function gE(e,n){for(var s=0;s<n.length;s++){const o=n[s];if(typeof o!="string"&&!Array.isArray(o)){for(const l in o)if(l!=="default"&&!(l in e)){const c=Object.getOwnPropertyDescriptor(o,l);c&&Object.defineProperty(e,l,c.get?c:{enumerable:!0,get:()=>o[l]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))o(l);new MutationObserver(l=>{for(const c of l)if(c.type==="childList")for(const d of c.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&o(d)}).observe(document,{childList:!0,subtree:!0});function s(l){const c={};return l.integrity&&(c.integrity=l.integrity),l.referrerPolicy&&(c.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?c.credentials="include":l.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function o(l){if(l.ep)return;l.ep=!0;const c=s(l);fetch(l.href,c)}})();function dp(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var $m={exports:{}},Oi={};/**
 * @license React
 * react-jsx-runtime.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var Fy;function xE(){if(Fy)return Oi;Fy=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function s(o,l,c){var d=null;if(c!==void 0&&(d=""+c),l.key!==void 0&&(d=""+l.key),"key"in l){c={};for(var f in l)f!=="key"&&(c[f]=l[f])}else c=l;return l=c.ref,{$$typeof:e,type:o,key:d,ref:l!==void 0?l:null,props:c}}return Oi.Fragment=n,Oi.jsx=s,Oi.jsxs=s,Oi}var Yy;function yE(){return Yy||(Yy=1,$m.exports=xE()),$m.exports}var a=yE(),Bm={exports:{}},Ue={};/**
 * @license React
 * react.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var Gy;function vE(){if(Gy)return Ue;Gy=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),d=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),v=Symbol.iterator;function y(T){return T===null||typeof T!="object"?null:(T=v&&T[v]||T["@@iterator"],typeof T=="function"?T:null)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,N={};function _(T,B,W){this.props=T,this.context=B,this.refs=N,this.updater=W||b}_.prototype.isReactComponent={},_.prototype.setState=function(T,B){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,B,"setState")},_.prototype.forceUpdate=function(T){this.updater.enqueueForceUpdate(this,T,"forceUpdate")};function E(){}E.prototype=_.prototype;function M(T,B,W){this.props=T,this.context=B,this.refs=N,this.updater=W||b}var j=M.prototype=new E;j.constructor=M,S(j,_.prototype),j.isPureReactComponent=!0;var k=Array.isArray,R={H:null,A:null,T:null,S:null,V:null},D=Object.prototype.hasOwnProperty;function z(T,B,W,Z,re,de){return W=de.ref,{$$typeof:e,type:T,key:B,ref:W!==void 0?W:null,props:de}}function H(T,B){return z(T.type,B,void 0,void 0,void 0,T.props)}function U(T){return typeof T=="object"&&T!==null&&T.$$typeof===e}function F(T){var B={"=":"=0",":":"=2"};return"$"+T.replace(/[=:]/g,function(W){return B[W]})}var K=/\/+/g;function G(T,B){return typeof T=="object"&&T!==null&&T.key!=null?F(""+T.key):B.toString(36)}function ne(){}function L(T){switch(T.status){case"fulfilled":return T.value;case"rejected":throw T.reason;default:switch(typeof T.status=="string"?T.then(ne,ne):(T.status="pending",T.then(function(B){T.status==="pending"&&(T.status="fulfilled",T.value=B)},function(B){T.status==="pending"&&(T.status="rejected",T.reason=B)})),T.status){case"fulfilled":return T.value;case"rejected":throw T.reason}}throw T}function V(T,B,W,Z,re){var de=typeof T;(de==="undefined"||de==="boolean")&&(T=null);var ge=!1;if(T===null)ge=!0;else switch(de){case"bigint":case"string":case"number":ge=!0;break;case"object":switch(T.$$typeof){case e:case n:ge=!0;break;case g:return ge=T._init,V(ge(T._payload),B,W,Z,re)}}if(ge)return re=re(T),ge=Z===""?"."+G(T,0):Z,k(re)?(W="",ge!=null&&(W=ge.replace(K,"$&/")+"/"),V(re,B,W,"",function(ve){return ve})):re!=null&&(U(re)&&(re=H(re,W+(re.key==null||T&&T.key===re.key?"":(""+re.key).replace(K,"$&/")+"/")+ge)),B.push(re)),1;ge=0;var J=Z===""?".":Z+":";if(k(T))for(var le=0;le<T.length;le++)Z=T[le],de=J+G(Z,le),ge+=V(Z,B,W,de,re);else if(le=y(T),typeof le=="function")for(T=le.call(T),le=0;!(Z=T.next()).done;)Z=Z.value,de=J+G(Z,le++),ge+=V(Z,B,W,de,re);else if(de==="object"){if(typeof T.then=="function")return V(L(T),B,W,Z,re);throw B=String(T),Error("Objects are not valid as a React child (found: "+(B==="[object Object]"?"object with keys {"+Object.keys(T).join(", ")+"}":B)+"). If you meant to render a collection of children, use an array instead.")}return ge}function A(T,B,W){if(T==null)return T;var Z=[],re=0;return V(T,Z,"","",function(de){return B.call(W,de,re++)}),Z}function I(T){if(T._status===-1){var B=T._result;B=B(),B.then(function(W){(T._status===0||T._status===-1)&&(T._status=1,T._result=W)},function(W){(T._status===0||T._status===-1)&&(T._status=2,T._result=W)}),T._status===-1&&(T._status=0,T._result=B)}if(T._status===1)return T._result.default;throw T._result}var $=typeof reportError=="function"?reportError:function(T){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var B=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(B))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",T);return}console.error(T)};function P(){}return Ue.Children={map:A,forEach:function(T,B,W){A(T,function(){B.apply(this,arguments)},W)},count:function(T){var B=0;return A(T,function(){B++}),B},toArray:function(T){return A(T,function(B){return B})||[]},only:function(T){if(!U(T))throw Error("React.Children.only expected to receive a single React element child.");return T}},Ue.Component=_,Ue.Fragment=s,Ue.Profiler=l,Ue.PureComponent=M,Ue.StrictMode=o,Ue.Suspense=m,Ue.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=R,Ue.__COMPILER_RUNTIME={__proto__:null,c:function(T){return R.H.useMemoCache(T)}},Ue.cache=function(T){return function(){return T.apply(null,arguments)}},Ue.cloneElement=function(T,B,W){if(T==null)throw Error("The argument must be a React element, but you passed "+T+".");var Z=S({},T.props),re=T.key,de=void 0;if(B!=null)for(ge in B.ref!==void 0&&(de=void 0),B.key!==void 0&&(re=""+B.key),B)!D.call(B,ge)||ge==="key"||ge==="__self"||ge==="__source"||ge==="ref"&&B.ref===void 0||(Z[ge]=B[ge]);var ge=arguments.length-2;if(ge===1)Z.children=W;else if(1<ge){for(var J=Array(ge),le=0;le<ge;le++)J[le]=arguments[le+2];Z.children=J}return z(T.type,re,void 0,void 0,de,Z)},Ue.createContext=function(T){return T={$$typeof:d,_currentValue:T,_currentValue2:T,_threadCount:0,Provider:null,Consumer:null},T.Provider=T,T.Consumer={$$typeof:c,_context:T},T},Ue.createElement=function(T,B,W){var Z,re={},de=null;if(B!=null)for(Z in B.key!==void 0&&(de=""+B.key),B)D.call(B,Z)&&Z!=="key"&&Z!=="__self"&&Z!=="__source"&&(re[Z]=B[Z]);var ge=arguments.length-2;if(ge===1)re.children=W;else if(1<ge){for(var J=Array(ge),le=0;le<ge;le++)J[le]=arguments[le+2];re.children=J}if(T&&T.defaultProps)for(Z in ge=T.defaultProps,ge)re[Z]===void 0&&(re[Z]=ge[Z]);return z(T,de,void 0,void 0,null,re)},Ue.createRef=function(){return{current:null}},Ue.forwardRef=function(T){return{$$typeof:f,render:T}},Ue.isValidElement=U,Ue.lazy=function(T){return{$$typeof:g,_payload:{_status:-1,_result:T},_init:I}},Ue.memo=function(T,B){return{$$typeof:p,type:T,compare:B===void 0?null:B}},Ue.startTransition=function(T){var B=R.T,W={};R.T=W;try{var Z=T(),re=R.S;re!==null&&re(W,Z),typeof Z=="object"&&Z!==null&&typeof Z.then=="function"&&Z.then(P,$)}catch(de){$(de)}finally{R.T=B}},Ue.unstable_useCacheRefresh=function(){return R.H.useCacheRefresh()},Ue.use=function(T){return R.H.use(T)},Ue.useActionState=function(T,B,W){return R.H.useActionState(T,B,W)},Ue.useCallback=function(T,B){return R.H.useCallback(T,B)},Ue.useContext=function(T){return R.H.useContext(T)},Ue.useDebugValue=function(){},Ue.useDeferredValue=function(T,B){return R.H.useDeferredValue(T,B)},Ue.useEffect=function(T,B,W){var Z=R.H;if(typeof W=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return Z.useEffect(T,B)},Ue.useId=function(){return R.H.useId()},Ue.useImperativeHandle=function(T,B,W){return R.H.useImperativeHandle(T,B,W)},Ue.useInsertionEffect=function(T,B){return R.H.useInsertionEffect(T,B)},Ue.useLayoutEffect=function(T,B){return R.H.useLayoutEffect(T,B)},Ue.useMemo=function(T,B){return R.H.useMemo(T,B)},Ue.useOptimistic=function(T,B){return R.H.useOptimistic(T,B)},Ue.useReducer=function(T,B,W){return R.H.useReducer(T,B,W)},Ue.useRef=function(T){return R.H.useRef(T)},Ue.useState=function(T){return R.H.useState(T)},Ue.useSyncExternalStore=function(T,B,W){return R.H.useSyncExternalStore(T,B,W)},Ue.useTransition=function(){return R.H.useTransition()},Ue.version="19.1.1",Ue}var Xy;function dl(){return Xy||(Xy=1,Bm.exports=vE()),Bm.exports}var w=dl();const gn=dp(w),Zb=gE({__proto__:null,default:gn},[w]);var Pm={exports:{}},zi={},Um={exports:{}},Vm={};/**
 * @license React
 * scheduler.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var Zy;function bE(){return Zy||(Zy=1,(function(e){function n(A,I){var $=A.length;A.push(I);e:for(;0<$;){var P=$-1>>>1,T=A[P];if(0<l(T,I))A[P]=I,A[$]=T,$=P;else break e}}function s(A){return A.length===0?null:A[0]}function o(A){if(A.length===0)return null;var I=A[0],$=A.pop();if($!==I){A[0]=$;e:for(var P=0,T=A.length,B=T>>>1;P<B;){var W=2*(P+1)-1,Z=A[W],re=W+1,de=A[re];if(0>l(Z,$))re<T&&0>l(de,Z)?(A[P]=de,A[re]=$,P=re):(A[P]=Z,A[W]=$,P=W);else if(re<T&&0>l(de,$))A[P]=de,A[re]=$,P=re;else break e}}return I}function l(A,I){var $=A.sortIndex-I.sortIndex;return $!==0?$:A.id-I.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;e.unstable_now=function(){return c.now()}}else{var d=Date,f=d.now();e.unstable_now=function(){return d.now()-f}}var m=[],p=[],g=1,v=null,y=3,b=!1,S=!1,N=!1,_=!1,E=typeof setTimeout=="function"?setTimeout:null,M=typeof clearTimeout=="function"?clearTimeout:null,j=typeof setImmediate<"u"?setImmediate:null;function k(A){for(var I=s(p);I!==null;){if(I.callback===null)o(p);else if(I.startTime<=A)o(p),I.sortIndex=I.expirationTime,n(m,I);else break;I=s(p)}}function R(A){if(N=!1,k(A),!S)if(s(m)!==null)S=!0,D||(D=!0,G());else{var I=s(p);I!==null&&V(R,I.startTime-A)}}var D=!1,z=-1,H=5,U=-1;function F(){return _?!0:!(e.unstable_now()-U<H)}function K(){if(_=!1,D){var A=e.unstable_now();U=A;var I=!0;try{e:{S=!1,N&&(N=!1,M(z),z=-1),b=!0;var $=y;try{t:{for(k(A),v=s(m);v!==null&&!(v.expirationTime>A&&F());){var P=v.callback;if(typeof P=="function"){v.callback=null,y=v.priorityLevel;var T=P(v.expirationTime<=A);if(A=e.unstable_now(),typeof T=="function"){v.callback=T,k(A),I=!0;break t}v===s(m)&&o(m),k(A)}else o(m);v=s(m)}if(v!==null)I=!0;else{var B=s(p);B!==null&&V(R,B.startTime-A),I=!1}}break e}finally{v=null,y=$,b=!1}I=void 0}}finally{I?G():D=!1}}}var G;if(typeof j=="function")G=function(){j(K)};else if(typeof MessageChannel<"u"){var ne=new MessageChannel,L=ne.port2;ne.port1.onmessage=K,G=function(){L.postMessage(null)}}else G=function(){E(K,0)};function V(A,I){z=E(function(){A(e.unstable_now())},I)}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(A){A.callback=null},e.unstable_forceFrameRate=function(A){0>A||125<A?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):H=0<A?Math.floor(1e3/A):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_next=function(A){switch(y){case 1:case 2:case 3:var I=3;break;default:I=y}var $=y;y=I;try{return A()}finally{y=$}},e.unstable_requestPaint=function(){_=!0},e.unstable_runWithPriority=function(A,I){switch(A){case 1:case 2:case 3:case 4:case 5:break;default:A=3}var $=y;y=A;try{return I()}finally{y=$}},e.unstable_scheduleCallback=function(A,I,$){var P=e.unstable_now();switch(typeof $=="object"&&$!==null?($=$.delay,$=typeof $=="number"&&0<$?P+$:P):$=P,A){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=$+T,A={id:g++,callback:I,priorityLevel:A,startTime:$,expirationTime:T,sortIndex:-1},$>P?(A.sortIndex=$,n(p,A),s(m)===null&&A===s(p)&&(N?(M(z),z=-1):N=!0,V(R,$-P))):(A.sortIndex=T,n(m,A),S||b||(S=!0,D||(D=!0,G()))),A},e.unstable_shouldYield=F,e.unstable_wrapCallback=function(A){var I=y;return function(){var $=y;y=I;try{return A.apply(this,arguments)}finally{y=$}}}})(Vm)),Vm}var Wy;function wE(){return Wy||(Wy=1,Um.exports=bE()),Um.exports}var qm={exports:{}},Yt={};/**
 * @license React
 * react-dom.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var Ky;function NE(){if(Ky)return Yt;Ky=1;var e=dl();function n(m){var p="https://react.dev/errors/"+m;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 #"+m+"; visit "+p+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(){}var o={d:{f:s,r:function(){throw Error(n(522))},D:s,C:s,L:s,m:s,X:s,S:s,M:s},p:0,findDOMNode:null},l=Symbol.for("react.portal");function c(m,p,g){var v=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:l,key:v==null?null:""+v,children:m,containerInfo:p,implementation:g}}var d=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(m,p){if(m==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return Yt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,Yt.createPortal=function(m,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(n(299));return c(m,p,null,g)},Yt.flushSync=function(m){var p=d.T,g=o.p;try{if(d.T=null,o.p=2,m)return m()}finally{d.T=p,o.p=g,o.d.f()}},Yt.preconnect=function(m,p){typeof m=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,o.d.C(m,p))},Yt.prefetchDNS=function(m){typeof m=="string"&&o.d.D(m)},Yt.preinit=function(m,p){if(typeof m=="string"&&p&&typeof p.as=="string"){var g=p.as,v=f(g,p.crossOrigin),y=typeof p.integrity=="string"?p.integrity:void 0,b=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;g==="style"?o.d.S(m,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:v,integrity:y,fetchPriority:b}):g==="script"&&o.d.X(m,{crossOrigin:v,integrity:y,fetchPriority:b,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},Yt.preinitModule=function(m,p){if(typeof m=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var g=f(p.as,p.crossOrigin);o.d.M(m,{crossOrigin:g,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0})}}else p==null&&o.d.M(m)},Yt.preload=function(m,p){if(typeof m=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var g=p.as,v=f(g,p.crossOrigin);o.d.L(m,g,{crossOrigin:v,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})}},Yt.preloadModule=function(m,p){if(typeof m=="string")if(p){var g=f(p.as,p.crossOrigin);o.d.m(m,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:g,integrity:typeof p.integrity=="string"?p.integrity:void 0})}else o.d.m(m)},Yt.requestFormReset=function(m){o.d.r(m)},Yt.unstable_batchedUpdates=function(m,p){return m(p)},Yt.useFormState=function(m,p,g){return d.H.useFormState(m,p,g)},Yt.useFormStatus=function(){return d.H.useHostTransitionStatus()},Yt.version="19.1.1",Yt}var Qy;function Wb(){if(Qy)return qm.exports;Qy=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(n){console.error(n)}}return e(),qm.exports=NE(),qm.exports}/**
 * @license React
 * react-dom-client.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var Jy;function SE(){if(Jy)return zi;Jy=1;var e=wE(),n=dl(),s=Wb();function o(t){var r="https://react.dev/errors/"+t;if(1<arguments.length){r+="?args[]="+encodeURIComponent(arguments[1]);for(var i=2;i<arguments.length;i++)r+="&args[]="+encodeURIComponent(arguments[i])}return"Minified React error #"+t+"; visit "+r+" 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 c(t){var r=t,i=t;if(t.alternate)for(;r.return;)r=r.return;else{t=r;do r=t,(r.flags&4098)!==0&&(i=r.return),t=r.return;while(t)}return r.tag===3?i:null}function d(t){if(t.tag===13){var r=t.memoizedState;if(r===null&&(t=t.alternate,t!==null&&(r=t.memoizedState)),r!==null)return r.dehydrated}return null}function f(t){if(c(t)!==t)throw Error(o(188))}function m(t){var r=t.alternate;if(!r){if(r=c(t),r===null)throw Error(o(188));return r!==t?null:t}for(var i=t,u=r;;){var h=i.return;if(h===null)break;var x=h.alternate;if(x===null){if(u=h.return,u!==null){i=u;continue}break}if(h.child===x.child){for(x=h.child;x;){if(x===i)return f(h),t;if(x===u)return f(h),r;x=x.sibling}throw Error(o(188))}if(i.return!==u.return)i=h,u=x;else{for(var C=!1,O=h.child;O;){if(O===i){C=!0,i=h,u=x;break}if(O===u){C=!0,u=h,i=x;break}O=O.sibling}if(!C){for(O=x.child;O;){if(O===i){C=!0,i=x,u=h;break}if(O===u){C=!0,u=x,i=h;break}O=O.sibling}if(!C)throw Error(o(189))}}if(i.alternate!==u)throw Error(o(190))}if(i.tag!==3)throw Error(o(188));return i.stateNode.current===i?t:r}function p(t){var r=t.tag;if(r===5||r===26||r===27||r===6)return t;for(t=t.child;t!==null;){if(r=p(t),r!==null)return r;t=t.sibling}return null}var g=Object.assign,v=Symbol.for("react.element"),y=Symbol.for("react.transitional.element"),b=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),N=Symbol.for("react.strict_mode"),_=Symbol.for("react.profiler"),E=Symbol.for("react.provider"),M=Symbol.for("react.consumer"),j=Symbol.for("react.context"),k=Symbol.for("react.forward_ref"),R=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),z=Symbol.for("react.memo"),H=Symbol.for("react.lazy"),U=Symbol.for("react.activity"),F=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 ne=Symbol.for("react.client.reference");function L(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===ne?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case S:return"Fragment";case _:return"Profiler";case N:return"StrictMode";case R:return"Suspense";case D:return"SuspenseList";case U:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case b:return"Portal";case j:return(t.displayName||"Context")+".Provider";case M:return(t._context.displayName||"Context")+".Consumer";case k:var r=t.render;return t=t.displayName,t||(t=r.displayName||r.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case z:return r=t.displayName||null,r!==null?r:L(t.type)||"Memo";case H:r=t._payload,t=t._init;try{return L(t(r))}catch{}}return null}var V=Array.isArray,A=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I=s.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$={pending:!1,data:null,method:null,action:null},P=[],T=-1;function B(t){return{current:t}}function W(t){0>T||(t.current=P[T],P[T]=null,T--)}function Z(t,r){T++,P[T]=t.current,t.current=r}var re=B(null),de=B(null),ge=B(null),J=B(null);function le(t,r){switch(Z(ge,r),Z(de,t),Z(re,null),r.nodeType){case 9:case 11:t=(t=r.documentElement)&&(t=t.namespaceURI)?vy(t):0;break;default:if(t=r.tagName,r=r.namespaceURI)r=vy(r),t=by(r,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}W(re),Z(re,t)}function ve(){W(re),W(de),W(ge)}function Ne(t){t.memoizedState!==null&&Z(J,t);var r=re.current,i=by(r,t.type);r!==i&&(Z(de,t),Z(re,i))}function _e(t){de.current===t&&(W(re),W(de)),J.current===t&&(W(J),Ai._currentValue=$)}var be=Object.prototype.hasOwnProperty,Re=e.unstable_scheduleCallback,te=e.unstable_cancelCallback,Ee=e.unstable_shouldYield,Ve=e.unstable_requestPaint,Qe=e.unstable_now,It=e.unstable_getCurrentPriorityLevel,Zt=e.unstable_ImmediatePriority,ht=e.unstable_UserBlockingPriority,We=e.unstable_NormalPriority,dt=e.unstable_LowPriority,wn=e.unstable_IdlePriority,ae=e.log,ie=e.unstable_setDisableYieldValue,ue=null,me=null;function ye(t){if(typeof ae=="function"&&ie(t),me&&typeof me.setStrictMode=="function")try{me.setStrictMode(ue,t)}catch{}}var ce=Math.clz32?Math.clz32:Ke,Se=Math.log,De=Math.LN2;function Ke(t){return t>>>=0,t===0?32:31-(Se(t)/De|0)|0}var Ut=256,we=4194304;function He(t){var r=t&42;if(r!==0)return r;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 je(t,r,i){var u=t.pendingLanes;if(u===0)return 0;var h=0,x=t.suspendedLanes,C=t.pingedLanes;t=t.warmLanes;var O=u&134217727;return O!==0?(u=O&~x,u!==0?h=He(u):(C&=O,C!==0?h=He(C):i||(i=O&~t,i!==0&&(h=He(i))))):(O=u&~x,O!==0?h=He(O):C!==0?h=He(C):i||(i=u&~t,i!==0&&(h=He(i)))),h===0?0:r!==0&&r!==h&&(r&x)===0&&(x=h&-h,i=r&-r,x>=i||x===32&&(i&4194048)!==0)?r:h}function rt(t,r){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&r)===0}function ft(t,r){switch(t){case 1:case 2:case 4:case 8:case 64:return r+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 r+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 Vt(){var t=Ut;return Ut<<=1,(Ut&4194048)===0&&(Ut=256),t}function Fn(){var t=we;return we<<=1,(we&62914560)===0&&(we=4194304),t}function Ma(t){for(var r=[],i=0;31>i;i++)r.push(t);return r}function Ms(t,r){t.pendingLanes|=r,r!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function kd(t,r,i,u,h,x){var C=t.pendingLanes;t.pendingLanes=i,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=i,t.entangledLanes&=i,t.errorRecoveryDisabledLanes&=i,t.shellSuspendCounter=0;var O=t.entanglements,q=t.expirationTimes,ee=t.hiddenUpdates;for(i=C&~i;0<i;){var fe=31-ce(i),xe=1<<fe;O[fe]=0,q[fe]=-1;var se=ee[fe];if(se!==null)for(ee[fe]=null,fe=0;fe<se.length;fe++){var oe=se[fe];oe!==null&&(oe.lane&=-536870913)}i&=~xe}u!==0&&_l(t,u,0),x!==0&&h===0&&t.tag!==0&&(t.suspendedLanes|=x&~(C&~r))}function _l(t,r,i){t.pendingLanes|=r,t.suspendedLanes&=~r;var u=31-ce(r);t.entangledLanes|=r,t.entanglements[u]=t.entanglements[u]|1073741824|i&4194090}function Ta(t,r){var i=t.entangledLanes|=r;for(t=t.entanglements;i;){var u=31-ce(i),h=1<<u;h&r|t[u]&r&&(t[u]|=r),i&=~h}}function Ra(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 Da(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function El(){var t=I.p;return t!==0?t:(t=window.event,t===void 0?32:$y(t.type))}function Ad(t,r){var i=I.p;try{return I.p=t,r()}finally{I.p=i}}var Yn=Math.random().toString(36).slice(2),Rt="__reactFiber$"+Yn,qt="__reactProps$"+Yn,$r="__reactContainer$"+Yn,Oa="__reactEvents$"+Yn,Md="__reactListeners$"+Yn,Td="__reactHandles$"+Yn,Cl="__reactResources$"+Yn,Ts="__reactMarker$"+Yn;function za(t){delete t[Rt],delete t[qt],delete t[Oa],delete t[Md],delete t[Td]}function Br(t){var r=t[Rt];if(r)return r;for(var i=t.parentNode;i;){if(r=i[$r]||i[Rt]){if(i=r.alternate,r.child!==null||i!==null&&i.child!==null)for(t=jy(t);t!==null;){if(i=t[Rt])return i;t=jy(t)}return r}t=i,i=t.parentNode}return null}function dr(t){if(t=t[Rt]||t[$r]){var r=t.tag;if(r===5||r===6||r===13||r===26||r===27||r===3)return t}return null}function Pr(t){var r=t.tag;if(r===5||r===26||r===27||r===6)return t.stateNode;throw Error(o(33))}function fr(t){var r=t[Cl];return r||(r=t[Cl]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function _t(t){t[Ts]=!0}var kl=new Set,Al={};function mr(t,r){Ur(t,r),Ur(t+"Capture",r)}function Ur(t,r){for(Al[t]=r,t=0;t<r.length;t++)kl.add(r[t])}var Rd=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]*$"),Ia={},Ml={};function Dd(t){return be.call(Ml,t)?!0:be.call(Ia,t)?!1:Rd.test(t)?Ml[t]=!0:(Ia[t]=!0,!1)}function xo(t,r,i){if(Dd(r))if(i===null)t.removeAttribute(r);else{switch(typeof i){case"undefined":case"function":case"symbol":t.removeAttribute(r);return;case"boolean":var u=r.toLowerCase().slice(0,5);if(u!=="data-"&&u!=="aria-"){t.removeAttribute(r);return}}t.setAttribute(r,""+i)}}function yo(t,r,i){if(i===null)t.removeAttribute(r);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(r);return}t.setAttribute(r,""+i)}}function Rn(t,r,i,u){if(u===null)t.removeAttribute(i);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(i);return}t.setAttributeNS(r,i,""+u)}}var La,Tl;function hr(t){if(La===void 0)try{throw Error()}catch(i){var r=i.stack.trim().match(/\n( *(at )?)/);La=r&&r[1]||"",Tl=-1<i.stack.indexOf(`
    at`)?" (<anonymous>)":-1<i.stack.indexOf("@")?"@unknown:0:0":""}return`
`+La+t+Tl}var Ha=!1;function $a(t,r){if(!t||Ha)return"";Ha=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var u={DetermineComponentFrameRoot:function(){try{if(r){var xe=function(){throw Error()};if(Object.defineProperty(xe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(xe,[])}catch(oe){var se=oe}Reflect.construct(t,[],xe)}else{try{xe.call()}catch(oe){se=oe}t.call(xe.prototype)}}else{try{throw Error()}catch(oe){se=oe}(xe=t())&&typeof xe.catch=="function"&&xe.catch(function(){})}}catch(oe){if(oe&&se&&typeof oe.stack=="string")return[oe.stack,se.stack]}return[null,null]}};u.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var h=Object.getOwnPropertyDescriptor(u.DetermineComponentFrameRoot,"name");h&&h.configurable&&Object.defineProperty(u.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var x=u.DetermineComponentFrameRoot(),C=x[0],O=x[1];if(C&&O){var q=C.split(`
`),ee=O.split(`
`);for(h=u=0;u<q.length&&!q[u].includes("DetermineComponentFrameRoot");)u++;for(;h<ee.length&&!ee[h].includes("DetermineComponentFrameRoot");)h++;if(u===q.length||h===ee.length)for(u=q.length-1,h=ee.length-1;1<=u&&0<=h&&q[u]!==ee[h];)h--;for(;1<=u&&0<=h;u--,h--)if(q[u]!==ee[h]){if(u!==1||h!==1)do if(u--,h--,0>h||q[u]!==ee[h]){var fe=`
`+q[u].replace(" at new "," at ");return t.displayName&&fe.includes("<anonymous>")&&(fe=fe.replace("<anonymous>",t.displayName)),fe}while(1<=u&&0<=h);break}}}finally{Ha=!1,Error.prepareStackTrace=i}return(i=t?t.displayName||t.name:"")?hr(i):""}function Od(t){switch(t.tag){case 26:case 27:case 5:return hr(t.type);case 16:return hr("Lazy");case 13:return hr("Suspense");case 19:return hr("SuspenseList");case 0:case 15:return $a(t.type,!1);case 11:return $a(t.type.render,!1);case 1:return $a(t.type,!0);case 31:return hr("Activity");default:return""}}function Rl(t){try{var r="";do r+=Od(t),t=t.return;while(t);return r}catch(i){return`
Error generating stack: `+i.message+`
`+i.stack}}function en(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function Dl(t){var r=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function zd(t){var r=Dl(t)?"checked":"value",i=Object.getOwnPropertyDescriptor(t.constructor.prototype,r),u=""+t[r];if(!t.hasOwnProperty(r)&&typeof i<"u"&&typeof i.get=="function"&&typeof i.set=="function"){var h=i.get,x=i.set;return Object.defineProperty(t,r,{configurable:!0,get:function(){return h.call(this)},set:function(C){u=""+C,x.call(this,C)}}),Object.defineProperty(t,r,{enumerable:i.enumerable}),{getValue:function(){return u},setValue:function(C){u=""+C},stopTracking:function(){t._valueTracker=null,delete t[r]}}}}function vo(t){t._valueTracker||(t._valueTracker=zd(t))}function Ba(t){if(!t)return!1;var r=t._valueTracker;if(!r)return!0;var i=r.getValue(),u="";return t&&(u=Dl(t)?t.checked?"true":"false":t.value),t=u,t!==i?(r.setValue(t),!0):!1}function bo(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 Id=/[\n"\\]/g;function tn(t){return t.replace(Id,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function Rs(t,r,i,u,h,x,C,O){t.name="",C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"?t.type=C:t.removeAttribute("type"),r!=null?C==="number"?(r===0&&t.value===""||t.value!=r)&&(t.value=""+en(r)):t.value!==""+en(r)&&(t.value=""+en(r)):C!=="submit"&&C!=="reset"||t.removeAttribute("value"),r!=null?Pa(t,C,en(r)):i!=null?Pa(t,C,en(i)):u!=null&&t.removeAttribute("value"),h==null&&x!=null&&(t.defaultChecked=!!x),h!=null&&(t.checked=h&&typeof h!="function"&&typeof h!="symbol"),O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"?t.name=""+en(O):t.removeAttribute("name")}function Ol(t,r,i,u,h,x,C,O){if(x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(t.type=x),r!=null||i!=null){if(!(x!=="submit"&&x!=="reset"||r!=null))return;i=i!=null?""+en(i):"",r=r!=null?""+en(r):i,O||r===t.value||(t.value=r),t.defaultValue=r}u=u??h,u=typeof u!="function"&&typeof u!="symbol"&&!!u,t.checked=O?t.checked:!!u,t.defaultChecked=!!u,C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"&&(t.name=C)}function Pa(t,r,i){r==="number"&&bo(t.ownerDocument)===t||t.defaultValue===""+i||(t.defaultValue=""+i)}function pr(t,r,i,u){if(t=t.options,r){r={};for(var h=0;h<i.length;h++)r["$"+i[h]]=!0;for(i=0;i<t.length;i++)h=r.hasOwnProperty("$"+t[i].value),t[i].selected!==h&&(t[i].selected=h),h&&u&&(t[i].defaultSelected=!0)}else{for(i=""+en(i),r=null,h=0;h<t.length;h++){if(t[h].value===i){t[h].selected=!0,u&&(t[h].defaultSelected=!0);return}r!==null||t[h].disabled||(r=t[h])}r!==null&&(r.selected=!0)}}function xg(t,r,i){if(r!=null&&(r=""+en(r),r!==t.value&&(t.value=r),i==null)){t.defaultValue!==r&&(t.defaultValue=r);return}t.defaultValue=i!=null?""+en(i):""}function yg(t,r,i,u){if(r==null){if(u!=null){if(i!=null)throw Error(o(92));if(V(u)){if(1<u.length)throw Error(o(93));u=u[0]}i=u}i==null&&(i=""),r=i}i=en(r),t.defaultValue=i,u=t.textContent,u===i&&u!==""&&u!==null&&(t.value=u)}function wo(t,r){if(r){var i=t.firstChild;if(i&&i===t.lastChild&&i.nodeType===3){i.nodeValue=r;return}}t.textContent=r}var mj=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 vg(t,r,i){var u=r.indexOf("--")===0;i==null||typeof i=="boolean"||i===""?u?t.setProperty(r,""):r==="float"?t.cssFloat="":t[r]="":u?t.setProperty(r,i):typeof i!="number"||i===0||mj.has(r)?r==="float"?t.cssFloat=i:t[r]=(""+i).trim():t[r]=i+"px"}function bg(t,r,i){if(r!=null&&typeof r!="object")throw Error(o(62));if(t=t.style,i!=null){for(var u in i)!i.hasOwnProperty(u)||r!=null&&r.hasOwnProperty(u)||(u.indexOf("--")===0?t.setProperty(u,""):u==="float"?t.cssFloat="":t[u]="");for(var h in r)u=r[h],r.hasOwnProperty(h)&&i[h]!==u&&vg(t,h,u)}else for(var x in r)r.hasOwnProperty(x)&&vg(t,x,r[x])}function Ld(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 hj=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"]]),pj=/^[\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 zl(t){return pj.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}var Hd=null;function $d(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var No=null,So=null;function wg(t){var r=dr(t);if(r&&(t=r.stateNode)){var i=t[qt]||null;e:switch(t=r.stateNode,r.type){case"input":if(Rs(t,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name),r=i.name,i.type==="radio"&&r!=null){for(i=t;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll('input[name="'+tn(""+r)+'"][type="radio"]'),r=0;r<i.length;r++){var u=i[r];if(u!==t&&u.form===t.form){var h=u[qt]||null;if(!h)throw Error(o(90));Rs(u,h.value,h.defaultValue,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name)}}for(r=0;r<i.length;r++)u=i[r],u.form===t.form&&Ba(u)}break e;case"textarea":xg(t,i.value,i.defaultValue);break e;case"select":r=i.value,r!=null&&pr(t,!!i.multiple,r,!1)}}}var Bd=!1;function Ng(t,r,i){if(Bd)return t(r,i);Bd=!0;try{var u=t(r);return u}finally{if(Bd=!1,(No!==null||So!==null)&&(bc(),No&&(r=No,t=So,So=No=null,wg(r),t)))for(r=0;r<t.length;r++)wg(t[r])}}function Ua(t,r){var i=t.stateNode;if(i===null)return null;var u=i[qt]||null;if(u===null)return null;i=u[r];e:switch(r){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(u=!u.disabled)||(t=t.type,u=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!u;break e;default:t=!1}if(t)return null;if(i&&typeof i!="function")throw Error(o(231,r,typeof i));return i}var gr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Pd=!1;if(gr)try{var Va={};Object.defineProperty(Va,"passive",{get:function(){Pd=!0}}),window.addEventListener("test",Va,Va),window.removeEventListener("test",Va,Va)}catch{Pd=!1}var Vr=null,Ud=null,Il=null;function Sg(){if(Il)return Il;var t,r=Ud,i=r.length,u,h="value"in Vr?Vr.value:Vr.textContent,x=h.length;for(t=0;t<i&&r[t]===h[t];t++);var C=i-t;for(u=1;u<=C&&r[i-u]===h[x-u];u++);return Il=h.slice(t,1<u?1-u:void 0)}function Ll(t){var r=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&r===13&&(t=13)):t=r,t===10&&(t=13),32<=t||t===13?t:0}function Hl(){return!0}function jg(){return!1}function nn(t){function r(i,u,h,x,C){this._reactName=i,this._targetInst=h,this.type=u,this.nativeEvent=x,this.target=C,this.currentTarget=null;for(var O in t)t.hasOwnProperty(O)&&(i=t[O],this[O]=i?i(x):x[O]);return this.isDefaultPrevented=(x.defaultPrevented!=null?x.defaultPrevented:x.returnValue===!1)?Hl:jg,this.isPropagationStopped=jg,this}return g(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var i=this.nativeEvent;i&&(i.preventDefault?i.preventDefault():typeof i.returnValue!="unknown"&&(i.returnValue=!1),this.isDefaultPrevented=Hl)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=Hl)},persist:function(){},isPersistent:Hl}),r}var Ds={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},$l=nn(Ds),qa=g({},Ds,{view:0,detail:0}),gj=nn(qa),Vd,qd,Fa,Bl=g({},qa,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Yd,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!==Fa&&(Fa&&t.type==="mousemove"?(Vd=t.screenX-Fa.screenX,qd=t.screenY-Fa.screenY):qd=Vd=0,Fa=t),Vd)},movementY:function(t){return"movementY"in t?t.movementY:qd}}),_g=nn(Bl),xj=g({},Bl,{dataTransfer:0}),yj=nn(xj),vj=g({},qa,{relatedTarget:0}),Fd=nn(vj),bj=g({},Ds,{animationName:0,elapsedTime:0,pseudoElement:0}),wj=nn(bj),Nj=g({},Ds,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),Sj=nn(Nj),jj=g({},Ds,{data:0}),Eg=nn(jj),_j={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Ej={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"},Cj={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function kj(t){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(t):(t=Cj[t])?!!r[t]:!1}function Yd(){return kj}var Aj=g({},qa,{key:function(t){if(t.key){var r=_j[t.key]||t.key;if(r!=="Unidentified")return r}return t.type==="keypress"?(t=Ll(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?Ej[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Yd,charCode:function(t){return t.type==="keypress"?Ll(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Ll(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),Mj=nn(Aj),Tj=g({},Bl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Cg=nn(Tj),Rj=g({},qa,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Yd}),Dj=nn(Rj),Oj=g({},Ds,{propertyName:0,elapsedTime:0,pseudoElement:0}),zj=nn(Oj),Ij=g({},Bl,{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}),Lj=nn(Ij),Hj=g({},Ds,{newState:0,oldState:0}),$j=nn(Hj),Bj=[9,13,27,32],Gd=gr&&"CompositionEvent"in window,Ya=null;gr&&"documentMode"in document&&(Ya=document.documentMode);var Pj=gr&&"TextEvent"in window&&!Ya,kg=gr&&(!Gd||Ya&&8<Ya&&11>=Ya),Ag=" ",Mg=!1;function Tg(t,r){switch(t){case"keyup":return Bj.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Rg(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var jo=!1;function Uj(t,r){switch(t){case"compositionend":return Rg(r);case"keypress":return r.which!==32?null:(Mg=!0,Ag);case"textInput":return t=r.data,t===Ag&&Mg?null:t;default:return null}}function Vj(t,r){if(jo)return t==="compositionend"||!Gd&&Tg(t,r)?(t=Sg(),Il=Ud=Vr=null,jo=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(r.ctrlKey||r.altKey||r.metaKey)||r.ctrlKey&&r.altKey){if(r.char&&1<r.char.length)return r.char;if(r.which)return String.fromCharCode(r.which)}return null;case"compositionend":return kg&&r.locale!=="ko"?null:r.data;default:return null}}var qj={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 Dg(t){var r=t&&t.nodeName&&t.nodeName.toLowerCase();return r==="input"?!!qj[t.type]:r==="textarea"}function Og(t,r,i,u){No?So?So.push(u):So=[u]:No=u,r=Ec(r,"onChange"),0<r.length&&(i=new $l("onChange","change",null,i,u),t.push({event:i,listeners:r}))}var Ga=null,Xa=null;function Fj(t){hy(t,0)}function Pl(t){var r=Pr(t);if(Ba(r))return t}function zg(t,r){if(t==="change")return r}var Ig=!1;if(gr){var Xd;if(gr){var Zd="oninput"in document;if(!Zd){var Lg=document.createElement("div");Lg.setAttribute("oninput","return;"),Zd=typeof Lg.oninput=="function"}Xd=Zd}else Xd=!1;Ig=Xd&&(!document.documentMode||9<document.documentMode)}function Hg(){Ga&&(Ga.detachEvent("onpropertychange",$g),Xa=Ga=null)}function $g(t){if(t.propertyName==="value"&&Pl(Xa)){var r=[];Og(r,Xa,t,$d(t)),Ng(Fj,r)}}function Yj(t,r,i){t==="focusin"?(Hg(),Ga=r,Xa=i,Ga.attachEvent("onpropertychange",$g)):t==="focusout"&&Hg()}function Gj(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Pl(Xa)}function Xj(t,r){if(t==="click")return Pl(r)}function Zj(t,r){if(t==="input"||t==="change")return Pl(r)}function Wj(t,r){return t===r&&(t!==0||1/t===1/r)||t!==t&&r!==r}var ln=typeof Object.is=="function"?Object.is:Wj;function Za(t,r){if(ln(t,r))return!0;if(typeof t!="object"||t===null||typeof r!="object"||r===null)return!1;var i=Object.keys(t),u=Object.keys(r);if(i.length!==u.length)return!1;for(u=0;u<i.length;u++){var h=i[u];if(!be.call(r,h)||!ln(t[h],r[h]))return!1}return!0}function Bg(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function Pg(t,r){var i=Bg(t);t=0;for(var u;i;){if(i.nodeType===3){if(u=t+i.textContent.length,t<=r&&u>=r)return{node:i,offset:r-t};t=u}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=Bg(i)}}function Ug(t,r){return t&&r?t===r?!0:t&&t.nodeType===3?!1:r&&r.nodeType===3?Ug(t,r.parentNode):"contains"in t?t.contains(r):t.compareDocumentPosition?!!(t.compareDocumentPosition(r)&16):!1:!1}function Vg(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var r=bo(t.document);r instanceof t.HTMLIFrameElement;){try{var i=typeof r.contentWindow.location.href=="string"}catch{i=!1}if(i)t=r.contentWindow;else break;r=bo(t.document)}return r}function Wd(t){var r=t&&t.nodeName&&t.nodeName.toLowerCase();return r&&(r==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||r==="textarea"||t.contentEditable==="true")}var Kj=gr&&"documentMode"in document&&11>=document.documentMode,_o=null,Kd=null,Wa=null,Qd=!1;function qg(t,r,i){var u=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;Qd||_o==null||_o!==bo(u)||(u=_o,"selectionStart"in u&&Wd(u)?u={start:u.selectionStart,end:u.selectionEnd}:(u=(u.ownerDocument&&u.ownerDocument.defaultView||window).getSelection(),u={anchorNode:u.anchorNode,anchorOffset:u.anchorOffset,focusNode:u.focusNode,focusOffset:u.focusOffset}),Wa&&Za(Wa,u)||(Wa=u,u=Ec(Kd,"onSelect"),0<u.length&&(r=new $l("onSelect","select",null,r,i),t.push({event:r,listeners:u}),r.target=_o)))}function Os(t,r){var i={};return i[t.toLowerCase()]=r.toLowerCase(),i["Webkit"+t]="webkit"+r,i["Moz"+t]="moz"+r,i}var Eo={animationend:Os("Animation","AnimationEnd"),animationiteration:Os("Animation","AnimationIteration"),animationstart:Os("Animation","AnimationStart"),transitionrun:Os("Transition","TransitionRun"),transitionstart:Os("Transition","TransitionStart"),transitioncancel:Os("Transition","TransitionCancel"),transitionend:Os("Transition","TransitionEnd")},Jd={},Fg={};gr&&(Fg=document.createElement("div").style,"AnimationEvent"in window||(delete Eo.animationend.animation,delete Eo.animationiteration.animation,delete Eo.animationstart.animation),"TransitionEvent"in window||delete Eo.transitionend.transition);function zs(t){if(Jd[t])return Jd[t];if(!Eo[t])return t;var r=Eo[t],i;for(i in r)if(r.hasOwnProperty(i)&&i in Fg)return Jd[t]=r[i];return t}var Yg=zs("animationend"),Gg=zs("animationiteration"),Xg=zs("animationstart"),Qj=zs("transitionrun"),Jj=zs("transitionstart"),e_=zs("transitioncancel"),Zg=zs("transitionend"),Wg=new Map,ef="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(" ");ef.push("scrollEnd");function Dn(t,r){Wg.set(t,r),mr(r,[t])}var Kg=new WeakMap;function Nn(t,r){if(typeof t=="object"&&t!==null){var i=Kg.get(t);return i!==void 0?i:(r={value:t,source:r,stack:Rl(r)},Kg.set(t,r),r)}return{value:t,source:r,stack:Rl(r)}}var Sn=[],Co=0,tf=0;function Ul(){for(var t=Co,r=tf=Co=0;r<t;){var i=Sn[r];Sn[r++]=null;var u=Sn[r];Sn[r++]=null;var h=Sn[r];Sn[r++]=null;var x=Sn[r];if(Sn[r++]=null,u!==null&&h!==null){var C=u.pending;C===null?h.next=h:(h.next=C.next,C.next=h),u.pending=h}x!==0&&Qg(i,h,x)}}function Vl(t,r,i,u){Sn[Co++]=t,Sn[Co++]=r,Sn[Co++]=i,Sn[Co++]=u,tf|=u,t.lanes|=u,t=t.alternate,t!==null&&(t.lanes|=u)}function nf(t,r,i,u){return Vl(t,r,i,u),ql(t)}function ko(t,r){return Vl(t,null,null,r),ql(t)}function Qg(t,r,i){t.lanes|=i;var u=t.alternate;u!==null&&(u.lanes|=i);for(var h=!1,x=t.return;x!==null;)x.childLanes|=i,u=x.alternate,u!==null&&(u.childLanes|=i),x.tag===22&&(t=x.stateNode,t===null||t._visibility&1||(h=!0)),t=x,x=x.return;return t.tag===3?(x=t.stateNode,h&&r!==null&&(h=31-ce(i),t=x.hiddenUpdates,u=t[h],u===null?t[h]=[r]:u.push(r),r.lane=i|536870912),x):null}function ql(t){if(50<wi)throw wi=0,cm=null,Error(o(185));for(var r=t.return;r!==null;)t=r,r=t.return;return t.tag===3?t.stateNode:null}var Ao={};function t_(t,r,i,u){this.tag=t,this.key=i,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=r,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=u,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function cn(t,r,i,u){return new t_(t,r,i,u)}function rf(t){return t=t.prototype,!(!t||!t.isReactComponent)}function xr(t,r){var i=t.alternate;return i===null?(i=cn(t.tag,r,t.key,t.mode),i.elementType=t.elementType,i.type=t.type,i.stateNode=t.stateNode,i.alternate=t,t.alternate=i):(i.pendingProps=r,i.type=t.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=t.flags&65011712,i.childLanes=t.childLanes,i.lanes=t.lanes,i.child=t.child,i.memoizedProps=t.memoizedProps,i.memoizedState=t.memoizedState,i.updateQueue=t.updateQueue,r=t.dependencies,i.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},i.sibling=t.sibling,i.index=t.index,i.ref=t.ref,i.refCleanup=t.refCleanup,i}function Jg(t,r){t.flags&=65011714;var i=t.alternate;return i===null?(t.childLanes=0,t.lanes=r,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=i.childLanes,t.lanes=i.lanes,t.child=i.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=i.memoizedProps,t.memoizedState=i.memoizedState,t.updateQueue=i.updateQueue,t.type=i.type,r=i.dependencies,t.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),t}function Fl(t,r,i,u,h,x){var C=0;if(u=t,typeof t=="function")rf(t)&&(C=1);else if(typeof t=="string")C=rE(t,i,re.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case U:return t=cn(31,i,r,h),t.elementType=U,t.lanes=x,t;case S:return Is(i.children,h,x,r);case N:C=8,h|=24;break;case _:return t=cn(12,i,r,h|2),t.elementType=_,t.lanes=x,t;case R:return t=cn(13,i,r,h),t.elementType=R,t.lanes=x,t;case D:return t=cn(19,i,r,h),t.elementType=D,t.lanes=x,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case E:case j:C=10;break e;case M:C=9;break e;case k:C=11;break e;case z:C=14;break e;case H:C=16,u=null;break e}C=29,i=Error(o(130,t===null?"null":typeof t,"")),u=null}return r=cn(C,i,r,h),r.elementType=t,r.type=u,r.lanes=x,r}function Is(t,r,i,u){return t=cn(7,t,u,r),t.lanes=i,t}function sf(t,r,i){return t=cn(6,t,null,r),t.lanes=i,t}function of(t,r,i){return r=cn(4,t.children!==null?t.children:[],t.key,r),r.lanes=i,r.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},r}var Mo=[],To=0,Yl=null,Gl=0,jn=[],_n=0,Ls=null,yr=1,vr="";function Hs(t,r){Mo[To++]=Gl,Mo[To++]=Yl,Yl=t,Gl=r}function ex(t,r,i){jn[_n++]=yr,jn[_n++]=vr,jn[_n++]=Ls,Ls=t;var u=yr;t=vr;var h=32-ce(u)-1;u&=~(1<<h),i+=1;var x=32-ce(r)+h;if(30<x){var C=h-h%5;x=(u&(1<<C)-1).toString(32),u>>=C,h-=C,yr=1<<32-ce(r)+h|i<<h|u,vr=x+t}else yr=1<<x|i<<h|u,vr=t}function af(t){t.return!==null&&(Hs(t,1),ex(t,1,0))}function lf(t){for(;t===Yl;)Yl=Mo[--To],Mo[To]=null,Gl=Mo[--To],Mo[To]=null;for(;t===Ls;)Ls=jn[--_n],jn[_n]=null,vr=jn[--_n],jn[_n]=null,yr=jn[--_n],jn[_n]=null}var Wt=null,wt=null,ot=!1,$s=null,Gn=!1,cf=Error(o(519));function Bs(t){var r=Error(o(418,""));throw Ja(Nn(r,t)),cf}function tx(t){var r=t.stateNode,i=t.type,u=t.memoizedProps;switch(r[Rt]=t,r[qt]=u,i){case"dialog":Ze("cancel",r),Ze("close",r);break;case"iframe":case"object":case"embed":Ze("load",r);break;case"video":case"audio":for(i=0;i<Si.length;i++)Ze(Si[i],r);break;case"source":Ze("error",r);break;case"img":case"image":case"link":Ze("error",r),Ze("load",r);break;case"details":Ze("toggle",r);break;case"input":Ze("invalid",r),Ol(r,u.value,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name,!0),vo(r);break;case"select":Ze("invalid",r);break;case"textarea":Ze("invalid",r),yg(r,u.value,u.defaultValue,u.children),vo(r)}i=u.children,typeof i!="string"&&typeof i!="number"&&typeof i!="bigint"||r.textContent===""+i||u.suppressHydrationWarning===!0||yy(r.textContent,i)?(u.popover!=null&&(Ze("beforetoggle",r),Ze("toggle",r)),u.onScroll!=null&&Ze("scroll",r),u.onScrollEnd!=null&&Ze("scrollend",r),u.onClick!=null&&(r.onclick=Cc),r=!0):r=!1,r||Bs(t)}function nx(t){for(Wt=t.return;Wt;)switch(Wt.tag){case 5:case 13:Gn=!1;return;case 27:case 3:Gn=!0;return;default:Wt=Wt.return}}function Ka(t){if(t!==Wt)return!1;if(!ot)return nx(t),ot=!0,!1;var r=t.tag,i;if((i=r!==3&&r!==27)&&((i=r===5)&&(i=t.type,i=!(i!=="form"&&i!=="button")||_m(t.type,t.memoizedProps)),i=!i),i&&wt&&Bs(t),nx(t),r===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(o(317));e:{for(t=t.nextSibling,r=0;t;){if(t.nodeType===8)if(i=t.data,i==="/$"){if(r===0){wt=zn(t.nextSibling);break e}r--}else i!=="$"&&i!=="$!"&&i!=="$?"||r++;t=t.nextSibling}wt=null}}else r===27?(r=wt,os(t.type)?(t=Am,Am=null,wt=t):wt=r):wt=Wt?zn(t.stateNode.nextSibling):null;return!0}function Qa(){wt=Wt=null,ot=!1}function rx(){var t=$s;return t!==null&&(on===null?on=t:on.push.apply(on,t),$s=null),t}function Ja(t){$s===null?$s=[t]:$s.push(t)}var uf=B(null),Ps=null,br=null;function qr(t,r,i){Z(uf,r._currentValue),r._currentValue=i}function wr(t){t._currentValue=uf.current,W(uf)}function df(t,r,i){for(;t!==null;){var u=t.alternate;if((t.childLanes&r)!==r?(t.childLanes|=r,u!==null&&(u.childLanes|=r)):u!==null&&(u.childLanes&r)!==r&&(u.childLanes|=r),t===i)break;t=t.return}}function ff(t,r,i,u){var h=t.child;for(h!==null&&(h.return=t);h!==null;){var x=h.dependencies;if(x!==null){var C=h.child;x=x.firstContext;e:for(;x!==null;){var O=x;x=h;for(var q=0;q<r.length;q++)if(O.context===r[q]){x.lanes|=i,O=x.alternate,O!==null&&(O.lanes|=i),df(x.return,i,t),u||(C=null);break e}x=O.next}}else if(h.tag===18){if(C=h.return,C===null)throw Error(o(341));C.lanes|=i,x=C.alternate,x!==null&&(x.lanes|=i),df(C,i,t),C=null}else C=h.child;if(C!==null)C.return=h;else for(C=h;C!==null;){if(C===t){C=null;break}if(h=C.sibling,h!==null){h.return=C.return,C=h;break}C=C.return}h=C}}function ei(t,r,i,u){t=null;for(var h=r,x=!1;h!==null;){if(!x){if((h.flags&524288)!==0)x=!0;else if((h.flags&262144)!==0)break}if(h.tag===10){var C=h.alternate;if(C===null)throw Error(o(387));if(C=C.memoizedProps,C!==null){var O=h.type;ln(h.pendingProps.value,C.value)||(t!==null?t.push(O):t=[O])}}else if(h===J.current){if(C=h.alternate,C===null)throw Error(o(387));C.memoizedState.memoizedState!==h.memoizedState.memoizedState&&(t!==null?t.push(Ai):t=[Ai])}h=h.return}t!==null&&ff(r,t,i,u),r.flags|=262144}function Xl(t){for(t=t.firstContext;t!==null;){if(!ln(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function Us(t){Ps=t,br=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function Ft(t){return sx(Ps,t)}function Zl(t,r){return Ps===null&&Us(t),sx(t,r)}function sx(t,r){var i=r._currentValue;if(r={context:r,memoizedValue:i,next:null},br===null){if(t===null)throw Error(o(308));br=r,t.dependencies={lanes:0,firstContext:r},t.flags|=524288}else br=br.next=r;return i}var n_=typeof AbortController<"u"?AbortController:function(){var t=[],r=this.signal={aborted:!1,addEventListener:function(i,u){t.push(u)}};this.abort=function(){r.aborted=!0,t.forEach(function(i){return i()})}},r_=e.unstable_scheduleCallback,s_=e.unstable_NormalPriority,At={$$typeof:j,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function mf(){return{controller:new n_,data:new Map,refCount:0}}function ti(t){t.refCount--,t.refCount===0&&r_(s_,function(){t.controller.abort()})}var ni=null,hf=0,Ro=0,Do=null;function o_(t,r){if(ni===null){var i=ni=[];hf=0,Ro=gm(),Do={status:"pending",value:void 0,then:function(u){i.push(u)}}}return hf++,r.then(ox,ox),r}function ox(){if(--hf===0&&ni!==null){Do!==null&&(Do.status="fulfilled");var t=ni;ni=null,Ro=0,Do=null;for(var r=0;r<t.length;r++)(0,t[r])()}}function a_(t,r){var i=[],u={status:"pending",value:null,reason:null,then:function(h){i.push(h)}};return t.then(function(){u.status="fulfilled",u.value=r;for(var h=0;h<i.length;h++)(0,i[h])(r)},function(h){for(u.status="rejected",u.reason=h,h=0;h<i.length;h++)(0,i[h])(void 0)}),u}var ax=A.S;A.S=function(t,r){typeof r=="object"&&r!==null&&typeof r.then=="function"&&o_(t,r),ax!==null&&ax(t,r)};var Vs=B(null);function pf(){var t=Vs.current;return t!==null?t:pt.pooledCache}function Wl(t,r){r===null?Z(Vs,Vs.current):Z(Vs,r.pool)}function ix(){var t=pf();return t===null?null:{parent:At._currentValue,pool:t}}var ri=Error(o(460)),lx=Error(o(474)),Kl=Error(o(542)),gf={then:function(){}};function cx(t){return t=t.status,t==="fulfilled"||t==="rejected"}function Ql(){}function ux(t,r,i){switch(i=t[i],i===void 0?t.push(r):i!==r&&(r.then(Ql,Ql),r=i),r.status){case"fulfilled":return r.value;case"rejected":throw t=r.reason,fx(t),t;default:if(typeof r.status=="string")r.then(Ql,Ql);else{if(t=pt,t!==null&&100<t.shellSuspendCounter)throw Error(o(482));t=r,t.status="pending",t.then(function(u){if(r.status==="pending"){var h=r;h.status="fulfilled",h.value=u}},function(u){if(r.status==="pending"){var h=r;h.status="rejected",h.reason=u}})}switch(r.status){case"fulfilled":return r.value;case"rejected":throw t=r.reason,fx(t),t}throw si=r,ri}}var si=null;function dx(){if(si===null)throw Error(o(459));var t=si;return si=null,t}function fx(t){if(t===ri||t===Kl)throw Error(o(483))}var Fr=!1;function xf(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function yf(t,r){t=t.updateQueue,r.updateQueue===t&&(r.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function Yr(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Gr(t,r,i){var u=t.updateQueue;if(u===null)return null;if(u=u.shared,(at&2)!==0){var h=u.pending;return h===null?r.next=r:(r.next=h.next,h.next=r),u.pending=r,r=ql(t),Qg(t,null,i),r}return Vl(t,u,r,i),ql(t)}function oi(t,r,i){if(r=r.updateQueue,r!==null&&(r=r.shared,(i&4194048)!==0)){var u=r.lanes;u&=t.pendingLanes,i|=u,r.lanes=i,Ta(t,i)}}function vf(t,r){var i=t.updateQueue,u=t.alternate;if(u!==null&&(u=u.updateQueue,i===u)){var h=null,x=null;if(i=i.firstBaseUpdate,i!==null){do{var C={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};x===null?h=x=C:x=x.next=C,i=i.next}while(i!==null);x===null?h=x=r:x=x.next=r}else h=x=r;i={baseState:u.baseState,firstBaseUpdate:h,lastBaseUpdate:x,shared:u.shared,callbacks:u.callbacks},t.updateQueue=i;return}t=i.lastBaseUpdate,t===null?i.firstBaseUpdate=r:t.next=r,i.lastBaseUpdate=r}var bf=!1;function ai(){if(bf){var t=Do;if(t!==null)throw t}}function ii(t,r,i,u){bf=!1;var h=t.updateQueue;Fr=!1;var x=h.firstBaseUpdate,C=h.lastBaseUpdate,O=h.shared.pending;if(O!==null){h.shared.pending=null;var q=O,ee=q.next;q.next=null,C===null?x=ee:C.next=ee,C=q;var fe=t.alternate;fe!==null&&(fe=fe.updateQueue,O=fe.lastBaseUpdate,O!==C&&(O===null?fe.firstBaseUpdate=ee:O.next=ee,fe.lastBaseUpdate=q))}if(x!==null){var xe=h.baseState;C=0,fe=ee=q=null,O=x;do{var se=O.lane&-536870913,oe=se!==O.lane;if(oe?(et&se)===se:(u&se)===se){se!==0&&se===Ro&&(bf=!0),fe!==null&&(fe=fe.next={lane:0,tag:O.tag,payload:O.payload,callback:null,next:null});e:{var Be=t,Le=O;se=r;var ut=i;switch(Le.tag){case 1:if(Be=Le.payload,typeof Be=="function"){xe=Be.call(ut,xe,se);break e}xe=Be;break e;case 3:Be.flags=Be.flags&-65537|128;case 0:if(Be=Le.payload,se=typeof Be=="function"?Be.call(ut,xe,se):Be,se==null)break e;xe=g({},xe,se);break e;case 2:Fr=!0}}se=O.callback,se!==null&&(t.flags|=64,oe&&(t.flags|=8192),oe=h.callbacks,oe===null?h.callbacks=[se]:oe.push(se))}else oe={lane:se,tag:O.tag,payload:O.payload,callback:O.callback,next:null},fe===null?(ee=fe=oe,q=xe):fe=fe.next=oe,C|=se;if(O=O.next,O===null){if(O=h.shared.pending,O===null)break;oe=O,O=oe.next,oe.next=null,h.lastBaseUpdate=oe,h.shared.pending=null}}while(!0);fe===null&&(q=xe),h.baseState=q,h.firstBaseUpdate=ee,h.lastBaseUpdate=fe,x===null&&(h.shared.lanes=0),ts|=C,t.lanes=C,t.memoizedState=xe}}function mx(t,r){if(typeof t!="function")throw Error(o(191,t));t.call(r)}function hx(t,r){var i=t.callbacks;if(i!==null)for(t.callbacks=null,t=0;t<i.length;t++)mx(i[t],r)}var Oo=B(null),Jl=B(0);function px(t,r){t=kr,Z(Jl,t),Z(Oo,r),kr=t|r.baseLanes}function wf(){Z(Jl,kr),Z(Oo,Oo.current)}function Nf(){kr=Jl.current,W(Oo),W(Jl)}var Xr=0,qe=null,lt=null,Et=null,ec=!1,zo=!1,qs=!1,tc=0,li=0,Io=null,i_=0;function St(){throw Error(o(321))}function Sf(t,r){if(r===null)return!1;for(var i=0;i<r.length&&i<t.length;i++)if(!ln(t[i],r[i]))return!1;return!0}function jf(t,r,i,u,h,x){return Xr=x,qe=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,A.H=t===null||t.memoizedState===null?Qx:Jx,qs=!1,x=i(u,h),qs=!1,zo&&(x=xx(r,i,u,h)),gx(t),x}function gx(t){A.H=ic;var r=lt!==null&&lt.next!==null;if(Xr=0,Et=lt=qe=null,ec=!1,li=0,Io=null,r)throw Error(o(300));t===null||Dt||(t=t.dependencies,t!==null&&Xl(t)&&(Dt=!0))}function xx(t,r,i,u){qe=t;var h=0;do{if(zo&&(Io=null),li=0,zo=!1,25<=h)throw Error(o(301));if(h+=1,Et=lt=null,t.updateQueue!=null){var x=t.updateQueue;x.lastEffect=null,x.events=null,x.stores=null,x.memoCache!=null&&(x.memoCache.index=0)}A.H=h_,x=r(i,u)}while(zo);return x}function l_(){var t=A.H,r=t.useState()[0];return r=typeof r.then=="function"?ci(r):r,t=t.useState()[0],(lt!==null?lt.memoizedState:null)!==t&&(qe.flags|=1024),r}function _f(){var t=tc!==0;return tc=0,t}function Ef(t,r,i){r.updateQueue=t.updateQueue,r.flags&=-2053,t.lanes&=~i}function Cf(t){if(ec){for(t=t.memoizedState;t!==null;){var r=t.queue;r!==null&&(r.pending=null),t=t.next}ec=!1}Xr=0,Et=lt=qe=null,zo=!1,li=tc=0,Io=null}function rn(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Et===null?qe.memoizedState=Et=t:Et=Et.next=t,Et}function Ct(){if(lt===null){var t=qe.alternate;t=t!==null?t.memoizedState:null}else t=lt.next;var r=Et===null?qe.memoizedState:Et.next;if(r!==null)Et=r,lt=t;else{if(t===null)throw qe.alternate===null?Error(o(467)):Error(o(310));lt=t,t={memoizedState:lt.memoizedState,baseState:lt.baseState,baseQueue:lt.baseQueue,queue:lt.queue,next:null},Et===null?qe.memoizedState=Et=t:Et=Et.next=t}return Et}function kf(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ci(t){var r=li;return li+=1,Io===null&&(Io=[]),t=ux(Io,t,r),r=qe,(Et===null?r.memoizedState:Et.next)===null&&(r=r.alternate,A.H=r===null||r.memoizedState===null?Qx:Jx),t}function nc(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return ci(t);if(t.$$typeof===j)return Ft(t)}throw Error(o(438,String(t)))}function Af(t){var r=null,i=qe.updateQueue;if(i!==null&&(r=i.memoCache),r==null){var u=qe.alternate;u!==null&&(u=u.updateQueue,u!==null&&(u=u.memoCache,u!=null&&(r={data:u.data.map(function(h){return h.slice()}),index:0})))}if(r==null&&(r={data:[],index:0}),i===null&&(i=kf(),qe.updateQueue=i),i.memoCache=r,i=r.data[r.index],i===void 0)for(i=r.data[r.index]=Array(t),u=0;u<t;u++)i[u]=F;return r.index++,i}function Nr(t,r){return typeof r=="function"?r(t):r}function rc(t){var r=Ct();return Mf(r,lt,t)}function Mf(t,r,i){var u=t.queue;if(u===null)throw Error(o(311));u.lastRenderedReducer=i;var h=t.baseQueue,x=u.pending;if(x!==null){if(h!==null){var C=h.next;h.next=x.next,x.next=C}r.baseQueue=h=x,u.pending=null}if(x=t.baseState,h===null)t.memoizedState=x;else{r=h.next;var O=C=null,q=null,ee=r,fe=!1;do{var xe=ee.lane&-536870913;if(xe!==ee.lane?(et&xe)===xe:(Xr&xe)===xe){var se=ee.revertLane;if(se===0)q!==null&&(q=q.next={lane:0,revertLane:0,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null}),xe===Ro&&(fe=!0);else if((Xr&se)===se){ee=ee.next,se===Ro&&(fe=!0);continue}else xe={lane:0,revertLane:ee.revertLane,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null},q===null?(O=q=xe,C=x):q=q.next=xe,qe.lanes|=se,ts|=se;xe=ee.action,qs&&i(x,xe),x=ee.hasEagerState?ee.eagerState:i(x,xe)}else se={lane:xe,revertLane:ee.revertLane,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null},q===null?(O=q=se,C=x):q=q.next=se,qe.lanes|=xe,ts|=xe;ee=ee.next}while(ee!==null&&ee!==r);if(q===null?C=x:q.next=O,!ln(x,t.memoizedState)&&(Dt=!0,fe&&(i=Do,i!==null)))throw i;t.memoizedState=x,t.baseState=C,t.baseQueue=q,u.lastRenderedState=x}return h===null&&(u.lanes=0),[t.memoizedState,u.dispatch]}function Tf(t){var r=Ct(),i=r.queue;if(i===null)throw Error(o(311));i.lastRenderedReducer=t;var u=i.dispatch,h=i.pending,x=r.memoizedState;if(h!==null){i.pending=null;var C=h=h.next;do x=t(x,C.action),C=C.next;while(C!==h);ln(x,r.memoizedState)||(Dt=!0),r.memoizedState=x,r.baseQueue===null&&(r.baseState=x),i.lastRenderedState=x}return[x,u]}function yx(t,r,i){var u=qe,h=Ct(),x=ot;if(x){if(i===void 0)throw Error(o(407));i=i()}else i=r();var C=!ln((lt||h).memoizedState,i);C&&(h.memoizedState=i,Dt=!0),h=h.queue;var O=wx.bind(null,u,h,t);if(ui(2048,8,O,[t]),h.getSnapshot!==r||C||Et!==null&&Et.memoizedState.tag&1){if(u.flags|=2048,Lo(9,sc(),bx.bind(null,u,h,i,r),null),pt===null)throw Error(o(349));x||(Xr&124)!==0||vx(u,r,i)}return i}function vx(t,r,i){t.flags|=16384,t={getSnapshot:r,value:i},r=qe.updateQueue,r===null?(r=kf(),qe.updateQueue=r,r.stores=[t]):(i=r.stores,i===null?r.stores=[t]:i.push(t))}function bx(t,r,i,u){r.value=i,r.getSnapshot=u,Nx(r)&&Sx(t)}function wx(t,r,i){return i(function(){Nx(r)&&Sx(t)})}function Nx(t){var r=t.getSnapshot;t=t.value;try{var i=r();return!ln(t,i)}catch{return!0}}function Sx(t){var r=ko(t,2);r!==null&&hn(r,t,2)}function Rf(t){var r=rn();if(typeof t=="function"){var i=t;if(t=i(),qs){ye(!0);try{i()}finally{ye(!1)}}}return r.memoizedState=r.baseState=t,r.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Nr,lastRenderedState:t},r}function jx(t,r,i,u){return t.baseState=i,Mf(t,lt,typeof u=="function"?u:Nr)}function c_(t,r,i,u,h){if(ac(t))throw Error(o(485));if(t=r.action,t!==null){var x={payload:h,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(C){x.listeners.push(C)}};A.T!==null?i(!0):x.isTransition=!1,u(x),i=r.pending,i===null?(x.next=r.pending=x,_x(r,x)):(x.next=i.next,r.pending=i.next=x)}}function _x(t,r){var i=r.action,u=r.payload,h=t.state;if(r.isTransition){var x=A.T,C={};A.T=C;try{var O=i(h,u),q=A.S;q!==null&&q(C,O),Ex(t,r,O)}catch(ee){Df(t,r,ee)}finally{A.T=x}}else try{x=i(h,u),Ex(t,r,x)}catch(ee){Df(t,r,ee)}}function Ex(t,r,i){i!==null&&typeof i=="object"&&typeof i.then=="function"?i.then(function(u){Cx(t,r,u)},function(u){return Df(t,r,u)}):Cx(t,r,i)}function Cx(t,r,i){r.status="fulfilled",r.value=i,kx(r),t.state=i,r=t.pending,r!==null&&(i=r.next,i===r?t.pending=null:(i=i.next,r.next=i,_x(t,i)))}function Df(t,r,i){var u=t.pending;if(t.pending=null,u!==null){u=u.next;do r.status="rejected",r.reason=i,kx(r),r=r.next;while(r!==u)}t.action=null}function kx(t){t=t.listeners;for(var r=0;r<t.length;r++)(0,t[r])()}function Ax(t,r){return r}function Mx(t,r){if(ot){var i=pt.formState;if(i!==null){e:{var u=qe;if(ot){if(wt){t:{for(var h=wt,x=Gn;h.nodeType!==8;){if(!x){h=null;break t}if(h=zn(h.nextSibling),h===null){h=null;break t}}x=h.data,h=x==="F!"||x==="F"?h:null}if(h){wt=zn(h.nextSibling),u=h.data==="F!";break e}}Bs(u)}u=!1}u&&(r=i[0])}}return i=rn(),i.memoizedState=i.baseState=r,u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ax,lastRenderedState:r},i.queue=u,i=Zx.bind(null,qe,u),u.dispatch=i,u=Rf(!1),x=Hf.bind(null,qe,!1,u.queue),u=rn(),h={state:r,dispatch:null,action:t,pending:null},u.queue=h,i=c_.bind(null,qe,h,x,i),h.dispatch=i,u.memoizedState=t,[r,i,!1]}function Tx(t){var r=Ct();return Rx(r,lt,t)}function Rx(t,r,i){if(r=Mf(t,r,Ax)[0],t=rc(Nr)[0],typeof r=="object"&&r!==null&&typeof r.then=="function")try{var u=ci(r)}catch(C){throw C===ri?Kl:C}else u=r;r=Ct();var h=r.queue,x=h.dispatch;return i!==r.memoizedState&&(qe.flags|=2048,Lo(9,sc(),u_.bind(null,h,i),null)),[u,x,t]}function u_(t,r){t.action=r}function Dx(t){var r=Ct(),i=lt;if(i!==null)return Rx(r,i,t);Ct(),r=r.memoizedState,i=Ct();var u=i.queue.dispatch;return i.memoizedState=t,[r,u,!1]}function Lo(t,r,i,u){return t={tag:t,create:i,deps:u,inst:r,next:null},r=qe.updateQueue,r===null&&(r=kf(),qe.updateQueue=r),i=r.lastEffect,i===null?r.lastEffect=t.next=t:(u=i.next,i.next=t,t.next=u,r.lastEffect=t),t}function sc(){return{destroy:void 0,resource:void 0}}function Ox(){return Ct().memoizedState}function oc(t,r,i,u){var h=rn();u=u===void 0?null:u,qe.flags|=t,h.memoizedState=Lo(1|r,sc(),i,u)}function ui(t,r,i,u){var h=Ct();u=u===void 0?null:u;var x=h.memoizedState.inst;lt!==null&&u!==null&&Sf(u,lt.memoizedState.deps)?h.memoizedState=Lo(r,x,i,u):(qe.flags|=t,h.memoizedState=Lo(1|r,x,i,u))}function zx(t,r){oc(8390656,8,t,r)}function Ix(t,r){ui(2048,8,t,r)}function Lx(t,r){return ui(4,2,t,r)}function Hx(t,r){return ui(4,4,t,r)}function $x(t,r){if(typeof r=="function"){t=t();var i=r(t);return function(){typeof i=="function"?i():r(null)}}if(r!=null)return t=t(),r.current=t,function(){r.current=null}}function Bx(t,r,i){i=i!=null?i.concat([t]):null,ui(4,4,$x.bind(null,r,t),i)}function Of(){}function Px(t,r){var i=Ct();r=r===void 0?null:r;var u=i.memoizedState;return r!==null&&Sf(r,u[1])?u[0]:(i.memoizedState=[t,r],t)}function Ux(t,r){var i=Ct();r=r===void 0?null:r;var u=i.memoizedState;if(r!==null&&Sf(r,u[1]))return u[0];if(u=t(),qs){ye(!0);try{t()}finally{ye(!1)}}return i.memoizedState=[u,r],u}function zf(t,r,i){return i===void 0||(Xr&1073741824)!==0?t.memoizedState=r:(t.memoizedState=i,t=F0(),qe.lanes|=t,ts|=t,i)}function Vx(t,r,i,u){return ln(i,r)?i:Oo.current!==null?(t=zf(t,i,u),ln(t,r)||(Dt=!0),t):(Xr&42)===0?(Dt=!0,t.memoizedState=i):(t=F0(),qe.lanes|=t,ts|=t,r)}function qx(t,r,i,u,h){var x=I.p;I.p=x!==0&&8>x?x:8;var C=A.T,O={};A.T=O,Hf(t,!1,r,i);try{var q=h(),ee=A.S;if(ee!==null&&ee(O,q),q!==null&&typeof q=="object"&&typeof q.then=="function"){var fe=a_(q,u);di(t,r,fe,mn(t))}else di(t,r,u,mn(t))}catch(xe){di(t,r,{then:function(){},status:"rejected",reason:xe},mn())}finally{I.p=x,A.T=C}}function d_(){}function If(t,r,i,u){if(t.tag!==5)throw Error(o(476));var h=Fx(t).queue;qx(t,h,r,$,i===null?d_:function(){return Yx(t),i(u)})}function Fx(t){var r=t.memoizedState;if(r!==null)return r;r={memoizedState:$,baseState:$,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Nr,lastRenderedState:$},next:null};var i={};return r.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Nr,lastRenderedState:i},next:null},t.memoizedState=r,t=t.alternate,t!==null&&(t.memoizedState=r),r}function Yx(t){var r=Fx(t).next.queue;di(t,r,{},mn())}function Lf(){return Ft(Ai)}function Gx(){return Ct().memoizedState}function Xx(){return Ct().memoizedState}function f_(t){for(var r=t.return;r!==null;){switch(r.tag){case 24:case 3:var i=mn();t=Yr(i);var u=Gr(r,t,i);u!==null&&(hn(u,r,i),oi(u,r,i)),r={cache:mf()},t.payload=r;return}r=r.return}}function m_(t,r,i){var u=mn();i={lane:u,revertLane:0,action:i,hasEagerState:!1,eagerState:null,next:null},ac(t)?Wx(r,i):(i=nf(t,r,i,u),i!==null&&(hn(i,t,u),Kx(i,r,u)))}function Zx(t,r,i){var u=mn();di(t,r,i,u)}function di(t,r,i,u){var h={lane:u,revertLane:0,action:i,hasEagerState:!1,eagerState:null,next:null};if(ac(t))Wx(r,h);else{var x=t.alternate;if(t.lanes===0&&(x===null||x.lanes===0)&&(x=r.lastRenderedReducer,x!==null))try{var C=r.lastRenderedState,O=x(C,i);if(h.hasEagerState=!0,h.eagerState=O,ln(O,C))return Vl(t,r,h,0),pt===null&&Ul(),!1}catch{}finally{}if(i=nf(t,r,h,u),i!==null)return hn(i,t,u),Kx(i,r,u),!0}return!1}function Hf(t,r,i,u){if(u={lane:2,revertLane:gm(),action:u,hasEagerState:!1,eagerState:null,next:null},ac(t)){if(r)throw Error(o(479))}else r=nf(t,i,u,2),r!==null&&hn(r,t,2)}function ac(t){var r=t.alternate;return t===qe||r!==null&&r===qe}function Wx(t,r){zo=ec=!0;var i=t.pending;i===null?r.next=r:(r.next=i.next,i.next=r),t.pending=r}function Kx(t,r,i){if((i&4194048)!==0){var u=r.lanes;u&=t.pendingLanes,i|=u,r.lanes=i,Ta(t,i)}}var ic={readContext:Ft,use:nc,useCallback:St,useContext:St,useEffect:St,useImperativeHandle:St,useLayoutEffect:St,useInsertionEffect:St,useMemo:St,useReducer:St,useRef:St,useState:St,useDebugValue:St,useDeferredValue:St,useTransition:St,useSyncExternalStore:St,useId:St,useHostTransitionStatus:St,useFormState:St,useActionState:St,useOptimistic:St,useMemoCache:St,useCacheRefresh:St},Qx={readContext:Ft,use:nc,useCallback:function(t,r){return rn().memoizedState=[t,r===void 0?null:r],t},useContext:Ft,useEffect:zx,useImperativeHandle:function(t,r,i){i=i!=null?i.concat([t]):null,oc(4194308,4,$x.bind(null,r,t),i)},useLayoutEffect:function(t,r){return oc(4194308,4,t,r)},useInsertionEffect:function(t,r){oc(4,2,t,r)},useMemo:function(t,r){var i=rn();r=r===void 0?null:r;var u=t();if(qs){ye(!0);try{t()}finally{ye(!1)}}return i.memoizedState=[u,r],u},useReducer:function(t,r,i){var u=rn();if(i!==void 0){var h=i(r);if(qs){ye(!0);try{i(r)}finally{ye(!1)}}}else h=r;return u.memoizedState=u.baseState=h,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:h},u.queue=t,t=t.dispatch=m_.bind(null,qe,t),[u.memoizedState,t]},useRef:function(t){var r=rn();return t={current:t},r.memoizedState=t},useState:function(t){t=Rf(t);var r=t.queue,i=Zx.bind(null,qe,r);return r.dispatch=i,[t.memoizedState,i]},useDebugValue:Of,useDeferredValue:function(t,r){var i=rn();return zf(i,t,r)},useTransition:function(){var t=Rf(!1);return t=qx.bind(null,qe,t.queue,!0,!1),rn().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,r,i){var u=qe,h=rn();if(ot){if(i===void 0)throw Error(o(407));i=i()}else{if(i=r(),pt===null)throw Error(o(349));(et&124)!==0||vx(u,r,i)}h.memoizedState=i;var x={value:i,getSnapshot:r};return h.queue=x,zx(wx.bind(null,u,x,t),[t]),u.flags|=2048,Lo(9,sc(),bx.bind(null,u,x,i,r),null),i},useId:function(){var t=rn(),r=pt.identifierPrefix;if(ot){var i=vr,u=yr;i=(u&~(1<<32-ce(u)-1)).toString(32)+i,r="«"+r+"R"+i,i=tc++,0<i&&(r+="H"+i.toString(32)),r+="»"}else i=i_++,r="«"+r+"r"+i.toString(32)+"»";return t.memoizedState=r},useHostTransitionStatus:Lf,useFormState:Mx,useActionState:Mx,useOptimistic:function(t){var r=rn();r.memoizedState=r.baseState=t;var i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return r.queue=i,r=Hf.bind(null,qe,!0,i),i.dispatch=r,[t,r]},useMemoCache:Af,useCacheRefresh:function(){return rn().memoizedState=f_.bind(null,qe)}},Jx={readContext:Ft,use:nc,useCallback:Px,useContext:Ft,useEffect:Ix,useImperativeHandle:Bx,useInsertionEffect:Lx,useLayoutEffect:Hx,useMemo:Ux,useReducer:rc,useRef:Ox,useState:function(){return rc(Nr)},useDebugValue:Of,useDeferredValue:function(t,r){var i=Ct();return Vx(i,lt.memoizedState,t,r)},useTransition:function(){var t=rc(Nr)[0],r=Ct().memoizedState;return[typeof t=="boolean"?t:ci(t),r]},useSyncExternalStore:yx,useId:Gx,useHostTransitionStatus:Lf,useFormState:Tx,useActionState:Tx,useOptimistic:function(t,r){var i=Ct();return jx(i,lt,t,r)},useMemoCache:Af,useCacheRefresh:Xx},h_={readContext:Ft,use:nc,useCallback:Px,useContext:Ft,useEffect:Ix,useImperativeHandle:Bx,useInsertionEffect:Lx,useLayoutEffect:Hx,useMemo:Ux,useReducer:Tf,useRef:Ox,useState:function(){return Tf(Nr)},useDebugValue:Of,useDeferredValue:function(t,r){var i=Ct();return lt===null?zf(i,t,r):Vx(i,lt.memoizedState,t,r)},useTransition:function(){var t=Tf(Nr)[0],r=Ct().memoizedState;return[typeof t=="boolean"?t:ci(t),r]},useSyncExternalStore:yx,useId:Gx,useHostTransitionStatus:Lf,useFormState:Dx,useActionState:Dx,useOptimistic:function(t,r){var i=Ct();return lt!==null?jx(i,lt,t,r):(i.baseState=t,[t,i.queue.dispatch])},useMemoCache:Af,useCacheRefresh:Xx},Ho=null,fi=0;function lc(t){var r=fi;return fi+=1,Ho===null&&(Ho=[]),ux(Ho,t,r)}function mi(t,r){r=r.props.ref,t.ref=r!==void 0?r:null}function cc(t,r){throw r.$$typeof===v?Error(o(525)):(t=Object.prototype.toString.call(r),Error(o(31,t==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":t)))}function e0(t){var r=t._init;return r(t._payload)}function t0(t){function r(X,Y){if(t){var Q=X.deletions;Q===null?(X.deletions=[Y],X.flags|=16):Q.push(Y)}}function i(X,Y){if(!t)return null;for(;Y!==null;)r(X,Y),Y=Y.sibling;return null}function u(X){for(var Y=new Map;X!==null;)X.key!==null?Y.set(X.key,X):Y.set(X.index,X),X=X.sibling;return Y}function h(X,Y){return X=xr(X,Y),X.index=0,X.sibling=null,X}function x(X,Y,Q){return X.index=Q,t?(Q=X.alternate,Q!==null?(Q=Q.index,Q<Y?(X.flags|=67108866,Y):Q):(X.flags|=67108866,Y)):(X.flags|=1048576,Y)}function C(X){return t&&X.alternate===null&&(X.flags|=67108866),X}function O(X,Y,Q,he){return Y===null||Y.tag!==6?(Y=sf(Q,X.mode,he),Y.return=X,Y):(Y=h(Y,Q),Y.return=X,Y)}function q(X,Y,Q,he){var ke=Q.type;return ke===S?fe(X,Y,Q.props.children,he,Q.key):Y!==null&&(Y.elementType===ke||typeof ke=="object"&&ke!==null&&ke.$$typeof===H&&e0(ke)===Y.type)?(Y=h(Y,Q.props),mi(Y,Q),Y.return=X,Y):(Y=Fl(Q.type,Q.key,Q.props,null,X.mode,he),mi(Y,Q),Y.return=X,Y)}function ee(X,Y,Q,he){return Y===null||Y.tag!==4||Y.stateNode.containerInfo!==Q.containerInfo||Y.stateNode.implementation!==Q.implementation?(Y=of(Q,X.mode,he),Y.return=X,Y):(Y=h(Y,Q.children||[]),Y.return=X,Y)}function fe(X,Y,Q,he,ke){return Y===null||Y.tag!==7?(Y=Is(Q,X.mode,he,ke),Y.return=X,Y):(Y=h(Y,Q),Y.return=X,Y)}function xe(X,Y,Q){if(typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint")return Y=sf(""+Y,X.mode,Q),Y.return=X,Y;if(typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case y:return Q=Fl(Y.type,Y.key,Y.props,null,X.mode,Q),mi(Q,Y),Q.return=X,Q;case b:return Y=of(Y,X.mode,Q),Y.return=X,Y;case H:var he=Y._init;return Y=he(Y._payload),xe(X,Y,Q)}if(V(Y)||G(Y))return Y=Is(Y,X.mode,Q,null),Y.return=X,Y;if(typeof Y.then=="function")return xe(X,lc(Y),Q);if(Y.$$typeof===j)return xe(X,Zl(X,Y),Q);cc(X,Y)}return null}function se(X,Y,Q,he){var ke=Y!==null?Y.key:null;if(typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint")return ke!==null?null:O(X,Y,""+Q,he);if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case y:return Q.key===ke?q(X,Y,Q,he):null;case b:return Q.key===ke?ee(X,Y,Q,he):null;case H:return ke=Q._init,Q=ke(Q._payload),se(X,Y,Q,he)}if(V(Q)||G(Q))return ke!==null?null:fe(X,Y,Q,he,null);if(typeof Q.then=="function")return se(X,Y,lc(Q),he);if(Q.$$typeof===j)return se(X,Y,Zl(X,Q),he);cc(X,Q)}return null}function oe(X,Y,Q,he,ke){if(typeof he=="string"&&he!==""||typeof he=="number"||typeof he=="bigint")return X=X.get(Q)||null,O(Y,X,""+he,ke);if(typeof he=="object"&&he!==null){switch(he.$$typeof){case y:return X=X.get(he.key===null?Q:he.key)||null,q(Y,X,he,ke);case b:return X=X.get(he.key===null?Q:he.key)||null,ee(Y,X,he,ke);case H:var Ye=he._init;return he=Ye(he._payload),oe(X,Y,Q,he,ke)}if(V(he)||G(he))return X=X.get(Q)||null,fe(Y,X,he,ke,null);if(typeof he.then=="function")return oe(X,Y,Q,lc(he),ke);if(he.$$typeof===j)return oe(X,Y,Q,Zl(Y,he),ke);cc(Y,he)}return null}function Be(X,Y,Q,he){for(var ke=null,Ye=null,ze=Y,$e=Y=0,zt=null;ze!==null&&$e<Q.length;$e++){ze.index>$e?(zt=ze,ze=null):zt=ze.sibling;var st=se(X,ze,Q[$e],he);if(st===null){ze===null&&(ze=zt);break}t&&ze&&st.alternate===null&&r(X,ze),Y=x(st,Y,$e),Ye===null?ke=st:Ye.sibling=st,Ye=st,ze=zt}if($e===Q.length)return i(X,ze),ot&&Hs(X,$e),ke;if(ze===null){for(;$e<Q.length;$e++)ze=xe(X,Q[$e],he),ze!==null&&(Y=x(ze,Y,$e),Ye===null?ke=ze:Ye.sibling=ze,Ye=ze);return ot&&Hs(X,$e),ke}for(ze=u(ze);$e<Q.length;$e++)zt=oe(ze,X,$e,Q[$e],he),zt!==null&&(t&&zt.alternate!==null&&ze.delete(zt.key===null?$e:zt.key),Y=x(zt,Y,$e),Ye===null?ke=zt:Ye.sibling=zt,Ye=zt);return t&&ze.forEach(function(us){return r(X,us)}),ot&&Hs(X,$e),ke}function Le(X,Y,Q,he){if(Q==null)throw Error(o(151));for(var ke=null,Ye=null,ze=Y,$e=Y=0,zt=null,st=Q.next();ze!==null&&!st.done;$e++,st=Q.next()){ze.index>$e?(zt=ze,ze=null):zt=ze.sibling;var us=se(X,ze,st.value,he);if(us===null){ze===null&&(ze=zt);break}t&&ze&&us.alternate===null&&r(X,ze),Y=x(us,Y,$e),Ye===null?ke=us:Ye.sibling=us,Ye=us,ze=zt}if(st.done)return i(X,ze),ot&&Hs(X,$e),ke;if(ze===null){for(;!st.done;$e++,st=Q.next())st=xe(X,st.value,he),st!==null&&(Y=x(st,Y,$e),Ye===null?ke=st:Ye.sibling=st,Ye=st);return ot&&Hs(X,$e),ke}for(ze=u(ze);!st.done;$e++,st=Q.next())st=oe(ze,X,$e,st.value,he),st!==null&&(t&&st.alternate!==null&&ze.delete(st.key===null?$e:st.key),Y=x(st,Y,$e),Ye===null?ke=st:Ye.sibling=st,Ye=st);return t&&ze.forEach(function(pE){return r(X,pE)}),ot&&Hs(X,$e),ke}function ut(X,Y,Q,he){if(typeof Q=="object"&&Q!==null&&Q.type===S&&Q.key===null&&(Q=Q.props.children),typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case y:e:{for(var ke=Q.key;Y!==null;){if(Y.key===ke){if(ke=Q.type,ke===S){if(Y.tag===7){i(X,Y.sibling),he=h(Y,Q.props.children),he.return=X,X=he;break e}}else if(Y.elementType===ke||typeof ke=="object"&&ke!==null&&ke.$$typeof===H&&e0(ke)===Y.type){i(X,Y.sibling),he=h(Y,Q.props),mi(he,Q),he.return=X,X=he;break e}i(X,Y);break}else r(X,Y);Y=Y.sibling}Q.type===S?(he=Is(Q.props.children,X.mode,he,Q.key),he.return=X,X=he):(he=Fl(Q.type,Q.key,Q.props,null,X.mode,he),mi(he,Q),he.return=X,X=he)}return C(X);case b:e:{for(ke=Q.key;Y!==null;){if(Y.key===ke)if(Y.tag===4&&Y.stateNode.containerInfo===Q.containerInfo&&Y.stateNode.implementation===Q.implementation){i(X,Y.sibling),he=h(Y,Q.children||[]),he.return=X,X=he;break e}else{i(X,Y);break}else r(X,Y);Y=Y.sibling}he=of(Q,X.mode,he),he.return=X,X=he}return C(X);case H:return ke=Q._init,Q=ke(Q._payload),ut(X,Y,Q,he)}if(V(Q))return Be(X,Y,Q,he);if(G(Q)){if(ke=G(Q),typeof ke!="function")throw Error(o(150));return Q=ke.call(Q),Le(X,Y,Q,he)}if(typeof Q.then=="function")return ut(X,Y,lc(Q),he);if(Q.$$typeof===j)return ut(X,Y,Zl(X,Q),he);cc(X,Q)}return typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint"?(Q=""+Q,Y!==null&&Y.tag===6?(i(X,Y.sibling),he=h(Y,Q),he.return=X,X=he):(i(X,Y),he=sf(Q,X.mode,he),he.return=X,X=he),C(X)):i(X,Y)}return function(X,Y,Q,he){try{fi=0;var ke=ut(X,Y,Q,he);return Ho=null,ke}catch(ze){if(ze===ri||ze===Kl)throw ze;var Ye=cn(29,ze,null,X.mode);return Ye.lanes=he,Ye.return=X,Ye}finally{}}}var $o=t0(!0),n0=t0(!1),En=B(null),Xn=null;function Zr(t){var r=t.alternate;Z(Mt,Mt.current&1),Z(En,t),Xn===null&&(r===null||Oo.current!==null||r.memoizedState!==null)&&(Xn=t)}function r0(t){if(t.tag===22){if(Z(Mt,Mt.current),Z(En,t),Xn===null){var r=t.alternate;r!==null&&r.memoizedState!==null&&(Xn=t)}}else Wr()}function Wr(){Z(Mt,Mt.current),Z(En,En.current)}function Sr(t){W(En),Xn===t&&(Xn=null),W(Mt)}var Mt=B(0);function uc(t){for(var r=t;r!==null;){if(r.tag===13){var i=r.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||i.data==="$?"||km(i)))return r}else if(r.tag===19&&r.memoizedProps.revealOrder!==void 0){if((r.flags&128)!==0)return r}else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}function $f(t,r,i,u){r=t.memoizedState,i=i(u,r),i=i==null?r:g({},r,i),t.memoizedState=i,t.lanes===0&&(t.updateQueue.baseState=i)}var Bf={enqueueSetState:function(t,r,i){t=t._reactInternals;var u=mn(),h=Yr(u);h.payload=r,i!=null&&(h.callback=i),r=Gr(t,h,u),r!==null&&(hn(r,t,u),oi(r,t,u))},enqueueReplaceState:function(t,r,i){t=t._reactInternals;var u=mn(),h=Yr(u);h.tag=1,h.payload=r,i!=null&&(h.callback=i),r=Gr(t,h,u),r!==null&&(hn(r,t,u),oi(r,t,u))},enqueueForceUpdate:function(t,r){t=t._reactInternals;var i=mn(),u=Yr(i);u.tag=2,r!=null&&(u.callback=r),r=Gr(t,u,i),r!==null&&(hn(r,t,i),oi(r,t,i))}};function s0(t,r,i,u,h,x,C){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(u,x,C):r.prototype&&r.prototype.isPureReactComponent?!Za(i,u)||!Za(h,x):!0}function o0(t,r,i,u){t=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(i,u),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(i,u),r.state!==t&&Bf.enqueueReplaceState(r,r.state,null)}function Fs(t,r){var i=r;if("ref"in r){i={};for(var u in r)u!=="ref"&&(i[u]=r[u])}if(t=t.defaultProps){i===r&&(i=g({},i));for(var h in t)i[h]===void 0&&(i[h]=t[h])}return i}var dc=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var r=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(r))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)};function a0(t){dc(t)}function i0(t){console.error(t)}function l0(t){dc(t)}function fc(t,r){try{var i=t.onUncaughtError;i(r.value,{componentStack:r.stack})}catch(u){setTimeout(function(){throw u})}}function c0(t,r,i){try{var u=t.onCaughtError;u(i.value,{componentStack:i.stack,errorBoundary:r.tag===1?r.stateNode:null})}catch(h){setTimeout(function(){throw h})}}function Pf(t,r,i){return i=Yr(i),i.tag=3,i.payload={element:null},i.callback=function(){fc(t,r)},i}function u0(t){return t=Yr(t),t.tag=3,t}function d0(t,r,i,u){var h=i.type.getDerivedStateFromError;if(typeof h=="function"){var x=u.value;t.payload=function(){return h(x)},t.callback=function(){c0(r,i,u)}}var C=i.stateNode;C!==null&&typeof C.componentDidCatch=="function"&&(t.callback=function(){c0(r,i,u),typeof h!="function"&&(ns===null?ns=new Set([this]):ns.add(this));var O=u.stack;this.componentDidCatch(u.value,{componentStack:O!==null?O:""})})}function p_(t,r,i,u,h){if(i.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){if(r=i.alternate,r!==null&&ei(r,i,h,!0),i=En.current,i!==null){switch(i.tag){case 13:return Xn===null?dm():i.alternate===null&&Nt===0&&(Nt=3),i.flags&=-257,i.flags|=65536,i.lanes=h,u===gf?i.flags|=16384:(r=i.updateQueue,r===null?i.updateQueue=new Set([u]):r.add(u),mm(t,u,h)),!1;case 22:return i.flags|=65536,u===gf?i.flags|=16384:(r=i.updateQueue,r===null?(r={transitions:null,markerInstances:null,retryQueue:new Set([u])},i.updateQueue=r):(i=r.retryQueue,i===null?r.retryQueue=new Set([u]):i.add(u)),mm(t,u,h)),!1}throw Error(o(435,i.tag))}return mm(t,u,h),dm(),!1}if(ot)return r=En.current,r!==null?((r.flags&65536)===0&&(r.flags|=256),r.flags|=65536,r.lanes=h,u!==cf&&(t=Error(o(422),{cause:u}),Ja(Nn(t,i)))):(u!==cf&&(r=Error(o(423),{cause:u}),Ja(Nn(r,i))),t=t.current.alternate,t.flags|=65536,h&=-h,t.lanes|=h,u=Nn(u,i),h=Pf(t.stateNode,u,h),vf(t,h),Nt!==4&&(Nt=2)),!1;var x=Error(o(520),{cause:u});if(x=Nn(x,i),bi===null?bi=[x]:bi.push(x),Nt!==4&&(Nt=2),r===null)return!0;u=Nn(u,i),i=r;do{switch(i.tag){case 3:return i.flags|=65536,t=h&-h,i.lanes|=t,t=Pf(i.stateNode,u,t),vf(i,t),!1;case 1:if(r=i.type,x=i.stateNode,(i.flags&128)===0&&(typeof r.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(ns===null||!ns.has(x))))return i.flags|=65536,h&=-h,i.lanes|=h,h=u0(h),d0(h,t,i,u),vf(i,h),!1}i=i.return}while(i!==null);return!1}var f0=Error(o(461)),Dt=!1;function Lt(t,r,i,u){r.child=t===null?n0(r,null,i,u):$o(r,t.child,i,u)}function m0(t,r,i,u,h){i=i.render;var x=r.ref;if("ref"in u){var C={};for(var O in u)O!=="ref"&&(C[O]=u[O])}else C=u;return Us(r),u=jf(t,r,i,C,x,h),O=_f(),t!==null&&!Dt?(Ef(t,r,h),jr(t,r,h)):(ot&&O&&af(r),r.flags|=1,Lt(t,r,u,h),r.child)}function h0(t,r,i,u,h){if(t===null){var x=i.type;return typeof x=="function"&&!rf(x)&&x.defaultProps===void 0&&i.compare===null?(r.tag=15,r.type=x,p0(t,r,x,u,h)):(t=Fl(i.type,null,u,r,r.mode,h),t.ref=r.ref,t.return=r,r.child=t)}if(x=t.child,!Zf(t,h)){var C=x.memoizedProps;if(i=i.compare,i=i!==null?i:Za,i(C,u)&&t.ref===r.ref)return jr(t,r,h)}return r.flags|=1,t=xr(x,u),t.ref=r.ref,t.return=r,r.child=t}function p0(t,r,i,u,h){if(t!==null){var x=t.memoizedProps;if(Za(x,u)&&t.ref===r.ref)if(Dt=!1,r.pendingProps=u=x,Zf(t,h))(t.flags&131072)!==0&&(Dt=!0);else return r.lanes=t.lanes,jr(t,r,h)}return Uf(t,r,i,u,h)}function g0(t,r,i){var u=r.pendingProps,h=u.children,x=t!==null?t.memoizedState:null;if(u.mode==="hidden"){if((r.flags&128)!==0){if(u=x!==null?x.baseLanes|i:i,t!==null){for(h=r.child=t.child,x=0;h!==null;)x=x|h.lanes|h.childLanes,h=h.sibling;r.childLanes=x&~u}else r.childLanes=0,r.child=null;return x0(t,r,u,i)}if((i&536870912)!==0)r.memoizedState={baseLanes:0,cachePool:null},t!==null&&Wl(r,x!==null?x.cachePool:null),x!==null?px(r,x):wf(),r0(r);else return r.lanes=r.childLanes=536870912,x0(t,r,x!==null?x.baseLanes|i:i,i)}else x!==null?(Wl(r,x.cachePool),px(r,x),Wr(),r.memoizedState=null):(t!==null&&Wl(r,null),wf(),Wr());return Lt(t,r,h,i),r.child}function x0(t,r,i,u){var h=pf();return h=h===null?null:{parent:At._currentValue,pool:h},r.memoizedState={baseLanes:i,cachePool:h},t!==null&&Wl(r,null),wf(),r0(r),t!==null&&ei(t,r,u,!0),null}function mc(t,r){var i=r.ref;if(i===null)t!==null&&t.ref!==null&&(r.flags|=4194816);else{if(typeof i!="function"&&typeof i!="object")throw Error(o(284));(t===null||t.ref!==i)&&(r.flags|=4194816)}}function Uf(t,r,i,u,h){return Us(r),i=jf(t,r,i,u,void 0,h),u=_f(),t!==null&&!Dt?(Ef(t,r,h),jr(t,r,h)):(ot&&u&&af(r),r.flags|=1,Lt(t,r,i,h),r.child)}function y0(t,r,i,u,h,x){return Us(r),r.updateQueue=null,i=xx(r,u,i,h),gx(t),u=_f(),t!==null&&!Dt?(Ef(t,r,x),jr(t,r,x)):(ot&&u&&af(r),r.flags|=1,Lt(t,r,i,x),r.child)}function v0(t,r,i,u,h){if(Us(r),r.stateNode===null){var x=Ao,C=i.contextType;typeof C=="object"&&C!==null&&(x=Ft(C)),x=new i(u,x),r.memoizedState=x.state!==null&&x.state!==void 0?x.state:null,x.updater=Bf,r.stateNode=x,x._reactInternals=r,x=r.stateNode,x.props=u,x.state=r.memoizedState,x.refs={},xf(r),C=i.contextType,x.context=typeof C=="object"&&C!==null?Ft(C):Ao,x.state=r.memoizedState,C=i.getDerivedStateFromProps,typeof C=="function"&&($f(r,i,C,u),x.state=r.memoizedState),typeof i.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&&Bf.enqueueReplaceState(x,x.state,null),ii(r,u,x,h),ai(),x.state=r.memoizedState),typeof x.componentDidMount=="function"&&(r.flags|=4194308),u=!0}else if(t===null){x=r.stateNode;var O=r.memoizedProps,q=Fs(i,O);x.props=q;var ee=x.context,fe=i.contextType;C=Ao,typeof fe=="object"&&fe!==null&&(C=Ft(fe));var xe=i.getDerivedStateFromProps;fe=typeof xe=="function"||typeof x.getSnapshotBeforeUpdate=="function",O=r.pendingProps!==O,fe||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(O||ee!==C)&&o0(r,x,u,C),Fr=!1;var se=r.memoizedState;x.state=se,ii(r,u,x,h),ai(),ee=r.memoizedState,O||se!==ee||Fr?(typeof xe=="function"&&($f(r,i,xe,u),ee=r.memoizedState),(q=Fr||s0(r,i,q,u,se,ee,C))?(fe||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"&&(r.flags|=4194308)):(typeof x.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=u,r.memoizedState=ee),x.props=u,x.state=ee,x.context=C,u=q):(typeof x.componentDidMount=="function"&&(r.flags|=4194308),u=!1)}else{x=r.stateNode,yf(t,r),C=r.memoizedProps,fe=Fs(i,C),x.props=fe,xe=r.pendingProps,se=x.context,ee=i.contextType,q=Ao,typeof ee=="object"&&ee!==null&&(q=Ft(ee)),O=i.getDerivedStateFromProps,(ee=typeof O=="function"||typeof x.getSnapshotBeforeUpdate=="function")||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(C!==xe||se!==q)&&o0(r,x,u,q),Fr=!1,se=r.memoizedState,x.state=se,ii(r,u,x,h),ai();var oe=r.memoizedState;C!==xe||se!==oe||Fr||t!==null&&t.dependencies!==null&&Xl(t.dependencies)?(typeof O=="function"&&($f(r,i,O,u),oe=r.memoizedState),(fe=Fr||s0(r,i,fe,u,se,oe,q)||t!==null&&t.dependencies!==null&&Xl(t.dependencies))?(ee||typeof x.UNSAFE_componentWillUpdate!="function"&&typeof x.componentWillUpdate!="function"||(typeof x.componentWillUpdate=="function"&&x.componentWillUpdate(u,oe,q),typeof x.UNSAFE_componentWillUpdate=="function"&&x.UNSAFE_componentWillUpdate(u,oe,q)),typeof x.componentDidUpdate=="function"&&(r.flags|=4),typeof x.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof x.componentDidUpdate!="function"||C===t.memoizedProps&&se===t.memoizedState||(r.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||C===t.memoizedProps&&se===t.memoizedState||(r.flags|=1024),r.memoizedProps=u,r.memoizedState=oe),x.props=u,x.state=oe,x.context=q,u=fe):(typeof x.componentDidUpdate!="function"||C===t.memoizedProps&&se===t.memoizedState||(r.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||C===t.memoizedProps&&se===t.memoizedState||(r.flags|=1024),u=!1)}return x=u,mc(t,r),u=(r.flags&128)!==0,x||u?(x=r.stateNode,i=u&&typeof i.getDerivedStateFromError!="function"?null:x.render(),r.flags|=1,t!==null&&u?(r.child=$o(r,t.child,null,h),r.child=$o(r,null,i,h)):Lt(t,r,i,h),r.memoizedState=x.state,t=r.child):t=jr(t,r,h),t}function b0(t,r,i,u){return Qa(),r.flags|=256,Lt(t,r,i,u),r.child}var Vf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function qf(t){return{baseLanes:t,cachePool:ix()}}function Ff(t,r,i){return t=t!==null?t.childLanes&~i:0,r&&(t|=Cn),t}function w0(t,r,i){var u=r.pendingProps,h=!1,x=(r.flags&128)!==0,C;if((C=x)||(C=t!==null&&t.memoizedState===null?!1:(Mt.current&2)!==0),C&&(h=!0,r.flags&=-129),C=(r.flags&32)!==0,r.flags&=-33,t===null){if(ot){if(h?Zr(r):Wr(),ot){var O=wt,q;if(q=O){e:{for(q=O,O=Gn;q.nodeType!==8;){if(!O){O=null;break e}if(q=zn(q.nextSibling),q===null){O=null;break e}}O=q}O!==null?(r.memoizedState={dehydrated:O,treeContext:Ls!==null?{id:yr,overflow:vr}:null,retryLane:536870912,hydrationErrors:null},q=cn(18,null,null,0),q.stateNode=O,q.return=r,r.child=q,Wt=r,wt=null,q=!0):q=!1}q||Bs(r)}if(O=r.memoizedState,O!==null&&(O=O.dehydrated,O!==null))return km(O)?r.lanes=32:r.lanes=536870912,null;Sr(r)}return O=u.children,u=u.fallback,h?(Wr(),h=r.mode,O=hc({mode:"hidden",children:O},h),u=Is(u,h,i,null),O.return=r,u.return=r,O.sibling=u,r.child=O,h=r.child,h.memoizedState=qf(i),h.childLanes=Ff(t,C,i),r.memoizedState=Vf,u):(Zr(r),Yf(r,O))}if(q=t.memoizedState,q!==null&&(O=q.dehydrated,O!==null)){if(x)r.flags&256?(Zr(r),r.flags&=-257,r=Gf(t,r,i)):r.memoizedState!==null?(Wr(),r.child=t.child,r.flags|=128,r=null):(Wr(),h=u.fallback,O=r.mode,u=hc({mode:"visible",children:u.children},O),h=Is(h,O,i,null),h.flags|=2,u.return=r,h.return=r,u.sibling=h,r.child=u,$o(r,t.child,null,i),u=r.child,u.memoizedState=qf(i),u.childLanes=Ff(t,C,i),r.memoizedState=Vf,r=h);else if(Zr(r),km(O)){if(C=O.nextSibling&&O.nextSibling.dataset,C)var ee=C.dgst;C=ee,u=Error(o(419)),u.stack="",u.digest=C,Ja({value:u,source:null,stack:null}),r=Gf(t,r,i)}else if(Dt||ei(t,r,i,!1),C=(i&t.childLanes)!==0,Dt||C){if(C=pt,C!==null&&(u=i&-i,u=(u&42)!==0?1:Ra(u),u=(u&(C.suspendedLanes|i))!==0?0:u,u!==0&&u!==q.retryLane))throw q.retryLane=u,ko(t,u),hn(C,t,u),f0;O.data==="$?"||dm(),r=Gf(t,r,i)}else O.data==="$?"?(r.flags|=192,r.child=t.child,r=null):(t=q.treeContext,wt=zn(O.nextSibling),Wt=r,ot=!0,$s=null,Gn=!1,t!==null&&(jn[_n++]=yr,jn[_n++]=vr,jn[_n++]=Ls,yr=t.id,vr=t.overflow,Ls=r),r=Yf(r,u.children),r.flags|=4096);return r}return h?(Wr(),h=u.fallback,O=r.mode,q=t.child,ee=q.sibling,u=xr(q,{mode:"hidden",children:u.children}),u.subtreeFlags=q.subtreeFlags&65011712,ee!==null?h=xr(ee,h):(h=Is(h,O,i,null),h.flags|=2),h.return=r,u.return=r,u.sibling=h,r.child=u,u=h,h=r.child,O=t.child.memoizedState,O===null?O=qf(i):(q=O.cachePool,q!==null?(ee=At._currentValue,q=q.parent!==ee?{parent:ee,pool:ee}:q):q=ix(),O={baseLanes:O.baseLanes|i,cachePool:q}),h.memoizedState=O,h.childLanes=Ff(t,C,i),r.memoizedState=Vf,u):(Zr(r),i=t.child,t=i.sibling,i=xr(i,{mode:"visible",children:u.children}),i.return=r,i.sibling=null,t!==null&&(C=r.deletions,C===null?(r.deletions=[t],r.flags|=16):C.push(t)),r.child=i,r.memoizedState=null,i)}function Yf(t,r){return r=hc({mode:"visible",children:r},t.mode),r.return=t,t.child=r}function hc(t,r){return t=cn(22,t,null,r),t.lanes=0,t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},t}function Gf(t,r,i){return $o(r,t.child,null,i),t=Yf(r,r.pendingProps.children),t.flags|=2,r.memoizedState=null,t}function N0(t,r,i){t.lanes|=r;var u=t.alternate;u!==null&&(u.lanes|=r),df(t.return,r,i)}function Xf(t,r,i,u,h){var x=t.memoizedState;x===null?t.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:u,tail:i,tailMode:h}:(x.isBackwards=r,x.rendering=null,x.renderingStartTime=0,x.last=u,x.tail=i,x.tailMode=h)}function S0(t,r,i){var u=r.pendingProps,h=u.revealOrder,x=u.tail;if(Lt(t,r,u.children,i),u=Mt.current,(u&2)!==0)u=u&1|2,r.flags|=128;else{if(t!==null&&(t.flags&128)!==0)e:for(t=r.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&N0(t,i,r);else if(t.tag===19)N0(t,i,r);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===r)break e;for(;t.sibling===null;){if(t.return===null||t.return===r)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}u&=1}switch(Z(Mt,u),h){case"forwards":for(i=r.child,h=null;i!==null;)t=i.alternate,t!==null&&uc(t)===null&&(h=i),i=i.sibling;i=h,i===null?(h=r.child,r.child=null):(h=i.sibling,i.sibling=null),Xf(r,!1,h,i,x);break;case"backwards":for(i=null,h=r.child,r.child=null;h!==null;){if(t=h.alternate,t!==null&&uc(t)===null){r.child=h;break}t=h.sibling,h.sibling=i,i=h,h=t}Xf(r,!0,i,null,x);break;case"together":Xf(r,!1,null,null,void 0);break;default:r.memoizedState=null}return r.child}function jr(t,r,i){if(t!==null&&(r.dependencies=t.dependencies),ts|=r.lanes,(i&r.childLanes)===0)if(t!==null){if(ei(t,r,i,!1),(i&r.childLanes)===0)return null}else return null;if(t!==null&&r.child!==t.child)throw Error(o(153));if(r.child!==null){for(t=r.child,i=xr(t,t.pendingProps),r.child=i,i.return=r;t.sibling!==null;)t=t.sibling,i=i.sibling=xr(t,t.pendingProps),i.return=r;i.sibling=null}return r.child}function Zf(t,r){return(t.lanes&r)!==0?!0:(t=t.dependencies,!!(t!==null&&Xl(t)))}function g_(t,r,i){switch(r.tag){case 3:le(r,r.stateNode.containerInfo),qr(r,At,t.memoizedState.cache),Qa();break;case 27:case 5:Ne(r);break;case 4:le(r,r.stateNode.containerInfo);break;case 10:qr(r,r.type,r.memoizedProps.value);break;case 13:var u=r.memoizedState;if(u!==null)return u.dehydrated!==null?(Zr(r),r.flags|=128,null):(i&r.child.childLanes)!==0?w0(t,r,i):(Zr(r),t=jr(t,r,i),t!==null?t.sibling:null);Zr(r);break;case 19:var h=(t.flags&128)!==0;if(u=(i&r.childLanes)!==0,u||(ei(t,r,i,!1),u=(i&r.childLanes)!==0),h){if(u)return S0(t,r,i);r.flags|=128}if(h=r.memoizedState,h!==null&&(h.rendering=null,h.tail=null,h.lastEffect=null),Z(Mt,Mt.current),u)break;return null;case 22:case 23:return r.lanes=0,g0(t,r,i);case 24:qr(r,At,t.memoizedState.cache)}return jr(t,r,i)}function j0(t,r,i){if(t!==null)if(t.memoizedProps!==r.pendingProps)Dt=!0;else{if(!Zf(t,i)&&(r.flags&128)===0)return Dt=!1,g_(t,r,i);Dt=(t.flags&131072)!==0}else Dt=!1,ot&&(r.flags&1048576)!==0&&ex(r,Gl,r.index);switch(r.lanes=0,r.tag){case 16:e:{t=r.pendingProps;var u=r.elementType,h=u._init;if(u=h(u._payload),r.type=u,typeof u=="function")rf(u)?(t=Fs(u,t),r.tag=1,r=v0(null,r,u,t,i)):(r.tag=0,r=Uf(null,r,u,t,i));else{if(u!=null){if(h=u.$$typeof,h===k){r.tag=11,r=m0(null,r,u,t,i);break e}else if(h===z){r.tag=14,r=h0(null,r,u,t,i);break e}}throw r=L(u)||u,Error(o(306,r,""))}}return r;case 0:return Uf(t,r,r.type,r.pendingProps,i);case 1:return u=r.type,h=Fs(u,r.pendingProps),v0(t,r,u,h,i);case 3:e:{if(le(r,r.stateNode.containerInfo),t===null)throw Error(o(387));u=r.pendingProps;var x=r.memoizedState;h=x.element,yf(t,r),ii(r,u,null,i);var C=r.memoizedState;if(u=C.cache,qr(r,At,u),u!==x.cache&&ff(r,[At],i,!0),ai(),u=C.element,x.isDehydrated)if(x={element:u,isDehydrated:!1,cache:C.cache},r.updateQueue.baseState=x,r.memoizedState=x,r.flags&256){r=b0(t,r,u,i);break e}else if(u!==h){h=Nn(Error(o(424)),r),Ja(h),r=b0(t,r,u,i);break e}else{switch(t=r.stateNode.containerInfo,t.nodeType){case 9:t=t.body;break;default:t=t.nodeName==="HTML"?t.ownerDocument.body:t}for(wt=zn(t.firstChild),Wt=r,ot=!0,$s=null,Gn=!0,i=n0(r,null,u,i),r.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling}else{if(Qa(),u===h){r=jr(t,r,i);break e}Lt(t,r,u,i)}r=r.child}return r;case 26:return mc(t,r),t===null?(i=ky(r.type,null,r.pendingProps,null))?r.memoizedState=i:ot||(i=r.type,t=r.pendingProps,u=kc(ge.current).createElement(i),u[Rt]=r,u[qt]=t,$t(u,i,t),_t(u),r.stateNode=u):r.memoizedState=ky(r.type,t.memoizedProps,r.pendingProps,t.memoizedState),null;case 27:return Ne(r),t===null&&ot&&(u=r.stateNode=_y(r.type,r.pendingProps,ge.current),Wt=r,Gn=!0,h=wt,os(r.type)?(Am=h,wt=zn(u.firstChild)):wt=h),Lt(t,r,r.pendingProps.children,i),mc(t,r),t===null&&(r.flags|=4194304),r.child;case 5:return t===null&&ot&&((h=u=wt)&&(u=q_(u,r.type,r.pendingProps,Gn),u!==null?(r.stateNode=u,Wt=r,wt=zn(u.firstChild),Gn=!1,h=!0):h=!1),h||Bs(r)),Ne(r),h=r.type,x=r.pendingProps,C=t!==null?t.memoizedProps:null,u=x.children,_m(h,x)?u=null:C!==null&&_m(h,C)&&(r.flags|=32),r.memoizedState!==null&&(h=jf(t,r,l_,null,null,i),Ai._currentValue=h),mc(t,r),Lt(t,r,u,i),r.child;case 6:return t===null&&ot&&((t=i=wt)&&(i=F_(i,r.pendingProps,Gn),i!==null?(r.stateNode=i,Wt=r,wt=null,t=!0):t=!1),t||Bs(r)),null;case 13:return w0(t,r,i);case 4:return le(r,r.stateNode.containerInfo),u=r.pendingProps,t===null?r.child=$o(r,null,u,i):Lt(t,r,u,i),r.child;case 11:return m0(t,r,r.type,r.pendingProps,i);case 7:return Lt(t,r,r.pendingProps,i),r.child;case 8:return Lt(t,r,r.pendingProps.children,i),r.child;case 12:return Lt(t,r,r.pendingProps.children,i),r.child;case 10:return u=r.pendingProps,qr(r,r.type,u.value),Lt(t,r,u.children,i),r.child;case 9:return h=r.type._context,u=r.pendingProps.children,Us(r),h=Ft(h),u=u(h),r.flags|=1,Lt(t,r,u,i),r.child;case 14:return h0(t,r,r.type,r.pendingProps,i);case 15:return p0(t,r,r.type,r.pendingProps,i);case 19:return S0(t,r,i);case 31:return u=r.pendingProps,i=r.mode,u={mode:u.mode,children:u.children},t===null?(i=hc(u,i),i.ref=r.ref,r.child=i,i.return=r,r=i):(i=xr(t.child,u),i.ref=r.ref,r.child=i,i.return=r,r=i),r;case 22:return g0(t,r,i);case 24:return Us(r),u=Ft(At),t===null?(h=pf(),h===null&&(h=pt,x=mf(),h.pooledCache=x,x.refCount++,x!==null&&(h.pooledCacheLanes|=i),h=x),r.memoizedState={parent:u,cache:h},xf(r),qr(r,At,h)):((t.lanes&i)!==0&&(yf(t,r),ii(r,null,null,i),ai()),h=t.memoizedState,x=r.memoizedState,h.parent!==u?(h={parent:u,cache:u},r.memoizedState=h,r.lanes===0&&(r.memoizedState=r.updateQueue.baseState=h),qr(r,At,u)):(u=x.cache,qr(r,At,u),u!==h.cache&&ff(r,[At],i,!0))),Lt(t,r,r.pendingProps.children,i),r.child;case 29:throw r.pendingProps}throw Error(o(156,r.tag))}function _r(t){t.flags|=4}function _0(t,r){if(r.type!=="stylesheet"||(r.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!Dy(r)){if(r=En.current,r!==null&&((et&4194048)===et?Xn!==null:(et&62914560)!==et&&(et&536870912)===0||r!==Xn))throw si=gf,lx;t.flags|=8192}}function pc(t,r){r!==null&&(t.flags|=4),t.flags&16384&&(r=t.tag!==22?Fn():536870912,t.lanes|=r,Vo|=r)}function hi(t,r){if(!ot)switch(t.tailMode){case"hidden":r=t.tail;for(var i=null;r!==null;)r.alternate!==null&&(i=r),r=r.sibling;i===null?t.tail=null:i.sibling=null;break;case"collapsed":i=t.tail;for(var u=null;i!==null;)i.alternate!==null&&(u=i),i=i.sibling;u===null?r||t.tail===null?t.tail=null:t.tail.sibling=null:u.sibling=null}}function vt(t){var r=t.alternate!==null&&t.alternate.child===t.child,i=0,u=0;if(r)for(var h=t.child;h!==null;)i|=h.lanes|h.childLanes,u|=h.subtreeFlags&65011712,u|=h.flags&65011712,h.return=t,h=h.sibling;else for(h=t.child;h!==null;)i|=h.lanes|h.childLanes,u|=h.subtreeFlags,u|=h.flags,h.return=t,h=h.sibling;return t.subtreeFlags|=u,t.childLanes=i,r}function x_(t,r,i){var u=r.pendingProps;switch(lf(r),r.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return vt(r),null;case 1:return vt(r),null;case 3:return i=r.stateNode,u=null,t!==null&&(u=t.memoizedState.cache),r.memoizedState.cache!==u&&(r.flags|=2048),wr(At),ve(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(t===null||t.child===null)&&(Ka(r)?_r(r):t===null||t.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,rx())),vt(r),null;case 26:return i=r.memoizedState,t===null?(_r(r),i!==null?(vt(r),_0(r,i)):(vt(r),r.flags&=-16777217)):i?i!==t.memoizedState?(_r(r),vt(r),_0(r,i)):(vt(r),r.flags&=-16777217):(t.memoizedProps!==u&&_r(r),vt(r),r.flags&=-16777217),null;case 27:_e(r),i=ge.current;var h=r.type;if(t!==null&&r.stateNode!=null)t.memoizedProps!==u&&_r(r);else{if(!u){if(r.stateNode===null)throw Error(o(166));return vt(r),null}t=re.current,Ka(r)?tx(r):(t=_y(h,u,i),r.stateNode=t,_r(r))}return vt(r),null;case 5:if(_e(r),i=r.type,t!==null&&r.stateNode!=null)t.memoizedProps!==u&&_r(r);else{if(!u){if(r.stateNode===null)throw Error(o(166));return vt(r),null}if(t=re.current,Ka(r))tx(r);else{switch(h=kc(ge.current),t){case 1:t=h.createElementNS("http://www.w3.org/2000/svg",i);break;case 2:t=h.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;default:switch(i){case"svg":t=h.createElementNS("http://www.w3.org/2000/svg",i);break;case"math":t=h.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;case"script":t=h.createElement("div"),t.innerHTML="<script><\/script>",t=t.removeChild(t.firstChild);break;case"select":t=typeof u.is=="string"?h.createElement("select",{is:u.is}):h.createElement("select"),u.multiple?t.multiple=!0:u.size&&(t.size=u.size);break;default:t=typeof u.is=="string"?h.createElement(i,{is:u.is}):h.createElement(i)}}t[Rt]=r,t[qt]=u;e:for(h=r.child;h!==null;){if(h.tag===5||h.tag===6)t.appendChild(h.stateNode);else if(h.tag!==4&&h.tag!==27&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===r)break e;for(;h.sibling===null;){if(h.return===null||h.return===r)break e;h=h.return}h.sibling.return=h.return,h=h.sibling}r.stateNode=t;e:switch($t(t,i,u),i){case"button":case"input":case"select":case"textarea":t=!!u.autoFocus;break e;case"img":t=!0;break e;default:t=!1}t&&_r(r)}}return vt(r),r.flags&=-16777217,null;case 6:if(t&&r.stateNode!=null)t.memoizedProps!==u&&_r(r);else{if(typeof u!="string"&&r.stateNode===null)throw Error(o(166));if(t=ge.current,Ka(r)){if(t=r.stateNode,i=r.memoizedProps,u=null,h=Wt,h!==null)switch(h.tag){case 27:case 5:u=h.memoizedProps}t[Rt]=r,t=!!(t.nodeValue===i||u!==null&&u.suppressHydrationWarning===!0||yy(t.nodeValue,i)),t||Bs(r)}else t=kc(t).createTextNode(u),t[Rt]=r,r.stateNode=t}return vt(r),null;case 13:if(u=r.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(h=Ka(r),u!==null&&u.dehydrated!==null){if(t===null){if(!h)throw Error(o(318));if(h=r.memoizedState,h=h!==null?h.dehydrated:null,!h)throw Error(o(317));h[Rt]=r}else Qa(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;vt(r),h=!1}else h=rx(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=h),h=!0;if(!h)return r.flags&256?(Sr(r),r):(Sr(r),null)}if(Sr(r),(r.flags&128)!==0)return r.lanes=i,r;if(i=u!==null,t=t!==null&&t.memoizedState!==null,i){u=r.child,h=null,u.alternate!==null&&u.alternate.memoizedState!==null&&u.alternate.memoizedState.cachePool!==null&&(h=u.alternate.memoizedState.cachePool.pool);var x=null;u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(x=u.memoizedState.cachePool.pool),x!==h&&(u.flags|=2048)}return i!==t&&i&&(r.child.flags|=8192),pc(r,r.updateQueue),vt(r),null;case 4:return ve(),t===null&&bm(r.stateNode.containerInfo),vt(r),null;case 10:return wr(r.type),vt(r),null;case 19:if(W(Mt),h=r.memoizedState,h===null)return vt(r),null;if(u=(r.flags&128)!==0,x=h.rendering,x===null)if(u)hi(h,!1);else{if(Nt!==0||t!==null&&(t.flags&128)!==0)for(t=r.child;t!==null;){if(x=uc(t),x!==null){for(r.flags|=128,hi(h,!1),t=x.updateQueue,r.updateQueue=t,pc(r,t),r.subtreeFlags=0,t=i,i=r.child;i!==null;)Jg(i,t),i=i.sibling;return Z(Mt,Mt.current&1|2),r.child}t=t.sibling}h.tail!==null&&Qe()>yc&&(r.flags|=128,u=!0,hi(h,!1),r.lanes=4194304)}else{if(!u)if(t=uc(x),t!==null){if(r.flags|=128,u=!0,t=t.updateQueue,r.updateQueue=t,pc(r,t),hi(h,!0),h.tail===null&&h.tailMode==="hidden"&&!x.alternate&&!ot)return vt(r),null}else 2*Qe()-h.renderingStartTime>yc&&i!==536870912&&(r.flags|=128,u=!0,hi(h,!1),r.lanes=4194304);h.isBackwards?(x.sibling=r.child,r.child=x):(t=h.last,t!==null?t.sibling=x:r.child=x,h.last=x)}return h.tail!==null?(r=h.tail,h.rendering=r,h.tail=r.sibling,h.renderingStartTime=Qe(),r.sibling=null,t=Mt.current,Z(Mt,u?t&1|2:t&1),r):(vt(r),null);case 22:case 23:return Sr(r),Nf(),u=r.memoizedState!==null,t!==null?t.memoizedState!==null!==u&&(r.flags|=8192):u&&(r.flags|=8192),u?(i&536870912)!==0&&(r.flags&128)===0&&(vt(r),r.subtreeFlags&6&&(r.flags|=8192)):vt(r),i=r.updateQueue,i!==null&&pc(r,i.retryQueue),i=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),u=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(u=r.memoizedState.cachePool.pool),u!==i&&(r.flags|=2048),t!==null&&W(Vs),null;case 24:return i=null,t!==null&&(i=t.memoizedState.cache),r.memoizedState.cache!==i&&(r.flags|=2048),wr(At),vt(r),null;case 25:return null;case 30:return null}throw Error(o(156,r.tag))}function y_(t,r){switch(lf(r),r.tag){case 1:return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 3:return wr(At),ve(),t=r.flags,(t&65536)!==0&&(t&128)===0?(r.flags=t&-65537|128,r):null;case 26:case 27:case 5:return _e(r),null;case 13:if(Sr(r),t=r.memoizedState,t!==null&&t.dehydrated!==null){if(r.alternate===null)throw Error(o(340));Qa()}return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 19:return W(Mt),null;case 4:return ve(),null;case 10:return wr(r.type),null;case 22:case 23:return Sr(r),Nf(),t!==null&&W(Vs),t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 24:return wr(At),null;case 25:return null;default:return null}}function E0(t,r){switch(lf(r),r.tag){case 3:wr(At),ve();break;case 26:case 27:case 5:_e(r);break;case 4:ve();break;case 13:Sr(r);break;case 19:W(Mt);break;case 10:wr(r.type);break;case 22:case 23:Sr(r),Nf(),t!==null&&W(Vs);break;case 24:wr(At)}}function pi(t,r){try{var i=r.updateQueue,u=i!==null?i.lastEffect:null;if(u!==null){var h=u.next;i=h;do{if((i.tag&t)===t){u=void 0;var x=i.create,C=i.inst;u=x(),C.destroy=u}i=i.next}while(i!==h)}}catch(O){mt(r,r.return,O)}}function Kr(t,r,i){try{var u=r.updateQueue,h=u!==null?u.lastEffect:null;if(h!==null){var x=h.next;u=x;do{if((u.tag&t)===t){var C=u.inst,O=C.destroy;if(O!==void 0){C.destroy=void 0,h=r;var q=i,ee=O;try{ee()}catch(fe){mt(h,q,fe)}}}u=u.next}while(u!==x)}}catch(fe){mt(r,r.return,fe)}}function C0(t){var r=t.updateQueue;if(r!==null){var i=t.stateNode;try{hx(r,i)}catch(u){mt(t,t.return,u)}}}function k0(t,r,i){i.props=Fs(t.type,t.memoizedProps),i.state=t.memoizedState;try{i.componentWillUnmount()}catch(u){mt(t,r,u)}}function gi(t,r){try{var i=t.ref;if(i!==null){switch(t.tag){case 26:case 27:case 5:var u=t.stateNode;break;case 30:u=t.stateNode;break;default:u=t.stateNode}typeof i=="function"?t.refCleanup=i(u):i.current=u}}catch(h){mt(t,r,h)}}function Zn(t,r){var i=t.ref,u=t.refCleanup;if(i!==null)if(typeof u=="function")try{u()}catch(h){mt(t,r,h)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof i=="function")try{i(null)}catch(h){mt(t,r,h)}else i.current=null}function A0(t){var r=t.type,i=t.memoizedProps,u=t.stateNode;try{e:switch(r){case"button":case"input":case"select":case"textarea":i.autoFocus&&u.focus();break e;case"img":i.src?u.src=i.src:i.srcSet&&(u.srcset=i.srcSet)}}catch(h){mt(t,t.return,h)}}function Wf(t,r,i){try{var u=t.stateNode;$_(u,t.type,i,r),u[qt]=r}catch(h){mt(t,t.return,h)}}function M0(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&os(t.type)||t.tag===4}function Kf(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||M0(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&&os(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 Qf(t,r,i){var u=t.tag;if(u===5||u===6)t=t.stateNode,r?(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i).insertBefore(t,r):(r=i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,r.appendChild(t),i=i._reactRootContainer,i!=null||r.onclick!==null||(r.onclick=Cc));else if(u!==4&&(u===27&&os(t.type)&&(i=t.stateNode,r=null),t=t.child,t!==null))for(Qf(t,r,i),t=t.sibling;t!==null;)Qf(t,r,i),t=t.sibling}function gc(t,r,i){var u=t.tag;if(u===5||u===6)t=t.stateNode,r?i.insertBefore(t,r):i.appendChild(t);else if(u!==4&&(u===27&&os(t.type)&&(i=t.stateNode),t=t.child,t!==null))for(gc(t,r,i),t=t.sibling;t!==null;)gc(t,r,i),t=t.sibling}function T0(t){var r=t.stateNode,i=t.memoizedProps;try{for(var u=t.type,h=r.attributes;h.length;)r.removeAttributeNode(h[0]);$t(r,u,i),r[Rt]=t,r[qt]=i}catch(x){mt(t,t.return,x)}}var Er=!1,jt=!1,Jf=!1,R0=typeof WeakSet=="function"?WeakSet:Set,Ot=null;function v_(t,r){if(t=t.containerInfo,Sm=Oc,t=Vg(t),Wd(t)){if("selectionStart"in t)var i={start:t.selectionStart,end:t.selectionEnd};else e:{i=(i=t.ownerDocument)&&i.defaultView||window;var u=i.getSelection&&i.getSelection();if(u&&u.rangeCount!==0){i=u.anchorNode;var h=u.anchorOffset,x=u.focusNode;u=u.focusOffset;try{i.nodeType,x.nodeType}catch{i=null;break e}var C=0,O=-1,q=-1,ee=0,fe=0,xe=t,se=null;t:for(;;){for(var oe;xe!==i||h!==0&&xe.nodeType!==3||(O=C+h),xe!==x||u!==0&&xe.nodeType!==3||(q=C+u),xe.nodeType===3&&(C+=xe.nodeValue.length),(oe=xe.firstChild)!==null;)se=xe,xe=oe;for(;;){if(xe===t)break t;if(se===i&&++ee===h&&(O=C),se===x&&++fe===u&&(q=C),(oe=xe.nextSibling)!==null)break;xe=se,se=xe.parentNode}xe=oe}i=O===-1||q===-1?null:{start:O,end:q}}else i=null}i=i||{start:0,end:0}}else i=null;for(jm={focusedElem:t,selectionRange:i},Oc=!1,Ot=r;Ot!==null;)if(r=Ot,t=r.child,(r.subtreeFlags&1024)!==0&&t!==null)t.return=r,Ot=t;else for(;Ot!==null;){switch(r=Ot,x=r.alternate,t=r.flags,r.tag){case 0:break;case 11:case 15:break;case 1:if((t&1024)!==0&&x!==null){t=void 0,i=r,h=x.memoizedProps,x=x.memoizedState,u=i.stateNode;try{var Be=Fs(i.type,h,i.elementType===i.type);t=u.getSnapshotBeforeUpdate(Be,x),u.__reactInternalSnapshotBeforeUpdate=t}catch(Le){mt(i,i.return,Le)}}break;case 3:if((t&1024)!==0){if(t=r.stateNode.containerInfo,i=t.nodeType,i===9)Cm(t);else if(i===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":Cm(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(o(163))}if(t=r.sibling,t!==null){t.return=r.return,Ot=t;break}Ot=r.return}}function D0(t,r,i){var u=i.flags;switch(i.tag){case 0:case 11:case 15:Qr(t,i),u&4&&pi(5,i);break;case 1:if(Qr(t,i),u&4)if(t=i.stateNode,r===null)try{t.componentDidMount()}catch(C){mt(i,i.return,C)}else{var h=Fs(i.type,r.memoizedProps);r=r.memoizedState;try{t.componentDidUpdate(h,r,t.__reactInternalSnapshotBeforeUpdate)}catch(C){mt(i,i.return,C)}}u&64&&C0(i),u&512&&gi(i,i.return);break;case 3:if(Qr(t,i),u&64&&(t=i.updateQueue,t!==null)){if(r=null,i.child!==null)switch(i.child.tag){case 27:case 5:r=i.child.stateNode;break;case 1:r=i.child.stateNode}try{hx(t,r)}catch(C){mt(i,i.return,C)}}break;case 27:r===null&&u&4&&T0(i);case 26:case 5:Qr(t,i),r===null&&u&4&&A0(i),u&512&&gi(i,i.return);break;case 12:Qr(t,i);break;case 13:Qr(t,i),u&4&&I0(t,i),u&64&&(t=i.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(i=k_.bind(null,i),Y_(t,i))));break;case 22:if(u=i.memoizedState!==null||Er,!u){r=r!==null&&r.memoizedState!==null||jt,h=Er;var x=jt;Er=u,(jt=r)&&!x?Jr(t,i,(i.subtreeFlags&8772)!==0):Qr(t,i),Er=h,jt=x}break;case 30:break;default:Qr(t,i)}}function O0(t){var r=t.alternate;r!==null&&(t.alternate=null,O0(r)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(r=t.stateNode,r!==null&&za(r)),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 xt=null,sn=!1;function Cr(t,r,i){for(i=i.child;i!==null;)z0(t,r,i),i=i.sibling}function z0(t,r,i){if(me&&typeof me.onCommitFiberUnmount=="function")try{me.onCommitFiberUnmount(ue,i)}catch{}switch(i.tag){case 26:jt||Zn(i,r),Cr(t,r,i),i.memoizedState?i.memoizedState.count--:i.stateNode&&(i=i.stateNode,i.parentNode.removeChild(i));break;case 27:jt||Zn(i,r);var u=xt,h=sn;os(i.type)&&(xt=i.stateNode,sn=!1),Cr(t,r,i),_i(i.stateNode),xt=u,sn=h;break;case 5:jt||Zn(i,r);case 6:if(u=xt,h=sn,xt=null,Cr(t,r,i),xt=u,sn=h,xt!==null)if(sn)try{(xt.nodeType===9?xt.body:xt.nodeName==="HTML"?xt.ownerDocument.body:xt).removeChild(i.stateNode)}catch(x){mt(i,r,x)}else try{xt.removeChild(i.stateNode)}catch(x){mt(i,r,x)}break;case 18:xt!==null&&(sn?(t=xt,Sy(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,i.stateNode),Di(t)):Sy(xt,i.stateNode));break;case 4:u=xt,h=sn,xt=i.stateNode.containerInfo,sn=!0,Cr(t,r,i),xt=u,sn=h;break;case 0:case 11:case 14:case 15:jt||Kr(2,i,r),jt||Kr(4,i,r),Cr(t,r,i);break;case 1:jt||(Zn(i,r),u=i.stateNode,typeof u.componentWillUnmount=="function"&&k0(i,r,u)),Cr(t,r,i);break;case 21:Cr(t,r,i);break;case 22:jt=(u=jt)||i.memoizedState!==null,Cr(t,r,i),jt=u;break;default:Cr(t,r,i)}}function I0(t,r){if(r.memoizedState===null&&(t=r.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{Di(t)}catch(i){mt(r,r.return,i)}}function b_(t){switch(t.tag){case 13:case 19:var r=t.stateNode;return r===null&&(r=t.stateNode=new R0),r;case 22:return t=t.stateNode,r=t._retryCache,r===null&&(r=t._retryCache=new R0),r;default:throw Error(o(435,t.tag))}}function em(t,r){var i=b_(t);r.forEach(function(u){var h=A_.bind(null,t,u);i.has(u)||(i.add(u),u.then(h,h))})}function un(t,r){var i=r.deletions;if(i!==null)for(var u=0;u<i.length;u++){var h=i[u],x=t,C=r,O=C;e:for(;O!==null;){switch(O.tag){case 27:if(os(O.type)){xt=O.stateNode,sn=!1;break e}break;case 5:xt=O.stateNode,sn=!1;break e;case 3:case 4:xt=O.stateNode.containerInfo,sn=!0;break e}O=O.return}if(xt===null)throw Error(o(160));z0(x,C,h),xt=null,sn=!1,x=h.alternate,x!==null&&(x.return=null),h.return=null}if(r.subtreeFlags&13878)for(r=r.child;r!==null;)L0(r,t),r=r.sibling}var On=null;function L0(t,r){var i=t.alternate,u=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:un(r,t),dn(t),u&4&&(Kr(3,t,t.return),pi(3,t),Kr(5,t,t.return));break;case 1:un(r,t),dn(t),u&512&&(jt||i===null||Zn(i,i.return)),u&64&&Er&&(t=t.updateQueue,t!==null&&(u=t.callbacks,u!==null&&(i=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=i===null?u:i.concat(u))));break;case 26:var h=On;if(un(r,t),dn(t),u&512&&(jt||i===null||Zn(i,i.return)),u&4){var x=i!==null?i.memoizedState:null;if(u=t.memoizedState,i===null)if(u===null)if(t.stateNode===null){e:{u=t.type,i=t.memoizedProps,h=h.ownerDocument||h;t:switch(u){case"title":x=h.getElementsByTagName("title")[0],(!x||x[Ts]||x[Rt]||x.namespaceURI==="http://www.w3.org/2000/svg"||x.hasAttribute("itemprop"))&&(x=h.createElement(u),h.head.insertBefore(x,h.querySelector("head > title"))),$t(x,u,i),x[Rt]=t,_t(x),u=x;break e;case"link":var C=Ty("link","href",h).get(u+(i.href||""));if(C){for(var O=0;O<C.length;O++)if(x=C[O],x.getAttribute("href")===(i.href==null||i.href===""?null:i.href)&&x.getAttribute("rel")===(i.rel==null?null:i.rel)&&x.getAttribute("title")===(i.title==null?null:i.title)&&x.getAttribute("crossorigin")===(i.crossOrigin==null?null:i.crossOrigin)){C.splice(O,1);break t}}x=h.createElement(u),$t(x,u,i),h.head.appendChild(x);break;case"meta":if(C=Ty("meta","content",h).get(u+(i.content||""))){for(O=0;O<C.length;O++)if(x=C[O],x.getAttribute("content")===(i.content==null?null:""+i.content)&&x.getAttribute("name")===(i.name==null?null:i.name)&&x.getAttribute("property")===(i.property==null?null:i.property)&&x.getAttribute("http-equiv")===(i.httpEquiv==null?null:i.httpEquiv)&&x.getAttribute("charset")===(i.charSet==null?null:i.charSet)){C.splice(O,1);break t}}x=h.createElement(u),$t(x,u,i),h.head.appendChild(x);break;default:throw Error(o(468,u))}x[Rt]=t,_t(x),u=x}t.stateNode=u}else Ry(h,t.type,t.stateNode);else t.stateNode=My(h,u,t.memoizedProps);else x!==u?(x===null?i.stateNode!==null&&(i=i.stateNode,i.parentNode.removeChild(i)):x.count--,u===null?Ry(h,t.type,t.stateNode):My(h,u,t.memoizedProps)):u===null&&t.stateNode!==null&&Wf(t,t.memoizedProps,i.memoizedProps)}break;case 27:un(r,t),dn(t),u&512&&(jt||i===null||Zn(i,i.return)),i!==null&&u&4&&Wf(t,t.memoizedProps,i.memoizedProps);break;case 5:if(un(r,t),dn(t),u&512&&(jt||i===null||Zn(i,i.return)),t.flags&32){h=t.stateNode;try{wo(h,"")}catch(oe){mt(t,t.return,oe)}}u&4&&t.stateNode!=null&&(h=t.memoizedProps,Wf(t,h,i!==null?i.memoizedProps:h)),u&1024&&(Jf=!0);break;case 6:if(un(r,t),dn(t),u&4){if(t.stateNode===null)throw Error(o(162));u=t.memoizedProps,i=t.stateNode;try{i.nodeValue=u}catch(oe){mt(t,t.return,oe)}}break;case 3:if(Tc=null,h=On,On=Ac(r.containerInfo),un(r,t),On=h,dn(t),u&4&&i!==null&&i.memoizedState.isDehydrated)try{Di(r.containerInfo)}catch(oe){mt(t,t.return,oe)}Jf&&(Jf=!1,H0(t));break;case 4:u=On,On=Ac(t.stateNode.containerInfo),un(r,t),dn(t),On=u;break;case 12:un(r,t),dn(t);break;case 13:un(r,t),dn(t),t.child.flags&8192&&t.memoizedState!==null!=(i!==null&&i.memoizedState!==null)&&(am=Qe()),u&4&&(u=t.updateQueue,u!==null&&(t.updateQueue=null,em(t,u)));break;case 22:h=t.memoizedState!==null;var q=i!==null&&i.memoizedState!==null,ee=Er,fe=jt;if(Er=ee||h,jt=fe||q,un(r,t),jt=fe,Er=ee,dn(t),u&8192)e:for(r=t.stateNode,r._visibility=h?r._visibility&-2:r._visibility|1,h&&(i===null||q||Er||jt||Ys(t)),i=null,r=t;;){if(r.tag===5||r.tag===26){if(i===null){q=i=r;try{if(x=q.stateNode,h)C=x.style,typeof C.setProperty=="function"?C.setProperty("display","none","important"):C.display="none";else{O=q.stateNode;var xe=q.memoizedProps.style,se=xe!=null&&xe.hasOwnProperty("display")?xe.display:null;O.style.display=se==null||typeof se=="boolean"?"":(""+se).trim()}}catch(oe){mt(q,q.return,oe)}}}else if(r.tag===6){if(i===null){q=r;try{q.stateNode.nodeValue=h?"":q.memoizedProps}catch(oe){mt(q,q.return,oe)}}}else if((r.tag!==22&&r.tag!==23||r.memoizedState===null||r===t)&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break e;for(;r.sibling===null;){if(r.return===null||r.return===t)break e;i===r&&(i=null),r=r.return}i===r&&(i=null),r.sibling.return=r.return,r=r.sibling}u&4&&(u=t.updateQueue,u!==null&&(i=u.retryQueue,i!==null&&(u.retryQueue=null,em(t,i))));break;case 19:un(r,t),dn(t),u&4&&(u=t.updateQueue,u!==null&&(t.updateQueue=null,em(t,u)));break;case 30:break;case 21:break;default:un(r,t),dn(t)}}function dn(t){var r=t.flags;if(r&2){try{for(var i,u=t.return;u!==null;){if(M0(u)){i=u;break}u=u.return}if(i==null)throw Error(o(160));switch(i.tag){case 27:var h=i.stateNode,x=Kf(t);gc(t,x,h);break;case 5:var C=i.stateNode;i.flags&32&&(wo(C,""),i.flags&=-33);var O=Kf(t);gc(t,O,C);break;case 3:case 4:var q=i.stateNode.containerInfo,ee=Kf(t);Qf(t,ee,q);break;default:throw Error(o(161))}}catch(fe){mt(t,t.return,fe)}t.flags&=-3}r&4096&&(t.flags&=-4097)}function H0(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var r=t;H0(r),r.tag===5&&r.flags&1024&&r.stateNode.reset(),t=t.sibling}}function Qr(t,r){if(r.subtreeFlags&8772)for(r=r.child;r!==null;)D0(t,r.alternate,r),r=r.sibling}function Ys(t){for(t=t.child;t!==null;){var r=t;switch(r.tag){case 0:case 11:case 14:case 15:Kr(4,r,r.return),Ys(r);break;case 1:Zn(r,r.return);var i=r.stateNode;typeof i.componentWillUnmount=="function"&&k0(r,r.return,i),Ys(r);break;case 27:_i(r.stateNode);case 26:case 5:Zn(r,r.return),Ys(r);break;case 22:r.memoizedState===null&&Ys(r);break;case 30:Ys(r);break;default:Ys(r)}t=t.sibling}}function Jr(t,r,i){for(i=i&&(r.subtreeFlags&8772)!==0,r=r.child;r!==null;){var u=r.alternate,h=t,x=r,C=x.flags;switch(x.tag){case 0:case 11:case 15:Jr(h,x,i),pi(4,x);break;case 1:if(Jr(h,x,i),u=x,h=u.stateNode,typeof h.componentDidMount=="function")try{h.componentDidMount()}catch(ee){mt(u,u.return,ee)}if(u=x,h=u.updateQueue,h!==null){var O=u.stateNode;try{var q=h.shared.hiddenCallbacks;if(q!==null)for(h.shared.hiddenCallbacks=null,h=0;h<q.length;h++)mx(q[h],O)}catch(ee){mt(u,u.return,ee)}}i&&C&64&&C0(x),gi(x,x.return);break;case 27:T0(x);case 26:case 5:Jr(h,x,i),i&&u===null&&C&4&&A0(x),gi(x,x.return);break;case 12:Jr(h,x,i);break;case 13:Jr(h,x,i),i&&C&4&&I0(h,x);break;case 22:x.memoizedState===null&&Jr(h,x,i),gi(x,x.return);break;case 30:break;default:Jr(h,x,i)}r=r.sibling}}function tm(t,r){var i=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),t=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(t=r.memoizedState.cachePool.pool),t!==i&&(t!=null&&t.refCount++,i!=null&&ti(i))}function nm(t,r){t=null,r.alternate!==null&&(t=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==t&&(r.refCount++,t!=null&&ti(t))}function Wn(t,r,i,u){if(r.subtreeFlags&10256)for(r=r.child;r!==null;)$0(t,r,i,u),r=r.sibling}function $0(t,r,i,u){var h=r.flags;switch(r.tag){case 0:case 11:case 15:Wn(t,r,i,u),h&2048&&pi(9,r);break;case 1:Wn(t,r,i,u);break;case 3:Wn(t,r,i,u),h&2048&&(t=null,r.alternate!==null&&(t=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==t&&(r.refCount++,t!=null&&ti(t)));break;case 12:if(h&2048){Wn(t,r,i,u),t=r.stateNode;try{var x=r.memoizedProps,C=x.id,O=x.onPostCommit;typeof O=="function"&&O(C,r.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(q){mt(r,r.return,q)}}else Wn(t,r,i,u);break;case 13:Wn(t,r,i,u);break;case 23:break;case 22:x=r.stateNode,C=r.alternate,r.memoizedState!==null?x._visibility&2?Wn(t,r,i,u):xi(t,r):x._visibility&2?Wn(t,r,i,u):(x._visibility|=2,Bo(t,r,i,u,(r.subtreeFlags&10256)!==0)),h&2048&&tm(C,r);break;case 24:Wn(t,r,i,u),h&2048&&nm(r.alternate,r);break;default:Wn(t,r,i,u)}}function Bo(t,r,i,u,h){for(h=h&&(r.subtreeFlags&10256)!==0,r=r.child;r!==null;){var x=t,C=r,O=i,q=u,ee=C.flags;switch(C.tag){case 0:case 11:case 15:Bo(x,C,O,q,h),pi(8,C);break;case 23:break;case 22:var fe=C.stateNode;C.memoizedState!==null?fe._visibility&2?Bo(x,C,O,q,h):xi(x,C):(fe._visibility|=2,Bo(x,C,O,q,h)),h&&ee&2048&&tm(C.alternate,C);break;case 24:Bo(x,C,O,q,h),h&&ee&2048&&nm(C.alternate,C);break;default:Bo(x,C,O,q,h)}r=r.sibling}}function xi(t,r){if(r.subtreeFlags&10256)for(r=r.child;r!==null;){var i=t,u=r,h=u.flags;switch(u.tag){case 22:xi(i,u),h&2048&&tm(u.alternate,u);break;case 24:xi(i,u),h&2048&&nm(u.alternate,u);break;default:xi(i,u)}r=r.sibling}}var yi=8192;function Po(t){if(t.subtreeFlags&yi)for(t=t.child;t!==null;)B0(t),t=t.sibling}function B0(t){switch(t.tag){case 26:Po(t),t.flags&yi&&t.memoizedState!==null&&oE(On,t.memoizedState,t.memoizedProps);break;case 5:Po(t);break;case 3:case 4:var r=On;On=Ac(t.stateNode.containerInfo),Po(t),On=r;break;case 22:t.memoizedState===null&&(r=t.alternate,r!==null&&r.memoizedState!==null?(r=yi,yi=16777216,Po(t),yi=r):Po(t));break;default:Po(t)}}function P0(t){var r=t.alternate;if(r!==null&&(t=r.child,t!==null)){r.child=null;do r=t.sibling,t.sibling=null,t=r;while(t!==null)}}function vi(t){var r=t.deletions;if((t.flags&16)!==0){if(r!==null)for(var i=0;i<r.length;i++){var u=r[i];Ot=u,V0(u,t)}P0(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)U0(t),t=t.sibling}function U0(t){switch(t.tag){case 0:case 11:case 15:vi(t),t.flags&2048&&Kr(9,t,t.return);break;case 3:vi(t);break;case 12:vi(t);break;case 22:var r=t.stateNode;t.memoizedState!==null&&r._visibility&2&&(t.return===null||t.return.tag!==13)?(r._visibility&=-3,xc(t)):vi(t);break;default:vi(t)}}function xc(t){var r=t.deletions;if((t.flags&16)!==0){if(r!==null)for(var i=0;i<r.length;i++){var u=r[i];Ot=u,V0(u,t)}P0(t)}for(t=t.child;t!==null;){switch(r=t,r.tag){case 0:case 11:case 15:Kr(8,r,r.return),xc(r);break;case 22:i=r.stateNode,i._visibility&2&&(i._visibility&=-3,xc(r));break;default:xc(r)}t=t.sibling}}function V0(t,r){for(;Ot!==null;){var i=Ot;switch(i.tag){case 0:case 11:case 15:Kr(8,i,r);break;case 23:case 22:if(i.memoizedState!==null&&i.memoizedState.cachePool!==null){var u=i.memoizedState.cachePool.pool;u!=null&&u.refCount++}break;case 24:ti(i.memoizedState.cache)}if(u=i.child,u!==null)u.return=i,Ot=u;else e:for(i=t;Ot!==null;){u=Ot;var h=u.sibling,x=u.return;if(O0(u),u===i){Ot=null;break e}if(h!==null){h.return=x,Ot=h;break e}Ot=x}}}var w_={getCacheForType:function(t){var r=Ft(At),i=r.data.get(t);return i===void 0&&(i=t(),r.data.set(t,i)),i}},N_=typeof WeakMap=="function"?WeakMap:Map,at=0,pt=null,Xe=null,et=0,it=0,fn=null,es=!1,Uo=!1,rm=!1,kr=0,Nt=0,ts=0,Gs=0,sm=0,Cn=0,Vo=0,bi=null,on=null,om=!1,am=0,yc=1/0,vc=null,ns=null,Ht=0,rs=null,qo=null,Fo=0,im=0,lm=null,q0=null,wi=0,cm=null;function mn(){if((at&2)!==0&&et!==0)return et&-et;if(A.T!==null){var t=Ro;return t!==0?t:gm()}return El()}function F0(){Cn===0&&(Cn=(et&536870912)===0||ot?Vt():536870912);var t=En.current;return t!==null&&(t.flags|=32),Cn}function hn(t,r,i){(t===pt&&(it===2||it===9)||t.cancelPendingCommit!==null)&&(Yo(t,0),ss(t,et,Cn,!1)),Ms(t,i),((at&2)===0||t!==pt)&&(t===pt&&((at&2)===0&&(Gs|=i),Nt===4&&ss(t,et,Cn,!1)),Kn(t))}function Y0(t,r,i){if((at&6)!==0)throw Error(o(327));var u=!i&&(r&124)===0&&(r&t.expiredLanes)===0||rt(t,r),h=u?__(t,r):fm(t,r,!0),x=u;do{if(h===0){Uo&&!u&&ss(t,r,0,!1);break}else{if(i=t.current.alternate,x&&!S_(i)){h=fm(t,r,!1),x=!1;continue}if(h===2){if(x=r,t.errorRecoveryDisabledLanes&x)var C=0;else C=t.pendingLanes&-536870913,C=C!==0?C:C&536870912?536870912:0;if(C!==0){r=C;e:{var O=t;h=bi;var q=O.current.memoizedState.isDehydrated;if(q&&(Yo(O,C).flags|=256),C=fm(O,C,!1),C!==2){if(rm&&!q){O.errorRecoveryDisabledLanes|=x,Gs|=x,h=4;break e}x=on,on=h,x!==null&&(on===null?on=x:on.push.apply(on,x))}h=C}if(x=!1,h!==2)continue}}if(h===1){Yo(t,0),ss(t,r,0,!0);break}e:{switch(u=t,x=h,x){case 0:case 1:throw Error(o(345));case 4:if((r&4194048)!==r)break;case 6:ss(u,r,Cn,!es);break e;case 2:on=null;break;case 3:case 5:break;default:throw Error(o(329))}if((r&62914560)===r&&(h=am+300-Qe(),10<h)){if(ss(u,r,Cn,!es),je(u,0,!0)!==0)break e;u.timeoutHandle=wy(G0.bind(null,u,i,on,vc,om,r,Cn,Gs,Vo,es,x,2,-0,0),h);break e}G0(u,i,on,vc,om,r,Cn,Gs,Vo,es,x,0,-0,0)}}break}while(!0);Kn(t)}function G0(t,r,i,u,h,x,C,O,q,ee,fe,xe,se,oe){if(t.timeoutHandle=-1,xe=r.subtreeFlags,(xe&8192||(xe&16785408)===16785408)&&(ki={stylesheets:null,count:0,unsuspend:sE},B0(r),xe=aE(),xe!==null)){t.cancelPendingCommit=xe(ey.bind(null,t,r,x,i,u,h,C,O,q,fe,1,se,oe)),ss(t,x,C,!ee);return}ey(t,r,x,i,u,h,C,O,q)}function S_(t){for(var r=t;;){var i=r.tag;if((i===0||i===11||i===15)&&r.flags&16384&&(i=r.updateQueue,i!==null&&(i=i.stores,i!==null)))for(var u=0;u<i.length;u++){var h=i[u],x=h.getSnapshot;h=h.value;try{if(!ln(x(),h))return!1}catch{return!1}}if(i=r.child,r.subtreeFlags&16384&&i!==null)i.return=r,r=i;else{if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function ss(t,r,i,u){r&=~sm,r&=~Gs,t.suspendedLanes|=r,t.pingedLanes&=~r,u&&(t.warmLanes|=r),u=t.expirationTimes;for(var h=r;0<h;){var x=31-ce(h),C=1<<x;u[x]=-1,h&=~C}i!==0&&_l(t,i,r)}function bc(){return(at&6)===0?(Ni(0),!1):!0}function um(){if(Xe!==null){if(it===0)var t=Xe.return;else t=Xe,br=Ps=null,Cf(t),Ho=null,fi=0,t=Xe;for(;t!==null;)E0(t.alternate,t),t=t.return;Xe=null}}function Yo(t,r){var i=t.timeoutHandle;i!==-1&&(t.timeoutHandle=-1,P_(i)),i=t.cancelPendingCommit,i!==null&&(t.cancelPendingCommit=null,i()),um(),pt=t,Xe=i=xr(t.current,null),et=r,it=0,fn=null,es=!1,Uo=rt(t,r),rm=!1,Vo=Cn=sm=Gs=ts=Nt=0,on=bi=null,om=!1,(r&8)!==0&&(r|=r&32);var u=t.entangledLanes;if(u!==0)for(t=t.entanglements,u&=r;0<u;){var h=31-ce(u),x=1<<h;r|=t[h],u&=~x}return kr=r,Ul(),i}function X0(t,r){qe=null,A.H=ic,r===ri||r===Kl?(r=dx(),it=3):r===lx?(r=dx(),it=4):it=r===f0?8:r!==null&&typeof r=="object"&&typeof r.then=="function"?6:1,fn=r,Xe===null&&(Nt=1,fc(t,Nn(r,t.current)))}function Z0(){var t=A.H;return A.H=ic,t===null?ic:t}function W0(){var t=A.A;return A.A=w_,t}function dm(){Nt=4,es||(et&4194048)!==et&&En.current!==null||(Uo=!0),(ts&134217727)===0&&(Gs&134217727)===0||pt===null||ss(pt,et,Cn,!1)}function fm(t,r,i){var u=at;at|=2;var h=Z0(),x=W0();(pt!==t||et!==r)&&(vc=null,Yo(t,r)),r=!1;var C=Nt;e:do try{if(it!==0&&Xe!==null){var O=Xe,q=fn;switch(it){case 8:um(),C=6;break e;case 3:case 2:case 9:case 6:En.current===null&&(r=!0);var ee=it;if(it=0,fn=null,Go(t,O,q,ee),i&&Uo){C=0;break e}break;default:ee=it,it=0,fn=null,Go(t,O,q,ee)}}j_(),C=Nt;break}catch(fe){X0(t,fe)}while(!0);return r&&t.shellSuspendCounter++,br=Ps=null,at=u,A.H=h,A.A=x,Xe===null&&(pt=null,et=0,Ul()),C}function j_(){for(;Xe!==null;)K0(Xe)}function __(t,r){var i=at;at|=2;var u=Z0(),h=W0();pt!==t||et!==r?(vc=null,yc=Qe()+500,Yo(t,r)):Uo=rt(t,r);e:do try{if(it!==0&&Xe!==null){r=Xe;var x=fn;t:switch(it){case 1:it=0,fn=null,Go(t,r,x,1);break;case 2:case 9:if(cx(x)){it=0,fn=null,Q0(r);break}r=function(){it!==2&&it!==9||pt!==t||(it=7),Kn(t)},x.then(r,r);break e;case 3:it=7;break e;case 4:it=5;break e;case 7:cx(x)?(it=0,fn=null,Q0(r)):(it=0,fn=null,Go(t,r,x,7));break;case 5:var C=null;switch(Xe.tag){case 26:C=Xe.memoizedState;case 5:case 27:var O=Xe;if(!C||Dy(C)){it=0,fn=null;var q=O.sibling;if(q!==null)Xe=q;else{var ee=O.return;ee!==null?(Xe=ee,wc(ee)):Xe=null}break t}}it=0,fn=null,Go(t,r,x,5);break;case 6:it=0,fn=null,Go(t,r,x,6);break;case 8:um(),Nt=6;break e;default:throw Error(o(462))}}E_();break}catch(fe){X0(t,fe)}while(!0);return br=Ps=null,A.H=u,A.A=h,at=i,Xe!==null?0:(pt=null,et=0,Ul(),Nt)}function E_(){for(;Xe!==null&&!Ee();)K0(Xe)}function K0(t){var r=j0(t.alternate,t,kr);t.memoizedProps=t.pendingProps,r===null?wc(t):Xe=r}function Q0(t){var r=t,i=r.alternate;switch(r.tag){case 15:case 0:r=y0(i,r,r.pendingProps,r.type,void 0,et);break;case 11:r=y0(i,r,r.pendingProps,r.type.render,r.ref,et);break;case 5:Cf(r);default:E0(i,r),r=Xe=Jg(r,kr),r=j0(i,r,kr)}t.memoizedProps=t.pendingProps,r===null?wc(t):Xe=r}function Go(t,r,i,u){br=Ps=null,Cf(r),Ho=null,fi=0;var h=r.return;try{if(p_(t,h,r,i,et)){Nt=1,fc(t,Nn(i,t.current)),Xe=null;return}}catch(x){if(h!==null)throw Xe=h,x;Nt=1,fc(t,Nn(i,t.current)),Xe=null;return}r.flags&32768?(ot||u===1?t=!0:Uo||(et&536870912)!==0?t=!1:(es=t=!0,(u===2||u===9||u===3||u===6)&&(u=En.current,u!==null&&u.tag===13&&(u.flags|=16384))),J0(r,t)):wc(r)}function wc(t){var r=t;do{if((r.flags&32768)!==0){J0(r,es);return}t=r.return;var i=x_(r.alternate,r,kr);if(i!==null){Xe=i;return}if(r=r.sibling,r!==null){Xe=r;return}Xe=r=t}while(r!==null);Nt===0&&(Nt=5)}function J0(t,r){do{var i=y_(t.alternate,t);if(i!==null){i.flags&=32767,Xe=i;return}if(i=t.return,i!==null&&(i.flags|=32768,i.subtreeFlags=0,i.deletions=null),!r&&(t=t.sibling,t!==null)){Xe=t;return}Xe=t=i}while(t!==null);Nt=6,Xe=null}function ey(t,r,i,u,h,x,C,O,q){t.cancelPendingCommit=null;do Nc();while(Ht!==0);if((at&6)!==0)throw Error(o(327));if(r!==null){if(r===t.current)throw Error(o(177));if(x=r.lanes|r.childLanes,x|=tf,kd(t,i,x,C,O,q),t===pt&&(Xe=pt=null,et=0),qo=r,rs=t,Fo=i,im=x,lm=h,q0=u,(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,M_(We,function(){return oy(),null})):(t.callbackNode=null,t.callbackPriority=0),u=(r.flags&13878)!==0,(r.subtreeFlags&13878)!==0||u){u=A.T,A.T=null,h=I.p,I.p=2,C=at,at|=4;try{v_(t,r,i)}finally{at=C,I.p=h,A.T=u}}Ht=1,ty(),ny(),ry()}}function ty(){if(Ht===1){Ht=0;var t=rs,r=qo,i=(r.flags&13878)!==0;if((r.subtreeFlags&13878)!==0||i){i=A.T,A.T=null;var u=I.p;I.p=2;var h=at;at|=4;try{L0(r,t);var x=jm,C=Vg(t.containerInfo),O=x.focusedElem,q=x.selectionRange;if(C!==O&&O&&O.ownerDocument&&Ug(O.ownerDocument.documentElement,O)){if(q!==null&&Wd(O)){var ee=q.start,fe=q.end;if(fe===void 0&&(fe=ee),"selectionStart"in O)O.selectionStart=ee,O.selectionEnd=Math.min(fe,O.value.length);else{var xe=O.ownerDocument||document,se=xe&&xe.defaultView||window;if(se.getSelection){var oe=se.getSelection(),Be=O.textContent.length,Le=Math.min(q.start,Be),ut=q.end===void 0?Le:Math.min(q.end,Be);!oe.extend&&Le>ut&&(C=ut,ut=Le,Le=C);var X=Pg(O,Le),Y=Pg(O,ut);if(X&&Y&&(oe.rangeCount!==1||oe.anchorNode!==X.node||oe.anchorOffset!==X.offset||oe.focusNode!==Y.node||oe.focusOffset!==Y.offset)){var Q=xe.createRange();Q.setStart(X.node,X.offset),oe.removeAllRanges(),Le>ut?(oe.addRange(Q),oe.extend(Y.node,Y.offset)):(Q.setEnd(Y.node,Y.offset),oe.addRange(Q))}}}}for(xe=[],oe=O;oe=oe.parentNode;)oe.nodeType===1&&xe.push({element:oe,left:oe.scrollLeft,top:oe.scrollTop});for(typeof O.focus=="function"&&O.focus(),O=0;O<xe.length;O++){var he=xe[O];he.element.scrollLeft=he.left,he.element.scrollTop=he.top}}Oc=!!Sm,jm=Sm=null}finally{at=h,I.p=u,A.T=i}}t.current=r,Ht=2}}function ny(){if(Ht===2){Ht=0;var t=rs,r=qo,i=(r.flags&8772)!==0;if((r.subtreeFlags&8772)!==0||i){i=A.T,A.T=null;var u=I.p;I.p=2;var h=at;at|=4;try{D0(t,r.alternate,r)}finally{at=h,I.p=u,A.T=i}}Ht=3}}function ry(){if(Ht===4||Ht===3){Ht=0,Ve();var t=rs,r=qo,i=Fo,u=q0;(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?Ht=5:(Ht=0,qo=rs=null,sy(t,t.pendingLanes));var h=t.pendingLanes;if(h===0&&(ns=null),Da(i),r=r.stateNode,me&&typeof me.onCommitFiberRoot=="function")try{me.onCommitFiberRoot(ue,r,void 0,(r.current.flags&128)===128)}catch{}if(u!==null){r=A.T,h=I.p,I.p=2,A.T=null;try{for(var x=t.onRecoverableError,C=0;C<u.length;C++){var O=u[C];x(O.value,{componentStack:O.stack})}}finally{A.T=r,I.p=h}}(Fo&3)!==0&&Nc(),Kn(t),h=t.pendingLanes,(i&4194090)!==0&&(h&42)!==0?t===cm?wi++:(wi=0,cm=t):wi=0,Ni(0)}}function sy(t,r){(t.pooledCacheLanes&=r)===0&&(r=t.pooledCache,r!=null&&(t.pooledCache=null,ti(r)))}function Nc(t){return ty(),ny(),ry(),oy()}function oy(){if(Ht!==5)return!1;var t=rs,r=im;im=0;var i=Da(Fo),u=A.T,h=I.p;try{I.p=32>i?32:i,A.T=null,i=lm,lm=null;var x=rs,C=Fo;if(Ht=0,qo=rs=null,Fo=0,(at&6)!==0)throw Error(o(331));var O=at;if(at|=4,U0(x.current),$0(x,x.current,C,i),at=O,Ni(0,!1),me&&typeof me.onPostCommitFiberRoot=="function")try{me.onPostCommitFiberRoot(ue,x)}catch{}return!0}finally{I.p=h,A.T=u,sy(t,r)}}function ay(t,r,i){r=Nn(i,r),r=Pf(t.stateNode,r,2),t=Gr(t,r,2),t!==null&&(Ms(t,2),Kn(t))}function mt(t,r,i){if(t.tag===3)ay(t,t,i);else for(;r!==null;){if(r.tag===3){ay(r,t,i);break}else if(r.tag===1){var u=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&(ns===null||!ns.has(u))){t=Nn(i,t),i=u0(2),u=Gr(r,i,2),u!==null&&(d0(i,u,r,t),Ms(u,2),Kn(u));break}}r=r.return}}function mm(t,r,i){var u=t.pingCache;if(u===null){u=t.pingCache=new N_;var h=new Set;u.set(r,h)}else h=u.get(r),h===void 0&&(h=new Set,u.set(r,h));h.has(i)||(rm=!0,h.add(i),t=C_.bind(null,t,r,i),r.then(t,t))}function C_(t,r,i){var u=t.pingCache;u!==null&&u.delete(r),t.pingedLanes|=t.suspendedLanes&i,t.warmLanes&=~i,pt===t&&(et&i)===i&&(Nt===4||Nt===3&&(et&62914560)===et&&300>Qe()-am?(at&2)===0&&Yo(t,0):sm|=i,Vo===et&&(Vo=0)),Kn(t)}function iy(t,r){r===0&&(r=Fn()),t=ko(t,r),t!==null&&(Ms(t,r),Kn(t))}function k_(t){var r=t.memoizedState,i=0;r!==null&&(i=r.retryLane),iy(t,i)}function A_(t,r){var i=0;switch(t.tag){case 13:var u=t.stateNode,h=t.memoizedState;h!==null&&(i=h.retryLane);break;case 19:u=t.stateNode;break;case 22:u=t.stateNode._retryCache;break;default:throw Error(o(314))}u!==null&&u.delete(r),iy(t,i)}function M_(t,r){return Re(t,r)}var Sc=null,Xo=null,hm=!1,jc=!1,pm=!1,Xs=0;function Kn(t){t!==Xo&&t.next===null&&(Xo===null?Sc=Xo=t:Xo=Xo.next=t),jc=!0,hm||(hm=!0,R_())}function Ni(t,r){if(!pm&&jc){pm=!0;do for(var i=!1,u=Sc;u!==null;){if(t!==0){var h=u.pendingLanes;if(h===0)var x=0;else{var C=u.suspendedLanes,O=u.pingedLanes;x=(1<<31-ce(42|t)+1)-1,x&=h&~(C&~O),x=x&201326741?x&201326741|1:x?x|2:0}x!==0&&(i=!0,dy(u,x))}else x=et,x=je(u,u===pt?x:0,u.cancelPendingCommit!==null||u.timeoutHandle!==-1),(x&3)===0||rt(u,x)||(i=!0,dy(u,x));u=u.next}while(i);pm=!1}}function T_(){ly()}function ly(){jc=hm=!1;var t=0;Xs!==0&&(B_()&&(t=Xs),Xs=0);for(var r=Qe(),i=null,u=Sc;u!==null;){var h=u.next,x=cy(u,r);x===0?(u.next=null,i===null?Sc=h:i.next=h,h===null&&(Xo=i)):(i=u,(t!==0||(x&3)!==0)&&(jc=!0)),u=h}Ni(t)}function cy(t,r){for(var i=t.suspendedLanes,u=t.pingedLanes,h=t.expirationTimes,x=t.pendingLanes&-62914561;0<x;){var C=31-ce(x),O=1<<C,q=h[C];q===-1?((O&i)===0||(O&u)!==0)&&(h[C]=ft(O,r)):q<=r&&(t.expiredLanes|=O),x&=~O}if(r=pt,i=et,i=je(t,t===r?i:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),u=t.callbackNode,i===0||t===r&&(it===2||it===9)||t.cancelPendingCommit!==null)return u!==null&&u!==null&&te(u),t.callbackNode=null,t.callbackPriority=0;if((i&3)===0||rt(t,i)){if(r=i&-i,r===t.callbackPriority)return r;switch(u!==null&&te(u),Da(i)){case 2:case 8:i=ht;break;case 32:i=We;break;case 268435456:i=wn;break;default:i=We}return u=uy.bind(null,t),i=Re(i,u),t.callbackPriority=r,t.callbackNode=i,r}return u!==null&&u!==null&&te(u),t.callbackPriority=2,t.callbackNode=null,2}function uy(t,r){if(Ht!==0&&Ht!==5)return t.callbackNode=null,t.callbackPriority=0,null;var i=t.callbackNode;if(Nc()&&t.callbackNode!==i)return null;var u=et;return u=je(t,t===pt?u:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),u===0?null:(Y0(t,u,r),cy(t,Qe()),t.callbackNode!=null&&t.callbackNode===i?uy.bind(null,t):null)}function dy(t,r){if(Nc())return null;Y0(t,r,!0)}function R_(){U_(function(){(at&6)!==0?Re(Zt,T_):ly()})}function gm(){return Xs===0&&(Xs=Vt()),Xs}function fy(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:zl(""+t)}function my(t,r){var i=r.ownerDocument.createElement("input");return i.name=r.name,i.value=r.value,t.id&&i.setAttribute("form",t.id),r.parentNode.insertBefore(i,r),t=new FormData(t),i.parentNode.removeChild(i),t}function D_(t,r,i,u,h){if(r==="submit"&&i&&i.stateNode===h){var x=fy((h[qt]||null).action),C=u.submitter;C&&(r=(r=C[qt]||null)?fy(r.formAction):C.getAttribute("formAction"),r!==null&&(x=r,C=null));var O=new $l("action","action",null,u,h);t.push({event:O,listeners:[{instance:null,listener:function(){if(u.defaultPrevented){if(Xs!==0){var q=C?my(h,C):new FormData(h);If(i,{pending:!0,data:q,method:h.method,action:x},null,q)}}else typeof x=="function"&&(O.preventDefault(),q=C?my(h,C):new FormData(h),If(i,{pending:!0,data:q,method:h.method,action:x},x,q))},currentTarget:h}]})}}for(var xm=0;xm<ef.length;xm++){var ym=ef[xm],O_=ym.toLowerCase(),z_=ym[0].toUpperCase()+ym.slice(1);Dn(O_,"on"+z_)}Dn(Yg,"onAnimationEnd"),Dn(Gg,"onAnimationIteration"),Dn(Xg,"onAnimationStart"),Dn("dblclick","onDoubleClick"),Dn("focusin","onFocus"),Dn("focusout","onBlur"),Dn(Qj,"onTransitionRun"),Dn(Jj,"onTransitionStart"),Dn(e_,"onTransitionCancel"),Dn(Zg,"onTransitionEnd"),Ur("onMouseEnter",["mouseout","mouseover"]),Ur("onMouseLeave",["mouseout","mouseover"]),Ur("onPointerEnter",["pointerout","pointerover"]),Ur("onPointerLeave",["pointerout","pointerover"]),mr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),mr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),mr("onBeforeInput",["compositionend","keypress","textInput","paste"]),mr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),mr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),mr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Si="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(" "),I_=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Si));function hy(t,r){r=(r&4)!==0;for(var i=0;i<t.length;i++){var u=t[i],h=u.event;u=u.listeners;e:{var x=void 0;if(r)for(var C=u.length-1;0<=C;C--){var O=u[C],q=O.instance,ee=O.currentTarget;if(O=O.listener,q!==x&&h.isPropagationStopped())break e;x=O,h.currentTarget=ee;try{x(h)}catch(fe){dc(fe)}h.currentTarget=null,x=q}else for(C=0;C<u.length;C++){if(O=u[C],q=O.instance,ee=O.currentTarget,O=O.listener,q!==x&&h.isPropagationStopped())break e;x=O,h.currentTarget=ee;try{x(h)}catch(fe){dc(fe)}h.currentTarget=null,x=q}}}}function Ze(t,r){var i=r[Oa];i===void 0&&(i=r[Oa]=new Set);var u=t+"__bubble";i.has(u)||(py(r,t,2,!1),i.add(u))}function vm(t,r,i){var u=0;r&&(u|=4),py(i,t,u,r)}var _c="_reactListening"+Math.random().toString(36).slice(2);function bm(t){if(!t[_c]){t[_c]=!0,kl.forEach(function(i){i!=="selectionchange"&&(I_.has(i)||vm(i,!1,t),vm(i,!0,t))});var r=t.nodeType===9?t:t.ownerDocument;r===null||r[_c]||(r[_c]=!0,vm("selectionchange",!1,r))}}function py(t,r,i,u){switch($y(r)){case 2:var h=cE;break;case 8:h=uE;break;default:h=Om}i=h.bind(null,r,i,t),h=void 0,!Pd||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(h=!0),u?h!==void 0?t.addEventListener(r,i,{capture:!0,passive:h}):t.addEventListener(r,i,!0):h!==void 0?t.addEventListener(r,i,{passive:h}):t.addEventListener(r,i,!1)}function wm(t,r,i,u,h){var x=u;if((r&1)===0&&(r&2)===0&&u!==null)e:for(;;){if(u===null)return;var C=u.tag;if(C===3||C===4){var O=u.stateNode.containerInfo;if(O===h)break;if(C===4)for(C=u.return;C!==null;){var q=C.tag;if((q===3||q===4)&&C.stateNode.containerInfo===h)return;C=C.return}for(;O!==null;){if(C=Br(O),C===null)return;if(q=C.tag,q===5||q===6||q===26||q===27){u=x=C;continue e}O=O.parentNode}}u=u.return}Ng(function(){var ee=x,fe=$d(i),xe=[];e:{var se=Wg.get(t);if(se!==void 0){var oe=$l,Be=t;switch(t){case"keypress":if(Ll(i)===0)break e;case"keydown":case"keyup":oe=Mj;break;case"focusin":Be="focus",oe=Fd;break;case"focusout":Be="blur",oe=Fd;break;case"beforeblur":case"afterblur":oe=Fd;break;case"click":if(i.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":oe=_g;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":oe=yj;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":oe=Dj;break;case Yg:case Gg:case Xg:oe=wj;break;case Zg:oe=zj;break;case"scroll":case"scrollend":oe=gj;break;case"wheel":oe=Lj;break;case"copy":case"cut":case"paste":oe=Sj;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":oe=Cg;break;case"toggle":case"beforetoggle":oe=$j}var Le=(r&4)!==0,ut=!Le&&(t==="scroll"||t==="scrollend"),X=Le?se!==null?se+"Capture":null:se;Le=[];for(var Y=ee,Q;Y!==null;){var he=Y;if(Q=he.stateNode,he=he.tag,he!==5&&he!==26&&he!==27||Q===null||X===null||(he=Ua(Y,X),he!=null&&Le.push(ji(Y,he,Q))),ut)break;Y=Y.return}0<Le.length&&(se=new oe(se,Be,null,i,fe),xe.push({event:se,listeners:Le}))}}if((r&7)===0){e:{if(se=t==="mouseover"||t==="pointerover",oe=t==="mouseout"||t==="pointerout",se&&i!==Hd&&(Be=i.relatedTarget||i.fromElement)&&(Br(Be)||Be[$r]))break e;if((oe||se)&&(se=fe.window===fe?fe:(se=fe.ownerDocument)?se.defaultView||se.parentWindow:window,oe?(Be=i.relatedTarget||i.toElement,oe=ee,Be=Be?Br(Be):null,Be!==null&&(ut=c(Be),Le=Be.tag,Be!==ut||Le!==5&&Le!==27&&Le!==6)&&(Be=null)):(oe=null,Be=ee),oe!==Be)){if(Le=_g,he="onMouseLeave",X="onMouseEnter",Y="mouse",(t==="pointerout"||t==="pointerover")&&(Le=Cg,he="onPointerLeave",X="onPointerEnter",Y="pointer"),ut=oe==null?se:Pr(oe),Q=Be==null?se:Pr(Be),se=new Le(he,Y+"leave",oe,i,fe),se.target=ut,se.relatedTarget=Q,he=null,Br(fe)===ee&&(Le=new Le(X,Y+"enter",Be,i,fe),Le.target=Q,Le.relatedTarget=ut,he=Le),ut=he,oe&&Be)t:{for(Le=oe,X=Be,Y=0,Q=Le;Q;Q=Zo(Q))Y++;for(Q=0,he=X;he;he=Zo(he))Q++;for(;0<Y-Q;)Le=Zo(Le),Y--;for(;0<Q-Y;)X=Zo(X),Q--;for(;Y--;){if(Le===X||X!==null&&Le===X.alternate)break t;Le=Zo(Le),X=Zo(X)}Le=null}else Le=null;oe!==null&&gy(xe,se,oe,Le,!1),Be!==null&&ut!==null&&gy(xe,ut,Be,Le,!0)}}e:{if(se=ee?Pr(ee):window,oe=se.nodeName&&se.nodeName.toLowerCase(),oe==="select"||oe==="input"&&se.type==="file")var ke=zg;else if(Dg(se))if(Ig)ke=Zj;else{ke=Gj;var Ye=Yj}else oe=se.nodeName,!oe||oe.toLowerCase()!=="input"||se.type!=="checkbox"&&se.type!=="radio"?ee&&Ld(ee.elementType)&&(ke=zg):ke=Xj;if(ke&&(ke=ke(t,ee))){Og(xe,ke,i,fe);break e}Ye&&Ye(t,se,ee),t==="focusout"&&ee&&se.type==="number"&&ee.memoizedProps.value!=null&&Pa(se,"number",se.value)}switch(Ye=ee?Pr(ee):window,t){case"focusin":(Dg(Ye)||Ye.contentEditable==="true")&&(_o=Ye,Kd=ee,Wa=null);break;case"focusout":Wa=Kd=_o=null;break;case"mousedown":Qd=!0;break;case"contextmenu":case"mouseup":case"dragend":Qd=!1,qg(xe,i,fe);break;case"selectionchange":if(Kj)break;case"keydown":case"keyup":qg(xe,i,fe)}var ze;if(Gd)e:{switch(t){case"compositionstart":var $e="onCompositionStart";break e;case"compositionend":$e="onCompositionEnd";break e;case"compositionupdate":$e="onCompositionUpdate";break e}$e=void 0}else jo?Tg(t,i)&&($e="onCompositionEnd"):t==="keydown"&&i.keyCode===229&&($e="onCompositionStart");$e&&(kg&&i.locale!=="ko"&&(jo||$e!=="onCompositionStart"?$e==="onCompositionEnd"&&jo&&(ze=Sg()):(Vr=fe,Ud="value"in Vr?Vr.value:Vr.textContent,jo=!0)),Ye=Ec(ee,$e),0<Ye.length&&($e=new Eg($e,t,null,i,fe),xe.push({event:$e,listeners:Ye}),ze?$e.data=ze:(ze=Rg(i),ze!==null&&($e.data=ze)))),(ze=Pj?Uj(t,i):Vj(t,i))&&($e=Ec(ee,"onBeforeInput"),0<$e.length&&(Ye=new Eg("onBeforeInput","beforeinput",null,i,fe),xe.push({event:Ye,listeners:$e}),Ye.data=ze)),D_(xe,t,ee,i,fe)}hy(xe,r)})}function ji(t,r,i){return{instance:t,listener:r,currentTarget:i}}function Ec(t,r){for(var i=r+"Capture",u=[];t!==null;){var h=t,x=h.stateNode;if(h=h.tag,h!==5&&h!==26&&h!==27||x===null||(h=Ua(t,i),h!=null&&u.unshift(ji(t,h,x)),h=Ua(t,r),h!=null&&u.push(ji(t,h,x))),t.tag===3)return u;t=t.return}return[]}function Zo(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function gy(t,r,i,u,h){for(var x=r._reactName,C=[];i!==null&&i!==u;){var O=i,q=O.alternate,ee=O.stateNode;if(O=O.tag,q!==null&&q===u)break;O!==5&&O!==26&&O!==27||ee===null||(q=ee,h?(ee=Ua(i,x),ee!=null&&C.unshift(ji(i,ee,q))):h||(ee=Ua(i,x),ee!=null&&C.push(ji(i,ee,q)))),i=i.return}C.length!==0&&t.push({event:r,listeners:C})}var L_=/\r\n?/g,H_=/\u0000|\uFFFD/g;function xy(t){return(typeof t=="string"?t:""+t).replace(L_,`
`).replace(H_,"")}function yy(t,r){return r=xy(r),xy(t)===r}function Cc(){}function ct(t,r,i,u,h,x){switch(i){case"children":typeof u=="string"?r==="body"||r==="textarea"&&u===""||wo(t,u):(typeof u=="number"||typeof u=="bigint")&&r!=="body"&&wo(t,""+u);break;case"className":yo(t,"class",u);break;case"tabIndex":yo(t,"tabindex",u);break;case"dir":case"role":case"viewBox":case"width":case"height":yo(t,i,u);break;case"style":bg(t,u,x);break;case"data":if(r!=="object"){yo(t,"data",u);break}case"src":case"href":if(u===""&&(r!=="a"||i!=="href")){t.removeAttribute(i);break}if(u==null||typeof u=="function"||typeof u=="symbol"||typeof u=="boolean"){t.removeAttribute(i);break}u=zl(""+u),t.setAttribute(i,u);break;case"action":case"formAction":if(typeof u=="function"){t.setAttribute(i,"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"&&(i==="formAction"?(r!=="input"&&ct(t,r,"name",h.name,h,null),ct(t,r,"formEncType",h.formEncType,h,null),ct(t,r,"formMethod",h.formMethod,h,null),ct(t,r,"formTarget",h.formTarget,h,null)):(ct(t,r,"encType",h.encType,h,null),ct(t,r,"method",h.method,h,null),ct(t,r,"target",h.target,h,null)));if(u==null||typeof u=="symbol"||typeof u=="boolean"){t.removeAttribute(i);break}u=zl(""+u),t.setAttribute(i,u);break;case"onClick":u!=null&&(t.onclick=Cc);break;case"onScroll":u!=null&&Ze("scroll",t);break;case"onScrollEnd":u!=null&&Ze("scrollend",t);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(o(61));if(i=u.__html,i!=null){if(h.children!=null)throw Error(o(60));t.innerHTML=i}}break;case"multiple":t.multiple=u&&typeof u!="function"&&typeof u!="symbol";break;case"muted":t.muted=u&&typeof u!="function"&&typeof u!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(u==null||typeof u=="function"||typeof u=="boolean"||typeof u=="symbol"){t.removeAttribute("xlink:href");break}i=zl(""+u),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",i);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":u!=null&&typeof u!="function"&&typeof u!="symbol"?t.setAttribute(i,""+u):t.removeAttribute(i);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":u&&typeof u!="function"&&typeof u!="symbol"?t.setAttribute(i,""):t.removeAttribute(i);break;case"capture":case"download":u===!0?t.setAttribute(i,""):u!==!1&&u!=null&&typeof u!="function"&&typeof u!="symbol"?t.setAttribute(i,u):t.removeAttribute(i);break;case"cols":case"rows":case"size":case"span":u!=null&&typeof u!="function"&&typeof u!="symbol"&&!isNaN(u)&&1<=u?t.setAttribute(i,u):t.removeAttribute(i);break;case"rowSpan":case"start":u==null||typeof u=="function"||typeof u=="symbol"||isNaN(u)?t.removeAttribute(i):t.setAttribute(i,u);break;case"popover":Ze("beforetoggle",t),Ze("toggle",t),xo(t,"popover",u);break;case"xlinkActuate":Rn(t,"http://www.w3.org/1999/xlink","xlink:actuate",u);break;case"xlinkArcrole":Rn(t,"http://www.w3.org/1999/xlink","xlink:arcrole",u);break;case"xlinkRole":Rn(t,"http://www.w3.org/1999/xlink","xlink:role",u);break;case"xlinkShow":Rn(t,"http://www.w3.org/1999/xlink","xlink:show",u);break;case"xlinkTitle":Rn(t,"http://www.w3.org/1999/xlink","xlink:title",u);break;case"xlinkType":Rn(t,"http://www.w3.org/1999/xlink","xlink:type",u);break;case"xmlBase":Rn(t,"http://www.w3.org/XML/1998/namespace","xml:base",u);break;case"xmlLang":Rn(t,"http://www.w3.org/XML/1998/namespace","xml:lang",u);break;case"xmlSpace":Rn(t,"http://www.w3.org/XML/1998/namespace","xml:space",u);break;case"is":xo(t,"is",u);break;case"innerText":case"textContent":break;default:(!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")&&(i=hj.get(i)||i,xo(t,i,u))}}function Nm(t,r,i,u,h,x){switch(i){case"style":bg(t,u,x);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(o(61));if(i=u.__html,i!=null){if(h.children!=null)throw Error(o(60));t.innerHTML=i}}break;case"children":typeof u=="string"?wo(t,u):(typeof u=="number"||typeof u=="bigint")&&wo(t,""+u);break;case"onScroll":u!=null&&Ze("scroll",t);break;case"onScrollEnd":u!=null&&Ze("scrollend",t);break;case"onClick":u!=null&&(t.onclick=Cc);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Al.hasOwnProperty(i))e:{if(i[0]==="o"&&i[1]==="n"&&(h=i.endsWith("Capture"),r=i.slice(2,h?i.length-7:void 0),x=t[qt]||null,x=x!=null?x[i]:null,typeof x=="function"&&t.removeEventListener(r,x,h),typeof u=="function")){typeof x!="function"&&x!==null&&(i in t?t[i]=null:t.hasAttribute(i)&&t.removeAttribute(i)),t.addEventListener(r,u,h);break e}i in t?t[i]=u:u===!0?t.setAttribute(i,""):xo(t,i,u)}}}function $t(t,r,i){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ze("error",t),Ze("load",t);var u=!1,h=!1,x;for(x in i)if(i.hasOwnProperty(x)){var C=i[x];if(C!=null)switch(x){case"src":u=!0;break;case"srcSet":h=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,r));default:ct(t,r,x,C,i,null)}}h&&ct(t,r,"srcSet",i.srcSet,i,null),u&&ct(t,r,"src",i.src,i,null);return;case"input":Ze("invalid",t);var O=x=C=h=null,q=null,ee=null;for(u in i)if(i.hasOwnProperty(u)){var fe=i[u];if(fe!=null)switch(u){case"name":h=fe;break;case"type":C=fe;break;case"checked":q=fe;break;case"defaultChecked":ee=fe;break;case"value":x=fe;break;case"defaultValue":O=fe;break;case"children":case"dangerouslySetInnerHTML":if(fe!=null)throw Error(o(137,r));break;default:ct(t,r,u,fe,i,null)}}Ol(t,x,O,q,ee,C,h,!1),vo(t);return;case"select":Ze("invalid",t),u=C=x=null;for(h in i)if(i.hasOwnProperty(h)&&(O=i[h],O!=null))switch(h){case"value":x=O;break;case"defaultValue":C=O;break;case"multiple":u=O;default:ct(t,r,h,O,i,null)}r=x,i=C,t.multiple=!!u,r!=null?pr(t,!!u,r,!1):i!=null&&pr(t,!!u,i,!0);return;case"textarea":Ze("invalid",t),x=h=u=null;for(C in i)if(i.hasOwnProperty(C)&&(O=i[C],O!=null))switch(C){case"value":u=O;break;case"defaultValue":h=O;break;case"children":x=O;break;case"dangerouslySetInnerHTML":if(O!=null)throw Error(o(91));break;default:ct(t,r,C,O,i,null)}yg(t,u,h,x),vo(t);return;case"option":for(q in i)if(i.hasOwnProperty(q)&&(u=i[q],u!=null))switch(q){case"selected":t.selected=u&&typeof u!="function"&&typeof u!="symbol";break;default:ct(t,r,q,u,i,null)}return;case"dialog":Ze("beforetoggle",t),Ze("toggle",t),Ze("cancel",t),Ze("close",t);break;case"iframe":case"object":Ze("load",t);break;case"video":case"audio":for(u=0;u<Si.length;u++)Ze(Si[u],t);break;case"image":Ze("error",t),Ze("load",t);break;case"details":Ze("toggle",t);break;case"embed":case"source":case"link":Ze("error",t),Ze("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(ee in i)if(i.hasOwnProperty(ee)&&(u=i[ee],u!=null))switch(ee){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,r));default:ct(t,r,ee,u,i,null)}return;default:if(Ld(r)){for(fe in i)i.hasOwnProperty(fe)&&(u=i[fe],u!==void 0&&Nm(t,r,fe,u,i,void 0));return}}for(O in i)i.hasOwnProperty(O)&&(u=i[O],u!=null&&ct(t,r,O,u,i,null))}function $_(t,r,i,u){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var h=null,x=null,C=null,O=null,q=null,ee=null,fe=null;for(oe in i){var xe=i[oe];if(i.hasOwnProperty(oe)&&xe!=null)switch(oe){case"checked":break;case"value":break;case"defaultValue":q=xe;default:u.hasOwnProperty(oe)||ct(t,r,oe,null,u,xe)}}for(var se in u){var oe=u[se];if(xe=i[se],u.hasOwnProperty(se)&&(oe!=null||xe!=null))switch(se){case"type":x=oe;break;case"name":h=oe;break;case"checked":ee=oe;break;case"defaultChecked":fe=oe;break;case"value":C=oe;break;case"defaultValue":O=oe;break;case"children":case"dangerouslySetInnerHTML":if(oe!=null)throw Error(o(137,r));break;default:oe!==xe&&ct(t,r,se,oe,u,xe)}}Rs(t,C,O,q,ee,fe,x,h);return;case"select":oe=C=O=se=null;for(x in i)if(q=i[x],i.hasOwnProperty(x)&&q!=null)switch(x){case"value":break;case"multiple":oe=q;default:u.hasOwnProperty(x)||ct(t,r,x,null,u,q)}for(h in u)if(x=u[h],q=i[h],u.hasOwnProperty(h)&&(x!=null||q!=null))switch(h){case"value":se=x;break;case"defaultValue":O=x;break;case"multiple":C=x;default:x!==q&&ct(t,r,h,x,u,q)}r=O,i=C,u=oe,se!=null?pr(t,!!i,se,!1):!!u!=!!i&&(r!=null?pr(t,!!i,r,!0):pr(t,!!i,i?[]:"",!1));return;case"textarea":oe=se=null;for(O in i)if(h=i[O],i.hasOwnProperty(O)&&h!=null&&!u.hasOwnProperty(O))switch(O){case"value":break;case"children":break;default:ct(t,r,O,null,u,h)}for(C in u)if(h=u[C],x=i[C],u.hasOwnProperty(C)&&(h!=null||x!=null))switch(C){case"value":se=h;break;case"defaultValue":oe=h;break;case"children":break;case"dangerouslySetInnerHTML":if(h!=null)throw Error(o(91));break;default:h!==x&&ct(t,r,C,h,u,x)}xg(t,se,oe);return;case"option":for(var Be in i)if(se=i[Be],i.hasOwnProperty(Be)&&se!=null&&!u.hasOwnProperty(Be))switch(Be){case"selected":t.selected=!1;break;default:ct(t,r,Be,null,u,se)}for(q in u)if(se=u[q],oe=i[q],u.hasOwnProperty(q)&&se!==oe&&(se!=null||oe!=null))switch(q){case"selected":t.selected=se&&typeof se!="function"&&typeof se!="symbol";break;default:ct(t,r,q,se,u,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 Le in i)se=i[Le],i.hasOwnProperty(Le)&&se!=null&&!u.hasOwnProperty(Le)&&ct(t,r,Le,null,u,se);for(ee in u)if(se=u[ee],oe=i[ee],u.hasOwnProperty(ee)&&se!==oe&&(se!=null||oe!=null))switch(ee){case"children":case"dangerouslySetInnerHTML":if(se!=null)throw Error(o(137,r));break;default:ct(t,r,ee,se,u,oe)}return;default:if(Ld(r)){for(var ut in i)se=i[ut],i.hasOwnProperty(ut)&&se!==void 0&&!u.hasOwnProperty(ut)&&Nm(t,r,ut,void 0,u,se);for(fe in u)se=u[fe],oe=i[fe],!u.hasOwnProperty(fe)||se===oe||se===void 0&&oe===void 0||Nm(t,r,fe,se,u,oe);return}}for(var X in i)se=i[X],i.hasOwnProperty(X)&&se!=null&&!u.hasOwnProperty(X)&&ct(t,r,X,null,u,se);for(xe in u)se=u[xe],oe=i[xe],!u.hasOwnProperty(xe)||se===oe||se==null&&oe==null||ct(t,r,xe,se,u,oe)}var Sm=null,jm=null;function kc(t){return t.nodeType===9?t:t.ownerDocument}function vy(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 by(t,r){if(t===0)switch(r){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&r==="foreignObject"?0:t}function _m(t,r){return t==="textarea"||t==="noscript"||typeof r.children=="string"||typeof r.children=="number"||typeof r.children=="bigint"||typeof r.dangerouslySetInnerHTML=="object"&&r.dangerouslySetInnerHTML!==null&&r.dangerouslySetInnerHTML.__html!=null}var Em=null;function B_(){var t=window.event;return t&&t.type==="popstate"?t===Em?!1:(Em=t,!0):(Em=null,!1)}var wy=typeof setTimeout=="function"?setTimeout:void 0,P_=typeof clearTimeout=="function"?clearTimeout:void 0,Ny=typeof Promise=="function"?Promise:void 0,U_=typeof queueMicrotask=="function"?queueMicrotask:typeof Ny<"u"?function(t){return Ny.resolve(null).then(t).catch(V_)}:wy;function V_(t){setTimeout(function(){throw t})}function os(t){return t==="head"}function Sy(t,r){var i=r,u=0,h=0;do{var x=i.nextSibling;if(t.removeChild(i),x&&x.nodeType===8)if(i=x.data,i==="/$"){if(0<u&&8>u){i=u;var C=t.ownerDocument;if(i&1&&_i(C.documentElement),i&2&&_i(C.body),i&4)for(i=C.head,_i(i),C=i.firstChild;C;){var O=C.nextSibling,q=C.nodeName;C[Ts]||q==="SCRIPT"||q==="STYLE"||q==="LINK"&&C.rel.toLowerCase()==="stylesheet"||i.removeChild(C),C=O}}if(h===0){t.removeChild(x),Di(r);return}h--}else i==="$"||i==="$?"||i==="$!"?h++:u=i.charCodeAt(0)-48;else u=0;i=x}while(i);Di(r)}function Cm(t){var r=t.firstChild;for(r&&r.nodeType===10&&(r=r.nextSibling);r;){var i=r;switch(r=r.nextSibling,i.nodeName){case"HTML":case"HEAD":case"BODY":Cm(i),za(i);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(i.rel.toLowerCase()==="stylesheet")continue}t.removeChild(i)}}function q_(t,r,i,u){for(;t.nodeType===1;){var h=i;if(t.nodeName.toLowerCase()!==r.toLowerCase()){if(!u&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(u){if(!t[Ts])switch(r){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!==h.rel||t.getAttribute("href")!==(h.href==null||h.href===""?null:h.href)||t.getAttribute("crossorigin")!==(h.crossOrigin==null?null:h.crossOrigin)||t.getAttribute("title")!==(h.title==null?null:h.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(x=t.getAttribute("src"),(x!==(h.src==null?null:h.src)||t.getAttribute("type")!==(h.type==null?null:h.type)||t.getAttribute("crossorigin")!==(h.crossOrigin==null?null:h.crossOrigin))&&x&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(r==="input"&&t.type==="hidden"){var x=h.name==null?null:""+h.name;if(h.type==="hidden"&&t.getAttribute("name")===x)return t}else return t;if(t=zn(t.nextSibling),t===null)break}return null}function F_(t,r,i){if(r==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!i||(t=zn(t.nextSibling),t===null))return null;return t}function km(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState==="complete"}function Y_(t,r){var i=t.ownerDocument;if(t.data!=="$?"||i.readyState==="complete")r();else{var u=function(){r(),i.removeEventListener("DOMContentLoaded",u)};i.addEventListener("DOMContentLoaded",u),t._reactRetry=u}}function zn(t){for(;t!=null;t=t.nextSibling){var r=t.nodeType;if(r===1||r===3)break;if(r===8){if(r=t.data,r==="$"||r==="$!"||r==="$?"||r==="F!"||r==="F")break;if(r==="/$")return null}}return t}var Am=null;function jy(t){t=t.previousSibling;for(var r=0;t;){if(t.nodeType===8){var i=t.data;if(i==="$"||i==="$!"||i==="$?"){if(r===0)return t;r--}else i==="/$"&&r++}t=t.previousSibling}return null}function _y(t,r,i){switch(r=kc(i),t){case"html":if(t=r.documentElement,!t)throw Error(o(452));return t;case"head":if(t=r.head,!t)throw Error(o(453));return t;case"body":if(t=r.body,!t)throw Error(o(454));return t;default:throw Error(o(451))}}function _i(t){for(var r=t.attributes;r.length;)t.removeAttributeNode(r[0]);za(t)}var kn=new Map,Ey=new Set;function Ac(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var Ar=I.d;I.d={f:G_,r:X_,D:Z_,C:W_,L:K_,m:Q_,X:eE,S:J_,M:tE};function G_(){var t=Ar.f(),r=bc();return t||r}function X_(t){var r=dr(t);r!==null&&r.tag===5&&r.type==="form"?Yx(r):Ar.r(t)}var Wo=typeof document>"u"?null:document;function Cy(t,r,i){var u=Wo;if(u&&typeof r=="string"&&r){var h=tn(r);h='link[rel="'+t+'"][href="'+h+'"]',typeof i=="string"&&(h+='[crossorigin="'+i+'"]'),Ey.has(h)||(Ey.add(h),t={rel:t,crossOrigin:i,href:r},u.querySelector(h)===null&&(r=u.createElement("link"),$t(r,"link",t),_t(r),u.head.appendChild(r)))}}function Z_(t){Ar.D(t),Cy("dns-prefetch",t,null)}function W_(t,r){Ar.C(t,r),Cy("preconnect",t,r)}function K_(t,r,i){Ar.L(t,r,i);var u=Wo;if(u&&t&&r){var h='link[rel="preload"][as="'+tn(r)+'"]';r==="image"&&i&&i.imageSrcSet?(h+='[imagesrcset="'+tn(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(h+='[imagesizes="'+tn(i.imageSizes)+'"]')):h+='[href="'+tn(t)+'"]';var x=h;switch(r){case"style":x=Ko(t);break;case"script":x=Qo(t)}kn.has(x)||(t=g({rel:"preload",href:r==="image"&&i&&i.imageSrcSet?void 0:t,as:r},i),kn.set(x,t),u.querySelector(h)!==null||r==="style"&&u.querySelector(Ei(x))||r==="script"&&u.querySelector(Ci(x))||(r=u.createElement("link"),$t(r,"link",t),_t(r),u.head.appendChild(r)))}}function Q_(t,r){Ar.m(t,r);var i=Wo;if(i&&t){var u=r&&typeof r.as=="string"?r.as:"script",h='link[rel="modulepreload"][as="'+tn(u)+'"][href="'+tn(t)+'"]',x=h;switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":x=Qo(t)}if(!kn.has(x)&&(t=g({rel:"modulepreload",href:t},r),kn.set(x,t),i.querySelector(h)===null)){switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector(Ci(x)))return}u=i.createElement("link"),$t(u,"link",t),_t(u),i.head.appendChild(u)}}}function J_(t,r,i){Ar.S(t,r,i);var u=Wo;if(u&&t){var h=fr(u).hoistableStyles,x=Ko(t);r=r||"default";var C=h.get(x);if(!C){var O={loading:0,preload:null};if(C=u.querySelector(Ei(x)))O.loading=5;else{t=g({rel:"stylesheet",href:t,"data-precedence":r},i),(i=kn.get(x))&&Mm(t,i);var q=C=u.createElement("link");_t(q),$t(q,"link",t),q._p=new Promise(function(ee,fe){q.onload=ee,q.onerror=fe}),q.addEventListener("load",function(){O.loading|=1}),q.addEventListener("error",function(){O.loading|=2}),O.loading|=4,Mc(C,r,u)}C={type:"stylesheet",instance:C,count:1,state:O},h.set(x,C)}}}function eE(t,r){Ar.X(t,r);var i=Wo;if(i&&t){var u=fr(i).hoistableScripts,h=Qo(t),x=u.get(h);x||(x=i.querySelector(Ci(h)),x||(t=g({src:t,async:!0},r),(r=kn.get(h))&&Tm(t,r),x=i.createElement("script"),_t(x),$t(x,"link",t),i.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},u.set(h,x))}}function tE(t,r){Ar.M(t,r);var i=Wo;if(i&&t){var u=fr(i).hoistableScripts,h=Qo(t),x=u.get(h);x||(x=i.querySelector(Ci(h)),x||(t=g({src:t,async:!0,type:"module"},r),(r=kn.get(h))&&Tm(t,r),x=i.createElement("script"),_t(x),$t(x,"link",t),i.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},u.set(h,x))}}function ky(t,r,i,u){var h=(h=ge.current)?Ac(h):null;if(!h)throw Error(o(446));switch(t){case"meta":case"title":return null;case"style":return typeof i.precedence=="string"&&typeof i.href=="string"?(r=Ko(i.href),i=fr(h).hoistableStyles,u=i.get(r),u||(u={type:"style",instance:null,count:0,state:null},i.set(r,u)),u):{type:"void",instance:null,count:0,state:null};case"link":if(i.rel==="stylesheet"&&typeof i.href=="string"&&typeof i.precedence=="string"){t=Ko(i.href);var x=fr(h).hoistableStyles,C=x.get(t);if(C||(h=h.ownerDocument||h,C={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},x.set(t,C),(x=h.querySelector(Ei(t)))&&!x._p&&(C.instance=x,C.state.loading=5),kn.has(t)||(i={rel:"preload",as:"style",href:i.href,crossOrigin:i.crossOrigin,integrity:i.integrity,media:i.media,hrefLang:i.hrefLang,referrerPolicy:i.referrerPolicy},kn.set(t,i),x||nE(h,t,i,C.state))),r&&u===null)throw Error(o(528,""));return C}if(r&&u!==null)throw Error(o(529,""));return null;case"script":return r=i.async,i=i.src,typeof i=="string"&&r&&typeof r!="function"&&typeof r!="symbol"?(r=Qo(i),i=fr(h).hoistableScripts,u=i.get(r),u||(u={type:"script",instance:null,count:0,state:null},i.set(r,u)),u):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,t))}}function Ko(t){return'href="'+tn(t)+'"'}function Ei(t){return'link[rel="stylesheet"]['+t+"]"}function Ay(t){return g({},t,{"data-precedence":t.precedence,precedence:null})}function nE(t,r,i,u){t.querySelector('link[rel="preload"][as="style"]['+r+"]")?u.loading=1:(r=t.createElement("link"),u.preload=r,r.addEventListener("load",function(){return u.loading|=1}),r.addEventListener("error",function(){return u.loading|=2}),$t(r,"link",i),_t(r),t.head.appendChild(r))}function Qo(t){return'[src="'+tn(t)+'"]'}function Ci(t){return"script[async]"+t}function My(t,r,i){if(r.count++,r.instance===null)switch(r.type){case"style":var u=t.querySelector('style[data-href~="'+tn(i.href)+'"]');if(u)return r.instance=u,_t(u),u;var h=g({},i,{"data-href":i.href,"data-precedence":i.precedence,href:null,precedence:null});return u=(t.ownerDocument||t).createElement("style"),_t(u),$t(u,"style",h),Mc(u,i.precedence,t),r.instance=u;case"stylesheet":h=Ko(i.href);var x=t.querySelector(Ei(h));if(x)return r.state.loading|=4,r.instance=x,_t(x),x;u=Ay(i),(h=kn.get(h))&&Mm(u,h),x=(t.ownerDocument||t).createElement("link"),_t(x);var C=x;return C._p=new Promise(function(O,q){C.onload=O,C.onerror=q}),$t(x,"link",u),r.state.loading|=4,Mc(x,i.precedence,t),r.instance=x;case"script":return x=Qo(i.src),(h=t.querySelector(Ci(x)))?(r.instance=h,_t(h),h):(u=i,(h=kn.get(x))&&(u=g({},i),Tm(u,h)),t=t.ownerDocument||t,h=t.createElement("script"),_t(h),$t(h,"link",u),t.head.appendChild(h),r.instance=h);case"void":return null;default:throw Error(o(443,r.type))}else r.type==="stylesheet"&&(r.state.loading&4)===0&&(u=r.instance,r.state.loading|=4,Mc(u,i.precedence,t));return r.instance}function Mc(t,r,i){for(var u=i.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),h=u.length?u[u.length-1]:null,x=h,C=0;C<u.length;C++){var O=u[C];if(O.dataset.precedence===r)x=O;else if(x!==h)break}x?x.parentNode.insertBefore(t,x.nextSibling):(r=i.nodeType===9?i.head:i,r.insertBefore(t,r.firstChild))}function Mm(t,r){t.crossOrigin==null&&(t.crossOrigin=r.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=r.referrerPolicy),t.title==null&&(t.title=r.title)}function Tm(t,r){t.crossOrigin==null&&(t.crossOrigin=r.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=r.referrerPolicy),t.integrity==null&&(t.integrity=r.integrity)}var Tc=null;function Ty(t,r,i){if(Tc===null){var u=new Map,h=Tc=new Map;h.set(i,u)}else h=Tc,u=h.get(i),u||(u=new Map,h.set(i,u));if(u.has(t))return u;for(u.set(t,null),i=i.getElementsByTagName(t),h=0;h<i.length;h++){var x=i[h];if(!(x[Ts]||x[Rt]||t==="link"&&x.getAttribute("rel")==="stylesheet")&&x.namespaceURI!=="http://www.w3.org/2000/svg"){var C=x.getAttribute(r)||"";C=t+C;var O=u.get(C);O?O.push(x):u.set(C,[x])}}return u}function Ry(t,r,i){t=t.ownerDocument||t,t.head.insertBefore(i,r==="title"?t.querySelector("head > title"):null)}function rE(t,r,i){if(i===1||r.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof r.precedence!="string"||typeof r.href!="string"||r.href==="")break;return!0;case"link":if(typeof r.rel!="string"||typeof r.href!="string"||r.href===""||r.onLoad||r.onError)break;switch(r.rel){case"stylesheet":return t=r.disabled,typeof r.precedence=="string"&&t==null;default:return!0}case"script":if(r.async&&typeof r.async!="function"&&typeof r.async!="symbol"&&!r.onLoad&&!r.onError&&r.src&&typeof r.src=="string")return!0}return!1}function Dy(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}var ki=null;function sE(){}function oE(t,r,i){if(ki===null)throw Error(o(475));var u=ki;if(r.type==="stylesheet"&&(typeof i.media!="string"||matchMedia(i.media).matches!==!1)&&(r.state.loading&4)===0){if(r.instance===null){var h=Ko(i.href),x=t.querySelector(Ei(h));if(x){t=x._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(u.count++,u=Rc.bind(u),t.then(u,u)),r.state.loading|=4,r.instance=x,_t(x);return}x=t.ownerDocument||t,i=Ay(i),(h=kn.get(h))&&Mm(i,h),x=x.createElement("link"),_t(x);var C=x;C._p=new Promise(function(O,q){C.onload=O,C.onerror=q}),$t(x,"link",i),r.instance=x}u.stylesheets===null&&(u.stylesheets=new Map),u.stylesheets.set(r,t),(t=r.state.preload)&&(r.state.loading&3)===0&&(u.count++,r=Rc.bind(u),t.addEventListener("load",r),t.addEventListener("error",r))}}function aE(){if(ki===null)throw Error(o(475));var t=ki;return t.stylesheets&&t.count===0&&Rm(t,t.stylesheets),0<t.count?function(r){var i=setTimeout(function(){if(t.stylesheets&&Rm(t,t.stylesheets),t.unsuspend){var u=t.unsuspend;t.unsuspend=null,u()}},6e4);return t.unsuspend=r,function(){t.unsuspend=null,clearTimeout(i)}}:null}function Rc(){if(this.count--,this.count===0){if(this.stylesheets)Rm(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Dc=null;function Rm(t,r){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Dc=new Map,r.forEach(iE,t),Dc=null,Rc.call(t))}function iE(t,r){if(!(r.state.loading&4)){var i=Dc.get(t);if(i)var u=i.get(null);else{i=new Map,Dc.set(t,i);for(var h=t.querySelectorAll("link[data-precedence],style[data-precedence]"),x=0;x<h.length;x++){var C=h[x];(C.nodeName==="LINK"||C.getAttribute("media")!=="not all")&&(i.set(C.dataset.precedence,C),u=C)}u&&i.set(null,u)}h=r.instance,C=h.getAttribute("data-precedence"),x=i.get(C)||u,x===u&&i.set(null,h),i.set(C,h),this.count++,u=Rc.bind(this),h.addEventListener("load",u),h.addEventListener("error",u),x?x.parentNode.insertBefore(h,x.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(h,t.firstChild)),r.state.loading|=4}}var Ai={$$typeof:j,Provider:null,Consumer:null,_currentValue:$,_currentValue2:$,_threadCount:0};function lE(t,r,i,u,h,x,C,O){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=Ma(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ma(0),this.hiddenUpdates=Ma(null),this.identifierPrefix=u,this.onUncaughtError=h,this.onCaughtError=x,this.onRecoverableError=C,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=O,this.incompleteTransitions=new Map}function Oy(t,r,i,u,h,x,C,O,q,ee,fe,xe){return t=new lE(t,r,i,C,O,q,ee,xe),r=1,x===!0&&(r|=24),x=cn(3,null,null,r),t.current=x,x.stateNode=t,r=mf(),r.refCount++,t.pooledCache=r,r.refCount++,x.memoizedState={element:u,isDehydrated:i,cache:r},xf(x),t}function zy(t){return t?(t=Ao,t):Ao}function Iy(t,r,i,u,h,x){h=zy(h),u.context===null?u.context=h:u.pendingContext=h,u=Yr(r),u.payload={element:i},x=x===void 0?null:x,x!==null&&(u.callback=x),i=Gr(t,u,r),i!==null&&(hn(i,t,r),oi(i,t,r))}function Ly(t,r){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var i=t.retryLane;t.retryLane=i!==0&&i<r?i:r}}function Dm(t,r){Ly(t,r),(t=t.alternate)&&Ly(t,r)}function Hy(t){if(t.tag===13){var r=ko(t,67108864);r!==null&&hn(r,t,67108864),Dm(t,67108864)}}var Oc=!0;function cE(t,r,i,u){var h=A.T;A.T=null;var x=I.p;try{I.p=2,Om(t,r,i,u)}finally{I.p=x,A.T=h}}function uE(t,r,i,u){var h=A.T;A.T=null;var x=I.p;try{I.p=8,Om(t,r,i,u)}finally{I.p=x,A.T=h}}function Om(t,r,i,u){if(Oc){var h=zm(u);if(h===null)wm(t,r,u,zc,i),By(t,u);else if(fE(h,t,r,i,u))u.stopPropagation();else if(By(t,u),r&4&&-1<dE.indexOf(t)){for(;h!==null;){var x=dr(h);if(x!==null)switch(x.tag){case 3:if(x=x.stateNode,x.current.memoizedState.isDehydrated){var C=He(x.pendingLanes);if(C!==0){var O=x;for(O.pendingLanes|=2,O.entangledLanes|=2;C;){var q=1<<31-ce(C);O.entanglements[1]|=q,C&=~q}Kn(x),(at&6)===0&&(yc=Qe()+500,Ni(0))}}break;case 13:O=ko(x,2),O!==null&&hn(O,x,2),bc(),Dm(x,2)}if(x=zm(u),x===null&&wm(t,r,u,zc,i),x===h)break;h=x}h!==null&&u.stopPropagation()}else wm(t,r,u,null,i)}}function zm(t){return t=$d(t),Im(t)}var zc=null;function Im(t){if(zc=null,t=Br(t),t!==null){var r=c(t);if(r===null)t=null;else{var i=r.tag;if(i===13){if(t=d(r),t!==null)return t;t=null}else if(i===3){if(r.stateNode.current.memoizedState.isDehydrated)return r.tag===3?r.stateNode.containerInfo:null;t=null}else r!==t&&(t=null)}}return zc=t,null}function $y(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(It()){case Zt:return 2;case ht:return 8;case We:case dt:return 32;case wn:return 268435456;default:return 32}default:return 32}}var Lm=!1,as=null,is=null,ls=null,Mi=new Map,Ti=new Map,cs=[],dE="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 By(t,r){switch(t){case"focusin":case"focusout":as=null;break;case"dragenter":case"dragleave":is=null;break;case"mouseover":case"mouseout":ls=null;break;case"pointerover":case"pointerout":Mi.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ti.delete(r.pointerId)}}function Ri(t,r,i,u,h,x){return t===null||t.nativeEvent!==x?(t={blockedOn:r,domEventName:i,eventSystemFlags:u,nativeEvent:x,targetContainers:[h]},r!==null&&(r=dr(r),r!==null&&Hy(r)),t):(t.eventSystemFlags|=u,r=t.targetContainers,h!==null&&r.indexOf(h)===-1&&r.push(h),t)}function fE(t,r,i,u,h){switch(r){case"focusin":return as=Ri(as,t,r,i,u,h),!0;case"dragenter":return is=Ri(is,t,r,i,u,h),!0;case"mouseover":return ls=Ri(ls,t,r,i,u,h),!0;case"pointerover":var x=h.pointerId;return Mi.set(x,Ri(Mi.get(x)||null,t,r,i,u,h)),!0;case"gotpointercapture":return x=h.pointerId,Ti.set(x,Ri(Ti.get(x)||null,t,r,i,u,h)),!0}return!1}function Py(t){var r=Br(t.target);if(r!==null){var i=c(r);if(i!==null){if(r=i.tag,r===13){if(r=d(i),r!==null){t.blockedOn=r,Ad(t.priority,function(){if(i.tag===13){var u=mn();u=Ra(u);var h=ko(i,u);h!==null&&hn(h,i,u),Dm(i,u)}});return}}else if(r===3&&i.stateNode.current.memoizedState.isDehydrated){t.blockedOn=i.tag===3?i.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Ic(t){if(t.blockedOn!==null)return!1;for(var r=t.targetContainers;0<r.length;){var i=zm(t.nativeEvent);if(i===null){i=t.nativeEvent;var u=new i.constructor(i.type,i);Hd=u,i.target.dispatchEvent(u),Hd=null}else return r=dr(i),r!==null&&Hy(r),t.blockedOn=i,!1;r.shift()}return!0}function Uy(t,r,i){Ic(t)&&i.delete(r)}function mE(){Lm=!1,as!==null&&Ic(as)&&(as=null),is!==null&&Ic(is)&&(is=null),ls!==null&&Ic(ls)&&(ls=null),Mi.forEach(Uy),Ti.forEach(Uy)}function Lc(t,r){t.blockedOn===r&&(t.blockedOn=null,Lm||(Lm=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,mE)))}var Hc=null;function Vy(t){Hc!==t&&(Hc=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Hc===t&&(Hc=null);for(var r=0;r<t.length;r+=3){var i=t[r],u=t[r+1],h=t[r+2];if(typeof u!="function"){if(Im(u||i)===null)continue;break}var x=dr(i);x!==null&&(t.splice(r,3),r-=3,If(x,{pending:!0,data:h,method:i.method,action:u},u,h))}}))}function Di(t){function r(q){return Lc(q,t)}as!==null&&Lc(as,t),is!==null&&Lc(is,t),ls!==null&&Lc(ls,t),Mi.forEach(r),Ti.forEach(r);for(var i=0;i<cs.length;i++){var u=cs[i];u.blockedOn===t&&(u.blockedOn=null)}for(;0<cs.length&&(i=cs[0],i.blockedOn===null);)Py(i),i.blockedOn===null&&cs.shift();if(i=(t.ownerDocument||t).$$reactFormReplay,i!=null)for(u=0;u<i.length;u+=3){var h=i[u],x=i[u+1],C=h[qt]||null;if(typeof x=="function")C||Vy(i);else if(C){var O=null;if(x&&x.hasAttribute("formAction")){if(h=x,C=x[qt]||null)O=C.formAction;else if(Im(h)!==null)continue}else O=C.action;typeof O=="function"?i[u+1]=O:(i.splice(u,3),u-=3),Vy(i)}}}function Hm(t){this._internalRoot=t}$c.prototype.render=Hm.prototype.render=function(t){var r=this._internalRoot;if(r===null)throw Error(o(409));var i=r.current,u=mn();Iy(i,u,t,r,null,null)},$c.prototype.unmount=Hm.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var r=t.containerInfo;Iy(t.current,2,null,t,null,null),bc(),r[$r]=null}};function $c(t){this._internalRoot=t}$c.prototype.unstable_scheduleHydration=function(t){if(t){var r=El();t={blockedOn:null,target:t,priority:r};for(var i=0;i<cs.length&&r!==0&&r<cs[i].priority;i++);cs.splice(i,0,t),i===0&&Py(t)}};var qy=n.version;if(qy!=="19.1.1")throw Error(o(527,qy,"19.1.1"));I.findDOMNode=function(t){var r=t._reactInternals;if(r===void 0)throw typeof t.render=="function"?Error(o(188)):(t=Object.keys(t).join(","),Error(o(268,t)));return t=m(r),t=t!==null?p(t):null,t=t===null?null:t.stateNode,t};var hE={bundleType:0,version:"19.1.1",rendererPackageName:"react-dom",currentDispatcherRef:A,reconcilerVersion:"19.1.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Bc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Bc.isDisabled&&Bc.supportsFiber)try{ue=Bc.inject(hE),me=Bc}catch{}}return zi.createRoot=function(t,r){if(!l(t))throw Error(o(299));var i=!1,u="",h=a0,x=i0,C=l0,O=null;return r!=null&&(r.unstable_strictMode===!0&&(i=!0),r.identifierPrefix!==void 0&&(u=r.identifierPrefix),r.onUncaughtError!==void 0&&(h=r.onUncaughtError),r.onCaughtError!==void 0&&(x=r.onCaughtError),r.onRecoverableError!==void 0&&(C=r.onRecoverableError),r.unstable_transitionCallbacks!==void 0&&(O=r.unstable_transitionCallbacks)),r=Oy(t,1,!1,null,null,i,u,h,x,C,O,null),t[$r]=r.current,bm(t),new Hm(r)},zi.hydrateRoot=function(t,r,i){if(!l(t))throw Error(o(299));var u=!1,h="",x=a0,C=i0,O=l0,q=null,ee=null;return i!=null&&(i.unstable_strictMode===!0&&(u=!0),i.identifierPrefix!==void 0&&(h=i.identifierPrefix),i.onUncaughtError!==void 0&&(x=i.onUncaughtError),i.onCaughtError!==void 0&&(C=i.onCaughtError),i.onRecoverableError!==void 0&&(O=i.onRecoverableError),i.unstable_transitionCallbacks!==void 0&&(q=i.unstable_transitionCallbacks),i.formState!==void 0&&(ee=i.formState)),r=Oy(t,1,!0,r,i??null,u,h,x,C,O,q,ee),r.context=zy(null),i=r.current,u=mn(),u=Ra(u),h=Yr(u),h.callback=null,Gr(i,h,u),i=u,r.current.lanes=i,Ms(r,i),Kn(r),t[$r]=r.current,bm(t),new $c(r)},zi.version="19.1.1",zi}var ev;function jE(){if(ev)return Pm.exports;ev=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(n){console.error(n)}}return e(),Pm.exports=SE(),Pm.exports}var _E=jE();function tv(e,n){if(typeof e=="function")return e(n);e!=null&&(e.current=n)}function qu(...e){return n=>{let s=!1;const o=e.map(l=>{const c=tv(l,n);return!s&&typeof c=="function"&&(s=!0),c});if(s)return()=>{for(let l=0;l<o.length;l++){const c=o[l];typeof c=="function"?c():tv(e[l],null)}}}}function nt(...e){return w.useCallback(qu(...e),e)}function da(e){const n=CE(e),s=w.forwardRef((o,l)=>{const{children:c,...d}=o,f=w.Children.toArray(c),m=f.find(AE);if(m){const p=m.props.children,g=f.map(v=>v===m?w.Children.count(p)>1?w.Children.only(null):w.isValidElement(p)?p.props.children:null:v);return a.jsx(n,{...d,ref:l,children:w.isValidElement(p)?w.cloneElement(p,void 0,g):null})}return a.jsx(n,{...d,ref:l,children:c})});return s.displayName=`${e}.Slot`,s}var EE=da("Slot");function CE(e){const n=w.forwardRef((s,o)=>{const{children:l,...c}=s;if(w.isValidElement(l)){const d=TE(l),f=ME(c,l.props);return l.type!==w.Fragment&&(f.ref=o?qu(o,d):d),w.cloneElement(l,f)}return w.Children.count(l)>1?w.Children.only(null):null});return n.displayName=`${e}.SlotClone`,n}var kE=Symbol("radix.slottable");function AE(e){return w.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===kE}function ME(e,n){const s={...n};for(const o in n){const l=e[o],c=n[o];/^on[A-Z]/.test(o)?l&&c?s[o]=(...f)=>{const m=c(...f);return l(...f),m}:l&&(s[o]=l):o==="style"?s[o]={...l,...c}:o==="className"&&(s[o]=[l,c].filter(Boolean).join(" "))}return{...e,...s}}function TE(e){let n=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,s=n&&"isReactWarning"in n&&n.isReactWarning;return s?e.ref:(n=Object.getOwnPropertyDescriptor(e,"ref")?.get,s=n&&"isReactWarning"in n&&n.isReactWarning,s?e.props.ref:e.props.ref||e.ref)}function Kb(e){var n,s,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var l=e.length;for(n=0;n<l;n++)e[n]&&(s=Kb(e[n]))&&(o&&(o+=" "),o+=s)}else for(s in e)e[s]&&(o&&(o+=" "),o+=s);return o}function Qb(){for(var e,n,s=0,o="",l=arguments.length;s<l;s++)(e=arguments[s])&&(n=Kb(e))&&(o&&(o+=" "),o+=n);return o}const nv=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,rv=Qb,Jb=(e,n)=>s=>{var o;if(n?.variants==null)return rv(e,s?.class,s?.className);const{variants:l,defaultVariants:c}=n,d=Object.keys(l).map(p=>{const g=s?.[p],v=c?.[p];if(g===null)return null;const y=nv(g)||nv(v);return l[p][y]}),f=s&&Object.entries(s).reduce((p,g)=>{let[v,y]=g;return y===void 0||(p[v]=y),p},{}),m=n==null||(o=n.compoundVariants)===null||o===void 0?void 0:o.reduce((p,g)=>{let{class:v,className:y,...b}=g;return Object.entries(b).every(S=>{let[N,_]=S;return Array.isArray(_)?_.includes({...c,...f}[N]):{...c,...f}[N]===_})?[...p,v,y]:p},[]);return rv(e,d,m,s?.class,s?.className)},fp="-",RE=e=>{const n=OE(e),{conflictingClassGroups:s,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:d=>{const f=d.split(fp);return f[0]===""&&f.length!==1&&f.shift(),ew(f,n)||DE(d)},getConflictingClassGroupIds:(d,f)=>{const m=s[d]||[];return f&&o[d]?[...m,...o[d]]:m}}},ew=(e,n)=>{if(e.length===0)return n.classGroupId;const s=e[0],o=n.nextPart.get(s),l=o?ew(e.slice(1),o):void 0;if(l)return l;if(n.validators.length===0)return;const c=e.join(fp);return n.validators.find(({validator:d})=>d(c))?.classGroupId},sv=/^\[(.+)\]$/,DE=e=>{if(sv.test(e)){const n=sv.exec(e)[1],s=n?.substring(0,n.indexOf(":"));if(s)return"arbitrary.."+s}},OE=e=>{const{theme:n,classGroups:s}=e,o={nextPart:new Map,validators:[]};for(const l in s)jh(s[l],o,l,n);return o},jh=(e,n,s,o)=>{e.forEach(l=>{if(typeof l=="string"){const c=l===""?n:ov(n,l);c.classGroupId=s;return}if(typeof l=="function"){if(zE(l)){jh(l(o),n,s,o);return}n.validators.push({validator:l,classGroupId:s});return}Object.entries(l).forEach(([c,d])=>{jh(d,ov(n,c),s,o)})})},ov=(e,n)=>{let s=e;return n.split(fp).forEach(o=>{s.nextPart.has(o)||s.nextPart.set(o,{nextPart:new Map,validators:[]}),s=s.nextPart.get(o)}),s},zE=e=>e.isThemeGetter,IE=e=>{if(e<1)return{get:()=>{},set:()=>{}};let n=0,s=new Map,o=new Map;const l=(c,d)=>{s.set(c,d),n++,n>e&&(n=0,o=s,s=new Map)};return{get(c){let d=s.get(c);if(d!==void 0)return d;if((d=o.get(c))!==void 0)return l(c,d),d},set(c,d){s.has(c)?s.set(c,d):l(c,d)}}},_h="!",Eh=":",LE=Eh.length,HE=e=>{const{prefix:n,experimentalParseClassName:s}=e;let o=l=>{const c=[];let d=0,f=0,m=0,p;for(let S=0;S<l.length;S++){let N=l[S];if(d===0&&f===0){if(N===Eh){c.push(l.slice(m,S)),m=S+LE;continue}if(N==="/"){p=S;continue}}N==="["?d++:N==="]"?d--:N==="("?f++:N===")"&&f--}const g=c.length===0?l:l.substring(m),v=$E(g),y=v!==g,b=p&&p>m?p-m:void 0;return{modifiers:c,hasImportantModifier:y,baseClassName:v,maybePostfixModifierPosition:b}};if(n){const l=n+Eh,c=o;o=d=>d.startsWith(l)?c(d.substring(l.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:d,maybePostfixModifierPosition:void 0}}if(s){const l=o;o=c=>s({className:c,parseClassName:l})}return o},$E=e=>e.endsWith(_h)?e.substring(0,e.length-1):e.startsWith(_h)?e.substring(1):e,BE=e=>{const n=Object.fromEntries(e.orderSensitiveModifiers.map(o=>[o,!0]));return o=>{if(o.length<=1)return o;const l=[];let c=[];return o.forEach(d=>{d[0]==="["||n[d]?(l.push(...c.sort(),d),c=[]):c.push(d)}),l.push(...c.sort()),l}},PE=e=>({cache:IE(e.cacheSize),parseClassName:HE(e),sortModifiers:BE(e),...RE(e)}),UE=/\s+/,VE=(e,n)=>{const{parseClassName:s,getClassGroupId:o,getConflictingClassGroupIds:l,sortModifiers:c}=n,d=[],f=e.trim().split(UE);let m="";for(let p=f.length-1;p>=0;p-=1){const g=f[p],{isExternal:v,modifiers:y,hasImportantModifier:b,baseClassName:S,maybePostfixModifierPosition:N}=s(g);if(v){m=g+(m.length>0?" "+m:m);continue}let _=!!N,E=o(_?S.substring(0,N):S);if(!E){if(!_){m=g+(m.length>0?" "+m:m);continue}if(E=o(S),!E){m=g+(m.length>0?" "+m:m);continue}_=!1}const M=c(y).join(":"),j=b?M+_h:M,k=j+E;if(d.includes(k))continue;d.push(k);const R=l(E,_);for(let D=0;D<R.length;++D){const z=R[D];d.push(j+z)}m=g+(m.length>0?" "+m:m)}return m};function qE(){let e=0,n,s,o="";for(;e<arguments.length;)(n=arguments[e++])&&(s=tw(n))&&(o&&(o+=" "),o+=s);return o}const tw=e=>{if(typeof e=="string")return e;let n,s="";for(let o=0;o<e.length;o++)e[o]&&(n=tw(e[o]))&&(s&&(s+=" "),s+=n);return s};function FE(e,...n){let s,o,l,c=d;function d(m){const p=n.reduce((g,v)=>v(g),e());return s=PE(p),o=s.cache.get,l=s.cache.set,c=f,f(m)}function f(m){const p=o(m);if(p)return p;const g=VE(m,s);return l(m,g),g}return function(){return c(qE.apply(null,arguments))}}const Tt=e=>{const n=s=>s[e]||[];return n.isThemeGetter=!0,n},nw=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,rw=/^\((?:(\w[\w-]*):)?(.+)\)$/i,YE=/^\d+\/\d+$/,GE=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,XE=/\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$/,ZE=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,WE=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,KE=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Jo=e=>YE.test(e),Fe=e=>!!e&&!Number.isNaN(Number(e)),ds=e=>!!e&&Number.isInteger(Number(e)),Fm=e=>e.endsWith("%")&&Fe(e.slice(0,-1)),Mr=e=>GE.test(e),QE=()=>!0,JE=e=>XE.test(e)&&!ZE.test(e),sw=()=>!1,eC=e=>WE.test(e),tC=e=>KE.test(e),nC=e=>!Ae(e)&&!Me(e),rC=e=>Na(e,iw,sw),Ae=e=>nw.test(e),Zs=e=>Na(e,lw,JE),Ym=e=>Na(e,lC,Fe),av=e=>Na(e,ow,sw),sC=e=>Na(e,aw,tC),Pc=e=>Na(e,cw,eC),Me=e=>rw.test(e),Ii=e=>Sa(e,lw),oC=e=>Sa(e,cC),iv=e=>Sa(e,ow),aC=e=>Sa(e,iw),iC=e=>Sa(e,aw),Uc=e=>Sa(e,cw,!0),Na=(e,n,s)=>{const o=nw.exec(e);return o?o[1]?n(o[1]):s(o[2]):!1},Sa=(e,n,s=!1)=>{const o=rw.exec(e);return o?o[1]?n(o[1]):s:!1},ow=e=>e==="position"||e==="percentage",aw=e=>e==="image"||e==="url",iw=e=>e==="length"||e==="size"||e==="bg-size",lw=e=>e==="length",lC=e=>e==="number",cC=e=>e==="family-name",cw=e=>e==="shadow",uC=()=>{const e=Tt("color"),n=Tt("font"),s=Tt("text"),o=Tt("font-weight"),l=Tt("tracking"),c=Tt("leading"),d=Tt("breakpoint"),f=Tt("container"),m=Tt("spacing"),p=Tt("radius"),g=Tt("shadow"),v=Tt("inset-shadow"),y=Tt("text-shadow"),b=Tt("drop-shadow"),S=Tt("blur"),N=Tt("perspective"),_=Tt("aspect"),E=Tt("ease"),M=Tt("animate"),j=()=>["auto","avoid","all","avoid-page","page","left","right","column"],k=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],R=()=>[...k(),Me,Ae],D=()=>["auto","hidden","clip","visible","scroll"],z=()=>["auto","contain","none"],H=()=>[Me,Ae,m],U=()=>[Jo,"full","auto",...H()],F=()=>[ds,"none","subgrid",Me,Ae],K=()=>["auto",{span:["full",ds,Me,Ae]},ds,Me,Ae],G=()=>[ds,"auto",Me,Ae],ne=()=>["auto","min","max","fr",Me,Ae],L=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],V=()=>["start","end","center","stretch","center-safe","end-safe"],A=()=>["auto",...H()],I=()=>[Jo,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...H()],$=()=>[e,Me,Ae],P=()=>[...k(),iv,av,{position:[Me,Ae]}],T=()=>["no-repeat",{repeat:["","x","y","space","round"]}],B=()=>["auto","cover","contain",aC,rC,{size:[Me,Ae]}],W=()=>[Fm,Ii,Zs],Z=()=>["","none","full",p,Me,Ae],re=()=>["",Fe,Ii,Zs],de=()=>["solid","dashed","dotted","double"],ge=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],J=()=>[Fe,Fm,iv,av],le=()=>["","none",S,Me,Ae],ve=()=>["none",Fe,Me,Ae],Ne=()=>["none",Fe,Me,Ae],_e=()=>[Fe,Me,Ae],be=()=>[Jo,"full",...H()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Mr],breakpoint:[Mr],color:[QE],container:[Mr],"drop-shadow":[Mr],ease:["in","out","in-out"],font:[nC],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Mr],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Mr],shadow:[Mr],spacing:["px",Fe],text:[Mr],"text-shadow":[Mr],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Jo,Ae,Me,_]}],container:["container"],columns:[{columns:[Fe,Ae,Me,f]}],"break-after":[{"break-after":j()}],"break-before":[{"break-before":j()}],"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:R()}],overflow:[{overflow:D()}],"overflow-x":[{"overflow-x":D()}],"overflow-y":[{"overflow-y":D()}],overscroll:[{overscroll:z()}],"overscroll-x":[{"overscroll-x":z()}],"overscroll-y":[{"overscroll-y":z()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:U()}],"inset-x":[{"inset-x":U()}],"inset-y":[{"inset-y":U()}],start:[{start:U()}],end:[{end:U()}],top:[{top:U()}],right:[{right:U()}],bottom:[{bottom:U()}],left:[{left:U()}],visibility:["visible","invisible","collapse"],z:[{z:[ds,"auto",Me,Ae]}],basis:[{basis:[Jo,"full","auto",f,...H()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Fe,Jo,"auto","initial","none",Ae]}],grow:[{grow:["",Fe,Me,Ae]}],shrink:[{shrink:["",Fe,Me,Ae]}],order:[{order:[ds,"first","last","none",Me,Ae]}],"grid-cols":[{"grid-cols":F()}],"col-start-end":[{col:K()}],"col-start":[{"col-start":G()}],"col-end":[{"col-end":G()}],"grid-rows":[{"grid-rows":F()}],"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":ne()}],"auto-rows":[{"auto-rows":ne()}],gap:[{gap:H()}],"gap-x":[{"gap-x":H()}],"gap-y":[{"gap-y":H()}],"justify-content":[{justify:[...L(),"normal"]}],"justify-items":[{"justify-items":[...V(),"normal"]}],"justify-self":[{"justify-self":["auto",...V()]}],"align-content":[{content:["normal",...L()]}],"align-items":[{items:[...V(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...V(),{baseline:["","last"]}]}],"place-content":[{"place-content":L()}],"place-items":[{"place-items":[...V(),"baseline"]}],"place-self":[{"place-self":["auto",...V()]}],p:[{p:H()}],px:[{px:H()}],py:[{py:H()}],ps:[{ps:H()}],pe:[{pe:H()}],pt:[{pt:H()}],pr:[{pr:H()}],pb:[{pb:H()}],pl:[{pl:H()}],m:[{m:A()}],mx:[{mx:A()}],my:[{my:A()}],ms:[{ms:A()}],me:[{me:A()}],mt:[{mt:A()}],mr:[{mr:A()}],mb:[{mb:A()}],ml:[{ml:A()}],"space-x":[{"space-x":H()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":H()}],"space-y-reverse":["space-y-reverse"],size:[{size:I()}],w:[{w:[f,"screen",...I()]}],"min-w":[{"min-w":[f,"screen","none",...I()]}],"max-w":[{"max-w":[f,"screen","none","prose",{screen:[d]},...I()]}],h:[{h:["screen","lh",...I()]}],"min-h":[{"min-h":["screen","lh","none",...I()]}],"max-h":[{"max-h":["screen","lh",...I()]}],"font-size":[{text:["base",s,Ii,Zs]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,Me,Ym]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Fm,Ae]}],"font-family":[{font:[oC,Ae,n]}],"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,Me,Ae]}],"line-clamp":[{"line-clamp":[Fe,"none",Me,Ym]}],leading:[{leading:[c,...H()]}],"list-image":[{"list-image":["none",Me,Ae]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Me,Ae]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:$()}],"text-color":[{text:$()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...de(),"wavy"]}],"text-decoration-thickness":[{decoration:[Fe,"from-font","auto",Me,Zs]}],"text-decoration-color":[{decoration:$()}],"underline-offset":[{"underline-offset":[Fe,"auto",Me,Ae]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:H()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Me,Ae]}],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",Me,Ae]}],"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:B()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ds,Me,Ae],radial:["",Me,Ae],conic:[ds,Me,Ae]},iC,sC]}],"bg-color":[{bg:$()}],"gradient-from-pos":[{from:W()}],"gradient-via-pos":[{via:W()}],"gradient-to-pos":[{to:W()}],"gradient-from":[{from:$()}],"gradient-via":[{via:$()}],"gradient-to":[{to:$()}],rounded:[{rounded:Z()}],"rounded-s":[{"rounded-s":Z()}],"rounded-e":[{"rounded-e":Z()}],"rounded-t":[{"rounded-t":Z()}],"rounded-r":[{"rounded-r":Z()}],"rounded-b":[{"rounded-b":Z()}],"rounded-l":[{"rounded-l":Z()}],"rounded-ss":[{"rounded-ss":Z()}],"rounded-se":[{"rounded-se":Z()}],"rounded-ee":[{"rounded-ee":Z()}],"rounded-es":[{"rounded-es":Z()}],"rounded-tl":[{"rounded-tl":Z()}],"rounded-tr":[{"rounded-tr":Z()}],"rounded-br":[{"rounded-br":Z()}],"rounded-bl":[{"rounded-bl":Z()}],"border-w":[{border:re()}],"border-w-x":[{"border-x":re()}],"border-w-y":[{"border-y":re()}],"border-w-s":[{"border-s":re()}],"border-w-e":[{"border-e":re()}],"border-w-t":[{"border-t":re()}],"border-w-r":[{"border-r":re()}],"border-w-b":[{"border-b":re()}],"border-w-l":[{"border-l":re()}],"divide-x":[{"divide-x":re()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":re()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...de(),"hidden","none"]}],"divide-style":[{divide:[...de(),"hidden","none"]}],"border-color":[{border:$()}],"border-color-x":[{"border-x":$()}],"border-color-y":[{"border-y":$()}],"border-color-s":[{"border-s":$()}],"border-color-e":[{"border-e":$()}],"border-color-t":[{"border-t":$()}],"border-color-r":[{"border-r":$()}],"border-color-b":[{"border-b":$()}],"border-color-l":[{"border-l":$()}],"divide-color":[{divide:$()}],"outline-style":[{outline:[...de(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Fe,Me,Ae]}],"outline-w":[{outline:["",Fe,Ii,Zs]}],"outline-color":[{outline:$()}],shadow:[{shadow:["","none",g,Uc,Pc]}],"shadow-color":[{shadow:$()}],"inset-shadow":[{"inset-shadow":["none",v,Uc,Pc]}],"inset-shadow-color":[{"inset-shadow":$()}],"ring-w":[{ring:re()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:$()}],"ring-offset-w":[{"ring-offset":[Fe,Zs]}],"ring-offset-color":[{"ring-offset":$()}],"inset-ring-w":[{"inset-ring":re()}],"inset-ring-color":[{"inset-ring":$()}],"text-shadow":[{"text-shadow":["none",y,Uc,Pc]}],"text-shadow-color":[{"text-shadow":$()}],opacity:[{opacity:[Fe,Me,Ae]}],"mix-blend":[{"mix-blend":[...ge(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ge()}],"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":[Fe]}],"mask-image-linear-from-pos":[{"mask-linear-from":J()}],"mask-image-linear-to-pos":[{"mask-linear-to":J()}],"mask-image-linear-from-color":[{"mask-linear-from":$()}],"mask-image-linear-to-color":[{"mask-linear-to":$()}],"mask-image-t-from-pos":[{"mask-t-from":J()}],"mask-image-t-to-pos":[{"mask-t-to":J()}],"mask-image-t-from-color":[{"mask-t-from":$()}],"mask-image-t-to-color":[{"mask-t-to":$()}],"mask-image-r-from-pos":[{"mask-r-from":J()}],"mask-image-r-to-pos":[{"mask-r-to":J()}],"mask-image-r-from-color":[{"mask-r-from":$()}],"mask-image-r-to-color":[{"mask-r-to":$()}],"mask-image-b-from-pos":[{"mask-b-from":J()}],"mask-image-b-to-pos":[{"mask-b-to":J()}],"mask-image-b-from-color":[{"mask-b-from":$()}],"mask-image-b-to-color":[{"mask-b-to":$()}],"mask-image-l-from-pos":[{"mask-l-from":J()}],"mask-image-l-to-pos":[{"mask-l-to":J()}],"mask-image-l-from-color":[{"mask-l-from":$()}],"mask-image-l-to-color":[{"mask-l-to":$()}],"mask-image-x-from-pos":[{"mask-x-from":J()}],"mask-image-x-to-pos":[{"mask-x-to":J()}],"mask-image-x-from-color":[{"mask-x-from":$()}],"mask-image-x-to-color":[{"mask-x-to":$()}],"mask-image-y-from-pos":[{"mask-y-from":J()}],"mask-image-y-to-pos":[{"mask-y-to":J()}],"mask-image-y-from-color":[{"mask-y-from":$()}],"mask-image-y-to-color":[{"mask-y-to":$()}],"mask-image-radial":[{"mask-radial":[Me,Ae]}],"mask-image-radial-from-pos":[{"mask-radial-from":J()}],"mask-image-radial-to-pos":[{"mask-radial-to":J()}],"mask-image-radial-from-color":[{"mask-radial-from":$()}],"mask-image-radial-to-color":[{"mask-radial-to":$()}],"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":k()}],"mask-image-conic-pos":[{"mask-conic":[Fe]}],"mask-image-conic-from-pos":[{"mask-conic-from":J()}],"mask-image-conic-to-pos":[{"mask-conic-to":J()}],"mask-image-conic-from-color":[{"mask-conic-from":$()}],"mask-image-conic-to-color":[{"mask-conic-to":$()}],"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:B()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Me,Ae]}],filter:[{filter:["","none",Me,Ae]}],blur:[{blur:le()}],brightness:[{brightness:[Fe,Me,Ae]}],contrast:[{contrast:[Fe,Me,Ae]}],"drop-shadow":[{"drop-shadow":["","none",b,Uc,Pc]}],"drop-shadow-color":[{"drop-shadow":$()}],grayscale:[{grayscale:["",Fe,Me,Ae]}],"hue-rotate":[{"hue-rotate":[Fe,Me,Ae]}],invert:[{invert:["",Fe,Me,Ae]}],saturate:[{saturate:[Fe,Me,Ae]}],sepia:[{sepia:["",Fe,Me,Ae]}],"backdrop-filter":[{"backdrop-filter":["","none",Me,Ae]}],"backdrop-blur":[{"backdrop-blur":le()}],"backdrop-brightness":[{"backdrop-brightness":[Fe,Me,Ae]}],"backdrop-contrast":[{"backdrop-contrast":[Fe,Me,Ae]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Fe,Me,Ae]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Fe,Me,Ae]}],"backdrop-invert":[{"backdrop-invert":["",Fe,Me,Ae]}],"backdrop-opacity":[{"backdrop-opacity":[Fe,Me,Ae]}],"backdrop-saturate":[{"backdrop-saturate":[Fe,Me,Ae]}],"backdrop-sepia":[{"backdrop-sepia":["",Fe,Me,Ae]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":H()}],"border-spacing-x":[{"border-spacing-x":H()}],"border-spacing-y":[{"border-spacing-y":H()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Me,Ae]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Fe,"initial",Me,Ae]}],ease:[{ease:["linear","initial",E,Me,Ae]}],delay:[{delay:[Fe,Me,Ae]}],animate:[{animate:["none",M,Me,Ae]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[N,Me,Ae]}],"perspective-origin":[{"perspective-origin":R()}],rotate:[{rotate:ve()}],"rotate-x":[{"rotate-x":ve()}],"rotate-y":[{"rotate-y":ve()}],"rotate-z":[{"rotate-z":ve()}],scale:[{scale:Ne()}],"scale-x":[{"scale-x":Ne()}],"scale-y":[{"scale-y":Ne()}],"scale-z":[{"scale-z":Ne()}],"scale-3d":["scale-3d"],skew:[{skew:_e()}],"skew-x":[{"skew-x":_e()}],"skew-y":[{"skew-y":_e()}],transform:[{transform:[Me,Ae,"","none","gpu","cpu"]}],"transform-origin":[{origin:R()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:be()}],"translate-x":[{"translate-x":be()}],"translate-y":[{"translate-y":be()}],"translate-z":[{"translate-z":be()}],"translate-none":["translate-none"],accent:[{accent:$()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:$()}],"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",Me,Ae]}],"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":H()}],"scroll-mx":[{"scroll-mx":H()}],"scroll-my":[{"scroll-my":H()}],"scroll-ms":[{"scroll-ms":H()}],"scroll-me":[{"scroll-me":H()}],"scroll-mt":[{"scroll-mt":H()}],"scroll-mr":[{"scroll-mr":H()}],"scroll-mb":[{"scroll-mb":H()}],"scroll-ml":[{"scroll-ml":H()}],"scroll-p":[{"scroll-p":H()}],"scroll-px":[{"scroll-px":H()}],"scroll-py":[{"scroll-py":H()}],"scroll-ps":[{"scroll-ps":H()}],"scroll-pe":[{"scroll-pe":H()}],"scroll-pt":[{"scroll-pt":H()}],"scroll-pr":[{"scroll-pr":H()}],"scroll-pb":[{"scroll-pb":H()}],"scroll-pl":[{"scroll-pl":H()}],"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",Me,Ae]}],fill:[{fill:["none",...$()]}],"stroke-w":[{stroke:[Fe,Ii,Zs,Ym]}],stroke:[{stroke:["none",...$()]}],"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"]}},dC=FE(uC);function Ge(...e){return dC(Qb(e))}const fC=Jb("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:n,size:s,asChild:o=!1,...l}){const c=o?EE:"button";return a.jsx(c,{"data-slot":"button",className:Ge(fC({variant:n,size:s,className:e})),...l})}const mC=Jb("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 Qt({className:e,variant:n,...s}){return a.jsx("div",{className:Ge(mC({variant:n}),e),...s})}function Te(e,n,{checkForDefaultPrevented:s=!0}={}){return function(l){if(e?.(l),s===!1||!l.defaultPrevented)return n?.(l)}}function ir(e,n=[]){let s=[];function o(c,d){const f=w.createContext(d),m=s.length;s=[...s,d];const p=v=>{const{scope:y,children:b,...S}=v,N=y?.[e]?.[m]||f,_=w.useMemo(()=>S,Object.values(S));return a.jsx(N.Provider,{value:_,children:b})};p.displayName=c+"Provider";function g(v,y){const b=y?.[e]?.[m]||f,S=w.useContext(b);if(S)return S;if(d!==void 0)return d;throw new Error(`\`${v}\` must be used within \`${c}\``)}return[p,g]}const l=()=>{const c=s.map(d=>w.createContext(d));return function(f){const m=f?.[e]||c;return w.useMemo(()=>({[`__scope${e}`]:{...f,[e]:m}}),[f,m])}};return l.scopeName=e,[o,hC(l,...n)]}function hC(...e){const n=e[0];if(e.length===1)return n;const s=()=>{const o=e.map(l=>({useScope:l(),scopeName:l.scopeName}));return function(c){const d=o.reduce((f,{useScope:m,scopeName:p})=>{const v=m(c)[`__scope${p}`];return{...f,...v}},{});return w.useMemo(()=>({[`__scope${n.scopeName}`]:d}),[d])}};return s.scopeName=n.scopeName,s}var Pt=globalThis?.document?w.useLayoutEffect:()=>{},pC=Zb[" useInsertionEffect ".trim().toString()]||Pt;function so({prop:e,defaultProp:n,onChange:s=()=>{},caller:o}){const[l,c,d]=gC({defaultProp:n,onChange:s}),f=e!==void 0,m=f?e:l;{const g=w.useRef(e!==void 0);w.useEffect(()=>{const v=g.current;v!==f&&console.warn(`${o} is changing from ${v?"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,o])}const p=w.useCallback(g=>{if(f){const v=xC(g)?g(e):g;v!==e&&d.current?.(v)}else c(g)},[f,e,c,d]);return[m,p]}function gC({defaultProp:e,onChange:n}){const[s,o]=w.useState(e),l=w.useRef(s),c=w.useRef(n);return pC(()=>{c.current=n},[n]),w.useEffect(()=>{l.current!==s&&(c.current?.(s),l.current=s)},[s,l]),[s,o,c]}function xC(e){return typeof e=="function"}var fl=Wb();const yC=dp(fl);var vC=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Pe=vC.reduce((e,n)=>{const s=da(`Primitive.${n}`),o=w.forwardRef((l,c)=>{const{asChild:d,...f}=l,m=d?s:n;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(m,{...f,ref:c})});return o.displayName=`Primitive.${n}`,{...e,[n]:o}},{});function uw(e,n){e&&fl.flushSync(()=>e.dispatchEvent(n))}function mp(e){const n=e+"CollectionProvider",[s,o]=ir(n),[l,c]=s(n,{collectionRef:{current:null},itemMap:new Map}),d=N=>{const{scope:_,children:E}=N,M=gn.useRef(null),j=gn.useRef(new Map).current;return a.jsx(l,{scope:_,itemMap:j,collectionRef:M,children:E})};d.displayName=n;const f=e+"CollectionSlot",m=da(f),p=gn.forwardRef((N,_)=>{const{scope:E,children:M}=N,j=c(f,E),k=nt(_,j.collectionRef);return a.jsx(m,{ref:k,children:M})});p.displayName=f;const g=e+"CollectionItemSlot",v="data-radix-collection-item",y=da(g),b=gn.forwardRef((N,_)=>{const{scope:E,children:M,...j}=N,k=gn.useRef(null),R=nt(_,k),D=c(g,E);return gn.useEffect(()=>(D.itemMap.set(k,{ref:k,...j}),()=>void D.itemMap.delete(k))),a.jsx(y,{[v]:"",ref:R,children:M})});b.displayName=g;function S(N){const _=c(e+"CollectionConsumer",N);return gn.useCallback(()=>{const M=_.collectionRef.current;if(!M)return[];const j=Array.from(M.querySelectorAll(`[${v}]`));return Array.from(_.itemMap.values()).sort((D,z)=>j.indexOf(D.ref.current)-j.indexOf(z.ref.current))},[_.collectionRef,_.itemMap])}return[{Provider:d,Slot:p,ItemSlot:b},S,o]}var bC=w.createContext(void 0);function ml(e){const n=w.useContext(bC);return e||n||"ltr"}function Bt(e){const n=w.useRef(e);return w.useEffect(()=>{n.current=e}),w.useMemo(()=>(...s)=>n.current?.(...s),[])}function wC(e,n=globalThis?.document){const s=Bt(e);w.useEffect(()=>{const o=l=>{l.key==="Escape"&&s(l)};return n.addEventListener("keydown",o,{capture:!0}),()=>n.removeEventListener("keydown",o,{capture:!0})},[s,n])}var NC="DismissableLayer",Ch="dismissableLayer.update",SC="dismissableLayer.pointerDownOutside",jC="dismissableLayer.focusOutside",lv,dw=w.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),hp=w.forwardRef((e,n)=>{const{disableOutsidePointerEvents:s=!1,onEscapeKeyDown:o,onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:d,onDismiss:f,...m}=e,p=w.useContext(dw),[g,v]=w.useState(null),y=g?.ownerDocument??globalThis?.document,[,b]=w.useState({}),S=nt(n,z=>v(z)),N=Array.from(p.layers),[_]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),E=N.indexOf(_),M=g?N.indexOf(g):-1,j=p.layersWithOutsidePointerEventsDisabled.size>0,k=M>=E,R=CC(z=>{const H=z.target,U=[...p.branches].some(F=>F.contains(H));!k||U||(l?.(z),d?.(z),z.defaultPrevented||f?.())},y),D=kC(z=>{const H=z.target;[...p.branches].some(F=>F.contains(H))||(c?.(z),d?.(z),z.defaultPrevented||f?.())},y);return wC(z=>{M===p.layers.size-1&&(o?.(z),!z.defaultPrevented&&f&&(z.preventDefault(),f()))},y),w.useEffect(()=>{if(g)return s&&(p.layersWithOutsidePointerEventsDisabled.size===0&&(lv=y.body.style.pointerEvents,y.body.style.pointerEvents="none"),p.layersWithOutsidePointerEventsDisabled.add(g)),p.layers.add(g),cv(),()=>{s&&p.layersWithOutsidePointerEventsDisabled.size===1&&(y.body.style.pointerEvents=lv)}},[g,y,s,p]),w.useEffect(()=>()=>{g&&(p.layers.delete(g),p.layersWithOutsidePointerEventsDisabled.delete(g),cv())},[g,p]),w.useEffect(()=>{const z=()=>b({});return document.addEventListener(Ch,z),()=>document.removeEventListener(Ch,z)},[]),a.jsx(Pe.div,{...m,ref:S,style:{pointerEvents:j?k?"auto":"none":void 0,...e.style},onFocusCapture:Te(e.onFocusCapture,D.onFocusCapture),onBlurCapture:Te(e.onBlurCapture,D.onBlurCapture),onPointerDownCapture:Te(e.onPointerDownCapture,R.onPointerDownCapture)})});hp.displayName=NC;var _C="DismissableLayerBranch",EC=w.forwardRef((e,n)=>{const s=w.useContext(dw),o=w.useRef(null),l=nt(n,o);return w.useEffect(()=>{const c=o.current;if(c)return s.branches.add(c),()=>{s.branches.delete(c)}},[s.branches]),a.jsx(Pe.div,{...e,ref:l})});EC.displayName=_C;function CC(e,n=globalThis?.document){const s=Bt(e),o=w.useRef(!1),l=w.useRef(()=>{});return w.useEffect(()=>{const c=f=>{if(f.target&&!o.current){let m=function(){fw(SC,s,p,{discrete:!0})};const p={originalEvent:f};f.pointerType==="touch"?(n.removeEventListener("click",l.current),l.current=m,n.addEventListener("click",l.current,{once:!0})):m()}else n.removeEventListener("click",l.current);o.current=!1},d=window.setTimeout(()=>{n.addEventListener("pointerdown",c)},0);return()=>{window.clearTimeout(d),n.removeEventListener("pointerdown",c),n.removeEventListener("click",l.current)}},[n,s]),{onPointerDownCapture:()=>o.current=!0}}function kC(e,n=globalThis?.document){const s=Bt(e),o=w.useRef(!1);return w.useEffect(()=>{const l=c=>{c.target&&!o.current&&fw(jC,s,{originalEvent:c},{discrete:!1})};return n.addEventListener("focusin",l),()=>n.removeEventListener("focusin",l)},[n,s]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function cv(){const e=new CustomEvent(Ch);document.dispatchEvent(e)}function fw(e,n,s,{discrete:o}){const l=s.originalEvent.target,c=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:s});n&&l.addEventListener(e,n,{once:!0}),o?uw(l,c):l.dispatchEvent(c)}var Gm=0;function mw(){w.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??uv()),document.body.insertAdjacentElement("beforeend",e[1]??uv()),Gm++,()=>{Gm===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(n=>n.remove()),Gm--}},[])}function uv(){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 Xm="focusScope.autoFocusOnMount",Zm="focusScope.autoFocusOnUnmount",dv={bubbles:!1,cancelable:!0},AC="FocusScope",pp=w.forwardRef((e,n)=>{const{loop:s=!1,trapped:o=!1,onMountAutoFocus:l,onUnmountAutoFocus:c,...d}=e,[f,m]=w.useState(null),p=Bt(l),g=Bt(c),v=w.useRef(null),y=nt(n,N=>m(N)),b=w.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;w.useEffect(()=>{if(o){let N=function(j){if(b.paused||!f)return;const k=j.target;f.contains(k)?v.current=k:ps(v.current,{select:!0})},_=function(j){if(b.paused||!f)return;const k=j.relatedTarget;k!==null&&(f.contains(k)||ps(v.current,{select:!0}))},E=function(j){if(document.activeElement===document.body)for(const R of j)R.removedNodes.length>0&&ps(f)};document.addEventListener("focusin",N),document.addEventListener("focusout",_);const M=new MutationObserver(E);return f&&M.observe(f,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",N),document.removeEventListener("focusout",_),M.disconnect()}}},[o,f,b.paused]),w.useEffect(()=>{if(f){mv.add(b);const N=document.activeElement;if(!f.contains(N)){const E=new CustomEvent(Xm,dv);f.addEventListener(Xm,p),f.dispatchEvent(E),E.defaultPrevented||(MC(zC(hw(f)),{select:!0}),document.activeElement===N&&ps(f))}return()=>{f.removeEventListener(Xm,p),setTimeout(()=>{const E=new CustomEvent(Zm,dv);f.addEventListener(Zm,g),f.dispatchEvent(E),E.defaultPrevented||ps(N??document.body,{select:!0}),f.removeEventListener(Zm,g),mv.remove(b)},0)}}},[f,p,g,b]);const S=w.useCallback(N=>{if(!s&&!o||b.paused)return;const _=N.key==="Tab"&&!N.altKey&&!N.ctrlKey&&!N.metaKey,E=document.activeElement;if(_&&E){const M=N.currentTarget,[j,k]=TC(M);j&&k?!N.shiftKey&&E===k?(N.preventDefault(),s&&ps(j,{select:!0})):N.shiftKey&&E===j&&(N.preventDefault(),s&&ps(k,{select:!0})):E===M&&N.preventDefault()}},[s,o,b.paused]);return a.jsx(Pe.div,{tabIndex:-1,...d,ref:y,onKeyDown:S})});pp.displayName=AC;function MC(e,{select:n=!1}={}){const s=document.activeElement;for(const o of e)if(ps(o,{select:n}),document.activeElement!==s)return}function TC(e){const n=hw(e),s=fv(n,e),o=fv(n.reverse(),e);return[s,o]}function hw(e){const n=[],s=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const l=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||l?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;s.nextNode();)n.push(s.currentNode);return n}function fv(e,n){for(const s of e)if(!RC(s,{upTo:n}))return s}function RC(e,{upTo:n}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(n!==void 0&&e===n)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function DC(e){return e instanceof HTMLInputElement&&"select"in e}function ps(e,{select:n=!1}={}){if(e&&e.focus){const s=document.activeElement;e.focus({preventScroll:!0}),e!==s&&DC(e)&&n&&e.select()}}var mv=OC();function OC(){let e=[];return{add(n){const s=e[0];n!==s&&s?.pause(),e=hv(e,n),e.unshift(n)},remove(n){e=hv(e,n),e[0]?.resume()}}}function hv(e,n){const s=[...e],o=s.indexOf(n);return o!==-1&&s.splice(o,1),s}function zC(e){return e.filter(n=>n.tagName!=="A")}var IC=Zb[" useId ".trim().toString()]||(()=>{}),LC=0;function oo(e){const[n,s]=w.useState(IC());return Pt(()=>{s(o=>o??String(LC++))},[e]),n?`radix-${n}`:""}const HC=["top","right","bottom","left"],vs=Math.min,xn=Math.max,bu=Math.round,Vc=Math.floor,nr=e=>({x:e,y:e}),$C={left:"right",right:"left",bottom:"top",top:"bottom"},BC={start:"end",end:"start"};function kh(e,n,s){return xn(e,vs(n,s))}function zr(e,n){return typeof e=="function"?e(n):e}function Ir(e){return e.split("-")[0]}function ja(e){return e.split("-")[1]}function gp(e){return e==="x"?"y":"x"}function xp(e){return e==="y"?"height":"width"}const PC=new Set(["top","bottom"]);function er(e){return PC.has(Ir(e))?"y":"x"}function yp(e){return gp(er(e))}function UC(e,n,s){s===void 0&&(s=!1);const o=ja(e),l=yp(e),c=xp(l);let d=l==="x"?o===(s?"end":"start")?"right":"left":o==="start"?"bottom":"top";return n.reference[c]>n.floating[c]&&(d=wu(d)),[d,wu(d)]}function VC(e){const n=wu(e);return[Ah(e),n,Ah(n)]}function Ah(e){return e.replace(/start|end/g,n=>BC[n])}const pv=["left","right"],gv=["right","left"],qC=["top","bottom"],FC=["bottom","top"];function YC(e,n,s){switch(e){case"top":case"bottom":return s?n?gv:pv:n?pv:gv;case"left":case"right":return n?qC:FC;default:return[]}}function GC(e,n,s,o){const l=ja(e);let c=YC(Ir(e),s==="start",o);return l&&(c=c.map(d=>d+"-"+l),n&&(c=c.concat(c.map(Ah)))),c}function wu(e){return e.replace(/left|right|bottom|top/g,n=>$C[n])}function XC(e){return{top:0,right:0,bottom:0,left:0,...e}}function pw(e){return typeof e!="number"?XC(e):{top:e,right:e,bottom:e,left:e}}function Nu(e){const{x:n,y:s,width:o,height:l}=e;return{width:o,height:l,top:s,left:n,right:n+o,bottom:s+l,x:n,y:s}}function xv(e,n,s){let{reference:o,floating:l}=e;const c=er(n),d=yp(n),f=xp(d),m=Ir(n),p=c==="y",g=o.x+o.width/2-l.width/2,v=o.y+o.height/2-l.height/2,y=o[f]/2-l[f]/2;let b;switch(m){case"top":b={x:g,y:o.y-l.height};break;case"bottom":b={x:g,y:o.y+o.height};break;case"right":b={x:o.x+o.width,y:v};break;case"left":b={x:o.x-l.width,y:v};break;default:b={x:o.x,y:o.y}}switch(ja(n)){case"start":b[d]-=y*(s&&p?-1:1);break;case"end":b[d]+=y*(s&&p?-1:1);break}return b}const ZC=async(e,n,s)=>{const{placement:o="bottom",strategy:l="absolute",middleware:c=[],platform:d}=s,f=c.filter(Boolean),m=await(d.isRTL==null?void 0:d.isRTL(n));let p=await d.getElementRects({reference:e,floating:n,strategy:l}),{x:g,y:v}=xv(p,o,m),y=o,b={},S=0;for(let N=0;N<f.length;N++){const{name:_,fn:E}=f[N],{x:M,y:j,data:k,reset:R}=await E({x:g,y:v,initialPlacement:o,placement:y,strategy:l,middlewareData:b,rects:p,platform:d,elements:{reference:e,floating:n}});g=M??g,v=j??v,b={...b,[_]:{...b[_],...k}},R&&S<=50&&(S++,typeof R=="object"&&(R.placement&&(y=R.placement),R.rects&&(p=R.rects===!0?await d.getElementRects({reference:e,floating:n,strategy:l}):R.rects),{x:g,y:v}=xv(p,y,m)),N=-1)}return{x:g,y:v,placement:y,strategy:l,middlewareData:b}};async function Gi(e,n){var s;n===void 0&&(n={});const{x:o,y:l,platform:c,rects:d,elements:f,strategy:m}=e,{boundary:p="clippingAncestors",rootBoundary:g="viewport",elementContext:v="floating",altBoundary:y=!1,padding:b=0}=zr(n,e),S=pw(b),_=f[y?v==="floating"?"reference":"floating":v],E=Nu(await c.getClippingRect({element:(s=await(c.isElement==null?void 0:c.isElement(_)))==null||s?_:_.contextElement||await(c.getDocumentElement==null?void 0:c.getDocumentElement(f.floating)),boundary:p,rootBoundary:g,strategy:m})),M=v==="floating"?{x:o,y:l,width:d.floating.width,height:d.floating.height}:d.reference,j=await(c.getOffsetParent==null?void 0:c.getOffsetParent(f.floating)),k=await(c.isElement==null?void 0:c.isElement(j))?await(c.getScale==null?void 0:c.getScale(j))||{x:1,y:1}:{x:1,y:1},R=Nu(c.convertOffsetParentRelativeRectToViewportRelativeRect?await c.convertOffsetParentRelativeRectToViewportRelativeRect({elements:f,rect:M,offsetParent:j,strategy:m}):M);return{top:(E.top-R.top+S.top)/k.y,bottom:(R.bottom-E.bottom+S.bottom)/k.y,left:(E.left-R.left+S.left)/k.x,right:(R.right-E.right+S.right)/k.x}}const WC=e=>({name:"arrow",options:e,async fn(n){const{x:s,y:o,placement:l,rects:c,platform:d,elements:f,middlewareData:m}=n,{element:p,padding:g=0}=zr(e,n)||{};if(p==null)return{};const v=pw(g),y={x:s,y:o},b=yp(l),S=xp(b),N=await d.getDimensions(p),_=b==="y",E=_?"top":"left",M=_?"bottom":"right",j=_?"clientHeight":"clientWidth",k=c.reference[S]+c.reference[b]-y[b]-c.floating[S],R=y[b]-c.reference[b],D=await(d.getOffsetParent==null?void 0:d.getOffsetParent(p));let z=D?D[j]:0;(!z||!await(d.isElement==null?void 0:d.isElement(D)))&&(z=f.floating[j]||c.floating[S]);const H=k/2-R/2,U=z/2-N[S]/2-1,F=vs(v[E],U),K=vs(v[M],U),G=F,ne=z-N[S]-K,L=z/2-N[S]/2+H,V=kh(G,L,ne),A=!m.arrow&&ja(l)!=null&&L!==V&&c.reference[S]/2-(L<G?F:K)-N[S]/2<0,I=A?L<G?L-G:L-ne:0;return{[b]:y[b]+I,data:{[b]:V,centerOffset:L-V-I,...A&&{alignmentOffset:I}},reset:A}}}),KC=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(n){var s,o;const{placement:l,middlewareData:c,rects:d,initialPlacement:f,platform:m,elements:p}=n,{mainAxis:g=!0,crossAxis:v=!0,fallbackPlacements:y,fallbackStrategy:b="bestFit",fallbackAxisSideDirection:S="none",flipAlignment:N=!0,..._}=zr(e,n);if((s=c.arrow)!=null&&s.alignmentOffset)return{};const E=Ir(l),M=er(f),j=Ir(f)===f,k=await(m.isRTL==null?void 0:m.isRTL(p.floating)),R=y||(j||!N?[wu(f)]:VC(f)),D=S!=="none";!y&&D&&R.push(...GC(f,N,S,k));const z=[f,...R],H=await Gi(n,_),U=[];let F=((o=c.flip)==null?void 0:o.overflows)||[];if(g&&U.push(H[E]),v){const L=UC(l,d,k);U.push(H[L[0]],H[L[1]])}if(F=[...F,{placement:l,overflows:U}],!U.every(L=>L<=0)){var K,G;const L=(((K=c.flip)==null?void 0:K.index)||0)+1,V=z[L];if(V&&(!(v==="alignment"?M!==er(V):!1)||F.every($=>er($.placement)===M?$.overflows[0]>0:!0)))return{data:{index:L,overflows:F},reset:{placement:V}};let A=(G=F.filter(I=>I.overflows[0]<=0).sort((I,$)=>I.overflows[1]-$.overflows[1])[0])==null?void 0:G.placement;if(!A)switch(b){case"bestFit":{var ne;const I=(ne=F.filter($=>{if(D){const P=er($.placement);return P===M||P==="y"}return!0}).map($=>[$.placement,$.overflows.filter(P=>P>0).reduce((P,T)=>P+T,0)]).sort(($,P)=>$[1]-P[1])[0])==null?void 0:ne[0];I&&(A=I);break}case"initialPlacement":A=f;break}if(l!==A)return{reset:{placement:A}}}return{}}}};function yv(e,n){return{top:e.top-n.height,right:e.right-n.width,bottom:e.bottom-n.height,left:e.left-n.width}}function vv(e){return HC.some(n=>e[n]>=0)}const QC=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(n){const{rects:s}=n,{strategy:o="referenceHidden",...l}=zr(e,n);switch(o){case"referenceHidden":{const c=await Gi(n,{...l,elementContext:"reference"}),d=yv(c,s.reference);return{data:{referenceHiddenOffsets:d,referenceHidden:vv(d)}}}case"escaped":{const c=await Gi(n,{...l,altBoundary:!0}),d=yv(c,s.floating);return{data:{escapedOffsets:d,escaped:vv(d)}}}default:return{}}}}},gw=new Set(["left","top"]);async function JC(e,n){const{placement:s,platform:o,elements:l}=e,c=await(o.isRTL==null?void 0:o.isRTL(l.floating)),d=Ir(s),f=ja(s),m=er(s)==="y",p=gw.has(d)?-1:1,g=c&&m?-1:1,v=zr(n,e);let{mainAxis:y,crossAxis:b,alignmentAxis:S}=typeof v=="number"?{mainAxis:v,crossAxis:0,alignmentAxis:null}:{mainAxis:v.mainAxis||0,crossAxis:v.crossAxis||0,alignmentAxis:v.alignmentAxis};return f&&typeof S=="number"&&(b=f==="end"?S*-1:S),m?{x:b*g,y:y*p}:{x:y*p,y:b*g}}const ek=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(n){var s,o;const{x:l,y:c,placement:d,middlewareData:f}=n,m=await JC(n,e);return d===((s=f.offset)==null?void 0:s.placement)&&(o=f.arrow)!=null&&o.alignmentOffset?{}:{x:l+m.x,y:c+m.y,data:{...m,placement:d}}}}},tk=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(n){const{x:s,y:o,placement:l}=n,{mainAxis:c=!0,crossAxis:d=!1,limiter:f={fn:_=>{let{x:E,y:M}=_;return{x:E,y:M}}},...m}=zr(e,n),p={x:s,y:o},g=await Gi(n,m),v=er(Ir(l)),y=gp(v);let b=p[y],S=p[v];if(c){const _=y==="y"?"top":"left",E=y==="y"?"bottom":"right",M=b+g[_],j=b-g[E];b=kh(M,b,j)}if(d){const _=v==="y"?"top":"left",E=v==="y"?"bottom":"right",M=S+g[_],j=S-g[E];S=kh(M,S,j)}const N=f.fn({...n,[y]:b,[v]:S});return{...N,data:{x:N.x-s,y:N.y-o,enabled:{[y]:c,[v]:d}}}}}},nk=function(e){return e===void 0&&(e={}),{options:e,fn(n){const{x:s,y:o,placement:l,rects:c,middlewareData:d}=n,{offset:f=0,mainAxis:m=!0,crossAxis:p=!0}=zr(e,n),g={x:s,y:o},v=er(l),y=gp(v);let b=g[y],S=g[v];const N=zr(f,n),_=typeof N=="number"?{mainAxis:N,crossAxis:0}:{mainAxis:0,crossAxis:0,...N};if(m){const j=y==="y"?"height":"width",k=c.reference[y]-c.floating[j]+_.mainAxis,R=c.reference[y]+c.reference[j]-_.mainAxis;b<k?b=k:b>R&&(b=R)}if(p){var E,M;const j=y==="y"?"width":"height",k=gw.has(Ir(l)),R=c.reference[v]-c.floating[j]+(k&&((E=d.offset)==null?void 0:E[v])||0)+(k?0:_.crossAxis),D=c.reference[v]+c.reference[j]+(k?0:((M=d.offset)==null?void 0:M[v])||0)-(k?_.crossAxis:0);S<R?S=R:S>D&&(S=D)}return{[y]:b,[v]:S}}}},rk=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(n){var s,o;const{placement:l,rects:c,platform:d,elements:f}=n,{apply:m=()=>{},...p}=zr(e,n),g=await Gi(n,p),v=Ir(l),y=ja(l),b=er(l)==="y",{width:S,height:N}=c.floating;let _,E;v==="top"||v==="bottom"?(_=v,E=y===(await(d.isRTL==null?void 0:d.isRTL(f.floating))?"start":"end")?"left":"right"):(E=v,_=y==="end"?"top":"bottom");const M=N-g.top-g.bottom,j=S-g.left-g.right,k=vs(N-g[_],M),R=vs(S-g[E],j),D=!n.middlewareData.shift;let z=k,H=R;if((s=n.middlewareData.shift)!=null&&s.enabled.x&&(H=j),(o=n.middlewareData.shift)!=null&&o.enabled.y&&(z=M),D&&!y){const F=xn(g.left,0),K=xn(g.right,0),G=xn(g.top,0),ne=xn(g.bottom,0);b?H=S-2*(F!==0||K!==0?F+K:xn(g.left,g.right)):z=N-2*(G!==0||ne!==0?G+ne:xn(g.top,g.bottom))}await m({...n,availableWidth:H,availableHeight:z});const U=await d.getDimensions(f.floating);return S!==U.width||N!==U.height?{reset:{rects:!0}}:{}}}};function Fu(){return typeof window<"u"}function _a(e){return xw(e)?(e.nodeName||"").toLowerCase():"#document"}function vn(e){var n;return(e==null||(n=e.ownerDocument)==null?void 0:n.defaultView)||window}function lr(e){var n;return(n=(xw(e)?e.ownerDocument:e.document)||window.document)==null?void 0:n.documentElement}function xw(e){return Fu()?e instanceof Node||e instanceof vn(e).Node:!1}function Bn(e){return Fu()?e instanceof Element||e instanceof vn(e).Element:!1}function or(e){return Fu()?e instanceof HTMLElement||e instanceof vn(e).HTMLElement:!1}function bv(e){return!Fu()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof vn(e).ShadowRoot}const sk=new Set(["inline","contents"]);function hl(e){const{overflow:n,overflowX:s,overflowY:o,display:l}=Pn(e);return/auto|scroll|overlay|hidden|clip/.test(n+o+s)&&!sk.has(l)}const ok=new Set(["table","td","th"]);function ak(e){return ok.has(_a(e))}const ik=[":popover-open",":modal"];function Yu(e){return ik.some(n=>{try{return e.matches(n)}catch{return!1}})}const lk=["transform","translate","scale","rotate","perspective"],ck=["transform","translate","scale","rotate","perspective","filter"],uk=["paint","layout","strict","content"];function vp(e){const n=bp(),s=Bn(e)?Pn(e):e;return lk.some(o=>s[o]?s[o]!=="none":!1)||(s.containerType?s.containerType!=="normal":!1)||!n&&(s.backdropFilter?s.backdropFilter!=="none":!1)||!n&&(s.filter?s.filter!=="none":!1)||ck.some(o=>(s.willChange||"").includes(o))||uk.some(o=>(s.contain||"").includes(o))}function dk(e){let n=bs(e);for(;or(n)&&!fa(n);){if(vp(n))return n;if(Yu(n))return null;n=bs(n)}return null}function bp(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const fk=new Set(["html","body","#document"]);function fa(e){return fk.has(_a(e))}function Pn(e){return vn(e).getComputedStyle(e)}function Gu(e){return Bn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function bs(e){if(_a(e)==="html")return e;const n=e.assignedSlot||e.parentNode||bv(e)&&e.host||lr(e);return bv(n)?n.host:n}function yw(e){const n=bs(e);return fa(n)?e.ownerDocument?e.ownerDocument.body:e.body:or(n)&&hl(n)?n:yw(n)}function Xi(e,n,s){var o;n===void 0&&(n=[]),s===void 0&&(s=!0);const l=yw(e),c=l===((o=e.ownerDocument)==null?void 0:o.body),d=vn(l);if(c){const f=Mh(d);return n.concat(d,d.visualViewport||[],hl(l)?l:[],f&&s?Xi(f):[])}return n.concat(l,Xi(l,[],s))}function Mh(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function vw(e){const n=Pn(e);let s=parseFloat(n.width)||0,o=parseFloat(n.height)||0;const l=or(e),c=l?e.offsetWidth:s,d=l?e.offsetHeight:o,f=bu(s)!==c||bu(o)!==d;return f&&(s=c,o=d),{width:s,height:o,$:f}}function wp(e){return Bn(e)?e:e.contextElement}function aa(e){const n=wp(e);if(!or(n))return nr(1);const s=n.getBoundingClientRect(),{width:o,height:l,$:c}=vw(n);let d=(c?bu(s.width):s.width)/o,f=(c?bu(s.height):s.height)/l;return(!d||!Number.isFinite(d))&&(d=1),(!f||!Number.isFinite(f))&&(f=1),{x:d,y:f}}const mk=nr(0);function bw(e){const n=vn(e);return!bp()||!n.visualViewport?mk:{x:n.visualViewport.offsetLeft,y:n.visualViewport.offsetTop}}function hk(e,n,s){return n===void 0&&(n=!1),!s||n&&s!==vn(e)?!1:n}function ao(e,n,s,o){n===void 0&&(n=!1),s===void 0&&(s=!1);const l=e.getBoundingClientRect(),c=wp(e);let d=nr(1);n&&(o?Bn(o)&&(d=aa(o)):d=aa(e));const f=hk(c,s,o)?bw(c):nr(0);let m=(l.left+f.x)/d.x,p=(l.top+f.y)/d.y,g=l.width/d.x,v=l.height/d.y;if(c){const y=vn(c),b=o&&Bn(o)?vn(o):o;let S=y,N=Mh(S);for(;N&&o&&b!==S;){const _=aa(N),E=N.getBoundingClientRect(),M=Pn(N),j=E.left+(N.clientLeft+parseFloat(M.paddingLeft))*_.x,k=E.top+(N.clientTop+parseFloat(M.paddingTop))*_.y;m*=_.x,p*=_.y,g*=_.x,v*=_.y,m+=j,p+=k,S=vn(N),N=Mh(S)}}return Nu({width:g,height:v,x:m,y:p})}function Xu(e,n){const s=Gu(e).scrollLeft;return n?n.left+s:ao(lr(e)).left+s}function ww(e,n){const s=e.getBoundingClientRect(),o=s.left+n.scrollLeft-Xu(e,s),l=s.top+n.scrollTop;return{x:o,y:l}}function pk(e){let{elements:n,rect:s,offsetParent:o,strategy:l}=e;const c=l==="fixed",d=lr(o),f=n?Yu(n.floating):!1;if(o===d||f&&c)return s;let m={scrollLeft:0,scrollTop:0},p=nr(1);const g=nr(0),v=or(o);if((v||!v&&!c)&&((_a(o)!=="body"||hl(d))&&(m=Gu(o)),or(o))){const b=ao(o);p=aa(o),g.x=b.x+o.clientLeft,g.y=b.y+o.clientTop}const y=d&&!v&&!c?ww(d,m):nr(0);return{width:s.width*p.x,height:s.height*p.y,x:s.x*p.x-m.scrollLeft*p.x+g.x+y.x,y:s.y*p.y-m.scrollTop*p.y+g.y+y.y}}function gk(e){return Array.from(e.getClientRects())}function xk(e){const n=lr(e),s=Gu(e),o=e.ownerDocument.body,l=xn(n.scrollWidth,n.clientWidth,o.scrollWidth,o.clientWidth),c=xn(n.scrollHeight,n.clientHeight,o.scrollHeight,o.clientHeight);let d=-s.scrollLeft+Xu(e);const f=-s.scrollTop;return Pn(o).direction==="rtl"&&(d+=xn(n.clientWidth,o.clientWidth)-l),{width:l,height:c,x:d,y:f}}const wv=25;function yk(e,n){const s=vn(e),o=lr(e),l=s.visualViewport;let c=o.clientWidth,d=o.clientHeight,f=0,m=0;if(l){c=l.width,d=l.height;const g=bp();(!g||g&&n==="fixed")&&(f=l.offsetLeft,m=l.offsetTop)}const p=Xu(o);if(p<=0){const g=o.ownerDocument,v=g.body,y=getComputedStyle(v),b=g.compatMode==="CSS1Compat"&&parseFloat(y.marginLeft)+parseFloat(y.marginRight)||0,S=Math.abs(o.clientWidth-v.clientWidth-b);S<=wv&&(c-=S)}else p<=wv&&(c+=p);return{width:c,height:d,x:f,y:m}}const vk=new Set(["absolute","fixed"]);function bk(e,n){const s=ao(e,!0,n==="fixed"),o=s.top+e.clientTop,l=s.left+e.clientLeft,c=or(e)?aa(e):nr(1),d=e.clientWidth*c.x,f=e.clientHeight*c.y,m=l*c.x,p=o*c.y;return{width:d,height:f,x:m,y:p}}function Nv(e,n,s){let o;if(n==="viewport")o=yk(e,s);else if(n==="document")o=xk(lr(e));else if(Bn(n))o=bk(n,s);else{const l=bw(e);o={x:n.x-l.x,y:n.y-l.y,width:n.width,height:n.height}}return Nu(o)}function Nw(e,n){const s=bs(e);return s===n||!Bn(s)||fa(s)?!1:Pn(s).position==="fixed"||Nw(s,n)}function wk(e,n){const s=n.get(e);if(s)return s;let o=Xi(e,[],!1).filter(f=>Bn(f)&&_a(f)!=="body"),l=null;const c=Pn(e).position==="fixed";let d=c?bs(e):e;for(;Bn(d)&&!fa(d);){const f=Pn(d),m=vp(d);!m&&f.position==="fixed"&&(l=null),(c?!m&&!l:!m&&f.position==="static"&&!!l&&vk.has(l.position)||hl(d)&&!m&&Nw(e,d))?o=o.filter(g=>g!==d):l=f,d=bs(d)}return n.set(e,o),o}function Nk(e){let{element:n,boundary:s,rootBoundary:o,strategy:l}=e;const d=[...s==="clippingAncestors"?Yu(n)?[]:wk(n,this._c):[].concat(s),o],f=d[0],m=d.reduce((p,g)=>{const v=Nv(n,g,l);return p.top=xn(v.top,p.top),p.right=vs(v.right,p.right),p.bottom=vs(v.bottom,p.bottom),p.left=xn(v.left,p.left),p},Nv(n,f,l));return{width:m.right-m.left,height:m.bottom-m.top,x:m.left,y:m.top}}function Sk(e){const{width:n,height:s}=vw(e);return{width:n,height:s}}function jk(e,n,s){const o=or(n),l=lr(n),c=s==="fixed",d=ao(e,!0,c,n);let f={scrollLeft:0,scrollTop:0};const m=nr(0);function p(){m.x=Xu(l)}if(o||!o&&!c)if((_a(n)!=="body"||hl(l))&&(f=Gu(n)),o){const b=ao(n,!0,c,n);m.x=b.x+n.clientLeft,m.y=b.y+n.clientTop}else l&&p();c&&!o&&l&&p();const g=l&&!o&&!c?ww(l,f):nr(0),v=d.left+f.scrollLeft-m.x-g.x,y=d.top+f.scrollTop-m.y-g.y;return{x:v,y,width:d.width,height:d.height}}function Wm(e){return Pn(e).position==="static"}function Sv(e,n){if(!or(e)||Pn(e).position==="fixed")return null;if(n)return n(e);let s=e.offsetParent;return lr(e)===s&&(s=s.ownerDocument.body),s}function Sw(e,n){const s=vn(e);if(Yu(e))return s;if(!or(e)){let l=bs(e);for(;l&&!fa(l);){if(Bn(l)&&!Wm(l))return l;l=bs(l)}return s}let o=Sv(e,n);for(;o&&ak(o)&&Wm(o);)o=Sv(o,n);return o&&fa(o)&&Wm(o)&&!vp(o)?s:o||dk(e)||s}const _k=async function(e){const n=this.getOffsetParent||Sw,s=this.getDimensions,o=await s(e.floating);return{reference:jk(e.reference,await n(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Ek(e){return Pn(e).direction==="rtl"}const Ck={convertOffsetParentRelativeRectToViewportRelativeRect:pk,getDocumentElement:lr,getClippingRect:Nk,getOffsetParent:Sw,getElementRects:_k,getClientRects:gk,getDimensions:Sk,getScale:aa,isElement:Bn,isRTL:Ek};function jw(e,n){return e.x===n.x&&e.y===n.y&&e.width===n.width&&e.height===n.height}function kk(e,n){let s=null,o;const l=lr(e);function c(){var f;clearTimeout(o),(f=s)==null||f.disconnect(),s=null}function d(f,m){f===void 0&&(f=!1),m===void 0&&(m=1),c();const p=e.getBoundingClientRect(),{left:g,top:v,width:y,height:b}=p;if(f||n(),!y||!b)return;const S=Vc(v),N=Vc(l.clientWidth-(g+y)),_=Vc(l.clientHeight-(v+b)),E=Vc(g),j={rootMargin:-S+"px "+-N+"px "+-_+"px "+-E+"px",threshold:xn(0,vs(1,m))||1};let k=!0;function R(D){const z=D[0].intersectionRatio;if(z!==m){if(!k)return d();z?d(!1,z):o=setTimeout(()=>{d(!1,1e-7)},1e3)}z===1&&!jw(p,e.getBoundingClientRect())&&d(),k=!1}try{s=new IntersectionObserver(R,{...j,root:l.ownerDocument})}catch{s=new IntersectionObserver(R,j)}s.observe(e)}return d(!0),c}function Ak(e,n,s,o){o===void 0&&(o={});const{ancestorScroll:l=!0,ancestorResize:c=!0,elementResize:d=typeof ResizeObserver=="function",layoutShift:f=typeof IntersectionObserver=="function",animationFrame:m=!1}=o,p=wp(e),g=l||c?[...p?Xi(p):[],...Xi(n)]:[];g.forEach(E=>{l&&E.addEventListener("scroll",s,{passive:!0}),c&&E.addEventListener("resize",s)});const v=p&&f?kk(p,s):null;let y=-1,b=null;d&&(b=new ResizeObserver(E=>{let[M]=E;M&&M.target===p&&b&&(b.unobserve(n),cancelAnimationFrame(y),y=requestAnimationFrame(()=>{var j;(j=b)==null||j.observe(n)})),s()}),p&&!m&&b.observe(p),b.observe(n));let S,N=m?ao(e):null;m&&_();function _(){const E=ao(e);N&&!jw(N,E)&&s(),N=E,S=requestAnimationFrame(_)}return s(),()=>{var E;g.forEach(M=>{l&&M.removeEventListener("scroll",s),c&&M.removeEventListener("resize",s)}),v?.(),(E=b)==null||E.disconnect(),b=null,m&&cancelAnimationFrame(S)}}const Mk=ek,Tk=tk,Rk=KC,Dk=rk,Ok=QC,jv=WC,zk=nk,Ik=(e,n,s)=>{const o=new Map,l={platform:Ck,...s},c={...l.platform,_c:o};return ZC(e,n,{...l,platform:c})};var Lk=typeof document<"u",Hk=function(){},iu=Lk?w.useLayoutEffect:Hk;function Su(e,n){if(e===n)return!0;if(typeof e!=typeof n)return!1;if(typeof e=="function"&&e.toString()===n.toString())return!0;let s,o,l;if(e&&n&&typeof e=="object"){if(Array.isArray(e)){if(s=e.length,s!==n.length)return!1;for(o=s;o--!==0;)if(!Su(e[o],n[o]))return!1;return!0}if(l=Object.keys(e),s=l.length,s!==Object.keys(n).length)return!1;for(o=s;o--!==0;)if(!{}.hasOwnProperty.call(n,l[o]))return!1;for(o=s;o--!==0;){const c=l[o];if(!(c==="_owner"&&e.$$typeof)&&!Su(e[c],n[c]))return!1}return!0}return e!==e&&n!==n}function _w(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function _v(e,n){const s=_w(e);return Math.round(n*s)/s}function Km(e){const n=w.useRef(e);return iu(()=>{n.current=e}),n}function $k(e){e===void 0&&(e={});const{placement:n="bottom",strategy:s="absolute",middleware:o=[],platform:l,elements:{reference:c,floating:d}={},transform:f=!0,whileElementsMounted:m,open:p}=e,[g,v]=w.useState({x:0,y:0,strategy:s,placement:n,middlewareData:{},isPositioned:!1}),[y,b]=w.useState(o);Su(y,o)||b(o);const[S,N]=w.useState(null),[_,E]=w.useState(null),M=w.useCallback($=>{$!==D.current&&(D.current=$,N($))},[]),j=w.useCallback($=>{$!==z.current&&(z.current=$,E($))},[]),k=c||S,R=d||_,D=w.useRef(null),z=w.useRef(null),H=w.useRef(g),U=m!=null,F=Km(m),K=Km(l),G=Km(p),ne=w.useCallback(()=>{if(!D.current||!z.current)return;const $={placement:n,strategy:s,middleware:y};K.current&&($.platform=K.current),Ik(D.current,z.current,$).then(P=>{const T={...P,isPositioned:G.current!==!1};L.current&&!Su(H.current,T)&&(H.current=T,fl.flushSync(()=>{v(T)}))})},[y,n,s,K,G]);iu(()=>{p===!1&&H.current.isPositioned&&(H.current.isPositioned=!1,v($=>({...$,isPositioned:!1})))},[p]);const L=w.useRef(!1);iu(()=>(L.current=!0,()=>{L.current=!1}),[]),iu(()=>{if(k&&(D.current=k),R&&(z.current=R),k&&R){if(F.current)return F.current(k,R,ne);ne()}},[k,R,ne,F,U]);const V=w.useMemo(()=>({reference:D,floating:z,setReference:M,setFloating:j}),[M,j]),A=w.useMemo(()=>({reference:k,floating:R}),[k,R]),I=w.useMemo(()=>{const $={position:s,left:0,top:0};if(!A.floating)return $;const P=_v(A.floating,g.x),T=_v(A.floating,g.y);return f?{...$,transform:"translate("+P+"px, "+T+"px)",..._w(A.floating)>=1.5&&{willChange:"transform"}}:{position:s,left:P,top:T}},[s,f,A.floating,g.x,g.y]);return w.useMemo(()=>({...g,update:ne,refs:V,elements:A,floatingStyles:I}),[g,ne,V,A,I])}const Bk=e=>{function n(s){return{}.hasOwnProperty.call(s,"current")}return{name:"arrow",options:e,fn(s){const{element:o,padding:l}=typeof e=="function"?e(s):e;return o&&n(o)?o.current!=null?jv({element:o.current,padding:l}).fn(s):{}:o?jv({element:o,padding:l}).fn(s):{}}}},Pk=(e,n)=>({...Mk(e),options:[e,n]}),Uk=(e,n)=>({...Tk(e),options:[e,n]}),Vk=(e,n)=>({...zk(e),options:[e,n]}),qk=(e,n)=>({...Rk(e),options:[e,n]}),Fk=(e,n)=>({...Dk(e),options:[e,n]}),Yk=(e,n)=>({...Ok(e),options:[e,n]}),Gk=(e,n)=>({...Bk(e),options:[e,n]});var Xk="Arrow",Ew=w.forwardRef((e,n)=>{const{children:s,width:o=10,height:l=5,...c}=e;return a.jsx(Pe.svg,{...c,ref:n,width:o,height:l,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?s:a.jsx("polygon",{points:"0,0 30,0 15,10"})})});Ew.displayName=Xk;var Zk=Ew;function Np(e){const[n,s]=w.useState(void 0);return Pt(()=>{if(e){s({width:e.offsetWidth,height:e.offsetHeight});const o=new ResizeObserver(l=>{if(!Array.isArray(l)||!l.length)return;const c=l[0];let d,f;if("borderBoxSize"in c){const m=c.borderBoxSize,p=Array.isArray(m)?m[0]:m;d=p.inlineSize,f=p.blockSize}else d=e.offsetWidth,f=e.offsetHeight;s({width:d,height:f})});return o.observe(e,{box:"border-box"}),()=>o.unobserve(e)}else s(void 0)},[e]),n}var Sp="Popper",[Cw,Zu]=ir(Sp),[Wk,kw]=Cw(Sp),Aw=e=>{const{__scopePopper:n,children:s}=e,[o,l]=w.useState(null);return a.jsx(Wk,{scope:n,anchor:o,onAnchorChange:l,children:s})};Aw.displayName=Sp;var Mw="PopperAnchor",Tw=w.forwardRef((e,n)=>{const{__scopePopper:s,virtualRef:o,...l}=e,c=kw(Mw,s),d=w.useRef(null),f=nt(n,d),m=w.useRef(null);return w.useEffect(()=>{const p=m.current;m.current=o?.current||d.current,p!==m.current&&c.onAnchorChange(m.current)}),o?null:a.jsx(Pe.div,{...l,ref:f})});Tw.displayName=Mw;var jp="PopperContent",[Kk,Qk]=Cw(jp),Rw=w.forwardRef((e,n)=>{const{__scopePopper:s,side:o="bottom",sideOffset:l=0,align:c="center",alignOffset:d=0,arrowPadding:f=0,avoidCollisions:m=!0,collisionBoundary:p=[],collisionPadding:g=0,sticky:v="partial",hideWhenDetached:y=!1,updatePositionStrategy:b="optimized",onPlaced:S,...N}=e,_=kw(jp,s),[E,M]=w.useState(null),j=nt(n,J=>M(J)),[k,R]=w.useState(null),D=Np(k),z=D?.width??0,H=D?.height??0,U=o+(c!=="center"?"-"+c:""),F=typeof g=="number"?g:{top:0,right:0,bottom:0,left:0,...g},K=Array.isArray(p)?p:[p],G=K.length>0,ne={padding:F,boundary:K.filter(e4),altBoundary:G},{refs:L,floatingStyles:V,placement:A,isPositioned:I,middlewareData:$}=$k({strategy:"fixed",placement:U,whileElementsMounted:(...J)=>Ak(...J,{animationFrame:b==="always"}),elements:{reference:_.anchor},middleware:[Pk({mainAxis:l+H,alignmentAxis:d}),m&&Uk({mainAxis:!0,crossAxis:!1,limiter:v==="partial"?Vk():void 0,...ne}),m&&qk({...ne}),Fk({...ne,apply:({elements:J,rects:le,availableWidth:ve,availableHeight:Ne})=>{const{width:_e,height:be}=le.reference,Re=J.floating.style;Re.setProperty("--radix-popper-available-width",`${ve}px`),Re.setProperty("--radix-popper-available-height",`${Ne}px`),Re.setProperty("--radix-popper-anchor-width",`${_e}px`),Re.setProperty("--radix-popper-anchor-height",`${be}px`)}}),k&&Gk({element:k,padding:f}),t4({arrowWidth:z,arrowHeight:H}),y&&Yk({strategy:"referenceHidden",...ne})]}),[P,T]=zw(A),B=Bt(S);Pt(()=>{I&&B?.()},[I,B]);const W=$.arrow?.x,Z=$.arrow?.y,re=$.arrow?.centerOffset!==0,[de,ge]=w.useState();return Pt(()=>{E&&ge(window.getComputedStyle(E).zIndex)},[E]),a.jsx("div",{ref:L.setFloating,"data-radix-popper-content-wrapper":"",style:{...V,transform:I?V.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:de,"--radix-popper-transform-origin":[$.transformOrigin?.x,$.transformOrigin?.y].join(" "),...$.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:a.jsx(Kk,{scope:s,placedSide:P,onArrowChange:R,arrowX:W,arrowY:Z,shouldHideArrow:re,children:a.jsx(Pe.div,{"data-side":P,"data-align":T,...N,ref:j,style:{...N.style,animation:I?void 0:"none"}})})})});Rw.displayName=jp;var Dw="PopperArrow",Jk={top:"bottom",right:"left",bottom:"top",left:"right"},Ow=w.forwardRef(function(n,s){const{__scopePopper:o,...l}=n,c=Qk(Dw,o),d=Jk[c.placedSide];return a.jsx("span",{ref:c.onArrowChange,style:{position:"absolute",left:c.arrowX,top:c.arrowY,[d]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[c.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[c.placedSide],visibility:c.shouldHideArrow?"hidden":void 0},children:a.jsx(Zk,{...l,ref:s,style:{...l.style,display:"block"}})})});Ow.displayName=Dw;function e4(e){return e!==null}var t4=e=>({name:"transformOrigin",options:e,fn(n){const{placement:s,rects:o,middlewareData:l}=n,d=l.arrow?.centerOffset!==0,f=d?0:e.arrowWidth,m=d?0:e.arrowHeight,[p,g]=zw(s),v={start:"0%",center:"50%",end:"100%"}[g],y=(l.arrow?.x??0)+f/2,b=(l.arrow?.y??0)+m/2;let S="",N="";return p==="bottom"?(S=d?v:`${y}px`,N=`${-m}px`):p==="top"?(S=d?v:`${y}px`,N=`${o.floating.height+m}px`):p==="right"?(S=`${-m}px`,N=d?v:`${b}px`):p==="left"&&(S=`${o.floating.width+m}px`,N=d?v:`${b}px`),{data:{x:S,y:N}}}});function zw(e){const[n,s="center"]=e.split("-");return[n,s]}var Iw=Aw,Lw=Tw,Hw=Rw,$w=Ow,n4="Portal",_p=w.forwardRef((e,n)=>{const{container:s,...o}=e,[l,c]=w.useState(!1);Pt(()=>c(!0),[]);const d=s||l&&globalThis?.document?.body;return d?yC.createPortal(a.jsx(Pe.div,{...o,ref:n}),d):null});_p.displayName=n4;function r4(e,n){return w.useReducer((s,o)=>n[s][o]??s,e)}var Vn=e=>{const{present:n,children:s}=e,o=s4(n),l=typeof s=="function"?s({present:o.isPresent}):w.Children.only(s),c=nt(o.ref,o4(l));return typeof s=="function"||o.isPresent?w.cloneElement(l,{ref:c}):null};Vn.displayName="Presence";function s4(e){const[n,s]=w.useState(),o=w.useRef(null),l=w.useRef(e),c=w.useRef("none"),d=e?"mounted":"unmounted",[f,m]=r4(d,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return w.useEffect(()=>{const p=qc(o.current);c.current=f==="mounted"?p:"none"},[f]),Pt(()=>{const p=o.current,g=l.current;if(g!==e){const y=c.current,b=qc(p);e?m("MOUNT"):b==="none"||p?.display==="none"?m("UNMOUNT"):m(g&&y!==b?"ANIMATION_OUT":"UNMOUNT"),l.current=e}},[e,m]),Pt(()=>{if(n){let p;const g=n.ownerDocument.defaultView??window,v=b=>{const N=qc(o.current).includes(CSS.escape(b.animationName));if(b.target===n&&N&&(m("ANIMATION_END"),!l.current)){const _=n.style.animationFillMode;n.style.animationFillMode="forwards",p=g.setTimeout(()=>{n.style.animationFillMode==="forwards"&&(n.style.animationFillMode=_)})}},y=b=>{b.target===n&&(c.current=qc(o.current))};return n.addEventListener("animationstart",y),n.addEventListener("animationcancel",v),n.addEventListener("animationend",v),()=>{g.clearTimeout(p),n.removeEventListener("animationstart",y),n.removeEventListener("animationcancel",v),n.removeEventListener("animationend",v)}}else m("ANIMATION_END")},[n,m]),{isPresent:["mounted","unmountSuspended"].includes(f),ref:w.useCallback(p=>{o.current=p?getComputedStyle(p):null,s(p)},[])}}function qc(e){return e?.animationName||"none"}function o4(e){let n=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,s=n&&"isReactWarning"in n&&n.isReactWarning;return s?e.ref:(n=Object.getOwnPropertyDescriptor(e,"ref")?.get,s=n&&"isReactWarning"in n&&n.isReactWarning,s?e.props.ref:e.props.ref||e.ref)}var Qm="rovingFocusGroup.onEntryFocus",a4={bubbles:!1,cancelable:!0},pl="RovingFocusGroup",[Th,Bw,i4]=mp(pl),[l4,Wu]=ir(pl,[i4]),[c4,u4]=l4(pl),Pw=w.forwardRef((e,n)=>a.jsx(Th.Provider,{scope:e.__scopeRovingFocusGroup,children:a.jsx(Th.Slot,{scope:e.__scopeRovingFocusGroup,children:a.jsx(d4,{...e,ref:n})})}));Pw.displayName=pl;var d4=w.forwardRef((e,n)=>{const{__scopeRovingFocusGroup:s,orientation:o,loop:l=!1,dir:c,currentTabStopId:d,defaultCurrentTabStopId:f,onCurrentTabStopIdChange:m,onEntryFocus:p,preventScrollOnEntryFocus:g=!1,...v}=e,y=w.useRef(null),b=nt(n,y),S=ml(c),[N,_]=so({prop:d,defaultProp:f??null,onChange:m,caller:pl}),[E,M]=w.useState(!1),j=Bt(p),k=Bw(s),R=w.useRef(!1),[D,z]=w.useState(0);return w.useEffect(()=>{const H=y.current;if(H)return H.addEventListener(Qm,j),()=>H.removeEventListener(Qm,j)},[j]),a.jsx(c4,{scope:s,orientation:o,dir:S,loop:l,currentTabStopId:N,onItemFocus:w.useCallback(H=>_(H),[_]),onItemShiftTab:w.useCallback(()=>M(!0),[]),onFocusableItemAdd:w.useCallback(()=>z(H=>H+1),[]),onFocusableItemRemove:w.useCallback(()=>z(H=>H-1),[]),children:a.jsx(Pe.div,{tabIndex:E||D===0?-1:0,"data-orientation":o,...v,ref:b,style:{outline:"none",...e.style},onMouseDown:Te(e.onMouseDown,()=>{R.current=!0}),onFocus:Te(e.onFocus,H=>{const U=!R.current;if(H.target===H.currentTarget&&U&&!E){const F=new CustomEvent(Qm,a4);if(H.currentTarget.dispatchEvent(F),!F.defaultPrevented){const K=k().filter(A=>A.focusable),G=K.find(A=>A.active),ne=K.find(A=>A.id===N),V=[G,ne,...K].filter(Boolean).map(A=>A.ref.current);qw(V,g)}}R.current=!1}),onBlur:Te(e.onBlur,()=>M(!1))})})}),Uw="RovingFocusGroupItem",Vw=w.forwardRef((e,n)=>{const{__scopeRovingFocusGroup:s,focusable:o=!0,active:l=!1,tabStopId:c,children:d,...f}=e,m=oo(),p=c||m,g=u4(Uw,s),v=g.currentTabStopId===p,y=Bw(s),{onFocusableItemAdd:b,onFocusableItemRemove:S,currentTabStopId:N}=g;return w.useEffect(()=>{if(o)return b(),()=>S()},[o,b,S]),a.jsx(Th.ItemSlot,{scope:s,id:p,focusable:o,active:l,children:a.jsx(Pe.span,{tabIndex:v?0:-1,"data-orientation":g.orientation,...f,ref:n,onMouseDown:Te(e.onMouseDown,_=>{o?g.onItemFocus(p):_.preventDefault()}),onFocus:Te(e.onFocus,()=>g.onItemFocus(p)),onKeyDown:Te(e.onKeyDown,_=>{if(_.key==="Tab"&&_.shiftKey){g.onItemShiftTab();return}if(_.target!==_.currentTarget)return;const E=h4(_,g.orientation,g.dir);if(E!==void 0){if(_.metaKey||_.ctrlKey||_.altKey||_.shiftKey)return;_.preventDefault();let j=y().filter(k=>k.focusable).map(k=>k.ref.current);if(E==="last")j.reverse();else if(E==="prev"||E==="next"){E==="prev"&&j.reverse();const k=j.indexOf(_.currentTarget);j=g.loop?p4(j,k+1):j.slice(k+1)}setTimeout(()=>qw(j))}}),children:typeof d=="function"?d({isCurrentTabStop:v,hasTabStop:N!=null}):d})})});Vw.displayName=Uw;var f4={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function m4(e,n){return n!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function h4(e,n,s){const o=m4(e.key,s);if(!(n==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(n==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return f4[o]}function qw(e,n=!1){const s=document.activeElement;for(const o of e)if(o===s||(o.focus({preventScroll:n}),document.activeElement!==s))return}function p4(e,n){return e.map((s,o)=>e[(n+o)%e.length])}var Fw=Pw,Yw=Vw,g4=function(e){if(typeof document>"u")return null;var n=Array.isArray(e)?e[0]:e;return n.ownerDocument.body},ea=new WeakMap,Fc=new WeakMap,Yc={},Jm=0,Gw=function(e){return e&&(e.host||Gw(e.parentNode))},x4=function(e,n){return n.map(function(s){if(e.contains(s))return s;var o=Gw(s);return o&&e.contains(o)?o:(console.error("aria-hidden",s,"in not contained inside",e,". Doing nothing"),null)}).filter(function(s){return!!s})},y4=function(e,n,s,o){var l=x4(n,Array.isArray(e)?e:[e]);Yc[s]||(Yc[s]=new WeakMap);var c=Yc[s],d=[],f=new Set,m=new Set(l),p=function(v){!v||f.has(v)||(f.add(v),p(v.parentNode))};l.forEach(p);var g=function(v){!v||m.has(v)||Array.prototype.forEach.call(v.children,function(y){if(f.has(y))g(y);else try{var b=y.getAttribute(o),S=b!==null&&b!=="false",N=(ea.get(y)||0)+1,_=(c.get(y)||0)+1;ea.set(y,N),c.set(y,_),d.push(y),N===1&&S&&Fc.set(y,!0),_===1&&y.setAttribute(s,"true"),S||y.setAttribute(o,"true")}catch(E){console.error("aria-hidden: cannot operate on ",y,E)}})};return g(n),f.clear(),Jm++,function(){d.forEach(function(v){var y=ea.get(v)-1,b=c.get(v)-1;ea.set(v,y),c.set(v,b),y||(Fc.has(v)||v.removeAttribute(o),Fc.delete(v)),b||v.removeAttribute(s)}),Jm--,Jm||(ea=new WeakMap,ea=new WeakMap,Fc=new WeakMap,Yc={})}},Xw=function(e,n,s){s===void 0&&(s="data-aria-hidden");var o=Array.from(Array.isArray(e)?e:[e]),l=g4(e);return l?(o.push.apply(o,Array.from(l.querySelectorAll("[aria-live], script"))),y4(o,l,s,"aria-hidden")):function(){return null}},Jn=function(){return Jn=Object.assign||function(n){for(var s,o=1,l=arguments.length;o<l;o++){s=arguments[o];for(var c in s)Object.prototype.hasOwnProperty.call(s,c)&&(n[c]=s[c])}return n},Jn.apply(this,arguments)};function Zw(e,n){var s={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&n.indexOf(o)<0&&(s[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,o=Object.getOwnPropertySymbols(e);l<o.length;l++)n.indexOf(o[l])<0&&Object.prototype.propertyIsEnumerable.call(e,o[l])&&(s[o[l]]=e[o[l]]);return s}function v4(e,n,s){if(s||arguments.length===2)for(var o=0,l=n.length,c;o<l;o++)(c||!(o in n))&&(c||(c=Array.prototype.slice.call(n,0,o)),c[o]=n[o]);return e.concat(c||Array.prototype.slice.call(n))}var lu="right-scroll-bar-position",cu="width-before-scroll-bar",b4="with-scroll-bars-hidden",w4="--removed-body-scroll-bar-size";function eh(e,n){return typeof e=="function"?e(n):e&&(e.current=n),e}function N4(e,n){var s=w.useState(function(){return{value:e,callback:n,facade:{get current(){return s.value},set current(o){var l=s.value;l!==o&&(s.value=o,s.callback(o,l))}}}})[0];return s.callback=n,s.facade}var S4=typeof window<"u"?w.useLayoutEffect:w.useEffect,Ev=new WeakMap;function j4(e,n){var s=N4(null,function(o){return e.forEach(function(l){return eh(l,o)})});return S4(function(){var o=Ev.get(s);if(o){var l=new Set(o),c=new Set(e),d=s.current;l.forEach(function(f){c.has(f)||eh(f,null)}),c.forEach(function(f){l.has(f)||eh(f,d)})}Ev.set(s,e)},[e]),s}function _4(e){return e}function E4(e,n){n===void 0&&(n=_4);var s=[],o=!1,l={read:function(){if(o)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return s.length?s[s.length-1]:e},useMedium:function(c){var d=n(c,o);return s.push(d),function(){s=s.filter(function(f){return f!==d})}},assignSyncMedium:function(c){for(o=!0;s.length;){var d=s;s=[],d.forEach(c)}s={push:function(f){return c(f)},filter:function(){return s}}},assignMedium:function(c){o=!0;var d=[];if(s.length){var f=s;s=[],f.forEach(c),d=s}var m=function(){var g=d;d=[],g.forEach(c)},p=function(){return Promise.resolve().then(m)};p(),s={push:function(g){d.push(g),p()},filter:function(g){return d=d.filter(g),s}}}};return l}function C4(e){e===void 0&&(e={});var n=E4(null);return n.options=Jn({async:!0,ssr:!1},e),n}var Ww=function(e){var n=e.sideCar,s=Zw(e,["sideCar"]);if(!n)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var o=n.read();if(!o)throw new Error("Sidecar medium not found");return w.createElement(o,Jn({},s))};Ww.isSideCarExport=!0;function k4(e,n){return e.useMedium(n),Ww}var Kw=C4(),th=function(){},Ku=w.forwardRef(function(e,n){var s=w.useRef(null),o=w.useState({onScrollCapture:th,onWheelCapture:th,onTouchMoveCapture:th}),l=o[0],c=o[1],d=e.forwardProps,f=e.children,m=e.className,p=e.removeScrollBar,g=e.enabled,v=e.shards,y=e.sideCar,b=e.noRelative,S=e.noIsolation,N=e.inert,_=e.allowPinchZoom,E=e.as,M=E===void 0?"div":E,j=e.gapMode,k=Zw(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),R=y,D=j4([s,n]),z=Jn(Jn({},k),l);return w.createElement(w.Fragment,null,g&&w.createElement(R,{sideCar:Kw,removeScrollBar:p,shards:v,noRelative:b,noIsolation:S,inert:N,setCallbacks:c,allowPinchZoom:!!_,lockRef:s,gapMode:j}),d?w.cloneElement(w.Children.only(f),Jn(Jn({},z),{ref:D})):w.createElement(M,Jn({},z,{className:m,ref:D}),f))});Ku.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Ku.classNames={fullWidth:cu,zeroRight:lu};var A4=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function M4(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var n=A4();return n&&e.setAttribute("nonce",n),e}function T4(e,n){e.styleSheet?e.styleSheet.cssText=n:e.appendChild(document.createTextNode(n))}function R4(e){var n=document.head||document.getElementsByTagName("head")[0];n.appendChild(e)}var D4=function(){var e=0,n=null;return{add:function(s){e==0&&(n=M4())&&(T4(n,s),R4(n)),e++},remove:function(){e--,!e&&n&&(n.parentNode&&n.parentNode.removeChild(n),n=null)}}},O4=function(){var e=D4();return function(n,s){w.useEffect(function(){return e.add(n),function(){e.remove()}},[n&&s])}},Qw=function(){var e=O4(),n=function(s){var o=s.styles,l=s.dynamic;return e(o,l),null};return n},z4={left:0,top:0,right:0,gap:0},nh=function(e){return parseInt(e||"",10)||0},I4=function(e){var n=window.getComputedStyle(document.body),s=n[e==="padding"?"paddingLeft":"marginLeft"],o=n[e==="padding"?"paddingTop":"marginTop"],l=n[e==="padding"?"paddingRight":"marginRight"];return[nh(s),nh(o),nh(l)]},L4=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return z4;var n=I4(e),s=document.documentElement.clientWidth,o=window.innerWidth;return{left:n[0],top:n[1],right:n[2],gap:Math.max(0,o-s+n[2]-n[0])}},H4=Qw(),ia="data-scroll-locked",$4=function(e,n,s,o){var l=e.left,c=e.top,d=e.right,f=e.gap;return s===void 0&&(s="margin"),`
  .`.concat(b4,` {
   overflow: hidden `).concat(o,`;
   padding-right: `).concat(f,"px ").concat(o,`;
  }
  body[`).concat(ia,`] {
    overflow: hidden `).concat(o,`;
    overscroll-behavior: contain;
    `).concat([n&&"position: relative ".concat(o,";"),s==="margin"&&`
    padding-left: `.concat(l,`px;
    padding-top: `).concat(c,`px;
    padding-right: `).concat(d,`px;
    margin-left:0;
    margin-top:0;
    margin-right: `).concat(f,"px ").concat(o,`;
    `),s==="padding"&&"padding-right: ".concat(f,"px ").concat(o,";")].filter(Boolean).join(""),`
  }
  
  .`).concat(lu,` {
    right: `).concat(f,"px ").concat(o,`;
  }
  
  .`).concat(cu,` {
    margin-right: `).concat(f,"px ").concat(o,`;
  }
  
  .`).concat(lu," .").concat(lu,` {
    right: 0 `).concat(o,`;
  }
  
  .`).concat(cu," .").concat(cu,` {
    margin-right: 0 `).concat(o,`;
  }
  
  body[`).concat(ia,`] {
    `).concat(w4,": ").concat(f,`px;
  }
`)},Cv=function(){var e=parseInt(document.body.getAttribute(ia)||"0",10);return isFinite(e)?e:0},B4=function(){w.useEffect(function(){return document.body.setAttribute(ia,(Cv()+1).toString()),function(){var e=Cv()-1;e<=0?document.body.removeAttribute(ia):document.body.setAttribute(ia,e.toString())}},[])},P4=function(e){var n=e.noRelative,s=e.noImportant,o=e.gapMode,l=o===void 0?"margin":o;B4();var c=w.useMemo(function(){return L4(l)},[l]);return w.createElement(H4,{styles:$4(c,!n,l,s?"":"!important")})},Rh=!1;if(typeof window<"u")try{var Gc=Object.defineProperty({},"passive",{get:function(){return Rh=!0,!0}});window.addEventListener("test",Gc,Gc),window.removeEventListener("test",Gc,Gc)}catch{Rh=!1}var ta=Rh?{passive:!1}:!1,U4=function(e){return e.tagName==="TEXTAREA"},Jw=function(e,n){if(!(e instanceof Element))return!1;var s=window.getComputedStyle(e);return s[n]!=="hidden"&&!(s.overflowY===s.overflowX&&!U4(e)&&s[n]==="visible")},V4=function(e){return Jw(e,"overflowY")},q4=function(e){return Jw(e,"overflowX")},kv=function(e,n){var s=n.ownerDocument,o=n;do{typeof ShadowRoot<"u"&&o instanceof ShadowRoot&&(o=o.host);var l=e1(e,o);if(l){var c=t1(e,o),d=c[1],f=c[2];if(d>f)return!0}o=o.parentNode}while(o&&o!==s.body);return!1},F4=function(e){var n=e.scrollTop,s=e.scrollHeight,o=e.clientHeight;return[n,s,o]},Y4=function(e){var n=e.scrollLeft,s=e.scrollWidth,o=e.clientWidth;return[n,s,o]},e1=function(e,n){return e==="v"?V4(n):q4(n)},t1=function(e,n){return e==="v"?F4(n):Y4(n)},G4=function(e,n){return e==="h"&&n==="rtl"?-1:1},X4=function(e,n,s,o,l){var c=G4(e,window.getComputedStyle(n).direction),d=c*o,f=s.target,m=n.contains(f),p=!1,g=d>0,v=0,y=0;do{if(!f)break;var b=t1(e,f),S=b[0],N=b[1],_=b[2],E=N-_-c*S;(S||E)&&e1(e,f)&&(v+=E,y+=S);var M=f.parentNode;f=M&&M.nodeType===Node.DOCUMENT_FRAGMENT_NODE?M.host:M}while(!m&&f!==document.body||m&&(n.contains(f)||n===f));return(g&&Math.abs(v)<1||!g&&Math.abs(y)<1)&&(p=!0),p},Xc=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Av=function(e){return[e.deltaX,e.deltaY]},Mv=function(e){return e&&"current"in e?e.current:e},Z4=function(e,n){return e[0]===n[0]&&e[1]===n[1]},W4=function(e){return`
  .block-interactivity-`.concat(e,` {pointer-events: none;}
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
`)},K4=0,na=[];function Q4(e){var n=w.useRef([]),s=w.useRef([0,0]),o=w.useRef(),l=w.useState(K4++)[0],c=w.useState(Qw)[0],d=w.useRef(e);w.useEffect(function(){d.current=e},[e]),w.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(l));var N=v4([e.lockRef.current],(e.shards||[]).map(Mv),!0).filter(Boolean);return N.forEach(function(_){return _.classList.add("allow-interactivity-".concat(l))}),function(){document.body.classList.remove("block-interactivity-".concat(l)),N.forEach(function(_){return _.classList.remove("allow-interactivity-".concat(l))})}}},[e.inert,e.lockRef.current,e.shards]);var f=w.useCallback(function(N,_){if("touches"in N&&N.touches.length===2||N.type==="wheel"&&N.ctrlKey)return!d.current.allowPinchZoom;var E=Xc(N),M=s.current,j="deltaX"in N?N.deltaX:M[0]-E[0],k="deltaY"in N?N.deltaY:M[1]-E[1],R,D=N.target,z=Math.abs(j)>Math.abs(k)?"h":"v";if("touches"in N&&z==="h"&&D.type==="range")return!1;var H=kv(z,D);if(!H)return!0;if(H?R=z:(R=z==="v"?"h":"v",H=kv(z,D)),!H)return!1;if(!o.current&&"changedTouches"in N&&(j||k)&&(o.current=R),!R)return!0;var U=o.current||R;return X4(U,_,N,U==="h"?j:k)},[]),m=w.useCallback(function(N){var _=N;if(!(!na.length||na[na.length-1]!==c)){var E="deltaY"in _?Av(_):Xc(_),M=n.current.filter(function(R){return R.name===_.type&&(R.target===_.target||_.target===R.shadowParent)&&Z4(R.delta,E)})[0];if(M&&M.should){_.cancelable&&_.preventDefault();return}if(!M){var j=(d.current.shards||[]).map(Mv).filter(Boolean).filter(function(R){return R.contains(_.target)}),k=j.length>0?f(_,j[0]):!d.current.noIsolation;k&&_.cancelable&&_.preventDefault()}}},[]),p=w.useCallback(function(N,_,E,M){var j={name:N,delta:_,target:E,should:M,shadowParent:J4(E)};n.current.push(j),setTimeout(function(){n.current=n.current.filter(function(k){return k!==j})},1)},[]),g=w.useCallback(function(N){s.current=Xc(N),o.current=void 0},[]),v=w.useCallback(function(N){p(N.type,Av(N),N.target,f(N,e.lockRef.current))},[]),y=w.useCallback(function(N){p(N.type,Xc(N),N.target,f(N,e.lockRef.current))},[]);w.useEffect(function(){return na.push(c),e.setCallbacks({onScrollCapture:v,onWheelCapture:v,onTouchMoveCapture:y}),document.addEventListener("wheel",m,ta),document.addEventListener("touchmove",m,ta),document.addEventListener("touchstart",g,ta),function(){na=na.filter(function(N){return N!==c}),document.removeEventListener("wheel",m,ta),document.removeEventListener("touchmove",m,ta),document.removeEventListener("touchstart",g,ta)}},[]);var b=e.removeScrollBar,S=e.inert;return w.createElement(w.Fragment,null,S?w.createElement(c,{styles:W4(l)}):null,b?w.createElement(P4,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function J4(e){for(var n=null;e!==null;)e instanceof ShadowRoot&&(n=e.host,e=e.host),e=e.parentNode;return n}const e3=k4(Kw,Q4);var Ep=w.forwardRef(function(e,n){return w.createElement(Ku,Jn({},e,{ref:n,sideCar:e3}))});Ep.classNames=Ku.classNames;var Dh=["Enter"," "],t3=["ArrowDown","PageUp","Home"],n1=["ArrowUp","PageDown","End"],n3=[...t3,...n1],r3={ltr:[...Dh,"ArrowRight"],rtl:[...Dh,"ArrowLeft"]},s3={ltr:["ArrowLeft"],rtl:["ArrowRight"]},gl="Menu",[Zi,o3,a3]=mp(gl),[ho,r1]=ir(gl,[a3,Zu,Wu]),Qu=Zu(),s1=Wu(),[i3,po]=ho(gl),[l3,xl]=ho(gl),o1=e=>{const{__scopeMenu:n,open:s=!1,children:o,dir:l,onOpenChange:c,modal:d=!0}=e,f=Qu(n),[m,p]=w.useState(null),g=w.useRef(!1),v=Bt(c),y=ml(l);return w.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})}},[]),a.jsx(Iw,{...f,children:a.jsx(i3,{scope:n,open:s,onOpenChange:v,content:m,onContentChange:p,children:a.jsx(l3,{scope:n,onClose:w.useCallback(()=>v(!1),[v]),isUsingKeyboardRef:g,dir:y,modal:d,children:o})})})};o1.displayName=gl;var c3="MenuAnchor",Cp=w.forwardRef((e,n)=>{const{__scopeMenu:s,...o}=e,l=Qu(s);return a.jsx(Lw,{...l,...o,ref:n})});Cp.displayName=c3;var kp="MenuPortal",[u3,a1]=ho(kp,{forceMount:void 0}),i1=e=>{const{__scopeMenu:n,forceMount:s,children:o,container:l}=e,c=po(kp,n);return a.jsx(u3,{scope:n,forceMount:s,children:a.jsx(Vn,{present:s||c.open,children:a.jsx(_p,{asChild:!0,container:l,children:o})})})};i1.displayName=kp;var Mn="MenuContent",[d3,Ap]=ho(Mn),l1=w.forwardRef((e,n)=>{const s=a1(Mn,e.__scopeMenu),{forceMount:o=s.forceMount,...l}=e,c=po(Mn,e.__scopeMenu),d=xl(Mn,e.__scopeMenu);return a.jsx(Zi.Provider,{scope:e.__scopeMenu,children:a.jsx(Vn,{present:o||c.open,children:a.jsx(Zi.Slot,{scope:e.__scopeMenu,children:d.modal?a.jsx(f3,{...l,ref:n}):a.jsx(m3,{...l,ref:n})})})})}),f3=w.forwardRef((e,n)=>{const s=po(Mn,e.__scopeMenu),o=w.useRef(null),l=nt(n,o);return w.useEffect(()=>{const c=o.current;if(c)return Xw(c)},[]),a.jsx(Mp,{...e,ref:l,trapFocus:s.open,disableOutsidePointerEvents:s.open,disableOutsideScroll:!0,onFocusOutside:Te(e.onFocusOutside,c=>c.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>s.onOpenChange(!1)})}),m3=w.forwardRef((e,n)=>{const s=po(Mn,e.__scopeMenu);return a.jsx(Mp,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>s.onOpenChange(!1)})}),h3=da("MenuContent.ScrollLock"),Mp=w.forwardRef((e,n)=>{const{__scopeMenu:s,loop:o=!1,trapFocus:l,onOpenAutoFocus:c,onCloseAutoFocus:d,disableOutsidePointerEvents:f,onEntryFocus:m,onEscapeKeyDown:p,onPointerDownOutside:g,onFocusOutside:v,onInteractOutside:y,onDismiss:b,disableOutsideScroll:S,...N}=e,_=po(Mn,s),E=xl(Mn,s),M=Qu(s),j=s1(s),k=o3(s),[R,D]=w.useState(null),z=w.useRef(null),H=nt(n,z,_.onContentChange),U=w.useRef(0),F=w.useRef(""),K=w.useRef(0),G=w.useRef(null),ne=w.useRef("right"),L=w.useRef(0),V=S?Ep:w.Fragment,A=S?{as:h3,allowPinchZoom:!0}:void 0,I=P=>{const T=F.current+P,B=k().filter(J=>!J.disabled),W=document.activeElement,Z=B.find(J=>J.ref.current===W)?.textValue,re=B.map(J=>J.textValue),de=E3(re,T,Z),ge=B.find(J=>J.textValue===de)?.ref.current;(function J(le){F.current=le,window.clearTimeout(U.current),le!==""&&(U.current=window.setTimeout(()=>J(""),1e3))})(T),ge&&setTimeout(()=>ge.focus())};w.useEffect(()=>()=>window.clearTimeout(U.current),[]),mw();const $=w.useCallback(P=>ne.current===G.current?.side&&k3(P,G.current?.area),[]);return a.jsx(d3,{scope:s,searchRef:F,onItemEnter:w.useCallback(P=>{$(P)&&P.preventDefault()},[$]),onItemLeave:w.useCallback(P=>{$(P)||(z.current?.focus(),D(null))},[$]),onTriggerLeave:w.useCallback(P=>{$(P)&&P.preventDefault()},[$]),pointerGraceTimerRef:K,onPointerGraceIntentChange:w.useCallback(P=>{G.current=P},[]),children:a.jsx(V,{...A,children:a.jsx(pp,{asChild:!0,trapped:l,onMountAutoFocus:Te(c,P=>{P.preventDefault(),z.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:d,children:a.jsx(hp,{asChild:!0,disableOutsidePointerEvents:f,onEscapeKeyDown:p,onPointerDownOutside:g,onFocusOutside:v,onInteractOutside:y,onDismiss:b,children:a.jsx(Fw,{asChild:!0,...j,dir:E.dir,orientation:"vertical",loop:o,currentTabStopId:R,onCurrentTabStopIdChange:D,onEntryFocus:Te(m,P=>{E.isUsingKeyboardRef.current||P.preventDefault()}),preventScrollOnEntryFocus:!0,children:a.jsx(Hw,{role:"menu","aria-orientation":"vertical","data-state":j1(_.open),"data-radix-menu-content":"",dir:E.dir,...M,...N,ref:H,style:{outline:"none",...N.style},onKeyDown:Te(N.onKeyDown,P=>{const B=P.target.closest("[data-radix-menu-content]")===P.currentTarget,W=P.ctrlKey||P.altKey||P.metaKey,Z=P.key.length===1;B&&(P.key==="Tab"&&P.preventDefault(),!W&&Z&&I(P.key));const re=z.current;if(P.target!==re||!n3.includes(P.key))return;P.preventDefault();const ge=k().filter(J=>!J.disabled).map(J=>J.ref.current);n1.includes(P.key)&&ge.reverse(),j3(ge)}),onBlur:Te(e.onBlur,P=>{P.currentTarget.contains(P.target)||(window.clearTimeout(U.current),F.current="")}),onPointerMove:Te(e.onPointerMove,Wi(P=>{const T=P.target,B=L.current!==P.clientX;if(P.currentTarget.contains(T)&&B){const W=P.clientX>L.current?"right":"left";ne.current=W,L.current=P.clientX}}))})})})})})})});l1.displayName=Mn;var p3="MenuGroup",Tp=w.forwardRef((e,n)=>{const{__scopeMenu:s,...o}=e;return a.jsx(Pe.div,{role:"group",...o,ref:n})});Tp.displayName=p3;var g3="MenuLabel",c1=w.forwardRef((e,n)=>{const{__scopeMenu:s,...o}=e;return a.jsx(Pe.div,{...o,ref:n})});c1.displayName=g3;var ju="MenuItem",Tv="menu.itemSelect",Ju=w.forwardRef((e,n)=>{const{disabled:s=!1,onSelect:o,...l}=e,c=w.useRef(null),d=xl(ju,e.__scopeMenu),f=Ap(ju,e.__scopeMenu),m=nt(n,c),p=w.useRef(!1),g=()=>{const v=c.current;if(!s&&v){const y=new CustomEvent(Tv,{bubbles:!0,cancelable:!0});v.addEventListener(Tv,b=>o?.(b),{once:!0}),uw(v,y),y.defaultPrevented?p.current=!1:d.onClose()}};return a.jsx(u1,{...l,ref:m,disabled:s,onClick:Te(e.onClick,g),onPointerDown:v=>{e.onPointerDown?.(v),p.current=!0},onPointerUp:Te(e.onPointerUp,v=>{p.current||v.currentTarget?.click()}),onKeyDown:Te(e.onKeyDown,v=>{const y=f.searchRef.current!=="";s||y&&v.key===" "||Dh.includes(v.key)&&(v.currentTarget.click(),v.preventDefault())})})});Ju.displayName=ju;var u1=w.forwardRef((e,n)=>{const{__scopeMenu:s,disabled:o=!1,textValue:l,...c}=e,d=Ap(ju,s),f=s1(s),m=w.useRef(null),p=nt(n,m),[g,v]=w.useState(!1),[y,b]=w.useState("");return w.useEffect(()=>{const S=m.current;S&&b((S.textContent??"").trim())},[c.children]),a.jsx(Zi.ItemSlot,{scope:s,disabled:o,textValue:l??y,children:a.jsx(Yw,{asChild:!0,...f,focusable:!o,children:a.jsx(Pe.div,{role:"menuitem","data-highlighted":g?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0,...c,ref:p,onPointerMove:Te(e.onPointerMove,Wi(S=>{o?d.onItemLeave(S):(d.onItemEnter(S),S.defaultPrevented||S.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Te(e.onPointerLeave,Wi(S=>d.onItemLeave(S))),onFocus:Te(e.onFocus,()=>v(!0)),onBlur:Te(e.onBlur,()=>v(!1))})})})}),x3="MenuCheckboxItem",d1=w.forwardRef((e,n)=>{const{checked:s=!1,onCheckedChange:o,...l}=e;return a.jsx(g1,{scope:e.__scopeMenu,checked:s,children:a.jsx(Ju,{role:"menuitemcheckbox","aria-checked":_u(s)?"mixed":s,...l,ref:n,"data-state":Dp(s),onSelect:Te(l.onSelect,()=>o?.(_u(s)?!0:!s),{checkForDefaultPrevented:!1})})})});d1.displayName=x3;var f1="MenuRadioGroup",[y3,v3]=ho(f1,{value:void 0,onValueChange:()=>{}}),m1=w.forwardRef((e,n)=>{const{value:s,onValueChange:o,...l}=e,c=Bt(o);return a.jsx(y3,{scope:e.__scopeMenu,value:s,onValueChange:c,children:a.jsx(Tp,{...l,ref:n})})});m1.displayName=f1;var h1="MenuRadioItem",p1=w.forwardRef((e,n)=>{const{value:s,...o}=e,l=v3(h1,e.__scopeMenu),c=s===l.value;return a.jsx(g1,{scope:e.__scopeMenu,checked:c,children:a.jsx(Ju,{role:"menuitemradio","aria-checked":c,...o,ref:n,"data-state":Dp(c),onSelect:Te(o.onSelect,()=>l.onValueChange?.(s),{checkForDefaultPrevented:!1})})})});p1.displayName=h1;var Rp="MenuItemIndicator",[g1,b3]=ho(Rp,{checked:!1}),x1=w.forwardRef((e,n)=>{const{__scopeMenu:s,forceMount:o,...l}=e,c=b3(Rp,s);return a.jsx(Vn,{present:o||_u(c.checked)||c.checked===!0,children:a.jsx(Pe.span,{...l,ref:n,"data-state":Dp(c.checked)})})});x1.displayName=Rp;var w3="MenuSeparator",y1=w.forwardRef((e,n)=>{const{__scopeMenu:s,...o}=e;return a.jsx(Pe.div,{role:"separator","aria-orientation":"horizontal",...o,ref:n})});y1.displayName=w3;var N3="MenuArrow",v1=w.forwardRef((e,n)=>{const{__scopeMenu:s,...o}=e,l=Qu(s);return a.jsx($w,{...l,...o,ref:n})});v1.displayName=N3;var S3="MenuSub",[wI,b1]=ho(S3),$i="MenuSubTrigger",w1=w.forwardRef((e,n)=>{const s=po($i,e.__scopeMenu),o=xl($i,e.__scopeMenu),l=b1($i,e.__scopeMenu),c=Ap($i,e.__scopeMenu),d=w.useRef(null),{pointerGraceTimerRef:f,onPointerGraceIntentChange:m}=c,p={__scopeMenu:e.__scopeMenu},g=w.useCallback(()=>{d.current&&window.clearTimeout(d.current),d.current=null},[]);return w.useEffect(()=>g,[g]),w.useEffect(()=>{const v=f.current;return()=>{window.clearTimeout(v),m(null)}},[f,m]),a.jsx(Cp,{asChild:!0,...p,children:a.jsx(u1,{id:l.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":l.contentId,"data-state":j1(s.open),...e,ref:qu(n,l.onTriggerChange),onClick:v=>{e.onClick?.(v),!(e.disabled||v.defaultPrevented)&&(v.currentTarget.focus(),s.open||s.onOpenChange(!0))},onPointerMove:Te(e.onPointerMove,Wi(v=>{c.onItemEnter(v),!v.defaultPrevented&&!e.disabled&&!s.open&&!d.current&&(c.onPointerGraceIntentChange(null),d.current=window.setTimeout(()=>{s.onOpenChange(!0),g()},100))})),onPointerLeave:Te(e.onPointerLeave,Wi(v=>{g();const y=s.content?.getBoundingClientRect();if(y){const b=s.content?.dataset.side,S=b==="right",N=S?-5:5,_=y[S?"left":"right"],E=y[S?"right":"left"];c.onPointerGraceIntentChange({area:[{x:v.clientX+N,y:v.clientY},{x:_,y:y.top},{x:E,y:y.top},{x:E,y:y.bottom},{x:_,y:y.bottom}],side:b}),window.clearTimeout(f.current),f.current=window.setTimeout(()=>c.onPointerGraceIntentChange(null),300)}else{if(c.onTriggerLeave(v),v.defaultPrevented)return;c.onPointerGraceIntentChange(null)}})),onKeyDown:Te(e.onKeyDown,v=>{const y=c.searchRef.current!=="";e.disabled||y&&v.key===" "||r3[o.dir].includes(v.key)&&(s.onOpenChange(!0),s.content?.focus(),v.preventDefault())})})})});w1.displayName=$i;var N1="MenuSubContent",S1=w.forwardRef((e,n)=>{const s=a1(Mn,e.__scopeMenu),{forceMount:o=s.forceMount,...l}=e,c=po(Mn,e.__scopeMenu),d=xl(Mn,e.__scopeMenu),f=b1(N1,e.__scopeMenu),m=w.useRef(null),p=nt(n,m);return a.jsx(Zi.Provider,{scope:e.__scopeMenu,children:a.jsx(Vn,{present:o||c.open,children:a.jsx(Zi.Slot,{scope:e.__scopeMenu,children:a.jsx(Mp,{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&&m.current?.focus(),g.preventDefault()},onCloseAutoFocus:g=>g.preventDefault(),onFocusOutside:Te(e.onFocusOutside,g=>{g.target!==f.trigger&&c.onOpenChange(!1)}),onEscapeKeyDown:Te(e.onEscapeKeyDown,g=>{d.onClose(),g.preventDefault()}),onKeyDown:Te(e.onKeyDown,g=>{const v=g.currentTarget.contains(g.target),y=s3[d.dir].includes(g.key);v&&y&&(c.onOpenChange(!1),f.trigger?.focus(),g.preventDefault())})})})})})});S1.displayName=N1;function j1(e){return e?"open":"closed"}function _u(e){return e==="indeterminate"}function Dp(e){return _u(e)?"indeterminate":e?"checked":"unchecked"}function j3(e){const n=document.activeElement;for(const s of e)if(s===n||(s.focus(),document.activeElement!==n))return}function _3(e,n){return e.map((s,o)=>e[(n+o)%e.length])}function E3(e,n,s){const l=n.length>1&&Array.from(n).every(p=>p===n[0])?n[0]:n,c=s?e.indexOf(s):-1;let d=_3(e,Math.max(c,0));l.length===1&&(d=d.filter(p=>p!==s));const m=d.find(p=>p.toLowerCase().startsWith(l.toLowerCase()));return m!==s?m:void 0}function C3(e,n){const{x:s,y:o}=e;let l=!1;for(let c=0,d=n.length-1;c<n.length;d=c++){const f=n[c],m=n[d],p=f.x,g=f.y,v=m.x,y=m.y;g>o!=y>o&&s<(v-p)*(o-g)/(y-g)+p&&(l=!l)}return l}function k3(e,n){if(!n)return!1;const s={x:e.clientX,y:e.clientY};return C3(s,n)}function Wi(e){return n=>n.pointerType==="mouse"?e(n):void 0}var A3=o1,M3=Cp,T3=i1,R3=l1,D3=Tp,O3=c1,z3=Ju,I3=d1,L3=m1,H3=p1,$3=x1,B3=y1,P3=v1,U3=w1,V3=S1,ed="DropdownMenu",[q3,NI]=ir(ed,[r1]),Jt=r1(),[F3,_1]=q3(ed),E1=e=>{const{__scopeDropdownMenu:n,children:s,dir:o,open:l,defaultOpen:c,onOpenChange:d,modal:f=!0}=e,m=Jt(n),p=w.useRef(null),[g,v]=so({prop:l,defaultProp:c??!1,onChange:d,caller:ed});return a.jsx(F3,{scope:n,triggerId:oo(),triggerRef:p,contentId:oo(),open:g,onOpenChange:v,onOpenToggle:w.useCallback(()=>v(y=>!y),[v]),modal:f,children:a.jsx(A3,{...m,open:g,onOpenChange:v,dir:o,modal:f,children:s})})};E1.displayName=ed;var C1="DropdownMenuTrigger",k1=w.forwardRef((e,n)=>{const{__scopeDropdownMenu:s,disabled:o=!1,...l}=e,c=_1(C1,s),d=Jt(s);return a.jsx(M3,{asChild:!0,...d,children:a.jsx(Pe.button,{type:"button",id:c.triggerId,"aria-haspopup":"menu","aria-expanded":c.open,"aria-controls":c.open?c.contentId:void 0,"data-state":c.open?"open":"closed","data-disabled":o?"":void 0,disabled:o,...l,ref:qu(n,c.triggerRef),onPointerDown:Te(e.onPointerDown,f=>{!o&&f.button===0&&f.ctrlKey===!1&&(c.onOpenToggle(),c.open||f.preventDefault())}),onKeyDown:Te(e.onKeyDown,f=>{o||(["Enter"," "].includes(f.key)&&c.onOpenToggle(),f.key==="ArrowDown"&&c.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(f.key)&&f.preventDefault())})})})});k1.displayName=C1;var Y3="DropdownMenuPortal",A1=e=>{const{__scopeDropdownMenu:n,...s}=e,o=Jt(n);return a.jsx(T3,{...o,...s})};A1.displayName=Y3;var M1="DropdownMenuContent",T1=w.forwardRef((e,n)=>{const{__scopeDropdownMenu:s,...o}=e,l=_1(M1,s),c=Jt(s),d=w.useRef(!1);return a.jsx(R3,{id:l.contentId,"aria-labelledby":l.triggerId,...c,...o,ref:n,onCloseAutoFocus:Te(e.onCloseAutoFocus,f=>{d.current||l.triggerRef.current?.focus(),d.current=!1,f.preventDefault()}),onInteractOutside:Te(e.onInteractOutside,f=>{const m=f.detail.originalEvent,p=m.button===0&&m.ctrlKey===!0,g=m.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)"}})});T1.displayName=M1;var G3="DropdownMenuGroup",X3=w.forwardRef((e,n)=>{const{__scopeDropdownMenu:s,...o}=e,l=Jt(s);return a.jsx(D3,{...l,...o,ref:n})});X3.displayName=G3;var Z3="DropdownMenuLabel",R1=w.forwardRef((e,n)=>{const{__scopeDropdownMenu:s,...o}=e,l=Jt(s);return a.jsx(O3,{...l,...o,ref:n})});R1.displayName=Z3;var W3="DropdownMenuItem",D1=w.forwardRef((e,n)=>{const{__scopeDropdownMenu:s,...o}=e,l=Jt(s);return a.jsx(z3,{...l,...o,ref:n})});D1.displayName=W3;var K3="DropdownMenuCheckboxItem",Q3=w.forwardRef((e,n)=>{const{__scopeDropdownMenu:s,...o}=e,l=Jt(s);return a.jsx(I3,{...l,...o,ref:n})});Q3.displayName=K3;var J3="DropdownMenuRadioGroup",eA=w.forwardRef((e,n)=>{const{__scopeDropdownMenu:s,...o}=e,l=Jt(s);return a.jsx(L3,{...l,...o,ref:n})});eA.displayName=J3;var tA="DropdownMenuRadioItem",nA=w.forwardRef((e,n)=>{const{__scopeDropdownMenu:s,...o}=e,l=Jt(s);return a.jsx(H3,{...l,...o,ref:n})});nA.displayName=tA;var rA="DropdownMenuItemIndicator",sA=w.forwardRef((e,n)=>{const{__scopeDropdownMenu:s,...o}=e,l=Jt(s);return a.jsx($3,{...l,...o,ref:n})});sA.displayName=rA;var oA="DropdownMenuSeparator",O1=w.forwardRef((e,n)=>{const{__scopeDropdownMenu:s,...o}=e,l=Jt(s);return a.jsx(B3,{...l,...o,ref:n})});O1.displayName=oA;var aA="DropdownMenuArrow",iA=w.forwardRef((e,n)=>{const{__scopeDropdownMenu:s,...o}=e,l=Jt(s);return a.jsx(P3,{...l,...o,ref:n})});iA.displayName=aA;var lA="DropdownMenuSubTrigger",cA=w.forwardRef((e,n)=>{const{__scopeDropdownMenu:s,...o}=e,l=Jt(s);return a.jsx(U3,{...l,...o,ref:n})});cA.displayName=lA;var uA="DropdownMenuSubContent",dA=w.forwardRef((e,n)=>{const{__scopeDropdownMenu:s,...o}=e,l=Jt(s);return a.jsx(V3,{...l,...o,ref:n,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)"}})});dA.displayName=uA;var fA=E1,mA=k1,hA=A1,pA=T1,gA=R1,xA=D1,yA=O1;/**
 * @license lucide-react v0.540.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const vA=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),bA=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(n,s,o)=>o?o.toUpperCase():s.toLowerCase()),Rv=e=>{const n=bA(e);return n.charAt(0).toUpperCase()+n.slice(1)},z1=(...e)=>e.filter((n,s,o)=>!!n&&n.trim()!==""&&o.indexOf(n)===s).join(" ").trim(),wA=e=>{for(const n in e)if(n.startsWith("aria-")||n==="role"||n==="title")return!0};/**
 * @license lucide-react v0.540.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */var NA={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"};/**
 * @license lucide-react v0.540.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const SA=w.forwardRef(({color:e="currentColor",size:n=24,strokeWidth:s=2,absoluteStrokeWidth:o,className:l="",children:c,iconNode:d,...f},m)=>w.createElement("svg",{ref:m,...NA,width:n,height:n,stroke:e,strokeWidth:o?Number(s)*24/Number(n):s,className:z1("lucide",l),...!c&&!wA(f)&&{"aria-hidden":"true"},...f},[...d.map(([p,g])=>w.createElement(p,g)),...Array.isArray(c)?c:[c]]));/**
 * @license lucide-react v0.540.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ce=(e,n)=>{const s=w.forwardRef(({className:o,...l},c)=>w.createElement(SA,{ref:c,iconNode:n,className:z1(`lucide-${vA(Rv(e))}`,`lucide-${e}`,o),...l}));return s.displayName=Rv(e),s};/**
 * @license lucide-react v0.540.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const jA=[["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"}]],Op=Ce("activity",jA);/**
 * @license lucide-react v0.540.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const _A=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],EA=Ce("arrow-down",_A);/**
 * @license lucide-react v0.540.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const CA=[["path",{d:"M8 3 4 7l4 4",key:"9rb6wj"}],["path",{d:"M4 7h16",key:"6tx8e3"}],["path",{d:"m16 21 4-4-4-4",key:"siv7j2"}],["path",{d:"M20 17H4",key:"h6l3hr"}]],kA=Ce("arrow-left-right",CA);/**
 * @license lucide-react v0.540.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const AA=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],MA=Ce("arrow-left",AA);/**
 * @license lucide-react v0.540.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const TA=[["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"}]],I1=Ce("book-open",TA);/**
 * @license lucide-react v0.540.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const RA=[["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"}]],rr=Ce("bot",RA);/**
 * @license lucide-react v0.540.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const DA=[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]],OA=Ce("check-check",DA);/**
 * @license lucide-react v0.540.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const zA=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Ea=Ce("check",zA);/**
 * @license lucide-react v0.540.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const IA=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Xt=Ce("chevron-down",IA);/**
 * @license lucide-react v0.540.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const LA=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],L1=Ce("chevron-left",LA);/**
 * @license lucide-react v0.540.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const HA=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Un=Ce("chevron-right",HA);/**
 * @license lucide-react v0.540.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const $A=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Eu=Ce("chevron-up",$A);/**
 * @license lucide-react v0.540.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const BA=[["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"}]],ws=Ce("circle-alert",BA);/**
 * @license lucide-react v0.540.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const PA=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],td=Ce("circle-check-big",PA);/**
 * @license lucide-react v0.540.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const UA=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Kt=Ce("circle-check",UA);/**
 * @license lucide-react v0.540.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const VA=[["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"}]],qA=Ce("circle-play",VA);/**
 * @license lucide-react v0.540.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const FA=[["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"}]],yl=Ce("circle-x",FA);/**
 * @license lucide-react v0.540.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const YA=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],GA=Ce("clock",YA);/**
 * @license lucide-react v0.540.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const XA=[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]],ZA=Ce("cloud",XA);/**
 * @license lucide-react v0.540.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const WA=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],H1=Ce("code",WA);/**
 * @license lucide-react v0.540.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const KA=[["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"}]],QA=Ce("container",KA);/**
 * @license lucide-react v0.540.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const JA=[["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"}]],Js=Ce("copy",JA);/**
 * @license lucide-react v0.540.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const eM=[["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"}]],Oh=Ce("database",eM);/**
 * @license lucide-react v0.540.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const tM=[["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"}]],Cu=Ce("download",tM);/**
 * @license lucide-react v0.540.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const nM=[["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"}]],rM=Ce("ellipsis-vertical",nM);/**
 * @license lucide-react v0.540.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const sM=[["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"}]],ku=Ce("external-link",sM);/**
 * @license lucide-react v0.540.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const oM=[["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"}]],Ns=Ce("file-text",oM);/**
 * @license lucide-react v0.540.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const aM=[["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"}]],$1=Ce("folder-open",aM);/**
 * @license lucide-react v0.540.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const iM=[["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"}]],B1=Ce("globe",iM);/**
 * @license lucide-react v0.540.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const lM=[["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"}]],cM=Ce("grid-3x3",lM);/**
 * @license lucide-react v0.540.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const uM=[["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"}]],dM=Ce("house",uM);/**
 * @license lucide-react v0.540.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const fM=[["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"}]],mM=Ce("image",fM);/**
 * @license lucide-react v0.540.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const hM=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Ki=Ce("info",hM);/**
 * @license lucide-react v0.540.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const pM=[["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"}]],gM=Ce("key",pM);/**
 * @license lucide-react v0.540.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const xM=[["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"}]],yM=Ce("lightbulb",xM);/**
 * @license lucide-react v0.540.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const vM=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],go=Ce("loader-circle",vM);/**
 * @license lucide-react v0.540.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const bM=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],wM=Ce("lock",bM);/**
 * @license lucide-react v0.540.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const NM=[["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"}]],SM=Ce("map",NM);/**
 * @license lucide-react v0.540.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const jM=[["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"}]],_M=Ce("maximize",jM);/**
 * @license lucide-react v0.540.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const EM=[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]],CM=Ce("message-circle",EM);/**
 * @license lucide-react v0.540.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const kM=[["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"}]],P1=Ce("message-square",kM);/**
 * @license lucide-react v0.540.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const AM=[["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"}]],MM=Ce("moon",AM);/**
 * @license lucide-react v0.540.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const TM=[["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"}]],U1=Ce("music",TM);/**
 * @license lucide-react v0.540.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const RM=[["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"}]],zh=Ce("package",RM);/**
 * @license lucide-react v0.540.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const DM=[["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"}]],OM=Ce("panel-right-open",DM);/**
 * @license lucide-react v0.540.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const zM=[["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"}]],IM=Ce("paperclip",zM);/**
 * @license lucide-react v0.540.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const LM=[["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"}]],HM=Ce("play",LM);/**
 * @license lucide-react v0.540.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const $M=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],zp=Ce("plus",$M);/**
 * @license lucide-react v0.540.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const BM=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],V1=Ce("refresh-cw",BM);/**
 * @license lucide-react v0.540.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const PM=[["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"}]],Ih=Ce("rocket",PM);/**
 * @license lucide-react v0.540.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const UM=[["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"}]],Ip=Ce("rotate-ccw",UM);/**
 * @license lucide-react v0.540.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const VM=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Qi=Ce("search",VM);/**
 * @license lucide-react v0.540.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const qM=[["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"}]],FM=Ce("send-horizontal",qM);/**
 * @license lucide-react v0.540.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const YM=[["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"}]],uu=Ce("send",YM);/**
 * @license lucide-react v0.540.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const GM=[["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"}]],XM=Ce("server-off",GM);/**
 * @license lucide-react v0.540.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ZM=[["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"}]],Lh=Ce("settings",ZM);/**
 * @license lucide-react v0.540.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const WM=[["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"}]],KM=Ce("shuffle",WM);/**
 * @license lucide-react v0.540.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const QM=[["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"}]],JM=Ce("sun",QM);/**
 * @license lucide-react v0.540.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const eT=[["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"}]],Lp=Ce("trash-2",eT);/**
 * @license lucide-react v0.540.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const tT=[["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"}]],nT=Ce("triangle-alert",tT);/**
 * @license lucide-react v0.540.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const rT=[["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"}]],sT=Ce("upload",rT);/**
 * @license lucide-react v0.540.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const oT=[["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"}]],q1=Ce("user",oT);/**
 * @license lucide-react v0.540.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const aT=[["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"}]],Rr=Ce("workflow",aT);/**
 * @license lucide-react v0.540.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const iT=[["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"}]],nd=Ce("wrench",iT);/**
 * @license lucide-react v0.540.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const lT=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Ji=Ce("x",lT);/**
 * @license lucide-react v0.540.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const cT=[["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"}]],Hp=Ce("zap",cT);function $p({...e}){return a.jsx(fA,{"data-slot":"dropdown-menu",...e})}function Bp({...e}){return a.jsx(mA,{"data-slot":"dropdown-menu-trigger",...e})}function Pp({className:e,sideOffset:n=4,...s}){return a.jsx(hA,{children:a.jsx(pA,{"data-slot":"dropdown-menu-content",sideOffset:n,className:Ge("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),...s})})}function Gt({className:e,inset:n,variant:s="default",...o}){return a.jsx(xA,{"data-slot":"dropdown-menu-item","data-inset":n,"data-variant":s,className:Ge("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),...o})}function rh({className:e,inset:n,...s}){return a.jsx(gA,{"data-slot":"dropdown-menu-label","data-inset":n,className:Ge("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",e),...s})}function Vi({className:e,...n}){return a.jsx(yA,{"data-slot":"dropdown-menu-separator",className:Ge("bg-border -mx-1 my-1 h-px",e),...n})}function Up({size:e="md",className:n}){return a.jsx(go,{className:Ge("animate-spin",{"h-4 w-4":e==="sm","h-6 w-6":e==="md","h-8 w-8":e==="lg"},n)})}const uT=e=>e==="workflow"?Rr:rr;function dT({agents:e,workflows:n,entities:s,selectedItem:o,onSelect:l,onBrowseGallery:c,isLoading:d=!1}){const[f,m]=w.useState(!1),p=s||[...e,...n],g=S=>{l(S),m(!1)},v=o?uT(o.type):rr,y=o?.name||o?.id||"Select Agent or Workflow",b=o?.metadata?.lazy_loaded!==!1;return a.jsxs($p,{open:f,onOpenChange:m,children:[a.jsx(Bp,{asChild:!0,children:a.jsx(Oe,{variant:"outline",className:"w-64 justify-between font-mono text-sm",disabled:d,children:d?a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Up,{size:"sm"}),a.jsx("span",{className:"text-muted-foreground",children:"Loading..."})]}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[a.jsx(v,{className:"h-4 w-4 flex-shrink-0"}),a.jsx("span",{className:"truncate",children:y}),o&&!b&&a.jsx(go,{className:"h-3 w-3 text-muted-foreground animate-spin ml-auto flex-shrink-0"})]}),a.jsx(Xt,{className:"h-4 w-4 opacity-50"})]})})}),a.jsxs(Pp,{className:"w-80 font-mono",children:[(()=>{const S=p.filter(E=>E.type==="workflow"),N=p.filter(E=>E.type==="agent"),_=p[0]?.type;return a.jsxs(a.Fragment,{children:[_==="workflow"&&S.length>0&&a.jsxs(a.Fragment,{children:[a.jsxs(rh,{className:"flex items-center gap-2",children:[a.jsx(Rr,{className:"h-4 w-4"}),"Workflows (",S.length,")"]}),S.map(E=>{const M=E.metadata?.lazy_loaded!==!1;return a.jsx(Gt,{className:"cursor-pointer group",onClick:()=>g(E),children:a.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[a.jsx(Rr,{className:"h-4 w-4 flex-shrink-0"}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("span",{className:"truncate font-medium block",children:E.name||E.id}),M&&E.description&&a.jsx("div",{className:"text-xs text-muted-foreground line-clamp-2",children:E.description})]})]})},E.id)})]}),S.length>0&&N.length>0&&a.jsx(Vi,{}),N.length>0&&a.jsxs(a.Fragment,{children:[a.jsxs(rh,{className:"flex items-center gap-2",children:[a.jsx(rr,{className:"h-4 w-4"}),"Agents (",N.length,")"]}),N.map(E=>{const M=E.metadata?.lazy_loaded!==!1;return a.jsx(Gt,{className:"cursor-pointer group",onClick:()=>g(E),children:a.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[a.jsx(rr,{className:"h-4 w-4 flex-shrink-0"}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("span",{className:"truncate font-medium block",children:E.name||E.id}),M&&E.description&&a.jsx("div",{className:"text-xs text-muted-foreground line-clamp-2",children:E.description})]})]})},E.id)})]}),_==="agent"&&S.length>0&&a.jsxs(a.Fragment,{children:[N.length>0&&a.jsx(Vi,{}),a.jsxs(rh,{className:"flex items-center gap-2",children:[a.jsx(Rr,{className:"h-4 w-4"}),"Workflows (",S.length,")"]}),S.map(E=>{const M=E.metadata?.lazy_loaded!==!1;return a.jsx(Gt,{className:"cursor-pointer group",onClick:()=>g(E),children:a.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[a.jsx(Rr,{className:"h-4 w-4 flex-shrink-0"}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("span",{className:"truncate font-medium block",children:E.name||E.id}),M&&E.description&&a.jsx("div",{className:"text-xs text-muted-foreground line-clamp-2",children:E.description})]})]})},E.id)})]})]})})(),p.length===0&&a.jsx(Gt,{disabled:!0,children:a.jsx("div",{className:"text-center text-muted-foreground py-2",children:d?"Loading agents and workflows...":"No agents or workflows found"})}),a.jsx(Vi,{}),a.jsxs(Gt,{className:"cursor-pointer text-primary",onClick:()=>{c?.(),m(!1)},children:[a.jsx(zp,{className:"h-4 w-4 mr-2"}),"Browse Gallery"]})]})]})}var fT=(e,n,s,o,l,c,d,f)=>{let m=document.documentElement,p=["light","dark"];function g(b){(Array.isArray(e)?e:[e]).forEach(S=>{let N=S==="class",_=N&&c?l.map(E=>c[E]||E):l;N?(m.classList.remove(..._),m.classList.add(c&&c[b]?c[b]:b)):m.setAttribute(S,b)}),v(b)}function v(b){f&&p.includes(b)&&(m.style.colorScheme=b)}function y(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(o)g(o);else try{let b=localStorage.getItem(n)||s,S=d&&b==="system"?y():b;g(S)}catch{}},Dv=["light","dark"],F1="(prefers-color-scheme: dark)",mT=typeof window>"u",Vp=w.createContext(void 0),hT={setTheme:e=>{},themes:[]},pT=()=>{var e;return(e=w.useContext(Vp))!=null?e:hT},gT=e=>w.useContext(Vp)?w.createElement(w.Fragment,null,e.children):w.createElement(yT,{...e}),xT=["light","dark"],yT=({forcedTheme:e,disableTransitionOnChange:n=!1,enableSystem:s=!0,enableColorScheme:o=!0,storageKey:l="theme",themes:c=xT,defaultTheme:d=s?"system":"light",attribute:f="data-theme",value:m,children:p,nonce:g,scriptProps:v})=>{let[y,b]=w.useState(()=>bT(l,d)),[S,N]=w.useState(()=>y==="system"?sh():y),_=m?Object.values(m):c,E=w.useCallback(R=>{let D=R;if(!D)return;R==="system"&&s&&(D=sh());let z=m?m[D]:D,H=n?wT(g):null,U=document.documentElement,F=K=>{K==="class"?(U.classList.remove(..._),z&&U.classList.add(z)):K.startsWith("data-")&&(z?U.setAttribute(K,z):U.removeAttribute(K))};if(Array.isArray(f)?f.forEach(F):F(f),o){let K=Dv.includes(d)?d:null,G=Dv.includes(D)?D:K;U.style.colorScheme=G}H?.()},[g]),M=w.useCallback(R=>{let D=typeof R=="function"?R(y):R;b(D);try{localStorage.setItem(l,D)}catch{}},[y]),j=w.useCallback(R=>{let D=sh(R);N(D),y==="system"&&s&&!e&&E("system")},[y,e]);w.useEffect(()=>{let R=window.matchMedia(F1);return R.addListener(j),j(R),()=>R.removeListener(j)},[j]),w.useEffect(()=>{let R=D=>{D.key===l&&(D.newValue?b(D.newValue):M(d))};return window.addEventListener("storage",R),()=>window.removeEventListener("storage",R)},[M]),w.useEffect(()=>{E(e??y)},[e,y]);let k=w.useMemo(()=>({theme:y,setTheme:M,forcedTheme:e,resolvedTheme:y==="system"?S:y,themes:s?[...c,"system"]:c,systemTheme:s?S:void 0}),[y,M,e,S,s,c]);return w.createElement(Vp.Provider,{value:k},w.createElement(vT,{forcedTheme:e,storageKey:l,attribute:f,enableSystem:s,enableColorScheme:o,defaultTheme:d,value:m,themes:c,nonce:g,scriptProps:v}),p)},vT=w.memo(({forcedTheme:e,storageKey:n,attribute:s,enableSystem:o,enableColorScheme:l,defaultTheme:c,value:d,themes:f,nonce:m,scriptProps:p})=>{let g=JSON.stringify([s,n,c,e,f,d,o,l]).slice(1,-1);return w.createElement("script",{...p,suppressHydrationWarning:!0,nonce:typeof window>"u"?m:"",dangerouslySetInnerHTML:{__html:`(${fT.toString()})(${g})`}})}),bT=(e,n)=>{if(mT)return;let s;try{s=localStorage.getItem(e)||void 0}catch{}return s||n},wT=e=>{let n=document.createElement("style");return e&&n.setAttribute("nonce",e),n.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(n),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(n)},1)}},sh=e=>(e||(e=window.matchMedia(F1)),e.matches?"dark":"light");function NT(){const{setTheme:e}=pT();return a.jsxs($p,{children:[a.jsx(Bp,{asChild:!0,children:a.jsxs(Oe,{variant:"ghost",size:"sm",children:[a.jsx(JM,{className:"h-[1.2rem] w-[1.2rem] rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),a.jsx(MM,{className:"absolute h-[1.2rem] w-[1.2rem] rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),a.jsx("span",{className:"sr-only",children:"Toggle theme"})]})}),a.jsxs(Pp,{align:"end",children:[a.jsx(Gt,{onClick:()=>e("light"),children:"Light"}),a.jsx(Gt,{onClick:()=>e("dark"),children:"Dark"}),a.jsx(Gt,{onClick:()=>e("system"),children:"System"})]})]})}const Ov=e=>{let n;const s=new Set,o=(p,g)=>{const v=typeof p=="function"?p(n):p;if(!Object.is(v,n)){const y=n;n=g??(typeof v!="object"||v===null)?v:Object.assign({},n,v),s.forEach(b=>b(n,y))}},l=()=>n,f={setState:o,getState:l,getInitialState:()=>m,subscribe:p=>(s.add(p),()=>s.delete(p))},m=n=e(o,l,f);return f},ST=(e=>e?Ov(e):Ov),jT=e=>e;function _T(e,n=jT){const s=gn.useSyncExternalStore(e.subscribe,gn.useCallback(()=>n(e.getState()),[e,n]),gn.useCallback(()=>n(e.getInitialState()),[e,n]));return gn.useDebugValue(s),s}const ET=e=>{const n=ST(e),s=o=>_T(n,o);return Object.assign(s,n),s},CT=(e=>ET),zv={BASE_URL:"./",DEV:!1,MODE:"production",PROD:!0,SSR:!1},el=new Map,Zc=e=>{const n=el.get(e);return n?Object.fromEntries(Object.entries(n.stores).map(([s,o])=>[s,o.getState()])):{}},kT=(e,n,s)=>{if(e===void 0)return{type:"untracked",connection:n.connect(s)};const o=el.get(s.name);if(o)return{type:"tracked",store:e,...o};const l={connection:n.connect(s),stores:{}};return el.set(s.name,l),{type:"tracked",store:e,...l}},AT=(e,n)=>{if(n===void 0)return;const s=el.get(e);s&&(delete s.stores[n],Object.keys(s.stores).length===0&&el.delete(e))},MT=e=>{var n,s;if(!e)return;const o=e.split(`
`),l=o.findIndex(d=>d.includes("api.setState"));if(l<0)return;const c=((n=o[l+1])==null?void 0:n.trim())||"";return(s=/.+ (.+) .+/.exec(c))==null?void 0:s[1]},TT=(e,n={})=>(s,o,l)=>{const{enabled:c,anonymousActionType:d,store:f,...m}=n;let p;try{p=(c??(zv?"production":void 0)!=="production")&&window.__REDUX_DEVTOOLS_EXTENSION__}catch{}if(!p)return e(s,o,l);const{connection:g,...v}=kT(f,p,m);let y=!0;l.setState=((N,_,E)=>{const M=s(N,_);if(!y)return M;const j=E===void 0?{type:d||MT(new Error().stack)||"anonymous"}:typeof E=="string"?{type:E}:E;return f===void 0?(g?.send(j,o()),M):(g?.send({...j,type:`${f}/${j.type}`},{...Zc(m.name),[f]:l.getState()}),M)}),l.devtools={cleanup:()=>{g&&typeof g.unsubscribe=="function"&&g.unsubscribe(),AT(m.name,f)}};const b=(...N)=>{const _=y;y=!1,s(...N),y=_},S=e(l.setState,o,l);if(v.type==="untracked"?g?.init(S):(v.stores[v.store]=l,g?.init(Object.fromEntries(Object.entries(v.stores).map(([N,_])=>[N,N===v.store?S:_.getState()])))),l.dispatchFromDevtools&&typeof l.dispatch=="function"){let N=!1;const _=l.dispatch;l.dispatch=(...E)=>{(zv?"production":void 0)!=="production"&&E[0].type==="__setState"&&!N&&(console.warn('[zustand devtools middleware] "__setState" action type is reserved to set state from the devtools. Avoid using it.'),N=!0),_(...E)}}return g.subscribe(N=>{var _;switch(N.type){case"ACTION":if(typeof N.payload!="string"){console.error("[zustand devtools middleware] Unsupported action format");return}return oh(N.payload,E=>{if(E.type==="__setState"){if(f===void 0){b(E.state);return}Object.keys(E.state).length!==1&&console.error(`
                    [zustand devtools middleware] Unsupported __setState action format.
                    When using 'store' option in devtools(), the 'state' should have only one key, which is a value of 'store' that was passed in devtools(),
                    and value of this only key should be a state object. Example: { "type": "__setState", "state": { "abc123Store": { "foo": "bar" } } }
                    `);const M=E.state[f];if(M==null)return;JSON.stringify(l.getState())!==JSON.stringify(M)&&b(M);return}l.dispatchFromDevtools&&typeof l.dispatch=="function"&&l.dispatch(E)});case"DISPATCH":switch(N.payload.type){case"RESET":return b(S),f===void 0?g?.init(l.getState()):g?.init(Zc(m.name));case"COMMIT":if(f===void 0){g?.init(l.getState());return}return g?.init(Zc(m.name));case"ROLLBACK":return oh(N.state,E=>{if(f===void 0){b(E),g?.init(l.getState());return}b(E[f]),g?.init(Zc(m.name))});case"JUMP_TO_STATE":case"JUMP_TO_ACTION":return oh(N.state,E=>{if(f===void 0){b(E);return}JSON.stringify(l.getState())!==JSON.stringify(E[f])&&b(E[f])});case"IMPORT_STATE":{const{nextLiftedState:E}=N.payload,M=(_=E.computedStates.slice(-1)[0])==null?void 0:_.state;if(!M)return;b(f===void 0?M:M[f]),g?.send(null,E);return}case"PAUSE_RECORDING":return y=!y}return}}),S},RT=TT,oh=(e,n)=>{let s;try{s=JSON.parse(e)}catch(o){console.error("[zustand devtools middleware] Could not parse the received json",o)}s!==void 0&&n(s)};function DT(e,n){let s;try{s=e()}catch{return}return{getItem:l=>{var c;const d=m=>m===null?null:JSON.parse(m,void 0),f=(c=s.getItem(l))!=null?c:null;return f instanceof Promise?f.then(d):d(f)},setItem:(l,c)=>s.setItem(l,JSON.stringify(c,void 0)),removeItem:l=>s.removeItem(l)}}const Hh=e=>n=>{try{const s=e(n);return s instanceof Promise?s:{then(o){return Hh(o)(s)},catch(o){return this}}}catch(s){return{then(o){return this},catch(o){return Hh(o)(s)}}}},OT=(e,n)=>(s,o,l)=>{let c={storage:DT(()=>localStorage),partialize:N=>N,version:0,merge:(N,_)=>({..._,...N}),...n},d=!1;const f=new Set,m=new Set;let p=c.storage;if(!p)return e((...N)=>{console.warn(`[zustand persist middleware] Unable to update item '${c.name}', the given storage is currently unavailable.`),s(...N)},o,l);const g=()=>{const N=c.partialize({...o()});return p.setItem(c.name,{state:N,version:c.version})},v=l.setState;l.setState=(N,_)=>(v(N,_),g());const y=e((...N)=>(s(...N),g()),o,l);l.getInitialState=()=>y;let b;const S=()=>{var N,_;if(!p)return;d=!1,f.forEach(M=>{var j;return M((j=o())!=null?j:y)});const E=((_=c.onRehydrateStorage)==null?void 0:_.call(c,(N=o())!=null?N:y))||void 0;return Hh(p.getItem.bind(p))(c.name).then(M=>{if(M)if(typeof M.version=="number"&&M.version!==c.version){if(c.migrate){const j=c.migrate(M.state,M.version);return j instanceof Promise?j.then(k=>[!0,k]):[!0,j]}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 j;const[k,R]=M;if(b=c.merge(R,(j=o())!=null?j:y),s(b,!0),k)return g()}).then(()=>{E?.(b,void 0),b=o(),d=!0,m.forEach(M=>M(b))}).catch(M=>{E?.(void 0,M)})};return l.persist={setOptions:N=>{c={...c,...N},N.storage&&(p=N.storage)},clearStorage:()=>{p?.removeItem(c.name)},getOptions:()=>c,rehydrate:()=>S(),hasHydrated:()=>d,onHydrate:N=>(f.add(N),()=>{f.delete(N)}),onFinishHydration:N=>(m.add(N),()=>{m.delete(N)})},c.skipHydration||S(),b||y},zT=OT,pe=CT()(RT(zT(e=>({agents:[],workflows:[],entities:[],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:[],currentSession:void 0,availableSessions:[],sessionCheckpoints:[],loadingSessions:!1,loadingCheckpoints:!1,showDebugPanel:!0,debugPanelMinimized:!1,debugPanelWidth:320,debugEvents:[],isResizing:!1,showAboutModal:!1,showGallery:!1,showDeployModal:!1,showEntityNotFoundToast:!1,toasts:[],oaiMode:{enabled:!1,model:"gpt-4o-mini"},uiMode:"developer",runtime:"python",serverCapabilities:{tracing:!1,openai_proxy:!1,deployment:!1},authRequired:!1,isDeploying:!1,deploymentLogs:[],lastDeployment:null,azureDeploymentEnabled:!1,setAgents:n=>e({agents:n}),setWorkflows:n=>e({workflows:n}),setEntities:n=>e({entities:n}),setSelectedAgent:n=>e({selectedAgent:n}),addAgent:n=>e(s=>({agents:[...s.agents,n]})),addWorkflow:n=>e(s=>({workflows:[...s.workflows,n]})),updateAgent:n=>e(s=>({agents:s.agents.map(o=>o.id===n.id?n:o),selectedAgent:s.selectedAgent?.id===n.id&&s.selectedAgent.type==="agent"?n:s.selectedAgent})),updateWorkflow:n=>e(s=>({workflows:s.workflows.map(o=>o.id===n.id?n:o),selectedAgent:s.selectedAgent?.id===n.id&&s.selectedAgent.type==="workflow"?n:s.selectedAgent})),removeEntity:n=>e(s=>({agents:s.agents.filter(o=>o.id!==n),workflows:s.workflows.filter(o=>o.id!==n),selectedAgent:s.selectedAgent?.id===n?void 0:s.selectedAgent})),setEntityError:n=>e({entityError:n}),setIsLoadingEntities:n=>e({isLoadingEntities:n}),setCurrentConversation:n=>e({currentConversation:n}),setAvailableConversations:n=>e({availableConversations:n}),setChatItems:n=>e({chatItems:n}),setIsStreaming:n=>e({isStreaming:n}),setIsSubmitting:n=>e({isSubmitting:n}),setLoadingConversations:n=>e({loadingConversations:n}),setInputValue:n=>e({inputValue:n}),setAttachments:n=>e({attachments:n}),updateConversationUsage:n=>e(s=>({conversationUsage:{total_tokens:s.conversationUsage.total_tokens+n,message_count:s.conversationUsage.message_count+1}})),setPendingApprovals:n=>e({pendingApprovals:n}),setCurrentSession:n=>e({currentSession:n}),setAvailableSessions:n=>e({availableSessions:n}),setSessionCheckpoints:n=>e({sessionCheckpoints:n}),setLoadingSessions:n=>e({loadingSessions:n}),setLoadingCheckpoints:n=>e({loadingCheckpoints:n}),addSession:n=>e(s=>({availableSessions:[n,...s.availableSessions]})),removeSession:n=>e(s=>({availableSessions:s.availableSessions.filter(o=>o.conversation_id!==n),currentSession:s.currentSession?.conversation_id===n?void 0:s.currentSession,sessionCheckpoints:s.currentSession?.conversation_id===n?[]:s.sessionCheckpoints})),setShowDebugPanel:n=>e({showDebugPanel:n}),setDebugPanelMinimized:n=>e({debugPanelMinimized:n}),setDebugPanelWidth:n=>e({debugPanelWidth:n}),addDebugEvent:n=>e(s=>{const o=Math.floor(Date.now()/1e3),l=s.debugEvents.length>0&&s.debugEvents[s.debugEvents.length-1]._uiTimestamp||0,c=Math.max(o,l+1);return{debugEvents:[...s.debugEvents,{...n,_uiTimestamp:"created_at"in n&&n.created_at?n.created_at:c}]}}),clearDebugEvents:()=>e({debugEvents:[]}),setIsResizing:n=>e({isResizing:n}),setShowAboutModal:n=>e({showAboutModal:n}),setShowGallery:n=>e({showGallery:n}),setShowDeployModal:n=>e({showDeployModal:n}),setShowEntityNotFoundToast:n=>e({showEntityNotFoundToast:n}),addToast:n=>e(s=>({toasts:[...s.toasts,{id:`toast-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,type:n.type||"info",duration:n.duration||4e3,...n}]})),removeToast:n=>e(s=>({toasts:s.toasts.filter(o=>o.id!==n)})),setOAIMode:n=>e(s=>n.enabled&&!s.oaiMode.enabled?(Object.keys(localStorage).forEach(o=>{o.startsWith("devui_convs_")&&localStorage.removeItem(o)}),{oaiMode:n,currentConversation:void 0,availableConversations:[],chatItems:[],inputValue:"",attachments:[],conversationUsage:{total_tokens:0,message_count:0},isStreaming:!1,isSubmitting:!1,pendingApprovals:[],debugEvents:[]}):!n.enabled&&s.oaiMode.enabled?(Object.keys(localStorage).forEach(o=>{o.startsWith("devui_convs_")&&localStorage.removeItem(o)}),{oaiMode:n,currentConversation:void 0,availableConversations:[],chatItems:[],inputValue:"",attachments:[],conversationUsage:{total_tokens:0,message_count:0},isStreaming:!1,isSubmitting:!1,pendingApprovals:[],debugEvents:[]}):{oaiMode:n}),toggleOAIMode:()=>e(n=>{const s=!n.oaiMode.enabled;return{oaiMode:{...n.oaiMode,enabled:s},currentConversation:void 0,availableConversations:[],chatItems:[],inputValue:"",attachments:[],conversationUsage:{total_tokens:0,message_count:0},isStreaming:!1,isSubmitting:!1,pendingApprovals:[],debugEvents:[]}}),setServerMeta:n=>e({uiMode:n.uiMode,runtime:n.runtime,serverCapabilities:n.capabilities,authRequired:n.authRequired}),startDeployment:()=>e({isDeploying:!0,deploymentLogs:[],lastDeployment:null}),addDeploymentLog:n=>e(s=>({deploymentLogs:[...s.deploymentLogs,n]})),setDeploymentResult:n=>e({isDeploying:!1,lastDeployment:n}),stopDeployment:()=>e({isDeploying:!1}),clearDeploymentState:()=>e({isDeploying:!1,deploymentLogs:[],lastDeployment:null}),setAzureDeploymentEnabled:n=>e({azureDeploymentEnabled:n}),selectEntity:n=>{e({selectedAgent:n,currentConversation:void 0,availableConversations:[],chatItems:[],inputValue:"",attachments:[],conversationUsage:{total_tokens:0,message_count:0},isStreaming:!1,isSubmitting:!1,pendingApprovals:[],currentSession:void 0,availableSessions:[],sessionCheckpoints:[],debugEvents:[]});const s=new URL(window.location.href);s.searchParams.set("entity_id",n.id),window.history.pushState({},"",s)}}),{name:"devui-storage",partialize:e=>({showDebugPanel:e.showDebugPanel,debugPanelMinimized:e.debugPanelMinimized,debugPanelWidth:e.debugPanelWidth,oaiMode:e.oaiMode,azureDeploymentEnabled:e.azureDeploymentEnabled})}),{name:"DevUI Store"})),$h=Object.freeze(Object.defineProperty({__proto__:null,useDevUIStore:pe},Symbol.toStringTag,{value:"Module"}));function Iv({agents:e,workflows:n,entities:s,selectedItem:o,onSelect:l,onBrowseGallery:c,isLoading:d=!1,onSettingsClick:f}){const{oaiMode:m}=pe();return a.jsxs("header",{className:"flex h-14 items-center gap-4 border-b px-4",children:[a.jsxs("div",{className:"flex items-center gap-2 font-semibold",children:[a.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:[a.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)"}),a.jsx("defs",{children:a.jsxs("linearGradient",{id:"paint0_linear_510_1294",x1:"255.628",y1:"-34.3245",x2:"618.483",y2:"632.032",gradientUnits:"userSpaceOnUse",children:[a.jsx("stop",{stopColor:"#D59FFF"}),a.jsx("stop",{offset:"1",stopColor:"#8562C5"})]})})]}),"Dev UI",m.enabled&&a.jsxs(Qt,{variant:"secondary",className:"gap-1 ml-2",children:[a.jsx(Hp,{className:"h-3 w-3"}),"OpenAI: ",m.model]})]}),!m.enabled&&a.jsx(dT,{agents:e,workflows:n,entities:s,selectedItem:o,onSelect:l,onBrowseGallery:c,isLoading:d}),a.jsx("div",{className:"flex-1"}),a.jsxs("div",{className:"flex items-center gap-2 ml-auto",children:[a.jsx(NT,{}),a.jsx(Oe,{variant:"ghost",size:"sm",onClick:p=>{p.stopPropagation(),f?.()},children:a.jsx(Lh,{className:"h-4 w-4"})})]})]})}function Bh(e,[n,s]){return Math.min(s,Math.max(n,e))}function IT(e,n){return w.useReducer((s,o)=>n[s][o]??s,e)}var qp="ScrollArea",[Y1,SI]=ir(qp),[LT,Tn]=Y1(qp),G1=w.forwardRef((e,n)=>{const{__scopeScrollArea:s,type:o="hover",dir:l,scrollHideDelay:c=600,...d}=e,[f,m]=w.useState(null),[p,g]=w.useState(null),[v,y]=w.useState(null),[b,S]=w.useState(null),[N,_]=w.useState(null),[E,M]=w.useState(0),[j,k]=w.useState(0),[R,D]=w.useState(!1),[z,H]=w.useState(!1),U=nt(n,K=>m(K)),F=ml(l);return a.jsx(LT,{scope:s,type:o,dir:F,scrollHideDelay:c,scrollArea:f,viewport:p,onViewportChange:g,content:v,onContentChange:y,scrollbarX:b,onScrollbarXChange:S,scrollbarXEnabled:R,onScrollbarXEnabledChange:D,scrollbarY:N,onScrollbarYChange:_,scrollbarYEnabled:z,onScrollbarYEnabledChange:H,onCornerWidthChange:M,onCornerHeightChange:k,children:a.jsx(Pe.div,{dir:F,...d,ref:U,style:{position:"relative","--radix-scroll-area-corner-width":E+"px","--radix-scroll-area-corner-height":j+"px",...e.style}})})});G1.displayName=qp;var X1="ScrollAreaViewport",Z1=w.forwardRef((e,n)=>{const{__scopeScrollArea:s,children:o,nonce:l,...c}=e,d=Tn(X1,s),f=w.useRef(null),m=nt(n,f,d.onViewportChange);return a.jsxs(a.Fragment,{children:[a.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}),a.jsx(Pe.div,{"data-radix-scroll-area-viewport":"",...c,ref:m,style:{overflowX:d.scrollbarXEnabled?"scroll":"hidden",overflowY:d.scrollbarYEnabled?"scroll":"hidden",...e.style},children:a.jsx("div",{ref:d.onContentChange,style:{minWidth:"100%",display:"table"},children:o})})]})});Z1.displayName=X1;var cr="ScrollAreaScrollbar",Fp=w.forwardRef((e,n)=>{const{forceMount:s,...o}=e,l=Tn(cr,e.__scopeScrollArea),{onScrollbarXEnabledChange:c,onScrollbarYEnabledChange:d}=l,f=e.orientation==="horizontal";return w.useEffect(()=>(f?c(!0):d(!0),()=>{f?c(!1):d(!1)}),[f,c,d]),l.type==="hover"?a.jsx(HT,{...o,ref:n,forceMount:s}):l.type==="scroll"?a.jsx($T,{...o,ref:n,forceMount:s}):l.type==="auto"?a.jsx(W1,{...o,ref:n,forceMount:s}):l.type==="always"?a.jsx(Yp,{...o,ref:n}):null});Fp.displayName=cr;var HT=w.forwardRef((e,n)=>{const{forceMount:s,...o}=e,l=Tn(cr,e.__scopeScrollArea),[c,d]=w.useState(!1);return w.useEffect(()=>{const f=l.scrollArea;let m=0;if(f){const p=()=>{window.clearTimeout(m),d(!0)},g=()=>{m=window.setTimeout(()=>d(!1),l.scrollHideDelay)};return f.addEventListener("pointerenter",p),f.addEventListener("pointerleave",g),()=>{window.clearTimeout(m),f.removeEventListener("pointerenter",p),f.removeEventListener("pointerleave",g)}}},[l.scrollArea,l.scrollHideDelay]),a.jsx(Vn,{present:s||c,children:a.jsx(W1,{"data-state":c?"visible":"hidden",...o,ref:n})})}),$T=w.forwardRef((e,n)=>{const{forceMount:s,...o}=e,l=Tn(cr,e.__scopeScrollArea),c=e.orientation==="horizontal",d=sd(()=>m("SCROLL_END"),100),[f,m]=IT("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 w.useEffect(()=>{if(f==="idle"){const p=window.setTimeout(()=>m("HIDE"),l.scrollHideDelay);return()=>window.clearTimeout(p)}},[f,l.scrollHideDelay,m]),w.useEffect(()=>{const p=l.viewport,g=c?"scrollLeft":"scrollTop";if(p){let v=p[g];const y=()=>{const b=p[g];v!==b&&(m("SCROLL"),d()),v=b};return p.addEventListener("scroll",y),()=>p.removeEventListener("scroll",y)}},[l.viewport,c,m,d]),a.jsx(Vn,{present:s||f!=="hidden",children:a.jsx(Yp,{"data-state":f==="hidden"?"hidden":"visible",...o,ref:n,onPointerEnter:Te(e.onPointerEnter,()=>m("POINTER_ENTER")),onPointerLeave:Te(e.onPointerLeave,()=>m("POINTER_LEAVE"))})})}),W1=w.forwardRef((e,n)=>{const s=Tn(cr,e.__scopeScrollArea),{forceMount:o,...l}=e,[c,d]=w.useState(!1),f=e.orientation==="horizontal",m=sd(()=>{if(s.viewport){const p=s.viewport.offsetWidth<s.viewport.scrollWidth,g=s.viewport.offsetHeight<s.viewport.scrollHeight;d(f?p:g)}},10);return ma(s.viewport,m),ma(s.content,m),a.jsx(Vn,{present:o||c,children:a.jsx(Yp,{"data-state":c?"visible":"hidden",...l,ref:n})})}),Yp=w.forwardRef((e,n)=>{const{orientation:s="vertical",...o}=e,l=Tn(cr,e.__scopeScrollArea),c=w.useRef(null),d=w.useRef(0),[f,m]=w.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),p=t2(f.viewport,f.content),g={...o,sizes:f,onSizesChange:m,hasThumb:p>0&&p<1,onThumbChange:y=>c.current=y,onThumbPointerUp:()=>d.current=0,onThumbPointerDown:y=>d.current=y};function v(y,b){return FT(y,d.current,f,b)}return s==="horizontal"?a.jsx(BT,{...g,ref:n,onThumbPositionChange:()=>{if(l.viewport&&c.current){const y=l.viewport.scrollLeft,b=Lv(y,f,l.dir);c.current.style.transform=`translate3d(${b}px, 0, 0)`}},onWheelScroll:y=>{l.viewport&&(l.viewport.scrollLeft=y)},onDragScroll:y=>{l.viewport&&(l.viewport.scrollLeft=v(y,l.dir))}}):s==="vertical"?a.jsx(PT,{...g,ref:n,onThumbPositionChange:()=>{if(l.viewport&&c.current){const y=l.viewport.scrollTop,b=Lv(y,f);c.current.style.transform=`translate3d(0, ${b}px, 0)`}},onWheelScroll:y=>{l.viewport&&(l.viewport.scrollTop=y)},onDragScroll:y=>{l.viewport&&(l.viewport.scrollTop=v(y))}}):null}),BT=w.forwardRef((e,n)=>{const{sizes:s,onSizesChange:o,...l}=e,c=Tn(cr,e.__scopeScrollArea),[d,f]=w.useState(),m=w.useRef(null),p=nt(n,m,c.onScrollbarXChange);return w.useEffect(()=>{m.current&&f(getComputedStyle(m.current))},[m]),a.jsx(Q1,{"data-orientation":"horizontal",...l,ref:p,sizes:s,style:{bottom:0,left:c.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:c.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":rd(s)+"px",...e.style},onThumbPointerDown:g=>e.onThumbPointerDown(g.x),onDragScroll:g=>e.onDragScroll(g.x),onWheelScroll:(g,v)=>{if(c.viewport){const y=c.viewport.scrollLeft+g.deltaX;e.onWheelScroll(y),r2(y,v)&&g.preventDefault()}},onResize:()=>{m.current&&c.viewport&&d&&o({content:c.viewport.scrollWidth,viewport:c.viewport.offsetWidth,scrollbar:{size:m.current.clientWidth,paddingStart:Mu(d.paddingLeft),paddingEnd:Mu(d.paddingRight)}})}})}),PT=w.forwardRef((e,n)=>{const{sizes:s,onSizesChange:o,...l}=e,c=Tn(cr,e.__scopeScrollArea),[d,f]=w.useState(),m=w.useRef(null),p=nt(n,m,c.onScrollbarYChange);return w.useEffect(()=>{m.current&&f(getComputedStyle(m.current))},[m]),a.jsx(Q1,{"data-orientation":"vertical",...l,ref:p,sizes:s,style:{top:0,right:c.dir==="ltr"?0:void 0,left:c.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":rd(s)+"px",...e.style},onThumbPointerDown:g=>e.onThumbPointerDown(g.y),onDragScroll:g=>e.onDragScroll(g.y),onWheelScroll:(g,v)=>{if(c.viewport){const y=c.viewport.scrollTop+g.deltaY;e.onWheelScroll(y),r2(y,v)&&g.preventDefault()}},onResize:()=>{m.current&&c.viewport&&d&&o({content:c.viewport.scrollHeight,viewport:c.viewport.offsetHeight,scrollbar:{size:m.current.clientHeight,paddingStart:Mu(d.paddingTop),paddingEnd:Mu(d.paddingBottom)}})}})}),[UT,K1]=Y1(cr),Q1=w.forwardRef((e,n)=>{const{__scopeScrollArea:s,sizes:o,hasThumb:l,onThumbChange:c,onThumbPointerUp:d,onThumbPointerDown:f,onThumbPositionChange:m,onDragScroll:p,onWheelScroll:g,onResize:v,...y}=e,b=Tn(cr,s),[S,N]=w.useState(null),_=nt(n,U=>N(U)),E=w.useRef(null),M=w.useRef(""),j=b.viewport,k=o.content-o.viewport,R=Bt(g),D=Bt(m),z=sd(v,10);function H(U){if(E.current){const F=U.clientX-E.current.left,K=U.clientY-E.current.top;p({x:F,y:K})}}return w.useEffect(()=>{const U=F=>{const K=F.target;S?.contains(K)&&R(F,k)};return document.addEventListener("wheel",U,{passive:!1}),()=>document.removeEventListener("wheel",U,{passive:!1})},[j,S,k,R]),w.useEffect(D,[o,D]),ma(S,z),ma(b.content,z),a.jsx(UT,{scope:s,scrollbar:S,hasThumb:l,onThumbChange:Bt(c),onThumbPointerUp:Bt(d),onThumbPositionChange:D,onThumbPointerDown:Bt(f),children:a.jsx(Pe.div,{...y,ref:_,style:{position:"absolute",...y.style},onPointerDown:Te(e.onPointerDown,U=>{U.button===0&&(U.target.setPointerCapture(U.pointerId),E.current=S.getBoundingClientRect(),M.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",b.viewport&&(b.viewport.style.scrollBehavior="auto"),H(U))}),onPointerMove:Te(e.onPointerMove,H),onPointerUp:Te(e.onPointerUp,U=>{const F=U.target;F.hasPointerCapture(U.pointerId)&&F.releasePointerCapture(U.pointerId),document.body.style.webkitUserSelect=M.current,b.viewport&&(b.viewport.style.scrollBehavior=""),E.current=null})})})}),Au="ScrollAreaThumb",J1=w.forwardRef((e,n)=>{const{forceMount:s,...o}=e,l=K1(Au,e.__scopeScrollArea);return a.jsx(Vn,{present:s||l.hasThumb,children:a.jsx(VT,{ref:n,...o})})}),VT=w.forwardRef((e,n)=>{const{__scopeScrollArea:s,style:o,...l}=e,c=Tn(Au,s),d=K1(Au,s),{onThumbPositionChange:f}=d,m=nt(n,v=>d.onThumbChange(v)),p=w.useRef(void 0),g=sd(()=>{p.current&&(p.current(),p.current=void 0)},100);return w.useEffect(()=>{const v=c.viewport;if(v){const y=()=>{if(g(),!p.current){const b=YT(v,f);p.current=b,f()}};return f(),v.addEventListener("scroll",y),()=>v.removeEventListener("scroll",y)}},[c.viewport,g,f]),a.jsx(Pe.div,{"data-state":d.hasThumb?"visible":"hidden",...l,ref:m,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...o},onPointerDownCapture:Te(e.onPointerDownCapture,v=>{const b=v.target.getBoundingClientRect(),S=v.clientX-b.left,N=v.clientY-b.top;d.onThumbPointerDown({x:S,y:N})}),onPointerUp:Te(e.onPointerUp,d.onThumbPointerUp)})});J1.displayName=Au;var Gp="ScrollAreaCorner",e2=w.forwardRef((e,n)=>{const s=Tn(Gp,e.__scopeScrollArea),o=!!(s.scrollbarX&&s.scrollbarY);return s.type!=="scroll"&&o?a.jsx(qT,{...e,ref:n}):null});e2.displayName=Gp;var qT=w.forwardRef((e,n)=>{const{__scopeScrollArea:s,...o}=e,l=Tn(Gp,s),[c,d]=w.useState(0),[f,m]=w.useState(0),p=!!(c&&f);return ma(l.scrollbarX,()=>{const g=l.scrollbarX?.offsetHeight||0;l.onCornerHeightChange(g),m(g)}),ma(l.scrollbarY,()=>{const g=l.scrollbarY?.offsetWidth||0;l.onCornerWidthChange(g),d(g)}),p?a.jsx(Pe.div,{...o,ref:n,style:{width:c,height:f,position:"absolute",right:l.dir==="ltr"?0:void 0,left:l.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function Mu(e){return e?parseInt(e,10):0}function t2(e,n){const s=e/n;return isNaN(s)?0:s}function rd(e){const n=t2(e.viewport,e.content),s=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,o=(e.scrollbar.size-s)*n;return Math.max(o,18)}function FT(e,n,s,o="ltr"){const l=rd(s),c=l/2,d=n||c,f=l-d,m=s.scrollbar.paddingStart+d,p=s.scrollbar.size-s.scrollbar.paddingEnd-f,g=s.content-s.viewport,v=o==="ltr"?[0,g]:[g*-1,0];return n2([m,p],v)(e)}function Lv(e,n,s="ltr"){const o=rd(n),l=n.scrollbar.paddingStart+n.scrollbar.paddingEnd,c=n.scrollbar.size-l,d=n.content-n.viewport,f=c-o,m=s==="ltr"?[0,d]:[d*-1,0],p=Bh(e,m);return n2([0,d],[0,f])(p)}function n2(e,n){return s=>{if(e[0]===e[1]||n[0]===n[1])return n[0];const o=(n[1]-n[0])/(e[1]-e[0]);return n[0]+o*(s-e[0])}}function r2(e,n){return e>0&&e<n}var YT=(e,n=()=>{})=>{let s={left:e.scrollLeft,top:e.scrollTop},o=0;return(function l(){const c={left:e.scrollLeft,top:e.scrollTop},d=s.left!==c.left,f=s.top!==c.top;(d||f)&&n(),s=c,o=window.requestAnimationFrame(l)})(),()=>window.cancelAnimationFrame(o)};function sd(e,n){const s=Bt(e),o=w.useRef(0);return w.useEffect(()=>()=>window.clearTimeout(o.current),[]),w.useCallback(()=>{window.clearTimeout(o.current),o.current=window.setTimeout(s,n)},[s,n])}function ma(e,n){const s=Bt(n);Pt(()=>{let o=0;if(e){const l=new ResizeObserver(()=>{cancelAnimationFrame(o),o=window.requestAnimationFrame(s)});return l.observe(e),()=>{window.cancelAnimationFrame(o),l.unobserve(e)}}},[e,s])}var s2=G1,GT=Z1,XT=e2;const Ss=w.forwardRef(({className:e,children:n,...s},o)=>a.jsxs(s2,{ref:o,className:Ge("relative overflow-hidden",e),...s,children:[a.jsx(GT,{className:"h-full w-full rounded-[inherit]",children:n}),a.jsx(o2,{}),a.jsx(XT,{})]}));Ss.displayName=s2.displayName;const o2=w.forwardRef(({className:e,orientation:n="vertical",...s},o)=>a.jsx(Fp,{ref:o,orientation:n,className:Ge("flex touch-none select-none transition-colors",n==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",n==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...s,children:a.jsx(J1,{className:"relative flex-1 rounded-full bg-border"})}));o2.displayName=Fp.displayName;var od="Tabs",[ZT,jI]=ir(od,[Wu]),a2=Wu(),[WT,Xp]=ZT(od),i2=w.forwardRef((e,n)=>{const{__scopeTabs:s,value:o,onValueChange:l,defaultValue:c,orientation:d="horizontal",dir:f,activationMode:m="automatic",...p}=e,g=ml(f),[v,y]=so({prop:o,onChange:l,defaultProp:c??"",caller:od});return a.jsx(WT,{scope:s,baseId:oo(),value:v,onValueChange:y,orientation:d,dir:g,activationMode:m,children:a.jsx(Pe.div,{dir:g,"data-orientation":d,...p,ref:n})})});i2.displayName=od;var l2="TabsList",c2=w.forwardRef((e,n)=>{const{__scopeTabs:s,loop:o=!0,...l}=e,c=Xp(l2,s),d=a2(s);return a.jsx(Fw,{asChild:!0,...d,orientation:c.orientation,dir:c.dir,loop:o,children:a.jsx(Pe.div,{role:"tablist","aria-orientation":c.orientation,...l,ref:n})})});c2.displayName=l2;var u2="TabsTrigger",d2=w.forwardRef((e,n)=>{const{__scopeTabs:s,value:o,disabled:l=!1,...c}=e,d=Xp(u2,s),f=a2(s),m=h2(d.baseId,o),p=p2(d.baseId,o),g=o===d.value;return a.jsx(Yw,{asChild:!0,...f,focusable:!l,active:g,children:a.jsx(Pe.button,{type:"button",role:"tab","aria-selected":g,"aria-controls":p,"data-state":g?"active":"inactive","data-disabled":l?"":void 0,disabled:l,id:m,...c,ref:n,onMouseDown:Te(e.onMouseDown,v=>{!l&&v.button===0&&v.ctrlKey===!1?d.onValueChange(o):v.preventDefault()}),onKeyDown:Te(e.onKeyDown,v=>{[" ","Enter"].includes(v.key)&&d.onValueChange(o)}),onFocus:Te(e.onFocus,()=>{const v=d.activationMode!=="manual";!g&&!l&&v&&d.onValueChange(o)})})})});d2.displayName=u2;var f2="TabsContent",m2=w.forwardRef((e,n)=>{const{__scopeTabs:s,value:o,forceMount:l,children:c,...d}=e,f=Xp(f2,s),m=h2(f.baseId,o),p=p2(f.baseId,o),g=o===f.value,v=w.useRef(g);return w.useEffect(()=>{const y=requestAnimationFrame(()=>v.current=!1);return()=>cancelAnimationFrame(y)},[]),a.jsx(Vn,{present:l||g,children:({present:y})=>a.jsx(Pe.div,{"data-state":g?"active":"inactive","data-orientation":f.orientation,role:"tabpanel","aria-labelledby":m,hidden:!y,id:p,tabIndex:0,...d,ref:n,style:{...e.style,animationDuration:v.current?"0s":void 0},children:y&&c})})});m2.displayName=f2;function h2(e,n){return`${e}-trigger-${n}`}function p2(e,n){return`${e}-content-${n}`}var KT=i2,g2=c2,x2=d2,y2=m2;const QT=KT,v2=w.forwardRef(({className:e,...n},s)=>a.jsx(g2,{ref:s,className:Ge("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",e),...n}));v2.displayName=g2.displayName;const du=w.forwardRef(({className:e,...n},s)=>a.jsx(x2,{ref:s,className:Ge("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),...n}));du.displayName=x2.displayName;const fu=w.forwardRef(({className:e,...n},s)=>a.jsx(y2,{ref:s,className:Ge("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...n}));fu.displayName=y2.displayName;function Zp(){return a.jsx("div",{className:"flex items-center gap-2 py-3 px-2",children:a.jsx("div",{className:"flex-1 border-t border-border/50"})})}function Wp(e){const n=[];let s=!1;for(let o=0;o<e.length;o++){const l=e[o];s&&l.type!=="response.done"&&(n.push({type:"separator",id:`sep-${o}`}),s=!1),n.push(l),(l.type==="response.done"||l.type==="response.completed")&&(s=!0)}return n}function io(e){if(e.type==="response.function_result.complete"){const n=e;return{call_id:n.call_id,output:n.output,status:n.status}}return null}function b2(e){const n=[],s=new Map,o=new Map;let l="";for(const c of e){if(c.type==="response.trace.completed"||c.type==="response.trace.completed")continue;if(c.type==="response.output_item.added"){const m=c.item;if(m.type==="function_call"&&m.call_id&&m.name){const p=m.call_id;s.set(p,{name:m.name,arguments:"",callId:p,itemId:m.id,timestamp:new Date().toISOString()}),o.set(p,m.name)}n.push(c);continue}const d=io(c)!==null;if(c.type==="response.completed"||c.type==="response.done"||c.type==="error"||c.type==="response.workflow_event.completed"||c.type==="response.trace.completed"||c.type==="response.trace.completed"||d){if(l.trim()&&(n.push({type:"response.output_text.delta",delta:l.trim()}),l=""),(c.type==="response.trace.completed"||c.type==="response.trace.completed")&&"data"in c){const m=c.data;if(m.attributes&&m.attributes["gen_ai.output.messages"]&&typeof m.attributes["gen_ai.output.messages"]=="string")try{const p=JSON.parse(m.attributes["gen_ai.output.messages"]);for(const g of p)if(g.parts)for(const v of g.parts)v.type==="tool_call"&&v.name&&v.id&&o.set(v.id,v.name)}catch{}}const f=io(c);if(f){const m=f.call_id;if(m&&s.has(m)){const p=s.get(m),g=o.get(m)||p.name||"unknown";n.push({type:"response.function_call.complete",data:{name:g,arguments:p.arguments,call_id:p.callId}}),s.delete(m)}}n.push(c);continue}if(c.type==="response.function_call.delta"&&"data"in c){const f=c.data,m=f.call_id||`call_${Date.now()}`;s.has(m)||s.set(m,{name:f.name||void 0,arguments:"",callId:m,timestamp:new Date().toISOString()}),f.name&&f.name.trim()&&(s.get(m).name=f.name.trim());continue}if(c.type==="response.function_call.complete"&&"data"in c){n.push(c);continue}if(c.type==="response.function_call_arguments.delta"){let f="",m=null;if("delta"in c&&typeof c.delta=="string"&&(f=c.delta),"item_id"in c&&c.item_id){const p=c.item_id;for(const[g,v]of s.entries())if(v.itemId===p||g===p){m=g;break}}if(f&&m){const p=s.get(m);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 c?c.item_id:"unknown"}`)}continue}if(c.type==="response.output_text.delta"&&"delta"in c){l+=c.delta||"",l.length>100&&(l.includes(`

`)||l.trim().match(/[.!?]\s*$/))&&(n.push({type:"response.output_text.delta",delta:l.trim()}),l="");continue}c.type!=="response.usage.complete"&&n.push(c)}for(const[,c]of s)if(c.arguments.trim()&&c.arguments.trim().length>2){const d=o.get(c.callId)||c.name||"unknown";n.push({type:"response.function_call.complete",data:{name:d,arguments:c.arguments,call_id:c.callId}})}return l.trim()&&n.push({type:"response.output_text.delta",delta:l.trim()}),n}function JT(e){switch(e.type){case"response.output_text.delta":if("delta"in e){const n=e.delta||"";return n.length>60?`${n.slice(0,60)}...`:n}return"Text output";case"response.function_call.complete":if("data"in e&&e.data){const n=e.data;let s=n.name||"unknown";(!s||s==="unknown")&&(s="function_call");const o=n.arguments?typeof n.arguments=="string"?n.arguments.slice(0,30):JSON.stringify(n.arguments).slice(0,30):"";return`Calling ${s}(${o}${o.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 s=e.output.slice(0,40);return`Function result: ${s}${s.length>=40?"...":""}`}case"response.output_item.added":{const n=e;return n.item.type==="function_call"?`Tool call: ${n.item.name}`:"Output item added"}case"response.workflow_event.completed":return"data"in e&&e.data?`Executor: ${e.data.executor_id||"unknown"}`:"Workflow event";case"response.trace.completed":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 s=e.response.usage;if(s)return`Response complete (${s.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 e5(e){switch(e){case"response.output_text.delta":return P1;case"response.function_call.complete":case"response.function_call.delta":case"response.function_call_arguments.delta":return nd;case"response.function_result.complete":return Kt;case"response.output_item.added":return Kt;case"response.workflow_event.completed":return Op;case"response.trace.completed":return Qi;case"response.completed":return Kt;case"response.done":return Kt;case"error":return yl;default:return ws}}function t5(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.completed":return"text-purple-600 dark:text-purple-400";case"response.trace.completed":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 n5({event:e}){const[n,s]=w.useState(!1),o=e.type||"unknown",l=e5(o),c=t5(o),d="_uiTimestamp"in e&&typeof e._uiTimestamp=="number"?new Date(e._uiTimestamp*1e3).toLocaleTimeString():new Date().toLocaleTimeString(),f=JT(e),m=e.type==="response.function_call.complete"&&"data"in e&&e.data||e.type==="response.function_result.complete"||e.type==="response.output_item.added"&&io(e)!==null||e.type==="response.workflow_event.completed"&&"data"in e&&e.data||e.type==="response.trace.completed"&&"data"in e&&e.data||e.type==="response.trace.completed"&&"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 a.jsxs("div",{className:"border-l-2 border-muted pl-3 py-2 hover:bg-muted/50 transition-colors",children:[a.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground mb-1",children:[a.jsx(l,{className:`h-3 w-3 ${c}`}),a.jsx("span",{className:"font-mono",children:d}),a.jsx(Qt,{variant:"outline",className:"text-xs py-0",children:e.type?e.type.replace("response.",""):"unknown"})]}),a.jsxs("div",{className:"text-sm",children:[a.jsxs("div",{className:`flex items-center gap-2 ${m?"cursor-pointer":""}`,onClick:()=>m&&s(!n),children:[m&&a.jsx("div",{className:"text-muted-foreground",children:n?a.jsx(Xt,{className:"h-3 w-3"}):a.jsx(Un,{className:"h-3 w-3"})}),a.jsx("div",{className:"text-muted-foreground flex-1",children:m&&f.length>80?`${f.slice(0,80)}...`:f})]}),n&&m&&a.jsx("div",{className:"mt-2 ml-5 p-3 bg-muted/30 rounded border",children:a.jsx(r5,{event:e})})]})]})}function r5({event:e}){if(e.type==="error"){const n=e;return a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(yl,{className:"h-4 w-4 text-red-500"}),a.jsx("span",{className:"font-semibold text-sm",children:"Error Details"})]}),a.jsxs("div",{className:"text-xs",children:[n.message&&a.jsxs("div",{className:"mb-2",children:[a.jsx("span",{className:"font-medium text-muted-foreground",children:"Message:"}),a.jsx("div",{className:"mt-1",children:a.jsx("pre",{className:"text-xs bg-destructive/10 border border-destructive/30 rounded p-2 text-destructive whitespace-pre-wrap break-all",children:n.message})})]}),n.code&&a.jsxs("div",{className:"mb-2",children:[a.jsx("span",{className:"font-medium text-muted-foreground",children:"Code:"}),a.jsx("span",{className:"ml-2 font-mono text-xs",children:n.code})]}),n.param&&a.jsxs("div",{className:"mb-2",children:[a.jsx("span",{className:"font-medium text-muted-foreground",children:"Parameter:"}),a.jsx("span",{className:"ml-2 font-mono text-xs",children:n.param})]}),a.jsxs("div",{children:[a.jsx("span",{className:"font-medium text-muted-foreground",children:"Raw Event:"}),a.jsx("div",{className:"mt-1",children:a.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 n=e.data;return a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(nd,{className:"h-4 w-4 text-blue-500"}),a.jsx("span",{className:"font-semibold text-sm",children:"Function Call"})]}),a.jsxs("div",{className:"grid grid-cols-1 gap-2 text-xs",children:[a.jsxs("div",{children:[a.jsx("span",{className:"font-medium text-muted-foreground",children:"Function:"}),a.jsx("span",{className:"ml-2 font-mono bg-blue-100 dark:bg-blue-900 px-2 py-1 rounded",children:n.name||"unknown"})]}),n.call_id&&a.jsxs("div",{children:[a.jsx("span",{className:"font-medium text-muted-foreground",children:"Call ID:"}),a.jsx("span",{className:"ml-2 font-mono text-xs",children:n.call_id})]}),n.arguments&&a.jsxs("div",{children:[a.jsx("span",{className:"font-medium text-muted-foreground",children:"Arguments:"}),a.jsx("div",{className:"mt-1 max-h-32 overflow-auto",children:a.jsx("pre",{className:"text-xs bg-background border rounded p-2 whitespace-pre-wrap max-w-full break-all",children:typeof n.arguments=="string"?n.arguments:JSON.stringify(n.arguments,null,1)})})]})]})]})}break;case"response.function_result.complete":{const n=e;return a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Kt,{className:"h-4 w-4 text-green-500"}),a.jsx("span",{className:"font-semibold text-sm",children:"Function Result"})]}),a.jsxs("div",{className:"grid grid-cols-1 gap-2 text-xs",children:[a.jsxs("div",{children:[a.jsx("span",{className:"font-medium text-muted-foreground",children:"Call ID:"}),a.jsx("span",{className:"ml-2 font-mono text-xs",children:n.call_id})]}),a.jsxs("div",{children:[a.jsx("span",{className:"font-medium text-muted-foreground",children:"Status:"}),a.jsx("span",{className:`ml-2 px-2 py-1 rounded text-xs font-medium ${n.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:n.status})]}),a.jsxs("div",{children:[a.jsx("span",{className:"font-medium text-muted-foreground",children:"Output:"}),a.jsx("div",{className:"mt-1 max-h-32 overflow-auto",children:a.jsx("pre",{className:"text-xs bg-background border rounded p-2 whitespace-pre-wrap max-w-full break-all",children:n.output})})]})]})]})}case"response.output_item.added":{const n=io(e);if(n)return a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Kt,{className:"h-4 w-4 text-green-500"}),a.jsx("span",{className:"font-semibold text-sm",children:"Function Result"})]}),a.jsxs("div",{className:"grid grid-cols-1 gap-2 text-xs",children:[a.jsxs("div",{children:[a.jsx("span",{className:"font-medium text-muted-foreground",children:"Call ID:"}),a.jsx("span",{className:"ml-2 font-mono text-xs",children:n.call_id})]}),a.jsxs("div",{children:[a.jsx("span",{className:"font-medium text-muted-foreground",children:"Status:"}),a.jsx("span",{className:`ml-2 px-2 py-1 rounded text-xs font-medium ${n.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:n.status})]}),a.jsxs("div",{children:[a.jsx("span",{className:"font-medium text-muted-foreground",children:"Output:"}),a.jsx("div",{className:"mt-1 max-h-32 overflow-auto",children:a.jsx("pre",{className:"text-xs bg-background border rounded p-2 whitespace-pre-wrap max-w-full break-all",children:n.output})})]})]})]});break}case"response.workflow_event.completed":if("data"in e&&e.data){const n=e.data;return a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Op,{className:"h-4 w-4 text-purple-500"}),a.jsx("span",{className:"font-semibold text-sm",children:"Workflow Event"})]}),a.jsxs("div",{className:"grid grid-cols-1 gap-2 text-xs",children:[a.jsxs("div",{children:[a.jsx("span",{className:"font-medium text-muted-foreground",children:"Event Type:"}),a.jsx("span",{className:"ml-2 font-mono bg-purple-100 dark:bg-purple-900 px-2 py-1 rounded",children:n.event_type||"unknown"})]}),n.executor_id&&a.jsxs("div",{children:[a.jsx("span",{className:"font-medium text-muted-foreground",children:"Executor:"}),a.jsx("span",{className:"ml-2 font-mono",children:n.executor_id})]}),n.timestamp&&a.jsxs("div",{children:[a.jsx("span",{className:"font-medium text-muted-foreground",children:"Timestamp:"}),a.jsx("span",{className:"ml-2 font-mono text-xs",children:n.timestamp})]}),n.data&&a.jsxs("div",{children:[a.jsx("span",{className:"font-medium text-muted-foreground",children:"Data:"}),a.jsx("div",{className:"mt-1 max-h-32 overflow-auto",children:a.jsx("pre",{className:"text-xs bg-background border rounded p-2 whitespace-pre-wrap max-w-full break-all",children:typeof n.data=="string"?n.data:JSON.stringify(n.data,null,1)})})]})]})]})}break;case"response.trace.completed":if("data"in e&&e.data){const n=e.data;return a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Qi,{className:"h-4 w-4 text-orange-500"}),a.jsx("span",{className:"font-semibold text-sm",children:"Trace Event"})]}),a.jsxs("div",{className:"grid grid-cols-1 gap-2 text-xs",children:[a.jsxs("div",{children:[a.jsx("span",{className:"font-medium text-muted-foreground",children:"Operation:"}),a.jsx("span",{className:"ml-2 font-mono bg-orange-100 dark:bg-orange-900 px-2 py-1 rounded",children:n.operation_name||"unknown"})]}),n.span_id&&a.jsxs("div",{children:[a.jsx("span",{className:"font-medium text-muted-foreground",children:"Span ID:"}),a.jsx("span",{className:"ml-2 font-mono text-xs",children:n.span_id})]}),n.trace_id&&a.jsxs("div",{children:[a.jsx("span",{className:"font-medium text-muted-foreground",children:"Trace ID:"}),a.jsx("span",{className:"ml-2 font-mono text-xs",children:n.trace_id})]}),n.duration_ms&&a.jsxs("div",{children:[a.jsx("span",{className:"font-medium text-muted-foreground",children:"Duration:"}),a.jsxs("span",{className:"ml-2 font-mono text-xs",children:[Number(n.duration_ms).toFixed(2),"ms"]})]}),n.status&&a.jsxs("div",{children:[a.jsx("span",{className:"font-medium text-muted-foreground",children:"Status:"}),a.jsx("span",{className:`ml-2 px-2 py-1 rounded text-xs font-medium ${n.status==="StatusCode.UNSET"||n.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:n.status||"unknown"})]}),n.entity_id&&a.jsxs("div",{children:[a.jsx("span",{className:"font-medium text-muted-foreground",children:"Entity:"}),a.jsx("span",{className:"ml-2 font-mono text-xs",children:n.entity_id})]}),n.attributes&&Object.keys(n.attributes).length>0&&a.jsxs("div",{children:[a.jsx("span",{className:"font-medium text-muted-foreground",children:"Attributes:"}),a.jsx("div",{className:"mt-1 max-h-32 overflow-auto",children:a.jsx("pre",{className:"text-xs bg-background border rounded p-2 whitespace-pre-wrap break-all",children:(()=>{try{const s={...n.attributes};return Object.keys(s).forEach(o=>{if(typeof s[o]=="string"&&s[o].startsWith("["))try{s[o]=JSON.parse(s[o])}catch{}}),JSON.stringify(s,null,2)}catch{return JSON.stringify(n.attributes,null,2)}})()})})]})]})]})}break;case"response.output_text.delta":if("delta"in e&&e.delta)return a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(P1,{className:"h-4 w-4 text-gray-500"}),a.jsx("span",{className:"font-semibold text-sm",children:"Text Output"})]}),a.jsx("div",{className:"max-h-32 overflow-auto",children:a.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 s=e.response;return a.jsx("div",{className:"space-y-2",children:a.jsxs("div",{className:"grid grid-cols-1 gap-2 text-xs",children:[s.usage&&a.jsxs(a.Fragment,{children:[a.jsx("div",{children:a.jsx("span",{className:"font-medium text-muted-foreground",children:"Usage:"})}),a.jsxs("div",{className:"ml-4 space-y-1",children:[a.jsxs("div",{children:[a.jsx("span",{className:"font-medium text-muted-foreground",children:"Input tokens:"}),a.jsx("span",{className:"ml-2 font-mono",children:s.usage.input_tokens})]}),a.jsxs("div",{children:[a.jsx("span",{className:"font-medium text-muted-foreground",children:"Output tokens:"}),a.jsx("span",{className:"ml-2 font-mono",children:s.usage.output_tokens})]}),a.jsxs("div",{children:[a.jsx("span",{className:"font-medium text-muted-foreground",children:"Total tokens:"}),a.jsx("span",{className:"ml-2 font-mono bg-green-100 dark:bg-green-900 px-2 py-1 rounded",children:s.usage.total_tokens})]})]})]}),s.id&&a.jsxs("div",{children:[a.jsx("span",{className:"font-medium text-muted-foreground",children:"Response ID:"}),a.jsx("span",{className:"ml-2 font-mono text-xs break-all",children:s.id})]}),s.model&&a.jsxs("div",{children:[a.jsx("span",{className:"font-medium text-muted-foreground",children:"Model:"}),a.jsx("span",{className:"ml-2 font-mono text-xs break-all",children:s.model})]})]})})}break;default:return a.jsx("div",{className:"text-xs text-muted-foreground",children:a.jsx("pre",{className:"bg-background border rounded p-2 overflow-auto max-h-32",children:JSON.stringify(e,null,2)})})}return null}function s5({events:e,isStreaming:n}){const s=w.useRef(null),o=b2(e),c=[...Wp(o)].reverse();return a.jsxs("div",{className:"h-full flex flex-col",children:[a.jsxs("div",{className:"flex items-center justify-between p-3 border-b",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Op,{className:"h-4 w-4"}),a.jsx("span",{className:"font-medium",children:"Events"}),a.jsxs(Qt,{variant:"outline",children:[o.length,e.length>o.length?` (${e.length} raw)`:""]})]}),n&&a.jsxs("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[a.jsx("div",{className:"h-2 w-2 animate-pulse rounded-full bg-green-500 dark:bg-green-400"}),"Streaming"]})]}),a.jsx(Ss,{ref:s,className:"flex-1",children:a.jsx("div",{className:"p-3",children:o.length===0?a.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."}):a.jsx("div",{className:"space-y-2",children:c.map((d,f)=>"type"in d&&d.type==="separator"?a.jsx(Zp,{},d.id):a.jsx(n5,{event:d},`${d.type}-${f}`))})})})]})}function o5({events:e}){const n=e.filter(l=>l.type==="response.trace.completed"||l.type==="response.trace.completed"),o=[...Wp(n)].reverse();return a.jsxs("div",{className:"h-full flex flex-col",children:[a.jsxs("div",{className:"flex items-center gap-2 p-3 border-b",children:[a.jsx(Qi,{className:"h-4 w-4"}),a.jsx("span",{className:"font-medium",children:"Traces"}),a.jsx(Qt,{variant:"outline",children:n.length})]}),a.jsx(Ss,{className:"flex-1",children:a.jsx("div",{className:"p-3",children:n.length===0?a.jsxs("div",{className:"text-center text-muted-foreground text-sm py-8",children:["No trace data available.",a.jsx("br",{}),e&&e.length>0&&a.jsxs("div",{className:"mt-3 text-xs border rounded p-2",children:[" ",a.jsx(Ki,{className:"inline h-4 w-4 mr-1  "}),"You may have to set the environment variable"," ",a.jsx("span",{className:"font-mono bg-accent/10 px-1 rounded",children:"ENABLE_OTEL=true"})," ","or restart devui with the tracing flag"," ",a.jsx("div",{className:"font-mono bg-accent/10 px-1 rounded",children:"devui --tracing"}),"to enable tracing."]})]}):a.jsx("div",{className:"space-y-3",children:o.map((l,c)=>"type"in l&&l.type==="separator"?a.jsx(Zp,{},l.id):a.jsx(a5,{event:l},c))})})})]})}function a5({event:e}){const[n,s]=w.useState(!1);if(e.type!=="response.trace.completed"&&e.type!=="response.trace.completed"||!("data"in e))return a.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 o=e.data;let l;"_uiTimestamp"in e&&typeof e._uiTimestamp=="number"?l=new Date(e._uiTimestamp*1e3).toLocaleTimeString():o.end_time?l=new Date(o.end_time*1e3).toLocaleTimeString():o.start_time?l=new Date(o.start_time*1e3).toLocaleTimeString():o.timestamp?l=new Date(o.timestamp).toLocaleTimeString():l=new Date().toLocaleTimeString();const c=o.operation_name||"Unknown Operation",d=o.duration_ms?`${Number(o.duration_ms).toFixed(1)}ms`:"",f=o.entity_id||"";return a.jsxs("div",{className:"border-l-2 border-muted pl-3 py-2 hover:bg-muted/50 transition-colors",children:[a.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground mb-1",children:[a.jsx(Qi,{className:"h-3 w-3 text-orange-600 dark:text-orange-400"}),a.jsx("span",{className:"font-mono",children:l}),a.jsx(Qt,{variant:"outline",className:"text-xs py-0",children:"trace"}),d&&a.jsx(Qt,{variant:"secondary",className:"text-xs py-0",children:d})]}),a.jsxs("div",{className:"text-sm",children:[a.jsxs("div",{className:"flex items-center gap-2 cursor-pointer",onClick:()=>s(!n),children:[a.jsx("div",{className:"text-muted-foreground",children:n?a.jsx(Xt,{className:"h-3 w-3"}):a.jsx(Un,{className:"h-3 w-3"})}),a.jsxs("div",{className:"text-muted-foreground flex-1 break-all",children:[a.jsx("span",{className:"font-medium",children:c}),f&&a.jsxs("span",{className:"ml-2 text-xs",children:["(",f,")"]})]})]}),n&&a.jsx("div",{className:"mt-2 ml-5 p-3 bg-muted/30 rounded border",children:a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Qi,{className:"h-4 w-4 text-orange-500"}),a.jsx("span",{className:"font-semibold text-sm",children:"Trace Details"})]}),a.jsxs("div",{className:"grid grid-cols-1 gap-2 text-xs",children:[a.jsxs("div",{children:[a.jsx("span",{className:"font-medium text-muted-foreground",children:"Operation:"}),a.jsx("span",{className:"ml-2 font-mono bg-orange-100 dark:bg-orange-900 px-2 py-1 rounded",children:c})]}),o.span_id&&a.jsxs("div",{children:[a.jsx("span",{className:"font-medium text-muted-foreground",children:"Span ID:"}),a.jsx("span",{className:"ml-2 font-mono text-xs break-all",children:o.span_id})]}),o.trace_id&&a.jsxs("div",{children:[a.jsx("span",{className:"font-medium text-muted-foreground",children:"Trace ID:"}),a.jsx("span",{className:"ml-2 font-mono text-xs break-all",children:o.trace_id})]}),o.parent_span_id&&a.jsxs("div",{children:[a.jsx("span",{className:"font-medium text-muted-foreground",children:"Parent Span:"}),a.jsx("span",{className:"ml-2 font-mono text-xs break-all",children:o.parent_span_id})]}),o.duration_ms&&a.jsxs("div",{children:[a.jsx("span",{className:"font-medium text-muted-foreground",children:"Duration:"}),a.jsxs("span",{className:"ml-2 font-mono text-xs",children:[Number(o.duration_ms).toFixed(2),"ms"]})]}),o.status&&a.jsxs("div",{children:[a.jsx("span",{className:"font-medium text-muted-foreground",children:"Status:"}),a.jsx("span",{className:`ml-2 px-2 py-1 rounded text-xs font-medium ${o.status==="StatusCode.UNSET"||o.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:o.status||"unknown"})]}),o.entity_id&&a.jsxs("div",{children:[a.jsx("span",{className:"font-medium text-muted-foreground",children:"Entity:"}),a.jsx("span",{className:"ml-2 font-mono text-xs break-all",children:o.entity_id})]}),o.attributes&&Object.keys(o.attributes).length>0&&a.jsxs("div",{children:[a.jsx("span",{className:"font-medium text-muted-foreground",children:"Attributes:"}),a.jsx("div",{className:"mt-1 max-h-32 overflow-auto",children:a.jsx("pre",{className:"text-xs bg-background border rounded p-2 whitespace-pre-wrap max-w-full break-all",children:(()=>{try{const m={...o.attributes};return Object.keys(m).forEach(p=>{if(typeof m[p]=="string"&&m[p].startsWith("["))try{m[p]=JSON.parse(m[p])}catch{}}),JSON.stringify(m,null,2)}catch{return JSON.stringify(o.attributes,null,2)}})()})})]})]})]})})]})]})}function i5({events:e}){const n=b2(e),s=[],o=n.filter(m=>m.type==="response.function_call.complete"),l=e.filter(m=>io(m)!==null),c=new Map;l.forEach(m=>{const p=io(m);p&&c.set(p.call_id,m)}),o.forEach(m=>{if(s.push(m),"data"in m&&m.data&&m.data.call_id){const p=String(m.data.call_id),g=c.get(p);g&&(s.push(g),c.delete(p))}}),c.forEach(m=>{s.push(m)});const f=[...Wp(s)].reverse();return a.jsxs("div",{className:"h-full flex flex-col",children:[a.jsxs("div",{className:"flex items-center gap-2 p-3 border-b",children:[a.jsx(nd,{className:"h-4 w-4"}),a.jsx("span",{className:"font-medium",children:"Tools"}),a.jsx(Qt,{variant:"outline",children:s.length})]}),a.jsx(Ss,{className:"flex-1",children:a.jsx("div",{className:"p-3",children:s.length===0?a.jsx("div",{className:"text-center text-muted-foreground text-sm py-8",children:"No tool executions yet. Tool calls will appear here during conversations."}):a.jsx("div",{className:"space-y-3",children:f.map((m,p)=>"type"in m&&m.type==="separator"?a.jsx(Zp,{},m.id):a.jsx(l5,{event:m},p))})})})]})}function l5({event:e}){const n="_uiTimestamp"in e&&typeof e._uiTimestamp=="number"?new Date(e._uiTimestamp*1e3).toLocaleTimeString():new Date().toLocaleTimeString(),s=e.type==="response.function_call.complete",o=io(e),l=o!==null;if(!s&&!l)return null;const c=s&&"data"in e?e.data:null;return a.jsxs("div",{className:"border rounded p-3",children:[a.jsxs("div",{className:"flex items-center justify-between mb-2",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Hp,{className:"h-4 w-4 text-yellow-600 dark:text-yellow-400"}),a.jsx("span",{className:"font-medium text-sm",children:s?"Tool Call":"Tool Result"}),s&&c&&c.name!==void 0&&a.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",String(c.name),")"]})]}),a.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:n})]}),s&&c&&a.jsxs("div",{className:"p-2 bg-blue-50 dark:bg-blue-950/50 border border-blue-200 dark:border-blue-800 rounded",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[a.jsx(nd,{className:"h-3 w-3 text-blue-600 dark:text-blue-400"}),a.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"}),a.jsx("span",{className:"font-medium text-sm",children:String(c.name||"unknown")})]}),c.arguments!==void 0&&a.jsxs("div",{className:"text-xs",children:[a.jsx("span",{className:"text-muted-foreground mb-1 block",children:"Arguments:"}),a.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 c.arguments=="string"?c.arguments:JSON.stringify(c.arguments,null,1)})]})]}),l&&o&&a.jsxs("div",{className:"p-2 bg-green-50 dark:bg-green-950/50 border border-green-200 dark:border-green-800 rounded",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[a.jsx(Kt,{className:"h-3 w-3 text-green-600 dark:text-green-400"}),a.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"}),o.status!=="completed"&&a.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:o.status})]}),a.jsxs("div",{className:"text-xs space-y-1",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-muted-foreground",children:"Call ID:"}),a.jsx("span",{className:"font-mono text-xs break-all",children:o.call_id})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-muted-foreground block mb-1",children:"Output:"}),a.jsx("pre",{className:"p-2 bg-background border rounded text-xs overflow-auto max-h-32 break-all whitespace-pre-wrap",children:o.output})]})]})]})]})}function c5({events:e,isStreaming:n=!1,onMinimize:s}){return a.jsx("div",{className:"flex-1 border-l flex flex-col min-h-0",children:a.jsxs(QT,{defaultValue:"events",className:"flex-1 flex flex-col min-h-0",children:[a.jsxs("div",{className:"px-3 pt-3 flex items-center gap-2 flex-shrink-0",children:[a.jsxs(v2,{className:"flex-1",children:[a.jsx(du,{value:"events",className:"flex-1",children:"Events"}),a.jsx(du,{value:"traces",className:"flex-1",children:"Traces"}),a.jsx(du,{value:"tools",className:"flex-1",children:"Tools"})]}),s&&a.jsx(Oe,{variant:"ghost",size:"sm",onClick:s,className:"h-8 w-8 p-0 flex-shrink-0",title:"Minimize debug panel",children:a.jsx(Un,{className:"h-4 w-4"})})]}),a.jsx(fu,{value:"events",className:"flex-1 mt-0 overflow-hidden",children:a.jsx(s5,{events:e,isStreaming:n})}),a.jsx(fu,{value:"traces",className:"flex-1 mt-0 overflow-hidden",children:a.jsx(o5,{events:e})}),a.jsx(fu,{value:"tools",className:"flex-1 mt-0 overflow-hidden",children:a.jsx(i5,{events:e})})]})})}function js({open:e,onOpenChange:n,children:s}){return e?a.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",onClick:()=>n(!1),children:[a.jsx("div",{className:"absolute inset-0 bg-black/50"}),a.jsx("div",{onClick:o=>o.stopPropagation(),children:s})]}):null}function _s({children:e,className:n=""}){const o=n.includes("w-[")||n.includes("w-full")||n.includes("max-w-")?"":"max-w-lg w-full";return a.jsx("div",{className:`relative bg-background border rounded-lg shadow-lg max-h-[90vh] overflow-hidden ${o} ${n}`,children:e})}function Es({children:e,className:n=""}){return a.jsx("div",{className:`space-y-2 ${n}`,children:e})}function Cs({children:e,className:n=""}){return a.jsx("h2",{className:`text-lg font-semibold ${n}`,children:e})}function w2({children:e,className:n=""}){return a.jsx("p",{className:`text-sm text-muted-foreground ${n}`,children:e})}function Ca({onClose:e}){return a.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:a.jsx(Ji,{className:"h-4 w-4"})})}function N2({children:e}){return a.jsx("div",{className:"flex justify-end gap-2 p-4 border-t bg-muted/50",children:e})}function An({className:e,type:n,...s}){return a.jsx("input",{type:n,"data-slot":"input",className:Ge("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),...s})}var u5="Label",S2=w.forwardRef((e,n)=>a.jsx(Pe.label,{...e,ref:n,onMouseDown:s=>{s.target.closest("button, input, select, textarea")||(e.onMouseDown?.(s),!s.defaultPrevented&&s.detail>1&&s.preventDefault())}}));S2.displayName=u5;var d5=S2;function gt({className:e,...n}){return a.jsx(d5,{"data-slot":"label",className:Ge("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),...n})}function Kp(e){const n=w.useRef({value:e,previous:e});return w.useMemo(()=>(n.current.value!==e&&(n.current.previous=n.current.value,n.current.value=e),n.current.previous),[e])}var ad="Switch",[f5,_I]=ir(ad),[m5,h5]=f5(ad),j2=w.forwardRef((e,n)=>{const{__scopeSwitch:s,name:o,checked:l,defaultChecked:c,required:d,disabled:f,value:m="on",onCheckedChange:p,form:g,...v}=e,[y,b]=w.useState(null),S=nt(n,j=>b(j)),N=w.useRef(!1),_=y?g||!!y.closest("form"):!0,[E,M]=so({prop:l,defaultProp:c??!1,onChange:p,caller:ad});return a.jsxs(m5,{scope:s,checked:E,disabled:f,children:[a.jsx(Pe.button,{type:"button",role:"switch","aria-checked":E,"aria-required":d,"data-state":k2(E),"data-disabled":f?"":void 0,disabled:f,value:m,...v,ref:S,onClick:Te(e.onClick,j=>{M(k=>!k),_&&(N.current=j.isPropagationStopped(),N.current||j.stopPropagation())})}),_&&a.jsx(C2,{control:y,bubbles:!N.current,name:o,value:m,checked:E,required:d,disabled:f,form:g,style:{transform:"translateX(-100%)"}})]})});j2.displayName=ad;var _2="SwitchThumb",E2=w.forwardRef((e,n)=>{const{__scopeSwitch:s,...o}=e,l=h5(_2,s);return a.jsx(Pe.span,{"data-state":k2(l.checked),"data-disabled":l.disabled?"":void 0,...o,ref:n})});E2.displayName=_2;var p5="SwitchBubbleInput",C2=w.forwardRef(({__scopeSwitch:e,control:n,checked:s,bubbles:o=!0,...l},c)=>{const d=w.useRef(null),f=nt(d,c),m=Kp(s),p=Np(n);return w.useEffect(()=>{const g=d.current;if(!g)return;const v=window.HTMLInputElement.prototype,b=Object.getOwnPropertyDescriptor(v,"checked").set;if(m!==s&&b){const S=new Event("click",{bubbles:o});b.call(g,s),g.dispatchEvent(S)}},[m,s,o]),a.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:s,...l,tabIndex:-1,ref:f,style:{...l.style,...p,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});C2.displayName=p5;function k2(e){return e?"checked":"unchecked"}var A2=j2,g5=E2;const Ph=w.forwardRef(({className:e,...n},s)=>a.jsx(A2,{className:Ge("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...n,ref:s,children:a.jsx(g5,{className:Ge("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));Ph.displayName=A2.displayName;const x5=["gpt-4.1","gpt-4.1-mini","o1","o1-mini","o3-mini"];function Hv({open:e,onOpenChange:n,onBackendUrlChange:s}){const[o,l]=w.useState("general"),{oaiMode:c,setOAIMode:d,azureDeploymentEnabled:f,setAzureDeploymentEnabled:m,authRequired:p,serverCapabilities:g}=pe(),v="",[y,b]=w.useState(()=>localStorage.getItem("devui_backend_url")||v),[S,N]=w.useState(y),[_,E]=w.useState(!!localStorage.getItem("devui_auth_token")),[M,j]=w.useState(""),k=()=>{try{new URL(S),localStorage.setItem("devui_backend_url",S),b(S),s?.(S),n(!1),window.location.reload()}catch{alert("Please enter a valid URL (e.g., http://localhost:8080)")}},R=()=>{localStorage.removeItem("devui_backend_url"),N(v),b(v),s?.(v),window.location.reload()},D=()=>{M.trim()&&(localStorage.setItem("devui_auth_token",M.trim()),E(!0),j(""),window.location.reload())},z=()=>{localStorage.removeItem("devui_auth_token"),E(!1),j(""),window.location.reload()},H=S!==y,U=!localStorage.getItem("devui_backend_url");return a.jsx(js,{open:e,onOpenChange:n,children:a.jsxs(_s,{className:"w-[600px] max-w-[90vw] flex flex-col max-h-[85vh]",children:[a.jsx(Es,{className:"p-6 pb-2 flex-shrink-0",children:a.jsx(Cs,{children:"Settings"})}),a.jsx(Ca,{onClose:()=>n(!1)}),a.jsxs("div",{className:"flex border-b px-6 flex-shrink-0",children:[a.jsxs("button",{onClick:()=>l("general"),className:`px-4 py-2 text-sm font-medium transition-colors relative ${o==="general"?"text-foreground":"text-muted-foreground hover:text-foreground"}`,children:["General",o==="general"&&a.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-0.5 bg-primary"})]}),g.openai_proxy&&a.jsxs("button",{onClick:()=>l("proxy"),className:`px-4 py-2 text-sm font-medium transition-colors relative ${o==="proxy"?"text-foreground":"text-muted-foreground hover:text-foreground"}`,children:["OpenAI Proxy",o==="proxy"&&a.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-0.5 bg-primary"})]}),a.jsxs("button",{onClick:()=>l("about"),className:`px-4 py-2 text-sm font-medium transition-colors relative ${o==="about"?"text-foreground":"text-muted-foreground hover:text-foreground"}`,children:["About",o==="about"&&a.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-0.5 bg-primary"})]})]}),a.jsxs("div",{className:"px-6 pb-6 overflow-y-auto flex-1 min-h-[400px]",children:[o==="general"&&a.jsxs("div",{className:"space-y-6 pt-4",children:[a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(gt,{htmlFor:"backend-url",className:"text-sm font-medium",children:"Backend URL"}),!U&&a.jsxs(Oe,{variant:"ghost",size:"sm",onClick:R,className:"h-7 text-xs",title:"Reset to default",children:[a.jsx(Ip,{className:"h-3 w-3 mr-1"}),"Reset"]})]}),a.jsx(An,{id:"backend-url",type:"url",value:S,onChange:F=>N(F.target.value),placeholder:"http://localhost:8080",className:"font-mono text-sm"}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:["Default: ",a.jsx("span",{className:"font-mono",children:v})]}),a.jsx("div",{className:"flex gap-2 pt-2 min-h-[36px]",children:H&&a.jsxs(a.Fragment,{children:[a.jsx(Oe,{onClick:k,size:"sm",className:"flex-1",children:"Apply & Reload"}),a.jsx(Oe,{onClick:()=>N(y),variant:"outline",size:"sm",className:"flex-1",children:"Cancel"})]})})]}),(p||_)&&a.jsxs("div",{className:"space-y-3 border-t pt-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(gt,{className:"text-sm font-medium",children:"Authentication Token"}),!p&&_&&a.jsx("span",{className:"text-xs text-muted-foreground",children:"(Not required by current backend)"})]}),_?a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(An,{type:"password",value:"••••••••••••••••••••",disabled:!0,className:"font-mono text-sm flex-1"}),a.jsx(Oe,{variant:"destructive",size:"sm",onClick:z,className:"flex-shrink-0",children:"Clear"})]}),a.jsx("p",{className:"text-xs text-green-600 dark:text-green-400",children:"✓ Token configured and stored locally"})]}):a.jsxs("div",{className:"space-y-3",children:[a.jsx(An,{type:"password",value:M,onChange:F=>j(F.target.value),placeholder:"Enter bearer token",className:"font-mono text-sm",onKeyDown:F=>{F.key==="Enter"&&M.trim()&&D()}}),a.jsx(Oe,{onClick:D,size:"sm",disabled:!M.trim(),className:"w-full",children:"Save & Reload"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:p?"Required by backend (started with --auth flag)":"Not required by current backend"})]})]}),g.deployment&&a.jsxs("div",{className:"space-y-3 border-t pt-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"space-y-0.5",children:[a.jsx(gt,{className:"text-sm font-medium",children:"Azure Deployment"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Enable one-click deployment to Azure Container Apps"})]}),a.jsx(Ph,{checked:f,onCheckedChange:m})]}),a.jsxs("details",{className:"group",children:[a.jsxs("summary",{className:"cursor-pointer text-xs text-muted-foreground hover:text-foreground transition-colors flex items-center gap-1",children:[a.jsx(Un,{className:"h-3 w-3 transition-transform group-open:rotate-90"}),"Learn more about Azure deployment"]}),a.jsxs("div",{className:"mt-3 space-y-3 pl-4",children:[a.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:'When enabled, agents that support deployment will show a "Deploy to Azure" button. This allows you to deploy your agent to Azure Container Apps directly from DevUI.'}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx("p",{className:"text-xs font-medium",children:"When enabled:"}),a.jsxs("ul",{className:"text-xs text-muted-foreground space-y-0.5 list-disc list-inside",children:[a.jsx("li",{children:'Shows "Deploy to Azure" for supported agents'}),a.jsx("li",{children:"Requires Azure CLI and proper authentication"}),a.jsx("li",{children:"Backend must have deployment capabilities enabled"})]})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx("p",{className:"text-xs font-medium",children:"When disabled:"}),a.jsxs("ul",{className:"text-xs text-muted-foreground space-y-0.5 list-disc list-inside",children:[a.jsx("li",{children:'Shows "Deployment Guide" for all agents'}),a.jsx("li",{children:"Provides Docker templates and manual deployment instructions"}),a.jsx("li",{children:"No backend deployment capabilities required"})]})]})]})]})]})]}),o==="proxy"&&g.openai_proxy&&a.jsxs("div",{className:"space-y-6 pt-4",children:[a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"space-y-0.5",children:[a.jsx(gt,{className:"text-base font-medium",children:"OpenAI Proxy Mode"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Route requests through DevUI backend to OpenAI API"})]}),a.jsx(Ph,{checked:c.enabled,onCheckedChange:F=>d({...c,enabled:F})})]}),!c.enabled&&a.jsx("div",{className:"bordder border-muted bg-muted/30 rounded-lg p-4 space-y-3",children:a.jsxs("div",{className:"flex items-start gap-2",children:[a.jsx(Ki,{className:"h-4 w-4 flex-shrink-0 mt-0.5 text-blue-600 dark:text-blue-400"}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("p",{className:"text-sm font-medium",children:"About OpenAI Proxy Mode"}),a.jsxs("p",{className:"text-xs text-muted-foreground leading-relaxed",children:["When enabled, your chat requests are sent to your DevUI backend"," ",a.jsxs("span",{className:"font-mono font-semibold",children:["(",y,")"]}),", which then forwards them to OpenAI's API. This keeps your"," ",a.jsx("span",{className:"font-mono font-semibold",children:"OPENAI_API_KEY"})," ","secure on the server instead of exposing it in the browser."]}),a.jsxs("div",{className:"space-y-1.5 pt-1",children:[a.jsx("p",{className:"text-xs font-medium",children:"Requirements:"}),a.jsxs("ul",{className:"text-xs text-muted-foreground space-y-0.5 list-disc list-inside",children:[a.jsxs("li",{children:["Backend must have"," ",a.jsx("span",{className:"font-mono",children:"OPENAI_API_KEY"})," ","configured"]}),a.jsx("li",{children:"Backend must support OpenAI Responses API proxying (DevUI does)"})]})]}),a.jsxs("div",{className:"space-y-1.5 pt-1",children:[a.jsx("p",{className:"text-xs font-medium",children:"Why use this?"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Quickly test and compare OpenAI models directly through the DevUI interface without creating custom agents or exposing API keys in the browser."})]})]})]})}),c.enabled&&a.jsxs("div",{className:"space-y-4 pl-4 border-l-2 border-muted",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(gt,{className:"text-sm font-medium",children:"Model"}),a.jsx(An,{type:"text",value:c.model,onChange:F=>d({...c,model:F.target.value}),placeholder:"gpt-4.1-mini",className:"font-mono text-sm"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Enter any OpenAI model ID (e.g., gpt-4.1, o1, o3-mini)"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(gt,{className:"text-xs text-muted-foreground",children:"Common presets"}),a.jsx("div",{className:"flex flex-wrap gap-2",children:x5.map(F=>a.jsx(Oe,{variant:c.model===F?"default":"outline",size:"sm",onClick:()=>d({...c,model:F}),className:"text-xs h-7",children:F},F))})]}),a.jsxs("details",{className:"group",children:[a.jsxs("summary",{className:"cursor-pointer text-sm font-medium text-muted-foreground hover:text-foreground transition-colors flex items-center gap-1",children:[a.jsx(Un,{className:"h-3 w-3 transition-transform group-open:rotate-90"}),"Advanced Parameters (optional)"]}),a.jsxs("div",{className:"space-y-3 mt-3 pl-4",children:[a.jsxs("div",{className:"space-y-1",children:[a.jsx(gt,{className:"text-xs",children:"Temperature"}),a.jsx(An,{type:"number",step:"0.1",min:"0",max:"2",value:c.temperature??"",onChange:F=>d({...c,temperature:F.target.value?parseFloat(F.target.value):void 0}),placeholder:"1.0 (default)",className:"text-sm"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Controls randomness (0-2)"})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx(gt,{className:"text-xs",children:"Max Output Tokens"}),a.jsx(An,{type:"number",min:"1",value:c.max_output_tokens??"",onChange:F=>d({...c,max_output_tokens:F.target.value?parseInt(F.target.value):void 0}),placeholder:"Auto",className:"text-sm"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Maximum tokens in response"})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx(gt,{className:"text-xs",children:"Top P"}),a.jsx(An,{type:"number",step:"0.1",min:"0",max:"1",value:c.top_p??"",onChange:F=>d({...c,top_p:F.target.value?parseFloat(F.target.value):void 0}),placeholder:"1.0 (default)",className:"text-sm"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Nucleus sampling (0-1)"})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx(gt,{className:"text-xs",children:"Reasoning Effort (o-series models)"}),a.jsxs("select",{value:c.reasoning_effort??"",onChange:F=>d({...c,reasoning_effort:F.target.value?F.target.value:void 0}),className:"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:[a.jsx("option",{value:"",children:"Auto (default)"}),a.jsx("option",{value:"minimal",children:"Minimal"}),a.jsx("option",{value:"low",children:"Low"}),a.jsx("option",{value:"medium",children:"Medium"}),a.jsx("option",{value:"high",children:"High"})]}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Constrains reasoning effort (faster/cheaper vs thorough)"})]})]})]})]})]}),c.enabled&&a.jsxs("div",{className:"flex items-start gap-2 text-xs text-muted-foreground bg-muted/50 p-3 rounded",children:[a.jsx(Ki,{className:"h-3.5 w-3.5 flex-shrink-0 mt-0.5"}),a.jsx("div",{className:"space-y-1",children:a.jsxs("p",{children:["Requests route through"," ",a.jsx("span",{className:"font-mono font-semibold",children:y})," ","to OpenAI API. Server must have"," ",a.jsx("span",{className:"font-mono font-semibold",children:"OPENAI_API_KEY"})," ","configured."]})})]})]}),o==="about"&&a.jsxs("div",{className:"space-y-4 pt-4",children:[a.jsx("p",{className:"text-sm text-muted-foreground",children:"DevUI is a sample app for getting started with Agent Framework."}),a.jsx("div",{className:"flex justify-center pt-2",children:a.jsxs(Oe,{variant:"outline",size:"sm",onClick:()=>window.open("https://github.com/microsoft/agent-framework","_blank"),className:"text-xs",children:[a.jsx(ku,{className:"h-3 w-3 mr-1"}),"Learn More about Agent Framework"]})})]})]})]})})}const y5="modulepreload",v5=function(e,n){return new URL(e,n).href},$v={},Uh=function(n,s,o){let l=Promise.resolve();if(s&&s.length>0){let p=function(g){return Promise.all(g.map(v=>Promise.resolve(v).then(y=>({status:"fulfilled",value:y}),y=>({status:"rejected",reason:y}))))};const d=document.getElementsByTagName("link"),f=document.querySelector("meta[property=csp-nonce]"),m=f?.nonce||f?.getAttribute("nonce");l=p(s.map(g=>{if(g=v5(g,o),g in $v)return;$v[g]=!0;const v=g.endsWith(".css"),y=v?'[rel="stylesheet"]':"";if(o)for(let S=d.length-1;S>=0;S--){const N=d[S];if(N.href===g&&(!v||N.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${g}"]${y}`))return;const b=document.createElement("link");if(b.rel=v?"stylesheet":y5,v||(b.as="script"),b.crossOrigin="",b.href=g,m&&b.setAttribute("nonce",m),document.head.appendChild(b),v)return new Promise((S,N)=>{b.addEventListener("load",S),b.addEventListener("error",()=>N(new Error(`Unable to preload CSS for ${g}`)))})}))}function c(d){const f=new Event("vite:preloadError",{cancelable:!0});if(f.payload=d,window.dispatchEvent(f),!f.defaultPrevented)throw d}return l.then(d=>{for(const f of d||[])f.status==="rejected"&&c(f.reason);return n().catch(c)})},M2="devui_streaming_state_",T2=1440*60*1e3;function Tu(e){return`${M2}${e}`}function b5(e){let n="";for(const s of e)s.type==="response.output_text.delta"&&"delta"in s&&(n+=s.delta);return n}function R2(e){try{const n=Tu(e.conversationId),s=JSON.stringify(e);localStorage.setItem(n,s)}catch(n){console.error("Failed to save streaming state:",n);try{D2();const s=Tu(e.conversationId),o=JSON.stringify(e);localStorage.setItem(s,o)}catch{console.error("Failed to save streaming state even after cleanup")}}}function la(e){try{const n=Tu(e),s=localStorage.getItem(n);if(!s)return null;const o=JSON.parse(s);return Date.now()-o.timestamp>T2?(mu(e),null):o.completed?null:o}catch(n){return console.error("Failed to load streaming state:",n),null}}function ah(e,n,s,o){try{const l=la(e),c="sequence_number"in n?n.sequence_number:void 0,d=l?[...l.events,n]:[n],f={conversationId:e,responseId:s,lastMessageId:o,lastSequenceNumber:c??l?.lastSequenceNumber??-1,events:d,timestamp:Date.now(),completed:n.type==="response.completed"||n.type==="response.failed",accumulatedText:b5(d)};R2(f)}catch(l){console.error("Failed to update streaming state:",l)}}function Bv(e){try{const n=la(e);n&&(n.completed=!0,n.timestamp=Date.now(),R2(n))}catch(n){console.error("Failed to mark streaming as completed:",n)}}function mu(e){try{const n=Tu(e);localStorage.removeItem(n)}catch(n){console.error("Failed to clear streaming state:",n)}}function D2(){try{const e=Object.keys(localStorage),n=Date.now();for(const s of e)if(s.startsWith(M2))try{const o=localStorage.getItem(s);if(o){const l=JSON.parse(o);(n-l.timestamp>T2||l.completed)&&localStorage.removeItem(s)}}catch{localStorage.removeItem(s)}}catch(e){console.error("Failed to clear expired streaming states:",e)}}function w5(){D2()}const N5="",S5=1e3,ih=10;function j5(){const e=localStorage.getItem("devui_backend_url");return e||N5}function _5(e){return new Promise(n=>setTimeout(n,e))}class E5{baseUrl;authToken=null;constructor(n){this.baseUrl=n||j5(),this.authToken=localStorage.getItem("devui_auth_token")}setBaseUrl(n){this.baseUrl=n}getBaseUrl(){return this.baseUrl}setAuthToken(n){this.authToken=n,n?localStorage.setItem("devui_auth_token",n):localStorage.removeItem("devui_auth_token")}getAuthToken(){return this.authToken}clearAuthToken(){this.setAuthToken(null)}async request(n,s={}){const o=`${this.baseUrl}${n}`,l={"Content-Type":"application/json",...s.headers};this.authToken&&(l.Authorization=`Bearer ${this.authToken}`);const c=await fetch(o,{...s,headers:l});if(!c.ok){if(c.status===401)throw this.clearAuthToken(),new Error("UNAUTHORIZED");let d=`API request failed: ${c.status} ${c.statusText}`;try{const f=await c.json();f.detail?typeof f.detail=="string"?d=f.detail:typeof f.detail=="object"&&f.detail.error?.message&&(d=f.detail.error.message):f.error?.message&&(d=f.error.message)}catch{}throw new Error(d)}return c.json()}async getHealth(){return this.request("/health")}async getMeta(){return this.request("/meta")}async getEntities(){const s=(await this.request("/v1/entities")).entities.map(c=>{if(c.type==="agent")return{id:c.id,name:c.name,description:c.description,type:"agent",source:c.source||"directory",tools:(c.tools||[]).map(d=>typeof d=="string"?d:JSON.stringify(d)),has_env:!1,module_path:typeof c.metadata?.module_path=="string"?c.metadata.module_path:void 0,metadata:c.metadata,deployment_supported:c.deployment_supported,deployment_reason:c.deployment_reason,instructions:c.instructions,model:c.model,chat_client_type:c.chat_client_type,context_providers:c.context_providers,middleware:c.middleware};{const d=c.tools?.[0],f=typeof d=="string"?d:"";return{id:c.id,name:c.name,description:c.description,type:"workflow",source:c.source||"directory",executors:(c.tools||[]).map(m=>typeof m=="string"?m:JSON.stringify(m)),has_env:!1,module_path:typeof c.metadata?.module_path=="string"?c.metadata.module_path:void 0,metadata:c.metadata,deployment_supported:c.deployment_supported,deployment_reason:c.deployment_reason,input_schema:c.input_schema||{type:"string"},input_type_name:c.input_type_name||"Input",start_executor_id:f}}}),o=s.filter(c=>c.type==="agent"),l=s.filter(c=>c.type==="workflow");return{entities:s,agents:o,workflows:l}}async getAgents(){const{agents:n}=await this.getEntities();return n}async getWorkflows(){const{workflows:n}=await this.getEntities();return n}async getAgentInfo(n){return this.request(`/v1/entities/${n}/info?type=agent`)}async getWorkflowInfo(n){return this.request(`/v1/entities/${n}/info?type=workflow`)}async reloadEntity(n){return this.request(`/v1/entities/${n}/reload`,{method:"POST"})}async createConversation(n){const{oaiMode:s}=await Uh(()=>Promise.resolve().then(()=>$h),void 0,import.meta.url).then(c=>({oaiMode:c.useDevUIStore.getState().oaiMode})),o={};s.enabled&&(o["X-Proxy-Backend"]="openai");const l=await this.request("/v1/conversations",{method:"POST",headers:o,body:JSON.stringify({metadata:n})});return{id:l.id,object:"conversation",created_at:l.created_at,metadata:l.metadata}}async listConversations(n){const s=n?`/v1/conversations?agent_id=${encodeURIComponent(n)}`:"/v1/conversations",o=await this.request(s);return{data:o.data.map(l=>({id:l.id,object:"conversation",created_at:l.created_at,metadata:l.metadata})),has_more:o.has_more}}async getConversation(n){const s=await this.request(`/v1/conversations/${n}`);return{id:s.id,object:"conversation",created_at:s.created_at,metadata:s.metadata}}async deleteConversation(n){try{return await this.request(`/v1/conversations/${n}`,{method:"DELETE"}),mu(n),!0}catch{return!1}}async listConversationItems(n,s){const o=new URLSearchParams;s?.limit&&o.set("limit",s.limit.toString()),s?.after&&o.set("after",s.after),s?.order&&o.set("order",s.order);const l=o.toString(),c=`/v1/conversations/${n}/items${l?`?${l}`:""}`;return this.request(c)}async deleteConversationItem(n,s){const o=await fetch(`${this.baseUrl}/v1/conversations/${n}/items/${s}`,{method:"DELETE"});if(!o.ok)throw new Error(`Failed to delete item: ${o.statusText}`)}async*streamOpenAIResponse(n,s,o){const{oaiMode:l}=await Uh(()=>Promise.resolve().then(()=>$h),void 0,import.meta.url).then(g=>({oaiMode:g.useDevUIStore.getState().oaiMode}));l.enabled&&(n.model=l.model,l.temperature!==void 0&&(n.temperature=l.temperature),l.max_output_tokens!==void 0&&(n.max_output_tokens=l.max_output_tokens),l.top_p!==void 0&&(n.top_p=l.top_p),l.instructions!==void 0&&(n.instructions=l.instructions),l.reasoning_effort!==void 0&&(n.reasoning={effort:l.reasoning_effort}));let c=-1,d=0,f=!1,m=o,p;if(s){const g=la(s);if(g)if(o||(m=g.responseId),c=g.lastSequenceNumber,p=g.lastMessageId,o)f=g.events.length>0;else for(const v of g.events)f=!0,yield v}for(;d<=ih;)try{let g;if(m){const S=new URLSearchParams;S.set("stream","true"),c>=0&&S.set("starting_after",c.toString());const N=`${this.baseUrl}/v1/responses/${m}?${S.toString()}`,_={Accept:"text/event-stream"};this.authToken&&(_.Authorization=`Bearer ${this.authToken}`),g=await fetch(N,{method:"GET",headers:_})}else{const S=`${this.baseUrl}/v1/responses`,N={"Content-Type":"application/json",Accept:"text/event-stream"};l.enabled&&(N["X-Proxy-Backend"]="openai"),this.authToken&&(N.Authorization=`Bearer ${this.authToken}`),g=await fetch(S,{method:"POST",headers:N,body:JSON.stringify(n)})}if(!g.ok){if(g.status===401)throw this.clearAuthToken(),new Error("UNAUTHORIZED");if(g.status>=400&&g.status<500){let N=`Client error ${g.status}`;try{const _=await g.json();_.error&&_.error.message?N=_.error.message:_.detail&&(N=_.detail)}catch{}throw new Error(`CLIENT_ERROR: ${N}`)}let S=`Request failed with status ${g.status}`;try{const N=await g.json();N.error&&N.error.message?S=N.error.message:N.detail&&(S=N.detail)}catch{}throw new Error(S)}const v=g.body?.getReader();if(!v)throw new Error("Response body is not readable");const y=new TextDecoder;let b="";try{for(;;){const{done:S,value:N}=await v.read();if(S){s&&Bv(s);return}b+=y.decode(N,{stream:!0});const _=b.split(`
`);b=_.pop()||"";for(const E of _)if(E.startsWith("data: ")){const M=E.slice(6);if(M==="[DONE]"){s&&Bv(s);return}try{const j=JSON.parse(M);if("response"in j&&j.response&&typeof j.response=="object"&&"id"in j.response){const R=j.response.id;(!m||m!==R)&&(m=R)}else if("id"in j&&typeof j.id=="string"&&j.id.startsWith("resp_")){const R=j.id;(!m||m!==R)&&(m=R)}"item_id"in j&&j.item_id&&(p=j.item_id);const k="sequence_number"in j?j.sequence_number:void 0;if(k!==void 0)if(f&&k<=1&&c>1)s&&mu(s),yield{type:"error",message:"Connection lost - previous response failed. Starting new response."},c=k,f=!0,s&&m&&ah(s,j,m,p),yield j;else{if(k<=c)continue;c=k,f=!0,s&&m&&ah(s,j,m,p),yield j}else f=!0,s&&m&&ah(s,j,m,p),yield j}catch(j){console.error("Failed to parse OpenAI SSE event:",j)}}}}finally{v.releaseLock()}}catch(g){const v=g instanceof Error?g.message:String(g);if(v==="UNAUTHORIZED"||v.startsWith("CLIENT_ERROR:"))throw g;if(d++,d>ih)throw new Error(`Connection failed after ${ih} retry attempts: ${v}`);const y=Math.min(S5*Math.pow(2,d-1),3e4);await _5(y)}}async*streamAgentExecutionOpenAI(n,s,o){const l={metadata:{entity_id:n},input:s.input,stream:!0,conversation:s.conversation_id};return yield*this.streamAgentExecutionOpenAIDirect(n,l,s.conversation_id,o)}async*streamAgentExecutionOpenAIDirect(n,s,o,l){yield*this.streamOpenAIResponse(s,o,l)}async*streamWorkflowExecutionOpenAI(n,s){const o={metadata:{entity_id:n},input:JSON.stringify(s.input_data||{}),stream:!0,conversation:s.conversation_id,extra_body:s.checkpoint_id?{entity_id:n,checkpoint_id:s.checkpoint_id}:void 0};yield*this.streamOpenAIResponse(o,s.conversation_id)}async runAgent(n,s){return this.request(`/agents/${n}/run`,{method:"POST",body:JSON.stringify(s)})}async runWorkflow(n,s){return this.request(`/workflows/${n}/run`,{method:"POST",body:JSON.stringify(s)})}clearStreamingState(n){mu(n)}async*streamDeployment(n){const s=await fetch(`${this.baseUrl}/v1/deployments`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...n,stream:!0})});if(!s.ok)throw new Error(`Deployment failed: ${s.statusText}`);const o=s.body?.getReader();if(!o)throw new Error("No response body");const l=new TextDecoder;let c="";try{for(;;){const{done:d,value:f}=await o.read();if(d)break;c+=l.decode(f,{stream:!0});const m=c.split(`
`);c=m.pop()||"";for(const p of m)if(p.startsWith("data: ")){const g=p.slice(6);if(g==="[DONE]")return;try{yield JSON.parse(g)}catch(v){yield{type:"deploy.error",message:`Failed to parse deployment event: ${v instanceof Error?v.message:"Unknown error"}`}}}}}catch(d){throw yield{type:"deploy.failed",message:`Stream interrupted: ${d instanceof Error?d.message:"Unknown error"}`},d}finally{o.releaseLock()}}async listWorkflowSessions(n){const s=`/v1/conversations?entity_id=${encodeURIComponent(n)}&type=workflow_session`;return{data:(await this.request(s)).data.map(c=>({conversation_id:c.id,entity_id:c.metadata?.entity_id||n,created_at:c.created_at,metadata:{name:c.metadata?.name||`Session ${new Date(c.created_at*1e3).toLocaleString()}`,description:c.metadata?.description,type:"workflow_session"}}))}}async createWorkflowSession(n,s){const o={entity_id:n,type:"workflow_session",name:s?.name||`Session ${new Date().toLocaleString()}`,...s?.description&&{description:s.description}},l=await this.createConversation(o);return{conversation_id:l.id,entity_id:n,created_at:l.created_at,metadata:{name:o.name,description:o.description,type:"workflow_session"}}}async deleteWorkflowSession(n,s){if(!await this.deleteConversation(s))throw new Error("Failed to delete workflow session")}}const Je=new E5;function C5({open:e,onClose:n,agentName:s="Agent",entity:o}){const c=pe(T=>T.azureDeploymentEnabled)&&(o?.deployment_supported??!1),[d,f]=w.useState(c?"azure":"docker"),[m,p]=w.useState(null),g=w.useRef(null),v=w.useRef(null),y=pe(T=>T.isDeploying),b=pe(T=>T.deploymentLogs),S=pe(T=>T.lastDeployment),N=pe(T=>T.startDeployment),_=pe(T=>T.addDeploymentLog),E=pe(T=>T.setDeploymentResult),M=pe(T=>T.stopDeployment),j=pe(T=>T.clearDeploymentState),k=T=>{const B=T.toLowerCase().replace(/[_\s]+/g,"-").replace(/[^a-z0-9-]/g,"").replace(/--+/g,"-").replace(/^[^a-z]+/,"").replace(/-$/,"");return(B.match(/^[a-z]/)?B:`app-${B}`).substring(0,31)},R=o?k(o.id):"",[D,z]=w.useState("my-test-rg"),[H,U]=w.useState(R),[F,K]=w.useState("eastus"),[G,ne]=w.useState(null);w.useEffect(()=>{if(o){const T=k(o.id);U(T);const B=L(T);ne(B)}},[o?.id]),w.useEffect(()=>{v.current&&b.length>0&&(v.current.scrollTop=v.current.scrollHeight)},[b]);const L=T=>T?T.length>=32?"App name must be less than 32 characters":/^[a-z0-9-]+$/.test(T)?/^[a-z]/.test(T)?/[a-z0-9]$/.test(T)?T.includes("--")?"App name cannot contain consecutive hyphens (--)":null:"App name must end with a letter or number":"App name must start with a lowercase letter":"App name must contain only lowercase letters, numbers, and hyphens (no underscores or uppercase)":null;w.useEffect(()=>()=>{g.current&&clearTimeout(g.current)},[]);const V=async()=>{if(!o?.id||!D||!H)return;const T=D.trim(),B=H.trim(),W=L(B);if(W){ne(W);return}try{N();for await(const Z of Je.streamDeployment({entity_id:o.id,resource_group:T,app_name:B,region:F,ui_mode:"user"}))_(Z.message),Z.type==="deploy.completed"&&Z.url&&Z.auth_token?E({url:Z.url,authToken:Z.auth_token}):Z.type==="deploy.failed"&&M()}catch(Z){_(`Error: ${Z instanceof Error?Z.message:"Deployment failed"}`),M()}},A=async(T,B)=>{try{await navigator.clipboard.writeText(T),p(B),g.current&&clearTimeout(g.current),g.current=setTimeout(()=>{p(null),g.current=null},2e3)}catch{p(null)}},I=`# Dockerfile for ${s}
FROM python:3.11-slim

WORKDIR /app

# Install dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Copy agent/workflow directories
COPY . .

# Expose DevUI default port
EXPOSE 8080

# Run DevUI server
CMD ["devui", ".", "--port", "8080", "--host", "0.0.0.0"]
`,$=`# docker-compose.yml
version: '3.8'

services:
  ${s.toLowerCase().replace(/\s+/g,"-")}:
    build: .
    environment:
      # OpenAI
      - OPENAI_API_KEY=\${OPENAI_API_KEY}
      - OPENAI_CHAT_MODEL_ID=\${OPENAI_CHAT_MODEL_ID:-gpt-4o-mini}
      # Or Azure OpenAI
      - AZURE_OPENAI_API_KEY=\${AZURE_OPENAI_API_KEY}
      - AZURE_OPENAI_ENDPOINT=\${AZURE_OPENAI_ENDPOINT}
      - AZURE_OPENAI_CHAT_DEPLOYMENT_NAME=\${AZURE_OPENAI_CHAT_DEPLOYMENT_NAME}
      # Optional: Enable tracing
      - ENABLE_OTEL=\${ENABLE_OTEL:-false}
    ports:
      - "8080:8080"
    restart: unless-stopped
`,P=`# requirements.txt
agent-framework-devui>=0.1.0
agent-framework>=0.1.0
# Chat clients (install what you need)
openai>=1.0.0
# azure-openai
# anthropic
`;return a.jsx(js,{open:e,onOpenChange:n,children:a.jsxs(_s,{className:"w-[800px] max-w-[90vw]",children:[a.jsx(Ca,{onClose:n}),a.jsxs(Es,{className:"p-6 pb-2",children:[a.jsxs(Cs,{className:"flex items-center gap-2",children:[a.jsx(Ih,{className:"h-5 w-5"}),"Deploy ",s]}),a.jsx("p",{className:"text-sm text-muted-foreground pt-1",children:"Get started with containerizing your agent for deployment."})]}),a.jsxs("div",{className:"flex border-b px-6",children:[a.jsxs("button",{onClick:()=>f("docker"),className:`px-4 py-2 text-sm font-medium transition-colors relative ${d==="docker"?"text-foreground":"text-muted-foreground hover:text-foreground"}`,children:[a.jsx(QA,{className:"h-4 w-4 mr-2 inline"}),"Docker",d==="docker"&&a.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-0.5 bg-primary"})]}),c&&a.jsxs("button",{onClick:()=>f("azure"),className:`px-4 py-2 text-sm font-medium transition-colors relative ${d==="azure"?"text-foreground":"text-muted-foreground hover:text-foreground"}`,children:[a.jsx(ZA,{className:"h-4 w-4 mr-2 inline"}),"Azure",d==="azure"&&a.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-0.5 bg-primary"})]})]}),a.jsx("div",{className:"px-6 pb-6 min-h-[400px]",children:a.jsx(Ss,{className:"h-[500px]",children:a.jsxs("div",{className:"pr-4",children:[d==="docker"&&a.jsxs("div",{className:"space-y-4 pt-4",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"font-semibold mb-2",children:"Containerize with Docker"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Package your agent as a Docker container for consistent deployment anywhere."})]}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center justify-between mb-2",children:[a.jsx("span",{className:"text-sm font-medium",children:"Dockerfile"}),a.jsx(Oe,{size:"sm",variant:"ghost",onClick:()=>A(I,"dockerfile"),children:m==="dockerfile"?a.jsxs(a.Fragment,{children:[a.jsx(Kt,{className:"h-4 w-4 mr-1 text-green-500"}),"Copied!"]}):a.jsxs(a.Fragment,{children:[a.jsx(Js,{className:"h-4 w-4 mr-1"}),"Copy"]})})]}),a.jsx("pre",{className:"bg-muted p-3 rounded-md text-xs overflow-x-auto border",children:I})]}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center justify-between mb-2",children:[a.jsx("span",{className:"text-sm font-medium",children:"docker-compose.yml"}),a.jsx(Oe,{size:"sm",variant:"ghost",onClick:()=>A($,"compose"),children:m==="compose"?a.jsxs(a.Fragment,{children:[a.jsx(Kt,{className:"h-4 w-4 mr-1 text-green-500"}),"Copied!"]}):a.jsxs(a.Fragment,{children:[a.jsx(Js,{className:"h-4 w-4 mr-1"}),"Copy"]})})]}),a.jsx("pre",{className:"bg-muted p-3 rounded-md text-xs overflow-x-auto border",children:$})]}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center justify-between mb-2",children:[a.jsx("span",{className:"text-sm font-medium",children:"requirements.txt"}),a.jsx(Oe,{size:"sm",variant:"ghost",onClick:()=>A(P,"requirements"),children:m==="requirements"?a.jsxs(a.Fragment,{children:[a.jsx(Kt,{className:"h-4 w-4 mr-1 text-green-500"}),"Copied!"]}):a.jsxs(a.Fragment,{children:[a.jsx(Js,{className:"h-4 w-4 mr-1"}),"Copy"]})})]}),a.jsx("pre",{className:"bg-muted p-3 rounded-md text-xs overflow-x-auto border",children:P})]}),a.jsxs("div",{className:"bg-blue-50 dark:bg-blue-950/50 border border-blue-200 dark:border-blue-800 rounded-md p-3",children:[a.jsx("h4",{className:"text-sm font-semibold mb-2",children:"Quick Start"}),a.jsxs("ol",{className:"text-xs space-y-1 list-decimal list-inside text-muted-foreground",children:[a.jsx("li",{children:"Save the files above to your project directory"}),a.jsxs("li",{children:["Build:"," ",a.jsxs("code",{className:"bg-muted px-1 rounded",children:["docker build -t ",s.toLowerCase(),"-agent ."]})]}),a.jsxs("li",{children:["Run:"," ",a.jsx("code",{className:"bg-muted px-1 rounded",children:"docker-compose up"})]}),a.jsx("li",{children:"Your agent is now running in a container!"})]})]}),a.jsxs("div",{className:"bg-amber-50 dark:bg-amber-950/50 border border-amber-200 dark:border-amber-800 rounded-md p-3",children:[a.jsx("h4",{className:"text-sm font-semibold mb-2 text-amber-900 dark:text-amber-100",children:"⚠️ Production Considerations"}),a.jsxs("ul",{className:"text-xs space-y-1 list-disc list-inside text-amber-800 dark:text-amber-200",children:[a.jsxs("li",{children:[a.jsx("strong",{children:"In-memory state:"})," Conversations are lost when container restarts"]}),a.jsxs("li",{children:[a.jsx("strong",{children:"No authentication:"})," Add reverse proxy (nginx, Caddy) with auth for production"]}),a.jsxs("li",{children:[a.jsx("strong",{children:"Security:"})," Use Azure Key Vault for secrets management"]}),a.jsxs("li",{children:[a.jsx("strong",{children:"Scaling:"})," Single instance only due to in-memory conversation store"]})]})]}),a.jsxs("div",{className:"border-t pt-4",children:[a.jsx("h4",{className:"font-semibold text-sm mb-3",children:"Pre-Deployment Checklist"}),a.jsxs("div",{className:"space-y-2 text-sm",children:[a.jsxs("div",{className:"flex items-start gap-2",children:[a.jsx(Kt,{className:"h-4 w-4 mt-0.5 text-muted-foreground flex-shrink-0"}),a.jsx("span",{className:"text-muted-foreground",children:"Set environment variables (API keys, secrets)"})]}),a.jsxs("div",{className:"flex items-start gap-2",children:[a.jsx(Kt,{className:"h-4 w-4 mt-0.5 text-muted-foreground flex-shrink-0"}),a.jsx("span",{className:"text-muted-foreground",children:"Test agent locally in container"})]}),a.jsxs("div",{className:"flex items-start gap-2",children:[a.jsx(Kt,{className:"h-4 w-4 mt-0.5 text-muted-foreground flex-shrink-0"}),a.jsx("span",{className:"text-muted-foreground",children:"Configure logging and monitoring"})]}),a.jsxs("div",{className:"flex items-start gap-2",children:[a.jsx(Kt,{className:"h-4 w-4 mt-0.5 text-muted-foreground flex-shrink-0"}),a.jsx("span",{className:"text-muted-foreground",children:"Set up error handling and retries"})]})]})]})]}),d==="azure"&&a.jsxs("div",{className:"space-y-4 pt-4",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"font-semibold mb-2",children:"Deploy to Azure Container Apps"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:c?"One-click deployment to Azure with automatic containerization and authentication.":"Azure Container Apps provides serverless containers with auto-scaling and integrated monitoring."})]}),a.jsxs("div",{className:"bg-blue-50 dark:bg-blue-950/50 border border-blue-200 dark:border-blue-800 rounded-md p-3",children:[a.jsx("h4",{className:"text-sm font-semibold mb-2 text-blue-900 dark:text-blue-100",children:"Prerequisites for Azure Deployment"}),a.jsxs("ul",{className:"text-xs space-y-1 list-disc list-inside text-blue-800 dark:text-blue-200",children:[a.jsxs("li",{children:["Azure CLI installed and authenticated (",a.jsx("code",{className:"bg-blue-100 dark:bg-blue-900 px-1 rounded",children:"az login"}),")"]}),a.jsx("li",{children:"Docker installed and running"}),a.jsxs("li",{children:["Azure subscription with the following providers registered:",a.jsxs("ul",{className:"ml-4 mt-1 space-y-0.5",children:[a.jsxs("li",{className:"list-none",children:["• ",a.jsx("code",{className:"bg-blue-100 dark:bg-blue-900 px-1 rounded text-xs",children:"Microsoft.App"})," (Container Apps)"]}),a.jsxs("li",{className:"list-none",children:["• ",a.jsx("code",{className:"bg-blue-100 dark:bg-blue-900 px-1 rounded text-xs",children:"Microsoft.ContainerRegistry"})," (ACR)"]}),a.jsxs("li",{className:"list-none",children:["• ",a.jsx("code",{className:"bg-blue-100 dark:bg-blue-900 px-1 rounded text-xs",children:"Microsoft.OperationalInsights"})," (Logging)"]})]})]})]}),a.jsxs("details",{className:"mt-2",children:[a.jsx("summary",{className:"text-xs cursor-pointer hover:underline text-blue-700 dark:text-blue-300",children:"How to register providers?"}),a.jsxs("div",{className:"mt-2 p-2 bg-blue-100 dark:bg-blue-900 rounded text-xs",children:[a.jsx("p",{className:"mb-1",children:"Run these commands once per subscription:"}),a.jsxs("code",{className:"block font-mono",children:["az provider register -n Microsoft.App --wait",a.jsx("br",{}),"az provider register -n Microsoft.ContainerRegistry --wait",a.jsx("br",{}),"az provider register -n Microsoft.OperationalInsights --wait"]})]})]})]}),c&&o&&!S&&a.jsxs("div",{className:"border rounded-lg p-4 space-y-4",children:[y?a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium",children:[a.jsx(go,{className:"h-4 w-4 animate-spin"}),"Deploying..."]}),a.jsx("div",{ref:v,className:"bg-muted p-3 rounded-md text-xs font-mono max-h-60 overflow-y-auto space-y-1",children:b.map((T,B)=>a.jsx("div",{className:T.includes("failed")||T.includes("Error")?"text-red-600":"",children:T},B))})]}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium",children:"Resource Group"}),a.jsx("input",{type:"text",className:"w-full mt-1 px-3 py-2 border rounded-md text-sm",placeholder:"my-test-rg",value:D,onChange:T=>z(T.target.value)})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium",children:"App Name"}),a.jsx("input",{type:"text",className:`w-full mt-1 px-3 py-2 border rounded-md text-sm ${G?"border-red-500":""}`,placeholder:"my-agent-app",value:H,onChange:T=>{const B=T.target.value;U(B);const W=L(B.trim());ne(W)}}),G&&a.jsx("p",{className:"mt-1 text-xs text-red-600",children:G})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium",children:"Region"}),a.jsxs("select",{className:"w-full mt-1 px-3 py-2 border rounded-md text-sm",value:F,onChange:T=>K(T.target.value),children:[a.jsx("option",{value:"eastus",children:"East US"}),a.jsx("option",{value:"westus",children:"West US"}),a.jsx("option",{value:"westeurope",children:"West Europe"}),a.jsx("option",{value:"eastasia",children:"East Asia"})]})]})]}),a.jsxs(Oe,{onClick:V,disabled:!D||!H||!!G,className:"w-full",children:[a.jsx(Ih,{className:"h-4 w-4 mr-2"}),"Deploy to Azure"]})]}),!y&&b.length>0&&!S&&a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-red-600",children:[a.jsx(ws,{className:"h-4 w-4"}),"Deployment Failed"]}),a.jsx("div",{className:"bg-muted p-3 rounded-md text-xs font-mono max-h-60 overflow-y-auto space-y-1",children:b.map((T,B)=>a.jsx("div",{className:T.includes("failed")||T.includes("Error")?"text-red-600":"",children:T},B))}),a.jsx(Oe,{onClick:j,variant:"outline",className:"w-full",children:"Try Again"})]})]}),S&&a.jsxs("div",{className:"border-2 border-green-200 bg-green-50 dark:bg-green-950/50 rounded-lg p-4 space-y-3",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Kt,{className:"h-5 w-5 text-green-600"}),a.jsx("h4",{className:"font-semibold text-green-900 dark:text-green-100",children:"Deployment Successful!"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{children:[a.jsx("label",{className:"text-xs font-medium text-green-800 dark:text-green-200",children:"Deployment URL"}),a.jsxs("div",{className:"flex gap-2 mt-1",children:[a.jsx("code",{className:"flex-1 bg-white dark:bg-gray-900 px-3 py-2 rounded border text-sm",children:S.url}),a.jsx(Oe,{size:"sm",variant:"outline",onClick:()=>window.open(S.url,"_blank"),children:a.jsx(ku,{className:"h-4 w-4"})})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-xs font-medium text-green-800 dark:text-green-200",children:"Auth Token (save this - shown only once)"}),a.jsxs("div",{className:"flex gap-2 mt-1",children:[a.jsx("code",{className:"flex-1 bg-white dark:bg-gray-900 px-3 py-2 rounded border text-sm font-mono",children:S.authToken}),a.jsx(Oe,{size:"sm",variant:"outline",onClick:()=>navigator.clipboard.writeText(S.authToken),children:a.jsx(Js,{className:"h-4 w-4"})})]})]})]}),a.jsx(Oe,{onClick:j,variant:"outline",className:"w-full",children:"Deploy Another"})]}),!c&&o?.deployment_reason&&a.jsx("div",{className:"bg-amber-50 dark:bg-amber-950/50 border border-amber-200 dark:border-amber-800 rounded-md p-3",children:a.jsxs("div",{className:"flex items-start gap-2",children:[a.jsx(ws,{className:"h-4 w-4 mt-0.5 text-amber-600 flex-shrink-0"}),a.jsxs("div",{className:"text-sm text-amber-800 dark:text-amber-200",children:[a.jsx("strong",{children:"Deployment not available:"})," ",o.deployment_reason]})]})}),!c&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"border rounded-lg p-4 space-y-3",children:[a.jsx("h4",{className:"font-medium text-sm",children:"Prerequisites"}),a.jsxs("ul",{className:"text-xs space-y-1 list-disc list-inside text-muted-foreground",children:[a.jsx("li",{children:"Azure subscription"}),a.jsxs("li",{children:["Azure CLI installed (",a.jsx("code",{className:"bg-muted px-1 rounded",children:"az --version"}),")"]}),a.jsx("li",{children:"Docker installed and running"}),a.jsxs("li",{children:["Logged in to Azure:"," ",a.jsx("code",{className:"bg-muted px-1 rounded",children:"az login"})]})]})]}),a.jsxs("div",{className:"space-y-3",children:[a.jsx("h4",{className:"font-medium text-sm",children:"Deployment Steps"}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"border-l-2 border-primary pl-3",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[a.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"}),a.jsx("h5",{className:"font-medium text-sm",children:"Create Azure Container Registry"})]}),a.jsx("pre",{className:"bg-muted p-2 rounded text-xs overflow-x-auto border mt-2",children:`# Create resource group
az group create --name myResourceGroup --location eastus

# Create container registry
az acr create --resource-group myResourceGroup \\
  --name myregistry --sku Basic`})]}),a.jsxs("div",{className:"border-l-2 border-primary pl-3",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[a.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"}),a.jsx("h5",{className:"font-medium text-sm",children:"Build and Push Docker Image"})]}),a.jsx("pre",{className:"bg-muted p-2 rounded text-xs overflow-x-auto border mt-2",children:`# Build and push in one command
az acr build --registry myregistry \\
  --image ${s.toLowerCase()}-agent:latest .`})]}),a.jsxs("div",{className:"border-l-2 border-primary pl-3",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[a.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"}),a.jsx("h5",{className:"font-medium text-sm",children:"Create Container Apps Environment"})]}),a.jsx("pre",{className:"bg-muted p-2 rounded text-xs overflow-x-auto border mt-2",children:`az containerapp env create --name myEnvironment \\
  --resource-group myResourceGroup \\
  --location eastus`})]}),a.jsxs("div",{className:"border-l-2 border-primary pl-3",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[a.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"}),a.jsx("h5",{className:"font-medium text-sm",children:"Deploy Container App"})]}),a.jsx("pre",{className:"bg-muted p-2 rounded text-xs overflow-x-auto border mt-2",children:`az containerapp create --name ${s.toLowerCase()}-app \\
  --resource-group myResourceGroup \\
  --environment myEnvironment \\
  --image myregistry.azurecr.io/${s.toLowerCase()}-agent:latest \\
  --target-port 8080 \\
  --ingress 'external' \\
  --registry-server myregistry.azurecr.io \\
  --env-vars OPENAI_API_KEY=secretref:openai-key OPENAI_CHAT_MODEL_ID=gpt-4o-mini`})]}),a.jsxs("div",{className:"border-l-2 border-primary pl-3",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[a.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"}),a.jsx("h5",{className:"font-medium text-sm",children:"Get Application URL"})]}),a.jsx("pre",{className:"bg-muted p-2 rounded text-xs overflow-x-auto border mt-2",children:`az containerapp show --name ${s.toLowerCase()}-app \\
  --resource-group myResourceGroup \\
  --query properties.configuration.ingress.fqdn`})]})]})]}),a.jsxs("div",{className:"bg-blue-50 dark:bg-blue-950/50 border border-blue-200 dark:border-blue-800 rounded-md p-3",children:[a.jsx("h4",{className:"text-sm font-semibold mb-2",children:"Learn More"}),a.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."}),a.jsx(Oe,{size:"sm",variant:"outline",className:"w-full",asChild:!0,children:a.jsxs("a",{href:"https://learn.microsoft.com/azure/container-apps/",target:"_blank",rel:"noopener noreferrer",children:[a.jsx(ku,{className:"h-3 w-3 mr-1"}),"View Azure Container Apps Documentation"]})})]})]})]})]})})})]})})}function O2({className:e,...n}){return a.jsx("div",{"data-slot":"card",className:Ge("bg-card text-card-foreground flex flex-col gap-6 rounded border py-6 shadow-sm",e),...n})}function z2({className:e,...n}){return a.jsx("div",{"data-slot":"card-header",className:Ge("@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),...n})}function Qp({className:e,...n}){return a.jsx("div",{"data-slot":"card-title",className:Ge("leading-none font-semibold",e),...n})}function k5({className:e,...n}){return a.jsx("div",{"data-slot":"card-description",className:Ge("text-muted-foreground text-sm",e),...n})}function I2({className:e,...n}){return a.jsx("div",{"data-slot":"card-content",className:Ge("px-6",e),...n})}function A5({className:e,...n}){return a.jsx("div",{"data-slot":"card-footer",className:Ge("flex items-center px-6 [.border-t]:pt-6",e),...n})}const gs=[{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"]}];gs.filter(e=>e.type==="agent"),gs.filter(e=>e.type==="workflow"),gs.filter(e=>e.difficulty==="beginner"),gs.filter(e=>e.difficulty==="intermediate"),gs.filter(e=>e.difficulty==="advanced");const M5=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"}},L2=w.forwardRef(({className:e,...n},s)=>a.jsx("div",{ref:s,role:"alert",className:Ge("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),...n}));L2.displayName="Alert";const H2=w.forwardRef(({className:e,...n},s)=>a.jsx("h5",{ref:s,className:Ge("mb-1 font-medium leading-none tracking-tight",e),...n}));H2.displayName="AlertTitle";const $2=w.forwardRef(({className:e,...n},s)=>a.jsx("div",{ref:s,className:Ge("text-sm [&_p]:leading-relaxed",e),...n}));$2.displayName="AlertDescription";function B2({children:e,copyable:n=!1}){const[s,o]=w.useState(!1),l=()=>{navigator.clipboard.writeText(e),o(!0),setTimeout(()=>o(!1),2e3)};return a.jsxs("div",{className:"relative",children:[a.jsx("pre",{className:"bg-muted p-3 rounded-md text-sm overflow-x-auto font-mono",children:a.jsx("code",{children:e})}),n&&a.jsx(Oe,{variant:"ghost",size:"sm",className:"absolute top-2 right-2 h-6 w-6 p-0",onClick:l,children:s?a.jsx(Ea,{className:"h-3 w-3"}):a.jsx(Js,{className:"h-3 w-3"})})]})}function Wc({number:e,title:n,description:s,code:o,action:l,copyable:c=!1}){return a.jsxs("div",{className:"flex gap-4",children:[a.jsx("div",{className:"flex-shrink-0",children:a.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-full bg-primary text-primary-foreground font-semibold",children:e})}),a.jsxs("div",{className:"flex-1 space-y-2",children:[a.jsx("h4",{className:"font-semibold",children:n}),s&&a.jsx("p",{className:"text-sm text-muted-foreground",children:s}),o&&a.jsx(B2,{copyable:c,children:o}),l&&a.jsx("div",{children:l})]})]})}function T5({sample:e,open:n,onOpenChange:s}){const o=e.requiredEnvVars&&e.requiredEnvVars.length>0,l=o?0:-1;return a.jsx(js,{open:n,onOpenChange:s,children:a.jsxs(_s,{className:"max-w-3xl",children:[a.jsxs(Es,{className:"px-6 pt-6 pb-2",children:[a.jsxs(Cs,{children:["Setup: ",e.name]}),a.jsxs(w2,{children:["Follow these steps to run this sample ",e.type," locally"]})]}),a.jsx("div",{className:"px-6 pb-6",children:a.jsx(Ss,{className:"h-[500px]",children:a.jsxs("div",{className:"space-y-6 pr-4",children:[a.jsx(Wc,{number:1,title:"Download the sample file",action:a.jsx(Oe,{asChild:!0,size:"sm",children:a.jsxs("a",{href:e.url,download:`${e.id}.py`,target:"_blank",rel:"noopener noreferrer",children:[a.jsx(Cu,{className:"h-4 w-4 mr-2"}),"Download ",e.id,".py"]})})}),a.jsx(Wc,{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}
mv ~/Downloads/${e.id}.py ~/my-agents/${e.id}/`,copyable:!0}),o&&a.jsx(Wc,{number:3,title:"Set up environment variables",description:"Create a .env file in the project folder with these required variables:",code:e.requiredEnvVars.map(c=>`${c.name}=${c.example||"your-value-here"}
# ${c.description}`).join(`

`),copyable:!0}),a.jsx(Wc,{number:4+l,title:"Run with DevUI",description:"Navigate to the folder and start DevUI:",code:`cd ~/my-agents/${e.id}
devui .`,copyable:!0}),a.jsxs(L2,{children:[a.jsx(yM,{className:"h-4 w-4"}),a.jsx(H2,{children:"Alternative: Run Programmatically"}),a.jsxs($2,{className:"mt-2",children:[a.jsxs("p",{className:"mb-2",children:["You can also run the ",e.type," directly in Python:"]}),a.jsx(B2,{copyable:!0,children:`from ${e.id} import ${e.type}
import asyncio

async def main():
    response = await ${e.type}.run("Hello!")
    print(response)

asyncio.run(main())`})]})]}),a.jsxs("div",{className:"flex gap-2 pt-4 border-t",children:[a.jsx(Oe,{variant:"outline",size:"sm",asChild:!0,children:a.jsxs("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",children:[a.jsx(ku,{className:"h-4 w-4 mr-2"}),"View Source"]})}),a.jsx(Oe,{variant:"outline",size:"sm",asChild:!0,children:a.jsxs("a",{href:"https://github.com/microsoft/agent-framework#readme",target:"_blank",rel:"noopener noreferrer",children:[a.jsx(I1,{className:"h-4 w-4 mr-2"}),"Documentation"]})})]})]})})})]})})}function R5({sample:e}){const[n,s]=w.useState(!1),o=e.type==="workflow"?Rr:rr;return a.jsxs(a.Fragment,{children:[a.jsxs(O2,{className:"hover:shadow-md transition-shadow duration-200 h-full flex flex-col overflow-hidden w-full",children:[a.jsxs(z2,{className:"pb-3 min-w-0",children:[a.jsxs("div",{className:"flex items-start justify-between mb-2",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(o,{className:"h-5 w-5"}),a.jsx(Qt,{variant:"secondary",className:"text-xs",children:e.type})]}),a.jsx(Qt,{variant:"outline",className:Ge("text-xs border",M5(e.difficulty)),children:e.difficulty})]}),a.jsx(Qp,{className:"text-lg leading-tight",children:e.name}),a.jsx(k5,{className:"text-sm line-clamp-3",children:e.description})]}),a.jsx(I2,{className:"pt-0 flex-1 min-w-0 overflow-hidden",children:a.jsxs("div",{className:"space-y-3 min-w-0",children:[a.jsxs("div",{className:"flex flex-wrap gap-1",children:[e.tags.slice(0,3).map(l=>a.jsx(Qt,{variant:"outline",className:"text-xs",children:l},l)),e.tags.length>3&&a.jsxs(Qt,{variant:"outline",className:"text-xs",children:["+",e.tags.length-3]})]}),e.requiredEnvVars&&e.requiredEnvVars.length>0&&a.jsxs("details",{className:"group min-w-0 max-w-full overflow-hidden",children:[a.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:[a.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[a.jsx(gM,{className:"h-3.5 w-3.5 text-amber-600 dark:text-amber-500 flex-shrink-0"}),a.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":""]})]}),a.jsx(Xt,{className:"h-3 w-3 text-amber-600 dark:text-amber-500 flex-shrink-0 group-open:rotate-180 transition-transform"})]}),a.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=>a.jsxs("div",{className:"text-xs min-w-0 max-w-full overflow-hidden",children:[a.jsx("div",{className:"font-mono font-medium text-amber-900 dark:text-amber-100 break-words",children:l.name}),a.jsx("div",{className:"text-amber-700 dark:text-amber-300 mt-0.5 break-words",children:l.description}),l.example&&a.jsx("div",{className:"font-mono text-amber-600 dark:text-amber-400 mt-0.5 break-all",children:l.example})]},l.name))})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("div",{className:"text-xs font-medium text-muted-foreground",children:"Key Features:"}),a.jsx("ul",{className:"text-xs space-y-1",children:e.features.slice(0,3).map(l=>a.jsxs("li",{className:"flex items-center gap-1",children:[a.jsx("div",{className:"w-1 h-1 rounded-full bg-current opacity-50"}),a.jsx("span",{children:l})]},l))})]})]})}),a.jsxs(A5,{className:"pt-3 flex-col gap-3",children:[a.jsx("div",{className:"w-full flex items-center justify-between text-xs text-muted-foreground",children:a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(q1,{className:"h-3 w-3"}),a.jsx("span",{children:e.author})]})}),a.jsxs("div",{className:"w-full flex gap-2",children:[a.jsx(Oe,{asChild:!0,className:"flex-1",size:"sm",children:a.jsxs("a",{href:e.url,download:`${e.id}.py`,target:"_blank",rel:"noopener noreferrer",children:[a.jsx(Cu,{className:"h-4 w-4 mr-2"}),"Download"]})}),a.jsxs(Oe,{variant:"outline",className:"flex-1",size:"sm",onClick:()=>s(!0),children:[a.jsx(I1,{className:"h-4 w-4 mr-2"}),"Setup Guide"]})]})]})]}),a.jsx(T5,{sample:e,open:n,onOpenChange:s})]})}function lh({samples:e}){return a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4",children:e.map(n=>a.jsx("div",{className:"min-w-0",children:a.jsx(R5,{sample:n})},n.id))})}function Pv({onClose:e,variant:n="inline",hasExistingEntities:s=!1}){return n==="inline"?a.jsx("div",{className:"flex-1 overflow-auto",children:a.jsxs("div",{className:"max-w-7xl mx-auto px-6 py-8",children:[a.jsx("div",{className:"mb-8 p-4 bg-muted/50 border border-border rounded-lg",children:a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx(nT,{className:"h-5 w-5 text-amber-500 flex-shrink-0 mt-0.5"}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h3",{className:"font-semibold mb-1",children:"No agents or workflows configured yet!"}),a.jsxs("p",{className:"text-sm text-muted-foreground mb-2",children:["You can configure agents or workflows by running"," ",a.jsx("code",{className:"px-1.5 py-0.5 bg-background rounded text-xs",children:"devui"})," ","in a directory containing them."]}),a.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."})]})]})}),a.jsxs("div",{className:"mb-6",children:[a.jsx("h3",{className:"text-lg font-semibold mb-4",children:"Sample Gallery"}),a.jsx(lh,{samples:gs})]}),a.jsx("div",{className:"text-center mt-12 pt-8 border-t",children:a.jsxs("p",{className:"text-sm text-muted-foreground",children:["Want to create your own agents or workflows? Check out the"," ",a.jsx("a",{href:"https://github.com/microsoft/agent-framework",className:"text-primary hover:underline",target:"_blank",rel:"noopener noreferrer",children:"documentation"})]})})]})}):n==="route"?a.jsx("div",{className:"h-full overflow-auto",children:a.jsxs("div",{className:"max-w-7xl mx-auto px-6 py-8",children:[a.jsxs("div",{className:"mb-8",children:[s&&a.jsx("div",{className:"mb-4",children:a.jsxs(Oe,{variant:"ghost",onClick:e,className:"gap-2",children:[a.jsx(MA,{className:"h-4 w-4"}),"Back"]})}),a.jsxs("div",{className:"text-center",children:[a.jsx("h2",{className:"text-2xl font-semibold mb-2",children:"Sample Gallery"}),a.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."})]})]}),a.jsx(lh,{samples:gs}),a.jsx("div",{className:"text-center mt-12 pt-8 border-t",children:a.jsxs("p",{className:"text-sm text-muted-foreground",children:["Want to create your own agents or workflows? Check out the"," ",a.jsx("a",{href:"https://github.com/microsoft/agent-framework",className:"text-primary hover:underline",target:"_blank",rel:"noopener noreferrer",children:"documentation"})]})})]})}):a.jsx(lh,{samples:gs})}function to({className:e,...n}){return a.jsx("textarea",{"data-slot":"textarea",className:Ge("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),...n})}function D5({onFilesSelected:e,accept:n="image/*,.pdf,audio/*,.wav,.mp3,.m4a,.ogg",multiple:s=!0,maxSize:o=50*1024*1024,disabled:l=!1,className:c=""}){const d=w.useRef(null),f=y=>{if(!y||y.length===0)return;const b=[],S=[];Array.from(y).forEach(N=>{if(N.size>o){S.push(`${N.name} is too large (max ${O5(o)})`);return}if(n&&!z5(N,n)){S.push(`${N.name} is not an accepted file type`);return}b.push(N)}),S.length>0&&console.warn("File upload errors:",S),b.length>0&&e(b)},m=()=>{d.current&&d.current.click()},p=y=>{f(y.target.files),y.target.value=""},g=y=>{if(y.preventDefault(),y.stopPropagation(),l)return;const b=y.dataTransfer.files;f(b)},v=y=>{y.preventDefault(),y.stopPropagation()};return a.jsxs("div",{className:c,children:[a.jsx("input",{ref:d,type:"file",accept:n,multiple:s,onChange:p,className:"hidden",disabled:l}),a.jsx(Oe,{type:"button",variant:"outline",size:"icon",onClick:m,disabled:l,onDrop:g,onDragOver:v,className:"shrink-0 transition-colors hover:bg-muted",title:"Upload files (images, PDFs, audio)",children:a.jsx(sT,{className:"h-4 w-4"})})]})}function O5(e){if(e===0)return"0 Bytes";const n=1024,s=["Bytes","KB","MB","GB"],o=Math.floor(Math.log(e)/Math.log(n));return parseFloat((e/Math.pow(n,o)).toFixed(2))+" "+s[o]}function z5(e,n){return n.split(",").map(o=>o.trim()).some(o=>{if(o.startsWith("."))return e.name.toLowerCase().endsWith(o.toLowerCase());if(o.includes("/*")){const[l]=o.split("/");return e.type.startsWith(l+"/")}else return e.type===o})}function I5({attachments:e,onRemoveAttachment:n,className:s=""}){return e.length===0?null:a.jsx("div",{className:`flex flex-wrap gap-2 p-2 bg-muted rounded-lg ${s}`,children:e.map(o=>a.jsx(L5,{attachment:o,onRemove:()=>n(o.id)},o.id))})}function L5({attachment:e,onRemove:n}){const[s,o]=w.useState(!1),l=()=>{switch(e.type){case"image":return e.preview?a.jsx("img",{src:e.preview,alt:e.file.name,className:"w-full h-full object-cover"}):a.jsx("div",{className:"flex items-center justify-center w-full h-full bg-gray-200",children:a.jsx(mM,{className:"h-6 w-6 text-gray-400"})});case"pdf":return a.jsxs("div",{className:"flex flex-col items-center justify-center w-full h-full bg-red-50",children:[a.jsx(Ns,{className:"h-6 w-6 text-red-500 mb-1"}),a.jsx("span",{className:"text-xs text-red-600",children:"PDF"})]});case"audio":return a.jsxs("div",{className:"flex flex-col items-center justify-center w-full h-full bg-purple-50",children:[a.jsx(U1,{className:"h-6 w-6 text-purple-500 mb-1"}),a.jsx("span",{className:"text-xs text-purple-600",children:"AUDIO"})]});default:return a.jsxs("div",{className:"flex flex-col items-center justify-center w-full h-full bg-gray-100",children:[a.jsx(Ns,{className:"h-6 w-6 text-gray-500 mb-1"}),a.jsx("span",{className:"text-xs text-gray-600",children:"FILE"})]})}};return a.jsxs("div",{className:"relative w-16 h-16 rounded border overflow-hidden group cursor-pointer",onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),title:e.file.name,children:[l(),a.jsx("div",{className:`absolute inset-0 bg-black/60 flex items-center justify-center transition-all duration-200 ease-in-out ${s?"opacity-100 backdrop-blur-sm":"opacity-0 pointer-events-none"}`,onClick:n,children:a.jsx("div",{className:`transition-all duration-200 ease-in-out ${s?"scale-100 opacity-100":"scale-75 opacity-0"}`,children:a.jsx(Lp,{className:"h-5 w-5 text-white drop-shadow-lg"})})}),a.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 H5({code:e,language:n}){const[s,o]=w.useState(!1),l=w.useRef(null);w.useEffect(()=>()=>{l.current&&clearTimeout(l.current)},[]);const c=async()=>{try{await navigator.clipboard.writeText(e),o(!0),l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{o(!1),l.current=null},2e3)}catch(d){console.error("Failed to copy code:",d)}};return a.jsxs("div",{className:"relative group",children:[a.jsx("pre",{className:"my-3 p-3 bg-foreground/5 dark:bg-foreground/10 rounded overflow-x-auto border border-foreground/10",children:a.jsxs("code",{className:"text-xs font-mono block whitespace-pre-wrap break-words",children:[n&&a.jsx("span",{className:"opacity-60 text-[10px] mb-1 block uppercase",children:n}),e]})}),a.jsx("button",{onClick:c,className:`absolute top-2 right-2 p-1.5 rounded-md border shadow-sm
                   bg-background hover:bg-accent
                   text-muted-foreground hover:text-foreground
                   transition-all duration-200
                   opacity-0 group-hover:opacity-100`,title:s?"Copied!":"Copy code",children:s?a.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:a.jsx("polyline",{points:"20 6 9 17 4 12"})}):a.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:[a.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),a.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})})]})}function $5({content:e,className:n=""}){const s=e.split(`
`),o=[];let l=0;for(;l<s.length;){const c=s[l];if(c.trim().startsWith("```")){const f=[],p=c.trim().match(/^```(\w+)?/)?.[1]||"";for(l++;l<s.length&&!s[l].trim().startsWith("```");)f.push(s[l]),l++;l++,o.push(a.jsx(H5,{code:f.join(`
`),language:p},o.length));continue}const d=c.match(/^(#{1,6})\s+(.+)$/);if(d){const f=d[1].length,m=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`,v=f===1?a.jsx("h1",{className:g,children:pn(m)},o.length):f===2?a.jsx("h2",{className:g,children:pn(m)},o.length):f===3?a.jsx("h3",{className:g,children:pn(m)},o.length):f===4?a.jsx("h4",{className:g,children:pn(m)},o.length):f===5?a.jsx("h5",{className:g,children:pn(m)},o.length):a.jsx("h6",{className:g,children:pn(m)},o.length);o.push(v),l++;continue}if(c.match(/^[\s]*[-*+]\s+/)){const f=[];for(;l<s.length&&s[l].match(/^[\s]*[-*+]\s+/);){const m=s[l].replace(/^[\s]*[-*+]\s+/,"");f.push(m),l++}o.push(a.jsx("ul",{className:"my-2 ml-4 list-disc space-y-1 break-words",children:f.map((m,p)=>a.jsx("li",{className:"text-sm break-words",children:pn(m)},p))},o.length));continue}if(c.match(/^[\s]*\d+\.\s+/)){const f=[];for(;l<s.length&&s[l].match(/^[\s]*\d+\.\s+/);){const m=s[l].replace(/^[\s]*\d+\.\s+/,"");f.push(m),l++}o.push(a.jsx("ol",{className:"my-2 ml-4 list-decimal space-y-1 break-words",children:f.map((m,p)=>a.jsx("li",{className:"text-sm break-words",children:pn(m)},p))},o.length));continue}if(c.trim().startsWith("|")&&c.trim().endsWith("|")){const f=[];for(;l<s.length&&s[l].trim().startsWith("|")&&s[l].trim().endsWith("|");)f.push(s[l].trim()),l++;if(f.length>=2){const m=f[0].split("|").slice(1,-1).map(g=>g.trim());if(f[1].match(/^\|[\s\-:|]+\|$/)){const g=f.slice(2).map(v=>v.split("|").slice(1,-1).map(y=>y.trim()));o.push(a.jsx("div",{className:"my-3 overflow-x-auto",children:a.jsxs("table",{className:"min-w-full border border-foreground/10 text-sm",children:[a.jsx("thead",{className:"bg-foreground/5",children:a.jsx("tr",{children:m.map((v,y)=>a.jsx("th",{className:"border-b border-foreground/10 px-3 py-2 text-left font-semibold break-words",children:pn(v)},y))})}),a.jsx("tbody",{children:g.map((v,y)=>a.jsx("tr",{className:"border-b border-foreground/5 last:border-b-0",children:v.map((b,S)=>a.jsx("td",{className:"px-3 py-2 border-r border-foreground/5 last:border-r-0 break-words",children:pn(b)},S))},y))})]})},o.length));continue}}for(const m of f)o.push(a.jsx("p",{className:"my-1",children:pn(m)},o.length));continue}if(c.trim().startsWith(">")){const f=[];for(;l<s.length&&s[l].trim().startsWith(">");)f.push(s[l].replace(/^>\s?/,"")),l++;o.push(a.jsx("blockquote",{className:"my-2 pl-4 border-l-4 border-current/30 opacity-80 italic break-words",children:f.map((m,p)=>a.jsx("div",{className:"break-words",children:pn(m)},p))},o.length));continue}if(c.match(/^[\s]*[-*_]{3,}[\s]*$/)){o.push(a.jsx("hr",{className:"my-4 border-t border-border"},o.length)),l++;continue}if(c.trim()===""){o.push(a.jsx("div",{className:"h-2"},o.length)),l++;continue}o.push(a.jsx("p",{className:"my-1 break-words",children:pn(c)},o.length)),l++}return a.jsx("div",{className:`markdown-content break-words ${n}`,children:o})}function pn(e){const n=[];let s=e,o=0;for(;s.length>0;){const l=s.match(/`([^`]+)`/);if(l&&l.index!==void 0){l.index>0&&n.push(a.jsx("span",{children:qi(s.slice(0,l.index))},o++)),n.push(a.jsx("code",{className:"px-1.5 py-0.5 bg-foreground/10 rounded text-xs font-mono border border-foreground/20",children:l[1]},o++)),s=s.slice(l.index+l[0].length);continue}n.push(a.jsx("span",{children:qi(s)},o++));break}return n}function qi(e){const n=[];let s=e,o=0;for(;s.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 c=!1;for(const d of l){const f=s.match(d.regex);if(f&&f.index!==void 0){if(f.index>0&&n.push(s.slice(0,f.index)),d.component==="strong")n.push(a.jsx("strong",{className:"font-semibold",children:f[1]},o++));else if(d.component==="em")n.push(a.jsx("em",{className:"italic",children:f[1]},o++));else if(d.component==="strong-link"){const m=f[1],p=f[2],g=qi(m);n.push(a.jsx("strong",{className:"font-semibold",children:a.jsx("a",{href:p,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline break-words",children:g})},o++))}else if(d.component==="em-link"){const m=f[1],p=f[2],g=qi(m);n.push(a.jsx("em",{className:"italic",children:a.jsx("a",{href:p,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline break-words",children:g})},o++))}else if(d.component==="link"){const m=f[1],p=f[2],g=qi(m);n.push(a.jsx("a",{href:p,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline break-words",children:g},o++))}s=s.slice(f.index+f[0].length),c=!0;break}}if(!c){s.length>0&&n.push(s);break}}return n}function B5({content:e,className:n,isStreaming:s}){if(e.type!=="text"&&e.type!=="input_text"&&e.type!=="output_text")return null;const o=e.text;return a.jsxs("div",{className:`break-words ${n||""}`,children:[a.jsx($5,{content:o}),s&&o.length>0&&a.jsx("span",{className:"ml-1 inline-block h-2 w-2 animate-pulse rounded-full bg-current"})]})}function P5({content:e,className:n}){const[s,o]=w.useState(!1),[l,c]=w.useState(!1);if(e.type!=="input_image"&&e.type!=="output_image")return null;const d=e.image_url;return s?a.jsx("div",{className:`my-2 p-3 border rounded-lg bg-muted ${n||""}`,children:a.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[a.jsx(Ns,{className:"h-4 w-4"}),a.jsx("span",{children:"Image could not be loaded"})]})}):a.jsxs("div",{className:`my-2 ${n||""}`,children:[a.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:()=>c(!l),onError:()=>o(!0)}),l&&a.jsx("div",{className:"text-xs text-muted-foreground mt-1",children:"Click to collapse"})]})}function U5({content:e,className:n}){if(e.type!=="input_file"&&e.type!=="output_file")return null;const s=e.file_url||e.file_data,o=e.filename||"file",l=o?.toLowerCase().endsWith(".pdf")||s?.includes("application/pdf"),c=o?.toLowerCase().match(/\.(mp3|wav|m4a|ogg|flac|aac)$/);return l&&s?a.jsxs("div",{className:`my-2 ${n||""}`,children:[a.jsx("div",{className:"border rounded-lg overflow-hidden",children:a.jsx("iframe",{src:s,className:"w-full h-96",title:o})}),a.jsxs("div",{className:"flex items-center gap-2 mt-2",children:[a.jsx(Ns,{className:"h-4 w-4 text-muted-foreground"}),a.jsx("span",{className:"text-sm text-muted-foreground",children:o}),s&&a.jsxs("a",{href:s,download:o,className:"ml-auto text-xs text-primary hover:underline flex items-center gap-1",children:[a.jsx(Cu,{className:"h-3 w-3"}),"Download"]})]})]}):c&&s?a.jsxs("div",{className:`my-2 p-3 border rounded-lg ${n||""}`,children:[a.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[a.jsx(U1,{className:"h-4 w-4 text-muted-foreground"}),a.jsx("span",{className:"text-sm font-medium",children:o})]}),a.jsxs("audio",{controls:!0,className:"w-full",children:[a.jsx("source",{src:s}),"Your browser does not support audio playback."]})]}):a.jsx("div",{className:`my-2 p-3 border rounded-lg bg-muted ${n||""}`,children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Ns,{className:"h-4 w-4 text-muted-foreground"}),a.jsx("span",{className:"text-sm",children:o})]}),s&&a.jsxs("a",{href:s,download:o,className:"text-xs text-primary hover:underline flex items-center gap-1",children:[a.jsx(Cu,{className:"h-3 w-3"}),"Download"]})]})})}function V5({content:e,className:n}){const[s,o]=w.useState(!1);if(e.type!=="output_data")return null;const l=e.data,c=e.mime_type,d=e.description;let f=l;try{const m=JSON.parse(l);f=JSON.stringify(m,null,2)}catch{}return a.jsxs("div",{className:`my-2 p-3 border rounded-lg bg-muted ${n||""}`,children:[a.jsxs("div",{className:"flex items-center gap-2 cursor-pointer",onClick:()=>o(!s),children:[a.jsx(Ns,{className:"h-4 w-4 text-muted-foreground"}),a.jsx("span",{className:"text-sm font-medium",children:d||"Data Output"}),a.jsx("span",{className:"text-xs text-muted-foreground ml-auto",children:c}),s?a.jsx(Xt,{className:"h-4 w-4 text-muted-foreground"}):a.jsx(Un,{className:"h-4 w-4 text-muted-foreground"})]}),s&&a.jsx("pre",{className:"mt-2 text-xs overflow-auto max-h-64 bg-background p-2 rounded border font-mono",children:f})]})}function q5({content:e,className:n}){if(e.type!=="function_approval_request")return null;const[s,o]=w.useState(!1),{status:l,function_call:c}=e,f={pending:{icon:GA,color:"amber",label:"Awaiting Approval",bgClass:"bg-amber-50 dark:bg-amber-950/20",borderClass:"border-amber-200 dark:border-amber-800",iconClass:"text-amber-600 dark:text-amber-400",textClass:"text-amber-800 dark:text-amber-300"},approved:{icon:Ea,color:"green",label:"Approved",bgClass:"bg-green-50 dark:bg-green-950/20",borderClass:"border-green-200 dark:border-green-800",iconClass:"text-green-600 dark:text-green-400",textClass:"text-green-800 dark:text-green-300"},rejected:{icon:Ji,color:"red",label:"Rejected",bgClass:"bg-red-50 dark:bg-red-950/20",borderClass:"border-red-200 dark:border-red-800",iconClass:"text-red-600 dark:text-red-400",textClass:"text-red-800 dark:text-red-300"}}[l],m=f.icon;let p;try{p=typeof c.arguments=="string"?JSON.parse(c.arguments):c.arguments}catch{p=c.arguments}return a.jsxs("div",{className:`my-2 p-3 border rounded ${f.bgClass} ${f.borderClass} ${n||""}`,children:[a.jsxs("div",{className:"flex items-center gap-2 cursor-pointer",onClick:()=>o(!s),children:[a.jsx(m,{className:`h-4 w-4 ${f.iconClass}`}),a.jsxs("span",{className:`text-sm font-medium ${f.textClass}`,children:[f.label,": ",c.name]}),s?a.jsx(Xt,{className:`h-4 w-4 ${f.iconClass} ml-auto`}):a.jsx(Un,{className:`h-4 w-4 ${f.iconClass} ml-auto`})]}),s&&a.jsxs("div",{className:"mt-2 text-xs font-mono bg-white dark:bg-gray-900 p-2 rounded border",children:[a.jsx("div",{className:`${f.textClass} mb-1`,children:"Arguments:"}),a.jsx("pre",{className:"whitespace-pre-wrap",children:JSON.stringify(p,null,2)})]})]})}function F5({content:e,className:n,isStreaming:s}){switch(e.type){case"text":case"input_text":case"output_text":return a.jsx(B5,{content:e,className:n,isStreaming:s});case"input_image":case"output_image":return a.jsx(P5,{content:e,className:n});case"input_file":case"output_file":return a.jsx(U5,{content:e,className:n});case"output_data":return a.jsx(V5,{content:e,className:n});case"function_approval_request":return a.jsx(q5,{content:e,className:n});default:return null}}function Y5({name:e,arguments:n,className:s}){const[o,l]=w.useState(!1);let c;try{c=typeof n=="string"?JSON.parse(n):n}catch{c=n}return a.jsxs("div",{className:`my-2 p-3 border rounded bg-blue-50 dark:bg-blue-950/20 ${s||""}`,children:[a.jsxs("div",{className:"flex items-center gap-2 cursor-pointer",onClick:()=>l(!o),children:[a.jsx(H1,{className:"h-4 w-4 text-blue-600 dark:text-blue-400"}),a.jsxs("span",{className:"text-sm font-medium text-blue-800 dark:text-blue-300",children:["Function Call: ",e]}),o?a.jsx(Xt,{className:"h-4 w-4 text-blue-600 dark:text-blue-400 ml-auto"}):a.jsx(Un,{className:"h-4 w-4 text-blue-600 dark:text-blue-400 ml-auto"})]}),o&&a.jsxs("div",{className:"mt-2 text-xs font-mono bg-white dark:bg-gray-900 p-2 rounded border",children:[a.jsx("div",{className:"text-blue-600 dark:text-blue-400 mb-1",children:"Arguments:"}),a.jsx("pre",{className:"whitespace-pre-wrap",children:JSON.stringify(c,null,2)})]})]})}function G5({output:e,call_id:n,className:s}){const[o,l]=w.useState(!1);let c;try{c=typeof e=="string"?JSON.parse(e):e}catch{c=e}return a.jsxs("div",{className:`my-2 p-3 border rounded bg-green-50 dark:bg-green-950/20 ${s||""}`,children:[a.jsxs("div",{className:"flex items-center gap-2 cursor-pointer",onClick:()=>l(!o),children:[a.jsx(H1,{className:"h-4 w-4 text-green-600 dark:text-green-400"}),a.jsx("span",{className:"text-sm font-medium text-green-800 dark:text-green-300",children:"Function Result"}),o?a.jsx(Xt,{className:"h-4 w-4 text-green-600 dark:text-green-400 ml-auto"}):a.jsx(Un,{className:"h-4 w-4 text-green-600 dark:text-green-400 ml-auto"})]}),o&&a.jsxs("div",{className:"mt-2 text-xs font-mono bg-white dark:bg-gray-900 p-2 rounded border",children:[a.jsx("div",{className:"text-green-600 dark:text-green-400 mb-1",children:"Output:"}),a.jsx("pre",{className:"whitespace-pre-wrap",children:JSON.stringify(c,null,2)}),a.jsxs("div",{className:"text-gray-500 text-[10px] mt-2",children:["Call ID: ",n]})]})]})}function Uv({item:e,className:n}){if(e.type==="message"){const s=e.status==="in_progress",o=e.content.length>0;return a.jsxs("div",{className:n,children:[e.content.map((l,c)=>a.jsx(F5,{content:l,className:c>0?"mt-2":"",isStreaming:s},c)),s&&!o&&a.jsx("div",{className:"flex items-center space-x-1",children:a.jsxs("div",{className:"flex space-x-1",children:[a.jsx("div",{className:"h-2 w-2 animate-bounce rounded-full bg-current [animation-delay:-0.3s]"}),a.jsx("div",{className:"h-2 w-2 animate-bounce rounded-full bg-current [animation-delay:-0.15s]"}),a.jsx("div",{className:"h-2 w-2 animate-bounce rounded-full bg-current"})]})})]})}return e.type==="function_call"?a.jsx(Y5,{name:e.name,arguments:e.arguments,className:n}):e.type==="function_call_output"?a.jsx(G5,{output:e.output,call_id:e.call_id,className:n}):null}var P2=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"}),X5="VisuallyHidden",Z5=w.forwardRef((e,n)=>a.jsx(Pe.span,{...e,ref:n,style:{...P2,...e.style}}));Z5.displayName=X5;var W5=[" ","Enter","ArrowUp","ArrowDown"],K5=[" ","Enter"],lo="Select",[id,ld,Q5]=mp(lo),[ka,EI]=ir(lo,[Q5,Zu]),cd=Zu(),[J5,ks]=ka(lo),[eR,tR]=ka(lo),U2=e=>{const{__scopeSelect:n,children:s,open:o,defaultOpen:l,onOpenChange:c,value:d,defaultValue:f,onValueChange:m,dir:p,name:g,autoComplete:v,disabled:y,required:b,form:S}=e,N=cd(n),[_,E]=w.useState(null),[M,j]=w.useState(null),[k,R]=w.useState(!1),D=ml(p),[z,H]=so({prop:o,defaultProp:l??!1,onChange:c,caller:lo}),[U,F]=so({prop:d,defaultProp:f,onChange:m,caller:lo}),K=w.useRef(null),G=_?S||!!_.closest("form"):!0,[ne,L]=w.useState(new Set),V=Array.from(ne).map(A=>A.props.value).join(";");return a.jsx(Iw,{...N,children:a.jsxs(J5,{required:b,scope:n,trigger:_,onTriggerChange:E,valueNode:M,onValueNodeChange:j,valueNodeHasChildren:k,onValueNodeHasChildrenChange:R,contentId:oo(),value:U,onValueChange:F,open:z,onOpenChange:H,dir:D,triggerPointerDownPosRef:K,disabled:y,children:[a.jsx(id.Provider,{scope:n,children:a.jsx(eR,{scope:e.__scopeSelect,onNativeOptionAdd:w.useCallback(A=>{L(I=>new Set(I).add(A))},[]),onNativeOptionRemove:w.useCallback(A=>{L(I=>{const $=new Set(I);return $.delete(A),$})},[]),children:s})}),G?a.jsxs(uN,{"aria-hidden":!0,required:b,tabIndex:-1,name:g,autoComplete:v,value:U,onChange:A=>F(A.target.value),disabled:y,form:S,children:[U===void 0?a.jsx("option",{value:""}):null,Array.from(ne)]},V):null]})})};U2.displayName=lo;var V2="SelectTrigger",q2=w.forwardRef((e,n)=>{const{__scopeSelect:s,disabled:o=!1,...l}=e,c=cd(s),d=ks(V2,s),f=d.disabled||o,m=nt(n,d.onTriggerChange),p=ld(s),g=w.useRef("touch"),[v,y,b]=fN(N=>{const _=p().filter(j=>!j.disabled),E=_.find(j=>j.value===d.value),M=mN(_,N,E);M!==void 0&&d.onValueChange(M.value)}),S=N=>{f||(d.onOpenChange(!0),b()),N&&(d.triggerPointerDownPosRef.current={x:Math.round(N.pageX),y:Math.round(N.pageY)})};return a.jsx(Lw,{asChild:!0,...c,children:a.jsx(Pe.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":dN(d.value)?"":void 0,...l,ref:m,onClick:Te(l.onClick,N=>{N.currentTarget.focus(),g.current!=="mouse"&&S(N)}),onPointerDown:Te(l.onPointerDown,N=>{g.current=N.pointerType;const _=N.target;_.hasPointerCapture(N.pointerId)&&_.releasePointerCapture(N.pointerId),N.button===0&&N.ctrlKey===!1&&N.pointerType==="mouse"&&(S(N),N.preventDefault())}),onKeyDown:Te(l.onKeyDown,N=>{const _=v.current!=="";!(N.ctrlKey||N.altKey||N.metaKey)&&N.key.length===1&&y(N.key),!(_&&N.key===" ")&&W5.includes(N.key)&&(S(),N.preventDefault())})})})});q2.displayName=V2;var F2="SelectValue",Y2=w.forwardRef((e,n)=>{const{__scopeSelect:s,className:o,style:l,children:c,placeholder:d="",...f}=e,m=ks(F2,s),{onValueNodeHasChildrenChange:p}=m,g=c!==void 0,v=nt(n,m.onValueNodeChange);return Pt(()=>{p(g)},[p,g]),a.jsx(Pe.span,{...f,ref:v,style:{pointerEvents:"none"},children:dN(m.value)?a.jsx(a.Fragment,{children:d}):c})});Y2.displayName=F2;var nR="SelectIcon",G2=w.forwardRef((e,n)=>{const{__scopeSelect:s,children:o,...l}=e;return a.jsx(Pe.span,{"aria-hidden":!0,...l,ref:n,children:o||"▼"})});G2.displayName=nR;var rR="SelectPortal",X2=e=>a.jsx(_p,{asChild:!0,...e});X2.displayName=rR;var co="SelectContent",Z2=w.forwardRef((e,n)=>{const s=ks(co,e.__scopeSelect),[o,l]=w.useState();if(Pt(()=>{l(new DocumentFragment)},[]),!s.open){const c=o;return c?fl.createPortal(a.jsx(W2,{scope:e.__scopeSelect,children:a.jsx(id.Slot,{scope:e.__scopeSelect,children:a.jsx("div",{children:e.children})})}),c):null}return a.jsx(K2,{...e,ref:n})});Z2.displayName=co;var In=10,[W2,As]=ka(co),sR="SelectContentImpl",oR=da("SelectContent.RemoveScroll"),K2=w.forwardRef((e,n)=>{const{__scopeSelect:s,position:o="item-aligned",onCloseAutoFocus:l,onEscapeKeyDown:c,onPointerDownOutside:d,side:f,sideOffset:m,align:p,alignOffset:g,arrowPadding:v,collisionBoundary:y,collisionPadding:b,sticky:S,hideWhenDetached:N,avoidCollisions:_,...E}=e,M=ks(co,s),[j,k]=w.useState(null),[R,D]=w.useState(null),z=nt(n,J=>k(J)),[H,U]=w.useState(null),[F,K]=w.useState(null),G=ld(s),[ne,L]=w.useState(!1),V=w.useRef(!1);w.useEffect(()=>{if(j)return Xw(j)},[j]),mw();const A=w.useCallback(J=>{const[le,...ve]=G().map(be=>be.ref.current),[Ne]=ve.slice(-1),_e=document.activeElement;for(const be of J)if(be===_e||(be?.scrollIntoView({block:"nearest"}),be===le&&R&&(R.scrollTop=0),be===Ne&&R&&(R.scrollTop=R.scrollHeight),be?.focus(),document.activeElement!==_e))return},[G,R]),I=w.useCallback(()=>A([H,j]),[A,H,j]);w.useEffect(()=>{ne&&I()},[ne,I]);const{onOpenChange:$,triggerPointerDownPosRef:P}=M;w.useEffect(()=>{if(j){let J={x:0,y:0};const le=Ne=>{J={x:Math.abs(Math.round(Ne.pageX)-(P.current?.x??0)),y:Math.abs(Math.round(Ne.pageY)-(P.current?.y??0))}},ve=Ne=>{J.x<=10&&J.y<=10?Ne.preventDefault():j.contains(Ne.target)||$(!1),document.removeEventListener("pointermove",le),P.current=null};return P.current!==null&&(document.addEventListener("pointermove",le),document.addEventListener("pointerup",ve,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",le),document.removeEventListener("pointerup",ve,{capture:!0})}}},[j,$,P]),w.useEffect(()=>{const J=()=>$(!1);return window.addEventListener("blur",J),window.addEventListener("resize",J),()=>{window.removeEventListener("blur",J),window.removeEventListener("resize",J)}},[$]);const[T,B]=fN(J=>{const le=G().filter(_e=>!_e.disabled),ve=le.find(_e=>_e.ref.current===document.activeElement),Ne=mN(le,J,ve);Ne&&setTimeout(()=>Ne.ref.current.focus())}),W=w.useCallback((J,le,ve)=>{const Ne=!V.current&&!ve;(M.value!==void 0&&M.value===le||Ne)&&(U(J),Ne&&(V.current=!0))},[M.value]),Z=w.useCallback(()=>j?.focus(),[j]),re=w.useCallback((J,le,ve)=>{const Ne=!V.current&&!ve;(M.value!==void 0&&M.value===le||Ne)&&K(J)},[M.value]),de=o==="popper"?Vh:Q2,ge=de===Vh?{side:f,sideOffset:m,align:p,alignOffset:g,arrowPadding:v,collisionBoundary:y,collisionPadding:b,sticky:S,hideWhenDetached:N,avoidCollisions:_}:{};return a.jsx(W2,{scope:s,content:j,viewport:R,onViewportChange:D,itemRefCallback:W,selectedItem:H,onItemLeave:Z,itemTextRefCallback:re,focusSelectedItem:I,selectedItemText:F,position:o,isPositioned:ne,searchRef:T,children:a.jsx(Ep,{as:oR,allowPinchZoom:!0,children:a.jsx(pp,{asChild:!0,trapped:M.open,onMountAutoFocus:J=>{J.preventDefault()},onUnmountAutoFocus:Te(l,J=>{M.trigger?.focus({preventScroll:!0}),J.preventDefault()}),children:a.jsx(hp,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:J=>J.preventDefault(),onDismiss:()=>M.onOpenChange(!1),children:a.jsx(de,{role:"listbox",id:M.contentId,"data-state":M.open?"open":"closed",dir:M.dir,onContextMenu:J=>J.preventDefault(),...E,...ge,onPlaced:()=>L(!0),ref:z,style:{display:"flex",flexDirection:"column",outline:"none",...E.style},onKeyDown:Te(E.onKeyDown,J=>{const le=J.ctrlKey||J.altKey||J.metaKey;if(J.key==="Tab"&&J.preventDefault(),!le&&J.key.length===1&&B(J.key),["ArrowUp","ArrowDown","Home","End"].includes(J.key)){let Ne=G().filter(_e=>!_e.disabled).map(_e=>_e.ref.current);if(["ArrowUp","End"].includes(J.key)&&(Ne=Ne.slice().reverse()),["ArrowUp","ArrowDown"].includes(J.key)){const _e=J.target,be=Ne.indexOf(_e);Ne=Ne.slice(be+1)}setTimeout(()=>A(Ne)),J.preventDefault()}})})})})})})});K2.displayName=sR;var aR="SelectItemAlignedPosition",Q2=w.forwardRef((e,n)=>{const{__scopeSelect:s,onPlaced:o,...l}=e,c=ks(co,s),d=As(co,s),[f,m]=w.useState(null),[p,g]=w.useState(null),v=nt(n,z=>g(z)),y=ld(s),b=w.useRef(!1),S=w.useRef(!0),{viewport:N,selectedItem:_,selectedItemText:E,focusSelectedItem:M}=d,j=w.useCallback(()=>{if(c.trigger&&c.valueNode&&f&&p&&N&&_&&E){const z=c.trigger.getBoundingClientRect(),H=p.getBoundingClientRect(),U=c.valueNode.getBoundingClientRect(),F=E.getBoundingClientRect();if(c.dir!=="rtl"){const _e=F.left-H.left,be=U.left-_e,Re=z.left-be,te=z.width+Re,Ee=Math.max(te,H.width),Ve=window.innerWidth-In,Qe=Bh(be,[In,Math.max(In,Ve-Ee)]);f.style.minWidth=te+"px",f.style.left=Qe+"px"}else{const _e=H.right-F.right,be=window.innerWidth-U.right-_e,Re=window.innerWidth-z.right-be,te=z.width+Re,Ee=Math.max(te,H.width),Ve=window.innerWidth-In,Qe=Bh(be,[In,Math.max(In,Ve-Ee)]);f.style.minWidth=te+"px",f.style.right=Qe+"px"}const K=y(),G=window.innerHeight-In*2,ne=N.scrollHeight,L=window.getComputedStyle(p),V=parseInt(L.borderTopWidth,10),A=parseInt(L.paddingTop,10),I=parseInt(L.borderBottomWidth,10),$=parseInt(L.paddingBottom,10),P=V+A+ne+$+I,T=Math.min(_.offsetHeight*5,P),B=window.getComputedStyle(N),W=parseInt(B.paddingTop,10),Z=parseInt(B.paddingBottom,10),re=z.top+z.height/2-In,de=G-re,ge=_.offsetHeight/2,J=_.offsetTop+ge,le=V+A+J,ve=P-le;if(le<=re){const _e=K.length>0&&_===K[K.length-1].ref.current;f.style.bottom="0px";const be=p.clientHeight-N.offsetTop-N.offsetHeight,Re=Math.max(de,ge+(_e?Z:0)+be+I),te=le+Re;f.style.height=te+"px"}else{const _e=K.length>0&&_===K[0].ref.current;f.style.top="0px";const Re=Math.max(re,V+N.offsetTop+(_e?W:0)+ge)+ve;f.style.height=Re+"px",N.scrollTop=le-re+N.offsetTop}f.style.margin=`${In}px 0`,f.style.minHeight=T+"px",f.style.maxHeight=G+"px",o?.(),requestAnimationFrame(()=>b.current=!0)}},[y,c.trigger,c.valueNode,f,p,N,_,E,c.dir,o]);Pt(()=>j(),[j]);const[k,R]=w.useState();Pt(()=>{p&&R(window.getComputedStyle(p).zIndex)},[p]);const D=w.useCallback(z=>{z&&S.current===!0&&(j(),M?.(),S.current=!1)},[j,M]);return a.jsx(lR,{scope:s,contentWrapper:f,shouldExpandOnScrollRef:b,onScrollButtonChange:D,children:a.jsx("div",{ref:m,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:k},children:a.jsx(Pe.div,{...l,ref:v,style:{boxSizing:"border-box",maxHeight:"100%",...l.style}})})})});Q2.displayName=aR;var iR="SelectPopperPosition",Vh=w.forwardRef((e,n)=>{const{__scopeSelect:s,align:o="start",collisionPadding:l=In,...c}=e,d=cd(s);return a.jsx(Hw,{...d,...c,ref:n,align:o,collisionPadding:l,style:{boxSizing:"border-box",...c.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)"}})});Vh.displayName=iR;var[lR,Jp]=ka(co,{}),qh="SelectViewport",J2=w.forwardRef((e,n)=>{const{__scopeSelect:s,nonce:o,...l}=e,c=As(qh,s),d=Jp(qh,s),f=nt(n,c.onViewportChange),m=w.useRef(0);return a.jsxs(a.Fragment,{children:[a.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:o}),a.jsx(id.Slot,{scope:s,children:a.jsx(Pe.div,{"data-radix-select-viewport":"",role:"presentation",...l,ref:f,style:{position:"relative",flex:1,overflow:"hidden auto",...l.style},onScroll:Te(l.onScroll,p=>{const g=p.currentTarget,{contentWrapper:v,shouldExpandOnScrollRef:y}=d;if(y?.current&&v){const b=Math.abs(m.current-g.scrollTop);if(b>0){const S=window.innerHeight-In*2,N=parseFloat(v.style.minHeight),_=parseFloat(v.style.height),E=Math.max(N,_);if(E<S){const M=E+b,j=Math.min(S,M),k=M-j;v.style.height=j+"px",v.style.bottom==="0px"&&(g.scrollTop=k>0?k:0,v.style.justifyContent="flex-end")}}}m.current=g.scrollTop})})})]})});J2.displayName=qh;var eN="SelectGroup",[cR,uR]=ka(eN),dR=w.forwardRef((e,n)=>{const{__scopeSelect:s,...o}=e,l=oo();return a.jsx(cR,{scope:s,id:l,children:a.jsx(Pe.div,{role:"group","aria-labelledby":l,...o,ref:n})})});dR.displayName=eN;var tN="SelectLabel",fR=w.forwardRef((e,n)=>{const{__scopeSelect:s,...o}=e,l=uR(tN,s);return a.jsx(Pe.div,{id:l.id,...o,ref:n})});fR.displayName=tN;var Ru="SelectItem",[mR,nN]=ka(Ru),rN=w.forwardRef((e,n)=>{const{__scopeSelect:s,value:o,disabled:l=!1,textValue:c,...d}=e,f=ks(Ru,s),m=As(Ru,s),p=f.value===o,[g,v]=w.useState(c??""),[y,b]=w.useState(!1),S=nt(n,M=>m.itemRefCallback?.(M,o,l)),N=oo(),_=w.useRef("touch"),E=()=>{l||(f.onValueChange(o),f.onOpenChange(!1))};if(o==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return a.jsx(mR,{scope:s,value:o,disabled:l,textId:N,isSelected:p,onItemTextChange:w.useCallback(M=>{v(j=>j||(M?.textContent??"").trim())},[]),children:a.jsx(id.ItemSlot,{scope:s,value:o,disabled:l,textValue:g,children:a.jsx(Pe.div,{role:"option","aria-labelledby":N,"data-highlighted":y?"":void 0,"aria-selected":p&&y,"data-state":p?"checked":"unchecked","aria-disabled":l||void 0,"data-disabled":l?"":void 0,tabIndex:l?void 0:-1,...d,ref:S,onFocus:Te(d.onFocus,()=>b(!0)),onBlur:Te(d.onBlur,()=>b(!1)),onClick:Te(d.onClick,()=>{_.current!=="mouse"&&E()}),onPointerUp:Te(d.onPointerUp,()=>{_.current==="mouse"&&E()}),onPointerDown:Te(d.onPointerDown,M=>{_.current=M.pointerType}),onPointerMove:Te(d.onPointerMove,M=>{_.current=M.pointerType,l?m.onItemLeave?.():_.current==="mouse"&&M.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Te(d.onPointerLeave,M=>{M.currentTarget===document.activeElement&&m.onItemLeave?.()}),onKeyDown:Te(d.onKeyDown,M=>{m.searchRef?.current!==""&&M.key===" "||(K5.includes(M.key)&&E(),M.key===" "&&M.preventDefault())})})})})});rN.displayName=Ru;var Bi="SelectItemText",sN=w.forwardRef((e,n)=>{const{__scopeSelect:s,className:o,style:l,...c}=e,d=ks(Bi,s),f=As(Bi,s),m=nN(Bi,s),p=tR(Bi,s),[g,v]=w.useState(null),y=nt(n,E=>v(E),m.onItemTextChange,E=>f.itemTextRefCallback?.(E,m.value,m.disabled)),b=g?.textContent,S=w.useMemo(()=>a.jsx("option",{value:m.value,disabled:m.disabled,children:b},m.value),[m.disabled,m.value,b]),{onNativeOptionAdd:N,onNativeOptionRemove:_}=p;return Pt(()=>(N(S),()=>_(S)),[N,_,S]),a.jsxs(a.Fragment,{children:[a.jsx(Pe.span,{id:m.textId,...c,ref:y}),m.isSelected&&d.valueNode&&!d.valueNodeHasChildren?fl.createPortal(c.children,d.valueNode):null]})});sN.displayName=Bi;var oN="SelectItemIndicator",aN=w.forwardRef((e,n)=>{const{__scopeSelect:s,...o}=e;return nN(oN,s).isSelected?a.jsx(Pe.span,{"aria-hidden":!0,...o,ref:n}):null});aN.displayName=oN;var Fh="SelectScrollUpButton",iN=w.forwardRef((e,n)=>{const s=As(Fh,e.__scopeSelect),o=Jp(Fh,e.__scopeSelect),[l,c]=w.useState(!1),d=nt(n,o.onScrollButtonChange);return Pt(()=>{if(s.viewport&&s.isPositioned){let f=function(){const p=m.scrollTop>0;c(p)};const m=s.viewport;return f(),m.addEventListener("scroll",f),()=>m.removeEventListener("scroll",f)}},[s.viewport,s.isPositioned]),l?a.jsx(cN,{...e,ref:d,onAutoScroll:()=>{const{viewport:f,selectedItem:m}=s;f&&m&&(f.scrollTop=f.scrollTop-m.offsetHeight)}}):null});iN.displayName=Fh;var Yh="SelectScrollDownButton",lN=w.forwardRef((e,n)=>{const s=As(Yh,e.__scopeSelect),o=Jp(Yh,e.__scopeSelect),[l,c]=w.useState(!1),d=nt(n,o.onScrollButtonChange);return Pt(()=>{if(s.viewport&&s.isPositioned){let f=function(){const p=m.scrollHeight-m.clientHeight,g=Math.ceil(m.scrollTop)<p;c(g)};const m=s.viewport;return f(),m.addEventListener("scroll",f),()=>m.removeEventListener("scroll",f)}},[s.viewport,s.isPositioned]),l?a.jsx(cN,{...e,ref:d,onAutoScroll:()=>{const{viewport:f,selectedItem:m}=s;f&&m&&(f.scrollTop=f.scrollTop+m.offsetHeight)}}):null});lN.displayName=Yh;var cN=w.forwardRef((e,n)=>{const{__scopeSelect:s,onAutoScroll:o,...l}=e,c=As("SelectScrollButton",s),d=w.useRef(null),f=ld(s),m=w.useCallback(()=>{d.current!==null&&(window.clearInterval(d.current),d.current=null)},[]);return w.useEffect(()=>()=>m(),[m]),Pt(()=>{f().find(g=>g.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[f]),a.jsx(Pe.div,{"aria-hidden":!0,...l,ref:n,style:{flexShrink:0,...l.style},onPointerDown:Te(l.onPointerDown,()=>{d.current===null&&(d.current=window.setInterval(o,50))}),onPointerMove:Te(l.onPointerMove,()=>{c.onItemLeave?.(),d.current===null&&(d.current=window.setInterval(o,50))}),onPointerLeave:Te(l.onPointerLeave,()=>{m()})})}),hR="SelectSeparator",pR=w.forwardRef((e,n)=>{const{__scopeSelect:s,...o}=e;return a.jsx(Pe.div,{"aria-hidden":!0,...o,ref:n})});pR.displayName=hR;var Gh="SelectArrow",gR=w.forwardRef((e,n)=>{const{__scopeSelect:s,...o}=e,l=cd(s),c=ks(Gh,s),d=As(Gh,s);return c.open&&d.position==="popper"?a.jsx($w,{...l,...o,ref:n}):null});gR.displayName=Gh;var xR="SelectBubbleInput",uN=w.forwardRef(({__scopeSelect:e,value:n,...s},o)=>{const l=w.useRef(null),c=nt(o,l),d=Kp(n);return w.useEffect(()=>{const f=l.current;if(!f)return;const m=window.HTMLSelectElement.prototype,g=Object.getOwnPropertyDescriptor(m,"value").set;if(d!==n&&g){const v=new Event("change",{bubbles:!0});g.call(f,n),f.dispatchEvent(v)}},[d,n]),a.jsx(Pe.select,{...s,style:{...P2,...s.style},ref:c,defaultValue:n})});uN.displayName=xR;function dN(e){return e===""||e===void 0}function fN(e){const n=Bt(e),s=w.useRef(""),o=w.useRef(0),l=w.useCallback(d=>{const f=s.current+d;n(f),(function m(p){s.current=p,window.clearTimeout(o.current),p!==""&&(o.current=window.setTimeout(()=>m(""),1e3))})(f)},[n]),c=w.useCallback(()=>{s.current="",window.clearTimeout(o.current)},[]);return w.useEffect(()=>()=>window.clearTimeout(o.current),[]),[s,l,c]}function mN(e,n,s){const l=n.length>1&&Array.from(n).every(p=>p===n[0])?n[0]:n,c=s?e.indexOf(s):-1;let d=yR(e,Math.max(c,0));l.length===1&&(d=d.filter(p=>p!==s));const m=d.find(p=>p.textValue.toLowerCase().startsWith(l.toLowerCase()));return m!==s?m:void 0}function yR(e,n){return e.map((s,o)=>e[(n+o)%e.length])}var vR=U2,bR=q2,wR=Y2,NR=G2,SR=X2,jR=Z2,_R=J2,ER=rN,CR=sN,kR=aN,AR=iN,MR=lN;function ud({...e}){return a.jsx(vR,{"data-slot":"select",...e})}function dd({...e}){return a.jsx(wR,{"data-slot":"select-value",...e})}function fd({className:e,size:n="default",children:s,...o}){return a.jsxs(bR,{"data-slot":"select-trigger","data-size":n,className:Ge("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),...o,children:[s,a.jsx(NR,{asChild:!0,children:a.jsx(Xt,{className:"size-4 opacity-50"})})]})}function md({className:e,children:n,position:s="popper",...o}){return a.jsx(SR,{children:a.jsxs(jR,{"data-slot":"select-content",className:Ge("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",s==="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:s,...o,children:[a.jsx(TR,{}),a.jsx(_R,{className:Ge("p-1",s==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:n}),a.jsx(RR,{})]})})}function hd({className:e,children:n,...s}){return a.jsxs(ER,{"data-slot":"select-item",className:Ge("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),...s,children:[a.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:a.jsx(kR,{children:a.jsx(Ea,{className:"size-4"})})}),a.jsx(CR,{children:n})]})}function TR({className:e,...n}){return a.jsx(AR,{"data-slot":"select-scroll-up-button",className:Ge("flex cursor-default items-center justify-center py-1",e),...n,children:a.jsx(Eu,{className:"size-4"})})}function RR({className:e,...n}){return a.jsx(MR,{"data-slot":"select-scroll-down-button",className:Ge("flex cursor-default items-center justify-center py-1",e),...n,children:a.jsx(Xt,{className:"size-4"})})}function Ws({title:e,icon:n,children:s,className:o=""}){return a.jsxs("div",{className:`border rounded-lg p-4 bg-card ${o}`,children:[a.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[n,a.jsx("h3",{className:"text-sm font-semibold text-foreground",children:e})]}),a.jsx("div",{className:"text-sm text-muted-foreground",children:s})]})}function DR({agent:e,open:n,onOpenChange:s}){const o=e.source==="directory"?a.jsx($1,{className:"h-4 w-4 text-muted-foreground"}):e.source==="in_memory"?a.jsx(Oh,{className:"h-4 w-4 text-muted-foreground"}):a.jsx(B1,{className:"h-4 w-4 text-muted-foreground"}),l=e.source==="directory"?"Local":e.source==="in_memory"?"In-Memory":"Gallery";return a.jsx(js,{open:n,onOpenChange:s,children:a.jsxs(_s,{className:"max-w-4xl max-h-[90vh] flex flex-col",children:[a.jsxs(Es,{className:"px-6 pt-6 flex-shrink-0",children:[a.jsx(Cs,{children:"Agent Details"}),a.jsx(Ca,{onClose:()=>s(!1)})]}),a.jsxs("div",{className:"px-6 pb-6 overflow-y-auto flex-1",children:[a.jsxs("div",{className:"mb-6",children:[a.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[a.jsx(rr,{className:"h-6 w-6 text-primary"}),a.jsx("h2",{className:"text-xl font-semibold text-foreground",children:e.name||e.id})]}),e.description&&a.jsx("p",{className:"text-muted-foreground",children:e.description})]}),a.jsx("div",{className:"h-px bg-border mb-6"}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4",children:[(e.model||e.chat_client_type)&&a.jsx(Ws,{title:"Model & Client",icon:a.jsx(rr,{className:"h-4 w-4 text-muted-foreground"}),children:a.jsxs("div",{className:"space-y-1",children:[e.model&&a.jsx("div",{className:"font-mono text-foreground",children:e.model}),e.chat_client_type&&a.jsxs("div",{className:"text-xs",children:["(",e.chat_client_type,")"]})]})}),a.jsx(Ws,{title:"Source",icon:o,children:a.jsxs("div",{className:"space-y-1",children:[a.jsx("div",{className:"text-foreground",children:l}),e.module_path&&a.jsx("div",{className:"font-mono text-xs break-all",children:e.module_path})]})}),a.jsx(Ws,{title:"Environment",icon:e.has_env?a.jsx(yl,{className:"h-4 w-4 text-orange-500"}):a.jsx(td,{className:"h-4 w-4 text-green-500"}),className:"md:col-span-2",children:a.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&&a.jsx(Ws,{title:"Instructions",icon:a.jsx(Ns,{className:"h-4 w-4 text-muted-foreground"}),className:"mb-4",children:a.jsx("div",{className:"text-sm text-foreground leading-relaxed whitespace-pre-wrap",children:e.instructions})}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsx(Ws,{title:`Tools (${e.tools.length})`,icon:a.jsx(zh,{className:"h-4 w-4 text-muted-foreground"}),children:e.tools.length>0?a.jsx("ul",{className:"space-y-1",children:e.tools.map((c,d)=>a.jsxs("li",{className:"font-mono text-xs text-foreground",children:["• ",c]},d))}):a.jsx("div",{className:"text-muted-foreground",children:"No tools configured"})}),e.middleware&&e.middleware.length>0&&a.jsx(Ws,{title:`Middleware (${e.middleware.length})`,icon:a.jsx(zh,{className:"h-4 w-4 text-muted-foreground"}),children:a.jsx("ul",{className:"space-y-1",children:e.middleware.map((c,d)=>a.jsxs("li",{className:"font-mono text-xs text-foreground",children:["• ",c]},d))})}),e.context_providers&&e.context_providers.length>0&&a.jsx(Ws,{title:`Context Providers (${e.context_providers.length})`,icon:a.jsx(Oh,{className:"h-4 w-4 text-muted-foreground"}),className:!e.middleware||e.middleware.length===0?"md:col-start-2":"",children:a.jsx("ul",{className:"space-y-1",children:e.context_providers.map((c,d)=>a.jsxs("li",{className:"font-mono text-xs text-foreground",children:["• ",c]},d))})})]})]})]})})}function OR({item:e}){const[n,s]=w.useState(!1),[o,l]=w.useState(!1),c=()=>e.type==="message"?e.content.filter(f=>f.type==="text").map(f=>f.text).join(`
`):"",d=async()=>{const f=c();if(f)try{await navigator.clipboard.writeText(f),l(!0),setTimeout(()=>l(!1),2e3)}catch(m){console.error("Failed to copy:",m)}};if(e.type==="message"){const f=e.role==="user",m=e.status==="incomplete",p=f?q1:m?ws:rr,g=c();return a.jsxs("div",{className:`flex gap-3 ${f?"flex-row-reverse":""}`,onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1),children:[a.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":m?"bg-orange-100 dark:bg-orange-900 text-orange-600 dark:text-orange-400 border-orange-200 dark:border-orange-800":"bg-muted"}`,children:a.jsx(p,{className:"h-4 w-4"})}),a.jsxs("div",{className:`flex flex-col space-y-1 ${f?"items-end":"items-start"} max-w-[80%]`,children:[a.jsxs("div",{className:"relative group",children:[a.jsxs("div",{className:`rounded px-3 py-2 text-sm ${f?"bg-primary text-primary-foreground":m?"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:[m&&a.jsxs("div",{className:"flex items-start gap-2 mb-2",children:[a.jsx(ws,{className:"h-4 w-4 text-orange-500 mt-0.5 flex-shrink-0"}),a.jsx("span",{className:"font-medium text-sm",children:"Unable to process request"})]}),a.jsx("div",{className:m?"text-xs leading-relaxed break-all":"",children:a.jsx(Uv,{item:e})})]}),g&&n&&a.jsx("button",{onClick:d,className:`absolute top-1 right-1
                           p-1.5 rounded-md border shadow-sm
                           bg-background hover:bg-accent
                           text-muted-foreground hover:text-foreground
                           transition-all duration-200 ease-in-out
                           opacity-0 group-hover:opacity-100`,title:o?"Copied!":"Copy message",children:o?a.jsx(OA,{className:"h-3.5 w-3.5 text-green-600 dark:text-green-400"}):a.jsx(Js,{className:"h-3.5 w-3.5"})})]}),a.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground font-mono",children:[a.jsx("span",{children:e.created_at?new Date(e.created_at*1e3).toLocaleTimeString():new Date().toLocaleTimeString()}),!f&&e.usage&&a.jsxs(a.Fragment,{children:[a.jsx("span",{children:"•"}),a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsxs("span",{className:"text-blue-600 dark:text-blue-400",children:["↑",e.usage.input_tokens]}),a.jsxs("span",{className:"text-green-600 dark:text-green-400",children:["↓",e.usage.output_tokens]}),a.jsxs("span",{children:["(",e.usage.total_tokens," tokens)"]})]})]})]})]})]})}return a.jsxs("div",{className:"flex gap-3",children:[a.jsx("div",{className:"flex h-8 w-8 shrink-0 select-none items-center justify-center rounded-md border bg-muted",children:a.jsx(rr,{className:"h-4 w-4"})}),a.jsx("div",{className:"flex flex-col space-y-1 items-start max-w-[80%]",children:a.jsx("div",{className:"rounded px-3 py-2 text-sm bg-muted",children:a.jsx(Uv,{item:e})})})]})}function zR({selectedAgent:e,onDebugEvent:n}){const s=pe(ae=>ae.currentConversation),o=pe(ae=>ae.availableConversations),l=pe(ae=>ae.chatItems),c=pe(ae=>ae.isStreaming),d=pe(ae=>ae.isSubmitting),f=pe(ae=>ae.loadingConversations),m=pe(ae=>ae.inputValue),p=pe(ae=>ae.attachments),g=pe(ae=>ae.uiMode),v=pe(ae=>ae.conversationUsage),y=pe(ae=>ae.pendingApprovals),b=pe(ae=>ae.oaiMode),S=pe(ae=>ae.setCurrentConversation),N=pe(ae=>ae.setAvailableConversations),_=pe(ae=>ae.setChatItems),E=pe(ae=>ae.setIsStreaming),M=pe(ae=>ae.setIsSubmitting),j=pe(ae=>ae.setLoadingConversations),k=pe(ae=>ae.setInputValue),R=pe(ae=>ae.setAttachments),D=pe(ae=>ae.updateConversationUsage),z=pe(ae=>ae.setPendingApprovals),[H,U]=w.useState(!1),[F,K]=w.useState(0),[G,ne]=w.useState(null),[L,V]=w.useState(!1),[A,I]=w.useState(null),[$,P]=w.useState(!1),T=w.useRef(null),B=w.useRef(null),W=w.useRef(null),Z=w.useRef(null),re=w.useRef(!1),de=w.useRef("");w.useEffect(()=>{if(!B.current)return;const ae=T.current?.querySelector("[data-radix-scroll-area-viewport]");let ie=!1;if(ae){const{scrollTop:ue,scrollHeight:me,clientHeight:ye}=ae,ce=me-ue-ye<100;ie=re.current||ce}else ie=!0;ie&&B.current.scrollIntoView({behavior:c?"instant":"smooth"}),re.current&&!c&&(re.current=!1)},[l,c]),w.useEffect(()=>{!c&&!d&&W.current?.focus()},[c,d]),w.useEffect(()=>{const ae=async(ue,me,ye)=>{const ce=la(me.id);if(!ce||!ce.responseId){E(!1);return}try{const Se={model:ye.id,input:[],stream:!0,conversation:me.id},De=Je.streamAgentExecutionOpenAIDirect(ye.id,Se,me.id,ce.responseId);for await(const we of De){if(n(we),we.type==="response.completed"){const je=we.response?.usage;je&&(Z.current={input_tokens:je.input_tokens,output_tokens:je.output_tokens,total_tokens:je.total_tokens});continue}if(we.type==="response.failed"){const je=we.response?.error,rt=je?typeof je=="object"&&"message"in je?je.message:JSON.stringify(je):"Request failed",ft=pe.getState().chatItems;_(ft.map(Vt=>Vt.id===ue.id&&Vt.type==="message"?{...Vt,content:[{type:"text",text:de.current||rt}],status:"incomplete"}:Vt)),E(!1);return}if(we.type==="response.function_approval.requested"){const He=we;z([...pe.getState().pendingApprovals,{request_id:He.request_id,function_call:He.function_call}]);continue}if(we.type==="response.function_approval.responded"){const He=we;z(pe.getState().pendingApprovals.filter(je=>je.request_id!==He.request_id));continue}if(we.type==="error"){const je=we.message||"An error occurred",rt=pe.getState().chatItems;_(rt.map(ft=>ft.id===ue.id&&ft.type==="message"?{...ft,content:[{type:"text",text:de.current||je}],status:"incomplete"}:ft)),E(!1);return}if(we.type==="response.output_text.delta"&&"delta"in we&&we.delta){de.current+=we.delta;const He=pe.getState().chatItems;_(He.map(je=>je.id===ue.id&&je.type==="message"?{...je,content:[{type:"text",text:de.current}],status:"in_progress"}:je))}}const Ke=Z.current,Ut=pe.getState().chatItems;_(Ut.map(we=>we.id===ue.id&&we.type==="message"?{...we,status:"completed",usage:Ke||void 0}:we)),E(!1),Ke&&D(Ke.total_tokens),Z.current=null}catch(Se){const De=pe.getState().chatItems;_(De.map(Ke=>Ke.id===ue.id&&Ke.type==="message"?{...Ke,content:[{type:"text",text:`Error resuming stream: ${Se instanceof Error?Se.message:"Unknown error"}`}],status:"incomplete"}:Ke)),E(!1)}},ie=async()=>{if(e){j(!0);try{try{const{data:ce}=await Je.listConversations(e.id);if(N(ce),ce.length>0){const Se=ce[0];S(Se);try{let De=[],Ke=!0,Ut;for(;Ke;){const He=await Je.listConversationItems(Se.id,{order:"asc",after:Ut});De=De.concat(He.data),Ke=He.has_more,Ke&&He.data.length>0&&(Ut=He.data[He.data.length-1].id)}_(De),E(!1);const we=la(Se.id);if(we&&!we.completed){de.current=we.accumulatedText||"";const He={id:we.lastMessageId||`assistant-${Date.now()}`,type:"message",role:"assistant",content:we.accumulatedText?[{type:"text",text:we.accumulatedText}]:[],status:"in_progress"};_([...De,He]),E(!0),setTimeout(()=>{ae(He,Se,e)},100)}setTimeout(()=>{B.current?.scrollIntoView({behavior:"smooth"})},100)}catch{console.debug(`No items found for conversation ${Se.id}, starting fresh`),_([]),E(!1)}return}}catch{}const ue=`devui_convs_${e.id}`,me=localStorage.getItem(ue);if(me)try{const ce=JSON.parse(me);if(ce.length>0)try{await Je.listConversationItems(ce[0].id),N(ce),S(ce[0]),_([]),E(!1);return}catch{console.debug(`Cached conversation ${ce[0].id} no longer exists, clearing cache`),localStorage.removeItem(ue)}}catch{localStorage.removeItem(ue)}const ye=await Je.createConversation({agent_id:e.id});S(ye),N([ye]),_([]),E(!1),I(null),localStorage.setItem(ue,JSON.stringify([ye]))}catch(ue){N([]),_([]),E(!1);const me=ue instanceof Error?ue.message:"Failed to create conversation";I({message:me,type:"conversation_creation_error"})}finally{j(!1)}}};_([]),E(!1),S(void 0),de.current="",ie()},[e,n,_,E,j,N,S,z,D]);const ge=async ae=>{const ie=[];for(const ue of ae){const me=`${Date.now()}-${Math.random().toString(36).substr(2,9)}`,ye=te(ue);let ce;ye==="image"&&(ce=await Ee(ue)),ie.push({id:me,file:ue,preview:ce,type:ye})}R([...pe.getState().attachments,...ie])},J=ae=>{R(pe.getState().attachments.filter(ie=>ie.id!==ae))},le=ae=>{ae.preventDefault(),ae.stopPropagation(),K(ie=>ie+1),ae.dataTransfer.items&&ae.dataTransfer.items.length>0&&U(!0)},ve=ae=>{ae.preventDefault(),ae.stopPropagation();const ie=F-1;K(ie),ie===0&&U(!1)},Ne=ae=>{ae.preventDefault(),ae.stopPropagation()},_e=async ae=>{if(ae.preventDefault(),ae.stopPropagation(),U(!1),K(0),d||c)return;const ie=Array.from(ae.dataTransfer.files);ie.length>0&&await ge(ie)},be=async ae=>{const ie=Array.from(ae.clipboardData.items),ue=[];let me=!1;const ye=8e3;for(const ce of ie)if(ce.type.startsWith("image/")){ae.preventDefault();const Se=ce.getAsFile();if(Se){const De=Date.now();ue.push(new File([Se],`screenshot-${De}.png`,{type:Se.type}))}}else ce.type==="text/plain"&&!me&&(me=!0,ae.preventDefault(),await new Promise(Se=>{ce.getAsString(De=>{const Ke=(De.match(/\n/g)||[]).length;if(De.length>ye||Ke>50||/^\s*[{[][\s\S]*[}\]]\s*$/.test(De)||/^<\?xml|^<html|^<!DOCTYPE/i.test(De)){const we=Re(De),He=Date.now(),je=new Blob([De],{type:"text/plain"});ue.push(new File([je],`pasted-text-${He}${we}`,{type:"text/plain"}))}else{const we=W.current;if(we){const He=we.selectionStart,je=we.selectionEnd,rt=we.value,ft=rt.slice(0,He)+De+rt.slice(je);k(ft),setTimeout(()=>{we.selectionStart=we.selectionEnd=He+De.length,we.focus()},0)}}Se()})}));if(ue.length>0){await ge(ue);const ce=ue.length===1?ue[0].name.includes("screenshot")?"Screenshot added as attachment":"Large text converted to file":`${ue.length} files added`;ne(ce),setTimeout(()=>ne(null),3e3)}},Re=ae=>{const ie=ae.trim(),ue=ie.split(`
`);if(/^{[\s\S]*}$|^\[[\s\S]*\]$/.test(ie))return".json";if(/^<\?xml|^<html|^<!DOCTYPE/i.test(ie))return".html";if(/^```/.test(ie))return".md";if(/\t/.test(ae)&&ue.length>1)return".tsv";if(ue.length>2){const me=ue.filter(ce=>ce.includes(",")),ye=ue.filter(ce=>ce.includes(";"));if(me.length>ue.length*.5&&me.reduce((Se,De)=>Se+(De.match(/,/g)||[]).length,0)/me.length>=2||ye.length>ue.length*.5&&ye.reduce((Se,De)=>Se+(De.match(/;/g)||[]).length,0)/ye.length>=2)return".csv"}return".txt"},te=ae=>ae.type.startsWith("image/")?"image":ae.type==="application/pdf"?"pdf":ae.type.startsWith("audio/")?"audio":"other",Ee=ae=>new Promise((ie,ue)=>{const me=new FileReader;me.onload=()=>ie(me.result),me.onerror=ue,me.readAsDataURL(ae)}),Ve=w.useCallback(async()=>{if(e)try{const ae=await Je.createConversation({agent_id:e.id});S(ae),N([ae,...pe.getState().availableConversations]),_([]),E(!1),I(null),pe.setState({conversationUsage:{total_tokens:0,message_count:0}}),de.current="";const ie=`devui_convs_${e.id}`,ue=[ae,...o];localStorage.setItem(ie,JSON.stringify(ue))}catch(ae){const ie=ae instanceof Error?ae.message:"Failed to create conversation";I({message:ie,type:"conversation_creation_error"})}},[e,S,N,_,E]),Qe=w.useCallback(async(ae,ie)=>{if(ie&&(ie.preventDefault(),ie.stopPropagation()),!!confirm("Delete this conversation? This cannot be undone."))try{if(await Je.deleteConversation(ae)){const me=o.filter(ye=>ye.id!==ae);if(N(me),s?.id===ae)if(me.length>0){const ye=me[0];S(ye),_([]),E(!1)}else S(void 0),_([]),E(!1),pe.setState({conversationUsage:{total_tokens:0,message_count:0}}),de.current="";n("clear")}}catch{alert("Failed to delete conversation. Please try again.")}},[o,s,n,N,S,_,E]),It=w.useCallback(async()=>{if($||!e)return;P(!0);const ae=pe.getState().addToast,ie=pe.getState().updateAgent;try{await Je.reloadEntity(e.id);const ue=await Je.getAgentInfo(e.id);ie(ue),ae({message:`${e.name} has been reloaded successfully`,type:"success"})}catch(ue){const me=ue instanceof Error?ue.message:"Failed to reload entity";ae({message:`Failed to reload: ${me}`,type:"error",duration:6e3})}finally{P(!1)}},[$,e]),Zt=w.useCallback(async ae=>{const ie=o.find(ue=>ue.id===ae);if(ie){S(ie),n("clear");try{let ue=[],me=!0,ye;for(;me;){const De=await Je.listConversationItems(ae,{order:"asc",after:ye});ue=ue.concat(De.data),me=De.has_more,me&&De.data.length>0&&(ye=De.data[De.data.length-1].id)}const ce=ue;_(ce),E(!1),pe.setState({conversationUsage:{total_tokens:0,message_count:ce.length}});const Se=la(ae);if(Se?.accumulatedText){de.current=Se.accumulatedText;const De={id:`assistant-${Date.now()}`,type:"message",role:"assistant",content:[{type:"output_text",text:Se.accumulatedText}],status:"in_progress"};_([...ce,De]),E(!0)}setTimeout(()=>{B.current?.scrollIntoView({behavior:"smooth"})},100)}catch{console.debug(`No items found for conversation ${ae}, starting with empty chat`),_([]),E(!1),pe.setState({conversationUsage:{total_tokens:0,message_count:0}})}de.current=""}},[o,n,S,_,E]),ht=async(ae,ie)=>{const ue=y.find(Ke=>Ke.request_id===ae);if(!ue)return;const me=Math.floor(Date.now()/1e3),ye={id:`user-approval-${Date.now()}`,type:"message",role:"user",content:[{type:"function_approval_request",request_id:ae,status:ie?"approved":"rejected",function_call:ue.function_call}],status:"completed",created_at:me},ce=pe.getState().chatItems;_([...ce,ye]);const De={input:[{type:"message",role:"user",content:[{type:"function_approval_response",request_id:ae,approved:ie,function_call:ue.function_call}]}],conversation_id:s?.id};return z(pe.getState().pendingApprovals.filter(Ke=>Ke.request_id!==ae)),De},We=w.useCallback(async ae=>{if(!e)return;const ie=ae.input.some(ce=>ce.type==="message"&&Array.isArray(ce.content)&&ce.content.some(Se=>Se.type==="function_approval_response")),ue=[];for(const ce of ae.input)if(ce.type==="message"&&Array.isArray(ce.content)){for(const Se of ce.content)if(Se.type==="input_text")ue.push({type:"text",text:Se.text});else if(Se.type==="input_image")ue.push({type:"input_image",image_url:Se.image_url||"",detail:"auto"});else if(Se.type==="input_file"){const De=Se;ue.push({type:"input_file",file_data:De.file_data,filename:De.filename})}}const me=Math.floor(Date.now()/1e3);if(!ie&&ue.length>0){const ce={id:`user-${Date.now()}`,type:"message",role:"user",content:ue,status:"completed",created_at:me};_([...pe.getState().chatItems,ce])}E(!0);const ye={id:`assistant-${Date.now()}`,type:"message",role:"assistant",content:[],status:"in_progress",created_at:me};_([...pe.getState().chatItems,ye]);try{let ce=s;if(!ce)try{ce=await Je.createConversation({agent_id:e.id}),S(ce),N([ce,...pe.getState().availableConversations]),I(null)}catch(we){const He=we instanceof Error?we.message:"Failed to create conversation";I({message:He,type:"conversation_creation_error"}),M(!1),E(!1);return}ce?.id&&Je.clearStreamingState(ce.id);const Se={input:ae.input,conversation_id:ce?.id};de.current="";const De=Je.streamAgentExecutionOpenAI(e.id,Se);for await(const we of De){if(n(we),we.type==="response.completed"){const je=we.response?.usage;je&&(Z.current={input_tokens:je.input_tokens,output_tokens:je.output_tokens,total_tokens:je.total_tokens});continue}if(we.type==="response.failed"){const je=we.response?.error;let rt="Request failed";je&&(typeof je=="object"&&"message"in je?(rt=je.message,"code"in je&&je.code&&(rt+=` (Code: ${je.code})`)):typeof je=="string"&&(rt=je));const ft=pe.getState().chatItems;_(ft.map(Vt=>Vt.id===ye.id&&Vt.type==="message"?{...Vt,content:[{type:"text",text:de.current||rt}],status:"incomplete"}:Vt)),E(!1);return}if(we.type==="response.function_approval.requested"){const He=we;z([...pe.getState().pendingApprovals,{request_id:He.request_id,function_call:He.function_call}]);const je=pe.getState().chatItems;_(je.map(rt=>rt.id===ye.id&&rt.type==="message"?{...rt,content:[...rt.content,{type:"function_approval_request",request_id:He.request_id,status:"pending",function_call:He.function_call}],status:"in_progress"}:rt));continue}if(we.type==="response.function_result.complete"){const He=we,je={id:`result-${Date.now()}`,type:"function_call_output",call_id:He.call_id,output:He.output,status:He.status==="completed"?"completed":"incomplete",created_at:Math.floor(Date.now()/1e3)},rt=pe.getState().chatItems;_([...rt,je]);continue}if(we.type==="error"){const je=we.message||"An error occurred",rt=pe.getState().chatItems;_(rt.map(ft=>ft.id===ye.id&&ft.type==="message"?{...ft,content:[{type:"text",text:je}],status:"incomplete"}:ft)),E(!1);return}if(we.type==="response.output_item.added"){const je=we.item,rt=pe.getState().chatItems;_(rt.map(ft=>{if(ft.id===ye.id&&ft.type==="message"){const Vt=ft.content;let Fn=null;if(je.type==="output_image"?Fn={type:"output_image",image_url:je.image_url,alt_text:je.alt_text,mime_type:je.mime_type}:je.type==="output_file"?Fn={type:"output_file",filename:je.filename,file_url:je.file_url,file_data:je.file_data,mime_type:je.mime_type}:je.type==="output_data"&&(Fn={type:"output_data",data:je.data,mime_type:je.mime_type,description:je.description}),Fn)return{...ft,content:[...Vt,Fn],status:"in_progress"}}return ft}));continue}if(we.type==="response.output_text.delta"&&"delta"in we&&we.delta){de.current+=we.delta;const He=pe.getState().chatItems;_(He.map(je=>{if(je.id===ye.id&&je.type==="message"){const rt=je.content.filter(ft=>ft.type!=="text");return{...je,content:[...rt,{type:"text",text:de.current}],status:"in_progress"}}return je}))}}const Ke=Z.current,Ut=pe.getState().chatItems;_(Ut.map(we=>we.id===ye.id&&we.type==="message"?{...we,status:"completed",usage:Ke||void 0}:we)),E(!1),Ke&&D(Ke.total_tokens),Z.current=null}catch(ce){const Se=pe.getState().chatItems;_(Se.map(De=>De.id===ye.id&&De.type==="message"?{...De,content:[{type:"text",text:`Error: ${ce instanceof Error?ce.message:"Failed to get response"}`}],status:"incomplete"}:De)),E(!1)}},[e,s,n,_,E,S,N,z,D]),dt=async ae=>{if(ae.preventDefault(),!m.trim()&&p.length===0||d||!e)return;re.current=!0,M(!0);const ie=m.trim();k("");try{if(p.length>0||ie){const ue=[];ie&&ue.push({text:ie,type:"input_text"});for(const ye of p){const ce=await Ee(ye.file);if(ye.file.type.startsWith("image/"))ue.push({detail:"auto",type:"input_image",image_url:ce});else if(ye.file.type==="text/plain"&&(ye.file.name.includes("pasted-text-")||ye.file.name.endsWith(".txt")||ye.file.name.endsWith(".csv")||ye.file.name.endsWith(".json")||ye.file.name.endsWith(".html")||ye.file.name.endsWith(".md")||ye.file.name.endsWith(".tsv"))){const Se=await ye.file.text();ue.push({text:Se,type:"input_text"})}else{const Se=ce.split(",")[1];ue.push({type:"input_file",file_data:Se,file_url:ce,filename:ye.file.name})}}await We({input:[{type:"message",role:"user",content:ue}],conversation_id:s?.id})}else await We({input:[{type:"message",role:"user",content:[{text:ie,type:"input_text"}]}],conversation_id:s?.id});R([])}finally{M(!1)}},wn=e&&!d&&!c&&(m.trim()||p.length>0);return a.jsxs("div",{className:"flex h-[calc(100vh-3.5rem)] flex-col",children:[a.jsxs("div",{className:"border-b pb-2  p-4 flex-shrink-0",children:[a.jsxs("div",{className:"flex flex-col lg:flex-row lg:items-center lg:justify-between gap-3 mb-3",children:[a.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[a.jsx("h2",{className:"font-semibold text-sm truncate",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(rr,{className:"h-4 w-4 flex-shrink-0"}),a.jsx("span",{className:"truncate",children:b.enabled?`Chat with ${b.model}`:`Chat with ${e.name||e.id}`})]})}),!b.enabled&&g==="developer"&&a.jsxs(a.Fragment,{children:[a.jsx(Oe,{variant:"ghost",size:"sm",onClick:()=>V(!0),className:"h-6 w-6 p-0 flex-shrink-0",title:"View agent details",children:a.jsx(Ki,{className:"h-4 w-4"})}),a.jsx(Oe,{variant:"ghost",size:"sm",onClick:It,disabled:$||e.metadata?.source==="in_memory",className:"h-6 w-6 p-0 flex-shrink-0",title:e.metadata?.source==="in_memory"?"In-memory entities cannot be reloaded":$?"Reloading...":"Reload entity code (hot reload)",children:a.jsx(V1,{className:`h-4 w-4 ${$?"animate-spin":""}`})})]})]}),a.jsxs("div",{className:"flex flex-col sm:flex-row items-stretch sm:items-center gap-2 flex-shrink-0",children:[a.jsxs(ud,{value:s?.id||"",onValueChange:Zt,disabled:f||d,children:[a.jsx(fd,{className:"w-full sm:w-64",children:a.jsx(dd,{placeholder:f?"Loading...":o.length===0?"No conversations":s?`Conversation ${s.id.slice(-8)}`:"Select conversation",children:s&&a.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[a.jsxs("span",{children:["Conversation ",s.id.slice(-8)]}),v.total_tokens>0&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"text-muted-foreground",children:"•"}),a.jsxs("span",{className:"text-muted-foreground",children:[v.total_tokens>=1e3?`${(v.total_tokens/1e3).toFixed(1)}k`:v.total_tokens," ","tokens"]})]})]})})}),a.jsx(md,{children:o.map(ae=>a.jsx(hd,{value:ae.id,children:a.jsxs("div",{className:"flex items-center justify-between w-full",children:[a.jsxs("span",{children:["Conversation ",ae.id.slice(-8)]}),ae.created_at&&a.jsx("span",{className:"text-xs text-muted-foreground ml-3",children:new Date(ae.created_at*1e3).toLocaleDateString()})]})},ae.id))})]}),a.jsx(Oe,{variant:"outline",size:"icon",onClick:()=>s&&Qe(s.id),disabled:!s||d,title:s?`Delete Conversation ${s.id.slice(-8)}`:"No conversation selected",children:a.jsx(Lp,{className:"h-4 w-4"})}),a.jsxs(Oe,{variant:"outline",size:"lg",onClick:Ve,disabled:!e||d,className:"whitespace-nowrap ",children:[a.jsx(zp,{className:"h-4 w-4 mr-2"}),a.jsx("span",{className:"hidden md:inline",children:" New Conversation"})]})]})]}),b.enabled?a.jsx("p",{className:"text-sm text-muted-foreground",children:"Using OpenAI model directly. Local agent tools and instructions are not applied."}):e.description&&a.jsx("p",{className:"text-sm text-muted-foreground",children:e.description})]}),A&&a.jsxs("div",{className:"mx-4 mt-2 p-3 bg-destructive/10 border border-destructive/30 rounded-md flex items-start gap-2",children:[a.jsx(ws,{className:"h-4 w-4 text-destructive mt-0.5 flex-shrink-0"}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("div",{className:"text-sm font-medium text-destructive",children:"Failed to Create Conversation"}),a.jsx("div",{className:"text-xs text-destructive/90 mt-1 break-words",children:A.message}),A.code&&a.jsxs("div",{className:"text-xs text-destructive/70 mt-1",children:["Error Code: ",A.code]})]}),a.jsx("button",{onClick:()=>I(null),className:"text-destructive hover:text-destructive/80 flex-shrink-0",title:"Dismiss error",children:a.jsx(Ji,{className:"h-4 w-4"})})]}),a.jsx(Ss,{className:"flex-1 p-4 h-0",ref:T,children:a.jsxs("div",{className:"space-y-4",children:[l.length===0?a.jsxs("div",{className:"flex flex-col items-center justify-center h-32 text-center",children:[a.jsxs("div",{className:"text-muted-foreground text-sm",children:["Start a conversation with"," ",e.name||e.id]}),a.jsx("div",{className:"text-xs text-muted-foreground mt-1",children:"Type a message below to begin"})]}):l.map(ae=>a.jsx(OR,{item:ae},ae.id)),a.jsx("div",{ref:B})]})}),y.length>0&&a.jsx("div",{className:"border-t bg-amber-50 dark:bg-amber-950/20 p-4 flex-shrink-0",children:a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx(ws,{className:"h-5 w-5 text-amber-600 dark:text-amber-500 mt-0.5 flex-shrink-0"}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("h4",{className:"font-medium text-sm mb-2",children:"Approval Required"}),a.jsx("div",{className:"space-y-2",children:y.map(ae=>a.jsxs("div",{className:"bg-white dark:bg-gray-900 rounded-lg p-3 border border-amber-200 dark:border-amber-900",children:[a.jsxs("div",{className:"font-mono text-xs mb-3 break-all",children:[a.jsx("span",{className:"text-blue-600 dark:text-blue-400 font-semibold",children:ae.function_call.name}),a.jsx("span",{className:"text-gray-500",children:"("}),a.jsx("span",{className:"text-gray-700 dark:text-gray-300",children:JSON.stringify(ae.function_call.arguments)}),a.jsx("span",{className:"text-gray-500",children:")"})]}),a.jsxs("div",{className:"flex gap-2",children:[a.jsxs(Oe,{size:"sm",onClick:async()=>{const ie=await ht(ae.request_id,!0);ie&&await We(ie)},variant:"default",className:"flex-1 sm:flex-none",children:[a.jsx(Ea,{className:"h-4 w-4 mr-1"}),"Approve"]}),a.jsxs(Oe,{size:"sm",onClick:async()=>{const ie=await ht(ae.request_id,!1);ie&&await We(ie)},variant:"outline",className:"flex-1 sm:flex-none",children:[a.jsx(Ji,{className:"h-4 w-4 mr-1"}),"Reject"]})]})]},ae.request_id))})]})]})}),a.jsx("div",{className:"border-t flex-shrink-0",children:a.jsxs("div",{className:`p-4 relative transition-all duration-300 ease-in-out ${H?"bg-blue-50 dark:bg-blue-950/20":""}`,onDragEnter:le,onDragLeave:ve,onDragOver:Ne,onDrop:_e,children:[H&&a.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:a.jsxs("div",{className:"text-center",children:[a.jsx("div",{className:"text-blue-600 dark:text-blue-400 text-sm font-medium mb-1",children:"Drop files here"}),a.jsx("div",{className:"text-blue-500 dark:text-blue-500 text-xs",children:"Images, PDFs, and other files"})]})}),p.length>0&&a.jsx("div",{className:"mb-3",children:a.jsx(I5,{attachments:p,onRemoveAttachment:J})}),G&&a.jsxs("div",{className:`absolute bottom-24 left-1/2 -translate-x-1/2 z-20
                          bg-blue-500 text-white px-4 py-2 rounded-full text-sm
                          animate-in slide-in-from-bottom-2 fade-in duration-200
                          flex items-center gap-2 shadow-lg`,children:[G.includes("screenshot")?a.jsx(IM,{className:"h-3 w-3"}):a.jsx(Ns,{className:"h-3 w-3"}),G]}),a.jsxs("form",{onSubmit:dt,className:"flex gap-2 items-end",children:[a.jsx(to,{ref:W,value:m,onChange:ae=>k(ae.target.value),onPaste:be,onKeyDown:ae=>{ae.key==="Enter"&&!ae.shiftKey&&(ae.preventDefault(),dt(ae))},placeholder:`Message ${e.name||e.id}... (Shift+Enter for new line)`,disabled:d||c,className:"flex-1 min-h-[40px] max-h-[200px] resize-none",style:{fieldSizing:"content"}}),a.jsx(D5,{onFilesSelected:ge,disabled:d||c}),a.jsx(Oe,{type:"submit",size:"icon",disabled:!wn,className:"shrink-0 h-10",children:d?a.jsx(Up,{size:"sm"}):a.jsx(FM,{className:"h-4 w-4"})})]})]})}),a.jsx(DR,{agent:e,open:L,onOpenChange:V})]})}function Vv({message:e="Loading...",description:n,size:s="md",className:o,fullPage:l=!1}){const c=a.jsxs("div",{className:Ge("flex flex-col items-center justify-center gap-3",l?"min-h-[50vh]":"py-8",o),children:[a.jsx(Up,{size:s,className:"text-muted-foreground"}),a.jsxs("div",{className:"text-center space-y-1",children:[a.jsx("p",{className:Ge("font-medium text-muted-foreground",s==="sm"&&"text-sm",s==="lg"&&"text-lg"),children:e}),n&&a.jsx("p",{className:"text-sm text-muted-foreground/80",children:n})]})]});return l?a.jsx("div",{className:"flex items-center justify-center min-h-screen bg-background",children:c}):c}var pd="Checkbox",[IR,CI]=ir(pd),[LR,eg]=IR(pd);function HR(e){const{__scopeCheckbox:n,checked:s,children:o,defaultChecked:l,disabled:c,form:d,name:f,onCheckedChange:m,required:p,value:g="on",internal_do_not_use_render:v}=e,[y,b]=so({prop:s,defaultProp:l??!1,onChange:m,caller:pd}),[S,N]=w.useState(null),[_,E]=w.useState(null),M=w.useRef(!1),j=S?!!d||!!S.closest("form"):!0,k={checked:y,disabled:c,setChecked:b,control:S,setControl:N,name:f,form:d,value:g,hasConsumerStoppedPropagationRef:M,required:p,defaultChecked:ys(l)?!1:l,isFormControl:j,bubbleInput:_,setBubbleInput:E};return a.jsx(LR,{scope:n,...k,children:$R(v)?v(k):o})}var hN="CheckboxTrigger",pN=w.forwardRef(({__scopeCheckbox:e,onKeyDown:n,onClick:s,...o},l)=>{const{control:c,value:d,disabled:f,checked:m,required:p,setControl:g,setChecked:v,hasConsumerStoppedPropagationRef:y,isFormControl:b,bubbleInput:S}=eg(hN,e),N=nt(l,g),_=w.useRef(m);return w.useEffect(()=>{const E=c?.form;if(E){const M=()=>v(_.current);return E.addEventListener("reset",M),()=>E.removeEventListener("reset",M)}},[c,v]),a.jsx(Pe.button,{type:"button",role:"checkbox","aria-checked":ys(m)?"mixed":m,"aria-required":p,"data-state":wN(m),"data-disabled":f?"":void 0,disabled:f,value:d,...o,ref:N,onKeyDown:Te(n,E=>{E.key==="Enter"&&E.preventDefault()}),onClick:Te(s,E=>{v(M=>ys(M)?!0:!M),S&&b&&(y.current=E.isPropagationStopped(),y.current||E.stopPropagation())})})});pN.displayName=hN;var gN=w.forwardRef((e,n)=>{const{__scopeCheckbox:s,name:o,checked:l,defaultChecked:c,required:d,disabled:f,value:m,onCheckedChange:p,form:g,...v}=e;return a.jsx(HR,{__scopeCheckbox:s,checked:l,defaultChecked:c,disabled:f,required:d,onCheckedChange:p,name:o,form:g,value:m,internal_do_not_use_render:({isFormControl:y})=>a.jsxs(a.Fragment,{children:[a.jsx(pN,{...v,ref:n,__scopeCheckbox:s}),y&&a.jsx(bN,{__scopeCheckbox:s})]})})});gN.displayName=pd;var xN="CheckboxIndicator",yN=w.forwardRef((e,n)=>{const{__scopeCheckbox:s,forceMount:o,...l}=e,c=eg(xN,s);return a.jsx(Vn,{present:o||ys(c.checked)||c.checked===!0,children:a.jsx(Pe.span,{"data-state":wN(c.checked),"data-disabled":c.disabled?"":void 0,...l,ref:n,style:{pointerEvents:"none",...e.style}})})});yN.displayName=xN;var vN="CheckboxBubbleInput",bN=w.forwardRef(({__scopeCheckbox:e,...n},s)=>{const{control:o,hasConsumerStoppedPropagationRef:l,checked:c,defaultChecked:d,required:f,disabled:m,name:p,value:g,form:v,bubbleInput:y,setBubbleInput:b}=eg(vN,e),S=nt(s,b),N=Kp(c),_=Np(o);w.useEffect(()=>{const M=y;if(!M)return;const j=window.HTMLInputElement.prototype,R=Object.getOwnPropertyDescriptor(j,"checked").set,D=!l.current;if(N!==c&&R){const z=new Event("click",{bubbles:D});M.indeterminate=ys(c),R.call(M,ys(c)?!1:c),M.dispatchEvent(z)}},[y,N,c,l]);const E=w.useRef(ys(c)?!1:c);return a.jsx(Pe.input,{type:"checkbox","aria-hidden":!0,defaultChecked:d??E.current,required:f,disabled:m,name:p,value:g,form:v,...n,tabIndex:-1,ref:S,style:{...n.style,..._,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});bN.displayName=vN;function $R(e){return typeof e=="function"}function ys(e){return e==="indeterminate"}function wN(e){return ys(e)?"indeterminate":e?"checked":"unchecked"}function Qs({className:e,...n}){return a.jsx(gN,{"data-slot":"checkbox",className:Ge("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),...n,children:a.jsx(yN,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current transition-none",children:a.jsx(Ea,{className:"size-3.5"})})})}function BR(e){return["name","title","id","key","label","type","status","tag","category","code","username","password"].includes(e.toLowerCase())}function fs({name:e,schema:n,value:s,onChange:o,isRequired:l=!1}){const{type:c,description:d,enum:f,default:m}=n,p=n.format==="textarea"||d&&d.length>100||c==="string"&&!f&&!BR(e),g=p||d&&d.length>150,v=p||d&&d.length>80||c==="array",y=(()=>{switch(c){case"string":return f?a.jsxs("div",{className:"space-y-2",children:[a.jsxs(gt,{htmlFor:e,children:[e,l&&a.jsx("span",{className:"text-destructive ml-1",children:"*"})]}),a.jsxs(ud,{value:typeof s=="string"&&s?s:typeof m=="string"?m:f[0],onValueChange:S=>o(S),children:[a.jsx(fd,{children:a.jsx(dd,{placeholder:`Select ${e}`})}),a.jsx(md,{children:f.map(S=>a.jsx(hd,{value:S,children:S},S))})]}),d&&a.jsx("p",{className:"text-sm text-muted-foreground",children:d})]}):p||d&&d.length>100?a.jsxs("div",{className:"space-y-2",children:[a.jsxs(gt,{htmlFor:e,children:[e,l&&a.jsx("span",{className:"text-destructive ml-1",children:"*"})]}),a.jsx(to,{id:e,value:typeof s=="string"?s:"",onChange:S=>o(S.target.value),placeholder:typeof m=="string"?m:`Enter ${e}`,rows:p?4:2,className:"min-w-[300px] w-full"}),d&&a.jsx("p",{className:"text-sm text-muted-foreground",children:d})]}):a.jsxs("div",{className:"space-y-2",children:[a.jsxs(gt,{htmlFor:e,children:[e,l&&a.jsx("span",{className:"text-destructive ml-1",children:"*"})]}),a.jsx(An,{id:e,type:"text",value:typeof s=="string"?s:"",onChange:S=>o(S.target.value),placeholder:typeof m=="string"?m:`Enter ${e}`}),d&&a.jsx("p",{className:"text-sm text-muted-foreground",children:d})]});case"number":return a.jsxs("div",{className:"space-y-2",children:[a.jsxs(gt,{htmlFor:e,children:[e,l&&a.jsx("span",{className:"text-destructive ml-1",children:"*"})]}),a.jsx(An,{id:e,type:"number",value:typeof s=="number"?s:"",onChange:S=>{const N=parseFloat(S.target.value);o(isNaN(N)?"":N)},placeholder:typeof m=="number"?m.toString():`Enter ${e}`}),d&&a.jsx("p",{className:"text-sm text-muted-foreground",children:d})]});case"boolean":return a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(Qs,{id:e,checked:!!s,onCheckedChange:S=>o(S)}),a.jsxs(gt,{htmlFor:e,children:[e,l&&a.jsx("span",{className:"text-destructive ml-1",children:"*"})]})]}),d&&a.jsx("p",{className:"text-sm text-muted-foreground",children:d})]});case"array":return a.jsxs("div",{className:"space-y-2",children:[a.jsxs(gt,{htmlFor:e,children:[e,l&&a.jsx("span",{className:"text-destructive ml-1",children:"*"})]}),a.jsx(to,{id:e,value:Array.isArray(s)?s.join(", "):typeof s=="string"?s:"",onChange:S=>{const N=S.target.value.split(",").map(_=>_.trim()).filter(_=>_.length>0);o(N)},placeholder:"Enter items separated by commas",rows:2}),d&&a.jsx("p",{className:"text-sm text-muted-foreground",children:d})]});case"object":default:return a.jsxs("div",{className:"space-y-2",children:[a.jsxs(gt,{htmlFor:e,children:[e,l&&a.jsx("span",{className:"text-destructive ml-1",children:"*"})]}),a.jsx(to,{id:e,value:typeof s=="object"&&s!==null?JSON.stringify(s,null,2):typeof s=="string"?s:"",onChange:S=>{try{const N=JSON.parse(S.target.value);o(N)}catch{o(S.target.value)}},placeholder:'{"key": "value"}',rows:3}),d&&a.jsx("p",{className:"text-sm text-muted-foreground",children:d})]})}})(),b=()=>g?"md:col-span-2 lg:col-span-3 xl:col-span-4":v?"xl:col-span-2":"";return a.jsx("div",{className:b(),children:y})}function PR({inputSchema:e,inputTypeName:n,onSubmit:s,isSubmitting:o=!1,className:l}){const[c,d]=w.useState(!1),[f,m]=w.useState(!1),p=l?.includes("embedded"),[g,v]=w.useState({}),[y,b]=w.useState(!1),S=e.properties||{},N=Object.keys(S),_=e.required||[],E=e.type==="string"&&!e.enum,M=N.filter(A=>!_.includes(A)),j=_.includes("role")&&M.some(A=>["text","message","content"].includes(A))&&S.role?.type==="string",k=N.filter(A=>_.includes(A)&&!(j&&A==="role")),R=M,D=j?[...R].sort((A,I)=>{const $=P=>["text","message","content"].includes(P)?1:0;return $(I)-$(A)}):R,H=Math.max(0,(j?1:6)-k.length),U=D.slice(0,H),F=D.slice(H),K=F.length>0,G=k.length>0,ne=E?g.value!==void 0&&g.value!=="":_.length>0?_.every(A=>j&&A==="role"&&g.role==="user"?!0:g[A]!==void 0&&g[A]!==""):Object.keys(g).length>0;w.useEffect(()=>{if(e.type==="string")v({value:e.default||""});else if(e.type==="object"&&e.properties){const A={};Object.entries(e.properties).forEach(([I,$])=>{$.default!==void 0?A[I]=$.default:$.enum&&$.enum.length>0&&(A[I]=$.enum[0])}),j&&!A.role&&(A.role="user"),v(A)}},[e,j]);const L=A=>{if(A.preventDefault(),b(!0),e.type==="string")s({input:g.value||""});else if(e.type==="object"){const I=e.properties||{},$=Object.keys(I);if($.length===1){const P=$[0];s({[P]:g[P]||""})}else{const P={};Object.keys(g).forEach(T=>{const B=g[T];(_.includes(T)||B!==void 0&&B!==""&&B!==null)&&(P[T]=B)}),s(P)}}else s(g);p||d(!1),b(!1)},V=(A,I)=>{v($=>({...$,[A]:I}))};return p?a.jsxs("form",{onSubmit:L,className:l,children:[a.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[E&&a.jsx(fs,{name:"Input",schema:e,value:g.value,onChange:A=>V("value",A),isRequired:!1}),!E&&a.jsxs(a.Fragment,{children:[k.map(A=>a.jsx(fs,{name:A,schema:S[A],value:g[A],onChange:I=>V(A,I),isRequired:!0},A)),G&&R.length>0&&a.jsx("div",{className:"sm:col-span-2 border-t border-border my-2"}),U.map(A=>a.jsx(fs,{name:A,schema:S[A],value:g[A],onChange:I=>V(A,I),isRequired:!1},A)),K&&a.jsx("div",{className:"sm:col-span-2",children:a.jsx(Oe,{type:"button",variant:"ghost",size:"sm",onClick:()=>m(!f),className:"w-full justify-center gap-2",children:f?a.jsxs(a.Fragment,{children:[a.jsx(Eu,{className:"h-4 w-4"}),"Hide ",F.length," optional field",F.length!==1?"s":""]}):a.jsxs(a.Fragment,{children:[a.jsx(Xt,{className:"h-4 w-4"}),"Show ",F.length," optional field",F.length!==1?"s":""]})})}),f&&F.map(A=>a.jsx(fs,{name:A,schema:S[A],value:g[A],onChange:I=>V(A,I),isRequired:!1},A))]})]}),a.jsx("div",{className:"flex gap-2 mt-4 justify-end",children:a.jsxs(Oe,{type:"submit",disabled:y||!ne,size:"default",children:[a.jsx(uu,{className:"h-4 w-4"}),y?"Running...":"Run Workflow"]})})]}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:Ge("flex flex-col",l),children:[a.jsxs("div",{className:"border-b border-border px-4 py-3 bg-muted",children:[a.jsx(Qp,{className:"text-sm mb-3",children:"Run Workflow"}),a.jsxs(Oe,{onClick:()=>d(!0),disabled:o,className:"w-full",size:"default",children:[a.jsx(uu,{className:"h-4 w-4 mr-2"}),o?"Running...":"Run Workflow"]})]}),a.jsxs("div",{className:"px-4 py-3",children:[a.jsxs("div",{className:"text-sm text-muted-foreground",children:[a.jsx("strong",{children:"Input Type:"})," ",a.jsx("code",{className:"bg-muted px-1 py-0.5 rounded",children:n}),e.type==="object"&&e.properties&&a.jsxs("span",{className:"ml-2",children:["(",Object.keys(e.properties).length," field",Object.keys(e.properties).length!==1?"s":"",")"]})]}),a.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:'Click "Run Workflow" to configure inputs and execute'})]})]}),a.jsx(js,{open:c,onOpenChange:d,children:a.jsxs(_s,{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:[a.jsxs(Es,{children:[a.jsx(Cs,{children:"Run Workflow"}),a.jsx(Ca,{onClose:()=>d(!1)})]}),a.jsx("div",{className:"px-8 py-4 border-b flex-shrink-0",children:a.jsx("div",{className:"text-sm text-muted-foreground",children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("span",{className:"font-medium",children:"Input Type:"}),a.jsx("code",{className:"bg-muted px-3 py-1 text-xs font-mono",children:n}),e.type==="object"&&a.jsxs("span",{className:"text-xs text-muted-foreground",children:[N.length," field",N.length!==1?"s":""]})]})})}),a.jsx("div",{className:"px-8 py-6 overflow-y-auto flex-1 min-h-0",children:a.jsx("form",{id:"workflow-modal-form",onSubmit:L,children:a.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:[E&&a.jsxs("div",{className:"md:col-span-2 lg:col-span-3 xl:col-span-4",children:[a.jsx(fs,{name:"Input",schema:e,value:g.value,onChange:A=>V("value",A),isRequired:!1}),e.description&&a.jsx("p",{className:"text-sm text-muted-foreground mt-2",children:e.description})]}),!E&&a.jsxs(a.Fragment,{children:[k.map(A=>a.jsx(fs,{name:A,schema:S[A],value:g[A],onChange:I=>V(A,I),isRequired:!0},A)),G&&R.length>0&&a.jsx("div",{className:"md:col-span-2 lg:col-span-3 xl:col-span-4",children:a.jsx("div",{className:"border-t border-border"})}),U.map(A=>a.jsx(fs,{name:A,schema:S[A],value:g[A],onChange:I=>V(A,I),isRequired:!1},A)),K&&a.jsx("div",{className:"md:col-span-2 lg:col-span-3 xl:col-span-4",children:a.jsx(Oe,{type:"button",variant:"ghost",size:"sm",onClick:()=>m(!f),className:"w-full justify-center gap-2",children:f?a.jsxs(a.Fragment,{children:[a.jsx(Eu,{className:"h-4 w-4"}),"Hide ",F.length," optional field",F.length!==1?"s":""]}):a.jsxs(a.Fragment,{children:[a.jsx(Xt,{className:"h-4 w-4"}),"Show ",F.length," optional field",F.length!==1?"s":""]})})}),f&&F.map(A=>a.jsx(fs,{name:A,schema:S[A],value:g[A],onChange:I=>V(A,I),isRequired:!1},A))]})]})})}),a.jsx("div",{className:"px-8 py-4 border-t flex-shrink-0",children:a.jsxs(N2,{children:[a.jsx(Oe,{variant:"outline",onClick:()=>d(!1),disabled:y,children:"Cancel"}),a.jsxs(Oe,{type:"submit",form:"workflow-modal-form",disabled:y||!ne,children:[a.jsx(uu,{className:"h-4 w-4 mr-2"}),y?"Running...":"Run Workflow"]})]})})]})})]})}function UR(e){return["name","title","id","key","label","type","status","tag","category","code","username","password","email"].includes(e.toLowerCase())}function NN(e,n){return n.format==="textarea"||!!n.description&&n.description.length>100||n.type==="string"&&!n.enum&&!UR(e)}function VR(e,n){const s=NN(e,n),o=!!n.description&&n.description.length>150;return s||o?"md:col-span-2 lg:col-span-3 xl:col-span-4":n.type==="array"||n.description&&n.description.length>80?"xl:col-span-2":""}function qR(e,n){if(e.type!=="object"||!e.properties)return!1;const s=e.properties,o=Object.keys(s).filter(l=>!n.includes(l));return n.includes("role")&&o.some(l=>["text","message","content"].includes(l))&&s.role?.type==="string"}function ch({name:e,schema:n,value:s,onChange:o,isRequired:l=!1,isReadOnly:c=!1}){const{type:d,description:f,enum:m,default:p}=n,g=NN(e,n),v=()=>{if(c)return a.jsxs("div",{className:"space-y-2",children:[a.jsx(gt,{htmlFor:e,className:"text-muted-foreground",children:e}),a.jsx("div",{className:"text-sm p-2 bg-muted rounded border",children:typeof s=="object"?JSON.stringify(s,null,2):String(s)}),f&&a.jsx("p",{className:"text-xs text-muted-foreground",children:f})]});switch(d){case"string":return m?a.jsxs("div",{className:"space-y-2",children:[a.jsxs(gt,{htmlFor:e,children:[e,l&&a.jsx("span",{className:"text-destructive ml-1",children:"*"})]}),a.jsxs(ud,{value:typeof s=="string"&&s?s:typeof p=="string"?p:m[0],onValueChange:y=>o(y),children:[a.jsx(fd,{children:a.jsx(dd,{placeholder:`Select ${e}`})}),a.jsx(md,{children:m.map(y=>a.jsx(hd,{value:y,children:y},y))})]}),f&&a.jsx("p",{className:"text-sm text-muted-foreground",children:f})]}):g?a.jsxs("div",{className:"space-y-2",children:[a.jsxs(gt,{htmlFor:e,children:[e,l&&a.jsx("span",{className:"text-destructive ml-1",children:"*"})]}),a.jsx(to,{id:e,value:typeof s=="string"?s:"",onChange:y=>o(y.target.value),placeholder:typeof p=="string"?p:`Enter ${e}`,rows:4,className:"min-w-[300px] w-full"}),f&&a.jsx("p",{className:"text-sm text-muted-foreground",children:f})]}):a.jsxs("div",{className:"space-y-2",children:[a.jsxs(gt,{htmlFor:e,children:[e,l&&a.jsx("span",{className:"text-destructive ml-1",children:"*"})]}),a.jsx(An,{id:e,type:"text",value:typeof s=="string"?s:"",onChange:y=>o(y.target.value),placeholder:typeof p=="string"?p:`Enter ${e}`}),f&&a.jsx("p",{className:"text-sm text-muted-foreground",children:f})]});case"integer":case"number":return a.jsxs("div",{className:"space-y-2",children:[a.jsxs(gt,{htmlFor:e,children:[e,l&&a.jsx("span",{className:"text-destructive ml-1",children:"*"})]}),a.jsx(An,{id:e,type:"number",step:d==="integer"?"1":"any",value:typeof s=="number"?s:"",onChange:y=>{const b=d==="integer"?parseInt(y.target.value):parseFloat(y.target.value);o(isNaN(b)?"":b)},placeholder:typeof p=="number"?p.toString():`Enter ${e}`}),f&&a.jsx("p",{className:"text-sm text-muted-foreground",children:f})]});case"boolean":return a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(Qs,{id:e,checked:!!s,onCheckedChange:y=>o(y)}),a.jsxs(gt,{htmlFor:e,children:[e,l&&a.jsx("span",{className:"text-destructive ml-1",children:"*"})]})]}),f&&a.jsx("p",{className:"text-sm text-muted-foreground",children:f})]});case"array":return a.jsxs("div",{className:"space-y-2",children:[a.jsxs(gt,{htmlFor:e,children:[e,l&&a.jsx("span",{className:"text-destructive ml-1",children:"*"})]}),a.jsx(to,{id:e,value:Array.isArray(s)?s.join(", "):typeof s=="string"?s:"",onChange:y=>{const b=y.target.value.split(",").map(S=>S.trim()).filter(S=>S.length>0);o(b)},placeholder:"Enter items separated by commas",rows:2}),f&&a.jsx("p",{className:"text-sm text-muted-foreground",children:f})]});case"object":default:return a.jsxs("div",{className:"space-y-2",children:[a.jsxs(gt,{htmlFor:e,children:[e,l&&a.jsx("span",{className:"text-destructive ml-1",children:"*"})]}),a.jsx(to,{id:e,value:typeof s=="object"&&s!==null?JSON.stringify(s,null,2):typeof s=="string"?s:"",onChange:y=>{try{const b=JSON.parse(y.target.value);o(b)}catch{o(y.target.value)}},placeholder:'{"key": "value"}',rows:3,className:"font-mono text-xs"}),f&&a.jsx("p",{className:"text-sm text-muted-foreground",children:f})]})}};return a.jsx("div",{className:VR(e,n),children:v()})}function FR({schema:e,values:n,onChange:s,disabled:o=!1,readOnlyFields:l=[],hideFields:c=[],showCollapsedByDefault:d=!1}){const[f,m]=w.useState(d),p=e.properties||{},g=Object.keys(p).filter(z=>!c.includes(z)),v=(e.required||[]).filter(z=>!c.includes(z)),y=qR(e,v),b=g.filter(z=>v.includes(z)&&!(y&&z==="role")),S=g.filter(z=>!v.includes(z)),N=y?[...S].sort((z,H)=>{const U=F=>["text","message","content"].includes(F)?1:0;return U(H)-U(z)}):S,E=Math.max(0,(y?1:6)-b.length),M=N.slice(0,E),j=N.slice(E),k=j.length>0,R=b.length>0,D=(z,H)=>{s({...n,[z]:H})};return a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4 md:gap-6",children:[b.map(z=>a.jsx(ch,{name:z,schema:p[z],value:n[z],onChange:H=>D(z,H),isRequired:!0,isReadOnly:o||l.includes(z)},z)),R&&S.length>0&&a.jsx("div",{className:"md:col-span-2 lg:col-span-3 xl:col-span-4",children:a.jsx("div",{className:"border-t border-border"})}),M.map(z=>a.jsx(ch,{name:z,schema:p[z],value:n[z],onChange:H=>D(z,H),isRequired:!1,isReadOnly:o||l.includes(z)},z)),k&&a.jsx("div",{className:"md:col-span-2 lg:col-span-3 xl:col-span-4",children:a.jsx(Oe,{type:"button",variant:"ghost",size:"sm",onClick:()=>m(!f),className:"w-full justify-center gap-2",disabled:o,children:f?a.jsxs(a.Fragment,{children:[a.jsx(Eu,{className:"h-4 w-4"}),"Hide ",j.length," optional field",j.length!==1?"s":""]}):a.jsxs(a.Fragment,{children:[a.jsx(Xt,{className:"h-4 w-4"}),"Show ",j.length," optional field",j.length!==1?"s":""]})})}),f&&j.map(z=>a.jsx(ch,{name:z,schema:p[z],value:n[z],onChange:H=>D(z,H),isRequired:!1,isReadOnly:o||l.includes(z)},z))]})}function YR(e,n){return(e.required||[]).every(o=>{const l=n[o];return l!==void 0&&l!==""&&l!==null})}function GR({open:e,onOpenChange:n,requests:s,responses:o,onResponseChange:l,onSubmit:c,isSubmitting:d}){const f=()=>s.every(m=>{const p=o[m.request_id]||{};return YR(m.request_schema,p)});return a.jsx(js,{open:e,onOpenChange:n,children:a.jsxs(_s,{className:"max-w-3xl max-h-[80vh] overflow-y-auto",children:[a.jsxs(Es,{className:"px-6 pt-6 pb-4",children:[a.jsxs(Cs,{className:"flex items-center gap-2",children:[a.jsx(CM,{className:"w-5 h-5"}),"Workflow Requires Input (",s.length," request",s.length>1?"s":"",")"]}),a.jsx(w2,{children:"The workflow is paused and needs your input to continue."})]}),a.jsx("div",{className:"space-y-6",children:s.map((m,p)=>a.jsxs(O2,{children:[a.jsx(z2,{children:a.jsxs(Qp,{className:"text-sm flex items-center gap-2",children:["Request ",p+1,a.jsx(Qt,{variant:"outline",className:"ml-2 font-mono text-xs",children:m.request_id.slice(0,8)})]})}),a.jsxs(I2,{children:[Object.keys(m.request_data).length>0&&a.jsxs("div",{className:"mb-4 p-3 bg-muted rounded-md max-h-48 overflow-y-auto",children:[a.jsx("p",{className:"text-xs font-medium text-muted-foreground mb-2",children:"Request Context:"}),a.jsx("div",{className:"space-y-1",children:Object.entries(m.request_data).filter(([g])=>!["request_id","source_executor_id"].includes(g)).map(([g,v])=>a.jsxs("div",{className:"text-xs",children:[a.jsxs("span",{className:"font-medium",children:[g,":"]})," ",a.jsx("span",{className:"text-muted-foreground break-all",children:typeof v=="object"?JSON.stringify(v):String(v)})]},g))})]}),m.request_schema?.description&&a.jsxs("div",{className:"mb-4 p-3 bg-blue-50 dark:bg-blue-950/30 border border-blue-200 dark:border-blue-800 rounded-md",children:[a.jsx("p",{className:"text-xs font-medium text-blue-900 dark:text-blue-100 mb-1",children:"Expected Response:"}),a.jsx("p",{className:"text-xs text-blue-700 dark:text-blue-300",children:m.request_schema.description})]}),a.jsx(FR,{schema:m.request_schema,values:o[m.request_id]||{},onChange:g=>l(m.request_id,g),disabled:d})]})]},m.request_id))}),a.jsx(N2,{children:a.jsxs("div",{className:"flex gap-2 w-full justify-end",children:[a.jsx(Oe,{variant:"outline",onClick:()=>n(!1),disabled:d,children:"Cancel"}),a.jsx(Oe,{onClick:c,disabled:d||!f(),children:d?a.jsxs(a.Fragment,{children:[a.jsx(go,{className:"w-4 h-4 animate-spin mr-2"}),"Submitting..."]}):a.jsxs(a.Fragment,{children:[a.jsx(uu,{className:"w-4 h-4 mr-2"}),"Submit & Continue"]})})]})})]})})}function kt(e){if(typeof e=="string"||typeof e=="number")return""+e;let n="";if(Array.isArray(e))for(let s=0,o;s<e.length;s++)(o=kt(e[s]))!==""&&(n+=(n&&" ")+o);else for(let s in e)e[s]&&(n+=(n&&" ")+s);return n}var XR={value:()=>{}};function gd(){for(var e=0,n=arguments.length,s={},o;e<n;++e){if(!(o=arguments[e]+"")||o in s||/[\s.]/.test(o))throw new Error("illegal type: "+o);s[o]=[]}return new hu(s)}function hu(e){this._=e}function ZR(e,n){return e.trim().split(/^|\s+/).map(function(s){var o="",l=s.indexOf(".");if(l>=0&&(o=s.slice(l+1),s=s.slice(0,l)),s&&!n.hasOwnProperty(s))throw new Error("unknown type: "+s);return{type:s,name:o}})}hu.prototype=gd.prototype={constructor:hu,on:function(e,n){var s=this._,o=ZR(e+"",s),l,c=-1,d=o.length;if(arguments.length<2){for(;++c<d;)if((l=(e=o[c]).type)&&(l=WR(s[l],e.name)))return l;return}if(n!=null&&typeof n!="function")throw new Error("invalid callback: "+n);for(;++c<d;)if(l=(e=o[c]).type)s[l]=qv(s[l],e.name,n);else if(n==null)for(l in s)s[l]=qv(s[l],e.name,null);return this},copy:function(){var e={},n=this._;for(var s in n)e[s]=n[s].slice();return new hu(e)},call:function(e,n){if((l=arguments.length-2)>0)for(var s=new Array(l),o=0,l,c;o<l;++o)s[o]=arguments[o+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(c=this._[e],o=0,l=c.length;o<l;++o)c[o].value.apply(n,s)},apply:function(e,n,s){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var o=this._[e],l=0,c=o.length;l<c;++l)o[l].value.apply(n,s)}};function WR(e,n){for(var s=0,o=e.length,l;s<o;++s)if((l=e[s]).name===n)return l.value}function qv(e,n,s){for(var o=0,l=e.length;o<l;++o)if(e[o].name===n){e[o]=XR,e=e.slice(0,o).concat(e.slice(o+1));break}return s!=null&&e.push({name:n,value:s}),e}var Xh="http://www.w3.org/1999/xhtml";const Fv={svg:"http://www.w3.org/2000/svg",xhtml:Xh,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function xd(e){var n=e+="",s=n.indexOf(":");return s>=0&&(n=e.slice(0,s))!=="xmlns"&&(e=e.slice(s+1)),Fv.hasOwnProperty(n)?{space:Fv[n],local:e}:e}function KR(e){return function(){var n=this.ownerDocument,s=this.namespaceURI;return s===Xh&&n.documentElement.namespaceURI===Xh?n.createElement(e):n.createElementNS(s,e)}}function QR(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function SN(e){var n=xd(e);return(n.local?QR:KR)(n)}function JR(){}function tg(e){return e==null?JR:function(){return this.querySelector(e)}}function e6(e){typeof e!="function"&&(e=tg(e));for(var n=this._groups,s=n.length,o=new Array(s),l=0;l<s;++l)for(var c=n[l],d=c.length,f=o[l]=new Array(d),m,p,g=0;g<d;++g)(m=c[g])&&(p=e.call(m,m.__data__,g,c))&&("__data__"in m&&(p.__data__=m.__data__),f[g]=p);return new bn(o,this._parents)}function t6(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function n6(){return[]}function jN(e){return e==null?n6:function(){return this.querySelectorAll(e)}}function r6(e){return function(){return t6(e.apply(this,arguments))}}function s6(e){typeof e=="function"?e=r6(e):e=jN(e);for(var n=this._groups,s=n.length,o=[],l=[],c=0;c<s;++c)for(var d=n[c],f=d.length,m,p=0;p<f;++p)(m=d[p])&&(o.push(e.call(m,m.__data__,p,d)),l.push(m));return new bn(o,l)}function _N(e){return function(){return this.matches(e)}}function EN(e){return function(n){return n.matches(e)}}var o6=Array.prototype.find;function a6(e){return function(){return o6.call(this.children,e)}}function i6(){return this.firstElementChild}function l6(e){return this.select(e==null?i6:a6(typeof e=="function"?e:EN(e)))}var c6=Array.prototype.filter;function u6(){return Array.from(this.children)}function d6(e){return function(){return c6.call(this.children,e)}}function f6(e){return this.selectAll(e==null?u6:d6(typeof e=="function"?e:EN(e)))}function m6(e){typeof e!="function"&&(e=_N(e));for(var n=this._groups,s=n.length,o=new Array(s),l=0;l<s;++l)for(var c=n[l],d=c.length,f=o[l]=[],m,p=0;p<d;++p)(m=c[p])&&e.call(m,m.__data__,p,c)&&f.push(m);return new bn(o,this._parents)}function CN(e){return new Array(e.length)}function h6(){return new bn(this._enter||this._groups.map(CN),this._parents)}function Du(e,n){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=n}Du.prototype={constructor:Du,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,n){return this._parent.insertBefore(e,n)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function p6(e){return function(){return e}}function g6(e,n,s,o,l,c){for(var d=0,f,m=n.length,p=c.length;d<p;++d)(f=n[d])?(f.__data__=c[d],o[d]=f):s[d]=new Du(e,c[d]);for(;d<m;++d)(f=n[d])&&(l[d]=f)}function x6(e,n,s,o,l,c,d){var f,m,p=new Map,g=n.length,v=c.length,y=new Array(g),b;for(f=0;f<g;++f)(m=n[f])&&(y[f]=b=d.call(m,m.__data__,f,n)+"",p.has(b)?l[f]=m:p.set(b,m));for(f=0;f<v;++f)b=d.call(e,c[f],f,c)+"",(m=p.get(b))?(o[f]=m,m.__data__=c[f],p.delete(b)):s[f]=new Du(e,c[f]);for(f=0;f<g;++f)(m=n[f])&&p.get(y[f])===m&&(l[f]=m)}function y6(e){return e.__data__}function v6(e,n){if(!arguments.length)return Array.from(this,y6);var s=n?x6:g6,o=this._parents,l=this._groups;typeof e!="function"&&(e=p6(e));for(var c=l.length,d=new Array(c),f=new Array(c),m=new Array(c),p=0;p<c;++p){var g=o[p],v=l[p],y=v.length,b=b6(e.call(g,g&&g.__data__,p,o)),S=b.length,N=f[p]=new Array(S),_=d[p]=new Array(S),E=m[p]=new Array(y);s(g,v,N,_,E,b,n);for(var M=0,j=0,k,R;M<S;++M)if(k=N[M]){for(M>=j&&(j=M+1);!(R=_[j])&&++j<S;);k._next=R||null}}return d=new bn(d,o),d._enter=f,d._exit=m,d}function b6(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function w6(){return new bn(this._exit||this._groups.map(CN),this._parents)}function N6(e,n,s){var o=this.enter(),l=this,c=this.exit();return typeof e=="function"?(o=e(o),o&&(o=o.selection())):o=o.append(e+""),n!=null&&(l=n(l),l&&(l=l.selection())),s==null?c.remove():s(c),o&&l?o.merge(l).order():l}function S6(e){for(var n=e.selection?e.selection():e,s=this._groups,o=n._groups,l=s.length,c=o.length,d=Math.min(l,c),f=new Array(l),m=0;m<d;++m)for(var p=s[m],g=o[m],v=p.length,y=f[m]=new Array(v),b,S=0;S<v;++S)(b=p[S]||g[S])&&(y[S]=b);for(;m<l;++m)f[m]=s[m];return new bn(f,this._parents)}function j6(){for(var e=this._groups,n=-1,s=e.length;++n<s;)for(var o=e[n],l=o.length-1,c=o[l],d;--l>=0;)(d=o[l])&&(c&&d.compareDocumentPosition(c)^4&&c.parentNode.insertBefore(d,c),c=d);return this}function _6(e){e||(e=E6);function n(v,y){return v&&y?e(v.__data__,y.__data__):!v-!y}for(var s=this._groups,o=s.length,l=new Array(o),c=0;c<o;++c){for(var d=s[c],f=d.length,m=l[c]=new Array(f),p,g=0;g<f;++g)(p=d[g])&&(m[g]=p);m.sort(n)}return new bn(l,this._parents).order()}function E6(e,n){return e<n?-1:e>n?1:e>=n?0:NaN}function C6(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function k6(){return Array.from(this)}function A6(){for(var e=this._groups,n=0,s=e.length;n<s;++n)for(var o=e[n],l=0,c=o.length;l<c;++l){var d=o[l];if(d)return d}return null}function M6(){let e=0;for(const n of this)++e;return e}function T6(){return!this.node()}function R6(e){for(var n=this._groups,s=0,o=n.length;s<o;++s)for(var l=n[s],c=0,d=l.length,f;c<d;++c)(f=l[c])&&e.call(f,f.__data__,c,l);return this}function D6(e){return function(){this.removeAttribute(e)}}function O6(e){return function(){this.removeAttributeNS(e.space,e.local)}}function z6(e,n){return function(){this.setAttribute(e,n)}}function I6(e,n){return function(){this.setAttributeNS(e.space,e.local,n)}}function L6(e,n){return function(){var s=n.apply(this,arguments);s==null?this.removeAttribute(e):this.setAttribute(e,s)}}function H6(e,n){return function(){var s=n.apply(this,arguments);s==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,s)}}function $6(e,n){var s=xd(e);if(arguments.length<2){var o=this.node();return s.local?o.getAttributeNS(s.space,s.local):o.getAttribute(s)}return this.each((n==null?s.local?O6:D6:typeof n=="function"?s.local?H6:L6:s.local?I6:z6)(s,n))}function kN(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function B6(e){return function(){this.style.removeProperty(e)}}function P6(e,n,s){return function(){this.style.setProperty(e,n,s)}}function U6(e,n,s){return function(){var o=n.apply(this,arguments);o==null?this.style.removeProperty(e):this.style.setProperty(e,o,s)}}function V6(e,n,s){return arguments.length>1?this.each((n==null?B6:typeof n=="function"?U6:P6)(e,n,s??"")):ha(this.node(),e)}function ha(e,n){return e.style.getPropertyValue(n)||kN(e).getComputedStyle(e,null).getPropertyValue(n)}function q6(e){return function(){delete this[e]}}function F6(e,n){return function(){this[e]=n}}function Y6(e,n){return function(){var s=n.apply(this,arguments);s==null?delete this[e]:this[e]=s}}function G6(e,n){return arguments.length>1?this.each((n==null?q6:typeof n=="function"?Y6:F6)(e,n)):this.node()[e]}function AN(e){return e.trim().split(/^|\s+/)}function ng(e){return e.classList||new MN(e)}function MN(e){this._node=e,this._names=AN(e.getAttribute("class")||"")}MN.prototype={add:function(e){var n=this._names.indexOf(e);n<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var n=this._names.indexOf(e);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function TN(e,n){for(var s=ng(e),o=-1,l=n.length;++o<l;)s.add(n[o])}function RN(e,n){for(var s=ng(e),o=-1,l=n.length;++o<l;)s.remove(n[o])}function X6(e){return function(){TN(this,e)}}function Z6(e){return function(){RN(this,e)}}function W6(e,n){return function(){(n.apply(this,arguments)?TN:RN)(this,e)}}function K6(e,n){var s=AN(e+"");if(arguments.length<2){for(var o=ng(this.node()),l=-1,c=s.length;++l<c;)if(!o.contains(s[l]))return!1;return!0}return this.each((typeof n=="function"?W6:n?X6:Z6)(s,n))}function Q6(){this.textContent=""}function J6(e){return function(){this.textContent=e}}function eD(e){return function(){var n=e.apply(this,arguments);this.textContent=n??""}}function tD(e){return arguments.length?this.each(e==null?Q6:(typeof e=="function"?eD:J6)(e)):this.node().textContent}function nD(){this.innerHTML=""}function rD(e){return function(){this.innerHTML=e}}function sD(e){return function(){var n=e.apply(this,arguments);this.innerHTML=n??""}}function oD(e){return arguments.length?this.each(e==null?nD:(typeof e=="function"?sD:rD)(e)):this.node().innerHTML}function aD(){this.nextSibling&&this.parentNode.appendChild(this)}function iD(){return this.each(aD)}function lD(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function cD(){return this.each(lD)}function uD(e){var n=typeof e=="function"?e:SN(e);return this.select(function(){return this.appendChild(n.apply(this,arguments))})}function dD(){return null}function fD(e,n){var s=typeof e=="function"?e:SN(e),o=n==null?dD:typeof n=="function"?n:tg(n);return this.select(function(){return this.insertBefore(s.apply(this,arguments),o.apply(this,arguments)||null)})}function mD(){var e=this.parentNode;e&&e.removeChild(this)}function hD(){return this.each(mD)}function pD(){var e=this.cloneNode(!1),n=this.parentNode;return n?n.insertBefore(e,this.nextSibling):e}function gD(){var e=this.cloneNode(!0),n=this.parentNode;return n?n.insertBefore(e,this.nextSibling):e}function xD(e){return this.select(e?gD:pD)}function yD(e){return arguments.length?this.property("__data__",e):this.node().__data__}function vD(e){return function(n){e.call(this,n,this.__data__)}}function bD(e){return e.trim().split(/^|\s+/).map(function(n){var s="",o=n.indexOf(".");return o>=0&&(s=n.slice(o+1),n=n.slice(0,o)),{type:n,name:s}})}function wD(e){return function(){var n=this.__on;if(n){for(var s=0,o=-1,l=n.length,c;s<l;++s)c=n[s],(!e.type||c.type===e.type)&&c.name===e.name?this.removeEventListener(c.type,c.listener,c.options):n[++o]=c;++o?n.length=o:delete this.__on}}}function ND(e,n,s){return function(){var o=this.__on,l,c=vD(n);if(o){for(var d=0,f=o.length;d<f;++d)if((l=o[d]).type===e.type&&l.name===e.name){this.removeEventListener(l.type,l.listener,l.options),this.addEventListener(l.type,l.listener=c,l.options=s),l.value=n;return}}this.addEventListener(e.type,c,s),l={type:e.type,name:e.name,value:n,listener:c,options:s},o?o.push(l):this.__on=[l]}}function SD(e,n,s){var o=bD(e+""),l,c=o.length,d;if(arguments.length<2){var f=this.node().__on;if(f){for(var m=0,p=f.length,g;m<p;++m)for(l=0,g=f[m];l<c;++l)if((d=o[l]).type===g.type&&d.name===g.name)return g.value}return}for(f=n?ND:wD,l=0;l<c;++l)this.each(f(o[l],n,s));return this}function DN(e,n,s){var o=kN(e),l=o.CustomEvent;typeof l=="function"?l=new l(n,s):(l=o.document.createEvent("Event"),s?(l.initEvent(n,s.bubbles,s.cancelable),l.detail=s.detail):l.initEvent(n,!1,!1)),e.dispatchEvent(l)}function jD(e,n){return function(){return DN(this,e,n)}}function _D(e,n){return function(){return DN(this,e,n.apply(this,arguments))}}function ED(e,n){return this.each((typeof n=="function"?_D:jD)(e,n))}function*CD(){for(var e=this._groups,n=0,s=e.length;n<s;++n)for(var o=e[n],l=0,c=o.length,d;l<c;++l)(d=o[l])&&(yield d)}var ON=[null];function bn(e,n){this._groups=e,this._parents=n}function vl(){return new bn([[document.documentElement]],ON)}function kD(){return this}bn.prototype=vl.prototype={constructor:bn,select:e6,selectAll:s6,selectChild:l6,selectChildren:f6,filter:m6,data:v6,enter:h6,exit:w6,join:N6,merge:S6,selection:kD,order:j6,sort:_6,call:C6,nodes:k6,node:A6,size:M6,empty:T6,each:R6,attr:$6,style:V6,property:G6,classed:K6,text:tD,html:oD,raise:iD,lower:cD,append:uD,insert:fD,remove:hD,clone:xD,datum:yD,on:SD,dispatch:ED,[Symbol.iterator]:CD};function yn(e){return typeof e=="string"?new bn([[document.querySelector(e)]],[document.documentElement]):new bn([[e]],ON)}function AD(e){let n;for(;n=e.sourceEvent;)e=n;return e}function Ln(e,n){if(e=AD(e),n===void 0&&(n=e.currentTarget),n){var s=n.ownerSVGElement||n;if(s.createSVGPoint){var o=s.createSVGPoint();return o.x=e.clientX,o.y=e.clientY,o=o.matrixTransform(n.getScreenCTM().inverse()),[o.x,o.y]}if(n.getBoundingClientRect){var l=n.getBoundingClientRect();return[e.clientX-l.left-n.clientLeft,e.clientY-l.top-n.clientTop]}}return[e.pageX,e.pageY]}const MD={passive:!1},tl={capture:!0,passive:!1};function uh(e){e.stopImmediatePropagation()}function ca(e){e.preventDefault(),e.stopImmediatePropagation()}function zN(e){var n=e.document.documentElement,s=yn(e).on("dragstart.drag",ca,tl);"onselectstart"in n?s.on("selectstart.drag",ca,tl):(n.__noselect=n.style.MozUserSelect,n.style.MozUserSelect="none")}function IN(e,n){var s=e.document.documentElement,o=yn(e).on("dragstart.drag",null);n&&(o.on("click.drag",ca,tl),setTimeout(function(){o.on("click.drag",null)},0)),"onselectstart"in s?o.on("selectstart.drag",null):(s.style.MozUserSelect=s.__noselect,delete s.__noselect)}const Kc=e=>()=>e;function Zh(e,{sourceEvent:n,subject:s,target:o,identifier:l,active:c,x:d,y:f,dx:m,dy:p,dispatch:g}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},subject:{value:s,enumerable:!0,configurable:!0},target:{value:o,enumerable:!0,configurable:!0},identifier:{value:l,enumerable:!0,configurable:!0},active:{value:c,enumerable:!0,configurable:!0},x:{value:d,enumerable:!0,configurable:!0},y:{value:f,enumerable:!0,configurable:!0},dx:{value:m,enumerable:!0,configurable:!0},dy:{value:p,enumerable:!0,configurable:!0},_:{value:g}})}Zh.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function TD(e){return!e.ctrlKey&&!e.button}function RD(){return this.parentNode}function DD(e,n){return n??{x:e.x,y:e.y}}function OD(){return navigator.maxTouchPoints||"ontouchstart"in this}function LN(){var e=TD,n=RD,s=DD,o=OD,l={},c=gd("start","drag","end"),d=0,f,m,p,g,v=0;function y(k){k.on("mousedown.drag",b).filter(o).on("touchstart.drag",_).on("touchmove.drag",E,MD).on("touchend.drag touchcancel.drag",M).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function b(k,R){if(!(g||!e.call(this,k,R))){var D=j(this,n.call(this,k,R),k,R,"mouse");D&&(yn(k.view).on("mousemove.drag",S,tl).on("mouseup.drag",N,tl),zN(k.view),uh(k),p=!1,f=k.clientX,m=k.clientY,D("start",k))}}function S(k){if(ca(k),!p){var R=k.clientX-f,D=k.clientY-m;p=R*R+D*D>v}l.mouse("drag",k)}function N(k){yn(k.view).on("mousemove.drag mouseup.drag",null),IN(k.view,p),ca(k),l.mouse("end",k)}function _(k,R){if(e.call(this,k,R)){var D=k.changedTouches,z=n.call(this,k,R),H=D.length,U,F;for(U=0;U<H;++U)(F=j(this,z,k,R,D[U].identifier,D[U]))&&(uh(k),F("start",k,D[U]))}}function E(k){var R=k.changedTouches,D=R.length,z,H;for(z=0;z<D;++z)(H=l[R[z].identifier])&&(ca(k),H("drag",k,R[z]))}function M(k){var R=k.changedTouches,D=R.length,z,H;for(g&&clearTimeout(g),g=setTimeout(function(){g=null},500),z=0;z<D;++z)(H=l[R[z].identifier])&&(uh(k),H("end",k,R[z]))}function j(k,R,D,z,H,U){var F=c.copy(),K=Ln(U||D,R),G,ne,L;if((L=s.call(k,new Zh("beforestart",{sourceEvent:D,target:y,identifier:H,active:d,x:K[0],y:K[1],dx:0,dy:0,dispatch:F}),z))!=null)return G=L.x-K[0]||0,ne=L.y-K[1]||0,function V(A,I,$){var P=K,T;switch(A){case"start":l[H]=V,T=d++;break;case"end":delete l[H],--d;case"drag":K=Ln($||I,R),T=d;break}F.call(A,k,new Zh(A,{sourceEvent:I,subject:L,target:y,identifier:H,active:T,x:K[0]+G,y:K[1]+ne,dx:K[0]-P[0],dy:K[1]-P[1],dispatch:F}),z)}}return y.filter=function(k){return arguments.length?(e=typeof k=="function"?k:Kc(!!k),y):e},y.container=function(k){return arguments.length?(n=typeof k=="function"?k:Kc(k),y):n},y.subject=function(k){return arguments.length?(s=typeof k=="function"?k:Kc(k),y):s},y.touchable=function(k){return arguments.length?(o=typeof k=="function"?k:Kc(!!k),y):o},y.on=function(){var k=c.on.apply(c,arguments);return k===c?y:k},y.clickDistance=function(k){return arguments.length?(v=(k=+k)*k,y):Math.sqrt(v)},y}function rg(e,n,s){e.prototype=n.prototype=s,s.constructor=e}function HN(e,n){var s=Object.create(e.prototype);for(var o in n)s[o]=n[o];return s}function bl(){}var nl=.7,Ou=1/nl,ua="\\s*([+-]?\\d+)\\s*",rl="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",sr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",zD=/^#([0-9a-f]{3,8})$/,ID=new RegExp(`^rgb\\(${ua},${ua},${ua}\\)$`),LD=new RegExp(`^rgb\\(${sr},${sr},${sr}\\)$`),HD=new RegExp(`^rgba\\(${ua},${ua},${ua},${rl}\\)$`),$D=new RegExp(`^rgba\\(${sr},${sr},${sr},${rl}\\)$`),BD=new RegExp(`^hsl\\(${rl},${sr},${sr}\\)$`),PD=new RegExp(`^hsla\\(${rl},${sr},${sr},${rl}\\)$`),Yv={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};rg(bl,uo,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Gv,formatHex:Gv,formatHex8:UD,formatHsl:VD,formatRgb:Xv,toString:Xv});function Gv(){return this.rgb().formatHex()}function UD(){return this.rgb().formatHex8()}function VD(){return $N(this).formatHsl()}function Xv(){return this.rgb().formatRgb()}function uo(e){var n,s;return e=(e+"").trim().toLowerCase(),(n=zD.exec(e))?(s=n[1].length,n=parseInt(n[1],16),s===6?Zv(n):s===3?new an(n>>8&15|n>>4&240,n>>4&15|n&240,(n&15)<<4|n&15,1):s===8?Qc(n>>24&255,n>>16&255,n>>8&255,(n&255)/255):s===4?Qc(n>>12&15|n>>8&240,n>>8&15|n>>4&240,n>>4&15|n&240,((n&15)<<4|n&15)/255):null):(n=ID.exec(e))?new an(n[1],n[2],n[3],1):(n=LD.exec(e))?new an(n[1]*255/100,n[2]*255/100,n[3]*255/100,1):(n=HD.exec(e))?Qc(n[1],n[2],n[3],n[4]):(n=$D.exec(e))?Qc(n[1]*255/100,n[2]*255/100,n[3]*255/100,n[4]):(n=BD.exec(e))?Qv(n[1],n[2]/100,n[3]/100,1):(n=PD.exec(e))?Qv(n[1],n[2]/100,n[3]/100,n[4]):Yv.hasOwnProperty(e)?Zv(Yv[e]):e==="transparent"?new an(NaN,NaN,NaN,0):null}function Zv(e){return new an(e>>16&255,e>>8&255,e&255,1)}function Qc(e,n,s,o){return o<=0&&(e=n=s=NaN),new an(e,n,s,o)}function qD(e){return e instanceof bl||(e=uo(e)),e?(e=e.rgb(),new an(e.r,e.g,e.b,e.opacity)):new an}function Wh(e,n,s,o){return arguments.length===1?qD(e):new an(e,n,s,o??1)}function an(e,n,s,o){this.r=+e,this.g=+n,this.b=+s,this.opacity=+o}rg(an,Wh,HN(bl,{brighter(e){return e=e==null?Ou:Math.pow(Ou,e),new an(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?nl:Math.pow(nl,e),new an(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new an(no(this.r),no(this.g),no(this.b),zu(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:Wv,formatHex:Wv,formatHex8:FD,formatRgb:Kv,toString:Kv}));function Wv(){return`#${eo(this.r)}${eo(this.g)}${eo(this.b)}`}function FD(){return`#${eo(this.r)}${eo(this.g)}${eo(this.b)}${eo((isNaN(this.opacity)?1:this.opacity)*255)}`}function Kv(){const e=zu(this.opacity);return`${e===1?"rgb(":"rgba("}${no(this.r)}, ${no(this.g)}, ${no(this.b)}${e===1?")":`, ${e})`}`}function zu(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function no(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function eo(e){return e=no(e),(e<16?"0":"")+e.toString(16)}function Qv(e,n,s,o){return o<=0?e=n=s=NaN:s<=0||s>=1?e=n=NaN:n<=0&&(e=NaN),new Hn(e,n,s,o)}function $N(e){if(e instanceof Hn)return new Hn(e.h,e.s,e.l,e.opacity);if(e instanceof bl||(e=uo(e)),!e)return new Hn;if(e instanceof Hn)return e;e=e.rgb();var n=e.r/255,s=e.g/255,o=e.b/255,l=Math.min(n,s,o),c=Math.max(n,s,o),d=NaN,f=c-l,m=(c+l)/2;return f?(n===c?d=(s-o)/f+(s<o)*6:s===c?d=(o-n)/f+2:d=(n-s)/f+4,f/=m<.5?c+l:2-c-l,d*=60):f=m>0&&m<1?0:d,new Hn(d,f,m,e.opacity)}function YD(e,n,s,o){return arguments.length===1?$N(e):new Hn(e,n,s,o??1)}function Hn(e,n,s,o){this.h=+e,this.s=+n,this.l=+s,this.opacity=+o}rg(Hn,YD,HN(bl,{brighter(e){return e=e==null?Ou:Math.pow(Ou,e),new Hn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?nl:Math.pow(nl,e),new Hn(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,n=isNaN(e)||isNaN(this.s)?0:this.s,s=this.l,o=s+(s<.5?s:1-s)*n,l=2*s-o;return new an(dh(e>=240?e-240:e+120,l,o),dh(e,l,o),dh(e<120?e+240:e-120,l,o),this.opacity)},clamp(){return new Hn(Jv(this.h),Jc(this.s),Jc(this.l),zu(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=zu(this.opacity);return`${e===1?"hsl(":"hsla("}${Jv(this.h)}, ${Jc(this.s)*100}%, ${Jc(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Jv(e){return e=(e||0)%360,e<0?e+360:e}function Jc(e){return Math.max(0,Math.min(1,e||0))}function dh(e,n,s){return(e<60?n+(s-n)*e/60:e<180?s:e<240?n+(s-n)*(240-e)/60:n)*255}const sg=e=>()=>e;function GD(e,n){return function(s){return e+s*n}}function XD(e,n,s){return e=Math.pow(e,s),n=Math.pow(n,s)-e,s=1/s,function(o){return Math.pow(e+o*n,s)}}function ZD(e){return(e=+e)==1?BN:function(n,s){return s-n?XD(n,s,e):sg(isNaN(n)?s:n)}}function BN(e,n){var s=n-e;return s?GD(e,s):sg(isNaN(e)?n:e)}const Iu=(function e(n){var s=ZD(n);function o(l,c){var d=s((l=Wh(l)).r,(c=Wh(c)).r),f=s(l.g,c.g),m=s(l.b,c.b),p=BN(l.opacity,c.opacity);return function(g){return l.r=d(g),l.g=f(g),l.b=m(g),l.opacity=p(g),l+""}}return o.gamma=e,o})(1);function WD(e,n){n||(n=[]);var s=e?Math.min(n.length,e.length):0,o=n.slice(),l;return function(c){for(l=0;l<s;++l)o[l]=e[l]*(1-c)+n[l]*c;return o}}function KD(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function QD(e,n){var s=n?n.length:0,o=e?Math.min(s,e.length):0,l=new Array(o),c=new Array(s),d;for(d=0;d<o;++d)l[d]=Fi(e[d],n[d]);for(;d<s;++d)c[d]=n[d];return function(f){for(d=0;d<o;++d)c[d]=l[d](f);return c}}function JD(e,n){var s=new Date;return e=+e,n=+n,function(o){return s.setTime(e*(1-o)+n*o),s}}function Qn(e,n){return e=+e,n=+n,function(s){return e*(1-s)+n*s}}function eO(e,n){var s={},o={},l;(e===null||typeof e!="object")&&(e={}),(n===null||typeof n!="object")&&(n={});for(l in n)l in e?s[l]=Fi(e[l],n[l]):o[l]=n[l];return function(c){for(l in s)o[l]=s[l](c);return o}}var Kh=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,fh=new RegExp(Kh.source,"g");function tO(e){return function(){return e}}function nO(e){return function(n){return e(n)+""}}function PN(e,n){var s=Kh.lastIndex=fh.lastIndex=0,o,l,c,d=-1,f=[],m=[];for(e=e+"",n=n+"";(o=Kh.exec(e))&&(l=fh.exec(n));)(c=l.index)>s&&(c=n.slice(s,c),f[d]?f[d]+=c:f[++d]=c),(o=o[0])===(l=l[0])?f[d]?f[d]+=l:f[++d]=l:(f[++d]=null,m.push({i:d,x:Qn(o,l)})),s=fh.lastIndex;return s<n.length&&(c=n.slice(s),f[d]?f[d]+=c:f[++d]=c),f.length<2?m[0]?nO(m[0].x):tO(n):(n=m.length,function(p){for(var g=0,v;g<n;++g)f[(v=m[g]).i]=v.x(p);return f.join("")})}function Fi(e,n){var s=typeof n,o;return n==null||s==="boolean"?sg(n):(s==="number"?Qn:s==="string"?(o=uo(n))?(n=o,Iu):PN:n instanceof uo?Iu:n instanceof Date?JD:KD(n)?WD:Array.isArray(n)?QD:typeof n.valueOf!="function"&&typeof n.toString!="function"||isNaN(n)?eO:Qn)(e,n)}var eb=180/Math.PI,Qh={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function UN(e,n,s,o,l,c){var d,f,m;return(d=Math.sqrt(e*e+n*n))&&(e/=d,n/=d),(m=e*s+n*o)&&(s-=e*m,o-=n*m),(f=Math.sqrt(s*s+o*o))&&(s/=f,o/=f,m/=f),e*o<n*s&&(e=-e,n=-n,m=-m,d=-d),{translateX:l,translateY:c,rotate:Math.atan2(n,e)*eb,skewX:Math.atan(m)*eb,scaleX:d,scaleY:f}}var eu;function rO(e){const n=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return n.isIdentity?Qh:UN(n.a,n.b,n.c,n.d,n.e,n.f)}function sO(e){return e==null||(eu||(eu=document.createElementNS("http://www.w3.org/2000/svg","g")),eu.setAttribute("transform",e),!(e=eu.transform.baseVal.consolidate()))?Qh:(e=e.matrix,UN(e.a,e.b,e.c,e.d,e.e,e.f))}function VN(e,n,s,o){function l(p){return p.length?p.pop()+" ":""}function c(p,g,v,y,b,S){if(p!==v||g!==y){var N=b.push("translate(",null,n,null,s);S.push({i:N-4,x:Qn(p,v)},{i:N-2,x:Qn(g,y)})}else(v||y)&&b.push("translate("+v+n+y+s)}function d(p,g,v,y){p!==g?(p-g>180?g+=360:g-p>180&&(p+=360),y.push({i:v.push(l(v)+"rotate(",null,o)-2,x:Qn(p,g)})):g&&v.push(l(v)+"rotate("+g+o)}function f(p,g,v,y){p!==g?y.push({i:v.push(l(v)+"skewX(",null,o)-2,x:Qn(p,g)}):g&&v.push(l(v)+"skewX("+g+o)}function m(p,g,v,y,b,S){if(p!==v||g!==y){var N=b.push(l(b)+"scale(",null,",",null,")");S.push({i:N-4,x:Qn(p,v)},{i:N-2,x:Qn(g,y)})}else(v!==1||y!==1)&&b.push(l(b)+"scale("+v+","+y+")")}return function(p,g){var v=[],y=[];return p=e(p),g=e(g),c(p.translateX,p.translateY,g.translateX,g.translateY,v,y),d(p.rotate,g.rotate,v,y),f(p.skewX,g.skewX,v,y),m(p.scaleX,p.scaleY,g.scaleX,g.scaleY,v,y),p=g=null,function(b){for(var S=-1,N=y.length,_;++S<N;)v[(_=y[S]).i]=_.x(b);return v.join("")}}}var oO=VN(rO,"px, ","px)","deg)"),aO=VN(sO,", ",")",")"),iO=1e-12;function tb(e){return((e=Math.exp(e))+1/e)/2}function lO(e){return((e=Math.exp(e))-1/e)/2}function cO(e){return((e=Math.exp(2*e))-1)/(e+1)}const pu=(function e(n,s,o){function l(c,d){var f=c[0],m=c[1],p=c[2],g=d[0],v=d[1],y=d[2],b=g-f,S=v-m,N=b*b+S*S,_,E;if(N<iO)E=Math.log(y/p)/n,_=function(z){return[f+z*b,m+z*S,p*Math.exp(n*z*E)]};else{var M=Math.sqrt(N),j=(y*y-p*p+o*N)/(2*p*s*M),k=(y*y-p*p-o*N)/(2*y*s*M),R=Math.log(Math.sqrt(j*j+1)-j),D=Math.log(Math.sqrt(k*k+1)-k);E=(D-R)/n,_=function(z){var H=z*E,U=tb(R),F=p/(s*M)*(U*cO(n*H+R)-lO(R));return[f+F*b,m+F*S,p*U/tb(n*H+R)]}}return _.duration=E*1e3*n/Math.SQRT2,_}return l.rho=function(c){var d=Math.max(.001,+c),f=d*d,m=f*f;return e(d,f,m)},l})(Math.SQRT2,2,4);var pa=0,Pi=0,Li=0,qN=1e3,Lu,Ui,Hu=0,fo=0,yd=0,sl=typeof performance=="object"&&performance.now?performance:Date,FN=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function og(){return fo||(FN(uO),fo=sl.now()+yd)}function uO(){fo=0}function $u(){this._call=this._time=this._next=null}$u.prototype=YN.prototype={constructor:$u,restart:function(e,n,s){if(typeof e!="function")throw new TypeError("callback is not a function");s=(s==null?og():+s)+(n==null?0:+n),!this._next&&Ui!==this&&(Ui?Ui._next=this:Lu=this,Ui=this),this._call=e,this._time=s,Jh()},stop:function(){this._call&&(this._call=null,this._time=1/0,Jh())}};function YN(e,n,s){var o=new $u;return o.restart(e,n,s),o}function dO(){og(),++pa;for(var e=Lu,n;e;)(n=fo-e._time)>=0&&e._call.call(void 0,n),e=e._next;--pa}function nb(){fo=(Hu=sl.now())+yd,pa=Pi=0;try{dO()}finally{pa=0,mO(),fo=0}}function fO(){var e=sl.now(),n=e-Hu;n>qN&&(yd-=n,Hu=e)}function mO(){for(var e,n=Lu,s,o=1/0;n;)n._call?(o>n._time&&(o=n._time),e=n,n=n._next):(s=n._next,n._next=null,n=e?e._next=s:Lu=s);Ui=e,Jh(o)}function Jh(e){if(!pa){Pi&&(Pi=clearTimeout(Pi));var n=e-fo;n>24?(e<1/0&&(Pi=setTimeout(nb,e-sl.now()-yd)),Li&&(Li=clearInterval(Li))):(Li||(Hu=sl.now(),Li=setInterval(fO,qN)),pa=1,FN(nb))}}function rb(e,n,s){var o=new $u;return n=n==null?0:+n,o.restart(l=>{o.stop(),e(l+n)},n,s),o}var hO=gd("start","end","cancel","interrupt"),pO=[],GN=0,sb=1,ep=2,gu=3,ob=4,tp=5,xu=6;function vd(e,n,s,o,l,c){var d=e.__transition;if(!d)e.__transition={};else if(s in d)return;gO(e,s,{name:n,index:o,group:l,on:hO,tween:pO,time:c.time,delay:c.delay,duration:c.duration,ease:c.ease,timer:null,state:GN})}function ag(e,n){var s=qn(e,n);if(s.state>GN)throw new Error("too late; already scheduled");return s}function ur(e,n){var s=qn(e,n);if(s.state>gu)throw new Error("too late; already running");return s}function qn(e,n){var s=e.__transition;if(!s||!(s=s[n]))throw new Error("transition not found");return s}function gO(e,n,s){var o=e.__transition,l;o[n]=s,s.timer=YN(c,0,s.time);function c(p){s.state=sb,s.timer.restart(d,s.delay,s.time),s.delay<=p&&d(p-s.delay)}function d(p){var g,v,y,b;if(s.state!==sb)return m();for(g in o)if(b=o[g],b.name===s.name){if(b.state===gu)return rb(d);b.state===ob?(b.state=xu,b.timer.stop(),b.on.call("interrupt",e,e.__data__,b.index,b.group),delete o[g]):+g<n&&(b.state=xu,b.timer.stop(),b.on.call("cancel",e,e.__data__,b.index,b.group),delete o[g])}if(rb(function(){s.state===gu&&(s.state=ob,s.timer.restart(f,s.delay,s.time),f(p))}),s.state=ep,s.on.call("start",e,e.__data__,s.index,s.group),s.state===ep){for(s.state=gu,l=new Array(y=s.tween.length),g=0,v=-1;g<y;++g)(b=s.tween[g].value.call(e,e.__data__,s.index,s.group))&&(l[++v]=b);l.length=v+1}}function f(p){for(var g=p<s.duration?s.ease.call(null,p/s.duration):(s.timer.restart(m),s.state=tp,1),v=-1,y=l.length;++v<y;)l[v].call(e,g);s.state===tp&&(s.on.call("end",e,e.__data__,s.index,s.group),m())}function m(){s.state=xu,s.timer.stop(),delete o[n];for(var p in o)return;delete e.__transition}}function yu(e,n){var s=e.__transition,o,l,c=!0,d;if(s){n=n==null?null:n+"";for(d in s){if((o=s[d]).name!==n){c=!1;continue}l=o.state>ep&&o.state<tp,o.state=xu,o.timer.stop(),o.on.call(l?"interrupt":"cancel",e,e.__data__,o.index,o.group),delete s[d]}c&&delete e.__transition}}function xO(e){return this.each(function(){yu(this,e)})}function yO(e,n){var s,o;return function(){var l=ur(this,e),c=l.tween;if(c!==s){o=s=c;for(var d=0,f=o.length;d<f;++d)if(o[d].name===n){o=o.slice(),o.splice(d,1);break}}l.tween=o}}function vO(e,n,s){var o,l;if(typeof s!="function")throw new Error;return function(){var c=ur(this,e),d=c.tween;if(d!==o){l=(o=d).slice();for(var f={name:n,value:s},m=0,p=l.length;m<p;++m)if(l[m].name===n){l[m]=f;break}m===p&&l.push(f)}c.tween=l}}function bO(e,n){var s=this._id;if(e+="",arguments.length<2){for(var o=qn(this.node(),s).tween,l=0,c=o.length,d;l<c;++l)if((d=o[l]).name===e)return d.value;return null}return this.each((n==null?yO:vO)(s,e,n))}function ig(e,n,s){var o=e._id;return e.each(function(){var l=ur(this,o);(l.value||(l.value={}))[n]=s.apply(this,arguments)}),function(l){return qn(l,o).value[n]}}function XN(e,n){var s;return(typeof n=="number"?Qn:n instanceof uo?Iu:(s=uo(n))?(n=s,Iu):PN)(e,n)}function wO(e){return function(){this.removeAttribute(e)}}function NO(e){return function(){this.removeAttributeNS(e.space,e.local)}}function SO(e,n,s){var o,l=s+"",c;return function(){var d=this.getAttribute(e);return d===l?null:d===o?c:c=n(o=d,s)}}function jO(e,n,s){var o,l=s+"",c;return function(){var d=this.getAttributeNS(e.space,e.local);return d===l?null:d===o?c:c=n(o=d,s)}}function _O(e,n,s){var o,l,c;return function(){var d,f=s(this),m;return f==null?void this.removeAttribute(e):(d=this.getAttribute(e),m=f+"",d===m?null:d===o&&m===l?c:(l=m,c=n(o=d,f)))}}function EO(e,n,s){var o,l,c;return function(){var d,f=s(this),m;return f==null?void this.removeAttributeNS(e.space,e.local):(d=this.getAttributeNS(e.space,e.local),m=f+"",d===m?null:d===o&&m===l?c:(l=m,c=n(o=d,f)))}}function CO(e,n){var s=xd(e),o=s==="transform"?aO:XN;return this.attrTween(e,typeof n=="function"?(s.local?EO:_O)(s,o,ig(this,"attr."+e,n)):n==null?(s.local?NO:wO)(s):(s.local?jO:SO)(s,o,n))}function kO(e,n){return function(s){this.setAttribute(e,n.call(this,s))}}function AO(e,n){return function(s){this.setAttributeNS(e.space,e.local,n.call(this,s))}}function MO(e,n){var s,o;function l(){var c=n.apply(this,arguments);return c!==o&&(s=(o=c)&&AO(e,c)),s}return l._value=n,l}function TO(e,n){var s,o;function l(){var c=n.apply(this,arguments);return c!==o&&(s=(o=c)&&kO(e,c)),s}return l._value=n,l}function RO(e,n){var s="attr."+e;if(arguments.length<2)return(s=this.tween(s))&&s._value;if(n==null)return this.tween(s,null);if(typeof n!="function")throw new Error;var o=xd(e);return this.tween(s,(o.local?MO:TO)(o,n))}function DO(e,n){return function(){ag(this,e).delay=+n.apply(this,arguments)}}function OO(e,n){return n=+n,function(){ag(this,e).delay=n}}function zO(e){var n=this._id;return arguments.length?this.each((typeof e=="function"?DO:OO)(n,e)):qn(this.node(),n).delay}function IO(e,n){return function(){ur(this,e).duration=+n.apply(this,arguments)}}function LO(e,n){return n=+n,function(){ur(this,e).duration=n}}function HO(e){var n=this._id;return arguments.length?this.each((typeof e=="function"?IO:LO)(n,e)):qn(this.node(),n).duration}function $O(e,n){if(typeof n!="function")throw new Error;return function(){ur(this,e).ease=n}}function BO(e){var n=this._id;return arguments.length?this.each($O(n,e)):qn(this.node(),n).ease}function PO(e,n){return function(){var s=n.apply(this,arguments);if(typeof s!="function")throw new Error;ur(this,e).ease=s}}function UO(e){if(typeof e!="function")throw new Error;return this.each(PO(this._id,e))}function VO(e){typeof e!="function"&&(e=_N(e));for(var n=this._groups,s=n.length,o=new Array(s),l=0;l<s;++l)for(var c=n[l],d=c.length,f=o[l]=[],m,p=0;p<d;++p)(m=c[p])&&e.call(m,m.__data__,p,c)&&f.push(m);return new Lr(o,this._parents,this._name,this._id)}function qO(e){if(e._id!==this._id)throw new Error;for(var n=this._groups,s=e._groups,o=n.length,l=s.length,c=Math.min(o,l),d=new Array(o),f=0;f<c;++f)for(var m=n[f],p=s[f],g=m.length,v=d[f]=new Array(g),y,b=0;b<g;++b)(y=m[b]||p[b])&&(v[b]=y);for(;f<o;++f)d[f]=n[f];return new Lr(d,this._parents,this._name,this._id)}function FO(e){return(e+"").trim().split(/^|\s+/).every(function(n){var s=n.indexOf(".");return s>=0&&(n=n.slice(0,s)),!n||n==="start"})}function YO(e,n,s){var o,l,c=FO(n)?ag:ur;return function(){var d=c(this,e),f=d.on;f!==o&&(l=(o=f).copy()).on(n,s),d.on=l}}function GO(e,n){var s=this._id;return arguments.length<2?qn(this.node(),s).on.on(e):this.each(YO(s,e,n))}function XO(e){return function(){var n=this.parentNode;for(var s in this.__transition)if(+s!==e)return;n&&n.removeChild(this)}}function ZO(){return this.on("end.remove",XO(this._id))}function WO(e){var n=this._name,s=this._id;typeof e!="function"&&(e=tg(e));for(var o=this._groups,l=o.length,c=new Array(l),d=0;d<l;++d)for(var f=o[d],m=f.length,p=c[d]=new Array(m),g,v,y=0;y<m;++y)(g=f[y])&&(v=e.call(g,g.__data__,y,f))&&("__data__"in g&&(v.__data__=g.__data__),p[y]=v,vd(p[y],n,s,y,p,qn(g,s)));return new Lr(c,this._parents,n,s)}function KO(e){var n=this._name,s=this._id;typeof e!="function"&&(e=jN(e));for(var o=this._groups,l=o.length,c=[],d=[],f=0;f<l;++f)for(var m=o[f],p=m.length,g,v=0;v<p;++v)if(g=m[v]){for(var y=e.call(g,g.__data__,v,m),b,S=qn(g,s),N=0,_=y.length;N<_;++N)(b=y[N])&&vd(b,n,s,N,y,S);c.push(y),d.push(g)}return new Lr(c,d,n,s)}var QO=vl.prototype.constructor;function JO(){return new QO(this._groups,this._parents)}function e8(e,n){var s,o,l;return function(){var c=ha(this,e),d=(this.style.removeProperty(e),ha(this,e));return c===d?null:c===s&&d===o?l:l=n(s=c,o=d)}}function ZN(e){return function(){this.style.removeProperty(e)}}function t8(e,n,s){var o,l=s+"",c;return function(){var d=ha(this,e);return d===l?null:d===o?c:c=n(o=d,s)}}function n8(e,n,s){var o,l,c;return function(){var d=ha(this,e),f=s(this),m=f+"";return f==null&&(m=f=(this.style.removeProperty(e),ha(this,e))),d===m?null:d===o&&m===l?c:(l=m,c=n(o=d,f))}}function r8(e,n){var s,o,l,c="style."+n,d="end."+c,f;return function(){var m=ur(this,e),p=m.on,g=m.value[c]==null?f||(f=ZN(n)):void 0;(p!==s||l!==g)&&(o=(s=p).copy()).on(d,l=g),m.on=o}}function s8(e,n,s){var o=(e+="")=="transform"?oO:XN;return n==null?this.styleTween(e,e8(e,o)).on("end.style."+e,ZN(e)):typeof n=="function"?this.styleTween(e,n8(e,o,ig(this,"style."+e,n))).each(r8(this._id,e)):this.styleTween(e,t8(e,o,n),s).on("end.style."+e,null)}function o8(e,n,s){return function(o){this.style.setProperty(e,n.call(this,o),s)}}function a8(e,n,s){var o,l;function c(){var d=n.apply(this,arguments);return d!==l&&(o=(l=d)&&o8(e,d,s)),o}return c._value=n,c}function i8(e,n,s){var o="style."+(e+="");if(arguments.length<2)return(o=this.tween(o))&&o._value;if(n==null)return this.tween(o,null);if(typeof n!="function")throw new Error;return this.tween(o,a8(e,n,s??""))}function l8(e){return function(){this.textContent=e}}function c8(e){return function(){var n=e(this);this.textContent=n??""}}function u8(e){return this.tween("text",typeof e=="function"?c8(ig(this,"text",e)):l8(e==null?"":e+""))}function d8(e){return function(n){this.textContent=e.call(this,n)}}function f8(e){var n,s;function o(){var l=e.apply(this,arguments);return l!==s&&(n=(s=l)&&d8(l)),n}return o._value=e,o}function m8(e){var n="text";if(arguments.length<1)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;return this.tween(n,f8(e))}function h8(){for(var e=this._name,n=this._id,s=WN(),o=this._groups,l=o.length,c=0;c<l;++c)for(var d=o[c],f=d.length,m,p=0;p<f;++p)if(m=d[p]){var g=qn(m,n);vd(m,e,s,p,d,{time:g.time+g.delay+g.duration,delay:0,duration:g.duration,ease:g.ease})}return new Lr(o,this._parents,e,s)}function p8(){var e,n,s=this,o=s._id,l=s.size();return new Promise(function(c,d){var f={value:d},m={value:function(){--l===0&&c()}};s.each(function(){var p=ur(this,o),g=p.on;g!==e&&(n=(e=g).copy(),n._.cancel.push(f),n._.interrupt.push(f),n._.end.push(m)),p.on=n}),l===0&&c()})}var g8=0;function Lr(e,n,s,o){this._groups=e,this._parents=n,this._name=s,this._id=o}function WN(){return++g8}var Tr=vl.prototype;Lr.prototype={constructor:Lr,select:WO,selectAll:KO,selectChild:Tr.selectChild,selectChildren:Tr.selectChildren,filter:VO,merge:qO,selection:JO,transition:h8,call:Tr.call,nodes:Tr.nodes,node:Tr.node,size:Tr.size,empty:Tr.empty,each:Tr.each,on:GO,attr:CO,attrTween:RO,style:s8,styleTween:i8,text:u8,textTween:m8,remove:ZO,tween:bO,delay:zO,duration:HO,ease:BO,easeVarying:UO,end:p8,[Symbol.iterator]:Tr[Symbol.iterator]};function x8(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var y8={time:null,delay:0,duration:250,ease:x8};function v8(e,n){for(var s;!(s=e.__transition)||!(s=s[n]);)if(!(e=e.parentNode))throw new Error(`transition ${n} not found`);return s}function b8(e){var n,s;e instanceof Lr?(n=e._id,e=e._name):(n=WN(),(s=y8).time=og(),e=e==null?null:e+"");for(var o=this._groups,l=o.length,c=0;c<l;++c)for(var d=o[c],f=d.length,m,p=0;p<f;++p)(m=d[p])&&vd(m,e,n,p,d,s||v8(m,n));return new Lr(o,this._parents,e,n)}vl.prototype.interrupt=xO;vl.prototype.transition=b8;const tu=e=>()=>e;function w8(e,{sourceEvent:n,target:s,transform:o,dispatch:l}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},target:{value:s,enumerable:!0,configurable:!0},transform:{value:o,enumerable:!0,configurable:!0},_:{value:l}})}function Dr(e,n,s){this.k=e,this.x=n,this.y=s}Dr.prototype={constructor:Dr,scale:function(e){return e===1?this:new Dr(this.k*e,this.x,this.y)},translate:function(e,n){return e===0&n===0?this:new Dr(this.k,this.x+this.k*e,this.y+this.k*n)},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 bd=new Dr(1,0,0);KN.prototype=Dr.prototype;function KN(e){for(;!e.__zoom;)if(!(e=e.parentNode))return bd;return e.__zoom}function mh(e){e.stopImmediatePropagation()}function Hi(e){e.preventDefault(),e.stopImmediatePropagation()}function N8(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function S8(){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 ab(){return this.__zoom||bd}function j8(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function _8(){return navigator.maxTouchPoints||"ontouchstart"in this}function E8(e,n,s){var o=e.invertX(n[0][0])-s[0][0],l=e.invertX(n[1][0])-s[1][0],c=e.invertY(n[0][1])-s[0][1],d=e.invertY(n[1][1])-s[1][1];return e.translate(l>o?(o+l)/2:Math.min(0,o)||Math.max(0,l),d>c?(c+d)/2:Math.min(0,c)||Math.max(0,d))}function QN(){var e=N8,n=S8,s=E8,o=j8,l=_8,c=[0,1/0],d=[[-1/0,-1/0],[1/0,1/0]],f=250,m=pu,p=gd("start","zoom","end"),g,v,y,b=500,S=150,N=0,_=10;function E(L){L.property("__zoom",ab).on("wheel.zoom",H,{passive:!1}).on("mousedown.zoom",U).on("dblclick.zoom",F).filter(l).on("touchstart.zoom",K).on("touchmove.zoom",G).on("touchend.zoom touchcancel.zoom",ne).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}E.transform=function(L,V,A,I){var $=L.selection?L.selection():L;$.property("__zoom",ab),L!==$?R(L,V,A,I):$.interrupt().each(function(){D(this,arguments).event(I).start().zoom(null,typeof V=="function"?V.apply(this,arguments):V).end()})},E.scaleBy=function(L,V,A,I){E.scaleTo(L,function(){var $=this.__zoom.k,P=typeof V=="function"?V.apply(this,arguments):V;return $*P},A,I)},E.scaleTo=function(L,V,A,I){E.transform(L,function(){var $=n.apply(this,arguments),P=this.__zoom,T=A==null?k($):typeof A=="function"?A.apply(this,arguments):A,B=P.invert(T),W=typeof V=="function"?V.apply(this,arguments):V;return s(j(M(P,W),T,B),$,d)},A,I)},E.translateBy=function(L,V,A,I){E.transform(L,function(){return s(this.__zoom.translate(typeof V=="function"?V.apply(this,arguments):V,typeof A=="function"?A.apply(this,arguments):A),n.apply(this,arguments),d)},null,I)},E.translateTo=function(L,V,A,I,$){E.transform(L,function(){var P=n.apply(this,arguments),T=this.__zoom,B=I==null?k(P):typeof I=="function"?I.apply(this,arguments):I;return s(bd.translate(B[0],B[1]).scale(T.k).translate(typeof V=="function"?-V.apply(this,arguments):-V,typeof A=="function"?-A.apply(this,arguments):-A),P,d)},I,$)};function M(L,V){return V=Math.max(c[0],Math.min(c[1],V)),V===L.k?L:new Dr(V,L.x,L.y)}function j(L,V,A){var I=V[0]-A[0]*L.k,$=V[1]-A[1]*L.k;return I===L.x&&$===L.y?L:new Dr(L.k,I,$)}function k(L){return[(+L[0][0]+ +L[1][0])/2,(+L[0][1]+ +L[1][1])/2]}function R(L,V,A,I){L.on("start.zoom",function(){D(this,arguments).event(I).start()}).on("interrupt.zoom end.zoom",function(){D(this,arguments).event(I).end()}).tween("zoom",function(){var $=this,P=arguments,T=D($,P).event(I),B=n.apply($,P),W=A==null?k(B):typeof A=="function"?A.apply($,P):A,Z=Math.max(B[1][0]-B[0][0],B[1][1]-B[0][1]),re=$.__zoom,de=typeof V=="function"?V.apply($,P):V,ge=m(re.invert(W).concat(Z/re.k),de.invert(W).concat(Z/de.k));return function(J){if(J===1)J=de;else{var le=ge(J),ve=Z/le[2];J=new Dr(ve,W[0]-le[0]*ve,W[1]-le[1]*ve)}T.zoom(null,J)}})}function D(L,V,A){return!A&&L.__zooming||new z(L,V)}function z(L,V){this.that=L,this.args=V,this.active=0,this.sourceEvent=null,this.extent=n.apply(L,V),this.taps=0}z.prototype={event:function(L){return L&&(this.sourceEvent=L),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(L,V){return this.mouse&&L!=="mouse"&&(this.mouse[1]=V.invert(this.mouse[0])),this.touch0&&L!=="touch"&&(this.touch0[1]=V.invert(this.touch0[0])),this.touch1&&L!=="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(L){var V=yn(this.that).datum();p.call(L,this.that,new w8(L,{sourceEvent:this.sourceEvent,target:E,transform:this.that.__zoom,dispatch:p}),V)}};function H(L,...V){if(!e.apply(this,arguments))return;var A=D(this,V).event(L),I=this.__zoom,$=Math.max(c[0],Math.min(c[1],I.k*Math.pow(2,o.apply(this,arguments)))),P=Ln(L);if(A.wheel)(A.mouse[0][0]!==P[0]||A.mouse[0][1]!==P[1])&&(A.mouse[1]=I.invert(A.mouse[0]=P)),clearTimeout(A.wheel);else{if(I.k===$)return;A.mouse=[P,I.invert(P)],yu(this),A.start()}Hi(L),A.wheel=setTimeout(T,S),A.zoom("mouse",s(j(M(I,$),A.mouse[0],A.mouse[1]),A.extent,d));function T(){A.wheel=null,A.end()}}function U(L,...V){if(y||!e.apply(this,arguments))return;var A=L.currentTarget,I=D(this,V,!0).event(L),$=yn(L.view).on("mousemove.zoom",W,!0).on("mouseup.zoom",Z,!0),P=Ln(L,A),T=L.clientX,B=L.clientY;zN(L.view),mh(L),I.mouse=[P,this.__zoom.invert(P)],yu(this),I.start();function W(re){if(Hi(re),!I.moved){var de=re.clientX-T,ge=re.clientY-B;I.moved=de*de+ge*ge>N}I.event(re).zoom("mouse",s(j(I.that.__zoom,I.mouse[0]=Ln(re,A),I.mouse[1]),I.extent,d))}function Z(re){$.on("mousemove.zoom mouseup.zoom",null),IN(re.view,I.moved),Hi(re),I.event(re).end()}}function F(L,...V){if(e.apply(this,arguments)){var A=this.__zoom,I=Ln(L.changedTouches?L.changedTouches[0]:L,this),$=A.invert(I),P=A.k*(L.shiftKey?.5:2),T=s(j(M(A,P),I,$),n.apply(this,V),d);Hi(L),f>0?yn(this).transition().duration(f).call(R,T,I,L):yn(this).call(E.transform,T,I,L)}}function K(L,...V){if(e.apply(this,arguments)){var A=L.touches,I=A.length,$=D(this,V,L.changedTouches.length===I).event(L),P,T,B,W;for(mh(L),T=0;T<I;++T)B=A[T],W=Ln(B,this),W=[W,this.__zoom.invert(W),B.identifier],$.touch0?!$.touch1&&$.touch0[2]!==W[2]&&($.touch1=W,$.taps=0):($.touch0=W,P=!0,$.taps=1+!!g);g&&(g=clearTimeout(g)),P&&($.taps<2&&(v=W[0],g=setTimeout(function(){g=null},b)),yu(this),$.start())}}function G(L,...V){if(this.__zooming){var A=D(this,V).event(L),I=L.changedTouches,$=I.length,P,T,B,W;for(Hi(L),P=0;P<$;++P)T=I[P],B=Ln(T,this),A.touch0&&A.touch0[2]===T.identifier?A.touch0[0]=B:A.touch1&&A.touch1[2]===T.identifier&&(A.touch1[0]=B);if(T=A.that.__zoom,A.touch1){var Z=A.touch0[0],re=A.touch0[1],de=A.touch1[0],ge=A.touch1[1],J=(J=de[0]-Z[0])*J+(J=de[1]-Z[1])*J,le=(le=ge[0]-re[0])*le+(le=ge[1]-re[1])*le;T=M(T,Math.sqrt(J/le)),B=[(Z[0]+de[0])/2,(Z[1]+de[1])/2],W=[(re[0]+ge[0])/2,(re[1]+ge[1])/2]}else if(A.touch0)B=A.touch0[0],W=A.touch0[1];else return;A.zoom("touch",s(j(T,B,W),A.extent,d))}}function ne(L,...V){if(this.__zooming){var A=D(this,V).event(L),I=L.changedTouches,$=I.length,P,T;for(mh(L),y&&clearTimeout(y),y=setTimeout(function(){y=null},b),P=0;P<$;++P)T=I[P],A.touch0&&A.touch0[2]===T.identifier?delete A.touch0:A.touch1&&A.touch1[2]===T.identifier&&delete A.touch1;if(A.touch1&&!A.touch0&&(A.touch0=A.touch1,delete A.touch1),A.touch0)A.touch0[1]=this.__zoom.invert(A.touch0[0]);else if(A.end(),A.taps===2&&(T=Ln(T,this),Math.hypot(v[0]-T[0],v[1]-T[1])<_)){var B=yn(this).on("dblclick.zoom");B&&B.apply(this,arguments)}}}return E.wheelDelta=function(L){return arguments.length?(o=typeof L=="function"?L:tu(+L),E):o},E.filter=function(L){return arguments.length?(e=typeof L=="function"?L:tu(!!L),E):e},E.touchable=function(L){return arguments.length?(l=typeof L=="function"?L:tu(!!L),E):l},E.extent=function(L){return arguments.length?(n=typeof L=="function"?L:tu([[+L[0][0],+L[0][1]],[+L[1][0],+L[1][1]]]),E):n},E.scaleExtent=function(L){return arguments.length?(c[0]=+L[0],c[1]=+L[1],E):[c[0],c[1]]},E.translateExtent=function(L){return arguments.length?(d[0][0]=+L[0][0],d[1][0]=+L[1][0],d[0][1]=+L[0][1],d[1][1]=+L[1][1],E):[[d[0][0],d[0][1]],[d[1][0],d[1][1]]]},E.constrain=function(L){return arguments.length?(s=L,E):s},E.duration=function(L){return arguments.length?(f=+L,E):f},E.interpolate=function(L){return arguments.length?(m=L,E):m},E.on=function(){var L=p.on.apply(p,arguments);return L===p?E:L},E.clickDistance=function(L){return arguments.length?(N=(L=+L)*L,E):Math.sqrt(N)},E.tapDistance=function(L){return arguments.length?(_=+L,E):_},E}const ar={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:n,sourceHandle:s,targetHandle:o})=>`Couldn't create edge for ${e} handle id: "${e==="source"?s:o}", edge id: ${n}.`,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."},ol=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],JN=["Enter"," ","Escape"],eS={"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:n,y:s})=>`Moved selected node ${e}. New position, x: ${n}, y: ${s}`,"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 ga;(function(e){e.Strict="strict",e.Loose="loose"})(ga||(ga={}));var ro;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(ro||(ro={}));var al;(function(e){e.Partial="partial",e.Full="full"})(al||(al={}));const tS={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null};var xs;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(xs||(xs={}));var Bu;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Bu||(Bu={}));var Ie;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Ie||(Ie={}));const ib={[Ie.Left]:Ie.Right,[Ie.Right]:Ie.Left,[Ie.Top]:Ie.Bottom,[Ie.Bottom]:Ie.Top};function nS(e){return e===null?null:e?"valid":"invalid"}const rS=e=>"id"in e&&"source"in e&&"target"in e,C8=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),lg=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),wl=(e,n=[0,0])=>{const{width:s,height:o}=Hr(e),l=e.origin??n,c=s*l[0],d=o*l[1];return{x:e.position.x-c,y:e.position.y-d}},k8=(e,n={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const s=e.reduce((o,l)=>{const c=typeof l=="string";let d=!n.nodeLookup&&!c?l:void 0;n.nodeLookup&&(d=c?n.nodeLookup.get(l):lg(l)?l:n.nodeLookup.get(l.id));const f=d?Pu(d,n.nodeOrigin):{x:0,y:0,x2:0,y2:0};return wd(o,f)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Nd(s)},Nl=(e,n={})=>{if(e.size===0)return{x:0,y:0,width:0,height:0};let s={x:1/0,y:1/0,x2:-1/0,y2:-1/0};return e.forEach(o=>{if(n.filter===void 0||n.filter(o)){const l=Pu(o);s=wd(s,l)}}),Nd(s)},cg=(e,n,[s,o,l]=[0,0,1],c=!1,d=!1)=>{const f={...jl(n,[s,o,l]),width:n.width/l,height:n.height/l},m=[];for(const p of e.values()){const{measured:g,selectable:v=!0,hidden:y=!1}=p;if(d&&!v||y)continue;const b=g.width??p.width??p.initialWidth??null,S=g.height??p.height??p.initialHeight??null,N=il(f,ya(p)),_=(b??0)*(S??0),E=c&&N>0;(!p.internals.handleBounds||E||N>=_||p.dragging)&&m.push(p)}return m},A8=(e,n)=>{const s=new Set;return e.forEach(o=>{s.add(o.id)}),n.filter(o=>s.has(o.source)||s.has(o.target))};function M8(e,n){const s=new Map,o=n?.nodes?new Set(n.nodes.map(l=>l.id)):null;return e.forEach(l=>{l.measured.width&&l.measured.height&&(n?.includeHiddenNodes||!l.hidden)&&(!o||o.has(l.id))&&s.set(l.id,l)}),s}async function T8({nodes:e,width:n,height:s,panZoom:o,minZoom:l,maxZoom:c},d){if(e.size===0)return Promise.resolve(!0);const f=M8(e,d),m=Nl(f),p=ug(m,n,s,d?.minZoom??l,d?.maxZoom??c,d?.padding??.1);return await o.setViewport(p,{duration:d?.duration,ease:d?.ease,interpolate:d?.interpolate}),Promise.resolve(!0)}function sS({nodeId:e,nextPosition:n,nodeLookup:s,nodeOrigin:o=[0,0],nodeExtent:l,onError:c}){const d=s.get(e),f=d.parentId?s.get(d.parentId):void 0,{x:m,y:p}=f?f.internals.positionAbsolute:{x:0,y:0},g=d.origin??o;let v=d.extent||l;if(d.extent==="parent"&&!d.expandParent)if(!f)c?.("005",ar.error005());else{const b=f.measured.width,S=f.measured.height;b&&S&&(v=[[m,p],[m+b,p+S]])}else f&&va(d.extent)&&(v=[[d.extent[0][0]+m,d.extent[0][1]+p],[d.extent[1][0]+m,d.extent[1][1]+p]]);const y=va(v)?mo(n,v,d.measured):n;return(d.measured.width===void 0||d.measured.height===void 0)&&c?.("015",ar.error015()),{position:{x:y.x-m+(d.measured.width??0)*g[0],y:y.y-p+(d.measured.height??0)*g[1]},positionAbsolute:y}}async function R8({nodesToRemove:e=[],edgesToRemove:n=[],nodes:s,edges:o,onBeforeDelete:l}){const c=new Set(e.map(y=>y.id)),d=[];for(const y of s){if(y.deletable===!1)continue;const b=c.has(y.id),S=!b&&y.parentId&&d.find(N=>N.id===y.parentId);(b||S)&&d.push(y)}const f=new Set(n.map(y=>y.id)),m=o.filter(y=>y.deletable!==!1),g=A8(d,m);for(const y of m)f.has(y.id)&&!g.find(S=>S.id===y.id)&&g.push(y);if(!l)return{edges:g,nodes:d};const v=await l({nodes:d,edges:g});return typeof v=="boolean"?v?{edges:g,nodes:d}:{edges:[],nodes:[]}:v}const xa=(e,n=0,s=1)=>Math.min(Math.max(e,n),s),mo=(e={x:0,y:0},n,s)=>({x:xa(e.x,n[0][0],n[1][0]-(s?.width??0)),y:xa(e.y,n[0][1],n[1][1]-(s?.height??0))});function oS(e,n,s){const{width:o,height:l}=Hr(s),{x:c,y:d}=s.internals.positionAbsolute;return mo(e,[[c,d],[c+o,d+l]],n)}const lb=(e,n,s)=>e<n?xa(Math.abs(e-n),1,n)/n:e>s?-xa(Math.abs(e-s),1,n)/n:0,aS=(e,n,s=15,o=40)=>{const l=lb(e.x,o,n.width-o)*s,c=lb(e.y,o,n.height-o)*s;return[l,c]},wd=(e,n)=>({x:Math.min(e.x,n.x),y:Math.min(e.y,n.y),x2:Math.max(e.x2,n.x2),y2:Math.max(e.y2,n.y2)}),np=({x:e,y:n,width:s,height:o})=>({x:e,y:n,x2:e+s,y2:n+o}),Nd=({x:e,y:n,x2:s,y2:o})=>({x:e,y:n,width:s-e,height:o-n}),ya=(e,n=[0,0])=>{const{x:s,y:o}=lg(e)?e.internals.positionAbsolute:wl(e,n);return{x:s,y:o,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},Pu=(e,n=[0,0])=>{const{x:s,y:o}=lg(e)?e.internals.positionAbsolute:wl(e,n);return{x:s,y:o,x2:s+(e.measured?.width??e.width??e.initialWidth??0),y2:o+(e.measured?.height??e.height??e.initialHeight??0)}},iS=(e,n)=>Nd(wd(np(e),np(n))),il=(e,n)=>{const s=Math.max(0,Math.min(e.x+e.width,n.x+n.width)-Math.max(e.x,n.x)),o=Math.max(0,Math.min(e.y+e.height,n.y+n.height)-Math.max(e.y,n.y));return Math.ceil(s*o)},cb=e=>$n(e.width)&&$n(e.height)&&$n(e.x)&&$n(e.y),$n=e=>!isNaN(e)&&isFinite(e),D8=(e,n)=>{},Sl=(e,n=[1,1])=>({x:n[0]*Math.round(e.x/n[0]),y:n[1]*Math.round(e.y/n[1])}),jl=({x:e,y:n},[s,o,l],c=!1,d=[1,1])=>{const f={x:(e-s)/l,y:(n-o)/l};return c?Sl(f,d):f},Uu=({x:e,y:n},[s,o,l])=>({x:e*l+s,y:n*l+o});function ra(e,n){if(typeof e=="number")return Math.floor((n-n/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const s=parseFloat(e);if(!Number.isNaN(s))return Math.floor(s)}if(typeof e=="string"&&e.endsWith("%")){const s=parseFloat(e);if(!Number.isNaN(s))return Math.floor(n*s*.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 O8(e,n,s){if(typeof e=="string"||typeof e=="number"){const o=ra(e,s),l=ra(e,n);return{top:o,right:l,bottom:o,left:l,x:l*2,y:o*2}}if(typeof e=="object"){const o=ra(e.top??e.y??0,s),l=ra(e.bottom??e.y??0,s),c=ra(e.left??e.x??0,n),d=ra(e.right??e.x??0,n);return{top:o,right:d,bottom:l,left:c,x:c+d,y:o+l}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function z8(e,n,s,o,l,c){const{x:d,y:f}=Uu(e,[n,s,o]),{x:m,y:p}=Uu({x:e.x+e.width,y:e.y+e.height},[n,s,o]),g=l-m,v=c-p;return{left:Math.floor(d),top:Math.floor(f),right:Math.floor(g),bottom:Math.floor(v)}}const ug=(e,n,s,o,l,c)=>{const d=O8(c,n,s),f=(n-d.x)/e.width,m=(s-d.y)/e.height,p=Math.min(f,m),g=xa(p,o,l),v=e.x+e.width/2,y=e.y+e.height/2,b=n/2-v*g,S=s/2-y*g,N=z8(e,b,S,g,n,s),_={left:Math.min(N.left-d.left,0),top:Math.min(N.top-d.top,0),right:Math.min(N.right-d.right,0),bottom:Math.min(N.bottom-d.bottom,0)};return{x:b-_.left+_.right,y:S-_.top+_.bottom,zoom:g}},ll=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0;function va(e){return e!=null&&e!=="parent"}function Hr(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function lS(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function cS(e,n={width:0,height:0},s,o,l){const c={...e},d=o.get(s);if(d){const f=d.origin||l;c.x+=d.internals.positionAbsolute.x-(n.width??0)*f[0],c.y+=d.internals.positionAbsolute.y-(n.height??0)*f[1]}return c}function ub(e,n){if(e.size!==n.size)return!1;for(const s of e)if(!n.has(s))return!1;return!0}function I8(){let e,n;return{promise:new Promise((o,l)=>{e=o,n=l}),resolve:e,reject:n}}function L8(e){return{...eS,...e||{}}}function Yi(e,{snapGrid:n=[0,0],snapToGrid:s=!1,transform:o,containerBounds:l}){const{x:c,y:d}=tr(e),f=jl({x:c-(l?.left??0),y:d-(l?.top??0)},o),{x:m,y:p}=s?Sl(f,n):f;return{xSnapped:m,ySnapped:p,...f}}const dg=e=>({width:e.offsetWidth,height:e.offsetHeight}),uS=e=>e?.getRootNode?.()||window?.document,H8=["INPUT","SELECT","TEXTAREA"];function dS(e){const n=e.composedPath?.()?.[0]||e.target;return n?.nodeType!==1?!1:H8.includes(n.nodeName)||n.hasAttribute("contenteditable")||!!n.closest(".nokey")}const fS=e=>"clientX"in e,tr=(e,n)=>{const s=fS(e),o=s?e.clientX:e.touches?.[0].clientX,l=s?e.clientY:e.touches?.[0].clientY;return{x:o-(n?.left??0),y:l-(n?.top??0)}},db=(e,n,s,o,l)=>{const c=n.querySelectorAll(`.${e}`);return!c||!c.length?null:Array.from(c).map(d=>{const f=d.getBoundingClientRect();return{id:d.getAttribute("data-handleid"),type:e,nodeId:l,position:d.getAttribute("data-handlepos"),x:(f.left-s.left)/o,y:(f.top-s.top)/o,...dg(d)}})};function mS({sourceX:e,sourceY:n,targetX:s,targetY:o,sourceControlX:l,sourceControlY:c,targetControlX:d,targetControlY:f}){const m=e*.125+l*.375+d*.375+s*.125,p=n*.125+c*.375+f*.375+o*.125,g=Math.abs(m-e),v=Math.abs(p-n);return[m,p,g,v]}function nu(e,n){return e>=0?.5*e:n*25*Math.sqrt(-e)}function fb({pos:e,x1:n,y1:s,x2:o,y2:l,c}){switch(e){case Ie.Left:return[n-nu(n-o,c),s];case Ie.Right:return[n+nu(o-n,c),s];case Ie.Top:return[n,s-nu(s-l,c)];case Ie.Bottom:return[n,s+nu(l-s,c)]}}function hS({sourceX:e,sourceY:n,sourcePosition:s=Ie.Bottom,targetX:o,targetY:l,targetPosition:c=Ie.Top,curvature:d=.25}){const[f,m]=fb({pos:s,x1:e,y1:n,x2:o,y2:l,c:d}),[p,g]=fb({pos:c,x1:o,y1:l,x2:e,y2:n,c:d}),[v,y,b,S]=mS({sourceX:e,sourceY:n,targetX:o,targetY:l,sourceControlX:f,sourceControlY:m,targetControlX:p,targetControlY:g});return[`M${e},${n} C${f},${m} ${p},${g} ${o},${l}`,v,y,b,S]}function pS({sourceX:e,sourceY:n,targetX:s,targetY:o}){const l=Math.abs(s-e)/2,c=s<e?s+l:s-l,d=Math.abs(o-n)/2,f=o<n?o+d:o-d;return[c,f,l,d]}function $8({sourceNode:e,targetNode:n,selected:s=!1,zIndex:o,elevateOnSelect:l=!1}){if(o!==void 0)return o;const c=l&&s?1e3:0,d=Math.max(e.parentId?e.internals.z:0,n.parentId?n.internals.z:0);return c+d}function B8({sourceNode:e,targetNode:n,width:s,height:o,transform:l}){const c=wd(Pu(e),Pu(n));c.x===c.x2&&(c.x2+=1),c.y===c.y2&&(c.y2+=1);const d={x:-l[0]/l[2],y:-l[1]/l[2],width:s/l[2],height:o/l[2]};return il(d,Nd(c))>0}const P8=({source:e,sourceHandle:n,target:s,targetHandle:o})=>`xy-edge__${e}${n||""}-${s}${o||""}`,U8=(e,n)=>n.some(s=>s.source===e.source&&s.target===e.target&&(s.sourceHandle===e.sourceHandle||!s.sourceHandle&&!e.sourceHandle)&&(s.targetHandle===e.targetHandle||!s.targetHandle&&!e.targetHandle)),V8=(e,n)=>{if(!e.source||!e.target)return n;let s;return rS(e)?s={...e}:s={...e,id:P8(e)},U8(s,n)?n:(s.sourceHandle===null&&delete s.sourceHandle,s.targetHandle===null&&delete s.targetHandle,n.concat(s))};function gS({sourceX:e,sourceY:n,targetX:s,targetY:o}){const[l,c,d,f]=pS({sourceX:e,sourceY:n,targetX:s,targetY:o});return[`M ${e},${n}L ${s},${o}`,l,c,d,f]}const mb={[Ie.Left]:{x:-1,y:0},[Ie.Right]:{x:1,y:0},[Ie.Top]:{x:0,y:-1},[Ie.Bottom]:{x:0,y:1}},q8=({source:e,sourcePosition:n=Ie.Bottom,target:s})=>n===Ie.Left||n===Ie.Right?e.x<s.x?{x:1,y:0}:{x:-1,y:0}:e.y<s.y?{x:0,y:1}:{x:0,y:-1},hb=(e,n)=>Math.sqrt(Math.pow(n.x-e.x,2)+Math.pow(n.y-e.y,2));function F8({source:e,sourcePosition:n=Ie.Bottom,target:s,targetPosition:o=Ie.Top,center:l,offset:c,stepPosition:d}){const f=mb[n],m=mb[o],p={x:e.x+f.x*c,y:e.y+f.y*c},g={x:s.x+m.x*c,y:s.y+m.y*c},v=q8({source:p,sourcePosition:n,target:g}),y=v.x!==0?"x":"y",b=v[y];let S=[],N,_;const E={x:0,y:0},M={x:0,y:0},[,,j,k]=pS({sourceX:e.x,sourceY:e.y,targetX:s.x,targetY:s.y});if(f[y]*m[y]===-1){y==="x"?(N=l.x??p.x+(g.x-p.x)*d,_=l.y??(p.y+g.y)/2):(N=l.x??(p.x+g.x)/2,_=l.y??p.y+(g.y-p.y)*d);const D=[{x:N,y:p.y},{x:N,y:g.y}],z=[{x:p.x,y:_},{x:g.x,y:_}];f[y]===b?S=y==="x"?D:z:S=y==="x"?z:D}else{const D=[{x:p.x,y:g.y}],z=[{x:g.x,y:p.y}];if(y==="x"?S=f.x===b?z:D:S=f.y===b?D:z,n===o){const G=Math.abs(e[y]-s[y]);if(G<=c){const ne=Math.min(c-1,c-G);f[y]===b?E[y]=(p[y]>e[y]?-1:1)*ne:M[y]=(g[y]>s[y]?-1:1)*ne}}if(n!==o){const G=y==="x"?"y":"x",ne=f[y]===m[G],L=p[G]>g[G],V=p[G]<g[G];(f[y]===1&&(!ne&&L||ne&&V)||f[y]!==1&&(!ne&&V||ne&&L))&&(S=y==="x"?D:z)}const H={x:p.x+E.x,y:p.y+E.y},U={x:g.x+M.x,y:g.y+M.y},F=Math.max(Math.abs(H.x-S[0].x),Math.abs(U.x-S[0].x)),K=Math.max(Math.abs(H.y-S[0].y),Math.abs(U.y-S[0].y));F>=K?(N=(H.x+U.x)/2,_=S[0].y):(N=S[0].x,_=(H.y+U.y)/2)}return[[e,{x:p.x+E.x,y:p.y+E.y},...S,{x:g.x+M.x,y:g.y+M.y},s],N,_,j,k]}function Y8(e,n,s,o){const l=Math.min(hb(e,n)/2,hb(n,s)/2,o),{x:c,y:d}=n;if(e.x===c&&c===s.x||e.y===d&&d===s.y)return`L${c} ${d}`;if(e.y===d){const p=e.x<s.x?-1:1,g=e.y<s.y?1:-1;return`L ${c+l*p},${d}Q ${c},${d} ${c},${d+l*g}`}const f=e.x<s.x?1:-1,m=e.y<s.y?-1:1;return`L ${c},${d+l*m}Q ${c},${d} ${c+l*f},${d}`}function rp({sourceX:e,sourceY:n,sourcePosition:s=Ie.Bottom,targetX:o,targetY:l,targetPosition:c=Ie.Top,borderRadius:d=5,centerX:f,centerY:m,offset:p=20,stepPosition:g=.5}){const[v,y,b,S,N]=F8({source:{x:e,y:n},sourcePosition:s,target:{x:o,y:l},targetPosition:c,center:{x:f,y:m},offset:p,stepPosition:g});return[v.reduce((E,M,j)=>{let k="";return j>0&&j<v.length-1?k=Y8(v[j-1],M,v[j+1],d):k=`${j===0?"M":"L"}${M.x} ${M.y}`,E+=k,E},""),y,b,S,N]}function pb(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function G8(e){const{sourceNode:n,targetNode:s}=e;if(!pb(n)||!pb(s))return null;const o=n.internals.handleBounds||gb(n.handles),l=s.internals.handleBounds||gb(s.handles),c=xb(o?.source??[],e.sourceHandle),d=xb(e.connectionMode===ga.Strict?l?.target??[]:(l?.target??[]).concat(l?.source??[]),e.targetHandle);if(!c||!d)return e.onError?.("008",ar.error008(c?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const f=c?.position||Ie.Bottom,m=d?.position||Ie.Top,p=cl(n,c,f),g=cl(s,d,m);return{sourceX:p.x,sourceY:p.y,targetX:g.x,targetY:g.y,sourcePosition:f,targetPosition:m}}function gb(e){if(!e)return null;const n=[],s=[];for(const o of e)o.width=o.width??1,o.height=o.height??1,o.type==="source"?n.push(o):o.type==="target"&&s.push(o);return{source:n,target:s}}function cl(e,n,s=Ie.Left,o=!1){const l=(n?.x??0)+e.internals.positionAbsolute.x,c=(n?.y??0)+e.internals.positionAbsolute.y,{width:d,height:f}=n??Hr(e);if(o)return{x:l+d/2,y:c+f/2};switch(n?.position??s){case Ie.Top:return{x:l+d/2,y:c};case Ie.Right:return{x:l+d,y:c+f/2};case Ie.Bottom:return{x:l+d/2,y:c+f};case Ie.Left:return{x:l,y:c+f/2}}}function xb(e,n){return e&&(n?e.find(s=>s.id===n):e[0])||null}function sp(e,n){return e?typeof e=="string"?e:`${n?`${n}__`:""}${Object.keys(e).sort().map(o=>`${o}=${e[o]}`).join("&")}`:""}function X8(e,{id:n,defaultColor:s,defaultMarkerStart:o,defaultMarkerEnd:l}){const c=new Set;return e.reduce((d,f)=>([f.markerStart||o,f.markerEnd||l].forEach(m=>{if(m&&typeof m=="object"){const p=sp(m,n);c.has(p)||(d.push({id:p,color:m.color||s,...m}),c.add(p))}}),d),[]).sort((d,f)=>d.id.localeCompare(f.id))}const fg={nodeOrigin:[0,0],nodeExtent:ol,elevateNodesOnSelect:!0,defaults:{}},Z8={...fg,checkEquality:!0};function mg(e,n){const s={...e};for(const o in n)n[o]!==void 0&&(s[o]=n[o]);return s}function W8(e,n,s){const o=mg(fg,s);for(const l of e.values())if(l.parentId)hg(l,e,n,o);else{const c=wl(l,o.nodeOrigin),d=va(l.extent)?l.extent:o.nodeExtent,f=mo(c,d,Hr(l));l.internals.positionAbsolute=f}}function op(e,n,s,o){const l=mg(Z8,o);let c=e.length>0;const d=new Map(n),f=l?.elevateNodesOnSelect?1e3:0;n.clear(),s.clear();for(const m of e){let p=d.get(m.id);if(l.checkEquality&&m===p?.internals.userNode)n.set(m.id,p);else{const g=wl(m,l.nodeOrigin),v=va(m.extent)?m.extent:l.nodeExtent,y=mo(g,v,Hr(m));p={...l.defaults,...m,measured:{width:m.measured?.width,height:m.measured?.height},internals:{positionAbsolute:y,handleBounds:m.measured?p?.internals.handleBounds:void 0,z:xS(m,f),userNode:m}},n.set(m.id,p)}(p.measured===void 0||p.measured.width===void 0||p.measured.height===void 0)&&!p.hidden&&(c=!1),m.parentId&&hg(p,n,s,o)}return c}function K8(e,n){if(!e.parentId)return;const s=n.get(e.parentId);s?s.set(e.id,e):n.set(e.parentId,new Map([[e.id,e]]))}function hg(e,n,s,o){const{elevateNodesOnSelect:l,nodeOrigin:c,nodeExtent:d}=mg(fg,o),f=e.parentId,m=n.get(f);if(!m){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}K8(e,s);const p=l?1e3:0,{x:g,y:v,z:y}=Q8(e,m,c,d,p),{positionAbsolute:b}=e.internals,S=g!==b.x||v!==b.y;(S||y!==e.internals.z)&&n.set(e.id,{...e,internals:{...e.internals,positionAbsolute:S?{x:g,y:v}:b,z:y}})}function xS(e,n){return($n(e.zIndex)?e.zIndex:0)+(e.selected?n:0)}function Q8(e,n,s,o,l){const{x:c,y:d}=n.internals.positionAbsolute,f=Hr(e),m=wl(e,s),p=va(e.extent)?mo(m,e.extent,f):m;let g=mo({x:c+p.x,y:d+p.y},o,f);e.extent==="parent"&&(g=oS(g,f,n));const v=xS(e,l),y=n.internals.z??0;return{x:g.x,y:g.y,z:y>=v?y+1:v}}function pg(e,n,s,o=[0,0]){const l=[],c=new Map;for(const d of e){const f=n.get(d.parentId);if(!f)continue;const m=c.get(d.parentId)?.expandedRect??ya(f),p=iS(m,d.rect);c.set(d.parentId,{expandedRect:p,parent:f})}return c.size>0&&c.forEach(({expandedRect:d,parent:f},m)=>{const p=f.internals.positionAbsolute,g=Hr(f),v=f.origin??o,y=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)),N=Math.max(g.height,Math.round(d.height)),_=(S-g.width)*v[0],E=(N-g.height)*v[1];(y>0||b>0||_||E)&&(l.push({id:m,type:"position",position:{x:f.position.x-y+_,y:f.position.y-b+E}}),s.get(m)?.forEach(M=>{e.some(j=>j.id===M.id)||l.push({id:M.id,type:"position",position:{x:M.position.x+y,y:M.position.y+b}})})),(g.width<d.width||g.height<d.height||y||b)&&l.push({id:m,type:"dimensions",setAttributes:!0,dimensions:{width:S+(y?v[0]*y-_:0),height:N+(b?v[1]*b-E:0)}})}),l}function J8(e,n,s,o,l,c){const d=o?.querySelector(".xyflow__viewport");let f=!1;if(!d)return{changes:[],updatedInternals:f};const m=[],p=window.getComputedStyle(d),{m22:g}=new window.DOMMatrixReadOnly(p.transform),v=[];for(const y of e.values()){const b=n.get(y.id);if(!b)continue;if(b.hidden){n.set(b.id,{...b,internals:{...b.internals,handleBounds:void 0}}),f=!0;continue}const S=dg(y.nodeElement),N=b.measured.width!==S.width||b.measured.height!==S.height;if(!!(S.width&&S.height&&(N||!b.internals.handleBounds||y.force))){const E=y.nodeElement.getBoundingClientRect(),M=va(b.extent)?b.extent:c;let{positionAbsolute:j}=b.internals;b.parentId&&b.extent==="parent"?j=oS(j,S,n.get(b.parentId)):M&&(j=mo(j,M,S));const k={...b,measured:S,internals:{...b.internals,positionAbsolute:j,handleBounds:{source:db("source",y.nodeElement,E,g,b.id),target:db("target",y.nodeElement,E,g,b.id)}}};n.set(b.id,k),b.parentId&&hg(k,n,s,{nodeOrigin:l}),f=!0,N&&(m.push({id:b.id,type:"dimensions",dimensions:S}),b.expandParent&&b.parentId&&v.push({id:b.id,parentId:b.parentId,rect:ya(k,l)}))}}if(v.length>0){const y=pg(v,n,s,l);m.push(...y)}return{changes:m,updatedInternals:f}}async function e9({delta:e,panZoom:n,transform:s,translateExtent:o,width:l,height:c}){if(!n||!e.x&&!e.y)return Promise.resolve(!1);const d=await n.setViewportConstrained({x:s[0]+e.x,y:s[1]+e.y,zoom:s[2]},[[0,0],[l,c]],o),f=!!d&&(d.x!==s[0]||d.y!==s[1]||d.k!==s[2]);return Promise.resolve(f)}function yb(e,n,s,o,l,c){let d=l;const f=o.get(d)||new Map;o.set(d,f.set(s,n)),d=`${l}-${e}`;const m=o.get(d)||new Map;if(o.set(d,m.set(s,n)),c){d=`${l}-${e}-${c}`;const p=o.get(d)||new Map;o.set(d,p.set(s,n))}}function yS(e,n,s){e.clear(),n.clear();for(const o of s){const{source:l,target:c,sourceHandle:d=null,targetHandle:f=null}=o,m={edgeId:o.id,source:l,target:c,sourceHandle:d,targetHandle:f},p=`${l}-${d}--${c}-${f}`,g=`${c}-${f}--${l}-${d}`;yb("source",m,g,e,l,d),yb("target",m,p,e,c,f),n.set(o.id,o)}}function vS(e,n){if(!e.parentId)return!1;const s=n.get(e.parentId);return s?s.selected?!0:vS(s,n):!1}function vb(e,n,s){let o=e;do{if(o?.matches?.(n))return!0;if(o===s)return!1;o=o?.parentElement}while(o);return!1}function t9(e,n,s,o){const l=new Map;for(const[c,d]of e)if((d.selected||d.id===o)&&(!d.parentId||!vS(d,e))&&(d.draggable||n&&typeof d.draggable>"u")){const f=e.get(c);f&&l.set(c,{id:c,position:f.position||{x:0,y:0},distance:{x:s.x-f.internals.positionAbsolute.x,y:s.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 hh({nodeId:e,dragItems:n,nodeLookup:s,dragging:o=!0}){const l=[];for(const[d,f]of n){const m=s.get(d)?.internals.userNode;m&&l.push({...m,position:f.position,dragging:o})}if(!e)return[l[0],l];const c=s.get(e)?.internals.userNode;return[c?{...c,position:n.get(e)?.position||c.position,dragging:o}:l[0],l]}function n9({dragItems:e,snapGrid:n,x:s,y:o}){const l=e.values().next().value;if(!l)return null;const c={x:s-l.distance.x,y:o-l.distance.y},d=Sl(c,n);return{x:d.x-c.x,y:d.y-c.y}}function r9({onNodeMouseDown:e,getStoreItems:n,onDragStart:s,onDrag:o,onDragStop:l}){let c={x:null,y:null},d=0,f=new Map,m=!1,p={x:0,y:0},g=null,v=!1,y=null,b=!1,S=!1,N=null;function _({noDragClassName:M,handleSelector:j,domNode:k,isSelectable:R,nodeId:D,nodeClickDistance:z=0}){y=yn(k);function H({x:G,y:ne}){const{nodeLookup:L,nodeExtent:V,snapGrid:A,snapToGrid:I,nodeOrigin:$,onNodeDrag:P,onSelectionDrag:T,onError:B,updateNodePositions:W}=n();c={x:G,y:ne};let Z=!1;const re=f.size>1,de=re&&V?np(Nl(f)):null,ge=re&&I?n9({dragItems:f,snapGrid:A,x:G,y:ne}):null;for(const[J,le]of f){if(!L.has(J))continue;let ve={x:G-le.distance.x,y:ne-le.distance.y};I&&(ve=ge?{x:Math.round(ve.x+ge.x),y:Math.round(ve.y+ge.y)}:Sl(ve,A));let Ne=null;if(re&&V&&!le.extent&&de){const{positionAbsolute:Re}=le.internals,te=Re.x-de.x+V[0][0],Ee=Re.x+le.measured.width-de.x2+V[1][0],Ve=Re.y-de.y+V[0][1],Qe=Re.y+le.measured.height-de.y2+V[1][1];Ne=[[te,Ve],[Ee,Qe]]}const{position:_e,positionAbsolute:be}=sS({nodeId:J,nextPosition:ve,nodeLookup:L,nodeExtent:Ne||V,nodeOrigin:$,onError:B});Z=Z||le.position.x!==_e.x||le.position.y!==_e.y,le.position=_e,le.internals.positionAbsolute=be}if(S=S||Z,!!Z&&(W(f,!0),N&&(o||P||!D&&T))){const[J,le]=hh({nodeId:D,dragItems:f,nodeLookup:L});o?.(N,f,J,le),P?.(N,J,le),D||T?.(N,le)}}async function U(){if(!g)return;const{transform:G,panBy:ne,autoPanSpeed:L,autoPanOnNodeDrag:V}=n();if(!V){m=!1,cancelAnimationFrame(d);return}const[A,I]=aS(p,g,L);(A!==0||I!==0)&&(c.x=(c.x??0)-A/G[2],c.y=(c.y??0)-I/G[2],await ne({x:A,y:I})&&H(c)),d=requestAnimationFrame(U)}function F(G){const{nodeLookup:ne,multiSelectionActive:L,nodesDraggable:V,transform:A,snapGrid:I,snapToGrid:$,selectNodesOnDrag:P,onNodeDragStart:T,onSelectionDragStart:B,unselectNodesAndEdges:W}=n();v=!0,(!P||!R)&&!L&&D&&(ne.get(D)?.selected||W()),R&&P&&D&&e?.(D);const Z=Yi(G.sourceEvent,{transform:A,snapGrid:I,snapToGrid:$,containerBounds:g});if(c=Z,f=t9(ne,V,Z,D),f.size>0&&(s||T||!D&&B)){const[re,de]=hh({nodeId:D,dragItems:f,nodeLookup:ne});s?.(G.sourceEvent,f,re,de),T?.(G.sourceEvent,re,de),D||B?.(G.sourceEvent,de)}}const K=LN().clickDistance(z).on("start",G=>{const{domNode:ne,nodeDragThreshold:L,transform:V,snapGrid:A,snapToGrid:I}=n();g=ne?.getBoundingClientRect()||null,b=!1,S=!1,N=G.sourceEvent,L===0&&F(G),c=Yi(G.sourceEvent,{transform:V,snapGrid:A,snapToGrid:I,containerBounds:g}),p=tr(G.sourceEvent,g)}).on("drag",G=>{const{autoPanOnNodeDrag:ne,transform:L,snapGrid:V,snapToGrid:A,nodeDragThreshold:I,nodeLookup:$}=n(),P=Yi(G.sourceEvent,{transform:L,snapGrid:V,snapToGrid:A,containerBounds:g});if(N=G.sourceEvent,(G.sourceEvent.type==="touchmove"&&G.sourceEvent.touches.length>1||D&&!$.has(D))&&(b=!0),!b){if(!m&&ne&&v&&(m=!0,U()),!v){const T=P.xSnapped-(c.x??0),B=P.ySnapped-(c.y??0);Math.sqrt(T*T+B*B)>I&&F(G)}(c.x!==P.xSnapped||c.y!==P.ySnapped)&&f&&v&&(p=tr(G.sourceEvent,g),H(P))}}).on("end",G=>{if(!(!v||b)&&(m=!1,v=!1,cancelAnimationFrame(d),f.size>0)){const{nodeLookup:ne,updateNodePositions:L,onNodeDragStop:V,onSelectionDragStop:A}=n();if(S&&(L(f,!1),S=!1),l||V||!D&&A){const[I,$]=hh({nodeId:D,dragItems:f,nodeLookup:ne,dragging:!1});l?.(G.sourceEvent,f,I,$),V?.(G.sourceEvent,I,$),D||A?.(G.sourceEvent,$)}}}).filter(G=>{const ne=G.target;return!G.button&&(!M||!vb(ne,`.${M}`,k))&&(!j||vb(ne,j,k))});y.call(K)}function E(){y?.on(".drag",null)}return{update:_,destroy:E}}function s9(e,n,s){const o=[],l={x:e.x-s,y:e.y-s,width:s*2,height:s*2};for(const c of n.values())il(l,ya(c))>0&&o.push(c);return o}const o9=250;function a9(e,n,s,o){let l=[],c=1/0;const d=s9(e,s,n+o9);for(const f of d){const m=[...f.internals.handleBounds?.source??[],...f.internals.handleBounds?.target??[]];for(const p of m){if(o.nodeId===p.nodeId&&o.type===p.type&&o.id===p.id)continue;const{x:g,y:v}=cl(f,p,p.position,!0),y=Math.sqrt(Math.pow(g-e.x,2)+Math.pow(v-e.y,2));y>n||(y<c?(l=[{...p,x:g,y:v}],c=y):y===c&&l.push({...p,x:g,y:v}))}}if(!l.length)return null;if(l.length>1){const f=o.type==="source"?"target":"source";return l.find(m=>m.type===f)??l[0]}return l[0]}function bS(e,n,s,o,l,c=!1){const d=o.get(e);if(!d)return null;const f=l==="strict"?d.internals.handleBounds?.[n]:[...d.internals.handleBounds?.source??[],...d.internals.handleBounds?.target??[]],m=(s?f?.find(p=>p.id===s):f?.[0])??null;return m&&c?{...m,...cl(d,m,m.position,!0)}:m}function wS(e,n){return e||(n?.classList.contains("target")?"target":n?.classList.contains("source")?"source":null)}function i9(e,n){let s=null;return n?s=!0:e&&!n&&(s=!1),s}const NS=()=>!0;function l9(e,{connectionMode:n,connectionRadius:s,handleId:o,nodeId:l,edgeUpdaterType:c,isTarget:d,domNode:f,nodeLookup:m,lib:p,autoPanOnConnect:g,flowId:v,panBy:y,cancelConnection:b,onConnectStart:S,onConnect:N,onConnectEnd:_,isValidConnection:E=NS,onReconnectEnd:M,updateConnection:j,getTransform:k,getFromHandle:R,autoPanSpeed:D,dragThreshold:z=1,handleDomNode:H}){const U=uS(e.target);let F=0,K;const{x:G,y:ne}=tr(e),L=wS(c,H),V=f?.getBoundingClientRect();let A=!1;if(!V||!L)return;const I=bS(l,L,o,m,n);if(!I)return;let $=tr(e,V),P=!1,T=null,B=!1,W=null;function Z(){if(!g||!V)return;const[_e,be]=aS($,V,D);y({x:_e,y:be}),F=requestAnimationFrame(Z)}const re={...I,nodeId:l,type:L,position:I.position},de=m.get(l);let J={inProgress:!0,isValid:null,from:cl(de,re,Ie.Left,!0),fromHandle:re,fromPosition:re.position,fromNode:de,to:$,toHandle:null,toPosition:ib[re.position],toNode:null};function le(){A=!0,j(J),S?.(e,{nodeId:l,handleId:o,handleType:L})}z===0&&le();function ve(_e){if(!A){const{x:Ee,y:Ve}=tr(_e),Qe=Ee-G,It=Ve-ne;if(!(Qe*Qe+It*It>z*z))return;le()}if(!R()||!re){Ne(_e);return}const be=k();$=tr(_e,V),K=a9(jl($,be,!1,[1,1]),s,m,re),P||(Z(),P=!0);const Re=SS(_e,{handle:K,connectionMode:n,fromNodeId:l,fromHandleId:o,fromType:d?"target":"source",isValidConnection:E,doc:U,lib:p,flowId:v,nodeLookup:m});W=Re.handleDomNode,T=Re.connection,B=i9(!!K,Re.isValid);const te={...J,isValid:B,to:Re.toHandle&&B?Uu({x:Re.toHandle.x,y:Re.toHandle.y},be):$,toHandle:Re.toHandle,toPosition:B&&Re.toHandle?Re.toHandle.position:ib[re.position],toNode:Re.toHandle?m.get(Re.toHandle.nodeId):null};B&&K&&J.toHandle&&te.toHandle&&J.toHandle.type===te.toHandle.type&&J.toHandle.nodeId===te.toHandle.nodeId&&J.toHandle.id===te.toHandle.id&&J.to.x===te.to.x&&J.to.y===te.to.y||(j(te),J=te)}function Ne(_e){if(A){(K||W)&&T&&B&&N?.(T);const{inProgress:be,...Re}=J,te={...Re,toPosition:J.toHandle?J.toPosition:null};_?.(_e,te),c&&M?.(_e,te)}b(),cancelAnimationFrame(F),P=!1,B=!1,T=null,W=null,U.removeEventListener("mousemove",ve),U.removeEventListener("mouseup",Ne),U.removeEventListener("touchmove",ve),U.removeEventListener("touchend",Ne)}U.addEventListener("mousemove",ve),U.addEventListener("mouseup",Ne),U.addEventListener("touchmove",ve),U.addEventListener("touchend",Ne)}function SS(e,{handle:n,connectionMode:s,fromNodeId:o,fromHandleId:l,fromType:c,doc:d,lib:f,flowId:m,isValidConnection:p=NS,nodeLookup:g}){const v=c==="target",y=n?d.querySelector(`.${f}-flow__handle[data-id="${m}-${n?.nodeId}-${n?.id}-${n?.type}"]`):null,{x:b,y:S}=tr(e),N=d.elementFromPoint(b,S),_=N?.classList.contains(`${f}-flow__handle`)?N:y,E={handleDomNode:_,isValid:!1,connection:null,toHandle:null};if(_){const M=wS(void 0,_),j=_.getAttribute("data-nodeid"),k=_.getAttribute("data-handleid"),R=_.classList.contains("connectable"),D=_.classList.contains("connectableend");if(!j||!M)return E;const z={source:v?j:o,sourceHandle:v?k:l,target:v?o:j,targetHandle:v?l:k};E.connection=z;const U=R&&D&&(s===ga.Strict?v&&M==="source"||!v&&M==="target":j!==o||k!==l);E.isValid=U&&p(z),E.toHandle=bS(j,M,k,g,s,!0)}return E}const ap={onPointerDown:l9,isValid:SS};function c9({domNode:e,panZoom:n,getTransform:s,getViewScale:o}){const l=yn(e);function c({translateExtent:f,width:m,height:p,zoomStep:g=1,pannable:v=!0,zoomable:y=!0,inversePan:b=!1}){const S=j=>{if(j.sourceEvent.type!=="wheel"||!n)return;const k=s(),R=j.sourceEvent.ctrlKey&&ll()?10:1,D=-j.sourceEvent.deltaY*(j.sourceEvent.deltaMode===1?.05:j.sourceEvent.deltaMode?1:.002)*g,z=k[2]*Math.pow(2,D*R);n.scaleTo(z)};let N=[0,0];const _=j=>{(j.sourceEvent.type==="mousedown"||j.sourceEvent.type==="touchstart")&&(N=[j.sourceEvent.clientX??j.sourceEvent.touches[0].clientX,j.sourceEvent.clientY??j.sourceEvent.touches[0].clientY])},E=j=>{const k=s();if(j.sourceEvent.type!=="mousemove"&&j.sourceEvent.type!=="touchmove"||!n)return;const R=[j.sourceEvent.clientX??j.sourceEvent.touches[0].clientX,j.sourceEvent.clientY??j.sourceEvent.touches[0].clientY],D=[R[0]-N[0],R[1]-N[1]];N=R;const z=o()*Math.max(k[2],Math.log(k[2]))*(b?-1:1),H={x:k[0]-D[0]*z,y:k[1]-D[1]*z},U=[[0,0],[m,p]];n.setViewportConstrained({x:H.x,y:H.y,zoom:k[2]},U,f)},M=QN().on("start",_).on("zoom",v?E:null).on("zoom.wheel",y?S:null);l.call(M,{})}function d(){l.on("zoom",null)}return{update:c,destroy:d,pointer:Ln}}const u9=(e,n)=>e.x!==n.x||e.y!==n.y||e.zoom!==n.k,Sd=e=>({x:e.x,y:e.y,zoom:e.k}),ph=({x:e,y:n,zoom:s})=>bd.translate(e,n).scale(s),sa=(e,n)=>e.target.closest(`.${n}`),jS=(e,n)=>n===2&&Array.isArray(e)&&e.includes(2),d9=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,gh=(e,n=0,s=d9,o=()=>{})=>{const l=typeof n=="number"&&n>0;return l||o(),l?e.transition().duration(n).ease(s).on("end",o):e},_S=e=>{const n=e.ctrlKey&&ll()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*n};function f9({zoomPanValues:e,noWheelClassName:n,d3Selection:s,d3Zoom:o,panOnScrollMode:l,panOnScrollSpeed:c,zoomOnPinch:d,onPanZoomStart:f,onPanZoom:m,onPanZoomEnd:p}){return g=>{if(sa(g,n))return!1;g.preventDefault(),g.stopImmediatePropagation();const v=s.property("__zoom").k||1;if(g.ctrlKey&&d){const _=Ln(g),E=_S(g),M=v*Math.pow(2,E);o.scaleTo(s,M,_,g);return}const y=g.deltaMode===1?20:1;let b=l===ro.Vertical?0:g.deltaX*y,S=l===ro.Horizontal?0:g.deltaY*y;!ll()&&g.shiftKey&&l!==ro.Vertical&&(b=g.deltaY*y,S=0),o.translateBy(s,-(b/v)*c,-(S/v)*c,{internal:!0});const N=Sd(s.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling||(e.isPanScrolling=!0,f?.(g,N)),e.isPanScrolling&&(m?.(g,N),e.panScrollTimeout=setTimeout(()=>{p?.(g,N),e.isPanScrolling=!1},150))}}function m9({noWheelClassName:e,preventScrolling:n,d3ZoomHandler:s}){return function(o,l){const c=o.type==="wheel",d=!n&&c&&!o.ctrlKey,f=sa(o,e);if(o.ctrlKey&&c&&f&&o.preventDefault(),d||f)return null;o.preventDefault(),s.call(this,o,l)}}function h9({zoomPanValues:e,onDraggingChange:n,onPanZoomStart:s}){return o=>{if(o.sourceEvent?.internal)return;const l=Sd(o.transform);e.mouseButton=o.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=l,o.sourceEvent?.type==="mousedown"&&n(!0),s&&s?.(o.sourceEvent,l)}}function p9({zoomPanValues:e,panOnDrag:n,onPaneContextMenu:s,onTransformChange:o,onPanZoom:l}){return c=>{e.usedRightMouseButton=!!(s&&jS(n,e.mouseButton??0)),c.sourceEvent?.sync||o([c.transform.x,c.transform.y,c.transform.k]),l&&!c.sourceEvent?.internal&&l?.(c.sourceEvent,Sd(c.transform))}}function g9({zoomPanValues:e,panOnDrag:n,panOnScroll:s,onDraggingChange:o,onPanZoomEnd:l,onPaneContextMenu:c}){return d=>{if(!d.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,c&&jS(n,e.mouseButton??0)&&!e.usedRightMouseButton&&d.sourceEvent&&c(d.sourceEvent),e.usedRightMouseButton=!1,o(!1),l&&u9(e.prevViewport,d.transform))){const f=Sd(d.transform);e.prevViewport=f,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{l?.(d.sourceEvent,f)},s?150:0)}}}function x9({zoomActivationKeyPressed:e,zoomOnScroll:n,zoomOnPinch:s,panOnDrag:o,panOnScroll:l,zoomOnDoubleClick:c,userSelectionActive:d,noWheelClassName:f,noPanClassName:m,lib:p}){return g=>{const v=e||n,y=s&&g.ctrlKey;if(g.button===1&&g.type==="mousedown"&&(sa(g,`${p}-flow__node`)||sa(g,`${p}-flow__edge`)))return!0;if(!o&&!v&&!l&&!c&&!s||d||sa(g,f)&&g.type==="wheel"||sa(g,m)&&(g.type!=="wheel"||l&&g.type==="wheel"&&!e)||!s&&g.ctrlKey&&g.type==="wheel")return!1;if(!s&&g.type==="touchstart"&&g.touches?.length>1)return g.preventDefault(),!1;if(!v&&!l&&!y&&g.type==="wheel"||!o&&(g.type==="mousedown"||g.type==="touchstart")||Array.isArray(o)&&!o.includes(g.button)&&g.type==="mousedown")return!1;const b=Array.isArray(o)&&o.includes(g.button)||!g.button||g.button<=1;return(!g.ctrlKey||g.type==="wheel")&&b}}function y9({domNode:e,minZoom:n,maxZoom:s,paneClickDistance:o,translateExtent:l,viewport:c,onPanZoom:d,onPanZoomStart:f,onPanZoomEnd:m,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},v=e.getBoundingClientRect(),y=QN().clickDistance(!$n(o)||o<0?0:o).scaleExtent([n,s]).translateExtent(l),b=yn(e).call(y);j({x:c.x,y:c.y,zoom:xa(c.zoom,n,s)},[[0,0],[v.width,v.height]],l);const S=b.on("wheel.zoom"),N=b.on("dblclick.zoom");y.wheelDelta(_S);function _(G,ne){return b?new Promise(L=>{y?.interpolate(ne?.interpolate==="linear"?Fi:pu).transform(gh(b,ne?.duration,ne?.ease,()=>L(!0)),G)}):Promise.resolve(!1)}function E({noWheelClassName:G,noPanClassName:ne,onPaneContextMenu:L,userSelectionActive:V,panOnScroll:A,panOnDrag:I,panOnScrollMode:$,panOnScrollSpeed:P,preventScrolling:T,zoomOnPinch:B,zoomOnScroll:W,zoomOnDoubleClick:Z,zoomActivationKeyPressed:re,lib:de,onTransformChange:ge}){V&&!g.isZoomingOrPanning&&M();const le=A&&!re&&!V?f9({zoomPanValues:g,noWheelClassName:G,d3Selection:b,d3Zoom:y,panOnScrollMode:$,panOnScrollSpeed:P,zoomOnPinch:B,onPanZoomStart:f,onPanZoom:d,onPanZoomEnd:m}):m9({noWheelClassName:G,preventScrolling:T,d3ZoomHandler:S});if(b.on("wheel.zoom",le,{passive:!1}),!V){const Ne=h9({zoomPanValues:g,onDraggingChange:p,onPanZoomStart:f});y.on("start",Ne);const _e=p9({zoomPanValues:g,panOnDrag:I,onPaneContextMenu:!!L,onPanZoom:d,onTransformChange:ge});y.on("zoom",_e);const be=g9({zoomPanValues:g,panOnDrag:I,panOnScroll:A,onPaneContextMenu:L,onPanZoomEnd:m,onDraggingChange:p});y.on("end",be)}const ve=x9({zoomActivationKeyPressed:re,panOnDrag:I,zoomOnScroll:W,panOnScroll:A,zoomOnDoubleClick:Z,zoomOnPinch:B,userSelectionActive:V,noPanClassName:ne,noWheelClassName:G,lib:de});y.filter(ve),Z?b.on("dblclick.zoom",N):b.on("dblclick.zoom",null)}function M(){y.on("zoom",null)}async function j(G,ne,L){const V=ph(G),A=y?.constrain()(V,ne,L);return A&&await _(A),new Promise(I=>I(A))}async function k(G,ne){const L=ph(G);return await _(L,ne),new Promise(V=>V(L))}function R(G){if(b){const ne=ph(G),L=b.property("__zoom");(L.k!==G.zoom||L.x!==G.x||L.y!==G.y)&&y?.transform(b,ne,null,{sync:!0})}}function D(){const G=b?KN(b.node()):{x:0,y:0,k:1};return{x:G.x,y:G.y,zoom:G.k}}function z(G,ne){return b?new Promise(L=>{y?.interpolate(ne?.interpolate==="linear"?Fi:pu).scaleTo(gh(b,ne?.duration,ne?.ease,()=>L(!0)),G)}):Promise.resolve(!1)}function H(G,ne){return b?new Promise(L=>{y?.interpolate(ne?.interpolate==="linear"?Fi:pu).scaleBy(gh(b,ne?.duration,ne?.ease,()=>L(!0)),G)}):Promise.resolve(!1)}function U(G){y?.scaleExtent(G)}function F(G){y?.translateExtent(G)}function K(G){const ne=!$n(G)||G<0?0:G;y?.clickDistance(ne)}return{update:E,destroy:M,setViewport:k,setViewportConstrained:j,getViewport:D,scaleTo:z,scaleBy:H,setScaleExtent:U,setTranslateExtent:F,syncViewport:R,setClickDistance:K}}var ba;(function(e){e.Line="line",e.Handle="handle"})(ba||(ba={}));function v9({width:e,prevWidth:n,height:s,prevHeight:o,affectsX:l,affectsY:c}){const d=e-n,f=s-o,m=[d>0?1:d<0?-1:0,f>0?1:f<0?-1:0];return d&&l&&(m[0]=m[0]*-1),f&&c&&(m[1]=m[1]*-1),m}function b9(e){const n=e.includes("right")||e.includes("left"),s=e.includes("bottom")||e.includes("top"),o=e.includes("left"),l=e.includes("top");return{isHorizontal:n,isVertical:s,affectsX:o,affectsY:l}}function ms(e,n){return Math.max(0,n-e)}function hs(e,n){return Math.max(0,e-n)}function ru(e,n,s){return Math.max(0,n-e,e-s)}function bb(e,n){return e?!n:n}function w9(e,n,s,o,l,c,d,f){let{affectsX:m,affectsY:p}=n;const{isHorizontal:g,isVertical:v}=n,y=g&&v,{xSnapped:b,ySnapped:S}=s,{minWidth:N,maxWidth:_,minHeight:E,maxHeight:M}=o,{x:j,y:k,width:R,height:D,aspectRatio:z}=e;let H=Math.floor(g?b-e.pointerX:0),U=Math.floor(v?S-e.pointerY:0);const F=R+(m?-H:H),K=D+(p?-U:U),G=-c[0]*R,ne=-c[1]*D;let L=ru(F,N,_),V=ru(K,E,M);if(d){let $=0,P=0;m&&H<0?$=ms(j+H+G,d[0][0]):!m&&H>0&&($=hs(j+F+G,d[1][0])),p&&U<0?P=ms(k+U+ne,d[0][1]):!p&&U>0&&(P=hs(k+K+ne,d[1][1])),L=Math.max(L,$),V=Math.max(V,P)}if(f){let $=0,P=0;m&&H>0?$=hs(j+H,f[0][0]):!m&&H<0&&($=ms(j+F,f[1][0])),p&&U>0?P=hs(k+U,f[0][1]):!p&&U<0&&(P=ms(k+K,f[1][1])),L=Math.max(L,$),V=Math.max(V,P)}if(l){if(g){const $=ru(F/z,E,M)*z;if(L=Math.max(L,$),d){let P=0;!m&&!p||m&&!p&&y?P=hs(k+ne+F/z,d[1][1])*z:P=ms(k+ne+(m?H:-H)/z,d[0][1])*z,L=Math.max(L,P)}if(f){let P=0;!m&&!p||m&&!p&&y?P=ms(k+F/z,f[1][1])*z:P=hs(k+(m?H:-H)/z,f[0][1])*z,L=Math.max(L,P)}}if(v){const $=ru(K*z,N,_)/z;if(V=Math.max(V,$),d){let P=0;!m&&!p||p&&!m&&y?P=hs(j+K*z+G,d[1][0])/z:P=ms(j+(p?U:-U)*z+G,d[0][0])/z,V=Math.max(V,P)}if(f){let P=0;!m&&!p||p&&!m&&y?P=ms(j+K*z,f[1][0])/z:P=hs(j+(p?U:-U)*z,f[0][0])/z,V=Math.max(V,P)}}}U=U+(U<0?V:-V),H=H+(H<0?L:-L),l&&(y?F>K*z?U=(bb(m,p)?-H:H)/z:H=(bb(m,p)?-U:U)*z:g?(U=H/z,p=m):(H=U*z,m=p));const A=m?j+H:j,I=p?k+U:k;return{width:R+(m?-H:H),height:D+(p?-U:U),x:c[0]*H*(m?-1:1)+A,y:c[1]*U*(p?-1:1)+I}}const ES={width:0,height:0,x:0,y:0},N9={...ES,pointerX:0,pointerY:0,aspectRatio:1};function S9(e){return[[0,0],[e.measured.width,e.measured.height]]}function j9(e,n,s){const o=n.position.x+e.position.x,l=n.position.y+e.position.y,c=e.measured.width??0,d=e.measured.height??0,f=s[0]*c,m=s[1]*d;return[[o-f,l-m],[o+c-f,l+d-m]]}function _9({domNode:e,nodeId:n,getStoreItems:s,onChange:o,onEnd:l}){const c=yn(e);function d({controlPosition:m,boundaries:p,keepAspectRatio:g,resizeDirection:v,onResizeStart:y,onResize:b,onResizeEnd:S,shouldResize:N}){let _={...ES},E={...N9};const M=b9(m);let j,k=null,R=[],D,z,H;const U=LN().on("start",F=>{const{nodeLookup:K,transform:G,snapGrid:ne,snapToGrid:L,nodeOrigin:V,paneDomNode:A}=s();if(j=K.get(n),!j)return;k=A?.getBoundingClientRect()??null;const{xSnapped:I,ySnapped:$}=Yi(F.sourceEvent,{transform:G,snapGrid:ne,snapToGrid:L,containerBounds:k});_={width:j.measured.width??0,height:j.measured.height??0,x:j.position.x??0,y:j.position.y??0},E={..._,pointerX:I,pointerY:$,aspectRatio:_.width/_.height},D=void 0,j.parentId&&(j.extent==="parent"||j.expandParent)&&(D=K.get(j.parentId),z=D&&j.extent==="parent"?S9(D):void 0),R=[],H=void 0;for(const[P,T]of K)if(T.parentId===n&&(R.push({id:P,position:{...T.position},extent:T.extent}),T.extent==="parent"||T.expandParent)){const B=j9(T,j,T.origin??V);H?H=[[Math.min(B[0][0],H[0][0]),Math.min(B[0][1],H[0][1])],[Math.max(B[1][0],H[1][0]),Math.max(B[1][1],H[1][1])]]:H=B}y?.(F,{..._})}).on("drag",F=>{const{transform:K,snapGrid:G,snapToGrid:ne,nodeOrigin:L}=s(),V=Yi(F.sourceEvent,{transform:K,snapGrid:G,snapToGrid:ne,containerBounds:k}),A=[];if(!j)return;const{x:I,y:$,width:P,height:T}=_,B={},W=j.origin??L,{width:Z,height:re,x:de,y:ge}=w9(E,M,V,p,g,W,z,H),J=Z!==P,le=re!==T,ve=de!==I&&J,Ne=ge!==$&&le;if(!ve&&!Ne&&!J&&!le)return;if((ve||Ne||W[0]===1||W[1]===1)&&(B.x=ve?de:_.x,B.y=Ne?ge:_.y,_.x=B.x,_.y=B.y,R.length>0)){const te=de-I,Ee=ge-$;for(const Ve of R)Ve.position={x:Ve.position.x-te+W[0]*(Z-P),y:Ve.position.y-Ee+W[1]*(re-T)},A.push(Ve)}if((J||le)&&(B.width=J&&(!v||v==="horizontal")?Z:_.width,B.height=le&&(!v||v==="vertical")?re:_.height,_.width=B.width,_.height=B.height),D&&j.expandParent){const te=W[0]*(B.width??0);B.x&&B.x<te&&(_.x=te,E.x=E.x-(B.x-te));const Ee=W[1]*(B.height??0);B.y&&B.y<Ee&&(_.y=Ee,E.y=E.y-(B.y-Ee))}const _e=v9({width:_.width,prevWidth:P,height:_.height,prevHeight:T,affectsX:M.affectsX,affectsY:M.affectsY}),be={..._,direction:_e};N?.(F,be)!==!1&&(b?.(F,be),o(B,A))}).on("end",F=>{S?.(F,{..._}),l?.({..._})});c.call(U)}function f(){c.on(".drag",null)}return{update:d,destroy:f}}var xh={exports:{}},yh={},vh={exports:{}},bh={};/**
 * @license React
 * use-sync-external-store-shim.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var wb;function E9(){if(wb)return bh;wb=1;var e=dl();function n(v,y){return v===y&&(v!==0||1/v===1/y)||v!==v&&y!==y}var s=typeof Object.is=="function"?Object.is:n,o=e.useState,l=e.useEffect,c=e.useLayoutEffect,d=e.useDebugValue;function f(v,y){var b=y(),S=o({inst:{value:b,getSnapshot:y}}),N=S[0].inst,_=S[1];return c(function(){N.value=b,N.getSnapshot=y,m(N)&&_({inst:N})},[v,b,y]),l(function(){return m(N)&&_({inst:N}),v(function(){m(N)&&_({inst:N})})},[v]),d(b),b}function m(v){var y=v.getSnapshot;v=v.value;try{var b=y();return!s(v,b)}catch{return!0}}function p(v,y){return y()}var g=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?p:f;return bh.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:g,bh}var Nb;function C9(){return Nb||(Nb=1,vh.exports=E9()),vh.exports}/**
 * @license React
 * use-sync-external-store-shim/with-selector.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var Sb;function k9(){if(Sb)return yh;Sb=1;var e=dl(),n=C9();function s(p,g){return p===g&&(p!==0||1/p===1/g)||p!==p&&g!==g}var o=typeof Object.is=="function"?Object.is:s,l=n.useSyncExternalStore,c=e.useRef,d=e.useEffect,f=e.useMemo,m=e.useDebugValue;return yh.useSyncExternalStoreWithSelector=function(p,g,v,y,b){var S=c(null);if(S.current===null){var N={hasValue:!1,value:null};S.current=N}else N=S.current;S=f(function(){function E(D){if(!M){if(M=!0,j=D,D=y(D),b!==void 0&&N.hasValue){var z=N.value;if(b(z,D))return k=z}return k=D}if(z=k,o(j,D))return z;var H=y(D);return b!==void 0&&b(z,H)?(j=D,z):(j=D,k=H)}var M=!1,j,k,R=v===void 0?null:v;return[function(){return E(g())},R===null?void 0:function(){return E(R())}]},[g,v,y,b]);var _=l(p,S[0],S[1]);return d(function(){N.hasValue=!0,N.value=_},[_]),m(_),_},yh}var jb;function A9(){return jb||(jb=1,xh.exports=k9()),xh.exports}var M9=A9();const T9=dp(M9),R9={},_b=e=>{let n;const s=new Set,o=(g,v)=>{const y=typeof g=="function"?g(n):g;if(!Object.is(y,n)){const b=n;n=v??(typeof y!="object"||y===null)?y:Object.assign({},n,y),s.forEach(S=>S(n,b))}},l=()=>n,m={setState:o,getState:l,getInitialState:()=>p,subscribe:g=>(s.add(g),()=>s.delete(g)),destroy:()=>{(R9?"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."),s.clear()}},p=n=e(o,l,m);return m},D9=e=>e?_b(e):_b,{useDebugValue:O9}=gn,{useSyncExternalStoreWithSelector:z9}=T9,I9=e=>e;function CS(e,n=I9,s){const o=z9(e.subscribe,e.getState,e.getServerState||e.getInitialState,n,s);return O9(o),o}const Eb=(e,n)=>{const s=D9(e),o=(l,c=n)=>CS(s,l,c);return Object.assign(o,s),o},L9=(e,n)=>e?Eb(e,n):Eb;function bt(e,n){if(Object.is(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;if(e instanceof Map&&n instanceof Map){if(e.size!==n.size)return!1;for(const[o,l]of e)if(!Object.is(l,n.get(o)))return!1;return!0}if(e instanceof Set&&n instanceof Set){if(e.size!==n.size)return!1;for(const o of e)if(!n.has(o))return!1;return!0}const s=Object.keys(e);if(s.length!==Object.keys(n).length)return!1;for(const o of s)if(!Object.prototype.hasOwnProperty.call(n,o)||!Object.is(e[o],n[o]))return!1;return!0}const jd=w.createContext(null),H9=jd.Provider,kS=ar.error001();function tt(e,n){const s=w.useContext(jd);if(s===null)throw new Error(kS);return CS(s,e,n)}function yt(){const e=w.useContext(jd);if(e===null)throw new Error(kS);return w.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const Cb={display:"none"},$9={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},AS="react-flow__node-desc",MS="react-flow__edge-desc",B9="react-flow__aria-live",P9=e=>e.ariaLiveMessage,U9=e=>e.ariaLabelConfig;function V9({rfId:e}){const n=tt(P9);return a.jsx("div",{id:`${B9}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:$9,children:n})}function q9({rfId:e,disableKeyboardA11y:n}){const s=tt(U9);return a.jsxs(a.Fragment,{children:[a.jsx("div",{id:`${AS}-${e}`,style:Cb,children:n?s["node.a11yDescription.default"]:s["node.a11yDescription.keyboardDisabled"]}),a.jsx("div",{id:`${MS}-${e}`,style:Cb,children:s["edge.a11yDescription.default"]}),!n&&a.jsx(V9,{rfId:e})]})}const _d=w.forwardRef(({position:e="top-left",children:n,className:s,style:o,...l},c)=>{const d=`${e}`.split("-");return a.jsx("div",{className:kt(["react-flow__panel",s,...d]),style:o,ref:c,...l,children:n})});_d.displayName="Panel";function F9({proOptions:e,position:n="bottom-right"}){return e?.hideAttribution?null:a.jsx(_d,{position:n,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:a.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const Y9=e=>{const n=[],s=[];for(const[,o]of e.nodeLookup)o.selected&&n.push(o.internals.userNode);for(const[,o]of e.edgeLookup)o.selected&&s.push(o);return{selectedNodes:n,selectedEdges:s}},su=e=>e.id;function G9(e,n){return bt(e.selectedNodes.map(su),n.selectedNodes.map(su))&&bt(e.selectedEdges.map(su),n.selectedEdges.map(su))}function X9({onSelectionChange:e}){const n=yt(),{selectedNodes:s,selectedEdges:o}=tt(Y9,G9);return w.useEffect(()=>{const l={nodes:s,edges:o};e?.(l),n.getState().onSelectionChangeHandlers.forEach(c=>c(l))},[s,o,e]),null}const Z9=e=>!!e.onSelectionChangeHandlers;function W9({onSelectionChange:e}){const n=tt(Z9);return e||n?a.jsx(X9,{onSelectionChange:e}):null}const TS=[0,0],K9={x:0,y:0,zoom:1},Q9=["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"],kb=[...Q9,"rfId"],J9=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}),Ab={translateExtent:ol,nodeOrigin:TS,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1",paneClickDistance:0};function ez(e){const{setNodes:n,setEdges:s,setMinZoom:o,setMaxZoom:l,setTranslateExtent:c,setNodeExtent:d,reset:f,setDefaultNodesAndEdges:m,setPaneClickDistance:p}=tt(J9,bt),g=yt();w.useEffect(()=>(m(e.defaultNodes,e.defaultEdges),()=>{v.current=Ab,f()}),[]);const v=w.useRef(Ab);return w.useEffect(()=>{for(const y of kb){const b=e[y],S=v.current[y];b!==S&&(typeof e[y]>"u"||(y==="nodes"?n(b):y==="edges"?s(b):y==="minZoom"?o(b):y==="maxZoom"?l(b):y==="translateExtent"?c(b):y==="nodeExtent"?d(b):y==="paneClickDistance"?p(b):y==="ariaLabelConfig"?g.setState({ariaLabelConfig:L8(b)}):y==="fitView"?g.setState({fitViewQueued:b}):y==="fitViewOptions"?g.setState({fitViewOptions:b}):g.setState({[y]:b})))}v.current=e},kb.map(y=>e[y])),null}function Mb(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function tz(e){const[n,s]=w.useState(e==="system"?null:e);return w.useEffect(()=>{if(e!=="system"){s(e);return}const o=Mb(),l=()=>s(o?.matches?"dark":"light");return l(),o?.addEventListener("change",l),()=>{o?.removeEventListener("change",l)}},[e]),n!==null?n:Mb()?.matches?"dark":"light"}const Tb=typeof document<"u"?document:null;function ul(e=null,n={target:Tb,actInsideInputWithModifier:!0}){const[s,o]=w.useState(!1),l=w.useRef(!1),c=w.useRef(new Set([])),[d,f]=w.useMemo(()=>{if(e!==null){const p=(Array.isArray(e)?e:[e]).filter(v=>typeof v=="string").map(v=>v.replace("+",`
`).replace(`

`,`
+`).split(`
`)),g=p.reduce((v,y)=>v.concat(...y),[]);return[p,g]}return[[],[]]},[e]);return w.useEffect(()=>{const m=n?.target??Tb,p=n?.actInsideInputWithModifier??!0;if(e!==null){const g=b=>{if(l.current=b.ctrlKey||b.metaKey||b.shiftKey||b.altKey,(!l.current||l.current&&!p)&&dS(b))return!1;const N=Db(b.code,f);if(c.current.add(b[N]),Rb(d,c.current,!1)){const _=b.composedPath?.()?.[0]||b.target,E=_?.nodeName==="BUTTON"||_?.nodeName==="A";n.preventDefault!==!1&&(l.current||!E)&&b.preventDefault(),o(!0)}},v=b=>{const S=Db(b.code,f);Rb(d,c.current,!0)?(o(!1),c.current.clear()):c.current.delete(b[S]),b.key==="Meta"&&c.current.clear(),l.current=!1},y=()=>{c.current.clear(),o(!1)};return m?.addEventListener("keydown",g),m?.addEventListener("keyup",v),window.addEventListener("blur",y),window.addEventListener("contextmenu",y),()=>{m?.removeEventListener("keydown",g),m?.removeEventListener("keyup",v),window.removeEventListener("blur",y),window.removeEventListener("contextmenu",y)}}},[e,o]),s}function Rb(e,n,s){return e.filter(o=>s||o.length===n.size).some(o=>o.every(l=>n.has(l)))}function Db(e,n){return n.includes(e)?"code":"key"}const nz=()=>{const e=yt();return w.useMemo(()=>({zoomIn:n=>{const{panZoom:s}=e.getState();return s?s.scaleBy(1.2,{duration:n?.duration}):Promise.resolve(!1)},zoomOut:n=>{const{panZoom:s}=e.getState();return s?s.scaleBy(1/1.2,{duration:n?.duration}):Promise.resolve(!1)},zoomTo:(n,s)=>{const{panZoom:o}=e.getState();return o?o.scaleTo(n,{duration:s?.duration}):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(n,s)=>{const{transform:[o,l,c],panZoom:d}=e.getState();return d?(await d.setViewport({x:n.x??o,y:n.y??l,zoom:n.zoom??c},s),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[n,s,o]=e.getState().transform;return{x:n,y:s,zoom:o}},setCenter:async(n,s,o)=>e.getState().setCenter(n,s,o),fitBounds:async(n,s)=>{const{width:o,height:l,minZoom:c,maxZoom:d,panZoom:f}=e.getState(),m=ug(n,o,l,c,d,s?.padding??.1);return f?(await f.setViewport(m,{duration:s?.duration,ease:s?.ease,interpolate:s?.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(n,s={})=>{const{transform:o,snapGrid:l,snapToGrid:c,domNode:d}=e.getState();if(!d)return n;const{x:f,y:m}=d.getBoundingClientRect(),p={x:n.x-f,y:n.y-m},g=s.snapGrid??l,v=s.snapToGrid??c;return jl(p,o,v,g)},flowToScreenPosition:n=>{const{transform:s,domNode:o}=e.getState();if(!o)return n;const{x:l,y:c}=o.getBoundingClientRect(),d=Uu(n,s);return{x:d.x+l,y:d.y+c}}}),[])};function RS(e,n){const s=[],o=new Map,l=[];for(const c of e)if(c.type==="add"){l.push(c);continue}else if(c.type==="remove"||c.type==="replace")o.set(c.id,[c]);else{const d=o.get(c.id);d?d.push(c):o.set(c.id,[c])}for(const c of n){const d=o.get(c.id);if(!d){s.push(c);continue}if(d[0].type==="remove")continue;if(d[0].type==="replace"){s.push({...d[0].item});continue}const f={...c};for(const m of d)rz(m,f);s.push(f)}return l.length&&l.forEach(c=>{c.index!==void 0?s.splice(c.index,0,{...c.item}):s.push({...c.item})}),s}function rz(e,n){switch(e.type){case"select":{n.selected=e.selected;break}case"position":{typeof e.position<"u"&&(n.position=e.position),typeof e.dragging<"u"&&(n.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(n.measured??={},n.measured.width=e.dimensions.width,n.measured.height=e.dimensions.height,e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(n.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(n.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(n.resizing=e.resizing);break}}}function DS(e,n){return RS(e,n)}function OS(e,n){return RS(e,n)}function Ks(e,n){return{id:e,type:"select",selected:n}}function oa(e,n=new Set,s=!1){const o=[];for(const[l,c]of e){const d=n.has(l);!(c.selected===void 0&&!d)&&c.selected!==d&&(s&&(c.selected=d),o.push(Ks(c.id,d)))}return o}function Ob({items:e=[],lookup:n}){const s=[],o=new Map(e.map(l=>[l.id,l]));for(const[l,c]of e.entries()){const d=n.get(c.id),f=d?.internals?.userNode??d;f!==void 0&&f!==c&&s.push({id:c.id,item:c,type:"replace"}),f===void 0&&s.push({item:c,type:"add",index:l})}for(const[l]of n)o.get(l)===void 0&&s.push({id:l,type:"remove"});return s}function zb(e){return{id:e.id,type:"remove"}}const Ib=e=>C8(e),sz=e=>rS(e);function zS(e){return w.forwardRef(e)}const oz=typeof window<"u"?w.useLayoutEffect:w.useEffect;function Lb(e){const[n,s]=w.useState(BigInt(0)),[o]=w.useState(()=>az(()=>s(l=>l+BigInt(1))));return oz(()=>{const l=o.get();l.length&&(e(l),o.reset())},[n]),o}function az(e){let n=[];return{get:()=>n,reset:()=>{n=[]},push:s=>{n.push(s),e()}}}const IS=w.createContext(null);function iz({children:e}){const n=yt(),s=w.useCallback(f=>{const{nodes:m=[],setNodes:p,hasDefaultNodes:g,onNodesChange:v,nodeLookup:y,fitViewQueued:b}=n.getState();let S=m;for(const _ of f)S=typeof _=="function"?_(S):_;const N=Ob({items:S,lookup:y});g&&p(S),N.length>0?v?.(N):b&&window.requestAnimationFrame(()=>{const{fitViewQueued:_,nodes:E,setNodes:M}=n.getState();_&&M(E)})},[]),o=Lb(s),l=w.useCallback(f=>{const{edges:m=[],setEdges:p,hasDefaultEdges:g,onEdgesChange:v,edgeLookup:y}=n.getState();let b=m;for(const S of f)b=typeof S=="function"?S(b):S;g?p(b):v&&v(Ob({items:b,lookup:y}))},[]),c=Lb(l),d=w.useMemo(()=>({nodeQueue:o,edgeQueue:c}),[]);return a.jsx(IS.Provider,{value:d,children:e})}function lz(){const e=w.useContext(IS);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const cz=e=>!!e.panZoom;function Aa(){const e=nz(),n=yt(),s=lz(),o=tt(cz),l=w.useMemo(()=>{const c=v=>n.getState().nodeLookup.get(v),d=v=>{s.nodeQueue.push(v)},f=v=>{s.edgeQueue.push(v)},m=v=>{const{nodeLookup:y,nodeOrigin:b}=n.getState(),S=Ib(v)?v:y.get(v.id),N=S.parentId?cS(S.position,S.measured,S.parentId,y,b):S.position,_={...S,position:N,width:S.measured?.width??S.width,height:S.measured?.height??S.height};return ya(_)},p=(v,y,b={replace:!1})=>{d(S=>S.map(N=>{if(N.id===v){const _=typeof y=="function"?y(N):y;return b.replace&&Ib(_)?_:{...N,..._}}return N}))},g=(v,y,b={replace:!1})=>{f(S=>S.map(N=>{if(N.id===v){const _=typeof y=="function"?y(N):y;return b.replace&&sz(_)?_:{...N,..._}}return N}))};return{getNodes:()=>n.getState().nodes.map(v=>({...v})),getNode:v=>c(v)?.internals.userNode,getInternalNode:c,getEdges:()=>{const{edges:v=[]}=n.getState();return v.map(y=>({...y}))},getEdge:v=>n.getState().edgeLookup.get(v),setNodes:d,setEdges:f,addNodes:v=>{const y=Array.isArray(v)?v:[v];s.nodeQueue.push(b=>[...b,...y])},addEdges:v=>{const y=Array.isArray(v)?v:[v];s.edgeQueue.push(b=>[...b,...y])},toObject:()=>{const{nodes:v=[],edges:y=[],transform:b}=n.getState(),[S,N,_]=b;return{nodes:v.map(E=>({...E})),edges:y.map(E=>({...E})),viewport:{x:S,y:N,zoom:_}}},deleteElements:async({nodes:v=[],edges:y=[]})=>{const{nodes:b,edges:S,onNodesDelete:N,onEdgesDelete:_,triggerNodeChanges:E,triggerEdgeChanges:M,onDelete:j,onBeforeDelete:k}=n.getState(),{nodes:R,edges:D}=await R8({nodesToRemove:v,edgesToRemove:y,nodes:b,edges:S,onBeforeDelete:k}),z=D.length>0,H=R.length>0;if(z){const U=D.map(zb);_?.(D),M(U)}if(H){const U=R.map(zb);N?.(R),E(U)}return(H||z)&&j?.({nodes:R,edges:D}),{deletedNodes:R,deletedEdges:D}},getIntersectingNodes:(v,y=!0,b)=>{const S=cb(v),N=S?v:m(v),_=b!==void 0;return N?(b||n.getState().nodes).filter(E=>{const M=n.getState().nodeLookup.get(E.id);if(M&&!S&&(E.id===v.id||!M.internals.positionAbsolute))return!1;const j=ya(_?E:M),k=il(j,N);return y&&k>0||k>=j.width*j.height||k>=N.width*N.height}):[]},isNodeIntersecting:(v,y,b=!0)=>{const N=cb(v)?v:m(v);if(!N)return!1;const _=il(N,y);return b&&_>0||_>=N.width*N.height},updateNode:p,updateNodeData:(v,y,b={replace:!1})=>{p(v,S=>{const N=typeof y=="function"?y(S):y;return b.replace?{...S,data:N}:{...S,data:{...S.data,...N}}},b)},updateEdge:g,updateEdgeData:(v,y,b={replace:!1})=>{g(v,S=>{const N=typeof y=="function"?y(S):y;return b.replace?{...S,data:N}:{...S,data:{...S.data,...N}}},b)},getNodesBounds:v=>{const{nodeLookup:y,nodeOrigin:b}=n.getState();return k8(v,{nodeLookup:y,nodeOrigin:b})},getHandleConnections:({type:v,id:y,nodeId:b})=>Array.from(n.getState().connectionLookup.get(`${b}-${v}${y?`-${y}`:""}`)?.values()??[]),getNodeConnections:({type:v,handleId:y,nodeId:b})=>Array.from(n.getState().connectionLookup.get(`${b}${v?y?`-${v}-${y}`:`-${v}`:""}`)?.values()??[]),fitView:async v=>{const y=n.getState().fitViewResolver??I8();return n.setState({fitViewQueued:!0,fitViewOptions:v,fitViewResolver:y}),s.nodeQueue.push(b=>[...b]),y.promise}}},[]);return w.useMemo(()=>({...l,...e,viewportInitialized:o}),[o])}const Hb=e=>e.selected,uz=typeof window<"u"?window:void 0;function dz({deleteKeyCode:e,multiSelectionKeyCode:n}){const s=yt(),{deleteElements:o}=Aa(),l=ul(e,{actInsideInputWithModifier:!1}),c=ul(n,{target:uz});w.useEffect(()=>{if(l){const{edges:d,nodes:f}=s.getState();o({nodes:f.filter(Hb),edges:d.filter(Hb)}),s.setState({nodesSelectionActive:!1})}},[l]),w.useEffect(()=>{s.setState({multiSelectionActive:c})},[c])}function fz(e){const n=yt();w.useEffect(()=>{const s=()=>{if(!e.current)return!1;const o=dg(e.current);(o.height===0||o.width===0)&&n.getState().onError?.("004",ar.error004()),n.setState({width:o.width||500,height:o.height||500})};if(e.current){s(),window.addEventListener("resize",s);const o=new ResizeObserver(()=>s());return o.observe(e.current),()=>{window.removeEventListener("resize",s),o&&e.current&&o.unobserve(e.current)}}},[])}const Ed={position:"absolute",width:"100%",height:"100%",top:0,left:0},mz=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib});function hz({onPaneContextMenu:e,zoomOnScroll:n=!0,zoomOnPinch:s=!0,panOnScroll:o=!1,panOnScrollSpeed:l=.5,panOnScrollMode:c=ro.Free,zoomOnDoubleClick:d=!0,panOnDrag:f=!0,defaultViewport:m,translateExtent:p,minZoom:g,maxZoom:v,zoomActivationKeyCode:y,preventScrolling:b=!0,children:S,noWheelClassName:N,noPanClassName:_,onViewportChange:E,isControlledViewport:M,paneClickDistance:j}){const k=yt(),R=w.useRef(null),{userSelectionActive:D,lib:z}=tt(mz,bt),H=ul(y),U=w.useRef();fz(R);const F=w.useCallback(K=>{E?.({x:K[0],y:K[1],zoom:K[2]}),M||k.setState({transform:K})},[E,M]);return w.useEffect(()=>{if(R.current){U.current=y9({domNode:R.current,minZoom:g,maxZoom:v,translateExtent:p,viewport:m,paneClickDistance:j,onDraggingChange:L=>k.setState({paneDragging:L}),onPanZoomStart:(L,V)=>{const{onViewportChangeStart:A,onMoveStart:I}=k.getState();I?.(L,V),A?.(V)},onPanZoom:(L,V)=>{const{onViewportChange:A,onMove:I}=k.getState();I?.(L,V),A?.(V)},onPanZoomEnd:(L,V)=>{const{onViewportChangeEnd:A,onMoveEnd:I}=k.getState();I?.(L,V),A?.(V)}});const{x:K,y:G,zoom:ne}=U.current.getViewport();return k.setState({panZoom:U.current,transform:[K,G,ne],domNode:R.current.closest(".react-flow")}),()=>{U.current?.destroy()}}},[]),w.useEffect(()=>{U.current?.update({onPaneContextMenu:e,zoomOnScroll:n,zoomOnPinch:s,panOnScroll:o,panOnScrollSpeed:l,panOnScrollMode:c,zoomOnDoubleClick:d,panOnDrag:f,zoomActivationKeyPressed:H,preventScrolling:b,noPanClassName:_,userSelectionActive:D,noWheelClassName:N,lib:z,onTransformChange:F})},[e,n,s,o,l,c,d,f,H,b,_,D,N,z,F]),a.jsx("div",{className:"react-flow__renderer",ref:R,style:Ed,children:S})}const pz=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function gz(){const{userSelectionActive:e,userSelectionRect:n}=tt(pz,bt);return e&&n?a.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:n.width,height:n.height,transform:`translate(${n.x}px, ${n.y}px)`}}):null}const wh=(e,n)=>s=>{s.target===n.current&&e?.(s)},xz=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function yz({isSelecting:e,selectionKeyPressed:n,selectionMode:s=al.Full,panOnDrag:o,selectionOnDrag:l,onSelectionStart:c,onSelectionEnd:d,onPaneClick:f,onPaneContextMenu:m,onPaneScroll:p,onPaneMouseEnter:g,onPaneMouseMove:v,onPaneMouseLeave:y,children:b}){const S=yt(),{userSelectionActive:N,elementsSelectable:_,dragging:E,connectionInProgress:M}=tt(xz,bt),j=_&&(e||N),k=w.useRef(null),R=w.useRef(),D=w.useRef(new Set),z=w.useRef(new Set),H=w.useRef(!1),U=w.useRef(!1),F=I=>{if(H.current||M){H.current=!1;return}f?.(I),S.getState().resetSelectedElements(),S.setState({nodesSelectionActive:!1})},K=I=>{if(Array.isArray(o)&&o?.includes(2)){I.preventDefault();return}m?.(I)},G=p?I=>p(I):void 0,ne=I=>{const{resetSelectedElements:$,domNode:P}=S.getState();if(R.current=P?.getBoundingClientRect(),!_||!e||I.button!==0||I.target!==k.current||!R.current)return;I.target?.setPointerCapture?.(I.pointerId),U.current=!0,H.current=!1;const{x:T,y:B}=tr(I.nativeEvent,R.current);$(),S.setState({userSelectionRect:{width:0,height:0,startX:T,startY:B,x:T,y:B}}),c?.(I)},L=I=>{const{userSelectionRect:$,transform:P,nodeLookup:T,edgeLookup:B,connectionLookup:W,triggerNodeChanges:Z,triggerEdgeChanges:re,defaultEdgeOptions:de}=S.getState();if(!R.current||!$)return;H.current=!0;const{x:ge,y:J}=tr(I.nativeEvent,R.current),{startX:le,startY:ve}=$,Ne={startX:le,startY:ve,x:ge<le?ge:le,y:J<ve?J:ve,width:Math.abs(ge-le),height:Math.abs(J-ve)},_e=D.current,be=z.current;D.current=new Set(cg(T,Ne,P,s===al.Partial,!0).map(te=>te.id)),z.current=new Set;const Re=de?.selectable??!0;for(const te of D.current){const Ee=W.get(te);if(Ee)for(const{edgeId:Ve}of Ee.values()){const Qe=B.get(Ve);Qe&&(Qe.selectable??Re)&&z.current.add(Ve)}}if(!ub(_e,D.current)){const te=oa(T,D.current,!0);Z(te)}if(!ub(be,z.current)){const te=oa(B,z.current);re(te)}S.setState({userSelectionRect:Ne,userSelectionActive:!0,nodesSelectionActive:!1})},V=I=>{if(I.button!==0||!U.current)return;I.target?.releasePointerCapture?.(I.pointerId);const{userSelectionRect:$}=S.getState();!N&&$&&I.target===k.current&&F?.(I),S.setState({userSelectionActive:!1,userSelectionRect:null,nodesSelectionActive:D.current.size>0}),d?.(I),(n||l)&&(H.current=!1),U.current=!1},A=o===!0||Array.isArray(o)&&o.includes(0);return a.jsxs("div",{className:kt(["react-flow__pane",{draggable:A,dragging:E,selection:e}]),onClick:j?void 0:wh(F,k),onContextMenu:wh(K,k),onWheel:wh(G,k),onPointerEnter:j?void 0:g,onPointerDown:j?ne:v,onPointerMove:j?L:v,onPointerUp:j?V:void 0,onPointerLeave:y,ref:k,style:Ed,children:[b,a.jsx(gz,{})]})}function ip({id:e,store:n,unselect:s=!1,nodeRef:o}){const{addSelectedNodes:l,unselectNodesAndEdges:c,multiSelectionActive:d,nodeLookup:f,onError:m}=n.getState(),p=f.get(e);if(!p){m?.("012",ar.error012(e));return}n.setState({nodesSelectionActive:!1}),p.selected?(s||p.selected&&d)&&(c({nodes:[p],edges:[]}),requestAnimationFrame(()=>o?.current?.blur())):l([e])}function LS({nodeRef:e,disabled:n=!1,noDragClassName:s,handleSelector:o,nodeId:l,isSelectable:c,nodeClickDistance:d}){const f=yt(),[m,p]=w.useState(!1),g=w.useRef();return w.useEffect(()=>{g.current=r9({getStoreItems:()=>f.getState(),onNodeMouseDown:v=>{ip({id:v,store:f,nodeRef:e})},onDragStart:()=>{p(!0)},onDragStop:()=>{p(!1)}})},[]),w.useEffect(()=>{if(n)g.current?.destroy();else if(e.current)return g.current?.update({noDragClassName:s,handleSelector:o,domNode:e.current,isSelectable:c,nodeId:l,nodeClickDistance:d}),()=>{g.current?.destroy()}},[s,o,n,c,e,l]),m}const vz=e=>n=>n.selected&&(n.draggable||e&&typeof n.draggable>"u");function HS(){const e=yt();return w.useCallback(s=>{const{nodeExtent:o,snapToGrid:l,snapGrid:c,nodesDraggable:d,onError:f,updateNodePositions:m,nodeLookup:p,nodeOrigin:g}=e.getState(),v=new Map,y=vz(d),b=l?c[0]:5,S=l?c[1]:5,N=s.direction.x*b*s.factor,_=s.direction.y*S*s.factor;for(const[,E]of p){if(!y(E))continue;let M={x:E.internals.positionAbsolute.x+N,y:E.internals.positionAbsolute.y+_};l&&(M=Sl(M,c));const{position:j,positionAbsolute:k}=sS({nodeId:E.id,nextPosition:M,nodeLookup:p,nodeExtent:o,nodeOrigin:g,onError:f});E.position=j,E.internals.positionAbsolute=k,v.set(E.id,E)}m(v)},[])}const gg=w.createContext(null),bz=gg.Provider;gg.Consumer;const $S=()=>w.useContext(gg),wz=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),Nz=(e,n,s)=>o=>{const{connectionClickStartHandle:l,connectionMode:c,connection:d}=o,{fromHandle:f,toHandle:m,isValid:p}=d,g=m?.nodeId===e&&m?.id===n&&m?.type===s;return{connectingFrom:f?.nodeId===e&&f?.id===n&&f?.type===s,connectingTo:g,clickConnecting:l?.nodeId===e&&l?.id===n&&l?.type===s,isPossibleEndHandle:c===ga.Strict?f?.type!==s:e!==f?.nodeId||n!==f?.id,connectionInProcess:!!f,clickConnectionInProcess:!!l,valid:g&&p}};function Sz({type:e="source",position:n=Ie.Top,isValidConnection:s,isConnectable:o=!0,isConnectableStart:l=!0,isConnectableEnd:c=!0,id:d,onConnect:f,children:m,className:p,onMouseDown:g,onTouchStart:v,...y},b){const S=d||null,N=e==="target",_=yt(),E=$S(),{connectOnClick:M,noPanClassName:j,rfId:k}=tt(wz,bt),{connectingFrom:R,connectingTo:D,clickConnecting:z,isPossibleEndHandle:H,connectionInProcess:U,clickConnectionInProcess:F,valid:K}=tt(Nz(E,S,e),bt);E||_.getState().onError?.("010",ar.error010());const G=V=>{const{defaultEdgeOptions:A,onConnect:I,hasDefaultEdges:$}=_.getState(),P={...A,...V};if($){const{edges:T,setEdges:B}=_.getState();B(V8(P,T))}I?.(P),f?.(P)},ne=V=>{if(!E)return;const A=fS(V.nativeEvent);if(l&&(A&&V.button===0||!A)){const I=_.getState();ap.onPointerDown(V.nativeEvent,{handleDomNode:V.currentTarget,autoPanOnConnect:I.autoPanOnConnect,connectionMode:I.connectionMode,connectionRadius:I.connectionRadius,domNode:I.domNode,nodeLookup:I.nodeLookup,lib:I.lib,isTarget:N,handleId:S,nodeId:E,flowId:I.rfId,panBy:I.panBy,cancelConnection:I.cancelConnection,onConnectStart:I.onConnectStart,onConnectEnd:I.onConnectEnd,updateConnection:I.updateConnection,onConnect:G,isValidConnection:s||I.isValidConnection,getTransform:()=>_.getState().transform,getFromHandle:()=>_.getState().connection.fromHandle,autoPanSpeed:I.autoPanSpeed,dragThreshold:I.connectionDragThreshold})}A?g?.(V):v?.(V)},L=V=>{const{onClickConnectStart:A,onClickConnectEnd:I,connectionClickStartHandle:$,connectionMode:P,isValidConnection:T,lib:B,rfId:W,nodeLookup:Z,connection:re}=_.getState();if(!E||!$&&!l)return;if(!$){A?.(V.nativeEvent,{nodeId:E,handleId:S,handleType:e}),_.setState({connectionClickStartHandle:{nodeId:E,type:e,id:S}});return}const de=uS(V.target),ge=s||T,{connection:J,isValid:le}=ap.isValid(V.nativeEvent,{handle:{nodeId:E,id:S,type:e},connectionMode:P,fromNodeId:$.nodeId,fromHandleId:$.id||null,fromType:$.type,isValidConnection:ge,flowId:W,doc:de,lib:B,nodeLookup:Z});le&&J&&G(J);const ve=structuredClone(re);delete ve.inProgress,ve.toPosition=ve.toHandle?ve.toHandle.position:null,I?.(V,ve),_.setState({connectionClickStartHandle:null})};return a.jsx("div",{"data-handleid":S,"data-nodeid":E,"data-handlepos":n,"data-id":`${k}-${E}-${S}-${e}`,className:kt(["react-flow__handle",`react-flow__handle-${n}`,"nodrag",j,p,{source:!N,target:N,connectable:o,connectablestart:l,connectableend:c,clickconnecting:z,connectingfrom:R,connectingto:D,valid:K,connectionindicator:o&&(!U||H)&&(U||F?c:l)}]),onMouseDown:ne,onTouchStart:ne,onClick:M?L:void 0,ref:b,...y,children:m})}const wa=w.memo(zS(Sz));function jz({data:e,isConnectable:n,sourcePosition:s=Ie.Bottom}){return a.jsxs(a.Fragment,{children:[e?.label,a.jsx(wa,{type:"source",position:s,isConnectable:n})]})}function _z({data:e,isConnectable:n,targetPosition:s=Ie.Top,sourcePosition:o=Ie.Bottom}){return a.jsxs(a.Fragment,{children:[a.jsx(wa,{type:"target",position:s,isConnectable:n}),e?.label,a.jsx(wa,{type:"source",position:o,isConnectable:n})]})}function Ez(){return null}function Cz({data:e,isConnectable:n,targetPosition:s=Ie.Top}){return a.jsxs(a.Fragment,{children:[a.jsx(wa,{type:"target",position:s,isConnectable:n}),e?.label]})}const Vu={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},$b={input:jz,default:_z,output:Cz,group:Ez};function kz(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 Az=e=>{const{width:n,height:s,x:o,y:l}=Nl(e.nodeLookup,{filter:c=>!!c.selected});return{width:$n(n)?n:null,height:$n(s)?s:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${o}px,${l}px)`}};function Mz({onSelectionContextMenu:e,noPanClassName:n,disableKeyboardA11y:s}){const o=yt(),{width:l,height:c,transformString:d,userSelectionActive:f}=tt(Az,bt),m=HS(),p=w.useRef(null);if(w.useEffect(()=>{s||p.current?.focus({preventScroll:!0})},[s]),LS({nodeRef:p}),f||!l||!c)return null;const g=e?y=>{const b=o.getState().nodes.filter(S=>S.selected);e(y,b)}:void 0,v=y=>{Object.prototype.hasOwnProperty.call(Vu,y.key)&&(y.preventDefault(),m({direction:Vu[y.key],factor:y.shiftKey?4:1}))};return a.jsx("div",{className:kt(["react-flow__nodesselection","react-flow__container",n]),style:{transform:d},children:a.jsx("div",{ref:p,className:"react-flow__nodesselection-rect",onContextMenu:g,tabIndex:s?void 0:-1,onKeyDown:s?void 0:v,style:{width:l,height:c}})})}const Bb=typeof window<"u"?window:void 0,Tz=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function BS({children:e,onPaneClick:n,onPaneMouseEnter:s,onPaneMouseMove:o,onPaneMouseLeave:l,onPaneContextMenu:c,onPaneScroll:d,paneClickDistance:f,deleteKeyCode:m,selectionKeyCode:p,selectionOnDrag:g,selectionMode:v,onSelectionStart:y,onSelectionEnd:b,multiSelectionKeyCode:S,panActivationKeyCode:N,zoomActivationKeyCode:_,elementsSelectable:E,zoomOnScroll:M,zoomOnPinch:j,panOnScroll:k,panOnScrollSpeed:R,panOnScrollMode:D,zoomOnDoubleClick:z,panOnDrag:H,defaultViewport:U,translateExtent:F,minZoom:K,maxZoom:G,preventScrolling:ne,onSelectionContextMenu:L,noWheelClassName:V,noPanClassName:A,disableKeyboardA11y:I,onViewportChange:$,isControlledViewport:P}){const{nodesSelectionActive:T,userSelectionActive:B}=tt(Tz),W=ul(p,{target:Bb}),Z=ul(N,{target:Bb}),re=Z||H,de=Z||k,ge=g&&re!==!0,J=W||B||ge;return dz({deleteKeyCode:m,multiSelectionKeyCode:S}),a.jsx(hz,{onPaneContextMenu:c,elementsSelectable:E,zoomOnScroll:M,zoomOnPinch:j,panOnScroll:de,panOnScrollSpeed:R,panOnScrollMode:D,zoomOnDoubleClick:z,panOnDrag:!W&&re,defaultViewport:U,translateExtent:F,minZoom:K,maxZoom:G,zoomActivationKeyCode:_,preventScrolling:ne,noWheelClassName:V,noPanClassName:A,onViewportChange:$,isControlledViewport:P,paneClickDistance:f,children:a.jsxs(yz,{onSelectionStart:y,onSelectionEnd:b,onPaneClick:n,onPaneMouseEnter:s,onPaneMouseMove:o,onPaneMouseLeave:l,onPaneContextMenu:c,onPaneScroll:d,panOnDrag:re,isSelecting:!!J,selectionMode:v,selectionKeyPressed:W,selectionOnDrag:ge,children:[e,T&&a.jsx(Mz,{onSelectionContextMenu:L,noPanClassName:A,disableKeyboardA11y:I})]})})}BS.displayName="FlowRenderer";const Rz=w.memo(BS),Dz=e=>n=>e?cg(n.nodeLookup,{x:0,y:0,width:n.width,height:n.height},n.transform,!0).map(s=>s.id):Array.from(n.nodeLookup.keys());function Oz(e){return tt(w.useCallback(Dz(e),[e]),bt)}const zz=e=>e.updateNodeInternals;function Iz(){const e=tt(zz),[n]=w.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(s=>{const o=new Map;s.forEach(l=>{const c=l.target.getAttribute("data-id");o.set(c,{id:c,nodeElement:l.target,force:!0})}),e(o)}));return w.useEffect(()=>()=>{n?.disconnect()},[n]),n}function Lz({node:e,nodeType:n,hasDimensions:s,resizeObserver:o}){const l=yt(),c=w.useRef(null),d=w.useRef(null),f=w.useRef(e.sourcePosition),m=w.useRef(e.targetPosition),p=w.useRef(n),g=s&&!!e.internals.handleBounds;return w.useEffect(()=>{c.current&&!e.hidden&&(!g||d.current!==c.current)&&(d.current&&o?.unobserve(d.current),o?.observe(c.current),d.current=c.current)},[g,e.hidden]),w.useEffect(()=>()=>{d.current&&(o?.unobserve(d.current),d.current=null)},[]),w.useEffect(()=>{if(c.current){const v=p.current!==n,y=f.current!==e.sourcePosition,b=m.current!==e.targetPosition;(v||y||b)&&(p.current=n,f.current=e.sourcePosition,m.current=e.targetPosition,l.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:c.current,force:!0}]])))}},[e.id,n,e.sourcePosition,e.targetPosition]),c}function Hz({id:e,onClick:n,onMouseEnter:s,onMouseMove:o,onMouseLeave:l,onContextMenu:c,onDoubleClick:d,nodesDraggable:f,elementsSelectable:m,nodesConnectable:p,nodesFocusable:g,resizeObserver:v,noDragClassName:y,noPanClassName:b,disableKeyboardA11y:S,rfId:N,nodeTypes:_,nodeClickDistance:E,onError:M}){const{node:j,internals:k,isParent:R}=tt(le=>{const ve=le.nodeLookup.get(e),Ne=le.parentLookup.has(e);return{node:ve,internals:ve.internals,isParent:Ne}},bt);let D=j.type||"default",z=_?.[D]||$b[D];z===void 0&&(M?.("003",ar.error003(D)),D="default",z=_?.default||$b.default);const H=!!(j.draggable||f&&typeof j.draggable>"u"),U=!!(j.selectable||m&&typeof j.selectable>"u"),F=!!(j.connectable||p&&typeof j.connectable>"u"),K=!!(j.focusable||g&&typeof j.focusable>"u"),G=yt(),ne=lS(j),L=Lz({node:j,nodeType:D,hasDimensions:ne,resizeObserver:v}),V=LS({nodeRef:L,disabled:j.hidden||!H,noDragClassName:y,handleSelector:j.dragHandle,nodeId:e,isSelectable:U,nodeClickDistance:E}),A=HS();if(j.hidden)return null;const I=Hr(j),$=kz(j),P=U||H||n||s||o||l,T=s?le=>s(le,{...k.userNode}):void 0,B=o?le=>o(le,{...k.userNode}):void 0,W=l?le=>l(le,{...k.userNode}):void 0,Z=c?le=>c(le,{...k.userNode}):void 0,re=d?le=>d(le,{...k.userNode}):void 0,de=le=>{const{selectNodesOnDrag:ve,nodeDragThreshold:Ne}=G.getState();U&&(!ve||!H||Ne>0)&&ip({id:e,store:G,nodeRef:L}),n&&n(le,{...k.userNode})},ge=le=>{if(!(dS(le.nativeEvent)||S)){if(JN.includes(le.key)&&U){const ve=le.key==="Escape";ip({id:e,store:G,unselect:ve,nodeRef:L})}else if(H&&j.selected&&Object.prototype.hasOwnProperty.call(Vu,le.key)){le.preventDefault();const{ariaLabelConfig:ve}=G.getState();G.setState({ariaLiveMessage:ve["node.a11yDescription.ariaLiveMessage"]({direction:le.key.replace("Arrow","").toLowerCase(),x:~~k.positionAbsolute.x,y:~~k.positionAbsolute.y})}),A({direction:Vu[le.key],factor:le.shiftKey?4:1})}}},J=()=>{if(S||!L.current?.matches(":focus-visible"))return;const{transform:le,width:ve,height:Ne,autoPanOnNodeFocus:_e,setCenter:be}=G.getState();if(!_e)return;cg(new Map([[e,j]]),{x:0,y:0,width:ve,height:Ne},le,!0).length>0||be(j.position.x+I.width/2,j.position.y+I.height/2,{zoom:le[2]})};return a.jsx("div",{className:kt(["react-flow__node",`react-flow__node-${D}`,{[b]:H},j.className,{selected:j.selected,selectable:U,parent:R,draggable:H,dragging:V}]),ref:L,style:{zIndex:k.z,transform:`translate(${k.positionAbsolute.x}px,${k.positionAbsolute.y}px)`,pointerEvents:P?"all":"none",visibility:ne?"visible":"hidden",...j.style,...$},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:T,onMouseMove:B,onMouseLeave:W,onContextMenu:Z,onClick:de,onDoubleClick:re,onKeyDown:K?ge:void 0,tabIndex:K?0:void 0,onFocus:K?J:void 0,role:j.ariaRole??(K?"group":void 0),"aria-roledescription":"node","aria-describedby":S?void 0:`${AS}-${N}`,"aria-label":j.ariaLabel,...j.domAttributes,children:a.jsx(bz,{value:e,children:a.jsx(z,{id:e,data:j.data,type:D,positionAbsoluteX:k.positionAbsolute.x,positionAbsoluteY:k.positionAbsolute.y,selected:j.selected??!1,selectable:U,draggable:H,deletable:j.deletable??!0,isConnectable:F,sourcePosition:j.sourcePosition,targetPosition:j.targetPosition,dragging:V,dragHandle:j.dragHandle,zIndex:k.z,parentId:j.parentId,...I})})})}const $z=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function PS(e){const{nodesDraggable:n,nodesConnectable:s,nodesFocusable:o,elementsSelectable:l,onError:c}=tt($z,bt),d=Oz(e.onlyRenderVisibleElements),f=Iz();return a.jsx("div",{className:"react-flow__nodes",style:Ed,children:d.map(m=>a.jsx(Hz,{id:m,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:n,nodesConnectable:s,nodesFocusable:o,elementsSelectable:l,nodeClickDistance:e.nodeClickDistance,onError:c},m))})}PS.displayName="NodeRenderer";const Bz=w.memo(PS);function Pz(e){return tt(w.useCallback(s=>{if(!e)return s.edges.map(l=>l.id);const o=[];if(s.width&&s.height)for(const l of s.edges){const c=s.nodeLookup.get(l.source),d=s.nodeLookup.get(l.target);c&&d&&B8({sourceNode:c,targetNode:d,width:s.width,height:s.height,transform:s.transform})&&o.push(l.id)}return o},[e]),bt)}const Uz=({color:e="none",strokeWidth:n=1})=>{const s={strokeWidth:n,...e&&{stroke:e}};return a.jsx("polyline",{className:"arrow",style:s,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},Vz=({color:e="none",strokeWidth:n=1})=>{const s={strokeWidth:n,...e&&{stroke:e,fill:e}};return a.jsx("polyline",{className:"arrowclosed",style:s,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},Pb={[Bu.Arrow]:Uz,[Bu.ArrowClosed]:Vz};function qz(e){const n=yt();return w.useMemo(()=>Object.prototype.hasOwnProperty.call(Pb,e)?Pb[e]:(n.getState().onError?.("009",ar.error009(e)),null),[e])}const Fz=({id:e,type:n,color:s,width:o=12.5,height:l=12.5,markerUnits:c="strokeWidth",strokeWidth:d,orient:f="auto-start-reverse"})=>{const m=qz(n);return m?a.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${o}`,markerHeight:`${l}`,viewBox:"-10 -10 20 20",markerUnits:c,orient:f,refX:"0",refY:"0",children:a.jsx(m,{color:s,strokeWidth:d})}):null},US=({defaultColor:e,rfId:n})=>{const s=tt(c=>c.edges),o=tt(c=>c.defaultEdgeOptions),l=w.useMemo(()=>X8(s,{id:n,defaultColor:e,defaultMarkerStart:o?.markerStart,defaultMarkerEnd:o?.markerEnd}),[s,o,n,e]);return l.length?a.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:a.jsx("defs",{children:l.map(c=>a.jsx(Fz,{id:c.id,type:c.type,color:c.color,width:c.width,height:c.height,markerUnits:c.markerUnits,strokeWidth:c.strokeWidth,orient:c.orient},c.id))})}):null};US.displayName="MarkerDefinitions";var Yz=w.memo(US);function VS({x:e,y:n,label:s,labelStyle:o,labelShowBg:l=!0,labelBgStyle:c,labelBgPadding:d=[2,4],labelBgBorderRadius:f=2,children:m,className:p,...g}){const[v,y]=w.useState({x:1,y:0,width:0,height:0}),b=kt(["react-flow__edge-textwrapper",p]),S=w.useRef(null);return w.useEffect(()=>{if(S.current){const N=S.current.getBBox();y({x:N.x,y:N.y,width:N.width,height:N.height})}},[s]),s?a.jsxs("g",{transform:`translate(${e-v.width/2} ${n-v.height/2})`,className:b,visibility:v.width?"visible":"hidden",...g,children:[l&&a.jsx("rect",{width:v.width+2*d[0],x:-d[0],y:-d[1],height:v.height+2*d[1],className:"react-flow__edge-textbg",style:c,rx:f,ry:f}),a.jsx("text",{className:"react-flow__edge-text",y:v.height/2,dy:"0.3em",ref:S,style:o,children:s}),m]}):null}VS.displayName="EdgeText";const Gz=w.memo(VS);function Cd({path:e,labelX:n,labelY:s,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:m,interactionWidth:p=20,...g}){return a.jsxs(a.Fragment,{children:[a.jsx("path",{...g,d:e,fill:"none",className:kt(["react-flow__edge-path",g.className])}),p?a.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:p,className:"react-flow__edge-interaction"}):null,o&&$n(n)&&$n(s)?a.jsx(Gz,{x:n,y:s,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:m}):null]})}function Ub({pos:e,x1:n,y1:s,x2:o,y2:l}){return e===Ie.Left||e===Ie.Right?[.5*(n+o),s]:[n,.5*(s+l)]}function qS({sourceX:e,sourceY:n,sourcePosition:s=Ie.Bottom,targetX:o,targetY:l,targetPosition:c=Ie.Top}){const[d,f]=Ub({pos:s,x1:e,y1:n,x2:o,y2:l}),[m,p]=Ub({pos:c,x1:o,y1:l,x2:e,y2:n}),[g,v,y,b]=mS({sourceX:e,sourceY:n,targetX:o,targetY:l,sourceControlX:d,sourceControlY:f,targetControlX:m,targetControlY:p});return[`M${e},${n} C${d},${f} ${m},${p} ${o},${l}`,g,v,y,b]}function FS(e){return w.memo(({id:n,sourceX:s,sourceY:o,targetX:l,targetY:c,sourcePosition:d,targetPosition:f,label:m,labelStyle:p,labelShowBg:g,labelBgStyle:v,labelBgPadding:y,labelBgBorderRadius:b,style:S,markerEnd:N,markerStart:_,interactionWidth:E})=>{const[M,j,k]=qS({sourceX:s,sourceY:o,sourcePosition:d,targetX:l,targetY:c,targetPosition:f}),R=e.isInternal?void 0:n;return a.jsx(Cd,{id:R,path:M,labelX:j,labelY:k,label:m,labelStyle:p,labelShowBg:g,labelBgStyle:v,labelBgPadding:y,labelBgBorderRadius:b,style:S,markerEnd:N,markerStart:_,interactionWidth:E})})}const Xz=FS({isInternal:!1}),YS=FS({isInternal:!0});Xz.displayName="SimpleBezierEdge";YS.displayName="SimpleBezierEdgeInternal";function GS(e){return w.memo(({id:n,sourceX:s,sourceY:o,targetX:l,targetY:c,label:d,labelStyle:f,labelShowBg:m,labelBgStyle:p,labelBgPadding:g,labelBgBorderRadius:v,style:y,sourcePosition:b=Ie.Bottom,targetPosition:S=Ie.Top,markerEnd:N,markerStart:_,pathOptions:E,interactionWidth:M})=>{const[j,k,R]=rp({sourceX:s,sourceY:o,sourcePosition:b,targetX:l,targetY:c,targetPosition:S,borderRadius:E?.borderRadius,offset:E?.offset,stepPosition:E?.stepPosition}),D=e.isInternal?void 0:n;return a.jsx(Cd,{id:D,path:j,labelX:k,labelY:R,label:d,labelStyle:f,labelShowBg:m,labelBgStyle:p,labelBgPadding:g,labelBgBorderRadius:v,style:y,markerEnd:N,markerStart:_,interactionWidth:M})})}const XS=GS({isInternal:!1}),ZS=GS({isInternal:!0});XS.displayName="SmoothStepEdge";ZS.displayName="SmoothStepEdgeInternal";function WS(e){return w.memo(({id:n,...s})=>{const o=e.isInternal?void 0:n;return a.jsx(XS,{...s,id:o,pathOptions:w.useMemo(()=>({borderRadius:0,offset:s.pathOptions?.offset}),[s.pathOptions?.offset])})})}const Zz=WS({isInternal:!1}),KS=WS({isInternal:!0});Zz.displayName="StepEdge";KS.displayName="StepEdgeInternal";function QS(e){return w.memo(({id:n,sourceX:s,sourceY:o,targetX:l,targetY:c,label:d,labelStyle:f,labelShowBg:m,labelBgStyle:p,labelBgPadding:g,labelBgBorderRadius:v,style:y,markerEnd:b,markerStart:S,interactionWidth:N})=>{const[_,E,M]=gS({sourceX:s,sourceY:o,targetX:l,targetY:c}),j=e.isInternal?void 0:n;return a.jsx(Cd,{id:j,path:_,labelX:E,labelY:M,label:d,labelStyle:f,labelShowBg:m,labelBgStyle:p,labelBgPadding:g,labelBgBorderRadius:v,style:y,markerEnd:b,markerStart:S,interactionWidth:N})})}const Wz=QS({isInternal:!1}),JS=QS({isInternal:!0});Wz.displayName="StraightEdge";JS.displayName="StraightEdgeInternal";function ej(e){return w.memo(({id:n,sourceX:s,sourceY:o,targetX:l,targetY:c,sourcePosition:d=Ie.Bottom,targetPosition:f=Ie.Top,label:m,labelStyle:p,labelShowBg:g,labelBgStyle:v,labelBgPadding:y,labelBgBorderRadius:b,style:S,markerEnd:N,markerStart:_,pathOptions:E,interactionWidth:M})=>{const[j,k,R]=hS({sourceX:s,sourceY:o,sourcePosition:d,targetX:l,targetY:c,targetPosition:f,curvature:E?.curvature}),D=e.isInternal?void 0:n;return a.jsx(Cd,{id:D,path:j,labelX:k,labelY:R,label:m,labelStyle:p,labelShowBg:g,labelBgStyle:v,labelBgPadding:y,labelBgBorderRadius:b,style:S,markerEnd:N,markerStart:_,interactionWidth:M})})}const Kz=ej({isInternal:!1}),tj=ej({isInternal:!0});Kz.displayName="BezierEdge";tj.displayName="BezierEdgeInternal";const Vb={default:tj,straight:JS,step:KS,smoothstep:ZS,simplebezier:YS},qb={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},Qz=(e,n,s)=>s===Ie.Left?e-n:s===Ie.Right?e+n:e,Jz=(e,n,s)=>s===Ie.Top?e-n:s===Ie.Bottom?e+n:e,Fb="react-flow__edgeupdater";function Yb({position:e,centerX:n,centerY:s,radius:o=10,onMouseDown:l,onMouseEnter:c,onMouseOut:d,type:f}){return a.jsx("circle",{onMouseDown:l,onMouseEnter:c,onMouseOut:d,className:kt([Fb,`${Fb}-${f}`]),cx:Qz(n,o,e),cy:Jz(s,o,e),r:o,stroke:"transparent",fill:"transparent"})}function e7({isReconnectable:e,reconnectRadius:n,edge:s,sourceX:o,sourceY:l,targetX:c,targetY:d,sourcePosition:f,targetPosition:m,onReconnect:p,onReconnectStart:g,onReconnectEnd:v,setReconnecting:y,setUpdateHover:b}){const S=yt(),N=(k,R)=>{if(k.button!==0)return;const{autoPanOnConnect:D,domNode:z,isValidConnection:H,connectionMode:U,connectionRadius:F,lib:K,onConnectStart:G,onConnectEnd:ne,cancelConnection:L,nodeLookup:V,rfId:A,panBy:I,updateConnection:$}=S.getState(),P=R.type==="target",T=(Z,re)=>{y(!1),v?.(Z,s,R.type,re)},B=Z=>p?.(s,Z),W=(Z,re)=>{y(!0),g?.(k,s,R.type),G?.(Z,re)};ap.onPointerDown(k.nativeEvent,{autoPanOnConnect:D,connectionMode:U,connectionRadius:F,domNode:z,handleId:R.id,nodeId:R.nodeId,nodeLookup:V,isTarget:P,edgeUpdaterType:R.type,lib:K,flowId:A,cancelConnection:L,panBy:I,isValidConnection:H,onConnect:B,onConnectStart:W,onConnectEnd:ne,onReconnectEnd:T,updateConnection:$,getTransform:()=>S.getState().transform,getFromHandle:()=>S.getState().connection.fromHandle,dragThreshold:S.getState().connectionDragThreshold,handleDomNode:k.currentTarget})},_=k=>N(k,{nodeId:s.target,id:s.targetHandle??null,type:"target"}),E=k=>N(k,{nodeId:s.source,id:s.sourceHandle??null,type:"source"}),M=()=>b(!0),j=()=>b(!1);return a.jsxs(a.Fragment,{children:[(e===!0||e==="source")&&a.jsx(Yb,{position:f,centerX:o,centerY:l,radius:n,onMouseDown:_,onMouseEnter:M,onMouseOut:j,type:"source"}),(e===!0||e==="target")&&a.jsx(Yb,{position:m,centerX:c,centerY:d,radius:n,onMouseDown:E,onMouseEnter:M,onMouseOut:j,type:"target"})]})}function t7({id:e,edgesFocusable:n,edgesReconnectable:s,elementsSelectable:o,onClick:l,onDoubleClick:c,onContextMenu:d,onMouseEnter:f,onMouseMove:m,onMouseLeave:p,reconnectRadius:g,onReconnect:v,onReconnectStart:y,onReconnectEnd:b,rfId:S,edgeTypes:N,noPanClassName:_,onError:E,disableKeyboardA11y:M}){let j=tt(be=>be.edgeLookup.get(e));const k=tt(be=>be.defaultEdgeOptions);j=k?{...k,...j}:j;let R=j.type||"default",D=N?.[R]||Vb[R];D===void 0&&(E?.("011",ar.error011(R)),R="default",D=N?.default||Vb.default);const z=!!(j.focusable||n&&typeof j.focusable>"u"),H=typeof v<"u"&&(j.reconnectable||s&&typeof j.reconnectable>"u"),U=!!(j.selectable||o&&typeof j.selectable>"u"),F=w.useRef(null),[K,G]=w.useState(!1),[ne,L]=w.useState(!1),V=yt(),{zIndex:A,sourceX:I,sourceY:$,targetX:P,targetY:T,sourcePosition:B,targetPosition:W}=tt(w.useCallback(be=>{const Re=be.nodeLookup.get(j.source),te=be.nodeLookup.get(j.target);if(!Re||!te)return{zIndex:j.zIndex,...qb};const Ee=G8({id:e,sourceNode:Re,targetNode:te,sourceHandle:j.sourceHandle||null,targetHandle:j.targetHandle||null,connectionMode:be.connectionMode,onError:E});return{zIndex:$8({selected:j.selected,zIndex:j.zIndex,sourceNode:Re,targetNode:te,elevateOnSelect:be.elevateEdgesOnSelect}),...Ee||qb}},[j.source,j.target,j.sourceHandle,j.targetHandle,j.selected,j.zIndex]),bt),Z=w.useMemo(()=>j.markerStart?`url('#${sp(j.markerStart,S)}')`:void 0,[j.markerStart,S]),re=w.useMemo(()=>j.markerEnd?`url('#${sp(j.markerEnd,S)}')`:void 0,[j.markerEnd,S]);if(j.hidden||I===null||$===null||P===null||T===null)return null;const de=be=>{const{addSelectedEdges:Re,unselectNodesAndEdges:te,multiSelectionActive:Ee}=V.getState();U&&(V.setState({nodesSelectionActive:!1}),j.selected&&Ee?(te({nodes:[],edges:[j]}),F.current?.blur()):Re([e])),l&&l(be,j)},ge=c?be=>{c(be,{...j})}:void 0,J=d?be=>{d(be,{...j})}:void 0,le=f?be=>{f(be,{...j})}:void 0,ve=m?be=>{m(be,{...j})}:void 0,Ne=p?be=>{p(be,{...j})}:void 0,_e=be=>{if(!M&&JN.includes(be.key)&&U){const{unselectNodesAndEdges:Re,addSelectedEdges:te}=V.getState();be.key==="Escape"?(F.current?.blur(),Re({edges:[j]})):te([e])}};return a.jsx("svg",{style:{zIndex:A},children:a.jsxs("g",{className:kt(["react-flow__edge",`react-flow__edge-${R}`,j.className,_,{selected:j.selected,animated:j.animated,inactive:!U&&!l,updating:K,selectable:U}]),onClick:de,onDoubleClick:ge,onContextMenu:J,onMouseEnter:le,onMouseMove:ve,onMouseLeave:Ne,onKeyDown:z?_e:void 0,tabIndex:z?0:void 0,role:j.ariaRole??(z?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":j.ariaLabel===null?void 0:j.ariaLabel||`Edge from ${j.source} to ${j.target}`,"aria-describedby":z?`${MS}-${S}`:void 0,ref:F,...j.domAttributes,children:[!ne&&a.jsx(D,{id:e,source:j.source,target:j.target,type:j.type,selected:j.selected,animated:j.animated,selectable:U,deletable:j.deletable??!0,label:j.label,labelStyle:j.labelStyle,labelShowBg:j.labelShowBg,labelBgStyle:j.labelBgStyle,labelBgPadding:j.labelBgPadding,labelBgBorderRadius:j.labelBgBorderRadius,sourceX:I,sourceY:$,targetX:P,targetY:T,sourcePosition:B,targetPosition:W,data:j.data,style:j.style,sourceHandleId:j.sourceHandle,targetHandleId:j.targetHandle,markerStart:Z,markerEnd:re,pathOptions:"pathOptions"in j?j.pathOptions:void 0,interactionWidth:j.interactionWidth}),H&&a.jsx(e7,{edge:j,isReconnectable:H,reconnectRadius:g,onReconnect:v,onReconnectStart:y,onReconnectEnd:b,sourceX:I,sourceY:$,targetX:P,targetY:T,sourcePosition:B,targetPosition:W,setUpdateHover:G,setReconnecting:L})]})})}const n7=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function nj({defaultMarkerColor:e,onlyRenderVisibleElements:n,rfId:s,edgeTypes:o,noPanClassName:l,onReconnect:c,onEdgeContextMenu:d,onEdgeMouseEnter:f,onEdgeMouseMove:m,onEdgeMouseLeave:p,onEdgeClick:g,reconnectRadius:v,onEdgeDoubleClick:y,onReconnectStart:b,onReconnectEnd:S,disableKeyboardA11y:N}){const{edgesFocusable:_,edgesReconnectable:E,elementsSelectable:M,onError:j}=tt(n7,bt),k=Pz(n);return a.jsxs("div",{className:"react-flow__edges",children:[a.jsx(Yz,{defaultColor:e,rfId:s}),k.map(R=>a.jsx(t7,{id:R,edgesFocusable:_,edgesReconnectable:E,elementsSelectable:M,noPanClassName:l,onReconnect:c,onContextMenu:d,onMouseEnter:f,onMouseMove:m,onMouseLeave:p,onClick:g,reconnectRadius:v,onDoubleClick:y,onReconnectStart:b,onReconnectEnd:S,rfId:s,onError:j,edgeTypes:o,disableKeyboardA11y:N},R))]})}nj.displayName="EdgeRenderer";const r7=w.memo(nj),s7=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function o7({children:e}){const n=tt(s7);return a.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:n},children:e})}function a7(e){const n=Aa(),s=w.useRef(!1);w.useEffect(()=>{!s.current&&n.viewportInitialized&&e&&(setTimeout(()=>e(n),1),s.current=!0)},[e,n.viewportInitialized])}const i7=e=>e.panZoom?.syncViewport;function l7(e){const n=tt(i7),s=yt();return w.useEffect(()=>{e&&(n?.(e),s.setState({transform:[e.x,e.y,e.zoom]}))},[e,n]),null}function c7(e){return e.connection.inProgress?{...e.connection,to:jl(e.connection.to,e.transform)}:{...e.connection}}function u7(e){return c7}function d7(e){const n=u7();return tt(n,bt)}const f7=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function m7({containerStyle:e,style:n,type:s,component:o}){const{nodesConnectable:l,width:c,height:d,isValid:f,inProgress:m}=tt(f7,bt);return!(c&&l&&m)?null:a.jsx("svg",{style:e,width:c,height:d,className:"react-flow__connectionline react-flow__container",children:a.jsx("g",{className:kt(["react-flow__connection",nS(f)]),children:a.jsx(rj,{style:n,type:s,CustomComponent:o,isValid:f})})})}const rj=({style:e,type:n=xs.Bezier,CustomComponent:s,isValid:o})=>{const{inProgress:l,from:c,fromNode:d,fromHandle:f,fromPosition:m,to:p,toNode:g,toHandle:v,toPosition:y}=d7();if(!l)return;if(s)return a.jsx(s,{connectionLineType:n,connectionLineStyle:e,fromNode:d,fromHandle:f,fromX:c.x,fromY:c.y,toX:p.x,toY:p.y,fromPosition:m,toPosition:y,connectionStatus:nS(o),toNode:g,toHandle:v});let b="";const S={sourceX:c.x,sourceY:c.y,sourcePosition:m,targetX:p.x,targetY:p.y,targetPosition:y};switch(n){case xs.Bezier:[b]=hS(S);break;case xs.SimpleBezier:[b]=qS(S);break;case xs.Step:[b]=rp({...S,borderRadius:0});break;case xs.SmoothStep:[b]=rp(S);break;default:[b]=gS(S)}return a.jsx("path",{d:b,fill:"none",className:"react-flow__connection-path",style:e})};rj.displayName="ConnectionLine";const h7={};function Gb(e=h7){w.useRef(e),yt(),w.useEffect(()=>{},[e])}function p7(){yt(),w.useRef(!1),w.useEffect(()=>{},[])}function sj({nodeTypes:e,edgeTypes:n,onInit:s,onNodeClick:o,onEdgeClick:l,onNodeDoubleClick:c,onEdgeDoubleClick:d,onNodeMouseEnter:f,onNodeMouseMove:m,onNodeMouseLeave:p,onNodeContextMenu:g,onSelectionContextMenu:v,onSelectionStart:y,onSelectionEnd:b,connectionLineType:S,connectionLineStyle:N,connectionLineComponent:_,connectionLineContainerStyle:E,selectionKeyCode:M,selectionOnDrag:j,selectionMode:k,multiSelectionKeyCode:R,panActivationKeyCode:D,zoomActivationKeyCode:z,deleteKeyCode:H,onlyRenderVisibleElements:U,elementsSelectable:F,defaultViewport:K,translateExtent:G,minZoom:ne,maxZoom:L,preventScrolling:V,defaultMarkerColor:A,zoomOnScroll:I,zoomOnPinch:$,panOnScroll:P,panOnScrollSpeed:T,panOnScrollMode:B,zoomOnDoubleClick:W,panOnDrag:Z,onPaneClick:re,onPaneMouseEnter:de,onPaneMouseMove:ge,onPaneMouseLeave:J,onPaneScroll:le,onPaneContextMenu:ve,paneClickDistance:Ne,nodeClickDistance:_e,onEdgeContextMenu:be,onEdgeMouseEnter:Re,onEdgeMouseMove:te,onEdgeMouseLeave:Ee,reconnectRadius:Ve,onReconnect:Qe,onReconnectStart:It,onReconnectEnd:Zt,noDragClassName:ht,noWheelClassName:We,noPanClassName:dt,disableKeyboardA11y:wn,nodeExtent:ae,rfId:ie,viewport:ue,onViewportChange:me}){return Gb(e),Gb(n),p7(),a7(s),l7(ue),a.jsx(Rz,{onPaneClick:re,onPaneMouseEnter:de,onPaneMouseMove:ge,onPaneMouseLeave:J,onPaneContextMenu:ve,onPaneScroll:le,paneClickDistance:Ne,deleteKeyCode:H,selectionKeyCode:M,selectionOnDrag:j,selectionMode:k,onSelectionStart:y,onSelectionEnd:b,multiSelectionKeyCode:R,panActivationKeyCode:D,zoomActivationKeyCode:z,elementsSelectable:F,zoomOnScroll:I,zoomOnPinch:$,zoomOnDoubleClick:W,panOnScroll:P,panOnScrollSpeed:T,panOnScrollMode:B,panOnDrag:Z,defaultViewport:K,translateExtent:G,minZoom:ne,maxZoom:L,onSelectionContextMenu:v,preventScrolling:V,noDragClassName:ht,noWheelClassName:We,noPanClassName:dt,disableKeyboardA11y:wn,onViewportChange:me,isControlledViewport:!!ue,children:a.jsxs(o7,{children:[a.jsx(r7,{edgeTypes:n,onEdgeClick:l,onEdgeDoubleClick:d,onReconnect:Qe,onReconnectStart:It,onReconnectEnd:Zt,onlyRenderVisibleElements:U,onEdgeContextMenu:be,onEdgeMouseEnter:Re,onEdgeMouseMove:te,onEdgeMouseLeave:Ee,reconnectRadius:Ve,defaultMarkerColor:A,noPanClassName:dt,disableKeyboardA11y:wn,rfId:ie}),a.jsx(m7,{style:N,type:S,component:_,containerStyle:E}),a.jsx("div",{className:"react-flow__edgelabel-renderer"}),a.jsx(Bz,{nodeTypes:e,onNodeClick:o,onNodeDoubleClick:c,onNodeMouseEnter:f,onNodeMouseMove:m,onNodeMouseLeave:p,onNodeContextMenu:g,nodeClickDistance:_e,onlyRenderVisibleElements:U,noPanClassName:dt,noDragClassName:ht,disableKeyboardA11y:wn,nodeExtent:ae,rfId:ie}),a.jsx("div",{className:"react-flow__viewport-portal"})]})})}sj.displayName="GraphView";const g7=w.memo(sj),Xb=({nodes:e,edges:n,defaultNodes:s,defaultEdges:o,width:l,height:c,fitView:d,fitViewOptions:f,minZoom:m=.5,maxZoom:p=2,nodeOrigin:g,nodeExtent:v}={})=>{const y=new Map,b=new Map,S=new Map,N=new Map,_=o??n??[],E=s??e??[],M=g??[0,0],j=v??ol;yS(S,N,_);const k=op(E,y,b,{nodeOrigin:M,nodeExtent:j,elevateNodesOnSelect:!1});let R=[0,0,1];if(d&&l&&c){const D=Nl(y,{filter:F=>!!((F.width||F.initialWidth)&&(F.height||F.initialHeight))}),{x:z,y:H,zoom:U}=ug(D,l,c,m,p,f?.padding??.1);R=[z,H,U]}return{rfId:"1",width:0,height:0,transform:R,nodes:E,nodesInitialized:k,nodeLookup:y,parentLookup:b,edges:_,edgeLookup:N,connectionLookup:S,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:s!==void 0,hasDefaultEdges:o!==void 0,panZoom:null,minZoom:m,maxZoom:p,translateExtent:ol,nodeExtent:j,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:ga.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:{...tS},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:D8,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:eS}},x7=({nodes:e,edges:n,defaultNodes:s,defaultEdges:o,width:l,height:c,fitView:d,fitViewOptions:f,minZoom:m,maxZoom:p,nodeOrigin:g,nodeExtent:v})=>L9((y,b)=>{async function S(){const{nodeLookup:N,panZoom:_,fitViewOptions:E,fitViewResolver:M,width:j,height:k,minZoom:R,maxZoom:D}=b();_&&(await T8({nodes:N,width:j,height:k,panZoom:_,minZoom:R,maxZoom:D},E),M?.resolve(!0),y({fitViewResolver:null}))}return{...Xb({nodes:e,edges:n,width:l,height:c,fitView:d,fitViewOptions:f,minZoom:m,maxZoom:p,nodeOrigin:g,nodeExtent:v,defaultNodes:s,defaultEdges:o}),setNodes:N=>{const{nodeLookup:_,parentLookup:E,nodeOrigin:M,elevateNodesOnSelect:j,fitViewQueued:k}=b(),R=op(N,_,E,{nodeOrigin:M,nodeExtent:v,elevateNodesOnSelect:j,checkEquality:!0});k&&R?(S(),y({nodes:N,nodesInitialized:R,fitViewQueued:!1,fitViewOptions:void 0})):y({nodes:N,nodesInitialized:R})},setEdges:N=>{const{connectionLookup:_,edgeLookup:E}=b();yS(_,E,N),y({edges:N})},setDefaultNodesAndEdges:(N,_)=>{if(N){const{setNodes:E}=b();E(N),y({hasDefaultNodes:!0})}if(_){const{setEdges:E}=b();E(_),y({hasDefaultEdges:!0})}},updateNodeInternals:N=>{const{triggerNodeChanges:_,nodeLookup:E,parentLookup:M,domNode:j,nodeOrigin:k,nodeExtent:R,debug:D,fitViewQueued:z}=b(),{changes:H,updatedInternals:U}=J8(N,E,M,j,k,R);U&&(W8(E,M,{nodeOrigin:k,nodeExtent:R}),z?(S(),y({fitViewQueued:!1,fitViewOptions:void 0})):y({}),H?.length>0&&(D&&console.log("React Flow: trigger node changes",H),_?.(H)))},updateNodePositions:(N,_=!1)=>{const E=[],M=[],{nodeLookup:j,triggerNodeChanges:k}=b();for(const[R,D]of N){const z=j.get(R),H=!!(z?.expandParent&&z?.parentId&&D?.position),U={id:R,type:"position",position:H?{x:Math.max(0,D.position.x),y:Math.max(0,D.position.y)}:D.position,dragging:_};H&&z.parentId&&E.push({id:R,parentId:z.parentId,rect:{...D.internals.positionAbsolute,width:D.measured.width??0,height:D.measured.height??0}}),M.push(U)}if(E.length>0){const{parentLookup:R,nodeOrigin:D}=b(),z=pg(E,j,R,D);M.push(...z)}k(M)},triggerNodeChanges:N=>{const{onNodesChange:_,setNodes:E,nodes:M,hasDefaultNodes:j,debug:k}=b();if(N?.length){if(j){const R=DS(N,M);E(R)}k&&console.log("React Flow: trigger node changes",N),_?.(N)}},triggerEdgeChanges:N=>{const{onEdgesChange:_,setEdges:E,edges:M,hasDefaultEdges:j,debug:k}=b();if(N?.length){if(j){const R=OS(N,M);E(R)}k&&console.log("React Flow: trigger edge changes",N),_?.(N)}},addSelectedNodes:N=>{const{multiSelectionActive:_,edgeLookup:E,nodeLookup:M,triggerNodeChanges:j,triggerEdgeChanges:k}=b();if(_){const R=N.map(D=>Ks(D,!0));j(R);return}j(oa(M,new Set([...N]),!0)),k(oa(E))},addSelectedEdges:N=>{const{multiSelectionActive:_,edgeLookup:E,nodeLookup:M,triggerNodeChanges:j,triggerEdgeChanges:k}=b();if(_){const R=N.map(D=>Ks(D,!0));k(R);return}k(oa(E,new Set([...N]))),j(oa(M,new Set,!0))},unselectNodesAndEdges:({nodes:N,edges:_}={})=>{const{edges:E,nodes:M,nodeLookup:j,triggerNodeChanges:k,triggerEdgeChanges:R}=b(),D=N||M,z=_||E,H=D.map(F=>{const K=j.get(F.id);return K&&(K.selected=!1),Ks(F.id,!1)}),U=z.map(F=>Ks(F.id,!1));k(H),R(U)},setMinZoom:N=>{const{panZoom:_,maxZoom:E}=b();_?.setScaleExtent([N,E]),y({minZoom:N})},setMaxZoom:N=>{const{panZoom:_,minZoom:E}=b();_?.setScaleExtent([E,N]),y({maxZoom:N})},setTranslateExtent:N=>{b().panZoom?.setTranslateExtent(N),y({translateExtent:N})},setPaneClickDistance:N=>{b().panZoom?.setClickDistance(N)},resetSelectedElements:()=>{const{edges:N,nodes:_,triggerNodeChanges:E,triggerEdgeChanges:M,elementsSelectable:j}=b();if(!j)return;const k=_.reduce((D,z)=>z.selected?[...D,Ks(z.id,!1)]:D,[]),R=N.reduce((D,z)=>z.selected?[...D,Ks(z.id,!1)]:D,[]);E(k),M(R)},setNodeExtent:N=>{const{nodes:_,nodeLookup:E,parentLookup:M,nodeOrigin:j,elevateNodesOnSelect:k,nodeExtent:R}=b();N[0][0]===R[0][0]&&N[0][1]===R[0][1]&&N[1][0]===R[1][0]&&N[1][1]===R[1][1]||(op(_,E,M,{nodeOrigin:j,nodeExtent:N,elevateNodesOnSelect:k,checkEquality:!1}),y({nodeExtent:N}))},panBy:N=>{const{transform:_,width:E,height:M,panZoom:j,translateExtent:k}=b();return e9({delta:N,panZoom:j,transform:_,translateExtent:k,width:E,height:M})},setCenter:async(N,_,E)=>{const{width:M,height:j,maxZoom:k,panZoom:R}=b();if(!R)return Promise.resolve(!1);const D=typeof E?.zoom<"u"?E.zoom:k;return await R.setViewport({x:M/2-N*D,y:j/2-_*D,zoom:D},{duration:E?.duration,ease:E?.ease,interpolate:E?.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{y({connection:{...tS}})},updateConnection:N=>{y({connection:N})},reset:()=>y({...Xb()})}},Object.is);function y7({initialNodes:e,initialEdges:n,defaultNodes:s,defaultEdges:o,initialWidth:l,initialHeight:c,initialMinZoom:d,initialMaxZoom:f,initialFitViewOptions:m,fitView:p,nodeOrigin:g,nodeExtent:v,children:y}){const[b]=w.useState(()=>x7({nodes:e,edges:n,defaultNodes:s,defaultEdges:o,width:l,height:c,fitView:p,minZoom:d,maxZoom:f,fitViewOptions:m,nodeOrigin:g,nodeExtent:v}));return a.jsx(H9,{value:b,children:a.jsx(iz,{children:y})})}function v7({children:e,nodes:n,edges:s,defaultNodes:o,defaultEdges:l,width:c,height:d,fitView:f,fitViewOptions:m,minZoom:p,maxZoom:g,nodeOrigin:v,nodeExtent:y}){return w.useContext(jd)?a.jsx(a.Fragment,{children:e}):a.jsx(y7,{initialNodes:n,initialEdges:s,defaultNodes:o,defaultEdges:l,initialWidth:c,initialHeight:d,fitView:f,initialFitViewOptions:m,initialMinZoom:p,initialMaxZoom:g,nodeOrigin:v,nodeExtent:y,children:e})}const b7={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function w7({nodes:e,edges:n,defaultNodes:s,defaultEdges:o,className:l,nodeTypes:c,edgeTypes:d,onNodeClick:f,onEdgeClick:m,onInit:p,onMove:g,onMoveStart:v,onMoveEnd:y,onConnect:b,onConnectStart:S,onConnectEnd:N,onClickConnectStart:_,onClickConnectEnd:E,onNodeMouseEnter:M,onNodeMouseMove:j,onNodeMouseLeave:k,onNodeContextMenu:R,onNodeDoubleClick:D,onNodeDragStart:z,onNodeDrag:H,onNodeDragStop:U,onNodesDelete:F,onEdgesDelete:K,onDelete:G,onSelectionChange:ne,onSelectionDragStart:L,onSelectionDrag:V,onSelectionDragStop:A,onSelectionContextMenu:I,onSelectionStart:$,onSelectionEnd:P,onBeforeDelete:T,connectionMode:B,connectionLineType:W=xs.Bezier,connectionLineStyle:Z,connectionLineComponent:re,connectionLineContainerStyle:de,deleteKeyCode:ge="Backspace",selectionKeyCode:J="Shift",selectionOnDrag:le=!1,selectionMode:ve=al.Full,panActivationKeyCode:Ne="Space",multiSelectionKeyCode:_e=ll()?"Meta":"Control",zoomActivationKeyCode:be=ll()?"Meta":"Control",snapToGrid:Re,snapGrid:te,onlyRenderVisibleElements:Ee=!1,selectNodesOnDrag:Ve,nodesDraggable:Qe,autoPanOnNodeFocus:It,nodesConnectable:Zt,nodesFocusable:ht,nodeOrigin:We=TS,edgesFocusable:dt,edgesReconnectable:wn,elementsSelectable:ae=!0,defaultViewport:ie=K9,minZoom:ue=.5,maxZoom:me=2,translateExtent:ye=ol,preventScrolling:ce=!0,nodeExtent:Se,defaultMarkerColor:De="#b1b1b7",zoomOnScroll:Ke=!0,zoomOnPinch:Ut=!0,panOnScroll:we=!1,panOnScrollSpeed:He=.5,panOnScrollMode:je=ro.Free,zoomOnDoubleClick:rt=!0,panOnDrag:ft=!0,onPaneClick:Vt,onPaneMouseEnter:Fn,onPaneMouseMove:Ma,onPaneMouseLeave:Ms,onPaneScroll:kd,onPaneContextMenu:_l,paneClickDistance:Ta=0,nodeClickDistance:Ra=0,children:Da,onReconnect:El,onReconnectStart:Ad,onReconnectEnd:Yn,onEdgeContextMenu:Rt,onEdgeDoubleClick:qt,onEdgeMouseEnter:$r,onEdgeMouseMove:Oa,onEdgeMouseLeave:Md,reconnectRadius:Td=10,onNodesChange:Cl,onEdgesChange:Ts,noDragClassName:za="nodrag",noWheelClassName:Br="nowheel",noPanClassName:dr="nopan",fitView:Pr,fitViewOptions:fr,connectOnClick:_t,attributionPosition:kl,proOptions:Al,defaultEdgeOptions:mr,elevateNodesOnSelect:Ur,elevateEdgesOnSelect:Rd,disableKeyboardA11y:Ia=!1,autoPanOnConnect:Ml,autoPanOnNodeDrag:Dd,autoPanSpeed:xo,connectionRadius:yo,isValidConnection:Rn,onError:La,style:Tl,id:hr,nodeDragThreshold:Ha,connectionDragThreshold:$a,viewport:Od,onViewportChange:Rl,width:en,height:Dl,colorMode:zd="light",debug:vo,onScroll:Ba,ariaLabelConfig:bo,...Id},tn){const Rs=hr||"1",Ol=tz(zd),Pa=w.useCallback(pr=>{pr.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Ba?.(pr)},[Ba]);return a.jsx("div",{"data-testid":"rf__wrapper",...Id,onScroll:Pa,style:{...Tl,...b7},ref:tn,className:kt(["react-flow",l,Ol]),id:hr,role:"application",children:a.jsxs(v7,{nodes:e,edges:n,width:en,height:Dl,fitView:Pr,fitViewOptions:fr,minZoom:ue,maxZoom:me,nodeOrigin:We,nodeExtent:Se,children:[a.jsx(g7,{onInit:p,onNodeClick:f,onEdgeClick:m,onNodeMouseEnter:M,onNodeMouseMove:j,onNodeMouseLeave:k,onNodeContextMenu:R,onNodeDoubleClick:D,nodeTypes:c,edgeTypes:d,connectionLineType:W,connectionLineStyle:Z,connectionLineComponent:re,connectionLineContainerStyle:de,selectionKeyCode:J,selectionOnDrag:le,selectionMode:ve,deleteKeyCode:ge,multiSelectionKeyCode:_e,panActivationKeyCode:Ne,zoomActivationKeyCode:be,onlyRenderVisibleElements:Ee,defaultViewport:ie,translateExtent:ye,minZoom:ue,maxZoom:me,preventScrolling:ce,zoomOnScroll:Ke,zoomOnPinch:Ut,zoomOnDoubleClick:rt,panOnScroll:we,panOnScrollSpeed:He,panOnScrollMode:je,panOnDrag:ft,onPaneClick:Vt,onPaneMouseEnter:Fn,onPaneMouseMove:Ma,onPaneMouseLeave:Ms,onPaneScroll:kd,onPaneContextMenu:_l,paneClickDistance:Ta,nodeClickDistance:Ra,onSelectionContextMenu:I,onSelectionStart:$,onSelectionEnd:P,onReconnect:El,onReconnectStart:Ad,onReconnectEnd:Yn,onEdgeContextMenu:Rt,onEdgeDoubleClick:qt,onEdgeMouseEnter:$r,onEdgeMouseMove:Oa,onEdgeMouseLeave:Md,reconnectRadius:Td,defaultMarkerColor:De,noDragClassName:za,noWheelClassName:Br,noPanClassName:dr,rfId:Rs,disableKeyboardA11y:Ia,nodeExtent:Se,viewport:Od,onViewportChange:Rl}),a.jsx(ez,{nodes:e,edges:n,defaultNodes:s,defaultEdges:o,onConnect:b,onConnectStart:S,onConnectEnd:N,onClickConnectStart:_,onClickConnectEnd:E,nodesDraggable:Qe,autoPanOnNodeFocus:It,nodesConnectable:Zt,nodesFocusable:ht,edgesFocusable:dt,edgesReconnectable:wn,elementsSelectable:ae,elevateNodesOnSelect:Ur,elevateEdgesOnSelect:Rd,minZoom:ue,maxZoom:me,nodeExtent:Se,onNodesChange:Cl,onEdgesChange:Ts,snapToGrid:Re,snapGrid:te,connectionMode:B,translateExtent:ye,connectOnClick:_t,defaultEdgeOptions:mr,fitView:Pr,fitViewOptions:fr,onNodesDelete:F,onEdgesDelete:K,onDelete:G,onNodeDragStart:z,onNodeDrag:H,onNodeDragStop:U,onSelectionDrag:V,onSelectionDragStart:L,onSelectionDragStop:A,onMove:g,onMoveStart:v,onMoveEnd:y,noPanClassName:dr,nodeOrigin:We,rfId:Rs,autoPanOnConnect:Ml,autoPanOnNodeDrag:Dd,autoPanSpeed:xo,onError:La,connectionRadius:yo,isValidConnection:Rn,selectNodesOnDrag:Ve,nodeDragThreshold:Ha,connectionDragThreshold:$a,onBeforeDelete:T,paneClickDistance:Ta,debug:vo,ariaLabelConfig:bo}),a.jsx(W9,{onSelectionChange:ne}),Da,a.jsx(F9,{proOptions:Al,position:kl}),a.jsx(q9,{rfId:Rs,disableKeyboardA11y:Ia})]})})}var N7=zS(w7);function S7(e){const[n,s]=w.useState(e),o=w.useCallback(l=>s(c=>DS(l,c)),[]);return[n,s,o]}function j7(e){const[n,s]=w.useState(e),o=w.useCallback(l=>s(c=>OS(l,c)),[]);return[n,s,o]}function _7({dimensions:e,lineWidth:n,variant:s,className:o}){return a.jsx("path",{strokeWidth:n,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:kt(["react-flow__background-pattern",s,o])})}function E7({radius:e,className:n}){return a.jsx("circle",{cx:e,cy:e,r:e,className:kt(["react-flow__background-pattern","dots",n])})}var Or;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Or||(Or={}));const C7={[Or.Dots]:1,[Or.Lines]:1,[Or.Cross]:6},k7=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function oj({id:e,variant:n=Or.Dots,gap:s=20,size:o,lineWidth:l=1,offset:c=0,color:d,bgColor:f,style:m,className:p,patternClassName:g}){const v=w.useRef(null),{transform:y,patternId:b}=tt(k7,bt),S=o||C7[n],N=n===Or.Dots,_=n===Or.Cross,E=Array.isArray(s)?s:[s,s],M=[E[0]*y[2]||1,E[1]*y[2]||1],j=S*y[2],k=Array.isArray(c)?c:[c,c],R=_?[j,j]:M,D=[k[0]*y[2]||1+R[0]/2,k[1]*y[2]||1+R[1]/2],z=`${b}${e||""}`;return a.jsxs("svg",{className:kt(["react-flow__background",p]),style:{...m,...Ed,"--xy-background-color-props":f,"--xy-background-pattern-color-props":d},ref:v,"data-testid":"rf__background",children:[a.jsx("pattern",{id:z,x:y[0]%M[0],y:y[1]%M[1],width:M[0],height:M[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${D[0]},-${D[1]})`,children:N?a.jsx(E7,{radius:j/2,className:g}):a.jsx(_7,{dimensions:R,lineWidth:l,variant:n,className:g})}),a.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${z})`})]})}oj.displayName="Background";const A7=w.memo(oj);function M7(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:a.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function T7(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:a.jsx("path",{d:"M0 0h32v4.2H0z"})})}function R7(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:a.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 D7(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:a.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 O7(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:a.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 ou({children:e,className:n,...s}){return a.jsx("button",{type:"button",className:kt(["react-flow__controls-button",n]),...s,children:e})}const z7=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function aj({style:e,showZoom:n=!0,showFitView:s=!0,showInteractive:o=!0,fitViewOptions:l,onZoomIn:c,onZoomOut:d,onFitView:f,onInteractiveChange:m,className:p,children:g,position:v="bottom-left",orientation:y="vertical","aria-label":b}){const S=yt(),{isInteractive:N,minZoomReached:_,maxZoomReached:E,ariaLabelConfig:M}=tt(z7,bt),{zoomIn:j,zoomOut:k,fitView:R}=Aa(),D=()=>{j(),c?.()},z=()=>{k(),d?.()},H=()=>{R(l),f?.()},U=()=>{S.setState({nodesDraggable:!N,nodesConnectable:!N,elementsSelectable:!N}),m?.(!N)},F=y==="horizontal"?"horizontal":"vertical";return a.jsxs(_d,{className:kt(["react-flow__controls",F,p]),position:v,style:e,"data-testid":"rf__controls","aria-label":b??M["controls.ariaLabel"],children:[n&&a.jsxs(a.Fragment,{children:[a.jsx(ou,{onClick:D,className:"react-flow__controls-zoomin",title:M["controls.zoomIn.ariaLabel"],"aria-label":M["controls.zoomIn.ariaLabel"],disabled:E,children:a.jsx(M7,{})}),a.jsx(ou,{onClick:z,className:"react-flow__controls-zoomout",title:M["controls.zoomOut.ariaLabel"],"aria-label":M["controls.zoomOut.ariaLabel"],disabled:_,children:a.jsx(T7,{})})]}),s&&a.jsx(ou,{className:"react-flow__controls-fitview",onClick:H,title:M["controls.fitView.ariaLabel"],"aria-label":M["controls.fitView.ariaLabel"],children:a.jsx(R7,{})}),o&&a.jsx(ou,{className:"react-flow__controls-interactive",onClick:U,title:M["controls.interactive.ariaLabel"],"aria-label":M["controls.interactive.ariaLabel"],children:N?a.jsx(O7,{}):a.jsx(D7,{})}),g]})}aj.displayName="Controls";const I7=w.memo(aj);function L7({id:e,x:n,y:s,width:o,height:l,style:c,color:d,strokeColor:f,strokeWidth:m,className:p,borderRadius:g,shapeRendering:v,selected:y,onClick:b}){const{background:S,backgroundColor:N}=c||{},_=d||S||N;return a.jsx("rect",{className:kt(["react-flow__minimap-node",{selected:y},p]),x:n,y:s,rx:g,ry:g,width:o,height:l,style:{fill:_,stroke:f,strokeWidth:m},shapeRendering:v,onClick:b?E=>b(E,e):void 0})}const H7=w.memo(L7),$7=e=>e.nodes.map(n=>n.id),Nh=e=>e instanceof Function?e:()=>e;function B7({nodeStrokeColor:e,nodeColor:n,nodeClassName:s="",nodeBorderRadius:o=5,nodeStrokeWidth:l,nodeComponent:c=H7,onClick:d}){const f=tt($7,bt),m=Nh(n),p=Nh(e),g=Nh(s),v=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return a.jsx(a.Fragment,{children:f.map(y=>a.jsx(U7,{id:y,nodeColorFunc:m,nodeStrokeColorFunc:p,nodeClassNameFunc:g,nodeBorderRadius:o,nodeStrokeWidth:l,NodeComponent:c,onClick:d,shapeRendering:v},y))})}function P7({id:e,nodeColorFunc:n,nodeStrokeColorFunc:s,nodeClassNameFunc:o,nodeBorderRadius:l,nodeStrokeWidth:c,shapeRendering:d,NodeComponent:f,onClick:m}){const{node:p,x:g,y:v,width:y,height:b}=tt(S=>{const{internals:N}=S.nodeLookup.get(e),_=N.userNode,{x:E,y:M}=N.positionAbsolute,{width:j,height:k}=Hr(_);return{node:_,x:E,y:M,width:j,height:k}},bt);return!p||p.hidden||!lS(p)?null:a.jsx(f,{x:g,y:v,width:y,height:b,style:p.style,selected:!!p.selected,className:o(p),color:n(p),borderRadius:l,strokeColor:s(p),strokeWidth:c,shapeRendering:d,onClick:m,id:p.id})}const U7=w.memo(P7);var V7=w.memo(B7);const q7=200,F7=150,Y7=e=>!e.hidden,G7=e=>{const n={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:n,boundingRect:e.nodeLookup.size>0?iS(Nl(e.nodeLookup,{filter:Y7}),n):n,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},X7="react-flow__minimap-desc";function ij({style:e,className:n,nodeStrokeColor:s,nodeColor:o,nodeClassName:l="",nodeBorderRadius:c=5,nodeStrokeWidth:d,nodeComponent:f,bgColor:m,maskColor:p,maskStrokeColor:g,maskStrokeWidth:v,position:y="bottom-right",onClick:b,onNodeClick:S,pannable:N=!1,zoomable:_=!1,ariaLabel:E,inversePan:M,zoomStep:j=1,offsetScale:k=5}){const R=yt(),D=w.useRef(null),{boundingRect:z,viewBB:H,rfId:U,panZoom:F,translateExtent:K,flowWidth:G,flowHeight:ne,ariaLabelConfig:L}=tt(G7,bt),V=e?.width??q7,A=e?.height??F7,I=z.width/V,$=z.height/A,P=Math.max(I,$),T=P*V,B=P*A,W=k*P,Z=z.x-(T-z.width)/2-W,re=z.y-(B-z.height)/2-W,de=T+W*2,ge=B+W*2,J=`${X7}-${U}`,le=w.useRef(0),ve=w.useRef();le.current=P,w.useEffect(()=>{if(D.current&&F)return ve.current=c9({domNode:D.current,panZoom:F,getTransform:()=>R.getState().transform,getViewScale:()=>le.current}),()=>{ve.current?.destroy()}},[F]),w.useEffect(()=>{ve.current?.update({translateExtent:K,width:G,height:ne,inversePan:M,pannable:N,zoomStep:j,zoomable:_})},[N,_,M,j,K,G,ne]);const Ne=b?Re=>{const[te,Ee]=ve.current?.pointer(Re)||[0,0];b(Re,{x:te,y:Ee})}:void 0,_e=S?w.useCallback((Re,te)=>{const Ee=R.getState().nodeLookup.get(te).internals.userNode;S(Re,Ee)},[]):void 0,be=E??L["minimap.ariaLabel"];return a.jsx(_d,{position:y,style:{...e,"--xy-minimap-background-color-props":typeof m=="string"?m: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 v=="number"?v*P:void 0,"--xy-minimap-node-background-color-props":typeof o=="string"?o:void 0,"--xy-minimap-node-stroke-color-props":typeof s=="string"?s:void 0,"--xy-minimap-node-stroke-width-props":typeof d=="number"?d:void 0},className:kt(["react-flow__minimap",n]),"data-testid":"rf__minimap",children:a.jsxs("svg",{width:V,height:A,viewBox:`${Z} ${re} ${de} ${ge}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":J,ref:D,onClick:Ne,children:[be&&a.jsx("title",{id:J,children:be}),a.jsx(V7,{onClick:_e,nodeColor:o,nodeStrokeColor:s,nodeBorderRadius:c,nodeClassName:l,nodeStrokeWidth:d,nodeComponent:f}),a.jsx("path",{className:"react-flow__minimap-mask",d:`M${Z-W},${re-W}h${de+W*2}v${ge+W*2}h${-de-W*2}z
        M${H.x},${H.y}h${H.width}v${H.height}h${-H.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}ij.displayName="MiniMap";const Z7=w.memo(ij),W7=e=>n=>e?`${Math.max(1/n.transform[2],1)}`:void 0,K7={[ba.Line]:"right",[ba.Handle]:"bottom-right"};function Q7({nodeId:e,position:n,variant:s=ba.Handle,className:o,style:l=void 0,children:c,color:d,minWidth:f=10,minHeight:m=10,maxWidth:p=Number.MAX_VALUE,maxHeight:g=Number.MAX_VALUE,keepAspectRatio:v=!1,resizeDirection:y,autoScale:b=!0,shouldResize:S,onResizeStart:N,onResize:_,onResizeEnd:E}){const M=$S(),j=typeof e=="string"?e:M,k=yt(),R=w.useRef(null),D=s===ba.Handle,z=tt(w.useCallback(W7(D&&b),[D,b]),bt),H=w.useRef(null),U=n??K7[s];w.useEffect(()=>{if(!(!R.current||!j))return H.current||(H.current=_9({domNode:R.current,nodeId:j,getStoreItems:()=>{const{nodeLookup:K,transform:G,snapGrid:ne,snapToGrid:L,nodeOrigin:V,domNode:A}=k.getState();return{nodeLookup:K,transform:G,snapGrid:ne,snapToGrid:L,nodeOrigin:V,paneDomNode:A}},onChange:(K,G)=>{const{triggerNodeChanges:ne,nodeLookup:L,parentLookup:V,nodeOrigin:A}=k.getState(),I=[],$={x:K.x,y:K.y},P=L.get(j);if(P&&P.expandParent&&P.parentId){const T=P.origin??A,B=K.width??P.measured.width??0,W=K.height??P.measured.height??0,Z={id:P.id,parentId:P.parentId,rect:{width:B,height:W,...cS({x:K.x??P.position.x,y:K.y??P.position.y},{width:B,height:W},P.parentId,L,T)}},re=pg([Z],L,V,A);I.push(...re),$.x=K.x?Math.max(T[0]*B,K.x):void 0,$.y=K.y?Math.max(T[1]*W,K.y):void 0}if($.x!==void 0&&$.y!==void 0){const T={id:j,type:"position",position:{...$}};I.push(T)}if(K.width!==void 0&&K.height!==void 0){const B={id:j,type:"dimensions",resizing:!0,setAttributes:y?y==="horizontal"?"width":"height":!0,dimensions:{width:K.width,height:K.height}};I.push(B)}for(const T of G){const B={...T,type:"position"};I.push(B)}ne(I)},onEnd:({width:K,height:G})=>{const ne={id:j,type:"dimensions",resizing:!1,dimensions:{width:K,height:G}};k.getState().triggerNodeChanges([ne])}})),H.current.update({controlPosition:U,boundaries:{minWidth:f,minHeight:m,maxWidth:p,maxHeight:g},keepAspectRatio:v,resizeDirection:y,onResizeStart:N,onResize:_,onResizeEnd:E,shouldResize:S}),()=>{H.current?.destroy()}},[U,f,m,p,g,v,N,_,E,S]);const F=U.split("-");return a.jsx("div",{className:kt(["react-flow__resize-control","nodrag",...F,s,o]),ref:R,style:{...l,scale:z,...d&&{[D?"backgroundColor":"borderColor"]:d}},children:c})}w.memo(Q7);function J7(e,n,s="LR"){if(e.length===0)return e;if(e.length===1)return e.map(S=>({...S,position:{x:0,y:0}}));const o=new Map,l=new Map;e.forEach(S=>{o.set(S.id,[]),l.set(S.id,[])}),n.forEach(S=>{o.get(S.source)?.push(S.target),l.get(S.target)?.push(S.source)});const c=e.filter(S=>(l.get(S.id)||[]).length===0);c.length===0&&c.push(e[0]);const d=220,f=120,m=s==="LR"?350:280,p=s==="TB"?250:180,g=new Map,v=new Map,y=[],b=new Set;for(c.forEach(S=>{y.push({nodeId:S.id,level:0})});y.length>0;){const{nodeId:S,level:N}=y.shift();if(b.has(S))continue;b.add(S),v.has(N)||v.set(N,[]),v.get(N).push(S),(o.get(S)||[]).forEach(E=>{b.has(E)||y.push({nodeId:E,level:N+1})})}return e.forEach(S=>{if(!b.has(S.id)){const _=Math.max(...Array.from(v.keys()),-1)+1;v.has(_)||v.set(_,[]),v.get(_).push(S.id)}}),v.forEach((S,N)=>{const _=S.length;S.forEach((E,M)=>{let j,k;s==="LR"?(j=N*m,k=-((_-1)*p)/2+M*p):(k=N*p,j=-((_-1)*m)/2+M*m),g.set(E,{x:j,y:k,level:N})})}),e.map(S=>{const N=g.get(S.id)||{x:0,y:0};return{...S,position:{x:N.x-d/2,y:N.y-f/2}}})}function eI(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 lj(e){return eI(e)?e:null}function vu(e,n=50,s="..."){return e.length<=n?e:e.substring(0,n)+s}function lp(e,n,s){if(!e)return console.warn("convertWorkflowDumpToNodes: workflowDump is undefined"),[];const o=lj(e);let l,c;return o?(l=Object.values(o.executors).map(f=>({id:f.id,type:f.type,name:f.name||f.id,description:f.description,config:f.config})),c=o.start_executor_id):(l=cj(e),c=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===c,layoutDirection:s||"LR",onNodeClick:n}}))}function cp(e){if(!e)return console.warn("convertWorkflowDumpToEdges: workflowDump is undefined"),[];const n=lj(e);let s;return n?(s=[],n.edge_groups.forEach(l=>{l.edges.forEach(c=>{s.push({source:c.source_id,target:c.target_id,condition:c.condition_name})})})):s=uj(e),!s||!Array.isArray(s)||s.length===0?(console.warn("No connections found in workflow dump. Available keys:",Object.keys(e)),[]):s.map(l=>({id:`${l.source}-${l.target}`,source:l.source,target:l.target,sourceHandle:"source",targetHandle:"target",type:"default",animated:!1,style:{stroke:"#6b7280",strokeWidth:2}}))}function cj(e){if(e.executors&&typeof e.executors=="object"&&!Array.isArray(e.executors)){const o=e.executors;return Object.entries(o).map(([l,c])=>({id:l,type:c.type_||c.type||"executor",name:c.name||l,description:c.description,config:c.config}))}const n=["executors","agents","steps","nodes"];for(const o of n)if(e[o]&&Array.isArray(e[o]))return e[o];if(e.config&&typeof e.config=="object")return cj(e.config);const s=[];return Object.entries(e).forEach(([o,l])=>{if(typeof l=="object"&&l!==null&&("type"in l||"type_"in l)){const c=l;s.push({id:o,type:c.type_||c.type||"executor",name:c.name||o,description:c.description,config:c.config})}}),s}function uj(e){if(e.edge_groups&&Array.isArray(e.edge_groups)){const s=[];return e.edge_groups.forEach(o=>{if(typeof o=="object"&&o!==null&&"edges"in o){const l=o.edges;Array.isArray(l)&&l.forEach(c=>{if(typeof c=="object"&&c!==null&&"source_id"in c&&"target_id"in c){const d=c;s.push({source:d.source_id,target:d.target_id,condition:d.condition_name||void 0})}})}}),s}const n=["connections","edges","transitions","links"];for(const s of n)if(e[s]&&Array.isArray(e[s]))return e[s];return e.config&&typeof e.config=="object"?uj(e.config):[]}function up(e,n,s="LR"){return J7(e,n,s)}function tI(e,n){const s={};let o=!1;const l={};return e.forEach(c=>{if(c.type==="response.output_item.added"||c.type==="response.output_item.done"){const d=c.item;if(d&&d.type==="executor_action"&&d.executor_id){const f=d.executor_id,m=d.id;if(c.type==="response.output_item.added"&&(l[f]=m),!(l[f]===m)&&c.type==="response.output_item.done")return;let g="pending",v;c.type==="response.output_item.added"?g="running":c.type==="response.output_item.done"&&(d.status==="completed"?g="completed":d.status==="failed"?(g="failed",v=d.error?typeof d.error=="string"?d.error:JSON.stringify(d.error):"Execution failed"):d.status==="cancelled"&&(g="cancelled")),s[f]={nodeId:f,state:g,data:d.result,error:v,timestamp:new Date().toISOString()}}}else if(c.type==="response.created"||c.type==="response.in_progress")o=!0;else if(c.type==="response.workflow_event.completed"&&"data"in c&&c.data){const f=c.data,m=f.executor_id,p=f.event_type,g=f.data;let v="pending",y;p==="ExecutorInvokedEvent"?v="running":p==="ExecutorCompletedEvent"?v="completed":p?.includes("Error")||p?.includes("Failed")?(v="failed",y=typeof g=="string"?g:"Execution failed"):p?.includes("Cancel")?v="cancelled":p==="WorkflowCompletedEvent"||p==="WorkflowOutputEvent"?v="completed":p==="WorkflowStartedEvent"&&(o=!0),m&&(s[m]={nodeId:m,state:v,data:g,error:y,timestamp:new Date().toISOString()})}}),o&&n&&!s[n]&&(e.some(d=>{if(d.type==="response.output_item.done"){const f=d.item;return f&&f.type==="executor_action"&&f.executor_id===n}if(d.type==="response.workflow_event.completed"&&"data"in d&&d.data){const f=d.data;return f.executor_id===n&&(f.event_type==="ExecutorCompletedEvent"||f.event_type==="ExecutorFailedEvent"||f.event_type?.includes("Error")||f.event_type?.includes("Failed"))}return!1})||(s[n]={nodeId:n,state:"running",data:void 0,error:void 0,timestamp:new Date().toISOString()})),s}function nI(e,n){return e.map(s=>{const o=n[s.id];return o?{...s,data:{...s.data,state:o.state,outputData:o.data,error:o.error,layoutDirection:s.data.layoutDirection}}:s})}function rI(e){const n={};return e.forEach(o=>{if(o.type==="response.output_item.added"||o.type==="response.output_item.done"){const l=o.item;if(l&&l.type==="executor_action"&&l.executor_id){const c=l.executor_id;n[c]={lastEvent:o.type==="response.output_item.added"?"ExecutorInvokedEvent":"ExecutorCompletedEvent",timestamp:new Date().toISOString()}}}else if(o.type==="response.workflow_event.completed"&&"data"in o&&o.data){const c=o.data,d=c.executor_id,f=c.event_type;d&&(f==="ExecutorInvokedEvent"||f==="ExecutorCompletedEvent")&&(n[d]={lastEvent:f,timestamp:new Date().toISOString()})}}),Object.entries(n).filter(([,o])=>o.lastEvent==="ExecutorInvokedEvent").map(([o])=>o)}function sI(e,n){const s=rI(n),o={};return n.forEach(l=>{if(l.type==="response.workflow_event.completed"&&"data"in l&&l.data){const d=l.data,f=d.executor_id,m=d.event_type;f&&m&&(o[f]||(o[f]={completed:!1,invoked:!1}),m==="ExecutorInvokedEvent"?o[f].invoked=!0:m==="ExecutorCompletedEvent"&&(o[f].completed=!0))}}),e.map(l=>{const c=o[l.source],d=o[l.target],f=s.includes(l.target);let m={...l.style},p=!1;return c?.completed&&f?(m={stroke:"#643FB2",strokeWidth:3,strokeDasharray:"5,5"},p=!0):c?.completed&&d?.completed?m={stroke:"#10b981",strokeWidth:2}:c?.completed&&d?.invoked?m={stroke:"#f59e0b",strokeWidth:2}:m={stroke:"#6b7280",strokeWidth:2},{...l,style:m,animated:p}})}function Sh(e){const n=new Map,s=new Set;return e.forEach(o=>{const l=`${o.source}-${o.target}`,c=`${o.target}-${o.source}`;if(n.has(c)){s.add(c),s.add(l);const d=n.get(c);n.set(c,{...d,markerStart:{type:"arrow",width:20,height:20},markerEnd:{type:"arrow",width:20,height:20},data:{...d.data,isBidirectional:!0}})}else s.has(l)||n.set(l,o)}),Array.from(n.values())}const oI=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"}}},dj=w.memo(({data:e,selected:n})=>{const s=e,o=oI(s.state),l=s.inputData||s.outputData||s.error,c=s.state==="running",d=s.layoutDirection==="TB",f=d?Ie.Top:Ie.Left,m=d?Ie.Bottom:Ie.Right,p=()=>{const g=[];if(s.error&&typeof s.error=="string"){const v=vu(s.error,150);g.push(a.jsxs("div",{className:"mb-2",children:[a.jsx("div",{className:"text-xs font-medium text-red-600 dark:text-red-400 mb-1",children:"Error:"}),a.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 break-words",children:v})]},"error"))}if(s.outputData)try{const v=typeof s.outputData=="string"?s.outputData:JSON.stringify(s.outputData,null,2);g.push(a.jsxs("div",{className:"mb-2",children:[a.jsx("div",{className:"text-xs font-medium text-green-600 dark:text-green-400 mb-1",children:"Output:"}),a.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:a.jsx("pre",{className:"whitespace-pre-wrap font-mono",children:v})})]},"output"))}catch{g.push(a.jsxs("div",{className:"mb-2",children:[a.jsx("div",{className:"text-xs font-medium text-green-600 dark:text-green-400 mb-1",children:"Output:"}),a.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(s.inputData)try{const v=typeof s.inputData=="string"?s.inputData:JSON.stringify(s.inputData,null,2);g.push(a.jsxs("div",{className:"mb-2",children:[a.jsx("div",{className:"text-xs font-medium text-blue-600 dark:text-blue-400 mb-1",children:"Input:"}),a.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:a.jsx("pre",{className:"whitespace-pre-wrap font-mono",children:v})})]},"input"))}catch{g.push(a.jsxs("div",{className:"mb-2",children:[a.jsx("div",{className:"text-xs font-medium text-blue-600 dark:text-blue-400 mb-1",children:"Input:"}),a.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 a.jsxs("div",{className:Ge("group relative w-64 bg-card dark:bg-card rounded border-2 transition-all duration-200",o.borderColor,n?"ring-2 ring-blue-500 ring-offset-2":"",c?o.glow:"shadow-sm"),children:[a.jsx(wa,{type:"target",position:f,id:"target",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:s.state==="running"?"#643FB2":s.state==="completed"?"#10b981":s.state==="failed"?"#ef4444":s.state==="cancelled"?"#f97316":"#4b5563"}}),a.jsx(wa,{type:"source",position:m,id:"source",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:s.state==="running"?"#643FB2":s.state==="completed"?"#10b981":s.state==="failed"?"#ef4444":s.state==="cancelled"?"#f97316":"#4b5563"}}),a.jsxs("div",{className:"p-3",children:[a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx("div",{className:"flex-shrink-0 relative",children:a.jsx("div",{className:"w-10 h-10 rounded-lg bg-gray-900/90 dark:bg-gray-800/90 flex items-center justify-center",children:s.isStartNode?a.jsx(dM,{className:"w-5 h-5 text-[#643FB2] dark:text-[#8B5CF6]"}):a.jsx(Rr,{className:"w-5 h-5 text-gray-300 dark:text-gray-400"})})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx("h3",{className:"font-medium text-sm text-gray-900 dark:text-gray-100 truncate",children:s.name||s.executorId}),c&&a.jsx(go,{className:"w-4 h-4 text-[#643FB2] dark:text-[#8B5CF6] animate-spin flex-shrink-0"})]}),s.executorType&&a.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 truncate mt-0.5",children:s.executorType})]})]}),l&&a.jsx("div",{className:"mt-3",children:p()}),c&&a.jsx("div",{className:"absolute inset-0 rounded border-2 border-[#643FB2]/30 dark:border-[#8B5CF6]/30 animate-pulse pointer-events-none"})]})]})});dj.displayName="ExecutorNode";const aI={executor:dj};function iI({workflowDump:e,onNodeSelect:n,viewOptions:s,onToggleViewOption:o,layoutDirection:l,onLayoutDirectionChange:c}){const{fitView:d,setViewport:f,setNodes:m}=Aa(),p=()=>{f({x:0,y:0,zoom:1})},g=()=>{d({padding:.2})},v=()=>{if(!e)return;const y=lp(e,n,l),b=cp(e),S=up(y,b,l);m(S)};return a.jsx("div",{className:"absolute top-4 right-4 z-10",children:a.jsxs($p,{children:[a.jsx(Bp,{asChild:!0,children:a.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:[a.jsx(rM,{className:"h-4 w-4"}),a.jsx("span",{className:"sr-only",children:"View options"})]})}),a.jsxs(Pp,{align:"end",className:"w-56",children:[a.jsxs(Gt,{className:"flex items-center justify-between",onClick:()=>o?.("showMinimap"),children:[a.jsxs("div",{className:"flex items-center",children:[a.jsx(SM,{className:"mr-2 h-4 w-4"}),"Show Minimap"]}),a.jsx(Qs,{checked:s.showMinimap,onChange:()=>{}})]}),a.jsxs(Gt,{className:"flex items-center justify-between",onClick:()=>o?.("showGrid"),children:[a.jsxs("div",{className:"flex items-center",children:[a.jsx(cM,{className:"mr-2 h-4 w-4"}),"Show Grid"]}),a.jsx(Qs,{checked:s.showGrid,onChange:()=>{}})]}),a.jsxs(Gt,{className:"flex items-center justify-between",onClick:()=>o?.("animateRun"),children:[a.jsxs("div",{className:"flex items-center",children:[a.jsx(Hp,{className:"mr-2 h-4 w-4"}),"Animate Run"]}),a.jsx(Qs,{checked:s.animateRun,onChange:()=>{}})]}),a.jsxs(Gt,{className:"flex items-center justify-between",onClick:()=>o?.("consolidateBidirectionalEdges"),children:[a.jsxs("div",{className:"flex items-center",children:[a.jsx(kA,{className:"mr-2 h-4 w-4"}),"Merge Bidirectional Edges"]}),a.jsx(Qs,{checked:s.consolidateBidirectionalEdges,onChange:()=>{}})]}),a.jsx(Vi,{}),a.jsxs(Gt,{className:"flex items-center justify-between",onClick:()=>{const y=l==="LR"?"TB":"LR";if(c?.(y),e){const b=lp(e,n,y),S=cp(e),N=up(b,S,y);m(N)}},children:[a.jsxs("div",{className:"flex items-center",children:[a.jsx(EA,{className:"mr-2 h-4 w-4"}),"Vertical Layout"]}),a.jsx(Qs,{checked:l==="TB",onChange:()=>{}})]}),a.jsx(Vi,{}),a.jsxs(Gt,{onClick:p,children:[a.jsx(Ip,{className:"mr-2 h-4 w-4"}),"Reset Zoom"]}),a.jsxs(Gt,{onClick:g,children:[a.jsx(_M,{className:"mr-2 h-4 w-4"}),"Fit to Screen"]}),a.jsxs(Gt,{onClick:v,children:[a.jsx(KM,{className:"mr-2 h-4 w-4"}),"Auto-arrange"]})]})]})})}function lI({nodes:e,nodeUpdates:n,isStreaming:s,animateRun:o}){const{fitView:l}=Aa();return w.useEffect(()=>{if(o)if(s){const c=e.filter(d=>d.data.state==="running");if(c.length>0){const d=c[0];l({nodes:[d],duration:800,padding:.3,minZoom:.8,maxZoom:1.5})}}else e.length>0&&l({duration:1e3,padding:.2})},[n,s,o,e]),null}const cI=w.memo(({timelineVisible:e})=>{const{fitView:n}=Aa();return w.useEffect(()=>{const s=setTimeout(()=>{n({padding:.2,duration:300})},350);return()=>clearTimeout(s)},[e]),null}),uI=w.memo(function({workflowDump:n,events:s,isStreaming:o,onNodeSelect:l,className:c="",viewOptions:d={showMinimap:!1,showGrid:!0,animateRun:!0,consolidateBidirectionalEdges:!0},onToggleViewOption:f,layoutDirection:m="LR",onLayoutDirectionChange:p,timelineVisible:g=!1}){const{initialNodes:v,initialEdges:y}=w.useMemo(()=>{if(!n)return{initialNodes:[],initialEdges:[]};const R=lp(n,l,m),D=cp(n),z=d.consolidateBidirectionalEdges?Sh(D):D;return{initialNodes:R.length>0?up(R,z,m):R,initialEdges:z}},[n,l,m,d.consolidateBidirectionalEdges]),[b,S,N]=S7(v),[_,E,M]=j7(y),j=w.useMemo(()=>tI(s,n?.start_executor_id),[s,n?.start_executor_id]);w.useMemo(()=>{Object.keys(j).length>0?S(R=>nI(R,j)):s.length===0&&S(R=>R.map(D=>({...D,data:{...D.data,state:"pending",outputData:void 0,error:void 0}})))},[j,S,s.length]),w.useMemo(()=>{s.length>0?E(R=>{const D=sI(R,s);return d.consolidateBidirectionalEdges?Sh(D):D}):E(R=>{const D=R.map(z=>({...z,animated:!1,style:{stroke:"#6b7280",strokeWidth:2}}));return d.consolidateBidirectionalEdges?Sh(D):D})},[s,E,d.consolidateBidirectionalEdges]),w.useEffect(()=>{v.length>0&&(S(v),E(y))},[n,d.consolidateBidirectionalEdges]);const k=w.useCallback((R,D)=>{R.stopPropagation(),l?.(D.data.executorId,D.data)},[l]);return n?v.length===0?a.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 ${c}`,children:a.jsxs("div",{className:"text-center text-gray-500 dark:text-gray-400",children:[a.jsx("div",{className:"text-lg font-medium mb-2",children:"No Executors Found"}),a.jsx("div",{className:"text-sm",children:"Could not extract executors from workflow dump."}),a.jsxs("details",{className:"mt-2 text-xs",children:[a.jsx("summary",{className:"cursor-pointer",children:"Debug Info"}),a.jsx("pre",{className:"mt-1 p-2 bg-gray-100 dark:bg-gray-800 rounded text-left overflow-auto",children:JSON.stringify(n,null,2)})]})]})}):a.jsxs("div",{className:`h-full w-full ${c}`,children:[a.jsxs(N7,{nodes:b,edges:_,onNodesChange:N,onEdgesChange:M,onNodeClick:k,nodeTypes:aI,fitView:!0,fitViewOptions:{padding:.2},minZoom:.1,maxZoom:1.5,defaultEdgeOptions:{type:"default",animated:!1,style:{stroke:"#6b7280",strokeWidth:2}},nodesDraggable:!o,nodesConnectable:!1,elementsSelectable:!0,proOptions:{hideAttribution:!0},children:[d.showGrid&&a.jsx(A7,{variant:Or.Dots,gap:20,size:1,color:"#e5e7eb",className:"dark:opacity-30"}),a.jsx(I7,{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&&a.jsx(Z7,{nodeColor:R=>{switch(R.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"}),a.jsx(lI,{nodes:b,nodeUpdates:j,isStreaming:o,animateRun:d.animateRun}),a.jsx(cI,{timelineVisible:g}),a.jsx(iI,{workflowDump:n,onNodeSelect:l,viewOptions:d,onToggleViewOption:f,layoutDirection:m,onLayoutDirectionChange:p})]}),a.jsx("style",{children:`
        .react-flow__edge-path {
          transition: stroke 0.3s ease, stroke-width 0.3s ease;
        }
        .react-flow__edge.animated .react-flow__edge-path {
          stroke-dasharray: 5 5;
          animation: dash 1s linear infinite;
        }
        @keyframes dash {
          0% { stroke-dashoffset: 0; }
          100% { stroke-dashoffset: -10; }
        }
        
        /* Dark theme styles for React Flow controls */
        .dark .react-flow__controls {
          background-color: rgba(31, 41, 55, 0.9) !important;
          border-color: rgb(75, 85, 99) !important;
        }
        .dark .react-flow__controls-button {
          background-color: rgba(31, 41, 55, 0.9) !important;
          border-color: rgb(75, 85, 99) !important;
          color: rgb(229, 231, 235) !important;
        }
        .dark .react-flow__controls-button:hover {
          background-color: rgba(55, 65, 81, 0.9) !important;
          color: rgb(255, 255, 255) !important;
        }
        .dark .react-flow__controls-button svg {
          fill: rgb(229, 231, 235) !important;
        }
        .dark .react-flow__controls-button:hover svg {
          fill: rgb(255, 255, 255) !important;
        }
      `})]}):a.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 ${c}`,children:a.jsxs("div",{className:"text-center text-gray-500 dark:text-gray-400",children:[a.jsx("div",{className:"text-lg font-medium mb-2",children:"No Workflow Data"}),a.jsx("div",{className:"text-sm",children:"Workflow dump is not available."})]})})});function au({title:e,icon:n,children:s,className:o=""}){return a.jsxs("div",{className:`border rounded-lg p-4 bg-card ${o}`,children:[a.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[n,a.jsx("h3",{className:"text-sm font-semibold text-foreground",children:e})]}),a.jsx("div",{className:"text-sm text-muted-foreground",children:s})]})}function dI({workflow:e,open:n,onOpenChange:s}){const o=e.source==="directory"?a.jsx($1,{className:"h-4 w-4 text-muted-foreground"}):e.source==="in_memory"?a.jsx(Oh,{className:"h-4 w-4 text-muted-foreground"}):a.jsx(B1,{className:"h-4 w-4 text-muted-foreground"}),l=e.source==="directory"?"Local":e.source==="in_memory"?"In-Memory":"Gallery";return a.jsx(js,{open:n,onOpenChange:s,children:a.jsxs(_s,{className:"max-w-4xl max-h-[90vh] flex flex-col",children:[a.jsxs(Es,{className:"px-6 pt-6 flex-shrink-0",children:[a.jsx(Cs,{children:"Workflow Details"}),a.jsx(Ca,{onClose:()=>s(!1)})]}),a.jsxs("div",{className:"px-6 pb-6 overflow-y-auto flex-1",children:[a.jsxs("div",{className:"mb-6",children:[a.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[a.jsx(Rr,{className:"h-6 w-6 text-primary"}),a.jsx("h2",{className:"text-xl font-semibold text-foreground",children:e.name||e.id})]}),e.description&&a.jsx("p",{className:"text-muted-foreground",children:e.description})]}),a.jsx("div",{className:"h-px bg-border mb-6"}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4",children:[a.jsx(au,{title:"Start Executor",icon:a.jsx(qA,{className:"h-4 w-4 text-muted-foreground"}),children:a.jsx("div",{className:"font-mono text-foreground",children:e.start_executor_id})}),a.jsx(au,{title:"Source",icon:o,children:a.jsxs("div",{className:"space-y-1",children:[a.jsx("div",{className:"text-foreground",children:l}),e.module_path&&a.jsx("div",{className:"font-mono text-xs break-all",children:e.module_path})]})}),a.jsx(au,{title:"Environment",icon:e.has_env?a.jsx(yl,{className:"h-4 w-4 text-orange-500"}):a.jsx(td,{className:"h-4 w-4 text-green-500"}),className:"md:col-span-2",children:a.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"})})]}),a.jsx(au,{title:`Executors (${e.executors.length})`,icon:a.jsx(zh,{className:"h-4 w-4 text-muted-foreground"}),children:e.executors.length>0?a.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-2",children:e.executors.map((c,d)=>a.jsx("div",{className:"font-mono text-xs text-foreground bg-muted px-2 py-1 rounded",children:c},d))}):a.jsx("div",{className:"text-muted-foreground",children:"No executors configured"})})]})]})})}function fI(e){switch(e){case"running":return a.jsx(go,{className:"w-4 h-4 text-[#643FB2] dark:text-[#8B5CF6] animate-spin"});case"completed":return a.jsx(td,{className:"w-4 h-4 text-green-500 dark:text-green-400"});case"failed":return a.jsx(yl,{className:"w-4 h-4 text-red-500 dark:text-red-400"});case"cancelled":return a.jsx(ws,{className:"w-4 h-4 text-orange-500 dark:text-orange-400"});default:return a.jsx("div",{className:"w-4 h-4 rounded-full border-2 border-gray-400 dark:border-gray-500"})}}function mI(e){switch(e){case"running":return"bg-[#643FB2]/10 text-[#643FB2] dark:bg-[#8B5CF6]/10 dark:text-[#8B5CF6] border-[#643FB2]/20 dark:border-[#8B5CF6]/20";case"completed":return"bg-green-500/10 text-green-600 dark:text-green-400 border-green-500/20";case"failed":return"bg-red-500/10 text-red-600 dark:text-red-400 border-red-500/20";case"cancelled":return"bg-orange-500/10 text-orange-600 dark:text-orange-400 border-orange-500/20";default:return"bg-gray-500/10 text-gray-600 dark:text-gray-400 border-gray-500/20"}}function hI({run:e,isExpanded:n,onToggle:s,onClick:o,isSelected:l}){const c=new Date(e.timestamp).toLocaleTimeString(),f=e.output.trim().length>0||e.error,m=w.useRef(null);return w.useEffect(()=>{n&&e.state==="running"&&m.current&&(m.current.scrollTop=m.current.scrollHeight)},[e.output,n,e.state]),a.jsxs("div",{className:`border rounded-lg transition-all ${l?"border-blue-500 dark:border-blue-400 bg-blue-500/5 dark:bg-blue-500/10":"border-border hover:border-muted-foreground/30"}`,children:[a.jsxs("div",{className:"p-3 cursor-pointer",onClick:()=>{o(),f&&s()},children:[a.jsxs("div",{className:"grid grid-cols-[auto_auto_1fr_auto] items-center gap-2 mb-1",children:[a.jsx("div",{className:"w-3 text-muted-foreground",children:f&&a.jsx(a.Fragment,{children:n?a.jsx(Xt,{className:"w-3 h-3"}):a.jsx(Un,{className:"w-3 h-3"})})}),a.jsx("div",{children:fI(e.state)}),a.jsx("span",{className:"font-medium text-sm truncate overflow-hidden",children:e.executorName}),e.runNumber>1?a.jsxs(Qt,{variant:"outline",className:"text-xs whitespace-nowrap",children:["Run #",e.runNumber]}):a.jsx("div",{})]}),a.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground ml-5",children:[a.jsx("span",{className:"font-mono",children:c}),a.jsx(Qt,{variant:"outline",className:`text-xs border ${mI(e.state)}`,children:e.state})]})]}),n&&f&&a.jsx("div",{className:"border-t px-3 py-2 bg-muted/30",children:e.error?a.jsxs("div",{className:"space-y-1",children:[a.jsx("div",{className:"text-xs font-medium text-red-600 dark:text-red-400",children:"Error:"}),a.jsx("pre",{className:"text-xs bg-red-50 dark:bg-red-950/20 border border-red-200 dark:border-red-800 rounded p-2 overflow-y-auto overflow-x-hidden max-h-40 whitespace-pre-wrap break-all",children:e.error})]}):a.jsxs("div",{className:"space-y-1",children:[a.jsx("div",{className:"text-xs font-medium text-muted-foreground",children:"Output:"}),a.jsx("pre",{ref:m,className:"text-xs bg-background border rounded p-2 overflow-y-auto overflow-x-hidden max-h-60 whitespace-pre-wrap break-all",children:e.output})]})})]})}function pI({events:e,itemOutputs:n,currentExecutorId:s,isStreaming:o,onExecutorClick:l,selectedExecutorId:c,workflowResult:d}){const[f,m]=w.useState(new Set),[p,g]=w.useState(0),[v,y]=w.useState(!1),b=w.useRef(null),S=w.useRef(null);w.useEffect(()=>{if(o){const M=setInterval(()=>{g(j=>j+1)},100);return()=>clearInterval(M)}},[o]);const{executorRuns:N,executorRunCount:_}=w.useMemo(()=>{const M=[],j=new Map;return e.forEach(k=>{const R="_uiTimestamp"in k&&typeof k._uiTimestamp=="number"?k._uiTimestamp*1e3:Date.now();if(k.type==="response.output_item.added"){const D=k.item;if(D&&D.type==="executor_action"&&D.executor_id&&D.id){const z=D.executor_id,H=D.id,U=(j.get(z)||0)+1;j.set(z,U),M.push({executorId:z,executorName:vu(z,35),itemId:H,state:"running",output:n[H]||"",timestamp:R,runNumber:U})}else if(D&&D.type==="message"&&D.metadata?.agent_id&&D.metadata?.source==="magentic"&&D.id){const z=D.metadata.agent_id,H=D.id,U=(j.get(z)||0)+1;j.set(z,U),M.push({executorId:z,executorName:vu(z,35),itemId:H,state:"running",output:n[H]||"",timestamp:R,runNumber:U})}}if(k.type==="response.output_item.done"){const D=k.item;if(D&&D.type==="executor_action"&&D.executor_id&&D.id){const z=D.id,H=M.find(U=>U.itemId===z);H&&(H.state=D.status==="completed"?"completed":D.status==="failed"?"failed":"completed",H.output=n[z]||"",D.status==="failed"&&D.error&&(H.error=D.error))}else if(D&&D.type==="message"&&D.metadata?.agent_id&&D.metadata?.source==="magentic"&&D.id){const z=D.id,H=M.find(U=>U.itemId===z);H&&(H.state=D.status==="completed"?"completed":"failed",H.output=n[z]||"")}}if(k.type==="response.workflow_event.completed"&&"data"in k&&k.data){const D=k.data,z=D.executor_id;if(!z)return;const H=D.event_type;if(H==="ExecutorInvokedEvent"){const U=(j.get(z)||0)+1;j.set(z,U);const F=`fallback_${z}_${R}`;M.push({executorId:z,executorName:vu(z,35),itemId:F,state:"running",output:n[F]||"",timestamp:R,runNumber:U})}else if(H==="ExecutorCompletedEvent"){let U;for(let F=M.length-1;F>=0;F--)if(M[F].executorId===z&&M[F].state==="running"){U=M[F];break}U&&(U.state="completed",U.output=n[U.itemId]||"")}else if(H?.includes("Error")||H?.includes("Failed")){let U;for(let F=M.length-1;F>=0;F--)if(M[F].executorId===z&&M[F].state==="running"){U=M[F];break}U&&(U.state="failed",U.error=typeof D.data=="string"?D.data:"Execution failed")}}}),M.forEach(k=>{k.state==="running"&&n[k.itemId]&&(k.output=n[k.itemId])}),{executorRuns:M,executorRunCount:j}},[e,n,p]);w.useEffect(()=>{s&&m(M=>{const j=new Set(M);return j.add(`${s}-${_.get(s)||1}`),j})},[s,_]),w.useEffect(()=>{if(N.length>0&&o){const M=N[N.length-1],j=`${M.executorId}-${M.runNumber}`;j!==b.current&&(b.current=j,S.current&&S.current.scrollIntoView({behavior:"smooth",block:"end"}))}},[N,o]),w.useEffect(()=>{d&&!o&&S.current&&setTimeout(()=>{S.current?.scrollIntoView({behavior:"smooth",block:"end"})},100)},[d,o]);const E=()=>{const M=N.map(j=>{const R=`[${new Date(j.timestamp).toLocaleTimeString()}] ${j.executorName} (${j.state})`,D=j.error||j.output||"(no output)";return`${R}
${D}
`}).join(`
`);navigator.clipboard.writeText(M),y(!0),setTimeout(()=>y(!1),2e3)};return a.jsxs("div",{className:"h-full flex flex-col border-l bg-muted/30",children:[a.jsxs("div",{className:"p-3 border-b bg-background flex items-center justify-between flex-shrink-0",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"font-medium text-sm",children:"Execution Timeline"}),a.jsx(Qt,{variant:"outline",className:"text-xs",children:N.length}),o&&a.jsxs("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[a.jsx("div",{className:"h-2 w-2 animate-pulse rounded-full bg-[#643FB2] dark:bg-[#8B5CF6]"}),a.jsx("span",{children:"Running"})]})]}),N.length>0&&a.jsx(Oe,{variant:"ghost",size:"sm",onClick:E,className:`h-7 px-2 text-xs ${v?"text-green-600 dark:text-green-400":""}`,children:v?a.jsxs(a.Fragment,{children:[a.jsx(Ea,{className:"w-3 h-3 mr-1"}),"Copied!"]}):a.jsxs(a.Fragment,{children:[a.jsx(Js,{className:"w-3 h-3 mr-1"}),"Copy All"]})})]}),a.jsx(Ss,{className:"flex-1",children:a.jsxs("div",{className:"p-3 space-y-2",children:[N.length===0?a.jsx("div",{className:"text-center text-muted-foreground text-sm py-8",children:"No executor runs yet. Start the workflow to see execution timeline."}):N.map((M,j)=>{const k=`${M.executorId}-${M.runNumber}`;return a.jsx(hI,{run:M,isExpanded:f.has(k),onToggle:()=>{m(R=>{const D=new Set(R);return D.has(k)?D.delete(k):D.add(k),D})},onClick:()=>l?.(M.executorId),isSelected:c===M.executorId},`${k}-${j}`)}),d&&d.trim().length>0&&!o&&a.jsxs("div",{className:"border rounded-lg border-green-500/40 bg-green-500/5 dark:bg-green-500/10",children:[a.jsx("div",{className:"p-3 bg-green-500/10 border-b border-green-500/20",children:a.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[a.jsx(td,{className:"w-4 h-4 text-green-500 dark:text-green-400"}),a.jsx("span",{className:"font-medium text-sm",children:"Workflow Complete"})]})}),a.jsx("div",{className:"border-t px-3 py-2 bg-muted/30",children:a.jsxs("div",{className:"space-y-1",children:[a.jsx("div",{className:"text-xs font-medium text-muted-foreground",children:"Final Output:"}),a.jsx("pre",{className:"text-xs bg-background border rounded p-2 overflow-y-auto overflow-x-hidden max-h-60 whitespace-pre-wrap break-all",children:d})]})})]}),a.jsx("div",{ref:S})]})})]})}function gI({inputSchema:e,onRun:n,isSubmitting:s,workflowState:o}){const[l,c]=w.useState(!1);w.useEffect(()=>{const y=b=>{b.key==="Escape"&&l&&c(!1)};if(l)return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[l]);const d=w.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 y=e.properties,b=Object.entries(y),S=b.filter(([,N])=>N.default!==void 0||N.enum&&N.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 y={};e.type==="string"&&e.default?y.input=e.default:e.type==="object"&&e.properties&&Object.entries(e.properties).forEach(([b,S])=>{S.default!==void 0?y[b]=S.default:S.enum&&S.enum.length>0&&(y[b]=S.enum[0])}),n(y)}else c(!0)},m=()=>o==="running"?"Running...":o==="completed"?"Run Again":o==="error"?"Retry":d.fieldCount===0||d.canRunDirectly?"Run Workflow":"Configure & Run",p=()=>o==="running"?a.jsx(go,{className:"w-4 h-4 animate-spin"}):o==="error"?a.jsx(Ip,{className:"w-4 h-4"}):d.needsInput&&!d.canRunDirectly?a.jsx(Lh,{className:"w-4 h-4"}):a.jsx(HM,{className:"w-4 h-4"}),g=o==="running",v=o==="error"?"destructive":"primary";return a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"flex items-center",children:a.jsxs("div",{className:"flex",children:[a.jsxs(Oe,{onClick:f,disabled:g,variant:v==="destructive"?"destructive":"default",size:"default",className:d.needsInput?"rounded-r-none":"",children:[p(),m()]}),d.needsInput&&a.jsxs(Oe,{onClick:()=>c(!0),disabled:g,variant:v==="destructive"?"destructive":"default",size:"default",className:"rounded-l-none border-l-0 px-3",title:"Configure workflow inputs - customize parameters before running",children:[a.jsx(Lh,{className:"w-4 h-4"}),a.jsx("span",{className:"ml-1.5",children:"Inputs"})]})]})}),a.jsx(js,{open:l,onOpenChange:c,children:a.jsxs(_s,{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:[a.jsxs(Es,{className:"px-8 pt-6",children:[a.jsx(Cs,{children:"Configure Workflow Inputs"}),a.jsx(Ca,{onClose:()=>c(!1)})]}),a.jsx("div",{className:"px-8 py-4 border-b flex-shrink-0",children:a.jsx("div",{className:"text-sm text-muted-foreground",children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("span",{className:"font-medium",children:"Input Type:"}),a.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&&a.jsxs("span",{className:"text-xs text-muted-foreground",children:[Object.keys(e.properties).length," field",Object.keys(e.properties).length!==1?"s":""]})]})})}),a.jsx("div",{className:"px-8 py-6 overflow-y-auto flex-1 min-h-0",children:a.jsx(PR,{inputSchema:e,inputTypeName:"Input",onSubmit:y=>{n(y),c(!1)},isSubmitting:s,className:"embedded"})})]})})]})}function xI({selectedWorkflow:e,onDebugEvent:n}){const[s,o]=w.useState(null),[l,c]=w.useState(!1),[d,f]=w.useState(null),[m,p]=w.useState([]),[g,v]=w.useState(!1),[y,b]=w.useState(null),[S,N]=w.useState(!1),[_,E]=w.useState(!1),[M,j]=w.useState(!1),[k,R]=w.useState(!1),[D,z]=w.useState(""),[H,U]=w.useState([]),[F,K]=w.useState({}),[G,ne]=w.useState(!1),L=w.useRef({}),V=w.useRef(null),A=w.useRef(null),I=pe(ie=>ie.currentSession),$=pe(ie=>ie.availableSessions),P=pe(ie=>ie.loadingSessions),T=pe(ie=>ie.setCurrentSession),B=pe(ie=>ie.setAvailableSessions),W=pe(ie=>ie.setLoadingSessions),Z=pe(ie=>ie.addSession),re=pe(ie=>ie.removeSession),de=pe(ie=>ie.addToast),ge=pe(ie=>ie.runtime),[J,le]=w.useState(null),[ve,Ne]=w.useState(()=>{const ie=localStorage.getItem("workflowViewOptions"),ue={showMinimap:!1,showGrid:!0,animateRun:!1,consolidateBidirectionalEdges:!0};if(ie){const me=JSON.parse(ie);return{...ue,...me}}return ue}),[_e,be]=w.useState(()=>localStorage.getItem("workflowLayoutDirection")||"LR");w.useEffect(()=>{localStorage.setItem("workflowViewOptions",JSON.stringify(ve))},[ve]),w.useEffect(()=>{localStorage.setItem("workflowLayoutDirection",_e)},[_e]);const Re=ie=>{Ne(ue=>({...ue,[ie]:!ue[ie]}))},te=async()=>{if(_||!e)return;E(!0);const{addToast:ie,updateWorkflow:ue}=await Uh(()=>Promise.resolve().then(()=>$h),void 0,import.meta.url).then(me=>({addToast:me.useDevUIStore.getState().addToast,updateWorkflow:me.useDevUIStore.getState().updateWorkflow}));try{await Je.reloadEntity(e.id);const me=await Je.getWorkflowInfo(e.id);ue(me),o(me),ie({message:`${e.name} has been reloaded successfully`,type:"success"})}catch(me){const ye=me instanceof Error?me.message:"Failed to reload entity";ie({message:`Failed to reload: ${ye}`,type:"error",duration:6e3})}finally{E(!1)}};w.useEffect(()=>{const ie=async()=>{if(e.type==="workflow"){c(!0),f(null);try{const ue=await Je.getWorkflowInfo(e.id);o(ue),f(null)}catch(ue){o(null);const me=ue instanceof Error?ue.message:String(ue);f(me),console.error("Error loading workflow info:",ue)}finally{c(!1)}}};p([]),v(!1),b(null),j(!1),z(""),f(null),L.current={},V.current=null,A.current=null,ie()},[e.id,e.type]),w.useEffect(()=>{(async()=>{if(s){W(!0);try{const ue=await Je.listWorkflowSessions(s.id);if(ue.data.length===0){const me=await Je.createWorkflowSession(s.id,{name:`Conversation ${new Date().toLocaleString()}`});B([me]),T(me)}else if(B(ue.data),!I){const me=ue.data[0];T(me),await Ee(me)}}catch(ue){console.error("Failed to load sessions:",ue),ge!=="dotnet"&&de({message:"Failed to load sessions",type:"error"})}finally{W(!1)}}})()},[s?.id,ge]);const Ee=w.useCallback(async ie=>{!ie||!s||le(null)},[s]),Ve=w.useCallback(async ie=>{const ue=$.find(me=>me.conversation_id===ie);ue&&(T(ue),await Ee(ue))},[$,T,Ee]),Qe=w.useCallback(async()=>{if(s)try{const ie=await Je.createWorkflowSession(s.id,{name:`Conversation ${new Date().toLocaleString()}`});Z(ie),T(ie),await Ee(ie),de({message:"New session created",type:"success"})}catch(ie){console.error("Failed to create session:",ie),de({message:"Failed to create session",type:"error"})}},[s,Z,T,Ee,de]),It=w.useCallback(async()=>{if(!(!I||!s)&&confirm("Delete this session? All checkpoints will be lost."))try{await Je.deleteWorkflowSession(s.id,I.conversation_id),re(I.conversation_id),de({message:"Session deleted",type:"success"})}catch(ie){console.error("Failed to delete session:",ie),de({message:"Failed to delete session",type:"error"})}},[I,s,re,de]),Zt=ie=>{b(ie)},ht=w.useMemo(()=>m.filter(ie=>ie.type==="response.output_item.added"||ie.type==="response.output_item.done"||ie.type==="response.created"||ie.type==="response.in_progress"||ie.type==="response.completed"||ie.type==="response.failed"||ie.type==="response.workflow_event.completed"||ie.type==="response.workflow_event.complete"),[m]);w.useEffect(()=>{ht.length>0&&!M&&j(!0)},[ht.length,M]);const We=w.useMemo(()=>{const ie=[];return ht.forEach(ue=>{if(ue.type==="response.output_item.added"||ue.type==="response.output_item.done"){const me=ue.item;me&&me.type==="executor_action"&&me.executor_id&&ie.push({executorId:me.executor_id,message:ue.type==="response.output_item.added"?"Executor started":me.status==="completed"?"Executor completed":me.status==="failed"?"Executor failed":"Executor processing",timestamp:new Date().toISOString(),status:me.status==="completed"?"completed":me.status==="failed"?"error":"running"})}else if(ue.type==="response.workflow_event.complete"&&"data"in ue&&ue.data&&typeof ue.data=="object"){const me=ue.data;me.executor_id!=null&&ie.push({executorId:String(me.executor_id),message:String(me.event_type||"Processing"),timestamp:String(me.timestamp||new Date().toISOString()),status:String(me.event_type||"").includes("Completed")?"completed":String(me.event_type||"").includes("Error")?"error":"running"})}}),ie},[ht]),dt=w.useMemo(()=>g?We.filter(ue=>ue.status==="running").slice(-2).map(ue=>ue.executorId):[],[We,g]),wn=w.useCallback(async ie=>{if(!(!e||e.type!=="workflow")){v(!0),p([]),z(""),L.current={},V.current=null,A.current=null,n("clear");try{const ue={input_data:ie,conversation_id:I?.conversation_id||void 0,checkpoint_id:J||void 0};Je.clearStreamingState(e.id);const me=Je.streamWorkflowExecutionOpenAI(e.id,ue);for await(const ye of me){if((ye.type==="response.output_item.added"||ye.type==="response.output_item.done"||ye.type==="response.created"||ye.type==="response.in_progress"||ye.type==="response.completed"||ye.type==="response.failed"||ye.type==="response.workflow_event.completed"||ye.type==="response.workflow_event.complete")&&p(ce=>{const Se=Math.floor(Date.now()/1e3),De=ce.length>0&&ce[ce.length-1]._uiTimestamp||0,Ke=Math.max(Se,De+1);return[...ce,{...ye,_uiTimestamp:Ke}]}),n(ye),ye.type==="response.output_item.added"){const ce=ye.item;if(ce&&ce.type==="executor_action"&&ce.executor_id&&ce.id&&(V.current=ce.id,L.current[ce.id]||(L.current[ce.id]="")),ce&&ce.type==="message"&&ce.metadata?.source==="magentic"&&ce.id&&(V.current=ce.id,L.current[ce.id]||(L.current[ce.id]="")),ce&&ce.type==="message"&&!ce.metadata?.source&&ce.content){for(const Se of ce.content)if(Se.type==="output_text"&&Se.text){z(De=>De&&De.length>0?De+`

`+Se.text:Se.text);try{const De=JSON.parse(Se.text);typeof De=="object"&&De!==null&&(A.current=De)}catch{}}}}if(ye.type,ye.type,ye.type==="response.workflow_event.completed"&&"data"in ye&&ye.data){const ce=ye.data;if(ce.event_type==="ExecutorInvokedEvent"&&ce.executor_id){const Se=`fallback_${ce.executor_id}_${Date.now()}`;V.current=Se,L.current[Se]||(L.current[Se]="")}(ce.event_type==="WorkflowCompletedEvent"||ce.event_type==="WorkflowOutputEvent")&&ce.data&&(typeof ce.data=="object"&&(A.current=ce.data),V.current=null)}if(ye.type==="response.output_text.delta"&&"delta"in ye&&ye.delta){const ce=V.current;ce&&(L.current[ce]||(L.current[ce]=""),L.current[ce]+=ye.delta)}if(ye.type==="response.request_info.requested"){const ce=ye;U(Ke=>[...Ke,{request_id:ce.request_id,request_data:ce.request_data,request_schema:ce.request_schema}]);const Se=ce.request_schema,De={};Se.properties&&Object.entries(Se.properties).forEach(([Ke,Ut])=>{const we=Ut;we.enum&&we.enum.length>0?De[Ke]=we.enum[0]:we.default!==void 0&&(De[Ke]=we.default)}),K(Ke=>({...Ke,[ce.request_id]:De})),H.length===0&&ne(!0)}if(ye.type==="error")break}H.length>0&&!G&&ne(!0),v(!1)}catch(ue){console.error("Workflow execution error:",ue),v(!1)}}},[e,n,s,I,J]),ae=w.useCallback(async()=>{if(!(!e||e.type!=="workflow")){ne(!1),v(!0);try{const ie={input_data:[{type:"message",content:[{type:"workflow_hil_response",responses:F}]}],conversation_id:I?.conversation_id||void 0,checkpoint_id:J||void 0},ue=Je.streamWorkflowExecutionOpenAI(e.id,ie);for await(const me of ue){if((me.type==="response.output_item.added"||me.type==="response.output_item.done"||me.type==="response.created"||me.type==="response.in_progress"||me.type==="response.completed"||me.type==="response.failed"||me.type==="response.workflow_event.completed")&&p(ye=>{const ce=Math.floor(Date.now()/1e3),Se=ye.length>0&&ye[ye.length-1]._uiTimestamp||0,De=Math.max(ce,Se+1);return[...ye,{...me,_uiTimestamp:De}]}),n(me),me.type==="response.output_item.added"){const ye=me.item;if(ye&&ye.type==="executor_action"&&ye.executor_id&&ye.id&&(V.current=ye.id,L.current[ye.id]||(L.current[ye.id]="")),ye&&ye.type==="message"&&ye.content){for(const ce of ye.content)if(ce.type==="output_text"&&ce.text){z(Se=>Se&&Se.length>0?Se+`

`+ce.text:ce.text);try{const Se=JSON.parse(ce.text);typeof Se=="object"&&Se!==null&&(A.current=Se)}catch{}}}}if(me.type==="response.output_text.delta"&&"delta"in me&&me.delta){const ye=V.current;ye&&(L.current[ye]||(L.current[ye]=""),L.current[ye]+=me.delta)}me.type,me.type}U([]),K({}),v(!1)}catch(ie){console.error("HIL submission error:",ie),v(!1)}}},[e,F,n,I,J]);return l?a.jsx(Vv,{message:"Loading workflow...",description:"Fetching workflow structure and configuration"}):d?a.jsx("div",{className:"flex items-center justify-center h-full",children:a.jsxs("div",{className:"text-center max-w-md p-6",children:[a.jsx("div",{className:"text-red-500 mb-4",children:a.jsx("svg",{className:"w-16 h-16 mx-auto",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}),a.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Failed to Load Workflow"}),a.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:d}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"This may not be a valid workflow entity. Check the file contains a workflow export."})]})}):!s?.workflow_dump&&!We.length?a.jsx(Vv,{message:"Initializing workflow...",description:"Setting up workflow execution environment"}):a.jsxs("div",{className:"workflow-view flex flex-col h-full",children:[a.jsxs("div",{className:"border-b pb-2 p-4 flex-shrink-0",children:[a.jsxs("div",{className:"flex flex-col lg:flex-row lg:items-center lg:justify-between gap-3 mb-3",children:[a.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[a.jsx("h2",{className:"font-semibold text-sm truncate",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Rr,{className:"h-4 w-4 flex-shrink-0"}),a.jsx("span",{className:"truncate",children:e.name||e.id})]})}),a.jsx(Oe,{variant:"ghost",size:"sm",onClick:()=>N(!0),className:"h-6 w-6 p-0 flex-shrink-0",title:"View workflow details",children:a.jsx(Ki,{className:"h-4 w-4"})}),a.jsx(Oe,{variant:"ghost",size:"sm",onClick:te,disabled:_||e.metadata?.source==="in_memory",className:"h-6 w-6 p-0 flex-shrink-0",title:e.metadata?.source==="in_memory"?"In-memory entities cannot be reloaded":_?"Reloading...":"Reload entity code (hot reload)",children:a.jsx(V1,{className:`h-4 w-4 ${_?"animate-spin":""}`})})]}),s&&a.jsxs("div",{className:"flex flex-col sm:flex-row items-stretch sm:items-center gap-2 flex-shrink-0",children:[a.jsxs(ud,{value:I?.conversation_id||"",onValueChange:Ve,disabled:P,children:[a.jsx(fd,{className:"w-full sm:w-64",children:a.jsx(dd,{placeholder:P?"Loading...":$.length===0?"No conversations":"Select conversation",children:I&&a.jsx("div",{className:"flex items-center gap-2 text-xs",children:a.jsx("span",{children:I.metadata.name||`Conversation ${I.conversation_id.slice(-8)}`})})})}),a.jsx(md,{children:$.map(ie=>a.jsx(hd,{value:ie.conversation_id,children:a.jsxs("div",{className:"flex items-center justify-between w-full",children:[a.jsx("span",{children:ie.metadata.name||`Conversation ${ie.conversation_id.slice(-8)}`}),ie.created_at&&a.jsx("span",{className:"text-xs text-muted-foreground ml-3",children:new Date(ie.created_at*1e3).toLocaleTimeString()})]})},ie.conversation_id))})]}),a.jsx(Oe,{variant:"ghost",size:"sm",onClick:It,disabled:!I||P,className:"h-9 w-9 p-0",title:"Delete current session",children:a.jsx(Lp,{className:"h-4 w-4 "})}),a.jsx(Oe,{variant:"ghost",size:"sm",onClick:Qe,disabled:P,className:"h-9 px-3",title:"New session",children:a.jsx(zp,{className:"h-4 w-4"})}),a.jsx(gI,{inputSchema:s.input_schema,onRun:wn,isSubmitting:g,workflowState:g?"running":We.length>0?"completed":"ready",executorHistory:We})]})]}),e.description&&a.jsx("p",{className:"text-sm text-muted-foreground",children:e.description})]}),a.jsxs("div",{className:"flex-1 min-h-0 flex gap-0",children:[a.jsx("div",{className:"flex-1 min-w-0 transition-all duration-300",children:s?.workflow_dump&&a.jsx(uI,{workflowDump:s.workflow_dump,events:ht,isStreaming:g,onNodeSelect:Zt,className:"h-full",viewOptions:ve,onToggleViewOption:Re,layoutDirection:_e,onLayoutDirectionChange:be,timelineVisible:M})}),M&&a.jsx("div",{className:"flex-shrink-0 overflow-hidden transition-all duration-300 ease-out border-l",style:{width:k?"2.5rem":"24rem"},children:k?a.jsxs("div",{className:"h-full w-10 bg-background flex flex-col items-center py-2 cursor-pointer hover:bg-accent/50 transition-colors",onClick:()=>R(!1),title:"Expand timeline",children:[a.jsx("div",{className:"h-8 w-8 flex items-center justify-center",children:a.jsx(L1,{className:"h-4 w-4 text-muted-foreground"})}),a.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-2 pointer-events-none",children:[a.jsx("div",{className:"text-xs text-muted-foreground select-none",style:{writingMode:"vertical-rl",transform:"rotate(180deg)"},children:"Execution Timeline"}),ht.length>0&&a.jsx("div",{className:`bg-primary text-primary-foreground rounded-full w-5 h-5 flex items-center justify-center ${g?"animate-pulse":""}`,style:{fontSize:"10px"},children:ht.length})]})]}):a.jsxs("div",{className:"w-96 h-full flex flex-col",children:[a.jsxs("div",{className:"flex items-center justify-between p-2 border-b",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("h3",{className:"text-sm font-medium",children:"Execution Timeline"}),ht.length>0&&a.jsx("div",{className:`bg-primary text-primary-foreground rounded-full px-2 h-5 flex items-center justify-center ${g?"animate-pulse":""}`,style:{fontSize:"11px",minWidth:"20px"},children:ht.length})]}),a.jsx(Oe,{variant:"ghost",size:"sm",onClick:()=>R(!0),className:"h-8 w-8 p-0",title:"Minimize timeline",children:a.jsx(Un,{className:"h-4 w-4"})})]}),a.jsx("div",{className:"flex-1 min-h-0 overflow-hidden",children:a.jsx(pI,{events:ht,itemOutputs:L.current,currentExecutorId:dt[dt.length-1]||null,isStreaming:g,onExecutorClick:Zt,selectedExecutorId:y,workflowResult:D})})]})})]}),a.jsx(dI,{workflow:e,open:S,onOpenChange:N}),a.jsx(GR,{open:G,onOpenChange:ne,requests:H,responses:F,onResponseChange:(ie,ue)=>{K(me=>({...me,[ie]:ue}))},onSubmit:ae,isSubmitting:g})]})}function fj({message:e,type:n="info",duration:s=4e3,onClose:o}){const[l,c]=w.useState(!0);w.useEffect(()=>{const m=setTimeout(()=>{c(!1),setTimeout(o,300)},s);return()=>clearTimeout(m)},[s,o]);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"}[n],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"}[n];return a.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:[a.jsx("p",{className:`text-sm flex-1 ${f}`,children:e}),a.jsx("button",{onClick:()=>{c(!1),setTimeout(o,300)},className:`flex-shrink-0 hover:opacity-70 transition-opacity ${f}`,children:a.jsx(Ji,{className:"h-4 w-4"})})]})}function yI({toasts:e,onRemove:n}){return a.jsx("div",{className:"fixed top-4 right-4 z-50 flex flex-col gap-2",children:e.map(s=>a.jsx(fj,{message:s.message,type:s.type,duration:s.duration,onClose:()=>n(s.id)},s.id))})}function vI(){const[e,n]=w.useState(!1),[s,o]=w.useState(""),[l,c]=w.useState(!1),[d,f]=w.useState(""),m=pe(te=>te.agents),p=pe(te=>te.workflows),g=pe(te=>te.entities),v=pe(te=>te.selectedAgent),y=pe(te=>te.azureDeploymentEnabled),b=pe(te=>te.isLoadingEntities),S=pe(te=>te.entityError),N=pe(te=>te.oaiMode),_=pe(te=>te.uiMode),E=pe(te=>te.setAgents),M=pe(te=>te.setWorkflows),j=pe(te=>te.setEntities),k=pe(te=>te.selectEntity),R=pe(te=>te.updateAgent),D=pe(te=>te.updateWorkflow),z=pe(te=>te.setIsLoadingEntities),H=pe(te=>te.setEntityError),U=pe(te=>te.showDebugPanel),F=pe(te=>te.debugPanelMinimized),K=pe(te=>te.debugPanelWidth),G=pe(te=>te.debugEvents),ne=pe(te=>te.isResizing),L=pe(te=>te.setShowDebugPanel),V=pe(te=>te.setDebugPanelMinimized),A=pe(te=>te.setDebugPanelWidth),I=pe(te=>te.addDebugEvent),$=pe(te=>te.clearDebugEvents),P=pe(te=>te.setIsResizing),T=pe(te=>te.showAboutModal),B=pe(te=>te.showGallery),W=pe(te=>te.showDeployModal),Z=pe(te=>te.showEntityNotFoundToast),re=pe(te=>te.setShowAboutModal),de=pe(te=>te.setShowGallery),ge=pe(te=>te.setShowDeployModal),J=pe(te=>te.setShowEntityNotFoundToast),le=pe(te=>te.toasts),ve=pe(te=>te.removeToast);w.useEffect(()=>{(async()=>{try{const Ee=await Je.getMeta();if(Ee.auth_required&&(n(!0),!Je.getAuthToken())){H("UNAUTHORIZED"),z(!1);return}pe.getState().setServerMeta({uiMode:Ee.ui_mode,runtime:Ee.runtime,capabilities:Ee.capabilities,authRequired:Ee.auth_required});const{entities:Ve,agents:Qe,workflows:It}=await Je.getEntities();j(Ve),E(Qe),M(It);const ht=new URLSearchParams(window.location.search).get("entity_id");let We;if(ht&&(We=Ve.find(dt=>dt.id===ht),We||J(!0)),!We)if(We=Ve.length>0?Ve[0]:void 0,We){const dt=new URL(window.location.href);dt.searchParams.set("entity_id",We.id),window.history.replaceState({},"",dt)}else{const dt=new URL(window.location.href);dt.searchParams.delete("entity_id"),window.history.replaceState({},"",dt)}if(We&&(k(We),We.metadata?.lazy_loaded===!1))try{if(We.type==="agent"){const dt=await Je.getAgentInfo(We.id);R(dt)}else{const dt=await Je.getWorkflowInfo(We.id);D(dt)}}catch(dt){console.error(`Failed to load full info for first entity ${We.id}:`,dt)}z(!1)}catch(Ee){console.error("Failed to load agents/workflows:",Ee);const Ve=Ee instanceof Error?Ee.message:"Failed to load data";Ve==="UNAUTHORIZED"&&n(!0),H(Ve),z(!1)}})()},[E,M,k,R,D,z,H,J]);const Ne=w.useCallback(async()=>{if(s.trim()){c(!0),f("");try{Je.setAuthToken(s.trim()),await Je.getEntities(),window.location.reload()}catch(te){Je.clearAuthToken(),c(!1);const Ee=te instanceof Error?te.message:"Unknown error";f(Ee==="UNAUTHORIZED"?"Invalid token. Please check and try again.":`Failed to connect: ${Ee}`)}}},[s]);w.useEffect(()=>{if(N.enabled&&v?.type==="workflow"){const te=m[0];te&&k(te)}},[N.enabled,v,m,k]);const _e=w.useCallback(te=>{te.preventDefault(),P(!0);const Ee=te.clientX,Ve=K,Qe=Zt=>{const ht=Ee-Zt.clientX,We=Math.max(200,Math.min(window.innerWidth*.5,Ve+ht));A(We)},It=()=>{P(!1),document.removeEventListener("mousemove",Qe),document.removeEventListener("mouseup",It)};document.addEventListener("mousemove",Qe),document.addEventListener("mouseup",It)},[K]),be=w.useCallback(async te=>{if(k(te),te.metadata?.lazy_loaded===!1)try{if(te.type==="agent"){const Ee=await Je.getAgentInfo(te.id);R(Ee)}else{const Ee=await Je.getWorkflowInfo(te.id);D(Ee)}}catch(Ee){console.error(`Failed to load full info for ${te.id}:`,Ee)}},[k,R,D]),Re=w.useCallback(te=>{te==="clear"?$():I(te)},[I,$]);if(b)return a.jsxs("div",{className:"h-screen flex flex-col bg-background",children:[a.jsxs("header",{className:"flex h-14 items-center gap-4 border-b px-4",children:[a.jsx("div",{className:"w-64 h-9 bg-muted animate-pulse rounded-md"}),a.jsxs("div",{className:"flex items-center gap-2 ml-auto",children:[a.jsx("div",{className:"w-8 h-8 bg-muted animate-pulse rounded-md"}),a.jsx("div",{className:"w-8 h-8 bg-muted animate-pulse rounded-md"})]})]}),a.jsx("div",{className:"flex-1 flex items-center justify-center",children:a.jsxs("div",{className:"text-center",children:[a.jsx("div",{className:"text-lg font-medium",children:"Initializing DevUI..."}),a.jsx("div",{className:"text-sm text-muted-foreground mt-2",children:"Loading agents and workflows from your configuration"})]})})]});if(S){const te=Je.getBaseUrl(),Ee=S==="UNAUTHORIZED"||e;return a.jsxs("div",{className:"h-screen flex flex-col bg-background",children:[a.jsx(Iv,{agents:[],workflows:[],entities:[],selectedItem:void 0,onSelect:()=>{},isLoading:!1,onSettingsClick:()=>re(!0)}),a.jsx("div",{className:"flex-1 flex items-center justify-center p-8",children:a.jsxs("div",{className:"text-center space-y-6 max-w-2xl",children:[a.jsx("div",{className:"flex justify-center",children:a.jsx("div",{className:"rounded-full bg-muted p-4 animate-pulse",children:Ee?a.jsx(wM,{className:"h-12 w-12 text-muted-foreground"}):a.jsx(XM,{className:"h-12 w-12 text-muted-foreground"})})}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("h2",{className:"text-2xl font-semibold text-foreground",children:Ee?"Authentication Required":"Can't Connect to Backend"}),a.jsx("p",{className:"text-muted-foreground text-base",children:Ee?"This backend requires a bearer token to access.":"No worries! Just start the DevUI backend server and you'll be good to go."})]}),Ee?a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"text-left bg-muted/50 rounded-lg p-4 space-y-3",children:[a.jsx("p",{className:"text-sm font-medium text-foreground",children:"Enter Authentication Token"}),a.jsx(An,{type:"password",placeholder:"Paste token from server logs",value:s,onChange:Ve=>o(Ve.target.value),onKeyDown:Ve=>{Ve.key==="Enter"&&!l&&Ne()},disabled:l,className:"font-mono text-sm"}),a.jsx(Oe,{onClick:Ne,disabled:!s.trim()||l,className:"w-full",children:l?"Verifying...":"Connect"}),d&&a.jsx("p",{className:"text-sm text-red-600 dark:text-red-400 text-center",children:d})]}),a.jsxs("details",{className:"text-left group",children:[a.jsxs("summary",{className:"text-sm text-muted-foreground cursor-pointer hover:text-foreground flex items-center gap-2 justify-center",children:[a.jsx(Xt,{className:"h-4 w-4 transition-transform group-open:rotate-180"}),"Where do I find the token?"]}),a.jsxs("div",{className:"mt-3 text-left bg-muted/30 rounded-lg p-3 space-y-2",children:[a.jsx("p",{className:"text-xs text-muted-foreground",children:"Look for this in your DevUI server startup logs:"}),a.jsxs("code",{className:"block bg-background px-2 py-1 rounded text-xs font-mono text-foreground",children:["🔑 DEV TOKEN (localhost only, shown once):",a.jsx("br",{}),"   abc123xyz..."]})]})]})]}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"text-left bg-muted/50 rounded-lg p-4 space-y-3",children:[a.jsx("p",{className:"text-sm font-medium text-foreground",children:"Start the backend:"}),a.jsx("code",{className:"block bg-background px-3 py-2 rounded border text-sm font-mono text-foreground",children:"devui ./agents --port 8080"}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:["Or launch programmatically with"," ",a.jsx("code",{className:"text-xs",children:"serve(entities=[agent])"})]})]}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:["Default:"," ",a.jsx("span",{className:"font-mono",children:te})]})]}),S&&a.jsxs("details",{className:"text-left group",children:[a.jsxs("summary",{className:"text-sm text-muted-foreground cursor-pointer hover:text-foreground flex items-center gap-2",children:[a.jsx(Xt,{className:"h-4 w-4 transition-transform group-open:rotate-180"}),"Error details"]}),a.jsx("p",{className:"mt-2 text-xs text-muted-foreground font-mono bg-muted/30 p-3 rounded border",children:S})]}),a.jsx(Oe,{onClick:()=>window.location.reload(),variant:"default",className:"mt-2",children:"Retry Connection"})]})]})}),a.jsx(Hv,{open:T,onOpenChange:re})]})}return a.jsxs("div",{className:"h-screen flex flex-col bg-background max-h-screen",children:[a.jsx(Iv,{agents:m,workflows:p,entities:g,selectedItem:v,onSelect:be,onBrowseGallery:()=>de(!0),isLoading:b,onSettingsClick:()=>re(!0)}),a.jsx("div",{className:"flex flex-1 overflow-hidden",children:B?a.jsx("div",{className:"flex-1 w-full",children:a.jsx(Pv,{variant:"route",onClose:()=>de(!1),hasExistingEntities:m.length>0||p.length>0})}):m.length===0&&p.length===0?a.jsx(Pv,{variant:"inline"}):a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"flex-1 min-w-0",children:v?v.type==="agent"?a.jsx(zR,{selectedAgent:v,onDebugEvent:Re}):a.jsx(xI,{selectedWorkflow:v,onDebugEvent:Re}):a.jsx("div",{className:"flex-1 flex items-center justify-center text-muted-foreground",children:"Select an agent or workflow to get started."})}),_==="developer"&&U?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:`w-1 cursor-col-resize flex-shrink-0 relative group transition-colors duration-200 ease-in-out ${ne?"bg-primary/40":"bg-border hover:bg-primary/20"}`,onMouseDown:_e,children:a.jsx("div",{className:"absolute inset-y-0 -left-2 -right-2 flex items-center justify-center",children:a.jsx("div",{className:`h-12 w-1 rounded-full transition-all duration-200 ease-in-out ${ne?"bg-primary shadow-lg shadow-primary/25":"bg-primary/30 group-hover:bg-primary group-hover:shadow-md group-hover:shadow-primary/20"}`})})}),a.jsx("div",{className:"flex-shrink-0 flex flex-col h-[calc(100vh-3.7rem)]",style:{width:F?"2.5rem":`${K}px`},children:F?a.jsxs("div",{className:"h-full w-10 bg-background border-l flex flex-col items-center py-2 cursor-pointer hover:bg-accent/50 transition-colors",onClick:()=>V(!1),title:"Expand debug panel",children:[a.jsx("div",{className:"h-8 w-8 flex items-center justify-center",children:a.jsx(L1,{className:"h-4 w-4 text-muted-foreground"})}),a.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-2 pointer-events-none",children:[a.jsx("div",{className:"text-xs text-muted-foreground select-none",style:{writingMode:"vertical-rl",transform:"rotate(180deg)"},children:"Debug Panel"}),G.length>0&&a.jsx("div",{className:"bg-primary text-primary-foreground rounded-full w-5 h-5 flex items-center justify-center",style:{fontSize:"10px"},children:G.length})]})]}):a.jsxs(a.Fragment,{children:[a.jsx(c5,{events:G,isStreaming:!1,onMinimize:()=>V(!0)}),a.jsx("div",{className:"border-t bg-muted/30 px-3 py-2.5 flex-shrink-0",children:a.jsxs(Oe,{onClick:()=>ge(!0),className:"w-full",variant:"outline",size:"sm",children:[a.jsx(Ih,{className:"h-3 w-3 mr-2 flex-shrink-0"}),a.jsx("span",{className:"truncate text-xs",children:y&&v?.deployment_supported?"Deploy to Azure":"Deployment Guide"})]})})]})})]}):_==="developer"?a.jsx("div",{className:"flex-shrink-0",children:a.jsx(Oe,{variant:"ghost",size:"sm",onClick:()=>L(!0),className:"h-full w-10 rounded-none border-l",title:"Show debug panel",children:a.jsx(OM,{className:"h-4 w-4"})})}):null]})}),a.jsx(Hv,{open:T,onOpenChange:re}),a.jsx(C5,{open:W,onClose:()=>ge(!1),agentName:v?.name,entity:v}),Z&&a.jsx(fj,{message:"Entity not found. Showing first available entity instead.",type:"info",onClose:()=>J(!1)}),a.jsx(yI,{toasts:le,onRemove:ve})]})}function bI({children:e,attribute:n="class",defaultTheme:s="dark",enableSystem:o=!0,disableTransitionOnChange:l=!0,...c}){return a.jsx(gT,{attribute:n,defaultTheme:s,enableSystem:o,disableTransitionOnChange:l,...c,children:e})}w5();_E.createRoot(document.getElementById("root")).render(a.jsx(w.StrictMode,{children:a.jsx(bI,{attribute:"class",defaultTheme:"dark",enableSystem:!0,disableTransitionOnChange:!0,children:a.jsx(vI,{})})}));
