agent-framework-devui 1.0.0b251016__py3-none-any.whl → 1.0.0b251104__py3-none-any.whl

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.

Potentially problematic release.


This version of agent-framework-devui might be problematic. Click here for more details.

@@ -1,577 +0,0 @@
1
- function H_(e,r){for(var o=0;o<r.length;o++){const a=r[o];if(typeof a!="string"&&!Array.isArray(a)){for(const l in a)if(l!=="default"&&!(l in e)){const u=Object.getOwnPropertyDescriptor(a,l);u&&Object.defineProperty(e,l,u.get?u:{enumerable:!0,get:()=>a[l]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))a(l);new MutationObserver(l=>{for(const u of l)if(u.type==="childList")for(const d of u.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&a(d)}).observe(document,{childList:!0,subtree:!0});function o(l){const u={};return l.integrity&&(u.integrity=l.integrity),l.referrerPolicy&&(u.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?u.credentials="include":l.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function a(l){if(l.ep)return;l.ep=!0;const u=o(l);fetch(l.href,u)}})();function qh(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Em={exports:{}},wi={};/**
2
- * @license React
3
- * react-jsx-runtime.production.js
4
- *
5
- * Copyright (c) Meta Platforms, Inc. and affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */var bv;function B_(){if(bv)return wi;bv=1;var e=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function o(a,l,u){var d=null;if(u!==void 0&&(d=""+u),l.key!==void 0&&(d=""+l.key),"key"in l){u={};for(var f in l)f!=="key"&&(u[f]=l[f])}else u=l;return l=u.ref,{$$typeof:e,type:a,key:d,ref:l!==void 0?l:null,props:u}}return wi.Fragment=r,wi.jsx=o,wi.jsxs=o,wi}var wv;function U_(){return wv||(wv=1,Em.exports=B_()),Em.exports}var i=U_(),_m={exports:{}},Le={};/**
10
- * @license React
11
- * react.production.js
12
- *
13
- * Copyright (c) Meta Platforms, Inc. and affiliates.
14
- *
15
- * This source code is licensed under the MIT license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- */var Nv;function P_(){if(Nv)return Le;Nv=1;var e=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),d=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),y=Symbol.iterator;function v(T){return T===null||typeof T!="object"?null:(T=y&&T[y]||T["@@iterator"],typeof T=="function"?T:null)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,w={};function j(T,U,X){this.props=T,this.context=U,this.refs=w,this.updater=X||b}j.prototype.isReactComponent={},j.prototype.setState=function(T,U){if(typeof T!="object"&&typeof T!="function"&&T!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,T,U,"setState")},j.prototype.forceUpdate=function(T){this.updater.enqueueForceUpdate(this,T,"forceUpdate")};function k(){}k.prototype=j.prototype;function M(T,U,X){this.props=T,this.context=U,this.refs=w,this.updater=X||b}var _=M.prototype=new k;_.constructor=M,S(_,j.prototype),_.isPureReactComponent=!0;var A=Array.isArray,D={H:null,A:null,T:null,S:null,V:null},L=Object.prototype.hasOwnProperty;function H(T,U,X,ee,ae,me){return X=me.ref,{$$typeof:e,type:T,key:U,ref:X!==void 0?X:null,props:me}}function B(T,U){return H(T.type,U,void 0,void 0,void 0,T.props)}function q(T){return typeof T=="object"&&T!==null&&T.$$typeof===e}function Z(T){var U={"=":"=0",":":"=2"};return"$"+T.replace(/[=:]/g,function(X){return U[X]})}var K=/\/+/g;function G(T,U){return typeof T=="object"&&T!==null&&T.key!=null?Z(""+T.key):U.toString(36)}function te(){}function I(T){switch(T.status){case"fulfilled":return T.value;case"rejected":throw T.reason;default:switch(typeof T.status=="string"?T.then(te,te):(T.status="pending",T.then(function(U){T.status==="pending"&&(T.status="fulfilled",T.value=U)},function(U){T.status==="pending"&&(T.status="rejected",T.reason=U)})),T.status){case"fulfilled":return T.value;case"rejected":throw T.reason}}throw T}function V(T,U,X,ee,ae){var me=typeof T;(me==="undefined"||me==="boolean")&&(T=null);var ue=!1;if(T===null)ue=!0;else switch(me){case"bigint":case"string":case"number":ue=!0;break;case"object":switch(T.$$typeof){case e:case r:ue=!0;break;case g:return ue=T._init,V(ue(T._payload),U,X,ee,ae)}}if(ue)return ae=ae(T),ue=ee===""?"."+G(T,0):ee,A(ae)?(X="",ue!=null&&(X=ue.replace(K,"$&/")+"/"),V(ae,U,X,"",function(pe){return pe})):ae!=null&&(q(ae)&&(ae=B(ae,X+(ae.key==null||T&&T.key===ae.key?"":(""+ae.key).replace(K,"$&/")+"/")+ue)),U.push(ae)),1;ue=0;var Q=ee===""?".":ee+":";if(A(T))for(var se=0;se<T.length;se++)ee=T[se],me=Q+G(ee,se),ue+=V(ee,U,X,me,ae);else if(se=v(T),typeof se=="function")for(T=se.call(T),se=0;!(ee=T.next()).done;)ee=ee.value,me=Q+G(ee,se++),ue+=V(ee,U,X,me,ae);else if(me==="object"){if(typeof T.then=="function")return V(I(T),U,X,ee,ae);throw U=String(T),Error("Objects are not valid as a React child (found: "+(U==="[object Object]"?"object with keys {"+Object.keys(T).join(", ")+"}":U)+"). If you meant to render a collection of children, use an array instead.")}return ue}function E(T,U,X){if(T==null)return T;var ee=[],ae=0;return V(T,ee,"","",function(me){return U.call(X,me,ae++)}),ee}function O(T){if(T._status===-1){var U=T._result;U=U(),U.then(function(X){(T._status===0||T._status===-1)&&(T._status=1,T._result=X)},function(X){(T._status===0||T._status===-1)&&(T._status=2,T._result=X)}),T._status===-1&&(T._status=0,T._result=U)}if(T._status===1)return T._result.default;throw T._result}var z=typeof reportError=="function"?reportError:function(T){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var U=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof T=="object"&&T!==null&&typeof T.message=="string"?String(T.message):String(T),error:T});if(!window.dispatchEvent(U))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",T);return}console.error(T)};function P(){}return Le.Children={map:E,forEach:function(T,U,X){E(T,function(){U.apply(this,arguments)},X)},count:function(T){var U=0;return E(T,function(){U++}),U},toArray:function(T){return E(T,function(U){return U})||[]},only:function(T){if(!q(T))throw Error("React.Children.only expected to receive a single React element child.");return T}},Le.Component=j,Le.Fragment=o,Le.Profiler=l,Le.PureComponent=M,Le.StrictMode=a,Le.Suspense=h,Le.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=D,Le.__COMPILER_RUNTIME={__proto__:null,c:function(T){return D.H.useMemoCache(T)}},Le.cache=function(T){return function(){return T.apply(null,arguments)}},Le.cloneElement=function(T,U,X){if(T==null)throw Error("The argument must be a React element, but you passed "+T+".");var ee=S({},T.props),ae=T.key,me=void 0;if(U!=null)for(ue in U.ref!==void 0&&(me=void 0),U.key!==void 0&&(ae=""+U.key),U)!L.call(U,ue)||ue==="key"||ue==="__self"||ue==="__source"||ue==="ref"&&U.ref===void 0||(ee[ue]=U[ue]);var ue=arguments.length-2;if(ue===1)ee.children=X;else if(1<ue){for(var Q=Array(ue),se=0;se<ue;se++)Q[se]=arguments[se+2];ee.children=Q}return H(T.type,ae,void 0,void 0,me,ee)},Le.createContext=function(T){return T={$$typeof:d,_currentValue:T,_currentValue2:T,_threadCount:0,Provider:null,Consumer:null},T.Provider=T,T.Consumer={$$typeof:u,_context:T},T},Le.createElement=function(T,U,X){var ee,ae={},me=null;if(U!=null)for(ee in U.key!==void 0&&(me=""+U.key),U)L.call(U,ee)&&ee!=="key"&&ee!=="__self"&&ee!=="__source"&&(ae[ee]=U[ee]);var ue=arguments.length-2;if(ue===1)ae.children=X;else if(1<ue){for(var Q=Array(ue),se=0;se<ue;se++)Q[se]=arguments[se+2];ae.children=Q}if(T&&T.defaultProps)for(ee in ue=T.defaultProps,ue)ae[ee]===void 0&&(ae[ee]=ue[ee]);return H(T,me,void 0,void 0,null,ae)},Le.createRef=function(){return{current:null}},Le.forwardRef=function(T){return{$$typeof:f,render:T}},Le.isValidElement=q,Le.lazy=function(T){return{$$typeof:g,_payload:{_status:-1,_result:T},_init:O}},Le.memo=function(T,U){return{$$typeof:p,type:T,compare:U===void 0?null:U}},Le.startTransition=function(T){var U=D.T,X={};D.T=X;try{var ee=T(),ae=D.S;ae!==null&&ae(X,ee),typeof ee=="object"&&ee!==null&&typeof ee.then=="function"&&ee.then(P,z)}catch(me){z(me)}finally{D.T=U}},Le.unstable_useCacheRefresh=function(){return D.H.useCacheRefresh()},Le.use=function(T){return D.H.use(T)},Le.useActionState=function(T,U,X){return D.H.useActionState(T,U,X)},Le.useCallback=function(T,U){return D.H.useCallback(T,U)},Le.useContext=function(T){return D.H.useContext(T)},Le.useDebugValue=function(){},Le.useDeferredValue=function(T,U){return D.H.useDeferredValue(T,U)},Le.useEffect=function(T,U,X){var ee=D.H;if(typeof X=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return ee.useEffect(T,U)},Le.useId=function(){return D.H.useId()},Le.useImperativeHandle=function(T,U,X){return D.H.useImperativeHandle(T,U,X)},Le.useInsertionEffect=function(T,U){return D.H.useInsertionEffect(T,U)},Le.useLayoutEffect=function(T,U){return D.H.useLayoutEffect(T,U)},Le.useMemo=function(T,U){return D.H.useMemo(T,U)},Le.useOptimistic=function(T,U){return D.H.useOptimistic(T,U)},Le.useReducer=function(T,U,X){return D.H.useReducer(T,U,X)},Le.useRef=function(T){return D.H.useRef(T)},Le.useState=function(T){return D.H.useState(T)},Le.useSyncExternalStore=function(T,U,X){return D.H.useSyncExternalStore(T,U,X)},Le.useTransition=function(){return D.H.useTransition()},Le.version="19.1.1",Le}var Sv;function Wi(){return Sv||(Sv=1,_m.exports=P_()),_m.exports}var N=Wi();const rn=qh(N),Eb=H_({__proto__:null,default:rn},[N]);var jm={exports:{}},Ni={},Cm={exports:{}},km={};/**
18
- * @license React
19
- * scheduler.production.js
20
- *
21
- * Copyright (c) Meta Platforms, Inc. and affiliates.
22
- *
23
- * This source code is licensed under the MIT license found in the
24
- * LICENSE file in the root directory of this source tree.
25
- */var Ev;function $_(){return Ev||(Ev=1,(function(e){function r(E,O){var z=E.length;E.push(O);e:for(;0<z;){var P=z-1>>>1,T=E[P];if(0<l(T,O))E[P]=O,E[z]=T,z=P;else break e}}function o(E){return E.length===0?null:E[0]}function a(E){if(E.length===0)return null;var O=E[0],z=E.pop();if(z!==O){E[0]=z;e:for(var P=0,T=E.length,U=T>>>1;P<U;){var X=2*(P+1)-1,ee=E[X],ae=X+1,me=E[ae];if(0>l(ee,z))ae<T&&0>l(me,ee)?(E[P]=me,E[ae]=z,P=ae):(E[P]=ee,E[X]=z,P=X);else if(ae<T&&0>l(me,z))E[P]=me,E[ae]=z,P=ae;else break e}}return O}function l(E,O){var z=E.sortIndex-O.sortIndex;return z!==0?z:E.id-O.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;e.unstable_now=function(){return u.now()}}else{var d=Date,f=d.now();e.unstable_now=function(){return d.now()-f}}var h=[],p=[],g=1,y=null,v=3,b=!1,S=!1,w=!1,j=!1,k=typeof setTimeout=="function"?setTimeout:null,M=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;function A(E){for(var O=o(p);O!==null;){if(O.callback===null)a(p);else if(O.startTime<=E)a(p),O.sortIndex=O.expirationTime,r(h,O);else break;O=o(p)}}function D(E){if(w=!1,A(E),!S)if(o(h)!==null)S=!0,L||(L=!0,G());else{var O=o(p);O!==null&&V(D,O.startTime-E)}}var L=!1,H=-1,B=5,q=-1;function Z(){return j?!0:!(e.unstable_now()-q<B)}function K(){if(j=!1,L){var E=e.unstable_now();q=E;var O=!0;try{e:{S=!1,w&&(w=!1,M(H),H=-1),b=!0;var z=v;try{t:{for(A(E),y=o(h);y!==null&&!(y.expirationTime>E&&Z());){var P=y.callback;if(typeof P=="function"){y.callback=null,v=y.priorityLevel;var T=P(y.expirationTime<=E);if(E=e.unstable_now(),typeof T=="function"){y.callback=T,A(E),O=!0;break t}y===o(h)&&a(h),A(E)}else a(h);y=o(h)}if(y!==null)O=!0;else{var U=o(p);U!==null&&V(D,U.startTime-E),O=!1}}break e}finally{y=null,v=z,b=!1}O=void 0}}finally{O?G():L=!1}}}var G;if(typeof _=="function")G=function(){_(K)};else if(typeof MessageChannel<"u"){var te=new MessageChannel,I=te.port2;te.port1.onmessage=K,G=function(){I.postMessage(null)}}else G=function(){k(K,0)};function V(E,O){H=k(function(){E(e.unstable_now())},O)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(E){E.callback=null},e.unstable_forceFrameRate=function(E){0>E||125<E?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):B=0<E?Math.floor(1e3/E):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_next=function(E){switch(v){case 1:case 2:case 3:var O=3;break;default:O=v}var z=v;v=O;try{return E()}finally{v=z}},e.unstable_requestPaint=function(){j=!0},e.unstable_runWithPriority=function(E,O){switch(E){case 1:case 2:case 3:case 4:case 5:break;default:E=3}var z=v;v=E;try{return O()}finally{v=z}},e.unstable_scheduleCallback=function(E,O,z){var P=e.unstable_now();switch(typeof z=="object"&&z!==null?(z=z.delay,z=typeof z=="number"&&0<z?P+z:P):z=P,E){case 1:var T=-1;break;case 2:T=250;break;case 5:T=1073741823;break;case 4:T=1e4;break;default:T=5e3}return T=z+T,E={id:g++,callback:O,priorityLevel:E,startTime:z,expirationTime:T,sortIndex:-1},z>P?(E.sortIndex=z,r(p,E),o(h)===null&&E===o(p)&&(w?(M(H),H=-1):w=!0,V(D,z-P))):(E.sortIndex=T,r(h,E),S||b||(S=!0,L||(L=!0,G()))),E},e.unstable_shouldYield=Z,e.unstable_wrapCallback=function(E){var O=v;return function(){var z=v;v=O;try{return E.apply(this,arguments)}finally{v=z}}}})(km)),km}var _v;function V_(){return _v||(_v=1,Cm.exports=$_()),Cm.exports}var Am={exports:{}},zt={};/**
26
- * @license React
27
- * react-dom.production.js
28
- *
29
- * Copyright (c) Meta Platforms, Inc. and affiliates.
30
- *
31
- * This source code is licensed under the MIT license found in the
32
- * LICENSE file in the root directory of this source tree.
33
- */var jv;function q_(){if(jv)return zt;jv=1;var e=Wi();function r(h){var p="https://react.dev/errors/"+h;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)p+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+h+"; visit "+p+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(){}var a={d:{f:o,r:function(){throw Error(r(522))},D:o,C:o,L:o,m:o,X:o,S:o,M:o},p:0,findDOMNode:null},l=Symbol.for("react.portal");function u(h,p,g){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:l,key:y==null?null:""+y,children:h,containerInfo:p,implementation:g}}var d=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(h,p){if(h==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return zt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,zt.createPortal=function(h,p){var g=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(r(299));return u(h,p,null,g)},zt.flushSync=function(h){var p=d.T,g=a.p;try{if(d.T=null,a.p=2,h)return h()}finally{d.T=p,a.p=g,a.d.f()}},zt.preconnect=function(h,p){typeof h=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,a.d.C(h,p))},zt.prefetchDNS=function(h){typeof h=="string"&&a.d.D(h)},zt.preinit=function(h,p){if(typeof h=="string"&&p&&typeof p.as=="string"){var g=p.as,y=f(g,p.crossOrigin),v=typeof p.integrity=="string"?p.integrity:void 0,b=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;g==="style"?a.d.S(h,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:y,integrity:v,fetchPriority:b}):g==="script"&&a.d.X(h,{crossOrigin:y,integrity:v,fetchPriority:b,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},zt.preinitModule=function(h,p){if(typeof h=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var g=f(p.as,p.crossOrigin);a.d.M(h,{crossOrigin:g,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0})}}else p==null&&a.d.M(h)},zt.preload=function(h,p){if(typeof h=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var g=p.as,y=f(g,p.crossOrigin);a.d.L(h,g,{crossOrigin:y,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,type:typeof p.type=="string"?p.type:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0,referrerPolicy:typeof p.referrerPolicy=="string"?p.referrerPolicy:void 0,imageSrcSet:typeof p.imageSrcSet=="string"?p.imageSrcSet:void 0,imageSizes:typeof p.imageSizes=="string"?p.imageSizes:void 0,media:typeof p.media=="string"?p.media:void 0})}},zt.preloadModule=function(h,p){if(typeof h=="string")if(p){var g=f(p.as,p.crossOrigin);a.d.m(h,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:g,integrity:typeof p.integrity=="string"?p.integrity:void 0})}else a.d.m(h)},zt.requestFormReset=function(h){a.d.r(h)},zt.unstable_batchedUpdates=function(h,p){return h(p)},zt.useFormState=function(h,p,g){return d.H.useFormState(h,p,g)},zt.useFormStatus=function(){return d.H.useHostTransitionStatus()},zt.version="19.1.1",zt}var Cv;function _b(){if(Cv)return Am.exports;Cv=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(r){console.error(r)}}return e(),Am.exports=q_(),Am.exports}/**
34
- * @license React
35
- * react-dom-client.production.js
36
- *
37
- * Copyright (c) Meta Platforms, Inc. and affiliates.
38
- *
39
- * This source code is licensed under the MIT license found in the
40
- * LICENSE file in the root directory of this source tree.
41
- */var kv;function Y_(){if(kv)return Ni;kv=1;var e=V_(),r=Wi(),o=_b();function a(t){var n="https://react.dev/errors/"+t;if(1<arguments.length){n+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)n+="&args[]="+encodeURIComponent(arguments[s])}return"Minified React error #"+t+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function l(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function u(t){var n=t,s=t;if(t.alternate)for(;n.return;)n=n.return;else{t=n;do n=t,(n.flags&4098)!==0&&(s=n.return),t=n.return;while(t)}return n.tag===3?s:null}function d(t){if(t.tag===13){var n=t.memoizedState;if(n===null&&(t=t.alternate,t!==null&&(n=t.memoizedState)),n!==null)return n.dehydrated}return null}function f(t){if(u(t)!==t)throw Error(a(188))}function h(t){var n=t.alternate;if(!n){if(n=u(t),n===null)throw Error(a(188));return n!==t?null:t}for(var s=t,c=n;;){var m=s.return;if(m===null)break;var x=m.alternate;if(x===null){if(c=m.return,c!==null){s=c;continue}break}if(m.child===x.child){for(x=m.child;x;){if(x===s)return f(m),t;if(x===c)return f(m),n;x=x.sibling}throw Error(a(188))}if(s.return!==c.return)s=m,c=x;else{for(var C=!1,R=m.child;R;){if(R===s){C=!0,s=m,c=x;break}if(R===c){C=!0,c=m,s=x;break}R=R.sibling}if(!C){for(R=x.child;R;){if(R===s){C=!0,s=x,c=m;break}if(R===c){C=!0,c=x,s=m;break}R=R.sibling}if(!C)throw Error(a(189))}}if(s.alternate!==c)throw Error(a(190))}if(s.tag!==3)throw Error(a(188));return s.stateNode.current===s?t:n}function p(t){var n=t.tag;if(n===5||n===26||n===27||n===6)return t;for(t=t.child;t!==null;){if(n=p(t),n!==null)return n;t=t.sibling}return null}var g=Object.assign,y=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),b=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),w=Symbol.for("react.strict_mode"),j=Symbol.for("react.profiler"),k=Symbol.for("react.provider"),M=Symbol.for("react.consumer"),_=Symbol.for("react.context"),A=Symbol.for("react.forward_ref"),D=Symbol.for("react.suspense"),L=Symbol.for("react.suspense_list"),H=Symbol.for("react.memo"),B=Symbol.for("react.lazy"),q=Symbol.for("react.activity"),Z=Symbol.for("react.memo_cache_sentinel"),K=Symbol.iterator;function G(t){return t===null||typeof t!="object"?null:(t=K&&t[K]||t["@@iterator"],typeof t=="function"?t:null)}var te=Symbol.for("react.client.reference");function I(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===te?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case S:return"Fragment";case j:return"Profiler";case w:return"StrictMode";case D:return"Suspense";case L:return"SuspenseList";case q:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case b:return"Portal";case _:return(t.displayName||"Context")+".Provider";case M:return(t._context.displayName||"Context")+".Consumer";case A:var n=t.render;return t=t.displayName,t||(t=n.displayName||n.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case H:return n=t.displayName||null,n!==null?n:I(t.type)||"Memo";case B:n=t._payload,t=t._init;try{return I(t(n))}catch{}}return null}var V=Array.isArray,E=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,O=o.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,z={pending:!1,data:null,method:null,action:null},P=[],T=-1;function U(t){return{current:t}}function X(t){0>T||(t.current=P[T],P[T]=null,T--)}function ee(t,n){T++,P[T]=t.current,t.current=n}var ae=U(null),me=U(null),ue=U(null),Q=U(null);function se(t,n){switch(ee(ue,n),ee(me,t),ee(ae,null),n.nodeType){case 9:case 11:t=(t=n.documentElement)&&(t=t.namespaceURI)?F0(t):0;break;default:if(t=n.tagName,n=n.namespaceURI)n=F0(n),t=Z0(n,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}X(ae),ee(ae,t)}function pe(){X(ae),X(me),X(ue)}function le(t){t.memoizedState!==null&&ee(Q,t);var n=ae.current,s=Z0(n,t.type);n!==s&&(ee(me,t),ee(ae,s))}function de(t){me.current===t&&(X(ae),X(me)),Q.current===t&&(X(Q),gi._currentValue=z)}var he=Object.prototype.hasOwnProperty,xe=e.unstable_scheduleCallback,ge=e.unstable_cancelCallback,Be=e.unstable_shouldYield,at=e.unstable_requestPaint,re=e.unstable_now,ve=e.unstable_getCurrentPriorityLevel,ke=e.unstable_ImmediatePriority,De=e.unstable_UserBlockingPriority,be=e.unstable_NormalPriority,Te=e.unstable_LowPriority,Ye=e.unstable_IdlePriority,it=e.log,Tn=e.unstable_setDisableYieldValue,Fe=null,Ue=null;function Qe(t){if(typeof it=="function"&&Tn(t),Ue&&typeof Ue.setStrictMode=="function")try{Ue.setStrictMode(Fe,t)}catch{}}var ht=Math.clz32?Math.clz32:dd,Ft=Math.log,gs=Math.LN2;function dd(t){return t>>>=0,t===0?32:31-(Ft(t)/gs|0)|0}var na=256,ra=4194304;function Wn(t){var n=t&42;if(n!==0)return n;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t&4194048;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function oa(t,n,s){var c=t.pendingLanes;if(c===0)return 0;var m=0,x=t.suspendedLanes,C=t.pingedLanes;t=t.warmLanes;var R=c&134217727;return R!==0?(c=R&~x,c!==0?m=Wn(c):(C&=R,C!==0?m=Wn(C):s||(s=R&~t,s!==0&&(m=Wn(s))))):(R=c&~x,R!==0?m=Wn(R):C!==0?m=Wn(C):s||(s=c&~t,s!==0&&(m=Wn(s)))),m===0?0:n!==0&&n!==m&&(n&x)===0&&(x=m&-m,s=n&-n,x>=s||x===32&&(s&4194048)!==0)?n:m}function xo(t,n){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&n)===0}function fd(t,n){switch(t){case 1:case 2:case 4:case 8:case 64:return n+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return n+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function dl(){var t=na;return na<<=1,(na&4194048)===0&&(na=256),t}function fl(){var t=ra;return ra<<=1,(ra&62914560)===0&&(ra=4194304),t}function xs(t){for(var n=[],s=0;31>s;s++)n.push(t);return n}function vo(t,n){t.pendingLanes|=n,n!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function md(t,n,s,c,m,x){var C=t.pendingLanes;t.pendingLanes=s,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=s,t.entangledLanes&=s,t.errorRecoveryDisabledLanes&=s,t.shellSuspendCounter=0;var R=t.entanglements,$=t.expirationTimes,J=t.hiddenUpdates;for(s=C&~s;0<s;){var ie=31-ht(s),fe=1<<ie;R[ie]=0,$[ie]=-1;var ne=J[ie];if(ne!==null)for(J[ie]=null,ie=0;ie<ne.length;ie++){var oe=ne[ie];oe!==null&&(oe.lane&=-536870913)}s&=~fe}c!==0&&ml(t,c,0),x!==0&&m===0&&t.tag!==0&&(t.suspendedLanes|=x&~(C&~n))}function ml(t,n,s){t.pendingLanes|=n,t.suspendedLanes&=~n;var c=31-ht(n);t.entangledLanes|=n,t.entanglements[c]=t.entanglements[c]|1073741824|s&4194090}function vs(t,n){var s=t.entangledLanes|=n;for(t=t.entanglements;s;){var c=31-ht(s),m=1<<c;m&n|t[c]&n&&(t[c]|=n),s&=~m}}function ys(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function bs(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function hl(){var t=O.p;return t!==0?t:(t=window.event,t===void 0?32:hv(t.type))}function hd(t,n){var s=O.p;try{return O.p=t,n()}finally{O.p=s}}var Rn=Math.random().toString(36).slice(2),Et="__reactFiber$"+Rn,Dt="__reactProps$"+Rn,Mr="__reactContainer$"+Rn,ws="__reactEvents$"+Rn,pd="__reactListeners$"+Rn,gd="__reactHandles$"+Rn,pl="__reactResources$"+Rn,yo="__reactMarker$"+Rn;function Ns(t){delete t[Et],delete t[Dt],delete t[ws],delete t[pd],delete t[gd]}function Tr(t){var n=t[Et];if(n)return n;for(var s=t.parentNode;s;){if(n=s[Mr]||s[Et]){if(s=n.alternate,n.child!==null||s!==null&&s.child!==null)for(t=J0(t);t!==null;){if(s=t[Et])return s;t=J0(t)}return n}t=s,s=t.parentNode}return null}function Qn(t){if(t=t[Et]||t[Mr]){var n=t.tag;if(n===5||n===6||n===13||n===26||n===27||n===3)return t}return null}function Rr(t){var n=t.tag;if(n===5||n===26||n===27||n===6)return t.stateNode;throw Error(a(33))}function Jn(t){var n=t[pl];return n||(n=t[pl]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function xt(t){t[yo]=!0}var gl=new Set,xl={};function er(t,n){Dr(t,n),Dr(t+"Capture",n)}function Dr(t,n){for(xl[t]=n,t=0;t<n.length;t++)gl.add(n[t])}var xd=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Ss={},vl={};function vd(t){return he.call(vl,t)?!0:he.call(Ss,t)?!1:xd.test(t)?vl[t]=!0:(Ss[t]=!0,!1)}function aa(t,n,s){if(vd(n))if(s===null)t.removeAttribute(n);else{switch(typeof s){case"undefined":case"function":case"symbol":t.removeAttribute(n);return;case"boolean":var c=n.toLowerCase().slice(0,5);if(c!=="data-"&&c!=="aria-"){t.removeAttribute(n);return}}t.setAttribute(n,""+s)}}function sa(t,n,s){if(s===null)t.removeAttribute(n);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(n);return}t.setAttribute(n,""+s)}}function vn(t,n,s,c){if(c===null)t.removeAttribute(s);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(s);return}t.setAttributeNS(n,s,""+c)}}var Es,yl;function tr(t){if(Es===void 0)try{throw Error()}catch(s){var n=s.stack.trim().match(/\n( *(at )?)/);Es=n&&n[1]||"",yl=-1<s.stack.indexOf(`
42
- at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
43
- `+Es+t+yl}var _s=!1;function js(t,n){if(!t||_s)return"";_s=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var c={DetermineComponentFrameRoot:function(){try{if(n){var fe=function(){throw Error()};if(Object.defineProperty(fe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(fe,[])}catch(oe){var ne=oe}Reflect.construct(t,[],fe)}else{try{fe.call()}catch(oe){ne=oe}t.call(fe.prototype)}}else{try{throw Error()}catch(oe){ne=oe}(fe=t())&&typeof fe.catch=="function"&&fe.catch(function(){})}}catch(oe){if(oe&&ne&&typeof oe.stack=="string")return[oe.stack,ne.stack]}return[null,null]}};c.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var m=Object.getOwnPropertyDescriptor(c.DetermineComponentFrameRoot,"name");m&&m.configurable&&Object.defineProperty(c.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var x=c.DetermineComponentFrameRoot(),C=x[0],R=x[1];if(C&&R){var $=C.split(`
44
- `),J=R.split(`
45
- `);for(m=c=0;c<$.length&&!$[c].includes("DetermineComponentFrameRoot");)c++;for(;m<J.length&&!J[m].includes("DetermineComponentFrameRoot");)m++;if(c===$.length||m===J.length)for(c=$.length-1,m=J.length-1;1<=c&&0<=m&&$[c]!==J[m];)m--;for(;1<=c&&0<=m;c--,m--)if($[c]!==J[m]){if(c!==1||m!==1)do if(c--,m--,0>m||$[c]!==J[m]){var ie=`
46
- `+$[c].replace(" at new "," at ");return t.displayName&&ie.includes("<anonymous>")&&(ie=ie.replace("<anonymous>",t.displayName)),ie}while(1<=c&&0<=m);break}}}finally{_s=!1,Error.prepareStackTrace=s}return(s=t?t.displayName||t.name:"")?tr(s):""}function yd(t){switch(t.tag){case 26:case 27:case 5:return tr(t.type);case 16:return tr("Lazy");case 13:return tr("Suspense");case 19:return tr("SuspenseList");case 0:case 15:return js(t.type,!1);case 11:return js(t.type.render,!1);case 1:return js(t.type,!0);case 31:return tr("Activity");default:return""}}function bl(t){try{var n="";do n+=yd(t),t=t.return;while(t);return n}catch(s){return`
47
- Error generating stack: `+s.message+`
48
- `+s.stack}}function Bt(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function wl(t){var n=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function bd(t){var n=wl(t)?"checked":"value",s=Object.getOwnPropertyDescriptor(t.constructor.prototype,n),c=""+t[n];if(!t.hasOwnProperty(n)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var m=s.get,x=s.set;return Object.defineProperty(t,n,{configurable:!0,get:function(){return m.call(this)},set:function(C){c=""+C,x.call(this,C)}}),Object.defineProperty(t,n,{enumerable:s.enumerable}),{getValue:function(){return c},setValue:function(C){c=""+C},stopTracking:function(){t._valueTracker=null,delete t[n]}}}}function ia(t){t._valueTracker||(t._valueTracker=bd(t))}function Cs(t){if(!t)return!1;var n=t._valueTracker;if(!n)return!0;var s=n.getValue(),c="";return t&&(c=wl(t)?t.checked?"true":"false":t.value),t=c,t!==s?(n.setValue(t),!0):!1}function la(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var wd=/[\n"\\]/g;function Ut(t){return t.replace(wd,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function bo(t,n,s,c,m,x,C,R){t.name="",C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"?t.type=C:t.removeAttribute("type"),n!=null?C==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+Bt(n)):t.value!==""+Bt(n)&&(t.value=""+Bt(n)):C!=="submit"&&C!=="reset"||t.removeAttribute("value"),n!=null?ks(t,C,Bt(n)):s!=null?ks(t,C,Bt(s)):c!=null&&t.removeAttribute("value"),m==null&&x!=null&&(t.defaultChecked=!!x),m!=null&&(t.checked=m&&typeof m!="function"&&typeof m!="symbol"),R!=null&&typeof R!="function"&&typeof R!="symbol"&&typeof R!="boolean"?t.name=""+Bt(R):t.removeAttribute("name")}function Nl(t,n,s,c,m,x,C,R){if(x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(t.type=x),n!=null||s!=null){if(!(x!=="submit"&&x!=="reset"||n!=null))return;s=s!=null?""+Bt(s):"",n=n!=null?""+Bt(n):s,R||n===t.value||(t.value=n),t.defaultValue=n}c=c??m,c=typeof c!="function"&&typeof c!="symbol"&&!!c,t.checked=R?t.checked:!!c,t.defaultChecked=!!c,C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"&&(t.name=C)}function ks(t,n,s){n==="number"&&la(t.ownerDocument)===t||t.defaultValue===""+s||(t.defaultValue=""+s)}function nr(t,n,s,c){if(t=t.options,n){n={};for(var m=0;m<s.length;m++)n["$"+s[m]]=!0;for(s=0;s<t.length;s++)m=n.hasOwnProperty("$"+t[s].value),t[s].selected!==m&&(t[s].selected=m),m&&c&&(t[s].defaultSelected=!0)}else{for(s=""+Bt(s),n=null,m=0;m<t.length;m++){if(t[m].value===s){t[m].selected=!0,c&&(t[m].defaultSelected=!0);return}n!==null||t[m].disabled||(n=t[m])}n!==null&&(n.selected=!0)}}function Gp(t,n,s){if(n!=null&&(n=""+Bt(n),n!==t.value&&(t.value=n),s==null)){t.defaultValue!==n&&(t.defaultValue=n);return}t.defaultValue=s!=null?""+Bt(s):""}function Xp(t,n,s,c){if(n==null){if(c!=null){if(s!=null)throw Error(a(92));if(V(c)){if(1<c.length)throw Error(a(93));c=c[0]}s=c}s==null&&(s=""),n=s}s=Bt(n),t.defaultValue=s,c=t.textContent,c===s&&c!==""&&c!==null&&(t.value=c)}function ca(t,n){if(n){var s=t.firstChild;if(s&&s===t.lastChild&&s.nodeType===3){s.nodeValue=n;return}}t.textContent=n}var zS=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Fp(t,n,s){var c=n.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?c?t.setProperty(n,""):n==="float"?t.cssFloat="":t[n]="":c?t.setProperty(n,s):typeof s!="number"||s===0||zS.has(n)?n==="float"?t.cssFloat=s:t[n]=(""+s).trim():t[n]=s+"px"}function Zp(t,n,s){if(n!=null&&typeof n!="object")throw Error(a(62));if(t=t.style,s!=null){for(var c in s)!s.hasOwnProperty(c)||n!=null&&n.hasOwnProperty(c)||(c.indexOf("--")===0?t.setProperty(c,""):c==="float"?t.cssFloat="":t[c]="");for(var m in n)c=n[m],n.hasOwnProperty(m)&&s[m]!==c&&Fp(t,m,c)}else for(var x in n)n.hasOwnProperty(x)&&Fp(t,x,n[x])}function Nd(t){if(t.indexOf("-")===-1)return!1;switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var LS=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),IS=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Sl(t){return IS.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}var Sd=null;function Ed(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var ua=null,da=null;function Kp(t){var n=Qn(t);if(n&&(t=n.stateNode)){var s=t[Dt]||null;e:switch(t=n.stateNode,n.type){case"input":if(bo(t,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name),n=s.name,s.type==="radio"&&n!=null){for(s=t;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll('input[name="'+Ut(""+n)+'"][type="radio"]'),n=0;n<s.length;n++){var c=s[n];if(c!==t&&c.form===t.form){var m=c[Dt]||null;if(!m)throw Error(a(90));bo(c,m.value,m.defaultValue,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name)}}for(n=0;n<s.length;n++)c=s[n],c.form===t.form&&Cs(c)}break e;case"textarea":Gp(t,s.value,s.defaultValue);break e;case"select":n=s.value,n!=null&&nr(t,!!s.multiple,n,!1)}}}var _d=!1;function Wp(t,n,s){if(_d)return t(n,s);_d=!0;try{var c=t(n);return c}finally{if(_d=!1,(ua!==null||da!==null)&&(lc(),ua&&(n=ua,t=da,da=ua=null,Kp(n),t)))for(n=0;n<t.length;n++)Kp(t[n])}}function As(t,n){var s=t.stateNode;if(s===null)return null;var c=s[Dt]||null;if(c===null)return null;s=c[n];e:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(c=!c.disabled)||(t=t.type,c=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!c;break e;default:t=!1}if(t)return null;if(s&&typeof s!="function")throw Error(a(231,n,typeof s));return s}var rr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),jd=!1;if(rr)try{var Ms={};Object.defineProperty(Ms,"passive",{get:function(){jd=!0}}),window.addEventListener("test",Ms,Ms),window.removeEventListener("test",Ms,Ms)}catch{jd=!1}var Or=null,Cd=null,El=null;function Qp(){if(El)return El;var t,n=Cd,s=n.length,c,m="value"in Or?Or.value:Or.textContent,x=m.length;for(t=0;t<s&&n[t]===m[t];t++);var C=s-t;for(c=1;c<=C&&n[s-c]===m[x-c];c++);return El=m.slice(t,1<c?1-c:void 0)}function _l(t){var n=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&n===13&&(t=13)):t=n,t===10&&(t=13),32<=t||t===13?t:0}function jl(){return!0}function Jp(){return!1}function Pt(t){function n(s,c,m,x,C){this._reactName=s,this._targetInst=m,this.type=c,this.nativeEvent=x,this.target=C,this.currentTarget=null;for(var R in t)t.hasOwnProperty(R)&&(s=t[R],this[R]=s?s(x):x[R]);return this.isDefaultPrevented=(x.defaultPrevented!=null?x.defaultPrevented:x.returnValue===!1)?jl:Jp,this.isPropagationStopped=Jp,this}return g(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=jl)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=jl)},persist:function(){},isPersistent:jl}),n}var wo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Cl=Pt(wo),Ts=g({},wo,{view:0,detail:0}),HS=Pt(Ts),kd,Ad,Rs,kl=g({},Ts,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Td,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==Rs&&(Rs&&t.type==="mousemove"?(kd=t.screenX-Rs.screenX,Ad=t.screenY-Rs.screenY):Ad=kd=0,Rs=t),kd)},movementY:function(t){return"movementY"in t?t.movementY:Ad}}),eg=Pt(kl),BS=g({},kl,{dataTransfer:0}),US=Pt(BS),PS=g({},Ts,{relatedTarget:0}),Md=Pt(PS),$S=g({},wo,{animationName:0,elapsedTime:0,pseudoElement:0}),VS=Pt($S),qS=g({},wo,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),YS=Pt(qS),GS=g({},wo,{data:0}),tg=Pt(GS),XS={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},FS={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},ZS={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function KS(t){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(t):(t=ZS[t])?!!n[t]:!1}function Td(){return KS}var WS=g({},Ts,{key:function(t){if(t.key){var n=XS[t.key]||t.key;if(n!=="Unidentified")return n}return t.type==="keypress"?(t=_l(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?FS[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Td,charCode:function(t){return t.type==="keypress"?_l(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?_l(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),QS=Pt(WS),JS=g({},kl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),ng=Pt(JS),eE=g({},Ts,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Td}),tE=Pt(eE),nE=g({},wo,{propertyName:0,elapsedTime:0,pseudoElement:0}),rE=Pt(nE),oE=g({},kl,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),aE=Pt(oE),sE=g({},wo,{newState:0,oldState:0}),iE=Pt(sE),lE=[9,13,27,32],Rd=rr&&"CompositionEvent"in window,Ds=null;rr&&"documentMode"in document&&(Ds=document.documentMode);var cE=rr&&"TextEvent"in window&&!Ds,rg=rr&&(!Rd||Ds&&8<Ds&&11>=Ds),og=" ",ag=!1;function sg(t,n){switch(t){case"keyup":return lE.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ig(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var fa=!1;function uE(t,n){switch(t){case"compositionend":return ig(n);case"keypress":return n.which!==32?null:(ag=!0,og);case"textInput":return t=n.data,t===og&&ag?null:t;default:return null}}function dE(t,n){if(fa)return t==="compositionend"||!Rd&&sg(t,n)?(t=Qp(),El=Cd=Or=null,fa=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return rg&&n.locale!=="ko"?null:n.data;default:return null}}var fE={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function lg(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n==="input"?!!fE[t.type]:n==="textarea"}function cg(t,n,s,c){ua?da?da.push(c):da=[c]:ua=c,n=hc(n,"onChange"),0<n.length&&(s=new Cl("onChange","change",null,s,c),t.push({event:s,listeners:n}))}var Os=null,zs=null;function mE(t){V0(t,0)}function Al(t){var n=Rr(t);if(Cs(n))return t}function ug(t,n){if(t==="change")return n}var dg=!1;if(rr){var Dd;if(rr){var Od="oninput"in document;if(!Od){var fg=document.createElement("div");fg.setAttribute("oninput","return;"),Od=typeof fg.oninput=="function"}Dd=Od}else Dd=!1;dg=Dd&&(!document.documentMode||9<document.documentMode)}function mg(){Os&&(Os.detachEvent("onpropertychange",hg),zs=Os=null)}function hg(t){if(t.propertyName==="value"&&Al(zs)){var n=[];cg(n,zs,t,Ed(t)),Wp(mE,n)}}function hE(t,n,s){t==="focusin"?(mg(),Os=n,zs=s,Os.attachEvent("onpropertychange",hg)):t==="focusout"&&mg()}function pE(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Al(zs)}function gE(t,n){if(t==="click")return Al(n)}function xE(t,n){if(t==="input"||t==="change")return Al(n)}function vE(t,n){return t===n&&(t!==0||1/t===1/n)||t!==t&&n!==n}var Zt=typeof Object.is=="function"?Object.is:vE;function Ls(t,n){if(Zt(t,n))return!0;if(typeof t!="object"||t===null||typeof n!="object"||n===null)return!1;var s=Object.keys(t),c=Object.keys(n);if(s.length!==c.length)return!1;for(c=0;c<s.length;c++){var m=s[c];if(!he.call(n,m)||!Zt(t[m],n[m]))return!1}return!0}function pg(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function gg(t,n){var s=pg(t);t=0;for(var c;s;){if(s.nodeType===3){if(c=t+s.textContent.length,t<=n&&c>=n)return{node:s,offset:n-t};t=c}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=pg(s)}}function xg(t,n){return t&&n?t===n?!0:t&&t.nodeType===3?!1:n&&n.nodeType===3?xg(t,n.parentNode):"contains"in t?t.contains(n):t.compareDocumentPosition?!!(t.compareDocumentPosition(n)&16):!1:!1}function vg(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var n=la(t.document);n instanceof t.HTMLIFrameElement;){try{var s=typeof n.contentWindow.location.href=="string"}catch{s=!1}if(s)t=n.contentWindow;else break;n=la(t.document)}return n}function zd(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n&&(n==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||n==="textarea"||t.contentEditable==="true")}var yE=rr&&"documentMode"in document&&11>=document.documentMode,ma=null,Ld=null,Is=null,Id=!1;function yg(t,n,s){var c=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;Id||ma==null||ma!==la(c)||(c=ma,"selectionStart"in c&&zd(c)?c={start:c.selectionStart,end:c.selectionEnd}:(c=(c.ownerDocument&&c.ownerDocument.defaultView||window).getSelection(),c={anchorNode:c.anchorNode,anchorOffset:c.anchorOffset,focusNode:c.focusNode,focusOffset:c.focusOffset}),Is&&Ls(Is,c)||(Is=c,c=hc(Ld,"onSelect"),0<c.length&&(n=new Cl("onSelect","select",null,n,s),t.push({event:n,listeners:c}),n.target=ma)))}function No(t,n){var s={};return s[t.toLowerCase()]=n.toLowerCase(),s["Webkit"+t]="webkit"+n,s["Moz"+t]="moz"+n,s}var ha={animationend:No("Animation","AnimationEnd"),animationiteration:No("Animation","AnimationIteration"),animationstart:No("Animation","AnimationStart"),transitionrun:No("Transition","TransitionRun"),transitionstart:No("Transition","TransitionStart"),transitioncancel:No("Transition","TransitionCancel"),transitionend:No("Transition","TransitionEnd")},Hd={},bg={};rr&&(bg=document.createElement("div").style,"AnimationEvent"in window||(delete ha.animationend.animation,delete ha.animationiteration.animation,delete ha.animationstart.animation),"TransitionEvent"in window||delete ha.transitionend.transition);function So(t){if(Hd[t])return Hd[t];if(!ha[t])return t;var n=ha[t],s;for(s in n)if(n.hasOwnProperty(s)&&s in bg)return Hd[t]=n[s];return t}var wg=So("animationend"),Ng=So("animationiteration"),Sg=So("animationstart"),bE=So("transitionrun"),wE=So("transitionstart"),NE=So("transitioncancel"),Eg=So("transitionend"),_g=new Map,Bd="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Bd.push("scrollEnd");function yn(t,n){_g.set(t,n),er(n,[t])}var jg=new WeakMap;function cn(t,n){if(typeof t=="object"&&t!==null){var s=jg.get(t);return s!==void 0?s:(n={value:t,source:n,stack:bl(n)},jg.set(t,n),n)}return{value:t,source:n,stack:bl(n)}}var un=[],pa=0,Ud=0;function Ml(){for(var t=pa,n=Ud=pa=0;n<t;){var s=un[n];un[n++]=null;var c=un[n];un[n++]=null;var m=un[n];un[n++]=null;var x=un[n];if(un[n++]=null,c!==null&&m!==null){var C=c.pending;C===null?m.next=m:(m.next=C.next,C.next=m),c.pending=m}x!==0&&Cg(s,m,x)}}function Tl(t,n,s,c){un[pa++]=t,un[pa++]=n,un[pa++]=s,un[pa++]=c,Ud|=c,t.lanes|=c,t=t.alternate,t!==null&&(t.lanes|=c)}function Pd(t,n,s,c){return Tl(t,n,s,c),Rl(t)}function ga(t,n){return Tl(t,null,null,n),Rl(t)}function Cg(t,n,s){t.lanes|=s;var c=t.alternate;c!==null&&(c.lanes|=s);for(var m=!1,x=t.return;x!==null;)x.childLanes|=s,c=x.alternate,c!==null&&(c.childLanes|=s),x.tag===22&&(t=x.stateNode,t===null||t._visibility&1||(m=!0)),t=x,x=x.return;return t.tag===3?(x=t.stateNode,m&&n!==null&&(m=31-ht(s),t=x.hiddenUpdates,c=t[m],c===null?t[m]=[n]:c.push(n),n.lane=s|536870912),x):null}function Rl(t){if(50<li)throw li=0,Ff=null,Error(a(185));for(var n=t.return;n!==null;)t=n,n=t.return;return t.tag===3?t.stateNode:null}var xa={};function SE(t,n,s,c){this.tag=t,this.key=s,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=c,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Kt(t,n,s,c){return new SE(t,n,s,c)}function $d(t){return t=t.prototype,!(!t||!t.isReactComponent)}function or(t,n){var s=t.alternate;return s===null?(s=Kt(t.tag,n,t.key,t.mode),s.elementType=t.elementType,s.type=t.type,s.stateNode=t.stateNode,s.alternate=t,t.alternate=s):(s.pendingProps=n,s.type=t.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=t.flags&65011712,s.childLanes=t.childLanes,s.lanes=t.lanes,s.child=t.child,s.memoizedProps=t.memoizedProps,s.memoizedState=t.memoizedState,s.updateQueue=t.updateQueue,n=t.dependencies,s.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},s.sibling=t.sibling,s.index=t.index,s.ref=t.ref,s.refCleanup=t.refCleanup,s}function kg(t,n){t.flags&=65011714;var s=t.alternate;return s===null?(t.childLanes=0,t.lanes=n,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=s.childLanes,t.lanes=s.lanes,t.child=s.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=s.memoizedProps,t.memoizedState=s.memoizedState,t.updateQueue=s.updateQueue,t.type=s.type,n=s.dependencies,t.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),t}function Dl(t,n,s,c,m,x){var C=0;if(c=t,typeof t=="function")$d(t)&&(C=1);else if(typeof t=="string")C=__(t,s,ae.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case q:return t=Kt(31,s,n,m),t.elementType=q,t.lanes=x,t;case S:return Eo(s.children,m,x,n);case w:C=8,m|=24;break;case j:return t=Kt(12,s,n,m|2),t.elementType=j,t.lanes=x,t;case D:return t=Kt(13,s,n,m),t.elementType=D,t.lanes=x,t;case L:return t=Kt(19,s,n,m),t.elementType=L,t.lanes=x,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case k:case _:C=10;break e;case M:C=9;break e;case A:C=11;break e;case H:C=14;break e;case B:C=16,c=null;break e}C=29,s=Error(a(130,t===null?"null":typeof t,"")),c=null}return n=Kt(C,s,n,m),n.elementType=t,n.type=c,n.lanes=x,n}function Eo(t,n,s,c){return t=Kt(7,t,c,n),t.lanes=s,t}function Vd(t,n,s){return t=Kt(6,t,null,n),t.lanes=s,t}function qd(t,n,s){return n=Kt(4,t.children!==null?t.children:[],t.key,n),n.lanes=s,n.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},n}var va=[],ya=0,Ol=null,zl=0,dn=[],fn=0,_o=null,ar=1,sr="";function jo(t,n){va[ya++]=zl,va[ya++]=Ol,Ol=t,zl=n}function Ag(t,n,s){dn[fn++]=ar,dn[fn++]=sr,dn[fn++]=_o,_o=t;var c=ar;t=sr;var m=32-ht(c)-1;c&=~(1<<m),s+=1;var x=32-ht(n)+m;if(30<x){var C=m-m%5;x=(c&(1<<C)-1).toString(32),c>>=C,m-=C,ar=1<<32-ht(n)+m|s<<m|c,sr=x+t}else ar=1<<x|s<<m|c,sr=t}function Yd(t){t.return!==null&&(jo(t,1),Ag(t,1,0))}function Gd(t){for(;t===Ol;)Ol=va[--ya],va[ya]=null,zl=va[--ya],va[ya]=null;for(;t===_o;)_o=dn[--fn],dn[fn]=null,sr=dn[--fn],dn[fn]=null,ar=dn[--fn],dn[fn]=null}var It=null,ft=null,We=!1,Co=null,Dn=!1,Xd=Error(a(519));function ko(t){var n=Error(a(418,""));throw Us(cn(n,t)),Xd}function Mg(t){var n=t.stateNode,s=t.type,c=t.memoizedProps;switch(n[Et]=t,n[Dt]=c,s){case"dialog":Ve("cancel",n),Ve("close",n);break;case"iframe":case"object":case"embed":Ve("load",n);break;case"video":case"audio":for(s=0;s<ui.length;s++)Ve(ui[s],n);break;case"source":Ve("error",n);break;case"img":case"image":case"link":Ve("error",n),Ve("load",n);break;case"details":Ve("toggle",n);break;case"input":Ve("invalid",n),Nl(n,c.value,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name,!0),ia(n);break;case"select":Ve("invalid",n);break;case"textarea":Ve("invalid",n),Xp(n,c.value,c.defaultValue,c.children),ia(n)}s=c.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||n.textContent===""+s||c.suppressHydrationWarning===!0||X0(n.textContent,s)?(c.popover!=null&&(Ve("beforetoggle",n),Ve("toggle",n)),c.onScroll!=null&&Ve("scroll",n),c.onScrollEnd!=null&&Ve("scrollend",n),c.onClick!=null&&(n.onclick=pc),n=!0):n=!1,n||ko(t)}function Tg(t){for(It=t.return;It;)switch(It.tag){case 5:case 13:Dn=!1;return;case 27:case 3:Dn=!0;return;default:It=It.return}}function Hs(t){if(t!==It)return!1;if(!We)return Tg(t),We=!0,!1;var n=t.tag,s;if((s=n!==3&&n!==27)&&((s=n===5)&&(s=t.type,s=!(s!=="form"&&s!=="button")||um(t.type,t.memoizedProps)),s=!s),s&&ft&&ko(t),Tg(t),n===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(a(317));e:{for(t=t.nextSibling,n=0;t;){if(t.nodeType===8)if(s=t.data,s==="/$"){if(n===0){ft=wn(t.nextSibling);break e}n--}else s!=="$"&&s!=="$!"&&s!=="$?"||n++;t=t.nextSibling}ft=null}}else n===27?(n=ft,Kr(t.type)?(t=hm,hm=null,ft=t):ft=n):ft=It?wn(t.stateNode.nextSibling):null;return!0}function Bs(){ft=It=null,We=!1}function Rg(){var t=Co;return t!==null&&(qt===null?qt=t:qt.push.apply(qt,t),Co=null),t}function Us(t){Co===null?Co=[t]:Co.push(t)}var Fd=U(null),Ao=null,ir=null;function zr(t,n,s){ee(Fd,n._currentValue),n._currentValue=s}function lr(t){t._currentValue=Fd.current,X(Fd)}function Zd(t,n,s){for(;t!==null;){var c=t.alternate;if((t.childLanes&n)!==n?(t.childLanes|=n,c!==null&&(c.childLanes|=n)):c!==null&&(c.childLanes&n)!==n&&(c.childLanes|=n),t===s)break;t=t.return}}function Kd(t,n,s,c){var m=t.child;for(m!==null&&(m.return=t);m!==null;){var x=m.dependencies;if(x!==null){var C=m.child;x=x.firstContext;e:for(;x!==null;){var R=x;x=m;for(var $=0;$<n.length;$++)if(R.context===n[$]){x.lanes|=s,R=x.alternate,R!==null&&(R.lanes|=s),Zd(x.return,s,t),c||(C=null);break e}x=R.next}}else if(m.tag===18){if(C=m.return,C===null)throw Error(a(341));C.lanes|=s,x=C.alternate,x!==null&&(x.lanes|=s),Zd(C,s,t),C=null}else C=m.child;if(C!==null)C.return=m;else for(C=m;C!==null;){if(C===t){C=null;break}if(m=C.sibling,m!==null){m.return=C.return,C=m;break}C=C.return}m=C}}function Ps(t,n,s,c){t=null;for(var m=n,x=!1;m!==null;){if(!x){if((m.flags&524288)!==0)x=!0;else if((m.flags&262144)!==0)break}if(m.tag===10){var C=m.alternate;if(C===null)throw Error(a(387));if(C=C.memoizedProps,C!==null){var R=m.type;Zt(m.pendingProps.value,C.value)||(t!==null?t.push(R):t=[R])}}else if(m===Q.current){if(C=m.alternate,C===null)throw Error(a(387));C.memoizedState.memoizedState!==m.memoizedState.memoizedState&&(t!==null?t.push(gi):t=[gi])}m=m.return}t!==null&&Kd(n,t,s,c),n.flags|=262144}function Ll(t){for(t=t.firstContext;t!==null;){if(!Zt(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function Mo(t){Ao=t,ir=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function Ot(t){return Dg(Ao,t)}function Il(t,n){return Ao===null&&Mo(t),Dg(t,n)}function Dg(t,n){var s=n._currentValue;if(n={context:n,memoizedValue:s,next:null},ir===null){if(t===null)throw Error(a(308));ir=n,t.dependencies={lanes:0,firstContext:n},t.flags|=524288}else ir=ir.next=n;return s}var EE=typeof AbortController<"u"?AbortController:function(){var t=[],n=this.signal={aborted:!1,addEventListener:function(s,c){t.push(c)}};this.abort=function(){n.aborted=!0,t.forEach(function(s){return s()})}},_E=e.unstable_scheduleCallback,jE=e.unstable_NormalPriority,wt={$$typeof:_,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Wd(){return{controller:new EE,data:new Map,refCount:0}}function $s(t){t.refCount--,t.refCount===0&&_E(jE,function(){t.controller.abort()})}var Vs=null,Qd=0,ba=0,wa=null;function CE(t,n){if(Vs===null){var s=Vs=[];Qd=0,ba=tm(),wa={status:"pending",value:void 0,then:function(c){s.push(c)}}}return Qd++,n.then(Og,Og),n}function Og(){if(--Qd===0&&Vs!==null){wa!==null&&(wa.status="fulfilled");var t=Vs;Vs=null,ba=0,wa=null;for(var n=0;n<t.length;n++)(0,t[n])()}}function kE(t,n){var s=[],c={status:"pending",value:null,reason:null,then:function(m){s.push(m)}};return t.then(function(){c.status="fulfilled",c.value=n;for(var m=0;m<s.length;m++)(0,s[m])(n)},function(m){for(c.status="rejected",c.reason=m,m=0;m<s.length;m++)(0,s[m])(void 0)}),c}var zg=E.S;E.S=function(t,n){typeof n=="object"&&n!==null&&typeof n.then=="function"&&CE(t,n),zg!==null&&zg(t,n)};var To=U(null);function Jd(){var t=To.current;return t!==null?t:st.pooledCache}function Hl(t,n){n===null?ee(To,To.current):ee(To,n.pool)}function Lg(){var t=Jd();return t===null?null:{parent:wt._currentValue,pool:t}}var qs=Error(a(460)),Ig=Error(a(474)),Bl=Error(a(542)),ef={then:function(){}};function Hg(t){return t=t.status,t==="fulfilled"||t==="rejected"}function Ul(){}function Bg(t,n,s){switch(s=t[s],s===void 0?t.push(n):s!==n&&(n.then(Ul,Ul),n=s),n.status){case"fulfilled":return n.value;case"rejected":throw t=n.reason,Pg(t),t;default:if(typeof n.status=="string")n.then(Ul,Ul);else{if(t=st,t!==null&&100<t.shellSuspendCounter)throw Error(a(482));t=n,t.status="pending",t.then(function(c){if(n.status==="pending"){var m=n;m.status="fulfilled",m.value=c}},function(c){if(n.status==="pending"){var m=n;m.status="rejected",m.reason=c}})}switch(n.status){case"fulfilled":return n.value;case"rejected":throw t=n.reason,Pg(t),t}throw Ys=n,qs}}var Ys=null;function Ug(){if(Ys===null)throw Error(a(459));var t=Ys;return Ys=null,t}function Pg(t){if(t===qs||t===Bl)throw Error(a(483))}var Lr=!1;function tf(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function nf(t,n){t=t.updateQueue,n.updateQueue===t&&(n.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function Ir(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Hr(t,n,s){var c=t.updateQueue;if(c===null)return null;if(c=c.shared,(Je&2)!==0){var m=c.pending;return m===null?n.next=n:(n.next=m.next,m.next=n),c.pending=n,n=Rl(t),Cg(t,null,s),n}return Tl(t,c,n,s),Rl(t)}function Gs(t,n,s){if(n=n.updateQueue,n!==null&&(n=n.shared,(s&4194048)!==0)){var c=n.lanes;c&=t.pendingLanes,s|=c,n.lanes=s,vs(t,s)}}function rf(t,n){var s=t.updateQueue,c=t.alternate;if(c!==null&&(c=c.updateQueue,s===c)){var m=null,x=null;if(s=s.firstBaseUpdate,s!==null){do{var C={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};x===null?m=x=C:x=x.next=C,s=s.next}while(s!==null);x===null?m=x=n:x=x.next=n}else m=x=n;s={baseState:c.baseState,firstBaseUpdate:m,lastBaseUpdate:x,shared:c.shared,callbacks:c.callbacks},t.updateQueue=s;return}t=s.lastBaseUpdate,t===null?s.firstBaseUpdate=n:t.next=n,s.lastBaseUpdate=n}var of=!1;function Xs(){if(of){var t=wa;if(t!==null)throw t}}function Fs(t,n,s,c){of=!1;var m=t.updateQueue;Lr=!1;var x=m.firstBaseUpdate,C=m.lastBaseUpdate,R=m.shared.pending;if(R!==null){m.shared.pending=null;var $=R,J=$.next;$.next=null,C===null?x=J:C.next=J,C=$;var ie=t.alternate;ie!==null&&(ie=ie.updateQueue,R=ie.lastBaseUpdate,R!==C&&(R===null?ie.firstBaseUpdate=J:R.next=J,ie.lastBaseUpdate=$))}if(x!==null){var fe=m.baseState;C=0,ie=J=$=null,R=x;do{var ne=R.lane&-536870913,oe=ne!==R.lane;if(oe?(Ge&ne)===ne:(c&ne)===ne){ne!==0&&ne===ba&&(of=!0),ie!==null&&(ie=ie.next={lane:0,tag:R.tag,payload:R.payload,callback:null,next:null});e:{var Re=t,Ae=R;ne=n;var rt=s;switch(Ae.tag){case 1:if(Re=Ae.payload,typeof Re=="function"){fe=Re.call(rt,fe,ne);break e}fe=Re;break e;case 3:Re.flags=Re.flags&-65537|128;case 0:if(Re=Ae.payload,ne=typeof Re=="function"?Re.call(rt,fe,ne):Re,ne==null)break e;fe=g({},fe,ne);break e;case 2:Lr=!0}}ne=R.callback,ne!==null&&(t.flags|=64,oe&&(t.flags|=8192),oe=m.callbacks,oe===null?m.callbacks=[ne]:oe.push(ne))}else oe={lane:ne,tag:R.tag,payload:R.payload,callback:R.callback,next:null},ie===null?(J=ie=oe,$=fe):ie=ie.next=oe,C|=ne;if(R=R.next,R===null){if(R=m.shared.pending,R===null)break;oe=R,R=oe.next,oe.next=null,m.lastBaseUpdate=oe,m.shared.pending=null}}while(!0);ie===null&&($=fe),m.baseState=$,m.firstBaseUpdate=J,m.lastBaseUpdate=ie,x===null&&(m.shared.lanes=0),Gr|=C,t.lanes=C,t.memoizedState=fe}}function $g(t,n){if(typeof t!="function")throw Error(a(191,t));t.call(n)}function Vg(t,n){var s=t.callbacks;if(s!==null)for(t.callbacks=null,t=0;t<s.length;t++)$g(s[t],n)}var Na=U(null),Pl=U(0);function qg(t,n){t=pr,ee(Pl,t),ee(Na,n),pr=t|n.baseLanes}function af(){ee(Pl,pr),ee(Na,Na.current)}function sf(){pr=Pl.current,X(Na),X(Pl)}var Br=0,Ie=null,tt=null,vt=null,$l=!1,Sa=!1,Ro=!1,Vl=0,Zs=0,Ea=null,AE=0;function pt(){throw Error(a(321))}function lf(t,n){if(n===null)return!1;for(var s=0;s<n.length&&s<t.length;s++)if(!Zt(t[s],n[s]))return!1;return!0}function cf(t,n,s,c,m,x){return Br=x,Ie=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,E.H=t===null||t.memoizedState===null?Cx:kx,Ro=!1,x=s(c,m),Ro=!1,Sa&&(x=Gg(n,s,c,m)),Yg(t),x}function Yg(t){E.H=Zl;var n=tt!==null&&tt.next!==null;if(Br=0,vt=tt=Ie=null,$l=!1,Zs=0,Ea=null,n)throw Error(a(300));t===null||_t||(t=t.dependencies,t!==null&&Ll(t)&&(_t=!0))}function Gg(t,n,s,c){Ie=t;var m=0;do{if(Sa&&(Ea=null),Zs=0,Sa=!1,25<=m)throw Error(a(301));if(m+=1,vt=tt=null,t.updateQueue!=null){var x=t.updateQueue;x.lastEffect=null,x.events=null,x.stores=null,x.memoCache!=null&&(x.memoCache.index=0)}E.H=LE,x=n(s,c)}while(Sa);return x}function ME(){var t=E.H,n=t.useState()[0];return n=typeof n.then=="function"?Ks(n):n,t=t.useState()[0],(tt!==null?tt.memoizedState:null)!==t&&(Ie.flags|=1024),n}function uf(){var t=Vl!==0;return Vl=0,t}function df(t,n,s){n.updateQueue=t.updateQueue,n.flags&=-2053,t.lanes&=~s}function ff(t){if($l){for(t=t.memoizedState;t!==null;){var n=t.queue;n!==null&&(n.pending=null),t=t.next}$l=!1}Br=0,vt=tt=Ie=null,Sa=!1,Zs=Vl=0,Ea=null}function $t(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return vt===null?Ie.memoizedState=vt=t:vt=vt.next=t,vt}function yt(){if(tt===null){var t=Ie.alternate;t=t!==null?t.memoizedState:null}else t=tt.next;var n=vt===null?Ie.memoizedState:vt.next;if(n!==null)vt=n,tt=t;else{if(t===null)throw Ie.alternate===null?Error(a(467)):Error(a(310));tt=t,t={memoizedState:tt.memoizedState,baseState:tt.baseState,baseQueue:tt.baseQueue,queue:tt.queue,next:null},vt===null?Ie.memoizedState=vt=t:vt=vt.next=t}return vt}function mf(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ks(t){var n=Zs;return Zs+=1,Ea===null&&(Ea=[]),t=Bg(Ea,t,n),n=Ie,(vt===null?n.memoizedState:vt.next)===null&&(n=n.alternate,E.H=n===null||n.memoizedState===null?Cx:kx),t}function ql(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return Ks(t);if(t.$$typeof===_)return Ot(t)}throw Error(a(438,String(t)))}function hf(t){var n=null,s=Ie.updateQueue;if(s!==null&&(n=s.memoCache),n==null){var c=Ie.alternate;c!==null&&(c=c.updateQueue,c!==null&&(c=c.memoCache,c!=null&&(n={data:c.data.map(function(m){return m.slice()}),index:0})))}if(n==null&&(n={data:[],index:0}),s===null&&(s=mf(),Ie.updateQueue=s),s.memoCache=n,s=n.data[n.index],s===void 0)for(s=n.data[n.index]=Array(t),c=0;c<t;c++)s[c]=Z;return n.index++,s}function cr(t,n){return typeof n=="function"?n(t):n}function Yl(t){var n=yt();return pf(n,tt,t)}function pf(t,n,s){var c=t.queue;if(c===null)throw Error(a(311));c.lastRenderedReducer=s;var m=t.baseQueue,x=c.pending;if(x!==null){if(m!==null){var C=m.next;m.next=x.next,x.next=C}n.baseQueue=m=x,c.pending=null}if(x=t.baseState,m===null)t.memoizedState=x;else{n=m.next;var R=C=null,$=null,J=n,ie=!1;do{var fe=J.lane&-536870913;if(fe!==J.lane?(Ge&fe)===fe:(Br&fe)===fe){var ne=J.revertLane;if(ne===0)$!==null&&($=$.next={lane:0,revertLane:0,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null}),fe===ba&&(ie=!0);else if((Br&ne)===ne){J=J.next,ne===ba&&(ie=!0);continue}else fe={lane:0,revertLane:J.revertLane,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null},$===null?(R=$=fe,C=x):$=$.next=fe,Ie.lanes|=ne,Gr|=ne;fe=J.action,Ro&&s(x,fe),x=J.hasEagerState?J.eagerState:s(x,fe)}else ne={lane:fe,revertLane:J.revertLane,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null},$===null?(R=$=ne,C=x):$=$.next=ne,Ie.lanes|=fe,Gr|=fe;J=J.next}while(J!==null&&J!==n);if($===null?C=x:$.next=R,!Zt(x,t.memoizedState)&&(_t=!0,ie&&(s=wa,s!==null)))throw s;t.memoizedState=x,t.baseState=C,t.baseQueue=$,c.lastRenderedState=x}return m===null&&(c.lanes=0),[t.memoizedState,c.dispatch]}function gf(t){var n=yt(),s=n.queue;if(s===null)throw Error(a(311));s.lastRenderedReducer=t;var c=s.dispatch,m=s.pending,x=n.memoizedState;if(m!==null){s.pending=null;var C=m=m.next;do x=t(x,C.action),C=C.next;while(C!==m);Zt(x,n.memoizedState)||(_t=!0),n.memoizedState=x,n.baseQueue===null&&(n.baseState=x),s.lastRenderedState=x}return[x,c]}function Xg(t,n,s){var c=Ie,m=yt(),x=We;if(x){if(s===void 0)throw Error(a(407));s=s()}else s=n();var C=!Zt((tt||m).memoizedState,s);C&&(m.memoizedState=s,_t=!0),m=m.queue;var R=Kg.bind(null,c,m,t);if(Ws(2048,8,R,[t]),m.getSnapshot!==n||C||vt!==null&&vt.memoizedState.tag&1){if(c.flags|=2048,_a(9,Gl(),Zg.bind(null,c,m,s,n),null),st===null)throw Error(a(349));x||(Br&124)!==0||Fg(c,n,s)}return s}function Fg(t,n,s){t.flags|=16384,t={getSnapshot:n,value:s},n=Ie.updateQueue,n===null?(n=mf(),Ie.updateQueue=n,n.stores=[t]):(s=n.stores,s===null?n.stores=[t]:s.push(t))}function Zg(t,n,s,c){n.value=s,n.getSnapshot=c,Wg(n)&&Qg(t)}function Kg(t,n,s){return s(function(){Wg(n)&&Qg(t)})}function Wg(t){var n=t.getSnapshot;t=t.value;try{var s=n();return!Zt(t,s)}catch{return!0}}function Qg(t){var n=ga(t,2);n!==null&&tn(n,t,2)}function xf(t){var n=$t();if(typeof t=="function"){var s=t;if(t=s(),Ro){Qe(!0);try{s()}finally{Qe(!1)}}}return n.memoizedState=n.baseState=t,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:cr,lastRenderedState:t},n}function Jg(t,n,s,c){return t.baseState=s,pf(t,tt,typeof c=="function"?c:cr)}function TE(t,n,s,c,m){if(Fl(t))throw Error(a(485));if(t=n.action,t!==null){var x={payload:m,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(C){x.listeners.push(C)}};E.T!==null?s(!0):x.isTransition=!1,c(x),s=n.pending,s===null?(x.next=n.pending=x,ex(n,x)):(x.next=s.next,n.pending=s.next=x)}}function ex(t,n){var s=n.action,c=n.payload,m=t.state;if(n.isTransition){var x=E.T,C={};E.T=C;try{var R=s(m,c),$=E.S;$!==null&&$(C,R),tx(t,n,R)}catch(J){vf(t,n,J)}finally{E.T=x}}else try{x=s(m,c),tx(t,n,x)}catch(J){vf(t,n,J)}}function tx(t,n,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(c){nx(t,n,c)},function(c){return vf(t,n,c)}):nx(t,n,s)}function nx(t,n,s){n.status="fulfilled",n.value=s,rx(n),t.state=s,n=t.pending,n!==null&&(s=n.next,s===n?t.pending=null:(s=s.next,n.next=s,ex(t,s)))}function vf(t,n,s){var c=t.pending;if(t.pending=null,c!==null){c=c.next;do n.status="rejected",n.reason=s,rx(n),n=n.next;while(n!==c)}t.action=null}function rx(t){t=t.listeners;for(var n=0;n<t.length;n++)(0,t[n])()}function ox(t,n){return n}function ax(t,n){if(We){var s=st.formState;if(s!==null){e:{var c=Ie;if(We){if(ft){t:{for(var m=ft,x=Dn;m.nodeType!==8;){if(!x){m=null;break t}if(m=wn(m.nextSibling),m===null){m=null;break t}}x=m.data,m=x==="F!"||x==="F"?m:null}if(m){ft=wn(m.nextSibling),c=m.data==="F!";break e}}ko(c)}c=!1}c&&(n=s[0])}}return s=$t(),s.memoizedState=s.baseState=n,c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ox,lastRenderedState:n},s.queue=c,s=Ex.bind(null,Ie,c),c.dispatch=s,c=xf(!1),x=Sf.bind(null,Ie,!1,c.queue),c=$t(),m={state:n,dispatch:null,action:t,pending:null},c.queue=m,s=TE.bind(null,Ie,m,x,s),m.dispatch=s,c.memoizedState=t,[n,s,!1]}function sx(t){var n=yt();return ix(n,tt,t)}function ix(t,n,s){if(n=pf(t,n,ox)[0],t=Yl(cr)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var c=Ks(n)}catch(C){throw C===qs?Bl:C}else c=n;n=yt();var m=n.queue,x=m.dispatch;return s!==n.memoizedState&&(Ie.flags|=2048,_a(9,Gl(),RE.bind(null,m,s),null)),[c,x,t]}function RE(t,n){t.action=n}function lx(t){var n=yt(),s=tt;if(s!==null)return ix(n,s,t);yt(),n=n.memoizedState,s=yt();var c=s.queue.dispatch;return s.memoizedState=t,[n,c,!1]}function _a(t,n,s,c){return t={tag:t,create:s,deps:c,inst:n,next:null},n=Ie.updateQueue,n===null&&(n=mf(),Ie.updateQueue=n),s=n.lastEffect,s===null?n.lastEffect=t.next=t:(c=s.next,s.next=t,t.next=c,n.lastEffect=t),t}function Gl(){return{destroy:void 0,resource:void 0}}function cx(){return yt().memoizedState}function Xl(t,n,s,c){var m=$t();c=c===void 0?null:c,Ie.flags|=t,m.memoizedState=_a(1|n,Gl(),s,c)}function Ws(t,n,s,c){var m=yt();c=c===void 0?null:c;var x=m.memoizedState.inst;tt!==null&&c!==null&&lf(c,tt.memoizedState.deps)?m.memoizedState=_a(n,x,s,c):(Ie.flags|=t,m.memoizedState=_a(1|n,x,s,c))}function ux(t,n){Xl(8390656,8,t,n)}function dx(t,n){Ws(2048,8,t,n)}function fx(t,n){return Ws(4,2,t,n)}function mx(t,n){return Ws(4,4,t,n)}function hx(t,n){if(typeof n=="function"){t=t();var s=n(t);return function(){typeof s=="function"?s():n(null)}}if(n!=null)return t=t(),n.current=t,function(){n.current=null}}function px(t,n,s){s=s!=null?s.concat([t]):null,Ws(4,4,hx.bind(null,n,t),s)}function yf(){}function gx(t,n){var s=yt();n=n===void 0?null:n;var c=s.memoizedState;return n!==null&&lf(n,c[1])?c[0]:(s.memoizedState=[t,n],t)}function xx(t,n){var s=yt();n=n===void 0?null:n;var c=s.memoizedState;if(n!==null&&lf(n,c[1]))return c[0];if(c=t(),Ro){Qe(!0);try{t()}finally{Qe(!1)}}return s.memoizedState=[c,n],c}function bf(t,n,s){return s===void 0||(Br&1073741824)!==0?t.memoizedState=n:(t.memoizedState=s,t=b0(),Ie.lanes|=t,Gr|=t,s)}function vx(t,n,s,c){return Zt(s,n)?s:Na.current!==null?(t=bf(t,s,c),Zt(t,n)||(_t=!0),t):(Br&42)===0?(_t=!0,t.memoizedState=s):(t=b0(),Ie.lanes|=t,Gr|=t,n)}function yx(t,n,s,c,m){var x=O.p;O.p=x!==0&&8>x?x:8;var C=E.T,R={};E.T=R,Sf(t,!1,n,s);try{var $=m(),J=E.S;if(J!==null&&J(R,$),$!==null&&typeof $=="object"&&typeof $.then=="function"){var ie=kE($,c);Qs(t,n,ie,en(t))}else Qs(t,n,c,en(t))}catch(fe){Qs(t,n,{then:function(){},status:"rejected",reason:fe},en())}finally{O.p=x,E.T=C}}function DE(){}function wf(t,n,s,c){if(t.tag!==5)throw Error(a(476));var m=bx(t).queue;yx(t,m,n,z,s===null?DE:function(){return wx(t),s(c)})}function bx(t){var n=t.memoizedState;if(n!==null)return n;n={memoizedState:z,baseState:z,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:cr,lastRenderedState:z},next:null};var s={};return n.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:cr,lastRenderedState:s},next:null},t.memoizedState=n,t=t.alternate,t!==null&&(t.memoizedState=n),n}function wx(t){var n=bx(t).next.queue;Qs(t,n,{},en())}function Nf(){return Ot(gi)}function Nx(){return yt().memoizedState}function Sx(){return yt().memoizedState}function OE(t){for(var n=t.return;n!==null;){switch(n.tag){case 24:case 3:var s=en();t=Ir(s);var c=Hr(n,t,s);c!==null&&(tn(c,n,s),Gs(c,n,s)),n={cache:Wd()},t.payload=n;return}n=n.return}}function zE(t,n,s){var c=en();s={lane:c,revertLane:0,action:s,hasEagerState:!1,eagerState:null,next:null},Fl(t)?_x(n,s):(s=Pd(t,n,s,c),s!==null&&(tn(s,t,c),jx(s,n,c)))}function Ex(t,n,s){var c=en();Qs(t,n,s,c)}function Qs(t,n,s,c){var m={lane:c,revertLane:0,action:s,hasEagerState:!1,eagerState:null,next:null};if(Fl(t))_x(n,m);else{var x=t.alternate;if(t.lanes===0&&(x===null||x.lanes===0)&&(x=n.lastRenderedReducer,x!==null))try{var C=n.lastRenderedState,R=x(C,s);if(m.hasEagerState=!0,m.eagerState=R,Zt(R,C))return Tl(t,n,m,0),st===null&&Ml(),!1}catch{}finally{}if(s=Pd(t,n,m,c),s!==null)return tn(s,t,c),jx(s,n,c),!0}return!1}function Sf(t,n,s,c){if(c={lane:2,revertLane:tm(),action:c,hasEagerState:!1,eagerState:null,next:null},Fl(t)){if(n)throw Error(a(479))}else n=Pd(t,s,c,2),n!==null&&tn(n,t,2)}function Fl(t){var n=t.alternate;return t===Ie||n!==null&&n===Ie}function _x(t,n){Sa=$l=!0;var s=t.pending;s===null?n.next=n:(n.next=s.next,s.next=n),t.pending=n}function jx(t,n,s){if((s&4194048)!==0){var c=n.lanes;c&=t.pendingLanes,s|=c,n.lanes=s,vs(t,s)}}var Zl={readContext:Ot,use:ql,useCallback:pt,useContext:pt,useEffect:pt,useImperativeHandle:pt,useLayoutEffect:pt,useInsertionEffect:pt,useMemo:pt,useReducer:pt,useRef:pt,useState:pt,useDebugValue:pt,useDeferredValue:pt,useTransition:pt,useSyncExternalStore:pt,useId:pt,useHostTransitionStatus:pt,useFormState:pt,useActionState:pt,useOptimistic:pt,useMemoCache:pt,useCacheRefresh:pt},Cx={readContext:Ot,use:ql,useCallback:function(t,n){return $t().memoizedState=[t,n===void 0?null:n],t},useContext:Ot,useEffect:ux,useImperativeHandle:function(t,n,s){s=s!=null?s.concat([t]):null,Xl(4194308,4,hx.bind(null,n,t),s)},useLayoutEffect:function(t,n){return Xl(4194308,4,t,n)},useInsertionEffect:function(t,n){Xl(4,2,t,n)},useMemo:function(t,n){var s=$t();n=n===void 0?null:n;var c=t();if(Ro){Qe(!0);try{t()}finally{Qe(!1)}}return s.memoizedState=[c,n],c},useReducer:function(t,n,s){var c=$t();if(s!==void 0){var m=s(n);if(Ro){Qe(!0);try{s(n)}finally{Qe(!1)}}}else m=n;return c.memoizedState=c.baseState=m,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:m},c.queue=t,t=t.dispatch=zE.bind(null,Ie,t),[c.memoizedState,t]},useRef:function(t){var n=$t();return t={current:t},n.memoizedState=t},useState:function(t){t=xf(t);var n=t.queue,s=Ex.bind(null,Ie,n);return n.dispatch=s,[t.memoizedState,s]},useDebugValue:yf,useDeferredValue:function(t,n){var s=$t();return bf(s,t,n)},useTransition:function(){var t=xf(!1);return t=yx.bind(null,Ie,t.queue,!0,!1),$t().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,n,s){var c=Ie,m=$t();if(We){if(s===void 0)throw Error(a(407));s=s()}else{if(s=n(),st===null)throw Error(a(349));(Ge&124)!==0||Fg(c,n,s)}m.memoizedState=s;var x={value:s,getSnapshot:n};return m.queue=x,ux(Kg.bind(null,c,x,t),[t]),c.flags|=2048,_a(9,Gl(),Zg.bind(null,c,x,s,n),null),s},useId:function(){var t=$t(),n=st.identifierPrefix;if(We){var s=sr,c=ar;s=(c&~(1<<32-ht(c)-1)).toString(32)+s,n="«"+n+"R"+s,s=Vl++,0<s&&(n+="H"+s.toString(32)),n+="»"}else s=AE++,n="«"+n+"r"+s.toString(32)+"»";return t.memoizedState=n},useHostTransitionStatus:Nf,useFormState:ax,useActionState:ax,useOptimistic:function(t){var n=$t();n.memoizedState=n.baseState=t;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=s,n=Sf.bind(null,Ie,!0,s),s.dispatch=n,[t,n]},useMemoCache:hf,useCacheRefresh:function(){return $t().memoizedState=OE.bind(null,Ie)}},kx={readContext:Ot,use:ql,useCallback:gx,useContext:Ot,useEffect:dx,useImperativeHandle:px,useInsertionEffect:fx,useLayoutEffect:mx,useMemo:xx,useReducer:Yl,useRef:cx,useState:function(){return Yl(cr)},useDebugValue:yf,useDeferredValue:function(t,n){var s=yt();return vx(s,tt.memoizedState,t,n)},useTransition:function(){var t=Yl(cr)[0],n=yt().memoizedState;return[typeof t=="boolean"?t:Ks(t),n]},useSyncExternalStore:Xg,useId:Nx,useHostTransitionStatus:Nf,useFormState:sx,useActionState:sx,useOptimistic:function(t,n){var s=yt();return Jg(s,tt,t,n)},useMemoCache:hf,useCacheRefresh:Sx},LE={readContext:Ot,use:ql,useCallback:gx,useContext:Ot,useEffect:dx,useImperativeHandle:px,useInsertionEffect:fx,useLayoutEffect:mx,useMemo:xx,useReducer:gf,useRef:cx,useState:function(){return gf(cr)},useDebugValue:yf,useDeferredValue:function(t,n){var s=yt();return tt===null?bf(s,t,n):vx(s,tt.memoizedState,t,n)},useTransition:function(){var t=gf(cr)[0],n=yt().memoizedState;return[typeof t=="boolean"?t:Ks(t),n]},useSyncExternalStore:Xg,useId:Nx,useHostTransitionStatus:Nf,useFormState:lx,useActionState:lx,useOptimistic:function(t,n){var s=yt();return tt!==null?Jg(s,tt,t,n):(s.baseState=t,[t,s.queue.dispatch])},useMemoCache:hf,useCacheRefresh:Sx},ja=null,Js=0;function Kl(t){var n=Js;return Js+=1,ja===null&&(ja=[]),Bg(ja,t,n)}function ei(t,n){n=n.props.ref,t.ref=n!==void 0?n:null}function Wl(t,n){throw n.$$typeof===y?Error(a(525)):(t=Object.prototype.toString.call(n),Error(a(31,t==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":t)))}function Ax(t){var n=t._init;return n(t._payload)}function Mx(t){function n(F,Y){if(t){var W=F.deletions;W===null?(F.deletions=[Y],F.flags|=16):W.push(Y)}}function s(F,Y){if(!t)return null;for(;Y!==null;)n(F,Y),Y=Y.sibling;return null}function c(F){for(var Y=new Map;F!==null;)F.key!==null?Y.set(F.key,F):Y.set(F.index,F),F=F.sibling;return Y}function m(F,Y){return F=or(F,Y),F.index=0,F.sibling=null,F}function x(F,Y,W){return F.index=W,t?(W=F.alternate,W!==null?(W=W.index,W<Y?(F.flags|=67108866,Y):W):(F.flags|=67108866,Y)):(F.flags|=1048576,Y)}function C(F){return t&&F.alternate===null&&(F.flags|=67108866),F}function R(F,Y,W,ce){return Y===null||Y.tag!==6?(Y=Vd(W,F.mode,ce),Y.return=F,Y):(Y=m(Y,W),Y.return=F,Y)}function $(F,Y,W,ce){var we=W.type;return we===S?ie(F,Y,W.props.children,ce,W.key):Y!==null&&(Y.elementType===we||typeof we=="object"&&we!==null&&we.$$typeof===B&&Ax(we)===Y.type)?(Y=m(Y,W.props),ei(Y,W),Y.return=F,Y):(Y=Dl(W.type,W.key,W.props,null,F.mode,ce),ei(Y,W),Y.return=F,Y)}function J(F,Y,W,ce){return Y===null||Y.tag!==4||Y.stateNode.containerInfo!==W.containerInfo||Y.stateNode.implementation!==W.implementation?(Y=qd(W,F.mode,ce),Y.return=F,Y):(Y=m(Y,W.children||[]),Y.return=F,Y)}function ie(F,Y,W,ce,we){return Y===null||Y.tag!==7?(Y=Eo(W,F.mode,ce,we),Y.return=F,Y):(Y=m(Y,W),Y.return=F,Y)}function fe(F,Y,W){if(typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint")return Y=Vd(""+Y,F.mode,W),Y.return=F,Y;if(typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case v:return W=Dl(Y.type,Y.key,Y.props,null,F.mode,W),ei(W,Y),W.return=F,W;case b:return Y=qd(Y,F.mode,W),Y.return=F,Y;case B:var ce=Y._init;return Y=ce(Y._payload),fe(F,Y,W)}if(V(Y)||G(Y))return Y=Eo(Y,F.mode,W,null),Y.return=F,Y;if(typeof Y.then=="function")return fe(F,Kl(Y),W);if(Y.$$typeof===_)return fe(F,Il(F,Y),W);Wl(F,Y)}return null}function ne(F,Y,W,ce){var we=Y!==null?Y.key:null;if(typeof W=="string"&&W!==""||typeof W=="number"||typeof W=="bigint")return we!==null?null:R(F,Y,""+W,ce);if(typeof W=="object"&&W!==null){switch(W.$$typeof){case v:return W.key===we?$(F,Y,W,ce):null;case b:return W.key===we?J(F,Y,W,ce):null;case B:return we=W._init,W=we(W._payload),ne(F,Y,W,ce)}if(V(W)||G(W))return we!==null?null:ie(F,Y,W,ce,null);if(typeof W.then=="function")return ne(F,Y,Kl(W),ce);if(W.$$typeof===_)return ne(F,Y,Il(F,W),ce);Wl(F,W)}return null}function oe(F,Y,W,ce,we){if(typeof ce=="string"&&ce!==""||typeof ce=="number"||typeof ce=="bigint")return F=F.get(W)||null,R(Y,F,""+ce,we);if(typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case v:return F=F.get(ce.key===null?W:ce.key)||null,$(Y,F,ce,we);case b:return F=F.get(ce.key===null?W:ce.key)||null,J(Y,F,ce,we);case B:var Pe=ce._init;return ce=Pe(ce._payload),oe(F,Y,W,ce,we)}if(V(ce)||G(ce))return F=F.get(W)||null,ie(Y,F,ce,we,null);if(typeof ce.then=="function")return oe(F,Y,W,Kl(ce),we);if(ce.$$typeof===_)return oe(F,Y,W,Il(Y,ce),we);Wl(Y,ce)}return null}function Re(F,Y,W,ce){for(var we=null,Pe=null,je=Y,Me=Y=0,Ct=null;je!==null&&Me<W.length;Me++){je.index>Me?(Ct=je,je=null):Ct=je.sibling;var Ze=ne(F,je,W[Me],ce);if(Ze===null){je===null&&(je=Ct);break}t&&je&&Ze.alternate===null&&n(F,je),Y=x(Ze,Y,Me),Pe===null?we=Ze:Pe.sibling=Ze,Pe=Ze,je=Ct}if(Me===W.length)return s(F,je),We&&jo(F,Me),we;if(je===null){for(;Me<W.length;Me++)je=fe(F,W[Me],ce),je!==null&&(Y=x(je,Y,Me),Pe===null?we=je:Pe.sibling=je,Pe=je);return We&&jo(F,Me),we}for(je=c(je);Me<W.length;Me++)Ct=oe(je,F,Me,W[Me],ce),Ct!==null&&(t&&Ct.alternate!==null&&je.delete(Ct.key===null?Me:Ct.key),Y=x(Ct,Y,Me),Pe===null?we=Ct:Pe.sibling=Ct,Pe=Ct);return t&&je.forEach(function(to){return n(F,to)}),We&&jo(F,Me),we}function Ae(F,Y,W,ce){if(W==null)throw Error(a(151));for(var we=null,Pe=null,je=Y,Me=Y=0,Ct=null,Ze=W.next();je!==null&&!Ze.done;Me++,Ze=W.next()){je.index>Me?(Ct=je,je=null):Ct=je.sibling;var to=ne(F,je,Ze.value,ce);if(to===null){je===null&&(je=Ct);break}t&&je&&to.alternate===null&&n(F,je),Y=x(to,Y,Me),Pe===null?we=to:Pe.sibling=to,Pe=to,je=Ct}if(Ze.done)return s(F,je),We&&jo(F,Me),we;if(je===null){for(;!Ze.done;Me++,Ze=W.next())Ze=fe(F,Ze.value,ce),Ze!==null&&(Y=x(Ze,Y,Me),Pe===null?we=Ze:Pe.sibling=Ze,Pe=Ze);return We&&jo(F,Me),we}for(je=c(je);!Ze.done;Me++,Ze=W.next())Ze=oe(je,F,Me,Ze.value,ce),Ze!==null&&(t&&Ze.alternate!==null&&je.delete(Ze.key===null?Me:Ze.key),Y=x(Ze,Y,Me),Pe===null?we=Ze:Pe.sibling=Ze,Pe=Ze);return t&&je.forEach(function(I_){return n(F,I_)}),We&&jo(F,Me),we}function rt(F,Y,W,ce){if(typeof W=="object"&&W!==null&&W.type===S&&W.key===null&&(W=W.props.children),typeof W=="object"&&W!==null){switch(W.$$typeof){case v:e:{for(var we=W.key;Y!==null;){if(Y.key===we){if(we=W.type,we===S){if(Y.tag===7){s(F,Y.sibling),ce=m(Y,W.props.children),ce.return=F,F=ce;break e}}else if(Y.elementType===we||typeof we=="object"&&we!==null&&we.$$typeof===B&&Ax(we)===Y.type){s(F,Y.sibling),ce=m(Y,W.props),ei(ce,W),ce.return=F,F=ce;break e}s(F,Y);break}else n(F,Y);Y=Y.sibling}W.type===S?(ce=Eo(W.props.children,F.mode,ce,W.key),ce.return=F,F=ce):(ce=Dl(W.type,W.key,W.props,null,F.mode,ce),ei(ce,W),ce.return=F,F=ce)}return C(F);case b:e:{for(we=W.key;Y!==null;){if(Y.key===we)if(Y.tag===4&&Y.stateNode.containerInfo===W.containerInfo&&Y.stateNode.implementation===W.implementation){s(F,Y.sibling),ce=m(Y,W.children||[]),ce.return=F,F=ce;break e}else{s(F,Y);break}else n(F,Y);Y=Y.sibling}ce=qd(W,F.mode,ce),ce.return=F,F=ce}return C(F);case B:return we=W._init,W=we(W._payload),rt(F,Y,W,ce)}if(V(W))return Re(F,Y,W,ce);if(G(W)){if(we=G(W),typeof we!="function")throw Error(a(150));return W=we.call(W),Ae(F,Y,W,ce)}if(typeof W.then=="function")return rt(F,Y,Kl(W),ce);if(W.$$typeof===_)return rt(F,Y,Il(F,W),ce);Wl(F,W)}return typeof W=="string"&&W!==""||typeof W=="number"||typeof W=="bigint"?(W=""+W,Y!==null&&Y.tag===6?(s(F,Y.sibling),ce=m(Y,W),ce.return=F,F=ce):(s(F,Y),ce=Vd(W,F.mode,ce),ce.return=F,F=ce),C(F)):s(F,Y)}return function(F,Y,W,ce){try{Js=0;var we=rt(F,Y,W,ce);return ja=null,we}catch(je){if(je===qs||je===Bl)throw je;var Pe=Kt(29,je,null,F.mode);return Pe.lanes=ce,Pe.return=F,Pe}finally{}}}var Ca=Mx(!0),Tx=Mx(!1),mn=U(null),On=null;function Ur(t){var n=t.alternate;ee(Nt,Nt.current&1),ee(mn,t),On===null&&(n===null||Na.current!==null||n.memoizedState!==null)&&(On=t)}function Rx(t){if(t.tag===22){if(ee(Nt,Nt.current),ee(mn,t),On===null){var n=t.alternate;n!==null&&n.memoizedState!==null&&(On=t)}}else Pr()}function Pr(){ee(Nt,Nt.current),ee(mn,mn.current)}function ur(t){X(mn),On===t&&(On=null),X(Nt)}var Nt=U(0);function Ql(t){for(var n=t;n!==null;){if(n.tag===13){var s=n.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||s.data==="$?"||mm(s)))return n}else if(n.tag===19&&n.memoizedProps.revealOrder!==void 0){if((n.flags&128)!==0)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}function Ef(t,n,s,c){n=t.memoizedState,s=s(c,n),s=s==null?n:g({},n,s),t.memoizedState=s,t.lanes===0&&(t.updateQueue.baseState=s)}var _f={enqueueSetState:function(t,n,s){t=t._reactInternals;var c=en(),m=Ir(c);m.payload=n,s!=null&&(m.callback=s),n=Hr(t,m,c),n!==null&&(tn(n,t,c),Gs(n,t,c))},enqueueReplaceState:function(t,n,s){t=t._reactInternals;var c=en(),m=Ir(c);m.tag=1,m.payload=n,s!=null&&(m.callback=s),n=Hr(t,m,c),n!==null&&(tn(n,t,c),Gs(n,t,c))},enqueueForceUpdate:function(t,n){t=t._reactInternals;var s=en(),c=Ir(s);c.tag=2,n!=null&&(c.callback=n),n=Hr(t,c,s),n!==null&&(tn(n,t,s),Gs(n,t,s))}};function Dx(t,n,s,c,m,x,C){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(c,x,C):n.prototype&&n.prototype.isPureReactComponent?!Ls(s,c)||!Ls(m,x):!0}function Ox(t,n,s,c){t=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(s,c),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(s,c),n.state!==t&&_f.enqueueReplaceState(n,n.state,null)}function Do(t,n){var s=n;if("ref"in n){s={};for(var c in n)c!=="ref"&&(s[c]=n[c])}if(t=t.defaultProps){s===n&&(s=g({},s));for(var m in t)s[m]===void 0&&(s[m]=t[m])}return s}var Jl=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var n=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(n))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)};function zx(t){Jl(t)}function Lx(t){console.error(t)}function Ix(t){Jl(t)}function ec(t,n){try{var s=t.onUncaughtError;s(n.value,{componentStack:n.stack})}catch(c){setTimeout(function(){throw c})}}function Hx(t,n,s){try{var c=t.onCaughtError;c(s.value,{componentStack:s.stack,errorBoundary:n.tag===1?n.stateNode:null})}catch(m){setTimeout(function(){throw m})}}function jf(t,n,s){return s=Ir(s),s.tag=3,s.payload={element:null},s.callback=function(){ec(t,n)},s}function Bx(t){return t=Ir(t),t.tag=3,t}function Ux(t,n,s,c){var m=s.type.getDerivedStateFromError;if(typeof m=="function"){var x=c.value;t.payload=function(){return m(x)},t.callback=function(){Hx(n,s,c)}}var C=s.stateNode;C!==null&&typeof C.componentDidCatch=="function"&&(t.callback=function(){Hx(n,s,c),typeof m!="function"&&(Xr===null?Xr=new Set([this]):Xr.add(this));var R=c.stack;this.componentDidCatch(c.value,{componentStack:R!==null?R:""})})}function IE(t,n,s,c,m){if(s.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){if(n=s.alternate,n!==null&&Ps(n,s,m,!0),s=mn.current,s!==null){switch(s.tag){case 13:return On===null?Kf():s.alternate===null&&mt===0&&(mt=3),s.flags&=-257,s.flags|=65536,s.lanes=m,c===ef?s.flags|=16384:(n=s.updateQueue,n===null?s.updateQueue=new Set([c]):n.add(c),Qf(t,c,m)),!1;case 22:return s.flags|=65536,c===ef?s.flags|=16384:(n=s.updateQueue,n===null?(n={transitions:null,markerInstances:null,retryQueue:new Set([c])},s.updateQueue=n):(s=n.retryQueue,s===null?n.retryQueue=new Set([c]):s.add(c)),Qf(t,c,m)),!1}throw Error(a(435,s.tag))}return Qf(t,c,m),Kf(),!1}if(We)return n=mn.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=m,c!==Xd&&(t=Error(a(422),{cause:c}),Us(cn(t,s)))):(c!==Xd&&(n=Error(a(423),{cause:c}),Us(cn(n,s))),t=t.current.alternate,t.flags|=65536,m&=-m,t.lanes|=m,c=cn(c,s),m=jf(t.stateNode,c,m),rf(t,m),mt!==4&&(mt=2)),!1;var x=Error(a(520),{cause:c});if(x=cn(x,s),ii===null?ii=[x]:ii.push(x),mt!==4&&(mt=2),n===null)return!0;c=cn(c,s),s=n;do{switch(s.tag){case 3:return s.flags|=65536,t=m&-m,s.lanes|=t,t=jf(s.stateNode,c,t),rf(s,t),!1;case 1:if(n=s.type,x=s.stateNode,(s.flags&128)===0&&(typeof n.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(Xr===null||!Xr.has(x))))return s.flags|=65536,m&=-m,s.lanes|=m,m=Bx(m),Ux(m,t,s,c),rf(s,m),!1}s=s.return}while(s!==null);return!1}var Px=Error(a(461)),_t=!1;function kt(t,n,s,c){n.child=t===null?Tx(n,null,s,c):Ca(n,t.child,s,c)}function $x(t,n,s,c,m){s=s.render;var x=n.ref;if("ref"in c){var C={};for(var R in c)R!=="ref"&&(C[R]=c[R])}else C=c;return Mo(n),c=cf(t,n,s,C,x,m),R=uf(),t!==null&&!_t?(df(t,n,m),dr(t,n,m)):(We&&R&&Yd(n),n.flags|=1,kt(t,n,c,m),n.child)}function Vx(t,n,s,c,m){if(t===null){var x=s.type;return typeof x=="function"&&!$d(x)&&x.defaultProps===void 0&&s.compare===null?(n.tag=15,n.type=x,qx(t,n,x,c,m)):(t=Dl(s.type,null,c,n,n.mode,m),t.ref=n.ref,t.return=n,n.child=t)}if(x=t.child,!Of(t,m)){var C=x.memoizedProps;if(s=s.compare,s=s!==null?s:Ls,s(C,c)&&t.ref===n.ref)return dr(t,n,m)}return n.flags|=1,t=or(x,c),t.ref=n.ref,t.return=n,n.child=t}function qx(t,n,s,c,m){if(t!==null){var x=t.memoizedProps;if(Ls(x,c)&&t.ref===n.ref)if(_t=!1,n.pendingProps=c=x,Of(t,m))(t.flags&131072)!==0&&(_t=!0);else return n.lanes=t.lanes,dr(t,n,m)}return Cf(t,n,s,c,m)}function Yx(t,n,s){var c=n.pendingProps,m=c.children,x=t!==null?t.memoizedState:null;if(c.mode==="hidden"){if((n.flags&128)!==0){if(c=x!==null?x.baseLanes|s:s,t!==null){for(m=n.child=t.child,x=0;m!==null;)x=x|m.lanes|m.childLanes,m=m.sibling;n.childLanes=x&~c}else n.childLanes=0,n.child=null;return Gx(t,n,c,s)}if((s&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},t!==null&&Hl(n,x!==null?x.cachePool:null),x!==null?qg(n,x):af(),Rx(n);else return n.lanes=n.childLanes=536870912,Gx(t,n,x!==null?x.baseLanes|s:s,s)}else x!==null?(Hl(n,x.cachePool),qg(n,x),Pr(),n.memoizedState=null):(t!==null&&Hl(n,null),af(),Pr());return kt(t,n,m,s),n.child}function Gx(t,n,s,c){var m=Jd();return m=m===null?null:{parent:wt._currentValue,pool:m},n.memoizedState={baseLanes:s,cachePool:m},t!==null&&Hl(n,null),af(),Rx(n),t!==null&&Ps(t,n,c,!0),null}function tc(t,n){var s=n.ref;if(s===null)t!==null&&t.ref!==null&&(n.flags|=4194816);else{if(typeof s!="function"&&typeof s!="object")throw Error(a(284));(t===null||t.ref!==s)&&(n.flags|=4194816)}}function Cf(t,n,s,c,m){return Mo(n),s=cf(t,n,s,c,void 0,m),c=uf(),t!==null&&!_t?(df(t,n,m),dr(t,n,m)):(We&&c&&Yd(n),n.flags|=1,kt(t,n,s,m),n.child)}function Xx(t,n,s,c,m,x){return Mo(n),n.updateQueue=null,s=Gg(n,c,s,m),Yg(t),c=uf(),t!==null&&!_t?(df(t,n,x),dr(t,n,x)):(We&&c&&Yd(n),n.flags|=1,kt(t,n,s,x),n.child)}function Fx(t,n,s,c,m){if(Mo(n),n.stateNode===null){var x=xa,C=s.contextType;typeof C=="object"&&C!==null&&(x=Ot(C)),x=new s(c,x),n.memoizedState=x.state!==null&&x.state!==void 0?x.state:null,x.updater=_f,n.stateNode=x,x._reactInternals=n,x=n.stateNode,x.props=c,x.state=n.memoizedState,x.refs={},tf(n),C=s.contextType,x.context=typeof C=="object"&&C!==null?Ot(C):xa,x.state=n.memoizedState,C=s.getDerivedStateFromProps,typeof C=="function"&&(Ef(n,s,C,c),x.state=n.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof x.getSnapshotBeforeUpdate=="function"||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(C=x.state,typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount(),C!==x.state&&_f.enqueueReplaceState(x,x.state,null),Fs(n,c,x,m),Xs(),x.state=n.memoizedState),typeof x.componentDidMount=="function"&&(n.flags|=4194308),c=!0}else if(t===null){x=n.stateNode;var R=n.memoizedProps,$=Do(s,R);x.props=$;var J=x.context,ie=s.contextType;C=xa,typeof ie=="object"&&ie!==null&&(C=Ot(ie));var fe=s.getDerivedStateFromProps;ie=typeof fe=="function"||typeof x.getSnapshotBeforeUpdate=="function",R=n.pendingProps!==R,ie||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(R||J!==C)&&Ox(n,x,c,C),Lr=!1;var ne=n.memoizedState;x.state=ne,Fs(n,c,x,m),Xs(),J=n.memoizedState,R||ne!==J||Lr?(typeof fe=="function"&&(Ef(n,s,fe,c),J=n.memoizedState),($=Lr||Dx(n,s,$,c,ne,J,C))?(ie||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount()),typeof x.componentDidMount=="function"&&(n.flags|=4194308)):(typeof x.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=c,n.memoizedState=J),x.props=c,x.state=J,x.context=C,c=$):(typeof x.componentDidMount=="function"&&(n.flags|=4194308),c=!1)}else{x=n.stateNode,nf(t,n),C=n.memoizedProps,ie=Do(s,C),x.props=ie,fe=n.pendingProps,ne=x.context,J=s.contextType,$=xa,typeof J=="object"&&J!==null&&($=Ot(J)),R=s.getDerivedStateFromProps,(J=typeof R=="function"||typeof x.getSnapshotBeforeUpdate=="function")||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(C!==fe||ne!==$)&&Ox(n,x,c,$),Lr=!1,ne=n.memoizedState,x.state=ne,Fs(n,c,x,m),Xs();var oe=n.memoizedState;C!==fe||ne!==oe||Lr||t!==null&&t.dependencies!==null&&Ll(t.dependencies)?(typeof R=="function"&&(Ef(n,s,R,c),oe=n.memoizedState),(ie=Lr||Dx(n,s,ie,c,ne,oe,$)||t!==null&&t.dependencies!==null&&Ll(t.dependencies))?(J||typeof x.UNSAFE_componentWillUpdate!="function"&&typeof x.componentWillUpdate!="function"||(typeof x.componentWillUpdate=="function"&&x.componentWillUpdate(c,oe,$),typeof x.UNSAFE_componentWillUpdate=="function"&&x.UNSAFE_componentWillUpdate(c,oe,$)),typeof x.componentDidUpdate=="function"&&(n.flags|=4),typeof x.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof x.componentDidUpdate!="function"||C===t.memoizedProps&&ne===t.memoizedState||(n.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||C===t.memoizedProps&&ne===t.memoizedState||(n.flags|=1024),n.memoizedProps=c,n.memoizedState=oe),x.props=c,x.state=oe,x.context=$,c=ie):(typeof x.componentDidUpdate!="function"||C===t.memoizedProps&&ne===t.memoizedState||(n.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||C===t.memoizedProps&&ne===t.memoizedState||(n.flags|=1024),c=!1)}return x=c,tc(t,n),c=(n.flags&128)!==0,x||c?(x=n.stateNode,s=c&&typeof s.getDerivedStateFromError!="function"?null:x.render(),n.flags|=1,t!==null&&c?(n.child=Ca(n,t.child,null,m),n.child=Ca(n,null,s,m)):kt(t,n,s,m),n.memoizedState=x.state,t=n.child):t=dr(t,n,m),t}function Zx(t,n,s,c){return Bs(),n.flags|=256,kt(t,n,s,c),n.child}var kf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Af(t){return{baseLanes:t,cachePool:Lg()}}function Mf(t,n,s){return t=t!==null?t.childLanes&~s:0,n&&(t|=hn),t}function Kx(t,n,s){var c=n.pendingProps,m=!1,x=(n.flags&128)!==0,C;if((C=x)||(C=t!==null&&t.memoizedState===null?!1:(Nt.current&2)!==0),C&&(m=!0,n.flags&=-129),C=(n.flags&32)!==0,n.flags&=-33,t===null){if(We){if(m?Ur(n):Pr(),We){var R=ft,$;if($=R){e:{for($=R,R=Dn;$.nodeType!==8;){if(!R){R=null;break e}if($=wn($.nextSibling),$===null){R=null;break e}}R=$}R!==null?(n.memoizedState={dehydrated:R,treeContext:_o!==null?{id:ar,overflow:sr}:null,retryLane:536870912,hydrationErrors:null},$=Kt(18,null,null,0),$.stateNode=R,$.return=n,n.child=$,It=n,ft=null,$=!0):$=!1}$||ko(n)}if(R=n.memoizedState,R!==null&&(R=R.dehydrated,R!==null))return mm(R)?n.lanes=32:n.lanes=536870912,null;ur(n)}return R=c.children,c=c.fallback,m?(Pr(),m=n.mode,R=nc({mode:"hidden",children:R},m),c=Eo(c,m,s,null),R.return=n,c.return=n,R.sibling=c,n.child=R,m=n.child,m.memoizedState=Af(s),m.childLanes=Mf(t,C,s),n.memoizedState=kf,c):(Ur(n),Tf(n,R))}if($=t.memoizedState,$!==null&&(R=$.dehydrated,R!==null)){if(x)n.flags&256?(Ur(n),n.flags&=-257,n=Rf(t,n,s)):n.memoizedState!==null?(Pr(),n.child=t.child,n.flags|=128,n=null):(Pr(),m=c.fallback,R=n.mode,c=nc({mode:"visible",children:c.children},R),m=Eo(m,R,s,null),m.flags|=2,c.return=n,m.return=n,c.sibling=m,n.child=c,Ca(n,t.child,null,s),c=n.child,c.memoizedState=Af(s),c.childLanes=Mf(t,C,s),n.memoizedState=kf,n=m);else if(Ur(n),mm(R)){if(C=R.nextSibling&&R.nextSibling.dataset,C)var J=C.dgst;C=J,c=Error(a(419)),c.stack="",c.digest=C,Us({value:c,source:null,stack:null}),n=Rf(t,n,s)}else if(_t||Ps(t,n,s,!1),C=(s&t.childLanes)!==0,_t||C){if(C=st,C!==null&&(c=s&-s,c=(c&42)!==0?1:ys(c),c=(c&(C.suspendedLanes|s))!==0?0:c,c!==0&&c!==$.retryLane))throw $.retryLane=c,ga(t,c),tn(C,t,c),Px;R.data==="$?"||Kf(),n=Rf(t,n,s)}else R.data==="$?"?(n.flags|=192,n.child=t.child,n=null):(t=$.treeContext,ft=wn(R.nextSibling),It=n,We=!0,Co=null,Dn=!1,t!==null&&(dn[fn++]=ar,dn[fn++]=sr,dn[fn++]=_o,ar=t.id,sr=t.overflow,_o=n),n=Tf(n,c.children),n.flags|=4096);return n}return m?(Pr(),m=c.fallback,R=n.mode,$=t.child,J=$.sibling,c=or($,{mode:"hidden",children:c.children}),c.subtreeFlags=$.subtreeFlags&65011712,J!==null?m=or(J,m):(m=Eo(m,R,s,null),m.flags|=2),m.return=n,c.return=n,c.sibling=m,n.child=c,c=m,m=n.child,R=t.child.memoizedState,R===null?R=Af(s):($=R.cachePool,$!==null?(J=wt._currentValue,$=$.parent!==J?{parent:J,pool:J}:$):$=Lg(),R={baseLanes:R.baseLanes|s,cachePool:$}),m.memoizedState=R,m.childLanes=Mf(t,C,s),n.memoizedState=kf,c):(Ur(n),s=t.child,t=s.sibling,s=or(s,{mode:"visible",children:c.children}),s.return=n,s.sibling=null,t!==null&&(C=n.deletions,C===null?(n.deletions=[t],n.flags|=16):C.push(t)),n.child=s,n.memoizedState=null,s)}function Tf(t,n){return n=nc({mode:"visible",children:n},t.mode),n.return=t,t.child=n}function nc(t,n){return t=Kt(22,t,null,n),t.lanes=0,t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},t}function Rf(t,n,s){return Ca(n,t.child,null,s),t=Tf(n,n.pendingProps.children),t.flags|=2,n.memoizedState=null,t}function Wx(t,n,s){t.lanes|=n;var c=t.alternate;c!==null&&(c.lanes|=n),Zd(t.return,n,s)}function Df(t,n,s,c,m){var x=t.memoizedState;x===null?t.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:c,tail:s,tailMode:m}:(x.isBackwards=n,x.rendering=null,x.renderingStartTime=0,x.last=c,x.tail=s,x.tailMode=m)}function Qx(t,n,s){var c=n.pendingProps,m=c.revealOrder,x=c.tail;if(kt(t,n,c.children,s),c=Nt.current,(c&2)!==0)c=c&1|2,n.flags|=128;else{if(t!==null&&(t.flags&128)!==0)e:for(t=n.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&Wx(t,s,n);else if(t.tag===19)Wx(t,s,n);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===n)break e;for(;t.sibling===null;){if(t.return===null||t.return===n)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}c&=1}switch(ee(Nt,c),m){case"forwards":for(s=n.child,m=null;s!==null;)t=s.alternate,t!==null&&Ql(t)===null&&(m=s),s=s.sibling;s=m,s===null?(m=n.child,n.child=null):(m=s.sibling,s.sibling=null),Df(n,!1,m,s,x);break;case"backwards":for(s=null,m=n.child,n.child=null;m!==null;){if(t=m.alternate,t!==null&&Ql(t)===null){n.child=m;break}t=m.sibling,m.sibling=s,s=m,m=t}Df(n,!0,s,null,x);break;case"together":Df(n,!1,null,null,void 0);break;default:n.memoizedState=null}return n.child}function dr(t,n,s){if(t!==null&&(n.dependencies=t.dependencies),Gr|=n.lanes,(s&n.childLanes)===0)if(t!==null){if(Ps(t,n,s,!1),(s&n.childLanes)===0)return null}else return null;if(t!==null&&n.child!==t.child)throw Error(a(153));if(n.child!==null){for(t=n.child,s=or(t,t.pendingProps),n.child=s,s.return=n;t.sibling!==null;)t=t.sibling,s=s.sibling=or(t,t.pendingProps),s.return=n;s.sibling=null}return n.child}function Of(t,n){return(t.lanes&n)!==0?!0:(t=t.dependencies,!!(t!==null&&Ll(t)))}function HE(t,n,s){switch(n.tag){case 3:se(n,n.stateNode.containerInfo),zr(n,wt,t.memoizedState.cache),Bs();break;case 27:case 5:le(n);break;case 4:se(n,n.stateNode.containerInfo);break;case 10:zr(n,n.type,n.memoizedProps.value);break;case 13:var c=n.memoizedState;if(c!==null)return c.dehydrated!==null?(Ur(n),n.flags|=128,null):(s&n.child.childLanes)!==0?Kx(t,n,s):(Ur(n),t=dr(t,n,s),t!==null?t.sibling:null);Ur(n);break;case 19:var m=(t.flags&128)!==0;if(c=(s&n.childLanes)!==0,c||(Ps(t,n,s,!1),c=(s&n.childLanes)!==0),m){if(c)return Qx(t,n,s);n.flags|=128}if(m=n.memoizedState,m!==null&&(m.rendering=null,m.tail=null,m.lastEffect=null),ee(Nt,Nt.current),c)break;return null;case 22:case 23:return n.lanes=0,Yx(t,n,s);case 24:zr(n,wt,t.memoizedState.cache)}return dr(t,n,s)}function Jx(t,n,s){if(t!==null)if(t.memoizedProps!==n.pendingProps)_t=!0;else{if(!Of(t,s)&&(n.flags&128)===0)return _t=!1,HE(t,n,s);_t=(t.flags&131072)!==0}else _t=!1,We&&(n.flags&1048576)!==0&&Ag(n,zl,n.index);switch(n.lanes=0,n.tag){case 16:e:{t=n.pendingProps;var c=n.elementType,m=c._init;if(c=m(c._payload),n.type=c,typeof c=="function")$d(c)?(t=Do(c,t),n.tag=1,n=Fx(null,n,c,t,s)):(n.tag=0,n=Cf(null,n,c,t,s));else{if(c!=null){if(m=c.$$typeof,m===A){n.tag=11,n=$x(null,n,c,t,s);break e}else if(m===H){n.tag=14,n=Vx(null,n,c,t,s);break e}}throw n=I(c)||c,Error(a(306,n,""))}}return n;case 0:return Cf(t,n,n.type,n.pendingProps,s);case 1:return c=n.type,m=Do(c,n.pendingProps),Fx(t,n,c,m,s);case 3:e:{if(se(n,n.stateNode.containerInfo),t===null)throw Error(a(387));c=n.pendingProps;var x=n.memoizedState;m=x.element,nf(t,n),Fs(n,c,null,s);var C=n.memoizedState;if(c=C.cache,zr(n,wt,c),c!==x.cache&&Kd(n,[wt],s,!0),Xs(),c=C.element,x.isDehydrated)if(x={element:c,isDehydrated:!1,cache:C.cache},n.updateQueue.baseState=x,n.memoizedState=x,n.flags&256){n=Zx(t,n,c,s);break e}else if(c!==m){m=cn(Error(a(424)),n),Us(m),n=Zx(t,n,c,s);break e}else{switch(t=n.stateNode.containerInfo,t.nodeType){case 9:t=t.body;break;default:t=t.nodeName==="HTML"?t.ownerDocument.body:t}for(ft=wn(t.firstChild),It=n,We=!0,Co=null,Dn=!0,s=Tx(n,null,c,s),n.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling}else{if(Bs(),c===m){n=dr(t,n,s);break e}kt(t,n,c,s)}n=n.child}return n;case 26:return tc(t,n),t===null?(s=rv(n.type,null,n.pendingProps,null))?n.memoizedState=s:We||(s=n.type,t=n.pendingProps,c=gc(ue.current).createElement(s),c[Et]=n,c[Dt]=t,Mt(c,s,t),xt(c),n.stateNode=c):n.memoizedState=rv(n.type,t.memoizedProps,n.pendingProps,t.memoizedState),null;case 27:return le(n),t===null&&We&&(c=n.stateNode=ev(n.type,n.pendingProps,ue.current),It=n,Dn=!0,m=ft,Kr(n.type)?(hm=m,ft=wn(c.firstChild)):ft=m),kt(t,n,n.pendingProps.children,s),tc(t,n),t===null&&(n.flags|=4194304),n.child;case 5:return t===null&&We&&((m=c=ft)&&(c=f_(c,n.type,n.pendingProps,Dn),c!==null?(n.stateNode=c,It=n,ft=wn(c.firstChild),Dn=!1,m=!0):m=!1),m||ko(n)),le(n),m=n.type,x=n.pendingProps,C=t!==null?t.memoizedProps:null,c=x.children,um(m,x)?c=null:C!==null&&um(m,C)&&(n.flags|=32),n.memoizedState!==null&&(m=cf(t,n,ME,null,null,s),gi._currentValue=m),tc(t,n),kt(t,n,c,s),n.child;case 6:return t===null&&We&&((t=s=ft)&&(s=m_(s,n.pendingProps,Dn),s!==null?(n.stateNode=s,It=n,ft=null,t=!0):t=!1),t||ko(n)),null;case 13:return Kx(t,n,s);case 4:return se(n,n.stateNode.containerInfo),c=n.pendingProps,t===null?n.child=Ca(n,null,c,s):kt(t,n,c,s),n.child;case 11:return $x(t,n,n.type,n.pendingProps,s);case 7:return kt(t,n,n.pendingProps,s),n.child;case 8:return kt(t,n,n.pendingProps.children,s),n.child;case 12:return kt(t,n,n.pendingProps.children,s),n.child;case 10:return c=n.pendingProps,zr(n,n.type,c.value),kt(t,n,c.children,s),n.child;case 9:return m=n.type._context,c=n.pendingProps.children,Mo(n),m=Ot(m),c=c(m),n.flags|=1,kt(t,n,c,s),n.child;case 14:return Vx(t,n,n.type,n.pendingProps,s);case 15:return qx(t,n,n.type,n.pendingProps,s);case 19:return Qx(t,n,s);case 31:return c=n.pendingProps,s=n.mode,c={mode:c.mode,children:c.children},t===null?(s=nc(c,s),s.ref=n.ref,n.child=s,s.return=n,n=s):(s=or(t.child,c),s.ref=n.ref,n.child=s,s.return=n,n=s),n;case 22:return Yx(t,n,s);case 24:return Mo(n),c=Ot(wt),t===null?(m=Jd(),m===null&&(m=st,x=Wd(),m.pooledCache=x,x.refCount++,x!==null&&(m.pooledCacheLanes|=s),m=x),n.memoizedState={parent:c,cache:m},tf(n),zr(n,wt,m)):((t.lanes&s)!==0&&(nf(t,n),Fs(n,null,null,s),Xs()),m=t.memoizedState,x=n.memoizedState,m.parent!==c?(m={parent:c,cache:c},n.memoizedState=m,n.lanes===0&&(n.memoizedState=n.updateQueue.baseState=m),zr(n,wt,c)):(c=x.cache,zr(n,wt,c),c!==m.cache&&Kd(n,[wt],s,!0))),kt(t,n,n.pendingProps.children,s),n.child;case 29:throw n.pendingProps}throw Error(a(156,n.tag))}function fr(t){t.flags|=4}function e0(t,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!lv(n)){if(n=mn.current,n!==null&&((Ge&4194048)===Ge?On!==null:(Ge&62914560)!==Ge&&(Ge&536870912)===0||n!==On))throw Ys=ef,Ig;t.flags|=8192}}function rc(t,n){n!==null&&(t.flags|=4),t.flags&16384&&(n=t.tag!==22?fl():536870912,t.lanes|=n,Ta|=n)}function ti(t,n){if(!We)switch(t.tailMode){case"hidden":n=t.tail;for(var s=null;n!==null;)n.alternate!==null&&(s=n),n=n.sibling;s===null?t.tail=null:s.sibling=null;break;case"collapsed":s=t.tail;for(var c=null;s!==null;)s.alternate!==null&&(c=s),s=s.sibling;c===null?n||t.tail===null?t.tail=null:t.tail.sibling=null:c.sibling=null}}function ut(t){var n=t.alternate!==null&&t.alternate.child===t.child,s=0,c=0;if(n)for(var m=t.child;m!==null;)s|=m.lanes|m.childLanes,c|=m.subtreeFlags&65011712,c|=m.flags&65011712,m.return=t,m=m.sibling;else for(m=t.child;m!==null;)s|=m.lanes|m.childLanes,c|=m.subtreeFlags,c|=m.flags,m.return=t,m=m.sibling;return t.subtreeFlags|=c,t.childLanes=s,n}function BE(t,n,s){var c=n.pendingProps;switch(Gd(n),n.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ut(n),null;case 1:return ut(n),null;case 3:return s=n.stateNode,c=null,t!==null&&(c=t.memoizedState.cache),n.memoizedState.cache!==c&&(n.flags|=2048),lr(wt),pe(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(t===null||t.child===null)&&(Hs(n)?fr(n):t===null||t.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,Rg())),ut(n),null;case 26:return s=n.memoizedState,t===null?(fr(n),s!==null?(ut(n),e0(n,s)):(ut(n),n.flags&=-16777217)):s?s!==t.memoizedState?(fr(n),ut(n),e0(n,s)):(ut(n),n.flags&=-16777217):(t.memoizedProps!==c&&fr(n),ut(n),n.flags&=-16777217),null;case 27:de(n),s=ue.current;var m=n.type;if(t!==null&&n.stateNode!=null)t.memoizedProps!==c&&fr(n);else{if(!c){if(n.stateNode===null)throw Error(a(166));return ut(n),null}t=ae.current,Hs(n)?Mg(n):(t=ev(m,c,s),n.stateNode=t,fr(n))}return ut(n),null;case 5:if(de(n),s=n.type,t!==null&&n.stateNode!=null)t.memoizedProps!==c&&fr(n);else{if(!c){if(n.stateNode===null)throw Error(a(166));return ut(n),null}if(t=ae.current,Hs(n))Mg(n);else{switch(m=gc(ue.current),t){case 1:t=m.createElementNS("http://www.w3.org/2000/svg",s);break;case 2:t=m.createElementNS("http://www.w3.org/1998/Math/MathML",s);break;default:switch(s){case"svg":t=m.createElementNS("http://www.w3.org/2000/svg",s);break;case"math":t=m.createElementNS("http://www.w3.org/1998/Math/MathML",s);break;case"script":t=m.createElement("div"),t.innerHTML="<script><\/script>",t=t.removeChild(t.firstChild);break;case"select":t=typeof c.is=="string"?m.createElement("select",{is:c.is}):m.createElement("select"),c.multiple?t.multiple=!0:c.size&&(t.size=c.size);break;default:t=typeof c.is=="string"?m.createElement(s,{is:c.is}):m.createElement(s)}}t[Et]=n,t[Dt]=c;e:for(m=n.child;m!==null;){if(m.tag===5||m.tag===6)t.appendChild(m.stateNode);else if(m.tag!==4&&m.tag!==27&&m.child!==null){m.child.return=m,m=m.child;continue}if(m===n)break e;for(;m.sibling===null;){if(m.return===null||m.return===n)break e;m=m.return}m.sibling.return=m.return,m=m.sibling}n.stateNode=t;e:switch(Mt(t,s,c),s){case"button":case"input":case"select":case"textarea":t=!!c.autoFocus;break e;case"img":t=!0;break e;default:t=!1}t&&fr(n)}}return ut(n),n.flags&=-16777217,null;case 6:if(t&&n.stateNode!=null)t.memoizedProps!==c&&fr(n);else{if(typeof c!="string"&&n.stateNode===null)throw Error(a(166));if(t=ue.current,Hs(n)){if(t=n.stateNode,s=n.memoizedProps,c=null,m=It,m!==null)switch(m.tag){case 27:case 5:c=m.memoizedProps}t[Et]=n,t=!!(t.nodeValue===s||c!==null&&c.suppressHydrationWarning===!0||X0(t.nodeValue,s)),t||ko(n)}else t=gc(t).createTextNode(c),t[Et]=n,n.stateNode=t}return ut(n),null;case 13:if(c=n.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(m=Hs(n),c!==null&&c.dehydrated!==null){if(t===null){if(!m)throw Error(a(318));if(m=n.memoizedState,m=m!==null?m.dehydrated:null,!m)throw Error(a(317));m[Et]=n}else Bs(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;ut(n),m=!1}else m=Rg(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=m),m=!0;if(!m)return n.flags&256?(ur(n),n):(ur(n),null)}if(ur(n),(n.flags&128)!==0)return n.lanes=s,n;if(s=c!==null,t=t!==null&&t.memoizedState!==null,s){c=n.child,m=null,c.alternate!==null&&c.alternate.memoizedState!==null&&c.alternate.memoizedState.cachePool!==null&&(m=c.alternate.memoizedState.cachePool.pool);var x=null;c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(x=c.memoizedState.cachePool.pool),x!==m&&(c.flags|=2048)}return s!==t&&s&&(n.child.flags|=8192),rc(n,n.updateQueue),ut(n),null;case 4:return pe(),t===null&&am(n.stateNode.containerInfo),ut(n),null;case 10:return lr(n.type),ut(n),null;case 19:if(X(Nt),m=n.memoizedState,m===null)return ut(n),null;if(c=(n.flags&128)!==0,x=m.rendering,x===null)if(c)ti(m,!1);else{if(mt!==0||t!==null&&(t.flags&128)!==0)for(t=n.child;t!==null;){if(x=Ql(t),x!==null){for(n.flags|=128,ti(m,!1),t=x.updateQueue,n.updateQueue=t,rc(n,t),n.subtreeFlags=0,t=s,s=n.child;s!==null;)kg(s,t),s=s.sibling;return ee(Nt,Nt.current&1|2),n.child}t=t.sibling}m.tail!==null&&re()>sc&&(n.flags|=128,c=!0,ti(m,!1),n.lanes=4194304)}else{if(!c)if(t=Ql(x),t!==null){if(n.flags|=128,c=!0,t=t.updateQueue,n.updateQueue=t,rc(n,t),ti(m,!0),m.tail===null&&m.tailMode==="hidden"&&!x.alternate&&!We)return ut(n),null}else 2*re()-m.renderingStartTime>sc&&s!==536870912&&(n.flags|=128,c=!0,ti(m,!1),n.lanes=4194304);m.isBackwards?(x.sibling=n.child,n.child=x):(t=m.last,t!==null?t.sibling=x:n.child=x,m.last=x)}return m.tail!==null?(n=m.tail,m.rendering=n,m.tail=n.sibling,m.renderingStartTime=re(),n.sibling=null,t=Nt.current,ee(Nt,c?t&1|2:t&1),n):(ut(n),null);case 22:case 23:return ur(n),sf(),c=n.memoizedState!==null,t!==null?t.memoizedState!==null!==c&&(n.flags|=8192):c&&(n.flags|=8192),c?(s&536870912)!==0&&(n.flags&128)===0&&(ut(n),n.subtreeFlags&6&&(n.flags|=8192)):ut(n),s=n.updateQueue,s!==null&&rc(n,s.retryQueue),s=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),c=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(c=n.memoizedState.cachePool.pool),c!==s&&(n.flags|=2048),t!==null&&X(To),null;case 24:return s=null,t!==null&&(s=t.memoizedState.cache),n.memoizedState.cache!==s&&(n.flags|=2048),lr(wt),ut(n),null;case 25:return null;case 30:return null}throw Error(a(156,n.tag))}function UE(t,n){switch(Gd(n),n.tag){case 1:return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 3:return lr(wt),pe(),t=n.flags,(t&65536)!==0&&(t&128)===0?(n.flags=t&-65537|128,n):null;case 26:case 27:case 5:return de(n),null;case 13:if(ur(n),t=n.memoizedState,t!==null&&t.dehydrated!==null){if(n.alternate===null)throw Error(a(340));Bs()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 19:return X(Nt),null;case 4:return pe(),null;case 10:return lr(n.type),null;case 22:case 23:return ur(n),sf(),t!==null&&X(To),t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 24:return lr(wt),null;case 25:return null;default:return null}}function t0(t,n){switch(Gd(n),n.tag){case 3:lr(wt),pe();break;case 26:case 27:case 5:de(n);break;case 4:pe();break;case 13:ur(n);break;case 19:X(Nt);break;case 10:lr(n.type);break;case 22:case 23:ur(n),sf(),t!==null&&X(To);break;case 24:lr(wt)}}function ni(t,n){try{var s=n.updateQueue,c=s!==null?s.lastEffect:null;if(c!==null){var m=c.next;s=m;do{if((s.tag&t)===t){c=void 0;var x=s.create,C=s.inst;c=x(),C.destroy=c}s=s.next}while(s!==m)}}catch(R){ot(n,n.return,R)}}function $r(t,n,s){try{var c=n.updateQueue,m=c!==null?c.lastEffect:null;if(m!==null){var x=m.next;c=x;do{if((c.tag&t)===t){var C=c.inst,R=C.destroy;if(R!==void 0){C.destroy=void 0,m=n;var $=s,J=R;try{J()}catch(ie){ot(m,$,ie)}}}c=c.next}while(c!==x)}}catch(ie){ot(n,n.return,ie)}}function n0(t){var n=t.updateQueue;if(n!==null){var s=t.stateNode;try{Vg(n,s)}catch(c){ot(t,t.return,c)}}}function r0(t,n,s){s.props=Do(t.type,t.memoizedProps),s.state=t.memoizedState;try{s.componentWillUnmount()}catch(c){ot(t,n,c)}}function ri(t,n){try{var s=t.ref;if(s!==null){switch(t.tag){case 26:case 27:case 5:var c=t.stateNode;break;case 30:c=t.stateNode;break;default:c=t.stateNode}typeof s=="function"?t.refCleanup=s(c):s.current=c}}catch(m){ot(t,n,m)}}function zn(t,n){var s=t.ref,c=t.refCleanup;if(s!==null)if(typeof c=="function")try{c()}catch(m){ot(t,n,m)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(m){ot(t,n,m)}else s.current=null}function o0(t){var n=t.type,s=t.memoizedProps,c=t.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":s.autoFocus&&c.focus();break e;case"img":s.src?c.src=s.src:s.srcSet&&(c.srcset=s.srcSet)}}catch(m){ot(t,t.return,m)}}function zf(t,n,s){try{var c=t.stateNode;i_(c,t.type,s,n),c[Dt]=n}catch(m){ot(t,t.return,m)}}function a0(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&Kr(t.type)||t.tag===4}function Lf(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||a0(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&Kr(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function If(t,n,s){var c=t.tag;if(c===5||c===6)t=t.stateNode,n?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(t,n):(n=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,n.appendChild(t),s=s._reactRootContainer,s!=null||n.onclick!==null||(n.onclick=pc));else if(c!==4&&(c===27&&Kr(t.type)&&(s=t.stateNode,n=null),t=t.child,t!==null))for(If(t,n,s),t=t.sibling;t!==null;)If(t,n,s),t=t.sibling}function oc(t,n,s){var c=t.tag;if(c===5||c===6)t=t.stateNode,n?s.insertBefore(t,n):s.appendChild(t);else if(c!==4&&(c===27&&Kr(t.type)&&(s=t.stateNode),t=t.child,t!==null))for(oc(t,n,s),t=t.sibling;t!==null;)oc(t,n,s),t=t.sibling}function s0(t){var n=t.stateNode,s=t.memoizedProps;try{for(var c=t.type,m=n.attributes;m.length;)n.removeAttributeNode(m[0]);Mt(n,c,s),n[Et]=t,n[Dt]=s}catch(x){ot(t,t.return,x)}}var mr=!1,gt=!1,Hf=!1,i0=typeof WeakSet=="function"?WeakSet:Set,jt=null;function PE(t,n){if(t=t.containerInfo,lm=Nc,t=vg(t),zd(t)){if("selectionStart"in t)var s={start:t.selectionStart,end:t.selectionEnd};else e:{s=(s=t.ownerDocument)&&s.defaultView||window;var c=s.getSelection&&s.getSelection();if(c&&c.rangeCount!==0){s=c.anchorNode;var m=c.anchorOffset,x=c.focusNode;c=c.focusOffset;try{s.nodeType,x.nodeType}catch{s=null;break e}var C=0,R=-1,$=-1,J=0,ie=0,fe=t,ne=null;t:for(;;){for(var oe;fe!==s||m!==0&&fe.nodeType!==3||(R=C+m),fe!==x||c!==0&&fe.nodeType!==3||($=C+c),fe.nodeType===3&&(C+=fe.nodeValue.length),(oe=fe.firstChild)!==null;)ne=fe,fe=oe;for(;;){if(fe===t)break t;if(ne===s&&++J===m&&(R=C),ne===x&&++ie===c&&($=C),(oe=fe.nextSibling)!==null)break;fe=ne,ne=fe.parentNode}fe=oe}s=R===-1||$===-1?null:{start:R,end:$}}else s=null}s=s||{start:0,end:0}}else s=null;for(cm={focusedElem:t,selectionRange:s},Nc=!1,jt=n;jt!==null;)if(n=jt,t=n.child,(n.subtreeFlags&1024)!==0&&t!==null)t.return=n,jt=t;else for(;jt!==null;){switch(n=jt,x=n.alternate,t=n.flags,n.tag){case 0:break;case 11:case 15:break;case 1:if((t&1024)!==0&&x!==null){t=void 0,s=n,m=x.memoizedProps,x=x.memoizedState,c=s.stateNode;try{var Re=Do(s.type,m,s.elementType===s.type);t=c.getSnapshotBeforeUpdate(Re,x),c.__reactInternalSnapshotBeforeUpdate=t}catch(Ae){ot(s,s.return,Ae)}}break;case 3:if((t&1024)!==0){if(t=n.stateNode.containerInfo,s=t.nodeType,s===9)fm(t);else if(s===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":fm(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(a(163))}if(t=n.sibling,t!==null){t.return=n.return,jt=t;break}jt=n.return}}function l0(t,n,s){var c=s.flags;switch(s.tag){case 0:case 11:case 15:Vr(t,s),c&4&&ni(5,s);break;case 1:if(Vr(t,s),c&4)if(t=s.stateNode,n===null)try{t.componentDidMount()}catch(C){ot(s,s.return,C)}else{var m=Do(s.type,n.memoizedProps);n=n.memoizedState;try{t.componentDidUpdate(m,n,t.__reactInternalSnapshotBeforeUpdate)}catch(C){ot(s,s.return,C)}}c&64&&n0(s),c&512&&ri(s,s.return);break;case 3:if(Vr(t,s),c&64&&(t=s.updateQueue,t!==null)){if(n=null,s.child!==null)switch(s.child.tag){case 27:case 5:n=s.child.stateNode;break;case 1:n=s.child.stateNode}try{Vg(t,n)}catch(C){ot(s,s.return,C)}}break;case 27:n===null&&c&4&&s0(s);case 26:case 5:Vr(t,s),n===null&&c&4&&o0(s),c&512&&ri(s,s.return);break;case 12:Vr(t,s);break;case 13:Vr(t,s),c&4&&d0(t,s),c&64&&(t=s.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(s=KE.bind(null,s),h_(t,s))));break;case 22:if(c=s.memoizedState!==null||mr,!c){n=n!==null&&n.memoizedState!==null||gt,m=mr;var x=gt;mr=c,(gt=n)&&!x?qr(t,s,(s.subtreeFlags&8772)!==0):Vr(t,s),mr=m,gt=x}break;case 30:break;default:Vr(t,s)}}function c0(t){var n=t.alternate;n!==null&&(t.alternate=null,c0(n)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(n=t.stateNode,n!==null&&Ns(n)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var lt=null,Vt=!1;function hr(t,n,s){for(s=s.child;s!==null;)u0(t,n,s),s=s.sibling}function u0(t,n,s){if(Ue&&typeof Ue.onCommitFiberUnmount=="function")try{Ue.onCommitFiberUnmount(Fe,s)}catch{}switch(s.tag){case 26:gt||zn(s,n),hr(t,n,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:gt||zn(s,n);var c=lt,m=Vt;Kr(s.type)&&(lt=s.stateNode,Vt=!1),hr(t,n,s),fi(s.stateNode),lt=c,Vt=m;break;case 5:gt||zn(s,n);case 6:if(c=lt,m=Vt,lt=null,hr(t,n,s),lt=c,Vt=m,lt!==null)if(Vt)try{(lt.nodeType===9?lt.body:lt.nodeName==="HTML"?lt.ownerDocument.body:lt).removeChild(s.stateNode)}catch(x){ot(s,n,x)}else try{lt.removeChild(s.stateNode)}catch(x){ot(s,n,x)}break;case 18:lt!==null&&(Vt?(t=lt,Q0(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,s.stateNode),bi(t)):Q0(lt,s.stateNode));break;case 4:c=lt,m=Vt,lt=s.stateNode.containerInfo,Vt=!0,hr(t,n,s),lt=c,Vt=m;break;case 0:case 11:case 14:case 15:gt||$r(2,s,n),gt||$r(4,s,n),hr(t,n,s);break;case 1:gt||(zn(s,n),c=s.stateNode,typeof c.componentWillUnmount=="function"&&r0(s,n,c)),hr(t,n,s);break;case 21:hr(t,n,s);break;case 22:gt=(c=gt)||s.memoizedState!==null,hr(t,n,s),gt=c;break;default:hr(t,n,s)}}function d0(t,n){if(n.memoizedState===null&&(t=n.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{bi(t)}catch(s){ot(n,n.return,s)}}function $E(t){switch(t.tag){case 13:case 19:var n=t.stateNode;return n===null&&(n=t.stateNode=new i0),n;case 22:return t=t.stateNode,n=t._retryCache,n===null&&(n=t._retryCache=new i0),n;default:throw Error(a(435,t.tag))}}function Bf(t,n){var s=$E(t);n.forEach(function(c){var m=WE.bind(null,t,c);s.has(c)||(s.add(c),c.then(m,m))})}function Wt(t,n){var s=n.deletions;if(s!==null)for(var c=0;c<s.length;c++){var m=s[c],x=t,C=n,R=C;e:for(;R!==null;){switch(R.tag){case 27:if(Kr(R.type)){lt=R.stateNode,Vt=!1;break e}break;case 5:lt=R.stateNode,Vt=!1;break e;case 3:case 4:lt=R.stateNode.containerInfo,Vt=!0;break e}R=R.return}if(lt===null)throw Error(a(160));u0(x,C,m),lt=null,Vt=!1,x=m.alternate,x!==null&&(x.return=null),m.return=null}if(n.subtreeFlags&13878)for(n=n.child;n!==null;)f0(n,t),n=n.sibling}var bn=null;function f0(t,n){var s=t.alternate,c=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:Wt(n,t),Qt(t),c&4&&($r(3,t,t.return),ni(3,t),$r(5,t,t.return));break;case 1:Wt(n,t),Qt(t),c&512&&(gt||s===null||zn(s,s.return)),c&64&&mr&&(t=t.updateQueue,t!==null&&(c=t.callbacks,c!==null&&(s=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=s===null?c:s.concat(c))));break;case 26:var m=bn;if(Wt(n,t),Qt(t),c&512&&(gt||s===null||zn(s,s.return)),c&4){var x=s!==null?s.memoizedState:null;if(c=t.memoizedState,s===null)if(c===null)if(t.stateNode===null){e:{c=t.type,s=t.memoizedProps,m=m.ownerDocument||m;t:switch(c){case"title":x=m.getElementsByTagName("title")[0],(!x||x[yo]||x[Et]||x.namespaceURI==="http://www.w3.org/2000/svg"||x.hasAttribute("itemprop"))&&(x=m.createElement(c),m.head.insertBefore(x,m.querySelector("head > title"))),Mt(x,c,s),x[Et]=t,xt(x),c=x;break e;case"link":var C=sv("link","href",m).get(c+(s.href||""));if(C){for(var R=0;R<C.length;R++)if(x=C[R],x.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&x.getAttribute("rel")===(s.rel==null?null:s.rel)&&x.getAttribute("title")===(s.title==null?null:s.title)&&x.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){C.splice(R,1);break t}}x=m.createElement(c),Mt(x,c,s),m.head.appendChild(x);break;case"meta":if(C=sv("meta","content",m).get(c+(s.content||""))){for(R=0;R<C.length;R++)if(x=C[R],x.getAttribute("content")===(s.content==null?null:""+s.content)&&x.getAttribute("name")===(s.name==null?null:s.name)&&x.getAttribute("property")===(s.property==null?null:s.property)&&x.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&x.getAttribute("charset")===(s.charSet==null?null:s.charSet)){C.splice(R,1);break t}}x=m.createElement(c),Mt(x,c,s),m.head.appendChild(x);break;default:throw Error(a(468,c))}x[Et]=t,xt(x),c=x}t.stateNode=c}else iv(m,t.type,t.stateNode);else t.stateNode=av(m,c,t.memoizedProps);else x!==c?(x===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):x.count--,c===null?iv(m,t.type,t.stateNode):av(m,c,t.memoizedProps)):c===null&&t.stateNode!==null&&zf(t,t.memoizedProps,s.memoizedProps)}break;case 27:Wt(n,t),Qt(t),c&512&&(gt||s===null||zn(s,s.return)),s!==null&&c&4&&zf(t,t.memoizedProps,s.memoizedProps);break;case 5:if(Wt(n,t),Qt(t),c&512&&(gt||s===null||zn(s,s.return)),t.flags&32){m=t.stateNode;try{ca(m,"")}catch(oe){ot(t,t.return,oe)}}c&4&&t.stateNode!=null&&(m=t.memoizedProps,zf(t,m,s!==null?s.memoizedProps:m)),c&1024&&(Hf=!0);break;case 6:if(Wt(n,t),Qt(t),c&4){if(t.stateNode===null)throw Error(a(162));c=t.memoizedProps,s=t.stateNode;try{s.nodeValue=c}catch(oe){ot(t,t.return,oe)}}break;case 3:if(yc=null,m=bn,bn=xc(n.containerInfo),Wt(n,t),bn=m,Qt(t),c&4&&s!==null&&s.memoizedState.isDehydrated)try{bi(n.containerInfo)}catch(oe){ot(t,t.return,oe)}Hf&&(Hf=!1,m0(t));break;case 4:c=bn,bn=xc(t.stateNode.containerInfo),Wt(n,t),Qt(t),bn=c;break;case 12:Wt(n,t),Qt(t);break;case 13:Wt(n,t),Qt(t),t.child.flags&8192&&t.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(Yf=re()),c&4&&(c=t.updateQueue,c!==null&&(t.updateQueue=null,Bf(t,c)));break;case 22:m=t.memoizedState!==null;var $=s!==null&&s.memoizedState!==null,J=mr,ie=gt;if(mr=J||m,gt=ie||$,Wt(n,t),gt=ie,mr=J,Qt(t),c&8192)e:for(n=t.stateNode,n._visibility=m?n._visibility&-2:n._visibility|1,m&&(s===null||$||mr||gt||Oo(t)),s=null,n=t;;){if(n.tag===5||n.tag===26){if(s===null){$=s=n;try{if(x=$.stateNode,m)C=x.style,typeof C.setProperty=="function"?C.setProperty("display","none","important"):C.display="none";else{R=$.stateNode;var fe=$.memoizedProps.style,ne=fe!=null&&fe.hasOwnProperty("display")?fe.display:null;R.style.display=ne==null||typeof ne=="boolean"?"":(""+ne).trim()}}catch(oe){ot($,$.return,oe)}}}else if(n.tag===6){if(s===null){$=n;try{$.stateNode.nodeValue=m?"":$.memoizedProps}catch(oe){ot($,$.return,oe)}}}else if((n.tag!==22&&n.tag!==23||n.memoizedState===null||n===t)&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break e;for(;n.sibling===null;){if(n.return===null||n.return===t)break e;s===n&&(s=null),n=n.return}s===n&&(s=null),n.sibling.return=n.return,n=n.sibling}c&4&&(c=t.updateQueue,c!==null&&(s=c.retryQueue,s!==null&&(c.retryQueue=null,Bf(t,s))));break;case 19:Wt(n,t),Qt(t),c&4&&(c=t.updateQueue,c!==null&&(t.updateQueue=null,Bf(t,c)));break;case 30:break;case 21:break;default:Wt(n,t),Qt(t)}}function Qt(t){var n=t.flags;if(n&2){try{for(var s,c=t.return;c!==null;){if(a0(c)){s=c;break}c=c.return}if(s==null)throw Error(a(160));switch(s.tag){case 27:var m=s.stateNode,x=Lf(t);oc(t,x,m);break;case 5:var C=s.stateNode;s.flags&32&&(ca(C,""),s.flags&=-33);var R=Lf(t);oc(t,R,C);break;case 3:case 4:var $=s.stateNode.containerInfo,J=Lf(t);If(t,J,$);break;default:throw Error(a(161))}}catch(ie){ot(t,t.return,ie)}t.flags&=-3}n&4096&&(t.flags&=-4097)}function m0(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var n=t;m0(n),n.tag===5&&n.flags&1024&&n.stateNode.reset(),t=t.sibling}}function Vr(t,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)l0(t,n.alternate,n),n=n.sibling}function Oo(t){for(t=t.child;t!==null;){var n=t;switch(n.tag){case 0:case 11:case 14:case 15:$r(4,n,n.return),Oo(n);break;case 1:zn(n,n.return);var s=n.stateNode;typeof s.componentWillUnmount=="function"&&r0(n,n.return,s),Oo(n);break;case 27:fi(n.stateNode);case 26:case 5:zn(n,n.return),Oo(n);break;case 22:n.memoizedState===null&&Oo(n);break;case 30:Oo(n);break;default:Oo(n)}t=t.sibling}}function qr(t,n,s){for(s=s&&(n.subtreeFlags&8772)!==0,n=n.child;n!==null;){var c=n.alternate,m=t,x=n,C=x.flags;switch(x.tag){case 0:case 11:case 15:qr(m,x,s),ni(4,x);break;case 1:if(qr(m,x,s),c=x,m=c.stateNode,typeof m.componentDidMount=="function")try{m.componentDidMount()}catch(J){ot(c,c.return,J)}if(c=x,m=c.updateQueue,m!==null){var R=c.stateNode;try{var $=m.shared.hiddenCallbacks;if($!==null)for(m.shared.hiddenCallbacks=null,m=0;m<$.length;m++)$g($[m],R)}catch(J){ot(c,c.return,J)}}s&&C&64&&n0(x),ri(x,x.return);break;case 27:s0(x);case 26:case 5:qr(m,x,s),s&&c===null&&C&4&&o0(x),ri(x,x.return);break;case 12:qr(m,x,s);break;case 13:qr(m,x,s),s&&C&4&&d0(m,x);break;case 22:x.memoizedState===null&&qr(m,x,s),ri(x,x.return);break;case 30:break;default:qr(m,x,s)}n=n.sibling}}function Uf(t,n){var s=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),t=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(t=n.memoizedState.cachePool.pool),t!==s&&(t!=null&&t.refCount++,s!=null&&$s(s))}function Pf(t,n){t=null,n.alternate!==null&&(t=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==t&&(n.refCount++,t!=null&&$s(t))}function Ln(t,n,s,c){if(n.subtreeFlags&10256)for(n=n.child;n!==null;)h0(t,n,s,c),n=n.sibling}function h0(t,n,s,c){var m=n.flags;switch(n.tag){case 0:case 11:case 15:Ln(t,n,s,c),m&2048&&ni(9,n);break;case 1:Ln(t,n,s,c);break;case 3:Ln(t,n,s,c),m&2048&&(t=null,n.alternate!==null&&(t=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==t&&(n.refCount++,t!=null&&$s(t)));break;case 12:if(m&2048){Ln(t,n,s,c),t=n.stateNode;try{var x=n.memoizedProps,C=x.id,R=x.onPostCommit;typeof R=="function"&&R(C,n.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch($){ot(n,n.return,$)}}else Ln(t,n,s,c);break;case 13:Ln(t,n,s,c);break;case 23:break;case 22:x=n.stateNode,C=n.alternate,n.memoizedState!==null?x._visibility&2?Ln(t,n,s,c):oi(t,n):x._visibility&2?Ln(t,n,s,c):(x._visibility|=2,ka(t,n,s,c,(n.subtreeFlags&10256)!==0)),m&2048&&Uf(C,n);break;case 24:Ln(t,n,s,c),m&2048&&Pf(n.alternate,n);break;default:Ln(t,n,s,c)}}function ka(t,n,s,c,m){for(m=m&&(n.subtreeFlags&10256)!==0,n=n.child;n!==null;){var x=t,C=n,R=s,$=c,J=C.flags;switch(C.tag){case 0:case 11:case 15:ka(x,C,R,$,m),ni(8,C);break;case 23:break;case 22:var ie=C.stateNode;C.memoizedState!==null?ie._visibility&2?ka(x,C,R,$,m):oi(x,C):(ie._visibility|=2,ka(x,C,R,$,m)),m&&J&2048&&Uf(C.alternate,C);break;case 24:ka(x,C,R,$,m),m&&J&2048&&Pf(C.alternate,C);break;default:ka(x,C,R,$,m)}n=n.sibling}}function oi(t,n){if(n.subtreeFlags&10256)for(n=n.child;n!==null;){var s=t,c=n,m=c.flags;switch(c.tag){case 22:oi(s,c),m&2048&&Uf(c.alternate,c);break;case 24:oi(s,c),m&2048&&Pf(c.alternate,c);break;default:oi(s,c)}n=n.sibling}}var ai=8192;function Aa(t){if(t.subtreeFlags&ai)for(t=t.child;t!==null;)p0(t),t=t.sibling}function p0(t){switch(t.tag){case 26:Aa(t),t.flags&ai&&t.memoizedState!==null&&C_(bn,t.memoizedState,t.memoizedProps);break;case 5:Aa(t);break;case 3:case 4:var n=bn;bn=xc(t.stateNode.containerInfo),Aa(t),bn=n;break;case 22:t.memoizedState===null&&(n=t.alternate,n!==null&&n.memoizedState!==null?(n=ai,ai=16777216,Aa(t),ai=n):Aa(t));break;default:Aa(t)}}function g0(t){var n=t.alternate;if(n!==null&&(t=n.child,t!==null)){n.child=null;do n=t.sibling,t.sibling=null,t=n;while(t!==null)}}function si(t){var n=t.deletions;if((t.flags&16)!==0){if(n!==null)for(var s=0;s<n.length;s++){var c=n[s];jt=c,v0(c,t)}g0(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)x0(t),t=t.sibling}function x0(t){switch(t.tag){case 0:case 11:case 15:si(t),t.flags&2048&&$r(9,t,t.return);break;case 3:si(t);break;case 12:si(t);break;case 22:var n=t.stateNode;t.memoizedState!==null&&n._visibility&2&&(t.return===null||t.return.tag!==13)?(n._visibility&=-3,ac(t)):si(t);break;default:si(t)}}function ac(t){var n=t.deletions;if((t.flags&16)!==0){if(n!==null)for(var s=0;s<n.length;s++){var c=n[s];jt=c,v0(c,t)}g0(t)}for(t=t.child;t!==null;){switch(n=t,n.tag){case 0:case 11:case 15:$r(8,n,n.return),ac(n);break;case 22:s=n.stateNode,s._visibility&2&&(s._visibility&=-3,ac(n));break;default:ac(n)}t=t.sibling}}function v0(t,n){for(;jt!==null;){var s=jt;switch(s.tag){case 0:case 11:case 15:$r(8,s,n);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var c=s.memoizedState.cachePool.pool;c!=null&&c.refCount++}break;case 24:$s(s.memoizedState.cache)}if(c=s.child,c!==null)c.return=s,jt=c;else e:for(s=t;jt!==null;){c=jt;var m=c.sibling,x=c.return;if(c0(c),c===s){jt=null;break e}if(m!==null){m.return=x,jt=m;break e}jt=x}}}var VE={getCacheForType:function(t){var n=Ot(wt),s=n.data.get(t);return s===void 0&&(s=t(),n.data.set(t,s)),s}},qE=typeof WeakMap=="function"?WeakMap:Map,Je=0,st=null,$e=null,Ge=0,et=0,Jt=null,Yr=!1,Ma=!1,$f=!1,pr=0,mt=0,Gr=0,zo=0,Vf=0,hn=0,Ta=0,ii=null,qt=null,qf=!1,Yf=0,sc=1/0,ic=null,Xr=null,At=0,Fr=null,Ra=null,Da=0,Gf=0,Xf=null,y0=null,li=0,Ff=null;function en(){if((Je&2)!==0&&Ge!==0)return Ge&-Ge;if(E.T!==null){var t=ba;return t!==0?t:tm()}return hl()}function b0(){hn===0&&(hn=(Ge&536870912)===0||We?dl():536870912);var t=mn.current;return t!==null&&(t.flags|=32),hn}function tn(t,n,s){(t===st&&(et===2||et===9)||t.cancelPendingCommit!==null)&&(Oa(t,0),Zr(t,Ge,hn,!1)),vo(t,s),((Je&2)===0||t!==st)&&(t===st&&((Je&2)===0&&(zo|=s),mt===4&&Zr(t,Ge,hn,!1)),In(t))}function w0(t,n,s){if((Je&6)!==0)throw Error(a(327));var c=!s&&(n&124)===0&&(n&t.expiredLanes)===0||xo(t,n),m=c?XE(t,n):Wf(t,n,!0),x=c;do{if(m===0){Ma&&!c&&Zr(t,n,0,!1);break}else{if(s=t.current.alternate,x&&!YE(s)){m=Wf(t,n,!1),x=!1;continue}if(m===2){if(x=n,t.errorRecoveryDisabledLanes&x)var C=0;else C=t.pendingLanes&-536870913,C=C!==0?C:C&536870912?536870912:0;if(C!==0){n=C;e:{var R=t;m=ii;var $=R.current.memoizedState.isDehydrated;if($&&(Oa(R,C).flags|=256),C=Wf(R,C,!1),C!==2){if($f&&!$){R.errorRecoveryDisabledLanes|=x,zo|=x,m=4;break e}x=qt,qt=m,x!==null&&(qt===null?qt=x:qt.push.apply(qt,x))}m=C}if(x=!1,m!==2)continue}}if(m===1){Oa(t,0),Zr(t,n,0,!0);break}e:{switch(c=t,x=m,x){case 0:case 1:throw Error(a(345));case 4:if((n&4194048)!==n)break;case 6:Zr(c,n,hn,!Yr);break e;case 2:qt=null;break;case 3:case 5:break;default:throw Error(a(329))}if((n&62914560)===n&&(m=Yf+300-re(),10<m)){if(Zr(c,n,hn,!Yr),oa(c,0,!0)!==0)break e;c.timeoutHandle=K0(N0.bind(null,c,s,qt,ic,qf,n,hn,zo,Ta,Yr,x,2,-0,0),m);break e}N0(c,s,qt,ic,qf,n,hn,zo,Ta,Yr,x,0,-0,0)}}break}while(!0);In(t)}function N0(t,n,s,c,m,x,C,R,$,J,ie,fe,ne,oe){if(t.timeoutHandle=-1,fe=n.subtreeFlags,(fe&8192||(fe&16785408)===16785408)&&(pi={stylesheets:null,count:0,unsuspend:j_},p0(n),fe=k_(),fe!==null)){t.cancelPendingCommit=fe(A0.bind(null,t,n,x,s,c,m,C,R,$,ie,1,ne,oe)),Zr(t,x,C,!J);return}A0(t,n,x,s,c,m,C,R,$)}function YE(t){for(var n=t;;){var s=n.tag;if((s===0||s===11||s===15)&&n.flags&16384&&(s=n.updateQueue,s!==null&&(s=s.stores,s!==null)))for(var c=0;c<s.length;c++){var m=s[c],x=m.getSnapshot;m=m.value;try{if(!Zt(x(),m))return!1}catch{return!1}}if(s=n.child,n.subtreeFlags&16384&&s!==null)s.return=n,n=s;else{if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function Zr(t,n,s,c){n&=~Vf,n&=~zo,t.suspendedLanes|=n,t.pingedLanes&=~n,c&&(t.warmLanes|=n),c=t.expirationTimes;for(var m=n;0<m;){var x=31-ht(m),C=1<<x;c[x]=-1,m&=~C}s!==0&&ml(t,s,n)}function lc(){return(Je&6)===0?(ci(0),!1):!0}function Zf(){if($e!==null){if(et===0)var t=$e.return;else t=$e,ir=Ao=null,ff(t),ja=null,Js=0,t=$e;for(;t!==null;)t0(t.alternate,t),t=t.return;$e=null}}function Oa(t,n){var s=t.timeoutHandle;s!==-1&&(t.timeoutHandle=-1,c_(s)),s=t.cancelPendingCommit,s!==null&&(t.cancelPendingCommit=null,s()),Zf(),st=t,$e=s=or(t.current,null),Ge=n,et=0,Jt=null,Yr=!1,Ma=xo(t,n),$f=!1,Ta=hn=Vf=zo=Gr=mt=0,qt=ii=null,qf=!1,(n&8)!==0&&(n|=n&32);var c=t.entangledLanes;if(c!==0)for(t=t.entanglements,c&=n;0<c;){var m=31-ht(c),x=1<<m;n|=t[m],c&=~x}return pr=n,Ml(),s}function S0(t,n){Ie=null,E.H=Zl,n===qs||n===Bl?(n=Ug(),et=3):n===Ig?(n=Ug(),et=4):et=n===Px?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,Jt=n,$e===null&&(mt=1,ec(t,cn(n,t.current)))}function E0(){var t=E.H;return E.H=Zl,t===null?Zl:t}function _0(){var t=E.A;return E.A=VE,t}function Kf(){mt=4,Yr||(Ge&4194048)!==Ge&&mn.current!==null||(Ma=!0),(Gr&134217727)===0&&(zo&134217727)===0||st===null||Zr(st,Ge,hn,!1)}function Wf(t,n,s){var c=Je;Je|=2;var m=E0(),x=_0();(st!==t||Ge!==n)&&(ic=null,Oa(t,n)),n=!1;var C=mt;e:do try{if(et!==0&&$e!==null){var R=$e,$=Jt;switch(et){case 8:Zf(),C=6;break e;case 3:case 2:case 9:case 6:mn.current===null&&(n=!0);var J=et;if(et=0,Jt=null,za(t,R,$,J),s&&Ma){C=0;break e}break;default:J=et,et=0,Jt=null,za(t,R,$,J)}}GE(),C=mt;break}catch(ie){S0(t,ie)}while(!0);return n&&t.shellSuspendCounter++,ir=Ao=null,Je=c,E.H=m,E.A=x,$e===null&&(st=null,Ge=0,Ml()),C}function GE(){for(;$e!==null;)j0($e)}function XE(t,n){var s=Je;Je|=2;var c=E0(),m=_0();st!==t||Ge!==n?(ic=null,sc=re()+500,Oa(t,n)):Ma=xo(t,n);e:do try{if(et!==0&&$e!==null){n=$e;var x=Jt;t:switch(et){case 1:et=0,Jt=null,za(t,n,x,1);break;case 2:case 9:if(Hg(x)){et=0,Jt=null,C0(n);break}n=function(){et!==2&&et!==9||st!==t||(et=7),In(t)},x.then(n,n);break e;case 3:et=7;break e;case 4:et=5;break e;case 7:Hg(x)?(et=0,Jt=null,C0(n)):(et=0,Jt=null,za(t,n,x,7));break;case 5:var C=null;switch($e.tag){case 26:C=$e.memoizedState;case 5:case 27:var R=$e;if(!C||lv(C)){et=0,Jt=null;var $=R.sibling;if($!==null)$e=$;else{var J=R.return;J!==null?($e=J,cc(J)):$e=null}break t}}et=0,Jt=null,za(t,n,x,5);break;case 6:et=0,Jt=null,za(t,n,x,6);break;case 8:Zf(),mt=6;break e;default:throw Error(a(462))}}FE();break}catch(ie){S0(t,ie)}while(!0);return ir=Ao=null,E.H=c,E.A=m,Je=s,$e!==null?0:(st=null,Ge=0,Ml(),mt)}function FE(){for(;$e!==null&&!Be();)j0($e)}function j0(t){var n=Jx(t.alternate,t,pr);t.memoizedProps=t.pendingProps,n===null?cc(t):$e=n}function C0(t){var n=t,s=n.alternate;switch(n.tag){case 15:case 0:n=Xx(s,n,n.pendingProps,n.type,void 0,Ge);break;case 11:n=Xx(s,n,n.pendingProps,n.type.render,n.ref,Ge);break;case 5:ff(n);default:t0(s,n),n=$e=kg(n,pr),n=Jx(s,n,pr)}t.memoizedProps=t.pendingProps,n===null?cc(t):$e=n}function za(t,n,s,c){ir=Ao=null,ff(n),ja=null,Js=0;var m=n.return;try{if(IE(t,m,n,s,Ge)){mt=1,ec(t,cn(s,t.current)),$e=null;return}}catch(x){if(m!==null)throw $e=m,x;mt=1,ec(t,cn(s,t.current)),$e=null;return}n.flags&32768?(We||c===1?t=!0:Ma||(Ge&536870912)!==0?t=!1:(Yr=t=!0,(c===2||c===9||c===3||c===6)&&(c=mn.current,c!==null&&c.tag===13&&(c.flags|=16384))),k0(n,t)):cc(n)}function cc(t){var n=t;do{if((n.flags&32768)!==0){k0(n,Yr);return}t=n.return;var s=BE(n.alternate,n,pr);if(s!==null){$e=s;return}if(n=n.sibling,n!==null){$e=n;return}$e=n=t}while(n!==null);mt===0&&(mt=5)}function k0(t,n){do{var s=UE(t.alternate,t);if(s!==null){s.flags&=32767,$e=s;return}if(s=t.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!n&&(t=t.sibling,t!==null)){$e=t;return}$e=t=s}while(t!==null);mt=6,$e=null}function A0(t,n,s,c,m,x,C,R,$){t.cancelPendingCommit=null;do uc();while(At!==0);if((Je&6)!==0)throw Error(a(327));if(n!==null){if(n===t.current)throw Error(a(177));if(x=n.lanes|n.childLanes,x|=Ud,md(t,s,x,C,R,$),t===st&&($e=st=null,Ge=0),Ra=n,Fr=t,Da=s,Gf=x,Xf=m,y0=c,(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,QE(be,function(){return O0(),null})):(t.callbackNode=null,t.callbackPriority=0),c=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||c){c=E.T,E.T=null,m=O.p,O.p=2,C=Je,Je|=4;try{PE(t,n,s)}finally{Je=C,O.p=m,E.T=c}}At=1,M0(),T0(),R0()}}function M0(){if(At===1){At=0;var t=Fr,n=Ra,s=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||s){s=E.T,E.T=null;var c=O.p;O.p=2;var m=Je;Je|=4;try{f0(n,t);var x=cm,C=vg(t.containerInfo),R=x.focusedElem,$=x.selectionRange;if(C!==R&&R&&R.ownerDocument&&xg(R.ownerDocument.documentElement,R)){if($!==null&&zd(R)){var J=$.start,ie=$.end;if(ie===void 0&&(ie=J),"selectionStart"in R)R.selectionStart=J,R.selectionEnd=Math.min(ie,R.value.length);else{var fe=R.ownerDocument||document,ne=fe&&fe.defaultView||window;if(ne.getSelection){var oe=ne.getSelection(),Re=R.textContent.length,Ae=Math.min($.start,Re),rt=$.end===void 0?Ae:Math.min($.end,Re);!oe.extend&&Ae>rt&&(C=rt,rt=Ae,Ae=C);var F=gg(R,Ae),Y=gg(R,rt);if(F&&Y&&(oe.rangeCount!==1||oe.anchorNode!==F.node||oe.anchorOffset!==F.offset||oe.focusNode!==Y.node||oe.focusOffset!==Y.offset)){var W=fe.createRange();W.setStart(F.node,F.offset),oe.removeAllRanges(),Ae>rt?(oe.addRange(W),oe.extend(Y.node,Y.offset)):(W.setEnd(Y.node,Y.offset),oe.addRange(W))}}}}for(fe=[],oe=R;oe=oe.parentNode;)oe.nodeType===1&&fe.push({element:oe,left:oe.scrollLeft,top:oe.scrollTop});for(typeof R.focus=="function"&&R.focus(),R=0;R<fe.length;R++){var ce=fe[R];ce.element.scrollLeft=ce.left,ce.element.scrollTop=ce.top}}Nc=!!lm,cm=lm=null}finally{Je=m,O.p=c,E.T=s}}t.current=n,At=2}}function T0(){if(At===2){At=0;var t=Fr,n=Ra,s=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||s){s=E.T,E.T=null;var c=O.p;O.p=2;var m=Je;Je|=4;try{l0(t,n.alternate,n)}finally{Je=m,O.p=c,E.T=s}}At=3}}function R0(){if(At===4||At===3){At=0,at();var t=Fr,n=Ra,s=Da,c=y0;(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?At=5:(At=0,Ra=Fr=null,D0(t,t.pendingLanes));var m=t.pendingLanes;if(m===0&&(Xr=null),bs(s),n=n.stateNode,Ue&&typeof Ue.onCommitFiberRoot=="function")try{Ue.onCommitFiberRoot(Fe,n,void 0,(n.current.flags&128)===128)}catch{}if(c!==null){n=E.T,m=O.p,O.p=2,E.T=null;try{for(var x=t.onRecoverableError,C=0;C<c.length;C++){var R=c[C];x(R.value,{componentStack:R.stack})}}finally{E.T=n,O.p=m}}(Da&3)!==0&&uc(),In(t),m=t.pendingLanes,(s&4194090)!==0&&(m&42)!==0?t===Ff?li++:(li=0,Ff=t):li=0,ci(0)}}function D0(t,n){(t.pooledCacheLanes&=n)===0&&(n=t.pooledCache,n!=null&&(t.pooledCache=null,$s(n)))}function uc(t){return M0(),T0(),R0(),O0()}function O0(){if(At!==5)return!1;var t=Fr,n=Gf;Gf=0;var s=bs(Da),c=E.T,m=O.p;try{O.p=32>s?32:s,E.T=null,s=Xf,Xf=null;var x=Fr,C=Da;if(At=0,Ra=Fr=null,Da=0,(Je&6)!==0)throw Error(a(331));var R=Je;if(Je|=4,x0(x.current),h0(x,x.current,C,s),Je=R,ci(0,!1),Ue&&typeof Ue.onPostCommitFiberRoot=="function")try{Ue.onPostCommitFiberRoot(Fe,x)}catch{}return!0}finally{O.p=m,E.T=c,D0(t,n)}}function z0(t,n,s){n=cn(s,n),n=jf(t.stateNode,n,2),t=Hr(t,n,2),t!==null&&(vo(t,2),In(t))}function ot(t,n,s){if(t.tag===3)z0(t,t,s);else for(;n!==null;){if(n.tag===3){z0(n,t,s);break}else if(n.tag===1){var c=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof c.componentDidCatch=="function"&&(Xr===null||!Xr.has(c))){t=cn(s,t),s=Bx(2),c=Hr(n,s,2),c!==null&&(Ux(s,c,n,t),vo(c,2),In(c));break}}n=n.return}}function Qf(t,n,s){var c=t.pingCache;if(c===null){c=t.pingCache=new qE;var m=new Set;c.set(n,m)}else m=c.get(n),m===void 0&&(m=new Set,c.set(n,m));m.has(s)||($f=!0,m.add(s),t=ZE.bind(null,t,n,s),n.then(t,t))}function ZE(t,n,s){var c=t.pingCache;c!==null&&c.delete(n),t.pingedLanes|=t.suspendedLanes&s,t.warmLanes&=~s,st===t&&(Ge&s)===s&&(mt===4||mt===3&&(Ge&62914560)===Ge&&300>re()-Yf?(Je&2)===0&&Oa(t,0):Vf|=s,Ta===Ge&&(Ta=0)),In(t)}function L0(t,n){n===0&&(n=fl()),t=ga(t,n),t!==null&&(vo(t,n),In(t))}function KE(t){var n=t.memoizedState,s=0;n!==null&&(s=n.retryLane),L0(t,s)}function WE(t,n){var s=0;switch(t.tag){case 13:var c=t.stateNode,m=t.memoizedState;m!==null&&(s=m.retryLane);break;case 19:c=t.stateNode;break;case 22:c=t.stateNode._retryCache;break;default:throw Error(a(314))}c!==null&&c.delete(n),L0(t,s)}function QE(t,n){return xe(t,n)}var dc=null,La=null,Jf=!1,fc=!1,em=!1,Lo=0;function In(t){t!==La&&t.next===null&&(La===null?dc=La=t:La=La.next=t),fc=!0,Jf||(Jf=!0,e_())}function ci(t,n){if(!em&&fc){em=!0;do for(var s=!1,c=dc;c!==null;){if(t!==0){var m=c.pendingLanes;if(m===0)var x=0;else{var C=c.suspendedLanes,R=c.pingedLanes;x=(1<<31-ht(42|t)+1)-1,x&=m&~(C&~R),x=x&201326741?x&201326741|1:x?x|2:0}x!==0&&(s=!0,U0(c,x))}else x=Ge,x=oa(c,c===st?x:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),(x&3)===0||xo(c,x)||(s=!0,U0(c,x));c=c.next}while(s);em=!1}}function JE(){I0()}function I0(){fc=Jf=!1;var t=0;Lo!==0&&(l_()&&(t=Lo),Lo=0);for(var n=re(),s=null,c=dc;c!==null;){var m=c.next,x=H0(c,n);x===0?(c.next=null,s===null?dc=m:s.next=m,m===null&&(La=s)):(s=c,(t!==0||(x&3)!==0)&&(fc=!0)),c=m}ci(t)}function H0(t,n){for(var s=t.suspendedLanes,c=t.pingedLanes,m=t.expirationTimes,x=t.pendingLanes&-62914561;0<x;){var C=31-ht(x),R=1<<C,$=m[C];$===-1?((R&s)===0||(R&c)!==0)&&(m[C]=fd(R,n)):$<=n&&(t.expiredLanes|=R),x&=~R}if(n=st,s=Ge,s=oa(t,t===n?s:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),c=t.callbackNode,s===0||t===n&&(et===2||et===9)||t.cancelPendingCommit!==null)return c!==null&&c!==null&&ge(c),t.callbackNode=null,t.callbackPriority=0;if((s&3)===0||xo(t,s)){if(n=s&-s,n===t.callbackPriority)return n;switch(c!==null&&ge(c),bs(s)){case 2:case 8:s=De;break;case 32:s=be;break;case 268435456:s=Ye;break;default:s=be}return c=B0.bind(null,t),s=xe(s,c),t.callbackPriority=n,t.callbackNode=s,n}return c!==null&&c!==null&&ge(c),t.callbackPriority=2,t.callbackNode=null,2}function B0(t,n){if(At!==0&&At!==5)return t.callbackNode=null,t.callbackPriority=0,null;var s=t.callbackNode;if(uc()&&t.callbackNode!==s)return null;var c=Ge;return c=oa(t,t===st?c:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),c===0?null:(w0(t,c,n),H0(t,re()),t.callbackNode!=null&&t.callbackNode===s?B0.bind(null,t):null)}function U0(t,n){if(uc())return null;w0(t,n,!0)}function e_(){u_(function(){(Je&6)!==0?xe(ke,JE):I0()})}function tm(){return Lo===0&&(Lo=dl()),Lo}function P0(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:Sl(""+t)}function $0(t,n){var s=n.ownerDocument.createElement("input");return s.name=n.name,s.value=n.value,t.id&&s.setAttribute("form",t.id),n.parentNode.insertBefore(s,n),t=new FormData(t),s.parentNode.removeChild(s),t}function t_(t,n,s,c,m){if(n==="submit"&&s&&s.stateNode===m){var x=P0((m[Dt]||null).action),C=c.submitter;C&&(n=(n=C[Dt]||null)?P0(n.formAction):C.getAttribute("formAction"),n!==null&&(x=n,C=null));var R=new Cl("action","action",null,c,m);t.push({event:R,listeners:[{instance:null,listener:function(){if(c.defaultPrevented){if(Lo!==0){var $=C?$0(m,C):new FormData(m);wf(s,{pending:!0,data:$,method:m.method,action:x},null,$)}}else typeof x=="function"&&(R.preventDefault(),$=C?$0(m,C):new FormData(m),wf(s,{pending:!0,data:$,method:m.method,action:x},x,$))},currentTarget:m}]})}}for(var nm=0;nm<Bd.length;nm++){var rm=Bd[nm],n_=rm.toLowerCase(),r_=rm[0].toUpperCase()+rm.slice(1);yn(n_,"on"+r_)}yn(wg,"onAnimationEnd"),yn(Ng,"onAnimationIteration"),yn(Sg,"onAnimationStart"),yn("dblclick","onDoubleClick"),yn("focusin","onFocus"),yn("focusout","onBlur"),yn(bE,"onTransitionRun"),yn(wE,"onTransitionStart"),yn(NE,"onTransitionCancel"),yn(Eg,"onTransitionEnd"),Dr("onMouseEnter",["mouseout","mouseover"]),Dr("onMouseLeave",["mouseout","mouseover"]),Dr("onPointerEnter",["pointerout","pointerover"]),Dr("onPointerLeave",["pointerout","pointerover"]),er("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),er("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),er("onBeforeInput",["compositionend","keypress","textInput","paste"]),er("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),er("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),er("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ui="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),o_=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(ui));function V0(t,n){n=(n&4)!==0;for(var s=0;s<t.length;s++){var c=t[s],m=c.event;c=c.listeners;e:{var x=void 0;if(n)for(var C=c.length-1;0<=C;C--){var R=c[C],$=R.instance,J=R.currentTarget;if(R=R.listener,$!==x&&m.isPropagationStopped())break e;x=R,m.currentTarget=J;try{x(m)}catch(ie){Jl(ie)}m.currentTarget=null,x=$}else for(C=0;C<c.length;C++){if(R=c[C],$=R.instance,J=R.currentTarget,R=R.listener,$!==x&&m.isPropagationStopped())break e;x=R,m.currentTarget=J;try{x(m)}catch(ie){Jl(ie)}m.currentTarget=null,x=$}}}}function Ve(t,n){var s=n[ws];s===void 0&&(s=n[ws]=new Set);var c=t+"__bubble";s.has(c)||(q0(n,t,2,!1),s.add(c))}function om(t,n,s){var c=0;n&&(c|=4),q0(s,t,c,n)}var mc="_reactListening"+Math.random().toString(36).slice(2);function am(t){if(!t[mc]){t[mc]=!0,gl.forEach(function(s){s!=="selectionchange"&&(o_.has(s)||om(s,!1,t),om(s,!0,t))});var n=t.nodeType===9?t:t.ownerDocument;n===null||n[mc]||(n[mc]=!0,om("selectionchange",!1,n))}}function q0(t,n,s,c){switch(hv(n)){case 2:var m=T_;break;case 8:m=R_;break;default:m=ym}s=m.bind(null,n,s,t),m=void 0,!jd||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(m=!0),c?m!==void 0?t.addEventListener(n,s,{capture:!0,passive:m}):t.addEventListener(n,s,!0):m!==void 0?t.addEventListener(n,s,{passive:m}):t.addEventListener(n,s,!1)}function sm(t,n,s,c,m){var x=c;if((n&1)===0&&(n&2)===0&&c!==null)e:for(;;){if(c===null)return;var C=c.tag;if(C===3||C===4){var R=c.stateNode.containerInfo;if(R===m)break;if(C===4)for(C=c.return;C!==null;){var $=C.tag;if(($===3||$===4)&&C.stateNode.containerInfo===m)return;C=C.return}for(;R!==null;){if(C=Tr(R),C===null)return;if($=C.tag,$===5||$===6||$===26||$===27){c=x=C;continue e}R=R.parentNode}}c=c.return}Wp(function(){var J=x,ie=Ed(s),fe=[];e:{var ne=_g.get(t);if(ne!==void 0){var oe=Cl,Re=t;switch(t){case"keypress":if(_l(s)===0)break e;case"keydown":case"keyup":oe=QS;break;case"focusin":Re="focus",oe=Md;break;case"focusout":Re="blur",oe=Md;break;case"beforeblur":case"afterblur":oe=Md;break;case"click":if(s.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":oe=eg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":oe=US;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":oe=tE;break;case wg:case Ng:case Sg:oe=VS;break;case Eg:oe=rE;break;case"scroll":case"scrollend":oe=HS;break;case"wheel":oe=aE;break;case"copy":case"cut":case"paste":oe=YS;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":oe=ng;break;case"toggle":case"beforetoggle":oe=iE}var Ae=(n&4)!==0,rt=!Ae&&(t==="scroll"||t==="scrollend"),F=Ae?ne!==null?ne+"Capture":null:ne;Ae=[];for(var Y=J,W;Y!==null;){var ce=Y;if(W=ce.stateNode,ce=ce.tag,ce!==5&&ce!==26&&ce!==27||W===null||F===null||(ce=As(Y,F),ce!=null&&Ae.push(di(Y,ce,W))),rt)break;Y=Y.return}0<Ae.length&&(ne=new oe(ne,Re,null,s,ie),fe.push({event:ne,listeners:Ae}))}}if((n&7)===0){e:{if(ne=t==="mouseover"||t==="pointerover",oe=t==="mouseout"||t==="pointerout",ne&&s!==Sd&&(Re=s.relatedTarget||s.fromElement)&&(Tr(Re)||Re[Mr]))break e;if((oe||ne)&&(ne=ie.window===ie?ie:(ne=ie.ownerDocument)?ne.defaultView||ne.parentWindow:window,oe?(Re=s.relatedTarget||s.toElement,oe=J,Re=Re?Tr(Re):null,Re!==null&&(rt=u(Re),Ae=Re.tag,Re!==rt||Ae!==5&&Ae!==27&&Ae!==6)&&(Re=null)):(oe=null,Re=J),oe!==Re)){if(Ae=eg,ce="onMouseLeave",F="onMouseEnter",Y="mouse",(t==="pointerout"||t==="pointerover")&&(Ae=ng,ce="onPointerLeave",F="onPointerEnter",Y="pointer"),rt=oe==null?ne:Rr(oe),W=Re==null?ne:Rr(Re),ne=new Ae(ce,Y+"leave",oe,s,ie),ne.target=rt,ne.relatedTarget=W,ce=null,Tr(ie)===J&&(Ae=new Ae(F,Y+"enter",Re,s,ie),Ae.target=W,Ae.relatedTarget=rt,ce=Ae),rt=ce,oe&&Re)t:{for(Ae=oe,F=Re,Y=0,W=Ae;W;W=Ia(W))Y++;for(W=0,ce=F;ce;ce=Ia(ce))W++;for(;0<Y-W;)Ae=Ia(Ae),Y--;for(;0<W-Y;)F=Ia(F),W--;for(;Y--;){if(Ae===F||F!==null&&Ae===F.alternate)break t;Ae=Ia(Ae),F=Ia(F)}Ae=null}else Ae=null;oe!==null&&Y0(fe,ne,oe,Ae,!1),Re!==null&&rt!==null&&Y0(fe,rt,Re,Ae,!0)}}e:{if(ne=J?Rr(J):window,oe=ne.nodeName&&ne.nodeName.toLowerCase(),oe==="select"||oe==="input"&&ne.type==="file")var we=ug;else if(lg(ne))if(dg)we=xE;else{we=pE;var Pe=hE}else oe=ne.nodeName,!oe||oe.toLowerCase()!=="input"||ne.type!=="checkbox"&&ne.type!=="radio"?J&&Nd(J.elementType)&&(we=ug):we=gE;if(we&&(we=we(t,J))){cg(fe,we,s,ie);break e}Pe&&Pe(t,ne,J),t==="focusout"&&J&&ne.type==="number"&&J.memoizedProps.value!=null&&ks(ne,"number",ne.value)}switch(Pe=J?Rr(J):window,t){case"focusin":(lg(Pe)||Pe.contentEditable==="true")&&(ma=Pe,Ld=J,Is=null);break;case"focusout":Is=Ld=ma=null;break;case"mousedown":Id=!0;break;case"contextmenu":case"mouseup":case"dragend":Id=!1,yg(fe,s,ie);break;case"selectionchange":if(yE)break;case"keydown":case"keyup":yg(fe,s,ie)}var je;if(Rd)e:{switch(t){case"compositionstart":var Me="onCompositionStart";break e;case"compositionend":Me="onCompositionEnd";break e;case"compositionupdate":Me="onCompositionUpdate";break e}Me=void 0}else fa?sg(t,s)&&(Me="onCompositionEnd"):t==="keydown"&&s.keyCode===229&&(Me="onCompositionStart");Me&&(rg&&s.locale!=="ko"&&(fa||Me!=="onCompositionStart"?Me==="onCompositionEnd"&&fa&&(je=Qp()):(Or=ie,Cd="value"in Or?Or.value:Or.textContent,fa=!0)),Pe=hc(J,Me),0<Pe.length&&(Me=new tg(Me,t,null,s,ie),fe.push({event:Me,listeners:Pe}),je?Me.data=je:(je=ig(s),je!==null&&(Me.data=je)))),(je=cE?uE(t,s):dE(t,s))&&(Me=hc(J,"onBeforeInput"),0<Me.length&&(Pe=new tg("onBeforeInput","beforeinput",null,s,ie),fe.push({event:Pe,listeners:Me}),Pe.data=je)),t_(fe,t,J,s,ie)}V0(fe,n)})}function di(t,n,s){return{instance:t,listener:n,currentTarget:s}}function hc(t,n){for(var s=n+"Capture",c=[];t!==null;){var m=t,x=m.stateNode;if(m=m.tag,m!==5&&m!==26&&m!==27||x===null||(m=As(t,s),m!=null&&c.unshift(di(t,m,x)),m=As(t,n),m!=null&&c.push(di(t,m,x))),t.tag===3)return c;t=t.return}return[]}function Ia(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function Y0(t,n,s,c,m){for(var x=n._reactName,C=[];s!==null&&s!==c;){var R=s,$=R.alternate,J=R.stateNode;if(R=R.tag,$!==null&&$===c)break;R!==5&&R!==26&&R!==27||J===null||($=J,m?(J=As(s,x),J!=null&&C.unshift(di(s,J,$))):m||(J=As(s,x),J!=null&&C.push(di(s,J,$)))),s=s.return}C.length!==0&&t.push({event:n,listeners:C})}var a_=/\r\n?/g,s_=/\u0000|\uFFFD/g;function G0(t){return(typeof t=="string"?t:""+t).replace(a_,`
49
- `).replace(s_,"")}function X0(t,n){return n=G0(n),G0(t)===n}function pc(){}function nt(t,n,s,c,m,x){switch(s){case"children":typeof c=="string"?n==="body"||n==="textarea"&&c===""||ca(t,c):(typeof c=="number"||typeof c=="bigint")&&n!=="body"&&ca(t,""+c);break;case"className":sa(t,"class",c);break;case"tabIndex":sa(t,"tabindex",c);break;case"dir":case"role":case"viewBox":case"width":case"height":sa(t,s,c);break;case"style":Zp(t,c,x);break;case"data":if(n!=="object"){sa(t,"data",c);break}case"src":case"href":if(c===""&&(n!=="a"||s!=="href")){t.removeAttribute(s);break}if(c==null||typeof c=="function"||typeof c=="symbol"||typeof c=="boolean"){t.removeAttribute(s);break}c=Sl(""+c),t.setAttribute(s,c);break;case"action":case"formAction":if(typeof c=="function"){t.setAttribute(s,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof x=="function"&&(s==="formAction"?(n!=="input"&&nt(t,n,"name",m.name,m,null),nt(t,n,"formEncType",m.formEncType,m,null),nt(t,n,"formMethod",m.formMethod,m,null),nt(t,n,"formTarget",m.formTarget,m,null)):(nt(t,n,"encType",m.encType,m,null),nt(t,n,"method",m.method,m,null),nt(t,n,"target",m.target,m,null)));if(c==null||typeof c=="symbol"||typeof c=="boolean"){t.removeAttribute(s);break}c=Sl(""+c),t.setAttribute(s,c);break;case"onClick":c!=null&&(t.onclick=pc);break;case"onScroll":c!=null&&Ve("scroll",t);break;case"onScrollEnd":c!=null&&Ve("scrollend",t);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(a(61));if(s=c.__html,s!=null){if(m.children!=null)throw Error(a(60));t.innerHTML=s}}break;case"multiple":t.multiple=c&&typeof c!="function"&&typeof c!="symbol";break;case"muted":t.muted=c&&typeof c!="function"&&typeof c!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(c==null||typeof c=="function"||typeof c=="boolean"||typeof c=="symbol"){t.removeAttribute("xlink:href");break}s=Sl(""+c),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":c!=null&&typeof c!="function"&&typeof c!="symbol"?t.setAttribute(s,""+c):t.removeAttribute(s);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":c&&typeof c!="function"&&typeof c!="symbol"?t.setAttribute(s,""):t.removeAttribute(s);break;case"capture":case"download":c===!0?t.setAttribute(s,""):c!==!1&&c!=null&&typeof c!="function"&&typeof c!="symbol"?t.setAttribute(s,c):t.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":c!=null&&typeof c!="function"&&typeof c!="symbol"&&!isNaN(c)&&1<=c?t.setAttribute(s,c):t.removeAttribute(s);break;case"rowSpan":case"start":c==null||typeof c=="function"||typeof c=="symbol"||isNaN(c)?t.removeAttribute(s):t.setAttribute(s,c);break;case"popover":Ve("beforetoggle",t),Ve("toggle",t),aa(t,"popover",c);break;case"xlinkActuate":vn(t,"http://www.w3.org/1999/xlink","xlink:actuate",c);break;case"xlinkArcrole":vn(t,"http://www.w3.org/1999/xlink","xlink:arcrole",c);break;case"xlinkRole":vn(t,"http://www.w3.org/1999/xlink","xlink:role",c);break;case"xlinkShow":vn(t,"http://www.w3.org/1999/xlink","xlink:show",c);break;case"xlinkTitle":vn(t,"http://www.w3.org/1999/xlink","xlink:title",c);break;case"xlinkType":vn(t,"http://www.w3.org/1999/xlink","xlink:type",c);break;case"xmlBase":vn(t,"http://www.w3.org/XML/1998/namespace","xml:base",c);break;case"xmlLang":vn(t,"http://www.w3.org/XML/1998/namespace","xml:lang",c);break;case"xmlSpace":vn(t,"http://www.w3.org/XML/1998/namespace","xml:space",c);break;case"is":aa(t,"is",c);break;case"innerText":case"textContent":break;default:(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(s=LS.get(s)||s,aa(t,s,c))}}function im(t,n,s,c,m,x){switch(s){case"style":Zp(t,c,x);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(a(61));if(s=c.__html,s!=null){if(m.children!=null)throw Error(a(60));t.innerHTML=s}}break;case"children":typeof c=="string"?ca(t,c):(typeof c=="number"||typeof c=="bigint")&&ca(t,""+c);break;case"onScroll":c!=null&&Ve("scroll",t);break;case"onScrollEnd":c!=null&&Ve("scrollend",t);break;case"onClick":c!=null&&(t.onclick=pc);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!xl.hasOwnProperty(s))e:{if(s[0]==="o"&&s[1]==="n"&&(m=s.endsWith("Capture"),n=s.slice(2,m?s.length-7:void 0),x=t[Dt]||null,x=x!=null?x[s]:null,typeof x=="function"&&t.removeEventListener(n,x,m),typeof c=="function")){typeof x!="function"&&x!==null&&(s in t?t[s]=null:t.hasAttribute(s)&&t.removeAttribute(s)),t.addEventListener(n,c,m);break e}s in t?t[s]=c:c===!0?t.setAttribute(s,""):aa(t,s,c)}}}function Mt(t,n,s){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ve("error",t),Ve("load",t);var c=!1,m=!1,x;for(x in s)if(s.hasOwnProperty(x)){var C=s[x];if(C!=null)switch(x){case"src":c=!0;break;case"srcSet":m=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,n));default:nt(t,n,x,C,s,null)}}m&&nt(t,n,"srcSet",s.srcSet,s,null),c&&nt(t,n,"src",s.src,s,null);return;case"input":Ve("invalid",t);var R=x=C=m=null,$=null,J=null;for(c in s)if(s.hasOwnProperty(c)){var ie=s[c];if(ie!=null)switch(c){case"name":m=ie;break;case"type":C=ie;break;case"checked":$=ie;break;case"defaultChecked":J=ie;break;case"value":x=ie;break;case"defaultValue":R=ie;break;case"children":case"dangerouslySetInnerHTML":if(ie!=null)throw Error(a(137,n));break;default:nt(t,n,c,ie,s,null)}}Nl(t,x,R,$,J,C,m,!1),ia(t);return;case"select":Ve("invalid",t),c=C=x=null;for(m in s)if(s.hasOwnProperty(m)&&(R=s[m],R!=null))switch(m){case"value":x=R;break;case"defaultValue":C=R;break;case"multiple":c=R;default:nt(t,n,m,R,s,null)}n=x,s=C,t.multiple=!!c,n!=null?nr(t,!!c,n,!1):s!=null&&nr(t,!!c,s,!0);return;case"textarea":Ve("invalid",t),x=m=c=null;for(C in s)if(s.hasOwnProperty(C)&&(R=s[C],R!=null))switch(C){case"value":c=R;break;case"defaultValue":m=R;break;case"children":x=R;break;case"dangerouslySetInnerHTML":if(R!=null)throw Error(a(91));break;default:nt(t,n,C,R,s,null)}Xp(t,c,m,x),ia(t);return;case"option":for($ in s)if(s.hasOwnProperty($)&&(c=s[$],c!=null))switch($){case"selected":t.selected=c&&typeof c!="function"&&typeof c!="symbol";break;default:nt(t,n,$,c,s,null)}return;case"dialog":Ve("beforetoggle",t),Ve("toggle",t),Ve("cancel",t),Ve("close",t);break;case"iframe":case"object":Ve("load",t);break;case"video":case"audio":for(c=0;c<ui.length;c++)Ve(ui[c],t);break;case"image":Ve("error",t),Ve("load",t);break;case"details":Ve("toggle",t);break;case"embed":case"source":case"link":Ve("error",t),Ve("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(J in s)if(s.hasOwnProperty(J)&&(c=s[J],c!=null))switch(J){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,n));default:nt(t,n,J,c,s,null)}return;default:if(Nd(n)){for(ie in s)s.hasOwnProperty(ie)&&(c=s[ie],c!==void 0&&im(t,n,ie,c,s,void 0));return}}for(R in s)s.hasOwnProperty(R)&&(c=s[R],c!=null&&nt(t,n,R,c,s,null))}function i_(t,n,s,c){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var m=null,x=null,C=null,R=null,$=null,J=null,ie=null;for(oe in s){var fe=s[oe];if(s.hasOwnProperty(oe)&&fe!=null)switch(oe){case"checked":break;case"value":break;case"defaultValue":$=fe;default:c.hasOwnProperty(oe)||nt(t,n,oe,null,c,fe)}}for(var ne in c){var oe=c[ne];if(fe=s[ne],c.hasOwnProperty(ne)&&(oe!=null||fe!=null))switch(ne){case"type":x=oe;break;case"name":m=oe;break;case"checked":J=oe;break;case"defaultChecked":ie=oe;break;case"value":C=oe;break;case"defaultValue":R=oe;break;case"children":case"dangerouslySetInnerHTML":if(oe!=null)throw Error(a(137,n));break;default:oe!==fe&&nt(t,n,ne,oe,c,fe)}}bo(t,C,R,$,J,ie,x,m);return;case"select":oe=C=R=ne=null;for(x in s)if($=s[x],s.hasOwnProperty(x)&&$!=null)switch(x){case"value":break;case"multiple":oe=$;default:c.hasOwnProperty(x)||nt(t,n,x,null,c,$)}for(m in c)if(x=c[m],$=s[m],c.hasOwnProperty(m)&&(x!=null||$!=null))switch(m){case"value":ne=x;break;case"defaultValue":R=x;break;case"multiple":C=x;default:x!==$&&nt(t,n,m,x,c,$)}n=R,s=C,c=oe,ne!=null?nr(t,!!s,ne,!1):!!c!=!!s&&(n!=null?nr(t,!!s,n,!0):nr(t,!!s,s?[]:"",!1));return;case"textarea":oe=ne=null;for(R in s)if(m=s[R],s.hasOwnProperty(R)&&m!=null&&!c.hasOwnProperty(R))switch(R){case"value":break;case"children":break;default:nt(t,n,R,null,c,m)}for(C in c)if(m=c[C],x=s[C],c.hasOwnProperty(C)&&(m!=null||x!=null))switch(C){case"value":ne=m;break;case"defaultValue":oe=m;break;case"children":break;case"dangerouslySetInnerHTML":if(m!=null)throw Error(a(91));break;default:m!==x&&nt(t,n,C,m,c,x)}Gp(t,ne,oe);return;case"option":for(var Re in s)if(ne=s[Re],s.hasOwnProperty(Re)&&ne!=null&&!c.hasOwnProperty(Re))switch(Re){case"selected":t.selected=!1;break;default:nt(t,n,Re,null,c,ne)}for($ in c)if(ne=c[$],oe=s[$],c.hasOwnProperty($)&&ne!==oe&&(ne!=null||oe!=null))switch($){case"selected":t.selected=ne&&typeof ne!="function"&&typeof ne!="symbol";break;default:nt(t,n,$,ne,c,oe)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Ae in s)ne=s[Ae],s.hasOwnProperty(Ae)&&ne!=null&&!c.hasOwnProperty(Ae)&&nt(t,n,Ae,null,c,ne);for(J in c)if(ne=c[J],oe=s[J],c.hasOwnProperty(J)&&ne!==oe&&(ne!=null||oe!=null))switch(J){case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(a(137,n));break;default:nt(t,n,J,ne,c,oe)}return;default:if(Nd(n)){for(var rt in s)ne=s[rt],s.hasOwnProperty(rt)&&ne!==void 0&&!c.hasOwnProperty(rt)&&im(t,n,rt,void 0,c,ne);for(ie in c)ne=c[ie],oe=s[ie],!c.hasOwnProperty(ie)||ne===oe||ne===void 0&&oe===void 0||im(t,n,ie,ne,c,oe);return}}for(var F in s)ne=s[F],s.hasOwnProperty(F)&&ne!=null&&!c.hasOwnProperty(F)&&nt(t,n,F,null,c,ne);for(fe in c)ne=c[fe],oe=s[fe],!c.hasOwnProperty(fe)||ne===oe||ne==null&&oe==null||nt(t,n,fe,ne,c,oe)}var lm=null,cm=null;function gc(t){return t.nodeType===9?t:t.ownerDocument}function F0(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Z0(t,n){if(t===0)switch(n){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&n==="foreignObject"?0:t}function um(t,n){return t==="textarea"||t==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.children=="bigint"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var dm=null;function l_(){var t=window.event;return t&&t.type==="popstate"?t===dm?!1:(dm=t,!0):(dm=null,!1)}var K0=typeof setTimeout=="function"?setTimeout:void 0,c_=typeof clearTimeout=="function"?clearTimeout:void 0,W0=typeof Promise=="function"?Promise:void 0,u_=typeof queueMicrotask=="function"?queueMicrotask:typeof W0<"u"?function(t){return W0.resolve(null).then(t).catch(d_)}:K0;function d_(t){setTimeout(function(){throw t})}function Kr(t){return t==="head"}function Q0(t,n){var s=n,c=0,m=0;do{var x=s.nextSibling;if(t.removeChild(s),x&&x.nodeType===8)if(s=x.data,s==="/$"){if(0<c&&8>c){s=c;var C=t.ownerDocument;if(s&1&&fi(C.documentElement),s&2&&fi(C.body),s&4)for(s=C.head,fi(s),C=s.firstChild;C;){var R=C.nextSibling,$=C.nodeName;C[yo]||$==="SCRIPT"||$==="STYLE"||$==="LINK"&&C.rel.toLowerCase()==="stylesheet"||s.removeChild(C),C=R}}if(m===0){t.removeChild(x),bi(n);return}m--}else s==="$"||s==="$?"||s==="$!"?m++:c=s.charCodeAt(0)-48;else c=0;s=x}while(s);bi(n)}function fm(t){var n=t.firstChild;for(n&&n.nodeType===10&&(n=n.nextSibling);n;){var s=n;switch(n=n.nextSibling,s.nodeName){case"HTML":case"HEAD":case"BODY":fm(s),Ns(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}t.removeChild(s)}}function f_(t,n,s,c){for(;t.nodeType===1;){var m=s;if(t.nodeName.toLowerCase()!==n.toLowerCase()){if(!c&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(c){if(!t[yo])switch(n){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(x=t.getAttribute("rel"),x==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(x!==m.rel||t.getAttribute("href")!==(m.href==null||m.href===""?null:m.href)||t.getAttribute("crossorigin")!==(m.crossOrigin==null?null:m.crossOrigin)||t.getAttribute("title")!==(m.title==null?null:m.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(x=t.getAttribute("src"),(x!==(m.src==null?null:m.src)||t.getAttribute("type")!==(m.type==null?null:m.type)||t.getAttribute("crossorigin")!==(m.crossOrigin==null?null:m.crossOrigin))&&x&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(n==="input"&&t.type==="hidden"){var x=m.name==null?null:""+m.name;if(m.type==="hidden"&&t.getAttribute("name")===x)return t}else return t;if(t=wn(t.nextSibling),t===null)break}return null}function m_(t,n,s){if(n==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!s||(t=wn(t.nextSibling),t===null))return null;return t}function mm(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState==="complete"}function h_(t,n){var s=t.ownerDocument;if(t.data!=="$?"||s.readyState==="complete")n();else{var c=function(){n(),s.removeEventListener("DOMContentLoaded",c)};s.addEventListener("DOMContentLoaded",c),t._reactRetry=c}}function wn(t){for(;t!=null;t=t.nextSibling){var n=t.nodeType;if(n===1||n===3)break;if(n===8){if(n=t.data,n==="$"||n==="$!"||n==="$?"||n==="F!"||n==="F")break;if(n==="/$")return null}}return t}var hm=null;function J0(t){t=t.previousSibling;for(var n=0;t;){if(t.nodeType===8){var s=t.data;if(s==="$"||s==="$!"||s==="$?"){if(n===0)return t;n--}else s==="/$"&&n++}t=t.previousSibling}return null}function ev(t,n,s){switch(n=gc(s),t){case"html":if(t=n.documentElement,!t)throw Error(a(452));return t;case"head":if(t=n.head,!t)throw Error(a(453));return t;case"body":if(t=n.body,!t)throw Error(a(454));return t;default:throw Error(a(451))}}function fi(t){for(var n=t.attributes;n.length;)t.removeAttributeNode(n[0]);Ns(t)}var pn=new Map,tv=new Set;function xc(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var gr=O.d;O.d={f:p_,r:g_,D:x_,C:v_,L:y_,m:b_,X:N_,S:w_,M:S_};function p_(){var t=gr.f(),n=lc();return t||n}function g_(t){var n=Qn(t);n!==null&&n.tag===5&&n.type==="form"?wx(n):gr.r(t)}var Ha=typeof document>"u"?null:document;function nv(t,n,s){var c=Ha;if(c&&typeof n=="string"&&n){var m=Ut(n);m='link[rel="'+t+'"][href="'+m+'"]',typeof s=="string"&&(m+='[crossorigin="'+s+'"]'),tv.has(m)||(tv.add(m),t={rel:t,crossOrigin:s,href:n},c.querySelector(m)===null&&(n=c.createElement("link"),Mt(n,"link",t),xt(n),c.head.appendChild(n)))}}function x_(t){gr.D(t),nv("dns-prefetch",t,null)}function v_(t,n){gr.C(t,n),nv("preconnect",t,n)}function y_(t,n,s){gr.L(t,n,s);var c=Ha;if(c&&t&&n){var m='link[rel="preload"][as="'+Ut(n)+'"]';n==="image"&&s&&s.imageSrcSet?(m+='[imagesrcset="'+Ut(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(m+='[imagesizes="'+Ut(s.imageSizes)+'"]')):m+='[href="'+Ut(t)+'"]';var x=m;switch(n){case"style":x=Ba(t);break;case"script":x=Ua(t)}pn.has(x)||(t=g({rel:"preload",href:n==="image"&&s&&s.imageSrcSet?void 0:t,as:n},s),pn.set(x,t),c.querySelector(m)!==null||n==="style"&&c.querySelector(mi(x))||n==="script"&&c.querySelector(hi(x))||(n=c.createElement("link"),Mt(n,"link",t),xt(n),c.head.appendChild(n)))}}function b_(t,n){gr.m(t,n);var s=Ha;if(s&&t){var c=n&&typeof n.as=="string"?n.as:"script",m='link[rel="modulepreload"][as="'+Ut(c)+'"][href="'+Ut(t)+'"]',x=m;switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":x=Ua(t)}if(!pn.has(x)&&(t=g({rel:"modulepreload",href:t},n),pn.set(x,t),s.querySelector(m)===null)){switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(hi(x)))return}c=s.createElement("link"),Mt(c,"link",t),xt(c),s.head.appendChild(c)}}}function w_(t,n,s){gr.S(t,n,s);var c=Ha;if(c&&t){var m=Jn(c).hoistableStyles,x=Ba(t);n=n||"default";var C=m.get(x);if(!C){var R={loading:0,preload:null};if(C=c.querySelector(mi(x)))R.loading=5;else{t=g({rel:"stylesheet",href:t,"data-precedence":n},s),(s=pn.get(x))&&pm(t,s);var $=C=c.createElement("link");xt($),Mt($,"link",t),$._p=new Promise(function(J,ie){$.onload=J,$.onerror=ie}),$.addEventListener("load",function(){R.loading|=1}),$.addEventListener("error",function(){R.loading|=2}),R.loading|=4,vc(C,n,c)}C={type:"stylesheet",instance:C,count:1,state:R},m.set(x,C)}}}function N_(t,n){gr.X(t,n);var s=Ha;if(s&&t){var c=Jn(s).hoistableScripts,m=Ua(t),x=c.get(m);x||(x=s.querySelector(hi(m)),x||(t=g({src:t,async:!0},n),(n=pn.get(m))&&gm(t,n),x=s.createElement("script"),xt(x),Mt(x,"link",t),s.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},c.set(m,x))}}function S_(t,n){gr.M(t,n);var s=Ha;if(s&&t){var c=Jn(s).hoistableScripts,m=Ua(t),x=c.get(m);x||(x=s.querySelector(hi(m)),x||(t=g({src:t,async:!0,type:"module"},n),(n=pn.get(m))&&gm(t,n),x=s.createElement("script"),xt(x),Mt(x,"link",t),s.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},c.set(m,x))}}function rv(t,n,s,c){var m=(m=ue.current)?xc(m):null;if(!m)throw Error(a(446));switch(t){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(n=Ba(s.href),s=Jn(m).hoistableStyles,c=s.get(n),c||(c={type:"style",instance:null,count:0,state:null},s.set(n,c)),c):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){t=Ba(s.href);var x=Jn(m).hoistableStyles,C=x.get(t);if(C||(m=m.ownerDocument||m,C={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},x.set(t,C),(x=m.querySelector(mi(t)))&&!x._p&&(C.instance=x,C.state.loading=5),pn.has(t)||(s={rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},pn.set(t,s),x||E_(m,t,s,C.state))),n&&c===null)throw Error(a(528,""));return C}if(n&&c!==null)throw Error(a(529,""));return null;case"script":return n=s.async,s=s.src,typeof s=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(n=Ua(s),s=Jn(m).hoistableScripts,c=s.get(n),c||(c={type:"script",instance:null,count:0,state:null},s.set(n,c)),c):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,t))}}function Ba(t){return'href="'+Ut(t)+'"'}function mi(t){return'link[rel="stylesheet"]['+t+"]"}function ov(t){return g({},t,{"data-precedence":t.precedence,precedence:null})}function E_(t,n,s,c){t.querySelector('link[rel="preload"][as="style"]['+n+"]")?c.loading=1:(n=t.createElement("link"),c.preload=n,n.addEventListener("load",function(){return c.loading|=1}),n.addEventListener("error",function(){return c.loading|=2}),Mt(n,"link",s),xt(n),t.head.appendChild(n))}function Ua(t){return'[src="'+Ut(t)+'"]'}function hi(t){return"script[async]"+t}function av(t,n,s){if(n.count++,n.instance===null)switch(n.type){case"style":var c=t.querySelector('style[data-href~="'+Ut(s.href)+'"]');if(c)return n.instance=c,xt(c),c;var m=g({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return c=(t.ownerDocument||t).createElement("style"),xt(c),Mt(c,"style",m),vc(c,s.precedence,t),n.instance=c;case"stylesheet":m=Ba(s.href);var x=t.querySelector(mi(m));if(x)return n.state.loading|=4,n.instance=x,xt(x),x;c=ov(s),(m=pn.get(m))&&pm(c,m),x=(t.ownerDocument||t).createElement("link"),xt(x);var C=x;return C._p=new Promise(function(R,$){C.onload=R,C.onerror=$}),Mt(x,"link",c),n.state.loading|=4,vc(x,s.precedence,t),n.instance=x;case"script":return x=Ua(s.src),(m=t.querySelector(hi(x)))?(n.instance=m,xt(m),m):(c=s,(m=pn.get(x))&&(c=g({},s),gm(c,m)),t=t.ownerDocument||t,m=t.createElement("script"),xt(m),Mt(m,"link",c),t.head.appendChild(m),n.instance=m);case"void":return null;default:throw Error(a(443,n.type))}else n.type==="stylesheet"&&(n.state.loading&4)===0&&(c=n.instance,n.state.loading|=4,vc(c,s.precedence,t));return n.instance}function vc(t,n,s){for(var c=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),m=c.length?c[c.length-1]:null,x=m,C=0;C<c.length;C++){var R=c[C];if(R.dataset.precedence===n)x=R;else if(x!==m)break}x?x.parentNode.insertBefore(t,x.nextSibling):(n=s.nodeType===9?s.head:s,n.insertBefore(t,n.firstChild))}function pm(t,n){t.crossOrigin==null&&(t.crossOrigin=n.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=n.referrerPolicy),t.title==null&&(t.title=n.title)}function gm(t,n){t.crossOrigin==null&&(t.crossOrigin=n.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=n.referrerPolicy),t.integrity==null&&(t.integrity=n.integrity)}var yc=null;function sv(t,n,s){if(yc===null){var c=new Map,m=yc=new Map;m.set(s,c)}else m=yc,c=m.get(s),c||(c=new Map,m.set(s,c));if(c.has(t))return c;for(c.set(t,null),s=s.getElementsByTagName(t),m=0;m<s.length;m++){var x=s[m];if(!(x[yo]||x[Et]||t==="link"&&x.getAttribute("rel")==="stylesheet")&&x.namespaceURI!=="http://www.w3.org/2000/svg"){var C=x.getAttribute(n)||"";C=t+C;var R=c.get(C);R?R.push(x):c.set(C,[x])}}return c}function iv(t,n,s){t=t.ownerDocument||t,t.head.insertBefore(s,n==="title"?t.querySelector("head > title"):null)}function __(t,n,s){if(s===1||n.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof n.precedence!="string"||typeof n.href!="string"||n.href==="")break;return!0;case"link":if(typeof n.rel!="string"||typeof n.href!="string"||n.href===""||n.onLoad||n.onError)break;switch(n.rel){case"stylesheet":return t=n.disabled,typeof n.precedence=="string"&&t==null;default:return!0}case"script":if(n.async&&typeof n.async!="function"&&typeof n.async!="symbol"&&!n.onLoad&&!n.onError&&n.src&&typeof n.src=="string")return!0}return!1}function lv(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}var pi=null;function j_(){}function C_(t,n,s){if(pi===null)throw Error(a(475));var c=pi;if(n.type==="stylesheet"&&(typeof s.media!="string"||matchMedia(s.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var m=Ba(s.href),x=t.querySelector(mi(m));if(x){t=x._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(c.count++,c=bc.bind(c),t.then(c,c)),n.state.loading|=4,n.instance=x,xt(x);return}x=t.ownerDocument||t,s=ov(s),(m=pn.get(m))&&pm(s,m),x=x.createElement("link"),xt(x);var C=x;C._p=new Promise(function(R,$){C.onload=R,C.onerror=$}),Mt(x,"link",s),n.instance=x}c.stylesheets===null&&(c.stylesheets=new Map),c.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(c.count++,n=bc.bind(c),t.addEventListener("load",n),t.addEventListener("error",n))}}function k_(){if(pi===null)throw Error(a(475));var t=pi;return t.stylesheets&&t.count===0&&xm(t,t.stylesheets),0<t.count?function(n){var s=setTimeout(function(){if(t.stylesheets&&xm(t,t.stylesheets),t.unsuspend){var c=t.unsuspend;t.unsuspend=null,c()}},6e4);return t.unsuspend=n,function(){t.unsuspend=null,clearTimeout(s)}}:null}function bc(){if(this.count--,this.count===0){if(this.stylesheets)xm(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var wc=null;function xm(t,n){t.stylesheets=null,t.unsuspend!==null&&(t.count++,wc=new Map,n.forEach(A_,t),wc=null,bc.call(t))}function A_(t,n){if(!(n.state.loading&4)){var s=wc.get(t);if(s)var c=s.get(null);else{s=new Map,wc.set(t,s);for(var m=t.querySelectorAll("link[data-precedence],style[data-precedence]"),x=0;x<m.length;x++){var C=m[x];(C.nodeName==="LINK"||C.getAttribute("media")!=="not all")&&(s.set(C.dataset.precedence,C),c=C)}c&&s.set(null,c)}m=n.instance,C=m.getAttribute("data-precedence"),x=s.get(C)||c,x===c&&s.set(null,m),s.set(C,m),this.count++,c=bc.bind(this),m.addEventListener("load",c),m.addEventListener("error",c),x?x.parentNode.insertBefore(m,x.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(m,t.firstChild)),n.state.loading|=4}}var gi={$$typeof:_,Provider:null,Consumer:null,_currentValue:z,_currentValue2:z,_threadCount:0};function M_(t,n,s,c,m,x,C,R){this.tag=1,this.containerInfo=t,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=xs(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=xs(0),this.hiddenUpdates=xs(null),this.identifierPrefix=c,this.onUncaughtError=m,this.onCaughtError=x,this.onRecoverableError=C,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=R,this.incompleteTransitions=new Map}function cv(t,n,s,c,m,x,C,R,$,J,ie,fe){return t=new M_(t,n,s,C,R,$,J,fe),n=1,x===!0&&(n|=24),x=Kt(3,null,null,n),t.current=x,x.stateNode=t,n=Wd(),n.refCount++,t.pooledCache=n,n.refCount++,x.memoizedState={element:c,isDehydrated:s,cache:n},tf(x),t}function uv(t){return t?(t=xa,t):xa}function dv(t,n,s,c,m,x){m=uv(m),c.context===null?c.context=m:c.pendingContext=m,c=Ir(n),c.payload={element:s},x=x===void 0?null:x,x!==null&&(c.callback=x),s=Hr(t,c,n),s!==null&&(tn(s,t,n),Gs(s,t,n))}function fv(t,n){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var s=t.retryLane;t.retryLane=s!==0&&s<n?s:n}}function vm(t,n){fv(t,n),(t=t.alternate)&&fv(t,n)}function mv(t){if(t.tag===13){var n=ga(t,67108864);n!==null&&tn(n,t,67108864),vm(t,67108864)}}var Nc=!0;function T_(t,n,s,c){var m=E.T;E.T=null;var x=O.p;try{O.p=2,ym(t,n,s,c)}finally{O.p=x,E.T=m}}function R_(t,n,s,c){var m=E.T;E.T=null;var x=O.p;try{O.p=8,ym(t,n,s,c)}finally{O.p=x,E.T=m}}function ym(t,n,s,c){if(Nc){var m=bm(c);if(m===null)sm(t,n,c,Sc,s),pv(t,c);else if(O_(m,t,n,s,c))c.stopPropagation();else if(pv(t,c),n&4&&-1<D_.indexOf(t)){for(;m!==null;){var x=Qn(m);if(x!==null)switch(x.tag){case 3:if(x=x.stateNode,x.current.memoizedState.isDehydrated){var C=Wn(x.pendingLanes);if(C!==0){var R=x;for(R.pendingLanes|=2,R.entangledLanes|=2;C;){var $=1<<31-ht(C);R.entanglements[1]|=$,C&=~$}In(x),(Je&6)===0&&(sc=re()+500,ci(0))}}break;case 13:R=ga(x,2),R!==null&&tn(R,x,2),lc(),vm(x,2)}if(x=bm(c),x===null&&sm(t,n,c,Sc,s),x===m)break;m=x}m!==null&&c.stopPropagation()}else sm(t,n,c,null,s)}}function bm(t){return t=Ed(t),wm(t)}var Sc=null;function wm(t){if(Sc=null,t=Tr(t),t!==null){var n=u(t);if(n===null)t=null;else{var s=n.tag;if(s===13){if(t=d(n),t!==null)return t;t=null}else if(s===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;t=null}else n!==t&&(t=null)}}return Sc=t,null}function hv(t){switch(t){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(ve()){case ke:return 2;case De:return 8;case be:case Te:return 32;case Ye:return 268435456;default:return 32}default:return 32}}var Nm=!1,Wr=null,Qr=null,Jr=null,xi=new Map,vi=new Map,eo=[],D_="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function pv(t,n){switch(t){case"focusin":case"focusout":Wr=null;break;case"dragenter":case"dragleave":Qr=null;break;case"mouseover":case"mouseout":Jr=null;break;case"pointerover":case"pointerout":xi.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":vi.delete(n.pointerId)}}function yi(t,n,s,c,m,x){return t===null||t.nativeEvent!==x?(t={blockedOn:n,domEventName:s,eventSystemFlags:c,nativeEvent:x,targetContainers:[m]},n!==null&&(n=Qn(n),n!==null&&mv(n)),t):(t.eventSystemFlags|=c,n=t.targetContainers,m!==null&&n.indexOf(m)===-1&&n.push(m),t)}function O_(t,n,s,c,m){switch(n){case"focusin":return Wr=yi(Wr,t,n,s,c,m),!0;case"dragenter":return Qr=yi(Qr,t,n,s,c,m),!0;case"mouseover":return Jr=yi(Jr,t,n,s,c,m),!0;case"pointerover":var x=m.pointerId;return xi.set(x,yi(xi.get(x)||null,t,n,s,c,m)),!0;case"gotpointercapture":return x=m.pointerId,vi.set(x,yi(vi.get(x)||null,t,n,s,c,m)),!0}return!1}function gv(t){var n=Tr(t.target);if(n!==null){var s=u(n);if(s!==null){if(n=s.tag,n===13){if(n=d(s),n!==null){t.blockedOn=n,hd(t.priority,function(){if(s.tag===13){var c=en();c=ys(c);var m=ga(s,c);m!==null&&tn(m,s,c),vm(s,c)}});return}}else if(n===3&&s.stateNode.current.memoizedState.isDehydrated){t.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Ec(t){if(t.blockedOn!==null)return!1;for(var n=t.targetContainers;0<n.length;){var s=bm(t.nativeEvent);if(s===null){s=t.nativeEvent;var c=new s.constructor(s.type,s);Sd=c,s.target.dispatchEvent(c),Sd=null}else return n=Qn(s),n!==null&&mv(n),t.blockedOn=s,!1;n.shift()}return!0}function xv(t,n,s){Ec(t)&&s.delete(n)}function z_(){Nm=!1,Wr!==null&&Ec(Wr)&&(Wr=null),Qr!==null&&Ec(Qr)&&(Qr=null),Jr!==null&&Ec(Jr)&&(Jr=null),xi.forEach(xv),vi.forEach(xv)}function _c(t,n){t.blockedOn===n&&(t.blockedOn=null,Nm||(Nm=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,z_)))}var jc=null;function vv(t){jc!==t&&(jc=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){jc===t&&(jc=null);for(var n=0;n<t.length;n+=3){var s=t[n],c=t[n+1],m=t[n+2];if(typeof c!="function"){if(wm(c||s)===null)continue;break}var x=Qn(s);x!==null&&(t.splice(n,3),n-=3,wf(x,{pending:!0,data:m,method:s.method,action:c},c,m))}}))}function bi(t){function n($){return _c($,t)}Wr!==null&&_c(Wr,t),Qr!==null&&_c(Qr,t),Jr!==null&&_c(Jr,t),xi.forEach(n),vi.forEach(n);for(var s=0;s<eo.length;s++){var c=eo[s];c.blockedOn===t&&(c.blockedOn=null)}for(;0<eo.length&&(s=eo[0],s.blockedOn===null);)gv(s),s.blockedOn===null&&eo.shift();if(s=(t.ownerDocument||t).$$reactFormReplay,s!=null)for(c=0;c<s.length;c+=3){var m=s[c],x=s[c+1],C=m[Dt]||null;if(typeof x=="function")C||vv(s);else if(C){var R=null;if(x&&x.hasAttribute("formAction")){if(m=x,C=x[Dt]||null)R=C.formAction;else if(wm(m)!==null)continue}else R=C.action;typeof R=="function"?s[c+1]=R:(s.splice(c,3),c-=3),vv(s)}}}function Sm(t){this._internalRoot=t}Cc.prototype.render=Sm.prototype.render=function(t){var n=this._internalRoot;if(n===null)throw Error(a(409));var s=n.current,c=en();dv(s,c,t,n,null,null)},Cc.prototype.unmount=Sm.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var n=t.containerInfo;dv(t.current,2,null,t,null,null),lc(),n[Mr]=null}};function Cc(t){this._internalRoot=t}Cc.prototype.unstable_scheduleHydration=function(t){if(t){var n=hl();t={blockedOn:null,target:t,priority:n};for(var s=0;s<eo.length&&n!==0&&n<eo[s].priority;s++);eo.splice(s,0,t),s===0&&gv(t)}};var yv=r.version;if(yv!=="19.1.1")throw Error(a(527,yv,"19.1.1"));O.findDOMNode=function(t){var n=t._reactInternals;if(n===void 0)throw typeof t.render=="function"?Error(a(188)):(t=Object.keys(t).join(","),Error(a(268,t)));return t=h(n),t=t!==null?p(t):null,t=t===null?null:t.stateNode,t};var L_={bundleType:0,version:"19.1.1",rendererPackageName:"react-dom",currentDispatcherRef:E,reconcilerVersion:"19.1.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var kc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!kc.isDisabled&&kc.supportsFiber)try{Fe=kc.inject(L_),Ue=kc}catch{}}return Ni.createRoot=function(t,n){if(!l(t))throw Error(a(299));var s=!1,c="",m=zx,x=Lx,C=Ix,R=null;return n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(c=n.identifierPrefix),n.onUncaughtError!==void 0&&(m=n.onUncaughtError),n.onCaughtError!==void 0&&(x=n.onCaughtError),n.onRecoverableError!==void 0&&(C=n.onRecoverableError),n.unstable_transitionCallbacks!==void 0&&(R=n.unstable_transitionCallbacks)),n=cv(t,1,!1,null,null,s,c,m,x,C,R,null),t[Mr]=n.current,am(t),new Sm(n)},Ni.hydrateRoot=function(t,n,s){if(!l(t))throw Error(a(299));var c=!1,m="",x=zx,C=Lx,R=Ix,$=null,J=null;return s!=null&&(s.unstable_strictMode===!0&&(c=!0),s.identifierPrefix!==void 0&&(m=s.identifierPrefix),s.onUncaughtError!==void 0&&(x=s.onUncaughtError),s.onCaughtError!==void 0&&(C=s.onCaughtError),s.onRecoverableError!==void 0&&(R=s.onRecoverableError),s.unstable_transitionCallbacks!==void 0&&($=s.unstable_transitionCallbacks),s.formState!==void 0&&(J=s.formState)),n=cv(t,1,!0,n,s??null,c,m,x,C,R,$,J),n.context=uv(null),s=n.current,c=en(),c=ys(c),m=Ir(c),m.callback=null,Hr(s,m,c),s=c,n.current.lanes=s,vo(n,s),In(n),t[Mr]=n.current,am(t),new Cc(n)},Ni.version="19.1.1",Ni}var Av;function G_(){if(Av)return jm.exports;Av=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(r){console.error(r)}}return e(),jm.exports=Y_(),jm.exports}var X_=G_();function Mv(e,r){if(typeof e=="function")return e(r);e!=null&&(e.current=r)}function Mu(...e){return r=>{let o=!1;const a=e.map(l=>{const u=Mv(l,r);return!o&&typeof u=="function"&&(o=!0),u});if(o)return()=>{for(let l=0;l<a.length;l++){const u=a[l];typeof u=="function"?u():Mv(e[l],null)}}}}function Ke(...e){return N.useCallback(Mu(...e),e)}function Qa(e){const r=Z_(e),o=N.forwardRef((a,l)=>{const{children:u,...d}=a,f=N.Children.toArray(u),h=f.find(W_);if(h){const p=h.props.children,g=f.map(y=>y===h?N.Children.count(p)>1?N.Children.only(null):N.isValidElement(p)?p.props.children:null:y);return i.jsx(r,{...d,ref:l,children:N.isValidElement(p)?N.cloneElement(p,void 0,g):null})}return i.jsx(r,{...d,ref:l,children:u})});return o.displayName=`${e}.Slot`,o}var F_=Qa("Slot");function Z_(e){const r=N.forwardRef((o,a)=>{const{children:l,...u}=o;if(N.isValidElement(l)){const d=J_(l),f=Q_(u,l.props);return l.type!==N.Fragment&&(f.ref=a?Mu(a,d):d),N.cloneElement(l,f)}return N.Children.count(l)>1?N.Children.only(null):null});return r.displayName=`${e}.SlotClone`,r}var K_=Symbol("radix.slottable");function W_(e){return N.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===K_}function Q_(e,r){const o={...r};for(const a in r){const l=e[a],u=r[a];/^on[A-Z]/.test(a)?l&&u?o[a]=(...f)=>{const h=u(...f);return l(...f),h}:l&&(o[a]=l):a==="style"?o[a]={...l,...u}:a==="className"&&(o[a]=[l,u].filter(Boolean).join(" "))}return{...e,...o}}function J_(e){let r=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,o=r&&"isReactWarning"in r&&r.isReactWarning;return o?e.ref:(r=Object.getOwnPropertyDescriptor(e,"ref")?.get,o=r&&"isReactWarning"in r&&r.isReactWarning,o?e.props.ref:e.props.ref||e.ref)}function jb(e){var r,o,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var l=e.length;for(r=0;r<l;r++)e[r]&&(o=jb(e[r]))&&(a&&(a+=" "),a+=o)}else for(o in e)e[o]&&(a&&(a+=" "),a+=o);return a}function Cb(){for(var e,r,o=0,a="",l=arguments.length;o<l;o++)(e=arguments[o])&&(r=jb(e))&&(a&&(a+=" "),a+=r);return a}const Tv=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Rv=Cb,kb=(e,r)=>o=>{var a;if(r?.variants==null)return Rv(e,o?.class,o?.className);const{variants:l,defaultVariants:u}=r,d=Object.keys(l).map(p=>{const g=o?.[p],y=u?.[p];if(g===null)return null;const v=Tv(g)||Tv(y);return l[p][v]}),f=o&&Object.entries(o).reduce((p,g)=>{let[y,v]=g;return v===void 0||(p[y]=v),p},{}),h=r==null||(a=r.compoundVariants)===null||a===void 0?void 0:a.reduce((p,g)=>{let{class:y,className:v,...b}=g;return Object.entries(b).every(S=>{let[w,j]=S;return Array.isArray(j)?j.includes({...u,...f}[w]):{...u,...f}[w]===j})?[...p,y,v]:p},[]);return Rv(e,d,h,o?.class,o?.className)},Yh="-",ej=e=>{const r=nj(e),{conflictingClassGroups:o,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:d=>{const f=d.split(Yh);return f[0]===""&&f.length!==1&&f.shift(),Ab(f,r)||tj(d)},getConflictingClassGroupIds:(d,f)=>{const h=o[d]||[];return f&&a[d]?[...h,...a[d]]:h}}},Ab=(e,r)=>{if(e.length===0)return r.classGroupId;const o=e[0],a=r.nextPart.get(o),l=a?Ab(e.slice(1),a):void 0;if(l)return l;if(r.validators.length===0)return;const u=e.join(Yh);return r.validators.find(({validator:d})=>d(u))?.classGroupId},Dv=/^\[(.+)\]$/,tj=e=>{if(Dv.test(e)){const r=Dv.exec(e)[1],o=r?.substring(0,r.indexOf(":"));if(o)return"arbitrary.."+o}},nj=e=>{const{theme:r,classGroups:o}=e,a={nextPart:new Map,validators:[]};for(const l in o)ah(o[l],a,l,r);return a},ah=(e,r,o,a)=>{e.forEach(l=>{if(typeof l=="string"){const u=l===""?r:Ov(r,l);u.classGroupId=o;return}if(typeof l=="function"){if(rj(l)){ah(l(a),r,o,a);return}r.validators.push({validator:l,classGroupId:o});return}Object.entries(l).forEach(([u,d])=>{ah(d,Ov(r,u),o,a)})})},Ov=(e,r)=>{let o=e;return r.split(Yh).forEach(a=>{o.nextPart.has(a)||o.nextPart.set(a,{nextPart:new Map,validators:[]}),o=o.nextPart.get(a)}),o},rj=e=>e.isThemeGetter,oj=e=>{if(e<1)return{get:()=>{},set:()=>{}};let r=0,o=new Map,a=new Map;const l=(u,d)=>{o.set(u,d),r++,r>e&&(r=0,a=o,o=new Map)};return{get(u){let d=o.get(u);if(d!==void 0)return d;if((d=a.get(u))!==void 0)return l(u,d),d},set(u,d){o.has(u)?o.set(u,d):l(u,d)}}},sh="!",ih=":",aj=ih.length,sj=e=>{const{prefix:r,experimentalParseClassName:o}=e;let a=l=>{const u=[];let d=0,f=0,h=0,p;for(let S=0;S<l.length;S++){let w=l[S];if(d===0&&f===0){if(w===ih){u.push(l.slice(h,S)),h=S+aj;continue}if(w==="/"){p=S;continue}}w==="["?d++:w==="]"?d--:w==="("?f++:w===")"&&f--}const g=u.length===0?l:l.substring(h),y=ij(g),v=y!==g,b=p&&p>h?p-h:void 0;return{modifiers:u,hasImportantModifier:v,baseClassName:y,maybePostfixModifierPosition:b}};if(r){const l=r+ih,u=a;a=d=>d.startsWith(l)?u(d.substring(l.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:d,maybePostfixModifierPosition:void 0}}if(o){const l=a;a=u=>o({className:u,parseClassName:l})}return a},ij=e=>e.endsWith(sh)?e.substring(0,e.length-1):e.startsWith(sh)?e.substring(1):e,lj=e=>{const r=Object.fromEntries(e.orderSensitiveModifiers.map(a=>[a,!0]));return a=>{if(a.length<=1)return a;const l=[];let u=[];return a.forEach(d=>{d[0]==="["||r[d]?(l.push(...u.sort(),d),u=[]):u.push(d)}),l.push(...u.sort()),l}},cj=e=>({cache:oj(e.cacheSize),parseClassName:sj(e),sortModifiers:lj(e),...ej(e)}),uj=/\s+/,dj=(e,r)=>{const{parseClassName:o,getClassGroupId:a,getConflictingClassGroupIds:l,sortModifiers:u}=r,d=[],f=e.trim().split(uj);let h="";for(let p=f.length-1;p>=0;p-=1){const g=f[p],{isExternal:y,modifiers:v,hasImportantModifier:b,baseClassName:S,maybePostfixModifierPosition:w}=o(g);if(y){h=g+(h.length>0?" "+h:h);continue}let j=!!w,k=a(j?S.substring(0,w):S);if(!k){if(!j){h=g+(h.length>0?" "+h:h);continue}if(k=a(S),!k){h=g+(h.length>0?" "+h:h);continue}j=!1}const M=u(v).join(":"),_=b?M+sh:M,A=_+k;if(d.includes(A))continue;d.push(A);const D=l(k,j);for(let L=0;L<D.length;++L){const H=D[L];d.push(_+H)}h=g+(h.length>0?" "+h:h)}return h};function fj(){let e=0,r,o,a="";for(;e<arguments.length;)(r=arguments[e++])&&(o=Mb(r))&&(a&&(a+=" "),a+=o);return a}const Mb=e=>{if(typeof e=="string")return e;let r,o="";for(let a=0;a<e.length;a++)e[a]&&(r=Mb(e[a]))&&(o&&(o+=" "),o+=r);return o};function mj(e,...r){let o,a,l,u=d;function d(h){const p=r.reduce((g,y)=>y(g),e());return o=cj(p),a=o.cache.get,l=o.cache.set,u=f,f(h)}function f(h){const p=a(h);if(p)return p;const g=dj(h,o);return l(h,g),g}return function(){return u(fj.apply(null,arguments))}}const St=e=>{const r=o=>o[e]||[];return r.isThemeGetter=!0,r},Tb=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Rb=/^\((?:(\w[\w-]*):)?(.+)\)$/i,hj=/^\d+\/\d+$/,pj=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,gj=/\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$/,xj=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,vj=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,yj=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Pa=e=>hj.test(e),He=e=>!!e&&!Number.isNaN(Number(e)),no=e=>!!e&&Number.isInteger(Number(e)),Mm=e=>e.endsWith("%")&&He(e.slice(0,-1)),xr=e=>pj.test(e),bj=()=>!0,wj=e=>gj.test(e)&&!xj.test(e),Db=()=>!1,Nj=e=>vj.test(e),Sj=e=>yj.test(e),Ej=e=>!Ne(e)&&!Se(e),_j=e=>ds(e,Lb,Db),Ne=e=>Tb.test(e),Io=e=>ds(e,Ib,wj),Tm=e=>ds(e,Mj,He),zv=e=>ds(e,Ob,Db),jj=e=>ds(e,zb,Sj),Ac=e=>ds(e,Hb,Nj),Se=e=>Rb.test(e),Si=e=>fs(e,Ib),Cj=e=>fs(e,Tj),Lv=e=>fs(e,Ob),kj=e=>fs(e,Lb),Aj=e=>fs(e,zb),Mc=e=>fs(e,Hb,!0),ds=(e,r,o)=>{const a=Tb.exec(e);return a?a[1]?r(a[1]):o(a[2]):!1},fs=(e,r,o=!1)=>{const a=Rb.exec(e);return a?a[1]?r(a[1]):o:!1},Ob=e=>e==="position"||e==="percentage",zb=e=>e==="image"||e==="url",Lb=e=>e==="length"||e==="size"||e==="bg-size",Ib=e=>e==="length",Mj=e=>e==="number",Tj=e=>e==="family-name",Hb=e=>e==="shadow",Rj=()=>{const e=St("color"),r=St("font"),o=St("text"),a=St("font-weight"),l=St("tracking"),u=St("leading"),d=St("breakpoint"),f=St("container"),h=St("spacing"),p=St("radius"),g=St("shadow"),y=St("inset-shadow"),v=St("text-shadow"),b=St("drop-shadow"),S=St("blur"),w=St("perspective"),j=St("aspect"),k=St("ease"),M=St("animate"),_=()=>["auto","avoid","all","avoid-page","page","left","right","column"],A=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],D=()=>[...A(),Se,Ne],L=()=>["auto","hidden","clip","visible","scroll"],H=()=>["auto","contain","none"],B=()=>[Se,Ne,h],q=()=>[Pa,"full","auto",...B()],Z=()=>[no,"none","subgrid",Se,Ne],K=()=>["auto",{span:["full",no,Se,Ne]},no,Se,Ne],G=()=>[no,"auto",Se,Ne],te=()=>["auto","min","max","fr",Se,Ne],I=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],V=()=>["start","end","center","stretch","center-safe","end-safe"],E=()=>["auto",...B()],O=()=>[Pa,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...B()],z=()=>[e,Se,Ne],P=()=>[...A(),Lv,zv,{position:[Se,Ne]}],T=()=>["no-repeat",{repeat:["","x","y","space","round"]}],U=()=>["auto","cover","contain",kj,_j,{size:[Se,Ne]}],X=()=>[Mm,Si,Io],ee=()=>["","none","full",p,Se,Ne],ae=()=>["",He,Si,Io],me=()=>["solid","dashed","dotted","double"],ue=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Q=()=>[He,Mm,Lv,zv],se=()=>["","none",S,Se,Ne],pe=()=>["none",He,Se,Ne],le=()=>["none",He,Se,Ne],de=()=>[He,Se,Ne],he=()=>[Pa,"full",...B()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[xr],breakpoint:[xr],color:[bj],container:[xr],"drop-shadow":[xr],ease:["in","out","in-out"],font:[Ej],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[xr],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[xr],shadow:[xr],spacing:["px",He],text:[xr],"text-shadow":[xr],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Pa,Ne,Se,j]}],container:["container"],columns:[{columns:[He,Ne,Se,f]}],"break-after":[{"break-after":_()}],"break-before":[{"break-before":_()}],"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:D()}],overflow:[{overflow:L()}],"overflow-x":[{"overflow-x":L()}],"overflow-y":[{"overflow-y":L()}],overscroll:[{overscroll:H()}],"overscroll-x":[{"overscroll-x":H()}],"overscroll-y":[{"overscroll-y":H()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:q()}],"inset-x":[{"inset-x":q()}],"inset-y":[{"inset-y":q()}],start:[{start:q()}],end:[{end:q()}],top:[{top:q()}],right:[{right:q()}],bottom:[{bottom:q()}],left:[{left:q()}],visibility:["visible","invisible","collapse"],z:[{z:[no,"auto",Se,Ne]}],basis:[{basis:[Pa,"full","auto",f,...B()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[He,Pa,"auto","initial","none",Ne]}],grow:[{grow:["",He,Se,Ne]}],shrink:[{shrink:["",He,Se,Ne]}],order:[{order:[no,"first","last","none",Se,Ne]}],"grid-cols":[{"grid-cols":Z()}],"col-start-end":[{col:K()}],"col-start":[{"col-start":G()}],"col-end":[{"col-end":G()}],"grid-rows":[{"grid-rows":Z()}],"row-start-end":[{row:K()}],"row-start":[{"row-start":G()}],"row-end":[{"row-end":G()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":te()}],"auto-rows":[{"auto-rows":te()}],gap:[{gap:B()}],"gap-x":[{"gap-x":B()}],"gap-y":[{"gap-y":B()}],"justify-content":[{justify:[...I(),"normal"]}],"justify-items":[{"justify-items":[...V(),"normal"]}],"justify-self":[{"justify-self":["auto",...V()]}],"align-content":[{content:["normal",...I()]}],"align-items":[{items:[...V(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...V(),{baseline:["","last"]}]}],"place-content":[{"place-content":I()}],"place-items":[{"place-items":[...V(),"baseline"]}],"place-self":[{"place-self":["auto",...V()]}],p:[{p:B()}],px:[{px:B()}],py:[{py:B()}],ps:[{ps:B()}],pe:[{pe:B()}],pt:[{pt:B()}],pr:[{pr:B()}],pb:[{pb:B()}],pl:[{pl:B()}],m:[{m:E()}],mx:[{mx:E()}],my:[{my:E()}],ms:[{ms:E()}],me:[{me:E()}],mt:[{mt:E()}],mr:[{mr:E()}],mb:[{mb:E()}],ml:[{ml:E()}],"space-x":[{"space-x":B()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":B()}],"space-y-reverse":["space-y-reverse"],size:[{size:O()}],w:[{w:[f,"screen",...O()]}],"min-w":[{"min-w":[f,"screen","none",...O()]}],"max-w":[{"max-w":[f,"screen","none","prose",{screen:[d]},...O()]}],h:[{h:["screen","lh",...O()]}],"min-h":[{"min-h":["screen","lh","none",...O()]}],"max-h":[{"max-h":["screen","lh",...O()]}],"font-size":[{text:["base",o,Si,Io]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,Se,Tm]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Mm,Ne]}],"font-family":[{font:[Cj,Ne,r]}],"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:[l,Se,Ne]}],"line-clamp":[{"line-clamp":[He,"none",Se,Tm]}],leading:[{leading:[u,...B()]}],"list-image":[{"list-image":["none",Se,Ne]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Se,Ne]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:z()}],"text-color":[{text:z()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...me(),"wavy"]}],"text-decoration-thickness":[{decoration:[He,"from-font","auto",Se,Io]}],"text-decoration-color":[{decoration:z()}],"underline-offset":[{"underline-offset":[He,"auto",Se,Ne]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:B()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Se,Ne]}],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",Se,Ne]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:P()}],"bg-repeat":[{bg:T()}],"bg-size":[{bg:U()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},no,Se,Ne],radial:["",Se,Ne],conic:[no,Se,Ne]},Aj,jj]}],"bg-color":[{bg:z()}],"gradient-from-pos":[{from:X()}],"gradient-via-pos":[{via:X()}],"gradient-to-pos":[{to:X()}],"gradient-from":[{from:z()}],"gradient-via":[{via:z()}],"gradient-to":[{to:z()}],rounded:[{rounded:ee()}],"rounded-s":[{"rounded-s":ee()}],"rounded-e":[{"rounded-e":ee()}],"rounded-t":[{"rounded-t":ee()}],"rounded-r":[{"rounded-r":ee()}],"rounded-b":[{"rounded-b":ee()}],"rounded-l":[{"rounded-l":ee()}],"rounded-ss":[{"rounded-ss":ee()}],"rounded-se":[{"rounded-se":ee()}],"rounded-ee":[{"rounded-ee":ee()}],"rounded-es":[{"rounded-es":ee()}],"rounded-tl":[{"rounded-tl":ee()}],"rounded-tr":[{"rounded-tr":ee()}],"rounded-br":[{"rounded-br":ee()}],"rounded-bl":[{"rounded-bl":ee()}],"border-w":[{border:ae()}],"border-w-x":[{"border-x":ae()}],"border-w-y":[{"border-y":ae()}],"border-w-s":[{"border-s":ae()}],"border-w-e":[{"border-e":ae()}],"border-w-t":[{"border-t":ae()}],"border-w-r":[{"border-r":ae()}],"border-w-b":[{"border-b":ae()}],"border-w-l":[{"border-l":ae()}],"divide-x":[{"divide-x":ae()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ae()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...me(),"hidden","none"]}],"divide-style":[{divide:[...me(),"hidden","none"]}],"border-color":[{border:z()}],"border-color-x":[{"border-x":z()}],"border-color-y":[{"border-y":z()}],"border-color-s":[{"border-s":z()}],"border-color-e":[{"border-e":z()}],"border-color-t":[{"border-t":z()}],"border-color-r":[{"border-r":z()}],"border-color-b":[{"border-b":z()}],"border-color-l":[{"border-l":z()}],"divide-color":[{divide:z()}],"outline-style":[{outline:[...me(),"none","hidden"]}],"outline-offset":[{"outline-offset":[He,Se,Ne]}],"outline-w":[{outline:["",He,Si,Io]}],"outline-color":[{outline:z()}],shadow:[{shadow:["","none",g,Mc,Ac]}],"shadow-color":[{shadow:z()}],"inset-shadow":[{"inset-shadow":["none",y,Mc,Ac]}],"inset-shadow-color":[{"inset-shadow":z()}],"ring-w":[{ring:ae()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:z()}],"ring-offset-w":[{"ring-offset":[He,Io]}],"ring-offset-color":[{"ring-offset":z()}],"inset-ring-w":[{"inset-ring":ae()}],"inset-ring-color":[{"inset-ring":z()}],"text-shadow":[{"text-shadow":["none",v,Mc,Ac]}],"text-shadow-color":[{"text-shadow":z()}],opacity:[{opacity:[He,Se,Ne]}],"mix-blend":[{"mix-blend":[...ue(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ue()}],"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":[He]}],"mask-image-linear-from-pos":[{"mask-linear-from":Q()}],"mask-image-linear-to-pos":[{"mask-linear-to":Q()}],"mask-image-linear-from-color":[{"mask-linear-from":z()}],"mask-image-linear-to-color":[{"mask-linear-to":z()}],"mask-image-t-from-pos":[{"mask-t-from":Q()}],"mask-image-t-to-pos":[{"mask-t-to":Q()}],"mask-image-t-from-color":[{"mask-t-from":z()}],"mask-image-t-to-color":[{"mask-t-to":z()}],"mask-image-r-from-pos":[{"mask-r-from":Q()}],"mask-image-r-to-pos":[{"mask-r-to":Q()}],"mask-image-r-from-color":[{"mask-r-from":z()}],"mask-image-r-to-color":[{"mask-r-to":z()}],"mask-image-b-from-pos":[{"mask-b-from":Q()}],"mask-image-b-to-pos":[{"mask-b-to":Q()}],"mask-image-b-from-color":[{"mask-b-from":z()}],"mask-image-b-to-color":[{"mask-b-to":z()}],"mask-image-l-from-pos":[{"mask-l-from":Q()}],"mask-image-l-to-pos":[{"mask-l-to":Q()}],"mask-image-l-from-color":[{"mask-l-from":z()}],"mask-image-l-to-color":[{"mask-l-to":z()}],"mask-image-x-from-pos":[{"mask-x-from":Q()}],"mask-image-x-to-pos":[{"mask-x-to":Q()}],"mask-image-x-from-color":[{"mask-x-from":z()}],"mask-image-x-to-color":[{"mask-x-to":z()}],"mask-image-y-from-pos":[{"mask-y-from":Q()}],"mask-image-y-to-pos":[{"mask-y-to":Q()}],"mask-image-y-from-color":[{"mask-y-from":z()}],"mask-image-y-to-color":[{"mask-y-to":z()}],"mask-image-radial":[{"mask-radial":[Se,Ne]}],"mask-image-radial-from-pos":[{"mask-radial-from":Q()}],"mask-image-radial-to-pos":[{"mask-radial-to":Q()}],"mask-image-radial-from-color":[{"mask-radial-from":z()}],"mask-image-radial-to-color":[{"mask-radial-to":z()}],"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":A()}],"mask-image-conic-pos":[{"mask-conic":[He]}],"mask-image-conic-from-pos":[{"mask-conic-from":Q()}],"mask-image-conic-to-pos":[{"mask-conic-to":Q()}],"mask-image-conic-from-color":[{"mask-conic-from":z()}],"mask-image-conic-to-color":[{"mask-conic-to":z()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:P()}],"mask-repeat":[{mask:T()}],"mask-size":[{mask:U()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Se,Ne]}],filter:[{filter:["","none",Se,Ne]}],blur:[{blur:se()}],brightness:[{brightness:[He,Se,Ne]}],contrast:[{contrast:[He,Se,Ne]}],"drop-shadow":[{"drop-shadow":["","none",b,Mc,Ac]}],"drop-shadow-color":[{"drop-shadow":z()}],grayscale:[{grayscale:["",He,Se,Ne]}],"hue-rotate":[{"hue-rotate":[He,Se,Ne]}],invert:[{invert:["",He,Se,Ne]}],saturate:[{saturate:[He,Se,Ne]}],sepia:[{sepia:["",He,Se,Ne]}],"backdrop-filter":[{"backdrop-filter":["","none",Se,Ne]}],"backdrop-blur":[{"backdrop-blur":se()}],"backdrop-brightness":[{"backdrop-brightness":[He,Se,Ne]}],"backdrop-contrast":[{"backdrop-contrast":[He,Se,Ne]}],"backdrop-grayscale":[{"backdrop-grayscale":["",He,Se,Ne]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[He,Se,Ne]}],"backdrop-invert":[{"backdrop-invert":["",He,Se,Ne]}],"backdrop-opacity":[{"backdrop-opacity":[He,Se,Ne]}],"backdrop-saturate":[{"backdrop-saturate":[He,Se,Ne]}],"backdrop-sepia":[{"backdrop-sepia":["",He,Se,Ne]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":B()}],"border-spacing-x":[{"border-spacing-x":B()}],"border-spacing-y":[{"border-spacing-y":B()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Se,Ne]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[He,"initial",Se,Ne]}],ease:[{ease:["linear","initial",k,Se,Ne]}],delay:[{delay:[He,Se,Ne]}],animate:[{animate:["none",M,Se,Ne]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,Se,Ne]}],"perspective-origin":[{"perspective-origin":D()}],rotate:[{rotate:pe()}],"rotate-x":[{"rotate-x":pe()}],"rotate-y":[{"rotate-y":pe()}],"rotate-z":[{"rotate-z":pe()}],scale:[{scale:le()}],"scale-x":[{"scale-x":le()}],"scale-y":[{"scale-y":le()}],"scale-z":[{"scale-z":le()}],"scale-3d":["scale-3d"],skew:[{skew:de()}],"skew-x":[{"skew-x":de()}],"skew-y":[{"skew-y":de()}],transform:[{transform:[Se,Ne,"","none","gpu","cpu"]}],"transform-origin":[{origin:D()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:he()}],"translate-x":[{"translate-x":he()}],"translate-y":[{"translate-y":he()}],"translate-z":[{"translate-z":he()}],"translate-none":["translate-none"],accent:[{accent:z()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:z()}],"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",Se,Ne]}],"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":B()}],"scroll-mx":[{"scroll-mx":B()}],"scroll-my":[{"scroll-my":B()}],"scroll-ms":[{"scroll-ms":B()}],"scroll-me":[{"scroll-me":B()}],"scroll-mt":[{"scroll-mt":B()}],"scroll-mr":[{"scroll-mr":B()}],"scroll-mb":[{"scroll-mb":B()}],"scroll-ml":[{"scroll-ml":B()}],"scroll-p":[{"scroll-p":B()}],"scroll-px":[{"scroll-px":B()}],"scroll-py":[{"scroll-py":B()}],"scroll-ps":[{"scroll-ps":B()}],"scroll-pe":[{"scroll-pe":B()}],"scroll-pt":[{"scroll-pt":B()}],"scroll-pr":[{"scroll-pr":B()}],"scroll-pb":[{"scroll-pb":B()}],"scroll-pl":[{"scroll-pl":B()}],"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",Se,Ne]}],fill:[{fill:["none",...z()]}],"stroke-w":[{stroke:[He,Si,Io,Tm]}],stroke:[{stroke:["none",...z()]}],"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"]}},Dj=mj(Rj);function qe(...e){return Dj(Cb(e))}const Oj=kb("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function Oe({className:e,variant:r,size:o,asChild:a=!1,...l}){const u=a?F_:"button";return i.jsx(u,{"data-slot":"button",className:qe(Oj({variant:r,size:o,className:e})),...l})}function Ee(e,r,{checkForDefaultPrevented:o=!0}={}){return function(l){if(e?.(l),o===!1||!l.defaultPrevented)return r?.(l)}}function kr(e,r=[]){let o=[];function a(u,d){const f=N.createContext(d),h=o.length;o=[...o,d];const p=y=>{const{scope:v,children:b,...S}=y,w=v?.[e]?.[h]||f,j=N.useMemo(()=>S,Object.values(S));return i.jsx(w.Provider,{value:j,children:b})};p.displayName=u+"Provider";function g(y,v){const b=v?.[e]?.[h]||f,S=N.useContext(b);if(S)return S;if(d!==void 0)return d;throw new Error(`\`${y}\` must be used within \`${u}\``)}return[p,g]}const l=()=>{const u=o.map(d=>N.createContext(d));return function(f){const h=f?.[e]||u;return N.useMemo(()=>({[`__scope${e}`]:{...f,[e]:h}}),[f,h])}};return l.scopeName=e,[a,zj(l,...r)]}function zj(...e){const r=e[0];if(e.length===1)return r;const o=()=>{const a=e.map(l=>({useScope:l(),scopeName:l.scopeName}));return function(u){const d=a.reduce((f,{useScope:h,scopeName:p})=>{const y=h(u)[`__scope${p}`];return{...f,...y}},{});return N.useMemo(()=>({[`__scope${r.scopeName}`]:d}),[d])}};return o.scopeName=r.scopeName,o}var Rt=globalThis?.document?N.useLayoutEffect:()=>{},Lj=Eb[" useInsertionEffect ".trim().toString()]||Rt;function Ja({prop:e,defaultProp:r,onChange:o=()=>{},caller:a}){const[l,u,d]=Ij({defaultProp:r,onChange:o}),f=e!==void 0,h=f?e:l;{const g=N.useRef(e!==void 0);N.useEffect(()=>{const y=g.current;y!==f&&console.warn(`${a} is changing from ${y?"controlled":"uncontrolled"} to ${f?"controlled":"uncontrolled"}. 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.`),g.current=f},[f,a])}const p=N.useCallback(g=>{if(f){const y=Hj(g)?g(e):g;y!==e&&d.current?.(y)}else u(g)},[f,e,u,d]);return[h,p]}function Ij({defaultProp:e,onChange:r}){const[o,a]=N.useState(e),l=N.useRef(o),u=N.useRef(r);return Lj(()=>{u.current=r},[r]),N.useEffect(()=>{l.current!==o&&(u.current?.(o),l.current=o)},[o,l]),[o,a,u]}function Hj(e){return typeof e=="function"}var Qi=_b();const Bj=qh(Qi);var Uj=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ze=Uj.reduce((e,r)=>{const o=Qa(`Primitive.${r}`),a=N.forwardRef((l,u)=>{const{asChild:d,...f}=l,h=d?o:r;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),i.jsx(h,{...f,ref:u})});return a.displayName=`Primitive.${r}`,{...e,[r]:a}},{});function Bb(e,r){e&&Qi.flushSync(()=>e.dispatchEvent(r))}function Gh(e){const r=e+"CollectionProvider",[o,a]=kr(r),[l,u]=o(r,{collectionRef:{current:null},itemMap:new Map}),d=w=>{const{scope:j,children:k}=w,M=rn.useRef(null),_=rn.useRef(new Map).current;return i.jsx(l,{scope:j,itemMap:_,collectionRef:M,children:k})};d.displayName=r;const f=e+"CollectionSlot",h=Qa(f),p=rn.forwardRef((w,j)=>{const{scope:k,children:M}=w,_=u(f,k),A=Ke(j,_.collectionRef);return i.jsx(h,{ref:A,children:M})});p.displayName=f;const g=e+"CollectionItemSlot",y="data-radix-collection-item",v=Qa(g),b=rn.forwardRef((w,j)=>{const{scope:k,children:M,..._}=w,A=rn.useRef(null),D=Ke(j,A),L=u(g,k);return rn.useEffect(()=>(L.itemMap.set(A,{ref:A,..._}),()=>void L.itemMap.delete(A))),i.jsx(v,{[y]:"",ref:D,children:M})});b.displayName=g;function S(w){const j=u(e+"CollectionConsumer",w);return rn.useCallback(()=>{const M=j.collectionRef.current;if(!M)return[];const _=Array.from(M.querySelectorAll(`[${y}]`));return Array.from(j.itemMap.values()).sort((L,H)=>_.indexOf(L.ref.current)-_.indexOf(H.ref.current))},[j.collectionRef,j.itemMap])}return[{Provider:d,Slot:p,ItemSlot:b},S,a]}var Pj=N.createContext(void 0);function Ji(e){const r=N.useContext(Pj);return e||r||"ltr"}function Tt(e){const r=N.useRef(e);return N.useEffect(()=>{r.current=e}),N.useMemo(()=>(...o)=>r.current?.(...o),[])}function $j(e,r=globalThis?.document){const o=Tt(e);N.useEffect(()=>{const a=l=>{l.key==="Escape"&&o(l)};return r.addEventListener("keydown",a,{capture:!0}),()=>r.removeEventListener("keydown",a,{capture:!0})},[o,r])}var Vj="DismissableLayer",lh="dismissableLayer.update",qj="dismissableLayer.pointerDownOutside",Yj="dismissableLayer.focusOutside",Iv,Ub=N.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Xh=N.forwardRef((e,r)=>{const{disableOutsidePointerEvents:o=!1,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:d,onDismiss:f,...h}=e,p=N.useContext(Ub),[g,y]=N.useState(null),v=g?.ownerDocument??globalThis?.document,[,b]=N.useState({}),S=Ke(r,H=>y(H)),w=Array.from(p.layers),[j]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),k=w.indexOf(j),M=g?w.indexOf(g):-1,_=p.layersWithOutsidePointerEventsDisabled.size>0,A=M>=k,D=Fj(H=>{const B=H.target,q=[...p.branches].some(Z=>Z.contains(B));!A||q||(l?.(H),d?.(H),H.defaultPrevented||f?.())},v),L=Zj(H=>{const B=H.target;[...p.branches].some(Z=>Z.contains(B))||(u?.(H),d?.(H),H.defaultPrevented||f?.())},v);return $j(H=>{M===p.layers.size-1&&(a?.(H),!H.defaultPrevented&&f&&(H.preventDefault(),f()))},v),N.useEffect(()=>{if(g)return o&&(p.layersWithOutsidePointerEventsDisabled.size===0&&(Iv=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),p.layersWithOutsidePointerEventsDisabled.add(g)),p.layers.add(g),Hv(),()=>{o&&p.layersWithOutsidePointerEventsDisabled.size===1&&(v.body.style.pointerEvents=Iv)}},[g,v,o,p]),N.useEffect(()=>()=>{g&&(p.layers.delete(g),p.layersWithOutsidePointerEventsDisabled.delete(g),Hv())},[g,p]),N.useEffect(()=>{const H=()=>b({});return document.addEventListener(lh,H),()=>document.removeEventListener(lh,H)},[]),i.jsx(ze.div,{...h,ref:S,style:{pointerEvents:_?A?"auto":"none":void 0,...e.style},onFocusCapture:Ee(e.onFocusCapture,L.onFocusCapture),onBlurCapture:Ee(e.onBlurCapture,L.onBlurCapture),onPointerDownCapture:Ee(e.onPointerDownCapture,D.onPointerDownCapture)})});Xh.displayName=Vj;var Gj="DismissableLayerBranch",Xj=N.forwardRef((e,r)=>{const o=N.useContext(Ub),a=N.useRef(null),l=Ke(r,a);return N.useEffect(()=>{const u=a.current;if(u)return o.branches.add(u),()=>{o.branches.delete(u)}},[o.branches]),i.jsx(ze.div,{...e,ref:l})});Xj.displayName=Gj;function Fj(e,r=globalThis?.document){const o=Tt(e),a=N.useRef(!1),l=N.useRef(()=>{});return N.useEffect(()=>{const u=f=>{if(f.target&&!a.current){let h=function(){Pb(qj,o,p,{discrete:!0})};const p={originalEvent:f};f.pointerType==="touch"?(r.removeEventListener("click",l.current),l.current=h,r.addEventListener("click",l.current,{once:!0})):h()}else r.removeEventListener("click",l.current);a.current=!1},d=window.setTimeout(()=>{r.addEventListener("pointerdown",u)},0);return()=>{window.clearTimeout(d),r.removeEventListener("pointerdown",u),r.removeEventListener("click",l.current)}},[r,o]),{onPointerDownCapture:()=>a.current=!0}}function Zj(e,r=globalThis?.document){const o=Tt(e),a=N.useRef(!1);return N.useEffect(()=>{const l=u=>{u.target&&!a.current&&Pb(Yj,o,{originalEvent:u},{discrete:!1})};return r.addEventListener("focusin",l),()=>r.removeEventListener("focusin",l)},[r,o]),{onFocusCapture:()=>a.current=!0,onBlurCapture:()=>a.current=!1}}function Hv(){const e=new CustomEvent(lh);document.dispatchEvent(e)}function Pb(e,r,o,{discrete:a}){const l=o.originalEvent.target,u=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:o});r&&l.addEventListener(e,r,{once:!0}),a?Bb(l,u):l.dispatchEvent(u)}var Rm=0;function $b(){N.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Bv()),document.body.insertAdjacentElement("beforeend",e[1]??Bv()),Rm++,()=>{Rm===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),Rm--}},[])}function Bv(){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 Dm="focusScope.autoFocusOnMount",Om="focusScope.autoFocusOnUnmount",Uv={bubbles:!1,cancelable:!0},Kj="FocusScope",Fh=N.forwardRef((e,r)=>{const{loop:o=!1,trapped:a=!1,onMountAutoFocus:l,onUnmountAutoFocus:u,...d}=e,[f,h]=N.useState(null),p=Tt(l),g=Tt(u),y=N.useRef(null),v=Ke(r,w=>h(w)),b=N.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;N.useEffect(()=>{if(a){let w=function(_){if(b.paused||!f)return;const A=_.target;f.contains(A)?y.current=A:so(y.current,{select:!0})},j=function(_){if(b.paused||!f)return;const A=_.relatedTarget;A!==null&&(f.contains(A)||so(y.current,{select:!0}))},k=function(_){if(document.activeElement===document.body)for(const D of _)D.removedNodes.length>0&&so(f)};document.addEventListener("focusin",w),document.addEventListener("focusout",j);const M=new MutationObserver(k);return f&&M.observe(f,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",j),M.disconnect()}}},[a,f,b.paused]),N.useEffect(()=>{if(f){$v.add(b);const w=document.activeElement;if(!f.contains(w)){const k=new CustomEvent(Dm,Uv);f.addEventListener(Dm,p),f.dispatchEvent(k),k.defaultPrevented||(Wj(nC(Vb(f)),{select:!0}),document.activeElement===w&&so(f))}return()=>{f.removeEventListener(Dm,p),setTimeout(()=>{const k=new CustomEvent(Om,Uv);f.addEventListener(Om,g),f.dispatchEvent(k),k.defaultPrevented||so(w??document.body,{select:!0}),f.removeEventListener(Om,g),$v.remove(b)},0)}}},[f,p,g,b]);const S=N.useCallback(w=>{if(!o&&!a||b.paused)return;const j=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,k=document.activeElement;if(j&&k){const M=w.currentTarget,[_,A]=Qj(M);_&&A?!w.shiftKey&&k===A?(w.preventDefault(),o&&so(_,{select:!0})):w.shiftKey&&k===_&&(w.preventDefault(),o&&so(A,{select:!0})):k===M&&w.preventDefault()}},[o,a,b.paused]);return i.jsx(ze.div,{tabIndex:-1,...d,ref:v,onKeyDown:S})});Fh.displayName=Kj;function Wj(e,{select:r=!1}={}){const o=document.activeElement;for(const a of e)if(so(a,{select:r}),document.activeElement!==o)return}function Qj(e){const r=Vb(e),o=Pv(r,e),a=Pv(r.reverse(),e);return[o,a]}function Vb(e){const r=[],o=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:a=>{const l=a.tagName==="INPUT"&&a.type==="hidden";return a.disabled||a.hidden||l?NodeFilter.FILTER_SKIP:a.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;o.nextNode();)r.push(o.currentNode);return r}function Pv(e,r){for(const o of e)if(!Jj(o,{upTo:r}))return o}function Jj(e,{upTo:r}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(r!==void 0&&e===r)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function eC(e){return e instanceof HTMLInputElement&&"select"in e}function so(e,{select:r=!1}={}){if(e&&e.focus){const o=document.activeElement;e.focus({preventScroll:!0}),e!==o&&eC(e)&&r&&e.select()}}var $v=tC();function tC(){let e=[];return{add(r){const o=e[0];r!==o&&o?.pause(),e=Vv(e,r),e.unshift(r)},remove(r){e=Vv(e,r),e[0]?.resume()}}}function Vv(e,r){const o=[...e],a=o.indexOf(r);return a!==-1&&o.splice(a,1),o}function nC(e){return e.filter(r=>r.tagName!=="A")}var rC=Eb[" useId ".trim().toString()]||(()=>{}),oC=0;function Vo(e){const[r,o]=N.useState(rC());return Rt(()=>{o(a=>a??String(oC++))},[e]),r?`radix-${r}`:""}const aC=["top","right","bottom","left"],fo=Math.min,on=Math.max,su=Math.round,Tc=Math.floor,Vn=e=>({x:e,y:e}),sC={left:"right",right:"left",bottom:"top",top:"bottom"},iC={start:"end",end:"start"};function ch(e,r,o){return on(e,fo(r,o))}function wr(e,r){return typeof e=="function"?e(r):e}function Nr(e){return e.split("-")[0]}function ms(e){return e.split("-")[1]}function Zh(e){return e==="x"?"y":"x"}function Kh(e){return e==="y"?"height":"width"}const lC=new Set(["top","bottom"]);function Un(e){return lC.has(Nr(e))?"y":"x"}function Wh(e){return Zh(Un(e))}function cC(e,r,o){o===void 0&&(o=!1);const a=ms(e),l=Wh(e),u=Kh(l);let d=l==="x"?a===(o?"end":"start")?"right":"left":a==="start"?"bottom":"top";return r.reference[u]>r.floating[u]&&(d=iu(d)),[d,iu(d)]}function uC(e){const r=iu(e);return[uh(e),r,uh(r)]}function uh(e){return e.replace(/start|end/g,r=>iC[r])}const qv=["left","right"],Yv=["right","left"],dC=["top","bottom"],fC=["bottom","top"];function mC(e,r,o){switch(e){case"top":case"bottom":return o?r?Yv:qv:r?qv:Yv;case"left":case"right":return r?dC:fC;default:return[]}}function hC(e,r,o,a){const l=ms(e);let u=mC(Nr(e),o==="start",a);return l&&(u=u.map(d=>d+"-"+l),r&&(u=u.concat(u.map(uh)))),u}function iu(e){return e.replace(/left|right|bottom|top/g,r=>sC[r])}function pC(e){return{top:0,right:0,bottom:0,left:0,...e}}function qb(e){return typeof e!="number"?pC(e):{top:e,right:e,bottom:e,left:e}}function lu(e){const{x:r,y:o,width:a,height:l}=e;return{width:a,height:l,top:o,left:r,right:r+a,bottom:o+l,x:r,y:o}}function Gv(e,r,o){let{reference:a,floating:l}=e;const u=Un(r),d=Wh(r),f=Kh(d),h=Nr(r),p=u==="y",g=a.x+a.width/2-l.width/2,y=a.y+a.height/2-l.height/2,v=a[f]/2-l[f]/2;let b;switch(h){case"top":b={x:g,y:a.y-l.height};break;case"bottom":b={x:g,y:a.y+a.height};break;case"right":b={x:a.x+a.width,y};break;case"left":b={x:a.x-l.width,y};break;default:b={x:a.x,y:a.y}}switch(ms(r)){case"start":b[d]-=v*(o&&p?-1:1);break;case"end":b[d]+=v*(o&&p?-1:1);break}return b}const gC=async(e,r,o)=>{const{placement:a="bottom",strategy:l="absolute",middleware:u=[],platform:d}=o,f=u.filter(Boolean),h=await(d.isRTL==null?void 0:d.isRTL(r));let p=await d.getElementRects({reference:e,floating:r,strategy:l}),{x:g,y}=Gv(p,a,h),v=a,b={},S=0;for(let w=0;w<f.length;w++){const{name:j,fn:k}=f[w],{x:M,y:_,data:A,reset:D}=await k({x:g,y,initialPlacement:a,placement:v,strategy:l,middlewareData:b,rects:p,platform:d,elements:{reference:e,floating:r}});g=M??g,y=_??y,b={...b,[j]:{...b[j],...A}},D&&S<=50&&(S++,typeof D=="object"&&(D.placement&&(v=D.placement),D.rects&&(p=D.rects===!0?await d.getElementRects({reference:e,floating:r,strategy:l}):D.rects),{x:g,y}=Gv(p,v,h)),w=-1)}return{x:g,y,placement:v,strategy:l,middlewareData:b}};async function zi(e,r){var o;r===void 0&&(r={});const{x:a,y:l,platform:u,rects:d,elements:f,strategy:h}=e,{boundary:p="clippingAncestors",rootBoundary:g="viewport",elementContext:y="floating",altBoundary:v=!1,padding:b=0}=wr(r,e),S=qb(b),j=f[v?y==="floating"?"reference":"floating":y],k=lu(await u.getClippingRect({element:(o=await(u.isElement==null?void 0:u.isElement(j)))==null||o?j:j.contextElement||await(u.getDocumentElement==null?void 0:u.getDocumentElement(f.floating)),boundary:p,rootBoundary:g,strategy:h})),M=y==="floating"?{x:a,y:l,width:d.floating.width,height:d.floating.height}:d.reference,_=await(u.getOffsetParent==null?void 0:u.getOffsetParent(f.floating)),A=await(u.isElement==null?void 0:u.isElement(_))?await(u.getScale==null?void 0:u.getScale(_))||{x:1,y:1}:{x:1,y:1},D=lu(u.convertOffsetParentRelativeRectToViewportRelativeRect?await u.convertOffsetParentRelativeRectToViewportRelativeRect({elements:f,rect:M,offsetParent:_,strategy:h}):M);return{top:(k.top-D.top+S.top)/A.y,bottom:(D.bottom-k.bottom+S.bottom)/A.y,left:(k.left-D.left+S.left)/A.x,right:(D.right-k.right+S.right)/A.x}}const xC=e=>({name:"arrow",options:e,async fn(r){const{x:o,y:a,placement:l,rects:u,platform:d,elements:f,middlewareData:h}=r,{element:p,padding:g=0}=wr(e,r)||{};if(p==null)return{};const y=qb(g),v={x:o,y:a},b=Wh(l),S=Kh(b),w=await d.getDimensions(p),j=b==="y",k=j?"top":"left",M=j?"bottom":"right",_=j?"clientHeight":"clientWidth",A=u.reference[S]+u.reference[b]-v[b]-u.floating[S],D=v[b]-u.reference[b],L=await(d.getOffsetParent==null?void 0:d.getOffsetParent(p));let H=L?L[_]:0;(!H||!await(d.isElement==null?void 0:d.isElement(L)))&&(H=f.floating[_]||u.floating[S]);const B=A/2-D/2,q=H/2-w[S]/2-1,Z=fo(y[k],q),K=fo(y[M],q),G=Z,te=H-w[S]-K,I=H/2-w[S]/2+B,V=ch(G,I,te),E=!h.arrow&&ms(l)!=null&&I!==V&&u.reference[S]/2-(I<G?Z:K)-w[S]/2<0,O=E?I<G?I-G:I-te:0;return{[b]:v[b]+O,data:{[b]:V,centerOffset:I-V-O,...E&&{alignmentOffset:O}},reset:E}}}),vC=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(r){var o,a;const{placement:l,middlewareData:u,rects:d,initialPlacement:f,platform:h,elements:p}=r,{mainAxis:g=!0,crossAxis:y=!0,fallbackPlacements:v,fallbackStrategy:b="bestFit",fallbackAxisSideDirection:S="none",flipAlignment:w=!0,...j}=wr(e,r);if((o=u.arrow)!=null&&o.alignmentOffset)return{};const k=Nr(l),M=Un(f),_=Nr(f)===f,A=await(h.isRTL==null?void 0:h.isRTL(p.floating)),D=v||(_||!w?[iu(f)]:uC(f)),L=S!=="none";!v&&L&&D.push(...hC(f,w,S,A));const H=[f,...D],B=await zi(r,j),q=[];let Z=((a=u.flip)==null?void 0:a.overflows)||[];if(g&&q.push(B[k]),y){const I=cC(l,d,A);q.push(B[I[0]],B[I[1]])}if(Z=[...Z,{placement:l,overflows:q}],!q.every(I=>I<=0)){var K,G;const I=(((K=u.flip)==null?void 0:K.index)||0)+1,V=H[I];if(V&&(!(y==="alignment"?M!==Un(V):!1)||Z.every(z=>Un(z.placement)===M?z.overflows[0]>0:!0)))return{data:{index:I,overflows:Z},reset:{placement:V}};let E=(G=Z.filter(O=>O.overflows[0]<=0).sort((O,z)=>O.overflows[1]-z.overflows[1])[0])==null?void 0:G.placement;if(!E)switch(b){case"bestFit":{var te;const O=(te=Z.filter(z=>{if(L){const P=Un(z.placement);return P===M||P==="y"}return!0}).map(z=>[z.placement,z.overflows.filter(P=>P>0).reduce((P,T)=>P+T,0)]).sort((z,P)=>z[1]-P[1])[0])==null?void 0:te[0];O&&(E=O);break}case"initialPlacement":E=f;break}if(l!==E)return{reset:{placement:E}}}return{}}}};function Xv(e,r){return{top:e.top-r.height,right:e.right-r.width,bottom:e.bottom-r.height,left:e.left-r.width}}function Fv(e){return aC.some(r=>e[r]>=0)}const yC=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(r){const{rects:o}=r,{strategy:a="referenceHidden",...l}=wr(e,r);switch(a){case"referenceHidden":{const u=await zi(r,{...l,elementContext:"reference"}),d=Xv(u,o.reference);return{data:{referenceHiddenOffsets:d,referenceHidden:Fv(d)}}}case"escaped":{const u=await zi(r,{...l,altBoundary:!0}),d=Xv(u,o.floating);return{data:{escapedOffsets:d,escaped:Fv(d)}}}default:return{}}}}},Yb=new Set(["left","top"]);async function bC(e,r){const{placement:o,platform:a,elements:l}=e,u=await(a.isRTL==null?void 0:a.isRTL(l.floating)),d=Nr(o),f=ms(o),h=Un(o)==="y",p=Yb.has(d)?-1:1,g=u&&h?-1:1,y=wr(r,e);let{mainAxis:v,crossAxis:b,alignmentAxis:S}=typeof y=="number"?{mainAxis:y,crossAxis:0,alignmentAxis:null}:{mainAxis:y.mainAxis||0,crossAxis:y.crossAxis||0,alignmentAxis:y.alignmentAxis};return f&&typeof S=="number"&&(b=f==="end"?S*-1:S),h?{x:b*g,y:v*p}:{x:v*p,y:b*g}}const wC=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(r){var o,a;const{x:l,y:u,placement:d,middlewareData:f}=r,h=await bC(r,e);return d===((o=f.offset)==null?void 0:o.placement)&&(a=f.arrow)!=null&&a.alignmentOffset?{}:{x:l+h.x,y:u+h.y,data:{...h,placement:d}}}}},NC=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(r){const{x:o,y:a,placement:l}=r,{mainAxis:u=!0,crossAxis:d=!1,limiter:f={fn:j=>{let{x:k,y:M}=j;return{x:k,y:M}}},...h}=wr(e,r),p={x:o,y:a},g=await zi(r,h),y=Un(Nr(l)),v=Zh(y);let b=p[v],S=p[y];if(u){const j=v==="y"?"top":"left",k=v==="y"?"bottom":"right",M=b+g[j],_=b-g[k];b=ch(M,b,_)}if(d){const j=y==="y"?"top":"left",k=y==="y"?"bottom":"right",M=S+g[j],_=S-g[k];S=ch(M,S,_)}const w=f.fn({...r,[v]:b,[y]:S});return{...w,data:{x:w.x-o,y:w.y-a,enabled:{[v]:u,[y]:d}}}}}},SC=function(e){return e===void 0&&(e={}),{options:e,fn(r){const{x:o,y:a,placement:l,rects:u,middlewareData:d}=r,{offset:f=0,mainAxis:h=!0,crossAxis:p=!0}=wr(e,r),g={x:o,y:a},y=Un(l),v=Zh(y);let b=g[v],S=g[y];const w=wr(f,r),j=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};if(h){const _=v==="y"?"height":"width",A=u.reference[v]-u.floating[_]+j.mainAxis,D=u.reference[v]+u.reference[_]-j.mainAxis;b<A?b=A:b>D&&(b=D)}if(p){var k,M;const _=v==="y"?"width":"height",A=Yb.has(Nr(l)),D=u.reference[y]-u.floating[_]+(A&&((k=d.offset)==null?void 0:k[y])||0)+(A?0:j.crossAxis),L=u.reference[y]+u.reference[_]+(A?0:((M=d.offset)==null?void 0:M[y])||0)-(A?j.crossAxis:0);S<D?S=D:S>L&&(S=L)}return{[v]:b,[y]:S}}}},EC=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(r){var o,a;const{placement:l,rects:u,platform:d,elements:f}=r,{apply:h=()=>{},...p}=wr(e,r),g=await zi(r,p),y=Nr(l),v=ms(l),b=Un(l)==="y",{width:S,height:w}=u.floating;let j,k;y==="top"||y==="bottom"?(j=y,k=v===(await(d.isRTL==null?void 0:d.isRTL(f.floating))?"start":"end")?"left":"right"):(k=y,j=v==="end"?"top":"bottom");const M=w-g.top-g.bottom,_=S-g.left-g.right,A=fo(w-g[j],M),D=fo(S-g[k],_),L=!r.middlewareData.shift;let H=A,B=D;if((o=r.middlewareData.shift)!=null&&o.enabled.x&&(B=_),(a=r.middlewareData.shift)!=null&&a.enabled.y&&(H=M),L&&!v){const Z=on(g.left,0),K=on(g.right,0),G=on(g.top,0),te=on(g.bottom,0);b?B=S-2*(Z!==0||K!==0?Z+K:on(g.left,g.right)):H=w-2*(G!==0||te!==0?G+te:on(g.top,g.bottom))}await h({...r,availableWidth:B,availableHeight:H});const q=await d.getDimensions(f.floating);return S!==q.width||w!==q.height?{reset:{rects:!0}}:{}}}};function Tu(){return typeof window<"u"}function hs(e){return Gb(e)?(e.nodeName||"").toLowerCase():"#document"}function sn(e){var r;return(e==null||(r=e.ownerDocument)==null?void 0:r.defaultView)||window}function Fn(e){var r;return(r=(Gb(e)?e.ownerDocument:e.document)||window.document)==null?void 0:r.documentElement}function Gb(e){return Tu()?e instanceof Node||e instanceof sn(e).Node:!1}function jn(e){return Tu()?e instanceof Element||e instanceof sn(e).Element:!1}function Gn(e){return Tu()?e instanceof HTMLElement||e instanceof sn(e).HTMLElement:!1}function Zv(e){return!Tu()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof sn(e).ShadowRoot}const _C=new Set(["inline","contents"]);function el(e){const{overflow:r,overflowX:o,overflowY:a,display:l}=Cn(e);return/auto|scroll|overlay|hidden|clip/.test(r+a+o)&&!_C.has(l)}const jC=new Set(["table","td","th"]);function CC(e){return jC.has(hs(e))}const kC=[":popover-open",":modal"];function Ru(e){return kC.some(r=>{try{return e.matches(r)}catch{return!1}})}const AC=["transform","translate","scale","rotate","perspective"],MC=["transform","translate","scale","rotate","perspective","filter"],TC=["paint","layout","strict","content"];function Qh(e){const r=Jh(),o=jn(e)?Cn(e):e;return AC.some(a=>o[a]?o[a]!=="none":!1)||(o.containerType?o.containerType!=="normal":!1)||!r&&(o.backdropFilter?o.backdropFilter!=="none":!1)||!r&&(o.filter?o.filter!=="none":!1)||MC.some(a=>(o.willChange||"").includes(a))||TC.some(a=>(o.contain||"").includes(a))}function RC(e){let r=mo(e);for(;Gn(r)&&!es(r);){if(Qh(r))return r;if(Ru(r))return null;r=mo(r)}return null}function Jh(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const DC=new Set(["html","body","#document"]);function es(e){return DC.has(hs(e))}function Cn(e){return sn(e).getComputedStyle(e)}function Du(e){return jn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function mo(e){if(hs(e)==="html")return e;const r=e.assignedSlot||e.parentNode||Zv(e)&&e.host||Fn(e);return Zv(r)?r.host:r}function Xb(e){const r=mo(e);return es(r)?e.ownerDocument?e.ownerDocument.body:e.body:Gn(r)&&el(r)?r:Xb(r)}function Li(e,r,o){var a;r===void 0&&(r=[]),o===void 0&&(o=!0);const l=Xb(e),u=l===((a=e.ownerDocument)==null?void 0:a.body),d=sn(l);if(u){const f=dh(d);return r.concat(d,d.visualViewport||[],el(l)?l:[],f&&o?Li(f):[])}return r.concat(l,Li(l,[],o))}function dh(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Fb(e){const r=Cn(e);let o=parseFloat(r.width)||0,a=parseFloat(r.height)||0;const l=Gn(e),u=l?e.offsetWidth:o,d=l?e.offsetHeight:a,f=su(o)!==u||su(a)!==d;return f&&(o=u,a=d),{width:o,height:a,$:f}}function ep(e){return jn(e)?e:e.contextElement}function Fa(e){const r=ep(e);if(!Gn(r))return Vn(1);const o=r.getBoundingClientRect(),{width:a,height:l,$:u}=Fb(r);let d=(u?su(o.width):o.width)/a,f=(u?su(o.height):o.height)/l;return(!d||!Number.isFinite(d))&&(d=1),(!f||!Number.isFinite(f))&&(f=1),{x:d,y:f}}const OC=Vn(0);function Zb(e){const r=sn(e);return!Jh()||!r.visualViewport?OC:{x:r.visualViewport.offsetLeft,y:r.visualViewport.offsetTop}}function zC(e,r,o){return r===void 0&&(r=!1),!o||r&&o!==sn(e)?!1:r}function qo(e,r,o,a){r===void 0&&(r=!1),o===void 0&&(o=!1);const l=e.getBoundingClientRect(),u=ep(e);let d=Vn(1);r&&(a?jn(a)&&(d=Fa(a)):d=Fa(e));const f=zC(u,o,a)?Zb(u):Vn(0);let h=(l.left+f.x)/d.x,p=(l.top+f.y)/d.y,g=l.width/d.x,y=l.height/d.y;if(u){const v=sn(u),b=a&&jn(a)?sn(a):a;let S=v,w=dh(S);for(;w&&a&&b!==S;){const j=Fa(w),k=w.getBoundingClientRect(),M=Cn(w),_=k.left+(w.clientLeft+parseFloat(M.paddingLeft))*j.x,A=k.top+(w.clientTop+parseFloat(M.paddingTop))*j.y;h*=j.x,p*=j.y,g*=j.x,y*=j.y,h+=_,p+=A,S=sn(w),w=dh(S)}}return lu({width:g,height:y,x:h,y:p})}function Ou(e,r){const o=Du(e).scrollLeft;return r?r.left+o:qo(Fn(e)).left+o}function Kb(e,r){const o=e.getBoundingClientRect(),a=o.left+r.scrollLeft-Ou(e,o),l=o.top+r.scrollTop;return{x:a,y:l}}function LC(e){let{elements:r,rect:o,offsetParent:a,strategy:l}=e;const u=l==="fixed",d=Fn(a),f=r?Ru(r.floating):!1;if(a===d||f&&u)return o;let h={scrollLeft:0,scrollTop:0},p=Vn(1);const g=Vn(0),y=Gn(a);if((y||!y&&!u)&&((hs(a)!=="body"||el(d))&&(h=Du(a)),Gn(a))){const b=qo(a);p=Fa(a),g.x=b.x+a.clientLeft,g.y=b.y+a.clientTop}const v=d&&!y&&!u?Kb(d,h):Vn(0);return{width:o.width*p.x,height:o.height*p.y,x:o.x*p.x-h.scrollLeft*p.x+g.x+v.x,y:o.y*p.y-h.scrollTop*p.y+g.y+v.y}}function IC(e){return Array.from(e.getClientRects())}function HC(e){const r=Fn(e),o=Du(e),a=e.ownerDocument.body,l=on(r.scrollWidth,r.clientWidth,a.scrollWidth,a.clientWidth),u=on(r.scrollHeight,r.clientHeight,a.scrollHeight,a.clientHeight);let d=-o.scrollLeft+Ou(e);const f=-o.scrollTop;return Cn(a).direction==="rtl"&&(d+=on(r.clientWidth,a.clientWidth)-l),{width:l,height:u,x:d,y:f}}const Kv=25;function BC(e,r){const o=sn(e),a=Fn(e),l=o.visualViewport;let u=a.clientWidth,d=a.clientHeight,f=0,h=0;if(l){u=l.width,d=l.height;const g=Jh();(!g||g&&r==="fixed")&&(f=l.offsetLeft,h=l.offsetTop)}const p=Ou(a);if(p<=0){const g=a.ownerDocument,y=g.body,v=getComputedStyle(y),b=g.compatMode==="CSS1Compat"&&parseFloat(v.marginLeft)+parseFloat(v.marginRight)||0,S=Math.abs(a.clientWidth-y.clientWidth-b);S<=Kv&&(u-=S)}else p<=Kv&&(u+=p);return{width:u,height:d,x:f,y:h}}const UC=new Set(["absolute","fixed"]);function PC(e,r){const o=qo(e,!0,r==="fixed"),a=o.top+e.clientTop,l=o.left+e.clientLeft,u=Gn(e)?Fa(e):Vn(1),d=e.clientWidth*u.x,f=e.clientHeight*u.y,h=l*u.x,p=a*u.y;return{width:d,height:f,x:h,y:p}}function Wv(e,r,o){let a;if(r==="viewport")a=BC(e,o);else if(r==="document")a=HC(Fn(e));else if(jn(r))a=PC(r,o);else{const l=Zb(e);a={x:r.x-l.x,y:r.y-l.y,width:r.width,height:r.height}}return lu(a)}function Wb(e,r){const o=mo(e);return o===r||!jn(o)||es(o)?!1:Cn(o).position==="fixed"||Wb(o,r)}function $C(e,r){const o=r.get(e);if(o)return o;let a=Li(e,[],!1).filter(f=>jn(f)&&hs(f)!=="body"),l=null;const u=Cn(e).position==="fixed";let d=u?mo(e):e;for(;jn(d)&&!es(d);){const f=Cn(d),h=Qh(d);!h&&f.position==="fixed"&&(l=null),(u?!h&&!l:!h&&f.position==="static"&&!!l&&UC.has(l.position)||el(d)&&!h&&Wb(e,d))?a=a.filter(g=>g!==d):l=f,d=mo(d)}return r.set(e,a),a}function VC(e){let{element:r,boundary:o,rootBoundary:a,strategy:l}=e;const d=[...o==="clippingAncestors"?Ru(r)?[]:$C(r,this._c):[].concat(o),a],f=d[0],h=d.reduce((p,g)=>{const y=Wv(r,g,l);return p.top=on(y.top,p.top),p.right=fo(y.right,p.right),p.bottom=fo(y.bottom,p.bottom),p.left=on(y.left,p.left),p},Wv(r,f,l));return{width:h.right-h.left,height:h.bottom-h.top,x:h.left,y:h.top}}function qC(e){const{width:r,height:o}=Fb(e);return{width:r,height:o}}function YC(e,r,o){const a=Gn(r),l=Fn(r),u=o==="fixed",d=qo(e,!0,u,r);let f={scrollLeft:0,scrollTop:0};const h=Vn(0);function p(){h.x=Ou(l)}if(a||!a&&!u)if((hs(r)!=="body"||el(l))&&(f=Du(r)),a){const b=qo(r,!0,u,r);h.x=b.x+r.clientLeft,h.y=b.y+r.clientTop}else l&&p();u&&!a&&l&&p();const g=l&&!a&&!u?Kb(l,f):Vn(0),y=d.left+f.scrollLeft-h.x-g.x,v=d.top+f.scrollTop-h.y-g.y;return{x:y,y:v,width:d.width,height:d.height}}function zm(e){return Cn(e).position==="static"}function Qv(e,r){if(!Gn(e)||Cn(e).position==="fixed")return null;if(r)return r(e);let o=e.offsetParent;return Fn(e)===o&&(o=o.ownerDocument.body),o}function Qb(e,r){const o=sn(e);if(Ru(e))return o;if(!Gn(e)){let l=mo(e);for(;l&&!es(l);){if(jn(l)&&!zm(l))return l;l=mo(l)}return o}let a=Qv(e,r);for(;a&&CC(a)&&zm(a);)a=Qv(a,r);return a&&es(a)&&zm(a)&&!Qh(a)?o:a||RC(e)||o}const GC=async function(e){const r=this.getOffsetParent||Qb,o=this.getDimensions,a=await o(e.floating);return{reference:YC(e.reference,await r(e.floating),e.strategy),floating:{x:0,y:0,width:a.width,height:a.height}}};function XC(e){return Cn(e).direction==="rtl"}const FC={convertOffsetParentRelativeRectToViewportRelativeRect:LC,getDocumentElement:Fn,getClippingRect:VC,getOffsetParent:Qb,getElementRects:GC,getClientRects:IC,getDimensions:qC,getScale:Fa,isElement:jn,isRTL:XC};function Jb(e,r){return e.x===r.x&&e.y===r.y&&e.width===r.width&&e.height===r.height}function ZC(e,r){let o=null,a;const l=Fn(e);function u(){var f;clearTimeout(a),(f=o)==null||f.disconnect(),o=null}function d(f,h){f===void 0&&(f=!1),h===void 0&&(h=1),u();const p=e.getBoundingClientRect(),{left:g,top:y,width:v,height:b}=p;if(f||r(),!v||!b)return;const S=Tc(y),w=Tc(l.clientWidth-(g+v)),j=Tc(l.clientHeight-(y+b)),k=Tc(g),_={rootMargin:-S+"px "+-w+"px "+-j+"px "+-k+"px",threshold:on(0,fo(1,h))||1};let A=!0;function D(L){const H=L[0].intersectionRatio;if(H!==h){if(!A)return d();H?d(!1,H):a=setTimeout(()=>{d(!1,1e-7)},1e3)}H===1&&!Jb(p,e.getBoundingClientRect())&&d(),A=!1}try{o=new IntersectionObserver(D,{..._,root:l.ownerDocument})}catch{o=new IntersectionObserver(D,_)}o.observe(e)}return d(!0),u}function KC(e,r,o,a){a===void 0&&(a={});const{ancestorScroll:l=!0,ancestorResize:u=!0,elementResize:d=typeof ResizeObserver=="function",layoutShift:f=typeof IntersectionObserver=="function",animationFrame:h=!1}=a,p=ep(e),g=l||u?[...p?Li(p):[],...Li(r)]:[];g.forEach(k=>{l&&k.addEventListener("scroll",o,{passive:!0}),u&&k.addEventListener("resize",o)});const y=p&&f?ZC(p,o):null;let v=-1,b=null;d&&(b=new ResizeObserver(k=>{let[M]=k;M&&M.target===p&&b&&(b.unobserve(r),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var _;(_=b)==null||_.observe(r)})),o()}),p&&!h&&b.observe(p),b.observe(r));let S,w=h?qo(e):null;h&&j();function j(){const k=qo(e);w&&!Jb(w,k)&&o(),w=k,S=requestAnimationFrame(j)}return o(),()=>{var k;g.forEach(M=>{l&&M.removeEventListener("scroll",o),u&&M.removeEventListener("resize",o)}),y?.(),(k=b)==null||k.disconnect(),b=null,h&&cancelAnimationFrame(S)}}const WC=wC,QC=NC,JC=vC,e4=EC,t4=yC,Jv=xC,n4=SC,r4=(e,r,o)=>{const a=new Map,l={platform:FC,...o},u={...l.platform,_c:a};return gC(e,r,{...l,platform:u})};var o4=typeof document<"u",a4=function(){},Zc=o4?N.useLayoutEffect:a4;function cu(e,r){if(e===r)return!0;if(typeof e!=typeof r)return!1;if(typeof e=="function"&&e.toString()===r.toString())return!0;let o,a,l;if(e&&r&&typeof e=="object"){if(Array.isArray(e)){if(o=e.length,o!==r.length)return!1;for(a=o;a--!==0;)if(!cu(e[a],r[a]))return!1;return!0}if(l=Object.keys(e),o=l.length,o!==Object.keys(r).length)return!1;for(a=o;a--!==0;)if(!{}.hasOwnProperty.call(r,l[a]))return!1;for(a=o;a--!==0;){const u=l[a];if(!(u==="_owner"&&e.$$typeof)&&!cu(e[u],r[u]))return!1}return!0}return e!==e&&r!==r}function ew(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ey(e,r){const o=ew(e);return Math.round(r*o)/o}function Lm(e){const r=N.useRef(e);return Zc(()=>{r.current=e}),r}function s4(e){e===void 0&&(e={});const{placement:r="bottom",strategy:o="absolute",middleware:a=[],platform:l,elements:{reference:u,floating:d}={},transform:f=!0,whileElementsMounted:h,open:p}=e,[g,y]=N.useState({x:0,y:0,strategy:o,placement:r,middlewareData:{},isPositioned:!1}),[v,b]=N.useState(a);cu(v,a)||b(a);const[S,w]=N.useState(null),[j,k]=N.useState(null),M=N.useCallback(z=>{z!==L.current&&(L.current=z,w(z))},[]),_=N.useCallback(z=>{z!==H.current&&(H.current=z,k(z))},[]),A=u||S,D=d||j,L=N.useRef(null),H=N.useRef(null),B=N.useRef(g),q=h!=null,Z=Lm(h),K=Lm(l),G=Lm(p),te=N.useCallback(()=>{if(!L.current||!H.current)return;const z={placement:r,strategy:o,middleware:v};K.current&&(z.platform=K.current),r4(L.current,H.current,z).then(P=>{const T={...P,isPositioned:G.current!==!1};I.current&&!cu(B.current,T)&&(B.current=T,Qi.flushSync(()=>{y(T)}))})},[v,r,o,K,G]);Zc(()=>{p===!1&&B.current.isPositioned&&(B.current.isPositioned=!1,y(z=>({...z,isPositioned:!1})))},[p]);const I=N.useRef(!1);Zc(()=>(I.current=!0,()=>{I.current=!1}),[]),Zc(()=>{if(A&&(L.current=A),D&&(H.current=D),A&&D){if(Z.current)return Z.current(A,D,te);te()}},[A,D,te,Z,q]);const V=N.useMemo(()=>({reference:L,floating:H,setReference:M,setFloating:_}),[M,_]),E=N.useMemo(()=>({reference:A,floating:D}),[A,D]),O=N.useMemo(()=>{const z={position:o,left:0,top:0};if(!E.floating)return z;const P=ey(E.floating,g.x),T=ey(E.floating,g.y);return f?{...z,transform:"translate("+P+"px, "+T+"px)",...ew(E.floating)>=1.5&&{willChange:"transform"}}:{position:o,left:P,top:T}},[o,f,E.floating,g.x,g.y]);return N.useMemo(()=>({...g,update:te,refs:V,elements:E,floatingStyles:O}),[g,te,V,E,O])}const i4=e=>{function r(o){return{}.hasOwnProperty.call(o,"current")}return{name:"arrow",options:e,fn(o){const{element:a,padding:l}=typeof e=="function"?e(o):e;return a&&r(a)?a.current!=null?Jv({element:a.current,padding:l}).fn(o):{}:a?Jv({element:a,padding:l}).fn(o):{}}}},l4=(e,r)=>({...WC(e),options:[e,r]}),c4=(e,r)=>({...QC(e),options:[e,r]}),u4=(e,r)=>({...n4(e),options:[e,r]}),d4=(e,r)=>({...JC(e),options:[e,r]}),f4=(e,r)=>({...e4(e),options:[e,r]}),m4=(e,r)=>({...t4(e),options:[e,r]}),h4=(e,r)=>({...i4(e),options:[e,r]});var p4="Arrow",tw=N.forwardRef((e,r)=>{const{children:o,width:a=10,height:l=5,...u}=e;return i.jsx(ze.svg,{...u,ref:r,width:a,height:l,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?o:i.jsx("polygon",{points:"0,0 30,0 15,10"})})});tw.displayName=p4;var g4=tw;function nw(e){const[r,o]=N.useState(void 0);return Rt(()=>{if(e){o({width:e.offsetWidth,height:e.offsetHeight});const a=new ResizeObserver(l=>{if(!Array.isArray(l)||!l.length)return;const u=l[0];let d,f;if("borderBoxSize"in u){const h=u.borderBoxSize,p=Array.isArray(h)?h[0]:h;d=p.inlineSize,f=p.blockSize}else d=e.offsetWidth,f=e.offsetHeight;o({width:d,height:f})});return a.observe(e,{box:"border-box"}),()=>a.unobserve(e)}else o(void 0)},[e]),r}var tp="Popper",[rw,zu]=kr(tp),[x4,ow]=rw(tp),aw=e=>{const{__scopePopper:r,children:o}=e,[a,l]=N.useState(null);return i.jsx(x4,{scope:r,anchor:a,onAnchorChange:l,children:o})};aw.displayName=tp;var sw="PopperAnchor",iw=N.forwardRef((e,r)=>{const{__scopePopper:o,virtualRef:a,...l}=e,u=ow(sw,o),d=N.useRef(null),f=Ke(r,d),h=N.useRef(null);return N.useEffect(()=>{const p=h.current;h.current=a?.current||d.current,p!==h.current&&u.onAnchorChange(h.current)}),a?null:i.jsx(ze.div,{...l,ref:f})});iw.displayName=sw;var np="PopperContent",[v4,y4]=rw(np),lw=N.forwardRef((e,r)=>{const{__scopePopper:o,side:a="bottom",sideOffset:l=0,align:u="center",alignOffset:d=0,arrowPadding:f=0,avoidCollisions:h=!0,collisionBoundary:p=[],collisionPadding:g=0,sticky:y="partial",hideWhenDetached:v=!1,updatePositionStrategy:b="optimized",onPlaced:S,...w}=e,j=ow(np,o),[k,M]=N.useState(null),_=Ke(r,Q=>M(Q)),[A,D]=N.useState(null),L=nw(A),H=L?.width??0,B=L?.height??0,q=a+(u!=="center"?"-"+u:""),Z=typeof g=="number"?g:{top:0,right:0,bottom:0,left:0,...g},K=Array.isArray(p)?p:[p],G=K.length>0,te={padding:Z,boundary:K.filter(w4),altBoundary:G},{refs:I,floatingStyles:V,placement:E,isPositioned:O,middlewareData:z}=s4({strategy:"fixed",placement:q,whileElementsMounted:(...Q)=>KC(...Q,{animationFrame:b==="always"}),elements:{reference:j.anchor},middleware:[l4({mainAxis:l+B,alignmentAxis:d}),h&&c4({mainAxis:!0,crossAxis:!1,limiter:y==="partial"?u4():void 0,...te}),h&&d4({...te}),f4({...te,apply:({elements:Q,rects:se,availableWidth:pe,availableHeight:le})=>{const{width:de,height:he}=se.reference,xe=Q.floating.style;xe.setProperty("--radix-popper-available-width",`${pe}px`),xe.setProperty("--radix-popper-available-height",`${le}px`),xe.setProperty("--radix-popper-anchor-width",`${de}px`),xe.setProperty("--radix-popper-anchor-height",`${he}px`)}}),A&&h4({element:A,padding:f}),N4({arrowWidth:H,arrowHeight:B}),v&&m4({strategy:"referenceHidden",...te})]}),[P,T]=dw(E),U=Tt(S);Rt(()=>{O&&U?.()},[O,U]);const X=z.arrow?.x,ee=z.arrow?.y,ae=z.arrow?.centerOffset!==0,[me,ue]=N.useState();return Rt(()=>{k&&ue(window.getComputedStyle(k).zIndex)},[k]),i.jsx("div",{ref:I.setFloating,"data-radix-popper-content-wrapper":"",style:{...V,transform:O?V.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:me,"--radix-popper-transform-origin":[z.transformOrigin?.x,z.transformOrigin?.y].join(" "),...z.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:i.jsx(v4,{scope:o,placedSide:P,onArrowChange:D,arrowX:X,arrowY:ee,shouldHideArrow:ae,children:i.jsx(ze.div,{"data-side":P,"data-align":T,...w,ref:_,style:{...w.style,animation:O?void 0:"none"}})})})});lw.displayName=np;var cw="PopperArrow",b4={top:"bottom",right:"left",bottom:"top",left:"right"},uw=N.forwardRef(function(r,o){const{__scopePopper:a,...l}=r,u=y4(cw,a),d=b4[u.placedSide];return i.jsx("span",{ref:u.onArrowChange,style:{position:"absolute",left:u.arrowX,top:u.arrowY,[d]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[u.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[u.placedSide],visibility:u.shouldHideArrow?"hidden":void 0},children:i.jsx(g4,{...l,ref:o,style:{...l.style,display:"block"}})})});uw.displayName=cw;function w4(e){return e!==null}var N4=e=>({name:"transformOrigin",options:e,fn(r){const{placement:o,rects:a,middlewareData:l}=r,d=l.arrow?.centerOffset!==0,f=d?0:e.arrowWidth,h=d?0:e.arrowHeight,[p,g]=dw(o),y={start:"0%",center:"50%",end:"100%"}[g],v=(l.arrow?.x??0)+f/2,b=(l.arrow?.y??0)+h/2;let S="",w="";return p==="bottom"?(S=d?y:`${v}px`,w=`${-h}px`):p==="top"?(S=d?y:`${v}px`,w=`${a.floating.height+h}px`):p==="right"?(S=`${-h}px`,w=d?y:`${b}px`):p==="left"&&(S=`${a.floating.width+h}px`,w=d?y:`${b}px`),{data:{x:S,y:w}}}});function dw(e){const[r,o="center"]=e.split("-");return[r,o]}var fw=aw,mw=iw,hw=lw,pw=uw,S4="Portal",rp=N.forwardRef((e,r)=>{const{container:o,...a}=e,[l,u]=N.useState(!1);Rt(()=>u(!0),[]);const d=o||l&&globalThis?.document?.body;return d?Bj.createPortal(i.jsx(ze.div,{...a,ref:r}),d):null});rp.displayName=S4;function E4(e,r){return N.useReducer((o,a)=>r[o][a]??o,e)}var An=e=>{const{present:r,children:o}=e,a=_4(r),l=typeof o=="function"?o({present:a.isPresent}):N.Children.only(o),u=Ke(a.ref,j4(l));return typeof o=="function"||a.isPresent?N.cloneElement(l,{ref:u}):null};An.displayName="Presence";function _4(e){const[r,o]=N.useState(),a=N.useRef(null),l=N.useRef(e),u=N.useRef("none"),d=e?"mounted":"unmounted",[f,h]=E4(d,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return N.useEffect(()=>{const p=Rc(a.current);u.current=f==="mounted"?p:"none"},[f]),Rt(()=>{const p=a.current,g=l.current;if(g!==e){const v=u.current,b=Rc(p);e?h("MOUNT"):b==="none"||p?.display==="none"?h("UNMOUNT"):h(g&&v!==b?"ANIMATION_OUT":"UNMOUNT"),l.current=e}},[e,h]),Rt(()=>{if(r){let p;const g=r.ownerDocument.defaultView??window,y=b=>{const w=Rc(a.current).includes(CSS.escape(b.animationName));if(b.target===r&&w&&(h("ANIMATION_END"),!l.current)){const j=r.style.animationFillMode;r.style.animationFillMode="forwards",p=g.setTimeout(()=>{r.style.animationFillMode==="forwards"&&(r.style.animationFillMode=j)})}},v=b=>{b.target===r&&(u.current=Rc(a.current))};return r.addEventListener("animationstart",v),r.addEventListener("animationcancel",y),r.addEventListener("animationend",y),()=>{g.clearTimeout(p),r.removeEventListener("animationstart",v),r.removeEventListener("animationcancel",y),r.removeEventListener("animationend",y)}}else h("ANIMATION_END")},[r,h]),{isPresent:["mounted","unmountSuspended"].includes(f),ref:N.useCallback(p=>{a.current=p?getComputedStyle(p):null,o(p)},[])}}function Rc(e){return e?.animationName||"none"}function j4(e){let r=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,o=r&&"isReactWarning"in r&&r.isReactWarning;return o?e.ref:(r=Object.getOwnPropertyDescriptor(e,"ref")?.get,o=r&&"isReactWarning"in r&&r.isReactWarning,o?e.props.ref:e.props.ref||e.ref)}var Im="rovingFocusGroup.onEntryFocus",C4={bubbles:!1,cancelable:!0},tl="RovingFocusGroup",[fh,gw,k4]=Gh(tl),[A4,Lu]=kr(tl,[k4]),[M4,T4]=A4(tl),xw=N.forwardRef((e,r)=>i.jsx(fh.Provider,{scope:e.__scopeRovingFocusGroup,children:i.jsx(fh.Slot,{scope:e.__scopeRovingFocusGroup,children:i.jsx(R4,{...e,ref:r})})}));xw.displayName=tl;var R4=N.forwardRef((e,r)=>{const{__scopeRovingFocusGroup:o,orientation:a,loop:l=!1,dir:u,currentTabStopId:d,defaultCurrentTabStopId:f,onCurrentTabStopIdChange:h,onEntryFocus:p,preventScrollOnEntryFocus:g=!1,...y}=e,v=N.useRef(null),b=Ke(r,v),S=Ji(u),[w,j]=Ja({prop:d,defaultProp:f??null,onChange:h,caller:tl}),[k,M]=N.useState(!1),_=Tt(p),A=gw(o),D=N.useRef(!1),[L,H]=N.useState(0);return N.useEffect(()=>{const B=v.current;if(B)return B.addEventListener(Im,_),()=>B.removeEventListener(Im,_)},[_]),i.jsx(M4,{scope:o,orientation:a,dir:S,loop:l,currentTabStopId:w,onItemFocus:N.useCallback(B=>j(B),[j]),onItemShiftTab:N.useCallback(()=>M(!0),[]),onFocusableItemAdd:N.useCallback(()=>H(B=>B+1),[]),onFocusableItemRemove:N.useCallback(()=>H(B=>B-1),[]),children:i.jsx(ze.div,{tabIndex:k||L===0?-1:0,"data-orientation":a,...y,ref:b,style:{outline:"none",...e.style},onMouseDown:Ee(e.onMouseDown,()=>{D.current=!0}),onFocus:Ee(e.onFocus,B=>{const q=!D.current;if(B.target===B.currentTarget&&q&&!k){const Z=new CustomEvent(Im,C4);if(B.currentTarget.dispatchEvent(Z),!Z.defaultPrevented){const K=A().filter(E=>E.focusable),G=K.find(E=>E.active),te=K.find(E=>E.id===w),V=[G,te,...K].filter(Boolean).map(E=>E.ref.current);bw(V,g)}}D.current=!1}),onBlur:Ee(e.onBlur,()=>M(!1))})})}),vw="RovingFocusGroupItem",yw=N.forwardRef((e,r)=>{const{__scopeRovingFocusGroup:o,focusable:a=!0,active:l=!1,tabStopId:u,children:d,...f}=e,h=Vo(),p=u||h,g=T4(vw,o),y=g.currentTabStopId===p,v=gw(o),{onFocusableItemAdd:b,onFocusableItemRemove:S,currentTabStopId:w}=g;return N.useEffect(()=>{if(a)return b(),()=>S()},[a,b,S]),i.jsx(fh.ItemSlot,{scope:o,id:p,focusable:a,active:l,children:i.jsx(ze.span,{tabIndex:y?0:-1,"data-orientation":g.orientation,...f,ref:r,onMouseDown:Ee(e.onMouseDown,j=>{a?g.onItemFocus(p):j.preventDefault()}),onFocus:Ee(e.onFocus,()=>g.onItemFocus(p)),onKeyDown:Ee(e.onKeyDown,j=>{if(j.key==="Tab"&&j.shiftKey){g.onItemShiftTab();return}if(j.target!==j.currentTarget)return;const k=z4(j,g.orientation,g.dir);if(k!==void 0){if(j.metaKey||j.ctrlKey||j.altKey||j.shiftKey)return;j.preventDefault();let _=v().filter(A=>A.focusable).map(A=>A.ref.current);if(k==="last")_.reverse();else if(k==="prev"||k==="next"){k==="prev"&&_.reverse();const A=_.indexOf(j.currentTarget);_=g.loop?L4(_,A+1):_.slice(A+1)}setTimeout(()=>bw(_))}}),children:typeof d=="function"?d({isCurrentTabStop:y,hasTabStop:w!=null}):d})})});yw.displayName=vw;var D4={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function O4(e,r){return r!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function z4(e,r,o){const a=O4(e.key,o);if(!(r==="vertical"&&["ArrowLeft","ArrowRight"].includes(a))&&!(r==="horizontal"&&["ArrowUp","ArrowDown"].includes(a)))return D4[a]}function bw(e,r=!1){const o=document.activeElement;for(const a of e)if(a===o||(a.focus({preventScroll:r}),document.activeElement!==o))return}function L4(e,r){return e.map((o,a)=>e[(r+a)%e.length])}var ww=xw,Nw=yw,I4=function(e){if(typeof document>"u")return null;var r=Array.isArray(e)?e[0]:e;return r.ownerDocument.body},$a=new WeakMap,Dc=new WeakMap,Oc={},Hm=0,Sw=function(e){return e&&(e.host||Sw(e.parentNode))},H4=function(e,r){return r.map(function(o){if(e.contains(o))return o;var a=Sw(o);return a&&e.contains(a)?a:(console.error("aria-hidden",o,"in not contained inside",e,". Doing nothing"),null)}).filter(function(o){return!!o})},B4=function(e,r,o,a){var l=H4(r,Array.isArray(e)?e:[e]);Oc[o]||(Oc[o]=new WeakMap);var u=Oc[o],d=[],f=new Set,h=new Set(l),p=function(y){!y||f.has(y)||(f.add(y),p(y.parentNode))};l.forEach(p);var g=function(y){!y||h.has(y)||Array.prototype.forEach.call(y.children,function(v){if(f.has(v))g(v);else try{var b=v.getAttribute(a),S=b!==null&&b!=="false",w=($a.get(v)||0)+1,j=(u.get(v)||0)+1;$a.set(v,w),u.set(v,j),d.push(v),w===1&&S&&Dc.set(v,!0),j===1&&v.setAttribute(o,"true"),S||v.setAttribute(a,"true")}catch(k){console.error("aria-hidden: cannot operate on ",v,k)}})};return g(r),f.clear(),Hm++,function(){d.forEach(function(y){var v=$a.get(y)-1,b=u.get(y)-1;$a.set(y,v),u.set(y,b),v||(Dc.has(y)||y.removeAttribute(a),Dc.delete(y)),b||y.removeAttribute(o)}),Hm--,Hm||($a=new WeakMap,$a=new WeakMap,Dc=new WeakMap,Oc={})}},Ew=function(e,r,o){o===void 0&&(o="data-aria-hidden");var a=Array.from(Array.isArray(e)?e:[e]),l=I4(e);return l?(a.push.apply(a,Array.from(l.querySelectorAll("[aria-live], script"))),B4(a,l,o,"aria-hidden")):function(){return null}},Bn=function(){return Bn=Object.assign||function(r){for(var o,a=1,l=arguments.length;a<l;a++){o=arguments[a];for(var u in o)Object.prototype.hasOwnProperty.call(o,u)&&(r[u]=o[u])}return r},Bn.apply(this,arguments)};function _w(e,r){var o={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&r.indexOf(a)<0&&(o[a]=e[a]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,a=Object.getOwnPropertySymbols(e);l<a.length;l++)r.indexOf(a[l])<0&&Object.prototype.propertyIsEnumerable.call(e,a[l])&&(o[a[l]]=e[a[l]]);return o}function U4(e,r,o){if(o||arguments.length===2)for(var a=0,l=r.length,u;a<l;a++)(u||!(a in r))&&(u||(u=Array.prototype.slice.call(r,0,a)),u[a]=r[a]);return e.concat(u||Array.prototype.slice.call(r))}var Kc="right-scroll-bar-position",Wc="width-before-scroll-bar",P4="with-scroll-bars-hidden",$4="--removed-body-scroll-bar-size";function Bm(e,r){return typeof e=="function"?e(r):e&&(e.current=r),e}function V4(e,r){var o=N.useState(function(){return{value:e,callback:r,facade:{get current(){return o.value},set current(a){var l=o.value;l!==a&&(o.value=a,o.callback(a,l))}}}})[0];return o.callback=r,o.facade}var q4=typeof window<"u"?N.useLayoutEffect:N.useEffect,ty=new WeakMap;function Y4(e,r){var o=V4(null,function(a){return e.forEach(function(l){return Bm(l,a)})});return q4(function(){var a=ty.get(o);if(a){var l=new Set(a),u=new Set(e),d=o.current;l.forEach(function(f){u.has(f)||Bm(f,null)}),u.forEach(function(f){l.has(f)||Bm(f,d)})}ty.set(o,e)},[e]),o}function G4(e){return e}function X4(e,r){r===void 0&&(r=G4);var o=[],a=!1,l={read:function(){if(a)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return o.length?o[o.length-1]:e},useMedium:function(u){var d=r(u,a);return o.push(d),function(){o=o.filter(function(f){return f!==d})}},assignSyncMedium:function(u){for(a=!0;o.length;){var d=o;o=[],d.forEach(u)}o={push:function(f){return u(f)},filter:function(){return o}}},assignMedium:function(u){a=!0;var d=[];if(o.length){var f=o;o=[],f.forEach(u),d=o}var h=function(){var g=d;d=[],g.forEach(u)},p=function(){return Promise.resolve().then(h)};p(),o={push:function(g){d.push(g),p()},filter:function(g){return d=d.filter(g),o}}}};return l}function F4(e){e===void 0&&(e={});var r=X4(null);return r.options=Bn({async:!0,ssr:!1},e),r}var jw=function(e){var r=e.sideCar,o=_w(e,["sideCar"]);if(!r)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var a=r.read();if(!a)throw new Error("Sidecar medium not found");return N.createElement(a,Bn({},o))};jw.isSideCarExport=!0;function Z4(e,r){return e.useMedium(r),jw}var Cw=F4(),Um=function(){},Iu=N.forwardRef(function(e,r){var o=N.useRef(null),a=N.useState({onScrollCapture:Um,onWheelCapture:Um,onTouchMoveCapture:Um}),l=a[0],u=a[1],d=e.forwardProps,f=e.children,h=e.className,p=e.removeScrollBar,g=e.enabled,y=e.shards,v=e.sideCar,b=e.noRelative,S=e.noIsolation,w=e.inert,j=e.allowPinchZoom,k=e.as,M=k===void 0?"div":k,_=e.gapMode,A=_w(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),D=v,L=Y4([o,r]),H=Bn(Bn({},A),l);return N.createElement(N.Fragment,null,g&&N.createElement(D,{sideCar:Cw,removeScrollBar:p,shards:y,noRelative:b,noIsolation:S,inert:w,setCallbacks:u,allowPinchZoom:!!j,lockRef:o,gapMode:_}),d?N.cloneElement(N.Children.only(f),Bn(Bn({},H),{ref:L})):N.createElement(M,Bn({},H,{className:h,ref:L}),f))});Iu.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Iu.classNames={fullWidth:Wc,zeroRight:Kc};var K4=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function W4(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var r=K4();return r&&e.setAttribute("nonce",r),e}function Q4(e,r){e.styleSheet?e.styleSheet.cssText=r:e.appendChild(document.createTextNode(r))}function J4(e){var r=document.head||document.getElementsByTagName("head")[0];r.appendChild(e)}var e3=function(){var e=0,r=null;return{add:function(o){e==0&&(r=W4())&&(Q4(r,o),J4(r)),e++},remove:function(){e--,!e&&r&&(r.parentNode&&r.parentNode.removeChild(r),r=null)}}},t3=function(){var e=e3();return function(r,o){N.useEffect(function(){return e.add(r),function(){e.remove()}},[r&&o])}},kw=function(){var e=t3(),r=function(o){var a=o.styles,l=o.dynamic;return e(a,l),null};return r},n3={left:0,top:0,right:0,gap:0},Pm=function(e){return parseInt(e||"",10)||0},r3=function(e){var r=window.getComputedStyle(document.body),o=r[e==="padding"?"paddingLeft":"marginLeft"],a=r[e==="padding"?"paddingTop":"marginTop"],l=r[e==="padding"?"paddingRight":"marginRight"];return[Pm(o),Pm(a),Pm(l)]},o3=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return n3;var r=r3(e),o=document.documentElement.clientWidth,a=window.innerWidth;return{left:r[0],top:r[1],right:r[2],gap:Math.max(0,a-o+r[2]-r[0])}},a3=kw(),Za="data-scroll-locked",s3=function(e,r,o,a){var l=e.left,u=e.top,d=e.right,f=e.gap;return o===void 0&&(o="margin"),`
50
- .`.concat(P4,` {
51
- overflow: hidden `).concat(a,`;
52
- padding-right: `).concat(f,"px ").concat(a,`;
53
- }
54
- body[`).concat(Za,`] {
55
- overflow: hidden `).concat(a,`;
56
- overscroll-behavior: contain;
57
- `).concat([r&&"position: relative ".concat(a,";"),o==="margin"&&`
58
- padding-left: `.concat(l,`px;
59
- padding-top: `).concat(u,`px;
60
- padding-right: `).concat(d,`px;
61
- margin-left:0;
62
- margin-top:0;
63
- margin-right: `).concat(f,"px ").concat(a,`;
64
- `),o==="padding"&&"padding-right: ".concat(f,"px ").concat(a,";")].filter(Boolean).join(""),`
65
- }
66
-
67
- .`).concat(Kc,` {
68
- right: `).concat(f,"px ").concat(a,`;
69
- }
70
-
71
- .`).concat(Wc,` {
72
- margin-right: `).concat(f,"px ").concat(a,`;
73
- }
74
-
75
- .`).concat(Kc," .").concat(Kc,` {
76
- right: 0 `).concat(a,`;
77
- }
78
-
79
- .`).concat(Wc," .").concat(Wc,` {
80
- margin-right: 0 `).concat(a,`;
81
- }
82
-
83
- body[`).concat(Za,`] {
84
- `).concat($4,": ").concat(f,`px;
85
- }
86
- `)},ny=function(){var e=parseInt(document.body.getAttribute(Za)||"0",10);return isFinite(e)?e:0},i3=function(){N.useEffect(function(){return document.body.setAttribute(Za,(ny()+1).toString()),function(){var e=ny()-1;e<=0?document.body.removeAttribute(Za):document.body.setAttribute(Za,e.toString())}},[])},l3=function(e){var r=e.noRelative,o=e.noImportant,a=e.gapMode,l=a===void 0?"margin":a;i3();var u=N.useMemo(function(){return o3(l)},[l]);return N.createElement(a3,{styles:s3(u,!r,l,o?"":"!important")})},mh=!1;if(typeof window<"u")try{var zc=Object.defineProperty({},"passive",{get:function(){return mh=!0,!0}});window.addEventListener("test",zc,zc),window.removeEventListener("test",zc,zc)}catch{mh=!1}var Va=mh?{passive:!1}:!1,c3=function(e){return e.tagName==="TEXTAREA"},Aw=function(e,r){if(!(e instanceof Element))return!1;var o=window.getComputedStyle(e);return o[r]!=="hidden"&&!(o.overflowY===o.overflowX&&!c3(e)&&o[r]==="visible")},u3=function(e){return Aw(e,"overflowY")},d3=function(e){return Aw(e,"overflowX")},ry=function(e,r){var o=r.ownerDocument,a=r;do{typeof ShadowRoot<"u"&&a instanceof ShadowRoot&&(a=a.host);var l=Mw(e,a);if(l){var u=Tw(e,a),d=u[1],f=u[2];if(d>f)return!0}a=a.parentNode}while(a&&a!==o.body);return!1},f3=function(e){var r=e.scrollTop,o=e.scrollHeight,a=e.clientHeight;return[r,o,a]},m3=function(e){var r=e.scrollLeft,o=e.scrollWidth,a=e.clientWidth;return[r,o,a]},Mw=function(e,r){return e==="v"?u3(r):d3(r)},Tw=function(e,r){return e==="v"?f3(r):m3(r)},h3=function(e,r){return e==="h"&&r==="rtl"?-1:1},p3=function(e,r,o,a,l){var u=h3(e,window.getComputedStyle(r).direction),d=u*a,f=o.target,h=r.contains(f),p=!1,g=d>0,y=0,v=0;do{if(!f)break;var b=Tw(e,f),S=b[0],w=b[1],j=b[2],k=w-j-u*S;(S||k)&&Mw(e,f)&&(y+=k,v+=S);var M=f.parentNode;f=M&&M.nodeType===Node.DOCUMENT_FRAGMENT_NODE?M.host:M}while(!h&&f!==document.body||h&&(r.contains(f)||r===f));return(g&&Math.abs(y)<1||!g&&Math.abs(v)<1)&&(p=!0),p},Lc=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},oy=function(e){return[e.deltaX,e.deltaY]},ay=function(e){return e&&"current"in e?e.current:e},g3=function(e,r){return e[0]===r[0]&&e[1]===r[1]},x3=function(e){return`
87
- .block-interactivity-`.concat(e,` {pointer-events: none;}
88
- .allow-interactivity-`).concat(e,` {pointer-events: all;}
89
- `)},v3=0,qa=[];function y3(e){var r=N.useRef([]),o=N.useRef([0,0]),a=N.useRef(),l=N.useState(v3++)[0],u=N.useState(kw)[0],d=N.useRef(e);N.useEffect(function(){d.current=e},[e]),N.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(l));var w=U4([e.lockRef.current],(e.shards||[]).map(ay),!0).filter(Boolean);return w.forEach(function(j){return j.classList.add("allow-interactivity-".concat(l))}),function(){document.body.classList.remove("block-interactivity-".concat(l)),w.forEach(function(j){return j.classList.remove("allow-interactivity-".concat(l))})}}},[e.inert,e.lockRef.current,e.shards]);var f=N.useCallback(function(w,j){if("touches"in w&&w.touches.length===2||w.type==="wheel"&&w.ctrlKey)return!d.current.allowPinchZoom;var k=Lc(w),M=o.current,_="deltaX"in w?w.deltaX:M[0]-k[0],A="deltaY"in w?w.deltaY:M[1]-k[1],D,L=w.target,H=Math.abs(_)>Math.abs(A)?"h":"v";if("touches"in w&&H==="h"&&L.type==="range")return!1;var B=ry(H,L);if(!B)return!0;if(B?D=H:(D=H==="v"?"h":"v",B=ry(H,L)),!B)return!1;if(!a.current&&"changedTouches"in w&&(_||A)&&(a.current=D),!D)return!0;var q=a.current||D;return p3(q,j,w,q==="h"?_:A)},[]),h=N.useCallback(function(w){var j=w;if(!(!qa.length||qa[qa.length-1]!==u)){var k="deltaY"in j?oy(j):Lc(j),M=r.current.filter(function(D){return D.name===j.type&&(D.target===j.target||j.target===D.shadowParent)&&g3(D.delta,k)})[0];if(M&&M.should){j.cancelable&&j.preventDefault();return}if(!M){var _=(d.current.shards||[]).map(ay).filter(Boolean).filter(function(D){return D.contains(j.target)}),A=_.length>0?f(j,_[0]):!d.current.noIsolation;A&&j.cancelable&&j.preventDefault()}}},[]),p=N.useCallback(function(w,j,k,M){var _={name:w,delta:j,target:k,should:M,shadowParent:b3(k)};r.current.push(_),setTimeout(function(){r.current=r.current.filter(function(A){return A!==_})},1)},[]),g=N.useCallback(function(w){o.current=Lc(w),a.current=void 0},[]),y=N.useCallback(function(w){p(w.type,oy(w),w.target,f(w,e.lockRef.current))},[]),v=N.useCallback(function(w){p(w.type,Lc(w),w.target,f(w,e.lockRef.current))},[]);N.useEffect(function(){return qa.push(u),e.setCallbacks({onScrollCapture:y,onWheelCapture:y,onTouchMoveCapture:v}),document.addEventListener("wheel",h,Va),document.addEventListener("touchmove",h,Va),document.addEventListener("touchstart",g,Va),function(){qa=qa.filter(function(w){return w!==u}),document.removeEventListener("wheel",h,Va),document.removeEventListener("touchmove",h,Va),document.removeEventListener("touchstart",g,Va)}},[]);var b=e.removeScrollBar,S=e.inert;return N.createElement(N.Fragment,null,S?N.createElement(u,{styles:x3(l)}):null,b?N.createElement(l3,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function b3(e){for(var r=null;e!==null;)e instanceof ShadowRoot&&(r=e.host,e=e.host),e=e.parentNode;return r}const w3=Z4(Cw,y3);var op=N.forwardRef(function(e,r){return N.createElement(Iu,Bn({},e,{ref:r,sideCar:w3}))});op.classNames=Iu.classNames;var hh=["Enter"," "],N3=["ArrowDown","PageUp","Home"],Rw=["ArrowUp","PageDown","End"],S3=[...N3,...Rw],E3={ltr:[...hh,"ArrowRight"],rtl:[...hh,"ArrowLeft"]},_3={ltr:["ArrowLeft"],rtl:["ArrowRight"]},nl="Menu",[Ii,j3,C3]=Gh(nl),[Jo,Dw]=kr(nl,[C3,zu,Lu]),Hu=zu(),Ow=Lu(),[k3,ea]=Jo(nl),[A3,rl]=Jo(nl),zw=e=>{const{__scopeMenu:r,open:o=!1,children:a,dir:l,onOpenChange:u,modal:d=!0}=e,f=Hu(r),[h,p]=N.useState(null),g=N.useRef(!1),y=Tt(u),v=Ji(l);return N.useEffect(()=>{const b=()=>{g.current=!0,document.addEventListener("pointerdown",S,{capture:!0,once:!0}),document.addEventListener("pointermove",S,{capture:!0,once:!0})},S=()=>g.current=!1;return document.addEventListener("keydown",b,{capture:!0}),()=>{document.removeEventListener("keydown",b,{capture:!0}),document.removeEventListener("pointerdown",S,{capture:!0}),document.removeEventListener("pointermove",S,{capture:!0})}},[]),i.jsx(fw,{...f,children:i.jsx(k3,{scope:r,open:o,onOpenChange:y,content:h,onContentChange:p,children:i.jsx(A3,{scope:r,onClose:N.useCallback(()=>y(!1),[y]),isUsingKeyboardRef:g,dir:v,modal:d,children:a})})})};zw.displayName=nl;var M3="MenuAnchor",ap=N.forwardRef((e,r)=>{const{__scopeMenu:o,...a}=e,l=Hu(o);return i.jsx(mw,{...l,...a,ref:r})});ap.displayName=M3;var sp="MenuPortal",[T3,Lw]=Jo(sp,{forceMount:void 0}),Iw=e=>{const{__scopeMenu:r,forceMount:o,children:a,container:l}=e,u=ea(sp,r);return i.jsx(T3,{scope:r,forceMount:o,children:i.jsx(An,{present:o||u.open,children:i.jsx(rp,{asChild:!0,container:l,children:a})})})};Iw.displayName=sp;var gn="MenuContent",[R3,ip]=Jo(gn),Hw=N.forwardRef((e,r)=>{const o=Lw(gn,e.__scopeMenu),{forceMount:a=o.forceMount,...l}=e,u=ea(gn,e.__scopeMenu),d=rl(gn,e.__scopeMenu);return i.jsx(Ii.Provider,{scope:e.__scopeMenu,children:i.jsx(An,{present:a||u.open,children:i.jsx(Ii.Slot,{scope:e.__scopeMenu,children:d.modal?i.jsx(D3,{...l,ref:r}):i.jsx(O3,{...l,ref:r})})})})}),D3=N.forwardRef((e,r)=>{const o=ea(gn,e.__scopeMenu),a=N.useRef(null),l=Ke(r,a);return N.useEffect(()=>{const u=a.current;if(u)return Ew(u)},[]),i.jsx(lp,{...e,ref:l,trapFocus:o.open,disableOutsidePointerEvents:o.open,disableOutsideScroll:!0,onFocusOutside:Ee(e.onFocusOutside,u=>u.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>o.onOpenChange(!1)})}),O3=N.forwardRef((e,r)=>{const o=ea(gn,e.__scopeMenu);return i.jsx(lp,{...e,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>o.onOpenChange(!1)})}),z3=Qa("MenuContent.ScrollLock"),lp=N.forwardRef((e,r)=>{const{__scopeMenu:o,loop:a=!1,trapFocus:l,onOpenAutoFocus:u,onCloseAutoFocus:d,disableOutsidePointerEvents:f,onEntryFocus:h,onEscapeKeyDown:p,onPointerDownOutside:g,onFocusOutside:y,onInteractOutside:v,onDismiss:b,disableOutsideScroll:S,...w}=e,j=ea(gn,o),k=rl(gn,o),M=Hu(o),_=Ow(o),A=j3(o),[D,L]=N.useState(null),H=N.useRef(null),B=Ke(r,H,j.onContentChange),q=N.useRef(0),Z=N.useRef(""),K=N.useRef(0),G=N.useRef(null),te=N.useRef("right"),I=N.useRef(0),V=S?op:N.Fragment,E=S?{as:z3,allowPinchZoom:!0}:void 0,O=P=>{const T=Z.current+P,U=A().filter(Q=>!Q.disabled),X=document.activeElement,ee=U.find(Q=>Q.ref.current===X)?.textValue,ae=U.map(Q=>Q.textValue),me=X3(ae,T,ee),ue=U.find(Q=>Q.textValue===me)?.ref.current;(function Q(se){Z.current=se,window.clearTimeout(q.current),se!==""&&(q.current=window.setTimeout(()=>Q(""),1e3))})(T),ue&&setTimeout(()=>ue.focus())};N.useEffect(()=>()=>window.clearTimeout(q.current),[]),$b();const z=N.useCallback(P=>te.current===G.current?.side&&Z3(P,G.current?.area),[]);return i.jsx(R3,{scope:o,searchRef:Z,onItemEnter:N.useCallback(P=>{z(P)&&P.preventDefault()},[z]),onItemLeave:N.useCallback(P=>{z(P)||(H.current?.focus(),L(null))},[z]),onTriggerLeave:N.useCallback(P=>{z(P)&&P.preventDefault()},[z]),pointerGraceTimerRef:K,onPointerGraceIntentChange:N.useCallback(P=>{G.current=P},[]),children:i.jsx(V,{...E,children:i.jsx(Fh,{asChild:!0,trapped:l,onMountAutoFocus:Ee(u,P=>{P.preventDefault(),H.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:d,children:i.jsx(Xh,{asChild:!0,disableOutsidePointerEvents:f,onEscapeKeyDown:p,onPointerDownOutside:g,onFocusOutside:y,onInteractOutside:v,onDismiss:b,children:i.jsx(ww,{asChild:!0,..._,dir:k.dir,orientation:"vertical",loop:a,currentTabStopId:D,onCurrentTabStopIdChange:L,onEntryFocus:Ee(h,P=>{k.isUsingKeyboardRef.current||P.preventDefault()}),preventScrollOnEntryFocus:!0,children:i.jsx(hw,{role:"menu","aria-orientation":"vertical","data-state":e1(j.open),"data-radix-menu-content":"",dir:k.dir,...M,...w,ref:B,style:{outline:"none",...w.style},onKeyDown:Ee(w.onKeyDown,P=>{const U=P.target.closest("[data-radix-menu-content]")===P.currentTarget,X=P.ctrlKey||P.altKey||P.metaKey,ee=P.key.length===1;U&&(P.key==="Tab"&&P.preventDefault(),!X&&ee&&O(P.key));const ae=H.current;if(P.target!==ae||!S3.includes(P.key))return;P.preventDefault();const ue=A().filter(Q=>!Q.disabled).map(Q=>Q.ref.current);Rw.includes(P.key)&&ue.reverse(),Y3(ue)}),onBlur:Ee(e.onBlur,P=>{P.currentTarget.contains(P.target)||(window.clearTimeout(q.current),Z.current="")}),onPointerMove:Ee(e.onPointerMove,Hi(P=>{const T=P.target,U=I.current!==P.clientX;if(P.currentTarget.contains(T)&&U){const X=P.clientX>I.current?"right":"left";te.current=X,I.current=P.clientX}}))})})})})})})});Hw.displayName=gn;var L3="MenuGroup",cp=N.forwardRef((e,r)=>{const{__scopeMenu:o,...a}=e;return i.jsx(ze.div,{role:"group",...a,ref:r})});cp.displayName=L3;var I3="MenuLabel",Bw=N.forwardRef((e,r)=>{const{__scopeMenu:o,...a}=e;return i.jsx(ze.div,{...a,ref:r})});Bw.displayName=I3;var uu="MenuItem",sy="menu.itemSelect",Bu=N.forwardRef((e,r)=>{const{disabled:o=!1,onSelect:a,...l}=e,u=N.useRef(null),d=rl(uu,e.__scopeMenu),f=ip(uu,e.__scopeMenu),h=Ke(r,u),p=N.useRef(!1),g=()=>{const y=u.current;if(!o&&y){const v=new CustomEvent(sy,{bubbles:!0,cancelable:!0});y.addEventListener(sy,b=>a?.(b),{once:!0}),Bb(y,v),v.defaultPrevented?p.current=!1:d.onClose()}};return i.jsx(Uw,{...l,ref:h,disabled:o,onClick:Ee(e.onClick,g),onPointerDown:y=>{e.onPointerDown?.(y),p.current=!0},onPointerUp:Ee(e.onPointerUp,y=>{p.current||y.currentTarget?.click()}),onKeyDown:Ee(e.onKeyDown,y=>{const v=f.searchRef.current!=="";o||v&&y.key===" "||hh.includes(y.key)&&(y.currentTarget.click(),y.preventDefault())})})});Bu.displayName=uu;var Uw=N.forwardRef((e,r)=>{const{__scopeMenu:o,disabled:a=!1,textValue:l,...u}=e,d=ip(uu,o),f=Ow(o),h=N.useRef(null),p=Ke(r,h),[g,y]=N.useState(!1),[v,b]=N.useState("");return N.useEffect(()=>{const S=h.current;S&&b((S.textContent??"").trim())},[u.children]),i.jsx(Ii.ItemSlot,{scope:o,disabled:a,textValue:l??v,children:i.jsx(Nw,{asChild:!0,...f,focusable:!a,children:i.jsx(ze.div,{role:"menuitem","data-highlighted":g?"":void 0,"aria-disabled":a||void 0,"data-disabled":a?"":void 0,...u,ref:p,onPointerMove:Ee(e.onPointerMove,Hi(S=>{a?d.onItemLeave(S):(d.onItemEnter(S),S.defaultPrevented||S.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Ee(e.onPointerLeave,Hi(S=>d.onItemLeave(S))),onFocus:Ee(e.onFocus,()=>y(!0)),onBlur:Ee(e.onBlur,()=>y(!1))})})})}),H3="MenuCheckboxItem",Pw=N.forwardRef((e,r)=>{const{checked:o=!1,onCheckedChange:a,...l}=e;return i.jsx(Gw,{scope:e.__scopeMenu,checked:o,children:i.jsx(Bu,{role:"menuitemcheckbox","aria-checked":du(o)?"mixed":o,...l,ref:r,"data-state":dp(o),onSelect:Ee(l.onSelect,()=>a?.(du(o)?!0:!o),{checkForDefaultPrevented:!1})})})});Pw.displayName=H3;var $w="MenuRadioGroup",[B3,U3]=Jo($w,{value:void 0,onValueChange:()=>{}}),Vw=N.forwardRef((e,r)=>{const{value:o,onValueChange:a,...l}=e,u=Tt(a);return i.jsx(B3,{scope:e.__scopeMenu,value:o,onValueChange:u,children:i.jsx(cp,{...l,ref:r})})});Vw.displayName=$w;var qw="MenuRadioItem",Yw=N.forwardRef((e,r)=>{const{value:o,...a}=e,l=U3(qw,e.__scopeMenu),u=o===l.value;return i.jsx(Gw,{scope:e.__scopeMenu,checked:u,children:i.jsx(Bu,{role:"menuitemradio","aria-checked":u,...a,ref:r,"data-state":dp(u),onSelect:Ee(a.onSelect,()=>l.onValueChange?.(o),{checkForDefaultPrevented:!1})})})});Yw.displayName=qw;var up="MenuItemIndicator",[Gw,P3]=Jo(up,{checked:!1}),Xw=N.forwardRef((e,r)=>{const{__scopeMenu:o,forceMount:a,...l}=e,u=P3(up,o);return i.jsx(An,{present:a||du(u.checked)||u.checked===!0,children:i.jsx(ze.span,{...l,ref:r,"data-state":dp(u.checked)})})});Xw.displayName=up;var $3="MenuSeparator",Fw=N.forwardRef((e,r)=>{const{__scopeMenu:o,...a}=e;return i.jsx(ze.div,{role:"separator","aria-orientation":"horizontal",...a,ref:r})});Fw.displayName=$3;var V3="MenuArrow",Zw=N.forwardRef((e,r)=>{const{__scopeMenu:o,...a}=e,l=Hu(o);return i.jsx(pw,{...l,...a,ref:r})});Zw.displayName=V3;var q3="MenuSub",[y7,Kw]=Jo(q3),ji="MenuSubTrigger",Ww=N.forwardRef((e,r)=>{const o=ea(ji,e.__scopeMenu),a=rl(ji,e.__scopeMenu),l=Kw(ji,e.__scopeMenu),u=ip(ji,e.__scopeMenu),d=N.useRef(null),{pointerGraceTimerRef:f,onPointerGraceIntentChange:h}=u,p={__scopeMenu:e.__scopeMenu},g=N.useCallback(()=>{d.current&&window.clearTimeout(d.current),d.current=null},[]);return N.useEffect(()=>g,[g]),N.useEffect(()=>{const y=f.current;return()=>{window.clearTimeout(y),h(null)}},[f,h]),i.jsx(ap,{asChild:!0,...p,children:i.jsx(Uw,{id:l.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":l.contentId,"data-state":e1(o.open),...e,ref:Mu(r,l.onTriggerChange),onClick:y=>{e.onClick?.(y),!(e.disabled||y.defaultPrevented)&&(y.currentTarget.focus(),o.open||o.onOpenChange(!0))},onPointerMove:Ee(e.onPointerMove,Hi(y=>{u.onItemEnter(y),!y.defaultPrevented&&!e.disabled&&!o.open&&!d.current&&(u.onPointerGraceIntentChange(null),d.current=window.setTimeout(()=>{o.onOpenChange(!0),g()},100))})),onPointerLeave:Ee(e.onPointerLeave,Hi(y=>{g();const v=o.content?.getBoundingClientRect();if(v){const b=o.content?.dataset.side,S=b==="right",w=S?-5:5,j=v[S?"left":"right"],k=v[S?"right":"left"];u.onPointerGraceIntentChange({area:[{x:y.clientX+w,y:y.clientY},{x:j,y:v.top},{x:k,y:v.top},{x:k,y:v.bottom},{x:j,y:v.bottom}],side:b}),window.clearTimeout(f.current),f.current=window.setTimeout(()=>u.onPointerGraceIntentChange(null),300)}else{if(u.onTriggerLeave(y),y.defaultPrevented)return;u.onPointerGraceIntentChange(null)}})),onKeyDown:Ee(e.onKeyDown,y=>{const v=u.searchRef.current!=="";e.disabled||v&&y.key===" "||E3[a.dir].includes(y.key)&&(o.onOpenChange(!0),o.content?.focus(),y.preventDefault())})})})});Ww.displayName=ji;var Qw="MenuSubContent",Jw=N.forwardRef((e,r)=>{const o=Lw(gn,e.__scopeMenu),{forceMount:a=o.forceMount,...l}=e,u=ea(gn,e.__scopeMenu),d=rl(gn,e.__scopeMenu),f=Kw(Qw,e.__scopeMenu),h=N.useRef(null),p=Ke(r,h);return i.jsx(Ii.Provider,{scope:e.__scopeMenu,children:i.jsx(An,{present:a||u.open,children:i.jsx(Ii.Slot,{scope:e.__scopeMenu,children:i.jsx(lp,{id:f.contentId,"aria-labelledby":f.triggerId,...l,ref:p,align:"start",side:d.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:g=>{d.isUsingKeyboardRef.current&&h.current?.focus(),g.preventDefault()},onCloseAutoFocus:g=>g.preventDefault(),onFocusOutside:Ee(e.onFocusOutside,g=>{g.target!==f.trigger&&u.onOpenChange(!1)}),onEscapeKeyDown:Ee(e.onEscapeKeyDown,g=>{d.onClose(),g.preventDefault()}),onKeyDown:Ee(e.onKeyDown,g=>{const y=g.currentTarget.contains(g.target),v=_3[d.dir].includes(g.key);y&&v&&(u.onOpenChange(!1),f.trigger?.focus(),g.preventDefault())})})})})})});Jw.displayName=Qw;function e1(e){return e?"open":"closed"}function du(e){return e==="indeterminate"}function dp(e){return du(e)?"indeterminate":e?"checked":"unchecked"}function Y3(e){const r=document.activeElement;for(const o of e)if(o===r||(o.focus(),document.activeElement!==r))return}function G3(e,r){return e.map((o,a)=>e[(r+a)%e.length])}function X3(e,r,o){const l=r.length>1&&Array.from(r).every(p=>p===r[0])?r[0]:r,u=o?e.indexOf(o):-1;let d=G3(e,Math.max(u,0));l.length===1&&(d=d.filter(p=>p!==o));const h=d.find(p=>p.toLowerCase().startsWith(l.toLowerCase()));return h!==o?h:void 0}function F3(e,r){const{x:o,y:a}=e;let l=!1;for(let u=0,d=r.length-1;u<r.length;d=u++){const f=r[u],h=r[d],p=f.x,g=f.y,y=h.x,v=h.y;g>a!=v>a&&o<(y-p)*(a-g)/(v-g)+p&&(l=!l)}return l}function Z3(e,r){if(!r)return!1;const o={x:e.clientX,y:e.clientY};return F3(o,r)}function Hi(e){return r=>r.pointerType==="mouse"?e(r):void 0}var K3=zw,W3=ap,Q3=Iw,J3=Hw,ek=cp,tk=Bw,nk=Bu,rk=Pw,ok=Vw,ak=Yw,sk=Xw,ik=Fw,lk=Zw,ck=Ww,uk=Jw,Uu="DropdownMenu",[dk,b7]=kr(Uu,[Dw]),Ht=Dw(),[fk,t1]=dk(Uu),n1=e=>{const{__scopeDropdownMenu:r,children:o,dir:a,open:l,defaultOpen:u,onOpenChange:d,modal:f=!0}=e,h=Ht(r),p=N.useRef(null),[g,y]=Ja({prop:l,defaultProp:u??!1,onChange:d,caller:Uu});return i.jsx(fk,{scope:r,triggerId:Vo(),triggerRef:p,contentId:Vo(),open:g,onOpenChange:y,onOpenToggle:N.useCallback(()=>y(v=>!v),[y]),modal:f,children:i.jsx(K3,{...h,open:g,onOpenChange:y,dir:a,modal:f,children:o})})};n1.displayName=Uu;var r1="DropdownMenuTrigger",o1=N.forwardRef((e,r)=>{const{__scopeDropdownMenu:o,disabled:a=!1,...l}=e,u=t1(r1,o),d=Ht(o);return i.jsx(W3,{asChild:!0,...d,children:i.jsx(ze.button,{type:"button",id:u.triggerId,"aria-haspopup":"menu","aria-expanded":u.open,"aria-controls":u.open?u.contentId:void 0,"data-state":u.open?"open":"closed","data-disabled":a?"":void 0,disabled:a,...l,ref:Mu(r,u.triggerRef),onPointerDown:Ee(e.onPointerDown,f=>{!a&&f.button===0&&f.ctrlKey===!1&&(u.onOpenToggle(),u.open||f.preventDefault())}),onKeyDown:Ee(e.onKeyDown,f=>{a||(["Enter"," "].includes(f.key)&&u.onOpenToggle(),f.key==="ArrowDown"&&u.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(f.key)&&f.preventDefault())})})})});o1.displayName=r1;var mk="DropdownMenuPortal",a1=e=>{const{__scopeDropdownMenu:r,...o}=e,a=Ht(r);return i.jsx(Q3,{...a,...o})};a1.displayName=mk;var s1="DropdownMenuContent",i1=N.forwardRef((e,r)=>{const{__scopeDropdownMenu:o,...a}=e,l=t1(s1,o),u=Ht(o),d=N.useRef(!1);return i.jsx(J3,{id:l.contentId,"aria-labelledby":l.triggerId,...u,...a,ref:r,onCloseAutoFocus:Ee(e.onCloseAutoFocus,f=>{d.current||l.triggerRef.current?.focus(),d.current=!1,f.preventDefault()}),onInteractOutside:Ee(e.onInteractOutside,f=>{const h=f.detail.originalEvent,p=h.button===0&&h.ctrlKey===!0,g=h.button===2||p;(!l.modal||g)&&(d.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});i1.displayName=s1;var hk="DropdownMenuGroup",pk=N.forwardRef((e,r)=>{const{__scopeDropdownMenu:o,...a}=e,l=Ht(o);return i.jsx(ek,{...l,...a,ref:r})});pk.displayName=hk;var gk="DropdownMenuLabel",l1=N.forwardRef((e,r)=>{const{__scopeDropdownMenu:o,...a}=e,l=Ht(o);return i.jsx(tk,{...l,...a,ref:r})});l1.displayName=gk;var xk="DropdownMenuItem",c1=N.forwardRef((e,r)=>{const{__scopeDropdownMenu:o,...a}=e,l=Ht(o);return i.jsx(nk,{...l,...a,ref:r})});c1.displayName=xk;var vk="DropdownMenuCheckboxItem",yk=N.forwardRef((e,r)=>{const{__scopeDropdownMenu:o,...a}=e,l=Ht(o);return i.jsx(rk,{...l,...a,ref:r})});yk.displayName=vk;var bk="DropdownMenuRadioGroup",wk=N.forwardRef((e,r)=>{const{__scopeDropdownMenu:o,...a}=e,l=Ht(o);return i.jsx(ok,{...l,...a,ref:r})});wk.displayName=bk;var Nk="DropdownMenuRadioItem",Sk=N.forwardRef((e,r)=>{const{__scopeDropdownMenu:o,...a}=e,l=Ht(o);return i.jsx(ak,{...l,...a,ref:r})});Sk.displayName=Nk;var Ek="DropdownMenuItemIndicator",_k=N.forwardRef((e,r)=>{const{__scopeDropdownMenu:o,...a}=e,l=Ht(o);return i.jsx(sk,{...l,...a,ref:r})});_k.displayName=Ek;var jk="DropdownMenuSeparator",u1=N.forwardRef((e,r)=>{const{__scopeDropdownMenu:o,...a}=e,l=Ht(o);return i.jsx(ik,{...l,...a,ref:r})});u1.displayName=jk;var Ck="DropdownMenuArrow",kk=N.forwardRef((e,r)=>{const{__scopeDropdownMenu:o,...a}=e,l=Ht(o);return i.jsx(lk,{...l,...a,ref:r})});kk.displayName=Ck;var Ak="DropdownMenuSubTrigger",Mk=N.forwardRef((e,r)=>{const{__scopeDropdownMenu:o,...a}=e,l=Ht(o);return i.jsx(ck,{...l,...a,ref:r})});Mk.displayName=Ak;var Tk="DropdownMenuSubContent",Rk=N.forwardRef((e,r)=>{const{__scopeDropdownMenu:o,...a}=e,l=Ht(o);return i.jsx(uk,{...l,...a,ref:r,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Rk.displayName=Tk;var Dk=n1,Ok=o1,zk=a1,Lk=i1,Ik=l1,Hk=c1,Bk=u1;/**
90
- * @license lucide-react v0.540.0 - ISC
91
- *
92
- * This source code is licensed under the ISC license.
93
- * See the LICENSE file in the root directory of this source tree.
94
- */const Uk=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Pk=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(r,o,a)=>a?a.toUpperCase():o.toLowerCase()),iy=e=>{const r=Pk(e);return r.charAt(0).toUpperCase()+r.slice(1)},d1=(...e)=>e.filter((r,o,a)=>!!r&&r.trim()!==""&&a.indexOf(r)===o).join(" ").trim(),$k=e=>{for(const r in e)if(r.startsWith("aria-")||r==="role"||r==="title")return!0};/**
95
- * @license lucide-react v0.540.0 - ISC
96
- *
97
- * This source code is licensed under the ISC license.
98
- * See the LICENSE file in the root directory of this source tree.
99
- */var Vk={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"};/**
100
- * @license lucide-react v0.540.0 - ISC
101
- *
102
- * This source code is licensed under the ISC license.
103
- * See the LICENSE file in the root directory of this source tree.
104
- */const qk=N.forwardRef(({color:e="currentColor",size:r=24,strokeWidth:o=2,absoluteStrokeWidth:a,className:l="",children:u,iconNode:d,...f},h)=>N.createElement("svg",{ref:h,...Vk,width:r,height:r,stroke:e,strokeWidth:a?Number(o)*24/Number(r):o,className:d1("lucide",l),...!u&&!$k(f)&&{"aria-hidden":"true"},...f},[...d.map(([p,g])=>N.createElement(p,g)),...Array.isArray(u)?u:[u]]));/**
105
- * @license lucide-react v0.540.0 - ISC
106
- *
107
- * This source code is licensed under the ISC license.
108
- * See the LICENSE file in the root directory of this source tree.
109
- */const _e=(e,r)=>{const o=N.forwardRef(({className:a,...l},u)=>N.createElement(qk,{ref:u,iconNode:r,className:d1(`lucide-${Uk(iy(e))}`,`lucide-${e}`,a),...l}));return o.displayName=iy(e),o};/**
110
- * @license lucide-react v0.540.0 - ISC
111
- *
112
- * This source code is licensed under the ISC license.
113
- * See the LICENSE file in the root directory of this source tree.
114
- */const Yk=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],fp=_e("activity",Yk);/**
115
- * @license lucide-react v0.540.0 - ISC
116
- *
117
- * This source code is licensed under the ISC license.
118
- * See the LICENSE file in the root directory of this source tree.
119
- */const Gk=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],Xk=_e("arrow-down",Gk);/**
120
- * @license lucide-react v0.540.0 - ISC
121
- *
122
- * This source code is licensed under the ISC license.
123
- * See the LICENSE file in the root directory of this source tree.
124
- */const Fk=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],Zk=_e("arrow-left",Fk);/**
125
- * @license lucide-react v0.540.0 - ISC
126
- *
127
- * This source code is licensed under the ISC license.
128
- * See the LICENSE file in the root directory of this source tree.
129
- */const Kk=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],f1=_e("book-open",Kk);/**
130
- * @license lucide-react v0.540.0 - ISC
131
- *
132
- * This source code is licensed under the ISC license.
133
- * See the LICENSE file in the root directory of this source tree.
134
- */const Wk=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],qn=_e("bot",Wk);/**
135
- * @license lucide-react v0.540.0 - ISC
136
- *
137
- * This source code is licensed under the ISC license.
138
- * See the LICENSE file in the root directory of this source tree.
139
- */const Qk=[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]],Jk=_e("check-check",Qk);/**
140
- * @license lucide-react v0.540.0 - ISC
141
- *
142
- * This source code is licensed under the ISC license.
143
- * See the LICENSE file in the root directory of this source tree.
144
- */const eA=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Pu=_e("check",eA);/**
145
- * @license lucide-react v0.540.0 - ISC
146
- *
147
- * This source code is licensed under the ISC license.
148
- * See the LICENSE file in the root directory of this source tree.
149
- */const tA=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],kn=_e("chevron-down",tA);/**
150
- * @license lucide-react v0.540.0 - ISC
151
- *
152
- * This source code is licensed under the ISC license.
153
- * See the LICENSE file in the root directory of this source tree.
154
- */const nA=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],$u=_e("chevron-right",nA);/**
155
- * @license lucide-react v0.540.0 - ISC
156
- *
157
- * This source code is licensed under the ISC license.
158
- * See the LICENSE file in the root directory of this source tree.
159
- */const rA=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],ph=_e("chevron-up",rA);/**
160
- * @license lucide-react v0.540.0 - ISC
161
- *
162
- * This source code is licensed under the ISC license.
163
- * See the LICENSE file in the root directory of this source tree.
164
- */const oA=[["path",{d:"m7 6 5 5 5-5",key:"1lc07p"}],["path",{d:"m7 13 5 5 5-5",key:"1d48rs"}]],aA=_e("chevrons-down",oA);/**
165
- * @license lucide-react v0.540.0 - ISC
166
- *
167
- * This source code is licensed under the ISC license.
168
- * See the LICENSE file in the root directory of this source tree.
169
- */const sA=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],ts=_e("circle-alert",sA);/**
170
- * @license lucide-react v0.540.0 - ISC
171
- *
172
- * This source code is licensed under the ISC license.
173
- * See the LICENSE file in the root directory of this source tree.
174
- */const iA=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],fu=_e("circle-check-big",iA);/**
175
- * @license lucide-react v0.540.0 - ISC
176
- *
177
- * This source code is licensed under the ISC license.
178
- * See the LICENSE file in the root directory of this source tree.
179
- */const lA=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Yt=_e("circle-check",lA);/**
180
- * @license lucide-react v0.540.0 - ISC
181
- *
182
- * This source code is licensed under the ISC license.
183
- * See the LICENSE file in the root directory of this source tree.
184
- */const cA=[["path",{d:"M9 9.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997A1 1 0 0 1 9 14.996z",key:"kmsa83"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],uA=_e("circle-play",cA);/**
185
- * @license lucide-react v0.540.0 - ISC
186
- *
187
- * This source code is licensed under the ISC license.
188
- * See the LICENSE file in the root directory of this source tree.
189
- */const dA=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],Vu=_e("circle-x",dA);/**
190
- * @license lucide-react v0.540.0 - ISC
191
- *
192
- * This source code is licensed under the ISC license.
193
- * See the LICENSE file in the root directory of this source tree.
194
- */const fA=[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]],mA=_e("cloud",fA);/**
195
- * @license lucide-react v0.540.0 - ISC
196
- *
197
- * This source code is licensed under the ISC license.
198
- * See the LICENSE file in the root directory of this source tree.
199
- */const hA=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],m1=_e("code",hA);/**
200
- * @license lucide-react v0.540.0 - ISC
201
- *
202
- * This source code is licensed under the ISC license.
203
- * See the LICENSE file in the root directory of this source tree.
204
- */const pA=[["path",{d:"M22 7.7c0-.6-.4-1.2-.8-1.5l-6.3-3.9a1.72 1.72 0 0 0-1.7 0l-10.3 6c-.5.2-.9.8-.9 1.4v6.6c0 .5.4 1.2.8 1.5l6.3 3.9a1.72 1.72 0 0 0 1.7 0l10.3-6c.5-.3.9-1 .9-1.5Z",key:"1t2lqe"}],["path",{d:"M10 21.9V14L2.1 9.1",key:"o7czzq"}],["path",{d:"m10 14 11.9-6.9",key:"zm5e20"}],["path",{d:"M14 19.8v-8.1",key:"159ecu"}],["path",{d:"M18 17.5V9.4",key:"11uown"}]],gA=_e("container",pA);/**
205
- * @license lucide-react v0.540.0 - ISC
206
- *
207
- * This source code is licensed under the ISC license.
208
- * See the LICENSE file in the root directory of this source tree.
209
- */const xA=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Ti=_e("copy",xA);/**
210
- * @license lucide-react v0.540.0 - ISC
211
- *
212
- * This source code is licensed under the ISC license.
213
- * See the LICENSE file in the root directory of this source tree.
214
- */const vA=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],gh=_e("database",vA);/**
215
- * @license lucide-react v0.540.0 - ISC
216
- *
217
- * This source code is licensed under the ISC license.
218
- * See the LICENSE file in the root directory of this source tree.
219
- */const yA=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],mu=_e("download",yA);/**
220
- * @license lucide-react v0.540.0 - ISC
221
- *
222
- * This source code is licensed under the ISC license.
223
- * See the LICENSE file in the root directory of this source tree.
224
- */const bA=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]],wA=_e("ellipsis-vertical",bA);/**
225
- * @license lucide-react v0.540.0 - ISC
226
- *
227
- * This source code is licensed under the ISC license.
228
- * See the LICENSE file in the root directory of this source tree.
229
- */const NA=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],mp=_e("external-link",NA);/**
230
- * @license lucide-react v0.540.0 - ISC
231
- *
232
- * This source code is licensed under the ISC license.
233
- * See the LICENSE file in the root directory of this source tree.
234
- */const SA=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],Yo=_e("file-text",SA);/**
235
- * @license lucide-react v0.540.0 - ISC
236
- *
237
- * This source code is licensed under the ISC license.
238
- * See the LICENSE file in the root directory of this source tree.
239
- */const EA=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],h1=_e("folder-open",EA);/**
240
- * @license lucide-react v0.540.0 - ISC
241
- *
242
- * This source code is licensed under the ISC license.
243
- * See the LICENSE file in the root directory of this source tree.
244
- */const _A=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],p1=_e("globe",_A);/**
245
- * @license lucide-react v0.540.0 - ISC
246
- *
247
- * This source code is licensed under the ISC license.
248
- * See the LICENSE file in the root directory of this source tree.
249
- */const jA=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]],CA=_e("grid-3x3",jA);/**
250
- * @license lucide-react v0.540.0 - ISC
251
- *
252
- * This source code is licensed under the ISC license.
253
- * See the LICENSE file in the root directory of this source tree.
254
- */const kA=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]],AA=_e("house",kA);/**
255
- * @license lucide-react v0.540.0 - ISC
256
- *
257
- * This source code is licensed under the ISC license.
258
- * See the LICENSE file in the root directory of this source tree.
259
- */const MA=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],TA=_e("image",MA);/**
260
- * @license lucide-react v0.540.0 - ISC
261
- *
262
- * This source code is licensed under the ISC license.
263
- * See the LICENSE file in the root directory of this source tree.
264
- */const RA=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],hu=_e("info",RA);/**
265
- * @license lucide-react v0.540.0 - ISC
266
- *
267
- * This source code is licensed under the ISC license.
268
- * See the LICENSE file in the root directory of this source tree.
269
- */const DA=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],OA=_e("key",DA);/**
270
- * @license lucide-react v0.540.0 - ISC
271
- *
272
- * This source code is licensed under the ISC license.
273
- * See the LICENSE file in the root directory of this source tree.
274
- */const zA=[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]],LA=_e("lightbulb",zA);/**
275
- * @license lucide-react v0.540.0 - ISC
276
- *
277
- * This source code is licensed under the ISC license.
278
- * See the LICENSE file in the root directory of this source tree.
279
- */const IA=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],qu=_e("loader-circle",IA);/**
280
- * @license lucide-react v0.540.0 - ISC
281
- *
282
- * This source code is licensed under the ISC license.
283
- * See the LICENSE file in the root directory of this source tree.
284
- */const HA=[["path",{d:"M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z",key:"169xi5"}],["path",{d:"M15 5.764v15",key:"1pn4in"}],["path",{d:"M9 3.236v15",key:"1uimfh"}]],BA=_e("map",HA);/**
285
- * @license lucide-react v0.540.0 - ISC
286
- *
287
- * This source code is licensed under the ISC license.
288
- * See the LICENSE file in the root directory of this source tree.
289
- */const UA=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]],ly=_e("maximize-2",UA);/**
290
- * @license lucide-react v0.540.0 - ISC
291
- *
292
- * This source code is licensed under the ISC license.
293
- * See the LICENSE file in the root directory of this source tree.
294
- */const PA=[["path",{d:"M8 3H5a2 2 0 0 0-2 2v3",key:"1dcmit"}],["path",{d:"M21 8V5a2 2 0 0 0-2-2h-3",key:"1e4gt3"}],["path",{d:"M3 16v3a2 2 0 0 0 2 2h3",key:"wsl5sc"}],["path",{d:"M16 21h3a2 2 0 0 0 2-2v-3",key:"18trek"}]],$A=_e("maximize",PA);/**
295
- * @license lucide-react v0.540.0 - ISC
296
- *
297
- * This source code is licensed under the ISC license.
298
- * See the LICENSE file in the root directory of this source tree.
299
- */const VA=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],g1=_e("message-square",VA);/**
300
- * @license lucide-react v0.540.0 - ISC
301
- *
302
- * This source code is licensed under the ISC license.
303
- * See the LICENSE file in the root directory of this source tree.
304
- */const qA=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],YA=_e("moon",qA);/**
305
- * @license lucide-react v0.540.0 - ISC
306
- *
307
- * This source code is licensed under the ISC license.
308
- * See the LICENSE file in the root directory of this source tree.
309
- */const GA=[["path",{d:"M9 18V5l12-2v13",key:"1jmyc2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["circle",{cx:"18",cy:"16",r:"3",key:"1hluhg"}]],x1=_e("music",GA);/**
310
- * @license lucide-react v0.540.0 - ISC
311
- *
312
- * This source code is licensed under the ISC license.
313
- * See the LICENSE file in the root directory of this source tree.
314
- */const XA=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],xh=_e("package",XA);/**
315
- * @license lucide-react v0.540.0 - ISC
316
- *
317
- * This source code is licensed under the ISC license.
318
- * See the LICENSE file in the root directory of this source tree.
319
- */const FA=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"m8 9 3 3-3 3",key:"12hl5m"}]],ZA=_e("panel-right-close",FA);/**
320
- * @license lucide-react v0.540.0 - ISC
321
- *
322
- * This source code is licensed under the ISC license.
323
- * See the LICENSE file in the root directory of this source tree.
324
- */const KA=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"m10 15-3-3 3-3",key:"1pgupc"}]],WA=_e("panel-right-open",KA);/**
325
- * @license lucide-react v0.540.0 - ISC
326
- *
327
- * This source code is licensed under the ISC license.
328
- * See the LICENSE file in the root directory of this source tree.
329
- */const QA=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],JA=_e("paperclip",QA);/**
330
- * @license lucide-react v0.540.0 - ISC
331
- *
332
- * This source code is licensed under the ISC license.
333
- * See the LICENSE file in the root directory of this source tree.
334
- */const eM=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],tM=_e("play",eM);/**
335
- * @license lucide-react v0.540.0 - ISC
336
- *
337
- * This source code is licensed under the ISC license.
338
- * See the LICENSE file in the root directory of this source tree.
339
- */const nM=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],v1=_e("plus",nM);/**
340
- * @license lucide-react v0.540.0 - ISC
341
- *
342
- * This source code is licensed under the ISC license.
343
- * See the LICENSE file in the root directory of this source tree.
344
- */const rM=[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]],y1=_e("rocket",rM);/**
345
- * @license lucide-react v0.540.0 - ISC
346
- *
347
- * This source code is licensed under the ISC license.
348
- * See the LICENSE file in the root directory of this source tree.
349
- */const oM=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],hp=_e("rotate-ccw",oM);/**
350
- * @license lucide-react v0.540.0 - ISC
351
- *
352
- * This source code is licensed under the ISC license.
353
- * See the LICENSE file in the root directory of this source tree.
354
- */const aM=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Bi=_e("search",aM);/**
355
- * @license lucide-react v0.540.0 - ISC
356
- *
357
- * This source code is licensed under the ISC license.
358
- * See the LICENSE file in the root directory of this source tree.
359
- */const sM=[["path",{d:"M3.714 3.048a.498.498 0 0 0-.683.627l2.843 7.627a2 2 0 0 1 0 1.396l-2.842 7.627a.498.498 0 0 0 .682.627l18-8.5a.5.5 0 0 0 0-.904z",key:"117uat"}],["path",{d:"M6 12h16",key:"s4cdu5"}]],iM=_e("send-horizontal",sM);/**
360
- * @license lucide-react v0.540.0 - ISC
361
- *
362
- * This source code is licensed under the ISC license.
363
- * See the LICENSE file in the root directory of this source tree.
364
- */const lM=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],$m=_e("send",lM);/**
365
- * @license lucide-react v0.540.0 - ISC
366
- *
367
- * This source code is licensed under the ISC license.
368
- * See the LICENSE file in the root directory of this source tree.
369
- */const cM=[["path",{d:"M7 2h13a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-5",key:"bt2siv"}],["path",{d:"M10 10 2.5 2.5C2 2 2 2.5 2 5v3a2 2 0 0 0 2 2h6z",key:"1hjrv1"}],["path",{d:"M22 17v-1a2 2 0 0 0-2-2h-1",key:"1iynyr"}],["path",{d:"M4 14a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h16.5l1-.5.5.5-8-8H4z",key:"161ggg"}],["path",{d:"M6 18h.01",key:"uhywen"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],uM=_e("server-off",cM);/**
370
- * @license lucide-react v0.540.0 - ISC
371
- *
372
- * This source code is licensed under the ISC license.
373
- * See the LICENSE file in the root directory of this source tree.
374
- */const dM=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],vh=_e("settings",dM);/**
375
- * @license lucide-react v0.540.0 - ISC
376
- *
377
- * This source code is licensed under the ISC license.
378
- * See the LICENSE file in the root directory of this source tree.
379
- */const fM=[["path",{d:"m18 14 4 4-4 4",key:"10pe0f"}],["path",{d:"m18 2 4 4-4 4",key:"pucp1d"}],["path",{d:"M2 18h1.973a4 4 0 0 0 3.3-1.7l5.454-8.6a4 4 0 0 1 3.3-1.7H22",key:"1ailkh"}],["path",{d:"M2 6h1.972a4 4 0 0 1 3.6 2.2",key:"km57vx"}],["path",{d:"M22 18h-6.041a4 4 0 0 1-3.3-1.8l-.359-.45",key:"os18l9"}]],mM=_e("shuffle",fM);/**
380
- * @license lucide-react v0.540.0 - ISC
381
- *
382
- * This source code is licensed under the ISC license.
383
- * See the LICENSE file in the root directory of this source tree.
384
- */const hM=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],pM=_e("sun",hM);/**
385
- * @license lucide-react v0.540.0 - ISC
386
- *
387
- * This source code is licensed under the ISC license.
388
- * See the LICENSE file in the root directory of this source tree.
389
- */const gM=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],b1=_e("trash-2",gM);/**
390
- * @license lucide-react v0.540.0 - ISC
391
- *
392
- * This source code is licensed under the ISC license.
393
- * See the LICENSE file in the root directory of this source tree.
394
- */const xM=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],vM=_e("triangle-alert",xM);/**
395
- * @license lucide-react v0.540.0 - ISC
396
- *
397
- * This source code is licensed under the ISC license.
398
- * See the LICENSE file in the root directory of this source tree.
399
- */const yM=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],bM=_e("upload",yM);/**
400
- * @license lucide-react v0.540.0 - ISC
401
- *
402
- * This source code is licensed under the ISC license.
403
- * See the LICENSE file in the root directory of this source tree.
404
- */const wM=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],w1=_e("user",wM);/**
405
- * @license lucide-react v0.540.0 - ISC
406
- *
407
- * This source code is licensed under the ISC license.
408
- * See the LICENSE file in the root directory of this source tree.
409
- */const NM=[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]],Go=_e("workflow",NM);/**
410
- * @license lucide-react v0.540.0 - ISC
411
- *
412
- * This source code is licensed under the ISC license.
413
- * See the LICENSE file in the root directory of this source tree.
414
- */const SM=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],Yu=_e("wrench",SM);/**
415
- * @license lucide-react v0.540.0 - ISC
416
- *
417
- * This source code is licensed under the ISC license.
418
- * See the LICENSE file in the root directory of this source tree.
419
- */const EM=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],pp=_e("x",EM);/**
420
- * @license lucide-react v0.540.0 - ISC
421
- *
422
- * This source code is licensed under the ISC license.
423
- * See the LICENSE file in the root directory of this source tree.
424
- */const _M=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],N1=_e("zap",_M);function gp({...e}){return i.jsx(Dk,{"data-slot":"dropdown-menu",...e})}function xp({...e}){return i.jsx(Ok,{"data-slot":"dropdown-menu-trigger",...e})}function vp({className:e,sideOffset:r=4,...o}){return i.jsx(zk,{children:i.jsx(Lk,{"data-slot":"dropdown-menu-content",sideOffset:r,className:qe("bg-popover text-popover-foreground 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 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",e),...o})})}function Gt({className:e,inset:r,variant:o="default",...a}){return i.jsx(Hk,{"data-slot":"dropdown-menu-item","data-inset":r,"data-variant":o,className:qe("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...a})}function cy({className:e,inset:r,...o}){return i.jsx(Ik,{"data-slot":"dropdown-menu-label","data-inset":r,className:qe("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",e),...o})}function pu({className:e,...r}){return i.jsx(Bk,{"data-slot":"dropdown-menu-separator",className:qe("bg-border -mx-1 my-1 h-px",e),...r})}function yp({size:e="md",className:r}){return i.jsx(qu,{className:qe("animate-spin",{"h-4 w-4":e==="sm","h-6 w-6":e==="md","h-8 w-8":e==="lg"},r)})}const jM=e=>e==="workflow"?Go:qn;function CM({agents:e,workflows:r,selectedItem:o,onSelect:a,onBrowseGallery:l,isLoading:u=!1}){const[d,f]=N.useState(!1),h=[...e,...r].sort((b,S)=>b.name?.localeCompare(S.name||b.id)||b.id.localeCompare(S.id)),p=b=>{a(b),f(!1)},g=o?jM(o.type):qn,y=o?.name||o?.id||"Select Agent or Workflow",v=o?.metadata?.lazy_loaded!==!1;return i.jsxs(gp,{open:d,onOpenChange:f,children:[i.jsx(xp,{asChild:!0,children:i.jsx(Oe,{variant:"outline",className:"w-64 justify-between font-mono text-sm",disabled:u,children:u?i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(yp,{size:"sm"}),i.jsx("span",{className:"text-muted-foreground",children:"Loading..."})]}):i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[i.jsx(g,{className:"h-4 w-4 flex-shrink-0"}),i.jsx("span",{className:"truncate",children:y}),o&&!v&&i.jsx(qu,{className:"h-3 w-3 text-muted-foreground animate-spin ml-auto flex-shrink-0"})]}),i.jsx(kn,{className:"h-4 w-4 opacity-50"})]})})}),i.jsxs(vp,{className:"w-80 font-mono",children:[e.length>0&&i.jsxs(i.Fragment,{children:[i.jsxs(cy,{className:"flex items-center gap-2",children:[i.jsx(qn,{className:"h-4 w-4"}),"Agents (",e.length,")"]}),e.map(b=>{const S=b.metadata?.lazy_loaded!==!1;return i.jsx(Gt,{className:"cursor-pointer group",children:i.jsx("div",{className:"flex items-center justify-between w-full gap-2",children:i.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-1",onClick:()=>p(b),children:[i.jsx(qn,{className:"h-4 w-4 flex-shrink-0"}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsx("span",{className:"truncate font-medium block",children:b.name||b.id}),S&&b.description&&i.jsx("div",{className:"text-xs text-muted-foreground line-clamp-2",children:b.description})]})]})})},b.id)})]}),r.length>0&&i.jsxs(i.Fragment,{children:[e.length>0&&i.jsx(pu,{}),i.jsxs(cy,{className:"flex items-center gap-2",children:[i.jsx(Go,{className:"h-4 w-4"}),"Workflows (",r.length,")"]}),r.map(b=>{const S=b.metadata?.lazy_loaded!==!1;return i.jsx(Gt,{className:"cursor-pointer group",children:i.jsx("div",{className:"flex items-center justify-between w-full gap-2",children:i.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-1",onClick:()=>p(b),children:[i.jsx(Go,{className:"h-4 w-4 flex-shrink-0"}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsx("span",{className:"truncate font-medium block",children:b.name||b.id}),S&&b.description&&i.jsx("div",{className:"text-xs text-muted-foreground line-clamp-2",children:b.description})]})]})})},b.id)})]}),h.length===0&&i.jsx(Gt,{disabled:!0,children:i.jsx("div",{className:"text-center text-muted-foreground py-2",children:u?"Loading agents and workflows...":"No agents or workflows found"})}),i.jsx(pu,{}),i.jsxs(Gt,{className:"cursor-pointer text-primary",onClick:()=>{l?.(),f(!1)},children:[i.jsx(v1,{className:"h-4 w-4 mr-2"}),"Browse Gallery"]})]})]})}var kM=(e,r,o,a,l,u,d,f)=>{let h=document.documentElement,p=["light","dark"];function g(b){(Array.isArray(e)?e:[e]).forEach(S=>{let w=S==="class",j=w&&u?l.map(k=>u[k]||k):l;w?(h.classList.remove(...j),h.classList.add(u&&u[b]?u[b]:b)):h.setAttribute(S,b)}),y(b)}function y(b){f&&p.includes(b)&&(h.style.colorScheme=b)}function v(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(a)g(a);else try{let b=localStorage.getItem(r)||o,S=d&&b==="system"?v():b;g(S)}catch{}},uy=["light","dark"],S1="(prefers-color-scheme: dark)",AM=typeof window>"u",bp=N.createContext(void 0),MM={setTheme:e=>{},themes:[]},TM=()=>{var e;return(e=N.useContext(bp))!=null?e:MM},RM=e=>N.useContext(bp)?N.createElement(N.Fragment,null,e.children):N.createElement(OM,{...e}),DM=["light","dark"],OM=({forcedTheme:e,disableTransitionOnChange:r=!1,enableSystem:o=!0,enableColorScheme:a=!0,storageKey:l="theme",themes:u=DM,defaultTheme:d=o?"system":"light",attribute:f="data-theme",value:h,children:p,nonce:g,scriptProps:y})=>{let[v,b]=N.useState(()=>LM(l,d)),[S,w]=N.useState(()=>v==="system"?Vm():v),j=h?Object.values(h):u,k=N.useCallback(D=>{let L=D;if(!L)return;D==="system"&&o&&(L=Vm());let H=h?h[L]:L,B=r?IM(g):null,q=document.documentElement,Z=K=>{K==="class"?(q.classList.remove(...j),H&&q.classList.add(H)):K.startsWith("data-")&&(H?q.setAttribute(K,H):q.removeAttribute(K))};if(Array.isArray(f)?f.forEach(Z):Z(f),a){let K=uy.includes(d)?d:null,G=uy.includes(L)?L:K;q.style.colorScheme=G}B?.()},[g]),M=N.useCallback(D=>{let L=typeof D=="function"?D(v):D;b(L);try{localStorage.setItem(l,L)}catch{}},[v]),_=N.useCallback(D=>{let L=Vm(D);w(L),v==="system"&&o&&!e&&k("system")},[v,e]);N.useEffect(()=>{let D=window.matchMedia(S1);return D.addListener(_),_(D),()=>D.removeListener(_)},[_]),N.useEffect(()=>{let D=L=>{L.key===l&&(L.newValue?b(L.newValue):M(d))};return window.addEventListener("storage",D),()=>window.removeEventListener("storage",D)},[M]),N.useEffect(()=>{k(e??v)},[e,v]);let A=N.useMemo(()=>({theme:v,setTheme:M,forcedTheme:e,resolvedTheme:v==="system"?S:v,themes:o?[...u,"system"]:u,systemTheme:o?S:void 0}),[v,M,e,S,o,u]);return N.createElement(bp.Provider,{value:A},N.createElement(zM,{forcedTheme:e,storageKey:l,attribute:f,enableSystem:o,enableColorScheme:a,defaultTheme:d,value:h,themes:u,nonce:g,scriptProps:y}),p)},zM=N.memo(({forcedTheme:e,storageKey:r,attribute:o,enableSystem:a,enableColorScheme:l,defaultTheme:u,value:d,themes:f,nonce:h,scriptProps:p})=>{let g=JSON.stringify([o,r,u,e,f,d,a,l]).slice(1,-1);return N.createElement("script",{...p,suppressHydrationWarning:!0,nonce:typeof window>"u"?h:"",dangerouslySetInnerHTML:{__html:`(${kM.toString()})(${g})`}})}),LM=(e,r)=>{if(AM)return;let o;try{o=localStorage.getItem(e)||void 0}catch{}return o||r},IM=e=>{let r=document.createElement("style");return e&&r.setAttribute("nonce",e),r.appendChild(document.createTextNode("*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(r),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(r)},1)}},Vm=e=>(e||(e=window.matchMedia(S1)),e.matches?"dark":"light");function HM(){const{setTheme:e}=TM();return i.jsxs(gp,{children:[i.jsx(xp,{asChild:!0,children:i.jsxs(Oe,{variant:"ghost",size:"sm",children:[i.jsx(pM,{className:"h-[1.2rem] w-[1.2rem] rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),i.jsx(YA,{className:"absolute h-[1.2rem] w-[1.2rem] rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),i.jsx("span",{className:"sr-only",children:"Toggle theme"})]})}),i.jsxs(vp,{align:"end",children:[i.jsx(Gt,{onClick:()=>e("light"),children:"Light"}),i.jsx(Gt,{onClick:()=>e("dark"),children:"Dark"}),i.jsx(Gt,{onClick:()=>e("system"),children:"System"})]})]})}function dy({agents:e,workflows:r,selectedItem:o,onSelect:a,onBrowseGallery:l,isLoading:u=!1,onSettingsClick:d}){return i.jsxs("header",{className:"flex h-14 items-center gap-4 border-b px-4",children:[i.jsxs("div",{className:"flex items-center gap-2 font-semibold",children:[i.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 805 805",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"flex-shrink-0",children:[i.jsx("path",{d:"M402.488 119.713C439.197 119.713 468.955 149.472 468.955 186.18C468.955 192.086 471.708 197.849 476.915 200.635L546.702 237.977C555.862 242.879 566.95 240.96 576.092 236.023C585.476 230.955 596.218 228.078 607.632 228.078C644.341 228.078 674.098 257.836 674.099 294.545C674.099 316.95 663.013 336.765 646.028 348.806C637.861 354.595 631.412 363.24 631.412 373.251V430.818C631.412 440.83 637.861 449.475 646.028 455.264C663.013 467.305 674.099 487.121 674.099 509.526C674.099 546.235 644.341 575.994 607.632 575.994C598.598 575.994 589.985 574.191 582.133 570.926C573.644 567.397 563.91 566.393 555.804 570.731L469.581 616.867C469.193 617.074 468.955 617.479 468.955 617.919C468.955 654.628 439.197 684.386 402.488 684.386C365.779 684.386 336.021 654.628 336.021 617.919C336.021 616.802 335.423 615.765 334.439 615.238L249.895 570C241.61 565.567 231.646 566.713 223.034 570.472C214.898 574.024 205.914 575.994 196.47 575.994C159.761 575.994 130.002 546.235 130.002 509.526C130.002 486.66 141.549 466.49 159.13 454.531C167.604 448.766 174.349 439.975 174.349 429.726V372.538C174.349 362.289 167.604 353.498 159.13 347.734C141.549 335.774 130.002 315.604 130.002 292.738C130.002 256.029 159.761 226.271 196.47 226.271C208.223 226.271 219.263 229.322 228.843 234.674C238.065 239.827 249.351 241.894 258.666 236.91L328.655 199.459C333.448 196.895 336.021 191.616 336.021 186.18C336.021 149.471 365.779 119.713 402.488 119.713ZM475.716 394.444C471.337 396.787 468.955 401.586 468.955 406.552C468.955 429.68 457.142 450.048 439.221 461.954C430.571 467.7 423.653 476.574 423.653 486.959V537.511C423.653 547.896 430.746 556.851 439.379 562.622C449 569.053 461.434 572.052 471.637 566.592L527.264 536.826C536.887 531.677 541.164 520.44 541.164 509.526C541.164 485.968 553.42 465.272 571.904 453.468C580.846 447.757 588.054 438.749 588.054 428.139V371.427C588.054 363.494 582.671 356.676 575.716 352.862C569.342 349.366 561.663 348.454 555.253 351.884L475.716 394.444ZM247.992 349.841C241.997 346.633 234.806 347.465 228.873 350.785C222.524 354.337 217.706 360.639 217.706 367.915V429.162C217.706 439.537 224.611 448.404 233.248 454.152C251.144 466.062 262.937 486.417 262.937 509.526C262.937 519.654 267.026 529.991 275.955 534.769L334.852 566.284C344.582 571.49 356.362 568.81 365.528 562.667C373.735 557.166 380.296 548.643 380.296 538.764V486.305C380.296 476.067 373.564 467.282 365.103 461.516C347.548 449.552 336.021 429.398 336.021 406.552C336.021 400.967 333.389 395.536 328.465 392.902L247.992 349.841ZM270.019 280.008C265.421 282.469 262.936 287.522 262.937 292.738C262.937 293.308 262.929 293.876 262.915 294.443C262.615 306.354 266.961 318.871 277.466 324.492L334.017 354.751C344.13 360.163 356.442 357.269 366.027 350.969C376.495 344.088 389.024 340.085 402.488 340.085C416.203 340.085 428.947 344.239 439.532 351.357C449.163 357.834 461.63 360.861 471.864 355.385L526.625 326.083C537.106 320.474 541.458 307.999 541.182 296.115C541.17 295.593 541.164 295.069 541.164 294.545C541.164 288.551 538.376 282.696 533.091 279.868L463.562 242.664C454.384 237.753 443.274 239.688 434.123 244.65C424.716 249.75 413.941 252.647 402.488 252.647C390.83 252.647 379.873 249.646 370.348 244.373C361.148 239.281 349.917 237.256 340.646 242.217L270.019 280.008Z",fill:"url(#paint0_linear_510_1294)"}),i.jsx("defs",{children:i.jsxs("linearGradient",{id:"paint0_linear_510_1294",x1:"255.628",y1:"-34.3245",x2:"618.483",y2:"632.032",gradientUnits:"userSpaceOnUse",children:[i.jsx("stop",{stopColor:"#D59FFF"}),i.jsx("stop",{offset:"1",stopColor:"#8562C5"})]})})]}),"Dev UI"]}),i.jsx(CM,{agents:e,workflows:r,selectedItem:o,onSelect:a,onBrowseGallery:l,isLoading:u}),i.jsxs("div",{className:"flex items-center gap-2 ml-auto",children:[i.jsx(HM,{}),i.jsx(Oe,{variant:"ghost",size:"sm",onClick:f=>{f.stopPropagation(),d?.()},children:i.jsx(vh,{className:"h-4 w-4"})})]})]})}function yh(e,[r,o]){return Math.min(o,Math.max(r,e))}function BM(e,r){return N.useReducer((o,a)=>r[o][a]??o,e)}var wp="ScrollArea",[E1,w7]=kr(wp),[UM,xn]=E1(wp),_1=N.forwardRef((e,r)=>{const{__scopeScrollArea:o,type:a="hover",dir:l,scrollHideDelay:u=600,...d}=e,[f,h]=N.useState(null),[p,g]=N.useState(null),[y,v]=N.useState(null),[b,S]=N.useState(null),[w,j]=N.useState(null),[k,M]=N.useState(0),[_,A]=N.useState(0),[D,L]=N.useState(!1),[H,B]=N.useState(!1),q=Ke(r,K=>h(K)),Z=Ji(l);return i.jsx(UM,{scope:o,type:a,dir:Z,scrollHideDelay:u,scrollArea:f,viewport:p,onViewportChange:g,content:y,onContentChange:v,scrollbarX:b,onScrollbarXChange:S,scrollbarXEnabled:D,onScrollbarXEnabledChange:L,scrollbarY:w,onScrollbarYChange:j,scrollbarYEnabled:H,onScrollbarYEnabledChange:B,onCornerWidthChange:M,onCornerHeightChange:A,children:i.jsx(ze.div,{dir:Z,...d,ref:q,style:{position:"relative","--radix-scroll-area-corner-width":k+"px","--radix-scroll-area-corner-height":_+"px",...e.style}})})});_1.displayName=wp;var j1="ScrollAreaViewport",C1=N.forwardRef((e,r)=>{const{__scopeScrollArea:o,children:a,nonce:l,...u}=e,d=xn(j1,o),f=N.useRef(null),h=Ke(r,f,d.onViewportChange);return i.jsxs(i.Fragment,{children:[i.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:l}),i.jsx(ze.div,{"data-radix-scroll-area-viewport":"",...u,ref:h,style:{overflowX:d.scrollbarXEnabled?"scroll":"hidden",overflowY:d.scrollbarYEnabled?"scroll":"hidden",...e.style},children:i.jsx("div",{ref:d.onContentChange,style:{minWidth:"100%",display:"table"},children:a})})]})});C1.displayName=j1;var Zn="ScrollAreaScrollbar",Np=N.forwardRef((e,r)=>{const{forceMount:o,...a}=e,l=xn(Zn,e.__scopeScrollArea),{onScrollbarXEnabledChange:u,onScrollbarYEnabledChange:d}=l,f=e.orientation==="horizontal";return N.useEffect(()=>(f?u(!0):d(!0),()=>{f?u(!1):d(!1)}),[f,u,d]),l.type==="hover"?i.jsx(PM,{...a,ref:r,forceMount:o}):l.type==="scroll"?i.jsx($M,{...a,ref:r,forceMount:o}):l.type==="auto"?i.jsx(k1,{...a,ref:r,forceMount:o}):l.type==="always"?i.jsx(Sp,{...a,ref:r}):null});Np.displayName=Zn;var PM=N.forwardRef((e,r)=>{const{forceMount:o,...a}=e,l=xn(Zn,e.__scopeScrollArea),[u,d]=N.useState(!1);return N.useEffect(()=>{const f=l.scrollArea;let h=0;if(f){const p=()=>{window.clearTimeout(h),d(!0)},g=()=>{h=window.setTimeout(()=>d(!1),l.scrollHideDelay)};return f.addEventListener("pointerenter",p),f.addEventListener("pointerleave",g),()=>{window.clearTimeout(h),f.removeEventListener("pointerenter",p),f.removeEventListener("pointerleave",g)}}},[l.scrollArea,l.scrollHideDelay]),i.jsx(An,{present:o||u,children:i.jsx(k1,{"data-state":u?"visible":"hidden",...a,ref:r})})}),$M=N.forwardRef((e,r)=>{const{forceMount:o,...a}=e,l=xn(Zn,e.__scopeScrollArea),u=e.orientation==="horizontal",d=Xu(()=>h("SCROLL_END"),100),[f,h]=BM("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return N.useEffect(()=>{if(f==="idle"){const p=window.setTimeout(()=>h("HIDE"),l.scrollHideDelay);return()=>window.clearTimeout(p)}},[f,l.scrollHideDelay,h]),N.useEffect(()=>{const p=l.viewport,g=u?"scrollLeft":"scrollTop";if(p){let y=p[g];const v=()=>{const b=p[g];y!==b&&(h("SCROLL"),d()),y=b};return p.addEventListener("scroll",v),()=>p.removeEventListener("scroll",v)}},[l.viewport,u,h,d]),i.jsx(An,{present:o||f!=="hidden",children:i.jsx(Sp,{"data-state":f==="hidden"?"hidden":"visible",...a,ref:r,onPointerEnter:Ee(e.onPointerEnter,()=>h("POINTER_ENTER")),onPointerLeave:Ee(e.onPointerLeave,()=>h("POINTER_LEAVE"))})})}),k1=N.forwardRef((e,r)=>{const o=xn(Zn,e.__scopeScrollArea),{forceMount:a,...l}=e,[u,d]=N.useState(!1),f=e.orientation==="horizontal",h=Xu(()=>{if(o.viewport){const p=o.viewport.offsetWidth<o.viewport.scrollWidth,g=o.viewport.offsetHeight<o.viewport.scrollHeight;d(f?p:g)}},10);return ns(o.viewport,h),ns(o.content,h),i.jsx(An,{present:a||u,children:i.jsx(Sp,{"data-state":u?"visible":"hidden",...l,ref:r})})}),Sp=N.forwardRef((e,r)=>{const{orientation:o="vertical",...a}=e,l=xn(Zn,e.__scopeScrollArea),u=N.useRef(null),d=N.useRef(0),[f,h]=N.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),p=D1(f.viewport,f.content),g={...a,sizes:f,onSizesChange:h,hasThumb:p>0&&p<1,onThumbChange:v=>u.current=v,onThumbPointerUp:()=>d.current=0,onThumbPointerDown:v=>d.current=v};function y(v,b){return FM(v,d.current,f,b)}return o==="horizontal"?i.jsx(VM,{...g,ref:r,onThumbPositionChange:()=>{if(l.viewport&&u.current){const v=l.viewport.scrollLeft,b=fy(v,f,l.dir);u.current.style.transform=`translate3d(${b}px, 0, 0)`}},onWheelScroll:v=>{l.viewport&&(l.viewport.scrollLeft=v)},onDragScroll:v=>{l.viewport&&(l.viewport.scrollLeft=y(v,l.dir))}}):o==="vertical"?i.jsx(qM,{...g,ref:r,onThumbPositionChange:()=>{if(l.viewport&&u.current){const v=l.viewport.scrollTop,b=fy(v,f);u.current.style.transform=`translate3d(0, ${b}px, 0)`}},onWheelScroll:v=>{l.viewport&&(l.viewport.scrollTop=v)},onDragScroll:v=>{l.viewport&&(l.viewport.scrollTop=y(v))}}):null}),VM=N.forwardRef((e,r)=>{const{sizes:o,onSizesChange:a,...l}=e,u=xn(Zn,e.__scopeScrollArea),[d,f]=N.useState(),h=N.useRef(null),p=Ke(r,h,u.onScrollbarXChange);return N.useEffect(()=>{h.current&&f(getComputedStyle(h.current))},[h]),i.jsx(M1,{"data-orientation":"horizontal",...l,ref:p,sizes:o,style:{bottom:0,left:u.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:u.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Gu(o)+"px",...e.style},onThumbPointerDown:g=>e.onThumbPointerDown(g.x),onDragScroll:g=>e.onDragScroll(g.x),onWheelScroll:(g,y)=>{if(u.viewport){const v=u.viewport.scrollLeft+g.deltaX;e.onWheelScroll(v),z1(v,y)&&g.preventDefault()}},onResize:()=>{h.current&&u.viewport&&d&&a({content:u.viewport.scrollWidth,viewport:u.viewport.offsetWidth,scrollbar:{size:h.current.clientWidth,paddingStart:xu(d.paddingLeft),paddingEnd:xu(d.paddingRight)}})}})}),qM=N.forwardRef((e,r)=>{const{sizes:o,onSizesChange:a,...l}=e,u=xn(Zn,e.__scopeScrollArea),[d,f]=N.useState(),h=N.useRef(null),p=Ke(r,h,u.onScrollbarYChange);return N.useEffect(()=>{h.current&&f(getComputedStyle(h.current))},[h]),i.jsx(M1,{"data-orientation":"vertical",...l,ref:p,sizes:o,style:{top:0,right:u.dir==="ltr"?0:void 0,left:u.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Gu(o)+"px",...e.style},onThumbPointerDown:g=>e.onThumbPointerDown(g.y),onDragScroll:g=>e.onDragScroll(g.y),onWheelScroll:(g,y)=>{if(u.viewport){const v=u.viewport.scrollTop+g.deltaY;e.onWheelScroll(v),z1(v,y)&&g.preventDefault()}},onResize:()=>{h.current&&u.viewport&&d&&a({content:u.viewport.scrollHeight,viewport:u.viewport.offsetHeight,scrollbar:{size:h.current.clientHeight,paddingStart:xu(d.paddingTop),paddingEnd:xu(d.paddingBottom)}})}})}),[YM,A1]=E1(Zn),M1=N.forwardRef((e,r)=>{const{__scopeScrollArea:o,sizes:a,hasThumb:l,onThumbChange:u,onThumbPointerUp:d,onThumbPointerDown:f,onThumbPositionChange:h,onDragScroll:p,onWheelScroll:g,onResize:y,...v}=e,b=xn(Zn,o),[S,w]=N.useState(null),j=Ke(r,q=>w(q)),k=N.useRef(null),M=N.useRef(""),_=b.viewport,A=a.content-a.viewport,D=Tt(g),L=Tt(h),H=Xu(y,10);function B(q){if(k.current){const Z=q.clientX-k.current.left,K=q.clientY-k.current.top;p({x:Z,y:K})}}return N.useEffect(()=>{const q=Z=>{const K=Z.target;S?.contains(K)&&D(Z,A)};return document.addEventListener("wheel",q,{passive:!1}),()=>document.removeEventListener("wheel",q,{passive:!1})},[_,S,A,D]),N.useEffect(L,[a,L]),ns(S,H),ns(b.content,H),i.jsx(YM,{scope:o,scrollbar:S,hasThumb:l,onThumbChange:Tt(u),onThumbPointerUp:Tt(d),onThumbPositionChange:L,onThumbPointerDown:Tt(f),children:i.jsx(ze.div,{...v,ref:j,style:{position:"absolute",...v.style},onPointerDown:Ee(e.onPointerDown,q=>{q.button===0&&(q.target.setPointerCapture(q.pointerId),k.current=S.getBoundingClientRect(),M.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",b.viewport&&(b.viewport.style.scrollBehavior="auto"),B(q))}),onPointerMove:Ee(e.onPointerMove,B),onPointerUp:Ee(e.onPointerUp,q=>{const Z=q.target;Z.hasPointerCapture(q.pointerId)&&Z.releasePointerCapture(q.pointerId),document.body.style.webkitUserSelect=M.current,b.viewport&&(b.viewport.style.scrollBehavior=""),k.current=null})})})}),gu="ScrollAreaThumb",T1=N.forwardRef((e,r)=>{const{forceMount:o,...a}=e,l=A1(gu,e.__scopeScrollArea);return i.jsx(An,{present:o||l.hasThumb,children:i.jsx(GM,{ref:r,...a})})}),GM=N.forwardRef((e,r)=>{const{__scopeScrollArea:o,style:a,...l}=e,u=xn(gu,o),d=A1(gu,o),{onThumbPositionChange:f}=d,h=Ke(r,y=>d.onThumbChange(y)),p=N.useRef(void 0),g=Xu(()=>{p.current&&(p.current(),p.current=void 0)},100);return N.useEffect(()=>{const y=u.viewport;if(y){const v=()=>{if(g(),!p.current){const b=ZM(y,f);p.current=b,f()}};return f(),y.addEventListener("scroll",v),()=>y.removeEventListener("scroll",v)}},[u.viewport,g,f]),i.jsx(ze.div,{"data-state":d.hasThumb?"visible":"hidden",...l,ref:h,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...a},onPointerDownCapture:Ee(e.onPointerDownCapture,y=>{const b=y.target.getBoundingClientRect(),S=y.clientX-b.left,w=y.clientY-b.top;d.onThumbPointerDown({x:S,y:w})}),onPointerUp:Ee(e.onPointerUp,d.onThumbPointerUp)})});T1.displayName=gu;var Ep="ScrollAreaCorner",R1=N.forwardRef((e,r)=>{const o=xn(Ep,e.__scopeScrollArea),a=!!(o.scrollbarX&&o.scrollbarY);return o.type!=="scroll"&&a?i.jsx(XM,{...e,ref:r}):null});R1.displayName=Ep;var XM=N.forwardRef((e,r)=>{const{__scopeScrollArea:o,...a}=e,l=xn(Ep,o),[u,d]=N.useState(0),[f,h]=N.useState(0),p=!!(u&&f);return ns(l.scrollbarX,()=>{const g=l.scrollbarX?.offsetHeight||0;l.onCornerHeightChange(g),h(g)}),ns(l.scrollbarY,()=>{const g=l.scrollbarY?.offsetWidth||0;l.onCornerWidthChange(g),d(g)}),p?i.jsx(ze.div,{...a,ref:r,style:{width:u,height:f,position:"absolute",right:l.dir==="ltr"?0:void 0,left:l.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function xu(e){return e?parseInt(e,10):0}function D1(e,r){const o=e/r;return isNaN(o)?0:o}function Gu(e){const r=D1(e.viewport,e.content),o=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,a=(e.scrollbar.size-o)*r;return Math.max(a,18)}function FM(e,r,o,a="ltr"){const l=Gu(o),u=l/2,d=r||u,f=l-d,h=o.scrollbar.paddingStart+d,p=o.scrollbar.size-o.scrollbar.paddingEnd-f,g=o.content-o.viewport,y=a==="ltr"?[0,g]:[g*-1,0];return O1([h,p],y)(e)}function fy(e,r,o="ltr"){const a=Gu(r),l=r.scrollbar.paddingStart+r.scrollbar.paddingEnd,u=r.scrollbar.size-l,d=r.content-r.viewport,f=u-a,h=o==="ltr"?[0,d]:[d*-1,0],p=yh(e,h);return O1([0,d],[0,f])(p)}function O1(e,r){return o=>{if(e[0]===e[1]||r[0]===r[1])return r[0];const a=(r[1]-r[0])/(e[1]-e[0]);return r[0]+a*(o-e[0])}}function z1(e,r){return e>0&&e<r}var ZM=(e,r=()=>{})=>{let o={left:e.scrollLeft,top:e.scrollTop},a=0;return(function l(){const u={left:e.scrollLeft,top:e.scrollTop},d=o.left!==u.left,f=o.top!==u.top;(d||f)&&r(),o=u,a=window.requestAnimationFrame(l)})(),()=>window.cancelAnimationFrame(a)};function Xu(e,r){const o=Tt(e),a=N.useRef(0);return N.useEffect(()=>()=>window.clearTimeout(a.current),[]),N.useCallback(()=>{window.clearTimeout(a.current),a.current=window.setTimeout(o,r)},[o,r])}function ns(e,r){const o=Tt(r);Rt(()=>{let a=0;if(e){const l=new ResizeObserver(()=>{cancelAnimationFrame(a),a=window.requestAnimationFrame(o)});return l.observe(e),()=>{window.cancelAnimationFrame(a),l.unobserve(e)}}},[e,o])}var L1=_1,KM=C1,WM=R1;const ta=N.forwardRef(({className:e,children:r,...o},a)=>i.jsxs(L1,{ref:a,className:qe("relative overflow-hidden",e),...o,children:[i.jsx(KM,{className:"h-full w-full rounded-[inherit]",children:r}),i.jsx(I1,{}),i.jsx(WM,{})]}));ta.displayName=L1.displayName;const I1=N.forwardRef(({className:e,orientation:r="vertical",...o},a)=>i.jsx(Np,{ref:a,orientation:r,className:qe("flex touch-none select-none transition-colors",r==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",r==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...o,children:i.jsx(T1,{className:"relative flex-1 rounded-full bg-border"})}));I1.displayName=Np.displayName;var Fu="Tabs",[QM,N7]=kr(Fu,[Lu]),H1=Lu(),[JM,_p]=QM(Fu),B1=N.forwardRef((e,r)=>{const{__scopeTabs:o,value:a,onValueChange:l,defaultValue:u,orientation:d="horizontal",dir:f,activationMode:h="automatic",...p}=e,g=Ji(f),[y,v]=Ja({prop:a,onChange:l,defaultProp:u??"",caller:Fu});return i.jsx(JM,{scope:o,baseId:Vo(),value:y,onValueChange:v,orientation:d,dir:g,activationMode:h,children:i.jsx(ze.div,{dir:g,"data-orientation":d,...p,ref:r})})});B1.displayName=Fu;var U1="TabsList",P1=N.forwardRef((e,r)=>{const{__scopeTabs:o,loop:a=!0,...l}=e,u=_p(U1,o),d=H1(o);return i.jsx(ww,{asChild:!0,...d,orientation:u.orientation,dir:u.dir,loop:a,children:i.jsx(ze.div,{role:"tablist","aria-orientation":u.orientation,...l,ref:r})})});P1.displayName=U1;var $1="TabsTrigger",V1=N.forwardRef((e,r)=>{const{__scopeTabs:o,value:a,disabled:l=!1,...u}=e,d=_p($1,o),f=H1(o),h=G1(d.baseId,a),p=X1(d.baseId,a),g=a===d.value;return i.jsx(Nw,{asChild:!0,...f,focusable:!l,active:g,children:i.jsx(ze.button,{type:"button",role:"tab","aria-selected":g,"aria-controls":p,"data-state":g?"active":"inactive","data-disabled":l?"":void 0,disabled:l,id:h,...u,ref:r,onMouseDown:Ee(e.onMouseDown,y=>{!l&&y.button===0&&y.ctrlKey===!1?d.onValueChange(a):y.preventDefault()}),onKeyDown:Ee(e.onKeyDown,y=>{[" ","Enter"].includes(y.key)&&d.onValueChange(a)}),onFocus:Ee(e.onFocus,()=>{const y=d.activationMode!=="manual";!g&&!l&&y&&d.onValueChange(a)})})})});V1.displayName=$1;var q1="TabsContent",Y1=N.forwardRef((e,r)=>{const{__scopeTabs:o,value:a,forceMount:l,children:u,...d}=e,f=_p(q1,o),h=G1(f.baseId,a),p=X1(f.baseId,a),g=a===f.value,y=N.useRef(g);return N.useEffect(()=>{const v=requestAnimationFrame(()=>y.current=!1);return()=>cancelAnimationFrame(v)},[]),i.jsx(An,{present:l||g,children:({present:v})=>i.jsx(ze.div,{"data-state":g?"active":"inactive","data-orientation":f.orientation,role:"tabpanel","aria-labelledby":h,hidden:!v,id:p,tabIndex:0,...d,ref:r,style:{...e.style,animationDuration:y.current?"0s":void 0},children:v&&u})})});Y1.displayName=q1;function G1(e,r){return`${e}-trigger-${r}`}function X1(e,r){return`${e}-content-${r}`}var e5=B1,F1=P1,Z1=V1,K1=Y1;const t5=e5,W1=N.forwardRef(({className:e,...r},o)=>i.jsx(F1,{ref:o,className:qe("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",e),...r}));W1.displayName=F1.displayName;const Qc=N.forwardRef(({className:e,...r},o)=>i.jsx(Z1,{ref:o,className:qe("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",e),...r}));Qc.displayName=Z1.displayName;const Jc=N.forwardRef(({className:e,...r},o)=>i.jsx(K1,{ref:o,className:qe("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...r}));Jc.displayName=K1.displayName;const n5=kb("inline-flex items-center rounded-md 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 shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function Pn({className:e,variant:r,...o}){return i.jsx("div",{className:qe(n5({variant:r}),e),...o})}function jp(){return i.jsx("div",{className:"flex items-center gap-2 py-3 px-2",children:i.jsx("div",{className:"flex-1 border-t border-border/50"})})}function Cp(e){const r=[];let o=!1;for(let a=0;a<e.length;a++){const l=e[a];o&&l.type!=="response.done"&&(r.push({type:"separator",id:`sep-${a}`}),o=!1),r.push(l),(l.type==="response.done"||l.type==="response.completed")&&(o=!0)}return r}function Xo(e){if(e.type==="response.function_result.complete"){const r=e;return{call_id:r.call_id,output:r.output,status:r.status}}return null}function Q1(e){const r=[],o=new Map,a=new Map;let l="";for(const u of e){if(u.type==="response.trace_event.complete"||u.type==="response.trace.complete")continue;if(u.type==="response.output_item.added"){const h=u.item;if(h.type==="function_call"&&h.call_id&&h.name){const p=h.call_id;o.set(p,{name:h.name,arguments:"",callId:p,itemId:h.id,timestamp:new Date().toISOString()}),a.set(p,h.name)}r.push(u);continue}const d=Xo(u)!==null;if(u.type==="response.completed"||u.type==="response.done"||u.type==="error"||u.type==="response.workflow_event.complete"||u.type==="response.trace_event.complete"||u.type==="response.trace.complete"||d){if(l.trim()&&(r.push({type:"response.output_text.delta",delta:l.trim()}),l=""),(u.type==="response.trace_event.complete"||u.type==="response.trace.complete")&&"data"in u){const h=u.data;if(h.attributes&&h.attributes["gen_ai.output.messages"]&&typeof h.attributes["gen_ai.output.messages"]=="string")try{const p=JSON.parse(h.attributes["gen_ai.output.messages"]);for(const g of p)if(g.parts)for(const y of g.parts)y.type==="tool_call"&&y.name&&y.id&&a.set(y.id,y.name)}catch{}}const f=Xo(u);if(f){const h=f.call_id;if(h&&o.has(h)){const p=o.get(h),g=a.get(h)||p.name||"unknown";r.push({type:"response.function_call.complete",data:{name:g,arguments:p.arguments,call_id:p.callId}}),o.delete(h)}}r.push(u);continue}if(u.type==="response.function_call.delta"&&"data"in u){const f=u.data,h=f.call_id||`call_${Date.now()}`;o.has(h)||o.set(h,{name:f.name||void 0,arguments:"",callId:h,timestamp:new Date().toISOString()}),f.name&&f.name.trim()&&(o.get(h).name=f.name.trim());continue}if(u.type==="response.function_call.complete"&&"data"in u){r.push(u);continue}if(u.type==="response.function_call_arguments.delta"){let f="",h=null;if("delta"in u&&typeof u.delta=="string"&&(f=u.delta),"item_id"in u&&u.item_id){const p=u.item_id;for(const[g,y]of o.entries())if(y.itemId===p||g===p){h=g;break}}if(f&&h){const p=o.get(h);if(p){if(f==="{}"&&p.arguments==="")continue;p.arguments+=f}else console.warn(`Received argument delta for unknown call with item_id: ${"item_id"in u?u.item_id:"unknown"}`)}continue}if(u.type==="response.output_text.delta"&&"delta"in u){l+=u.delta||"",l.length>100&&(l.includes(`
425
-
426
- `)||l.trim().match(/[.!?]\s*$/))&&(r.push({type:"response.output_text.delta",delta:l.trim()}),l="");continue}u.type!=="response.usage.complete"&&r.push(u)}for(const[,u]of o)if(u.arguments.trim()&&u.arguments.trim().length>2){const d=a.get(u.callId)||u.name||"unknown";r.push({type:"response.function_call.complete",data:{name:d,arguments:u.arguments,call_id:u.callId}})}return l.trim()&&r.push({type:"response.output_text.delta",delta:l.trim()}),r}function r5(e){switch(e.type){case"response.output_text.delta":if("delta"in e){const r=e.delta||"";return r.length>60?`${r.slice(0,60)}...`:r}return"Text output";case"response.function_call.complete":if("data"in e&&e.data){const r=e.data;let o=r.name||"unknown";(!o||o==="unknown")&&(o="function_call");const a=r.arguments?typeof r.arguments=="string"?r.arguments.slice(0,30):JSON.stringify(r.arguments).slice(0,30):"";return`Calling ${o}(${a}${a.length>=30?"...":""})`}return"Function call";case"response.function_call_arguments.delta":return"delta"in e&&e.delta?`Function arg delta: ${e.delta.slice(0,30)}${e.delta.length>30?"...":""}`:"Function arguments...";case"response.function_result.complete":{const o=e.output.slice(0,40);return`Function result: ${o}${o.length>=40?"...":""}`}case"response.output_item.added":{const r=e;return r.item.type==="function_call"?`Tool call: ${r.item.name}`:"Output item added"}case"response.workflow_event.complete":return"data"in e&&e.data?`Executor: ${e.data.executor_id||"unknown"}`:"Workflow event";case"response.trace_event.complete":case"response.trace.complete":return"data"in e&&e.data?`Trace: ${e.data.operation_name||"unknown"}`:"Trace event";case"response.completed":if("response"in e&&e.response&&"usage"in e.response){const o=e.response.usage;if(o)return`Response complete (${o.total_tokens} tokens)`}return"Response complete";case"response.done":return"Response complete";case"error":return"message"in e&&typeof e.message=="string"?e.message:"Error occurred";default:return`${e.type}`}}function o5(e){switch(e){case"response.output_text.delta":return g1;case"response.function_call.complete":case"response.function_call.delta":case"response.function_call_arguments.delta":return Yu;case"response.function_result.complete":return Yt;case"response.output_item.added":return Yt;case"response.workflow_event.complete":return fp;case"response.trace_event.complete":case"response.trace.complete":return Bi;case"response.completed":return Yt;case"response.done":return Yt;case"error":return Vu;default:return ts}}function a5(e){switch(e){case"response.output_text.delta":return"text-gray-600 dark:text-gray-400";case"response.function_call.complete":case"response.function_call.delta":case"response.function_call_arguments.delta":return"text-blue-600 dark:text-blue-400";case"response.function_result.complete":return"text-green-600 dark:text-green-400";case"response.output_item.added":return"text-green-600 dark:text-green-400";case"response.workflow_event.complete":return"text-purple-600 dark:text-purple-400";case"response.trace_event.complete":case"response.trace.complete":return"text-orange-600 dark:text-orange-400";case"response.completed":return"text-green-600 dark:text-green-400";case"response.done":return"text-green-600 dark:text-green-400";case"error":return"text-red-600 dark:text-red-400";default:return"text-gray-600 dark:text-gray-400"}}function s5({event:e}){const[r,o]=N.useState(!1),a=o5(e.type),l=a5(e.type),u=new Date().toLocaleTimeString(),d=r5(e),f=e.type==="response.function_call.complete"&&"data"in e&&e.data||e.type==="response.function_result.complete"||e.type==="response.output_item.added"&&Xo(e)!==null||e.type==="response.workflow_event.complete"&&"data"in e&&e.data||e.type==="response.trace_event.complete"&&"data"in e&&e.data||e.type==="response.trace.complete"&&"data"in e&&e.data||e.type==="response.output_text.delta"&&"delta"in e&&e.delta&&e.delta.length>100||e.type==="response.completed"&&"response"in e&&e.response||e.type==="error";return i.jsxs("div",{className:"border-l-2 border-muted pl-3 py-2 hover:bg-muted/50 transition-colors",children:[i.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground mb-1",children:[i.jsx(a,{className:`h-3 w-3 ${l}`}),i.jsx("span",{className:"font-mono",children:u}),i.jsx(Pn,{variant:"outline",className:"text-xs py-0",children:e.type.replace("response.","")})]}),i.jsxs("div",{className:"text-sm",children:[i.jsxs("div",{className:`flex items-center gap-2 ${f?"cursor-pointer":""}`,onClick:()=>f&&o(!r),children:[f&&i.jsx("div",{className:"text-muted-foreground",children:r?i.jsx(kn,{className:"h-3 w-3"}):i.jsx($u,{className:"h-3 w-3"})}),i.jsx("div",{className:"text-muted-foreground flex-1",children:f&&d.length>80?`${d.slice(0,80)}...`:d})]}),r&&f&&i.jsx("div",{className:"mt-2 ml-5 p-3 bg-muted/30 rounded border",children:i.jsx(i5,{event:e})})]})]})}function i5({event:e}){if(e.type==="error"){const r=e;return i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(Vu,{className:"h-4 w-4 text-red-500"}),i.jsx("span",{className:"font-semibold text-sm",children:"Error Details"})]}),i.jsxs("div",{className:"text-xs",children:[r.message&&i.jsxs("div",{className:"mb-2",children:[i.jsx("span",{className:"font-medium text-muted-foreground",children:"Message:"}),i.jsx("div",{className:"mt-1",children:i.jsx("pre",{className:"text-xs bg-destructive/10 border border-destructive/30 rounded p-2 text-destructive whitespace-pre-wrap break-all",children:r.message})})]}),r.code&&i.jsxs("div",{className:"mb-2",children:[i.jsx("span",{className:"font-medium text-muted-foreground",children:"Code:"}),i.jsx("span",{className:"ml-2 font-mono text-xs",children:r.code})]}),r.param&&i.jsxs("div",{className:"mb-2",children:[i.jsx("span",{className:"font-medium text-muted-foreground",children:"Parameter:"}),i.jsx("span",{className:"ml-2 font-mono text-xs",children:r.param})]}),i.jsxs("div",{children:[i.jsx("span",{className:"font-medium text-muted-foreground",children:"Raw Event:"}),i.jsx("div",{className:"mt-1",children:i.jsx("pre",{className:"text-xs bg-background border rounded p-2 whitespace-pre-wrap break-all max-h-32 overflow-auto",children:JSON.stringify(e,null,2)})})]})]})]})}switch(e.type){case"response.function_call.complete":if("data"in e&&e.data){const r=e.data;return i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(Yu,{className:"h-4 w-4 text-blue-500"}),i.jsx("span",{className:"font-semibold text-sm",children:"Function Call"})]}),i.jsxs("div",{className:"grid grid-cols-1 gap-2 text-xs",children:[i.jsxs("div",{children:[i.jsx("span",{className:"font-medium text-muted-foreground",children:"Function:"}),i.jsx("span",{className:"ml-2 font-mono bg-blue-100 dark:bg-blue-900 px-2 py-1 rounded",children:r.name||"unknown"})]}),r.call_id&&i.jsxs("div",{children:[i.jsx("span",{className:"font-medium text-muted-foreground",children:"Call ID:"}),i.jsx("span",{className:"ml-2 font-mono text-xs",children:r.call_id})]}),r.arguments&&i.jsxs("div",{children:[i.jsx("span",{className:"font-medium text-muted-foreground",children:"Arguments:"}),i.jsx("div",{className:"mt-1 max-h-32 overflow-auto",children:i.jsx("pre",{className:"text-xs bg-background border rounded p-2 whitespace-pre-wrap max-w-full break-all",children:typeof r.arguments=="string"?r.arguments:JSON.stringify(r.arguments,null,1)})})]})]})]})}break;case"response.function_result.complete":{const r=e;return i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(Yt,{className:"h-4 w-4 text-green-500"}),i.jsx("span",{className:"font-semibold text-sm",children:"Function Result"})]}),i.jsxs("div",{className:"grid grid-cols-1 gap-2 text-xs",children:[i.jsxs("div",{children:[i.jsx("span",{className:"font-medium text-muted-foreground",children:"Call ID:"}),i.jsx("span",{className:"ml-2 font-mono text-xs",children:r.call_id})]}),i.jsxs("div",{children:[i.jsx("span",{className:"font-medium text-muted-foreground",children:"Status:"}),i.jsx("span",{className:`ml-2 px-2 py-1 rounded text-xs font-medium ${r.status==="completed"?"bg-green-100 dark:bg-green-900 text-green-800 dark:text-green-200":"bg-red-100 dark:bg-red-900 text-red-800 dark:text-red-200"}`,children:r.status})]}),i.jsxs("div",{children:[i.jsx("span",{className:"font-medium text-muted-foreground",children:"Output:"}),i.jsx("div",{className:"mt-1 max-h-32 overflow-auto",children:i.jsx("pre",{className:"text-xs bg-background border rounded p-2 whitespace-pre-wrap max-w-full break-all",children:r.output})})]})]})]})}case"response.output_item.added":{const r=Xo(e);if(r)return i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(Yt,{className:"h-4 w-4 text-green-500"}),i.jsx("span",{className:"font-semibold text-sm",children:"Function Result"})]}),i.jsxs("div",{className:"grid grid-cols-1 gap-2 text-xs",children:[i.jsxs("div",{children:[i.jsx("span",{className:"font-medium text-muted-foreground",children:"Call ID:"}),i.jsx("span",{className:"ml-2 font-mono text-xs",children:r.call_id})]}),i.jsxs("div",{children:[i.jsx("span",{className:"font-medium text-muted-foreground",children:"Status:"}),i.jsx("span",{className:`ml-2 px-2 py-1 rounded text-xs font-medium ${r.status==="completed"?"bg-green-100 dark:bg-green-900 text-green-800 dark:text-green-200":"bg-red-100 dark:bg-red-900 text-red-800 dark:text-red-200"}`,children:r.status})]}),i.jsxs("div",{children:[i.jsx("span",{className:"font-medium text-muted-foreground",children:"Output:"}),i.jsx("div",{className:"mt-1 max-h-32 overflow-auto",children:i.jsx("pre",{className:"text-xs bg-background border rounded p-2 whitespace-pre-wrap max-w-full break-all",children:r.output})})]})]})]});break}case"response.workflow_event.complete":if("data"in e&&e.data){const r=e.data;return i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(fp,{className:"h-4 w-4 text-purple-500"}),i.jsx("span",{className:"font-semibold text-sm",children:"Workflow Event"})]}),i.jsxs("div",{className:"grid grid-cols-1 gap-2 text-xs",children:[i.jsxs("div",{children:[i.jsx("span",{className:"font-medium text-muted-foreground",children:"Event Type:"}),i.jsx("span",{className:"ml-2 font-mono bg-purple-100 dark:bg-purple-900 px-2 py-1 rounded",children:r.event_type||"unknown"})]}),r.executor_id&&i.jsxs("div",{children:[i.jsx("span",{className:"font-medium text-muted-foreground",children:"Executor:"}),i.jsx("span",{className:"ml-2 font-mono",children:r.executor_id})]}),r.timestamp&&i.jsxs("div",{children:[i.jsx("span",{className:"font-medium text-muted-foreground",children:"Timestamp:"}),i.jsx("span",{className:"ml-2 font-mono text-xs",children:r.timestamp})]}),r.data&&i.jsxs("div",{children:[i.jsx("span",{className:"font-medium text-muted-foreground",children:"Data:"}),i.jsx("div",{className:"mt-1 max-h-32 overflow-auto",children:i.jsx("pre",{className:"text-xs bg-background border rounded p-2 whitespace-pre-wrap max-w-full break-all",children:typeof r.data=="string"?r.data:JSON.stringify(r.data,null,1)})})]})]})]})}break;case"response.trace_event.complete":case"response.trace.complete":if("data"in e&&e.data){const r=e.data;return i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(Bi,{className:"h-4 w-4 text-orange-500"}),i.jsx("span",{className:"font-semibold text-sm",children:"Trace Event"})]}),i.jsxs("div",{className:"grid grid-cols-1 gap-2 text-xs",children:[i.jsxs("div",{children:[i.jsx("span",{className:"font-medium text-muted-foreground",children:"Operation:"}),i.jsx("span",{className:"ml-2 font-mono bg-orange-100 dark:bg-orange-900 px-2 py-1 rounded",children:r.operation_name||"unknown"})]}),r.span_id&&i.jsxs("div",{children:[i.jsx("span",{className:"font-medium text-muted-foreground",children:"Span ID:"}),i.jsx("span",{className:"ml-2 font-mono text-xs",children:r.span_id})]}),r.trace_id&&i.jsxs("div",{children:[i.jsx("span",{className:"font-medium text-muted-foreground",children:"Trace ID:"}),i.jsx("span",{className:"ml-2 font-mono text-xs",children:r.trace_id})]}),r.duration_ms&&i.jsxs("div",{children:[i.jsx("span",{className:"font-medium text-muted-foreground",children:"Duration:"}),i.jsxs("span",{className:"ml-2 font-mono text-xs",children:[Number(r.duration_ms).toFixed(2),"ms"]})]}),r.status&&i.jsxs("div",{children:[i.jsx("span",{className:"font-medium text-muted-foreground",children:"Status:"}),i.jsx("span",{className:`ml-2 px-2 py-1 rounded text-xs font-medium ${r.status==="StatusCode.UNSET"||r.status==="OK"?"bg-green-100 dark:bg-green-900 text-green-800 dark:text-green-200":"bg-red-100 dark:bg-red-900 text-red-800 dark:text-red-200"}`,children:r.status||"unknown"})]}),r.entity_id&&i.jsxs("div",{children:[i.jsx("span",{className:"font-medium text-muted-foreground",children:"Entity:"}),i.jsx("span",{className:"ml-2 font-mono text-xs",children:r.entity_id})]}),r.attributes&&Object.keys(r.attributes).length>0&&i.jsxs("div",{children:[i.jsx("span",{className:"font-medium text-muted-foreground",children:"Attributes:"}),i.jsx("div",{className:"mt-1 max-h-32 overflow-auto",children:i.jsx("pre",{className:"text-xs bg-background border rounded p-2 whitespace-pre-wrap break-all",children:(()=>{try{const o={...r.attributes};return Object.keys(o).forEach(a=>{if(typeof o[a]=="string"&&o[a].startsWith("["))try{o[a]=JSON.parse(o[a])}catch{}}),JSON.stringify(o,null,2)}catch{return JSON.stringify(r.attributes,null,2)}})()})})]})]})]})}break;case"response.output_text.delta":if("delta"in e&&e.delta)return i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(g1,{className:"h-4 w-4 text-gray-500"}),i.jsx("span",{className:"font-semibold text-sm",children:"Text Output"})]}),i.jsx("div",{className:"max-h-32 overflow-auto",children:i.jsx("pre",{className:"text-xs bg-background border rounded p-2 whitespace-pre-wrap max-w-full break-all",children:e.delta})})]});break;case"response.completed":if("response"in e&&e.response){const o=e.response;return i.jsx("div",{className:"space-y-2",children:i.jsxs("div",{className:"grid grid-cols-1 gap-2 text-xs",children:[o.usage&&i.jsxs(i.Fragment,{children:[i.jsx("div",{children:i.jsx("span",{className:"font-medium text-muted-foreground",children:"Usage:"})}),i.jsxs("div",{className:"ml-4 space-y-1",children:[i.jsxs("div",{children:[i.jsx("span",{className:"font-medium text-muted-foreground",children:"Input tokens:"}),i.jsx("span",{className:"ml-2 font-mono",children:o.usage.input_tokens})]}),i.jsxs("div",{children:[i.jsx("span",{className:"font-medium text-muted-foreground",children:"Output tokens:"}),i.jsx("span",{className:"ml-2 font-mono",children:o.usage.output_tokens})]}),i.jsxs("div",{children:[i.jsx("span",{className:"font-medium text-muted-foreground",children:"Total tokens:"}),i.jsx("span",{className:"ml-2 font-mono bg-green-100 dark:bg-green-900 px-2 py-1 rounded",children:o.usage.total_tokens})]})]})]}),o.id&&i.jsxs("div",{children:[i.jsx("span",{className:"font-medium text-muted-foreground",children:"Response ID:"}),i.jsx("span",{className:"ml-2 font-mono text-xs break-all",children:o.id})]}),o.model&&i.jsxs("div",{children:[i.jsx("span",{className:"font-medium text-muted-foreground",children:"Model:"}),i.jsx("span",{className:"ml-2 font-mono text-xs break-all",children:o.model})]})]})})}break;default:return i.jsx("div",{className:"text-xs text-muted-foreground",children:i.jsx("pre",{className:"bg-background border rounded p-2 overflow-auto max-h-32",children:JSON.stringify(e,null,2)})})}return null}function l5({events:e,isStreaming:r}){const o=N.useRef(null),a=Q1(e),u=[...Cp(a)].reverse();return i.jsxs("div",{className:"h-full flex flex-col",children:[i.jsxs("div",{className:"flex items-center justify-between p-3 border-b",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(fp,{className:"h-4 w-4"}),i.jsx("span",{className:"font-medium",children:"Events"}),i.jsxs(Pn,{variant:"outline",children:[a.length,e.length>a.length?` (${e.length} raw)`:""]})]}),r&&i.jsxs("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[i.jsx("div",{className:"h-2 w-2 animate-pulse rounded-full bg-green-500 dark:bg-green-400"}),"Streaming"]})]}),i.jsx(ta,{ref:o,className:"flex-1",children:i.jsx("div",{className:"p-3",children:a.length===0?i.jsx("div",{className:"text-center text-muted-foreground text-sm py-8",children:e.length===0?"No events yet. Start a conversation to see real-time events.":"Processing events... Accumulated events will appear here."}):i.jsx("div",{className:"space-y-2",children:u.map((d,f)=>"type"in d&&d.type==="separator"?i.jsx(jp,{},d.id):i.jsx(s5,{event:d},`${d.type}-${f}`))})})})]})}function c5({events:e}){const r=e.filter(l=>l.type==="response.trace_event.complete"||l.type==="response.trace.complete"),a=[...Cp(r)].reverse();return i.jsxs("div",{className:"h-full flex flex-col",children:[i.jsxs("div",{className:"flex items-center gap-2 p-3 border-b",children:[i.jsx(Bi,{className:"h-4 w-4"}),i.jsx("span",{className:"font-medium",children:"Traces"}),i.jsx(Pn,{variant:"outline",children:r.length})]}),i.jsx(ta,{className:"flex-1",children:i.jsx("div",{className:"p-3",children:r.length===0?i.jsxs("div",{className:"text-center text-muted-foreground text-sm py-8",children:["No trace data available.",i.jsx("br",{}),e&&e.length>0&&i.jsxs("div",{className:"mt-3 text-xs border rounded p-2",children:[" ",i.jsx(hu,{className:"inline h-4 w-4 mr-1 "}),"You may have to set the environment variable"," ",i.jsx("span",{className:"font-mono bg-accent/10 px-1 rounded",children:"ENABLE_OTEL=true"})," ","or restart devui with the tracing flag"," ",i.jsx("div",{className:"font-mono bg-accent/10 px-1 rounded",children:"devui --tracing"}),"to enable tracing."]})]}):i.jsx("div",{className:"space-y-3",children:a.map((l,u)=>"type"in l&&l.type==="separator"?i.jsx(jp,{},l.id):i.jsx(u5,{event:l},u))})})})]})}function u5({event:e}){const[r,o]=N.useState(!1);if(e.type!=="response.trace_event.complete"&&e.type!=="response.trace.complete"||!("data"in e))return i.jsxs("div",{className:"border rounded p-3 text-red-600 dark:text-red-400 text-xs",children:["Error: Expected trace event but got ",e.type]});const a=e.data;let l=new Date().toLocaleTimeString();a.end_time?l=new Date(a.end_time*1e3).toLocaleTimeString():a.start_time?l=new Date(a.start_time*1e3).toLocaleTimeString():a.timestamp&&(l=new Date(a.timestamp).toLocaleTimeString());const u=a.operation_name||"Unknown Operation",d=a.duration_ms?`${Number(a.duration_ms).toFixed(1)}ms`:"",f=a.entity_id||"";return i.jsxs("div",{className:"border-l-2 border-muted pl-3 py-2 hover:bg-muted/50 transition-colors",children:[i.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground mb-1",children:[i.jsx(Bi,{className:"h-3 w-3 text-orange-600 dark:text-orange-400"}),i.jsx("span",{className:"font-mono",children:l}),i.jsx(Pn,{variant:"outline",className:"text-xs py-0",children:"trace"}),d&&i.jsx(Pn,{variant:"secondary",className:"text-xs py-0",children:d})]}),i.jsxs("div",{className:"text-sm",children:[i.jsxs("div",{className:"flex items-center gap-2 cursor-pointer",onClick:()=>o(!r),children:[i.jsx("div",{className:"text-muted-foreground",children:r?i.jsx(kn,{className:"h-3 w-3"}):i.jsx($u,{className:"h-3 w-3"})}),i.jsxs("div",{className:"text-muted-foreground flex-1 break-all",children:[i.jsx("span",{className:"font-medium",children:u}),f&&i.jsxs("span",{className:"ml-2 text-xs",children:["(",f,")"]})]})]}),r&&i.jsx("div",{className:"mt-2 ml-5 p-3 bg-muted/30 rounded border",children:i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(Bi,{className:"h-4 w-4 text-orange-500"}),i.jsx("span",{className:"font-semibold text-sm",children:"Trace Details"})]}),i.jsxs("div",{className:"grid grid-cols-1 gap-2 text-xs",children:[i.jsxs("div",{children:[i.jsx("span",{className:"font-medium text-muted-foreground",children:"Operation:"}),i.jsx("span",{className:"ml-2 font-mono bg-orange-100 dark:bg-orange-900 px-2 py-1 rounded",children:u})]}),a.span_id&&i.jsxs("div",{children:[i.jsx("span",{className:"font-medium text-muted-foreground",children:"Span ID:"}),i.jsx("span",{className:"ml-2 font-mono text-xs break-all",children:a.span_id})]}),a.trace_id&&i.jsxs("div",{children:[i.jsx("span",{className:"font-medium text-muted-foreground",children:"Trace ID:"}),i.jsx("span",{className:"ml-2 font-mono text-xs break-all",children:a.trace_id})]}),a.parent_span_id&&i.jsxs("div",{children:[i.jsx("span",{className:"font-medium text-muted-foreground",children:"Parent Span:"}),i.jsx("span",{className:"ml-2 font-mono text-xs break-all",children:a.parent_span_id})]}),a.duration_ms&&i.jsxs("div",{children:[i.jsx("span",{className:"font-medium text-muted-foreground",children:"Duration:"}),i.jsxs("span",{className:"ml-2 font-mono text-xs",children:[Number(a.duration_ms).toFixed(2),"ms"]})]}),a.status&&i.jsxs("div",{children:[i.jsx("span",{className:"font-medium text-muted-foreground",children:"Status:"}),i.jsx("span",{className:`ml-2 px-2 py-1 rounded text-xs font-medium ${a.status==="StatusCode.UNSET"||a.status==="OK"?"bg-green-100 dark:bg-green-900 text-green-800 dark:text-green-200":"bg-red-100 dark:bg-red-900 text-red-800 dark:text-red-200"}`,children:a.status||"unknown"})]}),a.entity_id&&i.jsxs("div",{children:[i.jsx("span",{className:"font-medium text-muted-foreground",children:"Entity:"}),i.jsx("span",{className:"ml-2 font-mono text-xs break-all",children:a.entity_id})]}),a.attributes&&Object.keys(a.attributes).length>0&&i.jsxs("div",{children:[i.jsx("span",{className:"font-medium text-muted-foreground",children:"Attributes:"}),i.jsx("div",{className:"mt-1 max-h-32 overflow-auto",children:i.jsx("pre",{className:"text-xs bg-background border rounded p-2 whitespace-pre-wrap max-w-full break-all",children:(()=>{try{const h={...a.attributes};return Object.keys(h).forEach(p=>{if(typeof h[p]=="string"&&h[p].startsWith("["))try{h[p]=JSON.parse(h[p])}catch{}}),JSON.stringify(h,null,2)}catch{return JSON.stringify(a.attributes,null,2)}})()})})]})]})]})})]})]})}function d5({events:e}){const r=Q1(e),o=[],a=r.filter(h=>h.type==="response.function_call.complete"),l=e.filter(h=>Xo(h)!==null),u=new Map;l.forEach(h=>{const p=Xo(h);p&&u.set(p.call_id,h)}),a.forEach(h=>{if(o.push(h),"data"in h&&h.data&&h.data.call_id){const p=String(h.data.call_id),g=u.get(p);g&&(o.push(g),u.delete(p))}}),u.forEach(h=>{o.push(h)});const f=[...Cp(o)].reverse();return i.jsxs("div",{className:"h-full flex flex-col",children:[i.jsxs("div",{className:"flex items-center gap-2 p-3 border-b",children:[i.jsx(Yu,{className:"h-4 w-4"}),i.jsx("span",{className:"font-medium",children:"Tools"}),i.jsx(Pn,{variant:"outline",children:o.length})]}),i.jsx(ta,{className:"flex-1",children:i.jsx("div",{className:"p-3",children:o.length===0?i.jsx("div",{className:"text-center text-muted-foreground text-sm py-8",children:"No tool executions yet. Tool calls will appear here during conversations."}):i.jsx("div",{className:"space-y-3",children:f.map((h,p)=>"type"in h&&h.type==="separator"?i.jsx(jp,{},h.id):i.jsx(f5,{event:h},p))})})})]})}function f5({event:e}){const r=new Date().toLocaleTimeString(),o=e.type==="response.function_call.complete",a=Xo(e),l=a!==null;if(!o&&!l)return null;const u=o&&"data"in e?e.data:null;return i.jsxs("div",{className:"border rounded p-3",children:[i.jsxs("div",{className:"flex items-center justify-between mb-2",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(N1,{className:"h-4 w-4 text-yellow-600 dark:text-yellow-400"}),i.jsx("span",{className:"font-medium text-sm",children:o?"Tool Call":"Tool Result"}),o&&u&&u.name!==void 0&&i.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",String(u.name),")"]})]}),i.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:r})]}),o&&u&&i.jsxs("div",{className:"p-2 bg-blue-50 dark:bg-blue-950/50 border border-blue-200 dark:border-blue-800 rounded",children:[i.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[i.jsx(Yu,{className:"h-3 w-3 text-blue-600 dark:text-blue-400"}),i.jsx("span",{className:"text-xs font-mono bg-blue-100 dark:bg-blue-900 text-blue-800 dark:text-blue-200 px-2 py-1 rounded",children:"CALL"}),i.jsx("span",{className:"font-medium text-sm",children:String(u.name||"unknown")})]}),u.arguments!==void 0&&i.jsxs("div",{className:"text-xs",children:[i.jsx("span",{className:"text-muted-foreground mb-1 block",children:"Arguments:"}),i.jsx("pre",{className:"p-2 bg-background border rounded text-xs overflow-auto max-h-32 max-w-full break-all whitespace-pre-wrap",children:typeof u.arguments=="string"?u.arguments:JSON.stringify(u.arguments,null,1)})]})]}),l&&a&&i.jsxs("div",{className:"p-2 bg-green-50 dark:bg-green-950/50 border border-green-200 dark:border-green-800 rounded",children:[i.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[i.jsx(Yt,{className:"h-3 w-3 text-green-600 dark:text-green-400"}),i.jsx("span",{className:"text-xs font-mono bg-green-100 dark:bg-green-900 text-green-800 dark:text-green-200 px-2 py-1 rounded",children:"RESULT"}),a.status!=="completed"&&i.jsx("span",{className:"ml-auto px-2 py-1 rounded text-xs font-medium bg-red-100 dark:bg-red-900 text-red-800 dark:text-red-200",children:a.status})]}),i.jsxs("div",{className:"text-xs space-y-1",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"text-muted-foreground",children:"Call ID:"}),i.jsx("span",{className:"font-mono text-xs break-all",children:a.call_id})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-muted-foreground block mb-1",children:"Output:"}),i.jsx("pre",{className:"p-2 bg-background border rounded text-xs overflow-auto max-h-32 break-all whitespace-pre-wrap",children:a.output})]})]})]})]})}function m5({events:e,isStreaming:r=!1,onClose:o}){return i.jsx("div",{className:"flex-1 border-l flex flex-col min-h-0",children:i.jsxs(t5,{defaultValue:"events",className:"flex-1 flex flex-col min-h-0",children:[i.jsxs("div",{className:"px-3 pt-3 flex items-center gap-2 flex-shrink-0",children:[i.jsxs(W1,{className:"flex-1",children:[i.jsx(Qc,{value:"events",className:"flex-1",children:"Events"}),i.jsx(Qc,{value:"traces",className:"flex-1",children:"Traces"}),i.jsx(Qc,{value:"tools",className:"flex-1",children:"Tools"})]}),o&&i.jsx(Oe,{variant:"ghost",size:"sm",onClick:o,className:"h-8 w-8 p-0 flex-shrink-0",title:"Hide debug panel",children:i.jsx(ZA,{className:"h-4 w-4"})})]}),i.jsx(Jc,{value:"events",className:"flex-1 mt-0 overflow-hidden",children:i.jsx(l5,{events:e,isStreaming:r})}),i.jsx(Jc,{value:"traces",className:"flex-1 mt-0 overflow-hidden",children:i.jsx(c5,{events:e})}),i.jsx(Jc,{value:"tools",className:"flex-1 mt-0 overflow-hidden",children:i.jsx(d5,{events:e})})]})})}function Sr({open:e,onOpenChange:r,children:o}){return e?i.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",onClick:()=>r(!1),children:[i.jsx("div",{className:"absolute inset-0 bg-black/50"}),i.jsx("div",{onClick:a=>a.stopPropagation(),children:o})]}):null}function Er({children:e,className:r=""}){const a=r.includes("w-[")||r.includes("w-full")||r.includes("max-w-")?"":"max-w-lg w-full";return i.jsx("div",{className:`relative bg-background border rounded-lg shadow-lg max-h-[90vh] overflow-hidden ${a} ${r}`,children:e})}function _r({children:e,className:r=""}){return i.jsx("div",{className:`space-y-2 ${r}`,children:e})}function jr({children:e,className:r=""}){return i.jsx("h2",{className:`text-lg font-semibold ${r}`,children:e})}function h5({children:e,className:r=""}){return i.jsx("p",{className:`text-sm text-muted-foreground ${r}`,children:e})}function ho({onClose:e}){return i.jsx(Oe,{variant:"ghost",size:"sm",onClick:e,className:"absolute top-4 right-4 h-8 w-8 p-0 rounded-sm opacity-70 hover:opacity-100",children:i.jsx(pp,{className:"h-4 w-4"})})}function p5({children:e}){return i.jsx("div",{className:"flex justify-end gap-2 p-4 border-t bg-muted/50",children:e})}function bh({className:e,type:r,...o}){return i.jsx("input",{type:r,"data-slot":"input",className:qe("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...o})}var g5="Label",J1=N.forwardRef((e,r)=>i.jsx(ze.label,{...e,ref:r,onMouseDown:o=>{o.target.closest("button, input, select, textarea")||(e.onMouseDown?.(o),!o.defaultPrevented&&o.detail>1&&o.preventDefault())}}));J1.displayName=g5;var x5=J1;function io({className:e,...r}){return i.jsx(x5,{"data-slot":"label",className:qe("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...r})}function my({open:e,onOpenChange:r,onBackendUrlChange:o}){const[a,l]=N.useState("settings"),u="http://localhost:8080",[d,f]=N.useState(()=>localStorage.getItem("devui_backend_url")||u),[h,p]=N.useState(d),g=()=>{try{new URL(h),localStorage.setItem("devui_backend_url",h),f(h),o?.(h),r(!1),window.location.reload()}catch{alert("Please enter a valid URL (e.g., http://localhost:8080)")}},y=()=>{localStorage.removeItem("devui_backend_url"),p(u),f(u),o?.(u),window.location.reload()},v=h!==d,b=!localStorage.getItem("devui_backend_url");return i.jsx(Sr,{open:e,onOpenChange:r,children:i.jsxs(Er,{className:"w-[600px] max-w-[90vw]",children:[i.jsx(_r,{className:"p-6 pb-2",children:i.jsx(jr,{children:"Settings"})}),i.jsx(ho,{onClose:()=>r(!1)}),i.jsxs("div",{className:"flex border-b px-6",children:[i.jsxs("button",{onClick:()=>l("settings"),className:`px-4 py-2 text-sm font-medium transition-colors relative ${a==="settings"?"text-foreground":"text-muted-foreground hover:text-foreground"}`,children:["Settings",a==="settings"&&i.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-0.5 bg-primary"})]}),i.jsxs("button",{onClick:()=>l("about"),className:`px-4 py-2 text-sm font-medium transition-colors relative ${a==="about"?"text-foreground":"text-muted-foreground hover:text-foreground"}`,children:["About",a==="about"&&i.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-0.5 bg-primary"})]})]}),i.jsxs("div",{className:"px-6 pb-6 min-h-[240px]",children:[a==="settings"&&i.jsx("div",{className:"space-y-6 pt-4",children:i.jsxs("div",{className:"space-y-3",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx(io,{htmlFor:"backend-url",className:"text-sm font-medium",children:"Backend URL"}),!b&&i.jsxs(Oe,{variant:"ghost",size:"sm",onClick:y,className:"h-7 text-xs",title:"Reset to default",children:[i.jsx(hp,{className:"h-3 w-3 mr-1"}),"Reset"]})]}),i.jsx(bh,{id:"backend-url",type:"url",value:h,onChange:S=>p(S.target.value),placeholder:"http://localhost:8080",className:"font-mono text-sm"}),i.jsxs("p",{className:"text-xs text-muted-foreground",children:["Default: ",i.jsx("span",{className:"font-mono",children:u})]}),i.jsx("div",{className:"flex gap-2 pt-2 min-h-[36px]",children:v&&i.jsxs(i.Fragment,{children:[i.jsx(Oe,{onClick:g,size:"sm",className:"flex-1",children:"Apply & Reload"}),i.jsx(Oe,{onClick:()=>p(d),variant:"outline",size:"sm",className:"flex-1",children:"Cancel"})]})})]})}),a==="about"&&i.jsxs("div",{className:"space-y-4 pt-4",children:[i.jsx("p",{className:"text-sm text-muted-foreground",children:"DevUI is a sample app for getting started with Agent Framework."}),i.jsx("div",{className:"flex justify-center pt-2",children:i.jsxs(Oe,{variant:"outline",size:"sm",onClick:()=>window.open("https://github.com/microsoft/agent-framework","_blank"),className:"text-xs",children:[i.jsx(mp,{className:"h-3 w-3 mr-1"}),"Learn More about Agent Framework"]})})]})]})]})})}function v5({open:e,onClose:r,agentName:o="Agent"}){const[a,l]=N.useState("docker"),[u,d]=N.useState(null),f=(y,v)=>{navigator.clipboard.writeText(y),d(v),setTimeout(()=>d(null),2e3)},h=`# Dockerfile for ${o}
427
- FROM python:3.11-slim
428
-
429
- WORKDIR /app
430
-
431
- # Install dependencies
432
- COPY requirements.txt .
433
- RUN pip install --no-cache-dir -r requirements.txt
434
-
435
- # Copy agent/workflow directories
436
- COPY . .
437
-
438
- # Expose DevUI default port
439
- EXPOSE 8080
440
-
441
- # Run DevUI server
442
- CMD ["devui", ".", "--port", "8080", "--host", "0.0.0.0"]
443
- `,p=`# docker-compose.yml
444
- version: '3.8'
445
-
446
- services:
447
- ${o.toLowerCase().replace(/\s+/g,"-")}:
448
- build: .
449
- environment:
450
- # OpenAI
451
- - OPENAI_API_KEY=\${OPENAI_API_KEY}
452
- - OPENAI_CHAT_MODEL_ID=\${OPENAI_CHAT_MODEL_ID:-gpt-4o-mini}
453
- # Or Azure OpenAI
454
- - AZURE_OPENAI_API_KEY=\${AZURE_OPENAI_API_KEY}
455
- - AZURE_OPENAI_ENDPOINT=\${AZURE_OPENAI_ENDPOINT}
456
- - AZURE_OPENAI_CHAT_DEPLOYMENT_NAME=\${AZURE_OPENAI_CHAT_DEPLOYMENT_NAME}
457
- # Optional: Enable tracing
458
- - ENABLE_OTEL=\${ENABLE_OTEL:-false}
459
- ports:
460
- - "8080:8080"
461
- restart: unless-stopped
462
- `,g=`# requirements.txt
463
- agent-framework-devui>=0.1.0
464
- agent-framework>=0.1.0
465
- # Chat clients (install what you need)
466
- openai>=1.0.0
467
- # azure-openai
468
- # anthropic
469
- `;return i.jsx(Sr,{open:e,onOpenChange:r,children:i.jsxs(Er,{className:"w-[800px] max-w-[90vw]",children:[i.jsx(ho,{onClose:r}),i.jsxs(_r,{className:"p-6 pb-2",children:[i.jsxs(jr,{className:"flex items-center gap-2",children:[i.jsx(y1,{className:"h-5 w-5"}),"Deploy ",o]}),i.jsx("p",{className:"text-sm text-muted-foreground pt-1",children:"Get started with containerizing your agent for deployment."})]}),i.jsxs("div",{className:"flex border-b px-6",children:[i.jsxs("button",{onClick:()=>l("docker"),className:`px-4 py-2 text-sm font-medium transition-colors relative ${a==="docker"?"text-foreground":"text-muted-foreground hover:text-foreground"}`,children:[i.jsx(gA,{className:"h-4 w-4 mr-2 inline"}),"Docker",a==="docker"&&i.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-0.5 bg-primary"})]}),i.jsxs("button",{onClick:()=>l("azure"),className:`px-4 py-2 text-sm font-medium transition-colors relative ${a==="azure"?"text-foreground":"text-muted-foreground hover:text-foreground"}`,children:[i.jsx(mA,{className:"h-4 w-4 mr-2 inline"}),"Azure",a==="azure"&&i.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-0.5 bg-primary"})]})]}),i.jsx("div",{className:"px-6 pb-6 min-h-[400px]",children:i.jsx(ta,{className:"h-[500px]",children:i.jsxs("div",{className:"pr-4",children:[a==="docker"&&i.jsxs("div",{className:"space-y-4 pt-4",children:[i.jsxs("div",{children:[i.jsx("h3",{className:"font-semibold mb-2",children:"Containerize with Docker"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"Package your agent as a Docker container for consistent deployment anywhere."})]}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center justify-between mb-2",children:[i.jsx("span",{className:"text-sm font-medium",children:"Dockerfile"}),i.jsx(Oe,{size:"sm",variant:"ghost",onClick:()=>f(h,"dockerfile"),children:u==="dockerfile"?i.jsxs(i.Fragment,{children:[i.jsx(Yt,{className:"h-4 w-4 mr-1 text-green-500"}),"Copied!"]}):i.jsxs(i.Fragment,{children:[i.jsx(Ti,{className:"h-4 w-4 mr-1"}),"Copy"]})})]}),i.jsx("pre",{className:"bg-muted p-3 rounded-md text-xs overflow-x-auto border",children:h})]}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center justify-between mb-2",children:[i.jsx("span",{className:"text-sm font-medium",children:"docker-compose.yml"}),i.jsx(Oe,{size:"sm",variant:"ghost",onClick:()=>f(p,"compose"),children:u==="compose"?i.jsxs(i.Fragment,{children:[i.jsx(Yt,{className:"h-4 w-4 mr-1 text-green-500"}),"Copied!"]}):i.jsxs(i.Fragment,{children:[i.jsx(Ti,{className:"h-4 w-4 mr-1"}),"Copy"]})})]}),i.jsx("pre",{className:"bg-muted p-3 rounded-md text-xs overflow-x-auto border",children:p})]}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center justify-between mb-2",children:[i.jsx("span",{className:"text-sm font-medium",children:"requirements.txt"}),i.jsx(Oe,{size:"sm",variant:"ghost",onClick:()=>f(g,"requirements"),children:u==="requirements"?i.jsxs(i.Fragment,{children:[i.jsx(Yt,{className:"h-4 w-4 mr-1 text-green-500"}),"Copied!"]}):i.jsxs(i.Fragment,{children:[i.jsx(Ti,{className:"h-4 w-4 mr-1"}),"Copy"]})})]}),i.jsx("pre",{className:"bg-muted p-3 rounded-md text-xs overflow-x-auto border",children:g})]}),i.jsxs("div",{className:"bg-blue-50 dark:bg-blue-950/50 border border-blue-200 dark:border-blue-800 rounded-md p-3",children:[i.jsx("h4",{className:"text-sm font-semibold mb-2",children:"Quick Start"}),i.jsxs("ol",{className:"text-xs space-y-1 list-decimal list-inside text-muted-foreground",children:[i.jsx("li",{children:"Save the files above to your project directory"}),i.jsxs("li",{children:["Build: ",i.jsxs("code",{className:"bg-muted px-1 rounded",children:["docker build -t ",o.toLowerCase(),"-agent ."]})]}),i.jsxs("li",{children:["Run: ",i.jsx("code",{className:"bg-muted px-1 rounded",children:"docker-compose up"})]}),i.jsx("li",{children:"Your agent is now running in a container!"})]})]}),i.jsxs("div",{className:"bg-amber-50 dark:bg-amber-950/50 border border-amber-200 dark:border-amber-800 rounded-md p-3",children:[i.jsx("h4",{className:"text-sm font-semibold mb-2 text-amber-900 dark:text-amber-100",children:"⚠️ Production Considerations"}),i.jsxs("ul",{className:"text-xs space-y-1 list-disc list-inside text-amber-800 dark:text-amber-200",children:[i.jsxs("li",{children:[i.jsx("strong",{children:"In-memory state:"})," Conversations are lost when container restarts"]}),i.jsxs("li",{children:[i.jsx("strong",{children:"No authentication:"})," Add reverse proxy (nginx, Caddy) with auth for production"]}),i.jsxs("li",{children:[i.jsx("strong",{children:"Security:"})," Use Azure Key Vault for secrets management"]}),i.jsxs("li",{children:[i.jsx("strong",{children:"Scaling:"})," Single instance only due to in-memory conversation store"]})]})]}),i.jsxs("div",{className:"border-t pt-4",children:[i.jsx("h4",{className:"font-semibold text-sm mb-3",children:"Pre-Deployment Checklist"}),i.jsxs("div",{className:"space-y-2 text-sm",children:[i.jsxs("div",{className:"flex items-start gap-2",children:[i.jsx(Yt,{className:"h-4 w-4 mt-0.5 text-muted-foreground flex-shrink-0"}),i.jsx("span",{className:"text-muted-foreground",children:"Set environment variables (API keys, secrets)"})]}),i.jsxs("div",{className:"flex items-start gap-2",children:[i.jsx(Yt,{className:"h-4 w-4 mt-0.5 text-muted-foreground flex-shrink-0"}),i.jsx("span",{className:"text-muted-foreground",children:"Test agent locally in container"})]}),i.jsxs("div",{className:"flex items-start gap-2",children:[i.jsx(Yt,{className:"h-4 w-4 mt-0.5 text-muted-foreground flex-shrink-0"}),i.jsx("span",{className:"text-muted-foreground",children:"Configure logging and monitoring"})]}),i.jsxs("div",{className:"flex items-start gap-2",children:[i.jsx(Yt,{className:"h-4 w-4 mt-0.5 text-muted-foreground flex-shrink-0"}),i.jsx("span",{className:"text-muted-foreground",children:"Set up error handling and retries"})]})]})]})]}),a==="azure"&&i.jsxs("div",{className:"space-y-4 pt-4",children:[i.jsxs("div",{children:[i.jsx("h3",{className:"font-semibold mb-2",children:"Deploy to Azure Container Apps"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"Azure Container Apps provides serverless containers with auto-scaling and integrated monitoring."})]}),i.jsxs("div",{className:"border rounded-lg p-4 space-y-3",children:[i.jsx("h4",{className:"font-medium text-sm",children:"Prerequisites"}),i.jsxs("ul",{className:"text-xs space-y-1 list-disc list-inside text-muted-foreground",children:[i.jsx("li",{children:"Azure subscription"}),i.jsxs("li",{children:["Azure CLI installed (",i.jsx("code",{className:"bg-muted px-1 rounded",children:"az --version"}),")"]}),i.jsx("li",{children:"Docker installed and running"}),i.jsxs("li",{children:["Logged in to Azure: ",i.jsx("code",{className:"bg-muted px-1 rounded",children:"az login"})]})]})]}),i.jsxs("div",{className:"space-y-3",children:[i.jsx("h4",{className:"font-medium text-sm",children:"Deployment Steps"}),i.jsxs("div",{className:"space-y-3",children:[i.jsxs("div",{className:"border-l-2 border-primary pl-3",children:[i.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[i.jsx("div",{className:"w-5 h-5 rounded-full bg-primary text-primary-foreground flex items-center justify-center text-xs font-bold",children:"1"}),i.jsx("h5",{className:"font-medium text-sm",children:"Create Azure Container Registry"})]}),i.jsx("pre",{className:"bg-muted p-2 rounded text-xs overflow-x-auto border mt-2",children:`# Create resource group
470
- az group create --name myResourceGroup --location eastus
471
-
472
- # Create container registry
473
- az acr create --resource-group myResourceGroup \\
474
- --name myregistry --sku Basic`})]}),i.jsxs("div",{className:"border-l-2 border-primary pl-3",children:[i.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[i.jsx("div",{className:"w-5 h-5 rounded-full bg-primary text-primary-foreground flex items-center justify-center text-xs font-bold",children:"2"}),i.jsx("h5",{className:"font-medium text-sm",children:"Build and Push Docker Image"})]}),i.jsx("pre",{className:"bg-muted p-2 rounded text-xs overflow-x-auto border mt-2",children:`# Build and push in one command
475
- az acr build --registry myregistry \\
476
- --image ${o.toLowerCase()}-agent:latest .`})]}),i.jsxs("div",{className:"border-l-2 border-primary pl-3",children:[i.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[i.jsx("div",{className:"w-5 h-5 rounded-full bg-primary text-primary-foreground flex items-center justify-center text-xs font-bold",children:"3"}),i.jsx("h5",{className:"font-medium text-sm",children:"Create Container Apps Environment"})]}),i.jsx("pre",{className:"bg-muted p-2 rounded text-xs overflow-x-auto border mt-2",children:`az containerapp env create --name myEnvironment \\
477
- --resource-group myResourceGroup \\
478
- --location eastus`})]}),i.jsxs("div",{className:"border-l-2 border-primary pl-3",children:[i.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[i.jsx("div",{className:"w-5 h-5 rounded-full bg-primary text-primary-foreground flex items-center justify-center text-xs font-bold",children:"4"}),i.jsx("h5",{className:"font-medium text-sm",children:"Deploy Container App"})]}),i.jsx("pre",{className:"bg-muted p-2 rounded text-xs overflow-x-auto border mt-2",children:`az containerapp create --name ${o.toLowerCase()}-app \\
479
- --resource-group myResourceGroup \\
480
- --environment myEnvironment \\
481
- --image myregistry.azurecr.io/${o.toLowerCase()}-agent:latest \\
482
- --target-port 8080 \\
483
- --ingress 'external' \\
484
- --registry-server myregistry.azurecr.io \\
485
- --env-vars OPENAI_API_KEY=secretref:openai-key OPENAI_CHAT_MODEL_ID=gpt-4o-mini`})]}),i.jsxs("div",{className:"border-l-2 border-primary pl-3",children:[i.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[i.jsx("div",{className:"w-5 h-5 rounded-full bg-primary text-primary-foreground flex items-center justify-center text-xs font-bold",children:"5"}),i.jsx("h5",{className:"font-medium text-sm",children:"Get Application URL"})]}),i.jsx("pre",{className:"bg-muted p-2 rounded text-xs overflow-x-auto border mt-2",children:`az containerapp show --name ${o.toLowerCase()}-app \\
486
- --resource-group myResourceGroup \\
487
- --query properties.configuration.ingress.fqdn`})]})]})]}),i.jsxs("div",{className:"bg-blue-50 dark:bg-blue-950/50 border border-blue-200 dark:border-blue-800 rounded-md p-3",children:[i.jsx("h4",{className:"text-sm font-semibold mb-2",children:"Learn More"}),i.jsx("p",{className:"text-xs text-muted-foreground mb-3",children:"Explore Azure Container Apps documentation for advanced features like scaling, monitoring, and CI/CD integration."}),i.jsx(Oe,{size:"sm",variant:"outline",className:"w-full",asChild:!0,children:i.jsxs("a",{href:"https://learn.microsoft.com/azure/container-apps/",target:"_blank",rel:"noopener noreferrer",children:[i.jsx(mp,{className:"h-3 w-3 mr-1"}),"View Azure Container Apps Documentation"]})})]})]})]})})})]})})}function y5({className:e,...r}){return i.jsx("div",{"data-slot":"card",className:qe("bg-card text-card-foreground flex flex-col gap-6 rounded border py-6 shadow-sm",e),...r})}function b5({className:e,...r}){return i.jsx("div",{"data-slot":"card-header",className:qe("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...r})}function e2({className:e,...r}){return i.jsx("div",{"data-slot":"card-title",className:qe("leading-none font-semibold",e),...r})}function w5({className:e,...r}){return i.jsx("div",{"data-slot":"card-description",className:qe("text-muted-foreground text-sm",e),...r})}function N5({className:e,...r}){return i.jsx("div",{"data-slot":"card-content",className:qe("px-6",e),...r})}function S5({className:e,...r}){return i.jsx("div",{"data-slot":"card-footer",className:qe("flex items-center px-6 [.border-t]:pt-6",e),...r})}const lo=[{id:"foundry-weather-agent",name:"Azure AI Weather Agent",description:"Weather agent using Azure AI Agent (Foundry) with Azure CLI authentication",type:"agent",url:"https://raw.githubusercontent.com/microsoft/agent-framework/main/python/samples/getting_started/devui/foundry_agent/agent.py",tags:["azure-ai","foundry","tools"],author:"Microsoft",difficulty:"beginner",features:["Azure AI Agent integration","Azure CLI authentication","Mock weather tools"],requiredEnvVars:[{name:"AZURE_AI_PROJECT_ENDPOINT",description:"Azure AI Foundry project endpoint URL",required:!0,example:"https://your-project.api.azureml.ms"},{name:"FOUNDRY_MODEL_DEPLOYMENT_NAME",description:"Name of the deployed model in Azure AI Foundry",required:!0,example:"gpt-4o"}]},{id:"weather-agent-azure",name:"Azure OpenAI Weather Agent",description:"Weather agent using Azure OpenAI with API key authentication",type:"agent",url:"https://raw.githubusercontent.com/microsoft/agent-framework/main/python/samples/getting_started/devui/weather_agent_azure/agent.py",tags:["azure","openai","tools"],author:"Microsoft",difficulty:"beginner",features:["Azure OpenAI integration","API key authentication","Function calling","Mock weather tools"],requiredEnvVars:[{name:"AZURE_OPENAI_API_KEY",description:"Azure OpenAI API key",required:!0},{name:"AZURE_OPENAI_CHAT_DEPLOYMENT_NAME",description:"Name of the deployed model in Azure OpenAI",required:!0,example:"gpt-4o"},{name:"AZURE_OPENAI_ENDPOINT",description:"Azure OpenAI endpoint URL",required:!0,example:"https://your-resource.openai.azure.com"}]},{id:"spam-workflow",name:"Spam Detection Workflow",description:"5-step workflow demonstrating email spam detection with branching logic",type:"workflow",url:"https://raw.githubusercontent.com/microsoft/agent-framework/main/python/samples/getting_started/devui/spam_workflow/workflow.py",tags:["workflow","branching","multi-step"],author:"Microsoft",difficulty:"beginner",features:["Sequential execution","Conditional branching","Mock spam detection"]},{id:"fanout-workflow",name:"Complex Fan-In/Fan-Out Workflow",description:"Advanced data processing workflow with parallel validation, transformation, and quality assurance stages",type:"workflow",url:"https://raw.githubusercontent.com/microsoft/agent-framework/main/python/samples/getting_started/devui/fanout_workflow/workflow.py",tags:["workflow","fan-out","fan-in","parallel"],author:"Microsoft",difficulty:"advanced",features:["Fan-out pattern","Parallel execution","Complex state management","Multi-stage processing"]}];lo.filter(e=>e.type==="agent"),lo.filter(e=>e.type==="workflow"),lo.filter(e=>e.difficulty==="beginner"),lo.filter(e=>e.difficulty==="intermediate"),lo.filter(e=>e.difficulty==="advanced");const E5=e=>{switch(e){case"beginner":return"bg-green-100 text-green-700 border-green-200";case"intermediate":return"bg-yellow-100 text-yellow-700 border-yellow-200";case"advanced":return"bg-red-100 text-red-700 border-red-200";default:return"bg-gray-100 text-gray-700 border-gray-200"}},t2=N.forwardRef(({className:e,...r},o)=>i.jsx("div",{ref:o,role:"alert",className:qe("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",e),...r}));t2.displayName="Alert";const n2=N.forwardRef(({className:e,...r},o)=>i.jsx("h5",{ref:o,className:qe("mb-1 font-medium leading-none tracking-tight",e),...r}));n2.displayName="AlertTitle";const r2=N.forwardRef(({className:e,...r},o)=>i.jsx("div",{ref:o,className:qe("text-sm [&_p]:leading-relaxed",e),...r}));r2.displayName="AlertDescription";function o2({children:e,copyable:r=!1}){const[o,a]=N.useState(!1),l=()=>{navigator.clipboard.writeText(e),a(!0),setTimeout(()=>a(!1),2e3)};return i.jsxs("div",{className:"relative",children:[i.jsx("pre",{className:"bg-muted p-3 rounded-md text-sm overflow-x-auto font-mono",children:i.jsx("code",{children:e})}),r&&i.jsx(Oe,{variant:"ghost",size:"sm",className:"absolute top-2 right-2 h-6 w-6 p-0",onClick:l,children:o?i.jsx(Pu,{className:"h-3 w-3"}):i.jsx(Ti,{className:"h-3 w-3"})})]})}function Ic({number:e,title:r,description:o,code:a,action:l,copyable:u=!1}){return i.jsxs("div",{className:"flex gap-4",children:[i.jsx("div",{className:"flex-shrink-0",children:i.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-full bg-primary text-primary-foreground font-semibold",children:e})}),i.jsxs("div",{className:"flex-1 space-y-2",children:[i.jsx("h4",{className:"font-semibold",children:r}),o&&i.jsx("p",{className:"text-sm text-muted-foreground",children:o}),a&&i.jsx(o2,{copyable:u,children:a}),l&&i.jsx("div",{children:l})]})]})}function _5({sample:e,open:r,onOpenChange:o}){const a=e.requiredEnvVars&&e.requiredEnvVars.length>0,l=a?0:-1;return i.jsx(Sr,{open:r,onOpenChange:o,children:i.jsxs(Er,{className:"max-w-3xl",children:[i.jsxs(_r,{className:"px-6 pt-6 pb-2",children:[i.jsxs(jr,{children:["Setup: ",e.name]}),i.jsxs(h5,{children:["Follow these steps to run this sample ",e.type," locally"]})]}),i.jsx("div",{className:"px-6 pb-6",children:i.jsx(ta,{className:"h-[500px]",children:i.jsxs("div",{className:"space-y-6 pr-4",children:[i.jsx(Ic,{number:1,title:"Download the sample file",action:i.jsx(Oe,{asChild:!0,size:"sm",children:i.jsxs("a",{href:e.url,download:`${e.id}.py`,target:"_blank",rel:"noopener noreferrer",children:[i.jsx(mu,{className:"h-4 w-4 mr-2"}),"Download ",e.id,".py"]})})}),i.jsx(Ic,{number:2,title:"Create a project folder",description:"Create a dedicated folder for this sample and move the downloaded file there:",code:`mkdir -p ~/my-agents/${e.id}
488
- mv ~/Downloads/${e.id}.py ~/my-agents/${e.id}/`,copyable:!0}),a&&i.jsx(Ic,{number:3,title:"Set up environment variables",description:"Create a .env file in the project folder with these required variables:",code:e.requiredEnvVars.map(u=>`${u.name}=${u.example||"your-value-here"}
489
- # ${u.description}`).join(`
490
-
491
- `),copyable:!0}),i.jsx(Ic,{number:4+l,title:"Run with DevUI",description:"Navigate to the folder and start DevUI:",code:`cd ~/my-agents/${e.id}
492
- devui .`,copyable:!0}),i.jsxs(t2,{children:[i.jsx(LA,{className:"h-4 w-4"}),i.jsx(n2,{children:"Alternative: Run Programmatically"}),i.jsxs(r2,{className:"mt-2",children:[i.jsxs("p",{className:"mb-2",children:["You can also run the ",e.type," directly in Python:"]}),i.jsx(o2,{copyable:!0,children:`from ${e.id} import ${e.type}
493
- import asyncio
494
-
495
- async def main():
496
- response = await ${e.type}.run("Hello!")
497
- print(response)
498
-
499
- asyncio.run(main())`})]})]}),i.jsxs("div",{className:"flex gap-2 pt-4 border-t",children:[i.jsx(Oe,{variant:"outline",size:"sm",asChild:!0,children:i.jsxs("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",children:[i.jsx(mp,{className:"h-4 w-4 mr-2"}),"View Source"]})}),i.jsx(Oe,{variant:"outline",size:"sm",asChild:!0,children:i.jsxs("a",{href:"https://github.com/microsoft/agent-framework#readme",target:"_blank",rel:"noopener noreferrer",children:[i.jsx(f1,{className:"h-4 w-4 mr-2"}),"Documentation"]})})]})]})})})]})})}function j5({sample:e}){const[r,o]=N.useState(!1),a=e.type==="workflow"?Go:qn;return i.jsxs(i.Fragment,{children:[i.jsxs(y5,{className:"hover:shadow-md transition-shadow duration-200 h-full flex flex-col overflow-hidden w-full",children:[i.jsxs(b5,{className:"pb-3 min-w-0",children:[i.jsxs("div",{className:"flex items-start justify-between mb-2",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(a,{className:"h-5 w-5"}),i.jsx(Pn,{variant:"secondary",className:"text-xs",children:e.type})]}),i.jsx(Pn,{variant:"outline",className:qe("text-xs border",E5(e.difficulty)),children:e.difficulty})]}),i.jsx(e2,{className:"text-lg leading-tight",children:e.name}),i.jsx(w5,{className:"text-sm line-clamp-3",children:e.description})]}),i.jsx(N5,{className:"pt-0 flex-1 min-w-0 overflow-hidden",children:i.jsxs("div",{className:"space-y-3 min-w-0",children:[i.jsxs("div",{className:"flex flex-wrap gap-1",children:[e.tags.slice(0,3).map(l=>i.jsx(Pn,{variant:"outline",className:"text-xs",children:l},l)),e.tags.length>3&&i.jsxs(Pn,{variant:"outline",className:"text-xs",children:["+",e.tags.length-3]})]}),e.requiredEnvVars&&e.requiredEnvVars.length>0&&i.jsxs("details",{className:"group min-w-0 max-w-full overflow-hidden",children:[i.jsxs("summary",{className:"cursor-pointer list-none p-2 bg-amber-50 dark:bg-amber-950/20 border border-amber-200 dark:border-amber-800 rounded-md hover:bg-amber-100 dark:hover:bg-amber-950/30 transition-colors flex items-center justify-between gap-2",children:[i.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[i.jsx(OA,{className:"h-3.5 w-3.5 text-amber-600 dark:text-amber-500 flex-shrink-0"}),i.jsxs("span",{className:"text-xs font-medium text-amber-900 dark:text-amber-100 truncate",children:["Requires ",e.requiredEnvVars.length," env var",e.requiredEnvVars.length>1?"s":""]})]}),i.jsx(kn,{className:"h-3 w-3 text-amber-600 dark:text-amber-500 flex-shrink-0 group-open:rotate-180 transition-transform"})]}),i.jsx("div",{className:"mt-2 p-2 bg-amber-50 dark:bg-amber-950/20 border border-amber-200 dark:border-amber-800 rounded-md space-y-2 min-w-0 max-w-full overflow-hidden",children:e.requiredEnvVars.map(l=>i.jsxs("div",{className:"text-xs min-w-0 max-w-full overflow-hidden",children:[i.jsx("div",{className:"font-mono font-medium text-amber-900 dark:text-amber-100 break-words",children:l.name}),i.jsx("div",{className:"text-amber-700 dark:text-amber-300 mt-0.5 break-words",children:l.description}),l.example&&i.jsx("div",{className:"font-mono text-amber-600 dark:text-amber-400 mt-0.5 break-all",children:l.example})]},l.name))})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-xs font-medium text-muted-foreground",children:"Key Features:"}),i.jsx("ul",{className:"text-xs space-y-1",children:e.features.slice(0,3).map(l=>i.jsxs("li",{className:"flex items-center gap-1",children:[i.jsx("div",{className:"w-1 h-1 rounded-full bg-current opacity-50"}),i.jsx("span",{children:l})]},l))})]})]})}),i.jsxs(S5,{className:"pt-3 flex-col gap-3",children:[i.jsx("div",{className:"w-full flex items-center justify-between text-xs text-muted-foreground",children:i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx(w1,{className:"h-3 w-3"}),i.jsx("span",{children:e.author})]})}),i.jsxs("div",{className:"w-full flex gap-2",children:[i.jsx(Oe,{asChild:!0,className:"flex-1",size:"sm",children:i.jsxs("a",{href:e.url,download:`${e.id}.py`,target:"_blank",rel:"noopener noreferrer",children:[i.jsx(mu,{className:"h-4 w-4 mr-2"}),"Download"]})}),i.jsxs(Oe,{variant:"outline",className:"flex-1",size:"sm",onClick:()=>o(!0),children:[i.jsx(f1,{className:"h-4 w-4 mr-2"}),"Setup Guide"]})]})]})]}),i.jsx(_5,{sample:e,open:r,onOpenChange:o})]})}function qm({samples:e}){return i.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4",children:e.map(r=>i.jsx("div",{className:"min-w-0",children:i.jsx(j5,{sample:r})},r.id))})}function hy({onClose:e,variant:r="inline",hasExistingEntities:o=!1}){return r==="inline"?i.jsx("div",{className:"flex-1 overflow-auto",children:i.jsxs("div",{className:"max-w-7xl mx-auto px-6 py-8",children:[i.jsx("div",{className:"mb-8 p-4 bg-muted/50 border border-border rounded-lg",children:i.jsxs("div",{className:"flex items-start gap-3",children:[i.jsx(vM,{className:"h-5 w-5 text-amber-500 flex-shrink-0 mt-0.5"}),i.jsxs("div",{className:"flex-1",children:[i.jsx("h3",{className:"font-semibold mb-1",children:"No agents or workflows configured yet!"}),i.jsxs("p",{className:"text-sm text-muted-foreground mb-2",children:["You can configure agents or workflows by running"," ",i.jsx("code",{className:"px-1.5 py-0.5 bg-background rounded text-xs",children:"devui"})," ","in a directory containing them."]}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"Browse the sample agents and workflows below. Download them, review the code, and run them locally to get started quickly."})]})]})}),i.jsxs("div",{className:"mb-6",children:[i.jsx("h3",{className:"text-lg font-semibold mb-4",children:"Sample Gallery"}),i.jsx(qm,{samples:lo})]}),i.jsx("div",{className:"text-center mt-12 pt-8 border-t",children:i.jsxs("p",{className:"text-sm text-muted-foreground",children:["Want to create your own agents or workflows? Check out the"," ",i.jsx("a",{href:"https://github.com/microsoft/agent-framework",className:"text-primary hover:underline",target:"_blank",rel:"noopener noreferrer",children:"documentation"})]})})]})}):r==="route"?i.jsx("div",{className:"h-full overflow-auto",children:i.jsxs("div",{className:"max-w-7xl mx-auto px-6 py-8",children:[i.jsxs("div",{className:"mb-8",children:[o&&i.jsx("div",{className:"mb-4",children:i.jsxs(Oe,{variant:"ghost",onClick:e,className:"gap-2",children:[i.jsx(Zk,{className:"h-4 w-4"}),"Back"]})}),i.jsxs("div",{className:"text-center",children:[i.jsx("h2",{className:"text-2xl font-semibold mb-2",children:"Sample Gallery"}),i.jsx("p",{className:"text-muted-foreground max-w-2xl mx-auto",children:"Browse sample agents and workflows to learn the Agent Framework. Download these curated examples and run them locally. Examples range from beginner to advanced."})]})]}),i.jsx(qm,{samples:lo}),i.jsx("div",{className:"text-center mt-12 pt-8 border-t",children:i.jsxs("p",{className:"text-sm text-muted-foreground",children:["Want to create your own agents or workflows? Check out the"," ",i.jsx("a",{href:"https://github.com/microsoft/agent-framework",className:"text-primary hover:underline",target:"_blank",rel:"noopener noreferrer",children:"documentation"})]})})]})}):i.jsx(qm,{samples:lo})}function eu({className:e,...r}){return i.jsx("textarea",{"data-slot":"textarea",className:qe("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),...r})}function C5({onFilesSelected:e,accept:r="image/*,.pdf,audio/*,.wav,.mp3,.m4a,.ogg",multiple:o=!0,maxSize:a=50*1024*1024,disabled:l=!1,className:u=""}){const d=N.useRef(null),f=v=>{if(!v||v.length===0)return;const b=[],S=[];Array.from(v).forEach(w=>{if(w.size>a){S.push(`${w.name} is too large (max ${k5(a)})`);return}if(r&&!A5(w,r)){S.push(`${w.name} is not an accepted file type`);return}b.push(w)}),S.length>0&&console.warn("File upload errors:",S),b.length>0&&e(b)},h=()=>{d.current&&d.current.click()},p=v=>{f(v.target.files),v.target.value=""},g=v=>{if(v.preventDefault(),v.stopPropagation(),l)return;const b=v.dataTransfer.files;f(b)},y=v=>{v.preventDefault(),v.stopPropagation()};return i.jsxs("div",{className:u,children:[i.jsx("input",{ref:d,type:"file",accept:r,multiple:o,onChange:p,className:"hidden",disabled:l}),i.jsx(Oe,{type:"button",variant:"outline",size:"icon",onClick:h,disabled:l,onDrop:g,onDragOver:y,className:"shrink-0 transition-colors hover:bg-muted",title:"Upload files (images, PDFs, audio)",children:i.jsx(bM,{className:"h-4 w-4"})})]})}function k5(e){if(e===0)return"0 Bytes";const r=1024,o=["Bytes","KB","MB","GB"],a=Math.floor(Math.log(e)/Math.log(r));return parseFloat((e/Math.pow(r,a)).toFixed(2))+" "+o[a]}function A5(e,r){return r.split(",").map(a=>a.trim()).some(a=>{if(a.startsWith("."))return e.name.toLowerCase().endsWith(a.toLowerCase());if(a.includes("/*")){const[l]=a.split("/");return e.type.startsWith(l+"/")}else return e.type===a})}function M5({attachments:e,onRemoveAttachment:r,className:o=""}){return e.length===0?null:i.jsx("div",{className:`flex flex-wrap gap-2 p-2 bg-muted rounded-lg ${o}`,children:e.map(a=>i.jsx(T5,{attachment:a,onRemove:()=>r(a.id)},a.id))})}function T5({attachment:e,onRemove:r}){const[o,a]=N.useState(!1),l=()=>{switch(e.type){case"image":return e.preview?i.jsx("img",{src:e.preview,alt:e.file.name,className:"w-full h-full object-cover"}):i.jsx("div",{className:"flex items-center justify-center w-full h-full bg-gray-200",children:i.jsx(TA,{className:"h-6 w-6 text-gray-400"})});case"pdf":return i.jsxs("div",{className:"flex flex-col items-center justify-center w-full h-full bg-red-50",children:[i.jsx(Yo,{className:"h-6 w-6 text-red-500 mb-1"}),i.jsx("span",{className:"text-xs text-red-600",children:"PDF"})]});case"audio":return i.jsxs("div",{className:"flex flex-col items-center justify-center w-full h-full bg-purple-50",children:[i.jsx(x1,{className:"h-6 w-6 text-purple-500 mb-1"}),i.jsx("span",{className:"text-xs text-purple-600",children:"AUDIO"})]});default:return i.jsxs("div",{className:"flex flex-col items-center justify-center w-full h-full bg-gray-100",children:[i.jsx(Yo,{className:"h-6 w-6 text-gray-500 mb-1"}),i.jsx("span",{className:"text-xs text-gray-600",children:"FILE"})]})}};return i.jsxs("div",{className:"relative w-16 h-16 rounded border overflow-hidden group cursor-pointer",onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),title:e.file.name,children:[l(),i.jsx("div",{className:`absolute inset-0 bg-black/60 flex items-center justify-center transition-all duration-200 ease-in-out ${o?"opacity-100 backdrop-blur-sm":"opacity-0 pointer-events-none"}`,onClick:r,children:i.jsx("div",{className:`transition-all duration-200 ease-in-out ${o?"scale-100 opacity-100":"scale-75 opacity-0"}`,children:i.jsx(b1,{className:"h-5 w-5 text-white drop-shadow-lg"})})}),i.jsx("div",{className:"absolute bottom-0 left-0 right-0 bg-black bg-opacity-75 text-white text-xs p-1 truncate opacity-0 group-hover:opacity-100 transition-opacity duration-200",children:e.file.name})]})}function R5({code:e,language:r}){const[o,a]=N.useState(!1),l=async()=>{try{await navigator.clipboard.writeText(e),a(!0),setTimeout(()=>a(!1),2e3)}catch(u){console.error("Failed to copy code:",u)}};return i.jsxs("div",{className:"relative group",children:[i.jsx("pre",{className:"my-3 p-3 bg-foreground/5 dark:bg-foreground/10 rounded overflow-x-auto border border-foreground/10",children:i.jsxs("code",{className:"text-xs font-mono block whitespace-pre-wrap break-words",children:[r&&i.jsx("span",{className:"opacity-60 text-[10px] mb-1 block uppercase",children:r}),e]})}),i.jsx("button",{onClick:l,className:`absolute top-2 right-2 p-1.5 rounded-md border shadow-sm
500
- bg-background hover:bg-accent
501
- text-muted-foreground hover:text-foreground
502
- transition-all duration-200
503
- opacity-0 group-hover:opacity-100`,title:o?"Copied!":"Copy code",children:o?i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-green-600 dark:text-green-400",children:i.jsx("polyline",{points:"20 6 9 17 4 12"})}):i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[i.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),i.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})})]})}function D5({content:e,className:r=""}){const o=e.split(`
504
- `),a=[];let l=0;for(;l<o.length;){const u=o[l];if(u.trim().startsWith("```")){const f=[],p=u.trim().match(/^```(\w+)?/)?.[1]||"";for(l++;l<o.length&&!o[l].trim().startsWith("```");)f.push(o[l]),l++;l++,a.push(i.jsx(R5,{code:f.join(`
505
- `),language:p},a.length));continue}const d=u.match(/^(#{1,6})\s+(.+)$/);if(d){const f=d[1].length,h=d[2],g=`${["text-2xl","text-xl","text-lg","text-base","text-sm","text-sm"][f-1]} font-semibold mt-4 mb-2 first:mt-0 break-words`,y=f===1?i.jsx("h1",{className:g,children:nn(h)},a.length):f===2?i.jsx("h2",{className:g,children:nn(h)},a.length):f===3?i.jsx("h3",{className:g,children:nn(h)},a.length):f===4?i.jsx("h4",{className:g,children:nn(h)},a.length):f===5?i.jsx("h5",{className:g,children:nn(h)},a.length):i.jsx("h6",{className:g,children:nn(h)},a.length);a.push(y),l++;continue}if(u.match(/^[\s]*[-*+]\s+/)){const f=[];for(;l<o.length&&o[l].match(/^[\s]*[-*+]\s+/);){const h=o[l].replace(/^[\s]*[-*+]\s+/,"");f.push(h),l++}a.push(i.jsx("ul",{className:"my-2 ml-4 list-disc space-y-1 break-words",children:f.map((h,p)=>i.jsx("li",{className:"text-sm break-words",children:nn(h)},p))},a.length));continue}if(u.match(/^[\s]*\d+\.\s+/)){const f=[];for(;l<o.length&&o[l].match(/^[\s]*\d+\.\s+/);){const h=o[l].replace(/^[\s]*\d+\.\s+/,"");f.push(h),l++}a.push(i.jsx("ol",{className:"my-2 ml-4 list-decimal space-y-1 break-words",children:f.map((h,p)=>i.jsx("li",{className:"text-sm break-words",children:nn(h)},p))},a.length));continue}if(u.trim().startsWith("|")&&u.trim().endsWith("|")){const f=[];for(;l<o.length&&o[l].trim().startsWith("|")&&o[l].trim().endsWith("|");)f.push(o[l].trim()),l++;if(f.length>=2){const h=f[0].split("|").slice(1,-1).map(g=>g.trim());if(f[1].match(/^\|[\s\-:|]+\|$/)){const g=f.slice(2).map(y=>y.split("|").slice(1,-1).map(v=>v.trim()));a.push(i.jsx("div",{className:"my-3 overflow-x-auto",children:i.jsxs("table",{className:"min-w-full border border-foreground/10 text-sm",children:[i.jsx("thead",{className:"bg-foreground/5",children:i.jsx("tr",{children:h.map((y,v)=>i.jsx("th",{className:"border-b border-foreground/10 px-3 py-2 text-left font-semibold break-words",children:nn(y)},v))})}),i.jsx("tbody",{children:g.map((y,v)=>i.jsx("tr",{className:"border-b border-foreground/5 last:border-b-0",children:y.map((b,S)=>i.jsx("td",{className:"px-3 py-2 border-r border-foreground/5 last:border-r-0 break-words",children:nn(b)},S))},v))})]})},a.length));continue}}for(const h of f)a.push(i.jsx("p",{className:"my-1",children:nn(h)},a.length));continue}if(u.trim().startsWith(">")){const f=[];for(;l<o.length&&o[l].trim().startsWith(">");)f.push(o[l].replace(/^>\s?/,"")),l++;a.push(i.jsx("blockquote",{className:"my-2 pl-4 border-l-4 border-current/30 opacity-80 italic break-words",children:f.map((h,p)=>i.jsx("div",{className:"break-words",children:nn(h)},p))},a.length));continue}if(u.match(/^[\s]*[-*_]{3,}[\s]*$/)){a.push(i.jsx("hr",{className:"my-4 border-t border-border"},a.length)),l++;continue}if(u.trim()===""){a.push(i.jsx("div",{className:"h-2"},a.length)),l++;continue}a.push(i.jsx("p",{className:"my-1 break-words",children:nn(u)},a.length)),l++}return i.jsx("div",{className:`markdown-content break-words ${r}`,children:a})}function nn(e){const r=[];let o=e,a=0;for(;o.length>0;){const l=o.match(/`([^`]+)`/);if(l&&l.index!==void 0){l.index>0&&r.push(i.jsx("span",{children:Ri(o.slice(0,l.index))},a++)),r.push(i.jsx("code",{className:"px-1.5 py-0.5 bg-foreground/10 rounded text-xs font-mono border border-foreground/20",children:l[1]},a++)),o=o.slice(l.index+l[0].length);continue}r.push(i.jsx("span",{children:Ri(o)},a++));break}return r}function Ri(e){const r=[];let o=e,a=0;for(;o.length>0;){const l=[{regex:/\*\*\[([^\]]+)\]\(([^)]+)\)\*\*/,component:"strong-link"},{regex:/__\[([^\]]+)\]\(([^)]+)\)__/,component:"strong-link"},{regex:/\*\[([^\]]+)\]\(([^)]+)\)\*/,component:"em-link"},{regex:/_\[([^\]]+)\]\(([^)]+)\)_/,component:"em-link"},{regex:/\[([^\]]+)\]\(([^)]+)\)/,component:"link"},{regex:/\*\*(.+?)\*\*/,component:"strong"},{regex:/__(.+?)__/,component:"strong"},{regex:/\*(.+?)\*/,component:"em"},{regex:/_(.+?)_/,component:"em"}];let u=!1;for(const d of l){const f=o.match(d.regex);if(f&&f.index!==void 0){if(f.index>0&&r.push(o.slice(0,f.index)),d.component==="strong")r.push(i.jsx("strong",{className:"font-semibold",children:f[1]},a++));else if(d.component==="em")r.push(i.jsx("em",{className:"italic",children:f[1]},a++));else if(d.component==="strong-link"){const h=f[1],p=f[2],g=Ri(h);r.push(i.jsx("strong",{className:"font-semibold",children:i.jsx("a",{href:p,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline break-words",children:g})},a++))}else if(d.component==="em-link"){const h=f[1],p=f[2],g=Ri(h);r.push(i.jsx("em",{className:"italic",children:i.jsx("a",{href:p,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline break-words",children:g})},a++))}else if(d.component==="link"){const h=f[1],p=f[2],g=Ri(h);r.push(i.jsx("a",{href:p,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline break-words",children:g},a++))}o=o.slice(f.index+f[0].length),u=!0;break}}if(!u){o.length>0&&r.push(o);break}}return r}function O5({content:e,className:r,isStreaming:o}){if(e.type!=="text")return null;const a=e.text;return i.jsxs("div",{className:`break-words ${r||""}`,children:[i.jsx(D5,{content:a}),o&&a.length>0&&i.jsx("span",{className:"ml-1 inline-block h-2 w-2 animate-pulse rounded-full bg-current"})]})}function z5({content:e,className:r}){const[o,a]=N.useState(!1),[l,u]=N.useState(!1);if(e.type!=="input_image")return null;const d=e.image_url;return o?i.jsx("div",{className:`my-2 p-3 border rounded-lg bg-muted ${r||""}`,children:i.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[i.jsx(Yo,{className:"h-4 w-4"}),i.jsx("span",{children:"Image could not be loaded"})]})}):i.jsxs("div",{className:`my-2 ${r||""}`,children:[i.jsx("img",{src:d,alt:"Uploaded image",className:`rounded-lg border max-w-full transition-all cursor-pointer ${l?"max-h-none":"max-h-64"}`,onClick:()=>u(!l),onError:()=>a(!0)}),l&&i.jsx("div",{className:"text-xs text-muted-foreground mt-1",children:"Click to collapse"})]})}function L5({content:e,className:r}){if(e.type!=="input_file")return null;const o=e.file_url||e.file_data,a=e.filename||"file",l=a?.toLowerCase().endsWith(".pdf")||o?.includes("application/pdf"),u=a?.toLowerCase().match(/\.(mp3|wav|m4a|ogg|flac|aac)$/);return l&&o?i.jsxs("div",{className:`my-2 ${r||""}`,children:[i.jsx("div",{className:"border rounded-lg overflow-hidden",children:i.jsx("iframe",{src:o,className:"w-full h-96",title:a})}),i.jsxs("div",{className:"flex items-center gap-2 mt-2",children:[i.jsx(Yo,{className:"h-4 w-4 text-muted-foreground"}),i.jsx("span",{className:"text-sm text-muted-foreground",children:a}),o&&i.jsxs("a",{href:o,download:a,className:"ml-auto text-xs text-primary hover:underline flex items-center gap-1",children:[i.jsx(mu,{className:"h-3 w-3"}),"Download"]})]})]}):u&&o?i.jsxs("div",{className:`my-2 p-3 border rounded-lg ${r||""}`,children:[i.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[i.jsx(x1,{className:"h-4 w-4 text-muted-foreground"}),i.jsx("span",{className:"text-sm font-medium",children:a})]}),i.jsxs("audio",{controls:!0,className:"w-full",children:[i.jsx("source",{src:o}),"Your browser does not support audio playback."]})]}):i.jsx("div",{className:`my-2 p-3 border rounded-lg bg-muted ${r||""}`,children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(Yo,{className:"h-4 w-4 text-muted-foreground"}),i.jsx("span",{className:"text-sm",children:a})]}),o&&i.jsxs("a",{href:o,download:a,className:"text-xs text-primary hover:underline flex items-center gap-1",children:[i.jsx(mu,{className:"h-3 w-3"}),"Download"]})]})})}function I5({content:e,className:r,isStreaming:o}){switch(e.type){case"text":return i.jsx(O5,{content:e,className:r,isStreaming:o});case"input_image":return i.jsx(z5,{content:e,className:r});case"input_file":return i.jsx(L5,{content:e,className:r});default:return null}}function H5({name:e,arguments:r,className:o}){const[a,l]=N.useState(!1);let u;try{u=typeof r=="string"?JSON.parse(r):r}catch{u=r}return i.jsxs("div",{className:`my-2 p-3 border rounded bg-blue-50 dark:bg-blue-950/20 ${o||""}`,children:[i.jsxs("div",{className:"flex items-center gap-2 cursor-pointer",onClick:()=>l(!a),children:[i.jsx(m1,{className:"h-4 w-4 text-blue-600 dark:text-blue-400"}),i.jsxs("span",{className:"text-sm font-medium text-blue-800 dark:text-blue-300",children:["Function Call: ",e]}),a?i.jsx(kn,{className:"h-4 w-4 text-blue-600 dark:text-blue-400 ml-auto"}):i.jsx($u,{className:"h-4 w-4 text-blue-600 dark:text-blue-400 ml-auto"})]}),a&&i.jsxs("div",{className:"mt-2 text-xs font-mono bg-white dark:bg-gray-900 p-2 rounded border",children:[i.jsx("div",{className:"text-blue-600 dark:text-blue-400 mb-1",children:"Arguments:"}),i.jsx("pre",{className:"whitespace-pre-wrap",children:JSON.stringify(u,null,2)})]})]})}function B5({output:e,call_id:r,className:o}){const[a,l]=N.useState(!1);let u;try{u=typeof e=="string"?JSON.parse(e):e}catch{u=e}return i.jsxs("div",{className:`my-2 p-3 border rounded bg-green-50 dark:bg-green-950/20 ${o||""}`,children:[i.jsxs("div",{className:"flex items-center gap-2 cursor-pointer",onClick:()=>l(!a),children:[i.jsx(m1,{className:"h-4 w-4 text-green-600 dark:text-green-400"}),i.jsx("span",{className:"text-sm font-medium text-green-800 dark:text-green-300",children:"Function Result"}),a?i.jsx(kn,{className:"h-4 w-4 text-green-600 dark:text-green-400 ml-auto"}):i.jsx($u,{className:"h-4 w-4 text-green-600 dark:text-green-400 ml-auto"})]}),a&&i.jsxs("div",{className:"mt-2 text-xs font-mono bg-white dark:bg-gray-900 p-2 rounded border",children:[i.jsx("div",{className:"text-green-600 dark:text-green-400 mb-1",children:"Output:"}),i.jsx("pre",{className:"whitespace-pre-wrap",children:JSON.stringify(u,null,2)}),i.jsxs("div",{className:"text-gray-500 text-[10px] mt-2",children:["Call ID: ",r]})]})]})}function py({item:e,className:r}){if(e.type==="message"){const o=e.status==="in_progress",a=e.content.length>0;return i.jsxs("div",{className:r,children:[e.content.map((l,u)=>i.jsx(I5,{content:l,className:u>0?"mt-2":"",isStreaming:o},u)),o&&!a&&i.jsx("div",{className:"flex items-center space-x-1",children:i.jsxs("div",{className:"flex space-x-1",children:[i.jsx("div",{className:"h-2 w-2 animate-bounce rounded-full bg-current [animation-delay:-0.3s]"}),i.jsx("div",{className:"h-2 w-2 animate-bounce rounded-full bg-current [animation-delay:-0.15s]"}),i.jsx("div",{className:"h-2 w-2 animate-bounce rounded-full bg-current"})]})})]})}return e.type==="function_call"?i.jsx(H5,{name:e.name,arguments:e.arguments,className:r}):e.type==="function_call_output"?i.jsx(B5,{output:e.output,call_id:e.call_id,className:r}):null}function a2(e){const r=N.useRef({value:e,previous:e});return N.useMemo(()=>(r.current.value!==e&&(r.current.previous=r.current.value,r.current.value=e),r.current.previous),[e])}var s2=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"}),U5="VisuallyHidden",P5=N.forwardRef((e,r)=>i.jsx(ze.span,{...e,ref:r,style:{...s2,...e.style}}));P5.displayName=U5;var $5=[" ","Enter","ArrowUp","ArrowDown"],V5=[" ","Enter"],Fo="Select",[Zu,Ku,q5]=Gh(Fo),[ps,S7]=kr(Fo,[q5,zu]),Wu=zu(),[Y5,po]=ps(Fo),[G5,X5]=ps(Fo),i2=e=>{const{__scopeSelect:r,children:o,open:a,defaultOpen:l,onOpenChange:u,value:d,defaultValue:f,onValueChange:h,dir:p,name:g,autoComplete:y,disabled:v,required:b,form:S}=e,w=Wu(r),[j,k]=N.useState(null),[M,_]=N.useState(null),[A,D]=N.useState(!1),L=Ji(p),[H,B]=Ja({prop:a,defaultProp:l??!1,onChange:u,caller:Fo}),[q,Z]=Ja({prop:d,defaultProp:f,onChange:h,caller:Fo}),K=N.useRef(null),G=j?S||!!j.closest("form"):!0,[te,I]=N.useState(new Set),V=Array.from(te).map(E=>E.props.value).join(";");return i.jsx(fw,{...w,children:i.jsxs(Y5,{required:b,scope:r,trigger:j,onTriggerChange:k,valueNode:M,onValueNodeChange:_,valueNodeHasChildren:A,onValueNodeHasChildrenChange:D,contentId:Vo(),value:q,onValueChange:Z,open:H,onOpenChange:B,dir:L,triggerPointerDownPosRef:K,disabled:v,children:[i.jsx(Zu.Provider,{scope:r,children:i.jsx(G5,{scope:e.__scopeSelect,onNativeOptionAdd:N.useCallback(E=>{I(O=>new Set(O).add(E))},[]),onNativeOptionRemove:N.useCallback(E=>{I(O=>{const z=new Set(O);return z.delete(E),z})},[]),children:o})}),G?i.jsxs(A2,{"aria-hidden":!0,required:b,tabIndex:-1,name:g,autoComplete:y,value:q,onChange:E=>Z(E.target.value),disabled:v,form:S,children:[q===void 0?i.jsx("option",{value:""}):null,Array.from(te)]},V):null]})})};i2.displayName=Fo;var l2="SelectTrigger",c2=N.forwardRef((e,r)=>{const{__scopeSelect:o,disabled:a=!1,...l}=e,u=Wu(o),d=po(l2,o),f=d.disabled||a,h=Ke(r,d.onTriggerChange),p=Ku(o),g=N.useRef("touch"),[y,v,b]=T2(w=>{const j=p().filter(_=>!_.disabled),k=j.find(_=>_.value===d.value),M=R2(j,w,k);M!==void 0&&d.onValueChange(M.value)}),S=w=>{f||(d.onOpenChange(!0),b()),w&&(d.triggerPointerDownPosRef.current={x:Math.round(w.pageX),y:Math.round(w.pageY)})};return i.jsx(mw,{asChild:!0,...u,children:i.jsx(ze.button,{type:"button",role:"combobox","aria-controls":d.contentId,"aria-expanded":d.open,"aria-required":d.required,"aria-autocomplete":"none",dir:d.dir,"data-state":d.open?"open":"closed",disabled:f,"data-disabled":f?"":void 0,"data-placeholder":M2(d.value)?"":void 0,...l,ref:h,onClick:Ee(l.onClick,w=>{w.currentTarget.focus(),g.current!=="mouse"&&S(w)}),onPointerDown:Ee(l.onPointerDown,w=>{g.current=w.pointerType;const j=w.target;j.hasPointerCapture(w.pointerId)&&j.releasePointerCapture(w.pointerId),w.button===0&&w.ctrlKey===!1&&w.pointerType==="mouse"&&(S(w),w.preventDefault())}),onKeyDown:Ee(l.onKeyDown,w=>{const j=y.current!=="";!(w.ctrlKey||w.altKey||w.metaKey)&&w.key.length===1&&v(w.key),!(j&&w.key===" ")&&$5.includes(w.key)&&(S(),w.preventDefault())})})})});c2.displayName=l2;var u2="SelectValue",d2=N.forwardRef((e,r)=>{const{__scopeSelect:o,className:a,style:l,children:u,placeholder:d="",...f}=e,h=po(u2,o),{onValueNodeHasChildrenChange:p}=h,g=u!==void 0,y=Ke(r,h.onValueNodeChange);return Rt(()=>{p(g)},[p,g]),i.jsx(ze.span,{...f,ref:y,style:{pointerEvents:"none"},children:M2(h.value)?i.jsx(i.Fragment,{children:d}):u})});d2.displayName=u2;var F5="SelectIcon",f2=N.forwardRef((e,r)=>{const{__scopeSelect:o,children:a,...l}=e;return i.jsx(ze.span,{"aria-hidden":!0,...l,ref:r,children:a||"▼"})});f2.displayName=F5;var Z5="SelectPortal",m2=e=>i.jsx(rp,{asChild:!0,...e});m2.displayName=Z5;var Zo="SelectContent",h2=N.forwardRef((e,r)=>{const o=po(Zo,e.__scopeSelect),[a,l]=N.useState();if(Rt(()=>{l(new DocumentFragment)},[]),!o.open){const u=a;return u?Qi.createPortal(i.jsx(p2,{scope:e.__scopeSelect,children:i.jsx(Zu.Slot,{scope:e.__scopeSelect,children:i.jsx("div",{children:e.children})})}),u):null}return i.jsx(g2,{...e,ref:r})});h2.displayName=Zo;var Nn=10,[p2,go]=ps(Zo),K5="SelectContentImpl",W5=Qa("SelectContent.RemoveScroll"),g2=N.forwardRef((e,r)=>{const{__scopeSelect:o,position:a="item-aligned",onCloseAutoFocus:l,onEscapeKeyDown:u,onPointerDownOutside:d,side:f,sideOffset:h,align:p,alignOffset:g,arrowPadding:y,collisionBoundary:v,collisionPadding:b,sticky:S,hideWhenDetached:w,avoidCollisions:j,...k}=e,M=po(Zo,o),[_,A]=N.useState(null),[D,L]=N.useState(null),H=Ke(r,Q=>A(Q)),[B,q]=N.useState(null),[Z,K]=N.useState(null),G=Ku(o),[te,I]=N.useState(!1),V=N.useRef(!1);N.useEffect(()=>{if(_)return Ew(_)},[_]),$b();const E=N.useCallback(Q=>{const[se,...pe]=G().map(he=>he.ref.current),[le]=pe.slice(-1),de=document.activeElement;for(const he of Q)if(he===de||(he?.scrollIntoView({block:"nearest"}),he===se&&D&&(D.scrollTop=0),he===le&&D&&(D.scrollTop=D.scrollHeight),he?.focus(),document.activeElement!==de))return},[G,D]),O=N.useCallback(()=>E([B,_]),[E,B,_]);N.useEffect(()=>{te&&O()},[te,O]);const{onOpenChange:z,triggerPointerDownPosRef:P}=M;N.useEffect(()=>{if(_){let Q={x:0,y:0};const se=le=>{Q={x:Math.abs(Math.round(le.pageX)-(P.current?.x??0)),y:Math.abs(Math.round(le.pageY)-(P.current?.y??0))}},pe=le=>{Q.x<=10&&Q.y<=10?le.preventDefault():_.contains(le.target)||z(!1),document.removeEventListener("pointermove",se),P.current=null};return P.current!==null&&(document.addEventListener("pointermove",se),document.addEventListener("pointerup",pe,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",se),document.removeEventListener("pointerup",pe,{capture:!0})}}},[_,z,P]),N.useEffect(()=>{const Q=()=>z(!1);return window.addEventListener("blur",Q),window.addEventListener("resize",Q),()=>{window.removeEventListener("blur",Q),window.removeEventListener("resize",Q)}},[z]);const[T,U]=T2(Q=>{const se=G().filter(de=>!de.disabled),pe=se.find(de=>de.ref.current===document.activeElement),le=R2(se,Q,pe);le&&setTimeout(()=>le.ref.current.focus())}),X=N.useCallback((Q,se,pe)=>{const le=!V.current&&!pe;(M.value!==void 0&&M.value===se||le)&&(q(Q),le&&(V.current=!0))},[M.value]),ee=N.useCallback(()=>_?.focus(),[_]),ae=N.useCallback((Q,se,pe)=>{const le=!V.current&&!pe;(M.value!==void 0&&M.value===se||le)&&K(Q)},[M.value]),me=a==="popper"?wh:x2,ue=me===wh?{side:f,sideOffset:h,align:p,alignOffset:g,arrowPadding:y,collisionBoundary:v,collisionPadding:b,sticky:S,hideWhenDetached:w,avoidCollisions:j}:{};return i.jsx(p2,{scope:o,content:_,viewport:D,onViewportChange:L,itemRefCallback:X,selectedItem:B,onItemLeave:ee,itemTextRefCallback:ae,focusSelectedItem:O,selectedItemText:Z,position:a,isPositioned:te,searchRef:T,children:i.jsx(op,{as:W5,allowPinchZoom:!0,children:i.jsx(Fh,{asChild:!0,trapped:M.open,onMountAutoFocus:Q=>{Q.preventDefault()},onUnmountAutoFocus:Ee(l,Q=>{M.trigger?.focus({preventScroll:!0}),Q.preventDefault()}),children:i.jsx(Xh,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:Q=>Q.preventDefault(),onDismiss:()=>M.onOpenChange(!1),children:i.jsx(me,{role:"listbox",id:M.contentId,"data-state":M.open?"open":"closed",dir:M.dir,onContextMenu:Q=>Q.preventDefault(),...k,...ue,onPlaced:()=>I(!0),ref:H,style:{display:"flex",flexDirection:"column",outline:"none",...k.style},onKeyDown:Ee(k.onKeyDown,Q=>{const se=Q.ctrlKey||Q.altKey||Q.metaKey;if(Q.key==="Tab"&&Q.preventDefault(),!se&&Q.key.length===1&&U(Q.key),["ArrowUp","ArrowDown","Home","End"].includes(Q.key)){let le=G().filter(de=>!de.disabled).map(de=>de.ref.current);if(["ArrowUp","End"].includes(Q.key)&&(le=le.slice().reverse()),["ArrowUp","ArrowDown"].includes(Q.key)){const de=Q.target,he=le.indexOf(de);le=le.slice(he+1)}setTimeout(()=>E(le)),Q.preventDefault()}})})})})})})});g2.displayName=K5;var Q5="SelectItemAlignedPosition",x2=N.forwardRef((e,r)=>{const{__scopeSelect:o,onPlaced:a,...l}=e,u=po(Zo,o),d=go(Zo,o),[f,h]=N.useState(null),[p,g]=N.useState(null),y=Ke(r,H=>g(H)),v=Ku(o),b=N.useRef(!1),S=N.useRef(!0),{viewport:w,selectedItem:j,selectedItemText:k,focusSelectedItem:M}=d,_=N.useCallback(()=>{if(u.trigger&&u.valueNode&&f&&p&&w&&j&&k){const H=u.trigger.getBoundingClientRect(),B=p.getBoundingClientRect(),q=u.valueNode.getBoundingClientRect(),Z=k.getBoundingClientRect();if(u.dir!=="rtl"){const de=Z.left-B.left,he=q.left-de,xe=H.left-he,ge=H.width+xe,Be=Math.max(ge,B.width),at=window.innerWidth-Nn,re=yh(he,[Nn,Math.max(Nn,at-Be)]);f.style.minWidth=ge+"px",f.style.left=re+"px"}else{const de=B.right-Z.right,he=window.innerWidth-q.right-de,xe=window.innerWidth-H.right-he,ge=H.width+xe,Be=Math.max(ge,B.width),at=window.innerWidth-Nn,re=yh(he,[Nn,Math.max(Nn,at-Be)]);f.style.minWidth=ge+"px",f.style.right=re+"px"}const K=v(),G=window.innerHeight-Nn*2,te=w.scrollHeight,I=window.getComputedStyle(p),V=parseInt(I.borderTopWidth,10),E=parseInt(I.paddingTop,10),O=parseInt(I.borderBottomWidth,10),z=parseInt(I.paddingBottom,10),P=V+E+te+z+O,T=Math.min(j.offsetHeight*5,P),U=window.getComputedStyle(w),X=parseInt(U.paddingTop,10),ee=parseInt(U.paddingBottom,10),ae=H.top+H.height/2-Nn,me=G-ae,ue=j.offsetHeight/2,Q=j.offsetTop+ue,se=V+E+Q,pe=P-se;if(se<=ae){const de=K.length>0&&j===K[K.length-1].ref.current;f.style.bottom="0px";const he=p.clientHeight-w.offsetTop-w.offsetHeight,xe=Math.max(me,ue+(de?ee:0)+he+O),ge=se+xe;f.style.height=ge+"px"}else{const de=K.length>0&&j===K[0].ref.current;f.style.top="0px";const xe=Math.max(ae,V+w.offsetTop+(de?X:0)+ue)+pe;f.style.height=xe+"px",w.scrollTop=se-ae+w.offsetTop}f.style.margin=`${Nn}px 0`,f.style.minHeight=T+"px",f.style.maxHeight=G+"px",a?.(),requestAnimationFrame(()=>b.current=!0)}},[v,u.trigger,u.valueNode,f,p,w,j,k,u.dir,a]);Rt(()=>_(),[_]);const[A,D]=N.useState();Rt(()=>{p&&D(window.getComputedStyle(p).zIndex)},[p]);const L=N.useCallback(H=>{H&&S.current===!0&&(_(),M?.(),S.current=!1)},[_,M]);return i.jsx(eT,{scope:o,contentWrapper:f,shouldExpandOnScrollRef:b,onScrollButtonChange:L,children:i.jsx("div",{ref:h,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:A},children:i.jsx(ze.div,{...l,ref:y,style:{boxSizing:"border-box",maxHeight:"100%",...l.style}})})})});x2.displayName=Q5;var J5="SelectPopperPosition",wh=N.forwardRef((e,r)=>{const{__scopeSelect:o,align:a="start",collisionPadding:l=Nn,...u}=e,d=Wu(o);return i.jsx(hw,{...d,...u,ref:r,align:a,collisionPadding:l,style:{boxSizing:"border-box",...u.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)"}})});wh.displayName=J5;var[eT,kp]=ps(Zo,{}),Nh="SelectViewport",v2=N.forwardRef((e,r)=>{const{__scopeSelect:o,nonce:a,...l}=e,u=go(Nh,o),d=kp(Nh,o),f=Ke(r,u.onViewportChange),h=N.useRef(0);return i.jsxs(i.Fragment,{children:[i.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}),i.jsx(Zu.Slot,{scope:o,children:i.jsx(ze.div,{"data-radix-select-viewport":"",role:"presentation",...l,ref:f,style:{position:"relative",flex:1,overflow:"hidden auto",...l.style},onScroll:Ee(l.onScroll,p=>{const g=p.currentTarget,{contentWrapper:y,shouldExpandOnScrollRef:v}=d;if(v?.current&&y){const b=Math.abs(h.current-g.scrollTop);if(b>0){const S=window.innerHeight-Nn*2,w=parseFloat(y.style.minHeight),j=parseFloat(y.style.height),k=Math.max(w,j);if(k<S){const M=k+b,_=Math.min(S,M),A=M-_;y.style.height=_+"px",y.style.bottom==="0px"&&(g.scrollTop=A>0?A:0,y.style.justifyContent="flex-end")}}}h.current=g.scrollTop})})})]})});v2.displayName=Nh;var y2="SelectGroup",[tT,nT]=ps(y2),rT=N.forwardRef((e,r)=>{const{__scopeSelect:o,...a}=e,l=Vo();return i.jsx(tT,{scope:o,id:l,children:i.jsx(ze.div,{role:"group","aria-labelledby":l,...a,ref:r})})});rT.displayName=y2;var b2="SelectLabel",oT=N.forwardRef((e,r)=>{const{__scopeSelect:o,...a}=e,l=nT(b2,o);return i.jsx(ze.div,{id:l.id,...a,ref:r})});oT.displayName=b2;var vu="SelectItem",[aT,w2]=ps(vu),N2=N.forwardRef((e,r)=>{const{__scopeSelect:o,value:a,disabled:l=!1,textValue:u,...d}=e,f=po(vu,o),h=go(vu,o),p=f.value===a,[g,y]=N.useState(u??""),[v,b]=N.useState(!1),S=Ke(r,M=>h.itemRefCallback?.(M,a,l)),w=Vo(),j=N.useRef("touch"),k=()=>{l||(f.onValueChange(a),f.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 i.jsx(aT,{scope:o,value:a,disabled:l,textId:w,isSelected:p,onItemTextChange:N.useCallback(M=>{y(_=>_||(M?.textContent??"").trim())},[]),children:i.jsx(Zu.ItemSlot,{scope:o,value:a,disabled:l,textValue:g,children:i.jsx(ze.div,{role:"option","aria-labelledby":w,"data-highlighted":v?"":void 0,"aria-selected":p&&v,"data-state":p?"checked":"unchecked","aria-disabled":l||void 0,"data-disabled":l?"":void 0,tabIndex:l?void 0:-1,...d,ref:S,onFocus:Ee(d.onFocus,()=>b(!0)),onBlur:Ee(d.onBlur,()=>b(!1)),onClick:Ee(d.onClick,()=>{j.current!=="mouse"&&k()}),onPointerUp:Ee(d.onPointerUp,()=>{j.current==="mouse"&&k()}),onPointerDown:Ee(d.onPointerDown,M=>{j.current=M.pointerType}),onPointerMove:Ee(d.onPointerMove,M=>{j.current=M.pointerType,l?h.onItemLeave?.():j.current==="mouse"&&M.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ee(d.onPointerLeave,M=>{M.currentTarget===document.activeElement&&h.onItemLeave?.()}),onKeyDown:Ee(d.onKeyDown,M=>{h.searchRef?.current!==""&&M.key===" "||(V5.includes(M.key)&&k(),M.key===" "&&M.preventDefault())})})})})});N2.displayName=vu;var Ci="SelectItemText",S2=N.forwardRef((e,r)=>{const{__scopeSelect:o,className:a,style:l,...u}=e,d=po(Ci,o),f=go(Ci,o),h=w2(Ci,o),p=X5(Ci,o),[g,y]=N.useState(null),v=Ke(r,k=>y(k),h.onItemTextChange,k=>f.itemTextRefCallback?.(k,h.value,h.disabled)),b=g?.textContent,S=N.useMemo(()=>i.jsx("option",{value:h.value,disabled:h.disabled,children:b},h.value),[h.disabled,h.value,b]),{onNativeOptionAdd:w,onNativeOptionRemove:j}=p;return Rt(()=>(w(S),()=>j(S)),[w,j,S]),i.jsxs(i.Fragment,{children:[i.jsx(ze.span,{id:h.textId,...u,ref:v}),h.isSelected&&d.valueNode&&!d.valueNodeHasChildren?Qi.createPortal(u.children,d.valueNode):null]})});S2.displayName=Ci;var E2="SelectItemIndicator",_2=N.forwardRef((e,r)=>{const{__scopeSelect:o,...a}=e;return w2(E2,o).isSelected?i.jsx(ze.span,{"aria-hidden":!0,...a,ref:r}):null});_2.displayName=E2;var Sh="SelectScrollUpButton",j2=N.forwardRef((e,r)=>{const o=go(Sh,e.__scopeSelect),a=kp(Sh,e.__scopeSelect),[l,u]=N.useState(!1),d=Ke(r,a.onScrollButtonChange);return Rt(()=>{if(o.viewport&&o.isPositioned){let f=function(){const p=h.scrollTop>0;u(p)};const h=o.viewport;return f(),h.addEventListener("scroll",f),()=>h.removeEventListener("scroll",f)}},[o.viewport,o.isPositioned]),l?i.jsx(k2,{...e,ref:d,onAutoScroll:()=>{const{viewport:f,selectedItem:h}=o;f&&h&&(f.scrollTop=f.scrollTop-h.offsetHeight)}}):null});j2.displayName=Sh;var Eh="SelectScrollDownButton",C2=N.forwardRef((e,r)=>{const o=go(Eh,e.__scopeSelect),a=kp(Eh,e.__scopeSelect),[l,u]=N.useState(!1),d=Ke(r,a.onScrollButtonChange);return Rt(()=>{if(o.viewport&&o.isPositioned){let f=function(){const p=h.scrollHeight-h.clientHeight,g=Math.ceil(h.scrollTop)<p;u(g)};const h=o.viewport;return f(),h.addEventListener("scroll",f),()=>h.removeEventListener("scroll",f)}},[o.viewport,o.isPositioned]),l?i.jsx(k2,{...e,ref:d,onAutoScroll:()=>{const{viewport:f,selectedItem:h}=o;f&&h&&(f.scrollTop=f.scrollTop+h.offsetHeight)}}):null});C2.displayName=Eh;var k2=N.forwardRef((e,r)=>{const{__scopeSelect:o,onAutoScroll:a,...l}=e,u=go("SelectScrollButton",o),d=N.useRef(null),f=Ku(o),h=N.useCallback(()=>{d.current!==null&&(window.clearInterval(d.current),d.current=null)},[]);return N.useEffect(()=>()=>h(),[h]),Rt(()=>{f().find(g=>g.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[f]),i.jsx(ze.div,{"aria-hidden":!0,...l,ref:r,style:{flexShrink:0,...l.style},onPointerDown:Ee(l.onPointerDown,()=>{d.current===null&&(d.current=window.setInterval(a,50))}),onPointerMove:Ee(l.onPointerMove,()=>{u.onItemLeave?.(),d.current===null&&(d.current=window.setInterval(a,50))}),onPointerLeave:Ee(l.onPointerLeave,()=>{h()})})}),sT="SelectSeparator",iT=N.forwardRef((e,r)=>{const{__scopeSelect:o,...a}=e;return i.jsx(ze.div,{"aria-hidden":!0,...a,ref:r})});iT.displayName=sT;var _h="SelectArrow",lT=N.forwardRef((e,r)=>{const{__scopeSelect:o,...a}=e,l=Wu(o),u=po(_h,o),d=go(_h,o);return u.open&&d.position==="popper"?i.jsx(pw,{...l,...a,ref:r}):null});lT.displayName=_h;var cT="SelectBubbleInput",A2=N.forwardRef(({__scopeSelect:e,value:r,...o},a)=>{const l=N.useRef(null),u=Ke(a,l),d=a2(r);return N.useEffect(()=>{const f=l.current;if(!f)return;const h=window.HTMLSelectElement.prototype,g=Object.getOwnPropertyDescriptor(h,"value").set;if(d!==r&&g){const y=new Event("change",{bubbles:!0});g.call(f,r),f.dispatchEvent(y)}},[d,r]),i.jsx(ze.select,{...o,style:{...s2,...o.style},ref:u,defaultValue:r})});A2.displayName=cT;function M2(e){return e===""||e===void 0}function T2(e){const r=Tt(e),o=N.useRef(""),a=N.useRef(0),l=N.useCallback(d=>{const f=o.current+d;r(f),(function h(p){o.current=p,window.clearTimeout(a.current),p!==""&&(a.current=window.setTimeout(()=>h(""),1e3))})(f)},[r]),u=N.useCallback(()=>{o.current="",window.clearTimeout(a.current)},[]);return N.useEffect(()=>()=>window.clearTimeout(a.current),[]),[o,l,u]}function R2(e,r,o){const l=r.length>1&&Array.from(r).every(p=>p===r[0])?r[0]:r,u=o?e.indexOf(o):-1;let d=uT(e,Math.max(u,0));l.length===1&&(d=d.filter(p=>p!==o));const h=d.find(p=>p.textValue.toLowerCase().startsWith(l.toLowerCase()));return h!==o?h:void 0}function uT(e,r){return e.map((o,a)=>e[(r+a)%e.length])}var dT=i2,fT=c2,mT=d2,hT=f2,pT=m2,gT=h2,xT=v2,vT=N2,yT=S2,bT=_2,wT=j2,NT=C2;function D2({...e}){return i.jsx(dT,{"data-slot":"select",...e})}function O2({...e}){return i.jsx(mT,{"data-slot":"select-value",...e})}function z2({className:e,size:r="default",children:o,...a}){return i.jsxs(fT,{"data-slot":"select-trigger","data-size":r,className:qe("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...a,children:[o,i.jsx(hT,{asChild:!0,children:i.jsx(kn,{className:"size-4 opacity-50"})})]})}function L2({className:e,children:r,position:o="popper",...a}){return i.jsx(pT,{children:i.jsxs(gT,{"data-slot":"select-content",className:qe("bg-popover text-popover-foreground 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 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",o==="popper"&&"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:o,...a,children:[i.jsx(ST,{}),i.jsx(xT,{className:qe("p-1",o==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:r}),i.jsx(ET,{})]})})}function I2({className:e,children:r,...o}){return i.jsxs(vT,{"data-slot":"select-item",className:qe("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...o,children:[i.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:i.jsx(bT,{children:i.jsx(Pu,{className:"size-4"})})}),i.jsx(yT,{children:r})]})}function ST({className:e,...r}){return i.jsx(wT,{"data-slot":"select-scroll-up-button",className:qe("flex cursor-default items-center justify-center py-1",e),...r,children:i.jsx(ph,{className:"size-4"})})}function ET({className:e,...r}){return i.jsx(NT,{"data-slot":"select-scroll-down-button",className:qe("flex cursor-default items-center justify-center py-1",e),...r,children:i.jsx(kn,{className:"size-4"})})}function Ho({title:e,icon:r,children:o,className:a=""}){return i.jsxs("div",{className:`border rounded-lg p-4 bg-card ${a}`,children:[i.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[r,i.jsx("h3",{className:"text-sm font-semibold text-foreground",children:e})]}),i.jsx("div",{className:"text-sm text-muted-foreground",children:o})]})}function _T({agent:e,open:r,onOpenChange:o}){const a=e.source==="directory"?i.jsx(h1,{className:"h-4 w-4 text-muted-foreground"}):e.source==="in_memory"?i.jsx(gh,{className:"h-4 w-4 text-muted-foreground"}):i.jsx(p1,{className:"h-4 w-4 text-muted-foreground"}),l=e.source==="directory"?"Local":e.source==="in_memory"?"In-Memory":"Gallery";return i.jsx(Sr,{open:r,onOpenChange:o,children:i.jsxs(Er,{className:"max-w-4xl max-h-[90vh] flex flex-col",children:[i.jsxs(_r,{className:"px-6 pt-6 flex-shrink-0",children:[i.jsx(jr,{children:"Agent Details"}),i.jsx(ho,{onClose:()=>o(!1)})]}),i.jsxs("div",{className:"px-6 pb-6 overflow-y-auto flex-1",children:[i.jsxs("div",{className:"mb-6",children:[i.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[i.jsx(qn,{className:"h-6 w-6 text-primary"}),i.jsx("h2",{className:"text-xl font-semibold text-foreground",children:e.name||e.id})]}),e.description&&i.jsx("p",{className:"text-muted-foreground",children:e.description})]}),i.jsx("div",{className:"h-px bg-border mb-6"}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4",children:[(e.model||e.chat_client_type)&&i.jsx(Ho,{title:"Model & Client",icon:i.jsx(qn,{className:"h-4 w-4 text-muted-foreground"}),children:i.jsxs("div",{className:"space-y-1",children:[e.model&&i.jsx("div",{className:"font-mono text-foreground",children:e.model}),e.chat_client_type&&i.jsxs("div",{className:"text-xs",children:["(",e.chat_client_type,")"]})]})}),i.jsx(Ho,{title:"Source",icon:a,children:i.jsxs("div",{className:"space-y-1",children:[i.jsx("div",{className:"text-foreground",children:l}),e.module_path&&i.jsx("div",{className:"font-mono text-xs break-all",children:e.module_path})]})}),i.jsx(Ho,{title:"Environment",icon:e.has_env?i.jsx(Vu,{className:"h-4 w-4 text-orange-500"}):i.jsx(fu,{className:"h-4 w-4 text-green-500"}),className:"md:col-span-2",children:i.jsx("div",{className:e.has_env?"text-orange-600 dark:text-orange-400":"text-green-600 dark:text-green-400",children:e.has_env?"Requires environment variables":"No environment variables required"})})]}),e.instructions&&i.jsx(Ho,{title:"Instructions",icon:i.jsx(Yo,{className:"h-4 w-4 text-muted-foreground"}),className:"mb-4",children:i.jsx("div",{className:"text-sm text-foreground leading-relaxed whitespace-pre-wrap",children:e.instructions})}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsx(Ho,{title:`Tools (${e.tools.length})`,icon:i.jsx(xh,{className:"h-4 w-4 text-muted-foreground"}),children:e.tools.length>0?i.jsx("ul",{className:"space-y-1",children:e.tools.map((u,d)=>i.jsxs("li",{className:"font-mono text-xs text-foreground",children:["• ",u]},d))}):i.jsx("div",{className:"text-muted-foreground",children:"No tools configured"})}),e.middleware&&e.middleware.length>0&&i.jsx(Ho,{title:`Middleware (${e.middleware.length})`,icon:i.jsx(xh,{className:"h-4 w-4 text-muted-foreground"}),children:i.jsx("ul",{className:"space-y-1",children:e.middleware.map((u,d)=>i.jsxs("li",{className:"font-mono text-xs text-foreground",children:["• ",u]},d))})}),e.context_providers&&e.context_providers.length>0&&i.jsx(Ho,{title:`Context Providers (${e.context_providers.length})`,icon:i.jsx(gh,{className:"h-4 w-4 text-muted-foreground"}),className:!e.middleware||e.middleware.length===0?"md:col-start-2":"",children:i.jsx("ul",{className:"space-y-1",children:e.context_providers.map((u,d)=>i.jsxs("li",{className:"font-mono text-xs text-foreground",children:["• ",u]},d))})})]})]})]})})}const jT="";function CT(){return localStorage.getItem("devui_backend_url")||jT}class kT{baseUrl;constructor(r){this.baseUrl=r||CT()}setBaseUrl(r){this.baseUrl=r}getBaseUrl(){return this.baseUrl}async request(r,o={}){const a=`${this.baseUrl}${r}`,l=await fetch(a,{headers:{"Content-Type":"application/json",...o.headers},...o});if(!l.ok){let u=`API request failed: ${l.status} ${l.statusText}`;try{const d=await l.json();d.detail&&(u=d.detail)}catch{}throw new Error(u)}return l.json()}async getHealth(){return this.request("/health")}async getEntities(){const r=await this.request("/v1/entities"),o=[],a=[];return r.entities.forEach(l=>{if(l.type==="agent")o.push({id:l.id,name:l.name,description:l.description,type:"agent",source:l.source||"directory",tools:(l.tools||[]).map(u=>typeof u=="string"?u:JSON.stringify(u)),has_env:!1,module_path:typeof l.metadata?.module_path=="string"?l.metadata.module_path:void 0,metadata:l.metadata,instructions:l.instructions,model:l.model,chat_client_type:l.chat_client_type,context_providers:l.context_providers,middleware:l.middleware});else if(l.type==="workflow"){const u=l.tools?.[0],d=typeof u=="string"?u:"";a.push({id:l.id,name:l.name,description:l.description,type:"workflow",source:l.source||"directory",executors:(l.tools||[]).map(f=>typeof f=="string"?f:JSON.stringify(f)),has_env:!1,module_path:typeof l.metadata?.module_path=="string"?l.metadata.module_path:void 0,metadata:l.metadata,input_schema:l.input_schema||{type:"string"},input_type_name:l.input_type_name||"Input",start_executor_id:d})}}),{entities:[...o,...a],agents:o,workflows:a}}async getAgents(){const{agents:r}=await this.getEntities();return r}async getWorkflows(){const{workflows:r}=await this.getEntities();return r}async getAgentInfo(r){return this.request(`/v1/entities/${r}/info`)}async getWorkflowInfo(r){return this.request(`/v1/entities/${r}/info`)}async createConversation(r){const o=await this.request("/v1/conversations",{method:"POST",body:JSON.stringify({metadata:r})});return{id:o.id,object:"conversation",created_at:o.created_at,metadata:o.metadata}}async listConversations(r){const o=r?`/v1/conversations?agent_id=${encodeURIComponent(r)}`:"/v1/conversations",a=await this.request(o);return{data:a.data.map(l=>({id:l.id,object:"conversation",created_at:l.created_at,metadata:l.metadata})),has_more:a.has_more}}async getConversation(r){const o=await this.request(`/v1/conversations/${r}`);return{id:o.id,object:"conversation",created_at:o.created_at,metadata:o.metadata}}async deleteConversation(r){try{return await this.request(`/v1/conversations/${r}`,{method:"DELETE"}),!0}catch{return!1}}async listConversationItems(r,o){const a=new URLSearchParams;o?.limit&&a.set("limit",o.limit.toString()),o?.after&&a.set("after",o.after),o?.order&&a.set("order",o.order);const l=a.toString(),u=`/v1/conversations/${r}/items${l?`?${l}`:""}`;return this.request(u)}async*streamAgentExecutionOpenAI(r,o){const a={model:r,input:o.input,stream:!0,conversation:o.conversation_id};return yield*this.streamAgentExecutionOpenAIDirect(r,a)}async*streamAgentExecutionOpenAIDirect(r,o){const a=await fetch(`${this.baseUrl}/v1/responses`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"text/event-stream"},body:JSON.stringify(o)});if(!a.ok){let f=`Request failed with status ${a.status}`;try{const h=await a.json();h.error&&h.error.message?f=h.error.message:h.detail&&(f=h.detail)}catch{}throw new Error(f)}const l=a.body?.getReader();if(!l)throw new Error("Response body is not readable");const u=new TextDecoder;let d="";try{for(;;){const{done:f,value:h}=await l.read();if(f)break;d+=u.decode(h,{stream:!0});const p=d.split(`
506
- `);d=p.pop()||"";for(const g of p)if(g.startsWith("data: ")){const y=g.slice(6);if(y==="[DONE]")return;try{yield JSON.parse(y)}catch(v){console.error("Failed to parse OpenAI SSE event:",v)}}}}finally{l.releaseLock()}}async*streamWorkflowExecutionOpenAI(r,o){const a={model:r,input:typeof o.input_data=="string"?o.input_data:JSON.stringify(o.input_data||""),stream:!0,conversation:o.conversation_id},l=await fetch(`${this.baseUrl}/v1/responses`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"text/event-stream"},body:JSON.stringify(a)});if(!l.ok){let h=`Request failed with status ${l.status}`;try{const p=await l.json();p.error&&p.error.message?h=p.error.message:p.detail&&(h=p.detail)}catch{}throw new Error(h)}const u=l.body?.getReader();if(!u)throw new Error("Response body is not readable");const d=new TextDecoder;let f="";try{for(;;){const{done:h,value:p}=await u.read();if(h)break;f+=d.decode(p,{stream:!0});const g=f.split(`
507
- `);f=g.pop()||"";for(const y of g)if(y.startsWith("data: ")){const v=y.slice(6);if(v==="[DONE]")return;try{yield JSON.parse(v)}catch(b){console.error("Failed to parse OpenAI SSE event:",b)}}}}finally{u.releaseLock()}}async runAgent(r,o){return this.request(`/agents/${r}/run`,{method:"POST",body:JSON.stringify(o)})}async runWorkflow(r,o){return this.request(`/workflows/${r}/run`,{method:"POST",body:JSON.stringify(o)})}}const Lt=new kT,gy=e=>{let r;const o=new Set,a=(p,g)=>{const y=typeof p=="function"?p(r):p;if(!Object.is(y,r)){const v=r;r=g??(typeof y!="object"||y===null)?y:Object.assign({},r,y),o.forEach(b=>b(r,v))}},l=()=>r,f={setState:a,getState:l,getInitialState:()=>h,subscribe:p=>(o.add(p),()=>o.delete(p))},h=r=e(a,l,f);return f},AT=(e=>e?gy(e):gy),MT=e=>e;function TT(e,r=MT){const o=rn.useSyncExternalStore(e.subscribe,rn.useCallback(()=>r(e.getState()),[e,r]),rn.useCallback(()=>r(e.getInitialState()),[e,r]));return rn.useDebugValue(o),o}const RT=e=>{const r=AT(e),o=a=>TT(r,a);return Object.assign(o,r),o},DT=(e=>RT),xy={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_API_BASE_URL:""},Ui=new Map,Hc=e=>{const r=Ui.get(e);return r?Object.fromEntries(Object.entries(r.stores).map(([o,a])=>[o,a.getState()])):{}},OT=(e,r,o)=>{if(e===void 0)return{type:"untracked",connection:r.connect(o)};const a=Ui.get(o.name);if(a)return{type:"tracked",store:e,...a};const l={connection:r.connect(o),stores:{}};return Ui.set(o.name,l),{type:"tracked",store:e,...l}},zT=(e,r)=>{if(r===void 0)return;const o=Ui.get(e);o&&(delete o.stores[r],Object.keys(o.stores).length===0&&Ui.delete(e))},LT=e=>{var r,o;if(!e)return;const a=e.split(`
508
- `),l=a.findIndex(d=>d.includes("api.setState"));if(l<0)return;const u=((r=a[l+1])==null?void 0:r.trim())||"";return(o=/.+ (.+) .+/.exec(u))==null?void 0:o[1]},IT=(e,r={})=>(o,a,l)=>{const{enabled:u,anonymousActionType:d,store:f,...h}=r;let p;try{p=(u??(xy?"production":void 0)!=="production")&&window.__REDUX_DEVTOOLS_EXTENSION__}catch{}if(!p)return e(o,a,l);const{connection:g,...y}=OT(f,p,h);let v=!0;l.setState=((w,j,k)=>{const M=o(w,j);if(!v)return M;const _=k===void 0?{type:d||LT(new Error().stack)||"anonymous"}:typeof k=="string"?{type:k}:k;return f===void 0?(g?.send(_,a()),M):(g?.send({..._,type:`${f}/${_.type}`},{...Hc(h.name),[f]:l.getState()}),M)}),l.devtools={cleanup:()=>{g&&typeof g.unsubscribe=="function"&&g.unsubscribe(),zT(h.name,f)}};const b=(...w)=>{const j=v;v=!1,o(...w),v=j},S=e(l.setState,a,l);if(y.type==="untracked"?g?.init(S):(y.stores[y.store]=l,g?.init(Object.fromEntries(Object.entries(y.stores).map(([w,j])=>[w,w===y.store?S:j.getState()])))),l.dispatchFromDevtools&&typeof l.dispatch=="function"){let w=!1;const j=l.dispatch;l.dispatch=(...k)=>{(xy?"production":void 0)!=="production"&&k[0].type==="__setState"&&!w&&(console.warn('[zustand devtools middleware] "__setState" action type is reserved to set state from the devtools. Avoid using it.'),w=!0),j(...k)}}return g.subscribe(w=>{var j;switch(w.type){case"ACTION":if(typeof w.payload!="string"){console.error("[zustand devtools middleware] Unsupported action format");return}return Ym(w.payload,k=>{if(k.type==="__setState"){if(f===void 0){b(k.state);return}Object.keys(k.state).length!==1&&console.error(`
509
- [zustand devtools middleware] Unsupported __setState action format.
510
- When using 'store' option in devtools(), the 'state' should have only one key, which is a value of 'store' that was passed in devtools(),
511
- and value of this only key should be a state object. Example: { "type": "__setState", "state": { "abc123Store": { "foo": "bar" } } }
512
- `);const M=k.state[f];if(M==null)return;JSON.stringify(l.getState())!==JSON.stringify(M)&&b(M);return}l.dispatchFromDevtools&&typeof l.dispatch=="function"&&l.dispatch(k)});case"DISPATCH":switch(w.payload.type){case"RESET":return b(S),f===void 0?g?.init(l.getState()):g?.init(Hc(h.name));case"COMMIT":if(f===void 0){g?.init(l.getState());return}return g?.init(Hc(h.name));case"ROLLBACK":return Ym(w.state,k=>{if(f===void 0){b(k),g?.init(l.getState());return}b(k[f]),g?.init(Hc(h.name))});case"JUMP_TO_STATE":case"JUMP_TO_ACTION":return Ym(w.state,k=>{if(f===void 0){b(k);return}JSON.stringify(l.getState())!==JSON.stringify(k[f])&&b(k[f])});case"IMPORT_STATE":{const{nextLiftedState:k}=w.payload,M=(j=k.computedStates.slice(-1)[0])==null?void 0:j.state;if(!M)return;b(f===void 0?M:M[f]),g?.send(null,k);return}case"PAUSE_RECORDING":return v=!v}return}}),S},HT=IT,Ym=(e,r)=>{let o;try{o=JSON.parse(e)}catch(a){console.error("[zustand devtools middleware] Could not parse the received json",a)}o!==void 0&&r(o)};function BT(e,r){let o;try{o=e()}catch{return}return{getItem:l=>{var u;const d=h=>h===null?null:JSON.parse(h,void 0),f=(u=o.getItem(l))!=null?u:null;return f instanceof Promise?f.then(d):d(f)},setItem:(l,u)=>o.setItem(l,JSON.stringify(u,void 0)),removeItem:l=>o.removeItem(l)}}const jh=e=>r=>{try{const o=e(r);return o instanceof Promise?o:{then(a){return jh(a)(o)},catch(a){return this}}}catch(o){return{then(a){return this},catch(a){return jh(a)(o)}}}},UT=(e,r)=>(o,a,l)=>{let u={storage:BT(()=>localStorage),partialize:w=>w,version:0,merge:(w,j)=>({...j,...w}),...r},d=!1;const f=new Set,h=new Set;let p=u.storage;if(!p)return e((...w)=>{console.warn(`[zustand persist middleware] Unable to update item '${u.name}', the given storage is currently unavailable.`),o(...w)},a,l);const g=()=>{const w=u.partialize({...a()});return p.setItem(u.name,{state:w,version:u.version})},y=l.setState;l.setState=(w,j)=>(y(w,j),g());const v=e((...w)=>(o(...w),g()),a,l);l.getInitialState=()=>v;let b;const S=()=>{var w,j;if(!p)return;d=!1,f.forEach(M=>{var _;return M((_=a())!=null?_:v)});const k=((j=u.onRehydrateStorage)==null?void 0:j.call(u,(w=a())!=null?w:v))||void 0;return jh(p.getItem.bind(p))(u.name).then(M=>{if(M)if(typeof M.version=="number"&&M.version!==u.version){if(u.migrate){const _=u.migrate(M.state,M.version);return _ instanceof Promise?_.then(A=>[!0,A]):[!0,_]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,M.state];return[!1,void 0]}).then(M=>{var _;const[A,D]=M;if(b=u.merge(D,(_=a())!=null?_:v),o(b,!0),A)return g()}).then(()=>{k?.(b,void 0),b=a(),d=!0,h.forEach(M=>M(b))}).catch(M=>{k?.(void 0,M)})};return l.persist={setOptions:w=>{u={...u,...w},w.storage&&(p=w.storage)},clearStorage:()=>{p?.removeItem(u.name)},getOptions:()=>u,rehydrate:()=>S(),hasHydrated:()=>d,onHydrate:w=>(f.add(w),()=>{f.delete(w)}),onFinishHydration:w=>(h.add(w),()=>{h.delete(w)})},u.skipHydration||S(),b||v},PT=UT,ye=DT()(HT(PT(e=>({agents:[],workflows:[],selectedAgent:void 0,isLoadingEntities:!0,entityError:null,currentConversation:void 0,availableConversations:[],chatItems:[],isStreaming:!1,isSubmitting:!1,loadingConversations:!1,inputValue:"",attachments:[],conversationUsage:{total_tokens:0,message_count:0},pendingApprovals:[],showDebugPanel:!0,debugPanelWidth:320,debugEvents:[],isResizing:!1,showAboutModal:!1,showGallery:!1,showDeployModal:!1,showEntityNotFoundToast:!1,setAgents:r=>e({agents:r}),setWorkflows:r=>e({workflows:r}),setSelectedAgent:r=>e({selectedAgent:r}),addAgent:r=>e(o=>({agents:[...o.agents,r]})),addWorkflow:r=>e(o=>({workflows:[...o.workflows,r]})),updateAgent:r=>e(o=>({agents:o.agents.map(a=>a.id===r.id?r:a),selectedAgent:o.selectedAgent?.id===r.id&&o.selectedAgent.type==="agent"?r:o.selectedAgent})),updateWorkflow:r=>e(o=>({workflows:o.workflows.map(a=>a.id===r.id?r:a),selectedAgent:o.selectedAgent?.id===r.id&&o.selectedAgent.type==="workflow"?r:o.selectedAgent})),removeEntity:r=>e(o=>({agents:o.agents.filter(a=>a.id!==r),workflows:o.workflows.filter(a=>a.id!==r),selectedAgent:o.selectedAgent?.id===r?void 0:o.selectedAgent})),setEntityError:r=>e({entityError:r}),setIsLoadingEntities:r=>e({isLoadingEntities:r}),setCurrentConversation:r=>e({currentConversation:r}),setAvailableConversations:r=>e({availableConversations:r}),setChatItems:r=>e({chatItems:r}),setIsStreaming:r=>e({isStreaming:r}),setIsSubmitting:r=>e({isSubmitting:r}),setLoadingConversations:r=>e({loadingConversations:r}),setInputValue:r=>e({inputValue:r}),setAttachments:r=>e({attachments:r}),updateConversationUsage:r=>e(o=>({conversationUsage:{total_tokens:o.conversationUsage.total_tokens+r,message_count:o.conversationUsage.message_count+1}})),setPendingApprovals:r=>e({pendingApprovals:r}),setShowDebugPanel:r=>e({showDebugPanel:r}),setDebugPanelWidth:r=>e({debugPanelWidth:r}),addDebugEvent:r=>e(o=>({debugEvents:[...o.debugEvents,r]})),clearDebugEvents:()=>e({debugEvents:[]}),setIsResizing:r=>e({isResizing:r}),setShowAboutModal:r=>e({showAboutModal:r}),setShowGallery:r=>e({showGallery:r}),setShowDeployModal:r=>e({showDeployModal:r}),setShowEntityNotFoundToast:r=>e({showEntityNotFoundToast:r}),selectEntity:r=>{e({selectedAgent:r,currentConversation:void 0,availableConversations:[],chatItems:[],inputValue:"",attachments:[],conversationUsage:{total_tokens:0,message_count:0},isStreaming:!1,isSubmitting:!1,pendingApprovals:[],debugEvents:[]});const o=new URL(window.location.href);o.searchParams.set("entity_id",r.id),window.history.pushState({},"",o)}}),{name:"devui-storage",partialize:e=>({showDebugPanel:e.showDebugPanel,debugPanelWidth:e.debugPanelWidth})}),{name:"DevUI Store"}));function $T({item:e}){const[r,o]=N.useState(!1),[a,l]=N.useState(!1),u=()=>e.type==="message"?e.content.filter(f=>f.type==="text").map(f=>f.text).join(`
513
- `):"",d=async()=>{const f=u();if(f)try{await navigator.clipboard.writeText(f),l(!0),setTimeout(()=>l(!1),2e3)}catch(h){console.error("Failed to copy:",h)}};if(e.type==="message"){const f=e.role==="user",h=e.status==="incomplete",p=f?w1:h?ts:qn,g=u();return i.jsxs("div",{className:`flex gap-3 ${f?"flex-row-reverse":""}`,onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),children:[i.jsx("div",{className:`flex h-8 w-8 shrink-0 select-none items-center justify-center rounded-md border ${f?"bg-primary text-primary-foreground":h?"bg-orange-100 dark:bg-orange-900 text-orange-600 dark:text-orange-400 border-orange-200 dark:border-orange-800":"bg-muted"}`,children:i.jsx(p,{className:"h-4 w-4"})}),i.jsxs("div",{className:`flex flex-col space-y-1 ${f?"items-end":"items-start"} max-w-[80%]`,children:[i.jsxs("div",{className:"relative group",children:[i.jsxs("div",{className:`rounded px-3 py-2 text-sm break-all ${f?"bg-primary text-primary-foreground":h?"bg-orange-50 dark:bg-orange-950/50 text-orange-800 dark:text-orange-200 border border-orange-200 dark:border-orange-800":"bg-muted"}`,children:[h&&i.jsxs("div",{className:"flex items-start gap-2 mb-2",children:[i.jsx(ts,{className:"h-4 w-4 text-orange-500 mt-0.5 flex-shrink-0"}),i.jsx("span",{className:"font-medium text-sm",children:"Unable to process request"})]}),i.jsx("div",{className:h?"text-xs leading-relaxed break-all":"",children:i.jsx(py,{item:e})})]}),g&&r&&i.jsx("button",{onClick:d,className:`absolute top-1 right-1
514
- p-1.5 rounded-md border shadow-sm
515
- bg-background hover:bg-accent
516
- text-muted-foreground hover:text-foreground
517
- transition-all duration-200 ease-in-out
518
- opacity-0 group-hover:opacity-100`,title:a?"Copied!":"Copy message",children:a?i.jsx(Jk,{className:"h-3.5 w-3.5 text-green-600 dark:text-green-400"}):i.jsx(Ti,{className:"h-3.5 w-3.5"})})]}),i.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground font-mono",children:[i.jsx("span",{children:new Date().toLocaleTimeString()}),!f&&e.usage&&i.jsxs(i.Fragment,{children:[i.jsx("span",{children:"•"}),i.jsxs("span",{className:"flex items-center gap-1",children:[i.jsxs("span",{className:"text-blue-600 dark:text-blue-400",children:["↑",e.usage.input_tokens]}),i.jsxs("span",{className:"text-green-600 dark:text-green-400",children:["↓",e.usage.output_tokens]}),i.jsxs("span",{children:["(",e.usage.total_tokens," tokens)"]})]})]})]})]})]})}return i.jsxs("div",{className:"flex gap-3",children:[i.jsx("div",{className:"flex h-8 w-8 shrink-0 select-none items-center justify-center rounded-md border bg-muted",children:i.jsx(qn,{className:"h-4 w-4"})}),i.jsx("div",{className:"flex flex-col space-y-1 items-start max-w-[80%]",children:i.jsx("div",{className:"rounded px-3 py-2 text-sm bg-muted",children:i.jsx(py,{item:e})})})]})}function VT({selectedAgent:e,onDebugEvent:r}){const o=ye(re=>re.currentConversation),a=ye(re=>re.availableConversations),l=ye(re=>re.chatItems),u=ye(re=>re.isStreaming),d=ye(re=>re.isSubmitting),f=ye(re=>re.loadingConversations),h=ye(re=>re.inputValue),p=ye(re=>re.attachments),g=ye(re=>re.conversationUsage),y=ye(re=>re.pendingApprovals),v=ye(re=>re.setCurrentConversation),b=ye(re=>re.setAvailableConversations),S=ye(re=>re.setChatItems),w=ye(re=>re.setIsStreaming),j=ye(re=>re.setIsSubmitting),k=ye(re=>re.setLoadingConversations),M=ye(re=>re.setInputValue),_=ye(re=>re.setAttachments),A=ye(re=>re.updateConversationUsage),D=ye(re=>re.setPendingApprovals),[L,H]=N.useState(!1),[B,q]=N.useState(0),[Z,K]=N.useState(null),[G,te]=N.useState(!1),I=N.useRef(null),V=N.useRef(null),E=N.useRef(""),O=N.useRef(null),z=N.useRef(null),P=N.useRef(!1);N.useEffect(()=>{if(!V.current)return;const re=I.current?.querySelector("[data-radix-scroll-area-viewport]");let ve=!1;if(re){const{scrollTop:ke,scrollHeight:De,clientHeight:be}=re,Te=De-ke-be<100;ve=P.current||Te}else ve=!0;ve&&V.current.scrollIntoView({behavior:u?"instant":"smooth"}),P.current&&!u&&(P.current=!1)},[l,u]),N.useEffect(()=>{!u&&!d&&O.current?.focus()},[u,d]),N.useEffect(()=>{const re=async()=>{if(e){k(!0);try{try{const{data:be}=await Lt.listConversations(e.id);if(be.length>0){const Te=be[0];b(be),v(Te);try{const{data:Ye}=await Lt.listConversationItems(Te.id);S(Ye),w(!1)}catch{console.debug(`No items found for conversation ${Te.id}, starting fresh`),S([]),w(!1)}localStorage.setItem(`devui_convs_${e.id}`,JSON.stringify(be));return}}catch{}const ve=`devui_convs_${e.id}`,ke=localStorage.getItem(ve);if(ke)try{const be=JSON.parse(ke);if(be.length>0)try{await Lt.listConversationItems(be[0].id),b(be),v(be[0]),S([]),w(!1);return}catch{console.debug(`Cached conversation ${be[0].id} no longer exists, clearing cache`),localStorage.removeItem(ve)}}catch{localStorage.removeItem(ve)}const De=await Lt.createConversation({agent_id:e.id});v(De),b([De]),S([]),w(!1),localStorage.setItem(ve,JSON.stringify([De]))}catch{b([]),S([]),w(!1)}finally{k(!1)}}};S([]),w(!1),v(void 0),E.current="",re()},[e,k,b,v,S,w]);const T=async re=>{const ve=[];for(const ke of re){const De=`${Date.now()}-${Math.random().toString(36).substr(2,9)}`,be=se(ke);let Te;be==="image"&&(Te=await pe(ke)),ve.push({id:De,file:ke,preview:Te,type:be})}_([...ye.getState().attachments,...ve])},U=re=>{_(ye.getState().attachments.filter(ve=>ve.id!==re))},X=re=>{re.preventDefault(),re.stopPropagation(),q(ve=>ve+1),re.dataTransfer.items&&re.dataTransfer.items.length>0&&H(!0)},ee=re=>{re.preventDefault(),re.stopPropagation();const ve=B-1;q(ve),ve===0&&H(!1)},ae=re=>{re.preventDefault(),re.stopPropagation()},me=async re=>{if(re.preventDefault(),re.stopPropagation(),H(!1),q(0),d||u)return;const ve=Array.from(re.dataTransfer.files);ve.length>0&&await T(ve)},ue=async re=>{const ve=Array.from(re.clipboardData.items),ke=[];let De=!1;const be=8e3;for(const Te of ve)if(Te.type.startsWith("image/")){re.preventDefault();const Ye=Te.getAsFile();if(Ye){const it=Date.now();ke.push(new File([Ye],`screenshot-${it}.png`,{type:Ye.type}))}}else Te.type==="text/plain"&&!De&&(De=!0,re.preventDefault(),await new Promise(Ye=>{Te.getAsString(it=>{const Tn=(it.match(/\n/g)||[]).length;if(it.length>be||Tn>50||/^\s*[{[][\s\S]*[}\]]\s*$/.test(it)||/^<\?xml|^<html|^<!DOCTYPE/i.test(it)){const Ue=Q(it),Qe=Date.now(),ht=new Blob([it],{type:"text/plain"});ke.push(new File([ht],`pasted-text-${Qe}${Ue}`,{type:"text/plain"}))}else{const Ue=O.current;if(Ue){const Qe=Ue.selectionStart,ht=Ue.selectionEnd,Ft=Ue.value,gs=Ft.slice(0,Qe)+it+Ft.slice(ht);M(gs),setTimeout(()=>{Ue.selectionStart=Ue.selectionEnd=Qe+it.length,Ue.focus()},0)}}Ye()})}));if(ke.length>0){await T(ke);const Te=ke.length===1?ke[0].name.includes("screenshot")?"Screenshot added as attachment":"Large text converted to file":`${ke.length} files added`;K(Te),setTimeout(()=>K(null),3e3)}},Q=re=>{const ve=re.trim(),ke=ve.split(`
519
- `);if(/^{[\s\S]*}$|^\[[\s\S]*\]$/.test(ve))return".json";if(/^<\?xml|^<html|^<!DOCTYPE/i.test(ve))return".html";if(/^```/.test(ve))return".md";if(/\t/.test(re)&&ke.length>1)return".tsv";if(ke.length>2){const De=ke.filter(Te=>Te.includes(",")),be=ke.filter(Te=>Te.includes(";"));if(De.length>ke.length*.5&&De.reduce((Ye,it)=>Ye+(it.match(/,/g)||[]).length,0)/De.length>=2||be.length>ke.length*.5&&be.reduce((Ye,it)=>Ye+(it.match(/;/g)||[]).length,0)/be.length>=2)return".csv"}return".txt"},se=re=>re.type.startsWith("image/")?"image":re.type==="application/pdf"?"pdf":re.type.startsWith("audio/")?"audio":"other",pe=re=>new Promise((ve,ke)=>{const De=new FileReader;De.onload=()=>ve(De.result),De.onerror=ke,De.readAsDataURL(re)}),le=N.useCallback(async()=>{if(e)try{const re=await Lt.createConversation({agent_id:e.id});v(re),b([re,...ye.getState().availableConversations]),S([]),w(!1),ye.setState({conversationUsage:{total_tokens:0,message_count:0}}),E.current="";const ve=`devui_convs_${e.id}`,ke=[re,...a];localStorage.setItem(ve,JSON.stringify(ke))}catch{}},[e,a,v,b,S,w]),de=N.useCallback(async(re,ve)=>{if(ve&&(ve.preventDefault(),ve.stopPropagation()),!!confirm("Delete this conversation? This cannot be undone."))try{if(await Lt.deleteConversation(re)){const De=a.filter(be=>be.id!==re);if(b(De),e){const be=`devui_convs_${e.id}`;localStorage.setItem(be,JSON.stringify(De))}if(o?.id===re)if(De.length>0){const be=De[0];v(be),S([]),w(!1)}else v(void 0),S([]),w(!1),ye.setState({conversationUsage:{total_tokens:0,message_count:0}}),E.current="";r("clear")}}catch{alert("Failed to delete conversation. Please try again.")}},[a,o,e,r,b,v,S,w]),he=N.useCallback(async re=>{const ve=a.find(ke=>ke.id===re);if(ve){v(ve),r("clear");try{const De=(await Lt.listConversationItems(re)).data;S(De),w(!1),ye.setState({conversationUsage:{total_tokens:0,message_count:De.length}})}catch{console.debug(`No items found for conversation ${re}, starting with empty chat`),S([]),w(!1),ye.setState({conversationUsage:{total_tokens:0,message_count:0}})}E.current=""}},[a,r,v,S,w]),xe=async(re,ve)=>{const ke=y.find(Te=>Te.request_id===re);if(!ke)return;const be={input:[{type:"message",role:"user",content:[{type:"function_approval_response",request_id:re,approved:ve,function_call:ke.function_call}]}],conversation_id:o?.id};return D(ye.getState().pendingApprovals.filter(Te=>Te.request_id!==re)),be},ge=N.useCallback(async re=>{if(!e)return;const ve=[];for(const be of re.input)if(be.type==="message"&&Array.isArray(be.content)){for(const Te of be.content)if(Te.type==="input_text")ve.push({type:"text",text:Te.text});else if(Te.type==="input_image")ve.push({type:"input_image",image_url:Te.image_url||"",detail:"auto"});else if(Te.type==="input_file"){const Ye=Te;ve.push({type:"input_file",file_data:Ye.file_data,filename:Ye.filename})}}const ke={id:`user-${Date.now()}`,type:"message",role:"user",content:ve,status:"completed"};S([...ye.getState().chatItems,ke]),w(!0);const De={id:`assistant-${Date.now()}`,type:"message",role:"assistant",content:[],status:"in_progress"};S([...ye.getState().chatItems,De]);try{let be=o;if(!be)try{be=await Lt.createConversation({agent_id:e.id}),v(be),b([be,...ye.getState().availableConversations])}catch{}const Te={input:re.input,conversation_id:be?.id};E.current="";const Ye=Lt.streamAgentExecutionOpenAI(e.id,Te);for await(const Fe of Ye){if(r(Fe),Fe.type==="response.completed"){const Qe=Fe.response?.usage;Qe&&(z.current={input_tokens:Qe.input_tokens,output_tokens:Qe.output_tokens,total_tokens:Qe.total_tokens});continue}if(Fe.type==="response.function_approval.requested"){const Ue=Fe;D([...ye.getState().pendingApprovals,{request_id:Ue.request_id,function_call:Ue.function_call}]);continue}if(Fe.type==="response.function_approval.responded"){const Ue=Fe;D(ye.getState().pendingApprovals.filter(Qe=>Qe.request_id!==Ue.request_id));continue}if(Fe.type==="error"){const Qe=Fe.message||"An error occurred",ht=ye.getState().chatItems;S(ht.map(Ft=>Ft.id===De.id&&Ft.type==="message"?{...Ft,content:[{type:"text",text:Qe}],status:"incomplete"}:Ft)),w(!1);return}if(Fe.type==="response.output_text.delta"&&"delta"in Fe&&Fe.delta){E.current+=Fe.delta;const Ue=ye.getState().chatItems;S(Ue.map(Qe=>Qe.id===De.id&&Qe.type==="message"?{...Qe,content:[{type:"text",text:E.current}],status:"in_progress"}:Qe))}}const it=z.current,Tn=ye.getState().chatItems;S(Tn.map(Fe=>Fe.id===De.id&&Fe.type==="message"?{...Fe,status:"completed",usage:it||void 0}:Fe)),w(!1),it&&A(it.total_tokens),z.current=null}catch(be){const Te=ye.getState().chatItems;S(Te.map(Ye=>Ye.id===De.id&&Ye.type==="message"?{...Ye,content:[{type:"text",text:`Error: ${be instanceof Error?be.message:"Failed to get response"}`}],status:"incomplete"}:Ye)),w(!1)}},[e,o,r,S,w,v,b,D,A]),Be=async re=>{if(re.preventDefault(),!h.trim()&&p.length===0||d||!e)return;P.current=!0,j(!0);const ve=h.trim();M("");try{if(p.length>0||ve){const ke=[];ve&&ke.push({text:ve,type:"input_text"});for(const be of p){const Te=await pe(be.file);if(be.file.type.startsWith("image/"))ke.push({detail:"auto",type:"input_image",image_url:Te});else if(be.file.type==="text/plain"&&(be.file.name.includes("pasted-text-")||be.file.name.endsWith(".txt")||be.file.name.endsWith(".csv")||be.file.name.endsWith(".json")||be.file.name.endsWith(".html")||be.file.name.endsWith(".md")||be.file.name.endsWith(".tsv"))){const Ye=await be.file.text();ke.push({text:Ye,type:"input_text"})}else{const Ye=Te.split(",")[1];ke.push({type:"input_file",file_data:Ye,file_url:Te,filename:be.file.name})}}await ge({input:[{type:"message",role:"user",content:ke}],conversation_id:o?.id})}else await ge({input:[{type:"message",role:"user",content:[{text:ve,type:"input_text"}]}],conversation_id:o?.id});_([])}finally{j(!1)}},at=e&&!d&&!u&&(h.trim()||p.length>0);return i.jsxs("div",{className:"flex h-[calc(100vh-3.5rem)] flex-col",children:[i.jsxs("div",{className:"border-b pb-2 p-4 flex-shrink-0",children:[i.jsxs("div",{className:"flex flex-col lg:flex-row lg:items-center lg:justify-between gap-3 mb-3",children:[i.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[i.jsx("h2",{className:"font-semibold text-sm truncate",children:i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(qn,{className:"h-4 w-4 flex-shrink-0"}),i.jsxs("span",{className:"truncate",children:["Chat with ",e.name||e.id]})]})}),i.jsx(Oe,{variant:"ghost",size:"sm",onClick:()=>te(!0),className:"h-6 w-6 p-0 flex-shrink-0",title:"View agent details",children:i.jsx(hu,{className:"h-4 w-4"})})]}),i.jsxs("div",{className:"flex flex-col sm:flex-row items-stretch sm:items-center gap-2 flex-shrink-0",children:[i.jsxs(D2,{value:o?.id||"",onValueChange:he,disabled:f||d,children:[i.jsx(z2,{className:"w-full sm:w-64",children:i.jsx(O2,{placeholder:f?"Loading...":a.length===0?"No conversations":o?`Conversation ${o.id.slice(-8)}`:"Select conversation",children:o&&i.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[i.jsxs("span",{children:["Conversation ",o.id.slice(-8)]}),g.total_tokens>0&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"text-muted-foreground",children:"•"}),i.jsxs("span",{className:"text-muted-foreground",children:[g.total_tokens>=1e3?`${(g.total_tokens/1e3).toFixed(1)}k`:g.total_tokens," ","tokens"]})]})]})})}),i.jsx(L2,{children:a.map(re=>i.jsx(I2,{value:re.id,children:i.jsxs("div",{className:"flex items-center justify-between w-full",children:[i.jsxs("span",{children:["Conversation ",re.id.slice(-8)]}),re.created_at&&i.jsx("span",{className:"text-xs text-muted-foreground ml-3",children:new Date(re.created_at*1e3).toLocaleDateString()})]})},re.id))})]}),i.jsx(Oe,{variant:"outline",size:"icon",onClick:()=>o&&de(o.id),disabled:!o||d,title:o?`Delete Conversation ${o.id.slice(-8)}`:"No conversation selected",children:i.jsx(b1,{className:"h-4 w-4"})}),i.jsxs(Oe,{variant:"outline",size:"lg",onClick:le,disabled:!e||d,className:"whitespace-nowrap ",children:[i.jsx(v1,{className:"h-4 w-4 mr-2"}),i.jsx("span",{className:"hidden md:inline",children:" New Conversation"})]})]})]}),e.description&&i.jsx("p",{className:"text-sm text-muted-foreground",children:e.description})]}),i.jsx(ta,{className:"flex-1 p-4 h-0",ref:I,children:i.jsxs("div",{className:"space-y-4",children:[l.length===0?i.jsxs("div",{className:"flex flex-col items-center justify-center h-32 text-center",children:[i.jsxs("div",{className:"text-muted-foreground text-sm",children:["Start a conversation with"," ",e.name||e.id]}),i.jsx("div",{className:"text-xs text-muted-foreground mt-1",children:"Type a message below to begin"})]}):l.map(re=>i.jsx($T,{item:re},re.id)),i.jsx("div",{ref:V})]})}),y.length>0&&i.jsx("div",{className:"border-t bg-amber-50 dark:bg-amber-950/20 p-4 flex-shrink-0",children:i.jsxs("div",{className:"flex items-start gap-3",children:[i.jsx(ts,{className:"h-5 w-5 text-amber-600 dark:text-amber-500 mt-0.5 flex-shrink-0"}),i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsx("h4",{className:"font-medium text-sm mb-2",children:"Approval Required"}),i.jsx("div",{className:"space-y-2",children:y.map(re=>i.jsxs("div",{className:"bg-white dark:bg-gray-900 rounded-lg p-3 border border-amber-200 dark:border-amber-900",children:[i.jsxs("div",{className:"font-mono text-xs mb-3 break-all",children:[i.jsx("span",{className:"text-blue-600 dark:text-blue-400 font-semibold",children:re.function_call.name}),i.jsx("span",{className:"text-gray-500",children:"("}),i.jsx("span",{className:"text-gray-700 dark:text-gray-300",children:JSON.stringify(re.function_call.arguments)}),i.jsx("span",{className:"text-gray-500",children:")"})]}),i.jsxs("div",{className:"flex gap-2",children:[i.jsxs(Oe,{size:"sm",onClick:async()=>{const ve=await xe(re.request_id,!0);ve&&await ge(ve)},variant:"default",className:"flex-1 sm:flex-none",children:[i.jsx(Pu,{className:"h-4 w-4 mr-1"}),"Approve"]}),i.jsxs(Oe,{size:"sm",onClick:async()=>{const ve=await xe(re.request_id,!1);ve&&await ge(ve)},variant:"outline",className:"flex-1 sm:flex-none",children:[i.jsx(pp,{className:"h-4 w-4 mr-1"}),"Reject"]})]})]},re.request_id))})]})]})}),i.jsx("div",{className:"border-t flex-shrink-0",children:i.jsxs("div",{className:`p-4 relative transition-all duration-300 ease-in-out ${L?"bg-blue-50 dark:bg-blue-950/20":""}`,onDragEnter:X,onDragLeave:ee,onDragOver:ae,onDrop:me,children:[L&&i.jsx("div",{className:"absolute inset-2 border-2 border-dashed border-blue-400 dark:border-blue-500 rounded-lg bg-blue-50/80 dark:bg-blue-950/40 backdrop-blur-sm flex items-center justify-center transition-all duration-200 ease-in-out z-10",children:i.jsxs("div",{className:"text-center",children:[i.jsx("div",{className:"text-blue-600 dark:text-blue-400 text-sm font-medium mb-1",children:"Drop files here"}),i.jsx("div",{className:"text-blue-500 dark:text-blue-500 text-xs",children:"Images, PDFs, and other files"})]})}),p.length>0&&i.jsx("div",{className:"mb-3",children:i.jsx(M5,{attachments:p,onRemoveAttachment:U})}),Z&&i.jsxs("div",{className:`absolute bottom-24 left-1/2 -translate-x-1/2 z-20
520
- bg-blue-500 text-white px-4 py-2 rounded-full text-sm
521
- animate-in slide-in-from-bottom-2 fade-in duration-200
522
- flex items-center gap-2 shadow-lg`,children:[Z.includes("screenshot")?i.jsx(JA,{className:"h-3 w-3"}):i.jsx(Yo,{className:"h-3 w-3"}),Z]}),i.jsxs("form",{onSubmit:Be,className:"flex gap-2 items-end",children:[i.jsx(eu,{ref:O,value:h,onChange:re=>M(re.target.value),onPaste:ue,onKeyDown:re=>{re.key==="Enter"&&!re.shiftKey&&(re.preventDefault(),Be(re))},placeholder:`Message ${e.name||e.id}... (Shift+Enter for new line)`,disabled:d||u,className:"flex-1 min-h-[40px] max-h-[200px] resize-none",style:{fieldSizing:"content"}}),i.jsx(C5,{onFilesSelected:T,disabled:d||u}),i.jsx(Oe,{type:"submit",size:"icon",disabled:!at,className:"shrink-0 h-10",children:d?i.jsx(yp,{size:"sm"}):i.jsx(iM,{className:"h-4 w-4"})})]})]})}),i.jsx(_T,{agent:e,open:G,onOpenChange:te})]})}function vy({message:e="Loading...",description:r,size:o="md",className:a,fullPage:l=!1}){const u=i.jsxs("div",{className:qe("flex flex-col items-center justify-center gap-3",l?"min-h-[50vh]":"py-8",a),children:[i.jsx(yp,{size:o,className:"text-muted-foreground"}),i.jsxs("div",{className:"text-center space-y-1",children:[i.jsx("p",{className:qe("font-medium text-muted-foreground",o==="sm"&&"text-sm",o==="lg"&&"text-lg"),children:e}),r&&i.jsx("p",{className:"text-sm text-muted-foreground/80",children:r})]})]});return l?i.jsx("div",{className:"flex items-center justify-center min-h-screen bg-background",children:u}):u}var Qu="Checkbox",[qT,E7]=kr(Qu),[YT,Ap]=qT(Qu);function GT(e){const{__scopeCheckbox:r,checked:o,children:a,defaultChecked:l,disabled:u,form:d,name:f,onCheckedChange:h,required:p,value:g="on",internal_do_not_use_render:y}=e,[v,b]=Ja({prop:o,defaultProp:l??!1,onChange:h,caller:Qu}),[S,w]=N.useState(null),[j,k]=N.useState(null),M=N.useRef(!1),_=S?!!d||!!S.closest("form"):!0,A={checked:v,disabled:u,setChecked:b,control:S,setControl:w,name:f,form:d,value:g,hasConsumerStoppedPropagationRef:M,required:p,defaultChecked:uo(l)?!1:l,isFormControl:_,bubbleInput:j,setBubbleInput:k};return i.jsx(YT,{scope:r,...A,children:XT(y)?y(A):a})}var H2="CheckboxTrigger",B2=N.forwardRef(({__scopeCheckbox:e,onKeyDown:r,onClick:o,...a},l)=>{const{control:u,value:d,disabled:f,checked:h,required:p,setControl:g,setChecked:y,hasConsumerStoppedPropagationRef:v,isFormControl:b,bubbleInput:S}=Ap(H2,e),w=Ke(l,g),j=N.useRef(h);return N.useEffect(()=>{const k=u?.form;if(k){const M=()=>y(j.current);return k.addEventListener("reset",M),()=>k.removeEventListener("reset",M)}},[u,y]),i.jsx(ze.button,{type:"button",role:"checkbox","aria-checked":uo(h)?"mixed":h,"aria-required":p,"data-state":Y2(h),"data-disabled":f?"":void 0,disabled:f,value:d,...a,ref:w,onKeyDown:Ee(r,k=>{k.key==="Enter"&&k.preventDefault()}),onClick:Ee(o,k=>{y(M=>uo(M)?!0:!M),S&&b&&(v.current=k.isPropagationStopped(),v.current||k.stopPropagation())})})});B2.displayName=H2;var U2=N.forwardRef((e,r)=>{const{__scopeCheckbox:o,name:a,checked:l,defaultChecked:u,required:d,disabled:f,value:h,onCheckedChange:p,form:g,...y}=e;return i.jsx(GT,{__scopeCheckbox:o,checked:l,defaultChecked:u,disabled:f,required:d,onCheckedChange:p,name:a,form:g,value:h,internal_do_not_use_render:({isFormControl:v})=>i.jsxs(i.Fragment,{children:[i.jsx(B2,{...y,ref:r,__scopeCheckbox:o}),v&&i.jsx(q2,{__scopeCheckbox:o})]})})});U2.displayName=Qu;var P2="CheckboxIndicator",$2=N.forwardRef((e,r)=>{const{__scopeCheckbox:o,forceMount:a,...l}=e,u=Ap(P2,o);return i.jsx(An,{present:a||uo(u.checked)||u.checked===!0,children:i.jsx(ze.span,{"data-state":Y2(u.checked),"data-disabled":u.disabled?"":void 0,...l,ref:r,style:{pointerEvents:"none",...e.style}})})});$2.displayName=P2;var V2="CheckboxBubbleInput",q2=N.forwardRef(({__scopeCheckbox:e,...r},o)=>{const{control:a,hasConsumerStoppedPropagationRef:l,checked:u,defaultChecked:d,required:f,disabled:h,name:p,value:g,form:y,bubbleInput:v,setBubbleInput:b}=Ap(V2,e),S=Ke(o,b),w=a2(u),j=nw(a);N.useEffect(()=>{const M=v;if(!M)return;const _=window.HTMLInputElement.prototype,D=Object.getOwnPropertyDescriptor(_,"checked").set,L=!l.current;if(w!==u&&D){const H=new Event("click",{bubbles:L});M.indeterminate=uo(u),D.call(M,uo(u)?!1:u),M.dispatchEvent(H)}},[v,w,u,l]);const k=N.useRef(uo(u)?!1:u);return i.jsx(ze.input,{type:"checkbox","aria-hidden":!0,defaultChecked:d??k.current,required:f,disabled:h,name:p,value:g,form:y,...r,tabIndex:-1,ref:S,style:{...r.style,...j,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});q2.displayName=V2;function XT(e){return typeof e=="function"}function uo(e){return e==="indeterminate"}function Y2(e){return uo(e)?"indeterminate":e?"checked":"unchecked"}function ki({className:e,...r}){return i.jsx(U2,{"data-slot":"checkbox",className:qe("peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...r,children:i.jsx($2,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current transition-none",children:i.jsx(Pu,{className:"size-3.5"})})})}function FT(e){return["name","title","id","key","label","type","status","tag","category","code","username","password"].includes(e.toLowerCase())}function ro({name:e,schema:r,value:o,onChange:a,isRequired:l=!1}){const{type:u,description:d,enum:f,default:h}=r,p=r.format==="textarea"||d&&d.length>100||u==="string"&&!f&&!FT(e),g=p||d&&d.length>150,y=p||d&&d.length>80||u==="array",v=(()=>{switch(u){case"string":return f?i.jsxs("div",{className:"space-y-2",children:[i.jsxs(io,{htmlFor:e,children:[e,l&&i.jsx("span",{className:"text-destructive ml-1",children:"*"})]}),i.jsxs(D2,{value:typeof o=="string"&&o?o:typeof h=="string"?h:f[0],onValueChange:S=>a(S),children:[i.jsx(z2,{children:i.jsx(O2,{placeholder:`Select ${e}`})}),i.jsx(L2,{children:f.map(S=>i.jsx(I2,{value:S,children:S},S))})]}),d&&i.jsx("p",{className:"text-sm text-muted-foreground",children:d})]}):p||d&&d.length>100?i.jsxs("div",{className:"space-y-2",children:[i.jsxs(io,{htmlFor:e,children:[e,l&&i.jsx("span",{className:"text-destructive ml-1",children:"*"})]}),i.jsx(eu,{id:e,value:typeof o=="string"?o:"",onChange:S=>a(S.target.value),placeholder:typeof h=="string"?h:`Enter ${e}`,rows:p?4:2,className:"min-w-[300px] w-full"}),d&&i.jsx("p",{className:"text-sm text-muted-foreground",children:d})]}):i.jsxs("div",{className:"space-y-2",children:[i.jsxs(io,{htmlFor:e,children:[e,l&&i.jsx("span",{className:"text-destructive ml-1",children:"*"})]}),i.jsx(bh,{id:e,type:"text",value:typeof o=="string"?o:"",onChange:S=>a(S.target.value),placeholder:typeof h=="string"?h:`Enter ${e}`}),d&&i.jsx("p",{className:"text-sm text-muted-foreground",children:d})]});case"number":return i.jsxs("div",{className:"space-y-2",children:[i.jsxs(io,{htmlFor:e,children:[e,l&&i.jsx("span",{className:"text-destructive ml-1",children:"*"})]}),i.jsx(bh,{id:e,type:"number",value:typeof o=="number"?o:"",onChange:S=>{const w=parseFloat(S.target.value);a(isNaN(w)?"":w)},placeholder:typeof h=="number"?h.toString():`Enter ${e}`}),d&&i.jsx("p",{className:"text-sm text-muted-foreground",children:d})]});case"boolean":return i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(ki,{id:e,checked:!!o,onCheckedChange:S=>a(S)}),i.jsxs(io,{htmlFor:e,children:[e,l&&i.jsx("span",{className:"text-destructive ml-1",children:"*"})]})]}),d&&i.jsx("p",{className:"text-sm text-muted-foreground",children:d})]});case"array":return i.jsxs("div",{className:"space-y-2",children:[i.jsxs(io,{htmlFor:e,children:[e,l&&i.jsx("span",{className:"text-destructive ml-1",children:"*"})]}),i.jsx(eu,{id:e,value:Array.isArray(o)?o.join(", "):typeof o=="string"?o:"",onChange:S=>{const w=S.target.value.split(",").map(j=>j.trim()).filter(j=>j.length>0);a(w)},placeholder:"Enter items separated by commas",rows:2}),d&&i.jsx("p",{className:"text-sm text-muted-foreground",children:d})]});case"object":default:return i.jsxs("div",{className:"space-y-2",children:[i.jsxs(io,{htmlFor:e,children:[e,l&&i.jsx("span",{className:"text-destructive ml-1",children:"*"})]}),i.jsx(eu,{id:e,value:typeof o=="object"&&o!==null?JSON.stringify(o,null,2):typeof o=="string"?o:"",onChange:S=>{try{const w=JSON.parse(S.target.value);a(w)}catch{a(S.target.value)}},placeholder:'{"key": "value"}',rows:3}),d&&i.jsx("p",{className:"text-sm text-muted-foreground",children:d})]})}})(),b=()=>g?"md:col-span-2 lg:col-span-3 xl:col-span-4":y?"xl:col-span-2":"";return i.jsx("div",{className:b(),children:v})}function ZT({inputSchema:e,inputTypeName:r,onSubmit:o,isSubmitting:a=!1,className:l}){const[u,d]=N.useState(!1),[f,h]=N.useState(!1),p=l?.includes("embedded"),[g,y]=N.useState({}),[v,b]=N.useState(!1),S=e.properties||{},w=Object.keys(S),j=e.required||[],k=e.type==="string"&&!e.enum,M=w.filter(E=>!j.includes(E)),_=j.includes("role")&&M.some(E=>["text","message","content"].includes(E))&&S.role?.type==="string",A=w.filter(E=>j.includes(E)&&!(_&&E==="role")),D=M,L=_?[...D].sort((E,O)=>{const z=P=>["text","message","content"].includes(P)?1:0;return z(O)-z(E)}):D,B=Math.max(0,(_?1:6)-A.length),q=L.slice(0,B),Z=L.slice(B),K=Z.length>0,G=A.length>0,te=k?g.value!==void 0&&g.value!=="":j.length>0?j.every(E=>_&&E==="role"&&g.role==="user"?!0:g[E]!==void 0&&g[E]!==""):Object.keys(g).length>0;N.useEffect(()=>{if(e.type==="string")y({value:e.default||""});else if(e.type==="object"&&e.properties){const E={};Object.entries(e.properties).forEach(([O,z])=>{z.default!==void 0?E[O]=z.default:z.enum&&z.enum.length>0&&(E[O]=z.enum[0])}),_&&!E.role&&(E.role="user"),y(E)}},[e,_]);const I=E=>{if(E.preventDefault(),b(!0),e.type==="string")o({input:g.value||""});else if(e.type==="object"){const O=e.properties||{},z=Object.keys(O);if(z.length===1){const P=z[0];o({[P]:g[P]||""})}else{const P={};Object.keys(g).forEach(T=>{const U=g[T];(j.includes(T)||U!==void 0&&U!==""&&U!==null)&&(P[T]=U)}),o(P)}}else o(g);p||d(!1),b(!1)},V=(E,O)=>{y(z=>({...z,[E]:O}))};return p?i.jsxs("form",{onSubmit:I,className:l,children:[i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[k&&i.jsx(ro,{name:"Input",schema:e,value:g.value,onChange:E=>V("value",E),isRequired:!1}),!k&&i.jsxs(i.Fragment,{children:[A.map(E=>i.jsx(ro,{name:E,schema:S[E],value:g[E],onChange:O=>V(E,O),isRequired:!0},E)),G&&D.length>0&&i.jsx("div",{className:"sm:col-span-2 border-t border-border my-2"}),q.map(E=>i.jsx(ro,{name:E,schema:S[E],value:g[E],onChange:O=>V(E,O),isRequired:!1},E)),K&&i.jsx("div",{className:"sm:col-span-2",children:i.jsx(Oe,{type:"button",variant:"ghost",size:"sm",onClick:()=>h(!f),className:"w-full justify-center gap-2",children:f?i.jsxs(i.Fragment,{children:[i.jsx(ph,{className:"h-4 w-4"}),"Hide ",Z.length," optional field",Z.length!==1?"s":""]}):i.jsxs(i.Fragment,{children:[i.jsx(kn,{className:"h-4 w-4"}),"Show ",Z.length," optional field",Z.length!==1?"s":""]})})}),f&&Z.map(E=>i.jsx(ro,{name:E,schema:S[E],value:g[E],onChange:O=>V(E,O),isRequired:!1},E))]})]}),i.jsx("div",{className:"flex gap-2 mt-4 justify-end",children:i.jsxs(Oe,{type:"submit",disabled:v||!te,size:"default",children:[i.jsx($m,{className:"h-4 w-4"}),v?"Running...":"Run Workflow"]})})]}):i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:qe("flex flex-col",l),children:[i.jsxs("div",{className:"border-b border-border px-4 py-3 bg-muted",children:[i.jsx(e2,{className:"text-sm mb-3",children:"Run Workflow"}),i.jsxs(Oe,{onClick:()=>d(!0),disabled:a,className:"w-full",size:"default",children:[i.jsx($m,{className:"h-4 w-4 mr-2"}),a?"Running...":"Run Workflow"]})]}),i.jsxs("div",{className:"px-4 py-3",children:[i.jsxs("div",{className:"text-sm text-muted-foreground",children:[i.jsx("strong",{children:"Input Type:"})," ",i.jsx("code",{className:"bg-muted px-1 py-0.5 rounded",children:r}),e.type==="object"&&e.properties&&i.jsxs("span",{className:"ml-2",children:["(",Object.keys(e.properties).length," field",Object.keys(e.properties).length!==1?"s":"",")"]})]}),i.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:'Click "Run Workflow" to configure inputs and execute'})]})]}),i.jsx(Sr,{open:u,onOpenChange:d,children:i.jsxs(Er,{className:"w-full max-w-md sm:max-w-lg md:max-w-2xl lg:max-w-4xl xl:max-w-5xl max-h-[90vh] flex flex-col",children:[i.jsxs(_r,{children:[i.jsx(jr,{children:"Run Workflow"}),i.jsx(ho,{onClose:()=>d(!1)})]}),i.jsx("div",{className:"px-8 py-4 border-b flex-shrink-0",children:i.jsx("div",{className:"text-sm text-muted-foreground",children:i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("span",{className:"font-medium",children:"Input Type:"}),i.jsx("code",{className:"bg-muted px-3 py-1 text-xs font-mono",children:r}),e.type==="object"&&i.jsxs("span",{className:"text-xs text-muted-foreground",children:[w.length," field",w.length!==1?"s":""]})]})})}),i.jsx("div",{className:"px-8 py-6 overflow-y-auto flex-1 min-h-0",children:i.jsx("form",{id:"workflow-modal-form",onSubmit:I,children:i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6 md:gap-8 max-w-none",children:[k&&i.jsxs("div",{className:"md:col-span-2 lg:col-span-3 xl:col-span-4",children:[i.jsx(ro,{name:"Input",schema:e,value:g.value,onChange:E=>V("value",E),isRequired:!1}),e.description&&i.jsx("p",{className:"text-sm text-muted-foreground mt-2",children:e.description})]}),!k&&i.jsxs(i.Fragment,{children:[A.map(E=>i.jsx(ro,{name:E,schema:S[E],value:g[E],onChange:O=>V(E,O),isRequired:!0},E)),G&&D.length>0&&i.jsx("div",{className:"md:col-span-2 lg:col-span-3 xl:col-span-4",children:i.jsx("div",{className:"border-t border-border"})}),q.map(E=>i.jsx(ro,{name:E,schema:S[E],value:g[E],onChange:O=>V(E,O),isRequired:!1},E)),K&&i.jsx("div",{className:"md:col-span-2 lg:col-span-3 xl:col-span-4",children:i.jsx(Oe,{type:"button",variant:"ghost",size:"sm",onClick:()=>h(!f),className:"w-full justify-center gap-2",children:f?i.jsxs(i.Fragment,{children:[i.jsx(ph,{className:"h-4 w-4"}),"Hide ",Z.length," optional field",Z.length!==1?"s":""]}):i.jsxs(i.Fragment,{children:[i.jsx(kn,{className:"h-4 w-4"}),"Show ",Z.length," optional field",Z.length!==1?"s":""]})})}),f&&Z.map(E=>i.jsx(ro,{name:E,schema:S[E],value:g[E],onChange:O=>V(E,O),isRequired:!1},E))]})]})})}),i.jsx("div",{className:"px-8 py-4 border-t flex-shrink-0",children:i.jsxs(p5,{children:[i.jsx(Oe,{variant:"outline",onClick:()=>d(!1),disabled:v,children:"Cancel"}),i.jsxs(Oe,{type:"submit",form:"workflow-modal-form",disabled:v||!te,children:[i.jsx($m,{className:"h-4 w-4 mr-2"}),v?"Running...":"Run Workflow"]})]})})]})})]})}function bt(e){if(typeof e=="string"||typeof e=="number")return""+e;let r="";if(Array.isArray(e))for(let o=0,a;o<e.length;o++)(a=bt(e[o]))!==""&&(r+=(r&&" ")+a);else for(let o in e)e[o]&&(r+=(r&&" ")+o);return r}var KT={value:()=>{}};function Ju(){for(var e=0,r=arguments.length,o={},a;e<r;++e){if(!(a=arguments[e]+"")||a in o||/[\s.]/.test(a))throw new Error("illegal type: "+a);o[a]=[]}return new tu(o)}function tu(e){this._=e}function WT(e,r){return e.trim().split(/^|\s+/).map(function(o){var a="",l=o.indexOf(".");if(l>=0&&(a=o.slice(l+1),o=o.slice(0,l)),o&&!r.hasOwnProperty(o))throw new Error("unknown type: "+o);return{type:o,name:a}})}tu.prototype=Ju.prototype={constructor:tu,on:function(e,r){var o=this._,a=WT(e+"",o),l,u=-1,d=a.length;if(arguments.length<2){for(;++u<d;)if((l=(e=a[u]).type)&&(l=QT(o[l],e.name)))return l;return}if(r!=null&&typeof r!="function")throw new Error("invalid callback: "+r);for(;++u<d;)if(l=(e=a[u]).type)o[l]=yy(o[l],e.name,r);else if(r==null)for(l in o)o[l]=yy(o[l],e.name,null);return this},copy:function(){var e={},r=this._;for(var o in r)e[o]=r[o].slice();return new tu(e)},call:function(e,r){if((l=arguments.length-2)>0)for(var o=new Array(l),a=0,l,u;a<l;++a)o[a]=arguments[a+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(u=this._[e],a=0,l=u.length;a<l;++a)u[a].value.apply(r,o)},apply:function(e,r,o){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var a=this._[e],l=0,u=a.length;l<u;++l)a[l].value.apply(r,o)}};function QT(e,r){for(var o=0,a=e.length,l;o<a;++o)if((l=e[o]).name===r)return l.value}function yy(e,r,o){for(var a=0,l=e.length;a<l;++a)if(e[a].name===r){e[a]=KT,e=e.slice(0,a).concat(e.slice(a+1));break}return o!=null&&e.push({name:r,value:o}),e}var Ch="http://www.w3.org/1999/xhtml";const by={svg:"http://www.w3.org/2000/svg",xhtml:Ch,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function ed(e){var r=e+="",o=r.indexOf(":");return o>=0&&(r=e.slice(0,o))!=="xmlns"&&(e=e.slice(o+1)),by.hasOwnProperty(r)?{space:by[r],local:e}:e}function JT(e){return function(){var r=this.ownerDocument,o=this.namespaceURI;return o===Ch&&r.documentElement.namespaceURI===Ch?r.createElement(e):r.createElementNS(o,e)}}function eR(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function G2(e){var r=ed(e);return(r.local?eR:JT)(r)}function tR(){}function Mp(e){return e==null?tR:function(){return this.querySelector(e)}}function nR(e){typeof e!="function"&&(e=Mp(e));for(var r=this._groups,o=r.length,a=new Array(o),l=0;l<o;++l)for(var u=r[l],d=u.length,f=a[l]=new Array(d),h,p,g=0;g<d;++g)(h=u[g])&&(p=e.call(h,h.__data__,g,u))&&("__data__"in h&&(p.__data__=h.__data__),f[g]=p);return new ln(a,this._parents)}function rR(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function oR(){return[]}function X2(e){return e==null?oR:function(){return this.querySelectorAll(e)}}function aR(e){return function(){return rR(e.apply(this,arguments))}}function sR(e){typeof e=="function"?e=aR(e):e=X2(e);for(var r=this._groups,o=r.length,a=[],l=[],u=0;u<o;++u)for(var d=r[u],f=d.length,h,p=0;p<f;++p)(h=d[p])&&(a.push(e.call(h,h.__data__,p,d)),l.push(h));return new ln(a,l)}function F2(e){return function(){return this.matches(e)}}function Z2(e){return function(r){return r.matches(e)}}var iR=Array.prototype.find;function lR(e){return function(){return iR.call(this.children,e)}}function cR(){return this.firstElementChild}function uR(e){return this.select(e==null?cR:lR(typeof e=="function"?e:Z2(e)))}var dR=Array.prototype.filter;function fR(){return Array.from(this.children)}function mR(e){return function(){return dR.call(this.children,e)}}function hR(e){return this.selectAll(e==null?fR:mR(typeof e=="function"?e:Z2(e)))}function pR(e){typeof e!="function"&&(e=F2(e));for(var r=this._groups,o=r.length,a=new Array(o),l=0;l<o;++l)for(var u=r[l],d=u.length,f=a[l]=[],h,p=0;p<d;++p)(h=u[p])&&e.call(h,h.__data__,p,u)&&f.push(h);return new ln(a,this._parents)}function K2(e){return new Array(e.length)}function gR(){return new ln(this._enter||this._groups.map(K2),this._parents)}function yu(e,r){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=r}yu.prototype={constructor:yu,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,r){return this._parent.insertBefore(e,r)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function xR(e){return function(){return e}}function vR(e,r,o,a,l,u){for(var d=0,f,h=r.length,p=u.length;d<p;++d)(f=r[d])?(f.__data__=u[d],a[d]=f):o[d]=new yu(e,u[d]);for(;d<h;++d)(f=r[d])&&(l[d]=f)}function yR(e,r,o,a,l,u,d){var f,h,p=new Map,g=r.length,y=u.length,v=new Array(g),b;for(f=0;f<g;++f)(h=r[f])&&(v[f]=b=d.call(h,h.__data__,f,r)+"",p.has(b)?l[f]=h:p.set(b,h));for(f=0;f<y;++f)b=d.call(e,u[f],f,u)+"",(h=p.get(b))?(a[f]=h,h.__data__=u[f],p.delete(b)):o[f]=new yu(e,u[f]);for(f=0;f<g;++f)(h=r[f])&&p.get(v[f])===h&&(l[f]=h)}function bR(e){return e.__data__}function wR(e,r){if(!arguments.length)return Array.from(this,bR);var o=r?yR:vR,a=this._parents,l=this._groups;typeof e!="function"&&(e=xR(e));for(var u=l.length,d=new Array(u),f=new Array(u),h=new Array(u),p=0;p<u;++p){var g=a[p],y=l[p],v=y.length,b=NR(e.call(g,g&&g.__data__,p,a)),S=b.length,w=f[p]=new Array(S),j=d[p]=new Array(S),k=h[p]=new Array(v);o(g,y,w,j,k,b,r);for(var M=0,_=0,A,D;M<S;++M)if(A=w[M]){for(M>=_&&(_=M+1);!(D=j[_])&&++_<S;);A._next=D||null}}return d=new ln(d,a),d._enter=f,d._exit=h,d}function NR(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function SR(){return new ln(this._exit||this._groups.map(K2),this._parents)}function ER(e,r,o){var a=this.enter(),l=this,u=this.exit();return typeof e=="function"?(a=e(a),a&&(a=a.selection())):a=a.append(e+""),r!=null&&(l=r(l),l&&(l=l.selection())),o==null?u.remove():o(u),a&&l?a.merge(l).order():l}function _R(e){for(var r=e.selection?e.selection():e,o=this._groups,a=r._groups,l=o.length,u=a.length,d=Math.min(l,u),f=new Array(l),h=0;h<d;++h)for(var p=o[h],g=a[h],y=p.length,v=f[h]=new Array(y),b,S=0;S<y;++S)(b=p[S]||g[S])&&(v[S]=b);for(;h<l;++h)f[h]=o[h];return new ln(f,this._parents)}function jR(){for(var e=this._groups,r=-1,o=e.length;++r<o;)for(var a=e[r],l=a.length-1,u=a[l],d;--l>=0;)(d=a[l])&&(u&&d.compareDocumentPosition(u)^4&&u.parentNode.insertBefore(d,u),u=d);return this}function CR(e){e||(e=kR);function r(y,v){return y&&v?e(y.__data__,v.__data__):!y-!v}for(var o=this._groups,a=o.length,l=new Array(a),u=0;u<a;++u){for(var d=o[u],f=d.length,h=l[u]=new Array(f),p,g=0;g<f;++g)(p=d[g])&&(h[g]=p);h.sort(r)}return new ln(l,this._parents).order()}function kR(e,r){return e<r?-1:e>r?1:e>=r?0:NaN}function AR(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function MR(){return Array.from(this)}function TR(){for(var e=this._groups,r=0,o=e.length;r<o;++r)for(var a=e[r],l=0,u=a.length;l<u;++l){var d=a[l];if(d)return d}return null}function RR(){let e=0;for(const r of this)++e;return e}function DR(){return!this.node()}function OR(e){for(var r=this._groups,o=0,a=r.length;o<a;++o)for(var l=r[o],u=0,d=l.length,f;u<d;++u)(f=l[u])&&e.call(f,f.__data__,u,l);return this}function zR(e){return function(){this.removeAttribute(e)}}function LR(e){return function(){this.removeAttributeNS(e.space,e.local)}}function IR(e,r){return function(){this.setAttribute(e,r)}}function HR(e,r){return function(){this.setAttributeNS(e.space,e.local,r)}}function BR(e,r){return function(){var o=r.apply(this,arguments);o==null?this.removeAttribute(e):this.setAttribute(e,o)}}function UR(e,r){return function(){var o=r.apply(this,arguments);o==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,o)}}function PR(e,r){var o=ed(e);if(arguments.length<2){var a=this.node();return o.local?a.getAttributeNS(o.space,o.local):a.getAttribute(o)}return this.each((r==null?o.local?LR:zR:typeof r=="function"?o.local?UR:BR:o.local?HR:IR)(o,r))}function W2(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function $R(e){return function(){this.style.removeProperty(e)}}function VR(e,r,o){return function(){this.style.setProperty(e,r,o)}}function qR(e,r,o){return function(){var a=r.apply(this,arguments);a==null?this.style.removeProperty(e):this.style.setProperty(e,a,o)}}function YR(e,r,o){return arguments.length>1?this.each((r==null?$R:typeof r=="function"?qR:VR)(e,r,o??"")):rs(this.node(),e)}function rs(e,r){return e.style.getPropertyValue(r)||W2(e).getComputedStyle(e,null).getPropertyValue(r)}function GR(e){return function(){delete this[e]}}function XR(e,r){return function(){this[e]=r}}function FR(e,r){return function(){var o=r.apply(this,arguments);o==null?delete this[e]:this[e]=o}}function ZR(e,r){return arguments.length>1?this.each((r==null?GR:typeof r=="function"?FR:XR)(e,r)):this.node()[e]}function Q2(e){return e.trim().split(/^|\s+/)}function Tp(e){return e.classList||new J2(e)}function J2(e){this._node=e,this._names=Q2(e.getAttribute("class")||"")}J2.prototype={add:function(e){var r=this._names.indexOf(e);r<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var r=this._names.indexOf(e);r>=0&&(this._names.splice(r,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function eN(e,r){for(var o=Tp(e),a=-1,l=r.length;++a<l;)o.add(r[a])}function tN(e,r){for(var o=Tp(e),a=-1,l=r.length;++a<l;)o.remove(r[a])}function KR(e){return function(){eN(this,e)}}function WR(e){return function(){tN(this,e)}}function QR(e,r){return function(){(r.apply(this,arguments)?eN:tN)(this,e)}}function JR(e,r){var o=Q2(e+"");if(arguments.length<2){for(var a=Tp(this.node()),l=-1,u=o.length;++l<u;)if(!a.contains(o[l]))return!1;return!0}return this.each((typeof r=="function"?QR:r?KR:WR)(o,r))}function e6(){this.textContent=""}function t6(e){return function(){this.textContent=e}}function n6(e){return function(){var r=e.apply(this,arguments);this.textContent=r??""}}function r6(e){return arguments.length?this.each(e==null?e6:(typeof e=="function"?n6:t6)(e)):this.node().textContent}function o6(){this.innerHTML=""}function a6(e){return function(){this.innerHTML=e}}function s6(e){return function(){var r=e.apply(this,arguments);this.innerHTML=r??""}}function i6(e){return arguments.length?this.each(e==null?o6:(typeof e=="function"?s6:a6)(e)):this.node().innerHTML}function l6(){this.nextSibling&&this.parentNode.appendChild(this)}function c6(){return this.each(l6)}function u6(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function d6(){return this.each(u6)}function f6(e){var r=typeof e=="function"?e:G2(e);return this.select(function(){return this.appendChild(r.apply(this,arguments))})}function m6(){return null}function h6(e,r){var o=typeof e=="function"?e:G2(e),a=r==null?m6:typeof r=="function"?r:Mp(r);return this.select(function(){return this.insertBefore(o.apply(this,arguments),a.apply(this,arguments)||null)})}function p6(){var e=this.parentNode;e&&e.removeChild(this)}function g6(){return this.each(p6)}function x6(){var e=this.cloneNode(!1),r=this.parentNode;return r?r.insertBefore(e,this.nextSibling):e}function v6(){var e=this.cloneNode(!0),r=this.parentNode;return r?r.insertBefore(e,this.nextSibling):e}function y6(e){return this.select(e?v6:x6)}function b6(e){return arguments.length?this.property("__data__",e):this.node().__data__}function w6(e){return function(r){e.call(this,r,this.__data__)}}function N6(e){return e.trim().split(/^|\s+/).map(function(r){var o="",a=r.indexOf(".");return a>=0&&(o=r.slice(a+1),r=r.slice(0,a)),{type:r,name:o}})}function S6(e){return function(){var r=this.__on;if(r){for(var o=0,a=-1,l=r.length,u;o<l;++o)u=r[o],(!e.type||u.type===e.type)&&u.name===e.name?this.removeEventListener(u.type,u.listener,u.options):r[++a]=u;++a?r.length=a:delete this.__on}}}function E6(e,r,o){return function(){var a=this.__on,l,u=w6(r);if(a){for(var d=0,f=a.length;d<f;++d)if((l=a[d]).type===e.type&&l.name===e.name){this.removeEventListener(l.type,l.listener,l.options),this.addEventListener(l.type,l.listener=u,l.options=o),l.value=r;return}}this.addEventListener(e.type,u,o),l={type:e.type,name:e.name,value:r,listener:u,options:o},a?a.push(l):this.__on=[l]}}function _6(e,r,o){var a=N6(e+""),l,u=a.length,d;if(arguments.length<2){var f=this.node().__on;if(f){for(var h=0,p=f.length,g;h<p;++h)for(l=0,g=f[h];l<u;++l)if((d=a[l]).type===g.type&&d.name===g.name)return g.value}return}for(f=r?E6:S6,l=0;l<u;++l)this.each(f(a[l],r,o));return this}function nN(e,r,o){var a=W2(e),l=a.CustomEvent;typeof l=="function"?l=new l(r,o):(l=a.document.createEvent("Event"),o?(l.initEvent(r,o.bubbles,o.cancelable),l.detail=o.detail):l.initEvent(r,!1,!1)),e.dispatchEvent(l)}function j6(e,r){return function(){return nN(this,e,r)}}function C6(e,r){return function(){return nN(this,e,r.apply(this,arguments))}}function k6(e,r){return this.each((typeof r=="function"?C6:j6)(e,r))}function*A6(){for(var e=this._groups,r=0,o=e.length;r<o;++r)for(var a=e[r],l=0,u=a.length,d;l<u;++l)(d=a[l])&&(yield d)}var rN=[null];function ln(e,r){this._groups=e,this._parents=r}function ol(){return new ln([[document.documentElement]],rN)}function M6(){return this}ln.prototype=ol.prototype={constructor:ln,select:nR,selectAll:sR,selectChild:uR,selectChildren:hR,filter:pR,data:wR,enter:gR,exit:SR,join:ER,merge:_R,selection:M6,order:jR,sort:CR,call:AR,nodes:MR,node:TR,size:RR,empty:DR,each:OR,attr:PR,style:YR,property:ZR,classed:JR,text:r6,html:i6,raise:c6,lower:d6,append:f6,insert:h6,remove:g6,clone:y6,datum:b6,on:_6,dispatch:k6,[Symbol.iterator]:A6};function an(e){return typeof e=="string"?new ln([[document.querySelector(e)]],[document.documentElement]):new ln([[e]],rN)}function T6(e){let r;for(;r=e.sourceEvent;)e=r;return e}function Sn(e,r){if(e=T6(e),r===void 0&&(r=e.currentTarget),r){var o=r.ownerSVGElement||r;if(o.createSVGPoint){var a=o.createSVGPoint();return a.x=e.clientX,a.y=e.clientY,a=a.matrixTransform(r.getScreenCTM().inverse()),[a.x,a.y]}if(r.getBoundingClientRect){var l=r.getBoundingClientRect();return[e.clientX-l.left-r.clientLeft,e.clientY-l.top-r.clientTop]}}return[e.pageX,e.pageY]}const R6={passive:!1},Pi={capture:!0,passive:!1};function Gm(e){e.stopImmediatePropagation()}function Ka(e){e.preventDefault(),e.stopImmediatePropagation()}function oN(e){var r=e.document.documentElement,o=an(e).on("dragstart.drag",Ka,Pi);"onselectstart"in r?o.on("selectstart.drag",Ka,Pi):(r.__noselect=r.style.MozUserSelect,r.style.MozUserSelect="none")}function aN(e,r){var o=e.document.documentElement,a=an(e).on("dragstart.drag",null);r&&(a.on("click.drag",Ka,Pi),setTimeout(function(){a.on("click.drag",null)},0)),"onselectstart"in o?a.on("selectstart.drag",null):(o.style.MozUserSelect=o.__noselect,delete o.__noselect)}const Bc=e=>()=>e;function kh(e,{sourceEvent:r,subject:o,target:a,identifier:l,active:u,x:d,y:f,dx:h,dy:p,dispatch:g}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:r,enumerable:!0,configurable:!0},subject:{value:o,enumerable:!0,configurable:!0},target:{value:a,enumerable:!0,configurable:!0},identifier:{value:l,enumerable:!0,configurable:!0},active:{value:u,enumerable:!0,configurable:!0},x:{value:d,enumerable:!0,configurable:!0},y:{value:f,enumerable:!0,configurable:!0},dx:{value:h,enumerable:!0,configurable:!0},dy:{value:p,enumerable:!0,configurable:!0},_:{value:g}})}kh.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function D6(e){return!e.ctrlKey&&!e.button}function O6(){return this.parentNode}function z6(e,r){return r??{x:e.x,y:e.y}}function L6(){return navigator.maxTouchPoints||"ontouchstart"in this}function sN(){var e=D6,r=O6,o=z6,a=L6,l={},u=Ju("start","drag","end"),d=0,f,h,p,g,y=0;function v(A){A.on("mousedown.drag",b).filter(a).on("touchstart.drag",j).on("touchmove.drag",k,R6).on("touchend.drag touchcancel.drag",M).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function b(A,D){if(!(g||!e.call(this,A,D))){var L=_(this,r.call(this,A,D),A,D,"mouse");L&&(an(A.view).on("mousemove.drag",S,Pi).on("mouseup.drag",w,Pi),oN(A.view),Gm(A),p=!1,f=A.clientX,h=A.clientY,L("start",A))}}function S(A){if(Ka(A),!p){var D=A.clientX-f,L=A.clientY-h;p=D*D+L*L>y}l.mouse("drag",A)}function w(A){an(A.view).on("mousemove.drag mouseup.drag",null),aN(A.view,p),Ka(A),l.mouse("end",A)}function j(A,D){if(e.call(this,A,D)){var L=A.changedTouches,H=r.call(this,A,D),B=L.length,q,Z;for(q=0;q<B;++q)(Z=_(this,H,A,D,L[q].identifier,L[q]))&&(Gm(A),Z("start",A,L[q]))}}function k(A){var D=A.changedTouches,L=D.length,H,B;for(H=0;H<L;++H)(B=l[D[H].identifier])&&(Ka(A),B("drag",A,D[H]))}function M(A){var D=A.changedTouches,L=D.length,H,B;for(g&&clearTimeout(g),g=setTimeout(function(){g=null},500),H=0;H<L;++H)(B=l[D[H].identifier])&&(Gm(A),B("end",A,D[H]))}function _(A,D,L,H,B,q){var Z=u.copy(),K=Sn(q||L,D),G,te,I;if((I=o.call(A,new kh("beforestart",{sourceEvent:L,target:v,identifier:B,active:d,x:K[0],y:K[1],dx:0,dy:0,dispatch:Z}),H))!=null)return G=I.x-K[0]||0,te=I.y-K[1]||0,function V(E,O,z){var P=K,T;switch(E){case"start":l[B]=V,T=d++;break;case"end":delete l[B],--d;case"drag":K=Sn(z||O,D),T=d;break}Z.call(E,A,new kh(E,{sourceEvent:O,subject:I,target:v,identifier:B,active:T,x:K[0]+G,y:K[1]+te,dx:K[0]-P[0],dy:K[1]-P[1],dispatch:Z}),H)}}return v.filter=function(A){return arguments.length?(e=typeof A=="function"?A:Bc(!!A),v):e},v.container=function(A){return arguments.length?(r=typeof A=="function"?A:Bc(A),v):r},v.subject=function(A){return arguments.length?(o=typeof A=="function"?A:Bc(A),v):o},v.touchable=function(A){return arguments.length?(a=typeof A=="function"?A:Bc(!!A),v):a},v.on=function(){var A=u.on.apply(u,arguments);return A===u?v:A},v.clickDistance=function(A){return arguments.length?(y=(A=+A)*A,v):Math.sqrt(y)},v}function Rp(e,r,o){e.prototype=r.prototype=o,o.constructor=e}function iN(e,r){var o=Object.create(e.prototype);for(var a in r)o[a]=r[a];return o}function al(){}var $i=.7,bu=1/$i,Wa="\\s*([+-]?\\d+)\\s*",Vi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Yn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",I6=/^#([0-9a-f]{3,8})$/,H6=new RegExp(`^rgb\\(${Wa},${Wa},${Wa}\\)$`),B6=new RegExp(`^rgb\\(${Yn},${Yn},${Yn}\\)$`),U6=new RegExp(`^rgba\\(${Wa},${Wa},${Wa},${Vi}\\)$`),P6=new RegExp(`^rgba\\(${Yn},${Yn},${Yn},${Vi}\\)$`),$6=new RegExp(`^hsl\\(${Vi},${Yn},${Yn}\\)$`),V6=new RegExp(`^hsla\\(${Vi},${Yn},${Yn},${Vi}\\)$`),wy={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};Rp(al,Ko,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Ny,formatHex:Ny,formatHex8:q6,formatHsl:Y6,formatRgb:Sy,toString:Sy});function Ny(){return this.rgb().formatHex()}function q6(){return this.rgb().formatHex8()}function Y6(){return lN(this).formatHsl()}function Sy(){return this.rgb().formatRgb()}function Ko(e){var r,o;return e=(e+"").trim().toLowerCase(),(r=I6.exec(e))?(o=r[1].length,r=parseInt(r[1],16),o===6?Ey(r):o===3?new Xt(r>>8&15|r>>4&240,r>>4&15|r&240,(r&15)<<4|r&15,1):o===8?Uc(r>>24&255,r>>16&255,r>>8&255,(r&255)/255):o===4?Uc(r>>12&15|r>>8&240,r>>8&15|r>>4&240,r>>4&15|r&240,((r&15)<<4|r&15)/255):null):(r=H6.exec(e))?new Xt(r[1],r[2],r[3],1):(r=B6.exec(e))?new Xt(r[1]*255/100,r[2]*255/100,r[3]*255/100,1):(r=U6.exec(e))?Uc(r[1],r[2],r[3],r[4]):(r=P6.exec(e))?Uc(r[1]*255/100,r[2]*255/100,r[3]*255/100,r[4]):(r=$6.exec(e))?Cy(r[1],r[2]/100,r[3]/100,1):(r=V6.exec(e))?Cy(r[1],r[2]/100,r[3]/100,r[4]):wy.hasOwnProperty(e)?Ey(wy[e]):e==="transparent"?new Xt(NaN,NaN,NaN,0):null}function Ey(e){return new Xt(e>>16&255,e>>8&255,e&255,1)}function Uc(e,r,o,a){return a<=0&&(e=r=o=NaN),new Xt(e,r,o,a)}function G6(e){return e instanceof al||(e=Ko(e)),e?(e=e.rgb(),new Xt(e.r,e.g,e.b,e.opacity)):new Xt}function Ah(e,r,o,a){return arguments.length===1?G6(e):new Xt(e,r,o,a??1)}function Xt(e,r,o,a){this.r=+e,this.g=+r,this.b=+o,this.opacity=+a}Rp(Xt,Ah,iN(al,{brighter(e){return e=e==null?bu:Math.pow(bu,e),new Xt(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?$i:Math.pow($i,e),new Xt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Xt(Po(this.r),Po(this.g),Po(this.b),wu(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:_y,formatHex:_y,formatHex8:X6,formatRgb:jy,toString:jy}));function _y(){return`#${Uo(this.r)}${Uo(this.g)}${Uo(this.b)}`}function X6(){return`#${Uo(this.r)}${Uo(this.g)}${Uo(this.b)}${Uo((isNaN(this.opacity)?1:this.opacity)*255)}`}function jy(){const e=wu(this.opacity);return`${e===1?"rgb(":"rgba("}${Po(this.r)}, ${Po(this.g)}, ${Po(this.b)}${e===1?")":`, ${e})`}`}function wu(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Po(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Uo(e){return e=Po(e),(e<16?"0":"")+e.toString(16)}function Cy(e,r,o,a){return a<=0?e=r=o=NaN:o<=0||o>=1?e=r=NaN:r<=0&&(e=NaN),new En(e,r,o,a)}function lN(e){if(e instanceof En)return new En(e.h,e.s,e.l,e.opacity);if(e instanceof al||(e=Ko(e)),!e)return new En;if(e instanceof En)return e;e=e.rgb();var r=e.r/255,o=e.g/255,a=e.b/255,l=Math.min(r,o,a),u=Math.max(r,o,a),d=NaN,f=u-l,h=(u+l)/2;return f?(r===u?d=(o-a)/f+(o<a)*6:o===u?d=(a-r)/f+2:d=(r-o)/f+4,f/=h<.5?u+l:2-u-l,d*=60):f=h>0&&h<1?0:d,new En(d,f,h,e.opacity)}function F6(e,r,o,a){return arguments.length===1?lN(e):new En(e,r,o,a??1)}function En(e,r,o,a){this.h=+e,this.s=+r,this.l=+o,this.opacity=+a}Rp(En,F6,iN(al,{brighter(e){return e=e==null?bu:Math.pow(bu,e),new En(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?$i:Math.pow($i,e),new En(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,r=isNaN(e)||isNaN(this.s)?0:this.s,o=this.l,a=o+(o<.5?o:1-o)*r,l=2*o-a;return new Xt(Xm(e>=240?e-240:e+120,l,a),Xm(e,l,a),Xm(e<120?e+240:e-120,l,a),this.opacity)},clamp(){return new En(ky(this.h),Pc(this.s),Pc(this.l),wu(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=wu(this.opacity);return`${e===1?"hsl(":"hsla("}${ky(this.h)}, ${Pc(this.s)*100}%, ${Pc(this.l)*100}%${e===1?")":`, ${e})`}`}}));function ky(e){return e=(e||0)%360,e<0?e+360:e}function Pc(e){return Math.max(0,Math.min(1,e||0))}function Xm(e,r,o){return(e<60?r+(o-r)*e/60:e<180?o:e<240?r+(o-r)*(240-e)/60:r)*255}const Dp=e=>()=>e;function Z6(e,r){return function(o){return e+o*r}}function K6(e,r,o){return e=Math.pow(e,o),r=Math.pow(r,o)-e,o=1/o,function(a){return Math.pow(e+a*r,o)}}function W6(e){return(e=+e)==1?cN:function(r,o){return o-r?K6(r,o,e):Dp(isNaN(r)?o:r)}}function cN(e,r){var o=r-e;return o?Z6(e,o):Dp(isNaN(e)?r:e)}const Nu=(function e(r){var o=W6(r);function a(l,u){var d=o((l=Ah(l)).r,(u=Ah(u)).r),f=o(l.g,u.g),h=o(l.b,u.b),p=cN(l.opacity,u.opacity);return function(g){return l.r=d(g),l.g=f(g),l.b=h(g),l.opacity=p(g),l+""}}return a.gamma=e,a})(1);function Q6(e,r){r||(r=[]);var o=e?Math.min(r.length,e.length):0,a=r.slice(),l;return function(u){for(l=0;l<o;++l)a[l]=e[l]*(1-u)+r[l]*u;return a}}function J6(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function eD(e,r){var o=r?r.length:0,a=e?Math.min(o,e.length):0,l=new Array(a),u=new Array(o),d;for(d=0;d<a;++d)l[d]=Di(e[d],r[d]);for(;d<o;++d)u[d]=r[d];return function(f){for(d=0;d<a;++d)u[d]=l[d](f);return u}}function tD(e,r){var o=new Date;return e=+e,r=+r,function(a){return o.setTime(e*(1-a)+r*a),o}}function Hn(e,r){return e=+e,r=+r,function(o){return e*(1-o)+r*o}}function nD(e,r){var o={},a={},l;(e===null||typeof e!="object")&&(e={}),(r===null||typeof r!="object")&&(r={});for(l in r)l in e?o[l]=Di(e[l],r[l]):a[l]=r[l];return function(u){for(l in o)a[l]=o[l](u);return a}}var Mh=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Fm=new RegExp(Mh.source,"g");function rD(e){return function(){return e}}function oD(e){return function(r){return e(r)+""}}function uN(e,r){var o=Mh.lastIndex=Fm.lastIndex=0,a,l,u,d=-1,f=[],h=[];for(e=e+"",r=r+"";(a=Mh.exec(e))&&(l=Fm.exec(r));)(u=l.index)>o&&(u=r.slice(o,u),f[d]?f[d]+=u:f[++d]=u),(a=a[0])===(l=l[0])?f[d]?f[d]+=l:f[++d]=l:(f[++d]=null,h.push({i:d,x:Hn(a,l)})),o=Fm.lastIndex;return o<r.length&&(u=r.slice(o),f[d]?f[d]+=u:f[++d]=u),f.length<2?h[0]?oD(h[0].x):rD(r):(r=h.length,function(p){for(var g=0,y;g<r;++g)f[(y=h[g]).i]=y.x(p);return f.join("")})}function Di(e,r){var o=typeof r,a;return r==null||o==="boolean"?Dp(r):(o==="number"?Hn:o==="string"?(a=Ko(r))?(r=a,Nu):uN:r instanceof Ko?Nu:r instanceof Date?tD:J6(r)?Q6:Array.isArray(r)?eD:typeof r.valueOf!="function"&&typeof r.toString!="function"||isNaN(r)?nD:Hn)(e,r)}var Ay=180/Math.PI,Th={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function dN(e,r,o,a,l,u){var d,f,h;return(d=Math.sqrt(e*e+r*r))&&(e/=d,r/=d),(h=e*o+r*a)&&(o-=e*h,a-=r*h),(f=Math.sqrt(o*o+a*a))&&(o/=f,a/=f,h/=f),e*a<r*o&&(e=-e,r=-r,h=-h,d=-d),{translateX:l,translateY:u,rotate:Math.atan2(r,e)*Ay,skewX:Math.atan(h)*Ay,scaleX:d,scaleY:f}}var $c;function aD(e){const r=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return r.isIdentity?Th:dN(r.a,r.b,r.c,r.d,r.e,r.f)}function sD(e){return e==null||($c||($c=document.createElementNS("http://www.w3.org/2000/svg","g")),$c.setAttribute("transform",e),!(e=$c.transform.baseVal.consolidate()))?Th:(e=e.matrix,dN(e.a,e.b,e.c,e.d,e.e,e.f))}function fN(e,r,o,a){function l(p){return p.length?p.pop()+" ":""}function u(p,g,y,v,b,S){if(p!==y||g!==v){var w=b.push("translate(",null,r,null,o);S.push({i:w-4,x:Hn(p,y)},{i:w-2,x:Hn(g,v)})}else(y||v)&&b.push("translate("+y+r+v+o)}function d(p,g,y,v){p!==g?(p-g>180?g+=360:g-p>180&&(p+=360),v.push({i:y.push(l(y)+"rotate(",null,a)-2,x:Hn(p,g)})):g&&y.push(l(y)+"rotate("+g+a)}function f(p,g,y,v){p!==g?v.push({i:y.push(l(y)+"skewX(",null,a)-2,x:Hn(p,g)}):g&&y.push(l(y)+"skewX("+g+a)}function h(p,g,y,v,b,S){if(p!==y||g!==v){var w=b.push(l(b)+"scale(",null,",",null,")");S.push({i:w-4,x:Hn(p,y)},{i:w-2,x:Hn(g,v)})}else(y!==1||v!==1)&&b.push(l(b)+"scale("+y+","+v+")")}return function(p,g){var y=[],v=[];return p=e(p),g=e(g),u(p.translateX,p.translateY,g.translateX,g.translateY,y,v),d(p.rotate,g.rotate,y,v),f(p.skewX,g.skewX,y,v),h(p.scaleX,p.scaleY,g.scaleX,g.scaleY,y,v),p=g=null,function(b){for(var S=-1,w=v.length,j;++S<w;)y[(j=v[S]).i]=j.x(b);return y.join("")}}}var iD=fN(aD,"px, ","px)","deg)"),lD=fN(sD,", ",")",")"),cD=1e-12;function My(e){return((e=Math.exp(e))+1/e)/2}function uD(e){return((e=Math.exp(e))-1/e)/2}function dD(e){return((e=Math.exp(2*e))-1)/(e+1)}const nu=(function e(r,o,a){function l(u,d){var f=u[0],h=u[1],p=u[2],g=d[0],y=d[1],v=d[2],b=g-f,S=y-h,w=b*b+S*S,j,k;if(w<cD)k=Math.log(v/p)/r,j=function(H){return[f+H*b,h+H*S,p*Math.exp(r*H*k)]};else{var M=Math.sqrt(w),_=(v*v-p*p+a*w)/(2*p*o*M),A=(v*v-p*p-a*w)/(2*v*o*M),D=Math.log(Math.sqrt(_*_+1)-_),L=Math.log(Math.sqrt(A*A+1)-A);k=(L-D)/r,j=function(H){var B=H*k,q=My(D),Z=p/(o*M)*(q*dD(r*B+D)-uD(D));return[f+Z*b,h+Z*S,p*q/My(r*B+D)]}}return j.duration=k*1e3*r/Math.SQRT2,j}return l.rho=function(u){var d=Math.max(.001,+u),f=d*d,h=f*f;return e(d,f,h)},l})(Math.SQRT2,2,4);var os=0,Ai=0,Ei=0,mN=1e3,Su,Mi,Eu=0,Wo=0,td=0,qi=typeof performance=="object"&&performance.now?performance:Date,hN=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Op(){return Wo||(hN(fD),Wo=qi.now()+td)}function fD(){Wo=0}function _u(){this._call=this._time=this._next=null}_u.prototype=pN.prototype={constructor:_u,restart:function(e,r,o){if(typeof e!="function")throw new TypeError("callback is not a function");o=(o==null?Op():+o)+(r==null?0:+r),!this._next&&Mi!==this&&(Mi?Mi._next=this:Su=this,Mi=this),this._call=e,this._time=o,Rh()},stop:function(){this._call&&(this._call=null,this._time=1/0,Rh())}};function pN(e,r,o){var a=new _u;return a.restart(e,r,o),a}function mD(){Op(),++os;for(var e=Su,r;e;)(r=Wo-e._time)>=0&&e._call.call(void 0,r),e=e._next;--os}function Ty(){Wo=(Eu=qi.now())+td,os=Ai=0;try{mD()}finally{os=0,pD(),Wo=0}}function hD(){var e=qi.now(),r=e-Eu;r>mN&&(td-=r,Eu=e)}function pD(){for(var e,r=Su,o,a=1/0;r;)r._call?(a>r._time&&(a=r._time),e=r,r=r._next):(o=r._next,r._next=null,r=e?e._next=o:Su=o);Mi=e,Rh(a)}function Rh(e){if(!os){Ai&&(Ai=clearTimeout(Ai));var r=e-Wo;r>24?(e<1/0&&(Ai=setTimeout(Ty,e-qi.now()-td)),Ei&&(Ei=clearInterval(Ei))):(Ei||(Eu=qi.now(),Ei=setInterval(hD,mN)),os=1,hN(Ty))}}function Ry(e,r,o){var a=new _u;return r=r==null?0:+r,a.restart(l=>{a.stop(),e(l+r)},r,o),a}var gD=Ju("start","end","cancel","interrupt"),xD=[],gN=0,Dy=1,Dh=2,ru=3,Oy=4,Oh=5,ou=6;function nd(e,r,o,a,l,u){var d=e.__transition;if(!d)e.__transition={};else if(o in d)return;vD(e,o,{name:r,index:a,group:l,on:gD,tween:xD,time:u.time,delay:u.delay,duration:u.duration,ease:u.ease,timer:null,state:gN})}function zp(e,r){var o=Mn(e,r);if(o.state>gN)throw new Error("too late; already scheduled");return o}function Kn(e,r){var o=Mn(e,r);if(o.state>ru)throw new Error("too late; already running");return o}function Mn(e,r){var o=e.__transition;if(!o||!(o=o[r]))throw new Error("transition not found");return o}function vD(e,r,o){var a=e.__transition,l;a[r]=o,o.timer=pN(u,0,o.time);function u(p){o.state=Dy,o.timer.restart(d,o.delay,o.time),o.delay<=p&&d(p-o.delay)}function d(p){var g,y,v,b;if(o.state!==Dy)return h();for(g in a)if(b=a[g],b.name===o.name){if(b.state===ru)return Ry(d);b.state===Oy?(b.state=ou,b.timer.stop(),b.on.call("interrupt",e,e.__data__,b.index,b.group),delete a[g]):+g<r&&(b.state=ou,b.timer.stop(),b.on.call("cancel",e,e.__data__,b.index,b.group),delete a[g])}if(Ry(function(){o.state===ru&&(o.state=Oy,o.timer.restart(f,o.delay,o.time),f(p))}),o.state=Dh,o.on.call("start",e,e.__data__,o.index,o.group),o.state===Dh){for(o.state=ru,l=new Array(v=o.tween.length),g=0,y=-1;g<v;++g)(b=o.tween[g].value.call(e,e.__data__,o.index,o.group))&&(l[++y]=b);l.length=y+1}}function f(p){for(var g=p<o.duration?o.ease.call(null,p/o.duration):(o.timer.restart(h),o.state=Oh,1),y=-1,v=l.length;++y<v;)l[y].call(e,g);o.state===Oh&&(o.on.call("end",e,e.__data__,o.index,o.group),h())}function h(){o.state=ou,o.timer.stop(),delete a[r];for(var p in a)return;delete e.__transition}}function au(e,r){var o=e.__transition,a,l,u=!0,d;if(o){r=r==null?null:r+"";for(d in o){if((a=o[d]).name!==r){u=!1;continue}l=a.state>Dh&&a.state<Oh,a.state=ou,a.timer.stop(),a.on.call(l?"interrupt":"cancel",e,e.__data__,a.index,a.group),delete o[d]}u&&delete e.__transition}}function yD(e){return this.each(function(){au(this,e)})}function bD(e,r){var o,a;return function(){var l=Kn(this,e),u=l.tween;if(u!==o){a=o=u;for(var d=0,f=a.length;d<f;++d)if(a[d].name===r){a=a.slice(),a.splice(d,1);break}}l.tween=a}}function wD(e,r,o){var a,l;if(typeof o!="function")throw new Error;return function(){var u=Kn(this,e),d=u.tween;if(d!==a){l=(a=d).slice();for(var f={name:r,value:o},h=0,p=l.length;h<p;++h)if(l[h].name===r){l[h]=f;break}h===p&&l.push(f)}u.tween=l}}function ND(e,r){var o=this._id;if(e+="",arguments.length<2){for(var a=Mn(this.node(),o).tween,l=0,u=a.length,d;l<u;++l)if((d=a[l]).name===e)return d.value;return null}return this.each((r==null?bD:wD)(o,e,r))}function Lp(e,r,o){var a=e._id;return e.each(function(){var l=Kn(this,a);(l.value||(l.value={}))[r]=o.apply(this,arguments)}),function(l){return Mn(l,a).value[r]}}function xN(e,r){var o;return(typeof r=="number"?Hn:r instanceof Ko?Nu:(o=Ko(r))?(r=o,Nu):uN)(e,r)}function SD(e){return function(){this.removeAttribute(e)}}function ED(e){return function(){this.removeAttributeNS(e.space,e.local)}}function _D(e,r,o){var a,l=o+"",u;return function(){var d=this.getAttribute(e);return d===l?null:d===a?u:u=r(a=d,o)}}function jD(e,r,o){var a,l=o+"",u;return function(){var d=this.getAttributeNS(e.space,e.local);return d===l?null:d===a?u:u=r(a=d,o)}}function CD(e,r,o){var a,l,u;return function(){var d,f=o(this),h;return f==null?void this.removeAttribute(e):(d=this.getAttribute(e),h=f+"",d===h?null:d===a&&h===l?u:(l=h,u=r(a=d,f)))}}function kD(e,r,o){var a,l,u;return function(){var d,f=o(this),h;return f==null?void this.removeAttributeNS(e.space,e.local):(d=this.getAttributeNS(e.space,e.local),h=f+"",d===h?null:d===a&&h===l?u:(l=h,u=r(a=d,f)))}}function AD(e,r){var o=ed(e),a=o==="transform"?lD:xN;return this.attrTween(e,typeof r=="function"?(o.local?kD:CD)(o,a,Lp(this,"attr."+e,r)):r==null?(o.local?ED:SD)(o):(o.local?jD:_D)(o,a,r))}function MD(e,r){return function(o){this.setAttribute(e,r.call(this,o))}}function TD(e,r){return function(o){this.setAttributeNS(e.space,e.local,r.call(this,o))}}function RD(e,r){var o,a;function l(){var u=r.apply(this,arguments);return u!==a&&(o=(a=u)&&TD(e,u)),o}return l._value=r,l}function DD(e,r){var o,a;function l(){var u=r.apply(this,arguments);return u!==a&&(o=(a=u)&&MD(e,u)),o}return l._value=r,l}function OD(e,r){var o="attr."+e;if(arguments.length<2)return(o=this.tween(o))&&o._value;if(r==null)return this.tween(o,null);if(typeof r!="function")throw new Error;var a=ed(e);return this.tween(o,(a.local?RD:DD)(a,r))}function zD(e,r){return function(){zp(this,e).delay=+r.apply(this,arguments)}}function LD(e,r){return r=+r,function(){zp(this,e).delay=r}}function ID(e){var r=this._id;return arguments.length?this.each((typeof e=="function"?zD:LD)(r,e)):Mn(this.node(),r).delay}function HD(e,r){return function(){Kn(this,e).duration=+r.apply(this,arguments)}}function BD(e,r){return r=+r,function(){Kn(this,e).duration=r}}function UD(e){var r=this._id;return arguments.length?this.each((typeof e=="function"?HD:BD)(r,e)):Mn(this.node(),r).duration}function PD(e,r){if(typeof r!="function")throw new Error;return function(){Kn(this,e).ease=r}}function $D(e){var r=this._id;return arguments.length?this.each(PD(r,e)):Mn(this.node(),r).ease}function VD(e,r){return function(){var o=r.apply(this,arguments);if(typeof o!="function")throw new Error;Kn(this,e).ease=o}}function qD(e){if(typeof e!="function")throw new Error;return this.each(VD(this._id,e))}function YD(e){typeof e!="function"&&(e=F2(e));for(var r=this._groups,o=r.length,a=new Array(o),l=0;l<o;++l)for(var u=r[l],d=u.length,f=a[l]=[],h,p=0;p<d;++p)(h=u[p])&&e.call(h,h.__data__,p,u)&&f.push(h);return new Cr(a,this._parents,this._name,this._id)}function GD(e){if(e._id!==this._id)throw new Error;for(var r=this._groups,o=e._groups,a=r.length,l=o.length,u=Math.min(a,l),d=new Array(a),f=0;f<u;++f)for(var h=r[f],p=o[f],g=h.length,y=d[f]=new Array(g),v,b=0;b<g;++b)(v=h[b]||p[b])&&(y[b]=v);for(;f<a;++f)d[f]=r[f];return new Cr(d,this._parents,this._name,this._id)}function XD(e){return(e+"").trim().split(/^|\s+/).every(function(r){var o=r.indexOf(".");return o>=0&&(r=r.slice(0,o)),!r||r==="start"})}function FD(e,r,o){var a,l,u=XD(r)?zp:Kn;return function(){var d=u(this,e),f=d.on;f!==a&&(l=(a=f).copy()).on(r,o),d.on=l}}function ZD(e,r){var o=this._id;return arguments.length<2?Mn(this.node(),o).on.on(e):this.each(FD(o,e,r))}function KD(e){return function(){var r=this.parentNode;for(var o in this.__transition)if(+o!==e)return;r&&r.removeChild(this)}}function WD(){return this.on("end.remove",KD(this._id))}function QD(e){var r=this._name,o=this._id;typeof e!="function"&&(e=Mp(e));for(var a=this._groups,l=a.length,u=new Array(l),d=0;d<l;++d)for(var f=a[d],h=f.length,p=u[d]=new Array(h),g,y,v=0;v<h;++v)(g=f[v])&&(y=e.call(g,g.__data__,v,f))&&("__data__"in g&&(y.__data__=g.__data__),p[v]=y,nd(p[v],r,o,v,p,Mn(g,o)));return new Cr(u,this._parents,r,o)}function JD(e){var r=this._name,o=this._id;typeof e!="function"&&(e=X2(e));for(var a=this._groups,l=a.length,u=[],d=[],f=0;f<l;++f)for(var h=a[f],p=h.length,g,y=0;y<p;++y)if(g=h[y]){for(var v=e.call(g,g.__data__,y,h),b,S=Mn(g,o),w=0,j=v.length;w<j;++w)(b=v[w])&&nd(b,r,o,w,v,S);u.push(v),d.push(g)}return new Cr(u,d,r,o)}var eO=ol.prototype.constructor;function tO(){return new eO(this._groups,this._parents)}function nO(e,r){var o,a,l;return function(){var u=rs(this,e),d=(this.style.removeProperty(e),rs(this,e));return u===d?null:u===o&&d===a?l:l=r(o=u,a=d)}}function vN(e){return function(){this.style.removeProperty(e)}}function rO(e,r,o){var a,l=o+"",u;return function(){var d=rs(this,e);return d===l?null:d===a?u:u=r(a=d,o)}}function oO(e,r,o){var a,l,u;return function(){var d=rs(this,e),f=o(this),h=f+"";return f==null&&(h=f=(this.style.removeProperty(e),rs(this,e))),d===h?null:d===a&&h===l?u:(l=h,u=r(a=d,f))}}function aO(e,r){var o,a,l,u="style."+r,d="end."+u,f;return function(){var h=Kn(this,e),p=h.on,g=h.value[u]==null?f||(f=vN(r)):void 0;(p!==o||l!==g)&&(a=(o=p).copy()).on(d,l=g),h.on=a}}function sO(e,r,o){var a=(e+="")=="transform"?iD:xN;return r==null?this.styleTween(e,nO(e,a)).on("end.style."+e,vN(e)):typeof r=="function"?this.styleTween(e,oO(e,a,Lp(this,"style."+e,r))).each(aO(this._id,e)):this.styleTween(e,rO(e,a,r),o).on("end.style."+e,null)}function iO(e,r,o){return function(a){this.style.setProperty(e,r.call(this,a),o)}}function lO(e,r,o){var a,l;function u(){var d=r.apply(this,arguments);return d!==l&&(a=(l=d)&&iO(e,d,o)),a}return u._value=r,u}function cO(e,r,o){var a="style."+(e+="");if(arguments.length<2)return(a=this.tween(a))&&a._value;if(r==null)return this.tween(a,null);if(typeof r!="function")throw new Error;return this.tween(a,lO(e,r,o??""))}function uO(e){return function(){this.textContent=e}}function dO(e){return function(){var r=e(this);this.textContent=r??""}}function fO(e){return this.tween("text",typeof e=="function"?dO(Lp(this,"text",e)):uO(e==null?"":e+""))}function mO(e){return function(r){this.textContent=e.call(this,r)}}function hO(e){var r,o;function a(){var l=e.apply(this,arguments);return l!==o&&(r=(o=l)&&mO(l)),r}return a._value=e,a}function pO(e){var r="text";if(arguments.length<1)return(r=this.tween(r))&&r._value;if(e==null)return this.tween(r,null);if(typeof e!="function")throw new Error;return this.tween(r,hO(e))}function gO(){for(var e=this._name,r=this._id,o=yN(),a=this._groups,l=a.length,u=0;u<l;++u)for(var d=a[u],f=d.length,h,p=0;p<f;++p)if(h=d[p]){var g=Mn(h,r);nd(h,e,o,p,d,{time:g.time+g.delay+g.duration,delay:0,duration:g.duration,ease:g.ease})}return new Cr(a,this._parents,e,o)}function xO(){var e,r,o=this,a=o._id,l=o.size();return new Promise(function(u,d){var f={value:d},h={value:function(){--l===0&&u()}};o.each(function(){var p=Kn(this,a),g=p.on;g!==e&&(r=(e=g).copy(),r._.cancel.push(f),r._.interrupt.push(f),r._.end.push(h)),p.on=r}),l===0&&u()})}var vO=0;function Cr(e,r,o,a){this._groups=e,this._parents=r,this._name=o,this._id=a}function yN(){return++vO}var vr=ol.prototype;Cr.prototype={constructor:Cr,select:QD,selectAll:JD,selectChild:vr.selectChild,selectChildren:vr.selectChildren,filter:YD,merge:GD,selection:tO,transition:gO,call:vr.call,nodes:vr.nodes,node:vr.node,size:vr.size,empty:vr.empty,each:vr.each,on:ZD,attr:AD,attrTween:OD,style:sO,styleTween:cO,text:fO,textTween:pO,remove:WD,tween:ND,delay:ID,duration:UD,ease:$D,easeVarying:qD,end:xO,[Symbol.iterator]:vr[Symbol.iterator]};function yO(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var bO={time:null,delay:0,duration:250,ease:yO};function wO(e,r){for(var o;!(o=e.__transition)||!(o=o[r]);)if(!(e=e.parentNode))throw new Error(`transition ${r} not found`);return o}function NO(e){var r,o;e instanceof Cr?(r=e._id,e=e._name):(r=yN(),(o=bO).time=Op(),e=e==null?null:e+"");for(var a=this._groups,l=a.length,u=0;u<l;++u)for(var d=a[u],f=d.length,h,p=0;p<f;++p)(h=d[p])&&nd(h,e,r,p,d,o||wO(h,r));return new Cr(a,this._parents,e,r)}ol.prototype.interrupt=yD;ol.prototype.transition=NO;const Vc=e=>()=>e;function SO(e,{sourceEvent:r,target:o,transform:a,dispatch:l}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:r,enumerable:!0,configurable:!0},target:{value:o,enumerable:!0,configurable:!0},transform:{value:a,enumerable:!0,configurable:!0},_:{value:l}})}function yr(e,r,o){this.k=e,this.x=r,this.y=o}yr.prototype={constructor:yr,scale:function(e){return e===1?this:new yr(this.k*e,this.x,this.y)},translate:function(e,r){return e===0&r===0?this:new yr(this.k,this.x+this.k*e,this.y+this.k*r)},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 rd=new yr(1,0,0);bN.prototype=yr.prototype;function bN(e){for(;!e.__zoom;)if(!(e=e.parentNode))return rd;return e.__zoom}function Zm(e){e.stopImmediatePropagation()}function _i(e){e.preventDefault(),e.stopImmediatePropagation()}function EO(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function _O(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.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 zy(){return this.__zoom||rd}function jO(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function CO(){return navigator.maxTouchPoints||"ontouchstart"in this}function kO(e,r,o){var a=e.invertX(r[0][0])-o[0][0],l=e.invertX(r[1][0])-o[1][0],u=e.invertY(r[0][1])-o[0][1],d=e.invertY(r[1][1])-o[1][1];return e.translate(l>a?(a+l)/2:Math.min(0,a)||Math.max(0,l),d>u?(u+d)/2:Math.min(0,u)||Math.max(0,d))}function wN(){var e=EO,r=_O,o=kO,a=jO,l=CO,u=[0,1/0],d=[[-1/0,-1/0],[1/0,1/0]],f=250,h=nu,p=Ju("start","zoom","end"),g,y,v,b=500,S=150,w=0,j=10;function k(I){I.property("__zoom",zy).on("wheel.zoom",B,{passive:!1}).on("mousedown.zoom",q).on("dblclick.zoom",Z).filter(l).on("touchstart.zoom",K).on("touchmove.zoom",G).on("touchend.zoom touchcancel.zoom",te).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}k.transform=function(I,V,E,O){var z=I.selection?I.selection():I;z.property("__zoom",zy),I!==z?D(I,V,E,O):z.interrupt().each(function(){L(this,arguments).event(O).start().zoom(null,typeof V=="function"?V.apply(this,arguments):V).end()})},k.scaleBy=function(I,V,E,O){k.scaleTo(I,function(){var z=this.__zoom.k,P=typeof V=="function"?V.apply(this,arguments):V;return z*P},E,O)},k.scaleTo=function(I,V,E,O){k.transform(I,function(){var z=r.apply(this,arguments),P=this.__zoom,T=E==null?A(z):typeof E=="function"?E.apply(this,arguments):E,U=P.invert(T),X=typeof V=="function"?V.apply(this,arguments):V;return o(_(M(P,X),T,U),z,d)},E,O)},k.translateBy=function(I,V,E,O){k.transform(I,function(){return o(this.__zoom.translate(typeof V=="function"?V.apply(this,arguments):V,typeof E=="function"?E.apply(this,arguments):E),r.apply(this,arguments),d)},null,O)},k.translateTo=function(I,V,E,O,z){k.transform(I,function(){var P=r.apply(this,arguments),T=this.__zoom,U=O==null?A(P):typeof O=="function"?O.apply(this,arguments):O;return o(rd.translate(U[0],U[1]).scale(T.k).translate(typeof V=="function"?-V.apply(this,arguments):-V,typeof E=="function"?-E.apply(this,arguments):-E),P,d)},O,z)};function M(I,V){return V=Math.max(u[0],Math.min(u[1],V)),V===I.k?I:new yr(V,I.x,I.y)}function _(I,V,E){var O=V[0]-E[0]*I.k,z=V[1]-E[1]*I.k;return O===I.x&&z===I.y?I:new yr(I.k,O,z)}function A(I){return[(+I[0][0]+ +I[1][0])/2,(+I[0][1]+ +I[1][1])/2]}function D(I,V,E,O){I.on("start.zoom",function(){L(this,arguments).event(O).start()}).on("interrupt.zoom end.zoom",function(){L(this,arguments).event(O).end()}).tween("zoom",function(){var z=this,P=arguments,T=L(z,P).event(O),U=r.apply(z,P),X=E==null?A(U):typeof E=="function"?E.apply(z,P):E,ee=Math.max(U[1][0]-U[0][0],U[1][1]-U[0][1]),ae=z.__zoom,me=typeof V=="function"?V.apply(z,P):V,ue=h(ae.invert(X).concat(ee/ae.k),me.invert(X).concat(ee/me.k));return function(Q){if(Q===1)Q=me;else{var se=ue(Q),pe=ee/se[2];Q=new yr(pe,X[0]-se[0]*pe,X[1]-se[1]*pe)}T.zoom(null,Q)}})}function L(I,V,E){return!E&&I.__zooming||new H(I,V)}function H(I,V){this.that=I,this.args=V,this.active=0,this.sourceEvent=null,this.extent=r.apply(I,V),this.taps=0}H.prototype={event:function(I){return I&&(this.sourceEvent=I),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(I,V){return this.mouse&&I!=="mouse"&&(this.mouse[1]=V.invert(this.mouse[0])),this.touch0&&I!=="touch"&&(this.touch0[1]=V.invert(this.touch0[0])),this.touch1&&I!=="touch"&&(this.touch1[1]=V.invert(this.touch1[0])),this.that.__zoom=V,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(I){var V=an(this.that).datum();p.call(I,this.that,new SO(I,{sourceEvent:this.sourceEvent,target:k,transform:this.that.__zoom,dispatch:p}),V)}};function B(I,...V){if(!e.apply(this,arguments))return;var E=L(this,V).event(I),O=this.__zoom,z=Math.max(u[0],Math.min(u[1],O.k*Math.pow(2,a.apply(this,arguments)))),P=Sn(I);if(E.wheel)(E.mouse[0][0]!==P[0]||E.mouse[0][1]!==P[1])&&(E.mouse[1]=O.invert(E.mouse[0]=P)),clearTimeout(E.wheel);else{if(O.k===z)return;E.mouse=[P,O.invert(P)],au(this),E.start()}_i(I),E.wheel=setTimeout(T,S),E.zoom("mouse",o(_(M(O,z),E.mouse[0],E.mouse[1]),E.extent,d));function T(){E.wheel=null,E.end()}}function q(I,...V){if(v||!e.apply(this,arguments))return;var E=I.currentTarget,O=L(this,V,!0).event(I),z=an(I.view).on("mousemove.zoom",X,!0).on("mouseup.zoom",ee,!0),P=Sn(I,E),T=I.clientX,U=I.clientY;oN(I.view),Zm(I),O.mouse=[P,this.__zoom.invert(P)],au(this),O.start();function X(ae){if(_i(ae),!O.moved){var me=ae.clientX-T,ue=ae.clientY-U;O.moved=me*me+ue*ue>w}O.event(ae).zoom("mouse",o(_(O.that.__zoom,O.mouse[0]=Sn(ae,E),O.mouse[1]),O.extent,d))}function ee(ae){z.on("mousemove.zoom mouseup.zoom",null),aN(ae.view,O.moved),_i(ae),O.event(ae).end()}}function Z(I,...V){if(e.apply(this,arguments)){var E=this.__zoom,O=Sn(I.changedTouches?I.changedTouches[0]:I,this),z=E.invert(O),P=E.k*(I.shiftKey?.5:2),T=o(_(M(E,P),O,z),r.apply(this,V),d);_i(I),f>0?an(this).transition().duration(f).call(D,T,O,I):an(this).call(k.transform,T,O,I)}}function K(I,...V){if(e.apply(this,arguments)){var E=I.touches,O=E.length,z=L(this,V,I.changedTouches.length===O).event(I),P,T,U,X;for(Zm(I),T=0;T<O;++T)U=E[T],X=Sn(U,this),X=[X,this.__zoom.invert(X),U.identifier],z.touch0?!z.touch1&&z.touch0[2]!==X[2]&&(z.touch1=X,z.taps=0):(z.touch0=X,P=!0,z.taps=1+!!g);g&&(g=clearTimeout(g)),P&&(z.taps<2&&(y=X[0],g=setTimeout(function(){g=null},b)),au(this),z.start())}}function G(I,...V){if(this.__zooming){var E=L(this,V).event(I),O=I.changedTouches,z=O.length,P,T,U,X;for(_i(I),P=0;P<z;++P)T=O[P],U=Sn(T,this),E.touch0&&E.touch0[2]===T.identifier?E.touch0[0]=U:E.touch1&&E.touch1[2]===T.identifier&&(E.touch1[0]=U);if(T=E.that.__zoom,E.touch1){var ee=E.touch0[0],ae=E.touch0[1],me=E.touch1[0],ue=E.touch1[1],Q=(Q=me[0]-ee[0])*Q+(Q=me[1]-ee[1])*Q,se=(se=ue[0]-ae[0])*se+(se=ue[1]-ae[1])*se;T=M(T,Math.sqrt(Q/se)),U=[(ee[0]+me[0])/2,(ee[1]+me[1])/2],X=[(ae[0]+ue[0])/2,(ae[1]+ue[1])/2]}else if(E.touch0)U=E.touch0[0],X=E.touch0[1];else return;E.zoom("touch",o(_(T,U,X),E.extent,d))}}function te(I,...V){if(this.__zooming){var E=L(this,V).event(I),O=I.changedTouches,z=O.length,P,T;for(Zm(I),v&&clearTimeout(v),v=setTimeout(function(){v=null},b),P=0;P<z;++P)T=O[P],E.touch0&&E.touch0[2]===T.identifier?delete E.touch0:E.touch1&&E.touch1[2]===T.identifier&&delete E.touch1;if(E.touch1&&!E.touch0&&(E.touch0=E.touch1,delete E.touch1),E.touch0)E.touch0[1]=this.__zoom.invert(E.touch0[0]);else if(E.end(),E.taps===2&&(T=Sn(T,this),Math.hypot(y[0]-T[0],y[1]-T[1])<j)){var U=an(this).on("dblclick.zoom");U&&U.apply(this,arguments)}}}return k.wheelDelta=function(I){return arguments.length?(a=typeof I=="function"?I:Vc(+I),k):a},k.filter=function(I){return arguments.length?(e=typeof I=="function"?I:Vc(!!I),k):e},k.touchable=function(I){return arguments.length?(l=typeof I=="function"?I:Vc(!!I),k):l},k.extent=function(I){return arguments.length?(r=typeof I=="function"?I:Vc([[+I[0][0],+I[0][1]],[+I[1][0],+I[1][1]]]),k):r},k.scaleExtent=function(I){return arguments.length?(u[0]=+I[0],u[1]=+I[1],k):[u[0],u[1]]},k.translateExtent=function(I){return arguments.length?(d[0][0]=+I[0][0],d[1][0]=+I[1][0],d[0][1]=+I[0][1],d[1][1]=+I[1][1],k):[[d[0][0],d[0][1]],[d[1][0],d[1][1]]]},k.constrain=function(I){return arguments.length?(o=I,k):o},k.duration=function(I){return arguments.length?(f=+I,k):f},k.interpolate=function(I){return arguments.length?(h=I,k):h},k.on=function(){var I=p.on.apply(p,arguments);return I===p?k:I},k.clickDistance=function(I){return arguments.length?(w=(I=+I)*I,k):Math.sqrt(w)},k.tapDistance=function(I){return arguments.length?(j=+I,k):j},k}const Xn={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:r,sourceHandle:o,targetHandle:a})=>`Couldn't create edge for ${e} handle id: "${e==="source"?o:a}", edge id: ${r}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012: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.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},Yi=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],NN=["Enter"," ","Escape"],SN={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:r,y:o})=>`Moved selected node ${e}. New position, x: ${r}, y: ${o}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var as;(function(e){e.Strict="strict",e.Loose="loose"})(as||(as={}));var $o;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})($o||($o={}));var Gi;(function(e){e.Partial="partial",e.Full="full"})(Gi||(Gi={}));const EN={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null};var co;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(co||(co={}));var ju;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(ju||(ju={}));var Ce;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Ce||(Ce={}));const Ly={[Ce.Left]:Ce.Right,[Ce.Right]:Ce.Left,[Ce.Top]:Ce.Bottom,[Ce.Bottom]:Ce.Top};function _N(e){return e===null?null:e?"valid":"invalid"}const jN=e=>"id"in e&&"source"in e&&"target"in e,AO=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Ip=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),sl=(e,r=[0,0])=>{const{width:o,height:a}=Ar(e),l=e.origin??r,u=o*l[0],d=a*l[1];return{x:e.position.x-u,y:e.position.y-d}},MO=(e,r={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const o=e.reduce((a,l)=>{const u=typeof l=="string";let d=!r.nodeLookup&&!u?l:void 0;r.nodeLookup&&(d=u?r.nodeLookup.get(l):Ip(l)?l:r.nodeLookup.get(l.id));const f=d?Cu(d,r.nodeOrigin):{x:0,y:0,x2:0,y2:0};return od(a,f)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return ad(o)},il=(e,r={})=>{if(e.size===0)return{x:0,y:0,width:0,height:0};let o={x:1/0,y:1/0,x2:-1/0,y2:-1/0};return e.forEach(a=>{if(r.filter===void 0||r.filter(a)){const l=Cu(a);o=od(o,l)}}),ad(o)},Hp=(e,r,[o,a,l]=[0,0,1],u=!1,d=!1)=>{const f={...cl(r,[o,a,l]),width:r.width/l,height:r.height/l},h=[];for(const p of e.values()){const{measured:g,selectable:y=!0,hidden:v=!1}=p;if(d&&!y||v)continue;const b=g.width??p.width??p.initialWidth??null,S=g.height??p.height??p.initialHeight??null,w=Xi(f,is(p)),j=(b??0)*(S??0),k=u&&w>0;(!p.internals.handleBounds||k||w>=j||p.dragging)&&h.push(p)}return h},TO=(e,r)=>{const o=new Set;return e.forEach(a=>{o.add(a.id)}),r.filter(a=>o.has(a.source)||o.has(a.target))};function RO(e,r){const o=new Map,a=r?.nodes?new Set(r.nodes.map(l=>l.id)):null;return e.forEach(l=>{l.measured.width&&l.measured.height&&(r?.includeHiddenNodes||!l.hidden)&&(!a||a.has(l.id))&&o.set(l.id,l)}),o}async function DO({nodes:e,width:r,height:o,panZoom:a,minZoom:l,maxZoom:u},d){if(e.size===0)return Promise.resolve(!0);const f=RO(e,d),h=il(f),p=Bp(h,r,o,d?.minZoom??l,d?.maxZoom??u,d?.padding??.1);return await a.setViewport(p,{duration:d?.duration,ease:d?.ease,interpolate:d?.interpolate}),Promise.resolve(!0)}function CN({nodeId:e,nextPosition:r,nodeLookup:o,nodeOrigin:a=[0,0],nodeExtent:l,onError:u}){const d=o.get(e),f=d.parentId?o.get(d.parentId):void 0,{x:h,y:p}=f?f.internals.positionAbsolute:{x:0,y:0},g=d.origin??a;let y=d.extent||l;if(d.extent==="parent"&&!d.expandParent)if(!f)u?.("005",Xn.error005());else{const b=f.measured.width,S=f.measured.height;b&&S&&(y=[[h,p],[h+b,p+S]])}else f&&ls(d.extent)&&(y=[[d.extent[0][0]+h,d.extent[0][1]+p],[d.extent[1][0]+h,d.extent[1][1]+p]]);const v=ls(y)?Qo(r,y,d.measured):r;return(d.measured.width===void 0||d.measured.height===void 0)&&u?.("015",Xn.error015()),{position:{x:v.x-h+(d.measured.width??0)*g[0],y:v.y-p+(d.measured.height??0)*g[1]},positionAbsolute:v}}async function OO({nodesToRemove:e=[],edgesToRemove:r=[],nodes:o,edges:a,onBeforeDelete:l}){const u=new Set(e.map(v=>v.id)),d=[];for(const v of o){if(v.deletable===!1)continue;const b=u.has(v.id),S=!b&&v.parentId&&d.find(w=>w.id===v.parentId);(b||S)&&d.push(v)}const f=new Set(r.map(v=>v.id)),h=a.filter(v=>v.deletable!==!1),g=TO(d,h);for(const v of h)f.has(v.id)&&!g.find(S=>S.id===v.id)&&g.push(v);if(!l)return{edges:g,nodes:d};const y=await l({nodes:d,edges:g});return typeof y=="boolean"?y?{edges:g,nodes:d}:{edges:[],nodes:[]}:y}const ss=(e,r=0,o=1)=>Math.min(Math.max(e,r),o),Qo=(e={x:0,y:0},r,o)=>({x:ss(e.x,r[0][0],r[1][0]-(o?.width??0)),y:ss(e.y,r[0][1],r[1][1]-(o?.height??0))});function kN(e,r,o){const{width:a,height:l}=Ar(o),{x:u,y:d}=o.internals.positionAbsolute;return Qo(e,[[u,d],[u+a,d+l]],r)}const Iy=(e,r,o)=>e<r?ss(Math.abs(e-r),1,r)/r:e>o?-ss(Math.abs(e-o),1,r)/r:0,AN=(e,r,o=15,a=40)=>{const l=Iy(e.x,a,r.width-a)*o,u=Iy(e.y,a,r.height-a)*o;return[l,u]},od=(e,r)=>({x:Math.min(e.x,r.x),y:Math.min(e.y,r.y),x2:Math.max(e.x2,r.x2),y2:Math.max(e.y2,r.y2)}),zh=({x:e,y:r,width:o,height:a})=>({x:e,y:r,x2:e+o,y2:r+a}),ad=({x:e,y:r,x2:o,y2:a})=>({x:e,y:r,width:o-e,height:a-r}),is=(e,r=[0,0])=>{const{x:o,y:a}=Ip(e)?e.internals.positionAbsolute:sl(e,r);return{x:o,y:a,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},Cu=(e,r=[0,0])=>{const{x:o,y:a}=Ip(e)?e.internals.positionAbsolute:sl(e,r);return{x:o,y:a,x2:o+(e.measured?.width??e.width??e.initialWidth??0),y2:a+(e.measured?.height??e.height??e.initialHeight??0)}},MN=(e,r)=>ad(od(zh(e),zh(r))),Xi=(e,r)=>{const o=Math.max(0,Math.min(e.x+e.width,r.x+r.width)-Math.max(e.x,r.x)),a=Math.max(0,Math.min(e.y+e.height,r.y+r.height)-Math.max(e.y,r.y));return Math.ceil(o*a)},Hy=e=>_n(e.width)&&_n(e.height)&&_n(e.x)&&_n(e.y),_n=e=>!isNaN(e)&&isFinite(e),zO=(e,r)=>{},ll=(e,r=[1,1])=>({x:r[0]*Math.round(e.x/r[0]),y:r[1]*Math.round(e.y/r[1])}),cl=({x:e,y:r},[o,a,l],u=!1,d=[1,1])=>{const f={x:(e-o)/l,y:(r-a)/l};return u?ll(f,d):f},ku=({x:e,y:r},[o,a,l])=>({x:e*l+o,y:r*l+a});function Ya(e,r){if(typeof e=="number")return Math.floor((r-r/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const o=parseFloat(e);if(!Number.isNaN(o))return Math.floor(o)}if(typeof e=="string"&&e.endsWith("%")){const o=parseFloat(e);if(!Number.isNaN(o))return Math.floor(r*o*.01)}return console.error(`[React Flow] The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function LO(e,r,o){if(typeof e=="string"||typeof e=="number"){const a=Ya(e,o),l=Ya(e,r);return{top:a,right:l,bottom:a,left:l,x:l*2,y:a*2}}if(typeof e=="object"){const a=Ya(e.top??e.y??0,o),l=Ya(e.bottom??e.y??0,o),u=Ya(e.left??e.x??0,r),d=Ya(e.right??e.x??0,r);return{top:a,right:d,bottom:l,left:u,x:u+d,y:a+l}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function IO(e,r,o,a,l,u){const{x:d,y:f}=ku(e,[r,o,a]),{x:h,y:p}=ku({x:e.x+e.width,y:e.y+e.height},[r,o,a]),g=l-h,y=u-p;return{left:Math.floor(d),top:Math.floor(f),right:Math.floor(g),bottom:Math.floor(y)}}const Bp=(e,r,o,a,l,u)=>{const d=LO(u,r,o),f=(r-d.x)/e.width,h=(o-d.y)/e.height,p=Math.min(f,h),g=ss(p,a,l),y=e.x+e.width/2,v=e.y+e.height/2,b=r/2-y*g,S=o/2-v*g,w=IO(e,b,S,g,r,o),j={left:Math.min(w.left-d.left,0),top:Math.min(w.top-d.top,0),right:Math.min(w.right-d.right,0),bottom:Math.min(w.bottom-d.bottom,0)};return{x:b-j.left+j.right,y:S-j.top+j.bottom,zoom:g}},Fi=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0;function ls(e){return e!=null&&e!=="parent"}function Ar(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function TN(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function RN(e,r={width:0,height:0},o,a,l){const u={...e},d=a.get(o);if(d){const f=d.origin||l;u.x+=d.internals.positionAbsolute.x-(r.width??0)*f[0],u.y+=d.internals.positionAbsolute.y-(r.height??0)*f[1]}return u}function By(e,r){if(e.size!==r.size)return!1;for(const o of e)if(!r.has(o))return!1;return!0}function HO(){let e,r;return{promise:new Promise((a,l)=>{e=a,r=l}),resolve:e,reject:r}}function BO(e){return{...SN,...e||{}}}function Oi(e,{snapGrid:r=[0,0],snapToGrid:o=!1,transform:a,containerBounds:l}){const{x:u,y:d}=$n(e),f=cl({x:u-(l?.left??0),y:d-(l?.top??0)},a),{x:h,y:p}=o?ll(f,r):f;return{xSnapped:h,ySnapped:p,...f}}const Up=e=>({width:e.offsetWidth,height:e.offsetHeight}),DN=e=>e?.getRootNode?.()||window?.document,UO=["INPUT","SELECT","TEXTAREA"];function ON(e){const r=e.composedPath?.()?.[0]||e.target;return r?.nodeType!==1?!1:UO.includes(r.nodeName)||r.hasAttribute("contenteditable")||!!r.closest(".nokey")}const zN=e=>"clientX"in e,$n=(e,r)=>{const o=zN(e),a=o?e.clientX:e.touches?.[0].clientX,l=o?e.clientY:e.touches?.[0].clientY;return{x:a-(r?.left??0),y:l-(r?.top??0)}},Uy=(e,r,o,a,l)=>{const u=r.querySelectorAll(`.${e}`);return!u||!u.length?null:Array.from(u).map(d=>{const f=d.getBoundingClientRect();return{id:d.getAttribute("data-handleid"),type:e,nodeId:l,position:d.getAttribute("data-handlepos"),x:(f.left-o.left)/a,y:(f.top-o.top)/a,...Up(d)}})};function LN({sourceX:e,sourceY:r,targetX:o,targetY:a,sourceControlX:l,sourceControlY:u,targetControlX:d,targetControlY:f}){const h=e*.125+l*.375+d*.375+o*.125,p=r*.125+u*.375+f*.375+a*.125,g=Math.abs(h-e),y=Math.abs(p-r);return[h,p,g,y]}function qc(e,r){return e>=0?.5*e:r*25*Math.sqrt(-e)}function Py({pos:e,x1:r,y1:o,x2:a,y2:l,c:u}){switch(e){case Ce.Left:return[r-qc(r-a,u),o];case Ce.Right:return[r+qc(a-r,u),o];case Ce.Top:return[r,o-qc(o-l,u)];case Ce.Bottom:return[r,o+qc(l-o,u)]}}function IN({sourceX:e,sourceY:r,sourcePosition:o=Ce.Bottom,targetX:a,targetY:l,targetPosition:u=Ce.Top,curvature:d=.25}){const[f,h]=Py({pos:o,x1:e,y1:r,x2:a,y2:l,c:d}),[p,g]=Py({pos:u,x1:a,y1:l,x2:e,y2:r,c:d}),[y,v,b,S]=LN({sourceX:e,sourceY:r,targetX:a,targetY:l,sourceControlX:f,sourceControlY:h,targetControlX:p,targetControlY:g});return[`M${e},${r} C${f},${h} ${p},${g} ${a},${l}`,y,v,b,S]}function HN({sourceX:e,sourceY:r,targetX:o,targetY:a}){const l=Math.abs(o-e)/2,u=o<e?o+l:o-l,d=Math.abs(a-r)/2,f=a<r?a+d:a-d;return[u,f,l,d]}function PO({sourceNode:e,targetNode:r,selected:o=!1,zIndex:a,elevateOnSelect:l=!1}){if(a!==void 0)return a;const u=l&&o?1e3:0,d=Math.max(e.parentId?e.internals.z:0,r.parentId?r.internals.z:0);return u+d}function $O({sourceNode:e,targetNode:r,width:o,height:a,transform:l}){const u=od(Cu(e),Cu(r));u.x===u.x2&&(u.x2+=1),u.y===u.y2&&(u.y2+=1);const d={x:-l[0]/l[2],y:-l[1]/l[2],width:o/l[2],height:a/l[2]};return Xi(d,ad(u))>0}const VO=({source:e,sourceHandle:r,target:o,targetHandle:a})=>`xy-edge__${e}${r||""}-${o}${a||""}`,qO=(e,r)=>r.some(o=>o.source===e.source&&o.target===e.target&&(o.sourceHandle===e.sourceHandle||!o.sourceHandle&&!e.sourceHandle)&&(o.targetHandle===e.targetHandle||!o.targetHandle&&!e.targetHandle)),YO=(e,r)=>{if(!e.source||!e.target)return r;let o;return jN(e)?o={...e}:o={...e,id:VO(e)},qO(o,r)?r:(o.sourceHandle===null&&delete o.sourceHandle,o.targetHandle===null&&delete o.targetHandle,r.concat(o))};function BN({sourceX:e,sourceY:r,targetX:o,targetY:a}){const[l,u,d,f]=HN({sourceX:e,sourceY:r,targetX:o,targetY:a});return[`M ${e},${r}L ${o},${a}`,l,u,d,f]}const $y={[Ce.Left]:{x:-1,y:0},[Ce.Right]:{x:1,y:0},[Ce.Top]:{x:0,y:-1},[Ce.Bottom]:{x:0,y:1}},GO=({source:e,sourcePosition:r=Ce.Bottom,target:o})=>r===Ce.Left||r===Ce.Right?e.x<o.x?{x:1,y:0}:{x:-1,y:0}:e.y<o.y?{x:0,y:1}:{x:0,y:-1},Vy=(e,r)=>Math.sqrt(Math.pow(r.x-e.x,2)+Math.pow(r.y-e.y,2));function XO({source:e,sourcePosition:r=Ce.Bottom,target:o,targetPosition:a=Ce.Top,center:l,offset:u,stepPosition:d}){const f=$y[r],h=$y[a],p={x:e.x+f.x*u,y:e.y+f.y*u},g={x:o.x+h.x*u,y:o.y+h.y*u},y=GO({source:p,sourcePosition:r,target:g}),v=y.x!==0?"x":"y",b=y[v];let S=[],w,j;const k={x:0,y:0},M={x:0,y:0},[,,_,A]=HN({sourceX:e.x,sourceY:e.y,targetX:o.x,targetY:o.y});if(f[v]*h[v]===-1){v==="x"?(w=l.x??p.x+(g.x-p.x)*d,j=l.y??(p.y+g.y)/2):(w=l.x??(p.x+g.x)/2,j=l.y??p.y+(g.y-p.y)*d);const L=[{x:w,y:p.y},{x:w,y:g.y}],H=[{x:p.x,y:j},{x:g.x,y:j}];f[v]===b?S=v==="x"?L:H:S=v==="x"?H:L}else{const L=[{x:p.x,y:g.y}],H=[{x:g.x,y:p.y}];if(v==="x"?S=f.x===b?H:L:S=f.y===b?L:H,r===a){const G=Math.abs(e[v]-o[v]);if(G<=u){const te=Math.min(u-1,u-G);f[v]===b?k[v]=(p[v]>e[v]?-1:1)*te:M[v]=(g[v]>o[v]?-1:1)*te}}if(r!==a){const G=v==="x"?"y":"x",te=f[v]===h[G],I=p[G]>g[G],V=p[G]<g[G];(f[v]===1&&(!te&&I||te&&V)||f[v]!==1&&(!te&&V||te&&I))&&(S=v==="x"?L:H)}const B={x:p.x+k.x,y:p.y+k.y},q={x:g.x+M.x,y:g.y+M.y},Z=Math.max(Math.abs(B.x-S[0].x),Math.abs(q.x-S[0].x)),K=Math.max(Math.abs(B.y-S[0].y),Math.abs(q.y-S[0].y));Z>=K?(w=(B.x+q.x)/2,j=S[0].y):(w=S[0].x,j=(B.y+q.y)/2)}return[[e,{x:p.x+k.x,y:p.y+k.y},...S,{x:g.x+M.x,y:g.y+M.y},o],w,j,_,A]}function FO(e,r,o,a){const l=Math.min(Vy(e,r)/2,Vy(r,o)/2,a),{x:u,y:d}=r;if(e.x===u&&u===o.x||e.y===d&&d===o.y)return`L${u} ${d}`;if(e.y===d){const p=e.x<o.x?-1:1,g=e.y<o.y?1:-1;return`L ${u+l*p},${d}Q ${u},${d} ${u},${d+l*g}`}const f=e.x<o.x?1:-1,h=e.y<o.y?-1:1;return`L ${u},${d+l*h}Q ${u},${d} ${u+l*f},${d}`}function Lh({sourceX:e,sourceY:r,sourcePosition:o=Ce.Bottom,targetX:a,targetY:l,targetPosition:u=Ce.Top,borderRadius:d=5,centerX:f,centerY:h,offset:p=20,stepPosition:g=.5}){const[y,v,b,S,w]=XO({source:{x:e,y:r},sourcePosition:o,target:{x:a,y:l},targetPosition:u,center:{x:f,y:h},offset:p,stepPosition:g});return[y.reduce((k,M,_)=>{let A="";return _>0&&_<y.length-1?A=FO(y[_-1],M,y[_+1],d):A=`${_===0?"M":"L"}${M.x} ${M.y}`,k+=A,k},""),v,b,S,w]}function qy(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function ZO(e){const{sourceNode:r,targetNode:o}=e;if(!qy(r)||!qy(o))return null;const a=r.internals.handleBounds||Yy(r.handles),l=o.internals.handleBounds||Yy(o.handles),u=Gy(a?.source??[],e.sourceHandle),d=Gy(e.connectionMode===as.Strict?l?.target??[]:(l?.target??[]).concat(l?.source??[]),e.targetHandle);if(!u||!d)return e.onError?.("008",Xn.error008(u?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const f=u?.position||Ce.Bottom,h=d?.position||Ce.Top,p=Zi(r,u,f),g=Zi(o,d,h);return{sourceX:p.x,sourceY:p.y,targetX:g.x,targetY:g.y,sourcePosition:f,targetPosition:h}}function Yy(e){if(!e)return null;const r=[],o=[];for(const a of e)a.width=a.width??1,a.height=a.height??1,a.type==="source"?r.push(a):a.type==="target"&&o.push(a);return{source:r,target:o}}function Zi(e,r,o=Ce.Left,a=!1){const l=(r?.x??0)+e.internals.positionAbsolute.x,u=(r?.y??0)+e.internals.positionAbsolute.y,{width:d,height:f}=r??Ar(e);if(a)return{x:l+d/2,y:u+f/2};switch(r?.position??o){case Ce.Top:return{x:l+d/2,y:u};case Ce.Right:return{x:l+d,y:u+f/2};case Ce.Bottom:return{x:l+d/2,y:u+f};case Ce.Left:return{x:l,y:u+f/2}}}function Gy(e,r){return e&&(r?e.find(o=>o.id===r):e[0])||null}function Ih(e,r){return e?typeof e=="string"?e:`${r?`${r}__`:""}${Object.keys(e).sort().map(a=>`${a}=${e[a]}`).join("&")}`:""}function KO(e,{id:r,defaultColor:o,defaultMarkerStart:a,defaultMarkerEnd:l}){const u=new Set;return e.reduce((d,f)=>([f.markerStart||a,f.markerEnd||l].forEach(h=>{if(h&&typeof h=="object"){const p=Ih(h,r);u.has(p)||(d.push({id:p,color:h.color||o,...h}),u.add(p))}}),d),[]).sort((d,f)=>d.id.localeCompare(f.id))}const Pp={nodeOrigin:[0,0],nodeExtent:Yi,elevateNodesOnSelect:!0,defaults:{}},WO={...Pp,checkEquality:!0};function $p(e,r){const o={...e};for(const a in r)r[a]!==void 0&&(o[a]=r[a]);return o}function QO(e,r,o){const a=$p(Pp,o);for(const l of e.values())if(l.parentId)Vp(l,e,r,a);else{const u=sl(l,a.nodeOrigin),d=ls(l.extent)?l.extent:a.nodeExtent,f=Qo(u,d,Ar(l));l.internals.positionAbsolute=f}}function Hh(e,r,o,a){const l=$p(WO,a);let u=e.length>0;const d=new Map(r),f=l?.elevateNodesOnSelect?1e3:0;r.clear(),o.clear();for(const h of e){let p=d.get(h.id);if(l.checkEquality&&h===p?.internals.userNode)r.set(h.id,p);else{const g=sl(h,l.nodeOrigin),y=ls(h.extent)?h.extent:l.nodeExtent,v=Qo(g,y,Ar(h));p={...l.defaults,...h,measured:{width:h.measured?.width,height:h.measured?.height},internals:{positionAbsolute:v,handleBounds:h.measured?p?.internals.handleBounds:void 0,z:UN(h,f),userNode:h}},r.set(h.id,p)}(p.measured===void 0||p.measured.width===void 0||p.measured.height===void 0)&&!p.hidden&&(u=!1),h.parentId&&Vp(p,r,o,a)}return u}function JO(e,r){if(!e.parentId)return;const o=r.get(e.parentId);o?o.set(e.id,e):r.set(e.parentId,new Map([[e.id,e]]))}function Vp(e,r,o,a){const{elevateNodesOnSelect:l,nodeOrigin:u,nodeExtent:d}=$p(Pp,a),f=e.parentId,h=r.get(f);if(!h){console.warn(`Parent node ${f} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}JO(e,o);const p=l?1e3:0,{x:g,y,z:v}=e8(e,h,u,d,p),{positionAbsolute:b}=e.internals,S=g!==b.x||y!==b.y;(S||v!==e.internals.z)&&r.set(e.id,{...e,internals:{...e.internals,positionAbsolute:S?{x:g,y}:b,z:v}})}function UN(e,r){return(_n(e.zIndex)?e.zIndex:0)+(e.selected?r:0)}function e8(e,r,o,a,l){const{x:u,y:d}=r.internals.positionAbsolute,f=Ar(e),h=sl(e,o),p=ls(e.extent)?Qo(h,e.extent,f):h;let g=Qo({x:u+p.x,y:d+p.y},a,f);e.extent==="parent"&&(g=kN(g,f,r));const y=UN(e,l),v=r.internals.z??0;return{x:g.x,y:g.y,z:v>=y?v+1:y}}function qp(e,r,o,a=[0,0]){const l=[],u=new Map;for(const d of e){const f=r.get(d.parentId);if(!f)continue;const h=u.get(d.parentId)?.expandedRect??is(f),p=MN(h,d.rect);u.set(d.parentId,{expandedRect:p,parent:f})}return u.size>0&&u.forEach(({expandedRect:d,parent:f},h)=>{const p=f.internals.positionAbsolute,g=Ar(f),y=f.origin??a,v=d.x<p.x?Math.round(Math.abs(p.x-d.x)):0,b=d.y<p.y?Math.round(Math.abs(p.y-d.y)):0,S=Math.max(g.width,Math.round(d.width)),w=Math.max(g.height,Math.round(d.height)),j=(S-g.width)*y[0],k=(w-g.height)*y[1];(v>0||b>0||j||k)&&(l.push({id:h,type:"position",position:{x:f.position.x-v+j,y:f.position.y-b+k}}),o.get(h)?.forEach(M=>{e.some(_=>_.id===M.id)||l.push({id:M.id,type:"position",position:{x:M.position.x+v,y:M.position.y+b}})})),(g.width<d.width||g.height<d.height||v||b)&&l.push({id:h,type:"dimensions",setAttributes:!0,dimensions:{width:S+(v?y[0]*v-j:0),height:w+(b?y[1]*b-k:0)}})}),l}function t8(e,r,o,a,l,u){const d=a?.querySelector(".xyflow__viewport");let f=!1;if(!d)return{changes:[],updatedInternals:f};const h=[],p=window.getComputedStyle(d),{m22:g}=new window.DOMMatrixReadOnly(p.transform),y=[];for(const v of e.values()){const b=r.get(v.id);if(!b)continue;if(b.hidden){r.set(b.id,{...b,internals:{...b.internals,handleBounds:void 0}}),f=!0;continue}const S=Up(v.nodeElement),w=b.measured.width!==S.width||b.measured.height!==S.height;if(!!(S.width&&S.height&&(w||!b.internals.handleBounds||v.force))){const k=v.nodeElement.getBoundingClientRect(),M=ls(b.extent)?b.extent:u;let{positionAbsolute:_}=b.internals;b.parentId&&b.extent==="parent"?_=kN(_,S,r.get(b.parentId)):M&&(_=Qo(_,M,S));const A={...b,measured:S,internals:{...b.internals,positionAbsolute:_,handleBounds:{source:Uy("source",v.nodeElement,k,g,b.id),target:Uy("target",v.nodeElement,k,g,b.id)}}};r.set(b.id,A),b.parentId&&Vp(A,r,o,{nodeOrigin:l}),f=!0,w&&(h.push({id:b.id,type:"dimensions",dimensions:S}),b.expandParent&&b.parentId&&y.push({id:b.id,parentId:b.parentId,rect:is(A,l)}))}}if(y.length>0){const v=qp(y,r,o,l);h.push(...v)}return{changes:h,updatedInternals:f}}async function n8({delta:e,panZoom:r,transform:o,translateExtent:a,width:l,height:u}){if(!r||!e.x&&!e.y)return Promise.resolve(!1);const d=await r.setViewportConstrained({x:o[0]+e.x,y:o[1]+e.y,zoom:o[2]},[[0,0],[l,u]],a),f=!!d&&(d.x!==o[0]||d.y!==o[1]||d.k!==o[2]);return Promise.resolve(f)}function Xy(e,r,o,a,l,u){let d=l;const f=a.get(d)||new Map;a.set(d,f.set(o,r)),d=`${l}-${e}`;const h=a.get(d)||new Map;if(a.set(d,h.set(o,r)),u){d=`${l}-${e}-${u}`;const p=a.get(d)||new Map;a.set(d,p.set(o,r))}}function PN(e,r,o){e.clear(),r.clear();for(const a of o){const{source:l,target:u,sourceHandle:d=null,targetHandle:f=null}=a,h={edgeId:a.id,source:l,target:u,sourceHandle:d,targetHandle:f},p=`${l}-${d}--${u}-${f}`,g=`${u}-${f}--${l}-${d}`;Xy("source",h,g,e,l,d),Xy("target",h,p,e,u,f),r.set(a.id,a)}}function $N(e,r){if(!e.parentId)return!1;const o=r.get(e.parentId);return o?o.selected?!0:$N(o,r):!1}function Fy(e,r,o){let a=e;do{if(a?.matches?.(r))return!0;if(a===o)return!1;a=a?.parentElement}while(a);return!1}function r8(e,r,o,a){const l=new Map;for(const[u,d]of e)if((d.selected||d.id===a)&&(!d.parentId||!$N(d,e))&&(d.draggable||r&&typeof d.draggable>"u")){const f=e.get(u);f&&l.set(u,{id:u,position:f.position||{x:0,y:0},distance:{x:o.x-f.internals.positionAbsolute.x,y:o.y-f.internals.positionAbsolute.y},extent:f.extent,parentId:f.parentId,origin:f.origin,expandParent:f.expandParent,internals:{positionAbsolute:f.internals.positionAbsolute||{x:0,y:0}},measured:{width:f.measured.width??0,height:f.measured.height??0}})}return l}function Km({nodeId:e,dragItems:r,nodeLookup:o,dragging:a=!0}){const l=[];for(const[d,f]of r){const h=o.get(d)?.internals.userNode;h&&l.push({...h,position:f.position,dragging:a})}if(!e)return[l[0],l];const u=o.get(e)?.internals.userNode;return[u?{...u,position:r.get(e)?.position||u.position,dragging:a}:l[0],l]}function o8({dragItems:e,snapGrid:r,x:o,y:a}){const l=e.values().next().value;if(!l)return null;const u={x:o-l.distance.x,y:a-l.distance.y},d=ll(u,r);return{x:d.x-u.x,y:d.y-u.y}}function a8({onNodeMouseDown:e,getStoreItems:r,onDragStart:o,onDrag:a,onDragStop:l}){let u={x:null,y:null},d=0,f=new Map,h=!1,p={x:0,y:0},g=null,y=!1,v=null,b=!1,S=!1,w=null;function j({noDragClassName:M,handleSelector:_,domNode:A,isSelectable:D,nodeId:L,nodeClickDistance:H=0}){v=an(A);function B({x:G,y:te}){const{nodeLookup:I,nodeExtent:V,snapGrid:E,snapToGrid:O,nodeOrigin:z,onNodeDrag:P,onSelectionDrag:T,onError:U,updateNodePositions:X}=r();u={x:G,y:te};let ee=!1;const ae=f.size>1,me=ae&&V?zh(il(f)):null,ue=ae&&O?o8({dragItems:f,snapGrid:E,x:G,y:te}):null;for(const[Q,se]of f){if(!I.has(Q))continue;let pe={x:G-se.distance.x,y:te-se.distance.y};O&&(pe=ue?{x:Math.round(pe.x+ue.x),y:Math.round(pe.y+ue.y)}:ll(pe,E));let le=null;if(ae&&V&&!se.extent&&me){const{positionAbsolute:xe}=se.internals,ge=xe.x-me.x+V[0][0],Be=xe.x+se.measured.width-me.x2+V[1][0],at=xe.y-me.y+V[0][1],re=xe.y+se.measured.height-me.y2+V[1][1];le=[[ge,at],[Be,re]]}const{position:de,positionAbsolute:he}=CN({nodeId:Q,nextPosition:pe,nodeLookup:I,nodeExtent:le||V,nodeOrigin:z,onError:U});ee=ee||se.position.x!==de.x||se.position.y!==de.y,se.position=de,se.internals.positionAbsolute=he}if(S=S||ee,!!ee&&(X(f,!0),w&&(a||P||!L&&T))){const[Q,se]=Km({nodeId:L,dragItems:f,nodeLookup:I});a?.(w,f,Q,se),P?.(w,Q,se),L||T?.(w,se)}}async function q(){if(!g)return;const{transform:G,panBy:te,autoPanSpeed:I,autoPanOnNodeDrag:V}=r();if(!V){h=!1,cancelAnimationFrame(d);return}const[E,O]=AN(p,g,I);(E!==0||O!==0)&&(u.x=(u.x??0)-E/G[2],u.y=(u.y??0)-O/G[2],await te({x:E,y:O})&&B(u)),d=requestAnimationFrame(q)}function Z(G){const{nodeLookup:te,multiSelectionActive:I,nodesDraggable:V,transform:E,snapGrid:O,snapToGrid:z,selectNodesOnDrag:P,onNodeDragStart:T,onSelectionDragStart:U,unselectNodesAndEdges:X}=r();y=!0,(!P||!D)&&!I&&L&&(te.get(L)?.selected||X()),D&&P&&L&&e?.(L);const ee=Oi(G.sourceEvent,{transform:E,snapGrid:O,snapToGrid:z,containerBounds:g});if(u=ee,f=r8(te,V,ee,L),f.size>0&&(o||T||!L&&U)){const[ae,me]=Km({nodeId:L,dragItems:f,nodeLookup:te});o?.(G.sourceEvent,f,ae,me),T?.(G.sourceEvent,ae,me),L||U?.(G.sourceEvent,me)}}const K=sN().clickDistance(H).on("start",G=>{const{domNode:te,nodeDragThreshold:I,transform:V,snapGrid:E,snapToGrid:O}=r();g=te?.getBoundingClientRect()||null,b=!1,S=!1,w=G.sourceEvent,I===0&&Z(G),u=Oi(G.sourceEvent,{transform:V,snapGrid:E,snapToGrid:O,containerBounds:g}),p=$n(G.sourceEvent,g)}).on("drag",G=>{const{autoPanOnNodeDrag:te,transform:I,snapGrid:V,snapToGrid:E,nodeDragThreshold:O,nodeLookup:z}=r(),P=Oi(G.sourceEvent,{transform:I,snapGrid:V,snapToGrid:E,containerBounds:g});if(w=G.sourceEvent,(G.sourceEvent.type==="touchmove"&&G.sourceEvent.touches.length>1||L&&!z.has(L))&&(b=!0),!b){if(!h&&te&&y&&(h=!0,q()),!y){const T=P.xSnapped-(u.x??0),U=P.ySnapped-(u.y??0);Math.sqrt(T*T+U*U)>O&&Z(G)}(u.x!==P.xSnapped||u.y!==P.ySnapped)&&f&&y&&(p=$n(G.sourceEvent,g),B(P))}}).on("end",G=>{if(!(!y||b)&&(h=!1,y=!1,cancelAnimationFrame(d),f.size>0)){const{nodeLookup:te,updateNodePositions:I,onNodeDragStop:V,onSelectionDragStop:E}=r();if(S&&(I(f,!1),S=!1),l||V||!L&&E){const[O,z]=Km({nodeId:L,dragItems:f,nodeLookup:te,dragging:!1});l?.(G.sourceEvent,f,O,z),V?.(G.sourceEvent,O,z),L||E?.(G.sourceEvent,z)}}}).filter(G=>{const te=G.target;return!G.button&&(!M||!Fy(te,`.${M}`,A))&&(!_||Fy(te,_,A))});v.call(K)}function k(){v?.on(".drag",null)}return{update:j,destroy:k}}function s8(e,r,o){const a=[],l={x:e.x-o,y:e.y-o,width:o*2,height:o*2};for(const u of r.values())Xi(l,is(u))>0&&a.push(u);return a}const i8=250;function l8(e,r,o,a){let l=[],u=1/0;const d=s8(e,o,r+i8);for(const f of d){const h=[...f.internals.handleBounds?.source??[],...f.internals.handleBounds?.target??[]];for(const p of h){if(a.nodeId===p.nodeId&&a.type===p.type&&a.id===p.id)continue;const{x:g,y}=Zi(f,p,p.position,!0),v=Math.sqrt(Math.pow(g-e.x,2)+Math.pow(y-e.y,2));v>r||(v<u?(l=[{...p,x:g,y}],u=v):v===u&&l.push({...p,x:g,y}))}}if(!l.length)return null;if(l.length>1){const f=a.type==="source"?"target":"source";return l.find(h=>h.type===f)??l[0]}return l[0]}function VN(e,r,o,a,l,u=!1){const d=a.get(e);if(!d)return null;const f=l==="strict"?d.internals.handleBounds?.[r]:[...d.internals.handleBounds?.source??[],...d.internals.handleBounds?.target??[]],h=(o?f?.find(p=>p.id===o):f?.[0])??null;return h&&u?{...h,...Zi(d,h,h.position,!0)}:h}function qN(e,r){return e||(r?.classList.contains("target")?"target":r?.classList.contains("source")?"source":null)}function c8(e,r){let o=null;return r?o=!0:e&&!r&&(o=!1),o}const YN=()=>!0;function u8(e,{connectionMode:r,connectionRadius:o,handleId:a,nodeId:l,edgeUpdaterType:u,isTarget:d,domNode:f,nodeLookup:h,lib:p,autoPanOnConnect:g,flowId:y,panBy:v,cancelConnection:b,onConnectStart:S,onConnect:w,onConnectEnd:j,isValidConnection:k=YN,onReconnectEnd:M,updateConnection:_,getTransform:A,getFromHandle:D,autoPanSpeed:L,dragThreshold:H=1,handleDomNode:B}){const q=DN(e.target);let Z=0,K;const{x:G,y:te}=$n(e),I=qN(u,B),V=f?.getBoundingClientRect();let E=!1;if(!V||!I)return;const O=VN(l,I,a,h,r);if(!O)return;let z=$n(e,V),P=!1,T=null,U=!1,X=null;function ee(){if(!g||!V)return;const[de,he]=AN(z,V,L);v({x:de,y:he}),Z=requestAnimationFrame(ee)}const ae={...O,nodeId:l,type:I,position:O.position},me=h.get(l);let Q={inProgress:!0,isValid:null,from:Zi(me,ae,Ce.Left,!0),fromHandle:ae,fromPosition:ae.position,fromNode:me,to:z,toHandle:null,toPosition:Ly[ae.position],toNode:null};function se(){E=!0,_(Q),S?.(e,{nodeId:l,handleId:a,handleType:I})}H===0&&se();function pe(de){if(!E){const{x:Be,y:at}=$n(de),re=Be-G,ve=at-te;if(!(re*re+ve*ve>H*H))return;se()}if(!D()||!ae){le(de);return}const he=A();z=$n(de,V),K=l8(cl(z,he,!1,[1,1]),o,h,ae),P||(ee(),P=!0);const xe=GN(de,{handle:K,connectionMode:r,fromNodeId:l,fromHandleId:a,fromType:d?"target":"source",isValidConnection:k,doc:q,lib:p,flowId:y,nodeLookup:h});X=xe.handleDomNode,T=xe.connection,U=c8(!!K,xe.isValid);const ge={...Q,isValid:U,to:xe.toHandle&&U?ku({x:xe.toHandle.x,y:xe.toHandle.y},he):z,toHandle:xe.toHandle,toPosition:U&&xe.toHandle?xe.toHandle.position:Ly[ae.position],toNode:xe.toHandle?h.get(xe.toHandle.nodeId):null};U&&K&&Q.toHandle&&ge.toHandle&&Q.toHandle.type===ge.toHandle.type&&Q.toHandle.nodeId===ge.toHandle.nodeId&&Q.toHandle.id===ge.toHandle.id&&Q.to.x===ge.to.x&&Q.to.y===ge.to.y||(_(ge),Q=ge)}function le(de){if(E){(K||X)&&T&&U&&w?.(T);const{inProgress:he,...xe}=Q,ge={...xe,toPosition:Q.toHandle?Q.toPosition:null};j?.(de,ge),u&&M?.(de,ge)}b(),cancelAnimationFrame(Z),P=!1,U=!1,T=null,X=null,q.removeEventListener("mousemove",pe),q.removeEventListener("mouseup",le),q.removeEventListener("touchmove",pe),q.removeEventListener("touchend",le)}q.addEventListener("mousemove",pe),q.addEventListener("mouseup",le),q.addEventListener("touchmove",pe),q.addEventListener("touchend",le)}function GN(e,{handle:r,connectionMode:o,fromNodeId:a,fromHandleId:l,fromType:u,doc:d,lib:f,flowId:h,isValidConnection:p=YN,nodeLookup:g}){const y=u==="target",v=r?d.querySelector(`.${f}-flow__handle[data-id="${h}-${r?.nodeId}-${r?.id}-${r?.type}"]`):null,{x:b,y:S}=$n(e),w=d.elementFromPoint(b,S),j=w?.classList.contains(`${f}-flow__handle`)?w:v,k={handleDomNode:j,isValid:!1,connection:null,toHandle:null};if(j){const M=qN(void 0,j),_=j.getAttribute("data-nodeid"),A=j.getAttribute("data-handleid"),D=j.classList.contains("connectable"),L=j.classList.contains("connectableend");if(!_||!M)return k;const H={source:y?_:a,sourceHandle:y?A:l,target:y?a:_,targetHandle:y?l:A};k.connection=H;const q=D&&L&&(o===as.Strict?y&&M==="source"||!y&&M==="target":_!==a||A!==l);k.isValid=q&&p(H),k.toHandle=VN(_,M,A,g,o,!0)}return k}const Bh={onPointerDown:u8,isValid:GN};function d8({domNode:e,panZoom:r,getTransform:o,getViewScale:a}){const l=an(e);function u({translateExtent:f,width:h,height:p,zoomStep:g=1,pannable:y=!0,zoomable:v=!0,inversePan:b=!1}){const S=_=>{if(_.sourceEvent.type!=="wheel"||!r)return;const A=o(),D=_.sourceEvent.ctrlKey&&Fi()?10:1,L=-_.sourceEvent.deltaY*(_.sourceEvent.deltaMode===1?.05:_.sourceEvent.deltaMode?1:.002)*g,H=A[2]*Math.pow(2,L*D);r.scaleTo(H)};let w=[0,0];const j=_=>{(_.sourceEvent.type==="mousedown"||_.sourceEvent.type==="touchstart")&&(w=[_.sourceEvent.clientX??_.sourceEvent.touches[0].clientX,_.sourceEvent.clientY??_.sourceEvent.touches[0].clientY])},k=_=>{const A=o();if(_.sourceEvent.type!=="mousemove"&&_.sourceEvent.type!=="touchmove"||!r)return;const D=[_.sourceEvent.clientX??_.sourceEvent.touches[0].clientX,_.sourceEvent.clientY??_.sourceEvent.touches[0].clientY],L=[D[0]-w[0],D[1]-w[1]];w=D;const H=a()*Math.max(A[2],Math.log(A[2]))*(b?-1:1),B={x:A[0]-L[0]*H,y:A[1]-L[1]*H},q=[[0,0],[h,p]];r.setViewportConstrained({x:B.x,y:B.y,zoom:A[2]},q,f)},M=wN().on("start",j).on("zoom",y?k:null).on("zoom.wheel",v?S:null);l.call(M,{})}function d(){l.on("zoom",null)}return{update:u,destroy:d,pointer:Sn}}const f8=(e,r)=>e.x!==r.x||e.y!==r.y||e.zoom!==r.k,sd=e=>({x:e.x,y:e.y,zoom:e.k}),Wm=({x:e,y:r,zoom:o})=>rd.translate(e,r).scale(o),Ga=(e,r)=>e.target.closest(`.${r}`),XN=(e,r)=>r===2&&Array.isArray(e)&&e.includes(2),m8=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,Qm=(e,r=0,o=m8,a=()=>{})=>{const l=typeof r=="number"&&r>0;return l||a(),l?e.transition().duration(r).ease(o).on("end",a):e},FN=e=>{const r=e.ctrlKey&&Fi()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*r};function h8({zoomPanValues:e,noWheelClassName:r,d3Selection:o,d3Zoom:a,panOnScrollMode:l,panOnScrollSpeed:u,zoomOnPinch:d,onPanZoomStart:f,onPanZoom:h,onPanZoomEnd:p}){return g=>{if(Ga(g,r))return!1;g.preventDefault(),g.stopImmediatePropagation();const y=o.property("__zoom").k||1;if(g.ctrlKey&&d){const j=Sn(g),k=FN(g),M=y*Math.pow(2,k);a.scaleTo(o,M,j,g);return}const v=g.deltaMode===1?20:1;let b=l===$o.Vertical?0:g.deltaX*v,S=l===$o.Horizontal?0:g.deltaY*v;!Fi()&&g.shiftKey&&l!==$o.Vertical&&(b=g.deltaY*v,S=0),a.translateBy(o,-(b/y)*u,-(S/y)*u,{internal:!0});const w=sd(o.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling||(e.isPanScrolling=!0,f?.(g,w)),e.isPanScrolling&&(h?.(g,w),e.panScrollTimeout=setTimeout(()=>{p?.(g,w),e.isPanScrolling=!1},150))}}function p8({noWheelClassName:e,preventScrolling:r,d3ZoomHandler:o}){return function(a,l){const u=a.type==="wheel",d=!r&&u&&!a.ctrlKey,f=Ga(a,e);if(a.ctrlKey&&u&&f&&a.preventDefault(),d||f)return null;a.preventDefault(),o.call(this,a,l)}}function g8({zoomPanValues:e,onDraggingChange:r,onPanZoomStart:o}){return a=>{if(a.sourceEvent?.internal)return;const l=sd(a.transform);e.mouseButton=a.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=l,a.sourceEvent?.type==="mousedown"&&r(!0),o&&o?.(a.sourceEvent,l)}}function x8({zoomPanValues:e,panOnDrag:r,onPaneContextMenu:o,onTransformChange:a,onPanZoom:l}){return u=>{e.usedRightMouseButton=!!(o&&XN(r,e.mouseButton??0)),u.sourceEvent?.sync||a([u.transform.x,u.transform.y,u.transform.k]),l&&!u.sourceEvent?.internal&&l?.(u.sourceEvent,sd(u.transform))}}function v8({zoomPanValues:e,panOnDrag:r,panOnScroll:o,onDraggingChange:a,onPanZoomEnd:l,onPaneContextMenu:u}){return d=>{if(!d.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,u&&XN(r,e.mouseButton??0)&&!e.usedRightMouseButton&&d.sourceEvent&&u(d.sourceEvent),e.usedRightMouseButton=!1,a(!1),l&&f8(e.prevViewport,d.transform))){const f=sd(d.transform);e.prevViewport=f,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{l?.(d.sourceEvent,f)},o?150:0)}}}function y8({zoomActivationKeyPressed:e,zoomOnScroll:r,zoomOnPinch:o,panOnDrag:a,panOnScroll:l,zoomOnDoubleClick:u,userSelectionActive:d,noWheelClassName:f,noPanClassName:h,lib:p}){return g=>{const y=e||r,v=o&&g.ctrlKey;if(g.button===1&&g.type==="mousedown"&&(Ga(g,`${p}-flow__node`)||Ga(g,`${p}-flow__edge`)))return!0;if(!a&&!y&&!l&&!u&&!o||d||Ga(g,f)&&g.type==="wheel"||Ga(g,h)&&(g.type!=="wheel"||l&&g.type==="wheel"&&!e)||!o&&g.ctrlKey&&g.type==="wheel")return!1;if(!o&&g.type==="touchstart"&&g.touches?.length>1)return g.preventDefault(),!1;if(!y&&!l&&!v&&g.type==="wheel"||!a&&(g.type==="mousedown"||g.type==="touchstart")||Array.isArray(a)&&!a.includes(g.button)&&g.type==="mousedown")return!1;const b=Array.isArray(a)&&a.includes(g.button)||!g.button||g.button<=1;return(!g.ctrlKey||g.type==="wheel")&&b}}function b8({domNode:e,minZoom:r,maxZoom:o,paneClickDistance:a,translateExtent:l,viewport:u,onPanZoom:d,onPanZoomStart:f,onPanZoomEnd:h,onDraggingChange:p}){const g={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{x:0,y:0,zoom:0},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},y=e.getBoundingClientRect(),v=wN().clickDistance(!_n(a)||a<0?0:a).scaleExtent([r,o]).translateExtent(l),b=an(e).call(v);_({x:u.x,y:u.y,zoom:ss(u.zoom,r,o)},[[0,0],[y.width,y.height]],l);const S=b.on("wheel.zoom"),w=b.on("dblclick.zoom");v.wheelDelta(FN);function j(G,te){return b?new Promise(I=>{v?.interpolate(te?.interpolate==="linear"?Di:nu).transform(Qm(b,te?.duration,te?.ease,()=>I(!0)),G)}):Promise.resolve(!1)}function k({noWheelClassName:G,noPanClassName:te,onPaneContextMenu:I,userSelectionActive:V,panOnScroll:E,panOnDrag:O,panOnScrollMode:z,panOnScrollSpeed:P,preventScrolling:T,zoomOnPinch:U,zoomOnScroll:X,zoomOnDoubleClick:ee,zoomActivationKeyPressed:ae,lib:me,onTransformChange:ue}){V&&!g.isZoomingOrPanning&&M();const se=E&&!ae&&!V?h8({zoomPanValues:g,noWheelClassName:G,d3Selection:b,d3Zoom:v,panOnScrollMode:z,panOnScrollSpeed:P,zoomOnPinch:U,onPanZoomStart:f,onPanZoom:d,onPanZoomEnd:h}):p8({noWheelClassName:G,preventScrolling:T,d3ZoomHandler:S});if(b.on("wheel.zoom",se,{passive:!1}),!V){const le=g8({zoomPanValues:g,onDraggingChange:p,onPanZoomStart:f});v.on("start",le);const de=x8({zoomPanValues:g,panOnDrag:O,onPaneContextMenu:!!I,onPanZoom:d,onTransformChange:ue});v.on("zoom",de);const he=v8({zoomPanValues:g,panOnDrag:O,panOnScroll:E,onPaneContextMenu:I,onPanZoomEnd:h,onDraggingChange:p});v.on("end",he)}const pe=y8({zoomActivationKeyPressed:ae,panOnDrag:O,zoomOnScroll:X,panOnScroll:E,zoomOnDoubleClick:ee,zoomOnPinch:U,userSelectionActive:V,noPanClassName:te,noWheelClassName:G,lib:me});v.filter(pe),ee?b.on("dblclick.zoom",w):b.on("dblclick.zoom",null)}function M(){v.on("zoom",null)}async function _(G,te,I){const V=Wm(G),E=v?.constrain()(V,te,I);return E&&await j(E),new Promise(O=>O(E))}async function A(G,te){const I=Wm(G);return await j(I,te),new Promise(V=>V(I))}function D(G){if(b){const te=Wm(G),I=b.property("__zoom");(I.k!==G.zoom||I.x!==G.x||I.y!==G.y)&&v?.transform(b,te,null,{sync:!0})}}function L(){const G=b?bN(b.node()):{x:0,y:0,k:1};return{x:G.x,y:G.y,zoom:G.k}}function H(G,te){return b?new Promise(I=>{v?.interpolate(te?.interpolate==="linear"?Di:nu).scaleTo(Qm(b,te?.duration,te?.ease,()=>I(!0)),G)}):Promise.resolve(!1)}function B(G,te){return b?new Promise(I=>{v?.interpolate(te?.interpolate==="linear"?Di:nu).scaleBy(Qm(b,te?.duration,te?.ease,()=>I(!0)),G)}):Promise.resolve(!1)}function q(G){v?.scaleExtent(G)}function Z(G){v?.translateExtent(G)}function K(G){const te=!_n(G)||G<0?0:G;v?.clickDistance(te)}return{update:k,destroy:M,setViewport:A,setViewportConstrained:_,getViewport:L,scaleTo:H,scaleBy:B,setScaleExtent:q,setTranslateExtent:Z,syncViewport:D,setClickDistance:K}}var cs;(function(e){e.Line="line",e.Handle="handle"})(cs||(cs={}));function w8({width:e,prevWidth:r,height:o,prevHeight:a,affectsX:l,affectsY:u}){const d=e-r,f=o-a,h=[d>0?1:d<0?-1:0,f>0?1:f<0?-1:0];return d&&l&&(h[0]=h[0]*-1),f&&u&&(h[1]=h[1]*-1),h}function N8(e){const r=e.includes("right")||e.includes("left"),o=e.includes("bottom")||e.includes("top"),a=e.includes("left"),l=e.includes("top");return{isHorizontal:r,isVertical:o,affectsX:a,affectsY:l}}function oo(e,r){return Math.max(0,r-e)}function ao(e,r){return Math.max(0,e-r)}function Yc(e,r,o){return Math.max(0,r-e,e-o)}function Zy(e,r){return e?!r:r}function S8(e,r,o,a,l,u,d,f){let{affectsX:h,affectsY:p}=r;const{isHorizontal:g,isVertical:y}=r,v=g&&y,{xSnapped:b,ySnapped:S}=o,{minWidth:w,maxWidth:j,minHeight:k,maxHeight:M}=a,{x:_,y:A,width:D,height:L,aspectRatio:H}=e;let B=Math.floor(g?b-e.pointerX:0),q=Math.floor(y?S-e.pointerY:0);const Z=D+(h?-B:B),K=L+(p?-q:q),G=-u[0]*D,te=-u[1]*L;let I=Yc(Z,w,j),V=Yc(K,k,M);if(d){let z=0,P=0;h&&B<0?z=oo(_+B+G,d[0][0]):!h&&B>0&&(z=ao(_+Z+G,d[1][0])),p&&q<0?P=oo(A+q+te,d[0][1]):!p&&q>0&&(P=ao(A+K+te,d[1][1])),I=Math.max(I,z),V=Math.max(V,P)}if(f){let z=0,P=0;h&&B>0?z=ao(_+B,f[0][0]):!h&&B<0&&(z=oo(_+Z,f[1][0])),p&&q>0?P=ao(A+q,f[0][1]):!p&&q<0&&(P=oo(A+K,f[1][1])),I=Math.max(I,z),V=Math.max(V,P)}if(l){if(g){const z=Yc(Z/H,k,M)*H;if(I=Math.max(I,z),d){let P=0;!h&&!p||h&&!p&&v?P=ao(A+te+Z/H,d[1][1])*H:P=oo(A+te+(h?B:-B)/H,d[0][1])*H,I=Math.max(I,P)}if(f){let P=0;!h&&!p||h&&!p&&v?P=oo(A+Z/H,f[1][1])*H:P=ao(A+(h?B:-B)/H,f[0][1])*H,I=Math.max(I,P)}}if(y){const z=Yc(K*H,w,j)/H;if(V=Math.max(V,z),d){let P=0;!h&&!p||p&&!h&&v?P=ao(_+K*H+G,d[1][0])/H:P=oo(_+(p?q:-q)*H+G,d[0][0])/H,V=Math.max(V,P)}if(f){let P=0;!h&&!p||p&&!h&&v?P=oo(_+K*H,f[1][0])/H:P=ao(_+(p?q:-q)*H,f[0][0])/H,V=Math.max(V,P)}}}q=q+(q<0?V:-V),B=B+(B<0?I:-I),l&&(v?Z>K*H?q=(Zy(h,p)?-B:B)/H:B=(Zy(h,p)?-q:q)*H:g?(q=B/H,p=h):(B=q*H,h=p));const E=h?_+B:_,O=p?A+q:A;return{width:D+(h?-B:B),height:L+(p?-q:q),x:u[0]*B*(h?-1:1)+E,y:u[1]*q*(p?-1:1)+O}}const ZN={width:0,height:0,x:0,y:0},E8={...ZN,pointerX:0,pointerY:0,aspectRatio:1};function _8(e){return[[0,0],[e.measured.width,e.measured.height]]}function j8(e,r,o){const a=r.position.x+e.position.x,l=r.position.y+e.position.y,u=e.measured.width??0,d=e.measured.height??0,f=o[0]*u,h=o[1]*d;return[[a-f,l-h],[a+u-f,l+d-h]]}function C8({domNode:e,nodeId:r,getStoreItems:o,onChange:a,onEnd:l}){const u=an(e);function d({controlPosition:h,boundaries:p,keepAspectRatio:g,resizeDirection:y,onResizeStart:v,onResize:b,onResizeEnd:S,shouldResize:w}){let j={...ZN},k={...E8};const M=N8(h);let _,A=null,D=[],L,H,B;const q=sN().on("start",Z=>{const{nodeLookup:K,transform:G,snapGrid:te,snapToGrid:I,nodeOrigin:V,paneDomNode:E}=o();if(_=K.get(r),!_)return;A=E?.getBoundingClientRect()??null;const{xSnapped:O,ySnapped:z}=Oi(Z.sourceEvent,{transform:G,snapGrid:te,snapToGrid:I,containerBounds:A});j={width:_.measured.width??0,height:_.measured.height??0,x:_.position.x??0,y:_.position.y??0},k={...j,pointerX:O,pointerY:z,aspectRatio:j.width/j.height},L=void 0,_.parentId&&(_.extent==="parent"||_.expandParent)&&(L=K.get(_.parentId),H=L&&_.extent==="parent"?_8(L):void 0),D=[],B=void 0;for(const[P,T]of K)if(T.parentId===r&&(D.push({id:P,position:{...T.position},extent:T.extent}),T.extent==="parent"||T.expandParent)){const U=j8(T,_,T.origin??V);B?B=[[Math.min(U[0][0],B[0][0]),Math.min(U[0][1],B[0][1])],[Math.max(U[1][0],B[1][0]),Math.max(U[1][1],B[1][1])]]:B=U}v?.(Z,{...j})}).on("drag",Z=>{const{transform:K,snapGrid:G,snapToGrid:te,nodeOrigin:I}=o(),V=Oi(Z.sourceEvent,{transform:K,snapGrid:G,snapToGrid:te,containerBounds:A}),E=[];if(!_)return;const{x:O,y:z,width:P,height:T}=j,U={},X=_.origin??I,{width:ee,height:ae,x:me,y:ue}=S8(k,M,V,p,g,X,H,B),Q=ee!==P,se=ae!==T,pe=me!==O&&Q,le=ue!==z&&se;if(!pe&&!le&&!Q&&!se)return;if((pe||le||X[0]===1||X[1]===1)&&(U.x=pe?me:j.x,U.y=le?ue:j.y,j.x=U.x,j.y=U.y,D.length>0)){const ge=me-O,Be=ue-z;for(const at of D)at.position={x:at.position.x-ge+X[0]*(ee-P),y:at.position.y-Be+X[1]*(ae-T)},E.push(at)}if((Q||se)&&(U.width=Q&&(!y||y==="horizontal")?ee:j.width,U.height=se&&(!y||y==="vertical")?ae:j.height,j.width=U.width,j.height=U.height),L&&_.expandParent){const ge=X[0]*(U.width??0);U.x&&U.x<ge&&(j.x=ge,k.x=k.x-(U.x-ge));const Be=X[1]*(U.height??0);U.y&&U.y<Be&&(j.y=Be,k.y=k.y-(U.y-Be))}const de=w8({width:j.width,prevWidth:P,height:j.height,prevHeight:T,affectsX:M.affectsX,affectsY:M.affectsY}),he={...j,direction:de};w?.(Z,he)!==!1&&(b?.(Z,he),a(U,E))}).on("end",Z=>{S?.(Z,{...j}),l?.({...j})});u.call(q)}function f(){u.on(".drag",null)}return{update:d,destroy:f}}var Jm={exports:{}},eh={},th={exports:{}},nh={};/**
523
- * @license React
524
- * use-sync-external-store-shim.production.js
525
- *
526
- * Copyright (c) Meta Platforms, Inc. and affiliates.
527
- *
528
- * This source code is licensed under the MIT license found in the
529
- * LICENSE file in the root directory of this source tree.
530
- */var Ky;function k8(){if(Ky)return nh;Ky=1;var e=Wi();function r(y,v){return y===v&&(y!==0||1/y===1/v)||y!==y&&v!==v}var o=typeof Object.is=="function"?Object.is:r,a=e.useState,l=e.useEffect,u=e.useLayoutEffect,d=e.useDebugValue;function f(y,v){var b=v(),S=a({inst:{value:b,getSnapshot:v}}),w=S[0].inst,j=S[1];return u(function(){w.value=b,w.getSnapshot=v,h(w)&&j({inst:w})},[y,b,v]),l(function(){return h(w)&&j({inst:w}),y(function(){h(w)&&j({inst:w})})},[y]),d(b),b}function h(y){var v=y.getSnapshot;y=y.value;try{var b=v();return!o(y,b)}catch{return!0}}function p(y,v){return v()}var g=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?p:f;return nh.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:g,nh}var Wy;function A8(){return Wy||(Wy=1,th.exports=k8()),th.exports}/**
531
- * @license React
532
- * use-sync-external-store-shim/with-selector.production.js
533
- *
534
- * Copyright (c) Meta Platforms, Inc. and affiliates.
535
- *
536
- * This source code is licensed under the MIT license found in the
537
- * LICENSE file in the root directory of this source tree.
538
- */var Qy;function M8(){if(Qy)return eh;Qy=1;var e=Wi(),r=A8();function o(p,g){return p===g&&(p!==0||1/p===1/g)||p!==p&&g!==g}var a=typeof Object.is=="function"?Object.is:o,l=r.useSyncExternalStore,u=e.useRef,d=e.useEffect,f=e.useMemo,h=e.useDebugValue;return eh.useSyncExternalStoreWithSelector=function(p,g,y,v,b){var S=u(null);if(S.current===null){var w={hasValue:!1,value:null};S.current=w}else w=S.current;S=f(function(){function k(L){if(!M){if(M=!0,_=L,L=v(L),b!==void 0&&w.hasValue){var H=w.value;if(b(H,L))return A=H}return A=L}if(H=A,a(_,L))return H;var B=v(L);return b!==void 0&&b(H,B)?(_=L,H):(_=L,A=B)}var M=!1,_,A,D=y===void 0?null:y;return[function(){return k(g())},D===null?void 0:function(){return k(D())}]},[g,y,v,b]);var j=l(p,S[0],S[1]);return d(function(){w.hasValue=!0,w.value=j},[j]),h(j),j},eh}var Jy;function T8(){return Jy||(Jy=1,Jm.exports=M8()),Jm.exports}var R8=T8();const D8=qh(R8),O8={},eb=e=>{let r;const o=new Set,a=(g,y)=>{const v=typeof g=="function"?g(r):g;if(!Object.is(v,r)){const b=r;r=y??(typeof v!="object"||v===null)?v:Object.assign({},r,v),o.forEach(S=>S(r,b))}},l=()=>r,h={setState:a,getState:l,getInitialState:()=>p,subscribe:g=>(o.add(g),()=>o.delete(g)),destroy:()=>{(O8?"production":void 0)!=="production"&&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."),o.clear()}},p=r=e(a,l,h);return h},z8=e=>e?eb(e):eb,{useDebugValue:L8}=rn,{useSyncExternalStoreWithSelector:I8}=D8,H8=e=>e;function KN(e,r=H8,o){const a=I8(e.subscribe,e.getState,e.getServerState||e.getInitialState,r,o);return L8(a),a}const tb=(e,r)=>{const o=z8(e),a=(l,u=r)=>KN(o,l,u);return Object.assign(a,o),a},B8=(e,r)=>e?tb(e,r):tb;function dt(e,r){if(Object.is(e,r))return!0;if(typeof e!="object"||e===null||typeof r!="object"||r===null)return!1;if(e instanceof Map&&r instanceof Map){if(e.size!==r.size)return!1;for(const[a,l]of e)if(!Object.is(l,r.get(a)))return!1;return!0}if(e instanceof Set&&r instanceof Set){if(e.size!==r.size)return!1;for(const a of e)if(!r.has(a))return!1;return!0}const o=Object.keys(e);if(o.length!==Object.keys(r).length)return!1;for(const a of o)if(!Object.prototype.hasOwnProperty.call(r,a)||!Object.is(e[a],r[a]))return!1;return!0}const id=N.createContext(null),U8=id.Provider,WN=Xn.error001();function Xe(e,r){const o=N.useContext(id);if(o===null)throw new Error(WN);return KN(o,e,r)}function ct(){const e=N.useContext(id);if(e===null)throw new Error(WN);return N.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const nb={display:"none"},P8={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},QN="react-flow__node-desc",JN="react-flow__edge-desc",$8="react-flow__aria-live",V8=e=>e.ariaLiveMessage,q8=e=>e.ariaLabelConfig;function Y8({rfId:e}){const r=Xe(V8);return i.jsx("div",{id:`${$8}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:P8,children:r})}function G8({rfId:e,disableKeyboardA11y:r}){const o=Xe(q8);return i.jsxs(i.Fragment,{children:[i.jsx("div",{id:`${QN}-${e}`,style:nb,children:r?o["node.a11yDescription.default"]:o["node.a11yDescription.keyboardDisabled"]}),i.jsx("div",{id:`${JN}-${e}`,style:nb,children:o["edge.a11yDescription.default"]}),!r&&i.jsx(Y8,{rfId:e})]})}const ld=N.forwardRef(({position:e="top-left",children:r,className:o,style:a,...l},u)=>{const d=`${e}`.split("-");return i.jsx("div",{className:bt(["react-flow__panel",o,...d]),style:a,ref:u,...l,children:r})});ld.displayName="Panel";function X8({proOptions:e,position:r="bottom-right"}){return e?.hideAttribution?null:i.jsx(ld,{position:r,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:i.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const F8=e=>{const r=[],o=[];for(const[,a]of e.nodeLookup)a.selected&&r.push(a.internals.userNode);for(const[,a]of e.edgeLookup)a.selected&&o.push(a);return{selectedNodes:r,selectedEdges:o}},Gc=e=>e.id;function Z8(e,r){return dt(e.selectedNodes.map(Gc),r.selectedNodes.map(Gc))&&dt(e.selectedEdges.map(Gc),r.selectedEdges.map(Gc))}function K8({onSelectionChange:e}){const r=ct(),{selectedNodes:o,selectedEdges:a}=Xe(F8,Z8);return N.useEffect(()=>{const l={nodes:o,edges:a};e?.(l),r.getState().onSelectionChangeHandlers.forEach(u=>u(l))},[o,a,e]),null}const W8=e=>!!e.onSelectionChangeHandlers;function Q8({onSelectionChange:e}){const r=Xe(W8);return e||r?i.jsx(K8,{onSelectionChange:e}):null}const eS=[0,0],J8={x:0,y:0,zoom:1},e9=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","paneClickDistance","ariaLabelConfig"],rb=[...e9,"rfId"],t9=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges,setPaneClickDistance:e.setPaneClickDistance}),ob={translateExtent:Yi,nodeOrigin:eS,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1",paneClickDistance:0};function n9(e){const{setNodes:r,setEdges:o,setMinZoom:a,setMaxZoom:l,setTranslateExtent:u,setNodeExtent:d,reset:f,setDefaultNodesAndEdges:h,setPaneClickDistance:p}=Xe(t9,dt),g=ct();N.useEffect(()=>(h(e.defaultNodes,e.defaultEdges),()=>{y.current=ob,f()}),[]);const y=N.useRef(ob);return N.useEffect(()=>{for(const v of rb){const b=e[v],S=y.current[v];b!==S&&(typeof e[v]>"u"||(v==="nodes"?r(b):v==="edges"?o(b):v==="minZoom"?a(b):v==="maxZoom"?l(b):v==="translateExtent"?u(b):v==="nodeExtent"?d(b):v==="paneClickDistance"?p(b):v==="ariaLabelConfig"?g.setState({ariaLabelConfig:BO(b)}):v==="fitView"?g.setState({fitViewQueued:b}):v==="fitViewOptions"?g.setState({fitViewOptions:b}):g.setState({[v]:b})))}y.current=e},rb.map(v=>e[v])),null}function ab(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function r9(e){const[r,o]=N.useState(e==="system"?null:e);return N.useEffect(()=>{if(e!=="system"){o(e);return}const a=ab(),l=()=>o(a?.matches?"dark":"light");return l(),a?.addEventListener("change",l),()=>{a?.removeEventListener("change",l)}},[e]),r!==null?r:ab()?.matches?"dark":"light"}const sb=typeof document<"u"?document:null;function Ki(e=null,r={target:sb,actInsideInputWithModifier:!0}){const[o,a]=N.useState(!1),l=N.useRef(!1),u=N.useRef(new Set([])),[d,f]=N.useMemo(()=>{if(e!==null){const p=(Array.isArray(e)?e:[e]).filter(y=>typeof y=="string").map(y=>y.replace("+",`
539
- `).replace(`
540
-
541
- `,`
542
- +`).split(`
543
- `)),g=p.reduce((y,v)=>y.concat(...v),[]);return[p,g]}return[[],[]]},[e]);return N.useEffect(()=>{const h=r?.target??sb,p=r?.actInsideInputWithModifier??!0;if(e!==null){const g=b=>{if(l.current=b.ctrlKey||b.metaKey||b.shiftKey||b.altKey,(!l.current||l.current&&!p)&&ON(b))return!1;const w=lb(b.code,f);if(u.current.add(b[w]),ib(d,u.current,!1)){const j=b.composedPath?.()?.[0]||b.target,k=j?.nodeName==="BUTTON"||j?.nodeName==="A";r.preventDefault!==!1&&(l.current||!k)&&b.preventDefault(),a(!0)}},y=b=>{const S=lb(b.code,f);ib(d,u.current,!0)?(a(!1),u.current.clear()):u.current.delete(b[S]),b.key==="Meta"&&u.current.clear(),l.current=!1},v=()=>{u.current.clear(),a(!1)};return h?.addEventListener("keydown",g),h?.addEventListener("keyup",y),window.addEventListener("blur",v),window.addEventListener("contextmenu",v),()=>{h?.removeEventListener("keydown",g),h?.removeEventListener("keyup",y),window.removeEventListener("blur",v),window.removeEventListener("contextmenu",v)}}},[e,a]),o}function ib(e,r,o){return e.filter(a=>o||a.length===r.size).some(a=>a.every(l=>r.has(l)))}function lb(e,r){return r.includes(e)?"code":"key"}const o9=()=>{const e=ct();return N.useMemo(()=>({zoomIn:r=>{const{panZoom:o}=e.getState();return o?o.scaleBy(1.2,{duration:r?.duration}):Promise.resolve(!1)},zoomOut:r=>{const{panZoom:o}=e.getState();return o?o.scaleBy(1/1.2,{duration:r?.duration}):Promise.resolve(!1)},zoomTo:(r,o)=>{const{panZoom:a}=e.getState();return a?a.scaleTo(r,{duration:o?.duration}):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(r,o)=>{const{transform:[a,l,u],panZoom:d}=e.getState();return d?(await d.setViewport({x:r.x??a,y:r.y??l,zoom:r.zoom??u},o),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[r,o,a]=e.getState().transform;return{x:r,y:o,zoom:a}},setCenter:async(r,o,a)=>e.getState().setCenter(r,o,a),fitBounds:async(r,o)=>{const{width:a,height:l,minZoom:u,maxZoom:d,panZoom:f}=e.getState(),h=Bp(r,a,l,u,d,o?.padding??.1);return f?(await f.setViewport(h,{duration:o?.duration,ease:o?.ease,interpolate:o?.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(r,o={})=>{const{transform:a,snapGrid:l,snapToGrid:u,domNode:d}=e.getState();if(!d)return r;const{x:f,y:h}=d.getBoundingClientRect(),p={x:r.x-f,y:r.y-h},g=o.snapGrid??l,y=o.snapToGrid??u;return cl(p,a,y,g)},flowToScreenPosition:r=>{const{transform:o,domNode:a}=e.getState();if(!a)return r;const{x:l,y:u}=a.getBoundingClientRect(),d=ku(r,o);return{x:d.x+l,y:d.y+u}}}),[])};function tS(e,r){const o=[],a=new Map,l=[];for(const u of e)if(u.type==="add"){l.push(u);continue}else if(u.type==="remove"||u.type==="replace")a.set(u.id,[u]);else{const d=a.get(u.id);d?d.push(u):a.set(u.id,[u])}for(const u of r){const d=a.get(u.id);if(!d){o.push(u);continue}if(d[0].type==="remove")continue;if(d[0].type==="replace"){o.push({...d[0].item});continue}const f={...u};for(const h of d)a9(h,f);o.push(f)}return l.length&&l.forEach(u=>{u.index!==void 0?o.splice(u.index,0,{...u.item}):o.push({...u.item})}),o}function a9(e,r){switch(e.type){case"select":{r.selected=e.selected;break}case"position":{typeof e.position<"u"&&(r.position=e.position),typeof e.dragging<"u"&&(r.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(r.measured??={},r.measured.width=e.dimensions.width,r.measured.height=e.dimensions.height,e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(r.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(r.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(r.resizing=e.resizing);break}}}function nS(e,r){return tS(e,r)}function rS(e,r){return tS(e,r)}function Bo(e,r){return{id:e,type:"select",selected:r}}function Xa(e,r=new Set,o=!1){const a=[];for(const[l,u]of e){const d=r.has(l);!(u.selected===void 0&&!d)&&u.selected!==d&&(o&&(u.selected=d),a.push(Bo(u.id,d)))}return a}function cb({items:e=[],lookup:r}){const o=[],a=new Map(e.map(l=>[l.id,l]));for(const[l,u]of e.entries()){const d=r.get(u.id),f=d?.internals?.userNode??d;f!==void 0&&f!==u&&o.push({id:u.id,item:u,type:"replace"}),f===void 0&&o.push({item:u,type:"add",index:l})}for(const[l]of r)a.get(l)===void 0&&o.push({id:l,type:"remove"});return o}function ub(e){return{id:e.id,type:"remove"}}const db=e=>AO(e),s9=e=>jN(e);function oS(e){return N.forwardRef(e)}const i9=typeof window<"u"?N.useLayoutEffect:N.useEffect;function fb(e){const[r,o]=N.useState(BigInt(0)),[a]=N.useState(()=>l9(()=>o(l=>l+BigInt(1))));return i9(()=>{const l=a.get();l.length&&(e(l),a.reset())},[r]),a}function l9(e){let r=[];return{get:()=>r,reset:()=>{r=[]},push:o=>{r.push(o),e()}}}const aS=N.createContext(null);function c9({children:e}){const r=ct(),o=N.useCallback(f=>{const{nodes:h=[],setNodes:p,hasDefaultNodes:g,onNodesChange:y,nodeLookup:v,fitViewQueued:b}=r.getState();let S=h;for(const j of f)S=typeof j=="function"?j(S):j;const w=cb({items:S,lookup:v});g&&p(S),w.length>0?y?.(w):b&&window.requestAnimationFrame(()=>{const{fitViewQueued:j,nodes:k,setNodes:M}=r.getState();j&&M(k)})},[]),a=fb(o),l=N.useCallback(f=>{const{edges:h=[],setEdges:p,hasDefaultEdges:g,onEdgesChange:y,edgeLookup:v}=r.getState();let b=h;for(const S of f)b=typeof S=="function"?S(b):S;g?p(b):y&&y(cb({items:b,lookup:v}))},[]),u=fb(l),d=N.useMemo(()=>({nodeQueue:a,edgeQueue:u}),[]);return i.jsx(aS.Provider,{value:d,children:e})}function u9(){const e=N.useContext(aS);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const d9=e=>!!e.panZoom;function ul(){const e=o9(),r=ct(),o=u9(),a=Xe(d9),l=N.useMemo(()=>{const u=y=>r.getState().nodeLookup.get(y),d=y=>{o.nodeQueue.push(y)},f=y=>{o.edgeQueue.push(y)},h=y=>{const{nodeLookup:v,nodeOrigin:b}=r.getState(),S=db(y)?y:v.get(y.id),w=S.parentId?RN(S.position,S.measured,S.parentId,v,b):S.position,j={...S,position:w,width:S.measured?.width??S.width,height:S.measured?.height??S.height};return is(j)},p=(y,v,b={replace:!1})=>{d(S=>S.map(w=>{if(w.id===y){const j=typeof v=="function"?v(w):v;return b.replace&&db(j)?j:{...w,...j}}return w}))},g=(y,v,b={replace:!1})=>{f(S=>S.map(w=>{if(w.id===y){const j=typeof v=="function"?v(w):v;return b.replace&&s9(j)?j:{...w,...j}}return w}))};return{getNodes:()=>r.getState().nodes.map(y=>({...y})),getNode:y=>u(y)?.internals.userNode,getInternalNode:u,getEdges:()=>{const{edges:y=[]}=r.getState();return y.map(v=>({...v}))},getEdge:y=>r.getState().edgeLookup.get(y),setNodes:d,setEdges:f,addNodes:y=>{const v=Array.isArray(y)?y:[y];o.nodeQueue.push(b=>[...b,...v])},addEdges:y=>{const v=Array.isArray(y)?y:[y];o.edgeQueue.push(b=>[...b,...v])},toObject:()=>{const{nodes:y=[],edges:v=[],transform:b}=r.getState(),[S,w,j]=b;return{nodes:y.map(k=>({...k})),edges:v.map(k=>({...k})),viewport:{x:S,y:w,zoom:j}}},deleteElements:async({nodes:y=[],edges:v=[]})=>{const{nodes:b,edges:S,onNodesDelete:w,onEdgesDelete:j,triggerNodeChanges:k,triggerEdgeChanges:M,onDelete:_,onBeforeDelete:A}=r.getState(),{nodes:D,edges:L}=await OO({nodesToRemove:y,edgesToRemove:v,nodes:b,edges:S,onBeforeDelete:A}),H=L.length>0,B=D.length>0;if(H){const q=L.map(ub);j?.(L),M(q)}if(B){const q=D.map(ub);w?.(D),k(q)}return(B||H)&&_?.({nodes:D,edges:L}),{deletedNodes:D,deletedEdges:L}},getIntersectingNodes:(y,v=!0,b)=>{const S=Hy(y),w=S?y:h(y),j=b!==void 0;return w?(b||r.getState().nodes).filter(k=>{const M=r.getState().nodeLookup.get(k.id);if(M&&!S&&(k.id===y.id||!M.internals.positionAbsolute))return!1;const _=is(j?k:M),A=Xi(_,w);return v&&A>0||A>=_.width*_.height||A>=w.width*w.height}):[]},isNodeIntersecting:(y,v,b=!0)=>{const w=Hy(y)?y:h(y);if(!w)return!1;const j=Xi(w,v);return b&&j>0||j>=w.width*w.height},updateNode:p,updateNodeData:(y,v,b={replace:!1})=>{p(y,S=>{const w=typeof v=="function"?v(S):v;return b.replace?{...S,data:w}:{...S,data:{...S.data,...w}}},b)},updateEdge:g,updateEdgeData:(y,v,b={replace:!1})=>{g(y,S=>{const w=typeof v=="function"?v(S):v;return b.replace?{...S,data:w}:{...S,data:{...S.data,...w}}},b)},getNodesBounds:y=>{const{nodeLookup:v,nodeOrigin:b}=r.getState();return MO(y,{nodeLookup:v,nodeOrigin:b})},getHandleConnections:({type:y,id:v,nodeId:b})=>Array.from(r.getState().connectionLookup.get(`${b}-${y}${v?`-${v}`:""}`)?.values()??[]),getNodeConnections:({type:y,handleId:v,nodeId:b})=>Array.from(r.getState().connectionLookup.get(`${b}${y?v?`-${y}-${v}`:`-${y}`:""}`)?.values()??[]),fitView:async y=>{const v=r.getState().fitViewResolver??HO();return r.setState({fitViewQueued:!0,fitViewOptions:y,fitViewResolver:v}),o.nodeQueue.push(b=>[...b]),v.promise}}},[]);return N.useMemo(()=>({...l,...e,viewportInitialized:a}),[a])}const mb=e=>e.selected,f9=typeof window<"u"?window:void 0;function m9({deleteKeyCode:e,multiSelectionKeyCode:r}){const o=ct(),{deleteElements:a}=ul(),l=Ki(e,{actInsideInputWithModifier:!1}),u=Ki(r,{target:f9});N.useEffect(()=>{if(l){const{edges:d,nodes:f}=o.getState();a({nodes:f.filter(mb),edges:d.filter(mb)}),o.setState({nodesSelectionActive:!1})}},[l]),N.useEffect(()=>{o.setState({multiSelectionActive:u})},[u])}function h9(e){const r=ct();N.useEffect(()=>{const o=()=>{if(!e.current)return!1;const a=Up(e.current);(a.height===0||a.width===0)&&r.getState().onError?.("004",Xn.error004()),r.setState({width:a.width||500,height:a.height||500})};if(e.current){o(),window.addEventListener("resize",o);const a=new ResizeObserver(()=>o());return a.observe(e.current),()=>{window.removeEventListener("resize",o),a&&e.current&&a.unobserve(e.current)}}},[])}const cd={position:"absolute",width:"100%",height:"100%",top:0,left:0},p9=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib});function g9({onPaneContextMenu:e,zoomOnScroll:r=!0,zoomOnPinch:o=!0,panOnScroll:a=!1,panOnScrollSpeed:l=.5,panOnScrollMode:u=$o.Free,zoomOnDoubleClick:d=!0,panOnDrag:f=!0,defaultViewport:h,translateExtent:p,minZoom:g,maxZoom:y,zoomActivationKeyCode:v,preventScrolling:b=!0,children:S,noWheelClassName:w,noPanClassName:j,onViewportChange:k,isControlledViewport:M,paneClickDistance:_}){const A=ct(),D=N.useRef(null),{userSelectionActive:L,lib:H}=Xe(p9,dt),B=Ki(v),q=N.useRef();h9(D);const Z=N.useCallback(K=>{k?.({x:K[0],y:K[1],zoom:K[2]}),M||A.setState({transform:K})},[k,M]);return N.useEffect(()=>{if(D.current){q.current=b8({domNode:D.current,minZoom:g,maxZoom:y,translateExtent:p,viewport:h,paneClickDistance:_,onDraggingChange:I=>A.setState({paneDragging:I}),onPanZoomStart:(I,V)=>{const{onViewportChangeStart:E,onMoveStart:O}=A.getState();O?.(I,V),E?.(V)},onPanZoom:(I,V)=>{const{onViewportChange:E,onMove:O}=A.getState();O?.(I,V),E?.(V)},onPanZoomEnd:(I,V)=>{const{onViewportChangeEnd:E,onMoveEnd:O}=A.getState();O?.(I,V),E?.(V)}});const{x:K,y:G,zoom:te}=q.current.getViewport();return A.setState({panZoom:q.current,transform:[K,G,te],domNode:D.current.closest(".react-flow")}),()=>{q.current?.destroy()}}},[]),N.useEffect(()=>{q.current?.update({onPaneContextMenu:e,zoomOnScroll:r,zoomOnPinch:o,panOnScroll:a,panOnScrollSpeed:l,panOnScrollMode:u,zoomOnDoubleClick:d,panOnDrag:f,zoomActivationKeyPressed:B,preventScrolling:b,noPanClassName:j,userSelectionActive:L,noWheelClassName:w,lib:H,onTransformChange:Z})},[e,r,o,a,l,u,d,f,B,b,j,L,w,H,Z]),i.jsx("div",{className:"react-flow__renderer",ref:D,style:cd,children:S})}const x9=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function v9(){const{userSelectionActive:e,userSelectionRect:r}=Xe(x9,dt);return e&&r?i.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:r.width,height:r.height,transform:`translate(${r.x}px, ${r.y}px)`}}):null}const rh=(e,r)=>o=>{o.target===r.current&&e?.(o)},y9=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function b9({isSelecting:e,selectionKeyPressed:r,selectionMode:o=Gi.Full,panOnDrag:a,selectionOnDrag:l,onSelectionStart:u,onSelectionEnd:d,onPaneClick:f,onPaneContextMenu:h,onPaneScroll:p,onPaneMouseEnter:g,onPaneMouseMove:y,onPaneMouseLeave:v,children:b}){const S=ct(),{userSelectionActive:w,elementsSelectable:j,dragging:k,connectionInProgress:M}=Xe(y9,dt),_=j&&(e||w),A=N.useRef(null),D=N.useRef(),L=N.useRef(new Set),H=N.useRef(new Set),B=N.useRef(!1),q=N.useRef(!1),Z=O=>{if(B.current||M){B.current=!1;return}f?.(O),S.getState().resetSelectedElements(),S.setState({nodesSelectionActive:!1})},K=O=>{if(Array.isArray(a)&&a?.includes(2)){O.preventDefault();return}h?.(O)},G=p?O=>p(O):void 0,te=O=>{const{resetSelectedElements:z,domNode:P}=S.getState();if(D.current=P?.getBoundingClientRect(),!j||!e||O.button!==0||O.target!==A.current||!D.current)return;O.target?.setPointerCapture?.(O.pointerId),q.current=!0,B.current=!1;const{x:T,y:U}=$n(O.nativeEvent,D.current);z(),S.setState({userSelectionRect:{width:0,height:0,startX:T,startY:U,x:T,y:U}}),u?.(O)},I=O=>{const{userSelectionRect:z,transform:P,nodeLookup:T,edgeLookup:U,connectionLookup:X,triggerNodeChanges:ee,triggerEdgeChanges:ae,defaultEdgeOptions:me}=S.getState();if(!D.current||!z)return;B.current=!0;const{x:ue,y:Q}=$n(O.nativeEvent,D.current),{startX:se,startY:pe}=z,le={startX:se,startY:pe,x:ue<se?ue:se,y:Q<pe?Q:pe,width:Math.abs(ue-se),height:Math.abs(Q-pe)},de=L.current,he=H.current;L.current=new Set(Hp(T,le,P,o===Gi.Partial,!0).map(ge=>ge.id)),H.current=new Set;const xe=me?.selectable??!0;for(const ge of L.current){const Be=X.get(ge);if(Be)for(const{edgeId:at}of Be.values()){const re=U.get(at);re&&(re.selectable??xe)&&H.current.add(at)}}if(!By(de,L.current)){const ge=Xa(T,L.current,!0);ee(ge)}if(!By(he,H.current)){const ge=Xa(U,H.current);ae(ge)}S.setState({userSelectionRect:le,userSelectionActive:!0,nodesSelectionActive:!1})},V=O=>{if(O.button!==0||!q.current)return;O.target?.releasePointerCapture?.(O.pointerId);const{userSelectionRect:z}=S.getState();!w&&z&&O.target===A.current&&Z?.(O),S.setState({userSelectionActive:!1,userSelectionRect:null,nodesSelectionActive:L.current.size>0}),d?.(O),(r||l)&&(B.current=!1),q.current=!1},E=a===!0||Array.isArray(a)&&a.includes(0);return i.jsxs("div",{className:bt(["react-flow__pane",{draggable:E,dragging:k,selection:e}]),onClick:_?void 0:rh(Z,A),onContextMenu:rh(K,A),onWheel:rh(G,A),onPointerEnter:_?void 0:g,onPointerDown:_?te:y,onPointerMove:_?I:y,onPointerUp:_?V:void 0,onPointerLeave:v,ref:A,style:cd,children:[b,i.jsx(v9,{})]})}function Uh({id:e,store:r,unselect:o=!1,nodeRef:a}){const{addSelectedNodes:l,unselectNodesAndEdges:u,multiSelectionActive:d,nodeLookup:f,onError:h}=r.getState(),p=f.get(e);if(!p){h?.("012",Xn.error012(e));return}r.setState({nodesSelectionActive:!1}),p.selected?(o||p.selected&&d)&&(u({nodes:[p],edges:[]}),requestAnimationFrame(()=>a?.current?.blur())):l([e])}function sS({nodeRef:e,disabled:r=!1,noDragClassName:o,handleSelector:a,nodeId:l,isSelectable:u,nodeClickDistance:d}){const f=ct(),[h,p]=N.useState(!1),g=N.useRef();return N.useEffect(()=>{g.current=a8({getStoreItems:()=>f.getState(),onNodeMouseDown:y=>{Uh({id:y,store:f,nodeRef:e})},onDragStart:()=>{p(!0)},onDragStop:()=>{p(!1)}})},[]),N.useEffect(()=>{if(r)g.current?.destroy();else if(e.current)return g.current?.update({noDragClassName:o,handleSelector:a,domNode:e.current,isSelectable:u,nodeId:l,nodeClickDistance:d}),()=>{g.current?.destroy()}},[o,a,r,u,e,l]),h}const w9=e=>r=>r.selected&&(r.draggable||e&&typeof r.draggable>"u");function iS(){const e=ct();return N.useCallback(o=>{const{nodeExtent:a,snapToGrid:l,snapGrid:u,nodesDraggable:d,onError:f,updateNodePositions:h,nodeLookup:p,nodeOrigin:g}=e.getState(),y=new Map,v=w9(d),b=l?u[0]:5,S=l?u[1]:5,w=o.direction.x*b*o.factor,j=o.direction.y*S*o.factor;for(const[,k]of p){if(!v(k))continue;let M={x:k.internals.positionAbsolute.x+w,y:k.internals.positionAbsolute.y+j};l&&(M=ll(M,u));const{position:_,positionAbsolute:A}=CN({nodeId:k.id,nextPosition:M,nodeLookup:p,nodeExtent:a,nodeOrigin:g,onError:f});k.position=_,k.internals.positionAbsolute=A,y.set(k.id,k)}h(y)},[])}const Yp=N.createContext(null),N9=Yp.Provider;Yp.Consumer;const lS=()=>N.useContext(Yp),S9=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),E9=(e,r,o)=>a=>{const{connectionClickStartHandle:l,connectionMode:u,connection:d}=a,{fromHandle:f,toHandle:h,isValid:p}=d,g=h?.nodeId===e&&h?.id===r&&h?.type===o;return{connectingFrom:f?.nodeId===e&&f?.id===r&&f?.type===o,connectingTo:g,clickConnecting:l?.nodeId===e&&l?.id===r&&l?.type===o,isPossibleEndHandle:u===as.Strict?f?.type!==o:e!==f?.nodeId||r!==f?.id,connectionInProcess:!!f,clickConnectionInProcess:!!l,valid:g&&p}};function _9({type:e="source",position:r=Ce.Top,isValidConnection:o,isConnectable:a=!0,isConnectableStart:l=!0,isConnectableEnd:u=!0,id:d,onConnect:f,children:h,className:p,onMouseDown:g,onTouchStart:y,...v},b){const S=d||null,w=e==="target",j=ct(),k=lS(),{connectOnClick:M,noPanClassName:_,rfId:A}=Xe(S9,dt),{connectingFrom:D,connectingTo:L,clickConnecting:H,isPossibleEndHandle:B,connectionInProcess:q,clickConnectionInProcess:Z,valid:K}=Xe(E9(k,S,e),dt);k||j.getState().onError?.("010",Xn.error010());const G=V=>{const{defaultEdgeOptions:E,onConnect:O,hasDefaultEdges:z}=j.getState(),P={...E,...V};if(z){const{edges:T,setEdges:U}=j.getState();U(YO(P,T))}O?.(P),f?.(P)},te=V=>{if(!k)return;const E=zN(V.nativeEvent);if(l&&(E&&V.button===0||!E)){const O=j.getState();Bh.onPointerDown(V.nativeEvent,{handleDomNode:V.currentTarget,autoPanOnConnect:O.autoPanOnConnect,connectionMode:O.connectionMode,connectionRadius:O.connectionRadius,domNode:O.domNode,nodeLookup:O.nodeLookup,lib:O.lib,isTarget:w,handleId:S,nodeId:k,flowId:O.rfId,panBy:O.panBy,cancelConnection:O.cancelConnection,onConnectStart:O.onConnectStart,onConnectEnd:O.onConnectEnd,updateConnection:O.updateConnection,onConnect:G,isValidConnection:o||O.isValidConnection,getTransform:()=>j.getState().transform,getFromHandle:()=>j.getState().connection.fromHandle,autoPanSpeed:O.autoPanSpeed,dragThreshold:O.connectionDragThreshold})}E?g?.(V):y?.(V)},I=V=>{const{onClickConnectStart:E,onClickConnectEnd:O,connectionClickStartHandle:z,connectionMode:P,isValidConnection:T,lib:U,rfId:X,nodeLookup:ee,connection:ae}=j.getState();if(!k||!z&&!l)return;if(!z){E?.(V.nativeEvent,{nodeId:k,handleId:S,handleType:e}),j.setState({connectionClickStartHandle:{nodeId:k,type:e,id:S}});return}const me=DN(V.target),ue=o||T,{connection:Q,isValid:se}=Bh.isValid(V.nativeEvent,{handle:{nodeId:k,id:S,type:e},connectionMode:P,fromNodeId:z.nodeId,fromHandleId:z.id||null,fromType:z.type,isValidConnection:ue,flowId:X,doc:me,lib:U,nodeLookup:ee});se&&Q&&G(Q);const pe=structuredClone(ae);delete pe.inProgress,pe.toPosition=pe.toHandle?pe.toHandle.position:null,O?.(V,pe),j.setState({connectionClickStartHandle:null})};return i.jsx("div",{"data-handleid":S,"data-nodeid":k,"data-handlepos":r,"data-id":`${A}-${k}-${S}-${e}`,className:bt(["react-flow__handle",`react-flow__handle-${r}`,"nodrag",_,p,{source:!w,target:w,connectable:a,connectablestart:l,connectableend:u,clickconnecting:H,connectingfrom:D,connectingto:L,valid:K,connectionindicator:a&&(!q||B)&&(q||Z?u:l)}]),onMouseDown:te,onTouchStart:te,onClick:M?I:void 0,ref:b,...v,children:h})}const us=N.memo(oS(_9));function j9({data:e,isConnectable:r,sourcePosition:o=Ce.Bottom}){return i.jsxs(i.Fragment,{children:[e?.label,i.jsx(us,{type:"source",position:o,isConnectable:r})]})}function C9({data:e,isConnectable:r,targetPosition:o=Ce.Top,sourcePosition:a=Ce.Bottom}){return i.jsxs(i.Fragment,{children:[i.jsx(us,{type:"target",position:o,isConnectable:r}),e?.label,i.jsx(us,{type:"source",position:a,isConnectable:r})]})}function k9(){return null}function A9({data:e,isConnectable:r,targetPosition:o=Ce.Top}){return i.jsxs(i.Fragment,{children:[i.jsx(us,{type:"target",position:o,isConnectable:r}),e?.label]})}const Au={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},hb={input:j9,default:C9,output:A9,group:k9};function M9(e){return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??e.style?.width,height:e.height??e.initialHeight??e.style?.height}:{width:e.width??e.style?.width,height:e.height??e.style?.height}}const T9=e=>{const{width:r,height:o,x:a,y:l}=il(e.nodeLookup,{filter:u=>!!u.selected});return{width:_n(r)?r:null,height:_n(o)?o:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${a}px,${l}px)`}};function R9({onSelectionContextMenu:e,noPanClassName:r,disableKeyboardA11y:o}){const a=ct(),{width:l,height:u,transformString:d,userSelectionActive:f}=Xe(T9,dt),h=iS(),p=N.useRef(null);if(N.useEffect(()=>{o||p.current?.focus({preventScroll:!0})},[o]),sS({nodeRef:p}),f||!l||!u)return null;const g=e?v=>{const b=a.getState().nodes.filter(S=>S.selected);e(v,b)}:void 0,y=v=>{Object.prototype.hasOwnProperty.call(Au,v.key)&&(v.preventDefault(),h({direction:Au[v.key],factor:v.shiftKey?4:1}))};return i.jsx("div",{className:bt(["react-flow__nodesselection","react-flow__container",r]),style:{transform:d},children:i.jsx("div",{ref:p,className:"react-flow__nodesselection-rect",onContextMenu:g,tabIndex:o?void 0:-1,onKeyDown:o?void 0:y,style:{width:l,height:u}})})}const pb=typeof window<"u"?window:void 0,D9=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function cS({children:e,onPaneClick:r,onPaneMouseEnter:o,onPaneMouseMove:a,onPaneMouseLeave:l,onPaneContextMenu:u,onPaneScroll:d,paneClickDistance:f,deleteKeyCode:h,selectionKeyCode:p,selectionOnDrag:g,selectionMode:y,onSelectionStart:v,onSelectionEnd:b,multiSelectionKeyCode:S,panActivationKeyCode:w,zoomActivationKeyCode:j,elementsSelectable:k,zoomOnScroll:M,zoomOnPinch:_,panOnScroll:A,panOnScrollSpeed:D,panOnScrollMode:L,zoomOnDoubleClick:H,panOnDrag:B,defaultViewport:q,translateExtent:Z,minZoom:K,maxZoom:G,preventScrolling:te,onSelectionContextMenu:I,noWheelClassName:V,noPanClassName:E,disableKeyboardA11y:O,onViewportChange:z,isControlledViewport:P}){const{nodesSelectionActive:T,userSelectionActive:U}=Xe(D9),X=Ki(p,{target:pb}),ee=Ki(w,{target:pb}),ae=ee||B,me=ee||A,ue=g&&ae!==!0,Q=X||U||ue;return m9({deleteKeyCode:h,multiSelectionKeyCode:S}),i.jsx(g9,{onPaneContextMenu:u,elementsSelectable:k,zoomOnScroll:M,zoomOnPinch:_,panOnScroll:me,panOnScrollSpeed:D,panOnScrollMode:L,zoomOnDoubleClick:H,panOnDrag:!X&&ae,defaultViewport:q,translateExtent:Z,minZoom:K,maxZoom:G,zoomActivationKeyCode:j,preventScrolling:te,noWheelClassName:V,noPanClassName:E,onViewportChange:z,isControlledViewport:P,paneClickDistance:f,children:i.jsxs(b9,{onSelectionStart:v,onSelectionEnd:b,onPaneClick:r,onPaneMouseEnter:o,onPaneMouseMove:a,onPaneMouseLeave:l,onPaneContextMenu:u,onPaneScroll:d,panOnDrag:ae,isSelecting:!!Q,selectionMode:y,selectionKeyPressed:X,selectionOnDrag:ue,children:[e,T&&i.jsx(R9,{onSelectionContextMenu:I,noPanClassName:E,disableKeyboardA11y:O})]})})}cS.displayName="FlowRenderer";const O9=N.memo(cS),z9=e=>r=>e?Hp(r.nodeLookup,{x:0,y:0,width:r.width,height:r.height},r.transform,!0).map(o=>o.id):Array.from(r.nodeLookup.keys());function L9(e){return Xe(N.useCallback(z9(e),[e]),dt)}const I9=e=>e.updateNodeInternals;function H9(){const e=Xe(I9),[r]=N.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(o=>{const a=new Map;o.forEach(l=>{const u=l.target.getAttribute("data-id");a.set(u,{id:u,nodeElement:l.target,force:!0})}),e(a)}));return N.useEffect(()=>()=>{r?.disconnect()},[r]),r}function B9({node:e,nodeType:r,hasDimensions:o,resizeObserver:a}){const l=ct(),u=N.useRef(null),d=N.useRef(null),f=N.useRef(e.sourcePosition),h=N.useRef(e.targetPosition),p=N.useRef(r),g=o&&!!e.internals.handleBounds;return N.useEffect(()=>{u.current&&!e.hidden&&(!g||d.current!==u.current)&&(d.current&&a?.unobserve(d.current),a?.observe(u.current),d.current=u.current)},[g,e.hidden]),N.useEffect(()=>()=>{d.current&&(a?.unobserve(d.current),d.current=null)},[]),N.useEffect(()=>{if(u.current){const y=p.current!==r,v=f.current!==e.sourcePosition,b=h.current!==e.targetPosition;(y||v||b)&&(p.current=r,f.current=e.sourcePosition,h.current=e.targetPosition,l.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:u.current,force:!0}]])))}},[e.id,r,e.sourcePosition,e.targetPosition]),u}function U9({id:e,onClick:r,onMouseEnter:o,onMouseMove:a,onMouseLeave:l,onContextMenu:u,onDoubleClick:d,nodesDraggable:f,elementsSelectable:h,nodesConnectable:p,nodesFocusable:g,resizeObserver:y,noDragClassName:v,noPanClassName:b,disableKeyboardA11y:S,rfId:w,nodeTypes:j,nodeClickDistance:k,onError:M}){const{node:_,internals:A,isParent:D}=Xe(se=>{const pe=se.nodeLookup.get(e),le=se.parentLookup.has(e);return{node:pe,internals:pe.internals,isParent:le}},dt);let L=_.type||"default",H=j?.[L]||hb[L];H===void 0&&(M?.("003",Xn.error003(L)),L="default",H=j?.default||hb.default);const B=!!(_.draggable||f&&typeof _.draggable>"u"),q=!!(_.selectable||h&&typeof _.selectable>"u"),Z=!!(_.connectable||p&&typeof _.connectable>"u"),K=!!(_.focusable||g&&typeof _.focusable>"u"),G=ct(),te=TN(_),I=B9({node:_,nodeType:L,hasDimensions:te,resizeObserver:y}),V=sS({nodeRef:I,disabled:_.hidden||!B,noDragClassName:v,handleSelector:_.dragHandle,nodeId:e,isSelectable:q,nodeClickDistance:k}),E=iS();if(_.hidden)return null;const O=Ar(_),z=M9(_),P=q||B||r||o||a||l,T=o?se=>o(se,{...A.userNode}):void 0,U=a?se=>a(se,{...A.userNode}):void 0,X=l?se=>l(se,{...A.userNode}):void 0,ee=u?se=>u(se,{...A.userNode}):void 0,ae=d?se=>d(se,{...A.userNode}):void 0,me=se=>{const{selectNodesOnDrag:pe,nodeDragThreshold:le}=G.getState();q&&(!pe||!B||le>0)&&Uh({id:e,store:G,nodeRef:I}),r&&r(se,{...A.userNode})},ue=se=>{if(!(ON(se.nativeEvent)||S)){if(NN.includes(se.key)&&q){const pe=se.key==="Escape";Uh({id:e,store:G,unselect:pe,nodeRef:I})}else if(B&&_.selected&&Object.prototype.hasOwnProperty.call(Au,se.key)){se.preventDefault();const{ariaLabelConfig:pe}=G.getState();G.setState({ariaLiveMessage:pe["node.a11yDescription.ariaLiveMessage"]({direction:se.key.replace("Arrow","").toLowerCase(),x:~~A.positionAbsolute.x,y:~~A.positionAbsolute.y})}),E({direction:Au[se.key],factor:se.shiftKey?4:1})}}},Q=()=>{if(S||!I.current?.matches(":focus-visible"))return;const{transform:se,width:pe,height:le,autoPanOnNodeFocus:de,setCenter:he}=G.getState();if(!de)return;Hp(new Map([[e,_]]),{x:0,y:0,width:pe,height:le},se,!0).length>0||he(_.position.x+O.width/2,_.position.y+O.height/2,{zoom:se[2]})};return i.jsx("div",{className:bt(["react-flow__node",`react-flow__node-${L}`,{[b]:B},_.className,{selected:_.selected,selectable:q,parent:D,draggable:B,dragging:V}]),ref:I,style:{zIndex:A.z,transform:`translate(${A.positionAbsolute.x}px,${A.positionAbsolute.y}px)`,pointerEvents:P?"all":"none",visibility:te?"visible":"hidden",..._.style,...z},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:T,onMouseMove:U,onMouseLeave:X,onContextMenu:ee,onClick:me,onDoubleClick:ae,onKeyDown:K?ue:void 0,tabIndex:K?0:void 0,onFocus:K?Q:void 0,role:_.ariaRole??(K?"group":void 0),"aria-roledescription":"node","aria-describedby":S?void 0:`${QN}-${w}`,"aria-label":_.ariaLabel,..._.domAttributes,children:i.jsx(N9,{value:e,children:i.jsx(H,{id:e,data:_.data,type:L,positionAbsoluteX:A.positionAbsolute.x,positionAbsoluteY:A.positionAbsolute.y,selected:_.selected??!1,selectable:q,draggable:B,deletable:_.deletable??!0,isConnectable:Z,sourcePosition:_.sourcePosition,targetPosition:_.targetPosition,dragging:V,dragHandle:_.dragHandle,zIndex:A.z,parentId:_.parentId,...O})})})}const P9=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function uS(e){const{nodesDraggable:r,nodesConnectable:o,nodesFocusable:a,elementsSelectable:l,onError:u}=Xe(P9,dt),d=L9(e.onlyRenderVisibleElements),f=H9();return i.jsx("div",{className:"react-flow__nodes",style:cd,children:d.map(h=>i.jsx(U9,{id:h,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:f,nodesDraggable:r,nodesConnectable:o,nodesFocusable:a,elementsSelectable:l,nodeClickDistance:e.nodeClickDistance,onError:u},h))})}uS.displayName="NodeRenderer";const $9=N.memo(uS);function V9(e){return Xe(N.useCallback(o=>{if(!e)return o.edges.map(l=>l.id);const a=[];if(o.width&&o.height)for(const l of o.edges){const u=o.nodeLookup.get(l.source),d=o.nodeLookup.get(l.target);u&&d&&$O({sourceNode:u,targetNode:d,width:o.width,height:o.height,transform:o.transform})&&a.push(l.id)}return a},[e]),dt)}const q9=({color:e="none",strokeWidth:r=1})=>{const o={strokeWidth:r,...e&&{stroke:e}};return i.jsx("polyline",{className:"arrow",style:o,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},Y9=({color:e="none",strokeWidth:r=1})=>{const o={strokeWidth:r,...e&&{stroke:e,fill:e}};return i.jsx("polyline",{className:"arrowclosed",style:o,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},gb={[ju.Arrow]:q9,[ju.ArrowClosed]:Y9};function G9(e){const r=ct();return N.useMemo(()=>Object.prototype.hasOwnProperty.call(gb,e)?gb[e]:(r.getState().onError?.("009",Xn.error009(e)),null),[e])}const X9=({id:e,type:r,color:o,width:a=12.5,height:l=12.5,markerUnits:u="strokeWidth",strokeWidth:d,orient:f="auto-start-reverse"})=>{const h=G9(r);return h?i.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${a}`,markerHeight:`${l}`,viewBox:"-10 -10 20 20",markerUnits:u,orient:f,refX:"0",refY:"0",children:i.jsx(h,{color:o,strokeWidth:d})}):null},dS=({defaultColor:e,rfId:r})=>{const o=Xe(u=>u.edges),a=Xe(u=>u.defaultEdgeOptions),l=N.useMemo(()=>KO(o,{id:r,defaultColor:e,defaultMarkerStart:a?.markerStart,defaultMarkerEnd:a?.markerEnd}),[o,a,r,e]);return l.length?i.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:i.jsx("defs",{children:l.map(u=>i.jsx(X9,{id:u.id,type:u.type,color:u.color,width:u.width,height:u.height,markerUnits:u.markerUnits,strokeWidth:u.strokeWidth,orient:u.orient},u.id))})}):null};dS.displayName="MarkerDefinitions";var F9=N.memo(dS);function fS({x:e,y:r,label:o,labelStyle:a,labelShowBg:l=!0,labelBgStyle:u,labelBgPadding:d=[2,4],labelBgBorderRadius:f=2,children:h,className:p,...g}){const[y,v]=N.useState({x:1,y:0,width:0,height:0}),b=bt(["react-flow__edge-textwrapper",p]),S=N.useRef(null);return N.useEffect(()=>{if(S.current){const w=S.current.getBBox();v({x:w.x,y:w.y,width:w.width,height:w.height})}},[o]),o?i.jsxs("g",{transform:`translate(${e-y.width/2} ${r-y.height/2})`,className:b,visibility:y.width?"visible":"hidden",...g,children:[l&&i.jsx("rect",{width:y.width+2*d[0],x:-d[0],y:-d[1],height:y.height+2*d[1],className:"react-flow__edge-textbg",style:u,rx:f,ry:f}),i.jsx("text",{className:"react-flow__edge-text",y:y.height/2,dy:"0.3em",ref:S,style:a,children:o}),h]}):null}fS.displayName="EdgeText";const Z9=N.memo(fS);function ud({path:e,labelX:r,labelY:o,label:a,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:h,interactionWidth:p=20,...g}){return i.jsxs(i.Fragment,{children:[i.jsx("path",{...g,d:e,fill:"none",className:bt(["react-flow__edge-path",g.className])}),p?i.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:p,className:"react-flow__edge-interaction"}):null,a&&_n(r)&&_n(o)?i.jsx(Z9,{x:r,y:o,label:a,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:h}):null]})}function xb({pos:e,x1:r,y1:o,x2:a,y2:l}){return e===Ce.Left||e===Ce.Right?[.5*(r+a),o]:[r,.5*(o+l)]}function mS({sourceX:e,sourceY:r,sourcePosition:o=Ce.Bottom,targetX:a,targetY:l,targetPosition:u=Ce.Top}){const[d,f]=xb({pos:o,x1:e,y1:r,x2:a,y2:l}),[h,p]=xb({pos:u,x1:a,y1:l,x2:e,y2:r}),[g,y,v,b]=LN({sourceX:e,sourceY:r,targetX:a,targetY:l,sourceControlX:d,sourceControlY:f,targetControlX:h,targetControlY:p});return[`M${e},${r} C${d},${f} ${h},${p} ${a},${l}`,g,y,v,b]}function hS(e){return N.memo(({id:r,sourceX:o,sourceY:a,targetX:l,targetY:u,sourcePosition:d,targetPosition:f,label:h,labelStyle:p,labelShowBg:g,labelBgStyle:y,labelBgPadding:v,labelBgBorderRadius:b,style:S,markerEnd:w,markerStart:j,interactionWidth:k})=>{const[M,_,A]=mS({sourceX:o,sourceY:a,sourcePosition:d,targetX:l,targetY:u,targetPosition:f}),D=e.isInternal?void 0:r;return i.jsx(ud,{id:D,path:M,labelX:_,labelY:A,label:h,labelStyle:p,labelShowBg:g,labelBgStyle:y,labelBgPadding:v,labelBgBorderRadius:b,style:S,markerEnd:w,markerStart:j,interactionWidth:k})})}const K9=hS({isInternal:!1}),pS=hS({isInternal:!0});K9.displayName="SimpleBezierEdge";pS.displayName="SimpleBezierEdgeInternal";function gS(e){return N.memo(({id:r,sourceX:o,sourceY:a,targetX:l,targetY:u,label:d,labelStyle:f,labelShowBg:h,labelBgStyle:p,labelBgPadding:g,labelBgBorderRadius:y,style:v,sourcePosition:b=Ce.Bottom,targetPosition:S=Ce.Top,markerEnd:w,markerStart:j,pathOptions:k,interactionWidth:M})=>{const[_,A,D]=Lh({sourceX:o,sourceY:a,sourcePosition:b,targetX:l,targetY:u,targetPosition:S,borderRadius:k?.borderRadius,offset:k?.offset,stepPosition:k?.stepPosition}),L=e.isInternal?void 0:r;return i.jsx(ud,{id:L,path:_,labelX:A,labelY:D,label:d,labelStyle:f,labelShowBg:h,labelBgStyle:p,labelBgPadding:g,labelBgBorderRadius:y,style:v,markerEnd:w,markerStart:j,interactionWidth:M})})}const xS=gS({isInternal:!1}),vS=gS({isInternal:!0});xS.displayName="SmoothStepEdge";vS.displayName="SmoothStepEdgeInternal";function yS(e){return N.memo(({id:r,...o})=>{const a=e.isInternal?void 0:r;return i.jsx(xS,{...o,id:a,pathOptions:N.useMemo(()=>({borderRadius:0,offset:o.pathOptions?.offset}),[o.pathOptions?.offset])})})}const W9=yS({isInternal:!1}),bS=yS({isInternal:!0});W9.displayName="StepEdge";bS.displayName="StepEdgeInternal";function wS(e){return N.memo(({id:r,sourceX:o,sourceY:a,targetX:l,targetY:u,label:d,labelStyle:f,labelShowBg:h,labelBgStyle:p,labelBgPadding:g,labelBgBorderRadius:y,style:v,markerEnd:b,markerStart:S,interactionWidth:w})=>{const[j,k,M]=BN({sourceX:o,sourceY:a,targetX:l,targetY:u}),_=e.isInternal?void 0:r;return i.jsx(ud,{id:_,path:j,labelX:k,labelY:M,label:d,labelStyle:f,labelShowBg:h,labelBgStyle:p,labelBgPadding:g,labelBgBorderRadius:y,style:v,markerEnd:b,markerStart:S,interactionWidth:w})})}const Q9=wS({isInternal:!1}),NS=wS({isInternal:!0});Q9.displayName="StraightEdge";NS.displayName="StraightEdgeInternal";function SS(e){return N.memo(({id:r,sourceX:o,sourceY:a,targetX:l,targetY:u,sourcePosition:d=Ce.Bottom,targetPosition:f=Ce.Top,label:h,labelStyle:p,labelShowBg:g,labelBgStyle:y,labelBgPadding:v,labelBgBorderRadius:b,style:S,markerEnd:w,markerStart:j,pathOptions:k,interactionWidth:M})=>{const[_,A,D]=IN({sourceX:o,sourceY:a,sourcePosition:d,targetX:l,targetY:u,targetPosition:f,curvature:k?.curvature}),L=e.isInternal?void 0:r;return i.jsx(ud,{id:L,path:_,labelX:A,labelY:D,label:h,labelStyle:p,labelShowBg:g,labelBgStyle:y,labelBgPadding:v,labelBgBorderRadius:b,style:S,markerEnd:w,markerStart:j,interactionWidth:M})})}const J9=SS({isInternal:!1}),ES=SS({isInternal:!0});J9.displayName="BezierEdge";ES.displayName="BezierEdgeInternal";const vb={default:ES,straight:NS,step:bS,smoothstep:vS,simplebezier:pS},yb={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},ez=(e,r,o)=>o===Ce.Left?e-r:o===Ce.Right?e+r:e,tz=(e,r,o)=>o===Ce.Top?e-r:o===Ce.Bottom?e+r:e,bb="react-flow__edgeupdater";function wb({position:e,centerX:r,centerY:o,radius:a=10,onMouseDown:l,onMouseEnter:u,onMouseOut:d,type:f}){return i.jsx("circle",{onMouseDown:l,onMouseEnter:u,onMouseOut:d,className:bt([bb,`${bb}-${f}`]),cx:ez(r,a,e),cy:tz(o,a,e),r:a,stroke:"transparent",fill:"transparent"})}function nz({isReconnectable:e,reconnectRadius:r,edge:o,sourceX:a,sourceY:l,targetX:u,targetY:d,sourcePosition:f,targetPosition:h,onReconnect:p,onReconnectStart:g,onReconnectEnd:y,setReconnecting:v,setUpdateHover:b}){const S=ct(),w=(A,D)=>{if(A.button!==0)return;const{autoPanOnConnect:L,domNode:H,isValidConnection:B,connectionMode:q,connectionRadius:Z,lib:K,onConnectStart:G,onConnectEnd:te,cancelConnection:I,nodeLookup:V,rfId:E,panBy:O,updateConnection:z}=S.getState(),P=D.type==="target",T=(ee,ae)=>{v(!1),y?.(ee,o,D.type,ae)},U=ee=>p?.(o,ee),X=(ee,ae)=>{v(!0),g?.(A,o,D.type),G?.(ee,ae)};Bh.onPointerDown(A.nativeEvent,{autoPanOnConnect:L,connectionMode:q,connectionRadius:Z,domNode:H,handleId:D.id,nodeId:D.nodeId,nodeLookup:V,isTarget:P,edgeUpdaterType:D.type,lib:K,flowId:E,cancelConnection:I,panBy:O,isValidConnection:B,onConnect:U,onConnectStart:X,onConnectEnd:te,onReconnectEnd:T,updateConnection:z,getTransform:()=>S.getState().transform,getFromHandle:()=>S.getState().connection.fromHandle,dragThreshold:S.getState().connectionDragThreshold,handleDomNode:A.currentTarget})},j=A=>w(A,{nodeId:o.target,id:o.targetHandle??null,type:"target"}),k=A=>w(A,{nodeId:o.source,id:o.sourceHandle??null,type:"source"}),M=()=>b(!0),_=()=>b(!1);return i.jsxs(i.Fragment,{children:[(e===!0||e==="source")&&i.jsx(wb,{position:f,centerX:a,centerY:l,radius:r,onMouseDown:j,onMouseEnter:M,onMouseOut:_,type:"source"}),(e===!0||e==="target")&&i.jsx(wb,{position:h,centerX:u,centerY:d,radius:r,onMouseDown:k,onMouseEnter:M,onMouseOut:_,type:"target"})]})}function rz({id:e,edgesFocusable:r,edgesReconnectable:o,elementsSelectable:a,onClick:l,onDoubleClick:u,onContextMenu:d,onMouseEnter:f,onMouseMove:h,onMouseLeave:p,reconnectRadius:g,onReconnect:y,onReconnectStart:v,onReconnectEnd:b,rfId:S,edgeTypes:w,noPanClassName:j,onError:k,disableKeyboardA11y:M}){let _=Xe(he=>he.edgeLookup.get(e));const A=Xe(he=>he.defaultEdgeOptions);_=A?{...A,..._}:_;let D=_.type||"default",L=w?.[D]||vb[D];L===void 0&&(k?.("011",Xn.error011(D)),D="default",L=w?.default||vb.default);const H=!!(_.focusable||r&&typeof _.focusable>"u"),B=typeof y<"u"&&(_.reconnectable||o&&typeof _.reconnectable>"u"),q=!!(_.selectable||a&&typeof _.selectable>"u"),Z=N.useRef(null),[K,G]=N.useState(!1),[te,I]=N.useState(!1),V=ct(),{zIndex:E,sourceX:O,sourceY:z,targetX:P,targetY:T,sourcePosition:U,targetPosition:X}=Xe(N.useCallback(he=>{const xe=he.nodeLookup.get(_.source),ge=he.nodeLookup.get(_.target);if(!xe||!ge)return{zIndex:_.zIndex,...yb};const Be=ZO({id:e,sourceNode:xe,targetNode:ge,sourceHandle:_.sourceHandle||null,targetHandle:_.targetHandle||null,connectionMode:he.connectionMode,onError:k});return{zIndex:PO({selected:_.selected,zIndex:_.zIndex,sourceNode:xe,targetNode:ge,elevateOnSelect:he.elevateEdgesOnSelect}),...Be||yb}},[_.source,_.target,_.sourceHandle,_.targetHandle,_.selected,_.zIndex]),dt),ee=N.useMemo(()=>_.markerStart?`url('#${Ih(_.markerStart,S)}')`:void 0,[_.markerStart,S]),ae=N.useMemo(()=>_.markerEnd?`url('#${Ih(_.markerEnd,S)}')`:void 0,[_.markerEnd,S]);if(_.hidden||O===null||z===null||P===null||T===null)return null;const me=he=>{const{addSelectedEdges:xe,unselectNodesAndEdges:ge,multiSelectionActive:Be}=V.getState();q&&(V.setState({nodesSelectionActive:!1}),_.selected&&Be?(ge({nodes:[],edges:[_]}),Z.current?.blur()):xe([e])),l&&l(he,_)},ue=u?he=>{u(he,{..._})}:void 0,Q=d?he=>{d(he,{..._})}:void 0,se=f?he=>{f(he,{..._})}:void 0,pe=h?he=>{h(he,{..._})}:void 0,le=p?he=>{p(he,{..._})}:void 0,de=he=>{if(!M&&NN.includes(he.key)&&q){const{unselectNodesAndEdges:xe,addSelectedEdges:ge}=V.getState();he.key==="Escape"?(Z.current?.blur(),xe({edges:[_]})):ge([e])}};return i.jsx("svg",{style:{zIndex:E},children:i.jsxs("g",{className:bt(["react-flow__edge",`react-flow__edge-${D}`,_.className,j,{selected:_.selected,animated:_.animated,inactive:!q&&!l,updating:K,selectable:q}]),onClick:me,onDoubleClick:ue,onContextMenu:Q,onMouseEnter:se,onMouseMove:pe,onMouseLeave:le,onKeyDown:H?de:void 0,tabIndex:H?0:void 0,role:_.ariaRole??(H?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":_.ariaLabel===null?void 0:_.ariaLabel||`Edge from ${_.source} to ${_.target}`,"aria-describedby":H?`${JN}-${S}`:void 0,ref:Z,..._.domAttributes,children:[!te&&i.jsx(L,{id:e,source:_.source,target:_.target,type:_.type,selected:_.selected,animated:_.animated,selectable:q,deletable:_.deletable??!0,label:_.label,labelStyle:_.labelStyle,labelShowBg:_.labelShowBg,labelBgStyle:_.labelBgStyle,labelBgPadding:_.labelBgPadding,labelBgBorderRadius:_.labelBgBorderRadius,sourceX:O,sourceY:z,targetX:P,targetY:T,sourcePosition:U,targetPosition:X,data:_.data,style:_.style,sourceHandleId:_.sourceHandle,targetHandleId:_.targetHandle,markerStart:ee,markerEnd:ae,pathOptions:"pathOptions"in _?_.pathOptions:void 0,interactionWidth:_.interactionWidth}),B&&i.jsx(nz,{edge:_,isReconnectable:B,reconnectRadius:g,onReconnect:y,onReconnectStart:v,onReconnectEnd:b,sourceX:O,sourceY:z,targetX:P,targetY:T,sourcePosition:U,targetPosition:X,setUpdateHover:G,setReconnecting:I})]})})}const oz=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function _S({defaultMarkerColor:e,onlyRenderVisibleElements:r,rfId:o,edgeTypes:a,noPanClassName:l,onReconnect:u,onEdgeContextMenu:d,onEdgeMouseEnter:f,onEdgeMouseMove:h,onEdgeMouseLeave:p,onEdgeClick:g,reconnectRadius:y,onEdgeDoubleClick:v,onReconnectStart:b,onReconnectEnd:S,disableKeyboardA11y:w}){const{edgesFocusable:j,edgesReconnectable:k,elementsSelectable:M,onError:_}=Xe(oz,dt),A=V9(r);return i.jsxs("div",{className:"react-flow__edges",children:[i.jsx(F9,{defaultColor:e,rfId:o}),A.map(D=>i.jsx(rz,{id:D,edgesFocusable:j,edgesReconnectable:k,elementsSelectable:M,noPanClassName:l,onReconnect:u,onContextMenu:d,onMouseEnter:f,onMouseMove:h,onMouseLeave:p,onClick:g,reconnectRadius:y,onDoubleClick:v,onReconnectStart:b,onReconnectEnd:S,rfId:o,onError:_,edgeTypes:a,disableKeyboardA11y:w},D))]})}_S.displayName="EdgeRenderer";const az=N.memo(_S),sz=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function iz({children:e}){const r=Xe(sz);return i.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:r},children:e})}function lz(e){const r=ul(),o=N.useRef(!1);N.useEffect(()=>{!o.current&&r.viewportInitialized&&e&&(setTimeout(()=>e(r),1),o.current=!0)},[e,r.viewportInitialized])}const cz=e=>e.panZoom?.syncViewport;function uz(e){const r=Xe(cz),o=ct();return N.useEffect(()=>{e&&(r?.(e),o.setState({transform:[e.x,e.y,e.zoom]}))},[e,r]),null}function dz(e){return e.connection.inProgress?{...e.connection,to:cl(e.connection.to,e.transform)}:{...e.connection}}function fz(e){return dz}function mz(e){const r=fz();return Xe(r,dt)}const hz=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function pz({containerStyle:e,style:r,type:o,component:a}){const{nodesConnectable:l,width:u,height:d,isValid:f,inProgress:h}=Xe(hz,dt);return!(u&&l&&h)?null:i.jsx("svg",{style:e,width:u,height:d,className:"react-flow__connectionline react-flow__container",children:i.jsx("g",{className:bt(["react-flow__connection",_N(f)]),children:i.jsx(jS,{style:r,type:o,CustomComponent:a,isValid:f})})})}const jS=({style:e,type:r=co.Bezier,CustomComponent:o,isValid:a})=>{const{inProgress:l,from:u,fromNode:d,fromHandle:f,fromPosition:h,to:p,toNode:g,toHandle:y,toPosition:v}=mz();if(!l)return;if(o)return i.jsx(o,{connectionLineType:r,connectionLineStyle:e,fromNode:d,fromHandle:f,fromX:u.x,fromY:u.y,toX:p.x,toY:p.y,fromPosition:h,toPosition:v,connectionStatus:_N(a),toNode:g,toHandle:y});let b="";const S={sourceX:u.x,sourceY:u.y,sourcePosition:h,targetX:p.x,targetY:p.y,targetPosition:v};switch(r){case co.Bezier:[b]=IN(S);break;case co.SimpleBezier:[b]=mS(S);break;case co.Step:[b]=Lh({...S,borderRadius:0});break;case co.SmoothStep:[b]=Lh(S);break;default:[b]=BN(S)}return i.jsx("path",{d:b,fill:"none",className:"react-flow__connection-path",style:e})};jS.displayName="ConnectionLine";const gz={};function Nb(e=gz){N.useRef(e),ct(),N.useEffect(()=>{},[e])}function xz(){ct(),N.useRef(!1),N.useEffect(()=>{},[])}function CS({nodeTypes:e,edgeTypes:r,onInit:o,onNodeClick:a,onEdgeClick:l,onNodeDoubleClick:u,onEdgeDoubleClick:d,onNodeMouseEnter:f,onNodeMouseMove:h,onNodeMouseLeave:p,onNodeContextMenu:g,onSelectionContextMenu:y,onSelectionStart:v,onSelectionEnd:b,connectionLineType:S,connectionLineStyle:w,connectionLineComponent:j,connectionLineContainerStyle:k,selectionKeyCode:M,selectionOnDrag:_,selectionMode:A,multiSelectionKeyCode:D,panActivationKeyCode:L,zoomActivationKeyCode:H,deleteKeyCode:B,onlyRenderVisibleElements:q,elementsSelectable:Z,defaultViewport:K,translateExtent:G,minZoom:te,maxZoom:I,preventScrolling:V,defaultMarkerColor:E,zoomOnScroll:O,zoomOnPinch:z,panOnScroll:P,panOnScrollSpeed:T,panOnScrollMode:U,zoomOnDoubleClick:X,panOnDrag:ee,onPaneClick:ae,onPaneMouseEnter:me,onPaneMouseMove:ue,onPaneMouseLeave:Q,onPaneScroll:se,onPaneContextMenu:pe,paneClickDistance:le,nodeClickDistance:de,onEdgeContextMenu:he,onEdgeMouseEnter:xe,onEdgeMouseMove:ge,onEdgeMouseLeave:Be,reconnectRadius:at,onReconnect:re,onReconnectStart:ve,onReconnectEnd:ke,noDragClassName:De,noWheelClassName:be,noPanClassName:Te,disableKeyboardA11y:Ye,nodeExtent:it,rfId:Tn,viewport:Fe,onViewportChange:Ue}){return Nb(e),Nb(r),xz(),lz(o),uz(Fe),i.jsx(O9,{onPaneClick:ae,onPaneMouseEnter:me,onPaneMouseMove:ue,onPaneMouseLeave:Q,onPaneContextMenu:pe,onPaneScroll:se,paneClickDistance:le,deleteKeyCode:B,selectionKeyCode:M,selectionOnDrag:_,selectionMode:A,onSelectionStart:v,onSelectionEnd:b,multiSelectionKeyCode:D,panActivationKeyCode:L,zoomActivationKeyCode:H,elementsSelectable:Z,zoomOnScroll:O,zoomOnPinch:z,zoomOnDoubleClick:X,panOnScroll:P,panOnScrollSpeed:T,panOnScrollMode:U,panOnDrag:ee,defaultViewport:K,translateExtent:G,minZoom:te,maxZoom:I,onSelectionContextMenu:y,preventScrolling:V,noDragClassName:De,noWheelClassName:be,noPanClassName:Te,disableKeyboardA11y:Ye,onViewportChange:Ue,isControlledViewport:!!Fe,children:i.jsxs(iz,{children:[i.jsx(az,{edgeTypes:r,onEdgeClick:l,onEdgeDoubleClick:d,onReconnect:re,onReconnectStart:ve,onReconnectEnd:ke,onlyRenderVisibleElements:q,onEdgeContextMenu:he,onEdgeMouseEnter:xe,onEdgeMouseMove:ge,onEdgeMouseLeave:Be,reconnectRadius:at,defaultMarkerColor:E,noPanClassName:Te,disableKeyboardA11y:Ye,rfId:Tn}),i.jsx(pz,{style:w,type:S,component:j,containerStyle:k}),i.jsx("div",{className:"react-flow__edgelabel-renderer"}),i.jsx($9,{nodeTypes:e,onNodeClick:a,onNodeDoubleClick:u,onNodeMouseEnter:f,onNodeMouseMove:h,onNodeMouseLeave:p,onNodeContextMenu:g,nodeClickDistance:de,onlyRenderVisibleElements:q,noPanClassName:Te,noDragClassName:De,disableKeyboardA11y:Ye,nodeExtent:it,rfId:Tn}),i.jsx("div",{className:"react-flow__viewport-portal"})]})})}CS.displayName="GraphView";const vz=N.memo(CS),Sb=({nodes:e,edges:r,defaultNodes:o,defaultEdges:a,width:l,height:u,fitView:d,fitViewOptions:f,minZoom:h=.5,maxZoom:p=2,nodeOrigin:g,nodeExtent:y}={})=>{const v=new Map,b=new Map,S=new Map,w=new Map,j=a??r??[],k=o??e??[],M=g??[0,0],_=y??Yi;PN(S,w,j);const A=Hh(k,v,b,{nodeOrigin:M,nodeExtent:_,elevateNodesOnSelect:!1});let D=[0,0,1];if(d&&l&&u){const L=il(v,{filter:Z=>!!((Z.width||Z.initialWidth)&&(Z.height||Z.initialHeight))}),{x:H,y:B,zoom:q}=Bp(L,l,u,h,p,f?.padding??.1);D=[H,B,q]}return{rfId:"1",width:0,height:0,transform:D,nodes:k,nodesInitialized:A,nodeLookup:v,parentLookup:b,edges:j,edgeLookup:w,connectionLookup:S,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:o!==void 0,hasDefaultEdges:a!==void 0,panZoom:null,minZoom:h,maxZoom:p,translateExtent:Yi,nodeExtent:_,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:as.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:M,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!1,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:d??!1,fitViewOptions:f,fitViewResolver:null,connection:{...EN},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:zO,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:SN}},yz=({nodes:e,edges:r,defaultNodes:o,defaultEdges:a,width:l,height:u,fitView:d,fitViewOptions:f,minZoom:h,maxZoom:p,nodeOrigin:g,nodeExtent:y})=>B8((v,b)=>{async function S(){const{nodeLookup:w,panZoom:j,fitViewOptions:k,fitViewResolver:M,width:_,height:A,minZoom:D,maxZoom:L}=b();j&&(await DO({nodes:w,width:_,height:A,panZoom:j,minZoom:D,maxZoom:L},k),M?.resolve(!0),v({fitViewResolver:null}))}return{...Sb({nodes:e,edges:r,width:l,height:u,fitView:d,fitViewOptions:f,minZoom:h,maxZoom:p,nodeOrigin:g,nodeExtent:y,defaultNodes:o,defaultEdges:a}),setNodes:w=>{const{nodeLookup:j,parentLookup:k,nodeOrigin:M,elevateNodesOnSelect:_,fitViewQueued:A}=b(),D=Hh(w,j,k,{nodeOrigin:M,nodeExtent:y,elevateNodesOnSelect:_,checkEquality:!0});A&&D?(S(),v({nodes:w,nodesInitialized:D,fitViewQueued:!1,fitViewOptions:void 0})):v({nodes:w,nodesInitialized:D})},setEdges:w=>{const{connectionLookup:j,edgeLookup:k}=b();PN(j,k,w),v({edges:w})},setDefaultNodesAndEdges:(w,j)=>{if(w){const{setNodes:k}=b();k(w),v({hasDefaultNodes:!0})}if(j){const{setEdges:k}=b();k(j),v({hasDefaultEdges:!0})}},updateNodeInternals:w=>{const{triggerNodeChanges:j,nodeLookup:k,parentLookup:M,domNode:_,nodeOrigin:A,nodeExtent:D,debug:L,fitViewQueued:H}=b(),{changes:B,updatedInternals:q}=t8(w,k,M,_,A,D);q&&(QO(k,M,{nodeOrigin:A,nodeExtent:D}),H?(S(),v({fitViewQueued:!1,fitViewOptions:void 0})):v({}),B?.length>0&&(L&&console.log("React Flow: trigger node changes",B),j?.(B)))},updateNodePositions:(w,j=!1)=>{const k=[],M=[],{nodeLookup:_,triggerNodeChanges:A}=b();for(const[D,L]of w){const H=_.get(D),B=!!(H?.expandParent&&H?.parentId&&L?.position),q={id:D,type:"position",position:B?{x:Math.max(0,L.position.x),y:Math.max(0,L.position.y)}:L.position,dragging:j};B&&H.parentId&&k.push({id:D,parentId:H.parentId,rect:{...L.internals.positionAbsolute,width:L.measured.width??0,height:L.measured.height??0}}),M.push(q)}if(k.length>0){const{parentLookup:D,nodeOrigin:L}=b(),H=qp(k,_,D,L);M.push(...H)}A(M)},triggerNodeChanges:w=>{const{onNodesChange:j,setNodes:k,nodes:M,hasDefaultNodes:_,debug:A}=b();if(w?.length){if(_){const D=nS(w,M);k(D)}A&&console.log("React Flow: trigger node changes",w),j?.(w)}},triggerEdgeChanges:w=>{const{onEdgesChange:j,setEdges:k,edges:M,hasDefaultEdges:_,debug:A}=b();if(w?.length){if(_){const D=rS(w,M);k(D)}A&&console.log("React Flow: trigger edge changes",w),j?.(w)}},addSelectedNodes:w=>{const{multiSelectionActive:j,edgeLookup:k,nodeLookup:M,triggerNodeChanges:_,triggerEdgeChanges:A}=b();if(j){const D=w.map(L=>Bo(L,!0));_(D);return}_(Xa(M,new Set([...w]),!0)),A(Xa(k))},addSelectedEdges:w=>{const{multiSelectionActive:j,edgeLookup:k,nodeLookup:M,triggerNodeChanges:_,triggerEdgeChanges:A}=b();if(j){const D=w.map(L=>Bo(L,!0));A(D);return}A(Xa(k,new Set([...w]))),_(Xa(M,new Set,!0))},unselectNodesAndEdges:({nodes:w,edges:j}={})=>{const{edges:k,nodes:M,nodeLookup:_,triggerNodeChanges:A,triggerEdgeChanges:D}=b(),L=w||M,H=j||k,B=L.map(Z=>{const K=_.get(Z.id);return K&&(K.selected=!1),Bo(Z.id,!1)}),q=H.map(Z=>Bo(Z.id,!1));A(B),D(q)},setMinZoom:w=>{const{panZoom:j,maxZoom:k}=b();j?.setScaleExtent([w,k]),v({minZoom:w})},setMaxZoom:w=>{const{panZoom:j,minZoom:k}=b();j?.setScaleExtent([k,w]),v({maxZoom:w})},setTranslateExtent:w=>{b().panZoom?.setTranslateExtent(w),v({translateExtent:w})},setPaneClickDistance:w=>{b().panZoom?.setClickDistance(w)},resetSelectedElements:()=>{const{edges:w,nodes:j,triggerNodeChanges:k,triggerEdgeChanges:M,elementsSelectable:_}=b();if(!_)return;const A=j.reduce((L,H)=>H.selected?[...L,Bo(H.id,!1)]:L,[]),D=w.reduce((L,H)=>H.selected?[...L,Bo(H.id,!1)]:L,[]);k(A),M(D)},setNodeExtent:w=>{const{nodes:j,nodeLookup:k,parentLookup:M,nodeOrigin:_,elevateNodesOnSelect:A,nodeExtent:D}=b();w[0][0]===D[0][0]&&w[0][1]===D[0][1]&&w[1][0]===D[1][0]&&w[1][1]===D[1][1]||(Hh(j,k,M,{nodeOrigin:_,nodeExtent:w,elevateNodesOnSelect:A,checkEquality:!1}),v({nodeExtent:w}))},panBy:w=>{const{transform:j,width:k,height:M,panZoom:_,translateExtent:A}=b();return n8({delta:w,panZoom:_,transform:j,translateExtent:A,width:k,height:M})},setCenter:async(w,j,k)=>{const{width:M,height:_,maxZoom:A,panZoom:D}=b();if(!D)return Promise.resolve(!1);const L=typeof k?.zoom<"u"?k.zoom:A;return await D.setViewport({x:M/2-w*L,y:_/2-j*L,zoom:L},{duration:k?.duration,ease:k?.ease,interpolate:k?.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{v({connection:{...EN}})},updateConnection:w=>{v({connection:w})},reset:()=>v({...Sb()})}},Object.is);function bz({initialNodes:e,initialEdges:r,defaultNodes:o,defaultEdges:a,initialWidth:l,initialHeight:u,initialMinZoom:d,initialMaxZoom:f,initialFitViewOptions:h,fitView:p,nodeOrigin:g,nodeExtent:y,children:v}){const[b]=N.useState(()=>yz({nodes:e,edges:r,defaultNodes:o,defaultEdges:a,width:l,height:u,fitView:p,minZoom:d,maxZoom:f,fitViewOptions:h,nodeOrigin:g,nodeExtent:y}));return i.jsx(U8,{value:b,children:i.jsx(c9,{children:v})})}function wz({children:e,nodes:r,edges:o,defaultNodes:a,defaultEdges:l,width:u,height:d,fitView:f,fitViewOptions:h,minZoom:p,maxZoom:g,nodeOrigin:y,nodeExtent:v}){return N.useContext(id)?i.jsx(i.Fragment,{children:e}):i.jsx(bz,{initialNodes:r,initialEdges:o,defaultNodes:a,defaultEdges:l,initialWidth:u,initialHeight:d,fitView:f,initialFitViewOptions:h,initialMinZoom:p,initialMaxZoom:g,nodeOrigin:y,nodeExtent:v,children:e})}const Nz={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function Sz({nodes:e,edges:r,defaultNodes:o,defaultEdges:a,className:l,nodeTypes:u,edgeTypes:d,onNodeClick:f,onEdgeClick:h,onInit:p,onMove:g,onMoveStart:y,onMoveEnd:v,onConnect:b,onConnectStart:S,onConnectEnd:w,onClickConnectStart:j,onClickConnectEnd:k,onNodeMouseEnter:M,onNodeMouseMove:_,onNodeMouseLeave:A,onNodeContextMenu:D,onNodeDoubleClick:L,onNodeDragStart:H,onNodeDrag:B,onNodeDragStop:q,onNodesDelete:Z,onEdgesDelete:K,onDelete:G,onSelectionChange:te,onSelectionDragStart:I,onSelectionDrag:V,onSelectionDragStop:E,onSelectionContextMenu:O,onSelectionStart:z,onSelectionEnd:P,onBeforeDelete:T,connectionMode:U,connectionLineType:X=co.Bezier,connectionLineStyle:ee,connectionLineComponent:ae,connectionLineContainerStyle:me,deleteKeyCode:ue="Backspace",selectionKeyCode:Q="Shift",selectionOnDrag:se=!1,selectionMode:pe=Gi.Full,panActivationKeyCode:le="Space",multiSelectionKeyCode:de=Fi()?"Meta":"Control",zoomActivationKeyCode:he=Fi()?"Meta":"Control",snapToGrid:xe,snapGrid:ge,onlyRenderVisibleElements:Be=!1,selectNodesOnDrag:at,nodesDraggable:re,autoPanOnNodeFocus:ve,nodesConnectable:ke,nodesFocusable:De,nodeOrigin:be=eS,edgesFocusable:Te,edgesReconnectable:Ye,elementsSelectable:it=!0,defaultViewport:Tn=J8,minZoom:Fe=.5,maxZoom:Ue=2,translateExtent:Qe=Yi,preventScrolling:ht=!0,nodeExtent:Ft,defaultMarkerColor:gs="#b1b1b7",zoomOnScroll:dd=!0,zoomOnPinch:na=!0,panOnScroll:ra=!1,panOnScrollSpeed:Wn=.5,panOnScrollMode:oa=$o.Free,zoomOnDoubleClick:xo=!0,panOnDrag:fd=!0,onPaneClick:dl,onPaneMouseEnter:fl,onPaneMouseMove:xs,onPaneMouseLeave:vo,onPaneScroll:md,onPaneContextMenu:ml,paneClickDistance:vs=0,nodeClickDistance:ys=0,children:bs,onReconnect:hl,onReconnectStart:hd,onReconnectEnd:Rn,onEdgeContextMenu:Et,onEdgeDoubleClick:Dt,onEdgeMouseEnter:Mr,onEdgeMouseMove:ws,onEdgeMouseLeave:pd,reconnectRadius:gd=10,onNodesChange:pl,onEdgesChange:yo,noDragClassName:Ns="nodrag",noWheelClassName:Tr="nowheel",noPanClassName:Qn="nopan",fitView:Rr,fitViewOptions:Jn,connectOnClick:xt,attributionPosition:gl,proOptions:xl,defaultEdgeOptions:er,elevateNodesOnSelect:Dr,elevateEdgesOnSelect:xd,disableKeyboardA11y:Ss=!1,autoPanOnConnect:vl,autoPanOnNodeDrag:vd,autoPanSpeed:aa,connectionRadius:sa,isValidConnection:vn,onError:Es,style:yl,id:tr,nodeDragThreshold:_s,connectionDragThreshold:js,viewport:yd,onViewportChange:bl,width:Bt,height:wl,colorMode:bd="light",debug:ia,onScroll:Cs,ariaLabelConfig:la,...wd},Ut){const bo=tr||"1",Nl=r9(bd),ks=N.useCallback(nr=>{nr.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Cs?.(nr)},[Cs]);return i.jsx("div",{"data-testid":"rf__wrapper",...wd,onScroll:ks,style:{...yl,...Nz},ref:Ut,className:bt(["react-flow",l,Nl]),id:tr,role:"application",children:i.jsxs(wz,{nodes:e,edges:r,width:Bt,height:wl,fitView:Rr,fitViewOptions:Jn,minZoom:Fe,maxZoom:Ue,nodeOrigin:be,nodeExtent:Ft,children:[i.jsx(vz,{onInit:p,onNodeClick:f,onEdgeClick:h,onNodeMouseEnter:M,onNodeMouseMove:_,onNodeMouseLeave:A,onNodeContextMenu:D,onNodeDoubleClick:L,nodeTypes:u,edgeTypes:d,connectionLineType:X,connectionLineStyle:ee,connectionLineComponent:ae,connectionLineContainerStyle:me,selectionKeyCode:Q,selectionOnDrag:se,selectionMode:pe,deleteKeyCode:ue,multiSelectionKeyCode:de,panActivationKeyCode:le,zoomActivationKeyCode:he,onlyRenderVisibleElements:Be,defaultViewport:Tn,translateExtent:Qe,minZoom:Fe,maxZoom:Ue,preventScrolling:ht,zoomOnScroll:dd,zoomOnPinch:na,zoomOnDoubleClick:xo,panOnScroll:ra,panOnScrollSpeed:Wn,panOnScrollMode:oa,panOnDrag:fd,onPaneClick:dl,onPaneMouseEnter:fl,onPaneMouseMove:xs,onPaneMouseLeave:vo,onPaneScroll:md,onPaneContextMenu:ml,paneClickDistance:vs,nodeClickDistance:ys,onSelectionContextMenu:O,onSelectionStart:z,onSelectionEnd:P,onReconnect:hl,onReconnectStart:hd,onReconnectEnd:Rn,onEdgeContextMenu:Et,onEdgeDoubleClick:Dt,onEdgeMouseEnter:Mr,onEdgeMouseMove:ws,onEdgeMouseLeave:pd,reconnectRadius:gd,defaultMarkerColor:gs,noDragClassName:Ns,noWheelClassName:Tr,noPanClassName:Qn,rfId:bo,disableKeyboardA11y:Ss,nodeExtent:Ft,viewport:yd,onViewportChange:bl}),i.jsx(n9,{nodes:e,edges:r,defaultNodes:o,defaultEdges:a,onConnect:b,onConnectStart:S,onConnectEnd:w,onClickConnectStart:j,onClickConnectEnd:k,nodesDraggable:re,autoPanOnNodeFocus:ve,nodesConnectable:ke,nodesFocusable:De,edgesFocusable:Te,edgesReconnectable:Ye,elementsSelectable:it,elevateNodesOnSelect:Dr,elevateEdgesOnSelect:xd,minZoom:Fe,maxZoom:Ue,nodeExtent:Ft,onNodesChange:pl,onEdgesChange:yo,snapToGrid:xe,snapGrid:ge,connectionMode:U,translateExtent:Qe,connectOnClick:xt,defaultEdgeOptions:er,fitView:Rr,fitViewOptions:Jn,onNodesDelete:Z,onEdgesDelete:K,onDelete:G,onNodeDragStart:H,onNodeDrag:B,onNodeDragStop:q,onSelectionDrag:V,onSelectionDragStart:I,onSelectionDragStop:E,onMove:g,onMoveStart:y,onMoveEnd:v,noPanClassName:Qn,nodeOrigin:be,rfId:bo,autoPanOnConnect:vl,autoPanOnNodeDrag:vd,autoPanSpeed:aa,onError:Es,connectionRadius:sa,isValidConnection:vn,selectNodesOnDrag:at,nodeDragThreshold:_s,connectionDragThreshold:js,onBeforeDelete:T,paneClickDistance:vs,debug:ia,ariaLabelConfig:la}),i.jsx(Q8,{onSelectionChange:te}),bs,i.jsx(X8,{proOptions:xl,position:gl}),i.jsx(G8,{rfId:bo,disableKeyboardA11y:Ss})]})})}var Ez=oS(Sz);function _z(e){const[r,o]=N.useState(e),a=N.useCallback(l=>o(u=>nS(l,u)),[]);return[r,o,a]}function jz(e){const[r,o]=N.useState(e),a=N.useCallback(l=>o(u=>rS(l,u)),[]);return[r,o,a]}function Cz({dimensions:e,lineWidth:r,variant:o,className:a}){return i.jsx("path",{strokeWidth:r,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:bt(["react-flow__background-pattern",o,a])})}function kz({radius:e,className:r}){return i.jsx("circle",{cx:e,cy:e,r:e,className:bt(["react-flow__background-pattern","dots",r])})}var br;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(br||(br={}));const Az={[br.Dots]:1,[br.Lines]:1,[br.Cross]:6},Mz=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function kS({id:e,variant:r=br.Dots,gap:o=20,size:a,lineWidth:l=1,offset:u=0,color:d,bgColor:f,style:h,className:p,patternClassName:g}){const y=N.useRef(null),{transform:v,patternId:b}=Xe(Mz,dt),S=a||Az[r],w=r===br.Dots,j=r===br.Cross,k=Array.isArray(o)?o:[o,o],M=[k[0]*v[2]||1,k[1]*v[2]||1],_=S*v[2],A=Array.isArray(u)?u:[u,u],D=j?[_,_]:M,L=[A[0]*v[2]||1+D[0]/2,A[1]*v[2]||1+D[1]/2],H=`${b}${e||""}`;return i.jsxs("svg",{className:bt(["react-flow__background",p]),style:{...h,...cd,"--xy-background-color-props":f,"--xy-background-pattern-color-props":d},ref:y,"data-testid":"rf__background",children:[i.jsx("pattern",{id:H,x:v[0]%M[0],y:v[1]%M[1],width:M[0],height:M[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${L[0]},-${L[1]})`,children:w?i.jsx(kz,{radius:_/2,className:g}):i.jsx(Cz,{dimensions:D,lineWidth:l,variant:r,className:g})}),i.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${H})`})]})}kS.displayName="Background";const Tz=N.memo(kS);function Rz(){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:i.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function Dz(){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:i.jsx("path",{d:"M0 0h32v4.2H0z"})})}function Oz(){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:i.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function zz(){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:i.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function Lz(){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:i.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function Xc({children:e,className:r,...o}){return i.jsx("button",{type:"button",className:bt(["react-flow__controls-button",r]),...o,children:e})}const Iz=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function AS({style:e,showZoom:r=!0,showFitView:o=!0,showInteractive:a=!0,fitViewOptions:l,onZoomIn:u,onZoomOut:d,onFitView:f,onInteractiveChange:h,className:p,children:g,position:y="bottom-left",orientation:v="vertical","aria-label":b}){const S=ct(),{isInteractive:w,minZoomReached:j,maxZoomReached:k,ariaLabelConfig:M}=Xe(Iz,dt),{zoomIn:_,zoomOut:A,fitView:D}=ul(),L=()=>{_(),u?.()},H=()=>{A(),d?.()},B=()=>{D(l),f?.()},q=()=>{S.setState({nodesDraggable:!w,nodesConnectable:!w,elementsSelectable:!w}),h?.(!w)},Z=v==="horizontal"?"horizontal":"vertical";return i.jsxs(ld,{className:bt(["react-flow__controls",Z,p]),position:y,style:e,"data-testid":"rf__controls","aria-label":b??M["controls.ariaLabel"],children:[r&&i.jsxs(i.Fragment,{children:[i.jsx(Xc,{onClick:L,className:"react-flow__controls-zoomin",title:M["controls.zoomIn.ariaLabel"],"aria-label":M["controls.zoomIn.ariaLabel"],disabled:k,children:i.jsx(Rz,{})}),i.jsx(Xc,{onClick:H,className:"react-flow__controls-zoomout",title:M["controls.zoomOut.ariaLabel"],"aria-label":M["controls.zoomOut.ariaLabel"],disabled:j,children:i.jsx(Dz,{})})]}),o&&i.jsx(Xc,{className:"react-flow__controls-fitview",onClick:B,title:M["controls.fitView.ariaLabel"],"aria-label":M["controls.fitView.ariaLabel"],children:i.jsx(Oz,{})}),a&&i.jsx(Xc,{className:"react-flow__controls-interactive",onClick:q,title:M["controls.interactive.ariaLabel"],"aria-label":M["controls.interactive.ariaLabel"],children:w?i.jsx(Lz,{}):i.jsx(zz,{})}),g]})}AS.displayName="Controls";const Hz=N.memo(AS);function Bz({id:e,x:r,y:o,width:a,height:l,style:u,color:d,strokeColor:f,strokeWidth:h,className:p,borderRadius:g,shapeRendering:y,selected:v,onClick:b}){const{background:S,backgroundColor:w}=u||{},j=d||S||w;return i.jsx("rect",{className:bt(["react-flow__minimap-node",{selected:v},p]),x:r,y:o,rx:g,ry:g,width:a,height:l,style:{fill:j,stroke:f,strokeWidth:h},shapeRendering:y,onClick:b?k=>b(k,e):void 0})}const Uz=N.memo(Bz),Pz=e=>e.nodes.map(r=>r.id),oh=e=>e instanceof Function?e:()=>e;function $z({nodeStrokeColor:e,nodeColor:r,nodeClassName:o="",nodeBorderRadius:a=5,nodeStrokeWidth:l,nodeComponent:u=Uz,onClick:d}){const f=Xe(Pz,dt),h=oh(r),p=oh(e),g=oh(o),y=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return i.jsx(i.Fragment,{children:f.map(v=>i.jsx(qz,{id:v,nodeColorFunc:h,nodeStrokeColorFunc:p,nodeClassNameFunc:g,nodeBorderRadius:a,nodeStrokeWidth:l,NodeComponent:u,onClick:d,shapeRendering:y},v))})}function Vz({id:e,nodeColorFunc:r,nodeStrokeColorFunc:o,nodeClassNameFunc:a,nodeBorderRadius:l,nodeStrokeWidth:u,shapeRendering:d,NodeComponent:f,onClick:h}){const{node:p,x:g,y,width:v,height:b}=Xe(S=>{const{internals:w}=S.nodeLookup.get(e),j=w.userNode,{x:k,y:M}=w.positionAbsolute,{width:_,height:A}=Ar(j);return{node:j,x:k,y:M,width:_,height:A}},dt);return!p||p.hidden||!TN(p)?null:i.jsx(f,{x:g,y,width:v,height:b,style:p.style,selected:!!p.selected,className:a(p),color:r(p),borderRadius:l,strokeColor:o(p),strokeWidth:u,shapeRendering:d,onClick:h,id:p.id})}const qz=N.memo(Vz);var Yz=N.memo($z);const Gz=200,Xz=150,Fz=e=>!e.hidden,Zz=e=>{const r={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:r,boundingRect:e.nodeLookup.size>0?MN(il(e.nodeLookup,{filter:Fz}),r):r,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},Kz="react-flow__minimap-desc";function MS({style:e,className:r,nodeStrokeColor:o,nodeColor:a,nodeClassName:l="",nodeBorderRadius:u=5,nodeStrokeWidth:d,nodeComponent:f,bgColor:h,maskColor:p,maskStrokeColor:g,maskStrokeWidth:y,position:v="bottom-right",onClick:b,onNodeClick:S,pannable:w=!1,zoomable:j=!1,ariaLabel:k,inversePan:M,zoomStep:_=1,offsetScale:A=5}){const D=ct(),L=N.useRef(null),{boundingRect:H,viewBB:B,rfId:q,panZoom:Z,translateExtent:K,flowWidth:G,flowHeight:te,ariaLabelConfig:I}=Xe(Zz,dt),V=e?.width??Gz,E=e?.height??Xz,O=H.width/V,z=H.height/E,P=Math.max(O,z),T=P*V,U=P*E,X=A*P,ee=H.x-(T-H.width)/2-X,ae=H.y-(U-H.height)/2-X,me=T+X*2,ue=U+X*2,Q=`${Kz}-${q}`,se=N.useRef(0),pe=N.useRef();se.current=P,N.useEffect(()=>{if(L.current&&Z)return pe.current=d8({domNode:L.current,panZoom:Z,getTransform:()=>D.getState().transform,getViewScale:()=>se.current}),()=>{pe.current?.destroy()}},[Z]),N.useEffect(()=>{pe.current?.update({translateExtent:K,width:G,height:te,inversePan:M,pannable:w,zoomStep:_,zoomable:j})},[w,j,M,_,K,G,te]);const le=b?xe=>{const[ge,Be]=pe.current?.pointer(xe)||[0,0];b(xe,{x:ge,y:Be})}:void 0,de=S?N.useCallback((xe,ge)=>{const Be=D.getState().nodeLookup.get(ge).internals.userNode;S(xe,Be)},[]):void 0,he=k??I["minimap.ariaLabel"];return i.jsx(ld,{position:v,style:{...e,"--xy-minimap-background-color-props":typeof h=="string"?h:void 0,"--xy-minimap-mask-background-color-props":typeof p=="string"?p:void 0,"--xy-minimap-mask-stroke-color-props":typeof g=="string"?g:void 0,"--xy-minimap-mask-stroke-width-props":typeof y=="number"?y*P:void 0,"--xy-minimap-node-background-color-props":typeof a=="string"?a:void 0,"--xy-minimap-node-stroke-color-props":typeof o=="string"?o:void 0,"--xy-minimap-node-stroke-width-props":typeof d=="number"?d:void 0},className:bt(["react-flow__minimap",r]),"data-testid":"rf__minimap",children:i.jsxs("svg",{width:V,height:E,viewBox:`${ee} ${ae} ${me} ${ue}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":Q,ref:L,onClick:le,children:[he&&i.jsx("title",{id:Q,children:he}),i.jsx(Yz,{onClick:de,nodeColor:a,nodeStrokeColor:o,nodeBorderRadius:u,nodeClassName:l,nodeStrokeWidth:d,nodeComponent:f}),i.jsx("path",{className:"react-flow__minimap-mask",d:`M${ee-X},${ae-X}h${me+X*2}v${ue+X*2}h${-me-X*2}z
544
- M${B.x},${B.y}h${B.width}v${B.height}h${-B.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}MS.displayName="MiniMap";const Wz=N.memo(MS),Qz=e=>r=>e?`${Math.max(1/r.transform[2],1)}`:void 0,Jz={[cs.Line]:"right",[cs.Handle]:"bottom-right"};function e7({nodeId:e,position:r,variant:o=cs.Handle,className:a,style:l=void 0,children:u,color:d,minWidth:f=10,minHeight:h=10,maxWidth:p=Number.MAX_VALUE,maxHeight:g=Number.MAX_VALUE,keepAspectRatio:y=!1,resizeDirection:v,autoScale:b=!0,shouldResize:S,onResizeStart:w,onResize:j,onResizeEnd:k}){const M=lS(),_=typeof e=="string"?e:M,A=ct(),D=N.useRef(null),L=o===cs.Handle,H=Xe(N.useCallback(Qz(L&&b),[L,b]),dt),B=N.useRef(null),q=r??Jz[o];N.useEffect(()=>{if(!(!D.current||!_))return B.current||(B.current=C8({domNode:D.current,nodeId:_,getStoreItems:()=>{const{nodeLookup:K,transform:G,snapGrid:te,snapToGrid:I,nodeOrigin:V,domNode:E}=A.getState();return{nodeLookup:K,transform:G,snapGrid:te,snapToGrid:I,nodeOrigin:V,paneDomNode:E}},onChange:(K,G)=>{const{triggerNodeChanges:te,nodeLookup:I,parentLookup:V,nodeOrigin:E}=A.getState(),O=[],z={x:K.x,y:K.y},P=I.get(_);if(P&&P.expandParent&&P.parentId){const T=P.origin??E,U=K.width??P.measured.width??0,X=K.height??P.measured.height??0,ee={id:P.id,parentId:P.parentId,rect:{width:U,height:X,...RN({x:K.x??P.position.x,y:K.y??P.position.y},{width:U,height:X},P.parentId,I,T)}},ae=qp([ee],I,V,E);O.push(...ae),z.x=K.x?Math.max(T[0]*U,K.x):void 0,z.y=K.y?Math.max(T[1]*X,K.y):void 0}if(z.x!==void 0&&z.y!==void 0){const T={id:_,type:"position",position:{...z}};O.push(T)}if(K.width!==void 0&&K.height!==void 0){const U={id:_,type:"dimensions",resizing:!0,setAttributes:v?v==="horizontal"?"width":"height":!0,dimensions:{width:K.width,height:K.height}};O.push(U)}for(const T of G){const U={...T,type:"position"};O.push(U)}te(O)},onEnd:({width:K,height:G})=>{const te={id:_,type:"dimensions",resizing:!1,dimensions:{width:K,height:G}};A.getState().triggerNodeChanges([te])}})),B.current.update({controlPosition:q,boundaries:{minWidth:f,minHeight:h,maxWidth:p,maxHeight:g},keepAspectRatio:y,resizeDirection:v,onResizeStart:w,onResize:j,onResizeEnd:k,shouldResize:S}),()=>{B.current?.destroy()}},[q,f,h,p,g,y,w,j,k,S]);const Z=q.split("-");return i.jsx("div",{className:bt(["react-flow__resize-control","nodrag",...Z,o,a]),ref:D,style:{...l,scale:H,...d&&{[L?"backgroundColor":"borderColor"]:d}},children:u})}N.memo(e7);const t7=e=>{switch(e){case"running":return{borderColor:"border-[#643FB2] dark:border-[#8B5CF6]",glow:"shadow-lg shadow-[#643FB2]/20",badgeColor:"bg-[#643FB2] dark:bg-[#8B5CF6]"};case"completed":return{borderColor:"border-green-500 dark:border-green-400",glow:"shadow-lg shadow-green-500/20",badgeColor:"bg-green-500 dark:bg-green-400"};case"failed":return{borderColor:"border-red-500 dark:border-red-400",glow:"shadow-lg shadow-red-500/20",badgeColor:"bg-red-500 dark:bg-red-400"};case"cancelled":return{borderColor:"border-orange-500 dark:border-orange-400",glow:"shadow-lg shadow-orange-500/20",badgeColor:"bg-orange-500 dark:bg-orange-400"};case"pending":default:return{borderColor:"border-gray-300 dark:border-gray-600",glow:"",badgeColor:"bg-gray-400 dark:bg-gray-500"}}},TS=N.memo(({data:e,selected:r})=>{const o=e,a=t7(o.state),l=o.inputData||o.outputData||o.error,u=o.state==="running",d=o.layoutDirection==="TB",f=d?Ce.Top:Ce.Left,h=d?Ce.Bottom:Ce.Right,p=()=>{const g=[];if(o.error&&typeof o.error=="string"&&g.push(i.jsxs("div",{className:"mb-2",children:[i.jsx("div",{className:"text-xs font-medium text-red-600 dark:text-red-400 mb-1",children:"Error:"}),i.jsx("div",{className:"text-xs text-red-600 dark:text-red-400 bg-red-50 dark:bg-red-950/20 p-2 rounded border border-red-200 dark:border-red-800",children:o.error})]},"error")),o.outputData)try{const y=typeof o.outputData=="string"?o.outputData:JSON.stringify(o.outputData,null,2);g.push(i.jsxs("div",{className:"mb-2",children:[i.jsx("div",{className:"text-xs font-medium text-green-600 dark:text-green-400 mb-1",children:"Output:"}),i.jsx("div",{className:"text-xs text-gray-700 dark:text-gray-300 bg-green-50 dark:bg-green-950/20 p-2 rounded border border-green-200 dark:border-green-800 max-h-20 overflow-auto",children:i.jsx("pre",{className:"whitespace-pre-wrap font-mono",children:y})})]},"output"))}catch{g.push(i.jsxs("div",{className:"mb-2",children:[i.jsx("div",{className:"text-xs font-medium text-green-600 dark:text-green-400 mb-1",children:"Output:"}),i.jsx("div",{className:"text-xs text-gray-600 dark:text-gray-400 bg-green-50 dark:bg-green-950/20 p-2 rounded border border-green-200 dark:border-green-800",children:"[Unable to display output data]"})]},"output"))}if(o.inputData)try{const y=typeof o.inputData=="string"?o.inputData:JSON.stringify(o.inputData,null,2);g.push(i.jsxs("div",{className:"mb-2",children:[i.jsx("div",{className:"text-xs font-medium text-blue-600 dark:text-blue-400 mb-1",children:"Input:"}),i.jsx("div",{className:"text-xs text-gray-700 dark:text-gray-300 bg-blue-50 dark:bg-blue-950/20 p-2 rounded border border-blue-200 dark:border-blue-800 max-h-20 overflow-auto",children:i.jsx("pre",{className:"whitespace-pre-wrap font-mono",children:y})})]},"input"))}catch{g.push(i.jsxs("div",{className:"mb-2",children:[i.jsx("div",{className:"text-xs font-medium text-blue-600 dark:text-blue-400 mb-1",children:"Input:"}),i.jsx("div",{className:"text-xs text-gray-600 dark:text-gray-400 bg-blue-50 dark:bg-blue-950/20 p-2 rounded border border-blue-200 dark:border-blue-800",children:"[Unable to display input data]"})]},"input"))}return g.length>0?g:null};return i.jsxs("div",{className:qe("group relative w-64 bg-card dark:bg-card rounded border-2 transition-all duration-200",a.borderColor,r?"ring-2 ring-blue-500 ring-offset-2":"",u?a.glow:"shadow-sm"),children:[!o.isStartNode&&i.jsx(us,{type:"target",position:f,className:"!w-2 !h-2 !rounded-full !border !border-gray-600 dark:!border-gray-500 transition-colors !min-w-0 !min-h-0",style:{backgroundColor:o.state==="running"?"#643FB2":o.state==="completed"?"#10b981":o.state==="failed"?"#ef4444":o.state==="cancelled"?"#f97316":"#4b5563"}}),!o.isEndNode&&i.jsx(us,{type:"source",position:h,className:"!w-2 !h-2 !rounded-full !border !border-gray-600 dark:!border-gray-500 transition-colors !min-w-0 !min-h-0",style:{backgroundColor:o.state==="running"?"#643FB2":o.state==="completed"?"#10b981":o.state==="failed"?"#ef4444":o.state==="cancelled"?"#f97316":"#4b5563"}}),i.jsxs("div",{className:"p-3",children:[i.jsxs("div",{className:"flex items-start gap-3",children:[i.jsxs("div",{className:"flex-shrink-0 relative",children:[i.jsx("div",{className:"w-10 h-10 rounded-lg bg-gray-900/90 dark:bg-gray-800/90 flex items-center justify-center",children:o.isStartNode?i.jsx(AA,{className:"w-5 h-5 text-[#643FB2] dark:text-[#8B5CF6]"}):i.jsx(Go,{className:"w-5 h-5 text-gray-300 dark:text-gray-400"})}),u&&i.jsx("div",{className:qe("absolute -top-1 -right-1 w-3 h-3 rounded-full animate-pulse",a.badgeColor)})]}),i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsx("h3",{className:"font-medium text-sm text-gray-900 dark:text-gray-100 truncate",children:o.name||o.executorId}),o.executorType&&i.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 truncate mt-0.5",children:o.executorType})]})]}),l&&i.jsx("div",{className:"mt-3",children:p()}),u&&i.jsx("div",{className:"absolute inset-0 rounded border-2 border-[#643FB2]/30 dark:border-[#8B5CF6]/30 animate-pulse pointer-events-none"})]})]})});TS.displayName="ExecutorNode";function n7(e,r,o="LR"){if(e.length===0)return e;if(e.length===1)return e.map(S=>({...S,position:{x:0,y:0}}));const a=new Map,l=new Map;e.forEach(S=>{a.set(S.id,[]),l.set(S.id,[])}),r.forEach(S=>{a.get(S.source)?.push(S.target),l.get(S.target)?.push(S.source)});const u=e.filter(S=>(l.get(S.id)||[]).length===0);u.length===0&&u.push(e[0]);const d=220,f=120,h=o==="LR"?350:280,p=o==="TB"?250:180,g=new Map,y=new Map,v=[],b=new Set;for(u.forEach(S=>{v.push({nodeId:S.id,level:0})});v.length>0;){const{nodeId:S,level:w}=v.shift();if(b.has(S))continue;b.add(S),y.has(w)||y.set(w,[]),y.get(w).push(S),(a.get(S)||[]).forEach(k=>{b.has(k)||v.push({nodeId:k,level:w+1})})}return e.forEach(S=>{if(!b.has(S.id)){const j=Math.max(...Array.from(y.keys()),-1)+1;y.has(j)||y.set(j,[]),y.get(j).push(S.id)}}),y.forEach((S,w)=>{const j=S.length;S.forEach((k,M)=>{let _,A;o==="LR"?(_=w*h,A=-((j-1)*p)/2+M*p):(A=w*p,_=-((j-1)*h)/2+M*h),g.set(k,{x:_,y:A,level:w})})}),e.map(S=>{const w=g.get(S.id)||{x:0,y:0};return{...S,position:{x:w.x-d/2,y:w.y-f/2}}})}function r7(e){return typeof e=="object"&&e!==null&&"id"in e&&"edge_groups"in e&&"executors"in e&&"start_executor_id"in e&&"max_iterations"in e&&typeof e.id=="string"&&Array.isArray(e.edge_groups)&&typeof e.executors=="object"&&typeof e.start_executor_id=="string"&&typeof e.max_iterations=="number"}function RS(e){return r7(e)?e:null}function Ph(e,r,o){if(!e)return console.warn("convertWorkflowDumpToNodes: workflowDump is undefined"),[];const a=RS(e);let l,u;return a?(l=Object.values(a.executors).map(f=>({id:f.id,type:f.type,name:f.name||f.id,description:f.description,config:f.config})),u=a.start_executor_id):(l=DS(e),u=e?.start_executor_id),!l||!Array.isArray(l)||l.length===0?(console.warn("No executors found in workflow dump. Available keys:",Object.keys(e)),[]):l.map(f=>({id:f.id,type:"executor",position:{x:0,y:0},data:{executorId:f.id,executorType:f.type,name:f.name||f.id,state:"pending",isStartNode:f.id===u,layoutDirection:o||"LR",onNodeClick:r}}))}function $h(e){if(!e)return console.warn("convertWorkflowDumpToEdges: workflowDump is undefined"),[];const r=RS(e);let o;return r?(o=[],r.edge_groups.forEach(l=>{l.edges.forEach(u=>{o.push({source:u.source_id,target:u.target_id,condition:u.condition_name})})})):o=OS(e),!o||!Array.isArray(o)||o.length===0?(console.warn("No connections found in workflow dump. Available keys:",Object.keys(e)),[]):o.map(l=>({id:`${l.source}-${l.target}`,source:l.source,target:l.target,type:"default",animated:!1,style:{stroke:"#6b7280",strokeWidth:2}}))}function DS(e){if(e.executors&&typeof e.executors=="object"&&!Array.isArray(e.executors)){const a=e.executors;return Object.entries(a).map(([l,u])=>({id:l,type:u.type_||u.type||"executor",name:u.name||l,description:u.description,config:u.config}))}const r=["executors","agents","steps","nodes"];for(const a of r)if(e[a]&&Array.isArray(e[a]))return e[a];if(e.config&&typeof e.config=="object")return DS(e.config);const o=[];return Object.entries(e).forEach(([a,l])=>{if(typeof l=="object"&&l!==null&&("type"in l||"type_"in l)){const u=l;o.push({id:a,type:u.type_||u.type||"executor",name:u.name||a,description:u.description,config:u.config})}}),o}function OS(e){if(e.edge_groups&&Array.isArray(e.edge_groups)){const o=[];return e.edge_groups.forEach(a=>{if(typeof a=="object"&&a!==null&&"edges"in a){const l=a.edges;Array.isArray(l)&&l.forEach(u=>{if(typeof u=="object"&&u!==null&&"source_id"in u&&"target_id"in u){const d=u;o.push({source:d.source_id,target:d.target_id,condition:d.condition_name||void 0})}})}}),o}const r=["connections","edges","transitions","links"];for(const o of r)if(e[o]&&Array.isArray(e[o]))return e[o];return e.config&&typeof e.config=="object"?OS(e.config):[]}function Vh(e,r,o="LR"){return n7(e,r,o)}function o7(e,r){const o={};let a=!1;return e.forEach(l=>{if(l.type==="response.workflow_event.complete"&&"data"in l&&l.data){const d=l.data,f=d.executor_id,h=d.event_type,p=d.data;let g="pending",y;h==="ExecutorInvokedEvent"?g="running":h==="ExecutorCompletedEvent"?g="completed":h?.includes("Error")||h?.includes("Failed")?(g="failed",y=typeof p=="string"?p:"Execution failed"):h?.includes("Cancel")?g="cancelled":h==="WorkflowCompletedEvent"||h==="WorkflowOutputEvent"?g="completed":h==="WorkflowStartedEvent"&&(a=!0),f&&(o[f]={nodeId:f,state:g,data:p,error:y,timestamp:new Date().toISOString()})}}),a&&r&&!o[r]&&(o[r]={nodeId:r,state:"running",data:void 0,error:void 0,timestamp:new Date().toISOString()}),o}function a7(e,r){return e.map(o=>{const a=r[o.id];return a?{...o,data:{...o.data,state:a.state,outputData:a.data,error:a.error,layoutDirection:o.data.layoutDirection}}:o})}function s7(e){const r={};return e.forEach(a=>{if(a.type==="response.workflow_event.complete"&&"data"in a&&a.data){const u=a.data,d=u.executor_id,f=u.event_type;d&&(f==="ExecutorInvokedEvent"||f==="ExecutorCompletedEvent")&&(r[d]={lastEvent:f,timestamp:new Date().toISOString()})}}),Object.entries(r).filter(([,a])=>a.lastEvent==="ExecutorInvokedEvent").map(([a])=>a)}function i7(e,r){const o=s7(r),a={};return r.forEach(l=>{if(l.type==="response.workflow_event.complete"&&"data"in l&&l.data){const d=l.data,f=d.executor_id,h=d.event_type;f&&h&&(a[f]||(a[f]={completed:!1,invoked:!1}),h==="ExecutorInvokedEvent"?a[f].invoked=!0:h==="ExecutorCompletedEvent"&&(a[f].completed=!0))}}),e.map(l=>{const u=a[l.source],d=a[l.target],f=o.includes(l.target);let h={...l.style},p=!1;return u?.completed&&f?(h={stroke:"#643FB2",strokeWidth:3,strokeDasharray:"5,5"},p=!0):u?.completed&&d?.completed?h={stroke:"#10b981",strokeWidth:2}:u?.completed&&d?.invoked?h={stroke:"#f59e0b",strokeWidth:2}:h={stroke:"#6b7280",strokeWidth:2},{...l,style:h,animated:p}})}const l7={executor:TS};function c7({workflowDump:e,onNodeSelect:r,viewOptions:o,onToggleViewOption:a,layoutDirection:l,onLayoutDirectionChange:u}){const{fitView:d,setViewport:f,setNodes:h}=ul(),p=()=>{f({x:0,y:0,zoom:1})},g=()=>{d({padding:.2})},y=()=>{if(!e)return;const v=Ph(e,r,l),b=$h(e),S=Vh(v,b,l);h(S)};return i.jsx("div",{className:"absolute top-4 right-4 z-10",children:i.jsxs(gp,{children:[i.jsx(xp,{asChild:!0,children:i.jsxs(Oe,{variant:"outline",size:"sm",className:"h-8 w-8 p-0 bg-white/90 backdrop-blur-sm border-gray-200 shadow-sm hover:bg-white dark:bg-gray-800/90 dark:border-gray-600 dark:hover:bg-gray-800",children:[i.jsx(wA,{className:"h-4 w-4"}),i.jsx("span",{className:"sr-only",children:"View options"})]})}),i.jsxs(vp,{align:"end",className:"w-56",children:[i.jsxs(Gt,{className:"flex items-center justify-between",onClick:()=>a?.("showMinimap"),children:[i.jsxs("div",{className:"flex items-center",children:[i.jsx(BA,{className:"mr-2 h-4 w-4"}),"Show Minimap"]}),i.jsx(ki,{checked:o.showMinimap,onChange:()=>{}})]}),i.jsxs(Gt,{className:"flex items-center justify-between",onClick:()=>a?.("showGrid"),children:[i.jsxs("div",{className:"flex items-center",children:[i.jsx(CA,{className:"mr-2 h-4 w-4"}),"Show Grid"]}),i.jsx(ki,{checked:o.showGrid,onChange:()=>{}})]}),i.jsxs(Gt,{className:"flex items-center justify-between",onClick:()=>a?.("animateRun"),children:[i.jsxs("div",{className:"flex items-center",children:[i.jsx(N1,{className:"mr-2 h-4 w-4"}),"Animate Run"]}),i.jsx(ki,{checked:o.animateRun,onChange:()=>{}})]}),i.jsx(pu,{}),i.jsxs(Gt,{className:"flex items-center justify-between",onClick:()=>{const v=l==="LR"?"TB":"LR";if(u?.(v),e){const b=Ph(e,r,v),S=$h(e),w=Vh(b,S,v);h(w)}},children:[i.jsxs("div",{className:"flex items-center",children:[i.jsx(Xk,{className:"mr-2 h-4 w-4"}),"Vertical Layout"]}),i.jsx(ki,{checked:l==="TB",onChange:()=>{}})]}),i.jsx(pu,{}),i.jsxs(Gt,{onClick:p,children:[i.jsx(hp,{className:"mr-2 h-4 w-4"}),"Reset Zoom"]}),i.jsxs(Gt,{onClick:g,children:[i.jsx($A,{className:"mr-2 h-4 w-4"}),"Fit to Screen"]}),i.jsxs(Gt,{onClick:y,children:[i.jsx(mM,{className:"mr-2 h-4 w-4"}),"Auto-arrange"]})]})]})})}function u7({nodes:e,nodeUpdates:r,isStreaming:o,animateRun:a}){const{fitView:l}=ul();return N.useEffect(()=>{if(a)if(o){const u=e.filter(d=>d.data.state==="running");if(u.length>0){const d=u[0];l({nodes:[d],duration:800,padding:.3,minZoom:.8,maxZoom:1.5})}}else e.length>0&&l({duration:1e3,padding:.2})},[r,o,a,e]),null}const d7=N.memo(function({workflowDump:r,events:o,isStreaming:a,onNodeSelect:l,className:u="",viewOptions:d={showMinimap:!1,showGrid:!0,animateRun:!0},onToggleViewOption:f,layoutDirection:h="LR",onLayoutDirectionChange:p}){const{initialNodes:g,initialEdges:y}=N.useMemo(()=>{if(!r)return{initialNodes:[],initialEdges:[]};const A=Ph(r,l,h),D=$h(r);return{initialNodes:A.length>0?Vh(A,D,h):A,initialEdges:D}},[r,l,h]),[v,b,S]=_z(g),[w,j,k]=jz(y),M=N.useMemo(()=>o7(o,r?.start_executor_id),[o,r?.start_executor_id]);N.useMemo(()=>{Object.keys(M).length>0?b(A=>a7(A,M)):o.length===0&&b(A=>A.map(D=>({...D,data:{...D.data,state:"pending",outputData:void 0,error:void 0}})))},[M,b,o.length]),N.useMemo(()=>{o.length>0?j(A=>i7(A,o)):j(A=>A.map(D=>({...D,animated:!1,style:{stroke:"#6b7280",strokeWidth:2}})))},[o,j]),N.useEffect(()=>{g.length>0&&(b(g),j(y))},[r]);const _=N.useCallback((A,D)=>{A.stopPropagation(),l?.(D.data.executorId,D.data)},[l]);return r?g.length===0?i.jsx("div",{className:`flex items-center justify-center h-full bg-gray-50 dark:bg-gray-900 rounded border border-gray-200 dark:border-gray-700 ${u}`,children:i.jsxs("div",{className:"text-center text-gray-500 dark:text-gray-400",children:[i.jsx("div",{className:"text-lg font-medium mb-2",children:"No Executors Found"}),i.jsx("div",{className:"text-sm",children:"Could not extract executors from workflow dump."}),i.jsxs("details",{className:"mt-2 text-xs",children:[i.jsx("summary",{className:"cursor-pointer",children:"Debug Info"}),i.jsx("pre",{className:"mt-1 p-2 bg-gray-100 dark:bg-gray-800 rounded text-left overflow-auto",children:JSON.stringify(r,null,2)})]})]})}):i.jsxs("div",{className:`h-full w-full ${u}`,children:[i.jsxs(Ez,{nodes:v,edges:w,onNodesChange:S,onEdgesChange:k,onNodeClick:_,nodeTypes:l7,fitView:!0,fitViewOptions:{padding:.2},minZoom:.1,maxZoom:1.5,defaultEdgeOptions:{type:"default",animated:!1,style:{stroke:"#6b7280",strokeWidth:2}},nodesDraggable:!a,nodesConnectable:!1,elementsSelectable:!0,proOptions:{hideAttribution:!0},children:[d.showGrid&&i.jsx(Tz,{variant:br.Dots,gap:20,size:1,color:"#e5e7eb",className:"dark:opacity-30"}),i.jsx(Hz,{position:"bottom-left",showInteractive:!1,style:{backgroundColor:"rgba(255, 255, 255, 0.9)",border:"1px solid #e5e7eb",borderRadius:"3px"},className:"dark:!bg-gray-800/90 dark:!border-gray-600"}),d.showMinimap&&i.jsx(Wz,{nodeColor:A=>{switch(A.data?.state){case"running":return"#643FB2";case"completed":return"#10b981";case"failed":return"#ef4444";case"cancelled":return"#f97316";default:return"#6b7280"}},maskColor:"rgba(0, 0, 0, 0.1)",position:"bottom-right",style:{backgroundColor:"rgba(255, 255, 255, 0.9)",border:"1px solid #e5e7eb",borderRadius:"8px"},className:"dark:!bg-gray-800/90 dark:!border-gray-600"}),i.jsx(u7,{nodes:v,nodeUpdates:M,isStreaming:a,animateRun:d.animateRun}),i.jsx(c7,{workflowDump:r,onNodeSelect:l,viewOptions:d,onToggleViewOption:f,layoutDirection:h,onLayoutDirectionChange:p})]}),i.jsx("style",{children:`
545
- .react-flow__edge-path {
546
- transition: stroke 0.3s ease, stroke-width 0.3s ease;
547
- }
548
- .react-flow__edge.animated .react-flow__edge-path {
549
- stroke-dasharray: 5 5;
550
- animation: dash 1s linear infinite;
551
- }
552
- @keyframes dash {
553
- 0% { stroke-dashoffset: 0; }
554
- 100% { stroke-dashoffset: -10; }
555
- }
556
-
557
- /* Dark theme styles for React Flow controls */
558
- .dark .react-flow__controls {
559
- background-color: rgba(31, 41, 55, 0.9) !important;
560
- border-color: rgb(75, 85, 99) !important;
561
- }
562
- .dark .react-flow__controls-button {
563
- background-color: rgba(31, 41, 55, 0.9) !important;
564
- border-color: rgb(75, 85, 99) !important;
565
- color: rgb(229, 231, 235) !important;
566
- }
567
- .dark .react-flow__controls-button:hover {
568
- background-color: rgba(55, 65, 81, 0.9) !important;
569
- color: rgb(255, 255, 255) !important;
570
- }
571
- .dark .react-flow__controls-button svg {
572
- fill: rgb(229, 231, 235) !important;
573
- }
574
- .dark .react-flow__controls-button:hover svg {
575
- fill: rgb(255, 255, 255) !important;
576
- }
577
- `})]}):i.jsx("div",{className:`flex items-center justify-center h-full bg-gray-50 dark:bg-gray-900 rounded border border-gray-200 dark:border-gray-700 ${u}`,children:i.jsxs("div",{className:"text-center text-gray-500 dark:text-gray-400",children:[i.jsx("div",{className:"text-lg font-medium mb-2",children:"No Workflow Data"}),i.jsx("div",{className:"text-sm",children:"Workflow dump is not available."})]})})});function f7(e,r){const[o,a]=N.useState(null),{executors:l,recentlyActive:u,isWorkflowRunning:d}=N.useMemo(()=>{const g={},y=[];let v=r;return e.forEach(b=>{if(b.type==="response.workflow_event.complete"&&"data"in b&&b.data){const S=b.data,w=S.executor_id;if(!w)return;g[w]||(g[w]={executorId:w,state:"pending",timestamp:new Date().toISOString()});const j=g[w],k=S.event_type;k==="ExecutorInvokedEvent"?(j.state="running",j.inputData=S.data,y.includes(w)||y.push(w)):k==="ExecutorCompletedEvent"?(j.state="completed",j.outputData=S.data):k?.includes("Error")||k?.includes("Failed")?(j.state="failed",j.error=typeof S.data=="string"?S.data:"Execution failed"):k?.includes("Cancel")&&(j.state="cancelled"),j.timestamp=new Date().toISOString()}}),{executors:g,recentlyActive:y.slice(-3),isWorkflowRunning:v}},[e,r]),f=N.useCallback(g=>{a(g)},[]),h=N.useCallback(g=>l[g]||null,[l]),p=N.useCallback(g=>e.filter(y=>y.type==="response.workflow_event.complete"&&"data"in y&&y.data?y.data.executor_id===g:!1),[e]);return{isWorkflowRunning:d,selectedExecutorId:o,recentlyActive:u,selectExecutor:f,getExecutorData:h,getExecutorEvents:p}}function Fc({title:e,icon:r,children:o,className:a=""}){return i.jsxs("div",{className:`border rounded-lg p-4 bg-card ${a}`,children:[i.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[r,i.jsx("h3",{className:"text-sm font-semibold text-foreground",children:e})]}),i.jsx("div",{className:"text-sm text-muted-foreground",children:o})]})}function m7({workflow:e,open:r,onOpenChange:o}){const a=e.source==="directory"?i.jsx(h1,{className:"h-4 w-4 text-muted-foreground"}):e.source==="in_memory"?i.jsx(gh,{className:"h-4 w-4 text-muted-foreground"}):i.jsx(p1,{className:"h-4 w-4 text-muted-foreground"}),l=e.source==="directory"?"Local":e.source==="in_memory"?"In-Memory":"Gallery";return i.jsx(Sr,{open:r,onOpenChange:o,children:i.jsxs(Er,{className:"max-w-4xl max-h-[90vh] flex flex-col",children:[i.jsxs(_r,{className:"px-6 pt-6 flex-shrink-0",children:[i.jsx(jr,{children:"Workflow Details"}),i.jsx(ho,{onClose:()=>o(!1)})]}),i.jsxs("div",{className:"px-6 pb-6 overflow-y-auto flex-1",children:[i.jsxs("div",{className:"mb-6",children:[i.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[i.jsx(Go,{className:"h-6 w-6 text-primary"}),i.jsx("h2",{className:"text-xl font-semibold text-foreground",children:e.name||e.id})]}),e.description&&i.jsx("p",{className:"text-muted-foreground",children:e.description})]}),i.jsx("div",{className:"h-px bg-border mb-6"}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4",children:[i.jsx(Fc,{title:"Start Executor",icon:i.jsx(uA,{className:"h-4 w-4 text-muted-foreground"}),children:i.jsx("div",{className:"font-mono text-foreground",children:e.start_executor_id})}),i.jsx(Fc,{title:"Source",icon:a,children:i.jsxs("div",{className:"space-y-1",children:[i.jsx("div",{className:"text-foreground",children:l}),e.module_path&&i.jsx("div",{className:"font-mono text-xs break-all",children:e.module_path})]})}),i.jsx(Fc,{title:"Environment",icon:e.has_env?i.jsx(Vu,{className:"h-4 w-4 text-orange-500"}):i.jsx(fu,{className:"h-4 w-4 text-green-500"}),className:"md:col-span-2",children:i.jsx("div",{className:e.has_env?"text-orange-600 dark:text-orange-400":"text-green-600 dark:text-green-400",children:e.has_env?"Requires environment variables":"No environment variables required"})})]}),i.jsx(Fc,{title:`Executors (${e.executors.length})`,icon:i.jsx(xh,{className:"h-4 w-4 text-muted-foreground"}),children:e.executors.length>0?i.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-2",children:e.executors.map((u,d)=>i.jsx("div",{className:"font-mono text-xs text-foreground bg-muted px-2 py-1 rounded",children:u},d))}):i.jsx("div",{className:"text-muted-foreground",children:"No executors configured"})})]})]})})}function h7({inputSchema:e,onRun:r,isSubmitting:o,workflowState:a}){const[l,u]=N.useState(!1);N.useEffect(()=>{const v=b=>{b.key==="Escape"&&l&&u(!1)};if(l)return document.addEventListener("keydown",v),()=>document.removeEventListener("keydown",v)},[l]);const d=N.useMemo(()=>{if(!e)return{needsInput:!1,hasDefaults:!1,fieldCount:0};if(e.type==="string")return{needsInput:!e.default,hasDefaults:!!e.default,fieldCount:1,canRunDirectly:!!e.default};if(e.type==="object"&&e.properties){const v=e.properties,b=Object.entries(v),S=b.filter(([,w])=>w.default!==void 0||w.enum&&w.enum.length>0);return{needsInput:b.length>0,hasDefaults:S.length>0,fieldCount:b.length,canRunDirectly:S.length===b.length}}return{needsInput:!1,hasDefaults:!1,fieldCount:0,canRunDirectly:!0}},[e]),f=()=>{if(d.canRunDirectly){const v={};e.type==="string"&&e.default?v.input=e.default:e.type==="object"&&e.properties&&Object.entries(e.properties).forEach(([b,S])=>{S.default!==void 0?v[b]=S.default:S.enum&&S.enum.length>0&&(v[b]=S.enum[0])}),r(v)}else u(!0)},h=()=>a==="running"?"Running...":a==="completed"?"Run Again":a==="error"?"Retry":d.fieldCount===0||d.canRunDirectly?"Run Workflow":"Configure & Run",p=()=>a==="running"?i.jsx(qu,{className:"w-4 h-4 animate-spin"}):a==="error"?i.jsx(hp,{className:"w-4 h-4"}):d.needsInput&&!d.canRunDirectly?i.jsx(vh,{className:"w-4 h-4"}):i.jsx(tM,{className:"w-4 h-4"}),g=a==="running",y=a==="error"?"destructive":"primary";return i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"flex items-center",children:i.jsxs("div",{className:"flex",children:[i.jsxs(Oe,{onClick:f,disabled:g,variant:y==="destructive"?"destructive":"default",size:"default",className:d.needsInput?"rounded-r-none":"",children:[p(),h()]}),d.needsInput&&i.jsxs(Oe,{onClick:()=>u(!0),disabled:g,variant:y==="destructive"?"destructive":"default",size:"default",className:"rounded-l-none border-l-0 px-3",title:"Configure workflow inputs - customize parameters before running",children:[i.jsx(vh,{className:"w-4 h-4"}),i.jsx("span",{className:"ml-1.5",children:"Inputs"})]})]})}),i.jsx(Sr,{open:l,onOpenChange:u,children:i.jsxs(Er,{className:"w-full min-w-[400px] max-w-md sm:max-w-lg md:max-w-2xl lg:max-w-4xl xl:max-w-5xl max-h-[90vh] flex flex-col",children:[i.jsxs(_r,{className:"px-8 pt-6",children:[i.jsx(jr,{children:"Configure Workflow Inputs"}),i.jsx(ho,{onClose:()=>u(!1)})]}),i.jsx("div",{className:"px-8 py-4 border-b flex-shrink-0",children:i.jsx("div",{className:"text-sm text-muted-foreground",children:i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("span",{className:"font-medium",children:"Input Type:"}),i.jsx("code",{className:"bg-muted px-3 py-1 text-xs font-mono",children:d.fieldCount===0?"No Input":e.type==="string"?"String":"Object"}),e.type==="object"&&e.properties&&i.jsxs("span",{className:"text-xs text-muted-foreground",children:[Object.keys(e.properties).length," field",Object.keys(e.properties).length!==1?"s":""]})]})})}),i.jsx("div",{className:"px-8 py-6 overflow-y-auto flex-1 min-h-0",children:i.jsx(ZT,{inputSchema:e,inputTypeName:"Input",onSubmit:v=>{r(v),u(!1)},isSubmitting:o,className:"embedded"})})]})})]})}function p7({selectedWorkflow:e,onDebugEvent:r}){const[o,a]=N.useState(null),[l,u]=N.useState(!1),[d,f]=N.useState([]),[h,p]=N.useState(!1),[g,y]=N.useState(null),[v,b]=N.useState(""),[S,w]=N.useState(""),[j,k]=N.useState(!1),[M,_]=N.useState(!1),[A,D]=N.useState(!1),L=N.useRef(null),H=N.useRef(null),[B,q]=N.useState(!1),Z=N.useRef({}),K=N.useRef(null),G=N.useRef(null),[te,I]=N.useState(()=>{const le=localStorage.getItem("workflowBottomPanelHeight");return le?parseInt(le,10):300}),[V,E]=N.useState(!1),[O,z]=N.useState(()=>{const le=localStorage.getItem("workflowViewOptions");return le?JSON.parse(le):{showMinimap:!1,showGrid:!0,animateRun:!1}}),[P,T]=N.useState(()=>localStorage.getItem("workflowLayoutDirection")||"LR"),{selectExecutor:U,getExecutorData:X}=f7(d,h);N.useEffect(()=>{localStorage.setItem("workflowViewOptions",JSON.stringify(O))},[O]),N.useEffect(()=>{localStorage.setItem("workflowLayoutDirection",P)},[P]),N.useEffect(()=>{const le=()=>{if(L.current){const de=L.current,he=de.scrollHeight>de.clientHeight,ge=de.scrollHeight-de.scrollTop-de.clientHeight<100;h&&ge&&he&&de.scrollTo({top:de.scrollHeight,behavior:"smooth"})}if(H.current){const de=H.current.scrollHeight>H.current.clientHeight;q(de)}};return le(),window.addEventListener("resize",le),()=>window.removeEventListener("resize",le)},[v,S,te,h]);const ee=le=>{z(de=>({...de,[le]:!de[le]}))};N.useEffect(()=>{const le=async()=>{if(e.type==="workflow"){u(!0);try{const de=await Lt.getWorkflowInfo(e.id);a(de)}catch(de){a(null),console.error("Error loading workflow info:",de)}finally{u(!1)}}};f([]),p(!1),y(null),b(""),w(""),Z.current={},K.current=null,G.current=null,le()},[e.id,e.type]);const ae=(le,de)=>{y(de),U(le),Z.current[le]&&b(Z.current[le])},me=N.useMemo(()=>d.filter(le=>le.type==="response.workflow_event.complete"),[d]),ue=N.useMemo(()=>me.filter(le=>"data"in le&&le.data&&typeof le.data=="object"?le.data.executor_id!=null:!1).map(le=>{if("data"in le&&le.data&&typeof le.data=="object"){const de=le.data;return{executorId:String(de.executor_id),message:String(de.event_type||"Processing"),timestamp:String(de.timestamp||new Date().toISOString()),status:String(de.event_type||"").includes("Completed")?"completed":String(de.event_type||"").includes("Error")?"error":"running"}}return{executorId:"unknown",message:"Processing",timestamp:new Date().toISOString(),status:"running"}}),[me]),Q=N.useMemo(()=>h?ue.filter(de=>de.status==="running").slice(-2).map(de=>de.executorId):[],[ue,h]);N.useEffect(()=>{localStorage.setItem("workflowBottomPanelHeight",te.toString())},[te]);const se=N.useCallback(le=>{le.preventDefault(),E(!0);const de=le.clientY,he=te,xe=Be=>{const at=de-Be.clientY,re=Math.max(200,Math.min(window.innerHeight*.6,he+at));I(re)},ge=()=>{E(!1),document.removeEventListener("mousemove",xe),document.removeEventListener("mouseup",ge)};document.addEventListener("mousemove",xe),document.addEventListener("mouseup",ge)},[te]),pe=N.useCallback(async le=>{if(!(!e||e.type!=="workflow")){p(!0),f([]),b(""),w(""),Z.current={},K.current=null,G.current=null,r("clear");try{const de={input_data:le},he=Lt.streamWorkflowExecutionOpenAI(e.id,de);for await(const xe of he){if(xe.type==="response.workflow_event.complete"&&f(ge=>[...ge,xe]),r(xe),xe.type==="response.workflow_event.complete"&&"data"in xe&&xe.data){const ge=xe.data;if(ge.event_type==="ExecutorInvokedEvent"&&ge.executor_id&&(K.current=ge.executor_id,Z.current[ge.executor_id]||(Z.current[ge.executor_id]="")),(ge.event_type==="WorkflowCompletedEvent"||ge.event_type==="WorkflowOutputEvent")&&ge.data){if(typeof ge.data=="string")b(ge.data);else{G.current=ge.data;const Be=JSON.stringify(ge.data,null,2);b(Be)}K.current=null}}if(xe.type==="response.output_text.delta"&&"delta"in xe&&xe.delta){const ge=K.current;ge&&(Z.current[ge]||(Z.current[ge]=""),Z.current[ge]+=xe.delta,g&&Z.current[g.executorId]?b(Z.current[g.executorId]):b(Z.current[ge]))}if(xe.type==="error"){w("error"in xe?String(xe.error):"Unknown error");break}}p(!1)}catch(de){w(de instanceof Error?de.message:"Unknown error"),p(!1)}}},[e,r,o]);return l?i.jsx(vy,{message:"Loading workflow...",description:"Fetching workflow structure and configuration"}):!o?.workflow_dump&&!ue.length?i.jsx(vy,{message:"Initializing workflow...",description:"Setting up workflow execution environment"}):i.jsxs("div",{className:"workflow-view flex flex-col h-full",children:[i.jsxs("div",{className:"border-b pb-2 p-4 flex-shrink-0",children:[i.jsxs("div",{className:"flex flex-col lg:flex-row lg:items-center lg:justify-between gap-3 mb-3",children:[i.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[i.jsx("h2",{className:"font-semibold text-sm truncate",children:i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(Go,{className:"h-4 w-4 flex-shrink-0"}),i.jsx("span",{className:"truncate",children:e.name||e.id})]})}),i.jsx(Oe,{variant:"ghost",size:"sm",onClick:()=>k(!0),className:"h-6 w-6 p-0 flex-shrink-0",title:"View workflow details",children:i.jsx(hu,{className:"h-4 w-4"})})]}),o&&i.jsx("div",{className:"flex flex-col sm:flex-row items-stretch sm:items-center gap-2 flex-shrink-0",children:i.jsx(h7,{inputSchema:o.input_schema,onRun:pe,isSubmitting:h,workflowState:h?"running":S?"error":ue.length>0?"completed":"ready",executorHistory:ue,workflowError:S})})]}),e.description&&i.jsx("p",{className:"text-sm text-muted-foreground",children:e.description})]}),i.jsx("div",{className:"flex-1 min-h-0",children:o?.workflow_dump&&i.jsx(d7,{workflowDump:o.workflow_dump,events:me,isStreaming:h,onNodeSelect:ae,className:"h-full",viewOptions:O,onToggleViewOption:ee,layoutDirection:P,onLayoutDirectionChange:T})}),i.jsx("div",{className:`h-1 cursor-row-resize flex-shrink-0 relative group transition-colors duration-200 ease-in-out ${V?"bg-primary/40":"bg-border hover:bg-primary/20"}`,onMouseDown:se,children:i.jsx("div",{className:"absolute inset-x-0 -top-2 -bottom-2 flex items-center justify-center",children:i.jsx("div",{className:`w-12 h-1 rounded-full transition-all duration-200 ease-in-out ${V?"bg-primary shadow-lg shadow-primary/25":"bg-primary/30 group-hover:bg-primary group-hover:shadow-md group-hover:shadow-primary/20"}`})})}),i.jsx("div",{className:"flex-shrink-0 border-t overflow-hidden",style:{height:`${te}px`},children:i.jsx("div",{className:"h-full flex gap-4 p-4",children:g||Q.length>0||ue.length>0||v||S?i.jsxs(i.Fragment,{children:[(g||Q.length>0||ue.length>0)&&i.jsxs("div",{className:`border border-border rounded bg-card shadow-sm flex flex-col ${v||S?"flex-1":"w-full"}`,children:[i.jsx("div",{className:"border-b border-border px-4 py-3 bg-muted rounded-t flex-shrink-0",children:i.jsx("h4",{className:"text-sm font-medium text-foreground",children:g?`Executor: ${g.name||g.executorId}`:h&&Q.length>0?"Current Executor":"Last Executor"})}),i.jsx("div",{className:"p-4 overflow-auto flex-1",children:g?i.jsxs("div",{className:"space-y-3",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("div",{className:`w-3 h-3 rounded-full ${g.state==="running"?"bg-[#643FB2] dark:bg-[#8B5CF6] animate-pulse":g.state==="completed"?"bg-green-500 dark:bg-green-400":g.state==="failed"?"bg-red-500 dark:bg-red-400":g.state==="cancelled"?"bg-orange-500 dark:bg-orange-400":"bg-gray-400 dark:bg-gray-500"}`}),i.jsx("span",{className:"text-sm font-medium capitalize text-foreground",children:g.state}),g.executorType&&i.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",g.executorType,")"]})]}),g.inputData!==void 0&&g.inputData!==null&&i.jsxs("div",{children:[i.jsx("h5",{className:"text-xs font-medium text-foreground mb-1",children:"Input Data:"}),i.jsx("pre",{className:"text-xs bg-muted p-2 rounded overflow-x-auto max-h-24",children:String(typeof g.inputData=="string"?g.inputData:(()=>{try{return JSON.stringify(g.inputData,null,2)}catch{return"[Unable to display data]"}})())})]}),g.outputData!==void 0&&g.outputData!==null&&i.jsxs("div",{children:[i.jsx("h5",{className:"text-xs font-medium text-foreground mb-1",children:"Output Data:"}),i.jsx("pre",{className:"text-xs bg-muted p-2 rounded overflow-x-auto max-h-24",children:String(typeof g.outputData=="string"?g.outputData:(()=>{try{return JSON.stringify(g.outputData,null,2)}catch{return"[Unable to display data]"}})())})]}),g.error&&i.jsxs("div",{children:[i.jsx("h5",{className:"text-xs font-medium text-destructive mb-1",children:"Error:"}),i.jsx("pre",{className:"text-xs bg-destructive/10 text-destructive p-2 rounded overflow-x-auto",children:g.error})]}),i.jsx("button",{onClick:()=>y(null),className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:"← Back to current executor"})]}):(()=>{const le=h&&Q.length>0?Q[Q.length-1]:ue.length>0?ue[ue.length-1].executorId:null;if(!le)return null;const de=X(le),he=ue.find(xe=>xe.executorId===le);return i.jsxs("div",{className:"space-y-3 cursor-pointer hover:bg-muted/30 p-2 rounded transition-colors",onClick:()=>{de&&y({executorId:de.executorId,state:de.state,inputData:de.inputData,outputData:de.outputData,error:de.error,name:void 0,executorType:void 0,isSelected:!0,isStartNode:!1,onNodeClick:void 0})},children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("div",{className:`w-3 h-3 rounded-full ${h?"bg-[#643FB2] dark:bg-[#8B5CF6] animate-pulse":he?.status==="completed"?"bg-green-500 dark:bg-green-400":he?.status==="error"?"bg-red-500 dark:bg-red-400":"bg-gray-400 dark:bg-gray-500"}`}),i.jsx("span",{className:"text-sm font-medium text-foreground",children:le}),he&&i.jsx("span",{className:"text-xs text-muted-foreground",children:new Date(he.timestamp).toLocaleTimeString()})]}),he&&i.jsx("p",{className:"text-sm text-muted-foreground",children:h?"Processing...":he.message})]})})()})]}),v&&(()=>{const le=h&&K.current,de=!h&&g,he=le?{border:"border-[#643FB2]/40 dark:border-[#8B5CF6]/40",bg:"bg-[#643FB2]/5 dark:bg-[#8B5CF6]/5",headerBg:"bg-[#643FB2]/10 dark:bg-[#8B5CF6]/10",icon:i.jsx(qu,{className:"w-4 h-4 text-[#643FB2] dark:text-[#8B5CF6] animate-spin"}),buttonBg:"bg-background dark:bg-background",buttonBorder:"border-[#643FB2]/30 dark:border-[#8B5CF6]/30",buttonHover:"hover:bg-[#643FB2]/10 dark:hover:bg-[#8B5CF6]/10"}:de?{border:"border-blue-500/40 dark:border-blue-500/40",bg:"bg-blue-500/5 dark:bg-blue-500/5",headerBg:"bg-blue-500/10 dark:bg-blue-500/10",icon:i.jsx(hu,{className:"w-4 h-4 text-blue-500 dark:text-blue-400"}),buttonBg:"bg-background dark:bg-background",buttonBorder:"border-blue-500/30 dark:border-blue-500/30",buttonHover:"hover:bg-blue-500/10 dark:hover:bg-blue-500/10"}:{border:"border-green-500/40 dark:border-green-400/40",bg:"bg-green-500/5 dark:bg-green-400/5",headerBg:"bg-green-500/10 dark:bg-green-400/10",icon:i.jsx(fu,{className:"w-4 h-4 text-green-500 dark:text-green-400"}),buttonBg:"bg-background dark:bg-background",buttonBorder:"border-green-500/30 dark:border-green-400/30",buttonHover:"hover:bg-green-500/10 dark:hover:bg-green-400/10"};return i.jsxs("div",{className:`border-2 ${he.border} rounded ${he.bg} shadow flex-1 flex flex-col min-w-0 relative`,children:[i.jsx("div",{className:`border-b ${he.border} px-4 py-3 ${he.headerBg} rounded-t flex-shrink-0`,children:i.jsxs("div",{className:"flex items-center gap-3",children:[he.icon,i.jsx("h4",{className:"text-sm font-semibold text-foreground",children:le?`Output: ${K.current}`:de?`Output: ${g.executorId}`:"Workflow Complete"})]})}),i.jsx("div",{ref:L,className:"p-4 overflow-auto flex-1 min-h-0 relative",children:i.jsx("div",{className:"text-foreground whitespace-pre-wrap break-words text-sm pb-12",children:v})}),i.jsx("div",{className:"absolute bottom-3 right-3 pointer-events-auto",children:i.jsxs(Oe,{variant:"outline",size:"sm",onClick:()=>_(!0),className:`h-8 px-3 ${he.buttonBg} ${he.buttonBorder} ${he.buttonHover} shadow-md`,title:"Expand to full view",children:[i.jsx(ly,{className:"w-3.5 h-3.5 mr-1.5"}),"View Full"]})})]})})(),S&&i.jsxs("div",{className:"border-2 border-destructive/70 rounded bg-destructive/5 shadow flex-1 flex flex-col min-w-0 relative",children:[i.jsx("div",{className:"border-b border-destructive/70 px-4 py-3 bg-destructive/10 rounded-t flex-shrink-0",children:i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx(ts,{className:"w-4 h-4 text-destructive"}),i.jsx("h4",{className:"text-sm font-semibold text-destructive",children:"Workflow Failed"})]})}),i.jsx("div",{ref:H,className:"p-4 overflow-auto flex-1 min-h-0 relative",children:i.jsx("div",{className:"text-destructive whitespace-pre-wrap break-words text-sm pb-12",children:S})}),i.jsx("div",{className:"absolute bottom-3 right-3 pointer-events-auto",children:i.jsxs(Oe,{variant:"outline",size:"sm",onClick:()=>D(!0),className:"h-8 px-3 bg-destructive/10 dark:bg-destructive/20 border-destructive/50 text-destructive hover:bg-destructive/20 dark:hover:bg-destructive/30 shadow-md",title:"Expand to full view",children:[i.jsx(ly,{className:"w-3.5 h-3.5 mr-1.5"}),"View Full"]})}),B&&i.jsx("div",{className:"absolute bottom-14 left-1/2 transform -translate-x-1/2 pointer-events-none",children:i.jsxs("div",{className:"bg-destructive/80 text-white px-2 py-1 rounded-full flex items-center gap-1 text-xs animate-bounce",children:[i.jsx(aA,{className:"w-3 h-3"}),i.jsx("span",{children:"Scroll for more"})]})})]})]}):i.jsx("div",{className:"h-full flex items-center justify-center text-muted-foreground",children:i.jsx("p",{children:"Select a workflow node (executor) to see execution details"})})})}),i.jsx(m7,{workflow:e,open:j,onOpenChange:k}),i.jsx(Sr,{open:M,onOpenChange:_,children:i.jsxs(Er,{className:"max-w-4xl max-h-[90vh] flex flex-col",children:[i.jsxs(_r,{className:"px-6 pt-6 flex-shrink-0",children:[i.jsxs(jr,{className:"flex items-center gap-2",children:[i.jsx(fu,{className:"w-5 h-5 text-emerald-600 dark:text-emerald-400"}),"Workflow Results"]}),i.jsx(ho,{onClose:()=>_(!1)})]}),i.jsx("div",{className:"px-6 pb-6 overflow-y-auto flex-1",children:i.jsxs("div",{className:"space-y-4",children:[Object.values(Z.current).some(le=>le&&le.trim().length>0)?Object.entries(Z.current).map(([le,de])=>de&&i.jsxs("div",{className:"border-2 border-emerald-300 dark:border-emerald-600 rounded overflow-hidden",children:[i.jsx("div",{className:"bg-emerald-100 dark:bg-emerald-900/50 px-4 py-2 border-b border-emerald-300 dark:border-emerald-600",children:i.jsx("h5",{className:"text-sm font-semibold text-emerald-800 dark:text-emerald-200",children:le})}),i.jsx("div",{className:"bg-emerald-50 dark:bg-emerald-950/50 p-4",children:i.jsx("div",{className:"text-emerald-700 dark:text-emerald-300 whitespace-pre-wrap break-words text-sm font-mono",children:de})})]},le)):i.jsx("div",{className:"bg-emerald-50 dark:bg-emerald-950/50 rounded border-2 border-emerald-300 dark:border-emerald-600 p-6",children:i.jsx("div",{className:"text-emerald-700 dark:text-emerald-300 whitespace-pre-wrap break-words text-sm font-mono",children:v||"No output available"})}),G.current&&i.jsxs("div",{className:"border-2 border-blue-300 dark:border-blue-600 rounded overflow-hidden",children:[i.jsx("div",{className:"bg-blue-100 dark:bg-blue-900/50 px-4 py-2 border-b border-blue-300 dark:border-blue-600",children:i.jsx("h5",{className:"text-sm font-semibold text-blue-800 dark:text-blue-200",children:"Workflow Output (Structured)"})}),i.jsx("div",{className:"bg-blue-50 dark:bg-blue-950/50 p-4",children:i.jsx("pre",{className:"text-blue-700 dark:text-blue-300 whitespace-pre-wrap break-words text-xs font-mono",children:JSON.stringify(G.current,null,2)})})]})]})})]})}),i.jsx(Sr,{open:A,onOpenChange:D,children:i.jsxs(Er,{className:"max-w-4xl max-h-[90vh] flex flex-col",children:[i.jsxs(_r,{className:"px-6 pt-6 flex-shrink-0",children:[i.jsxs(jr,{className:"flex items-center gap-2",children:[i.jsx(ts,{className:"w-5 h-5 text-destructive"}),"Workflow Error"]}),i.jsx(ho,{onClose:()=>D(!1)})]}),i.jsx("div",{className:"px-6 pb-6 overflow-y-auto flex-1",children:i.jsx("div",{className:"bg-destructive/5 rounded border-2 border-destructive/70 p-6",children:i.jsx("div",{className:"text-destructive whitespace-pre-wrap break-words text-sm font-mono",children:S})})})]})})]})}function g7({message:e,type:r="info",duration:o=4e3,onClose:a}){const[l,u]=N.useState(!0);N.useEffect(()=>{const h=setTimeout(()=>{u(!1),setTimeout(a,300)},o);return()=>clearTimeout(h)},[o,a]);const d={info:"bg-primary/10 border-primary/20",success:"bg-green-50 dark:bg-green-950 border-green-200 dark:border-green-800",warning:"bg-orange-50 dark:bg-orange-950 border-orange-200 dark:border-orange-800",error:"bg-red-50 dark:bg-red-950 border-red-200 dark:border-red-800"}[r],f={info:"text-primary",success:"text-green-800 dark:text-green-200",warning:"text-orange-800 dark:text-orange-200",error:"text-red-800 dark:text-red-200"}[r];return i.jsxs("div",{className:`fixed top-4 right-4 z-50 flex items-start gap-3 p-4 rounded-lg border shadow-lg max-w-md transition-all duration-300 ${l?"opacity-100 translate-x-0":"opacity-0 translate-x-4"} ${d}`,children:[i.jsx("p",{className:`text-sm flex-1 ${f}`,children:e}),i.jsx("button",{onClick:()=>{u(!1),setTimeout(a,300)},className:`flex-shrink-0 hover:opacity-70 transition-opacity ${f}`,children:i.jsx(pp,{className:"h-4 w-4"})})]})}function x7(){const e=ye(E=>E.agents),r=ye(E=>E.workflows),o=ye(E=>E.selectedAgent),a=ye(E=>E.isLoadingEntities),l=ye(E=>E.entityError),u=ye(E=>E.setAgents),d=ye(E=>E.setWorkflows),f=ye(E=>E.selectEntity),h=ye(E=>E.updateAgent),p=ye(E=>E.updateWorkflow),g=ye(E=>E.setIsLoadingEntities),y=ye(E=>E.setEntityError),v=ye(E=>E.showDebugPanel),b=ye(E=>E.debugPanelWidth),S=ye(E=>E.debugEvents),w=ye(E=>E.isResizing),j=ye(E=>E.setShowDebugPanel),k=ye(E=>E.setDebugPanelWidth),M=ye(E=>E.addDebugEvent),_=ye(E=>E.clearDebugEvents),A=ye(E=>E.setIsResizing),D=ye(E=>E.showAboutModal),L=ye(E=>E.showGallery),H=ye(E=>E.showDeployModal),B=ye(E=>E.showEntityNotFoundToast),q=ye(E=>E.setShowAboutModal),Z=ye(E=>E.setShowGallery),K=ye(E=>E.setShowDeployModal),G=ye(E=>E.setShowEntityNotFoundToast);N.useEffect(()=>{(async()=>{try{const{agents:O,workflows:z}=await Lt.getEntities();u(O),d(z);const T=new URLSearchParams(window.location.search).get("entity_id");let U;if(T&&(U=O.find(X=>X.id===T)||z.find(X=>X.id===T),U||G(!0)),!U)if(U=O.length>0?O[0]:z.length>0?z[0]:void 0,U){const X=new URL(window.location.href);X.searchParams.set("entity_id",U.id),window.history.replaceState({},"",X)}else{const X=new URL(window.location.href);X.searchParams.delete("entity_id"),window.history.replaceState({},"",X)}if(U&&(f(U),U.metadata?.lazy_loaded===!1))try{if(U.type==="agent"){const X=await Lt.getAgentInfo(U.id);h(X)}else{const X=await Lt.getWorkflowInfo(U.id);p(X)}}catch(X){console.error(`Failed to load full info for first entity ${U.id}:`,X)}g(!1)}catch(O){console.error("Failed to load agents/workflows:",O),y(O instanceof Error?O.message:"Failed to load data"),g(!1)}})()},[u,d,f,h,p,g,y,G]);const te=N.useCallback(E=>{E.preventDefault(),A(!0);const O=E.clientX,z=b,P=U=>{const X=O-U.clientX,ee=Math.max(200,Math.min(window.innerWidth*.5,z+X));k(ee)},T=()=>{A(!1),document.removeEventListener("mousemove",P),document.removeEventListener("mouseup",T)};document.addEventListener("mousemove",P),document.addEventListener("mouseup",T)},[b]),I=N.useCallback(async E=>{if(f(E),E.metadata?.lazy_loaded===!1)try{if(E.type==="agent"){const O=await Lt.getAgentInfo(E.id);h(O)}else{const O=await Lt.getWorkflowInfo(E.id);p(O)}}catch(O){console.error(`Failed to load full info for ${E.id}:`,O)}},[f,h,p]),V=N.useCallback(E=>{E==="clear"?_():M(E)},[M,_]);return a?i.jsxs("div",{className:"h-screen flex flex-col bg-background",children:[i.jsxs("header",{className:"flex h-14 items-center gap-4 border-b px-4",children:[i.jsx("div",{className:"w-64 h-9 bg-muted animate-pulse rounded-md"}),i.jsxs("div",{className:"flex items-center gap-2 ml-auto",children:[i.jsx("div",{className:"w-8 h-8 bg-muted animate-pulse rounded-md"}),i.jsx("div",{className:"w-8 h-8 bg-muted animate-pulse rounded-md"})]})]}),i.jsx("div",{className:"flex-1 flex items-center justify-center",children:i.jsxs("div",{className:"text-center",children:[i.jsx("div",{className:"text-lg font-medium",children:"Initializing DevUI..."}),i.jsx("div",{className:"text-sm text-muted-foreground mt-2",children:"Loading agents and workflows from your configuration"})]})})]}):l?i.jsxs("div",{className:"h-screen flex flex-col bg-background",children:[i.jsx(dy,{agents:[],workflows:[],selectedItem:void 0,onSelect:()=>{},isLoading:!1,onSettingsClick:()=>q(!0)}),i.jsx("div",{className:"flex-1 flex items-center justify-center p-8",children:i.jsxs("div",{className:"text-center space-y-6 max-w-2xl",children:[i.jsx("div",{className:"flex justify-center",children:i.jsx("div",{className:"rounded-full bg-muted p-4 animate-pulse",children:i.jsx(uM,{className:"h-12 w-12 text-muted-foreground"})})}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("h2",{className:"text-2xl font-semibold text-foreground",children:"Can't Connect to Backend"}),i.jsx("p",{className:"text-muted-foreground text-base",children:"No worries! Just start the DevUI backend server and you'll be good to go."})]}),i.jsxs("div",{className:"space-y-3",children:[i.jsxs("div",{className:"text-left bg-muted/50 rounded-lg p-4 space-y-3",children:[i.jsx("p",{className:"text-sm font-medium text-foreground",children:"Start the backend:"}),i.jsx("code",{className:"block bg-background px-3 py-2 rounded border text-sm font-mono text-foreground",children:"devui ./agents --port 8080"}),i.jsxs("p",{className:"text-xs text-muted-foreground",children:["Or launch programmatically with"," ",i.jsx("code",{className:"text-xs",children:"serve(entities=[agent])"})]})]}),i.jsxs("p",{className:"text-xs text-muted-foreground",children:["Default:"," ",i.jsx("span",{className:"font-mono",children:"http://localhost:8080"})]})]}),l&&i.jsxs("details",{className:"text-left group",children:[i.jsxs("summary",{className:"text-sm text-muted-foreground cursor-pointer hover:text-foreground flex items-center gap-2",children:[i.jsx(kn,{className:"h-4 w-4 transition-transform group-open:rotate-180"}),"Error details"]}),i.jsx("p",{className:"mt-2 text-xs text-muted-foreground font-mono bg-muted/30 p-3 rounded border",children:l})]}),i.jsx(Oe,{onClick:()=>window.location.reload(),variant:"default",className:"mt-2",children:"Retry Connection"})]})}),i.jsx(my,{open:D,onOpenChange:q})]}):i.jsxs("div",{className:"h-screen flex flex-col bg-background max-h-screen",children:[i.jsx(dy,{agents:e,workflows:r,selectedItem:o,onSelect:I,onBrowseGallery:()=>Z(!0),isLoading:a,onSettingsClick:()=>q(!0)}),i.jsx("div",{className:"flex flex-1 overflow-hidden",children:L?i.jsx("div",{className:"flex-1 w-full",children:i.jsx(hy,{variant:"route",onClose:()=>Z(!1),hasExistingEntities:e.length>0||r.length>0})}):e.length===0&&r.length===0?i.jsx(hy,{variant:"inline"}):i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"flex-1 min-w-0",children:o?o.type==="agent"?i.jsx(VT,{selectedAgent:o,onDebugEvent:V}):i.jsx(p7,{selectedWorkflow:o,onDebugEvent:V}):i.jsx("div",{className:"flex-1 flex items-center justify-center text-muted-foreground",children:"Select an agent or workflow to get started."})}),v?i.jsxs(i.Fragment,{children:[i.jsx("div",{className:`w-1 cursor-col-resize flex-shrink-0 relative group transition-colors duration-200 ease-in-out ${w?"bg-primary/40":"bg-border hover:bg-primary/20"}`,onMouseDown:te,children:i.jsx("div",{className:"absolute inset-y-0 -left-2 -right-2 flex items-center justify-center",children:i.jsx("div",{className:`h-12 w-1 rounded-full transition-all duration-200 ease-in-out ${w?"bg-primary shadow-lg shadow-primary/25":"bg-primary/30 group-hover:bg-primary group-hover:shadow-md group-hover:shadow-primary/20"}`})})}),i.jsxs("div",{className:"flex-shrink-0 flex flex-col h-[calc(100vh-3.7rem)]",style:{width:`${b}px`},children:[i.jsx(m5,{events:S,isStreaming:!1,onClose:()=>j(!1)}),i.jsx("div",{className:"border-t bg-muted/30 px-3 py-2.5 flex-shrink-0",children:i.jsxs(Oe,{onClick:()=>K(!0),className:"w-full",variant:"outline",size:"sm",children:[i.jsx(y1,{className:"h-3 w-3 mr-2 flex-shrink-0"}),i.jsxs("span",{className:"truncate text-xs",children:["Deployment Guide for ",o?.name||"Agent"]})]})})]})]}):i.jsx("div",{className:"flex-shrink-0",children:i.jsx(Oe,{variant:"ghost",size:"sm",onClick:()=>j(!0),className:"h-full w-10 rounded-none border-l",title:"Show debug panel",children:i.jsx(WA,{className:"h-4 w-4"})})})]})}),i.jsx(my,{open:D,onOpenChange:q}),i.jsx(v5,{open:H,onClose:()=>K(!1),agentName:o?.name}),B&&i.jsx(g7,{message:"Entity not found. Showing first available entity instead.",type:"info",onClose:()=>G(!1)})]})}function v7({children:e,attribute:r="class",defaultTheme:o="dark",enableSystem:a=!0,disableTransitionOnChange:l=!0,...u}){return i.jsx(RM,{attribute:r,defaultTheme:o,enableSystem:a,disableTransitionOnChange:l,...u,children:e})}X_.createRoot(document.getElementById("root")).render(i.jsx(N.StrictMode,{children:i.jsx(v7,{attribute:"class",defaultTheme:"dark",enableSystem:!0,disableTransitionOnChange:!0,children:i.jsx(x7,{})})}));