apteva 0.3.8 → 0.3.9

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.
@@ -0,0 +1,227 @@
1
+ var EP=Object.create;var{getPrototypeOf:mP,defineProperty:OO,getOwnPropertyNames:uP}=Object;var gP=Object.prototype.hasOwnProperty;var q0=(Y,G,U)=>{U=Y!=null?EP(mP(Y)):{};let W=G||!Y||!Y.__esModule?OO(U,"default",{value:Y,enumerable:!0}):U;for(let q of uP(Y))if(!gP.call(W,q))OO(W,q,{get:()=>Y[q],enumerable:!0});return W};var Wz=(Y,G)=>()=>(G||Y((G={exports:{}}).exports,G),G.exports);var I1=Wz((xP,X3)=>{(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",G=Symbol.for("react.element"),U=Symbol.for("react.portal"),W=Symbol.for("react.fragment"),q=Symbol.for("react.strict_mode"),R=Symbol.for("react.profiler"),L=Symbol.for("react.provider"),_=Symbol.for("react.context"),k=Symbol.for("react.forward_ref"),I=Symbol.for("react.suspense"),F=Symbol.for("react.suspense_list"),w=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),C=Symbol.for("react.offscreen"),f=Symbol.iterator,E="@@iterator";function V(O){if(O===null||typeof O!=="object")return null;var y=f&&O[f]||O[E];if(typeof y==="function")return y;return null}var v={current:null},T={transition:null},D={current:null,isBatchingLegacy:!1,didScheduleLegacyUpdate:!1},n={current:null},p={},r=null;function J0(O){r=O}p.setExtraStackFrame=function(O){r=O},p.getCurrentStack=null,p.getStackAddendum=function(){var O="";if(r)O+=r;var y=p.getCurrentStack;if(y)O+=y()||"";return O};var i=!1,t=!1,l=!1,j=!1,c=!1,X0={ReactCurrentDispatcher:v,ReactCurrentBatchConfig:T,ReactCurrentOwner:n};X0.ReactDebugCurrentFrame=p,X0.ReactCurrentActQueue=D;function I0(O){{for(var y=arguments.length,s=Array(y>1?y-1:0),$0=1;$0<y;$0++)s[$0-1]=arguments[$0];Q1("warn",O,s)}}function F0(O){{for(var y=arguments.length,s=Array(y>1?y-1:0),$0=1;$0<y;$0++)s[$0-1]=arguments[$0];Q1("error",O,s)}}function Q1(O,y,s){{var $0=X0.ReactDebugCurrentFrame,A0=$0.getStackAddendum();if(A0!=="")y+="%s",s=s.concat([A0]);var q1=s.map(function(c0){return String(c0)});q1.unshift("Warning: "+y),Function.prototype.apply.call(console[O],console,q1)}}var O1={};function Q0(O,y){{var s=O.constructor,$0=s&&(s.displayName||s.name)||"ReactClass",A0=$0+"."+y;if(O1[A0])return;F0("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.",y,$0),O1[A0]=!0}}var U0={isMounted:function(O){return!1},enqueueForceUpdate:function(O,y,s){Q0(O,"forceUpdate")},enqueueReplaceState:function(O,y,s,$0){Q0(O,"replaceState")},enqueueSetState:function(O,y,s,$0){Q0(O,"setState")}},_0=Object.assign,Z0={};Object.freeze(Z0);function d(O,y,s){this.props=O,this.context=y,this.refs=Z0,this.updater=s||U0}d.prototype.isReactComponent={},d.prototype.setState=function(O,y){if(typeof O!=="object"&&typeof O!=="function"&&O!=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,O,y,"setState")},d.prototype.forceUpdate=function(O){this.updater.enqueueForceUpdate(this,O,"forceUpdate")};{var P0={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(O,y){Object.defineProperty(d.prototype,O,{get:function(){I0("%s(...) is deprecated in plain JavaScript React classes. %s",y[0],y[1]);return}})};for(var X1 in P0)if(P0.hasOwnProperty(X1))v0(X1,P0[X1])}function r0(){}r0.prototype=d.prototype;function V0(O,y,s){this.props=O,this.context=y,this.refs=Z0,this.updater=s||U0}var $1=V0.prototype=new r0;$1.constructor=V0,_0($1,d.prototype),$1.isPureReactComponent=!0;function L0(){var O={current:null};return Object.seal(O),O}var a0=Array.isArray;function f1(O){return a0(O)}function q4(O){{var y=typeof Symbol==="function"&&Symbol.toStringTag,s=y&&O[Symbol.toStringTag]||O.constructor.name||"Object";return s}}function h4(O){try{return g1(O),!1}catch(y){return!0}}function g1(O){return""+O}function K1(O){if(h4(O))return F0("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",q4(O)),g1(O)}function r4(O,y,s){var $0=O.displayName;if($0)return $0;var A0=y.displayName||y.name||"";return A0!==""?s+"("+A0+")":s}function o4(O){return O.displayName||"Context"}function k4(O){if(O==null)return null;if(typeof O.tag==="number")F0("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.");if(typeof O==="function")return O.displayName||O.name||null;if(typeof O==="string")return O;switch(O){case W:return"Fragment";case U:return"Portal";case R:return"Profiler";case q:return"StrictMode";case I:return"Suspense";case F:return"SuspenseList"}if(typeof O==="object")switch(O.$$typeof){case _:var y=O;return o4(y)+".Consumer";case L:var s=O;return o4(s._context)+".Provider";case k:return r4(O,O.render,"ForwardRef");case w:var $0=O.displayName||null;if($0!==null)return $0;return k4(O.type)||"Memo";case b:{var A0=O,q1=A0._payload,c0=A0._init;try{return k4(c0(q1))}catch(W1){return null}}}return null}var y4=Object.prototype.hasOwnProperty,D5={key:!0,ref:!0,__self:!0,__source:!0},W4,F6,L4;L4={};function M6(O){if(y4.call(O,"ref")){var y=Object.getOwnPropertyDescriptor(O,"ref").get;if(y&&y.isReactWarning)return!1}return O.ref!==void 0}function M4(O){if(y4.call(O,"key")){var y=Object.getOwnPropertyDescriptor(O,"key").get;if(y&&y.isReactWarning)return!1}return O.key!==void 0}function T4(O,y){var s=function(){if(!W4)W4=!0,F0("%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)",y)};s.isReactWarning=!0,Object.defineProperty(O,"key",{get:s,configurable:!0})}function W6(O,y){var s=function(){if(!F6)F6=!0,F0("%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)",y)};s.isReactWarning=!0,Object.defineProperty(O,"ref",{get:s,configurable:!0})}function E6(O){if(typeof O.ref==="string"&&n.current&&O.__self&&n.current.stateNode!==O.__self){var y=k4(n.current.type);if(!L4[y])F0('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',y,O.ref),L4[y]=!0}}var j4=function(O,y,s,$0,A0,q1,c0){var W1={$$typeof:G,type:O,key:y,ref:s,props:c0,_owner:q1};if(W1._store={},Object.defineProperty(W1._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(W1,"_self",{configurable:!1,enumerable:!1,writable:!1,value:$0}),Object.defineProperty(W1,"_source",{configurable:!1,enumerable:!1,writable:!1,value:A0}),Object.freeze)Object.freeze(W1.props),Object.freeze(W1);return W1};function t4(O,y,s){var $0,A0={},q1=null,c0=null,W1=null,E1=null;if(y!=null){if(M6(y))c0=y.ref,E6(y);if(M4(y))K1(y.key),q1=""+y.key;W1=y.__self===void 0?null:y.__self,E1=y.__source===void 0?null:y.__source;for($0 in y)if(y4.call(y,$0)&&!D5.hasOwnProperty($0))A0[$0]=y[$0]}var Q4=arguments.length-2;if(Q4===1)A0.children=s;else if(Q4>1){var _4=Array(Q4);for(var R4=0;R4<Q4;R4++)_4[R4]=arguments[R4+2];if(Object.freeze)Object.freeze(_4);A0.children=_4}if(O&&O.defaultProps){var C4=O.defaultProps;for($0 in C4)if(A0[$0]===void 0)A0[$0]=C4[$0]}if(q1||c0){var p4=typeof O==="function"?O.displayName||O.name||"Unknown":O;if(q1)T4(A0,p4);if(c0)W6(A0,p4)}return j4(O,q1,c0,W1,E1,n.current,A0)}function T0(O,y){var s=j4(O.type,y,O.ref,O._self,O._source,O._owner,O.props);return s}function t0(O,y,s){if(O===null||O===void 0)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+O+".");var $0,A0=_0({},O.props),q1=O.key,c0=O.ref,W1=O._self,E1=O._source,Q4=O._owner;if(y!=null){if(M6(y))c0=y.ref,Q4=n.current;if(M4(y))K1(y.key),q1=""+y.key;var _4;if(O.type&&O.type.defaultProps)_4=O.type.defaultProps;for($0 in y)if(y4.call(y,$0)&&!D5.hasOwnProperty($0))if(y[$0]===void 0&&_4!==void 0)A0[$0]=_4[$0];else A0[$0]=y[$0]}var R4=arguments.length-2;if(R4===1)A0.children=s;else if(R4>1){var C4=Array(R4);for(var p4=0;p4<R4;p4++)C4[p4]=arguments[p4+2];A0.children=C4}return j4(O.type,q1,c0,W1,E1,Q4,A0)}function J1(O){return typeof O==="object"&&O!==null&&O.$$typeof===G}var x1=".",t1=":";function V4(O){var y=/[=:]/g,s={"=":"=0",":":"=2"},$0=O.replace(y,function(A0){return s[A0]});return"$"+$0}var H4=!1,a4=/\/+/g;function F1(O){return O.replace(a4,"$&/")}function N1(O,y){if(typeof O==="object"&&O!==null&&O.key!=null)return K1(O.key),V4(""+O.key);return y.toString(36)}function c6(O,y,s,$0,A0){var q1=typeof O;if(q1==="undefined"||q1==="boolean")O=null;var c0=!1;if(O===null)c0=!0;else switch(q1){case"string":case"number":c0=!0;break;case"object":switch(O.$$typeof){case G:case U:c0=!0}}if(c0){var W1=O,E1=A0(W1),Q4=$0===""?x1+N1(W1,0):$0;if(f1(E1)){var _4="";if(Q4!=null)_4=F1(Q4)+"/";c6(E1,y,_4,"",function(C3){return C3})}else if(E1!=null){if(J1(E1)){if(E1.key&&(!W1||W1.key!==E1.key))K1(E1.key);E1=T0(E1,s+(E1.key&&(!W1||W1.key!==E1.key)?F1(""+E1.key)+"/":"")+Q4)}y.push(E1)}return 1}var R4,C4,p4=0,i1=$0===""?x1:$0+t1;if(f1(O))for(var m8=0;m8<O.length;m8++)R4=O[m8],C4=i1+N1(R4,m8),p4+=c6(R4,y,s,C4,A0);else{var fz=V(O);if(typeof fz==="function"){var tQ=O;if(fz===tQ.entries){if(!H4)I0("Using Maps as children is not supported. Use an array of keyed ReactElements instead.");H4=!0}var T3=fz.call(tQ),M7,sQ=0;while(!(M7=T3.next()).done)R4=M7.value,C4=i1+N1(R4,sQ++),p4+=c6(R4,y,s,C4,A0)}else if(q1==="object"){var eQ=String(O);throw Error("Objects are not valid as a React child (found: "+(eQ==="[object Object]"?"object with keys {"+Object.keys(O).join(", ")+"}":eQ)+"). If you meant to render a collection of children, use an array instead.")}}return p4}function L6(O,y,s){if(O==null)return O;var $0=[],A0=0;return c6(O,$0,"","",function(q1){return y.call(s,q1,A0++)}),$0}function l6(O){var y=0;return L6(O,function(){y++}),y}function Q7(O,y,s){L6(O,function(){y.apply(this,arguments)},s)}function E5(O){return L6(O,function(y){return y})||[]}function X7(O){if(!J1(O))throw Error("React.Children.only expected to receive a single React element child.");return O}function F5(O){var y={$$typeof:_,_currentValue:O,_currentValue2:O,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null};y.Provider={$$typeof:L,_context:y};var s=!1,$0=!1,A0=!1;{var q1={$$typeof:_,_context:y};Object.defineProperties(q1,{Provider:{get:function(){if(!$0)$0=!0,F0("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 y.Provider},set:function(c0){y.Provider=c0}},_currentValue:{get:function(){return y._currentValue},set:function(c0){y._currentValue=c0}},_currentValue2:{get:function(){return y._currentValue2},set:function(c0){y._currentValue2=c0}},_threadCount:{get:function(){return y._threadCount},set:function(c0){y._threadCount=c0}},Consumer:{get:function(){if(!s)s=!0,F0("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 y.Consumer}},displayName:{get:function(){return y.displayName},set:function(c0){if(!A0)I0("Setting `displayName` on Context.Consumer has no effect. You should set it directly on the context with Context.displayName = '%s'.",c0),A0=!0}}}),y.Consumer=q1}return y._currentRenderer=null,y._currentRenderer2=null,y}var m6=-1,m5=0,V1=1,s1=2;function B4(O){if(O._status===m6){var y=O._result,s=y();if(s.then(function(q1){if(O._status===m5||O._status===m6){var c0=O;c0._status=V1,c0._result=q1}},function(q1){if(O._status===m5||O._status===m6){var c0=O;c0._status=s1,c0._result=q1}}),O._status===m6){var $0=O;$0._status=m5,$0._result=s}}if(O._status===V1){var A0=O._result;if(A0===void 0)F0(`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?`,A0);if(!("default"in A0))F0(`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'))`,A0);return A0.default}else throw O._result}function d1(O){var y={_status:m6,_result:O},s={$$typeof:b,_payload:y,_init:B4};{var $0,A0;Object.defineProperties(s,{defaultProps:{configurable:!0,get:function(){return $0},set:function(q1){F0("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."),$0=q1,Object.defineProperty(s,"defaultProps",{enumerable:!0})}},propTypes:{configurable:!0,get:function(){return A0},set:function(q1){F0("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."),A0=q1,Object.defineProperty(s,"propTypes",{enumerable:!0})}}})}return s}function h(O){{if(O!=null&&O.$$typeof===w)F0("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...)).");else if(typeof O!=="function")F0("forwardRef requires a render function but was given %s.",O===null?"null":typeof O);else if(O.length!==0&&O.length!==2)F0("forwardRef render functions accept exactly two parameters: props and ref. %s",O.length===1?"Did you forget to use the ref parameter?":"Any additional parameter will be undefined.");if(O!=null){if(O.defaultProps!=null||O.propTypes!=null)F0("forwardRef render functions do not support propTypes or defaultProps. Did you accidentally pass a React component?")}}var y={$$typeof:k,render:O};{var s;Object.defineProperty(y,"displayName",{enumerable:!1,configurable:!0,get:function(){return s},set:function($0){if(s=$0,!O.name&&!O.displayName)O.displayName=$0}})}return y}var H0=Symbol.for("react.module.reference");function R0(O){if(typeof O==="string"||typeof O==="function")return!0;if(O===W||O===R||c||O===q||O===I||O===F||j||O===C||i||t||l)return!0;if(typeof O==="object"&&O!==null){if(O.$$typeof===b||O.$$typeof===w||O.$$typeof===L||O.$$typeof===_||O.$$typeof===k||O.$$typeof===H0||O.getModuleId!==void 0)return!0}return!1}function A(O,y){if(!R0(O))F0("memo: The first argument must be a component. Instead received: %s",O===null?"null":typeof O);var s={$$typeof:w,type:O,compare:y===void 0?null:y};{var $0;Object.defineProperty(s,"displayName",{enumerable:!1,configurable:!0,get:function(){return $0},set:function(A0){if($0=A0,!O.name&&!O.displayName)O.displayName=A0}})}return s}function x(){var O=v.current;if(O===null)F0(`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 O}function O0(O){var y=x();if(O._context!==void 0){var s=O._context;if(s.Consumer===O)F0("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(s.Provider===O)F0("Calling useContext(Context.Provider) is not supported. Did you mean to call useContext(Context) instead?")}return y.useContext(O)}function M0(O){var y=x();return y.useState(O)}function S0(O,y,s){var $0=x();return $0.useReducer(O,y,s)}function i0(O){var y=x();return y.useRef(O)}function g0(O,y){var s=x();return s.useEffect(O,y)}function W0(O,y){var s=x();return s.useInsertionEffect(O,y)}function k0(O,y){var s=x();return s.useLayoutEffect(O,y)}function n0(O,y){var s=x();return s.useCallback(O,y)}function D1(O,y){var s=x();return s.useMemo(O,y)}function e1(O,y,s){var $0=x();return $0.useImperativeHandle(O,y,s)}function i6(O,y){{var s=x();return s.useDebugValue(O,y)}}function q5(){var O=x();return O.useTransition()}function P4(O){var y=x();return y.useDeferredValue(O)}function T1(){var O=x();return O.useId()}function b7(O,y,s){var $0=x();return $0.useSyncExternalStore(O,y,s)}var Z7=0,gQ,xQ,jQ,pQ,dQ,cQ,lQ;function gZ(){}gZ.__reactDisabledLog=!0;function A3(){{if(Z7===0){gQ=console.log,xQ=console.info,jQ=console.warn,pQ=console.error,dQ=console.group,cQ=console.groupCollapsed,lQ=console.groupEnd;var O={configurable:!0,enumerable:!0,value:gZ,writable:!0};Object.defineProperties(console,{info:O,log:O,warn:O,error:O,group:O,groupCollapsed:O,groupEnd:O})}Z7++}}function iQ(){{if(Z7--,Z7===0){var O={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:_0({},O,{value:gQ}),info:_0({},O,{value:xQ}),warn:_0({},O,{value:jQ}),error:_0({},O,{value:pQ}),group:_0({},O,{value:dQ}),groupCollapsed:_0({},O,{value:cQ}),groupEnd:_0({},O,{value:lQ})})}if(Z7<0)F0("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var V8=X0.ReactCurrentDispatcher,M5;function r7(O,y,s){{if(M5===void 0)try{throw Error()}catch(A0){var $0=A0.stack.trim().match(/\n( *(at )?)/);M5=$0&&$0[1]||""}return`
14
+ `+M5+O}}var t7=!1,kz;{var oQ=typeof WeakMap==="function"?WeakMap:Map;kz=new oQ}function xZ(O,y){if(!O||t7)return"";{var s=kz.get(O);if(s!==void 0)return s}var $0;t7=!0;var A0=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var q1;q1=V8.current,V8.current=null,A3();try{if(y){var c0=function(){throw Error()};if(Object.defineProperty(c0.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==="object"&&Reflect.construct){try{Reflect.construct(c0,[])}catch(i1){$0=i1}Reflect.construct(O,[],c0)}else{try{c0.call()}catch(i1){$0=i1}O.call(c0.prototype)}}else{try{throw Error()}catch(i1){$0=i1}O()}}catch(i1){if(i1&&$0&&typeof i1.stack==="string"){var W1=i1.stack.split(`
15
+ `),E1=$0.stack.split(`
16
+ `),Q4=W1.length-1,_4=E1.length-1;while(Q4>=1&&_4>=0&&W1[Q4]!==E1[_4])_4--;for(;Q4>=1&&_4>=0;Q4--,_4--)if(W1[Q4]!==E1[_4]){if(Q4!==1||_4!==1)do if(Q4--,_4--,_4<0||W1[Q4]!==E1[_4]){var R4=`
17
+ `+W1[Q4].replace(" at new "," at ");if(O.displayName&&R4.includes("<anonymous>"))R4=R4.replace("<anonymous>",O.displayName);if(typeof O==="function")kz.set(O,R4);return R4}while(Q4>=1&&_4>=0);break}}}finally{t7=!1,V8.current=q1,iQ(),Error.prepareStackTrace=A0}var C4=O?O.displayName||O.name:"",p4=C4?r7(C4):"";if(typeof O==="function")kz.set(O,p4);return p4}function aQ(O,y,s){return xZ(O,!1)}function I3(O){var y=O.prototype;return!!(y&&y.isReactComponent)}function s7(O,y,s){if(O==null)return"";if(typeof O==="function")return xZ(O,I3(O));if(typeof O==="string")return r7(O);switch(O){case I:return r7("Suspense");case F:return r7("SuspenseList")}if(typeof O==="object")switch(O.$$typeof){case k:return aQ(O.render);case w:return s7(O.type,y,s);case b:{var $0=O,A0=$0._payload,q1=$0._init;try{return s7(q1(A0),y,s)}catch(c0){}}}return""}var jZ={},nQ=X0.ReactDebugCurrentFrame;function Tz(O){if(O){var y=O._owner,s=s7(O.type,O._source,y?y.type:null);nQ.setExtraStackFrame(s)}else nQ.setExtraStackFrame(null)}function pZ(O,y,s,$0,A0){{var q1=Function.call.bind(y4);for(var c0 in O)if(q1(O,c0)){var W1=void 0;try{if(typeof O[c0]!=="function"){var E1=Error(($0||"React class")+": "+s+" type `"+c0+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof O[c0]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw E1.name="Invariant Violation",E1}W1=O[c0](y,c0,$0,s,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(Q4){W1=Q4}if(W1&&!(W1 instanceof Error))Tz(A0),F0("%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).",$0||"React class",s,c0,typeof W1),Tz(null);if(W1 instanceof Error&&!(W1.message in jZ))jZ[W1.message]=!0,Tz(A0),F0("Failed %s type: %s",s,W1.message),Tz(null)}}}function p1(O){if(O){var y=O._owner,s=s7(O.type,O._source,y?y.type:null);J0(s)}else J0(null)}var dZ=!1;function rQ(){if(n.current){var O=k4(n.current.type);if(O)return`
18
+
19
+ Check the render method of \``+O+"`."}return""}function M1(O){if(O!==void 0){var y=O.fileName.replace(/^.*[\\\/]/,""),s=O.lineNumber;return`
20
+
21
+ Check your code at `+y+":"+s+"."}return""}function cZ(O){if(O!==null&&O!==void 0)return M1(O.__source);return""}var u6={};function D8(O){var y=rQ();if(!y){var s=typeof O==="string"?O:O.displayName||O.name;if(s)y=`
22
+
23
+ Check the top-level render call using <`+s+">."}return y}function e7(O,y){if(!O._store||O._store.validated||O.key!=null)return;O._store.validated=!0;var s=D8(y);if(u6[s])return;u6[s]=!0;var $0="";if(O&&O._owner&&O._owner!==n.current)$0=" It was passed a child from "+k4(O._owner.type)+".";p1(O),F0('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',s,$0),p1(null)}function lZ(O,y){if(typeof O!=="object")return;if(f1(O))for(var s=0;s<O.length;s++){var $0=O[s];if(J1($0))e7($0,y)}else if(J1(O)){if(O._store)O._store.validated=!0}else if(O){var A0=V(O);if(typeof A0==="function"){if(A0!==O.entries){var q1=A0.call(O),c0;while(!(c0=q1.next()).done)if(J1(c0.value))e7(c0.value,y)}}}}function _6(O){{var y=O.type;if(y===null||y===void 0||typeof y==="string")return;var s;if(typeof y==="function")s=y.propTypes;else if(typeof y==="object"&&(y.$$typeof===k||y.$$typeof===w))s=y.propTypes;else return;if(s){var $0=k4(y);pZ(s,O.props,"prop",$0,O)}else if(y.PropTypes!==void 0&&!dZ){dZ=!0;var A0=k4(y);F0("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",A0||"Unknown")}if(typeof y.getDefaultProps==="function"&&!y.getDefaultProps.isReactClassApproved)F0("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function m4(O){{var y=Object.keys(O.props);for(var s=0;s<y.length;s++){var $0=y[s];if($0!=="children"&&$0!=="key"){p1(O),F0("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",$0),p1(null);break}}if(O.ref!==null)p1(O),F0("Invalid attribute `ref` supplied to `React.Fragment`."),p1(null)}}function iZ(O,y,s){var $0=R0(O);if(!$0){var A0="";if(O===void 0||typeof O==="object"&&O!==null&&Object.keys(O).length===0)A0+=" 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=cZ(y);if(q1)A0+=q1;else A0+=rQ();var c0;if(O===null)c0="null";else if(f1(O))c0="array";else if(O!==void 0&&O.$$typeof===G)c0="<"+(k4(O.type)||"Unknown")+" />",A0=" Did you accidentally export a JSX literal instead of a component?";else c0=typeof O;F0("React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",c0,A0)}var W1=t4.apply(this,arguments);if(W1==null)return W1;if($0)for(var E1=2;E1<arguments.length;E1++)lZ(arguments[E1],O);if(O===W)m4(W1);else _6(W1);return W1}var B5=!1;function Q5(O){var y=iZ.bind(null,O);y.type=O;{if(!B5)B5=!0,I0("React.createFactory() is deprecated and will be removed in a future major release. Consider using JSX or use React.createElement() directly instead.");Object.defineProperty(y,"type",{enumerable:!1,get:function(){return I0("Factory.type is deprecated. Access the class directly before passing it to createFactory."),Object.defineProperty(this,"type",{value:O}),O}})}return y}function J7(O,y,s){var $0=t0.apply(this,arguments);for(var A0=2;A0<arguments.length;A0++)lZ(arguments[A0],$0.type);return _6($0),$0}function k3(O,y){var s=T.transition;T.transition={};var $0=T.transition;T.transition._updatedFibers=new Set;try{O()}finally{if(T.transition=s,s===null&&$0._updatedFibers){var A0=$0._updatedFibers.size;if(A0>10)I0("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.");$0._updatedFibers.clear()}}}var Cz=!1,E8=null;function oZ(O){if(E8===null)try{var y=("require"+Math.random()).slice(0,7),s=X3&&X3[y];E8=s.call(X3,"timers").setImmediate}catch($0){E8=function(A0){if(Cz===!1){if(Cz=!0,typeof MessageChannel>"u")F0("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 q1=new MessageChannel;q1.port1.onmessage=A0,q1.port2.postMessage(void 0)}}return E8(O)}var z8=0,aZ=!1;function nZ(O){{var y=z8;if(z8++,D.current===null)D.current=[];var s=D.isBatchingLegacy,$0;try{if(D.isBatchingLegacy=!0,$0=O(),!s&&D.didScheduleLegacyUpdate){var A0=D.current;if(A0!==null)D.didScheduleLegacyUpdate=!1,Sz(A0)}}catch(C4){throw F7(y),C4}finally{D.isBatchingLegacy=s}if($0!==null&&typeof $0==="object"&&typeof $0.then==="function"){var q1=$0,c0=!1,W1={then:function(C4,p4){c0=!0,q1.then(function(i1){if(F7(y),z8===0)vz(i1,C4,p4);else C4(i1)},function(i1){F7(y),p4(i1)})}};if(!aZ&&typeof Promise<"u")Promise.resolve().then(function(){}).then(function(){if(!c0)aZ=!0,F0("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 W1}else{var E1=$0;if(F7(y),z8===0){var Q4=D.current;if(Q4!==null)Sz(Q4),D.current=null;var _4={then:function(C4,p4){if(D.current===null)D.current=[],vz(E1,C4,p4);else C4(E1)}};return _4}else{var R4={then:function(C4,p4){C4(E1)}};return R4}}}}function F7(O){{if(O!==z8-1)F0("You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. ");z8=O}}function vz(O,y,s){{var $0=D.current;if($0!==null)try{Sz($0),oZ(function(){if($0.length===0)D.current=null,y(O);else vz(O,y,s)})}catch(A0){s(A0)}else y(O)}}var Q8=!1;function Sz(O){if(!Q8){Q8=!0;var y=0;try{for(;y<O.length;y++){var s=O[y];do s=s(!0);while(s!==null)}O.length=0}catch($0){throw O=O.slice(y+1),$0}finally{Q8=!1}}}var rZ=iZ,tZ=J7,sZ=Q5,eZ={map:L6,forEach:Q7,count:l6,toArray:E5,only:X7};if(xP.Children=eZ,xP.Component=d,xP.Fragment=W,xP.Profiler=R,xP.PureComponent=V0,xP.StrictMode=q,xP.Suspense=I,xP.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=X0,xP.act=nZ,xP.cloneElement=tZ,xP.createContext=F5,xP.createElement=rZ,xP.createFactory=sZ,xP.createRef=L0,xP.forwardRef=h,xP.isValidElement=J1,xP.lazy=d1,xP.memo=A,xP.startTransition=k3,xP.unstable_act=nZ,xP.useCallback=n0,xP.useContext=O0,xP.useDebugValue=i6,xP.useDeferredValue=P4,xP.useEffect=g0,xP.useId=T1,xP.useImperativeHandle=e1,xP.useInsertionEffect=W0,xP.useLayoutEffect=k0,xP.useMemo=D1,xP.useReducer=S0,xP.useRef=i0,xP.useState=M0,xP.useSyncExternalStore=b7,xP.useTransition=q5,xP.version=Y,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==="function")__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()});var WO=Wz((jP)=>{(function(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==="function")__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var Y=!1,G=!1,U=5;function W(T0,t0){var J1=T0.length;T0.push(t0),L(T0,t0,J1)}function q(T0){return T0.length===0?null:T0[0]}function R(T0){if(T0.length===0)return null;var t0=T0[0],J1=T0.pop();if(J1!==t0)T0[0]=J1,_(T0,J1,0);return t0}function L(T0,t0,J1){var x1=J1;while(x1>0){var t1=x1-1>>>1,V4=T0[t1];if(k(V4,t0)>0)T0[t1]=t0,T0[x1]=V4,x1=t1;else return}}function _(T0,t0,J1){var x1=J1,t1=T0.length,V4=t1>>>1;while(x1<V4){var H4=(x1+1)*2-1,a4=T0[H4],F1=H4+1,N1=T0[F1];if(k(a4,t0)<0)if(F1<t1&&k(N1,a4)<0)T0[x1]=N1,T0[F1]=t0,x1=F1;else T0[x1]=a4,T0[H4]=t0,x1=H4;else if(F1<t1&&k(N1,t0)<0)T0[x1]=N1,T0[F1]=t0,x1=F1;else return}}function k(T0,t0){var J1=T0.sortIndex-t0.sortIndex;return J1!==0?J1:T0.id-t0.id}var I=1,F=2,w=3,b=4,C=5;function f(T0,t0){}var E=typeof performance==="object"&&typeof performance.now==="function";if(E){var V=performance;jP.unstable_now=function(){return V.now()}}else{var v=Date,T=v.now();jP.unstable_now=function(){return v.now()-T}}var D=1073741823,n=-1,p=250,r=5000,J0=1e4,i=D,t=[],l=[],j=1,c=null,X0=w,I0=!1,F0=!1,Q1=!1,O1=typeof setTimeout==="function"?setTimeout:null,Q0=typeof clearTimeout==="function"?clearTimeout:null,U0=typeof setImmediate<"u"?setImmediate:null,_0=typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0?navigator.scheduling.isInputPending.bind(navigator.scheduling):null;function Z0(T0){var t0=q(l);while(t0!==null){if(t0.callback===null)R(l);else if(t0.startTime<=T0)R(l),t0.sortIndex=t0.expirationTime,W(t,t0);else return;t0=q(l)}}function d(T0){if(Q1=!1,Z0(T0),!F0)if(q(t)!==null)F0=!0,T4(P0);else{var t0=q(l);if(t0!==null)W6(d,t0.startTime-T0)}}function P0(T0,t0){if(F0=!1,Q1)Q1=!1,E6();I0=!0;var J1=X0;try{if(G)try{return v0(T0,t0)}catch(t1){if(c!==null){var x1=jP.unstable_now();f(c,x1),c.isQueued=!1}throw t1}else return v0(T0,t0)}finally{c=null,X0=J1,I0=!1}}function v0(T0,t0){var J1=t0;Z0(J1),c=q(t);while(c!==null&&!Y){if(c.expirationTime>J1&&(!T0||y4()))break;var x1=c.callback;if(typeof x1==="function"){c.callback=null,X0=c.priorityLevel;var t1=c.expirationTime<=J1,V4=x1(t1);if(J1=jP.unstable_now(),typeof V4==="function")c.callback=V4;else if(c===q(t))R(t);Z0(J1)}else R(t);c=q(t)}if(c!==null)return!0;else{var H4=q(l);if(H4!==null)W6(d,H4.startTime-J1);return!1}}function X1(T0,t0){switch(T0){case I:case F:case w:case b:case C:break;default:T0=w}var J1=X0;X0=T0;try{return t0()}finally{X0=J1}}function r0(T0){var t0;switch(X0){case I:case F:case w:t0=w;break;default:t0=X0;break}var J1=X0;X0=t0;try{return T0()}finally{X0=J1}}function V0(T0){var t0=X0;return function(){var J1=X0;X0=t0;try{return T0.apply(this,arguments)}finally{X0=J1}}}function $1(T0,t0,J1){var x1=jP.unstable_now(),t1;if(typeof J1==="object"&&J1!==null){var V4=J1.delay;if(typeof V4==="number"&&V4>0)t1=x1+V4;else t1=x1}else t1=x1;var H4;switch(T0){case I:H4=n;break;case F:H4=p;break;case C:H4=i;break;case b:H4=J0;break;case w:default:H4=r;break}var a4=t1+H4,F1={id:j++,callback:t0,priorityLevel:T0,startTime:t1,expirationTime:a4,sortIndex:-1};if(t1>x1){if(F1.sortIndex=t1,W(l,F1),q(t)===null&&F1===q(l)){if(Q1)E6();else Q1=!0;W6(d,t1-x1)}}else if(F1.sortIndex=a4,W(t,F1),!F0&&!I0)F0=!0,T4(P0);return F1}function L0(){}function a0(){if(!F0&&!I0)F0=!0,T4(P0)}function f1(){return q(t)}function q4(T0){T0.callback=null}function h4(){return X0}var g1=!1,K1=null,r4=-1,o4=U,k4=-1;function y4(){var T0=jP.unstable_now()-k4;if(T0<o4)return!1;return!0}function D5(){}function W4(T0){if(T0<0||T0>125){console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported");return}if(T0>0)o4=Math.floor(1000/T0);else o4=U}var F6=function(){if(K1!==null){var T0=jP.unstable_now();k4=T0;var t0=!0,J1=!0;try{J1=K1(t0,T0)}finally{if(J1)L4();else g1=!1,K1=null}}else g1=!1},L4;if(typeof U0==="function")L4=function(){U0(F6)};else if(typeof MessageChannel<"u"){var M6=new MessageChannel,M4=M6.port2;M6.port1.onmessage=F6,L4=function(){M4.postMessage(null)}}else L4=function(){O1(F6,0)};function T4(T0){if(K1=T0,!g1)g1=!0,L4()}function W6(T0,t0){r4=O1(function(){T0(jP.unstable_now())},t0)}function E6(){Q0(r4),r4=-1}var j4=D5,t4=null;if(jP.unstable_IdlePriority=C,jP.unstable_ImmediatePriority=I,jP.unstable_LowPriority=b,jP.unstable_NormalPriority=w,jP.unstable_Profiling=t4,jP.unstable_UserBlockingPriority=F,jP.unstable_cancelCallback=q4,jP.unstable_continueExecution=a0,jP.unstable_forceFrameRate=W4,jP.unstable_getCurrentPriorityLevel=h4,jP.unstable_getFirstCallbackNode=f1,jP.unstable_next=r0,jP.unstable_pauseExecution=L0,jP.unstable_requestPaint=j4,jP.unstable_runWithPriority=X1,jP.unstable_scheduleCallback=$1,jP.unstable_shouldYield=y4,jP.unstable_wrapCallback=V0,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==="function")__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()});var LO=Wz((pP)=>{var vZ=q0(I1()),Y4=q0(WO());(function(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==="function")__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var Y=vZ.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,G=!1;function U(z){G=z}function W(z){if(!G){for(var Q=arguments.length,X=Array(Q>1?Q-1:0),Z=1;Z<Q;Z++)X[Z-1]=arguments[Z];R("warn",z,X)}}function q(z){if(!G){for(var Q=arguments.length,X=Array(Q>1?Q-1:0),Z=1;Z<Q;Z++)X[Z-1]=arguments[Z];R("error",z,X)}}function R(z,Q,X){{var Z=Y.ReactDebugCurrentFrame,J=Z.getStackAddendum();if(J!=="")Q+="%s",X=X.concat([J]);var $=X.map(function(H){return String(H)});$.unshift("Warning: "+Q),Function.prototype.apply.call(console[z],console,$)}}var L=0,_=1,k=2,I=3,F=4,w=5,b=6,C=7,f=8,E=9,V=10,v=11,T=12,D=13,n=14,p=15,r=16,J0=17,i=18,t=19,l=21,j=22,c=23,X0=24,I0=25,F0=!0,Q1=!1,O1=!1,Q0=!1,U0=!1,_0=!0,Z0=!1,d=!0,P0=!0,v0=!0,X1=!0,r0=new Set,V0={},$1={};function L0(z,Q){a0(z,Q),a0(z+"Capture",Q)}function a0(z,Q){if(V0[z])q("EventRegistry: More than one plugin attempted to publish the same registration name, `%s`.",z);V0[z]=Q;{var X=z.toLowerCase();if($1[X]=z,z==="onDoubleClick")$1.ondblclick=z}for(var Z=0;Z<Q.length;Z++)r0.add(Q[Z])}var f1=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",q4=Object.prototype.hasOwnProperty;function h4(z){{var Q=typeof Symbol==="function"&&Symbol.toStringTag,X=Q&&z[Symbol.toStringTag]||z.constructor.name||"Object";return X}}function g1(z){try{return K1(z),!1}catch(Q){return!0}}function K1(z){return""+z}function r4(z,Q){if(g1(z))return q("The provided `%s` attribute is an unsupported type %s. This value must be coerced to a string before before using it here.",Q,h4(z)),K1(z)}function o4(z){if(g1(z))return q("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",h4(z)),K1(z)}function k4(z,Q){if(g1(z))return q("The provided `%s` prop is an unsupported type %s. This value must be coerced to a string before before using it here.",Q,h4(z)),K1(z)}function y4(z,Q){if(g1(z))return q("The provided `%s` CSS property is an unsupported type %s. This value must be coerced to a string before before using it here.",Q,h4(z)),K1(z)}function D5(z){if(g1(z))return q("The provided HTML markup uses a value of unsupported type %s. This value must be coerced to a string before before using it here.",h4(z)),K1(z)}function W4(z){if(g1(z))return q("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.",h4(z)),K1(z)}var F6=0,L4=1,M6=2,M4=3,T4=4,W6=5,E6=6,j4=":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",t4=j4+"\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",T0=new RegExp("^["+j4+"]["+t4+"]*$"),t0={},J1={};function x1(z){if(q4.call(J1,z))return!0;if(q4.call(t0,z))return!1;if(T0.test(z))return J1[z]=!0,!0;return t0[z]=!0,q("Invalid attribute name: `%s`",z),!1}function t1(z,Q,X){if(Q!==null)return Q.type===F6;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 V4(z,Q,X,Z){if(X!==null&&X.type===F6)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 H4(z,Q,X,Z){if(Q===null||typeof Q>"u")return!0;if(V4(z,Q,X,Z))return!0;if(Z)return!1;if(X!==null)switch(X.type){case M4:return!Q;case T4:return Q===!1;case W6:return isNaN(Q);case E6:return isNaN(Q)||Q<1}return!1}function a4(z){return N1.hasOwnProperty(z)?N1[z]:null}function F1(z,Q,X,Z,J,$,H){this.acceptsBooleans=Q===M6||Q===M4||Q===T4,this.attributeName=Z,this.attributeNamespace=J,this.mustUseProperty=X,this.propertyName=z,this.type=Q,this.sanitizeURL=$,this.removeEmptyString=H}var N1={},c6=["children","dangerouslySetInnerHTML","defaultValue","defaultChecked","innerHTML","suppressContentEditableWarning","suppressHydrationWarning","style"];c6.forEach(function(z){N1[z]=new F1(z,F6,!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];N1[Q]=new F1(Q,L4,!1,X,null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(z){N1[z]=new F1(z,M6,!1,z.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(z){N1[z]=new F1(z,M6,!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){N1[z]=new F1(z,M4,!1,z.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(z){N1[z]=new F1(z,M4,!0,z,null,!1,!1)}),["capture","download"].forEach(function(z){N1[z]=new F1(z,T4,!1,z,null,!1,!1)}),["cols","rows","size","span"].forEach(function(z){N1[z]=new F1(z,E6,!1,z,null,!1,!1)}),["rowSpan","start"].forEach(function(z){N1[z]=new F1(z,W6,!1,z.toLowerCase(),null,!1,!1)});var L6=/[\-\:]([a-z])/g,l6=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(L6,l6);N1[Q]=new F1(Q,L4,!1,z,null,!1,!1)}),["xlink:actuate","xlink:arcrole","xlink:role","xlink:show","xlink:title","xlink:type"].forEach(function(z){var Q=z.replace(L6,l6);N1[Q]=new F1(Q,L4,!1,z,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(z){var Q=z.replace(L6,l6);N1[Q]=new F1(Q,L4,!1,z,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(z){N1[z]=new F1(z,L4,!1,z.toLowerCase(),null,!1,!1)});var Q7="xlinkHref";N1[Q7]=new F1("xlinkHref",L4,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(z){N1[z]=new F1(z,L4,!1,z.toLowerCase(),null,!0,!0)});var E5=/^[\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,X7=!1;function F5(z){if(!X7&&E5.test(z))X7=!0,q("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 m6(z,Q,X,Z){if(Z.mustUseProperty){var J=Z.propertyName;return z[J]}else{if(r4(X,Q),Z.sanitizeURL)F5(""+X);var $=Z.attributeName,H=null;if(Z.type===T4){if(z.hasAttribute($)){var B=z.getAttribute($);if(B==="")return!0;if(H4(Q,X,Z,!1))return B;if(B===""+X)return X;return B}}else if(z.hasAttribute($)){if(H4(Q,X,Z,!1))return z.getAttribute($);if(Z.type===M4)return X;H=z.getAttribute($)}if(H4(Q,X,Z,!1))return H===null?X:H;else if(H===""+X)return X;else return H}}function m5(z,Q,X,Z){{if(!x1(Q))return;if(!z.hasAttribute(Q))return X===void 0?void 0:null;var J=z.getAttribute(Q);if(r4(X,Q),J===""+X)return X;return J}}function V1(z,Q,X,Z){var J=a4(Q);if(t1(Q,J,Z))return;if(H4(Q,X,J,Z))X=null;if(Z||J===null){if(x1(Q)){var $=Q;if(X===null)z.removeAttribute($);else r4(X,Q),z.setAttribute($,""+X)}return}var H=J.mustUseProperty;if(H){var B=J.propertyName;if(X===null){var K=J.type;z[B]=K===M4?!1:""}else z[B]=X;return}var{attributeName:N,attributeNamespace:P}=J;if(X===null)z.removeAttribute(N);else{var g=J.type,u;if(g===M4||g===T4&&X===!0)u="";else if(r4(X,N),u=""+X,J.sanitizeURL)F5(u.toString());if(P)z.setAttributeNS(P,N,u);else z.setAttribute(N,u)}}var s1=Symbol.for("react.element"),B4=Symbol.for("react.portal"),d1=Symbol.for("react.fragment"),h=Symbol.for("react.strict_mode"),H0=Symbol.for("react.profiler"),R0=Symbol.for("react.provider"),A=Symbol.for("react.context"),x=Symbol.for("react.forward_ref"),O0=Symbol.for("react.suspense"),M0=Symbol.for("react.suspense_list"),S0=Symbol.for("react.memo"),i0=Symbol.for("react.lazy"),g0=Symbol.for("react.scope"),W0=Symbol.for("react.debug_trace_mode"),k0=Symbol.for("react.offscreen"),n0=Symbol.for("react.legacy_hidden"),D1=Symbol.for("react.cache"),e1=Symbol.for("react.tracing_marker"),i6=Symbol.iterator,q5="@@iterator";function P4(z){if(z===null||typeof z!=="object")return null;var Q=i6&&z[i6]||z[q5];if(typeof Q==="function")return Q;return null}var T1=Object.assign,b7=0,Z7,gQ,xQ,jQ,pQ,dQ,cQ;function lQ(){}lQ.__reactDisabledLog=!0;function gZ(){{if(b7===0){Z7=console.log,gQ=console.info,xQ=console.warn,jQ=console.error,pQ=console.group,dQ=console.groupCollapsed,cQ=console.groupEnd;var z={configurable:!0,enumerable:!0,value:lQ,writable:!0};Object.defineProperties(console,{info:z,log:z,warn:z,error:z,group:z,groupCollapsed:z,groupEnd:z})}b7++}}function A3(){{if(b7--,b7===0){var z={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:T1({},z,{value:Z7}),info:T1({},z,{value:gQ}),warn:T1({},z,{value:xQ}),error:T1({},z,{value:jQ}),group:T1({},z,{value:pQ}),groupCollapsed:T1({},z,{value:dQ}),groupEnd:T1({},z,{value:cQ})})}if(b7<0)q("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var iQ=Y.ReactCurrentDispatcher,V8;function M5(z,Q,X){{if(V8===void 0)try{throw Error()}catch(J){var Z=J.stack.trim().match(/\n( *(at )?)/);V8=Z&&Z[1]||""}return`
24
+ `+V8+z}}var r7=!1,t7;{var kz=typeof WeakMap==="function"?WeakMap:Map;t7=new kz}function oQ(z,Q){if(!z||r7)return"";{var X=t7.get(z);if(X!==void 0)return X}var Z;r7=!0;var J=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var $;$=iQ.current,iQ.current=null,gZ();try{if(Q){var H=function(){throw Error()};if(Object.defineProperty(H.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==="object"&&Reflect.construct){try{Reflect.construct(H,[])}catch(z0){Z=z0}Reflect.construct(z,[],H)}else{try{H.call()}catch(z0){Z=z0}z.call(H.prototype)}}else{try{throw Error()}catch(z0){Z=z0}z()}}catch(z0){if(z0&&Z&&typeof z0.stack==="string"){var B=z0.stack.split(`
25
+ `),K=Z.stack.split(`
26
+ `),N=B.length-1,P=K.length-1;while(N>=1&&P>=0&&B[N]!==K[P])P--;for(;N>=1&&P>=0;N--,P--)if(B[N]!==K[P]){if(N!==1||P!==1)do if(N--,P--,P<0||B[N]!==K[P]){var g=`
27
+ `+B[N].replace(" at new "," at ");if(z.displayName&&g.includes("<anonymous>"))g=g.replace("<anonymous>",z.displayName);if(typeof z==="function")t7.set(z,g);return g}while(N>=1&&P>=0);break}}}finally{r7=!1,iQ.current=$,A3(),Error.prepareStackTrace=J}var u=z?z.displayName||z.name:"",e=u?M5(u):"";if(typeof z==="function")t7.set(z,e);return e}function xZ(z,Q,X){return oQ(z,!0)}function aQ(z,Q,X){return oQ(z,!1)}function I3(z){var Q=z.prototype;return!!(Q&&Q.isReactComponent)}function s7(z,Q,X){if(z==null)return"";if(typeof z==="function")return oQ(z,I3(z));if(typeof z==="string")return M5(z);switch(z){case O0:return M5("Suspense");case M0:return M5("SuspenseList")}if(typeof z==="object")switch(z.$$typeof){case x:return aQ(z.render);case S0:return s7(z.type,Q,X);case i0:{var Z=z,J=Z._payload,$=Z._init;try{return s7($(J),Q,X)}catch(H){}}}return""}function jZ(z){var Q=z._debugOwner?z._debugOwner.type:null,X=z._debugSource;switch(z.tag){case w:return M5(z.type);case r:return M5("Lazy");case D:return M5("Suspense");case t:return M5("SuspenseList");case L:case k:case p:return aQ(z.type);case v:return aQ(z.type.render);case _:return xZ(z.type);default:return""}}function nQ(z){try{var Q="",X=z;do Q+=jZ(X),X=X.return;while(X);return Q}catch(Z){return`
28
+ Error generating stack: `+Z.message+`
29
+ `+Z.stack}}function Tz(z,Q,X){var Z=z.displayName;if(Z)return Z;var J=Q.displayName||Q.name||"";return J!==""?X+"("+J+")":X}function pZ(z){return z.displayName||"Context"}function p1(z){if(z==null)return null;if(typeof z.tag==="number")q("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 d1:return"Fragment";case B4:return"Portal";case H0:return"Profiler";case h:return"StrictMode";case O0:return"Suspense";case M0:return"SuspenseList"}if(typeof z==="object")switch(z.$$typeof){case A:var Q=z;return pZ(Q)+".Consumer";case R0:var X=z;return pZ(X._context)+".Provider";case x:return Tz(z,z.render,"ForwardRef");case S0:var Z=z.displayName||null;if(Z!==null)return Z;return p1(z.type)||"Memo";case i0:{var J=z,$=J._payload,H=J._init;try{return p1(H($))}catch(B){return null}}}return null}function dZ(z,Q,X){var Z=Q.displayName||Q.name||"";return z.displayName||(Z!==""?X+"("+Z+")":X)}function rQ(z){return z.displayName||"Context"}function M1(z){var{tag:Q,type:X}=z;switch(Q){case X0:return"Cache";case E:var Z=X;return rQ(Z)+".Consumer";case V:var J=X;return rQ(J._context)+".Provider";case i:return"DehydratedFragment";case v:return dZ(X,X.render,"ForwardRef");case C:return"Fragment";case w:return X;case F:return"Portal";case I:return"Root";case b:return"Text";case r:return p1(X);case f:if(X===h)return"StrictMode";return"Mode";case j:return"Offscreen";case T:return"Profiler";case l:return"Scope";case D:return"Suspense";case t:return"SuspenseList";case I0:return"TracingMarker";case _:case L:case J0:case k:case n:case p:if(typeof X==="function")return X.displayName||X.name||null;if(typeof X==="string")return X;break}return null}var cZ=Y.ReactDebugCurrentFrame,u6=null,D8=!1;function e7(){{if(u6===null)return null;var z=u6._debugOwner;if(z!==null&&typeof z<"u")return M1(z)}return null}function lZ(){{if(u6===null)return"";return nQ(u6)}}function _6(){cZ.getCurrentStack=null,u6=null,D8=!1}function m4(z){cZ.getCurrentStack=z===null?null:lZ,u6=z,D8=!1}function iZ(){return u6}function B5(z){D8=z}function Q5(z){return""+z}function J7(z){switch(typeof z){case"boolean":case"number":case"string":case"undefined":return z;case"object":return W4(z),z;default:return""}}var k3={button:!0,checkbox:!0,image:!0,hidden:!0,radio:!0,reset:!0,submit:!0};function Cz(z,Q){{if(!(k3[Q.type]||Q.onChange||Q.onInput||Q.readOnly||Q.disabled||Q.value==null))q("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))q("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 E8(z){var{type:Q,nodeName:X}=z;return X&&X.toLowerCase()==="input"&&(Q==="checkbox"||Q==="radio")}function oZ(z){return z._valueTracker}function z8(z){z._valueTracker=null}function aZ(z){var Q="";if(!z)return Q;if(E8(z))Q=z.checked?"true":"false";else Q=z.value;return Q}function nZ(z){var Q=E8(z)?"checked":"value",X=Object.getOwnPropertyDescriptor(z.constructor.prototype,Q);W4(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(B){W4(B),Z=""+B,$.call(this,B)}}),Object.defineProperty(z,Q,{enumerable:X.enumerable});var H={getValue:function(){return Z},setValue:function(B){W4(B),Z=""+B},stopTracking:function(){z8(z),delete z[Q]}};return H}function F7(z){if(oZ(z))return;z._valueTracker=nZ(z)}function vz(z){if(!z)return!1;var Q=oZ(z);if(!Q)return!0;var X=Q.getValue(),Z=aZ(z);if(Z!==X)return Q.setValue(Z),!0;return!1}function Q8(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 Sz=!1,rZ=!1,tZ=!1,sZ=!1;function eZ(z){var Q=z.type==="checkbox"||z.type==="radio";return Q?z.checked!=null:z.value!=null}function O(z,Q){var X=z,Z=Q.checked,J=T1({},Q,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:Z!=null?Z:X._wrapperState.initialChecked});return J}function y(z,Q){{if(Cz("input",Q),Q.checked!==void 0&&Q.defaultChecked!==void 0&&!rZ)q("%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",e7()||"A component",Q.type),rZ=!0;if(Q.value!==void 0&&Q.defaultValue!==void 0&&!Sz)q("%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",e7()||"A component",Q.type),Sz=!0}var X=z,Z=Q.defaultValue==null?"":Q.defaultValue;X._wrapperState={initialChecked:Q.checked!=null?Q.checked:Q.defaultChecked,initialValue:J7(Q.value!=null?Q.value:Z),controlled:eZ(Q)}}function s(z,Q){var X=z,Z=Q.checked;if(Z!=null)V1(X,"checked",Z,!1)}function $0(z,Q){var X=z;{var Z=eZ(Q);if(!X._wrapperState.controlled&&Z&&!sZ)q("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"),sZ=!0;if(X._wrapperState.controlled&&!Z&&!tZ)q("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"),tZ=!0}s(z,Q);var J=J7(Q.value),$=Q.type;if(J!=null){if($==="number"){if(J===0&&X.value===""||X.value!=J)X.value=Q5(J)}else if(X.value!==Q5(J))X.value=Q5(J)}else if($==="submit"||$==="reset"){X.removeAttribute("value");return}if(Q.hasOwnProperty("value"))W1(X,Q.type,J);else if(Q.hasOwnProperty("defaultValue"))W1(X,Q.type,J7(Q.defaultValue));if(Q.checked==null&&Q.defaultChecked!=null)X.defaultChecked=!!Q.defaultChecked}function A0(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 H=Q5(Z._wrapperState.initialValue);if(!X){if(H!==Z.value)Z.value=H}Z.defaultValue=H}var B=Z.name;if(B!=="")Z.name="";if(Z.defaultChecked=!Z.defaultChecked,Z.defaultChecked=!!Z._wrapperState.initialChecked,B!=="")Z.name=B}function q1(z,Q){var X=z;$0(X,Q),c0(X,Q)}function c0(z,Q){var X=Q.name;if(Q.type==="radio"&&X!=null){var Z=z;while(Z.parentNode)Z=Z.parentNode;r4(X,"name");var J=Z.querySelectorAll("input[name="+JSON.stringify(""+X)+'][type="radio"]');for(var $=0;$<J.length;$++){var H=J[$];if(H===z||H.form!==z.form)continue;var B=xJ(H);if(!B)throw Error("ReactDOMInput: Mixing React and non-React radio inputs with the same `name` is not supported.");vz(H),$0(H,B)}}}function W1(z,Q,X){if(Q!=="number"||Q8(z.ownerDocument)!==z){if(X==null)z.defaultValue=Q5(z._wrapperState.initialValue);else if(z.defaultValue!==Q5(X))z.defaultValue=Q5(X)}}var E1=!1,Q4=!1,_4=!1;function R4(z,Q){{if(Q.value==null){if(typeof Q.children==="object"&&Q.children!==null)vZ.Children.forEach(Q.children,function(X){if(X==null)return;if(typeof X==="string"||typeof X==="number")return;if(!Q4)Q4=!0,q("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(!_4)_4=!0,q("Pass a `value` prop if you set dangerouslyInnerHTML so React knows which value should be selected.")}}if(Q.selected!=null&&!E1)q("Use the `defaultValue` or `value` props on <select> instead of setting `selected` on <option>."),E1=!0}}function C4(z,Q){if(Q.value!=null)z.setAttribute("value",Q5(J7(Q.value)))}var p4=Array.isArray;function i1(z){return p4(z)}var m8=!1;function fz(){var z=e7();if(z)return`
30
+
31
+ Check the render method of \``+z+"`.";return""}var tQ=["value","defaultValue"];function T3(z){{Cz("select",z);for(var Q=0;Q<tQ.length;Q++){var X=tQ[Q];if(z[X]==null)continue;var Z=i1(z[X]);if(z.multiple&&!Z)q("The `%s` prop supplied to <select> must be an array if `multiple` is true.%s",X,fz());else if(!z.multiple&&Z)q("The `%s` prop supplied to <select> must be a scalar value if `multiple` is false.%s",X,fz())}}}function M7(z,Q,X,Z){var J=z.options;if(Q){var $=X,H={};for(var B=0;B<$.length;B++)H["$"+$[B]]=!0;for(var K=0;K<J.length;K++){var N=H.hasOwnProperty("$"+J[K].value);if(J[K].selected!==N)J[K].selected=N;if(N&&Z)J[K].defaultSelected=!0}}else{var P=Q5(J7(X)),g=null;for(var u=0;u<J.length;u++){if(J[u].value===P){if(J[u].selected=!0,Z)J[u].defaultSelected=!0;return}if(g===null&&!J[u].disabled)g=J[u]}if(g!==null)g.selected=!0}}function sQ(z,Q){return T1({},Q,{value:void 0})}function eQ(z,Q){var X=z;if(T3(Q),X._wrapperState={wasMultiple:!!Q.multiple},Q.value!==void 0&&Q.defaultValue!==void 0&&!m8)q("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"),m8=!0}function C3(z,Q){var X=z;X.multiple=!!Q.multiple;var Z=Q.value;if(Z!=null)M7(X,!!Q.multiple,Z,!1);else if(Q.defaultValue!=null)M7(X,!!Q.multiple,Q.defaultValue,!0)}function _W(z,Q){var X=z,Z=X._wrapperState.wasMultiple;X._wrapperState.wasMultiple=!!Q.multiple;var J=Q.value;if(J!=null)M7(X,!!Q.multiple,J,!1);else if(Z!==!!Q.multiple)if(Q.defaultValue!=null)M7(X,!!Q.multiple,Q.defaultValue,!0);else M7(X,!!Q.multiple,Q.multiple?[]:"",!1)}function RW(z,Q){var X=z,Z=Q.value;if(Z!=null)M7(X,!!Q.multiple,Z,!1)}var J2=!1;function v3(z,Q){var X=z;if(Q.dangerouslySetInnerHTML!=null)throw Error("`dangerouslySetInnerHTML` does not make sense on <textarea>.");var Z=T1({},Q,{value:void 0,defaultValue:void 0,children:Q5(X._wrapperState.initialValue)});return Z}function Y2(z,Q){var X=z;if(Cz("textarea",Q),Q.value!==void 0&&Q.defaultValue!==void 0&&!J2)q("%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",e7()||"A component"),J2=!0;var Z=Q.value;if(Z==null){var{children:J,defaultValue:$}=Q;if(J!=null){q("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(i1(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:J7(Z)}}function $2(z,Q){var X=z,Z=J7(Q.value),J=J7(Q.defaultValue);if(Z!=null){var $=Q5(Z);if($!==X.value)X.value=$;if(Q.defaultValue==null&&X.defaultValue!==$)X.defaultValue=$}if(J!=null)X.defaultValue=Q5(J)}function H2(z,Q){var X=z,Z=X.textContent;if(Z===X._wrapperState.initialValue){if(Z!==""&&Z!==null)X.value=Z}}function NW(z,Q){$2(z,Q)}var P7="http://www.w3.org/1999/xhtml",wW="http://www.w3.org/1998/Math/MathML",S3="http://www.w3.org/2000/svg";function f3(z){switch(z){case"svg":return S3;case"math":return wW;default:return P7}}function h3(z,Q){if(z==null||z===P7)return f3(Q);if(z===S3&&Q==="foreignObject")return P7;return z}var bW=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},zJ,G2=bW(function(z,Q){if(z.namespaceURI===S3){if(!("innerHTML"in z)){zJ=zJ||document.createElement("div"),zJ.innerHTML="<svg>"+Q.valueOf().toString()+"</svg>";var X=zJ.firstChild;while(z.firstChild)z.removeChild(z.firstChild);while(X.firstChild)z.appendChild(X.firstChild);return}}z.innerHTML=Q}),X5=1,A7=3,s4=8,I7=9,y3=11,QJ=function(z,Q){if(Q){var X=z.firstChild;if(X&&X===z.lastChild&&X.nodeType===A7){X.nodeValue=Q;return}}z.textContent=Q},FW={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"]},zX={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 MW(z,Q){return z+Q.charAt(0).toUpperCase()+Q.substring(1)}var PW=["Webkit","ms","Moz","O"];Object.keys(zX).forEach(function(z){PW.forEach(function(Q){zX[MW(Q,z)]=zX[z]})});function V3(z,Q,X){var Z=Q==null||typeof Q==="boolean"||Q==="";if(Z)return"";if(!X&&typeof Q==="number"&&Q!==0&&!(zX.hasOwnProperty(z)&&zX[z]))return Q+"px";return y4(Q,z),(""+Q).trim()}var AW=/([A-Z])/g,IW=/^ms-/;function kW(z){return z.replace(AW,"-$1").toLowerCase().replace(IW,"-ms-")}var q2=function(){};{var TW=/^(?:webkit|moz|o)[A-Z]/,CW=/^-ms-/,vW=/-(.)/g,B2=/;\s*$/,hz={},D3={},U2=!1,K2=!1,SW=function(z){return z.replace(vW,function(Q,X){return X.toUpperCase()})},fW=function(z){if(hz.hasOwnProperty(z)&&hz[z])return;hz[z]=!0,q("Unsupported style property %s. Did you mean %s?",z,SW(z.replace(CW,"ms-")))},hW=function(z){if(hz.hasOwnProperty(z)&&hz[z])return;hz[z]=!0,q("Unsupported vendor-prefixed style property %s. Did you mean %s?",z,z.charAt(0).toUpperCase()+z.slice(1))},yW=function(z,Q){if(D3.hasOwnProperty(Q)&&D3[Q])return;D3[Q]=!0,q(`Style property values shouldn't contain a semicolon. Try "%s: %s" instead.`,z,Q.replace(B2,""))},VW=function(z,Q){if(U2)return;U2=!0,q("`NaN` is an invalid value for the `%s` css style property.",z)},DW=function(z,Q){if(K2)return;K2=!0,q("`Infinity` is an invalid value for the `%s` css style property.",z)};q2=function(z,Q){if(z.indexOf("-")>-1)fW(z);else if(TW.test(z))hW(z);else if(B2.test(Q))yW(z,Q);if(typeof Q==="number"){if(isNaN(Q))VW(z,Q);else if(!isFinite(Q))DW(z,Q)}}}var EW=q2;function mW(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:kW(Z))+":",Q+=V3(Z,J,$),X=";"}}return Q||null}}function O2(z,Q){var X=z.style;for(var Z in Q){if(!Q.hasOwnProperty(Z))continue;var J=Z.indexOf("--")===0;if(!J)EW(Z,Q[Z]);var $=V3(Z,Q[Z],J);if(Z==="float")Z="cssFloat";if(J)X.setProperty(Z,$);else X[Z]=$}}function uW(z){return z==null||typeof z==="boolean"||z===""}function W2(z){var Q={};for(var X in z){var Z=FW[X]||[X];for(var J=0;J<Z.length;J++)Q[Z[J]]=X}return Q}function gW(z,Q){{if(!Q)return;var X=W2(z),Z=W2(Q),J={};for(var $ in X){var H=X[$],B=Z[$];if(B&&H!==B){var K=H+","+B;if(J[K])continue;J[K]=!0,q("%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.",uW(z[H])?"Removing":"Updating",H,B)}}}}var xW={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},jW=T1({menuitem:!0},xW),pW="__html";function E3(z,Q){if(!Q)return;if(jW[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"||!(pW 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)q("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 u8(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 XJ={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"},L2={"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},yz={},dW=new RegExp("^(aria)-["+t4+"]*$"),cW=new RegExp("^(aria)[A-Z]["+t4+"]*$");function lW(z,Q){{if(q4.call(yz,Q)&&yz[Q])return!0;if(cW.test(Q)){var X="aria-"+Q.slice(4).toLowerCase(),Z=L2.hasOwnProperty(X)?X:null;if(Z==null)return q("Invalid ARIA attribute `%s`. ARIA attributes follow the pattern aria-* and must be lowercase.",Q),yz[Q]=!0,!0;if(Q!==Z)return q("Invalid ARIA attribute `%s`. Did you mean `%s`?",Q,Z),yz[Q]=!0,!0}if(dW.test(Q)){var J=Q.toLowerCase(),$=L2.hasOwnProperty(J)?J:null;if($==null)return yz[Q]=!0,!1;if(Q!==$)return q("Unknown ARIA attribute `%s`. Did you mean `%s`?",Q,$),yz[Q]=!0,!0}}return!0}function iW(z,Q){{var X=[];for(var Z in Q){var J=lW(z,Z);if(!J)X.push(Z)}var $=X.map(function(H){return"`"+H+"`"}).join(", ");if(X.length===1)q("Invalid aria prop %s on <%s> tag. For details, see https://reactjs.org/link/invalid-aria-props",$,z);else if(X.length>1)q("Invalid aria props %s on <%s> tag. For details, see https://reactjs.org/link/invalid-aria-props",$,z)}}function oW(z,Q){if(u8(z,Q))return;iW(z,Q)}var _2=!1;function aW(z,Q){{if(z!=="input"&&z!=="textarea"&&z!=="select")return;if(Q!=null&&Q.value===null&&!_2)if(_2=!0,z==="select"&&Q.multiple)q("`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 q("`value` prop on `%s` should not be null. Consider using an empty string to clear the component or `undefined` for uncontrolled components.",z)}}var R2=function(){};{var o6={},N2=/^on./,nW=/^on[^A-Z]/,rW=new RegExp("^(aria)-["+t4+"]*$"),tW=new RegExp("^(aria)[A-Z]["+t4+"]*$");R2=function(z,Q,X,Z){if(q4.call(o6,Q)&&o6[Q])return!0;var J=Q.toLowerCase();if(J==="onfocusin"||J==="onfocusout")return q("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."),o6[Q]=!0,!0;if(Z!=null){var{registrationNameDependencies:$,possibleRegistrationNames:H}=Z;if($.hasOwnProperty(Q))return!0;var B=H.hasOwnProperty(J)?H[J]:null;if(B!=null)return q("Invalid event handler property `%s`. Did you mean `%s`?",Q,B),o6[Q]=!0,!0;if(N2.test(Q))return q("Unknown event handler property `%s`. It will be ignored.",Q),o6[Q]=!0,!0}else if(N2.test(Q)){if(nW.test(Q))q("Invalid event handler property `%s`. React events use the camelCase naming convention, for example `onClick`.",Q);return o6[Q]=!0,!0}if(rW.test(Q)||tW.test(Q))return!0;if(J==="innerhtml")return q("Directly setting property `innerHTML` is not permitted. For more information, lookup documentation on `dangerouslySetInnerHTML`."),o6[Q]=!0,!0;if(J==="aria")return q("The `aria` attribute is reserved for future use in React. Pass individual `aria-` attributes instead."),o6[Q]=!0,!0;if(J==="is"&&X!==null&&X!==void 0&&typeof X!=="string")return q("Received a `%s` for a string attribute `is`. If this is expected, cast the value to a string.",typeof X),o6[Q]=!0,!0;if(typeof X==="number"&&isNaN(X))return q("Received NaN for the `%s` attribute. If this is expected, cast the value to a string.",Q),o6[Q]=!0,!0;var K=a4(Q),N=K!==null&&K.type===F6;if(XJ.hasOwnProperty(J)){var P=XJ[J];if(P!==Q)return q("Invalid DOM property `%s`. Did you mean `%s`?",Q,P),o6[Q]=!0,!0}else if(!N&&Q!==J)return q("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),o6[Q]=!0,!0;if(typeof X==="boolean"&&V4(Q,X,K,!1)){if(X)q('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 q('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 o6[Q]=!0,!0}if(N)return!0;if(V4(Q,X,K,!1))return o6[Q]=!0,!1;if((X==="false"||X==="true")&&K!==null&&K.type===M4)return q("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),o6[Q]=!0,!0;return!0}}var sW=function(z,Q,X){{var Z=[];for(var J in Q){var $=R2(z,J,Q[J],X);if(!$)Z.push(J)}var H=Z.map(function(B){return"`"+B+"`"}).join(", ");if(Z.length===1)q("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 ",H,z);else if(Z.length>1)q("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 ",H,z)}};function eW(z,Q,X){if(u8(z,Q))return;sW(z,Q,X)}var w2=1,m3=2,QX=4,zL=w2|m3|QX,XX=null;function QL(z){if(XX!==null)q("Expected currently replaying event to be null. This error is likely caused by a bug in React. Please file an issue.");XX=z}function XL(){if(XX===null)q("Expected currently replaying event to not be null. This error is likely caused by a bug in React. Please file an issue.");XX=null}function ZL(z){return z===XX}function u3(z){var Q=z.target||z.srcElement||window;if(Q.correspondingUseElement)Q=Q.correspondingUseElement;return Q.nodeType===A7?Q.parentNode:Q}var g3=null,Vz=null,Dz=null;function b2(z){var Q=q8(z);if(!Q)return;if(typeof g3!=="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=xJ(X);g3(Q.stateNode,Q.type,Z)}}function JL(z){g3=z}function F2(z){if(Vz)if(Dz)Dz.push(z);else Dz=[z];else Vz=z}function YL(){return Vz!==null||Dz!==null}function M2(){if(!Vz)return;var z=Vz,Q=Dz;if(Vz=null,Dz=null,b2(z),Q)for(var X=0;X<Q.length;X++)b2(Q[X])}var P2=function(z,Q){return z(Q)},A2=function(){},x3=!1;function $L(){var z=YL();if(z)A2(),M2()}function I2(z,Q,X){if(x3)return z(Q,X);x3=!0;try{return P2(z,Q,X)}finally{x3=!1,$L()}}function HL(z,Q,X){P2=z,A2=X}function GL(z){return z==="button"||z==="input"||z==="select"||z==="textarea"}function qL(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&&GL(Q));default:return!1}}function ZX(z,Q){var X=z.stateNode;if(X===null)return null;var Z=xJ(X);if(Z===null)return null;var J=Z[Q];if(qL(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 j3=!1;if(f1)try{var JX={};Object.defineProperty(JX,"passive",{get:function(){j3=!0}}),window.addEventListener("test",JX,JX),window.removeEventListener("test",JX,JX)}catch(z){j3=!1}function k2(z,Q,X,Z,J,$,H,B,K){var N=Array.prototype.slice.call(arguments,3);try{Q.apply(X,N)}catch(P){this.onError(P)}}var T2=k2;if(typeof window<"u"&&typeof window.dispatchEvent==="function"&&typeof document<"u"&&typeof document.createEvent==="function"){var p3=document.createElement("react");T2=function(Q,X,Z,J,$,H,B,K,N){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 P=document.createEvent("Event"),g=!1,u=!0,e=window.event,z0=Object.getOwnPropertyDescriptor(window,"event");function Y0(){if(p3.removeEventListener(G0,e0,!1),typeof window.event<"u"&&window.hasOwnProperty("event"))window.event=e}var h0=Array.prototype.slice.call(arguments,3);function e0(){g=!0,Y0(),X.apply(Z,h0),u=!1}var o0,h1=!1,y1=!1;function o(a){if(o0=a.error,h1=!0,o0===null&&a.colno===0&&a.lineno===0)y1=!0;if(a.defaultPrevented){if(o0!=null&&typeof o0==="object")try{o0._suppressLogging=!0}catch(b0){}}}var G0="react-"+(Q?Q:"invokeguardedcallback");if(window.addEventListener("error",o),p3.addEventListener(G0,e0,!1),P.initEvent(G0,!1,!1),p3.dispatchEvent(P),z0)Object.defineProperty(window,"event",z0);if(g&&u){if(!h1)o0=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(y1)o0=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(o0)}if(window.removeEventListener("error",o),!g)return Y0(),k2.apply(this,arguments)}}var BL=T2,Ez=!1,ZJ=null,JJ=!1,d3=null,UL={onError:function(z){Ez=!0,ZJ=z}};function c3(z,Q,X,Z,J,$,H,B,K){Ez=!1,ZJ=null,BL.apply(UL,arguments)}function KL(z,Q,X,Z,J,$,H,B,K){if(c3.apply(this,arguments),Ez){var N=l3();if(!JJ)JJ=!0,d3=N}}function OL(){if(JJ){var z=d3;throw JJ=!1,d3=null,z}}function WL(){return Ez}function l3(){if(Ez){var z=ZJ;return Ez=!1,ZJ=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 mz(z){return z._reactInternals}function LL(z){return z._reactInternals!==void 0}function _L(z,Q){z._reactInternals=Q}var G1=0,uz=1,e4=2,j1=4,g8=16,YX=32,i3=64,o1=128,k7=256,X8=512,x8=1024,u5=2048,T7=4096,j8=8192,YJ=16384,RL=u5|j1|i3|X8|x8|YJ,NL=32767,$X=32768,a6=65536,o3=131072,C2=1048576,a3=2097152,p8=4194304,n3=8388608,C7=16777216,$J=33554432,r3=j1|x8|0,t3=e4|j1|g8|YX|X8|T7|j8,HX=j1|i3|X8|j8,gz=u5|g8,v7=p8|n3|a3,wL=Y.ReactCurrentOwner;function d8(z){var Q=z,X=z;if(!z.alternate){var Z=Q;do{if(Q=Z,(Q.flags&(e4|T7))!==G1)X=Q.return;Z=Q.return}while(Z)}else while(Q.return)Q=Q.return;if(Q.tag===I)return X;return null}function v2(z){if(z.tag===D){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 S2(z){return z.tag===I?z.stateNode.containerInfo:null}function bL(z){return d8(z)===z}function FL(z){{var Q=wL.current;if(Q!==null&&Q.tag===_){var X=Q,Z=X.stateNode;if(!Z._warnedAboutRefsInRender)q("%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.",M1(X)||"A component");Z._warnedAboutRefsInRender=!0}}var J=mz(z);if(!J)return!1;return d8(J)===J}function f2(z){if(d8(z)!==z)throw Error("Unable to find node on an unmounted component.")}function h2(z){var Q=z.alternate;if(!Q){var X=d8(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 H=$.alternate;if(H===null){var B=$.return;if(B!==null){Z=J=B;continue}break}if($.child===H.child){var K=$.child;while(K){if(K===Z)return f2($),z;if(K===J)return f2($),Q;K=K.sibling}throw Error("Unable to find node on an unmounted component.")}if(Z.return!==J.return)Z=$,J=H;else{var N=!1,P=$.child;while(P){if(P===Z){N=!0,Z=$,J=H;break}if(P===J){N=!0,J=$,Z=H;break}P=P.sibling}if(!N){P=H.child;while(P){if(P===Z){N=!0,Z=H,J=$;break}if(P===J){N=!0,J=H,Z=$;break}P=P.sibling}if(!N)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!==I)throw Error("Unable to find node on an unmounted component.");if(Z.stateNode.current===Z)return z;return Q}function y2(z){var Q=h2(z);return Q!==null?V2(Q):null}function V2(z){if(z.tag===w||z.tag===b)return z;var Q=z.child;while(Q!==null){var X=V2(Q);if(X!==null)return X;Q=Q.sibling}return null}function ML(z){var Q=h2(z);return Q!==null?D2(Q):null}function D2(z){if(z.tag===w||z.tag===b)return z;var Q=z.child;while(Q!==null){if(Q.tag!==F){var X=D2(Q);if(X!==null)return X}Q=Q.sibling}return null}var E2=Y4.unstable_scheduleCallback,PL=Y4.unstable_cancelCallback,AL=Y4.unstable_shouldYield,IL=Y4.unstable_requestPaint,R6=Y4.unstable_now,kL=Y4.unstable_getCurrentPriorityLevel,HJ=Y4.unstable_ImmediatePriority,s3=Y4.unstable_UserBlockingPriority,c8=Y4.unstable_NormalPriority,TL=Y4.unstable_LowPriority,e3=Y4.unstable_IdlePriority,CL=Y4.unstable_yieldValue,vL=Y4.unstable_setDisableYieldValue,l8=null,P6=null,D0=null,Y7=!1,g5=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u";function SL(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 q("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(P0)z=T1({},z,{getLaneLabelMap:EL,injectProfilingHooks:DL});l8=Q.inject(z),P6=Q}catch(X){q("React instrumentation encountered an error: %s.",X)}if(Q.checkDCE)return!0;else return!1}function fL(z,Q){if(P6&&typeof P6.onScheduleFiberRoot==="function")try{P6.onScheduleFiberRoot(l8,z,Q)}catch(X){if(!Y7)Y7=!0,q("React instrumentation encountered an error: %s",X)}}function hL(z,Q){if(P6&&typeof P6.onCommitFiberRoot==="function")try{var X=(z.current.flags&o1)===o1;if(v0){var Z;switch(Q){case O5:Z=HJ;break;case f7:Z=s3;break;case h7:Z=c8;break;case LJ:Z=e3;break;default:Z=c8;break}P6.onCommitFiberRoot(l8,z,Z,X)}else P6.onCommitFiberRoot(l8,z,void 0,X)}catch(J){if(!Y7)Y7=!0,q("React instrumentation encountered an error: %s",J)}}function yL(z){if(P6&&typeof P6.onPostCommitFiberRoot==="function")try{P6.onPostCommitFiberRoot(l8,z)}catch(Q){if(!Y7)Y7=!0,q("React instrumentation encountered an error: %s",Q)}}function VL(z){if(P6&&typeof P6.onCommitFiberUnmount==="function")try{P6.onCommitFiberUnmount(l8,z)}catch(Q){if(!Y7)Y7=!0,q("React instrumentation encountered an error: %s",Q)}}function N6(z){{if(typeof CL==="function")vL(z),U(z);if(P6&&typeof P6.setStrictMode==="function")try{P6.setStrictMode(l8,z)}catch(Q){if(!Y7)Y7=!0,q("React instrumentation encountered an error: %s",Q)}}}function DL(z){D0=z}function EL(){{var z=new Map,Q=1;for(var X=0;X<Q$;X++){var Z=X_(Q);z.set(Q,Z),Q*=2}return z}}function mL(z){if(D0!==null&&typeof D0.markCommitStarted==="function")D0.markCommitStarted(z)}function m2(){if(D0!==null&&typeof D0.markCommitStopped==="function")D0.markCommitStopped()}function GX(z){if(D0!==null&&typeof D0.markComponentRenderStarted==="function")D0.markComponentRenderStarted(z)}function xz(){if(D0!==null&&typeof D0.markComponentRenderStopped==="function")D0.markComponentRenderStopped()}function uL(z){if(D0!==null&&typeof D0.markComponentPassiveEffectMountStarted==="function")D0.markComponentPassiveEffectMountStarted(z)}function gL(){if(D0!==null&&typeof D0.markComponentPassiveEffectMountStopped==="function")D0.markComponentPassiveEffectMountStopped()}function xL(z){if(D0!==null&&typeof D0.markComponentPassiveEffectUnmountStarted==="function")D0.markComponentPassiveEffectUnmountStarted(z)}function jL(){if(D0!==null&&typeof D0.markComponentPassiveEffectUnmountStopped==="function")D0.markComponentPassiveEffectUnmountStopped()}function pL(z){if(D0!==null&&typeof D0.markComponentLayoutEffectMountStarted==="function")D0.markComponentLayoutEffectMountStarted(z)}function dL(){if(D0!==null&&typeof D0.markComponentLayoutEffectMountStopped==="function")D0.markComponentLayoutEffectMountStopped()}function u2(z){if(D0!==null&&typeof D0.markComponentLayoutEffectUnmountStarted==="function")D0.markComponentLayoutEffectUnmountStarted(z)}function g2(){if(D0!==null&&typeof D0.markComponentLayoutEffectUnmountStopped==="function")D0.markComponentLayoutEffectUnmountStopped()}function cL(z,Q,X){if(D0!==null&&typeof D0.markComponentErrored==="function")D0.markComponentErrored(z,Q,X)}function lL(z,Q,X){if(D0!==null&&typeof D0.markComponentSuspended==="function")D0.markComponentSuspended(z,Q,X)}function iL(z){if(D0!==null&&typeof D0.markLayoutEffectsStarted==="function")D0.markLayoutEffectsStarted(z)}function oL(){if(D0!==null&&typeof D0.markLayoutEffectsStopped==="function")D0.markLayoutEffectsStopped()}function aL(z){if(D0!==null&&typeof D0.markPassiveEffectsStarted==="function")D0.markPassiveEffectsStarted(z)}function nL(){if(D0!==null&&typeof D0.markPassiveEffectsStopped==="function")D0.markPassiveEffectsStopped()}function x2(z){if(D0!==null&&typeof D0.markRenderStarted==="function")D0.markRenderStarted(z)}function rL(){if(D0!==null&&typeof D0.markRenderYielded==="function")D0.markRenderYielded()}function j2(){if(D0!==null&&typeof D0.markRenderStopped==="function")D0.markRenderStopped()}function tL(z){if(D0!==null&&typeof D0.markRenderScheduled==="function")D0.markRenderScheduled(z)}function sL(z,Q){if(D0!==null&&typeof D0.markForceUpdateScheduled==="function")D0.markForceUpdateScheduled(z,Q)}function z$(z,Q){if(D0!==null&&typeof D0.markStateUpdateScheduled==="function")D0.markStateUpdateScheduled(z,Q)}var Y1=0,m1=1,X4=2,d4=8,$7=16,p2=Math.clz32?Math.clz32:Q_,eL=Math.log,z_=Math.LN2;function Q_(z){var Q=z>>>0;if(Q===0)return 32;return 31-(eL(Q)/z_|0)|0}var Q$=31,N0=0,w6=0,L1=1,jz=2,S7=4,i8=8,H7=16,qX=32,pz=4194240,BX=64,X$=128,Z$=256,J$=512,Y$=1024,$$=2048,H$=4096,G$=8192,q$=16384,B$=32768,U$=65536,K$=131072,O$=262144,W$=524288,L$=1048576,_$=2097152,GJ=130023424,dz=4194304,R$=8388608,N$=16777216,w$=33554432,b$=67108864,d2=dz,UX=134217728,c2=268435455,KX=268435456,o8=536870912,U5=1073741824;function X_(z){{if(z&L1)return"Sync";if(z&jz)return"InputContinuousHydration";if(z&S7)return"InputContinuous";if(z&i8)return"DefaultHydration";if(z&H7)return"Default";if(z&qX)return"TransitionHydration";if(z&pz)return"Transition";if(z&GJ)return"Retry";if(z&UX)return"SelectiveHydration";if(z&KX)return"IdleHydration";if(z&o8)return"Idle";if(z&U5)return"Offscreen"}}var A4=-1,qJ=BX,BJ=dz;function OX(z){switch(a8(z)){case L1:return L1;case jz:return jz;case S7:return S7;case i8:return i8;case H7:return H7;case qX:return qX;case BX:case X$:case Z$:case J$:case Y$:case $$:case H$:case G$:case q$:case B$:case U$:case K$:case O$:case W$:case L$:case _$:return z&pz;case dz:case R$:case N$:case w$:case b$:return z&GJ;case UX:return UX;case KX:return KX;case o8:return o8;case U5:return U5;default:return q("Should have found matching lanes. This is a bug in React."),z}}function UJ(z,Q){var X=z.pendingLanes;if(X===N0)return N0;var Z=N0,J=z.suspendedLanes,$=z.pingedLanes,H=X&c2;if(H!==N0){var B=H&~J;if(B!==N0)Z=OX(B);else{var K=H&$;if(K!==N0)Z=OX(K)}}else{var N=X&~J;if(N!==N0)Z=OX(N);else if($!==N0)Z=OX($)}if(Z===N0)return N0;if(Q!==N0&&Q!==Z&&(Q&J)===N0){var P=a8(Z),g=a8(Q);if(P>=g||P===H7&&(g&pz)!==N0)return Q}if((Z&S7)!==N0)Z|=X&H7;var u=z.entangledLanes;if(u!==N0){var e=z.entanglements,z0=Z&u;while(z0>0){var Y0=n8(z0),h0=1<<Y0;Z|=e[Y0],z0&=~h0}}return Z}function Z_(z,Q){var X=z.eventTimes,Z=A4;while(Q>0){var J=n8(Q),$=1<<J,H=X[J];if(H>Z)Z=H;Q&=~$}return Z}function J_(z,Q){switch(z){case L1:case jz:case S7:return Q+250;case i8:case H7:case qX:case BX:case X$:case Z$:case J$:case Y$:case $$:case H$:case G$:case q$:case B$:case U$:case K$:case O$:case W$:case L$:case _$:return Q+5000;case dz:case R$:case N$:case w$:case b$:return A4;case UX:case KX:case o8:case U5:return A4;default:return q("Should have found matching lanes. This is a bug in React."),A4}}function Y_(z,Q){var{pendingLanes:X,suspendedLanes:Z,pingedLanes:J,expirationTimes:$}=z,H=X;while(H>0){var B=n8(H),K=1<<B,N=$[B];if(N===A4){if((K&Z)===N0||(K&J)!==N0)$[B]=J_(K,Q)}else if(N<=Q)z.expiredLanes|=K;H&=~K}}function $_(z){return OX(z.pendingLanes)}function F$(z){var Q=z.pendingLanes&~U5;if(Q!==N0)return Q;if(Q&U5)return U5;return N0}function H_(z){return(z&L1)!==N0}function M$(z){return(z&c2)!==N0}function l2(z){return(z&GJ)===z}function G_(z){var Q=L1|S7|H7;return(z&Q)===N0}function q_(z){return(z&pz)===z}function KJ(z,Q){var X=jz|S7|i8|H7;return(Q&X)!==N0}function B_(z,Q){return(Q&z.expiredLanes)!==N0}function i2(z){return(z&pz)!==N0}function o2(){var z=qJ;if(qJ<<=1,(qJ&pz)===N0)qJ=BX;return z}function U_(){var z=BJ;if(BJ<<=1,(BJ&GJ)===N0)BJ=dz;return z}function a8(z){return z&-z}function WX(z){return a8(z)}function n8(z){return 31-p2(z)}function P$(z){return n8(z)}function K5(z,Q){return(z&Q)!==N0}function cz(z,Q){return(z&Q)===Q}function A1(z,Q){return z|Q}function OJ(z,Q){return z&~Q}function a2(z,Q){return z&Q}function WJ(z){return z}function K_(z,Q){return z!==w6&&z<Q?z:Q}function A$(z){var Q=[];for(var X=0;X<Q$;X++)Q.push(z);return Q}function LX(z,Q,X){if(z.pendingLanes|=Q,Q!==o8)z.suspendedLanes=N0,z.pingedLanes=N0;var Z=z.eventTimes,J=P$(Q);Z[J]=X}function O_(z,Q){z.suspendedLanes|=Q,z.pingedLanes&=~Q;var X=z.expirationTimes,Z=Q;while(Z>0){var J=n8(Z),$=1<<J;X[J]=A4,Z&=~$}}function n2(z,Q,X){z.pingedLanes|=z.suspendedLanes&Q}function W_(z,Q){var X=z.pendingLanes&~Q;z.pendingLanes=Q,z.suspendedLanes=N0,z.pingedLanes=N0,z.expiredLanes&=Q,z.mutableReadLanes&=Q,z.entangledLanes&=Q;var{entanglements:Z,eventTimes:J,expirationTimes:$}=z,H=X;while(H>0){var B=n8(H),K=1<<B;Z[B]=N0,J[B]=A4,$[B]=A4,H&=~K}}function I$(z,Q){var X=z.entangledLanes|=Q,Z=z.entanglements,J=X;while(J){var $=n8(J),H=1<<$;if(H&Q|Z[$]&Q)Z[$]|=Q;J&=~H}}function L_(z,Q){var X=a8(Q),Z;switch(X){case S7:Z=jz;break;case H7:Z=i8;break;case BX:case X$:case Z$:case J$:case Y$:case $$:case H$:case G$:case q$:case B$:case U$:case K$:case O$:case W$:case L$:case _$:case dz:case R$:case N$:case w$:case b$:Z=qX;break;case o8:Z=KX;break;default:Z=w6;break}if((Z&(z.suspendedLanes|Q))!==w6)return w6;return Z}function r2(z,Q,X){if(!g5)return;var Z=z.pendingUpdatersLaneMap;while(X>0){var J=P$(X),$=1<<J,H=Z[J];H.add(Q),X&=~$}}function t2(z,Q){if(!g5)return;var{pendingUpdatersLaneMap:X,memoizedUpdaters:Z}=z;while(Q>0){var J=P$(Q),$=1<<J,H=X[J];if(H.size>0)H.forEach(function(B){var K=B.alternate;if(K===null||!Z.has(K))Z.add(B)}),H.clear();Q&=~$}}function s2(z,Q){return null}var O5=L1,f7=S7,h7=H7,LJ=o8,_X=w6;function x5(){return _X}function b6(z){_X=z}function __(z,Q){var X=_X;try{return _X=z,Q()}finally{_X=X}}function R_(z,Q){return z!==0&&z<Q?z:Q}function N_(z,Q){return z===0||z>Q?z:Q}function k$(z,Q){return z!==0&&z<Q}function e2(z){var Q=a8(z);if(!k$(O5,Q))return O5;if(!k$(f7,Q))return f7;if(M$(Q))return h7;return LJ}function _J(z){var Q=z.current.memoizedState;return Q.isDehydrated}var zq;function w_(z){zq=z}function b_(z){zq(z)}var T$;function F_(z){T$=z}var Qq;function M_(z){Qq=z}var Xq;function P_(z){Xq=z}var Zq;function A_(z){Zq=z}var C$=!1,RJ=[],Z8=null,J8=null,Y8=null,RX=new Map,NX=new Map,$8=[],I_=["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 k_(z){return I_.indexOf(z)>-1}function T_(z,Q,X,Z,J){return{blockedOn:z,domEventName:Q,eventSystemFlags:X,nativeEvent:J,targetContainers:[Z]}}function Jq(z,Q){switch(z){case"focusin":case"focusout":Z8=null;break;case"dragenter":case"dragleave":J8=null;break;case"mouseover":case"mouseout":Y8=null;break;case"pointerover":case"pointerout":{var X=Q.pointerId;RX.delete(X);break}case"gotpointercapture":case"lostpointercapture":{var Z=Q.pointerId;NX.delete(Z);break}}}function wX(z,Q,X,Z,J,$){if(z===null||z.nativeEvent!==$){var H=T_(Q,X,Z,J,$);if(Q!==null){var B=q8(Q);if(B!==null)T$(B)}return H}z.eventSystemFlags|=Z;var K=z.targetContainers;if(J!==null&&K.indexOf(J)===-1)K.push(J);return z}function C_(z,Q,X,Z,J){switch(Q){case"focusin":{var $=J;return Z8=wX(Z8,z,Q,X,Z,$),!0}case"dragenter":{var H=J;return J8=wX(J8,z,Q,X,Z,H),!0}case"mouseover":{var B=J;return Y8=wX(Y8,z,Q,X,Z,B),!0}case"pointerover":{var K=J,N=K.pointerId;return RX.set(N,wX(RX.get(N)||null,z,Q,X,Z,K)),!0}case"gotpointercapture":{var P=J,g=P.pointerId;return NX.set(g,wX(NX.get(g)||null,z,Q,X,Z,P)),!0}}return!1}function Yq(z){var Q=s8(z.target);if(Q!==null){var X=d8(Q);if(X!==null){var Z=X.tag;if(Z===D){var J=v2(X);if(J!==null){z.blockedOn=J,Zq(z.priority,function(){Qq(X)});return}}else if(Z===I){var $=X.stateNode;if(_J($)){z.blockedOn=S2(X);return}}}}z.blockedOn=null}function v_(z){var Q=Xq(),X={blockedOn:null,target:z,priority:Q},Z=0;for(;Z<$8.length;Z++)if(!k$(Q,$8[Z].priority))break;if($8.splice(Z,0,X),Z===0)Yq(X)}function NJ(z){if(z.blockedOn!==null)return!1;var Q=z.targetContainers;while(Q.length>0){var X=Q[0],Z=f$(z.domEventName,z.eventSystemFlags,X,z.nativeEvent);if(Z===null){var J=z.nativeEvent,$=new J.constructor(J.type,J);QL($),J.target.dispatchEvent($),XL()}else{var H=q8(Z);if(H!==null)T$(H);return z.blockedOn=Z,!1}Q.shift()}return!0}function $q(z,Q,X){if(NJ(z))X.delete(Q)}function S_(){if(C$=!1,Z8!==null&&NJ(Z8))Z8=null;if(J8!==null&&NJ(J8))J8=null;if(Y8!==null&&NJ(Y8))Y8=null;RX.forEach($q),NX.forEach($q)}function bX(z,Q){if(z.blockedOn===Q){if(z.blockedOn=null,!C$)C$=!0,Y4.unstable_scheduleCallback(Y4.unstable_NormalPriority,S_)}}function FX(z){if(RJ.length>0){bX(RJ[0],z);for(var Q=1;Q<RJ.length;Q++){var X=RJ[Q];if(X.blockedOn===z)X.blockedOn=null}}if(Z8!==null)bX(Z8,z);if(J8!==null)bX(J8,z);if(Y8!==null)bX(Y8,z);var Z=function(B){return bX(B,z)};RX.forEach(Z),NX.forEach(Z);for(var J=0;J<$8.length;J++){var $=$8[J];if($.blockedOn===z)$.blockedOn=null}while($8.length>0){var H=$8[0];if(H.blockedOn!==null)break;else if(Yq(H),H.blockedOn===null)$8.shift()}}var lz=Y.ReactCurrentBatchConfig,v$=!0;function Hq(z){v$=!!z}function f_(){return v$}function h_(z,Q,X){var Z=Gq(Q),J;switch(Z){case O5:J=y_;break;case f7:J=V_;break;case h7:default:J=S$;break}return J.bind(null,Q,X,z)}function y_(z,Q,X,Z){var J=x5(),$=lz.transition;lz.transition=null;try{b6(O5),S$(z,Q,X,Z)}finally{b6(J),lz.transition=$}}function V_(z,Q,X,Z){var J=x5(),$=lz.transition;lz.transition=null;try{b6(f7),S$(z,Q,X,Z)}finally{b6(J),lz.transition=$}}function S$(z,Q,X,Z){if(!v$)return;D_(z,Q,X,Z)}function D_(z,Q,X,Z){var J=f$(z,Q,X,Z);if(J===null){l$(z,Q,Z,wJ,X),Jq(z,Z);return}if(C_(J,z,Q,X,Z)){Z.stopPropagation();return}if(Jq(z,Z),Q&QX&&k_(z)){while(J!==null){var $=q8(J);if($!==null)b_($);var H=f$(z,Q,X,Z);if(H===null)l$(z,Q,Z,wJ,X);if(H===J)break;J=H}if(J!==null)Z.stopPropagation();return}l$(z,Q,Z,null,X)}var wJ=null;function f$(z,Q,X,Z){wJ=null;var J=u3(Z),$=s8(J);if($!==null){var H=d8($);if(H===null)$=null;else{var B=H.tag;if(B===D){var K=v2(H);if(K!==null)return K;$=null}else if(B===I){var N=H.stateNode;if(_J(N))return S2(H);$=null}else if(H!==$)$=null}}return wJ=$,null}function Gq(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 O5;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 f7;case"message":{var Q=kL();switch(Q){case HJ:return O5;case s3:return f7;case c8:case TL:return h7;case e3:return LJ;default:return h7}}default:return h7}}function E_(z,Q,X){return z.addEventListener(Q,X,!1),X}function m_(z,Q,X){return z.addEventListener(Q,X,!0),X}function u_(z,Q,X,Z){return z.addEventListener(Q,X,{capture:!0,passive:Z}),X}function g_(z,Q,X,Z){return z.addEventListener(Q,X,{passive:Z}),X}var MX=null,h$=null,PX=null;function x_(z){return MX=z,h$=Bq(),!0}function j_(){MX=null,h$=null,PX=null}function qq(){if(PX)return PX;var z,Q=h$,X=Q.length,Z,J=Bq(),$=J.length;for(z=0;z<X;z++)if(Q[z]!==J[z])break;var H=X-z;for(Z=1;Z<=H;Z++)if(Q[X-Z]!==J[$-Z])break;var B=Z>1?1-Z:void 0;return PX=J.slice(z,B),PX}function Bq(){if("value"in MX)return MX.value;return MX.textContent}function bJ(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 FJ(){return!0}function Uq(){return!1}function W5(z){function Q(X,Z,J,$,H){this._reactName=X,this._targetInst=J,this.type=Z,this.nativeEvent=$,this.target=H,this.currentTarget=null;for(var B in z){if(!z.hasOwnProperty(B))continue;var K=z[B];if(K)this[B]=K($);else this[B]=$[B]}var N=$.defaultPrevented!=null?$.defaultPrevented:$.returnValue===!1;if(N)this.isDefaultPrevented=FJ;else this.isDefaultPrevented=Uq;return this.isPropagationStopped=Uq,this}return T1(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=FJ},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=FJ},persist:function(){},isPersistent:FJ}),Q}var iz={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(z){return z.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},y$=W5(iz),AX=T1({},iz,{view:0,detail:0}),p_=W5(AX),V$,D$,IX;function d_(z){if(z!==IX){if(IX&&z.type==="mousemove")V$=z.screenX-IX.screenX,D$=z.screenY-IX.screenY;else V$=0,D$=0;IX=z}}var MJ=T1({},AX,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:m$,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 d_(z),V$},movementY:function(z){if("movementY"in z)return z.movementY;return D$}}),Kq=W5(MJ),c_=T1({},MJ,{dataTransfer:0}),l_=W5(c_),i_=T1({},AX,{relatedTarget:0}),E$=W5(i_),o_=T1({},iz,{animationName:0,elapsedTime:0,pseudoElement:0}),a_=W5(o_),n_=T1({},iz,{clipboardData:function(z){return"clipboardData"in z?z.clipboardData:window.clipboardData}}),r_=W5(n_),t_=T1({},iz,{data:0}),Oq=W5(t_),s_=Oq,e_={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},zR={"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 QR(z){if(z.key){var Q=e_[z.key]||z.key;if(Q!=="Unidentified")return Q}if(z.type==="keypress"){var X=bJ(z);return X===13?"Enter":String.fromCharCode(X)}if(z.type==="keydown"||z.type==="keyup")return zR[z.keyCode]||"Unidentified";return""}var XR={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ZR(z){var Q=this,X=Q.nativeEvent;if(X.getModifierState)return X.getModifierState(z);var Z=XR[z];return Z?!!X[Z]:!1}function m$(z){return ZR}var JR=T1({},AX,{key:QR,code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:m$,charCode:function(z){if(z.type==="keypress")return bJ(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 bJ(z);if(z.type==="keydown"||z.type==="keyup")return z.keyCode;return 0}}),YR=W5(JR),$R=T1({},MJ,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Wq=W5($R),HR=T1({},AX,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:m$}),GR=W5(HR),qR=T1({},iz,{propertyName:0,elapsedTime:0,pseudoElement:0}),BR=W5(qR),UR=T1({},MJ,{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}),KR=W5(UR),OR=[9,13,27,32],Lq=229,u$=f1&&"CompositionEvent"in window,kX=null;if(f1&&"documentMode"in document)kX=document.documentMode;var WR=f1&&"TextEvent"in window&&!kX,_q=f1&&(!u$||kX&&kX>8&&kX<=11),Rq=32,Nq=String.fromCharCode(Rq);function LR(){L0("onBeforeInput",["compositionend","keypress","textInput","paste"]),L0("onCompositionEnd",["compositionend","focusout","keydown","keypress","keyup","mousedown"]),L0("onCompositionStart",["compositionstart","focusout","keydown","keypress","keyup","mousedown"]),L0("onCompositionUpdate",["compositionupdate","focusout","keydown","keypress","keyup","mousedown"])}var wq=!1;function _R(z){return(z.ctrlKey||z.altKey||z.metaKey)&&!(z.ctrlKey&&z.altKey)}function RR(z){switch(z){case"compositionstart":return"onCompositionStart";case"compositionend":return"onCompositionEnd";case"compositionupdate":return"onCompositionUpdate"}}function NR(z,Q){return z==="keydown"&&Q.keyCode===Lq}function bq(z,Q){switch(z){case"keyup":return OR.indexOf(Q.keyCode)!==-1;case"keydown":return Q.keyCode!==Lq;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Fq(z){var Q=z.detail;if(typeof Q==="object"&&"data"in Q)return Q.data;return null}function Mq(z){return z.locale==="ko"}var oz=!1;function wR(z,Q,X,Z,J){var $,H;if(u$)$=RR(Q);else if(!oz){if(NR(Q,Z))$="onCompositionStart"}else if(bq(Q,Z))$="onCompositionEnd";if(!$)return null;if(_q&&!Mq(Z)){if(!oz&&$==="onCompositionStart")oz=x_(J);else if($==="onCompositionEnd"){if(oz)H=qq()}}var B=TJ(X,$);if(B.length>0){var K=new Oq($,Q,null,Z,J);if(z.push({event:K,listeners:B}),H)K.data=H;else{var N=Fq(Z);if(N!==null)K.data=N}}}function bR(z,Q){switch(z){case"compositionend":return Fq(Q);case"keypress":var X=Q.which;if(X!==Rq)return null;return wq=!0,Nq;case"textInput":var Z=Q.data;if(Z===Nq&&wq)return null;return Z;default:return null}}function FR(z,Q){if(oz){if(z==="compositionend"||!u$&&bq(z,Q)){var X=qq();return j_(),oz=!1,X}return null}switch(z){case"paste":return null;case"keypress":if(!_R(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 _q&&!Mq(Q)?null:Q.data;default:return null}}function MR(z,Q,X,Z,J){var $;if(WR)$=bR(Q,Z);else $=FR(Q,Z);if(!$)return null;var H=TJ(X,"onBeforeInput");if(H.length>0){var B=new s_("onBeforeInput","beforeinput",null,Z,J);z.push({event:B,listeners:H}),B.data=$}}function PR(z,Q,X,Z,J,$,H){wR(z,Q,X,Z,J),MR(z,Q,X,Z,J)}var AR={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 Pq(z){var Q=z&&z.nodeName&&z.nodeName.toLowerCase();if(Q==="input")return!!AR[z.type];if(Q==="textarea")return!0;return!1}function IR(z){if(!f1)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 kR(){L0("onChange",["change","click","focusin","focusout","input","keydown","keyup","selectionchange"])}function Aq(z,Q,X,Z){F2(Z);var J=TJ(Q,"onChange");if(J.length>0){var $=new y$("onChange","change",null,X,Z);z.push({event:$,listeners:J})}}var TX=null,CX=null;function TR(z){var Q=z.nodeName&&z.nodeName.toLowerCase();return Q==="select"||Q==="input"&&z.type==="file"}function CR(z){var Q=[];Aq(Q,CX,z,u3(z)),I2(vR,Q)}function vR(z){pq(z,0)}function PJ(z){var Q=ez(z);if(vz(Q))return z}function SR(z,Q){if(z==="change")return Q}var Iq=!1;if(f1)Iq=IR("input")&&(!document.documentMode||document.documentMode>9);function fR(z,Q){TX=z,CX=Q,TX.attachEvent("onpropertychange",Tq)}function kq(){if(!TX)return;TX.detachEvent("onpropertychange",Tq),TX=null,CX=null}function Tq(z){if(z.propertyName!=="value")return;if(PJ(CX))CR(z)}function hR(z,Q,X){if(z==="focusin")kq(),fR(Q,X);else if(z==="focusout")kq()}function yR(z,Q){if(z==="selectionchange"||z==="keyup"||z==="keydown")return PJ(CX)}function VR(z){var Q=z.nodeName;return Q&&Q.toLowerCase()==="input"&&(z.type==="checkbox"||z.type==="radio")}function DR(z,Q){if(z==="click")return PJ(Q)}function ER(z,Q){if(z==="input"||z==="change")return PJ(Q)}function mR(z){var Q=z._wrapperState;if(!Q||!Q.controlled||z.type!=="number")return;W1(z,"number",z.value)}function uR(z,Q,X,Z,J,$,H){var B=X?ez(X):window,K,N;if(TR(B))K=SR;else if(Pq(B))if(Iq)K=ER;else K=yR,N=hR;else if(VR(B))K=DR;if(K){var P=K(Q,X);if(P){Aq(z,P,Z,J);return}}if(N)N(Q,B,X);if(Q==="focusout")mR(B)}function gR(){a0("onMouseEnter",["mouseout","mouseover"]),a0("onMouseLeave",["mouseout","mouseover"]),a0("onPointerEnter",["pointerout","pointerover"]),a0("onPointerLeave",["pointerout","pointerover"])}function xR(z,Q,X,Z,J,$,H){var B=Q==="mouseover"||Q==="pointerover",K=Q==="mouseout"||Q==="pointerout";if(B&&!ZL(Z)){var N=Z.relatedTarget||Z.fromElement;if(N){if(s8(N)||dX(N))return}}if(!K&&!B)return;var P;if(J.window===J)P=J;else{var g=J.ownerDocument;if(g)P=g.defaultView||g.parentWindow;else P=window}var u,e;if(K){var z0=Z.relatedTarget||Z.toElement;if(u=X,e=z0?s8(z0):null,e!==null){var Y0=d8(e);if(e!==Y0||e.tag!==w&&e.tag!==b)e=null}}else u=null,e=X;if(u===e)return;var h0=Kq,e0="onMouseLeave",o0="onMouseEnter",h1="mouse";if(Q==="pointerout"||Q==="pointerover")h0=Wq,e0="onPointerLeave",o0="onPointerEnter",h1="pointer";var y1=u==null?P:ez(u),o=e==null?P:ez(e),G0=new h0(e0,h1+"leave",u,Z,J);G0.target=y1,G0.relatedTarget=o;var a=null,b0=s8(J);if(b0===X){var m0=new h0(o0,h1+"enter",e,Z,J);m0.target=o,m0.relatedTarget=y1,a=m0}BN(z,G0,a,u,e)}function jR(z,Q){return z===Q&&(z!==0||1/z===1/Q)||z!==z&&Q!==Q}var L5=typeof Object.is==="function"?Object.is:jR;function vX(z,Q){if(L5(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(!q4.call(Q,$)||!L5(z[$],Q[$]))return!1}return!0}function Cq(z){while(z&&z.firstChild)z=z.firstChild;return z}function pR(z){while(z){if(z.nextSibling)return z.nextSibling;z=z.parentNode}}function vq(z,Q){var X=Cq(z),Z=0,J=0;while(X){if(X.nodeType===A7){if(J=Z+X.textContent.length,Z<=Q&&J>=Q)return{node:X,offset:Q-Z};Z=J}X=Cq(pR(X))}}function dR(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:H,focusOffset:B}=Z;try{J.nodeType,H.nodeType}catch(K){return null}return cR(z,J,$,H,B)}function cR(z,Q,X,Z,J){var $=0,H=-1,B=-1,K=0,N=0,P=z,g=null;z:while(!0){var u=null;while(!0){if(P===Q&&(X===0||P.nodeType===A7))H=$+X;if(P===Z&&(J===0||P.nodeType===A7))B=$+J;if(P.nodeType===A7)$+=P.nodeValue.length;if((u=P.firstChild)===null)break;g=P,P=u}while(!0){if(P===z)break z;if(g===Q&&++K===X)H=$;if(g===Z&&++N===J)B=$;if((u=P.nextSibling)!==null)break;P=g,g=P.parentNode}P=u}if(H===-1||B===-1)return null;return{start:H,end:B}}function lR(z,Q){var X=z.ownerDocument||document,Z=X&&X.defaultView||window;if(!Z.getSelection)return;var J=Z.getSelection(),$=z.textContent.length,H=Math.min(Q.start,$),B=Q.end===void 0?H:Math.min(Q.end,$);if(!J.extend&&H>B){var K=B;B=H,H=K}var N=vq(z,H),P=vq(z,B);if(N&&P){if(J.rangeCount===1&&J.anchorNode===N.node&&J.anchorOffset===N.offset&&J.focusNode===P.node&&J.focusOffset===P.offset)return;var g=X.createRange();if(g.setStart(N.node,N.offset),J.removeAllRanges(),H>B)J.addRange(g),J.extend(P.node,P.offset);else g.setEnd(P.node,P.offset),J.addRange(g)}}function Sq(z){return z&&z.nodeType===A7}function fq(z,Q){if(!z||!Q)return!1;else if(z===Q)return!0;else if(Sq(z))return!1;else if(Sq(Q))return fq(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 iR(z){return z&&z.ownerDocument&&fq(z.ownerDocument.documentElement,z)}function oR(z){try{return typeof z.contentWindow.location.href==="string"}catch(Q){return!1}}function hq(){var z=window,Q=Q8();while(Q instanceof z.HTMLIFrameElement){if(oR(Q))z=Q.contentWindow;else return Q;Q=Q8(z.document)}return Q}function g$(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 aR(){var z=hq();return{focusedElem:z,selectionRange:g$(z)?rR(z):null}}function nR(z){var Q=hq(),X=z.focusedElem,Z=z.selectionRange;if(Q!==X&&iR(X)){if(Z!==null&&g$(X))tR(X,Z);var J=[],$=X;while($=$.parentNode)if($.nodeType===X5)J.push({element:$,left:$.scrollLeft,top:$.scrollTop});if(typeof X.focus==="function")X.focus();for(var H=0;H<J.length;H++){var B=J[H];B.element.scrollLeft=B.left,B.element.scrollTop=B.top}}}function rR(z){var Q;if("selectionStart"in z)Q={start:z.selectionStart,end:z.selectionEnd};else Q=dR(z);return Q||{start:0,end:0}}function tR(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 lR(z,Q)}var sR=f1&&"documentMode"in document&&document.documentMode<=11;function eR(){L0("onSelect",["focusout","contextmenu","dragend","focusin","keydown","keyup","mousedown","mouseup","selectionchange"])}var az=null,x$=null,SX=null,j$=!1;function zN(z){if("selectionStart"in z&&g$(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 QN(z){return z.window===z?z.document:z.nodeType===I7?z:z.ownerDocument}function yq(z,Q,X){var Z=QN(X);if(j$||az==null||az!==Q8(Z))return;var J=zN(az);if(!SX||!vX(SX,J)){SX=J;var $=TJ(x$,"onSelect");if($.length>0){var H=new y$("onSelect","select",null,Q,X);z.push({event:H,listeners:$}),H.target=az}}}function XN(z,Q,X,Z,J,$,H){var B=X?ez(X):window;switch(Q){case"focusin":if(Pq(B)||B.contentEditable==="true")az=B,x$=X,SX=null;break;case"focusout":az=null,x$=null,SX=null;break;case"mousedown":j$=!0;break;case"contextmenu":case"mouseup":case"dragend":j$=!1,yq(z,Z,J);break;case"selectionchange":if(sR)break;case"keydown":case"keyup":yq(z,Z,J)}}function AJ(z,Q){var X={};return X[z.toLowerCase()]=Q.toLowerCase(),X["Webkit"+z]="webkit"+Q,X["Moz"+z]="moz"+Q,X}var nz={animationend:AJ("Animation","AnimationEnd"),animationiteration:AJ("Animation","AnimationIteration"),animationstart:AJ("Animation","AnimationStart"),transitionend:AJ("Transition","TransitionEnd")},p$={},Vq={};if(f1){if(Vq=document.createElement("div").style,!("AnimationEvent"in window))delete nz.animationend.animation,delete nz.animationiteration.animation,delete nz.animationstart.animation;if(!("TransitionEvent"in window))delete nz.transitionend.transition}function IJ(z){if(p$[z])return p$[z];else if(!nz[z])return z;var Q=nz[z];for(var X in Q)if(Q.hasOwnProperty(X)&&X in Vq)return p$[z]=Q[X];return z}var Dq=IJ("animationend"),Eq=IJ("animationiteration"),mq=IJ("animationstart"),uq=IJ("transitionend"),gq=new Map,xq=["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 H8(z,Q){gq.set(z,Q),L0(Q,[z])}function ZN(){for(var z=0;z<xq.length;z++){var Q=xq[z],X=Q.toLowerCase(),Z=Q[0].toUpperCase()+Q.slice(1);H8(X,"on"+Z)}H8(Dq,"onAnimationEnd"),H8(Eq,"onAnimationIteration"),H8(mq,"onAnimationStart"),H8("dblclick","onDoubleClick"),H8("focusin","onFocus"),H8("focusout","onBlur"),H8(uq,"onTransitionEnd")}function JN(z,Q,X,Z,J,$,H){var B=gq.get(Q);if(B===void 0)return;var K=y$,N=Q;switch(Q){case"keypress":if(bJ(Z)===0)return;case"keydown":case"keyup":K=YR;break;case"focusin":N="focus",K=E$;break;case"focusout":N="blur",K=E$;break;case"beforeblur":case"afterblur":K=E$;break;case"click":if(Z.button===2)return;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":K=Kq;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":K=l_;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":K=GR;break;case Dq:case Eq:case mq:K=a_;break;case uq:K=BR;break;case"scroll":K=p_;break;case"wheel":K=KR;break;case"copy":case"cut":case"paste":K=r_;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":K=Wq;break}var P=($&QX)!==0;{var g=!P&&Q==="scroll",u=GN(X,B,Z.type,P,g);if(u.length>0){var e=new K(B,N,null,Z,J);z.push({event:e,listeners:u})}}}ZN(),gR(),kR(),eR(),LR();function YN(z,Q,X,Z,J,$,H){JN(z,Q,X,Z,J,$);var B=($&zL)===0;if(B)xR(z,Q,X,Z,J),uR(z,Q,X,Z,J),XN(z,Q,X,Z,J),PR(z,Q,X,Z,J)}var fX=["abort","canplay","canplaythrough","durationchange","emptied","encrypted","ended","error","loadeddata","loadedmetadata","loadstart","pause","play","playing","progress","ratechange","resize","seeked","seeking","stalled","suspend","timeupdate","volumechange","waiting"],d$=new Set(["cancel","close","invalid","load","scroll","toggle"].concat(fX));function jq(z,Q,X){var Z=z.type||"unknown-event";z.currentTarget=X,KL(Z,Q,void 0,z),z.currentTarget=null}function $N(z,Q,X){var Z;if(X)for(var J=Q.length-1;J>=0;J--){var $=Q[J],H=$.instance,B=$.currentTarget,K=$.listener;if(H!==Z&&z.isPropagationStopped())return;jq(z,K,B),Z=H}else for(var N=0;N<Q.length;N++){var P=Q[N],g=P.instance,u=P.currentTarget,e=P.listener;if(g!==Z&&z.isPropagationStopped())return;jq(z,e,u),Z=g}}function pq(z,Q){var X=(Q&QX)!==0;for(var Z=0;Z<z.length;Z++){var J=z[Z],$=J.event,H=J.listeners;$N($,H,X)}OL()}function HN(z,Q,X,Z,J){var $=u3(X),H=[];YN(H,z,Z,X,$,Q),pq(H,Q)}function v4(z,Q){if(!d$.has(z))q('Did not expect a listenToNonDelegatedEvent() call for "%s". This is a bug in React. Please file an issue.',z);var X=!1,Z=mw(Q),J=UN(z,X);if(!Z.has(J))dq(Q,z,m3,X),Z.add(J)}function c$(z,Q,X){if(d$.has(z)&&!Q)q('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|=QX;dq(X,z,Z,Q)}var kJ="_reactListening"+Math.random().toString(36).slice(2);function hX(z){if(!z[kJ]){z[kJ]=!0,r0.forEach(function(X){if(X!=="selectionchange"){if(!d$.has(X))c$(X,!1,z);c$(X,!0,z)}});var Q=z.nodeType===I7?z:z.ownerDocument;if(Q!==null){if(!Q[kJ])Q[kJ]=!0,c$("selectionchange",!1,Q)}}}function dq(z,Q,X,Z,J){var $=h_(z,Q,X),H=void 0;if(j3){if(Q==="touchstart"||Q==="touchmove"||Q==="wheel")H=!0}z=z;var B;if(Z)if(H!==void 0)B=u_(z,Q,$,H);else B=m_(z,Q,$);else if(H!==void 0)B=g_(z,Q,$,H);else B=E_(z,Q,$)}function cq(z,Q){return z===Q||z.nodeType===s4&&z.parentNode===Q}function l$(z,Q,X,Z,J){var $=Z;if((Q&w2)===0&&(Q&m3)===0){var H=J;if(Z!==null){var B=Z;z:while(!0){if(B===null)return;var K=B.tag;if(K===I||K===F){var N=B.stateNode.containerInfo;if(cq(N,H))break;if(K===F){var P=B.return;while(P!==null){var g=P.tag;if(g===I||g===F){var u=P.stateNode.containerInfo;if(cq(u,H))return}P=P.return}}while(N!==null){var e=s8(N);if(e===null)return;var z0=e.tag;if(z0===w||z0===b){B=$=e;continue z}N=N.parentNode}}B=B.return}}}I2(function(){return HN(z,Q,X,$)})}function yX(z,Q,X){return{instance:z,listener:Q,currentTarget:X}}function GN(z,Q,X,Z,J,$){var H=Q!==null?Q+"Capture":null,B=Z?H:Q,K=[],N=z,P=null;while(N!==null){var g=N,u=g.stateNode,e=g.tag;if(e===w&&u!==null){if(P=u,B!==null){var z0=ZX(N,B);if(z0!=null)K.push(yX(N,z0,P))}}if(J)break;N=N.return}return K}function TJ(z,Q){var X=Q+"Capture",Z=[],J=z;while(J!==null){var $=J,H=$.stateNode,B=$.tag;if(B===w&&H!==null){var K=H,N=ZX(J,X);if(N!=null)Z.unshift(yX(J,N,K));var P=ZX(J,Q);if(P!=null)Z.push(yX(J,P,K))}J=J.return}return Z}function rz(z){if(z===null)return null;do z=z.return;while(z&&z.tag!==w);if(z)return z;return null}function qN(z,Q){var X=z,Z=Q,J=0;for(var $=X;$;$=rz($))J++;var H=0;for(var B=Z;B;B=rz(B))H++;while(J-H>0)X=rz(X),J--;while(H-J>0)Z=rz(Z),H--;var K=J;while(K--){if(X===Z||Z!==null&&X===Z.alternate)return X;X=rz(X),Z=rz(Z)}return null}function lq(z,Q,X,Z,J){var $=Q._reactName,H=[],B=X;while(B!==null){if(B===Z)break;var K=B,N=K.alternate,P=K.stateNode,g=K.tag;if(N!==null&&N===Z)break;if(g===w&&P!==null){var u=P;if(J){var e=ZX(B,$);if(e!=null)H.unshift(yX(B,e,u))}else if(!J){var z0=ZX(B,$);if(z0!=null)H.push(yX(B,z0,u))}}B=B.return}if(H.length!==0)z.push({event:Q,listeners:H})}function BN(z,Q,X,Z,J){var $=Z&&J?qN(Z,J):null;if(Z!==null)lq(z,Q,Z,$,!1);if(J!==null&&X!==null)lq(z,X,J,$,!0)}function UN(z,Q){return z+"__"+(Q?"capture":"bubble")}var Z5=!1,VX="dangerouslySetInnerHTML",CJ="suppressContentEditableWarning",G8="suppressHydrationWarning",iq="autoFocus",r8="children",t8="style",vJ="__html",i$,SJ,DX,oq,fJ,aq,nq;i$={dialog:!0,webview:!0},SJ=function(z,Q){oW(z,Q),aW(z,Q),eW(z,Q,{registrationNameDependencies:V0,possibleRegistrationNames:$1})},aq=f1&&!document.documentMode,DX=function(z,Q,X){if(Z5)return;var Z=hJ(X),J=hJ(Q);if(J===Z)return;Z5=!0,q("Prop `%s` did not match. Server: %s Client: %s",z,JSON.stringify(J),JSON.stringify(Z))},oq=function(z){if(Z5)return;Z5=!0;var Q=[];z.forEach(function(X){Q.push(X)}),q("Extra attributes from the server: %s",Q)},fJ=function(z,Q){if(Q===!1)q("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 q("Expected `%s` listener to be a function, instead got a value of `%s` type.",z,typeof Q)},nq=function(z,Q){var X=z.namespaceURI===P7?z.ownerDocument.createElement(z.tagName):z.ownerDocument.createElementNS(z.namespaceURI,z.tagName);return X.innerHTML=Q,X.innerHTML};var KN=/\r\n?/g,ON=/\u0000|\uFFFD/g;function hJ(z){D5(z);var Q=typeof z==="string"?z:""+z;return Q.replace(KN,`
32
+ `).replace(ON,"")}function yJ(z,Q,X,Z){var J=hJ(Q),$=hJ(z);if($===J)return;if(Z){if(!Z5)Z5=!0,q('Text content did not match. Server: "%s" Client: "%s"',$,J)}if(X&&F0)throw Error("Text content does not match server-rendered HTML.")}function rq(z){return z.nodeType===I7?z:z.ownerDocument}function WN(){}function VJ(z){z.onclick=WN}function LN(z,Q,X,Z,J){for(var $ in Z){if(!Z.hasOwnProperty($))continue;var H=Z[$];if($===t8){if(H)Object.freeze(H);O2(Q,H)}else if($===VX){var B=H?H[vJ]:void 0;if(B!=null)G2(Q,B)}else if($===r8){if(typeof H==="string"){var K=z!=="textarea"||H!=="";if(K)QJ(Q,H)}else if(typeof H==="number")QJ(Q,""+H)}else if($===CJ||$===G8);else if($===iq);else if(V0.hasOwnProperty($)){if(H!=null){if(typeof H!=="function")fJ($,H);if($==="onScroll")v4("scroll",Q)}}else if(H!=null)V1(Q,$,H,J)}}function _N(z,Q,X,Z){for(var J=0;J<Q.length;J+=2){var $=Q[J],H=Q[J+1];if($===t8)O2(z,H);else if($===VX)G2(z,H);else if($===r8)QJ(z,H);else V1(z,$,H,Z)}}function RN(z,Q,X,Z){var J,$=rq(X),H,B=Z;if(B===P7)B=f3(z);if(B===P7){if(J=u8(z,Q),!J&&z!==z.toLowerCase())q("<%s /> is using incorrect casing. Use PascalCase for React components, or lowercase for HTML elements.",z);if(z==="script"){var K=$.createElement("div");K.innerHTML="<script></script>";var N=K.firstChild;H=K.removeChild(N)}else if(typeof Q.is==="string")H=$.createElement(z,{is:Q.is});else if(H=$.createElement(z),z==="select"){var P=H;if(Q.multiple)P.multiple=!0;else if(Q.size)P.size=Q.size}}else H=$.createElementNS(B,z);if(B===P7){if(!J&&Object.prototype.toString.call(H)==="[object HTMLUnknownElement]"&&!q4.call(i$,z))i$[z]=!0,q("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 H}function NN(z,Q){return rq(Q).createTextNode(z)}function wN(z,Q,X,Z){var J=u8(Q,X);SJ(Q,X);var $;switch(Q){case"dialog":v4("cancel",z),v4("close",z),$=X;break;case"iframe":case"object":case"embed":v4("load",z),$=X;break;case"video":case"audio":for(var H=0;H<fX.length;H++)v4(fX[H],z);$=X;break;case"source":v4("error",z),$=X;break;case"img":case"image":case"link":v4("error",z),v4("load",z),$=X;break;case"details":v4("toggle",z),$=X;break;case"input":y(z,X),$=O(z,X),v4("invalid",z);break;case"option":R4(z,X),$=X;break;case"select":eQ(z,X),$=sQ(z,X),v4("invalid",z);break;case"textarea":Y2(z,X),$=v3(z,X),v4("invalid",z);break;default:$=X}switch(E3(Q,$),LN(Q,z,Z,$,J),Q){case"input":F7(z),A0(z,X,!1);break;case"textarea":F7(z),H2(z);break;case"option":C4(z,X);break;case"select":C3(z,X);break;default:if(typeof $.onClick==="function")VJ(z);break}}function bN(z,Q,X,Z,J){SJ(Q,Z);var $=null,H,B;switch(Q){case"input":H=O(z,X),B=O(z,Z),$=[];break;case"select":H=sQ(z,X),B=sQ(z,Z),$=[];break;case"textarea":H=v3(z,X),B=v3(z,Z),$=[];break;default:if(H=X,B=Z,typeof H.onClick!=="function"&&typeof B.onClick==="function")VJ(z);break}E3(Q,B);var K,N,P=null;for(K in H){if(B.hasOwnProperty(K)||!H.hasOwnProperty(K)||H[K]==null)continue;if(K===t8){var g=H[K];for(N in g)if(g.hasOwnProperty(N)){if(!P)P={};P[N]=""}}else if(K===VX||K===r8);else if(K===CJ||K===G8);else if(K===iq);else if(V0.hasOwnProperty(K)){if(!$)$=[]}else($=$||[]).push(K,null)}for(K in B){var u=B[K],e=H!=null?H[K]:void 0;if(!B.hasOwnProperty(K)||u===e||u==null&&e==null)continue;if(K===t8){if(u)Object.freeze(u);if(e){for(N in e)if(e.hasOwnProperty(N)&&(!u||!u.hasOwnProperty(N))){if(!P)P={};P[N]=""}for(N in u)if(u.hasOwnProperty(N)&&e[N]!==u[N]){if(!P)P={};P[N]=u[N]}}else{if(!P){if(!$)$=[];$.push(K,P)}P=u}}else if(K===VX){var z0=u?u[vJ]:void 0,Y0=e?e[vJ]:void 0;if(z0!=null){if(Y0!==z0)($=$||[]).push(K,z0)}}else if(K===r8){if(typeof u==="string"||typeof u==="number")($=$||[]).push(K,""+u)}else if(K===CJ||K===G8);else if(V0.hasOwnProperty(K)){if(u!=null){if(typeof u!=="function")fJ(K,u);if(K==="onScroll")v4("scroll",z)}if(!$&&e!==u)$=[]}else($=$||[]).push(K,u)}if(P)gW(P,B[t8]),($=$||[]).push(t8,P);return $}function FN(z,Q,X,Z,J){if(X==="input"&&J.type==="radio"&&J.name!=null)s(z,J);var $=u8(X,Z),H=u8(X,J);switch(_N(z,Q,$,H),X){case"input":$0(z,J);break;case"textarea":$2(z,J);break;case"select":_W(z,J);break}}function MN(z){{var Q=z.toLowerCase();if(!XJ.hasOwnProperty(Q))return null;return XJ[Q]||null}}function PN(z,Q,X,Z,J,$,H){var B,K;switch(B=u8(Q,X),SJ(Q,X),Q){case"dialog":v4("cancel",z),v4("close",z);break;case"iframe":case"object":case"embed":v4("load",z);break;case"video":case"audio":for(var N=0;N<fX.length;N++)v4(fX[N],z);break;case"source":v4("error",z);break;case"img":case"image":case"link":v4("error",z),v4("load",z);break;case"details":v4("toggle",z);break;case"input":y(z,X),v4("invalid",z);break;case"option":R4(z,X);break;case"select":eQ(z,X),v4("invalid",z);break;case"textarea":Y2(z,X),v4("invalid",z);break}E3(Q,X);{K=new Set;var P=z.attributes;for(var g=0;g<P.length;g++){var u=P[g].name.toLowerCase();switch(u){case"value":break;case"checked":break;case"selected":break;default:K.add(P[g].name)}}}var e=null;for(var z0 in X){if(!X.hasOwnProperty(z0))continue;var Y0=X[z0];if(z0===r8){if(typeof Y0==="string"){if(z.textContent!==Y0){if(X[G8]!==!0)yJ(z.textContent,Y0,$,H);e=[r8,Y0]}}else if(typeof Y0==="number"){if(z.textContent!==""+Y0){if(X[G8]!==!0)yJ(z.textContent,Y0,$,H);e=[r8,""+Y0]}}}else if(V0.hasOwnProperty(z0)){if(Y0!=null){if(typeof Y0!=="function")fJ(z0,Y0);if(z0==="onScroll")v4("scroll",z)}}else if(H&&!0&&typeof B==="boolean"){var h0=void 0,e0=B&&Z0?null:a4(z0);if(X[G8]===!0);else if(z0===CJ||z0===G8||z0==="value"||z0==="checked"||z0==="selected");else if(z0===VX){var o0=z.innerHTML,h1=Y0?Y0[vJ]:void 0;if(h1!=null){var y1=nq(z,h1);if(y1!==o0)DX(z0,o0,y1)}}else if(z0===t8){if(K.delete(z0),aq){var o=mW(Y0);if(h0=z.getAttribute("style"),o!==h0)DX(z0,h0,o)}}else if(B&&!Z0){if(K.delete(z0.toLowerCase()),h0=m5(z,z0,Y0),Y0!==h0)DX(z0,h0,Y0)}else if(!t1(z0,e0,B)&&!H4(z0,Y0,e0,B)){var G0=!1;if(e0!==null)K.delete(e0.attributeName),h0=m6(z,z0,Y0,e0);else{var a=Z;if(a===P7)a=f3(Q);if(a===P7)K.delete(z0.toLowerCase());else{var b0=MN(z0);if(b0!==null&&b0!==z0)G0=!0,K.delete(b0);K.delete(z0)}h0=m5(z,z0,Y0)}var m0=Z0;if(!m0&&Y0!==h0&&!G0)DX(z0,h0,Y0)}}}if(H){if(K.size>0&&X[G8]!==!0)oq(K)}switch(Q){case"input":F7(z),A0(z,X,!0);break;case"textarea":F7(z),H2(z);break;case"select":case"option":break;default:if(typeof X.onClick==="function")VJ(z);break}return e}function AN(z,Q,X){var Z=z.nodeValue!==Q;return Z}function o$(z,Q){{if(Z5)return;Z5=!0,q("Did not expect server HTML to contain a <%s> in <%s>.",Q.nodeName.toLowerCase(),z.nodeName.toLowerCase())}}function a$(z,Q){{if(Z5)return;Z5=!0,q('Did not expect server HTML to contain the text node "%s" in <%s>.',Q.nodeValue,z.nodeName.toLowerCase())}}function n$(z,Q,X){{if(Z5)return;Z5=!0,q("Expected server HTML to contain a matching <%s> in <%s>.",Q,z.nodeName.toLowerCase())}}function r$(z,Q){{if(Q==="")return;if(Z5)return;Z5=!0,q('Expected server HTML to contain a matching text node for "%s" in <%s>.',Q,z.nodeName.toLowerCase())}}function IN(z,Q,X){switch(Q){case"input":q1(z,X);return;case"textarea":NW(z,X);return;case"select":RW(z,X);return}}var EX=function(){},mX=function(){};{var kN=["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"],tq=["applet","caption","html","table","td","th","marquee","object","template","foreignObject","desc","title"],TN=tq.concat(["button"]),CN=["dd","dt","li","option","optgroup","p","rp","rt"],sq={current:null,formTag:null,aTagInScope:null,buttonTagInScope:null,nobrTagInScope:null,pTagInButtonScope:null,listItemTagAutoclosing:null,dlItemTagAutoclosing:null};mX=function(z,Q){var X=T1({},z||sq),Z={tag:Q};if(tq.indexOf(Q)!==-1)X.aTagInScope=null,X.buttonTagInScope=null,X.nobrTagInScope=null;if(TN.indexOf(Q)!==-1)X.pTagInButtonScope=null;if(kN.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 vN=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 CN.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},SN=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},eq={};EX=function(z,Q,X){X=X||sq;var Z=X.current,J=Z&&Z.tag;if(Q!=null){if(z!=null)q("validateDOMNesting: when childText is passed, childTag should be null");z="#text"}var $=vN(z,J)?null:Z,H=$?null:SN(z,X),B=$||H;if(!B)return;var K=B.tag,N=!!$+"|"+z+"|"+K;if(eq[N])return;eq[N]=!0;var P=z,g="";if(z==="#text")if(/\S/.test(Q))P="Text nodes";else P="Whitespace text nodes",g=" Make sure you don't have any extra whitespace between tags on each line of your source code.";else P="<"+z+">";if($){var u="";if(K==="table"&&z==="tr")u+=" Add a <tbody>, <thead> or <tfoot> to your code to match the DOM tree generated by the browser.";q("validateDOMNesting(...): %s cannot appear as a child of <%s>.%s%s",P,K,g,u)}else q("validateDOMNesting(...): %s cannot appear as a descendant of <%s>.",P,K)}}var DJ="suppressHydrationWarning",EJ="$",mJ="/$",uX="$?",gX="$!",fN="style",t$=null,s$=null;function hN(z){var Q,X,Z=z.nodeType;switch(Z){case I7:case y3:{Q=Z===I7?"#document":"#fragment";var J=z.documentElement;X=J?J.namespaceURI:h3(null,"");break}default:{var $=Z===s4?z.parentNode:z,H=$.namespaceURI||null;Q=$.tagName,X=h3(H,Q);break}}{var B=Q.toLowerCase(),K=mX(null,B);return{namespace:X,ancestorInfo:K}}}function yN(z,Q,X){{var Z=z,J=h3(Z.namespace,Q),$=mX(Z.ancestorInfo,Q);return{namespace:J,ancestorInfo:$}}}function e$(z){return z}function VN(z){t$=f_(),s$=aR();var Q=null;return Hq(!1),Q}function DN(z){nR(s$),Hq(t$),t$=null,s$=null}function EN(z,Q,X,Z,J){var $;{var H=Z;if(EX(z,null,H.ancestorInfo),typeof Q.children==="string"||typeof Q.children==="number"){var B=""+Q.children,K=mX(H.ancestorInfo,z);EX(null,B,K)}$=H.namespace}var N=RN(z,Q,X,$);return pX(J,N),HH(N,Q),N}function mN(z,Q){z.appendChild(Q)}function uN(z,Q,X,Z,J){switch(wN(z,Q,X,Z),Q){case"button":case"input":case"select":case"textarea":return!!X.autoFocus;case"img":return!0;default:return!1}}function gN(z,Q,X,Z,J,$){{var H=$;if(typeof Z.children!==typeof X.children&&(typeof Z.children==="string"||typeof Z.children==="number")){var B=""+Z.children,K=mX(H.ancestorInfo,Q);EX(null,B,K)}}return bN(z,Q,X,Z)}function zH(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 xN(z,Q,X,Z){{var J=X;EX(null,z,J.ancestorInfo)}var $=NN(z,Q);return pX(Z,$),$}function jN(){var z=window.event;if(z===void 0)return h7;return Gq(z.type)}var QH=typeof setTimeout==="function"?setTimeout:void 0,pN=typeof clearTimeout==="function"?clearTimeout:void 0,XH=-1,zB=typeof Promise==="function"?Promise:void 0,dN=typeof queueMicrotask==="function"?queueMicrotask:typeof zB<"u"?function(z){return zB.resolve(null).then(z).catch(cN)}:QH;function cN(z){setTimeout(function(){throw z})}function lN(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 iN(z,Q,X,Z,J,$){FN(z,Q,X,Z,J),HH(z,J)}function QB(z){QJ(z,"")}function oN(z,Q,X){z.nodeValue=X}function aN(z,Q){z.appendChild(Q)}function nN(z,Q){var X;if(z.nodeType===s4)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)VJ(X)}function rN(z,Q,X){z.insertBefore(Q,X)}function tN(z,Q,X){if(z.nodeType===s4)z.parentNode.insertBefore(Q,X);else z.insertBefore(Q,X)}function sN(z,Q){z.removeChild(Q)}function eN(z,Q){if(z.nodeType===s4)z.parentNode.removeChild(Q);else z.removeChild(Q)}function ZH(z,Q){var X=Q,Z=0;do{var J=X.nextSibling;if(z.removeChild(X),J&&J.nodeType===s4){var $=J.data;if($===mJ)if(Z===0){z.removeChild(J),FX(Q);return}else Z--;else if($===EJ||$===uX||$===gX)Z++}X=J}while(X);FX(Q)}function zw(z,Q){if(z.nodeType===s4)ZH(z.parentNode,Q);else if(z.nodeType===X5)ZH(z,Q);FX(z)}function Qw(z){z=z;var Q=z.style;if(typeof Q.setProperty==="function")Q.setProperty("display","none","important");else Q.display="none"}function Xw(z){z.nodeValue=""}function Zw(z,Q){z=z;var X=Q[fN],Z=X!==void 0&&X!==null&&X.hasOwnProperty("display")?X.display:null;z.style.display=V3("display",Z)}function Jw(z,Q){z.nodeValue=Q}function Yw(z){if(z.nodeType===X5)z.textContent="";else if(z.nodeType===I7){if(z.documentElement)z.removeChild(z.documentElement)}}function $w(z,Q,X){if(z.nodeType!==X5||Q.toLowerCase()!==z.nodeName.toLowerCase())return null;return z}function Hw(z,Q){if(Q===""||z.nodeType!==A7)return null;return z}function Gw(z){if(z.nodeType!==s4)return null;return z}function XB(z){return z.data===uX}function JH(z){return z.data===gX}function qw(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 Bw(z,Q){z._reactRetry=Q}function uJ(z){for(;z!=null;z=z.nextSibling){var Q=z.nodeType;if(Q===X5||Q===A7)break;if(Q===s4){var X=z.data;if(X===EJ||X===gX||X===uX)break;if(X===mJ)return null}}return z}function xX(z){return uJ(z.nextSibling)}function Uw(z){return uJ(z.firstChild)}function Kw(z){return uJ(z.firstChild)}function Ow(z){return uJ(z.nextSibling)}function Ww(z,Q,X,Z,J,$,H){pX($,z),HH(z,X);var B;{var K=J;B=K.namespace}var N=($.mode&m1)!==Y1;return PN(z,Q,X,B,Z,N,H)}function Lw(z,Q,X,Z){pX(X,z);var J=(X.mode&m1)!==Y1;return AN(z,Q)}function _w(z,Q){pX(Q,z)}function Rw(z){var Q=z.nextSibling,X=0;while(Q){if(Q.nodeType===s4){var Z=Q.data;if(Z===mJ)if(X===0)return xX(Q);else X--;else if(Z===EJ||Z===gX||Z===uX)X++}Q=Q.nextSibling}return null}function ZB(z){var Q=z.previousSibling,X=0;while(Q){if(Q.nodeType===s4){var Z=Q.data;if(Z===EJ||Z===gX||Z===uX)if(X===0)return Q;else X--;else if(Z===mJ)X++}Q=Q.previousSibling}return null}function Nw(z){FX(z)}function ww(z){FX(z)}function bw(z){return z!=="head"&&z!=="body"}function Fw(z,Q,X,Z){var J=!0;yJ(Q.nodeValue,X,Z,J)}function Mw(z,Q,X,Z,J,$){if(Q[DJ]!==!0){var H=!0;yJ(Z.nodeValue,J,$,H)}}function Pw(z,Q){if(Q.nodeType===X5)o$(z,Q);else if(Q.nodeType===s4);else a$(z,Q)}function Aw(z,Q){{var X=z.parentNode;if(X!==null)if(Q.nodeType===X5)o$(X,Q);else if(Q.nodeType===s4);else a$(X,Q)}}function Iw(z,Q,X,Z,J){if(J||Q[DJ]!==!0)if(Z.nodeType===X5)o$(X,Z);else if(Z.nodeType===s4);else a$(X,Z)}function kw(z,Q,X){n$(z,Q)}function Tw(z,Q){r$(z,Q)}function Cw(z,Q,X){{var Z=z.parentNode;if(Z!==null)n$(Z,Q)}}function vw(z,Q){{var X=z.parentNode;if(X!==null)r$(X,Q)}}function Sw(z,Q,X,Z,J,$){if($||Q[DJ]!==!0)n$(X,Z)}function fw(z,Q,X,Z,J){if(J||Q[DJ]!==!0)r$(X,Z)}function hw(z){q("An error occurred during hydration. The server HTML was replaced with client content in <%s>.",z.nodeName.toLowerCase())}function yw(z){hX(z)}var tz=Math.random().toString(36).slice(2),sz="__reactFiber$"+tz,YH="__reactProps$"+tz,jX="__reactContainer$"+tz,$H="__reactEvents$"+tz,Vw="__reactListeners$"+tz,Dw="__reactHandles$"+tz;function Ew(z){delete z[sz],delete z[YH],delete z[$H],delete z[Vw],delete z[Dw]}function pX(z,Q){Q[sz]=z}function gJ(z,Q){Q[jX]=z}function JB(z){z[jX]=null}function dX(z){return!!z[jX]}function s8(z){var Q=z[sz];if(Q)return Q;var X=z.parentNode;while(X){if(Q=X[jX]||X[sz],Q){var Z=Q.alternate;if(Q.child!==null||Z!==null&&Z.child!==null){var J=ZB(z);while(J!==null){var $=J[sz];if($)return $;J=ZB(J)}}return Q}z=X,X=z.parentNode}return null}function q8(z){var Q=z[sz]||z[jX];if(Q)if(Q.tag===w||Q.tag===b||Q.tag===D||Q.tag===I)return Q;else return null;return null}function ez(z){if(z.tag===w||z.tag===b)return z.stateNode;throw Error("getNodeFromInstance: Invalid argument.")}function xJ(z){return z[YH]||null}function HH(z,Q){z[YH]=Q}function mw(z){var Q=z[$H];if(Q===void 0)Q=z[$H]=new Set;return Q}var YB={},$B=Y.ReactDebugCurrentFrame;function jJ(z){if(z){var Q=z._owner,X=s7(z.type,z._source,Q?Q.type:null);$B.setExtraStackFrame(X)}else $B.setExtraStackFrame(null)}function j5(z,Q,X,Z,J){{var $=Function.call.bind(q4);for(var H in z)if($(z,H)){var B=void 0;try{if(typeof z[H]!=="function"){var K=Error((Z||"React class")+": "+X+" type `"+H+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof z[H]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw K.name="Invariant Violation",K}B=z[H](Q,H,Z,X,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(N){B=N}if(B&&!(B instanceof Error))jJ(J),q("%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,H,typeof B),jJ(null);if(B instanceof Error&&!(B.message in YB))YB[B.message]=!0,jJ(J),q("Failed %s type: %s",X,B.message),jJ(null)}}}var GH=[],pJ;pJ=[];var y7=-1;function B8(z){return{current:z}}function g6(z,Q){if(y7<0){q("Unexpected pop.");return}if(Q!==pJ[y7])q("Unexpected Fiber popped.");z.current=GH[y7],GH[y7]=null,pJ[y7]=null,y7--}function x6(z,Q,X){y7++,GH[y7]=z.current,pJ[y7]=X,z.current=Q}var HB={},_5={};Object.freeze(_5);var V7=B8(_5),G7=B8(!1),qH=_5;function zQ(z,Q,X){{if(X&&q7(Q))return qH;return V7.current}}function GB(z,Q,X){{var Z=z.stateNode;Z.__reactInternalMemoizedUnmaskedChildContext=Q,Z.__reactInternalMemoizedMaskedChildContext=X}}function QQ(z,Q){{var X=z.type,Z=X.contextTypes;if(!Z)return _5;var J=z.stateNode;if(J&&J.__reactInternalMemoizedUnmaskedChildContext===Q)return J.__reactInternalMemoizedMaskedChildContext;var $={};for(var H in Z)$[H]=Q[H];{var B=M1(z)||"Unknown";j5(Z,$,"context",B)}if(J)GB(z,Q,$);return $}}function dJ(){return G7.current}function q7(z){{var Q=z.childContextTypes;return Q!==null&&Q!==void 0}}function cJ(z){g6(G7,z),g6(V7,z)}function BH(z){g6(G7,z),g6(V7,z)}function qB(z,Q,X){{if(V7.current!==_5)throw Error("Unexpected context found on stack. This error is likely caused by a bug in React. Please file an issue.");x6(V7,Q,z),x6(G7,X,z)}}function BB(z,Q,X){{var Z=z.stateNode,J=Q.childContextTypes;if(typeof Z.getChildContext!=="function"){{var $=M1(z)||"Unknown";if(!HB[$])HB[$]=!0,q("%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 H=Z.getChildContext();for(var B in H)if(!(B in J))throw Error((M1(z)||"Unknown")+'.getChildContext(): key "'+B+'" is not defined in childContextTypes.');{var K=M1(z)||"Unknown";j5(J,H,"child context",K)}return T1({},X,H)}}function lJ(z){{var Q=z.stateNode,X=Q&&Q.__reactInternalMemoizedMergedChildContext||_5;return qH=V7.current,x6(V7,X,z),x6(G7,G7.current,z),!0}}function UB(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=BB(z,Q,qH);Z.__reactInternalMemoizedMergedChildContext=J,g6(G7,z),g6(V7,z),x6(V7,J,z),x6(G7,X,z)}else g6(G7,z),x6(G7,X,z)}}function uw(z){{if(!bL(z)||z.tag!==_)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 I:return Q.stateNode.context;case _:{var X=Q.type;if(q7(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 U8=0,iJ=1,D7=null,UH=!1,KH=!1;function KB(z){if(D7===null)D7=[z];else D7.push(z)}function gw(z){UH=!0,KB(z)}function OB(){if(UH)K8()}function K8(){if(!KH&&D7!==null){KH=!0;var z=0,Q=x5();try{var X=!0,Z=D7;b6(O5);for(;z<Z.length;z++){var J=Z[z];do J=J(X);while(J!==null)}D7=null,UH=!1}catch($){if(D7!==null)D7=D7.slice(z+1);throw E2(HJ,K8),$}finally{b6(Q),KH=!1}}return null}var XQ=[],ZQ=0,oJ=null,aJ=0,P5=[],A5=0,e8=null,E7=1,m7="";function xw(z){return Qz(),(z.flags&C2)!==G1}function jw(z){return Qz(),aJ}function pw(){var z=m7,Q=E7,X=Q&~dw(Q);return X.toString(32)+z}function zz(z,Q){Qz(),XQ[ZQ++]=aJ,XQ[ZQ++]=oJ,oJ=z,aJ=Q}function WB(z,Q,X){Qz(),P5[A5++]=E7,P5[A5++]=m7,P5[A5++]=e8,e8=z;var Z=E7,J=m7,$=nJ(Z)-1,H=Z&~(1<<$),B=X+1,K=nJ(Q)+$;if(K>30){var N=$-$%5,P=(1<<N)-1,g=(H&P).toString(32),u=H>>N,e=$-N,z0=nJ(Q)+e,Y0=B<<e,h0=Y0|u,e0=g+J;E7=1<<z0|h0,m7=e0}else{var o0=B<<$,h1=o0|H,y1=J;E7=1<<K|h1,m7=y1}}function OH(z){Qz();var Q=z.return;if(Q!==null){var X=1,Z=0;zz(z,X),WB(z,X,Z)}}function nJ(z){return 32-p2(z)}function dw(z){return 1<<nJ(z)-1}function WH(z){while(z===oJ)oJ=XQ[--ZQ],XQ[ZQ]=null,aJ=XQ[--ZQ],XQ[ZQ]=null;while(z===e8)e8=P5[--A5],P5[A5]=null,m7=P5[--A5],P5[A5]=null,E7=P5[--A5],P5[A5]=null}function cw(){if(Qz(),e8!==null)return{id:E7,overflow:m7};else return null}function lw(z,Q){Qz(),P5[A5++]=E7,P5[A5++]=m7,P5[A5++]=e8,E7=Q.id,m7=Q.overflow,e8=z}function Qz(){if(!I6())q("Expected to be hydrating. This is a bug in React. Please file an issue.")}var A6=null,I5=null,p5=!1,Xz=!1,O8=null;function iw(){if(p5)q("We should not be hydrating here. This is a bug in React. Please file a bug.")}function LB(){Xz=!0}function ow(){return Xz}function aw(z){var Q=z.stateNode.containerInfo;return I5=Kw(Q),A6=z,p5=!0,O8=null,Xz=!1,!0}function nw(z,Q,X){if(I5=Ow(Q),A6=z,p5=!0,O8=null,Xz=!1,X!==null)lw(z,X);return!0}function _B(z,Q){switch(z.tag){case I:{Pw(z.stateNode.containerInfo,Q);break}case w:{var X=(z.mode&m1)!==Y1;Iw(z.type,z.memoizedProps,z.stateNode,Q,X);break}case D:{var Z=z.memoizedState;if(Z.dehydrated!==null)Aw(Z.dehydrated,Q);break}}}function RB(z,Q){_B(z,Q);var X=ZP();X.stateNode=Q,X.return=z;var Z=z.deletions;if(Z===null)z.deletions=[X],z.flags|=g8;else Z.push(X)}function LH(z,Q){{if(Xz)return;switch(z.tag){case I:{var X=z.stateNode.containerInfo;switch(Q.tag){case w:var{type:Z,pendingProps:J}=Q;kw(X,Z);break;case b:var $=Q.pendingProps;Tw(X,$);break}break}case w:{var{type:H,memoizedProps:B,stateNode:K}=z;switch(Q.tag){case w:{var{type:N,pendingProps:P}=Q,g=(z.mode&m1)!==Y1;Sw(H,B,K,N,P,g);break}case b:{var u=Q.pendingProps,e=(z.mode&m1)!==Y1;fw(H,B,K,u,e);break}}break}case D:{var z0=z.memoizedState,Y0=z0.dehydrated;if(Y0!==null)switch(Q.tag){case w:var{type:h0,pendingProps:e0}=Q;Cw(Y0,h0);break;case b:var o0=Q.pendingProps;vw(Y0,o0);break}break}default:return}}}function NB(z,Q){Q.flags=Q.flags&~T7|e4,LH(z,Q)}function wB(z,Q){switch(z.tag){case w:{var{type:X,pendingProps:Z}=z,J=$w(Q,X);if(J!==null)return z.stateNode=J,A6=z,I5=Uw(J),!0;return!1}case b:{var $=z.pendingProps,H=Hw(Q,$);if(H!==null)return z.stateNode=H,A6=z,I5=null,!0;return!1}case D:{var B=Gw(Q);if(B!==null){var K={dehydrated:B,treeContext:cw(),retryLane:U5};z.memoizedState=K;var N=JP(B);return N.return=z,z.child=N,A6=z,I5=null,!0}return!1}default:return!1}}function _H(z){return(z.mode&m1)!==Y1&&(z.flags&o1)===G1}function RH(z){throw Error("Hydration failed because the initial UI does not match what was rendered on the server.")}function NH(z){if(!p5)return;var Q=I5;if(!Q){if(_H(z))LH(A6,z),RH();NB(A6,z),p5=!1,A6=z;return}var X=Q;if(!wB(z,Q)){if(_H(z))LH(A6,z),RH();Q=xX(X);var Z=A6;if(!Q||!wB(z,Q)){NB(A6,z),p5=!1,A6=z;return}RB(Z,X)}}function rw(z,Q,X){var Z=z.stateNode,J=!Xz,$=Ww(Z,z.type,z.memoizedProps,Q,X,z,J);if(z.updateQueue=$,$!==null)return!0;return!1}function tw(z){var{stateNode:Q,memoizedProps:X}=z,Z=Lw(Q,X,z);if(Z){var J=A6;if(J!==null)switch(J.tag){case I:{var $=J.stateNode.containerInfo,H=(J.mode&m1)!==Y1;Fw($,Q,X,H);break}case w:{var{type:B,memoizedProps:K,stateNode:N}=J,P=(J.mode&m1)!==Y1;Mw(B,K,N,Q,X,P);break}}}return Z}function sw(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.");_w(X,z)}function ew(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 Rw(X)}function bB(z){var Q=z.return;while(Q!==null&&Q.tag!==w&&Q.tag!==I&&Q.tag!==D)Q=Q.return;A6=Q}function rJ(z){if(z!==A6)return!1;if(!p5)return bB(z),p5=!0,!1;if(z.tag!==I&&(z.tag!==w||bw(z.type)&&!zH(z.type,z.memoizedProps))){var Q=I5;if(Q)if(_H(z))FB(z),RH();else while(Q)RB(z,Q),Q=xX(Q)}if(bB(z),z.tag===D)I5=ew(z);else I5=A6?xX(z.stateNode):null;return!0}function zb(){return p5&&I5!==null}function FB(z){var Q=I5;while(Q)_B(z,Q),Q=xX(Q)}function JQ(){A6=null,I5=null,p5=!1,Xz=!1}function MB(){if(O8!==null)_K(O8),O8=null}function I6(){return p5}function wH(z){if(O8===null)O8=[z];else O8.push(z)}var Qb=Y.ReactCurrentBatchConfig,Xb=null;function Zb(){return Qb.transition}var d5={recordUnsafeLifecycleWarnings:function(z,Q){},flushPendingUnsafeLifecycleWarnings:function(){},recordLegacyContextWarning:function(z,Q){},flushLegacyContextWarning:function(){},discardPendingWarnings:function(){}};{var Jb=function(z){var Q=null,X=z;while(X!==null){if(X.mode&d4)Q=X;X=X.return}return Q},Zz=function(z){var Q=[];return z.forEach(function(X){Q.push(X)}),Q.sort().join(", ")},cX=[],lX=[],iX=[],oX=[],aX=[],nX=[],Jz=new Set;d5.recordUnsafeLifecycleWarnings=function(z,Q){if(Jz.has(z.type))return;if(typeof Q.componentWillMount==="function"&&Q.componentWillMount.__suppressDeprecationWarning!==!0)cX.push(z);if(z.mode&d4&&typeof Q.UNSAFE_componentWillMount==="function")lX.push(z);if(typeof Q.componentWillReceiveProps==="function"&&Q.componentWillReceiveProps.__suppressDeprecationWarning!==!0)iX.push(z);if(z.mode&d4&&typeof Q.UNSAFE_componentWillReceiveProps==="function")oX.push(z);if(typeof Q.componentWillUpdate==="function"&&Q.componentWillUpdate.__suppressDeprecationWarning!==!0)aX.push(z);if(z.mode&d4&&typeof Q.UNSAFE_componentWillUpdate==="function")nX.push(z)},d5.flushPendingUnsafeLifecycleWarnings=function(){var z=new Set;if(cX.length>0)cX.forEach(function(u){z.add(M1(u)||"Component"),Jz.add(u.type)}),cX=[];var Q=new Set;if(lX.length>0)lX.forEach(function(u){Q.add(M1(u)||"Component"),Jz.add(u.type)}),lX=[];var X=new Set;if(iX.length>0)iX.forEach(function(u){X.add(M1(u)||"Component"),Jz.add(u.type)}),iX=[];var Z=new Set;if(oX.length>0)oX.forEach(function(u){Z.add(M1(u)||"Component"),Jz.add(u.type)}),oX=[];var J=new Set;if(aX.length>0)aX.forEach(function(u){J.add(M1(u)||"Component"),Jz.add(u.type)}),aX=[];var $=new Set;if(nX.length>0)nX.forEach(function(u){$.add(M1(u)||"Component"),Jz.add(u.type)}),nX=[];if(Q.size>0){var H=Zz(Q);q(`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`,H)}if(Z.size>0){var B=Zz(Z);q(`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`,B)}if($.size>0){var K=Zz($);q(`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`,K)}if(z.size>0){var N=Zz(z);W(`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`,N)}if(X.size>0){var P=Zz(X);W(`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`,P)}if(J.size>0){var g=Zz(J);W(`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`,g)}};var tJ=new Map,PB=new Set;d5.recordLegacyContextWarning=function(z,Q){var X=Jb(z);if(X===null){q("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(PB.has(z.type))return;var Z=tJ.get(X);if(z.type.contextTypes!=null||z.type.childContextTypes!=null||Q!==null&&typeof Q.getChildContext==="function"){if(Z===void 0)Z=[],tJ.set(X,Z);Z.push(z)}},d5.flushLegacyContextWarning=function(){tJ.forEach(function(z,Q){if(z.length===0)return;var X=z[0],Z=new Set;z.forEach(function($){Z.add(M1($)||"Component"),PB.add($.type)});var J=Zz(Z);try{m4(X),q(`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{_6()}})},d5.discardPendingWarnings=function(){cX=[],lX=[],iX=[],oX=[],aX=[],nX=[],tJ=new Map}}var bH,FH,MH,PH,AH,AB=function(z,Q){};bH=!1,FH=!1,MH={},PH={},AH={},AB=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=M1(Q)||"Component";if(PH[X])return;PH[X]=!0,q('Each child in a list should have a unique "key" prop. See https://reactjs.org/link/warning-keys for more information.')};function Yb(z){return z.prototype&&z.prototype.isReactComponent}function rX(z,Q,X){var Z=X.ref;if(Z!==null&&typeof Z!=="function"&&typeof Z!=="object"){if((z.mode&d4||d)&&!(X._owner&&X._self&&X._owner.stateNode!==X._self)&&!(X._owner&&X._owner.tag!==_)&&!(typeof X.type==="function"&&!Yb(X.type))&&X._owner){var J=M1(z)||"Component";if(!MH[J])q('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),MH[J]=!0}if(X._owner){var $=X._owner,H;if($){var B=$;if(B.tag!==_)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");H=B.stateNode}if(!H)throw Error("Missing owner for string ref "+Z+". This error is likely caused by a bug in React. Please file an issue.");var K=H;k4(Z,"ref");var N=""+Z;if(Q!==null&&Q.ref!==null&&typeof Q.ref==="function"&&Q.ref._stringRef===N)return Q.ref;var P=function(g){var u=K.refs;if(g===null)delete u[N];else u[N]=g};return P._stringRef=N,P}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 sJ(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 eJ(z){{var Q=M1(z)||"Component";if(AH[Q])return;AH[Q]=!0,q("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 IB(z){var{_payload:Q,_init:X}=z;return X(Q)}function kB(z){function Q(o,G0){if(!z)return;var a=o.deletions;if(a===null)o.deletions=[G0],o.flags|=g8;else a.push(G0)}function X(o,G0){if(!z)return null;var a=G0;while(a!==null)Q(o,a),a=a.sibling;return null}function Z(o,G0){var a=new Map,b0=G0;while(b0!==null){if(b0.key!==null)a.set(b0.key,b0);else a.set(b0.index,b0);b0=b0.sibling}return a}function J(o,G0){var a=Oz(o,G0);return a.index=0,a.sibling=null,a}function $(o,G0,a){if(o.index=a,!z)return o.flags|=C2,G0;var b0=o.alternate;if(b0!==null){var m0=b0.index;if(m0<G0)return o.flags|=e4,G0;else return m0}else return o.flags|=e4,G0}function H(o){if(z&&o.alternate===null)o.flags|=e4;return o}function B(o,G0,a,b0){if(G0===null||G0.tag!==b){var m0=F9(a,o.mode,b0);return m0.return=o,m0}else{var y0=J(G0,a);return y0.return=o,y0}}function K(o,G0,a,b0){var m0=a.type;if(m0===d1)return P(o,G0,a.props.children,b0,a.key);if(G0!==null){if(G0.elementType===m0||hK(G0,a)||typeof m0==="object"&&m0!==null&&m0.$$typeof===i0&&IB(m0)===G0.type){var y0=J(G0,a.props);return y0.ref=rX(o,G0,a),y0.return=o,y0._debugSource=a._source,y0._debugOwner=a._owner,y0}}var B1=b9(a,o.mode,b0);return B1.ref=rX(o,G0,a),B1.return=o,B1}function N(o,G0,a,b0){if(G0===null||G0.tag!==F||G0.stateNode.containerInfo!==a.containerInfo||G0.stateNode.implementation!==a.implementation){var m0=M9(a,o.mode,b0);return m0.return=o,m0}else{var y0=J(G0,a.children||[]);return y0.return=o,y0}}function P(o,G0,a,b0,m0){if(G0===null||G0.tag!==C){var y0=A8(a,o.mode,b0,m0);return y0.return=o,y0}else{var B1=J(G0,a);return B1.return=o,B1}}function g(o,G0,a){if(typeof G0==="string"&&G0!==""||typeof G0==="number"){var b0=F9(""+G0,o.mode,a);return b0.return=o,b0}if(typeof G0==="object"&&G0!==null){switch(G0.$$typeof){case s1:{var m0=b9(G0,o.mode,a);return m0.ref=rX(o,null,G0),m0.return=o,m0}case B4:{var y0=M9(G0,o.mode,a);return y0.return=o,y0}case i0:{var{_payload:B1,_init:w1}=G0;return g(o,w1(B1),a)}}if(i1(G0)||P4(G0)){var J4=A8(G0,o.mode,a,null);return J4.return=o,J4}sJ(o,G0)}if(typeof G0==="function")eJ(o);return null}function u(o,G0,a,b0){var m0=G0!==null?G0.key:null;if(typeof a==="string"&&a!==""||typeof a==="number"){if(m0!==null)return null;return B(o,G0,""+a,b0)}if(typeof a==="object"&&a!==null){switch(a.$$typeof){case s1:if(a.key===m0)return K(o,G0,a,b0);else return null;case B4:if(a.key===m0)return N(o,G0,a,b0);else return null;case i0:{var{_payload:y0,_init:B1}=a;return u(o,G0,B1(y0),b0)}}if(i1(a)||P4(a)){if(m0!==null)return null;return P(o,G0,a,b0,null)}sJ(o,a)}if(typeof a==="function")eJ(o);return null}function e(o,G0,a,b0,m0){if(typeof b0==="string"&&b0!==""||typeof b0==="number"){var y0=o.get(a)||null;return B(G0,y0,""+b0,m0)}if(typeof b0==="object"&&b0!==null){switch(b0.$$typeof){case s1:{var B1=o.get(b0.key===null?a:b0.key)||null;return K(G0,B1,b0,m0)}case B4:{var w1=o.get(b0.key===null?a:b0.key)||null;return N(G0,w1,b0,m0)}case i0:var{_payload:J4,_init:c1}=b0;return e(o,G0,a,c1(J4),m0)}if(i1(b0)||P4(b0)){var n4=o.get(a)||null;return P(G0,n4,b0,m0,null)}sJ(G0,b0)}if(typeof b0==="function")eJ(G0);return null}function z0(o,G0,a){{if(typeof o!=="object"||o===null)return G0;switch(o.$$typeof){case s1:case B4:AB(o,a);var b0=o.key;if(typeof b0!=="string")break;if(G0===null){G0=new Set,G0.add(b0);break}if(!G0.has(b0)){G0.add(b0);break}q("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.",b0);break;case i0:var{_payload:m0,_init:y0}=o;z0(y0(m0),G0,a);break}}return G0}function Y0(o,G0,a,b0){{var m0=null;for(var y0=0;y0<a.length;y0++){var B1=a[y0];m0=z0(B1,m0,o)}}var w1=null,J4=null,c1=G0,n4=0,l1=0,c4=null;for(;c1!==null&&l1<a.length;l1++){if(c1.index>l1)c4=c1,c1=null;else c4=c1.sibling;var p6=u(o,c1,a[l1],b0);if(p6===null){if(c1===null)c1=c4;break}if(z){if(c1&&p6.alternate===null)Q(o,c1)}if(n4=$(p6,n4,l1),J4===null)w1=p6;else J4.sibling=p6;J4=p6,c1=c4}if(l1===a.length){if(X(o,c1),I6()){var h6=l1;zz(o,h6)}return w1}if(c1===null){for(;l1<a.length;l1++){var N5=g(o,a[l1],b0);if(N5===null)continue;if(n4=$(N5,n4,l1),J4===null)w1=N5;else J4.sibling=N5;J4=N5}if(I6()){var s6=l1;zz(o,s6)}return w1}var e6=Z(o,c1);for(;l1<a.length;l1++){var d6=e(e6,o,l1,a[l1],b0);if(d6!==null){if(z){if(d6.alternate!==null)e6.delete(d6.key===null?l1:d6.key)}if(n4=$(d6,n4,l1),J4===null)w1=d6;else J4.sibling=d6;J4=d6}}if(z)e6.forEach(function(PQ){return Q(o,PQ)});if(I6()){var c7=l1;zz(o,c7)}return w1}function h0(o,G0,a,b0){var m0=P4(a);if(typeof m0!=="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"&&a[Symbol.toStringTag]==="Generator"){if(!FH)q("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.");FH=!0}if(a.entries===m0){if(!bH)q("Using Maps as children is not supported. Use an array of keyed ReactElements instead.");bH=!0}var y0=m0.call(a);if(y0){var B1=null,w1=y0.next();for(;!w1.done;w1=y0.next()){var J4=w1.value;B1=z0(J4,B1,o)}}}var c1=m0.call(a);if(c1==null)throw Error("An iterable object provided no iterator.");var n4=null,l1=null,c4=G0,p6=0,h6=0,N5=null,s6=c1.next();for(;c4!==null&&!s6.done;h6++,s6=c1.next()){if(c4.index>h6)N5=c4,c4=null;else N5=c4.sibling;var e6=u(o,c4,s6.value,b0);if(e6===null){if(c4===null)c4=N5;break}if(z){if(c4&&e6.alternate===null)Q(o,c4)}if(p6=$(e6,p6,h6),l1===null)n4=e6;else l1.sibling=e6;l1=e6,c4=N5}if(s6.done){if(X(o,c4),I6()){var d6=h6;zz(o,d6)}return n4}if(c4===null){for(;!s6.done;h6++,s6=c1.next()){var c7=g(o,s6.value,b0);if(c7===null)continue;if(p6=$(c7,p6,h6),l1===null)n4=c7;else l1.sibling=c7;l1=c7}if(I6()){var PQ=h6;zz(o,PQ)}return n4}var CZ=Z(o,c4);for(;!s6.done;h6++,s6=c1.next()){var R7=e(CZ,o,h6,s6.value,b0);if(R7!==null){if(z){if(R7.alternate!==null)CZ.delete(R7.key===null?h6:R7.key)}if(p6=$(R7,p6,h6),l1===null)n4=R7;else l1.sibling=R7;l1=R7}}if(z)CZ.forEach(function(DP){return Q(o,DP)});if(I6()){var VP=h6;zz(o,VP)}return n4}function e0(o,G0,a,b0){if(G0!==null&&G0.tag===b){X(o,G0.sibling);var m0=J(G0,a);return m0.return=o,m0}X(o,G0);var y0=F9(a,o.mode,b0);return y0.return=o,y0}function o0(o,G0,a,b0){var m0=a.key,y0=G0;while(y0!==null){if(y0.key===m0){var B1=a.type;if(B1===d1){if(y0.tag===C){X(o,y0.sibling);var w1=J(y0,a.props.children);return w1.return=o,w1._debugSource=a._source,w1._debugOwner=a._owner,w1}}else if(y0.elementType===B1||hK(y0,a)||typeof B1==="object"&&B1!==null&&B1.$$typeof===i0&&IB(B1)===y0.type){X(o,y0.sibling);var J4=J(y0,a.props);return J4.ref=rX(o,y0,a),J4.return=o,J4._debugSource=a._source,J4._debugOwner=a._owner,J4}X(o,y0);break}else Q(o,y0);y0=y0.sibling}if(a.type===d1){var c1=A8(a.props.children,o.mode,b0,a.key);return c1.return=o,c1}else{var n4=b9(a,o.mode,b0);return n4.ref=rX(o,G0,a),n4.return=o,n4}}function h1(o,G0,a,b0){var m0=a.key,y0=G0;while(y0!==null){if(y0.key===m0)if(y0.tag===F&&y0.stateNode.containerInfo===a.containerInfo&&y0.stateNode.implementation===a.implementation){X(o,y0.sibling);var B1=J(y0,a.children||[]);return B1.return=o,B1}else{X(o,y0);break}else Q(o,y0);y0=y0.sibling}var w1=M9(a,o.mode,b0);return w1.return=o,w1}function y1(o,G0,a,b0){var m0=typeof a==="object"&&a!==null&&a.type===d1&&a.key===null;if(m0)a=a.props.children;if(typeof a==="object"&&a!==null){switch(a.$$typeof){case s1:return H(o0(o,G0,a,b0));case B4:return H(h1(o,G0,a,b0));case i0:var{_payload:y0,_init:B1}=a;return y1(o,G0,B1(y0),b0)}if(i1(a))return Y0(o,G0,a,b0);if(P4(a))return h0(o,G0,a,b0);sJ(o,a)}if(typeof a==="string"&&a!==""||typeof a==="number")return H(e0(o,G0,""+a,b0));if(typeof a==="function")eJ(o);return X(o,G0)}return y1}var YQ=kB(!0),TB=kB(!1);function $b(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=Oz(X,X.pendingProps);Q.child=Z,Z.return=Q;while(X.sibling!==null)X=X.sibling,Z=Z.sibling=Oz(X,X.pendingProps),Z.return=Q;Z.sibling=null}function Hb(z,Q){var X=z.child;while(X!==null)sM(X,Q),X=X.sibling}var IH=B8(null),kH;kH={};var zY=null,$Q=null,TH=null,QY=!1;function XY(){zY=null,$Q=null,TH=null,QY=!1}function CB(){QY=!0}function vB(){QY=!1}function SB(z,Q,X){{x6(IH,Q._currentValue,z),Q._currentValue=X;{if(Q._currentRenderer!==void 0&&Q._currentRenderer!==null&&Q._currentRenderer!==kH)q("Detected multiple renderers concurrently rendering the same context provider. This is currently unsupported.");Q._currentRenderer=kH}}}function CH(z,Q){var X=IH.current;g6(IH,Q),z._currentValue=X}function vH(z,Q,X){var Z=z;while(Z!==null){var J=Z.alternate;if(!cz(Z.childLanes,Q)){if(Z.childLanes=A1(Z.childLanes,Q),J!==null)J.childLanes=A1(J.childLanes,Q)}else if(J!==null&&!cz(J.childLanes,Q))J.childLanes=A1(J.childLanes,Q);if(Z===X)break;Z=Z.return}if(Z!==X)q("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 Gb(z,Q,X){qb(z,Q,X)}function qb(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 H=$.firstContext;while(H!==null){if(H.context===Q){if(Z.tag===_){var B=WX(X),K=u7(A4,B);K.tag=JY;var N=Z.updateQueue;if(N===null);else{var P=N.shared,g=P.pending;if(g===null)K.next=K;else K.next=g.next,g.next=K;P.pending=K}}Z.lanes=A1(Z.lanes,X);var u=Z.alternate;if(u!==null)u.lanes=A1(u.lanes,X);vH(Z.return,X,z),$.lanes=A1($.lanes,X);break}H=H.next}}else if(Z.tag===V)J=Z.type===z.type?null:Z.child;else if(Z.tag===i){var e=Z.return;if(e===null)throw Error("We just came from a parent so we must have had a parent. This is a bug in React.");e.lanes=A1(e.lanes,X);var z0=e.alternate;if(z0!==null)z0.lanes=A1(z0.lanes,X);vH(e,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 Y0=J.sibling;if(Y0!==null){Y0.return=J.return,J=Y0;break}J=J.return}}Z=J}}function HQ(z,Q){zY=z,$Q=null,TH=null;var X=z.dependencies;if(X!==null){var Z=X.firstContext;if(Z!==null){if(K5(X.lanes,Q))UZ();X.firstContext=null}}}function z6(z){if(QY)q("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(TH===z);else{var X={context:z,memoizedValue:Q,next:null};if($Q===null){if(zY===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().");$Q=X,zY.dependencies={lanes:N0,firstContext:X}}else $Q=$Q.next=X}return Q}var Yz=null;function SH(z){if(Yz===null)Yz=[z];else Yz.push(z)}function Bb(){if(Yz!==null){for(var z=0;z<Yz.length;z++){var Q=Yz[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}}Yz=null}}function fB(z,Q,X,Z){var J=Q.interleaved;if(J===null)X.next=X,SH(Q);else X.next=J.next,J.next=X;return Q.interleaved=X,ZY(z,Z)}function Ub(z,Q,X,Z){var J=Q.interleaved;if(J===null)X.next=X,SH(Q);else X.next=J.next,J.next=X;Q.interleaved=X}function Kb(z,Q,X,Z){var J=Q.interleaved;if(J===null)X.next=X,SH(Q);else X.next=J.next,J.next=X;return Q.interleaved=X,ZY(z,Z)}function J5(z,Q){return ZY(z,Q)}var Ob=ZY;function ZY(z,Q){z.lanes=A1(z.lanes,Q);var X=z.alternate;if(X!==null)X.lanes=A1(X.lanes,Q);if(X===null&&(z.flags&(e4|T7))!==G1)CK(z);var Z=z,J=z.return;while(J!==null){if(J.childLanes=A1(J.childLanes,Q),X=J.alternate,X!==null)X.childLanes=A1(X.childLanes,Q);else if((J.flags&(e4|T7))!==G1)CK(z);Z=J,J=J.return}if(Z.tag===I){var $=Z.stateNode;return $}else return null}var hB=0,yB=1,JY=2,fH=3,YY=!1,hH,$Y;hH=!1,$Y=null;function yH(z){var Q={baseState:z.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:N0},effects:null};z.updateQueue=Q}function VB(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 u7(z,Q){var X={eventTime:z,lane:Q,tag:hB,payload:null,callback:null,next:null};return X}function W8(z,Q,X){var Z=z.updateQueue;if(Z===null)return null;var J=Z.shared;if($Y===J&&!hH)q("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."),hH=!0;if(LM()){var $=J.pending;if($===null)Q.next=Q;else Q.next=$.next,$.next=Q;return J.pending=Q,Ob(z,X)}else return Kb(z,J,Q,X)}function HY(z,Q,X){var Z=Q.updateQueue;if(Z===null)return;var J=Z.shared;if(i2(X)){var $=J.lanes;$=a2($,z.pendingLanes);var H=A1($,X);J.lanes=H,I$(z,H)}}function VH(z,Q){var{updateQueue:X,alternate:Z}=z;if(Z!==null){var J=Z.updateQueue;if(X===J){var $=null,H=null,B=X.firstBaseUpdate;if(B!==null){var K=B;do{var N={eventTime:K.eventTime,lane:K.lane,tag:K.tag,payload:K.payload,callback:K.callback,next:null};if(H===null)$=H=N;else H.next=N,H=N;K=K.next}while(K!==null);if(H===null)$=H=Q;else H.next=Q,H=Q}else $=H=Q;X={baseState:J.baseState,firstBaseUpdate:$,lastBaseUpdate:H,shared:J.shared,effects:J.effects},z.updateQueue=X;return}}var P=X.lastBaseUpdate;if(P===null)X.firstBaseUpdate=Q;else P.next=Q;X.lastBaseUpdate=Q}function Wb(z,Q,X,Z,J,$){switch(X.tag){case yB:{var H=X.payload;if(typeof H==="function"){CB();var B=H.call($,Z,J);{if(z.mode&d4){N6(!0);try{H.call($,Z,J)}finally{N6(!1)}}vB()}return B}return H}case fH:z.flags=z.flags&~a6|o1;case hB:{var K=X.payload,N;if(typeof K==="function"){CB(),N=K.call($,Z,J);{if(z.mode&d4){N6(!0);try{K.call($,Z,J)}finally{N6(!1)}}vB()}}else N=K;if(N===null||N===void 0)return Z;return T1({},Z,N)}case JY:return YY=!0,Z}return Z}function GY(z,Q,X,Z){var J=z.updateQueue;YY=!1,$Y=J.shared;var{firstBaseUpdate:$,lastBaseUpdate:H}=J,B=J.shared.pending;if(B!==null){J.shared.pending=null;var K=B,N=K.next;if(K.next=null,H===null)$=N;else H.next=N;H=K;var P=z.alternate;if(P!==null){var g=P.updateQueue,u=g.lastBaseUpdate;if(u!==H){if(u===null)g.firstBaseUpdate=N;else u.next=N;g.lastBaseUpdate=K}}}if($!==null){var e=J.baseState,z0=N0,Y0=null,h0=null,e0=null,o0=$;do{var{lane:h1,eventTime:y1}=o0;if(!cz(Z,h1)){var o={eventTime:y1,lane:h1,tag:o0.tag,payload:o0.payload,callback:o0.callback,next:null};if(e0===null)h0=e0=o,Y0=e;else e0=e0.next=o;z0=A1(z0,h1)}else{if(e0!==null){var G0={eventTime:y1,lane:w6,tag:o0.tag,payload:o0.payload,callback:o0.callback,next:null};e0=e0.next=G0}e=Wb(z,J,o0,e,Q,X);var a=o0.callback;if(a!==null&&o0.lane!==w6){z.flags|=i3;var b0=J.effects;if(b0===null)J.effects=[o0];else b0.push(o0)}}if(o0=o0.next,o0===null)if(B=J.shared.pending,B===null)break;else{var m0=B,y0=m0.next;m0.next=null,o0=y0,J.lastBaseUpdate=m0,J.shared.pending=null}}while(!0);if(e0===null)Y0=e;J.baseState=Y0,J.firstBaseUpdate=h0,J.lastBaseUpdate=e0;var B1=J.shared.interleaved;if(B1!==null){var w1=B1;do z0=A1(z0,w1.lane),w1=w1.next;while(w1!==B1)}else if($===null)J.shared.lanes=N0;PZ(z0),z.lanes=z0,z.memoizedState=e}$Y=null}function Lb(z,Q){if(typeof z!=="function")throw Error("Invalid argument passed as callback. Expected a function. Instead "+("received: "+z));z.call(Q)}function DB(){YY=!1}function qY(){return YY}function EB(z,Q,X){var Z=Q.effects;if(Q.effects=null,Z!==null)for(var J=0;J<Z.length;J++){var $=Z[J],H=$.callback;if(H!==null)$.callback=null,Lb(H,X)}}var tX={},L8=B8(tX),sX=B8(tX),BY=B8(tX);function UY(z){if(z===tX)throw Error("Expected host context to exist. This error is likely caused by a bug in React. Please file an issue.");return z}function mB(){var z=UY(BY.current);return z}function DH(z,Q){x6(BY,Q,z),x6(sX,z,z),x6(L8,tX,z);var X=hN(Q);g6(L8,z),x6(L8,X,z)}function GQ(z){g6(L8,z),g6(sX,z),g6(BY,z)}function EH(){var z=UY(L8.current);return z}function uB(z){var Q=UY(BY.current),X=UY(L8.current),Z=yN(X,z.type);if(X===Z)return;x6(sX,z,z),x6(L8,Z,z)}function mH(z){if(sX.current!==z)return;g6(L8,z),g6(sX,z)}var _b=0,gB=1,xB=1,eX=2,c5=B8(_b);function uH(z,Q){return(z&Q)!==0}function qQ(z){return z&gB}function gH(z,Q){return z&gB|Q}function Rb(z,Q){return z|Q}function _8(z,Q){x6(c5,Q,z)}function BQ(z){g6(c5,z)}function Nb(z,Q){var X=z.memoizedState;if(X!==null){if(X.dehydrated!==null)return!0;return!1}var Z=z.memoizedProps;return!0}function KY(z){var Q=z;while(Q!==null){if(Q.tag===D){var X=Q.memoizedState;if(X!==null){var Z=X.dehydrated;if(Z===null||XB(Z)||JH(Z))return Q}}else if(Q.tag===t&&Q.memoizedProps.revealOrder!==void 0){var J=(Q.flags&o1)!==G1;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 Y5=0,Z6=1,B7=2,J6=4,k6=8,xH=[];function jH(){for(var z=0;z<xH.length;z++){var Q=xH[z];Q._workInProgressVersionPrimary=null}xH.length=0}function wb(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:E0,ReactCurrentBatchConfig:zZ}=Y,pH,UQ;pH=new Set;var $z=N0,Z4=null,Y6=null,$6=null,OY=!1,QZ=!1,XZ=0,bb=0,Fb=25,K0=null,k5=null,R8=-1,dH=!1;function n1(){{var z=K0;if(k5===null)k5=[z];else k5.push(z)}}function f0(){{var z=K0;if(k5!==null){if(R8++,k5[R8]!==z)Mb(z)}}}function KQ(z){if(z!==void 0&&z!==null&&!i1(z))q("%s received a final argument that is not an array (instead, received `%s`). When specified, the final argument must be an array.",K0,typeof z)}function Mb(z){{var Q=M1(Z4);if(!pH.has(Q)){if(pH.add(Q),k5!==null){var X="",Z=30;for(var J=0;J<=R8;J++){var $=k5[J],H=J===R8?z:$,B=J+1+". "+$;while(B.length<Z)B+=" ";B+=H+`
72
+ `,X+=B}q(`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 j6(){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 cH(z,Q){if(dH)return!1;if(Q===null)return q("%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.",K0),!1;if(z.length!==Q.length)q(`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`,K0,"["+Q.join(", ")+"]","["+z.join(", ")+"]");for(var X=0;X<Q.length&&X<z.length;X++){if(L5(z[X],Q[X]))continue;return!1}return!0}function OQ(z,Q,X,Z,J,$){if($z=$,Z4=Q,k5=z!==null?z._debugHookTypes:null,R8=-1,dH=z!==null&&z.type!==Q.type,Q.memoizedState=null,Q.updateQueue=null,Q.lanes=N0,z!==null&&z.memoizedState!==null)E0.current=GU;else if(k5!==null)E0.current=HU;else E0.current=$U;var H=X(Z,J);if(QZ){var B=0;do{if(QZ=!1,XZ=0,B>=Fb)throw Error("Too many re-renders. React limits the number of renders to prevent an infinite loop.");B+=1,dH=!1,Y6=null,$6=null,Q.updateQueue=null,R8=-1,E0.current=qU,H=X(Z,J)}while(QZ)}E0.current=CY,Q._debugHookTypes=k5;var K=Y6!==null&&Y6.next!==null;if($z=N0,Z4=null,Y6=null,$6=null,K0=null,k5=null,R8=-1,z!==null&&(z.flags&v7)!==(Q.flags&v7)&&(z.mode&m1)!==Y1)q("Internal React error: Expected static flag was missing. Please notify the React team.");if(OY=!1,K)throw Error("Rendered fewer hooks than expected. This may be caused by an accidental early return statement.");return H}function WQ(){var z=XZ!==0;return XZ=0,z}function jB(z,Q,X){if(Q.updateQueue=z.updateQueue,(Q.mode&$7)!==Y1)Q.flags&=~($J|C7|u5|j1);else Q.flags&=~(u5|j1);z.lanes=OJ(z.lanes,X)}function pB(){if(E0.current=CY,OY){var z=Z4.memoizedState;while(z!==null){var Q=z.queue;if(Q!==null)Q.pending=null;z=z.next}OY=!1}$z=N0,Z4=null,Y6=null,$6=null,k5=null,R8=-1,K0=null,QU=!1,QZ=!1,XZ=0}function U7(){var z={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};if($6===null)Z4.memoizedState=$6=z;else $6=$6.next=z;return $6}function T5(){var z;if(Y6===null){var Q=Z4.alternate;if(Q!==null)z=Q.memoizedState;else z=null}else z=Y6.next;var X;if($6===null)X=Z4.memoizedState;else X=$6.next;if(X!==null)$6=X,X=$6.next,Y6=z;else{if(z===null)throw Error("Rendered more hooks than during the previous render.");Y6=z;var Z={memoizedState:Y6.memoizedState,baseState:Y6.baseState,baseQueue:Y6.baseQueue,queue:Y6.queue,next:null};if($6===null)Z4.memoizedState=$6=Z;else $6=$6.next=Z}return $6}function dB(){return{lastEffect:null,stores:null}}function lH(z,Q){return typeof Q==="function"?Q(z):Q}function iH(z,Q,X){var Z=U7(),J;if(X!==void 0)J=X(Q);else J=Q;Z.memoizedState=Z.baseState=J;var $={pending:null,interleaved:null,lanes:N0,dispatch:null,lastRenderedReducer:z,lastRenderedState:J};Z.queue=$;var H=$.dispatch=Ib.bind(null,Z4,$);return[Z.memoizedState,H]}function oH(z,Q,X){var Z=T5(),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 $=Y6,H=$.baseQueue,B=J.pending;if(B!==null){if(H!==null){var K=H.next,N=B.next;H.next=N,B.next=K}if($.baseQueue!==H)q("Internal error: Expected work-in-progress queue to be a clone. This is a bug in React.");$.baseQueue=H=B,J.pending=null}if(H!==null){var P=H.next,g=$.baseState,u=null,e=null,z0=null,Y0=P;do{var h0=Y0.lane;if(!cz($z,h0)){var e0={lane:h0,action:Y0.action,hasEagerState:Y0.hasEagerState,eagerState:Y0.eagerState,next:null};if(z0===null)e=z0=e0,u=g;else z0=z0.next=e0;Z4.lanes=A1(Z4.lanes,h0),PZ(h0)}else{if(z0!==null){var o0={lane:w6,action:Y0.action,hasEagerState:Y0.hasEagerState,eagerState:Y0.eagerState,next:null};z0=z0.next=o0}if(Y0.hasEagerState)g=Y0.eagerState;else{var h1=Y0.action;g=z(g,h1)}}Y0=Y0.next}while(Y0!==null&&Y0!==P);if(z0===null)u=g;else z0.next=e;if(!L5(g,Z.memoizedState))UZ();Z.memoizedState=g,Z.baseState=u,Z.baseQueue=z0,J.lastRenderedState=g}var y1=J.interleaved;if(y1!==null){var o=y1;do{var G0=o.lane;Z4.lanes=A1(Z4.lanes,G0),PZ(G0),o=o.next}while(o!==y1)}else if(H===null)J.lanes=N0;var a=J.dispatch;return[Z.memoizedState,a]}function aH(z,Q,X){var Z=T5(),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:H}=J,B=Z.memoizedState;if(H!==null){J.pending=null;var K=H.next,N=K;do{var P=N.action;B=z(B,P),N=N.next}while(N!==K);if(!L5(B,Z.memoizedState))UZ();if(Z.memoizedState=B,Z.baseQueue===null)Z.baseState=B;J.lastRenderedState=B}return[B,$]}function nH(z,Q,X){return}function WY(z,Q,X){return}function rH(z,Q,X){var Z=Z4,J=U7(),$,H=I6();if(H){if(X===void 0)throw Error("Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering.");if($=X(),!UQ){if($!==X())q("The result of getServerSnapshot should be cached to avoid an infinite loop"),UQ=!0}}else{if($=Q(),!UQ){var B=Q();if(!L5($,B))q("The result of getSnapshot should be cached to avoid an infinite loop"),UQ=!0}var K=oY();if(K===null)throw Error("Expected a work-in-progress root. This is a bug in React. Please file an issue.");if(!KJ(K,$z))cB(Z,Q,$)}J.memoizedState=$;var N={value:$,getSnapshot:Q};return J.queue=N,wY(iB.bind(null,Z,N,z),[z]),Z.flags|=u5,ZZ(Z6|k6,lB.bind(null,Z,N,$,Q),void 0,null),$}function LY(z,Q,X){var Z=Z4,J=T5(),$=Q();if(!UQ){var H=Q();if(!L5($,H))q("The result of getSnapshot should be cached to avoid an infinite loop"),UQ=!0}var B=J.memoizedState,K=!L5(B,$);if(K)J.memoizedState=$,UZ();var N=J.queue;if(YZ(iB.bind(null,Z,N,z),[z]),N.getSnapshot!==Q||K||$6!==null&&$6.memoizedState.tag&Z6){Z.flags|=u5,ZZ(Z6|k6,lB.bind(null,Z,N,$,Q),void 0,null);var P=oY();if(P===null)throw Error("Expected a work-in-progress root. This is a bug in React. Please file an issue.");if(!KJ(P,$z))cB(Z,Q,$)}return $}function cB(z,Q,X){z.flags|=YJ;var Z={getSnapshot:Q,value:X},J=Z4.updateQueue;if(J===null)J=dB(),Z4.updateQueue=J,J.stores=[Z];else{var $=J.stores;if($===null)J.stores=[Z];else $.push(Z)}}function lB(z,Q,X,Z){if(Q.value=X,Q.getSnapshot=Z,oB(Q))aB(z)}function iB(z,Q,X){var Z=function(){if(oB(Q))aB(z)};return X(Z)}function oB(z){var{getSnapshot:Q,value:X}=z;try{var Z=Q();return!L5(X,Z)}catch(J){return!0}}function aB(z){var Q=J5(z,L1);if(Q!==null)B6(Q,z,L1,A4)}function _Y(z){var Q=U7();if(typeof z==="function")z=z();Q.memoizedState=Q.baseState=z;var X={pending:null,interleaved:null,lanes:N0,dispatch:null,lastRenderedReducer:lH,lastRenderedState:z};Q.queue=X;var Z=X.dispatch=kb.bind(null,Z4,X);return[Q.memoizedState,Z]}function tH(z){return oH(lH)}function sH(z){return aH(lH)}function ZZ(z,Q,X,Z){var J={tag:z,create:Q,destroy:X,deps:Z,next:null},$=Z4.updateQueue;if($===null)$=dB(),Z4.updateQueue=$,$.lastEffect=J.next=J;else{var H=$.lastEffect;if(H===null)$.lastEffect=J.next=J;else{var B=H.next;H.next=J,J.next=B,$.lastEffect=J}}return J}function eH(z){var Q=U7();{var X={current:z};return Q.memoizedState=X,X}}function RY(z){var Q=T5();return Q.memoizedState}function JZ(z,Q,X,Z){var J=U7(),$=Z===void 0?null:Z;Z4.flags|=z,J.memoizedState=ZZ(Z6|Q,X,void 0,$)}function NY(z,Q,X,Z){var J=T5(),$=Z===void 0?null:Z,H=void 0;if(Y6!==null){var B=Y6.memoizedState;if(H=B.destroy,$!==null){var K=B.deps;if(cH($,K)){J.memoizedState=ZZ(Q,X,H,$);return}}}Z4.flags|=z,J.memoizedState=ZZ(Z6|Q,X,H,$)}function wY(z,Q){if((Z4.mode&$7)!==Y1)return JZ($J|u5|n3,k6,z,Q);else return JZ(u5|n3,k6,z,Q)}function YZ(z,Q){return NY(u5,k6,z,Q)}function zG(z,Q){return JZ(j1,B7,z,Q)}function bY(z,Q){return NY(j1,B7,z,Q)}function QG(z,Q){var X=j1;if(X|=p8,(Z4.mode&$7)!==Y1)X|=C7;return JZ(X,J6,z,Q)}function FY(z,Q){return NY(j1,J6,z,Q)}function nB(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"))q("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 XG(z,Q,X){if(typeof Q!=="function")q("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=j1;if(J|=p8,(Z4.mode&$7)!==Y1)J|=C7;return JZ(J,J6,nB.bind(null,Q,z),Z)}function MY(z,Q,X){if(typeof Q!=="function")q("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 NY(j1,J6,nB.bind(null,Q,z),Z)}function PY(z,Q){}var AY=PY;function ZG(z,Q){var X=U7(),Z=Q===void 0?null:Q;return X.memoizedState=[z,Z],z}function IY(z,Q){var X=T5(),Z=Q===void 0?null:Q,J=X.memoizedState;if(J!==null){if(Z!==null){var $=J[1];if(cH(Z,$))return J[0]}}return X.memoizedState=[z,Z],z}function JG(z,Q){var X=U7(),Z=Q===void 0?null:Q,J=z();return X.memoizedState=[J,Z],J}function kY(z,Q){var X=T5(),Z=Q===void 0?null:Q,J=X.memoizedState;if(J!==null){if(Z!==null){var $=J[1];if(cH(Z,$))return J[0]}}var H=z();return X.memoizedState=[H,Z],H}function YG(z){var Q=U7();return Q.memoizedState=z,z}function rB(z){var Q=T5(),X=Y6,Z=X.memoizedState;return sB(Q,Z,z)}function tB(z){var Q=T5();if(Y6===null)return Q.memoizedState=z,z;else{var X=Y6.memoizedState;return sB(Q,X,z)}}function sB(z,Q,X){var Z=!G_($z);if(Z){if(!L5(X,Q)){var J=o2();Z4.lanes=A1(Z4.lanes,J),PZ(J),z.baseState=!0}return Q}else{if(z.baseState)z.baseState=!1,UZ();return z.memoizedState=X,X}}function Pb(z,Q,X){var Z=x5();b6(R_(Z,f7)),z(!0);var J=zZ.transition;zZ.transition={};var $=zZ.transition;zZ.transition._updatedFibers=new Set;try{z(!1),Q()}finally{if(b6(Z),zZ.transition=J,J===null&&$._updatedFibers){var H=$._updatedFibers.size;if(H>10)W("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 $G(){var z=_Y(!1),Q=z[0],X=z[1],Z=Pb.bind(null,X),J=U7();return J.memoizedState=Z,[Q,Z]}function eB(){var z=tH(),Q=z[0],X=T5(),Z=X.memoizedState;return[Q,Z]}function zU(){var z=sH(),Q=z[0],X=T5(),Z=X.memoizedState;return[Q,Z]}var QU=!1;function Ab(){return QU}function HG(){var z=U7(),Q=oY(),X=Q.identifierPrefix,Z;if(I6()){var J=pw();Z=":"+X+"R"+J;var $=XZ++;if($>0)Z+="H"+$.toString(32);Z+=":"}else{var H=bb++;Z=":"+X+"r"+H.toString(32)+":"}return z.memoizedState=Z,Z}function TY(){var z=T5(),Q=z.memoizedState;return Q}function Ib(z,Q,X){if(typeof arguments[3]==="function")q("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=M8(z),J={lane:Z,action:X,hasEagerState:!1,eagerState:null,next:null};if(XU(z))ZU(Q,J);else{var $=fB(z,Q,J,Z);if($!==null){var H=t6();B6($,z,Z,H),JU($,Q,Z)}}YU(z,Z)}function kb(z,Q,X){if(typeof arguments[3]==="function")q("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=M8(z),J={lane:Z,action:X,hasEagerState:!1,eagerState:null,next:null};if(XU(z))ZU(Q,J);else{var $=z.alternate;if(z.lanes===N0&&($===null||$.lanes===N0)){var H=Q.lastRenderedReducer;if(H!==null){var B;B=E0.current,E0.current=l5;try{var K=Q.lastRenderedState,N=H(K,X);if(J.hasEagerState=!0,J.eagerState=N,L5(N,K)){Ub(z,Q,J,Z);return}}catch(u){}finally{E0.current=B}}}var P=fB(z,Q,J,Z);if(P!==null){var g=t6();B6(P,z,Z,g),JU(P,Q,Z)}}YU(z,Z)}function XU(z){var Q=z.alternate;return z===Z4||Q!==null&&Q===Z4}function ZU(z,Q){QZ=OY=!0;var X=z.pending;if(X===null)Q.next=Q;else Q.next=X.next,X.next=Q;z.pending=Q}function JU(z,Q,X){if(i2(X)){var Z=Q.lanes;Z=a2(Z,z.pendingLanes);var J=A1(Z,X);Q.lanes=J,I$(z,J)}}function YU(z,Q,X){z$(z,Q)}var CY={readContext:z6,useCallback:j6,useContext:j6,useEffect:j6,useImperativeHandle:j6,useInsertionEffect:j6,useLayoutEffect:j6,useMemo:j6,useReducer:j6,useRef:j6,useState:j6,useDebugValue:j6,useDeferredValue:j6,useTransition:j6,useMutableSource:j6,useSyncExternalStore:j6,useId:j6,unstable_isNewReconciler:Q1},$U=null,HU=null,GU=null,qU=null,K7=null,l5=null,vY=null;{var GG=function(){q("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().")},_1=function(){q("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")};$U={readContext:function(z){return z6(z)},useCallback:function(z,Q){return K0="useCallback",n1(),KQ(Q),ZG(z,Q)},useContext:function(z){return K0="useContext",n1(),z6(z)},useEffect:function(z,Q){return K0="useEffect",n1(),KQ(Q),wY(z,Q)},useImperativeHandle:function(z,Q,X){return K0="useImperativeHandle",n1(),KQ(X),XG(z,Q,X)},useInsertionEffect:function(z,Q){return K0="useInsertionEffect",n1(),KQ(Q),zG(z,Q)},useLayoutEffect:function(z,Q){return K0="useLayoutEffect",n1(),KQ(Q),QG(z,Q)},useMemo:function(z,Q){K0="useMemo",n1(),KQ(Q);var X=E0.current;E0.current=K7;try{return JG(z,Q)}finally{E0.current=X}},useReducer:function(z,Q,X){K0="useReducer",n1();var Z=E0.current;E0.current=K7;try{return iH(z,Q,X)}finally{E0.current=Z}},useRef:function(z){return K0="useRef",n1(),eH(z)},useState:function(z){K0="useState",n1();var Q=E0.current;E0.current=K7;try{return _Y(z)}finally{E0.current=Q}},useDebugValue:function(z,Q){return K0="useDebugValue",n1(),PY()},useDeferredValue:function(z){return K0="useDeferredValue",n1(),YG(z)},useTransition:function(){return K0="useTransition",n1(),$G()},useMutableSource:function(z,Q,X){return K0="useMutableSource",n1(),nH()},useSyncExternalStore:function(z,Q,X){return K0="useSyncExternalStore",n1(),rH(z,Q,X)},useId:function(){return K0="useId",n1(),HG()},unstable_isNewReconciler:Q1},HU={readContext:function(z){return z6(z)},useCallback:function(z,Q){return K0="useCallback",f0(),ZG(z,Q)},useContext:function(z){return K0="useContext",f0(),z6(z)},useEffect:function(z,Q){return K0="useEffect",f0(),wY(z,Q)},useImperativeHandle:function(z,Q,X){return K0="useImperativeHandle",f0(),XG(z,Q,X)},useInsertionEffect:function(z,Q){return K0="useInsertionEffect",f0(),zG(z,Q)},useLayoutEffect:function(z,Q){return K0="useLayoutEffect",f0(),QG(z,Q)},useMemo:function(z,Q){K0="useMemo",f0();var X=E0.current;E0.current=K7;try{return JG(z,Q)}finally{E0.current=X}},useReducer:function(z,Q,X){K0="useReducer",f0();var Z=E0.current;E0.current=K7;try{return iH(z,Q,X)}finally{E0.current=Z}},useRef:function(z){return K0="useRef",f0(),eH(z)},useState:function(z){K0="useState",f0();var Q=E0.current;E0.current=K7;try{return _Y(z)}finally{E0.current=Q}},useDebugValue:function(z,Q){return K0="useDebugValue",f0(),PY()},useDeferredValue:function(z){return K0="useDeferredValue",f0(),YG(z)},useTransition:function(){return K0="useTransition",f0(),$G()},useMutableSource:function(z,Q,X){return K0="useMutableSource",f0(),nH()},useSyncExternalStore:function(z,Q,X){return K0="useSyncExternalStore",f0(),rH(z,Q,X)},useId:function(){return K0="useId",f0(),HG()},unstable_isNewReconciler:Q1},GU={readContext:function(z){return z6(z)},useCallback:function(z,Q){return K0="useCallback",f0(),IY(z,Q)},useContext:function(z){return K0="useContext",f0(),z6(z)},useEffect:function(z,Q){return K0="useEffect",f0(),YZ(z,Q)},useImperativeHandle:function(z,Q,X){return K0="useImperativeHandle",f0(),MY(z,Q,X)},useInsertionEffect:function(z,Q){return K0="useInsertionEffect",f0(),bY(z,Q)},useLayoutEffect:function(z,Q){return K0="useLayoutEffect",f0(),FY(z,Q)},useMemo:function(z,Q){K0="useMemo",f0();var X=E0.current;E0.current=l5;try{return kY(z,Q)}finally{E0.current=X}},useReducer:function(z,Q,X){K0="useReducer",f0();var Z=E0.current;E0.current=l5;try{return oH(z,Q,X)}finally{E0.current=Z}},useRef:function(z){return K0="useRef",f0(),RY()},useState:function(z){K0="useState",f0();var Q=E0.current;E0.current=l5;try{return tH(z)}finally{E0.current=Q}},useDebugValue:function(z,Q){return K0="useDebugValue",f0(),AY()},useDeferredValue:function(z){return K0="useDeferredValue",f0(),rB(z)},useTransition:function(){return K0="useTransition",f0(),eB()},useMutableSource:function(z,Q,X){return K0="useMutableSource",f0(),WY()},useSyncExternalStore:function(z,Q,X){return K0="useSyncExternalStore",f0(),LY(z,Q)},useId:function(){return K0="useId",f0(),TY()},unstable_isNewReconciler:Q1},qU={readContext:function(z){return z6(z)},useCallback:function(z,Q){return K0="useCallback",f0(),IY(z,Q)},useContext:function(z){return K0="useContext",f0(),z6(z)},useEffect:function(z,Q){return K0="useEffect",f0(),YZ(z,Q)},useImperativeHandle:function(z,Q,X){return K0="useImperativeHandle",f0(),MY(z,Q,X)},useInsertionEffect:function(z,Q){return K0="useInsertionEffect",f0(),bY(z,Q)},useLayoutEffect:function(z,Q){return K0="useLayoutEffect",f0(),FY(z,Q)},useMemo:function(z,Q){K0="useMemo",f0();var X=E0.current;E0.current=vY;try{return kY(z,Q)}finally{E0.current=X}},useReducer:function(z,Q,X){K0="useReducer",f0();var Z=E0.current;E0.current=vY;try{return aH(z,Q,X)}finally{E0.current=Z}},useRef:function(z){return K0="useRef",f0(),RY()},useState:function(z){K0="useState",f0();var Q=E0.current;E0.current=vY;try{return sH(z)}finally{E0.current=Q}},useDebugValue:function(z,Q){return K0="useDebugValue",f0(),AY()},useDeferredValue:function(z){return K0="useDeferredValue",f0(),tB(z)},useTransition:function(){return K0="useTransition",f0(),zU()},useMutableSource:function(z,Q,X){return K0="useMutableSource",f0(),WY()},useSyncExternalStore:function(z,Q,X){return K0="useSyncExternalStore",f0(),LY(z,Q)},useId:function(){return K0="useId",f0(),TY()},unstable_isNewReconciler:Q1},K7={readContext:function(z){return GG(),z6(z)},useCallback:function(z,Q){return K0="useCallback",_1(),n1(),ZG(z,Q)},useContext:function(z){return K0="useContext",_1(),n1(),z6(z)},useEffect:function(z,Q){return K0="useEffect",_1(),n1(),wY(z,Q)},useImperativeHandle:function(z,Q,X){return K0="useImperativeHandle",_1(),n1(),XG(z,Q,X)},useInsertionEffect:function(z,Q){return K0="useInsertionEffect",_1(),n1(),zG(z,Q)},useLayoutEffect:function(z,Q){return K0="useLayoutEffect",_1(),n1(),QG(z,Q)},useMemo:function(z,Q){K0="useMemo",_1(),n1();var X=E0.current;E0.current=K7;try{return JG(z,Q)}finally{E0.current=X}},useReducer:function(z,Q,X){K0="useReducer",_1(),n1();var Z=E0.current;E0.current=K7;try{return iH(z,Q,X)}finally{E0.current=Z}},useRef:function(z){return K0="useRef",_1(),n1(),eH(z)},useState:function(z){K0="useState",_1(),n1();var Q=E0.current;E0.current=K7;try{return _Y(z)}finally{E0.current=Q}},useDebugValue:function(z,Q){return K0="useDebugValue",_1(),n1(),PY()},useDeferredValue:function(z){return K0="useDeferredValue",_1(),n1(),YG(z)},useTransition:function(){return K0="useTransition",_1(),n1(),$G()},useMutableSource:function(z,Q,X){return K0="useMutableSource",_1(),n1(),nH()},useSyncExternalStore:function(z,Q,X){return K0="useSyncExternalStore",_1(),n1(),rH(z,Q,X)},useId:function(){return K0="useId",_1(),n1(),HG()},unstable_isNewReconciler:Q1},l5={readContext:function(z){return GG(),z6(z)},useCallback:function(z,Q){return K0="useCallback",_1(),f0(),IY(z,Q)},useContext:function(z){return K0="useContext",_1(),f0(),z6(z)},useEffect:function(z,Q){return K0="useEffect",_1(),f0(),YZ(z,Q)},useImperativeHandle:function(z,Q,X){return K0="useImperativeHandle",_1(),f0(),MY(z,Q,X)},useInsertionEffect:function(z,Q){return K0="useInsertionEffect",_1(),f0(),bY(z,Q)},useLayoutEffect:function(z,Q){return K0="useLayoutEffect",_1(),f0(),FY(z,Q)},useMemo:function(z,Q){K0="useMemo",_1(),f0();var X=E0.current;E0.current=l5;try{return kY(z,Q)}finally{E0.current=X}},useReducer:function(z,Q,X){K0="useReducer",_1(),f0();var Z=E0.current;E0.current=l5;try{return oH(z,Q,X)}finally{E0.current=Z}},useRef:function(z){return K0="useRef",_1(),f0(),RY()},useState:function(z){K0="useState",_1(),f0();var Q=E0.current;E0.current=l5;try{return tH(z)}finally{E0.current=Q}},useDebugValue:function(z,Q){return K0="useDebugValue",_1(),f0(),AY()},useDeferredValue:function(z){return K0="useDeferredValue",_1(),f0(),rB(z)},useTransition:function(){return K0="useTransition",_1(),f0(),eB()},useMutableSource:function(z,Q,X){return K0="useMutableSource",_1(),f0(),WY()},useSyncExternalStore:function(z,Q,X){return K0="useSyncExternalStore",_1(),f0(),LY(z,Q)},useId:function(){return K0="useId",_1(),f0(),TY()},unstable_isNewReconciler:Q1},vY={readContext:function(z){return GG(),z6(z)},useCallback:function(z,Q){return K0="useCallback",_1(),f0(),IY(z,Q)},useContext:function(z){return K0="useContext",_1(),f0(),z6(z)},useEffect:function(z,Q){return K0="useEffect",_1(),f0(),YZ(z,Q)},useImperativeHandle:function(z,Q,X){return K0="useImperativeHandle",_1(),f0(),MY(z,Q,X)},useInsertionEffect:function(z,Q){return K0="useInsertionEffect",_1(),f0(),bY(z,Q)},useLayoutEffect:function(z,Q){return K0="useLayoutEffect",_1(),f0(),FY(z,Q)},useMemo:function(z,Q){K0="useMemo",_1(),f0();var X=E0.current;E0.current=l5;try{return kY(z,Q)}finally{E0.current=X}},useReducer:function(z,Q,X){K0="useReducer",_1(),f0();var Z=E0.current;E0.current=l5;try{return aH(z,Q,X)}finally{E0.current=Z}},useRef:function(z){return K0="useRef",_1(),f0(),RY()},useState:function(z){K0="useState",_1(),f0();var Q=E0.current;E0.current=l5;try{return sH(z)}finally{E0.current=Q}},useDebugValue:function(z,Q){return K0="useDebugValue",_1(),f0(),AY()},useDeferredValue:function(z){return K0="useDeferredValue",_1(),f0(),tB(z)},useTransition:function(){return K0="useTransition",_1(),f0(),zU()},useMutableSource:function(z,Q,X){return K0="useMutableSource",_1(),f0(),WY()},useSyncExternalStore:function(z,Q,X){return K0="useSyncExternalStore",_1(),f0(),LY(z,Q)},useId:function(){return K0="useId",_1(),f0(),TY()},unstable_isNewReconciler:Q1}}var N8=Y4.unstable_now,BU=0,SY=-1,$Z=-1,fY=-1,qG=!1,hY=!1;function UU(){return qG}function Tb(){hY=!0}function Cb(){qG=!1,hY=!1}function vb(){qG=hY,hY=!1}function KU(){return BU}function OU(){BU=N8()}function BG(z){if($Z=N8(),z.actualStartTime<0)z.actualStartTime=N8()}function WU(z){$Z=-1}function yY(z,Q){if($Z>=0){var X=N8()-$Z;if(z.actualDuration+=X,Q)z.selfBaseDuration=X;$Z=-1}}function O7(z){if(SY>=0){var Q=N8()-SY;SY=-1;var X=z.return;while(X!==null){switch(X.tag){case I:var Z=X.stateNode;Z.effectDuration+=Q;return;case T:var J=X.stateNode;J.effectDuration+=Q;return}X=X.return}}}function UG(z){if(fY>=0){var Q=N8()-fY;fY=-1;var X=z.return;while(X!==null){switch(X.tag){case I:var Z=X.stateNode;if(Z!==null)Z.passiveEffectDuration+=Q;return;case T:var J=X.stateNode;if(J!==null)J.passiveEffectDuration+=Q;return}X=X.return}}}function W7(){SY=N8()}function KG(){fY=N8()}function OG(z){var Q=z.child;while(Q)z.actualDuration+=Q.actualDuration,Q=Q.sibling}function i5(z,Q){if(z&&z.defaultProps){var X=T1({},Q),Z=z.defaultProps;for(var J in Z)if(X[J]===void 0)X[J]=Z[J];return X}return Q}var WG={},LG,_G,RG,NG,wG,LU,VY,bG,FG,MG,HZ;{LG=new Set,_G=new Set,RG=new Set,NG=new Set,bG=new Set,wG=new Set,FG=new Set,MG=new Set,HZ=new Set;var _U=new Set;VY=function(z,Q){if(z===null||typeof z==="function")return;var X=Q+"_"+z;if(!_U.has(X))_U.add(X),q("%s(...): Expected the last optional `callback` argument to be a function. Instead received: %s.",Q,z)},LU=function(z,Q){if(Q===void 0){var X=p1(z)||"Component";if(!wG.has(X))wG.add(X),q("%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. You have returned undefined.",X)}},Object.defineProperty(WG,"_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(WG)}function PG(z,Q,X,Z){var J=z.memoizedState,$=X(Z,J);{if(z.mode&d4){N6(!0);try{$=X(Z,J)}finally{N6(!1)}}LU(Q,$)}var H=$===null||$===void 0?J:T1({},J,$);if(z.memoizedState=H,z.lanes===N0){var B=z.updateQueue;B.baseState=H}}var AG={isMounted:FL,enqueueSetState:function(z,Q,X){var Z=mz(z),J=t6(),$=M8(Z),H=u7(J,$);if(H.payload=Q,X!==void 0&&X!==null)VY(X,"setState"),H.callback=X;var B=W8(Z,H,$);if(B!==null)B6(B,Z,$,J),HY(B,Z,$);z$(Z,$)},enqueueReplaceState:function(z,Q,X){var Z=mz(z),J=t6(),$=M8(Z),H=u7(J,$);if(H.tag=yB,H.payload=Q,X!==void 0&&X!==null)VY(X,"replaceState"),H.callback=X;var B=W8(Z,H,$);if(B!==null)B6(B,Z,$,J),HY(B,Z,$);z$(Z,$)},enqueueForceUpdate:function(z,Q){var X=mz(z),Z=t6(),J=M8(X),$=u7(Z,J);if($.tag=JY,Q!==void 0&&Q!==null)VY(Q,"forceUpdate"),$.callback=Q;var H=W8(X,$,J);if(H!==null)B6(H,X,J,Z),HY(H,X,J);sL(X,J)}};function RU(z,Q,X,Z,J,$,H){var B=z.stateNode;if(typeof B.shouldComponentUpdate==="function"){var K=B.shouldComponentUpdate(Z,$,H);{if(z.mode&d4){N6(!0);try{K=B.shouldComponentUpdate(Z,$,H)}finally{N6(!1)}}if(K===void 0)q("%s.shouldComponentUpdate(): Returned undefined instead of a boolean value. Make sure to return true or false.",p1(Q)||"Component")}return K}if(Q.prototype&&Q.prototype.isPureReactComponent)return!vX(X,Z)||!vX(J,$);return!0}function Sb(z,Q,X){var Z=z.stateNode;{var J=p1(Q)||"Component",$=Z.render;if(!$)if(Q.prototype&&typeof Q.prototype.render==="function")q("%s(...): No `render` method found on the returned component instance: did you accidentally return an object from the constructor?",J);else q("%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)q("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)q("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)q("propTypes was defined as an instance property on %s. Use a static property to define propTypes instead.",J);if(Z.contextType)q("contextType was defined as an instance property on %s. Use a static property to define contextType instead.",J);{if(Q.childContextTypes&&!HZ.has(Q)&&(z.mode&d4)===Y1)HZ.add(Q),q(`%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&&!HZ.has(Q)&&(z.mode&d4)===Y1)HZ.add(Q),q(`%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)q("contextTypes was defined as an instance property on %s. Use a static property to define contextTypes instead.",J);if(Q.contextType&&Q.contextTypes&&!FG.has(Q))FG.add(Q),q("%s declares both contextTypes and contextType static properties. The legacy contextTypes property will be ignored.",J)}if(typeof Z.componentShouldUpdate==="function")q("%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")q("%s has a method called shouldComponentUpdate(). shouldComponentUpdate should not be used when extending React.PureComponent. Please extend React.Component if shouldComponentUpdate is used.",p1(Q)||"A pure component");if(typeof Z.componentDidUnmount==="function")q("%s has a method called componentDidUnmount(). But there is no such lifecycle method. Did you mean componentWillUnmount()?",J);if(typeof Z.componentDidReceiveProps==="function")q("%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")q("%s has a method called componentWillRecieveProps(). Did you mean componentWillReceiveProps()?",J);if(typeof Z.UNSAFE_componentWillRecieveProps==="function")q("%s has a method called UNSAFE_componentWillRecieveProps(). Did you mean UNSAFE_componentWillReceiveProps()?",J);var H=Z.props!==X;if(Z.props!==void 0&&H)q("%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)q("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"&&!RG.has(Q))RG.add(Q),q("%s: getSnapshotBeforeUpdate() should be used with componentDidUpdate(). This component defines getSnapshotBeforeUpdate() only.",p1(Q));if(typeof Z.getDerivedStateFromProps==="function")q("%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")q("%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")q("%s: getSnapshotBeforeUpdate() is defined as a static method and will be ignored. Instead, declare it as an instance method.",J);var B=Z.state;if(B&&(typeof B!=="object"||i1(B)))q("%s.state: must be set to an object or null",J);if(typeof Z.getChildContext==="function"&&typeof Q.childContextTypes!=="object")q("%s.getChildContext(): childContextTypes must be defined in order to use getChildContext().",J)}}function NU(z,Q){Q.updater=AG,z.stateNode=Q,_L(Q,z),Q._reactInternalInstance=WG}function wU(z,Q,X){var Z=!1,J=_5,$=_5,H=Q.contextType;if("contextType"in Q){var B=H===null||H!==void 0&&H.$$typeof===A&&H._context===void 0;if(!B&&!MG.has(Q)){MG.add(Q);var K="";if(H===void 0)K=" 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 H!=="object")K=" However, it is set to a "+typeof H+".";else if(H.$$typeof===R0)K=" Did you accidentally pass the Context.Provider instead?";else if(H._context!==void 0)K=" Did you accidentally pass the Context.Consumer instead?";else K=" However, it is set to an object with keys {"+Object.keys(H).join(", ")+"}.";q("%s defines an invalid contextType. contextType should point to the Context object returned by React.createContext().%s",p1(Q)||"Component",K)}}if(typeof H==="object"&&H!==null)$=z6(H);else{J=zQ(z,Q,!0);var N=Q.contextTypes;Z=N!==null&&N!==void 0,$=Z?QQ(z,J):_5}var P=new Q(X,$);if(z.mode&d4){N6(!0);try{P=new Q(X,$)}finally{N6(!1)}}var g=z.memoizedState=P.state!==null&&P.state!==void 0?P.state:null;NU(z,P);{if(typeof Q.getDerivedStateFromProps==="function"&&g===null){var u=p1(Q)||"Component";if(!_G.has(u))_G.add(u),q("`%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.",u,P.state===null?"null":"undefined",u)}if(typeof Q.getDerivedStateFromProps==="function"||typeof P.getSnapshotBeforeUpdate==="function"){var e=null,z0=null,Y0=null;if(typeof P.componentWillMount==="function"&&P.componentWillMount.__suppressDeprecationWarning!==!0)e="componentWillMount";else if(typeof P.UNSAFE_componentWillMount==="function")e="UNSAFE_componentWillMount";if(typeof P.componentWillReceiveProps==="function"&&P.componentWillReceiveProps.__suppressDeprecationWarning!==!0)z0="componentWillReceiveProps";else if(typeof P.UNSAFE_componentWillReceiveProps==="function")z0="UNSAFE_componentWillReceiveProps";if(typeof P.componentWillUpdate==="function"&&P.componentWillUpdate.__suppressDeprecationWarning!==!0)Y0="componentWillUpdate";else if(typeof P.UNSAFE_componentWillUpdate==="function")Y0="UNSAFE_componentWillUpdate";if(e!==null||z0!==null||Y0!==null){var h0=p1(Q)||"Component",e0=typeof Q.getDerivedStateFromProps==="function"?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()";if(!NG.has(h0))NG.add(h0),q(`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`,h0,e0,e!==null?`
94
+ `+e:"",z0!==null?`
95
+ `+z0:"",Y0!==null?`
96
+ `+Y0:"")}}}if(Z)GB(z,J,$);return P}function fb(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)q("%s.componentWillMount(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.",M1(z)||"Component"),AG.enqueueReplaceState(Q,Q.state,null)}function bU(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 $=M1(z)||"Component";if(!LG.has($))LG.add($),q("%s.componentWillReceiveProps(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.",$)}AG.enqueueReplaceState(Q,Q.state,null)}}function IG(z,Q,X,Z){Sb(z,Q,X);var J=z.stateNode;J.props=X,J.state=z.memoizedState,J.refs={},yH(z);var $=Q.contextType;if(typeof $==="object"&&$!==null)J.context=z6($);else{var H=zQ(z,Q,!0);J.context=QQ(z,H)}{if(J.state===X){var B=p1(Q)||"Component";if(!bG.has(B))bG.add(B),q("%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.",B)}if(z.mode&d4)d5.recordLegacyContextWarning(z,J);d5.recordUnsafeLifecycleWarnings(z,J)}J.state=z.memoizedState;var K=Q.getDerivedStateFromProps;if(typeof K==="function")PG(z,Q,K,X),J.state=z.memoizedState;if(typeof Q.getDerivedStateFromProps!=="function"&&typeof J.getSnapshotBeforeUpdate!=="function"&&(typeof J.UNSAFE_componentWillMount==="function"||typeof J.componentWillMount==="function"))fb(z,J),GY(z,X,J,Z),J.state=z.memoizedState;if(typeof J.componentDidMount==="function"){var N=j1;if(N|=p8,(z.mode&$7)!==Y1)N|=C7;z.flags|=N}}function hb(z,Q,X,Z){var{stateNode:J,memoizedProps:$}=z;J.props=$;var H=J.context,B=Q.contextType,K=_5;if(typeof B==="object"&&B!==null)K=z6(B);else{var N=zQ(z,Q,!0);K=QQ(z,N)}var P=Q.getDerivedStateFromProps,g=typeof P==="function"||typeof J.getSnapshotBeforeUpdate==="function";if(!g&&(typeof J.UNSAFE_componentWillReceiveProps==="function"||typeof J.componentWillReceiveProps==="function")){if($!==X||H!==K)bU(z,J,X,K)}DB();var u=z.memoizedState,e=J.state=u;if(GY(z,X,J,Z),e=z.memoizedState,$===X&&u===e&&!dJ()&&!qY()){if(typeof J.componentDidMount==="function"){var z0=j1;if(z0|=p8,(z.mode&$7)!==Y1)z0|=C7;z.flags|=z0}return!1}if(typeof P==="function")PG(z,Q,P,X),e=z.memoizedState;var Y0=qY()||RU(z,Q,$,X,u,e,K);if(Y0){if(!g&&(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 h0=j1;if(h0|=p8,(z.mode&$7)!==Y1)h0|=C7;z.flags|=h0}}else{if(typeof J.componentDidMount==="function"){var e0=j1;if(e0|=p8,(z.mode&$7)!==Y1)e0|=C7;z.flags|=e0}z.memoizedProps=X,z.memoizedState=e}return J.props=X,J.state=e,J.context=K,Y0}function yb(z,Q,X,Z,J){var $=Q.stateNode;VB(z,Q);var H=Q.memoizedProps,B=Q.type===Q.elementType?H:i5(Q.type,H);$.props=B;var K=Q.pendingProps,N=$.context,P=X.contextType,g=_5;if(typeof P==="object"&&P!==null)g=z6(P);else{var u=zQ(Q,X,!0);g=QQ(Q,u)}var e=X.getDerivedStateFromProps,z0=typeof e==="function"||typeof $.getSnapshotBeforeUpdate==="function";if(!z0&&(typeof $.UNSAFE_componentWillReceiveProps==="function"||typeof $.componentWillReceiveProps==="function")){if(H!==K||N!==g)bU(Q,$,Z,g)}DB();var Y0=Q.memoizedState,h0=$.state=Y0;if(GY(Q,Z,$,J),h0=Q.memoizedState,H===K&&Y0===h0&&!dJ()&&!qY()&&!O1){if(typeof $.componentDidUpdate==="function"){if(H!==z.memoizedProps||Y0!==z.memoizedState)Q.flags|=j1}if(typeof $.getSnapshotBeforeUpdate==="function"){if(H!==z.memoizedProps||Y0!==z.memoizedState)Q.flags|=x8}return!1}if(typeof e==="function")PG(Q,X,e,Z),h0=Q.memoizedState;var e0=qY()||RU(Q,X,B,Z,Y0,h0,g)||O1;if(e0){if(!z0&&(typeof $.UNSAFE_componentWillUpdate==="function"||typeof $.componentWillUpdate==="function")){if(typeof $.componentWillUpdate==="function")$.componentWillUpdate(Z,h0,g);if(typeof $.UNSAFE_componentWillUpdate==="function")$.UNSAFE_componentWillUpdate(Z,h0,g)}if(typeof $.componentDidUpdate==="function")Q.flags|=j1;if(typeof $.getSnapshotBeforeUpdate==="function")Q.flags|=x8}else{if(typeof $.componentDidUpdate==="function"){if(H!==z.memoizedProps||Y0!==z.memoizedState)Q.flags|=j1}if(typeof $.getSnapshotBeforeUpdate==="function"){if(H!==z.memoizedProps||Y0!==z.memoizedState)Q.flags|=x8}Q.memoizedProps=Z,Q.memoizedState=h0}return $.props=Z,$.state=h0,$.context=g,e0}function Hz(z,Q){return{value:z,source:Q,stack:nQ(Q),digest:null}}function kG(z,Q,X){return{value:z,source:null,stack:X!=null?X:null,digest:Q!=null?Q:null}}function Vb(z,Q){return!0}function TG(z,Q){try{var X=Vb(z,Q);if(X===!1)return;var{value:Z,source:J,stack:$}=Q,H=$!==null?$:"";if(Z!=null&&Z._suppressLogging){if(z.tag===_)return;console.error(Z)}var B=J?M1(J):null,K=B?"The above error occurred in the <"+B+"> component:":"The above error occurred in one of your React components:",N;if(z.tag===I)N=`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 P=M1(z)||"Anonymous";N="React will try to recreate this component tree from scratch "+("using the error boundary you provided, "+P+".")}var g=K+`
98
+ `+H+`
99
+
100
+ `+(""+N);console.error(g)}catch(u){setTimeout(function(){throw u})}}var Db=typeof WeakMap==="function"?WeakMap:Map;function FU(z,Q,X){var Z=u7(A4,X);Z.tag=fH,Z.payload={element:null};var J=Q.value;return Z.callback=function(){hM(J),TG(z,Q)},Z}function CG(z,Q,X){var Z=u7(A4,X);Z.tag=fH;var J=z.type.getDerivedStateFromError;if(typeof J==="function"){var $=Q.value;Z.payload=function(){return J($)},Z.callback=function(){yK(z),TG(z,Q)}}var H=z.stateNode;if(H!==null&&typeof H.componentDidCatch==="function")Z.callback=function(){if(yK(z),TG(z,Q),typeof J!=="function")SM(this);var{value:K,stack:N}=Q;if(this.componentDidCatch(K,{componentStack:N!==null?N:""}),typeof J!=="function"){if(!K5(z.lanes,L1))q("%s: Error boundaries should implement getDerivedStateFromError(). In that method, return a state update to display an error message or fallback UI.",M1(z)||"Unknown")}};return Z}function MU(z,Q,X){var Z=z.pingCache,J;if(Z===null)Z=z.pingCache=new Db,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 $=yM.bind(null,z,Q,X);if(g5)AZ(z,X);Q.then($,$)}}function Eb(z,Q,X,Z){var J=z.updateQueue;if(J===null){var $=new Set;$.add(X),z.updateQueue=$}else J.add(X)}function mb(z,Q){var X=z.tag;if((z.mode&m1)===Y1&&(X===L||X===v||X===p)){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 PU(z){var Q=z;do{if(Q.tag===D&&Nb(Q))return Q;Q=Q.return}while(Q!==null);return null}function AU(z,Q,X,Z,J){if((z.mode&m1)===Y1){if(z===Q)z.flags|=a6;else{if(z.flags|=o1,X.flags|=o3,X.flags&=~(RL|$X),X.tag===_){var $=X.alternate;if($===null)X.tag=J0;else{var H=u7(A4,L1);H.tag=JY,W8(X,H,L1)}}X.lanes=A1(X.lanes,L1)}return z}return z.flags|=a6,z.lanes=J,z}function ub(z,Q,X,Z,J){if(X.flags|=$X,g5)AZ(z,J);if(Z!==null&&typeof Z==="object"&&typeof Z.then==="function"){var $=Z;if(mb(X),I6()&&X.mode&m1)LB();var H=PU(Q);if(H!==null){if(H.flags&=~k7,AU(H,Q,X,z,J),H.mode&m1)MU(z,$,J);Eb(H,z,$);return}else{if(!H_(J)){MU(z,$,J),G9();return}var B=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=B}}else if(I6()&&X.mode&m1){LB();var K=PU(Q);if(K!==null){if((K.flags&a6)===G1)K.flags|=k7;AU(K,Q,X,z,J),wH(Hz(Z,X));return}}Z=Hz(Z,X),MM(Z);var N=Q;do{switch(N.tag){case I:{var P=Z;N.flags|=a6;var g=WX(J);N.lanes=A1(N.lanes,g);var u=FU(N,P,g);VH(N,u);return}case _:var e=Z,z0=N.type,Y0=N.stateNode;if((N.flags&o1)===G1&&(typeof z0.getDerivedStateFromError==="function"||Y0!==null&&typeof Y0.componentDidCatch==="function"&&!AK(Y0))){N.flags|=a6;var h0=WX(J);N.lanes=A1(N.lanes,h0);var e0=CG(N,e,h0);VH(N,e0);return}break}N=N.return}while(N!==null)}function gb(){return null}var GZ=Y.ReactCurrentOwner,o5=!1,vG,qZ,SG,fG,hG,Gz,yG,DY,BZ;vG={},qZ={},SG={},fG={},hG={},Gz=!1,yG={},DY={},BZ={};function n6(z,Q,X,Z){if(z===null)Q.child=TB(Q,null,X,Z);else Q.child=YQ(Q,z.child,X,Z)}function xb(z,Q,X,Z){Q.child=YQ(Q,z.child,null,Z),Q.child=YQ(Q,null,X,Z)}function IU(z,Q,X,Z,J){if(Q.type!==Q.elementType){var $=X.propTypes;if($)j5($,Z,"prop",p1(X))}var H=X.render,B=Q.ref,K,N;HQ(Q,J),GX(Q);{if(GZ.current=Q,B5(!0),K=OQ(z,Q,H,Z,B,J),N=WQ(),Q.mode&d4){N6(!0);try{K=OQ(z,Q,H,Z,B,J),N=WQ()}finally{N6(!1)}}B5(!1)}if(xz(),z!==null&&!o5)return jB(z,Q,J),g7(z,Q,J);if(I6()&&N)OH(Q);return Q.flags|=uz,n6(z,Q,K,J),Q.child}function kU(z,Q,X,Z,J){if(z===null){var $=X.type;if(rM($)&&X.compare===null&&X.defaultProps===void 0){var H=$;return H=MQ($),Q.tag=p,Q.type=H,EG(Q,$),TU(z,Q,H,Z,J)}{var B=$.propTypes;if(B)j5(B,Z,"prop",p1($));if(X.defaultProps!==void 0){var K=p1($)||"Unknown";if(!BZ[K])q("%s: Support for defaultProps will be removed from memo components in a future major release. Use JavaScript default parameters instead.",K),BZ[K]=!0}}var N=w9(X.type,null,Z,Q,Q.mode,J);return N.ref=Q.ref,N.return=Q,Q.child=N,N}{var P=X.type,g=P.propTypes;if(g)j5(g,Z,"prop",p1(P))}var u=z.child,e=pG(z,J);if(!e){var z0=u.memoizedProps,Y0=X.compare;if(Y0=Y0!==null?Y0:vX,Y0(z0,Z)&&z.ref===Q.ref)return g7(z,Q,J)}Q.flags|=uz;var h0=Oz(u,Z);return h0.ref=Q.ref,h0.return=Q,Q.child=h0,h0}function TU(z,Q,X,Z,J){if(Q.type!==Q.elementType){var $=Q.elementType;if($.$$typeof===i0){var H=$,B=H._payload,K=H._init;try{$=K(B)}catch(g){$=null}var N=$&&$.propTypes;if(N)j5(N,Z,"prop",p1($))}}if(z!==null){var P=z.memoizedProps;if(vX(P,Z)&&z.ref===Q.ref&&Q.type===z.type){if(o5=!1,Q.pendingProps=Z=P,!pG(z,J))return Q.lanes=z.lanes,g7(z,Q,J);else if((z.flags&o3)!==G1)o5=!0}}return VG(z,Q,X,Z,J)}function CU(z,Q,X){var Z=Q.pendingProps,J=Z.children,$=z!==null?z.memoizedState:null;if(Z.mode==="hidden"||Q0)if((Q.mode&m1)===Y1){var H={baseLanes:N0,cachePool:null,transitions:null};Q.memoizedState=H,aY(Q,X)}else if(!K5(X,U5)){var B=null,K;if($!==null){var N=$.baseLanes;K=A1(N,X)}else K=X;Q.lanes=Q.childLanes=WJ(U5);var P={baseLanes:K,cachePool:B,transitions:null};return Q.memoizedState=P,Q.updateQueue=null,aY(Q,K),null}else{var g={baseLanes:N0,cachePool:null,transitions:null};Q.memoizedState=g;var u=$!==null?$.baseLanes:X;aY(Q,u)}else{var e;if($!==null)e=A1($.baseLanes,X),Q.memoizedState=null;else e=X;aY(Q,e)}return n6(z,Q,J,X),Q.child}function jb(z,Q,X){var Z=Q.pendingProps;return n6(z,Q,Z,X),Q.child}function pb(z,Q,X){var Z=Q.pendingProps.children;return n6(z,Q,Z,X),Q.child}function db(z,Q,X){{Q.flags|=j1;{var Z=Q.stateNode;Z.effectDuration=0,Z.passiveEffectDuration=0}}var J=Q.pendingProps,$=J.children;return n6(z,Q,$,X),Q.child}function vU(z,Q){var X=Q.ref;if(z===null&&X!==null||z!==null&&z.ref!==X)Q.flags|=X8,Q.flags|=a3}function VG(z,Q,X,Z,J){if(Q.type!==Q.elementType){var $=X.propTypes;if($)j5($,Z,"prop",p1(X))}var H;{var B=zQ(Q,X,!0);H=QQ(Q,B)}var K,N;HQ(Q,J),GX(Q);{if(GZ.current=Q,B5(!0),K=OQ(z,Q,X,Z,H,J),N=WQ(),Q.mode&d4){N6(!0);try{K=OQ(z,Q,X,Z,H,J),N=WQ()}finally{N6(!1)}}B5(!1)}if(xz(),z!==null&&!o5)return jB(z,Q,J),g7(z,Q,J);if(I6()&&N)OH(Q);return Q.flags|=uz,n6(z,Q,K,J),Q.child}function SU(z,Q,X,Z,J){{switch(UP(Q)){case!1:{var{stateNode:$,type:H}=Q,B=new H(Q.memoizedProps,$.context),K=B.state;$.updater.enqueueSetState($,K,null);break}case!0:{Q.flags|=o1,Q.flags|=a6;var N=Error("Simulated error coming from DevTools"),P=WX(J);Q.lanes=A1(Q.lanes,P);var g=CG(Q,Hz(N,Q),P);VH(Q,g);break}}if(Q.type!==Q.elementType){var u=X.propTypes;if(u)j5(u,Z,"prop",p1(X))}}var e;if(q7(X))e=!0,lJ(Q);else e=!1;HQ(Q,J);var z0=Q.stateNode,Y0;if(z0===null)mY(z,Q),wU(Q,X,Z),IG(Q,X,Z,J),Y0=!0;else if(z===null)Y0=hb(Q,X,Z,J);else Y0=yb(z,Q,X,Z,J);var h0=DG(z,Q,X,Y0,e,J);{var e0=Q.stateNode;if(Y0&&e0.props!==Z){if(!Gz)q("It looks like %s is reassigning its own `this.props` while rendering. This is not supported and can lead to confusing bugs.",M1(Q)||"a component");Gz=!0}}return h0}function DG(z,Q,X,Z,J,$){vU(z,Q);var H=(Q.flags&o1)!==G1;if(!Z&&!H){if(J)UB(Q,X,!1);return g7(z,Q,$)}var B=Q.stateNode;GZ.current=Q;var K;if(H&&typeof X.getDerivedStateFromError!=="function")K=null,WU();else{GX(Q);{if(B5(!0),K=B.render(),Q.mode&d4){N6(!0);try{B.render()}finally{N6(!1)}}B5(!1)}xz()}if(Q.flags|=uz,z!==null&&H)xb(z,Q,K,$);else n6(z,Q,K,$);if(Q.memoizedState=B.state,J)UB(Q,X,!0);return Q.child}function fU(z){var Q=z.stateNode;if(Q.pendingContext)qB(z,Q.pendingContext,Q.pendingContext!==Q.context);else if(Q.context)qB(z,Q.context,!1);DH(z,Q.containerInfo)}function cb(z,Q,X){if(fU(Q),z===null)throw Error("Should have a current fiber. This is a bug in React.");var{pendingProps:Z,memoizedState:J}=Q,$=J.element;VB(z,Q),GY(Q,Z,null,X);var{memoizedState:H,stateNode:B}=Q,K=H.element;if(J.isDehydrated){var N={element:K,isDehydrated:!1,cache:H.cache,pendingSuspenseBoundaries:H.pendingSuspenseBoundaries,transitions:H.transitions},P=Q.updateQueue;if(P.baseState=N,Q.memoizedState=N,Q.flags&k7){var g=Hz(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 hU(z,Q,K,X,g)}else if(K!==$){var u=Hz(Error("This root received an early update, before anything was able hydrate. Switched the entire root to client rendering."),Q);return hU(z,Q,K,X,u)}else{aw(Q);var e=TB(Q,null,K,X);Q.child=e;var z0=e;while(z0)z0.flags=z0.flags&~e4|T7,z0=z0.sibling}}else{if(JQ(),K===$)return g7(z,Q,X);n6(z,Q,K,X)}return Q.child}function hU(z,Q,X,Z,J){return JQ(),wH(J),Q.flags|=k7,n6(z,Q,X,Z),Q.child}function lb(z,Q,X){if(uB(Q),z===null)NH(Q);var{type:Z,pendingProps:J}=Q,$=z!==null?z.memoizedProps:null,H=J.children,B=zH(Z,J);if(B)H=null;else if($!==null&&zH(Z,$))Q.flags|=YX;return vU(z,Q),n6(z,Q,H,X),Q.child}function ib(z,Q){if(z===null)NH(Q);return null}function ob(z,Q,X,Z){mY(z,Q);var J=Q.pendingProps,$=X,H=$._payload,B=$._init,K=B(H);Q.type=K;var N=Q.tag=tM(K),P=i5(K,J),g;switch(N){case L:return EG(Q,K),Q.type=K=MQ(K),g=VG(null,Q,K,P,Z),g;case _:return Q.type=K=O9(K),g=SU(null,Q,K,P,Z),g;case v:return Q.type=K=W9(K),g=IU(null,Q,K,P,Z),g;case n:{if(Q.type!==Q.elementType){var u=K.propTypes;if(u)j5(u,P,"prop",p1(K))}return g=kU(null,Q,K,i5(K.type,P),Z),g}}var e="";if(K!==null&&typeof K==="object"&&K.$$typeof===i0)e=" Did you wrap a component in React.lazy() more than once?";throw Error("Element type is invalid. Received a promise that resolves to: "+K+". "+("Lazy element type must resolve to a class or function."+e))}function ab(z,Q,X,Z,J){mY(z,Q),Q.tag=_;var $;if(q7(X))$=!0,lJ(Q);else $=!1;return HQ(Q,J),wU(Q,X,Z),IG(Q,X,Z,J),DG(null,Q,X,!0,$,J)}function nb(z,Q,X,Z){mY(z,Q);var J=Q.pendingProps,$;{var H=zQ(Q,X,!1);$=QQ(Q,H)}HQ(Q,Z);var B,K;GX(Q);{if(X.prototype&&typeof X.prototype.render==="function"){var N=p1(X)||"Unknown";if(!vG[N])q("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.",N,N),vG[N]=!0}if(Q.mode&d4)d5.recordLegacyContextWarning(Q,null);B5(!0),GZ.current=Q,B=OQ(null,Q,X,J,$,Z),K=WQ(),B5(!1)}if(xz(),Q.flags|=uz,typeof B==="object"&&B!==null&&typeof B.render==="function"&&B.$$typeof===void 0){var P=p1(X)||"Unknown";if(!qZ[P])q("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.",P,P,P),qZ[P]=!0}if(typeof B==="object"&&B!==null&&typeof B.render==="function"&&B.$$typeof===void 0){{var g=p1(X)||"Unknown";if(!qZ[g])q("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.",g,g,g),qZ[g]=!0}Q.tag=_,Q.memoizedState=null,Q.updateQueue=null;var u=!1;if(q7(X))u=!0,lJ(Q);else u=!1;return Q.memoizedState=B.state!==null&&B.state!==void 0?B.state:null,yH(Q),NU(Q,B),IG(Q,X,J,Z),DG(null,Q,X,!0,u,Z)}else{if(Q.tag=L,Q.mode&d4){N6(!0);try{B=OQ(null,Q,X,J,$,Z),K=WQ()}finally{N6(!1)}}if(I6()&&K)OH(Q);return n6(null,Q,B,Z),EG(Q,X),Q.child}}function EG(z,Q){{if(Q){if(Q.childContextTypes)q("%s(...): childContextTypes cannot be defined on a function component.",Q.displayName||Q.name||"Component")}if(z.ref!==null){var X="",Z=e7();if(Z)X+=`
101
+
102
+ Check the render method of \``+Z+"`.";var J=Z||"",$=z._debugSource;if($)J=$.fileName+":"+$.lineNumber;if(!hG[J])hG[J]=!0,q("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 H=p1(Q)||"Unknown";if(!BZ[H])q("%s: Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead.",H),BZ[H]=!0}if(typeof Q.getDerivedStateFromProps==="function"){var B=p1(Q)||"Unknown";if(!fG[B])q("%s: Function components do not support getDerivedStateFromProps.",B),fG[B]=!0}if(typeof Q.contextType==="object"&&Q.contextType!==null){var K=p1(Q)||"Unknown";if(!SG[K])q("%s: Function components do not support contextType.",K),SG[K]=!0}}}var mG={dehydrated:null,treeContext:null,retryLane:w6};function uG(z){return{baseLanes:z,cachePool:gb(),transitions:null}}function rb(z,Q){var X=null;return{baseLanes:A1(z.baseLanes,Q),cachePool:X,transitions:z.transitions}}function tb(z,Q,X,Z){if(Q!==null){var J=Q.memoizedState;if(J===null)return!1}return uH(z,eX)}function sb(z,Q){return OJ(z.childLanes,Q)}function yU(z,Q,X){var Z=Q.pendingProps;if(KP(Q))Q.flags|=o1;var J=c5.current,$=!1,H=(Q.flags&o1)!==G1;if(H||tb(J,z))$=!0,Q.flags&=~o1;else if(z===null||z.memoizedState!==null)J=Rb(J,xB);if(J=qQ(J),_8(Q,J),z===null){NH(Q);var B=Q.memoizedState;if(B!==null){var K=B.dehydrated;if(K!==null)return ZF(Q,K)}var{children:N,fallback:P}=Z;if($){var g=eb(Q,N,P,X),u=Q.child;return u.memoizedState=uG(X),Q.memoizedState=mG,g}else return gG(Q,N)}else{var e=z.memoizedState;if(e!==null){var z0=e.dehydrated;if(z0!==null)return JF(z,Q,H,Z,z0,e,X)}if($){var{fallback:Y0,children:h0}=Z,e0=QF(z,Q,h0,Y0,X),o0=Q.child,h1=z.child.memoizedState;return o0.memoizedState=h1===null?uG(X):rb(h1,X),o0.childLanes=sb(z,X),Q.memoizedState=mG,e0}else{var y1=Z.children,o=zF(z,Q,y1,X);return Q.memoizedState=null,o}}}function gG(z,Q,X){var Z=z.mode,J={mode:"visible",children:Q},$=xG(J,Z);return $.return=z,z.child=$,$}function eb(z,Q,X,Z){var{mode:J,child:$}=z,H={mode:"hidden",children:Q},B,K;if((J&m1)===Y1&&$!==null){if(B=$,B.childLanes=N0,B.pendingProps=H,z.mode&X4)B.actualDuration=0,B.actualStartTime=-1,B.selfBaseDuration=0,B.treeBaseDuration=0;K=A8(X,J,Z,null)}else B=xG(H,J),K=A8(X,J,Z,null);return B.return=z,K.return=z,B.sibling=K,z.child=B,K}function xG(z,Q,X){return DK(z,Q,N0,null)}function VU(z,Q){return Oz(z,Q)}function zF(z,Q,X,Z){var J=z.child,$=J.sibling,H=VU(J,{mode:"visible",children:X});if((Q.mode&m1)===Y1)H.lanes=Z;if(H.return=Q,H.sibling=null,$!==null){var B=Q.deletions;if(B===null)Q.deletions=[$],Q.flags|=g8;else B.push($)}return Q.child=H,H}function QF(z,Q,X,Z,J){var $=Q.mode,H=z.child,B=H.sibling,K={mode:"hidden",children:X},N;if(($&m1)===Y1&&Q.child!==H){var P=Q.child;if(N=P,N.childLanes=N0,N.pendingProps=K,Q.mode&X4)N.actualDuration=0,N.actualStartTime=-1,N.selfBaseDuration=H.selfBaseDuration,N.treeBaseDuration=H.treeBaseDuration;Q.deletions=null}else N=VU(H,K),N.subtreeFlags=H.subtreeFlags&v7;var g;if(B!==null)g=Oz(B,Z);else g=A8(Z,$,J,null),g.flags|=e4;return g.return=Q,N.return=Q,N.sibling=g,Q.child=N,g}function EY(z,Q,X,Z){if(Z!==null)wH(Z);YQ(Q,z.child,null,X);var J=Q.pendingProps,$=J.children,H=gG(Q,$);return H.flags|=e4,Q.memoizedState=null,H}function XF(z,Q,X,Z,J){var $=Q.mode,H={mode:"visible",children:X},B=xG(H,$),K=A8(Z,$,J,null);if(K.flags|=e4,B.return=Q,K.return=Q,B.sibling=K,Q.child=B,(Q.mode&m1)!==Y1)YQ(Q,z.child,null,J);return K}function ZF(z,Q,X){if((z.mode&m1)===Y1)q("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=WJ(L1);else if(JH(Q))z.lanes=WJ(i8);else z.lanes=WJ(U5);return null}function JF(z,Q,X,Z,J,$,H){if(!X){if(iw(),(Q.mode&m1)===Y1)return EY(z,Q,H,null);if(JH(J)){var B,K,N;{var P=qw(J);B=P.digest,K=P.message,N=P.stack}var g;if(K)g=Error(K);else g=Error("The server could not finish this Suspense boundary, likely due to an error during server rendering. Switched to client rendering.");var u=kG(g,B,N);return EY(z,Q,H,u)}var e=K5(H,z.childLanes);if(o5||e){var z0=oY();if(z0!==null){var Y0=L_(z0,H);if(Y0!==w6&&Y0!==$.retryLane){$.retryLane=Y0;var h0=A4;J5(z,Y0),B6(z0,z,Y0,h0)}}G9();var e0=kG(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 EY(z,Q,H,e0)}else if(XB(J)){Q.flags|=o1,Q.child=z.child;var o0=VM.bind(null,z);return Bw(J,o0),null}else{nw(Q,J,$.treeContext);var h1=Z.children,y1=gG(Q,h1);return y1.flags|=T7,y1}}else if(Q.flags&k7){Q.flags&=~k7;var o=kG(Error("There was an error while hydrating this Suspense boundary. Switched to client rendering."));return EY(z,Q,H,o)}else if(Q.memoizedState!==null)return Q.child=z.child,Q.flags|=o1,null;else{var{children:G0,fallback:a}=Z,b0=XF(z,Q,G0,a,H),m0=Q.child;return m0.memoizedState=uG(H),Q.memoizedState=mG,b0}}function DU(z,Q,X){z.lanes=A1(z.lanes,Q);var Z=z.alternate;if(Z!==null)Z.lanes=A1(Z.lanes,Q);vH(z.return,Q,X)}function YF(z,Q,X){var Z=Q;while(Z!==null){if(Z.tag===D){var J=Z.memoizedState;if(J!==null)DU(Z,X,z)}else if(Z.tag===t)DU(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 $F(z){var Q=z,X=null;while(Q!==null){var Z=Q.alternate;if(Z!==null&&KY(Z)===null)X=Q;Q=Q.sibling}return X}function HF(z){if(z!==void 0&&z!=="forwards"&&z!=="backwards"&&z!=="together"&&!yG[z])if(yG[z]=!0,typeof z==="string")switch(z.toLowerCase()){case"together":case"forwards":case"backwards":{q('"%s" is not a valid value for revealOrder on <SuspenseList />. Use lowercase "%s" instead.',z,z.toLowerCase());break}case"forward":case"backward":{q('"%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:q('"%s" is not a supported revealOrder on <SuspenseList />. Did you mean "together", "forwards" or "backwards"?',z);break}else q('%s is not a supported value for revealOrder on <SuspenseList />. Did you mean "together", "forwards" or "backwards"?',z)}function GF(z,Q){if(z!==void 0&&!DY[z]){if(z!=="collapsed"&&z!=="hidden")DY[z]=!0,q('"%s" is not a supported value for tail on <SuspenseList />. Did you mean "collapsed" or "hidden"?',z);else if(Q!=="forwards"&&Q!=="backwards")DY[z]=!0,q('<SuspenseList tail="%s" /> is only valid if revealOrder is "forwards" or "backwards". Did you mean to specify revealOrder="forwards"?',z)}}function EU(z,Q){{var X=i1(z),Z=!X&&typeof P4(z)==="function";if(X||Z){var J=X?"array":"iterable";return q("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 qF(z,Q){if((Q==="forwards"||Q==="backwards")&&z!==void 0&&z!==null&&z!==!1)if(i1(z)){for(var X=0;X<z.length;X++)if(!EU(z[X],X))return}else{var Z=P4(z);if(typeof Z==="function"){var J=Z.call(z);if(J){var $=J.next(),H=0;for(;!$.done;$=J.next()){if(!EU($.value,H))return;H++}}}else q('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 jG(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 mU(z,Q,X){var Z=Q.pendingProps,J=Z.revealOrder,$=Z.tail,H=Z.children;HF(J),GF($,J),qF(H,J),n6(z,Q,H,X);var B=c5.current,K=uH(B,eX);if(K)B=gH(B,eX),Q.flags|=o1;else{var N=z!==null&&(z.flags&o1)!==G1;if(N)YF(Q,Q.child,X);B=qQ(B)}if(_8(Q,B),(Q.mode&m1)===Y1)Q.memoizedState=null;else switch(J){case"forwards":{var P=$F(Q.child),g;if(P===null)g=Q.child,Q.child=null;else g=P.sibling,P.sibling=null;jG(Q,!1,g,P,$);break}case"backwards":{var u=null,e=Q.child;Q.child=null;while(e!==null){var z0=e.alternate;if(z0!==null&&KY(z0)===null){Q.child=e;break}var Y0=e.sibling;e.sibling=u,u=e,e=Y0}jG(Q,!0,u,null,$);break}case"together":{jG(Q,!1,null,null,void 0);break}default:Q.memoizedState=null}return Q.child}function BF(z,Q,X){DH(Q,Q.stateNode.containerInfo);var Z=Q.pendingProps;if(z===null)Q.child=YQ(Q,null,Z,X);else n6(z,Q,Z,X);return Q.child}var uU=!1;function UF(z,Q,X){var Z=Q.type,J=Z._context,$=Q.pendingProps,H=Q.memoizedProps,B=$.value;{if(!("value"in $)){if(!uU)uU=!0,q("The `value` prop is required for the `<Context.Provider>`. Did you misspell it or forget to pass it?")}var K=Q.type.propTypes;if(K)j5(K,$,"prop","Context.Provider")}if(SB(Q,J,B),H!==null){var N=H.value;if(L5(N,B)){if(H.children===$.children&&!dJ())return g7(z,Q,X)}else Gb(Q,J,X)}var P=$.children;return n6(z,Q,P,X),Q.child}var gU=!1;function KF(z,Q,X){var Z=Q.type;if(Z._context===void 0){if(Z!==Z.Consumer){if(!gU)gU=!0,q("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")q("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.");HQ(Q,X);var H=z6(Z);GX(Q);var B;return GZ.current=Q,B5(!0),B=$(H),B5(!1),xz(),Q.flags|=uz,n6(z,Q,B,X),Q.child}function UZ(){o5=!0}function mY(z,Q){if((Q.mode&m1)===Y1){if(z!==null)z.alternate=null,Q.alternate=null,Q.flags|=e4}}function g7(z,Q,X){if(z!==null)Q.dependencies=z.dependencies;if(WU(),PZ(Q.lanes),!K5(X,Q.childLanes))return null;return $b(z,Q),Q.child}function OF(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|=g8;else $.push(z);return X.flags|=e4,X}}function pG(z,Q){var X=z.lanes;if(K5(X,Q))return!0;return!1}function WF(z,Q,X){switch(Q.tag){case I:fU(Q);var Z=Q.stateNode;JQ();break;case w:uB(Q);break;case _:{var J=Q.type;if(q7(J))lJ(Q);break}case F:DH(Q,Q.stateNode.containerInfo);break;case V:{var $=Q.memoizedProps.value,H=Q.type._context;SB(Q,H,$);break}case T:{var B=K5(X,Q.childLanes);if(B)Q.flags|=j1;{var K=Q.stateNode;K.effectDuration=0,K.passiveEffectDuration=0}}break;case D:{var N=Q.memoizedState;if(N!==null){if(N.dehydrated!==null)return _8(Q,qQ(c5.current)),Q.flags|=o1,null;var P=Q.child,g=P.childLanes;if(K5(X,g))return yU(z,Q,X);else{_8(Q,qQ(c5.current));var u=g7(z,Q,X);if(u!==null)return u.sibling;else return null}}else _8(Q,qQ(c5.current));break}case t:{var e=(z.flags&o1)!==G1,z0=K5(X,Q.childLanes);if(e){if(z0)return mU(z,Q,X);Q.flags|=o1}var Y0=Q.memoizedState;if(Y0!==null)Y0.rendering=null,Y0.tail=null,Y0.lastEffect=null;if(_8(Q,c5.current),z0)break;else return null}case j:case c:return Q.lanes=N0,CU(z,Q,X)}return g7(z,Q,X)}function xU(z,Q,X){if(Q._debugNeedsRemount&&z!==null)return OF(z,Q,w9(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||dJ()||Q.type!==z.type)o5=!0;else{var $=pG(z,X);if(!$&&(Q.flags&o1)===G1)return o5=!1,WF(z,Q,X);if((z.flags&o3)!==G1)o5=!0;else o5=!1}}else if(o5=!1,I6()&&xw(Q)){var H=Q.index,B=jw();WB(Q,B,H)}switch(Q.lanes=N0,Q.tag){case k:return nb(z,Q,Q.type,X);case r:{var K=Q.elementType;return ob(z,Q,K,X)}case L:{var{type:N,pendingProps:P}=Q,g=Q.elementType===N?P:i5(N,P);return VG(z,Q,N,g,X)}case _:{var{type:u,pendingProps:e}=Q,z0=Q.elementType===u?e:i5(u,e);return SU(z,Q,u,z0,X)}case I:return cb(z,Q,X);case w:return lb(z,Q,X);case b:return ib(z,Q);case D:return yU(z,Q,X);case F:return BF(z,Q,X);case v:{var{type:Y0,pendingProps:h0}=Q,e0=Q.elementType===Y0?h0:i5(Y0,h0);return IU(z,Q,Y0,e0,X)}case C:return jb(z,Q,X);case f:return pb(z,Q,X);case T:return db(z,Q,X);case V:return UF(z,Q,X);case E:return KF(z,Q,X);case n:{var{type:o0,pendingProps:h1}=Q,y1=i5(o0,h1);if(Q.type!==Q.elementType){var o=o0.propTypes;if(o)j5(o,y1,"prop",p1(o0))}return y1=i5(o0.type,y1),kU(z,Q,o0,y1,X)}case p:return TU(z,Q,Q.type,Q.pendingProps,X);case J0:{var{type:G0,pendingProps:a}=Q,b0=Q.elementType===G0?a:i5(G0,a);return ab(z,Q,G0,b0,X)}case t:return mU(z,Q,X);case l:break;case j:return CU(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 LQ(z){z.flags|=j1}function jU(z){z.flags|=X8,z.flags|=a3}var pU,dG,dU,cU;pU=function(z,Q,X,Z){var J=Q.child;while(J!==null){if(J.tag===w||J.tag===b)mN(z,J.stateNode);else if(J.tag===F);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}},dG=function(z,Q){},dU=function(z,Q,X,Z,J){var $=z.memoizedProps;if($===Z)return;var H=Q.stateNode,B=EH(),K=gN(H,X,$,Z,J,B);if(Q.updateQueue=K,K)LQ(Q)},cU=function(z,Q,X,Z){if(X!==Z)LQ(Q)};function KZ(z,Q){if(I6())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 T6(z){var Q=z.alternate!==null&&z.alternate.child===z.child,X=N0,Z=G1;if(!Q){if((z.mode&X4)!==Y1){var{actualDuration:J,selfBaseDuration:$,child:H}=z;while(H!==null)X=A1(X,A1(H.lanes,H.childLanes)),Z|=H.subtreeFlags,Z|=H.flags,J+=H.actualDuration,$+=H.treeBaseDuration,H=H.sibling;z.actualDuration=J,z.treeBaseDuration=$}else{var B=z.child;while(B!==null)X=A1(X,A1(B.lanes,B.childLanes)),Z|=B.subtreeFlags,Z|=B.flags,B.return=z,B=B.sibling}z.subtreeFlags|=Z}else{if((z.mode&X4)!==Y1){var{selfBaseDuration:K,child:N}=z;while(N!==null)X=A1(X,A1(N.lanes,N.childLanes)),Z|=N.subtreeFlags&v7,Z|=N.flags&v7,K+=N.treeBaseDuration,N=N.sibling;z.treeBaseDuration=K}else{var P=z.child;while(P!==null)X=A1(X,A1(P.lanes,P.childLanes)),Z|=P.subtreeFlags&v7,Z|=P.flags&v7,P.return=z,P=P.sibling}z.subtreeFlags|=Z}return z.childLanes=X,Q}function LF(z,Q,X){if(zb()&&(Q.mode&m1)!==Y1&&(Q.flags&o1)===G1)return FB(Q),JQ(),Q.flags|=k7|$X|a6,!1;var Z=rJ(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(sw(Q),T6(Q),(Q.mode&X4)!==Y1){var J=X!==null;if(J){var $=Q.child;if($!==null)Q.treeBaseDuration-=$.treeBaseDuration}}return!1}else{if(JQ(),(Q.flags&o1)===G1)Q.memoizedState=null;if(Q.flags|=j1,T6(Q),(Q.mode&X4)!==Y1){var H=X!==null;if(H){var B=Q.child;if(B!==null)Q.treeBaseDuration-=B.treeBaseDuration}}return!1}else return MB(),!0}function lU(z,Q,X){var Z=Q.pendingProps;switch(WH(Q),Q.tag){case k:case r:case p:case L:case v:case C:case f:case T:case E:case n:return T6(Q),null;case _:{var J=Q.type;if(q7(J))cJ(Q);return T6(Q),null}case I:{var $=Q.stateNode;if(GQ(Q),BH(Q),jH(),$.pendingContext)$.context=$.pendingContext,$.pendingContext=null;if(z===null||z.child===null){var H=rJ(Q);if(H)LQ(Q);else if(z!==null){var B=z.memoizedState;if(!B.isDehydrated||(Q.flags&k7)!==G1)Q.flags|=x8,MB()}}return dG(z,Q),T6(Q),null}case w:{mH(Q);var K=mB(),N=Q.type;if(z!==null&&Q.stateNode!=null){if(dU(z,Q,N,Z,K),z.ref!==Q.ref)jU(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 T6(Q),null}var P=EH(),g=rJ(Q);if(g){if(rw(Q,K,P))LQ(Q)}else{var u=EN(N,Z,K,P,Q);if(pU(u,Q,!1,!1),Q.stateNode=u,uN(u,N,Z,K))LQ(Q)}if(Q.ref!==null)jU(Q)}return T6(Q),null}case b:{var e=Z;if(z&&Q.stateNode!=null){var z0=z.memoizedProps;cU(z,Q,z0,e)}else{if(typeof e!=="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 Y0=mB(),h0=EH(),e0=rJ(Q);if(e0){if(tw(Q))LQ(Q)}else Q.stateNode=xN(e,Y0,h0,Q)}return T6(Q),null}case D:{BQ(Q);var o0=Q.memoizedState;if(z===null||z.memoizedState!==null&&z.memoizedState.dehydrated!==null){var h1=LF(z,Q,o0);if(!h1)if(Q.flags&a6)return Q;else return null}if((Q.flags&o1)!==G1){if(Q.lanes=X,(Q.mode&X4)!==Y1)OG(Q);return Q}var y1=o0!==null,o=z!==null&&z.memoizedState!==null;if(y1!==o){if(y1){var G0=Q.child;if(G0.flags|=j8,(Q.mode&m1)!==Y1){var a=z===null&&(Q.memoizedProps.unstable_avoidThisFallback!==!0||!U0);if(a||uH(c5.current,xB))FM();else G9()}}}var b0=Q.updateQueue;if(b0!==null)Q.flags|=j1;if(T6(Q),(Q.mode&X4)!==Y1){if(y1){var m0=Q.child;if(m0!==null)Q.treeBaseDuration-=m0.treeBaseDuration}}return null}case F:if(GQ(Q),dG(z,Q),z===null)yw(Q.stateNode.containerInfo);return T6(Q),null;case V:var y0=Q.type._context;return CH(y0,Q),T6(Q),null;case J0:{var B1=Q.type;if(q7(B1))cJ(Q);return T6(Q),null}case t:{BQ(Q);var w1=Q.memoizedState;if(w1===null)return T6(Q),null;var J4=(Q.flags&o1)!==G1,c1=w1.rendering;if(c1===null)if(!J4){var n4=PM()&&(z===null||(z.flags&o1)===G1);if(!n4){var l1=Q.child;while(l1!==null){var c4=KY(l1);if(c4!==null){J4=!0,Q.flags|=o1,KZ(w1,!1);var p6=c4.updateQueue;if(p6!==null)Q.updateQueue=p6,Q.flags|=j1;return Q.subtreeFlags=G1,Hb(Q,X),_8(Q,gH(c5.current,eX)),Q.child}l1=l1.sibling}}if(w1.tail!==null&&R6()>OK())Q.flags|=o1,J4=!0,KZ(w1,!1),Q.lanes=d2}else KZ(w1,!1);else{if(!J4){var h6=KY(c1);if(h6!==null){Q.flags|=o1,J4=!0;var N5=h6.updateQueue;if(N5!==null)Q.updateQueue=N5,Q.flags|=j1;if(KZ(w1,!0),w1.tail===null&&w1.tailMode==="hidden"&&!c1.alternate&&!I6())return T6(Q),null}else if(R6()*2-w1.renderingStartTime>OK()&&X!==U5)Q.flags|=o1,J4=!0,KZ(w1,!1),Q.lanes=d2}if(w1.isBackwards)c1.sibling=Q.child,Q.child=c1;else{var s6=w1.last;if(s6!==null)s6.sibling=c1;else Q.child=c1;w1.last=c1}}if(w1.tail!==null){var e6=w1.tail;w1.rendering=e6,w1.tail=e6.sibling,w1.renderingStartTime=R6(),e6.sibling=null;var d6=c5.current;if(J4)d6=gH(d6,eX);else d6=qQ(d6);return _8(Q,d6),e6}return T6(Q),null}case l:break;case j:case c:{H9(Q);var c7=Q.memoizedState,PQ=c7!==null;if(z!==null){var CZ=z.memoizedState,R7=CZ!==null;if(R7!==PQ&&!Q0)Q.flags|=j8}if(!PQ||(Q.mode&m1)===Y1)T6(Q);else if(K5(_7,U5)){if(T6(Q),Q.subtreeFlags&(e4|j1))Q.flags|=j8}return null}case X0:return null;case I0: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 _F(z,Q,X){switch(WH(Q),Q.tag){case _:{var Z=Q.type;if(q7(Z))cJ(Q);var J=Q.flags;if(J&a6){if(Q.flags=J&~a6|o1,(Q.mode&X4)!==Y1)OG(Q);return Q}return null}case I:{var $=Q.stateNode;GQ(Q),BH(Q),jH();var H=Q.flags;if((H&a6)!==G1&&(H&o1)===G1)return Q.flags=H&~a6|o1,Q;return null}case w:return mH(Q),null;case D:{BQ(Q);var B=Q.memoizedState;if(B!==null&&B.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.");JQ()}var K=Q.flags;if(K&a6){if(Q.flags=K&~a6|o1,(Q.mode&X4)!==Y1)OG(Q);return Q}return null}case t:return BQ(Q),null;case F:return GQ(Q),null;case V:var N=Q.type._context;return CH(N,Q),null;case j:case c:return H9(Q),null;case X0:return null;default:return null}}function iU(z,Q,X){switch(WH(Q),Q.tag){case _:{var Z=Q.type.childContextTypes;if(Z!==null&&Z!==void 0)cJ(Q);break}case I:{var J=Q.stateNode;GQ(Q),BH(Q),jH();break}case w:{mH(Q);break}case F:GQ(Q);break;case D:BQ(Q);break;case t:BQ(Q);break;case V:var $=Q.type._context;CH($,Q);break;case j:case c:H9(Q);break}}var oU=null;oU=new Set;var uY=!1,C6=!1,RF=typeof WeakSet==="function"?WeakSet:Set,p0=null,_Q=null,RQ=null;function NF(z){c3(null,function(){throw z}),l3()}var wF=function(z,Q){if(Q.props=z.memoizedProps,Q.state=z.memoizedState,z.mode&X4)try{W7(),Q.componentWillUnmount()}finally{O7(z)}else Q.componentWillUnmount()};function aU(z,Q){try{w8(J6,z)}catch(X){N4(z,Q,X)}}function cG(z,Q,X){try{wF(z,X)}catch(Z){N4(z,Q,Z)}}function bF(z,Q,X){try{X.componentDidMount()}catch(Z){N4(z,Q,Z)}}function nU(z,Q){try{sU(z)}catch(X){N4(z,Q,X)}}function NQ(z,Q){var X=z.ref;if(X!==null)if(typeof X==="function"){var Z;try{if(v0&&X1&&z.mode&X4)try{W7(),Z=X(null)}finally{O7(z)}else Z=X(null)}catch(J){N4(z,Q,J)}if(typeof Z==="function")q("Unexpected return value from a callback ref in %s. A callback ref should not return a function.",M1(z))}else X.current=null}function gY(z,Q,X){try{X()}catch(Z){N4(z,Q,Z)}}var rU=null,tU=!1;function FF(z,Q){rU=VN(z.containerInfo),p0=Q,MF();var X=tU;return tU=!1,rU=null,X}function MF(){while(p0!==null){var z=p0,Q=z.child;if((z.subtreeFlags&r3)!==G1&&Q!==null)Q.return=z,p0=Q;else PF()}}function PF(){while(p0!==null){var z=p0;m4(z);try{AF(z)}catch(X){N4(z,z.return,X)}_6();var Q=z.sibling;if(Q!==null){Q.return=z.return,p0=Q;return}p0=z.return}}function AF(z){var{alternate:Q,flags:X}=z;if((X&x8)!==G1){switch(m4(z),z.tag){case L:case v:case p:break;case _:{if(Q!==null){var{memoizedProps:Z,memoizedState:J}=Q,$=z.stateNode;if(z.type===z.elementType&&!Gz){if($.props!==z.memoizedProps)q("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.",M1(z)||"instance");if($.state!==z.memoizedState)q("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.",M1(z)||"instance")}var H=$.getSnapshotBeforeUpdate(z.elementType===z.type?Z:i5(z.type,Z),J);{var B=oU;if(H===void 0&&!B.has(z.type))B.add(z.type),q("%s.getSnapshotBeforeUpdate(): A snapshot value (or null) must be returned. You have returned undefined.",M1(z))}$.__reactInternalSnapshotBeforeUpdate=H}break}case I:{{var K=z.stateNode;Yw(K.containerInfo)}break}case w:case b:case F:case J0: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.")}_6()}}function a5(z,Q,X){var Z=Q.updateQueue,J=Z!==null?Z.lastEffect:null;if(J!==null){var $=J.next,H=$;do{if((H.tag&z)===z){var B=H.destroy;if(H.destroy=void 0,B!==void 0){if((z&k6)!==Y5)xL(Q);else if((z&J6)!==Y5)u2(Q);if((z&B7)!==Y5)IZ(!0);if(gY(Q,X,B),(z&B7)!==Y5)IZ(!1);if((z&k6)!==Y5)jL();else if((z&J6)!==Y5)g2()}}H=H.next}while(H!==$)}}function w8(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&k6)!==Y5)uL(Q);else if((z&J6)!==Y5)pL(Q);var H=$.create;if((z&B7)!==Y5)IZ(!0);if($.destroy=H(),(z&B7)!==Y5)IZ(!1);if((z&k6)!==Y5)gL();else if((z&J6)!==Y5)dL();{var B=$.destroy;if(B!==void 0&&typeof B!=="function"){var K=void 0;if(($.tag&J6)!==G1)K="useLayoutEffect";else if(($.tag&B7)!==G1)K="useInsertionEffect";else K="useEffect";var N=void 0;if(B===null)N=" You returned null. If your effect does not require clean up, return undefined (or nothing).";else if(typeof B.then==="function")N=`
103
+
104
+ It looks like you wrote `+K+`(async () => ...) or returned a Promise. Instead, write the async function inside your effect and call it immediately:
105
+
106
+ `+K+`(() => {
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 N=" You returned: "+B;q("%s must not return anything besides a function, which is used for clean-up.%s",K,N)}}}$=$.next}while($!==J)}}function IF(z,Q){if((Q.flags&j1)!==G1)switch(Q.tag){case T:{var X=Q.stateNode.passiveEffectDuration,Z=Q.memoizedProps,J=Z.id,$=Z.onPostCommit,H=KU(),B=Q.alternate===null?"mount":"update";if(UU())B="nested-update";if(typeof $==="function")$(J,B,X,H);var K=Q.return;z:while(K!==null){switch(K.tag){case I:var N=K.stateNode;N.passiveEffectDuration+=X;break z;case T:var P=K.stateNode;P.passiveEffectDuration+=X;break z}K=K.return}break}}}function kF(z,Q,X,Z){if((X.flags&HX)!==G1)switch(X.tag){case L:case v:case p:{if(!C6)if(X.mode&X4)try{W7(),w8(J6|Z6,X)}finally{O7(X)}else w8(J6|Z6,X);break}case _:{var J=X.stateNode;if(X.flags&j1){if(!C6)if(Q===null){if(X.type===X.elementType&&!Gz){if(J.props!==X.memoizedProps)q("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.",M1(X)||"instance");if(J.state!==X.memoizedState)q("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.",M1(X)||"instance")}if(X.mode&X4)try{W7(),J.componentDidMount()}finally{O7(X)}else J.componentDidMount()}else{var $=X.elementType===X.type?Q.memoizedProps:i5(X.type,Q.memoizedProps),H=Q.memoizedState;if(X.type===X.elementType&&!Gz){if(J.props!==X.memoizedProps)q("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.",M1(X)||"instance");if(J.state!==X.memoizedState)q("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.",M1(X)||"instance")}if(X.mode&X4)try{W7(),J.componentDidUpdate($,H,J.__reactInternalSnapshotBeforeUpdate)}finally{O7(X)}else J.componentDidUpdate($,H,J.__reactInternalSnapshotBeforeUpdate)}}var B=X.updateQueue;if(B!==null){if(X.type===X.elementType&&!Gz){if(J.props!==X.memoizedProps)q("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.",M1(X)||"instance");if(J.state!==X.memoizedState)q("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.",M1(X)||"instance")}EB(X,B,J)}break}case I:{var K=X.updateQueue;if(K!==null){var N=null;if(X.child!==null)switch(X.child.tag){case w:N=e$(X.child.stateNode);break;case _:N=X.child.stateNode;break}EB(X,K,N)}break}case w:{var P=X.stateNode;if(Q===null&&X.flags&j1){var{type:g,memoizedProps:u}=X;lN(P,g,u)}break}case b:break;case F:break;case T:{{var e=X.memoizedProps,z0=e.onCommit,Y0=e.onRender,h0=X.stateNode.effectDuration,e0=KU(),o0=Q===null?"mount":"update";if(UU())o0="nested-update";if(typeof Y0==="function")Y0(X.memoizedProps.id,o0,X.actualDuration,X.treeBaseDuration,X.actualStartTime,e0);{if(typeof z0==="function")z0(X.memoizedProps.id,o0,h0,e0);CM(X);var h1=X.return;z:while(h1!==null){switch(h1.tag){case I:var y1=h1.stateNode;y1.effectDuration+=h0;break z;case T:var o=h1.stateNode;o.effectDuration+=h0;break z}h1=h1.return}}}break}case D:{VF(z,X);break}case t:case J0:case l:case j:case c:case I0: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(!C6){if(X.flags&X8)sU(X)}}function TF(z){switch(z.tag){case L:case v:case p:{if(z.mode&X4)try{W7(),aU(z,z.return)}finally{O7(z)}else aU(z,z.return);break}case _:{var Q=z.stateNode;if(typeof Q.componentDidMount==="function")bF(z,z.return,Q);nU(z,z.return);break}case w:{nU(z,z.return);break}}}function CF(z,Q){var X=null;{var Z=z;while(!0){if(Z.tag===w){if(X===null){X=Z;try{var J=Z.stateNode;if(Q)Qw(J);else Zw(Z.stateNode,Z.memoizedProps)}catch(H){N4(z,z.return,H)}}}else if(Z.tag===b){if(X===null)try{var $=Z.stateNode;if(Q)Xw($);else Jw($,Z.memoizedProps)}catch(H){N4(z,z.return,H)}}else if((Z.tag===j||Z.tag===c)&&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 sU(z){var Q=z.ref;if(Q!==null){var X=z.stateNode,Z;switch(z.tag){case w:Z=e$(X);break;default:Z=X}if(typeof Q==="function"){var J;if(z.mode&X4)try{W7(),J=Q(Z)}finally{O7(z)}else J=Q(Z);if(typeof J==="function")q("Unexpected return value from a callback ref in %s. A callback ref should not return a function.",M1(z))}else{if(!Q.hasOwnProperty("current"))q("Unexpected ref object provided for %s. Use either a ref-setter function or React.createRef().",M1(z));Q.current=Z}}}function vF(z){var Q=z.alternate;if(Q!==null)Q.return=null;z.return=null}function eU(z){var Q=z.alternate;if(Q!==null)z.alternate=null,eU(Q);{if(z.child=null,z.deletions=null,z.sibling=null,z.tag===w){var X=z.stateNode;if(X!==null)Ew(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 SF(z){var Q=z.return;while(Q!==null){if(zK(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 zK(z){return z.tag===w||z.tag===I||z.tag===F}function QK(z){var Q=z;z:while(!0){while(Q.sibling===null){if(Q.return===null||zK(Q.return))return null;Q=Q.return}Q.sibling.return=Q.return,Q=Q.sibling;while(Q.tag!==w&&Q.tag!==b&&Q.tag!==i){if(Q.flags&e4)continue z;if(Q.child===null||Q.tag===F)continue z;else Q.child.return=Q,Q=Q.child}if(!(Q.flags&e4))return Q.stateNode}}function fF(z){var Q=SF(z);switch(Q.tag){case w:{var X=Q.stateNode;if(Q.flags&YX)QB(X),Q.flags&=~YX;var Z=QK(z);iG(z,Z,X);break}case I:case F:{var J=Q.stateNode.containerInfo,$=QK(z);lG(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 lG(z,Q,X){var Z=z.tag,J=Z===w||Z===b;if(J){var $=z.stateNode;if(Q)tN(X,$,Q);else nN(X,$)}else if(Z===F);else{var H=z.child;if(H!==null){lG(H,Q,X);var B=H.sibling;while(B!==null)lG(B,Q,X),B=B.sibling}}}function iG(z,Q,X){var Z=z.tag,J=Z===w||Z===b;if(J){var $=z.stateNode;if(Q)rN(X,$,Q);else aN(X,$)}else if(Z===F);else{var H=z.child;if(H!==null){iG(H,Q,X);var B=H.sibling;while(B!==null)iG(B,Q,X),B=B.sibling}}}var v6=null,n5=!1;function hF(z,Q,X){{var Z=Q;z:while(Z!==null){switch(Z.tag){case w:{v6=Z.stateNode,n5=!1;break z}case I:{v6=Z.stateNode.containerInfo,n5=!0;break z}case F:{v6=Z.stateNode.containerInfo,n5=!0;break z}}Z=Z.return}if(v6===null)throw Error("Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.");XK(z,Q,X),v6=null,n5=!1}vF(X)}function b8(z,Q,X){var Z=X.child;while(Z!==null)XK(z,Q,Z),Z=Z.sibling}function XK(z,Q,X){switch(VL(X),X.tag){case w:if(!C6)NQ(X,Q);case b:{{var Z=v6,J=n5;if(v6=null,b8(z,Q,X),v6=Z,n5=J,v6!==null)if(n5)eN(v6,X.stateNode);else sN(v6,X.stateNode)}return}case i:{if(v6!==null)if(n5)zw(v6,X.stateNode);else ZH(v6,X.stateNode);return}case F:{{var $=v6,H=n5;v6=X.stateNode.containerInfo,n5=!0,b8(z,Q,X),v6=$,n5=H}return}case L:case v:case n:case p:{if(!C6){var B=X.updateQueue;if(B!==null){var K=B.lastEffect;if(K!==null){var N=K.next,P=N;do{var g=P,u=g.destroy,e=g.tag;if(u!==void 0){if((e&B7)!==Y5)gY(X,Q,u);else if((e&J6)!==Y5){if(u2(X),X.mode&X4)W7(),gY(X,Q,u),O7(X);else gY(X,Q,u);g2()}}P=P.next}while(P!==N)}}}b8(z,Q,X);return}case _:{if(!C6){NQ(X,Q);var z0=X.stateNode;if(typeof z0.componentWillUnmount==="function")cG(X,Q,z0)}b8(z,Q,X);return}case l:{b8(z,Q,X);return}case j:{if(X.mode&m1){var Y0=C6;C6=Y0||X.memoizedState!==null,b8(z,Q,X),C6=Y0}else b8(z,Q,X);break}default:{b8(z,Q,X);return}}}function yF(z){var Q=z.memoizedState}function VF(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)ww($)}}}}function ZK(z){var Q=z.updateQueue;if(Q!==null){z.updateQueue=null;var X=z.stateNode;if(X===null)X=z.stateNode=new RF;Q.forEach(function(Z){var J=DM.bind(null,z,Z);if(!X.has(Z)){if(X.add(Z),g5)if(_Q!==null&&RQ!==null)AZ(RQ,_Q);else throw Error("Expected finished root and lanes to be set. This is a bug in React.");Z.then(J,J)}})}}function DF(z,Q,X){_Q=X,RQ=z,m4(Q),JK(Q,z),m4(Q),_Q=null,RQ=null}function r5(z,Q,X){var Z=Q.deletions;if(Z!==null)for(var J=0;J<Z.length;J++){var $=Z[J];try{hF(z,Q,$)}catch(K){N4($,Q,K)}}var H=iZ();if(Q.subtreeFlags&t3){var B=Q.child;while(B!==null)m4(B),JK(B,z),B=B.sibling}m4(H)}function JK(z,Q,X){var{alternate:Z,flags:J}=z;switch(z.tag){case L:case v:case n:case p:{if(r5(Q,z),L7(z),J&j1){try{a5(B7|Z6,z,z.return),w8(B7|Z6,z)}catch(B1){N4(z,z.return,B1)}if(z.mode&X4){try{W7(),a5(J6|Z6,z,z.return)}catch(B1){N4(z,z.return,B1)}O7(z)}else try{a5(J6|Z6,z,z.return)}catch(B1){N4(z,z.return,B1)}}return}case _:{if(r5(Q,z),L7(z),J&X8){if(Z!==null)NQ(Z,Z.return)}return}case w:{if(r5(Q,z),L7(z),J&X8){if(Z!==null)NQ(Z,Z.return)}{if(z.flags&YX){var $=z.stateNode;try{QB($)}catch(B1){N4(z,z.return,B1)}}if(J&j1){var H=z.stateNode;if(H!=null){var B=z.memoizedProps,K=Z!==null?Z.memoizedProps:B,N=z.type,P=z.updateQueue;if(z.updateQueue=null,P!==null)try{iN(H,P,N,K,B,z)}catch(B1){N4(z,z.return,B1)}}}}return}case b:{if(r5(Q,z),L7(z),J&j1){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:g,memoizedProps:u}=z,e=Z!==null?Z.memoizedProps:u;try{oN(g,e,u)}catch(B1){N4(z,z.return,B1)}}return}case I:{if(r5(Q,z),L7(z),J&j1){if(Z!==null){var z0=Z.memoizedState;if(z0.isDehydrated)try{Nw(Q.containerInfo)}catch(B1){N4(z,z.return,B1)}}}return}case F:{r5(Q,z),L7(z);return}case D:{r5(Q,z),L7(z);var Y0=z.child;if(Y0.flags&j8){var{stateNode:h0,memoizedState:e0}=Y0,o0=e0!==null;if(h0.isHidden=o0,o0){var h1=Y0.alternate!==null&&Y0.alternate.memoizedState!==null;if(!h1)bM()}}if(J&j1){try{yF(z)}catch(B1){N4(z,z.return,B1)}ZK(z)}return}case j:{var y1=Z!==null&&Z.memoizedState!==null;if(z.mode&m1){var o=C6;C6=o||y1,r5(Q,z),C6=o}else r5(Q,z);if(L7(z),J&j8){var{stateNode:G0,memoizedState:a}=z,b0=a!==null,m0=z;if(G0.isHidden=b0,b0){if(!y1){if((m0.mode&m1)!==Y1){p0=m0;var y0=m0.child;while(y0!==null)p0=y0,mF(y0),y0=y0.sibling}}}CF(m0,b0)}return}case t:{if(r5(Q,z),L7(z),J&j1)ZK(z);return}case l:return;default:{r5(Q,z),L7(z);return}}}function L7(z){var Q=z.flags;if(Q&e4){try{fF(z)}catch(X){N4(z,z.return,X)}z.flags&=~e4}if(Q&T7)z.flags&=~T7}function EF(z,Q,X){_Q=X,RQ=Q,p0=z,YK(z,Q,X),_Q=null,RQ=null}function YK(z,Q,X){var Z=(z.mode&m1)!==Y1;while(p0!==null){var J=p0,$=J.child;if(J.tag===j&&Z){var H=J.memoizedState!==null,B=H||uY;if(B){oG(z,Q,X);continue}else{var K=J.alternate,N=K!==null&&K.memoizedState!==null,P=N||C6,g=uY,u=C6;if(uY=B,C6=P,C6&&!u)p0=J,uF(J);var e=$;while(e!==null)p0=e,YK(e,Q,X),e=e.sibling;p0=J,uY=g,C6=u,oG(z,Q,X);continue}}if((J.subtreeFlags&HX)!==G1&&$!==null)$.return=J,p0=$;else oG(z,Q,X)}}function oG(z,Q,X){while(p0!==null){var Z=p0;if((Z.flags&HX)!==G1){var J=Z.alternate;m4(Z);try{kF(Q,J,Z,X)}catch(H){N4(Z,Z.return,H)}_6()}if(Z===z){p0=null;return}var $=Z.sibling;if($!==null){$.return=Z.return,p0=$;return}p0=Z.return}}function mF(z){while(p0!==null){var Q=p0,X=Q.child;switch(Q.tag){case L:case v:case n:case p:{if(Q.mode&X4)try{W7(),a5(J6,Q,Q.return)}finally{O7(Q)}else a5(J6,Q,Q.return);break}case _:{NQ(Q,Q.return);var Z=Q.stateNode;if(typeof Z.componentWillUnmount==="function")cG(Q,Q.return,Z);break}case w:{NQ(Q,Q.return);break}case j:{var J=Q.memoizedState!==null;if(J){$K(z);continue}break}}if(X!==null)X.return=Q,p0=X;else $K(z)}}function $K(z){while(p0!==null){var Q=p0;if(Q===z){p0=null;return}var X=Q.sibling;if(X!==null){X.return=Q.return,p0=X;return}p0=Q.return}}function uF(z){while(p0!==null){var Q=p0,X=Q.child;if(Q.tag===j){var Z=Q.memoizedState!==null;if(Z){HK(z);continue}}if(X!==null)X.return=Q,p0=X;else HK(z)}}function HK(z){while(p0!==null){var Q=p0;m4(Q);try{TF(Q)}catch(Z){N4(Q,Q.return,Z)}if(_6(),Q===z){p0=null;return}var X=Q.sibling;if(X!==null){X.return=Q.return,p0=X;return}p0=Q.return}}function gF(z,Q,X,Z){p0=Q,xF(Q,z,X,Z)}function xF(z,Q,X,Z){while(p0!==null){var J=p0,$=J.child;if((J.subtreeFlags&gz)!==G1&&$!==null)$.return=J,p0=$;else jF(z,Q,X,Z)}}function jF(z,Q,X,Z){while(p0!==null){var J=p0;if((J.flags&u5)!==G1){m4(J);try{pF(Q,J,X,Z)}catch(H){N4(J,J.return,H)}_6()}if(J===z){p0=null;return}var $=J.sibling;if($!==null){$.return=J.return,p0=$;return}p0=J.return}}function pF(z,Q,X,Z){switch(Q.tag){case L:case v:case p:{if(Q.mode&X4){KG();try{w8(k6|Z6,Q)}finally{UG(Q)}}else w8(k6|Z6,Q);break}}}function dF(z){p0=z,cF()}function cF(){while(p0!==null){var z=p0,Q=z.child;if((p0.flags&g8)!==G1){var X=z.deletions;if(X!==null){for(var Z=0;Z<X.length;Z++){var J=X[Z];p0=J,oF(J,z)}{var $=z.alternate;if($!==null){var H=$.child;if(H!==null){$.child=null;do{var B=H.sibling;H.sibling=null,H=B}while(H!==null)}}}p0=z}}if((z.subtreeFlags&gz)!==G1&&Q!==null)Q.return=z,p0=Q;else lF()}}function lF(){while(p0!==null){var z=p0;if((z.flags&u5)!==G1)m4(z),iF(z),_6();var Q=z.sibling;if(Q!==null){Q.return=z.return,p0=Q;return}p0=z.return}}function iF(z){switch(z.tag){case L:case v:case p:{if(z.mode&X4)KG(),a5(k6|Z6,z,z.return),UG(z);else a5(k6|Z6,z,z.return);break}}}function oF(z,Q){while(p0!==null){var X=p0;m4(X),nF(X,Q),_6();var Z=X.child;if(Z!==null)Z.return=X,p0=Z;else aF(z)}}function aF(z){while(p0!==null){var Q=p0,X=Q.sibling,Z=Q.return;if(eU(Q),Q===z){p0=null;return}if(X!==null){X.return=Z,p0=X;return}p0=Z}}function nF(z,Q){switch(z.tag){case L:case v:case p:{if(z.mode&X4)KG(),a5(k6,z,Q),UG(z);else a5(k6,z,Q);break}}}function rF(z){switch(z.tag){case L:case v:case p:{try{w8(J6|Z6,z)}catch(X){N4(z,z.return,X)}break}case _:{var Q=z.stateNode;try{Q.componentDidMount()}catch(X){N4(z,z.return,X)}break}}}function tF(z){switch(z.tag){case L:case v:case p:{try{w8(k6|Z6,z)}catch(Q){N4(z,z.return,Q)}break}}}function sF(z){switch(z.tag){case L:case v:case p:{try{a5(J6|Z6,z,z.return)}catch(X){N4(z,z.return,X)}break}case _:{var Q=z.stateNode;if(typeof Q.componentWillUnmount==="function")cG(z,z.return,Q);break}}}function eF(z){switch(z.tag){case L:case v:case p:try{a5(k6|Z6,z,z.return)}catch(Q){N4(z,z.return,Q)}}}var zM=0,QM=1,XM=2,ZM=3,JM=4;if(typeof Symbol==="function"&&Symbol.for){var OZ=Symbol.for;zM=OZ("selector.component"),QM=OZ("selector.has_pseudo_class"),XM=OZ("selector.role"),ZM=OZ("selector.test_id"),JM=OZ("selector.text")}var YM=[];function $M(){YM.forEach(function(z){return z()})}var HM=Y.ReactCurrentActQueue;function GM(z){{var Q=typeof IS_REACT_ACT_ENVIRONMENT<"u"?IS_REACT_ACT_ENVIRONMENT:void 0,X=typeof jest<"u";return X&&Q!==!1}}function GK(){{var z=typeof IS_REACT_ACT_ENVIRONMENT<"u"?IS_REACT_ACT_ENVIRONMENT:void 0;if(!z&&HM.current!==null)q("The current testing environment is not configured to support act(...)");return z}}var qM=Math.ceil,aG=Y.ReactCurrentDispatcher,nG=Y.ReactCurrentOwner,S6=Y.ReactCurrentBatchConfig,t5=Y.ReactCurrentActQueue,H6=0,qK=1,f6=2,C5=4,x7=0,WZ=1,qz=2,xY=3,LZ=4,BK=5,rG=6,u1=H6,r6=null,u4=null,G6=N0,_7=N0,tG=B8(N0),q6=x7,_Z=null,sG=N0,jY=N0,RZ=N0,pY=N0,NZ=null,$5=null,eG=0,UK=500,KK=1/0,BM=500,j7=null;function wZ(){KK=R6()+BM}function OK(){return KK}var dY=!1,z9=null,wQ=null,Bz=!1,F8=null,bZ=N0,Q9=[],X9=null,UM=50,FZ=0,Z9=null,J9=!1,cY=!1,KM=50,bQ=0,lY=null,MZ=A4,iY=N0,WK=!1;function oY(){return r6}function t6(){if((u1&(f6|C5))!==H6)return R6();if(MZ!==A4)return MZ;return MZ=R6(),MZ}function M8(z){var Q=z.mode;if((Q&m1)===Y1)return L1;else if((u1&f6)!==H6&&G6!==N0)return WX(G6);var X=Zb()!==Xb;if(X){if(S6.transition!==null){var Z=S6.transition;if(!Z._updatedFibers)Z._updatedFibers=new Set;Z._updatedFibers.add(z)}if(iY===w6)iY=o2();return iY}var J=x5();if(J!==w6)return J;var $=jN();return $}function OM(z){var Q=z.mode;if((Q&m1)===Y1)return L1;return U_()}function B6(z,Q,X,Z){if(mM(),WK)q("useInsertionEffect must not schedule updates.");if(J9)cY=!0;if(LX(z,X,Z),(u1&f6)!==N0&&z===r6)xM(Q);else{if(g5)r2(z,Q,X);if(jM(Q),z===r6){if((u1&f6)===H6)RZ=A1(RZ,X);if(q6===LZ)P8(z,G6)}if(H5(z,Z),X===L1&&u1===H6&&(Q.mode&m1)===Y1&&!t5.isBatchingLegacy)wZ(),OB()}}function WM(z,Q,X){var Z=z.current;Z.lanes=Q,LX(z,Q,X),H5(z,X)}function LM(z){return(u1&f6)!==H6}function H5(z,Q){var X=z.callbackNode;Y_(z,Q);var Z=UJ(z,z===r6?G6:N0);if(Z===N0){if(X!==null)SK(X);z.callbackNode=null,z.callbackPriority=w6;return}var J=a8(Z),$=z.callbackPriority;if($===J&&!(t5.current!==null&&X!==U9)){if(X==null&&$!==L1)q("Expected scheduled callback to exist. This error is likely caused by a bug in React. Please file an issue.");return}if(X!=null)SK(X);var H;if(J===L1){if(z.tag===U8){if(t5.isBatchingLegacy!==null)t5.didScheduleLegacyUpdate=!0;gw(RK.bind(null,z))}else KB(RK.bind(null,z));if(t5.current!==null)t5.current.push(K8);else dN(function(){if((u1&(f6|C5))===H6)K8()});H=null}else{var B;switch(e2(Z)){case O5:B=HJ;break;case f7:B=s3;break;case h7:B=c8;break;case LJ:B=e3;break;default:B=c8;break}H=K9(B,LK.bind(null,z))}z.callbackPriority=J,z.callbackNode=H}function LK(z,Q){if(Cb(),MZ=A4,iY=N0,(u1&(f6|C5))!==H6)throw Error("Should not already be working.");var X=z.callbackNode,Z=d7();if(Z){if(z.callbackNode!==X)return null}var J=UJ(z,z===r6?G6:N0);if(J===N0)return null;var $=!KJ(z,J)&&!B_(z,J)&&!Q,H=$?IM(z,J):nY(z,J);if(H!==x7){if(H===qz){var B=F$(z);if(B!==N0)J=B,H=Y9(z,B)}if(H===WZ){var K=_Z;throw Uz(z,N0),P8(z,J),H5(z,R6()),K}if(H===rG)P8(z,J);else{var N=!KJ(z,J),P=z.current.alternate;if(N&&!RM(P)){if(H=nY(z,J),H===qz){var g=F$(z);if(g!==N0)J=g,H=Y9(z,g)}if(H===WZ){var u=_Z;throw Uz(z,N0),P8(z,J),H5(z,R6()),u}}z.finishedWork=P,z.finishedLanes=J,_M(z,H,J)}}if(H5(z,R6()),z.callbackNode===X)return LK.bind(null,z);return null}function Y9(z,Q){var X=NZ;if(_J(z)){var Z=Uz(z,Q);Z.flags|=k7,hw(z.containerInfo)}var J=nY(z,Q);if(J!==qz){var $=$5;if($5=X,$!==null)_K($)}return J}function _K(z){if($5===null)$5=z;else $5.push.apply($5,z)}function _M(z,Q,X){switch(Q){case x7:case WZ:throw Error("Root did not complete. This is a bug in React.");case qz:{Kz(z,$5,j7);break}case xY:{if(P8(z,X),l2(X)&&!fK()){var Z=eG+UK-R6();if(Z>10){var J=UJ(z,N0);if(J!==N0)break;var $=z.suspendedLanes;if(!cz($,X)){var H=t6();n2(z,$);break}z.timeoutHandle=QH(Kz.bind(null,z,$5,j7),Z);break}}Kz(z,$5,j7);break}case LZ:{if(P8(z,X),q_(X))break;if(!fK()){var B=Z_(z,X),K=B,N=R6()-K,P=EM(N)-N;if(P>10){z.timeoutHandle=QH(Kz.bind(null,z,$5,j7),P);break}}Kz(z,$5,j7);break}case BK:{Kz(z,$5,j7);break}default:throw Error("Unknown root exit status.")}}function RM(z){var Q=z;while(!0){if(Q.flags&YJ){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],H=$.getSnapshot,B=$.value;try{if(!L5(H(),B))return!1}catch(N){return!1}}}}var K=Q.child;if(Q.subtreeFlags&YJ&&K!==null){K.return=Q,Q=K;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 P8(z,Q){Q=OJ(Q,pY),Q=OJ(Q,RZ),O_(z,Q)}function RK(z){if(vb(),(u1&(f6|C5))!==H6)throw Error("Should not already be working.");d7();var Q=UJ(z,N0);if(!K5(Q,L1))return H5(z,R6()),null;var X=nY(z,Q);if(z.tag!==U8&&X===qz){var Z=F$(z);if(Z!==N0)Q=Z,X=Y9(z,Z)}if(X===WZ){var J=_Z;throw Uz(z,N0),P8(z,Q),H5(z,R6()),J}if(X===rG)throw Error("Root did not complete. This is a bug in React.");var $=z.current.alternate;return z.finishedWork=$,z.finishedLanes=Q,Kz(z,$5,j7),H5(z,R6()),null}function NM(z,Q){if(Q!==N0){if(I$(z,A1(Q,L1)),H5(z,R6()),(u1&(f6|C5))===H6)wZ(),K8()}}function $9(z,Q){var X=u1;u1|=qK;try{return z(Q)}finally{if(u1=X,u1===H6&&!t5.isBatchingLegacy)wZ(),OB()}}function wM(z,Q,X,Z,J){var $=x5(),H=S6.transition;try{return S6.transition=null,b6(O5),z(Q,X,Z,J)}finally{if(b6($),S6.transition=H,u1===H6)wZ()}}function p7(z){if(F8!==null&&F8.tag===U8&&(u1&(f6|C5))===H6)d7();var Q=u1;u1|=qK;var X=S6.transition,Z=x5();try{if(S6.transition=null,b6(O5),z)return z();else return}finally{if(b6(Z),S6.transition=X,u1=Q,(u1&(f6|C5))===H6)K8()}}function NK(){return(u1&(f6|C5))!==H6}function aY(z,Q){x6(tG,_7,z),_7=A1(_7,Q),sG=A1(sG,Q)}function H9(z){_7=tG.current,g6(tG,z)}function Uz(z,Q){z.finishedWork=null,z.finishedLanes=N0;var X=z.timeoutHandle;if(X!==XH)z.timeoutHandle=XH,pN(X);if(u4!==null){var Z=u4.return;while(Z!==null){var J=Z.alternate;iU(J,Z),Z=Z.return}}r6=z;var $=Oz(z.current,null);return u4=$,G6=_7=sG=Q,q6=x7,_Z=null,jY=N0,RZ=N0,pY=N0,NZ=null,$5=null,Bb(),d5.discardPendingWarnings(),$}function wK(z,Q){do{var X=u4;try{if(XY(),pB(),_6(),nG.current=null,X===null||X.return===null){q6=WZ,_Z=Q,u4=null;return}if(v0&&X.mode&X4)yY(X,!0);if(P0)if(xz(),Q!==null&&typeof Q==="object"&&typeof Q.then==="function"){var Z=Q;lL(X,Z,G6)}else cL(X,Q,G6);ub(z,X.return,X,Q,G6),PK(X)}catch(J){if(Q=J,u4===X&&X!==null)X=X.return,u4=X;else X=u4;continue}return}while(!0)}function bK(){var z=aG.current;if(aG.current=CY,z===null)return CY;else return z}function FK(z){aG.current=z}function bM(){eG=R6()}function PZ(z){jY=A1(z,jY)}function FM(){if(q6===x7)q6=xY}function G9(){if(q6===x7||q6===xY||q6===qz)q6=LZ;if(r6!==null&&(M$(jY)||M$(RZ)))P8(r6,G6)}function MM(z){if(q6!==LZ)q6=qz;if(NZ===null)NZ=[z];else NZ.push(z)}function PM(){return q6===x7}function nY(z,Q){var X=u1;u1|=f6;var Z=bK();if(r6!==z||G6!==Q){if(g5){var J=z.memoizedUpdaters;if(J.size>0)AZ(z,G6),J.clear();t2(z,Q)}j7=s2(),Uz(z,Q)}x2(Q);do try{AM();break}catch($){wK(z,$)}while(!0);if(XY(),u1=X,FK(Z),u4!==null)throw Error("Cannot commit an incomplete root. This error is likely caused by a bug in React. Please file an issue.");return j2(),r6=null,G6=N0,q6}function AM(){while(u4!==null)MK(u4)}function IM(z,Q){var X=u1;u1|=f6;var Z=bK();if(r6!==z||G6!==Q){if(g5){var J=z.memoizedUpdaters;if(J.size>0)AZ(z,G6),J.clear();t2(z,Q)}j7=s2(),wZ(),Uz(z,Q)}x2(Q);do try{kM();break}catch($){wK(z,$)}while(!0);if(XY(),FK(Z),u1=X,u4!==null)return rL(),x7;else return j2(),r6=null,G6=N0,q6}function kM(){while(u4!==null&&!AL())MK(u4)}function MK(z){var Q=z.alternate;m4(z);var X;if((z.mode&X4)!==Y1)BG(z),X=q9(Q,z,_7),yY(z,!0);else X=q9(Q,z,_7);if(_6(),z.memoizedProps=z.pendingProps,X===null)PK(z);else u4=X;nG.current=null}function PK(z){var Q=z;do{var{alternate:X,return:Z}=Q;if((Q.flags&$X)===G1){m4(Q);var J=void 0;if((Q.mode&X4)===Y1)J=lU(X,Q,_7);else BG(Q),J=lU(X,Q,_7),yY(Q,!1);if(_6(),J!==null){u4=J;return}}else{var $=_F(X,Q);if($!==null){$.flags&=NL,u4=$;return}if((Q.mode&X4)!==Y1){yY(Q,!1);var{actualDuration:H,child:B}=Q;while(B!==null)H+=B.actualDuration,B=B.sibling;Q.actualDuration=H}if(Z!==null)Z.flags|=$X,Z.subtreeFlags=G1,Z.deletions=null;else{q6=rG,u4=null;return}}var K=Q.sibling;if(K!==null){u4=K;return}Q=Z,u4=Q}while(Q!==null);if(q6===x7)q6=BK}function Kz(z,Q,X){var Z=x5(),J=S6.transition;try{S6.transition=null,b6(O5),TM(z,Q,X,Z)}finally{S6.transition=J,b6(Z)}return null}function TM(z,Q,X,Z){do d7();while(F8!==null);if(uM(),(u1&(f6|C5))!==H6)throw Error("Should not already be working.");var{finishedWork:J,finishedLanes:$}=z;if(mL($),J===null)return m2(),null;else if($===N0)q("root.finishedLanes should not be empty during a commit. This is a bug in React.");if(z.finishedWork=null,z.finishedLanes=N0,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=w6;var H=A1(J.lanes,J.childLanes);if(W_(z,H),z===r6)r6=null,u4=null,G6=N0;if((J.subtreeFlags&gz)!==G1||(J.flags&gz)!==G1){if(!Bz)Bz=!0,X9=X,K9(c8,function(){return d7(),null})}var B=(J.subtreeFlags&(r3|t3|HX|gz))!==G1,K=(J.flags&(r3|t3|HX|gz))!==G1;if(B||K){var N=S6.transition;S6.transition=null;var P=x5();b6(O5);var g=u1;u1|=C5,nG.current=null;var u=FF(z,J);OU(),DF(z,J,$),DN(z.containerInfo),z.current=J,iL($),EF(J,z,$),oL(),IL(),u1=g,b6(P),S6.transition=N}else z.current=J,OU();var e=Bz;if(Bz)Bz=!1,F8=z,bZ=$;else bQ=0,lY=null;if(H=z.pendingLanes,H===N0)wQ=null;if(!e)TK(z.current,!1);if(hL(J.stateNode,Z),g5)z.memoizedUpdaters.clear();if($M(),H5(z,R6()),Q!==null){var z0=z.onRecoverableError;for(var Y0=0;Y0<Q.length;Y0++){var h0=Q[Y0],e0=h0.stack,o0=h0.digest;z0(h0.value,{componentStack:e0,digest:o0})}}if(dY){dY=!1;var h1=z9;throw z9=null,h1}if(K5(bZ,L1)&&z.tag!==U8)d7();if(H=z.pendingLanes,K5(H,L1))if(Tb(),z===Z9)FZ++;else FZ=0,Z9=z;else FZ=0;return K8(),m2(),null}function d7(){if(F8!==null){var z=e2(bZ),Q=N_(h7,z),X=S6.transition,Z=x5();try{return S6.transition=null,b6(Q),vM()}finally{b6(Z),S6.transition=X}}return!1}function CM(z){if(Q9.push(z),!Bz)Bz=!0,K9(c8,function(){return d7(),null})}function vM(){if(F8===null)return!1;var z=X9;X9=null;var Q=F8,X=bZ;if(F8=null,bZ=N0,(u1&(f6|C5))!==H6)throw Error("Cannot flush passive effects while already rendering.");J9=!0,cY=!1,aL(X);var Z=u1;u1|=C5,dF(Q.current),gF(Q,Q.current,X,z);{var J=Q9;Q9=[];for(var $=0;$<J.length;$++){var H=J[$];IF(Q,H)}}nL(),TK(Q.current,!0),u1=Z,K8();{if(cY)if(Q===lY)bQ++;else bQ=0,lY=Q;else bQ=0;J9=!1,cY=!1}yL(Q);{var B=Q.current.stateNode;B.effectDuration=0,B.passiveEffectDuration=0}return!0}function AK(z){return wQ!==null&&wQ.has(z)}function SM(z){if(wQ===null)wQ=new Set([z]);else wQ.add(z)}function fM(z){if(!dY)dY=!0,z9=z}var hM=fM;function IK(z,Q,X){var Z=Hz(X,Q),J=FU(z,Z,L1),$=W8(z,J,L1),H=t6();if($!==null)LX($,L1,H),H5($,H)}function N4(z,Q,X){if(NF(X),IZ(!1),z.tag===I){IK(z,z,X);return}var Z=null;Z=Q;while(Z!==null){if(Z.tag===I){IK(Z,z,X);return}else if(Z.tag===_){var{type:J,stateNode:$}=Z;if(typeof J.getDerivedStateFromError==="function"||typeof $.componentDidCatch==="function"&&!AK($)){var H=Hz(X,z),B=CG(Z,H,L1),K=W8(Z,B,L1),N=t6();if(K!==null)LX(K,L1,N),H5(K,N);return}}Z=Z.return}q(`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 yM(z,Q,X){var Z=z.pingCache;if(Z!==null)Z.delete(Q);var J=t6();if(n2(z,X),pM(z),r6===z&&cz(G6,X))if(q6===LZ||q6===xY&&l2(G6)&&R6()-eG<UK)Uz(z,N0);else pY=A1(pY,X);H5(z,J)}function kK(z,Q){if(Q===w6)Q=OM(z);var X=t6(),Z=J5(z,Q);if(Z!==null)LX(Z,Q,X),H5(Z,X)}function VM(z){var Q=z.memoizedState,X=w6;if(Q!==null)X=Q.retryLane;kK(z,X)}function DM(z,Q){var X=w6,Z;switch(z.tag){case D:Z=z.stateNode;var J=z.memoizedState;if(J!==null)X=J.retryLane;break;case t: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);kK(z,X)}function EM(z){return z<120?120:z<480?480:z<1080?1080:z<1920?1920:z<3000?3000:z<4320?4320:qM(z/1960)*1960}function mM(){if(FZ>UM)throw FZ=0,Z9=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(bQ>KM)bQ=0,lY=null,q("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 uM(){d5.flushLegacyContextWarning(),d5.flushPendingUnsafeLifecycleWarnings()}function TK(z,Q){{if(m4(z),rY(z,C7,sF),Q)rY(z,$J,eF);if(rY(z,C7,rF),Q)rY(z,$J,tF);_6()}}function rY(z,Q,X){{var Z=z,J=null;while(Z!==null){var $=Z.subtreeFlags&Q;if(Z!==J&&Z.child!==null&&$!==G1)Z=Z.child;else{if((Z.flags&Q)!==G1)X(Z);if(Z.sibling!==null)Z=Z.sibling;else Z=J=Z.return}}}}var tY=null;function CK(z){{if((u1&f6)!==H6)return;if(!(z.mode&m1))return;var Q=z.tag;if(Q!==k&&Q!==I&&Q!==_&&Q!==L&&Q!==v&&Q!==n&&Q!==p)return;var X=M1(z)||"ReactComponent";if(tY!==null){if(tY.has(X))return;tY.add(X)}else tY=new Set([X]);var Z=u6;try{m4(z),q("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)m4(z);else _6()}}}var q9;{var gM=null;q9=function(z,Q,X){var Z=EK(gM,Q);try{return xU(z,Q,X)}catch($){if(ow()||$!==null&&typeof $==="object"&&typeof $.then==="function")throw $;if(XY(),pB(),iU(z,Q),EK(Q,Z),Q.mode&X4)BG(Q);if(c3(null,xU,null,z,Q,X),WL()){var J=l3();if(typeof J==="object"&&J!==null&&J._suppressLogging&&typeof $==="object"&&$!==null&&!$._suppressLogging)$._suppressLogging=!0}throw $}}}var vK=!1,B9;B9=new Set;function xM(z){if(D8&&!Ab())switch(z.tag){case L:case v:case p:{var Q=u4&&M1(u4)||"Unknown",X=Q;if(!B9.has(X)){B9.add(X);var Z=M1(z)||"Unknown";q("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 _:{if(!vK)q("Cannot update during an existing state transition (such as within `render`). Render methods should be a pure function of props and state."),vK=!0;break}}}function AZ(z,Q){if(g5){var X=z.memoizedUpdaters;X.forEach(function(Z){r2(z,Z,Q)})}}var U9={};function K9(z,Q){{var X=t5.current;if(X!==null)return X.push(Q),U9;else return E2(z,Q)}}function SK(z){if(z===U9)return;return PL(z)}function fK(){return t5.current!==null}function jM(z){{if(z.mode&m1){if(!GK())return}else{if(!GM())return;if(u1!==H6)return;if(z.tag!==L&&z.tag!==v&&z.tag!==p)return}if(t5.current===null){var Q=u6;try{m4(z),q(`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`,M1(z))}finally{if(Q)m4(z);else _6()}}}}function pM(z){if(z.tag!==U8&&GK()&&t5.current===null)q(`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 IZ(z){WK=z}var v5=null,FQ=null,dM=function(z){v5=z};function MQ(z){{if(v5===null)return z;var Q=v5(z);if(Q===void 0)return z;return Q.current}}function O9(z){return MQ(z)}function W9(z){{if(v5===null)return z;var Q=v5(z);if(Q===void 0){if(z!==null&&z!==void 0&&typeof z.render==="function"){var X=MQ(z.render);if(z.render!==X){var Z={$$typeof:x,render:X};if(z.displayName!==void 0)Z.displayName=z.displayName;return Z}}return z}return Q.current}}function hK(z,Q){{if(v5===null)return!1;var X=z.elementType,Z=Q.type,J=!1,$=typeof Z==="object"&&Z!==null?Z.$$typeof:null;switch(z.tag){case _:{if(typeof Z==="function")J=!0;break}case L:{if(typeof Z==="function")J=!0;else if($===i0)J=!0;break}case v:{if($===x)J=!0;else if($===i0)J=!0;break}case n:case p:{if($===S0)J=!0;else if($===i0)J=!0;break}default:return!1}if(J){var H=v5(X);if(H!==void 0&&H===v5(Z))return!0}return!1}}function yK(z){{if(v5===null)return;if(typeof WeakSet!=="function")return;if(FQ===null)FQ=new WeakSet;FQ.add(z)}}var cM=function(z,Q){{if(v5===null)return;var{staleFamilies:X,updatedFamilies:Z}=Q;d7(),p7(function(){L9(z.current,Z,X)})}},lM=function(z,Q){{if(z.context!==_5)return;d7(),p7(function(){kZ(Q,z,null,null)})}};function L9(z,Q,X){{var{alternate:Z,child:J,sibling:$,tag:H,type:B}=z,K=null;switch(H){case L:case p:case _:K=B;break;case v:K=B.render;break}if(v5===null)throw Error("Expected resolveFamily to be set during hot reload.");var N=!1,P=!1;if(K!==null){var g=v5(K);if(g!==void 0){if(X.has(g))P=!0;else if(Q.has(g))if(H===_)P=!0;else N=!0}}if(FQ!==null){if(FQ.has(z)||Z!==null&&FQ.has(Z))P=!0}if(P)z._debugNeedsRemount=!0;if(P||N){var u=J5(z,L1);if(u!==null)B6(u,z,L1,A4)}if(J!==null&&!P)L9(J,Q,X);if($!==null)L9($,Q,X)}}var iM=function(z,Q){{var X=new Set,Z=new Set(Q.map(function(J){return J.current}));return _9(z.current,Z,X),X}};function _9(z,Q,X){{var{child:Z,sibling:J,tag:$,type:H}=z,B=null;switch($){case L:case p:case _:B=H;break;case v:B=H.render;break}var K=!1;if(B!==null){if(Q.has(B))K=!0}if(K)oM(z,X);else if(Z!==null)_9(Z,Q,X);if(J!==null)_9(J,Q,X)}}function oM(z,Q){{var X=aM(z,Q);if(X)return;var Z=z;while(!0){switch(Z.tag){case w:Q.add(Z.stateNode);return;case F:Q.add(Z.stateNode.containerInfo);return;case I:Q.add(Z.stateNode.containerInfo);return}if(Z.return===null)throw Error("Expected to reach root first.");Z=Z.return}}}function aM(z,Q){{var X=z,Z=!1;while(!0){if(X.tag===w)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 R9;{R9=!1;try{var VK=Object.preventExtensions({})}catch(z){R9=!0}}function nM(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=G1,this.subtreeFlags=G1,this.deletions=null,this.lanes=N0,this.childLanes=N0,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,!R9&&typeof Object.preventExtensions==="function")Object.preventExtensions(this)}var R5=function(z,Q,X,Z){return new nM(z,Q,X,Z)};function N9(z){var Q=z.prototype;return!!(Q&&Q.isReactComponent)}function rM(z){return typeof z==="function"&&!N9(z)&&z.defaultProps===void 0}function tM(z){if(typeof z==="function")return N9(z)?_:L;else if(z!==void 0&&z!==null){var Q=z.$$typeof;if(Q===x)return v;if(Q===S0)return n}return k}function Oz(z,Q){var X=z.alternate;if(X===null)X=R5(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=G1,X.subtreeFlags=G1,X.deletions=null,X.actualDuration=0,X.actualStartTime=-1;X.flags=z.flags&v7,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 k:case L:case p:X.type=MQ(z.type);break;case _:X.type=O9(z.type);break;case v:X.type=W9(z.type);break}return X}function sM(z,Q){z.flags&=v7|e4;var X=z.alternate;if(X===null)z.childLanes=N0,z.lanes=Q,z.child=null,z.subtreeFlags=G1,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=G1,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 eM(z,Q,X){var Z;if(z===iJ){if(Z=m1,Q===!0)Z|=d4,Z|=$7}else Z=Y1;if(g5)Z|=X4;return R5(I,null,null,Z)}function w9(z,Q,X,Z,J,$){var H=k,B=z;if(typeof z==="function")if(N9(z))H=_,B=O9(B);else B=MQ(B);else if(typeof z==="string")H=w;else z:switch(z){case d1:return A8(X.children,J,$,Q);case h:if(H=f,J|=d4,(J&m1)!==Y1)J|=$7;break;case H0:return zP(X,J,$,Q);case O0:return QP(X,J,$,Q);case M0:return XP(X,J,$,Q);case k0:return DK(X,J,$,Q);case n0:case g0:case D1:case e1:case W0:default:{if(typeof z==="object"&&z!==null)switch(z.$$typeof){case R0:H=V;break z;case A:H=E;break z;case x:H=v,B=W9(B);break z;case S0:H=n;break z;case i0:H=r,B=null;break z}var K="";{if(z===void 0||typeof z==="object"&&z!==null&&Object.keys(z).length===0)K+=" 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 N=Z?M1(Z):null;if(N)K+=`
138
+
139
+ Check the render method of \``+N+"`."}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)+"."+K))}}var P=R5(H,X,Q,J);return P.elementType=z,P.type=B,P.lanes=$,P._debugOwner=Z,P}function b9(z,Q,X){var Z=null;Z=z._owner;var{type:J,key:$,props:H}=z,B=w9(J,$,H,Z,Q,X);return B._debugSource=z._source,B._debugOwner=z._owner,B}function A8(z,Q,X,Z){var J=R5(C,z,Z,Q);return J.lanes=X,J}function zP(z,Q,X,Z){if(typeof z.id!=="string")q('Profiler must specify an "id" of type `string` as a prop. Received the type `%s` instead.',typeof z.id);var J=R5(T,z,Z,Q|X4);return J.elementType=H0,J.lanes=X,J.stateNode={effectDuration:0,passiveEffectDuration:0},J}function QP(z,Q,X,Z){var J=R5(D,z,Z,Q);return J.elementType=O0,J.lanes=X,J}function XP(z,Q,X,Z){var J=R5(t,z,Z,Q);return J.elementType=M0,J.lanes=X,J}function DK(z,Q,X,Z){var J=R5(j,z,Z,Q);J.elementType=k0,J.lanes=X;var $={isHidden:!1};return J.stateNode=$,J}function F9(z,Q,X){var Z=R5(b,z,null,Q);return Z.lanes=X,Z}function ZP(){var z=R5(w,null,null,Y1);return z.elementType="DELETED",z}function JP(z){var Q=R5(i,null,null,Y1);return Q.stateNode=z,Q}function M9(z,Q,X){var Z=z.children!==null?z.children:[],J=R5(F,Z,z.key,Q);return J.lanes=X,J.stateNode={containerInfo:z.containerInfo,pendingChildren:null,implementation:z.implementation},J}function EK(z,Q){if(z===null)z=R5(k,null,null,Y1);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 YP(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=XH,this.context=null,this.pendingContext=null,this.callbackNode=null,this.callbackPriority=w6,this.eventTimes=A$(N0),this.expirationTimes=A$(A4),this.pendingLanes=N0,this.suspendedLanes=N0,this.pingedLanes=N0,this.expiredLanes=N0,this.mutableReadLanes=N0,this.finishedLanes=N0,this.entangledLanes=N0,this.entanglements=A$(N0),this.identifierPrefix=Z,this.onRecoverableError=J,this.mutableSourceEagerHydrationData=null,this.effectDuration=0,this.passiveEffectDuration=0;{this.memoizedUpdaters=new Set;var $=this.pendingUpdatersLaneMap=[];for(var H=0;H<Q$;H++)$.push(new Set)}switch(Q){case iJ:this._debugRootType=X?"hydrateRoot()":"createRoot()";break;case U8:this._debugRootType=X?"hydrate()":"render()";break}}function mK(z,Q,X,Z,J,$,H,B,K,N){var P=new YP(z,Q,X,B,K),g=eM(Q,$);P.current=g,g.stateNode=P;{var u={element:Z,isDehydrated:X,cache:null,transitions:null,pendingSuspenseBoundaries:null};g.memoizedState=u}return yH(g),P}var P9="18.3.1";function $P(z,Q,X){var Z=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;return o4(Z),{$$typeof:B4,key:Z==null?null:""+Z,children:z,containerInfo:Q,implementation:X}}var A9,I9;A9=!1,I9={};function uK(z){if(!z)return _5;var Q=mz(z),X=uw(Q);if(Q.tag===_){var Z=Q.type;if(q7(Z))return BB(Q,Z,X)}return X}function HP(z,Q){{var X=mz(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=y2(X);if(J===null)return null;if(J.mode&d4){var $=M1(X)||"Component";if(!I9[$]){I9[$]=!0;var H=u6;try{if(m4(J),X.mode&d4)q("%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 q("%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(H)m4(H);else _6()}}}return J.stateNode}}function gK(z,Q,X,Z,J,$,H,B){var K=!1,N=null;return mK(z,Q,K,N,X,Z,J,$,H)}function xK(z,Q,X,Z,J,$,H,B,K,N){var P=!0,g=mK(X,Z,P,z,J,$,H,B,K);g.context=uK(null);var u=g.current,e=t6(),z0=M8(u),Y0=u7(e,z0);return Y0.callback=Q!==void 0&&Q!==null?Q:null,W8(u,Y0,z0),WM(g,z0,e),g}function kZ(z,Q,X,Z){fL(Q,z);var J=Q.current,$=t6(),H=M8(J);tL(H);var B=uK(X);if(Q.context===null)Q.context=B;else Q.pendingContext=B;if(D8&&u6!==null&&!A9)A9=!0,q(`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.`,M1(u6)||"Unknown");var K=u7($,H);if(K.payload={element:z},Z=Z===void 0?null:Z,Z!==null){if(typeof Z!=="function")q("render(...): Expected the last optional `callback` argument to be a function. Instead received: %s.",Z);K.callback=Z}var N=W8(J,K,H);if(N!==null)B6(N,J,H,$),HY(N,J,H);return H}function sY(z){var Q=z.current;if(!Q.child)return null;switch(Q.child.tag){case w:return e$(Q.child.stateNode);default:return Q.child.stateNode}}function GP(z){switch(z.tag){case I:{var Q=z.stateNode;if(_J(Q)){var X=$_(Q);NM(Q,X)}break}case D:{p7(function(){var J=J5(z,L1);if(J!==null){var $=t6();B6(J,z,L1,$)}});var Z=L1;k9(z,Z);break}}}function jK(z,Q){var X=z.memoizedState;if(X!==null&&X.dehydrated!==null)X.retryLane=K_(X.retryLane,Q)}function k9(z,Q){jK(z,Q);var X=z.alternate;if(X)jK(X,Q)}function qP(z){if(z.tag!==D)return;var Q=UX,X=J5(z,Q);if(X!==null){var Z=t6();B6(X,z,Q,Z)}k9(z,Q)}function BP(z){if(z.tag!==D)return;var Q=M8(z),X=J5(z,Q);if(X!==null){var Z=t6();B6(X,z,Q,Z)}k9(z,Q)}function pK(z){var Q=ML(z);if(Q===null)return null;return Q.stateNode}var dK=function(z){return null};function UP(z){return dK(z)}var cK=function(z){return!1};function KP(z){return cK(z)}var lK=null,iK=null,oK=null,aK=null,nK=null,rK=null,tK=null,sK=null,eK=null;{var zO=function(z,Q,X){var Z=Q[X],J=i1(z)?z.slice():T1({},z);if(X+1===Q.length){if(i1(J))J.splice(Z,1);else delete J[Z];return J}return J[Z]=zO(z[Z],Q,X+1),J},QO=function(z,Q){return zO(z,Q,0)},XO=function(z,Q,X,Z){var J=Q[Z],$=i1(z)?z.slice():T1({},z);if(Z+1===Q.length){var H=X[Z];if($[H]=$[J],i1($))$.splice(J,1);else delete $[J]}else $[J]=XO(z[J],Q,X,Z+1);return $},ZO=function(z,Q,X){if(Q.length!==X.length){W("copyWithRename() expects paths of the same length");return}else for(var Z=0;Z<X.length-1;Z++)if(Q[Z]!==X[Z]){W("copyWithRename() expects paths to be the same except for the deepest key");return}return XO(z,Q,X,0)},JO=function(z,Q,X,Z){if(X>=Q.length)return Z;var J=Q[X],$=i1(z)?z.slice():T1({},z);return $[J]=JO(z[J],Q,X+1,Z),$},YO=function(z,Q,X){return JO(z,Q,0,X)},T9=function(z,Q){var X=z.memoizedState;while(X!==null&&Q>0)X=X.next,Q--;return X};lK=function(z,Q,X,Z){var J=T9(z,Q);if(J!==null){var $=YO(J.memoizedState,X,Z);J.memoizedState=$,J.baseState=$,z.memoizedProps=T1({},z.memoizedProps);var H=J5(z,L1);if(H!==null)B6(H,z,L1,A4)}},iK=function(z,Q,X){var Z=T9(z,Q);if(Z!==null){var J=QO(Z.memoizedState,X);Z.memoizedState=J,Z.baseState=J,z.memoizedProps=T1({},z.memoizedProps);var $=J5(z,L1);if($!==null)B6($,z,L1,A4)}},oK=function(z,Q,X,Z){var J=T9(z,Q);if(J!==null){var $=ZO(J.memoizedState,X,Z);J.memoizedState=$,J.baseState=$,z.memoizedProps=T1({},z.memoizedProps);var H=J5(z,L1);if(H!==null)B6(H,z,L1,A4)}},aK=function(z,Q,X){if(z.pendingProps=YO(z.memoizedProps,Q,X),z.alternate)z.alternate.pendingProps=z.pendingProps;var Z=J5(z,L1);if(Z!==null)B6(Z,z,L1,A4)},nK=function(z,Q){if(z.pendingProps=QO(z.memoizedProps,Q),z.alternate)z.alternate.pendingProps=z.pendingProps;var X=J5(z,L1);if(X!==null)B6(X,z,L1,A4)},rK=function(z,Q,X){if(z.pendingProps=ZO(z.memoizedProps,Q,X),z.alternate)z.alternate.pendingProps=z.pendingProps;var Z=J5(z,L1);if(Z!==null)B6(Z,z,L1,A4)},tK=function(z){var Q=J5(z,L1);if(Q!==null)B6(Q,z,L1,A4)},sK=function(z){dK=z},eK=function(z){cK=z}}function OP(z){var Q=y2(z);if(Q===null)return null;return Q.stateNode}function WP(z){return null}function LP(){return u6}function _P(z){var Q=z.findFiberByHostInstance,X=Y.ReactCurrentDispatcher;return SL({bundleType:z.bundleType,version:z.version,rendererPackageName:z.rendererPackageName,rendererConfig:z.rendererConfig,overrideHookState:lK,overrideHookStateDeletePath:iK,overrideHookStateRenamePath:oK,overrideProps:aK,overridePropsDeletePath:nK,overridePropsRenamePath:rK,setErrorHandler:sK,setSuspenseHandler:eK,scheduleUpdate:tK,currentDispatcherRef:X,findHostInstanceByFiber:OP,findFiberByHostInstance:Q||WP,findHostInstancesForRefresh:iM,scheduleRefresh:cM,scheduleRoot:lM,setRefreshHandler:dM,getCurrentFiber:LP,reconcilerVersion:P9})}var $O=typeof reportError==="function"?reportError:function(z){console.error(z)};function C9(z){this._internalRoot=z}eY.prototype.render=C9.prototype.render=function(z){var Q=this._internalRoot;if(Q===null)throw Error("Cannot update an unmounted root.");{if(typeof arguments[1]==="function")q("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(z3(arguments[1]))q("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")q("You passed a second argument to root.render(...) but it only accepts one argument.");var X=Q.containerInfo;if(X.nodeType!==s4){var Z=pK(Q.current);if(Z){if(Z.parentNode!==X)q("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.")}}}kZ(z,Q,null,null)},eY.prototype.unmount=C9.prototype.unmount=function(){if(typeof arguments[0]==="function")q("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(NK())q("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.");p7(function(){kZ(null,z,null,null)}),JB(Q)}};function RP(z,Q){if(!z3(z))throw Error("createRoot(...): Target container is not a DOM element.");HO(z);var X=!1,Z=!1,J="",$=$O,H=null;if(Q!==null&&Q!==void 0){if(Q.hydrate)W("hydrate through createRoot is deprecated. Use ReactDOMClient.hydrateRoot(container, <App />) instead.");else if(typeof Q==="object"&&Q!==null&&Q.$$typeof===s1)q(`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)H=Q.transitionCallbacks}var B=gK(z,iJ,null,X,Z,J,$);gJ(B.current,z);var K=z.nodeType===s4?z.parentNode:z;return hX(K),new C9(B)}function eY(z){this._internalRoot=z}function NP(z){if(z)v_(z)}eY.prototype.unstable_scheduleHydration=NP;function wP(z,Q,X){if(!z3(z))throw Error("hydrateRoot(...): Target container is not a DOM element.");if(HO(z),Q===void 0)q("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,H=!1,B="",K=$O;if(X!==null&&X!==void 0){if(X.unstable_strictMode===!0)$=!0;if(X.identifierPrefix!==void 0)B=X.identifierPrefix;if(X.onRecoverableError!==void 0)K=X.onRecoverableError}var N=xK(Q,null,z,iJ,Z,$,H,B,K);if(gJ(N.current,z),hX(z),J)for(var P=0;P<J.length;P++){var g=J[P];wb(N,g)}return new eY(N)}function z3(z){return!!(z&&(z.nodeType===X5||z.nodeType===I7||z.nodeType===y3||!_0))}function TZ(z){return!!(z&&(z.nodeType===X5||z.nodeType===I7||z.nodeType===y3||z.nodeType===s4&&z.nodeValue===" react-mount-point-unstable "))}function HO(z){{if(z.nodeType===X5&&z.tagName&&z.tagName.toUpperCase()==="BODY")q("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(dX(z))if(z._reactRootContainer)q("You are calling ReactDOMClient.createRoot() on a container that was previously passed to ReactDOM.render(). This is not supported.");else q("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 bP=Y.ReactCurrentOwner,GO;GO=function(z){if(z._reactRootContainer&&z.nodeType!==s4){var Q=pK(z._reactRootContainer.current);if(Q){if(Q.parentNode!==z)q("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=v9(z),J=!!(Z&&q8(Z));if(J&&!X)q("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===X5&&z.tagName&&z.tagName.toUpperCase()==="BODY")q("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 v9(z){if(!z)return null;if(z.nodeType===I7)return z.documentElement;else return z.firstChild}function qO(){}function FP(z,Q,X,Z,J){if(J){if(typeof Z==="function"){var $=Z;Z=function(){var u=sY(H);$.call(u)}}var H=xK(Q,Z,z,U8,null,!1,!1,"",qO);z._reactRootContainer=H,gJ(H.current,z);var B=z.nodeType===s4?z.parentNode:z;return hX(B),p7(),H}else{var K;while(K=z.lastChild)z.removeChild(K);if(typeof Z==="function"){var N=Z;Z=function(){var u=sY(P);N.call(u)}}var P=gK(z,U8,null,!1,!1,"",qO);z._reactRootContainer=P,gJ(P.current,z);var g=z.nodeType===s4?z.parentNode:z;return hX(g),p7(function(){kZ(Q,P,X,Z)}),P}}function MP(z,Q){if(z!==null&&typeof z!=="function")q("%s(...): Expected the last optional `callback` argument to be a function. Instead received: %s.",Q,z)}function Q3(z,Q,X,Z,J){GO(X),MP(J===void 0?null:J,"render");var $=X._reactRootContainer,H;if(!$)H=FP(X,Q,z,J,Z);else{if(H=$,typeof J==="function"){var B=J;J=function(){var K=sY(H);B.call(K)}}kZ(Q,H,z,J)}return sY(H)}var BO=!1;function PP(z){{if(!BO)BO=!0,q("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=bP.current;if(Q!==null&&Q.stateNode!==null){var X=Q.stateNode._warnedAboutRefsInRender;if(!X)q("%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.",p1(Q.type)||"A component");Q.stateNode._warnedAboutRefsInRender=!0}}if(z==null)return null;if(z.nodeType===X5)return z;return HP(z,"findDOMNode")}function AP(z,Q,X){if(q("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"),!TZ(Q))throw Error("Target container is not a DOM element.");{var Z=dX(Q)&&Q._reactRootContainer===void 0;if(Z)q("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 Q3(null,z,Q,!0,X)}function IP(z,Q,X){if(q("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"),!TZ(Q))throw Error("Target container is not a DOM element.");{var Z=dX(Q)&&Q._reactRootContainer===void 0;if(Z)q("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 Q3(null,z,Q,!1,X)}function kP(z,Q,X,Z){if(q("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"),!TZ(X))throw Error("Target container is not a DOM element.");if(z==null||!LL(z))throw Error("parentComponent must be a valid React Component");return Q3(z,Q,X,!1,Z)}var UO=!1;function TP(z){if(!UO)UO=!0,q("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(!TZ(z))throw Error("unmountComponentAtNode(...): Target container is not a DOM element.");{var Q=dX(z)&&z._reactRootContainer===void 0;if(Q)q("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=v9(z),Z=X&&!q8(X);if(Z)q("unmountComponentAtNode(): The node you're attempting to unmount was rendered by another copy of React.")}return p7(function(){Q3(null,null,z,!1,function(){z._reactRootContainer=null,JB(z)})}),!0}else{{var J=v9(z),$=!!(J&&q8(J)),H=z.nodeType===X5&&TZ(z.parentNode)&&!!z.parentNode._reactRootContainer;if($)q("unmountComponentAtNode(): The node you're attempting to unmount was rendered by React and is not a top-level container. %s",H?"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(w_(GP),F_(qP),M_(BP),P_(x5),A_(__),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")q("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");JL(IN),HL($9,wM,p7);function CP(z,Q){var X=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;if(!z3(Q))throw Error("Target container is not a DOM element.");return $P(z,Q,null,X)}function vP(z,Q,X,Z){return kP(z,Q,X,Z)}var S9={usingClientEntryPoint:!1,Events:[q8,ez,xJ,F2,M2,$9]};function SP(z,Q){if(!S9.usingClientEntryPoint)q('You are importing createRoot from "react-dom" which is not supported. You should instead import it from "react-dom/client".');return RP(z,Q)}function fP(z,Q,X){if(!S9.usingClientEntryPoint)q('You are importing hydrateRoot from "react-dom" which is not supported. You should instead import it from "react-dom/client".');return wP(z,Q,X)}function hP(z){if(NK())q("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 p7(z)}var yP=_P({findFiberByHostInstance:s8,bundleType:1,version:P9,rendererPackageName:"react-dom"});if(!yP&&f1&&window.top===window.self){if(navigator.userAgent.indexOf("Chrome")>-1&&navigator.userAgent.indexOf("Edge")===-1||navigator.userAgent.indexOf("Firefox")>-1){var KO=window.location.protocol;if(/^(https?|file):$/.test(KO))console.info("%cDownload the React DevTools for a better development experience: https://reactjs.org/link/react-devtools"+(KO==="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(pP.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=S9,pP.createPortal=CP,pP.createRoot=SP,pP.findDOMNode=PP,pP.flushSync=hP,pP.hydrate=AP,pP.hydrateRoot=fP,pP.render=IP,pP.unmountComponentAtNode=TP,pP.unstable_batchedUpdates=$9,pP.unstable_renderSubtreeIntoContainer=vP,pP.version=P9,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==="function")__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()});var RO=Wz((IT,_O)=>{var dP=q0(LO());_O.exports=dP});var NO=Wz((cP)=>{var IQ=q0(RO());AQ=IQ.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,cP.createRoot=function(Y,G){AQ.usingClientEntryPoint=!0;try{return IQ.createRoot(Y,G)}finally{AQ.usingClientEntryPoint=!1}},cP.hydrateRoot=function(Y,G,U){AQ.usingClientEntryPoint=!0;try{return IQ.hydrateRoot(Y,G,U)}finally{AQ.usingClientEntryPoint=!1}};var AQ});var Z1=Wz((lP)=>{var h9=q0(I1());(function(){var Y=Symbol.for("react.element"),G=Symbol.for("react.portal"),U=Symbol.for("react.fragment"),W=Symbol.for("react.strict_mode"),q=Symbol.for("react.profiler"),R=Symbol.for("react.provider"),L=Symbol.for("react.context"),_=Symbol.for("react.forward_ref"),k=Symbol.for("react.suspense"),I=Symbol.for("react.suspense_list"),F=Symbol.for("react.memo"),w=Symbol.for("react.lazy"),b=Symbol.for("react.offscreen"),C=Symbol.iterator,f="@@iterator";function E(h){if(h===null||typeof h!=="object")return null;var H0=C&&h[C]||h[f];if(typeof H0==="function")return H0;return null}var V=h9.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function v(h){{for(var H0=arguments.length,R0=Array(H0>1?H0-1:0),A=1;A<H0;A++)R0[A-1]=arguments[A];T("error",h,R0)}}function T(h,H0,R0){{var A=V.ReactDebugCurrentFrame,x=A.getStackAddendum();if(x!=="")H0+="%s",R0=R0.concat([x]);var O0=R0.map(function(M0){return String(M0)});O0.unshift("Warning: "+H0),Function.prototype.apply.call(console[h],console,O0)}}var D=!1,n=!1,p=!1,r=!1,J0=!1,i;i=Symbol.for("react.module.reference");function t(h){if(typeof h==="string"||typeof h==="function")return!0;if(h===U||h===q||J0||h===W||h===k||h===I||r||h===b||D||n||p)return!0;if(typeof h==="object"&&h!==null){if(h.$$typeof===w||h.$$typeof===F||h.$$typeof===R||h.$$typeof===L||h.$$typeof===_||h.$$typeof===i||h.getModuleId!==void 0)return!0}return!1}function l(h,H0,R0){var A=h.displayName;if(A)return A;var x=H0.displayName||H0.name||"";return x!==""?R0+"("+x+")":R0}function j(h){return h.displayName||"Context"}function c(h){if(h==null)return null;if(typeof h.tag==="number")v("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.");if(typeof h==="function")return h.displayName||h.name||null;if(typeof h==="string")return h;switch(h){case U:return"Fragment";case G:return"Portal";case q:return"Profiler";case W:return"StrictMode";case k:return"Suspense";case I:return"SuspenseList"}if(typeof h==="object")switch(h.$$typeof){case L:var H0=h;return j(H0)+".Consumer";case R:var R0=h;return j(R0._context)+".Provider";case _:return l(h,h.render,"ForwardRef");case F:var A=h.displayName||null;if(A!==null)return A;return c(h.type)||"Memo";case w:{var x=h,O0=x._payload,M0=x._init;try{return c(M0(O0))}catch(S0){return null}}}return null}var X0=Object.assign,I0=0,F0,Q1,O1,Q0,U0,_0,Z0;function d(){}d.__reactDisabledLog=!0;function P0(){{if(I0===0){F0=console.log,Q1=console.info,O1=console.warn,Q0=console.error,U0=console.group,_0=console.groupCollapsed,Z0=console.groupEnd;var h={configurable:!0,enumerable:!0,value:d,writable:!0};Object.defineProperties(console,{info:h,log:h,warn:h,error:h,group:h,groupCollapsed:h,groupEnd:h})}I0++}}function v0(){{if(I0--,I0===0){var h={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:X0({},h,{value:F0}),info:X0({},h,{value:Q1}),warn:X0({},h,{value:O1}),error:X0({},h,{value:Q0}),group:X0({},h,{value:U0}),groupCollapsed:X0({},h,{value:_0}),groupEnd:X0({},h,{value:Z0})})}if(I0<0)v("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var X1=V.ReactCurrentDispatcher,r0;function V0(h,H0,R0){{if(r0===void 0)try{throw Error()}catch(x){var A=x.stack.trim().match(/\n( *(at )?)/);r0=A&&A[1]||""}return`
146
+ `+r0+h}}var $1=!1,L0;{var a0=typeof WeakMap==="function"?WeakMap:Map;L0=new a0}function f1(h,H0){if(!h||$1)return"";{var R0=L0.get(h);if(R0!==void 0)return R0}var A;$1=!0;var x=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var O0;O0=X1.current,X1.current=null,P0();try{if(H0){var M0=function(){throw Error()};if(Object.defineProperty(M0.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==="object"&&Reflect.construct){try{Reflect.construct(M0,[])}catch(e1){A=e1}Reflect.construct(h,[],M0)}else{try{M0.call()}catch(e1){A=e1}h.call(M0.prototype)}}else{try{throw Error()}catch(e1){A=e1}h()}}catch(e1){if(e1&&A&&typeof e1.stack==="string"){var S0=e1.stack.split(`
147
+ `),i0=A.stack.split(`
148
+ `),g0=S0.length-1,W0=i0.length-1;while(g0>=1&&W0>=0&&S0[g0]!==i0[W0])W0--;for(;g0>=1&&W0>=0;g0--,W0--)if(S0[g0]!==i0[W0]){if(g0!==1||W0!==1)do if(g0--,W0--,W0<0||S0[g0]!==i0[W0]){var k0=`
149
+ `+S0[g0].replace(" at new "," at ");if(h.displayName&&k0.includes("<anonymous>"))k0=k0.replace("<anonymous>",h.displayName);if(typeof h==="function")L0.set(h,k0);return k0}while(g0>=1&&W0>=0);break}}}finally{$1=!1,X1.current=O0,v0(),Error.prepareStackTrace=x}var n0=h?h.displayName||h.name:"",D1=n0?V0(n0):"";if(typeof h==="function")L0.set(h,D1);return D1}function q4(h,H0,R0){return f1(h,!1)}function h4(h){var H0=h.prototype;return!!(H0&&H0.isReactComponent)}function g1(h,H0,R0){if(h==null)return"";if(typeof h==="function")return f1(h,h4(h));if(typeof h==="string")return V0(h);switch(h){case k:return V0("Suspense");case I:return V0("SuspenseList")}if(typeof h==="object")switch(h.$$typeof){case _:return q4(h.render);case F:return g1(h.type,H0,R0);case w:{var A=h,x=A._payload,O0=A._init;try{return g1(O0(x),H0,R0)}catch(M0){}}}return""}var K1=Object.prototype.hasOwnProperty,r4={},o4=V.ReactDebugCurrentFrame;function k4(h){if(h){var H0=h._owner,R0=g1(h.type,h._source,H0?H0.type:null);o4.setExtraStackFrame(R0)}else o4.setExtraStackFrame(null)}function y4(h,H0,R0,A,x){{var O0=Function.call.bind(K1);for(var M0 in h)if(O0(h,M0)){var S0=void 0;try{if(typeof h[M0]!=="function"){var i0=Error((A||"React class")+": "+R0+" type `"+M0+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof h[M0]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw i0.name="Invariant Violation",i0}S0=h[M0](H0,M0,A,R0,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(g0){S0=g0}if(S0&&!(S0 instanceof Error))k4(x),v("%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).",A||"React class",R0,M0,typeof S0),k4(null);if(S0 instanceof Error&&!(S0.message in r4))r4[S0.message]=!0,k4(x),v("Failed %s type: %s",R0,S0.message),k4(null)}}}var D5=Array.isArray;function W4(h){return D5(h)}function F6(h){{var H0=typeof Symbol==="function"&&Symbol.toStringTag,R0=H0&&h[Symbol.toStringTag]||h.constructor.name||"Object";return R0}}function L4(h){try{return M6(h),!1}catch(H0){return!0}}function M6(h){return""+h}function M4(h){if(L4(h))return v("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",F6(h)),M6(h)}var T4=V.ReactCurrentOwner,W6={key:!0,ref:!0,__self:!0,__source:!0},E6,j4,t4;t4={};function T0(h){if(K1.call(h,"ref")){var H0=Object.getOwnPropertyDescriptor(h,"ref").get;if(H0&&H0.isReactWarning)return!1}return h.ref!==void 0}function t0(h){if(K1.call(h,"key")){var H0=Object.getOwnPropertyDescriptor(h,"key").get;if(H0&&H0.isReactWarning)return!1}return h.key!==void 0}function J1(h,H0){if(typeof h.ref==="string"&&T4.current&&H0&&T4.current.stateNode!==H0){var R0=c(T4.current.type);if(!t4[R0])v('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',c(T4.current.type),h.ref),t4[R0]=!0}}function x1(h,H0){{var R0=function(){if(!E6)E6=!0,v("%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)",H0)};R0.isReactWarning=!0,Object.defineProperty(h,"key",{get:R0,configurable:!0})}}function t1(h,H0){{var R0=function(){if(!j4)j4=!0,v("%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)",H0)};R0.isReactWarning=!0,Object.defineProperty(h,"ref",{get:R0,configurable:!0})}}var V4=function(h,H0,R0,A,x,O0,M0){var S0={$$typeof:Y,type:h,key:H0,ref:R0,props:M0,_owner:O0};if(S0._store={},Object.defineProperty(S0._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(S0,"_self",{configurable:!1,enumerable:!1,writable:!1,value:A}),Object.defineProperty(S0,"_source",{configurable:!1,enumerable:!1,writable:!1,value:x}),Object.freeze)Object.freeze(S0.props),Object.freeze(S0);return S0};function H4(h,H0,R0,A,x){{var O0,M0={},S0=null,i0=null;if(R0!==void 0)M4(R0),S0=""+R0;if(t0(H0))M4(H0.key),S0=""+H0.key;if(T0(H0))i0=H0.ref,J1(H0,x);for(O0 in H0)if(K1.call(H0,O0)&&!W6.hasOwnProperty(O0))M0[O0]=H0[O0];if(h&&h.defaultProps){var g0=h.defaultProps;for(O0 in g0)if(M0[O0]===void 0)M0[O0]=g0[O0]}if(S0||i0){var W0=typeof h==="function"?h.displayName||h.name||"Unknown":h;if(S0)x1(M0,W0);if(i0)t1(M0,W0)}return V4(h,S0,i0,x,A,T4.current,M0)}}var{ReactCurrentOwner:a4,ReactDebugCurrentFrame:F1}=V;function N1(h){if(h){var H0=h._owner,R0=g1(h.type,h._source,H0?H0.type:null);F1.setExtraStackFrame(R0)}else F1.setExtraStackFrame(null)}var c6=!1;function L6(h){return typeof h==="object"&&h!==null&&h.$$typeof===Y}function l6(){{if(a4.current){var h=c(a4.current.type);if(h)return`
150
+
151
+ Check the render method of \``+h+"`."}return""}}function Q7(h){{if(h!==void 0){var H0=h.fileName.replace(/^.*[\\\/]/,""),R0=h.lineNumber;return`
152
+
153
+ Check your code at `+H0+":"+R0+"."}return""}}var E5={};function X7(h){{var H0=l6();if(!H0){var R0=typeof h==="string"?h:h.displayName||h.name;if(R0)H0=`
154
+
155
+ Check the top-level render call using <`+R0+">."}return H0}}function F5(h,H0){{if(!h._store||h._store.validated||h.key!=null)return;h._store.validated=!0;var R0=X7(H0);if(E5[R0])return;E5[R0]=!0;var A="";if(h&&h._owner&&h._owner!==a4.current)A=" It was passed a child from "+c(h._owner.type)+".";N1(h),v('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',R0,A),N1(null)}}function m6(h,H0){{if(typeof h!=="object")return;if(W4(h))for(var R0=0;R0<h.length;R0++){var A=h[R0];if(L6(A))F5(A,H0)}else if(L6(h)){if(h._store)h._store.validated=!0}else if(h){var x=E(h);if(typeof x==="function"){if(x!==h.entries){var O0=x.call(h),M0;while(!(M0=O0.next()).done)if(L6(M0.value))F5(M0.value,H0)}}}}}function m5(h){{var H0=h.type;if(H0===null||H0===void 0||typeof H0==="string")return;var R0;if(typeof H0==="function")R0=H0.propTypes;else if(typeof H0==="object"&&(H0.$$typeof===_||H0.$$typeof===F))R0=H0.propTypes;else return;if(R0){var A=c(H0);y4(R0,h.props,"prop",A,h)}else if(H0.PropTypes!==void 0&&!c6){c6=!0;var x=c(H0);v("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",x||"Unknown")}if(typeof H0.getDefaultProps==="function"&&!H0.getDefaultProps.isReactClassApproved)v("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function V1(h){{var H0=Object.keys(h.props);for(var R0=0;R0<H0.length;R0++){var A=H0[R0];if(A!=="children"&&A!=="key"){N1(h),v("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",A),N1(null);break}}if(h.ref!==null)N1(h),v("Invalid attribute `ref` supplied to `React.Fragment`."),N1(null)}}var s1={};function B4(h,H0,R0,A,x,O0){{var M0=t(h);if(!M0){var S0="";if(h===void 0||typeof h==="object"&&h!==null&&Object.keys(h).length===0)S0+=" 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 i0=Q7(x);if(i0)S0+=i0;else S0+=l6();var g0;if(h===null)g0="null";else if(W4(h))g0="array";else if(h!==void 0&&h.$$typeof===Y)g0="<"+(c(h.type)||"Unknown")+" />",S0=" Did you accidentally export a JSX literal instead of a component?";else g0=typeof h;v("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",g0,S0)}var W0=H4(h,H0,R0,x,O0);if(W0==null)return W0;if(M0){var k0=H0.children;if(k0!==void 0)if(A)if(W4(k0)){for(var n0=0;n0<k0.length;n0++)m6(k0[n0],h);if(Object.freeze)Object.freeze(k0)}else v("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 m6(k0,h)}if(K1.call(H0,"key")){var D1=c(h),e1=Object.keys(H0).filter(function(P4){return P4!=="key"}),i6=e1.length>0?"{key: someKey, "+e1.join(": ..., ")+": ...}":"{key: someKey}";if(!s1[D1+i6]){var q5=e1.length>0?"{"+e1.join(": ..., ")+": ...}":"{}";v(`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} />`,i6,D1,q5,D1),s1[D1+i6]=!0}}if(h===U)V1(W0);else m5(W0);return W0}}var d1=B4;lP.Fragment=U,lP.jsxDEV=d1})()});var w4=Wz((TA)=>{var d9=q0(I1());(function(){var Y=Symbol.for("react.element"),G=Symbol.for("react.portal"),U=Symbol.for("react.fragment"),W=Symbol.for("react.strict_mode"),q=Symbol.for("react.profiler"),R=Symbol.for("react.provider"),L=Symbol.for("react.context"),_=Symbol.for("react.forward_ref"),k=Symbol.for("react.suspense"),I=Symbol.for("react.suspense_list"),F=Symbol.for("react.memo"),w=Symbol.for("react.lazy"),b=Symbol.for("react.offscreen"),C=Symbol.iterator,f="@@iterator";function E(A){if(A===null||typeof A!=="object")return null;var x=C&&A[C]||A[f];if(typeof x==="function")return x;return null}var V=d9.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function v(A){{for(var x=arguments.length,O0=Array(x>1?x-1:0),M0=1;M0<x;M0++)O0[M0-1]=arguments[M0];T("error",A,O0)}}function T(A,x,O0){{var M0=V.ReactDebugCurrentFrame,S0=M0.getStackAddendum();if(S0!=="")x+="%s",O0=O0.concat([S0]);var i0=O0.map(function(g0){return String(g0)});i0.unshift("Warning: "+x),Function.prototype.apply.call(console[A],console,i0)}}var D=!1,n=!1,p=!1,r=!1,J0=!1,i;i=Symbol.for("react.module.reference");function t(A){if(typeof A==="string"||typeof A==="function")return!0;if(A===U||A===q||J0||A===W||A===k||A===I||r||A===b||D||n||p)return!0;if(typeof A==="object"&&A!==null){if(A.$$typeof===w||A.$$typeof===F||A.$$typeof===R||A.$$typeof===L||A.$$typeof===_||A.$$typeof===i||A.getModuleId!==void 0)return!0}return!1}function l(A,x,O0){var M0=A.displayName;if(M0)return M0;var S0=x.displayName||x.name||"";return S0!==""?O0+"("+S0+")":O0}function j(A){return A.displayName||"Context"}function c(A){if(A==null)return null;if(typeof A.tag==="number")v("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.");if(typeof A==="function")return A.displayName||A.name||null;if(typeof A==="string")return A;switch(A){case U:return"Fragment";case G:return"Portal";case q:return"Profiler";case W:return"StrictMode";case k:return"Suspense";case I:return"SuspenseList"}if(typeof A==="object")switch(A.$$typeof){case L:var x=A;return j(x)+".Consumer";case R:var O0=A;return j(O0._context)+".Provider";case _:return l(A,A.render,"ForwardRef");case F:var M0=A.displayName||null;if(M0!==null)return M0;return c(A.type)||"Memo";case w:{var S0=A,i0=S0._payload,g0=S0._init;try{return c(g0(i0))}catch(W0){return null}}}return null}var X0=Object.assign,I0=0,F0,Q1,O1,Q0,U0,_0,Z0;function d(){}d.__reactDisabledLog=!0;function P0(){{if(I0===0){F0=console.log,Q1=console.info,O1=console.warn,Q0=console.error,U0=console.group,_0=console.groupCollapsed,Z0=console.groupEnd;var A={configurable:!0,enumerable:!0,value:d,writable:!0};Object.defineProperties(console,{info:A,log:A,warn:A,error:A,group:A,groupCollapsed:A,groupEnd:A})}I0++}}function v0(){{if(I0--,I0===0){var A={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:X0({},A,{value:F0}),info:X0({},A,{value:Q1}),warn:X0({},A,{value:O1}),error:X0({},A,{value:Q0}),group:X0({},A,{value:U0}),groupCollapsed:X0({},A,{value:_0}),groupEnd:X0({},A,{value:Z0})})}if(I0<0)v("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var X1=V.ReactCurrentDispatcher,r0;function V0(A,x,O0){{if(r0===void 0)try{throw Error()}catch(S0){var M0=S0.stack.trim().match(/\n( *(at )?)/);r0=M0&&M0[1]||""}return`
161
+ `+r0+A}}var $1=!1,L0;{var a0=typeof WeakMap==="function"?WeakMap:Map;L0=new a0}function f1(A,x){if(!A||$1)return"";{var O0=L0.get(A);if(O0!==void 0)return O0}var M0;$1=!0;var S0=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var i0;i0=X1.current,X1.current=null,P0();try{if(x){var g0=function(){throw Error()};if(Object.defineProperty(g0.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==="object"&&Reflect.construct){try{Reflect.construct(g0,[])}catch(P4){M0=P4}Reflect.construct(A,[],g0)}else{try{g0.call()}catch(P4){M0=P4}A.call(g0.prototype)}}else{try{throw Error()}catch(P4){M0=P4}A()}}catch(P4){if(P4&&M0&&typeof P4.stack==="string"){var W0=P4.stack.split(`
162
+ `),k0=M0.stack.split(`
163
+ `),n0=W0.length-1,D1=k0.length-1;while(n0>=1&&D1>=0&&W0[n0]!==k0[D1])D1--;for(;n0>=1&&D1>=0;n0--,D1--)if(W0[n0]!==k0[D1]){if(n0!==1||D1!==1)do if(n0--,D1--,D1<0||W0[n0]!==k0[D1]){var e1=`
164
+ `+W0[n0].replace(" at new "," at ");if(A.displayName&&e1.includes("<anonymous>"))e1=e1.replace("<anonymous>",A.displayName);if(typeof A==="function")L0.set(A,e1);return e1}while(n0>=1&&D1>=0);break}}}finally{$1=!1,X1.current=i0,v0(),Error.prepareStackTrace=S0}var i6=A?A.displayName||A.name:"",q5=i6?V0(i6):"";if(typeof A==="function")L0.set(A,q5);return q5}function q4(A,x,O0){return f1(A,!1)}function h4(A){var x=A.prototype;return!!(x&&x.isReactComponent)}function g1(A,x,O0){if(A==null)return"";if(typeof A==="function")return f1(A,h4(A));if(typeof A==="string")return V0(A);switch(A){case k:return V0("Suspense");case I:return V0("SuspenseList")}if(typeof A==="object")switch(A.$$typeof){case _:return q4(A.render);case F:return g1(A.type,x,O0);case w:{var M0=A,S0=M0._payload,i0=M0._init;try{return g1(i0(S0),x,O0)}catch(g0){}}}return""}var K1=Object.prototype.hasOwnProperty,r4={},o4=V.ReactDebugCurrentFrame;function k4(A){if(A){var x=A._owner,O0=g1(A.type,A._source,x?x.type:null);o4.setExtraStackFrame(O0)}else o4.setExtraStackFrame(null)}function y4(A,x,O0,M0,S0){{var i0=Function.call.bind(K1);for(var g0 in A)if(i0(A,g0)){var W0=void 0;try{if(typeof A[g0]!=="function"){var k0=Error((M0||"React class")+": "+O0+" type `"+g0+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof A[g0]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw k0.name="Invariant Violation",k0}W0=A[g0](x,g0,M0,O0,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(n0){W0=n0}if(W0&&!(W0 instanceof Error))k4(S0),v("%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).",M0||"React class",O0,g0,typeof W0),k4(null);if(W0 instanceof Error&&!(W0.message in r4))r4[W0.message]=!0,k4(S0),v("Failed %s type: %s",O0,W0.message),k4(null)}}}var D5=Array.isArray;function W4(A){return D5(A)}function F6(A){{var x=typeof Symbol==="function"&&Symbol.toStringTag,O0=x&&A[Symbol.toStringTag]||A.constructor.name||"Object";return O0}}function L4(A){try{return M6(A),!1}catch(x){return!0}}function M6(A){return""+A}function M4(A){if(L4(A))return v("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",F6(A)),M6(A)}var T4=V.ReactCurrentOwner,W6={key:!0,ref:!0,__self:!0,__source:!0},E6,j4,t4;t4={};function T0(A){if(K1.call(A,"ref")){var x=Object.getOwnPropertyDescriptor(A,"ref").get;if(x&&x.isReactWarning)return!1}return A.ref!==void 0}function t0(A){if(K1.call(A,"key")){var x=Object.getOwnPropertyDescriptor(A,"key").get;if(x&&x.isReactWarning)return!1}return A.key!==void 0}function J1(A,x){if(typeof A.ref==="string"&&T4.current&&x&&T4.current.stateNode!==x){var O0=c(T4.current.type);if(!t4[O0])v('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',c(T4.current.type),A.ref),t4[O0]=!0}}function x1(A,x){{var O0=function(){if(!E6)E6=!0,v("%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)",x)};O0.isReactWarning=!0,Object.defineProperty(A,"key",{get:O0,configurable:!0})}}function t1(A,x){{var O0=function(){if(!j4)j4=!0,v("%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)",x)};O0.isReactWarning=!0,Object.defineProperty(A,"ref",{get:O0,configurable:!0})}}var V4=function(A,x,O0,M0,S0,i0,g0){var W0={$$typeof:Y,type:A,key:x,ref:O0,props:g0,_owner:i0};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:M0}),Object.defineProperty(W0,"_source",{configurable:!1,enumerable:!1,writable:!1,value:S0}),Object.freeze)Object.freeze(W0.props),Object.freeze(W0);return W0};function H4(A,x,O0,M0,S0){{var i0,g0={},W0=null,k0=null;if(O0!==void 0)M4(O0),W0=""+O0;if(t0(x))M4(x.key),W0=""+x.key;if(T0(x))k0=x.ref,J1(x,S0);for(i0 in x)if(K1.call(x,i0)&&!W6.hasOwnProperty(i0))g0[i0]=x[i0];if(A&&A.defaultProps){var n0=A.defaultProps;for(i0 in n0)if(g0[i0]===void 0)g0[i0]=n0[i0]}if(W0||k0){var D1=typeof A==="function"?A.displayName||A.name||"Unknown":A;if(W0)x1(g0,D1);if(k0)t1(g0,D1)}return V4(A,W0,k0,S0,M0,T4.current,g0)}}var{ReactCurrentOwner:a4,ReactDebugCurrentFrame:F1}=V;function N1(A){if(A){var x=A._owner,O0=g1(A.type,A._source,x?x.type:null);F1.setExtraStackFrame(O0)}else F1.setExtraStackFrame(null)}var c6=!1;function L6(A){return typeof A==="object"&&A!==null&&A.$$typeof===Y}function l6(){{if(a4.current){var A=c(a4.current.type);if(A)return`
165
+
166
+ Check the render method of \``+A+"`."}return""}}function Q7(A){{if(A!==void 0){var x=A.fileName.replace(/^.*[\\\/]/,""),O0=A.lineNumber;return`
167
+
168
+ Check your code at `+x+":"+O0+"."}return""}}var E5={};function X7(A){{var x=l6();if(!x){var O0=typeof A==="string"?A:A.displayName||A.name;if(O0)x=`
169
+
170
+ Check the top-level render call using <`+O0+">."}return x}}function F5(A,x){{if(!A._store||A._store.validated||A.key!=null)return;A._store.validated=!0;var O0=X7(x);if(E5[O0])return;E5[O0]=!0;var M0="";if(A&&A._owner&&A._owner!==a4.current)M0=" It was passed a child from "+c(A._owner.type)+".";N1(A),v('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',O0,M0),N1(null)}}function m6(A,x){{if(typeof A!=="object")return;if(W4(A))for(var O0=0;O0<A.length;O0++){var M0=A[O0];if(L6(M0))F5(M0,x)}else if(L6(A)){if(A._store)A._store.validated=!0}else if(A){var S0=E(A);if(typeof S0==="function"){if(S0!==A.entries){var i0=S0.call(A),g0;while(!(g0=i0.next()).done)if(L6(g0.value))F5(g0.value,x)}}}}}function m5(A){{var x=A.type;if(x===null||x===void 0||typeof x==="string")return;var O0;if(typeof x==="function")O0=x.propTypes;else if(typeof x==="object"&&(x.$$typeof===_||x.$$typeof===F))O0=x.propTypes;else return;if(O0){var M0=c(x);y4(O0,A.props,"prop",M0,A)}else if(x.PropTypes!==void 0&&!c6){c6=!0;var S0=c(x);v("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",S0||"Unknown")}if(typeof x.getDefaultProps==="function"&&!x.getDefaultProps.isReactClassApproved)v("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function V1(A){{var x=Object.keys(A.props);for(var O0=0;O0<x.length;O0++){var M0=x[O0];if(M0!=="children"&&M0!=="key"){N1(A),v("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",M0),N1(null);break}}if(A.ref!==null)N1(A),v("Invalid attribute `ref` supplied to `React.Fragment`."),N1(null)}}var s1={};function B4(A,x,O0,M0,S0,i0){{var g0=t(A);if(!g0){var W0="";if(A===void 0||typeof A==="object"&&A!==null&&Object.keys(A).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 k0=Q7(S0);if(k0)W0+=k0;else W0+=l6();var n0;if(A===null)n0="null";else if(W4(A))n0="array";else if(A!==void 0&&A.$$typeof===Y)n0="<"+(c(A.type)||"Unknown")+" />",W0=" Did you accidentally export a JSX literal instead of a component?";else n0=typeof A;v("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",n0,W0)}var D1=H4(A,x,O0,S0,i0);if(D1==null)return D1;if(g0){var e1=x.children;if(e1!==void 0)if(M0)if(W4(e1)){for(var i6=0;i6<e1.length;i6++)m6(e1[i6],A);if(Object.freeze)Object.freeze(e1)}else v("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 m6(e1,A)}if(K1.call(x,"key")){var q5=c(A),P4=Object.keys(x).filter(function(Z7){return Z7!=="key"}),T1=P4.length>0?"{key: someKey, "+P4.join(": ..., ")+": ...}":"{key: someKey}";if(!s1[q5+T1]){var b7=P4.length>0?"{"+P4.join(": ..., ")+": ...}":"{}";v(`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} />`,T1,q5,b7,q5),s1[q5+T1]=!0}}if(A===U)V1(D1);else m5(D1);return D1}}function d1(A,x,O0){return B4(A,x,O0,!0)}function h(A,x,O0){return B4(A,x,O0,!1)}var H0=h,R0=d1;TA.Fragment=U,TA.jsx=H0,TA.jsxs=R0})()});var V5=q0(I1(),1),LW=q0(NO(),1);var f9={memory:!0,tasks:!1,vision:!0,operator:!1,mcp:!1,realtime:!1,files:!1,agents:!1,builtinTools:{webSearch:!1,webFetch:!1}};function _z(Y,G){let U=Y.agents;if(typeof U==="boolean")return{enabled:U,mode:"worker",group:G||void 0};return{...U,group:U.group||G||void 0}}var U6=q0(I1(),1),bO=q0(Z1(),1),wO=U6.createContext(null),iP=200;function y9({children:Y}){let[G,U]=U6.useState(!1),[W,q]=U6.useState([]),[R,L]=U6.useState({}),[_,k]=U6.useState({}),I=U6.useRef(null),F=U6.useRef(null);U6.useEffect(()=>{let C=setInterval(()=>{let f=Date.now();k((E)=>{let V={};for(let[v,T]of Object.entries(E))if(T.expiresAt>f)V[v]=T;return V})},500);return()=>clearInterval(C)},[]);let w=U6.useCallback(()=>{if(I.current)I.current.close(),I.current=null;try{let C=new EventSource("/api/telemetry/stream");I.current=C,C.onopen=()=>{U(!0)},C.onmessage=(f)=>{if(!f.data||f.data.trim()==="")return;try{let E=JSON.parse(f.data);if(E.connected){U(!0);return}if(Array.isArray(E))q((V)=>{return[...E,...V].slice(0,iP)}),L((V)=>{let v={...V};for(let T of E){let D=v[T.agent_id];if(!D||new Date(T.timestamp)>new Date(D.timestamp))v[T.agent_id]={timestamp:T.timestamp,category:T.category,type:T.type}}return v}),k((V)=>{let v={...V},T=Date.now()+3000;for(let D of E)v[D.agent_id]={type:D.type,expiresAt:T};return v})}catch{}},C.onerror=()=>{if(U(!1),C.close(),I.current=null,F.current)clearTimeout(F.current);F.current=setTimeout(w,2000)}}catch{if(U(!1),F.current)clearTimeout(F.current);F.current=setTimeout(w,2000)}},[]);U6.useEffect(()=>{return w(),()=>{if(I.current)I.current.close();if(F.current)clearTimeout(F.current)}},[w]);let b=U6.useCallback(()=>{q([])},[]);return bO.jsxDEV(wO.Provider,{value:{connected:G,events:W,lastActivityByAgent:R,activeAgents:_,clearEvents:b},children:Y},void 0,!1,void 0,this)}function kQ(){let Y=U6.useContext(wO);if(!Y)throw Error("useTelemetryContext must be used within TelemetryProvider");return Y}function SZ(Y){let{activeAgents:G}=kQ(),U=G[Y];return{isActive:!!U,type:U?.type}}var S4=q0(I1(),1),MO=q0(Z1(),1),FO=S4.createContext(null);function k1(){let Y=S4.useContext(FO);if(!Y)throw Error("useAuth must be used within an AuthProvider");return Y}function V9({children:Y}){let[G,U]=S4.useState(null),[W,q]=S4.useState(null),[R,L]=S4.useState(!0),[_,k]=S4.useState(null),[I,F]=S4.useState(!1),w=S4.useRef(null),b=S4.useRef(!1),C=S4.useRef(!1),f=S4.useCallback((r)=>{w.current=r,q(r)},[]),E=S4.useCallback(async()=>{if(b.current)return!1;b.current=!0;try{let r=await fetch("/api/auth/refresh",{method:"POST",credentials:"include"});if(!r.ok)return!1;let J0=await r.json();f(J0.accessToken);let i=await fetch("/api/auth/me",{headers:{Authorization:`Bearer ${J0.accessToken}`}});if(i.ok){let t=await i.json();return U(t.user),!0}return!1}catch(r){return console.error("Token refresh failed:",r),!1}finally{b.current=!1}},[f]),V=S4.useCallback(async()=>{try{let r=w.current,i=await(await fetch("/api/auth/check",{headers:r?{Authorization:`Bearer ${r}`}:{}})).json();if(k(i.hasUsers),F(i.isDev??!1),i.authenticated&&i.user)U(i.user);else if(U(null),i.hasUsers){if(!await E())f(null)}}catch(r){console.error("Auth check failed:",r),U(null),f(null)}finally{L(!1)}},[E,f]),v=S4.useCallback(async(r,J0)=>{try{let i=await fetch("/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({username:r,password:J0})}),t=await i.json();if(!i.ok)return{success:!1,error:t.error||"Login failed"};return f(t.accessToken),U(t.user),k(!0),{success:!0}}catch(i){return console.error("Login failed:",i),{success:!1,error:"Login failed"}}},[f]),T=S4.useCallback(async()=>{try{let r=w.current;await fetch("/api/auth/logout",{method:"POST",credentials:"include",headers:r?{Authorization:`Bearer ${r}`}:{}})}catch(r){console.error("Logout failed:",r)}finally{U(null),f(null)}},[f]),D=S4.useCallback(async(r,J0={})=>{let i=new Headers(J0.headers),t=w.current;if(t)i.set("Authorization",`Bearer ${t}`);return fetch(r,{...J0,headers:i})},[]),n=S4.useCallback(async()=>{return E()},[E]);S4.useEffect(()=>{if(C.current)return;C.current=!0,V()},[V]),S4.useEffect(()=>{if(!W)return;let r=setInterval(()=>{E()},840000);return()=>clearInterval(r)},[W,E]);let p={user:G,isAuthenticated:!!G,isLoading:R,hasUsers:_,isDev:I,accessToken:W,login:v,logout:T,refreshToken:n,checkAuth:V,authFetch:D};return MO.jsxDEV(FO.Provider,{value:p,children:Y},void 0,!1,void 0,this)}var Q6=q0(I1(),1);var AO=q0(Z1(),1),PO=Q6.createContext(null);function g4(){let Y=Q6.useContext(PO);if(!Y)throw Error("useProjects must be used within a ProjectProvider");return Y}var D9="apteva_current_project";function E9({children:Y}){let{authFetch:G,isAuthenticated:U,isLoading:W}=k1(),[q,R]=Q6.useState([]),[L,_]=Q6.useState(()=>{if(typeof window<"u")return localStorage.getItem(D9);return null}),[k,I]=Q6.useState(!0),[F,w]=Q6.useState(null),[b,C]=Q6.useState(0),[f,E]=Q6.useState(!1);Q6.useEffect(()=>{fetch("/api/features").then((J0)=>J0.json()).then((J0)=>{E(J0.projects===!0)}).catch(()=>{E(!1)})},[]);let V=Q6.useCallback((J0)=>{if(_(J0),typeof window<"u")if(J0===null)localStorage.removeItem(D9);else localStorage.setItem(D9,J0)},[]),v=q.find((J0)=>J0.id===L)||null,T=Q6.useCallback(async()=>{if(!f){R([]),I(!1);return}if(!U&&!W){R([]),I(!1);return}try{w(null);let J0=await G("/api/projects");if(!J0.ok)throw Error("Failed to fetch projects");let i=await J0.json();if(R(i.projects||[]),C(i.unassignedCount||0),L&&L!=="unassigned"&&!i.projects.find((t)=>t.id===L))V(null)}catch(J0){console.error("Failed to fetch projects:",J0),w("Failed to load projects")}finally{I(!1)}},[G,U,W,L,V,f]),D=Q6.useCallback(async(J0)=>{try{let i=await G("/api/projects",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(J0)});if(!i.ok){let l=await i.json();throw Error(l.error||"Failed to create project")}let t=await i.json();return await T(),t.project}catch(i){return console.error("Failed to create project:",i),null}},[G,T]),n=Q6.useCallback(async(J0,i)=>{try{let t=await G(`/api/projects/${J0}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});if(!t.ok){let j=await t.json();throw Error(j.error||"Failed to update project")}let l=await t.json();return await T(),l.project}catch(t){return console.error("Failed to update project:",t),null}},[G,T]),p=Q6.useCallback(async(J0)=>{try{let i=await G(`/api/projects/${J0}`,{method:"DELETE"});if(!i.ok){let t=await i.json();throw Error(t.error||"Failed to delete project")}if(L===J0)V(null);return await T(),!0}catch(i){return console.error("Failed to delete project:",i),!1}},[G,L,V,T]);Q6.useEffect(()=>{if(!W&&f)T()},[W,f,T]);let r={projects:q,currentProjectId:L,currentProject:v,isLoading:k,error:F,unassignedCount:b,projectsEnabled:f,setCurrentProjectId:V,createProject:D,updateProject:n,deleteProject:p,refreshProjects:T};return AO.jsxDEV(PO.Provider,{value:r,children:Y},void 0,!1,void 0,this)}var I8=q0(I1(),1);function m9(Y){let{accessToken:G}=k1(),[U,W]=I8.useState([]),[q,R]=I8.useState(!0),L=I8.useCallback(()=>{let C={"Content-Type":"application/json"};if(G)C.Authorization=`Bearer ${G}`;return C},[G]),_=I8.useCallback(async()=>{let f=await(await fetch("/api/agents",{headers:L()})).json();W(f.agents||[]),R(!1)},[L]);I8.useEffect(()=>{if(Y)_()},[Y,_]);let k=async(C)=>{await fetch("/api/agents",{method:"POST",headers:L(),body:JSON.stringify(C)}),await _()},I=async(C)=>{await fetch(`/api/agents/${C}`,{method:"DELETE",headers:L()}),await _()},F=async(C,f)=>{let E=await fetch(`/api/agents/${C}`,{method:"PUT",headers:L(),body:JSON.stringify(f)}),V=await E.json();if(await _(),!E.ok&&V.error)return{error:V.error};return{}},w=async(C)=>{let f=C.status==="running"?"stop":"start",E=await fetch(`/api/agents/${C.id}/${f}`,{method:"POST",headers:L()}),V=await E.json();if(await _(),!E.ok&&V.error)return{error:V.error};return{}},b=U.filter((C)=>C.status==="running").length;return{agents:U,loading:q,runningCount:b,fetchAgents:_,createAgent:k,updateAgent:F,deleteAgent:I,toggleAgent:w}}var Rz=q0(I1(),1);function u9(Y){let{accessToken:G}=k1(),[U,W]=Rz.useState([]),q=Rz.useCallback(()=>{let I={"Content-Type":"application/json"};if(G)I.Authorization=`Bearer ${G}`;return I},[G]),R=Rz.useCallback(async()=>{let F=await(await fetch("/api/providers",{headers:q()})).json();W(F.providers||[])},[q]);Rz.useEffect(()=>{if(Y)R()},[Y,R]);let L=U.filter((I)=>I.hasKey);return{providers:U,configuredProviders:L,fetchProviders:R,saveKey:async(I,F)=>{let b=await(await fetch(`/api/keys/${I}/test`,{method:"POST",headers:q(),body:JSON.stringify({key:F})})).json();if(!b.valid)return{success:!1,error:b.error||"API key is invalid"};let C=await fetch(`/api/keys/${I}`,{method:"POST",headers:q(),body:JSON.stringify({key:F})});if(!C.ok)return{success:!1,error:(await C.json()).error||"Failed to save key"};return await R(),{success:!0}},deleteKey:async(I)=>{await fetch(`/api/keys/${I}`,{method:"DELETE",headers:q()}),await R()}}}var Nz=q0(I1(),1);function g9(){let{accessToken:Y,isAuthenticated:G}=k1(),[U,W]=Nz.useState(null),q=Nz.useCallback(()=>{let L={};if(Y)L.Authorization=`Bearer ${Y}`;return L},[Y]);Nz.useEffect(()=>{if(!G){W(null);return}fetch("/api/onboarding/status",{headers:q()}).then((L)=>L.json()).then((L)=>{W(L.completed||L.has_any_keys)}).catch(()=>W(!0))},[G,q]);let R=Nz.useCallback(async()=>{await fetch("/api/onboarding/complete",{method:"POST",headers:q()}),W(!0)},[q]);return{isComplete:U,setIsComplete:W,complete:R}}var k8=q0(Z1(),1);function wz({message:Y="Loading...",fullScreen:G=!1}){let U=k8.jsxDEV("div",{className:"flex items-center gap-3 text-[#666]",children:[k8.jsxDEV("svg",{className:"animate-spin h-5 w-5",viewBox:"0 0 24 24",children:[k8.jsxDEV("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"},void 0,!1,void 0,this),k8.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),k8.jsxDEV("span",{children:Y},void 0,!1,void 0,this)]},void 0,!0,void 0,this);if(G)return k8.jsxDEV("div",{className:"min-h-screen bg-[#0a0a0a] text-[#e0e0e0] font-mono flex items-center justify-center",children:U},void 0,!1,void 0,this);return k8.jsxDEV("div",{className:"flex items-center justify-center py-20",children:U},void 0,!1,void 0,this)}var l7=q0(I1(),1),K6=q0(Z1(),1);function TQ({children:Y,onClose:G}){return K6.jsxDEV("div",{className:"fixed inset-0 bg-black/70 flex items-center justify-center z-50 p-4",children:K6.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 oP({title:Y,message:G,confirmText:U="Confirm",cancelText:W="Cancel",confirmVariant:q="danger",onConfirm:R,onCancel:L}){return K6.jsxDEV("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4",children:K6.jsxDEV("div",{className:"bg-[#111] border border-[#333] rounded-lg p-6 w-full max-w-sm",children:[Y&&K6.jsxDEV("h3",{className:"font-medium mb-2",children:Y},void 0,!1,void 0,this),K6.jsxDEV("p",{className:"text-sm text-[#ccc] mb-4",children:G},void 0,!1,void 0,this),K6.jsxDEV("div",{className:"flex gap-2",children:[K6.jsxDEV("button",{onClick:L,className:"flex-1 text-sm bg-[#1a1a1a] hover:bg-[#222] border border-[#333] px-4 py-2 rounded transition",children:W},void 0,!1,void 0,this),K6.jsxDEV("button",{onClick:R,className:`flex-1 text-sm text-white px-4 py-2 rounded transition ${q==="danger"?"bg-red-500 hover:bg-red-600":"bg-[#f97316] hover:bg-[#ea580c]"}`,children:U},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 aP({title:Y,message:G,buttonText:U="OK",variant:W="info",onClose:q}){let R={error:"bg-red-500/20 text-red-400",success:"bg-green-500/20 text-green-400",info:"bg-blue-500/20 text-blue-400"},L={error:"✕",success:"✓",info:"ℹ"};return K6.jsxDEV("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4",children:K6.jsxDEV("div",{className:"bg-[#111] border border-[#333] rounded-lg p-6 w-full max-w-sm text-center",children:[K6.jsxDEV("div",{className:`w-12 h-12 rounded-full flex items-center justify-center mx-auto mb-3 ${R[W]}`,children:K6.jsxDEV("span",{className:"text-xl",children:L[W]},void 0,!1,void 0,this)},void 0,!1,void 0,this),Y&&K6.jsxDEV("h3",{className:"font-medium mb-2",children:Y},void 0,!1,void 0,this),K6.jsxDEV("p",{className:"text-sm text-[#ccc] mb-4",children:G},void 0,!1,void 0,this),K6.jsxDEV("button",{onClick:q,className:"w-full text-sm bg-[#1a1a1a] hover:bg-[#222] border border-[#333] px-4 py-2 rounded transition",children:U},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}function S5(){let[Y,G]=l7.useState(null),U=l7.useCallback((L,_={})=>{return new Promise((k)=>{G({message:L,options:_,resolve:k})})},[]),W=l7.useCallback(()=>{Y?.resolve(!0),G(null)},[Y]),q=l7.useCallback(()=>{Y?.resolve(!1),G(null)},[Y]),R=Y?K6.jsxDEV(oP,{title:Y.options.title,message:Y.message,confirmText:Y.options.confirmText,cancelText:Y.options.cancelText,confirmVariant:Y.options.confirmVariant,onConfirm:W,onCancel:q},void 0,!1,void 0,this):null;return{confirm:U,ConfirmDialog:R}}function Z3(){let[Y,G]=l7.useState(null),U=l7.useCallback((R,L={})=>{return new Promise((_)=>{G({message:R,options:L,resolve:_})})},[]),W=l7.useCallback(()=>{Y?.resolve(),G(null)},[Y]),q=Y?K6.jsxDEV(aP,{title:Y.options.title,message:Y.message,buttonText:Y.options.buttonText,variant:Y.options.variant,onClose:W},void 0,!1,void 0,this):null;return{alert:U,AlertDialog:q}}var CQ=q0(I1(),1),y6=q0(Z1(),1);function V6({value:Y,options:G,onChange:U,placeholder:W="Select..."}){let[q,R]=CQ.useState(!1),L=CQ.useRef(null),_=G.find((k)=>k.value===Y);return CQ.useEffect(()=>{function k(I){if(L.current&&!L.current.contains(I.target))R(!1)}return document.addEventListener("mousedown",k),()=>document.removeEventListener("mousedown",k)},[]),y6.jsxDEV("div",{ref:L,className:"relative",children:[y6.jsxDEV("button",{type:"button",onClick:()=>R(!q),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:[y6.jsxDEV("span",{className:_?"text-[#e0e0e0]":"text-[#666]",children:_?y6.jsxDEV(y6.Fragment,{children:[_.label,_.recommended&&y6.jsxDEV("span",{className:"text-[#f97316] text-xs ml-2",children:"(Recommended)"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):W},void 0,!1,void 0,this),y6.jsxDEV(nP,{isOpen:q},void 0,!1,void 0,this)]},void 0,!0,void 0,this),q&&y6.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:G.map((k)=>y6.jsxDEV("button",{type:"button",onClick:()=>{U(k.value),R(!1)},className:`w-full px-3 py-2 text-left flex items-center justify-between hover:bg-[#1a1a1a] transition ${k.value===Y?"bg-[#1a1a1a] text-[#f97316]":"text-[#e0e0e0]"}`,children:[y6.jsxDEV("span",{children:[k.label,k.recommended&&y6.jsxDEV("span",{className:"text-[#f97316] text-xs ml-2",children:"(Recommended)"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),k.value===Y&&y6.jsxDEV("svg",{className:"w-4 h-4 text-[#f97316]",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:y6.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)]},k.value,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function nP({isOpen:Y}){return y6.jsxDEV("svg",{className:`w-4 h-4 text-[#666] transition-transform ${Y?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:y6.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 C1=q0(Z1(),1);function w5({className:Y="w-4 h-4"}){return C1.jsxDEV("svg",{className:Y,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:C1.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 N7({className:Y="w-5 h-5"}){return C1.jsxDEV("svg",{className:Y,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:C1.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 J3({className:Y="w-5 h-5"}){return C1.jsxDEV("svg",{className:Y,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:C1.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 Y3({className:Y="w-5 h-5"}){return C1.jsxDEV("svg",{className:Y,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:C1.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 $3({className:Y="w-5 h-5"}){return C1.jsxDEV("svg",{className:Y,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[C1.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),C1.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 bz({className:Y="w-4 h-4"}){return C1.jsxDEV("svg",{className:Y,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:C1.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 f5({className:Y="w-4 h-4"}){return C1.jsxDEV("svg",{className:Y,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:C1.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 Fz({className:Y="w-4 h-4"}){return C1.jsxDEV("svg",{className:Y,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[C1.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),C1.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 Mz({className:Y="w-4 h-4"}){return C1.jsxDEV("svg",{className:Y,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:C1.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 h5({className:Y="w-4 h-4"}){return C1.jsxDEV("svg",{className:Y,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:C1.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 fZ({className:Y="w-4 h-4"}){return C1.jsxDEV("svg",{className:Y,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:C1.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 Pz({className:Y="w-4 h-4"}){return C1.jsxDEV("svg",{className:Y,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:C1.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 x9({className:Y="w-4 h-4"}){return C1.jsxDEV("svg",{className:Y,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:C1.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 IO({className:Y="w-4 h-4"}){return C1.jsxDEV("svg",{className:Y,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:C1.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 vQ({className:Y="w-4 h-4"}){return C1.jsxDEV("svg",{className:Y,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:C1.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 SQ({className:Y="w-4 h-4"}){return C1.jsxDEV("svg",{className:Y,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:C1.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 kO({className:Y="w-5 h-5"}){return C1.jsxDEV("svg",{className:Y,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:C1.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 TO({className:Y="w-4 h-4"}){return C1.jsxDEV("svg",{className:Y,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:C1.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 CO({className:Y="w-4 h-4"}){return C1.jsxDEV("svg",{className:Y,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:C1.jsxDEV("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"},void 0,!1,void 0,this)},void 0,!1,void 0,this)}var e9=q0(I1(),1);var z7=q0(I1(),1);var r1=q0(I1(),1),VQ=q0(I1(),1),Iz=q0(I1(),1);function vO(Y){var G,U,W="";if(typeof Y=="string"||typeof Y=="number")W+=Y;else if(typeof Y=="object")if(Array.isArray(Y)){var q=Y.length;for(G=0;G<q;G++)Y[G]&&(U=vO(Y[G]))&&(W&&(W+=" "),W+=U)}else for(U in Y)Y[U]&&(W&&(W+=" "),W+=U);return W}function SO(){for(var Y,G,U=0,W="",q=arguments.length;U<q;U++)(Y=arguments[U])&&(G=vO(Y))&&(W&&(W+=" "),W+=G);return W}var rP=(Y)=>{let G=sP(Y),{conflictingClassGroups:U,conflictingClassGroupModifiers:W}=Y;return{getClassGroupId:(L)=>{let _=L.split("-");if(_[0]===""&&_.length!==1)_.shift();return yO(_,G)||tP(L)},getConflictingClassGroupIds:(L,_)=>{let k=U[L]||[];if(_&&W[L])return[...k,...W[L]];return k}}},yO=(Y,G)=>{if(Y.length===0)return G.classGroupId;let U=Y[0],W=G.nextPart.get(U),q=W?yO(Y.slice(1),W):void 0;if(q)return q;if(G.validators.length===0)return;let R=Y.join("-");return G.validators.find(({validator:L})=>L(R))?.classGroupId},fO=/^\[(.+)\]$/,tP=(Y)=>{if(fO.test(Y)){let G=fO.exec(Y)[1],U=G?.substring(0,G.indexOf(":"));if(U)return"arbitrary.."+U}},sP=(Y)=>{let{theme:G,prefix:U}=Y,W={nextPart:new Map,validators:[]};return zA(Object.entries(Y.classGroups),U).forEach(([R,L])=>{p9(L,W,R,G)}),W},p9=(Y,G,U,W)=>{Y.forEach((q)=>{if(typeof q==="string"){let R=q===""?G:hO(G,q);R.classGroupId=U;return}if(typeof q==="function"){if(eP(q)){p9(q(W),G,U,W);return}G.validators.push({validator:q,classGroupId:U});return}Object.entries(q).forEach(([R,L])=>{p9(L,hO(G,R),U,W)})})},hO=(Y,G)=>{let U=Y;return G.split("-").forEach((W)=>{if(!U.nextPart.has(W))U.nextPart.set(W,{nextPart:new Map,validators:[]});U=U.nextPart.get(W)}),U},eP=(Y)=>Y.isThemeGetter,zA=(Y,G)=>{if(!G)return Y;return Y.map(([U,W])=>{let q=W.map((R)=>{if(typeof R==="string")return G+R;if(typeof R==="object")return Object.fromEntries(Object.entries(R).map(([L,_])=>[G+L,_]));return R});return[U,q]})},QA=(Y)=>{if(Y<1)return{get:()=>{return},set:()=>{}};let G=0,U=new Map,W=new Map,q=(R,L)=>{if(U.set(R,L),G++,G>Y)G=0,W=U,U=new Map};return{get(R){let L=U.get(R);if(L!==void 0)return L;if((L=W.get(R))!==void 0)return q(R,L),L},set(R,L){if(U.has(R))U.set(R,L);else q(R,L)}}};var XA=(Y)=>{let{separator:G,experimentalParseClassName:U}=Y,W=G.length===1,q=G[0],R=G.length,L=(_)=>{let k=[],I=0,F=0,w;for(let V=0;V<_.length;V++){let v=_[V];if(I===0){if(v===q&&(W||_.slice(V,V+R)===G)){k.push(_.slice(F,V)),F=V+R;continue}if(v==="/"){w=V;continue}}if(v==="[")I++;else if(v==="]")I--}let b=k.length===0?_:_.substring(F),C=b.startsWith("!"),f=C?b.substring(1):b,E=w&&w>F?w-F:void 0;return{modifiers:k,hasImportantModifier:C,baseClassName:f,maybePostfixModifierPosition:E}};if(U)return(_)=>U({className:_,parseClassName:L});return L},ZA=(Y)=>{if(Y.length<=1)return Y;let G=[],U=[];return Y.forEach((W)=>{if(W[0]==="[")G.push(...U.sort(),W),U=[];else U.push(W)}),G.push(...U.sort()),G},JA=(Y)=>({cache:QA(Y.cacheSize),parseClassName:XA(Y),...rP(Y)}),YA=/\s+/,$A=(Y,G)=>{let{parseClassName:U,getClassGroupId:W,getConflictingClassGroupIds:q}=G,R=[],L=Y.trim().split(YA),_="";for(let k=L.length-1;k>=0;k-=1){let I=L[k],{modifiers:F,hasImportantModifier:w,baseClassName:b,maybePostfixModifierPosition:C}=U(I),f=Boolean(C),E=W(f?b.substring(0,C):b);if(!E){if(!f){_=I+(_.length>0?" "+_:_);continue}if(E=W(b),!E){_=I+(_.length>0?" "+_:_);continue}f=!1}let V=ZA(F).join(":"),v=w?V+"!":V,T=v+E;if(R.includes(T))continue;R.push(T);let D=q(E,f);for(let n=0;n<D.length;++n){let p=D[n];R.push(v+p)}_=I+(_.length>0?" "+_:_)}return _};function HA(){let Y=0,G,U,W="";while(Y<arguments.length)if(G=arguments[Y++]){if(U=VO(G))W&&(W+=" "),W+=U}return W}var VO=(Y)=>{if(typeof Y==="string")return Y;let G,U="";for(let W=0;W<Y.length;W++)if(Y[W]){if(G=VO(Y[W]))U&&(U+=" "),U+=G}return U};function GA(Y,...G){let U,W,q,R=L;function L(k){let I=G.reduce((F,w)=>w(F),Y());return U=JA(I),W=U.cache.get,q=U.cache.set,R=_,_(k)}function _(k){let I=W(k);if(I)return I;let F=$A(k,U);return q(k,F),F}return function(){return R(HA.apply(null,arguments))}}var f4=(Y)=>{let G=(U)=>U[Y]||[];return G.isThemeGetter=!0,G},DO=/^\[(?:([a-z-]+):)?(.+)\]$/i,qA=/^\d+\/\d+$/,BA=new Set(["px","full","screen"]),UA=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,KA=/\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$/,OA=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,WA=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,LA=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,i7=(Y)=>fQ(Y)||BA.has(Y)||qA.test(Y),T8=(Y)=>hQ(Y,"length",PA),fQ=(Y)=>Boolean(Y)&&!Number.isNaN(Number(Y)),j9=(Y)=>hQ(Y,"number",fQ),hZ=(Y)=>Boolean(Y)&&Number.isInteger(Number(Y)),_A=(Y)=>Y.endsWith("%")&&fQ(Y.slice(0,-1)),v1=(Y)=>DO.test(Y),C8=(Y)=>UA.test(Y),RA=new Set(["length","size","percentage"]),NA=(Y)=>hQ(Y,RA,EO),wA=(Y)=>hQ(Y,"position",EO),bA=new Set(["image","url"]),FA=(Y)=>hQ(Y,bA,IA),MA=(Y)=>hQ(Y,"",AA),yZ=()=>!0,hQ=(Y,G,U)=>{let W=DO.exec(Y);if(W){if(W[1])return typeof G==="string"?W[1]===G:G.has(W[1]);return U(W[2])}return!1},PA=(Y)=>KA.test(Y)&&!OA.test(Y),EO=()=>!1,AA=(Y)=>WA.test(Y),IA=(Y)=>LA.test(Y);var kA=()=>{let Y=f4("colors"),G=f4("spacing"),U=f4("blur"),W=f4("brightness"),q=f4("borderColor"),R=f4("borderRadius"),L=f4("borderSpacing"),_=f4("borderWidth"),k=f4("contrast"),I=f4("grayscale"),F=f4("hueRotate"),w=f4("invert"),b=f4("gap"),C=f4("gradientColorStops"),f=f4("gradientColorStopPositions"),E=f4("inset"),V=f4("margin"),v=f4("opacity"),T=f4("padding"),D=f4("saturate"),n=f4("scale"),p=f4("sepia"),r=f4("skew"),J0=f4("space"),i=f4("translate"),t=()=>["auto","contain","none"],l=()=>["auto","hidden","clip","visible","scroll"],j=()=>["auto",v1,G],c=()=>[v1,G],X0=()=>["",i7,T8],I0=()=>["auto",fQ,v1],F0=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Q1=()=>["solid","dashed","dotted","double","none"],O1=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Q0=()=>["start","end","center","between","around","evenly","stretch"],U0=()=>["","0",v1],_0=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Z0=()=>[fQ,v1];return{cacheSize:500,separator:":",theme:{colors:[yZ],spacing:[i7,T8],blur:["none","",C8,v1],brightness:Z0(),borderColor:[Y],borderRadius:["none","","full",C8,v1],borderSpacing:c(),borderWidth:X0(),contrast:Z0(),grayscale:U0(),hueRotate:Z0(),invert:U0(),gap:c(),gradientColorStops:[Y],gradientColorStopPositions:[_A,T8],inset:j(),margin:j(),opacity:Z0(),padding:c(),saturate:Z0(),scale:Z0(),sepia:U0(),skew:Z0(),space:c(),translate:c()},classGroups:{aspect:[{aspect:["auto","square","video",v1]}],container:["container"],columns:[{columns:[C8]}],"break-after":[{"break-after":_0()}],"break-before":[{"break-before":_0()}],"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:[...F0(),v1]}],overflow:[{overflow:l()}],"overflow-x":[{"overflow-x":l()}],"overflow-y":[{"overflow-y":l()}],overscroll:[{overscroll:t()}],"overscroll-x":[{"overscroll-x":t()}],"overscroll-y":[{"overscroll-y":t()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[E]}],"inset-x":[{"inset-x":[E]}],"inset-y":[{"inset-y":[E]}],start:[{start:[E]}],end:[{end:[E]}],top:[{top:[E]}],right:[{right:[E]}],bottom:[{bottom:[E]}],left:[{left:[E]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",hZ,v1]}],basis:[{basis:j()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",v1]}],grow:[{grow:U0()}],shrink:[{shrink:U0()}],order:[{order:["first","last","none",hZ,v1]}],"grid-cols":[{"grid-cols":[yZ]}],"col-start-end":[{col:["auto",{span:["full",hZ,v1]},v1]}],"col-start":[{"col-start":I0()}],"col-end":[{"col-end":I0()}],"grid-rows":[{"grid-rows":[yZ]}],"row-start-end":[{row:["auto",{span:[hZ,v1]},v1]}],"row-start":[{"row-start":I0()}],"row-end":[{"row-end":I0()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",v1]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",v1]}],gap:[{gap:[b]}],"gap-x":[{"gap-x":[b]}],"gap-y":[{"gap-y":[b]}],"justify-content":[{justify:["normal",...Q0()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...Q0(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...Q0(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[T]}],px:[{px:[T]}],py:[{py:[T]}],ps:[{ps:[T]}],pe:[{pe:[T]}],pt:[{pt:[T]}],pr:[{pr:[T]}],pb:[{pb:[T]}],pl:[{pl:[T]}],m:[{m:[V]}],mx:[{mx:[V]}],my:[{my:[V]}],ms:[{ms:[V]}],me:[{me:[V]}],mt:[{mt:[V]}],mr:[{mr:[V]}],mb:[{mb:[V]}],ml:[{ml:[V]}],"space-x":[{"space-x":[J0]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[J0]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",v1,G]}],"min-w":[{"min-w":[v1,G,"min","max","fit"]}],"max-w":[{"max-w":[v1,G,"none","full","min","max","fit","prose",{screen:[C8]},C8]}],h:[{h:[v1,G,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[v1,G,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[v1,G,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[v1,G,"auto","min","max","fit"]}],"font-size":[{text:["base",C8,T8]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",j9]}],"font-family":[{font:[yZ]}],"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",v1]}],"line-clamp":[{"line-clamp":["none",fQ,j9]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",i7,v1]}],"list-image":[{"list-image":["none",v1]}],"list-style-type":[{list:["none","disc","decimal",v1]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[Y]}],"placeholder-opacity":[{"placeholder-opacity":[v]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[Y]}],"text-opacity":[{"text-opacity":[v]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Q1(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",i7,T8]}],"underline-offset":[{"underline-offset":["auto",i7,v1]}],"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:c()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",v1]}],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",v1]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[v]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...F0(),wA]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",NA]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},FA]}],"bg-color":[{bg:[Y]}],"gradient-from-pos":[{from:[f]}],"gradient-via-pos":[{via:[f]}],"gradient-to-pos":[{to:[f]}],"gradient-from":[{from:[C]}],"gradient-via":[{via:[C]}],"gradient-to":[{to:[C]}],rounded:[{rounded:[R]}],"rounded-s":[{"rounded-s":[R]}],"rounded-e":[{"rounded-e":[R]}],"rounded-t":[{"rounded-t":[R]}],"rounded-r":[{"rounded-r":[R]}],"rounded-b":[{"rounded-b":[R]}],"rounded-l":[{"rounded-l":[R]}],"rounded-ss":[{"rounded-ss":[R]}],"rounded-se":[{"rounded-se":[R]}],"rounded-ee":[{"rounded-ee":[R]}],"rounded-es":[{"rounded-es":[R]}],"rounded-tl":[{"rounded-tl":[R]}],"rounded-tr":[{"rounded-tr":[R]}],"rounded-br":[{"rounded-br":[R]}],"rounded-bl":[{"rounded-bl":[R]}],"border-w":[{border:[_]}],"border-w-x":[{"border-x":[_]}],"border-w-y":[{"border-y":[_]}],"border-w-s":[{"border-s":[_]}],"border-w-e":[{"border-e":[_]}],"border-w-t":[{"border-t":[_]}],"border-w-r":[{"border-r":[_]}],"border-w-b":[{"border-b":[_]}],"border-w-l":[{"border-l":[_]}],"border-opacity":[{"border-opacity":[v]}],"border-style":[{border:[...Q1(),"hidden"]}],"divide-x":[{"divide-x":[_]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[_]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[v]}],"divide-style":[{divide:Q1()}],"border-color":[{border:[q]}],"border-color-x":[{"border-x":[q]}],"border-color-y":[{"border-y":[q]}],"border-color-s":[{"border-s":[q]}],"border-color-e":[{"border-e":[q]}],"border-color-t":[{"border-t":[q]}],"border-color-r":[{"border-r":[q]}],"border-color-b":[{"border-b":[q]}],"border-color-l":[{"border-l":[q]}],"divide-color":[{divide:[q]}],"outline-style":[{outline:["",...Q1()]}],"outline-offset":[{"outline-offset":[i7,v1]}],"outline-w":[{outline:[i7,T8]}],"outline-color":[{outline:[Y]}],"ring-w":[{ring:X0()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[Y]}],"ring-opacity":[{"ring-opacity":[v]}],"ring-offset-w":[{"ring-offset":[i7,T8]}],"ring-offset-color":[{"ring-offset":[Y]}],shadow:[{shadow:["","inner","none",C8,MA]}],"shadow-color":[{shadow:[yZ]}],opacity:[{opacity:[v]}],"mix-blend":[{"mix-blend":[...O1(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":O1()}],filter:[{filter:["","none"]}],blur:[{blur:[U]}],brightness:[{brightness:[W]}],contrast:[{contrast:[k]}],"drop-shadow":[{"drop-shadow":["","none",C8,v1]}],grayscale:[{grayscale:[I]}],"hue-rotate":[{"hue-rotate":[F]}],invert:[{invert:[w]}],saturate:[{saturate:[D]}],sepia:[{sepia:[p]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[U]}],"backdrop-brightness":[{"backdrop-brightness":[W]}],"backdrop-contrast":[{"backdrop-contrast":[k]}],"backdrop-grayscale":[{"backdrop-grayscale":[I]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[F]}],"backdrop-invert":[{"backdrop-invert":[w]}],"backdrop-opacity":[{"backdrop-opacity":[v]}],"backdrop-saturate":[{"backdrop-saturate":[D]}],"backdrop-sepia":[{"backdrop-sepia":[p]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[L]}],"border-spacing-x":[{"border-spacing-x":[L]}],"border-spacing-y":[{"border-spacing-y":[L]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",v1]}],duration:[{duration:Z0()}],ease:[{ease:["linear","in","out","in-out",v1]}],delay:[{delay:Z0()}],animate:[{animate:["none","spin","ping","pulse","bounce",v1]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[n]}],"scale-x":[{"scale-x":[n]}],"scale-y":[{"scale-y":[n]}],rotate:[{rotate:[hZ,v1]}],"translate-x":[{"translate-x":[i]}],"translate-y":[{"translate-y":[i]}],"skew-x":[{"skew-x":[r]}],"skew-y":[{"skew-y":[r]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",v1]}],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",v1]}],"caret-color":[{caret:[Y]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":c()}],"scroll-mx":[{"scroll-mx":c()}],"scroll-my":[{"scroll-my":c()}],"scroll-ms":[{"scroll-ms":c()}],"scroll-me":[{"scroll-me":c()}],"scroll-mt":[{"scroll-mt":c()}],"scroll-mr":[{"scroll-mr":c()}],"scroll-mb":[{"scroll-mb":c()}],"scroll-ml":[{"scroll-ml":c()}],"scroll-p":[{"scroll-p":c()}],"scroll-px":[{"scroll-px":c()}],"scroll-py":[{"scroll-py":c()}],"scroll-ps":[{"scroll-ps":c()}],"scroll-pe":[{"scroll-pe":c()}],"scroll-pt":[{"scroll-pt":c()}],"scroll-pr":[{"scroll-pr":c()}],"scroll-pb":[{"scroll-pb":c()}],"scroll-pl":[{"scroll-pl":c()}],"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",v1]}],fill:[{fill:[Y,"none"]}],"stroke-w":[{stroke:[i7,T8,j9]}],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 mO=GA(kA);var lO=q0(I1(),1),e5=q0(w4(),1),DQ=q0(I1(),1),D6=q0(w4(),1),iO=q0(w4(),1),a9=q0(w4(),1),EQ=q0(I1(),1),l4=q0(w4(),1),oO=q0(I1(),1),O6=q0(w4(),1),DZ=q0(w4(),1),C0=q0(w4(),1),G5=q0(w4(),1),r9=q0(w4(),1),s0=q0(w4(),1),D4=q0(w4(),1),a1=q0(w4(),1),u0=q0(w4(),1),R1=q0(w4(),1),VZ=q0(w4(),1),w7=q0(I1(),1),U1=q0(w4(),1),a7=q0(I1(),1),l0=q0(w4(),1),z5=q0(w4(),1),LI=q0(I1(),1),aO=q0(w4(),1),t9=q0(I1(),1),s9=q0(w4(),1),_I=q0(I1(),1),nO=q0(w4(),1),rO=q0(I1(),1),tO=q0(w4(),1),RI=q0(I1(),1),sO=q0(w4(),1),eO=q0(w4(),1),zW=q0(w4(),1),CA=Object.defineProperty,vA=(Y,G,U)=>(G in Y)?CA(Y,G,{enumerable:!0,configurable:!0,writable:!0,value:U}):Y[G]=U,SA=(Y,G,U)=>vA(Y,typeof G!=="symbol"?G+"":G,U);function U4(...Y){return mO(SO(Y))}var AC=[{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)}],IC=[{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 fA(Y=1000){return new Promise((G)=>{setTimeout(()=>{G({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 hA(Y){let G=Y.toLowerCase();if(G.includes("analyze")||G.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(G.includes("sales")||G.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(G.includes("report")||G.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(G.includes("data")||G.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(G.includes("customer")||G.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 yA(Y){let G=hA(Y),U=Y.toLowerCase(),W=[],q;if(U.includes("sales")||U.includes("revenue")||U.includes("analyze"))W.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(U.includes("customer")||U.includes("user"))W.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(U.includes("task")||U.includes("todo")||U.includes("work")||U.includes("completed"))W.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:{}}]}),q={type:"update_database",payload:{table:"tasks",operation:"mark_as_viewed",taskIds:["task-1","task-2","task-3"],timestamp:new Date().toISOString()}};if(U.includes("analyze")||U.includes("analysis"))q={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:G,widgets:W,action:q}}function VA(Y,G,U,W,q=30){let{message:R,widgets:L}=yA(Y),_=R.split(" "),k=0,I=setInterval(()=>{try{if(k<_.length)G({type:"token",content:_[k]+" "}),k++;else{clearInterval(I),L.forEach((w)=>{G({type:"widget",widget:w})});let F=`mock_thread_${Date.now()}`;G({type:"complete"}),U(F)}}catch(F){clearInterval(I),W(F instanceof Error?F:Error("Mock streaming error"))}},q)}function DA(Y){return new Promise((G,U)=>{let W=new FileReader;W.onload=()=>{let R=W.result.split(",")[1];G(R)},W.onerror=()=>U(Error("Failed to read file")),W.readAsDataURL(Y)})}function EA(Y){if(Y.startsWith("image/"))return"image";return"document"}function mA(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 uA(Y){let G=await DA(Y);return{type:EA(Y.type),source:{type:"base64",media_type:Y.type,data:G}}}async function gA(Y){let G=Array.from(Y);return await Promise.all(G.map((W)=>uA(W)))}async function uO(Y,G){if(!G||G.length===0)return Y;let U=[];if(Y.trim())U.push({type:"text",text:Y.trim()});let W=await gA(G);return U.push(...W),U}function G3(Y){if(Y<1024)return`${Y} B`;if(Y<1048576)return`${(Y/1024).toFixed(1)} KB`;return`${(Y/1048576).toFixed(1)} MB`}var gO=10485760;function pO(Y){if(!mA(Y))return{valid:!1,error:`Unsupported file type: ${Y.type}`};if(Y.size>gO)return{valid:!1,error:`File too large: ${G3(Y.size)} (max ${G3(gO)})`};return{valid:!0}}var xA=["list","table"];function jA(Y){let G=[],U=!1,W=Y.match(/"items"\s*:\s*\[/);if(!W)return{items:G,isStreaming:!1};let q=Y.indexOf("[",W.index);if(q===-1)return{items:G,isStreaming:!0};let R=0,L=!1,_=!1,k=-1;for(let w=q+1;w<Y.length;w++){let b=Y[w];if(_){_=!1;continue}if(b==="\\"&&L){_=!0;continue}if(b==='"'){L=!L;continue}if(L)continue;if(b==="{"){if(R===0)k=w;R++}else if(b==="}"){if(R--,R===0&&k!==-1){let C=Y.slice(k,w+1);try{let f=JSON.parse(C);if(!f.id)f.id=`item-${G.length}-${i9(C)}`;G.push(f)}catch(f){}k=-1}}else if(b==="]"&&R===0){U=!1;break}}if(R>0||k!==-1)U=!0;let I=Y.slice(q);if(o9(I,0)===-1)U=!0;return{items:G,isStreaming:U}}function i9(Y){let G=0;for(let U=0;U<Y.length;U++){let W=Y.charCodeAt(U);G=(G<<5)-G+W,G=G&G}return Math.abs(G).toString(36)}function o9(Y,G){let U=0,W=!1,q=!1;for(let R=G;R<Y.length;R++){let L=Y[R];if(q){q=!1;continue}if(L==="\\"&&W){q=!0;continue}if(L==='"'){W=!W;continue}if(W)continue;if(L==="["||L==="{")U++;else if(L==="]"||L==="}"){if(U--,U===0)return R}}return-1}function H3(Y){let G=[],U=!1,W=!1,q=0,R=null,L=Y,_=Y.lastIndexOf("@ui:");if(_!==-1){let F=Y.slice(_),w=F.match(/^@ui:(\w+)/);if(w){let b=w[1],C=F.indexOf("[");if(C===-1)L=Y.slice(0,_),R=b,W=!0;else{let f=_+C;if(o9(Y,f)===-1)if(xA.includes(b)){let V=Y.slice(f+1),{items:v,isStreaming:T}=jA(V);if(v.length>0){L=Y.slice(0,_);let D=`widget-${b}-streaming-${i9(V)}`,n=L.replace(/[\s:;\-–—\.]+$/g,"").trim();if(n)G.push({type:"text",content:n});G.push({type:"widget",widget:{type:b,id:D,props:b==="table"?{rows:v,columns:[]}:{items:v},isStreaming:T}}),U=!0,W=!1,L=""}else L=Y.slice(0,_),R=b,W=!0}else L=Y.slice(0,_),R=b,W=!0}}}if(W)L=L.replace(/[\s:;\-–—\.]+$/g,"");let k=/@ui:(\w+)\[/g,I;while((I=k.exec(L))!==null){let F=I[1],w=I.index+I[0].length-1,b=o9(L,w);if(b===-1)continue;let C=L.slice(w+1,b);if(I.index>q){let f=L.slice(q,I.index).trim();if(f)G.push({type:"text",content:f})}try{let f=C.trim(),E=JSON.parse(f),V=`widget-${F}-${i9(f)}`,{metadata:v,actions:T,...D}=E;G.push({type:"widget",widget:{type:F,id:V,props:D,...T&&{actions:T},...v&&{metadata:v}}}),U=!0}catch(f){}q=b+1,k.lastIndex=q}if(q<L.length){let F=L.slice(q).trim();if(F)G.push({type:"text",content:F})}if(G.length===0&&L.trim())G.push({type:"text",content:L.trim()});if(R)G.push({type:"widget_pending",pendingType:R});return{segments:G,hasWidgets:U,hasPendingWidget:W}}var dO={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"}]}]'}},pA=Object.keys(dO),dA=["flow"],cO=pA.filter((Y)=>!dA.includes(Y));function cA(Y){let G=Y||cO,U=`
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 W of G){let q=dO[W];if(!q)continue;U+=`${W}: ${q.schema} | ${q.example}
182
+ `}return U+=`
183
+ Per-item "metadata" is sent as payload on action click.
184
+ `,U}function lA(Y){return`
185
+ Widgets: @ui:type[{json}] - MUST use square brackets []. Example: @ui:list[{"items": [...]}]. Types: ${(Y||cO).join(", ")}. Per-item "metadata" is sent as action payload.
186
+ `}function iA({widget:Y,onAction:G}){let{title:U,description:W,image:q,footer:R}=Y.props;return e5.jsxs("div",{className:"border border-neutral-200 dark:border-neutral-700 rounded-xl bg-white dark:bg-neutral-900 overflow-hidden",children:[q&&e5.jsx("img",{src:q,alt:U,className:"w-full h-48 object-cover"}),e5.jsxs("div",{className:"p-4",children:[e5.jsx("h3",{className:"!text-lg font-semibold !text-neutral-900 dark:!text-white",children:U}),W&&e5.jsx("p",{className:"!text-neutral-600 dark:!text-neutral-400 mt-2",children:W})]}),(R||Y.actions&&Y.actions.length>0)&&e5.jsxs("div",{className:"border-t border-neutral-200 dark:border-neutral-700 p-4 flex justify-between items-center",children:[R&&e5.jsx("span",{className:"!text-sm !text-neutral-600 dark:!text-neutral-400",children:R}),Y.actions&&Y.actions.length>0&&e5.jsx("div",{className:"flex gap-2",children:Y.actions.map((L,_)=>e5.jsx("button",{onClick:()=>G?.({type:L.type,payload:L.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:L.label},_))})]})]})}function oA({widget:Y,onAction:G}){let{items:U}=Y.props,W=Y.isStreaming??!1,q=DQ.useRef(new Set),[R,L]=DQ.useState(new Set);return DQ.useEffect(()=>{let _=new Set(U.map((I)=>I.id)),k=new Set;if(U.forEach((I)=>{if(!q.current.has(I.id))k.add(I.id)}),U.forEach((I)=>q.current.add(I.id)),k.size>0){L(k);let I=setTimeout(()=>{L(new Set)},500);return()=>clearTimeout(I)}},[U]),D6.jsxs("div",{className:"border border-neutral-200 dark:border-neutral-700 rounded-xl bg-white dark:bg-neutral-900 overflow-hidden",children:[U.map((_,k)=>{let I=R.has(_.id),F=k===U.length-1;return D6.jsxs("div",{className:`apteva-list-item flex items-center p-4 transition-colors ${!F||W?"border-b border-neutral-200 dark:border-neutral-700":""} ${!_.backgroundColor?"hover:bg-neutral-50 dark:hover:bg-neutral-800":""} ${I?"apteva-list-item-new":""}`,style:_.backgroundColor?{backgroundColor:_.backgroundColor}:void 0,children:[_.image&&D6.jsx("img",{src:_.image,alt:_.title,className:"w-16 h-16 rounded object-cover"}),D6.jsxs("div",{className:`flex-1 ${_.image?"ml-4":""}`,children:[D6.jsx("h4",{className:"font-semibold !text-neutral-900 dark:!text-white",children:_.title}),_.subtitle&&D6.jsx("p",{className:"!text-sm !text-neutral-600 dark:!text-neutral-400",children:_.subtitle}),_.description&&D6.jsx("p",{className:"!text-xs !text-neutral-500 dark:!text-neutral-500 mt-1",children:_.description})]}),Y.actions&&Y.actions.length>0&&D6.jsx("div",{className:"flex gap-2",children:Y.actions.map((w,b)=>D6.jsx("button",{onClick:()=>G?.({type:w.type,payload:_.metadata||_,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},b))})]},_.id)}),W&&D6.jsxs("div",{className:"apteva-list-streaming flex items-center gap-3 p-4 text-neutral-500 dark:text-neutral-400",children:[D6.jsxs("div",{className:"apteva-streaming-dots flex gap-1",children:[D6.jsx("span",{className:"w-2 h-2 bg-current rounded-full animate-pulse",style:{animationDelay:"0ms"}}),D6.jsx("span",{className:"w-2 h-2 bg-current rounded-full animate-pulse",style:{animationDelay:"150ms"}}),D6.jsx("span",{className:"w-2 h-2 bg-current rounded-full animate-pulse",style:{animationDelay:"300ms"}})]}),D6.jsx("span",{className:"text-sm",children:"Loading more..."})]})]})}function aA({widget:Y,onAction:G}){let{label:U,variant:W="primary",disabled:q=!1}=Y.props;return iO.jsx("button",{onClick:()=>Y.actions?.[0]&&G?.({type:Y.actions[0].type,payload:Y.actions[0].payload,widgetId:Y.id,timestamp:new Date}),disabled:q,className:U4("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"}[W],{"opacity-50 cursor-not-allowed":q}),children:U})}function nA({widget:Y,onAction:G}){let{layout:U="horizontal",buttons:W}=Y.props,q={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"},R=(L)=>{return Y.actions?.find((_)=>_.payload?.buttonId===L)||Y.actions?.[0]};return a9.jsx("div",{className:U4("flex gap-2",U==="vertical"?"flex-col":"flex-row flex-wrap"),children:W.map((L)=>{let _=R(L.id);return a9.jsx("button",{onClick:()=>{if(_)G?.({type:_.type,payload:{..._.payload,buttonId:L.id},widgetId:Y.id,timestamp:new Date})},className:U4("px-4 py-2 rounded-lg font-medium transition-colors text-sm",q[L.variant||"secondary"]),children:L.label},L.id)})})}function rA({widget:Y,onAction:G}){let{columns:U,rows:W,caption:q,compact:R=!1,striped:L=!1}=Y.props,_=Y.isStreaming??!1,k=EQ.useRef(new Set),[I,F]=EQ.useState(new Set);EQ.useEffect(()=>{let b=new Set;if(W.forEach((C,f)=>{let E=C.id||`row-${f}`;if(!k.current.has(E))b.add(E)}),W.forEach((C,f)=>{let E=C.id||`row-${f}`;k.current.add(E)}),b.size>0){F(b);let C=setTimeout(()=>{F(new Set)},500);return()=>clearTimeout(C)}},[W]);let w=(b)=>{switch(b){case"center":return"text-center";case"right":return"text-right";default:return"text-left"}};return l4.jsx("div",{className:"border border-neutral-200 dark:border-neutral-700 rounded-xl bg-white dark:bg-neutral-900 overflow-hidden",children:l4.jsx("div",{className:"overflow-x-auto",children:l4.jsxs("table",{className:"w-full",children:[q&&l4.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:q}),l4.jsx("thead",{children:l4.jsx("tr",{className:"bg-neutral-50 dark:bg-neutral-800 border-b border-neutral-200 dark:border-neutral-700",children:U.map((b)=>l4.jsx("th",{className:U4("font-semibold text-neutral-900 dark:text-white",R?"px-3 py-2 text-xs":"px-4 py-3 text-sm",w(b.align)),style:b.width?{width:b.width}:void 0,children:b.label},b.key))})}),l4.jsxs("tbody",{children:[W.map((b,C)=>{let f=b.id||`row-${C}`,E=I.has(f);return l4.jsx("tr",{className:U4("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",L&&C%2===1&&"bg-neutral-50/50 dark:bg-neutral-800/50",E&&"apteva-table-row-new"),onClick:()=>{if(Y.actions&&Y.actions.length>0)G?.({type:Y.actions[0].type,payload:b,widgetId:Y.id,timestamp:new Date})},style:{cursor:Y.actions?.length?"pointer":"default"},children:U.map((V)=>l4.jsx("td",{className:U4("text-neutral-700 dark:text-neutral-300",R?"px-3 py-2 text-xs":"px-4 py-3 text-sm",w(V.align)),children:b[V.key]??"—"},V.key))},f)}),W.length===0&&!_&&l4.jsx("tr",{children:l4.jsx("td",{colSpan:U.length||1,className:"px-4 py-8 text-center text-sm text-neutral-500 dark:text-neutral-400",children:"No data available"})}),_&&l4.jsx("tr",{className:"apteva-table-streaming",children:l4.jsx("td",{colSpan:U.length||1,className:"px-4 py-3 text-center",children:l4.jsxs("div",{className:"flex items-center justify-center gap-3 text-neutral-500 dark:text-neutral-400",children:[l4.jsxs("div",{className:"flex gap-1",children:[l4.jsx("span",{className:"w-2 h-2 bg-current rounded-full animate-pulse",style:{animationDelay:"0ms"}}),l4.jsx("span",{className:"w-2 h-2 bg-current rounded-full animate-pulse",style:{animationDelay:"150ms"}}),l4.jsx("span",{className:"w-2 h-2 bg-current rounded-full animate-pulse",style:{animationDelay:"300ms"}})]}),l4.jsx("span",{className:"text-sm",children:"Loading more..."})]})})})]})]})})})}function tA({widget:Y,onAction:G}){let{title:U,fields:W}=Y.props,[q,R]=oO.useState(()=>{let F={};return W.forEach((w)=>{F[w.name]=w.defaultValue??(w.type==="checkbox"?!1:"")}),F}),L=(F,w)=>{R((b)=>({...b,[F]:w}))},_=(F)=>{if(F.preventDefault(),Y.actions?.[0]&&G)G({type:Y.actions[0].type,payload:{...Y.actions[0].payload,formData:q},widgetId:Y.id,timestamp:new Date})},k=(F)=>{switch(F.type){case"text":case"password":case"number":case"date":return O6.jsx("input",{type:F.type,name:F.name,value:q[F.name]||"",onChange:(b)=>L(F.name,F.type==="number"?Number(b.target.value):b.target.value),placeholder:F.placeholder,required:F.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 O6.jsx("textarea",{name:F.name,value:q[F.name]||"",onChange:(b)=>L(F.name,b.target.value),placeholder:F.placeholder,required:F.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 O6.jsxs("select",{name:F.name,value:q[F.name]||"",onChange:(b)=>L(F.name,b.target.value),required:F.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:[O6.jsx("option",{value:"",children:F.placeholder||"Select..."}),F.options?.map((b)=>O6.jsx("option",{value:b.value,children:b.label},b.value))]});case"checkbox":return O6.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[O6.jsx("input",{type:"checkbox",name:F.name,checked:q[F.name]||!1,onChange:(b)=>L(F.name,b.target.checked),className:"w-4 h-4 rounded border-neutral-300 dark:border-neutral-600 text-blue-500 focus:ring-blue-500"}),O6.jsx("span",{className:"!text-neutral-700 dark:!text-neutral-300",children:F.label})]});default:return null}},I=Y.actions?.find((F)=>F.type==="submit")||Y.actions?.[0];return O6.jsxs("form",{onSubmit:_,className:"border border-neutral-200 dark:border-neutral-700 rounded-xl bg-white dark:bg-neutral-900 overflow-hidden",children:[O6.jsxs("div",{className:"p-4",children:[U&&O6.jsx("h3",{className:"!text-lg font-semibold !text-neutral-900 dark:!text-white mb-4",children:U}),O6.jsx("div",{className:"space-y-3",children:W.map((F)=>O6.jsxs("div",{className:F.type==="checkbox"?"":"space-y-1",children:[F.type!=="checkbox"&&O6.jsxs("label",{className:"block !text-sm font-medium !text-neutral-600 dark:!text-neutral-400",children:[F.label,F.required&&O6.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),k(F)]},F.name))})]}),I&&O6.jsx("div",{className:"px-4 pb-4",children:O6.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:I.label||"Submit"})})]})}function sA({widget:Y}){let{src:G,alt:U,caption:W}=Y.props;return DZ.jsxs("figure",{className:"overflow-hidden rounded-xl",children:[DZ.jsx("img",{src:G,alt:U,className:"w-full h-auto object-contain bg-neutral-100 dark:bg-neutral-800",loading:"lazy"}),W&&DZ.jsx("figcaption",{className:"mt-2 text-center text-sm text-neutral-600 dark:text-neutral-400",children:W})]})}function eA({type:Y,status:G}){if(G==="completed")return C0.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:C0.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2.5,d:"M5 13l4 4L19 7"})});if(G==="error")return C0.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:C0.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2.5,d:"M6 18L18 6M6 6l12 12"})});if(G==="active")return C0.jsx("div",{className:"w-3.5 h-3.5 rounded-full bg-current animate-pulse"});let U="w-4 h-4";if(Y==="time"||Y==="schedule"||Y==="clock")return C0.jsx("svg",{className:U,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:C0.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 C0.jsx("svg",{className:U,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:C0.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 C0.jsx("svg",{className:U,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:C0.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 C0.jsx("svg",{className:U,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:C0.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 C0.jsx("svg",{className:U,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:C0.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 C0.jsx("svg",{className:U,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:C0.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 C0.jsx("svg",{className:U,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:C0.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 C0.jsx("svg",{className:U,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:C0.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 C0.jsx("svg",{className:U,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:C0.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 10V3L4 14h7v7l9-11h-7z"})});if(Y==="push"||Y==="upload"||Y==="cloud")return C0.jsx("svg",{className:U,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:C0.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 C0.jsx("svg",{className:U,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:C0.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 C0.jsxs("svg",{className:U,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[C0.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}),C0.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 C0.jsx("svg",{className:U,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:C0.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 C0.jsx("svg",{className:U,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:C0.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 C0.jsx("svg",{className:U,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:C0.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 C0.jsx("svg",{className:U,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:C0.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 C0.jsx("svg",{className:U,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:C0.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 7h12m0 0l-4-4m4 4l-4 4m0 6H4m0 0l4 4m-4-4l4-4"})});return C0.jsx("div",{className:"w-2 h-2 rounded-full bg-current opacity-50"})}function zI({icon:Y}){if(Y==="research"||Y==="multi-agent"||Y==="agents")return C0.jsx("div",{className:"w-10 h-10 rounded-lg bg-purple-100 dark:bg-purple-500/20 flex items-center justify-center",children:C0.jsx("svg",{className:"w-6 h-6 text-purple-600 dark:text-purple-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:C0.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 10V3L4 14h7v7l9-11h-7z"})})});if(Y==="schedule"||Y==="report"||Y==="calendar")return C0.jsx("div",{className:"w-10 h-10 rounded-lg bg-amber-100 dark:bg-amber-500/20 flex items-center justify-center",children:C0.jsx("svg",{className:"w-6 h-6 text-amber-600 dark:text-amber-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:C0.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 C0.jsx("div",{className:"w-10 h-10 rounded-lg bg-cyan-100 dark:bg-cyan-500/20 flex items-center justify-center",children:C0.jsx("svg",{className:"w-6 h-6 text-cyan-600 dark:text-cyan-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:C0.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 C0.jsx("div",{className:"w-10 h-10 rounded-lg bg-cyan-100 dark:bg-cyan-500/20 flex items-center justify-center",children:C0.jsx("svg",{className:"w-6 h-6 text-cyan-600 dark:text-cyan-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:C0.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 C0.jsx("div",{className:"w-10 h-10 rounded-lg bg-blue-100 dark:bg-blue-500/20 flex items-center justify-center",children:C0.jsx("svg",{className:"w-6 h-6 text-blue-600 dark:text-blue-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:C0.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 10V3L4 14h7v7l9-11h-7z"})})});if(Y==="automation"||Y==="workflow"||Y==="process")return C0.jsx("div",{className:"w-10 h-10 rounded-lg bg-indigo-100 dark:bg-indigo-500/20 flex items-center justify-center",children:C0.jsx("svg",{className:"w-6 h-6 text-indigo-600 dark:text-indigo-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:C0.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 C0.jsx("div",{className:"w-10 h-10 rounded-lg bg-emerald-100 dark:bg-emerald-500/20 flex items-center justify-center",children:C0.jsx("svg",{className:"w-6 h-6 text-emerald-600 dark:text-emerald-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:C0.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 C0.jsx("div",{className:"w-10 h-10 rounded-lg bg-neutral-100 dark:bg-neutral-700 flex items-center justify-center",children:C0.jsx("svg",{className:"w-6 h-6 text-neutral-600 dark:text-neutral-300",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:C0.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 QI(){return C0.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:C0.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})}var s5={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 XI(Y,G){if(Y.color&&s5[Y.color])return s5[Y.color];if(G==="time"||G==="schedule"||G==="clock")return s5.blue;if(G==="agent"||G?.startsWith("@"))return s5.purple;if(G==="email"||G==="slack"||G==="message"||G==="notification")return s5.cyan;if(G==="generate"||G==="document"||G==="create")return s5.amber;if(G==="deploy"||G==="rocket"||G==="launch")return s5.rose;if(G==="build"||G==="compile"||G==="package")return s5.indigo;if(G==="test"||G==="check"||G==="verify")return s5.emerald;if(G==="data"||G==="database"||G==="storage")return s5.orange;return s5.blue}function ZI({widget:Y}){let{title:G,subtitle:U,icon:W,steps:q}=Y.props;return C0.jsxs("div",{className:"rounded-xl bg-white dark:bg-neutral-900 border border-neutral-200 dark:border-neutral-700 overflow-hidden",children:[C0.jsxs("div",{className:"px-4 py-4 flex items-center gap-4",children:[C0.jsx(zI,{icon:W}),C0.jsxs("div",{className:"flex-1 min-w-0",children:[C0.jsx("h3",{className:"font-semibold text-base text-neutral-900 dark:text-white truncate",children:G}),U&&C0.jsx("p",{className:"text-sm text-neutral-500 dark:text-neutral-400 truncate mt-0.5",children:U})]})]}),C0.jsx("div",{className:"px-4 pb-4",children:C0.jsx("div",{className:"flex flex-wrap items-center gap-2",children:q.map((R,L)=>{let _=L===q.length-1,k=R.status==="active",I=R.status==="completed",F=R.status==="error",w=R.status==="skipped",b=R.label,C=R.type;if(!C)if(b.startsWith("@"))C="agent";else if(/^\d+[ap]m$/i.test(b)||/^(mon|tue|wed|thu|fri|sat|sun)/i.test(b))C="time";else{let V=b.toLowerCase();C={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"}[V]}let f,E="";if(k)f="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(I)f="bg-emerald-100 dark:bg-emerald-900/40 !text-emerald-700 dark:!text-emerald-300 border-emerald-400 dark:border-emerald-400";else if(F)f="bg-red-100 dark:bg-red-900/40 !text-red-700 dark:!text-red-300 border-red-400 dark:border-red-400";else if(w)f="bg-neutral-100 dark:bg-neutral-800 !text-neutral-400 dark:!text-neutral-500 border-neutral-300 dark:border-neutral-600",E="line-through";else f=XI(R,C);return C0.jsxs("div",{className:"flex items-center gap-2",children:[C0.jsxs("span",{className:`inline-flex items-center gap-2 px-4 py-2 rounded-lg text-sm font-medium border transition-colors ${f} ${E}`,children:[C0.jsx(eA,{type:C,status:R.status}),b]}),!_&&C0.jsx(QI,{})]},R.id)})})})]})}function n9({widget:Y,onAction:G}){return G5.jsx("div",{className:"apteva-widget",children:(()=>{switch(Y.type){case"card":return G5.jsx(iA,{widget:Y,onAction:G});case"list":return G5.jsx(oA,{widget:Y,onAction:G});case"button":return G5.jsx(aA,{widget:Y,onAction:G});case"button_group":return G5.jsx(nA,{widget:Y,onAction:G});case"table":return G5.jsx(rA,{widget:Y,onAction:G});case"form":return G5.jsx(tA,{widget:Y,onAction:G});case"image":return G5.jsx(sA,{widget:Y});case"flow":return G5.jsx(ZI,{widget:Y});default:return G5.jsxs("div",{className:"p-4 border border-yellow-300 bg-yellow-50 rounded-lg",children:[G5.jsxs("p",{className:"text-sm text-yellow-800",children:["Unknown widget type: ",Y.type]}),G5.jsx("pre",{className:"text-xs mt-2 overflow-auto",children:JSON.stringify(Y,null,2)})]})}})()})}function c9({widgets:Y,onAction:G,onWidgetMount:U,layout:W="stack",spacing:q="normal",columns:R=3,className:L}){lO.useEffect(()=>{Y.forEach((I)=>{U?.(I.id)})},[Y,U]);let _={stack:"flex flex-col",grid:`grid grid-cols-1 md:grid-cols-${R}`,masonry:"columns-1 md:columns-2 lg:columns-3"},k={tight:"gap-2",normal:"gap-4",loose:"gap-6"};return r9.jsx("div",{className:U4(_[W],k[q],L),children:Y.map((I)=>r9.jsx(n9,{widget:I,onAction:G},I.id))})}function xO({type:Y,className:G}){switch(Y){case"card":return s0.jsx("div",{className:U4("apteva-widget-skeleton animate-pulse rounded-lg border border-neutral-200 dark:border-neutral-800 overflow-hidden",G),children:s0.jsxs("div",{className:"p-4 space-y-3",children:[s0.jsx("div",{className:"h-4 bg-neutral-200 dark:bg-neutral-700 rounded w-3/4"}),s0.jsx("div",{className:"h-3 bg-neutral-200 dark:bg-neutral-700 rounded w-full"}),s0.jsx("div",{className:"h-3 bg-neutral-200 dark:bg-neutral-700 rounded w-5/6"})]})});case"list":return s0.jsx("div",{className:U4("apteva-widget-skeleton animate-pulse space-y-2",G),children:[1,2,3].map((U)=>s0.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg border border-neutral-200 dark:border-neutral-800",children:[s0.jsx("div",{className:"w-10 h-10 bg-neutral-200 dark:bg-neutral-700 rounded-full flex-shrink-0"}),s0.jsxs("div",{className:"flex-1 space-y-2",children:[s0.jsx("div",{className:"h-3 bg-neutral-200 dark:bg-neutral-700 rounded w-1/2"}),s0.jsx("div",{className:"h-2 bg-neutral-200 dark:bg-neutral-700 rounded w-3/4"})]})]},U))});case"button_group":return s0.jsxs("div",{className:U4("apteva-widget-skeleton animate-pulse flex gap-2",G),children:[s0.jsx("div",{className:"h-9 bg-neutral-200 dark:bg-neutral-700 rounded-lg w-20"}),s0.jsx("div",{className:"h-9 bg-neutral-200 dark:bg-neutral-700 rounded-lg w-20"}),s0.jsx("div",{className:"h-9 bg-neutral-200 dark:bg-neutral-700 rounded-lg w-20"})]});case"form":return s0.jsxs("div",{className:U4("apteva-widget-skeleton animate-pulse rounded-lg border border-neutral-200 dark:border-neutral-800 p-4 space-y-4",G),children:[s0.jsx("div",{className:"h-4 bg-neutral-200 dark:bg-neutral-700 rounded w-1/3"}),s0.jsxs("div",{className:"space-y-3",children:[s0.jsx("div",{className:"h-10 bg-neutral-200 dark:bg-neutral-700 rounded"}),s0.jsx("div",{className:"h-10 bg-neutral-200 dark:bg-neutral-700 rounded"})]}),s0.jsx("div",{className:"h-9 bg-neutral-200 dark:bg-neutral-700 rounded w-24"})]});case"chart":return s0.jsxs("div",{className:U4("apteva-widget-skeleton animate-pulse rounded-lg border border-neutral-200 dark:border-neutral-800 p-4",G),children:[s0.jsx("div",{className:"h-4 bg-neutral-200 dark:bg-neutral-700 rounded w-1/4 mb-4"}),s0.jsxs("div",{className:"flex items-end gap-2 h-32",children:[s0.jsx("div",{className:"flex-1 bg-neutral-200 dark:bg-neutral-700 rounded-t h-1/2"}),s0.jsx("div",{className:"flex-1 bg-neutral-200 dark:bg-neutral-700 rounded-t h-3/4"}),s0.jsx("div",{className:"flex-1 bg-neutral-200 dark:bg-neutral-700 rounded-t h-1/3"}),s0.jsx("div",{className:"flex-1 bg-neutral-200 dark:bg-neutral-700 rounded-t h-full"}),s0.jsx("div",{className:"flex-1 bg-neutral-200 dark:bg-neutral-700 rounded-t h-2/3"})]})]});case"image":return s0.jsx("div",{className:U4("apteva-widget-skeleton animate-pulse",G),children:s0.jsx("div",{className:"aspect-video bg-neutral-200 dark:bg-neutral-700 rounded-lg"})});case"gallery":return s0.jsx("div",{className:U4("apteva-widget-skeleton animate-pulse grid grid-cols-3 gap-2",G),children:[1,2,3].map((U)=>s0.jsx("div",{className:"aspect-square bg-neutral-200 dark:bg-neutral-700 rounded-lg"},U))});case"map":return s0.jsx("div",{className:U4("apteva-widget-skeleton animate-pulse",G),children:s0.jsx("div",{className:"h-48 bg-neutral-200 dark:bg-neutral-700 rounded-lg flex items-center justify-center",children:s0.jsxs("svg",{className:"w-8 h-8 text-neutral-400 dark:text-neutral-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:[s0.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"}),s0.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 s0.jsxs("div",{className:U4("apteva-widget-skeleton animate-pulse rounded-lg border border-neutral-200 dark:border-neutral-800 overflow-hidden",G),children:[s0.jsxs("div",{className:"flex bg-neutral-100 dark:bg-neutral-800 border-b border-neutral-200 dark:border-neutral-700",children:[s0.jsx("div",{className:"flex-1 px-4 py-3",children:s0.jsx("div",{className:"h-3 bg-neutral-300 dark:bg-neutral-600 rounded w-16"})}),s0.jsx("div",{className:"flex-1 px-4 py-3",children:s0.jsx("div",{className:"h-3 bg-neutral-300 dark:bg-neutral-600 rounded w-20"})}),s0.jsx("div",{className:"flex-1 px-4 py-3",children:s0.jsx("div",{className:"h-3 bg-neutral-300 dark:bg-neutral-600 rounded w-14"})})]}),[1,2,3].map((U)=>s0.jsxs("div",{className:"flex border-b border-neutral-200 dark:border-neutral-800 last:border-b-0",children:[s0.jsx("div",{className:"flex-1 px-4 py-3",children:s0.jsx("div",{className:"h-3 bg-neutral-200 dark:bg-neutral-700 rounded w-24"})}),s0.jsx("div",{className:"flex-1 px-4 py-3",children:s0.jsx("div",{className:"h-3 bg-neutral-200 dark:bg-neutral-700 rounded w-16"})}),s0.jsx("div",{className:"flex-1 px-4 py-3",children:s0.jsx("div",{className:"h-3 bg-neutral-200 dark:bg-neutral-700 rounded w-20"})})]},U))]});default:return s0.jsxs("div",{className:U4("apteva-widget-skeleton animate-pulse rounded-lg border border-neutral-200 dark:border-neutral-800 p-4",G),children:[s0.jsx("div",{className:"h-4 bg-neutral-200 dark:bg-neutral-700 rounded w-1/2 mb-2"}),s0.jsx("div",{className:"h-3 bg-neutral-200 dark:bg-neutral-700 rounded w-full"})]})}}function JI(Y){return/\.(jpg|jpeg|png|gif|webp|svg|bmp|ico)(\?.*)?$/i.test(Y)}function Az(Y,G=""){let U=[],W=/!\[([^\]]*)\]\(([^)]+)\)|\[([^\]]+)\]\(([^)]+)\)|(\*\*|__)(.+?)\5|`([^`]+)`/g,q=0,R,L=0;while((R=W.exec(Y))!==null){if(R.index>q)U.push(Y.slice(q,R.index));if(R[1]!==void 0||R[2]!==void 0){let _=R[1]||"",k=R[2];U.push(D4.jsx("img",{src:k,alt:_,className:"apteva-md-img"},`${G}img${L++}`))}else if(R[3]!==void 0||R[4]!==void 0){let _=R[3],k=R[4];if(JI(k))U.push(D4.jsx("img",{src:k,alt:_,className:"apteva-md-img"},`${G}img${L++}`));else U.push(D4.jsx("a",{href:k,target:"_blank",rel:"noopener noreferrer",className:"apteva-md-link",children:_},`${G}a${L++}`))}else if(R[5]!==void 0)U.push(D4.jsx("strong",{children:R[6]},`${G}b${L++}`));else if(R[7]!==void 0)U.push(D4.jsx("code",{className:"apteva-md-inline-code",children:R[7]},`${G}code${L++}`));q=R.index+R[0].length}if(q<Y.length)U.push(Y.slice(q));return U.length>0?U:[Y]}function YI(Y){let G=Y.split(`
187
+ `),U=[],W=0,q=0;while(q<G.length){let R=G[q],L=R.match(/^##\s+(.*)$/);if(L){U.push(D4.jsx("h2",{className:"apteva-md-h2",children:Az(L[1],`${W}`)},`h2${W++}`)),q++;continue}let _=R.match(/^###\s+(.*)$/);if(_){U.push(D4.jsx("h3",{className:"apteva-md-h3",children:Az(_[1],`${W}`)},`h3${W++}`)),q++;continue}let k=R.match(/^(\s*)([-*+])\s+(.*)$/);if(k){let w=[],b=k[1].length;while(q<G.length){let C=G[q].match(/^(\s*)([-*+])\s+(.*)$/);if(C&&C[1].length===b)w.push(D4.jsx("li",{className:"apteva-md-li",children:Az(C[3],`${W}`)},`li${W++}`)),q++;else break}U.push(D4.jsx("ul",{className:"apteva-md-ul",children:w},`ul${W++}`));continue}let I=R.match(/^(\s*)(\d+)\.\s+(.*)$/);if(I){let w=[],b=I[1].length;while(q<G.length){let C=G[q].match(/^(\s*)(\d+)\.\s+(.*)$/);if(C&&C[1].length===b)w.push(D4.jsx("li",{className:"apteva-md-li",children:Az(C[3],`${W}`)},`li${W++}`)),q++;else break}U.push(D4.jsx("ol",{className:"apteva-md-ol",children:w},`ol${W++}`));continue}if(R.match(/^\|(.+)\|$/)&&q+1<G.length){if(G[q+1].match(/^\|([\s:-]+\|)+$/)){let C=R.split("|").filter((E)=>E.trim()!=="").map((E)=>E.trim());q+=2;let f=[];while(q<G.length)if(G[q].match(/^\|(.+)\|$/)){let V=G[q].split("|").filter((v)=>v.trim()!=="").map((v)=>v.trim());f.push(V),q++}else break;U.push(D4.jsx("div",{className:"apteva-md-table-wrapper",children:D4.jsxs("table",{className:"apteva-md-table",children:[D4.jsx("thead",{children:D4.jsx("tr",{children:C.map((E,V)=>D4.jsx("th",{className:"apteva-md-th",children:Az(E,`th${W}${V}`)},`th${V}`))})}),D4.jsx("tbody",{children:f.map((E,V)=>D4.jsx("tr",{children:E.map((v,T)=>D4.jsx("td",{className:"apteva-md-td",children:Az(v,`td${W}${V}${T}`)},`td${T}`))},`tr${V}`))})]})},`table-wrapper${W++}`));continue}}if(R==="")U.push(D4.jsx("br",{},`br${W++}`));else U.push(D4.jsxs("span",{children:[Az(R,`${W}`),q<G.length-1?`
188
+ `:""]},`p${W++}`));q++}return U}function o7({content:Y,className:G=""}){return D4.jsx("div",{className:`apteva-md ${G}`,children:YI(Y)})}function $I({name:Y,status:G,isReceiving:U=!1,inputLength:W=0,streamOutput:q}){if(G==="preparing")return a1.jsxs("div",{className:"apteva-tool-card apteva-tool-card-preparing",children:[a1.jsxs("svg",{className:"apteva-tool-icon apteva-tool-icon-spin",fill:"none",viewBox:"0 0 24 24",children:[a1.jsx("circle",{className:"apteva-tool-spinner-track",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),a1.jsx("path",{className:"apteva-tool-spinner-fill",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),a1.jsxs("span",{className:"apteva-tool-label",children:[a1.jsx("strong",{children:Y}),a1.jsx("span",{className:"apteva-tool-status-text",children:" preparing..."})]})]});if(G==="running")return a1.jsxs("div",{className:"apteva-tool-card apteva-tool-card-running",children:[a1.jsxs("svg",{className:"apteva-tool-icon apteva-tool-icon-spin",fill:"none",viewBox:"0 0 24 24",children:[a1.jsx("circle",{className:"apteva-tool-spinner-track",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),a1.jsx("path",{className:"apteva-tool-spinner-fill",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),a1.jsxs("span",{className:"apteva-tool-label",children:[a1.jsx("strong",{children:Y}),q?a1.jsx("span",{className:"apteva-tool-stream-separator",children:" · "}):null,q?a1.jsx("span",{className:"apteva-tool-stream-output",children:q}):a1.jsxs(a1.Fragment,{children:[a1.jsx("span",{className:"apteva-tool-status-text",children:" running"}),a1.jsxs("span",{className:"apteva-tool-dots",children:[a1.jsx("span",{children:"."}),a1.jsx("span",{children:"."}),a1.jsx("span",{children:"."})]})]})]})]});if(G==="completed")return a1.jsxs("div",{className:"apteva-tool-card apteva-tool-card-completed",children:[a1.jsx("svg",{className:"apteva-tool-icon",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:a1.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),a1.jsx("span",{className:"apteva-tool-label",children:Y})]});return a1.jsxs("div",{className:"apteva-tool-card apteva-tool-card-error",children:[a1.jsx("svg",{className:"apteva-tool-icon",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:a1.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),a1.jsxs("span",{className:"apteva-tool-label",children:[Y," failed"]})]})}function HI({message:Y,onAction:G,enableWidgets:U,onWidgetRender:W}){let q=Y.role==="user",R=Y.metadata?.content_segments,L=Y.metadata?.isStreaming===!0,_=Y.content||R&&R.length>0,k=Iz.useRef(new Set),I=Iz.useMemo(()=>{if(!U||q||!Y.content)return[];return H3(Y.content).segments.filter((n)=>n.type==="widget"&&!!n.widget).map((n)=>n.widget)},[U,q,Y.content]);Iz.useEffect(()=>{if(W&&Y.widgets){for(let D of Y.widgets)if(!k.current.has(D.id))k.current.add(D.id),W(D)}},[Y.widgets,W]),Iz.useEffect(()=>{if(W&&I.length>0){for(let D of I)if(!k.current.has(D.id))k.current.add(D.id),W(D)}},[I,W]);let F=(D)=>{if(!U||q)return u0.jsx(o7,{content:D});let p=H3(D).segments.filter((r)=>r.type==="text"&&r.content).map((r)=>r.content).join("");if(!p.trim())return null;return u0.jsx(o7,{content:p})},w=()=>{if(!U||q||!Y.content)return null;let D=H3(Y.content),n=[],p="";if(D.segments.forEach((r,J0)=>{if(r.type==="text"&&r.content)p+=r.content;else if(r.type==="widget"&&r.widget){if(p.trim())n.push(u0.jsx("div",{className:"apteva-message-bubble apteva-message-assistant",children:u0.jsx("div",{className:"apteva-message-content-assistant",children:u0.jsx(o7,{content:p})})},`text-${J0}`)),p="";n.push(u0.jsx("div",{className:"apteva-widget-standalone",children:u0.jsx(n9,{widget:r.widget,onAction:G})},`widget-${J0}`))}else if(r.type==="widget_pending"&&r.pendingType){if(p.trim())n.push(u0.jsx("div",{className:"apteva-message-bubble apteva-message-assistant",children:u0.jsx("div",{className:"apteva-message-content-assistant",children:u0.jsx(o7,{content:p})})},`text-${J0}`)),p="";n.push(u0.jsx("div",{className:"apteva-widget-standalone",children:u0.jsx(xO,{type:r.pendingType})},`pending-${J0}`))}}),p.trim())n.push(u0.jsx("div",{className:"apteva-message-bubble apteva-message-assistant",children:u0.jsx("div",{className:"apteva-message-content-assistant",children:u0.jsx(o7,{content:p})})},"text-final"));return n.length>0?n:null},b=Y.metadata?.attachments||[],C=b.length>0,f=()=>{if(!C)return null;return u0.jsx("div",{className:"apteva-message-attachments flex flex-wrap gap-2 mb-2 justify-end",children:b.map((D,n)=>{let p=D.type.startsWith("image/"),r=D.type==="application/pdf";if(p&&D.preview)return u0.jsx("div",{className:"apteva-attachment-image relative rounded-lg overflow-hidden shadow-sm",children:u0.jsx("img",{src:D.preview,alt:D.name,className:"max-w-[150px] max-h-[150px] object-cover"})},n);return u0.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:[u0.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:r?u0.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:u0.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"})}):u0.jsx("svg",{className:"w-5 h-5",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"})})}),u0.jsxs("div",{className:"flex flex-col min-w-0",children:[u0.jsx("span",{className:"text-sm font-medium text-neutral-800 dark:text-neutral-200 truncate max-w-[180px]",children:D.name}),u0.jsxs("span",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:[r?"PDF":"Document"," · ",G3(D.size)]})]})]},n)})})},E=()=>{if(q)return u0.jsx("div",{className:"apteva-message-text",children:Y.content});if(L&&!_)return u0.jsxs("div",{className:"apteva-typing-indicator",children:[u0.jsx("span",{}),u0.jsx("span",{}),u0.jsx("span",{})]});if(R&&R.length>0)return null;return F(Y.content)},V=(D,n)=>{if(!U)return u0.jsx("div",{className:"apteva-message-bubble apteva-message-assistant",children:u0.jsx("div",{className:"apteva-message-content-assistant",children:u0.jsx(o7,{content:D})})},n);let p=H3(D),r=[],J0="";if(p.segments.forEach((i,t)=>{if(i.type==="text"&&i.content)J0+=i.content;else if(i.type==="widget"&&i.widget){if(J0.trim())r.push(u0.jsx("div",{className:"apteva-message-bubble apteva-message-assistant",children:u0.jsx("div",{className:"apteva-message-content-assistant",children:u0.jsx(o7,{content:J0})})},`${n}-text-${t}`)),J0="";r.push(u0.jsx("div",{className:"apteva-widget-standalone",children:u0.jsx(n9,{widget:i.widget,onAction:G})},`${n}-widget-${t}`))}else if(i.type==="widget_pending"&&i.pendingType){if(J0.trim())r.push(u0.jsx("div",{className:"apteva-message-bubble apteva-message-assistant",children:u0.jsx("div",{className:"apteva-message-content-assistant",children:u0.jsx(o7,{content:J0})})},`${n}-text-${t}`)),J0="";r.push(u0.jsx("div",{className:"apteva-widget-standalone",children:u0.jsx(xO,{type:i.pendingType})},`${n}-pending-${t}`))}}),J0.trim())r.push(u0.jsx("div",{className:"apteva-message-bubble apteva-message-assistant",children:u0.jsx("div",{className:"apteva-message-content-assistant",children:u0.jsx(o7,{content:J0})})},`${n}-text-final`));return r},v=()=>{if(!R||R.length===0)return null;let D=[];return R.forEach((n,p)=>{if(n.type==="text"&&n.content){let r=V(n.content,`seg-${p}`);if(Array.isArray(r))D.push(...r);else D.push(r)}else if(n.type==="tool")D.push(u0.jsx("div",{className:"apteva-tool-call-standalone",children:u0.jsx($I,{name:n.name,status:n.status||(n.result!==void 0?"completed":"running"),isReceiving:n.isReceiving,inputLength:n.inputLength,streamOutput:n.streamOutput})},n.id))}),D};if(!q&&(R&&R.length>0))return u0.jsxs("div",{className:"apteva-message-segmented",children:[v(),Y.widgets&&Y.widgets.length>0&&u0.jsx("div",{className:"apteva-widget-standalone",children:u0.jsx(c9,{widgets:Y.widgets,onAction:G,layout:"stack"})}),u0.jsx("div",{className:"apteva-message-timestamp apteva-message-timestamp-assistant",suppressHydrationWarning:!0,children:Y.timestamp.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]});let T=w();if(!q&&U&&T)return u0.jsxs("div",{className:"apteva-message-segmented",children:[T,Y.widgets&&Y.widgets.length>0&&u0.jsx("div",{className:"apteva-widget-standalone",children:u0.jsx(c9,{widgets:Y.widgets,onAction:G,layout:"stack"})}),u0.jsx("div",{className:"apteva-message-timestamp apteva-message-timestamp-assistant",suppressHydrationWarning:!0,children:Y.timestamp.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]});if(q&&C)return u0.jsxs("div",{className:"apteva-message-segmented apteva-message-user-with-attachments flex flex-col items-end",children:[f(),Y.content&&u0.jsx("div",{className:"apteva-message-bubble apteva-message-user",children:u0.jsx("div",{className:"apteva-message-content-user",children:u0.jsx("div",{className:"apteva-message-text",children:Y.content})})}),u0.jsx("div",{className:"apteva-message-timestamp apteva-message-timestamp-user",suppressHydrationWarning:!0,children:Y.timestamp.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]});return u0.jsxs("div",{className:U4("apteva-message-bubble",q?"apteva-message-user":"apteva-message-assistant"),children:[u0.jsx("div",{className:q?"apteva-message-content-user":"apteva-message-content-assistant",children:E()}),Y.widgets&&Y.widgets.length>0&&u0.jsx("div",{className:"apteva-widget-standalone",children:u0.jsx(c9,{widgets:Y.widgets,onAction:G,layout:"stack"})}),u0.jsx("div",{className:U4("apteva-message-timestamp",q?"apteva-message-timestamp-user":"apteva-message-timestamp-assistant"),suppressHydrationWarning:!0,children:Y.timestamp.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]})}var jO=()=>R1.jsx("svg",{className:"w-12 h-12 sm:w-16 sm:h-16",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:R1.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"})}),l9=()=>R1.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:R1.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 7l5 5m0 0l-5 5m5-5H6"})});function GI({title:Y,subtitle:G,icon:U,prompts:W,variant:q="centered",chatVariant:R="default",onPromptClick:L}){let _=(W||[]).map((F)=>typeof F==="string"?{text:F}:F),k=_.length>0,I=Y||G||U;if(!I&&!k)return R1.jsx("div",{className:"flex items-center justify-center h-full !text-neutral-500 dark:!text-neutral-400",children:R1.jsxs("div",{className:"text-center space-y-2",children:[R1.jsx("div",{className:"flex justify-center",children:R1.jsx(jO,{})}),R1.jsx("p",{className:"text-sm",children:"No messages yet. Start a conversation!"})]})});if(q==="minimal")return R1.jsxs("div",{className:"flex flex-col h-full px-4 py-4",children:[I&&R1.jsxs("div",{className:"mb-4",children:[Y&&R1.jsx("h2",{className:"text-lg font-semibold !text-neutral-900 dark:!text-white",children:Y}),G&&R1.jsx("p",{className:"text-sm !text-neutral-500 dark:!text-neutral-400 mt-1",children:G})]}),k&&R1.jsx("div",{className:"flex-1 space-y-2",children:_.map((F,w)=>R1.jsx("button",{onClick:()=>L(F.text),className:U4("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:R1.jsxs("div",{className:"flex items-center gap-3",children:[R1.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:F.icon||R1.jsx(l9,{})}),R1.jsxs("div",{className:"flex-1 min-w-0",children:[R1.jsx("p",{className:"text-sm font-medium !text-neutral-900 dark:!text-white truncate",children:F.text}),F.description&&R1.jsx("p",{className:"text-xs !text-neutral-500 dark:!text-neutral-400 mt-0.5 truncate",children:F.description})]})]})},w))})]});return R1.jsxs("div",{className:"flex flex-col items-center justify-center h-full px-4 py-6 sm:py-8",children:[R1.jsxs("div",{className:"text-center mb-6 sm:mb-8 max-w-md",children:[R1.jsx("div",{className:"mb-4 !text-neutral-400 dark:!text-neutral-500 flex justify-center",children:U||R1.jsx(jO,{})}),Y&&R1.jsx("h1",{className:"text-xl sm:text-2xl font-semibold !text-neutral-900 dark:!text-white mb-2",children:Y}),G&&R1.jsx("p",{className:"text-sm sm:text-base !text-neutral-500 dark:!text-neutral-400",children:G})]}),k&&R1.jsxs("div",{className:"w-full max-w-2xl",children:[R1.jsx("div",{className:"sm:hidden space-y-2",children:_.map((F,w)=>R1.jsx("button",{onClick:()=>L(F.text),className:U4("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:R1.jsxs("div",{className:"flex items-center gap-3",children:[R1.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:F.icon||R1.jsx(l9,{})}),R1.jsxs("div",{className:"flex-1 min-w-0",children:[R1.jsx("p",{className:"text-sm font-medium !text-neutral-900 dark:!text-white",children:F.text}),F.description&&R1.jsx("p",{className:"text-xs !text-neutral-500 dark:!text-neutral-400 mt-0.5 line-clamp-1",children:F.description})]}),R1.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:R1.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})]})},w))}),R1.jsx("div",{className:"hidden sm:grid sm:grid-cols-2 gap-3",children:_.map((F,w)=>R1.jsx("button",{onClick:()=>L(F.text),className:U4("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:R1.jsxs("div",{className:"flex items-start gap-3",children:[R1.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:F.icon||R1.jsx(l9,{})}),R1.jsxs("div",{className:"flex-1 min-w-0",children:[R1.jsx("p",{className:"text-sm font-medium !text-neutral-900 dark:!text-white leading-snug",children:F.text}),F.description&&R1.jsx("p",{className:"text-xs !text-neutral-500 dark:!text-neutral-400 mt-1 line-clamp-2",children:F.description})]})]})},w))})]})]})}function qI({messages:Y,onAction:G,welcomeTitle:U,welcomeSubtitle:W,welcomeIcon:q,suggestedPrompts:R,welcomeVariant:L,chatVariant:_,onPromptClick:k,enableWidgets:I,onWidgetRender:F}){let w=VQ.useRef(null),b=VQ.useRef(!0),C=VQ.useRef(0),f=()=>{if(w.current){let{scrollTop:E,scrollHeight:V,clientHeight:v}=w.current;b.current=V-E-v<100}};return VQ.useEffect(()=>{if(w.current&&b.current){let E=w.current.scrollHeight;if(E!==C.current)w.current.scrollTop=E,C.current=E}},[Y]),VZ.jsx("div",{ref:w,className:"apteva-message-list apteva-scrollbar-hidden",onScroll:f,children:Y.length===0?VZ.jsx(GI,{title:U,subtitle:W,icon:q,prompts:R,variant:L,chatVariant:_,onPromptClick:k||(()=>{})}):Y.map((E)=>VZ.jsx("div",{className:E.role==="user"?"apteva-message-row-user":"apteva-message-row-assistant",children:VZ.jsx(HI,{message:E,onAction:G,enableWidgets:I,onWidgetRender:F})},E.id))})}function BI({onSendMessage:Y,placeholder:G="Type a message...",disabled:U=!1,isLoading:W=!1,onStop:q,onFileUpload:R,onSwitchMode:L}){let[_,k]=w7.useState(""),[I,F]=w7.useState(!1),[w,b]=w7.useState([]),[C,f]=w7.useState(null),[E,V]=w7.useState(!1),v=w7.useRef(null),T=w7.useRef(null),D=w7.useRef(null),n=(l)=>{if(l.key==="Enter"&&!l.shiftKey)l.preventDefault(),p()},p=()=>{let l=_.trim(),j=w.length>0;if((l||j)&&!U){let c=w.map((X0)=>X0.file);if(Y(_.trim(),c.length>0?c:void 0),k(""),b([]),f(null),V(!1),v.current)v.current.style.height="auto"}},r=(l)=>{k(l.target.value),l.target.style.height="auto";let j=l.target.scrollHeight;l.target.style.height=`${j}px`;let c=l.target.value.includes(`
189
+ `),I0=j>36;if(!E&&(c||I0))V(!0);else if(E&&!c&&!I0&&l.target.value.length<20)V(!1)},J0=(l)=>{if(l.target.files&&l.target.files.length>0){let j=Array.from(l.target.files),c=[],X0=[];if(j.forEach((I0)=>{let F0=pO(I0);if(F0.valid){let Q1={file:I0};if(I0.type.startsWith("image/"))Q1.preview=URL.createObjectURL(I0);c.push(Q1)}else X0.push(F0.error||"Invalid file")}),c.length>0)b((I0)=>[...I0,...c]);if(X0.length>0)f(X0.join(", ")),setTimeout(()=>f(null),5000);R?.(l.target.files),F(!1),l.target.value=""}},i=(l)=>{b((j)=>{let c=j[l];if(c.preview)URL.revokeObjectURL(c.preview);return j.filter((X0,I0)=>I0!==l)})},t=(l)=>{if(l.startsWith("image/"))return U1.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:U1.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(l==="application/pdf")return U1.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:U1.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 U1.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:U1.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 U1.jsxs("div",{className:"px-4 py-3 relative",children:[C&&U1.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:U1.jsxs("div",{className:"flex items-center gap-2 !text-red-700 dark:!text-red-300 text-sm",children:[U1.jsx("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:U1.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),U1.jsx("span",{children:C})]})}),w.length>0&&U1.jsx("div",{className:"mb-2 flex flex-wrap gap-2",children:w.map((l,j)=>U1.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:[l.preview?U1.jsx("img",{src:l.preview,alt:l.file.name,className:"w-8 h-8 object-cover rounded"}):U1.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:t(l.file.type)}),U1.jsxs("div",{className:"flex flex-col min-w-0",children:[U1.jsx("span",{className:"text-xs font-medium !text-neutral-700 dark:!text-neutral-300 truncate max-w-[120px]",children:l.file.name}),U1.jsx("span",{className:"text-xs !text-neutral-500 dark:!text-neutral-400",children:G3(l.file.size)})]}),U1.jsx("button",{onClick:()=>i(j),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:U1.jsx("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:U1.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]},j))}),U1.jsxs("div",{className:"apteva-composer",style:{gridTemplateColumns:"auto 1fr auto",gridTemplateAreas:E?'"textarea textarea textarea" "plus . send"':'"plus textarea send"',alignItems:"end"},children:[U1.jsxs("div",{className:"relative flex-shrink-0 self-end",style:{gridArea:"plus"},children:[U1.jsx("button",{ref:D,onClick:()=>F(!I),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:U1.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:U1.jsx("path",{d:"M10 5v10M5 10h10",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),I&&U1.jsxs(U1.Fragment,{children:[U1.jsx("div",{className:"fixed inset-0 z-[9998]",onClick:()=>F(!1)}),U1.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:D.current?.getBoundingClientRect().left??0,bottom:window.innerHeight-(D.current?.getBoundingClientRect().top??0)+8},children:[U1.jsxs("button",{onClick:()=>{T.current?.click(),F(!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:[U1.jsx("svg",{width:"18",height:"18",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:U1.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)"})}),U1.jsx("span",{className:"!text-sm font-medium",children:"Add photos & files"})]}),L&&U1.jsxs("button",{onClick:()=>{L(),F(!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:[U1.jsx("svg",{className:"w-4.5 h-4.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:U1.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 10V3L4 14h7v7l9-11h-7z"})}),U1.jsx("span",{className:"!text-sm font-medium",children:"Switch to command mode"})]})]})]})]}),U1.jsx("textarea",{ref:v,value:_,onChange:r,onKeyDown:n,placeholder:G,disabled:U,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}),U1.jsx("div",{className:"self-end",style:{gridArea:"send"},children:W&&q?U1.jsx("button",{onClick:q,className:"apteva-composer-stop-btn",title:"Stop generation",children:U1.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:U1.jsx("rect",{x:"2",y:"2",width:"10",height:"10",rx:"1",fill:"currentColor"})})}):U1.jsx("button",{onClick:p,disabled:!_.trim()&&w.length===0||U,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:U1.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:U1.jsx("path",{d:"M8 3L8 13M8 3L4 7M8 3L12 7",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})})]}),U1.jsx("input",{ref:T,type:"file",multiple:!0,onChange:J0,className:"hidden",accept:"image/*,application/pdf,.doc,.docx,.txt"})]})}function UI({onExecute:Y,state:G,response:U,error:W,plan:q,streamedContent:R,toolName:L,onApprove:_,onReject:k,onReset:I,onStop:F,onExpand:w,placeholder:b="Enter your command...",disabled:C=!1}){let[f,E]=a7.useState(""),[V,v]=a7.useState([]),[T,D]=a7.useState(null),[n,p]=a7.useState(!1),r=a7.useRef(null),J0=a7.useRef(null),i=a7.useRef(null),t=()=>{let _0=f.trim(),Z0=V.length>0;if((_0||Z0)&&!C&&G==="idle"){let d=V.map((P0)=>P0.file);Y(f.trim(),d.length>0?d:void 0),E(""),v([])}},l=(_0)=>{if(_0.key==="Enter"&&!_0.shiftKey)_0.preventDefault(),t()},j=()=>{I?.(),r.current?.focus()},c=(_0)=>{if(E(_0),r.current)r.current.style.height="auto",r.current.style.height=`${Math.min(r.current.scrollHeight,120)}px`},X0=(_0)=>{if(_0.target.files&&_0.target.files.length>0){let Z0=Array.from(_0.target.files),d=[],P0=[];if(Z0.forEach((v0)=>{let X1=pO(v0);if(X1.valid){let r0={file:v0};if(v0.type.startsWith("image/"))r0.preview=URL.createObjectURL(v0);d.push(r0)}else P0.push(X1.error||"Invalid file")}),d.length>0)v((v0)=>[...v0,...d]);if(P0.length>0)D(P0.join(", ")),setTimeout(()=>D(null),5000);p(!1),_0.target.value=""}},I0=(_0)=>{v((Z0)=>{let d=Z0[_0];if(d.preview)URL.revokeObjectURL(d.preview);return Z0.filter((P0,v0)=>v0!==_0)})},F0=(_0)=>{if(_0.startsWith("image/"))return l0.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l0.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(_0==="application/pdf")return l0.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l0.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 l0.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l0.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"})})},Q1=()=>{if(G==="loading"){if(L)return{text:L,isToolCall:!0};if(R)return{text:R,isToolCall:!1};return{text:"Processing...",isToolCall:!1}}if(G==="success"&&U)return{text:U,isToolCall:!1};if(G==="error"&&W)return{text:W,isToolCall:!1};if(G==="plan-pending"&&q)return{text:q,isToolCall:!1};return{text:"",isToolCall:!1}},O1=G!=="idle",{text:Q0,isToolCall:U0}=Q1();return l0.jsxs("div",{className:"w-full relative",children:[T&&l0.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:l0.jsxs("div",{className:"flex items-center gap-2 !text-red-700 dark:!text-red-300 text-xs",children:[l0.jsx("svg",{className:"w-3 h-3 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l0.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),l0.jsx("span",{children:T})]})}),l0.jsxs("div",{className:U4("apteva-composer flex items-center gap-2 px-3 py-2 border-2 bg-white dark:bg-neutral-900 transition-all duration-200",G==="idle"&&"border-neutral-200 dark:border-neutral-700",G==="loading"&&"border-blue-400 dark:border-blue-500",G==="plan-pending"&&"border-amber-400 dark:border-amber-500",G==="success"&&"border-green-400 dark:border-green-500",G==="error"&&"border-red-400 dark:border-red-500"),children:[l0.jsxs("div",{className:"w-8 h-8 flex items-center justify-center flex-shrink-0",children:[G==="idle"&&l0.jsxs("div",{className:"relative",children:[l0.jsx("button",{ref:i,onClick:()=>p(!n),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:l0.jsx("svg",{width:"18",height:"18",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:l0.jsx("path",{d:"M10 5v10M5 10h10",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),n&&l0.jsxs(l0.Fragment,{children:[l0.jsx("div",{className:"fixed inset-0 z-[9998]",onClick:()=>p(!1)}),l0.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:i.current?.getBoundingClientRect().left??0,top:(i.current?.getBoundingClientRect().bottom??0)+8},children:[l0.jsxs("button",{onClick:()=>{J0.current?.click(),p(!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:[l0.jsx("svg",{width:"18",height:"18",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:l0.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)"})}),l0.jsx("span",{className:"!text-sm font-medium",children:"Add photos & files"})]}),w&&l0.jsxs("button",{onClick:()=>{w(),p(!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:[l0.jsx("svg",{className:"w-4.5 h-4.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l0.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"})}),l0.jsx("span",{className:"!text-sm font-medium",children:"Expand to chat"})]})]})]})]}),G==="loading"&&!L&&l0.jsx("div",{className:"w-4 h-4 border-2 border-blue-200 border-t-blue-500 rounded-full animate-spin"}),G==="loading"&&L&&l0.jsx("div",{className:"w-2 h-2 rounded-full bg-blue-500 animate-pulse"})]}),V.length>0&&G==="idle"&&l0.jsx("div",{className:"flex items-center gap-1 flex-shrink-0",children:V.map((_0,Z0)=>l0.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:_0.file.name,children:[_0.preview?l0.jsx("img",{src:_0.preview,alt:_0.file.name,className:"w-6 h-6 object-cover"}):l0.jsx("span",{className:"text-xs !text-neutral-500 dark:!text-neutral-400",children:F0(_0.file.type)}),l0.jsx("button",{onClick:()=>I0(Z0),className:"absolute inset-0 bg-black/50 opacity-0 group-hover:opacity-100 flex items-center justify-center transition-opacity",title:"Remove",children:l0.jsx("svg",{className:"w-3 h-3 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l0.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]},Z0))}),G==="idle"?l0.jsx("textarea",{ref:r,value:f,onChange:(_0)=>c(_0.target.value),onKeyDown:l,placeholder:V.length>0?"Add a message...":b,disabled:C,rows:1,className:U4("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"}}):l0.jsx("div",{className:U4("flex-1 text-sm py-1 truncate flex items-center gap-2",G==="loading"&&!U0&&"!text-neutral-600 dark:!text-neutral-400",G==="loading"&&U0&&"!text-blue-600 dark:!text-blue-400",G==="success"&&"!text-neutral-900 dark:!text-neutral-100",G==="error"&&"!text-red-600 dark:!text-red-400",G==="plan-pending"&&"!text-amber-700 dark:!text-amber-300"),children:U0?l0.jsxs(l0.Fragment,{children:[l0.jsx("span",{className:"font-mono",children:Q0}),l0.jsx("span",{className:"text-neutral-400 dark:text-neutral-500",children:"Running..."})]}):Q0}),l0.jsx("div",{className:"w-8 h-8 flex items-center justify-center flex-shrink-0",children:G==="plan-pending"?l0.jsxs("div",{className:"flex items-center gap-1",children:[l0.jsx("button",{onClick:_,className:"px-2 py-1 bg-amber-500 text-white rounded-lg hover:bg-amber-600 transition-colors text-xs font-medium",children:"Approve"}),l0.jsx("button",{onClick:k,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"})]}):l0.jsxs(l0.Fragment,{children:[G==="loading"&&F&&l0.jsx("button",{onClick:F,className:"apteva-composer-stop-btn",title:"Stop generation",children:l0.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:l0.jsx("rect",{x:"2",y:"2",width:"10",height:"10",rx:"1",fill:"currentColor"})})}),(G==="success"||G==="error")&&l0.jsx("button",{onClick:j,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:l0.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l0.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})}),G==="idle"&&l0.jsx("button",{onClick:t,disabled:!f.trim()&&V.length===0||C,className:U4("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",f.trim()||V.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:l0.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l0.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 12h14M12 5l7 7-7 7"})})})]})})]}),l0.jsx("input",{ref:J0,type:"file",multiple:!0,onChange:X0,className:"hidden",accept:"image/*,application/pdf,.doc,.docx,.txt"})]})}var KI="http://91.99.200.48:3000/agents",OI="agt_894abd5966bc9f1e9f8f17f2a6f6b5e0",WI=class{constructor(){SA(this,"config"),this.config={apiUrl:KI,apiKey:OI}}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 G=await fetch(`${this.config.apiUrl}/chat`,{method:"POST",headers:{"Content-Type":"application/json","X-API-Key":this.config.apiKey},body:JSON.stringify(Y)});if(!G.ok){let W=await G.json().catch(()=>({error:"Request failed"}));throw Error(W.error||`Request failed with status ${G.status}`)}let U=await G.json();return{message:U.response||U.message||"",thread_id:U.thread_id,widgets:U.widgets}}catch(G){throw console.error("Chat API error:",G),G}}async chatStream(Y,G,U,W){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 q=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(!q.ok){let I=await q.json().catch(()=>({error:"Request failed"}));throw Error(I.error||`Request failed with status ${q.status}`)}let R=q.body?.getReader();if(!R)throw Error("Response body is not readable");let L=new TextDecoder,_="",k="";while(!0){let{done:I,value:F}=await R.read();if(I)break;_+=L.decode(F,{stream:!0});let w=_.split(`
190
+ `);_=w.pop()||"";for(let b of w){if(!b.trim()||b.startsWith(":"))continue;if(b.startsWith("data: ")){let C=b.slice(6);if(C==="[DONE]"){U?.(k);return}try{let f=JSON.parse(C);if(f.thread_id)k=f.thread_id;G(f)}catch(f){console.warn("[AptevaClient] Failed to parse SSE data:",C)}}}}U?.(k)}catch(q){let R=q instanceof Error?q:Error("Unknown error");throw W?.(R),R}}async createThread(Y,G){let U=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:G})});if(!U.ok){let q=await U.json().catch(()=>({error:"Request failed"}));throw Error(q.error||`Request failed with status ${U.status}`)}return(await U.json()).thread_id}async getThreadMessages(Y){let G=await fetch(`${this.config.apiUrl}/threads/${Y}/messages`,{method:"GET",headers:{"X-API-Key":this.config.apiKey}});if(!G.ok){let W=await G.json().catch(()=>({error:"Request failed"}));throw Error(W.error||`Request failed with status ${G.status}`)}return(await G.json()).messages}async cancelRequest(Y,G){try{let U=await fetch(`${this.config.apiUrl}/agents/${Y}/requests/${G}/cancel`,{method:"POST",headers:{"Content-Type":"application/json","X-API-Key":this.config.apiKey}});if(!U.ok){let W=await U.json().catch(()=>({error:"Cancel request failed"}));throw Error(W.error||`Cancel request failed with status ${U.status}`)}}catch(U){throw console.error("[AptevaClient] Cancel request error:",U),U}}},yQ=new WI,q3=r1.forwardRef(function({agentId:G,threadId:U,initialMessages:W=[],context:q,apiUrl:R,apiKey:L,useMock:_=!1,initialMode:k="chat",showModeToggle:I=!1,onModeChange:F,commandVariant:w="default",planMode:b=!1,onPlanModeChange:C,enableStreaming:f=!0,showProgress:E=!0,loadingText:V="Processing...",welcomeTitle:v,welcomeSubtitle:T,welcomeIcon:D,suggestedPrompts:n,welcomeVariant:p,onThreadChange:r,onMessageSent:J0,onAction:i,onFileUpload:t,onComplete:l,onError:j,onToolCall:c,onToolResult:X0,variant:I0="default",placeholder:F0,showHeader:Q1=!0,headerTitle:O1="Chat",enableWidgets:Q0=!1,availableWidgets:U0,compactWidgetContext:_0=!1,onWidgetRender:Z0,className:d},P0){let[v0,X1]=r1.useState(W),[r0,V0]=r1.useState(!1),[$1,L0]=r1.useState(U||null),[a0,f1]=r1.useState(k),[q4,h4]=r1.useState(null),[g1,K1]=r1.useState("idle"),[r4,o4]=r1.useState(null),[k4,y4]=r1.useState(null),[D5,W4]=r1.useState(0),[F6,L4]=r1.useState(""),[M6,M4]=r1.useState(""),[T4,W6]=r1.useState(null),[E6,j4]=r1.useState(null),[t4,T0]=r1.useState(""),[t0,J1]=r1.useState(""),[x1,t1]=r1.useState(b),[V4,H4]=r1.useState(!1),a4=r1.useRef(null),F1=r1.useRef(null);r1.useImperativeHandle(P0,()=>({sendMessage:async(V1)=>{if(F1.current)await F1.current(V1)},sendSystemMessage:async(V1)=>{if(F1.current)await F1.current(V1,void 0,!0)},getMessages:()=>v0,clearMessages:()=>X1([])}),[v0]);let N1=r1.useMemo(()=>{if(!Q0)return q;let V1=_0?lA(U0):cA(U0);return q?`${q}
191
+ ${V1}`:V1},[q,Q0,U0,_0]);r1.useEffect(()=>{if(R||L)yQ.configure({...R&&{apiUrl:R},...L&&{apiKey:L}})},[R,L]),r1.useEffect(()=>{if(U)r?.(U)},[U,r]),r1.useEffect(()=>{t1(b)},[b]),r1.useEffect(()=>{let V1=(s1)=>{let B4=s1.target;if(V4&&!B4.closest(".settings-menu-container"))H4(!1)};return document.addEventListener("mousedown",V1),()=>document.removeEventListener("mousedown",V1)},[V4]);let c6=(V1)=>{if(f1(V1),F?.(V1),V1==="command")K1("idle"),o4(null),y4(null)},L6=a0==="chat"?"Type a message...":"Enter your command...",l6=async(V1,s1,B4)=>{let d1=s1&&s1.length>0,h=d1?s1.map((H0)=>({name:H0.name,type:H0.type,size:H0.size,preview:H0.type.startsWith("image/")?URL.createObjectURL(H0):void 0})):[];if(!B4){let H0={id:`msg-${Date.now()}`,role:"user",content:V1,timestamp:new Date,metadata:d1?{attachments:h}:void 0};X1((R0)=>[...R0,H0]),J0?.(H0)}V0(!0);try{let H0=await uO(V1,s1);if(_){let R0=await fA(1000);X1((A)=>[...A,R0])}else{let R0=[],A="",x=[],O0=$1,M0={},S0={},i0=`msg-${Date.now()}`,g0=()=>{let W0=[...R0];if(A){let k0=W0[W0.length-1];if(k0&&k0.type==="text")k0.content=A;else W0.push({type:"text",content:A})}X1((k0)=>{let n0=k0[k0.length-1];if(n0&&n0.role==="assistant")return[...k0.slice(0,-1),{...n0,content:A,widgets:x.length>0?x:void 0,metadata:{...n0.metadata,content_segments:W0,isStreaming:!0}}];else return[...k0,{id:i0,role:"assistant",content:A,widgets:x.length>0?x:void 0,timestamp:new Date,metadata:{content_segments:W0,isStreaming:!0}}]})};await yQ.chatStream({agent_id:G,message:H0,stream:!0,...$1&&{thread_id:$1},...N1&&{system:N1}},(W0)=>{switch(W0.type){case"thread_id":if(W0.thread_id){if(O0=W0.thread_id,!$1)L0(W0.thread_id),r?.(W0.thread_id)}break;case"request_id":if(W0.request_id)j4(W0.request_id);break;case"content":case"token":if(W0.content)A+=W0.content,g0();break;case"tool_call":if(W0.tool_id&&W0.tool_name){let k0=W0.tool_display_name||W0.tool_name;if(A)R0.push({type:"text",content:A}),A="";R0.push({type:"tool",id:W0.tool_id,name:k0,status:"preparing"}),M0[W0.tool_id]="",h4(k0),c?.(W0.tool_name,W0.tool_id),g0()}break;case"tool_input_delta":if(W0.tool_id&&W0.content){let k0=W0.tool_id;if(M0[k0]===void 0)M0[k0]="";M0[k0]+=W0.content;let n0=R0.find((D1)=>D1.type==="tool"&&D1.id===k0);if(n0){if(n0.isReceiving=!0,n0.inputLength=M0[k0].length,g0(),S0[k0])clearTimeout(S0[k0]);S0[k0]=setTimeout(()=>{if(n0.status==="preparing")n0.isReceiving=!1,g0()},150)}}break;case"tool_use":if(W0.tool_id){let k0=R0.find((n0)=>n0.type==="tool"&&n0.id===W0.tool_id);if(k0&&k0.status==="preparing")k0.status="running",k0.isReceiving=!1,g0()}break;case"tool_stream":if(W0.tool_id){let k0=R0.find((n0)=>n0.type==="tool"&&n0.id===W0.tool_id);if(k0){if(W0.event==="chunk"&&W0.content){if(k0.pendingReset)k0.streamOutput="",k0.pendingReset=!1;k0.streamOutput=(k0.streamOutput||"")+W0.content,g0()}else if(W0.event==="log"||W0.event==="progress")k0.pendingReset=!0}}break;case"tool_result":if(W0.tool_id){let k0=R0.find((n0)=>n0.type==="tool"&&n0.id===W0.tool_id);if(k0)k0.result=W0.content,k0.status="completed",k0.isReceiving=!1,X0?.(k0.name,W0.content);h4(null),g0()}break;case"widget":if(W0.widget)x.push(W0.widget),g0();break;case"error":throw Error(W0.message||"Stream error")}},(W0)=>{if(A){let k0=R0[R0.length-1];if(k0&&k0.type==="text")k0.content=A;else R0.push({type:"text",content:A})}if(X1((k0)=>{let n0=k0[k0.length-1];if(n0&&n0.role==="assistant")return[...k0.slice(0,-1),{...n0,content:A||"Response received",widgets:x.length>0?x:void 0,metadata:{thread_id:W0,content_segments:R0,isStreaming:!1}}];return k0}),W0&&W0!==$1)L0(W0),r?.(W0);V0(!1),j4(null),h4(null)},(W0)=>{let k0={id:`msg-${Date.now()}-error`,role:"assistant",content:`Error: ${W0.message}`,timestamp:new Date,metadata:{error:!0}};X1((n0)=>{let D1=n0[n0.length-1];if(D1&&D1.id.includes("streaming"))return[...n0.slice(0,-1),k0];return[...n0,k0]}),V0(!1),j4(null),h4(null),j?.(W0)})}}catch(H0){let R0={id:`msg-${Date.now()}-error`,role:"assistant",content:H0 instanceof Error?`Error: ${H0.message}`:"An error occurred",timestamp:new Date,metadata:{error:!0}};X1((A)=>[...A,R0]),j?.(H0 instanceof Error?H0:Error("Unknown error"))}finally{V0(!1)}};F1.current=l6;let Q7=async(V1,s1)=>{let B4=V1||F6;if(!B4.trim()&&(!s1||s1.length===0)){y4(Error("Please enter a command")),K1("error");return}if(x1&&g1!=="plan-pending"){if(K1("loading"),y4(null),L4(""),_)setTimeout(()=>{let d1=`1. Analyze the request: "${B4}"
192
+ 2. Process the data
193
+ 3. Generate response
194
+ 4. Return results`;T0(d1),J1(B4),K1("plan-pending")},800);else try{let h=N1?`${N1}
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.",H0=await yQ.chat({agent_id:G,message:B4,stream:!1,system:h});T0(H0.message),J1(B4),K1("plan-pending")}catch(d1){let h=d1 instanceof Error?d1:Error("Failed to generate plan");y4(h),K1("error"),j?.(h)}return}K1("loading"),y4(null),W4(0),M4(""),L4("");try{if(_)if(f){let d1="";VA(B4,(h)=>{if(h.type==="token"&&h.content){d1+=h.content,M4(d1);let H0=Math.min(Math.round(d1.length/10),90);W4(H0)}},(h)=>{let H0={success:!0,data:{summary:d1,thread_id:h},message:d1||"Command executed successfully"};o4(H0),K1("success"),W4(100),l?.(H0)},(h)=>{y4(h),K1("error"),j?.(h)})}else{await new Promise((h)=>setTimeout(h,1500));let d1={success:!0,data:{summary:`Executed: ${B4}`},message:"Command executed successfully"};o4(d1),K1("success"),W4(100),l?.(d1)}else{let h=N1?`${N1}
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.`,H0=s1&&s1.length>0?await uO(B4,s1):B4;if(f){let R0="",A="";await yQ.chatStream({agent_id:G,message:H0,stream:!0,...$1&&{thread_id:$1},system:h},(x)=>{if((x.type==="token"||x.type==="content")&&x.content){R0+=x.content,M4(R0),W6(null);let O0=Math.min(Math.round(R0.length/10),90);W4(O0)}else if(x.type==="tool_call"&&x.tool_name){let O0=x.tool_display_name||x.tool_name;A=x.tool_name,W6(O0),c?.(x.tool_name,x.tool_id||""),R0="",M4("")}else if(x.type==="tool_result")X0?.(A,x.content),W6(null);else if(x.type==="thread_id"&&x.thread_id){if(!$1)L0(x.thread_id),r?.(x.thread_id)}else if(x.type==="request_id"&&x.request_id)j4(x.request_id)},(x)=>{let O0={success:!0,data:{summary:R0,thread_id:x},message:R0||"Command executed successfully"};o4(O0),K1("success"),W4(100),j4(null),l?.(O0)},(x)=>{y4(x),K1("error"),j4(null),j?.(x)})}else{let R0=await yQ.chat({agent_id:G,message:H0,stream:!1,...$1&&{thread_id:$1},system:h}),A={success:!0,data:{summary:R0.message,thread_id:R0.thread_id},widgets:R0.widgets,message:R0.message};o4(A),K1("success"),W4(100),l?.(A)}}}catch(d1){let h=d1 instanceof Error?d1:Error("Unknown error");y4(h),K1("error"),j?.(h)}},E5=()=>{K1("idle"),o4(null),y4(null),W4(0),L4(""),T0(""),J1(""),M4(""),W6(null)},X7=()=>{let V1=t4;T0(""),J1("");let s1=`Execute this plan now:
199
+
200
+ ${V1}`;Q7(s1)},F5=()=>{L4(t0),T0(""),J1(""),K1("idle")},m6=async()=>{if(E6&&G)try{await yQ.cancelRequest(G,E6)}catch(V1){console.error("Failed to cancel request:",V1)}if(V0(!1),g1==="loading")K1("idle"),M4(""),W6(null),W4(0);j4(null)},m5=w==="compact";return z5.jsxs("div",{className:U4("apteva-chat flex flex-col h-full",I0!=="default"&&`apteva-chat-${I0}`,d),children:[Q1&&a0==="chat"&&z5.jsx("div",{className:"apteva-chat-header px-4 py-3 flex items-center justify-between",children:z5.jsxs("div",{children:[z5.jsx("div",{className:"apteva-chat-title",children:O1}),z5.jsx("div",{className:U4("apteva-chat-status",r0?q4?"apteva-chat-status-tool":"apteva-chat-status-thinking":"apteva-chat-status-ready"),children:r0?q4?`Using ${q4}...`:"Thinking...":"Ready"})]})}),a0==="chat"&&z5.jsxs(z5.Fragment,{children:[z5.jsx(qI,{messages:v0,onAction:i,welcomeTitle:v,welcomeSubtitle:T,welcomeIcon:D,suggestedPrompts:n,welcomeVariant:p,chatVariant:I0,onPromptClick:(V1)=>l6(V1),enableWidgets:Q0,onWidgetRender:Z0}),z5.jsx(BI,{onSendMessage:l6,placeholder:F0||L6,disabled:r0,isLoading:r0,onStop:m6,onFileUpload:t,onSwitchMode:I?()=>c6("command"):void 0})]}),a0==="command"&&z5.jsx("div",{className:"w-full",children:z5.jsx(UI,{onExecute:(V1,s1)=>{L4(V1),Q7(V1,s1)},state:g1,response:r4?.data?.summary||r4?.message,error:k4?.message,plan:t4,streamedContent:M6,toolName:T4,onApprove:X7,onReject:F5,onReset:E5,onStop:m6,onExpand:I?()=>c6("chat"):void 0,placeholder:F0||"Enter your command..."})}),z5.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 G4=q0(Z1(),1),QW=z7.createContext(null);function XW(){return z7.useContext(QW)}function ZW({children:Y}){let{authFetch:G,isAuthenticated:U,isLoading:W}=k1(),[q,R]=z7.useState(null),[L,_]=z7.useState(!1),[k,I]=z7.useState(!1),[F,w]=z7.useState(null),b=async()=>{try{let D=await(await G("/api/meta-agent/status")).json();R(D)}catch(T){console.error("[MetaAgent] Failed to fetch status:",T)}};z7.useEffect(()=>{if(!W&&U)b()},[G,U,W]);let C=async()=>{I(!0),w(null);try{let T=await G("/api/meta-agent/start",{method:"POST"}),D=await T.json();if(!T.ok)w(D.error||"Failed to start assistant");else await b()}catch(T){w("Failed to start assistant")}I(!1)},f=!!(q?.enabled&&q?.available),E=q?.agent,V=!!(E?.status==="running"&&E?.port),v={status:q,isOpen:L,isStarting:k,error:F,isAvailable:f,isRunning:V,agent:E,toggle:()=>_(!L),close:()=>_(!1),startAgent:C};return G4.jsxDEV(QW.Provider,{value:v,children:Y},void 0,!1,void 0,this)}function JW(){let Y=XW();if(!Y?.isAvailable)return null;return G4.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:[G4.jsxDEV($W,{className:"w-5 h-5"},void 0,!1,void 0,this),G4.jsxDEV("span",{className:"text-sm",children:"Assistant"},void 0,!1,void 0,this),Y.isRunning&&G4.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 YW(){let Y=XW();if(!Y?.isAvailable||!Y.isOpen)return null;let{agent:G,isRunning:U,error:W,isStarting:q,startAgent:R,close:L}=Y;return G4.jsxDEV(G4.Fragment,{children:[G4.jsxDEV("div",{className:"hidden md:block fixed inset-0 bg-black/20 z-40",onClick:L},void 0,!1,void 0,this),G4.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:[G4.jsxDEV("div",{className:"flex items-center justify-between px-4 py-3 border-b border-[#1a1a1a] bg-[#111]",children:[G4.jsxDEV("div",{className:"flex items-center gap-2",children:[G4.jsxDEV("div",{className:`w-2 h-2 rounded-full ${U?"bg-green-400":"bg-[#444]"}`},void 0,!1,void 0,this),G4.jsxDEV("span",{className:"font-medium text-sm",children:"Apteva Assistant"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),G4.jsxDEV("button",{onClick:L,className:"text-[#666] hover:text-[#888] transition",children:G4.jsxDEV(NI,{},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),G4.jsxDEV("div",{className:"flex-1 min-h-0 flex flex-col",children:U?G4.jsxDEV(q3,{agentId:"default",apiUrl:`/api/agents/${G.id}`,placeholder:"Ask me anything about Apteva...",variant:"terminal",showHeader:!1},void 0,!1,void 0,this):G4.jsxDEV("div",{className:"flex-1 flex flex-col items-center justify-center p-6 text-center",children:[G4.jsxDEV($W,{className:"w-12 h-12 text-[#333] mb-4"},void 0,!1,void 0,this),G4.jsxDEV("h3",{className:"font-medium mb-2",children:"Apteva Assistant"},void 0,!1,void 0,this),G4.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),W&&G4.jsxDEV("p",{className:"text-sm text-red-400 mb-4",children:W},void 0,!1,void 0,this),G4.jsxDEV("button",{onClick:R,disabled:q,className:"bg-[#f97316] hover:bg-[#fb923c] disabled:opacity-50 text-white px-6 py-2 rounded font-medium transition",children:q?"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 $W({className:Y="w-6 h-6"}){return G4.jsxDEV("svg",{className:Y,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:G4.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 NI(){return G4.jsxDEV("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:G4.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 S1=q0(Z1(),1);function B3({onMenuClick:Y}){let{connected:G}=kQ(),{user:U,logout:W}=k1(),{projects:q,currentProjectId:R,currentProject:L,setCurrentProjectId:_,unassignedCount:k,projectsEnabled:I}=g4(),[F,w]=e9.useState(!1),[b,C]=e9.useState(!1),f=async()=>{await W(),w(!1)},E=(T)=>{_(T),C(!1)},V=()=>{if(R===null)return"All Projects";if(R==="unassigned")return"Unassigned";return L?.name||"Select Project"},v=()=>{if(R===null)return"#666";if(R==="unassigned")return"#888";return L?.color||"#6366f1"};return S1.jsxDEV("header",{className:"border-b border-[#1a1a1a] px-4 md:px-6 py-4 flex-shrink-0",children:S1.jsxDEV("div",{className:"flex items-center justify-between",children:[S1.jsxDEV("div",{className:"flex items-center gap-3",children:[S1.jsxDEV("button",{onClick:Y,className:"p-2 -ml-2 text-[#666] hover:text-[#e0e0e0] transition md:hidden",children:S1.jsxDEV(kO,{},void 0,!1,void 0,this)},void 0,!1,void 0,this),S1.jsxDEV("div",{className:"flex items-center gap-2",children:[S1.jsxDEV("span",{className:"text-[#f97316]",children:">_"},void 0,!1,void 0,this),S1.jsxDEV("span",{className:"text-xl tracking-wider",children:"apteva"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),I&&q.length>0&&S1.jsxDEV("div",{className:"relative ml-2 md:ml-4",children:[S1.jsxDEV("button",{onClick:()=>C(!b),className:"flex items-center gap-2 px-3 py-1.5 rounded border border-[#222] bg-[#111] hover:bg-[#1a1a1a] transition text-sm",children:[S1.jsxDEV("span",{className:"w-2.5 h-2.5 rounded-full",style:{backgroundColor:v()}},void 0,!1,void 0,this),S1.jsxDEV("span",{className:"hidden sm:inline max-w-[120px] md:max-w-[180px] truncate",children:V()},void 0,!1,void 0,this),S1.jsxDEV(TO,{},void 0,!1,void 0,this)]},void 0,!0,void 0,this),b&&S1.jsxDEV("div",{className:"absolute left-0 top-full mt-1 w-56 bg-[#111] border border-[#222] rounded-lg shadow-xl z-50",children:S1.jsxDEV("div",{className:"py-1 max-h-64 overflow-y-auto",children:[S1.jsxDEV("button",{onClick:()=>E(null),className:`w-full px-4 py-2 text-left text-sm flex items-center gap-2 hover:bg-[#1a1a1a] transition ${R===null?"bg-[#1a1a1a] text-[#f97316]":""}`,children:[S1.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),q.map((T)=>S1.jsxDEV("button",{onClick:()=>E(T.id),className:`w-full px-4 py-2 text-left text-sm flex items-center gap-2 hover:bg-[#1a1a1a] transition ${R===T.id?"bg-[#1a1a1a] text-[#f97316]":""}`,children:[S1.jsxDEV("span",{className:"w-2.5 h-2.5 rounded-full flex-shrink-0",style:{backgroundColor:T.color}},void 0,!1,void 0,this),S1.jsxDEV("span",{className:"truncate",children:T.name},void 0,!1,void 0,this),S1.jsxDEV("span",{className:"ml-auto text-xs text-[#666]",children:T.agentCount},void 0,!1,void 0,this)]},T.id,!0,void 0,this)),k>0&&S1.jsxDEV("button",{onClick:()=>E("unassigned"),className:`w-full px-4 py-2 text-left text-sm flex items-center gap-2 hover:bg-[#1a1a1a] transition ${R==="unassigned"?"bg-[#1a1a1a] text-[#f97316]":""}`,children:[S1.jsxDEV("span",{className:"w-2.5 h-2.5 rounded-full bg-[#888]"},void 0,!1,void 0,this),S1.jsxDEV("span",{className:"truncate",children:"Unassigned"},void 0,!1,void 0,this),S1.jsxDEV("span",{className:"ml-auto text-xs text-[#666]",children:k},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),S1.jsxDEV("div",{className:"flex items-center gap-3 md:gap-4",children:[S1.jsxDEV("div",{className:"flex items-center gap-2",children:[S1.jsxDEV("span",{className:`w-2 h-2 rounded-full ${G?"bg-green-400":"bg-red-400"}`},void 0,!1,void 0,this),S1.jsxDEV("span",{className:"text-xs text-[#666] hidden sm:inline",children:G?"Live":"Offline"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),S1.jsxDEV(JW,{},void 0,!1,void 0,this),U&&S1.jsxDEV("div",{className:"relative",children:[S1.jsxDEV("button",{onClick:()=>w(!F),className:"flex items-center gap-2 px-2 md:px-3 py-2 rounded hover:bg-[#1a1a1a] transition",children:[S1.jsxDEV("div",{className:"w-8 h-8 rounded-full bg-[#f97316] flex items-center justify-center text-black font-medium text-sm",children:U.username.charAt(0).toUpperCase()},void 0,!1,void 0,this),S1.jsxDEV("span",{className:"text-sm text-[#888] hidden sm:block",children:U.username},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F&&S1.jsxDEV("div",{className:"absolute right-0 top-full mt-1 w-48 bg-[#111] border border-[#222] rounded-lg shadow-xl z-50",children:[S1.jsxDEV("div",{className:"px-4 py-3 border-b border-[#222]",children:[S1.jsxDEV("p",{className:"text-sm font-medium",children:U.username},void 0,!1,void 0,this),S1.jsxDEV("p",{className:"text-xs text-[#f97316] mt-1",children:U.role},void 0,!1,void 0,this)]},void 0,!0,void 0,this),S1.jsxDEV("button",{onClick:f,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 z4=q0(Z1(),1);function U3({route:Y,agentCount:G,taskCount:U,onNavigate:W,isOpen:q,onClose:R}){let L=(_)=>{W(_),R?.()};return z4.jsxDEV(z4.Fragment,{children:[q&&z4.jsxDEV("div",{className:"fixed inset-0 bg-black/60 z-40 md:hidden",onClick:R},void 0,!1,void 0,this),z4.jsxDEV("aside",{className:`
212
+ 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
213
+ md:relative md:w-56 md:translate-x-0 md:z-auto
214
+ ${q?"translate-x-0":"-translate-x-full"}
215
+ `,children:[z4.jsxDEV("div",{className:"flex items-center justify-between mb-4 md:hidden",children:[z4.jsxDEV("div",{className:"flex items-center gap-2",children:[z4.jsxDEV("span",{className:"text-[#f97316]",children:">_"},void 0,!1,void 0,this),z4.jsxDEV("span",{className:"text-lg tracking-wider",children:"apteva"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z4.jsxDEV("button",{onClick:R,className:"p-2 text-[#666] hover:text-[#e0e0e0] transition",children:z4.jsxDEV(N7,{},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z4.jsxDEV("nav",{className:"space-y-1",children:[z4.jsxDEV(v8,{icon:z4.jsxDEV(J3,{},void 0,!1,void 0,this),label:"Dashboard",active:Y==="dashboard",onClick:()=>L("dashboard")},void 0,!1,void 0,this),z4.jsxDEV(v8,{icon:z4.jsxDEV(Y3,{},void 0,!1,void 0,this),label:"Agents",active:Y==="agents",onClick:()=>L("agents"),badge:G>0?String(G):void 0},void 0,!1,void 0,this),z4.jsxDEV(v8,{icon:z4.jsxDEV(f5,{},void 0,!1,void 0,this),label:"Tasks",active:Y==="tasks",onClick:()=>L("tasks"),badge:U&&U>0?String(U):void 0},void 0,!1,void 0,this),z4.jsxDEV(v8,{icon:z4.jsxDEV(h5,{},void 0,!1,void 0,this),label:"MCP",active:Y==="mcp",onClick:()=>L("mcp")},void 0,!1,void 0,this),z4.jsxDEV(v8,{icon:z4.jsxDEV(fZ,{},void 0,!1,void 0,this),label:"Skills",active:Y==="skills",onClick:()=>L("skills")},void 0,!1,void 0,this),z4.jsxDEV(v8,{icon:z4.jsxDEV(x9,{},void 0,!1,void 0,this),label:"Telemetry",active:Y==="telemetry",onClick:()=>L("telemetry")},void 0,!1,void 0,this),z4.jsxDEV(v8,{icon:z4.jsxDEV(IO,{},void 0,!1,void 0,this),label:"API",active:Y==="api",onClick:()=>L("api")},void 0,!1,void 0,this),z4.jsxDEV(v8,{icon:z4.jsxDEV($3,{},void 0,!1,void 0,this),label:"Settings",active:Y==="settings",onClick:()=>L("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 v8({icon:Y,label:G,active:U,onClick:W,badge:q}){return z4.jsxDEV("button",{onClick:W,className:`w-full flex items-center gap-3 px-3 py-2 rounded font-medium transition ${U?"bg-[#111] text-[#e0e0e0]":"text-[#666] hover:bg-[#111] hover:text-[#888]"}`,children:[Y,G,q&&z4.jsxDEV("span",{className:"ml-auto bg-[#333] text-[#888] text-xs px-2 py-0.5 rounded-full",children:q},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}var EZ=q0(Z1(),1);function K3({message:Y,onDismiss:G}){return EZ.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:[EZ.jsxDEV("span",{children:Y},void 0,!1,void 0,this),EZ.jsxDEV("button",{onClick:G,className:"hover:text-red-300",children:EZ.jsxDEV(N7,{className:"w-4 h-4"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}var mZ=q0(I1(),1);var X6=q0(Z1(),1);function O3(){let{login:Y}=k1(),[G,U]=mZ.useState(""),[W,q]=mZ.useState(""),[R,L]=mZ.useState(null),[_,k]=mZ.useState(!1);return X6.jsxDEV("div",{className:"min-h-screen bg-[#0a0a0a] text-[#e0e0e0] font-mono flex items-center justify-center p-8",children:X6.jsxDEV("div",{className:"w-full max-w-md",children:[X6.jsxDEV("div",{className:"text-center mb-8",children:[X6.jsxDEV("div",{className:"flex items-center justify-center gap-2 mb-2",children:[X6.jsxDEV("span",{className:"text-[#f97316] text-3xl",children:">_"},void 0,!1,void 0,this),X6.jsxDEV("span",{className:"text-3xl tracking-wider",children:"apteva"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),X6.jsxDEV("p",{className:"text-[#666]",children:"Run AI agents locally"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),X6.jsxDEV("div",{className:"bg-[#111] rounded-lg border border-[#1a1a1a] p-8",children:[X6.jsxDEV("h2",{className:"text-2xl font-semibold mb-2",children:"Welcome back"},void 0,!1,void 0,this),X6.jsxDEV("p",{className:"text-[#666] mb-6",children:"Sign in to continue to apteva"},void 0,!1,void 0,this),X6.jsxDEV("form",{onSubmit:async(F)=>{F.preventDefault(),L(null),k(!0);let w=await Y(G,W);if(!w.success)L(w.error||"Login failed");k(!1)},className:"space-y-4",children:[X6.jsxDEV("div",{children:[X6.jsxDEV("label",{htmlFor:"username",className:"block text-sm text-[#888] mb-1",children:"Username"},void 0,!1,void 0,this),X6.jsxDEV("input",{id:"username",type:"text",value:G,onChange:(F)=>U(F.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),X6.jsxDEV("div",{children:[X6.jsxDEV("label",{htmlFor:"password",className:"block text-sm text-[#888] mb-1",children:"Password"},void 0,!1,void 0,this),X6.jsxDEV("input",{id:"password",type:"password",value:W,onChange:(F)=>q(F.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),R&&X6.jsxDEV("div",{className:"p-3 bg-red-500/10 border border-red-500/30 rounded text-red-400 text-sm",children:R},void 0,!1,void 0,this),X6.jsxDEV("button",{type:"submit",disabled:_||!G||!W,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:_?"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 S8=q0(I1(),1),b4=q0(Z1(),1);function W3({onComplete:Y}){let[G,U]=S8.useState(""),[W,q]=S8.useState(""),[R,L]=S8.useState(""),[_,k]=S8.useState(""),[I,F]=S8.useState(!1),[w,b]=S8.useState(null),[C,f]=S8.useState(!1);return b4.jsxDEV(b4.Fragment,{children:[b4.jsxDEV("h2",{className:"text-2xl font-semibold mb-2",children:"Create your account"},void 0,!1,void 0,this),b4.jsxDEV("p",{className:"text-[#666] mb-6",children:"Set up your admin account to get started with apteva."},void 0,!1,void 0,this),b4.jsxDEV("form",{onSubmit:async(V)=>{if(V.preventDefault(),b(null),W!==R){b("Passwords do not match");return}f(!0);try{let v=await fetch("/api/onboarding/user",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:G,password:W,..._&&{email:_}})}),T=await v.json();if(!v.ok){b(T.error||"Failed to create account"),f(!1);return}let D=await fetch("/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({username:G,password:W})});if(!D.ok){b("Account created but login failed. Please try logging in."),f(!1);return}let n=await D.json();if(n.accessToken)sessionStorage.setItem("accessToken",n.accessToken);Y({username:G})}catch(v){b("Failed to create account"),f(!1)}},className:"space-y-4",children:[b4.jsxDEV("div",{children:[b4.jsxDEV("label",{htmlFor:"username",className:"block text-sm text-[#888] mb-1",children:"Username"},void 0,!1,void 0,this),b4.jsxDEV("input",{id:"username",type:"text",value:G,onChange:(V)=>U(V.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),b4.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),b4.jsxDEV("div",{children:[b4.jsxDEV("label",{htmlFor:"password",className:"block text-sm text-[#888] mb-1",children:"Password"},void 0,!1,void 0,this),b4.jsxDEV("input",{id:"password",type:"password",value:W,onChange:(V)=>q(V.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),b4.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),b4.jsxDEV("div",{children:[b4.jsxDEV("label",{htmlFor:"confirmPassword",className:"block text-sm text-[#888] mb-1",children:"Confirm Password"},void 0,!1,void 0,this),b4.jsxDEV("input",{id:"confirmPassword",type:"password",value:R,onChange:(V)=>L(V.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),!I?b4.jsxDEV("button",{type:"button",onClick:()=>F(!0),className:"text-sm text-[#666] hover:text-[#888] transition",children:"+ Add email for password recovery (optional)"},void 0,!1,void 0,this):b4.jsxDEV("div",{children:[b4.jsxDEV("label",{htmlFor:"email",className:"block text-sm text-[#888] mb-1",children:["Email ",b4.jsxDEV("span",{className:"text-[#666]",children:"(optional)"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),b4.jsxDEV("input",{id:"email",type:"email",value:_,onChange:(V)=>k(V.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),b4.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),w&&b4.jsxDEV("div",{className:"p-3 bg-red-500/10 border border-red-500/30 rounded text-red-400 text-sm",children:w},void 0,!1,void 0,this),b4.jsxDEV("button",{type:"submit",disabled:C||!G||!W||!R,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:C?"Creating account...":"Create Account"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),b4.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 y5=q0(I1(),1);var d0=q0(Z1(),1);function uZ({onComplete:Y,needsAccount:G=!1}){let[U,W]=y5.useState(G?0:1),[q,R]=y5.useState([]),[L,_]=y5.useState(null),[k,I]=y5.useState(""),[F,w]=y5.useState(!1),[b,C]=y5.useState(!1),[f,E]=y5.useState(null),[V,v]=y5.useState(null),[T,D]=y5.useState(!1),n=()=>{let j=sessionStorage.getItem("accessToken");return j?{Authorization:`Bearer ${j}`}:{}};y5.useEffect(()=>{if(G&&!T&&U===0)return;fetch("/api/providers",{headers:n()}).then((j)=>j.json()).then((j)=>{let c=(j.providers||[]).filter((X0)=>X0.type==="llm");R(c)})},[T,U,G]);let p=q.filter((j)=>j.hasKey),r=async()=>{if(!L||!k)return;w(!0),E(null),v(null);try{C(!0);let c=await(await fetch(`/api/keys/${L}/test`,{method:"POST",headers:{"Content-Type":"application/json",...n()},body:JSON.stringify({key:k})})).json();if(C(!1),!c.valid){E(c.error||"API key is invalid"),w(!1);return}let X0=await fetch(`/api/keys/${L}`,{method:"POST",headers:{"Content-Type":"application/json",...n()},body:JSON.stringify({key:k})}),I0=await X0.json();if(!X0.ok)E(I0.error||"Failed to save key");else{v("API key saved successfully!"),I("");let Q1=await(await fetch("/api/providers",{headers:n()})).json();R(Q1.providers||[]),_(null)}}catch(j){E("Failed to save key")}w(!1)},J0=async()=>{try{let j=await fetch("/api/projects",{method:"POST",headers:{"Content-Type":"application/json",...n()},body:JSON.stringify({name:"My Project",description:"Default project for organizing agents",color:"#f97316"})});if(j.ok){let c=await j.json();if(c.project?.id)localStorage.setItem("apteva_current_project",c.project.id)}}catch(j){console.error("Failed to create default project:",j)}await fetch("/api/onboarding/complete",{method:"POST",headers:n()}),Y()},i=()=>{D(!0),W(1)},t=G?3:2,l=G?U:U-1;return d0.jsxDEV("div",{className:"min-h-screen bg-[#0a0a0a] text-[#e0e0e0] font-mono flex items-center justify-center p-8",children:d0.jsxDEV("div",{className:"w-full max-w-2xl",children:[d0.jsxDEV("div",{className:"text-center mb-8",children:[d0.jsxDEV("div",{className:"flex items-center justify-center gap-2 mb-2",children:[d0.jsxDEV("span",{className:"text-[#f97316] text-3xl",children:">_"},void 0,!1,void 0,this),d0.jsxDEV("span",{className:"text-3xl tracking-wider",children:"apteva"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),d0.jsxDEV("p",{className:"text-[#666]",children:"Run AI agents locally"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),d0.jsxDEV("div",{className:"flex items-center justify-center gap-2 mb-8",children:[G&&d0.jsxDEV(d0.Fragment,{children:[d0.jsxDEV("div",{className:`w-3 h-3 rounded-full ${U>=0?"bg-[#f97316]":"bg-[#333]"}`},void 0,!1,void 0,this),d0.jsxDEV("div",{className:`w-16 h-0.5 ${U>=1?"bg-[#f97316]":"bg-[#333]"}`},void 0,!1,void 0,this)]},void 0,!0,void 0,this),d0.jsxDEV("div",{className:`w-3 h-3 rounded-full ${U>=1?"bg-[#f97316]":"bg-[#333]"}`},void 0,!1,void 0,this),d0.jsxDEV("div",{className:`w-16 h-0.5 ${U>=2?"bg-[#f97316]":"bg-[#333]"}`},void 0,!1,void 0,this),d0.jsxDEV("div",{className:`w-3 h-3 rounded-full ${U>=2?"bg-[#f97316]":"bg-[#333]"}`},void 0,!1,void 0,this)]},void 0,!0,void 0,this),d0.jsxDEV("div",{className:"bg-[#111] rounded-lg border border-[#1a1a1a] p-8",children:[U===0&&G&&d0.jsxDEV(W3,{onComplete:i},void 0,!1,void 0,this),U===1&&d0.jsxDEV(wI,{providers:q,configuredProviders:p,selectedProvider:L,apiKey:k,saving:F,testing:b,error:f,success:V,onSelectProvider:_,onApiKeyChange:I,onSaveKey:r,onContinue:()=>W(2)},void 0,!1,void 0,this),U===2&&d0.jsxDEV(FI,{configuredProviders:p,onAddMore:()=>W(1),onComplete:J0},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 wI({providers:Y,configuredProviders:G,selectedProvider:U,apiKey:W,saving:q,testing:R,error:L,success:_,onSelectProvider:k,onApiKeyChange:I,onSaveKey:F,onContinue:w}){let b=Y.find((C)=>C.id===U);if(U&&b)return d0.jsxDEV(d0.Fragment,{children:[d0.jsxDEV("h2",{className:"text-2xl font-semibold mb-2",children:["Add ",b.name," Key"]},void 0,!0,void 0,this),d0.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),d0.jsxDEV("div",{className:"mb-6",children:[d0.jsxDEV("div",{className:"p-4 rounded border border-[#f97316] bg-[#f97316]/5 mb-4",children:d0.jsxDEV("div",{className:"flex items-center justify-between",children:[d0.jsxDEV("div",{children:[d0.jsxDEV("p",{className:"font-medium",children:b.name},void 0,!1,void 0,this),d0.jsxDEV("p",{className:"text-sm text-[#666]",children:[b.models.length," models available"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),d0.jsxDEV("a",{href:b.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),d0.jsxDEV("div",{className:"space-y-3",children:[d0.jsxDEV("input",{type:"password",value:W,onChange:(C)=>I(C.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),L&&d0.jsxDEV("p",{className:"text-red-400 text-sm",children:L},void 0,!1,void 0,this),_&&d0.jsxDEV("p",{className:"text-green-400 text-sm",children:_},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),d0.jsxDEV("div",{className:"flex gap-3",children:[d0.jsxDEV("button",{onClick:()=>{k(null),I("")},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),d0.jsxDEV("button",{onClick:F,disabled:!W||q,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:R?"Testing...":q?"Saving...":"Save API Key"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this);return d0.jsxDEV(d0.Fragment,{children:[d0.jsxDEV("h2",{className:"text-2xl font-semibold mb-2",children:"Welcome to apteva"},void 0,!1,void 0,this),d0.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),d0.jsxDEV("div",{className:"space-y-3 mb-6",children:Y.map((C)=>d0.jsxDEV(bI,{provider:C,selected:!1,onSelect:()=>!C.hasKey&&k(C.id)},C.id,!1,void 0,this))},void 0,!1,void 0,this),d0.jsxDEV("button",{onClick:w,disabled:G.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:G.length===0?"Add at least one API key to continue":`Continue with ${G.length} provider${G.length>1?"s":""}`},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function bI({provider:Y,selected:G,onSelect:U}){return d0.jsxDEV("div",{onClick:U,className:`p-4 rounded border transition cursor-pointer ${Y.hasKey?"border-green-500/30 bg-green-500/5":G?"border-[#f97316] bg-[#f97316]/5":"border-[#222] hover:border-[#333]"}`,children:d0.jsxDEV("div",{className:"flex items-center justify-between",children:[d0.jsxDEV("div",{children:[d0.jsxDEV("p",{className:"font-medium",children:Y.name},void 0,!1,void 0,this),d0.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?d0.jsxDEV("span",{className:"text-green-400 text-sm flex items-center gap-1",children:[d0.jsxDEV(w5,{},void 0,!1,void 0,this),"Configured (",Y.keyHint,")"]},void 0,!0,void 0,this):d0.jsxDEV("a",{href:Y.docsUrl,target:"_blank",rel:"noopener noreferrer",onClick:(W)=>W.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 FI({configuredProviders:Y,onAddMore:G,onComplete:U}){return d0.jsxDEV(d0.Fragment,{children:[d0.jsxDEV("h2",{className:"text-2xl font-semibold mb-2",children:"You're all set!"},void 0,!1,void 0,this),d0.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),d0.jsxDEV("div",{className:"space-y-2 mb-6",children:Y.map((W)=>d0.jsxDEV("div",{className:"flex items-center gap-3 p-3 bg-[#0a0a0a] rounded",children:[d0.jsxDEV(w5,{className:"w-5 h-5 text-green-400"},void 0,!1,void 0,this),d0.jsxDEV("span",{children:W.name},void 0,!1,void 0,this),d0.jsxDEV("span",{className:"text-[#666] text-sm",children:["(",W.keyHint,")"]},void 0,!0,void 0,this)]},W.id,!0,void 0,this))},void 0,!1,void 0,this),d0.jsxDEV("div",{className:"flex gap-3",children:[d0.jsxDEV("button",{onClick:G,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),d0.jsxDEV("button",{onClick:U,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 $4=q0(I1(),1);var m=q0(Z1(),1);function L3(){let{projectsEnabled:Y}=g4(),[G,U]=$4.useState("providers"),W=[{key:"providers",label:"Providers"},...Y?[{key:"projects",label:"Projects"}]:[],{key:"updates",label:"Updates"},{key:"data",label:"Data"}];return m.jsxDEV("div",{className:"flex-1 flex flex-col md:flex-row overflow-hidden",children:[m.jsxDEV("div",{className:"md:hidden border-b border-[#1a1a1a] bg-[#0a0a0a]",children:m.jsxDEV("div",{className:"flex overflow-x-auto",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:W.map((q)=>m.jsxDEV("button",{onClick:()=>U(q.key),className:`flex-shrink-0 px-4 py-3 text-sm font-medium border-b-2 transition ${G===q.key?"border-[#f97316] text-[#f97316]":"border-transparent text-[#666] hover:text-[#888]"}`,children:q.label},q.key,!1,void 0,this))},void 0,!1,void 0,this)},void 0,!1,void 0,this),m.jsxDEV("div",{className:"hidden md:block w-48 border-r border-[#1a1a1a] p-4 flex-shrink-0",children:[m.jsxDEV("h2",{className:"text-sm font-medium text-[#666] uppercase tracking-wider mb-3",children:"Settings"},void 0,!1,void 0,this),m.jsxDEV("nav",{className:"space-y-1",children:W.map((q)=>m.jsxDEV(MI,{label:q.label,active:G===q.key,onClick:()=>U(q.key)},q.key,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),m.jsxDEV("div",{className:"flex-1 overflow-auto p-4 md:p-6",children:[G==="providers"&&m.jsxDEV(PI,{},void 0,!1,void 0,this),G==="projects"&&Y&&m.jsxDEV(AI,{},void 0,!1,void 0,this),G==="updates"&&m.jsxDEV(kI,{},void 0,!1,void 0,this),G==="data"&&m.jsxDEV(vI,{},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function MI({label:Y,active:G,onClick:U}){return m.jsxDEV("button",{onClick:U,className:`w-full text-left px-3 py-2 rounded text-sm transition ${G?"bg-[#1a1a1a] text-[#e0e0e0]":"text-[#666] hover:bg-[#111] hover:text-[#888]"}`,children:Y},void 0,!1,void 0,this)}function PI(){let{authFetch:Y}=k1(),[G,U]=$4.useState([]),[W,q]=$4.useState(null),[R,L]=$4.useState(""),[_,k]=$4.useState(!1),[I,F]=$4.useState(!1),[w,b]=$4.useState(null),[C,f]=$4.useState(null),{confirm:E,ConfirmDialog:V}=S5(),v=async()=>{let t=await(await Y("/api/providers")).json();U(t.providers||[])};$4.useEffect(()=>{v()},[]);let T=async()=>{if(!W||!R)return;k(!0),b(null),f(null);try{F(!0);let t=await(await Y(`/api/keys/${W}/test`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:R})})).json();if(F(!1),!t.valid){b(t.error||"API key is invalid"),k(!1);return}let l=await Y(`/api/keys/${W}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:R})}),j=await l.json();if(!l.ok)b(j.error||"Failed to save key");else{let c="API key saved!";if(j.restartedAgents&&j.restartedAgents.length>0){let X0=j.restartedAgents.filter((F0)=>F0.success).length;if(j.restartedAgents.length-X0===0)c+=` Restarted ${X0} agent${X0>1?"s":""} with new key.`;else c+=` Restarted ${X0}/${j.restartedAgents.length} agents.`}f(c),L(""),q(null),v()}}catch(i){b("Failed to save key")}k(!1)},D=async(i)=>{if(!await E("Are you sure you want to remove this API key?",{confirmText:"Remove",title:"Remove API Key"}))return;await Y(`/api/keys/${i}`,{method:"DELETE"}),v()},n=G.filter((i)=>i.type==="llm"),p=G.filter((i)=>i.type==="integration"),r=n.filter((i)=>i.hasKey).length,J0=p.filter((i)=>i.hasKey).length;return $4.useEffect(()=>{if(C&&!W){let i=setTimeout(()=>f(null),5000);return()=>clearTimeout(i)}},[C,W]),m.jsxDEV(m.Fragment,{children:[V,m.jsxDEV("div",{className:"space-y-10",children:[C&&!W&&m.jsxDEV("div",{className:"bg-green-500/10 border border-green-500/30 rounded-lg p-4 flex items-center justify-between",children:[m.jsxDEV("div",{className:"flex items-center gap-2 text-green-400",children:[m.jsxDEV(w5,{className:"w-5 h-5"},void 0,!1,void 0,this),m.jsxDEV("span",{children:C},void 0,!1,void 0,this)]},void 0,!0,void 0,this),m.jsxDEV("button",{onClick:()=>f(null),className:"text-green-400 hover:text-green-300",children:m.jsxDEV(N7,{className:"w-4 h-4"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),m.jsxDEV("div",{children:[m.jsxDEV("div",{className:"mb-6",children:[m.jsxDEV("h1",{className:"text-2xl font-semibold mb-1",children:"AI Providers"},void 0,!1,void 0,this),m.jsxDEV("p",{className:"text-[#666]",children:["Manage your API keys for AI providers. ",r," of ",n.length," configured."]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),m.jsxDEV("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",children:n.map((i)=>m.jsxDEV(TI,{provider:i,isEditing:W===i.id,apiKey:R,saving:_,testing:I,error:W===i.id?w:null,success:W===i.id?C:null,onStartEdit:()=>{q(i.id),b(null),f(null)},onCancelEdit:()=>{q(null),L(""),b(null)},onApiKeyChange:L,onSave:T,onDelete:()=>D(i.id)},i.id,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),m.jsxDEV("div",{children:[m.jsxDEV("div",{className:"mb-6",children:[m.jsxDEV("h2",{className:"text-xl font-semibold mb-1",children:"MCP Integrations"},void 0,!1,void 0,this),m.jsxDEV("p",{className:"text-[#666]",children:["Connect to MCP gateways for tool integrations. ",J0," of ",p.length," configured."]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),m.jsxDEV("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",children:p.map((i)=>m.jsxDEV(CI,{provider:i,isEditing:W===i.id,apiKey:R,saving:_,testing:I,error:W===i.id?w:null,success:W===i.id?C:null,onStartEdit:()=>{q(i.id),b(null),f(null)},onCancelEdit:()=>{q(null),L(""),b(null)},onApiKeyChange:L,onSave:T,onDelete:()=>D(i.id)},i.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 z2=["#f97316","#6366f1","#22c55e","#ef4444","#3b82f6","#a855f7","#14b8a6","#f59e0b"];function AI(){let{projects:Y,createProject:G,updateProject:U,deleteProject:W}=g4(),[q,R]=$4.useState(!1),[L,_]=$4.useState(null),{confirm:k,ConfirmDialog:I}=S5(),F=async(f)=>{if(!await k("Are you sure you want to delete this project? Agents in this project will become unassigned.",{confirmText:"Delete",title:"Delete Project"}))return;await W(f)},w=()=>{_(null),R(!0)},b=(f)=>{_(f),R(!0)},C=()=>{R(!1),_(null)};return m.jsxDEV(m.Fragment,{children:[I,m.jsxDEV("div",{className:"max-w-4xl w-full",children:[m.jsxDEV("div",{className:"mb-6 flex items-center justify-between gap-4",children:[m.jsxDEV("div",{children:[m.jsxDEV("h1",{className:"text-2xl font-semibold mb-1",children:"Projects"},void 0,!1,void 0,this),m.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),m.jsxDEV("button",{onClick:w,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:[m.jsxDEV(CO,{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?m.jsxDEV("div",{className:"text-center py-12 text-[#666]",children:[m.jsxDEV("p",{className:"text-lg mb-2",children:"No projects yet"},void 0,!1,void 0,this),m.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):m.jsxDEV("div",{className:"space-y-3",children:Y.map((f)=>m.jsxDEV("div",{className:"bg-[#111] border border-[#1a1a1a] rounded-lg p-4 flex items-center gap-4",children:[m.jsxDEV("div",{className:"w-4 h-4 rounded-full flex-shrink-0",style:{backgroundColor:f.color}},void 0,!1,void 0,this),m.jsxDEV("div",{className:"flex-1 min-w-0",children:[m.jsxDEV("h3",{className:"font-medium",children:f.name},void 0,!1,void 0,this),f.description&&m.jsxDEV("p",{className:"text-sm text-[#666] truncate",children:f.description},void 0,!1,void 0,this),m.jsxDEV("p",{className:"text-xs text-[#666] mt-1",children:[f.agentCount," agent",f.agentCount!==1?"s":""]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),m.jsxDEV("div",{className:"flex items-center gap-2",children:[m.jsxDEV("button",{onClick:()=>b(f),className:"text-sm text-[#888] hover:text-[#e0e0e0] px-2 py-1",children:"Edit"},void 0,!1,void 0,this),m.jsxDEV("button",{onClick:()=>F(f.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)]},f.id,!0,void 0,this))},void 0,!1,void 0,this),q&&m.jsxDEV(II,{project:L,onSave:async(f)=>{if(L){let E=await U(L.id,f);if(E)C();return!!E}else{let E=await G(f);if(E)C();return!!E}},onClose:C},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function II({project:Y,onSave:G,onClose:U}){let[W,q]=$4.useState(Y?.name||""),[R,L]=$4.useState(Y?.description||""),[_,k]=$4.useState(Y?.color||z2[Math.floor(Math.random()*z2.length)]),[I,F]=$4.useState(!1),[w,b]=$4.useState(null),C=async()=>{if(!W.trim()){b("Name is required");return}F(!0),b(null);let f=await G({name:W,description:R||void 0,color:_});if(F(!1),!f)b(Y?"Failed to update project":"Failed to create project")};return m.jsxDEV(TQ,{onClose:U,children:[m.jsxDEV("h2",{className:"text-xl font-semibold mb-6",children:Y?"Edit Project":"Create New Project"},void 0,!1,void 0,this),m.jsxDEV("div",{className:"space-y-4",children:[m.jsxDEV("div",{children:[m.jsxDEV("label",{className:"block text-sm text-[#666] mb-1",children:"Name"},void 0,!1,void 0,this),m.jsxDEV("input",{type:"text",value:W,onChange:(f)=>q(f.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),m.jsxDEV("div",{children:[m.jsxDEV("label",{className:"block text-sm text-[#666] mb-1",children:"Description (optional)"},void 0,!1,void 0,this),m.jsxDEV("input",{type:"text",value:R,onChange:(f)=>L(f.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),m.jsxDEV("div",{children:[m.jsxDEV("label",{className:"block text-sm text-[#666] mb-1",children:"Color"},void 0,!1,void 0,this),m.jsxDEV("div",{className:"flex gap-3 flex-wrap",children:z2.map((f)=>m.jsxDEV("button",{type:"button",onClick:()=>k(f),className:`w-10 h-10 rounded-full transition ${_===f?"ring-2 ring-white ring-offset-2 ring-offset-[#111]":"hover:scale-110"}`,style:{backgroundColor:f}},f,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),w&&m.jsxDEV("p",{className:"text-red-400 text-sm",children:w},void 0,!1,void 0,this)]},void 0,!0,void 0,this),m.jsxDEV("div",{className:"flex gap-3 mt-6",children:[m.jsxDEV("button",{onClick:U,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),m.jsxDEV("button",{onClick:C,disabled:I||!W.trim(),className:"flex-1 bg-[#f97316] hover:bg-[#fb923c] disabled:opacity-50 text-black px-4 py-2 rounded font-medium transition",children:I?"Saving...":Y?"Update":"Create"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function kI(){let{authFetch:Y}=k1(),[G,U]=$4.useState(null),[W,q]=$4.useState(!1),[R,L]=$4.useState(!1),[_,k]=$4.useState(null),[I,F]=$4.useState(null),[w,b]=$4.useState(null),C=async()=>{q(!0),k(null);try{let v=await Y("/api/version");if(!v.ok)throw Error("Failed to check for updates");let T=await v.json();U(T)}catch(v){k("Failed to check for updates")}q(!1)},f=async()=>{L(!0),k(null),F(null);try{let T=await(await Y("/api/version/update",{method:"POST"})).json();if(!T.success)k(T.error||"Update failed");else{let D=T.restarted?.length||0,n=D>0?` ${D} running agent${D>1?"s":""} restarted.`:"";F(`Agent binary updated to v${T.version}.${n}`),await C()}}catch(v){k("Failed to update agent")}L(!1)};$4.useEffect(()=>{C()},[]);let E=(v,T)=>{navigator.clipboard.writeText(v),b(T),setTimeout(()=>b(null),2000)},V=G?.apteva.updateAvailable||G?.agent.updateAvailable;return m.jsxDEV("div",{className:"max-w-4xl w-full",children:[m.jsxDEV("div",{className:"mb-6",children:[m.jsxDEV("h1",{className:"text-2xl font-semibold mb-1",children:"Updates"},void 0,!1,void 0,this),m.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),W&&!G?m.jsxDEV("div",{className:"text-[#666]",children:"Checking version info..."},void 0,!1,void 0,this):_&&!G?m.jsxDEV("div",{className:"text-red-400",children:_},void 0,!1,void 0,this):G?.isDocker?m.jsxDEV("div",{className:"space-y-6",children:[m.jsxDEV("div",{className:"bg-blue-500/10 border border-blue-500/30 rounded-lg p-4",children:[m.jsxDEV("div",{className:"flex items-center gap-2 text-blue-400 mb-2",children:[m.jsxDEV("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24",children:m.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),m.jsxDEV("span",{className:"font-medium",children:"Docker Environment"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),m.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),m.jsxDEV("div",{className:"bg-[#111] border border-[#1a1a1a] rounded-lg p-5",children:[m.jsxDEV("div",{className:"flex items-center justify-between mb-4",children:[m.jsxDEV("div",{children:[m.jsxDEV("h3",{className:"font-medium text-lg",children:"Current Version"},void 0,!1,void 0,this),m.jsxDEV("p",{className:"text-sm text-[#666]",children:"apteva + agent binary"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),m.jsxDEV("div",{className:"text-right",children:m.jsxDEV("div",{className:"text-xl font-mono",children:["v",G.apteva.installed||"?"]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),V?m.jsxDEV("div",{className:"bg-[#f97316]/10 border border-[#f97316]/30 rounded-lg p-4",children:[m.jsxDEV("p",{className:"text-sm text-[#888] mb-3",children:["A newer version (v",G.apteva.latest,") is available. To update:"]},void 0,!0,void 0,this),m.jsxDEV("div",{className:"space-y-2",children:[m.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),m.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),m.jsxDEV("button",{onClick:()=>{navigator.clipboard.writeText("docker pull apteva/apteva:latest && docker compose up -d"),b("docker"),setTimeout(()=>b(null),2000)},className:"mt-3 px-3 py-1.5 bg-[#1a1a1a] hover:bg-[#222] rounded text-sm",children:w==="docker"?"Copied!":"Copy commands"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):m.jsxDEV("div",{className:"flex items-center gap-2 text-green-400 text-sm",children:[m.jsxDEV(w5,{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),m.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):G?m.jsxDEV("div",{className:"space-y-6",children:[I&&m.jsxDEV("div",{className:"bg-green-500/10 border border-green-500/30 rounded-lg p-4 text-green-400",children:I},void 0,!1,void 0,this),_&&m.jsxDEV("div",{className:"bg-red-500/10 border border-red-500/30 rounded-lg p-4 text-red-400",children:_},void 0,!1,void 0,this),m.jsxDEV("div",{className:"bg-[#111] border border-[#1a1a1a] rounded-lg p-5",children:[m.jsxDEV("div",{className:"flex items-center justify-between mb-4",children:[m.jsxDEV("div",{children:[m.jsxDEV("h3",{className:"font-medium text-lg",children:"apteva"},void 0,!1,void 0,this),m.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),m.jsxDEV("div",{className:"text-right",children:[m.jsxDEV("div",{className:"text-xl font-mono",children:["v",G.apteva.installed||"?"]},void 0,!0,void 0,this),G.apteva.updateAvailable&&m.jsxDEV("div",{className:"text-sm text-[#f97316]",children:["→ v",G.apteva.latest]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),G.apteva.updateAvailable?m.jsxDEV("div",{className:"bg-[#f97316]/10 border border-[#f97316]/30 rounded-lg p-4",children:[m.jsxDEV("p",{className:"text-sm text-[#888] mb-3",children:"Update by running:"},void 0,!1,void 0,this),m.jsxDEV("div",{className:"flex items-center gap-2",children:[m.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),m.jsxDEV("button",{onClick:()=>E("npx apteva@latest","apteva"),className:"px-3 py-2 bg-[#1a1a1a] hover:bg-[#222] rounded text-sm",children:w==="apteva"?"Copied!":"Copy"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):m.jsxDEV("div",{className:"flex items-center gap-2 text-green-400 text-sm",children:[m.jsxDEV(w5,{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),m.jsxDEV("div",{className:"bg-[#111] border border-[#1a1a1a] rounded-lg p-5",children:[m.jsxDEV("div",{className:"flex items-center justify-between mb-4",children:[m.jsxDEV("div",{children:[m.jsxDEV("h3",{className:"font-medium text-lg",children:"Agent Binary"},void 0,!1,void 0,this),m.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),m.jsxDEV("div",{className:"text-right",children:[m.jsxDEV("div",{className:"text-xl font-mono",children:["v",G.agent.installed||"?"]},void 0,!0,void 0,this),G.agent.updateAvailable&&m.jsxDEV("div",{className:"text-sm text-[#f97316]",children:["→ v",G.agent.latest]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),G.agent.updateAvailable?m.jsxDEV("div",{className:"bg-[#f97316]/10 border border-[#f97316]/30 rounded-lg p-4",children:[m.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),m.jsxDEV("div",{className:"flex items-center gap-2",children:m.jsxDEV("button",{onClick:f,disabled:R,className:"px-4 py-2 bg-[#f97316] text-black rounded font-medium text-sm disabled:opacity-50",children:R?"Updating...":"Update Agent"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this):m.jsxDEV("div",{className:"flex items-center gap-2 text-green-400 text-sm",children:[m.jsxDEV(w5,{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),!V&&!I&&m.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:[m.jsxDEV(w5,{className:"w-5 h-5"},void 0,!1,void 0,this),"Everything is up to date!"]},void 0,!0,void 0,this),m.jsxDEV("button",{onClick:C,disabled:W,className:"text-sm text-[#666] hover:text-[#888] disabled:opacity-50",children:W?"Checking...":"Check for updates"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)}function TI({provider:Y,isEditing:G,apiKey:U,saving:W,testing:q,error:R,success:L,onStartEdit:_,onCancelEdit:k,onApiKeyChange:I,onSave:F,onDelete:w}){return m.jsxDEV("div",{className:`bg-[#111] border rounded-lg p-4 ${Y.hasKey?"border-green-500/20":"border-[#1a1a1a]"}`,children:[m.jsxDEV("div",{className:"flex items-start justify-between gap-2 mb-2",children:[m.jsxDEV("div",{className:"min-w-0",children:[m.jsxDEV("h3",{className:"font-medium",children:Y.name},void 0,!1,void 0,this),m.jsxDEV("p",{className:"text-sm text-[#666] truncate",children:Y.type==="integration"?Y.description||"MCP integration":`${Y.models.length} models`},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Y.hasKey?m.jsxDEV("span",{className:"text-green-400 text-xs flex items-center gap-1 bg-green-500/10 px-2 py-1 rounded whitespace-nowrap flex-shrink-0",children:[m.jsxDEV(w5,{className:"w-3 h-3"},void 0,!1,void 0,this),Y.keyHint]},void 0,!0,void 0,this):m.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),m.jsxDEV("div",{className:"mt-3 pt-3 border-t border-[#1a1a1a]",children:G?m.jsxDEV("div",{className:"space-y-3",children:[m.jsxDEV("input",{type:"password",value:U,onChange:(b)=>I(b.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),R&&m.jsxDEV("p",{className:"text-red-400 text-sm",children:R},void 0,!1,void 0,this),L&&m.jsxDEV("p",{className:"text-green-400 text-sm",children:L},void 0,!1,void 0,this),m.jsxDEV("div",{className:"flex gap-2",children:[m.jsxDEV("button",{onClick:k,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),m.jsxDEV("button",{onClick:F,disabled:!U||W,className:"flex-1 px-3 py-1.5 bg-[#f97316] text-black rounded text-sm font-medium disabled:opacity-50",children:q?"Validating...":W?"Saving...":"Save"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):Y.hasKey?m.jsxDEV("div",{className:"flex items-center justify-between",children:[m.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),m.jsxDEV("div",{className:"flex items-center gap-3",children:[m.jsxDEV("button",{onClick:_,className:"text-sm text-[#888] hover:text-[#e0e0e0]",children:"Update key"},void 0,!1,void 0,this),m.jsxDEV("button",{onClick:w,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):m.jsxDEV("div",{className:"flex items-center justify-between",children:[m.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),m.jsxDEV("button",{onClick:_,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)}function CI({provider:Y,isEditing:G,apiKey:U,saving:W,testing:q,error:R,success:L,onStartEdit:_,onCancelEdit:k,onApiKeyChange:I,onSave:F,onDelete:w}){return m.jsxDEV("div",{className:`bg-[#111] border rounded-lg p-4 ${Y.hasKey?"border-[#f97316]/20":"border-[#1a1a1a]"}`,children:[m.jsxDEV("div",{className:"flex items-center justify-between mb-2",children:[m.jsxDEV("div",{children:[m.jsxDEV("h3",{className:"font-medium",children:Y.name},void 0,!1,void 0,this),m.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?m.jsxDEV("span",{className:"text-[#f97316] text-xs flex items-center gap-1 bg-[#f97316]/10 px-2 py-1 rounded",children:[m.jsxDEV(w5,{className:"w-3 h-3"},void 0,!1,void 0,this),Y.keyHint]},void 0,!0,void 0,this):m.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),m.jsxDEV("div",{className:"mt-3 pt-3 border-t border-[#1a1a1a]",children:G?m.jsxDEV("div",{className:"space-y-3",children:[m.jsxDEV("input",{type:"password",value:U,onChange:(b)=>I(b.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),R&&m.jsxDEV("p",{className:"text-red-400 text-sm",children:R},void 0,!1,void 0,this),L&&m.jsxDEV("p",{className:"text-green-400 text-sm",children:L},void 0,!1,void 0,this),m.jsxDEV("div",{className:"flex gap-2",children:[m.jsxDEV("button",{onClick:k,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),m.jsxDEV("button",{onClick:F,disabled:!U||W,className:"flex-1 px-3 py-1.5 bg-[#f97316] text-black rounded text-sm font-medium disabled:opacity-50",children:q?"Validating...":W?"Saving...":"Save"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):Y.hasKey?m.jsxDEV("div",{className:"flex items-center justify-between",children:[m.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),m.jsxDEV("div",{className:"flex items-center gap-3",children:[m.jsxDEV("button",{onClick:_,className:"text-sm text-[#888] hover:text-[#e0e0e0]",children:"Update key"},void 0,!1,void 0,this),m.jsxDEV("button",{onClick:w,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):m.jsxDEV("div",{className:"flex items-center justify-between",children:[m.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),m.jsxDEV("button",{onClick:_,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)}function vI(){let{authFetch:Y}=k1(),[G,U]=$4.useState(!1),[W,q]=$4.useState(null),[R,L]=$4.useState(null),{confirm:_,ConfirmDialog:k}=S5(),I=async()=>{try{let b=await(await Y("/api/telemetry/stats")).json();L(b.stats?.total_events||0)}catch{L(null)}};$4.useEffect(()=>{I()},[]);let F=async()=>{if(!await _("Are you sure you want to delete all telemetry data? This cannot be undone.",{confirmText:"Clear All",title:"Clear Telemetry Data"}))return;U(!0),q(null);try{let b=await Y("/api/telemetry/clear",{method:"POST"}),C=await b.json();if(b.ok)q({type:"success",text:`Cleared ${C.deleted||0} telemetry events.`}),L(0);else q({type:"error",text:C.error||"Failed to clear telemetry"})}catch{q({type:"error",text:"Failed to clear telemetry"})}U(!1)};return m.jsxDEV(m.Fragment,{children:[k,m.jsxDEV("div",{className:"max-w-4xl w-full",children:[m.jsxDEV("div",{className:"mb-6",children:[m.jsxDEV("h1",{className:"text-2xl font-semibold mb-1",children:"Data Management"},void 0,!1,void 0,this),m.jsxDEV("p",{className:"text-[#666]",children:"Manage stored data and telemetry."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),m.jsxDEV("div",{className:"bg-[#111] border border-[#1a1a1a] rounded-lg p-4",children:[m.jsxDEV("h3",{className:"font-medium mb-2",children:"Telemetry Data"},void 0,!1,void 0,this),m.jsxDEV("p",{className:"text-sm text-[#666] mb-4",children:R!==null?`${R.toLocaleString()} events stored`:"Loading..."},void 0,!1,void 0,this),W&&m.jsxDEV("div",{className:`mb-4 p-3 rounded text-sm ${W.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:W.text},void 0,!1,void 0,this),m.jsxDEV("button",{onClick:F,disabled:G||R===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:G?"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 x4=q0(Z1(),1),SI=[{key:"memory",icon:bz,label:"Memory"},{key:"tasks",icon:f5,label:"Tasks"},{key:"files",icon:vQ,label:"Files"},{key:"vision",icon:Fz,label:"Vision"},{key:"operator",icon:Mz,label:"Operator"},{key:"mcp",icon:h5,label:"MCP"},{key:"realtime",icon:Pz,label:"Realtime"},{key:"agents",icon:SQ,label:"Multi-Agent"}];function _3({agent:Y,selected:G,onSelect:U,onToggle:W,showProject:q}){let R=SI.filter((b)=>Y.features?.[b.key]),L=Y.mcpServerDetails||[],_=Y.skillDetails||[],{isActive:k,type:I}=SZ(Y.id),{projects:F}=g4(),w=Y.projectId?F.find((b)=>b.id===Y.projectId):null;return x4.jsxDEV("div",{onClick:U,className:`bg-[#111] rounded p-5 border transition cursor-pointer flex flex-col h-full ${G?"border-[#f97316]":"border-[#1a1a1a] hover:border-[#333]"}`,children:[x4.jsxDEV("div",{className:"flex items-start justify-between mb-3",children:[x4.jsxDEV("div",{children:[x4.jsxDEV("h3",{className:"font-semibold text-lg",children:Y.name},void 0,!1,void 0,this),x4.jsxDEV("p",{className:"text-sm text-[#666]",children:[Y.provider," / ",Y.model,Y.port&&x4.jsxDEV("span",{className:"text-[#444]",children:[" · :",Y.port]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),q&&w&&x4.jsxDEV("p",{className:"text-sm text-[#666] flex items-center gap-1.5 mt-1",children:[x4.jsxDEV("span",{className:"w-2 h-2 rounded-full",style:{backgroundColor:w.color}},void 0,!1,void 0,this),w.name]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),x4.jsxDEV(fI,{status:Y.status,isActive:k&&Y.status==="running",activityType:I},void 0,!1,void 0,this)]},void 0,!0,void 0,this),R.length>0&&x4.jsxDEV("div",{className:"flex flex-wrap gap-1.5 mb-3",children:R.map(({key:b,icon:C,label:f})=>x4.jsxDEV("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded bg-[#f97316]/10 text-[#f97316]/70 text-xs",title:f,children:[x4.jsxDEV(C,{className:"w-3 h-3"},void 0,!1,void 0,this),f]},b,!0,void 0,this))},void 0,!1,void 0,this),L.length>0&&x4.jsxDEV("div",{className:"flex flex-wrap gap-1.5 mb-3",children:L.map((b)=>{let C=b.type==="http"&&b.url||b.status==="running";return x4.jsxDEV("span",{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded text-xs ${C?"bg-green-500/10 text-green-400":"bg-[#222] text-[#666]"}`,title:`MCP: ${b.name} (${C?"available":b.status})`,children:[x4.jsxDEV(h5,{className:"w-3 h-3"},void 0,!1,void 0,this),b.name]},b.id,!0,void 0,this)})},void 0,!1,void 0,this),_.length>0&&x4.jsxDEV("div",{className:"flex flex-wrap gap-1.5 mb-3",children:_.map((b)=>x4.jsxDEV("span",{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded text-xs ${b.enabled?"bg-purple-500/10 text-purple-400":"bg-[#222] text-[#666]"}`,title:`Skill: ${b.name} v${b.version}`,children:[x4.jsxDEV(fZ,{className:"w-3 h-3"},void 0,!1,void 0,this),b.name]},b.id,!0,void 0,this))},void 0,!1,void 0,this),x4.jsxDEV("p",{className:"text-sm text-[#666] line-clamp-2 mb-4 flex-1",children:Y.systemPrompt},void 0,!1,void 0,this),x4.jsxDEV("button",{onClick:W,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 fI({status:Y,isActive:G,activityType:U}){if(Y==="running"&&G&&U)return x4.jsxDEV("span",{className:"px-2 py-1 rounded text-xs font-medium bg-green-500/20 text-green-400 animate-pulse",children:U},void 0,!1,void 0,this);return x4.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 HW=q0(I1(),1);var H1=q0(Z1(),1),hI=[{key:"memory",label:"Memory",description:"Persistent recall",icon:bz},{key:"tasks",label:"Tasks",description:"Schedule and execute tasks",icon:f5},{key:"files",label:"Files",description:"File storage and management",icon:vQ},{key:"vision",label:"Vision",description:"Process images and PDFs",icon:Fz},{key:"operator",label:"Operator",description:"Browser automation",icon:Mz},{key:"mcp",label:"MCP",description:"External tools/services",icon:h5},{key:"realtime",label:"Realtime",description:"Voice conversations",icon:Pz},{key:"agents",label:"Multi-Agent",description:"Communicate with peer agents",icon:SQ}];function R3({form:Y,providers:G,configuredProviders:U,onFormChange:W,onProviderChange:q,onCreate:R,onClose:L,onGoToSettings:_}){let{projects:k,currentProjectId:I}=g4(),F=G.find((T)=>T.id===Y.provider),w=U.filter((T)=>T.type==="llm").map((T)=>({value:T.id,label:T.name})),b=F?.models.map((T)=>({value:T.value,label:T.label,recommended:T.recommended}))||[],C=k.map((T)=>({value:T.id,label:T.name}));HW.default.useEffect(()=>{if(Y.projectId===void 0&&I&&I!=="unassigned")W({...Y,projectId:I})},[I]);let f=(T)=>{if(T==="agents")if(typeof Y.features.agents==="boolean"?Y.features.agents:Y.features.agents?.enabled??!1)W({...Y,features:{...Y.features,agents:!1}});else W({...Y,features:{...Y.features,agents:{enabled:!0,mode:"worker",group:Y.projectId||void 0}}});else W({...Y,features:{...Y.features,[T]:!Y.features[T]}})},E=()=>{let T=Y.features.agents;if(typeof T==="boolean")return T;return T?.enabled??!1},V=()=>{return _z(Y.features,Y.projectId).mode||"worker"},v=(T)=>{let D=_z(Y.features,Y.projectId);W({...Y,features:{...Y.features,agents:{...D,enabled:!0,mode:T}}})};return H1.jsxDEV(TQ,{children:[H1.jsxDEV("h2",{className:"text-xl font-semibold mb-4",children:"Create New Agent"},void 0,!1,void 0,this),w.length===0?H1.jsxDEV(yI,{onGoToSettings:_},void 0,!1,void 0,this):H1.jsxDEV(H1.Fragment,{children:[H1.jsxDEV("div",{className:"space-y-4",children:[H1.jsxDEV(f8,{label:"Name",children:H1.jsxDEV("input",{type:"text",value:Y.name,onChange:(T)=>W({...Y,name:T.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),k.length>0&&H1.jsxDEV(f8,{label:"Project",children:H1.jsxDEV(V6,{value:Y.projectId||"",options:C,onChange:(T)=>W({...Y,projectId:T||null}),placeholder:"Select project..."},void 0,!1,void 0,this)},void 0,!1,void 0,this),H1.jsxDEV(f8,{label:"Provider",children:H1.jsxDEV(V6,{value:Y.provider,options:w,onChange:q,placeholder:"Select provider..."},void 0,!1,void 0,this)},void 0,!1,void 0,this),H1.jsxDEV(f8,{label:"Model",children:H1.jsxDEV(V6,{value:Y.model,options:b,onChange:(T)=>W({...Y,model:T}),placeholder:"Select model..."},void 0,!1,void 0,this)},void 0,!1,void 0,this),H1.jsxDEV(f8,{label:"System Prompt",children:H1.jsxDEV("textarea",{value:Y.systemPrompt,onChange:(T)=>W({...Y,systemPrompt:T.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),H1.jsxDEV(f8,{label:"Features",children:H1.jsxDEV("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:hI.map(({key:T,label:D,description:n,icon:p})=>{let r=T==="agents"?E():!!Y.features[T];return H1.jsxDEV("button",{type:"button",onClick:()=>f(T),className:`flex items-center gap-3 p-3 rounded border text-left transition ${r?"border-[#f97316] bg-[#f97316]/10":"border-[#222] hover:border-[#333]"}`,children:[H1.jsxDEV(p,{className:`w-5 h-5 flex-shrink-0 ${r?"text-[#f97316]":"text-[#666]"}`},void 0,!1,void 0,this),H1.jsxDEV("div",{className:"flex-1 min-w-0",children:[H1.jsxDEV("div",{className:`text-sm font-medium ${r?"text-[#f97316]":""}`,children:D},void 0,!1,void 0,this),H1.jsxDEV("div",{className:"text-xs text-[#666]",children:n},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},T,!0,void 0,this)})},void 0,!1,void 0,this)},void 0,!1,void 0,this),E()&&H1.jsxDEV(f8,{label:"Multi-Agent Mode",children:[H1.jsxDEV("div",{className:"flex gap-2",children:[H1.jsxDEV("button",{type:"button",onClick:()=>v("coordinator"),className:`flex-1 p-3 rounded border text-left transition ${V()==="coordinator"?"border-[#f97316] bg-[#f97316]/10":"border-[#222] hover:border-[#333]"}`,children:[H1.jsxDEV("div",{className:`text-sm font-medium ${V()==="coordinator"?"text-[#f97316]":""}`,children:"Coordinator"},void 0,!1,void 0,this),H1.jsxDEV("div",{className:"text-xs text-[#666]",children:"Orchestrates and delegates"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),H1.jsxDEV("button",{type:"button",onClick:()=>v("worker"),className:`flex-1 p-3 rounded border text-left transition ${V()==="worker"?"border-[#f97316] bg-[#f97316]/10":"border-[#222] hover:border-[#333]"}`,children:[H1.jsxDEV("div",{className:`text-sm font-medium ${V()==="worker"?"text-[#f97316]":""}`,children:"Worker"},void 0,!1,void 0,this),H1.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&&H1.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"&&H1.jsxDEV(f8,{label:"Agent Built-in Tools",children:[H1.jsxDEV("div",{className:"flex flex-wrap gap-2",children:[H1.jsxDEV("button",{type:"button",onClick:()=>W({...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:[H1.jsxDEV("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:H1.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),H1.jsxDEV("span",{className:"text-sm",children:"Web Search"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),H1.jsxDEV("button",{type:"button",onClick:()=>W({...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:[H1.jsxDEV("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:H1.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),H1.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),H1.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),H1.jsxDEV("div",{className:"flex gap-3 mt-6",children:[H1.jsxDEV("button",{onClick:L,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),H1.jsxDEV("button",{onClick:R,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 f8({label:Y,children:G}){return H1.jsxDEV("div",{children:[H1.jsxDEV("label",{className:"block text-sm text-[#666] mb-1",children:Y},void 0,!1,void 0,this),G]},void 0,!0,void 0,this)}function yI({onGoToSettings:Y}){return H1.jsxDEV("div",{className:"text-center py-6",children:[H1.jsxDEV("p",{className:"text-[#666] mb-4",children:"No API keys configured. Add a provider key first."},void 0,!1,void 0,this),H1.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 b1=q0(I1(),1);var S=q0(Z1(),1),VI=[{key:"memory",label:"Memory",description:"Persistent recall",icon:bz},{key:"tasks",label:"Tasks",description:"Schedule and execute tasks",icon:f5},{key:"files",label:"Files",description:"File storage and management",icon:vQ},{key:"vision",label:"Vision",description:"Process images and PDFs",icon:Fz},{key:"operator",label:"Operator",description:"Browser automation",icon:Mz},{key:"mcp",label:"MCP",description:"External tools/services",icon:h5},{key:"realtime",label:"Realtime",description:"Voice conversations",icon:Pz},{key:"agents",label:"Multi-Agent",description:"Communicate with peer agents",icon:SQ}];function N3({agent:Y,providers:G,onClose:U,onStartAgent:W,onUpdateAgent:q,onDeleteAgent:R}){let[L,_]=b1.useState("chat");return S.jsxDEV("div",{className:"w-full h-full flex flex-col overflow-hidden bg-[#0a0a0a] border-l border-[#1a1a1a]",children:[S.jsxDEV("div",{className:"border-b border-[#1a1a1a] flex items-center",children:[S.jsxDEV("div",{className:"flex-1 overflow-x-auto scrollbar-hide px-2 md:px-4",children:S.jsxDEV("div",{className:"flex gap-1",children:[S.jsxDEV(mQ,{active:L==="chat",onClick:()=>_("chat"),children:"Chat"},void 0,!1,void 0,this),S.jsxDEV(mQ,{active:L==="threads",onClick:()=>_("threads"),children:"Threads"},void 0,!1,void 0,this),S.jsxDEV(mQ,{active:L==="tasks",onClick:()=>_("tasks"),children:"Tasks"},void 0,!1,void 0,this),S.jsxDEV(mQ,{active:L==="memory",onClick:()=>_("memory"),children:"Memory"},void 0,!1,void 0,this),S.jsxDEV(mQ,{active:L==="files",onClick:()=>_("files"),children:"Files"},void 0,!1,void 0,this),S.jsxDEV(mQ,{active:L==="settings",onClick:()=>_("settings"),children:"Settings"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),S.jsxDEV("button",{onClick:U,className:"text-[#666] hover:text-[#e0e0e0] transition p-2 flex-shrink-0 mr-2",children:S.jsxDEV(N7,{},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),S.jsxDEV("div",{className:"flex-1 min-h-0 flex flex-col overflow-hidden",children:[L==="chat"&&S.jsxDEV(DI,{agent:Y,onStartAgent:W},void 0,!1,void 0,this),L==="threads"&&S.jsxDEV(EI,{agent:Y},void 0,!1,void 0,this),L==="tasks"&&S.jsxDEV(mI,{agent:Y},void 0,!1,void 0,this),L==="memory"&&S.jsxDEV(uI,{agent:Y},void 0,!1,void 0,this),L==="files"&&S.jsxDEV(gI,{agent:Y},void 0,!1,void 0,this),L==="settings"&&S.jsxDEV(xI,{agent:Y,providers:G,onUpdateAgent:q,onDeleteAgent:R},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function mQ({active:Y,onClick:G,children:U}){return S.jsxDEV("button",{onClick:G,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:U},void 0,!1,void 0,this)}function DI({agent:Y,onStartAgent:G}){if(Y.status==="running"&&Y.port)return S.jsxDEV(q3,{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 S.jsxDEV("div",{className:"flex-1 flex items-center justify-center text-[#666]",children:S.jsxDEV("div",{className:"text-center",children:[S.jsxDEV("p",{className:"text-lg mb-2",children:"Agent is not running"},void 0,!1,void 0,this),S.jsxDEV("button",{onClick:G,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 EI({agent:Y}){let[G,U]=b1.useState([]),[W,q]=b1.useState(!0),[R,L]=b1.useState(null),[_,k]=b1.useState(null),[I,F]=b1.useState([]),[w,b]=b1.useState(!1),{confirm:C,ConfirmDialog:f}=S5();b1.useEffect(()=>{U([]),k(null),F([]),L(null),q(!0)},[Y.id]),b1.useEffect(()=>{if(Y.status!=="running"){q(!1);return}(async()=>{try{let T=await fetch(`/api/agents/${Y.id}/threads`);if(!T.ok)throw Error("Failed to fetch threads");let D=await T.json();U(D.threads||[]),L(null)}catch(T){L(T instanceof Error?T.message:"Failed to load threads")}finally{q(!1)}})()},[Y.id,Y.status]);let E=async(v)=>{k(v),b(!0);try{let T=await fetch(`/api/agents/${Y.id}/threads/${v}/messages`);if(!T.ok)throw Error("Failed to fetch messages");let D=await T.json();F(D.messages||[])}catch{F([])}finally{b(!1)}},V=async(v,T)=>{if(T.stopPropagation(),!await C("Delete this thread?",{confirmText:"Delete",title:"Delete Thread"}))return;try{if(await fetch(`/api/agents/${Y.id}/threads/${v}`,{method:"DELETE"}),U((n)=>n.filter((p)=>p.id!==v)),_===v)k(null),F([])}catch{}};if(Y.status!=="running")return S.jsxDEV("div",{className:"flex-1 flex items-center justify-center text-[#666]",children:S.jsxDEV("p",{children:"Start the agent to view threads"},void 0,!1,void 0,this)},void 0,!1,void 0,this);if(W)return S.jsxDEV("div",{className:"flex-1 flex items-center justify-center text-[#666]",children:S.jsxDEV("p",{children:"Loading threads..."},void 0,!1,void 0,this)},void 0,!1,void 0,this);if(R)return S.jsxDEV("div",{className:"flex-1 flex items-center justify-center text-red-400",children:S.jsxDEV("p",{children:R},void 0,!1,void 0,this)},void 0,!1,void 0,this);if(_){let v=G.find((T)=>T.id===_);return S.jsxDEV(S.Fragment,{children:[f,S.jsxDEV("div",{className:"flex-1 flex flex-col overflow-hidden",children:[S.jsxDEV("div",{className:"flex items-center gap-3 px-4 py-3 border-b border-[#1a1a1a]",children:[S.jsxDEV("button",{onClick:()=>{k(null),F([])},className:"text-[#666] hover:text-[#e0e0e0] transition text-lg",children:"←"},void 0,!1,void 0,this),S.jsxDEV("div",{className:"flex-1",children:[S.jsxDEV("p",{className:"text-sm font-medium",children:v?.title||`Thread ${_.slice(0,8)}`},void 0,!1,void 0,this),S.jsxDEV("p",{className:"text-xs text-[#666]",children:v&&new Date(v.updated_at||v.created_at).toLocaleString()},void 0,!1,void 0,this)]},void 0,!0,void 0,this),S.jsxDEV("button",{onClick:(T)=>V(_,T),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),S.jsxDEV("div",{className:"flex-1 overflow-auto p-4",children:w?S.jsxDEV("p",{className:"text-[#666]",children:"Loading messages..."},void 0,!1,void 0,this):I.length===0?S.jsxDEV("p",{className:"text-[#666]",children:"No messages in this thread"},void 0,!1,void 0,this):S.jsxDEV("div",{className:"space-y-4",children:I.map((T,D)=>S.jsxDEV("div",{className:`${T.role==="user"?"text-right":""}`,children:S.jsxDEV("div",{className:`inline-block max-w-[80%] p-3 rounded ${T.role==="user"?"bg-[#f97316]/20 text-[#f97316]":"bg-[#1a1a1a] text-[#e0e0e0]"}`,children:[S.jsxDEV("div",{className:"text-sm whitespace-pre-wrap",children:typeof T.content==="string"?T.content:Array.isArray(T.content)?T.content.map((n,p)=>S.jsxDEV("div",{children:[n.type==="text"&&n.text,n.type==="tool_use"&&S.jsxDEV("div",{className:"bg-[#222] p-2 rounded mt-1 text-xs text-[#888]",children:["\uD83D\uDD27 Tool: ",n.name]},void 0,!0,void 0,this),n.type==="tool_result"&&S.jsxDEV("div",{className:"bg-[#222] p-2 rounded mt-1 text-xs text-[#888]",children:["\uD83D\uDCCB Result: ",typeof n.content==="string"?n.content.slice(0,200):"..."]},void 0,!0,void 0,this)]},p,!0,void 0,this)):JSON.stringify(T.content)},void 0,!1,void 0,this),S.jsxDEV("p",{className:"text-xs text-[#666] mt-1",children:new Date(T.created_at).toLocaleTimeString()},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},D,!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 S.jsxDEV(S.Fragment,{children:[f,S.jsxDEV("div",{className:"flex-1 overflow-auto",children:G.length===0?S.jsxDEV("div",{className:"flex items-center justify-center h-full text-[#666]",children:S.jsxDEV("p",{children:"No conversation threads yet"},void 0,!1,void 0,this)},void 0,!1,void 0,this):S.jsxDEV("div",{className:"divide-y divide-[#1a1a1a]",children:G.map((v)=>S.jsxDEV("div",{onClick:()=>E(v.id),className:"p-4 cursor-pointer hover:bg-[#111] transition flex items-center justify-between",children:[S.jsxDEV("div",{className:"flex-1 min-w-0",children:[S.jsxDEV("p",{className:"text-sm font-medium truncate",children:v.title||`Thread ${v.id.slice(0,8)}`},void 0,!1,void 0,this),S.jsxDEV("p",{className:"text-xs text-[#666] mt-1",children:[new Date(v.updated_at||v.created_at).toLocaleString(),v.message_count!==void 0&&` • ${v.message_count} messages`]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),S.jsxDEV("button",{onClick:(T)=>V(v.id,T),className:"text-[#666] hover:text-red-400 text-lg ml-4",children:"×"},void 0,!1,void 0,this)]},v.id,!0,void 0,this))},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function mI({agent:Y}){let[G,U]=b1.useState([]),[W,q]=b1.useState(!0),[R,L]=b1.useState(null),[_,k]=b1.useState("all");b1.useEffect(()=>{U([]),L(null),q(!0)},[Y.id]);let I=async()=>{if(Y.status!=="running"){q(!1);return}try{let w=await fetch(`/api/agents/${Y.id}/tasks?status=${_}`);if(!w.ok)throw Error("Failed to fetch tasks");let b=await w.json();U(b.tasks||[]),L(null)}catch(w){L(w instanceof Error?w.message:"Failed to load tasks")}finally{q(!1)}};b1.useEffect(()=>{q(!0),I()},[Y.id,Y.status,_]),b1.useEffect(()=>{if(Y.status!=="running")return;let w=setInterval(I,5000);return()=>clearInterval(w)},[Y.id,Y.status,_]);let F=(w)=>{switch(w){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 S.jsxDEV("div",{className:"flex-1 flex items-center justify-center text-[#666]",children:S.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 S.jsxDEV("div",{className:"flex-1 flex items-center justify-center text-[#666]",children:S.jsxDEV("div",{className:"text-center",children:[S.jsxDEV("p",{className:"mb-2",children:"Tasks feature is not enabled"},void 0,!1,void 0,this),S.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(W)return S.jsxDEV("div",{className:"flex-1 flex items-center justify-center text-[#666]",children:S.jsxDEV("p",{children:"Loading tasks..."},void 0,!1,void 0,this)},void 0,!1,void 0,this);if(R)return S.jsxDEV("div",{className:"flex-1 flex items-center justify-center text-red-400",children:S.jsxDEV("p",{children:R},void 0,!1,void 0,this)},void 0,!1,void 0,this);return S.jsxDEV("div",{className:"flex-1 overflow-auto p-4",children:[S.jsxDEV("div",{className:"flex gap-2 mb-4",children:["all","pending","running","completed"].map((w)=>S.jsxDEV("button",{onClick:()=>k(w),className:`px-3 py-1 text-xs rounded transition ${_===w?"bg-[#f97316] text-black":"bg-[#1a1a1a] text-[#666] hover:text-[#888]"}`,children:w.charAt(0).toUpperCase()+w.slice(1)},w,!1,void 0,this))},void 0,!1,void 0,this),G.length===0?S.jsxDEV("div",{className:"text-center py-10 text-[#666]",children:S.jsxDEV("p",{children:["No ",_==="all"?"":_+" ","tasks"]},void 0,!0,void 0,this)},void 0,!1,void 0,this):S.jsxDEV("div",{className:"space-y-3",children:G.map((w)=>S.jsxDEV("div",{className:"bg-[#111] border border-[#1a1a1a] rounded p-3",children:[S.jsxDEV("div",{className:"flex items-start justify-between",children:[S.jsxDEV("div",{className:"flex-1 min-w-0",children:[S.jsxDEV("p",{className:"text-sm font-medium text-[#e0e0e0]",children:w.name},void 0,!1,void 0,this),w.description&&S.jsxDEV("p",{className:"text-xs text-[#666] mt-1 line-clamp-2",children:w.description},void 0,!1,void 0,this)]},void 0,!0,void 0,this),S.jsxDEV("span",{className:`text-xs px-2 py-0.5 rounded ml-2 ${F(w.status)}`,children:w.status},void 0,!1,void 0,this)]},void 0,!0,void 0,this),S.jsxDEV("div",{className:"flex items-center gap-4 mt-2 text-xs text-[#666]",children:[S.jsxDEV("span",{children:["Created: ",new Date(w.created_at).toLocaleString()]},void 0,!0,void 0,this),w.scheduled_at&&S.jsxDEV("span",{children:["Scheduled: ",new Date(w.scheduled_at).toLocaleString()]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),w.status==="completed"&&w.result&&S.jsxDEV("div",{className:"mt-2 p-2 bg-[#0a0a0a] rounded text-xs text-[#888]",children:[S.jsxDEV("p",{className:"text-[#666] mb-1",children:"Result:"},void 0,!1,void 0,this),S.jsxDEV("p",{className:"whitespace-pre-wrap",children:w.result},void 0,!1,void 0,this)]},void 0,!0,void 0,this),w.status==="failed"&&w.error&&S.jsxDEV("div",{className:"mt-2 p-2 bg-red-500/10 rounded text-xs text-red-400",children:[S.jsxDEV("p",{className:"text-red-400/70 mb-1",children:"Error:"},void 0,!1,void 0,this),S.jsxDEV("p",{className:"whitespace-pre-wrap",children:w.error},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},w.id,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function uI({agent:Y}){let[G,U]=b1.useState([]),[W,q]=b1.useState(!0),[R,L]=b1.useState(null),[_,k]=b1.useState(!1),{confirm:I,ConfirmDialog:F}=S5();b1.useEffect(()=>{U([]),L(null),q(!0)},[Y.id]);let w=async()=>{if(Y.status!=="running"){q(!1);return}try{let f=await fetch(`/api/agents/${Y.id}/memories`);if(!f.ok)throw Error("Failed to fetch memories");let E=await f.json();U(E.memories||[]),k(E.enabled??!1),L(null)}catch(f){L(f instanceof Error?f.message:"Failed to load memories")}finally{q(!1)}};b1.useEffect(()=>{w()},[Y.id,Y.status]);let b=async(f)=>{try{await fetch(`/api/agents/${Y.id}/memories/${f}`,{method:"DELETE"}),U((E)=>E.filter((V)=>V.id!==f))}catch{}},C=async()=>{if(!await I("Clear all memories?",{confirmText:"Clear",title:"Clear Memories"}))return;try{await fetch(`/api/agents/${Y.id}/memories`,{method:"DELETE"}),U([])}catch{}};if(!Y.features?.memory)return S.jsxDEV("div",{className:"flex-1 flex items-center justify-center text-[#666]",children:S.jsxDEV("div",{className:"text-center",children:[S.jsxDEV("p",{className:"mb-2",children:"Memory feature is not enabled"},void 0,!1,void 0,this),S.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 S.jsxDEV("div",{className:"flex-1 flex items-center justify-center text-[#666]",children:S.jsxDEV("p",{children:"Start the agent to view memories"},void 0,!1,void 0,this)},void 0,!1,void 0,this);if(W)return S.jsxDEV("div",{className:"flex-1 flex items-center justify-center text-[#666]",children:S.jsxDEV("p",{children:"Loading memories..."},void 0,!1,void 0,this)},void 0,!1,void 0,this);if(R)return S.jsxDEV("div",{className:"flex-1 flex items-center justify-center text-red-400",children:S.jsxDEV("p",{children:R},void 0,!1,void 0,this)},void 0,!1,void 0,this);if(!_)return S.jsxDEV("div",{className:"flex-1 flex items-center justify-center text-[#666]",children:S.jsxDEV("div",{className:"text-center",children:[S.jsxDEV("p",{className:"mb-2",children:"Memory system not initialized"},void 0,!1,void 0,this),S.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 S.jsxDEV(S.Fragment,{children:[F,S.jsxDEV("div",{className:"flex-1 overflow-auto p-4",children:[S.jsxDEV("div",{className:"flex items-center justify-between mb-4",children:[S.jsxDEV("h3",{className:"text-sm font-medium text-[#888]",children:["Stored Memories (",G.length,")"]},void 0,!0,void 0,this),G.length>0&&S.jsxDEV("button",{onClick:C,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),G.length===0?S.jsxDEV("div",{className:"text-center py-10 text-[#666]",children:[S.jsxDEV("p",{children:"No memories stored yet"},void 0,!1,void 0,this),S.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):S.jsxDEV("div",{className:"space-y-3",children:G.map((f)=>S.jsxDEV("div",{className:"bg-[#111] border border-[#1a1a1a] rounded p-3",children:[S.jsxDEV("div",{className:"flex items-start justify-between gap-2",children:[S.jsxDEV("p",{className:"text-sm text-[#e0e0e0] flex-1",children:f.content},void 0,!1,void 0,this),S.jsxDEV("button",{onClick:()=>b(f.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),S.jsxDEV("div",{className:"flex items-center gap-3 mt-2",children:[S.jsxDEV("span",{className:`text-xs px-2 py-0.5 rounded ${f.type==="preference"?"bg-purple-500/20 text-purple-400":f.type==="fact"?"bg-green-500/20 text-green-400":"bg-blue-500/20 text-blue-400"}`,children:f.type},void 0,!1,void 0,this),S.jsxDEV("span",{className:"text-xs text-[#666]",children:new Date(f.created_at).toLocaleString()},void 0,!1,void 0,this),f.importance&&S.jsxDEV("span",{className:"text-xs text-[#555]",children:["importance: ",f.importance.toFixed(1)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},f.id,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function gI({agent:Y}){let[G,U]=b1.useState([]),[W,q]=b1.useState(!0),[R,L]=b1.useState(null),[_,k]=b1.useState(!1),[I,F]=b1.useState(null),[w,b]=b1.useState(!1),C=b1.default.useRef(null),{confirm:f,ConfirmDialog:E}=S5();b1.useEffect(()=>{U([]),L(null),q(!0)},[Y.id]);let V=async()=>{if(Y.status!=="running"){q(!1);return}try{let l=await fetch(`/api/agents/${Y.id}/files`);if(!l.ok)throw Error("Failed to fetch files");let j=await l.json();U(j.files||[]),L(null)}catch(l){L(l instanceof Error?l.message:"Failed to load files")}finally{q(!1)}};b1.useEffect(()=>{V()},[Y.id,Y.status]);let v=async(l)=>{if(!await f("Delete this file?",{confirmText:"Delete",title:"Delete File"}))return;try{await fetch(`/api/agents/${Y.id}/files/${l}`,{method:"DELETE"}),U((c)=>c.filter((X0)=>X0.id!==l))}catch{}},T=(l,j)=>{let c=document.createElement("a");c.href=`/api/agents/${Y.id}/files/${l}/download`,c.download=j,c.click()},D=(l)=>{if(l<1024)return`${l} B`;if(l<1048576)return`${(l/1024).toFixed(1)} KB`;return`${(l/1048576).toFixed(1)} MB`},n=async(l)=>{k(!0),F(null);try{let j=new FormData;j.append("file",l);let c=await fetch(`/api/agents/${Y.id}/files`,{method:"POST",body:j});if(!c.ok){let X0=await c.json();throw Error(X0.error||"Upload failed")}await V()}catch(j){F(j instanceof Error?j.message:"Upload failed")}finally{k(!1)}},p=(l)=>{let j=l.target.files?.[0];if(j)n(j);l.target.value=""},r=(l)=>{l.preventDefault(),b(!1);let j=l.dataTransfer.files?.[0];if(j)n(j)},J0=(l)=>{l.preventDefault(),b(!0)},i=(l)=>{l.preventDefault(),b(!1)},t=(l)=>{if(l.startsWith("image/"))return"\uD83D\uDDBC";if(l.includes("pdf"))return"\uD83D\uDCD5";if(l.includes("json"))return"{}";if(l.includes("javascript")||l.includes("typescript"))return"⚡";if(l.startsWith("text/"))return"\uD83D\uDCC4";if(l.startsWith("audio/"))return"\uD83C\uDFB5";if(l.startsWith("video/"))return"\uD83C\uDFAC";return"\uD83D\uDCC1"};if(!Y.features?.files)return S.jsxDEV("div",{className:"flex-1 flex items-center justify-center text-[#666]",children:S.jsxDEV("div",{className:"text-center",children:[S.jsxDEV("p",{className:"mb-2",children:"Files feature is not enabled"},void 0,!1,void 0,this),S.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 S.jsxDEV("div",{className:"flex-1 flex items-center justify-center text-[#666]",children:S.jsxDEV("p",{children:"Start the agent to view files"},void 0,!1,void 0,this)},void 0,!1,void 0,this);if(W)return S.jsxDEV("div",{className:"flex-1 flex items-center justify-center text-[#666]",children:S.jsxDEV("p",{children:"Loading files..."},void 0,!1,void 0,this)},void 0,!1,void 0,this);if(R)return S.jsxDEV("div",{className:"flex-1 flex items-center justify-center text-red-400",children:S.jsxDEV("p",{children:R},void 0,!1,void 0,this)},void 0,!1,void 0,this);return S.jsxDEV(S.Fragment,{children:[E,S.jsxDEV("div",{className:`flex-1 overflow-auto p-4 transition ${w?"bg-[#f97316]/5":""}`,onDrop:r,onDragOver:J0,onDragLeave:i,children:[S.jsxDEV("input",{ref:C,type:"file",className:"hidden",onChange:p},void 0,!1,void 0,this),S.jsxDEV("div",{className:"flex items-center justify-between mb-4",children:[S.jsxDEV("h3",{className:"text-sm font-medium text-[#888]",children:["Agent Files (",G.length,")"]},void 0,!0,void 0,this),S.jsxDEV("div",{className:"flex items-center gap-2",children:[S.jsxDEV("button",{onClick:()=>C.current?.click(),disabled:_,className:"text-xs bg-[#f97316] hover:bg-[#fb923c] disabled:opacity-50 text-black px-3 py-1 rounded font-medium transition",children:_?"Uploading...":"Upload"},void 0,!1,void 0,this),S.jsxDEV("button",{onClick:V,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),I&&S.jsxDEV("div",{className:"mb-4 text-sm bg-red-500/10 text-red-400 px-3 py-2 rounded",children:I},void 0,!1,void 0,this),w&&S.jsxDEV("div",{className:"mb-4 border-2 border-dashed border-[#f97316] rounded-lg p-8 text-center",children:S.jsxDEV("p",{className:"text-[#f97316]",children:"Drop file to upload"},void 0,!1,void 0,this)},void 0,!1,void 0,this),G.length===0&&!w&&S.jsxDEV("div",{className:"text-center py-10 text-[#666]",children:[S.jsxDEV("p",{children:"No files stored yet"},void 0,!1,void 0,this),S.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&&S.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),G.length>0&&S.jsxDEV("div",{className:"space-y-2",children:G.map((l)=>S.jsxDEV("div",{className:"bg-[#111] border border-[#1a1a1a] rounded p-3 flex items-center gap-3",children:[S.jsxDEV("div",{className:"w-10 h-10 bg-[#1a1a1a] rounded flex items-center justify-center text-[#666]",children:t(l.mime_type)},void 0,!1,void 0,this),S.jsxDEV("div",{className:"flex-1 min-w-0",children:[S.jsxDEV("p",{className:"text-sm text-[#e0e0e0] truncate",children:l.filename},void 0,!1,void 0,this),S.jsxDEV("p",{className:"text-xs text-[#666]",children:[D(l.size_bytes)," • ",new Date(l.created_at).toLocaleString(),l.source&&l.source!=="upload"&&` • ${l.source}`]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),S.jsxDEV("div",{className:"flex items-center gap-2",children:[S.jsxDEV("button",{onClick:()=>T(l.id,l.filename),className:"text-xs text-[#666] hover:text-[#f97316] px-2 py-1",children:"↓"},void 0,!1,void 0,this),S.jsxDEV("button",{onClick:()=>v(l.id),className:"text-[#666] hover:text-red-400 text-sm",children:"×"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},l.id,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function xI({agent:Y,providers:G,onUpdateAgent:U,onDeleteAgent:W}){let{authFetch:q,isDev:R}=k1(),[L,_]=b1.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||[]]}),[k,I]=b1.useState(!1),[F,w]=b1.useState(!1),[b,C]=b1.useState(null),[f,E]=b1.useState([]),[V,v]=b1.useState([]),[T,D]=b1.useState(null),[n,p]=b1.useState(!1);b1.useEffect(()=>{(async()=>{try{let _0=await(await q("/api/mcp/servers")).json();E(_0.servers||[])}catch(U0){console.error("Failed to fetch MCP servers:",U0)}})()},[q]),b1.useEffect(()=>{if(!R)return;(async()=>{try{let U0=await q(`/api/agents/${Y.id}/api-key`);if(U0.ok){let _0=await U0.json();D(_0.apiKey)}}catch(U0){}})()},[Y.id,R,q]),b1.useEffect(()=>{(async()=>{try{let _0=await(await q("/api/skills")).json();v(_0.skills||[])}catch(U0){console.error("Failed to fetch skills:",U0)}})()},[q]),b1.useEffect(()=>{_({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||[]]}),C(null)},[Y.id]);let r=G.find((Q0)=>Q0.id===L.provider),J0=G.filter((Q0)=>Q0.hasKey&&Q0.type==="llm").map((Q0)=>({value:Q0.id,label:Q0.name})),i=r?.models.map((Q0)=>({value:Q0.value,label:Q0.label,recommended:Q0.recommended}))||[],t=(Q0)=>{let U0=G.find((Z0)=>Z0.id===Q0),_0=U0?.models.find((Z0)=>Z0.recommended)?.value||U0?.models[0]?.value||"";_((Z0)=>({...Z0,provider:Q0,model:_0}))},l=(Q0)=>{if(Q0==="agents"){let U0=(_0)=>{return _z(_0.features,Y.projectId).enabled};_((_0)=>{if(typeof _0.features.agents==="boolean"?_0.features.agents:_0.features.agents?.enabled??!1)return{..._0,features:{..._0.features,agents:!1}};else return{..._0,features:{..._0.features,agents:{enabled:!0,mode:"worker",group:Y.projectId||void 0}}}})}else _((U0)=>({...U0,features:{...U0.features,[Q0]:!U0.features[Q0]}}))},j=(Q0)=>{_((U0)=>{let _0=_z(U0.features,Y.projectId);return{...U0,features:{...U0.features,agents:{..._0,enabled:!0,mode:Q0}}}})},c=()=>{let Q0=L.features.agents;if(typeof Q0==="boolean")return Q0;return Q0?.enabled??!1},X0=()=>{return _z(L.features,Y.projectId).mode||"worker"},I0=(Q0)=>{_((U0)=>({...U0,mcpServers:U0.mcpServers.includes(Q0)?U0.mcpServers.filter((_0)=>_0!==Q0):[...U0.mcpServers,Q0]}))},F0=(Q0)=>{_((U0)=>({...U0,skills:U0.skills.includes(Q0)?U0.skills.filter((_0)=>_0!==Q0):[...U0.skills,Q0]}))},Q1=async()=>{I(!0),C(null);let Q0=await U(L);if(I(!1),Q0.error)C({type:"error",text:Q0.error});else C({type:"success",text:"Settings saved"}),setTimeout(()=>C(null),2000)},O1=L.name!==Y.name||L.provider!==Y.provider||L.model!==Y.model||L.systemPrompt!==Y.systemPrompt||JSON.stringify(L.features)!==JSON.stringify(Y.features)||JSON.stringify(L.mcpServers.sort())!==JSON.stringify((Y.mcpServers||[]).sort())||JSON.stringify(L.skills.sort())!==JSON.stringify((Y.skills||[]).sort());return S.jsxDEV("div",{className:"flex-1 overflow-auto p-4",children:S.jsxDEV("div",{className:"space-y-4",children:[S.jsxDEV(n7,{label:"Name",children:S.jsxDEV("input",{type:"text",value:L.name,onChange:(Q0)=>_((U0)=>({...U0,name:Q0.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),S.jsxDEV(n7,{label:"Provider",children:S.jsxDEV(V6,{value:L.provider,options:J0,onChange:t},void 0,!1,void 0,this)},void 0,!1,void 0,this),S.jsxDEV(n7,{label:"Model",children:S.jsxDEV(V6,{value:L.model,options:i,onChange:(Q0)=>_((U0)=>({...U0,model:Q0}))},void 0,!1,void 0,this)},void 0,!1,void 0,this),S.jsxDEV(n7,{label:"System Prompt",children:S.jsxDEV("textarea",{value:L.systemPrompt,onChange:(Q0)=>_((U0)=>({...U0,systemPrompt:Q0.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),S.jsxDEV(n7,{label:"Features",children:S.jsxDEV("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:VI.map(({key:Q0,label:U0,description:_0,icon:Z0})=>{let d=Q0==="agents"?c():!!L.features[Q0];return S.jsxDEV("button",{type:"button",onClick:()=>l(Q0),className:`flex items-center gap-3 p-3 rounded border text-left transition ${d?"border-[#f97316] bg-[#f97316]/10":"border-[#222] hover:border-[#333]"}`,children:[S.jsxDEV(Z0,{className:`w-5 h-5 flex-shrink-0 ${d?"text-[#f97316]":"text-[#666]"}`},void 0,!1,void 0,this),S.jsxDEV("div",{className:"flex-1 min-w-0",children:[S.jsxDEV("div",{className:`text-sm font-medium ${d?"text-[#f97316]":""}`,children:U0},void 0,!1,void 0,this),S.jsxDEV("div",{className:"text-xs text-[#666]",children:_0},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},Q0,!0,void 0,this)})},void 0,!1,void 0,this)},void 0,!1,void 0,this),c()&&S.jsxDEV(n7,{label:"Multi-Agent Mode",children:[S.jsxDEV("div",{className:"flex gap-2",children:[S.jsxDEV("button",{type:"button",onClick:()=>j("coordinator"),className:`flex-1 p-3 rounded border text-left transition ${X0()==="coordinator"?"border-[#f97316] bg-[#f97316]/10":"border-[#222] hover:border-[#333]"}`,children:[S.jsxDEV("div",{className:`text-sm font-medium ${X0()==="coordinator"?"text-[#f97316]":""}`,children:"Coordinator"},void 0,!1,void 0,this),S.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),S.jsxDEV("button",{type:"button",onClick:()=>j("worker"),className:`flex-1 p-3 rounded border text-left transition ${X0()==="worker"?"border-[#f97316] bg-[#f97316]/10":"border-[#222] hover:border-[#333]"}`,children:[S.jsxDEV("div",{className:`text-sm font-medium ${X0()==="worker"?"text-[#f97316]":""}`,children:"Worker"},void 0,!1,void 0,this),S.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&&S.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),L.provider==="anthropic"&&S.jsxDEV(n7,{label:"Agent Built-in Tools",children:[S.jsxDEV("div",{className:"flex flex-wrap gap-2",children:[S.jsxDEV("button",{type:"button",onClick:()=>_((Q0)=>({...Q0,features:{...Q0.features,builtinTools:{...Q0.features.builtinTools,webSearch:!Q0.features.builtinTools?.webSearch}}})),className:`flex items-center gap-2 px-3 py-2 rounded border transition ${L.features.builtinTools?.webSearch?"border-[#f97316] bg-[#f97316]/10 text-[#f97316]":"border-[#222] hover:border-[#333] text-[#888]"}`,children:[S.jsxDEV("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:S.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),S.jsxDEV("span",{className:"text-sm",children:"Web Search"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),S.jsxDEV("button",{type:"button",onClick:()=>_((Q0)=>({...Q0,features:{...Q0.features,builtinTools:{...Q0.features.builtinTools,webFetch:!Q0.features.builtinTools?.webFetch}}})),className:`flex items-center gap-2 px-3 py-2 rounded border transition ${L.features.builtinTools?.webFetch?"border-[#f97316] bg-[#f97316]/10 text-[#f97316]":"border-[#222] hover:border-[#333] text-[#888]"}`,children:[S.jsxDEV("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:S.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),S.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),S.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),L.features.mcp&&S.jsxDEV(n7,{label:"MCP Servers",children:f.length===0?S.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):S.jsxDEV("div",{className:"space-y-2",children:[f.filter((Q0)=>Q0.project_id===null||Q0.project_id===Y.projectId).map((Q0)=>{let U0=Q0.type==="http"&&Q0.url,_0=U0||Q0.status==="running",Z0=U0?`${Q0.source||"remote"} • http`:`${Q0.type} • ${Q0.package||Q0.command||"custom"}${Q0.status==="running"&&Q0.port?` • :${Q0.port}`:""}`;return S.jsxDEV("button",{type:"button",onClick:()=>I0(Q0.id),className:`w-full flex items-center gap-3 p-3 rounded border text-left transition ${L.mcpServers.includes(Q0.id)?"border-[#f97316] bg-[#f97316]/10":"border-[#222] hover:border-[#333]"}`,children:[S.jsxDEV("div",{className:`w-2 h-2 rounded-full flex-shrink-0 ${_0?"bg-green-400":"bg-[#444]"}`},void 0,!1,void 0,this),S.jsxDEV("div",{className:"flex-1 min-w-0",children:[S.jsxDEV("div",{className:"flex items-center gap-2",children:[S.jsxDEV("span",{className:`text-sm font-medium ${L.mcpServers.includes(Q0.id)?"text-[#f97316]":""}`,children:Q0.name},void 0,!1,void 0,this),Q0.project_id===null&&S.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),S.jsxDEV("div",{className:"text-xs text-[#666]",children:Z0},void 0,!1,void 0,this)]},void 0,!0,void 0,this),S.jsxDEV("div",{className:`text-xs px-2 py-0.5 rounded ${_0?"bg-green-500/20 text-green-400":"bg-[#222] text-[#666]"}`,children:U0?"remote":Q0.status},void 0,!1,void 0,this)]},Q0.id,!0,void 0,this)}),S.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),S.jsxDEV(n7,{label:"Skills",children:V.length===0?S.jsxDEV("p",{className:"text-sm text-[#666]",children:"No skills configured. Add skills in the Skills page first."},void 0,!1,void 0,this):S.jsxDEV("div",{className:"space-y-2",children:[V.filter((Q0)=>Q0.enabled&&(Q0.project_id===null||Q0.project_id===Y.projectId)).map((Q0)=>S.jsxDEV("button",{type:"button",onClick:()=>F0(Q0.id),className:`w-full flex items-center gap-3 p-3 rounded border text-left transition ${L.skills.includes(Q0.id)?"border-[#f97316] bg-[#f97316]/10":"border-[#222] hover:border-[#333]"}`,children:[S.jsxDEV("div",{className:"flex-1 min-w-0",children:[S.jsxDEV("div",{className:"flex items-center gap-2",children:[S.jsxDEV("span",{className:`text-sm font-medium ${L.skills.includes(Q0.id)?"text-[#f97316]":""}`,children:Q0.name},void 0,!1,void 0,this),Q0.project_id===null&&S.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),S.jsxDEV("div",{className:"text-xs text-[#666]",children:Q0.description},void 0,!1,void 0,this)]},void 0,!0,void 0,this),S.jsxDEV("div",{className:"text-xs px-2 py-0.5 rounded bg-[#222] text-[#666]",children:["v",Q0.version]},void 0,!0,void 0,this)]},Q0.id,!0,void 0,this)),S.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),b&&S.jsxDEV("div",{className:`text-sm px-3 py-2 rounded ${b.type==="success"?"bg-green-500/10 text-green-400":"bg-red-500/10 text-red-400"}`,children:b.text},void 0,!1,void 0,this),S.jsxDEV("button",{onClick:Q1,disabled:!O1||k||!L.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:k?"Saving...":"Save Changes"},void 0,!1,void 0,this),Y.status==="running"&&O1&&S.jsxDEV("p",{className:"text-xs text-[#666] text-center",children:"Changes will be applied to the running agent"},void 0,!1,void 0,this),R&&T&&S.jsxDEV("div",{className:"mt-8 pt-6 border-t border-[#222]",children:[S.jsxDEV("p",{className:"text-sm text-[#666] mb-3",children:"Developer Info"},void 0,!1,void 0,this),S.jsxDEV("div",{className:"space-y-2",children:[S.jsxDEV("div",{className:"flex items-center justify-between",children:[S.jsxDEV("span",{className:"text-xs text-[#666]",children:"Agent ID"},void 0,!1,void 0,this),S.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),S.jsxDEV("div",{className:"flex items-center justify-between",children:[S.jsxDEV("span",{className:"text-xs text-[#666]",children:"Port"},void 0,!1,void 0,this),S.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),S.jsxDEV("div",{className:"flex flex-col gap-1",children:[S.jsxDEV("div",{className:"flex items-center justify-between",children:[S.jsxDEV("span",{className:"text-xs text-[#666]",children:"API Key"},void 0,!1,void 0,this),S.jsxDEV("button",{onClick:()=>p(!n),className:"text-xs text-[#f97316] hover:text-[#fb923c]",children:n?"Hide":"Show"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),n&&S.jsxDEV("code",{className:"text-xs bg-[#1a1a1a] px-2 py-1 rounded text-[#888] break-all",children:T},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Y.status==="running"&&Y.port&&S.jsxDEV("div",{className:"flex flex-col gap-1 mt-2",children:[S.jsxDEV("span",{className:"text-xs text-[#666]",children:"Test with curl"},void 0,!1,void 0,this),S.jsxDEV("code",{className:"text-xs bg-[#1a1a1a] px-2 py-1.5 rounded text-[#666] break-all",children:['curl -H "X-API-Key: ',n?T:"***",'" 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),S.jsxDEV("div",{className:"mt-8 pt-6 border-t border-[#222]",children:[S.jsxDEV("p",{className:"text-sm text-[#666] mb-3",children:"Danger Zone"},void 0,!1,void 0,this),F?S.jsxDEV("div",{className:"flex gap-2",children:[S.jsxDEV("button",{onClick:()=>w(!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),S.jsxDEV("button",{onClick:W,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):S.jsxDEV("button",{onClick:()=>w(!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 n7({label:Y,children:G}){return S.jsxDEV("div",{children:[S.jsxDEV("label",{className:"block text-sm text-[#666] mb-1",children:Y},void 0,!1,void 0,this),G]},void 0,!0,void 0,this)}var GW=q0(I1(),1);var F4=q0(Z1(),1);function w3({agents:Y,loading:G,selectedAgent:U,providers:W,onSelectAgent:q,onCloseAgent:R,onToggleAgent:L,onDeleteAgent:_,onUpdateAgent:k,onNewAgent:I,canCreateAgent:F=!0}){let{currentProjectId:w,currentProject:b}=g4(),C=GW.useMemo(()=>{if(w===null)return Y;if(w==="unassigned")return Y.filter((E)=>!E.projectId);return Y.filter((E)=>E.projectId===w)},[Y,w]),f=w===null?"Agents":w==="unassigned"?"Unassigned Agents":b?.name||"Agents";return F4.jsxDEV("div",{className:"flex-1 flex overflow-hidden relative",children:[F4.jsxDEV("div",{className:"flex-1 overflow-auto p-6",children:[F4.jsxDEV("div",{className:"flex items-center justify-between mb-6",children:[F4.jsxDEV("div",{className:"flex items-center gap-3",children:[b&&F4.jsxDEV("span",{className:"w-3 h-3 rounded-full",style:{backgroundColor:b.color}},void 0,!1,void 0,this),F4.jsxDEV("h1",{className:"text-xl font-semibold",children:f},void 0,!1,void 0,this),w!==null&&F4.jsxDEV("span",{className:"text-sm text-[#666]",children:["(",C.length," agent",C.length!==1?"s":"",")"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),I&&F4.jsxDEV("button",{onClick:I,disabled:!F,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),G?F4.jsxDEV(wz,{message:"Loading agents..."},void 0,!1,void 0,this):C.length===0?F4.jsxDEV(jI,{onNewAgent:I,canCreateAgent:F,hasProjectFilter:w!==null},void 0,!1,void 0,this):F4.jsxDEV("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-3 auto-rows-fr",children:C.map((E)=>F4.jsxDEV(_3,{agent:E,selected:U?.id===E.id,onSelect:()=>q(E),onToggle:(V)=>L(E,V),showProject:w===null},E.id,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),U&&F4.jsxDEV("div",{className:"absolute inset-0 bg-black/40 backdrop-blur-[2px] z-10",onClick:R},void 0,!1,void 0,this),U&&F4.jsxDEV("div",{className:"absolute right-0 top-0 bottom-0 w-full sm:w-[500px] lg:w-[600px] xl:w-[700px] z-20",children:F4.jsxDEV(N3,{agent:U,providers:W,onClose:R,onStartAgent:(E)=>L(U,E),onUpdateAgent:(E)=>k(U.id,E),onDeleteAgent:()=>_(U.id)},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function jI({onNewAgent:Y,canCreateAgent:G,hasProjectFilter:U}){return F4.jsxDEV("div",{className:"text-center py-20 text-[#666]",children:[U?F4.jsxDEV(F4.Fragment,{children:[F4.jsxDEV("p",{className:"text-lg",children:"No agents in this project"},void 0,!1,void 0,this),F4.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):F4.jsxDEV(F4.Fragment,{children:[F4.jsxDEV("p",{className:"text-lg",children:"No agents yet"},void 0,!1,void 0,this),F4.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&&F4.jsxDEV("button",{onClick:Y,disabled:!G,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 b5=q0(I1(),1);var P1=q0(Z1(),1);function F3({agents:Y,loading:G,runningCount:U,configuredProviders:W,onNavigate:q,onSelectAgent:R}){let{authFetch:L}=k1(),{currentProjectId:_}=g4(),[k,I]=b5.useState(null),[F,w]=b5.useState([]),b=b5.useMemo(()=>{if(!_)return Y;if(_==="unassigned")return Y.filter((T)=>!T.projectId);return Y.filter((T)=>T.projectId===_)},[Y,_]),C=b5.useMemo(()=>{return b.filter((T)=>T.status==="running").length},[b]),f=b5.useMemo(()=>{return new Set(b.map((T)=>T.id))},[b]),E=b5.useCallback(async()=>{try{let[T,D]=await Promise.all([L("/api/dashboard"),L("/api/tasks?status=all")]);if(T.ok){let n=await T.json();I(n)}if(D.ok){let n=await D.json();w((n.tasks||[]).slice(0,5))}}catch(T){console.error("Failed to fetch dashboard data:",T)}},[L]);b5.useEffect(()=>{E();let T=setInterval(E,1e4);return()=>clearInterval(T)},[E]);let V=b5.useMemo(()=>{if(!_)return F;return F.filter((T)=>f.has(T.agentId))},[F,_,f]),v=b5.useMemo(()=>{if(!_)return k?.tasks||{total:0,pending:0,running:0,completed:0};let T=V.length,D=V.filter((r)=>r.status==="pending").length,n=V.filter((r)=>r.status==="running").length,p=V.filter((r)=>r.status==="completed").length;return{total:T,pending:D,running:n,completed:p}},[k,_,V]);return P1.jsxDEV("div",{className:"flex-1 overflow-auto p-6",children:[P1.jsxDEV("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-4 mb-6",children:[P1.jsxDEV(b3,{label:"Agents",value:b.length,subValue:`${C} running`},void 0,!1,void 0,this),P1.jsxDEV(b3,{label:"Tasks",value:v.total,subValue:`${v.pending} pending`},void 0,!1,void 0,this),P1.jsxDEV(b3,{label:"Completed",value:v.completed,color:"text-green-400"},void 0,!1,void 0,this),P1.jsxDEV(b3,{label:"Providers",value:W.length,color:"text-[#f97316]"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),P1.jsxDEV("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[P1.jsxDEV(qW,{title:"Agents",actionLabel:"View All",onAction:()=>q("agents"),children:G?P1.jsxDEV("div",{className:"p-4 text-center text-[#666]",children:"Loading..."},void 0,!1,void 0,this):b.length===0?P1.jsxDEV("div",{className:"p-4 text-center text-[#666]",children:"No agents yet"},void 0,!1,void 0,this):P1.jsxDEV("div",{className:"divide-y divide-[#1a1a1a]",children:b.slice(0,5).map((T)=>P1.jsxDEV(pI,{agent:T,onSelect:()=>R(T),showProject:!_},T.id,!1,void 0,this))},void 0,!1,void 0,this)},void 0,!1,void 0,this),P1.jsxDEV(qW,{title:"Recent Tasks",actionLabel:"View All",onAction:()=>q("tasks"),children:V.length===0?P1.jsxDEV("div",{className:"p-4 text-center text-[#666]",children:[P1.jsxDEV("p",{children:"No tasks yet"},void 0,!1,void 0,this),P1.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):P1.jsxDEV("div",{className:"divide-y divide-[#1a1a1a]",children:V.map((T)=>P1.jsxDEV("div",{className:"px-4 py-3 flex items-center justify-between",children:[P1.jsxDEV("div",{className:"flex-1 min-w-0",children:[P1.jsxDEV("p",{className:"font-medium truncate",children:T.title},void 0,!1,void 0,this),P1.jsxDEV("p",{className:"text-sm text-[#666]",children:T.agentName},void 0,!1,void 0,this)]},void 0,!0,void 0,this),P1.jsxDEV(dI,{status:T.status},void 0,!1,void 0,this)]},`${T.agentId}-${T.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 b3({label:Y,value:G,subValue:U,color:W}){return P1.jsxDEV("div",{className:"bg-[#111] rounded p-4 border border-[#1a1a1a]",children:[P1.jsxDEV("p",{className:"text-sm text-[#666] mb-1",children:Y},void 0,!1,void 0,this),P1.jsxDEV("p",{className:`text-2xl font-semibold ${W||""}`,children:G},void 0,!1,void 0,this),U&&P1.jsxDEV("p",{className:"text-xs text-[#555] mt-1",children:U},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function qW({title:Y,actionLabel:G,onAction:U,children:W}){return P1.jsxDEV("div",{className:"bg-[#111] rounded border border-[#1a1a1a] overflow-hidden",children:[P1.jsxDEV("div",{className:"px-4 py-3 border-b border-[#1a1a1a] flex items-center justify-between",children:[P1.jsxDEV("h3",{className:"font-semibold",children:Y},void 0,!1,void 0,this),P1.jsxDEV("button",{onClick:U,className:"text-sm text-[#3b82f6] hover:text-[#60a5fa]",children:G},void 0,!1,void 0,this)]},void 0,!0,void 0,this),W]},void 0,!0,void 0,this)}function pI({agent:Y,onSelect:G,showProject:U}){let{isActive:W}=SZ(Y.id),{projects:q}=g4(),R=Y.projectId?q.find((L)=>L.id===Y.projectId):null;return P1.jsxDEV("div",{onClick:G,className:"px-4 py-3 hover:bg-[#1a1a1a] cursor-pointer flex items-center justify-between",children:[P1.jsxDEV("div",{className:"flex-1 min-w-0",children:[P1.jsxDEV("p",{className:"font-medium",children:Y.name},void 0,!1,void 0,this),P1.jsxDEV("div",{className:"flex items-center gap-2 text-sm text-[#666]",children:[P1.jsxDEV("span",{children:Y.provider},void 0,!1,void 0,this),U&&R&&P1.jsxDEV(P1.Fragment,{children:[P1.jsxDEV("span",{className:"text-[#444]",children:"·"},void 0,!1,void 0,this),P1.jsxDEV("span",{className:"flex items-center gap-1",children:[P1.jsxDEV("span",{className:"w-2 h-2 rounded-full",style:{backgroundColor:R.color}},void 0,!1,void 0,this),R.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),P1.jsxDEV("span",{className:`w-2 h-2 rounded-full flex-shrink-0 ${Y.status==="running"?W?"bg-green-400 animate-pulse":"bg-[#3b82f6]":"bg-[#444]"}`},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function dI({status:Y}){let G={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 P1.jsxDEV("span",{className:`px-2 py-0.5 rounded text-xs font-medium ${G[Y]||G.pending}`,children:Y},void 0,!1,void 0,this)}var h8=q0(I1(),1);var K4=q0(Z1(),1);function M3({onSelectAgent:Y}){let{authFetch:G}=k1(),[U,W]=h8.useState([]),[q,R]=h8.useState(!0),[L,_]=h8.useState("all"),k=h8.useCallback(async()=>{try{let b=await(await G(`/api/tasks?status=${L}`)).json();W(b.tasks||[])}catch(w){console.error("Failed to fetch tasks:",w)}finally{R(!1)}},[G,L]);h8.useEffect(()=>{k();let w=setInterval(k,1e4);return()=>clearInterval(w)},[k]);let I={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 K4.jsxDEV("div",{className:"flex-1 p-4 md:p-6 overflow-auto",children:K4.jsxDEV("div",{className:"max-w-4xl",children:[K4.jsxDEV("div",{className:"mb-6",children:[K4.jsxDEV("div",{className:"mb-4",children:[K4.jsxDEV("h1",{className:"text-xl md:text-2xl font-semibold mb-1",children:"Tasks"},void 0,!1,void 0,this),K4.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),K4.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((w)=>K4.jsxDEV("button",{onClick:()=>_(w.value),className:`px-3 py-1.5 rounded text-sm transition whitespace-nowrap ${L===w.value?"bg-[#f97316] text-black":"bg-[#1a1a1a] hover:bg-[#222]"}`,children:w.label},w.value,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),q?K4.jsxDEV("div",{className:"text-center py-12 text-[#666]",children:"Loading tasks..."},void 0,!1,void 0,this):U.length===0?K4.jsxDEV("div",{className:"text-center py-12",children:[K4.jsxDEV(f5,{className:"w-12 h-12 mx-auto mb-4 text-[#333]"},void 0,!1,void 0,this),K4.jsxDEV("p",{className:"text-[#666]",children:"No tasks found"},void 0,!1,void 0,this),K4.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):K4.jsxDEV("div",{className:"space-y-3",children:U.map((w)=>K4.jsxDEV("div",{className:"bg-[#111] border border-[#1a1a1a] rounded-lg p-4 hover:border-[#333] transition",children:[K4.jsxDEV("div",{className:"flex items-start justify-between mb-2",children:[K4.jsxDEV("div",{className:"flex-1",children:[K4.jsxDEV("h3",{className:"font-medium",children:w.title},void 0,!1,void 0,this),K4.jsxDEV("p",{className:"text-sm text-[#666]",children:[w.agentName,w.execute_at&&K4.jsxDEV("span",{className:"ml-2",children:["· Scheduled: ",new Date(w.execute_at).toLocaleString()]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),K4.jsxDEV("span",{className:`px-2 py-1 rounded text-xs font-medium ${I[w.status]||I.pending}`,children:w.status},void 0,!1,void 0,this)]},void 0,!0,void 0,this),w.description&&K4.jsxDEV("p",{className:"text-sm text-[#888] mb-2 line-clamp-2",children:w.description},void 0,!1,void 0,this),K4.jsxDEV("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1 text-xs text-[#555]",children:[K4.jsxDEV("span",{children:["Type: ",w.type]},void 0,!0,void 0,this),K4.jsxDEV("span",{children:["Priority: ",w.priority]},void 0,!0,void 0,this),w.recurrence&&K4.jsxDEV("span",{children:["Recurrence: ",w.recurrence]},void 0,!0,void 0,this),K4.jsxDEV("span",{children:["Created: ",new Date(w.created_at).toLocaleString()]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},`${w.agentId}-${w.id}`,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}var z1=q0(I1(),1);var i4=q0(I1(),1);var w0=q0(Z1(),1);function Q2(Y){return Y.authSchemes.some((G)=>G.toUpperCase()==="API_KEY")}function UW(Y){return Y.authSchemes.some((G)=>G.toUpperCase()==="OAUTH2")}function cI(Y){return Q2(Y)&&UW(Y)}function KW({providerId:Y="composio",onConnectionComplete:G}){let{authFetch:U}=k1(),[W,q]=i4.useState([]),[R,L]=i4.useState([]),[_,k]=i4.useState(!0),[I,F]=i4.useState(""),[w,b]=i4.useState(null),[C,f]=i4.useState(null),[E,V]=i4.useState(null),[v,T]=i4.useState(null),[D,n]=i4.useState(null),[p,r]=i4.useState(""),[J0,i]=i4.useState(null),[t,l]=i4.useState(""),[j,c]=i4.useState(!1),[X0,I0]=i4.useState(null),[F0,Q1]=i4.useState(null),O1=i4.useCallback(async()=>{k(!0),V(null);try{let[L0,a0]=await Promise.all([U(`/api/integrations/${Y}/apps`),U(`/api/integrations/${Y}/connected`)]),f1=await L0.json(),q4=await a0.json();q(f1.apps||[]),L(q4.accounts||[])}catch(L0){console.error("Failed to fetch integrations:",L0),V("Failed to load integrations")}k(!1)},[U,Y]);i4.useEffect(()=>{O1()},[O1]),i4.useEffect(()=>{if(new URLSearchParams(window.location.search).get("connected"))window.history.replaceState({},"",window.location.pathname),O1(),G?.()},[O1,G]),i4.useEffect(()=>{if(!C?.connectionId)return;let L0=setInterval(async()=>{try{let f1=await(await U(`/api/integrations/${Y}/connection/${C.connectionId}`)).json();if(f1.connection?.status==="active")f(null),b(null),O1(),G?.();else if(f1.connection?.status==="failed")f(null),b(null),V(`Connection to ${C.appSlug} failed`)}catch(a0){}},2000);return()=>clearInterval(L0)},[C,U,Y,O1,G]);let Q0=async(L0,a0,f1)=>{if(cI(L0)&&!a0&&!f1){T({app:L0});return}if(Q2(L0)&&!a0&&!f1){n({app:L0}),r("");return}b(L0.slug),V(null);try{let q4={appSlug:L0.slug};if(a0)q4.credentials={authScheme:"API_KEY",apiKey:a0};let h4=await U(`/api/integrations/${Y}/connect`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(q4)}),g1=await h4.json();if(!h4.ok){V(g1.error||"Failed to initiate connection"),b(null),n(null);return}if(g1.status==="active"||!g1.redirectUrl){b(null),n(null),O1(),G?.();return}if(g1.redirectUrl){f({appSlug:L0.slug,connectionId:g1.connectionId});let K1=window.open(g1.redirectUrl,`connect-${L0.slug}`,"width=600,height=700,left=200,top=100");if(!K1||K1.closed)window.location.href=g1.redirectUrl}}catch(q4){V(`Failed to connect: ${q4}`),b(null),n(null)}},U0=(L0)=>{if(L0.preventDefault(),!D||!p.trim())return;Q0(D.app,p.trim())},_0=async(L0)=>{try{let a0=await U(`/api/integrations/${Y}/connection/${L0.id}`,{method:"DELETE"});if(a0.ok)O1();else{let f1=await a0.json();V(f1.error||"Failed to disconnect")}}catch(a0){V(`Failed to disconnect: ${a0}`)}},Z0=(L0)=>{i({app:L0}),l(`${L0.name} MCP`),I0(null)},d=async()=>{if(!J0||!t.trim())return;c(!0),V(null);try{let L0=await U(`/api/integrations/${Y}/configs`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:t.replace(/[^a-zA-Z0-9\s-]/g,"").substring(0,30),toolkitSlug:J0.app.slug})}),a0=await L0.json();if(!L0.ok){V(a0.error||"Failed to create MCP config"),c(!1);return}I0(t),G?.()}catch(L0){V(`Failed to create MCP config: ${L0}`)}finally{c(!1)}},P0=(L0)=>{Q1({message:`Disconnect ${L0.appName}?`,onConfirm:()=>{_0(L0),Q1(null)}})},v0=(L0)=>{return R.some((a0)=>a0.appId===L0&&a0.status==="active")},X1=(L0)=>{return R.find((a0)=>a0.appId===L0)},r0=W.filter((L0)=>{if(!I)return!0;let a0=I.toLowerCase();return L0.name.toLowerCase().includes(a0)||L0.slug.toLowerCase().includes(a0)||L0.description?.toLowerCase().includes(a0)||L0.categories.some((f1)=>f1.toLowerCase().includes(a0))}),V0=r0.filter((L0)=>v0(L0.slug)),$1=r0.filter((L0)=>!v0(L0.slug));if(_)return w0.jsxDEV("div",{className:"text-center py-8 text-[#666]",children:"Loading apps..."},void 0,!1,void 0,this);return w0.jsxDEV("div",{className:"space-y-6",children:[v&&w0.jsxDEV("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:w0.jsxDEV("div",{className:"bg-[#111] border border-[#333] rounded-lg p-6 w-full max-w-md mx-4",children:[w0.jsxDEV("div",{className:"flex items-center gap-3 mb-4",children:[v.app.logo&&w0.jsxDEV("img",{src:v.app.logo,alt:v.app.name,className:"w-10 h-10 object-contain"},void 0,!1,void 0,this),w0.jsxDEV("div",{children:[w0.jsxDEV("h3",{className:"font-medium",children:["Connect ",v.app.name]},void 0,!0,void 0,this),w0.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),w0.jsxDEV("div",{className:"space-y-3",children:[w0.jsxDEV("button",{onClick:()=>{T(null),n({app:v.app}),r("")},className:"w-full text-left p-3 bg-[#0a0a0a] hover:bg-[#1a1a1a] border border-[#333] hover:border-[#f97316] rounded-lg transition",children:[w0.jsxDEV("div",{className:"font-medium text-sm",children:"API Key"},void 0,!1,void 0,this),w0.jsxDEV("div",{className:"text-xs text-[#666] mt-0.5",children:["Enter your ",v.app.name," API key directly"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),w0.jsxDEV("button",{onClick:()=>{T(null),Q0(v.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:[w0.jsxDEV("div",{className:"font-medium text-sm",children:"OAuth"},void 0,!1,void 0,this),w0.jsxDEV("div",{className:"text-xs text-[#666] mt-0.5",children:["Sign in with your ",v.app.name," account"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),w0.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),D&&w0.jsxDEV("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:w0.jsxDEV("div",{className:"bg-[#111] border border-[#333] rounded-lg p-6 w-full max-w-md mx-4",children:[w0.jsxDEV("div",{className:"flex items-center gap-3 mb-4",children:[D.app.logo&&w0.jsxDEV("img",{src:D.app.logo,alt:D.app.name,className:"w-10 h-10 object-contain"},void 0,!1,void 0,this),w0.jsxDEV("div",{children:[w0.jsxDEV("h3",{className:"font-medium",children:["Connect ",D.app.name]},void 0,!0,void 0,this),w0.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),w0.jsxDEV("form",{onSubmit:U0,children:[w0.jsxDEV("input",{type:"password",value:p,onChange:(L0)=>r(L0.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),w0.jsxDEV("div",{className:"flex gap-2",children:[w0.jsxDEV("button",{type:"button",onClick:()=>n(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),w0.jsxDEV("button",{type:"submit",disabled:!p.trim()||w===D.app.slug,className:"flex-1 text-sm bg-[#f97316] hover:bg-[#ea580c] text-white px-4 py-2 rounded transition disabled:opacity-50",children:w===D.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),J0&&w0.jsxDEV("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:w0.jsxDEV("div",{className:"bg-[#111] border border-[#333] rounded-lg p-6 w-full max-w-md mx-4",children:X0?w0.jsxDEV(w0.Fragment,{children:[w0.jsxDEV("div",{className:"text-center mb-4",children:[w0.jsxDEV("div",{className:"w-12 h-12 bg-green-500/20 rounded-full flex items-center justify-center mx-auto mb-3",children:w0.jsxDEV("span",{className:"text-green-400 text-2xl",children:"✓"},void 0,!1,void 0,this)},void 0,!1,void 0,this),w0.jsxDEV("h3",{className:"font-medium text-lg",children:"MCP Config Created!"},void 0,!1,void 0,this),w0.jsxDEV("p",{className:"text-sm text-[#888] mt-2",children:['"',X0,'" has been created successfully.']},void 0,!0,void 0,this),w0.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),w0.jsxDEV("button",{onClick:()=>{i(null),I0(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):w0.jsxDEV(w0.Fragment,{children:[w0.jsxDEV("div",{className:"flex items-center gap-3 mb-4",children:[J0.app.logo&&w0.jsxDEV("img",{src:J0.app.logo,alt:J0.app.name,className:"w-10 h-10 object-contain"},void 0,!1,void 0,this),w0.jsxDEV("div",{children:[w0.jsxDEV("h3",{className:"font-medium",children:"Create MCP Config"},void 0,!1,void 0,this),w0.jsxDEV("p",{className:"text-xs text-[#666]",children:["Create an MCP config for ",J0.app.name]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),w0.jsxDEV("form",{onSubmit:(L0)=>{L0.preventDefault(),d()},children:[w0.jsxDEV("label",{className:"block text-xs text-[#888] mb-1",children:"Config Name"},void 0,!1,void 0,this),w0.jsxDEV("input",{type:"text",value:t,onChange:(L0)=>l(L0.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),w0.jsxDEV("div",{className:"flex gap-2",children:[w0.jsxDEV("button",{type:"button",onClick:()=>i(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),w0.jsxDEV("button",{type:"submit",disabled:!t.trim()||j,className:"flex-1 text-sm bg-[#f97316] hover:bg-[#ea580c] text-white px-4 py-2 rounded transition disabled:opacity-50",children:j?"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&&w0.jsxDEV("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:w0.jsxDEV("div",{className:"bg-[#111] border border-[#333] rounded-lg p-6 w-full max-w-sm mx-4",children:[w0.jsxDEV("p",{className:"text-center mb-4",children:F0.message},void 0,!1,void 0,this),w0.jsxDEV("div",{className:"flex gap-2",children:[w0.jsxDEV("button",{onClick:()=>Q1(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),w0.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),E&&w0.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:[w0.jsxDEV("span",{children:E},void 0,!1,void 0,this),w0.jsxDEV("button",{onClick:()=>V(null),className:"text-red-400 hover:text-red-300",children:"×"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),C&&w0.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:[w0.jsxDEV("span",{className:"animate-spin",children:"⟳"},void 0,!1,void 0,this),w0.jsxDEV("span",{children:["Waiting for ",C.appSlug," authorization..."]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),w0.jsxDEV("div",{children:w0.jsxDEV("input",{type:"text",value:I,onChange:(L0)=>F(L0.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),V0.length>0&&w0.jsxDEV("div",{children:[w0.jsxDEV("h3",{className:"text-sm font-medium text-[#888] mb-3",children:["Connected (",V0.length,")"]},void 0,!0,void 0,this),w0.jsxDEV("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:V0.map((L0)=>w0.jsxDEV(BW,{app:L0,connection:X1(L0.slug),onConnect:()=>Q0(L0),onDisconnect:()=>{let a0=X1(L0.slug);if(a0)P0(a0)},onCreateMcpConfig:()=>Z0(L0),connecting:w===L0.slug},L0.id,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),w0.jsxDEV("div",{children:[w0.jsxDEV("h3",{className:"text-sm font-medium text-[#888] mb-3",children:["Available Apps (",$1.length,")"]},void 0,!0,void 0,this),$1.length===0?w0.jsxDEV("p",{className:"text-[#666] text-sm",children:I?"No apps match your search":"No apps available"},void 0,!1,void 0,this):w0.jsxDEV("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:$1.slice(0,50).map((L0)=>w0.jsxDEV(BW,{app:L0,onConnect:()=>Q0(L0),connecting:w===L0.slug},L0.id,!1,void 0,this))},void 0,!1,void 0,this),$1.length>50&&w0.jsxDEV("p",{className:"text-xs text-[#555] mt-3 text-center",children:["Showing first 50 of ",$1.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 BW({app:Y,connection:G,onConnect:U,onDisconnect:W,onCreateMcpConfig:q,connecting:R}){let L=G?.status==="active",_=Q2(Y),k=UW(Y),I=_&&k;return w0.jsxDEV("div",{className:`bg-[#111] border rounded-lg p-3 transition ${L?"border-green-500/30":"border-[#1a1a1a] hover:border-[#333]"}`,children:[w0.jsxDEV("div",{className:"flex items-start gap-3",children:[w0.jsxDEV("div",{className:"w-10 h-10 rounded bg-[#1a1a1a] flex items-center justify-center flex-shrink-0 overflow-hidden",children:Y.logo?w0.jsxDEV("img",{src:Y.logo,alt:Y.name,className:"w-8 h-8 object-contain",onError:(F)=>{F.target.style.display="none"}},void 0,!1,void 0,this):w0.jsxDEV("span",{className:"text-lg",children:Y.name[0]?.toUpperCase()},void 0,!1,void 0,this)},void 0,!1,void 0,this),w0.jsxDEV("div",{className:"flex-1 min-w-0",children:[w0.jsxDEV("div",{className:"flex items-center gap-2",children:[w0.jsxDEV("h4",{className:"font-medium text-sm truncate",children:Y.name},void 0,!1,void 0,this),L&&w0.jsxDEV("span",{className:"text-xs text-green-400",children:"✓"},void 0,!1,void 0,this),!L&&_&&!k&&w0.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),!L&&I&&w0.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&&w0.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&&w0.jsxDEV("div",{className:"flex flex-wrap gap-1 mt-1",children:Y.categories.slice(0,2).map((F)=>w0.jsxDEV("span",{className:"text-[10px] bg-[#1a1a1a] text-[#555] px-1.5 py-0.5 rounded",children:F},F,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),w0.jsxDEV("div",{className:"mt-3 flex gap-2",children:L?w0.jsxDEV(w0.Fragment,{children:[q&&w0.jsxDEV("button",{onClick:q,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),W&&w0.jsxDEV("button",{onClick:W,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):w0.jsxDEV("button",{onClick:U,disabled:R,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:R?"Connecting...":_&&!k?"Enter API Key":"Connect"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}var M=q0(Z1(),1);function P3(){let{authFetch:Y}=k1(),{projects:G,currentProjectId:U}=g4(),[W,q]=z1.useState([]),[R,L]=z1.useState(!0),[_,k]=z1.useState(!1),[I,F]=z1.useState(null),[w,b]=z1.useState(null),[C,f]=z1.useState("servers"),{confirm:E,ConfirmDialog:V}=S5(),v=G.length>0,T=async()=>{try{let l=await(await Y("/api/mcp/servers")).json();q(l.servers||[])}catch(t){console.error("Failed to fetch MCP servers:",t)}L(!1)};z1.useEffect(()=>{T()},[Y]);let D=W.filter((t)=>{if(!U)return!0;if(U==="unassigned")return t.project_id===null;return t.project_id===null||t.project_id===U}),n=async(t)=>{try{await Y(`/api/mcp/servers/${t}/start`,{method:"POST"}),T()}catch(l){console.error("Failed to start server:",l)}},p=async(t)=>{try{await Y(`/api/mcp/servers/${t}/stop`,{method:"POST"}),T()}catch(l){console.error("Failed to stop server:",l)}},r=async(t)=>{if(!await E("Delete this MCP server?",{confirmText:"Delete",title:"Delete Server"}))return;try{if(await Y(`/api/mcp/servers/${t}`,{method:"DELETE"}),w?.id===t)b(null);T()}catch(j){console.error("Failed to delete server:",j)}},J0=async(t,l)=>{try{await Y(`/api/mcp/servers/${t}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:l})}),T()}catch(j){console.error("Failed to rename server:",j)}},i=async(t,l)=>{try{await Y(`/api/mcp/servers/${t}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)}),T()}catch(j){throw console.error("Failed to update server:",j),j}};return M.jsxDEV(M.Fragment,{children:[V,M.jsxDEV("div",{className:"flex-1 overflow-auto p-6",children:[M.jsxDEV("div",{className:"max-w-6xl",children:[M.jsxDEV("div",{className:"flex items-center justify-between mb-6",children:[M.jsxDEV("div",{children:[M.jsxDEV("h1",{className:"text-2xl font-semibold mb-1",children:"MCP Servers"},void 0,!1,void 0,this),M.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),C==="servers"&&M.jsxDEV("button",{onClick:()=>k(!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),M.jsxDEV("div",{className:"flex gap-1 mb-6 bg-[#111] border border-[#1a1a1a] rounded-lg p-1 w-fit",children:[M.jsxDEV("button",{onClick:()=>f("servers"),className:`px-4 py-2 rounded text-sm font-medium transition ${C==="servers"?"bg-[#1a1a1a] text-white":"text-[#666] hover:text-[#888]"}`,children:"My Servers"},void 0,!1,void 0,this),M.jsxDEV("button",{onClick:()=>f("hosted"),className:`px-4 py-2 rounded text-sm font-medium transition ${C==="hosted"?"bg-[#1a1a1a] text-white":"text-[#666] hover:text-[#888]"}`,children:"Hosted Services"},void 0,!1,void 0,this),M.jsxDEV("button",{onClick:()=>f("registry"),className:`px-4 py-2 rounded text-sm font-medium transition ${C==="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),C==="servers"&&M.jsxDEV(M.Fragment,{children:[R&&M.jsxDEV("div",{className:"text-center py-8 text-[#666]",children:"Loading..."},void 0,!1,void 0,this),!R&&D.length===0&&W.length===0&&M.jsxDEV("div",{className:"bg-[#111] border border-[#1a1a1a] rounded-lg p-8 text-center",children:[M.jsxDEV(h5,{className:"w-12 h-12 text-[#333] mx-auto mb-4"},void 0,!1,void 0,this),M.jsxDEV("h3",{className:"text-lg font-medium mb-2",children:"No MCP servers configured"},void 0,!1,void 0,this),M.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),M.jsxDEV("div",{className:"flex gap-3 justify-center",children:[M.jsxDEV("button",{onClick:()=>k(!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),M.jsxDEV("button",{onClick:()=>f("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),!R&&D.length===0&&W.length>0&&M.jsxDEV("div",{className:"bg-[#111] border border-[#1a1a1a] rounded-lg p-6 text-center",children:M.jsxDEV("p",{className:"text-[#666]",children:"No servers match this filter."},void 0,!1,void 0,this)},void 0,!1,void 0,this),!R&&D.length>0&&M.jsxDEV("div",{className:"flex gap-6",children:[M.jsxDEV("div",{className:`space-y-3 ${w?"w-1/2":"w-full"}`,children:D.map((t)=>{let j=t.type==="http"&&t.url||t.status==="running",c=v&&t.project_id?G.find((X0)=>X0.id===t.project_id):null;return M.jsxDEV(lI,{server:t,project:c,selected:w?.id===t.id,onSelect:()=>b(j?t:null),onStart:()=>n(t.id),onStop:()=>p(t.id),onDelete:()=>r(t.id),onEdit:()=>F(t)},t.id,!1,void 0,this)})},void 0,!1,void 0,this),w&&M.jsxDEV("div",{className:"w-1/2",children:M.jsxDEV(iI,{server:w,onClose:()=>b(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),C==="hosted"&&M.jsxDEV(nI,{onServerAdded:T},void 0,!1,void 0,this),C==="registry"&&M.jsxDEV(aI,{onInstall:(t)=>{T(),f("servers")}},void 0,!1,void 0,this),C==="servers"&&M.jsxDEV("div",{className:"mt-8 p-4 bg-[#111] border border-[#1a1a1a] rounded-lg",children:[M.jsxDEV("h3",{className:"font-medium mb-2",children:"Quick Start"},void 0,!1,void 0,this),M.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),M.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((t)=>M.jsxDEV("code",{className:"text-xs bg-[#0a0a0a] px-2 py-1 rounded",children:t.pkg},t.name,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),_&&M.jsxDEV(tI,{onClose:()=>k(!1),onAdded:()=>{k(!1),T()},projects:v?G:void 0,defaultProjectId:U&&U!=="unassigned"?U:null},void 0,!1,void 0,this),I&&M.jsxDEV(sI,{server:I,projects:v?G:void 0,onClose:()=>F(null),onSaved:()=>{F(null),T()}},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function lI({server:Y,project:G,selected:U,onSelect:W,onStart:q,onStop:R,onDelete:L,onEdit:_}){let k=Y.type==="http"&&Y.url,I=k||Y.status==="running",F=()=>{if(k)return`${Y.source||"remote"} • http`;return`${Y.type} • ${Y.package||Y.command||"custom"}${Y.status==="running"&&Y.port?` • :${Y.port}`:""}`},w=()=>{if(G)return M.jsxDEV("span",{className:"text-xs px-1.5 py-0.5 rounded",style:{backgroundColor:`${G.color}20`,color:G.color},children:G.name},void 0,!1,void 0,this);if(Y.project_id===null)return M.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 M.jsxDEV("div",{className:`bg-[#111] border rounded-lg p-4 cursor-pointer transition ${U?"border-[#f97316]":"border-[#1a1a1a] hover:border-[#333]"}`,onClick:I?W:void 0,children:M.jsxDEV("div",{className:"flex items-center justify-between",children:[M.jsxDEV("div",{className:"flex items-center gap-3",children:[M.jsxDEV("div",{className:`w-2 h-2 rounded-full ${I?"bg-green-400":"bg-[#444]"}`},void 0,!1,void 0,this),M.jsxDEV("div",{children:[M.jsxDEV("div",{className:"flex items-center gap-2",children:[M.jsxDEV("h3",{className:"font-medium",children:Y.name},void 0,!1,void 0,this),w()]},void 0,!0,void 0,this),M.jsxDEV("p",{className:"text-sm text-[#666]",children:F()},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),M.jsxDEV("div",{className:"flex items-center gap-2",children:[M.jsxDEV("button",{onClick:(b)=>{b.stopPropagation(),_()},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),k?M.jsxDEV("button",{onClick:(b)=>{b.stopPropagation(),L()},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"?M.jsxDEV(M.Fragment,{children:[M.jsxDEV("button",{onClick:(b)=>{b.stopPropagation(),W()},className:"text-sm text-[#f97316] hover:text-[#fb923c] px-3 py-1 transition",children:"Tools"},void 0,!1,void 0,this),M.jsxDEV("button",{onClick:(b)=>{b.stopPropagation(),R()},className:"text-sm text-[#666] hover:text-red-400 px-3 py-1 transition",children:"Stop"},void 0,!1,void 0,this),M.jsxDEV("button",{onClick:(b)=>{b.stopPropagation(),L()},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):M.jsxDEV(M.Fragment,{children:[M.jsxDEV("button",{onClick:(b)=>{b.stopPropagation(),q()},className:"text-sm text-[#666] hover:text-green-400 px-3 py-1 transition",children:"Start"},void 0,!1,void 0,this),M.jsxDEV("button",{onClick:(b)=>{b.stopPropagation(),L()},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 iI({server:Y,onClose:G}){let{authFetch:U}=k1(),[W,q]=z1.useState([]),[R,L]=z1.useState(null),[_,k]=z1.useState(!0),[I,F]=z1.useState(null),[w,b]=z1.useState(null);return z1.useEffect(()=>{(async()=>{k(!0),F(null);try{let f=await U(`/api/mcp/servers/${Y.id}/tools`),E=await f.json();if(!f.ok){F(E.error||"Failed to fetch tools");return}q(E.tools||[]),L(E.serverInfo||null)}catch(f){F(`Failed to fetch tools: ${f}`)}finally{k(!1)}})()},[Y.id,U]),M.jsxDEV("div",{className:"bg-[#111] border border-[#1a1a1a] rounded-lg overflow-hidden",children:[M.jsxDEV("div",{className:"p-4 border-b border-[#1a1a1a] flex items-center justify-between",children:[M.jsxDEV("div",{children:[M.jsxDEV("h3",{className:"font-medium",children:[Y.name," Tools"]},void 0,!0,void 0,this),R&&M.jsxDEV("p",{className:"text-xs text-[#666]",children:[R.name," v",R.version]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),M.jsxDEV("button",{onClick:G,className:"text-[#666] hover:text-[#888] text-xl leading-none",children:"×"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),M.jsxDEV("div",{className:"p-4 max-h-[500px] overflow-auto",children:[_&&M.jsxDEV("p",{className:"text-[#666]",children:"Loading tools..."},void 0,!1,void 0,this),I&&M.jsxDEV("div",{className:"text-red-400 text-sm p-3 bg-red-500/10 rounded",children:I},void 0,!1,void 0,this),!_&&!I&&W.length===0&&M.jsxDEV("p",{className:"text-[#666]",children:"No tools available from this server."},void 0,!1,void 0,this),!_&&!I&&W.length>0&&!w&&M.jsxDEV("div",{className:"space-y-2",children:W.map((C)=>M.jsxDEV("button",{onClick:()=>b(C),className:"w-full text-left p-3 bg-[#0a0a0a] hover:bg-[#1a1a1a] border border-[#222] hover:border-[#333] rounded transition",children:[M.jsxDEV("div",{className:"font-medium text-sm",children:C.name},void 0,!1,void 0,this),C.description&&M.jsxDEV("div",{className:"text-xs text-[#666] mt-1",children:C.description},void 0,!1,void 0,this)]},C.name,!0,void 0,this))},void 0,!1,void 0,this),w&&M.jsxDEV(oI,{serverId:Y.id,tool:w,onBack:()=>b(null)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function oI({serverId:Y,tool:G,onBack:U}){let{authFetch:W}=k1(),[q,R]=z1.useState("{}"),[L,_]=z1.useState(null),[k,I]=z1.useState(null),[F,w]=z1.useState(!1);z1.useEffect(()=>{let C=G.inputSchema;if(C&&typeof C==="object"&&"properties"in C){let f=C.properties,E={};for(let[V,v]of Object.entries(f))if(v.default!==void 0)E[V]=v.default;else if(v.type==="string")E[V]="";else if(v.type==="number"||v.type==="integer")E[V]=0;else if(v.type==="boolean")E[V]=!1;else if(v.type==="array")E[V]=[];else if(v.type==="object")E[V]={};R(JSON.stringify(E,null,2))}},[G]);let b=async()=>{w(!0),I(null),_(null);try{let C=JSON.parse(q),f=await W(`/api/mcp/servers/${Y}/tools/${encodeURIComponent(G.name)}/call`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({arguments:C})}),E=await f.json();if(!f.ok){I(E.error||"Failed to call tool");return}_(E.result)}catch(C){I(`Error: ${C}`)}finally{w(!1)}};return M.jsxDEV("div",{className:"space-y-4",children:[M.jsxDEV("div",{className:"flex items-center gap-2",children:[M.jsxDEV("button",{onClick:U,className:"text-[#666] hover:text-[#888] text-sm",children:"← Back"},void 0,!1,void 0,this),M.jsxDEV("span",{className:"text-[#444]",children:"/"},void 0,!1,void 0,this),M.jsxDEV("span",{className:"font-medium",children:G.name},void 0,!1,void 0,this)]},void 0,!0,void 0,this),G.description&&M.jsxDEV("p",{className:"text-sm text-[#666]",children:G.description},void 0,!1,void 0,this),G.inputSchema&&M.jsxDEV("div",{className:"text-xs",children:M.jsxDEV("details",{className:"cursor-pointer",children:[M.jsxDEV("summary",{className:"text-[#666] hover:text-[#888]",children:"Input Schema"},void 0,!1,void 0,this),M.jsxDEV("pre",{className:"mt-2 p-2 bg-[#0a0a0a] rounded text-[#888] overflow-auto max-h-32",children:JSON.stringify(G.inputSchema,null,2)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),M.jsxDEV("div",{children:[M.jsxDEV("label",{className:"block text-sm text-[#666] mb-1",children:"Arguments (JSON)"},void 0,!1,void 0,this),M.jsxDEV("textarea",{value:q,onChange:(C)=>R(C.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),M.jsxDEV("button",{onClick:b,disabled:F,className:"w-full bg-[#f97316] hover:bg-[#fb923c] disabled:opacity-50 text-black px-4 py-2 rounded font-medium transition",children:F?"Calling...":"Call Tool"},void 0,!1,void 0,this),k&&M.jsxDEV("div",{className:"text-red-400 text-sm p-3 bg-red-500/10 rounded",children:k},void 0,!1,void 0,this),L&&M.jsxDEV("div",{className:"space-y-2",children:[M.jsxDEV("div",{className:"text-sm text-[#666]",children:["Result ",L.isError&&M.jsxDEV("span",{className:"text-red-400",children:"(error)"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),M.jsxDEV("div",{className:`p-3 rounded text-sm ${L.isError?"bg-red-500/10":"bg-green-500/10"}`,children:L.content.map((C,f)=>M.jsxDEV("div",{className:"mb-2 last:mb-0",children:[C.type==="text"&&M.jsxDEV("pre",{className:"whitespace-pre-wrap font-mono text-xs",children:C.text},void 0,!1,void 0,this),C.type==="image"&&C.data&&M.jsxDEV("img",{src:`data:${C.mimeType||"image/png"};base64,${C.data}`,alt:"Tool result",className:"max-w-full rounded"},void 0,!1,void 0,this)]},f,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function aI({onInstall:Y}){let{authFetch:G}=k1(),[U,W]=z1.useState(""),[q,R]=z1.useState([]),[L,_]=z1.useState(!1),[k,I]=z1.useState(!1),[F,w]=z1.useState(null),[b,C]=z1.useState(null),f=async(v)=>{_(!0),C(null);try{let T=await G(`/api/mcp/registry?search=${encodeURIComponent(v)}&limit=20`),D=await T.json();if(!T.ok)C(D.error||"Failed to search registry"),R([]);else R(D.servers||[])}catch(T){C(`Failed to search: ${T}`),R([])}finally{_(!1),I(!0)}},E=(v)=>{if(v.preventDefault(),U.trim())f(U.trim())};z1.useEffect(()=>{f("")},[]);let V=async(v)=>{if(!v.npmPackage){C("This server does not have an npm package");return}w(v.id),C(null);try{let T=await G("/api/mcp/servers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:v.name,type:"npm",package:v.npmPackage})});if(!T.ok){let D=await T.json();C(D.error||"Failed to add server");return}Y(v)}catch(T){C(`Failed to add server: ${T}`)}finally{w(null)}};return M.jsxDEV("div",{className:"space-y-6",children:[M.jsxDEV("form",{onSubmit:E,className:"flex gap-2",children:[M.jsxDEV("input",{type:"text",value:U,onChange:(v)=>W(v.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),M.jsxDEV("button",{type:"submit",disabled:L,className:"bg-[#f97316] hover:bg-[#fb923c] disabled:opacity-50 text-black px-6 py-3 rounded-lg font-medium transition",children:L?"...":"Search"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),b&&M.jsxDEV("div",{className:"text-red-400 text-sm p-3 bg-red-500/10 border border-red-500/20 rounded-lg",children:b},void 0,!1,void 0,this),!L&&k&&q.length===0&&M.jsxDEV("div",{className:"text-center py-8 text-[#666]",children:"No servers found. Try a different search term."},void 0,!1,void 0,this),q.length>0&&M.jsxDEV("div",{className:"grid gap-4 md:grid-cols-2",children:q.map((v)=>M.jsxDEV("div",{className:"bg-[#111] border border-[#1a1a1a] rounded-lg p-4 hover:border-[#333] transition",children:M.jsxDEV("div",{className:"flex items-start justify-between gap-3",children:[M.jsxDEV("div",{className:"flex-1 min-w-0",children:[M.jsxDEV("h3",{className:"font-medium truncate",children:v.name},void 0,!1,void 0,this),M.jsxDEV("p",{className:"text-sm text-[#666] mt-1 line-clamp-2",children:v.description||"No description"},void 0,!1,void 0,this),M.jsxDEV("div",{className:"flex items-center gap-2 mt-2 text-xs text-[#555]",children:[v.version&&M.jsxDEV("span",{children:["v",v.version]},void 0,!0,void 0,this),M.jsxDEV("span",{className:`px-1.5 py-0.5 rounded ${v.npmPackage?"bg-green-500/10 text-green-400":"bg-blue-500/10 text-blue-400"}`,children:v.npmPackage?"npm":"remote"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),M.jsxDEV("code",{className:"text-xs text-[#555] bg-[#0a0a0a] px-2 py-0.5 rounded mt-2 inline-block truncate max-w-full",children:v.npmPackage||v.fullName},void 0,!1,void 0,this)]},void 0,!0,void 0,this),M.jsxDEV("div",{className:"flex-shrink-0",children:v.npmPackage?M.jsxDEV("button",{onClick:()=>V(v),disabled:F===v.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:F===v.id?"Adding...":"Add"},void 0,!1,void 0,this):v.repository?M.jsxDEV("a",{href:v.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)},v.id,!1,void 0,this))},void 0,!1,void 0,this),L&&M.jsxDEV("div",{className:"text-center py-8 text-[#666]",children:"Searching registry..."},void 0,!1,void 0,this),M.jsxDEV("div",{className:"p-4 bg-[#111] border border-[#1a1a1a] rounded-lg text-sm text-[#666]",children:M.jsxDEV("p",{children:["Servers are sourced from the"," ",M.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 nI({onServerAdded:Y}){let{authFetch:G}=k1(),[U,W]=z1.useState("configs"),[q,R]=z1.useState(!1),[L,_]=z1.useState(!1),[k,I]=z1.useState(!1),[F,w]=z1.useState([]),[b,C]=z1.useState(new Set),[f,E]=z1.useState(!0),[V,v]=z1.useState(!1),[T,D]=z1.useState(null),{alert:n,AlertDialog:p}=Z3(),r=async()=>{try{let[j,c]=await Promise.all([G("/api/providers"),G("/api/mcp/servers")]),X0=await j.json(),I0=await c.json(),F0=X0.providers||[],Q1=I0.servers||[],O1=new Set(Q1.filter((Z0)=>Z0.source==="composio"&&Z0.url).map((Z0)=>{let d=Z0.url.match(/\/v3\/mcp\/([^/]+)/);return d?d[1]:null}).filter(Boolean));C(O1);let Q0=F0.find((Z0)=>Z0.id==="composio"),U0=F0.find((Z0)=>Z0.id==="smithery"),_0=F0.find((Z0)=>Z0.id==="agentdojo");if(R(Q0?.hasKey||!1),_(U0?.hasKey||!1),I(_0?.hasKey||!1),Q0?.hasKey)J0()}catch(j){console.error("Failed to fetch providers:",j)}E(!1)},J0=async()=>{v(!0);try{let c=await(await G("/api/integrations/composio/configs")).json();w(c.configs||[])}catch(j){console.error("Failed to fetch Composio configs:",j)}v(!1)},i=async(j)=>{D(j);try{let c=await G(`/api/integrations/composio/configs/${j}/add`,{method:"POST"});if(c.ok)C((X0)=>new Set([...X0,j])),Y?.();else{let X0=await c.json();await n(X0.error||"Failed to add config",{title:"Error",variant:"error"})}}catch(c){console.error("Failed to add config:",c)}D(null)},t=(j)=>{return b.has(j)};if(z1.useEffect(()=>{r()},[G]),f)return M.jsxDEV("div",{className:"text-center py-8 text-[#666]",children:"Loading..."},void 0,!1,void 0,this);if(!(q||L||k))return M.jsxDEV("div",{className:"bg-[#111] border border-[#1a1a1a] rounded-lg p-8 text-center",children:[M.jsxDEV("p",{className:"text-[#888] mb-2",children:"No hosted MCP services connected"},void 0,!1,void 0,this),M.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),M.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 M.jsxDEV(M.Fragment,{children:[p,M.jsxDEV("div",{className:"space-y-6",children:[q&&M.jsxDEV("div",{className:"flex gap-1 bg-[#0a0a0a] border border-[#222] rounded-lg p-1 w-fit",children:[M.jsxDEV("button",{onClick:()=>W("configs"),className:`px-4 py-2 rounded text-sm font-medium transition ${U==="configs"?"bg-[#1a1a1a] text-white":"text-[#666] hover:text-[#888]"}`,children:"MCP Configs"},void 0,!1,void 0,this),M.jsxDEV("button",{onClick:()=>W("connect"),className:`px-4 py-2 rounded text-sm font-medium transition ${U==="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),q&&U==="connect"&&M.jsxDEV("div",{children:[M.jsxDEV("div",{className:"flex items-center justify-between mb-4",children:M.jsxDEV("div",{children:[M.jsxDEV("h2",{className:"font-medium",children:"Connect Apps via Composio"},void 0,!1,void 0,this),M.jsxDEV("p",{className:"text-sm text-[#666] mt-1",children:"Connect your accounts to enable tools in MCP configs"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),M.jsxDEV(KW,{providerId:"composio",onConnectionComplete:()=>{J0()}},void 0,!1,void 0,this)]},void 0,!0,void 0,this),q&&U==="configs"&&M.jsxDEV("div",{children:[M.jsxDEV("div",{className:"flex items-center justify-between mb-3",children:[M.jsxDEV("div",{className:"flex items-center gap-2",children:[M.jsxDEV("h2",{className:"font-medium",children:"Composio MCP Configs"},void 0,!1,void 0,this),M.jsxDEV("span",{className:"text-xs text-green-400",children:"Connected"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),M.jsxDEV("div",{className:"flex items-center gap-3",children:[M.jsxDEV("button",{onClick:J0,disabled:V,className:"text-xs text-[#666] hover:text-[#888] transition",children:V?"Loading...":"Refresh"},void 0,!1,void 0,this),M.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),V?M.jsxDEV("div",{className:"text-center py-6 text-[#666]",children:"Loading configs..."},void 0,!1,void 0,this):F.length===0?M.jsxDEV("div",{className:"bg-[#111] border border-[#1a1a1a] rounded-lg p-4 text-center",children:[M.jsxDEV("p",{className:"text-sm text-[#666]",children:"No MCP configs found"},void 0,!1,void 0,this),M.jsxDEV("p",{className:"text-xs text-[#555] mt-2",children:["First ",M.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),M.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):M.jsxDEV("div",{className:"space-y-2",children:F.map((j)=>{let c=t(j.id),X0=T===j.id;return M.jsxDEV("div",{className:`bg-[#111] border rounded-lg p-3 transition flex items-center justify-between ${c?"border-green-500/30":"border-[#1a1a1a] hover:border-[#333]"}`,children:[M.jsxDEV("div",{className:"flex-1 min-w-0",children:[M.jsxDEV("div",{className:"flex items-center gap-2",children:[M.jsxDEV("span",{className:"font-medium text-sm",children:j.name},void 0,!1,void 0,this),M.jsxDEV("span",{className:"text-xs text-[#555]",children:[j.toolsCount," tools"]},void 0,!0,void 0,this),c&&M.jsxDEV("span",{className:"text-xs text-green-400",children:"Added"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),j.toolkits.length>0&&M.jsxDEV("div",{className:"flex flex-wrap gap-1 mt-1",children:[j.toolkits.slice(0,4).map((I0)=>M.jsxDEV("span",{className:"text-xs bg-[#1a1a1a] text-[#666] px-1.5 py-0.5 rounded",children:I0},I0,!1,void 0,this)),j.toolkits.length>4&&M.jsxDEV("span",{className:"text-xs text-[#555]",children:["+",j.toolkits.length-4]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),M.jsxDEV("div",{className:"flex items-center gap-2 ml-3",children:[c?M.jsxDEV("span",{className:"text-xs text-[#555] px-2 py-1",children:"In Servers"},void 0,!1,void 0,this):M.jsxDEV("button",{onClick:()=>i(j.id),disabled:X0,className:"text-xs bg-[#f97316] hover:bg-[#fb923c] text-black px-3 py-1 rounded font-medium transition disabled:opacity-50",children:X0?"Adding...":"Add"},void 0,!1,void 0,this),M.jsxDEV("a",{href:`https://app.composio.dev/mcp_configs/${j.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)]},j.id,!0,void 0,this)})},void 0,!1,void 0,this)]},void 0,!0,void 0,this),L&&M.jsxDEV("div",{children:[M.jsxDEV("div",{className:"flex items-center justify-between mb-3",children:[M.jsxDEV("div",{className:"flex items-center gap-2",children:[M.jsxDEV("h2",{className:"font-medium",children:"Smithery"},void 0,!1,void 0,this),M.jsxDEV("span",{className:"text-xs text-green-400",children:"Connected"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),M.jsxDEV("a",{href:"https://smithery.ai/servers",target:"_blank",rel:"noopener noreferrer",className:"text-xs text-[#666] hover:text-[#f97316] transition",children:"View Servers →"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),M.jsxDEV("div",{className:"bg-[#111] border border-[#1a1a1a] rounded-lg p-4 text-center",children:M.jsxDEV("p",{className:"text-sm text-[#666]",children:"Smithery servers can be added from the Registry tab."},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),k&&M.jsxDEV("div",{children:[M.jsxDEV("div",{className:"flex items-center justify-between mb-3",children:[M.jsxDEV("div",{className:"flex items-center gap-2",children:[M.jsxDEV("h2",{className:"font-medium",children:"AgentDojo"},void 0,!1,void 0,this),M.jsxDEV("span",{className:"text-xs text-green-400",children:"Connected"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),M.jsxDEV("a",{href:"https://agentdojo.com/tools",target:"_blank",rel:"noopener noreferrer",className:"text-xs text-[#666] hover:text-[#f97316] transition",children:"Browse Tools →"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),M.jsxDEV("div",{className:"bg-[#111] border border-[#1a1a1a] rounded-lg p-4 text-center",children:M.jsxDEV("p",{className:"text-sm text-[#666]",children:"AgentDojo integration coming soon. Browse available tools on their platform."},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),M.jsxDEV("div",{className:"p-3 bg-[#0a0a0a] border border-[#222] rounded text-xs text-[#666]",children:[M.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."," · ",M.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 rI(Y){let G=[],U=Y,W=null,q=Y.match(/(?:npx\s+-y\s+)?(@?[\w-]+\/)?(@?[\w-]+)(?:@[\w.-]+)?/);if(q){let _=q[2]||q[1];if(_)W=_.replace(/^@/,"").replace(/-mcp$/,"").replace(/-server$/,"").replace(/^server-/,"").replace(/^mcp-/,"")}let R=/--(\w+[-\w]*)\s+(YOUR_\w+|<[\w_]+>|\{[\w_]+\}|\$[\w_]+|[\w_]*(?:TOKEN|KEY|SECRET|PASSWORD|USER|ID|APIKEY)[\w_]*)/gi,L;while((L=R.exec(Y))!==null){let _=L[1],k=L[2],I=_.toUpperCase().replace(/-/g,"_"),F=W?`${W.toUpperCase().replace(/-/g,"_")}_${I}`:I;G.push({key:F,flag:_}),U=U.replace(new RegExp(`(--${_}\\s+)${k.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}`,"i"),`--${_} $${F}`)}return{cleanCommand:U,credentials:G,serverName:W}}function tI({onClose:Y,onAdded:G,projects:U,defaultProjectId:W}){let{authFetch:q}=k1(),[R,L]=z1.useState("npm"),[_,k]=z1.useState(""),[I,F]=z1.useState(""),[w,b]=z1.useState(""),[C,f]=z1.useState(""),[E,V]=z1.useState(""),[v,T]=z1.useState(""),[D,n]=z1.useState(""),[p,r]=z1.useState([]),[J0,i]=z1.useState(W||null),[t,l]=z1.useState(!1),[j,c]=z1.useState(null),X0=U&&U.length>0,I0=()=>{r([...p,{key:"",value:""}])},F0=(Z0,d,P0)=>{let v0=[...p];v0[Z0][d]=P0,r(v0)},Q1=(Z0)=>{r(p.filter((d,P0)=>P0!==Z0))},O1=(Z0)=>{if(f(Z0),Z0.includes("YOUR_")||Z0.includes("<")||Z0.includes("{")||/TOKEN|KEY|SECRET|PASSWORD/i.test(Z0)){let{cleanCommand:d,credentials:P0,serverName:v0}=rI(Z0);if(!_&&v0)k(v0);if(P0.length>0){let X1=new Set(p.map((V0)=>V0.key)),r0=P0.filter((V0)=>!X1.has(V0.key)).map((V0)=>({key:V0.key,value:""}));if(r0.length>0)r([...p,...r0]),f(d)}}},Q0=(Z0)=>{if(Z0.startsWith("npx ")||Z0.includes(" --")||Z0.includes("YOUR_")||Z0.includes("<")||/\s+(TOKEN|KEY|SECRET|PASSWORD)/i.test(Z0))L("command"),O1(Z0);else if(F(Z0),!_&&Z0){let P0=Z0.replace(/^@[\w-]+\//,"").replace(/@[\w.-]+$/,"").replace(/^server-/,"").replace(/-server$/,"").replace(/^mcp-/,"").replace(/-mcp$/,"");if(P0&&P0!==Z0)k(P0)}},U0=async()=>{if(!_){c("Name is required");return}if(R==="npm"&&!I){c("npm package is required");return}if(R==="pip"&&!I){c("pip package is required");return}if(R==="command"&&!C){c("Command is required");return}if(R==="http"&&!E){c("URL is required");return}l(!0),c(null);let Z0={};for(let{key:d,value:P0}of p)if(d.trim())Z0[d.trim()]=P0;try{let d={name:_};if(R==="npm")d.type="npm",d.package=I;else if(R==="pip"){if(d.type="pip",d.package=I,w)d.pip_module=w}else if(R==="http"){d.type="http",d.url=E;let v0={"Content-Type":"application/json"};if(v&&D){let X1=btoa(`${v}:${D}`);v0.Authorization=`Basic ${X1}`}d.headers=v0}else{let v0=C.trim().split(/\s+/);d.type="custom",d.command=v0[0],d.args=v0.slice(1).join(" ")}if(Object.keys(Z0).length>0)d.env=Z0;if(J0)d.project_id=J0;let P0=await q("/api/mcp/servers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(d)});if(!P0.ok){let v0=await P0.json();c(v0.error||"Failed to add server"),l(!1);return}G()}catch(d){c("Failed to add server"),l(!1)}},_0=(Z0,d)=>{L("npm"),k(Z0),F(d)};return M.jsxDEV("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-[2px] z-50 flex items-center justify-center p-4",children:M.jsxDEV("div",{className:"bg-[#111] border border-[#1a1a1a] rounded-lg w-full max-w-lg max-h-[90vh] overflow-y-auto",children:[M.jsxDEV("div",{className:"p-4 border-b border-[#1a1a1a] flex items-center justify-between sticky top-0 bg-[#111]",children:[M.jsxDEV("h2",{className:"text-lg font-semibold",children:"Add MCP Server"},void 0,!1,void 0,this),M.jsxDEV("button",{onClick:Y,className:"text-[#666] hover:text-[#888]",children:"✕"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),M.jsxDEV("div",{className:"p-4 space-y-4",children:[M.jsxDEV("div",{children:[M.jsxDEV("p",{className:"text-sm text-[#666] mb-2",children:"Quick add:"},void 0,!1,void 0,this),M.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((Z0)=>M.jsxDEV("button",{onClick:()=>{if(L(Z0.type),k(Z0.name),F(Z0.pkg),Z0.type==="pip"&&"module"in Z0)b(Z0.module||"");else b("")},className:"text-sm bg-[#1a1a1a] hover:bg-[#222] px-3 py-1 rounded transition",children:Z0.name},Z0.name,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),M.jsxDEV("div",{className:"flex gap-1 bg-[#0a0a0a] border border-[#222] rounded p-1",children:[M.jsxDEV("button",{onClick:()=>L("npm"),className:`flex-1 px-2 py-1.5 rounded text-sm transition ${R==="npm"?"bg-[#1a1a1a] text-white":"text-[#666] hover:text-[#888]"}`,children:"npm"},void 0,!1,void 0,this),M.jsxDEV("button",{onClick:()=>L("pip"),className:`flex-1 px-2 py-1.5 rounded text-sm transition ${R==="pip"?"bg-[#1a1a1a] text-white":"text-[#666] hover:text-[#888]"}`,children:"pip"},void 0,!1,void 0,this),M.jsxDEV("button",{onClick:()=>L("command"),className:`flex-1 px-2 py-1.5 rounded text-sm transition ${R==="command"?"bg-[#1a1a1a] text-white":"text-[#666] hover:text-[#888]"}`,children:"Command"},void 0,!1,void 0,this),M.jsxDEV("button",{onClick:()=>L("http"),className:`flex-1 px-2 py-1.5 rounded text-sm transition ${R==="http"?"bg-[#1a1a1a] text-white":"text-[#666] hover:text-[#888]"}`,children:"HTTP"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),M.jsxDEV("div",{children:[M.jsxDEV("label",{className:"block text-sm text-[#666] mb-1",children:"Name"},void 0,!1,void 0,this),M.jsxDEV("input",{type:"text",value:_,onChange:(Z0)=>k(Z0.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),X0&&M.jsxDEV("div",{children:[M.jsxDEV("label",{className:"block text-sm text-[#666] mb-1",children:"Scope"},void 0,!1,void 0,this),M.jsxDEV(V6,{value:J0||"",onChange:(Z0)=>i(Z0||null),options:[{value:"",label:"Global (all projects)"},...U.map((Z0)=>({value:Z0.id,label:Z0.name}))],placeholder:"Select scope..."},void 0,!1,void 0,this),M.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),R==="npm"&&M.jsxDEV("div",{children:[M.jsxDEV("label",{className:"block text-sm text-[#666] mb-1",children:"npm Package"},void 0,!1,void 0,this),M.jsxDEV("input",{type:"text",value:I,onChange:(Z0)=>Q0(Z0.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),M.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),R==="pip"&&M.jsxDEV("div",{className:"space-y-4",children:[M.jsxDEV("div",{children:[M.jsxDEV("label",{className:"block text-sm text-[#666] mb-1",children:"pip Package"},void 0,!1,void 0,this),M.jsxDEV("input",{type:"text",value:I,onChange:(Z0)=>{if(F(Z0.target.value),!w&&Z0.target.value){let d=Z0.target.value.split("[")[0].replace(/-/g,".");b(d)}},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),M.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),M.jsxDEV("div",{children:[M.jsxDEV("label",{className:"block text-sm text-[#666] mb-1",children:"Module (optional)"},void 0,!1,void 0,this),M.jsxDEV("input",{type:"text",value:w,onChange:(Z0)=>b(Z0.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),M.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),R==="command"&&M.jsxDEV("div",{children:[M.jsxDEV("label",{className:"block text-sm text-[#666] mb-1",children:"Command"},void 0,!1,void 0,this),M.jsxDEV("input",{type:"text",value:C,onChange:(Z0)=>O1(Z0.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),M.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),R==="http"&&M.jsxDEV("div",{className:"space-y-4",children:[M.jsxDEV("div",{children:[M.jsxDEV("label",{className:"block text-sm text-[#666] mb-1",children:"URL"},void 0,!1,void 0,this),M.jsxDEV("input",{type:"text",value:E,onChange:(Z0)=>V(Z0.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),M.jsxDEV("div",{className:"p-3 bg-[#0a0a0a] border border-[#222] rounded",children:[M.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),M.jsxDEV("div",{className:"grid grid-cols-2 gap-3",children:[M.jsxDEV("div",{children:[M.jsxDEV("label",{className:"block text-xs text-[#555] mb-1",children:"Username"},void 0,!1,void 0,this),M.jsxDEV("input",{type:"text",value:v,onChange:(Z0)=>T(Z0.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),M.jsxDEV("div",{children:[M.jsxDEV("label",{className:"block text-xs text-[#555] mb-1",children:"Password"},void 0,!1,void 0,this),M.jsxDEV("input",{type:"password",value:D,onChange:(Z0)=>n(Z0.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),M.jsxDEV("div",{children:[M.jsxDEV("div",{className:"flex items-center justify-between mb-2",children:[M.jsxDEV("label",{className:"text-sm text-[#666]",children:"Environment Variables / Credentials"},void 0,!1,void 0,this),M.jsxDEV("button",{onClick:I0,className:"text-xs text-[#f97316] hover:text-[#fb923c] transition",children:"+ Add Variable"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),p.length===0&&M.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),p.length>0&&M.jsxDEV("div",{className:"space-y-2",children:p.map((Z0,d)=>M.jsxDEV("div",{className:"flex gap-2",children:[M.jsxDEV("input",{type:"text",value:Z0.key,onChange:(P0)=>F0(d,"key",P0.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),M.jsxDEV("input",{type:"password",value:Z0.value,onChange:(P0)=>F0(d,"value",P0.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),M.jsxDEV("button",{onClick:()=>Q1(d),className:"text-[#666] hover:text-red-400 px-2 transition",children:"✕"},void 0,!1,void 0,this)]},d,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),j&&M.jsxDEV("p",{className:"text-red-400 text-sm",children:j},void 0,!1,void 0,this)]},void 0,!0,void 0,this),M.jsxDEV("div",{className:"p-4 border-t border-[#1a1a1a] flex justify-end gap-2 sticky bottom-0 bg-[#111]",children:[M.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),M.jsxDEV("button",{onClick:U0,disabled:t||!_||(R==="npm"?!I:R==="pip"?!I:R==="http"?!E:!C),className:"px-4 py-2 bg-[#f97316] hover:bg-[#fb923c] text-black rounded font-medium transition disabled:opacity-50",children:t?"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 sI({server:Y,projects:G,onClose:U,onSaved:W}){let{authFetch:q}=k1(),[R,L]=z1.useState(Y.name),[_,k]=z1.useState(Y.package||""),[I,F]=z1.useState(Y.command||""),[w,b]=z1.useState(Y.args||""),[C,f]=z1.useState(()=>{return Object.entries(Y.env||{}).map(([j,c])=>({key:j,value:c}))}),[E,V]=z1.useState(Y.project_id),[v,T]=z1.useState(!1),[D,n]=z1.useState(null),p=G&&G.length>0,r=Y.type==="http"&&Y.url,J0=()=>{f([...C,{key:"",value:""}])},i=(j,c,X0)=>{let I0=[...C];I0[j][c]=X0,f(I0)},t=(j)=>{f(C.filter((c,X0)=>X0!==j))},l=async()=>{if(!R.trim()){n("Name is required");return}T(!0),n(null);let j={};for(let{key:c,value:X0}of C)if(c.trim())j[c.trim()]=X0;try{let c={name:R.trim(),env:j};if(!r){if(Y.type==="npm"&&_.trim())c.package=_.trim();if(Y.type==="custom"){if(I.trim())c.command=I.trim();if(w.trim())c.args=w.trim()}}c.project_id=E;let X0=await q(`/api/mcp/servers/${Y.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(c)});if(!X0.ok){let I0=await X0.json();n(I0.error||"Failed to save changes"),T(!1);return}if(Y.status==="running"&&!r)try{await q(`/api/mcp/servers/${Y.id}/stop`,{method:"POST"}),await q(`/api/mcp/servers/${Y.id}/start`,{method:"POST"})}catch(I0){console.error("Failed to restart server:",I0)}W()}catch(c){n("Failed to save changes"),T(!1)}};return M.jsxDEV("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-[2px] z-50 flex items-center justify-center p-4",children:M.jsxDEV("div",{className:"bg-[#111] border border-[#1a1a1a] rounded-lg w-full max-w-lg max-h-[90vh] overflow-y-auto",children:[M.jsxDEV("div",{className:"p-4 border-b border-[#1a1a1a] flex items-center justify-between sticky top-0 bg-[#111]",children:[M.jsxDEV("h2",{className:"text-lg font-semibold",children:"Edit MCP Server"},void 0,!1,void 0,this),M.jsxDEV("button",{onClick:U,className:"text-[#666] hover:text-[#888]",children:"✕"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),M.jsxDEV("div",{className:"p-4 space-y-4",children:[M.jsxDEV("div",{className:"text-sm text-[#666] bg-[#0a0a0a] border border-[#222] rounded p-3",children:["Type: ",M.jsxDEV("span",{className:"text-[#888]",children:Y.type},void 0,!1,void 0,this),Y.package&&M.jsxDEV(M.Fragment,{children:[" • Package: ",M.jsxDEV("span",{className:"text-[#888] font-mono",children:Y.package},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Y.command&&M.jsxDEV(M.Fragment,{children:[" • Command: ",M.jsxDEV("span",{className:"text-[#888] font-mono",children:Y.command},void 0,!1,void 0,this)]},void 0,!0,void 0,this),r&&Y.url&&M.jsxDEV(M.Fragment,{children:[" • URL: ",M.jsxDEV("span",{className:"text-[#888] font-mono text-xs",children:Y.url},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),M.jsxDEV("div",{children:[M.jsxDEV("label",{className:"block text-sm text-[#666] mb-1",children:"Name"},void 0,!1,void 0,this),M.jsxDEV("input",{type:"text",value:R,onChange:(j)=>L(j.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),p&&M.jsxDEV("div",{children:[M.jsxDEV("label",{className:"block text-sm text-[#666] mb-1",children:"Scope"},void 0,!1,void 0,this),M.jsxDEV(V6,{value:E||"",onChange:(j)=>V(j||null),options:[{value:"",label:"Global (all projects)"},...G.map((j)=>({value:j.id,label:j.name}))],placeholder:"Select scope..."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Y.type==="npm"&&M.jsxDEV("div",{children:[M.jsxDEV("label",{className:"block text-sm text-[#666] mb-1",children:"npm Package"},void 0,!1,void 0,this),M.jsxDEV("input",{type:"text",value:_,onChange:(j)=>k(j.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==="custom"&&M.jsxDEV(M.Fragment,{children:[M.jsxDEV("div",{children:[M.jsxDEV("label",{className:"block text-sm text-[#666] mb-1",children:"Command"},void 0,!1,void 0,this),M.jsxDEV("input",{type:"text",value:I,onChange:(j)=>F(j.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),M.jsxDEV("div",{children:[M.jsxDEV("label",{className:"block text-sm text-[#666] mb-1",children:"Arguments"},void 0,!1,void 0,this),M.jsxDEV("input",{type:"text",value:w,onChange:(j)=>b(j.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&&M.jsxDEV("div",{children:[M.jsxDEV("div",{className:"flex items-center justify-between mb-2",children:[M.jsxDEV("label",{className:"text-sm text-[#666]",children:"Environment Variables / Credentials"},void 0,!1,void 0,this),M.jsxDEV("button",{onClick:J0,className:"text-xs text-[#f97316] hover:text-[#fb923c] transition",children:"+ Add Variable"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),C.length===0&&M.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),C.length>0&&M.jsxDEV("div",{className:"space-y-2",children:C.map((j,c)=>M.jsxDEV("div",{className:"flex gap-2",children:[M.jsxDEV("input",{type:"text",value:j.key,onChange:(X0)=>i(c,"key",X0.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),M.jsxDEV("input",{type:"password",value:j.value,onChange:(X0)=>i(c,"value",X0.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),M.jsxDEV("button",{onClick:()=>t(c),className:"text-[#666] hover:text-red-400 px-2 transition",children:"✕"},void 0,!1,void 0,this)]},c,!0,void 0,this))},void 0,!1,void 0,this),M.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),D&&M.jsxDEV("p",{className:"text-red-400 text-sm",children:D},void 0,!1,void 0,this)]},void 0,!0,void 0,this),M.jsxDEV("div",{className:"p-4 border-t border-[#1a1a1a] flex justify-end gap-2 sticky bottom-0 bg-[#111]",children:[M.jsxDEV("button",{onClick:U,className:"px-4 py-2 border border-[#333] hover:border-[#666] rounded transition",children:"Cancel"},void 0,!1,void 0,this),M.jsxDEV("button",{onClick:l,disabled:v||!R.trim(),className:"px-4 py-2 bg-[#f97316] hover:bg-[#fb923c] text-black rounded font-medium transition disabled:opacity-50",children:v?"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 I4=q0(I1(),1);var B0=q0(Z1(),1);function X2(){let{authFetch:Y}=k1(),{projects:G,currentProjectId:U}=g4(),[W,q]=I4.useState([]),[R,L]=I4.useState(!0),[_,k]=I4.useState("installed"),[I,F]=I4.useState(!1),[w,b]=I4.useState(!1),[C,f]=I4.useState(null),{confirm:E,ConfirmDialog:V}=S5(),{alert:v,AlertDialog:T}=Z3(),D=G.length>0,[n,p]=I4.useState(""),[r,J0]=I4.useState([]),[i,t]=I4.useState(!1),[l,j]=I4.useState(null),c=W.filter((U0)=>{if(!U)return!0;if(U==="unassigned")return U0.project_id===null;return U0.project_id===null||U0.project_id===U}),X0=async()=>{try{let _0=await(await Y("/api/skills")).json();q(_0.skills||[])}catch(U0){console.error("Failed to fetch skills:",U0)}L(!1)},I0=async(U0)=>{t(!0);try{let _0=U0!==void 0?U0:n,Z0=_0?`/api/skills/marketplace/search?q=${encodeURIComponent(_0)}`:"/api/skills/marketplace/featured",P0=await(await Y(Z0)).json();J0(P0.skills||[])}catch(_0){console.error("Failed to search marketplace:",_0)}t(!1)};I4.useEffect(()=>{X0()},[Y]),I4.useEffect(()=>{if(_==="marketplace"&&r.length===0)I0("")},[_]);let F0=async(U0)=>{try{await Y(`/api/skills/${U0}/toggle`,{method:"POST"}),X0()}catch(_0){console.error("Failed to toggle skill:",_0)}},Q1=async(U0)=>{if(!await E("Delete this skill?",{confirmText:"Delete",title:"Delete Skill"}))return;try{if(await Y(`/api/skills/${U0}`,{method:"DELETE"}),C?.id===U0)f(null);X0()}catch(Z0){console.error("Failed to delete skill:",Z0)}},O1=async(U0)=>{j(U0.id);try{let _0=await Y(`/api/skills/marketplace/${U0.id}/install`,{method:"POST"}),Z0=await _0.json();if(_0.ok)await v(`Installed "${U0.name}" successfully!`,{title:"Skill Installed"}),X0(),k("installed");else await v(Z0.error||"Failed to install skill",{title:"Installation Failed"})}catch(_0){console.error("Failed to install skill:",_0),await v("Failed to install skill",{title:"Error"})}j(null)},Q0=(U0)=>W.some((_0)=>_0.name===U0);return B0.jsxDEV(B0.Fragment,{children:[V,T,B0.jsxDEV("div",{className:"flex-1 overflow-auto p-6",children:B0.jsxDEV("div",{className:"max-w-6xl",children:[B0.jsxDEV("div",{className:"flex items-center justify-between mb-6",children:[B0.jsxDEV("div",{children:[B0.jsxDEV("h1",{className:"text-2xl font-semibold mb-1",children:"Skills"},void 0,!1,void 0,this),B0.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),_==="installed"&&B0.jsxDEV("div",{className:"flex gap-2",children:[B0.jsxDEV("button",{onClick:()=>b(!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),B0.jsxDEV("button",{onClick:()=>F(!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),B0.jsxDEV("div",{className:"flex gap-1 mb-6 bg-[#111] border border-[#1a1a1a] rounded-lg p-1 w-fit",children:[B0.jsxDEV("button",{onClick:()=>k("installed"),className:`px-4 py-2 rounded text-sm font-medium transition ${_==="installed"?"bg-[#1a1a1a] text-white":"text-[#666] hover:text-[#888]"}`,children:["Installed (",W.length,")"]},void 0,!0,void 0,this),B0.jsxDEV("button",{onClick:()=>k("marketplace"),className:`px-4 py-2 rounded text-sm font-medium transition ${_==="marketplace"?"bg-[#1a1a1a] text-white":"text-[#666] hover:text-[#888]"}`,children:"Marketplace"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),_==="installed"&&B0.jsxDEV(B0.Fragment,{children:R?B0.jsxDEV("div",{className:"text-[#666]",children:"Loading skills..."},void 0,!1,void 0,this):W.length===0?B0.jsxDEV("div",{className:"text-center py-20 text-[#666]",children:[B0.jsxDEV("p",{className:"text-lg",children:"No skills installed"},void 0,!1,void 0,this),B0.jsxDEV("p",{className:"text-sm mt-1",children:"Create a skill or browse the marketplace"},void 0,!1,void 0,this),B0.jsxDEV("button",{onClick:()=>k("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):c.length===0?B0.jsxDEV("div",{className:"bg-[#111] border border-[#1a1a1a] rounded-lg p-6 text-center",children:B0.jsxDEV("p",{className:"text-[#666]",children:"No skills match this filter."},void 0,!1,void 0,this)},void 0,!1,void 0,this):B0.jsxDEV("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-3",children:c.map((U0)=>{let _0=D&&U0.project_id?G.find((Z0)=>Z0.id===U0.project_id):null;return B0.jsxDEV(eI,{skill:U0,project:_0,onToggle:()=>F0(U0.id),onDelete:()=>Q1(U0.id),onView:()=>f(U0)},U0.id,!1,void 0,this)})},void 0,!1,void 0,this)},void 0,!1,void 0,this),_==="marketplace"&&B0.jsxDEV(B0.Fragment,{children:[B0.jsxDEV("div",{className:"mb-6",children:B0.jsxDEV("div",{className:"flex gap-2",children:[B0.jsxDEV("input",{type:"text",value:n,onChange:(U0)=>p(U0.target.value),onKeyDown:(U0)=>U0.key==="Enter"&&I0(),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),B0.jsxDEV("button",{onClick:()=>I0(),disabled:i,className:"bg-[#1a1a1a] hover:bg-[#222] text-white px-4 py-2 rounded font-medium transition border border-[#333]",children:i?"...":"Search"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),i?B0.jsxDEV("div",{className:"text-[#666]",children:"Loading..."},void 0,!1,void 0,this):r.length===0?B0.jsxDEV("div",{className:"text-center py-20 text-[#666]",children:[B0.jsxDEV("p",{className:"text-lg",children:"No skills found"},void 0,!1,void 0,this),B0.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):B0.jsxDEV("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-3",children:r.map((U0)=>B0.jsxDEV(zk,{skill:U0,installed:Q0(U0.name),installing:l===U0.id,onInstall:()=>O1(U0)},U0.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),I&&B0.jsxDEV(Qk,{authFetch:Y,onClose:()=>F(!1),onCreated:()=>{F(!1),X0()},projects:D?G:void 0,defaultProjectId:U&&U!=="unassigned"?U:null},void 0,!1,void 0,this),w&&B0.jsxDEV(Xk,{authFetch:Y,onClose:()=>b(!1),onImported:()=>{b(!1),X0()}},void 0,!1,void 0,this),C&&B0.jsxDEV(Zk,{skill:C,authFetch:Y,onClose:()=>f(null),onUpdated:()=>{f(null),X0()}},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function eI({skill:Y,project:G,onToggle:U,onDelete:W,onView:q}){let R={local:"Local",skillsmp:"SkillsMP",github:"GitHub",import:"Imported"}[Y.source],L=()=>{if(G)return B0.jsxDEV("span",{className:"text-xs px-1.5 py-0.5 rounded",style:{backgroundColor:`${G.color}20`,color:G.color},children:G.name},void 0,!1,void 0,this);if(Y.project_id===null)return B0.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 B0.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:q,children:[B0.jsxDEV("div",{className:"flex items-start justify-between mb-3",children:[B0.jsxDEV("div",{className:"flex-1 min-w-0",children:[B0.jsxDEV("div",{className:"flex items-center gap-2",children:[B0.jsxDEV("h3",{className:"font-semibold text-lg truncate",children:Y.name},void 0,!1,void 0,this),L()]},void 0,!0,void 0,this),B0.jsxDEV("p",{className:"text-xs text-[#666] flex items-center gap-2 mt-0.5",children:[B0.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:R},void 0,!1,void 0,this),Y.metadata?.version&&B0.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),B0.jsxDEV("button",{onClick:(_)=>{_.stopPropagation(),U()},className:`w-10 h-5 rounded-full transition-colors relative ${Y.enabled?"bg-[#f97316]":"bg-[#333]"}`,children:B0.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),B0.jsxDEV("p",{className:"text-sm text-[#888] line-clamp-2 mb-4",children:Y.description},void 0,!1,void 0,this),B0.jsxDEV("div",{className:"flex items-center justify-between",children:[B0.jsxDEV("div",{className:"flex gap-1 flex-wrap",children:[Y.allowed_tools.slice(0,2).map((_)=>B0.jsxDEV("span",{className:"text-xs bg-[#222] px-2 py-0.5 rounded text-[#666]",children:_},_,!1,void 0,this)),Y.allowed_tools.length>2&&B0.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),B0.jsxDEV("button",{onClick:(_)=>{_.stopPropagation(),W()},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 zk({skill:Y,installed:G,installing:U,onInstall:W}){return B0.jsxDEV("div",{className:"bg-[#111] rounded-lg p-5 border border-[#1a1a1a] hover:border-[#333] transition",children:[B0.jsxDEV("div",{className:"flex items-start justify-between mb-3",children:[B0.jsxDEV("div",{className:"flex-1 min-w-0",children:[B0.jsxDEV("h3",{className:"font-semibold text-lg truncate",children:Y.name},void 0,!1,void 0,this),B0.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),B0.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),B0.jsxDEV("p",{className:"text-sm text-[#888] line-clamp-2 mb-4",children:Y.description},void 0,!1,void 0,this),B0.jsxDEV("div",{className:"flex items-center justify-between",children:[B0.jsxDEV("div",{className:"flex gap-1 flex-wrap",children:Y.tags.slice(0,3).map((q)=>B0.jsxDEV("span",{className:"text-xs bg-[#222] px-2 py-0.5 rounded text-[#666]",children:q},q,!1,void 0,this))},void 0,!1,void 0,this),G?B0.jsxDEV("span",{className:"text-green-400 text-sm",children:"✓ Installed"},void 0,!1,void 0,this):B0.jsxDEV("button",{onClick:W,disabled:U,className:"bg-[#f97316] hover:bg-[#fb923c] disabled:opacity-50 text-black px-3 py-1 rounded text-sm font-medium transition",children:U?"Installing...":"Install"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),B0.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 Qk({authFetch:Y,onClose:G,onCreated:U,projects:W,defaultProjectId:q}){let[R,L]=I4.useState(""),[_,k]=I4.useState(""),[I,F]=I4.useState(""),[w,b]=I4.useState(q||null),[C,f]=I4.useState(!1),[E,V]=I4.useState(null),v=W&&W.length>0,T=async()=>{if(!R||!_||!I){V("All fields are required");return}f(!0),V(null);try{let D={name:R,description:_,content:I,source:"local"};if(w)D.project_id=w;let n=await Y("/api/skills",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(D)}),p=await n.json();if(!n.ok){V(p.error||"Failed to create skill"),f(!1);return}U()}catch(D){V("Failed to create skill"),f(!1)}};return B0.jsxDEV("div",{className:"fixed inset-0 bg-black/60 flex items-center justify-center z-50 p-4",onClick:G,children:B0.jsxDEV("div",{className:"bg-[#111] border border-[#1a1a1a] rounded-lg w-full max-w-2xl max-h-[90vh] overflow-auto",onClick:(D)=>D.stopPropagation(),children:[B0.jsxDEV("div",{className:"p-6 border-b border-[#1a1a1a]",children:B0.jsxDEV("h2",{className:"text-xl font-semibold",children:"Create Skill"},void 0,!1,void 0,this)},void 0,!1,void 0,this),B0.jsxDEV("div",{className:"p-6 space-y-4",children:[E&&B0.jsxDEV("div",{className:"bg-red-500/10 border border-red-500/30 rounded p-3 text-red-400 text-sm",children:E},void 0,!1,void 0,this),B0.jsxDEV("div",{children:[B0.jsxDEV("label",{className:"block text-sm text-[#888] mb-1",children:"Name"},void 0,!1,void 0,this),B0.jsxDEV("input",{type:"text",value:R,onChange:(D)=>L(D.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),B0.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),B0.jsxDEV("div",{children:[B0.jsxDEV("label",{className:"block text-sm text-[#888] mb-1",children:"Description"},void 0,!1,void 0,this),B0.jsxDEV("input",{type:"text",value:_,onChange:(D)=>k(D.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),v&&B0.jsxDEV("div",{children:[B0.jsxDEV("label",{className:"block text-sm text-[#888] mb-1",children:"Scope"},void 0,!1,void 0,this),B0.jsxDEV(V6,{value:w||"",onChange:(D)=>b(D||null),options:[{value:"",label:"Global (all projects)"},...W.map((D)=>({value:D.id,label:D.name}))],placeholder:"Select scope..."},void 0,!1,void 0,this),B0.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),B0.jsxDEV("div",{children:[B0.jsxDEV("label",{className:"block text-sm text-[#888] mb-1",children:"Instructions (Markdown)"},void 0,!1,void 0,this),B0.jsxDEV("textarea",{value:I,onChange:(D)=>F(D.target.value),placeholder:`# Skill Instructions
216
+
217
+ 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),B0.jsxDEV("div",{className:"p-6 border-t border-[#1a1a1a] flex justify-end gap-3",children:[B0.jsxDEV("button",{onClick:G,className:"px-4 py-2 text-[#888] hover:text-white transition",children:"Cancel"},void 0,!1,void 0,this),B0.jsxDEV("button",{onClick:T,disabled:C,className:"bg-[#f97316] hover:bg-[#fb923c] disabled:opacity-50 text-black px-4 py-2 rounded font-medium transition",children:C?"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 Xk({authFetch:Y,onClose:G,onImported:U}){let[W,q]=I4.useState(""),[R,L]=I4.useState(!1),[_,k]=I4.useState(null);return B0.jsxDEV("div",{className:"fixed inset-0 bg-black/60 flex items-center justify-center z-50 p-4",onClick:G,children:B0.jsxDEV("div",{className:"bg-[#111] border border-[#1a1a1a] rounded-lg w-full max-w-2xl max-h-[90vh] overflow-auto",onClick:(F)=>F.stopPropagation(),children:[B0.jsxDEV("div",{className:"p-6 border-b border-[#1a1a1a]",children:[B0.jsxDEV("h2",{className:"text-xl font-semibold",children:"Import Skill"},void 0,!1,void 0,this),B0.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),B0.jsxDEV("div",{className:"p-6 space-y-4",children:[_&&B0.jsxDEV("div",{className:"bg-red-500/10 border border-red-500/30 rounded p-3 text-red-400 text-sm",children:_},void 0,!1,void 0,this),B0.jsxDEV("textarea",{value:W,onChange:(F)=>q(F.target.value),placeholder:`---
218
+ name: skill-name
219
+ description: What this skill does...
220
+ ---
221
+
222
+ # Instructions
223
+
224
+ 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),B0.jsxDEV("div",{className:"p-6 border-t border-[#1a1a1a] flex justify-end gap-3",children:[B0.jsxDEV("button",{onClick:G,className:"px-4 py-2 text-[#888] hover:text-white transition",children:"Cancel"},void 0,!1,void 0,this),B0.jsxDEV("button",{onClick:async()=>{if(!W.trim()){k("Paste SKILL.md content");return}L(!0),k(null);try{let F=await Y("/api/skills/import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:W})}),w=await F.json();if(!F.ok){k(w.error||"Failed to import skill"),L(!1);return}U()}catch(F){k("Failed to import skill"),L(!1)}},disabled:R,className:"bg-[#f97316] hover:bg-[#fb923c] disabled:opacity-50 text-black px-4 py-2 rounded font-medium transition",children:R?"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 Zk({skill:Y,authFetch:G,onClose:U,onUpdated:W}){let[q,R]=I4.useState(!1),[L,_]=I4.useState(Y.content),[k,I]=I4.useState(!1),F=async()=>{I(!0);try{await G(`/api/skills/${Y.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:L})}),W()}catch(b){console.error("Failed to save:",b)}I(!1)},w=async()=>{try{let C=await(await G(`/api/skills/${Y.id}/export`)).text(),f=new Blob([C],{type:"text/markdown"}),E=URL.createObjectURL(f),V=document.createElement("a");V.href=E,V.download=`${Y.name}-SKILL.md`,V.click(),URL.revokeObjectURL(E)}catch(b){console.error("Failed to export:",b)}};return B0.jsxDEV("div",{className:"fixed inset-0 bg-black/60 flex items-center justify-center z-50 p-4",onClick:U,children:B0.jsxDEV("div",{className:"bg-[#111] border border-[#1a1a1a] rounded-lg w-full max-w-3xl max-h-[90vh] overflow-auto",onClick:(b)=>b.stopPropagation(),children:[B0.jsxDEV("div",{className:"p-6 border-b border-[#1a1a1a] flex items-center justify-between",children:[B0.jsxDEV("div",{children:[B0.jsxDEV("h2",{className:"text-xl font-semibold",children:Y.name},void 0,!1,void 0,this),B0.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),B0.jsxDEV("div",{className:"flex gap-2",children:[B0.jsxDEV("button",{onClick:w,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),B0.jsxDEV("button",{onClick:()=>R(!q),className:"text-sm text-[#888] hover:text-white transition px-3 py-1 rounded border border-[#333]",children:q?"View":"Edit"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),B0.jsxDEV("div",{className:"p-6",children:q?B0.jsxDEV("textarea",{value:L,onChange:(b)=>_(b.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):B0.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),B0.jsxDEV("div",{className:"p-6 border-t border-[#1a1a1a] flex justify-between",children:[B0.jsxDEV("div",{className:"text-xs text-[#555]",children:Y.source!=="local"&&Y.source_url&&B0.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),B0.jsxDEV("div",{className:"flex gap-3",children:[B0.jsxDEV("button",{onClick:U,className:"px-4 py-2 text-[#888] hover:text-white transition",children:"Close"},void 0,!1,void 0,this),q&&B0.jsxDEV("button",{onClick:F,disabled:k,className:"bg-[#f97316] hover:bg-[#fb923c] disabled:opacity-50 text-black px-4 py-2 rounded font-medium transition",children:k?"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 E4=q0(I1(),1);var x0=q0(Z1(),1);function OW(Y){let G=Y.category==="LLM",U=Y.category==="TOOL",W=Y.level==="error",q=Y.data?.input_tokens||0,R=Y.data?.output_tokens||0;return{llm_calls:G?1:0,tool_calls:U?1:0,errors:W?1:0,input_tokens:q,output_tokens:R}}function Z2(){let{events:Y}=kQ(),{currentProjectId:G,currentProject:U}=g4(),{authFetch:W}=k1(),[q,R]=E4.useState(null),[L,_]=E4.useState([]),[k,I]=E4.useState([]),[F,w]=E4.useState(!0),[b,C]=E4.useState({level:"",agent_id:""}),[f,E]=E4.useState(new Set(["DATABASE"])),[V,v]=E4.useState([]),[T,D]=E4.useState(null),n=E4.useRef(new Set),[p,r]=E4.useState(new Set),J0=E4.useRef(new Set);E4.useEffect(()=>{(async()=>{try{let v0=await(await W("/api/agents")).json();v(v0.agents||[])}catch(P0){console.error("Failed to fetch agents:",P0)}})()},[W]);let i=E4.useMemo(()=>{if(G===null)return V;if(G==="unassigned")return V.filter((d)=>!d.projectId);return V.filter((d)=>d.projectId===G)},[V,G]),t=E4.useMemo(()=>new Set(i.map((d)=>d.id)),[i]),l=async()=>{w(!0);try{let d=G==="unassigned"?"null":G||"",P0=new URLSearchParams;if(d)P0.set("project_id",d);let X1=await(await W(`/api/telemetry/stats${P0.toString()?`?${P0}`:""}`)).json();R(X1.stats);let r0=new URLSearchParams;if(b.level)r0.set("level",b.level);if(b.agent_id)r0.set("agent_id",b.agent_id);if(d)r0.set("project_id",d);r0.set("limit","100");let L0=(await(await W(`/api/telemetry/events?${r0}`)).json()).events||[];_(L0),n.current=new Set(L0.map((h4)=>h4.id));let a0=new URLSearchParams;if(a0.set("group_by","agent"),d)a0.set("project_id",d);let q4=await(await W(`/api/telemetry/usage?${a0}`)).json();I(q4.usage||[])}catch(d){console.error("Failed to fetch telemetry:",d)}w(!1)};E4.useEffect(()=>{l();let d=setInterval(l,60000);return()=>clearInterval(d)},[b,G,W]);let j=E4.useMemo(()=>{if(!q)return null;let d=0,P0=0,v0=0,X1=0,r0=0,V0=0;for(let $1 of Y)if(!n.current.has($1.id)){d++;let L0=OW($1);P0+=L0.llm_calls,v0+=L0.tool_calls,X1+=L0.errors,r0+=L0.input_tokens,V0+=L0.output_tokens}return{total_events:q.total_events+d,total_llm_calls:q.total_llm_calls+P0,total_tool_calls:q.total_tool_calls+v0,total_errors:q.total_errors+X1,total_input_tokens:q.total_input_tokens+r0,total_output_tokens:q.total_output_tokens+V0}},[q,Y]),c=E4.useMemo(()=>{let d=new Map;for(let P0 of k)d.set(P0.agent_id,{...P0});for(let P0 of Y)if(!n.current.has(P0.id)){let v0=OW(P0),X1=d.get(P0.agent_id);if(X1)X1.llm_calls+=v0.llm_calls,X1.tool_calls+=v0.tool_calls,X1.errors+=v0.errors,X1.input_tokens+=v0.input_tokens,X1.output_tokens+=v0.output_tokens;else d.set(P0.agent_id,{agent_id:P0.agent_id,llm_calls:v0.llm_calls,tool_calls:v0.tool_calls,errors:v0.errors,input_tokens:v0.input_tokens,output_tokens:v0.output_tokens})}return Array.from(d.values())},[k,Y]),X0=E4.default.useMemo(()=>{let d=Y;if(G!==null)d=d.filter((r0)=>t.has(r0.agent_id));if(b.agent_id)d=d.filter((r0)=>r0.agent_id===b.agent_id);if(f.size>0)d=d.filter((r0)=>!f.has(r0.category));if(b.level)d=d.filter((r0)=>r0.level===b.level);let P0=L;if(f.size>0)P0=P0.filter((r0)=>!f.has(r0.category));let v0=new Set(d.map((r0)=>r0.id)),X1=[...d];for(let r0 of P0)if(!v0.has(r0.id))X1.push(r0),v0.add(r0.id);return X1.sort((r0,V0)=>new Date(V0.timestamp).getTime()-new Date(r0.timestamp).getTime()),X1.slice(0,100)},[Y,L,b,f,G,t]);E4.useEffect(()=>{let d=[];for(let P0 of Y)if(!J0.current.has(P0.id))J0.current.add(P0.id),d.push(P0.id);if(d.length>0)r((P0)=>{let v0=new Set(P0);return d.forEach((X1)=>v0.add(X1)),v0}),setTimeout(()=>{r((P0)=>{let v0=new Set(P0);return d.forEach((X1)=>v0.delete(X1)),v0})},5000)},[Y]);let I0=(d)=>{return V.find((v0)=>v0.id===d)?.name||d},F0=(d)=>{if(d>=1e6)return(d/1e6).toFixed(1)+"M";if(d>=1000)return(d/1000).toFixed(1)+"K";return d.toString()},Q1={debug:"text-[#555]",info:"text-blue-400",warn:"text-yellow-400",error:"text-red-400"},O1={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"},Q0=["LLM","TOOL","CHAT","TASK","MEMORY","MCP","SYSTEM","DATABASE","ERROR"],U0=(d)=>{E((P0)=>{let v0=new Set(P0);if(v0.has(d))v0.delete(d);else v0.add(d);return v0})},_0=[{value:"",label:"All Agents"},...i.map((d)=>({value:d.id,label:d.name}))],Z0=[{value:"",label:"All Levels"},{value:"debug",label:"Debug"},{value:"info",label:"Info"},{value:"warn",label:"Warn"},{value:"error",label:"Error"}];return x0.jsxDEV("div",{className:"flex-1 overflow-auto p-6",children:x0.jsxDEV("div",{children:[x0.jsxDEV("div",{className:"mb-6",children:[x0.jsxDEV("div",{className:"flex items-center gap-3 mb-1",children:[U&&x0.jsxDEV("span",{className:"w-3 h-3 rounded-full",style:{backgroundColor:U.color}},void 0,!1,void 0,this),x0.jsxDEV("h1",{className:"text-2xl font-semibold",children:G===null?"Telemetry":G==="unassigned"?"Telemetry - Unassigned":`Telemetry - ${U?.name||""}`},void 0,!1,void 0,this)]},void 0,!0,void 0,this),x0.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),j&&x0.jsxDEV("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-4 mb-6",children:[x0.jsxDEV(uQ,{label:"Events",value:F0(j.total_events)},void 0,!1,void 0,this),x0.jsxDEV(uQ,{label:"LLM Calls",value:F0(j.total_llm_calls)},void 0,!1,void 0,this),x0.jsxDEV(uQ,{label:"Tool Calls",value:F0(j.total_tool_calls)},void 0,!1,void 0,this),x0.jsxDEV(uQ,{label:"Errors",value:F0(j.total_errors),color:"red"},void 0,!1,void 0,this),x0.jsxDEV(uQ,{label:"Input Tokens",value:F0(j.total_input_tokens)},void 0,!1,void 0,this),x0.jsxDEV(uQ,{label:"Output Tokens",value:F0(j.total_output_tokens)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),c.length>0&&x0.jsxDEV("div",{className:"mb-6",children:[x0.jsxDEV("h2",{className:"text-lg font-medium mb-3",children:"Usage by Agent"},void 0,!1,void 0,this),x0.jsxDEV("div",{className:"bg-[#111] border border-[#1a1a1a] rounded-lg overflow-hidden",children:x0.jsxDEV("table",{className:"w-full text-sm",children:[x0.jsxDEV("thead",{children:x0.jsxDEV("tr",{className:"border-b border-[#1a1a1a] text-[#666]",children:[x0.jsxDEV("th",{className:"text-left p-3",children:"Agent"},void 0,!1,void 0,this),x0.jsxDEV("th",{className:"text-right p-3",children:"LLM Calls"},void 0,!1,void 0,this),x0.jsxDEV("th",{className:"text-right p-3",children:"Tool Calls"},void 0,!1,void 0,this),x0.jsxDEV("th",{className:"text-right p-3",children:"Input Tokens"},void 0,!1,void 0,this),x0.jsxDEV("th",{className:"text-right p-3",children:"Output Tokens"},void 0,!1,void 0,this),x0.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),x0.jsxDEV("tbody",{children:c.map((d)=>x0.jsxDEV("tr",{className:"border-b border-[#1a1a1a] last:border-0",children:[x0.jsxDEV("td",{className:"p-3 font-medium",children:I0(d.agent_id)},void 0,!1,void 0,this),x0.jsxDEV("td",{className:"p-3 text-right text-[#888]",children:F0(d.llm_calls)},void 0,!1,void 0,this),x0.jsxDEV("td",{className:"p-3 text-right text-[#888]",children:F0(d.tool_calls)},void 0,!1,void 0,this),x0.jsxDEV("td",{className:"p-3 text-right text-[#888]",children:F0(d.input_tokens)},void 0,!1,void 0,this),x0.jsxDEV("td",{className:"p-3 text-right text-[#888]",children:F0(d.output_tokens)},void 0,!1,void 0,this),x0.jsxDEV("td",{className:"p-3 text-right",children:d.errors>0?x0.jsxDEV("span",{className:"text-red-400",children:d.errors},void 0,!1,void 0,this):x0.jsxDEV("span",{className:"text-[#444]",children:"0"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},d.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),x0.jsxDEV("div",{className:"flex flex-wrap items-center gap-3 mb-4",children:[x0.jsxDEV("div",{className:"w-44",children:x0.jsxDEV(V6,{value:b.agent_id,options:_0,onChange:(d)=>C({...b,agent_id:d}),placeholder:"All Agents"},void 0,!1,void 0,this)},void 0,!1,void 0,this),x0.jsxDEV("div",{className:"flex flex-wrap items-center gap-1.5 flex-1",children:Q0.map((d)=>{let P0=f.has(d),v0=O1[d]||"bg-[#222] text-[#888] border-[#333]";return x0.jsxDEV("button",{onClick:()=>U0(d),className:`px-2 py-0.5 rounded text-xs border transition-all ${P0?"bg-[#1a1a1a] text-[#555] border-[#333] opacity-50":v0}`,children:d},d,!1,void 0,this)})},void 0,!1,void 0,this),x0.jsxDEV("div",{className:"flex items-center gap-2",children:[x0.jsxDEV("div",{className:"w-36",children:x0.jsxDEV(V6,{value:b.level,options:Z0,onChange:(d)=>C({...b,level:d}),placeholder:"All Levels"},void 0,!1,void 0,this)},void 0,!1,void 0,this),x0.jsxDEV("button",{onClick:l,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),x0.jsxDEV("div",{className:"bg-[#111] border border-[#1a1a1a] rounded-lg",children:[x0.jsxDEV("div",{className:"p-3 border-b border-[#1a1a1a] flex items-center justify-between",children:[x0.jsxDEV("h2",{className:"font-medium",children:"Recent Events"},void 0,!1,void 0,this),Y.length>0&&x0.jsxDEV("span",{className:"text-xs text-[#666]",children:[Y.length," new"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),F&&X0.length===0?x0.jsxDEV("div",{className:"p-8 text-center text-[#666]",children:"Loading..."},void 0,!1,void 0,this):X0.length===0?x0.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):x0.jsxDEV("div",{className:"divide-y divide-[#1a1a1a]",children:X0.map((d)=>{let P0=p.has(d.id);return x0.jsxDEV("div",{className:`p-3 hover:bg-[#0a0a0a] cursor-pointer transition-all duration-500 ${P0?"bg-green-500/5":""}`,style:{animation:P0?"slideIn 0.3s ease-out":void 0},onClick:()=>D(T===d.id?null:d.id),children:x0.jsxDEV("div",{className:"flex items-start gap-3",children:[x0.jsxDEV("span",{className:`px-2 py-0.5 rounded text-xs border transition-colors duration-300 ${O1[d.category]||"bg-[#222] text-[#888] border-[#333]"}`,children:d.category},void 0,!1,void 0,this),x0.jsxDEV("div",{className:"flex-1 min-w-0",children:[x0.jsxDEV("div",{className:"flex items-center gap-2",children:[x0.jsxDEV("span",{className:"font-medium text-sm",children:d.type},void 0,!1,void 0,this),x0.jsxDEV("span",{className:`text-xs ${Q1[d.level]||"text-[#666]"}`,children:d.level},void 0,!1,void 0,this),d.duration_ms&&x0.jsxDEV("span",{className:"text-xs text-[#555]",children:[d.duration_ms,"ms"]},void 0,!0,void 0,this),x0.jsxDEV("span",{className:`w-1.5 h-1.5 rounded-full bg-green-400 transition-opacity duration-1000 ${P0?"opacity-100":"opacity-0"}`},void 0,!1,void 0,this)]},void 0,!0,void 0,this),x0.jsxDEV("div",{className:"text-xs text-[#555] mt-1",children:[I0(d.agent_id)," · ",new Date(d.timestamp).toLocaleString()]},void 0,!0,void 0,this),d.error&&x0.jsxDEV("div",{className:"text-xs text-red-400 mt-1 font-mono",children:d.error},void 0,!1,void 0,this),T===d.id&&d.data&&Object.keys(d.data).length>0&&x0.jsxDEV("pre",{className:"text-xs text-[#666] mt-2 p-2 bg-[#0a0a0a] rounded overflow-x-auto",children:JSON.stringify(d.data,null,2)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},d.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 uQ({label:Y,value:G,color:U}){return x0.jsxDEV("div",{className:"bg-[#111] border border-[#1a1a1a] rounded-lg p-4",children:[x0.jsxDEV("div",{className:"text-[#666] text-xs mb-1",children:Y},void 0,!1,void 0,this),x0.jsxDEV("div",{className:`text-2xl font-semibold ${U==="red"?"text-red-400":""}`,children:G},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}var y8=q0(I1(),1);var j0=q0(Z1(),1),Jk={get:"#61affe",post:"#49cc90",put:"#fca130",delete:"#f93e3e",patch:"#50e3c2"};function WW(){let{authFetch:Y}=k1(),[G,U]=y8.useState(null),[W,q]=y8.useState(!0),[R,L]=y8.useState(new Set),[_,k]=y8.useState(null),[I,F]=y8.useState(!1);y8.useEffect(()=>{C()},[]);async function w(){if(!G)return;try{await navigator.clipboard.writeText(JSON.stringify(G,null,2)),F(!0),setTimeout(()=>F(!1),2000)}catch(p){console.error("Failed to copy:",p)}}function b(){if(!G)return;let p=new Blob([JSON.stringify(G,null,2)],{type:"application/json"}),r=URL.createObjectURL(p),J0=document.createElement("a");J0.href=r,J0.download="apteva-openapi.json",J0.click(),URL.revokeObjectURL(r)}async function C(){try{let p=await Y("/api/openapi");if(p.ok){let r=await p.json();U(r)}}catch(p){console.error("Failed to load OpenAPI spec:",p)}finally{q(!1)}}function f(p){L((r)=>{let J0=new Set(r);if(J0.has(p))J0.delete(p);else J0.add(p);return J0})}function E(p,r=0){if(!p)return"{}";if(r>2)return"...";if(p.$ref)return p.$ref.split("/").pop()||"Object";if(p.type==="array")return`${E(p.items,r+1)}[]`;if(p.type==="object"&&p.properties){let J0=Object.entries(p.properties).slice(0,3).map(([t,l])=>`${t}: ${l.type||"any"}`).join(", "),i=Object.keys(p.properties).length>3?", ...":"";return`{ ${J0}${i} }`}return p.type||"any"}if(W)return j0.jsxDEV("div",{style:{padding:24},children:j0.jsxDEV("p",{style:{color:"#888"},children:"Loading API documentation..."},void 0,!1,void 0,this)},void 0,!1,void 0,this);if(!G)return j0.jsxDEV("div",{style:{padding:24},children:j0.jsxDEV("p",{style:{color:"#f66"},children:"Failed to load API documentation"},void 0,!1,void 0,this)},void 0,!1,void 0,this);let V=G.tags||[],v=Object.entries(G.paths);function T(p){let r=new Set;function J0(i){if(!i)return;if(typeof i==="object"){if(i.$ref){let t=i.$ref.split("/").pop();if(t)r.add(t)}for(let t of Object.values(i))J0(t)}}return J0(p.requestBody),J0(p.responses),r}function D(){if(!_||!G.components?.schemas)return Object.keys(G.components?.schemas||{});let p=new Set;for(let[r,J0]of n)for(let[i,t]of Object.entries(J0)){if(!["get","post","put","delete","patch"].includes(i))continue;if(t.tags?.includes(_))T(t).forEach((j)=>p.add(j))}return Array.from(p)}let n=_?v.filter(([p,r])=>Object.values(r).some((J0)=>J0.tags?.includes(_))):v;return j0.jsxDEV("div",{style:{padding:24,maxWidth:1000,height:"100%",overflowY:"auto"},children:[j0.jsxDEV("div",{style:{marginBottom:24},children:[j0.jsxDEV("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",marginBottom:8},children:[j0.jsxDEV("h1",{style:{fontSize:24,fontWeight:600},children:G.info.title},void 0,!1,void 0,this),j0.jsxDEV("div",{style:{display:"flex",gap:8},children:[j0.jsxDEV("button",{onClick:w,style:{padding:"8px 16px",borderRadius:4,border:"1px solid #333",background:I?"#49cc90":"#1a1a2e",color:I?"#000":"#fff",cursor:"pointer",fontSize:12,fontFamily:"inherit"},children:I?"Copied!":"Copy JSON"},void 0,!1,void 0,this),j0.jsxDEV("button",{onClick:b,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),j0.jsxDEV("p",{style:{color:"#888",marginBottom:8},children:G.info.description.split(`
225
+ `)[0]},void 0,!1,void 0,this),j0.jsxDEV("p",{style:{color:"#666",fontSize:12},children:["Version: ",G.info.version]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),j0.jsxDEV("div",{style:{background:"#1a1a2e",padding:12,borderRadius:6,marginBottom:24,fontFamily:"monospace"},children:[j0.jsxDEV("span",{style:{color:"#888"},children:"Base URL: "},void 0,!1,void 0,this),j0.jsxDEV("span",{style:{color:"#61affe"},children:[window.location.origin,"/api"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),j0.jsxDEV("div",{style:{marginBottom:24,display:"flex",flexWrap:"wrap",gap:8},children:[j0.jsxDEV("button",{onClick:()=>k(null),style:{padding:"6px 12px",borderRadius:4,border:"1px solid #333",background:_===null?"#333":"transparent",color:_===null?"#fff":"#888",cursor:"pointer",fontSize:12},children:"All"},void 0,!1,void 0,this),V.map((p)=>j0.jsxDEV("button",{onClick:()=>k(p.name),style:{padding:"6px 12px",borderRadius:4,border:"1px solid #333",background:_===p.name?"#333":"transparent",color:_===p.name?"#fff":"#888",cursor:"pointer",fontSize:12},title:p.description,children:p.name},p.name,!1,void 0,this))]},void 0,!0,void 0,this),j0.jsxDEV("div",{style:{display:"flex",flexDirection:"column",gap:8},children:n.map(([p,r])=>Object.entries(r).filter(([J0])=>["get","post","put","delete","patch"].includes(J0)).map(([J0,i])=>{let t=`${J0}:${p}`,l=R.has(t),j=J0.toUpperCase(),c=Jk[J0]||"#888";return j0.jsxDEV("div",{style:{border:"1px solid #333",borderRadius:6,overflow:"hidden"},children:[j0.jsxDEV("div",{onClick:()=>f(t),style:{display:"flex",alignItems:"center",gap:12,padding:"12px 16px",background:l?"#1a1a2e":"transparent",cursor:"pointer"},children:[j0.jsxDEV("span",{style:{background:c,color:"#000",padding:"4px 8px",borderRadius:4,fontSize:11,fontWeight:600,minWidth:60,textAlign:"center"},children:j},void 0,!1,void 0,this),j0.jsxDEV("span",{style:{fontFamily:"monospace",color:"#fff"},children:p},void 0,!1,void 0,this),j0.jsxDEV("span",{style:{color:"#888",flex:1,fontSize:13},children:i.summary},void 0,!1,void 0,this),j0.jsxDEV("span",{style:{color:"#666",fontSize:12},children:l?"[-]":"[+]"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),l&&j0.jsxDEV("div",{style:{padding:16,background:"#0d0d1a",borderTop:"1px solid #333"},children:[i.description&&j0.jsxDEV("p",{style:{color:"#888",marginBottom:16,fontSize:13},children:i.description},void 0,!1,void 0,this),i.parameters&&i.parameters.length>0&&j0.jsxDEV("div",{style:{marginBottom:16},children:[j0.jsxDEV("h4",{style:{fontSize:13,color:"#888",marginBottom:8},children:"Parameters"},void 0,!1,void 0,this),j0.jsxDEV("div",{style:{background:"#1a1a2e",borderRadius:4,padding:12},children:i.parameters.map((X0)=>j0.jsxDEV("div",{style:{display:"flex",gap:12,marginBottom:8,fontSize:12},children:[j0.jsxDEV("span",{style:{color:"#61affe",minWidth:100},children:[X0.name,X0.required&&j0.jsxDEV("span",{style:{color:"#f66"},children:"*"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),j0.jsxDEV("span",{style:{color:"#666"},children:["(",X0.in,")"]},void 0,!0,void 0,this),j0.jsxDEV("span",{style:{color:"#888"},children:X0.schema?.type||"string"},void 0,!1,void 0,this),X0.description&&j0.jsxDEV("span",{style:{color:"#666"},children:["- ",X0.description]},void 0,!0,void 0,this)]},X0.name,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),i.requestBody&&j0.jsxDEV("div",{style:{marginBottom:16},children:[j0.jsxDEV("h4",{style:{fontSize:13,color:"#888",marginBottom:8},children:["Request Body",i.requestBody.required&&j0.jsxDEV("span",{style:{color:"#f66"},children:" (required)"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),j0.jsxDEV("div",{style:{background:"#1a1a2e",borderRadius:4,padding:12,fontFamily:"monospace",fontSize:12,color:"#49cc90"},children:Object.entries(i.requestBody.content||{}).map(([X0,I0])=>j0.jsxDEV("div",{children:[j0.jsxDEV("span",{style:{color:"#666"},children:[X0,": "]},void 0,!0,void 0,this),E(I0.schema)]},X0,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),i.responses&&j0.jsxDEV("div",{children:[j0.jsxDEV("h4",{style:{fontSize:13,color:"#888",marginBottom:8},children:"Responses"},void 0,!1,void 0,this),j0.jsxDEV("div",{style:{background:"#1a1a2e",borderRadius:4,padding:12},children:Object.entries(i.responses).map(([X0,I0])=>{let F0=I0.content?.["application/json"]?.schema,Q1=F0?.$ref?.split("/").pop(),O1=F0?.type,Q0=F0?.items?.$ref?.split("/").pop();return j0.jsxDEV("div",{style:{marginBottom:12,fontSize:12},children:[j0.jsxDEV("div",{style:{display:"flex",gap:12,marginBottom:4},children:[j0.jsxDEV("span",{style:{color:X0.startsWith("2")?"#49cc90":"#f66",minWidth:40},children:X0},void 0,!1,void 0,this),j0.jsxDEV("span",{style:{color:"#888"},children:I0.description},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F0&&j0.jsxDEV("div",{style:{marginLeft:52,padding:"8px 12px",background:"#0d0d1a",borderRadius:4,fontFamily:"monospace"},children:Q1?j0.jsxDEV("span",{style:{color:"#61affe"},children:Q1},void 0,!1,void 0,this):O1==="array"&&Q0?j0.jsxDEV("span",{style:{color:"#61affe"},children:[Q0,"[]"]},void 0,!0,void 0,this):O1==="array"?j0.jsxDEV("span",{style:{color:"#888"},children:"array"},void 0,!1,void 0,this):j0.jsxDEV("span",{style:{color:"#888"},children:E(F0)},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},X0,!0,void 0,this)})},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},t,!0,void 0,this)}))},void 0,!1,void 0,this),G.components?.schemas&&D().length>0&&j0.jsxDEV("div",{style:{marginTop:32},children:[j0.jsxDEV("h2",{style:{fontSize:18,fontWeight:600,marginBottom:16},children:["Schemas ",_&&j0.jsxDEV("span",{style:{color:"#666",fontSize:14},children:["(",_,")"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),j0.jsxDEV("div",{style:{display:"flex",flexDirection:"column",gap:8},children:D().map((p)=>{let r=G.components.schemas[p];if(!r)return null;return j0.jsxDEV("div",{style:{border:"1px solid #333",borderRadius:6,padding:12},children:[j0.jsxDEV("h3",{style:{fontSize:14,color:"#61affe",marginBottom:8},children:p},void 0,!1,void 0,this),r.properties&&j0.jsxDEV("div",{style:{fontSize:12},children:Object.entries(r.properties).map(([J0,i])=>j0.jsxDEV("div",{style:{display:"flex",gap:8,marginBottom:4,fontFamily:"monospace"},children:[j0.jsxDEV("span",{style:{color:"#fff",minWidth:120},children:J0},void 0,!1,void 0,this),j0.jsxDEV("span",{style:{color:"#888"},children:[i.type||(i.$ref?i.$ref.split("/").pop():"any"),i.nullable&&" | null"]},void 0,!0,void 0,this),i.enum&&j0.jsxDEV("span",{style:{color:"#666"},children:["[",i.enum.join(" | "),"]"]},void 0,!0,void 0,this)]},J0,!0,void 0,this))},void 0,!1,void 0,this)]},p,!0,void 0,this)})},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}var O4=q0(Z1(),1);function Yk(){let{isAuthenticated:Y,isLoading:G,hasUsers:U,accessToken:W,checkAuth:q}=k1(),{refreshProjects:R}=g4(),{isComplete:L,setIsComplete:_}=g9(),k=()=>{return W?{Authorization:`Bearer ${W}`}:{}},I=Y&&L===!0,{agents:F,loading:w,runningCount:b,fetchAgents:C,createAgent:f,updateAgent:E,deleteAgent:V,toggleAgent:v}=m9(I),{providers:T,configuredProviders:D,fetchProviders:n}=u9(I),p=D.filter((V0)=>V0.type==="llm"),[r,J0]=V5.useState(!1),[i,t]=V5.useState(null),[l,j]=V5.useState("dashboard"),[c,X0]=V5.useState(null),[I0,F0]=V5.useState(0),[Q1,O1]=V5.useState(!1);V5.useEffect(()=>{if(!I)return;let V0=async()=>{try{let L0=await fetch("/api/tasks?status=pending",{headers:k()});if(L0.ok){let a0=await L0.json();F0(a0.count||0)}}catch{}};V0();let $1=setInterval(V0,15000);return()=>clearInterval($1)},[I,W]);let[Q0,U0]=V5.useState({name:"",model:"",provider:"",systemPrompt:"You are a helpful assistant.",features:{...f9},mcpServers:[],skills:[]});V5.useEffect(()=>{if(p.length>0&&!Q0.provider){let V0=p[0],$1=V0.models.find((L0)=>L0.recommended)?.value||V0.models[0]?.value||"";U0((L0)=>({...L0,provider:V0.id,model:$1}))}},[p,Q0.provider]),V5.useEffect(()=>{if(i){let V0=F.find(($1)=>$1.id===i.id);if(V0)t(V0);else t(null)}},[F,i]);let _0=(V0)=>{let $1=T.find((a0)=>a0.id===V0),L0=$1?.models.find((a0)=>a0.recommended)?.value||$1?.models[0]?.value||"";U0((a0)=>({...a0,provider:V0,model:L0}))},Z0=async()=>{if(!Q0.name)return;await f(Q0),await R();let V0=p[0],$1=V0?.models.find((L0)=>L0.recommended)?.value||V0?.models[0]?.value||"";U0({name:"",model:$1,provider:V0?.id||"",systemPrompt:"You are a helpful assistant.",features:{...f9},mcpServers:[],skills:[]}),J0(!1)},d=async(V0,$1)=>{$1?.stopPropagation(),X0(null);let L0=await v(V0);if(L0.error)X0(L0.error)},P0=async(V0,$1)=>{if($1?.stopPropagation(),i?.id===V0)t(null);await V(V0),await R()},v0=(V0)=>{t(V0),X0(null),j("agents")},X1=(V0)=>{j(V0),t(null)},r0=()=>{_(!0),n(),q()};if(G||U===null)return O4.jsxDEV(wz,{fullScreen:!0},void 0,!1,void 0,this);if(!U)return O4.jsxDEV(uZ,{onComplete:r0,needsAccount:!0},void 0,!1,void 0,this);if(!Y)return O4.jsxDEV(O3,{},void 0,!1,void 0,this);if(L===null)return O4.jsxDEV(wz,{fullScreen:!0},void 0,!1,void 0,this);if(!L)return O4.jsxDEV(uZ,{onComplete:r0,needsAccount:!1},void 0,!1,void 0,this);return O4.jsxDEV("div",{className:"h-screen bg-[#0a0a0a] text-[#e0e0e0] font-mono flex flex-col overflow-hidden",children:[O4.jsxDEV(B3,{onMenuClick:()=>O1(!0)},void 0,!1,void 0,this),c&&O4.jsxDEV(K3,{message:c,onDismiss:()=>X0(null)},void 0,!1,void 0,this),O4.jsxDEV("div",{className:"flex flex-1 overflow-hidden",children:[O4.jsxDEV(U3,{route:l,agentCount:F.length,taskCount:I0,onNavigate:X1,isOpen:Q1,onClose:()=>O1(!1)},void 0,!1,void 0,this),O4.jsxDEV("main",{className:"flex-1 overflow-hidden flex",children:[l==="settings"&&O4.jsxDEV(L3,{},void 0,!1,void 0,this),l==="agents"&&O4.jsxDEV(w3,{agents:F,loading:w,selectedAgent:i,providers:T,onSelectAgent:v0,onCloseAgent:()=>t(null),onToggleAgent:d,onDeleteAgent:P0,onUpdateAgent:E,onNewAgent:()=>J0(!0),canCreateAgent:p.length>0},void 0,!1,void 0,this),l==="dashboard"&&O4.jsxDEV(F3,{agents:F,loading:w,runningCount:b,configuredProviders:D,onNavigate:X1,onSelectAgent:v0},void 0,!1,void 0,this),l==="tasks"&&O4.jsxDEV(M3,{},void 0,!1,void 0,this),l==="mcp"&&O4.jsxDEV(P3,{},void 0,!1,void 0,this),l==="skills"&&O4.jsxDEV(X2,{},void 0,!1,void 0,this),l==="telemetry"&&O4.jsxDEV(Z2,{},void 0,!1,void 0,this),l==="api"&&O4.jsxDEV(WW,{},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),r&&O4.jsxDEV(R3,{form:Q0,providers:T,configuredProviders:D,onFormChange:U0,onProviderChange:_0,onCreate:Z0,onClose:()=>J0(!1),onGoToSettings:()=>{J0(!1),j("settings")}},void 0,!1,void 0,this),O4.jsxDEV(YW,{},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function $k(){return O4.jsxDEV(V9,{children:O4.jsxDEV(E9,{children:O4.jsxDEV(ZW,{children:O4.jsxDEV(y9,{children:O4.jsxDEV(Yk,{},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 Hk=LW.createRoot(document.getElementById("root"));Hk.render(O4.jsxDEV($k,{},void 0,!1,void 0,this));
226
+
227
+ //# debugId=5EDD3FB67336537664756E2164756E21