apteva 0.4.15 → 0.4.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/App.fq4xbpcz.js +228 -0
- package/dist/index.html +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/src/auth/middleware.ts +10 -0
- package/src/db.ts +159 -4
- package/src/mcp-handler.ts +387 -0
- package/src/routes/api/agent-utils.ts +12 -2
- package/src/routes/api/mcp.ts +174 -3
- package/src/server.ts +3 -3
- package/src/web/App.tsx +11 -2
- package/src/web/components/activity/ActivityPage.tsx +326 -0
- package/src/web/components/activity/index.ts +1 -0
- package/src/web/components/common/Icons.tsx +35 -0
- package/src/web/components/common/index.ts +1 -0
- package/src/web/components/dashboard/Dashboard.tsx +81 -1
- package/src/web/components/index.ts +1 -0
- package/src/web/components/layout/Sidebar.tsx +7 -1
- package/src/web/components/mcp/McpPage.tsx +9 -3
- package/src/web/components/tasks/TasksPage.tsx +122 -15
- package/src/web/context/TelemetryContext.tsx +14 -1
- package/src/web/context/index.ts +1 -1
- package/src/web/types.ts +1 -1
- package/dist/App.jdzxkzm1.js +0 -228
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
var QA=Object.create;var{getPrototypeOf:XA,defineProperty:CK,getOwnPropertyNames:ZA}=Object;var JA=Object.prototype.hasOwnProperty;var H0=(Y,H,B)=>{B=Y!=null?QA(XA(Y)):{};let K=H||!Y||!Y.__esModule?CK(B,"default",{value:Y,enumerable:!0}):B;for(let G of ZA(Y))if(!JA.call(K,G))CK(K,G,{get:()=>Y[G],enumerable:!0});return K};var M2=(Y,H)=>()=>(H||Y((H={exports:{}}).exports,H),H.exports);var D1=M2((YA,BJ)=>{(function(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==="function")__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var Y="18.3.1",H=Symbol.for("react.element"),B=Symbol.for("react.portal"),K=Symbol.for("react.fragment"),G=Symbol.for("react.strict_mode"),_=Symbol.for("react.profiler"),W=Symbol.for("react.provider"),O=Symbol.for("react.context"),F=Symbol.for("react.forward_ref"),b=Symbol.for("react.suspense"),M=Symbol.for("react.suspense_list"),A=Symbol.for("react.memo"),R=Symbol.for("react.lazy"),k=Symbol.for("react.offscreen"),S=Symbol.iterator,V="@@iterator";function x(N){if(N===null||typeof N!=="object")return null;var u=S&&N[S]||N[V];if(typeof u==="function")return u;return null}var f={current:null},l={transition:null},T={current:null,isBatchingLegacy:!1,didScheduleLegacyUpdate:!1},m={current:null},E={},D=null;function n(N){D=N}E.setExtraStackFrame=function(N){D=N},E.getCurrentStack=null,E.getStackAddendum=function(){var N="";if(D)N+=D;var u=E.getCurrentStack;if(u)N+=u()||"";return N};var c=!1,j=!1,g=!1,Q0=!1,r=!1,U0={ReactCurrentDispatcher:f,ReactCurrentBatchConfig:l,ReactCurrentOwner:m};U0.ReactDebugCurrentFrame=E,U0.ReactCurrentActQueue=T;function R0(N){{for(var u=arguments.length,X0=Array(u>1?u-1:0),q0=1;q0<u;q0++)X0[q0-1]=arguments[q0];f0("warn",N,X0)}}function _0(N){{for(var u=arguments.length,X0=Array(u>1?u-1:0),q0=1;q0<u;q0++)X0[q0-1]=arguments[q0];f0("error",N,X0)}}function f0(N,u,X0){{var q0=U0.ReactDebugCurrentFrame,y0=q0.getStackAddendum();if(y0!=="")u+="%s",X0=X0.concat([y0]);var b1=X0.map(function(e0){return String(e0)});b1.unshift("Warning: "+u),Function.prototype.apply.call(console[N],console,b1)}}var P0={};function a(N,u){{var X0=N.constructor,q0=X0&&(X0.displayName||X0.name)||"ReactClass",y0=q0+"."+u;if(P0[y0])return;_0("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",u,q0),P0[y0]=!0}}var Y0={isMounted:function(N){return!1},enqueueForceUpdate:function(N,u,X0){a(N,"forceUpdate")},enqueueReplaceState:function(N,u,X0,q0){a(N,"replaceState")},enqueueSetState:function(N,u,X0,q0){a(N,"setState")}},B0=Object.assign,G0={};Object.freeze(G0);function h0(N,u,X0){this.props=N,this.context=u,this.refs=G0,this.updater=X0||Y0}h0.prototype.isReactComponent={},h0.prototype.setState=function(N,u){if(typeof N!=="object"&&typeof N!=="function"&&N!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,N,u,"setState")},h0.prototype.forceUpdate=function(N){this.updater.enqueueForceUpdate(this,N,"forceUpdate")};{var z0={isMounted:["isMounted","Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],replaceState:["replaceState","Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]},v0=function(N,u){Object.defineProperty(h0.prototype,N,{get:function(){R0("%s(...) is deprecated in plain JavaScript React classes. %s",u[0],u[1]);return}})};for(var j0 in z0)if(z0.hasOwnProperty(j0))v0(j0,z0[j0])}function Y1(){}Y1.prototype=h0.prototype;function m0(N,u,X0){this.props=N,this.context=u,this.refs=G0,this.updater=X0||Y0}var F1=m0.prototype=new Y1;F1.constructor=m0,B0(F1,h0.prototype),F1.isPureReactComponent=!0;function R1(){var N={current:null};return Object.seal(N),N}var p=Array.isArray;function O0(N){return p(N)}function V0(N){{var u=typeof Symbol==="function"&&Symbol.toStringTag,X0=u&&N[Symbol.toStringTag]||N.constructor.name||"Object";return X0}}function q1(N){try{return y1(N),!1}catch(u){return!0}}function y1(N){return""+N}function M1(N){if(q1(N))return _0("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",V0(N)),y1(N)}function A0(N,u,X0){var q0=N.displayName;if(q0)return q0;var y0=u.displayName||u.name||"";return y0!==""?X0+"("+y0+")":X0}function Z1(N){return N.displayName||"Context"}function h1(N){if(N==null)return null;if(typeof N.tag==="number")_0("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.");if(typeof N==="function")return N.displayName||N.name||null;if(typeof N==="string")return N;switch(N){case K:return"Fragment";case B:return"Portal";case _:return"Profiler";case G:return"StrictMode";case b:return"Suspense";case M:return"SuspenseList"}if(typeof N==="object")switch(N.$$typeof){case O:var u=N;return Z1(u)+".Consumer";case W:var X0=N;return Z1(X0._context)+".Provider";case F:return A0(N,N.render,"ForwardRef");case A:var q0=N.displayName||null;if(q0!==null)return q0;return h1(N.type)||"Memo";case R:{var y0=N,b1=y0._payload,e0=y0._init;try{return h1(e0(b1))}catch(T1){return null}}}return null}var n1=Object.prototype.hasOwnProperty,f4={key:!0,ref:!0,__self:!0,__source:!0},B4,T5,A4;A4={};function k5(N){if(n1.call(N,"ref")){var u=Object.getOwnPropertyDescriptor(N,"ref").get;if(u&&u.isReactWarning)return!1}return N.ref!==void 0}function h4(N){if(n1.call(N,"key")){var u=Object.getOwnPropertyDescriptor(N,"key").get;if(u&&u.isReactWarning)return!1}return N.key!==void 0}function D4(N,u){var X0=function(){if(!B4)B4=!0,_0("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",u)};X0.isReactWarning=!0,Object.defineProperty(N,"key",{get:X0,configurable:!0})}function M5(N,u){var X0=function(){if(!T5)T5=!0,_0("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",u)};X0.isReactWarning=!0,Object.defineProperty(N,"ref",{get:X0,configurable:!0})}function x5(N){if(typeof N.ref==="string"&&m.current&&N.__self&&m.current.stateNode!==N.__self){var u=h1(m.current.type);if(!A4[u])_0('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',u,N.ref),A4[u]=!0}}var o4=function(N,u,X0,q0,y0,b1,e0){var T1={$$typeof:H,type:N,key:u,ref:X0,props:e0,_owner:b1};if(T1._store={},Object.defineProperty(T1._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(T1,"_self",{configurable:!1,enumerable:!1,writable:!1,value:q0}),Object.defineProperty(T1,"_source",{configurable:!1,enumerable:!1,writable:!1,value:y0}),Object.freeze)Object.freeze(T1.props),Object.freeze(T1);return T1};function X5(N,u,X0){var q0,y0={},b1=null,e0=null,T1=null,i1=null;if(u!=null){if(k5(u))e0=u.ref,x5(u);if(h4(u))M1(u.key),b1=""+u.key;T1=u.__self===void 0?null:u.__self,i1=u.__source===void 0?null:u.__source;for(q0 in u)if(n1.call(u,q0)&&!f4.hasOwnProperty(q0))y0[q0]=u[q0]}var O4=arguments.length-2;if(O4===1)y0.children=X0;else if(O4>1){var I4=Array(O4);for(var T4=0;T4<O4;T4++)I4[T4]=arguments[T4+2];if(Object.freeze)Object.freeze(I4);y0.children=I4}if(N&&N.defaultProps){var m4=N.defaultProps;for(q0 in m4)if(y0[q0]===void 0)y0[q0]=m4[q0]}if(b1||e0){var a4=typeof N==="function"?N.displayName||N.name||"Unknown":N;if(b1)D4(y0,a4);if(e0)M5(y0,a4)}return o4(N,b1,e0,T1,i1,m.current,y0)}function g0(N,u){var X0=o4(N.type,u,N.ref,N._self,N._source,N._owner,N.props);return X0}function $1(N,u,X0){if(N===null||N===void 0)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+N+".");var q0,y0=B0({},N.props),b1=N.key,e0=N.ref,T1=N._self,i1=N._source,O4=N._owner;if(u!=null){if(k5(u))e0=u.ref,O4=m.current;if(h4(u))M1(u.key),b1=""+u.key;var I4;if(N.type&&N.type.defaultProps)I4=N.type.defaultProps;for(q0 in u)if(n1.call(u,q0)&&!f4.hasOwnProperty(q0))if(u[q0]===void 0&&I4!==void 0)y0[q0]=I4[q0];else y0[q0]=u[q0]}var T4=arguments.length-2;if(T4===1)y0.children=X0;else if(T4>1){var m4=Array(T4);for(var a4=0;a4<T4;a4++)m4[a4]=arguments[a4+2];y0.children=m4}return o4(N.type,b1,e0,T1,i1,O4,y0)}function K1(N){return typeof N==="object"&&N!==null&&N.$$typeof===H}var r1=".",U4=":";function x4(N){var u=/[=:]/g,X0={"=":"=0",":":"=2"},q0=N.replace(u,function(y0){return X0[y0]});return"$"+q0}var w4=!1,z5=/\/+/g;function V1(N){return N.replace(z5,"$&/")}function S1(N,u){if(typeof N==="object"&&N!==null&&N.key!=null)return M1(N.key),x4(""+N.key);return u.toString(36)}function t5(N,u,X0,q0,y0){var b1=typeof N;if(b1==="undefined"||b1==="boolean")N=null;var e0=!1;if(N===null)e0=!0;else switch(b1){case"string":case"number":e0=!0;break;case"object":switch(N.$$typeof){case H:case B:e0=!0}}if(e0){var T1=N,i1=y0(T1),O4=q0===""?r1+S1(T1,0):q0;if(O0(i1)){var I4="";if(O4!=null)I4=V1(O4)+"/";t5(i1,u,I4,"",function(gJ){return gJ})}else if(i1!=null){if(K1(i1)){if(i1.key&&(!T1||T1.key!==i1.key))M1(i1.key);i1=g0(i1,X0+(i1.key&&(!T1||T1.key!==i1.key)?V1(""+i1.key)+"/":"")+O4)}u.push(i1)}return 1}var T4,m4,a4=0,Z4=q0===""?r1:q0+U4;if(O0(N))for(var j8=0;j8<N.length;j8++)T4=N[j8],m4=Z4+S1(T4,j8),a4+=t5(T4,u,X0,m4,y0);else{var u2=x(N);if(typeof u2==="function"){var ZQ=N;if(u2===ZQ.entries){if(!w4)R0("Using Maps as children is not supported. Use an array of keyed ReactElements instead.");w4=!0}var mJ=u2.call(ZQ),S7,JQ=0;while(!(S7=mJ.next()).done)T4=S7.value,m4=Z4+S1(T4,JQ++),a4+=t5(T4,u,X0,m4,y0)}else if(b1==="object"){var YQ=String(N);throw Error("Objects are not valid as a React child (found: "+(YQ==="[object Object]"?"object with keys {"+Object.keys(N).join(", ")+"}":YQ)+"). If you meant to render a collection of children, use an array instead.")}}return a4}function w5(N,u,X0){if(N==null)return N;var q0=[],y0=0;return t5(N,q0,"","",function(b1){return u.call(X0,b1,y0++)}),q0}function s5(N){var u=0;return w5(N,function(){u++}),u}function q7(N,u,X0){w5(N,function(){u.apply(this,arguments)},X0)}function d6(N){return w5(N,function(u){return u})||[]}function B7(N){if(!K1(N))throw Error("React.Children.only expected to receive a single React element child.");return N}function y6(N){var u={$$typeof:O,_currentValue:N,_currentValue2:N,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null};u.Provider={$$typeof:W,_context:u};var X0=!1,q0=!1,y0=!1;{var b1={$$typeof:O,_context:u};Object.defineProperties(b1,{Provider:{get:function(){if(!q0)q0=!0,_0("Rendering <Context.Consumer.Provider> is not supported and will be removed in a future major release. Did you mean to render <Context.Provider> instead?");return u.Provider},set:function(e0){u.Provider=e0}},_currentValue:{get:function(){return u._currentValue},set:function(e0){u._currentValue=e0}},_currentValue2:{get:function(){return u._currentValue2},set:function(e0){u._currentValue2=e0}},_threadCount:{get:function(){return u._threadCount},set:function(e0){u._threadCount=e0}},Consumer:{get:function(){if(!X0)X0=!0,_0("Rendering <Context.Consumer.Consumer> is not supported and will be removed in a future major release. Did you mean to render <Context.Consumer> instead?");return u.Consumer}},displayName:{get:function(){return u.displayName},set:function(e0){if(!y0)R0("Setting `displayName` on Context.Consumer has no effect. You should set it directly on the context with Context.displayName = '%s'.",e0),y0=!0}}}),u.Consumer=b1}return u._currentRenderer=null,u._currentRenderer2=null,u}var p5=-1,i6=0,c1=1,W4=2;function b4(N){if(N._status===p5){var u=N._result,X0=u();if(X0.then(function(b1){if(N._status===i6||N._status===p5){var e0=N;e0._status=c1,e0._result=b1}},function(b1){if(N._status===i6||N._status===p5){var e0=N;e0._status=W4,e0._result=b1}}),N._status===p5){var q0=N;q0._status=i6,q0._result=X0}}if(N._status===c1){var y0=N._result;if(y0===void 0)_0(`lazy: Expected the result of a dynamic import() call. Instead received: %s
|
|
2
|
+
|
|
3
|
+
Your code should look like:
|
|
4
|
+
const MyComponent = lazy(() => import('./MyComponent'))
|
|
5
|
+
|
|
6
|
+
Did you accidentally put curly braces around the import?`,y0);if(!("default"in y0))_0(`lazy: Expected the result of a dynamic import() call. Instead received: %s
|
|
7
|
+
|
|
8
|
+
Your code should look like:
|
|
9
|
+
const MyComponent = lazy(() => import('./MyComponent'))`,y0);return y0.default}else throw N._result}function z4(N){var u={_status:p5,_result:N},X0={$$typeof:R,_payload:u,_init:b4};{var q0,y0;Object.defineProperties(X0,{defaultProps:{configurable:!0,get:function(){return q0},set:function(b1){_0("React.lazy(...): It is not supported to assign `defaultProps` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),q0=b1,Object.defineProperty(X0,"defaultProps",{enumerable:!0})}},propTypes:{configurable:!0,get:function(){return y0},set:function(b1){_0("React.lazy(...): It is not supported to assign `propTypes` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),y0=b1,Object.defineProperty(X0,"propTypes",{enumerable:!0})}}})}return X0}function y(N){{if(N!=null&&N.$$typeof===A)_0("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...)).");else if(typeof N!=="function")_0("forwardRef requires a render function but was given %s.",N===null?"null":typeof N);else if(N.length!==0&&N.length!==2)_0("forwardRef render functions accept exactly two parameters: props and ref. %s",N.length===1?"Did you forget to use the ref parameter?":"Any additional parameter will be undefined.");if(N!=null){if(N.defaultProps!=null||N.propTypes!=null)_0("forwardRef render functions do not support propTypes or defaultProps. Did you accidentally pass a React component?")}}var u={$$typeof:F,render:N};{var X0;Object.defineProperty(u,"displayName",{enumerable:!1,configurable:!0,get:function(){return X0},set:function(q0){if(X0=q0,!N.name&&!N.displayName)N.displayName=q0}})}return u}var W0=Symbol.for("react.module.reference");function F0(N){if(typeof N==="string"||typeof N==="function")return!0;if(N===K||N===_||r||N===G||N===b||N===M||Q0||N===k||c||j||g)return!0;if(typeof N==="object"&&N!==null){if(N.$$typeof===R||N.$$typeof===A||N.$$typeof===W||N.$$typeof===O||N.$$typeof===F||N.$$typeof===W0||N.getModuleId!==void 0)return!0}return!1}function v(N,u){if(!F0(N))_0("memo: The first argument must be a component. Instead received: %s",N===null?"null":typeof N);var X0={$$typeof:A,type:N,compare:u===void 0?null:u};{var q0;Object.defineProperty(X0,"displayName",{enumerable:!1,configurable:!0,get:function(){return q0},set:function(y0){if(q0=y0,!N.name&&!N.displayName)N.displayName=y0}})}return X0}function o(){var N=f.current;if(N===null)_0(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
|
|
10
|
+
1. You might have mismatching versions of React and the renderer (such as React DOM)
|
|
11
|
+
2. You might be breaking the Rules of Hooks
|
|
12
|
+
3. You might have more than one copy of React in the same app
|
|
13
|
+
See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.`);return N}function N0(N){var u=o();if(N._context!==void 0){var X0=N._context;if(X0.Consumer===N)_0("Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be removed in a future major release. Did you mean to call useContext(Context) instead?");else if(X0.Provider===N)_0("Calling useContext(Context.Provider) is not supported. Did you mean to call useContext(Context) instead?")}return u.useContext(N)}function k0(N){var u=o();return u.useState(N)}function E0(N,u,X0){var q0=o();return q0.useReducer(N,u,X0)}function Q1(N){var u=o();return u.useRef(N)}function a0(N,u){var X0=o();return X0.useEffect(N,u)}function w0(N,u){var X0=o();return X0.useInsertionEffect(N,u)}function D0(N,u){var X0=o();return X0.useLayoutEffect(N,u)}function J1(N,u){var X0=o();return X0.useCallback(N,u)}function d1(N,u){var X0=o();return X0.useMemo(N,u)}function K4(N,u,X0){var q0=o();return q0.useImperativeHandle(N,u,X0)}function e5(N,u){{var X0=o();return X0.useDebugValue(N,u)}}function F6(){var N=o();return N.useTransition()}function y4(N){var u=o();return u.useDeferredValue(N)}function E1(){var N=o();return N.useId()}function C7(N,u,X0){var q0=o();return q0.useSyncExternalStore(N,u,X0)}var U7=0,dz,iz,oz,az,nz,rz,tz;function oX(){}oX.__reactDisabledLog=!0;function yJ(){{if(U7===0){dz=console.log,iz=console.info,oz=console.warn,az=console.error,nz=console.group,rz=console.groupCollapsed,tz=console.groupEnd;var N={configurable:!0,enumerable:!0,value:oX,writable:!0};Object.defineProperties(console,{info:N,log:N,warn:N,error:N,group:N,groupCollapsed:N,groupEnd:N})}U7++}}function sz(){{if(U7--,U7===0){var N={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:B0({},N,{value:dz}),info:B0({},N,{value:iz}),warn:B0({},N,{value:oz}),error:B0({},N,{value:az}),group:B0({},N,{value:nz}),groupCollapsed:B0({},N,{value:rz}),groupEnd:B0({},N,{value:tz})})}if(U7<0)_0("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var E8=U0.ReactCurrentDispatcher,V6;function Y8(N,u,X0){{if(V6===void 0)try{throw Error()}catch(y0){var q0=y0.stack.trim().match(/\n( *(at )?)/);V6=q0&&q0[1]||""}return`
|
|
14
|
+
`+V6+N}}var $8=!1,y2;{var ez=typeof WeakMap==="function"?WeakMap:Map;y2=new ez}function aX(N,u){if(!N||$8)return"";{var X0=y2.get(N);if(X0!==void 0)return X0}var q0;$8=!0;var y0=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var b1;b1=E8.current,E8.current=null,yJ();try{if(u){var e0=function(){throw Error()};if(Object.defineProperty(e0.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==="object"&&Reflect.construct){try{Reflect.construct(e0,[])}catch(Z4){q0=Z4}Reflect.construct(N,[],e0)}else{try{e0.call()}catch(Z4){q0=Z4}N.call(e0.prototype)}}else{try{throw Error()}catch(Z4){q0=Z4}N()}}catch(Z4){if(Z4&&q0&&typeof Z4.stack==="string"){var T1=Z4.stack.split(`
|
|
15
|
+
`),i1=q0.stack.split(`
|
|
16
|
+
`),O4=T1.length-1,I4=i1.length-1;while(O4>=1&&I4>=0&&T1[O4]!==i1[I4])I4--;for(;O4>=1&&I4>=0;O4--,I4--)if(T1[O4]!==i1[I4]){if(O4!==1||I4!==1)do if(O4--,I4--,I4<0||T1[O4]!==i1[I4]){var T4=`
|
|
17
|
+
`+T1[O4].replace(" at new "," at ");if(N.displayName&&T4.includes("<anonymous>"))T4=T4.replace("<anonymous>",N.displayName);if(typeof N==="function")y2.set(N,T4);return T4}while(O4>=1&&I4>=0);break}}}finally{$8=!1,E8.current=b1,sz(),Error.prepareStackTrace=y0}var m4=N?N.displayName||N.name:"",a4=m4?Y8(m4):"";if(typeof N==="function")y2.set(N,a4);return a4}function zQ(N,u,X0){return aX(N,!1)}function VJ(N){var u=N.prototype;return!!(u&&u.isReactComponent)}function H8(N,u,X0){if(N==null)return"";if(typeof N==="function")return aX(N,VJ(N));if(typeof N==="string")return Y8(N);switch(N){case b:return Y8("Suspense");case M:return Y8("SuspenseList")}if(typeof N==="object")switch(N.$$typeof){case F:return zQ(N.render);case A:return H8(N.type,u,X0);case R:{var q0=N,y0=q0._payload,b1=q0._init;try{return H8(b1(y0),u,X0)}catch(e0){}}}return""}var nX={},QQ=U0.ReactDebugCurrentFrame;function V2(N){if(N){var u=N._owner,X0=H8(N.type,N._source,u?u.type:null);QQ.setExtraStackFrame(X0)}else QQ.setExtraStackFrame(null)}function rX(N,u,X0,q0,y0){{var b1=Function.call.bind(n1);for(var e0 in N)if(b1(N,e0)){var T1=void 0;try{if(typeof N[e0]!=="function"){var i1=Error((q0||"React class")+": "+X0+" type `"+e0+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof N[e0]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw i1.name="Invariant Violation",i1}T1=N[e0](u,e0,q0,X0,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(O4){T1=O4}if(T1&&!(T1 instanceof Error))V2(y0),_0("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",q0||"React class",X0,e0,typeof T1),V2(null);if(T1 instanceof Error&&!(T1.message in nX))nX[T1.message]=!0,V2(y0),_0("Failed %s type: %s",X0,T1.message),V2(null)}}}function s1(N){if(N){var u=N._owner,X0=H8(N.type,N._source,u?u.type:null);n(X0)}else n(null)}var tX=!1;function XQ(){if(m.current){var N=h1(m.current.type);if(N)return`
|
|
18
|
+
|
|
19
|
+
Check the render method of \``+N+"`."}return""}function g1(N){if(N!==void 0){var u=N.fileName.replace(/^.*[\\\/]/,""),X0=N.lineNumber;return`
|
|
20
|
+
|
|
21
|
+
Check your code at `+u+":"+X0+"."}return""}function sX(N){if(N!==null&&N!==void 0)return g1(N.__source);return""}var j5={};function x8(N){var u=XQ();if(!u){var X0=typeof N==="string"?N:N.displayName||N.name;if(X0)u=`
|
|
22
|
+
|
|
23
|
+
Check the top-level render call using <`+X0+">."}return u}function G8(N,u){if(!N._store||N._store.validated||N.key!=null)return;N._store.validated=!0;var X0=x8(u);if(j5[X0])return;j5[X0]=!0;var q0="";if(N&&N._owner&&N._owner!==m.current)q0=" It was passed a child from "+h1(N._owner.type)+".";s1(N),_0('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',X0,q0),s1(null)}function eX(N,u){if(typeof N!=="object")return;if(O0(N))for(var X0=0;X0<N.length;X0++){var q0=N[X0];if(K1(q0))G8(q0,u)}else if(K1(N)){if(N._store)N._store.validated=!0}else if(N){var y0=x(N);if(typeof y0==="function"){if(y0!==N.entries){var b1=y0.call(N),e0;while(!(e0=b1.next()).done)if(K1(e0.value))G8(e0.value,u)}}}}function F5(N){{var u=N.type;if(u===null||u===void 0||typeof u==="string")return;var X0;if(typeof u==="function")X0=u.propTypes;else if(typeof u==="object"&&(u.$$typeof===F||u.$$typeof===A))X0=u.propTypes;else return;if(X0){var q0=h1(u);rX(X0,N.props,"prop",q0,N)}else if(u.PropTypes!==void 0&&!tX){tX=!0;var y0=h1(u);_0("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",y0||"Unknown")}if(typeof u.getDefaultProps==="function"&&!u.getDefaultProps.isReactClassApproved)_0("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function l4(N){{var u=Object.keys(N.props);for(var X0=0;X0<u.length;X0++){var q0=u[X0];if(q0!=="children"&&q0!=="key"){s1(N),_0("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",q0),s1(null);break}}if(N.ref!==null)s1(N),_0("Invalid attribute `ref` supplied to `React.Fragment`."),s1(null)}}function zZ(N,u,X0){var q0=F0(N);if(!q0){var y0="";if(N===void 0||typeof N==="object"&&N!==null&&Object.keys(N).length===0)y0+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.";var b1=sX(u);if(b1)y0+=b1;else y0+=XQ();var e0;if(N===null)e0="null";else if(O0(N))e0="array";else if(N!==void 0&&N.$$typeof===H)e0="<"+(h1(N.type)||"Unknown")+" />",y0=" Did you accidentally export a JSX literal instead of a component?";else e0=typeof N;_0("React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",e0,y0)}var T1=X5.apply(this,arguments);if(T1==null)return T1;if(q0)for(var i1=2;i1<arguments.length;i1++)eX(arguments[i1],N);if(N===K)l4(T1);else F5(T1);return T1}var b6=!1;function q6(N){var u=zZ.bind(null,N);u.type=N;{if(!b6)b6=!0,R0("React.createFactory() is deprecated and will be removed in a future major release. Consider using JSX or use React.createElement() directly instead.");Object.defineProperty(u,"type",{enumerable:!1,get:function(){return R0("Factory.type is deprecated. Access the class directly before passing it to createFactory."),Object.defineProperty(this,"type",{value:N}),N}})}return u}function W7(N,u,X0){var q0=$1.apply(this,arguments);for(var y0=2;y0<arguments.length;y0++)eX(arguments[y0],q0.type);return F5(q0),q0}function DJ(N,u){var X0=l.transition;l.transition={};var q0=l.transition;l.transition._updatedFibers=new Set;try{N()}finally{if(l.transition=X0,X0===null&&q0._updatedFibers){var y0=q0._updatedFibers.size;if(y0>10)R0("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table.");q0._updatedFibers.clear()}}}var D2=!1,p8=null;function QZ(N){if(p8===null)try{var u=("require"+Math.random()).slice(0,7),X0=BJ&&BJ[u];p8=X0.call(BJ,"timers").setImmediate}catch(q0){p8=function(y0){if(D2===!1){if(D2=!0,typeof MessageChannel>"u")_0("This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning.")}var b1=new MessageChannel;b1.port1.onmessage=y0,b1.port2.postMessage(void 0)}}return p8(N)}var q8=0,XZ=!1;function ZZ(N){{var u=q8;if(q8++,T.current===null)T.current=[];var X0=T.isBatchingLegacy,q0;try{if(T.isBatchingLegacy=!0,q0=N(),!X0&&T.didScheduleLegacyUpdate){var y0=T.current;if(y0!==null)T.didScheduleLegacyUpdate=!1,g2(y0)}}catch(m4){throw v7(u),m4}finally{T.isBatchingLegacy=X0}if(q0!==null&&typeof q0==="object"&&typeof q0.then==="function"){var b1=q0,e0=!1,T1={then:function(m4,a4){e0=!0,b1.then(function(Z4){if(v7(u),q8===0)m2(Z4,m4,a4);else m4(Z4)},function(Z4){v7(u),a4(Z4)})}};if(!XZ&&typeof Promise<"u")Promise.resolve().then(function(){}).then(function(){if(!e0)XZ=!0,_0("You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);")});return T1}else{var i1=q0;if(v7(u),q8===0){var O4=T.current;if(O4!==null)g2(O4),T.current=null;var I4={then:function(m4,a4){if(T.current===null)T.current=[],m2(i1,m4,a4);else m4(i1)}};return I4}else{var T4={then:function(m4,a4){m4(i1)}};return T4}}}}function v7(N){{if(N!==q8-1)_0("You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. ");q8=N}}function m2(N,u,X0){{var q0=T.current;if(q0!==null)try{g2(q0),QZ(function(){if(q0.length===0)T.current=null,u(N);else m2(N,u,X0)})}catch(y0){X0(y0)}else u(N)}}var B8=!1;function g2(N){if(!B8){B8=!0;var u=0;try{for(;u<N.length;u++){var X0=N[u];do X0=X0(!0);while(X0!==null)}N.length=0}catch(q0){throw N=N.slice(u+1),q0}finally{B8=!1}}}var JZ=zZ,YZ=W7,$Z=q6,HZ={map:w5,forEach:q7,count:s5,toArray:d6,only:B7};if(YA.Children=HZ,YA.Component=h0,YA.Fragment=K,YA.Profiler=_,YA.PureComponent=m0,YA.StrictMode=G,YA.Suspense=b,YA.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=U0,YA.act=ZZ,YA.cloneElement=YZ,YA.createContext=y6,YA.createElement=JZ,YA.createFactory=$Z,YA.createRef=R1,YA.forwardRef=y,YA.isValidElement=K1,YA.lazy=z4,YA.memo=v,YA.startTransition=DJ,YA.unstable_act=ZZ,YA.useCallback=J1,YA.useContext=N0,YA.useDebugValue=e5,YA.useDeferredValue=y4,YA.useEffect=a0,YA.useId=E1,YA.useImperativeHandle=K4,YA.useInsertionEffect=w0,YA.useLayoutEffect=D0,YA.useMemo=d1,YA.useReducer=E0,YA.useRef=Q1,YA.useState=k0,YA.useSyncExternalStore=C7,YA.useTransition=F6,YA.version=Y,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==="function")__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()});var vK=M2(($A)=>{(function(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==="function")__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var Y=!1,H=!1,B=5;function K(g0,$1){var K1=g0.length;g0.push($1),W(g0,$1,K1)}function G(g0){return g0.length===0?null:g0[0]}function _(g0){if(g0.length===0)return null;var $1=g0[0],K1=g0.pop();if(K1!==$1)g0[0]=K1,O(g0,K1,0);return $1}function W(g0,$1,K1){var r1=K1;while(r1>0){var U4=r1-1>>>1,x4=g0[U4];if(F(x4,$1)>0)g0[U4]=$1,g0[r1]=x4,r1=U4;else return}}function O(g0,$1,K1){var r1=K1,U4=g0.length,x4=U4>>>1;while(r1<x4){var w4=(r1+1)*2-1,z5=g0[w4],V1=w4+1,S1=g0[V1];if(F(z5,$1)<0)if(V1<U4&&F(S1,z5)<0)g0[r1]=S1,g0[V1]=$1,r1=V1;else g0[r1]=z5,g0[w4]=$1,r1=w4;else if(V1<U4&&F(S1,$1)<0)g0[r1]=S1,g0[V1]=$1,r1=V1;else return}}function F(g0,$1){var K1=g0.sortIndex-$1.sortIndex;return K1!==0?K1:g0.id-$1.id}var b=1,M=2,A=3,R=4,k=5;function S(g0,$1){}var V=typeof performance==="object"&&typeof performance.now==="function";if(V){var x=performance;$A.unstable_now=function(){return x.now()}}else{var f=Date,l=f.now();$A.unstable_now=function(){return f.now()-l}}var T=1073741823,m=-1,E=250,D=5000,n=1e4,c=T,j=[],g=[],Q0=1,r=null,U0=A,R0=!1,_0=!1,f0=!1,P0=typeof setTimeout==="function"?setTimeout:null,a=typeof clearTimeout==="function"?clearTimeout:null,Y0=typeof setImmediate<"u"?setImmediate:null,B0=typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0?navigator.scheduling.isInputPending.bind(navigator.scheduling):null;function G0(g0){var $1=G(g);while($1!==null){if($1.callback===null)_(g);else if($1.startTime<=g0)_(g),$1.sortIndex=$1.expirationTime,K(j,$1);else return;$1=G(g)}}function h0(g0){if(f0=!1,G0(g0),!_0)if(G(j)!==null)_0=!0,D4(z0);else{var $1=G(g);if($1!==null)M5(h0,$1.startTime-g0)}}function z0(g0,$1){if(_0=!1,f0)f0=!1,x5();R0=!0;var K1=U0;try{if(H)try{return v0(g0,$1)}catch(U4){if(r!==null){var r1=$A.unstable_now();S(r,r1),r.isQueued=!1}throw U4}else return v0(g0,$1)}finally{r=null,U0=K1,R0=!1}}function v0(g0,$1){var K1=$1;G0(K1),r=G(j);while(r!==null&&!Y){if(r.expirationTime>K1&&(!g0||n1()))break;var r1=r.callback;if(typeof r1==="function"){r.callback=null,U0=r.priorityLevel;var U4=r.expirationTime<=K1,x4=r1(U4);if(K1=$A.unstable_now(),typeof x4==="function")r.callback=x4;else if(r===G(j))_(j);G0(K1)}else _(j);r=G(j)}if(r!==null)return!0;else{var w4=G(g);if(w4!==null)M5(h0,w4.startTime-K1);return!1}}function j0(g0,$1){switch(g0){case b:case M:case A:case R:case k:break;default:g0=A}var K1=U0;U0=g0;try{return $1()}finally{U0=K1}}function Y1(g0){var $1;switch(U0){case b:case M:case A:$1=A;break;default:$1=U0;break}var K1=U0;U0=$1;try{return g0()}finally{U0=K1}}function m0(g0){var $1=U0;return function(){var K1=U0;U0=$1;try{return g0.apply(this,arguments)}finally{U0=K1}}}function F1(g0,$1,K1){var r1=$A.unstable_now(),U4;if(typeof K1==="object"&&K1!==null){var x4=K1.delay;if(typeof x4==="number"&&x4>0)U4=r1+x4;else U4=r1}else U4=r1;var w4;switch(g0){case b:w4=m;break;case M:w4=E;break;case k:w4=c;break;case R:w4=n;break;case A:default:w4=D;break}var z5=U4+w4,V1={id:Q0++,callback:$1,priorityLevel:g0,startTime:U4,expirationTime:z5,sortIndex:-1};if(U4>r1){if(V1.sortIndex=U4,K(g,V1),G(j)===null&&V1===G(g)){if(f0)x5();else f0=!0;M5(h0,U4-r1)}}else if(V1.sortIndex=z5,K(j,V1),!_0&&!R0)_0=!0,D4(z0);return V1}function R1(){}function p(){if(!_0&&!R0)_0=!0,D4(z0)}function O0(){return G(j)}function V0(g0){g0.callback=null}function q1(){return U0}var y1=!1,M1=null,A0=-1,Z1=B,h1=-1;function n1(){var g0=$A.unstable_now()-h1;if(g0<Z1)return!1;return!0}function f4(){}function B4(g0){if(g0<0||g0>125){console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported");return}if(g0>0)Z1=Math.floor(1000/g0);else Z1=B}var T5=function(){if(M1!==null){var g0=$A.unstable_now();h1=g0;var $1=!0,K1=!0;try{K1=M1($1,g0)}finally{if(K1)A4();else y1=!1,M1=null}}else y1=!1},A4;if(typeof Y0==="function")A4=function(){Y0(T5)};else if(typeof MessageChannel<"u"){var k5=new MessageChannel,h4=k5.port2;k5.port1.onmessage=T5,A4=function(){h4.postMessage(null)}}else A4=function(){P0(T5,0)};function D4(g0){if(M1=g0,!y1)y1=!0,A4()}function M5(g0,$1){A0=P0(function(){g0($A.unstable_now())},$1)}function x5(){a(A0),A0=-1}var o4=f4,X5=null;if($A.unstable_IdlePriority=k,$A.unstable_ImmediatePriority=b,$A.unstable_LowPriority=R,$A.unstable_NormalPriority=A,$A.unstable_Profiling=X5,$A.unstable_UserBlockingPriority=M,$A.unstable_cancelCallback=V0,$A.unstable_continueExecution=p,$A.unstable_forceFrameRate=B4,$A.unstable_getCurrentPriorityLevel=q1,$A.unstable_getFirstCallbackNode=O0,$A.unstable_next=Y1,$A.unstable_pauseExecution=R1,$A.unstable_requestPaint=o4,$A.unstable_runWithPriority=j0,$A.unstable_scheduleCallback=F1,$A.unstable_shouldYield=n1,$A.unstable_wrapCallback=m0,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==="function")__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()});var SK=M2((HA)=>{var DX=H0(D1()),R4=H0(vK());(function(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==="function")__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var Y=DX.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,H=!1;function B(z){H=z}function K(z){if(!H){for(var Q=arguments.length,X=Array(Q>1?Q-1:0),Z=1;Z<Q;Z++)X[Z-1]=arguments[Z];_("warn",z,X)}}function G(z){if(!H){for(var Q=arguments.length,X=Array(Q>1?Q-1:0),Z=1;Z<Q;Z++)X[Z-1]=arguments[Z];_("error",z,X)}}function _(z,Q,X){{var Z=Y.ReactDebugCurrentFrame,J=Z.getStackAddendum();if(J!=="")Q+="%s",X=X.concat([J]);var $=X.map(function(q){return String(q)});$.unshift("Warning: "+Q),Function.prototype.apply.call(console[z],console,$)}}var W=0,O=1,F=2,b=3,M=4,A=5,R=6,k=7,S=8,V=9,x=10,f=11,l=12,T=13,m=14,E=15,D=16,n=17,c=18,j=19,g=21,Q0=22,r=23,U0=24,R0=25,_0=!0,f0=!1,P0=!1,a=!1,Y0=!1,B0=!0,G0=!1,h0=!0,z0=!0,v0=!0,j0=!0,Y1=new Set,m0={},F1={};function R1(z,Q){p(z,Q),p(z+"Capture",Q)}function p(z,Q){if(m0[z])G("EventRegistry: More than one plugin attempted to publish the same registration name, `%s`.",z);m0[z]=Q;{var X=z.toLowerCase();if(F1[X]=z,z==="onDoubleClick")F1.ondblclick=z}for(var Z=0;Z<Q.length;Z++)Y1.add(Q[Z])}var O0=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",V0=Object.prototype.hasOwnProperty;function q1(z){{var Q=typeof Symbol==="function"&&Symbol.toStringTag,X=Q&&z[Symbol.toStringTag]||z.constructor.name||"Object";return X}}function y1(z){try{return M1(z),!1}catch(Q){return!0}}function M1(z){return""+z}function A0(z,Q){if(y1(z))return G("The provided `%s` attribute is an unsupported type %s. This value must be coerced to a string before before using it here.",Q,q1(z)),M1(z)}function Z1(z){if(y1(z))return G("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",q1(z)),M1(z)}function h1(z,Q){if(y1(z))return G("The provided `%s` prop is an unsupported type %s. This value must be coerced to a string before before using it here.",Q,q1(z)),M1(z)}function n1(z,Q){if(y1(z))return G("The provided `%s` CSS property is an unsupported type %s. This value must be coerced to a string before before using it here.",Q,q1(z)),M1(z)}function f4(z){if(y1(z))return G("The provided HTML markup uses a value of unsupported type %s. This value must be coerced to a string before before using it here.",q1(z)),M1(z)}function B4(z){if(y1(z))return G("Form field values (value, checked, defaultValue, or defaultChecked props) must be strings, not %s. This value must be coerced to a string before before using it here.",q1(z)),M1(z)}var T5=0,A4=1,k5=2,h4=3,D4=4,M5=5,x5=6,o4=":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",X5=o4+"\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",g0=new RegExp("^["+o4+"]["+X5+"]*$"),$1={},K1={};function r1(z){if(V0.call(K1,z))return!0;if(V0.call($1,z))return!1;if(g0.test(z))return K1[z]=!0,!0;return $1[z]=!0,G("Invalid attribute name: `%s`",z),!1}function U4(z,Q,X){if(Q!==null)return Q.type===T5;if(X)return!1;if(z.length>2&&(z[0]==="o"||z[0]==="O")&&(z[1]==="n"||z[1]==="N"))return!0;return!1}function x4(z,Q,X,Z){if(X!==null&&X.type===T5)return!1;switch(typeof Q){case"function":case"symbol":return!0;case"boolean":{if(Z)return!1;if(X!==null)return!X.acceptsBooleans;else{var J=z.toLowerCase().slice(0,5);return J!=="data-"&&J!=="aria-"}}default:return!1}}function w4(z,Q,X,Z){if(Q===null||typeof Q>"u")return!0;if(x4(z,Q,X,Z))return!0;if(Z)return!1;if(X!==null)switch(X.type){case h4:return!Q;case D4:return Q===!1;case M5:return isNaN(Q);case x5:return isNaN(Q)||Q<1}return!1}function z5(z){return S1.hasOwnProperty(z)?S1[z]:null}function V1(z,Q,X,Z,J,$,q){this.acceptsBooleans=Q===k5||Q===h4||Q===D4,this.attributeName=Z,this.attributeNamespace=J,this.mustUseProperty=X,this.propertyName=z,this.type=Q,this.sanitizeURL=$,this.removeEmptyString=q}var S1={},t5=["children","dangerouslySetInnerHTML","defaultValue","defaultChecked","innerHTML","suppressContentEditableWarning","suppressHydrationWarning","style"];t5.forEach(function(z){S1[z]=new V1(z,T5,!1,z,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(z){var Q=z[0],X=z[1];S1[Q]=new V1(Q,A4,!1,X,null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(z){S1[z]=new V1(z,k5,!1,z.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(z){S1[z]=new V1(z,k5,!1,z,null,!1,!1)}),["allowFullScreen","async","autoFocus","autoPlay","controls","default","defer","disabled","disablePictureInPicture","disableRemotePlayback","formNoValidate","hidden","loop","noModule","noValidate","open","playsInline","readOnly","required","reversed","scoped","seamless","itemScope"].forEach(function(z){S1[z]=new V1(z,h4,!1,z.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(z){S1[z]=new V1(z,h4,!0,z,null,!1,!1)}),["capture","download"].forEach(function(z){S1[z]=new V1(z,D4,!1,z,null,!1,!1)}),["cols","rows","size","span"].forEach(function(z){S1[z]=new V1(z,x5,!1,z,null,!1,!1)}),["rowSpan","start"].forEach(function(z){S1[z]=new V1(z,M5,!1,z.toLowerCase(),null,!1,!1)});var w5=/[\-\:]([a-z])/g,s5=function(z){return z[1].toUpperCase()};["accent-height","alignment-baseline","arabic-form","baseline-shift","cap-height","clip-path","clip-rule","color-interpolation","color-interpolation-filters","color-profile","color-rendering","dominant-baseline","enable-background","fill-opacity","fill-rule","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","glyph-name","glyph-orientation-horizontal","glyph-orientation-vertical","horiz-adv-x","horiz-origin-x","image-rendering","letter-spacing","lighting-color","marker-end","marker-mid","marker-start","overline-position","overline-thickness","paint-order","panose-1","pointer-events","rendering-intent","shape-rendering","stop-color","stop-opacity","strikethrough-position","strikethrough-thickness","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-anchor","text-decoration","text-rendering","underline-position","underline-thickness","unicode-bidi","unicode-range","units-per-em","v-alphabetic","v-hanging","v-ideographic","v-mathematical","vector-effect","vert-adv-y","vert-origin-x","vert-origin-y","word-spacing","writing-mode","xmlns:xlink","x-height"].forEach(function(z){var Q=z.replace(w5,s5);S1[Q]=new V1(Q,A4,!1,z,null,!1,!1)}),["xlink:actuate","xlink:arcrole","xlink:role","xlink:show","xlink:title","xlink:type"].forEach(function(z){var Q=z.replace(w5,s5);S1[Q]=new V1(Q,A4,!1,z,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(z){var Q=z.replace(w5,s5);S1[Q]=new V1(Q,A4,!1,z,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(z){S1[z]=new V1(z,A4,!1,z.toLowerCase(),null,!1,!1)});var q7="xlinkHref";S1[q7]=new V1("xlinkHref",A4,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(z){S1[z]=new V1(z,A4,!1,z.toLowerCase(),null,!0,!0)});var d6=/^[\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,B7=!1;function y6(z){if(!B7&&d6.test(z))B7=!0,G("A future version of React will block javascript: URLs as a security precaution. Use event handlers instead if you can. If you need to generate unsafe HTML try using dangerouslySetInnerHTML instead. React was passed %s.",JSON.stringify(z))}function p5(z,Q,X,Z){if(Z.mustUseProperty){var J=Z.propertyName;return z[J]}else{if(A0(X,Q),Z.sanitizeURL)y6(""+X);var $=Z.attributeName,q=null;if(Z.type===D4){if(z.hasAttribute($)){var U=z.getAttribute($);if(U==="")return!0;if(w4(Q,X,Z,!1))return U;if(U===""+X)return X;return U}}else if(z.hasAttribute($)){if(w4(Q,X,Z,!1))return z.getAttribute($);if(Z.type===h4)return X;q=z.getAttribute($)}if(w4(Q,X,Z,!1))return q===null?X:q;else if(q===""+X)return X;else return q}}function i6(z,Q,X,Z){{if(!r1(Q))return;if(!z.hasAttribute(Q))return X===void 0?void 0:null;var J=z.getAttribute(Q);if(A0(X,Q),J===""+X)return X;return J}}function c1(z,Q,X,Z){var J=z5(Q);if(U4(Q,J,Z))return;if(w4(Q,X,J,Z))X=null;if(Z||J===null){if(r1(Q)){var $=Q;if(X===null)z.removeAttribute($);else A0(X,Q),z.setAttribute($,""+X)}return}var q=J.mustUseProperty;if(q){var U=J.propertyName;if(X===null){var L=J.type;z[U]=L===h4?!1:""}else z[U]=X;return}var{attributeName:P,attributeNamespace:C}=J;if(X===null)z.removeAttribute(P);else{var i=J.type,d;if(i===h4||i===D4&&X===!0)d="";else if(A0(X,P),d=""+X,J.sanitizeURL)y6(d.toString());if(C)z.setAttributeNS(C,P,d);else z.setAttribute(P,d)}}var W4=Symbol.for("react.element"),b4=Symbol.for("react.portal"),z4=Symbol.for("react.fragment"),y=Symbol.for("react.strict_mode"),W0=Symbol.for("react.profiler"),F0=Symbol.for("react.provider"),v=Symbol.for("react.context"),o=Symbol.for("react.forward_ref"),N0=Symbol.for("react.suspense"),k0=Symbol.for("react.suspense_list"),E0=Symbol.for("react.memo"),Q1=Symbol.for("react.lazy"),a0=Symbol.for("react.scope"),w0=Symbol.for("react.debug_trace_mode"),D0=Symbol.for("react.offscreen"),J1=Symbol.for("react.legacy_hidden"),d1=Symbol.for("react.cache"),K4=Symbol.for("react.tracing_marker"),e5=Symbol.iterator,F6="@@iterator";function y4(z){if(z===null||typeof z!=="object")return null;var Q=e5&&z[e5]||z[F6];if(typeof Q==="function")return Q;return null}var E1=Object.assign,C7=0,U7,dz,iz,oz,az,nz,rz;function tz(){}tz.__reactDisabledLog=!0;function oX(){{if(C7===0){U7=console.log,dz=console.info,iz=console.warn,oz=console.error,az=console.group,nz=console.groupCollapsed,rz=console.groupEnd;var z={configurable:!0,enumerable:!0,value:tz,writable:!0};Object.defineProperties(console,{info:z,log:z,warn:z,error:z,group:z,groupCollapsed:z,groupEnd:z})}C7++}}function yJ(){{if(C7--,C7===0){var z={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:E1({},z,{value:U7}),info:E1({},z,{value:dz}),warn:E1({},z,{value:iz}),error:E1({},z,{value:oz}),group:E1({},z,{value:az}),groupCollapsed:E1({},z,{value:nz}),groupEnd:E1({},z,{value:rz})})}if(C7<0)G("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var sz=Y.ReactCurrentDispatcher,E8;function V6(z,Q,X){{if(E8===void 0)try{throw Error()}catch(J){var Z=J.stack.trim().match(/\n( *(at )?)/);E8=Z&&Z[1]||""}return`
|
|
24
|
+
`+E8+z}}var Y8=!1,$8;{var y2=typeof WeakMap==="function"?WeakMap:Map;$8=new y2}function ez(z,Q){if(!z||Y8)return"";{var X=$8.get(z);if(X!==void 0)return X}var Z;Y8=!0;var J=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var $;$=sz.current,sz.current=null,oX();try{if(Q){var q=function(){throw Error()};if(Object.defineProperty(q.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==="object"&&Reflect.construct){try{Reflect.construct(q,[])}catch(J0){Z=J0}Reflect.construct(z,[],q)}else{try{q.call()}catch(J0){Z=J0}z.call(q.prototype)}}else{try{throw Error()}catch(J0){Z=J0}z()}}catch(J0){if(J0&&Z&&typeof J0.stack==="string"){var U=J0.stack.split(`
|
|
25
|
+
`),L=Z.stack.split(`
|
|
26
|
+
`),P=U.length-1,C=L.length-1;while(P>=1&&C>=0&&U[P]!==L[C])C--;for(;P>=1&&C>=0;P--,C--)if(U[P]!==L[C]){if(P!==1||C!==1)do if(P--,C--,C<0||U[P]!==L[C]){var i=`
|
|
27
|
+
`+U[P].replace(" at new "," at ");if(z.displayName&&i.includes("<anonymous>"))i=i.replace("<anonymous>",z.displayName);if(typeof z==="function")$8.set(z,i);return i}while(P>=1&&C>=0);break}}}finally{Y8=!1,sz.current=$,yJ(),Error.prepareStackTrace=J}var d=z?z.displayName||z.name:"",Z0=d?V6(d):"";if(typeof z==="function")$8.set(z,Z0);return Z0}function aX(z,Q,X){return ez(z,!0)}function zQ(z,Q,X){return ez(z,!1)}function VJ(z){var Q=z.prototype;return!!(Q&&Q.isReactComponent)}function H8(z,Q,X){if(z==null)return"";if(typeof z==="function")return ez(z,VJ(z));if(typeof z==="string")return V6(z);switch(z){case N0:return V6("Suspense");case k0:return V6("SuspenseList")}if(typeof z==="object")switch(z.$$typeof){case o:return zQ(z.render);case E0:return H8(z.type,Q,X);case Q1:{var Z=z,J=Z._payload,$=Z._init;try{return H8($(J),Q,X)}catch(q){}}}return""}function nX(z){var Q=z._debugOwner?z._debugOwner.type:null,X=z._debugSource;switch(z.tag){case A:return V6(z.type);case D:return V6("Lazy");case T:return V6("Suspense");case j:return V6("SuspenseList");case W:case F:case E:return zQ(z.type);case f:return zQ(z.type.render);case O:return aX(z.type);default:return""}}function QQ(z){try{var Q="",X=z;do Q+=nX(X),X=X.return;while(X);return Q}catch(Z){return`
|
|
28
|
+
Error generating stack: `+Z.message+`
|
|
29
|
+
`+Z.stack}}function V2(z,Q,X){var Z=z.displayName;if(Z)return Z;var J=Q.displayName||Q.name||"";return J!==""?X+"("+J+")":X}function rX(z){return z.displayName||"Context"}function s1(z){if(z==null)return null;if(typeof z.tag==="number")G("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.");if(typeof z==="function")return z.displayName||z.name||null;if(typeof z==="string")return z;switch(z){case z4:return"Fragment";case b4:return"Portal";case W0:return"Profiler";case y:return"StrictMode";case N0:return"Suspense";case k0:return"SuspenseList"}if(typeof z==="object")switch(z.$$typeof){case v:var Q=z;return rX(Q)+".Consumer";case F0:var X=z;return rX(X._context)+".Provider";case o:return V2(z,z.render,"ForwardRef");case E0:var Z=z.displayName||null;if(Z!==null)return Z;return s1(z.type)||"Memo";case Q1:{var J=z,$=J._payload,q=J._init;try{return s1(q($))}catch(U){return null}}}return null}function tX(z,Q,X){var Z=Q.displayName||Q.name||"";return z.displayName||(Z!==""?X+"("+Z+")":X)}function XQ(z){return z.displayName||"Context"}function g1(z){var{tag:Q,type:X}=z;switch(Q){case U0:return"Cache";case V:var Z=X;return XQ(Z)+".Consumer";case x:var J=X;return XQ(J._context)+".Provider";case c:return"DehydratedFragment";case f:return tX(X,X.render,"ForwardRef");case k:return"Fragment";case A:return X;case M:return"Portal";case b:return"Root";case R:return"Text";case D:return s1(X);case S:if(X===y)return"StrictMode";return"Mode";case Q0:return"Offscreen";case l:return"Profiler";case g:return"Scope";case T:return"Suspense";case j:return"SuspenseList";case R0:return"TracingMarker";case O:case W:case n:case F:case m:case E:if(typeof X==="function")return X.displayName||X.name||null;if(typeof X==="string")return X;break}return null}var sX=Y.ReactDebugCurrentFrame,j5=null,x8=!1;function G8(){{if(j5===null)return null;var z=j5._debugOwner;if(z!==null&&typeof z<"u")return g1(z)}return null}function eX(){{if(j5===null)return"";return QQ(j5)}}function F5(){sX.getCurrentStack=null,j5=null,x8=!1}function l4(z){sX.getCurrentStack=z===null?null:eX,j5=z,x8=!1}function zZ(){return j5}function b6(z){x8=z}function q6(z){return""+z}function W7(z){switch(typeof z){case"boolean":case"number":case"string":case"undefined":return z;case"object":return B4(z),z;default:return""}}var DJ={button:!0,checkbox:!0,image:!0,hidden:!0,radio:!0,reset:!0,submit:!0};function D2(z,Q){{if(!(DJ[Q.type]||Q.onChange||Q.onInput||Q.readOnly||Q.disabled||Q.value==null))G("You provided a `value` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultValue`. Otherwise, set either `onChange` or `readOnly`.");if(!(Q.onChange||Q.readOnly||Q.disabled||Q.checked==null))G("You provided a `checked` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultChecked`. Otherwise, set either `onChange` or `readOnly`.")}}function p8(z){var{type:Q,nodeName:X}=z;return X&&X.toLowerCase()==="input"&&(Q==="checkbox"||Q==="radio")}function QZ(z){return z._valueTracker}function q8(z){z._valueTracker=null}function XZ(z){var Q="";if(!z)return Q;if(p8(z))Q=z.checked?"true":"false";else Q=z.value;return Q}function ZZ(z){var Q=p8(z)?"checked":"value",X=Object.getOwnPropertyDescriptor(z.constructor.prototype,Q);B4(z[Q]);var Z=""+z[Q];if(z.hasOwnProperty(Q)||typeof X>"u"||typeof X.get!=="function"||typeof X.set!=="function")return;var{get:J,set:$}=X;Object.defineProperty(z,Q,{configurable:!0,get:function(){return J.call(this)},set:function(U){B4(U),Z=""+U,$.call(this,U)}}),Object.defineProperty(z,Q,{enumerable:X.enumerable});var q={getValue:function(){return Z},setValue:function(U){B4(U),Z=""+U},stopTracking:function(){q8(z),delete z[Q]}};return q}function v7(z){if(QZ(z))return;z._valueTracker=ZZ(z)}function m2(z){if(!z)return!1;var Q=QZ(z);if(!Q)return!0;var X=Q.getValue(),Z=XZ(z);if(Z!==X)return Q.setValue(Z),!0;return!1}function B8(z){if(z=z||(typeof document<"u"?document:void 0),typeof z>"u")return null;try{return z.activeElement||z.body}catch(Q){return z.body}}var g2=!1,JZ=!1,YZ=!1,$Z=!1;function HZ(z){var Q=z.type==="checkbox"||z.type==="radio";return Q?z.checked!=null:z.value!=null}function N(z,Q){var X=z,Z=Q.checked,J=E1({},Q,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:Z!=null?Z:X._wrapperState.initialChecked});return J}function u(z,Q){{if(D2("input",Q),Q.checked!==void 0&&Q.defaultChecked!==void 0&&!JZ)G("%s contains an input of type %s with both checked and defaultChecked props. Input elements must be either controlled or uncontrolled (specify either the checked prop, or the defaultChecked prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props. More info: https://reactjs.org/link/controlled-components",G8()||"A component",Q.type),JZ=!0;if(Q.value!==void 0&&Q.defaultValue!==void 0&&!g2)G("%s contains an input of type %s with both value and defaultValue props. Input elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props. More info: https://reactjs.org/link/controlled-components",G8()||"A component",Q.type),g2=!0}var X=z,Z=Q.defaultValue==null?"":Q.defaultValue;X._wrapperState={initialChecked:Q.checked!=null?Q.checked:Q.defaultChecked,initialValue:W7(Q.value!=null?Q.value:Z),controlled:HZ(Q)}}function X0(z,Q){var X=z,Z=Q.checked;if(Z!=null)c1(X,"checked",Z,!1)}function q0(z,Q){var X=z;{var Z=HZ(Q);if(!X._wrapperState.controlled&&Z&&!$Z)G("A component is changing an uncontrolled input to be controlled. This is likely caused by the value changing from undefined to a defined value, which should not happen. Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://reactjs.org/link/controlled-components"),$Z=!0;if(X._wrapperState.controlled&&!Z&&!YZ)G("A component is changing a controlled input to be uncontrolled. This is likely caused by the value changing from a defined to undefined, which should not happen. Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://reactjs.org/link/controlled-components"),YZ=!0}X0(z,Q);var J=W7(Q.value),$=Q.type;if(J!=null){if($==="number"){if(J===0&&X.value===""||X.value!=J)X.value=q6(J)}else if(X.value!==q6(J))X.value=q6(J)}else if($==="submit"||$==="reset"){X.removeAttribute("value");return}if(Q.hasOwnProperty("value"))T1(X,Q.type,J);else if(Q.hasOwnProperty("defaultValue"))T1(X,Q.type,W7(Q.defaultValue));if(Q.checked==null&&Q.defaultChecked!=null)X.defaultChecked=!!Q.defaultChecked}function y0(z,Q,X){var Z=z;if(Q.hasOwnProperty("value")||Q.hasOwnProperty("defaultValue")){var J=Q.type,$=J==="submit"||J==="reset";if($&&(Q.value===void 0||Q.value===null))return;var q=q6(Z._wrapperState.initialValue);if(!X){if(q!==Z.value)Z.value=q}Z.defaultValue=q}var U=Z.name;if(U!=="")Z.name="";if(Z.defaultChecked=!Z.defaultChecked,Z.defaultChecked=!!Z._wrapperState.initialChecked,U!=="")Z.name=U}function b1(z,Q){var X=z;q0(X,Q),e0(X,Q)}function e0(z,Q){var X=Q.name;if(Q.type==="radio"&&X!=null){var Z=z;while(Z.parentNode)Z=Z.parentNode;A0(X,"name");var J=Z.querySelectorAll("input[name="+JSON.stringify(""+X)+'][type="radio"]');for(var $=0;$<J.length;$++){var q=J[$];if(q===z||q.form!==z.form)continue;var U=aZ(q);if(!U)throw Error("ReactDOMInput: Mixing React and non-React radio inputs with the same `name` is not supported.");m2(q),q0(q,U)}}}function T1(z,Q,X){if(Q!=="number"||B8(z.ownerDocument)!==z){if(X==null)z.defaultValue=q6(z._wrapperState.initialValue);else if(z.defaultValue!==q6(X))z.defaultValue=q6(X)}}var i1=!1,O4=!1,I4=!1;function T4(z,Q){{if(Q.value==null){if(typeof Q.children==="object"&&Q.children!==null)DX.Children.forEach(Q.children,function(X){if(X==null)return;if(typeof X==="string"||typeof X==="number")return;if(!O4)O4=!0,G("Cannot infer the option value of complex children. Pass a `value` prop or use a plain string as children to <option>.")});else if(Q.dangerouslySetInnerHTML!=null){if(!I4)I4=!0,G("Pass a `value` prop if you set dangerouslyInnerHTML so React knows which value should be selected.")}}if(Q.selected!=null&&!i1)G("Use the `defaultValue` or `value` props on <select> instead of setting `selected` on <option>."),i1=!0}}function m4(z,Q){if(Q.value!=null)z.setAttribute("value",q6(W7(Q.value)))}var a4=Array.isArray;function Z4(z){return a4(z)}var j8=!1;function u2(){var z=G8();if(z)return`
|
|
30
|
+
|
|
31
|
+
Check the render method of \``+z+"`.";return""}var ZQ=["value","defaultValue"];function mJ(z){{D2("select",z);for(var Q=0;Q<ZQ.length;Q++){var X=ZQ[Q];if(z[X]==null)continue;var Z=Z4(z[X]);if(z.multiple&&!Z)G("The `%s` prop supplied to <select> must be an array if `multiple` is true.%s",X,u2());else if(!z.multiple&&Z)G("The `%s` prop supplied to <select> must be a scalar value if `multiple` is false.%s",X,u2())}}}function S7(z,Q,X,Z){var J=z.options;if(Q){var $=X,q={};for(var U=0;U<$.length;U++)q["$"+$[U]]=!0;for(var L=0;L<J.length;L++){var P=q.hasOwnProperty("$"+J[L].value);if(J[L].selected!==P)J[L].selected=P;if(P&&Z)J[L].defaultSelected=!0}}else{var C=q6(W7(X)),i=null;for(var d=0;d<J.length;d++){if(J[d].value===C){if(J[d].selected=!0,Z)J[d].defaultSelected=!0;return}if(i===null&&!J[d].disabled)i=J[d]}if(i!==null)i.selected=!0}}function JQ(z,Q){return E1({},Q,{value:void 0})}function YQ(z,Q){var X=z;if(mJ(Q),X._wrapperState={wasMultiple:!!Q.multiple},Q.value!==void 0&&Q.defaultValue!==void 0&&!j8)G("Select elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled select element and remove one of these props. More info: https://reactjs.org/link/controlled-components"),j8=!0}function gJ(z,Q){var X=z;X.multiple=!!Q.multiple;var Z=Q.value;if(Z!=null)S7(X,!!Q.multiple,Z,!1);else if(Q.defaultValue!=null)S7(X,!!Q.multiple,Q.defaultValue,!0)}function DO(z,Q){var X=z,Z=X._wrapperState.wasMultiple;X._wrapperState.wasMultiple=!!Q.multiple;var J=Q.value;if(J!=null)S7(X,!!Q.multiple,J,!1);else if(Z!==!!Q.multiple)if(Q.defaultValue!=null)S7(X,!!Q.multiple,Q.defaultValue,!0);else S7(X,!!Q.multiple,Q.multiple?[]:"",!1)}function mO(z,Q){var X=z,Z=Q.value;if(Z!=null)S7(X,!!Q.multiple,Z,!1)}var MG=!1;function uJ(z,Q){var X=z;if(Q.dangerouslySetInnerHTML!=null)throw Error("`dangerouslySetInnerHTML` does not make sense on <textarea>.");var Z=E1({},Q,{value:void 0,defaultValue:void 0,children:q6(X._wrapperState.initialValue)});return Z}function wG(z,Q){var X=z;if(D2("textarea",Q),Q.value!==void 0&&Q.defaultValue!==void 0&&!MG)G("%s contains a textarea with both value and defaultValue props. Textarea elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled textarea and remove one of these props. More info: https://reactjs.org/link/controlled-components",G8()||"A component"),MG=!0;var Z=Q.value;if(Z==null){var{children:J,defaultValue:$}=Q;if(J!=null){G("Use the `defaultValue` or `value` props instead of setting children on <textarea>.");{if($!=null)throw Error("If you supply `defaultValue` on a <textarea>, do not pass children.");if(Z4(J)){if(J.length>1)throw Error("<textarea> can only have at most one child.");J=J[0]}$=J}}if($==null)$="";Z=$}X._wrapperState={initialValue:W7(Z)}}function FG(z,Q){var X=z,Z=W7(Q.value),J=W7(Q.defaultValue);if(Z!=null){var $=q6(Z);if($!==X.value)X.value=$;if(Q.defaultValue==null&&X.defaultValue!==$)X.defaultValue=$}if(J!=null)X.defaultValue=q6(J)}function bG(z,Q){var X=z,Z=X.textContent;if(Z===X._wrapperState.initialValue){if(Z!==""&&Z!==null)X.value=Z}}function gO(z,Q){FG(z,Q)}var f7="http://www.w3.org/1999/xhtml",uO="http://www.w3.org/1998/Math/MathML",EJ="http://www.w3.org/2000/svg";function xJ(z){switch(z){case"svg":return EJ;case"math":return uO;default:return f7}}function pJ(z,Q){if(z==null||z===f7)return xJ(Q);if(z===EJ&&Q==="foreignObject")return f7;return z}var EO=function(z){if(typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction)return function(Q,X,Z,J){MSApp.execUnsafeLocalFunction(function(){return z(Q,X,Z,J)})};else return z},GZ,PG=EO(function(z,Q){if(z.namespaceURI===EJ){if(!("innerHTML"in z)){GZ=GZ||document.createElement("div"),GZ.innerHTML="<svg>"+Q.valueOf().toString()+"</svg>";var X=GZ.firstChild;while(z.firstChild)z.removeChild(z.firstChild);while(X.firstChild)z.appendChild(X.firstChild);return}}z.innerHTML=Q}),B6=1,h7=3,Z5=8,y7=9,jJ=11,qZ=function(z,Q){if(Q){var X=z.firstChild;if(X&&X===z.lastChild&&X.nodeType===h7){X.nodeValue=Q;return}}z.textContent=Q},xO={animation:["animationDelay","animationDirection","animationDuration","animationFillMode","animationIterationCount","animationName","animationPlayState","animationTimingFunction"],background:["backgroundAttachment","backgroundClip","backgroundColor","backgroundImage","backgroundOrigin","backgroundPositionX","backgroundPositionY","backgroundRepeat","backgroundSize"],backgroundPosition:["backgroundPositionX","backgroundPositionY"],border:["borderBottomColor","borderBottomStyle","borderBottomWidth","borderImageOutset","borderImageRepeat","borderImageSlice","borderImageSource","borderImageWidth","borderLeftColor","borderLeftStyle","borderLeftWidth","borderRightColor","borderRightStyle","borderRightWidth","borderTopColor","borderTopStyle","borderTopWidth"],borderBlockEnd:["borderBlockEndColor","borderBlockEndStyle","borderBlockEndWidth"],borderBlockStart:["borderBlockStartColor","borderBlockStartStyle","borderBlockStartWidth"],borderBottom:["borderBottomColor","borderBottomStyle","borderBottomWidth"],borderColor:["borderBottomColor","borderLeftColor","borderRightColor","borderTopColor"],borderImage:["borderImageOutset","borderImageRepeat","borderImageSlice","borderImageSource","borderImageWidth"],borderInlineEnd:["borderInlineEndColor","borderInlineEndStyle","borderInlineEndWidth"],borderInlineStart:["borderInlineStartColor","borderInlineStartStyle","borderInlineStartWidth"],borderLeft:["borderLeftColor","borderLeftStyle","borderLeftWidth"],borderRadius:["borderBottomLeftRadius","borderBottomRightRadius","borderTopLeftRadius","borderTopRightRadius"],borderRight:["borderRightColor","borderRightStyle","borderRightWidth"],borderStyle:["borderBottomStyle","borderLeftStyle","borderRightStyle","borderTopStyle"],borderTop:["borderTopColor","borderTopStyle","borderTopWidth"],borderWidth:["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth"],columnRule:["columnRuleColor","columnRuleStyle","columnRuleWidth"],columns:["columnCount","columnWidth"],flex:["flexBasis","flexGrow","flexShrink"],flexFlow:["flexDirection","flexWrap"],font:["fontFamily","fontFeatureSettings","fontKerning","fontLanguageOverride","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontVariantAlternates","fontVariantCaps","fontVariantEastAsian","fontVariantLigatures","fontVariantNumeric","fontVariantPosition","fontWeight","lineHeight"],fontVariant:["fontVariantAlternates","fontVariantCaps","fontVariantEastAsian","fontVariantLigatures","fontVariantNumeric","fontVariantPosition"],gap:["columnGap","rowGap"],grid:["gridAutoColumns","gridAutoFlow","gridAutoRows","gridTemplateAreas","gridTemplateColumns","gridTemplateRows"],gridArea:["gridColumnEnd","gridColumnStart","gridRowEnd","gridRowStart"],gridColumn:["gridColumnEnd","gridColumnStart"],gridColumnGap:["columnGap"],gridGap:["columnGap","rowGap"],gridRow:["gridRowEnd","gridRowStart"],gridRowGap:["rowGap"],gridTemplate:["gridTemplateAreas","gridTemplateColumns","gridTemplateRows"],listStyle:["listStyleImage","listStylePosition","listStyleType"],margin:["marginBottom","marginLeft","marginRight","marginTop"],marker:["markerEnd","markerMid","markerStart"],mask:["maskClip","maskComposite","maskImage","maskMode","maskOrigin","maskPositionX","maskPositionY","maskRepeat","maskSize"],maskPosition:["maskPositionX","maskPositionY"],outline:["outlineColor","outlineStyle","outlineWidth"],overflow:["overflowX","overflowY"],padding:["paddingBottom","paddingLeft","paddingRight","paddingTop"],placeContent:["alignContent","justifyContent"],placeItems:["alignItems","justifyItems"],placeSelf:["alignSelf","justifySelf"],textDecoration:["textDecorationColor","textDecorationLine","textDecorationStyle"],textEmphasis:["textEmphasisColor","textEmphasisStyle"],transition:["transitionDelay","transitionDuration","transitionProperty","transitionTimingFunction"],wordWrap:["overflowWrap"]},$Q={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0};function pO(z,Q){return z+Q.charAt(0).toUpperCase()+Q.substring(1)}var jO=["Webkit","ms","Moz","O"];Object.keys($Q).forEach(function(z){jO.forEach(function(Q){$Q[pO(Q,z)]=$Q[z]})});function lJ(z,Q,X){var Z=Q==null||typeof Q==="boolean"||Q==="";if(Z)return"";if(!X&&typeof Q==="number"&&Q!==0&&!($Q.hasOwnProperty(z)&&$Q[z]))return Q+"px";return n1(Q,z),(""+Q).trim()}var lO=/([A-Z])/g,cO=/^ms-/;function dO(z){return z.replace(lO,"-$1").toLowerCase().replace(cO,"-ms-")}var AG=function(){};{var iO=/^(?:webkit|moz|o)[A-Z]/,oO=/^-ms-/,aO=/-(.)/g,IG=/;\s*$/,E2={},cJ={},TG=!1,kG=!1,nO=function(z){return z.replace(aO,function(Q,X){return X.toUpperCase()})},rO=function(z){if(E2.hasOwnProperty(z)&&E2[z])return;E2[z]=!0,G("Unsupported style property %s. Did you mean %s?",z,nO(z.replace(oO,"ms-")))},tO=function(z){if(E2.hasOwnProperty(z)&&E2[z])return;E2[z]=!0,G("Unsupported vendor-prefixed style property %s. Did you mean %s?",z,z.charAt(0).toUpperCase()+z.slice(1))},sO=function(z,Q){if(cJ.hasOwnProperty(Q)&&cJ[Q])return;cJ[Q]=!0,G(`Style property values shouldn't contain a semicolon. Try "%s: %s" instead.`,z,Q.replace(IG,""))},eO=function(z,Q){if(TG)return;TG=!0,G("`NaN` is an invalid value for the `%s` css style property.",z)},z_=function(z,Q){if(kG)return;kG=!0,G("`Infinity` is an invalid value for the `%s` css style property.",z)};AG=function(z,Q){if(z.indexOf("-")>-1)rO(z);else if(iO.test(z))tO(z);else if(IG.test(Q))sO(z,Q);if(typeof Q==="number"){if(isNaN(Q))eO(z,Q);else if(!isFinite(Q))z_(z,Q)}}}var Q_=AG;function X_(z){{var Q="",X="";for(var Z in z){if(!z.hasOwnProperty(Z))continue;var J=z[Z];if(J!=null){var $=Z.indexOf("--")===0;Q+=X+($?Z:dO(Z))+":",Q+=lJ(Z,J,$),X=";"}}return Q||null}}function CG(z,Q){var X=z.style;for(var Z in Q){if(!Q.hasOwnProperty(Z))continue;var J=Z.indexOf("--")===0;if(!J)Q_(Z,Q[Z]);var $=lJ(Z,Q[Z],J);if(Z==="float")Z="cssFloat";if(J)X.setProperty(Z,$);else X[Z]=$}}function Z_(z){return z==null||typeof z==="boolean"||z===""}function vG(z){var Q={};for(var X in z){var Z=xO[X]||[X];for(var J=0;J<Z.length;J++)Q[Z[J]]=X}return Q}function J_(z,Q){{if(!Q)return;var X=vG(z),Z=vG(Q),J={};for(var $ in X){var q=X[$],U=Z[$];if(U&&q!==U){var L=q+","+U;if(J[L])continue;J[L]=!0,G("%s a style property during rerender (%s) when a conflicting property is set (%s) can lead to styling bugs. To avoid this, don't mix shorthand and non-shorthand properties for the same value; instead, replace the shorthand with separate values.",Z_(z[q])?"Removing":"Updating",q,U)}}}}var Y_={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},$_=E1({menuitem:!0},Y_),H_="__html";function dJ(z,Q){if(!Q)return;if($_[z]){if(Q.children!=null||Q.dangerouslySetInnerHTML!=null)throw Error(z+" is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`.")}if(Q.dangerouslySetInnerHTML!=null){if(Q.children!=null)throw Error("Can only set one of `children` or `props.dangerouslySetInnerHTML`.");if(typeof Q.dangerouslySetInnerHTML!=="object"||!(H_ in Q.dangerouslySetInnerHTML))throw Error("`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://reactjs.org/link/dangerously-set-inner-html for more information.")}if(!Q.suppressContentEditableWarning&&Q.contentEditable&&Q.children!=null)G("A component is `contentEditable` and contains `children` managed by React. It is now your responsibility to guarantee that none of those nodes are unexpectedly modified or duplicated. This is probably not intentional.");if(Q.style!=null&&typeof Q.style!=="object")throw Error("The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX.")}function l8(z,Q){if(z.indexOf("-")===-1)return typeof Q.is==="string";switch(z){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 BZ={accept:"accept",acceptcharset:"acceptCharset","accept-charset":"acceptCharset",accesskey:"accessKey",action:"action",allowfullscreen:"allowFullScreen",alt:"alt",as:"as",async:"async",autocapitalize:"autoCapitalize",autocomplete:"autoComplete",autocorrect:"autoCorrect",autofocus:"autoFocus",autoplay:"autoPlay",autosave:"autoSave",capture:"capture",cellpadding:"cellPadding",cellspacing:"cellSpacing",challenge:"challenge",charset:"charSet",checked:"checked",children:"children",cite:"cite",class:"className",classid:"classID",classname:"className",cols:"cols",colspan:"colSpan",content:"content",contenteditable:"contentEditable",contextmenu:"contextMenu",controls:"controls",controlslist:"controlsList",coords:"coords",crossorigin:"crossOrigin",dangerouslysetinnerhtml:"dangerouslySetInnerHTML",data:"data",datetime:"dateTime",default:"default",defaultchecked:"defaultChecked",defaultvalue:"defaultValue",defer:"defer",dir:"dir",disabled:"disabled",disablepictureinpicture:"disablePictureInPicture",disableremoteplayback:"disableRemotePlayback",download:"download",draggable:"draggable",enctype:"encType",enterkeyhint:"enterKeyHint",for:"htmlFor",form:"form",formmethod:"formMethod",formaction:"formAction",formenctype:"formEncType",formnovalidate:"formNoValidate",formtarget:"formTarget",frameborder:"frameBorder",headers:"headers",height:"height",hidden:"hidden",high:"high",href:"href",hreflang:"hrefLang",htmlfor:"htmlFor",httpequiv:"httpEquiv","http-equiv":"httpEquiv",icon:"icon",id:"id",imagesizes:"imageSizes",imagesrcset:"imageSrcSet",innerhtml:"innerHTML",inputmode:"inputMode",integrity:"integrity",is:"is",itemid:"itemID",itemprop:"itemProp",itemref:"itemRef",itemscope:"itemScope",itemtype:"itemType",keyparams:"keyParams",keytype:"keyType",kind:"kind",label:"label",lang:"lang",list:"list",loop:"loop",low:"low",manifest:"manifest",marginwidth:"marginWidth",marginheight:"marginHeight",max:"max",maxlength:"maxLength",media:"media",mediagroup:"mediaGroup",method:"method",min:"min",minlength:"minLength",multiple:"multiple",muted:"muted",name:"name",nomodule:"noModule",nonce:"nonce",novalidate:"noValidate",open:"open",optimum:"optimum",pattern:"pattern",placeholder:"placeholder",playsinline:"playsInline",poster:"poster",preload:"preload",profile:"profile",radiogroup:"radioGroup",readonly:"readOnly",referrerpolicy:"referrerPolicy",rel:"rel",required:"required",reversed:"reversed",role:"role",rows:"rows",rowspan:"rowSpan",sandbox:"sandbox",scope:"scope",scoped:"scoped",scrolling:"scrolling",seamless:"seamless",selected:"selected",shape:"shape",size:"size",sizes:"sizes",span:"span",spellcheck:"spellCheck",src:"src",srcdoc:"srcDoc",srclang:"srcLang",srcset:"srcSet",start:"start",step:"step",style:"style",summary:"summary",tabindex:"tabIndex",target:"target",title:"title",type:"type",usemap:"useMap",value:"value",width:"width",wmode:"wmode",wrap:"wrap",about:"about",accentheight:"accentHeight","accent-height":"accentHeight",accumulate:"accumulate",additive:"additive",alignmentbaseline:"alignmentBaseline","alignment-baseline":"alignmentBaseline",allowreorder:"allowReorder",alphabetic:"alphabetic",amplitude:"amplitude",arabicform:"arabicForm","arabic-form":"arabicForm",ascent:"ascent",attributename:"attributeName",attributetype:"attributeType",autoreverse:"autoReverse",azimuth:"azimuth",basefrequency:"baseFrequency",baselineshift:"baselineShift","baseline-shift":"baselineShift",baseprofile:"baseProfile",bbox:"bbox",begin:"begin",bias:"bias",by:"by",calcmode:"calcMode",capheight:"capHeight","cap-height":"capHeight",clip:"clip",clippath:"clipPath","clip-path":"clipPath",clippathunits:"clipPathUnits",cliprule:"clipRule","clip-rule":"clipRule",color:"color",colorinterpolation:"colorInterpolation","color-interpolation":"colorInterpolation",colorinterpolationfilters:"colorInterpolationFilters","color-interpolation-filters":"colorInterpolationFilters",colorprofile:"colorProfile","color-profile":"colorProfile",colorrendering:"colorRendering","color-rendering":"colorRendering",contentscripttype:"contentScriptType",contentstyletype:"contentStyleType",cursor:"cursor",cx:"cx",cy:"cy",d:"d",datatype:"datatype",decelerate:"decelerate",descent:"descent",diffuseconstant:"diffuseConstant",direction:"direction",display:"display",divisor:"divisor",dominantbaseline:"dominantBaseline","dominant-baseline":"dominantBaseline",dur:"dur",dx:"dx",dy:"dy",edgemode:"edgeMode",elevation:"elevation",enablebackground:"enableBackground","enable-background":"enableBackground",end:"end",exponent:"exponent",externalresourcesrequired:"externalResourcesRequired",fill:"fill",fillopacity:"fillOpacity","fill-opacity":"fillOpacity",fillrule:"fillRule","fill-rule":"fillRule",filter:"filter",filterres:"filterRes",filterunits:"filterUnits",floodopacity:"floodOpacity","flood-opacity":"floodOpacity",floodcolor:"floodColor","flood-color":"floodColor",focusable:"focusable",fontfamily:"fontFamily","font-family":"fontFamily",fontsize:"fontSize","font-size":"fontSize",fontsizeadjust:"fontSizeAdjust","font-size-adjust":"fontSizeAdjust",fontstretch:"fontStretch","font-stretch":"fontStretch",fontstyle:"fontStyle","font-style":"fontStyle",fontvariant:"fontVariant","font-variant":"fontVariant",fontweight:"fontWeight","font-weight":"fontWeight",format:"format",from:"from",fx:"fx",fy:"fy",g1:"g1",g2:"g2",glyphname:"glyphName","glyph-name":"glyphName",glyphorientationhorizontal:"glyphOrientationHorizontal","glyph-orientation-horizontal":"glyphOrientationHorizontal",glyphorientationvertical:"glyphOrientationVertical","glyph-orientation-vertical":"glyphOrientationVertical",glyphref:"glyphRef",gradienttransform:"gradientTransform",gradientunits:"gradientUnits",hanging:"hanging",horizadvx:"horizAdvX","horiz-adv-x":"horizAdvX",horizoriginx:"horizOriginX","horiz-origin-x":"horizOriginX",ideographic:"ideographic",imagerendering:"imageRendering","image-rendering":"imageRendering",in2:"in2",in:"in",inlist:"inlist",intercept:"intercept",k1:"k1",k2:"k2",k3:"k3",k4:"k4",k:"k",kernelmatrix:"kernelMatrix",kernelunitlength:"kernelUnitLength",kerning:"kerning",keypoints:"keyPoints",keysplines:"keySplines",keytimes:"keyTimes",lengthadjust:"lengthAdjust",letterspacing:"letterSpacing","letter-spacing":"letterSpacing",lightingcolor:"lightingColor","lighting-color":"lightingColor",limitingconeangle:"limitingConeAngle",local:"local",markerend:"markerEnd","marker-end":"markerEnd",markerheight:"markerHeight",markermid:"markerMid","marker-mid":"markerMid",markerstart:"markerStart","marker-start":"markerStart",markerunits:"markerUnits",markerwidth:"markerWidth",mask:"mask",maskcontentunits:"maskContentUnits",maskunits:"maskUnits",mathematical:"mathematical",mode:"mode",numoctaves:"numOctaves",offset:"offset",opacity:"opacity",operator:"operator",order:"order",orient:"orient",orientation:"orientation",origin:"origin",overflow:"overflow",overlineposition:"overlinePosition","overline-position":"overlinePosition",overlinethickness:"overlineThickness","overline-thickness":"overlineThickness",paintorder:"paintOrder","paint-order":"paintOrder",panose1:"panose1","panose-1":"panose1",pathlength:"pathLength",patterncontentunits:"patternContentUnits",patterntransform:"patternTransform",patternunits:"patternUnits",pointerevents:"pointerEvents","pointer-events":"pointerEvents",points:"points",pointsatx:"pointsAtX",pointsaty:"pointsAtY",pointsatz:"pointsAtZ",prefix:"prefix",preservealpha:"preserveAlpha",preserveaspectratio:"preserveAspectRatio",primitiveunits:"primitiveUnits",property:"property",r:"r",radius:"radius",refx:"refX",refy:"refY",renderingintent:"renderingIntent","rendering-intent":"renderingIntent",repeatcount:"repeatCount",repeatdur:"repeatDur",requiredextensions:"requiredExtensions",requiredfeatures:"requiredFeatures",resource:"resource",restart:"restart",result:"result",results:"results",rotate:"rotate",rx:"rx",ry:"ry",scale:"scale",security:"security",seed:"seed",shaperendering:"shapeRendering","shape-rendering":"shapeRendering",slope:"slope",spacing:"spacing",specularconstant:"specularConstant",specularexponent:"specularExponent",speed:"speed",spreadmethod:"spreadMethod",startoffset:"startOffset",stddeviation:"stdDeviation",stemh:"stemh",stemv:"stemv",stitchtiles:"stitchTiles",stopcolor:"stopColor","stop-color":"stopColor",stopopacity:"stopOpacity","stop-opacity":"stopOpacity",strikethroughposition:"strikethroughPosition","strikethrough-position":"strikethroughPosition",strikethroughthickness:"strikethroughThickness","strikethrough-thickness":"strikethroughThickness",string:"string",stroke:"stroke",strokedasharray:"strokeDasharray","stroke-dasharray":"strokeDasharray",strokedashoffset:"strokeDashoffset","stroke-dashoffset":"strokeDashoffset",strokelinecap:"strokeLinecap","stroke-linecap":"strokeLinecap",strokelinejoin:"strokeLinejoin","stroke-linejoin":"strokeLinejoin",strokemiterlimit:"strokeMiterlimit","stroke-miterlimit":"strokeMiterlimit",strokewidth:"strokeWidth","stroke-width":"strokeWidth",strokeopacity:"strokeOpacity","stroke-opacity":"strokeOpacity",suppresscontenteditablewarning:"suppressContentEditableWarning",suppresshydrationwarning:"suppressHydrationWarning",surfacescale:"surfaceScale",systemlanguage:"systemLanguage",tablevalues:"tableValues",targetx:"targetX",targety:"targetY",textanchor:"textAnchor","text-anchor":"textAnchor",textdecoration:"textDecoration","text-decoration":"textDecoration",textlength:"textLength",textrendering:"textRendering","text-rendering":"textRendering",to:"to",transform:"transform",typeof:"typeof",u1:"u1",u2:"u2",underlineposition:"underlinePosition","underline-position":"underlinePosition",underlinethickness:"underlineThickness","underline-thickness":"underlineThickness",unicode:"unicode",unicodebidi:"unicodeBidi","unicode-bidi":"unicodeBidi",unicoderange:"unicodeRange","unicode-range":"unicodeRange",unitsperem:"unitsPerEm","units-per-em":"unitsPerEm",unselectable:"unselectable",valphabetic:"vAlphabetic","v-alphabetic":"vAlphabetic",values:"values",vectoreffect:"vectorEffect","vector-effect":"vectorEffect",version:"version",vertadvy:"vertAdvY","vert-adv-y":"vertAdvY",vertoriginx:"vertOriginX","vert-origin-x":"vertOriginX",vertoriginy:"vertOriginY","vert-origin-y":"vertOriginY",vhanging:"vHanging","v-hanging":"vHanging",videographic:"vIdeographic","v-ideographic":"vIdeographic",viewbox:"viewBox",viewtarget:"viewTarget",visibility:"visibility",vmathematical:"vMathematical","v-mathematical":"vMathematical",vocab:"vocab",widths:"widths",wordspacing:"wordSpacing","word-spacing":"wordSpacing",writingmode:"writingMode","writing-mode":"writingMode",x1:"x1",x2:"x2",x:"x",xchannelselector:"xChannelSelector",xheight:"xHeight","x-height":"xHeight",xlinkactuate:"xlinkActuate","xlink:actuate":"xlinkActuate",xlinkarcrole:"xlinkArcrole","xlink:arcrole":"xlinkArcrole",xlinkhref:"xlinkHref","xlink:href":"xlinkHref",xlinkrole:"xlinkRole","xlink:role":"xlinkRole",xlinkshow:"xlinkShow","xlink:show":"xlinkShow",xlinktitle:"xlinkTitle","xlink:title":"xlinkTitle",xlinktype:"xlinkType","xlink:type":"xlinkType",xmlbase:"xmlBase","xml:base":"xmlBase",xmllang:"xmlLang","xml:lang":"xmlLang",xmlns:"xmlns","xml:space":"xmlSpace",xmlnsxlink:"xmlnsXlink","xmlns:xlink":"xmlnsXlink",xmlspace:"xmlSpace",y1:"y1",y2:"y2",y:"y",ychannelselector:"yChannelSelector",z:"z",zoomandpan:"zoomAndPan"},SG={"aria-current":0,"aria-description":0,"aria-details":0,"aria-disabled":0,"aria-hidden":0,"aria-invalid":0,"aria-keyshortcuts":0,"aria-label":0,"aria-roledescription":0,"aria-autocomplete":0,"aria-checked":0,"aria-expanded":0,"aria-haspopup":0,"aria-level":0,"aria-modal":0,"aria-multiline":0,"aria-multiselectable":0,"aria-orientation":0,"aria-placeholder":0,"aria-pressed":0,"aria-readonly":0,"aria-required":0,"aria-selected":0,"aria-sort":0,"aria-valuemax":0,"aria-valuemin":0,"aria-valuenow":0,"aria-valuetext":0,"aria-atomic":0,"aria-busy":0,"aria-live":0,"aria-relevant":0,"aria-dropeffect":0,"aria-grabbed":0,"aria-activedescendant":0,"aria-colcount":0,"aria-colindex":0,"aria-colspan":0,"aria-controls":0,"aria-describedby":0,"aria-errormessage":0,"aria-flowto":0,"aria-labelledby":0,"aria-owns":0,"aria-posinset":0,"aria-rowcount":0,"aria-rowindex":0,"aria-rowspan":0,"aria-setsize":0},x2={},G_=new RegExp("^(aria)-["+X5+"]*$"),q_=new RegExp("^(aria)[A-Z]["+X5+"]*$");function B_(z,Q){{if(V0.call(x2,Q)&&x2[Q])return!0;if(q_.test(Q)){var X="aria-"+Q.slice(4).toLowerCase(),Z=SG.hasOwnProperty(X)?X:null;if(Z==null)return G("Invalid ARIA attribute `%s`. ARIA attributes follow the pattern aria-* and must be lowercase.",Q),x2[Q]=!0,!0;if(Q!==Z)return G("Invalid ARIA attribute `%s`. Did you mean `%s`?",Q,Z),x2[Q]=!0,!0}if(G_.test(Q)){var J=Q.toLowerCase(),$=SG.hasOwnProperty(J)?J:null;if($==null)return x2[Q]=!0,!1;if(Q!==$)return G("Unknown ARIA attribute `%s`. Did you mean `%s`?",Q,$),x2[Q]=!0,!0}}return!0}function U_(z,Q){{var X=[];for(var Z in Q){var J=B_(z,Z);if(!J)X.push(Z)}var $=X.map(function(q){return"`"+q+"`"}).join(", ");if(X.length===1)G("Invalid aria prop %s on <%s> tag. For details, see https://reactjs.org/link/invalid-aria-props",$,z);else if(X.length>1)G("Invalid aria props %s on <%s> tag. For details, see https://reactjs.org/link/invalid-aria-props",$,z)}}function W_(z,Q){if(l8(z,Q))return;U_(z,Q)}var fG=!1;function K_(z,Q){{if(z!=="input"&&z!=="textarea"&&z!=="select")return;if(Q!=null&&Q.value===null&&!fG)if(fG=!0,z==="select"&&Q.multiple)G("`value` prop on `%s` should not be null. Consider using an empty array when `multiple` is set to `true` to clear the component or `undefined` for uncontrolled components.",z);else G("`value` prop on `%s` should not be null. Consider using an empty string to clear the component or `undefined` for uncontrolled components.",z)}}var hG=function(){};{var z6={},yG=/^on./,O_=/^on[^A-Z]/,__=new RegExp("^(aria)-["+X5+"]*$"),L_=new RegExp("^(aria)[A-Z]["+X5+"]*$");hG=function(z,Q,X,Z){if(V0.call(z6,Q)&&z6[Q])return!0;var J=Q.toLowerCase();if(J==="onfocusin"||J==="onfocusout")return G("React uses onFocus and onBlur instead of onFocusIn and onFocusOut. All React events are normalized to bubble, so onFocusIn and onFocusOut are not needed/supported by React."),z6[Q]=!0,!0;if(Z!=null){var{registrationNameDependencies:$,possibleRegistrationNames:q}=Z;if($.hasOwnProperty(Q))return!0;var U=q.hasOwnProperty(J)?q[J]:null;if(U!=null)return G("Invalid event handler property `%s`. Did you mean `%s`?",Q,U),z6[Q]=!0,!0;if(yG.test(Q))return G("Unknown event handler property `%s`. It will be ignored.",Q),z6[Q]=!0,!0}else if(yG.test(Q)){if(O_.test(Q))G("Invalid event handler property `%s`. React events use the camelCase naming convention, for example `onClick`.",Q);return z6[Q]=!0,!0}if(__.test(Q)||L_.test(Q))return!0;if(J==="innerhtml")return G("Directly setting property `innerHTML` is not permitted. For more information, lookup documentation on `dangerouslySetInnerHTML`."),z6[Q]=!0,!0;if(J==="aria")return G("The `aria` attribute is reserved for future use in React. Pass individual `aria-` attributes instead."),z6[Q]=!0,!0;if(J==="is"&&X!==null&&X!==void 0&&typeof X!=="string")return G("Received a `%s` for a string attribute `is`. If this is expected, cast the value to a string.",typeof X),z6[Q]=!0,!0;if(typeof X==="number"&&isNaN(X))return G("Received NaN for the `%s` attribute. If this is expected, cast the value to a string.",Q),z6[Q]=!0,!0;var L=z5(Q),P=L!==null&&L.type===T5;if(BZ.hasOwnProperty(J)){var C=BZ[J];if(C!==Q)return G("Invalid DOM property `%s`. Did you mean `%s`?",Q,C),z6[Q]=!0,!0}else if(!P&&Q!==J)return G("React does not recognize the `%s` prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase `%s` instead. If you accidentally passed it from a parent component, remove it from the DOM element.",Q,J),z6[Q]=!0,!0;if(typeof X==="boolean"&&x4(Q,X,L,!1)){if(X)G('Received `%s` for a non-boolean attribute `%s`.\n\nIf you want to write it to the DOM, pass a string instead: %s="%s" or %s={value.toString()}.',X,Q,Q,X,Q);else G('Received `%s` for a non-boolean attribute `%s`.\n\nIf you want to write it to the DOM, pass a string instead: %s="%s" or %s={value.toString()}.\n\nIf you used to conditionally omit it with %s={condition && value}, pass %s={condition ? value : undefined} instead.',X,Q,Q,X,Q,Q,Q);return z6[Q]=!0,!0}if(P)return!0;if(x4(Q,X,L,!1))return z6[Q]=!0,!1;if((X==="false"||X==="true")&&L!==null&&L.type===h4)return G("Received the string `%s` for the boolean attribute `%s`. %s Did you mean %s={%s}?",X,Q,X==="false"?"The browser will interpret it as a truthy value.":'Although this works, it will not work as expected if you pass the string "false".',Q,X),z6[Q]=!0,!0;return!0}}var N_=function(z,Q,X){{var Z=[];for(var J in Q){var $=hG(z,J,Q[J],X);if(!$)Z.push(J)}var q=Z.map(function(U){return"`"+U+"`"}).join(", ");if(Z.length===1)G("Invalid value for prop %s on <%s> tag. Either remove it from the element, or pass a string or number value to keep it in the DOM. For details, see https://reactjs.org/link/attribute-behavior ",q,z);else if(Z.length>1)G("Invalid values for props %s on <%s> tag. Either remove them from the element, or pass a string or number value to keep them in the DOM. For details, see https://reactjs.org/link/attribute-behavior ",q,z)}};function R_(z,Q,X){if(l8(z,Q))return;N_(z,Q,X)}var VG=1,iJ=2,HQ=4,M_=VG|iJ|HQ,GQ=null;function w_(z){if(GQ!==null)G("Expected currently replaying event to be null. This error is likely caused by a bug in React. Please file an issue.");GQ=z}function F_(){if(GQ===null)G("Expected currently replaying event to not be null. This error is likely caused by a bug in React. Please file an issue.");GQ=null}function b_(z){return z===GQ}function oJ(z){var Q=z.target||z.srcElement||window;if(Q.correspondingUseElement)Q=Q.correspondingUseElement;return Q.nodeType===h7?Q.parentNode:Q}var aJ=null,p2=null,j2=null;function DG(z){var Q=R8(z);if(!Q)return;if(typeof aJ!=="function")throw Error("setRestoreImplementation() needs to be called to handle a target for controlled events. This error is likely caused by a bug in React. Please file an issue.");var X=Q.stateNode;if(X){var Z=aZ(X);aJ(Q.stateNode,Q.type,Z)}}function P_(z){aJ=z}function mG(z){if(p2)if(j2)j2.push(z);else j2=[z];else p2=z}function A_(){return p2!==null||j2!==null}function gG(){if(!p2)return;var z=p2,Q=j2;if(p2=null,j2=null,DG(z),Q)for(var X=0;X<Q.length;X++)DG(Q[X])}var uG=function(z,Q){return z(Q)},EG=function(){},nJ=!1;function I_(){var z=A_();if(z)EG(),gG()}function xG(z,Q,X){if(nJ)return z(Q,X);nJ=!0;try{return uG(z,Q,X)}finally{nJ=!1,I_()}}function T_(z,Q,X){uG=z,EG=X}function k_(z){return z==="button"||z==="input"||z==="select"||z==="textarea"}function C_(z,Q,X){switch(z){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":return!!(X.disabled&&k_(Q));default:return!1}}function qQ(z,Q){var X=z.stateNode;if(X===null)return null;var Z=aZ(X);if(Z===null)return null;var J=Z[Q];if(C_(Q,z.type,Z))return null;if(J&&typeof J!=="function")throw Error("Expected `"+Q+"` listener to be a function, instead got a value of `"+typeof J+"` type.");return J}var rJ=!1;if(O0)try{var BQ={};Object.defineProperty(BQ,"passive",{get:function(){rJ=!0}}),window.addEventListener("test",BQ,BQ),window.removeEventListener("test",BQ,BQ)}catch(z){rJ=!1}function pG(z,Q,X,Z,J,$,q,U,L){var P=Array.prototype.slice.call(arguments,3);try{Q.apply(X,P)}catch(C){this.onError(C)}}var jG=pG;if(typeof window<"u"&&typeof window.dispatchEvent==="function"&&typeof document<"u"&&typeof document.createEvent==="function"){var tJ=document.createElement("react");jG=function(Q,X,Z,J,$,q,U,L,P){if(typeof document>"u"||document===null)throw Error("The `document` global was defined when React was initialized, but is not defined anymore. This can happen in a test environment if a component schedules an update from an asynchronous callback, but the test has already finished running. To solve this, you can either unmount the component at the end of your test (and ensure that any asynchronous operations get canceled in `componentWillUnmount`), or you can change the test itself to be asynchronous.");var C=document.createEvent("Event"),i=!1,d=!0,Z0=window.event,J0=Object.getOwnPropertyDescriptor(window,"event");function $0(){if(tJ.removeEventListener(K0,U1,!1),typeof window.event<"u"&&window.hasOwnProperty("event"))window.event=Z0}var p0=Array.prototype.slice.call(arguments,3);function U1(){i=!0,$0(),X.apply(Z,p0),d=!1}var X1,j1=!1,l1=!1;function s(e){if(X1=e.error,j1=!0,X1===null&&e.colno===0&&e.lineno===0)l1=!0;if(e.defaultPrevented){if(X1!=null&&typeof X1==="object")try{X1._suppressLogging=!0}catch(T0){}}}var K0="react-"+(Q?Q:"invokeguardedcallback");if(window.addEventListener("error",s),tJ.addEventListener(K0,U1,!1),C.initEvent(K0,!1,!1),tJ.dispatchEvent(C),J0)Object.defineProperty(window,"event",J0);if(i&&d){if(!j1)X1=Error(`An error was thrown inside one of your components, but React doesn't know what it was. This is likely due to browser flakiness. React does its best to preserve the "Pause on exceptions" behavior of the DevTools, which requires some DEV-mode only tricks. It's possible that these don't work in your browser. Try triggering the error in production mode, or switching to a modern browser. If you suspect that this is actually an issue with React, please file an issue.`);else if(l1)X1=Error("A cross-origin error was thrown. React doesn't have access to the actual error object in development. See https://reactjs.org/link/crossorigin-error for more information.");this.onError(X1)}if(window.removeEventListener("error",s),!i)return $0(),pG.apply(this,arguments)}}var v_=jG,l2=!1,UZ=null,WZ=!1,sJ=null,S_={onError:function(z){l2=!0,UZ=z}};function eJ(z,Q,X,Z,J,$,q,U,L){l2=!1,UZ=null,v_.apply(S_,arguments)}function f_(z,Q,X,Z,J,$,q,U,L){if(eJ.apply(this,arguments),l2){var P=zY();if(!WZ)WZ=!0,sJ=P}}function h_(){if(WZ){var z=sJ;throw WZ=!1,sJ=null,z}}function y_(){return l2}function zY(){if(l2){var z=UZ;return l2=!1,UZ=null,z}else throw Error("clearCaughtError was called but no error was captured. This error is likely caused by a bug in React. Please file an issue.")}function c2(z){return z._reactInternals}function V_(z){return z._reactInternals!==void 0}function D_(z,Q){z._reactInternals=Q}var w1=0,d2=1,J5=2,t1=4,c8=16,UQ=32,QY=64,J4=128,V7=256,U8=512,d8=1024,o6=2048,D7=4096,i8=8192,KZ=16384,m_=o6|t1|QY|U8|d8|KZ,g_=32767,WQ=32768,Q6=65536,XY=131072,lG=1048576,ZY=2097152,o8=4194304,JY=8388608,m7=16777216,OZ=33554432,YY=t1|d8|0,$Y=J5|t1|c8|UQ|U8|D7|i8,KQ=t1|QY|U8|i8,i2=o6|c8,g7=o8|JY|ZY,u_=Y.ReactCurrentOwner;function a8(z){var Q=z,X=z;if(!z.alternate){var Z=Q;do{if(Q=Z,(Q.flags&(J5|D7))!==w1)X=Q.return;Z=Q.return}while(Z)}else while(Q.return)Q=Q.return;if(Q.tag===b)return X;return null}function cG(z){if(z.tag===T){var Q=z.memoizedState;if(Q===null){var X=z.alternate;if(X!==null)Q=X.memoizedState}if(Q!==null)return Q.dehydrated}return null}function dG(z){return z.tag===b?z.stateNode.containerInfo:null}function E_(z){return a8(z)===z}function x_(z){{var Q=u_.current;if(Q!==null&&Q.tag===O){var X=Q,Z=X.stateNode;if(!Z._warnedAboutRefsInRender)G("%s is accessing isMounted inside its render() function. render() should be a pure function of props and state. It should never access something that requires stale data from the previous render, such as refs. Move this logic to componentDidMount and componentDidUpdate instead.",g1(X)||"A component");Z._warnedAboutRefsInRender=!0}}var J=c2(z);if(!J)return!1;return a8(J)===J}function iG(z){if(a8(z)!==z)throw Error("Unable to find node on an unmounted component.")}function oG(z){var Q=z.alternate;if(!Q){var X=a8(z);if(X===null)throw Error("Unable to find node on an unmounted component.");if(X!==z)return null;return z}var Z=z,J=Q;while(!0){var $=Z.return;if($===null)break;var q=$.alternate;if(q===null){var U=$.return;if(U!==null){Z=J=U;continue}break}if($.child===q.child){var L=$.child;while(L){if(L===Z)return iG($),z;if(L===J)return iG($),Q;L=L.sibling}throw Error("Unable to find node on an unmounted component.")}if(Z.return!==J.return)Z=$,J=q;else{var P=!1,C=$.child;while(C){if(C===Z){P=!0,Z=$,J=q;break}if(C===J){P=!0,J=$,Z=q;break}C=C.sibling}if(!P){C=q.child;while(C){if(C===Z){P=!0,Z=q,J=$;break}if(C===J){P=!0,J=q,Z=$;break}C=C.sibling}if(!P)throw Error("Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue.")}}if(Z.alternate!==J)throw Error("Return fibers should always be each others' alternates. This error is likely caused by a bug in React. Please file an issue.")}if(Z.tag!==b)throw Error("Unable to find node on an unmounted component.");if(Z.stateNode.current===Z)return z;return Q}function aG(z){var Q=oG(z);return Q!==null?nG(Q):null}function nG(z){if(z.tag===A||z.tag===R)return z;var Q=z.child;while(Q!==null){var X=nG(Q);if(X!==null)return X;Q=Q.sibling}return null}function p_(z){var Q=oG(z);return Q!==null?rG(Q):null}function rG(z){if(z.tag===A||z.tag===R)return z;var Q=z.child;while(Q!==null){if(Q.tag!==M){var X=rG(Q);if(X!==null)return X}Q=Q.sibling}return null}var tG=R4.unstable_scheduleCallback,j_=R4.unstable_cancelCallback,l_=R4.unstable_shouldYield,c_=R4.unstable_requestPaint,b5=R4.unstable_now,d_=R4.unstable_getCurrentPriorityLevel,_Z=R4.unstable_ImmediatePriority,HY=R4.unstable_UserBlockingPriority,n8=R4.unstable_NormalPriority,i_=R4.unstable_LowPriority,GY=R4.unstable_IdlePriority,o_=R4.unstable_yieldValue,a_=R4.unstable_setDisableYieldValue,r8=null,C5=null,c0=null,K7=!1,a6=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u";function n_(z){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")return!1;var Q=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(Q.isDisabled)return!0;if(!Q.supportsFiber)return G("The installed version of React DevTools is too old and will not work with the current version of React. Please update React DevTools. https://reactjs.org/link/react-devtools"),!0;try{if(z0)z=E1({},z,{getLaneLabelMap:QL,injectProfilingHooks:zL});r8=Q.inject(z),C5=Q}catch(X){G("React instrumentation encountered an error: %s.",X)}if(Q.checkDCE)return!0;else return!1}function r_(z,Q){if(C5&&typeof C5.onScheduleFiberRoot==="function")try{C5.onScheduleFiberRoot(r8,z,Q)}catch(X){if(!K7)K7=!0,G("React instrumentation encountered an error: %s",X)}}function t_(z,Q){if(C5&&typeof C5.onCommitFiberRoot==="function")try{var X=(z.current.flags&J4)===J4;if(v0){var Z;switch(Q){case I6:Z=_Z;break;case E7:Z=HY;break;case x7:Z=n8;break;case PZ:Z=GY;break;default:Z=n8;break}C5.onCommitFiberRoot(r8,z,Z,X)}else C5.onCommitFiberRoot(r8,z,void 0,X)}catch(J){if(!K7)K7=!0,G("React instrumentation encountered an error: %s",J)}}function s_(z){if(C5&&typeof C5.onPostCommitFiberRoot==="function")try{C5.onPostCommitFiberRoot(r8,z)}catch(Q){if(!K7)K7=!0,G("React instrumentation encountered an error: %s",Q)}}function e_(z){if(C5&&typeof C5.onCommitFiberUnmount==="function")try{C5.onCommitFiberUnmount(r8,z)}catch(Q){if(!K7)K7=!0,G("React instrumentation encountered an error: %s",Q)}}function P5(z){{if(typeof o_==="function")a_(z),B(z);if(C5&&typeof C5.setStrictMode==="function")try{C5.setStrictMode(r8,z)}catch(Q){if(!K7)K7=!0,G("React instrumentation encountered an error: %s",Q)}}}function zL(z){c0=z}function QL(){{var z=new Map,Q=1;for(var X=0;X<BY;X++){var Z=FL(Q);z.set(Q,Z),Q*=2}return z}}function XL(z){if(c0!==null&&typeof c0.markCommitStarted==="function")c0.markCommitStarted(z)}function sG(){if(c0!==null&&typeof c0.markCommitStopped==="function")c0.markCommitStopped()}function OQ(z){if(c0!==null&&typeof c0.markComponentRenderStarted==="function")c0.markComponentRenderStarted(z)}function o2(){if(c0!==null&&typeof c0.markComponentRenderStopped==="function")c0.markComponentRenderStopped()}function ZL(z){if(c0!==null&&typeof c0.markComponentPassiveEffectMountStarted==="function")c0.markComponentPassiveEffectMountStarted(z)}function JL(){if(c0!==null&&typeof c0.markComponentPassiveEffectMountStopped==="function")c0.markComponentPassiveEffectMountStopped()}function YL(z){if(c0!==null&&typeof c0.markComponentPassiveEffectUnmountStarted==="function")c0.markComponentPassiveEffectUnmountStarted(z)}function $L(){if(c0!==null&&typeof c0.markComponentPassiveEffectUnmountStopped==="function")c0.markComponentPassiveEffectUnmountStopped()}function HL(z){if(c0!==null&&typeof c0.markComponentLayoutEffectMountStarted==="function")c0.markComponentLayoutEffectMountStarted(z)}function GL(){if(c0!==null&&typeof c0.markComponentLayoutEffectMountStopped==="function")c0.markComponentLayoutEffectMountStopped()}function eG(z){if(c0!==null&&typeof c0.markComponentLayoutEffectUnmountStarted==="function")c0.markComponentLayoutEffectUnmountStarted(z)}function zq(){if(c0!==null&&typeof c0.markComponentLayoutEffectUnmountStopped==="function")c0.markComponentLayoutEffectUnmountStopped()}function qL(z,Q,X){if(c0!==null&&typeof c0.markComponentErrored==="function")c0.markComponentErrored(z,Q,X)}function BL(z,Q,X){if(c0!==null&&typeof c0.markComponentSuspended==="function")c0.markComponentSuspended(z,Q,X)}function UL(z){if(c0!==null&&typeof c0.markLayoutEffectsStarted==="function")c0.markLayoutEffectsStarted(z)}function WL(){if(c0!==null&&typeof c0.markLayoutEffectsStopped==="function")c0.markLayoutEffectsStopped()}function KL(z){if(c0!==null&&typeof c0.markPassiveEffectsStarted==="function")c0.markPassiveEffectsStarted(z)}function OL(){if(c0!==null&&typeof c0.markPassiveEffectsStopped==="function")c0.markPassiveEffectsStopped()}function Qq(z){if(c0!==null&&typeof c0.markRenderStarted==="function")c0.markRenderStarted(z)}function _L(){if(c0!==null&&typeof c0.markRenderYielded==="function")c0.markRenderYielded()}function Xq(){if(c0!==null&&typeof c0.markRenderStopped==="function")c0.markRenderStopped()}function LL(z){if(c0!==null&&typeof c0.markRenderScheduled==="function")c0.markRenderScheduled(z)}function NL(z,Q){if(c0!==null&&typeof c0.markForceUpdateScheduled==="function")c0.markForceUpdateScheduled(z,Q)}function qY(z,Q){if(c0!==null&&typeof c0.markStateUpdateScheduled==="function")c0.markStateUpdateScheduled(z,Q)}var O1=0,o1=1,_4=2,n4=8,O7=16,Zq=Math.clz32?Math.clz32:wL,RL=Math.log,ML=Math.LN2;function wL(z){var Q=z>>>0;if(Q===0)return 32;return 31-(RL(Q)/ML|0)|0}var BY=31,b0=0,A5=0,k1=1,a2=2,u7=4,t8=8,_7=16,_Q=32,n2=4194240,LQ=64,UY=128,WY=256,KY=512,OY=1024,_Y=2048,LY=4096,NY=8192,RY=16384,MY=32768,wY=65536,FY=131072,bY=262144,PY=524288,AY=1048576,IY=2097152,LZ=130023424,r2=4194304,TY=8388608,kY=16777216,CY=33554432,vY=67108864,Jq=r2,NQ=134217728,Yq=268435455,RQ=268435456,s8=536870912,P6=1073741824;function FL(z){{if(z&k1)return"Sync";if(z&a2)return"InputContinuousHydration";if(z&u7)return"InputContinuous";if(z&t8)return"DefaultHydration";if(z&_7)return"Default";if(z&_Q)return"TransitionHydration";if(z&n2)return"Transition";if(z&LZ)return"Retry";if(z&NQ)return"SelectiveHydration";if(z&RQ)return"IdleHydration";if(z&s8)return"Idle";if(z&P6)return"Offscreen"}}var V4=-1,NZ=LQ,RZ=r2;function MQ(z){switch(e8(z)){case k1:return k1;case a2:return a2;case u7:return u7;case t8:return t8;case _7:return _7;case _Q:return _Q;case LQ:case UY:case WY:case KY:case OY:case _Y:case LY:case NY:case RY:case MY:case wY:case FY:case bY:case PY:case AY:case IY:return z&n2;case r2:case TY:case kY:case CY:case vY:return z&LZ;case NQ:return NQ;case RQ:return RQ;case s8:return s8;case P6:return P6;default:return G("Should have found matching lanes. This is a bug in React."),z}}function MZ(z,Q){var X=z.pendingLanes;if(X===b0)return b0;var Z=b0,J=z.suspendedLanes,$=z.pingedLanes,q=X&Yq;if(q!==b0){var U=q&~J;if(U!==b0)Z=MQ(U);else{var L=q&$;if(L!==b0)Z=MQ(L)}}else{var P=X&~J;if(P!==b0)Z=MQ(P);else if($!==b0)Z=MQ($)}if(Z===b0)return b0;if(Q!==b0&&Q!==Z&&(Q&J)===b0){var C=e8(Z),i=e8(Q);if(C>=i||C===_7&&(i&n2)!==b0)return Q}if((Z&u7)!==b0)Z|=X&_7;var d=z.entangledLanes;if(d!==b0){var Z0=z.entanglements,J0=Z&d;while(J0>0){var $0=z2(J0),p0=1<<$0;Z|=Z0[$0],J0&=~p0}}return Z}function bL(z,Q){var X=z.eventTimes,Z=V4;while(Q>0){var J=z2(Q),$=1<<J,q=X[J];if(q>Z)Z=q;Q&=~$}return Z}function PL(z,Q){switch(z){case k1:case a2:case u7:return Q+250;case t8:case _7:case _Q:case LQ:case UY:case WY:case KY:case OY:case _Y:case LY:case NY:case RY:case MY:case wY:case FY:case bY:case PY:case AY:case IY:return Q+5000;case r2:case TY:case kY:case CY:case vY:return V4;case NQ:case RQ:case s8:case P6:return V4;default:return G("Should have found matching lanes. This is a bug in React."),V4}}function AL(z,Q){var{pendingLanes:X,suspendedLanes:Z,pingedLanes:J,expirationTimes:$}=z,q=X;while(q>0){var U=z2(q),L=1<<U,P=$[U];if(P===V4){if((L&Z)===b0||(L&J)!==b0)$[U]=PL(L,Q)}else if(P<=Q)z.expiredLanes|=L;q&=~L}}function IL(z){return MQ(z.pendingLanes)}function SY(z){var Q=z.pendingLanes&~P6;if(Q!==b0)return Q;if(Q&P6)return P6;return b0}function TL(z){return(z&k1)!==b0}function fY(z){return(z&Yq)!==b0}function $q(z){return(z&LZ)===z}function kL(z){var Q=k1|u7|_7;return(z&Q)===b0}function CL(z){return(z&n2)===z}function wZ(z,Q){var X=a2|u7|t8|_7;return(Q&X)!==b0}function vL(z,Q){return(Q&z.expiredLanes)!==b0}function Hq(z){return(z&n2)!==b0}function Gq(){var z=NZ;if(NZ<<=1,(NZ&n2)===b0)NZ=LQ;return z}function SL(){var z=RZ;if(RZ<<=1,(RZ&LZ)===b0)RZ=r2;return z}function e8(z){return z&-z}function wQ(z){return e8(z)}function z2(z){return 31-Zq(z)}function hY(z){return z2(z)}function A6(z,Q){return(z&Q)!==b0}function t2(z,Q){return(z&Q)===Q}function u1(z,Q){return z|Q}function FZ(z,Q){return z&~Q}function qq(z,Q){return z&Q}function bZ(z){return z}function fL(z,Q){return z!==A5&&z<Q?z:Q}function yY(z){var Q=[];for(var X=0;X<BY;X++)Q.push(z);return Q}function FQ(z,Q,X){if(z.pendingLanes|=Q,Q!==s8)z.suspendedLanes=b0,z.pingedLanes=b0;var Z=z.eventTimes,J=hY(Q);Z[J]=X}function hL(z,Q){z.suspendedLanes|=Q,z.pingedLanes&=~Q;var X=z.expirationTimes,Z=Q;while(Z>0){var J=z2(Z),$=1<<J;X[J]=V4,Z&=~$}}function Bq(z,Q,X){z.pingedLanes|=z.suspendedLanes&Q}function yL(z,Q){var X=z.pendingLanes&~Q;z.pendingLanes=Q,z.suspendedLanes=b0,z.pingedLanes=b0,z.expiredLanes&=Q,z.mutableReadLanes&=Q,z.entangledLanes&=Q;var{entanglements:Z,eventTimes:J,expirationTimes:$}=z,q=X;while(q>0){var U=z2(q),L=1<<U;Z[U]=b0,J[U]=V4,$[U]=V4,q&=~L}}function VY(z,Q){var X=z.entangledLanes|=Q,Z=z.entanglements,J=X;while(J){var $=z2(J),q=1<<$;if(q&Q|Z[$]&Q)Z[$]|=Q;J&=~q}}function VL(z,Q){var X=e8(Q),Z;switch(X){case u7:Z=a2;break;case _7:Z=t8;break;case LQ:case UY:case WY:case KY:case OY:case _Y:case LY:case NY:case RY:case MY:case wY:case FY:case bY:case PY:case AY:case IY:case r2:case TY:case kY:case CY:case vY:Z=_Q;break;case s8:Z=RQ;break;default:Z=A5;break}if((Z&(z.suspendedLanes|Q))!==A5)return A5;return Z}function Uq(z,Q,X){if(!a6)return;var Z=z.pendingUpdatersLaneMap;while(X>0){var J=hY(X),$=1<<J,q=Z[J];q.add(Q),X&=~$}}function Wq(z,Q){if(!a6)return;var{pendingUpdatersLaneMap:X,memoizedUpdaters:Z}=z;while(Q>0){var J=hY(Q),$=1<<J,q=X[J];if(q.size>0)q.forEach(function(U){var L=U.alternate;if(L===null||!Z.has(L))Z.add(U)}),q.clear();Q&=~$}}function Kq(z,Q){return null}var I6=k1,E7=u7,x7=_7,PZ=s8,bQ=A5;function n6(){return bQ}function I5(z){bQ=z}function DL(z,Q){var X=bQ;try{return bQ=z,Q()}finally{bQ=X}}function mL(z,Q){return z!==0&&z<Q?z:Q}function gL(z,Q){return z===0||z>Q?z:Q}function DY(z,Q){return z!==0&&z<Q}function Oq(z){var Q=e8(z);if(!DY(I6,Q))return I6;if(!DY(E7,Q))return E7;if(fY(Q))return x7;return PZ}function AZ(z){var Q=z.current.memoizedState;return Q.isDehydrated}var _q;function uL(z){_q=z}function EL(z){_q(z)}var mY;function xL(z){mY=z}var Lq;function pL(z){Lq=z}var Nq;function jL(z){Nq=z}var Rq;function lL(z){Rq=z}var gY=!1,IZ=[],W8=null,K8=null,O8=null,PQ=new Map,AQ=new Map,_8=[],cL=["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","submit"];function dL(z){return cL.indexOf(z)>-1}function iL(z,Q,X,Z,J){return{blockedOn:z,domEventName:Q,eventSystemFlags:X,nativeEvent:J,targetContainers:[Z]}}function Mq(z,Q){switch(z){case"focusin":case"focusout":W8=null;break;case"dragenter":case"dragleave":K8=null;break;case"mouseover":case"mouseout":O8=null;break;case"pointerover":case"pointerout":{var X=Q.pointerId;PQ.delete(X);break}case"gotpointercapture":case"lostpointercapture":{var Z=Q.pointerId;AQ.delete(Z);break}}}function IQ(z,Q,X,Z,J,$){if(z===null||z.nativeEvent!==$){var q=iL(Q,X,Z,J,$);if(Q!==null){var U=R8(Q);if(U!==null)mY(U)}return q}z.eventSystemFlags|=Z;var L=z.targetContainers;if(J!==null&&L.indexOf(J)===-1)L.push(J);return z}function oL(z,Q,X,Z,J){switch(Q){case"focusin":{var $=J;return W8=IQ(W8,z,Q,X,Z,$),!0}case"dragenter":{var q=J;return K8=IQ(K8,z,Q,X,Z,q),!0}case"mouseover":{var U=J;return O8=IQ(O8,z,Q,X,Z,U),!0}case"pointerover":{var L=J,P=L.pointerId;return PQ.set(P,IQ(PQ.get(P)||null,z,Q,X,Z,L)),!0}case"gotpointercapture":{var C=J,i=C.pointerId;return AQ.set(i,IQ(AQ.get(i)||null,z,Q,X,Z,C)),!0}}return!1}function wq(z){var Q=Z2(z.target);if(Q!==null){var X=a8(Q);if(X!==null){var Z=X.tag;if(Z===T){var J=cG(X);if(J!==null){z.blockedOn=J,Rq(z.priority,function(){Lq(X)});return}}else if(Z===b){var $=X.stateNode;if(AZ($)){z.blockedOn=dG(X);return}}}}z.blockedOn=null}function aL(z){var Q=Nq(),X={blockedOn:null,target:z,priority:Q},Z=0;for(;Z<_8.length;Z++)if(!DY(Q,_8[Z].priority))break;if(_8.splice(Z,0,X),Z===0)wq(X)}function TZ(z){if(z.blockedOn!==null)return!1;var Q=z.targetContainers;while(Q.length>0){var X=Q[0],Z=xY(z.domEventName,z.eventSystemFlags,X,z.nativeEvent);if(Z===null){var J=z.nativeEvent,$=new J.constructor(J.type,J);w_($),J.target.dispatchEvent($),F_()}else{var q=R8(Z);if(q!==null)mY(q);return z.blockedOn=Z,!1}Q.shift()}return!0}function Fq(z,Q,X){if(TZ(z))X.delete(Q)}function nL(){if(gY=!1,W8!==null&&TZ(W8))W8=null;if(K8!==null&&TZ(K8))K8=null;if(O8!==null&&TZ(O8))O8=null;PQ.forEach(Fq),AQ.forEach(Fq)}function TQ(z,Q){if(z.blockedOn===Q){if(z.blockedOn=null,!gY)gY=!0,R4.unstable_scheduleCallback(R4.unstable_NormalPriority,nL)}}function kQ(z){if(IZ.length>0){TQ(IZ[0],z);for(var Q=1;Q<IZ.length;Q++){var X=IZ[Q];if(X.blockedOn===z)X.blockedOn=null}}if(W8!==null)TQ(W8,z);if(K8!==null)TQ(K8,z);if(O8!==null)TQ(O8,z);var Z=function(U){return TQ(U,z)};PQ.forEach(Z),AQ.forEach(Z);for(var J=0;J<_8.length;J++){var $=_8[J];if($.blockedOn===z)$.blockedOn=null}while(_8.length>0){var q=_8[0];if(q.blockedOn!==null)break;else if(wq(q),q.blockedOn===null)_8.shift()}}var s2=Y.ReactCurrentBatchConfig,uY=!0;function bq(z){uY=!!z}function rL(){return uY}function tL(z,Q,X){var Z=Pq(Q),J;switch(Z){case I6:J=sL;break;case E7:J=eL;break;case x7:default:J=EY;break}return J.bind(null,Q,X,z)}function sL(z,Q,X,Z){var J=n6(),$=s2.transition;s2.transition=null;try{I5(I6),EY(z,Q,X,Z)}finally{I5(J),s2.transition=$}}function eL(z,Q,X,Z){var J=n6(),$=s2.transition;s2.transition=null;try{I5(E7),EY(z,Q,X,Z)}finally{I5(J),s2.transition=$}}function EY(z,Q,X,Z){if(!uY)return;zN(z,Q,X,Z)}function zN(z,Q,X,Z){var J=xY(z,Q,X,Z);if(J===null){z$(z,Q,Z,kZ,X),Mq(z,Z);return}if(oL(J,z,Q,X,Z)){Z.stopPropagation();return}if(Mq(z,Z),Q&HQ&&dL(z)){while(J!==null){var $=R8(J);if($!==null)EL($);var q=xY(z,Q,X,Z);if(q===null)z$(z,Q,Z,kZ,X);if(q===J)break;J=q}if(J!==null)Z.stopPropagation();return}z$(z,Q,Z,null,X)}var kZ=null;function xY(z,Q,X,Z){kZ=null;var J=oJ(Z),$=Z2(J);if($!==null){var q=a8($);if(q===null)$=null;else{var U=q.tag;if(U===T){var L=cG(q);if(L!==null)return L;$=null}else if(U===b){var P=q.stateNode;if(AZ(P))return dG(q);$=null}else if(q!==$)$=null}}return kZ=$,null}function Pq(z){switch(z){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"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 I6;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"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return E7;case"message":{var Q=d_();switch(Q){case _Z:return I6;case HY:return E7;case n8:case i_:return x7;case GY:return PZ;default:return x7}}default:return x7}}function QN(z,Q,X){return z.addEventListener(Q,X,!1),X}function XN(z,Q,X){return z.addEventListener(Q,X,!0),X}function ZN(z,Q,X,Z){return z.addEventListener(Q,X,{capture:!0,passive:Z}),X}function JN(z,Q,X,Z){return z.addEventListener(Q,X,{passive:Z}),X}var CQ=null,pY=null,vQ=null;function YN(z){return CQ=z,pY=Iq(),!0}function $N(){CQ=null,pY=null,vQ=null}function Aq(){if(vQ)return vQ;var z,Q=pY,X=Q.length,Z,J=Iq(),$=J.length;for(z=0;z<X;z++)if(Q[z]!==J[z])break;var q=X-z;for(Z=1;Z<=q;Z++)if(Q[X-Z]!==J[$-Z])break;var U=Z>1?1-Z:void 0;return vQ=J.slice(z,U),vQ}function Iq(){if("value"in CQ)return CQ.value;return CQ.textContent}function CZ(z){var Q,X=z.keyCode;if("charCode"in z){if(Q=z.charCode,Q===0&&X===13)Q=13}else Q=X;if(Q===10)Q=13;if(Q>=32||Q===13)return Q;return 0}function vZ(){return!0}function Tq(){return!1}function T6(z){function Q(X,Z,J,$,q){this._reactName=X,this._targetInst=J,this.type=Z,this.nativeEvent=$,this.target=q,this.currentTarget=null;for(var U in z){if(!z.hasOwnProperty(U))continue;var L=z[U];if(L)this[U]=L($);else this[U]=$[U]}var P=$.defaultPrevented!=null?$.defaultPrevented:$.returnValue===!1;if(P)this.isDefaultPrevented=vZ;else this.isDefaultPrevented=Tq;return this.isPropagationStopped=Tq,this}return E1(Q.prototype,{preventDefault:function(){this.defaultPrevented=!0;var X=this.nativeEvent;if(!X)return;if(X.preventDefault)X.preventDefault();else if(typeof X.returnValue!=="unknown")X.returnValue=!1;this.isDefaultPrevented=vZ},stopPropagation:function(){var X=this.nativeEvent;if(!X)return;if(X.stopPropagation)X.stopPropagation();else if(typeof X.cancelBubble!=="unknown")X.cancelBubble=!0;this.isPropagationStopped=vZ},persist:function(){},isPersistent:vZ}),Q}var e2={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(z){return z.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},jY=T6(e2),SQ=E1({},e2,{view:0,detail:0}),HN=T6(SQ),lY,cY,fQ;function GN(z){if(z!==fQ){if(fQ&&z.type==="mousemove")lY=z.screenX-fQ.screenX,cY=z.screenY-fQ.screenY;else lY=0,cY=0;fQ=z}}var SZ=E1({},SQ,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:iY,button:0,buttons:0,relatedTarget:function(z){if(z.relatedTarget===void 0)return z.fromElement===z.srcElement?z.toElement:z.fromElement;return z.relatedTarget},movementX:function(z){if("movementX"in z)return z.movementX;return GN(z),lY},movementY:function(z){if("movementY"in z)return z.movementY;return cY}}),kq=T6(SZ),qN=E1({},SZ,{dataTransfer:0}),BN=T6(qN),UN=E1({},SQ,{relatedTarget:0}),dY=T6(UN),WN=E1({},e2,{animationName:0,elapsedTime:0,pseudoElement:0}),KN=T6(WN),ON=E1({},e2,{clipboardData:function(z){return"clipboardData"in z?z.clipboardData:window.clipboardData}}),_N=T6(ON),LN=E1({},e2,{data:0}),Cq=T6(LN),NN=Cq,RN={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},MN={"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"};function wN(z){if(z.key){var Q=RN[z.key]||z.key;if(Q!=="Unidentified")return Q}if(z.type==="keypress"){var X=CZ(z);return X===13?"Enter":String.fromCharCode(X)}if(z.type==="keydown"||z.type==="keyup")return MN[z.keyCode]||"Unidentified";return""}var FN={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function bN(z){var Q=this,X=Q.nativeEvent;if(X.getModifierState)return X.getModifierState(z);var Z=FN[z];return Z?!!X[Z]:!1}function iY(z){return bN}var PN=E1({},SQ,{key:wN,code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:iY,charCode:function(z){if(z.type==="keypress")return CZ(z);return 0},keyCode:function(z){if(z.type==="keydown"||z.type==="keyup")return z.keyCode;return 0},which:function(z){if(z.type==="keypress")return CZ(z);if(z.type==="keydown"||z.type==="keyup")return z.keyCode;return 0}}),AN=T6(PN),IN=E1({},SZ,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),vq=T6(IN),TN=E1({},SQ,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:iY}),kN=T6(TN),CN=E1({},e2,{propertyName:0,elapsedTime:0,pseudoElement:0}),vN=T6(CN),SN=E1({},SZ,{deltaX:function(z){return"deltaX"in z?z.deltaX:("wheelDeltaX"in z)?-z.wheelDeltaX:0},deltaY:function(z){return"deltaY"in z?z.deltaY:("wheelDeltaY"in z)?-z.wheelDeltaY:("wheelDelta"in z)?-z.wheelDelta:0},deltaZ:0,deltaMode:0}),fN=T6(SN),hN=[9,13,27,32],Sq=229,oY=O0&&"CompositionEvent"in window,hQ=null;if(O0&&"documentMode"in document)hQ=document.documentMode;var yN=O0&&"TextEvent"in window&&!hQ,fq=O0&&(!oY||hQ&&hQ>8&&hQ<=11),hq=32,yq=String.fromCharCode(hq);function VN(){R1("onBeforeInput",["compositionend","keypress","textInput","paste"]),R1("onCompositionEnd",["compositionend","focusout","keydown","keypress","keyup","mousedown"]),R1("onCompositionStart",["compositionstart","focusout","keydown","keypress","keyup","mousedown"]),R1("onCompositionUpdate",["compositionupdate","focusout","keydown","keypress","keyup","mousedown"])}var Vq=!1;function DN(z){return(z.ctrlKey||z.altKey||z.metaKey)&&!(z.ctrlKey&&z.altKey)}function mN(z){switch(z){case"compositionstart":return"onCompositionStart";case"compositionend":return"onCompositionEnd";case"compositionupdate":return"onCompositionUpdate"}}function gN(z,Q){return z==="keydown"&&Q.keyCode===Sq}function Dq(z,Q){switch(z){case"keyup":return hN.indexOf(Q.keyCode)!==-1;case"keydown":return Q.keyCode!==Sq;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function mq(z){var Q=z.detail;if(typeof Q==="object"&&"data"in Q)return Q.data;return null}function gq(z){return z.locale==="ko"}var zz=!1;function uN(z,Q,X,Z,J){var $,q;if(oY)$=mN(Q);else if(!zz){if(gN(Q,Z))$="onCompositionStart"}else if(Dq(Q,Z))$="onCompositionEnd";if(!$)return null;if(fq&&!gq(Z)){if(!zz&&$==="onCompositionStart")zz=YN(J);else if($==="onCompositionEnd"){if(zz)q=Aq()}}var U=DZ(X,$);if(U.length>0){var L=new Cq($,Q,null,Z,J);if(z.push({event:L,listeners:U}),q)L.data=q;else{var P=mq(Z);if(P!==null)L.data=P}}}function EN(z,Q){switch(z){case"compositionend":return mq(Q);case"keypress":var X=Q.which;if(X!==hq)return null;return Vq=!0,yq;case"textInput":var Z=Q.data;if(Z===yq&&Vq)return null;return Z;default:return null}}function xN(z,Q){if(zz){if(z==="compositionend"||!oY&&Dq(z,Q)){var X=Aq();return $N(),zz=!1,X}return null}switch(z){case"paste":return null;case"keypress":if(!DN(Q)){if(Q.char&&Q.char.length>1)return Q.char;else if(Q.which)return String.fromCharCode(Q.which)}return null;case"compositionend":return fq&&!gq(Q)?null:Q.data;default:return null}}function pN(z,Q,X,Z,J){var $;if(yN)$=EN(Q,Z);else $=xN(Q,Z);if(!$)return null;var q=DZ(X,"onBeforeInput");if(q.length>0){var U=new NN("onBeforeInput","beforeinput",null,Z,J);z.push({event:U,listeners:q}),U.data=$}}function jN(z,Q,X,Z,J,$,q){uN(z,Q,X,Z,J),pN(z,Q,X,Z,J)}var lN={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 uq(z){var Q=z&&z.nodeName&&z.nodeName.toLowerCase();if(Q==="input")return!!lN[z.type];if(Q==="textarea")return!0;return!1}function cN(z){if(!O0)return!1;var Q="on"+z,X=Q in document;if(!X){var Z=document.createElement("div");Z.setAttribute(Q,"return;"),X=typeof Z[Q]==="function"}return X}function dN(){R1("onChange",["change","click","focusin","focusout","input","keydown","keyup","selectionchange"])}function Eq(z,Q,X,Z){mG(Z);var J=DZ(Q,"onChange");if(J.length>0){var $=new jY("onChange","change",null,X,Z);z.push({event:$,listeners:J})}}var yQ=null,VQ=null;function iN(z){var Q=z.nodeName&&z.nodeName.toLowerCase();return Q==="select"||Q==="input"&&z.type==="file"}function oN(z){var Q=[];Eq(Q,VQ,z,oJ(z)),xG(aN,Q)}function aN(z){ZB(z,0)}function fZ(z){var Q=$z(z);if(m2(Q))return z}function nN(z,Q){if(z==="change")return Q}var xq=!1;if(O0)xq=cN("input")&&(!document.documentMode||document.documentMode>9);function rN(z,Q){yQ=z,VQ=Q,yQ.attachEvent("onpropertychange",jq)}function pq(){if(!yQ)return;yQ.detachEvent("onpropertychange",jq),yQ=null,VQ=null}function jq(z){if(z.propertyName!=="value")return;if(fZ(VQ))oN(z)}function tN(z,Q,X){if(z==="focusin")pq(),rN(Q,X);else if(z==="focusout")pq()}function sN(z,Q){if(z==="selectionchange"||z==="keyup"||z==="keydown")return fZ(VQ)}function eN(z){var Q=z.nodeName;return Q&&Q.toLowerCase()==="input"&&(z.type==="checkbox"||z.type==="radio")}function zR(z,Q){if(z==="click")return fZ(Q)}function QR(z,Q){if(z==="input"||z==="change")return fZ(Q)}function XR(z){var Q=z._wrapperState;if(!Q||!Q.controlled||z.type!=="number")return;T1(z,"number",z.value)}function ZR(z,Q,X,Z,J,$,q){var U=X?$z(X):window,L,P;if(iN(U))L=nN;else if(uq(U))if(xq)L=QR;else L=sN,P=tN;else if(eN(U))L=zR;if(L){var C=L(Q,X);if(C){Eq(z,C,Z,J);return}}if(P)P(Q,U,X);if(Q==="focusout")XR(U)}function JR(){p("onMouseEnter",["mouseout","mouseover"]),p("onMouseLeave",["mouseout","mouseover"]),p("onPointerEnter",["pointerout","pointerover"]),p("onPointerLeave",["pointerout","pointerover"])}function YR(z,Q,X,Z,J,$,q){var U=Q==="mouseover"||Q==="pointerover",L=Q==="mouseout"||Q==="pointerout";if(U&&!b_(Z)){var P=Z.relatedTarget||Z.fromElement;if(P){if(Z2(P)||nQ(P))return}}if(!L&&!U)return;var C;if(J.window===J)C=J;else{var i=J.ownerDocument;if(i)C=i.defaultView||i.parentWindow;else C=window}var d,Z0;if(L){var J0=Z.relatedTarget||Z.toElement;if(d=X,Z0=J0?Z2(J0):null,Z0!==null){var $0=a8(Z0);if(Z0!==$0||Z0.tag!==A&&Z0.tag!==R)Z0=null}}else d=null,Z0=X;if(d===Z0)return;var p0=kq,U1="onMouseLeave",X1="onMouseEnter",j1="mouse";if(Q==="pointerout"||Q==="pointerover")p0=vq,U1="onPointerLeave",X1="onPointerEnter",j1="pointer";var l1=d==null?C:$z(d),s=Z0==null?C:$z(Z0),K0=new p0(U1,j1+"leave",d,Z,J);K0.target=l1,K0.relatedTarget=s;var e=null,T0=Z2(J);if(T0===X){var i0=new p0(X1,j1+"enter",Z0,Z,J);i0.target=s,i0.relatedTarget=l1,e=i0}vR(z,K0,e,d,Z0)}function $R(z,Q){return z===Q&&(z!==0||1/z===1/Q)||z!==z&&Q!==Q}var k6=typeof Object.is==="function"?Object.is:$R;function DQ(z,Q){if(k6(z,Q))return!0;if(typeof z!=="object"||z===null||typeof Q!=="object"||Q===null)return!1;var X=Object.keys(z),Z=Object.keys(Q);if(X.length!==Z.length)return!1;for(var J=0;J<X.length;J++){var $=X[J];if(!V0.call(Q,$)||!k6(z[$],Q[$]))return!1}return!0}function lq(z){while(z&&z.firstChild)z=z.firstChild;return z}function HR(z){while(z){if(z.nextSibling)return z.nextSibling;z=z.parentNode}}function cq(z,Q){var X=lq(z),Z=0,J=0;while(X){if(X.nodeType===h7){if(J=Z+X.textContent.length,Z<=Q&&J>=Q)return{node:X,offset:Q-Z};Z=J}X=lq(HR(X))}}function GR(z){var Q=z.ownerDocument,X=Q&&Q.defaultView||window,Z=X.getSelection&&X.getSelection();if(!Z||Z.rangeCount===0)return null;var{anchorNode:J,anchorOffset:$,focusNode:q,focusOffset:U}=Z;try{J.nodeType,q.nodeType}catch(L){return null}return qR(z,J,$,q,U)}function qR(z,Q,X,Z,J){var $=0,q=-1,U=-1,L=0,P=0,C=z,i=null;z:while(!0){var d=null;while(!0){if(C===Q&&(X===0||C.nodeType===h7))q=$+X;if(C===Z&&(J===0||C.nodeType===h7))U=$+J;if(C.nodeType===h7)$+=C.nodeValue.length;if((d=C.firstChild)===null)break;i=C,C=d}while(!0){if(C===z)break z;if(i===Q&&++L===X)q=$;if(i===Z&&++P===J)U=$;if((d=C.nextSibling)!==null)break;C=i,i=C.parentNode}C=d}if(q===-1||U===-1)return null;return{start:q,end:U}}function BR(z,Q){var X=z.ownerDocument||document,Z=X&&X.defaultView||window;if(!Z.getSelection)return;var J=Z.getSelection(),$=z.textContent.length,q=Math.min(Q.start,$),U=Q.end===void 0?q:Math.min(Q.end,$);if(!J.extend&&q>U){var L=U;U=q,q=L}var P=cq(z,q),C=cq(z,U);if(P&&C){if(J.rangeCount===1&&J.anchorNode===P.node&&J.anchorOffset===P.offset&&J.focusNode===C.node&&J.focusOffset===C.offset)return;var i=X.createRange();if(i.setStart(P.node,P.offset),J.removeAllRanges(),q>U)J.addRange(i),J.extend(C.node,C.offset);else i.setEnd(C.node,C.offset),J.addRange(i)}}function dq(z){return z&&z.nodeType===h7}function iq(z,Q){if(!z||!Q)return!1;else if(z===Q)return!0;else if(dq(z))return!1;else if(dq(Q))return iq(z,Q.parentNode);else if("contains"in z)return z.contains(Q);else if(z.compareDocumentPosition)return!!(z.compareDocumentPosition(Q)&16);else return!1}function UR(z){return z&&z.ownerDocument&&iq(z.ownerDocument.documentElement,z)}function WR(z){try{return typeof z.contentWindow.location.href==="string"}catch(Q){return!1}}function oq(){var z=window,Q=B8();while(Q instanceof z.HTMLIFrameElement){if(WR(Q))z=Q.contentWindow;else return Q;Q=B8(z.document)}return Q}function aY(z){var Q=z&&z.nodeName&&z.nodeName.toLowerCase();return Q&&(Q==="input"&&(z.type==="text"||z.type==="search"||z.type==="tel"||z.type==="url"||z.type==="password")||Q==="textarea"||z.contentEditable==="true")}function KR(){var z=oq();return{focusedElem:z,selectionRange:aY(z)?_R(z):null}}function OR(z){var Q=oq(),X=z.focusedElem,Z=z.selectionRange;if(Q!==X&&UR(X)){if(Z!==null&&aY(X))LR(X,Z);var J=[],$=X;while($=$.parentNode)if($.nodeType===B6)J.push({element:$,left:$.scrollLeft,top:$.scrollTop});if(typeof X.focus==="function")X.focus();for(var q=0;q<J.length;q++){var U=J[q];U.element.scrollLeft=U.left,U.element.scrollTop=U.top}}}function _R(z){var Q;if("selectionStart"in z)Q={start:z.selectionStart,end:z.selectionEnd};else Q=GR(z);return Q||{start:0,end:0}}function LR(z,Q){var{start:X,end:Z}=Q;if(Z===void 0)Z=X;if("selectionStart"in z)z.selectionStart=X,z.selectionEnd=Math.min(Z,z.value.length);else BR(z,Q)}var NR=O0&&"documentMode"in document&&document.documentMode<=11;function RR(){R1("onSelect",["focusout","contextmenu","dragend","focusin","keydown","keyup","mousedown","mouseup","selectionchange"])}var Qz=null,nY=null,mQ=null,rY=!1;function MR(z){if("selectionStart"in z&&aY(z))return{start:z.selectionStart,end:z.selectionEnd};else{var Q=z.ownerDocument&&z.ownerDocument.defaultView||window,X=Q.getSelection();return{anchorNode:X.anchorNode,anchorOffset:X.anchorOffset,focusNode:X.focusNode,focusOffset:X.focusOffset}}}function wR(z){return z.window===z?z.document:z.nodeType===y7?z:z.ownerDocument}function aq(z,Q,X){var Z=wR(X);if(rY||Qz==null||Qz!==B8(Z))return;var J=MR(Qz);if(!mQ||!DQ(mQ,J)){mQ=J;var $=DZ(nY,"onSelect");if($.length>0){var q=new jY("onSelect","select",null,Q,X);z.push({event:q,listeners:$}),q.target=Qz}}}function FR(z,Q,X,Z,J,$,q){var U=X?$z(X):window;switch(Q){case"focusin":if(uq(U)||U.contentEditable==="true")Qz=U,nY=X,mQ=null;break;case"focusout":Qz=null,nY=null,mQ=null;break;case"mousedown":rY=!0;break;case"contextmenu":case"mouseup":case"dragend":rY=!1,aq(z,Z,J);break;case"selectionchange":if(NR)break;case"keydown":case"keyup":aq(z,Z,J)}}function hZ(z,Q){var X={};return X[z.toLowerCase()]=Q.toLowerCase(),X["Webkit"+z]="webkit"+Q,X["Moz"+z]="moz"+Q,X}var Xz={animationend:hZ("Animation","AnimationEnd"),animationiteration:hZ("Animation","AnimationIteration"),animationstart:hZ("Animation","AnimationStart"),transitionend:hZ("Transition","TransitionEnd")},tY={},nq={};if(O0){if(nq=document.createElement("div").style,!("AnimationEvent"in window))delete Xz.animationend.animation,delete Xz.animationiteration.animation,delete Xz.animationstart.animation;if(!("TransitionEvent"in window))delete Xz.transitionend.transition}function yZ(z){if(tY[z])return tY[z];else if(!Xz[z])return z;var Q=Xz[z];for(var X in Q)if(Q.hasOwnProperty(X)&&X in nq)return tY[z]=Q[X];return z}var rq=yZ("animationend"),tq=yZ("animationiteration"),sq=yZ("animationstart"),eq=yZ("transitionend"),zB=new Map,QB=["abort","auxClick","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"];function L8(z,Q){zB.set(z,Q),R1(Q,[z])}function bR(){for(var z=0;z<QB.length;z++){var Q=QB[z],X=Q.toLowerCase(),Z=Q[0].toUpperCase()+Q.slice(1);L8(X,"on"+Z)}L8(rq,"onAnimationEnd"),L8(tq,"onAnimationIteration"),L8(sq,"onAnimationStart"),L8("dblclick","onDoubleClick"),L8("focusin","onFocus"),L8("focusout","onBlur"),L8(eq,"onTransitionEnd")}function PR(z,Q,X,Z,J,$,q){var U=zB.get(Q);if(U===void 0)return;var L=jY,P=Q;switch(Q){case"keypress":if(CZ(Z)===0)return;case"keydown":case"keyup":L=AN;break;case"focusin":P="focus",L=dY;break;case"focusout":P="blur",L=dY;break;case"beforeblur":case"afterblur":L=dY;break;case"click":if(Z.button===2)return;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":L=kq;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":L=BN;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":L=kN;break;case rq:case tq:case sq:L=KN;break;case eq:L=vN;break;case"scroll":L=HN;break;case"wheel":L=fN;break;case"copy":case"cut":case"paste":L=_N;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":L=vq;break}var C=($&HQ)!==0;{var i=!C&&Q==="scroll",d=kR(X,U,Z.type,C,i);if(d.length>0){var Z0=new L(U,P,null,Z,J);z.push({event:Z0,listeners:d})}}}bR(),JR(),dN(),RR(),VN();function AR(z,Q,X,Z,J,$,q){PR(z,Q,X,Z,J,$);var U=($&M_)===0;if(U)YR(z,Q,X,Z,J),ZR(z,Q,X,Z,J),FR(z,Q,X,Z,J),jN(z,Q,X,Z,J)}var gQ=["abort","canplay","canplaythrough","durationchange","emptied","encrypted","ended","error","loadeddata","loadedmetadata","loadstart","pause","play","playing","progress","ratechange","resize","seeked","seeking","stalled","suspend","timeupdate","volumechange","waiting"],sY=new Set(["cancel","close","invalid","load","scroll","toggle"].concat(gQ));function XB(z,Q,X){var Z=z.type||"unknown-event";z.currentTarget=X,f_(Z,Q,void 0,z),z.currentTarget=null}function IR(z,Q,X){var Z;if(X)for(var J=Q.length-1;J>=0;J--){var $=Q[J],q=$.instance,U=$.currentTarget,L=$.listener;if(q!==Z&&z.isPropagationStopped())return;XB(z,L,U),Z=q}else for(var P=0;P<Q.length;P++){var C=Q[P],i=C.instance,d=C.currentTarget,Z0=C.listener;if(i!==Z&&z.isPropagationStopped())return;XB(z,Z0,d),Z=i}}function ZB(z,Q){var X=(Q&HQ)!==0;for(var Z=0;Z<z.length;Z++){var J=z[Z],$=J.event,q=J.listeners;IR($,q,X)}h_()}function TR(z,Q,X,Z,J){var $=oJ(X),q=[];AR(q,z,Z,X,$,Q),ZB(q,Q)}function g4(z,Q){if(!sY.has(z))G('Did not expect a listenToNonDelegatedEvent() call for "%s". This is a bug in React. Please file an issue.',z);var X=!1,Z=Xw(Q),J=SR(z,X);if(!Z.has(J))JB(Q,z,iJ,X),Z.add(J)}function eY(z,Q,X){if(sY.has(z)&&!Q)G('Did not expect a listenToNativeEvent() call for "%s" in the bubble phase. This is a bug in React. Please file an issue.',z);var Z=0;if(Q)Z|=HQ;JB(X,z,Z,Q)}var VZ="_reactListening"+Math.random().toString(36).slice(2);function uQ(z){if(!z[VZ]){z[VZ]=!0,Y1.forEach(function(X){if(X!=="selectionchange"){if(!sY.has(X))eY(X,!1,z);eY(X,!0,z)}});var Q=z.nodeType===y7?z:z.ownerDocument;if(Q!==null){if(!Q[VZ])Q[VZ]=!0,eY("selectionchange",!1,Q)}}}function JB(z,Q,X,Z,J){var $=tL(z,Q,X),q=void 0;if(rJ){if(Q==="touchstart"||Q==="touchmove"||Q==="wheel")q=!0}z=z;var U;if(Z)if(q!==void 0)U=ZN(z,Q,$,q);else U=XN(z,Q,$);else if(q!==void 0)U=JN(z,Q,$,q);else U=QN(z,Q,$)}function YB(z,Q){return z===Q||z.nodeType===Z5&&z.parentNode===Q}function z$(z,Q,X,Z,J){var $=Z;if((Q&VG)===0&&(Q&iJ)===0){var q=J;if(Z!==null){var U=Z;z:while(!0){if(U===null)return;var L=U.tag;if(L===b||L===M){var P=U.stateNode.containerInfo;if(YB(P,q))break;if(L===M){var C=U.return;while(C!==null){var i=C.tag;if(i===b||i===M){var d=C.stateNode.containerInfo;if(YB(d,q))return}C=C.return}}while(P!==null){var Z0=Z2(P);if(Z0===null)return;var J0=Z0.tag;if(J0===A||J0===R){U=$=Z0;continue z}P=P.parentNode}}U=U.return}}}xG(function(){return TR(z,Q,X,$)})}function EQ(z,Q,X){return{instance:z,listener:Q,currentTarget:X}}function kR(z,Q,X,Z,J,$){var q=Q!==null?Q+"Capture":null,U=Z?q:Q,L=[],P=z,C=null;while(P!==null){var i=P,d=i.stateNode,Z0=i.tag;if(Z0===A&&d!==null){if(C=d,U!==null){var J0=qQ(P,U);if(J0!=null)L.push(EQ(P,J0,C))}}if(J)break;P=P.return}return L}function DZ(z,Q){var X=Q+"Capture",Z=[],J=z;while(J!==null){var $=J,q=$.stateNode,U=$.tag;if(U===A&&q!==null){var L=q,P=qQ(J,X);if(P!=null)Z.unshift(EQ(J,P,L));var C=qQ(J,Q);if(C!=null)Z.push(EQ(J,C,L))}J=J.return}return Z}function Zz(z){if(z===null)return null;do z=z.return;while(z&&z.tag!==A);if(z)return z;return null}function CR(z,Q){var X=z,Z=Q,J=0;for(var $=X;$;$=Zz($))J++;var q=0;for(var U=Z;U;U=Zz(U))q++;while(J-q>0)X=Zz(X),J--;while(q-J>0)Z=Zz(Z),q--;var L=J;while(L--){if(X===Z||Z!==null&&X===Z.alternate)return X;X=Zz(X),Z=Zz(Z)}return null}function $B(z,Q,X,Z,J){var $=Q._reactName,q=[],U=X;while(U!==null){if(U===Z)break;var L=U,P=L.alternate,C=L.stateNode,i=L.tag;if(P!==null&&P===Z)break;if(i===A&&C!==null){var d=C;if(J){var Z0=qQ(U,$);if(Z0!=null)q.unshift(EQ(U,Z0,d))}else if(!J){var J0=qQ(U,$);if(J0!=null)q.push(EQ(U,J0,d))}}U=U.return}if(q.length!==0)z.push({event:Q,listeners:q})}function vR(z,Q,X,Z,J){var $=Z&&J?CR(Z,J):null;if(Z!==null)$B(z,Q,Z,$,!1);if(J!==null&&X!==null)$B(z,X,J,$,!0)}function SR(z,Q){return z+"__"+(Q?"capture":"bubble")}var U6=!1,xQ="dangerouslySetInnerHTML",mZ="suppressContentEditableWarning",N8="suppressHydrationWarning",HB="autoFocus",Q2="children",X2="style",gZ="__html",Q$,uZ,pQ,GB,EZ,qB,BB;Q$={dialog:!0,webview:!0},uZ=function(z,Q){W_(z,Q),K_(z,Q),R_(z,Q,{registrationNameDependencies:m0,possibleRegistrationNames:F1})},qB=O0&&!document.documentMode,pQ=function(z,Q,X){if(U6)return;var Z=xZ(X),J=xZ(Q);if(J===Z)return;U6=!0,G("Prop `%s` did not match. Server: %s Client: %s",z,JSON.stringify(J),JSON.stringify(Z))},GB=function(z){if(U6)return;U6=!0;var Q=[];z.forEach(function(X){Q.push(X)}),G("Extra attributes from the server: %s",Q)},EZ=function(z,Q){if(Q===!1)G("Expected `%s` listener to be a function, instead got `false`.\n\nIf you used to conditionally omit it with %s={condition && value}, pass %s={condition ? value : undefined} instead.",z,z,z);else G("Expected `%s` listener to be a function, instead got a value of `%s` type.",z,typeof Q)},BB=function(z,Q){var X=z.namespaceURI===f7?z.ownerDocument.createElement(z.tagName):z.ownerDocument.createElementNS(z.namespaceURI,z.tagName);return X.innerHTML=Q,X.innerHTML};var fR=/\r\n?/g,hR=/\u0000|\uFFFD/g;function xZ(z){f4(z);var Q=typeof z==="string"?z:""+z;return Q.replace(fR,`
|
|
32
|
+
`).replace(hR,"")}function pZ(z,Q,X,Z){var J=xZ(Q),$=xZ(z);if($===J)return;if(Z){if(!U6)U6=!0,G('Text content did not match. Server: "%s" Client: "%s"',$,J)}if(X&&_0)throw Error("Text content does not match server-rendered HTML.")}function UB(z){return z.nodeType===y7?z:z.ownerDocument}function yR(){}function jZ(z){z.onclick=yR}function VR(z,Q,X,Z,J){for(var $ in Z){if(!Z.hasOwnProperty($))continue;var q=Z[$];if($===X2){if(q)Object.freeze(q);CG(Q,q)}else if($===xQ){var U=q?q[gZ]:void 0;if(U!=null)PG(Q,U)}else if($===Q2){if(typeof q==="string"){var L=z!=="textarea"||q!=="";if(L)qZ(Q,q)}else if(typeof q==="number")qZ(Q,""+q)}else if($===mZ||$===N8);else if($===HB);else if(m0.hasOwnProperty($)){if(q!=null){if(typeof q!=="function")EZ($,q);if($==="onScroll")g4("scroll",Q)}}else if(q!=null)c1(Q,$,q,J)}}function DR(z,Q,X,Z){for(var J=0;J<Q.length;J+=2){var $=Q[J],q=Q[J+1];if($===X2)CG(z,q);else if($===xQ)PG(z,q);else if($===Q2)qZ(z,q);else c1(z,$,q,Z)}}function mR(z,Q,X,Z){var J,$=UB(X),q,U=Z;if(U===f7)U=xJ(z);if(U===f7){if(J=l8(z,Q),!J&&z!==z.toLowerCase())G("<%s /> is using incorrect casing. Use PascalCase for React components, or lowercase for HTML elements.",z);if(z==="script"){var L=$.createElement("div");L.innerHTML="<script></script>";var P=L.firstChild;q=L.removeChild(P)}else if(typeof Q.is==="string")q=$.createElement(z,{is:Q.is});else if(q=$.createElement(z),z==="select"){var C=q;if(Q.multiple)C.multiple=!0;else if(Q.size)C.size=Q.size}}else q=$.createElementNS(U,z);if(U===f7){if(!J&&Object.prototype.toString.call(q)==="[object HTMLUnknownElement]"&&!V0.call(Q$,z))Q$[z]=!0,G("The tag <%s> is unrecognized in this browser. If you meant to render a React component, start its name with an uppercase letter.",z)}return q}function gR(z,Q){return UB(Q).createTextNode(z)}function uR(z,Q,X,Z){var J=l8(Q,X);uZ(Q,X);var $;switch(Q){case"dialog":g4("cancel",z),g4("close",z),$=X;break;case"iframe":case"object":case"embed":g4("load",z),$=X;break;case"video":case"audio":for(var q=0;q<gQ.length;q++)g4(gQ[q],z);$=X;break;case"source":g4("error",z),$=X;break;case"img":case"image":case"link":g4("error",z),g4("load",z),$=X;break;case"details":g4("toggle",z),$=X;break;case"input":u(z,X),$=N(z,X),g4("invalid",z);break;case"option":T4(z,X),$=X;break;case"select":YQ(z,X),$=JQ(z,X),g4("invalid",z);break;case"textarea":wG(z,X),$=uJ(z,X),g4("invalid",z);break;default:$=X}switch(dJ(Q,$),VR(Q,z,Z,$,J),Q){case"input":v7(z),y0(z,X,!1);break;case"textarea":v7(z),bG(z);break;case"option":m4(z,X);break;case"select":gJ(z,X);break;default:if(typeof $.onClick==="function")jZ(z);break}}function ER(z,Q,X,Z,J){uZ(Q,Z);var $=null,q,U;switch(Q){case"input":q=N(z,X),U=N(z,Z),$=[];break;case"select":q=JQ(z,X),U=JQ(z,Z),$=[];break;case"textarea":q=uJ(z,X),U=uJ(z,Z),$=[];break;default:if(q=X,U=Z,typeof q.onClick!=="function"&&typeof U.onClick==="function")jZ(z);break}dJ(Q,U);var L,P,C=null;for(L in q){if(U.hasOwnProperty(L)||!q.hasOwnProperty(L)||q[L]==null)continue;if(L===X2){var i=q[L];for(P in i)if(i.hasOwnProperty(P)){if(!C)C={};C[P]=""}}else if(L===xQ||L===Q2);else if(L===mZ||L===N8);else if(L===HB);else if(m0.hasOwnProperty(L)){if(!$)$=[]}else($=$||[]).push(L,null)}for(L in U){var d=U[L],Z0=q!=null?q[L]:void 0;if(!U.hasOwnProperty(L)||d===Z0||d==null&&Z0==null)continue;if(L===X2){if(d)Object.freeze(d);if(Z0){for(P in Z0)if(Z0.hasOwnProperty(P)&&(!d||!d.hasOwnProperty(P))){if(!C)C={};C[P]=""}for(P in d)if(d.hasOwnProperty(P)&&Z0[P]!==d[P]){if(!C)C={};C[P]=d[P]}}else{if(!C){if(!$)$=[];$.push(L,C)}C=d}}else if(L===xQ){var J0=d?d[gZ]:void 0,$0=Z0?Z0[gZ]:void 0;if(J0!=null){if($0!==J0)($=$||[]).push(L,J0)}}else if(L===Q2){if(typeof d==="string"||typeof d==="number")($=$||[]).push(L,""+d)}else if(L===mZ||L===N8);else if(m0.hasOwnProperty(L)){if(d!=null){if(typeof d!=="function")EZ(L,d);if(L==="onScroll")g4("scroll",z)}if(!$&&Z0!==d)$=[]}else($=$||[]).push(L,d)}if(C)J_(C,U[X2]),($=$||[]).push(X2,C);return $}function xR(z,Q,X,Z,J){if(X==="input"&&J.type==="radio"&&J.name!=null)X0(z,J);var $=l8(X,Z),q=l8(X,J);switch(DR(z,Q,$,q),X){case"input":q0(z,J);break;case"textarea":FG(z,J);break;case"select":DO(z,J);break}}function pR(z){{var Q=z.toLowerCase();if(!BZ.hasOwnProperty(Q))return null;return BZ[Q]||null}}function jR(z,Q,X,Z,J,$,q){var U,L;switch(U=l8(Q,X),uZ(Q,X),Q){case"dialog":g4("cancel",z),g4("close",z);break;case"iframe":case"object":case"embed":g4("load",z);break;case"video":case"audio":for(var P=0;P<gQ.length;P++)g4(gQ[P],z);break;case"source":g4("error",z);break;case"img":case"image":case"link":g4("error",z),g4("load",z);break;case"details":g4("toggle",z);break;case"input":u(z,X),g4("invalid",z);break;case"option":T4(z,X);break;case"select":YQ(z,X),g4("invalid",z);break;case"textarea":wG(z,X),g4("invalid",z);break}dJ(Q,X);{L=new Set;var C=z.attributes;for(var i=0;i<C.length;i++){var d=C[i].name.toLowerCase();switch(d){case"value":break;case"checked":break;case"selected":break;default:L.add(C[i].name)}}}var Z0=null;for(var J0 in X){if(!X.hasOwnProperty(J0))continue;var $0=X[J0];if(J0===Q2){if(typeof $0==="string"){if(z.textContent!==$0){if(X[N8]!==!0)pZ(z.textContent,$0,$,q);Z0=[Q2,$0]}}else if(typeof $0==="number"){if(z.textContent!==""+$0){if(X[N8]!==!0)pZ(z.textContent,$0,$,q);Z0=[Q2,""+$0]}}}else if(m0.hasOwnProperty(J0)){if($0!=null){if(typeof $0!=="function")EZ(J0,$0);if(J0==="onScroll")g4("scroll",z)}}else if(q&&!0&&typeof U==="boolean"){var p0=void 0,U1=U&&G0?null:z5(J0);if(X[N8]===!0);else if(J0===mZ||J0===N8||J0==="value"||J0==="checked"||J0==="selected");else if(J0===xQ){var X1=z.innerHTML,j1=$0?$0[gZ]:void 0;if(j1!=null){var l1=BB(z,j1);if(l1!==X1)pQ(J0,X1,l1)}}else if(J0===X2){if(L.delete(J0),qB){var s=X_($0);if(p0=z.getAttribute("style"),s!==p0)pQ(J0,p0,s)}}else if(U&&!G0){if(L.delete(J0.toLowerCase()),p0=i6(z,J0,$0),$0!==p0)pQ(J0,p0,$0)}else if(!U4(J0,U1,U)&&!w4(J0,$0,U1,U)){var K0=!1;if(U1!==null)L.delete(U1.attributeName),p0=p5(z,J0,$0,U1);else{var e=Z;if(e===f7)e=xJ(Q);if(e===f7)L.delete(J0.toLowerCase());else{var T0=pR(J0);if(T0!==null&&T0!==J0)K0=!0,L.delete(T0);L.delete(J0)}p0=i6(z,J0,$0)}var i0=G0;if(!i0&&$0!==p0&&!K0)pQ(J0,p0,$0)}}}if(q){if(L.size>0&&X[N8]!==!0)GB(L)}switch(Q){case"input":v7(z),y0(z,X,!0);break;case"textarea":v7(z),bG(z);break;case"select":case"option":break;default:if(typeof X.onClick==="function")jZ(z);break}return Z0}function lR(z,Q,X){var Z=z.nodeValue!==Q;return Z}function X$(z,Q){{if(U6)return;U6=!0,G("Did not expect server HTML to contain a <%s> in <%s>.",Q.nodeName.toLowerCase(),z.nodeName.toLowerCase())}}function Z$(z,Q){{if(U6)return;U6=!0,G('Did not expect server HTML to contain the text node "%s" in <%s>.',Q.nodeValue,z.nodeName.toLowerCase())}}function J$(z,Q,X){{if(U6)return;U6=!0,G("Expected server HTML to contain a matching <%s> in <%s>.",Q,z.nodeName.toLowerCase())}}function Y$(z,Q){{if(Q==="")return;if(U6)return;U6=!0,G('Expected server HTML to contain a matching text node for "%s" in <%s>.',Q,z.nodeName.toLowerCase())}}function cR(z,Q,X){switch(Q){case"input":b1(z,X);return;case"textarea":gO(z,X);return;case"select":mO(z,X);return}}var jQ=function(){},lQ=function(){};{var dR=["address","applet","area","article","aside","base","basefont","bgsound","blockquote","body","br","button","caption","center","col","colgroup","dd","details","dir","div","dl","dt","embed","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","iframe","img","input","isindex","li","link","listing","main","marquee","menu","menuitem","meta","nav","noembed","noframes","noscript","object","ol","p","param","plaintext","pre","script","section","select","source","style","summary","table","tbody","td","template","textarea","tfoot","th","thead","title","tr","track","ul","wbr","xmp"],WB=["applet","caption","html","table","td","th","marquee","object","template","foreignObject","desc","title"],iR=WB.concat(["button"]),oR=["dd","dt","li","option","optgroup","p","rp","rt"],KB={current:null,formTag:null,aTagInScope:null,buttonTagInScope:null,nobrTagInScope:null,pTagInButtonScope:null,listItemTagAutoclosing:null,dlItemTagAutoclosing:null};lQ=function(z,Q){var X=E1({},z||KB),Z={tag:Q};if(WB.indexOf(Q)!==-1)X.aTagInScope=null,X.buttonTagInScope=null,X.nobrTagInScope=null;if(iR.indexOf(Q)!==-1)X.pTagInButtonScope=null;if(dR.indexOf(Q)!==-1&&Q!=="address"&&Q!=="div"&&Q!=="p")X.listItemTagAutoclosing=null,X.dlItemTagAutoclosing=null;if(X.current=Z,Q==="form")X.formTag=Z;if(Q==="a")X.aTagInScope=Z;if(Q==="button")X.buttonTagInScope=Z;if(Q==="nobr")X.nobrTagInScope=Z;if(Q==="p")X.pTagInButtonScope=Z;if(Q==="li")X.listItemTagAutoclosing=Z;if(Q==="dd"||Q==="dt")X.dlItemTagAutoclosing=Z;return X};var aR=function(z,Q){switch(Q){case"select":return z==="option"||z==="optgroup"||z==="#text";case"optgroup":return z==="option"||z==="#text";case"option":return z==="#text";case"tr":return z==="th"||z==="td"||z==="style"||z==="script"||z==="template";case"tbody":case"thead":case"tfoot":return z==="tr"||z==="style"||z==="script"||z==="template";case"colgroup":return z==="col"||z==="template";case"table":return z==="caption"||z==="colgroup"||z==="tbody"||z==="tfoot"||z==="thead"||z==="style"||z==="script"||z==="template";case"head":return z==="base"||z==="basefont"||z==="bgsound"||z==="link"||z==="meta"||z==="title"||z==="noscript"||z==="noframes"||z==="style"||z==="script"||z==="template";case"html":return z==="head"||z==="body"||z==="frameset";case"frameset":return z==="frame";case"#document":return z==="html"}switch(z){case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":return Q!=="h1"&&Q!=="h2"&&Q!=="h3"&&Q!=="h4"&&Q!=="h5"&&Q!=="h6";case"rp":case"rt":return oR.indexOf(Q)===-1;case"body":case"caption":case"col":case"colgroup":case"frameset":case"frame":case"head":case"html":case"tbody":case"td":case"tfoot":case"th":case"thead":case"tr":return Q==null}return!0},nR=function(z,Q){switch(z){case"address":case"article":case"aside":case"blockquote":case"center":case"details":case"dialog":case"dir":case"div":case"dl":case"fieldset":case"figcaption":case"figure":case"footer":case"header":case"hgroup":case"main":case"menu":case"nav":case"ol":case"p":case"section":case"summary":case"ul":case"pre":case"listing":case"table":case"hr":case"xmp":case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":return Q.pTagInButtonScope;case"form":return Q.formTag||Q.pTagInButtonScope;case"li":return Q.listItemTagAutoclosing;case"dd":case"dt":return Q.dlItemTagAutoclosing;case"button":return Q.buttonTagInScope;case"a":return Q.aTagInScope;case"nobr":return Q.nobrTagInScope}return null},OB={};jQ=function(z,Q,X){X=X||KB;var Z=X.current,J=Z&&Z.tag;if(Q!=null){if(z!=null)G("validateDOMNesting: when childText is passed, childTag should be null");z="#text"}var $=aR(z,J)?null:Z,q=$?null:nR(z,X),U=$||q;if(!U)return;var L=U.tag,P=!!$+"|"+z+"|"+L;if(OB[P])return;OB[P]=!0;var C=z,i="";if(z==="#text")if(/\S/.test(Q))C="Text nodes";else C="Whitespace text nodes",i=" Make sure you don't have any extra whitespace between tags on each line of your source code.";else C="<"+z+">";if($){var d="";if(L==="table"&&z==="tr")d+=" Add a <tbody>, <thead> or <tfoot> to your code to match the DOM tree generated by the browser.";G("validateDOMNesting(...): %s cannot appear as a child of <%s>.%s%s",C,L,i,d)}else G("validateDOMNesting(...): %s cannot appear as a descendant of <%s>.",C,L)}}var lZ="suppressHydrationWarning",cZ="$",dZ="/$",cQ="$?",dQ="$!",rR="style",$$=null,H$=null;function tR(z){var Q,X,Z=z.nodeType;switch(Z){case y7:case jJ:{Q=Z===y7?"#document":"#fragment";var J=z.documentElement;X=J?J.namespaceURI:pJ(null,"");break}default:{var $=Z===Z5?z.parentNode:z,q=$.namespaceURI||null;Q=$.tagName,X=pJ(q,Q);break}}{var U=Q.toLowerCase(),L=lQ(null,U);return{namespace:X,ancestorInfo:L}}}function sR(z,Q,X){{var Z=z,J=pJ(Z.namespace,Q),$=lQ(Z.ancestorInfo,Q);return{namespace:J,ancestorInfo:$}}}function G$(z){return z}function eR(z){$$=rL(),H$=KR();var Q=null;return bq(!1),Q}function zM(z){OR(H$),bq($$),$$=null,H$=null}function QM(z,Q,X,Z,J){var $;{var q=Z;if(jQ(z,null,q.ancestorInfo),typeof Q.children==="string"||typeof Q.children==="number"){var U=""+Q.children,L=lQ(q.ancestorInfo,z);jQ(null,U,L)}$=q.namespace}var P=mR(z,Q,X,$);return aQ(J,P),L$(P,Q),P}function XM(z,Q){z.appendChild(Q)}function ZM(z,Q,X,Z,J){switch(uR(z,Q,X,Z),Q){case"button":case"input":case"select":case"textarea":return!!X.autoFocus;case"img":return!0;default:return!1}}function JM(z,Q,X,Z,J,$){{var q=$;if(typeof Z.children!==typeof X.children&&(typeof Z.children==="string"||typeof Z.children==="number")){var U=""+Z.children,L=lQ(q.ancestorInfo,Q);jQ(null,U,L)}}return ER(z,Q,X,Z)}function q$(z,Q){return z==="textarea"||z==="noscript"||typeof Q.children==="string"||typeof Q.children==="number"||typeof Q.dangerouslySetInnerHTML==="object"&&Q.dangerouslySetInnerHTML!==null&&Q.dangerouslySetInnerHTML.__html!=null}function YM(z,Q,X,Z){{var J=X;jQ(null,z,J.ancestorInfo)}var $=gR(z,Q);return aQ(Z,$),$}function $M(){var z=window.event;if(z===void 0)return x7;return Pq(z.type)}var B$=typeof setTimeout==="function"?setTimeout:void 0,HM=typeof clearTimeout==="function"?clearTimeout:void 0,U$=-1,_B=typeof Promise==="function"?Promise:void 0,GM=typeof queueMicrotask==="function"?queueMicrotask:typeof _B<"u"?function(z){return _B.resolve(null).then(z).catch(qM)}:B$;function qM(z){setTimeout(function(){throw z})}function BM(z,Q,X,Z){switch(Q){case"button":case"input":case"select":case"textarea":if(X.autoFocus)z.focus();return;case"img":{if(X.src)z.src=X.src;return}}}function UM(z,Q,X,Z,J,$){xR(z,Q,X,Z,J),L$(z,J)}function LB(z){qZ(z,"")}function WM(z,Q,X){z.nodeValue=X}function KM(z,Q){z.appendChild(Q)}function OM(z,Q){var X;if(z.nodeType===Z5)X=z.parentNode,X.insertBefore(Q,z);else X=z,X.appendChild(Q);var Z=z._reactRootContainer;if((Z===null||Z===void 0)&&X.onclick===null)jZ(X)}function _M(z,Q,X){z.insertBefore(Q,X)}function LM(z,Q,X){if(z.nodeType===Z5)z.parentNode.insertBefore(Q,X);else z.insertBefore(Q,X)}function NM(z,Q){z.removeChild(Q)}function RM(z,Q){if(z.nodeType===Z5)z.parentNode.removeChild(Q);else z.removeChild(Q)}function W$(z,Q){var X=Q,Z=0;do{var J=X.nextSibling;if(z.removeChild(X),J&&J.nodeType===Z5){var $=J.data;if($===dZ)if(Z===0){z.removeChild(J),kQ(Q);return}else Z--;else if($===cZ||$===cQ||$===dQ)Z++}X=J}while(X);kQ(Q)}function MM(z,Q){if(z.nodeType===Z5)W$(z.parentNode,Q);else if(z.nodeType===B6)W$(z,Q);kQ(z)}function wM(z){z=z;var Q=z.style;if(typeof Q.setProperty==="function")Q.setProperty("display","none","important");else Q.display="none"}function FM(z){z.nodeValue=""}function bM(z,Q){z=z;var X=Q[rR],Z=X!==void 0&&X!==null&&X.hasOwnProperty("display")?X.display:null;z.style.display=lJ("display",Z)}function PM(z,Q){z.nodeValue=Q}function AM(z){if(z.nodeType===B6)z.textContent="";else if(z.nodeType===y7){if(z.documentElement)z.removeChild(z.documentElement)}}function IM(z,Q,X){if(z.nodeType!==B6||Q.toLowerCase()!==z.nodeName.toLowerCase())return null;return z}function TM(z,Q){if(Q===""||z.nodeType!==h7)return null;return z}function kM(z){if(z.nodeType!==Z5)return null;return z}function NB(z){return z.data===cQ}function K$(z){return z.data===dQ}function CM(z){var Q=z.nextSibling&&z.nextSibling.dataset,X,Z,J;if(Q)X=Q.dgst,Z=Q.msg,J=Q.stck;return{message:Z,digest:X,stack:J}}function vM(z,Q){z._reactRetry=Q}function iZ(z){for(;z!=null;z=z.nextSibling){var Q=z.nodeType;if(Q===B6||Q===h7)break;if(Q===Z5){var X=z.data;if(X===cZ||X===dQ||X===cQ)break;if(X===dZ)return null}}return z}function iQ(z){return iZ(z.nextSibling)}function SM(z){return iZ(z.firstChild)}function fM(z){return iZ(z.firstChild)}function hM(z){return iZ(z.nextSibling)}function yM(z,Q,X,Z,J,$,q){aQ($,z),L$(z,X);var U;{var L=J;U=L.namespace}var P=($.mode&o1)!==O1;return jR(z,Q,X,U,Z,P,q)}function VM(z,Q,X,Z){aQ(X,z);var J=(X.mode&o1)!==O1;return lR(z,Q)}function DM(z,Q){aQ(Q,z)}function mM(z){var Q=z.nextSibling,X=0;while(Q){if(Q.nodeType===Z5){var Z=Q.data;if(Z===dZ)if(X===0)return iQ(Q);else X--;else if(Z===cZ||Z===dQ||Z===cQ)X++}Q=Q.nextSibling}return null}function RB(z){var Q=z.previousSibling,X=0;while(Q){if(Q.nodeType===Z5){var Z=Q.data;if(Z===cZ||Z===dQ||Z===cQ)if(X===0)return Q;else X--;else if(Z===dZ)X++}Q=Q.previousSibling}return null}function gM(z){kQ(z)}function uM(z){kQ(z)}function EM(z){return z!=="head"&&z!=="body"}function xM(z,Q,X,Z){var J=!0;pZ(Q.nodeValue,X,Z,J)}function pM(z,Q,X,Z,J,$){if(Q[lZ]!==!0){var q=!0;pZ(Z.nodeValue,J,$,q)}}function jM(z,Q){if(Q.nodeType===B6)X$(z,Q);else if(Q.nodeType===Z5);else Z$(z,Q)}function lM(z,Q){{var X=z.parentNode;if(X!==null)if(Q.nodeType===B6)X$(X,Q);else if(Q.nodeType===Z5);else Z$(X,Q)}}function cM(z,Q,X,Z,J){if(J||Q[lZ]!==!0)if(Z.nodeType===B6)X$(X,Z);else if(Z.nodeType===Z5);else Z$(X,Z)}function dM(z,Q,X){J$(z,Q)}function iM(z,Q){Y$(z,Q)}function oM(z,Q,X){{var Z=z.parentNode;if(Z!==null)J$(Z,Q)}}function aM(z,Q){{var X=z.parentNode;if(X!==null)Y$(X,Q)}}function nM(z,Q,X,Z,J,$){if($||Q[lZ]!==!0)J$(X,Z)}function rM(z,Q,X,Z,J){if(J||Q[lZ]!==!0)Y$(X,Z)}function tM(z){G("An error occurred during hydration. The server HTML was replaced with client content in <%s>.",z.nodeName.toLowerCase())}function sM(z){uQ(z)}var Jz=Math.random().toString(36).slice(2),Yz="__reactFiber$"+Jz,O$="__reactProps$"+Jz,oQ="__reactContainer$"+Jz,_$="__reactEvents$"+Jz,eM="__reactListeners$"+Jz,zw="__reactHandles$"+Jz;function Qw(z){delete z[Yz],delete z[O$],delete z[_$],delete z[eM],delete z[zw]}function aQ(z,Q){Q[Yz]=z}function oZ(z,Q){Q[oQ]=z}function MB(z){z[oQ]=null}function nQ(z){return!!z[oQ]}function Z2(z){var Q=z[Yz];if(Q)return Q;var X=z.parentNode;while(X){if(Q=X[oQ]||X[Yz],Q){var Z=Q.alternate;if(Q.child!==null||Z!==null&&Z.child!==null){var J=RB(z);while(J!==null){var $=J[Yz];if($)return $;J=RB(J)}}return Q}z=X,X=z.parentNode}return null}function R8(z){var Q=z[Yz]||z[oQ];if(Q)if(Q.tag===A||Q.tag===R||Q.tag===T||Q.tag===b)return Q;else return null;return null}function $z(z){if(z.tag===A||z.tag===R)return z.stateNode;throw Error("getNodeFromInstance: Invalid argument.")}function aZ(z){return z[O$]||null}function L$(z,Q){z[O$]=Q}function Xw(z){var Q=z[_$];if(Q===void 0)Q=z[_$]=new Set;return Q}var wB={},FB=Y.ReactDebugCurrentFrame;function nZ(z){if(z){var Q=z._owner,X=H8(z.type,z._source,Q?Q.type:null);FB.setExtraStackFrame(X)}else FB.setExtraStackFrame(null)}function r6(z,Q,X,Z,J){{var $=Function.call.bind(V0);for(var q in z)if($(z,q)){var U=void 0;try{if(typeof z[q]!=="function"){var L=Error((Z||"React class")+": "+X+" type `"+q+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof z[q]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw L.name="Invariant Violation",L}U=z[q](Q,q,Z,X,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(P){U=P}if(U&&!(U instanceof Error))nZ(J),G("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",Z||"React class",X,q,typeof U),nZ(null);if(U instanceof Error&&!(U.message in wB))wB[U.message]=!0,nZ(J),G("Failed %s type: %s",X,U.message),nZ(null)}}}var N$=[],rZ;rZ=[];var p7=-1;function M8(z){return{current:z}}function l5(z,Q){if(p7<0){G("Unexpected pop.");return}if(Q!==rZ[p7])G("Unexpected Fiber popped.");z.current=N$[p7],N$[p7]=null,rZ[p7]=null,p7--}function c5(z,Q,X){p7++,N$[p7]=z.current,rZ[p7]=X,z.current=Q}var bB={},C6={};Object.freeze(C6);var j7=M8(C6),L7=M8(!1),R$=C6;function Hz(z,Q,X){{if(X&&N7(Q))return R$;return j7.current}}function PB(z,Q,X){{var Z=z.stateNode;Z.__reactInternalMemoizedUnmaskedChildContext=Q,Z.__reactInternalMemoizedMaskedChildContext=X}}function Gz(z,Q){{var X=z.type,Z=X.contextTypes;if(!Z)return C6;var J=z.stateNode;if(J&&J.__reactInternalMemoizedUnmaskedChildContext===Q)return J.__reactInternalMemoizedMaskedChildContext;var $={};for(var q in Z)$[q]=Q[q];{var U=g1(z)||"Unknown";r6(Z,$,"context",U)}if(J)PB(z,Q,$);return $}}function tZ(){return L7.current}function N7(z){{var Q=z.childContextTypes;return Q!==null&&Q!==void 0}}function sZ(z){l5(L7,z),l5(j7,z)}function M$(z){l5(L7,z),l5(j7,z)}function AB(z,Q,X){{if(j7.current!==C6)throw Error("Unexpected context found on stack. This error is likely caused by a bug in React. Please file an issue.");c5(j7,Q,z),c5(L7,X,z)}}function IB(z,Q,X){{var Z=z.stateNode,J=Q.childContextTypes;if(typeof Z.getChildContext!=="function"){{var $=g1(z)||"Unknown";if(!bB[$])bB[$]=!0,G("%s.childContextTypes is specified but there is no getChildContext() method on the instance. You can either define getChildContext() on %s or remove childContextTypes from it.",$,$)}return X}var q=Z.getChildContext();for(var U in q)if(!(U in J))throw Error((g1(z)||"Unknown")+'.getChildContext(): key "'+U+'" is not defined in childContextTypes.');{var L=g1(z)||"Unknown";r6(J,q,"child context",L)}return E1({},X,q)}}function eZ(z){{var Q=z.stateNode,X=Q&&Q.__reactInternalMemoizedMergedChildContext||C6;return R$=j7.current,c5(j7,X,z),c5(L7,L7.current,z),!0}}function TB(z,Q,X){{var Z=z.stateNode;if(!Z)throw Error("Expected to have an instance by this point. This error is likely caused by a bug in React. Please file an issue.");if(X){var J=IB(z,Q,R$);Z.__reactInternalMemoizedMergedChildContext=J,l5(L7,z),l5(j7,z),c5(j7,J,z),c5(L7,X,z)}else l5(L7,z),c5(L7,X,z)}}function Zw(z){{if(!E_(z)||z.tag!==O)throw Error("Expected subtree parent to be a mounted class component. This error is likely caused by a bug in React. Please file an issue.");var Q=z;do{switch(Q.tag){case b:return Q.stateNode.context;case O:{var X=Q.type;if(N7(X))return Q.stateNode.__reactInternalMemoizedMergedChildContext;break}}Q=Q.return}while(Q!==null);throw Error("Found unexpected detached subtree parent. This error is likely caused by a bug in React. Please file an issue.")}}var w8=0,z3=1,l7=null,w$=!1,F$=!1;function kB(z){if(l7===null)l7=[z];else l7.push(z)}function Jw(z){w$=!0,kB(z)}function CB(){if(w$)F8()}function F8(){if(!F$&&l7!==null){F$=!0;var z=0,Q=n6();try{var X=!0,Z=l7;I5(I6);for(;z<Z.length;z++){var J=Z[z];do J=J(X);while(J!==null)}l7=null,w$=!1}catch($){if(l7!==null)l7=l7.slice(z+1);throw tG(_Z,F8),$}finally{I5(Q),F$=!1}}return null}var qz=[],Bz=0,Q3=null,X3=0,D6=[],m6=0,J2=null,c7=1,d7="";function Yw(z){return $2(),(z.flags&lG)!==w1}function $w(z){return $2(),X3}function Hw(){var z=d7,Q=c7,X=Q&~Gw(Q);return X.toString(32)+z}function Y2(z,Q){$2(),qz[Bz++]=X3,qz[Bz++]=Q3,Q3=z,X3=Q}function vB(z,Q,X){$2(),D6[m6++]=c7,D6[m6++]=d7,D6[m6++]=J2,J2=z;var Z=c7,J=d7,$=Z3(Z)-1,q=Z&~(1<<$),U=X+1,L=Z3(Q)+$;if(L>30){var P=$-$%5,C=(1<<P)-1,i=(q&C).toString(32),d=q>>P,Z0=$-P,J0=Z3(Q)+Z0,$0=U<<Z0,p0=$0|d,U1=i+J;c7=1<<J0|p0,d7=U1}else{var X1=U<<$,j1=X1|q,l1=J;c7=1<<L|j1,d7=l1}}function b$(z){$2();var Q=z.return;if(Q!==null){var X=1,Z=0;Y2(z,X),vB(z,X,Z)}}function Z3(z){return 32-Zq(z)}function Gw(z){return 1<<Z3(z)-1}function P$(z){while(z===Q3)Q3=qz[--Bz],qz[Bz]=null,X3=qz[--Bz],qz[Bz]=null;while(z===J2)J2=D6[--m6],D6[m6]=null,d7=D6[--m6],D6[m6]=null,c7=D6[--m6],D6[m6]=null}function qw(){if($2(),J2!==null)return{id:c7,overflow:d7};else return null}function Bw(z,Q){$2(),D6[m6++]=c7,D6[m6++]=d7,D6[m6++]=J2,c7=Q.id,d7=Q.overflow,J2=z}function $2(){if(!S5())G("Expected to be hydrating. This is a bug in React. Please file an issue.")}var v5=null,g6=null,t6=!1,H2=!1,b8=null;function Uw(){if(t6)G("We should not be hydrating here. This is a bug in React. Please file a bug.")}function SB(){H2=!0}function Ww(){return H2}function Kw(z){var Q=z.stateNode.containerInfo;return g6=fM(Q),v5=z,t6=!0,b8=null,H2=!1,!0}function Ow(z,Q,X){if(g6=hM(Q),v5=z,t6=!0,b8=null,H2=!1,X!==null)Bw(z,X);return!0}function fB(z,Q){switch(z.tag){case b:{jM(z.stateNode.containerInfo,Q);break}case A:{var X=(z.mode&o1)!==O1;cM(z.type,z.memoizedProps,z.stateNode,Q,X);break}case T:{var Z=z.memoizedState;if(Z.dehydrated!==null)lM(Z.dehydrated,Q);break}}}function hB(z,Q){fB(z,Q);var X=bP();X.stateNode=Q,X.return=z;var Z=z.deletions;if(Z===null)z.deletions=[X],z.flags|=c8;else Z.push(X)}function A$(z,Q){{if(H2)return;switch(z.tag){case b:{var X=z.stateNode.containerInfo;switch(Q.tag){case A:var{type:Z,pendingProps:J}=Q;dM(X,Z);break;case R:var $=Q.pendingProps;iM(X,$);break}break}case A:{var{type:q,memoizedProps:U,stateNode:L}=z;switch(Q.tag){case A:{var{type:P,pendingProps:C}=Q,i=(z.mode&o1)!==O1;nM(q,U,L,P,C,i);break}case R:{var d=Q.pendingProps,Z0=(z.mode&o1)!==O1;rM(q,U,L,d,Z0);break}}break}case T:{var J0=z.memoizedState,$0=J0.dehydrated;if($0!==null)switch(Q.tag){case A:var{type:p0,pendingProps:U1}=Q;oM($0,p0);break;case R:var X1=Q.pendingProps;aM($0,X1);break}break}default:return}}}function yB(z,Q){Q.flags=Q.flags&~D7|J5,A$(z,Q)}function VB(z,Q){switch(z.tag){case A:{var{type:X,pendingProps:Z}=z,J=IM(Q,X);if(J!==null)return z.stateNode=J,v5=z,g6=SM(J),!0;return!1}case R:{var $=z.pendingProps,q=TM(Q,$);if(q!==null)return z.stateNode=q,v5=z,g6=null,!0;return!1}case T:{var U=kM(Q);if(U!==null){var L={dehydrated:U,treeContext:qw(),retryLane:P6};z.memoizedState=L;var P=PP(U);return P.return=z,z.child=P,v5=z,g6=null,!0}return!1}default:return!1}}function I$(z){return(z.mode&o1)!==O1&&(z.flags&J4)===w1}function T$(z){throw Error("Hydration failed because the initial UI does not match what was rendered on the server.")}function k$(z){if(!t6)return;var Q=g6;if(!Q){if(I$(z))A$(v5,z),T$();yB(v5,z),t6=!1,v5=z;return}var X=Q;if(!VB(z,Q)){if(I$(z))A$(v5,z),T$();Q=iQ(X);var Z=v5;if(!Q||!VB(z,Q)){yB(v5,z),t6=!1,v5=z;return}hB(Z,X)}}function _w(z,Q,X){var Z=z.stateNode,J=!H2,$=yM(Z,z.type,z.memoizedProps,Q,X,z,J);if(z.updateQueue=$,$!==null)return!0;return!1}function Lw(z){var{stateNode:Q,memoizedProps:X}=z,Z=VM(Q,X,z);if(Z){var J=v5;if(J!==null)switch(J.tag){case b:{var $=J.stateNode.containerInfo,q=(J.mode&o1)!==O1;xM($,Q,X,q);break}case A:{var{type:U,memoizedProps:L,stateNode:P}=J,C=(J.mode&o1)!==O1;pM(U,L,P,Q,X,C);break}}}return Z}function Nw(z){var Q=z.memoizedState,X=Q!==null?Q.dehydrated:null;if(!X)throw Error("Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue.");DM(X,z)}function Rw(z){var Q=z.memoizedState,X=Q!==null?Q.dehydrated:null;if(!X)throw Error("Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue.");return mM(X)}function DB(z){var Q=z.return;while(Q!==null&&Q.tag!==A&&Q.tag!==b&&Q.tag!==T)Q=Q.return;v5=Q}function J3(z){if(z!==v5)return!1;if(!t6)return DB(z),t6=!0,!1;if(z.tag!==b&&(z.tag!==A||EM(z.type)&&!q$(z.type,z.memoizedProps))){var Q=g6;if(Q)if(I$(z))mB(z),T$();else while(Q)hB(z,Q),Q=iQ(Q)}if(DB(z),z.tag===T)g6=Rw(z);else g6=v5?iQ(z.stateNode):null;return!0}function Mw(){return t6&&g6!==null}function mB(z){var Q=g6;while(Q)fB(z,Q),Q=iQ(Q)}function Uz(){v5=null,g6=null,t6=!1,H2=!1}function gB(){if(b8!==null)fW(b8),b8=null}function S5(){return t6}function C$(z){if(b8===null)b8=[z];else b8.push(z)}var ww=Y.ReactCurrentBatchConfig,Fw=null;function bw(){return ww.transition}var s6={recordUnsafeLifecycleWarnings:function(z,Q){},flushPendingUnsafeLifecycleWarnings:function(){},recordLegacyContextWarning:function(z,Q){},flushLegacyContextWarning:function(){},discardPendingWarnings:function(){}};{var Pw=function(z){var Q=null,X=z;while(X!==null){if(X.mode&n4)Q=X;X=X.return}return Q},G2=function(z){var Q=[];return z.forEach(function(X){Q.push(X)}),Q.sort().join(", ")},rQ=[],tQ=[],sQ=[],eQ=[],zX=[],QX=[],q2=new Set;s6.recordUnsafeLifecycleWarnings=function(z,Q){if(q2.has(z.type))return;if(typeof Q.componentWillMount==="function"&&Q.componentWillMount.__suppressDeprecationWarning!==!0)rQ.push(z);if(z.mode&n4&&typeof Q.UNSAFE_componentWillMount==="function")tQ.push(z);if(typeof Q.componentWillReceiveProps==="function"&&Q.componentWillReceiveProps.__suppressDeprecationWarning!==!0)sQ.push(z);if(z.mode&n4&&typeof Q.UNSAFE_componentWillReceiveProps==="function")eQ.push(z);if(typeof Q.componentWillUpdate==="function"&&Q.componentWillUpdate.__suppressDeprecationWarning!==!0)zX.push(z);if(z.mode&n4&&typeof Q.UNSAFE_componentWillUpdate==="function")QX.push(z)},s6.flushPendingUnsafeLifecycleWarnings=function(){var z=new Set;if(rQ.length>0)rQ.forEach(function(d){z.add(g1(d)||"Component"),q2.add(d.type)}),rQ=[];var Q=new Set;if(tQ.length>0)tQ.forEach(function(d){Q.add(g1(d)||"Component"),q2.add(d.type)}),tQ=[];var X=new Set;if(sQ.length>0)sQ.forEach(function(d){X.add(g1(d)||"Component"),q2.add(d.type)}),sQ=[];var Z=new Set;if(eQ.length>0)eQ.forEach(function(d){Z.add(g1(d)||"Component"),q2.add(d.type)}),eQ=[];var J=new Set;if(zX.length>0)zX.forEach(function(d){J.add(g1(d)||"Component"),q2.add(d.type)}),zX=[];var $=new Set;if(QX.length>0)QX.forEach(function(d){$.add(g1(d)||"Component"),q2.add(d.type)}),QX=[];if(Q.size>0){var q=G2(Q);G(`Using UNSAFE_componentWillMount in strict mode is not recommended and may indicate bugs in your code. See https://reactjs.org/link/unsafe-component-lifecycles for details.
|
|
33
|
+
|
|
34
|
+
* Move code with side effects to componentDidMount, and set initial state in the constructor.
|
|
35
|
+
|
|
36
|
+
Please update the following components: %s`,q)}if(Z.size>0){var U=G2(Z);G(`Using UNSAFE_componentWillReceiveProps in strict mode is not recommended and may indicate bugs in your code. See https://reactjs.org/link/unsafe-component-lifecycles for details.
|
|
37
|
+
|
|
38
|
+
* Move data fetching code or side effects to componentDidUpdate.
|
|
39
|
+
* If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://reactjs.org/link/derived-state
|
|
40
|
+
|
|
41
|
+
Please update the following components: %s`,U)}if($.size>0){var L=G2($);G(`Using UNSAFE_componentWillUpdate in strict mode is not recommended and may indicate bugs in your code. See https://reactjs.org/link/unsafe-component-lifecycles for details.
|
|
42
|
+
|
|
43
|
+
* Move data fetching code or side effects to componentDidUpdate.
|
|
44
|
+
|
|
45
|
+
Please update the following components: %s`,L)}if(z.size>0){var P=G2(z);K(`componentWillMount has been renamed, and is not recommended for use. See https://reactjs.org/link/unsafe-component-lifecycles for details.
|
|
46
|
+
|
|
47
|
+
* Move code with side effects to componentDidMount, and set initial state in the constructor.
|
|
48
|
+
* Rename componentWillMount to UNSAFE_componentWillMount to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run \`npx react-codemod rename-unsafe-lifecycles\` in your project source folder.
|
|
49
|
+
|
|
50
|
+
Please update the following components: %s`,P)}if(X.size>0){var C=G2(X);K(`componentWillReceiveProps has been renamed, and is not recommended for use. See https://reactjs.org/link/unsafe-component-lifecycles for details.
|
|
51
|
+
|
|
52
|
+
* Move data fetching code or side effects to componentDidUpdate.
|
|
53
|
+
* If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://reactjs.org/link/derived-state
|
|
54
|
+
* Rename componentWillReceiveProps to UNSAFE_componentWillReceiveProps to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run \`npx react-codemod rename-unsafe-lifecycles\` in your project source folder.
|
|
55
|
+
|
|
56
|
+
Please update the following components: %s`,C)}if(J.size>0){var i=G2(J);K(`componentWillUpdate has been renamed, and is not recommended for use. See https://reactjs.org/link/unsafe-component-lifecycles for details.
|
|
57
|
+
|
|
58
|
+
* Move data fetching code or side effects to componentDidUpdate.
|
|
59
|
+
* Rename componentWillUpdate to UNSAFE_componentWillUpdate to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run \`npx react-codemod rename-unsafe-lifecycles\` in your project source folder.
|
|
60
|
+
|
|
61
|
+
Please update the following components: %s`,i)}};var Y3=new Map,uB=new Set;s6.recordLegacyContextWarning=function(z,Q){var X=Pw(z);if(X===null){G("Expected to find a StrictMode component in a strict mode tree. This error is likely caused by a bug in React. Please file an issue.");return}if(uB.has(z.type))return;var Z=Y3.get(X);if(z.type.contextTypes!=null||z.type.childContextTypes!=null||Q!==null&&typeof Q.getChildContext==="function"){if(Z===void 0)Z=[],Y3.set(X,Z);Z.push(z)}},s6.flushLegacyContextWarning=function(){Y3.forEach(function(z,Q){if(z.length===0)return;var X=z[0],Z=new Set;z.forEach(function($){Z.add(g1($)||"Component"),uB.add($.type)});var J=G2(Z);try{l4(X),G(`Legacy context API has been detected within a strict-mode tree.
|
|
62
|
+
|
|
63
|
+
The old API will be supported in all 16.x releases, but applications using it should migrate to the new version.
|
|
64
|
+
|
|
65
|
+
Please update the following components: %s
|
|
66
|
+
|
|
67
|
+
Learn more about this warning here: https://reactjs.org/link/legacy-context`,J)}finally{F5()}})},s6.discardPendingWarnings=function(){rQ=[],tQ=[],sQ=[],eQ=[],zX=[],QX=[],Y3=new Map}}var v$,S$,f$,h$,y$,EB=function(z,Q){};v$=!1,S$=!1,f$={},h$={},y$={},EB=function(z,Q){if(z===null||typeof z!=="object")return;if(!z._store||z._store.validated||z.key!=null)return;if(typeof z._store!=="object")throw Error("React Component in warnForMissingKey should have a _store. This error is likely caused by a bug in React. Please file an issue.");z._store.validated=!0;var X=g1(Q)||"Component";if(h$[X])return;h$[X]=!0,G('Each child in a list should have a unique "key" prop. See https://reactjs.org/link/warning-keys for more information.')};function Aw(z){return z.prototype&&z.prototype.isReactComponent}function XX(z,Q,X){var Z=X.ref;if(Z!==null&&typeof Z!=="function"&&typeof Z!=="object"){if((z.mode&n4||h0)&&!(X._owner&&X._self&&X._owner.stateNode!==X._self)&&!(X._owner&&X._owner.tag!==O)&&!(typeof X.type==="function"&&!Aw(X.type))&&X._owner){var J=g1(z)||"Component";if(!f$[J])G('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. We recommend using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',J,Z),f$[J]=!0}if(X._owner){var $=X._owner,q;if($){var U=$;if(U.tag!==O)throw Error("Function components cannot have string refs. We recommend using useRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref");q=U.stateNode}if(!q)throw Error("Missing owner for string ref "+Z+". This error is likely caused by a bug in React. Please file an issue.");var L=q;h1(Z,"ref");var P=""+Z;if(Q!==null&&Q.ref!==null&&typeof Q.ref==="function"&&Q.ref._stringRef===P)return Q.ref;var C=function(i){var d=L.refs;if(i===null)delete d[P];else d[P]=i};return C._stringRef=P,C}else{if(typeof Z!=="string")throw Error("Expected ref to be a function, a string, an object returned by React.createRef(), or null.");if(!X._owner)throw Error("Element ref was specified as a string ("+Z+`) but no owner was set. This could happen for one of the following reasons:
|
|
68
|
+
1. You may be adding a ref to a function component
|
|
69
|
+
2. You may be adding a ref to a component that was not created inside a component's render method
|
|
70
|
+
3. You have multiple copies of React loaded
|
|
71
|
+
See https://reactjs.org/link/refs-must-have-owner for more information.`)}}return Z}function $3(z,Q){var X=Object.prototype.toString.call(Q);throw Error("Objects are not valid as a React child (found: "+(X==="[object Object]"?"object with keys {"+Object.keys(Q).join(", ")+"}":X)+"). If you meant to render a collection of children, use an array instead.")}function H3(z){{var Q=g1(z)||"Component";if(y$[Q])return;y$[Q]=!0,G("Functions are not valid as a React child. This may happen if you return a Component instead of <Component /> from render. Or maybe you meant to call this function rather than return it.")}}function xB(z){var{_payload:Q,_init:X}=z;return X(Q)}function pB(z){function Q(s,K0){if(!z)return;var e=s.deletions;if(e===null)s.deletions=[K0],s.flags|=c8;else e.push(K0)}function X(s,K0){if(!z)return null;var e=K0;while(e!==null)Q(s,e),e=e.sibling;return null}function Z(s,K0){var e=new Map,T0=K0;while(T0!==null){if(T0.key!==null)e.set(T0.key,T0);else e.set(T0.index,T0);T0=T0.sibling}return e}function J(s,K0){var e=R2(s,K0);return e.index=0,e.sibling=null,e}function $(s,K0,e){if(s.index=e,!z)return s.flags|=lG,K0;var T0=s.alternate;if(T0!==null){var i0=T0.index;if(i0<K0)return s.flags|=J5,K0;else return i0}else return s.flags|=J5,K0}function q(s){if(z&&s.alternate===null)s.flags|=J5;return s}function U(s,K0,e,T0){if(K0===null||K0.tag!==R){var i0=SH(e,s.mode,T0);return i0.return=s,i0}else{var l0=J(K0,e);return l0.return=s,l0}}function L(s,K0,e,T0){var i0=e.type;if(i0===z4)return C(s,K0,e.props.children,T0,e.key);if(K0!==null){if(K0.elementType===i0||oW(K0,e)||typeof i0==="object"&&i0!==null&&i0.$$typeof===Q1&&xB(i0)===K0.type){var l0=J(K0,e.props);return l0.ref=XX(s,K0,e),l0.return=s,l0._debugSource=e._source,l0._debugOwner=e._owner,l0}}var P1=vH(e,s.mode,T0);return P1.ref=XX(s,K0,e),P1.return=s,P1}function P(s,K0,e,T0){if(K0===null||K0.tag!==M||K0.stateNode.containerInfo!==e.containerInfo||K0.stateNode.implementation!==e.implementation){var i0=fH(e,s.mode,T0);return i0.return=s,i0}else{var l0=J(K0,e.children||[]);return l0.return=s,l0}}function C(s,K0,e,T0,i0){if(K0===null||K0.tag!==k){var l0=y8(e,s.mode,T0,i0);return l0.return=s,l0}else{var P1=J(K0,e);return P1.return=s,P1}}function i(s,K0,e){if(typeof K0==="string"&&K0!==""||typeof K0==="number"){var T0=SH(""+K0,s.mode,e);return T0.return=s,T0}if(typeof K0==="object"&&K0!==null){switch(K0.$$typeof){case W4:{var i0=vH(K0,s.mode,e);return i0.ref=XX(s,null,K0),i0.return=s,i0}case b4:{var l0=fH(K0,s.mode,e);return l0.return=s,l0}case Q1:{var{_payload:P1,_init:f1}=K0;return i(s,f1(P1),e)}}if(Z4(K0)||y4(K0)){var N4=y8(K0,s.mode,e,null);return N4.return=s,N4}$3(s,K0)}if(typeof K0==="function")H3(s);return null}function d(s,K0,e,T0){var i0=K0!==null?K0.key:null;if(typeof e==="string"&&e!==""||typeof e==="number"){if(i0!==null)return null;return U(s,K0,""+e,T0)}if(typeof e==="object"&&e!==null){switch(e.$$typeof){case W4:if(e.key===i0)return L(s,K0,e,T0);else return null;case b4:if(e.key===i0)return P(s,K0,e,T0);else return null;case Q1:{var{_payload:l0,_init:P1}=e;return d(s,K0,P1(l0),T0)}}if(Z4(e)||y4(e)){if(i0!==null)return null;return C(s,K0,e,T0,null)}$3(s,e)}if(typeof e==="function")H3(s);return null}function Z0(s,K0,e,T0,i0){if(typeof T0==="string"&&T0!==""||typeof T0==="number"){var l0=s.get(e)||null;return U(K0,l0,""+T0,i0)}if(typeof T0==="object"&&T0!==null){switch(T0.$$typeof){case W4:{var P1=s.get(T0.key===null?e:T0.key)||null;return L(K0,P1,T0,i0)}case b4:{var f1=s.get(T0.key===null?e:T0.key)||null;return P(K0,f1,T0,i0)}case Q1:var{_payload:N4,_init:Q4}=T0;return Z0(s,K0,e,Q4(N4),i0)}if(Z4(T0)||y4(T0)){var Q5=s.get(e)||null;return C(K0,Q5,T0,i0,null)}$3(K0,T0)}if(typeof T0==="function")H3(K0);return null}function J0(s,K0,e){{if(typeof s!=="object"||s===null)return K0;switch(s.$$typeof){case W4:case b4:EB(s,e);var T0=s.key;if(typeof T0!=="string")break;if(K0===null){K0=new Set,K0.add(T0);break}if(!K0.has(T0)){K0.add(T0);break}G("Encountered two children with the same key, `%s`. Keys should be unique so that components maintain their identity across updates. Non-unique keys may cause children to be "+"duplicated and/or omitted — the behavior is unsupported and "+"could change in a future version.",T0);break;case Q1:var{_payload:i0,_init:l0}=s;J0(l0(i0),K0,e);break}}return K0}function $0(s,K0,e,T0){{var i0=null;for(var l0=0;l0<e.length;l0++){var P1=e[l0];i0=J0(P1,i0,s)}}var f1=null,N4=null,Q4=K0,Q5=0,X4=0,r4=null;for(;Q4!==null&&X4<e.length;X4++){if(Q4.index>X4)r4=Q4,Q4=null;else r4=Q4.sibling;var i5=d(s,Q4,e[X4],T0);if(i5===null){if(Q4===null)Q4=r4;break}if(z){if(Q4&&i5.alternate===null)Q(s,Q4)}if(Q5=$(i5,Q5,X4),N4===null)f1=i5;else N4.sibling=i5;N4=i5,Q4=r4}if(X4===e.length){if(X(s,Q4),S5()){var g5=X4;Y2(s,g5)}return f1}if(Q4===null){for(;X4<e.length;X4++){var S6=i(s,e[X4],T0);if(S6===null)continue;if(Q5=$(S6,Q5,X4),N4===null)f1=S6;else N4.sibling=S6;N4=S6}if(S5()){var Y6=X4;Y2(s,Y6)}return f1}var $6=Z(s,Q4);for(;X4<e.length;X4++){var o5=Z0($6,s,X4,e[X4],T0);if(o5!==null){if(z){if(o5.alternate!==null)$6.delete(o5.key===null?X4:o5.key)}if(Q5=$(o5,Q5,X4),N4===null)f1=o5;else N4.sibling=o5;N4=o5}}if(z)$6.forEach(function(Sz){return Q(s,Sz)});if(S5()){var s7=X4;Y2(s,s7)}return f1}function p0(s,K0,e,T0){var i0=y4(e);if(typeof i0!=="function")throw Error("An object is not an iterable. This error is likely caused by a bug in React. Please file an issue.");{if(typeof Symbol==="function"&&e[Symbol.toStringTag]==="Generator"){if(!S$)G("Using Generators as children is unsupported and will likely yield unexpected results because enumerating a generator mutates it. You may convert it to an array with `Array.from()` or the `[...spread]` operator before rendering. Keep in mind you might need to polyfill these features for older browsers.");S$=!0}if(e.entries===i0){if(!v$)G("Using Maps as children is not supported. Use an array of keyed ReactElements instead.");v$=!0}var l0=i0.call(e);if(l0){var P1=null,f1=l0.next();for(;!f1.done;f1=l0.next()){var N4=f1.value;P1=J0(N4,P1,s)}}}var Q4=i0.call(e);if(Q4==null)throw Error("An iterable object provided no iterator.");var Q5=null,X4=null,r4=K0,i5=0,g5=0,S6=null,Y6=Q4.next();for(;r4!==null&&!Y6.done;g5++,Y6=Q4.next()){if(r4.index>g5)S6=r4,r4=null;else S6=r4.sibling;var $6=d(s,r4,Y6.value,T0);if($6===null){if(r4===null)r4=S6;break}if(z){if(r4&&$6.alternate===null)Q(s,r4)}if(i5=$($6,i5,g5),X4===null)Q5=$6;else X4.sibling=$6;X4=$6,r4=S6}if(Y6.done){if(X(s,r4),S5()){var o5=g5;Y2(s,o5)}return Q5}if(r4===null){for(;!Y6.done;g5++,Y6=Q4.next()){var s7=i(s,Y6.value,T0);if(s7===null)continue;if(i5=$(s7,i5,g5),X4===null)Q5=s7;else X4.sibling=s7;X4=s7}if(S5()){var Sz=g5;Y2(s,Sz)}return Q5}var VX=Z(s,r4);for(;!Y6.done;g5++,Y6=Q4.next()){var I7=Z0(VX,s,g5,Y6.value,T0);if(I7!==null){if(z){if(I7.alternate!==null)VX.delete(I7.key===null?g5:I7.key)}if(i5=$(I7,i5,g5),X4===null)Q5=I7;else X4.sibling=I7;X4=I7}}if(z)VX.forEach(function(zA){return Q(s,zA)});if(S5()){var eP=g5;Y2(s,eP)}return Q5}function U1(s,K0,e,T0){if(K0!==null&&K0.tag===R){X(s,K0.sibling);var i0=J(K0,e);return i0.return=s,i0}X(s,K0);var l0=SH(e,s.mode,T0);return l0.return=s,l0}function X1(s,K0,e,T0){var i0=e.key,l0=K0;while(l0!==null){if(l0.key===i0){var P1=e.type;if(P1===z4){if(l0.tag===k){X(s,l0.sibling);var f1=J(l0,e.props.children);return f1.return=s,f1._debugSource=e._source,f1._debugOwner=e._owner,f1}}else if(l0.elementType===P1||oW(l0,e)||typeof P1==="object"&&P1!==null&&P1.$$typeof===Q1&&xB(P1)===l0.type){X(s,l0.sibling);var N4=J(l0,e.props);return N4.ref=XX(s,l0,e),N4.return=s,N4._debugSource=e._source,N4._debugOwner=e._owner,N4}X(s,l0);break}else Q(s,l0);l0=l0.sibling}if(e.type===z4){var Q4=y8(e.props.children,s.mode,T0,e.key);return Q4.return=s,Q4}else{var Q5=vH(e,s.mode,T0);return Q5.ref=XX(s,K0,e),Q5.return=s,Q5}}function j1(s,K0,e,T0){var i0=e.key,l0=K0;while(l0!==null){if(l0.key===i0)if(l0.tag===M&&l0.stateNode.containerInfo===e.containerInfo&&l0.stateNode.implementation===e.implementation){X(s,l0.sibling);var P1=J(l0,e.children||[]);return P1.return=s,P1}else{X(s,l0);break}else Q(s,l0);l0=l0.sibling}var f1=fH(e,s.mode,T0);return f1.return=s,f1}function l1(s,K0,e,T0){var i0=typeof e==="object"&&e!==null&&e.type===z4&&e.key===null;if(i0)e=e.props.children;if(typeof e==="object"&&e!==null){switch(e.$$typeof){case W4:return q(X1(s,K0,e,T0));case b4:return q(j1(s,K0,e,T0));case Q1:var{_payload:l0,_init:P1}=e;return l1(s,K0,P1(l0),T0)}if(Z4(e))return $0(s,K0,e,T0);if(y4(e))return p0(s,K0,e,T0);$3(s,e)}if(typeof e==="string"&&e!==""||typeof e==="number")return q(U1(s,K0,""+e,T0));if(typeof e==="function")H3(s);return X(s,K0)}return l1}var Wz=pB(!0),jB=pB(!1);function Iw(z,Q){if(z!==null&&Q.child!==z.child)throw Error("Resuming work not yet implemented.");if(Q.child===null)return;var X=Q.child,Z=R2(X,X.pendingProps);Q.child=Z,Z.return=Q;while(X.sibling!==null)X=X.sibling,Z=Z.sibling=R2(X,X.pendingProps),Z.return=Q;Z.sibling=null}function Tw(z,Q){var X=z.child;while(X!==null)NP(X,Q),X=X.sibling}var V$=M8(null),D$;D$={};var G3=null,Kz=null,m$=null,q3=!1;function B3(){G3=null,Kz=null,m$=null,q3=!1}function lB(){q3=!0}function cB(){q3=!1}function dB(z,Q,X){{c5(V$,Q._currentValue,z),Q._currentValue=X;{if(Q._currentRenderer!==void 0&&Q._currentRenderer!==null&&Q._currentRenderer!==D$)G("Detected multiple renderers concurrently rendering the same context provider. This is currently unsupported.");Q._currentRenderer=D$}}}function g$(z,Q){var X=V$.current;l5(V$,Q),z._currentValue=X}function u$(z,Q,X){var Z=z;while(Z!==null){var J=Z.alternate;if(!t2(Z.childLanes,Q)){if(Z.childLanes=u1(Z.childLanes,Q),J!==null)J.childLanes=u1(J.childLanes,Q)}else if(J!==null&&!t2(J.childLanes,Q))J.childLanes=u1(J.childLanes,Q);if(Z===X)break;Z=Z.return}if(Z!==X)G("Expected to find the propagation root when scheduling context work. This error is likely caused by a bug in React. Please file an issue.")}function kw(z,Q,X){Cw(z,Q,X)}function Cw(z,Q,X){var Z=z.child;if(Z!==null)Z.return=z;while(Z!==null){var J=void 0,$=Z.dependencies;if($!==null){J=Z.child;var q=$.firstContext;while(q!==null){if(q.context===Q){if(Z.tag===O){var U=wQ(X),L=i7(V4,U);L.tag=W3;var P=Z.updateQueue;if(P===null);else{var C=P.shared,i=C.pending;if(i===null)L.next=L;else L.next=i.next,i.next=L;C.pending=L}}Z.lanes=u1(Z.lanes,X);var d=Z.alternate;if(d!==null)d.lanes=u1(d.lanes,X);u$(Z.return,X,z),$.lanes=u1($.lanes,X);break}q=q.next}}else if(Z.tag===x)J=Z.type===z.type?null:Z.child;else if(Z.tag===c){var Z0=Z.return;if(Z0===null)throw Error("We just came from a parent so we must have had a parent. This is a bug in React.");Z0.lanes=u1(Z0.lanes,X);var J0=Z0.alternate;if(J0!==null)J0.lanes=u1(J0.lanes,X);u$(Z0,X,z),J=Z.sibling}else J=Z.child;if(J!==null)J.return=Z;else{J=Z;while(J!==null){if(J===z){J=null;break}var $0=J.sibling;if($0!==null){$0.return=J.return,J=$0;break}J=J.return}}Z=J}}function Oz(z,Q){G3=z,Kz=null,m$=null;var X=z.dependencies;if(X!==null){var Z=X.firstContext;if(Z!==null){if(A6(X.lanes,Q))NX();X.firstContext=null}}}function Y5(z){if(q3)G("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo().");var Q=z._currentValue;if(m$===z);else{var X={context:z,memoizedValue:Q,next:null};if(Kz===null){if(G3===null)throw Error("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo().");Kz=X,G3.dependencies={lanes:b0,firstContext:X}}else Kz=Kz.next=X}return Q}var B2=null;function E$(z){if(B2===null)B2=[z];else B2.push(z)}function vw(){if(B2!==null){for(var z=0;z<B2.length;z++){var Q=B2[z],X=Q.interleaved;if(X!==null){Q.interleaved=null;var Z=X.next,J=Q.pending;if(J!==null){var $=J.next;J.next=Z,X.next=$}Q.pending=X}}B2=null}}function iB(z,Q,X,Z){var J=Q.interleaved;if(J===null)X.next=X,E$(Q);else X.next=J.next,J.next=X;return Q.interleaved=X,U3(z,Z)}function Sw(z,Q,X,Z){var J=Q.interleaved;if(J===null)X.next=X,E$(Q);else X.next=J.next,J.next=X;Q.interleaved=X}function fw(z,Q,X,Z){var J=Q.interleaved;if(J===null)X.next=X,E$(Q);else X.next=J.next,J.next=X;return Q.interleaved=X,U3(z,Z)}function W6(z,Q){return U3(z,Q)}var hw=U3;function U3(z,Q){z.lanes=u1(z.lanes,Q);var X=z.alternate;if(X!==null)X.lanes=u1(X.lanes,Q);if(X===null&&(z.flags&(J5|D7))!==w1)lW(z);var Z=z,J=z.return;while(J!==null){if(J.childLanes=u1(J.childLanes,Q),X=J.alternate,X!==null)X.childLanes=u1(X.childLanes,Q);else if((J.flags&(J5|D7))!==w1)lW(z);Z=J,J=J.return}if(Z.tag===b){var $=Z.stateNode;return $}else return null}var oB=0,aB=1,W3=2,x$=3,K3=!1,p$,O3;p$=!1,O3=null;function j$(z){var Q={baseState:z.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:b0},effects:null};z.updateQueue=Q}function nB(z,Q){var X=Q.updateQueue,Z=z.updateQueue;if(X===Z){var J={baseState:Z.baseState,firstBaseUpdate:Z.firstBaseUpdate,lastBaseUpdate:Z.lastBaseUpdate,shared:Z.shared,effects:Z.effects};Q.updateQueue=J}}function i7(z,Q){var X={eventTime:z,lane:Q,tag:oB,payload:null,callback:null,next:null};return X}function P8(z,Q,X){var Z=z.updateQueue;if(Z===null)return null;var J=Z.shared;if(O3===J&&!p$)G("An update (setState, replaceState, or forceUpdate) was scheduled from inside an update function. Update functions should be pure, with zero side-effects. Consider using componentDidUpdate or a callback."),p$=!0;if(Vb()){var $=J.pending;if($===null)Q.next=Q;else Q.next=$.next,$.next=Q;return J.pending=Q,hw(z,X)}else return fw(z,J,Q,X)}function _3(z,Q,X){var Z=Q.updateQueue;if(Z===null)return;var J=Z.shared;if(Hq(X)){var $=J.lanes;$=qq($,z.pendingLanes);var q=u1($,X);J.lanes=q,VY(z,q)}}function l$(z,Q){var{updateQueue:X,alternate:Z}=z;if(Z!==null){var J=Z.updateQueue;if(X===J){var $=null,q=null,U=X.firstBaseUpdate;if(U!==null){var L=U;do{var P={eventTime:L.eventTime,lane:L.lane,tag:L.tag,payload:L.payload,callback:L.callback,next:null};if(q===null)$=q=P;else q.next=P,q=P;L=L.next}while(L!==null);if(q===null)$=q=Q;else q.next=Q,q=Q}else $=q=Q;X={baseState:J.baseState,firstBaseUpdate:$,lastBaseUpdate:q,shared:J.shared,effects:J.effects},z.updateQueue=X;return}}var C=X.lastBaseUpdate;if(C===null)X.firstBaseUpdate=Q;else C.next=Q;X.lastBaseUpdate=Q}function yw(z,Q,X,Z,J,$){switch(X.tag){case aB:{var q=X.payload;if(typeof q==="function"){lB();var U=q.call($,Z,J);{if(z.mode&n4){P5(!0);try{q.call($,Z,J)}finally{P5(!1)}}cB()}return U}return q}case x$:z.flags=z.flags&~Q6|J4;case oB:{var L=X.payload,P;if(typeof L==="function"){lB(),P=L.call($,Z,J);{if(z.mode&n4){P5(!0);try{L.call($,Z,J)}finally{P5(!1)}}cB()}}else P=L;if(P===null||P===void 0)return Z;return E1({},Z,P)}case W3:return K3=!0,Z}return Z}function L3(z,Q,X,Z){var J=z.updateQueue;K3=!1,O3=J.shared;var{firstBaseUpdate:$,lastBaseUpdate:q}=J,U=J.shared.pending;if(U!==null){J.shared.pending=null;var L=U,P=L.next;if(L.next=null,q===null)$=P;else q.next=P;q=L;var C=z.alternate;if(C!==null){var i=C.updateQueue,d=i.lastBaseUpdate;if(d!==q){if(d===null)i.firstBaseUpdate=P;else d.next=P;i.lastBaseUpdate=L}}}if($!==null){var Z0=J.baseState,J0=b0,$0=null,p0=null,U1=null,X1=$;do{var{lane:j1,eventTime:l1}=X1;if(!t2(Z,j1)){var s={eventTime:l1,lane:j1,tag:X1.tag,payload:X1.payload,callback:X1.callback,next:null};if(U1===null)p0=U1=s,$0=Z0;else U1=U1.next=s;J0=u1(J0,j1)}else{if(U1!==null){var K0={eventTime:l1,lane:A5,tag:X1.tag,payload:X1.payload,callback:X1.callback,next:null};U1=U1.next=K0}Z0=yw(z,J,X1,Z0,Q,X);var e=X1.callback;if(e!==null&&X1.lane!==A5){z.flags|=QY;var T0=J.effects;if(T0===null)J.effects=[X1];else T0.push(X1)}}if(X1=X1.next,X1===null)if(U=J.shared.pending,U===null)break;else{var i0=U,l0=i0.next;i0.next=null,X1=l0,J.lastBaseUpdate=i0,J.shared.pending=null}}while(!0);if(U1===null)$0=Z0;J.baseState=$0,J.firstBaseUpdate=p0,J.lastBaseUpdate=U1;var P1=J.shared.interleaved;if(P1!==null){var f1=P1;do J0=u1(J0,f1.lane),f1=f1.next;while(f1!==P1)}else if($===null)J.shared.lanes=b0;vX(J0),z.lanes=J0,z.memoizedState=Z0}O3=null}function Vw(z,Q){if(typeof z!=="function")throw Error("Invalid argument passed as callback. Expected a function. Instead "+("received: "+z));z.call(Q)}function rB(){K3=!1}function N3(){return K3}function tB(z,Q,X){var Z=Q.effects;if(Q.effects=null,Z!==null)for(var J=0;J<Z.length;J++){var $=Z[J],q=$.callback;if(q!==null)$.callback=null,Vw(q,X)}}var ZX={},A8=M8(ZX),JX=M8(ZX),R3=M8(ZX);function M3(z){if(z===ZX)throw Error("Expected host context to exist. This error is likely caused by a bug in React. Please file an issue.");return z}function sB(){var z=M3(R3.current);return z}function c$(z,Q){c5(R3,Q,z),c5(JX,z,z),c5(A8,ZX,z);var X=tR(Q);l5(A8,z),c5(A8,X,z)}function _z(z){l5(A8,z),l5(JX,z),l5(R3,z)}function d$(){var z=M3(A8.current);return z}function eB(z){var Q=M3(R3.current),X=M3(A8.current),Z=sR(X,z.type);if(X===Z)return;c5(JX,z,z),c5(A8,Z,z)}function i$(z){if(JX.current!==z)return;l5(A8,z),l5(JX,z)}var Dw=0,zU=1,QU=1,YX=2,e6=M8(Dw);function o$(z,Q){return(z&Q)!==0}function Lz(z){return z&zU}function a$(z,Q){return z&zU|Q}function mw(z,Q){return z|Q}function I8(z,Q){c5(e6,Q,z)}function Nz(z){l5(e6,z)}function gw(z,Q){var X=z.memoizedState;if(X!==null){if(X.dehydrated!==null)return!0;return!1}var Z=z.memoizedProps;return!0}function w3(z){var Q=z;while(Q!==null){if(Q.tag===T){var X=Q.memoizedState;if(X!==null){var Z=X.dehydrated;if(Z===null||NB(Z)||K$(Z))return Q}}else if(Q.tag===j&&Q.memoizedProps.revealOrder!==void 0){var J=(Q.flags&J4)!==w1;if(J)return Q}else if(Q.child!==null){Q.child.return=Q,Q=Q.child;continue}if(Q===z)return null;while(Q.sibling===null){if(Q.return===null||Q.return===z)return null;Q=Q.return}Q.sibling.return=Q.return,Q=Q.sibling}return null}var K6=0,G5=1,R7=2,q5=4,f5=8,n$=[];function r$(){for(var z=0;z<n$.length;z++){var Q=n$[z];Q._workInProgressVersionPrimary=null}n$.length=0}function uw(z,Q){var X=Q._getVersion,Z=X(Q._source);if(z.mutableSourceEagerHydrationData==null)z.mutableSourceEagerHydrationData=[Q,Z];else z.mutableSourceEagerHydrationData.push(Q,Z)}var{ReactCurrentDispatcher:d0,ReactCurrentBatchConfig:$X}=Y,t$,Rz;t$=new Set;var U2=b0,L4=null,B5=null,U5=null,F3=!1,HX=!1,GX=0,Ew=0,xw=25,L0=null,u6=null,T8=-1,s$=!1;function H4(){{var z=L0;if(u6===null)u6=[z];else u6.push(z)}}function x0(){{var z=L0;if(u6!==null){if(T8++,u6[T8]!==z)pw(z)}}}function Mz(z){if(z!==void 0&&z!==null&&!Z4(z))G("%s received a final argument that is not an array (instead, received `%s`). When specified, the final argument must be an array.",L0,typeof z)}function pw(z){{var Q=g1(L4);if(!t$.has(Q)){if(t$.add(Q),u6!==null){var X="",Z=30;for(var J=0;J<=T8;J++){var $=u6[J],q=J===T8?z:$,U=J+1+". "+$;while(U.length<Z)U+=" ";U+=q+`
|
|
72
|
+
`,X+=U}G(`React has detected a change in the order of Hooks called by %s. This will lead to bugs and errors if not fixed. For more information, read the Rules of Hooks: https://reactjs.org/link/rules-of-hooks
|
|
73
|
+
|
|
74
|
+
Previous render Next render
|
|
75
|
+
------------------------------------------------------
|
|
76
|
+
%s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
77
|
+
`,Q,X)}}}}function d5(){throw Error(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
|
|
78
|
+
1. You might have mismatching versions of React and the renderer (such as React DOM)
|
|
79
|
+
2. You might be breaking the Rules of Hooks
|
|
80
|
+
3. You might have more than one copy of React in the same app
|
|
81
|
+
See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.`)}function e$(z,Q){if(s$)return!1;if(Q===null)return G("%s received a final argument during this render, but not during the previous render. Even though the final argument is optional, its type cannot change between renders.",L0),!1;if(z.length!==Q.length)G(`The final argument passed to %s changed size between renders. The order and size of this array must remain constant.
|
|
82
|
+
|
|
83
|
+
Previous: %s
|
|
84
|
+
Incoming: %s`,L0,"["+Q.join(", ")+"]","["+z.join(", ")+"]");for(var X=0;X<Q.length&&X<z.length;X++){if(k6(z[X],Q[X]))continue;return!1}return!0}function wz(z,Q,X,Z,J,$){if(U2=$,L4=Q,u6=z!==null?z._debugHookTypes:null,T8=-1,s$=z!==null&&z.type!==Q.type,Q.memoizedState=null,Q.updateQueue=null,Q.lanes=b0,z!==null&&z.memoizedState!==null)d0.current=PU;else if(u6!==null)d0.current=bU;else d0.current=FU;var q=X(Z,J);if(HX){var U=0;do{if(HX=!1,GX=0,U>=xw)throw Error("Too many re-renders. React limits the number of renders to prevent an infinite loop.");U+=1,s$=!1,B5=null,U5=null,Q.updateQueue=null,T8=-1,d0.current=AU,q=X(Z,J)}while(HX)}d0.current=m3,Q._debugHookTypes=u6;var L=B5!==null&&B5.next!==null;if(U2=b0,L4=null,B5=null,U5=null,L0=null,u6=null,T8=-1,z!==null&&(z.flags&g7)!==(Q.flags&g7)&&(z.mode&o1)!==O1)G("Internal React error: Expected static flag was missing. Please notify the React team.");if(F3=!1,L)throw Error("Rendered fewer hooks than expected. This may be caused by an accidental early return statement.");return q}function Fz(){var z=GX!==0;return GX=0,z}function XU(z,Q,X){if(Q.updateQueue=z.updateQueue,(Q.mode&O7)!==O1)Q.flags&=~(OZ|m7|o6|t1);else Q.flags&=~(o6|t1);z.lanes=FZ(z.lanes,X)}function ZU(){if(d0.current=m3,F3){var z=L4.memoizedState;while(z!==null){var Q=z.queue;if(Q!==null)Q.pending=null;z=z.next}F3=!1}U2=b0,L4=null,B5=null,U5=null,u6=null,T8=-1,L0=null,LU=!1,HX=!1,GX=0}function M7(){var z={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};if(U5===null)L4.memoizedState=U5=z;else U5=U5.next=z;return U5}function E6(){var z;if(B5===null){var Q=L4.alternate;if(Q!==null)z=Q.memoizedState;else z=null}else z=B5.next;var X;if(U5===null)X=L4.memoizedState;else X=U5.next;if(X!==null)U5=X,X=U5.next,B5=z;else{if(z===null)throw Error("Rendered more hooks than during the previous render.");B5=z;var Z={memoizedState:B5.memoizedState,baseState:B5.baseState,baseQueue:B5.baseQueue,queue:B5.queue,next:null};if(U5===null)L4.memoizedState=U5=Z;else U5=U5.next=Z}return U5}function JU(){return{lastEffect:null,stores:null}}function z9(z,Q){return typeof Q==="function"?Q(z):Q}function Q9(z,Q,X){var Z=M7(),J;if(X!==void 0)J=X(Q);else J=Q;Z.memoizedState=Z.baseState=J;var $={pending:null,interleaved:null,lanes:b0,dispatch:null,lastRenderedReducer:z,lastRenderedState:J};Z.queue=$;var q=$.dispatch=cw.bind(null,L4,$);return[Z.memoizedState,q]}function X9(z,Q,X){var Z=E6(),J=Z.queue;if(J===null)throw Error("Should have a queue. This is likely a bug in React. Please file an issue.");J.lastRenderedReducer=z;var $=B5,q=$.baseQueue,U=J.pending;if(U!==null){if(q!==null){var L=q.next,P=U.next;q.next=P,U.next=L}if($.baseQueue!==q)G("Internal error: Expected work-in-progress queue to be a clone. This is a bug in React.");$.baseQueue=q=U,J.pending=null}if(q!==null){var C=q.next,i=$.baseState,d=null,Z0=null,J0=null,$0=C;do{var p0=$0.lane;if(!t2(U2,p0)){var U1={lane:p0,action:$0.action,hasEagerState:$0.hasEagerState,eagerState:$0.eagerState,next:null};if(J0===null)Z0=J0=U1,d=i;else J0=J0.next=U1;L4.lanes=u1(L4.lanes,p0),vX(p0)}else{if(J0!==null){var X1={lane:A5,action:$0.action,hasEagerState:$0.hasEagerState,eagerState:$0.eagerState,next:null};J0=J0.next=X1}if($0.hasEagerState)i=$0.eagerState;else{var j1=$0.action;i=z(i,j1)}}$0=$0.next}while($0!==null&&$0!==C);if(J0===null)d=i;else J0.next=Z0;if(!k6(i,Z.memoizedState))NX();Z.memoizedState=i,Z.baseState=d,Z.baseQueue=J0,J.lastRenderedState=i}var l1=J.interleaved;if(l1!==null){var s=l1;do{var K0=s.lane;L4.lanes=u1(L4.lanes,K0),vX(K0),s=s.next}while(s!==l1)}else if(q===null)J.lanes=b0;var e=J.dispatch;return[Z.memoizedState,e]}function Z9(z,Q,X){var Z=E6(),J=Z.queue;if(J===null)throw Error("Should have a queue. This is likely a bug in React. Please file an issue.");J.lastRenderedReducer=z;var{dispatch:$,pending:q}=J,U=Z.memoizedState;if(q!==null){J.pending=null;var L=q.next,P=L;do{var C=P.action;U=z(U,C),P=P.next}while(P!==L);if(!k6(U,Z.memoizedState))NX();if(Z.memoizedState=U,Z.baseQueue===null)Z.baseState=U;J.lastRenderedState=U}return[U,$]}function J9(z,Q,X){return}function b3(z,Q,X){return}function Y9(z,Q,X){var Z=L4,J=M7(),$,q=S5();if(q){if(X===void 0)throw Error("Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering.");if($=X(),!Rz){if($!==X())G("The result of getServerSnapshot should be cached to avoid an infinite loop"),Rz=!0}}else{if($=Q(),!Rz){var U=Q();if(!k6($,U))G("The result of getSnapshot should be cached to avoid an infinite loop"),Rz=!0}var L=QJ();if(L===null)throw Error("Expected a work-in-progress root. This is a bug in React. Please file an issue.");if(!wZ(L,U2))YU(Z,Q,$)}J.memoizedState=$;var P={value:$,getSnapshot:Q};return J.queue=P,k3(HU.bind(null,Z,P,z),[z]),Z.flags|=o6,qX(G5|f5,$U.bind(null,Z,P,$,Q),void 0,null),$}function P3(z,Q,X){var Z=L4,J=E6(),$=Q();if(!Rz){var q=Q();if(!k6($,q))G("The result of getSnapshot should be cached to avoid an infinite loop"),Rz=!0}var U=J.memoizedState,L=!k6(U,$);if(L)J.memoizedState=$,NX();var P=J.queue;if(UX(HU.bind(null,Z,P,z),[z]),P.getSnapshot!==Q||L||U5!==null&&U5.memoizedState.tag&G5){Z.flags|=o6,qX(G5|f5,$U.bind(null,Z,P,$,Q),void 0,null);var C=QJ();if(C===null)throw Error("Expected a work-in-progress root. This is a bug in React. Please file an issue.");if(!wZ(C,U2))YU(Z,Q,$)}return $}function YU(z,Q,X){z.flags|=KZ;var Z={getSnapshot:Q,value:X},J=L4.updateQueue;if(J===null)J=JU(),L4.updateQueue=J,J.stores=[Z];else{var $=J.stores;if($===null)J.stores=[Z];else $.push(Z)}}function $U(z,Q,X,Z){if(Q.value=X,Q.getSnapshot=Z,GU(Q))qU(z)}function HU(z,Q,X){var Z=function(){if(GU(Q))qU(z)};return X(Z)}function GU(z){var{getSnapshot:Q,value:X}=z;try{var Z=Q();return!k6(X,Z)}catch(J){return!0}}function qU(z){var Q=W6(z,k1);if(Q!==null)_5(Q,z,k1,V4)}function A3(z){var Q=M7();if(typeof z==="function")z=z();Q.memoizedState=Q.baseState=z;var X={pending:null,interleaved:null,lanes:b0,dispatch:null,lastRenderedReducer:z9,lastRenderedState:z};Q.queue=X;var Z=X.dispatch=dw.bind(null,L4,X);return[Q.memoizedState,Z]}function $9(z){return X9(z9)}function H9(z){return Z9(z9)}function qX(z,Q,X,Z){var J={tag:z,create:Q,destroy:X,deps:Z,next:null},$=L4.updateQueue;if($===null)$=JU(),L4.updateQueue=$,$.lastEffect=J.next=J;else{var q=$.lastEffect;if(q===null)$.lastEffect=J.next=J;else{var U=q.next;q.next=J,J.next=U,$.lastEffect=J}}return J}function G9(z){var Q=M7();{var X={current:z};return Q.memoizedState=X,X}}function I3(z){var Q=E6();return Q.memoizedState}function BX(z,Q,X,Z){var J=M7(),$=Z===void 0?null:Z;L4.flags|=z,J.memoizedState=qX(G5|Q,X,void 0,$)}function T3(z,Q,X,Z){var J=E6(),$=Z===void 0?null:Z,q=void 0;if(B5!==null){var U=B5.memoizedState;if(q=U.destroy,$!==null){var L=U.deps;if(e$($,L)){J.memoizedState=qX(Q,X,q,$);return}}}L4.flags|=z,J.memoizedState=qX(G5|Q,X,q,$)}function k3(z,Q){if((L4.mode&O7)!==O1)return BX(OZ|o6|JY,f5,z,Q);else return BX(o6|JY,f5,z,Q)}function UX(z,Q){return T3(o6,f5,z,Q)}function q9(z,Q){return BX(t1,R7,z,Q)}function C3(z,Q){return T3(t1,R7,z,Q)}function B9(z,Q){var X=t1;if(X|=o8,(L4.mode&O7)!==O1)X|=m7;return BX(X,q5,z,Q)}function v3(z,Q){return T3(t1,q5,z,Q)}function BU(z,Q){if(typeof Q==="function"){var X=Q,Z=z();return X(Z),function(){X(null)}}else if(Q!==null&&Q!==void 0){var J=Q;if(!J.hasOwnProperty("current"))G("Expected useImperativeHandle() first argument to either be a ref callback or React.createRef() object. Instead received: %s.","an object with keys {"+Object.keys(J).join(", ")+"}");var $=z();return J.current=$,function(){J.current=null}}}function U9(z,Q,X){if(typeof Q!=="function")G("Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.",Q!==null?typeof Q:"null");var Z=X!==null&&X!==void 0?X.concat([z]):null,J=t1;if(J|=o8,(L4.mode&O7)!==O1)J|=m7;return BX(J,q5,BU.bind(null,Q,z),Z)}function S3(z,Q,X){if(typeof Q!=="function")G("Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.",Q!==null?typeof Q:"null");var Z=X!==null&&X!==void 0?X.concat([z]):null;return T3(t1,q5,BU.bind(null,Q,z),Z)}function f3(z,Q){}var h3=f3;function W9(z,Q){var X=M7(),Z=Q===void 0?null:Q;return X.memoizedState=[z,Z],z}function y3(z,Q){var X=E6(),Z=Q===void 0?null:Q,J=X.memoizedState;if(J!==null){if(Z!==null){var $=J[1];if(e$(Z,$))return J[0]}}return X.memoizedState=[z,Z],z}function K9(z,Q){var X=M7(),Z=Q===void 0?null:Q,J=z();return X.memoizedState=[J,Z],J}function V3(z,Q){var X=E6(),Z=Q===void 0?null:Q,J=X.memoizedState;if(J!==null){if(Z!==null){var $=J[1];if(e$(Z,$))return J[0]}}var q=z();return X.memoizedState=[q,Z],q}function O9(z){var Q=M7();return Q.memoizedState=z,z}function UU(z){var Q=E6(),X=B5,Z=X.memoizedState;return KU(Q,Z,z)}function WU(z){var Q=E6();if(B5===null)return Q.memoizedState=z,z;else{var X=B5.memoizedState;return KU(Q,X,z)}}function KU(z,Q,X){var Z=!kL(U2);if(Z){if(!k6(X,Q)){var J=Gq();L4.lanes=u1(L4.lanes,J),vX(J),z.baseState=!0}return Q}else{if(z.baseState)z.baseState=!1,NX();return z.memoizedState=X,X}}function jw(z,Q,X){var Z=n6();I5(mL(Z,E7)),z(!0);var J=$X.transition;$X.transition={};var $=$X.transition;$X.transition._updatedFibers=new Set;try{z(!1),Q()}finally{if(I5(Z),$X.transition=J,J===null&&$._updatedFibers){var q=$._updatedFibers.size;if(q>10)K("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table.");$._updatedFibers.clear()}}}function _9(){var z=A3(!1),Q=z[0],X=z[1],Z=jw.bind(null,X),J=M7();return J.memoizedState=Z,[Q,Z]}function OU(){var z=$9(),Q=z[0],X=E6(),Z=X.memoizedState;return[Q,Z]}function _U(){var z=H9(),Q=z[0],X=E6(),Z=X.memoizedState;return[Q,Z]}var LU=!1;function lw(){return LU}function L9(){var z=M7(),Q=QJ(),X=Q.identifierPrefix,Z;if(S5()){var J=Hw();Z=":"+X+"R"+J;var $=GX++;if($>0)Z+="H"+$.toString(32);Z+=":"}else{var q=Ew++;Z=":"+X+"r"+q.toString(32)+":"}return z.memoizedState=Z,Z}function D3(){var z=E6(),Q=z.memoizedState;return Q}function cw(z,Q,X){if(typeof arguments[3]==="function")G("State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect().");var Z=f8(z),J={lane:Z,action:X,hasEagerState:!1,eagerState:null,next:null};if(NU(z))RU(Q,J);else{var $=iB(z,Q,J,Z);if($!==null){var q=J6();_5($,z,Z,q),MU($,Q,Z)}}wU(z,Z)}function dw(z,Q,X){if(typeof arguments[3]==="function")G("State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect().");var Z=f8(z),J={lane:Z,action:X,hasEagerState:!1,eagerState:null,next:null};if(NU(z))RU(Q,J);else{var $=z.alternate;if(z.lanes===b0&&($===null||$.lanes===b0)){var q=Q.lastRenderedReducer;if(q!==null){var U;U=d0.current,d0.current=z7;try{var L=Q.lastRenderedState,P=q(L,X);if(J.hasEagerState=!0,J.eagerState=P,k6(P,L)){Sw(z,Q,J,Z);return}}catch(d){}finally{d0.current=U}}}var C=iB(z,Q,J,Z);if(C!==null){var i=J6();_5(C,z,Z,i),MU(C,Q,Z)}}wU(z,Z)}function NU(z){var Q=z.alternate;return z===L4||Q!==null&&Q===L4}function RU(z,Q){HX=F3=!0;var X=z.pending;if(X===null)Q.next=Q;else Q.next=X.next,X.next=Q;z.pending=Q}function MU(z,Q,X){if(Hq(X)){var Z=Q.lanes;Z=qq(Z,z.pendingLanes);var J=u1(Z,X);Q.lanes=J,VY(z,J)}}function wU(z,Q,X){qY(z,Q)}var m3={readContext:Y5,useCallback:d5,useContext:d5,useEffect:d5,useImperativeHandle:d5,useInsertionEffect:d5,useLayoutEffect:d5,useMemo:d5,useReducer:d5,useRef:d5,useState:d5,useDebugValue:d5,useDeferredValue:d5,useTransition:d5,useMutableSource:d5,useSyncExternalStore:d5,useId:d5,unstable_isNewReconciler:f0},FU=null,bU=null,PU=null,AU=null,w7=null,z7=null,g3=null;{var N9=function(){G("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo().")},C1=function(){G("Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks. You can only call Hooks at the top level of your React function. For more information, see https://reactjs.org/link/rules-of-hooks")};FU={readContext:function(z){return Y5(z)},useCallback:function(z,Q){return L0="useCallback",H4(),Mz(Q),W9(z,Q)},useContext:function(z){return L0="useContext",H4(),Y5(z)},useEffect:function(z,Q){return L0="useEffect",H4(),Mz(Q),k3(z,Q)},useImperativeHandle:function(z,Q,X){return L0="useImperativeHandle",H4(),Mz(X),U9(z,Q,X)},useInsertionEffect:function(z,Q){return L0="useInsertionEffect",H4(),Mz(Q),q9(z,Q)},useLayoutEffect:function(z,Q){return L0="useLayoutEffect",H4(),Mz(Q),B9(z,Q)},useMemo:function(z,Q){L0="useMemo",H4(),Mz(Q);var X=d0.current;d0.current=w7;try{return K9(z,Q)}finally{d0.current=X}},useReducer:function(z,Q,X){L0="useReducer",H4();var Z=d0.current;d0.current=w7;try{return Q9(z,Q,X)}finally{d0.current=Z}},useRef:function(z){return L0="useRef",H4(),G9(z)},useState:function(z){L0="useState",H4();var Q=d0.current;d0.current=w7;try{return A3(z)}finally{d0.current=Q}},useDebugValue:function(z,Q){return L0="useDebugValue",H4(),f3()},useDeferredValue:function(z){return L0="useDeferredValue",H4(),O9(z)},useTransition:function(){return L0="useTransition",H4(),_9()},useMutableSource:function(z,Q,X){return L0="useMutableSource",H4(),J9()},useSyncExternalStore:function(z,Q,X){return L0="useSyncExternalStore",H4(),Y9(z,Q,X)},useId:function(){return L0="useId",H4(),L9()},unstable_isNewReconciler:f0},bU={readContext:function(z){return Y5(z)},useCallback:function(z,Q){return L0="useCallback",x0(),W9(z,Q)},useContext:function(z){return L0="useContext",x0(),Y5(z)},useEffect:function(z,Q){return L0="useEffect",x0(),k3(z,Q)},useImperativeHandle:function(z,Q,X){return L0="useImperativeHandle",x0(),U9(z,Q,X)},useInsertionEffect:function(z,Q){return L0="useInsertionEffect",x0(),q9(z,Q)},useLayoutEffect:function(z,Q){return L0="useLayoutEffect",x0(),B9(z,Q)},useMemo:function(z,Q){L0="useMemo",x0();var X=d0.current;d0.current=w7;try{return K9(z,Q)}finally{d0.current=X}},useReducer:function(z,Q,X){L0="useReducer",x0();var Z=d0.current;d0.current=w7;try{return Q9(z,Q,X)}finally{d0.current=Z}},useRef:function(z){return L0="useRef",x0(),G9(z)},useState:function(z){L0="useState",x0();var Q=d0.current;d0.current=w7;try{return A3(z)}finally{d0.current=Q}},useDebugValue:function(z,Q){return L0="useDebugValue",x0(),f3()},useDeferredValue:function(z){return L0="useDeferredValue",x0(),O9(z)},useTransition:function(){return L0="useTransition",x0(),_9()},useMutableSource:function(z,Q,X){return L0="useMutableSource",x0(),J9()},useSyncExternalStore:function(z,Q,X){return L0="useSyncExternalStore",x0(),Y9(z,Q,X)},useId:function(){return L0="useId",x0(),L9()},unstable_isNewReconciler:f0},PU={readContext:function(z){return Y5(z)},useCallback:function(z,Q){return L0="useCallback",x0(),y3(z,Q)},useContext:function(z){return L0="useContext",x0(),Y5(z)},useEffect:function(z,Q){return L0="useEffect",x0(),UX(z,Q)},useImperativeHandle:function(z,Q,X){return L0="useImperativeHandle",x0(),S3(z,Q,X)},useInsertionEffect:function(z,Q){return L0="useInsertionEffect",x0(),C3(z,Q)},useLayoutEffect:function(z,Q){return L0="useLayoutEffect",x0(),v3(z,Q)},useMemo:function(z,Q){L0="useMemo",x0();var X=d0.current;d0.current=z7;try{return V3(z,Q)}finally{d0.current=X}},useReducer:function(z,Q,X){L0="useReducer",x0();var Z=d0.current;d0.current=z7;try{return X9(z,Q,X)}finally{d0.current=Z}},useRef:function(z){return L0="useRef",x0(),I3()},useState:function(z){L0="useState",x0();var Q=d0.current;d0.current=z7;try{return $9(z)}finally{d0.current=Q}},useDebugValue:function(z,Q){return L0="useDebugValue",x0(),h3()},useDeferredValue:function(z){return L0="useDeferredValue",x0(),UU(z)},useTransition:function(){return L0="useTransition",x0(),OU()},useMutableSource:function(z,Q,X){return L0="useMutableSource",x0(),b3()},useSyncExternalStore:function(z,Q,X){return L0="useSyncExternalStore",x0(),P3(z,Q)},useId:function(){return L0="useId",x0(),D3()},unstable_isNewReconciler:f0},AU={readContext:function(z){return Y5(z)},useCallback:function(z,Q){return L0="useCallback",x0(),y3(z,Q)},useContext:function(z){return L0="useContext",x0(),Y5(z)},useEffect:function(z,Q){return L0="useEffect",x0(),UX(z,Q)},useImperativeHandle:function(z,Q,X){return L0="useImperativeHandle",x0(),S3(z,Q,X)},useInsertionEffect:function(z,Q){return L0="useInsertionEffect",x0(),C3(z,Q)},useLayoutEffect:function(z,Q){return L0="useLayoutEffect",x0(),v3(z,Q)},useMemo:function(z,Q){L0="useMemo",x0();var X=d0.current;d0.current=g3;try{return V3(z,Q)}finally{d0.current=X}},useReducer:function(z,Q,X){L0="useReducer",x0();var Z=d0.current;d0.current=g3;try{return Z9(z,Q,X)}finally{d0.current=Z}},useRef:function(z){return L0="useRef",x0(),I3()},useState:function(z){L0="useState",x0();var Q=d0.current;d0.current=g3;try{return H9(z)}finally{d0.current=Q}},useDebugValue:function(z,Q){return L0="useDebugValue",x0(),h3()},useDeferredValue:function(z){return L0="useDeferredValue",x0(),WU(z)},useTransition:function(){return L0="useTransition",x0(),_U()},useMutableSource:function(z,Q,X){return L0="useMutableSource",x0(),b3()},useSyncExternalStore:function(z,Q,X){return L0="useSyncExternalStore",x0(),P3(z,Q)},useId:function(){return L0="useId",x0(),D3()},unstable_isNewReconciler:f0},w7={readContext:function(z){return N9(),Y5(z)},useCallback:function(z,Q){return L0="useCallback",C1(),H4(),W9(z,Q)},useContext:function(z){return L0="useContext",C1(),H4(),Y5(z)},useEffect:function(z,Q){return L0="useEffect",C1(),H4(),k3(z,Q)},useImperativeHandle:function(z,Q,X){return L0="useImperativeHandle",C1(),H4(),U9(z,Q,X)},useInsertionEffect:function(z,Q){return L0="useInsertionEffect",C1(),H4(),q9(z,Q)},useLayoutEffect:function(z,Q){return L0="useLayoutEffect",C1(),H4(),B9(z,Q)},useMemo:function(z,Q){L0="useMemo",C1(),H4();var X=d0.current;d0.current=w7;try{return K9(z,Q)}finally{d0.current=X}},useReducer:function(z,Q,X){L0="useReducer",C1(),H4();var Z=d0.current;d0.current=w7;try{return Q9(z,Q,X)}finally{d0.current=Z}},useRef:function(z){return L0="useRef",C1(),H4(),G9(z)},useState:function(z){L0="useState",C1(),H4();var Q=d0.current;d0.current=w7;try{return A3(z)}finally{d0.current=Q}},useDebugValue:function(z,Q){return L0="useDebugValue",C1(),H4(),f3()},useDeferredValue:function(z){return L0="useDeferredValue",C1(),H4(),O9(z)},useTransition:function(){return L0="useTransition",C1(),H4(),_9()},useMutableSource:function(z,Q,X){return L0="useMutableSource",C1(),H4(),J9()},useSyncExternalStore:function(z,Q,X){return L0="useSyncExternalStore",C1(),H4(),Y9(z,Q,X)},useId:function(){return L0="useId",C1(),H4(),L9()},unstable_isNewReconciler:f0},z7={readContext:function(z){return N9(),Y5(z)},useCallback:function(z,Q){return L0="useCallback",C1(),x0(),y3(z,Q)},useContext:function(z){return L0="useContext",C1(),x0(),Y5(z)},useEffect:function(z,Q){return L0="useEffect",C1(),x0(),UX(z,Q)},useImperativeHandle:function(z,Q,X){return L0="useImperativeHandle",C1(),x0(),S3(z,Q,X)},useInsertionEffect:function(z,Q){return L0="useInsertionEffect",C1(),x0(),C3(z,Q)},useLayoutEffect:function(z,Q){return L0="useLayoutEffect",C1(),x0(),v3(z,Q)},useMemo:function(z,Q){L0="useMemo",C1(),x0();var X=d0.current;d0.current=z7;try{return V3(z,Q)}finally{d0.current=X}},useReducer:function(z,Q,X){L0="useReducer",C1(),x0();var Z=d0.current;d0.current=z7;try{return X9(z,Q,X)}finally{d0.current=Z}},useRef:function(z){return L0="useRef",C1(),x0(),I3()},useState:function(z){L0="useState",C1(),x0();var Q=d0.current;d0.current=z7;try{return $9(z)}finally{d0.current=Q}},useDebugValue:function(z,Q){return L0="useDebugValue",C1(),x0(),h3()},useDeferredValue:function(z){return L0="useDeferredValue",C1(),x0(),UU(z)},useTransition:function(){return L0="useTransition",C1(),x0(),OU()},useMutableSource:function(z,Q,X){return L0="useMutableSource",C1(),x0(),b3()},useSyncExternalStore:function(z,Q,X){return L0="useSyncExternalStore",C1(),x0(),P3(z,Q)},useId:function(){return L0="useId",C1(),x0(),D3()},unstable_isNewReconciler:f0},g3={readContext:function(z){return N9(),Y5(z)},useCallback:function(z,Q){return L0="useCallback",C1(),x0(),y3(z,Q)},useContext:function(z){return L0="useContext",C1(),x0(),Y5(z)},useEffect:function(z,Q){return L0="useEffect",C1(),x0(),UX(z,Q)},useImperativeHandle:function(z,Q,X){return L0="useImperativeHandle",C1(),x0(),S3(z,Q,X)},useInsertionEffect:function(z,Q){return L0="useInsertionEffect",C1(),x0(),C3(z,Q)},useLayoutEffect:function(z,Q){return L0="useLayoutEffect",C1(),x0(),v3(z,Q)},useMemo:function(z,Q){L0="useMemo",C1(),x0();var X=d0.current;d0.current=z7;try{return V3(z,Q)}finally{d0.current=X}},useReducer:function(z,Q,X){L0="useReducer",C1(),x0();var Z=d0.current;d0.current=z7;try{return Z9(z,Q,X)}finally{d0.current=Z}},useRef:function(z){return L0="useRef",C1(),x0(),I3()},useState:function(z){L0="useState",C1(),x0();var Q=d0.current;d0.current=z7;try{return H9(z)}finally{d0.current=Q}},useDebugValue:function(z,Q){return L0="useDebugValue",C1(),x0(),h3()},useDeferredValue:function(z){return L0="useDeferredValue",C1(),x0(),WU(z)},useTransition:function(){return L0="useTransition",C1(),x0(),_U()},useMutableSource:function(z,Q,X){return L0="useMutableSource",C1(),x0(),b3()},useSyncExternalStore:function(z,Q,X){return L0="useSyncExternalStore",C1(),x0(),P3(z,Q)},useId:function(){return L0="useId",C1(),x0(),D3()},unstable_isNewReconciler:f0}}var k8=R4.unstable_now,IU=0,u3=-1,WX=-1,E3=-1,R9=!1,x3=!1;function TU(){return R9}function iw(){x3=!0}function ow(){R9=!1,x3=!1}function aw(){R9=x3,x3=!1}function kU(){return IU}function CU(){IU=k8()}function M9(z){if(WX=k8(),z.actualStartTime<0)z.actualStartTime=k8()}function vU(z){WX=-1}function p3(z,Q){if(WX>=0){var X=k8()-WX;if(z.actualDuration+=X,Q)z.selfBaseDuration=X;WX=-1}}function F7(z){if(u3>=0){var Q=k8()-u3;u3=-1;var X=z.return;while(X!==null){switch(X.tag){case b:var Z=X.stateNode;Z.effectDuration+=Q;return;case l:var J=X.stateNode;J.effectDuration+=Q;return}X=X.return}}}function w9(z){if(E3>=0){var Q=k8()-E3;E3=-1;var X=z.return;while(X!==null){switch(X.tag){case b:var Z=X.stateNode;if(Z!==null)Z.passiveEffectDuration+=Q;return;case l:var J=X.stateNode;if(J!==null)J.passiveEffectDuration+=Q;return}X=X.return}}}function b7(){u3=k8()}function F9(){E3=k8()}function b9(z){var Q=z.child;while(Q)z.actualDuration+=Q.actualDuration,Q=Q.sibling}function Q7(z,Q){if(z&&z.defaultProps){var X=E1({},Q),Z=z.defaultProps;for(var J in Z)if(X[J]===void 0)X[J]=Z[J];return X}return Q}var P9={},A9,I9,T9,k9,C9,SU,j3,v9,S9,f9,KX;{A9=new Set,I9=new Set,T9=new Set,k9=new Set,v9=new Set,C9=new Set,S9=new Set,f9=new Set,KX=new Set;var fU=new Set;j3=function(z,Q){if(z===null||typeof z==="function")return;var X=Q+"_"+z;if(!fU.has(X))fU.add(X),G("%s(...): Expected the last optional `callback` argument to be a function. Instead received: %s.",Q,z)},SU=function(z,Q){if(Q===void 0){var X=s1(z)||"Component";if(!C9.has(X))C9.add(X),G("%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. You have returned undefined.",X)}},Object.defineProperty(P9,"_processChildContext",{enumerable:!1,value:function(){throw Error("_processChildContext is not available in React 16+. This likely means you have multiple copies of React and are attempting to nest a React 15 tree inside a React 16 tree using unstable_renderSubtreeIntoContainer, which isn't supported. Try to make sure you have only one copy of React (and ideally, switch to ReactDOM.createPortal).")}}),Object.freeze(P9)}function h9(z,Q,X,Z){var J=z.memoizedState,$=X(Z,J);{if(z.mode&n4){P5(!0);try{$=X(Z,J)}finally{P5(!1)}}SU(Q,$)}var q=$===null||$===void 0?J:E1({},J,$);if(z.memoizedState=q,z.lanes===b0){var U=z.updateQueue;U.baseState=q}}var y9={isMounted:x_,enqueueSetState:function(z,Q,X){var Z=c2(z),J=J6(),$=f8(Z),q=i7(J,$);if(q.payload=Q,X!==void 0&&X!==null)j3(X,"setState"),q.callback=X;var U=P8(Z,q,$);if(U!==null)_5(U,Z,$,J),_3(U,Z,$);qY(Z,$)},enqueueReplaceState:function(z,Q,X){var Z=c2(z),J=J6(),$=f8(Z),q=i7(J,$);if(q.tag=aB,q.payload=Q,X!==void 0&&X!==null)j3(X,"replaceState"),q.callback=X;var U=P8(Z,q,$);if(U!==null)_5(U,Z,$,J),_3(U,Z,$);qY(Z,$)},enqueueForceUpdate:function(z,Q){var X=c2(z),Z=J6(),J=f8(X),$=i7(Z,J);if($.tag=W3,Q!==void 0&&Q!==null)j3(Q,"forceUpdate"),$.callback=Q;var q=P8(X,$,J);if(q!==null)_5(q,X,J,Z),_3(q,X,J);NL(X,J)}};function hU(z,Q,X,Z,J,$,q){var U=z.stateNode;if(typeof U.shouldComponentUpdate==="function"){var L=U.shouldComponentUpdate(Z,$,q);{if(z.mode&n4){P5(!0);try{L=U.shouldComponentUpdate(Z,$,q)}finally{P5(!1)}}if(L===void 0)G("%s.shouldComponentUpdate(): Returned undefined instead of a boolean value. Make sure to return true or false.",s1(Q)||"Component")}return L}if(Q.prototype&&Q.prototype.isPureReactComponent)return!DQ(X,Z)||!DQ(J,$);return!0}function nw(z,Q,X){var Z=z.stateNode;{var J=s1(Q)||"Component",$=Z.render;if(!$)if(Q.prototype&&typeof Q.prototype.render==="function")G("%s(...): No `render` method found on the returned component instance: did you accidentally return an object from the constructor?",J);else G("%s(...): No `render` method found on the returned component instance: you may have forgotten to define `render`.",J);if(Z.getInitialState&&!Z.getInitialState.isReactClassApproved&&!Z.state)G("getInitialState was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Did you mean to define a state property instead?",J);if(Z.getDefaultProps&&!Z.getDefaultProps.isReactClassApproved)G("getDefaultProps was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Use a static property to define defaultProps instead.",J);if(Z.propTypes)G("propTypes was defined as an instance property on %s. Use a static property to define propTypes instead.",J);if(Z.contextType)G("contextType was defined as an instance property on %s. Use a static property to define contextType instead.",J);{if(Q.childContextTypes&&!KX.has(Q)&&(z.mode&n4)===O1)KX.add(Q),G(`%s uses the legacy childContextTypes API which is no longer supported and will be removed in the next major release. Use React.createContext() instead
|
|
85
|
+
|
|
86
|
+
.Learn more about this warning here: https://reactjs.org/link/legacy-context`,J);if(Q.contextTypes&&!KX.has(Q)&&(z.mode&n4)===O1)KX.add(Q),G(`%s uses the legacy contextTypes API which is no longer supported and will be removed in the next major release. Use React.createContext() with static contextType instead.
|
|
87
|
+
|
|
88
|
+
Learn more about this warning here: https://reactjs.org/link/legacy-context`,J);if(Z.contextTypes)G("contextTypes was defined as an instance property on %s. Use a static property to define contextTypes instead.",J);if(Q.contextType&&Q.contextTypes&&!S9.has(Q))S9.add(Q),G("%s declares both contextTypes and contextType static properties. The legacy contextTypes property will be ignored.",J)}if(typeof Z.componentShouldUpdate==="function")G("%s has a method called componentShouldUpdate(). Did you mean shouldComponentUpdate()? The name is phrased as a question because the function is expected to return a value.",J);if(Q.prototype&&Q.prototype.isPureReactComponent&&typeof Z.shouldComponentUpdate<"u")G("%s has a method called shouldComponentUpdate(). shouldComponentUpdate should not be used when extending React.PureComponent. Please extend React.Component if shouldComponentUpdate is used.",s1(Q)||"A pure component");if(typeof Z.componentDidUnmount==="function")G("%s has a method called componentDidUnmount(). But there is no such lifecycle method. Did you mean componentWillUnmount()?",J);if(typeof Z.componentDidReceiveProps==="function")G("%s has a method called componentDidReceiveProps(). But there is no such lifecycle method. If you meant to update the state in response to changing props, use componentWillReceiveProps(). If you meant to fetch data or run side-effects or mutations after React has updated the UI, use componentDidUpdate().",J);if(typeof Z.componentWillRecieveProps==="function")G("%s has a method called componentWillRecieveProps(). Did you mean componentWillReceiveProps()?",J);if(typeof Z.UNSAFE_componentWillRecieveProps==="function")G("%s has a method called UNSAFE_componentWillRecieveProps(). Did you mean UNSAFE_componentWillReceiveProps()?",J);var q=Z.props!==X;if(Z.props!==void 0&&q)G("%s(...): When calling super() in `%s`, make sure to pass up the same props that your component's constructor was passed.",J,J);if(Z.defaultProps)G("Setting defaultProps as an instance property on %s is not supported and will be ignored. Instead, define defaultProps as a static property on %s.",J,J);if(typeof Z.getSnapshotBeforeUpdate==="function"&&typeof Z.componentDidUpdate!=="function"&&!T9.has(Q))T9.add(Q),G("%s: getSnapshotBeforeUpdate() should be used with componentDidUpdate(). This component defines getSnapshotBeforeUpdate() only.",s1(Q));if(typeof Z.getDerivedStateFromProps==="function")G("%s: getDerivedStateFromProps() is defined as an instance method and will be ignored. Instead, declare it as a static method.",J);if(typeof Z.getDerivedStateFromError==="function")G("%s: getDerivedStateFromError() is defined as an instance method and will be ignored. Instead, declare it as a static method.",J);if(typeof Q.getSnapshotBeforeUpdate==="function")G("%s: getSnapshotBeforeUpdate() is defined as a static method and will be ignored. Instead, declare it as an instance method.",J);var U=Z.state;if(U&&(typeof U!=="object"||Z4(U)))G("%s.state: must be set to an object or null",J);if(typeof Z.getChildContext==="function"&&typeof Q.childContextTypes!=="object")G("%s.getChildContext(): childContextTypes must be defined in order to use getChildContext().",J)}}function yU(z,Q){Q.updater=y9,z.stateNode=Q,D_(Q,z),Q._reactInternalInstance=P9}function VU(z,Q,X){var Z=!1,J=C6,$=C6,q=Q.contextType;if("contextType"in Q){var U=q===null||q!==void 0&&q.$$typeof===v&&q._context===void 0;if(!U&&!f9.has(Q)){f9.add(Q);var L="";if(q===void 0)L=" However, it is set to undefined. This can be caused by a typo or by mixing up named and default imports. This can also happen due to a circular dependency, so try moving the createContext() call to a separate file.";else if(typeof q!=="object")L=" However, it is set to a "+typeof q+".";else if(q.$$typeof===F0)L=" Did you accidentally pass the Context.Provider instead?";else if(q._context!==void 0)L=" Did you accidentally pass the Context.Consumer instead?";else L=" However, it is set to an object with keys {"+Object.keys(q).join(", ")+"}.";G("%s defines an invalid contextType. contextType should point to the Context object returned by React.createContext().%s",s1(Q)||"Component",L)}}if(typeof q==="object"&&q!==null)$=Y5(q);else{J=Hz(z,Q,!0);var P=Q.contextTypes;Z=P!==null&&P!==void 0,$=Z?Gz(z,J):C6}var C=new Q(X,$);if(z.mode&n4){P5(!0);try{C=new Q(X,$)}finally{P5(!1)}}var i=z.memoizedState=C.state!==null&&C.state!==void 0?C.state:null;yU(z,C);{if(typeof Q.getDerivedStateFromProps==="function"&&i===null){var d=s1(Q)||"Component";if(!I9.has(d))I9.add(d),G("`%s` uses `getDerivedStateFromProps` but its initial state is %s. This is not recommended. Instead, define the initial state by assigning an object to `this.state` in the constructor of `%s`. This ensures that `getDerivedStateFromProps` arguments have a consistent shape.",d,C.state===null?"null":"undefined",d)}if(typeof Q.getDerivedStateFromProps==="function"||typeof C.getSnapshotBeforeUpdate==="function"){var Z0=null,J0=null,$0=null;if(typeof C.componentWillMount==="function"&&C.componentWillMount.__suppressDeprecationWarning!==!0)Z0="componentWillMount";else if(typeof C.UNSAFE_componentWillMount==="function")Z0="UNSAFE_componentWillMount";if(typeof C.componentWillReceiveProps==="function"&&C.componentWillReceiveProps.__suppressDeprecationWarning!==!0)J0="componentWillReceiveProps";else if(typeof C.UNSAFE_componentWillReceiveProps==="function")J0="UNSAFE_componentWillReceiveProps";if(typeof C.componentWillUpdate==="function"&&C.componentWillUpdate.__suppressDeprecationWarning!==!0)$0="componentWillUpdate";else if(typeof C.UNSAFE_componentWillUpdate==="function")$0="UNSAFE_componentWillUpdate";if(Z0!==null||J0!==null||$0!==null){var p0=s1(Q)||"Component",U1=typeof Q.getDerivedStateFromProps==="function"?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()";if(!k9.has(p0))k9.add(p0),G(`Unsafe legacy lifecycles will not be called for components using new component APIs.
|
|
89
|
+
|
|
90
|
+
%s uses %s but also contains the following legacy lifecycles:%s%s%s
|
|
91
|
+
|
|
92
|
+
The above lifecycles should be removed. Learn more about this warning here:
|
|
93
|
+
https://reactjs.org/link/unsafe-component-lifecycles`,p0,U1,Z0!==null?`
|
|
94
|
+
`+Z0:"",J0!==null?`
|
|
95
|
+
`+J0:"",$0!==null?`
|
|
96
|
+
`+$0:"")}}}if(Z)PB(z,J,$);return C}function rw(z,Q){var X=Q.state;if(typeof Q.componentWillMount==="function")Q.componentWillMount();if(typeof Q.UNSAFE_componentWillMount==="function")Q.UNSAFE_componentWillMount();if(X!==Q.state)G("%s.componentWillMount(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.",g1(z)||"Component"),y9.enqueueReplaceState(Q,Q.state,null)}function DU(z,Q,X,Z){var J=Q.state;if(typeof Q.componentWillReceiveProps==="function")Q.componentWillReceiveProps(X,Z);if(typeof Q.UNSAFE_componentWillReceiveProps==="function")Q.UNSAFE_componentWillReceiveProps(X,Z);if(Q.state!==J){{var $=g1(z)||"Component";if(!A9.has($))A9.add($),G("%s.componentWillReceiveProps(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.",$)}y9.enqueueReplaceState(Q,Q.state,null)}}function V9(z,Q,X,Z){nw(z,Q,X);var J=z.stateNode;J.props=X,J.state=z.memoizedState,J.refs={},j$(z);var $=Q.contextType;if(typeof $==="object"&&$!==null)J.context=Y5($);else{var q=Hz(z,Q,!0);J.context=Gz(z,q)}{if(J.state===X){var U=s1(Q)||"Component";if(!v9.has(U))v9.add(U),G("%s: It is not recommended to assign props directly to state because updates to props won't be reflected in state. In most cases, it is better to use props directly.",U)}if(z.mode&n4)s6.recordLegacyContextWarning(z,J);s6.recordUnsafeLifecycleWarnings(z,J)}J.state=z.memoizedState;var L=Q.getDerivedStateFromProps;if(typeof L==="function")h9(z,Q,L,X),J.state=z.memoizedState;if(typeof Q.getDerivedStateFromProps!=="function"&&typeof J.getSnapshotBeforeUpdate!=="function"&&(typeof J.UNSAFE_componentWillMount==="function"||typeof J.componentWillMount==="function"))rw(z,J),L3(z,X,J,Z),J.state=z.memoizedState;if(typeof J.componentDidMount==="function"){var P=t1;if(P|=o8,(z.mode&O7)!==O1)P|=m7;z.flags|=P}}function tw(z,Q,X,Z){var{stateNode:J,memoizedProps:$}=z;J.props=$;var q=J.context,U=Q.contextType,L=C6;if(typeof U==="object"&&U!==null)L=Y5(U);else{var P=Hz(z,Q,!0);L=Gz(z,P)}var C=Q.getDerivedStateFromProps,i=typeof C==="function"||typeof J.getSnapshotBeforeUpdate==="function";if(!i&&(typeof J.UNSAFE_componentWillReceiveProps==="function"||typeof J.componentWillReceiveProps==="function")){if($!==X||q!==L)DU(z,J,X,L)}rB();var d=z.memoizedState,Z0=J.state=d;if(L3(z,X,J,Z),Z0=z.memoizedState,$===X&&d===Z0&&!tZ()&&!N3()){if(typeof J.componentDidMount==="function"){var J0=t1;if(J0|=o8,(z.mode&O7)!==O1)J0|=m7;z.flags|=J0}return!1}if(typeof C==="function")h9(z,Q,C,X),Z0=z.memoizedState;var $0=N3()||hU(z,Q,$,X,d,Z0,L);if($0){if(!i&&(typeof J.UNSAFE_componentWillMount==="function"||typeof J.componentWillMount==="function")){if(typeof J.componentWillMount==="function")J.componentWillMount();if(typeof J.UNSAFE_componentWillMount==="function")J.UNSAFE_componentWillMount()}if(typeof J.componentDidMount==="function"){var p0=t1;if(p0|=o8,(z.mode&O7)!==O1)p0|=m7;z.flags|=p0}}else{if(typeof J.componentDidMount==="function"){var U1=t1;if(U1|=o8,(z.mode&O7)!==O1)U1|=m7;z.flags|=U1}z.memoizedProps=X,z.memoizedState=Z0}return J.props=X,J.state=Z0,J.context=L,$0}function sw(z,Q,X,Z,J){var $=Q.stateNode;nB(z,Q);var q=Q.memoizedProps,U=Q.type===Q.elementType?q:Q7(Q.type,q);$.props=U;var L=Q.pendingProps,P=$.context,C=X.contextType,i=C6;if(typeof C==="object"&&C!==null)i=Y5(C);else{var d=Hz(Q,X,!0);i=Gz(Q,d)}var Z0=X.getDerivedStateFromProps,J0=typeof Z0==="function"||typeof $.getSnapshotBeforeUpdate==="function";if(!J0&&(typeof $.UNSAFE_componentWillReceiveProps==="function"||typeof $.componentWillReceiveProps==="function")){if(q!==L||P!==i)DU(Q,$,Z,i)}rB();var $0=Q.memoizedState,p0=$.state=$0;if(L3(Q,Z,$,J),p0=Q.memoizedState,q===L&&$0===p0&&!tZ()&&!N3()&&!P0){if(typeof $.componentDidUpdate==="function"){if(q!==z.memoizedProps||$0!==z.memoizedState)Q.flags|=t1}if(typeof $.getSnapshotBeforeUpdate==="function"){if(q!==z.memoizedProps||$0!==z.memoizedState)Q.flags|=d8}return!1}if(typeof Z0==="function")h9(Q,X,Z0,Z),p0=Q.memoizedState;var U1=N3()||hU(Q,X,U,Z,$0,p0,i)||P0;if(U1){if(!J0&&(typeof $.UNSAFE_componentWillUpdate==="function"||typeof $.componentWillUpdate==="function")){if(typeof $.componentWillUpdate==="function")$.componentWillUpdate(Z,p0,i);if(typeof $.UNSAFE_componentWillUpdate==="function")$.UNSAFE_componentWillUpdate(Z,p0,i)}if(typeof $.componentDidUpdate==="function")Q.flags|=t1;if(typeof $.getSnapshotBeforeUpdate==="function")Q.flags|=d8}else{if(typeof $.componentDidUpdate==="function"){if(q!==z.memoizedProps||$0!==z.memoizedState)Q.flags|=t1}if(typeof $.getSnapshotBeforeUpdate==="function"){if(q!==z.memoizedProps||$0!==z.memoizedState)Q.flags|=d8}Q.memoizedProps=Z,Q.memoizedState=p0}return $.props=Z,$.state=p0,$.context=i,U1}function W2(z,Q){return{value:z,source:Q,stack:QQ(Q),digest:null}}function D9(z,Q,X){return{value:z,source:null,stack:X!=null?X:null,digest:Q!=null?Q:null}}function ew(z,Q){return!0}function m9(z,Q){try{var X=ew(z,Q);if(X===!1)return;var{value:Z,source:J,stack:$}=Q,q=$!==null?$:"";if(Z!=null&&Z._suppressLogging){if(z.tag===O)return;console.error(Z)}var U=J?g1(J):null,L=U?"The above error occurred in the <"+U+"> component:":"The above error occurred in one of your React components:",P;if(z.tag===b)P=`Consider adding an error boundary to your tree to customize error handling behavior.
|
|
97
|
+
Visit https://reactjs.org/link/error-boundaries to learn more about error boundaries.`;else{var C=g1(z)||"Anonymous";P="React will try to recreate this component tree from scratch "+("using the error boundary you provided, "+C+".")}var i=L+`
|
|
98
|
+
`+q+`
|
|
99
|
+
|
|
100
|
+
`+(""+P);console.error(i)}catch(d){setTimeout(function(){throw d})}}var zF=typeof WeakMap==="function"?WeakMap:Map;function mU(z,Q,X){var Z=i7(V4,X);Z.tag=x$,Z.payload={element:null};var J=Q.value;return Z.callback=function(){tb(J),m9(z,Q)},Z}function g9(z,Q,X){var Z=i7(V4,X);Z.tag=x$;var J=z.type.getDerivedStateFromError;if(typeof J==="function"){var $=Q.value;Z.payload=function(){return J($)},Z.callback=function(){aW(z),m9(z,Q)}}var q=z.stateNode;if(q!==null&&typeof q.componentDidCatch==="function")Z.callback=function(){if(aW(z),m9(z,Q),typeof J!=="function")nb(this);var{value:L,stack:P}=Q;if(this.componentDidCatch(L,{componentStack:P!==null?P:""}),typeof J!=="function"){if(!A6(z.lanes,k1))G("%s: Error boundaries should implement getDerivedStateFromError(). In that method, return a state update to display an error message or fallback UI.",g1(z)||"Unknown")}};return Z}function gU(z,Q,X){var Z=z.pingCache,J;if(Z===null)Z=z.pingCache=new zF,J=new Set,Z.set(Q,J);else if(J=Z.get(Q),J===void 0)J=new Set,Z.set(Q,J);if(!J.has(X)){J.add(X);var $=sb.bind(null,z,Q,X);if(a6)SX(z,X);Q.then($,$)}}function QF(z,Q,X,Z){var J=z.updateQueue;if(J===null){var $=new Set;$.add(X),z.updateQueue=$}else J.add(X)}function XF(z,Q){var X=z.tag;if((z.mode&o1)===O1&&(X===W||X===f||X===E)){var Z=z.alternate;if(Z)z.updateQueue=Z.updateQueue,z.memoizedState=Z.memoizedState,z.lanes=Z.lanes;else z.updateQueue=null,z.memoizedState=null}}function uU(z){var Q=z;do{if(Q.tag===T&&gw(Q))return Q;Q=Q.return}while(Q!==null);return null}function EU(z,Q,X,Z,J){if((z.mode&o1)===O1){if(z===Q)z.flags|=Q6;else{if(z.flags|=J4,X.flags|=XY,X.flags&=~(m_|WQ),X.tag===O){var $=X.alternate;if($===null)X.tag=n;else{var q=i7(V4,k1);q.tag=W3,P8(X,q,k1)}}X.lanes=u1(X.lanes,k1)}return z}return z.flags|=Q6,z.lanes=J,z}function ZF(z,Q,X,Z,J){if(X.flags|=WQ,a6)SX(z,J);if(Z!==null&&typeof Z==="object"&&typeof Z.then==="function"){var $=Z;if(XF(X),S5()&&X.mode&o1)SB();var q=uU(Q);if(q!==null){if(q.flags&=~V7,EU(q,Q,X,z,J),q.mode&o1)gU(z,$,J);QF(q,z,$);return}else{if(!TL(J)){gU(z,$,J),NH();return}var U=Error("A component suspended while responding to synchronous input. This will cause the UI to be replaced with a loading indicator. To fix, updates that suspend should be wrapped with startTransition.");Z=U}}else if(S5()&&X.mode&o1){SB();var L=uU(Q);if(L!==null){if((L.flags&Q6)===w1)L.flags|=V7;EU(L,Q,X,z,J),C$(W2(Z,X));return}}Z=W2(Z,X),pb(Z);var P=Q;do{switch(P.tag){case b:{var C=Z;P.flags|=Q6;var i=wQ(J);P.lanes=u1(P.lanes,i);var d=mU(P,C,i);l$(P,d);return}case O:var Z0=Z,J0=P.type,$0=P.stateNode;if((P.flags&J4)===w1&&(typeof J0.getDerivedStateFromError==="function"||$0!==null&&typeof $0.componentDidCatch==="function"&&!EW($0))){P.flags|=Q6;var p0=wQ(J);P.lanes=u1(P.lanes,p0);var U1=g9(P,Z0,p0);l$(P,U1);return}break}P=P.return}while(P!==null)}function JF(){return null}var OX=Y.ReactCurrentOwner,X7=!1,u9,_X,E9,x9,p9,K2,j9,l3,LX;u9={},_X={},E9={},x9={},p9={},K2=!1,j9={},l3={},LX={};function X6(z,Q,X,Z){if(z===null)Q.child=jB(Q,null,X,Z);else Q.child=Wz(Q,z.child,X,Z)}function YF(z,Q,X,Z){Q.child=Wz(Q,z.child,null,Z),Q.child=Wz(Q,null,X,Z)}function xU(z,Q,X,Z,J){if(Q.type!==Q.elementType){var $=X.propTypes;if($)r6($,Z,"prop",s1(X))}var q=X.render,U=Q.ref,L,P;Oz(Q,J),OQ(Q);{if(OX.current=Q,b6(!0),L=wz(z,Q,q,Z,U,J),P=Fz(),Q.mode&n4){P5(!0);try{L=wz(z,Q,q,Z,U,J),P=Fz()}finally{P5(!1)}}b6(!1)}if(o2(),z!==null&&!X7)return XU(z,Q,J),o7(z,Q,J);if(S5()&&P)b$(Q);return Q.flags|=d2,X6(z,Q,L,J),Q.child}function pU(z,Q,X,Z,J){if(z===null){var $=X.type;if(_P($)&&X.compare===null&&X.defaultProps===void 0){var q=$;return q=vz($),Q.tag=E,Q.type=q,d9(Q,$),jU(z,Q,q,Z,J)}{var U=$.propTypes;if(U)r6(U,Z,"prop",s1($));if(X.defaultProps!==void 0){var L=s1($)||"Unknown";if(!LX[L])G("%s: Support for defaultProps will be removed from memo components in a future major release. Use JavaScript default parameters instead.",L),LX[L]=!0}}var P=CH(X.type,null,Z,Q,Q.mode,J);return P.ref=Q.ref,P.return=Q,Q.child=P,P}{var C=X.type,i=C.propTypes;if(i)r6(i,Z,"prop",s1(C))}var d=z.child,Z0=t9(z,J);if(!Z0){var J0=d.memoizedProps,$0=X.compare;if($0=$0!==null?$0:DQ,$0(J0,Z)&&z.ref===Q.ref)return o7(z,Q,J)}Q.flags|=d2;var p0=R2(d,Z);return p0.ref=Q.ref,p0.return=Q,Q.child=p0,p0}function jU(z,Q,X,Z,J){if(Q.type!==Q.elementType){var $=Q.elementType;if($.$$typeof===Q1){var q=$,U=q._payload,L=q._init;try{$=L(U)}catch(i){$=null}var P=$&&$.propTypes;if(P)r6(P,Z,"prop",s1($))}}if(z!==null){var C=z.memoizedProps;if(DQ(C,Z)&&z.ref===Q.ref&&Q.type===z.type){if(X7=!1,Q.pendingProps=Z=C,!t9(z,J))return Q.lanes=z.lanes,o7(z,Q,J);else if((z.flags&XY)!==w1)X7=!0}}return l9(z,Q,X,Z,J)}function lU(z,Q,X){var Z=Q.pendingProps,J=Z.children,$=z!==null?z.memoizedState:null;if(Z.mode==="hidden"||a)if((Q.mode&o1)===O1){var q={baseLanes:b0,cachePool:null,transitions:null};Q.memoizedState=q,XJ(Q,X)}else if(!A6(X,P6)){var U=null,L;if($!==null){var P=$.baseLanes;L=u1(P,X)}else L=X;Q.lanes=Q.childLanes=bZ(P6);var C={baseLanes:L,cachePool:U,transitions:null};return Q.memoizedState=C,Q.updateQueue=null,XJ(Q,L),null}else{var i={baseLanes:b0,cachePool:null,transitions:null};Q.memoizedState=i;var d=$!==null?$.baseLanes:X;XJ(Q,d)}else{var Z0;if($!==null)Z0=u1($.baseLanes,X),Q.memoizedState=null;else Z0=X;XJ(Q,Z0)}return X6(z,Q,J,X),Q.child}function $F(z,Q,X){var Z=Q.pendingProps;return X6(z,Q,Z,X),Q.child}function HF(z,Q,X){var Z=Q.pendingProps.children;return X6(z,Q,Z,X),Q.child}function GF(z,Q,X){{Q.flags|=t1;{var Z=Q.stateNode;Z.effectDuration=0,Z.passiveEffectDuration=0}}var J=Q.pendingProps,$=J.children;return X6(z,Q,$,X),Q.child}function cU(z,Q){var X=Q.ref;if(z===null&&X!==null||z!==null&&z.ref!==X)Q.flags|=U8,Q.flags|=ZY}function l9(z,Q,X,Z,J){if(Q.type!==Q.elementType){var $=X.propTypes;if($)r6($,Z,"prop",s1(X))}var q;{var U=Hz(Q,X,!0);q=Gz(Q,U)}var L,P;Oz(Q,J),OQ(Q);{if(OX.current=Q,b6(!0),L=wz(z,Q,X,Z,q,J),P=Fz(),Q.mode&n4){P5(!0);try{L=wz(z,Q,X,Z,q,J),P=Fz()}finally{P5(!1)}}b6(!1)}if(o2(),z!==null&&!X7)return XU(z,Q,J),o7(z,Q,J);if(S5()&&P)b$(Q);return Q.flags|=d2,X6(z,Q,L,J),Q.child}function dU(z,Q,X,Z,J){{switch(SP(Q)){case!1:{var{stateNode:$,type:q}=Q,U=new q(Q.memoizedProps,$.context),L=U.state;$.updater.enqueueSetState($,L,null);break}case!0:{Q.flags|=J4,Q.flags|=Q6;var P=Error("Simulated error coming from DevTools"),C=wQ(J);Q.lanes=u1(Q.lanes,C);var i=g9(Q,W2(P,Q),C);l$(Q,i);break}}if(Q.type!==Q.elementType){var d=X.propTypes;if(d)r6(d,Z,"prop",s1(X))}}var Z0;if(N7(X))Z0=!0,eZ(Q);else Z0=!1;Oz(Q,J);var J0=Q.stateNode,$0;if(J0===null)d3(z,Q),VU(Q,X,Z),V9(Q,X,Z,J),$0=!0;else if(z===null)$0=tw(Q,X,Z,J);else $0=sw(z,Q,X,Z,J);var p0=c9(z,Q,X,$0,Z0,J);{var U1=Q.stateNode;if($0&&U1.props!==Z){if(!K2)G("It looks like %s is reassigning its own `this.props` while rendering. This is not supported and can lead to confusing bugs.",g1(Q)||"a component");K2=!0}}return p0}function c9(z,Q,X,Z,J,$){cU(z,Q);var q=(Q.flags&J4)!==w1;if(!Z&&!q){if(J)TB(Q,X,!1);return o7(z,Q,$)}var U=Q.stateNode;OX.current=Q;var L;if(q&&typeof X.getDerivedStateFromError!=="function")L=null,vU();else{OQ(Q);{if(b6(!0),L=U.render(),Q.mode&n4){P5(!0);try{U.render()}finally{P5(!1)}}b6(!1)}o2()}if(Q.flags|=d2,z!==null&&q)YF(z,Q,L,$);else X6(z,Q,L,$);if(Q.memoizedState=U.state,J)TB(Q,X,!0);return Q.child}function iU(z){var Q=z.stateNode;if(Q.pendingContext)AB(z,Q.pendingContext,Q.pendingContext!==Q.context);else if(Q.context)AB(z,Q.context,!1);c$(z,Q.containerInfo)}function qF(z,Q,X){if(iU(Q),z===null)throw Error("Should have a current fiber. This is a bug in React.");var{pendingProps:Z,memoizedState:J}=Q,$=J.element;nB(z,Q),L3(Q,Z,null,X);var{memoizedState:q,stateNode:U}=Q,L=q.element;if(J.isDehydrated){var P={element:L,isDehydrated:!1,cache:q.cache,pendingSuspenseBoundaries:q.pendingSuspenseBoundaries,transitions:q.transitions},C=Q.updateQueue;if(C.baseState=P,Q.memoizedState=P,Q.flags&V7){var i=W2(Error("There was an error while hydrating. Because the error happened outside of a Suspense boundary, the entire root will switch to client rendering."),Q);return oU(z,Q,L,X,i)}else if(L!==$){var d=W2(Error("This root received an early update, before anything was able hydrate. Switched the entire root to client rendering."),Q);return oU(z,Q,L,X,d)}else{Kw(Q);var Z0=jB(Q,null,L,X);Q.child=Z0;var J0=Z0;while(J0)J0.flags=J0.flags&~J5|D7,J0=J0.sibling}}else{if(Uz(),L===$)return o7(z,Q,X);X6(z,Q,L,X)}return Q.child}function oU(z,Q,X,Z,J){return Uz(),C$(J),Q.flags|=V7,X6(z,Q,X,Z),Q.child}function BF(z,Q,X){if(eB(Q),z===null)k$(Q);var{type:Z,pendingProps:J}=Q,$=z!==null?z.memoizedProps:null,q=J.children,U=q$(Z,J);if(U)q=null;else if($!==null&&q$(Z,$))Q.flags|=UQ;return cU(z,Q),X6(z,Q,q,X),Q.child}function UF(z,Q){if(z===null)k$(Q);return null}function WF(z,Q,X,Z){d3(z,Q);var J=Q.pendingProps,$=X,q=$._payload,U=$._init,L=U(q);Q.type=L;var P=Q.tag=LP(L),C=Q7(L,J),i;switch(P){case W:return d9(Q,L),Q.type=L=vz(L),i=l9(null,Q,L,C,Z),i;case O:return Q.type=L=bH(L),i=dU(null,Q,L,C,Z),i;case f:return Q.type=L=PH(L),i=xU(null,Q,L,C,Z),i;case m:{if(Q.type!==Q.elementType){var d=L.propTypes;if(d)r6(d,C,"prop",s1(L))}return i=pU(null,Q,L,Q7(L.type,C),Z),i}}var Z0="";if(L!==null&&typeof L==="object"&&L.$$typeof===Q1)Z0=" Did you wrap a component in React.lazy() more than once?";throw Error("Element type is invalid. Received a promise that resolves to: "+L+". "+("Lazy element type must resolve to a class or function."+Z0))}function KF(z,Q,X,Z,J){d3(z,Q),Q.tag=O;var $;if(N7(X))$=!0,eZ(Q);else $=!1;return Oz(Q,J),VU(Q,X,Z),V9(Q,X,Z,J),c9(null,Q,X,!0,$,J)}function OF(z,Q,X,Z){d3(z,Q);var J=Q.pendingProps,$;{var q=Hz(Q,X,!1);$=Gz(Q,q)}Oz(Q,Z);var U,L;OQ(Q);{if(X.prototype&&typeof X.prototype.render==="function"){var P=s1(X)||"Unknown";if(!u9[P])G("The <%s /> component appears to have a render method, but doesn't extend React.Component. This is likely to cause errors. Change %s to extend React.Component instead.",P,P),u9[P]=!0}if(Q.mode&n4)s6.recordLegacyContextWarning(Q,null);b6(!0),OX.current=Q,U=wz(null,Q,X,J,$,Z),L=Fz(),b6(!1)}if(o2(),Q.flags|=d2,typeof U==="object"&&U!==null&&typeof U.render==="function"&&U.$$typeof===void 0){var C=s1(X)||"Unknown";if(!_X[C])G("The <%s /> component appears to be a function component that returns a class instance. Change %s to a class that extends React.Component instead. If you can't use a class try assigning the prototype on the function as a workaround. `%s.prototype = React.Component.prototype`. Don't use an arrow function since it cannot be called with `new` by React.",C,C,C),_X[C]=!0}if(typeof U==="object"&&U!==null&&typeof U.render==="function"&&U.$$typeof===void 0){{var i=s1(X)||"Unknown";if(!_X[i])G("The <%s /> component appears to be a function component that returns a class instance. Change %s to a class that extends React.Component instead. If you can't use a class try assigning the prototype on the function as a workaround. `%s.prototype = React.Component.prototype`. Don't use an arrow function since it cannot be called with `new` by React.",i,i,i),_X[i]=!0}Q.tag=O,Q.memoizedState=null,Q.updateQueue=null;var d=!1;if(N7(X))d=!0,eZ(Q);else d=!1;return Q.memoizedState=U.state!==null&&U.state!==void 0?U.state:null,j$(Q),yU(Q,U),V9(Q,X,J,Z),c9(null,Q,X,!0,d,Z)}else{if(Q.tag=W,Q.mode&n4){P5(!0);try{U=wz(null,Q,X,J,$,Z),L=Fz()}finally{P5(!1)}}if(S5()&&L)b$(Q);return X6(null,Q,U,Z),d9(Q,X),Q.child}}function d9(z,Q){{if(Q){if(Q.childContextTypes)G("%s(...): childContextTypes cannot be defined on a function component.",Q.displayName||Q.name||"Component")}if(z.ref!==null){var X="",Z=G8();if(Z)X+=`
|
|
101
|
+
|
|
102
|
+
Check the render method of \``+Z+"`.";var J=Z||"",$=z._debugSource;if($)J=$.fileName+":"+$.lineNumber;if(!p9[J])p9[J]=!0,G("Function components cannot be given refs. Attempts to access this ref will fail. Did you mean to use React.forwardRef()?%s",X)}if(Q.defaultProps!==void 0){var q=s1(Q)||"Unknown";if(!LX[q])G("%s: Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead.",q),LX[q]=!0}if(typeof Q.getDerivedStateFromProps==="function"){var U=s1(Q)||"Unknown";if(!x9[U])G("%s: Function components do not support getDerivedStateFromProps.",U),x9[U]=!0}if(typeof Q.contextType==="object"&&Q.contextType!==null){var L=s1(Q)||"Unknown";if(!E9[L])G("%s: Function components do not support contextType.",L),E9[L]=!0}}}var i9={dehydrated:null,treeContext:null,retryLane:A5};function o9(z){return{baseLanes:z,cachePool:JF(),transitions:null}}function _F(z,Q){var X=null;return{baseLanes:u1(z.baseLanes,Q),cachePool:X,transitions:z.transitions}}function LF(z,Q,X,Z){if(Q!==null){var J=Q.memoizedState;if(J===null)return!1}return o$(z,YX)}function NF(z,Q){return FZ(z.childLanes,Q)}function aU(z,Q,X){var Z=Q.pendingProps;if(fP(Q))Q.flags|=J4;var J=e6.current,$=!1,q=(Q.flags&J4)!==w1;if(q||LF(J,z))$=!0,Q.flags&=~J4;else if(z===null||z.memoizedState!==null)J=mw(J,QU);if(J=Lz(J),I8(Q,J),z===null){k$(Q);var U=Q.memoizedState;if(U!==null){var L=U.dehydrated;if(L!==null)return bF(Q,L)}var{children:P,fallback:C}=Z;if($){var i=RF(Q,P,C,X),d=Q.child;return d.memoizedState=o9(X),Q.memoizedState=i9,i}else return a9(Q,P)}else{var Z0=z.memoizedState;if(Z0!==null){var J0=Z0.dehydrated;if(J0!==null)return PF(z,Q,q,Z,J0,Z0,X)}if($){var{fallback:$0,children:p0}=Z,U1=wF(z,Q,p0,$0,X),X1=Q.child,j1=z.child.memoizedState;return X1.memoizedState=j1===null?o9(X):_F(j1,X),X1.childLanes=NF(z,X),Q.memoizedState=i9,U1}else{var l1=Z.children,s=MF(z,Q,l1,X);return Q.memoizedState=null,s}}}function a9(z,Q,X){var Z=z.mode,J={mode:"visible",children:Q},$=n9(J,Z);return $.return=z,z.child=$,$}function RF(z,Q,X,Z){var{mode:J,child:$}=z,q={mode:"hidden",children:Q},U,L;if((J&o1)===O1&&$!==null){if(U=$,U.childLanes=b0,U.pendingProps=q,z.mode&_4)U.actualDuration=0,U.actualStartTime=-1,U.selfBaseDuration=0,U.treeBaseDuration=0;L=y8(X,J,Z,null)}else U=n9(q,J),L=y8(X,J,Z,null);return U.return=z,L.return=z,U.sibling=L,z.child=U,L}function n9(z,Q,X){return rW(z,Q,b0,null)}function nU(z,Q){return R2(z,Q)}function MF(z,Q,X,Z){var J=z.child,$=J.sibling,q=nU(J,{mode:"visible",children:X});if((Q.mode&o1)===O1)q.lanes=Z;if(q.return=Q,q.sibling=null,$!==null){var U=Q.deletions;if(U===null)Q.deletions=[$],Q.flags|=c8;else U.push($)}return Q.child=q,q}function wF(z,Q,X,Z,J){var $=Q.mode,q=z.child,U=q.sibling,L={mode:"hidden",children:X},P;if(($&o1)===O1&&Q.child!==q){var C=Q.child;if(P=C,P.childLanes=b0,P.pendingProps=L,Q.mode&_4)P.actualDuration=0,P.actualStartTime=-1,P.selfBaseDuration=q.selfBaseDuration,P.treeBaseDuration=q.treeBaseDuration;Q.deletions=null}else P=nU(q,L),P.subtreeFlags=q.subtreeFlags&g7;var i;if(U!==null)i=R2(U,Z);else i=y8(Z,$,J,null),i.flags|=J5;return i.return=Q,P.return=Q,P.sibling=i,Q.child=P,i}function c3(z,Q,X,Z){if(Z!==null)C$(Z);Wz(Q,z.child,null,X);var J=Q.pendingProps,$=J.children,q=a9(Q,$);return q.flags|=J5,Q.memoizedState=null,q}function FF(z,Q,X,Z,J){var $=Q.mode,q={mode:"visible",children:X},U=n9(q,$),L=y8(Z,$,J,null);if(L.flags|=J5,U.return=Q,L.return=Q,U.sibling=L,Q.child=U,(Q.mode&o1)!==O1)Wz(Q,z.child,null,J);return L}function bF(z,Q,X){if((z.mode&o1)===O1)G("Cannot hydrate Suspense in legacy mode. Switch from ReactDOM.hydrate(element, container) to ReactDOMClient.hydrateRoot(container, <App />).render(element) or remove the Suspense components from the server rendered components."),z.lanes=bZ(k1);else if(K$(Q))z.lanes=bZ(t8);else z.lanes=bZ(P6);return null}function PF(z,Q,X,Z,J,$,q){if(!X){if(Uw(),(Q.mode&o1)===O1)return c3(z,Q,q,null);if(K$(J)){var U,L,P;{var C=CM(J);U=C.digest,L=C.message,P=C.stack}var i;if(L)i=Error(L);else i=Error("The server could not finish this Suspense boundary, likely due to an error during server rendering. Switched to client rendering.");var d=D9(i,U,P);return c3(z,Q,q,d)}var Z0=A6(q,z.childLanes);if(X7||Z0){var J0=QJ();if(J0!==null){var $0=VL(J0,q);if($0!==A5&&$0!==$.retryLane){$.retryLane=$0;var p0=V4;W6(z,$0),_5(J0,z,$0,p0)}}NH();var U1=D9(Error("This Suspense boundary received an update before it finished hydrating. This caused the boundary to switch to client rendering. The usual way to fix this is to wrap the original update in startTransition."));return c3(z,Q,q,U1)}else if(NB(J)){Q.flags|=J4,Q.child=z.child;var X1=eb.bind(null,z);return vM(J,X1),null}else{Ow(Q,J,$.treeContext);var j1=Z.children,l1=a9(Q,j1);return l1.flags|=D7,l1}}else if(Q.flags&V7){Q.flags&=~V7;var s=D9(Error("There was an error while hydrating this Suspense boundary. Switched to client rendering."));return c3(z,Q,q,s)}else if(Q.memoizedState!==null)return Q.child=z.child,Q.flags|=J4,null;else{var{children:K0,fallback:e}=Z,T0=FF(z,Q,K0,e,q),i0=Q.child;return i0.memoizedState=o9(q),Q.memoizedState=i9,T0}}function rU(z,Q,X){z.lanes=u1(z.lanes,Q);var Z=z.alternate;if(Z!==null)Z.lanes=u1(Z.lanes,Q);u$(z.return,Q,X)}function AF(z,Q,X){var Z=Q;while(Z!==null){if(Z.tag===T){var J=Z.memoizedState;if(J!==null)rU(Z,X,z)}else if(Z.tag===j)rU(Z,X,z);else if(Z.child!==null){Z.child.return=Z,Z=Z.child;continue}if(Z===z)return;while(Z.sibling===null){if(Z.return===null||Z.return===z)return;Z=Z.return}Z.sibling.return=Z.return,Z=Z.sibling}}function IF(z){var Q=z,X=null;while(Q!==null){var Z=Q.alternate;if(Z!==null&&w3(Z)===null)X=Q;Q=Q.sibling}return X}function TF(z){if(z!==void 0&&z!=="forwards"&&z!=="backwards"&&z!=="together"&&!j9[z])if(j9[z]=!0,typeof z==="string")switch(z.toLowerCase()){case"together":case"forwards":case"backwards":{G('"%s" is not a valid value for revealOrder on <SuspenseList />. Use lowercase "%s" instead.',z,z.toLowerCase());break}case"forward":case"backward":{G('"%s" is not a valid value for revealOrder on <SuspenseList />. React uses the -s suffix in the spelling. Use "%ss" instead.',z,z.toLowerCase());break}default:G('"%s" is not a supported revealOrder on <SuspenseList />. Did you mean "together", "forwards" or "backwards"?',z);break}else G('%s is not a supported value for revealOrder on <SuspenseList />. Did you mean "together", "forwards" or "backwards"?',z)}function kF(z,Q){if(z!==void 0&&!l3[z]){if(z!=="collapsed"&&z!=="hidden")l3[z]=!0,G('"%s" is not a supported value for tail on <SuspenseList />. Did you mean "collapsed" or "hidden"?',z);else if(Q!=="forwards"&&Q!=="backwards")l3[z]=!0,G('<SuspenseList tail="%s" /> is only valid if revealOrder is "forwards" or "backwards". Did you mean to specify revealOrder="forwards"?',z)}}function tU(z,Q){{var X=Z4(z),Z=!X&&typeof y4(z)==="function";if(X||Z){var J=X?"array":"iterable";return G("A nested %s was passed to row #%s in <SuspenseList />. Wrap it in an additional SuspenseList to configure its revealOrder: <SuspenseList revealOrder=...> ... <SuspenseList revealOrder=...>{%s}</SuspenseList> ... </SuspenseList>",J,Q,J),!1}}return!0}function CF(z,Q){if((Q==="forwards"||Q==="backwards")&&z!==void 0&&z!==null&&z!==!1)if(Z4(z)){for(var X=0;X<z.length;X++)if(!tU(z[X],X))return}else{var Z=y4(z);if(typeof Z==="function"){var J=Z.call(z);if(J){var $=J.next(),q=0;for(;!$.done;$=J.next()){if(!tU($.value,q))return;q++}}}else G('A single row was passed to a <SuspenseList revealOrder="%s" />. This is not useful since it needs multiple rows. Did you mean to pass multiple children or an array?',Q)}}function r9(z,Q,X,Z,J){var $=z.memoizedState;if($===null)z.memoizedState={isBackwards:Q,rendering:null,renderingStartTime:0,last:Z,tail:X,tailMode:J};else $.isBackwards=Q,$.rendering=null,$.renderingStartTime=0,$.last=Z,$.tail=X,$.tailMode=J}function sU(z,Q,X){var Z=Q.pendingProps,J=Z.revealOrder,$=Z.tail,q=Z.children;TF(J),kF($,J),CF(q,J),X6(z,Q,q,X);var U=e6.current,L=o$(U,YX);if(L)U=a$(U,YX),Q.flags|=J4;else{var P=z!==null&&(z.flags&J4)!==w1;if(P)AF(Q,Q.child,X);U=Lz(U)}if(I8(Q,U),(Q.mode&o1)===O1)Q.memoizedState=null;else switch(J){case"forwards":{var C=IF(Q.child),i;if(C===null)i=Q.child,Q.child=null;else i=C.sibling,C.sibling=null;r9(Q,!1,i,C,$);break}case"backwards":{var d=null,Z0=Q.child;Q.child=null;while(Z0!==null){var J0=Z0.alternate;if(J0!==null&&w3(J0)===null){Q.child=Z0;break}var $0=Z0.sibling;Z0.sibling=d,d=Z0,Z0=$0}r9(Q,!0,d,null,$);break}case"together":{r9(Q,!1,null,null,void 0);break}default:Q.memoizedState=null}return Q.child}function vF(z,Q,X){c$(Q,Q.stateNode.containerInfo);var Z=Q.pendingProps;if(z===null)Q.child=Wz(Q,null,Z,X);else X6(z,Q,Z,X);return Q.child}var eU=!1;function SF(z,Q,X){var Z=Q.type,J=Z._context,$=Q.pendingProps,q=Q.memoizedProps,U=$.value;{if(!("value"in $)){if(!eU)eU=!0,G("The `value` prop is required for the `<Context.Provider>`. Did you misspell it or forget to pass it?")}var L=Q.type.propTypes;if(L)r6(L,$,"prop","Context.Provider")}if(dB(Q,J,U),q!==null){var P=q.value;if(k6(P,U)){if(q.children===$.children&&!tZ())return o7(z,Q,X)}else kw(Q,J,X)}var C=$.children;return X6(z,Q,C,X),Q.child}var zW=!1;function fF(z,Q,X){var Z=Q.type;if(Z._context===void 0){if(Z!==Z.Consumer){if(!zW)zW=!0,G("Rendering <Context> directly is not supported and will be removed in a future major release. Did you mean to render <Context.Consumer> instead?")}}else Z=Z._context;var J=Q.pendingProps,$=J.children;if(typeof $!=="function")G("A context consumer was rendered with multiple children, or a child that isn't a function. A context consumer expects a single child that is a function. If you did pass a function, make sure there is no trailing or leading whitespace around it.");Oz(Q,X);var q=Y5(Z);OQ(Q);var U;return OX.current=Q,b6(!0),U=$(q),b6(!1),o2(),Q.flags|=d2,X6(z,Q,U,X),Q.child}function NX(){X7=!0}function d3(z,Q){if((Q.mode&o1)===O1){if(z!==null)z.alternate=null,Q.alternate=null,Q.flags|=J5}}function o7(z,Q,X){if(z!==null)Q.dependencies=z.dependencies;if(vU(),vX(Q.lanes),!A6(X,Q.childLanes))return null;return Iw(z,Q),Q.child}function hF(z,Q,X){{var Z=Q.return;if(Z===null)throw Error("Cannot swap the root fiber.");if(z.alternate=null,Q.alternate=null,X.index=Q.index,X.sibling=Q.sibling,X.return=Q.return,X.ref=Q.ref,Q===Z.child)Z.child=X;else{var J=Z.child;if(J===null)throw Error("Expected parent to have a child.");while(J.sibling!==Q)if(J=J.sibling,J===null)throw Error("Expected to find the previous sibling.");J.sibling=X}var $=Z.deletions;if($===null)Z.deletions=[z],Z.flags|=c8;else $.push(z);return X.flags|=J5,X}}function t9(z,Q){var X=z.lanes;if(A6(X,Q))return!0;return!1}function yF(z,Q,X){switch(Q.tag){case b:iU(Q);var Z=Q.stateNode;Uz();break;case A:eB(Q);break;case O:{var J=Q.type;if(N7(J))eZ(Q);break}case M:c$(Q,Q.stateNode.containerInfo);break;case x:{var $=Q.memoizedProps.value,q=Q.type._context;dB(Q,q,$);break}case l:{var U=A6(X,Q.childLanes);if(U)Q.flags|=t1;{var L=Q.stateNode;L.effectDuration=0,L.passiveEffectDuration=0}}break;case T:{var P=Q.memoizedState;if(P!==null){if(P.dehydrated!==null)return I8(Q,Lz(e6.current)),Q.flags|=J4,null;var C=Q.child,i=C.childLanes;if(A6(X,i))return aU(z,Q,X);else{I8(Q,Lz(e6.current));var d=o7(z,Q,X);if(d!==null)return d.sibling;else return null}}else I8(Q,Lz(e6.current));break}case j:{var Z0=(z.flags&J4)!==w1,J0=A6(X,Q.childLanes);if(Z0){if(J0)return sU(z,Q,X);Q.flags|=J4}var $0=Q.memoizedState;if($0!==null)$0.rendering=null,$0.tail=null,$0.lastEffect=null;if(I8(Q,e6.current),J0)break;else return null}case Q0:case r:return Q.lanes=b0,lU(z,Q,X)}return o7(z,Q,X)}function QW(z,Q,X){if(Q._debugNeedsRemount&&z!==null)return hF(z,Q,CH(Q.type,Q.key,Q.pendingProps,Q._debugOwner||null,Q.mode,Q.lanes));if(z!==null){var Z=z.memoizedProps,J=Q.pendingProps;if(Z!==J||tZ()||Q.type!==z.type)X7=!0;else{var $=t9(z,X);if(!$&&(Q.flags&J4)===w1)return X7=!1,yF(z,Q,X);if((z.flags&XY)!==w1)X7=!0;else X7=!1}}else if(X7=!1,S5()&&Yw(Q)){var q=Q.index,U=$w();vB(Q,U,q)}switch(Q.lanes=b0,Q.tag){case F:return OF(z,Q,Q.type,X);case D:{var L=Q.elementType;return WF(z,Q,L,X)}case W:{var{type:P,pendingProps:C}=Q,i=Q.elementType===P?C:Q7(P,C);return l9(z,Q,P,i,X)}case O:{var{type:d,pendingProps:Z0}=Q,J0=Q.elementType===d?Z0:Q7(d,Z0);return dU(z,Q,d,J0,X)}case b:return qF(z,Q,X);case A:return BF(z,Q,X);case R:return UF(z,Q);case T:return aU(z,Q,X);case M:return vF(z,Q,X);case f:{var{type:$0,pendingProps:p0}=Q,U1=Q.elementType===$0?p0:Q7($0,p0);return xU(z,Q,$0,U1,X)}case k:return $F(z,Q,X);case S:return HF(z,Q,X);case l:return GF(z,Q,X);case x:return SF(z,Q,X);case V:return fF(z,Q,X);case m:{var{type:X1,pendingProps:j1}=Q,l1=Q7(X1,j1);if(Q.type!==Q.elementType){var s=X1.propTypes;if(s)r6(s,l1,"prop",s1(X1))}return l1=Q7(X1.type,l1),pU(z,Q,X1,l1,X)}case E:return jU(z,Q,Q.type,Q.pendingProps,X);case n:{var{type:K0,pendingProps:e}=Q,T0=Q.elementType===K0?e:Q7(K0,e);return KF(z,Q,K0,T0,X)}case j:return sU(z,Q,X);case g:break;case Q0:return lU(z,Q,X)}throw Error("Unknown unit of work tag ("+Q.tag+"). This error is likely caused by a bug in React. Please file an issue.")}function bz(z){z.flags|=t1}function XW(z){z.flags|=U8,z.flags|=ZY}var ZW,s9,JW,YW;ZW=function(z,Q,X,Z){var J=Q.child;while(J!==null){if(J.tag===A||J.tag===R)XM(z,J.stateNode);else if(J.tag===M);else if(J.child!==null){J.child.return=J,J=J.child;continue}if(J===Q)return;while(J.sibling===null){if(J.return===null||J.return===Q)return;J=J.return}J.sibling.return=J.return,J=J.sibling}},s9=function(z,Q){},JW=function(z,Q,X,Z,J){var $=z.memoizedProps;if($===Z)return;var q=Q.stateNode,U=d$(),L=JM(q,X,$,Z,J,U);if(Q.updateQueue=L,L)bz(Q)},YW=function(z,Q,X,Z){if(X!==Z)bz(Q)};function RX(z,Q){if(S5())return;switch(z.tailMode){case"hidden":{var X=z.tail,Z=null;while(X!==null){if(X.alternate!==null)Z=X;X=X.sibling}if(Z===null)z.tail=null;else Z.sibling=null;break}case"collapsed":{var J=z.tail,$=null;while(J!==null){if(J.alternate!==null)$=J;J=J.sibling}if($===null)if(!Q&&z.tail!==null)z.tail.sibling=null;else z.tail=null;else $.sibling=null;break}}}function h5(z){var Q=z.alternate!==null&&z.alternate.child===z.child,X=b0,Z=w1;if(!Q){if((z.mode&_4)!==O1){var{actualDuration:J,selfBaseDuration:$,child:q}=z;while(q!==null)X=u1(X,u1(q.lanes,q.childLanes)),Z|=q.subtreeFlags,Z|=q.flags,J+=q.actualDuration,$+=q.treeBaseDuration,q=q.sibling;z.actualDuration=J,z.treeBaseDuration=$}else{var U=z.child;while(U!==null)X=u1(X,u1(U.lanes,U.childLanes)),Z|=U.subtreeFlags,Z|=U.flags,U.return=z,U=U.sibling}z.subtreeFlags|=Z}else{if((z.mode&_4)!==O1){var{selfBaseDuration:L,child:P}=z;while(P!==null)X=u1(X,u1(P.lanes,P.childLanes)),Z|=P.subtreeFlags&g7,Z|=P.flags&g7,L+=P.treeBaseDuration,P=P.sibling;z.treeBaseDuration=L}else{var C=z.child;while(C!==null)X=u1(X,u1(C.lanes,C.childLanes)),Z|=C.subtreeFlags&g7,Z|=C.flags&g7,C.return=z,C=C.sibling}z.subtreeFlags|=Z}return z.childLanes=X,Q}function VF(z,Q,X){if(Mw()&&(Q.mode&o1)!==O1&&(Q.flags&J4)===w1)return mB(Q),Uz(),Q.flags|=V7|WQ|Q6,!1;var Z=J3(Q);if(X!==null&&X.dehydrated!==null)if(z===null){if(!Z)throw Error("A dehydrated suspense component was completed without a hydrated node. This is probably a bug in React.");if(Nw(Q),h5(Q),(Q.mode&_4)!==O1){var J=X!==null;if(J){var $=Q.child;if($!==null)Q.treeBaseDuration-=$.treeBaseDuration}}return!1}else{if(Uz(),(Q.flags&J4)===w1)Q.memoizedState=null;if(Q.flags|=t1,h5(Q),(Q.mode&_4)!==O1){var q=X!==null;if(q){var U=Q.child;if(U!==null)Q.treeBaseDuration-=U.treeBaseDuration}}return!1}else return gB(),!0}function $W(z,Q,X){var Z=Q.pendingProps;switch(P$(Q),Q.tag){case F:case D:case E:case W:case f:case k:case S:case l:case V:case m:return h5(Q),null;case O:{var J=Q.type;if(N7(J))sZ(Q);return h5(Q),null}case b:{var $=Q.stateNode;if(_z(Q),M$(Q),r$(),$.pendingContext)$.context=$.pendingContext,$.pendingContext=null;if(z===null||z.child===null){var q=J3(Q);if(q)bz(Q);else if(z!==null){var U=z.memoizedState;if(!U.isDehydrated||(Q.flags&V7)!==w1)Q.flags|=d8,gB()}}return s9(z,Q),h5(Q),null}case A:{i$(Q);var L=sB(),P=Q.type;if(z!==null&&Q.stateNode!=null){if(JW(z,Q,P,Z,L),z.ref!==Q.ref)XW(Q)}else{if(!Z){if(Q.stateNode===null)throw Error("We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.");return h5(Q),null}var C=d$(),i=J3(Q);if(i){if(_w(Q,L,C))bz(Q)}else{var d=QM(P,Z,L,C,Q);if(ZW(d,Q,!1,!1),Q.stateNode=d,ZM(d,P,Z,L))bz(Q)}if(Q.ref!==null)XW(Q)}return h5(Q),null}case R:{var Z0=Z;if(z&&Q.stateNode!=null){var J0=z.memoizedProps;YW(z,Q,J0,Z0)}else{if(typeof Z0!=="string"){if(Q.stateNode===null)throw Error("We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.")}var $0=sB(),p0=d$(),U1=J3(Q);if(U1){if(Lw(Q))bz(Q)}else Q.stateNode=YM(Z0,$0,p0,Q)}return h5(Q),null}case T:{Nz(Q);var X1=Q.memoizedState;if(z===null||z.memoizedState!==null&&z.memoizedState.dehydrated!==null){var j1=VF(z,Q,X1);if(!j1)if(Q.flags&Q6)return Q;else return null}if((Q.flags&J4)!==w1){if(Q.lanes=X,(Q.mode&_4)!==O1)b9(Q);return Q}var l1=X1!==null,s=z!==null&&z.memoizedState!==null;if(l1!==s){if(l1){var K0=Q.child;if(K0.flags|=i8,(Q.mode&o1)!==O1){var e=z===null&&(Q.memoizedProps.unstable_avoidThisFallback!==!0||!Y0);if(e||o$(e6.current,QU))xb();else NH()}}}var T0=Q.updateQueue;if(T0!==null)Q.flags|=t1;if(h5(Q),(Q.mode&_4)!==O1){if(l1){var i0=Q.child;if(i0!==null)Q.treeBaseDuration-=i0.treeBaseDuration}}return null}case M:if(_z(Q),s9(z,Q),z===null)sM(Q.stateNode.containerInfo);return h5(Q),null;case x:var l0=Q.type._context;return g$(l0,Q),h5(Q),null;case n:{var P1=Q.type;if(N7(P1))sZ(Q);return h5(Q),null}case j:{Nz(Q);var f1=Q.memoizedState;if(f1===null)return h5(Q),null;var N4=(Q.flags&J4)!==w1,Q4=f1.rendering;if(Q4===null)if(!N4){var Q5=jb()&&(z===null||(z.flags&J4)===w1);if(!Q5){var X4=Q.child;while(X4!==null){var r4=w3(X4);if(r4!==null){N4=!0,Q.flags|=J4,RX(f1,!1);var i5=r4.updateQueue;if(i5!==null)Q.updateQueue=i5,Q.flags|=t1;return Q.subtreeFlags=w1,Tw(Q,X),I8(Q,a$(e6.current,YX)),Q.child}X4=X4.sibling}}if(f1.tail!==null&&b5()>CW())Q.flags|=J4,N4=!0,RX(f1,!1),Q.lanes=Jq}else RX(f1,!1);else{if(!N4){var g5=w3(Q4);if(g5!==null){Q.flags|=J4,N4=!0;var S6=g5.updateQueue;if(S6!==null)Q.updateQueue=S6,Q.flags|=t1;if(RX(f1,!0),f1.tail===null&&f1.tailMode==="hidden"&&!Q4.alternate&&!S5())return h5(Q),null}else if(b5()*2-f1.renderingStartTime>CW()&&X!==P6)Q.flags|=J4,N4=!0,RX(f1,!1),Q.lanes=Jq}if(f1.isBackwards)Q4.sibling=Q.child,Q.child=Q4;else{var Y6=f1.last;if(Y6!==null)Y6.sibling=Q4;else Q.child=Q4;f1.last=Q4}}if(f1.tail!==null){var $6=f1.tail;f1.rendering=$6,f1.tail=$6.sibling,f1.renderingStartTime=b5(),$6.sibling=null;var o5=e6.current;if(N4)o5=a$(o5,YX);else o5=Lz(o5);return I8(Q,o5),$6}return h5(Q),null}case g:break;case Q0:case r:{LH(Q);var s7=Q.memoizedState,Sz=s7!==null;if(z!==null){var VX=z.memoizedState,I7=VX!==null;if(I7!==Sz&&!a)Q.flags|=i8}if(!Sz||(Q.mode&o1)===O1)h5(Q);else if(A6(A7,P6)){if(h5(Q),Q.subtreeFlags&(J5|t1))Q.flags|=i8}return null}case U0:return null;case R0:return null}throw Error("Unknown unit of work tag ("+Q.tag+"). This error is likely caused by a bug in React. Please file an issue.")}function DF(z,Q,X){switch(P$(Q),Q.tag){case O:{var Z=Q.type;if(N7(Z))sZ(Q);var J=Q.flags;if(J&Q6){if(Q.flags=J&~Q6|J4,(Q.mode&_4)!==O1)b9(Q);return Q}return null}case b:{var $=Q.stateNode;_z(Q),M$(Q),r$();var q=Q.flags;if((q&Q6)!==w1&&(q&J4)===w1)return Q.flags=q&~Q6|J4,Q;return null}case A:return i$(Q),null;case T:{Nz(Q);var U=Q.memoizedState;if(U!==null&&U.dehydrated!==null){if(Q.alternate===null)throw Error("Threw in newly mounted dehydrated component. This is likely a bug in React. Please file an issue.");Uz()}var L=Q.flags;if(L&Q6){if(Q.flags=L&~Q6|J4,(Q.mode&_4)!==O1)b9(Q);return Q}return null}case j:return Nz(Q),null;case M:return _z(Q),null;case x:var P=Q.type._context;return g$(P,Q),null;case Q0:case r:return LH(Q),null;case U0:return null;default:return null}}function HW(z,Q,X){switch(P$(Q),Q.tag){case O:{var Z=Q.type.childContextTypes;if(Z!==null&&Z!==void 0)sZ(Q);break}case b:{var J=Q.stateNode;_z(Q),M$(Q),r$();break}case A:{i$(Q);break}case M:_z(Q);break;case T:Nz(Q);break;case j:Nz(Q);break;case x:var $=Q.type._context;g$($,Q);break;case Q0:case r:LH(Q);break}}var GW=null;GW=new Set;var i3=!1,y5=!1,mF=typeof WeakSet==="function"?WeakSet:Set,t0=null,Pz=null,Az=null;function gF(z){eJ(null,function(){throw z}),zY()}var uF=function(z,Q){if(Q.props=z.memoizedProps,Q.state=z.memoizedState,z.mode&_4)try{b7(),Q.componentWillUnmount()}finally{F7(z)}else Q.componentWillUnmount()};function qW(z,Q){try{C8(q5,z)}catch(X){k4(z,Q,X)}}function e9(z,Q,X){try{uF(z,X)}catch(Z){k4(z,Q,Z)}}function EF(z,Q,X){try{X.componentDidMount()}catch(Z){k4(z,Q,Z)}}function BW(z,Q){try{KW(z)}catch(X){k4(z,Q,X)}}function Iz(z,Q){var X=z.ref;if(X!==null)if(typeof X==="function"){var Z;try{if(v0&&j0&&z.mode&_4)try{b7(),Z=X(null)}finally{F7(z)}else Z=X(null)}catch(J){k4(z,Q,J)}if(typeof Z==="function")G("Unexpected return value from a callback ref in %s. A callback ref should not return a function.",g1(z))}else X.current=null}function o3(z,Q,X){try{X()}catch(Z){k4(z,Q,Z)}}var UW=null,WW=!1;function xF(z,Q){UW=eR(z.containerInfo),t0=Q,pF();var X=WW;return WW=!1,UW=null,X}function pF(){while(t0!==null){var z=t0,Q=z.child;if((z.subtreeFlags&YY)!==w1&&Q!==null)Q.return=z,t0=Q;else jF()}}function jF(){while(t0!==null){var z=t0;l4(z);try{lF(z)}catch(X){k4(z,z.return,X)}F5();var Q=z.sibling;if(Q!==null){Q.return=z.return,t0=Q;return}t0=z.return}}function lF(z){var{alternate:Q,flags:X}=z;if((X&d8)!==w1){switch(l4(z),z.tag){case W:case f:case E:break;case O:{if(Q!==null){var{memoizedProps:Z,memoizedState:J}=Q,$=z.stateNode;if(z.type===z.elementType&&!K2){if($.props!==z.memoizedProps)G("Expected %s props to match memoized props before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.",g1(z)||"instance");if($.state!==z.memoizedState)G("Expected %s state to match memoized state before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.",g1(z)||"instance")}var q=$.getSnapshotBeforeUpdate(z.elementType===z.type?Z:Q7(z.type,Z),J);{var U=GW;if(q===void 0&&!U.has(z.type))U.add(z.type),G("%s.getSnapshotBeforeUpdate(): A snapshot value (or null) must be returned. You have returned undefined.",g1(z))}$.__reactInternalSnapshotBeforeUpdate=q}break}case b:{{var L=z.stateNode;AM(L.containerInfo)}break}case A:case R:case M:case n:break;default:throw Error("This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.")}F5()}}function Z7(z,Q,X){var Z=Q.updateQueue,J=Z!==null?Z.lastEffect:null;if(J!==null){var $=J.next,q=$;do{if((q.tag&z)===z){var U=q.destroy;if(q.destroy=void 0,U!==void 0){if((z&f5)!==K6)YL(Q);else if((z&q5)!==K6)eG(Q);if((z&R7)!==K6)fX(!0);if(o3(Q,X,U),(z&R7)!==K6)fX(!1);if((z&f5)!==K6)$L();else if((z&q5)!==K6)zq()}}q=q.next}while(q!==$)}}function C8(z,Q){var X=Q.updateQueue,Z=X!==null?X.lastEffect:null;if(Z!==null){var J=Z.next,$=J;do{if(($.tag&z)===z){if((z&f5)!==K6)ZL(Q);else if((z&q5)!==K6)HL(Q);var q=$.create;if((z&R7)!==K6)fX(!0);if($.destroy=q(),(z&R7)!==K6)fX(!1);if((z&f5)!==K6)JL();else if((z&q5)!==K6)GL();{var U=$.destroy;if(U!==void 0&&typeof U!=="function"){var L=void 0;if(($.tag&q5)!==w1)L="useLayoutEffect";else if(($.tag&R7)!==w1)L="useInsertionEffect";else L="useEffect";var P=void 0;if(U===null)P=" You returned null. If your effect does not require clean up, return undefined (or nothing).";else if(typeof U.then==="function")P=`
|
|
103
|
+
|
|
104
|
+
It looks like you wrote `+L+`(async () => ...) or returned a Promise. Instead, write the async function inside your effect and call it immediately:
|
|
105
|
+
|
|
106
|
+
`+L+`(() => {
|
|
107
|
+
async function fetchData() {
|
|
108
|
+
// You can await here
|
|
109
|
+
const response = await MyAPI.getData(someId);
|
|
110
|
+
// ...
|
|
111
|
+
}
|
|
112
|
+
fetchData();
|
|
113
|
+
}, [someId]); // Or [] if effect doesn't need props or state
|
|
114
|
+
|
|
115
|
+
Learn more about data fetching with Hooks: https://reactjs.org/link/hooks-data-fetching`;else P=" You returned: "+U;G("%s must not return anything besides a function, which is used for clean-up.%s",L,P)}}}$=$.next}while($!==J)}}function cF(z,Q){if((Q.flags&t1)!==w1)switch(Q.tag){case l:{var X=Q.stateNode.passiveEffectDuration,Z=Q.memoizedProps,J=Z.id,$=Z.onPostCommit,q=kU(),U=Q.alternate===null?"mount":"update";if(TU())U="nested-update";if(typeof $==="function")$(J,U,X,q);var L=Q.return;z:while(L!==null){switch(L.tag){case b:var P=L.stateNode;P.passiveEffectDuration+=X;break z;case l:var C=L.stateNode;C.passiveEffectDuration+=X;break z}L=L.return}break}}}function dF(z,Q,X,Z){if((X.flags&KQ)!==w1)switch(X.tag){case W:case f:case E:{if(!y5)if(X.mode&_4)try{b7(),C8(q5|G5,X)}finally{F7(X)}else C8(q5|G5,X);break}case O:{var J=X.stateNode;if(X.flags&t1){if(!y5)if(Q===null){if(X.type===X.elementType&&!K2){if(J.props!==X.memoizedProps)G("Expected %s props to match memoized props before componentDidMount. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.",g1(X)||"instance");if(J.state!==X.memoizedState)G("Expected %s state to match memoized state before componentDidMount. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.",g1(X)||"instance")}if(X.mode&_4)try{b7(),J.componentDidMount()}finally{F7(X)}else J.componentDidMount()}else{var $=X.elementType===X.type?Q.memoizedProps:Q7(X.type,Q.memoizedProps),q=Q.memoizedState;if(X.type===X.elementType&&!K2){if(J.props!==X.memoizedProps)G("Expected %s props to match memoized props before componentDidUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.",g1(X)||"instance");if(J.state!==X.memoizedState)G("Expected %s state to match memoized state before componentDidUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.",g1(X)||"instance")}if(X.mode&_4)try{b7(),J.componentDidUpdate($,q,J.__reactInternalSnapshotBeforeUpdate)}finally{F7(X)}else J.componentDidUpdate($,q,J.__reactInternalSnapshotBeforeUpdate)}}var U=X.updateQueue;if(U!==null){if(X.type===X.elementType&&!K2){if(J.props!==X.memoizedProps)G("Expected %s props to match memoized props before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.",g1(X)||"instance");if(J.state!==X.memoizedState)G("Expected %s state to match memoized state before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.",g1(X)||"instance")}tB(X,U,J)}break}case b:{var L=X.updateQueue;if(L!==null){var P=null;if(X.child!==null)switch(X.child.tag){case A:P=G$(X.child.stateNode);break;case O:P=X.child.stateNode;break}tB(X,L,P)}break}case A:{var C=X.stateNode;if(Q===null&&X.flags&t1){var{type:i,memoizedProps:d}=X;BM(C,i,d)}break}case R:break;case M:break;case l:{{var Z0=X.memoizedProps,J0=Z0.onCommit,$0=Z0.onRender,p0=X.stateNode.effectDuration,U1=kU(),X1=Q===null?"mount":"update";if(TU())X1="nested-update";if(typeof $0==="function")$0(X.memoizedProps.id,X1,X.actualDuration,X.treeBaseDuration,X.actualStartTime,U1);{if(typeof J0==="function")J0(X.memoizedProps.id,X1,p0,U1);ob(X);var j1=X.return;z:while(j1!==null){switch(j1.tag){case b:var l1=j1.stateNode;l1.effectDuration+=p0;break z;case l:var s=j1.stateNode;s.effectDuration+=p0;break z}j1=j1.return}}}break}case T:{eF(z,X);break}case j:case n:case g:case Q0:case r:case R0:break;default:throw Error("This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.")}if(!y5){if(X.flags&U8)KW(X)}}function iF(z){switch(z.tag){case W:case f:case E:{if(z.mode&_4)try{b7(),qW(z,z.return)}finally{F7(z)}else qW(z,z.return);break}case O:{var Q=z.stateNode;if(typeof Q.componentDidMount==="function")EF(z,z.return,Q);BW(z,z.return);break}case A:{BW(z,z.return);break}}}function oF(z,Q){var X=null;{var Z=z;while(!0){if(Z.tag===A){if(X===null){X=Z;try{var J=Z.stateNode;if(Q)wM(J);else bM(Z.stateNode,Z.memoizedProps)}catch(q){k4(z,z.return,q)}}}else if(Z.tag===R){if(X===null)try{var $=Z.stateNode;if(Q)FM($);else PM($,Z.memoizedProps)}catch(q){k4(z,z.return,q)}}else if((Z.tag===Q0||Z.tag===r)&&Z.memoizedState!==null&&Z!==z);else if(Z.child!==null){Z.child.return=Z,Z=Z.child;continue}if(Z===z)return;while(Z.sibling===null){if(Z.return===null||Z.return===z)return;if(X===Z)X=null;Z=Z.return}if(X===Z)X=null;Z.sibling.return=Z.return,Z=Z.sibling}}}function KW(z){var Q=z.ref;if(Q!==null){var X=z.stateNode,Z;switch(z.tag){case A:Z=G$(X);break;default:Z=X}if(typeof Q==="function"){var J;if(z.mode&_4)try{b7(),J=Q(Z)}finally{F7(z)}else J=Q(Z);if(typeof J==="function")G("Unexpected return value from a callback ref in %s. A callback ref should not return a function.",g1(z))}else{if(!Q.hasOwnProperty("current"))G("Unexpected ref object provided for %s. Use either a ref-setter function or React.createRef().",g1(z));Q.current=Z}}}function aF(z){var Q=z.alternate;if(Q!==null)Q.return=null;z.return=null}function OW(z){var Q=z.alternate;if(Q!==null)z.alternate=null,OW(Q);{if(z.child=null,z.deletions=null,z.sibling=null,z.tag===A){var X=z.stateNode;if(X!==null)Qw(X)}z.stateNode=null,z._debugOwner=null,z.return=null,z.dependencies=null,z.memoizedProps=null,z.memoizedState=null,z.pendingProps=null,z.stateNode=null,z.updateQueue=null}}function nF(z){var Q=z.return;while(Q!==null){if(_W(Q))return Q;Q=Q.return}throw Error("Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.")}function _W(z){return z.tag===A||z.tag===b||z.tag===M}function LW(z){var Q=z;z:while(!0){while(Q.sibling===null){if(Q.return===null||_W(Q.return))return null;Q=Q.return}Q.sibling.return=Q.return,Q=Q.sibling;while(Q.tag!==A&&Q.tag!==R&&Q.tag!==c){if(Q.flags&J5)continue z;if(Q.child===null||Q.tag===M)continue z;else Q.child.return=Q,Q=Q.child}if(!(Q.flags&J5))return Q.stateNode}}function rF(z){var Q=nF(z);switch(Q.tag){case A:{var X=Q.stateNode;if(Q.flags&UQ)LB(X),Q.flags&=~UQ;var Z=LW(z);QH(z,Z,X);break}case b:case M:{var J=Q.stateNode.containerInfo,$=LW(z);zH(z,$,J);break}default:throw Error("Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue.")}}function zH(z,Q,X){var Z=z.tag,J=Z===A||Z===R;if(J){var $=z.stateNode;if(Q)LM(X,$,Q);else OM(X,$)}else if(Z===M);else{var q=z.child;if(q!==null){zH(q,Q,X);var U=q.sibling;while(U!==null)zH(U,Q,X),U=U.sibling}}}function QH(z,Q,X){var Z=z.tag,J=Z===A||Z===R;if(J){var $=z.stateNode;if(Q)_M(X,$,Q);else KM(X,$)}else if(Z===M);else{var q=z.child;if(q!==null){QH(q,Q,X);var U=q.sibling;while(U!==null)QH(U,Q,X),U=U.sibling}}}var V5=null,J7=!1;function tF(z,Q,X){{var Z=Q;z:while(Z!==null){switch(Z.tag){case A:{V5=Z.stateNode,J7=!1;break z}case b:{V5=Z.stateNode.containerInfo,J7=!0;break z}case M:{V5=Z.stateNode.containerInfo,J7=!0;break z}}Z=Z.return}if(V5===null)throw Error("Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.");NW(z,Q,X),V5=null,J7=!1}aF(X)}function v8(z,Q,X){var Z=X.child;while(Z!==null)NW(z,Q,Z),Z=Z.sibling}function NW(z,Q,X){switch(e_(X),X.tag){case A:if(!y5)Iz(X,Q);case R:{{var Z=V5,J=J7;if(V5=null,v8(z,Q,X),V5=Z,J7=J,V5!==null)if(J7)RM(V5,X.stateNode);else NM(V5,X.stateNode)}return}case c:{if(V5!==null)if(J7)MM(V5,X.stateNode);else W$(V5,X.stateNode);return}case M:{{var $=V5,q=J7;V5=X.stateNode.containerInfo,J7=!0,v8(z,Q,X),V5=$,J7=q}return}case W:case f:case m:case E:{if(!y5){var U=X.updateQueue;if(U!==null){var L=U.lastEffect;if(L!==null){var P=L.next,C=P;do{var i=C,d=i.destroy,Z0=i.tag;if(d!==void 0){if((Z0&R7)!==K6)o3(X,Q,d);else if((Z0&q5)!==K6){if(eG(X),X.mode&_4)b7(),o3(X,Q,d),F7(X);else o3(X,Q,d);zq()}}C=C.next}while(C!==P)}}}v8(z,Q,X);return}case O:{if(!y5){Iz(X,Q);var J0=X.stateNode;if(typeof J0.componentWillUnmount==="function")e9(X,Q,J0)}v8(z,Q,X);return}case g:{v8(z,Q,X);return}case Q0:{if(X.mode&o1){var $0=y5;y5=$0||X.memoizedState!==null,v8(z,Q,X),y5=$0}else v8(z,Q,X);break}default:{v8(z,Q,X);return}}}function sF(z){var Q=z.memoizedState}function eF(z,Q){var X=Q.memoizedState;if(X===null){var Z=Q.alternate;if(Z!==null){var J=Z.memoizedState;if(J!==null){var $=J.dehydrated;if($!==null)uM($)}}}}function RW(z){var Q=z.updateQueue;if(Q!==null){z.updateQueue=null;var X=z.stateNode;if(X===null)X=z.stateNode=new mF;Q.forEach(function(Z){var J=zP.bind(null,z,Z);if(!X.has(Z)){if(X.add(Z),a6)if(Pz!==null&&Az!==null)SX(Az,Pz);else throw Error("Expected finished root and lanes to be set. This is a bug in React.");Z.then(J,J)}})}}function zb(z,Q,X){Pz=X,Az=z,l4(Q),MW(Q,z),l4(Q),Pz=null,Az=null}function Y7(z,Q,X){var Z=Q.deletions;if(Z!==null)for(var J=0;J<Z.length;J++){var $=Z[J];try{tF(z,Q,$)}catch(L){k4($,Q,L)}}var q=zZ();if(Q.subtreeFlags&$Y){var U=Q.child;while(U!==null)l4(U),MW(U,z),U=U.sibling}l4(q)}function MW(z,Q,X){var{alternate:Z,flags:J}=z;switch(z.tag){case W:case f:case m:case E:{if(Y7(Q,z),P7(z),J&t1){try{Z7(R7|G5,z,z.return),C8(R7|G5,z)}catch(P1){k4(z,z.return,P1)}if(z.mode&_4){try{b7(),Z7(q5|G5,z,z.return)}catch(P1){k4(z,z.return,P1)}F7(z)}else try{Z7(q5|G5,z,z.return)}catch(P1){k4(z,z.return,P1)}}return}case O:{if(Y7(Q,z),P7(z),J&U8){if(Z!==null)Iz(Z,Z.return)}return}case A:{if(Y7(Q,z),P7(z),J&U8){if(Z!==null)Iz(Z,Z.return)}{if(z.flags&UQ){var $=z.stateNode;try{LB($)}catch(P1){k4(z,z.return,P1)}}if(J&t1){var q=z.stateNode;if(q!=null){var U=z.memoizedProps,L=Z!==null?Z.memoizedProps:U,P=z.type,C=z.updateQueue;if(z.updateQueue=null,C!==null)try{UM(q,C,P,L,U,z)}catch(P1){k4(z,z.return,P1)}}}}return}case R:{if(Y7(Q,z),P7(z),J&t1){if(z.stateNode===null)throw Error("This should have a text node initialized. This error is likely caused by a bug in React. Please file an issue.");var{stateNode:i,memoizedProps:d}=z,Z0=Z!==null?Z.memoizedProps:d;try{WM(i,Z0,d)}catch(P1){k4(z,z.return,P1)}}return}case b:{if(Y7(Q,z),P7(z),J&t1){if(Z!==null){var J0=Z.memoizedState;if(J0.isDehydrated)try{gM(Q.containerInfo)}catch(P1){k4(z,z.return,P1)}}}return}case M:{Y7(Q,z),P7(z);return}case T:{Y7(Q,z),P7(z);var $0=z.child;if($0.flags&i8){var{stateNode:p0,memoizedState:U1}=$0,X1=U1!==null;if(p0.isHidden=X1,X1){var j1=$0.alternate!==null&&$0.alternate.memoizedState!==null;if(!j1)Eb()}}if(J&t1){try{sF(z)}catch(P1){k4(z,z.return,P1)}RW(z)}return}case Q0:{var l1=Z!==null&&Z.memoizedState!==null;if(z.mode&o1){var s=y5;y5=s||l1,Y7(Q,z),y5=s}else Y7(Q,z);if(P7(z),J&i8){var{stateNode:K0,memoizedState:e}=z,T0=e!==null,i0=z;if(K0.isHidden=T0,T0){if(!l1){if((i0.mode&o1)!==O1){t0=i0;var l0=i0.child;while(l0!==null)t0=l0,Xb(l0),l0=l0.sibling}}}oF(i0,T0)}return}case j:{if(Y7(Q,z),P7(z),J&t1)RW(z);return}case g:return;default:{Y7(Q,z),P7(z);return}}}function P7(z){var Q=z.flags;if(Q&J5){try{rF(z)}catch(X){k4(z,z.return,X)}z.flags&=~J5}if(Q&D7)z.flags&=~D7}function Qb(z,Q,X){Pz=X,Az=Q,t0=z,wW(z,Q,X),Pz=null,Az=null}function wW(z,Q,X){var Z=(z.mode&o1)!==O1;while(t0!==null){var J=t0,$=J.child;if(J.tag===Q0&&Z){var q=J.memoizedState!==null,U=q||i3;if(U){XH(z,Q,X);continue}else{var L=J.alternate,P=L!==null&&L.memoizedState!==null,C=P||y5,i=i3,d=y5;if(i3=U,y5=C,y5&&!d)t0=J,Zb(J);var Z0=$;while(Z0!==null)t0=Z0,wW(Z0,Q,X),Z0=Z0.sibling;t0=J,i3=i,y5=d,XH(z,Q,X);continue}}if((J.subtreeFlags&KQ)!==w1&&$!==null)$.return=J,t0=$;else XH(z,Q,X)}}function XH(z,Q,X){while(t0!==null){var Z=t0;if((Z.flags&KQ)!==w1){var J=Z.alternate;l4(Z);try{dF(Q,J,Z,X)}catch(q){k4(Z,Z.return,q)}F5()}if(Z===z){t0=null;return}var $=Z.sibling;if($!==null){$.return=Z.return,t0=$;return}t0=Z.return}}function Xb(z){while(t0!==null){var Q=t0,X=Q.child;switch(Q.tag){case W:case f:case m:case E:{if(Q.mode&_4)try{b7(),Z7(q5,Q,Q.return)}finally{F7(Q)}else Z7(q5,Q,Q.return);break}case O:{Iz(Q,Q.return);var Z=Q.stateNode;if(typeof Z.componentWillUnmount==="function")e9(Q,Q.return,Z);break}case A:{Iz(Q,Q.return);break}case Q0:{var J=Q.memoizedState!==null;if(J){FW(z);continue}break}}if(X!==null)X.return=Q,t0=X;else FW(z)}}function FW(z){while(t0!==null){var Q=t0;if(Q===z){t0=null;return}var X=Q.sibling;if(X!==null){X.return=Q.return,t0=X;return}t0=Q.return}}function Zb(z){while(t0!==null){var Q=t0,X=Q.child;if(Q.tag===Q0){var Z=Q.memoizedState!==null;if(Z){bW(z);continue}}if(X!==null)X.return=Q,t0=X;else bW(z)}}function bW(z){while(t0!==null){var Q=t0;l4(Q);try{iF(Q)}catch(Z){k4(Q,Q.return,Z)}if(F5(),Q===z){t0=null;return}var X=Q.sibling;if(X!==null){X.return=Q.return,t0=X;return}t0=Q.return}}function Jb(z,Q,X,Z){t0=Q,Yb(Q,z,X,Z)}function Yb(z,Q,X,Z){while(t0!==null){var J=t0,$=J.child;if((J.subtreeFlags&i2)!==w1&&$!==null)$.return=J,t0=$;else $b(z,Q,X,Z)}}function $b(z,Q,X,Z){while(t0!==null){var J=t0;if((J.flags&o6)!==w1){l4(J);try{Hb(Q,J,X,Z)}catch(q){k4(J,J.return,q)}F5()}if(J===z){t0=null;return}var $=J.sibling;if($!==null){$.return=J.return,t0=$;return}t0=J.return}}function Hb(z,Q,X,Z){switch(Q.tag){case W:case f:case E:{if(Q.mode&_4){F9();try{C8(f5|G5,Q)}finally{w9(Q)}}else C8(f5|G5,Q);break}}}function Gb(z){t0=z,qb()}function qb(){while(t0!==null){var z=t0,Q=z.child;if((t0.flags&c8)!==w1){var X=z.deletions;if(X!==null){for(var Z=0;Z<X.length;Z++){var J=X[Z];t0=J,Wb(J,z)}{var $=z.alternate;if($!==null){var q=$.child;if(q!==null){$.child=null;do{var U=q.sibling;q.sibling=null,q=U}while(q!==null)}}}t0=z}}if((z.subtreeFlags&i2)!==w1&&Q!==null)Q.return=z,t0=Q;else Bb()}}function Bb(){while(t0!==null){var z=t0;if((z.flags&o6)!==w1)l4(z),Ub(z),F5();var Q=z.sibling;if(Q!==null){Q.return=z.return,t0=Q;return}t0=z.return}}function Ub(z){switch(z.tag){case W:case f:case E:{if(z.mode&_4)F9(),Z7(f5|G5,z,z.return),w9(z);else Z7(f5|G5,z,z.return);break}}}function Wb(z,Q){while(t0!==null){var X=t0;l4(X),Ob(X,Q),F5();var Z=X.child;if(Z!==null)Z.return=X,t0=Z;else Kb(z)}}function Kb(z){while(t0!==null){var Q=t0,X=Q.sibling,Z=Q.return;if(OW(Q),Q===z){t0=null;return}if(X!==null){X.return=Z,t0=X;return}t0=Z}}function Ob(z,Q){switch(z.tag){case W:case f:case E:{if(z.mode&_4)F9(),Z7(f5,z,Q),w9(z);else Z7(f5,z,Q);break}}}function _b(z){switch(z.tag){case W:case f:case E:{try{C8(q5|G5,z)}catch(X){k4(z,z.return,X)}break}case O:{var Q=z.stateNode;try{Q.componentDidMount()}catch(X){k4(z,z.return,X)}break}}}function Lb(z){switch(z.tag){case W:case f:case E:{try{C8(f5|G5,z)}catch(Q){k4(z,z.return,Q)}break}}}function Nb(z){switch(z.tag){case W:case f:case E:{try{Z7(q5|G5,z,z.return)}catch(X){k4(z,z.return,X)}break}case O:{var Q=z.stateNode;if(typeof Q.componentWillUnmount==="function")e9(z,z.return,Q);break}}}function Rb(z){switch(z.tag){case W:case f:case E:try{Z7(f5|G5,z,z.return)}catch(Q){k4(z,z.return,Q)}}}var Mb=0,wb=1,Fb=2,bb=3,Pb=4;if(typeof Symbol==="function"&&Symbol.for){var MX=Symbol.for;Mb=MX("selector.component"),wb=MX("selector.has_pseudo_class"),Fb=MX("selector.role"),bb=MX("selector.test_id"),Pb=MX("selector.text")}var Ab=[];function Ib(){Ab.forEach(function(z){return z()})}var Tb=Y.ReactCurrentActQueue;function kb(z){{var Q=typeof IS_REACT_ACT_ENVIRONMENT<"u"?IS_REACT_ACT_ENVIRONMENT:void 0,X=typeof jest<"u";return X&&Q!==!1}}function PW(){{var z=typeof IS_REACT_ACT_ENVIRONMENT<"u"?IS_REACT_ACT_ENVIRONMENT:void 0;if(!z&&Tb.current!==null)G("The current testing environment is not configured to support act(...)");return z}}var Cb=Math.ceil,ZH=Y.ReactCurrentDispatcher,JH=Y.ReactCurrentOwner,D5=Y.ReactCurrentBatchConfig,$7=Y.ReactCurrentActQueue,W5=0,AW=1,m5=2,x6=4,a7=0,wX=1,O2=2,a3=3,FX=4,IW=5,YH=6,a1=W5,Z6=null,c4=null,K5=b0,A7=b0,$H=M8(b0),O5=a7,bX=null,HH=b0,n3=b0,PX=b0,r3=b0,AX=null,O6=null,GH=0,TW=500,kW=1/0,vb=500,n7=null;function IX(){kW=b5()+vb}function CW(){return kW}var t3=!1,qH=null,Tz=null,_2=!1,S8=null,TX=b0,BH=[],UH=null,Sb=50,kX=0,WH=null,KH=!1,s3=!1,fb=50,kz=0,e3=null,CX=V4,zJ=b0,vW=!1;function QJ(){return Z6}function J6(){if((a1&(m5|x6))!==W5)return b5();if(CX!==V4)return CX;return CX=b5(),CX}function f8(z){var Q=z.mode;if((Q&o1)===O1)return k1;else if((a1&m5)!==W5&&K5!==b0)return wQ(K5);var X=bw()!==Fw;if(X){if(D5.transition!==null){var Z=D5.transition;if(!Z._updatedFibers)Z._updatedFibers=new Set;Z._updatedFibers.add(z)}if(zJ===A5)zJ=Gq();return zJ}var J=n6();if(J!==A5)return J;var $=$M();return $}function hb(z){var Q=z.mode;if((Q&o1)===O1)return k1;return SL()}function _5(z,Q,X,Z){if(XP(),vW)G("useInsertionEffect must not schedule updates.");if(KH)s3=!0;if(FQ(z,X,Z),(a1&m5)!==b0&&z===Z6)YP(Q);else{if(a6)Uq(z,Q,X);if($P(Q),z===Z6){if((a1&m5)===W5)PX=u1(PX,X);if(O5===FX)h8(z,K5)}if(_6(z,Z),X===k1&&a1===W5&&(Q.mode&o1)===O1&&!$7.isBatchingLegacy)IX(),CB()}}function yb(z,Q,X){var Z=z.current;Z.lanes=Q,FQ(z,Q,X),_6(z,X)}function Vb(z){return(a1&m5)!==W5}function _6(z,Q){var X=z.callbackNode;AL(z,Q);var Z=MZ(z,z===Z6?K5:b0);if(Z===b0){if(X!==null)dW(X);z.callbackNode=null,z.callbackPriority=A5;return}var J=e8(Z),$=z.callbackPriority;if($===J&&!($7.current!==null&&X!==wH)){if(X==null&&$!==k1)G("Expected scheduled callback to exist. This error is likely caused by a bug in React. Please file an issue.");return}if(X!=null)dW(X);var q;if(J===k1){if(z.tag===w8){if($7.isBatchingLegacy!==null)$7.didScheduleLegacyUpdate=!0;Jw(hW.bind(null,z))}else kB(hW.bind(null,z));if($7.current!==null)$7.current.push(F8);else GM(function(){if((a1&(m5|x6))===W5)F8()});q=null}else{var U;switch(Oq(Z)){case I6:U=_Z;break;case E7:U=HY;break;case x7:U=n8;break;case PZ:U=GY;break;default:U=n8;break}q=FH(U,SW.bind(null,z))}z.callbackPriority=J,z.callbackNode=q}function SW(z,Q){if(ow(),CX=V4,zJ=b0,(a1&(m5|x6))!==W5)throw Error("Should not already be working.");var X=z.callbackNode,Z=t7();if(Z){if(z.callbackNode!==X)return null}var J=MZ(z,z===Z6?K5:b0);if(J===b0)return null;var $=!wZ(z,J)&&!vL(z,J)&&!Q,q=$?cb(z,J):ZJ(z,J);if(q!==a7){if(q===O2){var U=SY(z);if(U!==b0)J=U,q=OH(z,U)}if(q===wX){var L=bX;throw L2(z,b0),h8(z,J),_6(z,b5()),L}if(q===YH)h8(z,J);else{var P=!wZ(z,J),C=z.current.alternate;if(P&&!mb(C)){if(q=ZJ(z,J),q===O2){var i=SY(z);if(i!==b0)J=i,q=OH(z,i)}if(q===wX){var d=bX;throw L2(z,b0),h8(z,J),_6(z,b5()),d}}z.finishedWork=C,z.finishedLanes=J,Db(z,q,J)}}if(_6(z,b5()),z.callbackNode===X)return SW.bind(null,z);return null}function OH(z,Q){var X=AX;if(AZ(z)){var Z=L2(z,Q);Z.flags|=V7,tM(z.containerInfo)}var J=ZJ(z,Q);if(J!==O2){var $=O6;if(O6=X,$!==null)fW($)}return J}function fW(z){if(O6===null)O6=z;else O6.push.apply(O6,z)}function Db(z,Q,X){switch(Q){case a7:case wX:throw Error("Root did not complete. This is a bug in React.");case O2:{N2(z,O6,n7);break}case a3:{if(h8(z,X),$q(X)&&!iW()){var Z=GH+TW-b5();if(Z>10){var J=MZ(z,b0);if(J!==b0)break;var $=z.suspendedLanes;if(!t2($,X)){var q=J6();Bq(z,$);break}z.timeoutHandle=B$(N2.bind(null,z,O6,n7),Z);break}}N2(z,O6,n7);break}case FX:{if(h8(z,X),CL(X))break;if(!iW()){var U=bL(z,X),L=U,P=b5()-L,C=QP(P)-P;if(C>10){z.timeoutHandle=B$(N2.bind(null,z,O6,n7),C);break}}N2(z,O6,n7);break}case IW:{N2(z,O6,n7);break}default:throw Error("Unknown root exit status.")}}function mb(z){var Q=z;while(!0){if(Q.flags&KZ){var X=Q.updateQueue;if(X!==null){var Z=X.stores;if(Z!==null)for(var J=0;J<Z.length;J++){var $=Z[J],q=$.getSnapshot,U=$.value;try{if(!k6(q(),U))return!1}catch(P){return!1}}}}var L=Q.child;if(Q.subtreeFlags&KZ&&L!==null){L.return=Q,Q=L;continue}if(Q===z)return!0;while(Q.sibling===null){if(Q.return===null||Q.return===z)return!0;Q=Q.return}Q.sibling.return=Q.return,Q=Q.sibling}return!0}function h8(z,Q){Q=FZ(Q,r3),Q=FZ(Q,PX),hL(z,Q)}function hW(z){if(aw(),(a1&(m5|x6))!==W5)throw Error("Should not already be working.");t7();var Q=MZ(z,b0);if(!A6(Q,k1))return _6(z,b5()),null;var X=ZJ(z,Q);if(z.tag!==w8&&X===O2){var Z=SY(z);if(Z!==b0)Q=Z,X=OH(z,Z)}if(X===wX){var J=bX;throw L2(z,b0),h8(z,Q),_6(z,b5()),J}if(X===YH)throw Error("Root did not complete. This is a bug in React.");var $=z.current.alternate;return z.finishedWork=$,z.finishedLanes=Q,N2(z,O6,n7),_6(z,b5()),null}function gb(z,Q){if(Q!==b0){if(VY(z,u1(Q,k1)),_6(z,b5()),(a1&(m5|x6))===W5)IX(),F8()}}function _H(z,Q){var X=a1;a1|=AW;try{return z(Q)}finally{if(a1=X,a1===W5&&!$7.isBatchingLegacy)IX(),CB()}}function ub(z,Q,X,Z,J){var $=n6(),q=D5.transition;try{return D5.transition=null,I5(I6),z(Q,X,Z,J)}finally{if(I5($),D5.transition=q,a1===W5)IX()}}function r7(z){if(S8!==null&&S8.tag===w8&&(a1&(m5|x6))===W5)t7();var Q=a1;a1|=AW;var X=D5.transition,Z=n6();try{if(D5.transition=null,I5(I6),z)return z();else return}finally{if(I5(Z),D5.transition=X,a1=Q,(a1&(m5|x6))===W5)F8()}}function yW(){return(a1&(m5|x6))!==W5}function XJ(z,Q){c5($H,A7,z),A7=u1(A7,Q),HH=u1(HH,Q)}function LH(z){A7=$H.current,l5($H,z)}function L2(z,Q){z.finishedWork=null,z.finishedLanes=b0;var X=z.timeoutHandle;if(X!==U$)z.timeoutHandle=U$,HM(X);if(c4!==null){var Z=c4.return;while(Z!==null){var J=Z.alternate;HW(J,Z),Z=Z.return}}Z6=z;var $=R2(z.current,null);return c4=$,K5=A7=HH=Q,O5=a7,bX=null,n3=b0,PX=b0,r3=b0,AX=null,O6=null,vw(),s6.discardPendingWarnings(),$}function VW(z,Q){do{var X=c4;try{if(B3(),ZU(),F5(),JH.current=null,X===null||X.return===null){O5=wX,bX=Q,c4=null;return}if(v0&&X.mode&_4)p3(X,!0);if(z0)if(o2(),Q!==null&&typeof Q==="object"&&typeof Q.then==="function"){var Z=Q;BL(X,Z,K5)}else qL(X,Q,K5);ZF(z,X.return,X,Q,K5),uW(X)}catch(J){if(Q=J,c4===X&&X!==null)X=X.return,c4=X;else X=c4;continue}return}while(!0)}function DW(){var z=ZH.current;if(ZH.current=m3,z===null)return m3;else return z}function mW(z){ZH.current=z}function Eb(){GH=b5()}function vX(z){n3=u1(z,n3)}function xb(){if(O5===a7)O5=a3}function NH(){if(O5===a7||O5===a3||O5===O2)O5=FX;if(Z6!==null&&(fY(n3)||fY(PX)))h8(Z6,K5)}function pb(z){if(O5!==FX)O5=O2;if(AX===null)AX=[z];else AX.push(z)}function jb(){return O5===a7}function ZJ(z,Q){var X=a1;a1|=m5;var Z=DW();if(Z6!==z||K5!==Q){if(a6){var J=z.memoizedUpdaters;if(J.size>0)SX(z,K5),J.clear();Wq(z,Q)}n7=Kq(),L2(z,Q)}Qq(Q);do try{lb();break}catch($){VW(z,$)}while(!0);if(B3(),a1=X,mW(Z),c4!==null)throw Error("Cannot commit an incomplete root. This error is likely caused by a bug in React. Please file an issue.");return Xq(),Z6=null,K5=b0,O5}function lb(){while(c4!==null)gW(c4)}function cb(z,Q){var X=a1;a1|=m5;var Z=DW();if(Z6!==z||K5!==Q){if(a6){var J=z.memoizedUpdaters;if(J.size>0)SX(z,K5),J.clear();Wq(z,Q)}n7=Kq(),IX(),L2(z,Q)}Qq(Q);do try{db();break}catch($){VW(z,$)}while(!0);if(B3(),mW(Z),a1=X,c4!==null)return _L(),a7;else return Xq(),Z6=null,K5=b0,O5}function db(){while(c4!==null&&!l_())gW(c4)}function gW(z){var Q=z.alternate;l4(z);var X;if((z.mode&_4)!==O1)M9(z),X=RH(Q,z,A7),p3(z,!0);else X=RH(Q,z,A7);if(F5(),z.memoizedProps=z.pendingProps,X===null)uW(z);else c4=X;JH.current=null}function uW(z){var Q=z;do{var{alternate:X,return:Z}=Q;if((Q.flags&WQ)===w1){l4(Q);var J=void 0;if((Q.mode&_4)===O1)J=$W(X,Q,A7);else M9(Q),J=$W(X,Q,A7),p3(Q,!1);if(F5(),J!==null){c4=J;return}}else{var $=DF(X,Q);if($!==null){$.flags&=g_,c4=$;return}if((Q.mode&_4)!==O1){p3(Q,!1);var{actualDuration:q,child:U}=Q;while(U!==null)q+=U.actualDuration,U=U.sibling;Q.actualDuration=q}if(Z!==null)Z.flags|=WQ,Z.subtreeFlags=w1,Z.deletions=null;else{O5=YH,c4=null;return}}var L=Q.sibling;if(L!==null){c4=L;return}Q=Z,c4=Q}while(Q!==null);if(O5===a7)O5=IW}function N2(z,Q,X){var Z=n6(),J=D5.transition;try{D5.transition=null,I5(I6),ib(z,Q,X,Z)}finally{D5.transition=J,I5(Z)}return null}function ib(z,Q,X,Z){do t7();while(S8!==null);if(ZP(),(a1&(m5|x6))!==W5)throw Error("Should not already be working.");var{finishedWork:J,finishedLanes:$}=z;if(XL($),J===null)return sG(),null;else if($===b0)G("root.finishedLanes should not be empty during a commit. This is a bug in React.");if(z.finishedWork=null,z.finishedLanes=b0,J===z.current)throw Error("Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue.");z.callbackNode=null,z.callbackPriority=A5;var q=u1(J.lanes,J.childLanes);if(yL(z,q),z===Z6)Z6=null,c4=null,K5=b0;if((J.subtreeFlags&i2)!==w1||(J.flags&i2)!==w1){if(!_2)_2=!0,UH=X,FH(n8,function(){return t7(),null})}var U=(J.subtreeFlags&(YY|$Y|KQ|i2))!==w1,L=(J.flags&(YY|$Y|KQ|i2))!==w1;if(U||L){var P=D5.transition;D5.transition=null;var C=n6();I5(I6);var i=a1;a1|=x6,JH.current=null;var d=xF(z,J);CU(),zb(z,J,$),zM(z.containerInfo),z.current=J,UL($),Qb(J,z,$),WL(),c_(),a1=i,I5(C),D5.transition=P}else z.current=J,CU();var Z0=_2;if(_2)_2=!1,S8=z,TX=$;else kz=0,e3=null;if(q=z.pendingLanes,q===b0)Tz=null;if(!Z0)jW(z.current,!1);if(t_(J.stateNode,Z),a6)z.memoizedUpdaters.clear();if(Ib(),_6(z,b5()),Q!==null){var J0=z.onRecoverableError;for(var $0=0;$0<Q.length;$0++){var p0=Q[$0],U1=p0.stack,X1=p0.digest;J0(p0.value,{componentStack:U1,digest:X1})}}if(t3){t3=!1;var j1=qH;throw qH=null,j1}if(A6(TX,k1)&&z.tag!==w8)t7();if(q=z.pendingLanes,A6(q,k1))if(iw(),z===WH)kX++;else kX=0,WH=z;else kX=0;return F8(),sG(),null}function t7(){if(S8!==null){var z=Oq(TX),Q=gL(x7,z),X=D5.transition,Z=n6();try{return D5.transition=null,I5(Q),ab()}finally{I5(Z),D5.transition=X}}return!1}function ob(z){if(BH.push(z),!_2)_2=!0,FH(n8,function(){return t7(),null})}function ab(){if(S8===null)return!1;var z=UH;UH=null;var Q=S8,X=TX;if(S8=null,TX=b0,(a1&(m5|x6))!==W5)throw Error("Cannot flush passive effects while already rendering.");KH=!0,s3=!1,KL(X);var Z=a1;a1|=x6,Gb(Q.current),Jb(Q,Q.current,X,z);{var J=BH;BH=[];for(var $=0;$<J.length;$++){var q=J[$];cF(Q,q)}}OL(),jW(Q.current,!0),a1=Z,F8();{if(s3)if(Q===e3)kz++;else kz=0,e3=Q;else kz=0;KH=!1,s3=!1}s_(Q);{var U=Q.current.stateNode;U.effectDuration=0,U.passiveEffectDuration=0}return!0}function EW(z){return Tz!==null&&Tz.has(z)}function nb(z){if(Tz===null)Tz=new Set([z]);else Tz.add(z)}function rb(z){if(!t3)t3=!0,qH=z}var tb=rb;function xW(z,Q,X){var Z=W2(X,Q),J=mU(z,Z,k1),$=P8(z,J,k1),q=J6();if($!==null)FQ($,k1,q),_6($,q)}function k4(z,Q,X){if(gF(X),fX(!1),z.tag===b){xW(z,z,X);return}var Z=null;Z=Q;while(Z!==null){if(Z.tag===b){xW(Z,z,X);return}else if(Z.tag===O){var{type:J,stateNode:$}=Z;if(typeof J.getDerivedStateFromError==="function"||typeof $.componentDidCatch==="function"&&!EW($)){var q=W2(X,z),U=g9(Z,q,k1),L=P8(Z,U,k1),P=J6();if(L!==null)FQ(L,k1,P),_6(L,P);return}}Z=Z.return}G(`Internal React error: Attempted to capture a commit phase error inside a detached tree. This indicates a bug in React. Likely causes include deleting the same fiber more than once, committing an already-finished tree, or an inconsistent return pointer.
|
|
116
|
+
|
|
117
|
+
Error message:
|
|
118
|
+
|
|
119
|
+
%s`,X)}function sb(z,Q,X){var Z=z.pingCache;if(Z!==null)Z.delete(Q);var J=J6();if(Bq(z,X),HP(z),Z6===z&&t2(K5,X))if(O5===FX||O5===a3&&$q(K5)&&b5()-GH<TW)L2(z,b0);else r3=u1(r3,X);_6(z,J)}function pW(z,Q){if(Q===A5)Q=hb(z);var X=J6(),Z=W6(z,Q);if(Z!==null)FQ(Z,Q,X),_6(Z,X)}function eb(z){var Q=z.memoizedState,X=A5;if(Q!==null)X=Q.retryLane;pW(z,X)}function zP(z,Q){var X=A5,Z;switch(z.tag){case T:Z=z.stateNode;var J=z.memoizedState;if(J!==null)X=J.retryLane;break;case j:Z=z.stateNode;break;default:throw Error("Pinged unknown suspense boundary type. This is probably a bug in React.")}if(Z!==null)Z.delete(Q);pW(z,X)}function QP(z){return z<120?120:z<480?480:z<1080?1080:z<1920?1920:z<3000?3000:z<4320?4320:Cb(z/1960)*1960}function XP(){if(kX>Sb)throw kX=0,WH=null,Error("Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.");if(kz>fb)kz=0,e3=null,G("Maximum update depth exceeded. This can happen when a component calls setState inside useEffect, but useEffect either doesn't have a dependency array, or one of the dependencies changes on every render.")}function ZP(){s6.flushLegacyContextWarning(),s6.flushPendingUnsafeLifecycleWarnings()}function jW(z,Q){{if(l4(z),JJ(z,m7,Nb),Q)JJ(z,OZ,Rb);if(JJ(z,m7,_b),Q)JJ(z,OZ,Lb);F5()}}function JJ(z,Q,X){{var Z=z,J=null;while(Z!==null){var $=Z.subtreeFlags&Q;if(Z!==J&&Z.child!==null&&$!==w1)Z=Z.child;else{if((Z.flags&Q)!==w1)X(Z);if(Z.sibling!==null)Z=Z.sibling;else Z=J=Z.return}}}}var YJ=null;function lW(z){{if((a1&m5)!==W5)return;if(!(z.mode&o1))return;var Q=z.tag;if(Q!==F&&Q!==b&&Q!==O&&Q!==W&&Q!==f&&Q!==m&&Q!==E)return;var X=g1(z)||"ReactComponent";if(YJ!==null){if(YJ.has(X))return;YJ.add(X)}else YJ=new Set([X]);var Z=j5;try{l4(z),G("Can't perform a React state update on a component that hasn't mounted yet. This indicates that you have a side-effect in your render function that asynchronously later calls tries to update the component. Move this work to useEffect instead.")}finally{if(Z)l4(z);else F5()}}}var RH;{var JP=null;RH=function(z,Q,X){var Z=tW(JP,Q);try{return QW(z,Q,X)}catch($){if(Ww()||$!==null&&typeof $==="object"&&typeof $.then==="function")throw $;if(B3(),ZU(),HW(z,Q),tW(Q,Z),Q.mode&_4)M9(Q);if(eJ(null,QW,null,z,Q,X),y_()){var J=zY();if(typeof J==="object"&&J!==null&&J._suppressLogging&&typeof $==="object"&&$!==null&&!$._suppressLogging)$._suppressLogging=!0}throw $}}}var cW=!1,MH;MH=new Set;function YP(z){if(x8&&!lw())switch(z.tag){case W:case f:case E:{var Q=c4&&g1(c4)||"Unknown",X=Q;if(!MH.has(X)){MH.add(X);var Z=g1(z)||"Unknown";G("Cannot update a component (`%s`) while rendering a different component (`%s`). To locate the bad setState() call inside `%s`, follow the stack trace as described in https://reactjs.org/link/setstate-in-render",Z,Q,Q)}break}case O:{if(!cW)G("Cannot update during an existing state transition (such as within `render`). Render methods should be a pure function of props and state."),cW=!0;break}}}function SX(z,Q){if(a6){var X=z.memoizedUpdaters;X.forEach(function(Z){Uq(z,Z,Q)})}}var wH={};function FH(z,Q){{var X=$7.current;if(X!==null)return X.push(Q),wH;else return tG(z,Q)}}function dW(z){if(z===wH)return;return j_(z)}function iW(){return $7.current!==null}function $P(z){{if(z.mode&o1){if(!PW())return}else{if(!kb())return;if(a1!==W5)return;if(z.tag!==W&&z.tag!==f&&z.tag!==E)return}if($7.current===null){var Q=j5;try{l4(z),G(`An update to %s inside a test was not wrapped in act(...).
|
|
120
|
+
|
|
121
|
+
When testing, code that causes React state updates should be wrapped into act(...):
|
|
122
|
+
|
|
123
|
+
act(() => {
|
|
124
|
+
/* fire events that update state */
|
|
125
|
+
});
|
|
126
|
+
/* assert on the output */
|
|
127
|
+
|
|
128
|
+
This ensures that you're testing the behavior the user would see in the browser. Learn more at https://reactjs.org/link/wrap-tests-with-act`,g1(z))}finally{if(Q)l4(z);else F5()}}}}function HP(z){if(z.tag!==w8&&PW()&&$7.current===null)G(`A suspended resource finished loading inside a test, but the event was not wrapped in act(...).
|
|
129
|
+
|
|
130
|
+
When testing, code that resolves suspended data should be wrapped into act(...):
|
|
131
|
+
|
|
132
|
+
act(() => {
|
|
133
|
+
/* finish loading suspended data */
|
|
134
|
+
});
|
|
135
|
+
/* assert on the output */
|
|
136
|
+
|
|
137
|
+
This ensures that you're testing the behavior the user would see in the browser. Learn more at https://reactjs.org/link/wrap-tests-with-act`)}function fX(z){vW=z}var p6=null,Cz=null,GP=function(z){p6=z};function vz(z){{if(p6===null)return z;var Q=p6(z);if(Q===void 0)return z;return Q.current}}function bH(z){return vz(z)}function PH(z){{if(p6===null)return z;var Q=p6(z);if(Q===void 0){if(z!==null&&z!==void 0&&typeof z.render==="function"){var X=vz(z.render);if(z.render!==X){var Z={$$typeof:o,render:X};if(z.displayName!==void 0)Z.displayName=z.displayName;return Z}}return z}return Q.current}}function oW(z,Q){{if(p6===null)return!1;var X=z.elementType,Z=Q.type,J=!1,$=typeof Z==="object"&&Z!==null?Z.$$typeof:null;switch(z.tag){case O:{if(typeof Z==="function")J=!0;break}case W:{if(typeof Z==="function")J=!0;else if($===Q1)J=!0;break}case f:{if($===o)J=!0;else if($===Q1)J=!0;break}case m:case E:{if($===E0)J=!0;else if($===Q1)J=!0;break}default:return!1}if(J){var q=p6(X);if(q!==void 0&&q===p6(Z))return!0}return!1}}function aW(z){{if(p6===null)return;if(typeof WeakSet!=="function")return;if(Cz===null)Cz=new WeakSet;Cz.add(z)}}var qP=function(z,Q){{if(p6===null)return;var{staleFamilies:X,updatedFamilies:Z}=Q;t7(),r7(function(){AH(z.current,Z,X)})}},BP=function(z,Q){{if(z.context!==C6)return;t7(),r7(function(){hX(Q,z,null,null)})}};function AH(z,Q,X){{var{alternate:Z,child:J,sibling:$,tag:q,type:U}=z,L=null;switch(q){case W:case E:case O:L=U;break;case f:L=U.render;break}if(p6===null)throw Error("Expected resolveFamily to be set during hot reload.");var P=!1,C=!1;if(L!==null){var i=p6(L);if(i!==void 0){if(X.has(i))C=!0;else if(Q.has(i))if(q===O)C=!0;else P=!0}}if(Cz!==null){if(Cz.has(z)||Z!==null&&Cz.has(Z))C=!0}if(C)z._debugNeedsRemount=!0;if(C||P){var d=W6(z,k1);if(d!==null)_5(d,z,k1,V4)}if(J!==null&&!C)AH(J,Q,X);if($!==null)AH($,Q,X)}}var UP=function(z,Q){{var X=new Set,Z=new Set(Q.map(function(J){return J.current}));return IH(z.current,Z,X),X}};function IH(z,Q,X){{var{child:Z,sibling:J,tag:$,type:q}=z,U=null;switch($){case W:case E:case O:U=q;break;case f:U=q.render;break}var L=!1;if(U!==null){if(Q.has(U))L=!0}if(L)WP(z,X);else if(Z!==null)IH(Z,Q,X);if(J!==null)IH(J,Q,X)}}function WP(z,Q){{var X=KP(z,Q);if(X)return;var Z=z;while(!0){switch(Z.tag){case A:Q.add(Z.stateNode);return;case M:Q.add(Z.stateNode.containerInfo);return;case b:Q.add(Z.stateNode.containerInfo);return}if(Z.return===null)throw Error("Expected to reach root first.");Z=Z.return}}}function KP(z,Q){{var X=z,Z=!1;while(!0){if(X.tag===A)Z=!0,Q.add(X.stateNode);else if(X.child!==null){X.child.return=X,X=X.child;continue}if(X===z)return Z;while(X.sibling===null){if(X.return===null||X.return===z)return Z;X=X.return}X.sibling.return=X.return,X=X.sibling}}return!1}var TH;{TH=!1;try{var nW=Object.preventExtensions({})}catch(z){TH=!0}}function OP(z,Q,X,Z){if(this.tag=z,this.key=X,this.elementType=null,this.type=null,this.stateNode=null,this.return=null,this.child=null,this.sibling=null,this.index=0,this.ref=null,this.pendingProps=Q,this.memoizedProps=null,this.updateQueue=null,this.memoizedState=null,this.dependencies=null,this.mode=Z,this.flags=w1,this.subtreeFlags=w1,this.deletions=null,this.lanes=b0,this.childLanes=b0,this.alternate=null,this.actualDuration=Number.NaN,this.actualStartTime=Number.NaN,this.selfBaseDuration=Number.NaN,this.treeBaseDuration=Number.NaN,this.actualDuration=0,this.actualStartTime=-1,this.selfBaseDuration=0,this.treeBaseDuration=0,this._debugSource=null,this._debugOwner=null,this._debugNeedsRemount=!1,this._debugHookTypes=null,!TH&&typeof Object.preventExtensions==="function")Object.preventExtensions(this)}var v6=function(z,Q,X,Z){return new OP(z,Q,X,Z)};function kH(z){var Q=z.prototype;return!!(Q&&Q.isReactComponent)}function _P(z){return typeof z==="function"&&!kH(z)&&z.defaultProps===void 0}function LP(z){if(typeof z==="function")return kH(z)?O:W;else if(z!==void 0&&z!==null){var Q=z.$$typeof;if(Q===o)return f;if(Q===E0)return m}return F}function R2(z,Q){var X=z.alternate;if(X===null)X=v6(z.tag,Q,z.key,z.mode),X.elementType=z.elementType,X.type=z.type,X.stateNode=z.stateNode,X._debugSource=z._debugSource,X._debugOwner=z._debugOwner,X._debugHookTypes=z._debugHookTypes,X.alternate=z,z.alternate=X;else X.pendingProps=Q,X.type=z.type,X.flags=w1,X.subtreeFlags=w1,X.deletions=null,X.actualDuration=0,X.actualStartTime=-1;X.flags=z.flags&g7,X.childLanes=z.childLanes,X.lanes=z.lanes,X.child=z.child,X.memoizedProps=z.memoizedProps,X.memoizedState=z.memoizedState,X.updateQueue=z.updateQueue;var Z=z.dependencies;switch(X.dependencies=Z===null?null:{lanes:Z.lanes,firstContext:Z.firstContext},X.sibling=z.sibling,X.index=z.index,X.ref=z.ref,X.selfBaseDuration=z.selfBaseDuration,X.treeBaseDuration=z.treeBaseDuration,X._debugNeedsRemount=z._debugNeedsRemount,X.tag){case F:case W:case E:X.type=vz(z.type);break;case O:X.type=bH(z.type);break;case f:X.type=PH(z.type);break}return X}function NP(z,Q){z.flags&=g7|J5;var X=z.alternate;if(X===null)z.childLanes=b0,z.lanes=Q,z.child=null,z.subtreeFlags=w1,z.memoizedProps=null,z.memoizedState=null,z.updateQueue=null,z.dependencies=null,z.stateNode=null,z.selfBaseDuration=0,z.treeBaseDuration=0;else{z.childLanes=X.childLanes,z.lanes=X.lanes,z.child=X.child,z.subtreeFlags=w1,z.deletions=null,z.memoizedProps=X.memoizedProps,z.memoizedState=X.memoizedState,z.updateQueue=X.updateQueue,z.type=X.type;var Z=X.dependencies;z.dependencies=Z===null?null:{lanes:Z.lanes,firstContext:Z.firstContext},z.selfBaseDuration=X.selfBaseDuration,z.treeBaseDuration=X.treeBaseDuration}return z}function RP(z,Q,X){var Z;if(z===z3){if(Z=o1,Q===!0)Z|=n4,Z|=O7}else Z=O1;if(a6)Z|=_4;return v6(b,null,null,Z)}function CH(z,Q,X,Z,J,$){var q=F,U=z;if(typeof z==="function")if(kH(z))q=O,U=bH(U);else U=vz(U);else if(typeof z==="string")q=A;else z:switch(z){case z4:return y8(X.children,J,$,Q);case y:if(q=S,J|=n4,(J&o1)!==O1)J|=O7;break;case W0:return MP(X,J,$,Q);case N0:return wP(X,J,$,Q);case k0:return FP(X,J,$,Q);case D0:return rW(X,J,$,Q);case J1:case a0:case d1:case K4:case w0:default:{if(typeof z==="object"&&z!==null)switch(z.$$typeof){case F0:q=x;break z;case v:q=V;break z;case o:q=f,U=PH(U);break z;case E0:q=m;break z;case Q1:q=D,U=null;break z}var L="";{if(z===void 0||typeof z==="object"&&z!==null&&Object.keys(z).length===0)L+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.";var P=Z?g1(Z):null;if(P)L+=`
|
|
138
|
+
|
|
139
|
+
Check the render method of \``+P+"`."}throw Error("Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) "+("but got: "+(z==null?z:typeof z)+"."+L))}}var C=v6(q,X,Q,J);return C.elementType=z,C.type=U,C.lanes=$,C._debugOwner=Z,C}function vH(z,Q,X){var Z=null;Z=z._owner;var{type:J,key:$,props:q}=z,U=CH(J,$,q,Z,Q,X);return U._debugSource=z._source,U._debugOwner=z._owner,U}function y8(z,Q,X,Z){var J=v6(k,z,Z,Q);return J.lanes=X,J}function MP(z,Q,X,Z){if(typeof z.id!=="string")G('Profiler must specify an "id" of type `string` as a prop. Received the type `%s` instead.',typeof z.id);var J=v6(l,z,Z,Q|_4);return J.elementType=W0,J.lanes=X,J.stateNode={effectDuration:0,passiveEffectDuration:0},J}function wP(z,Q,X,Z){var J=v6(T,z,Z,Q);return J.elementType=N0,J.lanes=X,J}function FP(z,Q,X,Z){var J=v6(j,z,Z,Q);return J.elementType=k0,J.lanes=X,J}function rW(z,Q,X,Z){var J=v6(Q0,z,Z,Q);J.elementType=D0,J.lanes=X;var $={isHidden:!1};return J.stateNode=$,J}function SH(z,Q,X){var Z=v6(R,z,null,Q);return Z.lanes=X,Z}function bP(){var z=v6(A,null,null,O1);return z.elementType="DELETED",z}function PP(z){var Q=v6(c,null,null,O1);return Q.stateNode=z,Q}function fH(z,Q,X){var Z=z.children!==null?z.children:[],J=v6(M,Z,z.key,Q);return J.lanes=X,J.stateNode={containerInfo:z.containerInfo,pendingChildren:null,implementation:z.implementation},J}function tW(z,Q){if(z===null)z=v6(F,null,null,O1);return z.tag=Q.tag,z.key=Q.key,z.elementType=Q.elementType,z.type=Q.type,z.stateNode=Q.stateNode,z.return=Q.return,z.child=Q.child,z.sibling=Q.sibling,z.index=Q.index,z.ref=Q.ref,z.pendingProps=Q.pendingProps,z.memoizedProps=Q.memoizedProps,z.updateQueue=Q.updateQueue,z.memoizedState=Q.memoizedState,z.dependencies=Q.dependencies,z.mode=Q.mode,z.flags=Q.flags,z.subtreeFlags=Q.subtreeFlags,z.deletions=Q.deletions,z.lanes=Q.lanes,z.childLanes=Q.childLanes,z.alternate=Q.alternate,z.actualDuration=Q.actualDuration,z.actualStartTime=Q.actualStartTime,z.selfBaseDuration=Q.selfBaseDuration,z.treeBaseDuration=Q.treeBaseDuration,z._debugSource=Q._debugSource,z._debugOwner=Q._debugOwner,z._debugNeedsRemount=Q._debugNeedsRemount,z._debugHookTypes=Q._debugHookTypes,z}function AP(z,Q,X,Z,J){this.tag=Q,this.containerInfo=z,this.pendingChildren=null,this.current=null,this.pingCache=null,this.finishedWork=null,this.timeoutHandle=U$,this.context=null,this.pendingContext=null,this.callbackNode=null,this.callbackPriority=A5,this.eventTimes=yY(b0),this.expirationTimes=yY(V4),this.pendingLanes=b0,this.suspendedLanes=b0,this.pingedLanes=b0,this.expiredLanes=b0,this.mutableReadLanes=b0,this.finishedLanes=b0,this.entangledLanes=b0,this.entanglements=yY(b0),this.identifierPrefix=Z,this.onRecoverableError=J,this.mutableSourceEagerHydrationData=null,this.effectDuration=0,this.passiveEffectDuration=0;{this.memoizedUpdaters=new Set;var $=this.pendingUpdatersLaneMap=[];for(var q=0;q<BY;q++)$.push(new Set)}switch(Q){case z3:this._debugRootType=X?"hydrateRoot()":"createRoot()";break;case w8:this._debugRootType=X?"hydrate()":"render()";break}}function sW(z,Q,X,Z,J,$,q,U,L,P){var C=new AP(z,Q,X,U,L),i=RP(Q,$);C.current=i,i.stateNode=C;{var d={element:Z,isDehydrated:X,cache:null,transitions:null,pendingSuspenseBoundaries:null};i.memoizedState=d}return j$(i),C}var hH="18.3.1";function IP(z,Q,X){var Z=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;return Z1(Z),{$$typeof:b4,key:Z==null?null:""+Z,children:z,containerInfo:Q,implementation:X}}var yH,VH;yH=!1,VH={};function eW(z){if(!z)return C6;var Q=c2(z),X=Zw(Q);if(Q.tag===O){var Z=Q.type;if(N7(Z))return IB(Q,Z,X)}return X}function TP(z,Q){{var X=c2(z);if(X===void 0)if(typeof z.render==="function")throw Error("Unable to find node on an unmounted component.");else{var Z=Object.keys(z).join(",");throw Error("Argument appears to not be a ReactComponent. Keys: "+Z)}var J=aG(X);if(J===null)return null;if(J.mode&n4){var $=g1(X)||"Component";if(!VH[$]){VH[$]=!0;var q=j5;try{if(l4(J),X.mode&n4)G("%s is deprecated in StrictMode. %s was passed an instance of %s which is inside StrictMode. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-find-node",Q,Q,$);else G("%s is deprecated in StrictMode. %s was passed an instance of %s which renders StrictMode children. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-find-node",Q,Q,$)}finally{if(q)l4(q);else F5()}}}return J.stateNode}}function zK(z,Q,X,Z,J,$,q,U){var L=!1,P=null;return sW(z,Q,L,P,X,Z,J,$,q)}function QK(z,Q,X,Z,J,$,q,U,L,P){var C=!0,i=sW(X,Z,C,z,J,$,q,U,L);i.context=eW(null);var d=i.current,Z0=J6(),J0=f8(d),$0=i7(Z0,J0);return $0.callback=Q!==void 0&&Q!==null?Q:null,P8(d,$0,J0),yb(i,J0,Z0),i}function hX(z,Q,X,Z){r_(Q,z);var J=Q.current,$=J6(),q=f8(J);LL(q);var U=eW(X);if(Q.context===null)Q.context=U;else Q.pendingContext=U;if(x8&&j5!==null&&!yH)yH=!0,G(`Render methods should be a pure function of props and state; triggering nested component updates from render is not allowed. If necessary, trigger nested updates in componentDidUpdate.
|
|
140
|
+
|
|
141
|
+
Check the render method of %s.`,g1(j5)||"Unknown");var L=i7($,q);if(L.payload={element:z},Z=Z===void 0?null:Z,Z!==null){if(typeof Z!=="function")G("render(...): Expected the last optional `callback` argument to be a function. Instead received: %s.",Z);L.callback=Z}var P=P8(J,L,q);if(P!==null)_5(P,J,q,$),_3(P,J,q);return q}function $J(z){var Q=z.current;if(!Q.child)return null;switch(Q.child.tag){case A:return G$(Q.child.stateNode);default:return Q.child.stateNode}}function kP(z){switch(z.tag){case b:{var Q=z.stateNode;if(AZ(Q)){var X=IL(Q);gb(Q,X)}break}case T:{r7(function(){var J=W6(z,k1);if(J!==null){var $=J6();_5(J,z,k1,$)}});var Z=k1;DH(z,Z);break}}}function XK(z,Q){var X=z.memoizedState;if(X!==null&&X.dehydrated!==null)X.retryLane=fL(X.retryLane,Q)}function DH(z,Q){XK(z,Q);var X=z.alternate;if(X)XK(X,Q)}function CP(z){if(z.tag!==T)return;var Q=NQ,X=W6(z,Q);if(X!==null){var Z=J6();_5(X,z,Q,Z)}DH(z,Q)}function vP(z){if(z.tag!==T)return;var Q=f8(z),X=W6(z,Q);if(X!==null){var Z=J6();_5(X,z,Q,Z)}DH(z,Q)}function ZK(z){var Q=p_(z);if(Q===null)return null;return Q.stateNode}var JK=function(z){return null};function SP(z){return JK(z)}var YK=function(z){return!1};function fP(z){return YK(z)}var $K=null,HK=null,GK=null,qK=null,BK=null,UK=null,WK=null,KK=null,OK=null;{var _K=function(z,Q,X){var Z=Q[X],J=Z4(z)?z.slice():E1({},z);if(X+1===Q.length){if(Z4(J))J.splice(Z,1);else delete J[Z];return J}return J[Z]=_K(z[Z],Q,X+1),J},LK=function(z,Q){return _K(z,Q,0)},NK=function(z,Q,X,Z){var J=Q[Z],$=Z4(z)?z.slice():E1({},z);if(Z+1===Q.length){var q=X[Z];if($[q]=$[J],Z4($))$.splice(J,1);else delete $[J]}else $[J]=NK(z[J],Q,X,Z+1);return $},RK=function(z,Q,X){if(Q.length!==X.length){K("copyWithRename() expects paths of the same length");return}else for(var Z=0;Z<X.length-1;Z++)if(Q[Z]!==X[Z]){K("copyWithRename() expects paths to be the same except for the deepest key");return}return NK(z,Q,X,0)},MK=function(z,Q,X,Z){if(X>=Q.length)return Z;var J=Q[X],$=Z4(z)?z.slice():E1({},z);return $[J]=MK(z[J],Q,X+1,Z),$},wK=function(z,Q,X){return MK(z,Q,0,X)},mH=function(z,Q){var X=z.memoizedState;while(X!==null&&Q>0)X=X.next,Q--;return X};$K=function(z,Q,X,Z){var J=mH(z,Q);if(J!==null){var $=wK(J.memoizedState,X,Z);J.memoizedState=$,J.baseState=$,z.memoizedProps=E1({},z.memoizedProps);var q=W6(z,k1);if(q!==null)_5(q,z,k1,V4)}},HK=function(z,Q,X){var Z=mH(z,Q);if(Z!==null){var J=LK(Z.memoizedState,X);Z.memoizedState=J,Z.baseState=J,z.memoizedProps=E1({},z.memoizedProps);var $=W6(z,k1);if($!==null)_5($,z,k1,V4)}},GK=function(z,Q,X,Z){var J=mH(z,Q);if(J!==null){var $=RK(J.memoizedState,X,Z);J.memoizedState=$,J.baseState=$,z.memoizedProps=E1({},z.memoizedProps);var q=W6(z,k1);if(q!==null)_5(q,z,k1,V4)}},qK=function(z,Q,X){if(z.pendingProps=wK(z.memoizedProps,Q,X),z.alternate)z.alternate.pendingProps=z.pendingProps;var Z=W6(z,k1);if(Z!==null)_5(Z,z,k1,V4)},BK=function(z,Q){if(z.pendingProps=LK(z.memoizedProps,Q),z.alternate)z.alternate.pendingProps=z.pendingProps;var X=W6(z,k1);if(X!==null)_5(X,z,k1,V4)},UK=function(z,Q,X){if(z.pendingProps=RK(z.memoizedProps,Q,X),z.alternate)z.alternate.pendingProps=z.pendingProps;var Z=W6(z,k1);if(Z!==null)_5(Z,z,k1,V4)},WK=function(z){var Q=W6(z,k1);if(Q!==null)_5(Q,z,k1,V4)},KK=function(z){JK=z},OK=function(z){YK=z}}function hP(z){var Q=aG(z);if(Q===null)return null;return Q.stateNode}function yP(z){return null}function VP(){return j5}function DP(z){var Q=z.findFiberByHostInstance,X=Y.ReactCurrentDispatcher;return n_({bundleType:z.bundleType,version:z.version,rendererPackageName:z.rendererPackageName,rendererConfig:z.rendererConfig,overrideHookState:$K,overrideHookStateDeletePath:HK,overrideHookStateRenamePath:GK,overrideProps:qK,overridePropsDeletePath:BK,overridePropsRenamePath:UK,setErrorHandler:KK,setSuspenseHandler:OK,scheduleUpdate:WK,currentDispatcherRef:X,findHostInstanceByFiber:hP,findFiberByHostInstance:Q||yP,findHostInstancesForRefresh:UP,scheduleRefresh:qP,scheduleRoot:BP,setRefreshHandler:GP,getCurrentFiber:VP,reconcilerVersion:hH})}var FK=typeof reportError==="function"?reportError:function(z){console.error(z)};function gH(z){this._internalRoot=z}HJ.prototype.render=gH.prototype.render=function(z){var Q=this._internalRoot;if(Q===null)throw Error("Cannot update an unmounted root.");{if(typeof arguments[1]==="function")G("render(...): does not support the second callback argument. To execute a side effect after rendering, declare it in a component body with useEffect().");else if(GJ(arguments[1]))G("You passed a container to the second argument of root.render(...). You don't need to pass it again since you already passed it to create the root.");else if(typeof arguments[1]<"u")G("You passed a second argument to root.render(...) but it only accepts one argument.");var X=Q.containerInfo;if(X.nodeType!==Z5){var Z=ZK(Q.current);if(Z){if(Z.parentNode!==X)G("render(...): It looks like the React-rendered content of the root container was removed without using React. This is not supported and will cause errors. Instead, call root.unmount() to empty a root's container.")}}}hX(z,Q,null,null)},HJ.prototype.unmount=gH.prototype.unmount=function(){if(typeof arguments[0]==="function")G("unmount(...): does not support a callback argument. To execute a side effect after rendering, declare it in a component body with useEffect().");var z=this._internalRoot;if(z!==null){this._internalRoot=null;var Q=z.containerInfo;if(yW())G("Attempted to synchronously unmount a root while React was already rendering. React cannot finish unmounting the root until the current render has completed, which may lead to a race condition.");r7(function(){hX(null,z,null,null)}),MB(Q)}};function mP(z,Q){if(!GJ(z))throw Error("createRoot(...): Target container is not a DOM element.");bK(z);var X=!1,Z=!1,J="",$=FK,q=null;if(Q!==null&&Q!==void 0){if(Q.hydrate)K("hydrate through createRoot is deprecated. Use ReactDOMClient.hydrateRoot(container, <App />) instead.");else if(typeof Q==="object"&&Q!==null&&Q.$$typeof===W4)G(`You passed a JSX element to createRoot. You probably meant to call root.render instead. Example usage:
|
|
142
|
+
|
|
143
|
+
let root = createRoot(domContainer);
|
|
144
|
+
root.render(<App />);`);if(Q.unstable_strictMode===!0)X=!0;if(Q.identifierPrefix!==void 0)J=Q.identifierPrefix;if(Q.onRecoverableError!==void 0)$=Q.onRecoverableError;if(Q.transitionCallbacks!==void 0)q=Q.transitionCallbacks}var U=zK(z,z3,null,X,Z,J,$);oZ(U.current,z);var L=z.nodeType===Z5?z.parentNode:z;return uQ(L),new gH(U)}function HJ(z){this._internalRoot=z}function gP(z){if(z)aL(z)}HJ.prototype.unstable_scheduleHydration=gP;function uP(z,Q,X){if(!GJ(z))throw Error("hydrateRoot(...): Target container is not a DOM element.");if(bK(z),Q===void 0)G("Must provide initial children as second argument to hydrateRoot. Example usage: hydrateRoot(domContainer, <App />)");var Z=X!=null?X:null,J=X!=null&&X.hydratedSources||null,$=!1,q=!1,U="",L=FK;if(X!==null&&X!==void 0){if(X.unstable_strictMode===!0)$=!0;if(X.identifierPrefix!==void 0)U=X.identifierPrefix;if(X.onRecoverableError!==void 0)L=X.onRecoverableError}var P=QK(Q,null,z,z3,Z,$,q,U,L);if(oZ(P.current,z),uQ(z),J)for(var C=0;C<J.length;C++){var i=J[C];uw(P,i)}return new HJ(P)}function GJ(z){return!!(z&&(z.nodeType===B6||z.nodeType===y7||z.nodeType===jJ||!B0))}function yX(z){return!!(z&&(z.nodeType===B6||z.nodeType===y7||z.nodeType===jJ||z.nodeType===Z5&&z.nodeValue===" react-mount-point-unstable "))}function bK(z){{if(z.nodeType===B6&&z.tagName&&z.tagName.toUpperCase()==="BODY")G("createRoot(): Creating roots directly with document.body is discouraged, since its children are often manipulated by third-party scripts and browser extensions. This may lead to subtle reconciliation issues. Try using a container element created for your app.");if(nQ(z))if(z._reactRootContainer)G("You are calling ReactDOMClient.createRoot() on a container that was previously passed to ReactDOM.render(). This is not supported.");else G("You are calling ReactDOMClient.createRoot() on a container that has already been passed to createRoot() before. Instead, call root.render() on the existing root instead if you want to update it.")}}var EP=Y.ReactCurrentOwner,PK;PK=function(z){if(z._reactRootContainer&&z.nodeType!==Z5){var Q=ZK(z._reactRootContainer.current);if(Q){if(Q.parentNode!==z)G("render(...): It looks like the React-rendered content of this container was removed without using React. This is not supported and will cause errors. Instead, call ReactDOM.unmountComponentAtNode to empty a container.")}}var X=!!z._reactRootContainer,Z=uH(z),J=!!(Z&&R8(Z));if(J&&!X)G("render(...): Replacing React-rendered children with a new root component. If you intended to update the children of this node, you should instead have the existing children update their state and render the new components instead of calling ReactDOM.render.");if(z.nodeType===B6&&z.tagName&&z.tagName.toUpperCase()==="BODY")G("render(): Rendering components directly into document.body is discouraged, since its children are often manipulated by third-party scripts and browser extensions. This may lead to subtle reconciliation issues. Try rendering into a container element created for your app.")};function uH(z){if(!z)return null;if(z.nodeType===y7)return z.documentElement;else return z.firstChild}function AK(){}function xP(z,Q,X,Z,J){if(J){if(typeof Z==="function"){var $=Z;Z=function(){var d=$J(q);$.call(d)}}var q=QK(Q,Z,z,w8,null,!1,!1,"",AK);z._reactRootContainer=q,oZ(q.current,z);var U=z.nodeType===Z5?z.parentNode:z;return uQ(U),r7(),q}else{var L;while(L=z.lastChild)z.removeChild(L);if(typeof Z==="function"){var P=Z;Z=function(){var d=$J(C);P.call(d)}}var C=zK(z,w8,null,!1,!1,"",AK);z._reactRootContainer=C,oZ(C.current,z);var i=z.nodeType===Z5?z.parentNode:z;return uQ(i),r7(function(){hX(Q,C,X,Z)}),C}}function pP(z,Q){if(z!==null&&typeof z!=="function")G("%s(...): Expected the last optional `callback` argument to be a function. Instead received: %s.",Q,z)}function qJ(z,Q,X,Z,J){PK(X),pP(J===void 0?null:J,"render");var $=X._reactRootContainer,q;if(!$)q=xP(X,Q,z,J,Z);else{if(q=$,typeof J==="function"){var U=J;J=function(){var L=$J(q);U.call(L)}}hX(Q,q,z,J)}return $J(q)}var IK=!1;function jP(z){{if(!IK)IK=!0,G("findDOMNode is deprecated and will be removed in the next major release. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-find-node");var Q=EP.current;if(Q!==null&&Q.stateNode!==null){var X=Q.stateNode._warnedAboutRefsInRender;if(!X)G("%s is accessing findDOMNode inside its render(). render() should be a pure function of props and state. It should never access something that requires stale data from the previous render, such as refs. Move this logic to componentDidMount and componentDidUpdate instead.",s1(Q.type)||"A component");Q.stateNode._warnedAboutRefsInRender=!0}}if(z==null)return null;if(z.nodeType===B6)return z;return TP(z,"findDOMNode")}function lP(z,Q,X){if(G("ReactDOM.hydrate is no longer supported in React 18. Use hydrateRoot instead. Until you switch to the new API, your app will behave as if it's running React 17. Learn more: https://reactjs.org/link/switch-to-createroot"),!yX(Q))throw Error("Target container is not a DOM element.");{var Z=nQ(Q)&&Q._reactRootContainer===void 0;if(Z)G("You are calling ReactDOM.hydrate() on a container that was previously passed to ReactDOMClient.createRoot(). This is not supported. Did you mean to call hydrateRoot(container, element)?")}return qJ(null,z,Q,!0,X)}function cP(z,Q,X){if(G("ReactDOM.render is no longer supported in React 18. Use createRoot instead. Until you switch to the new API, your app will behave as if it's running React 17. Learn more: https://reactjs.org/link/switch-to-createroot"),!yX(Q))throw Error("Target container is not a DOM element.");{var Z=nQ(Q)&&Q._reactRootContainer===void 0;if(Z)G("You are calling ReactDOM.render() on a container that was previously passed to ReactDOMClient.createRoot(). This is not supported. Did you mean to call root.render(element)?")}return qJ(null,z,Q,!1,X)}function dP(z,Q,X,Z){if(G("ReactDOM.unstable_renderSubtreeIntoContainer() is no longer supported in React 18. Consider using a portal instead. Until you switch to the createRoot API, your app will behave as if it's running React 17. Learn more: https://reactjs.org/link/switch-to-createroot"),!yX(X))throw Error("Target container is not a DOM element.");if(z==null||!V_(z))throw Error("parentComponent must be a valid React Component");return qJ(z,Q,X,!1,Z)}var TK=!1;function iP(z){if(!TK)TK=!0,G("unmountComponentAtNode is deprecated and will be removed in the next major release. Switch to the createRoot API. Learn more: https://reactjs.org/link/switch-to-createroot");if(!yX(z))throw Error("unmountComponentAtNode(...): Target container is not a DOM element.");{var Q=nQ(z)&&z._reactRootContainer===void 0;if(Q)G("You are calling ReactDOM.unmountComponentAtNode() on a container that was previously passed to ReactDOMClient.createRoot(). This is not supported. Did you mean to call root.unmount()?")}if(z._reactRootContainer){{var X=uH(z),Z=X&&!R8(X);if(Z)G("unmountComponentAtNode(): The node you're attempting to unmount was rendered by another copy of React.")}return r7(function(){qJ(null,null,z,!1,function(){z._reactRootContainer=null,MB(z)})}),!0}else{{var J=uH(z),$=!!(J&&R8(J)),q=z.nodeType===B6&&yX(z.parentNode)&&!!z.parentNode._reactRootContainer;if($)G("unmountComponentAtNode(): The node you're attempting to unmount was rendered by React and is not a top-level container. %s",q?"You may have accidentally passed in a React root node instead of its container.":"Instead, have the parent component update its state and rerender in order to remove this component.")}return!1}}if(uL(kP),xL(CP),pL(vP),jL(n6),lL(DL),typeof Map!=="function"||Map.prototype==null||typeof Map.prototype.forEach!=="function"||typeof Set!=="function"||Set.prototype==null||typeof Set.prototype.clear!=="function"||typeof Set.prototype.forEach!=="function")G("React depends on Map and Set built-in types. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills");P_(cR),T_(_H,ub,r7);function oP(z,Q){var X=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;if(!GJ(Q))throw Error("Target container is not a DOM element.");return IP(z,Q,null,X)}function aP(z,Q,X,Z){return dP(z,Q,X,Z)}var EH={usingClientEntryPoint:!1,Events:[R8,$z,aZ,mG,gG,_H]};function nP(z,Q){if(!EH.usingClientEntryPoint)G('You are importing createRoot from "react-dom" which is not supported. You should instead import it from "react-dom/client".');return mP(z,Q)}function rP(z,Q,X){if(!EH.usingClientEntryPoint)G('You are importing hydrateRoot from "react-dom" which is not supported. You should instead import it from "react-dom/client".');return uP(z,Q,X)}function tP(z){if(yW())G("flushSync was called from inside a lifecycle method. React cannot flush when React is already rendering. Consider moving this call to a scheduler task or micro task.");return r7(z)}var sP=DP({findFiberByHostInstance:Z2,bundleType:1,version:hH,rendererPackageName:"react-dom"});if(!sP&&O0&&window.top===window.self){if(navigator.userAgent.indexOf("Chrome")>-1&&navigator.userAgent.indexOf("Edge")===-1||navigator.userAgent.indexOf("Firefox")>-1){var kK=window.location.protocol;if(/^(https?|file):$/.test(kK))console.info("%cDownload the React DevTools for a better development experience: https://reactjs.org/link/react-devtools"+(kK==="file:"?`
|
|
145
|
+
You might need to use a local HTTP server (instead of file://): https://reactjs.org/link/react-devtools-faq`:""),"font-weight:bold")}}if(HA.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=EH,HA.createPortal=oP,HA.createRoot=nP,HA.findDOMNode=jP,HA.flushSync=tP,HA.hydrate=lP,HA.hydrateRoot=rP,HA.render=cP,HA.unmountComponentAtNode=iP,HA.unstable_batchedUpdates=_H,HA.unstable_renderSubtreeIntoContainer=aP,HA.version=hH,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==="function")__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()});var hK=M2((YC,fK)=>{var GA=H0(SK());fK.exports=GA});var yK=M2((qA)=>{var hz=H0(hK());fz=hz.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,qA.createRoot=function(Y,H){fz.usingClientEntryPoint=!0;try{return hz.createRoot(Y,H)}finally{fz.usingClientEntryPoint=!1}},qA.hydrateRoot=function(Y,H,B){fz.usingClientEntryPoint=!0;try{return hz.hydrateRoot(Y,H,B)}finally{fz.usingClientEntryPoint=!1}};var fz});var H1=M2((BA)=>{var pH=H0(D1());(function(){var Y=Symbol.for("react.element"),H=Symbol.for("react.portal"),B=Symbol.for("react.fragment"),K=Symbol.for("react.strict_mode"),G=Symbol.for("react.profiler"),_=Symbol.for("react.provider"),W=Symbol.for("react.context"),O=Symbol.for("react.forward_ref"),F=Symbol.for("react.suspense"),b=Symbol.for("react.suspense_list"),M=Symbol.for("react.memo"),A=Symbol.for("react.lazy"),R=Symbol.for("react.offscreen"),k=Symbol.iterator,S="@@iterator";function V(y){if(y===null||typeof y!=="object")return null;var W0=k&&y[k]||y[S];if(typeof W0==="function")return W0;return null}var x=pH.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function f(y){{for(var W0=arguments.length,F0=Array(W0>1?W0-1:0),v=1;v<W0;v++)F0[v-1]=arguments[v];l("error",y,F0)}}function l(y,W0,F0){{var v=x.ReactDebugCurrentFrame,o=v.getStackAddendum();if(o!=="")W0+="%s",F0=F0.concat([o]);var N0=F0.map(function(k0){return String(k0)});N0.unshift("Warning: "+W0),Function.prototype.apply.call(console[y],console,N0)}}var T=!1,m=!1,E=!1,D=!1,n=!1,c;c=Symbol.for("react.module.reference");function j(y){if(typeof y==="string"||typeof y==="function")return!0;if(y===B||y===G||n||y===K||y===F||y===b||D||y===R||T||m||E)return!0;if(typeof y==="object"&&y!==null){if(y.$$typeof===A||y.$$typeof===M||y.$$typeof===_||y.$$typeof===W||y.$$typeof===O||y.$$typeof===c||y.getModuleId!==void 0)return!0}return!1}function g(y,W0,F0){var v=y.displayName;if(v)return v;var o=W0.displayName||W0.name||"";return o!==""?F0+"("+o+")":F0}function Q0(y){return y.displayName||"Context"}function r(y){if(y==null)return null;if(typeof y.tag==="number")f("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.");if(typeof y==="function")return y.displayName||y.name||null;if(typeof y==="string")return y;switch(y){case B:return"Fragment";case H:return"Portal";case G:return"Profiler";case K:return"StrictMode";case F:return"Suspense";case b:return"SuspenseList"}if(typeof y==="object")switch(y.$$typeof){case W:var W0=y;return Q0(W0)+".Consumer";case _:var F0=y;return Q0(F0._context)+".Provider";case O:return g(y,y.render,"ForwardRef");case M:var v=y.displayName||null;if(v!==null)return v;return r(y.type)||"Memo";case A:{var o=y,N0=o._payload,k0=o._init;try{return r(k0(N0))}catch(E0){return null}}}return null}var U0=Object.assign,R0=0,_0,f0,P0,a,Y0,B0,G0;function h0(){}h0.__reactDisabledLog=!0;function z0(){{if(R0===0){_0=console.log,f0=console.info,P0=console.warn,a=console.error,Y0=console.group,B0=console.groupCollapsed,G0=console.groupEnd;var y={configurable:!0,enumerable:!0,value:h0,writable:!0};Object.defineProperties(console,{info:y,log:y,warn:y,error:y,group:y,groupCollapsed:y,groupEnd:y})}R0++}}function v0(){{if(R0--,R0===0){var y={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:U0({},y,{value:_0}),info:U0({},y,{value:f0}),warn:U0({},y,{value:P0}),error:U0({},y,{value:a}),group:U0({},y,{value:Y0}),groupCollapsed:U0({},y,{value:B0}),groupEnd:U0({},y,{value:G0})})}if(R0<0)f("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var j0=x.ReactCurrentDispatcher,Y1;function m0(y,W0,F0){{if(Y1===void 0)try{throw Error()}catch(o){var v=o.stack.trim().match(/\n( *(at )?)/);Y1=v&&v[1]||""}return`
|
|
146
|
+
`+Y1+y}}var F1=!1,R1;{var p=typeof WeakMap==="function"?WeakMap:Map;R1=new p}function O0(y,W0){if(!y||F1)return"";{var F0=R1.get(y);if(F0!==void 0)return F0}var v;F1=!0;var o=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var N0;N0=j0.current,j0.current=null,z0();try{if(W0){var k0=function(){throw Error()};if(Object.defineProperty(k0.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==="object"&&Reflect.construct){try{Reflect.construct(k0,[])}catch(K4){v=K4}Reflect.construct(y,[],k0)}else{try{k0.call()}catch(K4){v=K4}y.call(k0.prototype)}}else{try{throw Error()}catch(K4){v=K4}y()}}catch(K4){if(K4&&v&&typeof K4.stack==="string"){var E0=K4.stack.split(`
|
|
147
|
+
`),Q1=v.stack.split(`
|
|
148
|
+
`),a0=E0.length-1,w0=Q1.length-1;while(a0>=1&&w0>=0&&E0[a0]!==Q1[w0])w0--;for(;a0>=1&&w0>=0;a0--,w0--)if(E0[a0]!==Q1[w0]){if(a0!==1||w0!==1)do if(a0--,w0--,w0<0||E0[a0]!==Q1[w0]){var D0=`
|
|
149
|
+
`+E0[a0].replace(" at new "," at ");if(y.displayName&&D0.includes("<anonymous>"))D0=D0.replace("<anonymous>",y.displayName);if(typeof y==="function")R1.set(y,D0);return D0}while(a0>=1&&w0>=0);break}}}finally{F1=!1,j0.current=N0,v0(),Error.prepareStackTrace=o}var J1=y?y.displayName||y.name:"",d1=J1?m0(J1):"";if(typeof y==="function")R1.set(y,d1);return d1}function V0(y,W0,F0){return O0(y,!1)}function q1(y){var W0=y.prototype;return!!(W0&&W0.isReactComponent)}function y1(y,W0,F0){if(y==null)return"";if(typeof y==="function")return O0(y,q1(y));if(typeof y==="string")return m0(y);switch(y){case F:return m0("Suspense");case b:return m0("SuspenseList")}if(typeof y==="object")switch(y.$$typeof){case O:return V0(y.render);case M:return y1(y.type,W0,F0);case A:{var v=y,o=v._payload,N0=v._init;try{return y1(N0(o),W0,F0)}catch(k0){}}}return""}var M1=Object.prototype.hasOwnProperty,A0={},Z1=x.ReactDebugCurrentFrame;function h1(y){if(y){var W0=y._owner,F0=y1(y.type,y._source,W0?W0.type:null);Z1.setExtraStackFrame(F0)}else Z1.setExtraStackFrame(null)}function n1(y,W0,F0,v,o){{var N0=Function.call.bind(M1);for(var k0 in y)if(N0(y,k0)){var E0=void 0;try{if(typeof y[k0]!=="function"){var Q1=Error((v||"React class")+": "+F0+" type `"+k0+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof y[k0]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Q1.name="Invariant Violation",Q1}E0=y[k0](W0,k0,v,F0,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(a0){E0=a0}if(E0&&!(E0 instanceof Error))h1(o),f("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",v||"React class",F0,k0,typeof E0),h1(null);if(E0 instanceof Error&&!(E0.message in A0))A0[E0.message]=!0,h1(o),f("Failed %s type: %s",F0,E0.message),h1(null)}}}var f4=Array.isArray;function B4(y){return f4(y)}function T5(y){{var W0=typeof Symbol==="function"&&Symbol.toStringTag,F0=W0&&y[Symbol.toStringTag]||y.constructor.name||"Object";return F0}}function A4(y){try{return k5(y),!1}catch(W0){return!0}}function k5(y){return""+y}function h4(y){if(A4(y))return f("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",T5(y)),k5(y)}var D4=x.ReactCurrentOwner,M5={key:!0,ref:!0,__self:!0,__source:!0},x5,o4,X5;X5={};function g0(y){if(M1.call(y,"ref")){var W0=Object.getOwnPropertyDescriptor(y,"ref").get;if(W0&&W0.isReactWarning)return!1}return y.ref!==void 0}function $1(y){if(M1.call(y,"key")){var W0=Object.getOwnPropertyDescriptor(y,"key").get;if(W0&&W0.isReactWarning)return!1}return y.key!==void 0}function K1(y,W0){if(typeof y.ref==="string"&&D4.current&&W0&&D4.current.stateNode!==W0){var F0=r(D4.current.type);if(!X5[F0])f('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',r(D4.current.type),y.ref),X5[F0]=!0}}function r1(y,W0){{var F0=function(){if(!x5)x5=!0,f("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",W0)};F0.isReactWarning=!0,Object.defineProperty(y,"key",{get:F0,configurable:!0})}}function U4(y,W0){{var F0=function(){if(!o4)o4=!0,f("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",W0)};F0.isReactWarning=!0,Object.defineProperty(y,"ref",{get:F0,configurable:!0})}}var x4=function(y,W0,F0,v,o,N0,k0){var E0={$$typeof:Y,type:y,key:W0,ref:F0,props:k0,_owner:N0};if(E0._store={},Object.defineProperty(E0._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(E0,"_self",{configurable:!1,enumerable:!1,writable:!1,value:v}),Object.defineProperty(E0,"_source",{configurable:!1,enumerable:!1,writable:!1,value:o}),Object.freeze)Object.freeze(E0.props),Object.freeze(E0);return E0};function w4(y,W0,F0,v,o){{var N0,k0={},E0=null,Q1=null;if(F0!==void 0)h4(F0),E0=""+F0;if($1(W0))h4(W0.key),E0=""+W0.key;if(g0(W0))Q1=W0.ref,K1(W0,o);for(N0 in W0)if(M1.call(W0,N0)&&!M5.hasOwnProperty(N0))k0[N0]=W0[N0];if(y&&y.defaultProps){var a0=y.defaultProps;for(N0 in a0)if(k0[N0]===void 0)k0[N0]=a0[N0]}if(E0||Q1){var w0=typeof y==="function"?y.displayName||y.name||"Unknown":y;if(E0)r1(k0,w0);if(Q1)U4(k0,w0)}return x4(y,E0,Q1,o,v,D4.current,k0)}}var{ReactCurrentOwner:z5,ReactDebugCurrentFrame:V1}=x;function S1(y){if(y){var W0=y._owner,F0=y1(y.type,y._source,W0?W0.type:null);V1.setExtraStackFrame(F0)}else V1.setExtraStackFrame(null)}var t5=!1;function w5(y){return typeof y==="object"&&y!==null&&y.$$typeof===Y}function s5(){{if(z5.current){var y=r(z5.current.type);if(y)return`
|
|
150
|
+
|
|
151
|
+
Check the render method of \``+y+"`."}return""}}function q7(y){{if(y!==void 0){var W0=y.fileName.replace(/^.*[\\\/]/,""),F0=y.lineNumber;return`
|
|
152
|
+
|
|
153
|
+
Check your code at `+W0+":"+F0+"."}return""}}var d6={};function B7(y){{var W0=s5();if(!W0){var F0=typeof y==="string"?y:y.displayName||y.name;if(F0)W0=`
|
|
154
|
+
|
|
155
|
+
Check the top-level render call using <`+F0+">."}return W0}}function y6(y,W0){{if(!y._store||y._store.validated||y.key!=null)return;y._store.validated=!0;var F0=B7(W0);if(d6[F0])return;d6[F0]=!0;var v="";if(y&&y._owner&&y._owner!==z5.current)v=" It was passed a child from "+r(y._owner.type)+".";S1(y),f('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',F0,v),S1(null)}}function p5(y,W0){{if(typeof y!=="object")return;if(B4(y))for(var F0=0;F0<y.length;F0++){var v=y[F0];if(w5(v))y6(v,W0)}else if(w5(y)){if(y._store)y._store.validated=!0}else if(y){var o=V(y);if(typeof o==="function"){if(o!==y.entries){var N0=o.call(y),k0;while(!(k0=N0.next()).done)if(w5(k0.value))y6(k0.value,W0)}}}}}function i6(y){{var W0=y.type;if(W0===null||W0===void 0||typeof W0==="string")return;var F0;if(typeof W0==="function")F0=W0.propTypes;else if(typeof W0==="object"&&(W0.$$typeof===O||W0.$$typeof===M))F0=W0.propTypes;else return;if(F0){var v=r(W0);n1(F0,y.props,"prop",v,y)}else if(W0.PropTypes!==void 0&&!t5){t5=!0;var o=r(W0);f("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",o||"Unknown")}if(typeof W0.getDefaultProps==="function"&&!W0.getDefaultProps.isReactClassApproved)f("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function c1(y){{var W0=Object.keys(y.props);for(var F0=0;F0<W0.length;F0++){var v=W0[F0];if(v!=="children"&&v!=="key"){S1(y),f("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",v),S1(null);break}}if(y.ref!==null)S1(y),f("Invalid attribute `ref` supplied to `React.Fragment`."),S1(null)}}var W4={};function b4(y,W0,F0,v,o,N0){{var k0=j(y);if(!k0){var E0="";if(y===void 0||typeof y==="object"&&y!==null&&Object.keys(y).length===0)E0+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.";var Q1=q7(o);if(Q1)E0+=Q1;else E0+=s5();var a0;if(y===null)a0="null";else if(B4(y))a0="array";else if(y!==void 0&&y.$$typeof===Y)a0="<"+(r(y.type)||"Unknown")+" />",E0=" Did you accidentally export a JSX literal instead of a component?";else a0=typeof y;f("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",a0,E0)}var w0=w4(y,W0,F0,o,N0);if(w0==null)return w0;if(k0){var D0=W0.children;if(D0!==void 0)if(v)if(B4(D0)){for(var J1=0;J1<D0.length;J1++)p5(D0[J1],y);if(Object.freeze)Object.freeze(D0)}else f("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else p5(D0,y)}if(M1.call(W0,"key")){var d1=r(y),K4=Object.keys(W0).filter(function(y4){return y4!=="key"}),e5=K4.length>0?"{key: someKey, "+K4.join(": ..., ")+": ...}":"{key: someKey}";if(!W4[d1+e5]){var F6=K4.length>0?"{"+K4.join(": ..., ")+": ...}":"{}";f(`A props object containing a "key" prop is being spread into JSX:
|
|
156
|
+
let props = %s;
|
|
157
|
+
<%s {...props} />
|
|
158
|
+
React keys must be passed directly to JSX without using spread:
|
|
159
|
+
let props = %s;
|
|
160
|
+
<%s key={someKey} {...props} />`,e5,d1,F6,d1),W4[d1+e5]=!0}}if(y===B)c1(w0);else i6(w0);return w0}}var z4=b4;BA.Fragment=B,BA.jsxDEV=z4})()});var C4=M2((iA)=>{var QG=H0(D1());(function(){var Y=Symbol.for("react.element"),H=Symbol.for("react.portal"),B=Symbol.for("react.fragment"),K=Symbol.for("react.strict_mode"),G=Symbol.for("react.profiler"),_=Symbol.for("react.provider"),W=Symbol.for("react.context"),O=Symbol.for("react.forward_ref"),F=Symbol.for("react.suspense"),b=Symbol.for("react.suspense_list"),M=Symbol.for("react.memo"),A=Symbol.for("react.lazy"),R=Symbol.for("react.offscreen"),k=Symbol.iterator,S="@@iterator";function V(v){if(v===null||typeof v!=="object")return null;var o=k&&v[k]||v[S];if(typeof o==="function")return o;return null}var x=QG.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function f(v){{for(var o=arguments.length,N0=Array(o>1?o-1:0),k0=1;k0<o;k0++)N0[k0-1]=arguments[k0];l("error",v,N0)}}function l(v,o,N0){{var k0=x.ReactDebugCurrentFrame,E0=k0.getStackAddendum();if(E0!=="")o+="%s",N0=N0.concat([E0]);var Q1=N0.map(function(a0){return String(a0)});Q1.unshift("Warning: "+o),Function.prototype.apply.call(console[v],console,Q1)}}var T=!1,m=!1,E=!1,D=!1,n=!1,c;c=Symbol.for("react.module.reference");function j(v){if(typeof v==="string"||typeof v==="function")return!0;if(v===B||v===G||n||v===K||v===F||v===b||D||v===R||T||m||E)return!0;if(typeof v==="object"&&v!==null){if(v.$$typeof===A||v.$$typeof===M||v.$$typeof===_||v.$$typeof===W||v.$$typeof===O||v.$$typeof===c||v.getModuleId!==void 0)return!0}return!1}function g(v,o,N0){var k0=v.displayName;if(k0)return k0;var E0=o.displayName||o.name||"";return E0!==""?N0+"("+E0+")":N0}function Q0(v){return v.displayName||"Context"}function r(v){if(v==null)return null;if(typeof v.tag==="number")f("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.");if(typeof v==="function")return v.displayName||v.name||null;if(typeof v==="string")return v;switch(v){case B:return"Fragment";case H:return"Portal";case G:return"Profiler";case K:return"StrictMode";case F:return"Suspense";case b:return"SuspenseList"}if(typeof v==="object")switch(v.$$typeof){case W:var o=v;return Q0(o)+".Consumer";case _:var N0=v;return Q0(N0._context)+".Provider";case O:return g(v,v.render,"ForwardRef");case M:var k0=v.displayName||null;if(k0!==null)return k0;return r(v.type)||"Memo";case A:{var E0=v,Q1=E0._payload,a0=E0._init;try{return r(a0(Q1))}catch(w0){return null}}}return null}var U0=Object.assign,R0=0,_0,f0,P0,a,Y0,B0,G0;function h0(){}h0.__reactDisabledLog=!0;function z0(){{if(R0===0){_0=console.log,f0=console.info,P0=console.warn,a=console.error,Y0=console.group,B0=console.groupCollapsed,G0=console.groupEnd;var v={configurable:!0,enumerable:!0,value:h0,writable:!0};Object.defineProperties(console,{info:v,log:v,warn:v,error:v,group:v,groupCollapsed:v,groupEnd:v})}R0++}}function v0(){{if(R0--,R0===0){var v={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:U0({},v,{value:_0}),info:U0({},v,{value:f0}),warn:U0({},v,{value:P0}),error:U0({},v,{value:a}),group:U0({},v,{value:Y0}),groupCollapsed:U0({},v,{value:B0}),groupEnd:U0({},v,{value:G0})})}if(R0<0)f("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var j0=x.ReactCurrentDispatcher,Y1;function m0(v,o,N0){{if(Y1===void 0)try{throw Error()}catch(E0){var k0=E0.stack.trim().match(/\n( *(at )?)/);Y1=k0&&k0[1]||""}return`
|
|
161
|
+
`+Y1+v}}var F1=!1,R1;{var p=typeof WeakMap==="function"?WeakMap:Map;R1=new p}function O0(v,o){if(!v||F1)return"";{var N0=R1.get(v);if(N0!==void 0)return N0}var k0;F1=!0;var E0=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var Q1;Q1=j0.current,j0.current=null,z0();try{if(o){var a0=function(){throw Error()};if(Object.defineProperty(a0.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==="object"&&Reflect.construct){try{Reflect.construct(a0,[])}catch(y4){k0=y4}Reflect.construct(v,[],a0)}else{try{a0.call()}catch(y4){k0=y4}v.call(a0.prototype)}}else{try{throw Error()}catch(y4){k0=y4}v()}}catch(y4){if(y4&&k0&&typeof y4.stack==="string"){var w0=y4.stack.split(`
|
|
162
|
+
`),D0=k0.stack.split(`
|
|
163
|
+
`),J1=w0.length-1,d1=D0.length-1;while(J1>=1&&d1>=0&&w0[J1]!==D0[d1])d1--;for(;J1>=1&&d1>=0;J1--,d1--)if(w0[J1]!==D0[d1]){if(J1!==1||d1!==1)do if(J1--,d1--,d1<0||w0[J1]!==D0[d1]){var K4=`
|
|
164
|
+
`+w0[J1].replace(" at new "," at ");if(v.displayName&&K4.includes("<anonymous>"))K4=K4.replace("<anonymous>",v.displayName);if(typeof v==="function")R1.set(v,K4);return K4}while(J1>=1&&d1>=0);break}}}finally{F1=!1,j0.current=Q1,v0(),Error.prepareStackTrace=E0}var e5=v?v.displayName||v.name:"",F6=e5?m0(e5):"";if(typeof v==="function")R1.set(v,F6);return F6}function V0(v,o,N0){return O0(v,!1)}function q1(v){var o=v.prototype;return!!(o&&o.isReactComponent)}function y1(v,o,N0){if(v==null)return"";if(typeof v==="function")return O0(v,q1(v));if(typeof v==="string")return m0(v);switch(v){case F:return m0("Suspense");case b:return m0("SuspenseList")}if(typeof v==="object")switch(v.$$typeof){case O:return V0(v.render);case M:return y1(v.type,o,N0);case A:{var k0=v,E0=k0._payload,Q1=k0._init;try{return y1(Q1(E0),o,N0)}catch(a0){}}}return""}var M1=Object.prototype.hasOwnProperty,A0={},Z1=x.ReactDebugCurrentFrame;function h1(v){if(v){var o=v._owner,N0=y1(v.type,v._source,o?o.type:null);Z1.setExtraStackFrame(N0)}else Z1.setExtraStackFrame(null)}function n1(v,o,N0,k0,E0){{var Q1=Function.call.bind(M1);for(var a0 in v)if(Q1(v,a0)){var w0=void 0;try{if(typeof v[a0]!=="function"){var D0=Error((k0||"React class")+": "+N0+" type `"+a0+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof v[a0]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw D0.name="Invariant Violation",D0}w0=v[a0](o,a0,k0,N0,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(J1){w0=J1}if(w0&&!(w0 instanceof Error))h1(E0),f("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",k0||"React class",N0,a0,typeof w0),h1(null);if(w0 instanceof Error&&!(w0.message in A0))A0[w0.message]=!0,h1(E0),f("Failed %s type: %s",N0,w0.message),h1(null)}}}var f4=Array.isArray;function B4(v){return f4(v)}function T5(v){{var o=typeof Symbol==="function"&&Symbol.toStringTag,N0=o&&v[Symbol.toStringTag]||v.constructor.name||"Object";return N0}}function A4(v){try{return k5(v),!1}catch(o){return!0}}function k5(v){return""+v}function h4(v){if(A4(v))return f("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",T5(v)),k5(v)}var D4=x.ReactCurrentOwner,M5={key:!0,ref:!0,__self:!0,__source:!0},x5,o4,X5;X5={};function g0(v){if(M1.call(v,"ref")){var o=Object.getOwnPropertyDescriptor(v,"ref").get;if(o&&o.isReactWarning)return!1}return v.ref!==void 0}function $1(v){if(M1.call(v,"key")){var o=Object.getOwnPropertyDescriptor(v,"key").get;if(o&&o.isReactWarning)return!1}return v.key!==void 0}function K1(v,o){if(typeof v.ref==="string"&&D4.current&&o&&D4.current.stateNode!==o){var N0=r(D4.current.type);if(!X5[N0])f('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',r(D4.current.type),v.ref),X5[N0]=!0}}function r1(v,o){{var N0=function(){if(!x5)x5=!0,f("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",o)};N0.isReactWarning=!0,Object.defineProperty(v,"key",{get:N0,configurable:!0})}}function U4(v,o){{var N0=function(){if(!o4)o4=!0,f("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",o)};N0.isReactWarning=!0,Object.defineProperty(v,"ref",{get:N0,configurable:!0})}}var x4=function(v,o,N0,k0,E0,Q1,a0){var w0={$$typeof:Y,type:v,key:o,ref:N0,props:a0,_owner:Q1};if(w0._store={},Object.defineProperty(w0._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(w0,"_self",{configurable:!1,enumerable:!1,writable:!1,value:k0}),Object.defineProperty(w0,"_source",{configurable:!1,enumerable:!1,writable:!1,value:E0}),Object.freeze)Object.freeze(w0.props),Object.freeze(w0);return w0};function w4(v,o,N0,k0,E0){{var Q1,a0={},w0=null,D0=null;if(N0!==void 0)h4(N0),w0=""+N0;if($1(o))h4(o.key),w0=""+o.key;if(g0(o))D0=o.ref,K1(o,E0);for(Q1 in o)if(M1.call(o,Q1)&&!M5.hasOwnProperty(Q1))a0[Q1]=o[Q1];if(v&&v.defaultProps){var J1=v.defaultProps;for(Q1 in J1)if(a0[Q1]===void 0)a0[Q1]=J1[Q1]}if(w0||D0){var d1=typeof v==="function"?v.displayName||v.name||"Unknown":v;if(w0)r1(a0,d1);if(D0)U4(a0,d1)}return x4(v,w0,D0,E0,k0,D4.current,a0)}}var{ReactCurrentOwner:z5,ReactDebugCurrentFrame:V1}=x;function S1(v){if(v){var o=v._owner,N0=y1(v.type,v._source,o?o.type:null);V1.setExtraStackFrame(N0)}else V1.setExtraStackFrame(null)}var t5=!1;function w5(v){return typeof v==="object"&&v!==null&&v.$$typeof===Y}function s5(){{if(z5.current){var v=r(z5.current.type);if(v)return`
|
|
165
|
+
|
|
166
|
+
Check the render method of \``+v+"`."}return""}}function q7(v){{if(v!==void 0){var o=v.fileName.replace(/^.*[\\\/]/,""),N0=v.lineNumber;return`
|
|
167
|
+
|
|
168
|
+
Check your code at `+o+":"+N0+"."}return""}}var d6={};function B7(v){{var o=s5();if(!o){var N0=typeof v==="string"?v:v.displayName||v.name;if(N0)o=`
|
|
169
|
+
|
|
170
|
+
Check the top-level render call using <`+N0+">."}return o}}function y6(v,o){{if(!v._store||v._store.validated||v.key!=null)return;v._store.validated=!0;var N0=B7(o);if(d6[N0])return;d6[N0]=!0;var k0="";if(v&&v._owner&&v._owner!==z5.current)k0=" It was passed a child from "+r(v._owner.type)+".";S1(v),f('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',N0,k0),S1(null)}}function p5(v,o){{if(typeof v!=="object")return;if(B4(v))for(var N0=0;N0<v.length;N0++){var k0=v[N0];if(w5(k0))y6(k0,o)}else if(w5(v)){if(v._store)v._store.validated=!0}else if(v){var E0=V(v);if(typeof E0==="function"){if(E0!==v.entries){var Q1=E0.call(v),a0;while(!(a0=Q1.next()).done)if(w5(a0.value))y6(a0.value,o)}}}}}function i6(v){{var o=v.type;if(o===null||o===void 0||typeof o==="string")return;var N0;if(typeof o==="function")N0=o.propTypes;else if(typeof o==="object"&&(o.$$typeof===O||o.$$typeof===M))N0=o.propTypes;else return;if(N0){var k0=r(o);n1(N0,v.props,"prop",k0,v)}else if(o.PropTypes!==void 0&&!t5){t5=!0;var E0=r(o);f("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",E0||"Unknown")}if(typeof o.getDefaultProps==="function"&&!o.getDefaultProps.isReactClassApproved)f("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function c1(v){{var o=Object.keys(v.props);for(var N0=0;N0<o.length;N0++){var k0=o[N0];if(k0!=="children"&&k0!=="key"){S1(v),f("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",k0),S1(null);break}}if(v.ref!==null)S1(v),f("Invalid attribute `ref` supplied to `React.Fragment`."),S1(null)}}var W4={};function b4(v,o,N0,k0,E0,Q1){{var a0=j(v);if(!a0){var w0="";if(v===void 0||typeof v==="object"&&v!==null&&Object.keys(v).length===0)w0+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.";var D0=q7(E0);if(D0)w0+=D0;else w0+=s5();var J1;if(v===null)J1="null";else if(B4(v))J1="array";else if(v!==void 0&&v.$$typeof===Y)J1="<"+(r(v.type)||"Unknown")+" />",w0=" Did you accidentally export a JSX literal instead of a component?";else J1=typeof v;f("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",J1,w0)}var d1=w4(v,o,N0,E0,Q1);if(d1==null)return d1;if(a0){var K4=o.children;if(K4!==void 0)if(k0)if(B4(K4)){for(var e5=0;e5<K4.length;e5++)p5(K4[e5],v);if(Object.freeze)Object.freeze(K4)}else f("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else p5(K4,v)}if(M1.call(o,"key")){var F6=r(v),y4=Object.keys(o).filter(function(U7){return U7!=="key"}),E1=y4.length>0?"{key: someKey, "+y4.join(": ..., ")+": ...}":"{key: someKey}";if(!W4[F6+E1]){var C7=y4.length>0?"{"+y4.join(": ..., ")+": ...}":"{}";f(`A props object containing a "key" prop is being spread into JSX:
|
|
171
|
+
let props = %s;
|
|
172
|
+
<%s {...props} />
|
|
173
|
+
React keys must be passed directly to JSX without using spread:
|
|
174
|
+
let props = %s;
|
|
175
|
+
<%s key={someKey} {...props} />`,E1,F6,C7,F6),W4[F6+E1]=!0}}if(v===B)c1(d1);else i6(d1);return d1}}function z4(v,o,N0){return b4(v,o,N0,!0)}function y(v,o,N0){return b4(v,o,N0,!1)}var W0=y,F0=z4;iA.Fragment=B,iA.jsx=W0,iA.jsxs=F0})()});var w6=H0(D1(),1),VO=H0(yK(),1);var xH={memory:!0,tasks:!1,vision:!0,operator:!1,mcp:!1,realtime:!1,files:!1,agents:!1,builtinTools:{webSearch:!1,webFetch:!1}};function F2(Y,H){let B=Y.agents;if(typeof B==="boolean")return{enabled:B,mode:"worker",group:H||void 0};return{...B,group:B.group||H||void 0}}var d4=H0(D1(),1),DK=H0(H1(),1),VK=d4.createContext(null),UA=200;function jH({children:Y}){let[H,B]=d4.useState(!1),[K,G]=d4.useState([]),[_,W]=d4.useState({}),[O,F]=d4.useState({}),[b,M]=d4.useState(0),[A,R]=d4.useState(0),k=d4.useRef(null),S=d4.useRef(null);d4.useEffect(()=>{let f=setInterval(()=>{let l=Date.now();F((T)=>{let m={};for(let[E,D]of Object.entries(T))if(D.expiresAt>l)m[E]=D;return m})},500);return()=>clearInterval(f)},[]);let V=d4.useCallback(()=>{if(k.current)k.current.close(),k.current=null;try{let f=new EventSource("/api/telemetry/stream");k.current=f,f.onopen=()=>{B(!0)},f.onmessage=(l)=>{if(!l.data||l.data.trim()==="")return;try{let T=JSON.parse(l.data);if(T.connected){B(!0);return}if(Array.isArray(T)){if(G((m)=>{return[...T,...m].slice(0,UA)}),W((m)=>{let E={...m};for(let D of T){let n=E[D.agent_id];if(!n||new Date(D.timestamp)>new Date(n.timestamp))E[D.agent_id]={timestamp:D.timestamp,category:D.category,type:D.type}}return E}),F((m)=>{let E={...m},D=Date.now()+3000;for(let n of T)E[n.agent_id]={type:n.type,expiresAt:D};return E}),T.some((m)=>m.category==="system"&&(m.type==="agent_started"||m.type==="agent_stopped")))M((m)=>m+1);if(T.some((m)=>m.category==="TASK"&&(m.type==="task_created"||m.type==="task_updated"||m.type==="task_deleted")))R((m)=>m+1)}}catch{}},f.onerror=()=>{if(B(!1),f.close(),k.current=null,S.current)clearTimeout(S.current);S.current=setTimeout(V,2000)}}catch{if(B(!1),S.current)clearTimeout(S.current);S.current=setTimeout(V,2000)}},[]);d4.useEffect(()=>{return V(),()=>{if(k.current)k.current.close();if(S.current)clearTimeout(S.current)}},[V]);let x=d4.useCallback(()=>{G([])},[]);return DK.jsxDEV(VK.Provider,{value:{connected:H,events:K,lastActivityByAgent:_,activeAgents:O,statusChangeCounter:b,taskChangeCounter:A,clearEvents:x},children:Y},void 0,!1,void 0,this)}function f6(){let Y=d4.useContext(VK);if(!Y)throw Error("useTelemetryContext must be used within TelemetryProvider");return Y}function b2(Y){let{connected:H,events:B,lastActivityByAgent:K}=f6(),G=d4.default.useMemo(()=>{let O=B;if(Y?.agent_id)O=O.filter((F)=>F.agent_id===Y.agent_id);if(Y?.category)O=O.filter((F)=>F.category===Y.category);if(Y?.limit)O=O.slice(0,Y.limit);return O},[B,Y?.agent_id,Y?.category,Y?.limit]),_=Y?.agent_id?K[Y.agent_id]:void 0,W=d4.default.useMemo(()=>{if(!_)return!1;let O=new Date(_.timestamp).getTime();return Date.now()-O<1e4},[_]);return{connected:H,events:G,lastActivity:_,isActive:W}}function P2(Y){let{activeAgents:H}=f6(),B=H[Y];return{isActive:!!B,type:B?.type}}function mX(){let{statusChangeCounter:Y}=f6();return Y}function lH(){let{taskChangeCounter:Y}=f6();return Y}var u4=H0(D1(),1),gK=H0(H1(),1),mK=u4.createContext(null);function A1(){let Y=u4.useContext(mK);if(!Y)throw Error("useAuth must be used within an AuthProvider");return Y}function cH({children:Y}){let[H,B]=u4.useState(null),[K,G]=u4.useState(null),[_,W]=u4.useState(!0),[O,F]=u4.useState(null),[b,M]=u4.useState(!1),A=u4.useRef(null),R=u4.useRef(!1),k=u4.useRef(!1),S=u4.useCallback((D)=>{A.current=D,G(D)},[]),V=u4.useCallback(async()=>{if(R.current)return!1;R.current=!0;try{let D=await fetch("/api/auth/refresh",{method:"POST",credentials:"include"});if(!D.ok)return!1;let n=await D.json();S(n.accessToken);let c=await fetch("/api/auth/me",{headers:{Authorization:`Bearer ${n.accessToken}`}});if(c.ok){let j=await c.json();return B(j.user),!0}return!1}catch(D){return console.error("Token refresh failed:",D),!1}finally{R.current=!1}},[S]),x=u4.useCallback(async()=>{try{let D=A.current,c=await(await fetch("/api/auth/check",{headers:D?{Authorization:`Bearer ${D}`}:{}})).json();if(F(c.hasUsers),M(c.isDev??!1),c.authenticated&&c.user)B(c.user);else if(B(null),c.hasUsers){if(!await V())S(null)}}catch(D){console.error("Auth check failed:",D),B(null),S(null)}finally{W(!1)}},[V,S]),f=u4.useCallback(async(D,n)=>{try{let c=await fetch("/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({username:D,password:n})}),j=await c.json();if(!c.ok)return{success:!1,error:j.error||"Login failed"};return S(j.accessToken),B(j.user),F(!0),{success:!0}}catch(c){return console.error("Login failed:",c),{success:!1,error:"Login failed"}}},[S]),l=u4.useCallback(async()=>{try{let D=A.current;await fetch("/api/auth/logout",{method:"POST",credentials:"include",headers:D?{Authorization:`Bearer ${D}`}:{}})}catch(D){console.error("Logout failed:",D)}finally{B(null),S(null)}},[S]),T=u4.useCallback(async(D,n={})=>{let c=new Headers(n.headers),j=A.current;if(j)c.set("Authorization",`Bearer ${j}`);return fetch(D,{...n,headers:c})},[]),m=u4.useCallback(async()=>{return V()},[V]);u4.useEffect(()=>{if(k.current)return;k.current=!0,x()},[x]),u4.useEffect(()=>{if(!K)return;let D=setInterval(()=>{V()},840000);return()=>clearInterval(D)},[K,V]);let E={user:H,isAuthenticated:!!H,isLoading:_,hasUsers:O,isDev:b,accessToken:K,login:f,logout:l,refreshToken:m,checkAuth:x,authFetch:T};return gK.jsxDEV(mK.Provider,{value:E,children:Y},void 0,!1,void 0,this)}var $5=H0(D1(),1);var EK=H0(H1(),1),uK=$5.createContext(null);function G4(){let Y=$5.useContext(uK);if(!Y)throw Error("useProjects must be used within a ProjectProvider");return Y}var dH="apteva_current_project";function iH({children:Y}){let{authFetch:H,isAuthenticated:B,isLoading:K}=A1(),[G,_]=$5.useState([]),[W,O]=$5.useState(()=>{if(typeof window<"u")return localStorage.getItem(dH);return null}),[F,b]=$5.useState(!0),[M,A]=$5.useState(null),[R,k]=$5.useState(0),[S,V]=$5.useState(!1);$5.useEffect(()=>{fetch("/api/features").then((n)=>n.json()).then((n)=>{V(n.projects===!0)}).catch(()=>{V(!1)})},[]);let x=$5.useCallback((n)=>{if(O(n),typeof window<"u")if(n===null)localStorage.removeItem(dH);else localStorage.setItem(dH,n)},[]),f=G.find((n)=>n.id===W)||null,l=$5.useCallback(async()=>{if(!S){_([]),b(!1);return}if(!B&&!K){_([]),b(!1);return}try{A(null);let n=await H("/api/projects");if(!n.ok)throw Error("Failed to fetch projects");let c=await n.json();if(_(c.projects||[]),k(c.unassignedCount||0),W&&W!=="unassigned"&&!c.projects.find((j)=>j.id===W))x(null)}catch(n){console.error("Failed to fetch projects:",n),A("Failed to load projects")}finally{b(!1)}},[H,B,K,W,x,S]),T=$5.useCallback(async(n)=>{try{let c=await H("/api/projects",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});if(!c.ok){let g=await c.json();throw Error(g.error||"Failed to create project")}let j=await c.json();return await l(),j.project}catch(c){return console.error("Failed to create project:",c),null}},[H,l]),m=$5.useCallback(async(n,c)=>{try{let j=await H(`/api/projects/${n}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(c)});if(!j.ok){let Q0=await j.json();throw Error(Q0.error||"Failed to update project")}let g=await j.json();return await l(),g.project}catch(j){return console.error("Failed to update project:",j),null}},[H,l]),E=$5.useCallback(async(n)=>{try{let c=await H(`/api/projects/${n}`,{method:"DELETE"});if(!c.ok){let j=await c.json();throw Error(j.error||"Failed to delete project")}if(W===n)x(null);return await l(),!0}catch(c){return console.error("Failed to delete project:",c),!1}},[H,W,x,l]);$5.useEffect(()=>{if(!K&&S)l()},[K,S,l]);let D={projects:G,currentProjectId:W,currentProject:f,isLoading:F,error:M,unassignedCount:R,projectsEnabled:S,setCurrentProjectId:x,createProject:T,updateProject:m,deleteProject:E,refreshProjects:l};return EK.jsxDEV(uK.Provider,{value:D,children:Y},void 0,!1,void 0,this)}var e7=H0(D1(),1);function oH(Y){let{accessToken:H}=A1(),[B,K]=e7.useState([]),[G,_]=e7.useState(!0),W=e7.useCallback(()=>{let S={"Content-Type":"application/json"};if(H)S.Authorization=`Bearer ${H}`;return S},[H]),O=e7.useCallback(async()=>{let V=await(await fetch("/api/agents",{headers:W()})).json();K(V.agents||[]),_(!1)},[W]),F=mX();e7.useEffect(()=>{if(Y&&F>0)O()},[Y,F,O]),e7.useEffect(()=>{if(Y)O()},[Y,O]);let b=async(S)=>{await fetch("/api/agents",{method:"POST",headers:W(),body:JSON.stringify(S)}),await O()},M=async(S)=>{await fetch(`/api/agents/${S}`,{method:"DELETE",headers:W()}),await O()},A=async(S,V)=>{let x=await fetch(`/api/agents/${S}`,{method:"PUT",headers:W(),body:JSON.stringify(V)}),f=await x.json();if(await O(),!x.ok&&f.error)return{error:f.error};return{}},R=async(S)=>{let V=S.status==="running"?"stop":"start",x=await fetch(`/api/agents/${S.id}/${V}`,{method:"POST",headers:W()}),f=await x.json();if(await O(),!x.ok&&f.error)return{error:f.error};return{}},k=B.filter((S)=>S.status==="running").length;return{agents:B,loading:G,runningCount:k,fetchAgents:O,createAgent:b,updateAgent:A,deleteAgent:M,toggleAgent:R}}var A2=H0(D1(),1);function aH(Y){let{accessToken:H}=A1(),[B,K]=A2.useState([]),G=A2.useCallback(()=>{let b={"Content-Type":"application/json"};if(H)b.Authorization=`Bearer ${H}`;return b},[H]),_=A2.useCallback(async()=>{let M=await(await fetch("/api/providers",{headers:G()})).json();K(M.providers||[])},[G]);A2.useEffect(()=>{if(Y)_()},[Y,_]);let W=B.filter((b)=>b.hasKey);return{providers:B,configuredProviders:W,fetchProviders:_,saveKey:async(b,M)=>{let R=await(await fetch(`/api/keys/${b}/test`,{method:"POST",headers:G(),body:JSON.stringify({key:M})})).json();if(!R.valid)return{success:!1,error:R.error||"API key is invalid"};let k=await fetch(`/api/keys/${b}`,{method:"POST",headers:G(),body:JSON.stringify({key:M})});if(!k.ok)return{success:!1,error:(await k.json()).error||"Failed to save key"};return await _(),{success:!0}},deleteKey:async(b)=>{await fetch(`/api/keys/${b}`,{method:"DELETE",headers:G()}),await _()}}}var I2=H0(D1(),1);function nH(){let{accessToken:Y,isAuthenticated:H}=A1(),[B,K]=I2.useState(null),G=I2.useCallback(()=>{let W={};if(Y)W.Authorization=`Bearer ${Y}`;return W},[Y]);I2.useEffect(()=>{if(!H){K(null);return}fetch("/api/onboarding/status",{headers:G()}).then((W)=>W.json()).then((W)=>{K(W.completed||W.has_any_keys)}).catch(()=>K(!0))},[H,G]);let _=I2.useCallback(async()=>{await fetch("/api/onboarding/complete",{method:"POST",headers:G()}),K(!0)},[G]);return{isComplete:B,setIsComplete:K,complete:_}}var V8=H0(H1(),1);function T2({message:Y="Loading...",fullScreen:H=!1}){let B=V8.jsxDEV("div",{className:"flex items-center gap-3 text-[#666]",children:[V8.jsxDEV("svg",{className:"animate-spin h-5 w-5",viewBox:"0 0 24 24",children:[V8.jsxDEV("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"},void 0,!1,void 0,this),V8.jsxDEV("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),V8.jsxDEV("span",{children:Y},void 0,!1,void 0,this)]},void 0,!0,void 0,this);if(H)return V8.jsxDEV("div",{className:"min-h-screen bg-[#0a0a0a] text-[#e0e0e0] font-mono flex items-center justify-center",children:B},void 0,!1,void 0,this);return V8.jsxDEV("div",{className:"flex items-center justify-center py-20",children:B},void 0,!1,void 0,this)}var z8=H0(D1(),1),L5=H0(H1(),1);function yz({children:Y,onClose:H}){return L5.jsxDEV("div",{className:"fixed inset-0 bg-black/70 flex items-center justify-center z-50 p-4",children:L5.jsxDEV("div",{className:"bg-[#111] rounded p-6 w-full max-w-xl lg:max-w-2xl border border-[#1a1a1a] max-h-[90vh] overflow-y-auto",children:Y},void 0,!1,void 0,this)},void 0,!1,void 0,this)}function WA({title:Y,message:H,confirmText:B="Confirm",cancelText:K="Cancel",confirmVariant:G="danger",onConfirm:_,onCancel:W}){return L5.jsxDEV("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4",children:L5.jsxDEV("div",{className:"bg-[#111] border border-[#333] rounded-lg p-6 w-full max-w-sm",children:[Y&&L5.jsxDEV("h3",{className:"font-medium mb-2",children:Y},void 0,!1,void 0,this),L5.jsxDEV("p",{className:"text-sm text-[#ccc] mb-4",children:H},void 0,!1,void 0,this),L5.jsxDEV("div",{className:"flex gap-2",children:[L5.jsxDEV("button",{onClick:W,className:"flex-1 text-sm bg-[#1a1a1a] hover:bg-[#222] border border-[#333] px-4 py-2 rounded transition",children:K},void 0,!1,void 0,this),L5.jsxDEV("button",{onClick:_,className:`flex-1 text-sm text-white px-4 py-2 rounded transition ${G==="danger"?"bg-red-500 hover:bg-red-600":"bg-[#f97316] hover:bg-[#ea580c]"}`,children:B},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}function KA({title:Y,message:H,buttonText:B="OK",variant:K="info",onClose:G}){let _={error:"bg-red-500/20 text-red-400",success:"bg-green-500/20 text-green-400",info:"bg-blue-500/20 text-blue-400"},W={error:"✕",success:"✓",info:"ℹ"};return L5.jsxDEV("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4",children:L5.jsxDEV("div",{className:"bg-[#111] border border-[#333] rounded-lg p-6 w-full max-w-sm text-center",children:[L5.jsxDEV("div",{className:`w-12 h-12 rounded-full flex items-center justify-center mx-auto mb-3 ${_[K]}`,children:L5.jsxDEV("span",{className:"text-xl",children:W[K]},void 0,!1,void 0,this)},void 0,!1,void 0,this),Y&&L5.jsxDEV("h3",{className:"font-medium mb-2",children:Y},void 0,!1,void 0,this),L5.jsxDEV("p",{className:"text-sm text-[#ccc] mb-4",children:H},void 0,!1,void 0,this),L5.jsxDEV("button",{onClick:G,className:"w-full text-sm bg-[#1a1a1a] hover:bg-[#222] border border-[#333] px-4 py-2 rounded transition",children:B},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}function a5(){let[Y,H]=z8.useState(null),B=z8.useCallback((W,O={})=>{return new Promise((F)=>{H({message:W,options:O,resolve:F})})},[]),K=z8.useCallback(()=>{Y?.resolve(!0),H(null)},[Y]),G=z8.useCallback(()=>{Y?.resolve(!1),H(null)},[Y]),_=Y?L5.jsxDEV(WA,{title:Y.options.title,message:Y.message,confirmText:Y.options.confirmText,cancelText:Y.options.cancelText,confirmVariant:Y.options.confirmVariant,onConfirm:K,onCancel:G},void 0,!1,void 0,this):null;return{confirm:B,ConfirmDialog:_}}function gX(){let[Y,H]=z8.useState(null),B=z8.useCallback((_,W={})=>{return new Promise((O)=>{H({message:_,options:W,resolve:O})})},[]),K=z8.useCallback(()=>{Y?.resolve(),H(null)},[Y]),G=Y?L5.jsxDEV(KA,{title:Y.options.title,message:Y.message,buttonText:Y.options.buttonText,variant:Y.options.variant,onClose:K},void 0,!1,void 0,this):null;return{alert:B,AlertDialog:G}}var Vz=H0(D1(),1),u5=H0(H1(),1);function t4({value:Y,options:H,onChange:B,placeholder:K="Select..."}){let[G,_]=Vz.useState(!1),W=Vz.useRef(null),O=H.find((F)=>F.value===Y);return Vz.useEffect(()=>{function F(b){if(W.current&&!W.current.contains(b.target))_(!1)}return document.addEventListener("mousedown",F),()=>document.removeEventListener("mousedown",F)},[]),u5.jsxDEV("div",{ref:W,className:"relative",children:[u5.jsxDEV("button",{type:"button",onClick:()=>_(!G),className:"w-full bg-[#0a0a0a] border border-[#222] rounded px-3 py-2 text-left flex items-center justify-between focus:outline-none focus:border-[#f97316] text-[#e0e0e0] hover:border-[#333] transition",children:[u5.jsxDEV("span",{className:O?"text-[#e0e0e0]":"text-[#666]",children:O?u5.jsxDEV(u5.Fragment,{children:[O.label,O.recommended&&u5.jsxDEV("span",{className:"text-[#f97316] text-xs ml-2",children:"(Recommended)"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):K},void 0,!1,void 0,this),u5.jsxDEV(OA,{isOpen:G},void 0,!1,void 0,this)]},void 0,!0,void 0,this),G&&u5.jsxDEV("div",{className:"absolute z-50 w-full min-w-max mt-1 bg-[#111] border border-[#222] rounded shadow-lg max-h-60 overflow-y-auto scrollbar-hide",children:H.map((F)=>u5.jsxDEV("button",{type:"button",onClick:()=>{B(F.value),_(!1)},className:`w-full px-3 py-2 text-left flex items-center justify-between hover:bg-[#1a1a1a] transition ${F.value===Y?"bg-[#1a1a1a] text-[#f97316]":"text-[#e0e0e0]"}`,children:[u5.jsxDEV("span",{children:[F.label,F.recommended&&u5.jsxDEV("span",{className:"text-[#f97316] text-xs ml-2",children:"(Recommended)"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.value===Y&&u5.jsxDEV("svg",{className:"w-4 h-4 text-[#f97316]",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:u5.jsxDEV("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},F.value,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function OA({isOpen:Y}){return u5.jsxDEV("svg",{className:`w-4 h-4 text-[#666] transition-transform ${Y?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:u5.jsxDEV("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"},void 0,!1,void 0,this)},void 0,!1,void 0,this)}var _1=H0(H1(),1);function n5({className:Y="w-4 h-4"}){return _1.jsxDEV("svg",{className:Y,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:_1.jsxDEV("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"},void 0,!1,void 0,this)},void 0,!1,void 0,this)}function L6({className:Y="w-5 h-5"}){return _1.jsxDEV("svg",{className:Y,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:_1.jsxDEV("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"},void 0,!1,void 0,this)},void 0,!1,void 0,this)}function UJ({className:Y="w-5 h-5"}){return _1.jsxDEV("svg",{className:Y,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:_1.jsxDEV("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 5a1 1 0 011-1h14a1 1 0 011 1v2a1 1 0 01-1 1H5a1 1 0 01-1-1V5zM4 13a1 1 0 011-1h6a1 1 0 011 1v6a1 1 0 01-1 1H5a1 1 0 01-1-1v-6zM16 13a1 1 0 011-1h2a1 1 0 011 1v6a1 1 0 01-1 1h-2a1 1 0 01-1-1v-6z"},void 0,!1,void 0,this)},void 0,!1,void 0,this)}function WJ({className:Y="w-5 h-5"}){return _1.jsxDEV("svg",{className:Y,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:_1.jsxDEV("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9.75 17L9 20l-1 1h8l-1-1-.75-3M3 13h18M5 17h14a2 2 0 002-2V5a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"},void 0,!1,void 0,this)},void 0,!1,void 0,this)}function KJ({className:Y="w-5 h-5"}){return _1.jsxDEV("svg",{className:Y,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[_1.jsxDEV("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"},void 0,!1,void 0,this),_1.jsxDEV("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function k2({className:Y="w-4 h-4"}){return _1.jsxDEV("svg",{className:Y,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:_1.jsxDEV("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9.663 17h4.673M12 3v1m6.364 1.636l-.707.707M21 12h-1M4 12H3m3.343-5.657l-.707-.707m2.828 9.9a5 5 0 117.072 0l-.548.547A3.374 3.374 0 0014 18.469V19a2 2 0 11-4 0v-.531c0-.895-.356-1.754-.988-2.386l-.548-.547z"},void 0,!1,void 0,this)},void 0,!1,void 0,this)}function j6({className:Y="w-4 h-4"}){return _1.jsxDEV("svg",{className:Y,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:_1.jsxDEV("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"},void 0,!1,void 0,this)},void 0,!1,void 0,this)}function C2({className:Y="w-4 h-4"}){return _1.jsxDEV("svg",{className:Y,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[_1.jsxDEV("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"},void 0,!1,void 0,this),_1.jsxDEV("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function v2({className:Y="w-4 h-4"}){return _1.jsxDEV("svg",{className:Y,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:_1.jsxDEV("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9.75 17L9 20l-1 1h8l-1-1-.75-3M3 13h18M5 17h14a2 2 0 002-2V5a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"},void 0,!1,void 0,this)},void 0,!1,void 0,this)}function l6({className:Y="w-4 h-4"}){return _1.jsxDEV("svg",{className:Y,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:_1.jsxDEV("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1"},void 0,!1,void 0,this)},void 0,!1,void 0,this)}function uX({className:Y="w-4 h-4"}){return _1.jsxDEV("svg",{className:Y,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:_1.jsxDEV("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9.663 17h4.673M12 3v1m6.364 1.636l-.707.707M21 12h-1M4 12H3m3.343-5.657l-.707-.707m2.828 9.9a5 5 0 117.072 0l-.548.547A3.374 3.374 0 0014 18.469V19a2 2 0 11-4 0v-.531c0-.895-.356-1.754-.988-2.386l-.548-.547z"},void 0,!1,void 0,this)},void 0,!1,void 0,this)}function S2({className:Y="w-4 h-4"}){return _1.jsxDEV("svg",{className:Y,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:_1.jsxDEV("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 11a7 7 0 01-7 7m0 0a7 7 0 01-7-7m7 7v4m0 0H8m4 0h4m-4-8a3 3 0 01-3-3V5a3 3 0 116 0v6a3 3 0 01-3 3z"},void 0,!1,void 0,this)},void 0,!1,void 0,this)}function rH({className:Y="w-4 h-4"}){return _1.jsxDEV("svg",{className:Y,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:_1.jsxDEV("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"},void 0,!1,void 0,this)},void 0,!1,void 0,this)}function xK({className:Y="w-4 h-4"}){return _1.jsxDEV("svg",{className:Y,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:_1.jsxDEV("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4"},void 0,!1,void 0,this)},void 0,!1,void 0,this)}function Dz({className:Y="w-4 h-4"}){return _1.jsxDEV("svg",{className:Y,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:_1.jsxDEV("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"},void 0,!1,void 0,this)},void 0,!1,void 0,this)}function mz({className:Y="w-4 h-4"}){return _1.jsxDEV("svg",{className:Y,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:_1.jsxDEV("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z"},void 0,!1,void 0,this)},void 0,!1,void 0,this)}function pK({className:Y="w-5 h-5"}){return _1.jsxDEV("svg",{className:Y,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:_1.jsxDEV("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"},void 0,!1,void 0,this)},void 0,!1,void 0,this)}function jK({className:Y="w-4 h-4"}){return _1.jsxDEV("svg",{className:Y,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:_1.jsxDEV("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"},void 0,!1,void 0,this)},void 0,!1,void 0,this)}function lK({className:Y="w-4 h-4"}){return _1.jsxDEV("svg",{className:Y,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:_1.jsxDEV("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"},void 0,!1,void 0,this)},void 0,!1,void 0,this)}function tH({className:Y="w-5 h-5"}){return _1.jsxDEV("svg",{className:Y,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:_1.jsxDEV("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 10V3L4 14h7v7l9-11h-7z"},void 0,!1,void 0,this)},void 0,!1,void 0,this)}function sH({className:Y="w-4 h-4"}){return _1.jsxDEV("svg",{className:Y,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:_1.jsxDEV("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"},void 0,!1,void 0,this)},void 0,!1,void 0,this)}function cK({className:Y="w-4 h-4"}){return _1.jsxDEV("svg",{className:Y,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[_1.jsxDEV("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h5M20 20v-5h-5"},void 0,!1,void 0,this),_1.jsxDEV("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M20.49 9A9 9 0 005.64 5.64L4 4m16 16l-1.64-1.64A9 9 0 013.51 15"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function dK({className:Y="w-4 h-4"}){return _1.jsxDEV("svg",{className:Y,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[_1.jsxDEV("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4l3 3"},void 0,!1,void 0,this),_1.jsxDEV("circle",{cx:"12",cy:"12",r:"9",strokeWidth:2},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function iK({className:Y="w-4 h-4"}){return _1.jsxDEV("svg",{className:Y,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[_1.jsxDEV("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"},void 0,!1,void 0,this),_1.jsxDEV("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 14l2 2 4-4"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}var UG=H0(D1(),1);var h6=H0(D1(),1);var q4=H0(D1(),1),xz=H0(D1(),1),h2=H0(D1(),1);function oK(Y){var H,B,K="";if(typeof Y=="string"||typeof Y=="number")K+=Y;else if(typeof Y=="object")if(Array.isArray(Y)){var G=Y.length;for(H=0;H<G;H++)Y[H]&&(B=oK(Y[H]))&&(K&&(K+=" "),K+=B)}else for(B in Y)Y[B]&&(K&&(K+=" "),K+=B);return K}function aK(){for(var Y,H,B=0,K="",G=arguments.length;B<G;B++)(Y=arguments[B])&&(H=oK(Y))&&(K&&(K+=" "),K+=H);return K}var _A=(Y)=>{let H=NA(Y),{conflictingClassGroups:B,conflictingClassGroupModifiers:K}=Y;return{getClassGroupId:(W)=>{let O=W.split("-");if(O[0]===""&&O.length!==1)O.shift();return tK(O,H)||LA(W)},getConflictingClassGroupIds:(W,O)=>{let F=B[W]||[];if(O&&K[W])return[...F,...K[W]];return F}}},tK=(Y,H)=>{if(Y.length===0)return H.classGroupId;let B=Y[0],K=H.nextPart.get(B),G=K?tK(Y.slice(1),K):void 0;if(G)return G;if(H.validators.length===0)return;let _=Y.join("-");return H.validators.find(({validator:W})=>W(_))?.classGroupId},nK=/^\[(.+)\]$/,LA=(Y)=>{if(nK.test(Y)){let H=nK.exec(Y)[1],B=H?.substring(0,H.indexOf(":"));if(B)return"arbitrary.."+B}},NA=(Y)=>{let{theme:H,prefix:B}=Y,K={nextPart:new Map,validators:[]};return MA(Object.entries(Y.classGroups),B).forEach(([_,W])=>{zG(W,K,_,H)}),K},zG=(Y,H,B,K)=>{Y.forEach((G)=>{if(typeof G==="string"){let _=G===""?H:rK(H,G);_.classGroupId=B;return}if(typeof G==="function"){if(RA(G)){zG(G(K),H,B,K);return}H.validators.push({validator:G,classGroupId:B});return}Object.entries(G).forEach(([_,W])=>{zG(W,rK(H,_),B,K)})})},rK=(Y,H)=>{let B=Y;return H.split("-").forEach((K)=>{if(!B.nextPart.has(K))B.nextPart.set(K,{nextPart:new Map,validators:[]});B=B.nextPart.get(K)}),B},RA=(Y)=>Y.isThemeGetter,MA=(Y,H)=>{if(!H)return Y;return Y.map(([B,K])=>{let G=K.map((_)=>{if(typeof _==="string")return H+_;if(typeof _==="object")return Object.fromEntries(Object.entries(_).map(([W,O])=>[H+W,O]));return _});return[B,G]})},wA=(Y)=>{if(Y<1)return{get:()=>{return},set:()=>{}};let H=0,B=new Map,K=new Map,G=(_,W)=>{if(B.set(_,W),H++,H>Y)H=0,K=B,B=new Map};return{get(_){let W=B.get(_);if(W!==void 0)return W;if((W=K.get(_))!==void 0)return G(_,W),W},set(_,W){if(B.has(_))B.set(_,W);else G(_,W)}}};var FA=(Y)=>{let{separator:H,experimentalParseClassName:B}=Y,K=H.length===1,G=H[0],_=H.length,W=(O)=>{let F=[],b=0,M=0,A;for(let x=0;x<O.length;x++){let f=O[x];if(b===0){if(f===G&&(K||O.slice(x,x+_)===H)){F.push(O.slice(M,x)),M=x+_;continue}if(f==="/"){A=x;continue}}if(f==="[")b++;else if(f==="]")b--}let R=F.length===0?O:O.substring(M),k=R.startsWith("!"),S=k?R.substring(1):R,V=A&&A>M?A-M:void 0;return{modifiers:F,hasImportantModifier:k,baseClassName:S,maybePostfixModifierPosition:V}};if(B)return(O)=>B({className:O,parseClassName:W});return W},bA=(Y)=>{if(Y.length<=1)return Y;let H=[],B=[];return Y.forEach((K)=>{if(K[0]==="[")H.push(...B.sort(),K),B=[];else B.push(K)}),H.push(...B.sort()),H},PA=(Y)=>({cache:wA(Y.cacheSize),parseClassName:FA(Y),..._A(Y)}),AA=/\s+/,IA=(Y,H)=>{let{parseClassName:B,getClassGroupId:K,getConflictingClassGroupIds:G}=H,_=[],W=Y.trim().split(AA),O="";for(let F=W.length-1;F>=0;F-=1){let b=W[F],{modifiers:M,hasImportantModifier:A,baseClassName:R,maybePostfixModifierPosition:k}=B(b),S=Boolean(k),V=K(S?R.substring(0,k):R);if(!V){if(!S){O=b+(O.length>0?" "+O:O);continue}if(V=K(R),!V){O=b+(O.length>0?" "+O:O);continue}S=!1}let x=bA(M).join(":"),f=A?x+"!":x,l=f+V;if(_.includes(l))continue;_.push(l);let T=G(V,S);for(let m=0;m<T.length;++m){let E=T[m];_.push(f+E)}O=b+(O.length>0?" "+O:O)}return O};function TA(){let Y=0,H,B,K="";while(Y<arguments.length)if(H=arguments[Y++]){if(B=sK(H))K&&(K+=" "),K+=B}return K}var sK=(Y)=>{if(typeof Y==="string")return Y;let H,B="";for(let K=0;K<Y.length;K++)if(Y[K]){if(H=sK(Y[K]))B&&(B+=" "),B+=H}return B};function kA(Y,...H){let B,K,G,_=W;function W(F){let b=H.reduce((M,A)=>A(M),Y());return B=PA(b),K=B.cache.get,G=B.cache.set,_=O,O(F)}function O(F){let b=K(F);if(b)return b;let M=IA(F,B);return G(F,M),M}return function(){return _(TA.apply(null,arguments))}}var E4=(Y)=>{let H=(B)=>B[Y]||[];return H.isThemeGetter=!0,H},eK=/^\[(?:([a-z-]+):)?(.+)\]$/i,CA=/^\d+\/\d+$/,vA=new Set(["px","full","screen"]),SA=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,fA=/\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$/,hA=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,yA=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,VA=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Q8=(Y)=>gz(Y)||vA.has(Y)||CA.test(Y),D8=(Y)=>uz(Y,"length",jA),gz=(Y)=>Boolean(Y)&&!Number.isNaN(Number(Y)),eH=(Y)=>uz(Y,"number",gz),EX=(Y)=>Boolean(Y)&&Number.isInteger(Number(Y)),DA=(Y)=>Y.endsWith("%")&&gz(Y.slice(0,-1)),x1=(Y)=>eK.test(Y),m8=(Y)=>SA.test(Y),mA=new Set(["length","size","percentage"]),gA=(Y)=>uz(Y,mA,zO),uA=(Y)=>uz(Y,"position",zO),EA=new Set(["image","url"]),xA=(Y)=>uz(Y,EA,cA),pA=(Y)=>uz(Y,"",lA),xX=()=>!0,uz=(Y,H,B)=>{let K=eK.exec(Y);if(K){if(K[1])return typeof H==="string"?K[1]===H:H.has(K[1]);return B(K[2])}return!1},jA=(Y)=>fA.test(Y)&&!hA.test(Y),zO=()=>!1,lA=(Y)=>yA.test(Y),cA=(Y)=>VA.test(Y);var dA=()=>{let Y=E4("colors"),H=E4("spacing"),B=E4("blur"),K=E4("brightness"),G=E4("borderColor"),_=E4("borderRadius"),W=E4("borderSpacing"),O=E4("borderWidth"),F=E4("contrast"),b=E4("grayscale"),M=E4("hueRotate"),A=E4("invert"),R=E4("gap"),k=E4("gradientColorStops"),S=E4("gradientColorStopPositions"),V=E4("inset"),x=E4("margin"),f=E4("opacity"),l=E4("padding"),T=E4("saturate"),m=E4("scale"),E=E4("sepia"),D=E4("skew"),n=E4("space"),c=E4("translate"),j=()=>["auto","contain","none"],g=()=>["auto","hidden","clip","visible","scroll"],Q0=()=>["auto",x1,H],r=()=>[x1,H],U0=()=>["",Q8,D8],R0=()=>["auto",gz,x1],_0=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],f0=()=>["solid","dashed","dotted","double","none"],P0=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],a=()=>["start","end","center","between","around","evenly","stretch"],Y0=()=>["","0",x1],B0=()=>["auto","avoid","all","avoid-page","page","left","right","column"],G0=()=>[gz,x1];return{cacheSize:500,separator:":",theme:{colors:[xX],spacing:[Q8,D8],blur:["none","",m8,x1],brightness:G0(),borderColor:[Y],borderRadius:["none","","full",m8,x1],borderSpacing:r(),borderWidth:U0(),contrast:G0(),grayscale:Y0(),hueRotate:G0(),invert:Y0(),gap:r(),gradientColorStops:[Y],gradientColorStopPositions:[DA,D8],inset:Q0(),margin:Q0(),opacity:G0(),padding:r(),saturate:G0(),scale:G0(),sepia:Y0(),skew:G0(),space:r(),translate:r()},classGroups:{aspect:[{aspect:["auto","square","video",x1]}],container:["container"],columns:[{columns:[m8]}],"break-after":[{"break-after":B0()}],"break-before":[{"break-before":B0()}],"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"],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:[..._0(),x1]}],overflow:[{overflow:g()}],"overflow-x":[{"overflow-x":g()}],"overflow-y":[{"overflow-y":g()}],overscroll:[{overscroll:j()}],"overscroll-x":[{"overscroll-x":j()}],"overscroll-y":[{"overscroll-y":j()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[V]}],"inset-x":[{"inset-x":[V]}],"inset-y":[{"inset-y":[V]}],start:[{start:[V]}],end:[{end:[V]}],top:[{top:[V]}],right:[{right:[V]}],bottom:[{bottom:[V]}],left:[{left:[V]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",EX,x1]}],basis:[{basis:Q0()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",x1]}],grow:[{grow:Y0()}],shrink:[{shrink:Y0()}],order:[{order:["first","last","none",EX,x1]}],"grid-cols":[{"grid-cols":[xX]}],"col-start-end":[{col:["auto",{span:["full",EX,x1]},x1]}],"col-start":[{"col-start":R0()}],"col-end":[{"col-end":R0()}],"grid-rows":[{"grid-rows":[xX]}],"row-start-end":[{row:["auto",{span:[EX,x1]},x1]}],"row-start":[{"row-start":R0()}],"row-end":[{"row-end":R0()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",x1]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",x1]}],gap:[{gap:[R]}],"gap-x":[{"gap-x":[R]}],"gap-y":[{"gap-y":[R]}],"justify-content":[{justify:["normal",...a()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...a(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...a(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[l]}],px:[{px:[l]}],py:[{py:[l]}],ps:[{ps:[l]}],pe:[{pe:[l]}],pt:[{pt:[l]}],pr:[{pr:[l]}],pb:[{pb:[l]}],pl:[{pl:[l]}],m:[{m:[x]}],mx:[{mx:[x]}],my:[{my:[x]}],ms:[{ms:[x]}],me:[{me:[x]}],mt:[{mt:[x]}],mr:[{mr:[x]}],mb:[{mb:[x]}],ml:[{ml:[x]}],"space-x":[{"space-x":[n]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[n]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",x1,H]}],"min-w":[{"min-w":[x1,H,"min","max","fit"]}],"max-w":[{"max-w":[x1,H,"none","full","min","max","fit","prose",{screen:[m8]},m8]}],h:[{h:[x1,H,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[x1,H,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[x1,H,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[x1,H,"auto","min","max","fit"]}],"font-size":[{text:["base",m8,D8]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",eH]}],"font-family":[{font:[xX]}],"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:["tighter","tight","normal","wide","wider","widest",x1]}],"line-clamp":[{"line-clamp":["none",gz,eH]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Q8,x1]}],"list-image":[{"list-image":["none",x1]}],"list-style-type":[{list:["none","disc","decimal",x1]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[Y]}],"placeholder-opacity":[{"placeholder-opacity":[f]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[Y]}],"text-opacity":[{"text-opacity":[f]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...f0(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Q8,D8]}],"underline-offset":[{"underline-offset":["auto",Q8,x1]}],"text-decoration-color":[{decoration:[Y]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:r()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",x1]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",x1]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[f]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[..._0(),uA]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",gA]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},xA]}],"bg-color":[{bg:[Y]}],"gradient-from-pos":[{from:[S]}],"gradient-via-pos":[{via:[S]}],"gradient-to-pos":[{to:[S]}],"gradient-from":[{from:[k]}],"gradient-via":[{via:[k]}],"gradient-to":[{to:[k]}],rounded:[{rounded:[_]}],"rounded-s":[{"rounded-s":[_]}],"rounded-e":[{"rounded-e":[_]}],"rounded-t":[{"rounded-t":[_]}],"rounded-r":[{"rounded-r":[_]}],"rounded-b":[{"rounded-b":[_]}],"rounded-l":[{"rounded-l":[_]}],"rounded-ss":[{"rounded-ss":[_]}],"rounded-se":[{"rounded-se":[_]}],"rounded-ee":[{"rounded-ee":[_]}],"rounded-es":[{"rounded-es":[_]}],"rounded-tl":[{"rounded-tl":[_]}],"rounded-tr":[{"rounded-tr":[_]}],"rounded-br":[{"rounded-br":[_]}],"rounded-bl":[{"rounded-bl":[_]}],"border-w":[{border:[O]}],"border-w-x":[{"border-x":[O]}],"border-w-y":[{"border-y":[O]}],"border-w-s":[{"border-s":[O]}],"border-w-e":[{"border-e":[O]}],"border-w-t":[{"border-t":[O]}],"border-w-r":[{"border-r":[O]}],"border-w-b":[{"border-b":[O]}],"border-w-l":[{"border-l":[O]}],"border-opacity":[{"border-opacity":[f]}],"border-style":[{border:[...f0(),"hidden"]}],"divide-x":[{"divide-x":[O]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[O]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[f]}],"divide-style":[{divide:f0()}],"border-color":[{border:[G]}],"border-color-x":[{"border-x":[G]}],"border-color-y":[{"border-y":[G]}],"border-color-s":[{"border-s":[G]}],"border-color-e":[{"border-e":[G]}],"border-color-t":[{"border-t":[G]}],"border-color-r":[{"border-r":[G]}],"border-color-b":[{"border-b":[G]}],"border-color-l":[{"border-l":[G]}],"divide-color":[{divide:[G]}],"outline-style":[{outline:["",...f0()]}],"outline-offset":[{"outline-offset":[Q8,x1]}],"outline-w":[{outline:[Q8,D8]}],"outline-color":[{outline:[Y]}],"ring-w":[{ring:U0()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[Y]}],"ring-opacity":[{"ring-opacity":[f]}],"ring-offset-w":[{"ring-offset":[Q8,D8]}],"ring-offset-color":[{"ring-offset":[Y]}],shadow:[{shadow:["","inner","none",m8,pA]}],"shadow-color":[{shadow:[xX]}],opacity:[{opacity:[f]}],"mix-blend":[{"mix-blend":[...P0(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":P0()}],filter:[{filter:["","none"]}],blur:[{blur:[B]}],brightness:[{brightness:[K]}],contrast:[{contrast:[F]}],"drop-shadow":[{"drop-shadow":["","none",m8,x1]}],grayscale:[{grayscale:[b]}],"hue-rotate":[{"hue-rotate":[M]}],invert:[{invert:[A]}],saturate:[{saturate:[T]}],sepia:[{sepia:[E]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[B]}],"backdrop-brightness":[{"backdrop-brightness":[K]}],"backdrop-contrast":[{"backdrop-contrast":[F]}],"backdrop-grayscale":[{"backdrop-grayscale":[b]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[M]}],"backdrop-invert":[{"backdrop-invert":[A]}],"backdrop-opacity":[{"backdrop-opacity":[f]}],"backdrop-saturate":[{"backdrop-saturate":[T]}],"backdrop-sepia":[{"backdrop-sepia":[E]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[W]}],"border-spacing-x":[{"border-spacing-x":[W]}],"border-spacing-y":[{"border-spacing-y":[W]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",x1]}],duration:[{duration:G0()}],ease:[{ease:["linear","in","out","in-out",x1]}],delay:[{delay:G0()}],animate:[{animate:["none","spin","ping","pulse","bounce",x1]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[m]}],"scale-x":[{"scale-x":[m]}],"scale-y":[{"scale-y":[m]}],rotate:[{rotate:[EX,x1]}],"translate-x":[{"translate-x":[c]}],"translate-y":[{"translate-y":[c]}],"skew-x":[{"skew-x":[D]}],"skew-y":[{"skew-y":[D]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",x1]}],accent:[{accent:["auto",Y]}],appearance:[{appearance:["none","auto"]}],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",x1]}],"caret-color":[{caret:[Y]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":r()}],"scroll-mx":[{"scroll-mx":r()}],"scroll-my":[{"scroll-my":r()}],"scroll-ms":[{"scroll-ms":r()}],"scroll-me":[{"scroll-me":r()}],"scroll-mt":[{"scroll-mt":r()}],"scroll-mr":[{"scroll-mr":r()}],"scroll-mb":[{"scroll-mb":r()}],"scroll-ml":[{"scroll-ml":r()}],"scroll-p":[{"scroll-p":r()}],"scroll-px":[{"scroll-px":r()}],"scroll-py":[{"scroll-py":r()}],"scroll-ps":[{"scroll-ps":r()}],"scroll-pe":[{"scroll-pe":r()}],"scroll-pt":[{"scroll-pt":r()}],"scroll-pr":[{"scroll-pr":r()}],"scroll-pb":[{"scroll-pb":r()}],"scroll-pl":[{"scroll-pl":r()}],"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",x1]}],fill:[{fill:[Y,"none"]}],"stroke-w":[{stroke:[Q8,D8,eH]}],stroke:[{stroke:[Y,"none"]}],sr:["sr-only","not-sr-only"],"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-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-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"],"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"]}}};var QO=kA(dA);var qO=H0(D1(),1),G7=H0(C4(),1),pz=H0(D1(),1),E5=H0(C4(),1),BO=H0(C4(),1),$G=H0(C4(),1),jz=H0(D1(),1),s4=H0(C4(),1),UO=H0(D1(),1),N5=H0(C4(),1),jX=H0(C4(),1),u0=H0(C4(),1),N6=H0(C4(),1),GG=H0(C4(),1),B1=H0(C4(),1),p4=H0(C4(),1),Y4=H0(C4(),1),o0=H0(C4(),1),v1=H0(C4(),1),pX=H0(C4(),1),T7=H0(D1(),1),I1=H0(C4(),1),Z8=H0(D1(),1),z1=H0(C4(),1),H6=H0(C4(),1),VI=H0(D1(),1),WO=H0(C4(),1),qG=H0(D1(),1),BG=H0(C4(),1),DI=H0(D1(),1),KO=H0(C4(),1),OO=H0(D1(),1),_O=H0(C4(),1),mI=H0(D1(),1),LO=H0(C4(),1),NO=H0(C4(),1),RO=H0(C4(),1),oA=Object.defineProperty,aA=(Y,H,B)=>(H in Y)?oA(Y,H,{enumerable:!0,configurable:!0,writable:!0,value:B}):Y[H]=B,nA=(Y,H,B)=>aA(Y,typeof H!=="symbol"?H+"":H,B);function P4(...Y){return QO(aK(Y))}var Jv=[{id:"msg-1",role:"assistant",content:"Hello! I'm your AI assistant. How can I help you today?",timestamp:new Date(Date.now()-3600000)},{id:"msg-2",role:"user",content:"I want to plan a trip to Europe",timestamp:new Date(Date.now()-3500000)},{id:"msg-3",role:"assistant",content:"Great choice! Europe has amazing destinations. What's your budget and how many days do you have?",timestamp:new Date(Date.now()-3400000)},{id:"msg-4",role:"user",content:"Around $2000 for 5 days",timestamp:new Date(Date.now()-3300000)},{id:"msg-5",role:"assistant",content:"Perfect! I found some great destinations that fit your budget:",widgets:[{type:"list",id:"destinations-1",props:{items:[{id:"paris",title:"Paris, France",subtitle:"5 days • $1,850",description:"The City of Light with iconic landmarks",metadata:{city:"Paris",country:"France",lat:48.8566,lng:2.3522,price:1850,days:5}},{id:"rome",title:"Rome, Italy",subtitle:"5 days • $1,650",description:"Ancient history meets modern culture",metadata:{city:"Rome",country:"Italy",lat:41.9028,lng:12.4964,price:1650,days:5}},{id:"barcelona",title:"Barcelona, Spain",subtitle:"5 days • $1,450",description:"Beautiful beaches and Gaudí architecture",metadata:{city:"Barcelona",country:"Spain",lat:41.3851,lng:2.1734,price:1450,days:5}}]},actions:[{type:"select_destination",label:"Select",handler:"client",payload:{}},{type:"view_details",label:"Details",handler:"server",payload:{}}]}],timestamp:new Date(Date.now()-3200000)}],Yv=[{id:"thread-1",title:"Trip to Europe",preview:"Planning a 5-day trip...",createdAt:new Date(Date.now()-86400000),updatedAt:new Date(Date.now()-3600000),messageCount:12},{id:"thread-2",title:"Restaurant Recommendations",preview:"Looking for good places...",createdAt:new Date(Date.now()-172800000),updatedAt:new Date(Date.now()-86400000),messageCount:8},{id:"thread-3",title:"Budget Planning",preview:"Help with monthly budget",createdAt:new Date(Date.now()-259200000),updatedAt:new Date(Date.now()-172800000),messageCount:15}];function rA(Y=1000){return new Promise((H)=>{setTimeout(()=>{H({id:`msg-${Date.now()}`,role:"assistant",content:"This is a mock response. In production, this would come from your AI agent API.",timestamp:new Date})},Y)})}function tA(Y){let H=Y.toLowerCase();if(H.includes("analyze")||H.includes("analysis"))return`Analysis complete for "${Y}". Found 247 records with an average value of $1,234. The data shows a 23% increase compared to last quarter. Key insights: Revenue is up, customer satisfaction improved by 15%, and operational costs decreased by 8%.`;if(H.includes("sales")||H.includes("revenue"))return"Sales data processed: Q4 2024 revenue reached $2.4M, representing 18% growth year-over-year. Top performing products: Enterprise Plan (+45%), Pro Plan (+32%), Basic Plan (+12%). Regional breakdown: North America (52%), Europe (31%), APAC (17%).";if(H.includes("report")||H.includes("summary"))return"Report generated successfully. Executive Summary: Overall performance exceeded targets by 12%. Marketing ROI improved to 3.2x, customer acquisition cost reduced by 18%, and lifetime value increased by 24%. Detailed breakdown available in attached widgets.";if(H.includes("data")||H.includes("metrics"))return"Data metrics retrieved: 1,847 active users, 12,394 sessions this month, 94.2% uptime, average response time 127ms. Performance is within acceptable parameters. No critical issues detected.";if(H.includes("customer")||H.includes("user"))return"Customer analysis complete: 523 new customers this month, 89% retention rate, average satisfaction score 4.6/5. Top feedback themes: excellent support (87%), easy to use (72%), good value (68%). 3 support tickets pending review.";return"This is a mock response showing how your agent would process and respond to commands. The actual response would be generated by your AI agent based on real data and context."}function sA(Y){let H=tA(Y),B=Y.toLowerCase(),K=[],G;if(B.includes("sales")||B.includes("revenue")||B.includes("analyze"))K.push({type:"card",id:`widget-${Date.now()}-1`,props:{title:"Q4 2024 Performance",description:"Revenue: $2.4M (+18% YoY)",footer:"Updated: "+new Date().toLocaleDateString()},actions:[{type:"view_details",label:"View Details",handler:"client",payload:{reportId:"q4-2024"}}]});if(B.includes("customer")||B.includes("user"))K.push({type:"list",id:`widget-${Date.now()}-2`,props:{items:[{id:"metric-1",title:"Active Users",subtitle:"1,847 users",description:"+12% from last month"},{id:"metric-2",title:"Retention Rate",subtitle:"89%",description:"Above industry average"},{id:"metric-3",title:"Satisfaction Score",subtitle:"4.6/5",description:"Based on 234 reviews"}]}});if(B.includes("task")||B.includes("todo")||B.includes("work")||B.includes("completed"))K.push({type:"list",id:`widget-${Date.now()}-tasks`,props:{items:[{id:"task-1",title:"Implement user authentication",subtitle:"Created just now",description:"Added OAuth 2.0 support with Google and GitHub providers",backgroundColor:"rgba(59, 130, 246, 0.15)",metadata:{status:"created",priority:"high",tags:["backend","security"]}},{id:"task-2",title:"Update API documentation",subtitle:"Modified 2 minutes ago",description:"Changed endpoint descriptions and added new examples",backgroundColor:"rgba(234, 179, 8, 0.15)",metadata:{status:"modified",priority:"medium",tags:["docs"]}},{id:"task-3",title:"Fix login redirect bug",subtitle:"Completed 5 minutes ago",description:"Users now properly redirected after successful login",backgroundColor:"rgba(34, 197, 94, 0.15)",metadata:{status:"completed",priority:"urgent",tags:["bugfix","auth"]}}]},actions:[{type:"view_task",label:"View",handler:"client",payload:{}},{type:"undo",label:"Undo",handler:"server",payload:{}}]}),G={type:"update_database",payload:{table:"tasks",operation:"mark_as_viewed",taskIds:["task-1","task-2","task-3"],timestamp:new Date().toISOString()}};if(B.includes("analyze")||B.includes("analysis"))G={type:"send_notification",payload:{recipient:"team@company.com",subject:"Analysis Complete",message:"Your requested analysis has been completed and is ready for review."}};return{message:H,widgets:K,action:G}}function eA(Y,H,B,K,G=30){let{message:_,widgets:W}=sA(Y),O=_.split(" "),F=0,b=setInterval(()=>{try{if(F<O.length)H({type:"token",content:O[F]+" "}),F++;else{clearInterval(b),W.forEach((A)=>{H({type:"widget",widget:A})});let M=`mock_thread_${Date.now()}`;H({type:"complete"}),B(M)}}catch(M){clearInterval(b),K(M instanceof Error?M:Error("Mock streaming error"))}},G)}function zI(Y){return new Promise((H,B)=>{let K=new FileReader;K.onload=()=>{let _=K.result.split(",")[1];H(_)},K.onerror=()=>B(Error("Failed to read file")),K.readAsDataURL(Y)})}function QI(Y){if(Y.startsWith("image/"))return"image";return"document"}function XI(Y){return["image/jpeg","image/png","image/gif","image/webp","application/pdf","text/plain","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document"].includes(Y.type)}async function ZI(Y){let H=await zI(Y);return{type:QI(Y.type),source:{type:"base64",media_type:Y.type,data:H}}}async function JI(Y){let H=Array.from(Y);return await Promise.all(H.map((K)=>ZI(K)))}async function XO(Y,H){if(!H||H.length===0)return Y;let B=[];if(Y.trim())B.push({type:"text",text:Y.trim()});let K=await JI(H);return B.push(...K),B}function _J(Y){if(Y<1024)return`${Y} B`;if(Y<1048576)return`${(Y/1024).toFixed(1)} KB`;return`${(Y/1048576).toFixed(1)} MB`}var ZO=10485760;function $O(Y){if(!XI(Y))return{valid:!1,error:`Unsupported file type: ${Y.type}`};if(Y.size>ZO)return{valid:!1,error:`File too large: ${_J(Y.size)} (max ${_J(ZO)})`};return{valid:!0}}var YI=["list","table"];function $I(Y){let H=[],B=!1,K=Y.match(/"items"\s*:\s*\[/);if(!K)return{items:H,isStreaming:!1};let G=Y.indexOf("[",K.index);if(G===-1)return{items:H,isStreaming:!0};let _=0,W=!1,O=!1,F=-1;for(let A=G+1;A<Y.length;A++){let R=Y[A];if(O){O=!1;continue}if(R==="\\"&&W){O=!0;continue}if(R==='"'){W=!W;continue}if(W)continue;if(R==="{"){if(_===0)F=A;_++}else if(R==="}"){if(_--,_===0&&F!==-1){let k=Y.slice(F,A+1);try{let S=JSON.parse(k);if(!S.id)S.id=`item-${H.length}-${JG(k)}`;H.push(S)}catch(S){}F=-1}}else if(R==="]"&&_===0){B=!1;break}}if(_>0||F!==-1)B=!0;let b=Y.slice(G);if(YG(b,0)===-1)B=!0;return{items:H,isStreaming:B}}function JG(Y){let H=0;for(let B=0;B<Y.length;B++){let K=Y.charCodeAt(B);H=(H<<5)-H+K,H=H&H}return Math.abs(H).toString(36)}function YG(Y,H){let B=0,K=!1,G=!1;for(let _=H;_<Y.length;_++){let W=Y[_];if(G){G=!1;continue}if(W==="\\"&&K){G=!0;continue}if(W==='"'){K=!K;continue}if(K)continue;if(W==="["||W==="{")B++;else if(W==="]"||W==="}"){if(B--,B===0)return _}}return-1}function OJ(Y){let H=[],B=!1,K=!1,G=0,_=null,W=Y,O=Y.lastIndexOf("@ui:");if(O!==-1){let M=Y.slice(O),A=M.match(/^@ui:(\w+)/);if(A){let R=A[1],k=M.indexOf("[");if(k===-1)W=Y.slice(0,O),_=R,K=!0;else{let S=O+k;if(YG(Y,S)===-1)if(YI.includes(R)){let x=Y.slice(S+1),{items:f,isStreaming:l}=$I(x);if(f.length>0){W=Y.slice(0,O);let T=`widget-${R}-streaming-${JG(x)}`,m=W.replace(/[\s:;\-–—\.]+$/g,"").trim();if(m)H.push({type:"text",content:m});H.push({type:"widget",widget:{type:R,id:T,props:R==="table"?{rows:f,columns:[]}:{items:f},isStreaming:l}}),B=!0,K=!1,W=""}else W=Y.slice(0,O),_=R,K=!0}else W=Y.slice(0,O),_=R,K=!0}}}if(K)W=W.replace(/[\s:;\-–—\.]+$/g,"");let F=/@ui:(\w+)\[/g,b;while((b=F.exec(W))!==null){let M=b[1],A=b.index+b[0].length-1,R=YG(W,A);if(R===-1)continue;let k=W.slice(A+1,R);if(b.index>G){let S=W.slice(G,b.index).trim();if(S)H.push({type:"text",content:S})}try{let S=k.trim(),V=JSON.parse(S),x=`widget-${M}-${JG(S)}`,{metadata:f,actions:l,...T}=V;H.push({type:"widget",widget:{type:M,id:x,props:T,...l&&{actions:l},...f&&{metadata:f}}}),B=!0}catch(S){}G=R+1,F.lastIndex=G}if(G<W.length){let M=W.slice(G).trim();if(M)H.push({type:"text",content:M})}if(H.length===0&&W.trim())H.push({type:"text",content:W.trim()});if(_)H.push({type:"widget_pending",pendingType:_});return{segments:H,hasWidgets:B,hasPendingWidget:K}}var HO={card:{schema:"title, description?, image?, footer?, actions?: [{type, label}]",example:'@ui:card[{"title": "Summary", "description": "Details here"}]'},list:{schema:"items: [{id, title, subtitle?, description?, image?, metadata?: {any extra data}}], actions?: [{type, label}] - metadata is sent as action payload when clicked",example:'@ui:list[{"items": [{"id": "1", "title": "Item", "subtitle": "Info", "metadata": {"key": "value"}}]}]'},button_group:{schema:"buttons: [{id, label, variant?}] - Use for standalone buttons only, NOT for form submits",example:'@ui:button_group[{"buttons": [{"id": "ok", "label": "OK"}]}]'},form:{schema:"title?, fields: [{name, type: text|password|number|select|checkbox|textarea|date, label, required?, placeholder?, options?}], actions: [{type, label}] - Button is built-in via actions, do NOT add separate button",example:'@ui:form[{"title": "Settings", "fields": [{"name": "apiKey", "type": "password", "label": "API Key", "required": true}], "actions": [{"type": "save", "label": "Save"}]}]'},table:{schema:"columns: [{key, label}], rows: [...], striped?, compact?",example:'@ui:table[{"columns": [{"key": "name", "label": "Name"}], "rows": [{"name": "A"}]}]'},image:{schema:"src, alt, caption?",example:'@ui:image[{"src": "url", "alt": "desc"}]'},chart:{schema:"chartType: line|bar|pie, data: {labels, datasets}",example:'@ui:chart[{"chartType": "bar", "data": {"labels": ["A"], "datasets": [{"label": "X", "data": [10]}]}}]'},flow:{schema:"title, subtitle?, icon?: research|schedule|analyze|deploy|recurring|automation|data, steps: [{id, label, type?, color?: blue|purple|cyan|amber|emerald|rose|indigo|orange, status?: pending|active|completed|error|skipped}] - Horizontal pipeline. Use @label for agents. Types auto-detected from label.",example:'@ui:flow[{"title": "Deploy Pipeline", "icon": "deploy", "steps": [{"id": "1", "label": "Test", "color": "cyan"}, {"id": "2", "label": "Build", "color": "amber"}, {"id": "3", "label": "Deploy", "color": "rose"}]}]'}},HI=Object.keys(HO),GI=["flow"],GO=HI.filter((Y)=>!GI.includes(Y));function qI(Y){let H=Y||GO,B=`
|
|
176
|
+
## UI Widgets
|
|
177
|
+
SYNTAX: @ui:type[{json}] - MUST use SQUARE BRACKETS [] around the JSON object.
|
|
178
|
+
CORRECT: @ui:list[{"items": [...]}]
|
|
179
|
+
WRONG: @ui:list{"items": [...]} (missing square brackets)
|
|
180
|
+
|
|
181
|
+
`;for(let K of H){let G=HO[K];if(!G)continue;B+=`${K}: ${G.schema} | ${G.example}
|
|
182
|
+
`}return B+=`
|
|
183
|
+
Per-item "metadata" is sent as payload on action click.
|
|
184
|
+
`,B}function BI(Y){return`
|
|
185
|
+
Widgets: @ui:type[{json}] - MUST use square brackets []. Example: @ui:list[{"items": [...]}]. Types: ${(Y||GO).join(", ")}. Per-item "metadata" is sent as action payload.
|
|
186
|
+
`}function UI({widget:Y,onAction:H}){let{title:B,description:K,image:G,footer:_}=Y.props;return G7.jsxs("div",{className:"border border-neutral-200 dark:border-neutral-700 rounded-xl bg-white dark:bg-neutral-900 overflow-hidden",children:[G&&G7.jsx("img",{src:G,alt:B,className:"w-full h-48 object-cover"}),G7.jsxs("div",{className:"p-4",children:[G7.jsx("h3",{className:"!text-lg font-semibold !text-neutral-900 dark:!text-white",children:B}),K&&G7.jsx("p",{className:"!text-neutral-600 dark:!text-neutral-400 mt-2",children:K})]}),(_||Y.actions&&Y.actions.length>0)&&G7.jsxs("div",{className:"border-t border-neutral-200 dark:border-neutral-700 p-4 flex justify-between items-center",children:[_&&G7.jsx("span",{className:"!text-sm !text-neutral-600 dark:!text-neutral-400",children:_}),Y.actions&&Y.actions.length>0&&G7.jsx("div",{className:"flex gap-2",children:Y.actions.map((W,O)=>G7.jsx("button",{onClick:()=>H?.({type:W.type,payload:W.payload,widgetId:Y.id,timestamp:new Date}),className:"px-3 py-1.5 !text-sm rounded-lg font-medium transition-colors bg-blue-500 !text-white hover:bg-blue-600",children:W.label},O))})]})]})}function WI({widget:Y,onAction:H}){let{items:B}=Y.props,K=Y.isStreaming??!1,G=pz.useRef(new Set),[_,W]=pz.useState(new Set);return pz.useEffect(()=>{let O=new Set(B.map((b)=>b.id)),F=new Set;if(B.forEach((b)=>{if(!G.current.has(b.id))F.add(b.id)}),B.forEach((b)=>G.current.add(b.id)),F.size>0){W(F);let b=setTimeout(()=>{W(new Set)},500);return()=>clearTimeout(b)}},[B]),E5.jsxs("div",{className:"border border-neutral-200 dark:border-neutral-700 rounded-xl bg-white dark:bg-neutral-900 overflow-hidden",children:[B.map((O,F)=>{let b=_.has(O.id),M=F===B.length-1;return E5.jsxs("div",{className:`apteva-list-item flex items-center p-4 transition-colors ${!M||K?"border-b border-neutral-200 dark:border-neutral-700":""} ${!O.backgroundColor?"hover:bg-neutral-50 dark:hover:bg-neutral-800":""} ${b?"apteva-list-item-new":""}`,style:O.backgroundColor?{backgroundColor:O.backgroundColor}:void 0,children:[O.image&&E5.jsx("img",{src:O.image,alt:O.title,className:"w-16 h-16 rounded object-cover"}),E5.jsxs("div",{className:`flex-1 ${O.image?"ml-4":""}`,children:[E5.jsx("h4",{className:"font-semibold !text-neutral-900 dark:!text-white",children:O.title}),O.subtitle&&E5.jsx("p",{className:"!text-sm !text-neutral-600 dark:!text-neutral-400",children:O.subtitle}),O.description&&E5.jsx("p",{className:"!text-xs !text-neutral-500 dark:!text-neutral-500 mt-1",children:O.description})]}),Y.actions&&Y.actions.length>0&&E5.jsx("div",{className:"flex gap-2",children:Y.actions.map((A,R)=>E5.jsx("button",{onClick:()=>H?.({type:A.type,payload:O.metadata||O,widgetId:Y.id,timestamp:new Date}),className:"px-3 py-1.5 !text-sm rounded-lg font-medium transition-colors bg-blue-500 !text-white hover:bg-blue-600",children:A.label},R))})]},O.id)}),K&&E5.jsxs("div",{className:"apteva-list-streaming flex items-center gap-3 p-4 text-neutral-500 dark:text-neutral-400",children:[E5.jsxs("div",{className:"apteva-streaming-dots flex gap-1",children:[E5.jsx("span",{className:"w-2 h-2 bg-current rounded-full animate-pulse",style:{animationDelay:"0ms"}}),E5.jsx("span",{className:"w-2 h-2 bg-current rounded-full animate-pulse",style:{animationDelay:"150ms"}}),E5.jsx("span",{className:"w-2 h-2 bg-current rounded-full animate-pulse",style:{animationDelay:"300ms"}})]}),E5.jsx("span",{className:"text-sm",children:"Loading more..."})]})]})}function KI({widget:Y,onAction:H}){let{label:B,variant:K="primary",disabled:G=!1}=Y.props;return BO.jsx("button",{onClick:()=>Y.actions?.[0]&&H?.({type:Y.actions[0].type,payload:Y.actions[0].payload,widgetId:Y.id,timestamp:new Date}),disabled:G,className:P4("px-4 py-2 rounded-lg font-medium transition-colors",{primary:"bg-blue-500 !text-white hover:bg-blue-600",secondary:"bg-neutral-500 !text-white hover:bg-neutral-600",outline:"border-2 border-blue-500 !text-blue-500 hover:bg-blue-50 dark:hover:bg-blue-900",ghost:"!text-blue-500 hover:bg-blue-50 dark:hover:bg-blue-900"}[K],{"opacity-50 cursor-not-allowed":G}),children:B})}function OI({widget:Y,onAction:H}){let{layout:B="horizontal",buttons:K}=Y.props,G={primary:"bg-blue-500 !text-white hover:bg-blue-600",secondary:"bg-neutral-200 dark:bg-neutral-700 !text-neutral-800 dark:!text-neutral-200 hover:bg-neutral-300 dark:hover:bg-neutral-600",outline:"border border-neutral-300 dark:border-neutral-600 !text-neutral-700 dark:!text-neutral-300 hover:bg-neutral-100 dark:hover:bg-neutral-800"},_=(W)=>{return Y.actions?.find((O)=>O.payload?.buttonId===W)||Y.actions?.[0]};return $G.jsx("div",{className:P4("flex gap-2",B==="vertical"?"flex-col":"flex-row flex-wrap"),children:K.map((W)=>{let O=_(W.id);return $G.jsx("button",{onClick:()=>{if(O)H?.({type:O.type,payload:{...O.payload,buttonId:W.id},widgetId:Y.id,timestamp:new Date})},className:P4("px-4 py-2 rounded-lg font-medium transition-colors text-sm",G[W.variant||"secondary"]),children:W.label},W.id)})})}function _I({widget:Y,onAction:H}){let{columns:B,rows:K,caption:G,compact:_=!1,striped:W=!1}=Y.props,O=Y.isStreaming??!1,F=jz.useRef(new Set),[b,M]=jz.useState(new Set);jz.useEffect(()=>{let R=new Set;if(K.forEach((k,S)=>{let V=k.id||`row-${S}`;if(!F.current.has(V))R.add(V)}),K.forEach((k,S)=>{let V=k.id||`row-${S}`;F.current.add(V)}),R.size>0){M(R);let k=setTimeout(()=>{M(new Set)},500);return()=>clearTimeout(k)}},[K]);let A=(R)=>{switch(R){case"center":return"text-center";case"right":return"text-right";default:return"text-left"}};return s4.jsx("div",{className:"border border-neutral-200 dark:border-neutral-700 rounded-xl bg-white dark:bg-neutral-900 overflow-hidden",children:s4.jsx("div",{className:"overflow-x-auto",children:s4.jsxs("table",{className:"w-full",children:[G&&s4.jsx("caption",{className:"px-4 py-2 text-sm text-neutral-600 dark:text-neutral-400 text-left bg-neutral-50 dark:bg-neutral-800 border-b border-neutral-200 dark:border-neutral-700",children:G}),s4.jsx("thead",{children:s4.jsx("tr",{className:"bg-neutral-50 dark:bg-neutral-800 border-b border-neutral-200 dark:border-neutral-700",children:B.map((R)=>s4.jsx("th",{className:P4("font-semibold text-neutral-900 dark:text-white",_?"px-3 py-2 text-xs":"px-4 py-3 text-sm",A(R.align)),style:R.width?{width:R.width}:void 0,children:R.label},R.key))})}),s4.jsxs("tbody",{children:[K.map((R,k)=>{let S=R.id||`row-${k}`,V=b.has(S);return s4.jsx("tr",{className:P4("apteva-table-row border-b border-neutral-200 dark:border-neutral-700 last:border-b-0","transition-colors hover:bg-neutral-50 dark:hover:bg-neutral-800",W&&k%2===1&&"bg-neutral-50/50 dark:bg-neutral-800/50",V&&"apteva-table-row-new"),onClick:()=>{if(Y.actions&&Y.actions.length>0)H?.({type:Y.actions[0].type,payload:R,widgetId:Y.id,timestamp:new Date})},style:{cursor:Y.actions?.length?"pointer":"default"},children:B.map((x)=>s4.jsx("td",{className:P4("text-neutral-700 dark:text-neutral-300",_?"px-3 py-2 text-xs":"px-4 py-3 text-sm",A(x.align)),children:R[x.key]??"—"},x.key))},S)}),K.length===0&&!O&&s4.jsx("tr",{children:s4.jsx("td",{colSpan:B.length||1,className:"px-4 py-8 text-center text-sm text-neutral-500 dark:text-neutral-400",children:"No data available"})}),O&&s4.jsx("tr",{className:"apteva-table-streaming",children:s4.jsx("td",{colSpan:B.length||1,className:"px-4 py-3 text-center",children:s4.jsxs("div",{className:"flex items-center justify-center gap-3 text-neutral-500 dark:text-neutral-400",children:[s4.jsxs("div",{className:"flex gap-1",children:[s4.jsx("span",{className:"w-2 h-2 bg-current rounded-full animate-pulse",style:{animationDelay:"0ms"}}),s4.jsx("span",{className:"w-2 h-2 bg-current rounded-full animate-pulse",style:{animationDelay:"150ms"}}),s4.jsx("span",{className:"w-2 h-2 bg-current rounded-full animate-pulse",style:{animationDelay:"300ms"}})]}),s4.jsx("span",{className:"text-sm",children:"Loading more..."})]})})})]})]})})})}function LI({widget:Y,onAction:H}){let{title:B,fields:K}=Y.props,[G,_]=UO.useState(()=>{let M={};return K.forEach((A)=>{M[A.name]=A.defaultValue??(A.type==="checkbox"?!1:"")}),M}),W=(M,A)=>{_((R)=>({...R,[M]:A}))},O=(M)=>{if(M.preventDefault(),Y.actions?.[0]&&H)H({type:Y.actions[0].type,payload:{...Y.actions[0].payload,formData:G},widgetId:Y.id,timestamp:new Date})},F=(M)=>{switch(M.type){case"text":case"password":case"number":case"date":return N5.jsx("input",{type:M.type,name:M.name,value:G[M.name]||"",onChange:(R)=>W(M.name,M.type==="number"?Number(R.target.value):R.target.value),placeholder:M.placeholder,required:M.required,className:"w-full px-3 py-2 rounded-lg border transition-colors border-neutral-200 dark:border-neutral-600 bg-neutral-50 dark:bg-neutral-800 !text-neutral-900 dark:!text-neutral-100 placeholder-neutral-400 dark:placeholder-neutral-500 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent"});case"textarea":return N5.jsx("textarea",{name:M.name,value:G[M.name]||"",onChange:(R)=>W(M.name,R.target.value),placeholder:M.placeholder,required:M.required,rows:3,className:"w-full px-3 py-2 rounded-lg border transition-colors border-neutral-200 dark:border-neutral-600 bg-neutral-50 dark:bg-neutral-800 !text-neutral-900 dark:!text-neutral-100 placeholder-neutral-400 dark:placeholder-neutral-500 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent"});case"select":return N5.jsxs("select",{name:M.name,value:G[M.name]||"",onChange:(R)=>W(M.name,R.target.value),required:M.required,className:"w-full px-3 py-2 rounded-lg border transition-colors border-neutral-200 dark:border-neutral-600 bg-neutral-50 dark:bg-neutral-800 !text-neutral-900 dark:!text-neutral-100 placeholder-neutral-400 dark:placeholder-neutral-500 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent",children:[N5.jsx("option",{value:"",children:M.placeholder||"Select..."}),M.options?.map((R)=>N5.jsx("option",{value:R.value,children:R.label},R.value))]});case"checkbox":return N5.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[N5.jsx("input",{type:"checkbox",name:M.name,checked:G[M.name]||!1,onChange:(R)=>W(M.name,R.target.checked),className:"w-4 h-4 rounded border-neutral-300 dark:border-neutral-600 text-blue-500 focus:ring-blue-500"}),N5.jsx("span",{className:"!text-neutral-700 dark:!text-neutral-300",children:M.label})]});default:return null}},b=Y.actions?.find((M)=>M.type==="submit")||Y.actions?.[0];return N5.jsxs("form",{onSubmit:O,className:"border border-neutral-200 dark:border-neutral-700 rounded-xl bg-white dark:bg-neutral-900 overflow-hidden",children:[N5.jsxs("div",{className:"p-4",children:[B&&N5.jsx("h3",{className:"!text-lg font-semibold !text-neutral-900 dark:!text-white mb-4",children:B}),N5.jsx("div",{className:"space-y-3",children:K.map((M)=>N5.jsxs("div",{className:M.type==="checkbox"?"":"space-y-1",children:[M.type!=="checkbox"&&N5.jsxs("label",{className:"block !text-sm font-medium !text-neutral-600 dark:!text-neutral-400",children:[M.label,M.required&&N5.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),F(M)]},M.name))})]}),b&&N5.jsx("div",{className:"px-4 pb-4",children:N5.jsx("button",{type:"submit",className:"px-3 py-1.5 !text-sm rounded-lg font-medium transition-colors bg-blue-500 !text-white hover:bg-blue-600",children:b.label||"Submit"})})]})}function NI({widget:Y}){let{src:H,alt:B,caption:K}=Y.props;return jX.jsxs("figure",{className:"overflow-hidden rounded-xl",children:[jX.jsx("img",{src:H,alt:B,className:"w-full h-auto object-contain bg-neutral-100 dark:bg-neutral-800",loading:"lazy"}),K&&jX.jsx("figcaption",{className:"mt-2 text-center text-sm text-neutral-600 dark:text-neutral-400",children:K})]})}function RI({type:Y,status:H}){if(H==="completed")return u0.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:u0.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2.5,d:"M5 13l4 4L19 7"})});if(H==="error")return u0.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:u0.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2.5,d:"M6 18L18 6M6 6l12 12"})});if(H==="active")return u0.jsx("div",{className:"w-3.5 h-3.5 rounded-full bg-current animate-pulse"});let B="w-4 h-4";if(Y==="time"||Y==="schedule"||Y==="clock")return u0.jsx("svg",{className:B,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:u0.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})});if(Y==="recurring"||Y==="repeat")return u0.jsx("svg",{className:B,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:u0.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})});if(Y==="agent"||Y?.startsWith("@"))return u0.jsx("svg",{className:B,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:u0.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0z"})});if(Y==="email"||Y==="mail")return u0.jsx("svg",{className:B,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:u0.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"})});if(Y==="slack"||Y==="message"||Y==="chat")return u0.jsx("svg",{className:B,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:u0.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"})});if(Y==="webhook"||Y==="api")return u0.jsx("svg",{className:B,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:u0.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1"})});if(Y==="build"||Y==="compile"||Y==="package")return u0.jsx("svg",{className:B,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:u0.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M20 7l-8-4-8 4m16 0l-8 4m8-4v10l-8 4m0-10L4 7m8 4v10M4 7v10l8 4"})});if(Y==="test"||Y==="check"||Y==="verify")return u0.jsx("svg",{className:B,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:u0.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"})});if(Y==="deploy"||Y==="rocket"||Y==="launch")return u0.jsx("svg",{className:B,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:u0.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 10V3L4 14h7v7l9-11h-7z"})});if(Y==="push"||Y==="upload"||Y==="cloud")return u0.jsx("svg",{className:B,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:u0.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12"})});if(Y==="generate"||Y==="create"||Y==="document"||Y==="file")return u0.jsx("svg",{className:B,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:u0.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})});if(Y==="review"||Y==="inspect"||Y==="eye")return u0.jsxs("svg",{className:B,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[u0.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}),u0.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"})]});if(Y==="analyze"||Y==="research"||Y==="chart")return u0.jsx("svg",{className:B,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:u0.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"})});if(Y==="scrape"||Y==="crawl"||Y==="spider")return u0.jsx("svg",{className:B,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:u0.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9"})});if(Y==="data"||Y==="database"||Y==="storage")return u0.jsx("svg",{className:B,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:u0.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 7v10c0 2.21 3.582 4 8 4s8-1.79 8-4V7M4 7c0 2.21 3.582 4 8 4s8-1.79 8-4M4 7c0-2.21 3.582-4 8-4s8 1.79 8 4m0 5c0 2.21-3.582 4-8 4s-8-1.79-8-4"})});if(Y==="notification"||Y==="bell"||Y==="alert")return u0.jsx("svg",{className:B,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:u0.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9"})});if(Y==="transform"||Y==="process"||Y==="convert")return u0.jsx("svg",{className:B,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:u0.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 7h12m0 0l-4-4m4 4l-4 4m0 6H4m0 0l4 4m-4-4l4-4"})});return u0.jsx("div",{className:"w-2 h-2 rounded-full bg-current opacity-50"})}function MI({icon:Y}){if(Y==="research"||Y==="multi-agent"||Y==="agents")return u0.jsx("div",{className:"w-10 h-10 rounded-lg bg-purple-100 dark:bg-purple-500/20 flex items-center justify-center",children:u0.jsx("svg",{className:"w-6 h-6 text-purple-600 dark:text-purple-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:u0.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 10V3L4 14h7v7l9-11h-7z"})})});if(Y==="schedule"||Y==="report"||Y==="calendar")return u0.jsx("div",{className:"w-10 h-10 rounded-lg bg-amber-100 dark:bg-amber-500/20 flex items-center justify-center",children:u0.jsx("svg",{className:"w-6 h-6 text-amber-600 dark:text-amber-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:u0.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})})});if(Y==="recurring"||Y==="repeat"||Y==="sync")return u0.jsx("div",{className:"w-10 h-10 rounded-lg bg-cyan-100 dark:bg-cyan-500/20 flex items-center justify-center",children:u0.jsx("svg",{className:"w-6 h-6 text-cyan-600 dark:text-cyan-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:u0.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})})});if(Y==="analyze"||Y==="analysis"||Y==="chart")return u0.jsx("div",{className:"w-10 h-10 rounded-lg bg-cyan-100 dark:bg-cyan-500/20 flex items-center justify-center",children:u0.jsx("svg",{className:"w-6 h-6 text-cyan-600 dark:text-cyan-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:u0.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"})})});if(Y==="deploy"||Y==="rocket"||Y==="launch")return u0.jsx("div",{className:"w-10 h-10 rounded-lg bg-blue-100 dark:bg-blue-500/20 flex items-center justify-center",children:u0.jsx("svg",{className:"w-6 h-6 text-blue-600 dark:text-blue-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:u0.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 10V3L4 14h7v7l9-11h-7z"})})});if(Y==="automation"||Y==="workflow"||Y==="process")return u0.jsx("div",{className:"w-10 h-10 rounded-lg bg-indigo-100 dark:bg-indigo-500/20 flex items-center justify-center",children:u0.jsx("svg",{className:"w-6 h-6 text-indigo-600 dark:text-indigo-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:u0.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 5a1 1 0 011-1h14a1 1 0 011 1v2a1 1 0 01-1 1H5a1 1 0 01-1-1V5zM4 13a1 1 0 011-1h6a1 1 0 011 1v6a1 1 0 01-1 1H5a1 1 0 01-1-1v-6zM16 13a1 1 0 011-1h2a1 1 0 011 1v6a1 1 0 01-1 1h-2a1 1 0 01-1-1v-6z"})})});if(Y==="data"||Y==="pipeline"||Y==="etl")return u0.jsx("div",{className:"w-10 h-10 rounded-lg bg-emerald-100 dark:bg-emerald-500/20 flex items-center justify-center",children:u0.jsx("svg",{className:"w-6 h-6 text-emerald-600 dark:text-emerald-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:u0.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 7v10c0 2.21 3.582 4 8 4s8-1.79 8-4V7M4 7c0 2.21 3.582 4 8 4s8-1.79 8-4M4 7c0-2.21 3.582-4 8-4s8 1.79 8 4"})})});return u0.jsx("div",{className:"w-10 h-10 rounded-lg bg-neutral-100 dark:bg-neutral-700 flex items-center justify-center",children:u0.jsx("svg",{className:"w-6 h-6 text-neutral-600 dark:text-neutral-300",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:u0.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"})})})}function wI(){return u0.jsx("svg",{className:"w-4 h-4 text-neutral-400 dark:text-neutral-500 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:u0.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})}var H7={blue:"bg-blue-100 dark:bg-blue-900/40 !text-blue-700 dark:!text-blue-300 border-blue-300 dark:border-blue-500",purple:"bg-purple-100 dark:bg-purple-900/40 !text-purple-700 dark:!text-purple-300 border-purple-300 dark:border-purple-500",cyan:"bg-cyan-100 dark:bg-cyan-900/40 !text-cyan-700 dark:!text-cyan-300 border-cyan-300 dark:border-cyan-500",amber:"bg-amber-100 dark:bg-amber-900/40 !text-amber-700 dark:!text-amber-300 border-amber-300 dark:border-amber-500",emerald:"bg-emerald-100 dark:bg-emerald-900/40 !text-emerald-700 dark:!text-emerald-300 border-emerald-300 dark:border-emerald-500",rose:"bg-rose-100 dark:bg-rose-900/40 !text-rose-700 dark:!text-rose-300 border-rose-300 dark:border-rose-500",indigo:"bg-indigo-100 dark:bg-indigo-900/40 !text-indigo-700 dark:!text-indigo-300 border-indigo-300 dark:border-indigo-500",orange:"bg-orange-100 dark:bg-orange-900/40 !text-orange-700 dark:!text-orange-300 border-orange-300 dark:border-orange-500",neutral:"bg-neutral-100 dark:bg-neutral-800 !text-neutral-600 dark:!text-neutral-300 border-neutral-300 dark:border-neutral-600"};function FI(Y,H){if(Y.color&&H7[Y.color])return H7[Y.color];if(H==="time"||H==="schedule"||H==="clock")return H7.blue;if(H==="agent"||H?.startsWith("@"))return H7.purple;if(H==="email"||H==="slack"||H==="message"||H==="notification")return H7.cyan;if(H==="generate"||H==="document"||H==="create")return H7.amber;if(H==="deploy"||H==="rocket"||H==="launch")return H7.rose;if(H==="build"||H==="compile"||H==="package")return H7.indigo;if(H==="test"||H==="check"||H==="verify")return H7.emerald;if(H==="data"||H==="database"||H==="storage")return H7.orange;return H7.blue}function bI({widget:Y}){let{title:H,subtitle:B,icon:K,steps:G}=Y.props;return u0.jsxs("div",{className:"rounded-xl bg-white dark:bg-neutral-900 border border-neutral-200 dark:border-neutral-700 overflow-hidden",children:[u0.jsxs("div",{className:"px-4 py-4 flex items-center gap-4",children:[u0.jsx(MI,{icon:K}),u0.jsxs("div",{className:"flex-1 min-w-0",children:[u0.jsx("h3",{className:"font-semibold text-base text-neutral-900 dark:text-white truncate",children:H}),B&&u0.jsx("p",{className:"text-sm text-neutral-500 dark:text-neutral-400 truncate mt-0.5",children:B})]})]}),u0.jsx("div",{className:"px-4 pb-4",children:u0.jsx("div",{className:"flex flex-wrap items-center gap-2",children:G.map((_,W)=>{let O=W===G.length-1,F=_.status==="active",b=_.status==="completed",M=_.status==="error",A=_.status==="skipped",R=_.label,k=_.type;if(!k)if(R.startsWith("@"))k="agent";else if(/^\d+[ap]m$/i.test(R)||/^(mon|tue|wed|thu|fri|sat|sun)/i.test(R))k="time";else{let x=R.toLowerCase();k={test:"test",build:"build",push:"push",deploy:"deploy",email:"email",slack:"slack",generate:"generate",review:"review",analyze:"analyze",scrape:"scrape",transform:"transform",notify:"notification",alert:"notification",webhook:"webhook",api:"api",data:"data",process:"process"}[x]}let S,V="";if(F)S="bg-blue-100 dark:bg-blue-900/40 !text-blue-700 dark:!text-blue-300 border-blue-400 dark:border-blue-400 ring-2 ring-blue-400";else if(b)S="bg-emerald-100 dark:bg-emerald-900/40 !text-emerald-700 dark:!text-emerald-300 border-emerald-400 dark:border-emerald-400";else if(M)S="bg-red-100 dark:bg-red-900/40 !text-red-700 dark:!text-red-300 border-red-400 dark:border-red-400";else if(A)S="bg-neutral-100 dark:bg-neutral-800 !text-neutral-400 dark:!text-neutral-500 border-neutral-300 dark:border-neutral-600",V="line-through";else S=FI(_,k);return u0.jsxs("div",{className:"flex items-center gap-2",children:[u0.jsxs("span",{className:`inline-flex items-center gap-2 px-4 py-2 rounded-lg text-sm font-medium border transition-colors ${S} ${V}`,children:[u0.jsx(RI,{type:k,status:_.status}),R]}),!O&&u0.jsx(wI,{})]},_.id)})})})]})}function HG({widget:Y,onAction:H}){return N6.jsx("div",{className:"apteva-widget",children:(()=>{switch(Y.type){case"card":return N6.jsx(UI,{widget:Y,onAction:H});case"list":return N6.jsx(WI,{widget:Y,onAction:H});case"button":return N6.jsx(KI,{widget:Y,onAction:H});case"button_group":return N6.jsx(OI,{widget:Y,onAction:H});case"table":return N6.jsx(_I,{widget:Y,onAction:H});case"form":return N6.jsx(LI,{widget:Y,onAction:H});case"image":return N6.jsx(NI,{widget:Y});case"flow":return N6.jsx(bI,{widget:Y});default:return N6.jsxs("div",{className:"p-4 border border-yellow-300 bg-yellow-50 rounded-lg",children:[N6.jsxs("p",{className:"text-sm text-yellow-800",children:["Unknown widget type: ",Y.type]}),N6.jsx("pre",{className:"text-xs mt-2 overflow-auto",children:JSON.stringify(Y,null,2)})]})}})()})}function XG({widgets:Y,onAction:H,onWidgetMount:B,layout:K="stack",spacing:G="normal",columns:_=3,className:W}){qO.useEffect(()=>{Y.forEach((b)=>{B?.(b.id)})},[Y,B]);let O={stack:"flex flex-col",grid:`grid grid-cols-1 md:grid-cols-${_}`,masonry:"columns-1 md:columns-2 lg:columns-3"},F={tight:"gap-2",normal:"gap-4",loose:"gap-6"};return GG.jsx("div",{className:P4(O[K],F[G],W),children:Y.map((b)=>GG.jsx(HG,{widget:b,onAction:H},b.id))})}function JO({type:Y,className:H}){switch(Y){case"card":return B1.jsx("div",{className:P4("apteva-widget-skeleton animate-pulse rounded-lg border border-neutral-200 dark:border-neutral-800 overflow-hidden",H),children:B1.jsxs("div",{className:"p-4 space-y-3",children:[B1.jsx("div",{className:"h-4 bg-neutral-200 dark:bg-neutral-700 rounded w-3/4"}),B1.jsx("div",{className:"h-3 bg-neutral-200 dark:bg-neutral-700 rounded w-full"}),B1.jsx("div",{className:"h-3 bg-neutral-200 dark:bg-neutral-700 rounded w-5/6"})]})});case"list":return B1.jsx("div",{className:P4("apteva-widget-skeleton animate-pulse space-y-2",H),children:[1,2,3].map((B)=>B1.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg border border-neutral-200 dark:border-neutral-800",children:[B1.jsx("div",{className:"w-10 h-10 bg-neutral-200 dark:bg-neutral-700 rounded-full flex-shrink-0"}),B1.jsxs("div",{className:"flex-1 space-y-2",children:[B1.jsx("div",{className:"h-3 bg-neutral-200 dark:bg-neutral-700 rounded w-1/2"}),B1.jsx("div",{className:"h-2 bg-neutral-200 dark:bg-neutral-700 rounded w-3/4"})]})]},B))});case"button_group":return B1.jsxs("div",{className:P4("apteva-widget-skeleton animate-pulse flex gap-2",H),children:[B1.jsx("div",{className:"h-9 bg-neutral-200 dark:bg-neutral-700 rounded-lg w-20"}),B1.jsx("div",{className:"h-9 bg-neutral-200 dark:bg-neutral-700 rounded-lg w-20"}),B1.jsx("div",{className:"h-9 bg-neutral-200 dark:bg-neutral-700 rounded-lg w-20"})]});case"form":return B1.jsxs("div",{className:P4("apteva-widget-skeleton animate-pulse rounded-lg border border-neutral-200 dark:border-neutral-800 p-4 space-y-4",H),children:[B1.jsx("div",{className:"h-4 bg-neutral-200 dark:bg-neutral-700 rounded w-1/3"}),B1.jsxs("div",{className:"space-y-3",children:[B1.jsx("div",{className:"h-10 bg-neutral-200 dark:bg-neutral-700 rounded"}),B1.jsx("div",{className:"h-10 bg-neutral-200 dark:bg-neutral-700 rounded"})]}),B1.jsx("div",{className:"h-9 bg-neutral-200 dark:bg-neutral-700 rounded w-24"})]});case"chart":return B1.jsxs("div",{className:P4("apteva-widget-skeleton animate-pulse rounded-lg border border-neutral-200 dark:border-neutral-800 p-4",H),children:[B1.jsx("div",{className:"h-4 bg-neutral-200 dark:bg-neutral-700 rounded w-1/4 mb-4"}),B1.jsxs("div",{className:"flex items-end gap-2 h-32",children:[B1.jsx("div",{className:"flex-1 bg-neutral-200 dark:bg-neutral-700 rounded-t h-1/2"}),B1.jsx("div",{className:"flex-1 bg-neutral-200 dark:bg-neutral-700 rounded-t h-3/4"}),B1.jsx("div",{className:"flex-1 bg-neutral-200 dark:bg-neutral-700 rounded-t h-1/3"}),B1.jsx("div",{className:"flex-1 bg-neutral-200 dark:bg-neutral-700 rounded-t h-full"}),B1.jsx("div",{className:"flex-1 bg-neutral-200 dark:bg-neutral-700 rounded-t h-2/3"})]})]});case"image":return B1.jsx("div",{className:P4("apteva-widget-skeleton animate-pulse",H),children:B1.jsx("div",{className:"aspect-video bg-neutral-200 dark:bg-neutral-700 rounded-lg"})});case"gallery":return B1.jsx("div",{className:P4("apteva-widget-skeleton animate-pulse grid grid-cols-3 gap-2",H),children:[1,2,3].map((B)=>B1.jsx("div",{className:"aspect-square bg-neutral-200 dark:bg-neutral-700 rounded-lg"},B))});case"map":return B1.jsx("div",{className:P4("apteva-widget-skeleton animate-pulse",H),children:B1.jsx("div",{className:"h-48 bg-neutral-200 dark:bg-neutral-700 rounded-lg flex items-center justify-center",children:B1.jsxs("svg",{className:"w-8 h-8 text-neutral-400 dark:text-neutral-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:[B1.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z"}),B1.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M15 11a3 3 0 11-6 0 3 3 0 016 0z"})]})})});case"table":return B1.jsxs("div",{className:P4("apteva-widget-skeleton animate-pulse rounded-lg border border-neutral-200 dark:border-neutral-800 overflow-hidden",H),children:[B1.jsxs("div",{className:"flex bg-neutral-100 dark:bg-neutral-800 border-b border-neutral-200 dark:border-neutral-700",children:[B1.jsx("div",{className:"flex-1 px-4 py-3",children:B1.jsx("div",{className:"h-3 bg-neutral-300 dark:bg-neutral-600 rounded w-16"})}),B1.jsx("div",{className:"flex-1 px-4 py-3",children:B1.jsx("div",{className:"h-3 bg-neutral-300 dark:bg-neutral-600 rounded w-20"})}),B1.jsx("div",{className:"flex-1 px-4 py-3",children:B1.jsx("div",{className:"h-3 bg-neutral-300 dark:bg-neutral-600 rounded w-14"})})]}),[1,2,3].map((B)=>B1.jsxs("div",{className:"flex border-b border-neutral-200 dark:border-neutral-800 last:border-b-0",children:[B1.jsx("div",{className:"flex-1 px-4 py-3",children:B1.jsx("div",{className:"h-3 bg-neutral-200 dark:bg-neutral-700 rounded w-24"})}),B1.jsx("div",{className:"flex-1 px-4 py-3",children:B1.jsx("div",{className:"h-3 bg-neutral-200 dark:bg-neutral-700 rounded w-16"})}),B1.jsx("div",{className:"flex-1 px-4 py-3",children:B1.jsx("div",{className:"h-3 bg-neutral-200 dark:bg-neutral-700 rounded w-20"})})]},B))]});default:return B1.jsxs("div",{className:P4("apteva-widget-skeleton animate-pulse rounded-lg border border-neutral-200 dark:border-neutral-800 p-4",H),children:[B1.jsx("div",{className:"h-4 bg-neutral-200 dark:bg-neutral-700 rounded w-1/2 mb-2"}),B1.jsx("div",{className:"h-3 bg-neutral-200 dark:bg-neutral-700 rounded w-full"})]})}}function PI(Y){return/\.(jpg|jpeg|png|gif|webp|svg|bmp|ico)(\?.*)?$/i.test(Y)}function f2(Y,H=""){let B=[],K=/!\[([^\]]*)\]\(([^)]+)\)|\[([^\]]+)\]\(([^)]+)\)|(\*\*|__)(.+?)\5|`([^`]+)`/g,G=0,_,W=0;while((_=K.exec(Y))!==null){if(_.index>G)B.push(Y.slice(G,_.index));if(_[1]!==void 0||_[2]!==void 0){let O=_[1]||"",F=_[2];B.push(p4.jsx("img",{src:F,alt:O,className:"apteva-md-img"},`${H}img${W++}`))}else if(_[3]!==void 0||_[4]!==void 0){let O=_[3],F=_[4];if(PI(F))B.push(p4.jsx("img",{src:F,alt:O,className:"apteva-md-img"},`${H}img${W++}`));else B.push(p4.jsx("a",{href:F,target:"_blank",rel:"noopener noreferrer",className:"apteva-md-link",children:O},`${H}a${W++}`))}else if(_[5]!==void 0)B.push(p4.jsx("strong",{children:_[6]},`${H}b${W++}`));else if(_[7]!==void 0)B.push(p4.jsx("code",{className:"apteva-md-inline-code",children:_[7]},`${H}code${W++}`));G=_.index+_[0].length}if(G<Y.length)B.push(Y.slice(G));return B.length>0?B:[Y]}function AI(Y){let H=Y.split(`
|
|
187
|
+
`),B=[],K=0,G=0;while(G<H.length){let _=H[G],W=_.match(/^##\s+(.*)$/);if(W){B.push(p4.jsx("h2",{className:"apteva-md-h2",children:f2(W[1],`${K}`)},`h2${K++}`)),G++;continue}let O=_.match(/^###\s+(.*)$/);if(O){B.push(p4.jsx("h3",{className:"apteva-md-h3",children:f2(O[1],`${K}`)},`h3${K++}`)),G++;continue}let F=_.match(/^(\s*)([-*+])\s+(.*)$/);if(F){let A=[],R=F[1].length;while(G<H.length){let k=H[G].match(/^(\s*)([-*+])\s+(.*)$/);if(k&&k[1].length===R)A.push(p4.jsx("li",{className:"apteva-md-li",children:f2(k[3],`${K}`)},`li${K++}`)),G++;else break}B.push(p4.jsx("ul",{className:"apteva-md-ul",children:A},`ul${K++}`));continue}let b=_.match(/^(\s*)(\d+)\.\s+(.*)$/);if(b){let A=[],R=b[1].length;while(G<H.length){let k=H[G].match(/^(\s*)(\d+)\.\s+(.*)$/);if(k&&k[1].length===R)A.push(p4.jsx("li",{className:"apteva-md-li",children:f2(k[3],`${K}`)},`li${K++}`)),G++;else break}B.push(p4.jsx("ol",{className:"apteva-md-ol",children:A},`ol${K++}`));continue}if(_.match(/^\|(.+)\|$/)&&G+1<H.length){if(H[G+1].match(/^\|([\s:-]+\|)+$/)){let k=_.split("|").filter((V)=>V.trim()!=="").map((V)=>V.trim());G+=2;let S=[];while(G<H.length)if(H[G].match(/^\|(.+)\|$/)){let x=H[G].split("|").filter((f)=>f.trim()!=="").map((f)=>f.trim());S.push(x),G++}else break;B.push(p4.jsx("div",{className:"apteva-md-table-wrapper",children:p4.jsxs("table",{className:"apteva-md-table",children:[p4.jsx("thead",{children:p4.jsx("tr",{children:k.map((V,x)=>p4.jsx("th",{className:"apteva-md-th",children:f2(V,`th${K}${x}`)},`th${x}`))})}),p4.jsx("tbody",{children:S.map((V,x)=>p4.jsx("tr",{children:V.map((f,l)=>p4.jsx("td",{className:"apteva-md-td",children:f2(f,`td${K}${x}${l}`)},`td${l}`))},`tr${x}`))})]})},`table-wrapper${K++}`));continue}}if(_==="")B.push(p4.jsx("br",{},`br${K++}`));else B.push(p4.jsxs("span",{children:[f2(_,`${K}`),G<H.length-1?`
|
|
188
|
+
`:""]},`p${K++}`));G++}return B}function X8({content:Y,className:H=""}){return p4.jsx("div",{className:`apteva-md ${H}`,children:AI(Y)})}function II({name:Y,status:H,isReceiving:B=!1,inputLength:K=0,streamOutput:G}){if(H==="preparing")return Y4.jsxs("div",{className:"apteva-tool-card apteva-tool-card-preparing",children:[Y4.jsxs("svg",{className:"apteva-tool-icon apteva-tool-icon-spin",fill:"none",viewBox:"0 0 24 24",children:[Y4.jsx("circle",{className:"apteva-tool-spinner-track",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),Y4.jsx("path",{className:"apteva-tool-spinner-fill",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),Y4.jsxs("span",{className:"apteva-tool-label",children:[Y4.jsx("strong",{children:Y}),Y4.jsx("span",{className:"apteva-tool-status-text",children:" preparing..."})]})]});if(H==="running")return Y4.jsxs("div",{className:"apteva-tool-card apteva-tool-card-running",children:[Y4.jsxs("svg",{className:"apteva-tool-icon apteva-tool-icon-spin",fill:"none",viewBox:"0 0 24 24",children:[Y4.jsx("circle",{className:"apteva-tool-spinner-track",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),Y4.jsx("path",{className:"apteva-tool-spinner-fill",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),Y4.jsxs("span",{className:"apteva-tool-label",children:[Y4.jsx("strong",{children:Y}),G?Y4.jsx("span",{className:"apteva-tool-stream-separator",children:" · "}):null,G?Y4.jsx("span",{className:"apteva-tool-stream-output",children:G}):Y4.jsxs(Y4.Fragment,{children:[Y4.jsx("span",{className:"apteva-tool-status-text",children:" running"}),Y4.jsxs("span",{className:"apteva-tool-dots",children:[Y4.jsx("span",{children:"."}),Y4.jsx("span",{children:"."}),Y4.jsx("span",{children:"."})]})]})]})]});if(H==="completed")return Y4.jsxs("div",{className:"apteva-tool-card apteva-tool-card-completed",children:[Y4.jsx("svg",{className:"apteva-tool-icon",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:Y4.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),Y4.jsx("span",{className:"apteva-tool-label",children:Y})]});return Y4.jsxs("div",{className:"apteva-tool-card apteva-tool-card-error",children:[Y4.jsx("svg",{className:"apteva-tool-icon",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:Y4.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),Y4.jsxs("span",{className:"apteva-tool-label",children:[Y," failed"]})]})}function TI({message:Y,onAction:H,enableWidgets:B,onWidgetRender:K}){let G=Y.role==="user",_=Y.metadata?.content_segments,W=Y.metadata?.isStreaming===!0,O=Y.content||_&&_.length>0,F=h2.useRef(new Set),b=h2.useMemo(()=>{if(!B||G||!Y.content)return[];return OJ(Y.content).segments.filter((m)=>m.type==="widget"&&!!m.widget).map((m)=>m.widget)},[B,G,Y.content]);h2.useEffect(()=>{if(K&&Y.widgets){for(let T of Y.widgets)if(!F.current.has(T.id))F.current.add(T.id),K(T)}},[Y.widgets,K]),h2.useEffect(()=>{if(K&&b.length>0){for(let T of b)if(!F.current.has(T.id))F.current.add(T.id),K(T)}},[b,K]);let M=(T)=>{if(!B||G)return o0.jsx(X8,{content:T});let E=OJ(T).segments.filter((D)=>D.type==="text"&&D.content).map((D)=>D.content).join("");if(!E.trim())return null;return o0.jsx(X8,{content:E})},A=()=>{if(!B||G||!Y.content)return null;let T=OJ(Y.content),m=[],E="";if(T.segments.forEach((D,n)=>{if(D.type==="text"&&D.content)E+=D.content;else if(D.type==="widget"&&D.widget){if(E.trim())m.push(o0.jsx("div",{className:"apteva-message-bubble apteva-message-assistant",children:o0.jsx("div",{className:"apteva-message-content-assistant",children:o0.jsx(X8,{content:E})})},`text-${n}`)),E="";m.push(o0.jsx("div",{className:"apteva-widget-standalone",children:o0.jsx(HG,{widget:D.widget,onAction:H})},`widget-${n}`))}else if(D.type==="widget_pending"&&D.pendingType){if(E.trim())m.push(o0.jsx("div",{className:"apteva-message-bubble apteva-message-assistant",children:o0.jsx("div",{className:"apteva-message-content-assistant",children:o0.jsx(X8,{content:E})})},`text-${n}`)),E="";m.push(o0.jsx("div",{className:"apteva-widget-standalone",children:o0.jsx(JO,{type:D.pendingType})},`pending-${n}`))}}),E.trim())m.push(o0.jsx("div",{className:"apteva-message-bubble apteva-message-assistant",children:o0.jsx("div",{className:"apteva-message-content-assistant",children:o0.jsx(X8,{content:E})})},"text-final"));return m.length>0?m:null},R=Y.metadata?.attachments||[],k=R.length>0,S=()=>{if(!k)return null;return o0.jsx("div",{className:"apteva-message-attachments flex flex-wrap gap-2 mb-2 justify-end",children:R.map((T,m)=>{let E=T.type.startsWith("image/"),D=T.type==="application/pdf";if(E&&T.preview)return o0.jsx("div",{className:"apteva-attachment-image relative rounded-lg overflow-hidden shadow-sm",children:o0.jsx("img",{src:T.preview,alt:T.name,className:"max-w-[150px] max-h-[150px] object-cover"})},m);return o0.jsxs("div",{className:"apteva-attachment-doc flex items-center gap-3 px-4 py-3 bg-neutral-100 dark:bg-neutral-800 border border-neutral-200 dark:border-neutral-700 rounded-xl shadow-sm",children:[o0.jsx("div",{className:"w-10 h-10 flex items-center justify-center bg-red-100 dark:bg-red-900/30 rounded-lg text-red-600 dark:text-red-400",children:D?o0.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o0.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"})}):o0.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o0.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})})}),o0.jsxs("div",{className:"flex flex-col min-w-0",children:[o0.jsx("span",{className:"text-sm font-medium text-neutral-800 dark:text-neutral-200 truncate max-w-[180px]",children:T.name}),o0.jsxs("span",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:[D?"PDF":"Document"," · ",_J(T.size)]})]})]},m)})})},V=()=>{if(G)return o0.jsx("div",{className:"apteva-message-text",children:Y.content});if(W&&!O)return o0.jsxs("div",{className:"apteva-typing-indicator",children:[o0.jsx("span",{}),o0.jsx("span",{}),o0.jsx("span",{})]});if(_&&_.length>0)return null;return M(Y.content)},x=(T,m)=>{if(!B)return o0.jsx("div",{className:"apteva-message-bubble apteva-message-assistant",children:o0.jsx("div",{className:"apteva-message-content-assistant",children:o0.jsx(X8,{content:T})})},m);let E=OJ(T),D=[],n="";if(E.segments.forEach((c,j)=>{if(c.type==="text"&&c.content)n+=c.content;else if(c.type==="widget"&&c.widget){if(n.trim())D.push(o0.jsx("div",{className:"apteva-message-bubble apteva-message-assistant",children:o0.jsx("div",{className:"apteva-message-content-assistant",children:o0.jsx(X8,{content:n})})},`${m}-text-${j}`)),n="";D.push(o0.jsx("div",{className:"apteva-widget-standalone",children:o0.jsx(HG,{widget:c.widget,onAction:H})},`${m}-widget-${j}`))}else if(c.type==="widget_pending"&&c.pendingType){if(n.trim())D.push(o0.jsx("div",{className:"apteva-message-bubble apteva-message-assistant",children:o0.jsx("div",{className:"apteva-message-content-assistant",children:o0.jsx(X8,{content:n})})},`${m}-text-${j}`)),n="";D.push(o0.jsx("div",{className:"apteva-widget-standalone",children:o0.jsx(JO,{type:c.pendingType})},`${m}-pending-${j}`))}}),n.trim())D.push(o0.jsx("div",{className:"apteva-message-bubble apteva-message-assistant",children:o0.jsx("div",{className:"apteva-message-content-assistant",children:o0.jsx(X8,{content:n})})},`${m}-text-final`));return D},f=()=>{if(!_||_.length===0)return null;let T=[];return _.forEach((m,E)=>{if(m.type==="text"&&m.content){let D=x(m.content,`seg-${E}`);if(Array.isArray(D))T.push(...D);else T.push(D)}else if(m.type==="tool")T.push(o0.jsx("div",{className:"apteva-tool-call-standalone",children:o0.jsx(II,{name:m.name,status:m.status||(m.result!==void 0?"completed":"running"),isReceiving:m.isReceiving,inputLength:m.inputLength,streamOutput:m.streamOutput})},m.id))}),T};if(!G&&(_&&_.length>0))return o0.jsxs("div",{className:"apteva-message-segmented",children:[f(),Y.widgets&&Y.widgets.length>0&&o0.jsx("div",{className:"apteva-widget-standalone",children:o0.jsx(XG,{widgets:Y.widgets,onAction:H,layout:"stack"})}),o0.jsx("div",{className:"apteva-message-timestamp apteva-message-timestamp-assistant",suppressHydrationWarning:!0,children:Y.timestamp.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]});let l=A();if(!G&&B&&l)return o0.jsxs("div",{className:"apteva-message-segmented",children:[l,Y.widgets&&Y.widgets.length>0&&o0.jsx("div",{className:"apteva-widget-standalone",children:o0.jsx(XG,{widgets:Y.widgets,onAction:H,layout:"stack"})}),o0.jsx("div",{className:"apteva-message-timestamp apteva-message-timestamp-assistant",suppressHydrationWarning:!0,children:Y.timestamp.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]});if(G&&k)return o0.jsxs("div",{className:"apteva-message-segmented apteva-message-user-with-attachments flex flex-col items-end",children:[S(),Y.content&&o0.jsx("div",{className:"apteva-message-bubble apteva-message-user",children:o0.jsx("div",{className:"apteva-message-content-user",children:o0.jsx("div",{className:"apteva-message-text",children:Y.content})})}),o0.jsx("div",{className:"apteva-message-timestamp apteva-message-timestamp-user",suppressHydrationWarning:!0,children:Y.timestamp.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]});return o0.jsxs("div",{className:P4("apteva-message-bubble",G?"apteva-message-user":"apteva-message-assistant"),children:[o0.jsx("div",{className:G?"apteva-message-content-user":"apteva-message-content-assistant",children:V()}),Y.widgets&&Y.widgets.length>0&&o0.jsx("div",{className:"apteva-widget-standalone",children:o0.jsx(XG,{widgets:Y.widgets,onAction:H,layout:"stack"})}),o0.jsx("div",{className:P4("apteva-message-timestamp",G?"apteva-message-timestamp-user":"apteva-message-timestamp-assistant"),suppressHydrationWarning:!0,children:Y.timestamp.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]})}var YO=()=>v1.jsx("svg",{className:"w-12 h-12 sm:w-16 sm:h-16",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:v1.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"})}),ZG=()=>v1.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:v1.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 7l5 5m0 0l-5 5m5-5H6"})});function kI({title:Y,subtitle:H,icon:B,prompts:K,variant:G="centered",chatVariant:_="default",onPromptClick:W}){let O=(K||[]).map((M)=>typeof M==="string"?{text:M}:M),F=O.length>0,b=Y||H||B;if(!b&&!F)return v1.jsx("div",{className:"flex items-center justify-center h-full !text-neutral-500 dark:!text-neutral-400",children:v1.jsxs("div",{className:"text-center space-y-2",children:[v1.jsx("div",{className:"flex justify-center",children:v1.jsx(YO,{})}),v1.jsx("p",{className:"text-sm",children:"No messages yet. Start a conversation!"})]})});if(G==="minimal")return v1.jsxs("div",{className:"flex flex-col h-full px-4 py-4",children:[b&&v1.jsxs("div",{className:"mb-4",children:[Y&&v1.jsx("h2",{className:"text-lg font-semibold !text-neutral-900 dark:!text-white",children:Y}),H&&v1.jsx("p",{className:"text-sm !text-neutral-500 dark:!text-neutral-400 mt-1",children:H})]}),F&&v1.jsx("div",{className:"flex-1 space-y-2",children:O.map((M,A)=>v1.jsx("button",{onClick:()=>W(M.text),className:P4("w-full text-left px-4 py-3 rounded-xl","bg-neutral-50 dark:bg-neutral-800/50","border border-neutral-200 dark:border-neutral-700","hover:bg-neutral-100 dark:hover:bg-neutral-800","hover:border-neutral-300 dark:hover:border-neutral-600","transition-all duration-200","group"),children:v1.jsxs("div",{className:"flex items-center gap-3",children:[v1.jsx("div",{className:"flex-shrink-0 !text-neutral-400 dark:!text-neutral-500 group-hover:!text-blue-500 dark:group-hover:!text-blue-400 transition-colors",children:M.icon||v1.jsx(ZG,{})}),v1.jsxs("div",{className:"flex-1 min-w-0",children:[v1.jsx("p",{className:"text-sm font-medium !text-neutral-900 dark:!text-white truncate",children:M.text}),M.description&&v1.jsx("p",{className:"text-xs !text-neutral-500 dark:!text-neutral-400 mt-0.5 truncate",children:M.description})]})]})},A))})]});return v1.jsxs("div",{className:"flex flex-col items-center justify-center h-full px-4 py-6 sm:py-8",children:[v1.jsxs("div",{className:"text-center mb-6 sm:mb-8 max-w-md",children:[v1.jsx("div",{className:"mb-4 !text-neutral-400 dark:!text-neutral-500 flex justify-center",children:B||v1.jsx(YO,{})}),Y&&v1.jsx("h1",{className:"text-xl sm:text-2xl font-semibold !text-neutral-900 dark:!text-white mb-2",children:Y}),H&&v1.jsx("p",{className:"text-sm sm:text-base !text-neutral-500 dark:!text-neutral-400",children:H})]}),F&&v1.jsxs("div",{className:"w-full max-w-2xl",children:[v1.jsx("div",{className:"sm:hidden space-y-2",children:O.map((M,A)=>v1.jsx("button",{onClick:()=>W(M.text),className:P4("w-full text-left px-4 py-3 rounded-xl","bg-white dark:bg-neutral-800","border border-neutral-200 dark:border-neutral-700","hover:bg-neutral-50 dark:hover:bg-neutral-700","hover:border-blue-300 dark:hover:border-blue-600","active:scale-[0.98]","transition-all duration-200","shadow-sm hover:shadow","group"),children:v1.jsxs("div",{className:"flex items-center gap-3",children:[v1.jsx("div",{className:"flex-shrink-0 w-8 h-8 rounded-lg bg-neutral-100 dark:bg-neutral-700 flex items-center justify-center !text-neutral-500 dark:!text-neutral-400 group-hover:bg-blue-100 dark:group-hover:bg-blue-900/30 group-hover:!text-blue-600 dark:group-hover:!text-blue-400 transition-colors",children:M.icon||v1.jsx(ZG,{})}),v1.jsxs("div",{className:"flex-1 min-w-0",children:[v1.jsx("p",{className:"text-sm font-medium !text-neutral-900 dark:!text-white",children:M.text}),M.description&&v1.jsx("p",{className:"text-xs !text-neutral-500 dark:!text-neutral-400 mt-0.5 line-clamp-1",children:M.description})]}),v1.jsx("svg",{className:"w-4 h-4 !text-neutral-400 group-hover:!text-blue-500 transition-colors flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:v1.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})]})},A))}),v1.jsx("div",{className:"hidden sm:grid sm:grid-cols-2 gap-3",children:O.map((M,A)=>v1.jsx("button",{onClick:()=>W(M.text),className:P4("text-left p-4 rounded-xl","bg-white dark:bg-neutral-800","border border-neutral-200 dark:border-neutral-700","hover:bg-neutral-50 dark:hover:bg-neutral-700","hover:border-blue-300 dark:hover:border-blue-600","hover:shadow-md","active:scale-[0.98]","transition-all duration-200","group"),children:v1.jsxs("div",{className:"flex items-start gap-3",children:[v1.jsx("div",{className:"flex-shrink-0 w-9 h-9 rounded-lg bg-neutral-100 dark:bg-neutral-700 flex items-center justify-center !text-neutral-500 dark:!text-neutral-400 group-hover:bg-blue-100 dark:group-hover:bg-blue-900/30 group-hover:!text-blue-600 dark:group-hover:!text-blue-400 transition-colors",children:M.icon||v1.jsx(ZG,{})}),v1.jsxs("div",{className:"flex-1 min-w-0",children:[v1.jsx("p",{className:"text-sm font-medium !text-neutral-900 dark:!text-white leading-snug",children:M.text}),M.description&&v1.jsx("p",{className:"text-xs !text-neutral-500 dark:!text-neutral-400 mt-1 line-clamp-2",children:M.description})]})]})},A))})]})]})}function CI({messages:Y,onAction:H,welcomeTitle:B,welcomeSubtitle:K,welcomeIcon:G,suggestedPrompts:_,welcomeVariant:W,chatVariant:O,onPromptClick:F,enableWidgets:b,onWidgetRender:M}){let A=xz.useRef(null),R=xz.useRef(!0),k=xz.useRef(0),S=()=>{if(A.current){let{scrollTop:V,scrollHeight:x,clientHeight:f}=A.current;R.current=x-V-f<100}};return xz.useEffect(()=>{if(A.current&&R.current){let V=A.current.scrollHeight;if(V!==k.current)A.current.scrollTop=V,k.current=V}},[Y]),pX.jsx("div",{ref:A,className:"apteva-message-list apteva-scrollbar-hidden",onScroll:S,children:Y.length===0?pX.jsx(kI,{title:B,subtitle:K,icon:G,prompts:_,variant:W,chatVariant:O,onPromptClick:F||(()=>{})}):Y.map((V)=>pX.jsx("div",{className:V.role==="user"?"apteva-message-row-user":"apteva-message-row-assistant",children:pX.jsx(TI,{message:V,onAction:H,enableWidgets:b,onWidgetRender:M})},V.id))})}function vI({onSendMessage:Y,placeholder:H="Type a message...",disabled:B=!1,isLoading:K=!1,onStop:G,onFileUpload:_,onSwitchMode:W}){let[O,F]=T7.useState(""),[b,M]=T7.useState(!1),[A,R]=T7.useState([]),[k,S]=T7.useState(null),[V,x]=T7.useState(!1),f=T7.useRef(null),l=T7.useRef(null),T=T7.useRef(null),m=(g)=>{if(g.key==="Enter"&&!g.shiftKey)g.preventDefault(),E()},E=()=>{let g=O.trim(),Q0=A.length>0;if((g||Q0)&&!B){let r=A.map((U0)=>U0.file);if(Y(O.trim(),r.length>0?r:void 0),F(""),R([]),S(null),x(!1),f.current)f.current.style.height="auto"}},D=(g)=>{F(g.target.value),g.target.style.height="auto";let Q0=g.target.scrollHeight;g.target.style.height=`${Q0}px`;let r=g.target.value.includes(`
|
|
189
|
+
`),R0=Q0>36;if(!V&&(r||R0))x(!0);else if(V&&!r&&!R0&&g.target.value.length<20)x(!1)},n=(g)=>{if(g.target.files&&g.target.files.length>0){let Q0=Array.from(g.target.files),r=[],U0=[];if(Q0.forEach((R0)=>{let _0=$O(R0);if(_0.valid){let f0={file:R0};if(R0.type.startsWith("image/"))f0.preview=URL.createObjectURL(R0);r.push(f0)}else U0.push(_0.error||"Invalid file")}),r.length>0)R((R0)=>[...R0,...r]);if(U0.length>0)S(U0.join(", ")),setTimeout(()=>S(null),5000);_?.(g.target.files),M(!1),g.target.value=""}},c=(g)=>{R((Q0)=>{let r=Q0[g];if(r.preview)URL.revokeObjectURL(r.preview);return Q0.filter((U0,R0)=>R0!==g)})},j=(g)=>{if(g.startsWith("image/"))return I1.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:I1.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})});if(g==="application/pdf")return I1.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:I1.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"})});return I1.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:I1.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})})};return I1.jsxs("div",{className:"px-4 py-3 relative",children:[k&&I1.jsx("div",{className:"absolute bottom-full left-4 right-4 mb-2 p-3 bg-red-50 dark:bg-red-900/30 border border-red-200 dark:border-red-800 rounded-lg z-20",children:I1.jsxs("div",{className:"flex items-center gap-2 !text-red-700 dark:!text-red-300 text-sm",children:[I1.jsx("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:I1.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),I1.jsx("span",{children:k})]})}),A.length>0&&I1.jsx("div",{className:"mb-2 flex flex-wrap gap-2",children:A.map((g,Q0)=>I1.jsxs("div",{className:"relative group flex items-center gap-2 px-3 py-2 bg-neutral-100 dark:bg-neutral-800 border border-neutral-200 dark:border-neutral-700 rounded-lg",children:[g.preview?I1.jsx("img",{src:g.preview,alt:g.file.name,className:"w-8 h-8 object-cover rounded"}):I1.jsx("div",{className:"w-8 h-8 flex items-center justify-center bg-neutral-200 dark:bg-neutral-700 rounded !text-neutral-500 dark:!text-neutral-400",children:j(g.file.type)}),I1.jsxs("div",{className:"flex flex-col min-w-0",children:[I1.jsx("span",{className:"text-xs font-medium !text-neutral-700 dark:!text-neutral-300 truncate max-w-[120px]",children:g.file.name}),I1.jsx("span",{className:"text-xs !text-neutral-500 dark:!text-neutral-400",children:_J(g.file.size)})]}),I1.jsx("button",{onClick:()=>c(Q0),className:"absolute -top-1.5 -right-1.5 w-5 h-5 bg-neutral-500 hover:bg-red-500 text-white rounded-full flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity",title:"Remove file",children:I1.jsx("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:I1.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]},Q0))}),I1.jsxs("div",{className:"apteva-composer",style:{gridTemplateColumns:"auto 1fr auto",gridTemplateAreas:V?'"textarea textarea textarea" "plus . send"':'"plus textarea send"',alignItems:"end"},children:[I1.jsxs("div",{className:"relative flex-shrink-0 self-end",style:{gridArea:"plus"},children:[I1.jsx("button",{ref:T,onClick:()=>M(!b),className:"apteva-composer-menu-btn w-8 h-8 rounded-lg flex items-center justify-center transition-all !text-neutral-700 dark:!text-neutral-300 hover:bg-neutral-100 dark:hover:bg-neutral-800",title:"More options",children:I1.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:I1.jsx("path",{d:"M10 5v10M5 10h10",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),b&&I1.jsxs(I1.Fragment,{children:[I1.jsx("div",{className:"fixed inset-0 z-[9998]",onClick:()=>M(!1)}),I1.jsxs("div",{className:"apteva-composer-menu fixed bg-neutral-800 dark:bg-neutral-800 rounded-xl shadow-lg overflow-hidden z-[9999] min-w-[200px]",style:{left:T.current?.getBoundingClientRect().left??0,bottom:window.innerHeight-(T.current?.getBoundingClientRect().top??0)+8},children:[I1.jsxs("button",{onClick:()=>{l.current?.click(),M(!1)},className:"w-full flex items-center gap-3 px-4 py-3 hover:bg-neutral-700 dark:hover:bg-neutral-700 transition-colors !text-white text-left",children:[I1.jsx("svg",{width:"18",height:"18",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:I1.jsx("path",{d:"M10.5 3.5L5.5 8.5C4.67157 9.32843 4.67157 10.6716 5.5 11.5C6.32843 12.3284 7.67157 12.3284 8.5 11.5L14.5 5.5C15.8807 4.11929 15.8807 1.88071 14.5 0.5C13.1193 -0.880711 10.8807 -0.880711 9.5 0.5L3.5 6.5C1.56846 8.43154 1.56846 11.5685 3.5 13.5C5.43154 15.4315 8.56846 15.4315 10.5 13.5L15.5 8.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",transform:"translate(2, 3)"})}),I1.jsx("span",{className:"!text-sm font-medium",children:"Add photos & files"})]}),W&&I1.jsxs("button",{onClick:()=>{W(),M(!1)},className:"w-full flex items-center gap-3 px-4 py-3 hover:bg-neutral-700 dark:hover:bg-neutral-700 transition-colors !text-white text-left border-t border-neutral-700 dark:border-neutral-700",children:[I1.jsx("svg",{className:"w-4.5 h-4.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:I1.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 10V3L4 14h7v7l9-11h-7z"})}),I1.jsx("span",{className:"!text-sm font-medium",children:"Switch to command mode"})]})]})]})]}),I1.jsx("textarea",{ref:f,value:O,onChange:D,onKeyDown:m,placeholder:H,disabled:B,className:"apteva-composer-textarea resize-none bg-transparent border-none focus:outline-none !text-neutral-900 dark:!text-neutral-100 placeholder-neutral-400 dark:placeholder-neutral-500 py-1 disabled:opacity-50 disabled:cursor-not-allowed overflow-y-auto max-h-[200px]",style:{gridArea:"textarea"},rows:1}),I1.jsx("div",{className:"self-end",style:{gridArea:"send"},children:K&&G?I1.jsx("button",{onClick:G,className:"apteva-composer-stop-btn",title:"Stop generation",children:I1.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:I1.jsx("rect",{x:"2",y:"2",width:"10",height:"10",rx:"1",fill:"currentColor"})})}):I1.jsx("button",{onClick:E,disabled:!O.trim()&&A.length===0||B,className:"apteva-composer-send-btn w-8 h-8 rounded-lg flex items-center justify-center font-bold transition-all flex-shrink-0 border border-neutral-300 dark:border-neutral-600 bg-white dark:bg-neutral-800 !text-neutral-700 dark:!text-neutral-300 hover:bg-neutral-50 dark:hover:bg-neutral-700 disabled:opacity-30 disabled:cursor-not-allowed !text-lg",title:"Send message",children:I1.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:I1.jsx("path",{d:"M8 3L8 13M8 3L4 7M8 3L12 7",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})})]}),I1.jsx("input",{ref:l,type:"file",multiple:!0,onChange:n,className:"hidden",accept:"image/*,application/pdf,.doc,.docx,.txt"})]})}function SI({onExecute:Y,state:H,response:B,error:K,plan:G,streamedContent:_,toolName:W,onApprove:O,onReject:F,onReset:b,onStop:M,onExpand:A,placeholder:R="Enter your command...",disabled:k=!1}){let[S,V]=Z8.useState(""),[x,f]=Z8.useState([]),[l,T]=Z8.useState(null),[m,E]=Z8.useState(!1),D=Z8.useRef(null),n=Z8.useRef(null),c=Z8.useRef(null),j=()=>{let B0=S.trim(),G0=x.length>0;if((B0||G0)&&!k&&H==="idle"){let h0=x.map((z0)=>z0.file);Y(S.trim(),h0.length>0?h0:void 0),V(""),f([])}},g=(B0)=>{if(B0.key==="Enter"&&!B0.shiftKey)B0.preventDefault(),j()},Q0=()=>{b?.(),D.current?.focus()},r=(B0)=>{if(V(B0),D.current)D.current.style.height="auto",D.current.style.height=`${Math.min(D.current.scrollHeight,120)}px`},U0=(B0)=>{if(B0.target.files&&B0.target.files.length>0){let G0=Array.from(B0.target.files),h0=[],z0=[];if(G0.forEach((v0)=>{let j0=$O(v0);if(j0.valid){let Y1={file:v0};if(v0.type.startsWith("image/"))Y1.preview=URL.createObjectURL(v0);h0.push(Y1)}else z0.push(j0.error||"Invalid file")}),h0.length>0)f((v0)=>[...v0,...h0]);if(z0.length>0)T(z0.join(", ")),setTimeout(()=>T(null),5000);E(!1),B0.target.value=""}},R0=(B0)=>{f((G0)=>{let h0=G0[B0];if(h0.preview)URL.revokeObjectURL(h0.preview);return G0.filter((z0,v0)=>v0!==B0)})},_0=(B0)=>{if(B0.startsWith("image/"))return z1.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:z1.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})});if(B0==="application/pdf")return z1.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:z1.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"})});return z1.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:z1.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})})},f0=()=>{if(H==="loading"){if(W)return{text:W,isToolCall:!0};if(_)return{text:_,isToolCall:!1};return{text:"Processing...",isToolCall:!1}}if(H==="success"&&B)return{text:B,isToolCall:!1};if(H==="error"&&K)return{text:K,isToolCall:!1};if(H==="plan-pending"&&G)return{text:G,isToolCall:!1};return{text:"",isToolCall:!1}},P0=H!=="idle",{text:a,isToolCall:Y0}=f0();return z1.jsxs("div",{className:"w-full relative",children:[l&&z1.jsx("div",{className:"absolute -top-12 left-0 right-0 mx-3 p-2 bg-red-50 dark:bg-red-900/30 border border-red-200 dark:border-red-800 rounded-lg z-30",children:z1.jsxs("div",{className:"flex items-center gap-2 !text-red-700 dark:!text-red-300 text-xs",children:[z1.jsx("svg",{className:"w-3 h-3 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:z1.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),z1.jsx("span",{children:l})]})}),z1.jsxs("div",{className:P4("apteva-composer flex items-center gap-2 px-3 py-2 border-2 bg-white dark:bg-neutral-900 transition-all duration-200",H==="idle"&&"border-neutral-200 dark:border-neutral-700",H==="loading"&&"border-blue-400 dark:border-blue-500",H==="plan-pending"&&"border-amber-400 dark:border-amber-500",H==="success"&&"border-green-400 dark:border-green-500",H==="error"&&"border-red-400 dark:border-red-500"),children:[z1.jsxs("div",{className:"w-8 h-8 flex items-center justify-center flex-shrink-0",children:[H==="idle"&&z1.jsxs("div",{className:"relative",children:[z1.jsx("button",{ref:c,onClick:()=>E(!m),className:"apteva-composer-menu-btn w-8 h-8 rounded-lg flex items-center justify-center transition-all !text-neutral-500 dark:!text-neutral-400 hover:!text-neutral-700 dark:hover:!text-neutral-200 hover:bg-neutral-100 dark:hover:bg-neutral-800",title:"More options",children:z1.jsx("svg",{width:"18",height:"18",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:z1.jsx("path",{d:"M10 5v10M5 10h10",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),m&&z1.jsxs(z1.Fragment,{children:[z1.jsx("div",{className:"fixed inset-0 z-[9998]",onClick:()=>E(!1)}),z1.jsxs("div",{className:"apteva-composer-menu fixed bg-neutral-800 dark:bg-neutral-800 rounded-xl shadow-lg overflow-hidden z-[9999] min-w-[200px]",style:{left:c.current?.getBoundingClientRect().left??0,top:(c.current?.getBoundingClientRect().bottom??0)+8},children:[z1.jsxs("button",{onClick:()=>{n.current?.click(),E(!1)},className:"w-full flex items-center gap-3 px-4 py-3 hover:bg-neutral-700 dark:hover:bg-neutral-700 transition-colors !text-white text-left",children:[z1.jsx("svg",{width:"18",height:"18",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:z1.jsx("path",{d:"M10.5 3.5L5.5 8.5C4.67157 9.32843 4.67157 10.6716 5.5 11.5C6.32843 12.3284 7.67157 12.3284 8.5 11.5L14.5 5.5C15.8807 4.11929 15.8807 1.88071 14.5 0.5C13.1193 -0.880711 10.8807 -0.880711 9.5 0.5L3.5 6.5C1.56846 8.43154 1.56846 11.5685 3.5 13.5C5.43154 15.4315 8.56846 15.4315 10.5 13.5L15.5 8.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",transform:"translate(2, 3)"})}),z1.jsx("span",{className:"!text-sm font-medium",children:"Add photos & files"})]}),A&&z1.jsxs("button",{onClick:()=>{A(),E(!1)},className:"w-full flex items-center gap-3 px-4 py-3 hover:bg-neutral-700 dark:hover:bg-neutral-700 transition-colors !text-white text-left border-t border-neutral-700 dark:border-neutral-700",children:[z1.jsx("svg",{className:"w-4.5 h-4.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:z1.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"})}),z1.jsx("span",{className:"!text-sm font-medium",children:"Expand to chat"})]})]})]})]}),H==="loading"&&!W&&z1.jsx("div",{className:"w-4 h-4 border-2 border-blue-200 border-t-blue-500 rounded-full animate-spin"}),H==="loading"&&W&&z1.jsx("div",{className:"w-2 h-2 rounded-full bg-blue-500 animate-pulse"})]}),x.length>0&&H==="idle"&&z1.jsx("div",{className:"flex items-center gap-1 flex-shrink-0",children:x.map((B0,G0)=>z1.jsxs("div",{className:"relative group flex items-center justify-center w-6 h-6 bg-neutral-100 dark:bg-neutral-800 rounded overflow-hidden",title:B0.file.name,children:[B0.preview?z1.jsx("img",{src:B0.preview,alt:B0.file.name,className:"w-6 h-6 object-cover"}):z1.jsx("span",{className:"text-xs !text-neutral-500 dark:!text-neutral-400",children:_0(B0.file.type)}),z1.jsx("button",{onClick:()=>R0(G0),className:"absolute inset-0 bg-black/50 opacity-0 group-hover:opacity-100 flex items-center justify-center transition-opacity",title:"Remove",children:z1.jsx("svg",{className:"w-3 h-3 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:z1.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]},G0))}),H==="idle"?z1.jsx("textarea",{ref:D,value:S,onChange:(B0)=>r(B0.target.value),onKeyDown:g,placeholder:x.length>0?"Add a message...":R,disabled:k,rows:1,className:P4("flex-1 resize-none bg-transparent border-none focus:outline-none","!text-neutral-900 dark:!text-neutral-100 placeholder-neutral-400 dark:placeholder-neutral-500","text-sm leading-relaxed py-1","disabled:opacity-50"),style:{minHeight:"24px",maxHeight:"120px"}}):z1.jsx("div",{className:P4("flex-1 text-sm py-1 truncate flex items-center gap-2",H==="loading"&&!Y0&&"!text-neutral-600 dark:!text-neutral-400",H==="loading"&&Y0&&"!text-blue-600 dark:!text-blue-400",H==="success"&&"!text-neutral-900 dark:!text-neutral-100",H==="error"&&"!text-red-600 dark:!text-red-400",H==="plan-pending"&&"!text-amber-700 dark:!text-amber-300"),children:Y0?z1.jsxs(z1.Fragment,{children:[z1.jsx("span",{className:"font-mono",children:a}),z1.jsx("span",{className:"text-neutral-400 dark:text-neutral-500",children:"Running..."})]}):a}),z1.jsx("div",{className:"w-8 h-8 flex items-center justify-center flex-shrink-0",children:H==="plan-pending"?z1.jsxs("div",{className:"flex items-center gap-1",children:[z1.jsx("button",{onClick:O,className:"px-2 py-1 bg-amber-500 text-white rounded-lg hover:bg-amber-600 transition-colors text-xs font-medium",children:"Approve"}),z1.jsx("button",{onClick:F,className:"px-2 py-1 bg-neutral-200 dark:bg-neutral-700 text-neutral-700 dark:text-neutral-300 rounded-lg hover:bg-neutral-300 dark:hover:bg-neutral-600 transition-colors text-xs font-medium",children:"Modify"})]}):z1.jsxs(z1.Fragment,{children:[H==="loading"&&M&&z1.jsx("button",{onClick:M,className:"apteva-composer-stop-btn",title:"Stop generation",children:z1.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:z1.jsx("rect",{x:"2",y:"2",width:"10",height:"10",rx:"1",fill:"currentColor"})})}),(H==="success"||H==="error")&&z1.jsx("button",{onClick:Q0,className:"w-8 h-8 rounded-lg flex items-center justify-center !text-neutral-400 hover:!text-neutral-600 dark:hover:!text-neutral-300 hover:bg-neutral-100 dark:hover:bg-neutral-800 transition-colors",title:"New command",children:z1.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:z1.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})}),H==="idle"&&z1.jsx("button",{onClick:j,disabled:!S.trim()&&x.length===0||k,className:P4("apteva-composer-send-btn w-8 h-8 rounded-lg flex items-center justify-center transition-all","border border-neutral-200 dark:border-neutral-700","disabled:opacity-30 disabled:cursor-not-allowed",S.trim()||x.length>0?"bg-neutral-900 dark:bg-white !text-white dark:!text-neutral-900 border-neutral-900 dark:border-white":"bg-white dark:bg-neutral-800 !text-neutral-400"),title:"Execute command",children:z1.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:z1.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 12h14M12 5l7 7-7 7"})})})]})})]}),z1.jsx("input",{ref:n,type:"file",multiple:!0,onChange:U0,className:"hidden",accept:"image/*,application/pdf,.doc,.docx,.txt"})]})}var fI="http://91.99.200.48:3000/agents",hI="agt_894abd5966bc9f1e9f8f17f2a6f6b5e0",yI=class{constructor(){nA(this,"config"),this.config={apiUrl:fI,apiKey:hI}}configure(Y){if(Y.apiUrl)this.config.apiUrl=Y.apiUrl;if(Y.apiKey)this.config.apiKey=Y.apiKey}getConfig(){return{...this.config}}async chat(Y){try{console.log("[AptevaClient] Chat request:",{agent_id:Y.agent_id,message:typeof Y.message==="string"?Y.message.substring(0,100)+"...":"[multi-part message]",system:Y.system,stream:Y.stream});let H=await fetch(`${this.config.apiUrl}/chat`,{method:"POST",headers:{"Content-Type":"application/json","X-API-Key":this.config.apiKey},body:JSON.stringify(Y)});if(!H.ok){let K=await H.json().catch(()=>({error:"Request failed"}));throw Error(K.error||`Request failed with status ${H.status}`)}let B=await H.json();return{message:B.response||B.message||"",thread_id:B.thread_id,widgets:B.widgets}}catch(H){throw console.error("Chat API error:",H),H}}async chatStream(Y,H,B,K){try{console.log("[AptevaClient] Chat stream request:",{agent_id:Y.agent_id,message:typeof Y.message==="string"?Y.message.substring(0,100)+"...":"[multi-part message]",system:Y.system,stream:Y.stream});let G=await fetch(`${this.config.apiUrl}/chat`,{method:"POST",headers:{"Content-Type":"application/json","X-API-Key":this.config.apiKey,Accept:"text/event-stream"},body:JSON.stringify({...Y,stream:!0})});if(!G.ok){let b=await G.json().catch(()=>({error:"Request failed"}));throw Error(b.error||`Request failed with status ${G.status}`)}let _=G.body?.getReader();if(!_)throw Error("Response body is not readable");let W=new TextDecoder,O="",F="";while(!0){let{done:b,value:M}=await _.read();if(b)break;O+=W.decode(M,{stream:!0});let A=O.split(`
|
|
190
|
+
`);O=A.pop()||"";for(let R of A){if(!R.trim()||R.startsWith(":"))continue;if(R.startsWith("data: ")){let k=R.slice(6);if(k==="[DONE]"){B?.(F);return}try{let S=JSON.parse(k);if(S.thread_id)F=S.thread_id;H(S)}catch(S){console.warn("[AptevaClient] Failed to parse SSE data:",k)}}}}B?.(F)}catch(G){let _=G instanceof Error?G:Error("Unknown error");throw K?.(_),_}}async createThread(Y,H){let B=await fetch(`${this.config.apiUrl}/agents/${Y}/threads`,{method:"POST",headers:{"Content-Type":"application/json","X-API-Key":this.config.apiKey},body:JSON.stringify({metadata:H})});if(!B.ok){let G=await B.json().catch(()=>({error:"Request failed"}));throw Error(G.error||`Request failed with status ${B.status}`)}return(await B.json()).thread_id}async getThreadMessages(Y){let H=await fetch(`${this.config.apiUrl}/threads/${Y}/messages`,{method:"GET",headers:{"X-API-Key":this.config.apiKey}});if(!H.ok){let K=await H.json().catch(()=>({error:"Request failed"}));throw Error(K.error||`Request failed with status ${H.status}`)}return(await H.json()).messages}async cancelRequest(Y,H){try{let B=await fetch(`${this.config.apiUrl}/agents/${Y}/requests/${H}/cancel`,{method:"POST",headers:{"Content-Type":"application/json","X-API-Key":this.config.apiKey}});if(!B.ok){let K=await B.json().catch(()=>({error:"Cancel request failed"}));throw Error(K.error||`Cancel request failed with status ${B.status}`)}}catch(B){throw console.error("[AptevaClient] Cancel request error:",B),B}}},Ez=new yI,LJ=q4.forwardRef(function({agentId:H,threadId:B,initialMessages:K=[],context:G,apiUrl:_,apiKey:W,useMock:O=!1,initialMode:F="chat",showModeToggle:b=!1,onModeChange:M,commandVariant:A="default",planMode:R=!1,onPlanModeChange:k,enableStreaming:S=!0,showProgress:V=!0,loadingText:x="Processing...",welcomeTitle:f,welcomeSubtitle:l,welcomeIcon:T,suggestedPrompts:m,welcomeVariant:E,onThreadChange:D,onMessageSent:n,onAction:c,onFileUpload:j,onComplete:g,onError:Q0,onToolCall:r,onToolResult:U0,variant:R0="default",placeholder:_0,showHeader:f0=!0,headerTitle:P0="Chat",enableWidgets:a=!1,availableWidgets:Y0,compactWidgetContext:B0=!1,onWidgetRender:G0,className:h0},z0){let[v0,j0]=q4.useState(K),[Y1,m0]=q4.useState(!1),[F1,R1]=q4.useState(B||null),[p,O0]=q4.useState(F),[V0,q1]=q4.useState(null),[y1,M1]=q4.useState("idle"),[A0,Z1]=q4.useState(null),[h1,n1]=q4.useState(null),[f4,B4]=q4.useState(0),[T5,A4]=q4.useState(""),[k5,h4]=q4.useState(""),[D4,M5]=q4.useState(null),[x5,o4]=q4.useState(null),[X5,g0]=q4.useState(""),[$1,K1]=q4.useState(""),[r1,U4]=q4.useState(R),[x4,w4]=q4.useState(!1),z5=q4.useRef(null),V1=q4.useRef(null);q4.useImperativeHandle(z0,()=>({sendMessage:async(c1)=>{if(V1.current)await V1.current(c1)},sendSystemMessage:async(c1)=>{if(V1.current)await V1.current(c1,void 0,!0)},getMessages:()=>v0,clearMessages:()=>j0([])}),[v0]);let S1=q4.useMemo(()=>{if(!a)return G;let c1=B0?BI(Y0):qI(Y0);return G?`${G}
|
|
191
|
+
${c1}`:c1},[G,a,Y0,B0]);q4.useEffect(()=>{if(_||W)Ez.configure({..._&&{apiUrl:_},...W&&{apiKey:W}})},[_,W]),q4.useEffect(()=>{if(B)D?.(B)},[B,D]),q4.useEffect(()=>{U4(R)},[R]),q4.useEffect(()=>{let c1=(W4)=>{let b4=W4.target;if(x4&&!b4.closest(".settings-menu-container"))w4(!1)};return document.addEventListener("mousedown",c1),()=>document.removeEventListener("mousedown",c1)},[x4]);let t5=(c1)=>{if(O0(c1),M?.(c1),c1==="command")M1("idle"),Z1(null),n1(null)},w5=p==="chat"?"Type a message...":"Enter your command...",s5=async(c1,W4,b4)=>{let z4=W4&&W4.length>0,y=z4?W4.map((W0)=>({name:W0.name,type:W0.type,size:W0.size,preview:W0.type.startsWith("image/")?URL.createObjectURL(W0):void 0})):[];if(!b4){let W0={id:`msg-${Date.now()}`,role:"user",content:c1,timestamp:new Date,metadata:z4?{attachments:y}:void 0};j0((F0)=>[...F0,W0]),n?.(W0)}m0(!0);try{let W0=await XO(c1,W4);if(O){let F0=await rA(1000);j0((v)=>[...v,F0])}else{let F0=[],v="",o=[],N0=F1,k0={},E0={},Q1=`msg-${Date.now()}`,a0=()=>{let w0=[...F0];if(v){let D0=w0[w0.length-1];if(D0&&D0.type==="text")D0.content=v;else w0.push({type:"text",content:v})}j0((D0)=>{let J1=D0[D0.length-1];if(J1&&J1.role==="assistant")return[...D0.slice(0,-1),{...J1,content:v,widgets:o.length>0?o:void 0,metadata:{...J1.metadata,content_segments:w0,isStreaming:!0}}];else return[...D0,{id:Q1,role:"assistant",content:v,widgets:o.length>0?o:void 0,timestamp:new Date,metadata:{content_segments:w0,isStreaming:!0}}]})};await Ez.chatStream({agent_id:H,message:W0,stream:!0,...F1&&{thread_id:F1},...S1&&{system:S1}},(w0)=>{switch(w0.type){case"thread_id":if(w0.thread_id){if(N0=w0.thread_id,!F1)R1(w0.thread_id),D?.(w0.thread_id)}break;case"request_id":if(w0.request_id)o4(w0.request_id);break;case"content":case"token":if(w0.content)v+=w0.content,a0();break;case"tool_call":if(w0.tool_id&&w0.tool_name){let D0=w0.tool_display_name||w0.tool_name;if(v)F0.push({type:"text",content:v}),v="";F0.push({type:"tool",id:w0.tool_id,name:D0,status:"preparing"}),k0[w0.tool_id]="",q1(D0),r?.(w0.tool_name,w0.tool_id),a0()}break;case"tool_input_delta":if(w0.tool_id&&w0.content){let D0=w0.tool_id;if(k0[D0]===void 0)k0[D0]="";k0[D0]+=w0.content;let J1=F0.find((d1)=>d1.type==="tool"&&d1.id===D0);if(J1){if(J1.isReceiving=!0,J1.inputLength=k0[D0].length,a0(),E0[D0])clearTimeout(E0[D0]);E0[D0]=setTimeout(()=>{if(J1.status==="preparing")J1.isReceiving=!1,a0()},150)}}break;case"tool_use":if(w0.tool_id){let D0=F0.find((J1)=>J1.type==="tool"&&J1.id===w0.tool_id);if(D0&&D0.status==="preparing")D0.status="running",D0.isReceiving=!1,a0()}break;case"tool_stream":if(w0.tool_id){let D0=F0.find((J1)=>J1.type==="tool"&&J1.id===w0.tool_id);if(D0){if(w0.event==="chunk"&&w0.content){if(D0.pendingReset)D0.streamOutput="",D0.pendingReset=!1;D0.streamOutput=(D0.streamOutput||"")+w0.content,a0()}else if(w0.event==="log"||w0.event==="progress")D0.pendingReset=!0}}break;case"tool_result":if(w0.tool_id){let D0=F0.find((J1)=>J1.type==="tool"&&J1.id===w0.tool_id);if(D0)D0.result=w0.content,D0.status="completed",D0.isReceiving=!1,U0?.(D0.name,w0.content);q1(null),a0()}break;case"widget":if(w0.widget)o.push(w0.widget),a0();break;case"error":throw Error(w0.message||"Stream error")}},(w0)=>{if(v){let D0=F0[F0.length-1];if(D0&&D0.type==="text")D0.content=v;else F0.push({type:"text",content:v})}if(j0((D0)=>{let J1=D0[D0.length-1];if(J1&&J1.role==="assistant")return[...D0.slice(0,-1),{...J1,content:v||"Response received",widgets:o.length>0?o:void 0,metadata:{thread_id:w0,content_segments:F0,isStreaming:!1}}];return D0}),w0&&w0!==F1)R1(w0),D?.(w0);m0(!1),o4(null),q1(null)},(w0)=>{let D0={id:`msg-${Date.now()}-error`,role:"assistant",content:`Error: ${w0.message}`,timestamp:new Date,metadata:{error:!0}};j0((J1)=>{let d1=J1[J1.length-1];if(d1&&d1.id.includes("streaming"))return[...J1.slice(0,-1),D0];return[...J1,D0]}),m0(!1),o4(null),q1(null),Q0?.(w0)})}}catch(W0){let F0={id:`msg-${Date.now()}-error`,role:"assistant",content:W0 instanceof Error?`Error: ${W0.message}`:"An error occurred",timestamp:new Date,metadata:{error:!0}};j0((v)=>[...v,F0]),Q0?.(W0 instanceof Error?W0:Error("Unknown error"))}finally{m0(!1)}};V1.current=s5;let q7=async(c1,W4)=>{let b4=c1||T5;if(!b4.trim()&&(!W4||W4.length===0)){n1(Error("Please enter a command")),M1("error");return}if(r1&&y1!=="plan-pending"){if(M1("loading"),n1(null),A4(""),O)setTimeout(()=>{let z4=`1. Analyze the request: "${b4}"
|
|
192
|
+
2. Process the data
|
|
193
|
+
3. Generate response
|
|
194
|
+
4. Return results`;g0(z4),K1(b4),M1("plan-pending")},800);else try{let y=S1?`${S1}
|
|
195
|
+
|
|
196
|
+
CRITICAL PLANNING MODE: You are ONLY creating a plan. Write a numbered list of steps describing what WOULD be done. DO NOT execute anything.`:"CRITICAL PLANNING MODE: You are ONLY creating a plan. Write a numbered list of steps describing what WOULD be done. DO NOT execute anything.",W0=await Ez.chat({agent_id:H,message:b4,stream:!1,system:y});g0(W0.message),K1(b4),M1("plan-pending")}catch(z4){let y=z4 instanceof Error?z4:Error("Failed to generate plan");n1(y),M1("error"),Q0?.(y)}return}M1("loading"),n1(null),B4(0),h4(""),A4("");try{if(O)if(S){let z4="";eA(b4,(y)=>{if(y.type==="token"&&y.content){z4+=y.content,h4(z4);let W0=Math.min(Math.round(z4.length/10),90);B4(W0)}},(y)=>{let W0={success:!0,data:{summary:z4,thread_id:y},message:z4||"Command executed successfully"};Z1(W0),M1("success"),B4(100),g?.(W0)},(y)=>{n1(y),M1("error"),Q0?.(y)})}else{await new Promise((y)=>setTimeout(y,1500));let z4={success:!0,data:{summary:`Executed: ${b4}`},message:"Command executed successfully"};Z1(z4),M1("success"),B4(100),g?.(z4)}else{let y=S1?`${S1}
|
|
197
|
+
|
|
198
|
+
CRITICAL COMMAND MODE: Maximum 10 words per response. Execute the command immediately. Make reasonable assumptions based on context. Use sensible defaults for missing details. DO NOT ask questions unless something is truly impossible without user input (e.g., missing required password). State what you're doing or the result. Examples: "Analyzing customer data from last quarter..." or "Created 5 new database entries successfully" or "Search complete: found 12 matching results". NO greetings, NO filler words, NO clarification requests. Action/result only.`:`CRITICAL COMMAND MODE: Maximum 10 words per response. Execute the command immediately. Make reasonable assumptions based on context. Use sensible defaults for missing details. DO NOT ask questions unless something is truly impossible without user input (e.g., missing required password). State what you're doing or the result. Examples: "Analyzing customer data from last quarter..." or "Created 5 new database entries successfully" or "Search complete: found 12 matching results". NO greetings, NO filler words, NO clarification requests. Action/result only.`,W0=W4&&W4.length>0?await XO(b4,W4):b4;if(S){let F0="",v="";await Ez.chatStream({agent_id:H,message:W0,stream:!0,...F1&&{thread_id:F1},system:y},(o)=>{if((o.type==="token"||o.type==="content")&&o.content){F0+=o.content,h4(F0),M5(null);let N0=Math.min(Math.round(F0.length/10),90);B4(N0)}else if(o.type==="tool_call"&&o.tool_name){let N0=o.tool_display_name||o.tool_name;v=o.tool_name,M5(N0),r?.(o.tool_name,o.tool_id||""),F0="",h4("")}else if(o.type==="tool_result")U0?.(v,o.content),M5(null);else if(o.type==="thread_id"&&o.thread_id){if(!F1)R1(o.thread_id),D?.(o.thread_id)}else if(o.type==="request_id"&&o.request_id)o4(o.request_id)},(o)=>{let N0={success:!0,data:{summary:F0,thread_id:o},message:F0||"Command executed successfully"};Z1(N0),M1("success"),B4(100),o4(null),g?.(N0)},(o)=>{n1(o),M1("error"),o4(null),Q0?.(o)})}else{let F0=await Ez.chat({agent_id:H,message:W0,stream:!1,...F1&&{thread_id:F1},system:y}),v={success:!0,data:{summary:F0.message,thread_id:F0.thread_id},widgets:F0.widgets,message:F0.message};Z1(v),M1("success"),B4(100),g?.(v)}}}catch(z4){let y=z4 instanceof Error?z4:Error("Unknown error");n1(y),M1("error"),Q0?.(y)}},d6=()=>{M1("idle"),Z1(null),n1(null),B4(0),A4(""),g0(""),K1(""),h4(""),M5(null)},B7=()=>{let c1=X5;g0(""),K1("");let W4=`Execute this plan now:
|
|
199
|
+
|
|
200
|
+
${c1}`;q7(W4)},y6=()=>{A4($1),g0(""),K1(""),M1("idle")},p5=async()=>{if(x5&&H)try{await Ez.cancelRequest(H,x5)}catch(c1){console.error("Failed to cancel request:",c1)}if(m0(!1),y1==="loading")M1("idle"),h4(""),M5(null),B4(0);o4(null)},i6=A==="compact";return H6.jsxs("div",{className:P4("apteva-chat flex flex-col h-full",R0!=="default"&&`apteva-chat-${R0}`,h0),children:[f0&&p==="chat"&&H6.jsx("div",{className:"apteva-chat-header px-4 py-3 flex items-center justify-between",children:H6.jsxs("div",{children:[H6.jsx("div",{className:"apteva-chat-title",children:P0}),H6.jsx("div",{className:P4("apteva-chat-status",Y1?V0?"apteva-chat-status-tool":"apteva-chat-status-thinking":"apteva-chat-status-ready"),children:Y1?V0?`Using ${V0}...`:"Thinking...":"Ready"})]})}),p==="chat"&&H6.jsxs(H6.Fragment,{children:[H6.jsx(CI,{messages:v0,onAction:c,welcomeTitle:f,welcomeSubtitle:l,welcomeIcon:T,suggestedPrompts:m,welcomeVariant:E,chatVariant:R0,onPromptClick:(c1)=>s5(c1),enableWidgets:a,onWidgetRender:G0}),H6.jsx(vI,{onSendMessage:s5,placeholder:_0||w5,disabled:Y1,isLoading:Y1,onStop:p5,onFileUpload:j,onSwitchMode:b?()=>t5("command"):void 0})]}),p==="command"&&H6.jsx("div",{className:"w-full",children:H6.jsx(SI,{onExecute:(c1,W4)=>{A4(c1),q7(c1,W4)},state:y1,response:A0?.data?.summary||A0?.message,error:h1?.message,plan:X5,streamedContent:k5,toolName:D4,onApprove:B7,onReject:y6,onReset:d6,onStop:p5,onExpand:b?()=>t5("chat"):void 0,placeholder:_0||"Enter your command..."})}),H6.jsx("style",{dangerouslySetInnerHTML:{__html:`
|
|
201
|
+
@keyframes pulse-border {
|
|
202
|
+
0%, 100% { border-color: rgb(59, 130, 246); }
|
|
203
|
+
50% { border-color: rgb(147, 197, 253); }
|
|
204
|
+
}
|
|
205
|
+
.animate-pulse-border {
|
|
206
|
+
animation: pulse-border 2s ease-in-out infinite;
|
|
207
|
+
}
|
|
208
|
+
.apteva-composer {
|
|
209
|
+
border-radius: var(--apteva-border-radius, 1rem) !important;
|
|
210
|
+
}
|
|
211
|
+
`}})]})});var F4=H0(H1(),1),MO=h6.createContext(null);function wO(){return h6.useContext(MO)}function FO({children:Y}){let{authFetch:H,isAuthenticated:B,isLoading:K}=A1(),[G,_]=h6.useState(null),[W,O]=h6.useState(!1),[F,b]=h6.useState(!1),[M,A]=h6.useState(null),R=async()=>{try{let T=await(await H("/api/meta-agent/status")).json();_(T)}catch(l){console.error("[MetaAgent] Failed to fetch status:",l)}};h6.useEffect(()=>{if(!K&&B)R()},[H,B,K]);let k=async()=>{b(!0),A(null);try{let l=await H("/api/meta-agent/start",{method:"POST"}),T=await l.json();if(!l.ok)A(T.error||"Failed to start assistant");else await R()}catch(l){A("Failed to start assistant")}b(!1)},S=!!(G?.enabled&&G?.available),V=G?.agent,x=!!(V?.status==="running"&&V?.port),f={status:G,isOpen:W,isStarting:F,error:M,isAvailable:S,isRunning:x,agent:V,toggle:()=>O(!W),close:()=>O(!1),startAgent:k};return F4.jsxDEV(MO.Provider,{value:f,children:Y},void 0,!1,void 0,this)}function bO(){let Y=wO();if(!Y?.isAvailable)return null;return F4.jsxDEV("button",{onClick:Y.toggle,className:`hidden md:flex items-center gap-2 px-3 py-2 rounded transition ${Y.isOpen?"bg-[#f97316] text-white":"bg-[#151515] hover:bg-[#1a1a1a] text-[#888] hover:text-white"}`,title:"Apteva Assistant",children:[F4.jsxDEV(AO,{className:"w-5 h-5"},void 0,!1,void 0,this),F4.jsxDEV("span",{className:"text-sm",children:"Assistant"},void 0,!1,void 0,this),Y.isRunning&&F4.jsxDEV("span",{className:"w-2 h-2 rounded-full bg-green-400"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function PO(){let Y=wO(),{currentProjectId:H,currentProject:B}=G4();if(!Y?.isAvailable||!Y.isOpen)return null;let{agent:K,isRunning:G,error:_,isStarting:W,startAgent:O,close:F}=Y,b=h6.useMemo(()=>{let M=[];if(B)M.push(`Current project: "${B.name}" (id: ${B.id})`);else if(H==="unassigned")M.push("Viewing: unassigned agents (no project)");else M.push("Viewing: All Projects");return M.join(`
|
|
212
|
+
`)},[H,B]);return F4.jsxDEV(F4.Fragment,{children:[F4.jsxDEV("div",{className:"hidden md:block fixed inset-0 bg-black/20 z-40",onClick:F},void 0,!1,void 0,this),F4.jsxDEV("div",{className:"hidden md:flex fixed top-0 right-0 h-full w-[480px] lg:w-[540px] bg-[#0a0a0a] border-l border-[#1a1a1a] shadow-2xl z-50 flex-col",children:[F4.jsxDEV("div",{className:"flex items-center justify-between px-4 py-3 border-b border-[#1a1a1a] bg-[#111]",children:[F4.jsxDEV("div",{className:"flex items-center gap-2",children:[F4.jsxDEV("div",{className:`w-2 h-2 rounded-full ${G?"bg-green-400":"bg-[#444]"}`},void 0,!1,void 0,this),F4.jsxDEV("span",{className:"font-medium text-sm",children:"Apteva Assistant"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F4.jsxDEV("button",{onClick:F,className:"text-[#666] hover:text-[#888] transition",children:F4.jsxDEV(gI,{},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F4.jsxDEV("div",{className:"flex-1 min-h-0 flex flex-col",children:G?F4.jsxDEV(LJ,{agentId:"default",apiUrl:`/api/agents/${K.id}`,placeholder:"Ask me anything about Apteva...",variant:"terminal",showHeader:!1,context:b},void 0,!1,void 0,this):F4.jsxDEV("div",{className:"flex-1 flex flex-col items-center justify-center p-6 text-center",children:[F4.jsxDEV(AO,{className:"w-12 h-12 text-[#333] mb-4"},void 0,!1,void 0,this),F4.jsxDEV("h3",{className:"font-medium mb-2",children:"Apteva Assistant"},void 0,!1,void 0,this),F4.jsxDEV("p",{className:"text-sm text-[#666] mb-6",children:"I can help you navigate Apteva, create agents, set up MCP servers, and more."},void 0,!1,void 0,this),_&&F4.jsxDEV("p",{className:"text-sm text-red-400 mb-4",children:_},void 0,!1,void 0,this),F4.jsxDEV("button",{onClick:O,disabled:W,className:"bg-[#f97316] hover:bg-[#fb923c] disabled:opacity-50 text-white px-6 py-2 rounded font-medium transition",children:W?"Starting...":"Start Assistant"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function AO({className:Y="w-6 h-6"}){return F4.jsxDEV("svg",{className:Y,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:F4.jsxDEV("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 10h.01M12 10h.01M16 10h.01M9 16H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-5l-5 5v-5z"},void 0,!1,void 0,this)},void 0,!1,void 0,this)}function gI(){return F4.jsxDEV("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:F4.jsxDEV("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"},void 0,!1,void 0,this)},void 0,!1,void 0,this)}var p1=H0(H1(),1);function NJ({onMenuClick:Y}){let{connected:H}=f6(),{user:B,logout:K}=A1(),{projects:G,currentProjectId:_,currentProject:W,setCurrentProjectId:O,unassignedCount:F,projectsEnabled:b}=G4(),[M,A]=UG.useState(!1),[R,k]=UG.useState(!1),S=async()=>{await K(),A(!1)},V=(l)=>{O(l),k(!1)},x=()=>{if(_===null)return"All Projects";if(_==="unassigned")return"Unassigned";return W?.name||"Select Project"},f=()=>{if(_===null)return"#666";if(_==="unassigned")return"#888";return W?.color||"#6366f1"};return p1.jsxDEV("header",{className:"border-b border-[#1a1a1a] px-4 md:px-6 py-4 flex-shrink-0",children:p1.jsxDEV("div",{className:"flex items-center justify-between",children:[p1.jsxDEV("div",{className:"flex items-center gap-3",children:[p1.jsxDEV("button",{onClick:Y,className:"p-2 -ml-2 text-[#666] hover:text-[#e0e0e0] transition md:hidden",children:p1.jsxDEV(pK,{},void 0,!1,void 0,this)},void 0,!1,void 0,this),p1.jsxDEV("div",{className:"flex items-center gap-2",children:[p1.jsxDEV("span",{className:"text-[#f97316]",children:">_"},void 0,!1,void 0,this),p1.jsxDEV("span",{className:"text-xl tracking-wider",children:"apteva"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),b&&G.length>0&&p1.jsxDEV("div",{className:"relative ml-2 md:ml-4",children:[p1.jsxDEV("button",{onClick:()=>k(!R),className:"flex items-center gap-2 px-3 py-1.5 rounded border border-[#222] bg-[#111] hover:bg-[#1a1a1a] transition text-sm",children:[p1.jsxDEV("span",{className:"w-2.5 h-2.5 rounded-full",style:{backgroundColor:f()}},void 0,!1,void 0,this),p1.jsxDEV("span",{className:"hidden sm:inline max-w-[120px] md:max-w-[180px] truncate",children:x()},void 0,!1,void 0,this),p1.jsxDEV(jK,{},void 0,!1,void 0,this)]},void 0,!0,void 0,this),R&&p1.jsxDEV("div",{className:"absolute left-0 top-full mt-1 w-56 bg-[#111] border border-[#222] rounded-lg shadow-xl z-50",children:p1.jsxDEV("div",{className:"py-1 max-h-64 overflow-y-auto",children:[p1.jsxDEV("button",{onClick:()=>V(null),className:`w-full px-4 py-2 text-left text-sm flex items-center gap-2 hover:bg-[#1a1a1a] transition ${_===null?"bg-[#1a1a1a] text-[#f97316]":""}`,children:[p1.jsxDEV("span",{className:"w-2.5 h-2.5 rounded-full bg-[#666]"},void 0,!1,void 0,this),"All Projects"]},void 0,!0,void 0,this),G.map((l)=>p1.jsxDEV("button",{onClick:()=>V(l.id),className:`w-full px-4 py-2 text-left text-sm flex items-center gap-2 hover:bg-[#1a1a1a] transition ${_===l.id?"bg-[#1a1a1a] text-[#f97316]":""}`,children:[p1.jsxDEV("span",{className:"w-2.5 h-2.5 rounded-full flex-shrink-0",style:{backgroundColor:l.color}},void 0,!1,void 0,this),p1.jsxDEV("span",{className:"truncate",children:l.name},void 0,!1,void 0,this),p1.jsxDEV("span",{className:"ml-auto text-xs text-[#666]",children:l.agentCount},void 0,!1,void 0,this)]},l.id,!0,void 0,this)),F>0&&p1.jsxDEV("button",{onClick:()=>V("unassigned"),className:`w-full px-4 py-2 text-left text-sm flex items-center gap-2 hover:bg-[#1a1a1a] transition ${_==="unassigned"?"bg-[#1a1a1a] text-[#f97316]":""}`,children:[p1.jsxDEV("span",{className:"w-2.5 h-2.5 rounded-full bg-[#888]"},void 0,!1,void 0,this),p1.jsxDEV("span",{className:"truncate",children:"Unassigned"},void 0,!1,void 0,this),p1.jsxDEV("span",{className:"ml-auto text-xs text-[#666]",children:F},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),p1.jsxDEV("div",{className:"flex items-center gap-3 md:gap-4",children:[p1.jsxDEV("div",{className:"flex items-center gap-2",children:[p1.jsxDEV("span",{className:`w-2 h-2 rounded-full ${H?"bg-green-400":"bg-red-400"}`},void 0,!1,void 0,this),p1.jsxDEV("span",{className:"text-xs text-[#666] hidden sm:inline",children:H?"Live":"Offline"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),p1.jsxDEV(bO,{},void 0,!1,void 0,this),B&&p1.jsxDEV("div",{className:"relative",children:[p1.jsxDEV("button",{onClick:()=>A(!M),className:"flex items-center gap-2 px-2 md:px-3 py-2 rounded hover:bg-[#1a1a1a] transition",children:[p1.jsxDEV("div",{className:"w-8 h-8 rounded-full bg-[#f97316] flex items-center justify-center text-black font-medium text-sm",children:B.username.charAt(0).toUpperCase()},void 0,!1,void 0,this),p1.jsxDEV("span",{className:"text-sm text-[#888] hidden sm:block",children:B.username},void 0,!1,void 0,this)]},void 0,!0,void 0,this),M&&p1.jsxDEV("div",{className:"absolute right-0 top-full mt-1 w-48 bg-[#111] border border-[#222] rounded-lg shadow-xl z-50",children:[p1.jsxDEV("div",{className:"px-4 py-3 border-b border-[#222]",children:[p1.jsxDEV("p",{className:"text-sm font-medium",children:B.username},void 0,!1,void 0,this),p1.jsxDEV("p",{className:"text-xs text-[#f97316] mt-1",children:B.role},void 0,!1,void 0,this)]},void 0,!0,void 0,this),p1.jsxDEV("button",{onClick:S,className:"w-full px-4 py-2 text-left text-sm text-red-400 hover:bg-[#1a1a1a] transition",children:"Sign out"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}var e1=H0(H1(),1);function RJ({route:Y,agentCount:H,taskCount:B,onNavigate:K,isOpen:G,onClose:_}){let W=(O)=>{K(O),_?.()};return e1.jsxDEV(e1.Fragment,{children:[G&&e1.jsxDEV("div",{className:"fixed inset-0 bg-black/60 z-40 md:hidden",onClick:_},void 0,!1,void 0,this),e1.jsxDEV("aside",{className:`
|
|
213
|
+
fixed inset-y-0 left-0 z-50 w-64 bg-[#0a0a0a] border-r border-[#1a1a1a] p-4 transform transition-transform duration-200 ease-in-out
|
|
214
|
+
md:relative md:w-56 md:translate-x-0 md:z-auto
|
|
215
|
+
${G?"translate-x-0":"-translate-x-full"}
|
|
216
|
+
`,children:[e1.jsxDEV("div",{className:"flex items-center justify-between mb-4 md:hidden",children:[e1.jsxDEV("div",{className:"flex items-center gap-2",children:[e1.jsxDEV("span",{className:"text-[#f97316]",children:">_"},void 0,!1,void 0,this),e1.jsxDEV("span",{className:"text-lg tracking-wider",children:"apteva"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),e1.jsxDEV("button",{onClick:_,className:"p-2 text-[#666] hover:text-[#e0e0e0] transition",children:e1.jsxDEV(L6,{},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),e1.jsxDEV("nav",{className:"space-y-1",children:[e1.jsxDEV(k7,{icon:e1.jsxDEV(UJ,{},void 0,!1,void 0,this),label:"Dashboard",active:Y==="dashboard",onClick:()=>W("dashboard")},void 0,!1,void 0,this),e1.jsxDEV(k7,{icon:e1.jsxDEV(WJ,{},void 0,!1,void 0,this),label:"Agents",active:Y==="agents",onClick:()=>W("agents"),badge:H>0?String(H):void 0},void 0,!1,void 0,this),e1.jsxDEV(k7,{icon:e1.jsxDEV(tH,{},void 0,!1,void 0,this),label:"Activity",active:Y==="activity",onClick:()=>W("activity")},void 0,!1,void 0,this),e1.jsxDEV(k7,{icon:e1.jsxDEV(j6,{},void 0,!1,void 0,this),label:"Tasks",active:Y==="tasks",onClick:()=>W("tasks"),badge:B&&B>0?String(B):void 0},void 0,!1,void 0,this),e1.jsxDEV(k7,{icon:e1.jsxDEV(l6,{},void 0,!1,void 0,this),label:"MCP",active:Y==="mcp",onClick:()=>W("mcp")},void 0,!1,void 0,this),e1.jsxDEV(k7,{icon:e1.jsxDEV(uX,{},void 0,!1,void 0,this),label:"Skills",active:Y==="skills",onClick:()=>W("skills")},void 0,!1,void 0,this),e1.jsxDEV(k7,{icon:e1.jsxDEV(lK,{},void 0,!1,void 0,this),label:"Tests",active:Y==="tests",onClick:()=>W("tests")},void 0,!1,void 0,this),e1.jsxDEV(k7,{icon:e1.jsxDEV(rH,{},void 0,!1,void 0,this),label:"Telemetry",active:Y==="telemetry",onClick:()=>W("telemetry")},void 0,!1,void 0,this),e1.jsxDEV(k7,{icon:e1.jsxDEV(xK,{},void 0,!1,void 0,this),label:"API",active:Y==="api",onClick:()=>W("api")},void 0,!1,void 0,this),e1.jsxDEV(k7,{icon:e1.jsxDEV(KJ,{},void 0,!1,void 0,this),label:"Settings",active:Y==="settings",onClick:()=>W("settings")},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function k7({icon:Y,label:H,active:B,onClick:K,badge:G}){return e1.jsxDEV("button",{onClick:K,className:`w-full flex items-center gap-3 px-3 py-2 rounded font-medium transition ${B?"bg-[#111] text-[#e0e0e0]":"text-[#666] hover:bg-[#111] hover:text-[#888]"}`,children:[Y,H,G&&e1.jsxDEV("span",{className:"ml-auto bg-[#333] text-[#888] text-xs px-2 py-0.5 rounded-full",children:G},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}var lX=H0(H1(),1);function MJ({message:Y,onDismiss:H}){return lX.jsxDEV("div",{className:"bg-red-500/10 border-b border-red-500/30 px-6 py-3 text-red-400 text-sm flex items-center justify-between",children:[lX.jsxDEV("span",{children:Y},void 0,!1,void 0,this),lX.jsxDEV("button",{onClick:H,className:"hover:text-red-300",children:lX.jsxDEV(L6,{className:"w-4 h-4"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}var cX=H0(D1(),1);var H5=H0(H1(),1);function wJ(){let{login:Y}=A1(),[H,B]=cX.useState(""),[K,G]=cX.useState(""),[_,W]=cX.useState(null),[O,F]=cX.useState(!1);return H5.jsxDEV("div",{className:"min-h-screen bg-[#0a0a0a] text-[#e0e0e0] font-mono flex items-center justify-center p-8",children:H5.jsxDEV("div",{className:"w-full max-w-md",children:[H5.jsxDEV("div",{className:"text-center mb-8",children:[H5.jsxDEV("div",{className:"flex items-center justify-center gap-2 mb-2",children:[H5.jsxDEV("span",{className:"text-[#f97316] text-3xl",children:">_"},void 0,!1,void 0,this),H5.jsxDEV("span",{className:"text-3xl tracking-wider",children:"apteva"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),H5.jsxDEV("p",{className:"text-[#666]",children:"Run AI agents locally"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),H5.jsxDEV("div",{className:"bg-[#111] rounded-lg border border-[#1a1a1a] p-8",children:[H5.jsxDEV("h2",{className:"text-2xl font-semibold mb-2",children:"Welcome back"},void 0,!1,void 0,this),H5.jsxDEV("p",{className:"text-[#666] mb-6",children:"Sign in to continue to apteva"},void 0,!1,void 0,this),H5.jsxDEV("form",{onSubmit:async(M)=>{M.preventDefault(),W(null),F(!0);let A=await Y(H,K);if(!A.success)W(A.error||"Login failed");F(!1)},className:"space-y-4",children:[H5.jsxDEV("div",{children:[H5.jsxDEV("label",{htmlFor:"username",className:"block text-sm text-[#888] mb-1",children:"Username"},void 0,!1,void 0,this),H5.jsxDEV("input",{id:"username",type:"text",value:H,onChange:(M)=>B(M.target.value),placeholder:"Enter your username",autoFocus:!0,required:!0,className:"w-full bg-[#0a0a0a] border border-[#333] rounded px-4 py-3 focus:outline-none focus:border-[#f97316]"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),H5.jsxDEV("div",{children:[H5.jsxDEV("label",{htmlFor:"password",className:"block text-sm text-[#888] mb-1",children:"Password"},void 0,!1,void 0,this),H5.jsxDEV("input",{id:"password",type:"password",value:K,onChange:(M)=>G(M.target.value),placeholder:"Enter your password",required:!0,className:"w-full bg-[#0a0a0a] border border-[#333] rounded px-4 py-3 focus:outline-none focus:border-[#f97316]"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),_&&H5.jsxDEV("div",{className:"p-3 bg-red-500/10 border border-red-500/30 rounded text-red-400 text-sm",children:_},void 0,!1,void 0,this),H5.jsxDEV("button",{type:"submit",disabled:O||!H||!K,className:"w-full bg-[#f97316] hover:bg-[#fb923c] disabled:opacity-50 disabled:cursor-not-allowed text-black px-4 py-3 rounded font-medium transition",children:O?"Signing in...":"Sign In"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}var g8=H0(D1(),1),v4=H0(H1(),1);function FJ({onComplete:Y}){let[H,B]=g8.useState(""),[K,G]=g8.useState(""),[_,W]=g8.useState(""),[O,F]=g8.useState(""),[b,M]=g8.useState(!1),[A,R]=g8.useState(null),[k,S]=g8.useState(!1);return v4.jsxDEV(v4.Fragment,{children:[v4.jsxDEV("h2",{className:"text-2xl font-semibold mb-2",children:"Create your account"},void 0,!1,void 0,this),v4.jsxDEV("p",{className:"text-[#666] mb-6",children:"Set up your admin account to get started with apteva."},void 0,!1,void 0,this),v4.jsxDEV("form",{onSubmit:async(x)=>{if(x.preventDefault(),R(null),K!==_){R("Passwords do not match");return}S(!0);try{let f=await fetch("/api/onboarding/user",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:H,password:K,...O&&{email:O}})}),l=await f.json();if(!f.ok){R(l.error||"Failed to create account"),S(!1);return}let T=await fetch("/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({username:H,password:K})});if(!T.ok){R("Account created but login failed. Please try logging in."),S(!1);return}let m=await T.json();if(m.accessToken)sessionStorage.setItem("accessToken",m.accessToken);Y({username:H})}catch(f){R("Failed to create account"),S(!1)}},className:"space-y-4",children:[v4.jsxDEV("div",{children:[v4.jsxDEV("label",{htmlFor:"username",className:"block text-sm text-[#888] mb-1",children:"Username"},void 0,!1,void 0,this),v4.jsxDEV("input",{id:"username",type:"text",value:H,onChange:(x)=>B(x.target.value),placeholder:"Choose a username",autoFocus:!0,required:!0,className:"w-full bg-[#0a0a0a] border border-[#333] rounded px-4 py-3 focus:outline-none focus:border-[#f97316]"},void 0,!1,void 0,this),v4.jsxDEV("p",{className:"text-xs text-[#666] mt-1",children:"3-20 characters, letters, numbers, underscore"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),v4.jsxDEV("div",{children:[v4.jsxDEV("label",{htmlFor:"password",className:"block text-sm text-[#888] mb-1",children:"Password"},void 0,!1,void 0,this),v4.jsxDEV("input",{id:"password",type:"password",value:K,onChange:(x)=>G(x.target.value),placeholder:"Enter a password",required:!0,className:"w-full bg-[#0a0a0a] border border-[#333] rounded px-4 py-3 focus:outline-none focus:border-[#f97316]"},void 0,!1,void 0,this),v4.jsxDEV("p",{className:"text-xs text-[#666] mt-1",children:"Min 8 characters, uppercase, lowercase, number"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),v4.jsxDEV("div",{children:[v4.jsxDEV("label",{htmlFor:"confirmPassword",className:"block text-sm text-[#888] mb-1",children:"Confirm Password"},void 0,!1,void 0,this),v4.jsxDEV("input",{id:"confirmPassword",type:"password",value:_,onChange:(x)=>W(x.target.value),placeholder:"Confirm your password",required:!0,className:"w-full bg-[#0a0a0a] border border-[#333] rounded px-4 py-3 focus:outline-none focus:border-[#f97316]"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),!b?v4.jsxDEV("button",{type:"button",onClick:()=>M(!0),className:"text-sm text-[#666] hover:text-[#888] transition",children:"+ Add email for password recovery (optional)"},void 0,!1,void 0,this):v4.jsxDEV("div",{children:[v4.jsxDEV("label",{htmlFor:"email",className:"block text-sm text-[#888] mb-1",children:["Email ",v4.jsxDEV("span",{className:"text-[#666]",children:"(optional)"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),v4.jsxDEV("input",{id:"email",type:"email",value:O,onChange:(x)=>F(x.target.value),placeholder:"For password recovery only",className:"w-full bg-[#0a0a0a] border border-[#333] rounded px-4 py-3 focus:outline-none focus:border-[#f97316]"},void 0,!1,void 0,this),v4.jsxDEV("p",{className:"text-xs text-[#666] mt-1",children:"Only used for password recovery, never shared"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),A&&v4.jsxDEV("div",{className:"p-3 bg-red-500/10 border border-red-500/30 rounded text-red-400 text-sm",children:A},void 0,!1,void 0,this),v4.jsxDEV("button",{type:"submit",disabled:k||!H||!K||!_,className:"w-full bg-[#f97316] hover:bg-[#fb923c] disabled:opacity-50 disabled:cursor-not-allowed text-black px-4 py-3 rounded font-medium transition",children:k?"Creating account...":"Create Account"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),v4.jsxDEV("p",{className:"text-xs text-[#666] mt-4 text-center",children:"This will be your admin account with full access to apteva."},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}var c6=H0(D1(),1);var s0=H0(H1(),1);function dX({onComplete:Y,needsAccount:H=!1}){let[B,K]=c6.useState(H?0:1),[G,_]=c6.useState([]),[W,O]=c6.useState(null),[F,b]=c6.useState(""),[M,A]=c6.useState(!1),[R,k]=c6.useState(!1),[S,V]=c6.useState(null),[x,f]=c6.useState(null),[l,T]=c6.useState(!1),m=()=>{let Q0=sessionStorage.getItem("accessToken");return Q0?{Authorization:`Bearer ${Q0}`}:{}};c6.useEffect(()=>{if(H&&!l&&B===0)return;fetch("/api/providers",{headers:m()}).then((Q0)=>Q0.json()).then((Q0)=>{let r=(Q0.providers||[]).filter((U0)=>U0.type==="llm");_(r)})},[l,B,H]);let E=G.filter((Q0)=>Q0.hasKey),D=async()=>{if(!W||!F)return;A(!0),V(null),f(null);try{k(!0);let r=await(await fetch(`/api/keys/${W}/test`,{method:"POST",headers:{"Content-Type":"application/json",...m()},body:JSON.stringify({key:F})})).json();if(k(!1),!r.valid){V(r.error||"API key is invalid"),A(!1);return}let U0=await fetch(`/api/keys/${W}`,{method:"POST",headers:{"Content-Type":"application/json",...m()},body:JSON.stringify({key:F})}),R0=await U0.json();if(!U0.ok)V(R0.error||"Failed to save key");else{f("API key saved successfully!"),b("");let f0=await(await fetch("/api/providers",{headers:m()})).json();_(f0.providers||[]),O(null)}}catch(Q0){V("Failed to save key")}A(!1)},n=async()=>{try{let Q0=await fetch("/api/projects",{method:"POST",headers:{"Content-Type":"application/json",...m()},body:JSON.stringify({name:"My Project",description:"Default project for organizing agents",color:"#f97316"})});if(Q0.ok){let r=await Q0.json();if(r.project?.id)localStorage.setItem("apteva_current_project",r.project.id)}}catch(Q0){console.error("Failed to create default project:",Q0)}await fetch("/api/onboarding/complete",{method:"POST",headers:m()}),Y()},c=()=>{T(!0),K(1)},j=H?3:2,g=H?B:B-1;return s0.jsxDEV("div",{className:"min-h-screen bg-[#0a0a0a] text-[#e0e0e0] font-mono flex items-center justify-center p-8",children:s0.jsxDEV("div",{className:"w-full max-w-2xl",children:[s0.jsxDEV("div",{className:"text-center mb-8",children:[s0.jsxDEV("div",{className:"flex items-center justify-center gap-2 mb-2",children:[s0.jsxDEV("span",{className:"text-[#f97316] text-3xl",children:">_"},void 0,!1,void 0,this),s0.jsxDEV("span",{className:"text-3xl tracking-wider",children:"apteva"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),s0.jsxDEV("p",{className:"text-[#666]",children:"Run AI agents locally"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),s0.jsxDEV("div",{className:"flex items-center justify-center gap-2 mb-8",children:[H&&s0.jsxDEV(s0.Fragment,{children:[s0.jsxDEV("div",{className:`w-3 h-3 rounded-full ${B>=0?"bg-[#f97316]":"bg-[#333]"}`},void 0,!1,void 0,this),s0.jsxDEV("div",{className:`w-16 h-0.5 ${B>=1?"bg-[#f97316]":"bg-[#333]"}`},void 0,!1,void 0,this)]},void 0,!0,void 0,this),s0.jsxDEV("div",{className:`w-3 h-3 rounded-full ${B>=1?"bg-[#f97316]":"bg-[#333]"}`},void 0,!1,void 0,this),s0.jsxDEV("div",{className:`w-16 h-0.5 ${B>=2?"bg-[#f97316]":"bg-[#333]"}`},void 0,!1,void 0,this),s0.jsxDEV("div",{className:`w-3 h-3 rounded-full ${B>=2?"bg-[#f97316]":"bg-[#333]"}`},void 0,!1,void 0,this)]},void 0,!0,void 0,this),s0.jsxDEV("div",{className:"bg-[#111] rounded-lg border border-[#1a1a1a] p-8",children:[B===0&&H&&s0.jsxDEV(FJ,{onComplete:c},void 0,!1,void 0,this),B===1&&s0.jsxDEV(uI,{providers:G,configuredProviders:E,selectedProvider:W,apiKey:F,saving:M,testing:R,error:S,success:x,onSelectProvider:O,onApiKeyChange:b,onSaveKey:D,onContinue:()=>K(2)},void 0,!1,void 0,this),B===2&&s0.jsxDEV(xI,{configuredProviders:E,onAddMore:()=>K(1),onComplete:n},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}function uI({providers:Y,configuredProviders:H,selectedProvider:B,apiKey:K,saving:G,testing:_,error:W,success:O,onSelectProvider:F,onApiKeyChange:b,onSaveKey:M,onContinue:A}){let R=Y.find((k)=>k.id===B);if(B&&R)return s0.jsxDEV(s0.Fragment,{children:[s0.jsxDEV("h2",{className:"text-2xl font-semibold mb-2",children:["Add ",R.name," Key"]},void 0,!0,void 0,this),s0.jsxDEV("p",{className:"text-[#666] mb-6",children:"Enter your API key below. It will be encrypted and stored locally."},void 0,!1,void 0,this),s0.jsxDEV("div",{className:"mb-6",children:[s0.jsxDEV("div",{className:"p-4 rounded border border-[#f97316] bg-[#f97316]/5 mb-4",children:s0.jsxDEV("div",{className:"flex items-center justify-between",children:[s0.jsxDEV("div",{children:[s0.jsxDEV("p",{className:"font-medium",children:R.name},void 0,!1,void 0,this),s0.jsxDEV("p",{className:"text-sm text-[#666]",children:[R.models.length," models available"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),s0.jsxDEV("a",{href:R.docsUrl,target:"_blank",rel:"noopener noreferrer",className:"text-sm text-[#3b82f6] hover:underline",children:"Get API Key"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),s0.jsxDEV("div",{className:"space-y-3",children:[s0.jsxDEV("input",{type:"password",value:K,onChange:(k)=>b(k.target.value),placeholder:"Enter your API key...",autoFocus:!0,className:"w-full bg-[#0a0a0a] border border-[#333] rounded px-4 py-3 focus:outline-none focus:border-[#f97316] text-lg"},void 0,!1,void 0,this),W&&s0.jsxDEV("p",{className:"text-red-400 text-sm",children:W},void 0,!1,void 0,this),O&&s0.jsxDEV("p",{className:"text-green-400 text-sm",children:O},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),s0.jsxDEV("div",{className:"flex gap-3",children:[s0.jsxDEV("button",{onClick:()=>{F(null),b("")},className:"flex-1 border border-[#333] hover:border-[#666] px-4 py-3 rounded font-medium transition",children:"Back"},void 0,!1,void 0,this),s0.jsxDEV("button",{onClick:M,disabled:!K||G,className:"flex-1 bg-[#f97316] hover:bg-[#fb923c] disabled:opacity-50 disabled:cursor-not-allowed text-black px-4 py-3 rounded font-medium transition",children:_?"Testing...":G?"Saving...":"Save API Key"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this);return s0.jsxDEV(s0.Fragment,{children:[s0.jsxDEV("h2",{className:"text-2xl font-semibold mb-2",children:"Welcome to apteva"},void 0,!1,void 0,this),s0.jsxDEV("p",{className:"text-[#666] mb-6",children:"To get started, you'll need to add at least one AI provider API key. Your keys are encrypted and stored locally."},void 0,!1,void 0,this),s0.jsxDEV("div",{className:"space-y-3 mb-6",children:Y.map((k)=>s0.jsxDEV(EI,{provider:k,selected:!1,onSelect:()=>!k.hasKey&&F(k.id)},k.id,!1,void 0,this))},void 0,!1,void 0,this),s0.jsxDEV("button",{onClick:A,disabled:H.length===0,className:"w-full bg-[#222] hover:bg-[#333] disabled:opacity-50 disabled:cursor-not-allowed px-4 py-3 rounded font-medium transition",children:H.length===0?"Add at least one API key to continue":`Continue with ${H.length} provider${H.length>1?"s":""}`},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function EI({provider:Y,selected:H,onSelect:B}){return s0.jsxDEV("div",{onClick:B,className:`p-4 rounded border transition cursor-pointer ${Y.hasKey?"border-green-500/30 bg-green-500/5":H?"border-[#f97316] bg-[#f97316]/5":"border-[#222] hover:border-[#333]"}`,children:s0.jsxDEV("div",{className:"flex items-center justify-between",children:[s0.jsxDEV("div",{children:[s0.jsxDEV("p",{className:"font-medium",children:Y.name},void 0,!1,void 0,this),s0.jsxDEV("p",{className:"text-sm text-[#666]",children:[Y.models.length," models available"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),Y.hasKey?s0.jsxDEV("span",{className:"text-green-400 text-sm flex items-center gap-1",children:[s0.jsxDEV(n5,{},void 0,!1,void 0,this),"Configured (",Y.keyHint,")"]},void 0,!0,void 0,this):s0.jsxDEV("a",{href:Y.docsUrl,target:"_blank",rel:"noopener noreferrer",onClick:(K)=>K.stopPropagation(),className:"text-sm text-[#3b82f6] hover:underline",children:"Get API Key"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}function xI({configuredProviders:Y,onAddMore:H,onComplete:B}){return s0.jsxDEV(s0.Fragment,{children:[s0.jsxDEV("h2",{className:"text-2xl font-semibold mb-2",children:"You're all set!"},void 0,!1,void 0,this),s0.jsxDEV("p",{className:"text-[#666] mb-6",children:["You've configured ",Y.length," provider",Y.length>1?"s":"",". You can add more providers later in Settings."]},void 0,!0,void 0,this),s0.jsxDEV("div",{className:"space-y-2 mb-6",children:Y.map((K)=>s0.jsxDEV("div",{className:"flex items-center gap-3 p-3 bg-[#0a0a0a] rounded",children:[s0.jsxDEV(n5,{className:"w-5 h-5 text-green-400"},void 0,!1,void 0,this),s0.jsxDEV("span",{children:K.name},void 0,!1,void 0,this),s0.jsxDEV("span",{className:"text-[#666] text-sm",children:["(",K.keyHint,")"]},void 0,!0,void 0,this)]},K.id,!0,void 0,this))},void 0,!1,void 0,this),s0.jsxDEV("div",{className:"flex gap-3",children:[s0.jsxDEV("button",{onClick:H,className:"flex-1 border border-[#333] hover:border-[#f97316] px-4 py-3 rounded font-medium transition",children:"Add More"},void 0,!1,void 0,this),s0.jsxDEV("button",{onClick:B,className:"flex-1 bg-[#f97316] hover:bg-[#fb923c] text-black px-4 py-3 rounded font-medium transition",children:"Start Using apteva"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}var L1=H0(D1(),1);var I=H0(H1(),1);function bJ(){let{projectsEnabled:Y}=G4(),[H,B]=L1.useState("providers"),K=[{key:"providers",label:"Providers"},...Y?[{key:"projects",label:"Projects"}]:[],{key:"api-keys",label:"API Keys"},{key:"account",label:"Account"},{key:"updates",label:"Updates"},{key:"data",label:"Data"}];return I.jsxDEV("div",{className:"flex-1 flex flex-col md:flex-row overflow-hidden",children:[I.jsxDEV("div",{className:"md:hidden border-b border-[#1a1a1a] bg-[#0a0a0a]",children:I.jsxDEV("div",{className:"flex overflow-x-auto",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:K.map((G)=>I.jsxDEV("button",{onClick:()=>B(G.key),className:`flex-shrink-0 px-4 py-3 text-sm font-medium border-b-2 transition ${H===G.key?"border-[#f97316] text-[#f97316]":"border-transparent text-[#666] hover:text-[#888]"}`,children:G.label},G.key,!1,void 0,this))},void 0,!1,void 0,this)},void 0,!1,void 0,this),I.jsxDEV("div",{className:"hidden md:block w-48 border-r border-[#1a1a1a] p-4 flex-shrink-0",children:[I.jsxDEV("h2",{className:"text-sm font-medium text-[#666] uppercase tracking-wider mb-3",children:"Settings"},void 0,!1,void 0,this),I.jsxDEV("nav",{className:"space-y-1",children:K.map((G)=>I.jsxDEV(pI,{label:G.label,active:H===G.key,onClick:()=>B(G.key)},G.key,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),I.jsxDEV("div",{className:"flex-1 overflow-auto p-4 md:p-6",children:[H==="providers"&&I.jsxDEV(jI,{},void 0,!1,void 0,this),H==="projects"&&Y&&I.jsxDEV(lI,{},void 0,!1,void 0,this),H==="api-keys"&&I.jsxDEV(aI,{},void 0,!1,void 0,this),H==="account"&&I.jsxDEV(nI,{},void 0,!1,void 0,this),H==="updates"&&I.jsxDEV(dI,{},void 0,!1,void 0,this),H==="data"&&I.jsxDEV(rI,{},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function pI({label:Y,active:H,onClick:B}){return I.jsxDEV("button",{onClick:B,className:`w-full text-left px-3 py-2 rounded text-sm transition ${H?"bg-[#1a1a1a] text-[#e0e0e0]":"text-[#666] hover:bg-[#111] hover:text-[#888]"}`,children:Y},void 0,!1,void 0,this)}function jI(){let{authFetch:Y}=A1(),{projects:H,projectsEnabled:B}=G4(),[K,G]=L1.useState([]),[_,W]=L1.useState(null),[O,F]=L1.useState(""),[b,M]=L1.useState(!1),[A,R]=L1.useState(!1),[k,S]=L1.useState(null),[V,x]=L1.useState(null),{confirm:f,ConfirmDialog:l}=a5(),T=async()=>{let Q0=await(await Y("/api/providers")).json();G(Q0.providers||[])};L1.useEffect(()=>{T()},[]);let m=async()=>{if(!_||!O)return;M(!0),S(null),x(null);try{R(!0);let Q0=await(await Y(`/api/keys/${_}/test`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:O})})).json();if(R(!1),!Q0.valid){S(Q0.error||"API key is invalid"),M(!1);return}let r=await Y(`/api/keys/${_}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:O})}),U0=await r.json();if(!r.ok)S(U0.error||"Failed to save key");else{let R0="API key saved!";if(U0.restartedAgents&&U0.restartedAgents.length>0){let _0=U0.restartedAgents.filter((P0)=>P0.success).length;if(U0.restartedAgents.length-_0===0)R0+=` Restarted ${_0} agent${_0>1?"s":""} with new key.`;else R0+=` Restarted ${_0}/${U0.restartedAgents.length} agents.`}x(R0),F(""),W(null),T()}}catch(g){S("Failed to save key")}M(!1)},E=async(g)=>{if(!await f("Are you sure you want to remove this API key?",{confirmText:"Remove",title:"Remove API Key"}))return;await Y(`/api/keys/${g}`,{method:"DELETE"}),T()},D=K.filter((g)=>g.type==="llm"),n=K.filter((g)=>g.type==="integration"),c=D.filter((g)=>g.hasKey).length,j=n.filter((g)=>g.hasKey).length;return L1.useEffect(()=>{if(V&&!_){let g=setTimeout(()=>x(null),5000);return()=>clearTimeout(g)}},[V,_]),I.jsxDEV(I.Fragment,{children:[l,I.jsxDEV("div",{className:"space-y-10",children:[V&&!_&&I.jsxDEV("div",{className:"bg-green-500/10 border border-green-500/30 rounded-lg p-4 flex items-center justify-between",children:[I.jsxDEV("div",{className:"flex items-center gap-2 text-green-400",children:[I.jsxDEV(n5,{className:"w-5 h-5"},void 0,!1,void 0,this),I.jsxDEV("span",{children:V},void 0,!1,void 0,this)]},void 0,!0,void 0,this),I.jsxDEV("button",{onClick:()=>x(null),className:"text-green-400 hover:text-green-300",children:I.jsxDEV(L6,{className:"w-4 h-4"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),I.jsxDEV("div",{children:[I.jsxDEV("div",{className:"mb-6",children:[I.jsxDEV("h1",{className:"text-2xl font-semibold mb-1",children:"AI Providers"},void 0,!1,void 0,this),I.jsxDEV("p",{className:"text-[#666]",children:["Manage your API keys for AI providers. ",c," of ",D.length," configured."]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),I.jsxDEV("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:D.map((g)=>I.jsxDEV(iI,{provider:g,isEditing:_===g.id,apiKey:O,saving:b,testing:A,error:_===g.id?k:null,success:_===g.id?V:null,onStartEdit:()=>{W(g.id),S(null),x(null)},onCancelEdit:()=>{W(null),F(""),S(null)},onApiKeyChange:F,onSave:m,onDelete:()=>E(g.id)},g.id,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),I.jsxDEV("div",{children:[I.jsxDEV("div",{className:"mb-6",children:[I.jsxDEV("h2",{className:"text-xl font-semibold mb-1",children:"MCP Integrations"},void 0,!1,void 0,this),I.jsxDEV("p",{className:"text-[#666]",children:["Connect to MCP gateways for tool integrations. ",j," of ",n.length," configured."]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),I.jsxDEV("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:n.map((g)=>I.jsxDEV(oI,{provider:g,isEditing:_===g.id,apiKey:O,saving:b,testing:A,error:_===g.id?k:null,success:_===g.id?V:null,onStartEdit:()=>{W(g.id),S(null),x(null)},onCancelEdit:()=>{W(null),F(""),S(null)},onApiKeyChange:F,onSave:m,onDelete:()=>E(g.id),projectsEnabled:B,projects:H,onRefresh:T},g.id,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}var WG=["#f97316","#6366f1","#22c55e","#ef4444","#3b82f6","#a855f7","#14b8a6","#f59e0b"];function lI(){let{projects:Y,createProject:H,updateProject:B,deleteProject:K}=G4(),[G,_]=L1.useState(!1),[W,O]=L1.useState(null),{confirm:F,ConfirmDialog:b}=a5(),M=async(S)=>{if(!await F("Are you sure you want to delete this project? Agents in this project will become unassigned.",{confirmText:"Delete",title:"Delete Project"}))return;await K(S)},A=()=>{O(null),_(!0)},R=(S)=>{O(S),_(!0)},k=()=>{_(!1),O(null)};return I.jsxDEV(I.Fragment,{children:[b,I.jsxDEV("div",{className:"max-w-4xl w-full",children:[I.jsxDEV("div",{className:"mb-6 flex items-center justify-between gap-4",children:[I.jsxDEV("div",{children:[I.jsxDEV("h1",{className:"text-2xl font-semibold mb-1",children:"Projects"},void 0,!1,void 0,this),I.jsxDEV("p",{className:"text-[#666]",children:"Organize agents into projects for better management."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),I.jsxDEV("button",{onClick:A,className:"flex items-center gap-2 bg-[#f97316] hover:bg-[#fb923c] text-black px-4 py-2 rounded font-medium transition flex-shrink-0",children:[I.jsxDEV(sH,{className:"w-4 h-4"},void 0,!1,void 0,this),"New Project"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),Y.length===0?I.jsxDEV("div",{className:"text-center py-12 text-[#666]",children:[I.jsxDEV("p",{className:"text-lg mb-2",children:"No projects yet"},void 0,!1,void 0,this),I.jsxDEV("p",{className:"text-sm",children:"Create a project to organize your agents."},void 0,!1,void 0,this)]},void 0,!0,void 0,this):I.jsxDEV("div",{className:"space-y-3",children:Y.map((S)=>I.jsxDEV("div",{className:"bg-[#111] border border-[#1a1a1a] rounded-lg p-4 flex items-center gap-4",children:[I.jsxDEV("div",{className:"w-4 h-4 rounded-full flex-shrink-0",style:{backgroundColor:S.color}},void 0,!1,void 0,this),I.jsxDEV("div",{className:"flex-1 min-w-0",children:[I.jsxDEV("h3",{className:"font-medium",children:S.name},void 0,!1,void 0,this),S.description&&I.jsxDEV("p",{className:"text-sm text-[#666] truncate",children:S.description},void 0,!1,void 0,this),I.jsxDEV("p",{className:"text-xs text-[#666] mt-1",children:[S.agentCount," agent",S.agentCount!==1?"s":""]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),I.jsxDEV("div",{className:"flex items-center gap-2",children:[I.jsxDEV("button",{onClick:()=>R(S),className:"text-sm text-[#888] hover:text-[#e0e0e0] px-2 py-1",children:"Edit"},void 0,!1,void 0,this),I.jsxDEV("button",{onClick:()=>M(S.id),className:"text-sm text-red-400 hover:text-red-300 px-2 py-1",children:"Delete"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},S.id,!0,void 0,this))},void 0,!1,void 0,this),G&&I.jsxDEV(cI,{project:W,onSave:async(S)=>{if(W){let V=await B(W.id,S);if(V)k();return!!V}else{let V=await H(S);if(V)k();return!!V}},onClose:k},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function cI({project:Y,onSave:H,onClose:B}){let[K,G]=L1.useState(Y?.name||""),[_,W]=L1.useState(Y?.description||""),[O,F]=L1.useState(Y?.color||WG[Math.floor(Math.random()*WG.length)]),[b,M]=L1.useState(!1),[A,R]=L1.useState(null),k=async()=>{if(!K.trim()){R("Name is required");return}M(!0),R(null);let S=await H({name:K,description:_||void 0,color:O});if(M(!1),!S)R(Y?"Failed to update project":"Failed to create project")};return I.jsxDEV(yz,{onClose:B,children:[I.jsxDEV("h2",{className:"text-xl font-semibold mb-6",children:Y?"Edit Project":"Create New Project"},void 0,!1,void 0,this),I.jsxDEV("div",{className:"space-y-4",children:[I.jsxDEV("div",{children:[I.jsxDEV("label",{className:"block text-sm text-[#666] mb-1",children:"Name"},void 0,!1,void 0,this),I.jsxDEV("input",{type:"text",value:K,onChange:(S)=>G(S.target.value),className:"w-full bg-[#0a0a0a] border border-[#222] rounded px-3 py-2 focus:outline-none focus:border-[#f97316]",placeholder:"My Project",autoFocus:!0},void 0,!1,void 0,this)]},void 0,!0,void 0,this),I.jsxDEV("div",{children:[I.jsxDEV("label",{className:"block text-sm text-[#666] mb-1",children:"Description (optional)"},void 0,!1,void 0,this),I.jsxDEV("input",{type:"text",value:_,onChange:(S)=>W(S.target.value),className:"w-full bg-[#0a0a0a] border border-[#222] rounded px-3 py-2 focus:outline-none focus:border-[#f97316]",placeholder:"A short description"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),I.jsxDEV("div",{children:[I.jsxDEV("label",{className:"block text-sm text-[#666] mb-1",children:"Color"},void 0,!1,void 0,this),I.jsxDEV("div",{className:"flex gap-3 flex-wrap",children:WG.map((S)=>I.jsxDEV("button",{type:"button",onClick:()=>F(S),className:`w-10 h-10 rounded-full transition ${O===S?"ring-2 ring-white ring-offset-2 ring-offset-[#111]":"hover:scale-110"}`,style:{backgroundColor:S}},S,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),A&&I.jsxDEV("p",{className:"text-red-400 text-sm",children:A},void 0,!1,void 0,this)]},void 0,!0,void 0,this),I.jsxDEV("div",{className:"flex gap-3 mt-6",children:[I.jsxDEV("button",{onClick:B,className:"flex-1 border border-[#333] hover:border-[#f97316] hover:text-[#f97316] px-4 py-2 rounded font-medium transition",children:"Cancel"},void 0,!1,void 0,this),I.jsxDEV("button",{onClick:k,disabled:b||!K.trim(),className:"flex-1 bg-[#f97316] hover:bg-[#fb923c] disabled:opacity-50 text-black px-4 py-2 rounded font-medium transition",children:b?"Saving...":Y?"Update":"Create"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function dI(){let{authFetch:Y}=A1(),[H,B]=L1.useState(null),[K,G]=L1.useState(!1),[_,W]=L1.useState(!1),[O,F]=L1.useState(null),[b,M]=L1.useState(null),[A,R]=L1.useState(null),k=async()=>{G(!0),F(null);try{let f=await Y("/api/version");if(!f.ok)throw Error("Failed to check for updates");let l=await f.json();B(l)}catch(f){F("Failed to check for updates")}G(!1)},S=async()=>{W(!0),F(null),M(null);try{let l=await(await Y("/api/version/update",{method:"POST"})).json();if(!l.success)F(l.error||"Update failed");else{let T=l.restarted?.length||0,m=T>0?` ${T} running agent${T>1?"s":""} restarted.`:"";M(`Agent binary updated to v${l.version}.${m}`),await k()}}catch(f){F("Failed to update agent")}W(!1)};L1.useEffect(()=>{k()},[]);let V=(f,l)=>{navigator.clipboard.writeText(f),R(l),setTimeout(()=>R(null),2000)},x=H?.apteva.updateAvailable||H?.agent.updateAvailable;return I.jsxDEV("div",{className:"max-w-4xl w-full",children:[I.jsxDEV("div",{className:"mb-6",children:[I.jsxDEV("h1",{className:"text-2xl font-semibold mb-1",children:"Updates"},void 0,!1,void 0,this),I.jsxDEV("p",{className:"text-[#666]",children:"Check for new versions of apteva and the agent binary."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),K&&!H?I.jsxDEV("div",{className:"text-[#666]",children:"Checking version info..."},void 0,!1,void 0,this):O&&!H?I.jsxDEV("div",{className:"text-red-400",children:O},void 0,!1,void 0,this):H?.isDocker?I.jsxDEV("div",{className:"space-y-6",children:[I.jsxDEV("div",{className:"bg-blue-500/10 border border-blue-500/30 rounded-lg p-4",children:[I.jsxDEV("div",{className:"flex items-center gap-2 text-blue-400 mb-2",children:[I.jsxDEV("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24",children:I.jsxDEV("path",{d:"M13.983 11.078h2.119a.186.186 0 00.186-.185V9.006a.186.186 0 00-.186-.186h-2.119a.185.185 0 00-.185.185v1.888c0 .102.083.185.185.185m-2.954-5.43h2.118a.186.186 0 00.186-.186V3.574a.186.186 0 00-.186-.185h-2.118a.185.185 0 00-.185.185v1.888c0 .102.082.185.185.185m0 2.716h2.118a.187.187 0 00.186-.186V6.29a.186.186 0 00-.186-.185h-2.118a.185.185 0 00-.185.185v1.887c0 .102.082.186.185.186m-2.93 0h2.12a.186.186 0 00.184-.186V6.29a.185.185 0 00-.185-.185H8.1a.185.185 0 00-.185.185v1.887c0 .102.083.186.185.186m-2.964 0h2.119a.186.186 0 00.185-.186V6.29a.186.186 0 00-.185-.185H5.136a.186.186 0 00-.186.185v1.887c0 .102.084.186.186.186m5.893 2.715h2.118a.186.186 0 00.186-.185V9.006a.186.186 0 00-.186-.186h-2.118a.185.185 0 00-.185.185v1.888c0 .102.082.185.185.185m-2.93 0h2.12a.185.185 0 00.184-.185V9.006a.185.185 0 00-.184-.186h-2.12a.185.185 0 00-.184.185v1.888c0 .102.083.185.185.185m-2.964 0h2.119a.185.185 0 00.185-.185V9.006a.185.185 0 00-.185-.186H5.136a.186.186 0 00-.186.186v1.887c0 .102.084.185.186.185m-2.92 0h2.12a.185.185 0 00.184-.185V9.006a.185.185 0 00-.184-.186h-2.12a.186.186 0 00-.186.186v1.887c0 .102.084.185.186.185M23.763 9.89c-.065-.051-.672-.51-1.954-.51-.338.001-.676.03-1.01.087-.248-1.7-1.653-2.53-1.716-2.566l-.344-.199-.226.327c-.284.438-.49.922-.612 1.43-.23.97-.09 1.882.403 2.661-.595.332-1.55.413-1.744.42H.751a.751.751 0 00-.75.748 11.376 11.376 0 00.692 4.062c.545 1.428 1.355 2.48 2.41 3.124 1.18.723 3.1 1.137 5.275 1.137.983.003 1.963-.086 2.93-.266a12.248 12.248 0 003.823-1.389c.98-.567 1.86-1.288 2.61-2.136 1.252-1.418 1.998-2.997 2.553-4.4h.221c1.372 0 2.215-.549 2.68-1.009.309-.293.55-.65.707-1.046l.098-.288Z"},void 0,!1,void 0,this)},void 0,!1,void 0,this),I.jsxDEV("span",{className:"font-medium",children:"Docker Environment"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),I.jsxDEV("p",{className:"text-sm text-[#888]",children:"Updates are automatic when you pull a new image version."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),I.jsxDEV("div",{className:"bg-[#111] border border-[#1a1a1a] rounded-lg p-5",children:[I.jsxDEV("div",{className:"flex items-center justify-between mb-4",children:[I.jsxDEV("div",{children:[I.jsxDEV("h3",{className:"font-medium text-lg",children:"Current Version"},void 0,!1,void 0,this),I.jsxDEV("p",{className:"text-sm text-[#666]",children:"apteva + agent binary"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),I.jsxDEV("div",{className:"text-right",children:I.jsxDEV("div",{className:"text-xl font-mono",children:["v",H.apteva.installed||"?"]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),x?I.jsxDEV("div",{className:"bg-[#f97316]/10 border border-[#f97316]/30 rounded-lg p-4",children:[I.jsxDEV("p",{className:"text-sm text-[#888] mb-3",children:["A newer version (v",H.apteva.latest,") is available. To update:"]},void 0,!0,void 0,this),I.jsxDEV("div",{className:"space-y-2",children:[I.jsxDEV("code",{className:"block bg-[#0a0a0a] px-3 py-2 rounded font-mono text-sm text-[#888]",children:"docker pull apteva/apteva:latest"},void 0,!1,void 0,this),I.jsxDEV("code",{className:"block bg-[#0a0a0a] px-3 py-2 rounded font-mono text-sm text-[#888]",children:"docker compose up -d"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),I.jsxDEV("button",{onClick:()=>{navigator.clipboard.writeText("docker pull apteva/apteva:latest && docker compose up -d"),R("docker"),setTimeout(()=>R(null),2000)},className:"mt-3 px-3 py-1.5 bg-[#1a1a1a] hover:bg-[#222] rounded text-sm",children:A==="docker"?"Copied!":"Copy commands"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):I.jsxDEV("div",{className:"flex items-center gap-2 text-green-400 text-sm",children:[I.jsxDEV(n5,{className:"w-4 h-4"},void 0,!1,void 0,this),"Up to date"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),I.jsxDEV("p",{className:"text-xs text-[#555]",children:"Your data is stored in a Docker volume and persists across updates."},void 0,!1,void 0,this)]},void 0,!0,void 0,this):H?I.jsxDEV("div",{className:"space-y-6",children:[b&&I.jsxDEV("div",{className:"bg-green-500/10 border border-green-500/30 rounded-lg p-4 text-green-400",children:b},void 0,!1,void 0,this),O&&I.jsxDEV("div",{className:"bg-red-500/10 border border-red-500/30 rounded-lg p-4 text-red-400",children:O},void 0,!1,void 0,this),I.jsxDEV("div",{className:"bg-[#111] border border-[#1a1a1a] rounded-lg p-5",children:[I.jsxDEV("div",{className:"flex items-center justify-between mb-4",children:[I.jsxDEV("div",{children:[I.jsxDEV("h3",{className:"font-medium text-lg",children:"apteva"},void 0,!1,void 0,this),I.jsxDEV("p",{className:"text-sm text-[#666]",children:"The app you're running"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),I.jsxDEV("div",{className:"text-right",children:[I.jsxDEV("div",{className:"text-xl font-mono",children:["v",H.apteva.installed||"?"]},void 0,!0,void 0,this),H.apteva.updateAvailable&&I.jsxDEV("div",{className:"text-sm text-[#f97316]",children:["→ v",H.apteva.latest]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),H.apteva.updateAvailable?I.jsxDEV("div",{className:"bg-[#f97316]/10 border border-[#f97316]/30 rounded-lg p-4",children:[I.jsxDEV("p",{className:"text-sm text-[#888] mb-3",children:"Update by running:"},void 0,!1,void 0,this),I.jsxDEV("div",{className:"flex items-center gap-2",children:[I.jsxDEV("code",{className:"flex-1 bg-[#0a0a0a] px-3 py-2 rounded font-mono text-sm text-[#888]",children:"npx apteva@latest"},void 0,!1,void 0,this),I.jsxDEV("button",{onClick:()=>V("npx apteva@latest","apteva"),className:"px-3 py-2 bg-[#1a1a1a] hover:bg-[#222] rounded text-sm",children:A==="apteva"?"Copied!":"Copy"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):I.jsxDEV("div",{className:"flex items-center gap-2 text-green-400 text-sm",children:[I.jsxDEV(n5,{className:"w-4 h-4"},void 0,!1,void 0,this),"Up to date"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),I.jsxDEV("div",{className:"bg-[#111] border border-[#1a1a1a] rounded-lg p-5",children:[I.jsxDEV("div",{className:"flex items-center justify-between mb-4",children:[I.jsxDEV("div",{children:[I.jsxDEV("h3",{className:"font-medium text-lg",children:"Agent Binary"},void 0,!1,void 0,this),I.jsxDEV("p",{className:"text-sm text-[#666]",children:"The Go binary that runs agents"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),I.jsxDEV("div",{className:"text-right",children:[I.jsxDEV("div",{className:"text-xl font-mono",children:["v",H.agent.installed||"?"]},void 0,!0,void 0,this),H.agent.updateAvailable&&I.jsxDEV("div",{className:"text-sm text-[#f97316]",children:["→ v",H.agent.latest]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),H.agent.updateAvailable?I.jsxDEV("div",{className:"bg-[#f97316]/10 border border-[#f97316]/30 rounded-lg p-4",children:[I.jsxDEV("p",{className:"text-sm text-[#888] mb-3",children:"A new version is available. Stop all agents before updating."},void 0,!1,void 0,this),I.jsxDEV("div",{className:"flex items-center gap-2",children:I.jsxDEV("button",{onClick:S,disabled:_,className:"px-4 py-2 bg-[#f97316] text-black rounded font-medium text-sm disabled:opacity-50",children:_?"Updating...":"Update Agent"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this):I.jsxDEV("div",{className:"flex items-center gap-2 text-green-400 text-sm",children:[I.jsxDEV(n5,{className:"w-4 h-4"},void 0,!1,void 0,this),"Up to date"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),!x&&!b&&I.jsxDEV("div",{className:"bg-green-500/10 border border-green-500/30 rounded-lg p-4 flex items-center gap-2 text-green-400",children:[I.jsxDEV(n5,{className:"w-5 h-5"},void 0,!1,void 0,this),"Everything is up to date!"]},void 0,!0,void 0,this),I.jsxDEV("button",{onClick:k,disabled:K,className:"text-sm text-[#666] hover:text-[#888] disabled:opacity-50",children:K?"Checking...":"Check for updates"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)}function iI({provider:Y,isEditing:H,apiKey:B,saving:K,testing:G,error:_,success:W,onStartEdit:O,onCancelEdit:F,onApiKeyChange:b,onSave:M,onDelete:A}){let R=Y.id==="ollama",[k,S]=L1.default.useState(null);return L1.default.useEffect(()=>{if(R&&Y.hasKey)fetch("/api/providers/ollama/status").then((V)=>V.json()).then((V)=>S({connected:V.connected,modelCount:V.modelCount})).catch(()=>S({connected:!1}))},[R,Y.hasKey]),I.jsxDEV("div",{className:`bg-[#111] border rounded-lg p-4 ${Y.hasKey?"border-green-500/20":"border-[#1a1a1a]"}`,children:[I.jsxDEV("div",{className:"flex items-start justify-between gap-2 mb-2",children:[I.jsxDEV("div",{className:"min-w-0",children:[I.jsxDEV("h3",{className:"font-medium",children:Y.name},void 0,!1,void 0,this),I.jsxDEV("p",{className:"text-sm text-[#666] truncate",children:Y.type==="integration"?Y.description||"MCP integration":R?"Run models locally":`${Y.models.length} models`},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Y.hasKey?I.jsxDEV("span",{className:`text-xs flex items-center gap-1 px-2 py-1 rounded whitespace-nowrap flex-shrink-0 ${R&&k?k.connected?"text-green-400 bg-green-500/10":"text-yellow-400 bg-yellow-500/10":"text-green-400 bg-green-500/10"}`,children:R&&k?k.connected?I.jsxDEV(I.Fragment,{children:[I.jsxDEV(n5,{className:"w-3 h-3"},void 0,!1,void 0,this),k.modelCount," models"]},void 0,!0,void 0,this):I.jsxDEV(I.Fragment,{children:"Not running"},void 0,!1,void 0,this):I.jsxDEV(I.Fragment,{children:[I.jsxDEV(n5,{className:"w-3 h-3"},void 0,!1,void 0,this),Y.keyHint]},void 0,!0,void 0,this)},void 0,!1,void 0,this):I.jsxDEV("span",{className:"text-[#666] text-xs bg-[#1a1a1a] px-2 py-1 rounded whitespace-nowrap flex-shrink-0",children:"Not configured"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),I.jsxDEV("div",{className:"mt-3 pt-3 border-t border-[#1a1a1a]",children:H?I.jsxDEV("div",{className:"space-y-3",children:[I.jsxDEV("input",{type:R?"text":"password",value:B,onChange:(V)=>b(V.target.value),placeholder:R?"http://localhost:11434":Y.hasKey?"Enter new API key...":"Enter API key...",autoFocus:!0,className:"w-full bg-[#0a0a0a] border border-[#333] rounded px-3 py-2 focus:outline-none focus:border-[#f97316]"},void 0,!1,void 0,this),R&&I.jsxDEV("p",{className:"text-xs text-[#666]",children:"Enter your Ollama server URL. Default is http://localhost:11434"},void 0,!1,void 0,this),_&&I.jsxDEV("p",{className:"text-red-400 text-sm",children:_},void 0,!1,void 0,this),W&&I.jsxDEV("p",{className:"text-green-400 text-sm",children:W},void 0,!1,void 0,this),I.jsxDEV("div",{className:"flex gap-2",children:[I.jsxDEV("button",{onClick:F,className:"flex-1 px-3 py-1.5 border border-[#333] rounded text-sm hover:border-[#666]",children:"Cancel"},void 0,!1,void 0,this),I.jsxDEV("button",{onClick:M,disabled:!B||K,className:"flex-1 px-3 py-1.5 bg-[#f97316] text-black rounded text-sm font-medium disabled:opacity-50",children:G?"Validating...":K?"Saving...":R?"Connect":"Save"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):Y.hasKey?I.jsxDEV("div",{className:"flex items-center justify-between",children:[I.jsxDEV("a",{href:Y.docsUrl,target:"_blank",rel:"noopener noreferrer",className:"text-sm text-[#3b82f6] hover:underline",children:R?"Download Ollama":"View docs"},void 0,!1,void 0,this),I.jsxDEV("div",{className:"flex items-center gap-3",children:[I.jsxDEV("button",{onClick:O,className:"text-sm text-[#888] hover:text-[#e0e0e0]",children:R?"Change URL":"Update key"},void 0,!1,void 0,this),I.jsxDEV("button",{onClick:A,className:"text-red-400 hover:text-red-300 text-sm",children:"Remove"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):I.jsxDEV("div",{className:"flex items-center justify-between",children:[I.jsxDEV("a",{href:Y.docsUrl,target:"_blank",rel:"noopener noreferrer",className:"text-sm text-[#3b82f6] hover:underline",children:R?"Download Ollama":"Get API key"},void 0,!1,void 0,this),I.jsxDEV("button",{onClick:O,className:"text-sm text-[#f97316] hover:text-[#fb923c]",children:R?"Configure":"+ Add key"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function oI({provider:Y,isEditing:H,apiKey:B,saving:K,testing:G,error:_,success:W,onStartEdit:O,onCancelEdit:F,onApiKeyChange:b,onSave:M,onDelete:A,projectsEnabled:R,projects:k,onRefresh:S}){let{authFetch:V}=A1(),[x,f]=L1.useState([]),[l,T]=L1.useState(""),[m,E]=L1.useState(!1),[D,n]=L1.useState(null),[c,j]=L1.useState(!1),{confirm:g,ConfirmDialog:Q0}=a5(),r=async()=>{try{let B0=await(await V(`/api/keys/${Y.id}`)).json();f(B0.keys||[])}catch(Y0){console.error("Failed to fetch keys:",Y0)}};L1.useEffect(()=>{if(R)r()},[Y.id,R]),L1.useEffect(()=>{if(H)n(null)},[H]);let U0=async()=>{if(!B)return;j(!0),n(null);try{let Y0=await V(`/api/keys/${Y.id}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:B,project_id:l||null})}),B0=await Y0.json();if(Y0.ok)b(""),T(""),F(),r(),S();else n(B0.error||"Failed to save key")}catch(Y0){console.error("Failed to save key:",Y0),n("Failed to save key")}j(!1)},R0=async(Y0,B0)=>{if(!await g(`Are you sure you want to remove this API key${B0?` (${B0})`:""}?`,{confirmText:"Remove",title:"Remove API Key"}))return;try{await V(`/api/keys/by-id/${Y0}`,{method:"DELETE"}),r(),S()}catch(h0){console.error("Failed to delete key:",h0)}},_0=x.find((Y0)=>!Y0.project_id),f0=x.filter((Y0)=>Y0.project_id),P0=(Y0)=>k.find((B0)=>B0.id===Y0)?.name||"Unknown",a=(Y0)=>k.find((B0)=>B0.id===Y0)?.color||"#666";if(!R)return I.jsxDEV("div",{className:`bg-[#111] border rounded-lg p-4 ${Y.hasKey?"border-[#f97316]/20":"border-[#1a1a1a]"}`,children:[I.jsxDEV("div",{className:"flex items-center justify-between mb-2",children:[I.jsxDEV("div",{children:[I.jsxDEV("h3",{className:"font-medium",children:Y.name},void 0,!1,void 0,this),I.jsxDEV("p",{className:"text-sm text-[#666]",children:Y.description||"MCP integration"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Y.hasKey?I.jsxDEV("span",{className:"text-[#f97316] text-xs flex items-center gap-1 bg-[#f97316]/10 px-2 py-1 rounded",children:[I.jsxDEV(n5,{className:"w-3 h-3"},void 0,!1,void 0,this),Y.keyHint]},void 0,!0,void 0,this):I.jsxDEV("span",{className:"text-[#666] text-xs bg-[#1a1a1a] px-2 py-1 rounded",children:"Not configured"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),I.jsxDEV("div",{className:"mt-3 pt-3 border-t border-[#1a1a1a]",children:H?I.jsxDEV("div",{className:"space-y-3",children:[I.jsxDEV("input",{type:"password",value:B,onChange:(Y0)=>b(Y0.target.value),placeholder:Y.hasKey?"Enter new API key...":"Enter API key...",autoFocus:!0,className:"w-full bg-[#0a0a0a] border border-[#333] rounded px-3 py-2 focus:outline-none focus:border-[#f97316]"},void 0,!1,void 0,this),_&&I.jsxDEV("p",{className:"text-red-400 text-sm",children:_},void 0,!1,void 0,this),W&&I.jsxDEV("p",{className:"text-green-400 text-sm",children:W},void 0,!1,void 0,this),I.jsxDEV("div",{className:"flex gap-2",children:[I.jsxDEV("button",{onClick:F,className:"flex-1 px-3 py-1.5 border border-[#333] rounded text-sm hover:border-[#666]",children:"Cancel"},void 0,!1,void 0,this),I.jsxDEV("button",{onClick:M,disabled:!B||K,className:"flex-1 px-3 py-1.5 bg-[#f97316] text-black rounded text-sm font-medium disabled:opacity-50",children:G?"Validating...":K?"Saving...":"Save"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):Y.hasKey?I.jsxDEV("div",{className:"flex items-center justify-between",children:[I.jsxDEV("a",{href:Y.docsUrl,target:"_blank",rel:"noopener noreferrer",className:"text-sm text-[#3b82f6] hover:underline",children:"View docs"},void 0,!1,void 0,this),I.jsxDEV("div",{className:"flex items-center gap-3",children:[I.jsxDEV("button",{onClick:O,className:"text-sm text-[#888] hover:text-[#e0e0e0]",children:"Update key"},void 0,!1,void 0,this),I.jsxDEV("button",{onClick:A,className:"text-red-400 hover:text-red-300 text-sm",children:"Remove"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):I.jsxDEV("div",{className:"flex items-center justify-between",children:[I.jsxDEV("a",{href:Y.docsUrl,target:"_blank",rel:"noopener noreferrer",className:"text-sm text-[#3b82f6] hover:underline",children:"Get API key"},void 0,!1,void 0,this),I.jsxDEV("button",{onClick:O,className:"text-sm text-[#f97316] hover:text-[#fb923c]",children:"+ Add key"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this);return I.jsxDEV(I.Fragment,{children:[Q0,I.jsxDEV("div",{className:`bg-[#111] border rounded-lg p-4 ${x.length>0?"border-[#f97316]/20":"border-[#1a1a1a]"}`,children:[I.jsxDEV("div",{className:"flex items-center justify-between mb-2",children:[I.jsxDEV("div",{children:[I.jsxDEV("h3",{className:"font-medium",children:Y.name},void 0,!1,void 0,this),I.jsxDEV("p",{className:"text-sm text-[#666]",children:Y.description||"MCP integration"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),x.length>0?I.jsxDEV("span",{className:"text-[#f97316] text-xs flex items-center gap-1 bg-[#f97316]/10 px-2 py-1 rounded",children:[I.jsxDEV(n5,{className:"w-3 h-3"},void 0,!1,void 0,this),x.length," key",x.length!==1?"s":""]},void 0,!0,void 0,this):I.jsxDEV("span",{className:"text-[#666] text-xs bg-[#1a1a1a] px-2 py-1 rounded",children:"Not configured"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),x.length>0&&I.jsxDEV("div",{className:"mt-3 space-y-2",children:[_0&&I.jsxDEV("div",{className:"flex items-center justify-between text-sm bg-[#0a0a0a] rounded px-3 py-2",children:[I.jsxDEV("div",{className:"flex items-center gap-2",children:[I.jsxDEV("span",{className:"text-[#888]",children:"Global"},void 0,!1,void 0,this),I.jsxDEV("span",{className:"text-[#555]",children:"·"},void 0,!1,void 0,this),I.jsxDEV("span",{className:"text-[#666] font-mono text-xs",children:_0.key_hint},void 0,!1,void 0,this)]},void 0,!0,void 0,this),I.jsxDEV("button",{onClick:()=>R0(_0.id,"Global"),className:"text-red-400 hover:text-red-300 text-xs",children:"Remove"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),f0.slice(0,m?void 0:2).map((Y0)=>I.jsxDEV("div",{className:"flex items-center justify-between text-sm bg-[#0a0a0a] rounded px-3 py-2",children:[I.jsxDEV("div",{className:"flex items-center gap-2 min-w-0",children:[I.jsxDEV("span",{className:"w-2 h-2 rounded-full flex-shrink-0",style:{backgroundColor:a(Y0.project_id)}},void 0,!1,void 0,this),I.jsxDEV("span",{className:"text-[#888] truncate",children:Y0.name||P0(Y0.project_id)},void 0,!1,void 0,this),I.jsxDEV("span",{className:"text-[#555]",children:"·"},void 0,!1,void 0,this),I.jsxDEV("span",{className:"text-[#666] font-mono text-xs",children:Y0.key_hint},void 0,!1,void 0,this)]},void 0,!0,void 0,this),I.jsxDEV("button",{onClick:()=>R0(Y0.id,Y0.name||P0(Y0.project_id)),className:"text-red-400 hover:text-red-300 text-xs flex-shrink-0 ml-2",children:"Remove"},void 0,!1,void 0,this)]},Y0.id,!0,void 0,this)),f0.length>2&&!m&&I.jsxDEV("button",{onClick:()=>E(!0),className:"text-xs text-[#666] hover:text-[#888] w-full text-center py-1",children:["Show ",f0.length-2," more..."]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),I.jsxDEV("div",{className:"mt-3 pt-3 border-t border-[#1a1a1a]",children:H?I.jsxDEV("div",{className:"space-y-3",children:[I.jsxDEV("input",{type:"password",value:B,onChange:(Y0)=>b(Y0.target.value),placeholder:"Enter API key...",autoFocus:!0,className:"w-full bg-[#0a0a0a] border border-[#333] rounded px-3 py-2 focus:outline-none focus:border-[#f97316]"},void 0,!1,void 0,this),I.jsxDEV(t4,{value:l,onChange:T,placeholder:"Global (all projects)",options:[{value:"",label:"Global (all projects)"},...k.map((Y0)=>({value:Y0.id,label:Y0.name}))]},void 0,!1,void 0,this),D&&I.jsxDEV("p",{className:"text-red-400 text-sm",children:D},void 0,!1,void 0,this),I.jsxDEV("div",{className:"flex gap-2",children:[I.jsxDEV("button",{onClick:()=>{F(),T(""),n(null)},className:"flex-1 px-3 py-1.5 border border-[#333] rounded text-sm hover:border-[#666]",children:"Cancel"},void 0,!1,void 0,this),I.jsxDEV("button",{onClick:U0,disabled:!B||c,className:"flex-1 px-3 py-1.5 bg-[#f97316] text-black rounded text-sm font-medium disabled:opacity-50",children:c?"Saving...":"Save"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):I.jsxDEV("div",{className:"flex items-center justify-between",children:[I.jsxDEV("a",{href:Y.docsUrl,target:"_blank",rel:"noopener noreferrer",className:"text-sm text-[#3b82f6] hover:underline",children:x.length>0?"View docs":"Get API key"},void 0,!1,void 0,this),I.jsxDEV("button",{onClick:O,className:"text-sm text-[#f97316] hover:text-[#fb923c]",children:"+ Add key"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function aI(){let{authFetch:Y}=A1(),[H,B]=L1.useState([]),[K,G]=L1.useState(!1),[_,W]=L1.useState(""),[O,F]=L1.useState("90"),[b,M]=L1.useState(!1),[A,R]=L1.useState(null),[k,S]=L1.useState(null),[V,x]=L1.useState(!1),{confirm:f,ConfirmDialog:l}=a5(),T=async()=>{try{let g=await(await Y("/api/keys/personal")).json();B(g.keys||[])}catch{}};L1.useEffect(()=>{T()},[]);let m=async()=>{if(!_.trim()){R("Name is required");return}M(!0),R(null);try{let j=await Y("/api/keys/personal",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:_.trim(),expires_in_days:O?parseInt(O):null})}),g=await j.json();if(!j.ok)R(g.error||"Failed to create key");else S(g.key),W(""),F("90"),T()}catch{R("Failed to create key")}M(!1)},E=async(j,g)=>{if(!await f(`Delete API key "${g}"? This cannot be undone.`,{confirmText:"Delete",title:"Delete API Key"}))return;try{await Y(`/api/keys/personal/${j}`,{method:"DELETE"}),T()}catch{}},D=()=>{if(k)navigator.clipboard.writeText(k),x(!0),setTimeout(()=>x(!1),2000)},n=(j)=>{if(!j)return"Never";return new Date(j).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})},c=(j)=>{if(!j)return!1;return new Date(j)<new Date};return I.jsxDEV(I.Fragment,{children:[l,I.jsxDEV("div",{className:"max-w-4xl w-full",children:[I.jsxDEV("div",{className:"mb-6 flex items-center justify-between gap-4",children:[I.jsxDEV("div",{children:[I.jsxDEV("h1",{className:"text-2xl font-semibold mb-1",children:"API Keys"},void 0,!1,void 0,this),I.jsxDEV("p",{className:"text-[#666]",children:["Create personal API keys for programmatic access. Use them with the ",I.jsxDEV("code",{className:"text-[#888] bg-[#1a1a1a] px-1 rounded text-xs",children:"X-API-Key"},void 0,!1,void 0,this)," header."]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),!K&&!k&&I.jsxDEV("button",{onClick:()=>{G(!0),R(null)},className:"flex items-center gap-2 bg-[#f97316] hover:bg-[#fb923c] text-black px-4 py-2 rounded font-medium transition flex-shrink-0",children:[I.jsxDEV(sH,{className:"w-4 h-4"},void 0,!1,void 0,this),"New Key"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),k&&I.jsxDEV("div",{className:"bg-green-500/10 border border-green-500/30 rounded-lg p-4 mb-6",children:[I.jsxDEV("div",{className:"flex items-center gap-2 text-green-400 mb-2",children:[I.jsxDEV(n5,{className:"w-5 h-5"},void 0,!1,void 0,this),I.jsxDEV("span",{className:"font-medium",children:"API key created"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),I.jsxDEV("p",{className:"text-sm text-[#888] mb-3",children:"Copy this key now. You won't be able to see it again."},void 0,!1,void 0,this),I.jsxDEV("div",{className:"flex items-center gap-2",children:[I.jsxDEV("code",{className:"flex-1 bg-[#0a0a0a] px-3 py-2 rounded font-mono text-sm text-[#e0e0e0] break-all select-all",children:k},void 0,!1,void 0,this),I.jsxDEV("button",{onClick:D,className:"px-3 py-2 bg-[#1a1a1a] hover:bg-[#222] rounded text-sm flex-shrink-0",children:V?"Copied!":"Copy"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),I.jsxDEV("button",{onClick:()=>{S(null),G(!1)},className:"mt-3 text-sm text-[#666] hover:text-[#888]",children:"Done"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),K&&!k&&I.jsxDEV("div",{className:"bg-[#111] border border-[#1a1a1a] rounded-lg p-4 mb-6",children:[I.jsxDEV("h3",{className:"font-medium mb-4",children:"Create new API key"},void 0,!1,void 0,this),I.jsxDEV("div",{className:"space-y-4 max-w-md",children:[I.jsxDEV("div",{children:[I.jsxDEV("label",{className:"block text-sm text-[#666] mb-1",children:"Name"},void 0,!1,void 0,this),I.jsxDEV("input",{type:"text",value:_,onChange:(j)=>W(j.target.value),placeholder:"e.g. CI Pipeline, My Script",autoFocus:!0,className:"w-full bg-[#0a0a0a] border border-[#333] rounded px-3 py-2 focus:outline-none focus:border-[#f97316]"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),I.jsxDEV("div",{children:[I.jsxDEV("label",{className:"block text-sm text-[#666] mb-1",children:"Expiration"},void 0,!1,void 0,this),I.jsxDEV("select",{value:O,onChange:(j)=>F(j.target.value),className:"w-full bg-[#0a0a0a] border border-[#333] rounded px-3 py-2 focus:outline-none focus:border-[#f97316]",children:[I.jsxDEV("option",{value:"30",children:"30 days"},void 0,!1,void 0,this),I.jsxDEV("option",{value:"90",children:"90 days"},void 0,!1,void 0,this),I.jsxDEV("option",{value:"180",children:"180 days"},void 0,!1,void 0,this),I.jsxDEV("option",{value:"365",children:"1 year"},void 0,!1,void 0,this),I.jsxDEV("option",{value:"",children:"No expiration"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),A&&I.jsxDEV("p",{className:"text-red-400 text-sm",children:A},void 0,!1,void 0,this),I.jsxDEV("div",{className:"flex gap-2",children:[I.jsxDEV("button",{onClick:()=>{G(!1),R(null),W("")},className:"flex-1 px-3 py-2 border border-[#333] rounded text-sm hover:border-[#666]",children:"Cancel"},void 0,!1,void 0,this),I.jsxDEV("button",{onClick:m,disabled:b||!_.trim(),className:"flex-1 px-3 py-2 bg-[#f97316] text-black rounded text-sm font-medium disabled:opacity-50",children:b?"Creating...":"Create Key"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),H.length===0?I.jsxDEV("div",{className:"text-center py-12 text-[#666]",children:[I.jsxDEV("p",{className:"text-lg mb-2",children:"No API keys yet"},void 0,!1,void 0,this),I.jsxDEV("p",{className:"text-sm",children:"Create an API key to access apteva programmatically."},void 0,!1,void 0,this)]},void 0,!0,void 0,this):I.jsxDEV("div",{className:"space-y-3",children:H.map((j)=>I.jsxDEV("div",{className:`bg-[#111] border rounded-lg p-4 flex items-center gap-4 ${!j.is_active||c(j.expires_at)?"border-[#1a1a1a] opacity-60":"border-[#1a1a1a]"}`,children:[I.jsxDEV("div",{className:"flex-1 min-w-0",children:[I.jsxDEV("div",{className:"flex items-center gap-2 mb-1",children:[I.jsxDEV("h3",{className:"font-medium",children:j.name},void 0,!1,void 0,this),!j.is_active&&I.jsxDEV("span",{className:"text-xs text-red-400 bg-red-500/10 px-2 py-0.5 rounded",children:"Revoked"},void 0,!1,void 0,this),j.is_active&&c(j.expires_at)&&I.jsxDEV("span",{className:"text-xs text-yellow-400 bg-yellow-500/10 px-2 py-0.5 rounded",children:"Expired"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),I.jsxDEV("div",{className:"flex items-center gap-3 text-sm text-[#666]",children:[I.jsxDEV("code",{className:"font-mono text-xs bg-[#0a0a0a] px-2 py-0.5 rounded",children:[j.prefix,"..."]},void 0,!0,void 0,this),I.jsxDEV("span",{children:["Created ",n(j.created_at)]},void 0,!0,void 0,this),j.expires_at&&I.jsxDEV("span",{children:["Expires ",n(j.expires_at)]},void 0,!0,void 0,this),j.last_used_at&&I.jsxDEV("span",{children:["Last used ",n(j.last_used_at)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),j.is_active&&I.jsxDEV("button",{onClick:()=>E(j.id,j.name),className:"text-sm text-red-400 hover:text-red-300 px-2 py-1 flex-shrink-0",children:"Delete"},void 0,!1,void 0,this)]},j.id,!0,void 0,this))},void 0,!1,void 0,this),H.length>0&&I.jsxDEV("div",{className:"mt-6 bg-[#111] border border-[#1a1a1a] rounded-lg p-4",children:[I.jsxDEV("h3",{className:"font-medium mb-2 text-sm",children:"Usage"},void 0,!1,void 0,this),I.jsxDEV("code",{className:"block bg-[#0a0a0a] px-3 py-2 rounded font-mono text-xs text-[#888]",children:'curl -H "X-API-Key: apt_..." http://localhost:4280/api/agents'},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function nI(){let{authFetch:Y,user:H}=A1(),[B,K]=L1.useState(""),[G,_]=L1.useState(""),[W,O]=L1.useState(""),[F,b]=L1.useState(!1),[M,A]=L1.useState(null),R=async()=>{if(!B||!G||!W){A({type:"error",text:"All fields are required"});return}if(G!==W){A({type:"error",text:"New passwords do not match"});return}if(G.length<8){A({type:"error",text:"Password must be at least 8 characters"});return}b(!0),A(null);try{let k=await Y("/api/auth/password",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({currentPassword:B,newPassword:G})}),S=await k.json();if(k.ok)A({type:"success",text:"Password updated successfully"}),K(""),_(""),O("");else A({type:"error",text:S.error||"Failed to update password"})}catch{A({type:"error",text:"Failed to update password"})}b(!1)};return I.jsxDEV("div",{className:"max-w-4xl w-full",children:[I.jsxDEV("div",{className:"mb-6",children:[I.jsxDEV("h1",{className:"text-2xl font-semibold mb-1",children:"Account Settings"},void 0,!1,void 0,this),I.jsxDEV("p",{className:"text-[#666]",children:"Manage your account and security."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),H&&I.jsxDEV("div",{className:"bg-[#111] border border-[#1a1a1a] rounded-lg p-4 mb-6",children:[I.jsxDEV("h3",{className:"font-medium mb-3",children:"Profile"},void 0,!1,void 0,this),I.jsxDEV("div",{className:"space-y-2 text-sm",children:[I.jsxDEV("div",{className:"flex justify-between",children:[I.jsxDEV("span",{className:"text-[#666]",children:"Username"},void 0,!1,void 0,this),I.jsxDEV("span",{children:H.username},void 0,!1,void 0,this)]},void 0,!0,void 0,this),H.email&&I.jsxDEV("div",{className:"flex justify-between",children:[I.jsxDEV("span",{className:"text-[#666]",children:"Email"},void 0,!1,void 0,this),I.jsxDEV("span",{children:H.email},void 0,!1,void 0,this)]},void 0,!0,void 0,this),I.jsxDEV("div",{className:"flex justify-between",children:[I.jsxDEV("span",{className:"text-[#666]",children:"Role"},void 0,!1,void 0,this),I.jsxDEV("span",{className:"capitalize",children:H.role},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),I.jsxDEV("div",{className:"bg-[#111] border border-[#1a1a1a] rounded-lg p-4",children:[I.jsxDEV("h3",{className:"font-medium mb-4",children:"Change Password"},void 0,!1,void 0,this),I.jsxDEV("div",{className:"space-y-4 max-w-md",children:[I.jsxDEV("div",{children:[I.jsxDEV("label",{className:"block text-sm text-[#666] mb-1",children:"Current Password"},void 0,!1,void 0,this),I.jsxDEV("input",{type:"password",value:B,onChange:(k)=>K(k.target.value),className:"w-full bg-[#0a0a0a] border border-[#333] rounded px-3 py-2 focus:outline-none focus:border-[#f97316]"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),I.jsxDEV("div",{children:[I.jsxDEV("label",{className:"block text-sm text-[#666] mb-1",children:"New Password"},void 0,!1,void 0,this),I.jsxDEV("input",{type:"password",value:G,onChange:(k)=>_(k.target.value),className:"w-full bg-[#0a0a0a] border border-[#333] rounded px-3 py-2 focus:outline-none focus:border-[#f97316]"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),I.jsxDEV("div",{children:[I.jsxDEV("label",{className:"block text-sm text-[#666] mb-1",children:"Confirm New Password"},void 0,!1,void 0,this),I.jsxDEV("input",{type:"password",value:W,onChange:(k)=>O(k.target.value),className:"w-full bg-[#0a0a0a] border border-[#333] rounded px-3 py-2 focus:outline-none focus:border-[#f97316]"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),M&&I.jsxDEV("div",{className:`p-3 rounded text-sm ${M.type==="success"?"bg-green-500/10 text-green-400 border border-green-500/30":"bg-red-500/10 text-red-400 border border-red-500/30"}`,children:M.text},void 0,!1,void 0,this),I.jsxDEV("button",{onClick:R,disabled:F||!B||!G||!W,className:"px-4 py-2 bg-[#f97316] hover:bg-[#fb923c] disabled:opacity-50 disabled:cursor-not-allowed text-black rounded text-sm font-medium transition",children:F?"Updating...":"Update Password"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function rI(){let{authFetch:Y}=A1(),[H,B]=L1.useState(!1),[K,G]=L1.useState(null),[_,W]=L1.useState(null),{confirm:O,ConfirmDialog:F}=a5(),b=async()=>{try{let R=await(await Y("/api/telemetry/stats")).json();W(R.stats?.total_events||0)}catch{W(null)}};L1.useEffect(()=>{b()},[]);let M=async()=>{if(!await O("Are you sure you want to delete all telemetry data? This cannot be undone.",{confirmText:"Clear All",title:"Clear Telemetry Data"}))return;B(!0),G(null);try{let R=await Y("/api/telemetry/clear",{method:"POST"}),k=await R.json();if(R.ok)G({type:"success",text:`Cleared ${k.deleted||0} telemetry events.`}),W(0);else G({type:"error",text:k.error||"Failed to clear telemetry"})}catch{G({type:"error",text:"Failed to clear telemetry"})}B(!1)};return I.jsxDEV(I.Fragment,{children:[F,I.jsxDEV("div",{className:"max-w-4xl w-full",children:[I.jsxDEV("div",{className:"mb-6",children:[I.jsxDEV("h1",{className:"text-2xl font-semibold mb-1",children:"Data Management"},void 0,!1,void 0,this),I.jsxDEV("p",{className:"text-[#666]",children:"Manage stored data and telemetry."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),I.jsxDEV("div",{className:"bg-[#111] border border-[#1a1a1a] rounded-lg p-4",children:[I.jsxDEV("h3",{className:"font-medium mb-2",children:"Telemetry Data"},void 0,!1,void 0,this),I.jsxDEV("p",{className:"text-sm text-[#666] mb-4",children:_!==null?`${_.toLocaleString()} events stored`:"Loading..."},void 0,!1,void 0,this),K&&I.jsxDEV("div",{className:`mb-4 p-3 rounded text-sm ${K.type==="success"?"bg-green-500/10 text-green-400 border border-green-500/30":"bg-red-500/10 text-red-400 border border-red-500/30"}`,children:K.text},void 0,!1,void 0,this),I.jsxDEV("button",{onClick:M,disabled:H||_===0,className:"px-4 py-2 bg-red-500/20 text-red-400 hover:bg-red-500/30 disabled:opacity-50 disabled:cursor-not-allowed rounded text-sm font-medium transition",children:H?"Clearing...":"Clear All Telemetry"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}var i4=H0(H1(),1),tI=[{key:"memory",icon:k2,label:"Memory"},{key:"tasks",icon:j6,label:"Tasks"},{key:"files",icon:Dz,label:"Files"},{key:"vision",icon:C2,label:"Vision"},{key:"operator",icon:v2,label:"Operator"},{key:"mcp",icon:l6,label:"MCP"},{key:"realtime",icon:S2,label:"Realtime"},{key:"agents",icon:mz,label:"Multi-Agent"}];function PJ({agent:Y,selected:H,onSelect:B,onToggle:K,showProject:G}){let _=tI.filter((R)=>Y.features?.[R.key]),W=Y.mcpServerDetails||[],O=Y.skillDetails||[],{isActive:F,type:b}=P2(Y.id),{projects:M}=G4(),A=Y.projectId?M.find((R)=>R.id===Y.projectId):null;return i4.jsxDEV("div",{onClick:B,className:`bg-[#111] rounded p-5 border transition cursor-pointer flex flex-col h-full ${H?"border-[#f97316]":"border-[#1a1a1a] hover:border-[#333]"}`,children:[i4.jsxDEV("div",{className:"flex items-start justify-between mb-3",children:[i4.jsxDEV("div",{children:[i4.jsxDEV("h3",{className:"font-semibold text-lg",children:Y.name},void 0,!1,void 0,this),i4.jsxDEV("p",{className:"text-sm text-[#666]",children:[Y.provider," / ",Y.model,Y.port&&i4.jsxDEV("span",{className:"text-[#444]",children:[" · :",Y.port]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),G&&A&&i4.jsxDEV("p",{className:"text-sm text-[#666] flex items-center gap-1.5 mt-1",children:[i4.jsxDEV("span",{className:"w-2 h-2 rounded-full",style:{backgroundColor:A.color}},void 0,!1,void 0,this),A.name]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),i4.jsxDEV(sI,{status:Y.status,isActive:F&&Y.status==="running",activityType:b},void 0,!1,void 0,this)]},void 0,!0,void 0,this),_.length>0&&i4.jsxDEV("div",{className:"flex flex-wrap gap-1.5 mb-3",children:_.map(({key:R,icon:k,label:S})=>i4.jsxDEV("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded bg-[#f97316]/10 text-[#f97316]/70 text-xs",title:S,children:[i4.jsxDEV(k,{className:"w-3 h-3"},void 0,!1,void 0,this),S]},R,!0,void 0,this))},void 0,!1,void 0,this),W.length>0&&i4.jsxDEV("div",{className:"flex flex-wrap gap-1.5 mb-3",children:W.map((R)=>{let k=R.type==="http"&&R.url||R.status==="running";return i4.jsxDEV("span",{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded text-xs ${k?"bg-green-500/10 text-green-400":"bg-[#222] text-[#666]"}`,title:`MCP: ${R.name} (${k?"available":R.status})`,children:[i4.jsxDEV(l6,{className:"w-3 h-3"},void 0,!1,void 0,this),R.name]},R.id,!0,void 0,this)})},void 0,!1,void 0,this),O.length>0&&i4.jsxDEV("div",{className:"flex flex-wrap gap-1.5 mb-3",children:O.map((R)=>i4.jsxDEV("span",{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded text-xs ${R.enabled?"bg-purple-500/10 text-purple-400":"bg-[#222] text-[#666]"}`,title:`Skill: ${R.name} v${R.version}`,children:[i4.jsxDEV(uX,{className:"w-3 h-3"},void 0,!1,void 0,this),R.name]},R.id,!0,void 0,this))},void 0,!1,void 0,this),i4.jsxDEV("p",{className:"text-sm text-[#666] line-clamp-2 mb-4 flex-1",children:Y.systemPrompt},void 0,!1,void 0,this),i4.jsxDEV("button",{onClick:K,className:`w-full px-3 py-1.5 rounded text-sm font-medium transition mt-auto ${Y.status==="running"?"bg-[#f97316]/20 text-[#f97316] hover:bg-[#f97316]/30":"bg-[#3b82f6]/20 text-[#3b82f6] hover:bg-[#3b82f6]/30"}`,children:Y.status==="running"?"Stop":"Start"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function sI({status:Y,isActive:H,activityType:B}){if(Y==="running"&&H&&B)return i4.jsxDEV("span",{className:"px-2 py-1 rounded text-xs font-medium bg-green-500/20 text-green-400 animate-pulse",children:B},void 0,!1,void 0,this);return i4.jsxDEV("span",{className:`px-2 py-1 rounded text-xs font-medium ${Y==="running"?"bg-[#3b82f6]/20 text-[#3b82f6]":"bg-[#333] text-[#666]"}`,children:Y},void 0,!1,void 0,this)}var iX=H0(D1(),1);var W1=H0(H1(),1),eI=[{key:"memory",label:"Memory",description:"Persistent recall",icon:k2},{key:"tasks",label:"Tasks",description:"Schedule and execute tasks",icon:j6},{key:"files",label:"Files",description:"File storage and management",icon:Dz},{key:"vision",label:"Vision",description:"Process images and PDFs",icon:C2},{key:"operator",label:"Operator",description:"Browser automation",icon:v2},{key:"mcp",label:"MCP",description:"External tools/services",icon:l6},{key:"realtime",label:"Realtime",description:"Voice conversations",icon:S2},{key:"agents",label:"Multi-Agent",description:"Communicate with peer agents",icon:mz}];function AJ({form:Y,providers:H,configuredProviders:B,onFormChange:K,onProviderChange:G,onCreate:_,onClose:W,onGoToSettings:O}){let{projects:F,currentProjectId:b}=G4(),M=H.find((D)=>D.id===Y.provider),[A,R]=iX.default.useState([]),[k,S]=iX.default.useState(!1);iX.default.useEffect(()=>{if(Y.provider==="ollama")S(!0),fetch("/api/providers/ollama/models").then((D)=>D.json()).then((D)=>{if(D.models&&D.models.length>0){if(R(D.models.map((n)=>({value:n.value,label:n.label||n.value}))),!Y.model&&D.models.length>0)K({...Y,model:D.models[0].value})}}).catch(()=>R([])).finally(()=>S(!1))},[Y.provider]);let V=B.filter((D)=>D.type==="llm").map((D)=>({value:D.id,label:D.name})),x=Y.provider==="ollama"&&A.length>0?A:M?.models.map((D)=>({value:D.value,label:D.label,recommended:D.recommended}))||[],f=F.map((D)=>({value:D.id,label:D.name}));iX.default.useEffect(()=>{if(Y.projectId===void 0&&b&&b!=="unassigned")K({...Y,projectId:b})},[b]);let l=(D)=>{if(D==="agents")if(typeof Y.features.agents==="boolean"?Y.features.agents:Y.features.agents?.enabled??!1)K({...Y,features:{...Y.features,agents:!1}});else K({...Y,features:{...Y.features,agents:{enabled:!0,mode:"worker",group:Y.projectId||void 0}}});else K({...Y,features:{...Y.features,[D]:!Y.features[D]}})},T=()=>{let D=Y.features.agents;if(typeof D==="boolean")return D;return D?.enabled??!1},m=()=>{return F2(Y.features,Y.projectId).mode||"worker"},E=(D)=>{let n=F2(Y.features,Y.projectId);K({...Y,features:{...Y.features,agents:{...n,enabled:!0,mode:D}}})};return W1.jsxDEV(yz,{children:[W1.jsxDEV("h2",{className:"text-xl font-semibold mb-4",children:"Create New Agent"},void 0,!1,void 0,this),V.length===0?W1.jsxDEV(zT,{onGoToSettings:O},void 0,!1,void 0,this):W1.jsxDEV(W1.Fragment,{children:[W1.jsxDEV("div",{className:"space-y-4",children:[W1.jsxDEV(u8,{label:"Name",children:W1.jsxDEV("input",{type:"text",value:Y.name,onChange:(D)=>K({...Y,name:D.target.value}),className:"w-full bg-[#0a0a0a] border border-[#222] rounded px-3 py-2 focus:outline-none focus:border-[#f97316] text-[#e0e0e0]",placeholder:"My Agent"},void 0,!1,void 0,this)},void 0,!1,void 0,this),F.length>0&&W1.jsxDEV(u8,{label:"Project",children:W1.jsxDEV(t4,{value:Y.projectId||"",options:f,onChange:(D)=>K({...Y,projectId:D||null}),placeholder:"Select project..."},void 0,!1,void 0,this)},void 0,!1,void 0,this),W1.jsxDEV(u8,{label:"Provider",children:W1.jsxDEV(t4,{value:Y.provider,options:V,onChange:G,placeholder:"Select provider..."},void 0,!1,void 0,this)},void 0,!1,void 0,this),W1.jsxDEV(u8,{label:"Model",children:k?W1.jsxDEV("div",{className:"text-sm text-[#666] py-2",children:"Loading Ollama models..."},void 0,!1,void 0,this):Y.provider==="ollama"&&x.length===0?W1.jsxDEV("div",{className:"text-sm text-yellow-400/80 py-2",children:["No models found. Run ",W1.jsxDEV("code",{className:"bg-[#1a1a1a] px-1 rounded",children:"ollama pull llama3.3"},void 0,!1,void 0,this)," to download a model."]},void 0,!0,void 0,this):W1.jsxDEV(t4,{value:Y.model,options:x,onChange:(D)=>K({...Y,model:D}),placeholder:"Select model..."},void 0,!1,void 0,this)},void 0,!1,void 0,this),W1.jsxDEV(u8,{label:"System Prompt",children:W1.jsxDEV("textarea",{value:Y.systemPrompt,onChange:(D)=>K({...Y,systemPrompt:D.target.value}),className:"w-full bg-[#0a0a0a] border border-[#222] rounded px-3 py-2 h-24 resize-none focus:outline-none focus:border-[#f97316] text-[#e0e0e0]"},void 0,!1,void 0,this)},void 0,!1,void 0,this),W1.jsxDEV(u8,{label:"Features",children:W1.jsxDEV("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:eI.map(({key:D,label:n,description:c,icon:j})=>{let g=D==="agents"?T():!!Y.features[D];return W1.jsxDEV("button",{type:"button",onClick:()=>l(D),className:`flex items-center gap-3 p-3 rounded border text-left transition ${g?"border-[#f97316] bg-[#f97316]/10":"border-[#222] hover:border-[#333]"}`,children:[W1.jsxDEV(j,{className:`w-5 h-5 flex-shrink-0 ${g?"text-[#f97316]":"text-[#666]"}`},void 0,!1,void 0,this),W1.jsxDEV("div",{className:"flex-1 min-w-0",children:[W1.jsxDEV("div",{className:`text-sm font-medium ${g?"text-[#f97316]":""}`,children:n},void 0,!1,void 0,this),W1.jsxDEV("div",{className:"text-xs text-[#666]",children:c},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},D,!0,void 0,this)})},void 0,!1,void 0,this)},void 0,!1,void 0,this),T()&&W1.jsxDEV(u8,{label:"Multi-Agent Mode",children:[W1.jsxDEV("div",{className:"flex gap-2",children:[W1.jsxDEV("button",{type:"button",onClick:()=>E("coordinator"),className:`flex-1 p-3 rounded border text-left transition ${m()==="coordinator"?"border-[#f97316] bg-[#f97316]/10":"border-[#222] hover:border-[#333]"}`,children:[W1.jsxDEV("div",{className:`text-sm font-medium ${m()==="coordinator"?"text-[#f97316]":""}`,children:"Coordinator"},void 0,!1,void 0,this),W1.jsxDEV("div",{className:"text-xs text-[#666]",children:"Orchestrates and delegates"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),W1.jsxDEV("button",{type:"button",onClick:()=>E("worker"),className:`flex-1 p-3 rounded border text-left transition ${m()==="worker"?"border-[#f97316] bg-[#f97316]/10":"border-[#222] hover:border-[#333]"}`,children:[W1.jsxDEV("div",{className:`text-sm font-medium ${m()==="worker"?"text-[#f97316]":""}`,children:"Worker"},void 0,!1,void 0,this),W1.jsxDEV("div",{className:"text-xs text-[#666]",children:"Receives delegated tasks"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),Y.projectId&&W1.jsxDEV("p",{className:"text-xs text-[#555] mt-2",children:"Group: Using project as agent group"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Y.provider==="anthropic"&&W1.jsxDEV(u8,{label:"Agent Built-in Tools",children:[W1.jsxDEV("div",{className:"flex flex-wrap gap-2",children:[W1.jsxDEV("button",{type:"button",onClick:()=>K({...Y,features:{...Y.features,builtinTools:{...Y.features.builtinTools,webSearch:!Y.features.builtinTools?.webSearch}}}),className:`flex items-center gap-2 px-3 py-2 rounded border transition ${Y.features.builtinTools?.webSearch?"border-[#f97316] bg-[#f97316]/10 text-[#f97316]":"border-[#222] hover:border-[#333] text-[#888]"}`,children:[W1.jsxDEV("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:W1.jsxDEV("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"},void 0,!1,void 0,this)},void 0,!1,void 0,this),W1.jsxDEV("span",{className:"text-sm",children:"Web Search"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),W1.jsxDEV("button",{type:"button",onClick:()=>K({...Y,features:{...Y.features,builtinTools:{...Y.features.builtinTools,webFetch:!Y.features.builtinTools?.webFetch}}}),className:`flex items-center gap-2 px-3 py-2 rounded border transition ${Y.features.builtinTools?.webFetch?"border-[#f97316] bg-[#f97316]/10 text-[#f97316]":"border-[#222] hover:border-[#333] text-[#888]"}`,children:[W1.jsxDEV("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:W1.jsxDEV("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9"},void 0,!1,void 0,this)},void 0,!1,void 0,this),W1.jsxDEV("span",{className:"text-sm",children:"Web Fetch"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),W1.jsxDEV("p",{className:"text-xs text-[#555] mt-2",children:"Provider-native tools for real-time web access"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),W1.jsxDEV("div",{className:"flex gap-3 mt-6",children:[W1.jsxDEV("button",{onClick:W,className:"flex-1 border border-[#333] hover:border-[#f97316] hover:text-[#f97316] px-4 py-2 rounded font-medium transition",children:"Cancel"},void 0,!1,void 0,this),W1.jsxDEV("button",{onClick:_,disabled:!Y.name,className:"flex-1 bg-[#f97316] hover:bg-[#fb923c] disabled:opacity-50 text-black px-4 py-2 rounded font-medium transition",children:"Create"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function u8({label:Y,children:H}){return W1.jsxDEV("div",{children:[W1.jsxDEV("label",{className:"block text-sm text-[#666] mb-1",children:Y},void 0,!1,void 0,this),H]},void 0,!0,void 0,this)}function zT({onGoToSettings:Y}){return W1.jsxDEV("div",{className:"text-center py-6",children:[W1.jsxDEV("p",{className:"text-[#666] mb-4",children:"No API keys configured. Add a provider key first."},void 0,!1,void 0,this),W1.jsxDEV("button",{onClick:Y,className:"bg-[#f97316] hover:bg-[#fb923c] text-black px-4 py-2 rounded font-medium transition",children:"Go to Settings"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}var m1=H0(D1(),1);var h=H0(H1(),1),QT=[{key:"memory",label:"Memory",description:"Persistent recall",icon:k2},{key:"tasks",label:"Tasks",description:"Schedule and execute tasks",icon:j6},{key:"files",label:"Files",description:"File storage and management",icon:Dz},{key:"vision",label:"Vision",description:"Process images and PDFs",icon:C2},{key:"operator",label:"Operator",description:"Browser automation",icon:v2},{key:"mcp",label:"MCP",description:"External tools/services",icon:l6},{key:"realtime",label:"Realtime",description:"Voice conversations",icon:S2},{key:"agents",label:"Multi-Agent",description:"Communicate with peer agents",icon:mz}];function IJ({agent:Y,providers:H,onClose:B,onStartAgent:K,onUpdateAgent:G,onDeleteAgent:_}){let[W,O]=m1.useState("chat");return h.jsxDEV("div",{className:"w-full h-full flex flex-col overflow-hidden bg-[#0a0a0a] border-l border-[#1a1a1a]",children:[h.jsxDEV("div",{className:"border-b border-[#1a1a1a] flex items-center",children:[h.jsxDEV("div",{className:"flex-1 overflow-x-auto scrollbar-hide px-2 md:px-4",children:h.jsxDEV("div",{className:"flex gap-1",children:[h.jsxDEV(lz,{active:W==="chat",onClick:()=>O("chat"),children:"Chat"},void 0,!1,void 0,this),h.jsxDEV(lz,{active:W==="threads",onClick:()=>O("threads"),children:"Threads"},void 0,!1,void 0,this),h.jsxDEV(lz,{active:W==="tasks",onClick:()=>O("tasks"),children:"Tasks"},void 0,!1,void 0,this),h.jsxDEV(lz,{active:W==="memory",onClick:()=>O("memory"),children:"Memory"},void 0,!1,void 0,this),h.jsxDEV(lz,{active:W==="files",onClick:()=>O("files"),children:"Files"},void 0,!1,void 0,this),h.jsxDEV(lz,{active:W==="settings",onClick:()=>O("settings"),children:"Settings"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),h.jsxDEV("button",{onClick:B,className:"text-[#666] hover:text-[#e0e0e0] transition p-2 flex-shrink-0 mr-2",children:h.jsxDEV(L6,{},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),h.jsxDEV("div",{className:"flex-1 min-h-0 flex flex-col overflow-hidden",children:[W==="chat"&&h.jsxDEV(XT,{agent:Y,onStartAgent:K},void 0,!1,void 0,this),W==="threads"&&h.jsxDEV(ZT,{agent:Y},void 0,!1,void 0,this),W==="tasks"&&h.jsxDEV(JT,{agent:Y},void 0,!1,void 0,this),W==="memory"&&h.jsxDEV(YT,{agent:Y},void 0,!1,void 0,this),W==="files"&&h.jsxDEV($T,{agent:Y},void 0,!1,void 0,this),W==="settings"&&h.jsxDEV(HT,{agent:Y,providers:H,onUpdateAgent:G,onDeleteAgent:_},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function lz({active:Y,onClick:H,children:B}){return h.jsxDEV("button",{onClick:H,className:`px-4 py-3 text-sm font-medium border-b-2 transition ${Y?"border-[#f97316] text-[#e0e0e0]":"border-transparent text-[#666] hover:text-[#888]"}`,children:B},void 0,!1,void 0,this)}function XT({agent:Y,onStartAgent:H}){if(Y.status==="running"&&Y.port)return h.jsxDEV(LJ,{agentId:"default",apiUrl:`/api/agents/${Y.id}`,placeholder:"Message this agent...",context:Y.systemPrompt,variant:"terminal",headerTitle:Y.name},void 0,!1,void 0,this);return h.jsxDEV("div",{className:"flex-1 flex items-center justify-center text-[#666]",children:h.jsxDEV("div",{className:"text-center",children:[h.jsxDEV("p",{className:"text-lg mb-2",children:"Agent is not running"},void 0,!1,void 0,this),h.jsxDEV("button",{onClick:H,className:"bg-[#3b82f6]/20 text-[#3b82f6] hover:bg-[#3b82f6]/30 px-4 py-2 rounded font-medium transition",children:"Start Agent"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}function ZT({agent:Y}){let[H,B]=m1.useState([]),[K,G]=m1.useState(!0),[_,W]=m1.useState(null),[O,F]=m1.useState(null),[b,M]=m1.useState([]),[A,R]=m1.useState(!1),{confirm:k,ConfirmDialog:S}=a5();m1.useEffect(()=>{B([]),F(null),M([]),W(null),G(!0)},[Y.id]),m1.useEffect(()=>{if(Y.status!=="running"){G(!1);return}(async()=>{try{let l=await fetch(`/api/agents/${Y.id}/threads`);if(!l.ok)throw Error("Failed to fetch threads");let T=await l.json();B(T.threads||[]),W(null)}catch(l){W(l instanceof Error?l.message:"Failed to load threads")}finally{G(!1)}})()},[Y.id,Y.status]);let V=async(f)=>{F(f),R(!0);try{let l=await fetch(`/api/agents/${Y.id}/threads/${f}/messages`);if(!l.ok)throw Error("Failed to fetch messages");let T=await l.json();M(T.messages||[])}catch{M([])}finally{R(!1)}},x=async(f,l)=>{if(l.stopPropagation(),!await k("Delete this thread?",{confirmText:"Delete",title:"Delete Thread"}))return;try{if(await fetch(`/api/agents/${Y.id}/threads/${f}`,{method:"DELETE"}),B((m)=>m.filter((E)=>E.id!==f)),O===f)F(null),M([])}catch{}};if(Y.status!=="running")return h.jsxDEV("div",{className:"flex-1 flex items-center justify-center text-[#666]",children:h.jsxDEV("p",{children:"Start the agent to view threads"},void 0,!1,void 0,this)},void 0,!1,void 0,this);if(K)return h.jsxDEV("div",{className:"flex-1 flex items-center justify-center text-[#666]",children:h.jsxDEV("p",{children:"Loading threads..."},void 0,!1,void 0,this)},void 0,!1,void 0,this);if(_)return h.jsxDEV("div",{className:"flex-1 flex items-center justify-center text-red-400",children:h.jsxDEV("p",{children:_},void 0,!1,void 0,this)},void 0,!1,void 0,this);if(O){let f=H.find((l)=>l.id===O);return h.jsxDEV(h.Fragment,{children:[S,h.jsxDEV("div",{className:"flex-1 flex flex-col overflow-hidden",children:[h.jsxDEV("div",{className:"flex items-center gap-3 px-4 py-3 border-b border-[#1a1a1a]",children:[h.jsxDEV("button",{onClick:()=>{F(null),M([])},className:"text-[#666] hover:text-[#e0e0e0] transition text-lg",children:"←"},void 0,!1,void 0,this),h.jsxDEV("div",{className:"flex-1",children:[h.jsxDEV("p",{className:"text-sm font-medium",children:f?.title||`Thread ${O.slice(0,8)}`},void 0,!1,void 0,this),h.jsxDEV("p",{className:"text-xs text-[#666]",children:f&&new Date(f.updated_at||f.created_at).toLocaleString()},void 0,!1,void 0,this)]},void 0,!0,void 0,this),h.jsxDEV("button",{onClick:(l)=>x(O,l),className:"text-[#666] hover:text-red-400 text-sm px-2 py-1",children:"Delete"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),h.jsxDEV("div",{className:"flex-1 overflow-auto p-4",children:A?h.jsxDEV("p",{className:"text-[#666]",children:"Loading messages..."},void 0,!1,void 0,this):b.length===0?h.jsxDEV("p",{className:"text-[#666]",children:"No messages in this thread"},void 0,!1,void 0,this):h.jsxDEV("div",{className:"space-y-4",children:b.map((l,T)=>h.jsxDEV("div",{className:`${l.role==="user"?"text-right":""}`,children:h.jsxDEV("div",{className:`inline-block max-w-[80%] p-3 rounded ${l.role==="user"?"bg-[#f97316]/20 text-[#f97316]":"bg-[#1a1a1a] text-[#e0e0e0]"}`,children:[h.jsxDEV("div",{className:"text-sm whitespace-pre-wrap",children:typeof l.content==="string"?l.content:Array.isArray(l.content)?l.content.map((m,E)=>h.jsxDEV("div",{children:[m.type==="text"&&m.text,m.type==="tool_use"&&h.jsxDEV("div",{className:"bg-[#222] p-2 rounded mt-1 text-xs text-[#888]",children:["\uD83D\uDD27 Tool: ",m.name]},void 0,!0,void 0,this),m.type==="tool_result"&&h.jsxDEV("div",{className:"bg-[#222] p-2 rounded mt-1 text-xs text-[#888]",children:["\uD83D\uDCCB Result: ",typeof m.content==="string"?m.content.slice(0,200):"..."]},void 0,!0,void 0,this)]},E,!0,void 0,this)):JSON.stringify(l.content)},void 0,!1,void 0,this),h.jsxDEV("p",{className:"text-xs text-[#666] mt-1",children:new Date(l.created_at).toLocaleTimeString()},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},T,!1,void 0,this))},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}return h.jsxDEV(h.Fragment,{children:[S,h.jsxDEV("div",{className:"flex-1 overflow-auto",children:H.length===0?h.jsxDEV("div",{className:"flex items-center justify-center h-full text-[#666]",children:h.jsxDEV("p",{children:"No conversation threads yet"},void 0,!1,void 0,this)},void 0,!1,void 0,this):h.jsxDEV("div",{className:"divide-y divide-[#1a1a1a]",children:H.map((f)=>h.jsxDEV("div",{onClick:()=>V(f.id),className:"p-4 cursor-pointer hover:bg-[#111] transition flex items-center justify-between",children:[h.jsxDEV("div",{className:"flex-1 min-w-0",children:[h.jsxDEV("p",{className:"text-sm font-medium truncate",children:f.title||`Thread ${f.id.slice(0,8)}`},void 0,!1,void 0,this),h.jsxDEV("p",{className:"text-xs text-[#666] mt-1",children:[new Date(f.updated_at||f.created_at).toLocaleString(),f.message_count!==void 0&&` • ${f.message_count} messages`]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),h.jsxDEV("button",{onClick:(l)=>x(f.id,l),className:"text-[#666] hover:text-red-400 text-lg ml-4",children:"×"},void 0,!1,void 0,this)]},f.id,!0,void 0,this))},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function JT({agent:Y}){let[H,B]=m1.useState([]),[K,G]=m1.useState(!0),[_,W]=m1.useState(null),[O,F]=m1.useState("all"),{events:b}=b2({agent_id:Y.id,category:"task"});m1.useEffect(()=>{B([]),W(null),G(!0)},[Y.id]);let M=async()=>{if(Y.status!=="running"){G(!1);return}try{let R=await fetch(`/api/agents/${Y.id}/tasks?status=${O}`);if(!R.ok)throw Error("Failed to fetch tasks");let k=await R.json();B(k.tasks||[]),W(null)}catch(R){W(R instanceof Error?R.message:"Failed to load tasks")}finally{G(!1)}};m1.useEffect(()=>{G(!0),M()},[Y.id,Y.status,O,b.length]);let A=(R)=>{switch(R){case"pending":return"bg-yellow-500/20 text-yellow-400";case"running":return"bg-blue-500/20 text-blue-400";case"completed":return"bg-green-500/20 text-green-400";case"failed":return"bg-red-500/20 text-red-400";default:return"bg-[#222] text-[#666]"}};if(Y.status!=="running")return h.jsxDEV("div",{className:"flex-1 flex items-center justify-center text-[#666]",children:h.jsxDEV("p",{children:"Start the agent to view tasks"},void 0,!1,void 0,this)},void 0,!1,void 0,this);if(!Y.features?.tasks)return h.jsxDEV("div",{className:"flex-1 flex items-center justify-center text-[#666]",children:h.jsxDEV("div",{className:"text-center",children:[h.jsxDEV("p",{className:"mb-2",children:"Tasks feature is not enabled"},void 0,!1,void 0,this),h.jsxDEV("p",{className:"text-sm",children:"Enable it in Settings to schedule tasks"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this);if(K)return h.jsxDEV("div",{className:"flex-1 flex items-center justify-center text-[#666]",children:h.jsxDEV("p",{children:"Loading tasks..."},void 0,!1,void 0,this)},void 0,!1,void 0,this);if(_)return h.jsxDEV("div",{className:"flex-1 flex items-center justify-center text-red-400",children:h.jsxDEV("p",{children:_},void 0,!1,void 0,this)},void 0,!1,void 0,this);return h.jsxDEV("div",{className:"flex-1 overflow-auto p-4",children:[h.jsxDEV("div",{className:"flex gap-2 mb-4",children:["all","pending","running","completed"].map((R)=>h.jsxDEV("button",{onClick:()=>F(R),className:`px-3 py-1 text-xs rounded transition ${O===R?"bg-[#f97316] text-black":"bg-[#1a1a1a] text-[#666] hover:text-[#888]"}`,children:R.charAt(0).toUpperCase()+R.slice(1)},R,!1,void 0,this))},void 0,!1,void 0,this),H.length===0?h.jsxDEV("div",{className:"text-center py-10 text-[#666]",children:h.jsxDEV("p",{children:["No ",O==="all"?"":O+" ","tasks"]},void 0,!0,void 0,this)},void 0,!1,void 0,this):h.jsxDEV("div",{className:"space-y-3",children:H.map((R)=>h.jsxDEV("div",{className:"bg-[#111] border border-[#1a1a1a] rounded p-3",children:[h.jsxDEV("div",{className:"flex items-start justify-between",children:[h.jsxDEV("div",{className:"flex-1 min-w-0",children:[h.jsxDEV("p",{className:"text-sm font-medium text-[#e0e0e0]",children:R.name},void 0,!1,void 0,this),R.description&&h.jsxDEV("p",{className:"text-xs text-[#666] mt-1 line-clamp-2",children:R.description},void 0,!1,void 0,this)]},void 0,!0,void 0,this),h.jsxDEV("span",{className:`text-xs px-2 py-0.5 rounded ml-2 ${A(R.status)}`,children:R.status},void 0,!1,void 0,this)]},void 0,!0,void 0,this),h.jsxDEV("div",{className:"flex items-center gap-4 mt-2 text-xs text-[#666]",children:[h.jsxDEV("span",{children:["Created: ",new Date(R.created_at).toLocaleString()]},void 0,!0,void 0,this),R.scheduled_at&&h.jsxDEV("span",{children:["Scheduled: ",new Date(R.scheduled_at).toLocaleString()]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),R.status==="completed"&&R.result&&h.jsxDEV("div",{className:"mt-2 p-2 bg-[#0a0a0a] rounded text-xs text-[#888]",children:[h.jsxDEV("p",{className:"text-[#666] mb-1",children:"Result:"},void 0,!1,void 0,this),h.jsxDEV("p",{className:"whitespace-pre-wrap",children:R.result},void 0,!1,void 0,this)]},void 0,!0,void 0,this),R.status==="failed"&&R.error&&h.jsxDEV("div",{className:"mt-2 p-2 bg-red-500/10 rounded text-xs text-red-400",children:[h.jsxDEV("p",{className:"text-red-400/70 mb-1",children:"Error:"},void 0,!1,void 0,this),h.jsxDEV("p",{className:"whitespace-pre-wrap",children:R.error},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},R.id,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function YT({agent:Y}){let[H,B]=m1.useState([]),[K,G]=m1.useState(!0),[_,W]=m1.useState(null),[O,F]=m1.useState(!1),{confirm:b,ConfirmDialog:M}=a5();m1.useEffect(()=>{B([]),W(null),G(!0)},[Y.id]);let A=async()=>{if(Y.status!=="running"){G(!1);return}try{let S=await fetch(`/api/agents/${Y.id}/memories`);if(!S.ok)throw Error("Failed to fetch memories");let V=await S.json();B(V.memories||[]),F(V.enabled??!1),W(null)}catch(S){W(S instanceof Error?S.message:"Failed to load memories")}finally{G(!1)}};m1.useEffect(()=>{A()},[Y.id,Y.status]);let R=async(S)=>{try{await fetch(`/api/agents/${Y.id}/memories/${S}`,{method:"DELETE"}),B((V)=>V.filter((x)=>x.id!==S))}catch{}},k=async()=>{if(!await b("Clear all memories?",{confirmText:"Clear",title:"Clear Memories"}))return;try{await fetch(`/api/agents/${Y.id}/memories`,{method:"DELETE"}),B([])}catch{}};if(!Y.features?.memory)return h.jsxDEV("div",{className:"flex-1 flex items-center justify-center text-[#666]",children:h.jsxDEV("div",{className:"text-center",children:[h.jsxDEV("p",{className:"mb-2",children:"Memory feature is not enabled"},void 0,!1,void 0,this),h.jsxDEV("p",{className:"text-sm",children:"Enable it in Settings to persist knowledge"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this);if(Y.status!=="running")return h.jsxDEV("div",{className:"flex-1 flex items-center justify-center text-[#666]",children:h.jsxDEV("p",{children:"Start the agent to view memories"},void 0,!1,void 0,this)},void 0,!1,void 0,this);if(K)return h.jsxDEV("div",{className:"flex-1 flex items-center justify-center text-[#666]",children:h.jsxDEV("p",{children:"Loading memories..."},void 0,!1,void 0,this)},void 0,!1,void 0,this);if(_)return h.jsxDEV("div",{className:"flex-1 flex items-center justify-center text-red-400",children:h.jsxDEV("p",{children:_},void 0,!1,void 0,this)},void 0,!1,void 0,this);if(!O)return h.jsxDEV("div",{className:"flex-1 flex items-center justify-center text-[#666]",children:h.jsxDEV("div",{className:"text-center",children:[h.jsxDEV("p",{className:"mb-2",children:"Memory system not initialized"},void 0,!1,void 0,this),h.jsxDEV("p",{className:"text-sm",children:"Check OPENAI_API_KEY for embeddings"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this);return h.jsxDEV(h.Fragment,{children:[M,h.jsxDEV("div",{className:"flex-1 overflow-auto p-4",children:[h.jsxDEV("div",{className:"flex items-center justify-between mb-4",children:[h.jsxDEV("h3",{className:"text-sm font-medium text-[#888]",children:["Stored Memories (",H.length,")"]},void 0,!0,void 0,this),H.length>0&&h.jsxDEV("button",{onClick:k,className:"text-xs text-red-400 hover:text-red-300",children:"Clear All"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),H.length===0?h.jsxDEV("div",{className:"text-center py-10 text-[#666]",children:[h.jsxDEV("p",{children:"No memories stored yet"},void 0,!1,void 0,this),h.jsxDEV("p",{className:"text-sm mt-1",children:"The agent will remember important information from conversations"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):h.jsxDEV("div",{className:"space-y-3",children:H.map((S)=>h.jsxDEV("div",{className:"bg-[#111] border border-[#1a1a1a] rounded p-3",children:[h.jsxDEV("div",{className:"flex items-start justify-between gap-2",children:[h.jsxDEV("p",{className:"text-sm text-[#e0e0e0] flex-1",children:S.content},void 0,!1,void 0,this),h.jsxDEV("button",{onClick:()=>R(S.id),className:"text-[#666] hover:text-red-400 text-sm flex-shrink-0",children:"×"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),h.jsxDEV("div",{className:"flex items-center gap-3 mt-2",children:[h.jsxDEV("span",{className:`text-xs px-2 py-0.5 rounded ${S.type==="preference"?"bg-purple-500/20 text-purple-400":S.type==="fact"?"bg-green-500/20 text-green-400":"bg-blue-500/20 text-blue-400"}`,children:S.type},void 0,!1,void 0,this),h.jsxDEV("span",{className:"text-xs text-[#666]",children:new Date(S.created_at).toLocaleString()},void 0,!1,void 0,this),S.importance&&h.jsxDEV("span",{className:"text-xs text-[#555]",children:["importance: ",S.importance.toFixed(1)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},S.id,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function $T({agent:Y}){let[H,B]=m1.useState([]),[K,G]=m1.useState(!0),[_,W]=m1.useState(null),[O,F]=m1.useState(!1),[b,M]=m1.useState(null),[A,R]=m1.useState(!1),k=m1.default.useRef(null),{confirm:S,ConfirmDialog:V}=a5();m1.useEffect(()=>{B([]),W(null),G(!0)},[Y.id]);let x=async()=>{if(Y.status!=="running"){G(!1);return}try{let g=await fetch(`/api/agents/${Y.id}/files`);if(!g.ok)throw Error("Failed to fetch files");let Q0=await g.json();B(Q0.files||[]),W(null)}catch(g){W(g instanceof Error?g.message:"Failed to load files")}finally{G(!1)}};m1.useEffect(()=>{x()},[Y.id,Y.status]);let f=async(g)=>{if(!await S("Delete this file?",{confirmText:"Delete",title:"Delete File"}))return;try{await fetch(`/api/agents/${Y.id}/files/${g}`,{method:"DELETE"}),B((r)=>r.filter((U0)=>U0.id!==g))}catch{}},l=(g,Q0)=>{let r=document.createElement("a");r.href=`/api/agents/${Y.id}/files/${g}/download`,r.download=Q0,r.click()},T=(g)=>{if(g<1024)return`${g} B`;if(g<1048576)return`${(g/1024).toFixed(1)} KB`;return`${(g/1048576).toFixed(1)} MB`},m=async(g)=>{F(!0),M(null);try{let Q0=new FormData;Q0.append("file",g);let r=await fetch(`/api/agents/${Y.id}/files`,{method:"POST",body:Q0});if(!r.ok){let U0=await r.json();throw Error(U0.error||"Upload failed")}await x()}catch(Q0){M(Q0 instanceof Error?Q0.message:"Upload failed")}finally{F(!1)}},E=(g)=>{let Q0=g.target.files?.[0];if(Q0)m(Q0);g.target.value=""},D=(g)=>{g.preventDefault(),R(!1);let Q0=g.dataTransfer.files?.[0];if(Q0)m(Q0)},n=(g)=>{g.preventDefault(),R(!0)},c=(g)=>{g.preventDefault(),R(!1)},j=(g)=>{if(g.startsWith("image/"))return"\uD83D\uDDBC";if(g.includes("pdf"))return"\uD83D\uDCD5";if(g.includes("json"))return"{}";if(g.includes("javascript")||g.includes("typescript"))return"⚡";if(g.startsWith("text/"))return"\uD83D\uDCC4";if(g.startsWith("audio/"))return"\uD83C\uDFB5";if(g.startsWith("video/"))return"\uD83C\uDFAC";return"\uD83D\uDCC1"};if(!Y.features?.files)return h.jsxDEV("div",{className:"flex-1 flex items-center justify-center text-[#666]",children:h.jsxDEV("div",{className:"text-center",children:[h.jsxDEV("p",{className:"mb-2",children:"Files feature is not enabled"},void 0,!1,void 0,this),h.jsxDEV("p",{className:"text-sm",children:"Enable it in Settings to manage files"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this);if(Y.status!=="running")return h.jsxDEV("div",{className:"flex-1 flex items-center justify-center text-[#666]",children:h.jsxDEV("p",{children:"Start the agent to view files"},void 0,!1,void 0,this)},void 0,!1,void 0,this);if(K)return h.jsxDEV("div",{className:"flex-1 flex items-center justify-center text-[#666]",children:h.jsxDEV("p",{children:"Loading files..."},void 0,!1,void 0,this)},void 0,!1,void 0,this);if(_)return h.jsxDEV("div",{className:"flex-1 flex items-center justify-center text-red-400",children:h.jsxDEV("p",{children:_},void 0,!1,void 0,this)},void 0,!1,void 0,this);return h.jsxDEV(h.Fragment,{children:[V,h.jsxDEV("div",{className:`flex-1 overflow-auto p-4 transition ${A?"bg-[#f97316]/5":""}`,onDrop:D,onDragOver:n,onDragLeave:c,children:[h.jsxDEV("input",{ref:k,type:"file",className:"hidden",onChange:E},void 0,!1,void 0,this),h.jsxDEV("div",{className:"flex items-center justify-between mb-4",children:[h.jsxDEV("h3",{className:"text-sm font-medium text-[#888]",children:["Agent Files (",H.length,")"]},void 0,!0,void 0,this),h.jsxDEV("div",{className:"flex items-center gap-2",children:[h.jsxDEV("button",{onClick:()=>k.current?.click(),disabled:O,className:"text-xs bg-[#f97316] hover:bg-[#fb923c] disabled:opacity-50 text-black px-3 py-1 rounded font-medium transition",children:O?"Uploading...":"Upload"},void 0,!1,void 0,this),h.jsxDEV("button",{onClick:x,className:"text-xs text-[#666] hover:text-[#888]",children:"Refresh"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),b&&h.jsxDEV("div",{className:"mb-4 text-sm bg-red-500/10 text-red-400 px-3 py-2 rounded",children:b},void 0,!1,void 0,this),A&&h.jsxDEV("div",{className:"mb-4 border-2 border-dashed border-[#f97316] rounded-lg p-8 text-center",children:h.jsxDEV("p",{className:"text-[#f97316]",children:"Drop file to upload"},void 0,!1,void 0,this)},void 0,!1,void 0,this),H.length===0&&!A&&h.jsxDEV("div",{className:"text-center py-10 text-[#666]",children:[h.jsxDEV("p",{children:"No files stored yet"},void 0,!1,void 0,this),h.jsxDEV("p",{className:"text-sm mt-1",children:"Drop files here, click Upload, or attach files in Chat"},void 0,!1,void 0,this),Y.features?.memory&&h.jsxDEV("p",{className:"text-xs mt-2 text-[#555]",children:"Files will be auto-ingested into memory"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),H.length>0&&h.jsxDEV("div",{className:"space-y-2",children:H.map((g)=>h.jsxDEV("div",{className:"bg-[#111] border border-[#1a1a1a] rounded p-3 flex items-center gap-3",children:[h.jsxDEV("div",{className:"w-10 h-10 bg-[#1a1a1a] rounded flex items-center justify-center text-[#666]",children:j(g.mime_type)},void 0,!1,void 0,this),h.jsxDEV("div",{className:"flex-1 min-w-0",children:[h.jsxDEV("p",{className:"text-sm text-[#e0e0e0] truncate",children:g.filename},void 0,!1,void 0,this),h.jsxDEV("p",{className:"text-xs text-[#666]",children:[T(g.size_bytes)," • ",new Date(g.created_at).toLocaleString(),g.source&&g.source!=="upload"&&` • ${g.source}`]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),h.jsxDEV("div",{className:"flex items-center gap-2",children:[h.jsxDEV("button",{onClick:()=>l(g.id,g.filename),className:"text-xs text-[#666] hover:text-[#f97316] px-2 py-1",children:"↓"},void 0,!1,void 0,this),h.jsxDEV("button",{onClick:()=>f(g.id),className:"text-[#666] hover:text-red-400 text-sm",children:"×"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},g.id,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function HT({agent:Y,providers:H,onUpdateAgent:B,onDeleteAgent:K}){let{authFetch:G,isDev:_}=A1(),[W,O]=m1.useState({name:Y.name,provider:Y.provider,model:Y.model,systemPrompt:Y.systemPrompt,features:{...Y.features,builtinTools:Y.features.builtinTools||{webSearch:!1,webFetch:!1}},mcpServers:[...Y.mcpServers||[]],skills:[...Y.skills||[]]}),[F,b]=m1.useState(!1),[M,A]=m1.useState(!1),[R,k]=m1.useState(null),[S,V]=m1.useState([]),[x,f]=m1.useState([]),[l,T]=m1.useState(null),[m,E]=m1.useState(!1);m1.useEffect(()=>{(async()=>{try{let B0=await(await G("/api/mcp/servers")).json();V(B0.servers||[])}catch(Y0){console.error("Failed to fetch MCP servers:",Y0)}})()},[G]),m1.useEffect(()=>{if(!_)return;(async()=>{try{let Y0=await G(`/api/agents/${Y.id}/api-key`);if(Y0.ok){let B0=await Y0.json();T(B0.apiKey)}}catch(Y0){}})()},[Y.id,_,G]),m1.useEffect(()=>{(async()=>{try{let B0=await(await G("/api/skills")).json();f(B0.skills||[])}catch(Y0){console.error("Failed to fetch skills:",Y0)}})()},[G]),m1.useEffect(()=>{O({name:Y.name,provider:Y.provider,model:Y.model,systemPrompt:Y.systemPrompt,features:{...Y.features,builtinTools:Y.features.builtinTools||{webSearch:!1,webFetch:!1}},mcpServers:[...Y.mcpServers||[]],skills:[...Y.skills||[]]}),k(null)},[Y.id]);let D=H.find((a)=>a.id===W.provider),n=H.filter((a)=>a.hasKey&&a.type==="llm").map((a)=>({value:a.id,label:a.name})),c=D?.models.map((a)=>({value:a.value,label:a.label,recommended:a.recommended}))||[],j=(a)=>{let Y0=H.find((G0)=>G0.id===a),B0=Y0?.models.find((G0)=>G0.recommended)?.value||Y0?.models[0]?.value||"";O((G0)=>({...G0,provider:a,model:B0}))},g=(a)=>{if(a==="agents"){let Y0=(B0)=>{return F2(B0.features,Y.projectId).enabled};O((B0)=>{if(typeof B0.features.agents==="boolean"?B0.features.agents:B0.features.agents?.enabled??!1)return{...B0,features:{...B0.features,agents:!1}};else return{...B0,features:{...B0.features,agents:{enabled:!0,mode:"worker",group:Y.projectId||void 0}}}})}else O((Y0)=>({...Y0,features:{...Y0.features,[a]:!Y0.features[a]}}))},Q0=(a)=>{O((Y0)=>{let B0=F2(Y0.features,Y.projectId);return{...Y0,features:{...Y0.features,agents:{...B0,enabled:!0,mode:a}}}})},r=()=>{let a=W.features.agents;if(typeof a==="boolean")return a;return a?.enabled??!1},U0=()=>{return F2(W.features,Y.projectId).mode||"worker"},R0=(a)=>{O((Y0)=>({...Y0,mcpServers:Y0.mcpServers.includes(a)?Y0.mcpServers.filter((B0)=>B0!==a):[...Y0.mcpServers,a]}))},_0=(a)=>{O((Y0)=>({...Y0,skills:Y0.skills.includes(a)?Y0.skills.filter((B0)=>B0!==a):[...Y0.skills,a]}))},f0=async()=>{b(!0),k(null);let a=await B(W);if(b(!1),a.error)k({type:"error",text:a.error});else k({type:"success",text:"Settings saved"}),setTimeout(()=>k(null),2000)},P0=W.name!==Y.name||W.provider!==Y.provider||W.model!==Y.model||W.systemPrompt!==Y.systemPrompt||JSON.stringify(W.features)!==JSON.stringify(Y.features)||JSON.stringify(W.mcpServers.sort())!==JSON.stringify((Y.mcpServers||[]).sort())||JSON.stringify(W.skills.sort())!==JSON.stringify((Y.skills||[]).sort());return h.jsxDEV("div",{className:"flex-1 overflow-auto p-4",children:h.jsxDEV("div",{className:"space-y-4",children:[h.jsxDEV(J8,{label:"Name",children:h.jsxDEV("input",{type:"text",value:W.name,onChange:(a)=>O((Y0)=>({...Y0,name:a.target.value})),className:"w-full bg-[#0a0a0a] border border-[#222] rounded px-3 py-2 focus:outline-none focus:border-[#f97316] text-[#e0e0e0]"},void 0,!1,void 0,this)},void 0,!1,void 0,this),h.jsxDEV(J8,{label:"Provider",children:h.jsxDEV(t4,{value:W.provider,options:n,onChange:j},void 0,!1,void 0,this)},void 0,!1,void 0,this),h.jsxDEV(J8,{label:"Model",children:h.jsxDEV(t4,{value:W.model,options:c,onChange:(a)=>O((Y0)=>({...Y0,model:a}))},void 0,!1,void 0,this)},void 0,!1,void 0,this),h.jsxDEV(J8,{label:"System Prompt",children:h.jsxDEV("textarea",{value:W.systemPrompt,onChange:(a)=>O((Y0)=>({...Y0,systemPrompt:a.target.value})),className:"w-full bg-[#0a0a0a] border border-[#222] rounded px-3 py-2 h-24 resize-none focus:outline-none focus:border-[#f97316] text-[#e0e0e0]"},void 0,!1,void 0,this)},void 0,!1,void 0,this),h.jsxDEV(J8,{label:"Features",children:h.jsxDEV("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:QT.map(({key:a,label:Y0,description:B0,icon:G0})=>{let h0=a==="agents"?r():!!W.features[a];return h.jsxDEV("button",{type:"button",onClick:()=>g(a),className:`flex items-center gap-3 p-3 rounded border text-left transition ${h0?"border-[#f97316] bg-[#f97316]/10":"border-[#222] hover:border-[#333]"}`,children:[h.jsxDEV(G0,{className:`w-5 h-5 flex-shrink-0 ${h0?"text-[#f97316]":"text-[#666]"}`},void 0,!1,void 0,this),h.jsxDEV("div",{className:"flex-1 min-w-0",children:[h.jsxDEV("div",{className:`text-sm font-medium ${h0?"text-[#f97316]":""}`,children:Y0},void 0,!1,void 0,this),h.jsxDEV("div",{className:"text-xs text-[#666]",children:B0},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},a,!0,void 0,this)})},void 0,!1,void 0,this)},void 0,!1,void 0,this),r()&&h.jsxDEV(J8,{label:"Multi-Agent Mode",children:[h.jsxDEV("div",{className:"flex gap-2",children:[h.jsxDEV("button",{type:"button",onClick:()=>Q0("coordinator"),className:`flex-1 p-3 rounded border text-left transition ${U0()==="coordinator"?"border-[#f97316] bg-[#f97316]/10":"border-[#222] hover:border-[#333]"}`,children:[h.jsxDEV("div",{className:`text-sm font-medium ${U0()==="coordinator"?"text-[#f97316]":""}`,children:"Coordinator"},void 0,!1,void 0,this),h.jsxDEV("div",{className:"text-xs text-[#666]",children:"Orchestrates and delegates to other agents"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),h.jsxDEV("button",{type:"button",onClick:()=>Q0("worker"),className:`flex-1 p-3 rounded border text-left transition ${U0()==="worker"?"border-[#f97316] bg-[#f97316]/10":"border-[#222] hover:border-[#333]"}`,children:[h.jsxDEV("div",{className:`text-sm font-medium ${U0()==="worker"?"text-[#f97316]":""}`,children:"Worker"},void 0,!1,void 0,this),h.jsxDEV("div",{className:"text-xs text-[#666]",children:"Receives tasks from coordinators"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),Y.projectId&&h.jsxDEV("p",{className:"text-xs text-[#555] mt-2",children:"Group: Using project as agent group"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),W.provider==="anthropic"&&h.jsxDEV(J8,{label:"Agent Built-in Tools",children:[h.jsxDEV("div",{className:"flex flex-wrap gap-2",children:[h.jsxDEV("button",{type:"button",onClick:()=>O((a)=>({...a,features:{...a.features,builtinTools:{...a.features.builtinTools,webSearch:!a.features.builtinTools?.webSearch}}})),className:`flex items-center gap-2 px-3 py-2 rounded border transition ${W.features.builtinTools?.webSearch?"border-[#f97316] bg-[#f97316]/10 text-[#f97316]":"border-[#222] hover:border-[#333] text-[#888]"}`,children:[h.jsxDEV("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsxDEV("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"},void 0,!1,void 0,this)},void 0,!1,void 0,this),h.jsxDEV("span",{className:"text-sm",children:"Web Search"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),h.jsxDEV("button",{type:"button",onClick:()=>O((a)=>({...a,features:{...a.features,builtinTools:{...a.features.builtinTools,webFetch:!a.features.builtinTools?.webFetch}}})),className:`flex items-center gap-2 px-3 py-2 rounded border transition ${W.features.builtinTools?.webFetch?"border-[#f97316] bg-[#f97316]/10 text-[#f97316]":"border-[#222] hover:border-[#333] text-[#888]"}`,children:[h.jsxDEV("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsxDEV("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9"},void 0,!1,void 0,this)},void 0,!1,void 0,this),h.jsxDEV("span",{className:"text-sm",children:"Web Fetch"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),h.jsxDEV("p",{className:"text-xs text-[#555] mt-2",children:"Provider-native tools for real-time web access"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),W.features.mcp&&h.jsxDEV(J8,{label:"MCP Servers",children:S.length===0?h.jsxDEV("p",{className:"text-sm text-[#666]",children:"No MCP servers configured. Add servers in the MCP page first."},void 0,!1,void 0,this):h.jsxDEV("div",{className:"space-y-2",children:[S.filter((a)=>a.project_id===null||a.project_id===Y.projectId).map((a)=>{let Y0=a.type==="http"&&a.url,B0=Y0||a.status==="running",G0=Y0?`${a.source||"remote"} • http`:`${a.type} • ${a.package||a.command||"custom"}${a.status==="running"&&a.port?` • :${a.port}`:""}`;return h.jsxDEV("button",{type:"button",onClick:()=>R0(a.id),className:`w-full flex items-center gap-3 p-3 rounded border text-left transition ${W.mcpServers.includes(a.id)?"border-[#f97316] bg-[#f97316]/10":"border-[#222] hover:border-[#333]"}`,children:[h.jsxDEV("div",{className:`w-2 h-2 rounded-full flex-shrink-0 ${B0?"bg-green-400":"bg-[#444]"}`},void 0,!1,void 0,this),h.jsxDEV("div",{className:"flex-1 min-w-0",children:[h.jsxDEV("div",{className:"flex items-center gap-2",children:[h.jsxDEV("span",{className:`text-sm font-medium ${W.mcpServers.includes(a.id)?"text-[#f97316]":""}`,children:a.name},void 0,!1,void 0,this),a.project_id===null&&h.jsxDEV("span",{className:"text-[10px] text-[#666] bg-[#1a1a1a] px-1.5 py-0.5 rounded",children:"Global"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),h.jsxDEV("div",{className:"text-xs text-[#666]",children:G0},void 0,!1,void 0,this)]},void 0,!0,void 0,this),h.jsxDEV("div",{className:`text-xs px-2 py-0.5 rounded ${B0?"bg-green-500/20 text-green-400":"bg-[#222] text-[#666]"}`,children:Y0?"remote":a.status},void 0,!1,void 0,this)]},a.id,!0,void 0,this)}),h.jsxDEV("p",{className:"text-xs text-[#666] mt-2",children:"Remote servers are always available. Local servers must be running."},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),h.jsxDEV(J8,{label:"Skills",children:x.length===0?h.jsxDEV("p",{className:"text-sm text-[#666]",children:"No skills configured. Add skills in the Skills page first."},void 0,!1,void 0,this):h.jsxDEV("div",{className:"space-y-2",children:[x.filter((a)=>a.enabled&&(a.project_id===null||a.project_id===Y.projectId)).map((a)=>h.jsxDEV("button",{type:"button",onClick:()=>_0(a.id),className:`w-full flex items-center gap-3 p-3 rounded border text-left transition ${W.skills.includes(a.id)?"border-[#f97316] bg-[#f97316]/10":"border-[#222] hover:border-[#333]"}`,children:[h.jsxDEV("div",{className:"flex-1 min-w-0",children:[h.jsxDEV("div",{className:"flex items-center gap-2",children:[h.jsxDEV("span",{className:`text-sm font-medium ${W.skills.includes(a.id)?"text-[#f97316]":""}`,children:a.name},void 0,!1,void 0,this),a.project_id===null&&h.jsxDEV("span",{className:"text-[10px] text-[#666] bg-[#1a1a1a] px-1.5 py-0.5 rounded",children:"Global"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),h.jsxDEV("div",{className:"text-xs text-[#666]",children:a.description},void 0,!1,void 0,this)]},void 0,!0,void 0,this),h.jsxDEV("div",{className:"text-xs px-2 py-0.5 rounded bg-[#222] text-[#666]",children:["v",a.version]},void 0,!0,void 0,this)]},a.id,!0,void 0,this)),h.jsxDEV("p",{className:"text-xs text-[#666] mt-2",children:"Skills provide reusable instructions for the agent."},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),R&&h.jsxDEV("div",{className:`text-sm px-3 py-2 rounded ${R.type==="success"?"bg-green-500/10 text-green-400":"bg-red-500/10 text-red-400"}`,children:R.text},void 0,!1,void 0,this),h.jsxDEV("button",{onClick:f0,disabled:!P0||F||!W.name,className:"w-full bg-[#f97316] hover:bg-[#fb923c] disabled:opacity-50 disabled:cursor-not-allowed text-black px-4 py-2 rounded font-medium transition",children:F?"Saving...":"Save Changes"},void 0,!1,void 0,this),Y.status==="running"&&P0&&h.jsxDEV("p",{className:"text-xs text-[#666] text-center",children:"Changes will be applied to the running agent"},void 0,!1,void 0,this),_&&l&&h.jsxDEV("div",{className:"mt-8 pt-6 border-t border-[#222]",children:[h.jsxDEV("p",{className:"text-sm text-[#666] mb-3",children:"Developer Info"},void 0,!1,void 0,this),h.jsxDEV("div",{className:"space-y-2",children:[h.jsxDEV("div",{className:"flex items-center justify-between",children:[h.jsxDEV("span",{className:"text-xs text-[#666]",children:"Agent ID"},void 0,!1,void 0,this),h.jsxDEV("code",{className:"text-xs bg-[#1a1a1a] px-2 py-1 rounded text-[#888]",children:Y.id},void 0,!1,void 0,this)]},void 0,!0,void 0,this),h.jsxDEV("div",{className:"flex items-center justify-between",children:[h.jsxDEV("span",{className:"text-xs text-[#666]",children:"Port"},void 0,!1,void 0,this),h.jsxDEV("code",{className:"text-xs bg-[#1a1a1a] px-2 py-1 rounded text-[#888]",children:Y.port||"N/A"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),h.jsxDEV("div",{className:"flex flex-col gap-1",children:[h.jsxDEV("div",{className:"flex items-center justify-between",children:[h.jsxDEV("span",{className:"text-xs text-[#666]",children:"API Key"},void 0,!1,void 0,this),h.jsxDEV("button",{onClick:()=>E(!m),className:"text-xs text-[#f97316] hover:text-[#fb923c]",children:m?"Hide":"Show"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),m&&h.jsxDEV("code",{className:"text-xs bg-[#1a1a1a] px-2 py-1 rounded text-[#888] break-all",children:l},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Y.status==="running"&&Y.port&&h.jsxDEV("div",{className:"flex flex-col gap-1 mt-2",children:[h.jsxDEV("span",{className:"text-xs text-[#666]",children:"Test with curl"},void 0,!1,void 0,this),h.jsxDEV("code",{className:"text-xs bg-[#1a1a1a] px-2 py-1.5 rounded text-[#666] break-all",children:['curl -H "X-API-Key: ',m?l:"***",'" http://localhost:',Y.port,"/config"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),h.jsxDEV("div",{className:"mt-8 pt-6 border-t border-[#222]",children:[h.jsxDEV("p",{className:"text-sm text-[#666] mb-3",children:"Danger Zone"},void 0,!1,void 0,this),M?h.jsxDEV("div",{className:"flex gap-2",children:[h.jsxDEV("button",{onClick:()=>A(!1),className:"flex-1 border border-[#333] hover:border-[#444] px-4 py-2 rounded font-medium transition",children:"Cancel"},void 0,!1,void 0,this),h.jsxDEV("button",{onClick:K,className:"flex-1 bg-red-500/20 text-red-400 hover:bg-red-500/30 px-4 py-2 rounded font-medium transition",children:"Confirm Delete"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):h.jsxDEV("button",{onClick:()=>A(!0),className:"w-full border border-red-500/30 text-red-400/70 hover:border-red-500/50 hover:text-red-400 px-4 py-2 rounded font-medium transition",children:"Delete Agent"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}function J8({label:Y,children:H}){return h.jsxDEV("div",{children:[h.jsxDEV("label",{className:"block text-sm text-[#666] mb-1",children:Y},void 0,!1,void 0,this),H]},void 0,!0,void 0,this)}var IO=H0(D1(),1);var S4=H0(H1(),1);function TJ({agents:Y,loading:H,selectedAgent:B,providers:K,onSelectAgent:G,onCloseAgent:_,onToggleAgent:W,onDeleteAgent:O,onUpdateAgent:F,onNewAgent:b,canCreateAgent:M=!0}){let{currentProjectId:A,currentProject:R}=G4(),k=IO.useMemo(()=>{if(A===null)return Y;if(A==="unassigned")return Y.filter((V)=>!V.projectId);return Y.filter((V)=>V.projectId===A)},[Y,A]),S=A===null?"Agents":A==="unassigned"?"Unassigned Agents":R?.name||"Agents";return S4.jsxDEV("div",{className:"flex-1 flex overflow-hidden relative",children:[S4.jsxDEV("div",{className:"flex-1 overflow-auto p-6",children:[S4.jsxDEV("div",{className:"flex items-center justify-between mb-6",children:[S4.jsxDEV("div",{className:"flex items-center gap-3",children:[R&&S4.jsxDEV("span",{className:"w-3 h-3 rounded-full",style:{backgroundColor:R.color}},void 0,!1,void 0,this),S4.jsxDEV("h1",{className:"text-xl font-semibold",children:S},void 0,!1,void 0,this),A!==null&&S4.jsxDEV("span",{className:"text-sm text-[#666]",children:["(",k.length," agent",k.length!==1?"s":"",")"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),b&&S4.jsxDEV("button",{onClick:b,disabled:!M,className:"bg-[#f97316] hover:bg-[#fb923c] disabled:opacity-50 disabled:cursor-not-allowed text-black px-4 py-2 rounded font-medium transition",children:"+ New Agent"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),H?S4.jsxDEV(T2,{message:"Loading agents..."},void 0,!1,void 0,this):k.length===0?S4.jsxDEV(GT,{onNewAgent:b,canCreateAgent:M,hasProjectFilter:A!==null},void 0,!1,void 0,this):S4.jsxDEV("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-3 auto-rows-fr",children:k.map((V)=>S4.jsxDEV(PJ,{agent:V,selected:B?.id===V.id,onSelect:()=>G(V),onToggle:(x)=>W(V,x),showProject:A===null},V.id,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),B&&S4.jsxDEV("div",{className:"absolute inset-0 bg-black/40 backdrop-blur-[2px] z-10",onClick:_},void 0,!1,void 0,this),B&&S4.jsxDEV("div",{className:"absolute right-0 top-0 bottom-0 w-full sm:w-[500px] lg:w-[600px] xl:w-[700px] z-20",children:S4.jsxDEV(IJ,{agent:B,providers:K,onClose:_,onStartAgent:(V)=>W(B,V),onUpdateAgent:(V)=>F(B.id,V),onDeleteAgent:()=>O(B.id)},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function GT({onNewAgent:Y,canCreateAgent:H,hasProjectFilter:B}){return S4.jsxDEV("div",{className:"text-center py-20 text-[#666]",children:[B?S4.jsxDEV(S4.Fragment,{children:[S4.jsxDEV("p",{className:"text-lg",children:"No agents in this project"},void 0,!1,void 0,this),S4.jsxDEV("p",{className:"text-sm mt-1",children:"Create an agent or assign existing agents to this project"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):S4.jsxDEV(S4.Fragment,{children:[S4.jsxDEV("p",{className:"text-lg",children:"No agents yet"},void 0,!1,void 0,this),S4.jsxDEV("p",{className:"text-sm mt-1",children:"Create your first agent to get started"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Y&&S4.jsxDEV("button",{onClick:Y,disabled:!H,className:"mt-4 bg-[#f97316] hover:bg-[#fb923c] disabled:opacity-50 disabled:cursor-not-allowed text-black px-4 py-2 rounded font-medium transition",children:"+ New Agent"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}var r5=H0(D1(),1);var G1=H0(H1(),1);function CJ({agents:Y,loading:H,runningCount:B,configuredProviders:K,onNavigate:G,onSelectAgent:_}){let{authFetch:W}=A1(),{currentProjectId:O}=G4(),{events:F,statusChangeCounter:b}=f6(),[M,A]=r5.useState(null),[R,k]=r5.useState([]),[S,V]=r5.useState([]),x=r5.useMemo(()=>{if(!O)return Y;if(O==="unassigned")return Y.filter((c)=>!c.projectId);return Y.filter((c)=>c.projectId===O)},[Y,O]),f=r5.useMemo(()=>{return x.filter((c)=>c.status==="running").length},[x]),l=r5.useMemo(()=>{return new Set(x.map((c)=>c.id))},[x]),T=r5.useCallback(async()=>{try{let[c,j,g]=await Promise.all([W("/api/dashboard"),W("/api/tasks?status=all"),W("/api/telemetry/events?type=thread_activity&limit=20")]);if(c.ok){let Q0=await c.json();A(Q0)}if(j.ok){let Q0=await j.json();k((Q0.tasks||[]).slice(0,5))}if(g.ok){let Q0=await g.json();V(Q0.events||[])}}catch(c){console.error("Failed to fetch dashboard data:",c)}},[W]);r5.useEffect(()=>{T()},[T,b]);let m=r5.useMemo(()=>{if(!O)return R;return R.filter((c)=>l.has(c.agentId))},[R,O,l]),E=r5.useMemo(()=>{if(!O)return M?.tasks||{total:0,pending:0,running:0,completed:0};let c=m.length,j=m.filter((r)=>r.status==="pending").length,g=m.filter((r)=>r.status==="running").length,Q0=m.filter((r)=>r.status==="completed").length;return{total:c,pending:j,running:g,completed:Q0}},[M,O,m]),D=r5.useMemo(()=>{let c=F.filter((r)=>r.type==="thread_activity"),j=new Set(c.map((r)=>r.id)),g=[...c];for(let r of S)if(!j.has(r.id))g.push(r),j.add(r.id);let Q0=g;if(O)Q0=g.filter((r)=>l.has(r.agent_id));return Q0.sort((r,U0)=>new Date(U0.timestamp).getTime()-new Date(r.timestamp).getTime()),Q0.slice(0,8)},[F,S,O,l]),n=r5.useMemo(()=>{let c=new Map;for(let j of Y)c.set(j.id,j.name);return c},[Y]);return G1.jsxDEV("div",{className:"flex-1 overflow-auto p-6",children:[G1.jsxDEV("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-4 mb-6",children:[G1.jsxDEV(kJ,{label:"Agents",value:x.length,subValue:`${f} running`},void 0,!1,void 0,this),G1.jsxDEV(kJ,{label:"Tasks",value:E.total,subValue:`${E.pending} pending`},void 0,!1,void 0,this),G1.jsxDEV(kJ,{label:"Completed",value:E.completed,color:"text-green-400"},void 0,!1,void 0,this),G1.jsxDEV(kJ,{label:"Providers",value:K.length,color:"text-[#f97316]"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),G1.jsxDEV("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[G1.jsxDEV(KG,{title:"Agents",actionLabel:"View All",onAction:()=>G("agents"),children:H?G1.jsxDEV("div",{className:"p-4 text-center text-[#666]",children:"Loading..."},void 0,!1,void 0,this):x.length===0?G1.jsxDEV("div",{className:"p-4 text-center text-[#666]",children:"No agents yet"},void 0,!1,void 0,this):G1.jsxDEV("div",{className:"divide-y divide-[#1a1a1a]",children:x.slice(0,5).map((c)=>G1.jsxDEV(qT,{agent:c,onSelect:()=>_(c),showProject:!O},c.id,!1,void 0,this))},void 0,!1,void 0,this)},void 0,!1,void 0,this),G1.jsxDEV(KG,{title:"Activity",actionLabel:"Telemetry",onAction:()=>G("telemetry"),children:D.length===0?G1.jsxDEV("div",{className:"p-4 text-center text-[#666]",children:[G1.jsxDEV("p",{children:"No activity yet"},void 0,!1,void 0,this),G1.jsxDEV("p",{className:"text-sm text-[#444] mt-1",children:"Agent activity will appear here in real-time"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):G1.jsxDEV("div",{className:"divide-y divide-[#1a1a1a]",children:D.map((c)=>G1.jsxDEV(UT,{activity:c.data?.activity||"Working...",agentName:n.get(c.agent_id)||c.agent_id,timestamp:c.timestamp},c.id,!1,void 0,this))},void 0,!1,void 0,this)},void 0,!1,void 0,this),G1.jsxDEV(KG,{title:"Recent Tasks",actionLabel:"View All",onAction:()=>G("tasks"),children:m.length===0?G1.jsxDEV("div",{className:"p-4 text-center text-[#666]",children:[G1.jsxDEV("p",{children:"No tasks yet"},void 0,!1,void 0,this),G1.jsxDEV("p",{className:"text-sm text-[#444] mt-1",children:"Tasks will appear when agents create them"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):G1.jsxDEV("div",{className:"divide-y divide-[#1a1a1a]",children:m.map((c)=>G1.jsxDEV("div",{className:"px-4 py-3 flex items-center justify-between",children:[G1.jsxDEV("div",{className:"flex-1 min-w-0",children:[G1.jsxDEV("p",{className:"font-medium truncate",children:c.title},void 0,!1,void 0,this),G1.jsxDEV("p",{className:"text-sm text-[#666]",children:[c.agentName,c.recurrence&&G1.jsxDEV("span",{className:"ml-1 text-[#555]",children:["· ",KT(c.recurrence)]},void 0,!0,void 0,this),c.next_run&&G1.jsxDEV("span",{className:"ml-1 text-[#f97316]",children:["· ",TO(c.next_run)]},void 0,!0,void 0,this),!c.next_run&&c.execute_at&&G1.jsxDEV("span",{className:"ml-1 text-[#f97316]",children:["· ",TO(c.execute_at)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),G1.jsxDEV(WT,{status:c.status},void 0,!1,void 0,this)]},`${c.agentId}-${c.id}`,!0,void 0,this))},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function kJ({label:Y,value:H,subValue:B,color:K}){return G1.jsxDEV("div",{className:"bg-[#111] rounded p-4 border border-[#1a1a1a]",children:[G1.jsxDEV("p",{className:"text-sm text-[#666] mb-1",children:Y},void 0,!1,void 0,this),G1.jsxDEV("p",{className:`text-2xl font-semibold ${K||""}`,children:H},void 0,!1,void 0,this),B&&G1.jsxDEV("p",{className:"text-xs text-[#555] mt-1",children:B},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function KG({title:Y,actionLabel:H,onAction:B,children:K}){return G1.jsxDEV("div",{className:"bg-[#111] rounded border border-[#1a1a1a] overflow-hidden",children:[G1.jsxDEV("div",{className:"px-4 py-3 border-b border-[#1a1a1a] flex items-center justify-between",children:[G1.jsxDEV("h3",{className:"font-semibold",children:Y},void 0,!1,void 0,this),G1.jsxDEV("button",{onClick:B,className:"text-sm text-[#3b82f6] hover:text-[#60a5fa]",children:H},void 0,!1,void 0,this)]},void 0,!0,void 0,this),K]},void 0,!0,void 0,this)}function qT({agent:Y,onSelect:H,showProject:B}){let{isActive:K}=P2(Y.id),{projects:G}=G4(),_=Y.projectId?G.find((W)=>W.id===Y.projectId):null;return G1.jsxDEV("div",{onClick:H,className:"px-4 py-3 hover:bg-[#1a1a1a] cursor-pointer flex items-center justify-between",children:[G1.jsxDEV("div",{className:"flex-1 min-w-0",children:[G1.jsxDEV("p",{className:"font-medium",children:Y.name},void 0,!1,void 0,this),G1.jsxDEV("div",{className:"flex items-center gap-2 text-sm text-[#666]",children:[G1.jsxDEV("span",{children:Y.provider},void 0,!1,void 0,this),B&&_&&G1.jsxDEV(G1.Fragment,{children:[G1.jsxDEV("span",{className:"text-[#444]",children:"·"},void 0,!1,void 0,this),G1.jsxDEV("span",{className:"flex items-center gap-1",children:[G1.jsxDEV("span",{className:"w-2 h-2 rounded-full",style:{backgroundColor:_.color}},void 0,!1,void 0,this),_.name]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),G1.jsxDEV("span",{className:`w-2 h-2 rounded-full flex-shrink-0 ${Y.status==="running"?K?"bg-green-400 animate-pulse":"bg-[#3b82f6]":"bg-[#444]"}`},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function BT(Y){let H=Math.floor((Date.now()-new Date(Y).getTime())/1000);if(H<5)return"just now";if(H<60)return`${H}s ago`;let B=Math.floor(H/60);if(B<60)return`${B}m ago`;let K=Math.floor(B/60);if(K<24)return`${K}h ago`;return`${Math.floor(K/24)}d ago`}function UT({activity:Y,agentName:H,timestamp:B}){return G1.jsxDEV("div",{className:"px-4 py-3",children:[G1.jsxDEV("p",{className:"text-sm truncate",children:Y},void 0,!1,void 0,this),G1.jsxDEV("div",{className:"flex items-center gap-2 text-xs text-[#555] mt-1",children:[G1.jsxDEV("span",{className:"text-[#666]",children:H},void 0,!1,void 0,this),G1.jsxDEV("span",{className:"text-[#444]",children:"·"},void 0,!1,void 0,this),G1.jsxDEV("span",{children:BT(B)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function WT({status:Y}){let H={pending:"bg-yellow-500/20 text-yellow-400",running:"bg-blue-500/20 text-blue-400",completed:"bg-green-500/20 text-green-400",failed:"bg-red-500/20 text-red-400",cancelled:"bg-gray-500/20 text-gray-400"};return G1.jsxDEV("span",{className:`px-2 py-0.5 rounded text-xs font-medium ${H[Y]||H.pending}`,children:Y},void 0,!1,void 0,this)}var kO=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];function KT(Y){try{let H=Y.trim().split(/\s+/);if(H.length!==5)return Y;let[B,K,G,_,W]=H;if(B.startsWith("*/")&&K==="*"&&G==="*"&&_==="*"&&W==="*"){let F=parseInt(B.slice(2));return F===1?"Every min":`Every ${F}min`}if(B!=="*"&&!B.includes("/")&&K==="*"&&G==="*"&&_==="*"&&W==="*")return"Hourly";if(K.startsWith("*/")&&G==="*"&&_==="*"&&W==="*"){let F=parseInt(K.slice(2));return F===1?"Hourly":`Every ${F}h`}let O=(F,b)=>{let M=parseInt(F),A=parseInt(b);if(isNaN(M))return"";let R=M>=12?"PM":"AM";return`${M===0?12:M>12?M-12:M}:${A.toString().padStart(2,"0")} ${R}`};if(K!=="*"&&!K.includes("/")&&G==="*"&&_==="*"){let F=O(K,B);if(W==="*")return`Daily ${F}`;let b=W.split(",").map((M)=>kO[parseInt(M.trim())]||M);if(b.length===1)return`${b[0]} ${F}`;return`${b.join(" & ")} ${F}`}return Y}catch{return Y}}function TO(Y){let H=new Date(Y),B=new Date,K=H.getTime()-B.getTime(),G=K>0,_=Math.abs(K),W=Math.floor(_/60000),O=Math.floor(_/3600000),F=H.toLocaleTimeString([],{hour:"numeric",minute:"2-digit"}),b=H.toDateString()===B.toDateString(),M=new Date(B);M.setDate(M.getDate()+1);let A=H.toDateString()===M.toDateString();if(b){if(W<1)return"now";if(W<60)return G?`in ${W}m`:`${W}m ago`;return G?`in ${O}h`:`${O}h ago`}if(A)return`Tomorrow ${F}`;return`${kO[H.getDay()]} ${F}`}var R6=H0(D1(),1);var N1=H0(H1(),1);function vJ({agents:Y,loading:H}){let{currentProjectId:B}=G4(),[K,G]=R6.useState(null),_=R6.useMemo(()=>{if(B===null)return Y;if(B==="unassigned")return Y.filter((O)=>!O.projectId);return Y.filter((O)=>O.projectId===B)},[Y,B]),W=_.find((O)=>O.id===K)||null;return N1.jsxDEV("div",{className:"flex-1 flex flex-col overflow-hidden",children:[N1.jsxDEV("div",{className:"flex-[3] min-h-0 p-6 overflow-auto",children:N1.jsxDEV(OT,{agents:_,loading:H,selectedAgentId:K,onSelectAgent:G},void 0,!1,void 0,this)},void 0,!1,void 0,this),N1.jsxDEV("div",{className:"flex-[2] min-h-0 border-t border-[#1a1a1a] flex",children:[N1.jsxDEV(RT,{agent:W,onClose:()=>G(null)},void 0,!1,void 0,this),N1.jsxDEV(NT,{agents:_},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function OT({agents:Y,loading:H,selectedAgentId:B,onSelectAgent:K}){if(H)return N1.jsxDEV("div",{className:"flex items-center justify-center h-full text-[#666]",children:"Loading agents..."},void 0,!1,void 0,this);if(Y.length===0)return N1.jsxDEV("div",{className:"flex items-center justify-center h-full text-[#666]",children:N1.jsxDEV("div",{className:"text-center",children:[N1.jsxDEV("p",{className:"text-lg",children:"No agents found"},void 0,!1,void 0,this),N1.jsxDEV("p",{className:"text-sm text-[#444] mt-1",children:"Create and start agents to see them here"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this);let G=Y.filter((_)=>_.status==="running").length;return N1.jsxDEV("div",{className:"h-full flex flex-col",children:[N1.jsxDEV("div",{className:"mb-4 flex items-center justify-between",children:[N1.jsxDEV("h2",{className:"text-lg font-semibold",children:"Activity"},void 0,!1,void 0,this),N1.jsxDEV("span",{className:"text-sm text-[#666]",children:[G," of ",Y.length," running"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),N1.jsxDEV("div",{className:"flex-1 flex items-center justify-center",children:N1.jsxDEV("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 xl:grid-cols-6 gap-8",children:Y.map((_)=>N1.jsxDEV(_T,{agent:_,selected:B===_.id,onClick:()=>K(B===_.id?null:_.id)},_.id,!1,void 0,this))},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function _T({agent:Y,selected:H,onClick:B}){let{isActive:K,type:G}=P2(Y.id),_=Y.status==="running",W=H?"ring-2 ring-[#f97316] shadow-[0_0_12px_rgba(249,115,22,0.3)]":_&&K?"ring-2 ring-green-400":_?"ring-1 ring-[#3b82f6]/60":"ring-1 ring-[#333]",O=_?K?"bg-green-500/10":"bg-[#1a1a1a]":"bg-[#111]",F=_?"text-[#e0e0e0]":"text-[#555]";return N1.jsxDEV("button",{onClick:B,className:"flex flex-col items-center gap-2 group",children:[N1.jsxDEV("div",{className:`w-16 h-16 rounded-full ${O} ${W} flex items-center justify-center transition-all duration-300 group-hover:scale-110 relative`,children:[N1.jsxDEV("span",{className:`text-xl font-semibold ${F}`,children:Y.name.charAt(0).toUpperCase()},void 0,!1,void 0,this),K&&_&&N1.jsxDEV("div",{className:"absolute inset-0 rounded-full bg-green-400/20 animate-ping",style:{animationDuration:"1.5s"}},void 0,!1,void 0,this),_&&K&&N1.jsxDEV("div",{className:"absolute inset-0 rounded-full animate-pulse",style:{boxShadow:"0 0 12px 3px rgba(74, 222, 128, 0.4)"}},void 0,!1,void 0,this)]},void 0,!0,void 0,this),N1.jsxDEV("div",{className:"text-center max-w-[100px]",children:[N1.jsxDEV("p",{className:`text-xs font-medium truncate ${F}`,children:Y.name},void 0,!1,void 0,this),K&&G?N1.jsxDEV("p",{className:"text-[10px] text-green-400 truncate",children:G},void 0,!1,void 0,this):N1.jsxDEV("p",{className:`text-[10px] ${_?"text-[#3b82f6]":"text-[#444]"}`,children:_?"idle":"stopped"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}var LT={LLM:"bg-purple-500/20 text-purple-400",TOOL:"bg-blue-500/20 text-blue-400",CHAT:"bg-green-500/20 text-green-400",ERROR:"bg-red-500/20 text-red-400",SYSTEM:"bg-gray-500/20 text-gray-400",TASK:"bg-yellow-500/20 text-yellow-400",MEMORY:"bg-cyan-500/20 text-cyan-400",MCP:"bg-orange-500/20 text-orange-400"};function NT({agents:Y}){let{events:H}=f6(),B=R6.useRef(null),K=R6.useMemo(()=>new Set(Y.map((W)=>W.id)),[Y]),G=R6.useMemo(()=>{let W=new Map;return Y.forEach((O)=>W.set(O.id,O.name)),W},[Y]),_=R6.useMemo(()=>{return H.filter((W)=>K.has(W.agent_id)).slice(0,50)},[H,K]);return N1.jsxDEV("div",{className:"flex-1 flex flex-col overflow-hidden border-l border-[#1a1a1a]",children:[N1.jsxDEV("div",{className:"px-4 py-3 border-b border-[#1a1a1a] flex items-center justify-between shrink-0",children:[N1.jsxDEV("h3",{className:"font-semibold text-sm",children:"Live Activity"},void 0,!1,void 0,this),N1.jsxDEV("span",{className:"text-xs text-[#666]",children:[_.length," events"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),N1.jsxDEV("div",{ref:B,className:"flex-1 overflow-auto",children:_.length===0?N1.jsxDEV("div",{className:"p-4 text-center text-[#666] text-sm",children:"No activity yet. Events appear in real-time."},void 0,!1,void 0,this):N1.jsxDEV("div",{className:"divide-y divide-[#1a1a1a]",children:_.map((W)=>N1.jsxDEV("div",{className:"px-4 py-2 hover:bg-[#111] transition",style:{animation:"slideIn 0.3s ease-out"},children:[N1.jsxDEV("div",{className:"flex items-center gap-2",children:[N1.jsxDEV("span",{className:`px-1.5 py-0.5 rounded text-[10px] font-medium ${LT[W.category]||"bg-[#222] text-[#888]"}`,children:W.category},void 0,!1,void 0,this),N1.jsxDEV("span",{className:"text-xs font-medium truncate flex-1",children:W.type},void 0,!1,void 0,this),N1.jsxDEV("span",{className:"text-[10px] text-[#555] shrink-0",children:MT(W.timestamp)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),N1.jsxDEV("div",{className:"text-[10px] text-[#555] mt-0.5",children:[G.get(W.agent_id)||W.agent_id,W.duration_ms?` · ${W.duration_ms}ms`:""]},void 0,!0,void 0,this)]},W.id,!0,void 0,this))},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function RT({agent:Y,onClose:H}){let{authFetch:B}=A1(),[K,G]=R6.useState(""),[_,W]=R6.useState(!1),[O,F]=R6.useState(null);if(R6.useEffect(()=>{G(""),F(null)},[Y?.id]),!Y)return N1.jsxDEV("div",{className:"w-80 shrink-0 flex items-center justify-center text-[#555] text-sm p-4 text-center",children:"Click an agent to send a quick command"},void 0,!1,void 0,this);let b=async()=>{if(!K.trim()||_)return;if(Y.status!=="running"){F("Agent is not running"),setTimeout(()=>F(null),3000);return}W(!0);try{let A=await B(`/api/agents/${Y.id}/chat`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:K,agent_id:Y.id})});if(A.ok)F("Command sent"),G("");else{let R=await A.json().catch(()=>({}));F(R.error||"Failed to send")}}catch{F("Failed to send command")}finally{W(!1),setTimeout(()=>F(null),3000)}},M=Y.status==="running";return N1.jsxDEV("div",{className:"w-80 shrink-0 flex flex-col",children:[N1.jsxDEV("div",{className:"px-4 py-3 border-b border-[#1a1a1a] flex items-center justify-between shrink-0",children:[N1.jsxDEV("div",{className:"min-w-0",children:[N1.jsxDEV("h3",{className:"font-semibold text-sm truncate",children:Y.name},void 0,!1,void 0,this),N1.jsxDEV("p",{className:`text-[10px] ${M?"text-green-400":"text-[#666]"}`,children:M?"Running":"Stopped"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),N1.jsxDEV("button",{onClick:H,className:"text-[#666] hover:text-[#e0e0e0] transition shrink-0 ml-2",children:N1.jsxDEV(L6,{className:"w-4 h-4"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),N1.jsxDEV("div",{className:"flex-1 p-4 flex flex-col justify-end",children:[O&&N1.jsxDEV("div",{className:`mb-3 px-3 py-2 rounded text-xs ${O==="Command sent"?"bg-green-500/10 border border-green-500/20 text-green-400":"bg-red-500/10 border border-red-500/20 text-red-400"}`,children:O},void 0,!1,void 0,this),N1.jsxDEV("div",{className:"flex gap-2",children:[N1.jsxDEV("input",{type:"text",value:K,onChange:(A)=>G(A.target.value),onKeyDown:(A)=>A.key==="Enter"&&b(),placeholder:M?"Quick command...":"Agent not running",disabled:_||!M,className:"flex-1 bg-[#111] border border-[#1a1a1a] rounded px-3 py-2 text-sm focus:outline-none focus:border-[#f97316] placeholder-[#444] disabled:opacity-50"},void 0,!1,void 0,this),N1.jsxDEV("button",{onClick:b,disabled:_||!K.trim()||!M,className:"px-3 py-2 bg-[#f97316]/20 text-[#f97316] rounded text-sm font-medium hover:bg-[#f97316]/30 transition disabled:opacity-30",children:_?"...":"Send"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function MT(Y){let H=Math.floor((Date.now()-new Date(Y).getTime())/1000);if(H<5)return"just now";if(H<60)return`${H}s ago`;let B=Math.floor(H/60);if(B<60)return`${B}m ago`;let K=Math.floor(B/60);if(K<24)return`${K}h ago`;return`${Math.floor(K/24)}d ago`}var G6=H0(D1(),1);var M0=H0(H1(),1);function fJ({onSelectAgent:Y}){let{authFetch:H}=A1(),{currentProjectId:B}=G4(),[K,G]=G6.useState([]),[_,W]=G6.useState(!0),[O,F]=G6.useState("all"),[b,M]=G6.useState(null),[A,R]=G6.useState(!1),k=G6.useRef(null),{events:S}=b2({category:"TASK"}),V=G6.useCallback(async()=>{try{let T=`/api/tasks?status=${O}`;if(B!==null)T+=`&project_id=${encodeURIComponent(B)}`;let E=await(await H(T)).json();G(E.tasks||[])}catch(T){console.error("Failed to fetch tasks:",T)}finally{W(!1)}},[H,O,B]);G6.useEffect(()=>{V()},[V]),G6.useEffect(()=>{if(!S.length)return;let T=S[0];if(!T||T.id===k.current)return;let m=T.type;if(m==="task_created"||m==="task_updated"||m==="task_deleted")k.current=T.id,console.log("[TasksPage] Telemetry event:",m),V()},[S,V]);let x=G6.useCallback(async(T)=>{M(T),R(!0);try{let m=await H(`/api/tasks/${T.agentId}/${T.id}`);if(console.log("[TasksPage] Fetch task response status:",m.status),m.ok){let E=await m.json();if(console.log("[TasksPage] Task data:",E),console.log("[TasksPage] Has trajectory:",!!E.task?.trajectory,"Length:",E.task?.trajectory?.length),E.task)M({...E.task,agentId:T.agentId,agentName:T.agentName})}else console.error("[TasksPage] Failed to fetch task:",m.status,await m.text())}catch(m){console.error("Failed to fetch task details:",m)}finally{R(!1)}},[H]),f={pending:"bg-yellow-500/20 text-yellow-400",running:"bg-blue-500/20 text-blue-400",completed:"bg-green-500/20 text-green-400",failed:"bg-red-500/20 text-red-400",cancelled:"bg-gray-500/20 text-gray-400"};return M0.jsxDEV("div",{className:"flex-1 flex overflow-hidden",children:[M0.jsxDEV("div",{className:`flex-1 p-4 md:p-6 overflow-auto ${b?"hidden md:block md:w-1/2 lg:w-2/3":""}`,children:M0.jsxDEV("div",{className:"max-w-4xl",children:[M0.jsxDEV("div",{className:"mb-6",children:[M0.jsxDEV("div",{className:"mb-4",children:[M0.jsxDEV("h1",{className:"text-xl md:text-2xl font-semibold mb-1",children:"Tasks"},void 0,!1,void 0,this),M0.jsxDEV("p",{className:"text-sm text-[#666]",children:"View tasks from all running agents"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),M0.jsxDEV("div",{className:"flex gap-2 overflow-x-auto scrollbar-hide pb-1",children:[{value:"all",label:"All"},{value:"pending",label:"Pending"},{value:"running",label:"Running"},{value:"completed",label:"Completed"},{value:"failed",label:"Failed"}].map((T)=>M0.jsxDEV("button",{onClick:()=>F(T.value),className:`px-3 py-1.5 rounded text-sm transition whitespace-nowrap ${O===T.value?"bg-[#f97316] text-black":"bg-[#1a1a1a] hover:bg-[#222]"}`,children:T.label},T.value,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),_?M0.jsxDEV("div",{className:"text-center py-12 text-[#666]",children:"Loading tasks..."},void 0,!1,void 0,this):K.length===0?M0.jsxDEV("div",{className:"text-center py-12",children:[M0.jsxDEV(j6,{className:"w-12 h-12 mx-auto mb-4 text-[#333]"},void 0,!1,void 0,this),M0.jsxDEV("p",{className:"text-[#666]",children:"No tasks found"},void 0,!1,void 0,this),M0.jsxDEV("p",{className:"text-sm text-[#444] mt-1",children:"Tasks will appear here when agents create them"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):M0.jsxDEV("div",{className:"space-y-3",children:K.map((T)=>M0.jsxDEV("div",{onClick:()=>x(T),className:`bg-[#111] border rounded-lg p-4 cursor-pointer transition ${b?.id===T.id&&b?.agentId===T.agentId?"border-[#f97316]":"border-[#1a1a1a] hover:border-[#333]"}`,children:[M0.jsxDEV("div",{className:"flex items-start justify-between mb-2",children:[M0.jsxDEV("div",{className:"flex-1",children:[M0.jsxDEV("h3",{className:"font-medium",children:T.title},void 0,!1,void 0,this),M0.jsxDEV("p",{className:"text-sm text-[#666]",children:T.agentName},void 0,!1,void 0,this)]},void 0,!0,void 0,this),M0.jsxDEV("span",{className:`px-2 py-1 rounded text-xs font-medium ${f[T.status]||f.pending}`,children:T.status},void 0,!1,void 0,this)]},void 0,!0,void 0,this),T.description&&M0.jsxDEV("p",{className:"text-sm text-[#888] mb-2 line-clamp-2",children:T.description},void 0,!1,void 0,this),M0.jsxDEV("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1 text-xs text-[#555]",children:[M0.jsxDEV("span",{className:"flex items-center gap-1",children:[T.type==="recurring"?M0.jsxDEV(cK,{className:"w-3.5 h-3.5"},void 0,!1,void 0,this):T.execute_at?M0.jsxDEV(dK,{className:"w-3.5 h-3.5"},void 0,!1,void 0,this):M0.jsxDEV(iK,{className:"w-3.5 h-3.5"},void 0,!1,void 0,this),T.type==="recurring"&&T.recurrence?vO(T.recurrence):T.type]},void 0,!0,void 0,this),M0.jsxDEV("span",{children:["Priority: ",T.priority]},void 0,!0,void 0,this),T.next_run&&M0.jsxDEV("span",{className:"text-[#f97316]",children:SJ(T.next_run)},void 0,!1,void 0,this),!T.next_run&&T.execute_at&&M0.jsxDEV("span",{className:"text-[#f97316]",children:SJ(T.execute_at)},void 0,!1,void 0,this),M0.jsxDEV("span",{children:["Created: ",new Date(T.created_at).toLocaleDateString()]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},`${T.agentId}-${T.id}`,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),b&&M0.jsxDEV(wT,{task:b,statusColors:f,onClose:()=>M(null),onSelectAgent:Y,loading:A},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function wT({task:Y,statusColors:H,onClose:B,onSelectAgent:K,loading:G}){return M0.jsxDEV("div",{className:"w-full md:w-1/2 lg:w-1/3 border-l border-[#1a1a1a] bg-[#0a0a0a] flex flex-col overflow-hidden",children:[M0.jsxDEV("div",{className:"flex items-center justify-between p-4 border-b border-[#1a1a1a]",children:[M0.jsxDEV("h2",{className:"font-medium truncate pr-2",children:"Task Details"},void 0,!1,void 0,this),M0.jsxDEV("button",{onClick:B,className:"text-[#666] hover:text-[#e0e0e0] transition",children:M0.jsxDEV(L6,{},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),M0.jsxDEV("div",{className:"flex-1 overflow-auto p-4 space-y-4",children:[M0.jsxDEV("div",{children:[M0.jsxDEV("div",{className:"flex items-start justify-between gap-2 mb-2",children:[M0.jsxDEV("h3",{className:"text-lg font-medium",children:Y.title},void 0,!1,void 0,this),M0.jsxDEV("span",{className:`px-2 py-1 rounded text-xs font-medium flex-shrink-0 ${H[Y.status]}`,children:Y.status},void 0,!1,void 0,this)]},void 0,!0,void 0,this),M0.jsxDEV("button",{onClick:()=>K?.(Y.agentId),className:"text-sm text-[#f97316] hover:underline",children:Y.agentName},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Y.description&&M0.jsxDEV("div",{children:[M0.jsxDEV("h4",{className:"text-xs text-[#666] uppercase tracking-wider mb-1",children:"Description"},void 0,!1,void 0,this),M0.jsxDEV("p",{className:"text-sm text-[#888] whitespace-pre-wrap",children:Y.description},void 0,!1,void 0,this)]},void 0,!0,void 0,this),M0.jsxDEV("div",{className:"grid grid-cols-2 gap-3 text-sm",children:[M0.jsxDEV("div",{children:[M0.jsxDEV("span",{className:"text-[#666]",children:"Type"},void 0,!1,void 0,this),M0.jsxDEV("p",{className:"capitalize",children:Y.type},void 0,!1,void 0,this)]},void 0,!0,void 0,this),M0.jsxDEV("div",{children:[M0.jsxDEV("span",{className:"text-[#666]",children:"Priority"},void 0,!1,void 0,this),M0.jsxDEV("p",{children:Y.priority},void 0,!1,void 0,this)]},void 0,!0,void 0,this),M0.jsxDEV("div",{children:[M0.jsxDEV("span",{className:"text-[#666]",children:"Source"},void 0,!1,void 0,this),M0.jsxDEV("p",{className:"capitalize",children:Y.source},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Y.recurrence&&M0.jsxDEV("div",{children:[M0.jsxDEV("span",{className:"text-[#666]",children:"Recurrence"},void 0,!1,void 0,this),M0.jsxDEV("p",{children:vO(Y.recurrence)},void 0,!1,void 0,this),M0.jsxDEV("p",{className:"text-xs text-[#444] mt-0.5 font-mono",children:Y.recurrence},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),M0.jsxDEV("div",{className:"space-y-2 text-sm",children:[M0.jsxDEV("div",{className:"flex justify-between",children:[M0.jsxDEV("span",{className:"text-[#666]",children:"Created"},void 0,!1,void 0,this),M0.jsxDEV("span",{children:new Date(Y.created_at).toLocaleString()},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Y.execute_at&&M0.jsxDEV("div",{className:"flex justify-between",children:[M0.jsxDEV("span",{className:"text-[#666]",children:"Scheduled"},void 0,!1,void 0,this),M0.jsxDEV("span",{className:"text-[#f97316]",children:SJ(Y.execute_at)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Y.executed_at&&M0.jsxDEV("div",{className:"flex justify-between",children:[M0.jsxDEV("span",{className:"text-[#666]",children:"Started"},void 0,!1,void 0,this),M0.jsxDEV("span",{children:new Date(Y.executed_at).toLocaleString()},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Y.completed_at&&M0.jsxDEV("div",{className:"flex justify-between",children:[M0.jsxDEV("span",{className:"text-[#666]",children:"Completed"},void 0,!1,void 0,this),M0.jsxDEV("span",{children:new Date(Y.completed_at).toLocaleString()},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Y.next_run&&M0.jsxDEV("div",{className:"flex justify-between",children:[M0.jsxDEV("span",{className:"text-[#666]",children:"Next Run"},void 0,!1,void 0,this),M0.jsxDEV("span",{className:"text-[#f97316]",children:SJ(Y.next_run)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),Y.status==="failed"&&Y.error&&M0.jsxDEV("div",{className:"min-w-0",children:[M0.jsxDEV("h4",{className:"text-xs text-red-400 uppercase tracking-wider mb-1",children:"Error"},void 0,!1,void 0,this),M0.jsxDEV("div",{className:"bg-red-500/10 border border-red-500/20 rounded p-3 overflow-x-auto",children:M0.jsxDEV("pre",{className:"text-sm text-red-400 whitespace-pre-wrap break-words",children:Y.error},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Y.status==="completed"&&Y.result&&M0.jsxDEV("div",{className:"min-w-0",children:[M0.jsxDEV("h4",{className:"text-xs text-green-400 uppercase tracking-wider mb-1",children:"Result"},void 0,!1,void 0,this),M0.jsxDEV("div",{className:"bg-green-500/10 border border-green-500/20 rounded p-3 overflow-x-auto",children:M0.jsxDEV("pre",{className:"text-sm text-green-400 whitespace-pre-wrap break-words",children:typeof Y.result==="string"?Y.result:JSON.stringify(Y.result,null,2)},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),G&&!Y.trajectory&&M0.jsxDEV("div",{children:[M0.jsxDEV("h4",{className:"text-xs text-[#666] uppercase tracking-wider mb-2",children:"Trajectory"},void 0,!1,void 0,this),M0.jsxDEV("div",{className:"text-sm text-[#555]",children:"Loading trajectory..."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Y.trajectory&&Y.trajectory.length>0&&M0.jsxDEV("div",{children:[M0.jsxDEV("h4",{className:"text-xs text-[#666] uppercase tracking-wider mb-2",children:["Trajectory (",Y.trajectory.length," steps)"]},void 0,!0,void 0,this),M0.jsxDEV(FT,{trajectory:Y.trajectory},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function FT({trajectory:Y}){let[H,B]=G6.useState(new Set),K=(W)=>{B((O)=>{let F=new Set(O);if(F.has(W))F.delete(W);else F.add(W);return F})},G={user:{bg:"bg-blue-500/10",text:"text-blue-400",icon:"\uD83D\uDC64",label:"User"},assistant:{bg:"bg-purple-500/10",text:"text-purple-400",icon:"\uD83E\uDD16",label:"Assistant"}},_=(W)=>{let O=W.content;if(typeof O==="string"){let F=O.length>200,b=H.has(W.id);return M0.jsxDEV("div",{children:[M0.jsxDEV("p",{className:`text-sm text-[#ccc] whitespace-pre-wrap break-words ${!b&&F?"line-clamp-4":""}`,children:O},void 0,!1,void 0,this),F&&M0.jsxDEV("button",{onClick:()=>K(W.id),className:"text-xs text-[#666] hover:text-[#888] mt-1",children:b?"Show less":"Show more..."},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}return M0.jsxDEV("div",{className:"space-y-2",children:O.map((F,b)=>{if(F.type==="tool_use"){let M=JSON.stringify(F.input,null,2),A=M.length>150,R=`${W.id}-${b}`,k=H.has(R);return M0.jsxDEV("div",{className:"bg-orange-500/10 border border-orange-500/20 rounded p-2",children:[M0.jsxDEV("div",{className:"flex items-center gap-2 mb-1",children:[M0.jsxDEV("span",{className:"text-orange-400",children:"\uD83D\uDD27"},void 0,!1,void 0,this),M0.jsxDEV("span",{className:"text-xs font-medium text-orange-400",children:"Tool Call"},void 0,!1,void 0,this),M0.jsxDEV("span",{className:"text-xs text-[#888]",children:F.name},void 0,!1,void 0,this)]},void 0,!0,void 0,this),M0.jsxDEV("pre",{className:`text-xs text-[#888] overflow-x-auto ${!k&&A?"line-clamp-3":""}`,children:M},void 0,!1,void 0,this),A&&M0.jsxDEV("button",{onClick:()=>K(R),className:"text-xs text-[#666] hover:text-[#888] mt-1",children:k?"Show less":"Show more..."},void 0,!1,void 0,this)]},b,!0,void 0,this)}if(F.type==="tool_result"){let M=F.is_error,A=`${W.id}-${b}`,R=H.has(A),k=F.content.length>150;return M0.jsxDEV("div",{className:`${M?"bg-red-500/10 border-red-500/20":"bg-teal-500/10 border-teal-500/20"} border rounded p-2`,children:[M0.jsxDEV("div",{className:"flex items-center gap-2 mb-1",children:[M0.jsxDEV("span",{children:M?"❌":"\uD83D\uDCCB"},void 0,!1,void 0,this),M0.jsxDEV("span",{className:`text-xs font-medium ${M?"text-red-400":"text-teal-400"}`,children:"Tool Result"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),M0.jsxDEV("pre",{className:`text-xs text-[#888] overflow-x-auto whitespace-pre-wrap break-words ${!R&&k?"line-clamp-3":""}`,children:F.content},void 0,!1,void 0,this),k&&M0.jsxDEV("button",{onClick:()=>K(A),className:"text-xs text-[#666] hover:text-[#888] mt-1",children:R?"Show less":"Show more..."},void 0,!1,void 0,this)]},b,!0,void 0,this)}return null})},void 0,!1,void 0,this)};return M0.jsxDEV("div",{className:"space-y-2",children:Y.map((W)=>{let O=G[W.role]||G.assistant;return M0.jsxDEV("div",{className:`${O.bg} border border-[#1a1a1a] rounded overflow-hidden p-3`,children:[M0.jsxDEV("div",{className:"flex items-center gap-2 mb-2",children:[M0.jsxDEV("span",{children:O.icon},void 0,!1,void 0,this),M0.jsxDEV("span",{className:`text-xs font-medium ${O.text}`,children:O.label},void 0,!1,void 0,this),W.model&&M0.jsxDEV("span",{className:"text-xs text-[#555]",children:["· ",W.model]},void 0,!0,void 0,this),M0.jsxDEV("span",{className:"text-xs text-[#555]",children:["· ",new Date(W.created_at).toLocaleTimeString()]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),_(W)]},W.id,!0,void 0,this)})},void 0,!1,void 0,this)}var CO=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];function vO(Y){try{let H=Y.trim().split(/\s+/);if(H.length!==5)return Y;let[B,K,G,_,W]=H;if(B.startsWith("*/")&&K==="*"&&G==="*"&&_==="*"&&W==="*"){let F=parseInt(B.slice(2));if(F===1)return"Every minute";return`Every ${F} minutes`}if(B!=="*"&&!B.includes("/")&&K==="*"&&G==="*"&&_==="*"&&W==="*")return"Every hour";if(K.startsWith("*/")&&G==="*"&&_==="*"&&W==="*"){let F=parseInt(K.slice(2));if(F===1)return"Every hour";return`Every ${F} hours`}let O=(F,b)=>{let M=parseInt(F),A=parseInt(b);if(isNaN(M))return"";let R=M>=12?"PM":"AM";return`${M===0?12:M>12?M-12:M}:${A.toString().padStart(2,"0")} ${R}`};if(K!=="*"&&!K.includes("/")&&G==="*"&&_==="*"){let F=O(K,B);if(W==="*")return`Daily at ${F}`;let b=W.split(",").map((M)=>{let A=parseInt(M.trim());return CO[A]||M});if(b.length===7)return`Daily at ${F}`;if(b.length===5&&!b.includes("Sat")&&!b.includes("Sun"))return`Weekdays at ${F}`;if(b.length===1)return`Weekly on ${b[0]} at ${F}`;return`${b.join(" & ")} at ${F}`}return Y}catch{return Y}}function SJ(Y){let H=new Date(Y),B=new Date,K=H.getTime()-B.getTime(),G=Math.abs(K),_=K>0,W=Math.floor(G/60000),O=Math.floor(G/3600000),F=Math.floor(G/86400000),b=H.toLocaleTimeString([],{hour:"numeric",minute:"2-digit"}),M=H.toDateString()===B.toDateString(),A=new Date(B);A.setDate(A.getDate()+1);let R=H.toDateString()===A.toDateString(),k=new Date(B);k.setDate(k.getDate()-1);let S=H.toDateString()===k.toDateString();if(M){if(W<1)return _?"now":"just now";if(W<60)return _?`in ${W} min (${b})`:`${W} min ago`;return _?`in ${O}h (${b})`:`${O}h ago`}if(R)return`Tomorrow at ${b}`;if(S)return`Yesterday at ${b}`;if(F<7)return`${CO[H.getDay()]} at ${b}`;return H.toLocaleDateString([],{month:"short",day:"numeric"})+` at ${b}`}var r0=H0(D1(),1);var e4=H0(D1(),1);var I0=H0(H1(),1);function OG(Y){return Y.authSchemes.some((H)=>H.toUpperCase()==="API_KEY")}function fO(Y){return Y.authSchemes.some((H)=>H.toUpperCase()==="OAUTH2")}function bT(Y){return OG(Y)&&fO(Y)}function _G({providerId:Y="composio",projectId:H,onConnectionComplete:B}){let{authFetch:K}=A1(),[G,_]=e4.useState([]),[W,O]=e4.useState([]),[F,b]=e4.useState(!0),[M,A]=e4.useState(""),[R,k]=e4.useState(null),[S,V]=e4.useState(null),[x,f]=e4.useState(null),[l,T]=e4.useState(null),[m,E]=e4.useState(null),[D,n]=e4.useState(""),[c,j]=e4.useState(null),[g,Q0]=e4.useState(""),[r,U0]=e4.useState(!1),[R0,_0]=e4.useState(null),[f0,P0]=e4.useState(null),a=e4.useCallback(async()=>{b(!0),f(null);let p=H&&H!=="unassigned"?`?project_id=${H}`:"";try{let[O0,V0]=await Promise.all([K(`/api/integrations/${Y}/apps${p}`),K(`/api/integrations/${Y}/connected${p}`)]),q1=await O0.json(),y1=await V0.json();_(q1.apps||[]),O(y1.accounts||[])}catch(O0){console.error("Failed to fetch integrations:",O0),f("Failed to load integrations")}b(!1)},[K,Y,H]);e4.useEffect(()=>{a()},[a]),e4.useEffect(()=>{if(new URLSearchParams(window.location.search).get("connected"))window.history.replaceState({},"",window.location.pathname),a(),B?.()},[a,B]),e4.useEffect(()=>{if(!S?.connectionId)return;let p=H&&H!=="unassigned"?`?project_id=${H}`:"",O0=setInterval(async()=>{try{let q1=await(await K(`/api/integrations/${Y}/connection/${S.connectionId}${p}`)).json();if(q1.connection?.status==="active")V(null),k(null),a(),B?.();else if(q1.connection?.status==="failed")V(null),k(null),f(`Connection to ${S.appSlug} failed`)}catch(V0){}},2000);return()=>clearInterval(O0)},[S,K,Y,H,a,B]);let Y0=async(p,O0,V0)=>{if(bT(p)&&!O0&&!V0){T({app:p});return}if(OG(p)&&!O0&&!V0){E({app:p}),n("");return}k(p.slug),f(null);try{let q1={appSlug:p.slug};if(O0)q1.credentials={authScheme:"API_KEY",apiKey:O0};let y1=H&&H!=="unassigned"?`?project_id=${H}`:"",M1=await K(`/api/integrations/${Y}/connect${y1}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(q1)}),A0=await M1.json();if(!M1.ok){f(A0.error||"Failed to initiate connection"),k(null),E(null);return}if(A0.status==="active"||!A0.redirectUrl){k(null),E(null),a(),B?.();return}if(A0.redirectUrl){V({appSlug:p.slug,connectionId:A0.connectionId});let Z1=window.open(A0.redirectUrl,`connect-${p.slug}`,"width=600,height=700,left=200,top=100");if(!Z1||Z1.closed)window.location.href=A0.redirectUrl}}catch(q1){f(`Failed to connect: ${q1}`),k(null),E(null)}},B0=(p)=>{if(p.preventDefault(),!m||!D.trim())return;Y0(m.app,D.trim())},G0=async(p)=>{let O0=H&&H!=="unassigned"?`?project_id=${H}`:"";try{let V0=await K(`/api/integrations/${Y}/connection/${p.id}${O0}`,{method:"DELETE"});if(V0.ok)a();else{let q1=await V0.json();f(q1.error||"Failed to disconnect")}}catch(V0){f(`Failed to disconnect: ${V0}`)}},h0=(p)=>{j({app:p}),Q0(`${p.name} MCP`),_0(null)},z0=async()=>{if(!c||!g.trim())return;U0(!0),f(null);try{let p=H&&H!=="unassigned"?`?project_id=${H}`:"",O0=await K(`/api/integrations/${Y}/configs${p}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:g.replace(/[^a-zA-Z0-9\s-]/g,"").substring(0,30),toolkitSlug:c.app.slug})}),V0=await O0.json();if(!O0.ok){f(V0.error||"Failed to create MCP config"),U0(!1);return}_0(g),B?.()}catch(p){f(`Failed to create MCP config: ${p}`)}finally{U0(!1)}},v0=(p)=>{P0({message:`Disconnect ${p.appName}?`,onConfirm:()=>{G0(p),P0(null)}})},j0=(p)=>{return W.some((O0)=>O0.appId===p&&O0.status==="active")},Y1=(p)=>{return W.find((O0)=>O0.appId===p)},m0=G.filter((p)=>{if(!M)return!0;let O0=M.toLowerCase();return p.name.toLowerCase().includes(O0)||p.slug.toLowerCase().includes(O0)||p.description?.toLowerCase().includes(O0)||p.categories.some((V0)=>V0.toLowerCase().includes(O0))}),F1=m0.filter((p)=>j0(p.slug)),R1=m0.filter((p)=>!j0(p.slug));if(F)return I0.jsxDEV("div",{className:"text-center py-8 text-[#666]",children:"Loading apps..."},void 0,!1,void 0,this);return I0.jsxDEV("div",{className:"space-y-6",children:[l&&I0.jsxDEV("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:I0.jsxDEV("div",{className:"bg-[#111] border border-[#333] rounded-lg p-6 w-full max-w-md mx-4",children:[I0.jsxDEV("div",{className:"flex items-center gap-3 mb-4",children:[l.app.logo&&I0.jsxDEV("img",{src:l.app.logo,alt:l.app.name,className:"w-10 h-10 object-contain"},void 0,!1,void 0,this),I0.jsxDEV("div",{children:[I0.jsxDEV("h3",{className:"font-medium",children:["Connect ",l.app.name]},void 0,!0,void 0,this),I0.jsxDEV("p",{className:"text-xs text-[#666]",children:"Choose how to authenticate"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),I0.jsxDEV("div",{className:"space-y-3",children:[I0.jsxDEV("button",{onClick:()=>{T(null),E({app:l.app}),n("")},className:"w-full text-left p-3 bg-[#0a0a0a] hover:bg-[#1a1a1a] border border-[#333] hover:border-[#f97316] rounded-lg transition",children:[I0.jsxDEV("div",{className:"font-medium text-sm",children:"API Key"},void 0,!1,void 0,this),I0.jsxDEV("div",{className:"text-xs text-[#666] mt-0.5",children:["Enter your ",l.app.name," API key directly"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),I0.jsxDEV("button",{onClick:()=>{T(null),Y0(l.app,void 0,!0)},className:"w-full text-left p-3 bg-[#0a0a0a] hover:bg-[#1a1a1a] border border-[#333] hover:border-[#f97316] rounded-lg transition",children:[I0.jsxDEV("div",{className:"font-medium text-sm",children:"OAuth"},void 0,!1,void 0,this),I0.jsxDEV("div",{className:"text-xs text-[#666] mt-0.5",children:["Sign in with your ",l.app.name," account"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),I0.jsxDEV("button",{onClick:()=>T(null),className:"w-full text-sm text-[#666] hover:text-white mt-4 py-2 transition",children:"Cancel"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),m&&I0.jsxDEV("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:I0.jsxDEV("div",{className:"bg-[#111] border border-[#333] rounded-lg p-6 w-full max-w-md mx-4",children:[I0.jsxDEV("div",{className:"flex items-center gap-3 mb-4",children:[m.app.logo&&I0.jsxDEV("img",{src:m.app.logo,alt:m.app.name,className:"w-10 h-10 object-contain"},void 0,!1,void 0,this),I0.jsxDEV("div",{children:[I0.jsxDEV("h3",{className:"font-medium",children:["Connect ",m.app.name]},void 0,!0,void 0,this),I0.jsxDEV("p",{className:"text-xs text-[#666]",children:"Enter your API key to connect"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),I0.jsxDEV("form",{onSubmit:B0,children:[I0.jsxDEV("input",{type:"password",value:D,onChange:(p)=>n(p.target.value),placeholder:"Enter API Key...",className:"w-full bg-[#0a0a0a] border border-[#333] rounded-lg px-4 py-2 mb-4 focus:outline-none focus:border-[#f97316]",autoFocus:!0},void 0,!1,void 0,this),I0.jsxDEV("div",{className:"flex gap-2",children:[I0.jsxDEV("button",{type:"button",onClick:()=>E(null),className:"flex-1 text-sm bg-[#1a1a1a] hover:bg-[#222] border border-[#333] px-4 py-2 rounded transition",children:"Cancel"},void 0,!1,void 0,this),I0.jsxDEV("button",{type:"submit",disabled:!D.trim()||R===m.app.slug,className:"flex-1 text-sm bg-[#f97316] hover:bg-[#ea580c] text-white px-4 py-2 rounded transition disabled:opacity-50",children:R===m.app.slug?"Connecting...":"Connect"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),c&&I0.jsxDEV("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:I0.jsxDEV("div",{className:"bg-[#111] border border-[#333] rounded-lg p-6 w-full max-w-md mx-4",children:R0?I0.jsxDEV(I0.Fragment,{children:[I0.jsxDEV("div",{className:"text-center mb-4",children:[I0.jsxDEV("div",{className:"w-12 h-12 bg-green-500/20 rounded-full flex items-center justify-center mx-auto mb-3",children:I0.jsxDEV("span",{className:"text-green-400 text-2xl",children:"✓"},void 0,!1,void 0,this)},void 0,!1,void 0,this),I0.jsxDEV("h3",{className:"font-medium text-lg",children:"MCP Config Created!"},void 0,!1,void 0,this),I0.jsxDEV("p",{className:"text-sm text-[#888] mt-2",children:['"',R0,'" has been created successfully.']},void 0,!0,void 0,this),I0.jsxDEV("p",{className:"text-xs text-[#666] mt-2",children:"You can now add it to your agents from the MCP Configs tab."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),I0.jsxDEV("button",{onClick:()=>{j(null),_0(null)},className:"w-full text-sm bg-[#f97316] hover:bg-[#ea580c] text-white px-4 py-2 rounded transition",children:"Done"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):I0.jsxDEV(I0.Fragment,{children:[I0.jsxDEV("div",{className:"flex items-center gap-3 mb-4",children:[c.app.logo&&I0.jsxDEV("img",{src:c.app.logo,alt:c.app.name,className:"w-10 h-10 object-contain"},void 0,!1,void 0,this),I0.jsxDEV("div",{children:[I0.jsxDEV("h3",{className:"font-medium",children:"Create MCP Config"},void 0,!1,void 0,this),I0.jsxDEV("p",{className:"text-xs text-[#666]",children:["Create an MCP config for ",c.app.name]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),I0.jsxDEV("form",{onSubmit:(p)=>{p.preventDefault(),z0()},children:[I0.jsxDEV("label",{className:"block text-xs text-[#888] mb-1",children:"Config Name"},void 0,!1,void 0,this),I0.jsxDEV("input",{type:"text",value:g,onChange:(p)=>Q0(p.target.value),placeholder:"Enter config name...",className:"w-full bg-[#0a0a0a] border border-[#333] rounded-lg px-4 py-2 mb-4 focus:outline-none focus:border-[#f97316]",autoFocus:!0,maxLength:30},void 0,!1,void 0,this),I0.jsxDEV("div",{className:"flex gap-2",children:[I0.jsxDEV("button",{type:"button",onClick:()=>j(null),className:"flex-1 text-sm bg-[#1a1a1a] hover:bg-[#222] border border-[#333] px-4 py-2 rounded transition",children:"Cancel"},void 0,!1,void 0,this),I0.jsxDEV("button",{type:"submit",disabled:!g.trim()||r,className:"flex-1 text-sm bg-[#f97316] hover:bg-[#ea580c] text-white px-4 py-2 rounded transition disabled:opacity-50",children:r?"Creating...":"Create Config"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),f0&&I0.jsxDEV("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:I0.jsxDEV("div",{className:"bg-[#111] border border-[#333] rounded-lg p-6 w-full max-w-sm mx-4",children:[I0.jsxDEV("p",{className:"text-center mb-4",children:f0.message},void 0,!1,void 0,this),I0.jsxDEV("div",{className:"flex gap-2",children:[I0.jsxDEV("button",{onClick:()=>P0(null),className:"flex-1 text-sm bg-[#1a1a1a] hover:bg-[#222] border border-[#333] px-4 py-2 rounded transition",children:"Cancel"},void 0,!1,void 0,this),I0.jsxDEV("button",{onClick:f0.onConfirm,className:"flex-1 text-sm bg-red-500 hover:bg-red-600 text-white px-4 py-2 rounded transition",children:"Confirm"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),x&&I0.jsxDEV("div",{className:"text-red-400 text-sm p-3 bg-red-500/10 border border-red-500/20 rounded-lg flex items-center justify-between",children:[I0.jsxDEV("span",{children:x},void 0,!1,void 0,this),I0.jsxDEV("button",{onClick:()=>f(null),className:"text-red-400 hover:text-red-300",children:"×"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),S&&I0.jsxDEV("div",{className:"text-yellow-400 text-sm p-3 bg-yellow-500/10 border border-yellow-500/20 rounded-lg flex items-center gap-2",children:[I0.jsxDEV("span",{className:"animate-spin",children:"⟳"},void 0,!1,void 0,this),I0.jsxDEV("span",{children:["Waiting for ",S.appSlug," authorization..."]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),I0.jsxDEV("div",{children:I0.jsxDEV("input",{type:"text",value:M,onChange:(p)=>A(p.target.value),placeholder:"Search apps...",className:"w-full bg-[#111] border border-[#333] rounded-lg px-4 py-2 focus:outline-none focus:border-[#f97316]"},void 0,!1,void 0,this)},void 0,!1,void 0,this),F1.length>0&&I0.jsxDEV("div",{children:[I0.jsxDEV("h3",{className:"text-sm font-medium text-[#888] mb-3",children:["Connected (",F1.length,")"]},void 0,!0,void 0,this),I0.jsxDEV("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:F1.map((p)=>I0.jsxDEV(SO,{app:p,connection:Y1(p.slug),onConnect:()=>Y0(p),onDisconnect:()=>{let O0=Y1(p.slug);if(O0)v0(O0)},onCreateMcpConfig:()=>h0(p),connecting:R===p.slug},p.id,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),I0.jsxDEV("div",{children:[I0.jsxDEV("h3",{className:"text-sm font-medium text-[#888] mb-3",children:["Available Apps (",R1.length,")"]},void 0,!0,void 0,this),R1.length===0?I0.jsxDEV("p",{className:"text-[#666] text-sm",children:M?"No apps match your search":"No apps available"},void 0,!1,void 0,this):I0.jsxDEV("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:R1.slice(0,50).map((p)=>I0.jsxDEV(SO,{app:p,onConnect:()=>Y0(p),connecting:R===p.slug},p.id,!1,void 0,this))},void 0,!1,void 0,this),R1.length>50&&I0.jsxDEV("p",{className:"text-xs text-[#555] mt-3 text-center",children:["Showing first 50 of ",R1.length," apps. Use search to find more."]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function SO({app:Y,connection:H,onConnect:B,onDisconnect:K,onCreateMcpConfig:G,connecting:_}){let W=H?.status==="active",O=OG(Y),F=fO(Y),b=O&&F;return I0.jsxDEV("div",{className:`bg-[#111] border rounded-lg p-3 transition ${W?"border-green-500/30":"border-[#1a1a1a] hover:border-[#333]"}`,children:[I0.jsxDEV("div",{className:"flex items-start gap-3",children:[I0.jsxDEV("div",{className:"w-10 h-10 rounded bg-[#1a1a1a] flex items-center justify-center flex-shrink-0 overflow-hidden",children:Y.logo?I0.jsxDEV("img",{src:Y.logo,alt:Y.name,className:"w-8 h-8 object-contain",onError:(M)=>{M.target.style.display="none"}},void 0,!1,void 0,this):I0.jsxDEV("span",{className:"text-lg",children:Y.name[0]?.toUpperCase()},void 0,!1,void 0,this)},void 0,!1,void 0,this),I0.jsxDEV("div",{className:"flex-1 min-w-0",children:[I0.jsxDEV("div",{className:"flex items-center gap-2",children:[I0.jsxDEV("h4",{className:"font-medium text-sm truncate",children:Y.name},void 0,!1,void 0,this),W&&I0.jsxDEV("span",{className:"text-xs text-green-400",children:"✓"},void 0,!1,void 0,this),!W&&O&&!F&&I0.jsxDEV("span",{className:"text-[10px] bg-[#222] text-[#888] px-1.5 py-0.5 rounded",title:"Requires API Key",children:"API Key"},void 0,!1,void 0,this),!W&&b&&I0.jsxDEV("span",{className:"text-[10px] bg-[#1a2a1a] text-[#6a6] px-1.5 py-0.5 rounded",title:"Supports API Key or OAuth",children:"API Key / OAuth"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Y.description&&I0.jsxDEV("p",{className:"text-xs text-[#666] line-clamp-2 mt-0.5",children:Y.description},void 0,!1,void 0,this),Y.categories.length>0&&I0.jsxDEV("div",{className:"flex flex-wrap gap-1 mt-1",children:Y.categories.slice(0,2).map((M)=>I0.jsxDEV("span",{className:"text-[10px] bg-[#1a1a1a] text-[#555] px-1.5 py-0.5 rounded",children:M},M,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),I0.jsxDEV("div",{className:"mt-3 flex gap-2",children:W?I0.jsxDEV(I0.Fragment,{children:[G&&I0.jsxDEV("button",{onClick:G,className:"flex-1 text-xs bg-[#1a2a1a] hover:bg-[#1a3a1a] border border-green-500/30 hover:border-green-500/50 text-green-400 px-3 py-1.5 rounded transition",children:"Create MCP Config"},void 0,!1,void 0,this),K&&I0.jsxDEV("button",{onClick:K,className:"text-xs text-[#666] hover:text-red-400 transition px-2",title:"Disconnect",children:"×"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):I0.jsxDEV("button",{onClick:B,disabled:_,className:"w-full text-xs bg-[#1a1a1a] hover:bg-[#222] border border-[#333] hover:border-[#f97316] px-3 py-1.5 rounded transition disabled:opacity-50",children:_?"Connecting...":O&&!F?"Enter API Key":"Connect"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}var w=H0(H1(),1);function hJ(){let{authFetch:Y}=A1(),{projects:H,currentProjectId:B}=G4(),[K,G]=r0.useState([]),[_,W]=r0.useState(!0),[O,F]=r0.useState(!1),[b,M]=r0.useState(null),[A,R]=r0.useState(null),[k,S]=r0.useState("servers"),{confirm:V,ConfirmDialog:x}=a5(),f=H.length>0,l=async()=>{try{let g=await(await Y("/api/mcp/servers")).json();G(g.servers||[])}catch(j){console.error("Failed to fetch MCP servers:",j)}W(!1)};r0.useEffect(()=>{l()},[Y]);let T=K.filter((j)=>{if(!B)return!0;if(B==="unassigned")return j.project_id===null;return j.project_id===null||j.project_id===B}),m=async(j)=>{try{await Y(`/api/mcp/servers/${j}/start`,{method:"POST"}),l()}catch(g){console.error("Failed to start server:",g)}},E=async(j)=>{try{await Y(`/api/mcp/servers/${j}/stop`,{method:"POST"}),l()}catch(g){console.error("Failed to stop server:",g)}},D=async(j)=>{if(!await V("Delete this MCP server?",{confirmText:"Delete",title:"Delete Server"}))return;try{if(await Y(`/api/mcp/servers/${j}`,{method:"DELETE"}),A?.id===j)R(null);l()}catch(Q0){console.error("Failed to delete server:",Q0)}},n=async(j,g)=>{try{await Y(`/api/mcp/servers/${j}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:g})}),l()}catch(Q0){console.error("Failed to rename server:",Q0)}},c=async(j,g)=>{try{await Y(`/api/mcp/servers/${j}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(g)}),l()}catch(Q0){throw console.error("Failed to update server:",Q0),Q0}};return w.jsxDEV(w.Fragment,{children:[x,w.jsxDEV("div",{className:"flex-1 overflow-auto p-6",children:[w.jsxDEV("div",{className:"max-w-6xl",children:[w.jsxDEV("div",{className:"flex items-center justify-between mb-6",children:[w.jsxDEV("div",{children:[w.jsxDEV("h1",{className:"text-2xl font-semibold mb-1",children:"MCP Servers"},void 0,!1,void 0,this),w.jsxDEV("p",{className:"text-[#666]",children:"Manage Model Context Protocol servers for tool integrations."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),k==="servers"&&w.jsxDEV("button",{onClick:()=>F(!0),className:"bg-[#f97316] hover:bg-[#fb923c] text-black px-4 py-2 rounded font-medium transition",children:"+ Add Server"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),w.jsxDEV("div",{className:"flex gap-1 mb-6 bg-[#111] border border-[#1a1a1a] rounded-lg p-1 w-fit",children:[w.jsxDEV("button",{onClick:()=>S("servers"),className:`px-4 py-2 rounded text-sm font-medium transition ${k==="servers"?"bg-[#1a1a1a] text-white":"text-[#666] hover:text-[#888]"}`,children:"My Servers"},void 0,!1,void 0,this),w.jsxDEV("button",{onClick:()=>S("hosted"),className:`px-4 py-2 rounded text-sm font-medium transition ${k==="hosted"?"bg-[#1a1a1a] text-white":"text-[#666] hover:text-[#888]"}`,children:"Hosted Services"},void 0,!1,void 0,this),w.jsxDEV("button",{onClick:()=>S("registry"),className:`px-4 py-2 rounded text-sm font-medium transition ${k==="registry"?"bg-[#1a1a1a] text-white":"text-[#666] hover:text-[#888]"}`,children:"Browse Registry"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),k==="servers"&&w.jsxDEV(w.Fragment,{children:[_&&w.jsxDEV("div",{className:"text-center py-8 text-[#666]",children:"Loading..."},void 0,!1,void 0,this),!_&&T.length===0&&K.length===0&&w.jsxDEV("div",{className:"bg-[#111] border border-[#1a1a1a] rounded-lg p-8 text-center",children:[w.jsxDEV(l6,{className:"w-12 h-12 text-[#333] mx-auto mb-4"},void 0,!1,void 0,this),w.jsxDEV("h3",{className:"text-lg font-medium mb-2",children:"No MCP servers configured"},void 0,!1,void 0,this),w.jsxDEV("p",{className:"text-[#666] mb-6 max-w-md mx-auto",children:"MCP servers extend your agents with tools like file access, web browsing, database connections, and more."},void 0,!1,void 0,this),w.jsxDEV("div",{className:"flex gap-3 justify-center",children:[w.jsxDEV("button",{onClick:()=>F(!0),className:"bg-[#f97316] hover:bg-[#fb923c] text-black px-4 py-2 rounded font-medium transition",children:"Add Manually"},void 0,!1,void 0,this),w.jsxDEV("button",{onClick:()=>S("registry"),className:"border border-[#333] hover:border-[#666] px-4 py-2 rounded font-medium transition",children:"Browse Registry"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),!_&&T.length===0&&K.length>0&&w.jsxDEV("div",{className:"bg-[#111] border border-[#1a1a1a] rounded-lg p-6 text-center",children:w.jsxDEV("p",{className:"text-[#666]",children:"No servers match this filter."},void 0,!1,void 0,this)},void 0,!1,void 0,this),!_&&T.length>0&&w.jsxDEV("div",{className:"flex gap-6",children:[w.jsxDEV("div",{className:`space-y-3 ${A?"w-1/2":"w-full"}`,children:T.map((j)=>{let Q0=j.type==="http"&&j.url||j.status==="running",r=f&&j.project_id?H.find((U0)=>U0.id===j.project_id):null;return w.jsxDEV(PT,{server:j,project:r,selected:A?.id===j.id,onSelect:()=>R(Q0?j:null),onStart:()=>m(j.id),onStop:()=>E(j.id),onDelete:()=>D(j.id),onEdit:()=>M(j)},j.id,!1,void 0,this)})},void 0,!1,void 0,this),A&&w.jsxDEV("div",{className:"w-1/2",children:w.jsxDEV(AT,{server:A,onClose:()=>R(null)},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),k==="hosted"&&w.jsxDEV(kT,{onServerAdded:l,projectId:B},void 0,!1,void 0,this),k==="registry"&&w.jsxDEV(TT,{onInstall:(j)=>{l(),S("servers")}},void 0,!1,void 0,this),k==="servers"&&w.jsxDEV("div",{className:"mt-8 p-4 bg-[#111] border border-[#1a1a1a] rounded-lg",children:[w.jsxDEV("h3",{className:"font-medium mb-2",children:"Quick Start"},void 0,!1,void 0,this),w.jsxDEV("p",{className:"text-sm text-[#666] mb-3",children:"Add an MCP server by providing its npm package name. For example:"},void 0,!1,void 0,this),w.jsxDEV("div",{className:"flex flex-wrap gap-2",children:[{name:"filesystem",pkg:"@modelcontextprotocol/server-filesystem"},{name:"fetch",pkg:"@modelcontextprotocol/server-fetch"},{name:"memory",pkg:"@modelcontextprotocol/server-memory"}].map((j)=>w.jsxDEV("code",{className:"text-xs bg-[#0a0a0a] px-2 py-1 rounded",children:j.pkg},j.name,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),O&&w.jsxDEV(ST,{onClose:()=>F(!1),onAdded:()=>{F(!1),l()},projects:f?H:void 0,defaultProjectId:B&&B!=="unassigned"?B:null},void 0,!1,void 0,this),b&&w.jsxDEV(fT,{server:b,projects:f?H:void 0,onClose:()=>M(null),onSaved:()=>{M(null),l()}},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function PT({server:Y,project:H,selected:B,onSelect:K,onStart:G,onStop:_,onDelete:W,onEdit:O}){let F=Y.type==="http"&&Y.url,b=F||Y.status==="running",M=()=>{if(F)return`${Y.source||"remote"} • http`;return`${Y.type} • ${Y.package||Y.command||"custom"}${Y.status==="running"&&Y.port?` • :${Y.port}`:""}`},A=()=>{if(H)return w.jsxDEV("span",{className:"text-xs px-1.5 py-0.5 rounded",style:{backgroundColor:`${H.color}20`,color:H.color},children:H.name},void 0,!1,void 0,this);if(Y.project_id===null)return w.jsxDEV("span",{className:"text-xs text-[#666] bg-[#1a1a1a] px-1.5 py-0.5 rounded",children:"Global"},void 0,!1,void 0,this);return null};return w.jsxDEV("div",{className:`bg-[#111] border rounded-lg p-4 cursor-pointer transition ${B?"border-[#f97316]":"border-[#1a1a1a] hover:border-[#333]"}`,onClick:b?K:void 0,children:w.jsxDEV("div",{className:"flex items-center justify-between",children:[w.jsxDEV("div",{className:"flex items-center gap-3",children:[w.jsxDEV("div",{className:`w-2 h-2 rounded-full ${b?"bg-green-400":"bg-[#444]"}`},void 0,!1,void 0,this),w.jsxDEV("div",{children:[w.jsxDEV("div",{className:"flex items-center gap-2",children:[w.jsxDEV("h3",{className:"font-medium",children:Y.name},void 0,!1,void 0,this),A()]},void 0,!0,void 0,this),w.jsxDEV("p",{className:"text-sm text-[#666]",children:M()},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),w.jsxDEV("div",{className:"flex items-center gap-2",children:[w.jsxDEV("button",{onClick:(R)=>{R.stopPropagation(),O()},className:"text-sm text-[#666] hover:text-[#888] px-3 py-1 transition",title:"Edit server settings",children:"Edit"},void 0,!1,void 0,this),F?w.jsxDEV("button",{onClick:(R)=>{R.stopPropagation(),W()},className:"text-sm text-[#666] hover:text-red-400 px-3 py-1 transition",children:"Remove"},void 0,!1,void 0,this):Y.status==="running"?w.jsxDEV(w.Fragment,{children:[w.jsxDEV("button",{onClick:(R)=>{R.stopPropagation(),K()},className:"text-sm text-[#f97316] hover:text-[#fb923c] px-3 py-1 transition",children:"Tools"},void 0,!1,void 0,this),w.jsxDEV("button",{onClick:(R)=>{R.stopPropagation(),_()},className:"text-sm text-[#666] hover:text-red-400 px-3 py-1 transition",children:"Stop"},void 0,!1,void 0,this),w.jsxDEV("button",{onClick:(R)=>{R.stopPropagation(),W()},className:"text-sm text-[#666] hover:text-red-400 px-3 py-1 transition",children:"Delete"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):w.jsxDEV(w.Fragment,{children:[w.jsxDEV("button",{onClick:(R)=>{R.stopPropagation(),G()},className:"text-sm text-[#666] hover:text-green-400 px-3 py-1 transition",children:"Start"},void 0,!1,void 0,this),w.jsxDEV("button",{onClick:(R)=>{R.stopPropagation(),W()},className:"text-sm text-[#666] hover:text-red-400 px-3 py-1 transition",children:"Delete"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}function AT({server:Y,onClose:H}){let{authFetch:B}=A1(),[K,G]=r0.useState([]),[_,W]=r0.useState(null),[O,F]=r0.useState(!0),[b,M]=r0.useState(null),[A,R]=r0.useState(null);return r0.useEffect(()=>{(async()=>{F(!0),M(null);try{let S=await B(`/api/mcp/servers/${Y.id}/tools`),V=await S.json();if(!S.ok){M(V.error||"Failed to fetch tools");return}G(V.tools||[]),W(V.serverInfo||null)}catch(S){M(`Failed to fetch tools: ${S}`)}finally{F(!1)}})()},[Y.id,B]),w.jsxDEV("div",{className:"bg-[#111] border border-[#1a1a1a] rounded-lg overflow-hidden",children:[w.jsxDEV("div",{className:"p-4 border-b border-[#1a1a1a] flex items-center justify-between",children:[w.jsxDEV("div",{children:[w.jsxDEV("h3",{className:"font-medium",children:[Y.name," Tools"]},void 0,!0,void 0,this),_&&w.jsxDEV("p",{className:"text-xs text-[#666]",children:[_.name," v",_.version]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),w.jsxDEV("button",{onClick:H,className:"text-[#666] hover:text-[#888] text-xl leading-none",children:"×"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),w.jsxDEV("div",{className:"p-4 max-h-[500px] overflow-auto",children:[O&&w.jsxDEV("p",{className:"text-[#666]",children:"Loading tools..."},void 0,!1,void 0,this),b&&w.jsxDEV("div",{className:"text-red-400 text-sm p-3 bg-red-500/10 rounded",children:b},void 0,!1,void 0,this),!O&&!b&&K.length===0&&w.jsxDEV("p",{className:"text-[#666]",children:"No tools available from this server."},void 0,!1,void 0,this),!O&&!b&&K.length>0&&!A&&w.jsxDEV("div",{className:"space-y-2",children:K.map((k)=>w.jsxDEV("button",{onClick:()=>R(k),className:"w-full text-left p-3 bg-[#0a0a0a] hover:bg-[#1a1a1a] border border-[#222] hover:border-[#333] rounded transition",children:[w.jsxDEV("div",{className:"font-medium text-sm",children:k.name},void 0,!1,void 0,this),k.description&&w.jsxDEV("div",{className:"text-xs text-[#666] mt-1",children:k.description},void 0,!1,void 0,this)]},k.name,!0,void 0,this))},void 0,!1,void 0,this),A&&w.jsxDEV(IT,{serverId:Y.id,tool:A,onBack:()=>R(null)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function IT({serverId:Y,tool:H,onBack:B}){let{authFetch:K}=A1(),[G,_]=r0.useState("{}"),[W,O]=r0.useState(null),[F,b]=r0.useState(null),[M,A]=r0.useState(!1);r0.useEffect(()=>{let k=H.inputSchema;if(k&&typeof k==="object"&&"properties"in k){let S=k.properties,V={};for(let[x,f]of Object.entries(S))if(f.default!==void 0)V[x]=f.default;else if(f.type==="string")V[x]="";else if(f.type==="number"||f.type==="integer")V[x]=0;else if(f.type==="boolean")V[x]=!1;else if(f.type==="array")V[x]=[];else if(f.type==="object")V[x]={};_(JSON.stringify(V,null,2))}},[H]);let R=async()=>{A(!0),b(null),O(null);try{let k=JSON.parse(G),S=await K(`/api/mcp/servers/${Y}/tools/${encodeURIComponent(H.name)}/call`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({arguments:k})}),V=await S.json();if(!S.ok){b(V.error||"Failed to call tool");return}O(V.result)}catch(k){b(`Error: ${k}`)}finally{A(!1)}};return w.jsxDEV("div",{className:"space-y-4",children:[w.jsxDEV("div",{className:"flex items-center gap-2",children:[w.jsxDEV("button",{onClick:B,className:"text-[#666] hover:text-[#888] text-sm",children:"← Back"},void 0,!1,void 0,this),w.jsxDEV("span",{className:"text-[#444]",children:"/"},void 0,!1,void 0,this),w.jsxDEV("span",{className:"font-medium",children:H.name},void 0,!1,void 0,this)]},void 0,!0,void 0,this),H.description&&w.jsxDEV("p",{className:"text-sm text-[#666]",children:H.description},void 0,!1,void 0,this),H.inputSchema&&w.jsxDEV("div",{className:"text-xs",children:w.jsxDEV("details",{className:"cursor-pointer",children:[w.jsxDEV("summary",{className:"text-[#666] hover:text-[#888]",children:"Input Schema"},void 0,!1,void 0,this),w.jsxDEV("pre",{className:"mt-2 p-2 bg-[#0a0a0a] rounded text-[#888] overflow-auto max-h-32",children:JSON.stringify(H.inputSchema,null,2)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),w.jsxDEV("div",{children:[w.jsxDEV("label",{className:"block text-sm text-[#666] mb-1",children:"Arguments (JSON)"},void 0,!1,void 0,this),w.jsxDEV("textarea",{value:G,onChange:(k)=>_(k.target.value),className:"w-full bg-[#0a0a0a] border border-[#333] rounded px-3 py-2 h-32 font-mono text-sm focus:outline-none focus:border-[#f97316] resize-none",placeholder:"{}"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),w.jsxDEV("button",{onClick:R,disabled:M,className:"w-full bg-[#f97316] hover:bg-[#fb923c] disabled:opacity-50 text-black px-4 py-2 rounded font-medium transition",children:M?"Calling...":"Call Tool"},void 0,!1,void 0,this),F&&w.jsxDEV("div",{className:"text-red-400 text-sm p-3 bg-red-500/10 rounded",children:F},void 0,!1,void 0,this),W&&w.jsxDEV("div",{className:"space-y-2",children:[w.jsxDEV("div",{className:"text-sm text-[#666]",children:["Result ",W.isError&&w.jsxDEV("span",{className:"text-red-400",children:"(error)"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),w.jsxDEV("div",{className:`p-3 rounded text-sm ${W.isError?"bg-red-500/10":"bg-green-500/10"}`,children:W.content.map((k,S)=>w.jsxDEV("div",{className:"mb-2 last:mb-0",children:[k.type==="text"&&w.jsxDEV("pre",{className:"whitespace-pre-wrap font-mono text-xs",children:k.text},void 0,!1,void 0,this),k.type==="image"&&k.data&&w.jsxDEV("img",{src:`data:${k.mimeType||"image/png"};base64,${k.data}`,alt:"Tool result",className:"max-w-full rounded"},void 0,!1,void 0,this)]},S,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function TT({onInstall:Y}){let{authFetch:H}=A1(),[B,K]=r0.useState(""),[G,_]=r0.useState([]),[W,O]=r0.useState(!1),[F,b]=r0.useState(!1),[M,A]=r0.useState(null),[R,k]=r0.useState(null),S=async(f)=>{O(!0),k(null);try{let l=await H(`/api/mcp/registry?search=${encodeURIComponent(f)}&limit=20`),T=await l.json();if(!l.ok)k(T.error||"Failed to search registry"),_([]);else _(T.servers||[])}catch(l){k(`Failed to search: ${l}`),_([])}finally{O(!1),b(!0)}},V=(f)=>{if(f.preventDefault(),B.trim())S(B.trim())};r0.useEffect(()=>{S("")},[]);let x=async(f)=>{if(!f.npmPackage){k("This server does not have an npm package");return}A(f.id),k(null);try{let l=await H("/api/mcp/servers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:f.name,type:"npm",package:f.npmPackage})});if(!l.ok){let T=await l.json();k(T.error||"Failed to add server");return}Y(f)}catch(l){k(`Failed to add server: ${l}`)}finally{A(null)}};return w.jsxDEV("div",{className:"space-y-6",children:[w.jsxDEV("form",{onSubmit:V,className:"flex gap-2",children:[w.jsxDEV("input",{type:"text",value:B,onChange:(f)=>K(f.target.value),placeholder:"Search MCP servers (e.g., filesystem, github, slack...)",className:"flex-1 bg-[#111] border border-[#333] rounded-lg px-4 py-3 focus:outline-none focus:border-[#f97316]"},void 0,!1,void 0,this),w.jsxDEV("button",{type:"submit",disabled:W,className:"bg-[#f97316] hover:bg-[#fb923c] disabled:opacity-50 text-black px-6 py-3 rounded-lg font-medium transition",children:W?"...":"Search"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),R&&w.jsxDEV("div",{className:"text-red-400 text-sm p-3 bg-red-500/10 border border-red-500/20 rounded-lg",children:R},void 0,!1,void 0,this),!W&&F&&G.length===0&&w.jsxDEV("div",{className:"text-center py-8 text-[#666]",children:"No servers found. Try a different search term."},void 0,!1,void 0,this),G.length>0&&w.jsxDEV("div",{className:"grid gap-4 md:grid-cols-2",children:G.map((f)=>w.jsxDEV("div",{className:"bg-[#111] border border-[#1a1a1a] rounded-lg p-4 hover:border-[#333] transition",children:w.jsxDEV("div",{className:"flex items-start justify-between gap-3",children:[w.jsxDEV("div",{className:"flex-1 min-w-0",children:[w.jsxDEV("h3",{className:"font-medium truncate",children:f.name},void 0,!1,void 0,this),w.jsxDEV("p",{className:"text-sm text-[#666] mt-1 line-clamp-2",children:f.description||"No description"},void 0,!1,void 0,this),w.jsxDEV("div",{className:"flex items-center gap-2 mt-2 text-xs text-[#555]",children:[f.version&&w.jsxDEV("span",{children:["v",f.version]},void 0,!0,void 0,this),w.jsxDEV("span",{className:`px-1.5 py-0.5 rounded ${f.npmPackage?"bg-green-500/10 text-green-400":"bg-blue-500/10 text-blue-400"}`,children:f.npmPackage?"npm":"remote"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),w.jsxDEV("code",{className:"text-xs text-[#555] bg-[#0a0a0a] px-2 py-0.5 rounded mt-2 inline-block truncate max-w-full",children:f.npmPackage||f.fullName},void 0,!1,void 0,this)]},void 0,!0,void 0,this),w.jsxDEV("div",{className:"flex-shrink-0",children:f.npmPackage?w.jsxDEV("button",{onClick:()=>x(f),disabled:M===f.id,className:"text-sm bg-[#1a1a1a] hover:bg-[#222] border border-[#333] hover:border-[#f97316] px-3 py-1.5 rounded transition disabled:opacity-50",children:M===f.id?"Adding...":"Add"},void 0,!1,void 0,this):f.repository?w.jsxDEV("a",{href:f.repository,target:"_blank",rel:"noopener noreferrer",className:"text-sm text-[#666] hover:text-[#f97316] transition",children:"View →"},void 0,!1,void 0,this):null},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},f.id,!1,void 0,this))},void 0,!1,void 0,this),W&&w.jsxDEV("div",{className:"text-center py-8 text-[#666]",children:"Searching registry..."},void 0,!1,void 0,this),w.jsxDEV("div",{className:"p-4 bg-[#111] border border-[#1a1a1a] rounded-lg text-sm text-[#666]",children:w.jsxDEV("p",{children:["Servers are sourced from the"," ",w.jsxDEV("a",{href:"https://github.com/modelcontextprotocol/servers",target:"_blank",rel:"noopener noreferrer",className:"text-[#f97316] hover:underline",children:"official MCP registry"},void 0,!1,void 0,this),". Not all servers have npm packages - some require manual setup."]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function kT({onServerAdded:Y,projectId:H}){let{authFetch:B}=A1(),[K,G]=r0.useState("composio"),[_,W]=r0.useState("configs"),[O,F]=r0.useState(!1),[b,M]=r0.useState(!1),[A,R]=r0.useState(!1),[k,S]=r0.useState([]),[V,x]=r0.useState(new Set),[f,l]=r0.useState(!0),[T,m]=r0.useState(!1),[E,D]=r0.useState(null),{alert:n,AlertDialog:c}=gX(),j=async()=>{try{let _0=H&&H!=="unassigned"?`/api/mcp/servers?project=${encodeURIComponent(H)}`:"/api/mcp/servers",[f0,P0]=await Promise.all([B("/api/providers"),B(_0)]),a=await f0.json(),Y0=await P0.json(),B0=a.providers||[],G0=Y0.servers||[],h0=new Set(G0.filter((R1)=>R1.source==="composio"&&R1.url).map((R1)=>{let p=R1.url.match(/\/v3\/mcp\/([^/]+)/);return p?p[1]:null}).filter(Boolean));x(h0);let z0=B0.find((R1)=>R1.id==="composio"),v0=B0.find((R1)=>R1.id==="smithery"),j0=B0.find((R1)=>R1.id==="agentdojo"),Y1=z0?.hasKey||!1,m0=v0?.hasKey||!1,F1=j0?.hasKey||!1;if(F(Y1),M(m0),R(F1),Y1)G("composio"),g();else if(m0)G("smithery");else if(F1)G("agentdojo")}catch(_0){console.error("Failed to fetch providers:",_0)}l(!1)},g=async()=>{m(!0);try{let _0=H&&H!=="unassigned"?`?project_id=${H}`:"",P0=await(await B(`/api/integrations/composio/configs${_0}`)).json();S(P0.configs||[])}catch(_0){console.error("Failed to fetch Composio configs:",_0)}m(!1)},Q0=async(_0)=>{D(_0);try{let f0=H&&H!=="unassigned"?`?project_id=${H}`:"",P0=await B(`/api/integrations/composio/configs/${_0}/add${f0}`,{method:"POST"});if(P0.ok)x((a)=>new Set([...a,_0])),Y?.();else{let a=await P0.json();await n(a.error||"Failed to add config",{title:"Error",variant:"error"})}}catch(f0){console.error("Failed to add config:",f0)}D(null)},r=(_0)=>{return V.has(_0)};if(r0.useEffect(()=>{j()},[B,H]),f)return w.jsxDEV("div",{className:"text-center py-8 text-[#666]",children:"Loading..."},void 0,!1,void 0,this);let U0=O||b||A,R0=[O,b,A].filter(Boolean).length;if(!U0)return w.jsxDEV("div",{className:"bg-[#111] border border-[#1a1a1a] rounded-lg p-8 text-center",children:[w.jsxDEV("p",{className:"text-[#888] mb-2",children:"No hosted MCP services connected"},void 0,!1,void 0,this),w.jsxDEV("p",{className:"text-sm text-[#666] mb-4",children:"Connect Composio, Smithery, or AgentDojo in Settings to access cloud-based MCP servers."},void 0,!1,void 0,this),w.jsxDEV("a",{href:"/settings",className:"inline-block bg-[#1a1a1a] hover:bg-[#222] border border-[#333] hover:border-[#f97316] px-4 py-2 rounded text-sm font-medium transition",children:"Go to Settings →"},void 0,!1,void 0,this)]},void 0,!0,void 0,this);return w.jsxDEV(w.Fragment,{children:[c,w.jsxDEV("div",{className:"space-y-6",children:[R0>1&&w.jsxDEV("div",{className:"flex gap-1 bg-[#0a0a0a] border border-[#222] rounded-lg p-1 w-fit",children:[O&&w.jsxDEV("button",{onClick:()=>{G("composio"),W("configs")},className:`px-4 py-2 rounded text-sm font-medium transition flex items-center gap-2 ${K==="composio"?"bg-[#1a1a1a] text-white":"text-[#666] hover:text-[#888]"}`,children:[w.jsxDEV("span",{className:"w-2 h-2 rounded-full bg-purple-500"},void 0,!1,void 0,this),"Composio"]},void 0,!0,void 0,this),b&&w.jsxDEV("button",{onClick:()=>G("smithery"),className:`px-4 py-2 rounded text-sm font-medium transition flex items-center gap-2 ${K==="smithery"?"bg-[#1a1a1a] text-white":"text-[#666] hover:text-[#888]"}`,children:[w.jsxDEV("span",{className:"w-2 h-2 rounded-full bg-blue-500"},void 0,!1,void 0,this),"Smithery"]},void 0,!0,void 0,this),A&&w.jsxDEV("button",{onClick:()=>G("agentdojo"),className:`px-4 py-2 rounded text-sm font-medium transition flex items-center gap-2 ${K==="agentdojo"?"bg-[#1a1a1a] text-white":"text-[#666] hover:text-[#888]"}`,children:[w.jsxDEV("span",{className:"w-2 h-2 rounded-full bg-green-500"},void 0,!1,void 0,this),"AgentDojo"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),O&&(R0===1||K==="composio")&&w.jsxDEV(w.Fragment,{children:[w.jsxDEV("div",{className:"flex items-center justify-between",children:[w.jsxDEV("div",{className:"flex gap-1 bg-[#0a0a0a] border border-[#222] rounded-lg p-1",children:[w.jsxDEV("button",{onClick:()=>W("configs"),className:`px-4 py-2 rounded text-sm font-medium transition ${_==="configs"?"bg-[#1a1a1a] text-white":"text-[#666] hover:text-[#888]"}`,children:"MCP Configs"},void 0,!1,void 0,this),w.jsxDEV("button",{onClick:()=>W("connect"),className:`px-4 py-2 rounded text-sm font-medium transition ${_==="connect"?"bg-[#1a1a1a] text-white":"text-[#666] hover:text-[#888]"}`,children:"Connect Apps"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),R0===1&&w.jsxDEV("div",{className:"flex items-center gap-2 text-xs text-[#666]",children:[w.jsxDEV("span",{className:"w-2 h-2 rounded-full bg-purple-500"},void 0,!1,void 0,this),"Composio",w.jsxDEV("span",{className:"text-green-400",children:"Connected"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),_==="connect"&&w.jsxDEV("div",{children:[w.jsxDEV("p",{className:"text-sm text-[#666] mb-4",children:"Connect your accounts to enable tools in MCP configs"},void 0,!1,void 0,this),w.jsxDEV(_G,{providerId:"composio",projectId:H,onConnectionComplete:()=>{g()}},void 0,!1,void 0,this)]},void 0,!0,void 0,this),_==="configs"&&w.jsxDEV("div",{children:[w.jsxDEV("div",{className:"flex items-center justify-between mb-3",children:[w.jsxDEV("p",{className:"text-sm text-[#666]",children:"Your MCP configs from Composio"},void 0,!1,void 0,this),w.jsxDEV("div",{className:"flex items-center gap-3",children:[w.jsxDEV("button",{onClick:g,disabled:T,className:"text-xs text-[#666] hover:text-[#888] transition",children:T?"Loading...":"Refresh"},void 0,!1,void 0,this),w.jsxDEV("a",{href:"https://app.composio.dev/mcp_configs",target:"_blank",rel:"noopener noreferrer",className:"text-xs text-[#666] hover:text-[#f97316] transition",children:"Create Config →"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),T?w.jsxDEV("div",{className:"text-center py-6 text-[#666]",children:"Loading configs..."},void 0,!1,void 0,this):k.length===0?w.jsxDEV("div",{className:"bg-[#111] border border-[#1a1a1a] rounded-lg p-4 text-center",children:[w.jsxDEV("p",{className:"text-sm text-[#666]",children:"No MCP configs found"},void 0,!1,void 0,this),w.jsxDEV("p",{className:"text-xs text-[#555] mt-2",children:["First ",w.jsxDEV("button",{onClick:()=>W("connect"),className:"text-[#f97316] hover:text-[#fb923c]",children:"connect some apps"},void 0,!1,void 0,this),", then create a config."]},void 0,!0,void 0,this),w.jsxDEV("a",{href:"https://app.composio.dev/mcp_configs",target:"_blank",rel:"noopener noreferrer",className:"text-xs text-[#f97316] hover:text-[#fb923c] mt-2 inline-block",children:"Create in Composio →"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):w.jsxDEV("div",{className:"space-y-2",children:k.map((_0)=>{let f0=r(_0.id),P0=E===_0.id;return w.jsxDEV("div",{className:`bg-[#111] border rounded-lg p-3 transition flex items-center justify-between ${f0?"border-green-500/30":"border-[#1a1a1a] hover:border-[#333]"}`,children:[w.jsxDEV("div",{className:"flex-1 min-w-0",children:[w.jsxDEV("div",{className:"flex items-center gap-2",children:[w.jsxDEV("span",{className:"font-medium text-sm",children:_0.name},void 0,!1,void 0,this),w.jsxDEV("span",{className:"text-xs text-[#555]",children:[_0.toolsCount," tools"]},void 0,!0,void 0,this),f0&&w.jsxDEV("span",{className:"text-xs text-green-400",children:"Added"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),_0.toolkits.length>0&&w.jsxDEV("div",{className:"flex flex-wrap gap-1 mt-1",children:[_0.toolkits.slice(0,4).map((a)=>w.jsxDEV("span",{className:"text-xs bg-[#1a1a1a] text-[#666] px-1.5 py-0.5 rounded",children:a},a,!1,void 0,this)),_0.toolkits.length>4&&w.jsxDEV("span",{className:"text-xs text-[#555]",children:["+",_0.toolkits.length-4]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),w.jsxDEV("div",{className:"flex items-center gap-2 ml-3",children:[f0?w.jsxDEV("span",{className:"text-xs text-[#555] px-2 py-1",children:"In Servers"},void 0,!1,void 0,this):w.jsxDEV("button",{onClick:()=>Q0(_0.id),disabled:P0,className:"text-xs bg-[#f97316] hover:bg-[#fb923c] text-black px-3 py-1 rounded font-medium transition disabled:opacity-50",children:P0?"Adding...":"Add"},void 0,!1,void 0,this),w.jsxDEV("a",{href:`https://app.composio.dev/mcp_configs/${_0.id}`,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-[#666] hover:text-[#888] transition",children:"Edit"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},_0.id,!0,void 0,this)})},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),b&&(R0===1||K==="smithery")&&w.jsxDEV("div",{children:[R0===1&&w.jsxDEV("div",{className:"flex items-center gap-2 text-xs text-[#666] mb-4",children:[w.jsxDEV("span",{className:"w-2 h-2 rounded-full bg-blue-500"},void 0,!1,void 0,this),"Smithery",w.jsxDEV("span",{className:"text-green-400",children:"Connected"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),w.jsxDEV("div",{className:"flex items-center justify-between mb-3",children:[w.jsxDEV("p",{className:"text-sm text-[#666]",children:"Add MCP servers from the Smithery registry"},void 0,!1,void 0,this),w.jsxDEV("a",{href:"https://smithery.ai/servers",target:"_blank",rel:"noopener noreferrer",className:"text-xs text-[#666] hover:text-[#f97316] transition",children:"Browse Smithery →"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),w.jsxDEV("div",{className:"bg-[#111] border border-[#1a1a1a] rounded-lg p-4 text-center",children:[w.jsxDEV("p",{className:"text-sm text-[#666]",children:["Smithery servers can be added from the ",w.jsxDEV("strong",{children:"Browse Registry"},void 0,!1,void 0,this)," tab."]},void 0,!0,void 0,this),w.jsxDEV("p",{className:"text-xs text-[#555] mt-2",children:"Your API key will be used automatically when adding Smithery servers."},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),A&&(R0===1||K==="agentdojo")&&w.jsxDEV(CT,{projectId:H,onServerAdded:Y,showProviderBadge:R0===1},void 0,!1,void 0,this),w.jsxDEV("div",{className:"p-3 bg-[#0a0a0a] border border-[#222] rounded text-xs text-[#666]",children:[w.jsxDEV("strong",{className:"text-[#888]",children:"Tip:"},void 0,!1,void 0,this)," Connect apps first, then add MCP configs to make tools available to your agents."," · ",w.jsxDEV("a",{href:"/settings",className:"text-[#f97316] hover:text-[#fb923c]",children:"Add more providers in Settings"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function CT({projectId:Y,onServerAdded:H,showProviderBadge:B}){let{authFetch:K}=A1(),[G,_]=r0.useState("configs"),[W,O]=r0.useState([]),[F,b]=r0.useState(new Set),[M,A]=r0.useState(!1),[R,k]=r0.useState(null),{alert:S,AlertDialog:V}=gX(),x=async()=>{A(!0);try{let T=Y&&Y!=="unassigned"?`?project_id=${Y}`:"",m=Y&&Y!=="unassigned"?`/api/mcp/servers?project=${encodeURIComponent(Y)}`:"/api/mcp/servers",[E,D]=await Promise.all([K(`/api/integrations/agentdojo/configs${T}`),K(m)]),n=await E.json(),c=await D.json();O(n.configs||[]);let j=new Set((c.servers||[]).filter((g)=>g.source==="agentdojo").map((g)=>{let Q0=g.url?.match(/\/mcp\/([^/?]+)/);return Q0?Q0[1]:g.name}));b(j)}catch(T){console.error("Failed to fetch AgentDojo configs:",T)}A(!1)},f=async(T)=>{k(T);try{let m=Y&&Y!=="unassigned"?`?project_id=${Y}`:"",E=await K(`/api/integrations/agentdojo/configs/${T}/add${m}`,{method:"POST"});if(E.ok){let D=W.find((n)=>n.id===T);b((n)=>new Set([...n,D?.slug||T])),H?.()}else{let D=await E.json();await S(D.error||"Failed to add config",{title:"Error",variant:"error"})}}catch(m){console.error("Failed to add config:",m)}k(null)},l=(T)=>{return F.has(T.slug)||F.has(T.id)||F.has(T.name)};return r0.useEffect(()=>{x()},[K,Y]),w.jsxDEV(w.Fragment,{children:[V,w.jsxDEV("div",{children:[B&&w.jsxDEV("div",{className:"flex items-center gap-2 text-xs text-[#666] mb-4",children:[w.jsxDEV("span",{className:"w-2 h-2 rounded-full bg-green-500"},void 0,!1,void 0,this),"AgentDojo",w.jsxDEV("span",{className:"text-green-400",children:"Connected"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),w.jsxDEV("div",{className:"flex items-center justify-between mb-4",children:w.jsxDEV("div",{className:"flex gap-1 bg-[#0a0a0a] border border-[#222] rounded-lg p-1",children:[w.jsxDEV("button",{onClick:()=>_("configs"),className:`px-4 py-2 rounded text-sm font-medium transition ${G==="configs"?"bg-[#1a1a1a] text-white":"text-[#666] hover:text-[#888]"}`,children:"MCP Servers"},void 0,!1,void 0,this),w.jsxDEV("button",{onClick:()=>_("toolkits"),className:`px-4 py-2 rounded text-sm font-medium transition ${G==="toolkits"?"bg-[#1a1a1a] text-white":"text-[#666] hover:text-[#888]"}`,children:"Browse Toolkits"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),G==="configs"&&w.jsxDEV("div",{children:[w.jsxDEV("div",{className:"flex items-center justify-between mb-3",children:[w.jsxDEV("p",{className:"text-sm text-[#666]",children:"Your MCP servers from AgentDojo"},void 0,!1,void 0,this),w.jsxDEV("button",{onClick:x,disabled:M,className:"text-xs text-[#666] hover:text-[#888] transition",children:M?"Loading...":"Refresh"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),M?w.jsxDEV("div",{className:"text-center py-6 text-[#666]",children:"Loading servers..."},void 0,!1,void 0,this):W.length===0?w.jsxDEV("div",{className:"bg-[#111] border border-[#1a1a1a] rounded-lg p-4 text-center",children:[w.jsxDEV("p",{className:"text-sm text-[#666]",children:"No MCP servers found"},void 0,!1,void 0,this),w.jsxDEV("p",{className:"text-xs text-[#555] mt-2",children:[w.jsxDEV("button",{onClick:()=>_("toolkits"),className:"text-[#f97316] hover:text-[#fb923c]",children:"Browse toolkits"},void 0,!1,void 0,this)," ","to create a new MCP server."]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):w.jsxDEV("div",{className:"space-y-2",children:W.map((T)=>{let m=l(T),E=R===T.id;return w.jsxDEV("div",{className:`bg-[#111] border rounded-lg p-3 transition flex items-center justify-between ${m?"border-green-500/30":"border-[#1a1a1a] hover:border-[#333]"}`,children:[w.jsxDEV("div",{className:"flex-1 min-w-0",children:[w.jsxDEV("div",{className:"flex items-center gap-2",children:[w.jsxDEV("span",{className:"font-medium text-sm",children:T.name},void 0,!1,void 0,this),w.jsxDEV("span",{className:"text-xs text-[#555]",children:[T.toolsCount," tools"]},void 0,!0,void 0,this),m&&w.jsxDEV("span",{className:"text-xs text-green-400",children:"Added"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),T.mcpUrl&&w.jsxDEV("code",{className:"text-xs text-[#555] mt-1 block truncate",children:T.mcpUrl},void 0,!1,void 0,this),!T.mcpUrl&&T.slug&&w.jsxDEV("code",{className:"text-xs text-[#555] mt-1 block truncate",children:T.slug},void 0,!1,void 0,this)]},void 0,!0,void 0,this),w.jsxDEV("div",{className:"flex items-center gap-2 ml-3",children:m?w.jsxDEV("span",{className:"text-xs text-[#555] px-2 py-1",children:"In Servers"},void 0,!1,void 0,this):w.jsxDEV("button",{onClick:()=>f(T.id),disabled:E,className:"text-xs bg-[#f97316] hover:bg-[#fb923c] text-black px-3 py-1 rounded font-medium transition disabled:opacity-50",children:E?"Adding...":"Add"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},T.id,!0,void 0,this)})},void 0,!1,void 0,this)]},void 0,!0,void 0,this),G==="toolkits"&&w.jsxDEV("div",{children:[w.jsxDEV("p",{className:"text-sm text-[#666] mb-4",children:"Browse available toolkits and create MCP servers"},void 0,!1,void 0,this),w.jsxDEV(_G,{providerId:"agentdojo",projectId:Y,onConnectionComplete:()=>{x()}},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function vT(Y){let H=[],B=Y,K=null,G=Y.match(/(?:npx\s+-y\s+)?(@?[\w-]+\/)?(@?[\w-]+)(?:@[\w.-]+)?/);if(G){let O=G[2]||G[1];if(O)K=O.replace(/^@/,"").replace(/-mcp$/,"").replace(/-server$/,"").replace(/^server-/,"").replace(/^mcp-/,"")}let _=/--(\w+[-\w]*)\s+(YOUR_\w+|<[\w_]+>|\{[\w_]+\}|\$[\w_]+|[\w_]*(?:TOKEN|KEY|SECRET|PASSWORD|USER|ID|APIKEY)[\w_]*)/gi,W;while((W=_.exec(Y))!==null){let O=W[1],F=W[2],b=O.toUpperCase().replace(/-/g,"_"),M=K?`${K.toUpperCase().replace(/-/g,"_")}_${b}`:b;H.push({key:M,flag:O}),B=B.replace(new RegExp(`(--${O}\\s+)${F.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}`,"i"),`--${O} $${M}`)}return{cleanCommand:B,credentials:H,serverName:K}}function ST({onClose:Y,onAdded:H,projects:B,defaultProjectId:K}){let{authFetch:G}=A1(),[_,W]=r0.useState("npm"),[O,F]=r0.useState(""),[b,M]=r0.useState(""),[A,R]=r0.useState(""),[k,S]=r0.useState(""),[V,x]=r0.useState(""),[f,l]=r0.useState(""),[T,m]=r0.useState(""),[E,D]=r0.useState([]),[n,c]=r0.useState(K||null),[j,g]=r0.useState(!1),[Q0,r]=r0.useState(null),U0=B&&B.length>0,R0=()=>{D([...E,{key:"",value:""}])},_0=(G0,h0,z0)=>{let v0=[...E];v0[G0][h0]=z0,D(v0)},f0=(G0)=>{D(E.filter((h0,z0)=>z0!==G0))},P0=(G0)=>{if(S(G0),G0.includes("YOUR_")||G0.includes("<")||G0.includes("{")||/TOKEN|KEY|SECRET|PASSWORD/i.test(G0)){let{cleanCommand:h0,credentials:z0,serverName:v0}=vT(G0);if(!O&&v0)F(v0);if(z0.length>0){let j0=new Set(E.map((m0)=>m0.key)),Y1=z0.filter((m0)=>!j0.has(m0.key)).map((m0)=>({key:m0.key,value:""}));if(Y1.length>0)D([...E,...Y1]),S(h0)}}},a=(G0)=>{if(G0.startsWith("npx ")||G0.includes(" --")||G0.includes("YOUR_")||G0.includes("<")||/\s+(TOKEN|KEY|SECRET|PASSWORD)/i.test(G0))W("command"),P0(G0);else if(M(G0),!O&&G0){let z0=G0.replace(/^@[\w-]+\//,"").replace(/@[\w.-]+$/,"").replace(/^server-/,"").replace(/-server$/,"").replace(/^mcp-/,"").replace(/-mcp$/,"");if(z0&&z0!==G0)F(z0)}},Y0=async()=>{if(!O){r("Name is required");return}if(_==="npm"&&!b){r("npm package is required");return}if(_==="pip"&&!b){r("pip package is required");return}if(_==="command"&&!k){r("Command is required");return}if(_==="http"&&!V){r("URL is required");return}g(!0),r(null);let G0={};for(let{key:h0,value:z0}of E)if(h0.trim())G0[h0.trim()]=z0;try{let h0={name:O};if(_==="npm")h0.type="npm",h0.package=b;else if(_==="pip"){if(h0.type="pip",h0.package=b,A)h0.pip_module=A}else if(_==="http"){h0.type="http",h0.url=V;let v0={"Content-Type":"application/json"};if(f&&T){let j0=btoa(`${f}:${T}`);v0.Authorization=`Basic ${j0}`}h0.headers=v0}else{let v0=k.trim().split(/\s+/);h0.type="custom",h0.command=v0[0],h0.args=v0.slice(1).join(" ")}if(Object.keys(G0).length>0)h0.env=G0;if(n)h0.project_id=n;let z0=await G("/api/mcp/servers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(h0)});if(!z0.ok){let v0=await z0.json();r(v0.error||"Failed to add server"),g(!1);return}H()}catch(h0){r("Failed to add server"),g(!1)}},B0=(G0,h0)=>{W("npm"),F(G0),M(h0)};return w.jsxDEV("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-[2px] z-50 flex items-center justify-center p-4",children:w.jsxDEV("div",{className:"bg-[#111] border border-[#1a1a1a] rounded-lg w-full max-w-lg max-h-[90vh] overflow-y-auto",children:[w.jsxDEV("div",{className:"p-4 border-b border-[#1a1a1a] flex items-center justify-between sticky top-0 bg-[#111]",children:[w.jsxDEV("h2",{className:"text-lg font-semibold",children:"Add MCP Server"},void 0,!1,void 0,this),w.jsxDEV("button",{onClick:Y,className:"text-[#666] hover:text-[#888]",children:"✕"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),w.jsxDEV("div",{className:"p-4 space-y-4",children:[w.jsxDEV("div",{children:[w.jsxDEV("p",{className:"text-sm text-[#666] mb-2",children:"Quick add:"},void 0,!1,void 0,this),w.jsxDEV("div",{className:"flex flex-wrap gap-2",children:[{name:"filesystem",pkg:"@modelcontextprotocol/server-filesystem",type:"npm"},{name:"fetch",pkg:"@modelcontextprotocol/server-fetch",type:"npm"},{name:"memory",pkg:"@modelcontextprotocol/server-memory",type:"npm"},{name:"github",pkg:"@modelcontextprotocol/server-github",type:"npm"},{name:"time",pkg:"mcp-server-time",module:"mcp_server_time",type:"pip"}].map((G0)=>w.jsxDEV("button",{onClick:()=>{if(W(G0.type),F(G0.name),M(G0.pkg),G0.type==="pip"&&"module"in G0)R(G0.module||"");else R("")},className:"text-sm bg-[#1a1a1a] hover:bg-[#222] px-3 py-1 rounded transition",children:G0.name},G0.name,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),w.jsxDEV("div",{className:"flex gap-1 bg-[#0a0a0a] border border-[#222] rounded p-1",children:[w.jsxDEV("button",{onClick:()=>W("npm"),className:`flex-1 px-2 py-1.5 rounded text-sm transition ${_==="npm"?"bg-[#1a1a1a] text-white":"text-[#666] hover:text-[#888]"}`,children:"npm"},void 0,!1,void 0,this),w.jsxDEV("button",{onClick:()=>W("pip"),className:`flex-1 px-2 py-1.5 rounded text-sm transition ${_==="pip"?"bg-[#1a1a1a] text-white":"text-[#666] hover:text-[#888]"}`,children:"pip"},void 0,!1,void 0,this),w.jsxDEV("button",{onClick:()=>W("command"),className:`flex-1 px-2 py-1.5 rounded text-sm transition ${_==="command"?"bg-[#1a1a1a] text-white":"text-[#666] hover:text-[#888]"}`,children:"Command"},void 0,!1,void 0,this),w.jsxDEV("button",{onClick:()=>W("http"),className:`flex-1 px-2 py-1.5 rounded text-sm transition ${_==="http"?"bg-[#1a1a1a] text-white":"text-[#666] hover:text-[#888]"}`,children:"HTTP"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),w.jsxDEV("div",{children:[w.jsxDEV("label",{className:"block text-sm text-[#666] mb-1",children:"Name"},void 0,!1,void 0,this),w.jsxDEV("input",{type:"text",value:O,onChange:(G0)=>F(G0.target.value),placeholder:"e.g., pushover",className:"w-full bg-[#0a0a0a] border border-[#333] rounded px-3 py-2 focus:outline-none focus:border-[#f97316]"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),U0&&w.jsxDEV("div",{children:[w.jsxDEV("label",{className:"block text-sm text-[#666] mb-1",children:"Scope"},void 0,!1,void 0,this),w.jsxDEV(t4,{value:n||"",onChange:(G0)=>c(G0||null),options:[{value:"",label:"Global (all projects)"},...B.map((G0)=>({value:G0.id,label:G0.name}))],placeholder:"Select scope..."},void 0,!1,void 0,this),w.jsxDEV("p",{className:"text-xs text-[#555] mt-1",children:"Global servers are available to all agents. Project-scoped servers are only available to agents in that project."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),_==="npm"&&w.jsxDEV("div",{children:[w.jsxDEV("label",{className:"block text-sm text-[#666] mb-1",children:"npm Package"},void 0,!1,void 0,this),w.jsxDEV("input",{type:"text",value:b,onChange:(G0)=>a(G0.target.value),placeholder:"e.g., @modelcontextprotocol/server-filesystem or paste full command",className:"w-full bg-[#0a0a0a] border border-[#333] rounded px-3 py-2 focus:outline-none focus:border-[#f97316]"},void 0,!1,void 0,this),w.jsxDEV("p",{className:"text-xs text-[#555] mt-1",children:"Package name or paste a full npx command with credentials"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),_==="pip"&&w.jsxDEV("div",{className:"space-y-4",children:[w.jsxDEV("div",{children:[w.jsxDEV("label",{className:"block text-sm text-[#666] mb-1",children:"pip Package"},void 0,!1,void 0,this),w.jsxDEV("input",{type:"text",value:b,onChange:(G0)=>{if(M(G0.target.value),!A&&G0.target.value){let h0=G0.target.value.split("[")[0].replace(/-/g,".");R(h0)}},placeholder:"e.g., late-sdk[mcp]",className:"w-full bg-[#0a0a0a] border border-[#333] rounded px-3 py-2 focus:outline-none focus:border-[#f97316]"},void 0,!1,void 0,this),w.jsxDEV("p",{className:"text-xs text-[#555] mt-1",children:"Python package with extras, e.g., late-sdk[mcp] or mcp-server-time"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),w.jsxDEV("div",{children:[w.jsxDEV("label",{className:"block text-sm text-[#666] mb-1",children:"Module (optional)"},void 0,!1,void 0,this),w.jsxDEV("input",{type:"text",value:A,onChange:(G0)=>R(G0.target.value),placeholder:"e.g., late.mcp",className:"w-full bg-[#0a0a0a] border border-[#333] rounded px-3 py-2 font-mono text-sm focus:outline-none focus:border-[#f97316]"},void 0,!1,void 0,this),w.jsxDEV("p",{className:"text-xs text-[#555] mt-1",children:"Python module to run with -m. Auto-detected from package name if not specified."},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),_==="command"&&w.jsxDEV("div",{children:[w.jsxDEV("label",{className:"block text-sm text-[#666] mb-1",children:"Command"},void 0,!1,void 0,this),w.jsxDEV("input",{type:"text",value:k,onChange:(G0)=>P0(G0.target.value),placeholder:"e.g., npx -y pushover-mcp@latest start --token YOUR_TOKEN",className:"w-full bg-[#0a0a0a] border border-[#333] rounded px-3 py-2 font-mono text-sm focus:outline-none focus:border-[#f97316]"},void 0,!1,void 0,this),w.jsxDEV("p",{className:"text-xs text-[#555] mt-1",children:"Paste the full command - credentials like YOUR_TOKEN will be auto-extracted"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),_==="http"&&w.jsxDEV("div",{className:"space-y-4",children:[w.jsxDEV("div",{children:[w.jsxDEV("label",{className:"block text-sm text-[#666] mb-1",children:"URL"},void 0,!1,void 0,this),w.jsxDEV("input",{type:"text",value:V,onChange:(G0)=>x(G0.target.value),placeholder:"e.g., https://example.com/wp-json/mcp/v1/messages",className:"w-full bg-[#0a0a0a] border border-[#333] rounded px-3 py-2 font-mono text-sm focus:outline-none focus:border-[#f97316]"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),w.jsxDEV("div",{className:"p-3 bg-[#0a0a0a] border border-[#222] rounded",children:[w.jsxDEV("p",{className:"text-xs text-[#666] mb-3",children:"Optional: Basic Auth credentials (will be encoded and stored securely)"},void 0,!1,void 0,this),w.jsxDEV("div",{className:"grid grid-cols-2 gap-3",children:[w.jsxDEV("div",{children:[w.jsxDEV("label",{className:"block text-xs text-[#555] mb-1",children:"Username"},void 0,!1,void 0,this),w.jsxDEV("input",{type:"text",value:f,onChange:(G0)=>l(G0.target.value),placeholder:"username",className:"w-full bg-[#111] border border-[#333] rounded px-3 py-2 text-sm focus:outline-none focus:border-[#f97316]"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),w.jsxDEV("div",{children:[w.jsxDEV("label",{className:"block text-xs text-[#555] mb-1",children:"Password"},void 0,!1,void 0,this),w.jsxDEV("input",{type:"password",value:T,onChange:(G0)=>m(G0.target.value),placeholder:"password or app key",className:"w-full bg-[#111] border border-[#333] rounded px-3 py-2 text-sm focus:outline-none focus:border-[#f97316]"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),w.jsxDEV("div",{children:[w.jsxDEV("div",{className:"flex items-center justify-between mb-2",children:[w.jsxDEV("label",{className:"text-sm text-[#666]",children:"Environment Variables / Credentials"},void 0,!1,void 0,this),w.jsxDEV("button",{onClick:R0,className:"text-xs text-[#f97316] hover:text-[#fb923c] transition",children:"+ Add Variable"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),E.length===0&&w.jsxDEV("p",{className:"text-xs text-[#555] bg-[#0a0a0a] border border-[#222] rounded p-3",children:"Add environment variables for API tokens and credentials. These are stored encrypted and passed to the server at startup."},void 0,!1,void 0,this),E.length>0&&w.jsxDEV("div",{className:"space-y-2",children:E.map((G0,h0)=>w.jsxDEV("div",{className:"flex gap-2",children:[w.jsxDEV("input",{type:"text",value:G0.key,onChange:(z0)=>_0(h0,"key",z0.target.value),placeholder:"KEY",className:"w-1/3 bg-[#0a0a0a] border border-[#333] rounded px-2 py-1.5 text-sm font-mono focus:outline-none focus:border-[#f97316]"},void 0,!1,void 0,this),w.jsxDEV("input",{type:"password",value:G0.value,onChange:(z0)=>_0(h0,"value",z0.target.value),placeholder:"value",className:"flex-1 bg-[#0a0a0a] border border-[#333] rounded px-2 py-1.5 text-sm font-mono focus:outline-none focus:border-[#f97316]"},void 0,!1,void 0,this),w.jsxDEV("button",{onClick:()=>f0(h0),className:"text-[#666] hover:text-red-400 px-2 transition",children:"✕"},void 0,!1,void 0,this)]},h0,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Q0&&w.jsxDEV("p",{className:"text-red-400 text-sm",children:Q0},void 0,!1,void 0,this)]},void 0,!0,void 0,this),w.jsxDEV("div",{className:"p-4 border-t border-[#1a1a1a] flex justify-end gap-2 sticky bottom-0 bg-[#111]",children:[w.jsxDEV("button",{onClick:Y,className:"px-4 py-2 border border-[#333] hover:border-[#666] rounded transition",children:"Cancel"},void 0,!1,void 0,this),w.jsxDEV("button",{onClick:Y0,disabled:j||!O||(_==="npm"?!b:_==="pip"?!b:_==="http"?!V:!k),className:"px-4 py-2 bg-[#f97316] hover:bg-[#fb923c] text-black rounded font-medium transition disabled:opacity-50",children:j?"Adding...":"Add Server"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}function fT({server:Y,projects:H,onClose:B,onSaved:K}){let{authFetch:G}=A1(),[_,W]=r0.useState(Y.name),[O,F]=r0.useState(Y.package||""),[b,M]=r0.useState(Y.command||""),[A,R]=r0.useState(Y.args||""),[k,S]=r0.useState(Y.url||""),[V,x]=r0.useState(()=>{let P0=Y.headers?.Authorization||"";if(P0.startsWith("Basic "))try{return atob(P0.slice(6)).split(":")[0]||""}catch{return""}return""}),[f,l]=r0.useState(()=>{let P0=Y.headers?.Authorization||"";if(P0.startsWith("Basic "))try{return atob(P0.slice(6)).split(":").slice(1).join(":")||""}catch{return""}return""}),[T,m]=r0.useState(()=>{return Object.entries(Y.env||{}).map(([P0,a])=>({key:P0,value:a}))}),[E,D]=r0.useState(Y.project_id),[n,c]=r0.useState(!1),[j,g]=r0.useState(null),Q0=H&&H.length>0,r=Y.type==="http",U0=()=>{m([...T,{key:"",value:""}])},R0=(P0,a,Y0)=>{let B0=[...T];B0[P0][a]=Y0,m(B0)},_0=(P0)=>{m(T.filter((a,Y0)=>Y0!==P0))},f0=async()=>{if(!_.trim()){g("Name is required");return}c(!0),g(null);let P0={};for(let{key:a,value:Y0}of T)if(a.trim())P0[a.trim()]=Y0;try{let a={name:_.trim(),env:P0};if(r){if(k.trim())a.url=k.trim();let B0={"Content-Type":"application/json"};if(V&&f){let G0=btoa(`${V}:${f}`);B0.Authorization=`Basic ${G0}`}a.headers=B0}else{if(Y.type==="npm"&&O.trim())a.package=O.trim();if(Y.type==="pip"&&O.trim())a.package=O.trim();if(Y.type==="custom"){if(b.trim())a.command=b.trim();if(A.trim())a.args=A.trim()}}a.project_id=E;let Y0=await G(`/api/mcp/servers/${Y.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)});if(!Y0.ok){let B0=await Y0.json();g(B0.error||"Failed to save changes"),c(!1);return}if(Y.status==="running"&&!r)try{await G(`/api/mcp/servers/${Y.id}/stop`,{method:"POST"}),await G(`/api/mcp/servers/${Y.id}/start`,{method:"POST"})}catch(B0){console.error("Failed to restart server:",B0)}K()}catch(a){g("Failed to save changes"),c(!1)}};return w.jsxDEV("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-[2px] z-50 flex items-center justify-center p-4",children:w.jsxDEV("div",{className:"bg-[#111] border border-[#1a1a1a] rounded-lg w-full max-w-lg max-h-[90vh] overflow-y-auto",children:[w.jsxDEV("div",{className:"p-4 border-b border-[#1a1a1a] flex items-center justify-between sticky top-0 bg-[#111]",children:[w.jsxDEV("h2",{className:"text-lg font-semibold",children:"Edit MCP Server"},void 0,!1,void 0,this),w.jsxDEV("button",{onClick:B,className:"text-[#666] hover:text-[#888]",children:"✕"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),w.jsxDEV("div",{className:"p-4 space-y-4",children:[w.jsxDEV("div",{className:"text-sm text-[#666] bg-[#0a0a0a] border border-[#222] rounded p-3",children:["Type: ",w.jsxDEV("span",{className:"text-[#888]",children:Y.type},void 0,!1,void 0,this),Y.package&&w.jsxDEV(w.Fragment,{children:[" • Package: ",w.jsxDEV("span",{className:"text-[#888] font-mono",children:Y.package},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Y.command&&w.jsxDEV(w.Fragment,{children:[" • Command: ",w.jsxDEV("span",{className:"text-[#888] font-mono",children:Y.command},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),w.jsxDEV("div",{children:[w.jsxDEV("label",{className:"block text-sm text-[#666] mb-1",children:"Name"},void 0,!1,void 0,this),w.jsxDEV("input",{type:"text",value:_,onChange:(P0)=>W(P0.target.value),className:"w-full bg-[#0a0a0a] border border-[#333] rounded px-3 py-2 focus:outline-none focus:border-[#f97316]"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Q0&&w.jsxDEV("div",{children:[w.jsxDEV("label",{className:"block text-sm text-[#666] mb-1",children:"Scope"},void 0,!1,void 0,this),w.jsxDEV(t4,{value:E||"",onChange:(P0)=>D(P0||null),options:[{value:"",label:"Global (all projects)"},...H.map((P0)=>({value:P0.id,label:P0.name}))],placeholder:"Select scope..."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Y.type==="npm"&&w.jsxDEV("div",{children:[w.jsxDEV("label",{className:"block text-sm text-[#666] mb-1",children:"npm Package"},void 0,!1,void 0,this),w.jsxDEV("input",{type:"text",value:O,onChange:(P0)=>F(P0.target.value),className:"w-full bg-[#0a0a0a] border border-[#333] rounded px-3 py-2 font-mono text-sm focus:outline-none focus:border-[#f97316]"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Y.type==="pip"&&w.jsxDEV("div",{children:[w.jsxDEV("label",{className:"block text-sm text-[#666] mb-1",children:"pip Package"},void 0,!1,void 0,this),w.jsxDEV("input",{type:"text",value:O,onChange:(P0)=>F(P0.target.value),className:"w-full bg-[#0a0a0a] border border-[#333] rounded px-3 py-2 font-mono text-sm focus:outline-none focus:border-[#f97316]"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),r&&w.jsxDEV(w.Fragment,{children:[w.jsxDEV("div",{children:[w.jsxDEV("label",{className:"block text-sm text-[#666] mb-1",children:"Server URL"},void 0,!1,void 0,this),w.jsxDEV("input",{type:"text",value:k,onChange:(P0)=>S(P0.target.value),placeholder:"https://example.com/mcp",className:"w-full bg-[#0a0a0a] border border-[#333] rounded px-3 py-2 font-mono text-sm focus:outline-none focus:border-[#f97316]"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),w.jsxDEV("div",{children:[w.jsxDEV("label",{className:"block text-sm text-[#666] mb-1",children:"Authentication (Basic Auth)"},void 0,!1,void 0,this),w.jsxDEV("div",{className:"flex gap-2",children:[w.jsxDEV("input",{type:"text",value:V,onChange:(P0)=>x(P0.target.value),placeholder:"Username",className:"flex-1 bg-[#0a0a0a] border border-[#333] rounded px-3 py-2 text-sm focus:outline-none focus:border-[#f97316]"},void 0,!1,void 0,this),w.jsxDEV("input",{type:"password",value:f,onChange:(P0)=>l(P0.target.value),placeholder:"Password / App Password",className:"flex-1 bg-[#0a0a0a] border border-[#333] rounded px-3 py-2 text-sm focus:outline-none focus:border-[#f97316]"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),w.jsxDEV("p",{className:"text-xs text-[#555] mt-1",children:"Leave empty if no authentication required"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),Y.type==="custom"&&w.jsxDEV(w.Fragment,{children:[w.jsxDEV("div",{children:[w.jsxDEV("label",{className:"block text-sm text-[#666] mb-1",children:"Command"},void 0,!1,void 0,this),w.jsxDEV("input",{type:"text",value:b,onChange:(P0)=>M(P0.target.value),className:"w-full bg-[#0a0a0a] border border-[#333] rounded px-3 py-2 font-mono text-sm focus:outline-none focus:border-[#f97316]"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),w.jsxDEV("div",{children:[w.jsxDEV("label",{className:"block text-sm text-[#666] mb-1",children:"Arguments"},void 0,!1,void 0,this),w.jsxDEV("input",{type:"text",value:A,onChange:(P0)=>R(P0.target.value),placeholder:"e.g., --token $TOKEN --verbose",className:"w-full bg-[#0a0a0a] border border-[#333] rounded px-3 py-2 font-mono text-sm focus:outline-none focus:border-[#f97316]"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),!r&&w.jsxDEV("div",{children:[w.jsxDEV("div",{className:"flex items-center justify-between mb-2",children:[w.jsxDEV("label",{className:"text-sm text-[#666]",children:"Environment Variables / Credentials"},void 0,!1,void 0,this),w.jsxDEV("button",{onClick:U0,className:"text-xs text-[#f97316] hover:text-[#fb923c] transition",children:"+ Add Variable"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),T.length===0&&w.jsxDEV("p",{className:"text-xs text-[#555] bg-[#0a0a0a] border border-[#222] rounded p-3",children:"No environment variables configured."},void 0,!1,void 0,this),T.length>0&&w.jsxDEV("div",{className:"space-y-2",children:T.map((P0,a)=>w.jsxDEV("div",{className:"flex gap-2",children:[w.jsxDEV("input",{type:"text",value:P0.key,onChange:(Y0)=>R0(a,"key",Y0.target.value),placeholder:"KEY",className:"w-1/3 bg-[#0a0a0a] border border-[#333] rounded px-2 py-1.5 text-sm font-mono focus:outline-none focus:border-[#f97316]"},void 0,!1,void 0,this),w.jsxDEV("input",{type:"password",value:P0.value,onChange:(Y0)=>R0(a,"value",Y0.target.value),placeholder:"value",className:"flex-1 bg-[#0a0a0a] border border-[#333] rounded px-2 py-1.5 text-sm font-mono focus:outline-none focus:border-[#f97316]"},void 0,!1,void 0,this),w.jsxDEV("button",{onClick:()=>_0(a),className:"text-[#666] hover:text-red-400 px-2 transition",children:"✕"},void 0,!1,void 0,this)]},a,!0,void 0,this))},void 0,!1,void 0,this),w.jsxDEV("p",{className:"text-xs text-[#555] mt-2",children:Y.status==="running"?"Server will be automatically restarted to apply changes.":"Changes will take effect when the server is started."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),j&&w.jsxDEV("p",{className:"text-red-400 text-sm",children:j},void 0,!1,void 0,this)]},void 0,!0,void 0,this),w.jsxDEV("div",{className:"p-4 border-t border-[#1a1a1a] flex justify-end gap-2 sticky bottom-0 bg-[#111]",children:[w.jsxDEV("button",{onClick:B,className:"px-4 py-2 border border-[#333] hover:border-[#666] rounded transition",children:"Cancel"},void 0,!1,void 0,this),w.jsxDEV("button",{onClick:f0,disabled:n||!_.trim(),className:"px-4 py-2 bg-[#f97316] hover:bg-[#fb923c] text-black rounded font-medium transition disabled:opacity-50",children:n?"Saving...":"Save Changes"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}var $4=H0(D1(),1);var t=H0(H1(),1);function LG(){let{authFetch:Y}=A1(),{projects:H,currentProjectId:B}=G4(),[K,G]=$4.useState([]),[_,W]=$4.useState(!0),[O,F]=$4.useState("installed"),[b,M]=$4.useState(!1),[A,R]=$4.useState(!1),[k,S]=$4.useState(null),{confirm:V,ConfirmDialog:x}=a5(),{alert:f,AlertDialog:l}=gX(),T=H.length>0,[m,E]=$4.useState(""),[D,n]=$4.useState([]),[c,j]=$4.useState(!1),[g,Q0]=$4.useState(null),[r,U0]=$4.useState(""),[R0,_0]=$4.useState([]),[f0,P0]=$4.useState(!1),[a,Y0]=$4.useState(null),[B0,G0]=$4.useState(null),[h0,z0]=$4.useState(null),[v0,j0]=$4.useState(B&&B!=="unassigned"?B:null),Y1=K.filter((A0)=>{if(!B)return!0;if(B==="unassigned")return A0.project_id===null;return A0.project_id===null||A0.project_id===B}),m0=async()=>{try{let Z1=await(await Y("/api/skills")).json();G(Z1.skills||[])}catch(A0){console.error("Failed to fetch skills:",A0)}W(!1)},F1=async(A0)=>{j(!0);try{let Z1=A0!==void 0?A0:m,h1=Z1?`/api/skills/marketplace/search?q=${encodeURIComponent(Z1)}`:"/api/skills/marketplace/featured",f4=await(await Y(h1)).json();n(f4.skills||[])}catch(Z1){console.error("Failed to search marketplace:",Z1)}j(!1)};$4.useEffect(()=>{m0()},[Y]),$4.useEffect(()=>{if(O==="marketplace"&&D.length===0)F1("")},[O]);let R1=async(A0)=>{try{await Y(`/api/skills/${A0}/toggle`,{method:"POST"}),m0()}catch(Z1){console.error("Failed to toggle skill:",Z1)}},p=async(A0)=>{if(!await V("Delete this skill?",{confirmText:"Delete",title:"Delete Skill"}))return;try{if(await Y(`/api/skills/${A0}`,{method:"DELETE"}),k?.id===A0)S(null);m0()}catch(h1){console.error("Failed to delete skill:",h1)}},O0=async(A0)=>{Q0(A0.id);try{let Z1=await Y(`/api/skills/marketplace/${A0.id}/install`,{method:"POST"}),h1=await Z1.json();if(Z1.ok)await f(`Installed "${A0.name}" successfully!`,{title:"Skill Installed"}),m0(),F("installed");else await f(h1.error||"Failed to install skill",{title:"Installation Failed"})}catch(Z1){console.error("Failed to install skill:",Z1),await f("Failed to install skill",{title:"Error"})}Q0(null)},V0=(A0)=>K.some((Z1)=>Z1.name===A0),q1=async(A0)=>{let Z1=A0||r;if(!Z1.trim())return;let h1="",n1="";if(Z1.includes("github.com")){let f4=Z1.match(/github\.com\/([^/]+)\/([^/]+)/);if(f4)h1=f4[1],n1=f4[2].replace(/\.git$/,"")}else if(Z1.includes("/")){let f4=Z1.split("/");h1=f4[0],n1=f4[1]}if(!h1||!n1){Y0("Invalid repo format. Use 'owner/repo' or GitHub URL");return}P0(!0),Y0(null),_0([]),G0(null);try{let f4=await Y(`/api/skills/github/${h1}/${n1}`),B4=await f4.json();if(!f4.ok){Y0(B4.error||"Failed to fetch repository"),P0(!1);return}_0(B4.skills||[]),G0(B4.repo||null)}catch(f4){Y0("Failed to fetch repository")}P0(!1)},y1=async(A0)=>{if(!B0)return;z0(A0.name);try{let Z1=await Y("/api/skills/github/install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({owner:B0.owner,repo:B0.repo,skillName:A0.name,downloadUrl:A0.downloadUrl,projectId:v0})}),h1=await Z1.json();if(Z1.ok)await f(`Installed "${A0.name}" successfully!`,{title:"Skill Installed"}),m0();else await f(h1.error||"Failed to install skill",{title:"Installation Failed",variant:"error"})}catch(Z1){await f("Failed to install skill",{title:"Error",variant:"error"})}z0(null)},M1=async()=>{if(!B0||R0.length===0)return;let A0=R0.filter((n1)=>!V0(n1.name));if(A0.length===0){await f("All skills are already installed",{title:"Info"});return}if(!await V(`Install ${A0.length} skill(s) from ${B0.owner}/${B0.repo}?`,{confirmText:"Install All",title:"Install Skills"}))return;let h1=0;for(let n1 of A0){z0(n1.name);try{if((await Y("/api/skills/github/install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({owner:B0.owner,repo:B0.repo,skillName:n1.name,downloadUrl:n1.downloadUrl,projectId:v0})})).ok)h1++}catch(f4){}}z0(null),m0(),await f(`Installed ${h1} of ${A0.length} skills`,{title:"Installation Complete"})};return t.jsxDEV(t.Fragment,{children:[x,l,t.jsxDEV("div",{className:"flex-1 overflow-auto p-6",children:t.jsxDEV("div",{className:"max-w-6xl",children:[t.jsxDEV("div",{className:"flex items-center justify-between mb-6",children:[t.jsxDEV("div",{children:[t.jsxDEV("h1",{className:"text-2xl font-semibold mb-1",children:"Skills"},void 0,!1,void 0,this),t.jsxDEV("p",{className:"text-[#666]",children:"Manage agent skills - instructions that teach agents how to perform tasks."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),O==="installed"&&t.jsxDEV("div",{className:"flex gap-2",children:[t.jsxDEV("button",{onClick:()=>R(!0),className:"bg-[#1a1a1a] hover:bg-[#222] text-white px-4 py-2 rounded font-medium transition border border-[#333]",children:"Import"},void 0,!1,void 0,this),t.jsxDEV("button",{onClick:()=>M(!0),className:"bg-[#f97316] hover:bg-[#fb923c] text-black px-4 py-2 rounded font-medium transition",children:"+ Create Skill"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),t.jsxDEV("div",{className:"flex gap-1 mb-6 bg-[#111] border border-[#1a1a1a] rounded-lg p-1 w-fit",children:[t.jsxDEV("button",{onClick:()=>F("installed"),className:`px-4 py-2 rounded text-sm font-medium transition ${O==="installed"?"bg-[#1a1a1a] text-white":"text-[#666] hover:text-[#888]"}`,children:["Installed (",Y1.length,")"]},void 0,!0,void 0,this),t.jsxDEV("button",{onClick:()=>F("github"),className:`px-4 py-2 rounded text-sm font-medium transition ${O==="github"?"bg-[#1a1a1a] text-white":"text-[#666] hover:text-[#888]"}`,children:"Browse GitHub"},void 0,!1,void 0,this),t.jsxDEV("button",{onClick:()=>F("marketplace"),className:`px-4 py-2 rounded text-sm font-medium transition ${O==="marketplace"?"bg-[#1a1a1a] text-white":"text-[#666] hover:text-[#888]"}`,children:"Marketplace"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),O==="installed"&&t.jsxDEV(t.Fragment,{children:_?t.jsxDEV("div",{className:"text-[#666]",children:"Loading skills..."},void 0,!1,void 0,this):K.length===0?t.jsxDEV("div",{className:"text-center py-20 text-[#666]",children:[t.jsxDEV("p",{className:"text-lg",children:"No skills installed"},void 0,!1,void 0,this),t.jsxDEV("p",{className:"text-sm mt-1",children:"Create a skill or browse the marketplace"},void 0,!1,void 0,this),t.jsxDEV("button",{onClick:()=>F("marketplace"),className:"mt-4 bg-[#f97316] hover:bg-[#fb923c] text-black px-4 py-2 rounded font-medium transition",children:"Browse Marketplace"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):Y1.length===0?t.jsxDEV("div",{className:"bg-[#111] border border-[#1a1a1a] rounded-lg p-6 text-center",children:t.jsxDEV("p",{className:"text-[#666]",children:"No skills match this filter."},void 0,!1,void 0,this)},void 0,!1,void 0,this):t.jsxDEV("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-3",children:Y1.map((A0)=>{let Z1=T&&A0.project_id?H.find((h1)=>h1.id===A0.project_id):null;return t.jsxDEV(hT,{skill:A0,project:Z1,onToggle:()=>R1(A0.id),onDelete:()=>p(A0.id),onView:()=>S(A0)},A0.id,!1,void 0,this)})},void 0,!1,void 0,this)},void 0,!1,void 0,this),O==="github"&&t.jsxDEV("div",{className:"space-y-6",children:[t.jsxDEV("form",{onSubmit:(A0)=>{A0.preventDefault(),q1()},className:"flex gap-2",children:[t.jsxDEV("input",{type:"text",value:r,onChange:(A0)=>U0(A0.target.value),placeholder:"Enter GitHub repo (e.g., WordPress/agent-skills)",className:"flex-1 bg-[#111] border border-[#333] rounded-lg px-4 py-3 focus:outline-none focus:border-[#f97316]"},void 0,!1,void 0,this),t.jsxDEV("button",{type:"submit",disabled:f0,className:"bg-[#f97316] hover:bg-[#fb923c] disabled:opacity-50 text-black px-6 py-3 rounded-lg font-medium transition",children:f0?"...":"Browse"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),T&&R0.length>0&&t.jsxDEV("div",{className:"flex items-center gap-3 p-3 bg-[#0a0a0a] border border-[#222] rounded-lg",children:[t.jsxDEV("span",{className:"text-sm text-[#666]",children:"Install to:"},void 0,!1,void 0,this),t.jsxDEV(t4,{value:v0||"",onChange:(A0)=>j0(A0||null),options:[{value:"",label:"Global (all projects)"},...H.map((A0)=>({value:A0.id,label:A0.name}))],placeholder:"Select scope..."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),a&&t.jsxDEV("div",{className:"text-red-400 text-sm p-3 bg-red-500/10 border border-red-500/20 rounded-lg",children:a},void 0,!1,void 0,this),B0&&R0.length>0&&t.jsxDEV("div",{className:"flex items-center justify-between",children:[t.jsxDEV("div",{className:"flex items-center gap-3",children:[t.jsxDEV("a",{href:B0.url,target:"_blank",rel:"noopener noreferrer",className:"text-[#f97316] hover:underline font-medium",children:[B0.owner,"/",B0.repo]},void 0,!0,void 0,this),t.jsxDEV("span",{className:"text-sm text-[#666]",children:[R0.length," skill",R0.length!==1?"s":""," found"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),R0.some((A0)=>!V0(A0.name))&&t.jsxDEV("button",{onClick:M1,disabled:!!h0,className:"text-sm bg-[#1a1a1a] hover:bg-[#222] border border-[#333] hover:border-[#f97316] px-4 py-2 rounded transition disabled:opacity-50",children:"Install All"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),f0&&t.jsxDEV("div",{className:"text-center py-8 text-[#666]",children:"Fetching skills from repository..."},void 0,!1,void 0,this),!f0&&!B0&&!a&&t.jsxDEV("div",{className:"bg-[#111] border border-[#1a1a1a] rounded-lg p-8 text-center",children:[t.jsxDEV("div",{className:"text-4xl mb-4",children:"\uD83D\uDCE6"},void 0,!1,void 0,this),t.jsxDEV("h3",{className:"text-lg font-medium mb-2",children:"Browse Skills from GitHub"},void 0,!1,void 0,this),t.jsxDEV("p",{className:"text-[#666] mb-6 max-w-md mx-auto",children:"Enter a GitHub repository to browse and install skills. Skills are markdown files with instructions that teach agents how to perform specific tasks."},void 0,!1,void 0,this),t.jsxDEV("div",{className:"flex flex-wrap gap-2 justify-center",children:[{label:"WordPress Skills",repo:"WordPress/agent-skills"}].map(({label:A0,repo:Z1})=>t.jsxDEV("button",{onClick:()=>{U0(Z1),q1(Z1)},className:"text-sm bg-[#1a1a1a] hover:bg-[#222] border border-[#333] hover:border-[#f97316] px-3 py-1.5 rounded transition",children:A0},Z1,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),!f0&&B0&&R0.length===0&&t.jsxDEV("div",{className:"text-center py-8 text-[#666]",children:"No skills found in this repository. Skills should be in subdirectories with a SKILL.md file."},void 0,!1,void 0,this),R0.length>0&&t.jsxDEV("div",{className:"grid gap-4 md:grid-cols-2",children:R0.map((A0)=>{let Z1=V0(A0.name),h1=h0===A0.name;return t.jsxDEV("div",{className:`bg-[#111] border rounded-lg p-4 transition ${Z1?"border-green-500/30":"border-[#1a1a1a] hover:border-[#333]"}`,children:t.jsxDEV("div",{className:"flex items-start justify-between gap-3",children:[t.jsxDEV("div",{className:"flex-1 min-w-0",children:[t.jsxDEV("div",{className:"flex items-center gap-2",children:[t.jsxDEV("h3",{className:"font-medium truncate",children:A0.name},void 0,!1,void 0,this),Z1&&t.jsxDEV("span",{className:"text-xs text-green-400",children:"✓ Installed"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),t.jsxDEV("p",{className:"text-sm text-[#666] mt-1 line-clamp-2",children:A0.description||"No description"},void 0,!1,void 0,this),t.jsxDEV("div",{className:"flex items-center gap-2 mt-2 text-xs text-[#555]",children:[t.jsxDEV("span",{children:[(A0.size/1024).toFixed(1),"KB"]},void 0,!0,void 0,this),t.jsxDEV("span",{className:"px-1.5 py-0.5 rounded bg-blue-500/10 text-blue-400",children:"GitHub"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),t.jsxDEV("div",{className:"flex-shrink-0",children:Z1?t.jsxDEV("span",{className:"text-xs text-[#555] px-3 py-1.5",children:"Added"},void 0,!1,void 0,this):t.jsxDEV("button",{onClick:()=>y1(A0),disabled:h1,className:"text-sm bg-[#1a1a1a] hover:bg-[#222] border border-[#333] hover:border-[#f97316] px-3 py-1.5 rounded transition disabled:opacity-50",children:h1?"Installing...":"Install"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},A0.name,!1,void 0,this)})},void 0,!1,void 0,this),t.jsxDEV("div",{className:"p-4 bg-[#111] border border-[#1a1a1a] rounded-lg text-sm text-[#666]",children:t.jsxDEV("p",{children:["Skills are sourced from GitHub repositories. Each skill should be in its own directory with a"," ",t.jsxDEV("code",{className:"text-[#888] bg-[#0a0a0a] px-1 rounded",children:"SKILL.md"},void 0,!1,void 0,this)," file containing instructions."]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),O==="marketplace"&&t.jsxDEV(t.Fragment,{children:[t.jsxDEV("div",{className:"mb-6",children:t.jsxDEV("div",{className:"flex gap-2",children:[t.jsxDEV("input",{type:"text",value:m,onChange:(A0)=>E(A0.target.value),onKeyDown:(A0)=>A0.key==="Enter"&&F1(),placeholder:"Search skills...",className:"flex-1 bg-[#111] border border-[#1a1a1a] rounded px-4 py-2 focus:outline-none focus:border-[#f97316]"},void 0,!1,void 0,this),t.jsxDEV("button",{onClick:()=>F1(),disabled:c,className:"bg-[#1a1a1a] hover:bg-[#222] text-white px-4 py-2 rounded font-medium transition border border-[#333]",children:c?"...":"Search"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),c?t.jsxDEV("div",{className:"text-[#666]",children:"Loading..."},void 0,!1,void 0,this):D.length===0?t.jsxDEV("div",{className:"text-center py-20 text-[#666]",children:[t.jsxDEV("p",{className:"text-lg",children:"No skills found"},void 0,!1,void 0,this),t.jsxDEV("p",{className:"text-sm mt-1",children:"Try a different search term"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):t.jsxDEV("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-3",children:D.map((A0)=>t.jsxDEV(yT,{skill:A0,installed:V0(A0.name),installing:g===A0.id,onInstall:()=>O0(A0)},A0.id,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),b&&t.jsxDEV(VT,{authFetch:Y,onClose:()=>M(!1),onCreated:()=>{M(!1),m0()},projects:T?H:void 0,defaultProjectId:B&&B!=="unassigned"?B:null},void 0,!1,void 0,this),A&&t.jsxDEV(DT,{authFetch:Y,onClose:()=>R(!1),onImported:()=>{R(!1),m0()}},void 0,!1,void 0,this),k&&t.jsxDEV(mT,{skill:k,authFetch:Y,onClose:()=>S(null),onUpdated:()=>{S(null),m0()}},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function hT({skill:Y,project:H,onToggle:B,onDelete:K,onView:G}){let _={local:"Local",skillsmp:"SkillsMP",github:"GitHub",import:"Imported"}[Y.source],W=()=>{if(H)return t.jsxDEV("span",{className:"text-xs px-1.5 py-0.5 rounded",style:{backgroundColor:`${H.color}20`,color:H.color},children:H.name},void 0,!1,void 0,this);if(Y.project_id===null)return t.jsxDEV("span",{className:"text-xs text-[#666] bg-[#1a1a1a] px-1.5 py-0.5 rounded",children:"Global"},void 0,!1,void 0,this);return null};return t.jsxDEV("div",{className:`bg-[#111] rounded-lg p-5 border transition cursor-pointer ${Y.enabled?"border-[#1a1a1a]":"border-[#1a1a1a] opacity-60"} hover:border-[#333]`,onClick:G,children:[t.jsxDEV("div",{className:"flex items-start justify-between mb-3",children:[t.jsxDEV("div",{className:"flex-1 min-w-0",children:[t.jsxDEV("div",{className:"flex items-center gap-2",children:[t.jsxDEV("h3",{className:"font-semibold text-lg truncate",children:Y.name},void 0,!1,void 0,this),W()]},void 0,!0,void 0,this),t.jsxDEV("p",{className:"text-xs text-[#666] flex items-center gap-2 mt-0.5",children:[t.jsxDEV("span",{className:`px-1.5 py-0.5 rounded text-[10px] ${Y.source==="skillsmp"?"bg-purple-500/20 text-purple-400":Y.source==="github"?"bg-blue-500/20 text-blue-400":"bg-[#222] text-[#888]"}`,children:_},void 0,!1,void 0,this),Y.metadata?.version&&t.jsxDEV("span",{children:["v",Y.metadata.version]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),t.jsxDEV("button",{onClick:(O)=>{O.stopPropagation(),B()},className:`w-10 h-5 rounded-full transition-colors relative ${Y.enabled?"bg-[#f97316]":"bg-[#333]"}`,children:t.jsxDEV("span",{className:`absolute top-0.5 w-4 h-4 rounded-full bg-white transition-transform ${Y.enabled?"left-5":"left-0.5"}`},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),t.jsxDEV("p",{className:"text-sm text-[#888] line-clamp-2 mb-4",children:Y.description},void 0,!1,void 0,this),t.jsxDEV("div",{className:"flex items-center justify-between",children:[t.jsxDEV("div",{className:"flex gap-1 flex-wrap",children:[Y.allowed_tools.slice(0,2).map((O)=>t.jsxDEV("span",{className:"text-xs bg-[#222] px-2 py-0.5 rounded text-[#666]",children:O},O,!1,void 0,this)),Y.allowed_tools.length>2&&t.jsxDEV("span",{className:"text-xs text-[#666]",children:["+",Y.allowed_tools.length-2]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),t.jsxDEV("button",{onClick:(O)=>{O.stopPropagation(),K()},className:"text-red-400 hover:text-red-300 text-sm",children:"Delete"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function yT({skill:Y,installed:H,installing:B,onInstall:K}){return t.jsxDEV("div",{className:"bg-[#111] rounded-lg p-5 border border-[#1a1a1a] hover:border-[#333] transition",children:[t.jsxDEV("div",{className:"flex items-start justify-between mb-3",children:[t.jsxDEV("div",{className:"flex-1 min-w-0",children:[t.jsxDEV("h3",{className:"font-semibold text-lg truncate",children:Y.name},void 0,!1,void 0,this),t.jsxDEV("p",{className:"text-xs text-[#666] mt-0.5",children:["by ",Y.author," · v",Y.version]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),t.jsxDEV("div",{className:"flex items-center gap-1 text-yellow-500 text-sm",children:["★ ",Y.rating.toFixed(1)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),t.jsxDEV("p",{className:"text-sm text-[#888] line-clamp-2 mb-4",children:Y.description},void 0,!1,void 0,this),t.jsxDEV("div",{className:"flex items-center justify-between",children:[t.jsxDEV("div",{className:"flex gap-1 flex-wrap",children:Y.tags.slice(0,3).map((G)=>t.jsxDEV("span",{className:"text-xs bg-[#222] px-2 py-0.5 rounded text-[#666]",children:G},G,!1,void 0,this))},void 0,!1,void 0,this),H?t.jsxDEV("span",{className:"text-green-400 text-sm",children:"✓ Installed"},void 0,!1,void 0,this):t.jsxDEV("button",{onClick:K,disabled:B,className:"bg-[#f97316] hover:bg-[#fb923c] disabled:opacity-50 text-black px-3 py-1 rounded text-sm font-medium transition",children:B?"Installing...":"Install"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),t.jsxDEV("div",{className:"mt-3 text-xs text-[#555]",children:[Y.downloads.toLocaleString()," downloads"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function VT({authFetch:Y,onClose:H,onCreated:B,projects:K,defaultProjectId:G}){let[_,W]=$4.useState(""),[O,F]=$4.useState(""),[b,M]=$4.useState(""),[A,R]=$4.useState(G||null),[k,S]=$4.useState(!1),[V,x]=$4.useState(null),f=K&&K.length>0,l=async()=>{if(!_||!O||!b){x("All fields are required");return}S(!0),x(null);try{let T={name:_,description:O,content:b,source:"local"};if(A)T.project_id=A;let m=await Y("/api/skills",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(T)}),E=await m.json();if(!m.ok){x(E.error||"Failed to create skill"),S(!1);return}B()}catch(T){x("Failed to create skill"),S(!1)}};return t.jsxDEV("div",{className:"fixed inset-0 bg-black/60 flex items-center justify-center z-50 p-4",onClick:H,children:t.jsxDEV("div",{className:"bg-[#111] border border-[#1a1a1a] rounded-lg w-full max-w-2xl max-h-[90vh] overflow-auto",onClick:(T)=>T.stopPropagation(),children:[t.jsxDEV("div",{className:"p-6 border-b border-[#1a1a1a]",children:t.jsxDEV("h2",{className:"text-xl font-semibold",children:"Create Skill"},void 0,!1,void 0,this)},void 0,!1,void 0,this),t.jsxDEV("div",{className:"p-6 space-y-4",children:[V&&t.jsxDEV("div",{className:"bg-red-500/10 border border-red-500/30 rounded p-3 text-red-400 text-sm",children:V},void 0,!1,void 0,this),t.jsxDEV("div",{children:[t.jsxDEV("label",{className:"block text-sm text-[#888] mb-1",children:"Name"},void 0,!1,void 0,this),t.jsxDEV("input",{type:"text",value:_,onChange:(T)=>W(T.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"-")),placeholder:"my-skill-name",className:"w-full bg-[#0a0a0a] border border-[#222] rounded px-3 py-2 focus:outline-none focus:border-[#f97316]"},void 0,!1,void 0,this),t.jsxDEV("p",{className:"text-xs text-[#555] mt-1",children:"Lowercase letters, numbers, and hyphens only"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),t.jsxDEV("div",{children:[t.jsxDEV("label",{className:"block text-sm text-[#888] mb-1",children:"Description"},void 0,!1,void 0,this),t.jsxDEV("input",{type:"text",value:O,onChange:(T)=>F(T.target.value),placeholder:"What this skill does and when to use it...",className:"w-full bg-[#0a0a0a] border border-[#222] rounded px-3 py-2 focus:outline-none focus:border-[#f97316]"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),f&&t.jsxDEV("div",{children:[t.jsxDEV("label",{className:"block text-sm text-[#888] mb-1",children:"Scope"},void 0,!1,void 0,this),t.jsxDEV(t4,{value:A||"",onChange:(T)=>R(T||null),options:[{value:"",label:"Global (all projects)"},...K.map((T)=>({value:T.id,label:T.name}))],placeholder:"Select scope..."},void 0,!1,void 0,this),t.jsxDEV("p",{className:"text-xs text-[#555] mt-1",children:"Global skills are available to all agents. Project-scoped skills are only available to agents in that project."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),t.jsxDEV("div",{children:[t.jsxDEV("label",{className:"block text-sm text-[#888] mb-1",children:"Instructions (Markdown)"},void 0,!1,void 0,this),t.jsxDEV("textarea",{value:b,onChange:(T)=>M(T.target.value),placeholder:`# Skill Instructions
|
|
217
|
+
|
|
218
|
+
Write detailed instructions here...`,rows:12,className:"w-full bg-[#0a0a0a] border border-[#222] rounded px-3 py-2 focus:outline-none focus:border-[#f97316] font-mono text-sm"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),t.jsxDEV("div",{className:"p-6 border-t border-[#1a1a1a] flex justify-end gap-3",children:[t.jsxDEV("button",{onClick:H,className:"px-4 py-2 text-[#888] hover:text-white transition",children:"Cancel"},void 0,!1,void 0,this),t.jsxDEV("button",{onClick:l,disabled:k,className:"bg-[#f97316] hover:bg-[#fb923c] disabled:opacity-50 text-black px-4 py-2 rounded font-medium transition",children:k?"Creating...":"Create Skill"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}function DT({authFetch:Y,onClose:H,onImported:B}){let[K,G]=$4.useState(""),[_,W]=$4.useState(!1),[O,F]=$4.useState(null);return t.jsxDEV("div",{className:"fixed inset-0 bg-black/60 flex items-center justify-center z-50 p-4",onClick:H,children:t.jsxDEV("div",{className:"bg-[#111] border border-[#1a1a1a] rounded-lg w-full max-w-2xl max-h-[90vh] overflow-auto",onClick:(M)=>M.stopPropagation(),children:[t.jsxDEV("div",{className:"p-6 border-b border-[#1a1a1a]",children:[t.jsxDEV("h2",{className:"text-xl font-semibold",children:"Import Skill"},void 0,!1,void 0,this),t.jsxDEV("p",{className:"text-sm text-[#666] mt-1",children:"Paste the contents of a SKILL.md file"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),t.jsxDEV("div",{className:"p-6 space-y-4",children:[O&&t.jsxDEV("div",{className:"bg-red-500/10 border border-red-500/30 rounded p-3 text-red-400 text-sm",children:O},void 0,!1,void 0,this),t.jsxDEV("textarea",{value:K,onChange:(M)=>G(M.target.value),placeholder:`---
|
|
219
|
+
name: skill-name
|
|
220
|
+
description: What this skill does...
|
|
221
|
+
---
|
|
222
|
+
|
|
223
|
+
# Instructions
|
|
224
|
+
|
|
225
|
+
Your skill instructions here...`,rows:16,className:"w-full bg-[#0a0a0a] border border-[#222] rounded px-3 py-2 focus:outline-none focus:border-[#f97316] font-mono text-sm"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),t.jsxDEV("div",{className:"p-6 border-t border-[#1a1a1a] flex justify-end gap-3",children:[t.jsxDEV("button",{onClick:H,className:"px-4 py-2 text-[#888] hover:text-white transition",children:"Cancel"},void 0,!1,void 0,this),t.jsxDEV("button",{onClick:async()=>{if(!K.trim()){F("Paste SKILL.md content");return}W(!0),F(null);try{let M=await Y("/api/skills/import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:K})}),A=await M.json();if(!M.ok){F(A.error||"Failed to import skill"),W(!1);return}B()}catch(M){F("Failed to import skill"),W(!1)}},disabled:_,className:"bg-[#f97316] hover:bg-[#fb923c] disabled:opacity-50 text-black px-4 py-2 rounded font-medium transition",children:_?"Importing...":"Import Skill"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}function mT({skill:Y,authFetch:H,onClose:B,onUpdated:K}){let[G,_]=$4.useState(!1),[W,O]=$4.useState(Y.content),[F,b]=$4.useState(!1),M=async()=>{b(!0);try{await H(`/api/skills/${Y.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:W})}),K()}catch(R){console.error("Failed to save:",R)}b(!1)},A=async()=>{try{let k=await(await H(`/api/skills/${Y.id}/export`)).text(),S=new Blob([k],{type:"text/markdown"}),V=URL.createObjectURL(S),x=document.createElement("a");x.href=V,x.download=`${Y.name}-SKILL.md`,x.click(),URL.revokeObjectURL(V)}catch(R){console.error("Failed to export:",R)}};return t.jsxDEV("div",{className:"fixed inset-0 bg-black/60 flex items-center justify-center z-50 p-4",onClick:B,children:t.jsxDEV("div",{className:"bg-[#111] border border-[#1a1a1a] rounded-lg w-full max-w-3xl max-h-[90vh] overflow-auto",onClick:(R)=>R.stopPropagation(),children:[t.jsxDEV("div",{className:"p-6 border-b border-[#1a1a1a] flex items-center justify-between",children:[t.jsxDEV("div",{children:[t.jsxDEV("h2",{className:"text-xl font-semibold",children:Y.name},void 0,!1,void 0,this),t.jsxDEV("p",{className:"text-sm text-[#666] mt-0.5",children:Y.description},void 0,!1,void 0,this)]},void 0,!0,void 0,this),t.jsxDEV("div",{className:"flex gap-2",children:[t.jsxDEV("button",{onClick:A,className:"text-sm text-[#888] hover:text-white transition px-3 py-1 rounded border border-[#333]",children:"Export"},void 0,!1,void 0,this),t.jsxDEV("button",{onClick:()=>_(!G),className:"text-sm text-[#888] hover:text-white transition px-3 py-1 rounded border border-[#333]",children:G?"View":"Edit"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),t.jsxDEV("div",{className:"p-6",children:G?t.jsxDEV("textarea",{value:W,onChange:(R)=>O(R.target.value),rows:20,className:"w-full bg-[#0a0a0a] border border-[#222] rounded px-3 py-2 focus:outline-none focus:border-[#f97316] font-mono text-sm"},void 0,!1,void 0,this):t.jsxDEV("pre",{className:"bg-[#0a0a0a] border border-[#222] rounded p-4 font-mono text-sm overflow-auto max-h-[60vh] whitespace-pre-wrap",children:Y.content},void 0,!1,void 0,this)},void 0,!1,void 0,this),t.jsxDEV("div",{className:"p-6 border-t border-[#1a1a1a] flex justify-between",children:[t.jsxDEV("div",{className:"text-xs text-[#555]",children:Y.source!=="local"&&Y.source_url&&t.jsxDEV("a",{href:Y.source_url,target:"_blank",rel:"noopener noreferrer",className:"text-[#f97316] hover:underline",children:"View source →"},void 0,!1,void 0,this)},void 0,!1,void 0,this),t.jsxDEV("div",{className:"flex gap-3",children:[t.jsxDEV("button",{onClick:B,className:"px-4 py-2 text-[#888] hover:text-white transition",children:"Close"},void 0,!1,void 0,this),G&&t.jsxDEV("button",{onClick:M,disabled:F,className:"bg-[#f97316] hover:bg-[#fb923c] disabled:opacity-50 text-black px-4 py-2 rounded font-medium transition",children:F?"Saving...":"Save Changes"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}var R5=H0(D1(),1);var C0=H0(H1(),1);function NG(){let{authFetch:Y}=A1(),{currentProjectId:H}=G4(),{confirm:B,ConfirmDialog:K}=a5(),[G,_]=R5.useState([]),[W,O]=R5.useState([]),[F,b]=R5.useState(!0),[M,A]=R5.useState(!1),[R,k]=R5.useState(null),[S,V]=R5.useState(new Set),[x,f]=R5.useState(!1),[l,T]=R5.useState(null),[m,E]=R5.useState(null),[D,n]=R5.useState({}),[c,j]=R5.useState(""),[g,Q0]=R5.useState(""),[r,U0]=R5.useState(""),R0=H&&H!=="all"&&H!=="unassigned"?H:null,_0=R0?W.filter((p)=>p.projectId===R0):W,{events:f0}=b2({category:"test",limit:50}),P0=R5.useRef(new Set);R5.useEffect(()=>{for(let p of f0){if(P0.current.has(p.id))continue;P0.current.add(p.id);let O0=p.data?.test_case_id;if(!O0)continue;if(p.type==="test_started")n((V0)=>({...V0,[O0]:{phase:"starting"}})),V((V0)=>new Set(V0).add(O0));else if(p.type==="test_planning")n((V0)=>({...V0,[O0]:{phase:"planning"}}));else if(p.type==="test_executing"){let V0=p.data?.agent_name;n((q1)=>({...q1,[O0]:{phase:"executing",detail:V0}}))}else if(p.type==="test_judging")n((V0)=>({...V0,[O0]:{phase:"judging"}}));else if(p.type==="test_completed")n((V0)=>{let q1={...V0};return delete q1[O0],q1}),V((V0)=>{let q1=new Set(V0);return q1.delete(O0),q1}),a()}if(P0.current.size>500)P0.current=new Set([...P0.current].slice(-200))},[f0]);let a=async()=>{try{let p=R0?`?project_id=${R0}`:"",O0=await Y(`/api/tests${p}`);if(O0.ok)_(await O0.json())}catch{}b(!1)},Y0=async()=>{try{let p=await Y("/api/agents");if(p.ok){let O0=await p.json();O((O0.agents||O0).map((V0)=>({id:V0.id,name:V0.name,status:V0.status,provider:V0.provider,model:V0.model,projectId:V0.projectId||null})))}}catch{}};R5.useEffect(()=>{a(),Y0()},[H]);let B0=()=>{k(null),j(""),Q0(""),U0(""),A(!0)},G0=(p)=>{k(p),j(p.name),Q0(p.behavior||""),U0(p.agent_id||""),A(!0)},h0=async()=>{if(!c||!g)return;let p={name:c,behavior:g,agent_id:r||null,project_id:R0||void 0};if(R)await Y(`/api/tests/${R.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(p)});else await Y("/api/tests",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(p)});A(!1),a()},z0=async(p)=>{if(!await B("Delete this test case? Run history will also be deleted."))return;await Y(`/api/tests/${p}`,{method:"DELETE"}),a()},v0=async(p)=>{V((O0)=>new Set(O0).add(p));try{await Y(`/api/tests/${p}/run`,{method:"POST"}),await a()}catch{}V((O0)=>{let V0=new Set(O0);return V0.delete(p),V0}),n((O0)=>{let V0={...O0};return delete V0[p],V0})},j0=async()=>{f(!0);try{let p=G.map((O0)=>O0.id);V(new Set(p)),await Y("/api/tests/run",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({test_case_ids:p})}),await a()}catch{}V(new Set),f(!1)},Y1=async(p)=>{try{let O0=await Y(`/api/tests/${p}/runs`);if(O0.ok)T({testId:p,runs:await O0.json()})}catch{}},m0={starting:{label:"Starting",color:"bg-blue-900/50 text-blue-400 border-blue-500/30"},planning:{label:"Planning",color:"bg-purple-900/50 text-purple-400 border-purple-500/30"},executing:{label:"Executing",color:"bg-cyan-900/50 text-cyan-400 border-cyan-500/30"},judging:{label:"Judging",color:"bg-amber-900/50 text-amber-400 border-amber-500/30"}},F1=(p)=>{return C0.jsxDEV("span",{className:`px-2 py-0.5 rounded text-xs font-medium ${{passed:"bg-green-900/50 text-green-400",failed:"bg-red-900/50 text-red-400",error:"bg-yellow-900/50 text-yellow-400",running:"bg-blue-900/50 text-blue-400"}[p]||"bg-[#222] text-[#666]"}`,children:p.toUpperCase()},void 0,!1,void 0,this)},R1=(p)=>{let O0=D[p];if(!O0)return null;let V0=m0[O0.phase]||m0.starting;return C0.jsxDEV("span",{className:`inline-flex items-center gap-1.5 px-2 py-0.5 rounded text-xs font-medium border ${V0.color} animate-pulse`,children:[C0.jsxDEV("span",{className:"w-1.5 h-1.5 rounded-full bg-current"},void 0,!1,void 0,this),V0.label,O0.detail?` · ${O0.detail}`:""]},void 0,!0,void 0,this)};return C0.jsxDEV("div",{className:"flex-1 overflow-auto p-6",children:[K,C0.jsxDEV("div",{className:"flex items-center justify-between mb-6",children:[C0.jsxDEV("div",{children:[C0.jsxDEV("h1",{className:"text-xl font-bold",children:"Tests"},void 0,!1,void 0,this),C0.jsxDEV("p",{className:"text-sm text-[#666] mt-1",children:"Describe behavior, AI handles the rest"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),C0.jsxDEV("div",{className:"flex gap-2",children:[G.length>0&&C0.jsxDEV("button",{onClick:j0,disabled:x,className:"px-4 py-2 bg-[#1a1a1a] hover:bg-[#222] text-[#e0e0e0] rounded text-sm font-medium transition disabled:opacity-50",children:x?"Running...":"Run All"},void 0,!1,void 0,this),C0.jsxDEV("button",{onClick:B0,className:"px-4 py-2 bg-[#f97316] hover:bg-[#fb923c] text-white rounded text-sm font-medium transition",children:"+ New Test"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),F?C0.jsxDEV("div",{className:"text-[#666] text-sm",children:"Loading..."},void 0,!1,void 0,this):G.length===0?C0.jsxDEV("div",{className:"text-center py-16",children:[C0.jsxDEV("div",{className:"text-[#333] text-4xl mb-4",children:C0.jsxDEV("svg",{className:"w-12 h-12 mx-auto",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:C0.jsxDEV("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),C0.jsxDEV("p",{className:"text-[#666] mb-2",children:"No tests yet"},void 0,!1,void 0,this),C0.jsxDEV("p",{className:"text-xs text-[#555] mb-4",children:"Describe what your agents should do and let AI verify it"},void 0,!1,void 0,this),C0.jsxDEV("button",{onClick:B0,className:"px-4 py-2 bg-[#f97316] hover:bg-[#fb923c] text-white rounded text-sm font-medium transition",children:"Create your first test"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):C0.jsxDEV("div",{className:"space-y-3",children:G.map((p)=>C0.jsxDEV("div",{className:"bg-[#111] border border-[#1a1a1a] rounded-lg p-4",children:C0.jsxDEV("div",{className:"flex items-start justify-between",children:[C0.jsxDEV("div",{className:"flex-1 min-w-0",children:[C0.jsxDEV("div",{className:"flex items-center gap-2 mb-1",children:[C0.jsxDEV("span",{className:"font-medium text-sm",children:p.name},void 0,!1,void 0,this),D[p.id]?R1(p.id):p.last_run&&C0.jsxDEV(C0.Fragment,{children:[F1(p.last_run.status),p.last_run.score!=null&&C0.jsxDEV("span",{className:"text-xs text-[#888] font-mono",children:[p.last_run.score,"/10"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),p.behavior&&C0.jsxDEV("p",{className:"text-xs text-[#888] mb-1.5 line-clamp-2",children:p.behavior},void 0,!1,void 0,this),C0.jsxDEV("div",{className:"text-xs text-[#666] space-y-0.5",children:[C0.jsxDEV("div",{children:["Agent:"," ",C0.jsxDEV("span",{className:"text-[#888]",children:p.agent_name||(p.last_run?.selected_agent_name?`${p.last_run.selected_agent_name} (auto-selected)`:"Auto (AI picks)")},void 0,!1,void 0,this)]},void 0,!0,void 0,this),p.last_run?.generated_message&&C0.jsxDEV("div",{className:"truncate",children:["Message: ",C0.jsxDEV("span",{className:"text-[#888]",children:['"',p.last_run.generated_message,'"']},void 0,!0,void 0,this)]},void 0,!0,void 0,this),p.input_message&&!p.last_run?.generated_message&&C0.jsxDEV("div",{className:"truncate",children:["Message: ",C0.jsxDEV("span",{className:"text-[#888]",children:['"',p.input_message,'"']},void 0,!0,void 0,this)]},void 0,!0,void 0,this),p.last_run&&C0.jsxDEV("div",{children:["Last run:"," ",C0.jsxDEV("span",{className:"text-[#888]",children:[p.last_run.duration_ms?`${(p.last_run.duration_ms/1000).toFixed(1)}s`:"---",p.last_run.judge_reasoning&&` --- "${p.last_run.judge_reasoning.slice(0,80)}${p.last_run.judge_reasoning.length>80?"...":""}"`]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),C0.jsxDEV("div",{className:"flex items-center gap-1 ml-3 shrink-0",children:[C0.jsxDEV("button",{onClick:()=>Y1(p.id),className:"px-2 py-1 text-xs text-[#666] hover:text-[#888] hover:bg-[#1a1a1a] rounded transition",title:"View run history",children:"History"},void 0,!1,void 0,this),C0.jsxDEV("button",{onClick:()=>v0(p.id),disabled:S.has(p.id),className:"px-3 py-1 text-xs bg-[#1a1a1a] hover:bg-[#222] text-[#e0e0e0] rounded transition disabled:opacity-50",children:S.has(p.id)?"Running...":"Run"},void 0,!1,void 0,this),C0.jsxDEV("button",{onClick:()=>G0(p),className:"px-2 py-1 text-xs text-[#666] hover:text-[#888] hover:bg-[#1a1a1a] rounded transition",children:"Edit"},void 0,!1,void 0,this),C0.jsxDEV("button",{onClick:()=>z0(p.id),className:"px-2 py-1 text-xs text-[#666] hover:text-red-400 hover:bg-[#1a1a1a] rounded transition",children:"Delete"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},p.id,!1,void 0,this))},void 0,!1,void 0,this),l&&C0.jsxDEV("div",{className:"mt-6",children:[C0.jsxDEV("div",{className:"flex items-center justify-between mb-3",children:[C0.jsxDEV("h2",{className:"text-sm font-bold text-[#888]",children:"Run History"},void 0,!1,void 0,this),C0.jsxDEV("button",{onClick:()=>{T(null),E(null)},className:"text-xs text-[#666] hover:text-[#888]",children:"Close"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),l.runs.length===0?C0.jsxDEV("p",{className:"text-sm text-[#666]",children:"No runs yet"},void 0,!1,void 0,this):C0.jsxDEV("div",{className:"space-y-2",children:l.runs.map((p)=>C0.jsxDEV("div",{className:"bg-[#0d0d0d] border border-[#1a1a1a] rounded p-3",children:[C0.jsxDEV("div",{className:"flex items-center justify-between cursor-pointer",onClick:()=>E(m===p.id?null:p.id),children:[C0.jsxDEV("div",{className:"flex items-center gap-3",children:[F1(p.status),C0.jsxDEV("span",{className:"text-xs text-[#666]",children:p.duration_ms?`${(p.duration_ms/1000).toFixed(1)}s`:"---"},void 0,!1,void 0,this),p.score!=null&&C0.jsxDEV("span",{className:"text-xs text-[#888] font-mono",children:[p.score,"/10"]},void 0,!0,void 0,this),p.selected_agent_name&&C0.jsxDEV("span",{className:"text-xs text-[#555]",children:["Agent: ",p.selected_agent_name]},void 0,!0,void 0,this),C0.jsxDEV("span",{className:"text-xs text-[#555]",children:new Date(p.created_at).toLocaleString()},void 0,!1,void 0,this)]},void 0,!0,void 0,this),C0.jsxDEV("span",{className:"text-xs text-[#555]",children:m===p.id?"---":"+"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),m===p.id&&C0.jsxDEV("div",{className:"mt-3 space-y-2",children:[p.planner_reasoning&&C0.jsxDEV("div",{children:[C0.jsxDEV("div",{className:"text-xs text-[#666] mb-1",children:"Planner:"},void 0,!1,void 0,this),C0.jsxDEV("div",{className:"text-sm text-[#aaa] bg-[#0a0a0a] p-2 rounded",children:[p.selected_agent_name&&C0.jsxDEV("span",{className:"text-[#f97316]",children:p.selected_agent_name},void 0,!1,void 0,this),p.selected_agent_name&&" --- ",p.planner_reasoning]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),p.generated_message&&C0.jsxDEV("div",{children:[C0.jsxDEV("div",{className:"text-xs text-[#666] mb-1",children:"Generated Message:"},void 0,!1,void 0,this),C0.jsxDEV("div",{className:"text-sm text-[#aaa] bg-[#0a0a0a] p-2 rounded",children:['"',p.generated_message,'"']},void 0,!0,void 0,this)]},void 0,!0,void 0,this),p.judge_reasoning&&C0.jsxDEV("div",{children:[C0.jsxDEV("div",{className:"text-xs text-[#666] mb-1",children:"Judge:"},void 0,!1,void 0,this),C0.jsxDEV("div",{className:"text-sm text-[#aaa] bg-[#0a0a0a] p-2 rounded",children:p.judge_reasoning},void 0,!1,void 0,this)]},void 0,!0,void 0,this),p.error&&C0.jsxDEV("div",{children:[C0.jsxDEV("div",{className:"text-xs text-red-400 mb-1",children:"Error:"},void 0,!1,void 0,this),C0.jsxDEV("div",{className:"text-sm text-red-300 bg-[#0a0a0a] p-2 rounded",children:p.error},void 0,!1,void 0,this)]},void 0,!0,void 0,this),p.agent_response&&C0.jsxDEV("div",{children:[C0.jsxDEV("div",{className:"text-xs text-[#666] mb-1",children:"Agent Response (Thread):"},void 0,!1,void 0,this),C0.jsxDEV("pre",{className:"text-xs text-[#888] bg-[#0a0a0a] p-2 rounded overflow-auto max-h-64",children:p.agent_response},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},p.id,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),M&&C0.jsxDEV("div",{className:"fixed inset-0 bg-black/60 z-50 flex items-center justify-center",onClick:()=>A(!1),children:C0.jsxDEV("div",{className:"bg-[#111] border border-[#1a1a1a] rounded-lg w-full max-w-lg mx-4 p-6",onClick:(p)=>p.stopPropagation(),children:[C0.jsxDEV("h2",{className:"text-lg font-bold mb-4",children:R?"Edit Test":"New Test"},void 0,!1,void 0,this),C0.jsxDEV("div",{className:"space-y-4",children:[C0.jsxDEV("div",{children:[C0.jsxDEV("label",{className:"block text-xs text-[#666] mb-1",children:"Name"},void 0,!1,void 0,this),C0.jsxDEV("input",{value:c,onChange:(p)=>j(p.target.value),placeholder:"e.g. Social Media Posting",className:"w-full bg-[#0a0a0a] border border-[#222] rounded px-3 py-2 text-sm focus:outline-none focus:border-[#f97316]"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),C0.jsxDEV("div",{children:[C0.jsxDEV("label",{className:"block text-xs text-[#666] mb-1",children:"Behavior"},void 0,!1,void 0,this),C0.jsxDEV("textarea",{value:g,onChange:(p)=>Q0(p.target.value),placeholder:"Describe what should happen, e.g. 'When asked to post on social media, the agent creates a proper post with relevant hashtags and confirms it was published'",rows:3,className:"w-full bg-[#0a0a0a] border border-[#222] rounded px-3 py-2 text-sm focus:outline-none focus:border-[#f97316] resize-none"},void 0,!1,void 0,this),C0.jsxDEV("p",{className:"text-xs text-[#555] mt-1",children:"AI will generate the test message and evaluate results based on this"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),C0.jsxDEV("div",{children:[C0.jsxDEV("label",{className:"block text-xs text-[#666] mb-1",children:"Agent"},void 0,!1,void 0,this),C0.jsxDEV(t4,{value:r,onChange:U0,placeholder:"Auto (AI picks the best agent)",options:_0.map((p)=>({value:p.id,label:`${p.name} (${p.status})`}))},void 0,!1,void 0,this),C0.jsxDEV("p",{className:"text-xs text-[#555] mt-1",children:"Leave empty to let AI choose the right agent"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),C0.jsxDEV("div",{className:"flex justify-end gap-2 mt-6",children:[C0.jsxDEV("button",{onClick:()=>A(!1),className:"px-4 py-2 text-sm text-[#888] hover:text-[#e0e0e0] transition",children:"Cancel"},void 0,!1,void 0,this),C0.jsxDEV("button",{onClick:h0,disabled:!c||!g,className:"px-4 py-2 bg-[#f97316] hover:bg-[#fb923c] disabled:opacity-50 text-white rounded text-sm font-medium transition",children:R?"Save":"Create"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}var j4=H0(D1(),1);var n0=H0(H1(),1);function hO(Y){let H=Y.category==="LLM",B=Y.category==="TOOL",K=Y.level==="error",G=Y.data?.input_tokens||0,_=Y.data?.output_tokens||0;return{llm_calls:H?1:0,tool_calls:B?1:0,errors:K?1:0,input_tokens:G,output_tokens:_}}function RG(){let{events:Y,statusChangeCounter:H}=f6(),{currentProjectId:B,currentProject:K}=G4(),{authFetch:G}=A1(),[_,W]=j4.useState(null),[O,F]=j4.useState([]),[b,M]=j4.useState([]),[A,R]=j4.useState(!0),[k,S]=j4.useState({level:"",agent_id:""}),[V,x]=j4.useState(new Set(["DATABASE"])),[f,l]=j4.useState([]),[T,m]=j4.useState(null),E=j4.useRef(new Set),[D,n]=j4.useState(new Set),c=j4.useRef(new Set);j4.useEffect(()=>{(async()=>{try{let j0=await(await G("/api/agents")).json();l(j0.agents||[])}catch(v0){console.error("Failed to fetch agents:",v0)}})()},[G]);let j=j4.useMemo(()=>{if(B===null)return f;if(B==="unassigned")return f.filter((z0)=>!z0.projectId);return f.filter((z0)=>z0.projectId===B)},[f,B]),g=j4.useMemo(()=>new Set(j.map((z0)=>z0.id)),[j]),Q0=async()=>{R(!0);try{let z0=B==="unassigned"?"null":B||"",v0=new URLSearchParams;if(z0)v0.set("project_id",z0);let Y1=await(await G(`/api/telemetry/stats${v0.toString()?`?${v0}`:""}`)).json();W(Y1.stats);let m0=new URLSearchParams;if(k.level)m0.set("level",k.level);if(k.agent_id)m0.set("agent_id",k.agent_id);if(z0)m0.set("project_id",z0);m0.set("limit","100");let p=(await(await G(`/api/telemetry/events?${m0}`)).json()).events||[];F(p),E.current=new Set(p.map((y1)=>y1.id));let O0=new URLSearchParams;if(O0.set("group_by","agent"),z0)O0.set("project_id",z0);let q1=await(await G(`/api/telemetry/usage?${O0}`)).json();M(q1.usage||[])}catch(z0){console.error("Failed to fetch telemetry:",z0)}R(!1)};j4.useEffect(()=>{Q0()},[k,B,G,H]);let r=j4.useMemo(()=>{if(!_)return null;let z0=0,v0=0,j0=0,Y1=0,m0=0,F1=0;for(let R1 of Y)if(!E.current.has(R1.id)){z0++;let p=hO(R1);v0+=p.llm_calls,j0+=p.tool_calls,Y1+=p.errors,m0+=p.input_tokens,F1+=p.output_tokens}return{total_events:_.total_events+z0,total_llm_calls:_.total_llm_calls+v0,total_tool_calls:_.total_tool_calls+j0,total_errors:_.total_errors+Y1,total_input_tokens:_.total_input_tokens+m0,total_output_tokens:_.total_output_tokens+F1}},[_,Y]),U0=j4.useMemo(()=>{let z0=new Map;for(let v0 of b)z0.set(v0.agent_id,{...v0});for(let v0 of Y)if(!E.current.has(v0.id)){let j0=hO(v0),Y1=z0.get(v0.agent_id);if(Y1)Y1.llm_calls+=j0.llm_calls,Y1.tool_calls+=j0.tool_calls,Y1.errors+=j0.errors,Y1.input_tokens+=j0.input_tokens,Y1.output_tokens+=j0.output_tokens;else z0.set(v0.agent_id,{agent_id:v0.agent_id,llm_calls:j0.llm_calls,tool_calls:j0.tool_calls,errors:j0.errors,input_tokens:j0.input_tokens,output_tokens:j0.output_tokens})}return Array.from(z0.values())},[b,Y]),R0=j4.default.useMemo(()=>{let z0=Y;if(B!==null)z0=z0.filter((m0)=>g.has(m0.agent_id));if(k.agent_id)z0=z0.filter((m0)=>m0.agent_id===k.agent_id);if(V.size>0)z0=z0.filter((m0)=>!V.has(m0.category));if(k.level)z0=z0.filter((m0)=>m0.level===k.level);let v0=O;if(V.size>0)v0=v0.filter((m0)=>!V.has(m0.category));let j0=new Set(z0.map((m0)=>m0.id)),Y1=[...z0];for(let m0 of v0)if(!j0.has(m0.id))Y1.push(m0),j0.add(m0.id);return Y1.sort((m0,F1)=>new Date(F1.timestamp).getTime()-new Date(m0.timestamp).getTime()),Y1.slice(0,100)},[Y,O,k,V,B,g]);j4.useEffect(()=>{let z0=[];for(let v0 of Y)if(!c.current.has(v0.id))c.current.add(v0.id),z0.push(v0.id);if(z0.length>0)n((v0)=>{let j0=new Set(v0);return z0.forEach((Y1)=>j0.add(Y1)),j0}),setTimeout(()=>{n((v0)=>{let j0=new Set(v0);return z0.forEach((Y1)=>j0.delete(Y1)),j0})},5000)},[Y]);let _0=(z0)=>{return f.find((j0)=>j0.id===z0)?.name||z0},f0=(z0)=>{if(z0>=1e6)return(z0/1e6).toFixed(1)+"M";if(z0>=1000)return(z0/1000).toFixed(1)+"K";return z0.toString()},P0={debug:"text-[#555]",info:"text-blue-400",warn:"text-yellow-400",error:"text-red-400"},a={LLM:"bg-purple-500/20 text-purple-400 border-purple-500/30",TOOL:"bg-blue-500/20 text-blue-400 border-blue-500/30",CHAT:"bg-green-500/20 text-green-400 border-green-500/30",ERROR:"bg-red-500/20 text-red-400 border-red-500/30",SYSTEM:"bg-gray-500/20 text-gray-400 border-gray-500/30",TASK:"bg-yellow-500/20 text-yellow-400 border-yellow-500/30",MEMORY:"bg-cyan-500/20 text-cyan-400 border-cyan-500/30",MCP:"bg-orange-500/20 text-orange-400 border-orange-500/30",DATABASE:"bg-pink-500/20 text-pink-400 border-pink-500/30"},Y0=["LLM","TOOL","CHAT","TASK","MEMORY","MCP","SYSTEM","DATABASE","ERROR"],B0=(z0)=>{x((v0)=>{let j0=new Set(v0);if(j0.has(z0))j0.delete(z0);else j0.add(z0);return j0})},G0=[{value:"",label:"All Agents"},...j.map((z0)=>({value:z0.id,label:z0.name}))],h0=[{value:"",label:"All Levels"},{value:"debug",label:"Debug"},{value:"info",label:"Info"},{value:"warn",label:"Warn"},{value:"error",label:"Error"}];return n0.jsxDEV("div",{className:"flex-1 overflow-auto p-6",children:n0.jsxDEV("div",{children:[n0.jsxDEV("div",{className:"mb-6",children:[n0.jsxDEV("div",{className:"flex items-center gap-3 mb-1",children:[K&&n0.jsxDEV("span",{className:"w-3 h-3 rounded-full",style:{backgroundColor:K.color}},void 0,!1,void 0,this),n0.jsxDEV("h1",{className:"text-2xl font-semibold",children:B===null?"Telemetry":B==="unassigned"?"Telemetry - Unassigned":`Telemetry - ${K?.name||""}`},void 0,!1,void 0,this)]},void 0,!0,void 0,this),n0.jsxDEV("p",{className:"text-[#666]",children:"Monitor agent activity, token usage, and errors."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),r&&n0.jsxDEV("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-4 mb-6",children:[n0.jsxDEV(cz,{label:"Events",value:f0(r.total_events)},void 0,!1,void 0,this),n0.jsxDEV(cz,{label:"LLM Calls",value:f0(r.total_llm_calls)},void 0,!1,void 0,this),n0.jsxDEV(cz,{label:"Tool Calls",value:f0(r.total_tool_calls)},void 0,!1,void 0,this),n0.jsxDEV(cz,{label:"Errors",value:f0(r.total_errors),color:"red"},void 0,!1,void 0,this),n0.jsxDEV(cz,{label:"Input Tokens",value:f0(r.total_input_tokens)},void 0,!1,void 0,this),n0.jsxDEV(cz,{label:"Output Tokens",value:f0(r.total_output_tokens)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),U0.length>0&&n0.jsxDEV("div",{className:"mb-6",children:[n0.jsxDEV("h2",{className:"text-lg font-medium mb-3",children:"Usage by Agent"},void 0,!1,void 0,this),n0.jsxDEV("div",{className:"bg-[#111] border border-[#1a1a1a] rounded-lg overflow-hidden",children:n0.jsxDEV("table",{className:"w-full text-sm",children:[n0.jsxDEV("thead",{children:n0.jsxDEV("tr",{className:"border-b border-[#1a1a1a] text-[#666]",children:[n0.jsxDEV("th",{className:"text-left p-3",children:"Agent"},void 0,!1,void 0,this),n0.jsxDEV("th",{className:"text-right p-3",children:"LLM Calls"},void 0,!1,void 0,this),n0.jsxDEV("th",{className:"text-right p-3",children:"Tool Calls"},void 0,!1,void 0,this),n0.jsxDEV("th",{className:"text-right p-3",children:"Input Tokens"},void 0,!1,void 0,this),n0.jsxDEV("th",{className:"text-right p-3",children:"Output Tokens"},void 0,!1,void 0,this),n0.jsxDEV("th",{className:"text-right p-3",children:"Errors"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),n0.jsxDEV("tbody",{children:U0.map((z0)=>n0.jsxDEV("tr",{className:"border-b border-[#1a1a1a] last:border-0",children:[n0.jsxDEV("td",{className:"p-3 font-medium",children:_0(z0.agent_id)},void 0,!1,void 0,this),n0.jsxDEV("td",{className:"p-3 text-right text-[#888]",children:f0(z0.llm_calls)},void 0,!1,void 0,this),n0.jsxDEV("td",{className:"p-3 text-right text-[#888]",children:f0(z0.tool_calls)},void 0,!1,void 0,this),n0.jsxDEV("td",{className:"p-3 text-right text-[#888]",children:f0(z0.input_tokens)},void 0,!1,void 0,this),n0.jsxDEV("td",{className:"p-3 text-right text-[#888]",children:f0(z0.output_tokens)},void 0,!1,void 0,this),n0.jsxDEV("td",{className:"p-3 text-right",children:z0.errors>0?n0.jsxDEV("span",{className:"text-red-400",children:z0.errors},void 0,!1,void 0,this):n0.jsxDEV("span",{className:"text-[#444]",children:"0"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},z0.agent_id,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),n0.jsxDEV("div",{className:"flex flex-wrap items-center gap-3 mb-4",children:[n0.jsxDEV("div",{className:"w-44",children:n0.jsxDEV(t4,{value:k.agent_id,options:G0,onChange:(z0)=>S({...k,agent_id:z0}),placeholder:"All Agents"},void 0,!1,void 0,this)},void 0,!1,void 0,this),n0.jsxDEV("div",{className:"flex flex-wrap items-center gap-1.5 flex-1",children:Y0.map((z0)=>{let v0=V.has(z0),j0=a[z0]||"bg-[#222] text-[#888] border-[#333]";return n0.jsxDEV("button",{onClick:()=>B0(z0),className:`px-2 py-0.5 rounded text-xs border transition-all ${v0?"bg-[#1a1a1a] text-[#555] border-[#333] opacity-50":j0}`,children:z0},z0,!1,void 0,this)})},void 0,!1,void 0,this),n0.jsxDEV("div",{className:"flex items-center gap-2",children:[n0.jsxDEV("div",{className:"w-36",children:n0.jsxDEV(t4,{value:k.level,options:h0,onChange:(z0)=>S({...k,level:z0}),placeholder:"All Levels"},void 0,!1,void 0,this)},void 0,!1,void 0,this),n0.jsxDEV("button",{onClick:Q0,className:"px-3 py-2 bg-[#1a1a1a] hover:bg-[#222] border border-[#333] rounded text-sm transition",children:"Refresh"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),n0.jsxDEV("div",{className:"bg-[#111] border border-[#1a1a1a] rounded-lg",children:[n0.jsxDEV("div",{className:"p-3 border-b border-[#1a1a1a] flex items-center justify-between",children:[n0.jsxDEV("h2",{className:"font-medium",children:"Recent Events"},void 0,!1,void 0,this),Y.length>0&&n0.jsxDEV("span",{className:"text-xs text-[#666]",children:[Y.length," new"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),A&&R0.length===0?n0.jsxDEV("div",{className:"p-8 text-center text-[#666]",children:"Loading..."},void 0,!1,void 0,this):R0.length===0?n0.jsxDEV("div",{className:"p-8 text-center text-[#666]",children:"No telemetry events yet. Events will appear here in real-time once agents start sending data."},void 0,!1,void 0,this):n0.jsxDEV("div",{className:"divide-y divide-[#1a1a1a]",children:R0.map((z0)=>{let v0=D.has(z0.id);return n0.jsxDEV("div",{className:`p-3 hover:bg-[#0a0a0a] cursor-pointer transition-all duration-500 ${v0?"bg-green-500/5":""}`,style:{animation:v0?"slideIn 0.3s ease-out":void 0},onClick:()=>m(T===z0.id?null:z0.id),children:n0.jsxDEV("div",{className:"flex items-start gap-3",children:[n0.jsxDEV("span",{className:`px-2 py-0.5 rounded text-xs border transition-colors duration-300 ${a[z0.category]||"bg-[#222] text-[#888] border-[#333]"}`,children:z0.category},void 0,!1,void 0,this),n0.jsxDEV("div",{className:"flex-1 min-w-0",children:[n0.jsxDEV("div",{className:"flex items-center gap-2",children:[n0.jsxDEV("span",{className:"font-medium text-sm",children:z0.type},void 0,!1,void 0,this),n0.jsxDEV("span",{className:`text-xs ${P0[z0.level]||"text-[#666]"}`,children:z0.level},void 0,!1,void 0,this),z0.duration_ms&&n0.jsxDEV("span",{className:"text-xs text-[#555]",children:[z0.duration_ms,"ms"]},void 0,!0,void 0,this),n0.jsxDEV("span",{className:`w-1.5 h-1.5 rounded-full bg-green-400 transition-opacity duration-1000 ${v0?"opacity-100":"opacity-0"}`},void 0,!1,void 0,this)]},void 0,!0,void 0,this),n0.jsxDEV("div",{className:"text-xs text-[#555] mt-1",children:[_0(z0.agent_id)," · ",new Date(z0.timestamp).toLocaleString()]},void 0,!0,void 0,this),z0.error&&n0.jsxDEV("div",{className:"text-xs text-red-400 mt-1 font-mono",children:z0.error},void 0,!1,void 0,this),T===z0.id&&z0.data&&Object.keys(z0.data).length>0&&n0.jsxDEV("pre",{className:"text-xs text-[#666] mt-2 p-2 bg-[#0a0a0a] rounded overflow-x-auto",children:JSON.stringify(z0.data,null,2)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},z0.id,!1,void 0,this)})},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}function cz({label:Y,value:H,color:B}){return n0.jsxDEV("div",{className:"bg-[#111] border border-[#1a1a1a] rounded-lg p-4",children:[n0.jsxDEV("div",{className:"text-[#666] text-xs mb-1",children:Y},void 0,!1,void 0,this),n0.jsxDEV("div",{className:`text-2xl font-semibold ${B==="red"?"text-red-400":""}`,children:H},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}var M6=H0(D1(),1);var S0=H0(H1(),1),gT={get:"#61affe",post:"#49cc90",put:"#fca130",delete:"#f93e3e",patch:"#50e3c2"};function uT({method:Y,path:H,parameters:B,requestBody:K,authFetch:G}){let[_,W]=M6.useState({}),[O,F]=M6.useState(""),[b,M]=M6.useState(null),[A,R]=M6.useState(!1),[k,S]=M6.useState(null);M6.useEffect(()=>{if(K?.content?.["application/json"]?.schema){let T=K.content["application/json"].schema;if(T.example)F(JSON.stringify(T.example,null,2));else if(T.properties){let m={};for(let[E,D]of Object.entries(T.properties))if(D.example!==void 0)m[E]=D.example;else if(D.type==="string")m[E]="";else if(D.type==="number"||D.type==="integer")m[E]=0;else if(D.type==="boolean")m[E]=!1;else if(D.type==="array")m[E]=[];else if(D.type==="object")m[E]={};F(JSON.stringify(m,null,2))}}},[K]);let V=async()=>{R(!0),S(null),M(null);try{let T=H,m=[];for(let j of B||[]){let g=_[j.name]||"";if(j.in==="path")T=T.replace(`{${j.name}}`,encodeURIComponent(g));else if(j.in==="query"&&g)m.push(`${j.name}=${encodeURIComponent(g)}`)}if(m.length>0)T+=`?${m.join("&")}`;let E={method:Y.toUpperCase()};if(O&&["post","put","patch"].includes(Y))E.headers={"Content-Type":"application/json"},E.body=O;let D=await G(`/api${T}`,E),n;if(D.headers.get("content-type")?.includes("application/json"))n=await D.json();else n=await D.text();M({status:D.status,data:n})}catch(T){S(T.message||"Request failed")}finally{R(!1)}},x=B?.filter((T)=>T.in==="path")||[],f=B?.filter((T)=>T.in==="query")||[],l=["post","put","patch"].includes(Y)&&K;return S0.jsxDEV("div",{style:{marginTop:16,padding:16,background:"#0a0a14",borderRadius:6,border:"1px solid #222"},children:[S0.jsxDEV("h4",{style:{fontSize:13,color:"#f97316",marginBottom:12,fontWeight:600},children:"Try it out"},void 0,!1,void 0,this),x.length>0&&S0.jsxDEV("div",{style:{marginBottom:12},children:[S0.jsxDEV("div",{style:{fontSize:11,color:"#666",marginBottom:6},children:"Path Parameters"},void 0,!1,void 0,this),x.map((T)=>S0.jsxDEV("div",{style:{marginBottom:8},children:[S0.jsxDEV("label",{style:{fontSize:12,color:"#888",display:"block",marginBottom:4},children:[T.name," ",T.required&&S0.jsxDEV("span",{style:{color:"#f66"},children:"*"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),S0.jsxDEV("input",{type:"text",value:_[T.name]||"",onChange:(m)=>W({..._,[T.name]:m.target.value}),placeholder:T.schema?.type||"string",style:{width:"100%",padding:"8px 12px",background:"#111",border:"1px solid #333",borderRadius:4,color:"#fff",fontSize:13,fontFamily:"monospace"}},void 0,!1,void 0,this)]},T.name,!0,void 0,this))]},void 0,!0,void 0,this),f.length>0&&S0.jsxDEV("div",{style:{marginBottom:12},children:[S0.jsxDEV("div",{style:{fontSize:11,color:"#666",marginBottom:6},children:"Query Parameters"},void 0,!1,void 0,this),f.map((T)=>S0.jsxDEV("div",{style:{marginBottom:8},children:[S0.jsxDEV("label",{style:{fontSize:12,color:"#888",display:"block",marginBottom:4},children:[T.name," ",T.required&&S0.jsxDEV("span",{style:{color:"#f66"},children:"*"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),S0.jsxDEV("input",{type:"text",value:_[T.name]||"",onChange:(m)=>W({..._,[T.name]:m.target.value}),placeholder:T.schema?.type||"string",style:{width:"100%",padding:"8px 12px",background:"#111",border:"1px solid #333",borderRadius:4,color:"#fff",fontSize:13,fontFamily:"monospace"}},void 0,!1,void 0,this)]},T.name,!0,void 0,this))]},void 0,!0,void 0,this),l&&S0.jsxDEV("div",{style:{marginBottom:12},children:[S0.jsxDEV("div",{style:{fontSize:11,color:"#666",marginBottom:6},children:"Request Body (JSON)"},void 0,!1,void 0,this),S0.jsxDEV("textarea",{value:O,onChange:(T)=>F(T.target.value),rows:6,style:{width:"100%",padding:"8px 12px",background:"#111",border:"1px solid #333",borderRadius:4,color:"#fff",fontSize:12,fontFamily:"monospace",resize:"vertical"}},void 0,!1,void 0,this)]},void 0,!0,void 0,this),S0.jsxDEV("button",{onClick:V,disabled:A,style:{padding:"10px 20px",background:A?"#333":"#f97316",color:A?"#666":"#000",border:"none",borderRadius:4,cursor:A?"not-allowed":"pointer",fontSize:13,fontWeight:600},children:A?"Executing...":"Execute"},void 0,!1,void 0,this),k&&S0.jsxDEV("div",{style:{marginTop:12,padding:12,background:"#2a1515",borderRadius:4,color:"#f66",fontSize:12},children:k},void 0,!1,void 0,this),b&&S0.jsxDEV("div",{style:{marginTop:12},children:[S0.jsxDEV("div",{style:{fontSize:11,color:"#666",marginBottom:6},children:["Response"," ",S0.jsxDEV("span",{style:{color:b.status>=200&&b.status<300?"#49cc90":"#f66"},children:b.status},void 0,!1,void 0,this)]},void 0,!0,void 0,this),S0.jsxDEV("pre",{style:{padding:12,background:"#111",borderRadius:4,color:"#888",fontSize:11,fontFamily:"monospace",overflow:"auto",maxHeight:300,whiteSpace:"pre-wrap",wordBreak:"break-word"},children:typeof b.data==="string"?b.data:JSON.stringify(b.data,null,2)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function yO(){let{authFetch:Y}=A1(),[H,B]=M6.useState(null),[K,G]=M6.useState(!0),[_,W]=M6.useState(new Set),[O,F]=M6.useState(null),[b,M]=M6.useState(!1);M6.useEffect(()=>{k()},[]);async function A(){if(!H)return;try{await navigator.clipboard.writeText(JSON.stringify(H,null,2)),M(!0),setTimeout(()=>M(!1),2000)}catch(E){console.error("Failed to copy:",E)}}function R(){if(!H)return;let E=new Blob([JSON.stringify(H,null,2)],{type:"application/json"}),D=URL.createObjectURL(E),n=document.createElement("a");n.href=D,n.download="apteva-openapi.json",n.click(),URL.revokeObjectURL(D)}async function k(){try{let E=await Y("/api/openapi");if(E.ok){let D=await E.json();B(D)}}catch(E){console.error("Failed to load OpenAPI spec:",E)}finally{G(!1)}}function S(E){W((D)=>{let n=new Set(D);if(n.has(E))n.delete(E);else n.add(E);return n})}function V(E,D=0){if(!E)return"{}";if(D>2)return"...";if(E.$ref)return E.$ref.split("/").pop()||"Object";if(E.type==="array")return`${V(E.items,D+1)}[]`;if(E.type==="object"&&E.properties){let n=Object.entries(E.properties).slice(0,3).map(([j,g])=>`${j}: ${g.type||"any"}`).join(", "),c=Object.keys(E.properties).length>3?", ...":"";return`{ ${n}${c} }`}return E.type||"any"}if(K)return S0.jsxDEV("div",{style:{padding:24},children:S0.jsxDEV("p",{style:{color:"#888"},children:"Loading API documentation..."},void 0,!1,void 0,this)},void 0,!1,void 0,this);if(!H)return S0.jsxDEV("div",{style:{padding:24},children:S0.jsxDEV("p",{style:{color:"#f66"},children:"Failed to load API documentation"},void 0,!1,void 0,this)},void 0,!1,void 0,this);let x=H.tags||[],f=Object.entries(H.paths);function l(E){let D=new Set;function n(c){if(!c)return;if(typeof c==="object"){if(c.$ref){let j=c.$ref.split("/").pop();if(j)D.add(j)}for(let j of Object.values(c))n(j)}}return n(E.requestBody),n(E.responses),D}function T(){if(!O||!H.components?.schemas)return Object.keys(H.components?.schemas||{});let E=new Set;for(let[D,n]of m)for(let[c,j]of Object.entries(n)){if(!["get","post","put","delete","patch"].includes(c))continue;if(j.tags?.includes(O))l(j).forEach((Q0)=>E.add(Q0))}return Array.from(E)}let m=O?f.filter(([E,D])=>Object.values(D).some((n)=>n.tags?.includes(O))):f;return S0.jsxDEV("div",{style:{padding:24,maxWidth:1000,height:"100%",overflowY:"auto"},children:[S0.jsxDEV("div",{style:{marginBottom:24},children:[S0.jsxDEV("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",marginBottom:8},children:[S0.jsxDEV("h1",{style:{fontSize:24,fontWeight:600},children:H.info.title},void 0,!1,void 0,this),S0.jsxDEV("div",{style:{display:"flex",gap:8},children:[S0.jsxDEV("button",{onClick:A,style:{padding:"8px 16px",borderRadius:4,border:"1px solid #333",background:b?"#49cc90":"#1a1a2e",color:b?"#000":"#fff",cursor:"pointer",fontSize:12,fontFamily:"inherit"},children:b?"Copied!":"Copy JSON"},void 0,!1,void 0,this),S0.jsxDEV("button",{onClick:R,style:{padding:"8px 16px",borderRadius:4,border:"1px solid #333",background:"#1a1a2e",color:"#fff",cursor:"pointer",fontSize:12,fontFamily:"inherit"},children:"Download"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),S0.jsxDEV("p",{style:{color:"#888",marginBottom:8},children:H.info.description.split(`
|
|
226
|
+
`)[0]},void 0,!1,void 0,this),S0.jsxDEV("p",{style:{color:"#666",fontSize:12},children:["Version: ",H.info.version]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),S0.jsxDEV("div",{style:{background:"#1a1a2e",padding:12,borderRadius:6,marginBottom:24,fontFamily:"monospace"},children:[S0.jsxDEV("span",{style:{color:"#888"},children:"Base URL: "},void 0,!1,void 0,this),S0.jsxDEV("span",{style:{color:"#61affe"},children:[window.location.origin,"/api"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),S0.jsxDEV("div",{style:{marginBottom:24,display:"flex",flexWrap:"wrap",gap:8},children:[S0.jsxDEV("button",{onClick:()=>F(null),style:{padding:"6px 12px",borderRadius:4,border:"1px solid #333",background:O===null?"#333":"transparent",color:O===null?"#fff":"#888",cursor:"pointer",fontSize:12},children:"All"},void 0,!1,void 0,this),x.map((E)=>S0.jsxDEV("button",{onClick:()=>F(E.name),style:{padding:"6px 12px",borderRadius:4,border:"1px solid #333",background:O===E.name?"#333":"transparent",color:O===E.name?"#fff":"#888",cursor:"pointer",fontSize:12},title:E.description,children:E.name},E.name,!1,void 0,this))]},void 0,!0,void 0,this),S0.jsxDEV("div",{style:{display:"flex",flexDirection:"column",gap:8},children:m.map(([E,D])=>Object.entries(D).filter(([n])=>["get","post","put","delete","patch"].includes(n)).map(([n,c])=>{let j=`${n}:${E}`,g=_.has(j),Q0=n.toUpperCase(),r=gT[n]||"#888";return S0.jsxDEV("div",{style:{border:"1px solid #333",borderRadius:6,overflow:"hidden"},children:[S0.jsxDEV("div",{onClick:()=>S(j),style:{display:"flex",alignItems:"center",gap:12,padding:"12px 16px",background:g?"#1a1a2e":"transparent",cursor:"pointer"},children:[S0.jsxDEV("span",{style:{background:r,color:"#000",padding:"4px 8px",borderRadius:4,fontSize:11,fontWeight:600,minWidth:60,textAlign:"center"},children:Q0},void 0,!1,void 0,this),S0.jsxDEV("span",{style:{fontFamily:"monospace",color:"#fff"},children:E},void 0,!1,void 0,this),S0.jsxDEV("span",{style:{color:"#888",flex:1,fontSize:13},children:c.summary},void 0,!1,void 0,this),S0.jsxDEV("span",{style:{color:"#666",fontSize:12},children:g?"[-]":"[+]"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),g&&S0.jsxDEV("div",{style:{padding:16,background:"#0d0d1a",borderTop:"1px solid #333"},children:[c.description&&S0.jsxDEV("p",{style:{color:"#888",marginBottom:16,fontSize:13},children:c.description},void 0,!1,void 0,this),c.parameters&&c.parameters.length>0&&S0.jsxDEV("div",{style:{marginBottom:16},children:[S0.jsxDEV("h4",{style:{fontSize:13,color:"#888",marginBottom:8},children:"Parameters"},void 0,!1,void 0,this),S0.jsxDEV("div",{style:{background:"#1a1a2e",borderRadius:4,padding:12},children:c.parameters.map((U0)=>S0.jsxDEV("div",{style:{display:"flex",gap:12,marginBottom:8,fontSize:12},children:[S0.jsxDEV("span",{style:{color:"#61affe",minWidth:100},children:[U0.name,U0.required&&S0.jsxDEV("span",{style:{color:"#f66"},children:"*"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),S0.jsxDEV("span",{style:{color:"#666"},children:["(",U0.in,")"]},void 0,!0,void 0,this),S0.jsxDEV("span",{style:{color:"#888"},children:U0.schema?.type||"string"},void 0,!1,void 0,this),U0.description&&S0.jsxDEV("span",{style:{color:"#666"},children:["- ",U0.description]},void 0,!0,void 0,this)]},U0.name,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),c.requestBody&&S0.jsxDEV("div",{style:{marginBottom:16},children:[S0.jsxDEV("h4",{style:{fontSize:13,color:"#888",marginBottom:8},children:["Request Body",c.requestBody.required&&S0.jsxDEV("span",{style:{color:"#f66"},children:" (required)"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),S0.jsxDEV("div",{style:{background:"#1a1a2e",borderRadius:4,padding:12,fontFamily:"monospace",fontSize:12,color:"#49cc90"},children:Object.entries(c.requestBody.content||{}).map(([U0,R0])=>S0.jsxDEV("div",{children:[S0.jsxDEV("span",{style:{color:"#666"},children:[U0,": "]},void 0,!0,void 0,this),V(R0.schema)]},U0,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),c.responses&&S0.jsxDEV("div",{children:[S0.jsxDEV("h4",{style:{fontSize:13,color:"#888",marginBottom:8},children:"Responses"},void 0,!1,void 0,this),S0.jsxDEV("div",{style:{background:"#1a1a2e",borderRadius:4,padding:12},children:Object.entries(c.responses).map(([U0,R0])=>{let _0=R0.content?.["application/json"]?.schema,f0=_0?.$ref?.split("/").pop(),P0=_0?.type,a=_0?.items?.$ref?.split("/").pop();return S0.jsxDEV("div",{style:{marginBottom:12,fontSize:12},children:[S0.jsxDEV("div",{style:{display:"flex",gap:12,marginBottom:4},children:[S0.jsxDEV("span",{style:{color:U0.startsWith("2")?"#49cc90":"#f66",minWidth:40},children:U0},void 0,!1,void 0,this),S0.jsxDEV("span",{style:{color:"#888"},children:R0.description},void 0,!1,void 0,this)]},void 0,!0,void 0,this),_0&&S0.jsxDEV("div",{style:{marginLeft:52,padding:"8px 12px",background:"#0d0d1a",borderRadius:4,fontFamily:"monospace"},children:f0?S0.jsxDEV("span",{style:{color:"#61affe"},children:f0},void 0,!1,void 0,this):P0==="array"&&a?S0.jsxDEV("span",{style:{color:"#61affe"},children:[a,"[]"]},void 0,!0,void 0,this):P0==="array"?S0.jsxDEV("span",{style:{color:"#888"},children:"array"},void 0,!1,void 0,this):S0.jsxDEV("span",{style:{color:"#888"},children:V(_0)},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},U0,!0,void 0,this)})},void 0,!1,void 0,this)]},void 0,!0,void 0,this),S0.jsxDEV(uT,{method:n,path:E,parameters:c.parameters,requestBody:c.requestBody,authFetch:Y},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},j,!0,void 0,this)}))},void 0,!1,void 0,this),H.components?.schemas&&T().length>0&&S0.jsxDEV("div",{style:{marginTop:32},children:[S0.jsxDEV("h2",{style:{fontSize:18,fontWeight:600,marginBottom:16},children:["Schemas ",O&&S0.jsxDEV("span",{style:{color:"#666",fontSize:14},children:["(",O,")"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),S0.jsxDEV("div",{style:{display:"flex",flexDirection:"column",gap:8},children:T().map((E)=>{let D=H.components.schemas[E];if(!D)return null;return S0.jsxDEV("div",{style:{border:"1px solid #333",borderRadius:6,padding:12},children:[S0.jsxDEV("h3",{style:{fontSize:14,color:"#61affe",marginBottom:8},children:E},void 0,!1,void 0,this),D.properties&&S0.jsxDEV("div",{style:{fontSize:12},children:Object.entries(D.properties).map(([n,c])=>S0.jsxDEV("div",{style:{display:"flex",gap:8,marginBottom:4,fontFamily:"monospace"},children:[S0.jsxDEV("span",{style:{color:"#fff",minWidth:120},children:n},void 0,!1,void 0,this),S0.jsxDEV("span",{style:{color:"#888"},children:[c.type||(c.$ref?c.$ref.split("/").pop():"any"),c.nullable&&" | null"]},void 0,!0,void 0,this),c.enum&&S0.jsxDEV("span",{style:{color:"#666"},children:["[",c.enum.join(" | "),"]"]},void 0,!0,void 0,this)]},n,!0,void 0,this))},void 0,!1,void 0,this)]},E,!0,void 0,this)})},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}var M4=H0(H1(),1);function ET(){let{isAuthenticated:Y,isLoading:H,hasUsers:B,accessToken:K,checkAuth:G}=A1(),{currentProjectId:_,refreshProjects:W}=G4(),O=mX(),F=lH(),{isComplete:b,setIsComplete:M}=nH(),A=()=>{return K?{Authorization:`Bearer ${K}`}:{}},R=Y&&b===!0,{agents:k,loading:S,runningCount:V,fetchAgents:x,createAgent:f,updateAgent:l,deleteAgent:T,toggleAgent:m}=oH(R),{providers:E,configuredProviders:D,fetchProviders:n}=aH(R),c=D.filter((O0)=>O0.type==="llm"),j=w6.useMemo(()=>{if(_===null)return k.length;if(_==="unassigned")return k.filter((O0)=>!O0.projectId).length;return k.filter((O0)=>O0.projectId===_).length},[k,_]),[g,Q0]=w6.useState(!1),[r,U0]=w6.useState(null),[R0,_0]=w6.useState("dashboard"),[f0,P0]=w6.useState(null),[a,Y0]=w6.useState(0),[B0,G0]=w6.useState(!1);w6.useEffect(()=>{if(!R)return;(async()=>{try{let V0="/api/tasks?status=pending";if(_!==null)V0+=`&project_id=${encodeURIComponent(_)}`;let q1=await fetch(V0,{headers:A()});if(q1.ok){let y1=await q1.json();Y0(y1.count??(y1.tasks||[]).length)}}catch{}})()},[R,K,_,k,O,F]);let[h0,z0]=w6.useState({name:"",model:"",provider:"",systemPrompt:"You are a helpful assistant.",features:{...xH},mcpServers:[],skills:[]});w6.useEffect(()=>{if(c.length>0&&!h0.provider){let O0=c[0],V0=O0.models.find((q1)=>q1.recommended)?.value||O0.models[0]?.value||"";z0((q1)=>({...q1,provider:O0.id,model:V0}))}},[c,h0.provider]),w6.useEffect(()=>{if(r){let O0=k.find((V0)=>V0.id===r.id);if(O0)U0(O0);else U0(null)}},[k,r]);let v0=(O0)=>{let V0=E.find((y1)=>y1.id===O0),q1=V0?.models.find((y1)=>y1.recommended)?.value||V0?.models[0]?.value||"";z0((y1)=>({...y1,provider:O0,model:q1}))},j0=async()=>{if(!h0.name)return;await f(h0),await W();let O0=c[0],V0=O0?.models.find((q1)=>q1.recommended)?.value||O0?.models[0]?.value||"";z0({name:"",model:V0,provider:O0?.id||"",systemPrompt:"You are a helpful assistant.",features:{...xH},mcpServers:[],skills:[]}),Q0(!1)},Y1=async(O0,V0)=>{V0?.stopPropagation(),P0(null);let q1=await m(O0);if(q1.error)P0(q1.error)},m0=async(O0,V0)=>{if(V0?.stopPropagation(),r?.id===O0)U0(null);await T(O0),await W()},F1=(O0)=>{U0(O0),P0(null),_0("agents")},R1=(O0)=>{_0(O0),U0(null)},p=()=>{M(!0),n(),G()};if(H||B===null)return M4.jsxDEV(T2,{fullScreen:!0},void 0,!1,void 0,this);if(!B)return M4.jsxDEV(dX,{onComplete:p,needsAccount:!0},void 0,!1,void 0,this);if(!Y)return M4.jsxDEV(wJ,{},void 0,!1,void 0,this);if(b===null)return M4.jsxDEV(T2,{fullScreen:!0},void 0,!1,void 0,this);if(!b)return M4.jsxDEV(dX,{onComplete:p,needsAccount:!1},void 0,!1,void 0,this);return M4.jsxDEV("div",{className:"h-screen bg-[#0a0a0a] text-[#e0e0e0] font-mono flex flex-col overflow-hidden",children:[M4.jsxDEV(NJ,{onMenuClick:()=>G0(!0)},void 0,!1,void 0,this),f0&&M4.jsxDEV(MJ,{message:f0,onDismiss:()=>P0(null)},void 0,!1,void 0,this),M4.jsxDEV("div",{className:"flex flex-1 overflow-hidden",children:[M4.jsxDEV(RJ,{route:R0,agentCount:j,taskCount:a,onNavigate:R1,isOpen:B0,onClose:()=>G0(!1)},void 0,!1,void 0,this),M4.jsxDEV("main",{className:"flex-1 overflow-hidden flex",children:[R0==="settings"&&M4.jsxDEV(bJ,{},void 0,!1,void 0,this),R0==="activity"&&M4.jsxDEV(vJ,{agents:k,loading:S},void 0,!1,void 0,this),R0==="agents"&&M4.jsxDEV(TJ,{agents:k,loading:S,selectedAgent:r,providers:E,onSelectAgent:F1,onCloseAgent:()=>U0(null),onToggleAgent:Y1,onDeleteAgent:m0,onUpdateAgent:l,onNewAgent:()=>Q0(!0),canCreateAgent:c.length>0},void 0,!1,void 0,this),R0==="dashboard"&&M4.jsxDEV(CJ,{agents:k,loading:S,runningCount:V,configuredProviders:D,onNavigate:R1,onSelectAgent:F1},void 0,!1,void 0,this),R0==="tasks"&&M4.jsxDEV(fJ,{},void 0,!1,void 0,this),R0==="mcp"&&M4.jsxDEV(hJ,{},void 0,!1,void 0,this),R0==="skills"&&M4.jsxDEV(LG,{},void 0,!1,void 0,this),R0==="tests"&&M4.jsxDEV(NG,{},void 0,!1,void 0,this),R0==="telemetry"&&M4.jsxDEV(RG,{},void 0,!1,void 0,this),R0==="api"&&M4.jsxDEV(yO,{},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),g&&M4.jsxDEV(AJ,{form:h0,providers:E,configuredProviders:D,onFormChange:z0,onProviderChange:v0,onCreate:j0,onClose:()=>Q0(!1),onGoToSettings:()=>{Q0(!1),_0("settings")}},void 0,!1,void 0,this),M4.jsxDEV(PO,{},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function xT(){return M4.jsxDEV(cH,{children:M4.jsxDEV(iH,{children:M4.jsxDEV(FO,{children:M4.jsxDEV(jH,{children:M4.jsxDEV(ET,{},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this)}var pT=VO.createRoot(document.getElementById("root"));pT.render(M4.jsxDEV(xT,{},void 0,!1,void 0,this));
|
|
227
|
+
|
|
228
|
+
//# debugId=8A1ED07200C825C964756E2164756E21
|