@must-b/must-b 1.72.20 → 1.72.21

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.
@@ -6,7 +6,7 @@ function xb(e,t){for(var n=0;n<t.length;n++){const s=t[n];if(typeof s!="string"&
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var ua=Symbol.for("react.element"),yb=Symbol.for("react.portal"),vb=Symbol.for("react.fragment"),bb=Symbol.for("react.strict_mode"),wb=Symbol.for("react.profiler"),kb=Symbol.for("react.provider"),jb=Symbol.for("react.context"),Nb=Symbol.for("react.forward_ref"),Sb=Symbol.for("react.suspense"),Cb=Symbol.for("react.memo"),Eb=Symbol.for("react.lazy"),kf=Symbol.iterator;function _b(e){return e===null||typeof e!="object"?null:(e=kf&&e[kf]||e["@@iterator"],typeof e=="function"?e:null)}var tg={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},ng=Object.assign,sg={};function Br(e,t,n){this.props=e,this.context=t,this.refs=sg,this.updater=n||tg}Br.prototype.isReactComponent={};Br.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=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,e,t,"setState")};Br.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function rg(){}rg.prototype=Br.prototype;function bd(e,t,n){this.props=e,this.context=t,this.refs=sg,this.updater=n||tg}var wd=bd.prototype=new rg;wd.constructor=bd;ng(wd,Br.prototype);wd.isPureReactComponent=!0;var jf=Array.isArray,ig=Object.prototype.hasOwnProperty,kd={current:null},ag={key:!0,ref:!0,__self:!0,__source:!0};function og(e,t,n){var s,i={},a=null,o=null;if(t!=null)for(s in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(a=""+t.key),t)ig.call(t,s)&&!ag.hasOwnProperty(s)&&(i[s]=t[s]);var l=arguments.length-2;if(l===1)i.children=n;else if(1<l){for(var c=Array(l),u=0;u<l;u++)c[u]=arguments[u+2];i.children=c}if(e&&e.defaultProps)for(s in l=e.defaultProps,l)i[s]===void 0&&(i[s]=l[s]);return{$$typeof:ua,type:e,key:a,ref:o,props:i,_owner:kd.current}}function Tb(e,t){return{$$typeof:ua,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function jd(e){return typeof e=="object"&&e!==null&&e.$$typeof===ua}function Pb(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Nf=/\/+/g;function Wl(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Pb(""+e.key):t.toString(36)}function so(e,t,n,s,i){var a=typeof e;(a==="undefined"||a==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(a){case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case ua:case yb:o=!0}}if(o)return o=e,i=i(o),e=s===""?"."+Wl(o,0):s,jf(i)?(n="",e!=null&&(n=e.replace(Nf,"$&/")+"/"),so(i,t,n,"",function(u){return u})):i!=null&&(jd(i)&&(i=Tb(i,n+(!i.key||o&&o.key===i.key?"":(""+i.key).replace(Nf,"$&/")+"/")+e)),t.push(i)),1;if(o=0,s=s===""?".":s+":",jf(e))for(var l=0;l<e.length;l++){a=e[l];var c=s+Wl(a,l);o+=so(a,t,n,c,i)}else if(c=_b(e),typeof c=="function")for(e=c.call(e),l=0;!(a=e.next()).done;)a=a.value,c=s+Wl(a,l++),o+=so(a,t,n,c,i);else if(a==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return o}function Na(e,t,n){if(e==null)return e;var s=[],i=0;return so(e,s,"","",function(a){return t.call(n,a,i++)}),s}function Mb(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var rt={current:null},ro={transition:null},Ab={ReactCurrentDispatcher:rt,ReactCurrentBatchConfig:ro,ReactCurrentOwner:kd};function lg(){throw Error("act(...) is not supported in production builds of React.")}ie.Children={map:Na,forEach:function(e,t,n){Na(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Na(e,function(){t++}),t},toArray:function(e){return Na(e,function(t){return t})||[]},only:function(e){if(!jd(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};ie.Component=Br;ie.Fragment=vb;ie.Profiler=wb;ie.PureComponent=bd;ie.StrictMode=bb;ie.Suspense=Sb;ie.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Ab;ie.act=lg;ie.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var s=ng({},e.props),i=e.key,a=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(a=t.ref,o=kd.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(c in t)ig.call(t,c)&&!ag.hasOwnProperty(c)&&(s[c]=t[c]===void 0&&l!==void 0?l[c]:t[c])}var c=arguments.length-2;if(c===1)s.children=n;else if(1<c){l=Array(c);for(var u=0;u<c;u++)l[u]=arguments[u+2];s.children=l}return{$$typeof:ua,type:e.type,key:i,ref:a,props:s,_owner:o}};ie.createContext=function(e){return e={$$typeof:jb,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:kb,_context:e},e.Consumer=e};ie.createElement=og;ie.createFactory=function(e){var t=og.bind(null,e);return t.type=e,t};ie.createRef=function(){return{current:null}};ie.forwardRef=function(e){return{$$typeof:Nb,render:e}};ie.isValidElement=jd;ie.lazy=function(e){return{$$typeof:Eb,_payload:{_status:-1,_result:e},_init:Mb}};ie.memo=function(e,t){return{$$typeof:Cb,type:e,compare:t===void 0?null:t}};ie.startTransition=function(e){var t=ro.transition;ro.transition={};try{e()}finally{ro.transition=t}};ie.unstable_act=lg;ie.useCallback=function(e,t){return rt.current.useCallback(e,t)};ie.useContext=function(e){return rt.current.useContext(e)};ie.useDebugValue=function(){};ie.useDeferredValue=function(e){return rt.current.useDeferredValue(e)};ie.useEffect=function(e,t){return rt.current.useEffect(e,t)};ie.useId=function(){return rt.current.useId()};ie.useImperativeHandle=function(e,t,n){return rt.current.useImperativeHandle(e,t,n)};ie.useInsertionEffect=function(e,t){return rt.current.useInsertionEffect(e,t)};ie.useLayoutEffect=function(e,t){return rt.current.useLayoutEffect(e,t)};ie.useMemo=function(e,t){return rt.current.useMemo(e,t)};ie.useReducer=function(e,t,n){return rt.current.useReducer(e,t,n)};ie.useRef=function(e){return rt.current.useRef(e)};ie.useState=function(e){return rt.current.useState(e)};ie.useSyncExternalStore=function(e,t,n){return rt.current.useSyncExternalStore(e,t,n)};ie.useTransition=function(){return rt.current.useTransition()};ie.version="18.3.1";eg.exports=ie;var h=eg.exports;const W=J0(h),Nd=xb({__proto__:null,default:W},[h]);/**
9
+ */var ua=Symbol.for("react.element"),yb=Symbol.for("react.portal"),vb=Symbol.for("react.fragment"),bb=Symbol.for("react.strict_mode"),wb=Symbol.for("react.profiler"),kb=Symbol.for("react.provider"),jb=Symbol.for("react.context"),Nb=Symbol.for("react.forward_ref"),Sb=Symbol.for("react.suspense"),Cb=Symbol.for("react.memo"),Eb=Symbol.for("react.lazy"),kf=Symbol.iterator;function _b(e){return e===null||typeof e!="object"?null:(e=kf&&e[kf]||e["@@iterator"],typeof e=="function"?e:null)}var tg={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},ng=Object.assign,sg={};function Fr(e,t,n){this.props=e,this.context=t,this.refs=sg,this.updater=n||tg}Fr.prototype.isReactComponent={};Fr.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=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,e,t,"setState")};Fr.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function rg(){}rg.prototype=Fr.prototype;function bd(e,t,n){this.props=e,this.context=t,this.refs=sg,this.updater=n||tg}var wd=bd.prototype=new rg;wd.constructor=bd;ng(wd,Fr.prototype);wd.isPureReactComponent=!0;var jf=Array.isArray,ig=Object.prototype.hasOwnProperty,kd={current:null},ag={key:!0,ref:!0,__self:!0,__source:!0};function og(e,t,n){var s,i={},a=null,o=null;if(t!=null)for(s in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(a=""+t.key),t)ig.call(t,s)&&!ag.hasOwnProperty(s)&&(i[s]=t[s]);var l=arguments.length-2;if(l===1)i.children=n;else if(1<l){for(var c=Array(l),u=0;u<l;u++)c[u]=arguments[u+2];i.children=c}if(e&&e.defaultProps)for(s in l=e.defaultProps,l)i[s]===void 0&&(i[s]=l[s]);return{$$typeof:ua,type:e,key:a,ref:o,props:i,_owner:kd.current}}function Tb(e,t){return{$$typeof:ua,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function jd(e){return typeof e=="object"&&e!==null&&e.$$typeof===ua}function Pb(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Nf=/\/+/g;function Wl(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Pb(""+e.key):t.toString(36)}function so(e,t,n,s,i){var a=typeof e;(a==="undefined"||a==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(a){case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case ua:case yb:o=!0}}if(o)return o=e,i=i(o),e=s===""?"."+Wl(o,0):s,jf(i)?(n="",e!=null&&(n=e.replace(Nf,"$&/")+"/"),so(i,t,n,"",function(u){return u})):i!=null&&(jd(i)&&(i=Tb(i,n+(!i.key||o&&o.key===i.key?"":(""+i.key).replace(Nf,"$&/")+"/")+e)),t.push(i)),1;if(o=0,s=s===""?".":s+":",jf(e))for(var l=0;l<e.length;l++){a=e[l];var c=s+Wl(a,l);o+=so(a,t,n,c,i)}else if(c=_b(e),typeof c=="function")for(e=c.call(e),l=0;!(a=e.next()).done;)a=a.value,c=s+Wl(a,l++),o+=so(a,t,n,c,i);else if(a==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return o}function Na(e,t,n){if(e==null)return e;var s=[],i=0;return so(e,s,"","",function(a){return t.call(n,a,i++)}),s}function Ab(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var rt={current:null},ro={transition:null},Mb={ReactCurrentDispatcher:rt,ReactCurrentBatchConfig:ro,ReactCurrentOwner:kd};function lg(){throw Error("act(...) is not supported in production builds of React.")}ie.Children={map:Na,forEach:function(e,t,n){Na(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Na(e,function(){t++}),t},toArray:function(e){return Na(e,function(t){return t})||[]},only:function(e){if(!jd(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};ie.Component=Fr;ie.Fragment=vb;ie.Profiler=wb;ie.PureComponent=bd;ie.StrictMode=bb;ie.Suspense=Sb;ie.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Mb;ie.act=lg;ie.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var s=ng({},e.props),i=e.key,a=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(a=t.ref,o=kd.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(c in t)ig.call(t,c)&&!ag.hasOwnProperty(c)&&(s[c]=t[c]===void 0&&l!==void 0?l[c]:t[c])}var c=arguments.length-2;if(c===1)s.children=n;else if(1<c){l=Array(c);for(var u=0;u<c;u++)l[u]=arguments[u+2];s.children=l}return{$$typeof:ua,type:e.type,key:i,ref:a,props:s,_owner:o}};ie.createContext=function(e){return e={$$typeof:jb,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:kb,_context:e},e.Consumer=e};ie.createElement=og;ie.createFactory=function(e){var t=og.bind(null,e);return t.type=e,t};ie.createRef=function(){return{current:null}};ie.forwardRef=function(e){return{$$typeof:Nb,render:e}};ie.isValidElement=jd;ie.lazy=function(e){return{$$typeof:Eb,_payload:{_status:-1,_result:e},_init:Ab}};ie.memo=function(e,t){return{$$typeof:Cb,type:e,compare:t===void 0?null:t}};ie.startTransition=function(e){var t=ro.transition;ro.transition={};try{e()}finally{ro.transition=t}};ie.unstable_act=lg;ie.useCallback=function(e,t){return rt.current.useCallback(e,t)};ie.useContext=function(e){return rt.current.useContext(e)};ie.useDebugValue=function(){};ie.useDeferredValue=function(e){return rt.current.useDeferredValue(e)};ie.useEffect=function(e,t){return rt.current.useEffect(e,t)};ie.useId=function(){return rt.current.useId()};ie.useImperativeHandle=function(e,t,n){return rt.current.useImperativeHandle(e,t,n)};ie.useInsertionEffect=function(e,t){return rt.current.useInsertionEffect(e,t)};ie.useLayoutEffect=function(e,t){return rt.current.useLayoutEffect(e,t)};ie.useMemo=function(e,t){return rt.current.useMemo(e,t)};ie.useReducer=function(e,t,n){return rt.current.useReducer(e,t,n)};ie.useRef=function(e){return rt.current.useRef(e)};ie.useState=function(e){return rt.current.useState(e)};ie.useSyncExternalStore=function(e,t,n){return rt.current.useSyncExternalStore(e,t,n)};ie.useTransition=function(){return rt.current.useTransition()};ie.version="18.3.1";eg.exports=ie;var h=eg.exports;const W=J0(h),Nd=xb({__proto__:null,default:W},[h]);/**
10
10
  * @license React
11
11
  * react-jsx-runtime.production.min.js
12
12
  *
@@ -22,7 +22,7 @@ function xb(e,t){for(var n=0;n<t.length;n++){const s=t[n];if(typeof s!="string"&
22
22
  *
23
23
  * This source code is licensed under the MIT license found in the
24
24
  * LICENSE file in the root directory of this source tree.
25
- */(function(e){function t(C,A){var _=C.length;C.push(A);e:for(;0<_;){var U=_-1>>>1,K=C[U];if(0<i(K,A))C[U]=A,C[_]=K,_=U;else break e}}function n(C){return C.length===0?null:C[0]}function s(C){if(C.length===0)return null;var A=C[0],_=C.pop();if(_!==A){C[0]=_;e:for(var U=0,K=C.length,Y=K>>>1;U<Y;){var J=2*(U+1)-1,le=C[J],oe=J+1,re=C[oe];if(0>i(le,_))oe<K&&0>i(re,le)?(C[U]=re,C[oe]=_,U=oe):(C[U]=le,C[J]=_,U=J);else if(oe<K&&0>i(re,_))C[U]=re,C[oe]=_,U=oe;else break e}}return A}function i(C,A){var _=C.sortIndex-A.sortIndex;return _!==0?_:C.id-A.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,l=o.now();e.unstable_now=function(){return o.now()-l}}var c=[],u=[],d=1,p=null,f=3,m=!1,b=!1,y=!1,v=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(C){for(var A=n(u);A!==null;){if(A.callback===null)s(u);else if(A.startTime<=C)s(u),A.sortIndex=A.expirationTime,t(c,A);else break;A=n(u)}}function j(C){if(y=!1,w(C),!b)if(n(c)!==null)b=!0,z(k);else{var A=n(u);A!==null&&B(j,A.startTime-C)}}function k(C,A){b=!1,y&&(y=!1,g(E),E=-1),m=!0;var _=f;try{for(w(A),p=n(c);p!==null&&(!(p.expirationTime>A)||C&&!T());){var U=p.callback;if(typeof U=="function"){p.callback=null,f=p.priorityLevel;var K=U(p.expirationTime<=A);A=e.unstable_now(),typeof K=="function"?p.callback=K:p===n(c)&&s(c),w(A)}else s(c);p=n(c)}if(p!==null)var Y=!0;else{var J=n(u);J!==null&&B(j,J.startTime-A),Y=!1}return Y}finally{p=null,f=_,m=!1}}var N=!1,S=null,E=-1,P=5,M=-1;function T(){return!(e.unstable_now()-M<P)}function V(){if(S!==null){var C=e.unstable_now();M=C;var A=!0;try{A=S(!0,C)}finally{A?R():(N=!1,S=null)}}else N=!1}var R;if(typeof x=="function")R=function(){x(V)};else if(typeof MessageChannel<"u"){var I=new MessageChannel,L=I.port2;I.port1.onmessage=V,R=function(){L.postMessage(null)}}else R=function(){v(V,0)};function z(C){S=C,N||(N=!0,R())}function B(C,A){E=v(function(){C(e.unstable_now())},A)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(C){C.callback=null},e.unstable_continueExecution=function(){b||m||(b=!0,z(k))},e.unstable_forceFrameRate=function(C){0>C||125<C?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):P=0<C?Math.floor(1e3/C):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(C){switch(f){case 1:case 2:case 3:var A=3;break;default:A=f}var _=f;f=A;try{return C()}finally{f=_}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(C,A){switch(C){case 1:case 2:case 3:case 4:case 5:break;default:C=3}var _=f;f=C;try{return A()}finally{f=_}},e.unstable_scheduleCallback=function(C,A,_){var U=e.unstable_now();switch(typeof _=="object"&&_!==null?(_=_.delay,_=typeof _=="number"&&0<_?U+_:U):_=U,C){case 1:var K=-1;break;case 2:K=250;break;case 5:K=1073741823;break;case 4:K=1e4;break;default:K=5e3}return K=_+K,C={id:d++,callback:A,priorityLevel:C,startTime:_,expirationTime:K,sortIndex:-1},_>U?(C.sortIndex=_,t(u,C),n(c)===null&&C===n(u)&&(y?(g(E),E=-1):y=!0,B(j,_-U))):(C.sortIndex=K,t(c,C),b||m||(b=!0,z(k))),C},e.unstable_shouldYield=T,e.unstable_wrapCallback=function(C){var A=f;return function(){var _=f;f=A;try{return C.apply(this,arguments)}finally{f=_}}}})(hg);dg.exports=hg;var Bb=dg.exports;/**
25
+ */(function(e){function t(C,M){var _=C.length;C.push(M);e:for(;0<_;){var U=_-1>>>1,K=C[U];if(0<i(K,M))C[U]=M,C[_]=K,_=U;else break e}}function n(C){return C.length===0?null:C[0]}function s(C){if(C.length===0)return null;var M=C[0],_=C.pop();if(_!==M){C[0]=_;e:for(var U=0,K=C.length,Y=K>>>1;U<Y;){var J=2*(U+1)-1,ce=C[J],oe=J+1,re=C[oe];if(0>i(ce,_))oe<K&&0>i(re,ce)?(C[U]=re,C[oe]=_,U=oe):(C[U]=ce,C[J]=_,U=J);else if(oe<K&&0>i(re,_))C[U]=re,C[oe]=_,U=oe;else break e}}return M}function i(C,M){var _=C.sortIndex-M.sortIndex;return _!==0?_:C.id-M.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,l=o.now();e.unstable_now=function(){return o.now()-l}}var c=[],u=[],d=1,p=null,f=3,m=!1,v=!1,y=!1,b=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(C){for(var M=n(u);M!==null;){if(M.callback===null)s(u);else if(M.startTime<=C)s(u),M.sortIndex=M.expirationTime,t(c,M);else break;M=n(u)}}function j(C){if(y=!1,w(C),!v)if(n(c)!==null)v=!0,z(k);else{var M=n(u);M!==null&&B(j,M.startTime-C)}}function k(C,M){v=!1,y&&(y=!1,g(E),E=-1),m=!0;var _=f;try{for(w(M),p=n(c);p!==null&&(!(p.expirationTime>M)||C&&!T());){var U=p.callback;if(typeof U=="function"){p.callback=null,f=p.priorityLevel;var K=U(p.expirationTime<=M);M=e.unstable_now(),typeof K=="function"?p.callback=K:p===n(c)&&s(c),w(M)}else s(c);p=n(c)}if(p!==null)var Y=!0;else{var J=n(u);J!==null&&B(j,J.startTime-M),Y=!1}return Y}finally{p=null,f=_,m=!1}}var N=!1,S=null,E=-1,P=5,A=-1;function T(){return!(e.unstable_now()-A<P)}function V(){if(S!==null){var C=e.unstable_now();A=C;var M=!0;try{M=S(!0,C)}finally{M?R():(N=!1,S=null)}}else N=!1}var R;if(typeof x=="function")R=function(){x(V)};else if(typeof MessageChannel<"u"){var I=new MessageChannel,L=I.port2;I.port1.onmessage=V,R=function(){L.postMessage(null)}}else R=function(){b(V,0)};function z(C){S=C,N||(N=!0,R())}function B(C,M){E=b(function(){C(e.unstable_now())},M)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(C){C.callback=null},e.unstable_continueExecution=function(){v||m||(v=!0,z(k))},e.unstable_forceFrameRate=function(C){0>C||125<C?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):P=0<C?Math.floor(1e3/C):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(C){switch(f){case 1:case 2:case 3:var M=3;break;default:M=f}var _=f;f=M;try{return C()}finally{f=_}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(C,M){switch(C){case 1:case 2:case 3:case 4:case 5:break;default:C=3}var _=f;f=C;try{return M()}finally{f=_}},e.unstable_scheduleCallback=function(C,M,_){var U=e.unstable_now();switch(typeof _=="object"&&_!==null?(_=_.delay,_=typeof _=="number"&&0<_?U+_:U):_=U,C){case 1:var K=-1;break;case 2:K=250;break;case 5:K=1073741823;break;case 4:K=1e4;break;default:K=5e3}return K=_+K,C={id:d++,callback:M,priorityLevel:C,startTime:_,expirationTime:K,sortIndex:-1},_>U?(C.sortIndex=_,t(u,C),n(c)===null&&C===n(u)&&(y?(g(E),E=-1):y=!0,B(j,_-U))):(C.sortIndex=K,t(c,C),v||m||(v=!0,z(k))),C},e.unstable_shouldYield=T,e.unstable_wrapCallback=function(C){var M=f;return function(){var _=f;f=M;try{return C.apply(this,arguments)}finally{f=_}}}})(hg);dg.exports=hg;var Bb=dg.exports;/**
26
26
  * @license React
27
27
  * react-dom.production.min.js
28
28
  *
@@ -30,14 +30,14 @@ function xb(e,t){for(var n=0;n<t.length;n++){const s=t[n];if(typeof s!="string"&
30
30
  *
31
31
  * This source code is licensed under the MIT license found in the
32
32
  * LICENSE file in the root directory of this source tree.
33
- */var Fb=h,vt=Bb;function F(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var fg=new Set,zi={};function Bs(e,t){_r(e,t),_r(e+"Capture",t)}function _r(e,t){for(zi[e]=t,e=0;e<t.length;e++)fg.add(t[e])}var Nn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Xc=Object.prototype.hasOwnProperty,Vb=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Sf={},Cf={};function $b(e){return Xc.call(Cf,e)?!0:Xc.call(Sf,e)?!1:Vb.test(e)?Cf[e]=!0:(Sf[e]=!0,!1)}function Ub(e,t,n,s){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return s?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Hb(e,t,n,s){if(t===null||typeof t>"u"||Ub(e,t,n,s))return!0;if(s)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function it(e,t,n,s,i,a,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=s,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=o}var Ke={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Ke[e]=new it(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Ke[t]=new it(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Ke[e]=new it(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Ke[e]=new it(e,2,!1,e,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".split(" ").forEach(function(e){Ke[e]=new it(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Ke[e]=new it(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Ke[e]=new it(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Ke[e]=new it(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Ke[e]=new it(e,5,!1,e.toLowerCase(),null,!1,!1)});var Sd=/[\-:]([a-z])/g;function Cd(e){return e[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".split(" ").forEach(function(e){var t=e.replace(Sd,Cd);Ke[t]=new it(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Sd,Cd);Ke[t]=new it(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Sd,Cd);Ke[t]=new it(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Ke[e]=new it(e,1,!1,e.toLowerCase(),null,!1,!1)});Ke.xlinkHref=new it("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Ke[e]=new it(e,1,!1,e.toLowerCase(),null,!0,!0)});function Ed(e,t,n,s){var i=Ke.hasOwnProperty(t)?Ke[t]:null;(i!==null?i.type!==0:s||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(Hb(t,n,i,s)&&(n=null),s||i===null?$b(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):i.mustUseProperty?e[i.propertyName]=n===null?i.type===3?!1:"":n:(t=i.attributeName,s=i.attributeNamespace,n===null?e.removeAttribute(t):(i=i.type,n=i===3||i===4&&n===!0?"":""+n,s?e.setAttributeNS(s,t,n):e.setAttribute(t,n))))}var Tn=Fb.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Sa=Symbol.for("react.element"),sr=Symbol.for("react.portal"),rr=Symbol.for("react.fragment"),_d=Symbol.for("react.strict_mode"),Qc=Symbol.for("react.profiler"),pg=Symbol.for("react.provider"),mg=Symbol.for("react.context"),Td=Symbol.for("react.forward_ref"),Jc=Symbol.for("react.suspense"),Zc=Symbol.for("react.suspense_list"),Pd=Symbol.for("react.memo"),In=Symbol.for("react.lazy"),gg=Symbol.for("react.offscreen"),Ef=Symbol.iterator;function Jr(e){return e===null||typeof e!="object"?null:(e=Ef&&e[Ef]||e["@@iterator"],typeof e=="function"?e:null)}var Se=Object.assign,Kl;function ci(e){if(Kl===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Kl=t&&t[1]||""}return`
33
+ */var Fb=h,vt=Bb;function F(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var fg=new Set,zi={};function Bs(e,t){Tr(e,t),Tr(e+"Capture",t)}function Tr(e,t){for(zi[e]=t,e=0;e<t.length;e++)fg.add(t[e])}var Nn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Xc=Object.prototype.hasOwnProperty,Vb=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Sf={},Cf={};function $b(e){return Xc.call(Cf,e)?!0:Xc.call(Sf,e)?!1:Vb.test(e)?Cf[e]=!0:(Sf[e]=!0,!1)}function Ub(e,t,n,s){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return s?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Hb(e,t,n,s){if(t===null||typeof t>"u"||Ub(e,t,n,s))return!0;if(s)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function it(e,t,n,s,i,a,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=s,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=o}var Ke={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Ke[e]=new it(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Ke[t]=new it(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Ke[e]=new it(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Ke[e]=new it(e,2,!1,e,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".split(" ").forEach(function(e){Ke[e]=new it(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Ke[e]=new it(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Ke[e]=new it(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Ke[e]=new it(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Ke[e]=new it(e,5,!1,e.toLowerCase(),null,!1,!1)});var Sd=/[\-:]([a-z])/g;function Cd(e){return e[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".split(" ").forEach(function(e){var t=e.replace(Sd,Cd);Ke[t]=new it(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Sd,Cd);Ke[t]=new it(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Sd,Cd);Ke[t]=new it(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Ke[e]=new it(e,1,!1,e.toLowerCase(),null,!1,!1)});Ke.xlinkHref=new it("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Ke[e]=new it(e,1,!1,e.toLowerCase(),null,!0,!0)});function Ed(e,t,n,s){var i=Ke.hasOwnProperty(t)?Ke[t]:null;(i!==null?i.type!==0:s||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(Hb(t,n,i,s)&&(n=null),s||i===null?$b(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):i.mustUseProperty?e[i.propertyName]=n===null?i.type===3?!1:"":n:(t=i.attributeName,s=i.attributeNamespace,n===null?e.removeAttribute(t):(i=i.type,n=i===3||i===4&&n===!0?"":""+n,s?e.setAttributeNS(s,t,n):e.setAttribute(t,n))))}var Tn=Fb.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Sa=Symbol.for("react.element"),rr=Symbol.for("react.portal"),ir=Symbol.for("react.fragment"),_d=Symbol.for("react.strict_mode"),Qc=Symbol.for("react.profiler"),pg=Symbol.for("react.provider"),mg=Symbol.for("react.context"),Td=Symbol.for("react.forward_ref"),Jc=Symbol.for("react.suspense"),Zc=Symbol.for("react.suspense_list"),Pd=Symbol.for("react.memo"),In=Symbol.for("react.lazy"),gg=Symbol.for("react.offscreen"),Ef=Symbol.iterator;function Jr(e){return e===null||typeof e!="object"?null:(e=Ef&&e[Ef]||e["@@iterator"],typeof e=="function"?e:null)}var Se=Object.assign,Kl;function ci(e){if(Kl===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Kl=t&&t[1]||""}return`
34
34
  `+Kl+e}var Gl=!1;function ql(e,t){if(!e||Gl)return"";Gl=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(u){var s=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){s=u}e.call(t.prototype)}else{try{throw Error()}catch(u){s=u}e()}}catch(u){if(u&&s&&typeof u.stack=="string"){for(var i=u.stack.split(`
35
35
  `),a=s.stack.split(`
36
36
  `),o=i.length-1,l=a.length-1;1<=o&&0<=l&&i[o]!==a[l];)l--;for(;1<=o&&0<=l;o--,l--)if(i[o]!==a[l]){if(o!==1||l!==1)do if(o--,l--,0>l||i[o]!==a[l]){var c=`
37
- `+i[o].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=o&&0<=l);break}}}finally{Gl=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?ci(e):""}function Wb(e){switch(e.tag){case 5:return ci(e.type);case 16:return ci("Lazy");case 13:return ci("Suspense");case 19:return ci("SuspenseList");case 0:case 2:case 15:return e=ql(e.type,!1),e;case 11:return e=ql(e.type.render,!1),e;case 1:return e=ql(e.type,!0),e;default:return""}}function eu(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case rr:return"Fragment";case sr:return"Portal";case Qc:return"Profiler";case _d:return"StrictMode";case Jc:return"Suspense";case Zc:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case mg:return(e.displayName||"Context")+".Consumer";case pg:return(e._context.displayName||"Context")+".Provider";case Td:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Pd:return t=e.displayName||null,t!==null?t:eu(e.type)||"Memo";case In:t=e._payload,e=e._init;try{return eu(e(t))}catch{}}return null}function Kb(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return eu(t);case 8:return t===_d?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function ns(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function xg(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Gb(e){var t=xg(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),s=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(o){s=""+o,a.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return s},setValue:function(o){s=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ca(e){e._valueTracker||(e._valueTracker=Gb(e))}function yg(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),s="";return e&&(s=xg(e)?e.checked?"true":"false":e.value),e=s,e!==n?(t.setValue(e),!0):!1}function Co(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function tu(e,t){var n=t.checked;return Se({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function _f(e,t){var n=t.defaultValue==null?"":t.defaultValue,s=t.checked!=null?t.checked:t.defaultChecked;n=ns(t.value!=null?t.value:n),e._wrapperState={initialChecked:s,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function vg(e,t){t=t.checked,t!=null&&Ed(e,"checked",t,!1)}function nu(e,t){vg(e,t);var n=ns(t.value),s=t.type;if(n!=null)s==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(s==="submit"||s==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?su(e,t.type,n):t.hasOwnProperty("defaultValue")&&su(e,t.type,ns(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Tf(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var s=t.type;if(!(s!=="submit"&&s!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function su(e,t,n){(t!=="number"||Co(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var ui=Array.isArray;function wr(e,t,n,s){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&s&&(e[n].defaultSelected=!0)}else{for(n=""+ns(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,s&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function ru(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(F(91));return Se({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Pf(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(F(92));if(ui(n)){if(1<n.length)throw Error(F(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:ns(n)}}function bg(e,t){var n=ns(t.value),s=ns(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),s!=null&&(e.defaultValue=""+s)}function Mf(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function wg(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function iu(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?wg(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Ea,kg=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,s,i){MSApp.execUnsafeLocalFunction(function(){return e(t,n,s,i)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Ea=Ea||document.createElement("div"),Ea.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Ea.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Li(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var yi={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},qb=["Webkit","ms","Moz","O"];Object.keys(yi).forEach(function(e){qb.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),yi[t]=yi[e]})});function jg(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||yi.hasOwnProperty(e)&&yi[e]?(""+t).trim():t+"px"}function Ng(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var s=n.indexOf("--")===0,i=jg(n,t[n],s);n==="float"&&(n="cssFloat"),s?e.setProperty(n,i):e[n]=i}}var Yb=Se({menuitem:!0},{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});function au(e,t){if(t){if(Yb[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(F(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(F(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(F(61))}if(t.style!=null&&typeof t.style!="object")throw Error(F(62))}}function ou(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){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 lu=null;function Md(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var cu=null,kr=null,jr=null;function Af(e){if(e=fa(e)){if(typeof cu!="function")throw Error(F(280));var t=e.stateNode;t&&(t=dl(t),cu(e.stateNode,e.type,t))}}function Sg(e){kr?jr?jr.push(e):jr=[e]:kr=e}function Cg(){if(kr){var e=kr,t=jr;if(jr=kr=null,Af(e),t)for(e=0;e<t.length;e++)Af(t[e])}}function Eg(e,t){return e(t)}function _g(){}var Yl=!1;function Tg(e,t,n){if(Yl)return e(t,n);Yl=!0;try{return Eg(e,t,n)}finally{Yl=!1,(kr!==null||jr!==null)&&(_g(),Cg())}}function Oi(e,t){var n=e.stateNode;if(n===null)return null;var s=dl(n);if(s===null)return null;n=s[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(s=!s.disabled)||(e=e.type,s=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!s;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(F(231,t,typeof n));return n}var uu=!1;if(Nn)try{var Zr={};Object.defineProperty(Zr,"passive",{get:function(){uu=!0}}),window.addEventListener("test",Zr,Zr),window.removeEventListener("test",Zr,Zr)}catch{uu=!1}function Xb(e,t,n,s,i,a,o,l,c){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(d){this.onError(d)}}var vi=!1,Eo=null,_o=!1,du=null,Qb={onError:function(e){vi=!0,Eo=e}};function Jb(e,t,n,s,i,a,o,l,c){vi=!1,Eo=null,Xb.apply(Qb,arguments)}function Zb(e,t,n,s,i,a,o,l,c){if(Jb.apply(this,arguments),vi){if(vi){var u=Eo;vi=!1,Eo=null}else throw Error(F(198));_o||(_o=!0,du=u)}}function Fs(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function Pg(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function Rf(e){if(Fs(e)!==e)throw Error(F(188))}function ew(e){var t=e.alternate;if(!t){if(t=Fs(e),t===null)throw Error(F(188));return t!==e?null:e}for(var n=e,s=t;;){var i=n.return;if(i===null)break;var a=i.alternate;if(a===null){if(s=i.return,s!==null){n=s;continue}break}if(i.child===a.child){for(a=i.child;a;){if(a===n)return Rf(i),e;if(a===s)return Rf(i),t;a=a.sibling}throw Error(F(188))}if(n.return!==s.return)n=i,s=a;else{for(var o=!1,l=i.child;l;){if(l===n){o=!0,n=i,s=a;break}if(l===s){o=!0,s=i,n=a;break}l=l.sibling}if(!o){for(l=a.child;l;){if(l===n){o=!0,n=a,s=i;break}if(l===s){o=!0,s=a,n=i;break}l=l.sibling}if(!o)throw Error(F(189))}}if(n.alternate!==s)throw Error(F(190))}if(n.tag!==3)throw Error(F(188));return n.stateNode.current===n?e:t}function Mg(e){return e=ew(e),e!==null?Ag(e):null}function Ag(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Ag(e);if(t!==null)return t;e=e.sibling}return null}var Rg=vt.unstable_scheduleCallback,zf=vt.unstable_cancelCallback,tw=vt.unstable_shouldYield,nw=vt.unstable_requestPaint,Pe=vt.unstable_now,sw=vt.unstable_getCurrentPriorityLevel,Ad=vt.unstable_ImmediatePriority,zg=vt.unstable_UserBlockingPriority,To=vt.unstable_NormalPriority,rw=vt.unstable_LowPriority,Lg=vt.unstable_IdlePriority,ol=null,an=null;function iw(e){if(an&&typeof an.onCommitFiberRoot=="function")try{an.onCommitFiberRoot(ol,e,void 0,(e.current.flags&128)===128)}catch{}}var Kt=Math.clz32?Math.clz32:lw,aw=Math.log,ow=Math.LN2;function lw(e){return e>>>=0,e===0?32:31-(aw(e)/ow|0)|0}var _a=64,Ta=4194304;function di(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Po(e,t){var n=e.pendingLanes;if(n===0)return 0;var s=0,i=e.suspendedLanes,a=e.pingedLanes,o=n&268435455;if(o!==0){var l=o&~i;l!==0?s=di(l):(a&=o,a!==0&&(s=di(a)))}else o=n&~i,o!==0?s=di(o):a!==0&&(s=di(a));if(s===0)return 0;if(t!==0&&t!==s&&!(t&i)&&(i=s&-s,a=t&-t,i>=a||i===16&&(a&4194240)!==0))return t;if(s&4&&(s|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=s;0<t;)n=31-Kt(t),i=1<<n,s|=e[n],t&=~i;return s}function cw(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function uw(e,t){for(var n=e.suspendedLanes,s=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes;0<a;){var o=31-Kt(a),l=1<<o,c=i[o];c===-1?(!(l&n)||l&s)&&(i[o]=cw(l,t)):c<=t&&(e.expiredLanes|=l),a&=~l}}function hu(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Og(){var e=_a;return _a<<=1,!(_a&4194240)&&(_a=64),e}function Xl(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function da(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Kt(t),e[t]=n}function dw(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var s=e.eventTimes;for(e=e.expirationTimes;0<n;){var i=31-Kt(n),a=1<<i;t[i]=0,s[i]=-1,e[i]=-1,n&=~a}}function Rd(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var s=31-Kt(n),i=1<<s;i&t|e[s]&t&&(e[s]|=t),n&=~i}}var he=0;function Dg(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Ig,zd,Bg,Fg,Vg,fu=!1,Pa=[],Wn=null,Kn=null,Gn=null,Di=new Map,Ii=new Map,Fn=[],hw="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".split(" ");function Lf(e,t){switch(e){case"focusin":case"focusout":Wn=null;break;case"dragenter":case"dragleave":Kn=null;break;case"mouseover":case"mouseout":Gn=null;break;case"pointerover":case"pointerout":Di.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ii.delete(t.pointerId)}}function ei(e,t,n,s,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:s,nativeEvent:a,targetContainers:[i]},t!==null&&(t=fa(t),t!==null&&zd(t)),e):(e.eventSystemFlags|=s,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function fw(e,t,n,s,i){switch(t){case"focusin":return Wn=ei(Wn,e,t,n,s,i),!0;case"dragenter":return Kn=ei(Kn,e,t,n,s,i),!0;case"mouseover":return Gn=ei(Gn,e,t,n,s,i),!0;case"pointerover":var a=i.pointerId;return Di.set(a,ei(Di.get(a)||null,e,t,n,s,i)),!0;case"gotpointercapture":return a=i.pointerId,Ii.set(a,ei(Ii.get(a)||null,e,t,n,s,i)),!0}return!1}function $g(e){var t=js(e.target);if(t!==null){var n=Fs(t);if(n!==null){if(t=n.tag,t===13){if(t=Pg(n),t!==null){e.blockedOn=t,Vg(e.priority,function(){Bg(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function io(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=pu(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var s=new n.constructor(n.type,n);lu=s,n.target.dispatchEvent(s),lu=null}else return t=fa(n),t!==null&&zd(t),e.blockedOn=n,!1;t.shift()}return!0}function Of(e,t,n){io(e)&&n.delete(t)}function pw(){fu=!1,Wn!==null&&io(Wn)&&(Wn=null),Kn!==null&&io(Kn)&&(Kn=null),Gn!==null&&io(Gn)&&(Gn=null),Di.forEach(Of),Ii.forEach(Of)}function ti(e,t){e.blockedOn===t&&(e.blockedOn=null,fu||(fu=!0,vt.unstable_scheduleCallback(vt.unstable_NormalPriority,pw)))}function Bi(e){function t(i){return ti(i,e)}if(0<Pa.length){ti(Pa[0],e);for(var n=1;n<Pa.length;n++){var s=Pa[n];s.blockedOn===e&&(s.blockedOn=null)}}for(Wn!==null&&ti(Wn,e),Kn!==null&&ti(Kn,e),Gn!==null&&ti(Gn,e),Di.forEach(t),Ii.forEach(t),n=0;n<Fn.length;n++)s=Fn[n],s.blockedOn===e&&(s.blockedOn=null);for(;0<Fn.length&&(n=Fn[0],n.blockedOn===null);)$g(n),n.blockedOn===null&&Fn.shift()}var Nr=Tn.ReactCurrentBatchConfig,Mo=!0;function mw(e,t,n,s){var i=he,a=Nr.transition;Nr.transition=null;try{he=1,Ld(e,t,n,s)}finally{he=i,Nr.transition=a}}function gw(e,t,n,s){var i=he,a=Nr.transition;Nr.transition=null;try{he=4,Ld(e,t,n,s)}finally{he=i,Nr.transition=a}}function Ld(e,t,n,s){if(Mo){var i=pu(e,t,n,s);if(i===null)ac(e,t,s,Ao,n),Lf(e,s);else if(fw(i,e,t,n,s))s.stopPropagation();else if(Lf(e,s),t&4&&-1<hw.indexOf(e)){for(;i!==null;){var a=fa(i);if(a!==null&&Ig(a),a=pu(e,t,n,s),a===null&&ac(e,t,s,Ao,n),a===i)break;i=a}i!==null&&s.stopPropagation()}else ac(e,t,s,null,n)}}var Ao=null;function pu(e,t,n,s){if(Ao=null,e=Md(s),e=js(e),e!==null)if(t=Fs(e),t===null)e=null;else if(n=t.tag,n===13){if(e=Pg(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Ao=e,null}function Ug(e){switch(e){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 1;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 4;case"message":switch(sw()){case Ad:return 1;case zg:return 4;case To:case rw:return 16;case Lg:return 536870912;default:return 16}default:return 16}}var $n=null,Od=null,ao=null;function Hg(){if(ao)return ao;var e,t=Od,n=t.length,s,i="value"in $n?$n.value:$n.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(s=1;s<=o&&t[n-s]===i[a-s];s++);return ao=i.slice(e,1<s?1-s:void 0)}function oo(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Ma(){return!0}function Df(){return!1}function jt(e){function t(n,s,i,a,o){this._reactName=n,this._targetInst=i,this.type=s,this.nativeEvent=a,this.target=o,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(n=e[l],this[l]=n?n(a):a[l]);return this.isDefaultPrevented=(a.defaultPrevented!=null?a.defaultPrevented:a.returnValue===!1)?Ma:Df,this.isPropagationStopped=Df,this}return Se(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Ma)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Ma)},persist:function(){},isPersistent:Ma}),t}var Fr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Dd=jt(Fr),ha=Se({},Fr,{view:0,detail:0}),xw=jt(ha),Ql,Jl,ni,ll=Se({},ha,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Id,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==ni&&(ni&&e.type==="mousemove"?(Ql=e.screenX-ni.screenX,Jl=e.screenY-ni.screenY):Jl=Ql=0,ni=e),Ql)},movementY:function(e){return"movementY"in e?e.movementY:Jl}}),If=jt(ll),yw=Se({},ll,{dataTransfer:0}),vw=jt(yw),bw=Se({},ha,{relatedTarget:0}),Zl=jt(bw),ww=Se({},Fr,{animationName:0,elapsedTime:0,pseudoElement:0}),kw=jt(ww),jw=Se({},Fr,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Nw=jt(jw),Sw=Se({},Fr,{data:0}),Bf=jt(Sw),Cw={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Ew={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"},_w={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Tw(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=_w[e])?!!t[e]:!1}function Id(){return Tw}var Pw=Se({},ha,{key:function(e){if(e.key){var t=Cw[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=oo(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Ew[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Id,charCode:function(e){return e.type==="keypress"?oo(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?oo(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Mw=jt(Pw),Aw=Se({},ll,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ff=jt(Aw),Rw=Se({},ha,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Id}),zw=jt(Rw),Lw=Se({},Fr,{propertyName:0,elapsedTime:0,pseudoElement:0}),Ow=jt(Lw),Dw=Se({},ll,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Iw=jt(Dw),Bw=[9,13,27,32],Bd=Nn&&"CompositionEvent"in window,bi=null;Nn&&"documentMode"in document&&(bi=document.documentMode);var Fw=Nn&&"TextEvent"in window&&!bi,Wg=Nn&&(!Bd||bi&&8<bi&&11>=bi),Vf=" ",$f=!1;function Kg(e,t){switch(e){case"keyup":return Bw.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Gg(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ir=!1;function Vw(e,t){switch(e){case"compositionend":return Gg(t);case"keypress":return t.which!==32?null:($f=!0,Vf);case"textInput":return e=t.data,e===Vf&&$f?null:e;default:return null}}function $w(e,t){if(ir)return e==="compositionend"||!Bd&&Kg(e,t)?(e=Hg(),ao=Od=$n=null,ir=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Wg&&t.locale!=="ko"?null:t.data;default:return null}}var Uw={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 Uf(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Uw[e.type]:t==="textarea"}function qg(e,t,n,s){Sg(s),t=Ro(t,"onChange"),0<t.length&&(n=new Dd("onChange","change",null,n,s),e.push({event:n,listeners:t}))}var wi=null,Fi=null;function Hw(e){ix(e,0)}function cl(e){var t=lr(e);if(yg(t))return e}function Ww(e,t){if(e==="change")return t}var Yg=!1;if(Nn){var ec;if(Nn){var tc="oninput"in document;if(!tc){var Hf=document.createElement("div");Hf.setAttribute("oninput","return;"),tc=typeof Hf.oninput=="function"}ec=tc}else ec=!1;Yg=ec&&(!document.documentMode||9<document.documentMode)}function Wf(){wi&&(wi.detachEvent("onpropertychange",Xg),Fi=wi=null)}function Xg(e){if(e.propertyName==="value"&&cl(Fi)){var t=[];qg(t,Fi,e,Md(e)),Tg(Hw,t)}}function Kw(e,t,n){e==="focusin"?(Wf(),wi=t,Fi=n,wi.attachEvent("onpropertychange",Xg)):e==="focusout"&&Wf()}function Gw(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return cl(Fi)}function qw(e,t){if(e==="click")return cl(t)}function Yw(e,t){if(e==="input"||e==="change")return cl(t)}function Xw(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var qt=typeof Object.is=="function"?Object.is:Xw;function Vi(e,t){if(qt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),s=Object.keys(t);if(n.length!==s.length)return!1;for(s=0;s<n.length;s++){var i=n[s];if(!Xc.call(t,i)||!qt(e[i],t[i]))return!1}return!0}function Kf(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Gf(e,t){var n=Kf(e);e=0;for(var s;n;){if(n.nodeType===3){if(s=e+n.textContent.length,e<=t&&s>=t)return{node:n,offset:t-e};e=s}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Kf(n)}}function Qg(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Qg(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Jg(){for(var e=window,t=Co();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Co(e.document)}return t}function Fd(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function Qw(e){var t=Jg(),n=e.focusedElem,s=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Qg(n.ownerDocument.documentElement,n)){if(s!==null&&Fd(n)){if(t=s.start,e=s.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,a=Math.min(s.start,i);s=s.end===void 0?a:Math.min(s.end,i),!e.extend&&a>s&&(i=s,s=a,a=i),i=Gf(n,a);var o=Gf(n,s);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),a>s?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var Jw=Nn&&"documentMode"in document&&11>=document.documentMode,ar=null,mu=null,ki=null,gu=!1;function qf(e,t,n){var s=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;gu||ar==null||ar!==Co(s)||(s=ar,"selectionStart"in s&&Fd(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),ki&&Vi(ki,s)||(ki=s,s=Ro(mu,"onSelect"),0<s.length&&(t=new Dd("onSelect","select",null,t,n),e.push({event:t,listeners:s}),t.target=ar)))}function Aa(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var or={animationend:Aa("Animation","AnimationEnd"),animationiteration:Aa("Animation","AnimationIteration"),animationstart:Aa("Animation","AnimationStart"),transitionend:Aa("Transition","TransitionEnd")},nc={},Zg={};Nn&&(Zg=document.createElement("div").style,"AnimationEvent"in window||(delete or.animationend.animation,delete or.animationiteration.animation,delete or.animationstart.animation),"TransitionEvent"in window||delete or.transitionend.transition);function ul(e){if(nc[e])return nc[e];if(!or[e])return e;var t=or[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Zg)return nc[e]=t[n];return e}var ex=ul("animationend"),tx=ul("animationiteration"),nx=ul("animationstart"),sx=ul("transitionend"),rx=new Map,Yf="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".split(" ");function ls(e,t){rx.set(e,t),Bs(t,[e])}for(var sc=0;sc<Yf.length;sc++){var rc=Yf[sc],Zw=rc.toLowerCase(),e2=rc[0].toUpperCase()+rc.slice(1);ls(Zw,"on"+e2)}ls(ex,"onAnimationEnd");ls(tx,"onAnimationIteration");ls(nx,"onAnimationStart");ls("dblclick","onDoubleClick");ls("focusin","onFocus");ls("focusout","onBlur");ls(sx,"onTransitionEnd");_r("onMouseEnter",["mouseout","mouseover"]);_r("onMouseLeave",["mouseout","mouseover"]);_r("onPointerEnter",["pointerout","pointerover"]);_r("onPointerLeave",["pointerout","pointerover"]);Bs("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Bs("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Bs("onBeforeInput",["compositionend","keypress","textInput","paste"]);Bs("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Bs("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Bs("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var hi="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),t2=new Set("cancel close invalid load scroll toggle".split(" ").concat(hi));function Xf(e,t,n){var s=e.type||"unknown-event";e.currentTarget=n,Zb(s,t,void 0,e),e.currentTarget=null}function ix(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var s=e[n],i=s.event;s=s.listeners;e:{var a=void 0;if(t)for(var o=s.length-1;0<=o;o--){var l=s[o],c=l.instance,u=l.currentTarget;if(l=l.listener,c!==a&&i.isPropagationStopped())break e;Xf(i,l,u),a=c}else for(o=0;o<s.length;o++){if(l=s[o],c=l.instance,u=l.currentTarget,l=l.listener,c!==a&&i.isPropagationStopped())break e;Xf(i,l,u),a=c}}}if(_o)throw e=du,_o=!1,du=null,e}function ge(e,t){var n=t[wu];n===void 0&&(n=t[wu]=new Set);var s=e+"__bubble";n.has(s)||(ax(t,e,2,!1),n.add(s))}function ic(e,t,n){var s=0;t&&(s|=4),ax(n,e,s,t)}var Ra="_reactListening"+Math.random().toString(36).slice(2);function $i(e){if(!e[Ra]){e[Ra]=!0,fg.forEach(function(n){n!=="selectionchange"&&(t2.has(n)||ic(n,!1,e),ic(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ra]||(t[Ra]=!0,ic("selectionchange",!1,t))}}function ax(e,t,n,s){switch(Ug(t)){case 1:var i=mw;break;case 4:i=gw;break;default:i=Ld}n=i.bind(null,t,n,e),i=void 0,!uu||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),s?i!==void 0?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):i!==void 0?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function ac(e,t,n,s,i){var a=s;if(!(t&1)&&!(t&2)&&s!==null)e:for(;;){if(s===null)return;var o=s.tag;if(o===3||o===4){var l=s.stateNode.containerInfo;if(l===i||l.nodeType===8&&l.parentNode===i)break;if(o===4)for(o=s.return;o!==null;){var c=o.tag;if((c===3||c===4)&&(c=o.stateNode.containerInfo,c===i||c.nodeType===8&&c.parentNode===i))return;o=o.return}for(;l!==null;){if(o=js(l),o===null)return;if(c=o.tag,c===5||c===6){s=a=o;continue e}l=l.parentNode}}s=s.return}Tg(function(){var u=a,d=Md(n),p=[];e:{var f=rx.get(e);if(f!==void 0){var m=Dd,b=e;switch(e){case"keypress":if(oo(n)===0)break e;case"keydown":case"keyup":m=Mw;break;case"focusin":b="focus",m=Zl;break;case"focusout":b="blur",m=Zl;break;case"beforeblur":case"afterblur":m=Zl;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":m=If;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":m=vw;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":m=zw;break;case ex:case tx:case nx:m=kw;break;case sx:m=Ow;break;case"scroll":m=xw;break;case"wheel":m=Iw;break;case"copy":case"cut":case"paste":m=Nw;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":m=Ff}var y=(t&4)!==0,v=!y&&e==="scroll",g=y?f!==null?f+"Capture":null:f;y=[];for(var x=u,w;x!==null;){w=x;var j=w.stateNode;if(w.tag===5&&j!==null&&(w=j,g!==null&&(j=Oi(x,g),j!=null&&y.push(Ui(x,j,w)))),v)break;x=x.return}0<y.length&&(f=new m(f,b,null,n,d),p.push({event:f,listeners:y}))}}if(!(t&7)){e:{if(f=e==="mouseover"||e==="pointerover",m=e==="mouseout"||e==="pointerout",f&&n!==lu&&(b=n.relatedTarget||n.fromElement)&&(js(b)||b[Sn]))break e;if((m||f)&&(f=d.window===d?d:(f=d.ownerDocument)?f.defaultView||f.parentWindow:window,m?(b=n.relatedTarget||n.toElement,m=u,b=b?js(b):null,b!==null&&(v=Fs(b),b!==v||b.tag!==5&&b.tag!==6)&&(b=null)):(m=null,b=u),m!==b)){if(y=If,j="onMouseLeave",g="onMouseEnter",x="mouse",(e==="pointerout"||e==="pointerover")&&(y=Ff,j="onPointerLeave",g="onPointerEnter",x="pointer"),v=m==null?f:lr(m),w=b==null?f:lr(b),f=new y(j,x+"leave",m,n,d),f.target=v,f.relatedTarget=w,j=null,js(d)===u&&(y=new y(g,x+"enter",b,n,d),y.target=w,y.relatedTarget=v,j=y),v=j,m&&b)t:{for(y=m,g=b,x=0,w=y;w;w=Qs(w))x++;for(w=0,j=g;j;j=Qs(j))w++;for(;0<x-w;)y=Qs(y),x--;for(;0<w-x;)g=Qs(g),w--;for(;x--;){if(y===g||g!==null&&y===g.alternate)break t;y=Qs(y),g=Qs(g)}y=null}else y=null;m!==null&&Qf(p,f,m,y,!1),b!==null&&v!==null&&Qf(p,v,b,y,!0)}}e:{if(f=u?lr(u):window,m=f.nodeName&&f.nodeName.toLowerCase(),m==="select"||m==="input"&&f.type==="file")var k=Ww;else if(Uf(f))if(Yg)k=Yw;else{k=Gw;var N=Kw}else(m=f.nodeName)&&m.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(k=qw);if(k&&(k=k(e,u))){qg(p,k,n,d);break e}N&&N(e,f,u),e==="focusout"&&(N=f._wrapperState)&&N.controlled&&f.type==="number"&&su(f,"number",f.value)}switch(N=u?lr(u):window,e){case"focusin":(Uf(N)||N.contentEditable==="true")&&(ar=N,mu=u,ki=null);break;case"focusout":ki=mu=ar=null;break;case"mousedown":gu=!0;break;case"contextmenu":case"mouseup":case"dragend":gu=!1,qf(p,n,d);break;case"selectionchange":if(Jw)break;case"keydown":case"keyup":qf(p,n,d)}var S;if(Bd)e:{switch(e){case"compositionstart":var E="onCompositionStart";break e;case"compositionend":E="onCompositionEnd";break e;case"compositionupdate":E="onCompositionUpdate";break e}E=void 0}else ir?Kg(e,n)&&(E="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(E="onCompositionStart");E&&(Wg&&n.locale!=="ko"&&(ir||E!=="onCompositionStart"?E==="onCompositionEnd"&&ir&&(S=Hg()):($n=d,Od="value"in $n?$n.value:$n.textContent,ir=!0)),N=Ro(u,E),0<N.length&&(E=new Bf(E,e,null,n,d),p.push({event:E,listeners:N}),S?E.data=S:(S=Gg(n),S!==null&&(E.data=S)))),(S=Fw?Vw(e,n):$w(e,n))&&(u=Ro(u,"onBeforeInput"),0<u.length&&(d=new Bf("onBeforeInput","beforeinput",null,n,d),p.push({event:d,listeners:u}),d.data=S))}ix(p,t)})}function Ui(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ro(e,t){for(var n=t+"Capture",s=[];e!==null;){var i=e,a=i.stateNode;i.tag===5&&a!==null&&(i=a,a=Oi(e,n),a!=null&&s.unshift(Ui(e,a,i)),a=Oi(e,t),a!=null&&s.push(Ui(e,a,i))),e=e.return}return s}function Qs(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Qf(e,t,n,s,i){for(var a=t._reactName,o=[];n!==null&&n!==s;){var l=n,c=l.alternate,u=l.stateNode;if(c!==null&&c===s)break;l.tag===5&&u!==null&&(l=u,i?(c=Oi(n,a),c!=null&&o.unshift(Ui(n,c,l))):i||(c=Oi(n,a),c!=null&&o.push(Ui(n,c,l)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var n2=/\r\n?/g,s2=/\u0000|\uFFFD/g;function Jf(e){return(typeof e=="string"?e:""+e).replace(n2,`
38
- `).replace(s2,"")}function za(e,t,n){if(t=Jf(t),Jf(e)!==t&&n)throw Error(F(425))}function zo(){}var xu=null,yu=null;function vu(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var bu=typeof setTimeout=="function"?setTimeout:void 0,r2=typeof clearTimeout=="function"?clearTimeout:void 0,Zf=typeof Promise=="function"?Promise:void 0,i2=typeof queueMicrotask=="function"?queueMicrotask:typeof Zf<"u"?function(e){return Zf.resolve(null).then(e).catch(a2)}:bu;function a2(e){setTimeout(function(){throw e})}function oc(e,t){var n=t,s=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(s===0){e.removeChild(i),Bi(t);return}s--}else n!=="$"&&n!=="$?"&&n!=="$!"||s++;n=i}while(n);Bi(t)}function qn(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function ep(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var Vr=Math.random().toString(36).slice(2),nn="__reactFiber$"+Vr,Hi="__reactProps$"+Vr,Sn="__reactContainer$"+Vr,wu="__reactEvents$"+Vr,o2="__reactListeners$"+Vr,l2="__reactHandles$"+Vr;function js(e){var t=e[nn];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Sn]||n[nn]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=ep(e);e!==null;){if(n=e[nn])return n;e=ep(e)}return t}e=n,n=e.parentNode}return null}function fa(e){return e=e[nn]||e[Sn],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function lr(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(F(33))}function dl(e){return e[Hi]||null}var ku=[],cr=-1;function cs(e){return{current:e}}function ye(e){0>cr||(e.current=ku[cr],ku[cr]=null,cr--)}function me(e,t){cr++,ku[cr]=e.current,e.current=t}var ss={},Ze=cs(ss),dt=cs(!1),Ps=ss;function Tr(e,t){var n=e.type.contextTypes;if(!n)return ss;var s=e.stateNode;if(s&&s.__reactInternalMemoizedUnmaskedChildContext===t)return s.__reactInternalMemoizedMaskedChildContext;var i={},a;for(a in n)i[a]=t[a];return s&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function ht(e){return e=e.childContextTypes,e!=null}function Lo(){ye(dt),ye(Ze)}function tp(e,t,n){if(Ze.current!==ss)throw Error(F(168));me(Ze,t),me(dt,n)}function ox(e,t,n){var s=e.stateNode;if(t=t.childContextTypes,typeof s.getChildContext!="function")return n;s=s.getChildContext();for(var i in s)if(!(i in t))throw Error(F(108,Kb(e)||"Unknown",i));return Se({},n,s)}function Oo(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ss,Ps=Ze.current,me(Ze,e),me(dt,dt.current),!0}function np(e,t,n){var s=e.stateNode;if(!s)throw Error(F(169));n?(e=ox(e,t,Ps),s.__reactInternalMemoizedMergedChildContext=e,ye(dt),ye(Ze),me(Ze,e)):ye(dt),me(dt,n)}var xn=null,hl=!1,lc=!1;function lx(e){xn===null?xn=[e]:xn.push(e)}function c2(e){hl=!0,lx(e)}function us(){if(!lc&&xn!==null){lc=!0;var e=0,t=he;try{var n=xn;for(he=1;e<n.length;e++){var s=n[e];do s=s(!0);while(s!==null)}xn=null,hl=!1}catch(i){throw xn!==null&&(xn=xn.slice(e+1)),Rg(Ad,us),i}finally{he=t,lc=!1}}return null}var ur=[],dr=0,Do=null,Io=0,Ct=[],Et=0,Ms=null,vn=1,bn="";function vs(e,t){ur[dr++]=Io,ur[dr++]=Do,Do=e,Io=t}function cx(e,t,n){Ct[Et++]=vn,Ct[Et++]=bn,Ct[Et++]=Ms,Ms=e;var s=vn;e=bn;var i=32-Kt(s)-1;s&=~(1<<i),n+=1;var a=32-Kt(t)+i;if(30<a){var o=i-i%5;a=(s&(1<<o)-1).toString(32),s>>=o,i-=o,vn=1<<32-Kt(t)+i|n<<i|s,bn=a+e}else vn=1<<a|n<<i|s,bn=e}function Vd(e){e.return!==null&&(vs(e,1),cx(e,1,0))}function $d(e){for(;e===Do;)Do=ur[--dr],ur[dr]=null,Io=ur[--dr],ur[dr]=null;for(;e===Ms;)Ms=Ct[--Et],Ct[Et]=null,bn=Ct[--Et],Ct[Et]=null,vn=Ct[--Et],Ct[Et]=null}var xt=null,gt=null,we=!1,Wt=null;function ux(e,t){var n=Tt(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function sp(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,xt=e,gt=qn(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,xt=e,gt=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Ms!==null?{id:vn,overflow:bn}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Tt(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,xt=e,gt=null,!0):!1;default:return!1}}function ju(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Nu(e){if(we){var t=gt;if(t){var n=t;if(!sp(e,t)){if(ju(e))throw Error(F(418));t=qn(n.nextSibling);var s=xt;t&&sp(e,t)?ux(s,n):(e.flags=e.flags&-4097|2,we=!1,xt=e)}}else{if(ju(e))throw Error(F(418));e.flags=e.flags&-4097|2,we=!1,xt=e}}}function rp(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;xt=e}function La(e){if(e!==xt)return!1;if(!we)return rp(e),we=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!vu(e.type,e.memoizedProps)),t&&(t=gt)){if(ju(e))throw dx(),Error(F(418));for(;t;)ux(e,t),t=qn(t.nextSibling)}if(rp(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(F(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){gt=qn(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}gt=null}}else gt=xt?qn(e.stateNode.nextSibling):null;return!0}function dx(){for(var e=gt;e;)e=qn(e.nextSibling)}function Pr(){gt=xt=null,we=!1}function Ud(e){Wt===null?Wt=[e]:Wt.push(e)}var u2=Tn.ReactCurrentBatchConfig;function si(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(F(309));var s=n.stateNode}if(!s)throw Error(F(147,e));var i=s,a=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===a?t.ref:(t=function(o){var l=i.refs;o===null?delete l[a]:l[a]=o},t._stringRef=a,t)}if(typeof e!="string")throw Error(F(284));if(!n._owner)throw Error(F(290,e))}return e}function Oa(e,t){throw e=Object.prototype.toString.call(t),Error(F(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function ip(e){var t=e._init;return t(e._payload)}function hx(e){function t(g,x){if(e){var w=g.deletions;w===null?(g.deletions=[x],g.flags|=16):w.push(x)}}function n(g,x){if(!e)return null;for(;x!==null;)t(g,x),x=x.sibling;return null}function s(g,x){for(g=new Map;x!==null;)x.key!==null?g.set(x.key,x):g.set(x.index,x),x=x.sibling;return g}function i(g,x){return g=Jn(g,x),g.index=0,g.sibling=null,g}function a(g,x,w){return g.index=w,e?(w=g.alternate,w!==null?(w=w.index,w<x?(g.flags|=2,x):w):(g.flags|=2,x)):(g.flags|=1048576,x)}function o(g){return e&&g.alternate===null&&(g.flags|=2),g}function l(g,x,w,j){return x===null||x.tag!==6?(x=mc(w,g.mode,j),x.return=g,x):(x=i(x,w),x.return=g,x)}function c(g,x,w,j){var k=w.type;return k===rr?d(g,x,w.props.children,j,w.key):x!==null&&(x.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===In&&ip(k)===x.type)?(j=i(x,w.props),j.ref=si(g,x,w),j.return=g,j):(j=mo(w.type,w.key,w.props,null,g.mode,j),j.ref=si(g,x,w),j.return=g,j)}function u(g,x,w,j){return x===null||x.tag!==4||x.stateNode.containerInfo!==w.containerInfo||x.stateNode.implementation!==w.implementation?(x=gc(w,g.mode,j),x.return=g,x):(x=i(x,w.children||[]),x.return=g,x)}function d(g,x,w,j,k){return x===null||x.tag!==7?(x=_s(w,g.mode,j,k),x.return=g,x):(x=i(x,w),x.return=g,x)}function p(g,x,w){if(typeof x=="string"&&x!==""||typeof x=="number")return x=mc(""+x,g.mode,w),x.return=g,x;if(typeof x=="object"&&x!==null){switch(x.$$typeof){case Sa:return w=mo(x.type,x.key,x.props,null,g.mode,w),w.ref=si(g,null,x),w.return=g,w;case sr:return x=gc(x,g.mode,w),x.return=g,x;case In:var j=x._init;return p(g,j(x._payload),w)}if(ui(x)||Jr(x))return x=_s(x,g.mode,w,null),x.return=g,x;Oa(g,x)}return null}function f(g,x,w,j){var k=x!==null?x.key:null;if(typeof w=="string"&&w!==""||typeof w=="number")return k!==null?null:l(g,x,""+w,j);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Sa:return w.key===k?c(g,x,w,j):null;case sr:return w.key===k?u(g,x,w,j):null;case In:return k=w._init,f(g,x,k(w._payload),j)}if(ui(w)||Jr(w))return k!==null?null:d(g,x,w,j,null);Oa(g,w)}return null}function m(g,x,w,j,k){if(typeof j=="string"&&j!==""||typeof j=="number")return g=g.get(w)||null,l(x,g,""+j,k);if(typeof j=="object"&&j!==null){switch(j.$$typeof){case Sa:return g=g.get(j.key===null?w:j.key)||null,c(x,g,j,k);case sr:return g=g.get(j.key===null?w:j.key)||null,u(x,g,j,k);case In:var N=j._init;return m(g,x,w,N(j._payload),k)}if(ui(j)||Jr(j))return g=g.get(w)||null,d(x,g,j,k,null);Oa(x,j)}return null}function b(g,x,w,j){for(var k=null,N=null,S=x,E=x=0,P=null;S!==null&&E<w.length;E++){S.index>E?(P=S,S=null):P=S.sibling;var M=f(g,S,w[E],j);if(M===null){S===null&&(S=P);break}e&&S&&M.alternate===null&&t(g,S),x=a(M,x,E),N===null?k=M:N.sibling=M,N=M,S=P}if(E===w.length)return n(g,S),we&&vs(g,E),k;if(S===null){for(;E<w.length;E++)S=p(g,w[E],j),S!==null&&(x=a(S,x,E),N===null?k=S:N.sibling=S,N=S);return we&&vs(g,E),k}for(S=s(g,S);E<w.length;E++)P=m(S,g,E,w[E],j),P!==null&&(e&&P.alternate!==null&&S.delete(P.key===null?E:P.key),x=a(P,x,E),N===null?k=P:N.sibling=P,N=P);return e&&S.forEach(function(T){return t(g,T)}),we&&vs(g,E),k}function y(g,x,w,j){var k=Jr(w);if(typeof k!="function")throw Error(F(150));if(w=k.call(w),w==null)throw Error(F(151));for(var N=k=null,S=x,E=x=0,P=null,M=w.next();S!==null&&!M.done;E++,M=w.next()){S.index>E?(P=S,S=null):P=S.sibling;var T=f(g,S,M.value,j);if(T===null){S===null&&(S=P);break}e&&S&&T.alternate===null&&t(g,S),x=a(T,x,E),N===null?k=T:N.sibling=T,N=T,S=P}if(M.done)return n(g,S),we&&vs(g,E),k;if(S===null){for(;!M.done;E++,M=w.next())M=p(g,M.value,j),M!==null&&(x=a(M,x,E),N===null?k=M:N.sibling=M,N=M);return we&&vs(g,E),k}for(S=s(g,S);!M.done;E++,M=w.next())M=m(S,g,E,M.value,j),M!==null&&(e&&M.alternate!==null&&S.delete(M.key===null?E:M.key),x=a(M,x,E),N===null?k=M:N.sibling=M,N=M);return e&&S.forEach(function(V){return t(g,V)}),we&&vs(g,E),k}function v(g,x,w,j){if(typeof w=="object"&&w!==null&&w.type===rr&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case Sa:e:{for(var k=w.key,N=x;N!==null;){if(N.key===k){if(k=w.type,k===rr){if(N.tag===7){n(g,N.sibling),x=i(N,w.props.children),x.return=g,g=x;break e}}else if(N.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===In&&ip(k)===N.type){n(g,N.sibling),x=i(N,w.props),x.ref=si(g,N,w),x.return=g,g=x;break e}n(g,N);break}else t(g,N);N=N.sibling}w.type===rr?(x=_s(w.props.children,g.mode,j,w.key),x.return=g,g=x):(j=mo(w.type,w.key,w.props,null,g.mode,j),j.ref=si(g,x,w),j.return=g,g=j)}return o(g);case sr:e:{for(N=w.key;x!==null;){if(x.key===N)if(x.tag===4&&x.stateNode.containerInfo===w.containerInfo&&x.stateNode.implementation===w.implementation){n(g,x.sibling),x=i(x,w.children||[]),x.return=g,g=x;break e}else{n(g,x);break}else t(g,x);x=x.sibling}x=gc(w,g.mode,j),x.return=g,g=x}return o(g);case In:return N=w._init,v(g,x,N(w._payload),j)}if(ui(w))return b(g,x,w,j);if(Jr(w))return y(g,x,w,j);Oa(g,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,x!==null&&x.tag===6?(n(g,x.sibling),x=i(x,w),x.return=g,g=x):(n(g,x),x=mc(w,g.mode,j),x.return=g,g=x),o(g)):n(g,x)}return v}var Mr=hx(!0),fx=hx(!1),Bo=cs(null),Fo=null,hr=null,Hd=null;function Wd(){Hd=hr=Fo=null}function Kd(e){var t=Bo.current;ye(Bo),e._currentValue=t}function Su(e,t,n){for(;e!==null;){var s=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,s!==null&&(s.childLanes|=t)):s!==null&&(s.childLanes&t)!==t&&(s.childLanes|=t),e===n)break;e=e.return}}function Sr(e,t){Fo=e,Hd=hr=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(ut=!0),e.firstContext=null)}function At(e){var t=e._currentValue;if(Hd!==e)if(e={context:e,memoizedValue:t,next:null},hr===null){if(Fo===null)throw Error(F(308));hr=e,Fo.dependencies={lanes:0,firstContext:e}}else hr=hr.next=e;return t}var Ns=null;function Gd(e){Ns===null?Ns=[e]:Ns.push(e)}function px(e,t,n,s){var i=t.interleaved;return i===null?(n.next=n,Gd(t)):(n.next=i.next,i.next=n),t.interleaved=n,Cn(e,s)}function Cn(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Bn=!1;function qd(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function mx(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function wn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Yn(e,t,n){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,ce&2){var i=s.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),s.pending=t,Cn(e,n)}return i=s.interleaved,i===null?(t.next=t,Gd(s)):(t.next=i.next,i.next=t),s.interleaved=t,Cn(e,n)}function lo(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var s=t.lanes;s&=e.pendingLanes,n|=s,t.lanes=n,Rd(e,n)}}function ap(e,t){var n=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,n===s)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:s.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:s.shared,effects:s.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Vo(e,t,n,s){var i=e.updateQueue;Bn=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,l=i.shared.pending;if(l!==null){i.shared.pending=null;var c=l,u=c.next;c.next=null,o===null?a=u:o.next=u,o=c;var d=e.alternate;d!==null&&(d=d.updateQueue,l=d.lastBaseUpdate,l!==o&&(l===null?d.firstBaseUpdate=u:l.next=u,d.lastBaseUpdate=c))}if(a!==null){var p=i.baseState;o=0,d=u=c=null,l=a;do{var f=l.lane,m=l.eventTime;if((s&f)===f){d!==null&&(d=d.next={eventTime:m,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var b=e,y=l;switch(f=t,m=n,y.tag){case 1:if(b=y.payload,typeof b=="function"){p=b.call(m,p,f);break e}p=b;break e;case 3:b.flags=b.flags&-65537|128;case 0:if(b=y.payload,f=typeof b=="function"?b.call(m,p,f):b,f==null)break e;p=Se({},p,f);break e;case 2:Bn=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,f=i.effects,f===null?i.effects=[l]:f.push(l))}else m={eventTime:m,lane:f,tag:l.tag,payload:l.payload,callback:l.callback,next:null},d===null?(u=d=m,c=p):d=d.next=m,o|=f;if(l=l.next,l===null){if(l=i.shared.pending,l===null)break;f=l,l=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(!0);if(d===null&&(c=p),i.baseState=c,i.firstBaseUpdate=u,i.lastBaseUpdate=d,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else a===null&&(i.shared.lanes=0);Rs|=o,e.lanes=o,e.memoizedState=p}}function op(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var s=e[t],i=s.callback;if(i!==null){if(s.callback=null,s=n,typeof i!="function")throw Error(F(191,i));i.call(s)}}}var pa={},on=cs(pa),Wi=cs(pa),Ki=cs(pa);function Ss(e){if(e===pa)throw Error(F(174));return e}function Yd(e,t){switch(me(Ki,t),me(Wi,e),me(on,pa),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:iu(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=iu(t,e)}ye(on),me(on,t)}function Ar(){ye(on),ye(Wi),ye(Ki)}function gx(e){Ss(Ki.current);var t=Ss(on.current),n=iu(t,e.type);t!==n&&(me(Wi,e),me(on,n))}function Xd(e){Wi.current===e&&(ye(on),ye(Wi))}var ke=cs(0);function $o(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var cc=[];function Qd(){for(var e=0;e<cc.length;e++)cc[e]._workInProgressVersionPrimary=null;cc.length=0}var co=Tn.ReactCurrentDispatcher,uc=Tn.ReactCurrentBatchConfig,As=0,Ne=null,Le=null,Be=null,Uo=!1,ji=!1,Gi=0,d2=0;function Ge(){throw Error(F(321))}function Jd(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!qt(e[n],t[n]))return!1;return!0}function Zd(e,t,n,s,i,a){if(As=a,Ne=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,co.current=e===null||e.memoizedState===null?m2:g2,e=n(s,i),ji){a=0;do{if(ji=!1,Gi=0,25<=a)throw Error(F(301));a+=1,Be=Le=null,t.updateQueue=null,co.current=x2,e=n(s,i)}while(ji)}if(co.current=Ho,t=Le!==null&&Le.next!==null,As=0,Be=Le=Ne=null,Uo=!1,t)throw Error(F(300));return e}function eh(){var e=Gi!==0;return Gi=0,e}function tn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Be===null?Ne.memoizedState=Be=e:Be=Be.next=e,Be}function Rt(){if(Le===null){var e=Ne.alternate;e=e!==null?e.memoizedState:null}else e=Le.next;var t=Be===null?Ne.memoizedState:Be.next;if(t!==null)Be=t,Le=e;else{if(e===null)throw Error(F(310));Le=e,e={memoizedState:Le.memoizedState,baseState:Le.baseState,baseQueue:Le.baseQueue,queue:Le.queue,next:null},Be===null?Ne.memoizedState=Be=e:Be=Be.next=e}return Be}function qi(e,t){return typeof t=="function"?t(e):t}function dc(e){var t=Rt(),n=t.queue;if(n===null)throw Error(F(311));n.lastRenderedReducer=e;var s=Le,i=s.baseQueue,a=n.pending;if(a!==null){if(i!==null){var o=i.next;i.next=a.next,a.next=o}s.baseQueue=i=a,n.pending=null}if(i!==null){a=i.next,s=s.baseState;var l=o=null,c=null,u=a;do{var d=u.lane;if((As&d)===d)c!==null&&(c=c.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),s=u.hasEagerState?u.eagerState:e(s,u.action);else{var p={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};c===null?(l=c=p,o=s):c=c.next=p,Ne.lanes|=d,Rs|=d}u=u.next}while(u!==null&&u!==a);c===null?o=s:c.next=l,qt(s,t.memoizedState)||(ut=!0),t.memoizedState=s,t.baseState=o,t.baseQueue=c,n.lastRenderedState=s}if(e=n.interleaved,e!==null){i=e;do a=i.lane,Ne.lanes|=a,Rs|=a,i=i.next;while(i!==e)}else i===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function hc(e){var t=Rt(),n=t.queue;if(n===null)throw Error(F(311));n.lastRenderedReducer=e;var s=n.dispatch,i=n.pending,a=t.memoizedState;if(i!==null){n.pending=null;var o=i=i.next;do a=e(a,o.action),o=o.next;while(o!==i);qt(a,t.memoizedState)||(ut=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),n.lastRenderedState=a}return[a,s]}function xx(){}function yx(e,t){var n=Ne,s=Rt(),i=t(),a=!qt(s.memoizedState,i);if(a&&(s.memoizedState=i,ut=!0),s=s.queue,th(wx.bind(null,n,s,e),[e]),s.getSnapshot!==t||a||Be!==null&&Be.memoizedState.tag&1){if(n.flags|=2048,Yi(9,bx.bind(null,n,s,i,t),void 0,null),Fe===null)throw Error(F(349));As&30||vx(n,t,i)}return i}function vx(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Ne.updateQueue,t===null?(t={lastEffect:null,stores:null},Ne.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function bx(e,t,n,s){t.value=n,t.getSnapshot=s,kx(t)&&jx(e)}function wx(e,t,n){return n(function(){kx(t)&&jx(e)})}function kx(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!qt(e,n)}catch{return!0}}function jx(e){var t=Cn(e,1);t!==null&&Gt(t,e,1,-1)}function lp(e){var t=tn();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:qi,lastRenderedState:e},t.queue=e,e=e.dispatch=p2.bind(null,Ne,e),[t.memoizedState,e]}function Yi(e,t,n,s){return e={tag:e,create:t,destroy:n,deps:s,next:null},t=Ne.updateQueue,t===null?(t={lastEffect:null,stores:null},Ne.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(s=n.next,n.next=e,e.next=s,t.lastEffect=e)),e}function Nx(){return Rt().memoizedState}function uo(e,t,n,s){var i=tn();Ne.flags|=e,i.memoizedState=Yi(1|t,n,void 0,s===void 0?null:s)}function fl(e,t,n,s){var i=Rt();s=s===void 0?null:s;var a=void 0;if(Le!==null){var o=Le.memoizedState;if(a=o.destroy,s!==null&&Jd(s,o.deps)){i.memoizedState=Yi(t,n,a,s);return}}Ne.flags|=e,i.memoizedState=Yi(1|t,n,a,s)}function cp(e,t){return uo(8390656,8,e,t)}function th(e,t){return fl(2048,8,e,t)}function Sx(e,t){return fl(4,2,e,t)}function Cx(e,t){return fl(4,4,e,t)}function Ex(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function _x(e,t,n){return n=n!=null?n.concat([e]):null,fl(4,4,Ex.bind(null,t,e),n)}function nh(){}function Tx(e,t){var n=Rt();t=t===void 0?null:t;var s=n.memoizedState;return s!==null&&t!==null&&Jd(t,s[1])?s[0]:(n.memoizedState=[e,t],e)}function Px(e,t){var n=Rt();t=t===void 0?null:t;var s=n.memoizedState;return s!==null&&t!==null&&Jd(t,s[1])?s[0]:(e=e(),n.memoizedState=[e,t],e)}function Mx(e,t,n){return As&21?(qt(n,t)||(n=Og(),Ne.lanes|=n,Rs|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,ut=!0),e.memoizedState=n)}function h2(e,t){var n=he;he=n!==0&&4>n?n:4,e(!0);var s=uc.transition;uc.transition={};try{e(!1),t()}finally{he=n,uc.transition=s}}function Ax(){return Rt().memoizedState}function f2(e,t,n){var s=Qn(e);if(n={lane:s,action:n,hasEagerState:!1,eagerState:null,next:null},Rx(e))zx(t,n);else if(n=px(e,t,n,s),n!==null){var i=st();Gt(n,e,s,i),Lx(n,t,s)}}function p2(e,t,n){var s=Qn(e),i={lane:s,action:n,hasEagerState:!1,eagerState:null,next:null};if(Rx(e))zx(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,l=a(o,n);if(i.hasEagerState=!0,i.eagerState=l,qt(l,o)){var c=t.interleaved;c===null?(i.next=i,Gd(t)):(i.next=c.next,c.next=i),t.interleaved=i;return}}catch{}finally{}n=px(e,t,i,s),n!==null&&(i=st(),Gt(n,e,s,i),Lx(n,t,s))}}function Rx(e){var t=e.alternate;return e===Ne||t!==null&&t===Ne}function zx(e,t){ji=Uo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Lx(e,t,n){if(n&4194240){var s=t.lanes;s&=e.pendingLanes,n|=s,t.lanes=n,Rd(e,n)}}var Ho={readContext:At,useCallback:Ge,useContext:Ge,useEffect:Ge,useImperativeHandle:Ge,useInsertionEffect:Ge,useLayoutEffect:Ge,useMemo:Ge,useReducer:Ge,useRef:Ge,useState:Ge,useDebugValue:Ge,useDeferredValue:Ge,useTransition:Ge,useMutableSource:Ge,useSyncExternalStore:Ge,useId:Ge,unstable_isNewReconciler:!1},m2={readContext:At,useCallback:function(e,t){return tn().memoizedState=[e,t===void 0?null:t],e},useContext:At,useEffect:cp,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,uo(4194308,4,Ex.bind(null,t,e),n)},useLayoutEffect:function(e,t){return uo(4194308,4,e,t)},useInsertionEffect:function(e,t){return uo(4,2,e,t)},useMemo:function(e,t){var n=tn();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var s=tn();return t=n!==void 0?n(t):t,s.memoizedState=s.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},s.queue=e,e=e.dispatch=f2.bind(null,Ne,e),[s.memoizedState,e]},useRef:function(e){var t=tn();return e={current:e},t.memoizedState=e},useState:lp,useDebugValue:nh,useDeferredValue:function(e){return tn().memoizedState=e},useTransition:function(){var e=lp(!1),t=e[0];return e=h2.bind(null,e[1]),tn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var s=Ne,i=tn();if(we){if(n===void 0)throw Error(F(407));n=n()}else{if(n=t(),Fe===null)throw Error(F(349));As&30||vx(s,t,n)}i.memoizedState=n;var a={value:n,getSnapshot:t};return i.queue=a,cp(wx.bind(null,s,a,e),[e]),s.flags|=2048,Yi(9,bx.bind(null,s,a,n,t),void 0,null),n},useId:function(){var e=tn(),t=Fe.identifierPrefix;if(we){var n=bn,s=vn;n=(s&~(1<<32-Kt(s)-1)).toString(32)+n,t=":"+t+"R"+n,n=Gi++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=d2++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},g2={readContext:At,useCallback:Tx,useContext:At,useEffect:th,useImperativeHandle:_x,useInsertionEffect:Sx,useLayoutEffect:Cx,useMemo:Px,useReducer:dc,useRef:Nx,useState:function(){return dc(qi)},useDebugValue:nh,useDeferredValue:function(e){var t=Rt();return Mx(t,Le.memoizedState,e)},useTransition:function(){var e=dc(qi)[0],t=Rt().memoizedState;return[e,t]},useMutableSource:xx,useSyncExternalStore:yx,useId:Ax,unstable_isNewReconciler:!1},x2={readContext:At,useCallback:Tx,useContext:At,useEffect:th,useImperativeHandle:_x,useInsertionEffect:Sx,useLayoutEffect:Cx,useMemo:Px,useReducer:hc,useRef:Nx,useState:function(){return hc(qi)},useDebugValue:nh,useDeferredValue:function(e){var t=Rt();return Le===null?t.memoizedState=e:Mx(t,Le.memoizedState,e)},useTransition:function(){var e=hc(qi)[0],t=Rt().memoizedState;return[e,t]},useMutableSource:xx,useSyncExternalStore:yx,useId:Ax,unstable_isNewReconciler:!1};function $t(e,t){if(e&&e.defaultProps){t=Se({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Cu(e,t,n,s){t=e.memoizedState,n=n(s,t),n=n==null?t:Se({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var pl={isMounted:function(e){return(e=e._reactInternals)?Fs(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var s=st(),i=Qn(e),a=wn(s,i);a.payload=t,n!=null&&(a.callback=n),t=Yn(e,a,i),t!==null&&(Gt(t,e,i,s),lo(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var s=st(),i=Qn(e),a=wn(s,i);a.tag=1,a.payload=t,n!=null&&(a.callback=n),t=Yn(e,a,i),t!==null&&(Gt(t,e,i,s),lo(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=st(),s=Qn(e),i=wn(n,s);i.tag=2,t!=null&&(i.callback=t),t=Yn(e,i,s),t!==null&&(Gt(t,e,s,n),lo(t,e,s))}};function up(e,t,n,s,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,a,o):t.prototype&&t.prototype.isPureReactComponent?!Vi(n,s)||!Vi(i,a):!0}function Ox(e,t,n){var s=!1,i=ss,a=t.contextType;return typeof a=="object"&&a!==null?a=At(a):(i=ht(t)?Ps:Ze.current,s=t.contextTypes,a=(s=s!=null)?Tr(e,i):ss),t=new t(n,a),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=pl,e.stateNode=t,t._reactInternals=e,s&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=a),t}function dp(e,t,n,s){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,s),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,s),t.state!==e&&pl.enqueueReplaceState(t,t.state,null)}function Eu(e,t,n,s){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},qd(e);var a=t.contextType;typeof a=="object"&&a!==null?i.context=At(a):(a=ht(t)?Ps:Ze.current,i.context=Tr(e,a)),i.state=e.memoizedState,a=t.getDerivedStateFromProps,typeof a=="function"&&(Cu(e,t,a,n),i.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(t=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),t!==i.state&&pl.enqueueReplaceState(i,i.state,null),Vo(e,n,i,s),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function Rr(e,t){try{var n="",s=t;do n+=Wb(s),s=s.return;while(s);var i=n}catch(a){i=`
37
+ `+i[o].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=o&&0<=l);break}}}finally{Gl=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?ci(e):""}function Wb(e){switch(e.tag){case 5:return ci(e.type);case 16:return ci("Lazy");case 13:return ci("Suspense");case 19:return ci("SuspenseList");case 0:case 2:case 15:return e=ql(e.type,!1),e;case 11:return e=ql(e.type.render,!1),e;case 1:return e=ql(e.type,!0),e;default:return""}}function eu(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case ir:return"Fragment";case rr:return"Portal";case Qc:return"Profiler";case _d:return"StrictMode";case Jc:return"Suspense";case Zc:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case mg:return(e.displayName||"Context")+".Consumer";case pg:return(e._context.displayName||"Context")+".Provider";case Td:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Pd:return t=e.displayName||null,t!==null?t:eu(e.type)||"Memo";case In:t=e._payload,e=e._init;try{return eu(e(t))}catch{}}return null}function Kb(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return eu(t);case 8:return t===_d?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function ns(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function xg(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Gb(e){var t=xg(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),s=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(o){s=""+o,a.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return s},setValue:function(o){s=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ca(e){e._valueTracker||(e._valueTracker=Gb(e))}function yg(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),s="";return e&&(s=xg(e)?e.checked?"true":"false":e.value),e=s,e!==n?(t.setValue(e),!0):!1}function Co(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function tu(e,t){var n=t.checked;return Se({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function _f(e,t){var n=t.defaultValue==null?"":t.defaultValue,s=t.checked!=null?t.checked:t.defaultChecked;n=ns(t.value!=null?t.value:n),e._wrapperState={initialChecked:s,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function vg(e,t){t=t.checked,t!=null&&Ed(e,"checked",t,!1)}function nu(e,t){vg(e,t);var n=ns(t.value),s=t.type;if(n!=null)s==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(s==="submit"||s==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?su(e,t.type,n):t.hasOwnProperty("defaultValue")&&su(e,t.type,ns(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Tf(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var s=t.type;if(!(s!=="submit"&&s!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function su(e,t,n){(t!=="number"||Co(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var ui=Array.isArray;function kr(e,t,n,s){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&s&&(e[n].defaultSelected=!0)}else{for(n=""+ns(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,s&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function ru(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(F(91));return Se({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Pf(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(F(92));if(ui(n)){if(1<n.length)throw Error(F(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:ns(n)}}function bg(e,t){var n=ns(t.value),s=ns(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),s!=null&&(e.defaultValue=""+s)}function Af(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function wg(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function iu(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?wg(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Ea,kg=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,s,i){MSApp.execUnsafeLocalFunction(function(){return e(t,n,s,i)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Ea=Ea||document.createElement("div"),Ea.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Ea.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Li(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var yi={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},qb=["Webkit","ms","Moz","O"];Object.keys(yi).forEach(function(e){qb.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),yi[t]=yi[e]})});function jg(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||yi.hasOwnProperty(e)&&yi[e]?(""+t).trim():t+"px"}function Ng(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var s=n.indexOf("--")===0,i=jg(n,t[n],s);n==="float"&&(n="cssFloat"),s?e.setProperty(n,i):e[n]=i}}var Yb=Se({menuitem:!0},{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});function au(e,t){if(t){if(Yb[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(F(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(F(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(F(61))}if(t.style!=null&&typeof t.style!="object")throw Error(F(62))}}function ou(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){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 lu=null;function Ad(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var cu=null,jr=null,Nr=null;function Mf(e){if(e=fa(e)){if(typeof cu!="function")throw Error(F(280));var t=e.stateNode;t&&(t=dl(t),cu(e.stateNode,e.type,t))}}function Sg(e){jr?Nr?Nr.push(e):Nr=[e]:jr=e}function Cg(){if(jr){var e=jr,t=Nr;if(Nr=jr=null,Mf(e),t)for(e=0;e<t.length;e++)Mf(t[e])}}function Eg(e,t){return e(t)}function _g(){}var Yl=!1;function Tg(e,t,n){if(Yl)return e(t,n);Yl=!0;try{return Eg(e,t,n)}finally{Yl=!1,(jr!==null||Nr!==null)&&(_g(),Cg())}}function Oi(e,t){var n=e.stateNode;if(n===null)return null;var s=dl(n);if(s===null)return null;n=s[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(s=!s.disabled)||(e=e.type,s=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!s;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(F(231,t,typeof n));return n}var uu=!1;if(Nn)try{var Zr={};Object.defineProperty(Zr,"passive",{get:function(){uu=!0}}),window.addEventListener("test",Zr,Zr),window.removeEventListener("test",Zr,Zr)}catch{uu=!1}function Xb(e,t,n,s,i,a,o,l,c){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(d){this.onError(d)}}var vi=!1,Eo=null,_o=!1,du=null,Qb={onError:function(e){vi=!0,Eo=e}};function Jb(e,t,n,s,i,a,o,l,c){vi=!1,Eo=null,Xb.apply(Qb,arguments)}function Zb(e,t,n,s,i,a,o,l,c){if(Jb.apply(this,arguments),vi){if(vi){var u=Eo;vi=!1,Eo=null}else throw Error(F(198));_o||(_o=!0,du=u)}}function Fs(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function Pg(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function Rf(e){if(Fs(e)!==e)throw Error(F(188))}function ew(e){var t=e.alternate;if(!t){if(t=Fs(e),t===null)throw Error(F(188));return t!==e?null:e}for(var n=e,s=t;;){var i=n.return;if(i===null)break;var a=i.alternate;if(a===null){if(s=i.return,s!==null){n=s;continue}break}if(i.child===a.child){for(a=i.child;a;){if(a===n)return Rf(i),e;if(a===s)return Rf(i),t;a=a.sibling}throw Error(F(188))}if(n.return!==s.return)n=i,s=a;else{for(var o=!1,l=i.child;l;){if(l===n){o=!0,n=i,s=a;break}if(l===s){o=!0,s=i,n=a;break}l=l.sibling}if(!o){for(l=a.child;l;){if(l===n){o=!0,n=a,s=i;break}if(l===s){o=!0,s=a,n=i;break}l=l.sibling}if(!o)throw Error(F(189))}}if(n.alternate!==s)throw Error(F(190))}if(n.tag!==3)throw Error(F(188));return n.stateNode.current===n?e:t}function Ag(e){return e=ew(e),e!==null?Mg(e):null}function Mg(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Mg(e);if(t!==null)return t;e=e.sibling}return null}var Rg=vt.unstable_scheduleCallback,zf=vt.unstable_cancelCallback,tw=vt.unstable_shouldYield,nw=vt.unstable_requestPaint,Pe=vt.unstable_now,sw=vt.unstable_getCurrentPriorityLevel,Md=vt.unstable_ImmediatePriority,zg=vt.unstable_UserBlockingPriority,To=vt.unstable_NormalPriority,rw=vt.unstable_LowPriority,Lg=vt.unstable_IdlePriority,ol=null,an=null;function iw(e){if(an&&typeof an.onCommitFiberRoot=="function")try{an.onCommitFiberRoot(ol,e,void 0,(e.current.flags&128)===128)}catch{}}var Kt=Math.clz32?Math.clz32:lw,aw=Math.log,ow=Math.LN2;function lw(e){return e>>>=0,e===0?32:31-(aw(e)/ow|0)|0}var _a=64,Ta=4194304;function di(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Po(e,t){var n=e.pendingLanes;if(n===0)return 0;var s=0,i=e.suspendedLanes,a=e.pingedLanes,o=n&268435455;if(o!==0){var l=o&~i;l!==0?s=di(l):(a&=o,a!==0&&(s=di(a)))}else o=n&~i,o!==0?s=di(o):a!==0&&(s=di(a));if(s===0)return 0;if(t!==0&&t!==s&&!(t&i)&&(i=s&-s,a=t&-t,i>=a||i===16&&(a&4194240)!==0))return t;if(s&4&&(s|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=s;0<t;)n=31-Kt(t),i=1<<n,s|=e[n],t&=~i;return s}function cw(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function uw(e,t){for(var n=e.suspendedLanes,s=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes;0<a;){var o=31-Kt(a),l=1<<o,c=i[o];c===-1?(!(l&n)||l&s)&&(i[o]=cw(l,t)):c<=t&&(e.expiredLanes|=l),a&=~l}}function hu(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Og(){var e=_a;return _a<<=1,!(_a&4194240)&&(_a=64),e}function Xl(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function da(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Kt(t),e[t]=n}function dw(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var s=e.eventTimes;for(e=e.expirationTimes;0<n;){var i=31-Kt(n),a=1<<i;t[i]=0,s[i]=-1,e[i]=-1,n&=~a}}function Rd(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var s=31-Kt(n),i=1<<s;i&t|e[s]&t&&(e[s]|=t),n&=~i}}var he=0;function Dg(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Ig,zd,Bg,Fg,Vg,fu=!1,Pa=[],Wn=null,Kn=null,Gn=null,Di=new Map,Ii=new Map,Fn=[],hw="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".split(" ");function Lf(e,t){switch(e){case"focusin":case"focusout":Wn=null;break;case"dragenter":case"dragleave":Kn=null;break;case"mouseover":case"mouseout":Gn=null;break;case"pointerover":case"pointerout":Di.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ii.delete(t.pointerId)}}function ei(e,t,n,s,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:s,nativeEvent:a,targetContainers:[i]},t!==null&&(t=fa(t),t!==null&&zd(t)),e):(e.eventSystemFlags|=s,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function fw(e,t,n,s,i){switch(t){case"focusin":return Wn=ei(Wn,e,t,n,s,i),!0;case"dragenter":return Kn=ei(Kn,e,t,n,s,i),!0;case"mouseover":return Gn=ei(Gn,e,t,n,s,i),!0;case"pointerover":var a=i.pointerId;return Di.set(a,ei(Di.get(a)||null,e,t,n,s,i)),!0;case"gotpointercapture":return a=i.pointerId,Ii.set(a,ei(Ii.get(a)||null,e,t,n,s,i)),!0}return!1}function $g(e){var t=js(e.target);if(t!==null){var n=Fs(t);if(n!==null){if(t=n.tag,t===13){if(t=Pg(n),t!==null){e.blockedOn=t,Vg(e.priority,function(){Bg(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function io(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=pu(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var s=new n.constructor(n.type,n);lu=s,n.target.dispatchEvent(s),lu=null}else return t=fa(n),t!==null&&zd(t),e.blockedOn=n,!1;t.shift()}return!0}function Of(e,t,n){io(e)&&n.delete(t)}function pw(){fu=!1,Wn!==null&&io(Wn)&&(Wn=null),Kn!==null&&io(Kn)&&(Kn=null),Gn!==null&&io(Gn)&&(Gn=null),Di.forEach(Of),Ii.forEach(Of)}function ti(e,t){e.blockedOn===t&&(e.blockedOn=null,fu||(fu=!0,vt.unstable_scheduleCallback(vt.unstable_NormalPriority,pw)))}function Bi(e){function t(i){return ti(i,e)}if(0<Pa.length){ti(Pa[0],e);for(var n=1;n<Pa.length;n++){var s=Pa[n];s.blockedOn===e&&(s.blockedOn=null)}}for(Wn!==null&&ti(Wn,e),Kn!==null&&ti(Kn,e),Gn!==null&&ti(Gn,e),Di.forEach(t),Ii.forEach(t),n=0;n<Fn.length;n++)s=Fn[n],s.blockedOn===e&&(s.blockedOn=null);for(;0<Fn.length&&(n=Fn[0],n.blockedOn===null);)$g(n),n.blockedOn===null&&Fn.shift()}var Sr=Tn.ReactCurrentBatchConfig,Ao=!0;function mw(e,t,n,s){var i=he,a=Sr.transition;Sr.transition=null;try{he=1,Ld(e,t,n,s)}finally{he=i,Sr.transition=a}}function gw(e,t,n,s){var i=he,a=Sr.transition;Sr.transition=null;try{he=4,Ld(e,t,n,s)}finally{he=i,Sr.transition=a}}function Ld(e,t,n,s){if(Ao){var i=pu(e,t,n,s);if(i===null)ac(e,t,s,Mo,n),Lf(e,s);else if(fw(i,e,t,n,s))s.stopPropagation();else if(Lf(e,s),t&4&&-1<hw.indexOf(e)){for(;i!==null;){var a=fa(i);if(a!==null&&Ig(a),a=pu(e,t,n,s),a===null&&ac(e,t,s,Mo,n),a===i)break;i=a}i!==null&&s.stopPropagation()}else ac(e,t,s,null,n)}}var Mo=null;function pu(e,t,n,s){if(Mo=null,e=Ad(s),e=js(e),e!==null)if(t=Fs(e),t===null)e=null;else if(n=t.tag,n===13){if(e=Pg(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Mo=e,null}function Ug(e){switch(e){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 1;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 4;case"message":switch(sw()){case Md:return 1;case zg:return 4;case To:case rw:return 16;case Lg:return 536870912;default:return 16}default:return 16}}var $n=null,Od=null,ao=null;function Hg(){if(ao)return ao;var e,t=Od,n=t.length,s,i="value"in $n?$n.value:$n.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(s=1;s<=o&&t[n-s]===i[a-s];s++);return ao=i.slice(e,1<s?1-s:void 0)}function oo(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Aa(){return!0}function Df(){return!1}function jt(e){function t(n,s,i,a,o){this._reactName=n,this._targetInst=i,this.type=s,this.nativeEvent=a,this.target=o,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(n=e[l],this[l]=n?n(a):a[l]);return this.isDefaultPrevented=(a.defaultPrevented!=null?a.defaultPrevented:a.returnValue===!1)?Aa:Df,this.isPropagationStopped=Df,this}return Se(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Aa)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Aa)},persist:function(){},isPersistent:Aa}),t}var Vr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Dd=jt(Vr),ha=Se({},Vr,{view:0,detail:0}),xw=jt(ha),Ql,Jl,ni,ll=Se({},ha,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Id,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==ni&&(ni&&e.type==="mousemove"?(Ql=e.screenX-ni.screenX,Jl=e.screenY-ni.screenY):Jl=Ql=0,ni=e),Ql)},movementY:function(e){return"movementY"in e?e.movementY:Jl}}),If=jt(ll),yw=Se({},ll,{dataTransfer:0}),vw=jt(yw),bw=Se({},ha,{relatedTarget:0}),Zl=jt(bw),ww=Se({},Vr,{animationName:0,elapsedTime:0,pseudoElement:0}),kw=jt(ww),jw=Se({},Vr,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Nw=jt(jw),Sw=Se({},Vr,{data:0}),Bf=jt(Sw),Cw={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Ew={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"},_w={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Tw(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=_w[e])?!!t[e]:!1}function Id(){return Tw}var Pw=Se({},ha,{key:function(e){if(e.key){var t=Cw[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=oo(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Ew[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Id,charCode:function(e){return e.type==="keypress"?oo(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?oo(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Aw=jt(Pw),Mw=Se({},ll,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ff=jt(Mw),Rw=Se({},ha,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Id}),zw=jt(Rw),Lw=Se({},Vr,{propertyName:0,elapsedTime:0,pseudoElement:0}),Ow=jt(Lw),Dw=Se({},ll,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Iw=jt(Dw),Bw=[9,13,27,32],Bd=Nn&&"CompositionEvent"in window,bi=null;Nn&&"documentMode"in document&&(bi=document.documentMode);var Fw=Nn&&"TextEvent"in window&&!bi,Wg=Nn&&(!Bd||bi&&8<bi&&11>=bi),Vf=" ",$f=!1;function Kg(e,t){switch(e){case"keyup":return Bw.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Gg(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ar=!1;function Vw(e,t){switch(e){case"compositionend":return Gg(t);case"keypress":return t.which!==32?null:($f=!0,Vf);case"textInput":return e=t.data,e===Vf&&$f?null:e;default:return null}}function $w(e,t){if(ar)return e==="compositionend"||!Bd&&Kg(e,t)?(e=Hg(),ao=Od=$n=null,ar=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Wg&&t.locale!=="ko"?null:t.data;default:return null}}var Uw={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 Uf(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Uw[e.type]:t==="textarea"}function qg(e,t,n,s){Sg(s),t=Ro(t,"onChange"),0<t.length&&(n=new Dd("onChange","change",null,n,s),e.push({event:n,listeners:t}))}var wi=null,Fi=null;function Hw(e){ix(e,0)}function cl(e){var t=cr(e);if(yg(t))return e}function Ww(e,t){if(e==="change")return t}var Yg=!1;if(Nn){var ec;if(Nn){var tc="oninput"in document;if(!tc){var Hf=document.createElement("div");Hf.setAttribute("oninput","return;"),tc=typeof Hf.oninput=="function"}ec=tc}else ec=!1;Yg=ec&&(!document.documentMode||9<document.documentMode)}function Wf(){wi&&(wi.detachEvent("onpropertychange",Xg),Fi=wi=null)}function Xg(e){if(e.propertyName==="value"&&cl(Fi)){var t=[];qg(t,Fi,e,Ad(e)),Tg(Hw,t)}}function Kw(e,t,n){e==="focusin"?(Wf(),wi=t,Fi=n,wi.attachEvent("onpropertychange",Xg)):e==="focusout"&&Wf()}function Gw(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return cl(Fi)}function qw(e,t){if(e==="click")return cl(t)}function Yw(e,t){if(e==="input"||e==="change")return cl(t)}function Xw(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var qt=typeof Object.is=="function"?Object.is:Xw;function Vi(e,t){if(qt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),s=Object.keys(t);if(n.length!==s.length)return!1;for(s=0;s<n.length;s++){var i=n[s];if(!Xc.call(t,i)||!qt(e[i],t[i]))return!1}return!0}function Kf(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Gf(e,t){var n=Kf(e);e=0;for(var s;n;){if(n.nodeType===3){if(s=e+n.textContent.length,e<=t&&s>=t)return{node:n,offset:t-e};e=s}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Kf(n)}}function Qg(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Qg(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Jg(){for(var e=window,t=Co();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Co(e.document)}return t}function Fd(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function Qw(e){var t=Jg(),n=e.focusedElem,s=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Qg(n.ownerDocument.documentElement,n)){if(s!==null&&Fd(n)){if(t=s.start,e=s.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,a=Math.min(s.start,i);s=s.end===void 0?a:Math.min(s.end,i),!e.extend&&a>s&&(i=s,s=a,a=i),i=Gf(n,a);var o=Gf(n,s);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),a>s?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var Jw=Nn&&"documentMode"in document&&11>=document.documentMode,or=null,mu=null,ki=null,gu=!1;function qf(e,t,n){var s=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;gu||or==null||or!==Co(s)||(s=or,"selectionStart"in s&&Fd(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),ki&&Vi(ki,s)||(ki=s,s=Ro(mu,"onSelect"),0<s.length&&(t=new Dd("onSelect","select",null,t,n),e.push({event:t,listeners:s}),t.target=or)))}function Ma(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var lr={animationend:Ma("Animation","AnimationEnd"),animationiteration:Ma("Animation","AnimationIteration"),animationstart:Ma("Animation","AnimationStart"),transitionend:Ma("Transition","TransitionEnd")},nc={},Zg={};Nn&&(Zg=document.createElement("div").style,"AnimationEvent"in window||(delete lr.animationend.animation,delete lr.animationiteration.animation,delete lr.animationstart.animation),"TransitionEvent"in window||delete lr.transitionend.transition);function ul(e){if(nc[e])return nc[e];if(!lr[e])return e;var t=lr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Zg)return nc[e]=t[n];return e}var ex=ul("animationend"),tx=ul("animationiteration"),nx=ul("animationstart"),sx=ul("transitionend"),rx=new Map,Yf="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".split(" ");function ls(e,t){rx.set(e,t),Bs(t,[e])}for(var sc=0;sc<Yf.length;sc++){var rc=Yf[sc],Zw=rc.toLowerCase(),e2=rc[0].toUpperCase()+rc.slice(1);ls(Zw,"on"+e2)}ls(ex,"onAnimationEnd");ls(tx,"onAnimationIteration");ls(nx,"onAnimationStart");ls("dblclick","onDoubleClick");ls("focusin","onFocus");ls("focusout","onBlur");ls(sx,"onTransitionEnd");Tr("onMouseEnter",["mouseout","mouseover"]);Tr("onMouseLeave",["mouseout","mouseover"]);Tr("onPointerEnter",["pointerout","pointerover"]);Tr("onPointerLeave",["pointerout","pointerover"]);Bs("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Bs("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Bs("onBeforeInput",["compositionend","keypress","textInput","paste"]);Bs("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Bs("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Bs("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var hi="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),t2=new Set("cancel close invalid load scroll toggle".split(" ").concat(hi));function Xf(e,t,n){var s=e.type||"unknown-event";e.currentTarget=n,Zb(s,t,void 0,e),e.currentTarget=null}function ix(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var s=e[n],i=s.event;s=s.listeners;e:{var a=void 0;if(t)for(var o=s.length-1;0<=o;o--){var l=s[o],c=l.instance,u=l.currentTarget;if(l=l.listener,c!==a&&i.isPropagationStopped())break e;Xf(i,l,u),a=c}else for(o=0;o<s.length;o++){if(l=s[o],c=l.instance,u=l.currentTarget,l=l.listener,c!==a&&i.isPropagationStopped())break e;Xf(i,l,u),a=c}}}if(_o)throw e=du,_o=!1,du=null,e}function ge(e,t){var n=t[wu];n===void 0&&(n=t[wu]=new Set);var s=e+"__bubble";n.has(s)||(ax(t,e,2,!1),n.add(s))}function ic(e,t,n){var s=0;t&&(s|=4),ax(n,e,s,t)}var Ra="_reactListening"+Math.random().toString(36).slice(2);function $i(e){if(!e[Ra]){e[Ra]=!0,fg.forEach(function(n){n!=="selectionchange"&&(t2.has(n)||ic(n,!1,e),ic(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ra]||(t[Ra]=!0,ic("selectionchange",!1,t))}}function ax(e,t,n,s){switch(Ug(t)){case 1:var i=mw;break;case 4:i=gw;break;default:i=Ld}n=i.bind(null,t,n,e),i=void 0,!uu||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),s?i!==void 0?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):i!==void 0?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function ac(e,t,n,s,i){var a=s;if(!(t&1)&&!(t&2)&&s!==null)e:for(;;){if(s===null)return;var o=s.tag;if(o===3||o===4){var l=s.stateNode.containerInfo;if(l===i||l.nodeType===8&&l.parentNode===i)break;if(o===4)for(o=s.return;o!==null;){var c=o.tag;if((c===3||c===4)&&(c=o.stateNode.containerInfo,c===i||c.nodeType===8&&c.parentNode===i))return;o=o.return}for(;l!==null;){if(o=js(l),o===null)return;if(c=o.tag,c===5||c===6){s=a=o;continue e}l=l.parentNode}}s=s.return}Tg(function(){var u=a,d=Ad(n),p=[];e:{var f=rx.get(e);if(f!==void 0){var m=Dd,v=e;switch(e){case"keypress":if(oo(n)===0)break e;case"keydown":case"keyup":m=Aw;break;case"focusin":v="focus",m=Zl;break;case"focusout":v="blur",m=Zl;break;case"beforeblur":case"afterblur":m=Zl;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":m=If;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":m=vw;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":m=zw;break;case ex:case tx:case nx:m=kw;break;case sx:m=Ow;break;case"scroll":m=xw;break;case"wheel":m=Iw;break;case"copy":case"cut":case"paste":m=Nw;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":m=Ff}var y=(t&4)!==0,b=!y&&e==="scroll",g=y?f!==null?f+"Capture":null:f;y=[];for(var x=u,w;x!==null;){w=x;var j=w.stateNode;if(w.tag===5&&j!==null&&(w=j,g!==null&&(j=Oi(x,g),j!=null&&y.push(Ui(x,j,w)))),b)break;x=x.return}0<y.length&&(f=new m(f,v,null,n,d),p.push({event:f,listeners:y}))}}if(!(t&7)){e:{if(f=e==="mouseover"||e==="pointerover",m=e==="mouseout"||e==="pointerout",f&&n!==lu&&(v=n.relatedTarget||n.fromElement)&&(js(v)||v[Sn]))break e;if((m||f)&&(f=d.window===d?d:(f=d.ownerDocument)?f.defaultView||f.parentWindow:window,m?(v=n.relatedTarget||n.toElement,m=u,v=v?js(v):null,v!==null&&(b=Fs(v),v!==b||v.tag!==5&&v.tag!==6)&&(v=null)):(m=null,v=u),m!==v)){if(y=If,j="onMouseLeave",g="onMouseEnter",x="mouse",(e==="pointerout"||e==="pointerover")&&(y=Ff,j="onPointerLeave",g="onPointerEnter",x="pointer"),b=m==null?f:cr(m),w=v==null?f:cr(v),f=new y(j,x+"leave",m,n,d),f.target=b,f.relatedTarget=w,j=null,js(d)===u&&(y=new y(g,x+"enter",v,n,d),y.target=w,y.relatedTarget=b,j=y),b=j,m&&v)t:{for(y=m,g=v,x=0,w=y;w;w=Js(w))x++;for(w=0,j=g;j;j=Js(j))w++;for(;0<x-w;)y=Js(y),x--;for(;0<w-x;)g=Js(g),w--;for(;x--;){if(y===g||g!==null&&y===g.alternate)break t;y=Js(y),g=Js(g)}y=null}else y=null;m!==null&&Qf(p,f,m,y,!1),v!==null&&b!==null&&Qf(p,b,v,y,!0)}}e:{if(f=u?cr(u):window,m=f.nodeName&&f.nodeName.toLowerCase(),m==="select"||m==="input"&&f.type==="file")var k=Ww;else if(Uf(f))if(Yg)k=Yw;else{k=Gw;var N=Kw}else(m=f.nodeName)&&m.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(k=qw);if(k&&(k=k(e,u))){qg(p,k,n,d);break e}N&&N(e,f,u),e==="focusout"&&(N=f._wrapperState)&&N.controlled&&f.type==="number"&&su(f,"number",f.value)}switch(N=u?cr(u):window,e){case"focusin":(Uf(N)||N.contentEditable==="true")&&(or=N,mu=u,ki=null);break;case"focusout":ki=mu=or=null;break;case"mousedown":gu=!0;break;case"contextmenu":case"mouseup":case"dragend":gu=!1,qf(p,n,d);break;case"selectionchange":if(Jw)break;case"keydown":case"keyup":qf(p,n,d)}var S;if(Bd)e:{switch(e){case"compositionstart":var E="onCompositionStart";break e;case"compositionend":E="onCompositionEnd";break e;case"compositionupdate":E="onCompositionUpdate";break e}E=void 0}else ar?Kg(e,n)&&(E="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(E="onCompositionStart");E&&(Wg&&n.locale!=="ko"&&(ar||E!=="onCompositionStart"?E==="onCompositionEnd"&&ar&&(S=Hg()):($n=d,Od="value"in $n?$n.value:$n.textContent,ar=!0)),N=Ro(u,E),0<N.length&&(E=new Bf(E,e,null,n,d),p.push({event:E,listeners:N}),S?E.data=S:(S=Gg(n),S!==null&&(E.data=S)))),(S=Fw?Vw(e,n):$w(e,n))&&(u=Ro(u,"onBeforeInput"),0<u.length&&(d=new Bf("onBeforeInput","beforeinput",null,n,d),p.push({event:d,listeners:u}),d.data=S))}ix(p,t)})}function Ui(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ro(e,t){for(var n=t+"Capture",s=[];e!==null;){var i=e,a=i.stateNode;i.tag===5&&a!==null&&(i=a,a=Oi(e,n),a!=null&&s.unshift(Ui(e,a,i)),a=Oi(e,t),a!=null&&s.push(Ui(e,a,i))),e=e.return}return s}function Js(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Qf(e,t,n,s,i){for(var a=t._reactName,o=[];n!==null&&n!==s;){var l=n,c=l.alternate,u=l.stateNode;if(c!==null&&c===s)break;l.tag===5&&u!==null&&(l=u,i?(c=Oi(n,a),c!=null&&o.unshift(Ui(n,c,l))):i||(c=Oi(n,a),c!=null&&o.push(Ui(n,c,l)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var n2=/\r\n?/g,s2=/\u0000|\uFFFD/g;function Jf(e){return(typeof e=="string"?e:""+e).replace(n2,`
38
+ `).replace(s2,"")}function za(e,t,n){if(t=Jf(t),Jf(e)!==t&&n)throw Error(F(425))}function zo(){}var xu=null,yu=null;function vu(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var bu=typeof setTimeout=="function"?setTimeout:void 0,r2=typeof clearTimeout=="function"?clearTimeout:void 0,Zf=typeof Promise=="function"?Promise:void 0,i2=typeof queueMicrotask=="function"?queueMicrotask:typeof Zf<"u"?function(e){return Zf.resolve(null).then(e).catch(a2)}:bu;function a2(e){setTimeout(function(){throw e})}function oc(e,t){var n=t,s=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(s===0){e.removeChild(i),Bi(t);return}s--}else n!=="$"&&n!=="$?"&&n!=="$!"||s++;n=i}while(n);Bi(t)}function qn(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function ep(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var $r=Math.random().toString(36).slice(2),nn="__reactFiber$"+$r,Hi="__reactProps$"+$r,Sn="__reactContainer$"+$r,wu="__reactEvents$"+$r,o2="__reactListeners$"+$r,l2="__reactHandles$"+$r;function js(e){var t=e[nn];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Sn]||n[nn]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=ep(e);e!==null;){if(n=e[nn])return n;e=ep(e)}return t}e=n,n=e.parentNode}return null}function fa(e){return e=e[nn]||e[Sn],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function cr(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(F(33))}function dl(e){return e[Hi]||null}var ku=[],ur=-1;function cs(e){return{current:e}}function ye(e){0>ur||(e.current=ku[ur],ku[ur]=null,ur--)}function me(e,t){ur++,ku[ur]=e.current,e.current=t}var ss={},Ze=cs(ss),dt=cs(!1),Ps=ss;function Pr(e,t){var n=e.type.contextTypes;if(!n)return ss;var s=e.stateNode;if(s&&s.__reactInternalMemoizedUnmaskedChildContext===t)return s.__reactInternalMemoizedMaskedChildContext;var i={},a;for(a in n)i[a]=t[a];return s&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function ht(e){return e=e.childContextTypes,e!=null}function Lo(){ye(dt),ye(Ze)}function tp(e,t,n){if(Ze.current!==ss)throw Error(F(168));me(Ze,t),me(dt,n)}function ox(e,t,n){var s=e.stateNode;if(t=t.childContextTypes,typeof s.getChildContext!="function")return n;s=s.getChildContext();for(var i in s)if(!(i in t))throw Error(F(108,Kb(e)||"Unknown",i));return Se({},n,s)}function Oo(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ss,Ps=Ze.current,me(Ze,e),me(dt,dt.current),!0}function np(e,t,n){var s=e.stateNode;if(!s)throw Error(F(169));n?(e=ox(e,t,Ps),s.__reactInternalMemoizedMergedChildContext=e,ye(dt),ye(Ze),me(Ze,e)):ye(dt),me(dt,n)}var xn=null,hl=!1,lc=!1;function lx(e){xn===null?xn=[e]:xn.push(e)}function c2(e){hl=!0,lx(e)}function us(){if(!lc&&xn!==null){lc=!0;var e=0,t=he;try{var n=xn;for(he=1;e<n.length;e++){var s=n[e];do s=s(!0);while(s!==null)}xn=null,hl=!1}catch(i){throw xn!==null&&(xn=xn.slice(e+1)),Rg(Md,us),i}finally{he=t,lc=!1}}return null}var dr=[],hr=0,Do=null,Io=0,Ct=[],Et=0,As=null,vn=1,bn="";function vs(e,t){dr[hr++]=Io,dr[hr++]=Do,Do=e,Io=t}function cx(e,t,n){Ct[Et++]=vn,Ct[Et++]=bn,Ct[Et++]=As,As=e;var s=vn;e=bn;var i=32-Kt(s)-1;s&=~(1<<i),n+=1;var a=32-Kt(t)+i;if(30<a){var o=i-i%5;a=(s&(1<<o)-1).toString(32),s>>=o,i-=o,vn=1<<32-Kt(t)+i|n<<i|s,bn=a+e}else vn=1<<a|n<<i|s,bn=e}function Vd(e){e.return!==null&&(vs(e,1),cx(e,1,0))}function $d(e){for(;e===Do;)Do=dr[--hr],dr[hr]=null,Io=dr[--hr],dr[hr]=null;for(;e===As;)As=Ct[--Et],Ct[Et]=null,bn=Ct[--Et],Ct[Et]=null,vn=Ct[--Et],Ct[Et]=null}var xt=null,gt=null,we=!1,Wt=null;function ux(e,t){var n=Tt(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function sp(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,xt=e,gt=qn(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,xt=e,gt=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=As!==null?{id:vn,overflow:bn}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Tt(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,xt=e,gt=null,!0):!1;default:return!1}}function ju(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Nu(e){if(we){var t=gt;if(t){var n=t;if(!sp(e,t)){if(ju(e))throw Error(F(418));t=qn(n.nextSibling);var s=xt;t&&sp(e,t)?ux(s,n):(e.flags=e.flags&-4097|2,we=!1,xt=e)}}else{if(ju(e))throw Error(F(418));e.flags=e.flags&-4097|2,we=!1,xt=e}}}function rp(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;xt=e}function La(e){if(e!==xt)return!1;if(!we)return rp(e),we=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!vu(e.type,e.memoizedProps)),t&&(t=gt)){if(ju(e))throw dx(),Error(F(418));for(;t;)ux(e,t),t=qn(t.nextSibling)}if(rp(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(F(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){gt=qn(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}gt=null}}else gt=xt?qn(e.stateNode.nextSibling):null;return!0}function dx(){for(var e=gt;e;)e=qn(e.nextSibling)}function Ar(){gt=xt=null,we=!1}function Ud(e){Wt===null?Wt=[e]:Wt.push(e)}var u2=Tn.ReactCurrentBatchConfig;function si(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(F(309));var s=n.stateNode}if(!s)throw Error(F(147,e));var i=s,a=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===a?t.ref:(t=function(o){var l=i.refs;o===null?delete l[a]:l[a]=o},t._stringRef=a,t)}if(typeof e!="string")throw Error(F(284));if(!n._owner)throw Error(F(290,e))}return e}function Oa(e,t){throw e=Object.prototype.toString.call(t),Error(F(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function ip(e){var t=e._init;return t(e._payload)}function hx(e){function t(g,x){if(e){var w=g.deletions;w===null?(g.deletions=[x],g.flags|=16):w.push(x)}}function n(g,x){if(!e)return null;for(;x!==null;)t(g,x),x=x.sibling;return null}function s(g,x){for(g=new Map;x!==null;)x.key!==null?g.set(x.key,x):g.set(x.index,x),x=x.sibling;return g}function i(g,x){return g=Jn(g,x),g.index=0,g.sibling=null,g}function a(g,x,w){return g.index=w,e?(w=g.alternate,w!==null?(w=w.index,w<x?(g.flags|=2,x):w):(g.flags|=2,x)):(g.flags|=1048576,x)}function o(g){return e&&g.alternate===null&&(g.flags|=2),g}function l(g,x,w,j){return x===null||x.tag!==6?(x=mc(w,g.mode,j),x.return=g,x):(x=i(x,w),x.return=g,x)}function c(g,x,w,j){var k=w.type;return k===ir?d(g,x,w.props.children,j,w.key):x!==null&&(x.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===In&&ip(k)===x.type)?(j=i(x,w.props),j.ref=si(g,x,w),j.return=g,j):(j=mo(w.type,w.key,w.props,null,g.mode,j),j.ref=si(g,x,w),j.return=g,j)}function u(g,x,w,j){return x===null||x.tag!==4||x.stateNode.containerInfo!==w.containerInfo||x.stateNode.implementation!==w.implementation?(x=gc(w,g.mode,j),x.return=g,x):(x=i(x,w.children||[]),x.return=g,x)}function d(g,x,w,j,k){return x===null||x.tag!==7?(x=_s(w,g.mode,j,k),x.return=g,x):(x=i(x,w),x.return=g,x)}function p(g,x,w){if(typeof x=="string"&&x!==""||typeof x=="number")return x=mc(""+x,g.mode,w),x.return=g,x;if(typeof x=="object"&&x!==null){switch(x.$$typeof){case Sa:return w=mo(x.type,x.key,x.props,null,g.mode,w),w.ref=si(g,null,x),w.return=g,w;case rr:return x=gc(x,g.mode,w),x.return=g,x;case In:var j=x._init;return p(g,j(x._payload),w)}if(ui(x)||Jr(x))return x=_s(x,g.mode,w,null),x.return=g,x;Oa(g,x)}return null}function f(g,x,w,j){var k=x!==null?x.key:null;if(typeof w=="string"&&w!==""||typeof w=="number")return k!==null?null:l(g,x,""+w,j);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Sa:return w.key===k?c(g,x,w,j):null;case rr:return w.key===k?u(g,x,w,j):null;case In:return k=w._init,f(g,x,k(w._payload),j)}if(ui(w)||Jr(w))return k!==null?null:d(g,x,w,j,null);Oa(g,w)}return null}function m(g,x,w,j,k){if(typeof j=="string"&&j!==""||typeof j=="number")return g=g.get(w)||null,l(x,g,""+j,k);if(typeof j=="object"&&j!==null){switch(j.$$typeof){case Sa:return g=g.get(j.key===null?w:j.key)||null,c(x,g,j,k);case rr:return g=g.get(j.key===null?w:j.key)||null,u(x,g,j,k);case In:var N=j._init;return m(g,x,w,N(j._payload),k)}if(ui(j)||Jr(j))return g=g.get(w)||null,d(x,g,j,k,null);Oa(x,j)}return null}function v(g,x,w,j){for(var k=null,N=null,S=x,E=x=0,P=null;S!==null&&E<w.length;E++){S.index>E?(P=S,S=null):P=S.sibling;var A=f(g,S,w[E],j);if(A===null){S===null&&(S=P);break}e&&S&&A.alternate===null&&t(g,S),x=a(A,x,E),N===null?k=A:N.sibling=A,N=A,S=P}if(E===w.length)return n(g,S),we&&vs(g,E),k;if(S===null){for(;E<w.length;E++)S=p(g,w[E],j),S!==null&&(x=a(S,x,E),N===null?k=S:N.sibling=S,N=S);return we&&vs(g,E),k}for(S=s(g,S);E<w.length;E++)P=m(S,g,E,w[E],j),P!==null&&(e&&P.alternate!==null&&S.delete(P.key===null?E:P.key),x=a(P,x,E),N===null?k=P:N.sibling=P,N=P);return e&&S.forEach(function(T){return t(g,T)}),we&&vs(g,E),k}function y(g,x,w,j){var k=Jr(w);if(typeof k!="function")throw Error(F(150));if(w=k.call(w),w==null)throw Error(F(151));for(var N=k=null,S=x,E=x=0,P=null,A=w.next();S!==null&&!A.done;E++,A=w.next()){S.index>E?(P=S,S=null):P=S.sibling;var T=f(g,S,A.value,j);if(T===null){S===null&&(S=P);break}e&&S&&T.alternate===null&&t(g,S),x=a(T,x,E),N===null?k=T:N.sibling=T,N=T,S=P}if(A.done)return n(g,S),we&&vs(g,E),k;if(S===null){for(;!A.done;E++,A=w.next())A=p(g,A.value,j),A!==null&&(x=a(A,x,E),N===null?k=A:N.sibling=A,N=A);return we&&vs(g,E),k}for(S=s(g,S);!A.done;E++,A=w.next())A=m(S,g,E,A.value,j),A!==null&&(e&&A.alternate!==null&&S.delete(A.key===null?E:A.key),x=a(A,x,E),N===null?k=A:N.sibling=A,N=A);return e&&S.forEach(function(V){return t(g,V)}),we&&vs(g,E),k}function b(g,x,w,j){if(typeof w=="object"&&w!==null&&w.type===ir&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case Sa:e:{for(var k=w.key,N=x;N!==null;){if(N.key===k){if(k=w.type,k===ir){if(N.tag===7){n(g,N.sibling),x=i(N,w.props.children),x.return=g,g=x;break e}}else if(N.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===In&&ip(k)===N.type){n(g,N.sibling),x=i(N,w.props),x.ref=si(g,N,w),x.return=g,g=x;break e}n(g,N);break}else t(g,N);N=N.sibling}w.type===ir?(x=_s(w.props.children,g.mode,j,w.key),x.return=g,g=x):(j=mo(w.type,w.key,w.props,null,g.mode,j),j.ref=si(g,x,w),j.return=g,g=j)}return o(g);case rr:e:{for(N=w.key;x!==null;){if(x.key===N)if(x.tag===4&&x.stateNode.containerInfo===w.containerInfo&&x.stateNode.implementation===w.implementation){n(g,x.sibling),x=i(x,w.children||[]),x.return=g,g=x;break e}else{n(g,x);break}else t(g,x);x=x.sibling}x=gc(w,g.mode,j),x.return=g,g=x}return o(g);case In:return N=w._init,b(g,x,N(w._payload),j)}if(ui(w))return v(g,x,w,j);if(Jr(w))return y(g,x,w,j);Oa(g,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,x!==null&&x.tag===6?(n(g,x.sibling),x=i(x,w),x.return=g,g=x):(n(g,x),x=mc(w,g.mode,j),x.return=g,g=x),o(g)):n(g,x)}return b}var Mr=hx(!0),fx=hx(!1),Bo=cs(null),Fo=null,fr=null,Hd=null;function Wd(){Hd=fr=Fo=null}function Kd(e){var t=Bo.current;ye(Bo),e._currentValue=t}function Su(e,t,n){for(;e!==null;){var s=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,s!==null&&(s.childLanes|=t)):s!==null&&(s.childLanes&t)!==t&&(s.childLanes|=t),e===n)break;e=e.return}}function Cr(e,t){Fo=e,Hd=fr=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(ut=!0),e.firstContext=null)}function Mt(e){var t=e._currentValue;if(Hd!==e)if(e={context:e,memoizedValue:t,next:null},fr===null){if(Fo===null)throw Error(F(308));fr=e,Fo.dependencies={lanes:0,firstContext:e}}else fr=fr.next=e;return t}var Ns=null;function Gd(e){Ns===null?Ns=[e]:Ns.push(e)}function px(e,t,n,s){var i=t.interleaved;return i===null?(n.next=n,Gd(t)):(n.next=i.next,i.next=n),t.interleaved=n,Cn(e,s)}function Cn(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Bn=!1;function qd(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function mx(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function wn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Yn(e,t,n){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,ue&2){var i=s.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),s.pending=t,Cn(e,n)}return i=s.interleaved,i===null?(t.next=t,Gd(s)):(t.next=i.next,i.next=t),s.interleaved=t,Cn(e,n)}function lo(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var s=t.lanes;s&=e.pendingLanes,n|=s,t.lanes=n,Rd(e,n)}}function ap(e,t){var n=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,n===s)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:s.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:s.shared,effects:s.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Vo(e,t,n,s){var i=e.updateQueue;Bn=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,l=i.shared.pending;if(l!==null){i.shared.pending=null;var c=l,u=c.next;c.next=null,o===null?a=u:o.next=u,o=c;var d=e.alternate;d!==null&&(d=d.updateQueue,l=d.lastBaseUpdate,l!==o&&(l===null?d.firstBaseUpdate=u:l.next=u,d.lastBaseUpdate=c))}if(a!==null){var p=i.baseState;o=0,d=u=c=null,l=a;do{var f=l.lane,m=l.eventTime;if((s&f)===f){d!==null&&(d=d.next={eventTime:m,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var v=e,y=l;switch(f=t,m=n,y.tag){case 1:if(v=y.payload,typeof v=="function"){p=v.call(m,p,f);break e}p=v;break e;case 3:v.flags=v.flags&-65537|128;case 0:if(v=y.payload,f=typeof v=="function"?v.call(m,p,f):v,f==null)break e;p=Se({},p,f);break e;case 2:Bn=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,f=i.effects,f===null?i.effects=[l]:f.push(l))}else m={eventTime:m,lane:f,tag:l.tag,payload:l.payload,callback:l.callback,next:null},d===null?(u=d=m,c=p):d=d.next=m,o|=f;if(l=l.next,l===null){if(l=i.shared.pending,l===null)break;f=l,l=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(!0);if(d===null&&(c=p),i.baseState=c,i.firstBaseUpdate=u,i.lastBaseUpdate=d,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else a===null&&(i.shared.lanes=0);Rs|=o,e.lanes=o,e.memoizedState=p}}function op(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var s=e[t],i=s.callback;if(i!==null){if(s.callback=null,s=n,typeof i!="function")throw Error(F(191,i));i.call(s)}}}var pa={},on=cs(pa),Wi=cs(pa),Ki=cs(pa);function Ss(e){if(e===pa)throw Error(F(174));return e}function Yd(e,t){switch(me(Ki,t),me(Wi,e),me(on,pa),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:iu(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=iu(t,e)}ye(on),me(on,t)}function Rr(){ye(on),ye(Wi),ye(Ki)}function gx(e){Ss(Ki.current);var t=Ss(on.current),n=iu(t,e.type);t!==n&&(me(Wi,e),me(on,n))}function Xd(e){Wi.current===e&&(ye(on),ye(Wi))}var ke=cs(0);function $o(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var cc=[];function Qd(){for(var e=0;e<cc.length;e++)cc[e]._workInProgressVersionPrimary=null;cc.length=0}var co=Tn.ReactCurrentDispatcher,uc=Tn.ReactCurrentBatchConfig,Ms=0,Ne=null,Le=null,Be=null,Uo=!1,ji=!1,Gi=0,d2=0;function Ge(){throw Error(F(321))}function Jd(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!qt(e[n],t[n]))return!1;return!0}function Zd(e,t,n,s,i,a){if(Ms=a,Ne=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,co.current=e===null||e.memoizedState===null?m2:g2,e=n(s,i),ji){a=0;do{if(ji=!1,Gi=0,25<=a)throw Error(F(301));a+=1,Be=Le=null,t.updateQueue=null,co.current=x2,e=n(s,i)}while(ji)}if(co.current=Ho,t=Le!==null&&Le.next!==null,Ms=0,Be=Le=Ne=null,Uo=!1,t)throw Error(F(300));return e}function eh(){var e=Gi!==0;return Gi=0,e}function tn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Be===null?Ne.memoizedState=Be=e:Be=Be.next=e,Be}function Rt(){if(Le===null){var e=Ne.alternate;e=e!==null?e.memoizedState:null}else e=Le.next;var t=Be===null?Ne.memoizedState:Be.next;if(t!==null)Be=t,Le=e;else{if(e===null)throw Error(F(310));Le=e,e={memoizedState:Le.memoizedState,baseState:Le.baseState,baseQueue:Le.baseQueue,queue:Le.queue,next:null},Be===null?Ne.memoizedState=Be=e:Be=Be.next=e}return Be}function qi(e,t){return typeof t=="function"?t(e):t}function dc(e){var t=Rt(),n=t.queue;if(n===null)throw Error(F(311));n.lastRenderedReducer=e;var s=Le,i=s.baseQueue,a=n.pending;if(a!==null){if(i!==null){var o=i.next;i.next=a.next,a.next=o}s.baseQueue=i=a,n.pending=null}if(i!==null){a=i.next,s=s.baseState;var l=o=null,c=null,u=a;do{var d=u.lane;if((Ms&d)===d)c!==null&&(c=c.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),s=u.hasEagerState?u.eagerState:e(s,u.action);else{var p={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};c===null?(l=c=p,o=s):c=c.next=p,Ne.lanes|=d,Rs|=d}u=u.next}while(u!==null&&u!==a);c===null?o=s:c.next=l,qt(s,t.memoizedState)||(ut=!0),t.memoizedState=s,t.baseState=o,t.baseQueue=c,n.lastRenderedState=s}if(e=n.interleaved,e!==null){i=e;do a=i.lane,Ne.lanes|=a,Rs|=a,i=i.next;while(i!==e)}else i===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function hc(e){var t=Rt(),n=t.queue;if(n===null)throw Error(F(311));n.lastRenderedReducer=e;var s=n.dispatch,i=n.pending,a=t.memoizedState;if(i!==null){n.pending=null;var o=i=i.next;do a=e(a,o.action),o=o.next;while(o!==i);qt(a,t.memoizedState)||(ut=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),n.lastRenderedState=a}return[a,s]}function xx(){}function yx(e,t){var n=Ne,s=Rt(),i=t(),a=!qt(s.memoizedState,i);if(a&&(s.memoizedState=i,ut=!0),s=s.queue,th(wx.bind(null,n,s,e),[e]),s.getSnapshot!==t||a||Be!==null&&Be.memoizedState.tag&1){if(n.flags|=2048,Yi(9,bx.bind(null,n,s,i,t),void 0,null),Fe===null)throw Error(F(349));Ms&30||vx(n,t,i)}return i}function vx(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Ne.updateQueue,t===null?(t={lastEffect:null,stores:null},Ne.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function bx(e,t,n,s){t.value=n,t.getSnapshot=s,kx(t)&&jx(e)}function wx(e,t,n){return n(function(){kx(t)&&jx(e)})}function kx(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!qt(e,n)}catch{return!0}}function jx(e){var t=Cn(e,1);t!==null&&Gt(t,e,1,-1)}function lp(e){var t=tn();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:qi,lastRenderedState:e},t.queue=e,e=e.dispatch=p2.bind(null,Ne,e),[t.memoizedState,e]}function Yi(e,t,n,s){return e={tag:e,create:t,destroy:n,deps:s,next:null},t=Ne.updateQueue,t===null?(t={lastEffect:null,stores:null},Ne.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(s=n.next,n.next=e,e.next=s,t.lastEffect=e)),e}function Nx(){return Rt().memoizedState}function uo(e,t,n,s){var i=tn();Ne.flags|=e,i.memoizedState=Yi(1|t,n,void 0,s===void 0?null:s)}function fl(e,t,n,s){var i=Rt();s=s===void 0?null:s;var a=void 0;if(Le!==null){var o=Le.memoizedState;if(a=o.destroy,s!==null&&Jd(s,o.deps)){i.memoizedState=Yi(t,n,a,s);return}}Ne.flags|=e,i.memoizedState=Yi(1|t,n,a,s)}function cp(e,t){return uo(8390656,8,e,t)}function th(e,t){return fl(2048,8,e,t)}function Sx(e,t){return fl(4,2,e,t)}function Cx(e,t){return fl(4,4,e,t)}function Ex(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function _x(e,t,n){return n=n!=null?n.concat([e]):null,fl(4,4,Ex.bind(null,t,e),n)}function nh(){}function Tx(e,t){var n=Rt();t=t===void 0?null:t;var s=n.memoizedState;return s!==null&&t!==null&&Jd(t,s[1])?s[0]:(n.memoizedState=[e,t],e)}function Px(e,t){var n=Rt();t=t===void 0?null:t;var s=n.memoizedState;return s!==null&&t!==null&&Jd(t,s[1])?s[0]:(e=e(),n.memoizedState=[e,t],e)}function Ax(e,t,n){return Ms&21?(qt(n,t)||(n=Og(),Ne.lanes|=n,Rs|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,ut=!0),e.memoizedState=n)}function h2(e,t){var n=he;he=n!==0&&4>n?n:4,e(!0);var s=uc.transition;uc.transition={};try{e(!1),t()}finally{he=n,uc.transition=s}}function Mx(){return Rt().memoizedState}function f2(e,t,n){var s=Qn(e);if(n={lane:s,action:n,hasEagerState:!1,eagerState:null,next:null},Rx(e))zx(t,n);else if(n=px(e,t,n,s),n!==null){var i=st();Gt(n,e,s,i),Lx(n,t,s)}}function p2(e,t,n){var s=Qn(e),i={lane:s,action:n,hasEagerState:!1,eagerState:null,next:null};if(Rx(e))zx(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,l=a(o,n);if(i.hasEagerState=!0,i.eagerState=l,qt(l,o)){var c=t.interleaved;c===null?(i.next=i,Gd(t)):(i.next=c.next,c.next=i),t.interleaved=i;return}}catch{}finally{}n=px(e,t,i,s),n!==null&&(i=st(),Gt(n,e,s,i),Lx(n,t,s))}}function Rx(e){var t=e.alternate;return e===Ne||t!==null&&t===Ne}function zx(e,t){ji=Uo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Lx(e,t,n){if(n&4194240){var s=t.lanes;s&=e.pendingLanes,n|=s,t.lanes=n,Rd(e,n)}}var Ho={readContext:Mt,useCallback:Ge,useContext:Ge,useEffect:Ge,useImperativeHandle:Ge,useInsertionEffect:Ge,useLayoutEffect:Ge,useMemo:Ge,useReducer:Ge,useRef:Ge,useState:Ge,useDebugValue:Ge,useDeferredValue:Ge,useTransition:Ge,useMutableSource:Ge,useSyncExternalStore:Ge,useId:Ge,unstable_isNewReconciler:!1},m2={readContext:Mt,useCallback:function(e,t){return tn().memoizedState=[e,t===void 0?null:t],e},useContext:Mt,useEffect:cp,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,uo(4194308,4,Ex.bind(null,t,e),n)},useLayoutEffect:function(e,t){return uo(4194308,4,e,t)},useInsertionEffect:function(e,t){return uo(4,2,e,t)},useMemo:function(e,t){var n=tn();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var s=tn();return t=n!==void 0?n(t):t,s.memoizedState=s.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},s.queue=e,e=e.dispatch=f2.bind(null,Ne,e),[s.memoizedState,e]},useRef:function(e){var t=tn();return e={current:e},t.memoizedState=e},useState:lp,useDebugValue:nh,useDeferredValue:function(e){return tn().memoizedState=e},useTransition:function(){var e=lp(!1),t=e[0];return e=h2.bind(null,e[1]),tn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var s=Ne,i=tn();if(we){if(n===void 0)throw Error(F(407));n=n()}else{if(n=t(),Fe===null)throw Error(F(349));Ms&30||vx(s,t,n)}i.memoizedState=n;var a={value:n,getSnapshot:t};return i.queue=a,cp(wx.bind(null,s,a,e),[e]),s.flags|=2048,Yi(9,bx.bind(null,s,a,n,t),void 0,null),n},useId:function(){var e=tn(),t=Fe.identifierPrefix;if(we){var n=bn,s=vn;n=(s&~(1<<32-Kt(s)-1)).toString(32)+n,t=":"+t+"R"+n,n=Gi++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=d2++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},g2={readContext:Mt,useCallback:Tx,useContext:Mt,useEffect:th,useImperativeHandle:_x,useInsertionEffect:Sx,useLayoutEffect:Cx,useMemo:Px,useReducer:dc,useRef:Nx,useState:function(){return dc(qi)},useDebugValue:nh,useDeferredValue:function(e){var t=Rt();return Ax(t,Le.memoizedState,e)},useTransition:function(){var e=dc(qi)[0],t=Rt().memoizedState;return[e,t]},useMutableSource:xx,useSyncExternalStore:yx,useId:Mx,unstable_isNewReconciler:!1},x2={readContext:Mt,useCallback:Tx,useContext:Mt,useEffect:th,useImperativeHandle:_x,useInsertionEffect:Sx,useLayoutEffect:Cx,useMemo:Px,useReducer:hc,useRef:Nx,useState:function(){return hc(qi)},useDebugValue:nh,useDeferredValue:function(e){var t=Rt();return Le===null?t.memoizedState=e:Ax(t,Le.memoizedState,e)},useTransition:function(){var e=hc(qi)[0],t=Rt().memoizedState;return[e,t]},useMutableSource:xx,useSyncExternalStore:yx,useId:Mx,unstable_isNewReconciler:!1};function $t(e,t){if(e&&e.defaultProps){t=Se({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Cu(e,t,n,s){t=e.memoizedState,n=n(s,t),n=n==null?t:Se({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var pl={isMounted:function(e){return(e=e._reactInternals)?Fs(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var s=st(),i=Qn(e),a=wn(s,i);a.payload=t,n!=null&&(a.callback=n),t=Yn(e,a,i),t!==null&&(Gt(t,e,i,s),lo(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var s=st(),i=Qn(e),a=wn(s,i);a.tag=1,a.payload=t,n!=null&&(a.callback=n),t=Yn(e,a,i),t!==null&&(Gt(t,e,i,s),lo(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=st(),s=Qn(e),i=wn(n,s);i.tag=2,t!=null&&(i.callback=t),t=Yn(e,i,s),t!==null&&(Gt(t,e,s,n),lo(t,e,s))}};function up(e,t,n,s,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,a,o):t.prototype&&t.prototype.isPureReactComponent?!Vi(n,s)||!Vi(i,a):!0}function Ox(e,t,n){var s=!1,i=ss,a=t.contextType;return typeof a=="object"&&a!==null?a=Mt(a):(i=ht(t)?Ps:Ze.current,s=t.contextTypes,a=(s=s!=null)?Pr(e,i):ss),t=new t(n,a),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=pl,e.stateNode=t,t._reactInternals=e,s&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=a),t}function dp(e,t,n,s){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,s),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,s),t.state!==e&&pl.enqueueReplaceState(t,t.state,null)}function Eu(e,t,n,s){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},qd(e);var a=t.contextType;typeof a=="object"&&a!==null?i.context=Mt(a):(a=ht(t)?Ps:Ze.current,i.context=Pr(e,a)),i.state=e.memoizedState,a=t.getDerivedStateFromProps,typeof a=="function"&&(Cu(e,t,a,n),i.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(t=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),t!==i.state&&pl.enqueueReplaceState(i,i.state,null),Vo(e,n,i,s),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function zr(e,t){try{var n="",s=t;do n+=Wb(s),s=s.return;while(s);var i=n}catch(a){i=`
39
39
  Error generating stack: `+a.message+`
40
- `+a.stack}return{value:e,source:t,stack:i,digest:null}}function fc(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function _u(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var y2=typeof WeakMap=="function"?WeakMap:Map;function Dx(e,t,n){n=wn(-1,n),n.tag=3,n.payload={element:null};var s=t.value;return n.callback=function(){Ko||(Ko=!0,Iu=s),_u(e,t)},n}function Ix(e,t,n){n=wn(-1,n),n.tag=3;var s=e.type.getDerivedStateFromError;if(typeof s=="function"){var i=t.value;n.payload=function(){return s(i)},n.callback=function(){_u(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch=="function"&&(n.callback=function(){_u(e,t),typeof s!="function"&&(Xn===null?Xn=new Set([this]):Xn.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function hp(e,t,n){var s=e.pingCache;if(s===null){s=e.pingCache=new y2;var i=new Set;s.set(t,i)}else i=s.get(t),i===void 0&&(i=new Set,s.set(t,i));i.has(n)||(i.add(n),e=A2.bind(null,e,t,n),t.then(e,e))}function fp(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function pp(e,t,n,s,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=wn(-1,1),t.tag=2,Yn(n,t,1))),n.lanes|=1),e)}var v2=Tn.ReactCurrentOwner,ut=!1;function nt(e,t,n,s){t.child=e===null?fx(t,null,n,s):Mr(t,e.child,n,s)}function mp(e,t,n,s,i){n=n.render;var a=t.ref;return Sr(t,i),s=Zd(e,t,n,s,a,i),n=eh(),e!==null&&!ut?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,En(e,t,i)):(we&&n&&Vd(t),t.flags|=1,nt(e,t,s,i),t.child)}function gp(e,t,n,s,i){if(e===null){var a=n.type;return typeof a=="function"&&!uh(a)&&a.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=a,Bx(e,t,a,s,i)):(e=mo(n.type,null,s,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!(e.lanes&i)){var o=a.memoizedProps;if(n=n.compare,n=n!==null?n:Vi,n(o,s)&&e.ref===t.ref)return En(e,t,i)}return t.flags|=1,e=Jn(a,s),e.ref=t.ref,e.return=t,t.child=e}function Bx(e,t,n,s,i){if(e!==null){var a=e.memoizedProps;if(Vi(a,s)&&e.ref===t.ref)if(ut=!1,t.pendingProps=s=a,(e.lanes&i)!==0)e.flags&131072&&(ut=!0);else return t.lanes=e.lanes,En(e,t,i)}return Tu(e,t,n,s,i)}function Fx(e,t,n){var s=t.pendingProps,i=s.children,a=e!==null?e.memoizedState:null;if(s.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},me(pr,mt),mt|=n;else{if(!(n&1073741824))return e=a!==null?a.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,me(pr,mt),mt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},s=a!==null?a.baseLanes:n,me(pr,mt),mt|=s}else a!==null?(s=a.baseLanes|n,t.memoizedState=null):s=n,me(pr,mt),mt|=s;return nt(e,t,i,n),t.child}function Vx(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Tu(e,t,n,s,i){var a=ht(n)?Ps:Ze.current;return a=Tr(t,a),Sr(t,i),n=Zd(e,t,n,s,a,i),s=eh(),e!==null&&!ut?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,En(e,t,i)):(we&&s&&Vd(t),t.flags|=1,nt(e,t,n,i),t.child)}function xp(e,t,n,s,i){if(ht(n)){var a=!0;Oo(t)}else a=!1;if(Sr(t,i),t.stateNode===null)ho(e,t),Ox(t,n,s),Eu(t,n,s,i),s=!0;else if(e===null){var o=t.stateNode,l=t.memoizedProps;o.props=l;var c=o.context,u=n.contextType;typeof u=="object"&&u!==null?u=At(u):(u=ht(n)?Ps:Ze.current,u=Tr(t,u));var d=n.getDerivedStateFromProps,p=typeof d=="function"||typeof o.getSnapshotBeforeUpdate=="function";p||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==s||c!==u)&&dp(t,o,s,u),Bn=!1;var f=t.memoizedState;o.state=f,Vo(t,s,o,i),c=t.memoizedState,l!==s||f!==c||dt.current||Bn?(typeof d=="function"&&(Cu(t,n,d,s),c=t.memoizedState),(l=Bn||up(t,n,l,s,f,c,u))?(p||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=s,t.memoizedState=c),o.props=s,o.state=c,o.context=u,s=l):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),s=!1)}else{o=t.stateNode,mx(e,t),l=t.memoizedProps,u=t.type===t.elementType?l:$t(t.type,l),o.props=u,p=t.pendingProps,f=o.context,c=n.contextType,typeof c=="object"&&c!==null?c=At(c):(c=ht(n)?Ps:Ze.current,c=Tr(t,c));var m=n.getDerivedStateFromProps;(d=typeof m=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==p||f!==c)&&dp(t,o,s,c),Bn=!1,f=t.memoizedState,o.state=f,Vo(t,s,o,i);var b=t.memoizedState;l!==p||f!==b||dt.current||Bn?(typeof m=="function"&&(Cu(t,n,m,s),b=t.memoizedState),(u=Bn||up(t,n,u,s,f,b,c)||!1)?(d||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(s,b,c),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(s,b,c)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=s,t.memoizedState=b),o.props=s,o.state=b,o.context=c,s=u):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),s=!1)}return Pu(e,t,n,s,a,i)}function Pu(e,t,n,s,i,a){Vx(e,t);var o=(t.flags&128)!==0;if(!s&&!o)return i&&np(t,n,!1),En(e,t,a);s=t.stateNode,v2.current=t;var l=o&&typeof n.getDerivedStateFromError!="function"?null:s.render();return t.flags|=1,e!==null&&o?(t.child=Mr(t,e.child,null,a),t.child=Mr(t,null,l,a)):nt(e,t,l,a),t.memoizedState=s.state,i&&np(t,n,!0),t.child}function $x(e){var t=e.stateNode;t.pendingContext?tp(e,t.pendingContext,t.pendingContext!==t.context):t.context&&tp(e,t.context,!1),Yd(e,t.containerInfo)}function yp(e,t,n,s,i){return Pr(),Ud(i),t.flags|=256,nt(e,t,n,s),t.child}var Mu={dehydrated:null,treeContext:null,retryLane:0};function Au(e){return{baseLanes:e,cachePool:null,transitions:null}}function Ux(e,t,n){var s=t.pendingProps,i=ke.current,a=!1,o=(t.flags&128)!==0,l;if((l=o)||(l=e!==null&&e.memoizedState===null?!1:(i&2)!==0),l?(a=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),me(ke,i&1),e===null)return Nu(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(o=s.children,e=s.fallback,a?(s=t.mode,a=t.child,o={mode:"hidden",children:o},!(s&1)&&a!==null?(a.childLanes=0,a.pendingProps=o):a=xl(o,s,0,null),e=_s(e,s,n,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=Au(n),t.memoizedState=Mu,e):sh(t,o));if(i=e.memoizedState,i!==null&&(l=i.dehydrated,l!==null))return b2(e,t,o,s,l,i,n);if(a){a=s.fallback,o=t.mode,i=e.child,l=i.sibling;var c={mode:"hidden",children:s.children};return!(o&1)&&t.child!==i?(s=t.child,s.childLanes=0,s.pendingProps=c,t.deletions=null):(s=Jn(i,c),s.subtreeFlags=i.subtreeFlags&14680064),l!==null?a=Jn(l,a):(a=_s(a,o,n,null),a.flags|=2),a.return=t,s.return=t,s.sibling=a,t.child=s,s=a,a=t.child,o=e.child.memoizedState,o=o===null?Au(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},a.memoizedState=o,a.childLanes=e.childLanes&~n,t.memoizedState=Mu,s}return a=e.child,e=a.sibling,s=Jn(a,{mode:"visible",children:s.children}),!(t.mode&1)&&(s.lanes=n),s.return=t,s.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=s,t.memoizedState=null,s}function sh(e,t){return t=xl({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Da(e,t,n,s){return s!==null&&Ud(s),Mr(t,e.child,null,n),e=sh(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function b2(e,t,n,s,i,a,o){if(n)return t.flags&256?(t.flags&=-257,s=fc(Error(F(422))),Da(e,t,o,s)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(a=s.fallback,i=t.mode,s=xl({mode:"visible",children:s.children},i,0,null),a=_s(a,i,o,null),a.flags|=2,s.return=t,a.return=t,s.sibling=a,t.child=s,t.mode&1&&Mr(t,e.child,null,o),t.child.memoizedState=Au(o),t.memoizedState=Mu,a);if(!(t.mode&1))return Da(e,t,o,null);if(i.data==="$!"){if(s=i.nextSibling&&i.nextSibling.dataset,s)var l=s.dgst;return s=l,a=Error(F(419)),s=fc(a,s,void 0),Da(e,t,o,s)}if(l=(o&e.childLanes)!==0,ut||l){if(s=Fe,s!==null){switch(o&-o){case 4:i=2;break;case 16:i=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(s.suspendedLanes|o)?0:i,i!==0&&i!==a.retryLane&&(a.retryLane=i,Cn(e,i),Gt(s,e,i,-1))}return ch(),s=fc(Error(F(421))),Da(e,t,o,s)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=R2.bind(null,e),i._reactRetry=t,null):(e=a.treeContext,gt=qn(i.nextSibling),xt=t,we=!0,Wt=null,e!==null&&(Ct[Et++]=vn,Ct[Et++]=bn,Ct[Et++]=Ms,vn=e.id,bn=e.overflow,Ms=t),t=sh(t,s.children),t.flags|=4096,t)}function vp(e,t,n){e.lanes|=t;var s=e.alternate;s!==null&&(s.lanes|=t),Su(e.return,t,n)}function pc(e,t,n,s,i){var a=e.memoizedState;a===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:s,tail:n,tailMode:i}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=s,a.tail=n,a.tailMode=i)}function Hx(e,t,n){var s=t.pendingProps,i=s.revealOrder,a=s.tail;if(nt(e,t,s.children,n),s=ke.current,s&2)s=s&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&vp(e,n,t);else if(e.tag===19)vp(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}s&=1}if(me(ke,s),!(t.mode&1))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&$o(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),pc(t,!1,i,n,a);break;case"backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&$o(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}pc(t,!0,n,null,a);break;case"together":pc(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function ho(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function En(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Rs|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(F(153));if(t.child!==null){for(e=t.child,n=Jn(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Jn(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function w2(e,t,n){switch(t.tag){case 3:$x(t),Pr();break;case 5:gx(t);break;case 1:ht(t.type)&&Oo(t);break;case 4:Yd(t,t.stateNode.containerInfo);break;case 10:var s=t.type._context,i=t.memoizedProps.value;me(Bo,s._currentValue),s._currentValue=i;break;case 13:if(s=t.memoizedState,s!==null)return s.dehydrated!==null?(me(ke,ke.current&1),t.flags|=128,null):n&t.child.childLanes?Ux(e,t,n):(me(ke,ke.current&1),e=En(e,t,n),e!==null?e.sibling:null);me(ke,ke.current&1);break;case 19:if(s=(n&t.childLanes)!==0,e.flags&128){if(s)return Hx(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),me(ke,ke.current),s)break;return null;case 22:case 23:return t.lanes=0,Fx(e,t,n)}return En(e,t,n)}var Wx,Ru,Kx,Gx;Wx=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};Ru=function(){};Kx=function(e,t,n,s){var i=e.memoizedProps;if(i!==s){e=t.stateNode,Ss(on.current);var a=null;switch(n){case"input":i=tu(e,i),s=tu(e,s),a=[];break;case"select":i=Se({},i,{value:void 0}),s=Se({},s,{value:void 0}),a=[];break;case"textarea":i=ru(e,i),s=ru(e,s),a=[];break;default:typeof i.onClick!="function"&&typeof s.onClick=="function"&&(e.onclick=zo)}au(n,s);var o;n=null;for(u in i)if(!s.hasOwnProperty(u)&&i.hasOwnProperty(u)&&i[u]!=null)if(u==="style"){var l=i[u];for(o in l)l.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(zi.hasOwnProperty(u)?a||(a=[]):(a=a||[]).push(u,null));for(u in s){var c=s[u];if(l=i!=null?i[u]:void 0,s.hasOwnProperty(u)&&c!==l&&(c!=null||l!=null))if(u==="style")if(l){for(o in l)!l.hasOwnProperty(o)||c&&c.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in c)c.hasOwnProperty(o)&&l[o]!==c[o]&&(n||(n={}),n[o]=c[o])}else n||(a||(a=[]),a.push(u,n)),n=c;else u==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,l=l?l.__html:void 0,c!=null&&l!==c&&(a=a||[]).push(u,c)):u==="children"?typeof c!="string"&&typeof c!="number"||(a=a||[]).push(u,""+c):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(zi.hasOwnProperty(u)?(c!=null&&u==="onScroll"&&ge("scroll",e),a||l===c||(a=[])):(a=a||[]).push(u,c))}n&&(a=a||[]).push("style",n);var u=a;(t.updateQueue=u)&&(t.flags|=4)}};Gx=function(e,t,n,s){n!==s&&(t.flags|=4)};function ri(e,t){if(!we)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var s=null;n!==null;)n.alternate!==null&&(s=n),n=n.sibling;s===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:s.sibling=null}}function qe(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,s=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,s|=i.subtreeFlags&14680064,s|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,s|=i.subtreeFlags,s|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=s,e.childLanes=n,t}function k2(e,t,n){var s=t.pendingProps;switch($d(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return qe(t),null;case 1:return ht(t.type)&&Lo(),qe(t),null;case 3:return s=t.stateNode,Ar(),ye(dt),ye(Ze),Qd(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(e===null||e.child===null)&&(La(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Wt!==null&&(Vu(Wt),Wt=null))),Ru(e,t),qe(t),null;case 5:Xd(t);var i=Ss(Ki.current);if(n=t.type,e!==null&&t.stateNode!=null)Kx(e,t,n,s,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!s){if(t.stateNode===null)throw Error(F(166));return qe(t),null}if(e=Ss(on.current),La(t)){s=t.stateNode,n=t.type;var a=t.memoizedProps;switch(s[nn]=t,s[Hi]=a,e=(t.mode&1)!==0,n){case"dialog":ge("cancel",s),ge("close",s);break;case"iframe":case"object":case"embed":ge("load",s);break;case"video":case"audio":for(i=0;i<hi.length;i++)ge(hi[i],s);break;case"source":ge("error",s);break;case"img":case"image":case"link":ge("error",s),ge("load",s);break;case"details":ge("toggle",s);break;case"input":_f(s,a),ge("invalid",s);break;case"select":s._wrapperState={wasMultiple:!!a.multiple},ge("invalid",s);break;case"textarea":Pf(s,a),ge("invalid",s)}au(n,a),i=null;for(var o in a)if(a.hasOwnProperty(o)){var l=a[o];o==="children"?typeof l=="string"?s.textContent!==l&&(a.suppressHydrationWarning!==!0&&za(s.textContent,l,e),i=["children",l]):typeof l=="number"&&s.textContent!==""+l&&(a.suppressHydrationWarning!==!0&&za(s.textContent,l,e),i=["children",""+l]):zi.hasOwnProperty(o)&&l!=null&&o==="onScroll"&&ge("scroll",s)}switch(n){case"input":Ca(s),Tf(s,a,!0);break;case"textarea":Ca(s),Mf(s);break;case"select":case"option":break;default:typeof a.onClick=="function"&&(s.onclick=zo)}s=i,t.updateQueue=s,s!==null&&(t.flags|=4)}else{o=i.nodeType===9?i:i.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=wg(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=o.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof s.is=="string"?e=o.createElement(n,{is:s.is}):(e=o.createElement(n),n==="select"&&(o=e,s.multiple?o.multiple=!0:s.size&&(o.size=s.size))):e=o.createElementNS(e,n),e[nn]=t,e[Hi]=s,Wx(e,t,!1,!1),t.stateNode=e;e:{switch(o=ou(n,s),n){case"dialog":ge("cancel",e),ge("close",e),i=s;break;case"iframe":case"object":case"embed":ge("load",e),i=s;break;case"video":case"audio":for(i=0;i<hi.length;i++)ge(hi[i],e);i=s;break;case"source":ge("error",e),i=s;break;case"img":case"image":case"link":ge("error",e),ge("load",e),i=s;break;case"details":ge("toggle",e),i=s;break;case"input":_f(e,s),i=tu(e,s),ge("invalid",e);break;case"option":i=s;break;case"select":e._wrapperState={wasMultiple:!!s.multiple},i=Se({},s,{value:void 0}),ge("invalid",e);break;case"textarea":Pf(e,s),i=ru(e,s),ge("invalid",e);break;default:i=s}au(n,i),l=i;for(a in l)if(l.hasOwnProperty(a)){var c=l[a];a==="style"?Ng(e,c):a==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&kg(e,c)):a==="children"?typeof c=="string"?(n!=="textarea"||c!=="")&&Li(e,c):typeof c=="number"&&Li(e,""+c):a!=="suppressContentEditableWarning"&&a!=="suppressHydrationWarning"&&a!=="autoFocus"&&(zi.hasOwnProperty(a)?c!=null&&a==="onScroll"&&ge("scroll",e):c!=null&&Ed(e,a,c,o))}switch(n){case"input":Ca(e),Tf(e,s,!1);break;case"textarea":Ca(e),Mf(e);break;case"option":s.value!=null&&e.setAttribute("value",""+ns(s.value));break;case"select":e.multiple=!!s.multiple,a=s.value,a!=null?wr(e,!!s.multiple,a,!1):s.defaultValue!=null&&wr(e,!!s.multiple,s.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=zo)}switch(n){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}}s&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return qe(t),null;case 6:if(e&&t.stateNode!=null)Gx(e,t,e.memoizedProps,s);else{if(typeof s!="string"&&t.stateNode===null)throw Error(F(166));if(n=Ss(Ki.current),Ss(on.current),La(t)){if(s=t.stateNode,n=t.memoizedProps,s[nn]=t,(a=s.nodeValue!==n)&&(e=xt,e!==null))switch(e.tag){case 3:za(s.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&za(s.nodeValue,n,(e.mode&1)!==0)}a&&(t.flags|=4)}else s=(n.nodeType===9?n:n.ownerDocument).createTextNode(s),s[nn]=t,t.stateNode=s}return qe(t),null;case 13:if(ye(ke),s=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(we&&gt!==null&&t.mode&1&&!(t.flags&128))dx(),Pr(),t.flags|=98560,a=!1;else if(a=La(t),s!==null&&s.dehydrated!==null){if(e===null){if(!a)throw Error(F(318));if(a=t.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(F(317));a[nn]=t}else Pr(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;qe(t),a=!1}else Wt!==null&&(Vu(Wt),Wt=null),a=!0;if(!a)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(s=s!==null,s!==(e!==null&&e.memoizedState!==null)&&s&&(t.child.flags|=8192,t.mode&1&&(e===null||ke.current&1?Oe===0&&(Oe=3):ch())),t.updateQueue!==null&&(t.flags|=4),qe(t),null);case 4:return Ar(),Ru(e,t),e===null&&$i(t.stateNode.containerInfo),qe(t),null;case 10:return Kd(t.type._context),qe(t),null;case 17:return ht(t.type)&&Lo(),qe(t),null;case 19:if(ye(ke),a=t.memoizedState,a===null)return qe(t),null;if(s=(t.flags&128)!==0,o=a.rendering,o===null)if(s)ri(a,!1);else{if(Oe!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=$o(e),o!==null){for(t.flags|=128,ri(a,!1),s=o.updateQueue,s!==null&&(t.updateQueue=s,t.flags|=4),t.subtreeFlags=0,s=n,n=t.child;n!==null;)a=n,e=s,a.flags&=14680066,o=a.alternate,o===null?(a.childLanes=0,a.lanes=e,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=o.childLanes,a.lanes=o.lanes,a.child=o.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=o.memoizedProps,a.memoizedState=o.memoizedState,a.updateQueue=o.updateQueue,a.type=o.type,e=o.dependencies,a.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return me(ke,ke.current&1|2),t.child}e=e.sibling}a.tail!==null&&Pe()>zr&&(t.flags|=128,s=!0,ri(a,!1),t.lanes=4194304)}else{if(!s)if(e=$o(o),e!==null){if(t.flags|=128,s=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),ri(a,!0),a.tail===null&&a.tailMode==="hidden"&&!o.alternate&&!we)return qe(t),null}else 2*Pe()-a.renderingStartTime>zr&&n!==1073741824&&(t.flags|=128,s=!0,ri(a,!1),t.lanes=4194304);a.isBackwards?(o.sibling=t.child,t.child=o):(n=a.last,n!==null?n.sibling=o:t.child=o,a.last=o)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=Pe(),t.sibling=null,n=ke.current,me(ke,s?n&1|2:n&1),t):(qe(t),null);case 22:case 23:return lh(),s=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==s&&(t.flags|=8192),s&&t.mode&1?mt&1073741824&&(qe(t),t.subtreeFlags&6&&(t.flags|=8192)):qe(t),null;case 24:return null;case 25:return null}throw Error(F(156,t.tag))}function j2(e,t){switch($d(t),t.tag){case 1:return ht(t.type)&&Lo(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ar(),ye(dt),ye(Ze),Qd(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Xd(t),null;case 13:if(ye(ke),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(F(340));Pr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ye(ke),null;case 4:return Ar(),null;case 10:return Kd(t.type._context),null;case 22:case 23:return lh(),null;case 24:return null;default:return null}}var Ia=!1,Qe=!1,N2=typeof WeakSet=="function"?WeakSet:Set,q=null;function fr(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(s){Ee(e,t,s)}else n.current=null}function zu(e,t,n){try{n()}catch(s){Ee(e,t,s)}}var bp=!1;function S2(e,t){if(xu=Mo,e=Jg(),Fd(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var s=n.getSelection&&n.getSelection();if(s&&s.rangeCount!==0){n=s.anchorNode;var i=s.anchorOffset,a=s.focusNode;s=s.focusOffset;try{n.nodeType,a.nodeType}catch{n=null;break e}var o=0,l=-1,c=-1,u=0,d=0,p=e,f=null;t:for(;;){for(var m;p!==n||i!==0&&p.nodeType!==3||(l=o+i),p!==a||s!==0&&p.nodeType!==3||(c=o+s),p.nodeType===3&&(o+=p.nodeValue.length),(m=p.firstChild)!==null;)f=p,p=m;for(;;){if(p===e)break t;if(f===n&&++u===i&&(l=o),f===a&&++d===s&&(c=o),(m=p.nextSibling)!==null)break;p=f,f=p.parentNode}p=m}n=l===-1||c===-1?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(yu={focusedElem:e,selectionRange:n},Mo=!1,q=t;q!==null;)if(t=q,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,q=e;else for(;q!==null;){t=q;try{var b=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(b!==null){var y=b.memoizedProps,v=b.memoizedState,g=t.stateNode,x=g.getSnapshotBeforeUpdate(t.elementType===t.type?y:$t(t.type,y),v);g.__reactInternalSnapshotBeforeUpdate=x}break;case 3:var w=t.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(F(163))}}catch(j){Ee(t,t.return,j)}if(e=t.sibling,e!==null){e.return=t.return,q=e;break}q=t.return}return b=bp,bp=!1,b}function Ni(e,t,n){var s=t.updateQueue;if(s=s!==null?s.lastEffect:null,s!==null){var i=s=s.next;do{if((i.tag&e)===e){var a=i.destroy;i.destroy=void 0,a!==void 0&&zu(t,n,a)}i=i.next}while(i!==s)}}function ml(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var s=n.create;n.destroy=s()}n=n.next}while(n!==t)}}function Lu(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function qx(e){var t=e.alternate;t!==null&&(e.alternate=null,qx(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[nn],delete t[Hi],delete t[wu],delete t[o2],delete t[l2])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Yx(e){return e.tag===5||e.tag===3||e.tag===4}function wp(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Yx(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Ou(e,t,n){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=zo));else if(s!==4&&(e=e.child,e!==null))for(Ou(e,t,n),e=e.sibling;e!==null;)Ou(e,t,n),e=e.sibling}function Du(e,t,n){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(s!==4&&(e=e.child,e!==null))for(Du(e,t,n),e=e.sibling;e!==null;)Du(e,t,n),e=e.sibling}var $e=null,Ut=!1;function Ln(e,t,n){for(n=n.child;n!==null;)Xx(e,t,n),n=n.sibling}function Xx(e,t,n){if(an&&typeof an.onCommitFiberUnmount=="function")try{an.onCommitFiberUnmount(ol,n)}catch{}switch(n.tag){case 5:Qe||fr(n,t);case 6:var s=$e,i=Ut;$e=null,Ln(e,t,n),$e=s,Ut=i,$e!==null&&(Ut?(e=$e,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):$e.removeChild(n.stateNode));break;case 18:$e!==null&&(Ut?(e=$e,n=n.stateNode,e.nodeType===8?oc(e.parentNode,n):e.nodeType===1&&oc(e,n),Bi(e)):oc($e,n.stateNode));break;case 4:s=$e,i=Ut,$e=n.stateNode.containerInfo,Ut=!0,Ln(e,t,n),$e=s,Ut=i;break;case 0:case 11:case 14:case 15:if(!Qe&&(s=n.updateQueue,s!==null&&(s=s.lastEffect,s!==null))){i=s=s.next;do{var a=i,o=a.destroy;a=a.tag,o!==void 0&&(a&2||a&4)&&zu(n,t,o),i=i.next}while(i!==s)}Ln(e,t,n);break;case 1:if(!Qe&&(fr(n,t),s=n.stateNode,typeof s.componentWillUnmount=="function"))try{s.props=n.memoizedProps,s.state=n.memoizedState,s.componentWillUnmount()}catch(l){Ee(n,t,l)}Ln(e,t,n);break;case 21:Ln(e,t,n);break;case 22:n.mode&1?(Qe=(s=Qe)||n.memoizedState!==null,Ln(e,t,n),Qe=s):Ln(e,t,n);break;default:Ln(e,t,n)}}function kp(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new N2),t.forEach(function(s){var i=z2.bind(null,e,s);n.has(s)||(n.add(s),s.then(i,i))})}}function Bt(e,t){var n=t.deletions;if(n!==null)for(var s=0;s<n.length;s++){var i=n[s];try{var a=e,o=t,l=o;e:for(;l!==null;){switch(l.tag){case 5:$e=l.stateNode,Ut=!1;break e;case 3:$e=l.stateNode.containerInfo,Ut=!0;break e;case 4:$e=l.stateNode.containerInfo,Ut=!0;break e}l=l.return}if($e===null)throw Error(F(160));Xx(a,o,i),$e=null,Ut=!1;var c=i.alternate;c!==null&&(c.return=null),i.return=null}catch(u){Ee(i,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Qx(t,e),t=t.sibling}function Qx(e,t){var n=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Bt(t,e),en(e),s&4){try{Ni(3,e,e.return),ml(3,e)}catch(y){Ee(e,e.return,y)}try{Ni(5,e,e.return)}catch(y){Ee(e,e.return,y)}}break;case 1:Bt(t,e),en(e),s&512&&n!==null&&fr(n,n.return);break;case 5:if(Bt(t,e),en(e),s&512&&n!==null&&fr(n,n.return),e.flags&32){var i=e.stateNode;try{Li(i,"")}catch(y){Ee(e,e.return,y)}}if(s&4&&(i=e.stateNode,i!=null)){var a=e.memoizedProps,o=n!==null?n.memoizedProps:a,l=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{l==="input"&&a.type==="radio"&&a.name!=null&&vg(i,a),ou(l,o);var u=ou(l,a);for(o=0;o<c.length;o+=2){var d=c[o],p=c[o+1];d==="style"?Ng(i,p):d==="dangerouslySetInnerHTML"?kg(i,p):d==="children"?Li(i,p):Ed(i,d,p,u)}switch(l){case"input":nu(i,a);break;case"textarea":bg(i,a);break;case"select":var f=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!a.multiple;var m=a.value;m!=null?wr(i,!!a.multiple,m,!1):f!==!!a.multiple&&(a.defaultValue!=null?wr(i,!!a.multiple,a.defaultValue,!0):wr(i,!!a.multiple,a.multiple?[]:"",!1))}i[Hi]=a}catch(y){Ee(e,e.return,y)}}break;case 6:if(Bt(t,e),en(e),s&4){if(e.stateNode===null)throw Error(F(162));i=e.stateNode,a=e.memoizedProps;try{i.nodeValue=a}catch(y){Ee(e,e.return,y)}}break;case 3:if(Bt(t,e),en(e),s&4&&n!==null&&n.memoizedState.isDehydrated)try{Bi(t.containerInfo)}catch(y){Ee(e,e.return,y)}break;case 4:Bt(t,e),en(e);break;case 13:Bt(t,e),en(e),i=e.child,i.flags&8192&&(a=i.memoizedState!==null,i.stateNode.isHidden=a,!a||i.alternate!==null&&i.alternate.memoizedState!==null||(ah=Pe())),s&4&&kp(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(Qe=(u=Qe)||d,Bt(t,e),Qe=u):Bt(t,e),en(e),s&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!d&&e.mode&1)for(q=e,d=e.child;d!==null;){for(p=q=d;q!==null;){switch(f=q,m=f.child,f.tag){case 0:case 11:case 14:case 15:Ni(4,f,f.return);break;case 1:fr(f,f.return);var b=f.stateNode;if(typeof b.componentWillUnmount=="function"){s=f,n=f.return;try{t=s,b.props=t.memoizedProps,b.state=t.memoizedState,b.componentWillUnmount()}catch(y){Ee(s,n,y)}}break;case 5:fr(f,f.return);break;case 22:if(f.memoizedState!==null){Np(p);continue}}m!==null?(m.return=f,q=m):Np(p)}d=d.sibling}e:for(d=null,p=e;;){if(p.tag===5){if(d===null){d=p;try{i=p.stateNode,u?(a=i.style,typeof a.setProperty=="function"?a.setProperty("display","none","important"):a.display="none"):(l=p.stateNode,c=p.memoizedProps.style,o=c!=null&&c.hasOwnProperty("display")?c.display:null,l.style.display=jg("display",o))}catch(y){Ee(e,e.return,y)}}}else if(p.tag===6){if(d===null)try{p.stateNode.nodeValue=u?"":p.memoizedProps}catch(y){Ee(e,e.return,y)}}else if((p.tag!==22&&p.tag!==23||p.memoizedState===null||p===e)&&p.child!==null){p.child.return=p,p=p.child;continue}if(p===e)break e;for(;p.sibling===null;){if(p.return===null||p.return===e)break e;d===p&&(d=null),p=p.return}d===p&&(d=null),p.sibling.return=p.return,p=p.sibling}}break;case 19:Bt(t,e),en(e),s&4&&kp(e);break;case 21:break;default:Bt(t,e),en(e)}}function en(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(Yx(n)){var s=n;break e}n=n.return}throw Error(F(160))}switch(s.tag){case 5:var i=s.stateNode;s.flags&32&&(Li(i,""),s.flags&=-33);var a=wp(e);Du(e,a,i);break;case 3:case 4:var o=s.stateNode.containerInfo,l=wp(e);Ou(e,l,o);break;default:throw Error(F(161))}}catch(c){Ee(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function C2(e,t,n){q=e,Jx(e)}function Jx(e,t,n){for(var s=(e.mode&1)!==0;q!==null;){var i=q,a=i.child;if(i.tag===22&&s){var o=i.memoizedState!==null||Ia;if(!o){var l=i.alternate,c=l!==null&&l.memoizedState!==null||Qe;l=Ia;var u=Qe;if(Ia=o,(Qe=c)&&!u)for(q=i;q!==null;)o=q,c=o.child,o.tag===22&&o.memoizedState!==null?Sp(i):c!==null?(c.return=o,q=c):Sp(i);for(;a!==null;)q=a,Jx(a),a=a.sibling;q=i,Ia=l,Qe=u}jp(e)}else i.subtreeFlags&8772&&a!==null?(a.return=i,q=a):jp(e)}}function jp(e){for(;q!==null;){var t=q;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Qe||ml(5,t);break;case 1:var s=t.stateNode;if(t.flags&4&&!Qe)if(n===null)s.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:$t(t.type,n.memoizedProps);s.componentDidUpdate(i,n.memoizedState,s.__reactInternalSnapshotBeforeUpdate)}var a=t.updateQueue;a!==null&&op(t,a,s);break;case 3:var o=t.updateQueue;if(o!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}op(t,o,n)}break;case 5:var l=t.stateNode;if(n===null&&t.flags&4){n=l;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&n.focus();break;case"img":c.src&&(n.src=c.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var d=u.memoizedState;if(d!==null){var p=d.dehydrated;p!==null&&Bi(p)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(F(163))}Qe||t.flags&512&&Lu(t)}catch(f){Ee(t,t.return,f)}}if(t===e){q=null;break}if(n=t.sibling,n!==null){n.return=t.return,q=n;break}q=t.return}}function Np(e){for(;q!==null;){var t=q;if(t===e){q=null;break}var n=t.sibling;if(n!==null){n.return=t.return,q=n;break}q=t.return}}function Sp(e){for(;q!==null;){var t=q;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{ml(4,t)}catch(c){Ee(t,n,c)}break;case 1:var s=t.stateNode;if(typeof s.componentDidMount=="function"){var i=t.return;try{s.componentDidMount()}catch(c){Ee(t,i,c)}}var a=t.return;try{Lu(t)}catch(c){Ee(t,a,c)}break;case 5:var o=t.return;try{Lu(t)}catch(c){Ee(t,o,c)}}}catch(c){Ee(t,t.return,c)}if(t===e){q=null;break}var l=t.sibling;if(l!==null){l.return=t.return,q=l;break}q=t.return}}var E2=Math.ceil,Wo=Tn.ReactCurrentDispatcher,rh=Tn.ReactCurrentOwner,Mt=Tn.ReactCurrentBatchConfig,ce=0,Fe=null,Ae=null,He=0,mt=0,pr=cs(0),Oe=0,Xi=null,Rs=0,gl=0,ih=0,Si=null,ct=null,ah=0,zr=1/0,gn=null,Ko=!1,Iu=null,Xn=null,Ba=!1,Un=null,Go=0,Ci=0,Bu=null,fo=-1,po=0;function st(){return ce&6?Pe():fo!==-1?fo:fo=Pe()}function Qn(e){return e.mode&1?ce&2&&He!==0?He&-He:u2.transition!==null?(po===0&&(po=Og()),po):(e=he,e!==0||(e=window.event,e=e===void 0?16:Ug(e.type)),e):1}function Gt(e,t,n,s){if(50<Ci)throw Ci=0,Bu=null,Error(F(185));da(e,n,s),(!(ce&2)||e!==Fe)&&(e===Fe&&(!(ce&2)&&(gl|=n),Oe===4&&Vn(e,He)),ft(e,s),n===1&&ce===0&&!(t.mode&1)&&(zr=Pe()+500,hl&&us()))}function ft(e,t){var n=e.callbackNode;uw(e,t);var s=Po(e,e===Fe?He:0);if(s===0)n!==null&&zf(n),e.callbackNode=null,e.callbackPriority=0;else if(t=s&-s,e.callbackPriority!==t){if(n!=null&&zf(n),t===1)e.tag===0?c2(Cp.bind(null,e)):lx(Cp.bind(null,e)),i2(function(){!(ce&6)&&us()}),n=null;else{switch(Dg(s)){case 1:n=Ad;break;case 4:n=zg;break;case 16:n=To;break;case 536870912:n=Lg;break;default:n=To}n=ay(n,Zx.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Zx(e,t){if(fo=-1,po=0,ce&6)throw Error(F(327));var n=e.callbackNode;if(Cr()&&e.callbackNode!==n)return null;var s=Po(e,e===Fe?He:0);if(s===0)return null;if(s&30||s&e.expiredLanes||t)t=qo(e,s);else{t=s;var i=ce;ce|=2;var a=ty();(Fe!==e||He!==t)&&(gn=null,zr=Pe()+500,Es(e,t));do try{P2();break}catch(l){ey(e,l)}while(!0);Wd(),Wo.current=a,ce=i,Ae!==null?t=0:(Fe=null,He=0,t=Oe)}if(t!==0){if(t===2&&(i=hu(e),i!==0&&(s=i,t=Fu(e,i))),t===1)throw n=Xi,Es(e,0),Vn(e,s),ft(e,Pe()),n;if(t===6)Vn(e,s);else{if(i=e.current.alternate,!(s&30)&&!_2(i)&&(t=qo(e,s),t===2&&(a=hu(e),a!==0&&(s=a,t=Fu(e,a))),t===1))throw n=Xi,Es(e,0),Vn(e,s),ft(e,Pe()),n;switch(e.finishedWork=i,e.finishedLanes=s,t){case 0:case 1:throw Error(F(345));case 2:bs(e,ct,gn);break;case 3:if(Vn(e,s),(s&130023424)===s&&(t=ah+500-Pe(),10<t)){if(Po(e,0)!==0)break;if(i=e.suspendedLanes,(i&s)!==s){st(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=bu(bs.bind(null,e,ct,gn),t);break}bs(e,ct,gn);break;case 4:if(Vn(e,s),(s&4194240)===s)break;for(t=e.eventTimes,i=-1;0<s;){var o=31-Kt(s);a=1<<o,o=t[o],o>i&&(i=o),s&=~a}if(s=i,s=Pe()-s,s=(120>s?120:480>s?480:1080>s?1080:1920>s?1920:3e3>s?3e3:4320>s?4320:1960*E2(s/1960))-s,10<s){e.timeoutHandle=bu(bs.bind(null,e,ct,gn),s);break}bs(e,ct,gn);break;case 5:bs(e,ct,gn);break;default:throw Error(F(329))}}}return ft(e,Pe()),e.callbackNode===n?Zx.bind(null,e):null}function Fu(e,t){var n=Si;return e.current.memoizedState.isDehydrated&&(Es(e,t).flags|=256),e=qo(e,t),e!==2&&(t=ct,ct=n,t!==null&&Vu(t)),e}function Vu(e){ct===null?ct=e:ct.push.apply(ct,e)}function _2(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var s=0;s<n.length;s++){var i=n[s],a=i.getSnapshot;i=i.value;try{if(!qt(a(),i))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Vn(e,t){for(t&=~ih,t&=~gl,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Kt(t),s=1<<n;e[n]=-1,t&=~s}}function Cp(e){if(ce&6)throw Error(F(327));Cr();var t=Po(e,0);if(!(t&1))return ft(e,Pe()),null;var n=qo(e,t);if(e.tag!==0&&n===2){var s=hu(e);s!==0&&(t=s,n=Fu(e,s))}if(n===1)throw n=Xi,Es(e,0),Vn(e,t),ft(e,Pe()),n;if(n===6)throw Error(F(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,bs(e,ct,gn),ft(e,Pe()),null}function oh(e,t){var n=ce;ce|=1;try{return e(t)}finally{ce=n,ce===0&&(zr=Pe()+500,hl&&us())}}function zs(e){Un!==null&&Un.tag===0&&!(ce&6)&&Cr();var t=ce;ce|=1;var n=Mt.transition,s=he;try{if(Mt.transition=null,he=1,e)return e()}finally{he=s,Mt.transition=n,ce=t,!(ce&6)&&us()}}function lh(){mt=pr.current,ye(pr)}function Es(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,r2(n)),Ae!==null)for(n=Ae.return;n!==null;){var s=n;switch($d(s),s.tag){case 1:s=s.type.childContextTypes,s!=null&&Lo();break;case 3:Ar(),ye(dt),ye(Ze),Qd();break;case 5:Xd(s);break;case 4:Ar();break;case 13:ye(ke);break;case 19:ye(ke);break;case 10:Kd(s.type._context);break;case 22:case 23:lh()}n=n.return}if(Fe=e,Ae=e=Jn(e.current,null),He=mt=t,Oe=0,Xi=null,ih=gl=Rs=0,ct=Si=null,Ns!==null){for(t=0;t<Ns.length;t++)if(n=Ns[t],s=n.interleaved,s!==null){n.interleaved=null;var i=s.next,a=n.pending;if(a!==null){var o=a.next;a.next=i,s.next=o}n.pending=s}Ns=null}return e}function ey(e,t){do{var n=Ae;try{if(Wd(),co.current=Ho,Uo){for(var s=Ne.memoizedState;s!==null;){var i=s.queue;i!==null&&(i.pending=null),s=s.next}Uo=!1}if(As=0,Be=Le=Ne=null,ji=!1,Gi=0,rh.current=null,n===null||n.return===null){Oe=1,Xi=t,Ae=null;break}e:{var a=e,o=n.return,l=n,c=t;if(t=He,l.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var u=c,d=l,p=d.tag;if(!(d.mode&1)&&(p===0||p===11||p===15)){var f=d.alternate;f?(d.updateQueue=f.updateQueue,d.memoizedState=f.memoizedState,d.lanes=f.lanes):(d.updateQueue=null,d.memoizedState=null)}var m=fp(o);if(m!==null){m.flags&=-257,pp(m,o,l,a,t),m.mode&1&&hp(a,u,t),t=m,c=u;var b=t.updateQueue;if(b===null){var y=new Set;y.add(c),t.updateQueue=y}else b.add(c);break e}else{if(!(t&1)){hp(a,u,t),ch();break e}c=Error(F(426))}}else if(we&&l.mode&1){var v=fp(o);if(v!==null){!(v.flags&65536)&&(v.flags|=256),pp(v,o,l,a,t),Ud(Rr(c,l));break e}}a=c=Rr(c,l),Oe!==4&&(Oe=2),Si===null?Si=[a]:Si.push(a),a=o;do{switch(a.tag){case 3:a.flags|=65536,t&=-t,a.lanes|=t;var g=Dx(a,c,t);ap(a,g);break e;case 1:l=c;var x=a.type,w=a.stateNode;if(!(a.flags&128)&&(typeof x.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(Xn===null||!Xn.has(w)))){a.flags|=65536,t&=-t,a.lanes|=t;var j=Ix(a,l,t);ap(a,j);break e}}a=a.return}while(a!==null)}sy(n)}catch(k){t=k,Ae===n&&n!==null&&(Ae=n=n.return);continue}break}while(!0)}function ty(){var e=Wo.current;return Wo.current=Ho,e===null?Ho:e}function ch(){(Oe===0||Oe===3||Oe===2)&&(Oe=4),Fe===null||!(Rs&268435455)&&!(gl&268435455)||Vn(Fe,He)}function qo(e,t){var n=ce;ce|=2;var s=ty();(Fe!==e||He!==t)&&(gn=null,Es(e,t));do try{T2();break}catch(i){ey(e,i)}while(!0);if(Wd(),ce=n,Wo.current=s,Ae!==null)throw Error(F(261));return Fe=null,He=0,Oe}function T2(){for(;Ae!==null;)ny(Ae)}function P2(){for(;Ae!==null&&!tw();)ny(Ae)}function ny(e){var t=iy(e.alternate,e,mt);e.memoizedProps=e.pendingProps,t===null?sy(e):Ae=t,rh.current=null}function sy(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=j2(n,t),n!==null){n.flags&=32767,Ae=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Oe=6,Ae=null;return}}else if(n=k2(n,t,mt),n!==null){Ae=n;return}if(t=t.sibling,t!==null){Ae=t;return}Ae=t=e}while(t!==null);Oe===0&&(Oe=5)}function bs(e,t,n){var s=he,i=Mt.transition;try{Mt.transition=null,he=1,M2(e,t,n,s)}finally{Mt.transition=i,he=s}return null}function M2(e,t,n,s){do Cr();while(Un!==null);if(ce&6)throw Error(F(327));n=e.finishedWork;var i=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(F(177));e.callbackNode=null,e.callbackPriority=0;var a=n.lanes|n.childLanes;if(dw(e,a),e===Fe&&(Ae=Fe=null,He=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Ba||(Ba=!0,ay(To,function(){return Cr(),null})),a=(n.flags&15990)!==0,n.subtreeFlags&15990||a){a=Mt.transition,Mt.transition=null;var o=he;he=1;var l=ce;ce|=4,rh.current=null,S2(e,n),Qx(n,e),Qw(yu),Mo=!!xu,yu=xu=null,e.current=n,C2(n),nw(),ce=l,he=o,Mt.transition=a}else e.current=n;if(Ba&&(Ba=!1,Un=e,Go=i),a=e.pendingLanes,a===0&&(Xn=null),iw(n.stateNode),ft(e,Pe()),t!==null)for(s=e.onRecoverableError,n=0;n<t.length;n++)i=t[n],s(i.value,{componentStack:i.stack,digest:i.digest});if(Ko)throw Ko=!1,e=Iu,Iu=null,e;return Go&1&&e.tag!==0&&Cr(),a=e.pendingLanes,a&1?e===Bu?Ci++:(Ci=0,Bu=e):Ci=0,us(),null}function Cr(){if(Un!==null){var e=Dg(Go),t=Mt.transition,n=he;try{if(Mt.transition=null,he=16>e?16:e,Un===null)var s=!1;else{if(e=Un,Un=null,Go=0,ce&6)throw Error(F(331));var i=ce;for(ce|=4,q=e.current;q!==null;){var a=q,o=a.child;if(q.flags&16){var l=a.deletions;if(l!==null){for(var c=0;c<l.length;c++){var u=l[c];for(q=u;q!==null;){var d=q;switch(d.tag){case 0:case 11:case 15:Ni(8,d,a)}var p=d.child;if(p!==null)p.return=d,q=p;else for(;q!==null;){d=q;var f=d.sibling,m=d.return;if(qx(d),d===u){q=null;break}if(f!==null){f.return=m,q=f;break}q=m}}}var b=a.alternate;if(b!==null){var y=b.child;if(y!==null){b.child=null;do{var v=y.sibling;y.sibling=null,y=v}while(y!==null)}}q=a}}if(a.subtreeFlags&2064&&o!==null)o.return=a,q=o;else e:for(;q!==null;){if(a=q,a.flags&2048)switch(a.tag){case 0:case 11:case 15:Ni(9,a,a.return)}var g=a.sibling;if(g!==null){g.return=a.return,q=g;break e}q=a.return}}var x=e.current;for(q=x;q!==null;){o=q;var w=o.child;if(o.subtreeFlags&2064&&w!==null)w.return=o,q=w;else e:for(o=x;q!==null;){if(l=q,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:ml(9,l)}}catch(k){Ee(l,l.return,k)}if(l===o){q=null;break e}var j=l.sibling;if(j!==null){j.return=l.return,q=j;break e}q=l.return}}if(ce=i,us(),an&&typeof an.onPostCommitFiberRoot=="function")try{an.onPostCommitFiberRoot(ol,e)}catch{}s=!0}return s}finally{he=n,Mt.transition=t}}return!1}function Ep(e,t,n){t=Rr(n,t),t=Dx(e,t,1),e=Yn(e,t,1),t=st(),e!==null&&(da(e,1,t),ft(e,t))}function Ee(e,t,n){if(e.tag===3)Ep(e,e,n);else for(;t!==null;){if(t.tag===3){Ep(t,e,n);break}else if(t.tag===1){var s=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(Xn===null||!Xn.has(s))){e=Rr(n,e),e=Ix(t,e,1),t=Yn(t,e,1),e=st(),t!==null&&(da(t,1,e),ft(t,e));break}}t=t.return}}function A2(e,t,n){var s=e.pingCache;s!==null&&s.delete(t),t=st(),e.pingedLanes|=e.suspendedLanes&n,Fe===e&&(He&n)===n&&(Oe===4||Oe===3&&(He&130023424)===He&&500>Pe()-ah?Es(e,0):ih|=n),ft(e,t)}function ry(e,t){t===0&&(e.mode&1?(t=Ta,Ta<<=1,!(Ta&130023424)&&(Ta=4194304)):t=1);var n=st();e=Cn(e,t),e!==null&&(da(e,t,n),ft(e,n))}function R2(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),ry(e,n)}function z2(e,t){var n=0;switch(e.tag){case 13:var s=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:s=e.stateNode;break;default:throw Error(F(314))}s!==null&&s.delete(t),ry(e,n)}var iy;iy=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||dt.current)ut=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return ut=!1,w2(e,t,n);ut=!!(e.flags&131072)}else ut=!1,we&&t.flags&1048576&&cx(t,Io,t.index);switch(t.lanes=0,t.tag){case 2:var s=t.type;ho(e,t),e=t.pendingProps;var i=Tr(t,Ze.current);Sr(t,n),i=Zd(null,t,s,e,i,n);var a=eh();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,ht(s)?(a=!0,Oo(t)):a=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,qd(t),i.updater=pl,t.stateNode=i,i._reactInternals=t,Eu(t,s,e,n),t=Pu(null,t,s,!0,a,n)):(t.tag=0,we&&a&&Vd(t),nt(null,t,i,n),t=t.child),t;case 16:s=t.elementType;e:{switch(ho(e,t),e=t.pendingProps,i=s._init,s=i(s._payload),t.type=s,i=t.tag=O2(s),e=$t(s,e),i){case 0:t=Tu(null,t,s,e,n);break e;case 1:t=xp(null,t,s,e,n);break e;case 11:t=mp(null,t,s,e,n);break e;case 14:t=gp(null,t,s,$t(s.type,e),n);break e}throw Error(F(306,s,""))}return t;case 0:return s=t.type,i=t.pendingProps,i=t.elementType===s?i:$t(s,i),Tu(e,t,s,i,n);case 1:return s=t.type,i=t.pendingProps,i=t.elementType===s?i:$t(s,i),xp(e,t,s,i,n);case 3:e:{if($x(t),e===null)throw Error(F(387));s=t.pendingProps,a=t.memoizedState,i=a.element,mx(e,t),Vo(t,s,null,n);var o=t.memoizedState;if(s=o.element,a.isDehydrated)if(a={element:s,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){i=Rr(Error(F(423)),t),t=yp(e,t,s,n,i);break e}else if(s!==i){i=Rr(Error(F(424)),t),t=yp(e,t,s,n,i);break e}else for(gt=qn(t.stateNode.containerInfo.firstChild),xt=t,we=!0,Wt=null,n=fx(t,null,s,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Pr(),s===i){t=En(e,t,n);break e}nt(e,t,s,n)}t=t.child}return t;case 5:return gx(t),e===null&&Nu(t),s=t.type,i=t.pendingProps,a=e!==null?e.memoizedProps:null,o=i.children,vu(s,i)?o=null:a!==null&&vu(s,a)&&(t.flags|=32),Vx(e,t),nt(e,t,o,n),t.child;case 6:return e===null&&Nu(t),null;case 13:return Ux(e,t,n);case 4:return Yd(t,t.stateNode.containerInfo),s=t.pendingProps,e===null?t.child=Mr(t,null,s,n):nt(e,t,s,n),t.child;case 11:return s=t.type,i=t.pendingProps,i=t.elementType===s?i:$t(s,i),mp(e,t,s,i,n);case 7:return nt(e,t,t.pendingProps,n),t.child;case 8:return nt(e,t,t.pendingProps.children,n),t.child;case 12:return nt(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(s=t.type._context,i=t.pendingProps,a=t.memoizedProps,o=i.value,me(Bo,s._currentValue),s._currentValue=o,a!==null)if(qt(a.value,o)){if(a.children===i.children&&!dt.current){t=En(e,t,n);break e}}else for(a=t.child,a!==null&&(a.return=t);a!==null;){var l=a.dependencies;if(l!==null){o=a.child;for(var c=l.firstContext;c!==null;){if(c.context===s){if(a.tag===1){c=wn(-1,n&-n),c.tag=2;var u=a.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?c.next=c:(c.next=d.next,d.next=c),u.pending=c}}a.lanes|=n,c=a.alternate,c!==null&&(c.lanes|=n),Su(a.return,n,t),l.lanes|=n;break}c=c.next}}else if(a.tag===10)o=a.type===t.type?null:a.child;else if(a.tag===18){if(o=a.return,o===null)throw Error(F(341));o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),Su(o,n,t),o=a.sibling}else o=a.child;if(o!==null)o.return=a;else for(o=a;o!==null;){if(o===t){o=null;break}if(a=o.sibling,a!==null){a.return=o.return,o=a;break}o=o.return}a=o}nt(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,s=t.pendingProps.children,Sr(t,n),i=At(i),s=s(i),t.flags|=1,nt(e,t,s,n),t.child;case 14:return s=t.type,i=$t(s,t.pendingProps),i=$t(s.type,i),gp(e,t,s,i,n);case 15:return Bx(e,t,t.type,t.pendingProps,n);case 17:return s=t.type,i=t.pendingProps,i=t.elementType===s?i:$t(s,i),ho(e,t),t.tag=1,ht(s)?(e=!0,Oo(t)):e=!1,Sr(t,n),Ox(t,s,i),Eu(t,s,i,n),Pu(null,t,s,!0,e,n);case 19:return Hx(e,t,n);case 22:return Fx(e,t,n)}throw Error(F(156,t.tag))};function ay(e,t){return Rg(e,t)}function L2(e,t,n,s){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Tt(e,t,n,s){return new L2(e,t,n,s)}function uh(e){return e=e.prototype,!(!e||!e.isReactComponent)}function O2(e){if(typeof e=="function")return uh(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Td)return 11;if(e===Pd)return 14}return 2}function Jn(e,t){var n=e.alternate;return n===null?(n=Tt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function mo(e,t,n,s,i,a){var o=2;if(s=e,typeof e=="function")uh(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case rr:return _s(n.children,i,a,t);case _d:o=8,i|=8;break;case Qc:return e=Tt(12,n,t,i|2),e.elementType=Qc,e.lanes=a,e;case Jc:return e=Tt(13,n,t,i),e.elementType=Jc,e.lanes=a,e;case Zc:return e=Tt(19,n,t,i),e.elementType=Zc,e.lanes=a,e;case gg:return xl(n,i,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case pg:o=10;break e;case mg:o=9;break e;case Td:o=11;break e;case Pd:o=14;break e;case In:o=16,s=null;break e}throw Error(F(130,e==null?e:typeof e,""))}return t=Tt(o,n,t,i),t.elementType=e,t.type=s,t.lanes=a,t}function _s(e,t,n,s){return e=Tt(7,e,s,t),e.lanes=n,e}function xl(e,t,n,s){return e=Tt(22,e,s,t),e.elementType=gg,e.lanes=n,e.stateNode={isHidden:!1},e}function mc(e,t,n){return e=Tt(6,e,null,t),e.lanes=n,e}function gc(e,t,n){return t=Tt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function D2(e,t,n,s,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Xl(0),this.expirationTimes=Xl(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Xl(0),this.identifierPrefix=s,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function dh(e,t,n,s,i,a,o,l,c){return e=new D2(e,t,n,l,c),t===1?(t=1,a===!0&&(t|=8)):t=0,a=Tt(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:s,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},qd(a),e}function I2(e,t,n){var s=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:sr,key:s==null?null:""+s,children:e,containerInfo:t,implementation:n}}function oy(e){if(!e)return ss;e=e._reactInternals;e:{if(Fs(e)!==e||e.tag!==1)throw Error(F(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(ht(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(F(171))}if(e.tag===1){var n=e.type;if(ht(n))return ox(e,n,t)}return t}function ly(e,t,n,s,i,a,o,l,c){return e=dh(n,s,!0,e,i,a,o,l,c),e.context=oy(null),n=e.current,s=st(),i=Qn(n),a=wn(s,i),a.callback=t??null,Yn(n,a,i),e.current.lanes=i,da(e,i,s),ft(e,s),e}function yl(e,t,n,s){var i=t.current,a=st(),o=Qn(i);return n=oy(n),t.context===null?t.context=n:t.pendingContext=n,t=wn(a,o),t.payload={element:e},s=s===void 0?null:s,s!==null&&(t.callback=s),e=Yn(i,t,o),e!==null&&(Gt(e,i,o,a),lo(e,i,o)),o}function Yo(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function _p(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function hh(e,t){_p(e,t),(e=e.alternate)&&_p(e,t)}function B2(){return null}var cy=typeof reportError=="function"?reportError:function(e){console.error(e)};function fh(e){this._internalRoot=e}vl.prototype.render=fh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(F(409));yl(e,t,null,null)};vl.prototype.unmount=fh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;zs(function(){yl(null,e,null,null)}),t[Sn]=null}};function vl(e){this._internalRoot=e}vl.prototype.unstable_scheduleHydration=function(e){if(e){var t=Fg();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Fn.length&&t!==0&&t<Fn[n].priority;n++);Fn.splice(n,0,e),n===0&&$g(e)}};function ph(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function bl(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Tp(){}function F2(e,t,n,s,i){if(i){if(typeof s=="function"){var a=s;s=function(){var u=Yo(o);a.call(u)}}var o=ly(t,s,e,0,null,!1,!1,"",Tp);return e._reactRootContainer=o,e[Sn]=o.current,$i(e.nodeType===8?e.parentNode:e),zs(),o}for(;i=e.lastChild;)e.removeChild(i);if(typeof s=="function"){var l=s;s=function(){var u=Yo(c);l.call(u)}}var c=dh(e,0,!1,null,null,!1,!1,"",Tp);return e._reactRootContainer=c,e[Sn]=c.current,$i(e.nodeType===8?e.parentNode:e),zs(function(){yl(t,c,n,s)}),c}function wl(e,t,n,s,i){var a=n._reactRootContainer;if(a){var o=a;if(typeof i=="function"){var l=i;i=function(){var c=Yo(o);l.call(c)}}yl(t,o,e,i)}else o=F2(n,t,e,i,s);return Yo(o)}Ig=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=di(t.pendingLanes);n!==0&&(Rd(t,n|1),ft(t,Pe()),!(ce&6)&&(zr=Pe()+500,us()))}break;case 13:zs(function(){var s=Cn(e,1);if(s!==null){var i=st();Gt(s,e,1,i)}}),hh(e,1)}};zd=function(e){if(e.tag===13){var t=Cn(e,134217728);if(t!==null){var n=st();Gt(t,e,134217728,n)}hh(e,134217728)}};Bg=function(e){if(e.tag===13){var t=Qn(e),n=Cn(e,t);if(n!==null){var s=st();Gt(n,e,t,s)}hh(e,t)}};Fg=function(){return he};Vg=function(e,t){var n=he;try{return he=e,t()}finally{he=n}};cu=function(e,t,n){switch(t){case"input":if(nu(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var s=n[t];if(s!==e&&s.form===e.form){var i=dl(s);if(!i)throw Error(F(90));yg(s),nu(s,i)}}}break;case"textarea":bg(e,n);break;case"select":t=n.value,t!=null&&wr(e,!!n.multiple,t,!1)}};Eg=oh;_g=zs;var V2={usingClientEntryPoint:!1,Events:[fa,lr,dl,Sg,Cg,oh]},ii={findFiberByHostInstance:js,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},$2={bundleType:ii.bundleType,version:ii.version,rendererPackageName:ii.rendererPackageName,rendererConfig:ii.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Tn.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Mg(e),e===null?null:e.stateNode},findFiberByHostInstance:ii.findFiberByHostInstance||B2,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Fa=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Fa.isDisabled&&Fa.supportsFiber)try{ol=Fa.inject($2),an=Fa}catch{}}kt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=V2;kt.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!ph(t))throw Error(F(200));return I2(e,t,null,n)};kt.createRoot=function(e,t){if(!ph(e))throw Error(F(299));var n=!1,s="",i=cy;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=dh(e,1,!1,null,null,n,!1,s,i),e[Sn]=t.current,$i(e.nodeType===8?e.parentNode:e),new fh(t)};kt.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(F(188)):(e=Object.keys(e).join(","),Error(F(268,e)));return e=Mg(t),e=e===null?null:e.stateNode,e};kt.flushSync=function(e){return zs(e)};kt.hydrate=function(e,t,n){if(!bl(t))throw Error(F(200));return wl(null,e,t,!0,n)};kt.hydrateRoot=function(e,t,n){if(!ph(e))throw Error(F(405));var s=n!=null&&n.hydratedSources||null,i=!1,a="",o=cy;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(a=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),t=ly(t,null,e,1,n??null,i,!1,a,o),e[Sn]=t.current,$i(e),s)for(e=0;e<s.length;e++)n=s[e],i=n._getVersion,i=i(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,i]:t.mutableSourceEagerHydrationData.push(n,i);return new vl(t)};kt.render=function(e,t,n){if(!bl(t))throw Error(F(200));return wl(null,e,t,!1,n)};kt.unmountComponentAtNode=function(e){if(!bl(e))throw Error(F(40));return e._reactRootContainer?(zs(function(){wl(null,null,e,!1,function(){e._reactRootContainer=null,e[Sn]=null})}),!0):!1};kt.unstable_batchedUpdates=oh;kt.unstable_renderSubtreeIntoContainer=function(e,t,n,s){if(!bl(n))throw Error(F(200));if(e==null||e._reactInternals===void 0)throw Error(F(38));return wl(e,t,n,!1,s)};kt.version="18.3.1-next-f1338f8080-20240426";function uy(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(uy)}catch(e){console.error(e)}}uy(),ug.exports=kt;var mh=ug.exports;const dy=J0(mh);var hy,Pp=mh;hy=Pp.createRoot,Pp.hydrateRoot;/**
40
+ `+a.stack}return{value:e,source:t,stack:i,digest:null}}function fc(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function _u(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var y2=typeof WeakMap=="function"?WeakMap:Map;function Dx(e,t,n){n=wn(-1,n),n.tag=3,n.payload={element:null};var s=t.value;return n.callback=function(){Ko||(Ko=!0,Iu=s),_u(e,t)},n}function Ix(e,t,n){n=wn(-1,n),n.tag=3;var s=e.type.getDerivedStateFromError;if(typeof s=="function"){var i=t.value;n.payload=function(){return s(i)},n.callback=function(){_u(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch=="function"&&(n.callback=function(){_u(e,t),typeof s!="function"&&(Xn===null?Xn=new Set([this]):Xn.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function hp(e,t,n){var s=e.pingCache;if(s===null){s=e.pingCache=new y2;var i=new Set;s.set(t,i)}else i=s.get(t),i===void 0&&(i=new Set,s.set(t,i));i.has(n)||(i.add(n),e=M2.bind(null,e,t,n),t.then(e,e))}function fp(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function pp(e,t,n,s,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=wn(-1,1),t.tag=2,Yn(n,t,1))),n.lanes|=1),e)}var v2=Tn.ReactCurrentOwner,ut=!1;function nt(e,t,n,s){t.child=e===null?fx(t,null,n,s):Mr(t,e.child,n,s)}function mp(e,t,n,s,i){n=n.render;var a=t.ref;return Cr(t,i),s=Zd(e,t,n,s,a,i),n=eh(),e!==null&&!ut?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,En(e,t,i)):(we&&n&&Vd(t),t.flags|=1,nt(e,t,s,i),t.child)}function gp(e,t,n,s,i){if(e===null){var a=n.type;return typeof a=="function"&&!uh(a)&&a.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=a,Bx(e,t,a,s,i)):(e=mo(n.type,null,s,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!(e.lanes&i)){var o=a.memoizedProps;if(n=n.compare,n=n!==null?n:Vi,n(o,s)&&e.ref===t.ref)return En(e,t,i)}return t.flags|=1,e=Jn(a,s),e.ref=t.ref,e.return=t,t.child=e}function Bx(e,t,n,s,i){if(e!==null){var a=e.memoizedProps;if(Vi(a,s)&&e.ref===t.ref)if(ut=!1,t.pendingProps=s=a,(e.lanes&i)!==0)e.flags&131072&&(ut=!0);else return t.lanes=e.lanes,En(e,t,i)}return Tu(e,t,n,s,i)}function Fx(e,t,n){var s=t.pendingProps,i=s.children,a=e!==null?e.memoizedState:null;if(s.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},me(mr,mt),mt|=n;else{if(!(n&1073741824))return e=a!==null?a.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,me(mr,mt),mt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},s=a!==null?a.baseLanes:n,me(mr,mt),mt|=s}else a!==null?(s=a.baseLanes|n,t.memoizedState=null):s=n,me(mr,mt),mt|=s;return nt(e,t,i,n),t.child}function Vx(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Tu(e,t,n,s,i){var a=ht(n)?Ps:Ze.current;return a=Pr(t,a),Cr(t,i),n=Zd(e,t,n,s,a,i),s=eh(),e!==null&&!ut?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,En(e,t,i)):(we&&s&&Vd(t),t.flags|=1,nt(e,t,n,i),t.child)}function xp(e,t,n,s,i){if(ht(n)){var a=!0;Oo(t)}else a=!1;if(Cr(t,i),t.stateNode===null)ho(e,t),Ox(t,n,s),Eu(t,n,s,i),s=!0;else if(e===null){var o=t.stateNode,l=t.memoizedProps;o.props=l;var c=o.context,u=n.contextType;typeof u=="object"&&u!==null?u=Mt(u):(u=ht(n)?Ps:Ze.current,u=Pr(t,u));var d=n.getDerivedStateFromProps,p=typeof d=="function"||typeof o.getSnapshotBeforeUpdate=="function";p||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==s||c!==u)&&dp(t,o,s,u),Bn=!1;var f=t.memoizedState;o.state=f,Vo(t,s,o,i),c=t.memoizedState,l!==s||f!==c||dt.current||Bn?(typeof d=="function"&&(Cu(t,n,d,s),c=t.memoizedState),(l=Bn||up(t,n,l,s,f,c,u))?(p||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=s,t.memoizedState=c),o.props=s,o.state=c,o.context=u,s=l):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),s=!1)}else{o=t.stateNode,mx(e,t),l=t.memoizedProps,u=t.type===t.elementType?l:$t(t.type,l),o.props=u,p=t.pendingProps,f=o.context,c=n.contextType,typeof c=="object"&&c!==null?c=Mt(c):(c=ht(n)?Ps:Ze.current,c=Pr(t,c));var m=n.getDerivedStateFromProps;(d=typeof m=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==p||f!==c)&&dp(t,o,s,c),Bn=!1,f=t.memoizedState,o.state=f,Vo(t,s,o,i);var v=t.memoizedState;l!==p||f!==v||dt.current||Bn?(typeof m=="function"&&(Cu(t,n,m,s),v=t.memoizedState),(u=Bn||up(t,n,u,s,f,v,c)||!1)?(d||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(s,v,c),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(s,v,c)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=s,t.memoizedState=v),o.props=s,o.state=v,o.context=c,s=u):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),s=!1)}return Pu(e,t,n,s,a,i)}function Pu(e,t,n,s,i,a){Vx(e,t);var o=(t.flags&128)!==0;if(!s&&!o)return i&&np(t,n,!1),En(e,t,a);s=t.stateNode,v2.current=t;var l=o&&typeof n.getDerivedStateFromError!="function"?null:s.render();return t.flags|=1,e!==null&&o?(t.child=Mr(t,e.child,null,a),t.child=Mr(t,null,l,a)):nt(e,t,l,a),t.memoizedState=s.state,i&&np(t,n,!0),t.child}function $x(e){var t=e.stateNode;t.pendingContext?tp(e,t.pendingContext,t.pendingContext!==t.context):t.context&&tp(e,t.context,!1),Yd(e,t.containerInfo)}function yp(e,t,n,s,i){return Ar(),Ud(i),t.flags|=256,nt(e,t,n,s),t.child}var Au={dehydrated:null,treeContext:null,retryLane:0};function Mu(e){return{baseLanes:e,cachePool:null,transitions:null}}function Ux(e,t,n){var s=t.pendingProps,i=ke.current,a=!1,o=(t.flags&128)!==0,l;if((l=o)||(l=e!==null&&e.memoizedState===null?!1:(i&2)!==0),l?(a=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),me(ke,i&1),e===null)return Nu(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(o=s.children,e=s.fallback,a?(s=t.mode,a=t.child,o={mode:"hidden",children:o},!(s&1)&&a!==null?(a.childLanes=0,a.pendingProps=o):a=xl(o,s,0,null),e=_s(e,s,n,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=Mu(n),t.memoizedState=Au,e):sh(t,o));if(i=e.memoizedState,i!==null&&(l=i.dehydrated,l!==null))return b2(e,t,o,s,l,i,n);if(a){a=s.fallback,o=t.mode,i=e.child,l=i.sibling;var c={mode:"hidden",children:s.children};return!(o&1)&&t.child!==i?(s=t.child,s.childLanes=0,s.pendingProps=c,t.deletions=null):(s=Jn(i,c),s.subtreeFlags=i.subtreeFlags&14680064),l!==null?a=Jn(l,a):(a=_s(a,o,n,null),a.flags|=2),a.return=t,s.return=t,s.sibling=a,t.child=s,s=a,a=t.child,o=e.child.memoizedState,o=o===null?Mu(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},a.memoizedState=o,a.childLanes=e.childLanes&~n,t.memoizedState=Au,s}return a=e.child,e=a.sibling,s=Jn(a,{mode:"visible",children:s.children}),!(t.mode&1)&&(s.lanes=n),s.return=t,s.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=s,t.memoizedState=null,s}function sh(e,t){return t=xl({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Da(e,t,n,s){return s!==null&&Ud(s),Mr(t,e.child,null,n),e=sh(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function b2(e,t,n,s,i,a,o){if(n)return t.flags&256?(t.flags&=-257,s=fc(Error(F(422))),Da(e,t,o,s)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(a=s.fallback,i=t.mode,s=xl({mode:"visible",children:s.children},i,0,null),a=_s(a,i,o,null),a.flags|=2,s.return=t,a.return=t,s.sibling=a,t.child=s,t.mode&1&&Mr(t,e.child,null,o),t.child.memoizedState=Mu(o),t.memoizedState=Au,a);if(!(t.mode&1))return Da(e,t,o,null);if(i.data==="$!"){if(s=i.nextSibling&&i.nextSibling.dataset,s)var l=s.dgst;return s=l,a=Error(F(419)),s=fc(a,s,void 0),Da(e,t,o,s)}if(l=(o&e.childLanes)!==0,ut||l){if(s=Fe,s!==null){switch(o&-o){case 4:i=2;break;case 16:i=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(s.suspendedLanes|o)?0:i,i!==0&&i!==a.retryLane&&(a.retryLane=i,Cn(e,i),Gt(s,e,i,-1))}return ch(),s=fc(Error(F(421))),Da(e,t,o,s)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=R2.bind(null,e),i._reactRetry=t,null):(e=a.treeContext,gt=qn(i.nextSibling),xt=t,we=!0,Wt=null,e!==null&&(Ct[Et++]=vn,Ct[Et++]=bn,Ct[Et++]=As,vn=e.id,bn=e.overflow,As=t),t=sh(t,s.children),t.flags|=4096,t)}function vp(e,t,n){e.lanes|=t;var s=e.alternate;s!==null&&(s.lanes|=t),Su(e.return,t,n)}function pc(e,t,n,s,i){var a=e.memoizedState;a===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:s,tail:n,tailMode:i}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=s,a.tail=n,a.tailMode=i)}function Hx(e,t,n){var s=t.pendingProps,i=s.revealOrder,a=s.tail;if(nt(e,t,s.children,n),s=ke.current,s&2)s=s&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&vp(e,n,t);else if(e.tag===19)vp(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}s&=1}if(me(ke,s),!(t.mode&1))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&$o(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),pc(t,!1,i,n,a);break;case"backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&$o(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}pc(t,!0,n,null,a);break;case"together":pc(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function ho(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function En(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Rs|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(F(153));if(t.child!==null){for(e=t.child,n=Jn(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Jn(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function w2(e,t,n){switch(t.tag){case 3:$x(t),Ar();break;case 5:gx(t);break;case 1:ht(t.type)&&Oo(t);break;case 4:Yd(t,t.stateNode.containerInfo);break;case 10:var s=t.type._context,i=t.memoizedProps.value;me(Bo,s._currentValue),s._currentValue=i;break;case 13:if(s=t.memoizedState,s!==null)return s.dehydrated!==null?(me(ke,ke.current&1),t.flags|=128,null):n&t.child.childLanes?Ux(e,t,n):(me(ke,ke.current&1),e=En(e,t,n),e!==null?e.sibling:null);me(ke,ke.current&1);break;case 19:if(s=(n&t.childLanes)!==0,e.flags&128){if(s)return Hx(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),me(ke,ke.current),s)break;return null;case 22:case 23:return t.lanes=0,Fx(e,t,n)}return En(e,t,n)}var Wx,Ru,Kx,Gx;Wx=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};Ru=function(){};Kx=function(e,t,n,s){var i=e.memoizedProps;if(i!==s){e=t.stateNode,Ss(on.current);var a=null;switch(n){case"input":i=tu(e,i),s=tu(e,s),a=[];break;case"select":i=Se({},i,{value:void 0}),s=Se({},s,{value:void 0}),a=[];break;case"textarea":i=ru(e,i),s=ru(e,s),a=[];break;default:typeof i.onClick!="function"&&typeof s.onClick=="function"&&(e.onclick=zo)}au(n,s);var o;n=null;for(u in i)if(!s.hasOwnProperty(u)&&i.hasOwnProperty(u)&&i[u]!=null)if(u==="style"){var l=i[u];for(o in l)l.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(zi.hasOwnProperty(u)?a||(a=[]):(a=a||[]).push(u,null));for(u in s){var c=s[u];if(l=i!=null?i[u]:void 0,s.hasOwnProperty(u)&&c!==l&&(c!=null||l!=null))if(u==="style")if(l){for(o in l)!l.hasOwnProperty(o)||c&&c.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in c)c.hasOwnProperty(o)&&l[o]!==c[o]&&(n||(n={}),n[o]=c[o])}else n||(a||(a=[]),a.push(u,n)),n=c;else u==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,l=l?l.__html:void 0,c!=null&&l!==c&&(a=a||[]).push(u,c)):u==="children"?typeof c!="string"&&typeof c!="number"||(a=a||[]).push(u,""+c):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(zi.hasOwnProperty(u)?(c!=null&&u==="onScroll"&&ge("scroll",e),a||l===c||(a=[])):(a=a||[]).push(u,c))}n&&(a=a||[]).push("style",n);var u=a;(t.updateQueue=u)&&(t.flags|=4)}};Gx=function(e,t,n,s){n!==s&&(t.flags|=4)};function ri(e,t){if(!we)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var s=null;n!==null;)n.alternate!==null&&(s=n),n=n.sibling;s===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:s.sibling=null}}function qe(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,s=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,s|=i.subtreeFlags&14680064,s|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,s|=i.subtreeFlags,s|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=s,e.childLanes=n,t}function k2(e,t,n){var s=t.pendingProps;switch($d(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return qe(t),null;case 1:return ht(t.type)&&Lo(),qe(t),null;case 3:return s=t.stateNode,Rr(),ye(dt),ye(Ze),Qd(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(e===null||e.child===null)&&(La(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Wt!==null&&(Vu(Wt),Wt=null))),Ru(e,t),qe(t),null;case 5:Xd(t);var i=Ss(Ki.current);if(n=t.type,e!==null&&t.stateNode!=null)Kx(e,t,n,s,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!s){if(t.stateNode===null)throw Error(F(166));return qe(t),null}if(e=Ss(on.current),La(t)){s=t.stateNode,n=t.type;var a=t.memoizedProps;switch(s[nn]=t,s[Hi]=a,e=(t.mode&1)!==0,n){case"dialog":ge("cancel",s),ge("close",s);break;case"iframe":case"object":case"embed":ge("load",s);break;case"video":case"audio":for(i=0;i<hi.length;i++)ge(hi[i],s);break;case"source":ge("error",s);break;case"img":case"image":case"link":ge("error",s),ge("load",s);break;case"details":ge("toggle",s);break;case"input":_f(s,a),ge("invalid",s);break;case"select":s._wrapperState={wasMultiple:!!a.multiple},ge("invalid",s);break;case"textarea":Pf(s,a),ge("invalid",s)}au(n,a),i=null;for(var o in a)if(a.hasOwnProperty(o)){var l=a[o];o==="children"?typeof l=="string"?s.textContent!==l&&(a.suppressHydrationWarning!==!0&&za(s.textContent,l,e),i=["children",l]):typeof l=="number"&&s.textContent!==""+l&&(a.suppressHydrationWarning!==!0&&za(s.textContent,l,e),i=["children",""+l]):zi.hasOwnProperty(o)&&l!=null&&o==="onScroll"&&ge("scroll",s)}switch(n){case"input":Ca(s),Tf(s,a,!0);break;case"textarea":Ca(s),Af(s);break;case"select":case"option":break;default:typeof a.onClick=="function"&&(s.onclick=zo)}s=i,t.updateQueue=s,s!==null&&(t.flags|=4)}else{o=i.nodeType===9?i:i.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=wg(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=o.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof s.is=="string"?e=o.createElement(n,{is:s.is}):(e=o.createElement(n),n==="select"&&(o=e,s.multiple?o.multiple=!0:s.size&&(o.size=s.size))):e=o.createElementNS(e,n),e[nn]=t,e[Hi]=s,Wx(e,t,!1,!1),t.stateNode=e;e:{switch(o=ou(n,s),n){case"dialog":ge("cancel",e),ge("close",e),i=s;break;case"iframe":case"object":case"embed":ge("load",e),i=s;break;case"video":case"audio":for(i=0;i<hi.length;i++)ge(hi[i],e);i=s;break;case"source":ge("error",e),i=s;break;case"img":case"image":case"link":ge("error",e),ge("load",e),i=s;break;case"details":ge("toggle",e),i=s;break;case"input":_f(e,s),i=tu(e,s),ge("invalid",e);break;case"option":i=s;break;case"select":e._wrapperState={wasMultiple:!!s.multiple},i=Se({},s,{value:void 0}),ge("invalid",e);break;case"textarea":Pf(e,s),i=ru(e,s),ge("invalid",e);break;default:i=s}au(n,i),l=i;for(a in l)if(l.hasOwnProperty(a)){var c=l[a];a==="style"?Ng(e,c):a==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&kg(e,c)):a==="children"?typeof c=="string"?(n!=="textarea"||c!=="")&&Li(e,c):typeof c=="number"&&Li(e,""+c):a!=="suppressContentEditableWarning"&&a!=="suppressHydrationWarning"&&a!=="autoFocus"&&(zi.hasOwnProperty(a)?c!=null&&a==="onScroll"&&ge("scroll",e):c!=null&&Ed(e,a,c,o))}switch(n){case"input":Ca(e),Tf(e,s,!1);break;case"textarea":Ca(e),Af(e);break;case"option":s.value!=null&&e.setAttribute("value",""+ns(s.value));break;case"select":e.multiple=!!s.multiple,a=s.value,a!=null?kr(e,!!s.multiple,a,!1):s.defaultValue!=null&&kr(e,!!s.multiple,s.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=zo)}switch(n){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}}s&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return qe(t),null;case 6:if(e&&t.stateNode!=null)Gx(e,t,e.memoizedProps,s);else{if(typeof s!="string"&&t.stateNode===null)throw Error(F(166));if(n=Ss(Ki.current),Ss(on.current),La(t)){if(s=t.stateNode,n=t.memoizedProps,s[nn]=t,(a=s.nodeValue!==n)&&(e=xt,e!==null))switch(e.tag){case 3:za(s.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&za(s.nodeValue,n,(e.mode&1)!==0)}a&&(t.flags|=4)}else s=(n.nodeType===9?n:n.ownerDocument).createTextNode(s),s[nn]=t,t.stateNode=s}return qe(t),null;case 13:if(ye(ke),s=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(we&&gt!==null&&t.mode&1&&!(t.flags&128))dx(),Ar(),t.flags|=98560,a=!1;else if(a=La(t),s!==null&&s.dehydrated!==null){if(e===null){if(!a)throw Error(F(318));if(a=t.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(F(317));a[nn]=t}else Ar(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;qe(t),a=!1}else Wt!==null&&(Vu(Wt),Wt=null),a=!0;if(!a)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(s=s!==null,s!==(e!==null&&e.memoizedState!==null)&&s&&(t.child.flags|=8192,t.mode&1&&(e===null||ke.current&1?Oe===0&&(Oe=3):ch())),t.updateQueue!==null&&(t.flags|=4),qe(t),null);case 4:return Rr(),Ru(e,t),e===null&&$i(t.stateNode.containerInfo),qe(t),null;case 10:return Kd(t.type._context),qe(t),null;case 17:return ht(t.type)&&Lo(),qe(t),null;case 19:if(ye(ke),a=t.memoizedState,a===null)return qe(t),null;if(s=(t.flags&128)!==0,o=a.rendering,o===null)if(s)ri(a,!1);else{if(Oe!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=$o(e),o!==null){for(t.flags|=128,ri(a,!1),s=o.updateQueue,s!==null&&(t.updateQueue=s,t.flags|=4),t.subtreeFlags=0,s=n,n=t.child;n!==null;)a=n,e=s,a.flags&=14680066,o=a.alternate,o===null?(a.childLanes=0,a.lanes=e,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=o.childLanes,a.lanes=o.lanes,a.child=o.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=o.memoizedProps,a.memoizedState=o.memoizedState,a.updateQueue=o.updateQueue,a.type=o.type,e=o.dependencies,a.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return me(ke,ke.current&1|2),t.child}e=e.sibling}a.tail!==null&&Pe()>Lr&&(t.flags|=128,s=!0,ri(a,!1),t.lanes=4194304)}else{if(!s)if(e=$o(o),e!==null){if(t.flags|=128,s=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),ri(a,!0),a.tail===null&&a.tailMode==="hidden"&&!o.alternate&&!we)return qe(t),null}else 2*Pe()-a.renderingStartTime>Lr&&n!==1073741824&&(t.flags|=128,s=!0,ri(a,!1),t.lanes=4194304);a.isBackwards?(o.sibling=t.child,t.child=o):(n=a.last,n!==null?n.sibling=o:t.child=o,a.last=o)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=Pe(),t.sibling=null,n=ke.current,me(ke,s?n&1|2:n&1),t):(qe(t),null);case 22:case 23:return lh(),s=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==s&&(t.flags|=8192),s&&t.mode&1?mt&1073741824&&(qe(t),t.subtreeFlags&6&&(t.flags|=8192)):qe(t),null;case 24:return null;case 25:return null}throw Error(F(156,t.tag))}function j2(e,t){switch($d(t),t.tag){case 1:return ht(t.type)&&Lo(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Rr(),ye(dt),ye(Ze),Qd(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Xd(t),null;case 13:if(ye(ke),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(F(340));Ar()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ye(ke),null;case 4:return Rr(),null;case 10:return Kd(t.type._context),null;case 22:case 23:return lh(),null;case 24:return null;default:return null}}var Ia=!1,Qe=!1,N2=typeof WeakSet=="function"?WeakSet:Set,q=null;function pr(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(s){Ee(e,t,s)}else n.current=null}function zu(e,t,n){try{n()}catch(s){Ee(e,t,s)}}var bp=!1;function S2(e,t){if(xu=Ao,e=Jg(),Fd(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var s=n.getSelection&&n.getSelection();if(s&&s.rangeCount!==0){n=s.anchorNode;var i=s.anchorOffset,a=s.focusNode;s=s.focusOffset;try{n.nodeType,a.nodeType}catch{n=null;break e}var o=0,l=-1,c=-1,u=0,d=0,p=e,f=null;t:for(;;){for(var m;p!==n||i!==0&&p.nodeType!==3||(l=o+i),p!==a||s!==0&&p.nodeType!==3||(c=o+s),p.nodeType===3&&(o+=p.nodeValue.length),(m=p.firstChild)!==null;)f=p,p=m;for(;;){if(p===e)break t;if(f===n&&++u===i&&(l=o),f===a&&++d===s&&(c=o),(m=p.nextSibling)!==null)break;p=f,f=p.parentNode}p=m}n=l===-1||c===-1?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(yu={focusedElem:e,selectionRange:n},Ao=!1,q=t;q!==null;)if(t=q,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,q=e;else for(;q!==null;){t=q;try{var v=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var y=v.memoizedProps,b=v.memoizedState,g=t.stateNode,x=g.getSnapshotBeforeUpdate(t.elementType===t.type?y:$t(t.type,y),b);g.__reactInternalSnapshotBeforeUpdate=x}break;case 3:var w=t.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(F(163))}}catch(j){Ee(t,t.return,j)}if(e=t.sibling,e!==null){e.return=t.return,q=e;break}q=t.return}return v=bp,bp=!1,v}function Ni(e,t,n){var s=t.updateQueue;if(s=s!==null?s.lastEffect:null,s!==null){var i=s=s.next;do{if((i.tag&e)===e){var a=i.destroy;i.destroy=void 0,a!==void 0&&zu(t,n,a)}i=i.next}while(i!==s)}}function ml(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var s=n.create;n.destroy=s()}n=n.next}while(n!==t)}}function Lu(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function qx(e){var t=e.alternate;t!==null&&(e.alternate=null,qx(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[nn],delete t[Hi],delete t[wu],delete t[o2],delete t[l2])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Yx(e){return e.tag===5||e.tag===3||e.tag===4}function wp(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Yx(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Ou(e,t,n){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=zo));else if(s!==4&&(e=e.child,e!==null))for(Ou(e,t,n),e=e.sibling;e!==null;)Ou(e,t,n),e=e.sibling}function Du(e,t,n){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(s!==4&&(e=e.child,e!==null))for(Du(e,t,n),e=e.sibling;e!==null;)Du(e,t,n),e=e.sibling}var $e=null,Ut=!1;function Ln(e,t,n){for(n=n.child;n!==null;)Xx(e,t,n),n=n.sibling}function Xx(e,t,n){if(an&&typeof an.onCommitFiberUnmount=="function")try{an.onCommitFiberUnmount(ol,n)}catch{}switch(n.tag){case 5:Qe||pr(n,t);case 6:var s=$e,i=Ut;$e=null,Ln(e,t,n),$e=s,Ut=i,$e!==null&&(Ut?(e=$e,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):$e.removeChild(n.stateNode));break;case 18:$e!==null&&(Ut?(e=$e,n=n.stateNode,e.nodeType===8?oc(e.parentNode,n):e.nodeType===1&&oc(e,n),Bi(e)):oc($e,n.stateNode));break;case 4:s=$e,i=Ut,$e=n.stateNode.containerInfo,Ut=!0,Ln(e,t,n),$e=s,Ut=i;break;case 0:case 11:case 14:case 15:if(!Qe&&(s=n.updateQueue,s!==null&&(s=s.lastEffect,s!==null))){i=s=s.next;do{var a=i,o=a.destroy;a=a.tag,o!==void 0&&(a&2||a&4)&&zu(n,t,o),i=i.next}while(i!==s)}Ln(e,t,n);break;case 1:if(!Qe&&(pr(n,t),s=n.stateNode,typeof s.componentWillUnmount=="function"))try{s.props=n.memoizedProps,s.state=n.memoizedState,s.componentWillUnmount()}catch(l){Ee(n,t,l)}Ln(e,t,n);break;case 21:Ln(e,t,n);break;case 22:n.mode&1?(Qe=(s=Qe)||n.memoizedState!==null,Ln(e,t,n),Qe=s):Ln(e,t,n);break;default:Ln(e,t,n)}}function kp(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new N2),t.forEach(function(s){var i=z2.bind(null,e,s);n.has(s)||(n.add(s),s.then(i,i))})}}function Bt(e,t){var n=t.deletions;if(n!==null)for(var s=0;s<n.length;s++){var i=n[s];try{var a=e,o=t,l=o;e:for(;l!==null;){switch(l.tag){case 5:$e=l.stateNode,Ut=!1;break e;case 3:$e=l.stateNode.containerInfo,Ut=!0;break e;case 4:$e=l.stateNode.containerInfo,Ut=!0;break e}l=l.return}if($e===null)throw Error(F(160));Xx(a,o,i),$e=null,Ut=!1;var c=i.alternate;c!==null&&(c.return=null),i.return=null}catch(u){Ee(i,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Qx(t,e),t=t.sibling}function Qx(e,t){var n=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Bt(t,e),en(e),s&4){try{Ni(3,e,e.return),ml(3,e)}catch(y){Ee(e,e.return,y)}try{Ni(5,e,e.return)}catch(y){Ee(e,e.return,y)}}break;case 1:Bt(t,e),en(e),s&512&&n!==null&&pr(n,n.return);break;case 5:if(Bt(t,e),en(e),s&512&&n!==null&&pr(n,n.return),e.flags&32){var i=e.stateNode;try{Li(i,"")}catch(y){Ee(e,e.return,y)}}if(s&4&&(i=e.stateNode,i!=null)){var a=e.memoizedProps,o=n!==null?n.memoizedProps:a,l=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{l==="input"&&a.type==="radio"&&a.name!=null&&vg(i,a),ou(l,o);var u=ou(l,a);for(o=0;o<c.length;o+=2){var d=c[o],p=c[o+1];d==="style"?Ng(i,p):d==="dangerouslySetInnerHTML"?kg(i,p):d==="children"?Li(i,p):Ed(i,d,p,u)}switch(l){case"input":nu(i,a);break;case"textarea":bg(i,a);break;case"select":var f=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!a.multiple;var m=a.value;m!=null?kr(i,!!a.multiple,m,!1):f!==!!a.multiple&&(a.defaultValue!=null?kr(i,!!a.multiple,a.defaultValue,!0):kr(i,!!a.multiple,a.multiple?[]:"",!1))}i[Hi]=a}catch(y){Ee(e,e.return,y)}}break;case 6:if(Bt(t,e),en(e),s&4){if(e.stateNode===null)throw Error(F(162));i=e.stateNode,a=e.memoizedProps;try{i.nodeValue=a}catch(y){Ee(e,e.return,y)}}break;case 3:if(Bt(t,e),en(e),s&4&&n!==null&&n.memoizedState.isDehydrated)try{Bi(t.containerInfo)}catch(y){Ee(e,e.return,y)}break;case 4:Bt(t,e),en(e);break;case 13:Bt(t,e),en(e),i=e.child,i.flags&8192&&(a=i.memoizedState!==null,i.stateNode.isHidden=a,!a||i.alternate!==null&&i.alternate.memoizedState!==null||(ah=Pe())),s&4&&kp(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(Qe=(u=Qe)||d,Bt(t,e),Qe=u):Bt(t,e),en(e),s&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!d&&e.mode&1)for(q=e,d=e.child;d!==null;){for(p=q=d;q!==null;){switch(f=q,m=f.child,f.tag){case 0:case 11:case 14:case 15:Ni(4,f,f.return);break;case 1:pr(f,f.return);var v=f.stateNode;if(typeof v.componentWillUnmount=="function"){s=f,n=f.return;try{t=s,v.props=t.memoizedProps,v.state=t.memoizedState,v.componentWillUnmount()}catch(y){Ee(s,n,y)}}break;case 5:pr(f,f.return);break;case 22:if(f.memoizedState!==null){Np(p);continue}}m!==null?(m.return=f,q=m):Np(p)}d=d.sibling}e:for(d=null,p=e;;){if(p.tag===5){if(d===null){d=p;try{i=p.stateNode,u?(a=i.style,typeof a.setProperty=="function"?a.setProperty("display","none","important"):a.display="none"):(l=p.stateNode,c=p.memoizedProps.style,o=c!=null&&c.hasOwnProperty("display")?c.display:null,l.style.display=jg("display",o))}catch(y){Ee(e,e.return,y)}}}else if(p.tag===6){if(d===null)try{p.stateNode.nodeValue=u?"":p.memoizedProps}catch(y){Ee(e,e.return,y)}}else if((p.tag!==22&&p.tag!==23||p.memoizedState===null||p===e)&&p.child!==null){p.child.return=p,p=p.child;continue}if(p===e)break e;for(;p.sibling===null;){if(p.return===null||p.return===e)break e;d===p&&(d=null),p=p.return}d===p&&(d=null),p.sibling.return=p.return,p=p.sibling}}break;case 19:Bt(t,e),en(e),s&4&&kp(e);break;case 21:break;default:Bt(t,e),en(e)}}function en(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(Yx(n)){var s=n;break e}n=n.return}throw Error(F(160))}switch(s.tag){case 5:var i=s.stateNode;s.flags&32&&(Li(i,""),s.flags&=-33);var a=wp(e);Du(e,a,i);break;case 3:case 4:var o=s.stateNode.containerInfo,l=wp(e);Ou(e,l,o);break;default:throw Error(F(161))}}catch(c){Ee(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function C2(e,t,n){q=e,Jx(e)}function Jx(e,t,n){for(var s=(e.mode&1)!==0;q!==null;){var i=q,a=i.child;if(i.tag===22&&s){var o=i.memoizedState!==null||Ia;if(!o){var l=i.alternate,c=l!==null&&l.memoizedState!==null||Qe;l=Ia;var u=Qe;if(Ia=o,(Qe=c)&&!u)for(q=i;q!==null;)o=q,c=o.child,o.tag===22&&o.memoizedState!==null?Sp(i):c!==null?(c.return=o,q=c):Sp(i);for(;a!==null;)q=a,Jx(a),a=a.sibling;q=i,Ia=l,Qe=u}jp(e)}else i.subtreeFlags&8772&&a!==null?(a.return=i,q=a):jp(e)}}function jp(e){for(;q!==null;){var t=q;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Qe||ml(5,t);break;case 1:var s=t.stateNode;if(t.flags&4&&!Qe)if(n===null)s.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:$t(t.type,n.memoizedProps);s.componentDidUpdate(i,n.memoizedState,s.__reactInternalSnapshotBeforeUpdate)}var a=t.updateQueue;a!==null&&op(t,a,s);break;case 3:var o=t.updateQueue;if(o!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}op(t,o,n)}break;case 5:var l=t.stateNode;if(n===null&&t.flags&4){n=l;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&n.focus();break;case"img":c.src&&(n.src=c.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var d=u.memoizedState;if(d!==null){var p=d.dehydrated;p!==null&&Bi(p)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(F(163))}Qe||t.flags&512&&Lu(t)}catch(f){Ee(t,t.return,f)}}if(t===e){q=null;break}if(n=t.sibling,n!==null){n.return=t.return,q=n;break}q=t.return}}function Np(e){for(;q!==null;){var t=q;if(t===e){q=null;break}var n=t.sibling;if(n!==null){n.return=t.return,q=n;break}q=t.return}}function Sp(e){for(;q!==null;){var t=q;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{ml(4,t)}catch(c){Ee(t,n,c)}break;case 1:var s=t.stateNode;if(typeof s.componentDidMount=="function"){var i=t.return;try{s.componentDidMount()}catch(c){Ee(t,i,c)}}var a=t.return;try{Lu(t)}catch(c){Ee(t,a,c)}break;case 5:var o=t.return;try{Lu(t)}catch(c){Ee(t,o,c)}}}catch(c){Ee(t,t.return,c)}if(t===e){q=null;break}var l=t.sibling;if(l!==null){l.return=t.return,q=l;break}q=t.return}}var E2=Math.ceil,Wo=Tn.ReactCurrentDispatcher,rh=Tn.ReactCurrentOwner,At=Tn.ReactCurrentBatchConfig,ue=0,Fe=null,Me=null,He=0,mt=0,mr=cs(0),Oe=0,Xi=null,Rs=0,gl=0,ih=0,Si=null,ct=null,ah=0,Lr=1/0,gn=null,Ko=!1,Iu=null,Xn=null,Ba=!1,Un=null,Go=0,Ci=0,Bu=null,fo=-1,po=0;function st(){return ue&6?Pe():fo!==-1?fo:fo=Pe()}function Qn(e){return e.mode&1?ue&2&&He!==0?He&-He:u2.transition!==null?(po===0&&(po=Og()),po):(e=he,e!==0||(e=window.event,e=e===void 0?16:Ug(e.type)),e):1}function Gt(e,t,n,s){if(50<Ci)throw Ci=0,Bu=null,Error(F(185));da(e,n,s),(!(ue&2)||e!==Fe)&&(e===Fe&&(!(ue&2)&&(gl|=n),Oe===4&&Vn(e,He)),ft(e,s),n===1&&ue===0&&!(t.mode&1)&&(Lr=Pe()+500,hl&&us()))}function ft(e,t){var n=e.callbackNode;uw(e,t);var s=Po(e,e===Fe?He:0);if(s===0)n!==null&&zf(n),e.callbackNode=null,e.callbackPriority=0;else if(t=s&-s,e.callbackPriority!==t){if(n!=null&&zf(n),t===1)e.tag===0?c2(Cp.bind(null,e)):lx(Cp.bind(null,e)),i2(function(){!(ue&6)&&us()}),n=null;else{switch(Dg(s)){case 1:n=Md;break;case 4:n=zg;break;case 16:n=To;break;case 536870912:n=Lg;break;default:n=To}n=ay(n,Zx.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Zx(e,t){if(fo=-1,po=0,ue&6)throw Error(F(327));var n=e.callbackNode;if(Er()&&e.callbackNode!==n)return null;var s=Po(e,e===Fe?He:0);if(s===0)return null;if(s&30||s&e.expiredLanes||t)t=qo(e,s);else{t=s;var i=ue;ue|=2;var a=ty();(Fe!==e||He!==t)&&(gn=null,Lr=Pe()+500,Es(e,t));do try{P2();break}catch(l){ey(e,l)}while(!0);Wd(),Wo.current=a,ue=i,Me!==null?t=0:(Fe=null,He=0,t=Oe)}if(t!==0){if(t===2&&(i=hu(e),i!==0&&(s=i,t=Fu(e,i))),t===1)throw n=Xi,Es(e,0),Vn(e,s),ft(e,Pe()),n;if(t===6)Vn(e,s);else{if(i=e.current.alternate,!(s&30)&&!_2(i)&&(t=qo(e,s),t===2&&(a=hu(e),a!==0&&(s=a,t=Fu(e,a))),t===1))throw n=Xi,Es(e,0),Vn(e,s),ft(e,Pe()),n;switch(e.finishedWork=i,e.finishedLanes=s,t){case 0:case 1:throw Error(F(345));case 2:bs(e,ct,gn);break;case 3:if(Vn(e,s),(s&130023424)===s&&(t=ah+500-Pe(),10<t)){if(Po(e,0)!==0)break;if(i=e.suspendedLanes,(i&s)!==s){st(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=bu(bs.bind(null,e,ct,gn),t);break}bs(e,ct,gn);break;case 4:if(Vn(e,s),(s&4194240)===s)break;for(t=e.eventTimes,i=-1;0<s;){var o=31-Kt(s);a=1<<o,o=t[o],o>i&&(i=o),s&=~a}if(s=i,s=Pe()-s,s=(120>s?120:480>s?480:1080>s?1080:1920>s?1920:3e3>s?3e3:4320>s?4320:1960*E2(s/1960))-s,10<s){e.timeoutHandle=bu(bs.bind(null,e,ct,gn),s);break}bs(e,ct,gn);break;case 5:bs(e,ct,gn);break;default:throw Error(F(329))}}}return ft(e,Pe()),e.callbackNode===n?Zx.bind(null,e):null}function Fu(e,t){var n=Si;return e.current.memoizedState.isDehydrated&&(Es(e,t).flags|=256),e=qo(e,t),e!==2&&(t=ct,ct=n,t!==null&&Vu(t)),e}function Vu(e){ct===null?ct=e:ct.push.apply(ct,e)}function _2(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var s=0;s<n.length;s++){var i=n[s],a=i.getSnapshot;i=i.value;try{if(!qt(a(),i))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Vn(e,t){for(t&=~ih,t&=~gl,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Kt(t),s=1<<n;e[n]=-1,t&=~s}}function Cp(e){if(ue&6)throw Error(F(327));Er();var t=Po(e,0);if(!(t&1))return ft(e,Pe()),null;var n=qo(e,t);if(e.tag!==0&&n===2){var s=hu(e);s!==0&&(t=s,n=Fu(e,s))}if(n===1)throw n=Xi,Es(e,0),Vn(e,t),ft(e,Pe()),n;if(n===6)throw Error(F(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,bs(e,ct,gn),ft(e,Pe()),null}function oh(e,t){var n=ue;ue|=1;try{return e(t)}finally{ue=n,ue===0&&(Lr=Pe()+500,hl&&us())}}function zs(e){Un!==null&&Un.tag===0&&!(ue&6)&&Er();var t=ue;ue|=1;var n=At.transition,s=he;try{if(At.transition=null,he=1,e)return e()}finally{he=s,At.transition=n,ue=t,!(ue&6)&&us()}}function lh(){mt=mr.current,ye(mr)}function Es(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,r2(n)),Me!==null)for(n=Me.return;n!==null;){var s=n;switch($d(s),s.tag){case 1:s=s.type.childContextTypes,s!=null&&Lo();break;case 3:Rr(),ye(dt),ye(Ze),Qd();break;case 5:Xd(s);break;case 4:Rr();break;case 13:ye(ke);break;case 19:ye(ke);break;case 10:Kd(s.type._context);break;case 22:case 23:lh()}n=n.return}if(Fe=e,Me=e=Jn(e.current,null),He=mt=t,Oe=0,Xi=null,ih=gl=Rs=0,ct=Si=null,Ns!==null){for(t=0;t<Ns.length;t++)if(n=Ns[t],s=n.interleaved,s!==null){n.interleaved=null;var i=s.next,a=n.pending;if(a!==null){var o=a.next;a.next=i,s.next=o}n.pending=s}Ns=null}return e}function ey(e,t){do{var n=Me;try{if(Wd(),co.current=Ho,Uo){for(var s=Ne.memoizedState;s!==null;){var i=s.queue;i!==null&&(i.pending=null),s=s.next}Uo=!1}if(Ms=0,Be=Le=Ne=null,ji=!1,Gi=0,rh.current=null,n===null||n.return===null){Oe=1,Xi=t,Me=null;break}e:{var a=e,o=n.return,l=n,c=t;if(t=He,l.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var u=c,d=l,p=d.tag;if(!(d.mode&1)&&(p===0||p===11||p===15)){var f=d.alternate;f?(d.updateQueue=f.updateQueue,d.memoizedState=f.memoizedState,d.lanes=f.lanes):(d.updateQueue=null,d.memoizedState=null)}var m=fp(o);if(m!==null){m.flags&=-257,pp(m,o,l,a,t),m.mode&1&&hp(a,u,t),t=m,c=u;var v=t.updateQueue;if(v===null){var y=new Set;y.add(c),t.updateQueue=y}else v.add(c);break e}else{if(!(t&1)){hp(a,u,t),ch();break e}c=Error(F(426))}}else if(we&&l.mode&1){var b=fp(o);if(b!==null){!(b.flags&65536)&&(b.flags|=256),pp(b,o,l,a,t),Ud(zr(c,l));break e}}a=c=zr(c,l),Oe!==4&&(Oe=2),Si===null?Si=[a]:Si.push(a),a=o;do{switch(a.tag){case 3:a.flags|=65536,t&=-t,a.lanes|=t;var g=Dx(a,c,t);ap(a,g);break e;case 1:l=c;var x=a.type,w=a.stateNode;if(!(a.flags&128)&&(typeof x.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(Xn===null||!Xn.has(w)))){a.flags|=65536,t&=-t,a.lanes|=t;var j=Ix(a,l,t);ap(a,j);break e}}a=a.return}while(a!==null)}sy(n)}catch(k){t=k,Me===n&&n!==null&&(Me=n=n.return);continue}break}while(!0)}function ty(){var e=Wo.current;return Wo.current=Ho,e===null?Ho:e}function ch(){(Oe===0||Oe===3||Oe===2)&&(Oe=4),Fe===null||!(Rs&268435455)&&!(gl&268435455)||Vn(Fe,He)}function qo(e,t){var n=ue;ue|=2;var s=ty();(Fe!==e||He!==t)&&(gn=null,Es(e,t));do try{T2();break}catch(i){ey(e,i)}while(!0);if(Wd(),ue=n,Wo.current=s,Me!==null)throw Error(F(261));return Fe=null,He=0,Oe}function T2(){for(;Me!==null;)ny(Me)}function P2(){for(;Me!==null&&!tw();)ny(Me)}function ny(e){var t=iy(e.alternate,e,mt);e.memoizedProps=e.pendingProps,t===null?sy(e):Me=t,rh.current=null}function sy(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=j2(n,t),n!==null){n.flags&=32767,Me=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Oe=6,Me=null;return}}else if(n=k2(n,t,mt),n!==null){Me=n;return}if(t=t.sibling,t!==null){Me=t;return}Me=t=e}while(t!==null);Oe===0&&(Oe=5)}function bs(e,t,n){var s=he,i=At.transition;try{At.transition=null,he=1,A2(e,t,n,s)}finally{At.transition=i,he=s}return null}function A2(e,t,n,s){do Er();while(Un!==null);if(ue&6)throw Error(F(327));n=e.finishedWork;var i=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(F(177));e.callbackNode=null,e.callbackPriority=0;var a=n.lanes|n.childLanes;if(dw(e,a),e===Fe&&(Me=Fe=null,He=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Ba||(Ba=!0,ay(To,function(){return Er(),null})),a=(n.flags&15990)!==0,n.subtreeFlags&15990||a){a=At.transition,At.transition=null;var o=he;he=1;var l=ue;ue|=4,rh.current=null,S2(e,n),Qx(n,e),Qw(yu),Ao=!!xu,yu=xu=null,e.current=n,C2(n),nw(),ue=l,he=o,At.transition=a}else e.current=n;if(Ba&&(Ba=!1,Un=e,Go=i),a=e.pendingLanes,a===0&&(Xn=null),iw(n.stateNode),ft(e,Pe()),t!==null)for(s=e.onRecoverableError,n=0;n<t.length;n++)i=t[n],s(i.value,{componentStack:i.stack,digest:i.digest});if(Ko)throw Ko=!1,e=Iu,Iu=null,e;return Go&1&&e.tag!==0&&Er(),a=e.pendingLanes,a&1?e===Bu?Ci++:(Ci=0,Bu=e):Ci=0,us(),null}function Er(){if(Un!==null){var e=Dg(Go),t=At.transition,n=he;try{if(At.transition=null,he=16>e?16:e,Un===null)var s=!1;else{if(e=Un,Un=null,Go=0,ue&6)throw Error(F(331));var i=ue;for(ue|=4,q=e.current;q!==null;){var a=q,o=a.child;if(q.flags&16){var l=a.deletions;if(l!==null){for(var c=0;c<l.length;c++){var u=l[c];for(q=u;q!==null;){var d=q;switch(d.tag){case 0:case 11:case 15:Ni(8,d,a)}var p=d.child;if(p!==null)p.return=d,q=p;else for(;q!==null;){d=q;var f=d.sibling,m=d.return;if(qx(d),d===u){q=null;break}if(f!==null){f.return=m,q=f;break}q=m}}}var v=a.alternate;if(v!==null){var y=v.child;if(y!==null){v.child=null;do{var b=y.sibling;y.sibling=null,y=b}while(y!==null)}}q=a}}if(a.subtreeFlags&2064&&o!==null)o.return=a,q=o;else e:for(;q!==null;){if(a=q,a.flags&2048)switch(a.tag){case 0:case 11:case 15:Ni(9,a,a.return)}var g=a.sibling;if(g!==null){g.return=a.return,q=g;break e}q=a.return}}var x=e.current;for(q=x;q!==null;){o=q;var w=o.child;if(o.subtreeFlags&2064&&w!==null)w.return=o,q=w;else e:for(o=x;q!==null;){if(l=q,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:ml(9,l)}}catch(k){Ee(l,l.return,k)}if(l===o){q=null;break e}var j=l.sibling;if(j!==null){j.return=l.return,q=j;break e}q=l.return}}if(ue=i,us(),an&&typeof an.onPostCommitFiberRoot=="function")try{an.onPostCommitFiberRoot(ol,e)}catch{}s=!0}return s}finally{he=n,At.transition=t}}return!1}function Ep(e,t,n){t=zr(n,t),t=Dx(e,t,1),e=Yn(e,t,1),t=st(),e!==null&&(da(e,1,t),ft(e,t))}function Ee(e,t,n){if(e.tag===3)Ep(e,e,n);else for(;t!==null;){if(t.tag===3){Ep(t,e,n);break}else if(t.tag===1){var s=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(Xn===null||!Xn.has(s))){e=zr(n,e),e=Ix(t,e,1),t=Yn(t,e,1),e=st(),t!==null&&(da(t,1,e),ft(t,e));break}}t=t.return}}function M2(e,t,n){var s=e.pingCache;s!==null&&s.delete(t),t=st(),e.pingedLanes|=e.suspendedLanes&n,Fe===e&&(He&n)===n&&(Oe===4||Oe===3&&(He&130023424)===He&&500>Pe()-ah?Es(e,0):ih|=n),ft(e,t)}function ry(e,t){t===0&&(e.mode&1?(t=Ta,Ta<<=1,!(Ta&130023424)&&(Ta=4194304)):t=1);var n=st();e=Cn(e,t),e!==null&&(da(e,t,n),ft(e,n))}function R2(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),ry(e,n)}function z2(e,t){var n=0;switch(e.tag){case 13:var s=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:s=e.stateNode;break;default:throw Error(F(314))}s!==null&&s.delete(t),ry(e,n)}var iy;iy=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||dt.current)ut=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return ut=!1,w2(e,t,n);ut=!!(e.flags&131072)}else ut=!1,we&&t.flags&1048576&&cx(t,Io,t.index);switch(t.lanes=0,t.tag){case 2:var s=t.type;ho(e,t),e=t.pendingProps;var i=Pr(t,Ze.current);Cr(t,n),i=Zd(null,t,s,e,i,n);var a=eh();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,ht(s)?(a=!0,Oo(t)):a=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,qd(t),i.updater=pl,t.stateNode=i,i._reactInternals=t,Eu(t,s,e,n),t=Pu(null,t,s,!0,a,n)):(t.tag=0,we&&a&&Vd(t),nt(null,t,i,n),t=t.child),t;case 16:s=t.elementType;e:{switch(ho(e,t),e=t.pendingProps,i=s._init,s=i(s._payload),t.type=s,i=t.tag=O2(s),e=$t(s,e),i){case 0:t=Tu(null,t,s,e,n);break e;case 1:t=xp(null,t,s,e,n);break e;case 11:t=mp(null,t,s,e,n);break e;case 14:t=gp(null,t,s,$t(s.type,e),n);break e}throw Error(F(306,s,""))}return t;case 0:return s=t.type,i=t.pendingProps,i=t.elementType===s?i:$t(s,i),Tu(e,t,s,i,n);case 1:return s=t.type,i=t.pendingProps,i=t.elementType===s?i:$t(s,i),xp(e,t,s,i,n);case 3:e:{if($x(t),e===null)throw Error(F(387));s=t.pendingProps,a=t.memoizedState,i=a.element,mx(e,t),Vo(t,s,null,n);var o=t.memoizedState;if(s=o.element,a.isDehydrated)if(a={element:s,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){i=zr(Error(F(423)),t),t=yp(e,t,s,n,i);break e}else if(s!==i){i=zr(Error(F(424)),t),t=yp(e,t,s,n,i);break e}else for(gt=qn(t.stateNode.containerInfo.firstChild),xt=t,we=!0,Wt=null,n=fx(t,null,s,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Ar(),s===i){t=En(e,t,n);break e}nt(e,t,s,n)}t=t.child}return t;case 5:return gx(t),e===null&&Nu(t),s=t.type,i=t.pendingProps,a=e!==null?e.memoizedProps:null,o=i.children,vu(s,i)?o=null:a!==null&&vu(s,a)&&(t.flags|=32),Vx(e,t),nt(e,t,o,n),t.child;case 6:return e===null&&Nu(t),null;case 13:return Ux(e,t,n);case 4:return Yd(t,t.stateNode.containerInfo),s=t.pendingProps,e===null?t.child=Mr(t,null,s,n):nt(e,t,s,n),t.child;case 11:return s=t.type,i=t.pendingProps,i=t.elementType===s?i:$t(s,i),mp(e,t,s,i,n);case 7:return nt(e,t,t.pendingProps,n),t.child;case 8:return nt(e,t,t.pendingProps.children,n),t.child;case 12:return nt(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(s=t.type._context,i=t.pendingProps,a=t.memoizedProps,o=i.value,me(Bo,s._currentValue),s._currentValue=o,a!==null)if(qt(a.value,o)){if(a.children===i.children&&!dt.current){t=En(e,t,n);break e}}else for(a=t.child,a!==null&&(a.return=t);a!==null;){var l=a.dependencies;if(l!==null){o=a.child;for(var c=l.firstContext;c!==null;){if(c.context===s){if(a.tag===1){c=wn(-1,n&-n),c.tag=2;var u=a.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?c.next=c:(c.next=d.next,d.next=c),u.pending=c}}a.lanes|=n,c=a.alternate,c!==null&&(c.lanes|=n),Su(a.return,n,t),l.lanes|=n;break}c=c.next}}else if(a.tag===10)o=a.type===t.type?null:a.child;else if(a.tag===18){if(o=a.return,o===null)throw Error(F(341));o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),Su(o,n,t),o=a.sibling}else o=a.child;if(o!==null)o.return=a;else for(o=a;o!==null;){if(o===t){o=null;break}if(a=o.sibling,a!==null){a.return=o.return,o=a;break}o=o.return}a=o}nt(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,s=t.pendingProps.children,Cr(t,n),i=Mt(i),s=s(i),t.flags|=1,nt(e,t,s,n),t.child;case 14:return s=t.type,i=$t(s,t.pendingProps),i=$t(s.type,i),gp(e,t,s,i,n);case 15:return Bx(e,t,t.type,t.pendingProps,n);case 17:return s=t.type,i=t.pendingProps,i=t.elementType===s?i:$t(s,i),ho(e,t),t.tag=1,ht(s)?(e=!0,Oo(t)):e=!1,Cr(t,n),Ox(t,s,i),Eu(t,s,i,n),Pu(null,t,s,!0,e,n);case 19:return Hx(e,t,n);case 22:return Fx(e,t,n)}throw Error(F(156,t.tag))};function ay(e,t){return Rg(e,t)}function L2(e,t,n,s){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Tt(e,t,n,s){return new L2(e,t,n,s)}function uh(e){return e=e.prototype,!(!e||!e.isReactComponent)}function O2(e){if(typeof e=="function")return uh(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Td)return 11;if(e===Pd)return 14}return 2}function Jn(e,t){var n=e.alternate;return n===null?(n=Tt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function mo(e,t,n,s,i,a){var o=2;if(s=e,typeof e=="function")uh(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case ir:return _s(n.children,i,a,t);case _d:o=8,i|=8;break;case Qc:return e=Tt(12,n,t,i|2),e.elementType=Qc,e.lanes=a,e;case Jc:return e=Tt(13,n,t,i),e.elementType=Jc,e.lanes=a,e;case Zc:return e=Tt(19,n,t,i),e.elementType=Zc,e.lanes=a,e;case gg:return xl(n,i,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case pg:o=10;break e;case mg:o=9;break e;case Td:o=11;break e;case Pd:o=14;break e;case In:o=16,s=null;break e}throw Error(F(130,e==null?e:typeof e,""))}return t=Tt(o,n,t,i),t.elementType=e,t.type=s,t.lanes=a,t}function _s(e,t,n,s){return e=Tt(7,e,s,t),e.lanes=n,e}function xl(e,t,n,s){return e=Tt(22,e,s,t),e.elementType=gg,e.lanes=n,e.stateNode={isHidden:!1},e}function mc(e,t,n){return e=Tt(6,e,null,t),e.lanes=n,e}function gc(e,t,n){return t=Tt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function D2(e,t,n,s,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Xl(0),this.expirationTimes=Xl(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Xl(0),this.identifierPrefix=s,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function dh(e,t,n,s,i,a,o,l,c){return e=new D2(e,t,n,l,c),t===1?(t=1,a===!0&&(t|=8)):t=0,a=Tt(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:s,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},qd(a),e}function I2(e,t,n){var s=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:rr,key:s==null?null:""+s,children:e,containerInfo:t,implementation:n}}function oy(e){if(!e)return ss;e=e._reactInternals;e:{if(Fs(e)!==e||e.tag!==1)throw Error(F(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(ht(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(F(171))}if(e.tag===1){var n=e.type;if(ht(n))return ox(e,n,t)}return t}function ly(e,t,n,s,i,a,o,l,c){return e=dh(n,s,!0,e,i,a,o,l,c),e.context=oy(null),n=e.current,s=st(),i=Qn(n),a=wn(s,i),a.callback=t??null,Yn(n,a,i),e.current.lanes=i,da(e,i,s),ft(e,s),e}function yl(e,t,n,s){var i=t.current,a=st(),o=Qn(i);return n=oy(n),t.context===null?t.context=n:t.pendingContext=n,t=wn(a,o),t.payload={element:e},s=s===void 0?null:s,s!==null&&(t.callback=s),e=Yn(i,t,o),e!==null&&(Gt(e,i,o,a),lo(e,i,o)),o}function Yo(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function _p(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function hh(e,t){_p(e,t),(e=e.alternate)&&_p(e,t)}function B2(){return null}var cy=typeof reportError=="function"?reportError:function(e){console.error(e)};function fh(e){this._internalRoot=e}vl.prototype.render=fh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(F(409));yl(e,t,null,null)};vl.prototype.unmount=fh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;zs(function(){yl(null,e,null,null)}),t[Sn]=null}};function vl(e){this._internalRoot=e}vl.prototype.unstable_scheduleHydration=function(e){if(e){var t=Fg();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Fn.length&&t!==0&&t<Fn[n].priority;n++);Fn.splice(n,0,e),n===0&&$g(e)}};function ph(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function bl(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Tp(){}function F2(e,t,n,s,i){if(i){if(typeof s=="function"){var a=s;s=function(){var u=Yo(o);a.call(u)}}var o=ly(t,s,e,0,null,!1,!1,"",Tp);return e._reactRootContainer=o,e[Sn]=o.current,$i(e.nodeType===8?e.parentNode:e),zs(),o}for(;i=e.lastChild;)e.removeChild(i);if(typeof s=="function"){var l=s;s=function(){var u=Yo(c);l.call(u)}}var c=dh(e,0,!1,null,null,!1,!1,"",Tp);return e._reactRootContainer=c,e[Sn]=c.current,$i(e.nodeType===8?e.parentNode:e),zs(function(){yl(t,c,n,s)}),c}function wl(e,t,n,s,i){var a=n._reactRootContainer;if(a){var o=a;if(typeof i=="function"){var l=i;i=function(){var c=Yo(o);l.call(c)}}yl(t,o,e,i)}else o=F2(n,t,e,i,s);return Yo(o)}Ig=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=di(t.pendingLanes);n!==0&&(Rd(t,n|1),ft(t,Pe()),!(ue&6)&&(Lr=Pe()+500,us()))}break;case 13:zs(function(){var s=Cn(e,1);if(s!==null){var i=st();Gt(s,e,1,i)}}),hh(e,1)}};zd=function(e){if(e.tag===13){var t=Cn(e,134217728);if(t!==null){var n=st();Gt(t,e,134217728,n)}hh(e,134217728)}};Bg=function(e){if(e.tag===13){var t=Qn(e),n=Cn(e,t);if(n!==null){var s=st();Gt(n,e,t,s)}hh(e,t)}};Fg=function(){return he};Vg=function(e,t){var n=he;try{return he=e,t()}finally{he=n}};cu=function(e,t,n){switch(t){case"input":if(nu(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var s=n[t];if(s!==e&&s.form===e.form){var i=dl(s);if(!i)throw Error(F(90));yg(s),nu(s,i)}}}break;case"textarea":bg(e,n);break;case"select":t=n.value,t!=null&&kr(e,!!n.multiple,t,!1)}};Eg=oh;_g=zs;var V2={usingClientEntryPoint:!1,Events:[fa,cr,dl,Sg,Cg,oh]},ii={findFiberByHostInstance:js,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},$2={bundleType:ii.bundleType,version:ii.version,rendererPackageName:ii.rendererPackageName,rendererConfig:ii.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Tn.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Ag(e),e===null?null:e.stateNode},findFiberByHostInstance:ii.findFiberByHostInstance||B2,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Fa=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Fa.isDisabled&&Fa.supportsFiber)try{ol=Fa.inject($2),an=Fa}catch{}}kt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=V2;kt.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!ph(t))throw Error(F(200));return I2(e,t,null,n)};kt.createRoot=function(e,t){if(!ph(e))throw Error(F(299));var n=!1,s="",i=cy;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=dh(e,1,!1,null,null,n,!1,s,i),e[Sn]=t.current,$i(e.nodeType===8?e.parentNode:e),new fh(t)};kt.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(F(188)):(e=Object.keys(e).join(","),Error(F(268,e)));return e=Ag(t),e=e===null?null:e.stateNode,e};kt.flushSync=function(e){return zs(e)};kt.hydrate=function(e,t,n){if(!bl(t))throw Error(F(200));return wl(null,e,t,!0,n)};kt.hydrateRoot=function(e,t,n){if(!ph(e))throw Error(F(405));var s=n!=null&&n.hydratedSources||null,i=!1,a="",o=cy;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(a=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),t=ly(t,null,e,1,n??null,i,!1,a,o),e[Sn]=t.current,$i(e),s)for(e=0;e<s.length;e++)n=s[e],i=n._getVersion,i=i(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,i]:t.mutableSourceEagerHydrationData.push(n,i);return new vl(t)};kt.render=function(e,t,n){if(!bl(t))throw Error(F(200));return wl(null,e,t,!1,n)};kt.unmountComponentAtNode=function(e){if(!bl(e))throw Error(F(40));return e._reactRootContainer?(zs(function(){wl(null,null,e,!1,function(){e._reactRootContainer=null,e[Sn]=null})}),!0):!1};kt.unstable_batchedUpdates=oh;kt.unstable_renderSubtreeIntoContainer=function(e,t,n,s){if(!bl(n))throw Error(F(200));if(e==null||e._reactInternals===void 0)throw Error(F(38));return wl(e,t,n,!1,s)};kt.version="18.3.1-next-f1338f8080-20240426";function uy(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(uy)}catch(e){console.error(e)}}uy(),ug.exports=kt;var mh=ug.exports;const dy=J0(mh);var hy,Pp=mh;hy=Pp.createRoot,Pp.hydrateRoot;/**
41
41
  * @remix-run/router v1.23.2
42
42
  *
43
43
  * Copyright (c) Remix Software Inc.
@@ -46,7 +46,7 @@ Error generating stack: `+a.message+`
46
46
  * LICENSE.md file in the root directory of this source tree.
47
47
  *
48
48
  * @license MIT
49
- */function Qi(){return Qi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},Qi.apply(this,arguments)}var Hn;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Hn||(Hn={}));const Mp="popstate";function U2(e){e===void 0&&(e={});function t(s,i){let{pathname:a,search:o,hash:l}=s.location;return $u("",{pathname:a,search:o,hash:l},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function n(s,i){return typeof i=="string"?i:Xo(i)}return W2(t,n,null,e)}function Me(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function gh(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function H2(){return Math.random().toString(36).substr(2,8)}function Ap(e,t){return{usr:e.state,key:e.key,idx:t}}function $u(e,t,n,s){return n===void 0&&(n=null),Qi({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?$r(t):t,{state:n,key:t&&t.key||s||H2()})}function Xo(e){let{pathname:t="/",search:n="",hash:s=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),s&&s!=="#"&&(t+=s.charAt(0)==="#"?s:"#"+s),t}function $r(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let s=e.indexOf("?");s>=0&&(t.search=e.substr(s),e=e.substr(0,s)),e&&(t.pathname=e)}return t}function W2(e,t,n,s){s===void 0&&(s={});let{window:i=document.defaultView,v5Compat:a=!1}=s,o=i.history,l=Hn.Pop,c=null,u=d();u==null&&(u=0,o.replaceState(Qi({},o.state,{idx:u}),""));function d(){return(o.state||{idx:null}).idx}function p(){l=Hn.Pop;let v=d(),g=v==null?null:v-u;u=v,c&&c({action:l,location:y.location,delta:g})}function f(v,g){l=Hn.Push;let x=$u(y.location,v,g);u=d()+1;let w=Ap(x,u),j=y.createHref(x);try{o.pushState(w,"",j)}catch(k){if(k instanceof DOMException&&k.name==="DataCloneError")throw k;i.location.assign(j)}a&&c&&c({action:l,location:y.location,delta:1})}function m(v,g){l=Hn.Replace;let x=$u(y.location,v,g);u=d();let w=Ap(x,u),j=y.createHref(x);o.replaceState(w,"",j),a&&c&&c({action:l,location:y.location,delta:0})}function b(v){let g=i.location.origin!=="null"?i.location.origin:i.location.href,x=typeof v=="string"?v:Xo(v);return x=x.replace(/ $/,"%20"),Me(g,"No window.location.(origin|href) available to create URL for href: "+x),new URL(x,g)}let y={get action(){return l},get location(){return e(i,o)},listen(v){if(c)throw new Error("A history only accepts one active listener");return i.addEventListener(Mp,p),c=v,()=>{i.removeEventListener(Mp,p),c=null}},createHref(v){return t(i,v)},createURL:b,encodeLocation(v){let g=b(v);return{pathname:g.pathname,search:g.search,hash:g.hash}},push:f,replace:m,go(v){return o.go(v)}};return y}var Rp;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Rp||(Rp={}));function K2(e,t,n){return n===void 0&&(n="/"),G2(e,t,n)}function G2(e,t,n,s){let i=typeof t=="string"?$r(t):t,a=xh(i.pathname||"/",n);if(a==null)return null;let o=fy(e);q2(o);let l=null;for(let c=0;l==null&&c<o.length;++c){let u=ak(a);l=sk(o[c],u)}return l}function fy(e,t,n,s){t===void 0&&(t=[]),n===void 0&&(n=[]),s===void 0&&(s="");let i=(a,o,l)=>{let c={relativePath:l===void 0?a.path||"":l,caseSensitive:a.caseSensitive===!0,childrenIndex:o,route:a};c.relativePath.startsWith("/")&&(Me(c.relativePath.startsWith(s),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+s+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(s.length));let u=Zn([s,c.relativePath]),d=n.concat(c);a.children&&a.children.length>0&&(Me(a.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),fy(a.children,t,d,u)),!(a.path==null&&!a.index)&&t.push({path:u,score:tk(u,a.index),routesMeta:d})};return e.forEach((a,o)=>{var l;if(a.path===""||!((l=a.path)!=null&&l.includes("?")))i(a,o);else for(let c of py(a.path))i(a,o,c)}),t}function py(e){let t=e.split("/");if(t.length===0)return[];let[n,...s]=t,i=n.endsWith("?"),a=n.replace(/\?$/,"");if(s.length===0)return i?[a,""]:[a];let o=py(s.join("/")),l=[];return l.push(...o.map(c=>c===""?a:[a,c].join("/"))),i&&l.push(...o),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function q2(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:nk(t.routesMeta.map(s=>s.childrenIndex),n.routesMeta.map(s=>s.childrenIndex)))}const Y2=/^:[\w-]+$/,X2=3,Q2=2,J2=1,Z2=10,ek=-2,zp=e=>e==="*";function tk(e,t){let n=e.split("/"),s=n.length;return n.some(zp)&&(s+=ek),t&&(s+=Q2),n.filter(i=>!zp(i)).reduce((i,a)=>i+(Y2.test(a)?X2:a===""?J2:Z2),s)}function nk(e,t){return e.length===t.length&&e.slice(0,-1).every((s,i)=>s===t[i])?e[e.length-1]-t[t.length-1]:0}function sk(e,t,n){let{routesMeta:s}=e,i={},a="/",o=[];for(let l=0;l<s.length;++l){let c=s[l],u=l===s.length-1,d=a==="/"?t:t.slice(a.length)||"/",p=rk({path:c.relativePath,caseSensitive:c.caseSensitive,end:u},d),f=c.route;if(!p)return null;Object.assign(i,p.params),o.push({params:i,pathname:Zn([a,p.pathname]),pathnameBase:dk(Zn([a,p.pathnameBase])),route:f}),p.pathnameBase!=="/"&&(a=Zn([a,p.pathnameBase]))}return o}function rk(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,s]=ik(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,"$1"),l=i.slice(1);return{params:s.reduce((u,d,p)=>{let{paramName:f,isOptional:m}=d;if(f==="*"){let y=l[p]||"";o=a.slice(0,a.length-y.length).replace(/(.)\/+$/,"$1")}const b=l[p];return m&&!b?u[f]=void 0:u[f]=(b||"").replace(/%2F/g,"/"),u},{}),pathname:a,pathnameBase:o,pattern:e}}function ik(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),gh(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let s=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,l,c)=>(s.push({paramName:l,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(s.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),s]}function ak(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return gh(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function xh(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,s=e.charAt(n);return s&&s!=="/"?null:e.slice(n)||"/"}const ok=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,lk=e=>ok.test(e);function ck(e,t){t===void 0&&(t="/");let{pathname:n,search:s="",hash:i=""}=typeof e=="string"?$r(e):e,a;if(n)if(lk(n))a=n;else{if(n.includes("//")){let o=n;n=n.replace(/\/\/+/g,"/"),gh(!1,"Pathnames cannot have embedded double slashes - normalizing "+(o+" -> "+n))}n.startsWith("/")?a=Lp(n.substring(1),"/"):a=Lp(n,t)}else a=t;return{pathname:a,search:hk(s),hash:fk(i)}}function Lp(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function xc(e,t,n,s){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(s)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function uk(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function yh(e,t){let n=uk(e);return t?n.map((s,i)=>i===n.length-1?s.pathname:s.pathnameBase):n.map(s=>s.pathnameBase)}function vh(e,t,n,s){s===void 0&&(s=!1);let i;typeof e=="string"?i=$r(e):(i=Qi({},e),Me(!i.pathname||!i.pathname.includes("?"),xc("?","pathname","search",i)),Me(!i.pathname||!i.pathname.includes("#"),xc("#","pathname","hash",i)),Me(!i.search||!i.search.includes("#"),xc("#","search","hash",i)));let a=e===""||i.pathname==="",o=a?"/":i.pathname,l;if(o==null)l=n;else{let p=t.length-1;if(!s&&o.startsWith("..")){let f=o.split("/");for(;f[0]==="..";)f.shift(),p-=1;i.pathname=f.join("/")}l=p>=0?t[p]:"/"}let c=ck(i,l),u=o&&o!=="/"&&o.endsWith("/"),d=(a||o===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(u||d)&&(c.pathname+="/"),c}const Zn=e=>e.join("/").replace(/\/\/+/g,"/"),dk=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),hk=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,fk=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function pk(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const my=["post","put","patch","delete"];new Set(my);const mk=["get",...my];new Set(mk);/**
49
+ */function Qi(){return Qi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},Qi.apply(this,arguments)}var Hn;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Hn||(Hn={}));const Ap="popstate";function U2(e){e===void 0&&(e={});function t(s,i){let{pathname:a,search:o,hash:l}=s.location;return $u("",{pathname:a,search:o,hash:l},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function n(s,i){return typeof i=="string"?i:Xo(i)}return W2(t,n,null,e)}function Ae(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function gh(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function H2(){return Math.random().toString(36).substr(2,8)}function Mp(e,t){return{usr:e.state,key:e.key,idx:t}}function $u(e,t,n,s){return n===void 0&&(n=null),Qi({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Ur(t):t,{state:n,key:t&&t.key||s||H2()})}function Xo(e){let{pathname:t="/",search:n="",hash:s=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),s&&s!=="#"&&(t+=s.charAt(0)==="#"?s:"#"+s),t}function Ur(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let s=e.indexOf("?");s>=0&&(t.search=e.substr(s),e=e.substr(0,s)),e&&(t.pathname=e)}return t}function W2(e,t,n,s){s===void 0&&(s={});let{window:i=document.defaultView,v5Compat:a=!1}=s,o=i.history,l=Hn.Pop,c=null,u=d();u==null&&(u=0,o.replaceState(Qi({},o.state,{idx:u}),""));function d(){return(o.state||{idx:null}).idx}function p(){l=Hn.Pop;let b=d(),g=b==null?null:b-u;u=b,c&&c({action:l,location:y.location,delta:g})}function f(b,g){l=Hn.Push;let x=$u(y.location,b,g);u=d()+1;let w=Mp(x,u),j=y.createHref(x);try{o.pushState(w,"",j)}catch(k){if(k instanceof DOMException&&k.name==="DataCloneError")throw k;i.location.assign(j)}a&&c&&c({action:l,location:y.location,delta:1})}function m(b,g){l=Hn.Replace;let x=$u(y.location,b,g);u=d();let w=Mp(x,u),j=y.createHref(x);o.replaceState(w,"",j),a&&c&&c({action:l,location:y.location,delta:0})}function v(b){let g=i.location.origin!=="null"?i.location.origin:i.location.href,x=typeof b=="string"?b:Xo(b);return x=x.replace(/ $/,"%20"),Ae(g,"No window.location.(origin|href) available to create URL for href: "+x),new URL(x,g)}let y={get action(){return l},get location(){return e(i,o)},listen(b){if(c)throw new Error("A history only accepts one active listener");return i.addEventListener(Ap,p),c=b,()=>{i.removeEventListener(Ap,p),c=null}},createHref(b){return t(i,b)},createURL:v,encodeLocation(b){let g=v(b);return{pathname:g.pathname,search:g.search,hash:g.hash}},push:f,replace:m,go(b){return o.go(b)}};return y}var Rp;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Rp||(Rp={}));function K2(e,t,n){return n===void 0&&(n="/"),G2(e,t,n)}function G2(e,t,n,s){let i=typeof t=="string"?Ur(t):t,a=xh(i.pathname||"/",n);if(a==null)return null;let o=fy(e);q2(o);let l=null;for(let c=0;l==null&&c<o.length;++c){let u=ak(a);l=sk(o[c],u)}return l}function fy(e,t,n,s){t===void 0&&(t=[]),n===void 0&&(n=[]),s===void 0&&(s="");let i=(a,o,l)=>{let c={relativePath:l===void 0?a.path||"":l,caseSensitive:a.caseSensitive===!0,childrenIndex:o,route:a};c.relativePath.startsWith("/")&&(Ae(c.relativePath.startsWith(s),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+s+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(s.length));let u=Zn([s,c.relativePath]),d=n.concat(c);a.children&&a.children.length>0&&(Ae(a.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),fy(a.children,t,d,u)),!(a.path==null&&!a.index)&&t.push({path:u,score:tk(u,a.index),routesMeta:d})};return e.forEach((a,o)=>{var l;if(a.path===""||!((l=a.path)!=null&&l.includes("?")))i(a,o);else for(let c of py(a.path))i(a,o,c)}),t}function py(e){let t=e.split("/");if(t.length===0)return[];let[n,...s]=t,i=n.endsWith("?"),a=n.replace(/\?$/,"");if(s.length===0)return i?[a,""]:[a];let o=py(s.join("/")),l=[];return l.push(...o.map(c=>c===""?a:[a,c].join("/"))),i&&l.push(...o),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function q2(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:nk(t.routesMeta.map(s=>s.childrenIndex),n.routesMeta.map(s=>s.childrenIndex)))}const Y2=/^:[\w-]+$/,X2=3,Q2=2,J2=1,Z2=10,ek=-2,zp=e=>e==="*";function tk(e,t){let n=e.split("/"),s=n.length;return n.some(zp)&&(s+=ek),t&&(s+=Q2),n.filter(i=>!zp(i)).reduce((i,a)=>i+(Y2.test(a)?X2:a===""?J2:Z2),s)}function nk(e,t){return e.length===t.length&&e.slice(0,-1).every((s,i)=>s===t[i])?e[e.length-1]-t[t.length-1]:0}function sk(e,t,n){let{routesMeta:s}=e,i={},a="/",o=[];for(let l=0;l<s.length;++l){let c=s[l],u=l===s.length-1,d=a==="/"?t:t.slice(a.length)||"/",p=rk({path:c.relativePath,caseSensitive:c.caseSensitive,end:u},d),f=c.route;if(!p)return null;Object.assign(i,p.params),o.push({params:i,pathname:Zn([a,p.pathname]),pathnameBase:dk(Zn([a,p.pathnameBase])),route:f}),p.pathnameBase!=="/"&&(a=Zn([a,p.pathnameBase]))}return o}function rk(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,s]=ik(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,"$1"),l=i.slice(1);return{params:s.reduce((u,d,p)=>{let{paramName:f,isOptional:m}=d;if(f==="*"){let y=l[p]||"";o=a.slice(0,a.length-y.length).replace(/(.)\/+$/,"$1")}const v=l[p];return m&&!v?u[f]=void 0:u[f]=(v||"").replace(/%2F/g,"/"),u},{}),pathname:a,pathnameBase:o,pattern:e}}function ik(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),gh(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let s=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,l,c)=>(s.push({paramName:l,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(s.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),s]}function ak(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return gh(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function xh(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,s=e.charAt(n);return s&&s!=="/"?null:e.slice(n)||"/"}const ok=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,lk=e=>ok.test(e);function ck(e,t){t===void 0&&(t="/");let{pathname:n,search:s="",hash:i=""}=typeof e=="string"?Ur(e):e,a;if(n)if(lk(n))a=n;else{if(n.includes("//")){let o=n;n=n.replace(/\/\/+/g,"/"),gh(!1,"Pathnames cannot have embedded double slashes - normalizing "+(o+" -> "+n))}n.startsWith("/")?a=Lp(n.substring(1),"/"):a=Lp(n,t)}else a=t;return{pathname:a,search:hk(s),hash:fk(i)}}function Lp(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function xc(e,t,n,s){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(s)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function uk(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function yh(e,t){let n=uk(e);return t?n.map((s,i)=>i===n.length-1?s.pathname:s.pathnameBase):n.map(s=>s.pathnameBase)}function vh(e,t,n,s){s===void 0&&(s=!1);let i;typeof e=="string"?i=Ur(e):(i=Qi({},e),Ae(!i.pathname||!i.pathname.includes("?"),xc("?","pathname","search",i)),Ae(!i.pathname||!i.pathname.includes("#"),xc("#","pathname","hash",i)),Ae(!i.search||!i.search.includes("#"),xc("#","search","hash",i)));let a=e===""||i.pathname==="",o=a?"/":i.pathname,l;if(o==null)l=n;else{let p=t.length-1;if(!s&&o.startsWith("..")){let f=o.split("/");for(;f[0]==="..";)f.shift(),p-=1;i.pathname=f.join("/")}l=p>=0?t[p]:"/"}let c=ck(i,l),u=o&&o!=="/"&&o.endsWith("/"),d=(a||o===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(u||d)&&(c.pathname+="/"),c}const Zn=e=>e.join("/").replace(/\/\/+/g,"/"),dk=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),hk=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,fk=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function pk(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const my=["post","put","patch","delete"];new Set(my);const mk=["get",...my];new Set(mk);/**
50
50
  * React Router v6.30.3
51
51
  *
52
52
  * Copyright (c) Remix Software Inc.
@@ -55,7 +55,7 @@ Error generating stack: `+a.message+`
55
55
  * LICENSE.md file in the root directory of this source tree.
56
56
  *
57
57
  * @license MIT
58
- */function Ji(){return Ji=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},Ji.apply(this,arguments)}const bh=h.createContext(null),gk=h.createContext(null),ds=h.createContext(null),kl=h.createContext(null),Pn=h.createContext({outlet:null,matches:[],isDataRoute:!1}),gy=h.createContext(null);function xk(e,t){let{relative:n}=t===void 0?{}:t;Ur()||Me(!1);let{basename:s,navigator:i}=h.useContext(ds),{hash:a,pathname:o,search:l}=yy(e,{relative:n}),c=o;return s!=="/"&&(c=o==="/"?s:Zn([s,o])),i.createHref({pathname:c,search:l,hash:a})}function Ur(){return h.useContext(kl)!=null}function hs(){return Ur()||Me(!1),h.useContext(kl).location}function xy(e){h.useContext(ds).static||h.useLayoutEffect(e)}function mn(){let{isDataRoute:e}=h.useContext(Pn);return e?Ak():yk()}function yk(){Ur()||Me(!1);let e=h.useContext(bh),{basename:t,future:n,navigator:s}=h.useContext(ds),{matches:i}=h.useContext(Pn),{pathname:a}=hs(),o=JSON.stringify(yh(i,n.v7_relativeSplatPath)),l=h.useRef(!1);return xy(()=>{l.current=!0}),h.useCallback(function(u,d){if(d===void 0&&(d={}),!l.current)return;if(typeof u=="number"){s.go(u);return}let p=vh(u,JSON.parse(o),a,d.relative==="path");e==null&&t!=="/"&&(p.pathname=p.pathname==="/"?t:Zn([t,p.pathname])),(d.replace?s.replace:s.push)(p,d.state,d)},[t,s,o,a,e])}const vk=h.createContext(null);function bk(e){let t=h.useContext(Pn).outlet;return t&&h.createElement(vk.Provider,{value:e},t)}function yy(e,t){let{relative:n}=t===void 0?{}:t,{future:s}=h.useContext(ds),{matches:i}=h.useContext(Pn),{pathname:a}=hs(),o=JSON.stringify(yh(i,s.v7_relativeSplatPath));return h.useMemo(()=>vh(e,JSON.parse(o),a,n==="path"),[e,o,a,n])}function wk(e,t){return kk(e,t)}function kk(e,t,n,s){Ur()||Me(!1);let{navigator:i}=h.useContext(ds),{matches:a}=h.useContext(Pn),o=a[a.length-1],l=o?o.params:{};o&&o.pathname;let c=o?o.pathnameBase:"/";o&&o.route;let u=hs(),d;if(t){var p;let v=typeof t=="string"?$r(t):t;c==="/"||(p=v.pathname)!=null&&p.startsWith(c)||Me(!1),d=v}else d=u;let f=d.pathname||"/",m=f;if(c!=="/"){let v=c.replace(/^\//,"").split("/");m="/"+f.replace(/^\//,"").split("/").slice(v.length).join("/")}let b=K2(e,{pathname:m}),y=Ek(b&&b.map(v=>Object.assign({},v,{params:Object.assign({},l,v.params),pathname:Zn([c,i.encodeLocation?i.encodeLocation(v.pathname).pathname:v.pathname]),pathnameBase:v.pathnameBase==="/"?c:Zn([c,i.encodeLocation?i.encodeLocation(v.pathnameBase).pathname:v.pathnameBase])})),a,n,s);return t&&y?h.createElement(kl.Provider,{value:{location:Ji({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:Hn.Pop}},y):y}function jk(){let e=Mk(),t=pk(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return h.createElement(h.Fragment,null,h.createElement("h2",null,"Unexpected Application Error!"),h.createElement("h3",{style:{fontStyle:"italic"}},t),n?h.createElement("pre",{style:i},n):null,null)}const Nk=h.createElement(jk,null);class Sk extends h.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?h.createElement(Pn.Provider,{value:this.props.routeContext},h.createElement(gy.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Ck(e){let{routeContext:t,match:n,children:s}=e,i=h.useContext(bh);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),h.createElement(Pn.Provider,{value:t},s)}function Ek(e,t,n,s){var i;if(t===void 0&&(t=[]),n===void 0&&(n=null),s===void 0&&(s=null),e==null){var a;if(!n)return null;if(n.errors)e=n.matches;else if((a=s)!=null&&a.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,l=(i=n)==null?void 0:i.errors;if(l!=null){let d=o.findIndex(p=>p.route.id&&(l==null?void 0:l[p.route.id])!==void 0);d>=0||Me(!1),o=o.slice(0,Math.min(o.length,d+1))}let c=!1,u=-1;if(n&&s&&s.v7_partialHydration)for(let d=0;d<o.length;d++){let p=o[d];if((p.route.HydrateFallback||p.route.hydrateFallbackElement)&&(u=d),p.route.id){let{loaderData:f,errors:m}=n,b=p.route.loader&&f[p.route.id]===void 0&&(!m||m[p.route.id]===void 0);if(p.route.lazy||b){c=!0,u>=0?o=o.slice(0,u+1):o=[o[0]];break}}}return o.reduceRight((d,p,f)=>{let m,b=!1,y=null,v=null;n&&(m=l&&p.route.id?l[p.route.id]:void 0,y=p.route.errorElement||Nk,c&&(u<0&&f===0?(Rk("route-fallback"),b=!0,v=null):u===f&&(b=!0,v=p.route.hydrateFallbackElement||null)));let g=t.concat(o.slice(0,f+1)),x=()=>{let w;return m?w=y:b?w=v:p.route.Component?w=h.createElement(p.route.Component,null):p.route.element?w=p.route.element:w=d,h.createElement(Ck,{match:p,routeContext:{outlet:d,matches:g,isDataRoute:n!=null},children:w})};return n&&(p.route.ErrorBoundary||p.route.errorElement||f===0)?h.createElement(Sk,{location:n.location,revalidation:n.revalidation,component:y,error:m,children:x(),routeContext:{outlet:null,matches:g,isDataRoute:!0}}):x()},null)}var vy=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(vy||{}),by=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(by||{});function _k(e){let t=h.useContext(bh);return t||Me(!1),t}function Tk(e){let t=h.useContext(gk);return t||Me(!1),t}function Pk(e){let t=h.useContext(Pn);return t||Me(!1),t}function wy(e){let t=Pk(),n=t.matches[t.matches.length-1];return n.route.id||Me(!1),n.route.id}function Mk(){var e;let t=h.useContext(gy),n=Tk(),s=wy();return t!==void 0?t:(e=n.errors)==null?void 0:e[s]}function Ak(){let{router:e}=_k(vy.UseNavigateStable),t=wy(by.UseNavigateStable),n=h.useRef(!1);return xy(()=>{n.current=!0}),h.useCallback(function(i,a){a===void 0&&(a={}),n.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,Ji({fromRouteId:t},a)))},[e,t])}const Op={};function Rk(e,t,n){Op[e]||(Op[e]=!0)}function zk(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function Dp(e){let{to:t,replace:n,state:s,relative:i}=e;Ur()||Me(!1);let{future:a,static:o}=h.useContext(ds),{matches:l}=h.useContext(Pn),{pathname:c}=hs(),u=mn(),d=vh(t,yh(l,a.v7_relativeSplatPath),c,i==="path"),p=JSON.stringify(d);return h.useEffect(()=>u(JSON.parse(p),{replace:n,state:s,relative:i}),[u,p,i,n,s]),null}function Lk(e){return bk(e.context)}function xe(e){Me(!1)}function Ok(e){let{basename:t="/",children:n=null,location:s,navigationType:i=Hn.Pop,navigator:a,static:o=!1,future:l}=e;Ur()&&Me(!1);let c=t.replace(/^\/*/,"/"),u=h.useMemo(()=>({basename:c,navigator:a,static:o,future:Ji({v7_relativeSplatPath:!1},l)}),[c,l,a,o]);typeof s=="string"&&(s=$r(s));let{pathname:d="/",search:p="",hash:f="",state:m=null,key:b="default"}=s,y=h.useMemo(()=>{let v=xh(d,c);return v==null?null:{location:{pathname:v,search:p,hash:f,state:m,key:b},navigationType:i}},[c,d,p,f,m,b,i]);return y==null?null:h.createElement(ds.Provider,{value:u},h.createElement(kl.Provider,{children:n,value:y}))}function Dk(e){let{children:t,location:n}=e;return wk(Uu(t),n)}new Promise(()=>{});function Uu(e,t){t===void 0&&(t=[]);let n=[];return h.Children.forEach(e,(s,i)=>{if(!h.isValidElement(s))return;let a=[...t,i];if(s.type===h.Fragment){n.push.apply(n,Uu(s.props.children,a));return}s.type!==xe&&Me(!1),!s.props.index||!s.props.children||Me(!1);let o={id:s.props.id||a.join("-"),caseSensitive:s.props.caseSensitive,element:s.props.element,Component:s.props.Component,index:s.props.index,path:s.props.path,loader:s.props.loader,action:s.props.action,errorElement:s.props.errorElement,ErrorBoundary:s.props.ErrorBoundary,hasErrorBoundary:s.props.ErrorBoundary!=null||s.props.errorElement!=null,shouldRevalidate:s.props.shouldRevalidate,handle:s.props.handle,lazy:s.props.lazy};s.props.children&&(o.children=Uu(s.props.children,a)),n.push(o)}),n}/**
58
+ */function Ji(){return Ji=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},Ji.apply(this,arguments)}const bh=h.createContext(null),gk=h.createContext(null),ds=h.createContext(null),kl=h.createContext(null),Pn=h.createContext({outlet:null,matches:[],isDataRoute:!1}),gy=h.createContext(null);function xk(e,t){let{relative:n}=t===void 0?{}:t;Hr()||Ae(!1);let{basename:s,navigator:i}=h.useContext(ds),{hash:a,pathname:o,search:l}=yy(e,{relative:n}),c=o;return s!=="/"&&(c=o==="/"?s:Zn([s,o])),i.createHref({pathname:c,search:l,hash:a})}function Hr(){return h.useContext(kl)!=null}function hs(){return Hr()||Ae(!1),h.useContext(kl).location}function xy(e){h.useContext(ds).static||h.useLayoutEffect(e)}function mn(){let{isDataRoute:e}=h.useContext(Pn);return e?Mk():yk()}function yk(){Hr()||Ae(!1);let e=h.useContext(bh),{basename:t,future:n,navigator:s}=h.useContext(ds),{matches:i}=h.useContext(Pn),{pathname:a}=hs(),o=JSON.stringify(yh(i,n.v7_relativeSplatPath)),l=h.useRef(!1);return xy(()=>{l.current=!0}),h.useCallback(function(u,d){if(d===void 0&&(d={}),!l.current)return;if(typeof u=="number"){s.go(u);return}let p=vh(u,JSON.parse(o),a,d.relative==="path");e==null&&t!=="/"&&(p.pathname=p.pathname==="/"?t:Zn([t,p.pathname])),(d.replace?s.replace:s.push)(p,d.state,d)},[t,s,o,a,e])}const vk=h.createContext(null);function bk(e){let t=h.useContext(Pn).outlet;return t&&h.createElement(vk.Provider,{value:e},t)}function yy(e,t){let{relative:n}=t===void 0?{}:t,{future:s}=h.useContext(ds),{matches:i}=h.useContext(Pn),{pathname:a}=hs(),o=JSON.stringify(yh(i,s.v7_relativeSplatPath));return h.useMemo(()=>vh(e,JSON.parse(o),a,n==="path"),[e,o,a,n])}function wk(e,t){return kk(e,t)}function kk(e,t,n,s){Hr()||Ae(!1);let{navigator:i}=h.useContext(ds),{matches:a}=h.useContext(Pn),o=a[a.length-1],l=o?o.params:{};o&&o.pathname;let c=o?o.pathnameBase:"/";o&&o.route;let u=hs(),d;if(t){var p;let b=typeof t=="string"?Ur(t):t;c==="/"||(p=b.pathname)!=null&&p.startsWith(c)||Ae(!1),d=b}else d=u;let f=d.pathname||"/",m=f;if(c!=="/"){let b=c.replace(/^\//,"").split("/");m="/"+f.replace(/^\//,"").split("/").slice(b.length).join("/")}let v=K2(e,{pathname:m}),y=Ek(v&&v.map(b=>Object.assign({},b,{params:Object.assign({},l,b.params),pathname:Zn([c,i.encodeLocation?i.encodeLocation(b.pathname).pathname:b.pathname]),pathnameBase:b.pathnameBase==="/"?c:Zn([c,i.encodeLocation?i.encodeLocation(b.pathnameBase).pathname:b.pathnameBase])})),a,n,s);return t&&y?h.createElement(kl.Provider,{value:{location:Ji({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:Hn.Pop}},y):y}function jk(){let e=Ak(),t=pk(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return h.createElement(h.Fragment,null,h.createElement("h2",null,"Unexpected Application Error!"),h.createElement("h3",{style:{fontStyle:"italic"}},t),n?h.createElement("pre",{style:i},n):null,null)}const Nk=h.createElement(jk,null);class Sk extends h.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?h.createElement(Pn.Provider,{value:this.props.routeContext},h.createElement(gy.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Ck(e){let{routeContext:t,match:n,children:s}=e,i=h.useContext(bh);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),h.createElement(Pn.Provider,{value:t},s)}function Ek(e,t,n,s){var i;if(t===void 0&&(t=[]),n===void 0&&(n=null),s===void 0&&(s=null),e==null){var a;if(!n)return null;if(n.errors)e=n.matches;else if((a=s)!=null&&a.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,l=(i=n)==null?void 0:i.errors;if(l!=null){let d=o.findIndex(p=>p.route.id&&(l==null?void 0:l[p.route.id])!==void 0);d>=0||Ae(!1),o=o.slice(0,Math.min(o.length,d+1))}let c=!1,u=-1;if(n&&s&&s.v7_partialHydration)for(let d=0;d<o.length;d++){let p=o[d];if((p.route.HydrateFallback||p.route.hydrateFallbackElement)&&(u=d),p.route.id){let{loaderData:f,errors:m}=n,v=p.route.loader&&f[p.route.id]===void 0&&(!m||m[p.route.id]===void 0);if(p.route.lazy||v){c=!0,u>=0?o=o.slice(0,u+1):o=[o[0]];break}}}return o.reduceRight((d,p,f)=>{let m,v=!1,y=null,b=null;n&&(m=l&&p.route.id?l[p.route.id]:void 0,y=p.route.errorElement||Nk,c&&(u<0&&f===0?(Rk("route-fallback"),v=!0,b=null):u===f&&(v=!0,b=p.route.hydrateFallbackElement||null)));let g=t.concat(o.slice(0,f+1)),x=()=>{let w;return m?w=y:v?w=b:p.route.Component?w=h.createElement(p.route.Component,null):p.route.element?w=p.route.element:w=d,h.createElement(Ck,{match:p,routeContext:{outlet:d,matches:g,isDataRoute:n!=null},children:w})};return n&&(p.route.ErrorBoundary||p.route.errorElement||f===0)?h.createElement(Sk,{location:n.location,revalidation:n.revalidation,component:y,error:m,children:x(),routeContext:{outlet:null,matches:g,isDataRoute:!0}}):x()},null)}var vy=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(vy||{}),by=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(by||{});function _k(e){let t=h.useContext(bh);return t||Ae(!1),t}function Tk(e){let t=h.useContext(gk);return t||Ae(!1),t}function Pk(e){let t=h.useContext(Pn);return t||Ae(!1),t}function wy(e){let t=Pk(),n=t.matches[t.matches.length-1];return n.route.id||Ae(!1),n.route.id}function Ak(){var e;let t=h.useContext(gy),n=Tk(),s=wy();return t!==void 0?t:(e=n.errors)==null?void 0:e[s]}function Mk(){let{router:e}=_k(vy.UseNavigateStable),t=wy(by.UseNavigateStable),n=h.useRef(!1);return xy(()=>{n.current=!0}),h.useCallback(function(i,a){a===void 0&&(a={}),n.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,Ji({fromRouteId:t},a)))},[e,t])}const Op={};function Rk(e,t,n){Op[e]||(Op[e]=!0)}function zk(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function Dp(e){let{to:t,replace:n,state:s,relative:i}=e;Hr()||Ae(!1);let{future:a,static:o}=h.useContext(ds),{matches:l}=h.useContext(Pn),{pathname:c}=hs(),u=mn(),d=vh(t,yh(l,a.v7_relativeSplatPath),c,i==="path"),p=JSON.stringify(d);return h.useEffect(()=>u(JSON.parse(p),{replace:n,state:s,relative:i}),[u,p,i,n,s]),null}function Lk(e){return bk(e.context)}function xe(e){Ae(!1)}function Ok(e){let{basename:t="/",children:n=null,location:s,navigationType:i=Hn.Pop,navigator:a,static:o=!1,future:l}=e;Hr()&&Ae(!1);let c=t.replace(/^\/*/,"/"),u=h.useMemo(()=>({basename:c,navigator:a,static:o,future:Ji({v7_relativeSplatPath:!1},l)}),[c,l,a,o]);typeof s=="string"&&(s=Ur(s));let{pathname:d="/",search:p="",hash:f="",state:m=null,key:v="default"}=s,y=h.useMemo(()=>{let b=xh(d,c);return b==null?null:{location:{pathname:b,search:p,hash:f,state:m,key:v},navigationType:i}},[c,d,p,f,m,v,i]);return y==null?null:h.createElement(ds.Provider,{value:u},h.createElement(kl.Provider,{children:n,value:y}))}function Dk(e){let{children:t,location:n}=e;return wk(Uu(t),n)}new Promise(()=>{});function Uu(e,t){t===void 0&&(t=[]);let n=[];return h.Children.forEach(e,(s,i)=>{if(!h.isValidElement(s))return;let a=[...t,i];if(s.type===h.Fragment){n.push.apply(n,Uu(s.props.children,a));return}s.type!==xe&&Ae(!1),!s.props.index||!s.props.children||Ae(!1);let o={id:s.props.id||a.join("-"),caseSensitive:s.props.caseSensitive,element:s.props.element,Component:s.props.Component,index:s.props.index,path:s.props.path,loader:s.props.loader,action:s.props.action,errorElement:s.props.errorElement,ErrorBoundary:s.props.ErrorBoundary,hasErrorBoundary:s.props.ErrorBoundary!=null||s.props.errorElement!=null,shouldRevalidate:s.props.shouldRevalidate,handle:s.props.handle,lazy:s.props.lazy};s.props.children&&(o.children=Uu(s.props.children,a)),n.push(o)}),n}/**
59
59
  * React Router DOM v6.30.3
60
60
  *
61
61
  * Copyright (c) Remix Software Inc.
@@ -64,8 +64,8 @@ Error generating stack: `+a.message+`
64
64
  * LICENSE.md file in the root directory of this source tree.
65
65
  *
66
66
  * @license MIT
67
- */function Hu(){return Hu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},Hu.apply(this,arguments)}function Ik(e,t){if(e==null)return{};var n={},s=Object.keys(e),i,a;for(a=0;a<s.length;a++)i=s[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function Bk(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Fk(e,t){return e.button===0&&(!t||t==="_self")&&!Bk(e)}function Wu(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let s=e[n];return t.concat(Array.isArray(s)?s.map(i=>[n,i]):[[n,s]])},[]))}function Vk(e,t){let n=Wu(e);return t&&t.forEach((s,i)=>{n.has(i)||t.getAll(i).forEach(a=>{n.append(i,a)})}),n}const $k=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],Uk="6";try{window.__reactRouterVersion=Uk}catch{}const Hk="startTransition",Ip=Nd[Hk];function Wk(e){let{basename:t,children:n,future:s,window:i}=e,a=h.useRef();a.current==null&&(a.current=U2({window:i,v5Compat:!0}));let o=a.current,[l,c]=h.useState({action:o.action,location:o.location}),{v7_startTransition:u}=s||{},d=h.useCallback(p=>{u&&Ip?Ip(()=>c(p)):c(p)},[c,u]);return h.useLayoutEffect(()=>o.listen(d),[o,d]),h.useEffect(()=>zk(s),[s]),h.createElement(Ok,{basename:t,children:n,location:l.location,navigationType:l.action,navigator:o,future:s})}const Kk=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Gk=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ei=h.forwardRef(function(t,n){let{onClick:s,relative:i,reloadDocument:a,replace:o,state:l,target:c,to:u,preventScrollReset:d,viewTransition:p}=t,f=Ik(t,$k),{basename:m}=h.useContext(ds),b,y=!1;if(typeof u=="string"&&Gk.test(u)&&(b=u,Kk))try{let w=new URL(window.location.href),j=u.startsWith("//")?new URL(w.protocol+u):new URL(u),k=xh(j.pathname,m);j.origin===w.origin&&k!=null?u=k+j.search+j.hash:y=!0}catch{}let v=xk(u,{relative:i}),g=qk(u,{replace:o,state:l,target:c,preventScrollReset:d,relative:i,viewTransition:p});function x(w){s&&s(w),w.defaultPrevented||g(w)}return h.createElement("a",Hu({},f,{href:b||v,onClick:y||a?s:x,ref:n,target:c}))});var Bp;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Bp||(Bp={}));var Fp;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Fp||(Fp={}));function qk(e,t){let{target:n,replace:s,state:i,preventScrollReset:a,relative:o,viewTransition:l}=t===void 0?{}:t,c=mn(),u=hs(),d=yy(e,{relative:o});return h.useCallback(p=>{if(Fk(p,n)){p.preventDefault();let f=s!==void 0?s:Xo(u)===Xo(d);c(e,{replace:f,state:i,preventScrollReset:a,relative:o,viewTransition:l})}},[u,c,d,s,i,n,e,a,o,l])}function Yk(e){let t=h.useRef(Wu(e)),n=h.useRef(!1),s=hs(),i=h.useMemo(()=>Vk(s.search,n.current?null:t.current),[s.search]),a=mn(),o=h.useCallback((l,c)=>{const u=Wu(typeof l=="function"?l(i):l);n.current=!0,a("?"+u,c)},[a,i]);return[i,o]}var Xk=e=>{switch(e){case"success":return Zk;case"info":return t5;case"warning":return e5;case"error":return n5;default:return null}},Qk=Array(12).fill(0),Jk=({visible:e,className:t})=>W.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},W.createElement("div",{className:"sonner-spinner"},Qk.map((n,s)=>W.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${s}`})))),Zk=W.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},W.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),e5=W.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},W.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),t5=W.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},W.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),n5=W.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},W.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),s5=W.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},W.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),W.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),r5=()=>{let[e,t]=W.useState(document.hidden);return W.useEffect(()=>{let n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},Ku=1,i5=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:n,...s}=e,i=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:Ku++,a=this.toasts.find(l=>l.id===i),o=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(i)&&this.dismissedToasts.delete(i),a?this.toasts=this.toasts.map(l=>l.id===i?(this.publish({...l,...e,id:i,title:n}),{...l,...e,id:i,dismissible:o,title:n}):l):this.addToast({title:n,...s,dismissible:o,id:i}),i},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(t=>{this.subscribers.forEach(n=>n({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let s=e instanceof Promise?e:e(),i=n!==void 0,a,o=s.then(async c=>{if(a=["resolve",c],W.isValidElement(c))i=!1,this.create({id:n,type:"default",message:c});else if(o5(c)&&!c.ok){i=!1;let u=typeof t.error=="function"?await t.error(`HTTP error! status: ${c.status}`):t.error,d=typeof t.description=="function"?await t.description(`HTTP error! status: ${c.status}`):t.description;this.create({id:n,type:"error",message:u,description:d})}else if(t.success!==void 0){i=!1;let u=typeof t.success=="function"?await t.success(c):t.success,d=typeof t.description=="function"?await t.description(c):t.description;this.create({id:n,type:"success",message:u,description:d})}}).catch(async c=>{if(a=["reject",c],t.error!==void 0){i=!1;let u=typeof t.error=="function"?await t.error(c):t.error,d=typeof t.description=="function"?await t.description(c):t.description;this.create({id:n,type:"error",message:u,description:d})}}).finally(()=>{var c;i&&(this.dismiss(n),n=void 0),(c=t.finally)==null||c.call(t)}),l=()=>new Promise((c,u)=>o.then(()=>a[0]==="reject"?u(a[1]):c(a[1])).catch(u));return typeof n!="string"&&typeof n!="number"?{unwrap:l}:Object.assign(n,{unwrap:l})},this.custom=(e,t)=>{let n=(t==null?void 0:t.id)||Ku++;return this.create({jsx:e(n),id:n,...t}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},lt=new i5,a5=(e,t)=>{let n=(t==null?void 0:t.id)||Ku++;return lt.addToast({title:e,...t,id:n}),n},o5=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",l5=a5,c5=()=>lt.toasts,u5=()=>lt.getActiveToasts(),ue=Object.assign(l5,{success:lt.success,info:lt.info,warning:lt.warning,error:lt.error,custom:lt.custom,message:lt.message,promise:lt.promise,dismiss:lt.dismiss,loading:lt.loading},{getHistory:c5,getToasts:u5});function d5(e,{insertAt:t}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.type="text/css",t==="top"&&n.firstChild?n.insertBefore(s,n.firstChild):n.appendChild(s),s.styleSheet?s.styleSheet.cssText=e:s.appendChild(document.createTextNode(e))}d5(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
68
- `);function Va(e){return e.label!==void 0}var h5=3,f5="32px",p5="16px",Vp=4e3,m5=356,g5=14,x5=20,y5=200;function Ft(...e){return e.filter(Boolean).join(" ")}function v5(e){let[t,n]=e.split("-"),s=[];return t&&s.push(t),n&&s.push(n),s}var b5=e=>{var t,n,s,i,a,o,l,c,u,d,p;let{invert:f,toast:m,unstyled:b,interacting:y,setHeights:v,visibleToasts:g,heights:x,index:w,toasts:j,expanded:k,removeToast:N,defaultRichColors:S,closeButton:E,style:P,cancelButtonStyle:M,actionButtonStyle:T,className:V="",descriptionClassName:R="",duration:I,position:L,gap:z,loadingIcon:B,expandByDefault:C,classNames:A,icons:_,closeButtonAriaLabel:U="Close toast",pauseWhenPageIsHidden:K}=e,[Y,J]=W.useState(null),[le,oe]=W.useState(null),[re,De]=W.useState(!1),[ot,G]=W.useState(!1),[Q,Lt]=W.useState(!1),[Xr,Ks]=W.useState(!1),[tt,Gs]=W.useState(!1),[Vl,qs]=W.useState(0),[$l,wa]=W.useState(0),ms=W.useRef(m.duration||I||Vp),Qr=W.useRef(null),Zt=W.useRef(null),O=w===0,ee=w+1<=g,Z=m.type,_e=m.dismissible!==!1,Ie=m.className||"",ka=m.descriptionClassName||"",ja=W.useMemo(()=>x.findIndex(te=>te.toastId===m.id)||0,[x,m.id]),hb=W.useMemo(()=>{var te;return(te=m.closeButton)!=null?te:E},[m.closeButton,E]),yf=W.useMemo(()=>m.duration||I||Vp,[m.duration,I]),Ul=W.useRef(0),Ys=W.useRef(0),vf=W.useRef(0),Xs=W.useRef(null),[fb,pb]=L.split("-"),bf=W.useMemo(()=>x.reduce((te,fe,be)=>be>=ja?te:te+fe.height,0),[x,ja]),wf=r5(),mb=m.invert||f,Hl=Z==="loading";Ys.current=W.useMemo(()=>ja*z+bf,[ja,bf]),W.useEffect(()=>{ms.current=yf},[yf]),W.useEffect(()=>{De(!0)},[]),W.useEffect(()=>{let te=Zt.current;if(te){let fe=te.getBoundingClientRect().height;return wa(fe),v(be=>[{toastId:m.id,height:fe,position:m.position},...be]),()=>v(be=>be.filter(Ot=>Ot.toastId!==m.id))}},[v,m.id]),W.useLayoutEffect(()=>{if(!re)return;let te=Zt.current,fe=te.style.height;te.style.height="auto";let be=te.getBoundingClientRect().height;te.style.height=fe,wa(be),v(Ot=>Ot.find(Dt=>Dt.toastId===m.id)?Ot.map(Dt=>Dt.toastId===m.id?{...Dt,height:be}:Dt):[{toastId:m.id,height:be,position:m.position},...Ot])},[re,m.title,m.description,v,m.id]);let An=W.useCallback(()=>{G(!0),qs(Ys.current),v(te=>te.filter(fe=>fe.toastId!==m.id)),setTimeout(()=>{N(m)},y5)},[m,N,v,Ys]);W.useEffect(()=>{if(m.promise&&Z==="loading"||m.duration===1/0||m.type==="loading")return;let te;return k||y||K&&wf?(()=>{if(vf.current<Ul.current){let fe=new Date().getTime()-Ul.current;ms.current=ms.current-fe}vf.current=new Date().getTime()})():ms.current!==1/0&&(Ul.current=new Date().getTime(),te=setTimeout(()=>{var fe;(fe=m.onAutoClose)==null||fe.call(m,m),An()},ms.current)),()=>clearTimeout(te)},[k,y,m,Z,K,wf,An]),W.useEffect(()=>{m.delete&&An()},[An,m.delete]);function gb(){var te,fe,be;return _!=null&&_.loading?W.createElement("div",{className:Ft(A==null?void 0:A.loader,(te=m==null?void 0:m.classNames)==null?void 0:te.loader,"sonner-loader"),"data-visible":Z==="loading"},_.loading):B?W.createElement("div",{className:Ft(A==null?void 0:A.loader,(fe=m==null?void 0:m.classNames)==null?void 0:fe.loader,"sonner-loader"),"data-visible":Z==="loading"},B):W.createElement(Jk,{className:Ft(A==null?void 0:A.loader,(be=m==null?void 0:m.classNames)==null?void 0:be.loader),visible:Z==="loading"})}return W.createElement("li",{tabIndex:0,ref:Zt,className:Ft(V,Ie,A==null?void 0:A.toast,(t=m==null?void 0:m.classNames)==null?void 0:t.toast,A==null?void 0:A.default,A==null?void 0:A[Z],(n=m==null?void 0:m.classNames)==null?void 0:n[Z]),"data-sonner-toast":"","data-rich-colors":(s=m.richColors)!=null?s:S,"data-styled":!(m.jsx||m.unstyled||b),"data-mounted":re,"data-promise":!!m.promise,"data-swiped":tt,"data-removed":ot,"data-visible":ee,"data-y-position":fb,"data-x-position":pb,"data-index":w,"data-front":O,"data-swiping":Q,"data-dismissible":_e,"data-type":Z,"data-invert":mb,"data-swipe-out":Xr,"data-swipe-direction":le,"data-expanded":!!(k||C&&re),style:{"--index":w,"--toasts-before":w,"--z-index":j.length-w,"--offset":`${ot?Vl:Ys.current}px`,"--initial-height":C?"auto":`${$l}px`,...P,...m.style},onDragEnd:()=>{Lt(!1),J(null),Xs.current=null},onPointerDown:te=>{Hl||!_e||(Qr.current=new Date,qs(Ys.current),te.target.setPointerCapture(te.pointerId),te.target.tagName!=="BUTTON"&&(Lt(!0),Xs.current={x:te.clientX,y:te.clientY}))},onPointerUp:()=>{var te,fe,be,Ot;if(Xr||!_e)return;Xs.current=null;let Dt=Number(((te=Zt.current)==null?void 0:te.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Rn=Number(((fe=Zt.current)==null?void 0:fe.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),gs=new Date().getTime()-((be=Qr.current)==null?void 0:be.getTime()),It=Y==="x"?Dt:Rn,zn=Math.abs(It)/gs;if(Math.abs(It)>=x5||zn>.11){qs(Ys.current),(Ot=m.onDismiss)==null||Ot.call(m,m),oe(Y==="x"?Dt>0?"right":"left":Rn>0?"down":"up"),An(),Ks(!0),Gs(!1);return}Lt(!1),J(null)},onPointerMove:te=>{var fe,be,Ot,Dt;if(!Xs.current||!_e||((fe=window.getSelection())==null?void 0:fe.toString().length)>0)return;let Rn=te.clientY-Xs.current.y,gs=te.clientX-Xs.current.x,It=(be=e.swipeDirections)!=null?be:v5(L);!Y&&(Math.abs(gs)>1||Math.abs(Rn)>1)&&J(Math.abs(gs)>Math.abs(Rn)?"x":"y");let zn={x:0,y:0};Y==="y"?(It.includes("top")||It.includes("bottom"))&&(It.includes("top")&&Rn<0||It.includes("bottom")&&Rn>0)&&(zn.y=Rn):Y==="x"&&(It.includes("left")||It.includes("right"))&&(It.includes("left")&&gs<0||It.includes("right")&&gs>0)&&(zn.x=gs),(Math.abs(zn.x)>0||Math.abs(zn.y)>0)&&Gs(!0),(Ot=Zt.current)==null||Ot.style.setProperty("--swipe-amount-x",`${zn.x}px`),(Dt=Zt.current)==null||Dt.style.setProperty("--swipe-amount-y",`${zn.y}px`)}},hb&&!m.jsx?W.createElement("button",{"aria-label":U,"data-disabled":Hl,"data-close-button":!0,onClick:Hl||!_e?()=>{}:()=>{var te;An(),(te=m.onDismiss)==null||te.call(m,m)},className:Ft(A==null?void 0:A.closeButton,(i=m==null?void 0:m.classNames)==null?void 0:i.closeButton)},(a=_==null?void 0:_.close)!=null?a:s5):null,m.jsx||h.isValidElement(m.title)?m.jsx?m.jsx:typeof m.title=="function"?m.title():m.title:W.createElement(W.Fragment,null,Z||m.icon||m.promise?W.createElement("div",{"data-icon":"",className:Ft(A==null?void 0:A.icon,(o=m==null?void 0:m.classNames)==null?void 0:o.icon)},m.promise||m.type==="loading"&&!m.icon?m.icon||gb():null,m.type!=="loading"?m.icon||(_==null?void 0:_[Z])||Xk(Z):null):null,W.createElement("div",{"data-content":"",className:Ft(A==null?void 0:A.content,(l=m==null?void 0:m.classNames)==null?void 0:l.content)},W.createElement("div",{"data-title":"",className:Ft(A==null?void 0:A.title,(c=m==null?void 0:m.classNames)==null?void 0:c.title)},typeof m.title=="function"?m.title():m.title),m.description?W.createElement("div",{"data-description":"",className:Ft(R,ka,A==null?void 0:A.description,(u=m==null?void 0:m.classNames)==null?void 0:u.description)},typeof m.description=="function"?m.description():m.description):null),h.isValidElement(m.cancel)?m.cancel:m.cancel&&Va(m.cancel)?W.createElement("button",{"data-button":!0,"data-cancel":!0,style:m.cancelButtonStyle||M,onClick:te=>{var fe,be;Va(m.cancel)&&_e&&((be=(fe=m.cancel).onClick)==null||be.call(fe,te),An())},className:Ft(A==null?void 0:A.cancelButton,(d=m==null?void 0:m.classNames)==null?void 0:d.cancelButton)},m.cancel.label):null,h.isValidElement(m.action)?m.action:m.action&&Va(m.action)?W.createElement("button",{"data-button":!0,"data-action":!0,style:m.actionButtonStyle||T,onClick:te=>{var fe,be;Va(m.action)&&((be=(fe=m.action).onClick)==null||be.call(fe,te),!te.defaultPrevented&&An())},className:Ft(A==null?void 0:A.actionButton,(p=m==null?void 0:m.classNames)==null?void 0:p.actionButton)},m.action.label):null))};function $p(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function w5(e,t){let n={};return[e,t].forEach((s,i)=>{let a=i===1,o=a?"--mobile-offset":"--offset",l=a?p5:f5;function c(u){["top","right","bottom","left"].forEach(d=>{n[`${o}-${d}`]=typeof u=="number"?`${u}px`:u})}typeof s=="number"||typeof s=="string"?c(s):typeof s=="object"?["top","right","bottom","left"].forEach(u=>{s[u]===void 0?n[`${o}-${u}`]=l:n[`${o}-${u}`]=typeof s[u]=="number"?`${s[u]}px`:s[u]}):c(l)}),n}var k5=h.forwardRef(function(e,t){let{invert:n,position:s="bottom-right",hotkey:i=["altKey","KeyT"],expand:a,closeButton:o,className:l,offset:c,mobileOffset:u,theme:d="light",richColors:p,duration:f,style:m,visibleToasts:b=h5,toastOptions:y,dir:v=$p(),gap:g=g5,loadingIcon:x,icons:w,containerAriaLabel:j="Notifications",pauseWhenPageIsHidden:k}=e,[N,S]=W.useState([]),E=W.useMemo(()=>Array.from(new Set([s].concat(N.filter(K=>K.position).map(K=>K.position)))),[N,s]),[P,M]=W.useState([]),[T,V]=W.useState(!1),[R,I]=W.useState(!1),[L,z]=W.useState(d!=="system"?d:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),B=W.useRef(null),C=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),A=W.useRef(null),_=W.useRef(!1),U=W.useCallback(K=>{S(Y=>{var J;return(J=Y.find(le=>le.id===K.id))!=null&&J.delete||lt.dismiss(K.id),Y.filter(({id:le})=>le!==K.id)})},[]);return W.useEffect(()=>lt.subscribe(K=>{if(K.dismiss){S(Y=>Y.map(J=>J.id===K.id?{...J,delete:!0}:J));return}setTimeout(()=>{dy.flushSync(()=>{S(Y=>{let J=Y.findIndex(le=>le.id===K.id);return J!==-1?[...Y.slice(0,J),{...Y[J],...K},...Y.slice(J+1)]:[K,...Y]})})})}),[]),W.useEffect(()=>{if(d!=="system"){z(d);return}if(d==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?z("dark"):z("light")),typeof window>"u")return;let K=window.matchMedia("(prefers-color-scheme: dark)");try{K.addEventListener("change",({matches:Y})=>{z(Y?"dark":"light")})}catch{K.addListener(({matches:J})=>{try{z(J?"dark":"light")}catch(le){console.error(le)}})}},[d]),W.useEffect(()=>{N.length<=1&&V(!1)},[N]),W.useEffect(()=>{let K=Y=>{var J,le;i.every(oe=>Y[oe]||Y.code===oe)&&(V(!0),(J=B.current)==null||J.focus()),Y.code==="Escape"&&(document.activeElement===B.current||(le=B.current)!=null&&le.contains(document.activeElement))&&V(!1)};return document.addEventListener("keydown",K),()=>document.removeEventListener("keydown",K)},[i]),W.useEffect(()=>{if(B.current)return()=>{A.current&&(A.current.focus({preventScroll:!0}),A.current=null,_.current=!1)}},[B.current]),W.createElement("section",{ref:t,"aria-label":`${j} ${C}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},E.map((K,Y)=>{var J;let[le,oe]=K.split("-");return N.length?W.createElement("ol",{key:K,dir:v==="auto"?$p():v,tabIndex:-1,ref:B,className:l,"data-sonner-toaster":!0,"data-theme":L,"data-y-position":le,"data-lifted":T&&N.length>1&&!a,"data-x-position":oe,style:{"--front-toast-height":`${((J=P[0])==null?void 0:J.height)||0}px`,"--width":`${m5}px`,"--gap":`${g}px`,...m,...w5(c,u)},onBlur:re=>{_.current&&!re.currentTarget.contains(re.relatedTarget)&&(_.current=!1,A.current&&(A.current.focus({preventScroll:!0}),A.current=null))},onFocus:re=>{re.target instanceof HTMLElement&&re.target.dataset.dismissible==="false"||_.current||(_.current=!0,A.current=re.relatedTarget)},onMouseEnter:()=>V(!0),onMouseMove:()=>V(!0),onMouseLeave:()=>{R||V(!1)},onDragEnd:()=>V(!1),onPointerDown:re=>{re.target instanceof HTMLElement&&re.target.dataset.dismissible==="false"||I(!0)},onPointerUp:()=>I(!1)},N.filter(re=>!re.position&&Y===0||re.position===K).map((re,De)=>{var ot,G;return W.createElement(b5,{key:re.id,icons:w,index:De,toast:re,defaultRichColors:p,duration:(ot=y==null?void 0:y.duration)!=null?ot:f,className:y==null?void 0:y.className,descriptionClassName:y==null?void 0:y.descriptionClassName,invert:n,visibleToasts:b,closeButton:(G=y==null?void 0:y.closeButton)!=null?G:o,interacting:R,position:K,style:y==null?void 0:y.style,unstyled:y==null?void 0:y.unstyled,classNames:y==null?void 0:y.classNames,cancelButtonStyle:y==null?void 0:y.cancelButtonStyle,actionButtonStyle:y==null?void 0:y.actionButtonStyle,removeToast:U,toasts:N.filter(Q=>Q.position==re.position),heights:P.filter(Q=>Q.position==re.position),setHeights:M,expandByDefault:a,gap:g,loadingIcon:x,expanded:T,pauseWhenPageIsHidden:k,swipeDirections:e.swipeDirections})})):null}))});const wh=h.createContext({});function jl(e){const t=h.useRef(null);return t.current===null&&(t.current=e()),t.current}const Nl=h.createContext(null),Zi=h.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class j5 extends h.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const s=this.props.sizeRef.current;s.height=n.offsetHeight||0,s.width=n.offsetWidth||0,s.top=n.offsetTop,s.left=n.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function N5({children:e,isPresent:t}){const n=h.useId(),s=h.useRef(null),i=h.useRef({width:0,height:0,top:0,left:0}),{nonce:a}=h.useContext(Zi);return h.useInsertionEffect(()=>{const{width:o,height:l,top:c,left:u}=i.current;if(t||!s.current||!o||!l)return;s.current.dataset.motionPopId=n;const d=document.createElement("style");return a&&(d.nonce=a),document.head.appendChild(d),d.sheet&&d.sheet.insertRule(`
67
+ */function Hu(){return Hu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},Hu.apply(this,arguments)}function Ik(e,t){if(e==null)return{};var n={},s=Object.keys(e),i,a;for(a=0;a<s.length;a++)i=s[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function Bk(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Fk(e,t){return e.button===0&&(!t||t==="_self")&&!Bk(e)}function Wu(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let s=e[n];return t.concat(Array.isArray(s)?s.map(i=>[n,i]):[[n,s]])},[]))}function Vk(e,t){let n=Wu(e);return t&&t.forEach((s,i)=>{n.has(i)||t.getAll(i).forEach(a=>{n.append(i,a)})}),n}const $k=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],Uk="6";try{window.__reactRouterVersion=Uk}catch{}const Hk="startTransition",Ip=Nd[Hk];function Wk(e){let{basename:t,children:n,future:s,window:i}=e,a=h.useRef();a.current==null&&(a.current=U2({window:i,v5Compat:!0}));let o=a.current,[l,c]=h.useState({action:o.action,location:o.location}),{v7_startTransition:u}=s||{},d=h.useCallback(p=>{u&&Ip?Ip(()=>c(p)):c(p)},[c,u]);return h.useLayoutEffect(()=>o.listen(d),[o,d]),h.useEffect(()=>zk(s),[s]),h.createElement(Ok,{basename:t,children:n,location:l.location,navigationType:l.action,navigator:o,future:s})}const Kk=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Gk=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ei=h.forwardRef(function(t,n){let{onClick:s,relative:i,reloadDocument:a,replace:o,state:l,target:c,to:u,preventScrollReset:d,viewTransition:p}=t,f=Ik(t,$k),{basename:m}=h.useContext(ds),v,y=!1;if(typeof u=="string"&&Gk.test(u)&&(v=u,Kk))try{let w=new URL(window.location.href),j=u.startsWith("//")?new URL(w.protocol+u):new URL(u),k=xh(j.pathname,m);j.origin===w.origin&&k!=null?u=k+j.search+j.hash:y=!0}catch{}let b=xk(u,{relative:i}),g=qk(u,{replace:o,state:l,target:c,preventScrollReset:d,relative:i,viewTransition:p});function x(w){s&&s(w),w.defaultPrevented||g(w)}return h.createElement("a",Hu({},f,{href:v||b,onClick:y||a?s:x,ref:n,target:c}))});var Bp;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Bp||(Bp={}));var Fp;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Fp||(Fp={}));function qk(e,t){let{target:n,replace:s,state:i,preventScrollReset:a,relative:o,viewTransition:l}=t===void 0?{}:t,c=mn(),u=hs(),d=yy(e,{relative:o});return h.useCallback(p=>{if(Fk(p,n)){p.preventDefault();let f=s!==void 0?s:Xo(u)===Xo(d);c(e,{replace:f,state:i,preventScrollReset:a,relative:o,viewTransition:l})}},[u,c,d,s,i,n,e,a,o,l])}function Yk(e){let t=h.useRef(Wu(e)),n=h.useRef(!1),s=hs(),i=h.useMemo(()=>Vk(s.search,n.current?null:t.current),[s.search]),a=mn(),o=h.useCallback((l,c)=>{const u=Wu(typeof l=="function"?l(i):l);n.current=!0,a("?"+u,c)},[a,i]);return[i,o]}var Xk=e=>{switch(e){case"success":return Zk;case"info":return t5;case"warning":return e5;case"error":return n5;default:return null}},Qk=Array(12).fill(0),Jk=({visible:e,className:t})=>W.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},W.createElement("div",{className:"sonner-spinner"},Qk.map((n,s)=>W.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${s}`})))),Zk=W.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},W.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),e5=W.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},W.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),t5=W.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},W.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),n5=W.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},W.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),s5=W.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},W.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),W.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),r5=()=>{let[e,t]=W.useState(document.hidden);return W.useEffect(()=>{let n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},Ku=1,i5=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:n,...s}=e,i=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:Ku++,a=this.toasts.find(l=>l.id===i),o=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(i)&&this.dismissedToasts.delete(i),a?this.toasts=this.toasts.map(l=>l.id===i?(this.publish({...l,...e,id:i,title:n}),{...l,...e,id:i,dismissible:o,title:n}):l):this.addToast({title:n,...s,dismissible:o,id:i}),i},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(t=>{this.subscribers.forEach(n=>n({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let s=e instanceof Promise?e:e(),i=n!==void 0,a,o=s.then(async c=>{if(a=["resolve",c],W.isValidElement(c))i=!1,this.create({id:n,type:"default",message:c});else if(o5(c)&&!c.ok){i=!1;let u=typeof t.error=="function"?await t.error(`HTTP error! status: ${c.status}`):t.error,d=typeof t.description=="function"?await t.description(`HTTP error! status: ${c.status}`):t.description;this.create({id:n,type:"error",message:u,description:d})}else if(t.success!==void 0){i=!1;let u=typeof t.success=="function"?await t.success(c):t.success,d=typeof t.description=="function"?await t.description(c):t.description;this.create({id:n,type:"success",message:u,description:d})}}).catch(async c=>{if(a=["reject",c],t.error!==void 0){i=!1;let u=typeof t.error=="function"?await t.error(c):t.error,d=typeof t.description=="function"?await t.description(c):t.description;this.create({id:n,type:"error",message:u,description:d})}}).finally(()=>{var c;i&&(this.dismiss(n),n=void 0),(c=t.finally)==null||c.call(t)}),l=()=>new Promise((c,u)=>o.then(()=>a[0]==="reject"?u(a[1]):c(a[1])).catch(u));return typeof n!="string"&&typeof n!="number"?{unwrap:l}:Object.assign(n,{unwrap:l})},this.custom=(e,t)=>{let n=(t==null?void 0:t.id)||Ku++;return this.create({jsx:e(n),id:n,...t}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},lt=new i5,a5=(e,t)=>{let n=(t==null?void 0:t.id)||Ku++;return lt.addToast({title:e,...t,id:n}),n},o5=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",l5=a5,c5=()=>lt.toasts,u5=()=>lt.getActiveToasts(),le=Object.assign(l5,{success:lt.success,info:lt.info,warning:lt.warning,error:lt.error,custom:lt.custom,message:lt.message,promise:lt.promise,dismiss:lt.dismiss,loading:lt.loading},{getHistory:c5,getToasts:u5});function d5(e,{insertAt:t}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.type="text/css",t==="top"&&n.firstChild?n.insertBefore(s,n.firstChild):n.appendChild(s),s.styleSheet?s.styleSheet.cssText=e:s.appendChild(document.createTextNode(e))}d5(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
68
+ `);function Va(e){return e.label!==void 0}var h5=3,f5="32px",p5="16px",Vp=4e3,m5=356,g5=14,x5=20,y5=200;function Ft(...e){return e.filter(Boolean).join(" ")}function v5(e){let[t,n]=e.split("-"),s=[];return t&&s.push(t),n&&s.push(n),s}var b5=e=>{var t,n,s,i,a,o,l,c,u,d,p;let{invert:f,toast:m,unstyled:v,interacting:y,setHeights:b,visibleToasts:g,heights:x,index:w,toasts:j,expanded:k,removeToast:N,defaultRichColors:S,closeButton:E,style:P,cancelButtonStyle:A,actionButtonStyle:T,className:V="",descriptionClassName:R="",duration:I,position:L,gap:z,loadingIcon:B,expandByDefault:C,classNames:M,icons:_,closeButtonAriaLabel:U="Close toast",pauseWhenPageIsHidden:K}=e,[Y,J]=W.useState(null),[ce,oe]=W.useState(null),[re,De]=W.useState(!1),[ot,G]=W.useState(!1),[Q,Lt]=W.useState(!1),[Xr,Gs]=W.useState(!1),[tt,qs]=W.useState(!1),[Vl,Ys]=W.useState(0),[$l,wa]=W.useState(0),ms=W.useRef(m.duration||I||Vp),Qr=W.useRef(null),Zt=W.useRef(null),O=w===0,ee=w+1<=g,Z=m.type,_e=m.dismissible!==!1,Ie=m.className||"",ka=m.descriptionClassName||"",ja=W.useMemo(()=>x.findIndex(te=>te.toastId===m.id)||0,[x,m.id]),hb=W.useMemo(()=>{var te;return(te=m.closeButton)!=null?te:E},[m.closeButton,E]),yf=W.useMemo(()=>m.duration||I||Vp,[m.duration,I]),Ul=W.useRef(0),Xs=W.useRef(0),vf=W.useRef(0),Qs=W.useRef(null),[fb,pb]=L.split("-"),bf=W.useMemo(()=>x.reduce((te,fe,be)=>be>=ja?te:te+fe.height,0),[x,ja]),wf=r5(),mb=m.invert||f,Hl=Z==="loading";Xs.current=W.useMemo(()=>ja*z+bf,[ja,bf]),W.useEffect(()=>{ms.current=yf},[yf]),W.useEffect(()=>{De(!0)},[]),W.useEffect(()=>{let te=Zt.current;if(te){let fe=te.getBoundingClientRect().height;return wa(fe),b(be=>[{toastId:m.id,height:fe,position:m.position},...be]),()=>b(be=>be.filter(Ot=>Ot.toastId!==m.id))}},[b,m.id]),W.useLayoutEffect(()=>{if(!re)return;let te=Zt.current,fe=te.style.height;te.style.height="auto";let be=te.getBoundingClientRect().height;te.style.height=fe,wa(be),b(Ot=>Ot.find(Dt=>Dt.toastId===m.id)?Ot.map(Dt=>Dt.toastId===m.id?{...Dt,height:be}:Dt):[{toastId:m.id,height:be,position:m.position},...Ot])},[re,m.title,m.description,b,m.id]);let Mn=W.useCallback(()=>{G(!0),Ys(Xs.current),b(te=>te.filter(fe=>fe.toastId!==m.id)),setTimeout(()=>{N(m)},y5)},[m,N,b,Xs]);W.useEffect(()=>{if(m.promise&&Z==="loading"||m.duration===1/0||m.type==="loading")return;let te;return k||y||K&&wf?(()=>{if(vf.current<Ul.current){let fe=new Date().getTime()-Ul.current;ms.current=ms.current-fe}vf.current=new Date().getTime()})():ms.current!==1/0&&(Ul.current=new Date().getTime(),te=setTimeout(()=>{var fe;(fe=m.onAutoClose)==null||fe.call(m,m),Mn()},ms.current)),()=>clearTimeout(te)},[k,y,m,Z,K,wf,Mn]),W.useEffect(()=>{m.delete&&Mn()},[Mn,m.delete]);function gb(){var te,fe,be;return _!=null&&_.loading?W.createElement("div",{className:Ft(M==null?void 0:M.loader,(te=m==null?void 0:m.classNames)==null?void 0:te.loader,"sonner-loader"),"data-visible":Z==="loading"},_.loading):B?W.createElement("div",{className:Ft(M==null?void 0:M.loader,(fe=m==null?void 0:m.classNames)==null?void 0:fe.loader,"sonner-loader"),"data-visible":Z==="loading"},B):W.createElement(Jk,{className:Ft(M==null?void 0:M.loader,(be=m==null?void 0:m.classNames)==null?void 0:be.loader),visible:Z==="loading"})}return W.createElement("li",{tabIndex:0,ref:Zt,className:Ft(V,Ie,M==null?void 0:M.toast,(t=m==null?void 0:m.classNames)==null?void 0:t.toast,M==null?void 0:M.default,M==null?void 0:M[Z],(n=m==null?void 0:m.classNames)==null?void 0:n[Z]),"data-sonner-toast":"","data-rich-colors":(s=m.richColors)!=null?s:S,"data-styled":!(m.jsx||m.unstyled||v),"data-mounted":re,"data-promise":!!m.promise,"data-swiped":tt,"data-removed":ot,"data-visible":ee,"data-y-position":fb,"data-x-position":pb,"data-index":w,"data-front":O,"data-swiping":Q,"data-dismissible":_e,"data-type":Z,"data-invert":mb,"data-swipe-out":Xr,"data-swipe-direction":ce,"data-expanded":!!(k||C&&re),style:{"--index":w,"--toasts-before":w,"--z-index":j.length-w,"--offset":`${ot?Vl:Xs.current}px`,"--initial-height":C?"auto":`${$l}px`,...P,...m.style},onDragEnd:()=>{Lt(!1),J(null),Qs.current=null},onPointerDown:te=>{Hl||!_e||(Qr.current=new Date,Ys(Xs.current),te.target.setPointerCapture(te.pointerId),te.target.tagName!=="BUTTON"&&(Lt(!0),Qs.current={x:te.clientX,y:te.clientY}))},onPointerUp:()=>{var te,fe,be,Ot;if(Xr||!_e)return;Qs.current=null;let Dt=Number(((te=Zt.current)==null?void 0:te.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Rn=Number(((fe=Zt.current)==null?void 0:fe.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),gs=new Date().getTime()-((be=Qr.current)==null?void 0:be.getTime()),It=Y==="x"?Dt:Rn,zn=Math.abs(It)/gs;if(Math.abs(It)>=x5||zn>.11){Ys(Xs.current),(Ot=m.onDismiss)==null||Ot.call(m,m),oe(Y==="x"?Dt>0?"right":"left":Rn>0?"down":"up"),Mn(),Gs(!0),qs(!1);return}Lt(!1),J(null)},onPointerMove:te=>{var fe,be,Ot,Dt;if(!Qs.current||!_e||((fe=window.getSelection())==null?void 0:fe.toString().length)>0)return;let Rn=te.clientY-Qs.current.y,gs=te.clientX-Qs.current.x,It=(be=e.swipeDirections)!=null?be:v5(L);!Y&&(Math.abs(gs)>1||Math.abs(Rn)>1)&&J(Math.abs(gs)>Math.abs(Rn)?"x":"y");let zn={x:0,y:0};Y==="y"?(It.includes("top")||It.includes("bottom"))&&(It.includes("top")&&Rn<0||It.includes("bottom")&&Rn>0)&&(zn.y=Rn):Y==="x"&&(It.includes("left")||It.includes("right"))&&(It.includes("left")&&gs<0||It.includes("right")&&gs>0)&&(zn.x=gs),(Math.abs(zn.x)>0||Math.abs(zn.y)>0)&&qs(!0),(Ot=Zt.current)==null||Ot.style.setProperty("--swipe-amount-x",`${zn.x}px`),(Dt=Zt.current)==null||Dt.style.setProperty("--swipe-amount-y",`${zn.y}px`)}},hb&&!m.jsx?W.createElement("button",{"aria-label":U,"data-disabled":Hl,"data-close-button":!0,onClick:Hl||!_e?()=>{}:()=>{var te;Mn(),(te=m.onDismiss)==null||te.call(m,m)},className:Ft(M==null?void 0:M.closeButton,(i=m==null?void 0:m.classNames)==null?void 0:i.closeButton)},(a=_==null?void 0:_.close)!=null?a:s5):null,m.jsx||h.isValidElement(m.title)?m.jsx?m.jsx:typeof m.title=="function"?m.title():m.title:W.createElement(W.Fragment,null,Z||m.icon||m.promise?W.createElement("div",{"data-icon":"",className:Ft(M==null?void 0:M.icon,(o=m==null?void 0:m.classNames)==null?void 0:o.icon)},m.promise||m.type==="loading"&&!m.icon?m.icon||gb():null,m.type!=="loading"?m.icon||(_==null?void 0:_[Z])||Xk(Z):null):null,W.createElement("div",{"data-content":"",className:Ft(M==null?void 0:M.content,(l=m==null?void 0:m.classNames)==null?void 0:l.content)},W.createElement("div",{"data-title":"",className:Ft(M==null?void 0:M.title,(c=m==null?void 0:m.classNames)==null?void 0:c.title)},typeof m.title=="function"?m.title():m.title),m.description?W.createElement("div",{"data-description":"",className:Ft(R,ka,M==null?void 0:M.description,(u=m==null?void 0:m.classNames)==null?void 0:u.description)},typeof m.description=="function"?m.description():m.description):null),h.isValidElement(m.cancel)?m.cancel:m.cancel&&Va(m.cancel)?W.createElement("button",{"data-button":!0,"data-cancel":!0,style:m.cancelButtonStyle||A,onClick:te=>{var fe,be;Va(m.cancel)&&_e&&((be=(fe=m.cancel).onClick)==null||be.call(fe,te),Mn())},className:Ft(M==null?void 0:M.cancelButton,(d=m==null?void 0:m.classNames)==null?void 0:d.cancelButton)},m.cancel.label):null,h.isValidElement(m.action)?m.action:m.action&&Va(m.action)?W.createElement("button",{"data-button":!0,"data-action":!0,style:m.actionButtonStyle||T,onClick:te=>{var fe,be;Va(m.action)&&((be=(fe=m.action).onClick)==null||be.call(fe,te),!te.defaultPrevented&&Mn())},className:Ft(M==null?void 0:M.actionButton,(p=m==null?void 0:m.classNames)==null?void 0:p.actionButton)},m.action.label):null))};function $p(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function w5(e,t){let n={};return[e,t].forEach((s,i)=>{let a=i===1,o=a?"--mobile-offset":"--offset",l=a?p5:f5;function c(u){["top","right","bottom","left"].forEach(d=>{n[`${o}-${d}`]=typeof u=="number"?`${u}px`:u})}typeof s=="number"||typeof s=="string"?c(s):typeof s=="object"?["top","right","bottom","left"].forEach(u=>{s[u]===void 0?n[`${o}-${u}`]=l:n[`${o}-${u}`]=typeof s[u]=="number"?`${s[u]}px`:s[u]}):c(l)}),n}var k5=h.forwardRef(function(e,t){let{invert:n,position:s="bottom-right",hotkey:i=["altKey","KeyT"],expand:a,closeButton:o,className:l,offset:c,mobileOffset:u,theme:d="light",richColors:p,duration:f,style:m,visibleToasts:v=h5,toastOptions:y,dir:b=$p(),gap:g=g5,loadingIcon:x,icons:w,containerAriaLabel:j="Notifications",pauseWhenPageIsHidden:k}=e,[N,S]=W.useState([]),E=W.useMemo(()=>Array.from(new Set([s].concat(N.filter(K=>K.position).map(K=>K.position)))),[N,s]),[P,A]=W.useState([]),[T,V]=W.useState(!1),[R,I]=W.useState(!1),[L,z]=W.useState(d!=="system"?d:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),B=W.useRef(null),C=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),M=W.useRef(null),_=W.useRef(!1),U=W.useCallback(K=>{S(Y=>{var J;return(J=Y.find(ce=>ce.id===K.id))!=null&&J.delete||lt.dismiss(K.id),Y.filter(({id:ce})=>ce!==K.id)})},[]);return W.useEffect(()=>lt.subscribe(K=>{if(K.dismiss){S(Y=>Y.map(J=>J.id===K.id?{...J,delete:!0}:J));return}setTimeout(()=>{dy.flushSync(()=>{S(Y=>{let J=Y.findIndex(ce=>ce.id===K.id);return J!==-1?[...Y.slice(0,J),{...Y[J],...K},...Y.slice(J+1)]:[K,...Y]})})})}),[]),W.useEffect(()=>{if(d!=="system"){z(d);return}if(d==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?z("dark"):z("light")),typeof window>"u")return;let K=window.matchMedia("(prefers-color-scheme: dark)");try{K.addEventListener("change",({matches:Y})=>{z(Y?"dark":"light")})}catch{K.addListener(({matches:J})=>{try{z(J?"dark":"light")}catch(ce){console.error(ce)}})}},[d]),W.useEffect(()=>{N.length<=1&&V(!1)},[N]),W.useEffect(()=>{let K=Y=>{var J,ce;i.every(oe=>Y[oe]||Y.code===oe)&&(V(!0),(J=B.current)==null||J.focus()),Y.code==="Escape"&&(document.activeElement===B.current||(ce=B.current)!=null&&ce.contains(document.activeElement))&&V(!1)};return document.addEventListener("keydown",K),()=>document.removeEventListener("keydown",K)},[i]),W.useEffect(()=>{if(B.current)return()=>{M.current&&(M.current.focus({preventScroll:!0}),M.current=null,_.current=!1)}},[B.current]),W.createElement("section",{ref:t,"aria-label":`${j} ${C}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},E.map((K,Y)=>{var J;let[ce,oe]=K.split("-");return N.length?W.createElement("ol",{key:K,dir:b==="auto"?$p():b,tabIndex:-1,ref:B,className:l,"data-sonner-toaster":!0,"data-theme":L,"data-y-position":ce,"data-lifted":T&&N.length>1&&!a,"data-x-position":oe,style:{"--front-toast-height":`${((J=P[0])==null?void 0:J.height)||0}px`,"--width":`${m5}px`,"--gap":`${g}px`,...m,...w5(c,u)},onBlur:re=>{_.current&&!re.currentTarget.contains(re.relatedTarget)&&(_.current=!1,M.current&&(M.current.focus({preventScroll:!0}),M.current=null))},onFocus:re=>{re.target instanceof HTMLElement&&re.target.dataset.dismissible==="false"||_.current||(_.current=!0,M.current=re.relatedTarget)},onMouseEnter:()=>V(!0),onMouseMove:()=>V(!0),onMouseLeave:()=>{R||V(!1)},onDragEnd:()=>V(!1),onPointerDown:re=>{re.target instanceof HTMLElement&&re.target.dataset.dismissible==="false"||I(!0)},onPointerUp:()=>I(!1)},N.filter(re=>!re.position&&Y===0||re.position===K).map((re,De)=>{var ot,G;return W.createElement(b5,{key:re.id,icons:w,index:De,toast:re,defaultRichColors:p,duration:(ot=y==null?void 0:y.duration)!=null?ot:f,className:y==null?void 0:y.className,descriptionClassName:y==null?void 0:y.descriptionClassName,invert:n,visibleToasts:v,closeButton:(G=y==null?void 0:y.closeButton)!=null?G:o,interacting:R,position:K,style:y==null?void 0:y.style,unstyled:y==null?void 0:y.unstyled,classNames:y==null?void 0:y.classNames,cancelButtonStyle:y==null?void 0:y.cancelButtonStyle,actionButtonStyle:y==null?void 0:y.actionButtonStyle,removeToast:U,toasts:N.filter(Q=>Q.position==re.position),heights:P.filter(Q=>Q.position==re.position),setHeights:A,expandByDefault:a,gap:g,loadingIcon:x,expanded:T,pauseWhenPageIsHidden:k,swipeDirections:e.swipeDirections})})):null}))});const wh=h.createContext({});function jl(e){const t=h.useRef(null);return t.current===null&&(t.current=e()),t.current}const Nl=h.createContext(null),Zi=h.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class j5 extends h.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const s=this.props.sizeRef.current;s.height=n.offsetHeight||0,s.width=n.offsetWidth||0,s.top=n.offsetTop,s.left=n.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function N5({children:e,isPresent:t}){const n=h.useId(),s=h.useRef(null),i=h.useRef({width:0,height:0,top:0,left:0}),{nonce:a}=h.useContext(Zi);return h.useInsertionEffect(()=>{const{width:o,height:l,top:c,left:u}=i.current;if(t||!s.current||!o||!l)return;s.current.dataset.motionPopId=n;const d=document.createElement("style");return a&&(d.nonce=a),document.head.appendChild(d),d.sheet&&d.sheet.insertRule(`
69
69
  [data-motion-pop-id="${n}"] {
70
70
  position: absolute !important;
71
71
  width: ${o}px !important;
@@ -73,7 +73,7 @@ Error generating stack: `+a.message+`
73
73
  top: ${c}px !important;
74
74
  left: ${u}px !important;
75
75
  }
76
- `),()=>{document.head.removeChild(d)}},[t]),r.jsx(j5,{isPresent:t,childRef:s,sizeRef:i,children:h.cloneElement(e,{ref:s})})}const S5=({children:e,initial:t,isPresent:n,onExitComplete:s,custom:i,presenceAffectsLayout:a,mode:o})=>{const l=jl(C5),c=h.useId(),u=h.useCallback(p=>{l.set(p,!0);for(const f of l.values())if(!f)return;s&&s()},[l,s]),d=h.useMemo(()=>({id:c,initial:t,isPresent:n,custom:i,onExitComplete:u,register:p=>(l.set(p,!1),()=>l.delete(p))}),a?[Math.random(),u]:[n,u]);return h.useMemo(()=>{l.forEach((p,f)=>l.set(f,!1))},[n]),h.useEffect(()=>{!n&&!l.size&&s&&s()},[n]),o==="popLayout"&&(e=r.jsx(N5,{isPresent:n,children:e})),r.jsx(Nl.Provider,{value:d,children:e})};function C5(){return new Map}function ky(e=!0){const t=h.useContext(Nl);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:s,register:i}=t,a=h.useId();h.useEffect(()=>{e&&i(a)},[e]);const o=h.useCallback(()=>e&&s&&s(a),[a,s,e]);return!n&&s?[!1,o]:[!0]}const $a=e=>e.key||"";function Up(e){const t=[];return h.Children.forEach(e,n=>{h.isValidElement(n)&&t.push(n)}),t}const kh=typeof window<"u",jy=kh?h.useLayoutEffect:h.useEffect,se=({children:e,custom:t,initial:n=!0,onExitComplete:s,presenceAffectsLayout:i=!0,mode:a="sync",propagate:o=!1})=>{const[l,c]=ky(o),u=h.useMemo(()=>Up(e),[e]),d=o&&!l?[]:u.map($a),p=h.useRef(!0),f=h.useRef(u),m=jl(()=>new Map),[b,y]=h.useState(u),[v,g]=h.useState(u);jy(()=>{p.current=!1,f.current=u;for(let j=0;j<v.length;j++){const k=$a(v[j]);d.includes(k)?m.delete(k):m.get(k)!==!0&&m.set(k,!1)}},[v,d.length,d.join("-")]);const x=[];if(u!==b){let j=[...u];for(let k=0;k<v.length;k++){const N=v[k],S=$a(N);d.includes(S)||(j.splice(k,0,N),x.push(N))}a==="wait"&&x.length&&(j=x),g(Up(j)),y(u);return}const{forceRender:w}=h.useContext(wh);return r.jsx(r.Fragment,{children:v.map(j=>{const k=$a(j),N=o&&!l?!1:u===v||d.includes(k),S=()=>{if(m.has(k))m.set(k,!0);else return;let E=!0;m.forEach(P=>{P||(E=!1)}),E&&(w==null||w(),g(f.current),o&&(c==null||c()),s&&s())};return r.jsx(S5,{isPresent:N,initial:!p.current||n?void 0:!1,custom:N?void 0:t,presenceAffectsLayout:i,mode:a,onExitComplete:N?void 0:S,children:j},k)})})},yt=e=>e;let Ny=yt;function jh(e){let t;return()=>(t===void 0&&(t=e()),t)}const Lr=(e,t,n)=>{const s=t-e;return s===0?1:(n-e)/s},kn=e=>e*1e3,jn=e=>e/1e3,E5={useManualTiming:!1};function _5(e){let t=new Set,n=new Set,s=!1,i=!1;const a=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1};function l(u){a.has(u)&&(c.schedule(u),e()),u(o)}const c={schedule:(u,d=!1,p=!1)=>{const m=p&&s?t:n;return d&&a.add(u),m.has(u)||m.add(u),u},cancel:u=>{n.delete(u),a.delete(u)},process:u=>{if(o=u,s){i=!0;return}s=!0,[t,n]=[n,t],t.forEach(l),t.clear(),s=!1,i&&(i=!1,c.process(u))}};return c}const Ua=["read","resolveKeyframes","update","preRender","render","postRender"],T5=40;function Sy(e,t){let n=!1,s=!0;const i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=Ua.reduce((g,x)=>(g[x]=_5(a),g),{}),{read:l,resolveKeyframes:c,update:u,preRender:d,render:p,postRender:f}=o,m=()=>{const g=performance.now();n=!1,i.delta=s?1e3/60:Math.max(Math.min(g-i.timestamp,T5),1),i.timestamp=g,i.isProcessing=!0,l.process(i),c.process(i),u.process(i),d.process(i),p.process(i),f.process(i),i.isProcessing=!1,n&&t&&(s=!1,e(m))},b=()=>{n=!0,s=!0,i.isProcessing||e(m)};return{schedule:Ua.reduce((g,x)=>{const w=o[x];return g[x]=(j,k=!1,N=!1)=>(n||b(),w.schedule(j,k,N)),g},{}),cancel:g=>{for(let x=0;x<Ua.length;x++)o[Ua[x]].cancel(g)},state:i,steps:o}}const{schedule:ve,cancel:rs,state:Ue,steps:yc}=Sy(typeof requestAnimationFrame<"u"?requestAnimationFrame:yt,!0),Cy=h.createContext({strict:!1}),Hp={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Or={};for(const e in Hp)Or[e]={isEnabled:t=>Hp[e].some(n=>!!t[n])};function P5(e){for(const t in e)Or[t]={...Or[t],...e[t]}}const M5=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function Qo(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||M5.has(e)}let Ey=e=>!Qo(e);function _y(e){e&&(Ey=t=>t.startsWith("on")?!Qo(t):e(t))}try{_y(require("@emotion/is-prop-valid").default)}catch{}function A5(e,t,n){const s={};for(const i in e)i==="values"&&typeof e.values=="object"||(Ey(i)||n===!0&&Qo(i)||!t&&!Qo(i)||e.draggable&&i.startsWith("onDrag"))&&(s[i]=e[i]);return s}function R5({children:e,isValidProp:t,...n}){t&&_y(t),n={...h.useContext(Zi),...n},n.isStatic=jl(()=>n.isStatic);const s=h.useMemo(()=>n,[JSON.stringify(n.transition),n.transformPagePoint,n.reducedMotion]);return r.jsx(Zi.Provider,{value:s,children:e})}function z5(e){if(typeof Proxy>"u")return e;const t=new Map,n=(...s)=>e(...s);return new Proxy(n,{get:(s,i)=>i==="create"?e:(t.has(i)||t.set(i,e(i)),t.get(i))})}const Sl=h.createContext({});function ea(e){return typeof e=="string"||Array.isArray(e)}function Cl(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}const Nh=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Sh=["initial",...Nh];function El(e){return Cl(e.animate)||Sh.some(t=>ea(e[t]))}function Ty(e){return!!(El(e)||e.variants)}function L5(e,t){if(El(e)){const{initial:n,animate:s}=e;return{initial:n===!1||ea(n)?n:void 0,animate:ea(s)?s:void 0}}return e.inherit!==!1?t:{}}function O5(e){const{initial:t,animate:n}=L5(e,h.useContext(Sl));return h.useMemo(()=>({initial:t,animate:n}),[Wp(t),Wp(n)])}function Wp(e){return Array.isArray(e)?e.join(" "):e}const D5=Symbol.for("motionComponentSymbol");function mr(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function I5(e,t,n){return h.useCallback(s=>{s&&e.onMount&&e.onMount(s),t&&(s?t.mount(s):t.unmount()),n&&(typeof n=="function"?n(s):mr(n)&&(n.current=s))},[t])}const Ch=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),B5="framerAppearId",Py="data-"+Ch(B5),{schedule:Eh}=Sy(queueMicrotask,!1),My=h.createContext({});function F5(e,t,n,s,i){var a,o;const{visualElement:l}=h.useContext(Sl),c=h.useContext(Cy),u=h.useContext(Nl),d=h.useContext(Zi).reducedMotion,p=h.useRef(null);s=s||c.renderer,!p.current&&s&&(p.current=s(e,{visualState:t,parent:l,props:n,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:d}));const f=p.current,m=h.useContext(My);f&&!f.projection&&i&&(f.type==="html"||f.type==="svg")&&V5(p.current,n,i,m);const b=h.useRef(!1);h.useInsertionEffect(()=>{f&&b.current&&f.update(n,u)});const y=n[Py],v=h.useRef(!!y&&!(!((a=window.MotionHandoffIsComplete)===null||a===void 0)&&a.call(window,y))&&((o=window.MotionHasOptimisedAnimation)===null||o===void 0?void 0:o.call(window,y)));return jy(()=>{f&&(b.current=!0,window.MotionIsMounted=!0,f.updateFeatures(),Eh.render(f.render),v.current&&f.animationState&&f.animationState.animateChanges())}),h.useEffect(()=>{f&&(!v.current&&f.animationState&&f.animationState.animateChanges(),v.current&&(queueMicrotask(()=>{var g;(g=window.MotionHandoffMarkAsComplete)===null||g===void 0||g.call(window,y)}),v.current=!1))}),f}function V5(e,t,n,s){const{layoutId:i,layout:a,drag:o,dragConstraints:l,layoutScroll:c,layoutRoot:u}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Ay(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||l&&mr(l),visualElement:e,animationType:typeof a=="string"?a:"both",initialPromotionConfig:s,layoutScroll:c,layoutRoot:u})}function Ay(e){if(e)return e.options.allowProjection!==!1?e.projection:Ay(e.parent)}function $5({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:s,Component:i}){var a,o;e&&P5(e);function l(u,d){let p;const f={...h.useContext(Zi),...u,layoutId:U5(u)},{isStatic:m}=f,b=O5(u),y=s(u,m);if(!m&&kh){H5();const v=W5(f);p=v.MeasureLayout,b.visualElement=F5(i,y,f,t,v.ProjectionNode)}return r.jsxs(Sl.Provider,{value:b,children:[p&&b.visualElement?r.jsx(p,{visualElement:b.visualElement,...f}):null,n(i,u,I5(y,b.visualElement,d),y,m,b.visualElement)]})}l.displayName=`motion.${typeof i=="string"?i:`create(${(o=(a=i.displayName)!==null&&a!==void 0?a:i.name)!==null&&o!==void 0?o:""})`}`;const c=h.forwardRef(l);return c[D5]=i,c}function U5({layoutId:e}){const t=h.useContext(wh).id;return t&&e!==void 0?t+"-"+e:e}function H5(e,t){h.useContext(Cy).strict}function W5(e){const{drag:t,layout:n}=Or;if(!t&&!n)return{};const s={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}const K5=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function _h(e){return typeof e!="string"||e.includes("-")?!1:!!(K5.indexOf(e)>-1||/[A-Z]/u.test(e))}function Kp(e){const t=[{},{}];return e==null||e.values.forEach((n,s)=>{t[0][s]=n.get(),t[1][s]=n.getVelocity()}),t}function Th(e,t,n,s){if(typeof t=="function"){const[i,a]=Kp(s);t=t(n!==void 0?n:e.custom,i,a)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[i,a]=Kp(s);t=t(n!==void 0?n:e.custom,i,a)}return t}const Gu=e=>Array.isArray(e),G5=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),q5=e=>Gu(e)?e[e.length-1]||0:e,Je=e=>!!(e&&e.getVelocity);function go(e){const t=Je(e)?e.get():e;return G5(t)?t.toValue():t}function Y5({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},s,i,a){const o={latestValues:X5(s,i,a,e),renderState:t()};return n&&(o.onMount=l=>n({props:s,current:l,...o}),o.onUpdate=l=>n(l)),o}const Ry=e=>(t,n)=>{const s=h.useContext(Sl),i=h.useContext(Nl),a=()=>Y5(e,t,s,i);return n?a():jl(a)};function X5(e,t,n,s){const i={},a=s(e,{});for(const f in a)i[f]=go(a[f]);let{initial:o,animate:l}=e;const c=El(e),u=Ty(e);t&&u&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),l===void 0&&(l=t.animate));let d=n?n.initial===!1:!1;d=d||o===!1;const p=d?l:o;if(p&&typeof p!="boolean"&&!Cl(p)){const f=Array.isArray(p)?p:[p];for(let m=0;m<f.length;m++){const b=Th(e,f[m]);if(b){const{transitionEnd:y,transition:v,...g}=b;for(const x in g){let w=g[x];if(Array.isArray(w)){const j=d?w.length-1:0;w=w[j]}w!==null&&(i[x]=w)}for(const x in y)i[x]=y[x]}}}return i}const Hr=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Vs=new Set(Hr),zy=e=>t=>typeof t=="string"&&t.startsWith(e),Ly=zy("--"),Q5=zy("var(--"),Ph=e=>Q5(e)?J5.test(e.split("/*")[0].trim()):!1,J5=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Oy=(e,t)=>t&&typeof e=="number"?t.transform(e):e,_n=(e,t,n)=>n>t?t:n<e?e:n,Wr={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},ta={...Wr,transform:e=>_n(0,1,e)},Ha={...Wr,default:1},ma=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),On=ma("deg"),ln=ma("%"),X=ma("px"),Z5=ma("vh"),ej=ma("vw"),Gp={...ln,parse:e=>ln.parse(e)/100,transform:e=>ln.transform(e*100)},tj={borderWidth:X,borderTopWidth:X,borderRightWidth:X,borderBottomWidth:X,borderLeftWidth:X,borderRadius:X,radius:X,borderTopLeftRadius:X,borderTopRightRadius:X,borderBottomRightRadius:X,borderBottomLeftRadius:X,width:X,maxWidth:X,height:X,maxHeight:X,top:X,right:X,bottom:X,left:X,padding:X,paddingTop:X,paddingRight:X,paddingBottom:X,paddingLeft:X,margin:X,marginTop:X,marginRight:X,marginBottom:X,marginLeft:X,backgroundPositionX:X,backgroundPositionY:X},nj={rotate:On,rotateX:On,rotateY:On,rotateZ:On,scale:Ha,scaleX:Ha,scaleY:Ha,scaleZ:Ha,skew:On,skewX:On,skewY:On,distance:X,translateX:X,translateY:X,translateZ:X,x:X,y:X,z:X,perspective:X,transformPerspective:X,opacity:ta,originX:Gp,originY:Gp,originZ:X},qp={...Wr,transform:Math.round},Mh={...tj,...nj,zIndex:qp,size:X,fillOpacity:ta,strokeOpacity:ta,numOctaves:qp},sj={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},rj=Hr.length;function ij(e,t,n){let s="",i=!0;for(let a=0;a<rj;a++){const o=Hr[a],l=e[o];if(l===void 0)continue;let c=!0;if(typeof l=="number"?c=l===(o.startsWith("scale")?1:0):c=parseFloat(l)===0,!c||n){const u=Oy(l,Mh[o]);if(!c){i=!1;const d=sj[o]||o;s+=`${d}(${u}) `}n&&(t[o]=u)}}return s=s.trim(),n?s=n(t,i?"":s):i&&(s="none"),s}function Ah(e,t,n){const{style:s,vars:i,transformOrigin:a}=e;let o=!1,l=!1;for(const c in t){const u=t[c];if(Vs.has(c)){o=!0;continue}else if(Ly(c)){i[c]=u;continue}else{const d=Oy(u,Mh[c]);c.startsWith("origin")?(l=!0,a[c]=d):s[c]=d}}if(t.transform||(o||n?s.transform=ij(t,e.transform,n):s.transform&&(s.transform="none")),l){const{originX:c="50%",originY:u="50%",originZ:d=0}=a;s.transformOrigin=`${c} ${u} ${d}`}}const aj={offset:"stroke-dashoffset",array:"stroke-dasharray"},oj={offset:"strokeDashoffset",array:"strokeDasharray"};function lj(e,t,n=1,s=0,i=!0){e.pathLength=1;const a=i?aj:oj;e[a.offset]=X.transform(-s);const o=X.transform(t),l=X.transform(n);e[a.array]=`${o} ${l}`}function Yp(e,t,n){return typeof e=="string"?e:X.transform(t+n*e)}function cj(e,t,n){const s=Yp(t,e.x,e.width),i=Yp(n,e.y,e.height);return`${s} ${i}`}function Rh(e,{attrX:t,attrY:n,attrScale:s,originX:i,originY:a,pathLength:o,pathSpacing:l=1,pathOffset:c=0,...u},d,p){if(Ah(e,u,p),d){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:f,style:m,dimensions:b}=e;f.transform&&(b&&(m.transform=f.transform),delete f.transform),b&&(i!==void 0||a!==void 0||m.transform)&&(m.transformOrigin=cj(b,i!==void 0?i:.5,a!==void 0?a:.5)),t!==void 0&&(f.x=t),n!==void 0&&(f.y=n),s!==void 0&&(f.scale=s),o!==void 0&&lj(f,o,l,c,!1)}const zh=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),Dy=()=>({...zh(),attrs:{}}),Lh=e=>typeof e=="string"&&e.toLowerCase()==="svg";function Iy(e,{style:t,vars:n},s,i){Object.assign(e.style,t,i&&i.getProjectionStyles(s));for(const a in n)e.style.setProperty(a,n[a])}const By=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function Fy(e,t,n,s){Iy(e,t,void 0,s);for(const i in t.attrs)e.setAttribute(By.has(i)?i:Ch(i),t.attrs[i])}const Jo={};function uj(e){Object.assign(Jo,e)}function Vy(e,{layout:t,layoutId:n}){return Vs.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Jo[e]||e==="opacity")}function Oh(e,t,n){var s;const{style:i}=e,a={};for(const o in i)(Je(i[o])||t.style&&Je(t.style[o])||Vy(o,e)||((s=n==null?void 0:n.getValue(o))===null||s===void 0?void 0:s.liveStyle)!==void 0)&&(a[o]=i[o]);return a}function $y(e,t,n){const s=Oh(e,t,n);for(const i in e)if(Je(e[i])||Je(t[i])){const a=Hr.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;s[a]=e[i]}return s}function dj(e,t){try{t.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{t.dimensions={x:0,y:0,width:0,height:0}}}const Xp=["x","y","width","height","cx","cy","r"],hj={useVisualState:Ry({scrapeMotionValuesFromProps:$y,createRenderState:Dy,onUpdate:({props:e,prevProps:t,current:n,renderState:s,latestValues:i})=>{if(!n)return;let a=!!e.drag;if(!a){for(const l in i)if(Vs.has(l)){a=!0;break}}if(!a)return;let o=!t;if(t)for(let l=0;l<Xp.length;l++){const c=Xp[l];e[c]!==t[c]&&(o=!0)}o&&ve.read(()=>{dj(n,s),ve.render(()=>{Rh(s,i,Lh(n.tagName),e.transformTemplate),Fy(n,s)})})}})},fj={useVisualState:Ry({scrapeMotionValuesFromProps:Oh,createRenderState:zh})};function Uy(e,t,n){for(const s in t)!Je(t[s])&&!Vy(s,n)&&(e[s]=t[s])}function pj({transformTemplate:e},t){return h.useMemo(()=>{const n=zh();return Ah(n,t,e),Object.assign({},n.vars,n.style)},[t])}function mj(e,t){const n=e.style||{},s={};return Uy(s,n,e),Object.assign(s,pj(e,t)),s}function gj(e,t){const n={},s=mj(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,s.userSelect=s.WebkitUserSelect=s.WebkitTouchCallout="none",s.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=s,n}function xj(e,t,n,s){const i=h.useMemo(()=>{const a=Dy();return Rh(a,t,Lh(s),e.transformTemplate),{...a.attrs,style:{...a.style}}},[t]);if(e.style){const a={};Uy(a,e.style,e),i.style={...a,...i.style}}return i}function yj(e=!1){return(n,s,i,{latestValues:a},o)=>{const c=(_h(n)?xj:gj)(s,a,o,n),u=A5(s,typeof n=="string",e),d=n!==h.Fragment?{...u,...c,ref:i}:{},{children:p}=s,f=h.useMemo(()=>Je(p)?p.get():p,[p]);return h.createElement(n,{...d,children:f})}}function vj(e,t){return function(s,{forwardMotionProps:i}={forwardMotionProps:!1}){const o={..._h(s)?hj:fj,preloadedFeatures:e,useRender:yj(i),createVisualElement:t,Component:s};return $5(o)}}function Hy(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let s=0;s<n;s++)if(t[s]!==e[s])return!1;return!0}function _l(e,t,n){const s=e.getProps();return Th(s,t,n!==void 0?n:s.custom,e)}const bj=jh(()=>window.ScrollTimeline!==void 0);class wj{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>"finished"in t?t.finished:t))}getAll(t){return this.animations[0][t]}setAll(t,n){for(let s=0;s<this.animations.length;s++)this.animations[s][t]=n}attachTimeline(t,n){const s=this.animations.map(i=>{if(bj()&&i.attachTimeline)return i.attachTimeline(t);if(typeof n=="function")return n(i)});return()=>{s.forEach((i,a)=>{i&&i(),this.animations[a].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let n=0;n<this.animations.length;n++)t=Math.max(t,this.animations[n].duration);return t}runAll(t){this.animations.forEach(n=>n[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class kj extends wj{then(t,n){return Promise.all(this.animations).then(t).catch(n)}}function Dh(e,t){return e?e[t]||e.default||e:void 0}const qu=2e4;function Wy(e){let t=0;const n=50;let s=e.next(t);for(;!s.done&&t<qu;)t+=n,s=e.next(t);return t>=qu?1/0:t}function Ih(e){return typeof e=="function"}function Qp(e,t){e.timeline=t,e.onfinish=null}const Bh=e=>Array.isArray(e)&&typeof e[0]=="number",jj={linearEasing:void 0};function Nj(e,t){const n=jh(e);return()=>{var s;return(s=jj[t])!==null&&s!==void 0?s:n()}}const Zo=Nj(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Ky=(e,t,n=10)=>{let s="";const i=Math.max(Math.round(t/n),2);for(let a=0;a<i;a++)s+=e(Lr(0,i-1,a))+", ";return`linear(${s.substring(0,s.length-2)})`};function Gy(e){return!!(typeof e=="function"&&Zo()||!e||typeof e=="string"&&(e in Yu||Zo())||Bh(e)||Array.isArray(e)&&e.every(Gy))}const fi=([e,t,n,s])=>`cubic-bezier(${e}, ${t}, ${n}, ${s})`,Yu={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:fi([0,.65,.55,1]),circOut:fi([.55,0,1,.45]),backIn:fi([.31,.01,.66,-.59]),backOut:fi([.33,1.53,.69,.99])};function qy(e,t){if(e)return typeof e=="function"&&Zo()?Ky(e,t):Bh(e)?fi(e):Array.isArray(e)?e.map(n=>qy(n,t)||Yu.easeOut):Yu[e]}const Vt={x:!1,y:!1};function Yy(){return Vt.x||Vt.y}function Sj(e,t,n){var s;if(e instanceof Element)return[e];if(typeof e=="string"){let i=document;const a=(s=void 0)!==null&&s!==void 0?s:i.querySelectorAll(e);return a?Array.from(a):[]}return Array.from(e)}function Xy(e,t){const n=Sj(e),s=new AbortController,i={passive:!0,...t,signal:s.signal};return[n,i,()=>s.abort()]}function Jp(e){return t=>{t.pointerType==="touch"||Yy()||e(t)}}function Cj(e,t,n={}){const[s,i,a]=Xy(e,n),o=Jp(l=>{const{target:c}=l,u=t(l);if(typeof u!="function"||!c)return;const d=Jp(p=>{u(p),c.removeEventListener("pointerleave",d)});c.addEventListener("pointerleave",d,i)});return s.forEach(l=>{l.addEventListener("pointerenter",o,i)}),a}const Qy=(e,t)=>t?e===t?!0:Qy(e,t.parentElement):!1,Fh=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,Ej=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function _j(e){return Ej.has(e.tagName)||e.tabIndex!==-1}const pi=new WeakSet;function Zp(e){return t=>{t.key==="Enter"&&e(t)}}function vc(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const Tj=(e,t)=>{const n=e.currentTarget;if(!n)return;const s=Zp(()=>{if(pi.has(n))return;vc(n,"down");const i=Zp(()=>{vc(n,"up")}),a=()=>vc(n,"cancel");n.addEventListener("keyup",i,t),n.addEventListener("blur",a,t)});n.addEventListener("keydown",s,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",s),t)};function em(e){return Fh(e)&&!Yy()}function Pj(e,t,n={}){const[s,i,a]=Xy(e,n),o=l=>{const c=l.currentTarget;if(!em(l)||pi.has(c))return;pi.add(c);const u=t(l),d=(m,b)=>{window.removeEventListener("pointerup",p),window.removeEventListener("pointercancel",f),!(!em(m)||!pi.has(c))&&(pi.delete(c),typeof u=="function"&&u(m,{success:b}))},p=m=>{d(m,n.useGlobalTarget||Qy(c,m.target))},f=m=>{d(m,!1)};window.addEventListener("pointerup",p,i),window.addEventListener("pointercancel",f,i)};return s.forEach(l=>{!_j(l)&&l.getAttribute("tabindex")===null&&(l.tabIndex=0),(n.useGlobalTarget?window:l).addEventListener("pointerdown",o,i),l.addEventListener("focus",u=>Tj(u,i),i)}),a}function Mj(e){return e==="x"||e==="y"?Vt[e]?null:(Vt[e]=!0,()=>{Vt[e]=!1}):Vt.x||Vt.y?null:(Vt.x=Vt.y=!0,()=>{Vt.x=Vt.y=!1})}const Jy=new Set(["width","height","top","left","right","bottom",...Hr]);let xo;function Aj(){xo=void 0}const cn={now:()=>(xo===void 0&&cn.set(Ue.isProcessing||E5.useManualTiming?Ue.timestamp:performance.now()),xo),set:e=>{xo=e,queueMicrotask(Aj)}};function Vh(e,t){e.indexOf(t)===-1&&e.push(t)}function $h(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class Uh{constructor(){this.subscriptions=[]}add(t){return Vh(this.subscriptions,t),()=>$h(this.subscriptions,t)}notify(t,n,s){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,n,s);else for(let a=0;a<i;a++){const o=this.subscriptions[a];o&&o(t,n,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function Zy(e,t){return t?e*(1e3/t):0}const tm=30,Rj=e=>!isNaN(parseFloat(e));class zj{constructor(t,n={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(s,i=!0)=>{const a=cn.now();this.updatedAt!==a&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(s),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),i&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=cn.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=Rj(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new Uh);const s=this.events[t].add(n);return t==="change"?()=>{s(),ve.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,s){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-s}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=cn.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>tm)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,tm);return Zy(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function na(e,t){return new zj(e,t)}function Lj(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,na(n))}function Oj(e,t){const n=_l(e,t);let{transitionEnd:s={},transition:i={},...a}=n||{};a={...a,...s};for(const o in a){const l=q5(a[o]);Lj(e,o,l)}}function Dj(e){return!!(Je(e)&&e.add)}function Xu(e,t){const n=e.getValue("willChange");if(Dj(n))return n.add(t)}function e1(e){return e.props[Py]}const t1=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,Ij=1e-7,Bj=12;function Fj(e,t,n,s,i){let a,o,l=0;do o=t+(n-t)/2,a=t1(o,s,i)-e,a>0?n=o:t=o;while(Math.abs(a)>Ij&&++l<Bj);return o}function ga(e,t,n,s){if(e===t&&n===s)return yt;const i=a=>Fj(a,0,1,e,n);return a=>a===0||a===1?a:t1(i(a),t,s)}const n1=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,s1=e=>t=>1-e(1-t),r1=ga(.33,1.53,.69,.99),Hh=s1(r1),i1=n1(Hh),a1=e=>(e*=2)<1?.5*Hh(e):.5*(2-Math.pow(2,-10*(e-1))),Wh=e=>1-Math.sin(Math.acos(e)),o1=s1(Wh),l1=n1(Wh),c1=e=>/^0[^.\s]+$/u.test(e);function Vj(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||c1(e):!0}const _i=e=>Math.round(e*1e5)/1e5,Kh=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function $j(e){return e==null}const Uj=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Gh=(e,t)=>n=>!!(typeof n=="string"&&Uj.test(n)&&n.startsWith(e)||t&&!$j(n)&&Object.prototype.hasOwnProperty.call(n,t)),u1=(e,t,n)=>s=>{if(typeof s!="string")return s;const[i,a,o,l]=s.match(Kh);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:l!==void 0?parseFloat(l):1}},Hj=e=>_n(0,255,e),bc={...Wr,transform:e=>Math.round(Hj(e))},Cs={test:Gh("rgb","red"),parse:u1("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:s=1})=>"rgba("+bc.transform(e)+", "+bc.transform(t)+", "+bc.transform(n)+", "+_i(ta.transform(s))+")"};function Wj(e){let t="",n="",s="",i="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),s=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),s=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,s+=s,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:i?parseInt(i,16)/255:1}}const Qu={test:Gh("#"),parse:Wj,transform:Cs.transform},gr={test:Gh("hsl","hue"),parse:u1("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:s=1})=>"hsla("+Math.round(e)+", "+ln.transform(_i(t))+", "+ln.transform(_i(n))+", "+_i(ta.transform(s))+")"},Ye={test:e=>Cs.test(e)||Qu.test(e)||gr.test(e),parse:e=>Cs.test(e)?Cs.parse(e):gr.test(e)?gr.parse(e):Qu.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Cs.transform(e):gr.transform(e)},Kj=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Gj(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Kh))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(Kj))===null||n===void 0?void 0:n.length)||0)>0}const d1="number",h1="color",qj="var",Yj="var(",nm="${}",Xj=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function sa(e){const t=e.toString(),n=[],s={color:[],number:[],var:[]},i=[];let a=0;const l=t.replace(Xj,c=>(Ye.test(c)?(s.color.push(a),i.push(h1),n.push(Ye.parse(c))):c.startsWith(Yj)?(s.var.push(a),i.push(qj),n.push(c)):(s.number.push(a),i.push(d1),n.push(parseFloat(c))),++a,nm)).split(nm);return{values:n,split:l,indexes:s,types:i}}function f1(e){return sa(e).values}function p1(e){const{split:t,types:n}=sa(e),s=t.length;return i=>{let a="";for(let o=0;o<s;o++)if(a+=t[o],i[o]!==void 0){const l=n[o];l===d1?a+=_i(i[o]):l===h1?a+=Ye.transform(i[o]):a+=i[o]}return a}}const Qj=e=>typeof e=="number"?0:e;function Jj(e){const t=f1(e);return p1(e)(t.map(Qj))}const is={test:Gj,parse:f1,createTransformer:p1,getAnimatableNone:Jj},Zj=new Set(["brightness","contrast","saturate","opacity"]);function eN(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[s]=n.match(Kh)||[];if(!s)return e;const i=n.replace(s,"");let a=Zj.has(t)?1:0;return s!==n&&(a*=100),t+"("+a+i+")"}const tN=/\b([a-z-]*)\(.*?\)/gu,Ju={...is,getAnimatableNone:e=>{const t=e.match(tN);return t?t.map(eN).join(" "):e}},nN={...Mh,color:Ye,backgroundColor:Ye,outlineColor:Ye,fill:Ye,stroke:Ye,borderColor:Ye,borderTopColor:Ye,borderRightColor:Ye,borderBottomColor:Ye,borderLeftColor:Ye,filter:Ju,WebkitFilter:Ju},qh=e=>nN[e];function m1(e,t){let n=qh(e);return n!==Ju&&(n=is),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const sN=new Set(["auto","none","0"]);function rN(e,t,n){let s=0,i;for(;s<e.length&&!i;){const a=e[s];typeof a=="string"&&!sN.has(a)&&sa(a).values.length&&(i=e[s]),s++}if(i&&n)for(const a of t)e[a]=m1(n,i)}const sm=e=>e===Wr||e===X,rm=(e,t)=>parseFloat(e.split(", ")[t]),im=(e,t)=>(n,{transform:s})=>{if(s==="none"||!s)return 0;const i=s.match(/^matrix3d\((.+)\)$/u);if(i)return rm(i[1],t);{const a=s.match(/^matrix\((.+)\)$/u);return a?rm(a[1],e):0}},iN=new Set(["x","y","z"]),aN=Hr.filter(e=>!iN.has(e));function oN(e){const t=[];return aN.forEach(n=>{const s=e.getValue(n);s!==void 0&&(t.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),t}const Dr={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:im(4,13),y:im(5,14)};Dr.translateX=Dr.x;Dr.translateY=Dr.y;const Ts=new Set;let Zu=!1,ed=!1;function g1(){if(ed){const e=Array.from(Ts).filter(s=>s.needsMeasurement),t=new Set(e.map(s=>s.element)),n=new Map;t.forEach(s=>{const i=oN(s);i.length&&(n.set(s,i),s.render())}),e.forEach(s=>s.measureInitialState()),t.forEach(s=>{s.render();const i=n.get(s);i&&i.forEach(([a,o])=>{var l;(l=s.getValue(a))===null||l===void 0||l.set(o)})}),e.forEach(s=>s.measureEndState()),e.forEach(s=>{s.suspendedScrollY!==void 0&&window.scrollTo(0,s.suspendedScrollY)})}ed=!1,Zu=!1,Ts.forEach(e=>e.complete()),Ts.clear()}function x1(){Ts.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(ed=!0)})}function lN(){x1(),g1()}class Yh{constructor(t,n,s,i,a,o=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=s,this.motionValue=i,this.element=a,this.isAsync=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Ts.add(this),Zu||(Zu=!0,ve.read(x1),ve.resolveKeyframes(g1))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:s,motionValue:i}=this;for(let a=0;a<t.length;a++)if(t[a]===null)if(a===0){const o=i==null?void 0:i.get(),l=t[t.length-1];if(o!==void 0)t[0]=o;else if(s&&n){const c=s.readValue(n,l);c!=null&&(t[0]=c)}t[0]===void 0&&(t[0]=l),i&&o===void 0&&i.set(t[0])}else t[a]=t[a-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),Ts.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Ts.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const y1=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),cN=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function uN(e){const t=cN.exec(e);if(!t)return[,];const[,n,s,i]=t;return[`--${n??s}`,i]}function v1(e,t,n=1){const[s,i]=uN(e);if(!s)return;const a=window.getComputedStyle(t).getPropertyValue(s);if(a){const o=a.trim();return y1(o)?parseFloat(o):o}return Ph(i)?v1(i,t,n+1):i}const b1=e=>t=>t.test(e),dN={test:e=>e==="auto",parse:e=>e},w1=[Wr,X,ln,On,ej,Z5,dN],am=e=>w1.find(b1(e));class k1 extends Yh{constructor(t,n,s,i,a){super(t,n,s,i,a,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:s}=this;if(!n||!n.current)return;super.readKeyframes();for(let c=0;c<t.length;c++){let u=t[c];if(typeof u=="string"&&(u=u.trim(),Ph(u))){const d=v1(u,n.current);d!==void 0&&(t[c]=d),c===t.length-1&&(this.finalKeyframe=u)}}if(this.resolveNoneKeyframes(),!Jy.has(s)||t.length!==2)return;const[i,a]=t,o=am(i),l=am(a);if(o!==l)if(sm(o)&&sm(l))for(let c=0;c<t.length;c++){const u=t[c];typeof u=="string"&&(t[c]=parseFloat(u))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,s=[];for(let i=0;i<t.length;i++)Vj(t[i])&&s.push(i);s.length&&rN(t,s,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:s}=this;if(!t||!t.current)return;s==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Dr[s](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&t.getValue(s,i).jump(i,!1)}measureEndState(){var t;const{element:n,name:s,unresolvedKeyframes:i}=this;if(!n||!n.current)return;const a=n.getValue(s);a&&a.jump(this.measuredOrigin,!1);const o=i.length-1,l=i[o];i[o]=Dr[s](n.measureViewportBox(),window.getComputedStyle(n.current)),l!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=l),!((t=this.removedTransforms)===null||t===void 0)&&t.length&&this.removedTransforms.forEach(([c,u])=>{n.getValue(c).set(u)}),this.resolveNoneKeyframes()}}const om=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(is.test(e)||e==="0")&&!e.startsWith("url("));function hN(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function fN(e,t,n,s){const i=e[0];if(i===null)return!1;if(t==="display"||t==="visibility")return!0;const a=e[e.length-1],o=om(i,t),l=om(a,t);return!o||!l?!1:hN(e)||(n==="spring"||Ih(n))&&s}const pN=e=>e!==null;function Tl(e,{repeat:t,repeatType:n="loop"},s){const i=e.filter(pN),a=t&&n!=="loop"&&t%2===1?0:i.length-1;return!a||s===void 0?i[a]:s}const mN=40;class j1{constructor({autoplay:t=!0,delay:n=0,type:s="keyframes",repeat:i=0,repeatDelay:a=0,repeatType:o="loop",...l}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=cn.now(),this.options={autoplay:t,delay:n,type:s,repeat:i,repeatDelay:a,repeatType:o,...l},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>mN?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&lN(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=cn.now(),this.hasAttemptedResolve=!0;const{name:s,type:i,velocity:a,delay:o,onComplete:l,onUpdate:c,isGenerator:u}=this.options;if(!u&&!fN(t,s,i,a))if(o)this.options.duration=0;else{c&&c(Tl(t,this.options,n)),l&&l(),this.resolveFinishedPromise();return}const d=this.initPlayback(t,n);d!==!1&&(this._resolved={keyframes:t,finalKeyframe:n,...d},this.onPostResolved())}onPostResolved(){}then(t,n){return this.currentFinishedPromise.then(t,n)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}const je=(e,t,n)=>e+(t-e)*n;function wc(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function gN({hue:e,saturation:t,lightness:n,alpha:s}){e/=360,t/=100,n/=100;let i=0,a=0,o=0;if(!t)i=a=o=n;else{const l=n<.5?n*(1+t):n+t-n*t,c=2*n-l;i=wc(c,l,e+1/3),a=wc(c,l,e),o=wc(c,l,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:s}}function el(e,t){return n=>n>0?t:e}const kc=(e,t,n)=>{const s=e*e,i=n*(t*t-s)+s;return i<0?0:Math.sqrt(i)},xN=[Qu,Cs,gr],yN=e=>xN.find(t=>t.test(e));function lm(e){const t=yN(e);if(!t)return!1;let n=t.parse(e);return t===gr&&(n=gN(n)),n}const cm=(e,t)=>{const n=lm(e),s=lm(t);if(!n||!s)return el(e,t);const i={...n};return a=>(i.red=kc(n.red,s.red,a),i.green=kc(n.green,s.green,a),i.blue=kc(n.blue,s.blue,a),i.alpha=je(n.alpha,s.alpha,a),Cs.transform(i))},vN=(e,t)=>n=>t(e(n)),xa=(...e)=>e.reduce(vN),td=new Set(["none","hidden"]);function bN(e,t){return td.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function wN(e,t){return n=>je(e,t,n)}function Xh(e){return typeof e=="number"?wN:typeof e=="string"?Ph(e)?el:Ye.test(e)?cm:NN:Array.isArray(e)?N1:typeof e=="object"?Ye.test(e)?cm:kN:el}function N1(e,t){const n=[...e],s=n.length,i=e.map((a,o)=>Xh(a)(a,t[o]));return a=>{for(let o=0;o<s;o++)n[o]=i[o](a);return n}}function kN(e,t){const n={...e,...t},s={};for(const i in n)e[i]!==void 0&&t[i]!==void 0&&(s[i]=Xh(e[i])(e[i],t[i]));return i=>{for(const a in s)n[a]=s[a](i);return n}}function jN(e,t){var n;const s=[],i={color:0,var:0,number:0};for(let a=0;a<t.values.length;a++){const o=t.types[a],l=e.indexes[o][i[o]],c=(n=e.values[l])!==null&&n!==void 0?n:0;s[a]=c,i[o]++}return s}const NN=(e,t)=>{const n=is.createTransformer(t),s=sa(e),i=sa(t);return s.indexes.var.length===i.indexes.var.length&&s.indexes.color.length===i.indexes.color.length&&s.indexes.number.length>=i.indexes.number.length?td.has(e)&&!i.values.length||td.has(t)&&!s.values.length?bN(e,t):xa(N1(jN(s,i),i.values),n):el(e,t)};function S1(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?je(e,t,n):Xh(e)(e,t)}const SN=5;function C1(e,t,n){const s=Math.max(t-SN,0);return Zy(n-e(s),t-s)}const Ce={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},jc=.001;function CN({duration:e=Ce.duration,bounce:t=Ce.bounce,velocity:n=Ce.velocity,mass:s=Ce.mass}){let i,a,o=1-t;o=_n(Ce.minDamping,Ce.maxDamping,o),e=_n(Ce.minDuration,Ce.maxDuration,jn(e)),o<1?(i=u=>{const d=u*o,p=d*e,f=d-n,m=nd(u,o),b=Math.exp(-p);return jc-f/m*b},a=u=>{const p=u*o*e,f=p*n+n,m=Math.pow(o,2)*Math.pow(u,2)*e,b=Math.exp(-p),y=nd(Math.pow(u,2),o);return(-i(u)+jc>0?-1:1)*((f-m)*b)/y}):(i=u=>{const d=Math.exp(-u*e),p=(u-n)*e+1;return-jc+d*p},a=u=>{const d=Math.exp(-u*e),p=(n-u)*(e*e);return d*p});const l=5/e,c=_N(i,a,l);if(e=kn(e),isNaN(c))return{stiffness:Ce.stiffness,damping:Ce.damping,duration:e};{const u=Math.pow(c,2)*s;return{stiffness:u,damping:o*2*Math.sqrt(s*u),duration:e}}}const EN=12;function _N(e,t,n){let s=n;for(let i=1;i<EN;i++)s=s-e(s)/t(s);return s}function nd(e,t){return e*Math.sqrt(1-t*t)}const TN=["duration","bounce"],PN=["stiffness","damping","mass"];function um(e,t){return t.some(n=>e[n]!==void 0)}function MN(e){let t={velocity:Ce.velocity,stiffness:Ce.stiffness,damping:Ce.damping,mass:Ce.mass,isResolvedFromDuration:!1,...e};if(!um(e,PN)&&um(e,TN))if(e.visualDuration){const n=e.visualDuration,s=2*Math.PI/(n*1.2),i=s*s,a=2*_n(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:Ce.mass,stiffness:i,damping:a}}else{const n=CN(e);t={...t,...n,mass:Ce.mass},t.isResolvedFromDuration=!0}return t}function E1(e=Ce.visualDuration,t=Ce.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:s,restDelta:i}=n;const a=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],l={done:!1,value:a},{stiffness:c,damping:u,mass:d,duration:p,velocity:f,isResolvedFromDuration:m}=MN({...n,velocity:-jn(n.velocity||0)}),b=f||0,y=u/(2*Math.sqrt(c*d)),v=o-a,g=jn(Math.sqrt(c/d)),x=Math.abs(v)<5;s||(s=x?Ce.restSpeed.granular:Ce.restSpeed.default),i||(i=x?Ce.restDelta.granular:Ce.restDelta.default);let w;if(y<1){const k=nd(g,y);w=N=>{const S=Math.exp(-y*g*N);return o-S*((b+y*g*v)/k*Math.sin(k*N)+v*Math.cos(k*N))}}else if(y===1)w=k=>o-Math.exp(-g*k)*(v+(b+g*v)*k);else{const k=g*Math.sqrt(y*y-1);w=N=>{const S=Math.exp(-y*g*N),E=Math.min(k*N,300);return o-S*((b+y*g*v)*Math.sinh(E)+k*v*Math.cosh(E))/k}}const j={calculatedDuration:m&&p||null,next:k=>{const N=w(k);if(m)l.done=k>=p;else{let S=0;y<1&&(S=k===0?kn(b):C1(w,k,N));const E=Math.abs(S)<=s,P=Math.abs(o-N)<=i;l.done=E&&P}return l.value=l.done?o:N,l},toString:()=>{const k=Math.min(Wy(j),qu),N=Ky(S=>j.next(k*S).value,k,30);return k+"ms "+N}};return j}function dm({keyframes:e,velocity:t=0,power:n=.8,timeConstant:s=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:l,max:c,restDelta:u=.5,restSpeed:d}){const p=e[0],f={done:!1,value:p},m=E=>l!==void 0&&E<l||c!==void 0&&E>c,b=E=>l===void 0?c:c===void 0||Math.abs(l-E)<Math.abs(c-E)?l:c;let y=n*t;const v=p+y,g=o===void 0?v:o(v);g!==v&&(y=g-p);const x=E=>-y*Math.exp(-E/s),w=E=>g+x(E),j=E=>{const P=x(E),M=w(E);f.done=Math.abs(P)<=u,f.value=f.done?g:M};let k,N;const S=E=>{m(f.value)&&(k=E,N=E1({keyframes:[f.value,b(f.value)],velocity:C1(w,E,f.value),damping:i,stiffness:a,restDelta:u,restSpeed:d}))};return S(0),{calculatedDuration:null,next:E=>{let P=!1;return!N&&k===void 0&&(P=!0,j(E),S(E)),k!==void 0&&E>=k?N.next(E-k):(!P&&j(E),f)}}}const AN=ga(.42,0,1,1),RN=ga(0,0,.58,1),_1=ga(.42,0,.58,1),zN=e=>Array.isArray(e)&&typeof e[0]!="number",LN={linear:yt,easeIn:AN,easeInOut:_1,easeOut:RN,circIn:Wh,circInOut:l1,circOut:o1,backIn:Hh,backInOut:i1,backOut:r1,anticipate:a1},hm=e=>{if(Bh(e)){Ny(e.length===4);const[t,n,s,i]=e;return ga(t,n,s,i)}else if(typeof e=="string")return LN[e];return e};function ON(e,t,n){const s=[],i=n||S1,a=e.length-1;for(let o=0;o<a;o++){let l=i(e[o],e[o+1]);if(t){const c=Array.isArray(t)?t[o]||yt:t;l=xa(c,l)}s.push(l)}return s}function DN(e,t,{clamp:n=!0,ease:s,mixer:i}={}){const a=e.length;if(Ny(a===t.length),a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];const o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());const l=ON(t,s,i),c=l.length,u=d=>{if(o&&d<e[0])return t[0];let p=0;if(c>1)for(;p<e.length-2&&!(d<e[p+1]);p++);const f=Lr(e[p],e[p+1],d);return l[p](f)};return n?d=>u(_n(e[0],e[a-1],d)):u}function IN(e,t){const n=e[e.length-1];for(let s=1;s<=t;s++){const i=Lr(0,t,s);e.push(je(n,1,i))}}function BN(e){const t=[0];return IN(t,e.length-1),t}function FN(e,t){return e.map(n=>n*t)}function VN(e,t){return e.map(()=>t||_1).splice(0,e.length-1)}function tl({duration:e=300,keyframes:t,times:n,ease:s="easeInOut"}){const i=zN(s)?s.map(hm):hm(s),a={done:!1,value:t[0]},o=FN(n&&n.length===t.length?n:BN(t),e),l=DN(o,t,{ease:Array.isArray(i)?i:VN(t,i)});return{calculatedDuration:e,next:c=>(a.value=l(c),a.done=c>=e,a)}}const $N=e=>{const t=({timestamp:n})=>e(n);return{start:()=>ve.update(t,!0),stop:()=>rs(t),now:()=>Ue.isProcessing?Ue.timestamp:cn.now()}},UN={decay:dm,inertia:dm,tween:tl,keyframes:tl,spring:E1},HN=e=>e/100;class Qh extends j1{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:c}=this.options;c&&c()};const{name:n,motionValue:s,element:i,keyframes:a}=this.options,o=(i==null?void 0:i.KeyframeResolver)||Yh,l=(c,u)=>this.onKeyframesResolved(c,u);this.resolver=new o(a,l,n,s,i),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:n="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:a,velocity:o=0}=this.options,l=Ih(n)?n:UN[n]||tl;let c,u;l!==tl&&typeof t[0]!="number"&&(c=xa(HN,S1(t[0],t[1])),t=[0,100]);const d=l({...this.options,keyframes:t});a==="mirror"&&(u=l({...this.options,keyframes:[...t].reverse(),velocity:-o})),d.calculatedDuration===null&&(d.calculatedDuration=Wy(d));const{calculatedDuration:p}=d,f=p+i,m=f*(s+1)-i;return{generator:d,mirroredGenerator:u,mapPercentToKeyframes:c,calculatedDuration:p,resolvedDuration:f,totalDuration:m}}onPostResolved(){const{autoplay:t=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!t?this.pause():this.state=this.pendingPlayState}tick(t,n=!1){const{resolved:s}=this;if(!s){const{keyframes:E}=this.options;return{done:!0,value:E[E.length-1]}}const{finalKeyframe:i,generator:a,mirroredGenerator:o,mapPercentToKeyframes:l,keyframes:c,calculatedDuration:u,totalDuration:d,resolvedDuration:p}=s;if(this.startTime===null)return a.next(0);const{delay:f,repeat:m,repeatType:b,repeatDelay:y,onUpdate:v}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-d/this.speed,this.startTime)),n?this.currentTime=t:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const g=this.currentTime-f*(this.speed>=0?1:-1),x=this.speed>=0?g<0:g>d;this.currentTime=Math.max(g,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=d);let w=this.currentTime,j=a;if(m){const E=Math.min(this.currentTime,d)/p;let P=Math.floor(E),M=E%1;!M&&E>=1&&(M=1),M===1&&P--,P=Math.min(P,m+1),!!(P%2)&&(b==="reverse"?(M=1-M,y&&(M-=y/p)):b==="mirror"&&(j=o)),w=_n(0,1,M)*p}const k=x?{done:!1,value:c[0]}:j.next(w);l&&(k.value=l(k.value));let{done:N}=k;!x&&u!==null&&(N=this.speed>=0?this.currentTime>=d:this.currentTime<=0);const S=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&N);return S&&i!==void 0&&(k.value=Tl(c,this.options,i)),v&&v(k.value),S&&this.finish(),k}get duration(){const{resolved:t}=this;return t?jn(t.calculatedDuration):0}get time(){return jn(this.currentTime)}set time(t){t=kn(t),this.currentTime=t,this.holdTime!==null||this.speed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=jn(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=$N,onPlay:n,startTime:s}=this.options;this.driver||(this.driver=t(a=>this.tick(a))),n&&n();const i=this.driver.now();this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=i):this.startTime=s??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(t=this.currentTime)!==null&&t!==void 0?t:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}}const WN=new Set(["opacity","clipPath","filter","transform"]);function KN(e,t,n,{delay:s=0,duration:i=300,repeat:a=0,repeatType:o="loop",ease:l="easeInOut",times:c}={}){const u={[t]:n};c&&(u.offset=c);const d=qy(l,i);return Array.isArray(d)&&(u.easing=d),e.animate(u,{delay:s,duration:i,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:a+1,direction:o==="reverse"?"alternate":"normal"})}const GN=jh(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),nl=10,qN=2e4;function YN(e){return Ih(e.type)||e.type==="spring"||!Gy(e.ease)}function XN(e,t){const n=new Qh({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let s={done:!1,value:e[0]};const i=[];let a=0;for(;!s.done&&a<qN;)s=n.sample(a),i.push(s.value),a+=nl;return{times:void 0,keyframes:i,duration:a-nl,ease:"linear"}}const T1={anticipate:a1,backInOut:i1,circInOut:l1};function QN(e){return e in T1}class fm extends j1{constructor(t){super(t);const{name:n,motionValue:s,element:i,keyframes:a}=this.options;this.resolver=new k1(a,(o,l)=>this.onKeyframesResolved(o,l),n,s,i),this.resolver.scheduleResolve()}initPlayback(t,n){let{duration:s=300,times:i,ease:a,type:o,motionValue:l,name:c,startTime:u}=this.options;if(!l.owner||!l.owner.current)return!1;if(typeof a=="string"&&Zo()&&QN(a)&&(a=T1[a]),YN(this.options)){const{onComplete:p,onUpdate:f,motionValue:m,element:b,...y}=this.options,v=XN(t,y);t=v.keyframes,t.length===1&&(t[1]=t[0]),s=v.duration,i=v.times,a=v.ease,o="keyframes"}const d=KN(l.owner.current,c,t,{...this.options,duration:s,times:i,ease:a});return d.startTime=u??this.calcStartTime(),this.pendingTimeline?(Qp(d,this.pendingTimeline),this.pendingTimeline=void 0):d.onfinish=()=>{const{onComplete:p}=this.options;l.set(Tl(t,this.options,n)),p&&p(),this.cancel(),this.resolveFinishedPromise()},{animation:d,duration:s,times:i,type:o,ease:a,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:n}=t;return jn(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return jn(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:s}=n;s.currentTime=kn(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:n}=t;return n.playbackRate}set speed(t){const{resolved:n}=this;if(!n)return;const{animation:s}=n;s.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:n}=t;return n.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:n}=t;return n.startTime}attachTimeline(t){if(!this._resolved)this.pendingTimeline=t;else{const{resolved:n}=this;if(!n)return yt;const{animation:s}=n;Qp(s,t)}return yt}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.playState==="finished"&&this.updateFinishedPromise(),n.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:n,keyframes:s,duration:i,type:a,ease:o,times:l}=t;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:u,onUpdate:d,onComplete:p,element:f,...m}=this.options,b=new Qh({...m,keyframes:s,duration:i,type:a,ease:o,times:l,isGenerator:!0}),y=kn(this.time);u.setWithVelocity(b.sample(y-nl).value,b.sample(y).value,nl)}const{onStop:c}=this.options;c&&c(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:n,name:s,repeatDelay:i,repeatType:a,damping:o,type:l}=t;if(!n||!n.owner||!(n.owner.current instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:u}=n.owner.getProps();return GN()&&s&&WN.has(s)&&!c&&!u&&!i&&a!=="mirror"&&o!==0&&l!=="inertia"}}const JN={type:"spring",stiffness:500,damping:25,restSpeed:10},ZN=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),eS={type:"keyframes",duration:.8},tS={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},nS=(e,{keyframes:t})=>t.length>2?eS:Vs.has(e)?e.startsWith("scale")?ZN(t[1]):JN:tS;function sS({when:e,delay:t,delayChildren:n,staggerChildren:s,staggerDirection:i,repeat:a,repeatType:o,repeatDelay:l,from:c,elapsed:u,...d}){return!!Object.keys(d).length}const Jh=(e,t,n,s={},i,a)=>o=>{const l=Dh(s,e)||{},c=l.delay||s.delay||0;let{elapsed:u=0}=s;u=u-kn(c);let d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...l,delay:-u,onUpdate:f=>{t.set(f),l.onUpdate&&l.onUpdate(f)},onComplete:()=>{o(),l.onComplete&&l.onComplete()},name:e,motionValue:t,element:a?void 0:i};sS(l)||(d={...d,...nS(e,d)}),d.duration&&(d.duration=kn(d.duration)),d.repeatDelay&&(d.repeatDelay=kn(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let p=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(d.duration=0,d.delay===0&&(p=!0)),p&&!a&&t.get()!==void 0){const f=Tl(d.keyframes,l);if(f!==void 0)return ve.update(()=>{d.onUpdate(f),d.onComplete()}),new kj([])}return!a&&fm.supports(d)?new fm(d):new Qh(d)};function rS({protectedKeys:e,needsAnimating:t},n){const s=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,s}function P1(e,t,{delay:n=0,transitionOverride:s,type:i}={}){var a;let{transition:o=e.getDefaultTransition(),transitionEnd:l,...c}=t;s&&(o=s);const u=[],d=i&&e.animationState&&e.animationState.getState()[i];for(const p in c){const f=e.getValue(p,(a=e.latestValues[p])!==null&&a!==void 0?a:null),m=c[p];if(m===void 0||d&&rS(d,p))continue;const b={delay:n,...Dh(o||{},p)};let y=!1;if(window.MotionHandoffAnimation){const g=e1(e);if(g){const x=window.MotionHandoffAnimation(g,p,ve);x!==null&&(b.startTime=x,y=!0)}}Xu(e,p),f.start(Jh(p,f,m,e.shouldReduceMotion&&Jy.has(p)?{type:!1}:b,e,y));const v=f.animation;v&&u.push(v)}return l&&Promise.all(u).then(()=>{ve.update(()=>{l&&Oj(e,l)})}),u}function sd(e,t,n={}){var s;const i=_l(e,t,n.type==="exit"?(s=e.presenceContext)===null||s===void 0?void 0:s.custom:void 0);let{transition:a=e.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(a=n.transitionOverride);const o=i?()=>Promise.all(P1(e,i,n)):()=>Promise.resolve(),l=e.variantChildren&&e.variantChildren.size?(u=0)=>{const{delayChildren:d=0,staggerChildren:p,staggerDirection:f}=a;return iS(e,t,d+u,p,f,n)}:()=>Promise.resolve(),{when:c}=a;if(c){const[u,d]=c==="beforeChildren"?[o,l]:[l,o];return u().then(()=>d())}else return Promise.all([o(),l(n.delay)])}function iS(e,t,n=0,s=0,i=1,a){const o=[],l=(e.variantChildren.size-1)*s,c=i===1?(u=0)=>u*s:(u=0)=>l-u*s;return Array.from(e.variantChildren).sort(aS).forEach((u,d)=>{u.notify("AnimationStart",t),o.push(sd(u,t,{...a,delay:n+c(d)}).then(()=>u.notify("AnimationComplete",t)))}),Promise.all(o)}function aS(e,t){return e.sortNodePosition(t)}function oS(e,t,n={}){e.notify("AnimationStart",t);let s;if(Array.isArray(t)){const i=t.map(a=>sd(e,a,n));s=Promise.all(i)}else if(typeof t=="string")s=sd(e,t,n);else{const i=typeof t=="function"?_l(e,t,n.custom):t;s=Promise.all(P1(e,i,n))}return s.then(()=>{e.notify("AnimationComplete",t)})}const lS=Sh.length;function M1(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?M1(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<lS;n++){const s=Sh[n],i=e.props[s];(ea(i)||i===!1)&&(t[s]=i)}return t}const cS=[...Nh].reverse(),uS=Nh.length;function dS(e){return t=>Promise.all(t.map(({animation:n,options:s})=>oS(e,n,s)))}function hS(e){let t=dS(e),n=pm(),s=!0;const i=c=>(u,d)=>{var p;const f=_l(e,d,c==="exit"?(p=e.presenceContext)===null||p===void 0?void 0:p.custom:void 0);if(f){const{transition:m,transitionEnd:b,...y}=f;u={...u,...y,...b}}return u};function a(c){t=c(e)}function o(c){const{props:u}=e,d=M1(e.parent)||{},p=[],f=new Set;let m={},b=1/0;for(let v=0;v<uS;v++){const g=cS[v],x=n[g],w=u[g]!==void 0?u[g]:d[g],j=ea(w),k=g===c?x.isActive:null;k===!1&&(b=v);let N=w===d[g]&&w!==u[g]&&j;if(N&&s&&e.manuallyAnimateOnMount&&(N=!1),x.protectedKeys={...m},!x.isActive&&k===null||!w&&!x.prevProp||Cl(w)||typeof w=="boolean")continue;const S=fS(x.prevProp,w);let E=S||g===c&&x.isActive&&!N&&j||v>b&&j,P=!1;const M=Array.isArray(w)?w:[w];let T=M.reduce(i(g),{});k===!1&&(T={});const{prevResolvedValues:V={}}=x,R={...V,...T},I=B=>{E=!0,f.has(B)&&(P=!0,f.delete(B)),x.needsAnimating[B]=!0;const C=e.getValue(B);C&&(C.liveStyle=!1)};for(const B in R){const C=T[B],A=V[B];if(m.hasOwnProperty(B))continue;let _=!1;Gu(C)&&Gu(A)?_=!Hy(C,A):_=C!==A,_?C!=null?I(B):f.add(B):C!==void 0&&f.has(B)?I(B):x.protectedKeys[B]=!0}x.prevProp=w,x.prevResolvedValues=T,x.isActive&&(m={...m,...T}),s&&e.blockInitialAnimation&&(E=!1),E&&(!(N&&S)||P)&&p.push(...M.map(B=>({animation:B,options:{type:g}})))}if(f.size){const v={};f.forEach(g=>{const x=e.getBaseTarget(g),w=e.getValue(g);w&&(w.liveStyle=!0),v[g]=x??null}),p.push({animation:v})}let y=!!p.length;return s&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(y=!1),s=!1,y?t(p):Promise.resolve()}function l(c,u){var d;if(n[c].isActive===u)return Promise.resolve();(d=e.variantChildren)===null||d===void 0||d.forEach(f=>{var m;return(m=f.animationState)===null||m===void 0?void 0:m.setActive(c,u)}),n[c].isActive=u;const p=o(c);for(const f in n)n[f].protectedKeys={};return p}return{animateChanges:o,setActive:l,setAnimateFunction:a,getState:()=>n,reset:()=>{n=pm(),s=!0}}}function fS(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Hy(t,e):!1}function xs(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function pm(){return{animate:xs(!0),whileInView:xs(),whileHover:xs(),whileTap:xs(),whileDrag:xs(),whileFocus:xs(),exit:xs()}}class fs{constructor(t){this.isMounted=!1,this.node=t}update(){}}class pS extends fs{constructor(t){super(t),t.animationState||(t.animationState=hS(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Cl(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)===null||t===void 0||t.call(this)}}let mS=0;class gS extends fs{constructor(){super(...arguments),this.id=mS++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:s}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===s)return;const i=this.node.animationState.setActive("exit",!t);n&&!t&&i.then(()=>n(this.id))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}const xS={animation:{Feature:pS},exit:{Feature:gS}};function ra(e,t,n,s={passive:!0}){return e.addEventListener(t,n,s),()=>e.removeEventListener(t,n)}function ya(e){return{point:{x:e.pageX,y:e.pageY}}}const yS=e=>t=>Fh(t)&&e(t,ya(t));function Ti(e,t,n,s){return ra(e,t,yS(n),s)}const mm=(e,t)=>Math.abs(e-t);function vS(e,t){const n=mm(e.x,t.x),s=mm(e.y,t.y);return Math.sqrt(n**2+s**2)}class A1{constructor(t,n,{transformPagePoint:s,contextWindow:i,dragSnapToOrigin:a=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const p=Sc(this.lastMoveEventInfo,this.history),f=this.startEvent!==null,m=vS(p.offset,{x:0,y:0})>=3;if(!f&&!m)return;const{point:b}=p,{timestamp:y}=Ue;this.history.push({...b,timestamp:y});const{onStart:v,onMove:g}=this.handlers;f||(v&&v(this.lastMoveEvent,p),this.startEvent=this.lastMoveEvent),g&&g(this.lastMoveEvent,p)},this.handlePointerMove=(p,f)=>{this.lastMoveEvent=p,this.lastMoveEventInfo=Nc(f,this.transformPagePoint),ve.update(this.updatePoint,!0)},this.handlePointerUp=(p,f)=>{this.end();const{onEnd:m,onSessionEnd:b,resumeAnimation:y}=this.handlers;if(this.dragSnapToOrigin&&y&&y(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const v=Sc(p.type==="pointercancel"?this.lastMoveEventInfo:Nc(f,this.transformPagePoint),this.history);this.startEvent&&m&&m(p,v),b&&b(p,v)},!Fh(t))return;this.dragSnapToOrigin=a,this.handlers=n,this.transformPagePoint=s,this.contextWindow=i||window;const o=ya(t),l=Nc(o,this.transformPagePoint),{point:c}=l,{timestamp:u}=Ue;this.history=[{...c,timestamp:u}];const{onSessionStart:d}=n;d&&d(t,Sc(l,this.history)),this.removeListeners=xa(Ti(this.contextWindow,"pointermove",this.handlePointerMove),Ti(this.contextWindow,"pointerup",this.handlePointerUp),Ti(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),rs(this.updatePoint)}}function Nc(e,t){return t?{point:t(e.point)}:e}function gm(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Sc({point:e},t){return{point:e,delta:gm(e,R1(t)),offset:gm(e,bS(t)),velocity:wS(t,.1)}}function bS(e){return e[0]}function R1(e){return e[e.length-1]}function wS(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,s=null;const i=R1(e);for(;n>=0&&(s=e[n],!(i.timestamp-s.timestamp>kn(t)));)n--;if(!s)return{x:0,y:0};const a=jn(i.timestamp-s.timestamp);if(a===0)return{x:0,y:0};const o={x:(i.x-s.x)/a,y:(i.y-s.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}const z1=1e-4,kS=1-z1,jS=1+z1,L1=.01,NS=0-L1,SS=0+L1;function bt(e){return e.max-e.min}function CS(e,t,n){return Math.abs(e-t)<=n}function xm(e,t,n,s=.5){e.origin=s,e.originPoint=je(t.min,t.max,e.origin),e.scale=bt(n)/bt(t),e.translate=je(n.min,n.max,e.origin)-e.originPoint,(e.scale>=kS&&e.scale<=jS||isNaN(e.scale))&&(e.scale=1),(e.translate>=NS&&e.translate<=SS||isNaN(e.translate))&&(e.translate=0)}function Pi(e,t,n,s){xm(e.x,t.x,n.x,s?s.originX:void 0),xm(e.y,t.y,n.y,s?s.originY:void 0)}function ym(e,t,n){e.min=n.min+t.min,e.max=e.min+bt(t)}function ES(e,t,n){ym(e.x,t.x,n.x),ym(e.y,t.y,n.y)}function vm(e,t,n){e.min=t.min-n.min,e.max=e.min+bt(t)}function Mi(e,t,n){vm(e.x,t.x,n.x),vm(e.y,t.y,n.y)}function _S(e,{min:t,max:n},s){return t!==void 0&&e<t?e=s?je(t,e,s.min):Math.max(e,t):n!==void 0&&e>n&&(e=s?je(n,e,s.max):Math.min(e,n)),e}function bm(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function TS(e,{top:t,left:n,bottom:s,right:i}){return{x:bm(e.x,n,i),y:bm(e.y,t,s)}}function wm(e,t){let n=t.min-e.min,s=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,s]=[s,n]),{min:n,max:s}}function PS(e,t){return{x:wm(e.x,t.x),y:wm(e.y,t.y)}}function MS(e,t){let n=.5;const s=bt(e),i=bt(t);return i>s?n=Lr(t.min,t.max-s,e.min):s>i&&(n=Lr(e.min,e.max-i,t.min)),_n(0,1,n)}function AS(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const rd=.35;function RS(e=rd){return e===!1?e=0:e===!0&&(e=rd),{x:km(e,"left","right"),y:km(e,"top","bottom")}}function km(e,t,n){return{min:jm(e,t),max:jm(e,n)}}function jm(e,t){return typeof e=="number"?e:e[t]||0}const Nm=()=>({translate:0,scale:1,origin:0,originPoint:0}),xr=()=>({x:Nm(),y:Nm()}),Sm=()=>({min:0,max:0}),Te=()=>({x:Sm(),y:Sm()});function St(e){return[e("x"),e("y")]}function O1({top:e,left:t,right:n,bottom:s}){return{x:{min:t,max:n},y:{min:e,max:s}}}function zS({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function LS(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),s=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:s.y,right:s.x}}function Cc(e){return e===void 0||e===1}function id({scale:e,scaleX:t,scaleY:n}){return!Cc(e)||!Cc(t)||!Cc(n)}function ws(e){return id(e)||D1(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function D1(e){return Cm(e.x)||Cm(e.y)}function Cm(e){return e&&e!=="0%"}function sl(e,t,n){const s=e-n,i=t*s;return n+i}function Em(e,t,n,s,i){return i!==void 0&&(e=sl(e,i,s)),sl(e,n,s)+t}function ad(e,t=0,n=1,s,i){e.min=Em(e.min,t,n,s,i),e.max=Em(e.max,t,n,s,i)}function I1(e,{x:t,y:n}){ad(e.x,t.translate,t.scale,t.originPoint),ad(e.y,n.translate,n.scale,n.originPoint)}const _m=.999999999999,Tm=1.0000000000001;function OS(e,t,n,s=!1){const i=n.length;if(!i)return;t.x=t.y=1;let a,o;for(let l=0;l<i;l++){a=n[l],o=a.projectionDelta;const{visualElement:c}=a.options;c&&c.props.style&&c.props.style.display==="contents"||(s&&a.options.layoutScroll&&a.scroll&&a!==a.root&&vr(e,{x:-a.scroll.offset.x,y:-a.scroll.offset.y}),o&&(t.x*=o.x.scale,t.y*=o.y.scale,I1(e,o)),s&&ws(a.latestValues)&&vr(e,a.latestValues))}t.x<Tm&&t.x>_m&&(t.x=1),t.y<Tm&&t.y>_m&&(t.y=1)}function yr(e,t){e.min=e.min+t,e.max=e.max+t}function Pm(e,t,n,s,i=.5){const a=je(e.min,e.max,i);ad(e,t,n,a,s)}function vr(e,t){Pm(e.x,t.x,t.scaleX,t.scale,t.originX),Pm(e.y,t.y,t.scaleY,t.scale,t.originY)}function B1(e,t){return O1(LS(e.getBoundingClientRect(),t))}function DS(e,t,n){const s=B1(e,n),{scroll:i}=t;return i&&(yr(s.x,i.offset.x),yr(s.y,i.offset.y)),s}const F1=({current:e})=>e?e.ownerDocument.defaultView:null,IS=new WeakMap;class BS{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Te(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const i=d=>{const{dragSnapToOrigin:p}=this.getProps();p?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(ya(d).point)},a=(d,p)=>{const{drag:f,dragPropagation:m,onDragStart:b}=this.getProps();if(f&&!m&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Mj(f),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),St(v=>{let g=this.getAxisMotionValue(v).get()||0;if(ln.test(g)){const{projection:x}=this.visualElement;if(x&&x.layout){const w=x.layout.layoutBox[v];w&&(g=bt(w)*(parseFloat(g)/100))}}this.originPoint[v]=g}),b&&ve.postRender(()=>b(d,p)),Xu(this.visualElement,"transform");const{animationState:y}=this.visualElement;y&&y.setActive("whileDrag",!0)},o=(d,p)=>{const{dragPropagation:f,dragDirectionLock:m,onDirectionLock:b,onDrag:y}=this.getProps();if(!f&&!this.openDragLock)return;const{offset:v}=p;if(m&&this.currentDirection===null){this.currentDirection=FS(v),this.currentDirection!==null&&b&&b(this.currentDirection);return}this.updateAxis("x",p.point,v),this.updateAxis("y",p.point,v),this.visualElement.render(),y&&y(d,p)},l=(d,p)=>this.stop(d,p),c=()=>St(d=>{var p;return this.getAnimationState(d)==="paused"&&((p=this.getAxisMotionValue(d).animation)===null||p===void 0?void 0:p.play())}),{dragSnapToOrigin:u}=this.getProps();this.panSession=new A1(t,{onSessionStart:i,onStart:a,onMove:o,onSessionEnd:l,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,contextWindow:F1(this.visualElement)})}stop(t,n){const s=this.isDragging;if(this.cancel(),!s)return;const{velocity:i}=n;this.startAnimation(i);const{onDragEnd:a}=this.getProps();a&&ve.postRender(()=>a(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:s}=this.getProps();!s&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,s){const{drag:i}=this.getProps();if(!s||!Wa(t,i,this.currentDirection))return;const a=this.getAxisMotionValue(t);let o=this.originPoint[t]+s[t];this.constraints&&this.constraints[t]&&(o=_S(o,this.constraints[t],this.elastic[t])),a.set(o)}resolveConstraints(){var t;const{dragConstraints:n,dragElastic:s}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(t=this.visualElement.projection)===null||t===void 0?void 0:t.layout,a=this.constraints;n&&mr(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&i?this.constraints=TS(i.layoutBox,n):this.constraints=!1,this.elastic=RS(s),a!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&St(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=AS(i.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!mr(t))return!1;const s=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const a=DS(s,i.root,this.visualElement.getTransformPagePoint());let o=PS(i.layout.layoutBox,a);if(n){const l=n(zS(o));this.hasMutatedConstraints=!!l,l&&(o=O1(l))}return o}startAnimation(t){const{drag:n,dragMomentum:s,dragElastic:i,dragTransition:a,dragSnapToOrigin:o,onDragTransitionEnd:l}=this.getProps(),c=this.constraints||{},u=St(d=>{if(!Wa(d,n,this.currentDirection))return;let p=c&&c[d]||{};o&&(p={min:0,max:0});const f=i?200:1e6,m=i?40:1e7,b={type:"inertia",velocity:s?t[d]:0,bounceStiffness:f,bounceDamping:m,timeConstant:750,restDelta:1,restSpeed:10,...a,...p};return this.startAxisValueAnimation(d,b)});return Promise.all(u).then(l)}startAxisValueAnimation(t,n){const s=this.getAxisMotionValue(t);return Xu(this.visualElement,t),s.start(Jh(t,s,0,n,this.visualElement,!1))}stopAnimation(){St(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){St(t=>{var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,s=this.visualElement.getProps(),i=s[n];return i||this.visualElement.getValue(t,(s.initial?s.initial[t]:void 0)||0)}snapToCursor(t){St(n=>{const{drag:s}=this.getProps();if(!Wa(n,s,this.currentDirection))return;const{projection:i}=this.visualElement,a=this.getAxisMotionValue(n);if(i&&i.layout){const{min:o,max:l}=i.layout.layoutBox[n];a.set(t[n]-je(o,l,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:s}=this.visualElement;if(!mr(n)||!s||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};St(o=>{const l=this.getAxisMotionValue(o);if(l&&this.constraints!==!1){const c=l.get();i[o]=MS({min:c,max:c},this.constraints[o])}});const{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},""):"none",s.root&&s.root.updateScroll(),s.updateLayout(),this.resolveConstraints(),St(o=>{if(!Wa(o,t,null))return;const l=this.getAxisMotionValue(o),{min:c,max:u}=this.constraints[o];l.set(je(c,u,i[o]))})}addListeners(){if(!this.visualElement.current)return;IS.set(this.visualElement,this);const t=this.visualElement.current,n=Ti(t,"pointerdown",c=>{const{drag:u,dragListener:d=!0}=this.getProps();u&&d&&this.start(c)}),s=()=>{const{dragConstraints:c}=this.getProps();mr(c)&&c.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,a=i.addEventListener("measure",s);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),ve.read(s);const o=ra(window,"resize",()=>this.scalePositionWithinConstraints()),l=i.addEventListener("didUpdate",({delta:c,hasLayoutChanged:u})=>{this.isDragging&&u&&(St(d=>{const p=this.getAxisMotionValue(d);p&&(this.originPoint[d]+=c[d].translate,p.set(p.get()+c[d].translate))}),this.visualElement.render())});return()=>{o(),n(),a(),l&&l()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:s=!1,dragPropagation:i=!1,dragConstraints:a=!1,dragElastic:o=rd,dragMomentum:l=!0}=t;return{...t,drag:n,dragDirectionLock:s,dragPropagation:i,dragConstraints:a,dragElastic:o,dragMomentum:l}}}function Wa(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function FS(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class VS extends fs{constructor(t){super(t),this.removeGroupControls=yt,this.removeListeners=yt,this.controls=new BS(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||yt}unmount(){this.removeGroupControls(),this.removeListeners()}}const Mm=e=>(t,n)=>{e&&ve.postRender(()=>e(t,n))};class $S extends fs{constructor(){super(...arguments),this.removePointerDownListener=yt}onPointerDown(t){this.session=new A1(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:F1(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:s,onPanEnd:i}=this.node.getProps();return{onSessionStart:Mm(t),onStart:Mm(n),onMove:s,onEnd:(a,o)=>{delete this.session,i&&ve.postRender(()=>i(a,o))}}}mount(){this.removePointerDownListener=Ti(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const yo={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Am(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const ai={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(X.test(e))e=parseFloat(e);else return e;const n=Am(e,t.target.x),s=Am(e,t.target.y);return`${n}% ${s}%`}},US={correct:(e,{treeScale:t,projectionDelta:n})=>{const s=e,i=is.parse(e);if(i.length>5)return s;const a=is.createTransformer(e),o=typeof i[0]!="number"?1:0,l=n.x.scale*t.x,c=n.y.scale*t.y;i[0+o]/=l,i[1+o]/=c;const u=je(l,c,.5);return typeof i[2+o]=="number"&&(i[2+o]/=u),typeof i[3+o]=="number"&&(i[3+o]/=u),a(i)}};class HS extends h.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:s,layoutId:i}=this.props,{projection:a}=t;uj(WS),a&&(n.group&&n.group.add(a),s&&s.register&&i&&s.register(a),a.root.didUpdate(),a.addEventListener("animationComplete",()=>{this.safeToRemove()}),a.setOptions({...a.options,onExitComplete:()=>this.safeToRemove()})),yo.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:s,drag:i,isPresent:a}=this.props,o=s.projection;return o&&(o.isPresent=a,i||t.layoutDependency!==n||n===void 0?o.willUpdate():this.safeToRemove(),t.isPresent!==a&&(a?o.promote():o.relegate()||ve.postRender(()=>{const l=o.getStack();(!l||!l.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),Eh.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:s}=this.props,{projection:i}=t;i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),s&&s.deregister&&s.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function V1(e){const[t,n]=ky(),s=h.useContext(wh);return r.jsx(HS,{...e,layoutGroup:s,switchLayoutGroup:h.useContext(My),isPresent:t,safeToRemove:n})}const WS={borderRadius:{...ai,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:ai,borderTopRightRadius:ai,borderBottomLeftRadius:ai,borderBottomRightRadius:ai,boxShadow:US};function KS(e,t,n){const s=Je(e)?e:na(e);return s.start(Jh("",s,t,n)),s.animation}function GS(e){return e instanceof SVGElement&&e.tagName!=="svg"}const qS=(e,t)=>e.depth-t.depth;class YS{constructor(){this.children=[],this.isDirty=!1}add(t){Vh(this.children,t),this.isDirty=!0}remove(t){$h(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(qS),this.isDirty=!1,this.children.forEach(t)}}function XS(e,t){const n=cn.now(),s=({timestamp:i})=>{const a=i-n;a>=t&&(rs(s),e(a-t))};return ve.read(s,!0),()=>rs(s)}const $1=["TopLeft","TopRight","BottomLeft","BottomRight"],QS=$1.length,Rm=e=>typeof e=="string"?parseFloat(e):e,zm=e=>typeof e=="number"||X.test(e);function JS(e,t,n,s,i,a){i?(e.opacity=je(0,n.opacity!==void 0?n.opacity:1,ZS(s)),e.opacityExit=je(t.opacity!==void 0?t.opacity:1,0,e4(s))):a&&(e.opacity=je(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,s));for(let o=0;o<QS;o++){const l=`border${$1[o]}Radius`;let c=Lm(t,l),u=Lm(n,l);if(c===void 0&&u===void 0)continue;c||(c=0),u||(u=0),c===0||u===0||zm(c)===zm(u)?(e[l]=Math.max(je(Rm(c),Rm(u),s),0),(ln.test(u)||ln.test(c))&&(e[l]+="%")):e[l]=u}(t.rotate||n.rotate)&&(e.rotate=je(t.rotate||0,n.rotate||0,s))}function Lm(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const ZS=U1(0,.5,o1),e4=U1(.5,.95,yt);function U1(e,t,n){return s=>s<e?0:s>t?1:n(Lr(e,t,s))}function Om(e,t){e.min=t.min,e.max=t.max}function Nt(e,t){Om(e.x,t.x),Om(e.y,t.y)}function Dm(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function Im(e,t,n,s,i){return e-=t,e=sl(e,1/n,s),i!==void 0&&(e=sl(e,1/i,s)),e}function t4(e,t=0,n=1,s=.5,i,a=e,o=e){if(ln.test(t)&&(t=parseFloat(t),t=je(o.min,o.max,t/100)-o.min),typeof t!="number")return;let l=je(a.min,a.max,s);e===a&&(l-=t),e.min=Im(e.min,t,n,l,i),e.max=Im(e.max,t,n,l,i)}function Bm(e,t,[n,s,i],a,o){t4(e,t[n],t[s],t[i],t.scale,a,o)}const n4=["x","scaleX","originX"],s4=["y","scaleY","originY"];function Fm(e,t,n,s){Bm(e.x,t,n4,n?n.x:void 0,s?s.x:void 0),Bm(e.y,t,s4,n?n.y:void 0,s?s.y:void 0)}function Vm(e){return e.translate===0&&e.scale===1}function H1(e){return Vm(e.x)&&Vm(e.y)}function $m(e,t){return e.min===t.min&&e.max===t.max}function r4(e,t){return $m(e.x,t.x)&&$m(e.y,t.y)}function Um(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function W1(e,t){return Um(e.x,t.x)&&Um(e.y,t.y)}function Hm(e){return bt(e.x)/bt(e.y)}function Wm(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class i4{constructor(){this.members=[]}add(t){Vh(this.members,t),t.scheduleRender()}remove(t){if($h(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(i=>t===i);if(n===0)return!1;let s;for(let i=n;i>=0;i--){const a=this.members[i];if(a.isPresent!==!1){s=a;break}}return s?(this.promote(s),!0):!1}promote(t,n){const s=this.lead;if(t!==s&&(this.prevLead=s,this.lead=t,t.show(),s)){s.instance&&s.scheduleRender(),t.scheduleRender(),t.resumeFrom=s,n&&(t.resumeFrom.preserveOpacity=!0),s.snapshot&&(t.snapshot=s.snapshot,t.snapshot.latestValues=s.animationValues||s.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:i}=t.options;i===!1&&s.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:s}=t;n.onExitComplete&&n.onExitComplete(),s&&s.options.onExitComplete&&s.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function a4(e,t,n){let s="";const i=e.x.translate/t.x,a=e.y.translate/t.y,o=(n==null?void 0:n.z)||0;if((i||a||o)&&(s=`translate3d(${i}px, ${a}px, ${o}px) `),(t.x!==1||t.y!==1)&&(s+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:u,rotate:d,rotateX:p,rotateY:f,skewX:m,skewY:b}=n;u&&(s=`perspective(${u}px) ${s}`),d&&(s+=`rotate(${d}deg) `),p&&(s+=`rotateX(${p}deg) `),f&&(s+=`rotateY(${f}deg) `),m&&(s+=`skewX(${m}deg) `),b&&(s+=`skewY(${b}deg) `)}const l=e.x.scale*t.x,c=e.y.scale*t.y;return(l!==1||c!==1)&&(s+=`scale(${l}, ${c})`),s||"none"}const ks={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},mi=typeof window<"u"&&window.MotionDebug!==void 0,Ec=["","X","Y","Z"],o4={visibility:"hidden"},Km=1e3;let l4=0;function _c(e,t,n,s){const{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),s&&(s[e]=0))}function K1(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=e1(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:a}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",ve,!(i||a))}const{parent:s}=e;s&&!s.hasCheckedOptimisedAppear&&K1(s)}function G1({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:s,resetTransform:i}){return class{constructor(o={},l=t==null?void 0:t()){this.id=l4++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,mi&&(ks.totalNodes=ks.resolvedTargetDeltas=ks.recalculatedProjection=0),this.nodes.forEach(d4),this.nodes.forEach(g4),this.nodes.forEach(x4),this.nodes.forEach(h4),mi&&window.MotionDebug.record(ks)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=l?l.root||l:this,this.path=l?[...l.path,l]:[],this.parent=l,this.depth=l?l.depth+1:0;for(let c=0;c<this.path.length;c++)this.path[c].shouldResetTransform=!0;this.root===this&&(this.nodes=new YS)}addEventListener(o,l){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new Uh),this.eventHandlers.get(o).add(l)}notifyListeners(o,...l){const c=this.eventHandlers.get(o);c&&c.notify(...l)}hasListeners(o){return this.eventHandlers.has(o)}mount(o,l=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=GS(o),this.instance=o;const{layoutId:c,layout:u,visualElement:d}=this.options;if(d&&!d.current&&d.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),l&&(u||c)&&(this.isLayoutDirty=!0),e){let p;const f=()=>this.root.updateBlockedByResize=!1;e(o,()=>{this.root.updateBlockedByResize=!0,p&&p(),p=XS(f,250),yo.hasAnimatedSinceResize&&(yo.hasAnimatedSinceResize=!1,this.nodes.forEach(qm))})}c&&this.root.registerSharedNode(c,this),this.options.animate!==!1&&d&&(c||u)&&this.addEventListener("didUpdate",({delta:p,hasLayoutChanged:f,hasRelativeTargetChanged:m,layout:b})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const y=this.options.transition||d.getDefaultTransition()||k4,{onLayoutAnimationStart:v,onLayoutAnimationComplete:g}=d.getProps(),x=!this.targetLayout||!W1(this.targetLayout,b)||m,w=!f&&m;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||w||f&&(x||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(p,w);const j={...Dh(y,"layout"),onPlay:v,onComplete:g};(d.shouldReduceMotion||this.options.layoutRoot)&&(j.delay=0,j.type=!1),this.startAnimation(j)}else f||qm(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=b})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,rs(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(y4),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&K1(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d<this.path.length;d++){const p=this.path[d];p.shouldResetTransform=!0,p.updateScroll("snapshot"),p.options.layoutRoot&&p.willUpdate(!1)}const{layoutId:l,layout:c}=this.options;if(l===void 0&&!c)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(Gm);return}this.isUpdating||this.nodes.forEach(p4),this.isUpdating=!1,this.nodes.forEach(m4),this.nodes.forEach(c4),this.nodes.forEach(u4),this.clearAllSnapshots();const l=cn.now();Ue.delta=_n(0,1e3/60,l-Ue.timestamp),Ue.timestamp=l,Ue.isProcessing=!0,yc.update.process(Ue),yc.preRender.process(Ue),yc.render.process(Ue),Ue.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Eh.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(f4),this.sharedNodes.forEach(v4)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,ve.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){ve.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c<this.path.length;c++)this.path[c].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutCorrected=Te(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:l}=this.options;l&&l.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let l=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(l=!1),l){const c=s(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:c,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:c}}}resetTransform(){if(!i)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,l=this.projectionDelta&&!H1(this.projectionDelta),c=this.getTransformTemplate(),u=c?c(this.latestValues,""):void 0,d=u!==this.prevTransformTemplateValue;o&&(l||ws(this.latestValues)||d)&&(i(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const l=this.measurePageBox();let c=this.removeElementScroll(l);return o&&(c=this.removeTransform(c)),j4(c),{animationId:this.root.animationId,measuredBox:l,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){var o;const{visualElement:l}=this.options;if(!l)return Te();const c=l.measureViewportBox();if(!(((o=this.scroll)===null||o===void 0?void 0:o.wasRoot)||this.path.some(N4))){const{scroll:d}=this.root;d&&(yr(c.x,d.offset.x),yr(c.y,d.offset.y))}return c}removeElementScroll(o){var l;const c=Te();if(Nt(c,o),!((l=this.scroll)===null||l===void 0)&&l.wasRoot)return c;for(let u=0;u<this.path.length;u++){const d=this.path[u],{scroll:p,options:f}=d;d!==this.root&&p&&f.layoutScroll&&(p.wasRoot&&Nt(c,o),yr(c.x,p.offset.x),yr(c.y,p.offset.y))}return c}applyTransform(o,l=!1){const c=Te();Nt(c,o);for(let u=0;u<this.path.length;u++){const d=this.path[u];!l&&d.options.layoutScroll&&d.scroll&&d!==d.root&&vr(c,{x:-d.scroll.offset.x,y:-d.scroll.offset.y}),ws(d.latestValues)&&vr(c,d.latestValues)}return ws(this.latestValues)&&vr(c,this.latestValues),c}removeTransform(o){const l=Te();Nt(l,o);for(let c=0;c<this.path.length;c++){const u=this.path[c];if(!u.instance||!ws(u.latestValues))continue;id(u.latestValues)&&u.updateSnapshot();const d=Te(),p=u.measurePageBox();Nt(d,p),Fm(l,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,d)}return ws(this.latestValues)&&Fm(l,this.latestValues),l}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Ue.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var l;const c=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=c.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=c.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=c.isSharedProjectionDirty);const u=!!this.resumingFrom||this!==c;if(!(o||u&&this.isSharedProjectionDirty||this.isProjectionDirty||!((l=this.parent)===null||l===void 0)&&l.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:p,layoutId:f}=this.options;if(!(!this.layout||!(p||f))){if(this.resolvedRelativeTargetAt=Ue.timestamp,!this.targetDelta&&!this.relativeTarget){const m=this.getClosestProjectingParent();m&&m.layout&&this.animationProgress!==1?(this.relativeParent=m,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Te(),this.relativeTargetOrigin=Te(),Mi(this.relativeTargetOrigin,this.layout.layoutBox,m.layout.layoutBox),Nt(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=Te(),this.targetWithTransforms=Te()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),ES(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Nt(this.target,this.layout.layoutBox),I1(this.target,this.targetDelta)):Nt(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const m=this.getClosestProjectingParent();m&&!!m.resumingFrom==!!this.resumingFrom&&!m.options.layoutScroll&&m.target&&this.animationProgress!==1?(this.relativeParent=m,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Te(),this.relativeTargetOrigin=Te(),Mi(this.relativeTargetOrigin,this.target,m.target),Nt(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}mi&&ks.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||id(this.parent.latestValues)||D1(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var o;const l=this.getLead(),c=!!this.resumingFrom||this!==l;let u=!0;if((this.isProjectionDirty||!((o=this.parent)===null||o===void 0)&&o.isProjectionDirty)&&(u=!1),c&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(u=!1),this.resolvedRelativeTargetAt===Ue.timestamp&&(u=!1),u)return;const{layout:d,layoutId:p}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(d||p))return;Nt(this.layoutCorrected,this.layout.layoutBox);const f=this.treeScale.x,m=this.treeScale.y;OS(this.layoutCorrected,this.treeScale,this.path,c),l.layout&&!l.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(l.target=l.layout.layoutBox,l.targetWithTransforms=Te());const{target:b}=l;if(!b){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Dm(this.prevProjectionDelta.x,this.projectionDelta.x),Dm(this.prevProjectionDelta.y,this.projectionDelta.y)),Pi(this.projectionDelta,this.layoutCorrected,b,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==m||!Wm(this.projectionDelta.x,this.prevProjectionDelta.x)||!Wm(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",b)),mi&&ks.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var l;if((l=this.options.visualElement)===null||l===void 0||l.scheduleRender(),o){const c=this.getStack();c&&c.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=xr(),this.projectionDelta=xr(),this.projectionDeltaWithTransform=xr()}setAnimationOrigin(o,l=!1){const c=this.snapshot,u=c?c.latestValues:{},d={...this.latestValues},p=xr();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!l;const f=Te(),m=c?c.source:void 0,b=this.layout?this.layout.source:void 0,y=m!==b,v=this.getStack(),g=!v||v.members.length<=1,x=!!(y&&!g&&this.options.crossfade===!0&&!this.path.some(w4));this.animationProgress=0;let w;this.mixTargetDelta=j=>{const k=j/1e3;Ym(p.x,o.x,k),Ym(p.y,o.y,k),this.setTargetDelta(p),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Mi(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),b4(this.relativeTarget,this.relativeTargetOrigin,f,k),w&&r4(this.relativeTarget,w)&&(this.isProjectionDirty=!1),w||(w=Te()),Nt(w,this.relativeTarget)),y&&(this.animationValues=d,JS(d,u,this.latestValues,k,x,g)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=k},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(rs(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=ve.update(()=>{yo.hasAnimatedSinceResize=!0,this.currentAnimation=KS(0,Km,{...o,onUpdate:l=>{this.mixTargetDelta(l),o.onUpdate&&o.onUpdate(l)},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Km),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:l,target:c,layout:u,latestValues:d}=o;if(!(!l||!c||!u)){if(this!==o&&this.layout&&u&&q1(this.options.animationType,this.layout.layoutBox,u.layoutBox)){c=this.target||Te();const p=bt(this.layout.layoutBox.x);c.x.min=o.target.x.min,c.x.max=c.x.min+p;const f=bt(this.layout.layoutBox.y);c.y.min=o.target.y.min,c.y.max=c.y.min+f}Nt(l,c),vr(l,d),Pi(this.projectionDeltaWithTransform,this.layoutCorrected,l,d)}}registerSharedNode(o,l){this.sharedNodes.has(o)||this.sharedNodes.set(o,new i4),this.sharedNodes.get(o).add(l);const u=l.options.initialPromotionConfig;l.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(l):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var o;const{layoutId:l}=this.options;return l?((o=this.getStack())===null||o===void 0?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:l}=this.options;return l?(o=this.getStack())===null||o===void 0?void 0:o.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:l,preserveFollowOpacity:c}={}){const u=this.getStack();u&&u.promote(this,c),o&&(this.projectionDelta=void 0,this.needsReset=!0),l&&this.setOptions({transition:l})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let l=!1;const{latestValues:c}=o;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(l=!0),!l)return;const u={};c.z&&_c("z",o,u,this.animationValues);for(let d=0;d<Ec.length;d++)_c(`rotate${Ec[d]}`,o,u,this.animationValues),_c(`skew${Ec[d]}`,o,u,this.animationValues);o.render();for(const d in u)o.setStaticValue(d,u[d]),this.animationValues&&(this.animationValues[d]=u[d]);o.scheduleRender()}getProjectionStyles(o){var l,c;if(!this.instance||this.isSVG)return;if(!this.isVisible)return o4;const u={visibility:""},d=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,u.opacity="",u.pointerEvents=go(o==null?void 0:o.pointerEvents)||"",u.transform=d?d(this.latestValues,""):"none",u;const p=this.getLead();if(!this.projectionDelta||!this.layout||!p.target){const y={};return this.options.layoutId&&(y.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,y.pointerEvents=go(o==null?void 0:o.pointerEvents)||""),this.hasProjected&&!ws(this.latestValues)&&(y.transform=d?d({},""):"none",this.hasProjected=!1),y}const f=p.animationValues||p.latestValues;this.applyTransformsToTarget(),u.transform=a4(this.projectionDeltaWithTransform,this.treeScale,f),d&&(u.transform=d(f,u.transform));const{x:m,y:b}=this.projectionDelta;u.transformOrigin=`${m.origin*100}% ${b.origin*100}% 0`,p.animationValues?u.opacity=p===this?(c=(l=f.opacity)!==null&&l!==void 0?l:this.latestValues.opacity)!==null&&c!==void 0?c:1:this.preserveOpacity?this.latestValues.opacity:f.opacityExit:u.opacity=p===this?f.opacity!==void 0?f.opacity:"":f.opacityExit!==void 0?f.opacityExit:0;for(const y in Jo){if(f[y]===void 0)continue;const{correct:v,applyTo:g}=Jo[y],x=u.transform==="none"?f[y]:v(f[y],p);if(g){const w=g.length;for(let j=0;j<w;j++)u[g[j]]=x}else u[y]=x}return this.options.layoutId&&(u.pointerEvents=p===this?go(o==null?void 0:o.pointerEvents)||"":"none"),u}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var l;return(l=o.currentAnimation)===null||l===void 0?void 0:l.stop()}),this.root.nodes.forEach(Gm),this.root.sharedNodes.clear()}}}function c4(e){e.updateLayout()}function u4(e){var t;const n=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:s,measuredBox:i}=e.layout,{animationType:a}=e.options,o=n.source!==e.layout.source;a==="size"?St(p=>{const f=o?n.measuredBox[p]:n.layoutBox[p],m=bt(f);f.min=s[p].min,f.max=f.min+m}):q1(a,n.layoutBox,s)&&St(p=>{const f=o?n.measuredBox[p]:n.layoutBox[p],m=bt(s[p]);f.max=f.min+m,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[p].max=e.relativeTarget[p].min+m)});const l=xr();Pi(l,s,n.layoutBox);const c=xr();o?Pi(c,e.applyTransform(i,!0),n.measuredBox):Pi(c,s,n.layoutBox);const u=!H1(l);let d=!1;if(!e.resumeFrom){const p=e.getClosestProjectingParent();if(p&&!p.resumeFrom){const{snapshot:f,layout:m}=p;if(f&&m){const b=Te();Mi(b,n.layoutBox,f.layoutBox);const y=Te();Mi(y,s,m.layoutBox),W1(b,y)||(d=!0),p.options.layoutRoot&&(e.relativeTarget=y,e.relativeTargetOrigin=b,e.relativeParent=p)}}}e.notifyListeners("didUpdate",{layout:s,snapshot:n,delta:c,layoutDelta:l,hasLayoutChanged:u,hasRelativeTargetChanged:d})}else if(e.isLead()){const{onExitComplete:s}=e.options;s&&s()}e.options.transition=void 0}function d4(e){mi&&ks.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function h4(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function f4(e){e.clearSnapshot()}function Gm(e){e.clearMeasurements()}function p4(e){e.isLayoutDirty=!1}function m4(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function qm(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function g4(e){e.resolveTargetDelta()}function x4(e){e.calcProjection()}function y4(e){e.resetSkewAndRotation()}function v4(e){e.removeLeadSnapshot()}function Ym(e,t,n){e.translate=je(t.translate,0,n),e.scale=je(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Xm(e,t,n,s){e.min=je(t.min,n.min,s),e.max=je(t.max,n.max,s)}function b4(e,t,n,s){Xm(e.x,t.x,n.x,s),Xm(e.y,t.y,n.y,s)}function w4(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const k4={duration:.45,ease:[.4,0,.1,1]},Qm=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Jm=Qm("applewebkit/")&&!Qm("chrome/")?Math.round:yt;function Zm(e){e.min=Jm(e.min),e.max=Jm(e.max)}function j4(e){Zm(e.x),Zm(e.y)}function q1(e,t,n){return e==="position"||e==="preserve-aspect"&&!CS(Hm(t),Hm(n),.2)}function N4(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}const S4=G1({attachResizeListener:(e,t)=>ra(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Tc={current:void 0},Y1=G1({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Tc.current){const e=new S4({});e.mount(window),e.setOptions({layoutScroll:!0}),Tc.current=e}return Tc.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),C4={pan:{Feature:$S},drag:{Feature:VS,ProjectionNode:Y1,MeasureLayout:V1}};function e0(e,t,n){const{props:s}=e;e.animationState&&s.whileHover&&e.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,a=s[i];a&&ve.postRender(()=>a(t,ya(t)))}class E4 extends fs{mount(){const{current:t}=this.node;t&&(this.unmount=Cj(t,n=>(e0(this.node,n,"Start"),s=>e0(this.node,s,"End"))))}unmount(){}}class _4 extends fs{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=xa(ra(this.node.current,"focus",()=>this.onFocus()),ra(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function t0(e,t,n){const{props:s}=e;e.animationState&&s.whileTap&&e.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),a=s[i];a&&ve.postRender(()=>a(t,ya(t)))}class T4 extends fs{mount(){const{current:t}=this.node;t&&(this.unmount=Pj(t,n=>(t0(this.node,n,"Start"),(s,{success:i})=>t0(this.node,s,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const od=new WeakMap,Pc=new WeakMap,P4=e=>{const t=od.get(e.target);t&&t(e)},M4=e=>{e.forEach(P4)};function A4({root:e,...t}){const n=e||document;Pc.has(n)||Pc.set(n,{});const s=Pc.get(n),i=JSON.stringify(t);return s[i]||(s[i]=new IntersectionObserver(M4,{root:e,...t})),s[i]}function R4(e,t,n){const s=A4(t);return od.set(e,n),s.observe(e),()=>{od.delete(e),s.unobserve(e)}}const z4={some:0,all:1};class L4 extends fs{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:s,amount:i="some",once:a}=t,o={root:n?n.current:void 0,rootMargin:s,threshold:typeof i=="number"?i:z4[i]},l=c=>{const{isIntersecting:u}=c;if(this.isInView===u||(this.isInView=u,a&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:d,onViewportLeave:p}=this.node.getProps(),f=u?d:p;f&&f(c)};return R4(this.node.current,o,l)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(O4(t,n))&&this.startObserver()}unmount(){}}function O4({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const D4={inView:{Feature:L4},tap:{Feature:T4},focus:{Feature:_4},hover:{Feature:E4}},I4={layout:{ProjectionNode:Y1,MeasureLayout:V1}},ld={current:null},X1={current:!1};function B4(){if(X1.current=!0,!!kh)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>ld.current=e.matches;e.addListener(t),t()}else ld.current=!1}const F4=[...w1,Ye,is],V4=e=>F4.find(b1(e)),n0=new WeakMap;function $4(e,t,n){for(const s in t){const i=t[s],a=n[s];if(Je(i))e.addValue(s,i);else if(Je(a))e.addValue(s,na(i,{owner:e}));else if(a!==i)if(e.hasValue(s)){const o=e.getValue(s);o.liveStyle===!0?o.jump(i):o.hasAnimated||o.set(i)}else{const o=e.getStaticValue(s);e.addValue(s,na(o!==void 0?o:i,{owner:e}))}}for(const s in n)t[s]===void 0&&e.removeValue(s);return t}const s0=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class U4{scrapeMotionValuesFromProps(t,n,s){return{}}constructor({parent:t,props:n,presenceContext:s,reducedMotionConfig:i,blockInitialAnimation:a,visualState:o},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Yh,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const m=cn.now();this.renderScheduledAt<m&&(this.renderScheduledAt=m,ve.render(this.render,!1,!0))};const{latestValues:c,renderState:u,onUpdate:d}=o;this.onUpdate=d,this.latestValues=c,this.baseTarget={...c},this.initialValues=n.initial?{...c}:{},this.renderState=u,this.parent=t,this.props=n,this.presenceContext=s,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.options=l,this.blockInitialAnimation=!!a,this.isControllingVariants=El(n),this.isVariantNode=Ty(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:p,...f}=this.scrapeMotionValuesFromProps(n,{},this);for(const m in f){const b=f[m];c[m]!==void 0&&Je(b)&&b.set(c[m],!1)}}mount(t){this.current=t,n0.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,s)=>this.bindToMotionValue(s,n)),X1.current||B4(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:ld.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){n0.delete(this.current),this.projection&&this.projection.unmount(),rs(this.notifyUpdate),rs(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const s=Vs.has(t),i=n.on("change",l=>{this.latestValues[t]=l,this.props.onUpdate&&ve.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0)}),a=n.on("renderRequest",this.scheduleRender);let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{i(),a(),o&&o(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Or){const n=Or[t];if(!n)continue;const{isEnabled:s,Feature:i}=n;if(!this.features[t]&&i&&s(this.props)&&(this.features[t]=new i(this)),this.features[t]){const a=this.features[t];a.isMounted?a.update():(a.mount(),a.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Te()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let s=0;s<s0.length;s++){const i=s0[s];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const a="on"+i,o=t[a];o&&(this.propEventSubscriptions[i]=this.on(i,o))}this.prevMotionValues=$4(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const s=this.values.get(t);n!==s&&(s&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let s=this.values.get(t);return s===void 0&&n!==void 0&&(s=na(n===null?void 0:n,{owner:this}),this.addValue(t,s)),s}readValue(t,n){var s;let i=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(s=this.getBaseTargetFromProps(this.props,t))!==null&&s!==void 0?s:this.readValueFromInstance(this.current,t,this.options);return i!=null&&(typeof i=="string"&&(y1(i)||c1(i))?i=parseFloat(i):!V4(i)&&is.test(n)&&(i=m1(t,n)),this.setBaseTarget(t,Je(i)?i.get():i)),Je(i)?i.get():i}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:s}=this.props;let i;if(typeof s=="string"||typeof s=="object"){const o=Th(this.props,s,(n=this.presenceContext)===null||n===void 0?void 0:n.custom);o&&(i=o[t])}if(s&&i!==void 0)return i;const a=this.getBaseTargetFromProps(this.props,t);return a!==void 0&&!Je(a)?a:this.initialValues[t]!==void 0&&i===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Uh),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class Q1 extends U4{constructor(){super(...arguments),this.KeyframeResolver=k1}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:s}){delete n[t],delete s[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Je(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function H4(e){return window.getComputedStyle(e)}class W4 extends Q1{constructor(){super(...arguments),this.type="html",this.renderInstance=Iy}readValueFromInstance(t,n){if(Vs.has(n)){const s=qh(n);return s&&s.default||0}else{const s=H4(t),i=(Ly(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return B1(t,n)}build(t,n,s){Ah(t,n,s.transformTemplate)}scrapeMotionValuesFromProps(t,n,s){return Oh(t,n,s)}}class K4 extends Q1{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Te}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Vs.has(n)){const s=qh(n);return s&&s.default||0}return n=By.has(n)?n:Ch(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,s){return $y(t,n,s)}build(t,n,s){Rh(t,n,this.isSVGTag,s.transformTemplate)}renderInstance(t,n,s,i){Fy(t,n,s,i)}mount(t){this.isSVGTag=Lh(t.tagName),super.mount(t)}}const G4=(e,t)=>_h(e)?new K4(t):new W4(t,{allowProjection:e!==h.Fragment}),q4=vj({...xS,...D4,...C4,...I4},G4),H=z5(q4);/**
76
+ `),()=>{document.head.removeChild(d)}},[t]),r.jsx(j5,{isPresent:t,childRef:s,sizeRef:i,children:h.cloneElement(e,{ref:s})})}const S5=({children:e,initial:t,isPresent:n,onExitComplete:s,custom:i,presenceAffectsLayout:a,mode:o})=>{const l=jl(C5),c=h.useId(),u=h.useCallback(p=>{l.set(p,!0);for(const f of l.values())if(!f)return;s&&s()},[l,s]),d=h.useMemo(()=>({id:c,initial:t,isPresent:n,custom:i,onExitComplete:u,register:p=>(l.set(p,!1),()=>l.delete(p))}),a?[Math.random(),u]:[n,u]);return h.useMemo(()=>{l.forEach((p,f)=>l.set(f,!1))},[n]),h.useEffect(()=>{!n&&!l.size&&s&&s()},[n]),o==="popLayout"&&(e=r.jsx(N5,{isPresent:n,children:e})),r.jsx(Nl.Provider,{value:d,children:e})};function C5(){return new Map}function ky(e=!0){const t=h.useContext(Nl);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:s,register:i}=t,a=h.useId();h.useEffect(()=>{e&&i(a)},[e]);const o=h.useCallback(()=>e&&s&&s(a),[a,s,e]);return!n&&s?[!1,o]:[!0]}const $a=e=>e.key||"";function Up(e){const t=[];return h.Children.forEach(e,n=>{h.isValidElement(n)&&t.push(n)}),t}const kh=typeof window<"u",jy=kh?h.useLayoutEffect:h.useEffect,se=({children:e,custom:t,initial:n=!0,onExitComplete:s,presenceAffectsLayout:i=!0,mode:a="sync",propagate:o=!1})=>{const[l,c]=ky(o),u=h.useMemo(()=>Up(e),[e]),d=o&&!l?[]:u.map($a),p=h.useRef(!0),f=h.useRef(u),m=jl(()=>new Map),[v,y]=h.useState(u),[b,g]=h.useState(u);jy(()=>{p.current=!1,f.current=u;for(let j=0;j<b.length;j++){const k=$a(b[j]);d.includes(k)?m.delete(k):m.get(k)!==!0&&m.set(k,!1)}},[b,d.length,d.join("-")]);const x=[];if(u!==v){let j=[...u];for(let k=0;k<b.length;k++){const N=b[k],S=$a(N);d.includes(S)||(j.splice(k,0,N),x.push(N))}a==="wait"&&x.length&&(j=x),g(Up(j)),y(u);return}const{forceRender:w}=h.useContext(wh);return r.jsx(r.Fragment,{children:b.map(j=>{const k=$a(j),N=o&&!l?!1:u===b||d.includes(k),S=()=>{if(m.has(k))m.set(k,!0);else return;let E=!0;m.forEach(P=>{P||(E=!1)}),E&&(w==null||w(),g(f.current),o&&(c==null||c()),s&&s())};return r.jsx(S5,{isPresent:N,initial:!p.current||n?void 0:!1,custom:N?void 0:t,presenceAffectsLayout:i,mode:a,onExitComplete:N?void 0:S,children:j},k)})})},yt=e=>e;let Ny=yt;function jh(e){let t;return()=>(t===void 0&&(t=e()),t)}const Or=(e,t,n)=>{const s=t-e;return s===0?1:(n-e)/s},kn=e=>e*1e3,jn=e=>e/1e3,E5={useManualTiming:!1};function _5(e){let t=new Set,n=new Set,s=!1,i=!1;const a=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1};function l(u){a.has(u)&&(c.schedule(u),e()),u(o)}const c={schedule:(u,d=!1,p=!1)=>{const m=p&&s?t:n;return d&&a.add(u),m.has(u)||m.add(u),u},cancel:u=>{n.delete(u),a.delete(u)},process:u=>{if(o=u,s){i=!0;return}s=!0,[t,n]=[n,t],t.forEach(l),t.clear(),s=!1,i&&(i=!1,c.process(u))}};return c}const Ua=["read","resolveKeyframes","update","preRender","render","postRender"],T5=40;function Sy(e,t){let n=!1,s=!0;const i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=Ua.reduce((g,x)=>(g[x]=_5(a),g),{}),{read:l,resolveKeyframes:c,update:u,preRender:d,render:p,postRender:f}=o,m=()=>{const g=performance.now();n=!1,i.delta=s?1e3/60:Math.max(Math.min(g-i.timestamp,T5),1),i.timestamp=g,i.isProcessing=!0,l.process(i),c.process(i),u.process(i),d.process(i),p.process(i),f.process(i),i.isProcessing=!1,n&&t&&(s=!1,e(m))},v=()=>{n=!0,s=!0,i.isProcessing||e(m)};return{schedule:Ua.reduce((g,x)=>{const w=o[x];return g[x]=(j,k=!1,N=!1)=>(n||v(),w.schedule(j,k,N)),g},{}),cancel:g=>{for(let x=0;x<Ua.length;x++)o[Ua[x]].cancel(g)},state:i,steps:o}}const{schedule:ve,cancel:rs,state:Ue,steps:yc}=Sy(typeof requestAnimationFrame<"u"?requestAnimationFrame:yt,!0),Cy=h.createContext({strict:!1}),Hp={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Dr={};for(const e in Hp)Dr[e]={isEnabled:t=>Hp[e].some(n=>!!t[n])};function P5(e){for(const t in e)Dr[t]={...Dr[t],...e[t]}}const A5=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function Qo(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||A5.has(e)}let Ey=e=>!Qo(e);function _y(e){e&&(Ey=t=>t.startsWith("on")?!Qo(t):e(t))}try{_y(require("@emotion/is-prop-valid").default)}catch{}function M5(e,t,n){const s={};for(const i in e)i==="values"&&typeof e.values=="object"||(Ey(i)||n===!0&&Qo(i)||!t&&!Qo(i)||e.draggable&&i.startsWith("onDrag"))&&(s[i]=e[i]);return s}function R5({children:e,isValidProp:t,...n}){t&&_y(t),n={...h.useContext(Zi),...n},n.isStatic=jl(()=>n.isStatic);const s=h.useMemo(()=>n,[JSON.stringify(n.transition),n.transformPagePoint,n.reducedMotion]);return r.jsx(Zi.Provider,{value:s,children:e})}function z5(e){if(typeof Proxy>"u")return e;const t=new Map,n=(...s)=>e(...s);return new Proxy(n,{get:(s,i)=>i==="create"?e:(t.has(i)||t.set(i,e(i)),t.get(i))})}const Sl=h.createContext({});function ea(e){return typeof e=="string"||Array.isArray(e)}function Cl(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}const Nh=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Sh=["initial",...Nh];function El(e){return Cl(e.animate)||Sh.some(t=>ea(e[t]))}function Ty(e){return!!(El(e)||e.variants)}function L5(e,t){if(El(e)){const{initial:n,animate:s}=e;return{initial:n===!1||ea(n)?n:void 0,animate:ea(s)?s:void 0}}return e.inherit!==!1?t:{}}function O5(e){const{initial:t,animate:n}=L5(e,h.useContext(Sl));return h.useMemo(()=>({initial:t,animate:n}),[Wp(t),Wp(n)])}function Wp(e){return Array.isArray(e)?e.join(" "):e}const D5=Symbol.for("motionComponentSymbol");function gr(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function I5(e,t,n){return h.useCallback(s=>{s&&e.onMount&&e.onMount(s),t&&(s?t.mount(s):t.unmount()),n&&(typeof n=="function"?n(s):gr(n)&&(n.current=s))},[t])}const Ch=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),B5="framerAppearId",Py="data-"+Ch(B5),{schedule:Eh}=Sy(queueMicrotask,!1),Ay=h.createContext({});function F5(e,t,n,s,i){var a,o;const{visualElement:l}=h.useContext(Sl),c=h.useContext(Cy),u=h.useContext(Nl),d=h.useContext(Zi).reducedMotion,p=h.useRef(null);s=s||c.renderer,!p.current&&s&&(p.current=s(e,{visualState:t,parent:l,props:n,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:d}));const f=p.current,m=h.useContext(Ay);f&&!f.projection&&i&&(f.type==="html"||f.type==="svg")&&V5(p.current,n,i,m);const v=h.useRef(!1);h.useInsertionEffect(()=>{f&&v.current&&f.update(n,u)});const y=n[Py],b=h.useRef(!!y&&!(!((a=window.MotionHandoffIsComplete)===null||a===void 0)&&a.call(window,y))&&((o=window.MotionHasOptimisedAnimation)===null||o===void 0?void 0:o.call(window,y)));return jy(()=>{f&&(v.current=!0,window.MotionIsMounted=!0,f.updateFeatures(),Eh.render(f.render),b.current&&f.animationState&&f.animationState.animateChanges())}),h.useEffect(()=>{f&&(!b.current&&f.animationState&&f.animationState.animateChanges(),b.current&&(queueMicrotask(()=>{var g;(g=window.MotionHandoffMarkAsComplete)===null||g===void 0||g.call(window,y)}),b.current=!1))}),f}function V5(e,t,n,s){const{layoutId:i,layout:a,drag:o,dragConstraints:l,layoutScroll:c,layoutRoot:u}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:My(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||l&&gr(l),visualElement:e,animationType:typeof a=="string"?a:"both",initialPromotionConfig:s,layoutScroll:c,layoutRoot:u})}function My(e){if(e)return e.options.allowProjection!==!1?e.projection:My(e.parent)}function $5({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:s,Component:i}){var a,o;e&&P5(e);function l(u,d){let p;const f={...h.useContext(Zi),...u,layoutId:U5(u)},{isStatic:m}=f,v=O5(u),y=s(u,m);if(!m&&kh){H5();const b=W5(f);p=b.MeasureLayout,v.visualElement=F5(i,y,f,t,b.ProjectionNode)}return r.jsxs(Sl.Provider,{value:v,children:[p&&v.visualElement?r.jsx(p,{visualElement:v.visualElement,...f}):null,n(i,u,I5(y,v.visualElement,d),y,m,v.visualElement)]})}l.displayName=`motion.${typeof i=="string"?i:`create(${(o=(a=i.displayName)!==null&&a!==void 0?a:i.name)!==null&&o!==void 0?o:""})`}`;const c=h.forwardRef(l);return c[D5]=i,c}function U5({layoutId:e}){const t=h.useContext(wh).id;return t&&e!==void 0?t+"-"+e:e}function H5(e,t){h.useContext(Cy).strict}function W5(e){const{drag:t,layout:n}=Dr;if(!t&&!n)return{};const s={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}const K5=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function _h(e){return typeof e!="string"||e.includes("-")?!1:!!(K5.indexOf(e)>-1||/[A-Z]/u.test(e))}function Kp(e){const t=[{},{}];return e==null||e.values.forEach((n,s)=>{t[0][s]=n.get(),t[1][s]=n.getVelocity()}),t}function Th(e,t,n,s){if(typeof t=="function"){const[i,a]=Kp(s);t=t(n!==void 0?n:e.custom,i,a)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[i,a]=Kp(s);t=t(n!==void 0?n:e.custom,i,a)}return t}const Gu=e=>Array.isArray(e),G5=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),q5=e=>Gu(e)?e[e.length-1]||0:e,Je=e=>!!(e&&e.getVelocity);function go(e){const t=Je(e)?e.get():e;return G5(t)?t.toValue():t}function Y5({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},s,i,a){const o={latestValues:X5(s,i,a,e),renderState:t()};return n&&(o.onMount=l=>n({props:s,current:l,...o}),o.onUpdate=l=>n(l)),o}const Ry=e=>(t,n)=>{const s=h.useContext(Sl),i=h.useContext(Nl),a=()=>Y5(e,t,s,i);return n?a():jl(a)};function X5(e,t,n,s){const i={},a=s(e,{});for(const f in a)i[f]=go(a[f]);let{initial:o,animate:l}=e;const c=El(e),u=Ty(e);t&&u&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),l===void 0&&(l=t.animate));let d=n?n.initial===!1:!1;d=d||o===!1;const p=d?l:o;if(p&&typeof p!="boolean"&&!Cl(p)){const f=Array.isArray(p)?p:[p];for(let m=0;m<f.length;m++){const v=Th(e,f[m]);if(v){const{transitionEnd:y,transition:b,...g}=v;for(const x in g){let w=g[x];if(Array.isArray(w)){const j=d?w.length-1:0;w=w[j]}w!==null&&(i[x]=w)}for(const x in y)i[x]=y[x]}}}return i}const Wr=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Vs=new Set(Wr),zy=e=>t=>typeof t=="string"&&t.startsWith(e),Ly=zy("--"),Q5=zy("var(--"),Ph=e=>Q5(e)?J5.test(e.split("/*")[0].trim()):!1,J5=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Oy=(e,t)=>t&&typeof e=="number"?t.transform(e):e,_n=(e,t,n)=>n>t?t:n<e?e:n,Kr={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},ta={...Kr,transform:e=>_n(0,1,e)},Ha={...Kr,default:1},ma=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),On=ma("deg"),ln=ma("%"),X=ma("px"),Z5=ma("vh"),ej=ma("vw"),Gp={...ln,parse:e=>ln.parse(e)/100,transform:e=>ln.transform(e*100)},tj={borderWidth:X,borderTopWidth:X,borderRightWidth:X,borderBottomWidth:X,borderLeftWidth:X,borderRadius:X,radius:X,borderTopLeftRadius:X,borderTopRightRadius:X,borderBottomRightRadius:X,borderBottomLeftRadius:X,width:X,maxWidth:X,height:X,maxHeight:X,top:X,right:X,bottom:X,left:X,padding:X,paddingTop:X,paddingRight:X,paddingBottom:X,paddingLeft:X,margin:X,marginTop:X,marginRight:X,marginBottom:X,marginLeft:X,backgroundPositionX:X,backgroundPositionY:X},nj={rotate:On,rotateX:On,rotateY:On,rotateZ:On,scale:Ha,scaleX:Ha,scaleY:Ha,scaleZ:Ha,skew:On,skewX:On,skewY:On,distance:X,translateX:X,translateY:X,translateZ:X,x:X,y:X,z:X,perspective:X,transformPerspective:X,opacity:ta,originX:Gp,originY:Gp,originZ:X},qp={...Kr,transform:Math.round},Ah={...tj,...nj,zIndex:qp,size:X,fillOpacity:ta,strokeOpacity:ta,numOctaves:qp},sj={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},rj=Wr.length;function ij(e,t,n){let s="",i=!0;for(let a=0;a<rj;a++){const o=Wr[a],l=e[o];if(l===void 0)continue;let c=!0;if(typeof l=="number"?c=l===(o.startsWith("scale")?1:0):c=parseFloat(l)===0,!c||n){const u=Oy(l,Ah[o]);if(!c){i=!1;const d=sj[o]||o;s+=`${d}(${u}) `}n&&(t[o]=u)}}return s=s.trim(),n?s=n(t,i?"":s):i&&(s="none"),s}function Mh(e,t,n){const{style:s,vars:i,transformOrigin:a}=e;let o=!1,l=!1;for(const c in t){const u=t[c];if(Vs.has(c)){o=!0;continue}else if(Ly(c)){i[c]=u;continue}else{const d=Oy(u,Ah[c]);c.startsWith("origin")?(l=!0,a[c]=d):s[c]=d}}if(t.transform||(o||n?s.transform=ij(t,e.transform,n):s.transform&&(s.transform="none")),l){const{originX:c="50%",originY:u="50%",originZ:d=0}=a;s.transformOrigin=`${c} ${u} ${d}`}}const aj={offset:"stroke-dashoffset",array:"stroke-dasharray"},oj={offset:"strokeDashoffset",array:"strokeDasharray"};function lj(e,t,n=1,s=0,i=!0){e.pathLength=1;const a=i?aj:oj;e[a.offset]=X.transform(-s);const o=X.transform(t),l=X.transform(n);e[a.array]=`${o} ${l}`}function Yp(e,t,n){return typeof e=="string"?e:X.transform(t+n*e)}function cj(e,t,n){const s=Yp(t,e.x,e.width),i=Yp(n,e.y,e.height);return`${s} ${i}`}function Rh(e,{attrX:t,attrY:n,attrScale:s,originX:i,originY:a,pathLength:o,pathSpacing:l=1,pathOffset:c=0,...u},d,p){if(Mh(e,u,p),d){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:f,style:m,dimensions:v}=e;f.transform&&(v&&(m.transform=f.transform),delete f.transform),v&&(i!==void 0||a!==void 0||m.transform)&&(m.transformOrigin=cj(v,i!==void 0?i:.5,a!==void 0?a:.5)),t!==void 0&&(f.x=t),n!==void 0&&(f.y=n),s!==void 0&&(f.scale=s),o!==void 0&&lj(f,o,l,c,!1)}const zh=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),Dy=()=>({...zh(),attrs:{}}),Lh=e=>typeof e=="string"&&e.toLowerCase()==="svg";function Iy(e,{style:t,vars:n},s,i){Object.assign(e.style,t,i&&i.getProjectionStyles(s));for(const a in n)e.style.setProperty(a,n[a])}const By=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function Fy(e,t,n,s){Iy(e,t,void 0,s);for(const i in t.attrs)e.setAttribute(By.has(i)?i:Ch(i),t.attrs[i])}const Jo={};function uj(e){Object.assign(Jo,e)}function Vy(e,{layout:t,layoutId:n}){return Vs.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Jo[e]||e==="opacity")}function Oh(e,t,n){var s;const{style:i}=e,a={};for(const o in i)(Je(i[o])||t.style&&Je(t.style[o])||Vy(o,e)||((s=n==null?void 0:n.getValue(o))===null||s===void 0?void 0:s.liveStyle)!==void 0)&&(a[o]=i[o]);return a}function $y(e,t,n){const s=Oh(e,t,n);for(const i in e)if(Je(e[i])||Je(t[i])){const a=Wr.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;s[a]=e[i]}return s}function dj(e,t){try{t.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{t.dimensions={x:0,y:0,width:0,height:0}}}const Xp=["x","y","width","height","cx","cy","r"],hj={useVisualState:Ry({scrapeMotionValuesFromProps:$y,createRenderState:Dy,onUpdate:({props:e,prevProps:t,current:n,renderState:s,latestValues:i})=>{if(!n)return;let a=!!e.drag;if(!a){for(const l in i)if(Vs.has(l)){a=!0;break}}if(!a)return;let o=!t;if(t)for(let l=0;l<Xp.length;l++){const c=Xp[l];e[c]!==t[c]&&(o=!0)}o&&ve.read(()=>{dj(n,s),ve.render(()=>{Rh(s,i,Lh(n.tagName),e.transformTemplate),Fy(n,s)})})}})},fj={useVisualState:Ry({scrapeMotionValuesFromProps:Oh,createRenderState:zh})};function Uy(e,t,n){for(const s in t)!Je(t[s])&&!Vy(s,n)&&(e[s]=t[s])}function pj({transformTemplate:e},t){return h.useMemo(()=>{const n=zh();return Mh(n,t,e),Object.assign({},n.vars,n.style)},[t])}function mj(e,t){const n=e.style||{},s={};return Uy(s,n,e),Object.assign(s,pj(e,t)),s}function gj(e,t){const n={},s=mj(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,s.userSelect=s.WebkitUserSelect=s.WebkitTouchCallout="none",s.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=s,n}function xj(e,t,n,s){const i=h.useMemo(()=>{const a=Dy();return Rh(a,t,Lh(s),e.transformTemplate),{...a.attrs,style:{...a.style}}},[t]);if(e.style){const a={};Uy(a,e.style,e),i.style={...a,...i.style}}return i}function yj(e=!1){return(n,s,i,{latestValues:a},o)=>{const c=(_h(n)?xj:gj)(s,a,o,n),u=M5(s,typeof n=="string",e),d=n!==h.Fragment?{...u,...c,ref:i}:{},{children:p}=s,f=h.useMemo(()=>Je(p)?p.get():p,[p]);return h.createElement(n,{...d,children:f})}}function vj(e,t){return function(s,{forwardMotionProps:i}={forwardMotionProps:!1}){const o={..._h(s)?hj:fj,preloadedFeatures:e,useRender:yj(i),createVisualElement:t,Component:s};return $5(o)}}function Hy(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let s=0;s<n;s++)if(t[s]!==e[s])return!1;return!0}function _l(e,t,n){const s=e.getProps();return Th(s,t,n!==void 0?n:s.custom,e)}const bj=jh(()=>window.ScrollTimeline!==void 0);class wj{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>"finished"in t?t.finished:t))}getAll(t){return this.animations[0][t]}setAll(t,n){for(let s=0;s<this.animations.length;s++)this.animations[s][t]=n}attachTimeline(t,n){const s=this.animations.map(i=>{if(bj()&&i.attachTimeline)return i.attachTimeline(t);if(typeof n=="function")return n(i)});return()=>{s.forEach((i,a)=>{i&&i(),this.animations[a].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let n=0;n<this.animations.length;n++)t=Math.max(t,this.animations[n].duration);return t}runAll(t){this.animations.forEach(n=>n[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class kj extends wj{then(t,n){return Promise.all(this.animations).then(t).catch(n)}}function Dh(e,t){return e?e[t]||e.default||e:void 0}const qu=2e4;function Wy(e){let t=0;const n=50;let s=e.next(t);for(;!s.done&&t<qu;)t+=n,s=e.next(t);return t>=qu?1/0:t}function Ih(e){return typeof e=="function"}function Qp(e,t){e.timeline=t,e.onfinish=null}const Bh=e=>Array.isArray(e)&&typeof e[0]=="number",jj={linearEasing:void 0};function Nj(e,t){const n=jh(e);return()=>{var s;return(s=jj[t])!==null&&s!==void 0?s:n()}}const Zo=Nj(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Ky=(e,t,n=10)=>{let s="";const i=Math.max(Math.round(t/n),2);for(let a=0;a<i;a++)s+=e(Or(0,i-1,a))+", ";return`linear(${s.substring(0,s.length-2)})`};function Gy(e){return!!(typeof e=="function"&&Zo()||!e||typeof e=="string"&&(e in Yu||Zo())||Bh(e)||Array.isArray(e)&&e.every(Gy))}const fi=([e,t,n,s])=>`cubic-bezier(${e}, ${t}, ${n}, ${s})`,Yu={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:fi([0,.65,.55,1]),circOut:fi([.55,0,1,.45]),backIn:fi([.31,.01,.66,-.59]),backOut:fi([.33,1.53,.69,.99])};function qy(e,t){if(e)return typeof e=="function"&&Zo()?Ky(e,t):Bh(e)?fi(e):Array.isArray(e)?e.map(n=>qy(n,t)||Yu.easeOut):Yu[e]}const Vt={x:!1,y:!1};function Yy(){return Vt.x||Vt.y}function Sj(e,t,n){var s;if(e instanceof Element)return[e];if(typeof e=="string"){let i=document;const a=(s=void 0)!==null&&s!==void 0?s:i.querySelectorAll(e);return a?Array.from(a):[]}return Array.from(e)}function Xy(e,t){const n=Sj(e),s=new AbortController,i={passive:!0,...t,signal:s.signal};return[n,i,()=>s.abort()]}function Jp(e){return t=>{t.pointerType==="touch"||Yy()||e(t)}}function Cj(e,t,n={}){const[s,i,a]=Xy(e,n),o=Jp(l=>{const{target:c}=l,u=t(l);if(typeof u!="function"||!c)return;const d=Jp(p=>{u(p),c.removeEventListener("pointerleave",d)});c.addEventListener("pointerleave",d,i)});return s.forEach(l=>{l.addEventListener("pointerenter",o,i)}),a}const Qy=(e,t)=>t?e===t?!0:Qy(e,t.parentElement):!1,Fh=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,Ej=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function _j(e){return Ej.has(e.tagName)||e.tabIndex!==-1}const pi=new WeakSet;function Zp(e){return t=>{t.key==="Enter"&&e(t)}}function vc(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const Tj=(e,t)=>{const n=e.currentTarget;if(!n)return;const s=Zp(()=>{if(pi.has(n))return;vc(n,"down");const i=Zp(()=>{vc(n,"up")}),a=()=>vc(n,"cancel");n.addEventListener("keyup",i,t),n.addEventListener("blur",a,t)});n.addEventListener("keydown",s,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",s),t)};function em(e){return Fh(e)&&!Yy()}function Pj(e,t,n={}){const[s,i,a]=Xy(e,n),o=l=>{const c=l.currentTarget;if(!em(l)||pi.has(c))return;pi.add(c);const u=t(l),d=(m,v)=>{window.removeEventListener("pointerup",p),window.removeEventListener("pointercancel",f),!(!em(m)||!pi.has(c))&&(pi.delete(c),typeof u=="function"&&u(m,{success:v}))},p=m=>{d(m,n.useGlobalTarget||Qy(c,m.target))},f=m=>{d(m,!1)};window.addEventListener("pointerup",p,i),window.addEventListener("pointercancel",f,i)};return s.forEach(l=>{!_j(l)&&l.getAttribute("tabindex")===null&&(l.tabIndex=0),(n.useGlobalTarget?window:l).addEventListener("pointerdown",o,i),l.addEventListener("focus",u=>Tj(u,i),i)}),a}function Aj(e){return e==="x"||e==="y"?Vt[e]?null:(Vt[e]=!0,()=>{Vt[e]=!1}):Vt.x||Vt.y?null:(Vt.x=Vt.y=!0,()=>{Vt.x=Vt.y=!1})}const Jy=new Set(["width","height","top","left","right","bottom",...Wr]);let xo;function Mj(){xo=void 0}const cn={now:()=>(xo===void 0&&cn.set(Ue.isProcessing||E5.useManualTiming?Ue.timestamp:performance.now()),xo),set:e=>{xo=e,queueMicrotask(Mj)}};function Vh(e,t){e.indexOf(t)===-1&&e.push(t)}function $h(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class Uh{constructor(){this.subscriptions=[]}add(t){return Vh(this.subscriptions,t),()=>$h(this.subscriptions,t)}notify(t,n,s){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,n,s);else for(let a=0;a<i;a++){const o=this.subscriptions[a];o&&o(t,n,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function Zy(e,t){return t?e*(1e3/t):0}const tm=30,Rj=e=>!isNaN(parseFloat(e));class zj{constructor(t,n={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(s,i=!0)=>{const a=cn.now();this.updatedAt!==a&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(s),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),i&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=cn.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=Rj(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new Uh);const s=this.events[t].add(n);return t==="change"?()=>{s(),ve.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,s){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-s}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=cn.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>tm)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,tm);return Zy(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function na(e,t){return new zj(e,t)}function Lj(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,na(n))}function Oj(e,t){const n=_l(e,t);let{transitionEnd:s={},transition:i={},...a}=n||{};a={...a,...s};for(const o in a){const l=q5(a[o]);Lj(e,o,l)}}function Dj(e){return!!(Je(e)&&e.add)}function Xu(e,t){const n=e.getValue("willChange");if(Dj(n))return n.add(t)}function e1(e){return e.props[Py]}const t1=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,Ij=1e-7,Bj=12;function Fj(e,t,n,s,i){let a,o,l=0;do o=t+(n-t)/2,a=t1(o,s,i)-e,a>0?n=o:t=o;while(Math.abs(a)>Ij&&++l<Bj);return o}function ga(e,t,n,s){if(e===t&&n===s)return yt;const i=a=>Fj(a,0,1,e,n);return a=>a===0||a===1?a:t1(i(a),t,s)}const n1=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,s1=e=>t=>1-e(1-t),r1=ga(.33,1.53,.69,.99),Hh=s1(r1),i1=n1(Hh),a1=e=>(e*=2)<1?.5*Hh(e):.5*(2-Math.pow(2,-10*(e-1))),Wh=e=>1-Math.sin(Math.acos(e)),o1=s1(Wh),l1=n1(Wh),c1=e=>/^0[^.\s]+$/u.test(e);function Vj(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||c1(e):!0}const _i=e=>Math.round(e*1e5)/1e5,Kh=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function $j(e){return e==null}const Uj=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Gh=(e,t)=>n=>!!(typeof n=="string"&&Uj.test(n)&&n.startsWith(e)||t&&!$j(n)&&Object.prototype.hasOwnProperty.call(n,t)),u1=(e,t,n)=>s=>{if(typeof s!="string")return s;const[i,a,o,l]=s.match(Kh);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:l!==void 0?parseFloat(l):1}},Hj=e=>_n(0,255,e),bc={...Kr,transform:e=>Math.round(Hj(e))},Cs={test:Gh("rgb","red"),parse:u1("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:s=1})=>"rgba("+bc.transform(e)+", "+bc.transform(t)+", "+bc.transform(n)+", "+_i(ta.transform(s))+")"};function Wj(e){let t="",n="",s="",i="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),s=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),s=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,s+=s,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:i?parseInt(i,16)/255:1}}const Qu={test:Gh("#"),parse:Wj,transform:Cs.transform},xr={test:Gh("hsl","hue"),parse:u1("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:s=1})=>"hsla("+Math.round(e)+", "+ln.transform(_i(t))+", "+ln.transform(_i(n))+", "+_i(ta.transform(s))+")"},Ye={test:e=>Cs.test(e)||Qu.test(e)||xr.test(e),parse:e=>Cs.test(e)?Cs.parse(e):xr.test(e)?xr.parse(e):Qu.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Cs.transform(e):xr.transform(e)},Kj=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Gj(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Kh))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(Kj))===null||n===void 0?void 0:n.length)||0)>0}const d1="number",h1="color",qj="var",Yj="var(",nm="${}",Xj=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function sa(e){const t=e.toString(),n=[],s={color:[],number:[],var:[]},i=[];let a=0;const l=t.replace(Xj,c=>(Ye.test(c)?(s.color.push(a),i.push(h1),n.push(Ye.parse(c))):c.startsWith(Yj)?(s.var.push(a),i.push(qj),n.push(c)):(s.number.push(a),i.push(d1),n.push(parseFloat(c))),++a,nm)).split(nm);return{values:n,split:l,indexes:s,types:i}}function f1(e){return sa(e).values}function p1(e){const{split:t,types:n}=sa(e),s=t.length;return i=>{let a="";for(let o=0;o<s;o++)if(a+=t[o],i[o]!==void 0){const l=n[o];l===d1?a+=_i(i[o]):l===h1?a+=Ye.transform(i[o]):a+=i[o]}return a}}const Qj=e=>typeof e=="number"?0:e;function Jj(e){const t=f1(e);return p1(e)(t.map(Qj))}const is={test:Gj,parse:f1,createTransformer:p1,getAnimatableNone:Jj},Zj=new Set(["brightness","contrast","saturate","opacity"]);function eN(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[s]=n.match(Kh)||[];if(!s)return e;const i=n.replace(s,"");let a=Zj.has(t)?1:0;return s!==n&&(a*=100),t+"("+a+i+")"}const tN=/\b([a-z-]*)\(.*?\)/gu,Ju={...is,getAnimatableNone:e=>{const t=e.match(tN);return t?t.map(eN).join(" "):e}},nN={...Ah,color:Ye,backgroundColor:Ye,outlineColor:Ye,fill:Ye,stroke:Ye,borderColor:Ye,borderTopColor:Ye,borderRightColor:Ye,borderBottomColor:Ye,borderLeftColor:Ye,filter:Ju,WebkitFilter:Ju},qh=e=>nN[e];function m1(e,t){let n=qh(e);return n!==Ju&&(n=is),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const sN=new Set(["auto","none","0"]);function rN(e,t,n){let s=0,i;for(;s<e.length&&!i;){const a=e[s];typeof a=="string"&&!sN.has(a)&&sa(a).values.length&&(i=e[s]),s++}if(i&&n)for(const a of t)e[a]=m1(n,i)}const sm=e=>e===Kr||e===X,rm=(e,t)=>parseFloat(e.split(", ")[t]),im=(e,t)=>(n,{transform:s})=>{if(s==="none"||!s)return 0;const i=s.match(/^matrix3d\((.+)\)$/u);if(i)return rm(i[1],t);{const a=s.match(/^matrix\((.+)\)$/u);return a?rm(a[1],e):0}},iN=new Set(["x","y","z"]),aN=Wr.filter(e=>!iN.has(e));function oN(e){const t=[];return aN.forEach(n=>{const s=e.getValue(n);s!==void 0&&(t.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),t}const Ir={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:im(4,13),y:im(5,14)};Ir.translateX=Ir.x;Ir.translateY=Ir.y;const Ts=new Set;let Zu=!1,ed=!1;function g1(){if(ed){const e=Array.from(Ts).filter(s=>s.needsMeasurement),t=new Set(e.map(s=>s.element)),n=new Map;t.forEach(s=>{const i=oN(s);i.length&&(n.set(s,i),s.render())}),e.forEach(s=>s.measureInitialState()),t.forEach(s=>{s.render();const i=n.get(s);i&&i.forEach(([a,o])=>{var l;(l=s.getValue(a))===null||l===void 0||l.set(o)})}),e.forEach(s=>s.measureEndState()),e.forEach(s=>{s.suspendedScrollY!==void 0&&window.scrollTo(0,s.suspendedScrollY)})}ed=!1,Zu=!1,Ts.forEach(e=>e.complete()),Ts.clear()}function x1(){Ts.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(ed=!0)})}function lN(){x1(),g1()}class Yh{constructor(t,n,s,i,a,o=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=s,this.motionValue=i,this.element=a,this.isAsync=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Ts.add(this),Zu||(Zu=!0,ve.read(x1),ve.resolveKeyframes(g1))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:s,motionValue:i}=this;for(let a=0;a<t.length;a++)if(t[a]===null)if(a===0){const o=i==null?void 0:i.get(),l=t[t.length-1];if(o!==void 0)t[0]=o;else if(s&&n){const c=s.readValue(n,l);c!=null&&(t[0]=c)}t[0]===void 0&&(t[0]=l),i&&o===void 0&&i.set(t[0])}else t[a]=t[a-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),Ts.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Ts.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const y1=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),cN=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function uN(e){const t=cN.exec(e);if(!t)return[,];const[,n,s,i]=t;return[`--${n??s}`,i]}function v1(e,t,n=1){const[s,i]=uN(e);if(!s)return;const a=window.getComputedStyle(t).getPropertyValue(s);if(a){const o=a.trim();return y1(o)?parseFloat(o):o}return Ph(i)?v1(i,t,n+1):i}const b1=e=>t=>t.test(e),dN={test:e=>e==="auto",parse:e=>e},w1=[Kr,X,ln,On,ej,Z5,dN],am=e=>w1.find(b1(e));class k1 extends Yh{constructor(t,n,s,i,a){super(t,n,s,i,a,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:s}=this;if(!n||!n.current)return;super.readKeyframes();for(let c=0;c<t.length;c++){let u=t[c];if(typeof u=="string"&&(u=u.trim(),Ph(u))){const d=v1(u,n.current);d!==void 0&&(t[c]=d),c===t.length-1&&(this.finalKeyframe=u)}}if(this.resolveNoneKeyframes(),!Jy.has(s)||t.length!==2)return;const[i,a]=t,o=am(i),l=am(a);if(o!==l)if(sm(o)&&sm(l))for(let c=0;c<t.length;c++){const u=t[c];typeof u=="string"&&(t[c]=parseFloat(u))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,s=[];for(let i=0;i<t.length;i++)Vj(t[i])&&s.push(i);s.length&&rN(t,s,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:s}=this;if(!t||!t.current)return;s==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Ir[s](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&t.getValue(s,i).jump(i,!1)}measureEndState(){var t;const{element:n,name:s,unresolvedKeyframes:i}=this;if(!n||!n.current)return;const a=n.getValue(s);a&&a.jump(this.measuredOrigin,!1);const o=i.length-1,l=i[o];i[o]=Ir[s](n.measureViewportBox(),window.getComputedStyle(n.current)),l!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=l),!((t=this.removedTransforms)===null||t===void 0)&&t.length&&this.removedTransforms.forEach(([c,u])=>{n.getValue(c).set(u)}),this.resolveNoneKeyframes()}}const om=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(is.test(e)||e==="0")&&!e.startsWith("url("));function hN(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function fN(e,t,n,s){const i=e[0];if(i===null)return!1;if(t==="display"||t==="visibility")return!0;const a=e[e.length-1],o=om(i,t),l=om(a,t);return!o||!l?!1:hN(e)||(n==="spring"||Ih(n))&&s}const pN=e=>e!==null;function Tl(e,{repeat:t,repeatType:n="loop"},s){const i=e.filter(pN),a=t&&n!=="loop"&&t%2===1?0:i.length-1;return!a||s===void 0?i[a]:s}const mN=40;class j1{constructor({autoplay:t=!0,delay:n=0,type:s="keyframes",repeat:i=0,repeatDelay:a=0,repeatType:o="loop",...l}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=cn.now(),this.options={autoplay:t,delay:n,type:s,repeat:i,repeatDelay:a,repeatType:o,...l},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>mN?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&lN(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=cn.now(),this.hasAttemptedResolve=!0;const{name:s,type:i,velocity:a,delay:o,onComplete:l,onUpdate:c,isGenerator:u}=this.options;if(!u&&!fN(t,s,i,a))if(o)this.options.duration=0;else{c&&c(Tl(t,this.options,n)),l&&l(),this.resolveFinishedPromise();return}const d=this.initPlayback(t,n);d!==!1&&(this._resolved={keyframes:t,finalKeyframe:n,...d},this.onPostResolved())}onPostResolved(){}then(t,n){return this.currentFinishedPromise.then(t,n)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}const je=(e,t,n)=>e+(t-e)*n;function wc(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function gN({hue:e,saturation:t,lightness:n,alpha:s}){e/=360,t/=100,n/=100;let i=0,a=0,o=0;if(!t)i=a=o=n;else{const l=n<.5?n*(1+t):n+t-n*t,c=2*n-l;i=wc(c,l,e+1/3),a=wc(c,l,e),o=wc(c,l,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:s}}function el(e,t){return n=>n>0?t:e}const kc=(e,t,n)=>{const s=e*e,i=n*(t*t-s)+s;return i<0?0:Math.sqrt(i)},xN=[Qu,Cs,xr],yN=e=>xN.find(t=>t.test(e));function lm(e){const t=yN(e);if(!t)return!1;let n=t.parse(e);return t===xr&&(n=gN(n)),n}const cm=(e,t)=>{const n=lm(e),s=lm(t);if(!n||!s)return el(e,t);const i={...n};return a=>(i.red=kc(n.red,s.red,a),i.green=kc(n.green,s.green,a),i.blue=kc(n.blue,s.blue,a),i.alpha=je(n.alpha,s.alpha,a),Cs.transform(i))},vN=(e,t)=>n=>t(e(n)),xa=(...e)=>e.reduce(vN),td=new Set(["none","hidden"]);function bN(e,t){return td.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function wN(e,t){return n=>je(e,t,n)}function Xh(e){return typeof e=="number"?wN:typeof e=="string"?Ph(e)?el:Ye.test(e)?cm:NN:Array.isArray(e)?N1:typeof e=="object"?Ye.test(e)?cm:kN:el}function N1(e,t){const n=[...e],s=n.length,i=e.map((a,o)=>Xh(a)(a,t[o]));return a=>{for(let o=0;o<s;o++)n[o]=i[o](a);return n}}function kN(e,t){const n={...e,...t},s={};for(const i in n)e[i]!==void 0&&t[i]!==void 0&&(s[i]=Xh(e[i])(e[i],t[i]));return i=>{for(const a in s)n[a]=s[a](i);return n}}function jN(e,t){var n;const s=[],i={color:0,var:0,number:0};for(let a=0;a<t.values.length;a++){const o=t.types[a],l=e.indexes[o][i[o]],c=(n=e.values[l])!==null&&n!==void 0?n:0;s[a]=c,i[o]++}return s}const NN=(e,t)=>{const n=is.createTransformer(t),s=sa(e),i=sa(t);return s.indexes.var.length===i.indexes.var.length&&s.indexes.color.length===i.indexes.color.length&&s.indexes.number.length>=i.indexes.number.length?td.has(e)&&!i.values.length||td.has(t)&&!s.values.length?bN(e,t):xa(N1(jN(s,i),i.values),n):el(e,t)};function S1(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?je(e,t,n):Xh(e)(e,t)}const SN=5;function C1(e,t,n){const s=Math.max(t-SN,0);return Zy(n-e(s),t-s)}const Ce={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},jc=.001;function CN({duration:e=Ce.duration,bounce:t=Ce.bounce,velocity:n=Ce.velocity,mass:s=Ce.mass}){let i,a,o=1-t;o=_n(Ce.minDamping,Ce.maxDamping,o),e=_n(Ce.minDuration,Ce.maxDuration,jn(e)),o<1?(i=u=>{const d=u*o,p=d*e,f=d-n,m=nd(u,o),v=Math.exp(-p);return jc-f/m*v},a=u=>{const p=u*o*e,f=p*n+n,m=Math.pow(o,2)*Math.pow(u,2)*e,v=Math.exp(-p),y=nd(Math.pow(u,2),o);return(-i(u)+jc>0?-1:1)*((f-m)*v)/y}):(i=u=>{const d=Math.exp(-u*e),p=(u-n)*e+1;return-jc+d*p},a=u=>{const d=Math.exp(-u*e),p=(n-u)*(e*e);return d*p});const l=5/e,c=_N(i,a,l);if(e=kn(e),isNaN(c))return{stiffness:Ce.stiffness,damping:Ce.damping,duration:e};{const u=Math.pow(c,2)*s;return{stiffness:u,damping:o*2*Math.sqrt(s*u),duration:e}}}const EN=12;function _N(e,t,n){let s=n;for(let i=1;i<EN;i++)s=s-e(s)/t(s);return s}function nd(e,t){return e*Math.sqrt(1-t*t)}const TN=["duration","bounce"],PN=["stiffness","damping","mass"];function um(e,t){return t.some(n=>e[n]!==void 0)}function AN(e){let t={velocity:Ce.velocity,stiffness:Ce.stiffness,damping:Ce.damping,mass:Ce.mass,isResolvedFromDuration:!1,...e};if(!um(e,PN)&&um(e,TN))if(e.visualDuration){const n=e.visualDuration,s=2*Math.PI/(n*1.2),i=s*s,a=2*_n(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:Ce.mass,stiffness:i,damping:a}}else{const n=CN(e);t={...t,...n,mass:Ce.mass},t.isResolvedFromDuration=!0}return t}function E1(e=Ce.visualDuration,t=Ce.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:s,restDelta:i}=n;const a=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],l={done:!1,value:a},{stiffness:c,damping:u,mass:d,duration:p,velocity:f,isResolvedFromDuration:m}=AN({...n,velocity:-jn(n.velocity||0)}),v=f||0,y=u/(2*Math.sqrt(c*d)),b=o-a,g=jn(Math.sqrt(c/d)),x=Math.abs(b)<5;s||(s=x?Ce.restSpeed.granular:Ce.restSpeed.default),i||(i=x?Ce.restDelta.granular:Ce.restDelta.default);let w;if(y<1){const k=nd(g,y);w=N=>{const S=Math.exp(-y*g*N);return o-S*((v+y*g*b)/k*Math.sin(k*N)+b*Math.cos(k*N))}}else if(y===1)w=k=>o-Math.exp(-g*k)*(b+(v+g*b)*k);else{const k=g*Math.sqrt(y*y-1);w=N=>{const S=Math.exp(-y*g*N),E=Math.min(k*N,300);return o-S*((v+y*g*b)*Math.sinh(E)+k*b*Math.cosh(E))/k}}const j={calculatedDuration:m&&p||null,next:k=>{const N=w(k);if(m)l.done=k>=p;else{let S=0;y<1&&(S=k===0?kn(v):C1(w,k,N));const E=Math.abs(S)<=s,P=Math.abs(o-N)<=i;l.done=E&&P}return l.value=l.done?o:N,l},toString:()=>{const k=Math.min(Wy(j),qu),N=Ky(S=>j.next(k*S).value,k,30);return k+"ms "+N}};return j}function dm({keyframes:e,velocity:t=0,power:n=.8,timeConstant:s=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:l,max:c,restDelta:u=.5,restSpeed:d}){const p=e[0],f={done:!1,value:p},m=E=>l!==void 0&&E<l||c!==void 0&&E>c,v=E=>l===void 0?c:c===void 0||Math.abs(l-E)<Math.abs(c-E)?l:c;let y=n*t;const b=p+y,g=o===void 0?b:o(b);g!==b&&(y=g-p);const x=E=>-y*Math.exp(-E/s),w=E=>g+x(E),j=E=>{const P=x(E),A=w(E);f.done=Math.abs(P)<=u,f.value=f.done?g:A};let k,N;const S=E=>{m(f.value)&&(k=E,N=E1({keyframes:[f.value,v(f.value)],velocity:C1(w,E,f.value),damping:i,stiffness:a,restDelta:u,restSpeed:d}))};return S(0),{calculatedDuration:null,next:E=>{let P=!1;return!N&&k===void 0&&(P=!0,j(E),S(E)),k!==void 0&&E>=k?N.next(E-k):(!P&&j(E),f)}}}const MN=ga(.42,0,1,1),RN=ga(0,0,.58,1),_1=ga(.42,0,.58,1),zN=e=>Array.isArray(e)&&typeof e[0]!="number",LN={linear:yt,easeIn:MN,easeInOut:_1,easeOut:RN,circIn:Wh,circInOut:l1,circOut:o1,backIn:Hh,backInOut:i1,backOut:r1,anticipate:a1},hm=e=>{if(Bh(e)){Ny(e.length===4);const[t,n,s,i]=e;return ga(t,n,s,i)}else if(typeof e=="string")return LN[e];return e};function ON(e,t,n){const s=[],i=n||S1,a=e.length-1;for(let o=0;o<a;o++){let l=i(e[o],e[o+1]);if(t){const c=Array.isArray(t)?t[o]||yt:t;l=xa(c,l)}s.push(l)}return s}function DN(e,t,{clamp:n=!0,ease:s,mixer:i}={}){const a=e.length;if(Ny(a===t.length),a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];const o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());const l=ON(t,s,i),c=l.length,u=d=>{if(o&&d<e[0])return t[0];let p=0;if(c>1)for(;p<e.length-2&&!(d<e[p+1]);p++);const f=Or(e[p],e[p+1],d);return l[p](f)};return n?d=>u(_n(e[0],e[a-1],d)):u}function IN(e,t){const n=e[e.length-1];for(let s=1;s<=t;s++){const i=Or(0,t,s);e.push(je(n,1,i))}}function BN(e){const t=[0];return IN(t,e.length-1),t}function FN(e,t){return e.map(n=>n*t)}function VN(e,t){return e.map(()=>t||_1).splice(0,e.length-1)}function tl({duration:e=300,keyframes:t,times:n,ease:s="easeInOut"}){const i=zN(s)?s.map(hm):hm(s),a={done:!1,value:t[0]},o=FN(n&&n.length===t.length?n:BN(t),e),l=DN(o,t,{ease:Array.isArray(i)?i:VN(t,i)});return{calculatedDuration:e,next:c=>(a.value=l(c),a.done=c>=e,a)}}const $N=e=>{const t=({timestamp:n})=>e(n);return{start:()=>ve.update(t,!0),stop:()=>rs(t),now:()=>Ue.isProcessing?Ue.timestamp:cn.now()}},UN={decay:dm,inertia:dm,tween:tl,keyframes:tl,spring:E1},HN=e=>e/100;class Qh extends j1{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:c}=this.options;c&&c()};const{name:n,motionValue:s,element:i,keyframes:a}=this.options,o=(i==null?void 0:i.KeyframeResolver)||Yh,l=(c,u)=>this.onKeyframesResolved(c,u);this.resolver=new o(a,l,n,s,i),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:n="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:a,velocity:o=0}=this.options,l=Ih(n)?n:UN[n]||tl;let c,u;l!==tl&&typeof t[0]!="number"&&(c=xa(HN,S1(t[0],t[1])),t=[0,100]);const d=l({...this.options,keyframes:t});a==="mirror"&&(u=l({...this.options,keyframes:[...t].reverse(),velocity:-o})),d.calculatedDuration===null&&(d.calculatedDuration=Wy(d));const{calculatedDuration:p}=d,f=p+i,m=f*(s+1)-i;return{generator:d,mirroredGenerator:u,mapPercentToKeyframes:c,calculatedDuration:p,resolvedDuration:f,totalDuration:m}}onPostResolved(){const{autoplay:t=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!t?this.pause():this.state=this.pendingPlayState}tick(t,n=!1){const{resolved:s}=this;if(!s){const{keyframes:E}=this.options;return{done:!0,value:E[E.length-1]}}const{finalKeyframe:i,generator:a,mirroredGenerator:o,mapPercentToKeyframes:l,keyframes:c,calculatedDuration:u,totalDuration:d,resolvedDuration:p}=s;if(this.startTime===null)return a.next(0);const{delay:f,repeat:m,repeatType:v,repeatDelay:y,onUpdate:b}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-d/this.speed,this.startTime)),n?this.currentTime=t:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const g=this.currentTime-f*(this.speed>=0?1:-1),x=this.speed>=0?g<0:g>d;this.currentTime=Math.max(g,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=d);let w=this.currentTime,j=a;if(m){const E=Math.min(this.currentTime,d)/p;let P=Math.floor(E),A=E%1;!A&&E>=1&&(A=1),A===1&&P--,P=Math.min(P,m+1),!!(P%2)&&(v==="reverse"?(A=1-A,y&&(A-=y/p)):v==="mirror"&&(j=o)),w=_n(0,1,A)*p}const k=x?{done:!1,value:c[0]}:j.next(w);l&&(k.value=l(k.value));let{done:N}=k;!x&&u!==null&&(N=this.speed>=0?this.currentTime>=d:this.currentTime<=0);const S=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&N);return S&&i!==void 0&&(k.value=Tl(c,this.options,i)),b&&b(k.value),S&&this.finish(),k}get duration(){const{resolved:t}=this;return t?jn(t.calculatedDuration):0}get time(){return jn(this.currentTime)}set time(t){t=kn(t),this.currentTime=t,this.holdTime!==null||this.speed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=jn(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=$N,onPlay:n,startTime:s}=this.options;this.driver||(this.driver=t(a=>this.tick(a))),n&&n();const i=this.driver.now();this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=i):this.startTime=s??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(t=this.currentTime)!==null&&t!==void 0?t:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}}const WN=new Set(["opacity","clipPath","filter","transform"]);function KN(e,t,n,{delay:s=0,duration:i=300,repeat:a=0,repeatType:o="loop",ease:l="easeInOut",times:c}={}){const u={[t]:n};c&&(u.offset=c);const d=qy(l,i);return Array.isArray(d)&&(u.easing=d),e.animate(u,{delay:s,duration:i,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:a+1,direction:o==="reverse"?"alternate":"normal"})}const GN=jh(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),nl=10,qN=2e4;function YN(e){return Ih(e.type)||e.type==="spring"||!Gy(e.ease)}function XN(e,t){const n=new Qh({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let s={done:!1,value:e[0]};const i=[];let a=0;for(;!s.done&&a<qN;)s=n.sample(a),i.push(s.value),a+=nl;return{times:void 0,keyframes:i,duration:a-nl,ease:"linear"}}const T1={anticipate:a1,backInOut:i1,circInOut:l1};function QN(e){return e in T1}class fm extends j1{constructor(t){super(t);const{name:n,motionValue:s,element:i,keyframes:a}=this.options;this.resolver=new k1(a,(o,l)=>this.onKeyframesResolved(o,l),n,s,i),this.resolver.scheduleResolve()}initPlayback(t,n){let{duration:s=300,times:i,ease:a,type:o,motionValue:l,name:c,startTime:u}=this.options;if(!l.owner||!l.owner.current)return!1;if(typeof a=="string"&&Zo()&&QN(a)&&(a=T1[a]),YN(this.options)){const{onComplete:p,onUpdate:f,motionValue:m,element:v,...y}=this.options,b=XN(t,y);t=b.keyframes,t.length===1&&(t[1]=t[0]),s=b.duration,i=b.times,a=b.ease,o="keyframes"}const d=KN(l.owner.current,c,t,{...this.options,duration:s,times:i,ease:a});return d.startTime=u??this.calcStartTime(),this.pendingTimeline?(Qp(d,this.pendingTimeline),this.pendingTimeline=void 0):d.onfinish=()=>{const{onComplete:p}=this.options;l.set(Tl(t,this.options,n)),p&&p(),this.cancel(),this.resolveFinishedPromise()},{animation:d,duration:s,times:i,type:o,ease:a,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:n}=t;return jn(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return jn(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:s}=n;s.currentTime=kn(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:n}=t;return n.playbackRate}set speed(t){const{resolved:n}=this;if(!n)return;const{animation:s}=n;s.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:n}=t;return n.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:n}=t;return n.startTime}attachTimeline(t){if(!this._resolved)this.pendingTimeline=t;else{const{resolved:n}=this;if(!n)return yt;const{animation:s}=n;Qp(s,t)}return yt}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.playState==="finished"&&this.updateFinishedPromise(),n.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:n,keyframes:s,duration:i,type:a,ease:o,times:l}=t;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:u,onUpdate:d,onComplete:p,element:f,...m}=this.options,v=new Qh({...m,keyframes:s,duration:i,type:a,ease:o,times:l,isGenerator:!0}),y=kn(this.time);u.setWithVelocity(v.sample(y-nl).value,v.sample(y).value,nl)}const{onStop:c}=this.options;c&&c(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:n,name:s,repeatDelay:i,repeatType:a,damping:o,type:l}=t;if(!n||!n.owner||!(n.owner.current instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:u}=n.owner.getProps();return GN()&&s&&WN.has(s)&&!c&&!u&&!i&&a!=="mirror"&&o!==0&&l!=="inertia"}}const JN={type:"spring",stiffness:500,damping:25,restSpeed:10},ZN=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),eS={type:"keyframes",duration:.8},tS={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},nS=(e,{keyframes:t})=>t.length>2?eS:Vs.has(e)?e.startsWith("scale")?ZN(t[1]):JN:tS;function sS({when:e,delay:t,delayChildren:n,staggerChildren:s,staggerDirection:i,repeat:a,repeatType:o,repeatDelay:l,from:c,elapsed:u,...d}){return!!Object.keys(d).length}const Jh=(e,t,n,s={},i,a)=>o=>{const l=Dh(s,e)||{},c=l.delay||s.delay||0;let{elapsed:u=0}=s;u=u-kn(c);let d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...l,delay:-u,onUpdate:f=>{t.set(f),l.onUpdate&&l.onUpdate(f)},onComplete:()=>{o(),l.onComplete&&l.onComplete()},name:e,motionValue:t,element:a?void 0:i};sS(l)||(d={...d,...nS(e,d)}),d.duration&&(d.duration=kn(d.duration)),d.repeatDelay&&(d.repeatDelay=kn(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let p=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(d.duration=0,d.delay===0&&(p=!0)),p&&!a&&t.get()!==void 0){const f=Tl(d.keyframes,l);if(f!==void 0)return ve.update(()=>{d.onUpdate(f),d.onComplete()}),new kj([])}return!a&&fm.supports(d)?new fm(d):new Qh(d)};function rS({protectedKeys:e,needsAnimating:t},n){const s=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,s}function P1(e,t,{delay:n=0,transitionOverride:s,type:i}={}){var a;let{transition:o=e.getDefaultTransition(),transitionEnd:l,...c}=t;s&&(o=s);const u=[],d=i&&e.animationState&&e.animationState.getState()[i];for(const p in c){const f=e.getValue(p,(a=e.latestValues[p])!==null&&a!==void 0?a:null),m=c[p];if(m===void 0||d&&rS(d,p))continue;const v={delay:n,...Dh(o||{},p)};let y=!1;if(window.MotionHandoffAnimation){const g=e1(e);if(g){const x=window.MotionHandoffAnimation(g,p,ve);x!==null&&(v.startTime=x,y=!0)}}Xu(e,p),f.start(Jh(p,f,m,e.shouldReduceMotion&&Jy.has(p)?{type:!1}:v,e,y));const b=f.animation;b&&u.push(b)}return l&&Promise.all(u).then(()=>{ve.update(()=>{l&&Oj(e,l)})}),u}function sd(e,t,n={}){var s;const i=_l(e,t,n.type==="exit"?(s=e.presenceContext)===null||s===void 0?void 0:s.custom:void 0);let{transition:a=e.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(a=n.transitionOverride);const o=i?()=>Promise.all(P1(e,i,n)):()=>Promise.resolve(),l=e.variantChildren&&e.variantChildren.size?(u=0)=>{const{delayChildren:d=0,staggerChildren:p,staggerDirection:f}=a;return iS(e,t,d+u,p,f,n)}:()=>Promise.resolve(),{when:c}=a;if(c){const[u,d]=c==="beforeChildren"?[o,l]:[l,o];return u().then(()=>d())}else return Promise.all([o(),l(n.delay)])}function iS(e,t,n=0,s=0,i=1,a){const o=[],l=(e.variantChildren.size-1)*s,c=i===1?(u=0)=>u*s:(u=0)=>l-u*s;return Array.from(e.variantChildren).sort(aS).forEach((u,d)=>{u.notify("AnimationStart",t),o.push(sd(u,t,{...a,delay:n+c(d)}).then(()=>u.notify("AnimationComplete",t)))}),Promise.all(o)}function aS(e,t){return e.sortNodePosition(t)}function oS(e,t,n={}){e.notify("AnimationStart",t);let s;if(Array.isArray(t)){const i=t.map(a=>sd(e,a,n));s=Promise.all(i)}else if(typeof t=="string")s=sd(e,t,n);else{const i=typeof t=="function"?_l(e,t,n.custom):t;s=Promise.all(P1(e,i,n))}return s.then(()=>{e.notify("AnimationComplete",t)})}const lS=Sh.length;function A1(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?A1(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<lS;n++){const s=Sh[n],i=e.props[s];(ea(i)||i===!1)&&(t[s]=i)}return t}const cS=[...Nh].reverse(),uS=Nh.length;function dS(e){return t=>Promise.all(t.map(({animation:n,options:s})=>oS(e,n,s)))}function hS(e){let t=dS(e),n=pm(),s=!0;const i=c=>(u,d)=>{var p;const f=_l(e,d,c==="exit"?(p=e.presenceContext)===null||p===void 0?void 0:p.custom:void 0);if(f){const{transition:m,transitionEnd:v,...y}=f;u={...u,...y,...v}}return u};function a(c){t=c(e)}function o(c){const{props:u}=e,d=A1(e.parent)||{},p=[],f=new Set;let m={},v=1/0;for(let b=0;b<uS;b++){const g=cS[b],x=n[g],w=u[g]!==void 0?u[g]:d[g],j=ea(w),k=g===c?x.isActive:null;k===!1&&(v=b);let N=w===d[g]&&w!==u[g]&&j;if(N&&s&&e.manuallyAnimateOnMount&&(N=!1),x.protectedKeys={...m},!x.isActive&&k===null||!w&&!x.prevProp||Cl(w)||typeof w=="boolean")continue;const S=fS(x.prevProp,w);let E=S||g===c&&x.isActive&&!N&&j||b>v&&j,P=!1;const A=Array.isArray(w)?w:[w];let T=A.reduce(i(g),{});k===!1&&(T={});const{prevResolvedValues:V={}}=x,R={...V,...T},I=B=>{E=!0,f.has(B)&&(P=!0,f.delete(B)),x.needsAnimating[B]=!0;const C=e.getValue(B);C&&(C.liveStyle=!1)};for(const B in R){const C=T[B],M=V[B];if(m.hasOwnProperty(B))continue;let _=!1;Gu(C)&&Gu(M)?_=!Hy(C,M):_=C!==M,_?C!=null?I(B):f.add(B):C!==void 0&&f.has(B)?I(B):x.protectedKeys[B]=!0}x.prevProp=w,x.prevResolvedValues=T,x.isActive&&(m={...m,...T}),s&&e.blockInitialAnimation&&(E=!1),E&&(!(N&&S)||P)&&p.push(...A.map(B=>({animation:B,options:{type:g}})))}if(f.size){const b={};f.forEach(g=>{const x=e.getBaseTarget(g),w=e.getValue(g);w&&(w.liveStyle=!0),b[g]=x??null}),p.push({animation:b})}let y=!!p.length;return s&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(y=!1),s=!1,y?t(p):Promise.resolve()}function l(c,u){var d;if(n[c].isActive===u)return Promise.resolve();(d=e.variantChildren)===null||d===void 0||d.forEach(f=>{var m;return(m=f.animationState)===null||m===void 0?void 0:m.setActive(c,u)}),n[c].isActive=u;const p=o(c);for(const f in n)n[f].protectedKeys={};return p}return{animateChanges:o,setActive:l,setAnimateFunction:a,getState:()=>n,reset:()=>{n=pm(),s=!0}}}function fS(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Hy(t,e):!1}function xs(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function pm(){return{animate:xs(!0),whileInView:xs(),whileHover:xs(),whileTap:xs(),whileDrag:xs(),whileFocus:xs(),exit:xs()}}class fs{constructor(t){this.isMounted=!1,this.node=t}update(){}}class pS extends fs{constructor(t){super(t),t.animationState||(t.animationState=hS(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Cl(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)===null||t===void 0||t.call(this)}}let mS=0;class gS extends fs{constructor(){super(...arguments),this.id=mS++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:s}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===s)return;const i=this.node.animationState.setActive("exit",!t);n&&!t&&i.then(()=>n(this.id))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}const xS={animation:{Feature:pS},exit:{Feature:gS}};function ra(e,t,n,s={passive:!0}){return e.addEventListener(t,n,s),()=>e.removeEventListener(t,n)}function ya(e){return{point:{x:e.pageX,y:e.pageY}}}const yS=e=>t=>Fh(t)&&e(t,ya(t));function Ti(e,t,n,s){return ra(e,t,yS(n),s)}const mm=(e,t)=>Math.abs(e-t);function vS(e,t){const n=mm(e.x,t.x),s=mm(e.y,t.y);return Math.sqrt(n**2+s**2)}class M1{constructor(t,n,{transformPagePoint:s,contextWindow:i,dragSnapToOrigin:a=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const p=Sc(this.lastMoveEventInfo,this.history),f=this.startEvent!==null,m=vS(p.offset,{x:0,y:0})>=3;if(!f&&!m)return;const{point:v}=p,{timestamp:y}=Ue;this.history.push({...v,timestamp:y});const{onStart:b,onMove:g}=this.handlers;f||(b&&b(this.lastMoveEvent,p),this.startEvent=this.lastMoveEvent),g&&g(this.lastMoveEvent,p)},this.handlePointerMove=(p,f)=>{this.lastMoveEvent=p,this.lastMoveEventInfo=Nc(f,this.transformPagePoint),ve.update(this.updatePoint,!0)},this.handlePointerUp=(p,f)=>{this.end();const{onEnd:m,onSessionEnd:v,resumeAnimation:y}=this.handlers;if(this.dragSnapToOrigin&&y&&y(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const b=Sc(p.type==="pointercancel"?this.lastMoveEventInfo:Nc(f,this.transformPagePoint),this.history);this.startEvent&&m&&m(p,b),v&&v(p,b)},!Fh(t))return;this.dragSnapToOrigin=a,this.handlers=n,this.transformPagePoint=s,this.contextWindow=i||window;const o=ya(t),l=Nc(o,this.transformPagePoint),{point:c}=l,{timestamp:u}=Ue;this.history=[{...c,timestamp:u}];const{onSessionStart:d}=n;d&&d(t,Sc(l,this.history)),this.removeListeners=xa(Ti(this.contextWindow,"pointermove",this.handlePointerMove),Ti(this.contextWindow,"pointerup",this.handlePointerUp),Ti(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),rs(this.updatePoint)}}function Nc(e,t){return t?{point:t(e.point)}:e}function gm(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Sc({point:e},t){return{point:e,delta:gm(e,R1(t)),offset:gm(e,bS(t)),velocity:wS(t,.1)}}function bS(e){return e[0]}function R1(e){return e[e.length-1]}function wS(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,s=null;const i=R1(e);for(;n>=0&&(s=e[n],!(i.timestamp-s.timestamp>kn(t)));)n--;if(!s)return{x:0,y:0};const a=jn(i.timestamp-s.timestamp);if(a===0)return{x:0,y:0};const o={x:(i.x-s.x)/a,y:(i.y-s.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}const z1=1e-4,kS=1-z1,jS=1+z1,L1=.01,NS=0-L1,SS=0+L1;function bt(e){return e.max-e.min}function CS(e,t,n){return Math.abs(e-t)<=n}function xm(e,t,n,s=.5){e.origin=s,e.originPoint=je(t.min,t.max,e.origin),e.scale=bt(n)/bt(t),e.translate=je(n.min,n.max,e.origin)-e.originPoint,(e.scale>=kS&&e.scale<=jS||isNaN(e.scale))&&(e.scale=1),(e.translate>=NS&&e.translate<=SS||isNaN(e.translate))&&(e.translate=0)}function Pi(e,t,n,s){xm(e.x,t.x,n.x,s?s.originX:void 0),xm(e.y,t.y,n.y,s?s.originY:void 0)}function ym(e,t,n){e.min=n.min+t.min,e.max=e.min+bt(t)}function ES(e,t,n){ym(e.x,t.x,n.x),ym(e.y,t.y,n.y)}function vm(e,t,n){e.min=t.min-n.min,e.max=e.min+bt(t)}function Ai(e,t,n){vm(e.x,t.x,n.x),vm(e.y,t.y,n.y)}function _S(e,{min:t,max:n},s){return t!==void 0&&e<t?e=s?je(t,e,s.min):Math.max(e,t):n!==void 0&&e>n&&(e=s?je(n,e,s.max):Math.min(e,n)),e}function bm(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function TS(e,{top:t,left:n,bottom:s,right:i}){return{x:bm(e.x,n,i),y:bm(e.y,t,s)}}function wm(e,t){let n=t.min-e.min,s=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,s]=[s,n]),{min:n,max:s}}function PS(e,t){return{x:wm(e.x,t.x),y:wm(e.y,t.y)}}function AS(e,t){let n=.5;const s=bt(e),i=bt(t);return i>s?n=Or(t.min,t.max-s,e.min):s>i&&(n=Or(e.min,e.max-i,t.min)),_n(0,1,n)}function MS(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const rd=.35;function RS(e=rd){return e===!1?e=0:e===!0&&(e=rd),{x:km(e,"left","right"),y:km(e,"top","bottom")}}function km(e,t,n){return{min:jm(e,t),max:jm(e,n)}}function jm(e,t){return typeof e=="number"?e:e[t]||0}const Nm=()=>({translate:0,scale:1,origin:0,originPoint:0}),yr=()=>({x:Nm(),y:Nm()}),Sm=()=>({min:0,max:0}),Te=()=>({x:Sm(),y:Sm()});function St(e){return[e("x"),e("y")]}function O1({top:e,left:t,right:n,bottom:s}){return{x:{min:t,max:n},y:{min:e,max:s}}}function zS({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function LS(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),s=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:s.y,right:s.x}}function Cc(e){return e===void 0||e===1}function id({scale:e,scaleX:t,scaleY:n}){return!Cc(e)||!Cc(t)||!Cc(n)}function ws(e){return id(e)||D1(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function D1(e){return Cm(e.x)||Cm(e.y)}function Cm(e){return e&&e!=="0%"}function sl(e,t,n){const s=e-n,i=t*s;return n+i}function Em(e,t,n,s,i){return i!==void 0&&(e=sl(e,i,s)),sl(e,n,s)+t}function ad(e,t=0,n=1,s,i){e.min=Em(e.min,t,n,s,i),e.max=Em(e.max,t,n,s,i)}function I1(e,{x:t,y:n}){ad(e.x,t.translate,t.scale,t.originPoint),ad(e.y,n.translate,n.scale,n.originPoint)}const _m=.999999999999,Tm=1.0000000000001;function OS(e,t,n,s=!1){const i=n.length;if(!i)return;t.x=t.y=1;let a,o;for(let l=0;l<i;l++){a=n[l],o=a.projectionDelta;const{visualElement:c}=a.options;c&&c.props.style&&c.props.style.display==="contents"||(s&&a.options.layoutScroll&&a.scroll&&a!==a.root&&br(e,{x:-a.scroll.offset.x,y:-a.scroll.offset.y}),o&&(t.x*=o.x.scale,t.y*=o.y.scale,I1(e,o)),s&&ws(a.latestValues)&&br(e,a.latestValues))}t.x<Tm&&t.x>_m&&(t.x=1),t.y<Tm&&t.y>_m&&(t.y=1)}function vr(e,t){e.min=e.min+t,e.max=e.max+t}function Pm(e,t,n,s,i=.5){const a=je(e.min,e.max,i);ad(e,t,n,a,s)}function br(e,t){Pm(e.x,t.x,t.scaleX,t.scale,t.originX),Pm(e.y,t.y,t.scaleY,t.scale,t.originY)}function B1(e,t){return O1(LS(e.getBoundingClientRect(),t))}function DS(e,t,n){const s=B1(e,n),{scroll:i}=t;return i&&(vr(s.x,i.offset.x),vr(s.y,i.offset.y)),s}const F1=({current:e})=>e?e.ownerDocument.defaultView:null,IS=new WeakMap;class BS{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Te(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const i=d=>{const{dragSnapToOrigin:p}=this.getProps();p?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(ya(d).point)},a=(d,p)=>{const{drag:f,dragPropagation:m,onDragStart:v}=this.getProps();if(f&&!m&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Aj(f),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),St(b=>{let g=this.getAxisMotionValue(b).get()||0;if(ln.test(g)){const{projection:x}=this.visualElement;if(x&&x.layout){const w=x.layout.layoutBox[b];w&&(g=bt(w)*(parseFloat(g)/100))}}this.originPoint[b]=g}),v&&ve.postRender(()=>v(d,p)),Xu(this.visualElement,"transform");const{animationState:y}=this.visualElement;y&&y.setActive("whileDrag",!0)},o=(d,p)=>{const{dragPropagation:f,dragDirectionLock:m,onDirectionLock:v,onDrag:y}=this.getProps();if(!f&&!this.openDragLock)return;const{offset:b}=p;if(m&&this.currentDirection===null){this.currentDirection=FS(b),this.currentDirection!==null&&v&&v(this.currentDirection);return}this.updateAxis("x",p.point,b),this.updateAxis("y",p.point,b),this.visualElement.render(),y&&y(d,p)},l=(d,p)=>this.stop(d,p),c=()=>St(d=>{var p;return this.getAnimationState(d)==="paused"&&((p=this.getAxisMotionValue(d).animation)===null||p===void 0?void 0:p.play())}),{dragSnapToOrigin:u}=this.getProps();this.panSession=new M1(t,{onSessionStart:i,onStart:a,onMove:o,onSessionEnd:l,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,contextWindow:F1(this.visualElement)})}stop(t,n){const s=this.isDragging;if(this.cancel(),!s)return;const{velocity:i}=n;this.startAnimation(i);const{onDragEnd:a}=this.getProps();a&&ve.postRender(()=>a(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:s}=this.getProps();!s&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,s){const{drag:i}=this.getProps();if(!s||!Wa(t,i,this.currentDirection))return;const a=this.getAxisMotionValue(t);let o=this.originPoint[t]+s[t];this.constraints&&this.constraints[t]&&(o=_S(o,this.constraints[t],this.elastic[t])),a.set(o)}resolveConstraints(){var t;const{dragConstraints:n,dragElastic:s}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(t=this.visualElement.projection)===null||t===void 0?void 0:t.layout,a=this.constraints;n&&gr(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&i?this.constraints=TS(i.layoutBox,n):this.constraints=!1,this.elastic=RS(s),a!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&St(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=MS(i.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!gr(t))return!1;const s=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const a=DS(s,i.root,this.visualElement.getTransformPagePoint());let o=PS(i.layout.layoutBox,a);if(n){const l=n(zS(o));this.hasMutatedConstraints=!!l,l&&(o=O1(l))}return o}startAnimation(t){const{drag:n,dragMomentum:s,dragElastic:i,dragTransition:a,dragSnapToOrigin:o,onDragTransitionEnd:l}=this.getProps(),c=this.constraints||{},u=St(d=>{if(!Wa(d,n,this.currentDirection))return;let p=c&&c[d]||{};o&&(p={min:0,max:0});const f=i?200:1e6,m=i?40:1e7,v={type:"inertia",velocity:s?t[d]:0,bounceStiffness:f,bounceDamping:m,timeConstant:750,restDelta:1,restSpeed:10,...a,...p};return this.startAxisValueAnimation(d,v)});return Promise.all(u).then(l)}startAxisValueAnimation(t,n){const s=this.getAxisMotionValue(t);return Xu(this.visualElement,t),s.start(Jh(t,s,0,n,this.visualElement,!1))}stopAnimation(){St(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){St(t=>{var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,s=this.visualElement.getProps(),i=s[n];return i||this.visualElement.getValue(t,(s.initial?s.initial[t]:void 0)||0)}snapToCursor(t){St(n=>{const{drag:s}=this.getProps();if(!Wa(n,s,this.currentDirection))return;const{projection:i}=this.visualElement,a=this.getAxisMotionValue(n);if(i&&i.layout){const{min:o,max:l}=i.layout.layoutBox[n];a.set(t[n]-je(o,l,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:s}=this.visualElement;if(!gr(n)||!s||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};St(o=>{const l=this.getAxisMotionValue(o);if(l&&this.constraints!==!1){const c=l.get();i[o]=AS({min:c,max:c},this.constraints[o])}});const{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},""):"none",s.root&&s.root.updateScroll(),s.updateLayout(),this.resolveConstraints(),St(o=>{if(!Wa(o,t,null))return;const l=this.getAxisMotionValue(o),{min:c,max:u}=this.constraints[o];l.set(je(c,u,i[o]))})}addListeners(){if(!this.visualElement.current)return;IS.set(this.visualElement,this);const t=this.visualElement.current,n=Ti(t,"pointerdown",c=>{const{drag:u,dragListener:d=!0}=this.getProps();u&&d&&this.start(c)}),s=()=>{const{dragConstraints:c}=this.getProps();gr(c)&&c.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,a=i.addEventListener("measure",s);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),ve.read(s);const o=ra(window,"resize",()=>this.scalePositionWithinConstraints()),l=i.addEventListener("didUpdate",({delta:c,hasLayoutChanged:u})=>{this.isDragging&&u&&(St(d=>{const p=this.getAxisMotionValue(d);p&&(this.originPoint[d]+=c[d].translate,p.set(p.get()+c[d].translate))}),this.visualElement.render())});return()=>{o(),n(),a(),l&&l()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:s=!1,dragPropagation:i=!1,dragConstraints:a=!1,dragElastic:o=rd,dragMomentum:l=!0}=t;return{...t,drag:n,dragDirectionLock:s,dragPropagation:i,dragConstraints:a,dragElastic:o,dragMomentum:l}}}function Wa(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function FS(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class VS extends fs{constructor(t){super(t),this.removeGroupControls=yt,this.removeListeners=yt,this.controls=new BS(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||yt}unmount(){this.removeGroupControls(),this.removeListeners()}}const Am=e=>(t,n)=>{e&&ve.postRender(()=>e(t,n))};class $S extends fs{constructor(){super(...arguments),this.removePointerDownListener=yt}onPointerDown(t){this.session=new M1(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:F1(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:s,onPanEnd:i}=this.node.getProps();return{onSessionStart:Am(t),onStart:Am(n),onMove:s,onEnd:(a,o)=>{delete this.session,i&&ve.postRender(()=>i(a,o))}}}mount(){this.removePointerDownListener=Ti(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const yo={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Mm(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const ai={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(X.test(e))e=parseFloat(e);else return e;const n=Mm(e,t.target.x),s=Mm(e,t.target.y);return`${n}% ${s}%`}},US={correct:(e,{treeScale:t,projectionDelta:n})=>{const s=e,i=is.parse(e);if(i.length>5)return s;const a=is.createTransformer(e),o=typeof i[0]!="number"?1:0,l=n.x.scale*t.x,c=n.y.scale*t.y;i[0+o]/=l,i[1+o]/=c;const u=je(l,c,.5);return typeof i[2+o]=="number"&&(i[2+o]/=u),typeof i[3+o]=="number"&&(i[3+o]/=u),a(i)}};class HS extends h.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:s,layoutId:i}=this.props,{projection:a}=t;uj(WS),a&&(n.group&&n.group.add(a),s&&s.register&&i&&s.register(a),a.root.didUpdate(),a.addEventListener("animationComplete",()=>{this.safeToRemove()}),a.setOptions({...a.options,onExitComplete:()=>this.safeToRemove()})),yo.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:s,drag:i,isPresent:a}=this.props,o=s.projection;return o&&(o.isPresent=a,i||t.layoutDependency!==n||n===void 0?o.willUpdate():this.safeToRemove(),t.isPresent!==a&&(a?o.promote():o.relegate()||ve.postRender(()=>{const l=o.getStack();(!l||!l.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),Eh.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:s}=this.props,{projection:i}=t;i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),s&&s.deregister&&s.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function V1(e){const[t,n]=ky(),s=h.useContext(wh);return r.jsx(HS,{...e,layoutGroup:s,switchLayoutGroup:h.useContext(Ay),isPresent:t,safeToRemove:n})}const WS={borderRadius:{...ai,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:ai,borderTopRightRadius:ai,borderBottomLeftRadius:ai,borderBottomRightRadius:ai,boxShadow:US};function KS(e,t,n){const s=Je(e)?e:na(e);return s.start(Jh("",s,t,n)),s.animation}function GS(e){return e instanceof SVGElement&&e.tagName!=="svg"}const qS=(e,t)=>e.depth-t.depth;class YS{constructor(){this.children=[],this.isDirty=!1}add(t){Vh(this.children,t),this.isDirty=!0}remove(t){$h(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(qS),this.isDirty=!1,this.children.forEach(t)}}function XS(e,t){const n=cn.now(),s=({timestamp:i})=>{const a=i-n;a>=t&&(rs(s),e(a-t))};return ve.read(s,!0),()=>rs(s)}const $1=["TopLeft","TopRight","BottomLeft","BottomRight"],QS=$1.length,Rm=e=>typeof e=="string"?parseFloat(e):e,zm=e=>typeof e=="number"||X.test(e);function JS(e,t,n,s,i,a){i?(e.opacity=je(0,n.opacity!==void 0?n.opacity:1,ZS(s)),e.opacityExit=je(t.opacity!==void 0?t.opacity:1,0,e4(s))):a&&(e.opacity=je(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,s));for(let o=0;o<QS;o++){const l=`border${$1[o]}Radius`;let c=Lm(t,l),u=Lm(n,l);if(c===void 0&&u===void 0)continue;c||(c=0),u||(u=0),c===0||u===0||zm(c)===zm(u)?(e[l]=Math.max(je(Rm(c),Rm(u),s),0),(ln.test(u)||ln.test(c))&&(e[l]+="%")):e[l]=u}(t.rotate||n.rotate)&&(e.rotate=je(t.rotate||0,n.rotate||0,s))}function Lm(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const ZS=U1(0,.5,o1),e4=U1(.5,.95,yt);function U1(e,t,n){return s=>s<e?0:s>t?1:n(Or(e,t,s))}function Om(e,t){e.min=t.min,e.max=t.max}function Nt(e,t){Om(e.x,t.x),Om(e.y,t.y)}function Dm(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function Im(e,t,n,s,i){return e-=t,e=sl(e,1/n,s),i!==void 0&&(e=sl(e,1/i,s)),e}function t4(e,t=0,n=1,s=.5,i,a=e,o=e){if(ln.test(t)&&(t=parseFloat(t),t=je(o.min,o.max,t/100)-o.min),typeof t!="number")return;let l=je(a.min,a.max,s);e===a&&(l-=t),e.min=Im(e.min,t,n,l,i),e.max=Im(e.max,t,n,l,i)}function Bm(e,t,[n,s,i],a,o){t4(e,t[n],t[s],t[i],t.scale,a,o)}const n4=["x","scaleX","originX"],s4=["y","scaleY","originY"];function Fm(e,t,n,s){Bm(e.x,t,n4,n?n.x:void 0,s?s.x:void 0),Bm(e.y,t,s4,n?n.y:void 0,s?s.y:void 0)}function Vm(e){return e.translate===0&&e.scale===1}function H1(e){return Vm(e.x)&&Vm(e.y)}function $m(e,t){return e.min===t.min&&e.max===t.max}function r4(e,t){return $m(e.x,t.x)&&$m(e.y,t.y)}function Um(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function W1(e,t){return Um(e.x,t.x)&&Um(e.y,t.y)}function Hm(e){return bt(e.x)/bt(e.y)}function Wm(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class i4{constructor(){this.members=[]}add(t){Vh(this.members,t),t.scheduleRender()}remove(t){if($h(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(i=>t===i);if(n===0)return!1;let s;for(let i=n;i>=0;i--){const a=this.members[i];if(a.isPresent!==!1){s=a;break}}return s?(this.promote(s),!0):!1}promote(t,n){const s=this.lead;if(t!==s&&(this.prevLead=s,this.lead=t,t.show(),s)){s.instance&&s.scheduleRender(),t.scheduleRender(),t.resumeFrom=s,n&&(t.resumeFrom.preserveOpacity=!0),s.snapshot&&(t.snapshot=s.snapshot,t.snapshot.latestValues=s.animationValues||s.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:i}=t.options;i===!1&&s.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:s}=t;n.onExitComplete&&n.onExitComplete(),s&&s.options.onExitComplete&&s.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function a4(e,t,n){let s="";const i=e.x.translate/t.x,a=e.y.translate/t.y,o=(n==null?void 0:n.z)||0;if((i||a||o)&&(s=`translate3d(${i}px, ${a}px, ${o}px) `),(t.x!==1||t.y!==1)&&(s+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:u,rotate:d,rotateX:p,rotateY:f,skewX:m,skewY:v}=n;u&&(s=`perspective(${u}px) ${s}`),d&&(s+=`rotate(${d}deg) `),p&&(s+=`rotateX(${p}deg) `),f&&(s+=`rotateY(${f}deg) `),m&&(s+=`skewX(${m}deg) `),v&&(s+=`skewY(${v}deg) `)}const l=e.x.scale*t.x,c=e.y.scale*t.y;return(l!==1||c!==1)&&(s+=`scale(${l}, ${c})`),s||"none"}const ks={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},mi=typeof window<"u"&&window.MotionDebug!==void 0,Ec=["","X","Y","Z"],o4={visibility:"hidden"},Km=1e3;let l4=0;function _c(e,t,n,s){const{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),s&&(s[e]=0))}function K1(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=e1(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:a}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",ve,!(i||a))}const{parent:s}=e;s&&!s.hasCheckedOptimisedAppear&&K1(s)}function G1({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:s,resetTransform:i}){return class{constructor(o={},l=t==null?void 0:t()){this.id=l4++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,mi&&(ks.totalNodes=ks.resolvedTargetDeltas=ks.recalculatedProjection=0),this.nodes.forEach(d4),this.nodes.forEach(g4),this.nodes.forEach(x4),this.nodes.forEach(h4),mi&&window.MotionDebug.record(ks)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=l?l.root||l:this,this.path=l?[...l.path,l]:[],this.parent=l,this.depth=l?l.depth+1:0;for(let c=0;c<this.path.length;c++)this.path[c].shouldResetTransform=!0;this.root===this&&(this.nodes=new YS)}addEventListener(o,l){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new Uh),this.eventHandlers.get(o).add(l)}notifyListeners(o,...l){const c=this.eventHandlers.get(o);c&&c.notify(...l)}hasListeners(o){return this.eventHandlers.has(o)}mount(o,l=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=GS(o),this.instance=o;const{layoutId:c,layout:u,visualElement:d}=this.options;if(d&&!d.current&&d.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),l&&(u||c)&&(this.isLayoutDirty=!0),e){let p;const f=()=>this.root.updateBlockedByResize=!1;e(o,()=>{this.root.updateBlockedByResize=!0,p&&p(),p=XS(f,250),yo.hasAnimatedSinceResize&&(yo.hasAnimatedSinceResize=!1,this.nodes.forEach(qm))})}c&&this.root.registerSharedNode(c,this),this.options.animate!==!1&&d&&(c||u)&&this.addEventListener("didUpdate",({delta:p,hasLayoutChanged:f,hasRelativeTargetChanged:m,layout:v})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const y=this.options.transition||d.getDefaultTransition()||k4,{onLayoutAnimationStart:b,onLayoutAnimationComplete:g}=d.getProps(),x=!this.targetLayout||!W1(this.targetLayout,v)||m,w=!f&&m;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||w||f&&(x||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(p,w);const j={...Dh(y,"layout"),onPlay:b,onComplete:g};(d.shouldReduceMotion||this.options.layoutRoot)&&(j.delay=0,j.type=!1),this.startAnimation(j)}else f||qm(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=v})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,rs(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(y4),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&K1(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d<this.path.length;d++){const p=this.path[d];p.shouldResetTransform=!0,p.updateScroll("snapshot"),p.options.layoutRoot&&p.willUpdate(!1)}const{layoutId:l,layout:c}=this.options;if(l===void 0&&!c)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(Gm);return}this.isUpdating||this.nodes.forEach(p4),this.isUpdating=!1,this.nodes.forEach(m4),this.nodes.forEach(c4),this.nodes.forEach(u4),this.clearAllSnapshots();const l=cn.now();Ue.delta=_n(0,1e3/60,l-Ue.timestamp),Ue.timestamp=l,Ue.isProcessing=!0,yc.update.process(Ue),yc.preRender.process(Ue),yc.render.process(Ue),Ue.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Eh.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(f4),this.sharedNodes.forEach(v4)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,ve.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){ve.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c<this.path.length;c++)this.path[c].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutCorrected=Te(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:l}=this.options;l&&l.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let l=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(l=!1),l){const c=s(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:c,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:c}}}resetTransform(){if(!i)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,l=this.projectionDelta&&!H1(this.projectionDelta),c=this.getTransformTemplate(),u=c?c(this.latestValues,""):void 0,d=u!==this.prevTransformTemplateValue;o&&(l||ws(this.latestValues)||d)&&(i(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const l=this.measurePageBox();let c=this.removeElementScroll(l);return o&&(c=this.removeTransform(c)),j4(c),{animationId:this.root.animationId,measuredBox:l,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){var o;const{visualElement:l}=this.options;if(!l)return Te();const c=l.measureViewportBox();if(!(((o=this.scroll)===null||o===void 0?void 0:o.wasRoot)||this.path.some(N4))){const{scroll:d}=this.root;d&&(vr(c.x,d.offset.x),vr(c.y,d.offset.y))}return c}removeElementScroll(o){var l;const c=Te();if(Nt(c,o),!((l=this.scroll)===null||l===void 0)&&l.wasRoot)return c;for(let u=0;u<this.path.length;u++){const d=this.path[u],{scroll:p,options:f}=d;d!==this.root&&p&&f.layoutScroll&&(p.wasRoot&&Nt(c,o),vr(c.x,p.offset.x),vr(c.y,p.offset.y))}return c}applyTransform(o,l=!1){const c=Te();Nt(c,o);for(let u=0;u<this.path.length;u++){const d=this.path[u];!l&&d.options.layoutScroll&&d.scroll&&d!==d.root&&br(c,{x:-d.scroll.offset.x,y:-d.scroll.offset.y}),ws(d.latestValues)&&br(c,d.latestValues)}return ws(this.latestValues)&&br(c,this.latestValues),c}removeTransform(o){const l=Te();Nt(l,o);for(let c=0;c<this.path.length;c++){const u=this.path[c];if(!u.instance||!ws(u.latestValues))continue;id(u.latestValues)&&u.updateSnapshot();const d=Te(),p=u.measurePageBox();Nt(d,p),Fm(l,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,d)}return ws(this.latestValues)&&Fm(l,this.latestValues),l}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Ue.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var l;const c=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=c.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=c.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=c.isSharedProjectionDirty);const u=!!this.resumingFrom||this!==c;if(!(o||u&&this.isSharedProjectionDirty||this.isProjectionDirty||!((l=this.parent)===null||l===void 0)&&l.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:p,layoutId:f}=this.options;if(!(!this.layout||!(p||f))){if(this.resolvedRelativeTargetAt=Ue.timestamp,!this.targetDelta&&!this.relativeTarget){const m=this.getClosestProjectingParent();m&&m.layout&&this.animationProgress!==1?(this.relativeParent=m,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Te(),this.relativeTargetOrigin=Te(),Ai(this.relativeTargetOrigin,this.layout.layoutBox,m.layout.layoutBox),Nt(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=Te(),this.targetWithTransforms=Te()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),ES(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Nt(this.target,this.layout.layoutBox),I1(this.target,this.targetDelta)):Nt(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const m=this.getClosestProjectingParent();m&&!!m.resumingFrom==!!this.resumingFrom&&!m.options.layoutScroll&&m.target&&this.animationProgress!==1?(this.relativeParent=m,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Te(),this.relativeTargetOrigin=Te(),Ai(this.relativeTargetOrigin,this.target,m.target),Nt(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}mi&&ks.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||id(this.parent.latestValues)||D1(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var o;const l=this.getLead(),c=!!this.resumingFrom||this!==l;let u=!0;if((this.isProjectionDirty||!((o=this.parent)===null||o===void 0)&&o.isProjectionDirty)&&(u=!1),c&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(u=!1),this.resolvedRelativeTargetAt===Ue.timestamp&&(u=!1),u)return;const{layout:d,layoutId:p}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(d||p))return;Nt(this.layoutCorrected,this.layout.layoutBox);const f=this.treeScale.x,m=this.treeScale.y;OS(this.layoutCorrected,this.treeScale,this.path,c),l.layout&&!l.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(l.target=l.layout.layoutBox,l.targetWithTransforms=Te());const{target:v}=l;if(!v){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Dm(this.prevProjectionDelta.x,this.projectionDelta.x),Dm(this.prevProjectionDelta.y,this.projectionDelta.y)),Pi(this.projectionDelta,this.layoutCorrected,v,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==m||!Wm(this.projectionDelta.x,this.prevProjectionDelta.x)||!Wm(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",v)),mi&&ks.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var l;if((l=this.options.visualElement)===null||l===void 0||l.scheduleRender(),o){const c=this.getStack();c&&c.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=yr(),this.projectionDelta=yr(),this.projectionDeltaWithTransform=yr()}setAnimationOrigin(o,l=!1){const c=this.snapshot,u=c?c.latestValues:{},d={...this.latestValues},p=yr();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!l;const f=Te(),m=c?c.source:void 0,v=this.layout?this.layout.source:void 0,y=m!==v,b=this.getStack(),g=!b||b.members.length<=1,x=!!(y&&!g&&this.options.crossfade===!0&&!this.path.some(w4));this.animationProgress=0;let w;this.mixTargetDelta=j=>{const k=j/1e3;Ym(p.x,o.x,k),Ym(p.y,o.y,k),this.setTargetDelta(p),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Ai(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),b4(this.relativeTarget,this.relativeTargetOrigin,f,k),w&&r4(this.relativeTarget,w)&&(this.isProjectionDirty=!1),w||(w=Te()),Nt(w,this.relativeTarget)),y&&(this.animationValues=d,JS(d,u,this.latestValues,k,x,g)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=k},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(rs(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=ve.update(()=>{yo.hasAnimatedSinceResize=!0,this.currentAnimation=KS(0,Km,{...o,onUpdate:l=>{this.mixTargetDelta(l),o.onUpdate&&o.onUpdate(l)},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Km),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:l,target:c,layout:u,latestValues:d}=o;if(!(!l||!c||!u)){if(this!==o&&this.layout&&u&&q1(this.options.animationType,this.layout.layoutBox,u.layoutBox)){c=this.target||Te();const p=bt(this.layout.layoutBox.x);c.x.min=o.target.x.min,c.x.max=c.x.min+p;const f=bt(this.layout.layoutBox.y);c.y.min=o.target.y.min,c.y.max=c.y.min+f}Nt(l,c),br(l,d),Pi(this.projectionDeltaWithTransform,this.layoutCorrected,l,d)}}registerSharedNode(o,l){this.sharedNodes.has(o)||this.sharedNodes.set(o,new i4),this.sharedNodes.get(o).add(l);const u=l.options.initialPromotionConfig;l.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(l):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var o;const{layoutId:l}=this.options;return l?((o=this.getStack())===null||o===void 0?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:l}=this.options;return l?(o=this.getStack())===null||o===void 0?void 0:o.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:l,preserveFollowOpacity:c}={}){const u=this.getStack();u&&u.promote(this,c),o&&(this.projectionDelta=void 0,this.needsReset=!0),l&&this.setOptions({transition:l})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let l=!1;const{latestValues:c}=o;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(l=!0),!l)return;const u={};c.z&&_c("z",o,u,this.animationValues);for(let d=0;d<Ec.length;d++)_c(`rotate${Ec[d]}`,o,u,this.animationValues),_c(`skew${Ec[d]}`,o,u,this.animationValues);o.render();for(const d in u)o.setStaticValue(d,u[d]),this.animationValues&&(this.animationValues[d]=u[d]);o.scheduleRender()}getProjectionStyles(o){var l,c;if(!this.instance||this.isSVG)return;if(!this.isVisible)return o4;const u={visibility:""},d=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,u.opacity="",u.pointerEvents=go(o==null?void 0:o.pointerEvents)||"",u.transform=d?d(this.latestValues,""):"none",u;const p=this.getLead();if(!this.projectionDelta||!this.layout||!p.target){const y={};return this.options.layoutId&&(y.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,y.pointerEvents=go(o==null?void 0:o.pointerEvents)||""),this.hasProjected&&!ws(this.latestValues)&&(y.transform=d?d({},""):"none",this.hasProjected=!1),y}const f=p.animationValues||p.latestValues;this.applyTransformsToTarget(),u.transform=a4(this.projectionDeltaWithTransform,this.treeScale,f),d&&(u.transform=d(f,u.transform));const{x:m,y:v}=this.projectionDelta;u.transformOrigin=`${m.origin*100}% ${v.origin*100}% 0`,p.animationValues?u.opacity=p===this?(c=(l=f.opacity)!==null&&l!==void 0?l:this.latestValues.opacity)!==null&&c!==void 0?c:1:this.preserveOpacity?this.latestValues.opacity:f.opacityExit:u.opacity=p===this?f.opacity!==void 0?f.opacity:"":f.opacityExit!==void 0?f.opacityExit:0;for(const y in Jo){if(f[y]===void 0)continue;const{correct:b,applyTo:g}=Jo[y],x=u.transform==="none"?f[y]:b(f[y],p);if(g){const w=g.length;for(let j=0;j<w;j++)u[g[j]]=x}else u[y]=x}return this.options.layoutId&&(u.pointerEvents=p===this?go(o==null?void 0:o.pointerEvents)||"":"none"),u}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var l;return(l=o.currentAnimation)===null||l===void 0?void 0:l.stop()}),this.root.nodes.forEach(Gm),this.root.sharedNodes.clear()}}}function c4(e){e.updateLayout()}function u4(e){var t;const n=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:s,measuredBox:i}=e.layout,{animationType:a}=e.options,o=n.source!==e.layout.source;a==="size"?St(p=>{const f=o?n.measuredBox[p]:n.layoutBox[p],m=bt(f);f.min=s[p].min,f.max=f.min+m}):q1(a,n.layoutBox,s)&&St(p=>{const f=o?n.measuredBox[p]:n.layoutBox[p],m=bt(s[p]);f.max=f.min+m,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[p].max=e.relativeTarget[p].min+m)});const l=yr();Pi(l,s,n.layoutBox);const c=yr();o?Pi(c,e.applyTransform(i,!0),n.measuredBox):Pi(c,s,n.layoutBox);const u=!H1(l);let d=!1;if(!e.resumeFrom){const p=e.getClosestProjectingParent();if(p&&!p.resumeFrom){const{snapshot:f,layout:m}=p;if(f&&m){const v=Te();Ai(v,n.layoutBox,f.layoutBox);const y=Te();Ai(y,s,m.layoutBox),W1(v,y)||(d=!0),p.options.layoutRoot&&(e.relativeTarget=y,e.relativeTargetOrigin=v,e.relativeParent=p)}}}e.notifyListeners("didUpdate",{layout:s,snapshot:n,delta:c,layoutDelta:l,hasLayoutChanged:u,hasRelativeTargetChanged:d})}else if(e.isLead()){const{onExitComplete:s}=e.options;s&&s()}e.options.transition=void 0}function d4(e){mi&&ks.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function h4(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function f4(e){e.clearSnapshot()}function Gm(e){e.clearMeasurements()}function p4(e){e.isLayoutDirty=!1}function m4(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function qm(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function g4(e){e.resolveTargetDelta()}function x4(e){e.calcProjection()}function y4(e){e.resetSkewAndRotation()}function v4(e){e.removeLeadSnapshot()}function Ym(e,t,n){e.translate=je(t.translate,0,n),e.scale=je(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Xm(e,t,n,s){e.min=je(t.min,n.min,s),e.max=je(t.max,n.max,s)}function b4(e,t,n,s){Xm(e.x,t.x,n.x,s),Xm(e.y,t.y,n.y,s)}function w4(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const k4={duration:.45,ease:[.4,0,.1,1]},Qm=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Jm=Qm("applewebkit/")&&!Qm("chrome/")?Math.round:yt;function Zm(e){e.min=Jm(e.min),e.max=Jm(e.max)}function j4(e){Zm(e.x),Zm(e.y)}function q1(e,t,n){return e==="position"||e==="preserve-aspect"&&!CS(Hm(t),Hm(n),.2)}function N4(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}const S4=G1({attachResizeListener:(e,t)=>ra(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Tc={current:void 0},Y1=G1({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Tc.current){const e=new S4({});e.mount(window),e.setOptions({layoutScroll:!0}),Tc.current=e}return Tc.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),C4={pan:{Feature:$S},drag:{Feature:VS,ProjectionNode:Y1,MeasureLayout:V1}};function e0(e,t,n){const{props:s}=e;e.animationState&&s.whileHover&&e.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,a=s[i];a&&ve.postRender(()=>a(t,ya(t)))}class E4 extends fs{mount(){const{current:t}=this.node;t&&(this.unmount=Cj(t,n=>(e0(this.node,n,"Start"),s=>e0(this.node,s,"End"))))}unmount(){}}class _4 extends fs{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=xa(ra(this.node.current,"focus",()=>this.onFocus()),ra(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function t0(e,t,n){const{props:s}=e;e.animationState&&s.whileTap&&e.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),a=s[i];a&&ve.postRender(()=>a(t,ya(t)))}class T4 extends fs{mount(){const{current:t}=this.node;t&&(this.unmount=Pj(t,n=>(t0(this.node,n,"Start"),(s,{success:i})=>t0(this.node,s,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const od=new WeakMap,Pc=new WeakMap,P4=e=>{const t=od.get(e.target);t&&t(e)},A4=e=>{e.forEach(P4)};function M4({root:e,...t}){const n=e||document;Pc.has(n)||Pc.set(n,{});const s=Pc.get(n),i=JSON.stringify(t);return s[i]||(s[i]=new IntersectionObserver(A4,{root:e,...t})),s[i]}function R4(e,t,n){const s=M4(t);return od.set(e,n),s.observe(e),()=>{od.delete(e),s.unobserve(e)}}const z4={some:0,all:1};class L4 extends fs{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:s,amount:i="some",once:a}=t,o={root:n?n.current:void 0,rootMargin:s,threshold:typeof i=="number"?i:z4[i]},l=c=>{const{isIntersecting:u}=c;if(this.isInView===u||(this.isInView=u,a&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:d,onViewportLeave:p}=this.node.getProps(),f=u?d:p;f&&f(c)};return R4(this.node.current,o,l)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(O4(t,n))&&this.startObserver()}unmount(){}}function O4({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const D4={inView:{Feature:L4},tap:{Feature:T4},focus:{Feature:_4},hover:{Feature:E4}},I4={layout:{ProjectionNode:Y1,MeasureLayout:V1}},ld={current:null},X1={current:!1};function B4(){if(X1.current=!0,!!kh)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>ld.current=e.matches;e.addListener(t),t()}else ld.current=!1}const F4=[...w1,Ye,is],V4=e=>F4.find(b1(e)),n0=new WeakMap;function $4(e,t,n){for(const s in t){const i=t[s],a=n[s];if(Je(i))e.addValue(s,i);else if(Je(a))e.addValue(s,na(i,{owner:e}));else if(a!==i)if(e.hasValue(s)){const o=e.getValue(s);o.liveStyle===!0?o.jump(i):o.hasAnimated||o.set(i)}else{const o=e.getStaticValue(s);e.addValue(s,na(o!==void 0?o:i,{owner:e}))}}for(const s in n)t[s]===void 0&&e.removeValue(s);return t}const s0=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class U4{scrapeMotionValuesFromProps(t,n,s){return{}}constructor({parent:t,props:n,presenceContext:s,reducedMotionConfig:i,blockInitialAnimation:a,visualState:o},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Yh,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const m=cn.now();this.renderScheduledAt<m&&(this.renderScheduledAt=m,ve.render(this.render,!1,!0))};const{latestValues:c,renderState:u,onUpdate:d}=o;this.onUpdate=d,this.latestValues=c,this.baseTarget={...c},this.initialValues=n.initial?{...c}:{},this.renderState=u,this.parent=t,this.props=n,this.presenceContext=s,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.options=l,this.blockInitialAnimation=!!a,this.isControllingVariants=El(n),this.isVariantNode=Ty(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:p,...f}=this.scrapeMotionValuesFromProps(n,{},this);for(const m in f){const v=f[m];c[m]!==void 0&&Je(v)&&v.set(c[m],!1)}}mount(t){this.current=t,n0.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,s)=>this.bindToMotionValue(s,n)),X1.current||B4(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:ld.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){n0.delete(this.current),this.projection&&this.projection.unmount(),rs(this.notifyUpdate),rs(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const s=Vs.has(t),i=n.on("change",l=>{this.latestValues[t]=l,this.props.onUpdate&&ve.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0)}),a=n.on("renderRequest",this.scheduleRender);let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{i(),a(),o&&o(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Dr){const n=Dr[t];if(!n)continue;const{isEnabled:s,Feature:i}=n;if(!this.features[t]&&i&&s(this.props)&&(this.features[t]=new i(this)),this.features[t]){const a=this.features[t];a.isMounted?a.update():(a.mount(),a.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Te()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let s=0;s<s0.length;s++){const i=s0[s];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const a="on"+i,o=t[a];o&&(this.propEventSubscriptions[i]=this.on(i,o))}this.prevMotionValues=$4(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const s=this.values.get(t);n!==s&&(s&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let s=this.values.get(t);return s===void 0&&n!==void 0&&(s=na(n===null?void 0:n,{owner:this}),this.addValue(t,s)),s}readValue(t,n){var s;let i=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(s=this.getBaseTargetFromProps(this.props,t))!==null&&s!==void 0?s:this.readValueFromInstance(this.current,t,this.options);return i!=null&&(typeof i=="string"&&(y1(i)||c1(i))?i=parseFloat(i):!V4(i)&&is.test(n)&&(i=m1(t,n)),this.setBaseTarget(t,Je(i)?i.get():i)),Je(i)?i.get():i}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:s}=this.props;let i;if(typeof s=="string"||typeof s=="object"){const o=Th(this.props,s,(n=this.presenceContext)===null||n===void 0?void 0:n.custom);o&&(i=o[t])}if(s&&i!==void 0)return i;const a=this.getBaseTargetFromProps(this.props,t);return a!==void 0&&!Je(a)?a:this.initialValues[t]!==void 0&&i===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Uh),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class Q1 extends U4{constructor(){super(...arguments),this.KeyframeResolver=k1}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:s}){delete n[t],delete s[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Je(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function H4(e){return window.getComputedStyle(e)}class W4 extends Q1{constructor(){super(...arguments),this.type="html",this.renderInstance=Iy}readValueFromInstance(t,n){if(Vs.has(n)){const s=qh(n);return s&&s.default||0}else{const s=H4(t),i=(Ly(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return B1(t,n)}build(t,n,s){Mh(t,n,s.transformTemplate)}scrapeMotionValuesFromProps(t,n,s){return Oh(t,n,s)}}class K4 extends Q1{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Te}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Vs.has(n)){const s=qh(n);return s&&s.default||0}return n=By.has(n)?n:Ch(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,s){return $y(t,n,s)}build(t,n,s){Rh(t,n,this.isSVGTag,s.transformTemplate)}renderInstance(t,n,s,i){Fy(t,n,s,i)}mount(t){this.isSVGTag=Lh(t.tagName),super.mount(t)}}const G4=(e,t)=>_h(e)?new K4(t):new W4(t,{allowProjection:e!==h.Fragment}),q4=vj({...xS,...D4,...C4,...I4},G4),H=z5(q4);/**
77
77
  * @license lucide-react v0.462.0 - ISC
78
78
  *
79
79
  * This source code is licensed under the ISC license.
@@ -178,7 +178,7 @@ Error generating stack: `+a.message+`
178
178
  *
179
179
  * This source code is licensed under the ISC license.
180
180
  * See the LICENSE file in the root directory of this source tree.
181
- */const Kr=D("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
181
+ */const Gr=D("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
182
182
  * @license lucide-react v0.462.0 - ISC
183
183
  *
184
184
  * This source code is licensed under the ISC license.
@@ -193,7 +193,7 @@ Error generating stack: `+a.message+`
193
193
  *
194
194
  * This source code is licensed under the ISC license.
195
195
  * See the LICENSE file in the root directory of this source tree.
196
- */const Ml=D("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
196
+ */const Al=D("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
197
197
  * @license lucide-react v0.462.0 - ISC
198
198
  *
199
199
  * This source code is licensed under the ISC license.
@@ -203,7 +203,7 @@ Error generating stack: `+a.message+`
203
203
  *
204
204
  * This source code is licensed under the ISC license.
205
205
  * See the LICENSE file in the root directory of this source tree.
206
- */const br=D("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
206
+ */const wr=D("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
207
207
  * @license lucide-react v0.462.0 - ISC
208
208
  *
209
209
  * This source code is licensed under the ISC license.
@@ -258,7 +258,7 @@ Error generating stack: `+a.message+`
258
258
  *
259
259
  * This source code is licensed under the ISC license.
260
260
  * See the LICENSE file in the root directory of this source tree.
261
- */const Ai=D("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
261
+ */const Mi=D("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
262
262
  * @license lucide-react v0.462.0 - ISC
263
263
  *
264
264
  * This source code is licensed under the ISC license.
@@ -273,7 +273,7 @@ Error generating stack: `+a.message+`
273
273
  *
274
274
  * This source code is licensed under the ISC license.
275
275
  * See the LICENSE file in the root directory of this source tree.
276
- */const Al=D("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/**
276
+ */const Ml=D("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/**
277
277
  * @license lucide-react v0.462.0 - ISC
278
278
  *
279
279
  * This source code is licensed under the ISC license.
@@ -393,12 +393,12 @@ Error generating stack: `+a.message+`
393
393
  *
394
394
  * This source code is licensed under the ISC license.
395
395
  * See the LICENSE file in the root directory of this source tree.
396
- */const Mc=D("Library",[["path",{d:"m16 6 4 14",key:"ji33uf"}],["path",{d:"M12 6v14",key:"1n7gus"}],["path",{d:"M8 8v12",key:"1gg7y9"}],["path",{d:"M4 4v16",key:"6qkkli"}]]);/**
396
+ */const Ac=D("Library",[["path",{d:"m16 6 4 14",key:"ji33uf"}],["path",{d:"M12 6v14",key:"1n7gus"}],["path",{d:"M8 8v12",key:"1gg7y9"}],["path",{d:"M4 4v16",key:"6qkkli"}]]);/**
397
397
  * @license lucide-react v0.462.0 - ISC
398
398
  *
399
399
  * This source code is licensed under the ISC license.
400
400
  * See the LICENSE file in the root directory of this source tree.
401
- */const Gr=D("Link2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);/**
401
+ */const qr=D("Link2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);/**
402
402
  * @license lucide-react v0.462.0 - ISC
403
403
  *
404
404
  * This source code is licensed under the ISC license.
@@ -503,7 +503,7 @@ Error generating stack: `+a.message+`
503
503
  *
504
504
  * This source code is licensed under the ISC license.
505
505
  * See the LICENSE file in the root directory of this source tree.
506
- */const qr=D("Package",[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["path",{d:"m3.3 7 7.703 4.734a2 2 0 0 0 1.994 0L20.7 7",key:"yx3hmr"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]);/**
506
+ */const $s=D("Package",[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["path",{d:"m3.3 7 7.703 4.734a2 2 0 0 0 1.994 0L20.7 7",key:"yx3hmr"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]);/**
507
507
  * @license lucide-react v0.462.0 - ISC
508
508
  *
509
509
  * This source code is licensed under the ISC license.
@@ -533,12 +533,12 @@ Error generating stack: `+a.message+`
533
533
  *
534
534
  * This source code is licensed under the ISC license.
535
535
  * See the LICENSE file in the root directory of this source tree.
536
- */const $s=D("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
536
+ */const Us=D("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
537
537
  * @license lucide-react v0.462.0 - ISC
538
538
  *
539
539
  * This source code is licensed under the ISC license.
540
540
  * See the LICENSE file in the root directory of this source tree.
541
- */const MC=D("Plug",[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M9 8V2",key:"14iosj"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z",key:"osxo6l"}]]);/**
541
+ */const AC=D("Plug",[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M9 8V2",key:"14iosj"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z",key:"osxo6l"}]]);/**
542
542
  * @license lucide-react v0.462.0 - ISC
543
543
  *
544
544
  * This source code is licensed under the ISC license.
@@ -548,7 +548,7 @@ Error generating stack: `+a.message+`
548
548
  *
549
549
  * This source code is licensed under the ISC license.
550
550
  * See the LICENSE file in the root directory of this source tree.
551
- */const Ir=D("Puzzle",[["path",{d:"M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z",key:"w46dr5"}]]);/**
551
+ */const Br=D("Puzzle",[["path",{d:"M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z",key:"w46dr5"}]]);/**
552
552
  * @license lucide-react v0.462.0 - ISC
553
553
  *
554
554
  * This source code is licensed under the ISC license.
@@ -568,7 +568,7 @@ Error generating stack: `+a.message+`
568
568
  *
569
569
  * This source code is licensed under the ISC license.
570
570
  * See the LICENSE file in the root directory of this source tree.
571
- */const AC=D("Scale",[["path",{d:"m16 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z",key:"7g6ntu"}],["path",{d:"m2 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z",key:"ijws7r"}],["path",{d:"M7 21h10",key:"1b0cd5"}],["path",{d:"M12 3v18",key:"108xh3"}],["path",{d:"M3 7h2c2 0 5-1 7-2 2 1 5 2 7 2h2",key:"3gwbw2"}]]);/**
571
+ */const MC=D("Scale",[["path",{d:"m16 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z",key:"7g6ntu"}],["path",{d:"m2 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z",key:"ijws7r"}],["path",{d:"M7 21h10",key:"1b0cd5"}],["path",{d:"M12 3v18",key:"108xh3"}],["path",{d:"M3 7h2c2 0 5-1 7-2 2 1 5 2 7 2h2",key:"3gwbw2"}]]);/**
572
572
  * @license lucide-react v0.462.0 - ISC
573
573
  *
574
574
  * This source code is licensed under the ISC license.
@@ -658,7 +658,7 @@ Error generating stack: `+a.message+`
658
658
  *
659
659
  * This source code is licensed under the ISC license.
660
660
  * See the LICENSE file in the root directory of this source tree.
661
- */const Us=D("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
661
+ */const Hs=D("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
662
662
  * @license lucide-react v0.462.0 - ISC
663
663
  *
664
664
  * This source code is licensed under the ISC license.
@@ -688,7 +688,7 @@ Error generating stack: `+a.message+`
688
688
  *
689
689
  * This source code is licensed under the ISC license.
690
690
  * See the LICENSE file in the root directory of this source tree.
691
- */const Hs=D("WifiOff",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
691
+ */const Ws=D("WifiOff",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
692
692
  * @license lucide-react v0.462.0 - ISC
693
693
  *
694
694
  * This source code is licensed under the ISC license.
@@ -713,19 +713,19 @@ Error generating stack: `+a.message+`
713
713
  *
714
714
  * This source code is licensed under the ISC license.
715
715
  * See the LICENSE file in the root directory of this source tree.
716
- */const ze=D("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),xv={welcome:{tagline:"Your AI Brain",title:"Must-b",sleeping:"Sleeping...",waking:"Waking up...",awake:"Awakening...",wakeBtn:"Wake Must-b",wakeHint:"Tap to continue",reconfigure:"Reconfigure",footer:"© 2026 Must-b — Auto Step Platform"},sidebar:{newChat:"New Chat",recentChats:"Recent Chats",primary:"Primary",personalization:"Personalization",platform:"Platform",system:"System",automations:"My Automations",activeWorkflows:"Active Workflows",products:"Skills & Plugins",clients:"Client Management",integrations:"Integrations",logs:"Logs & Activity",settings:"Settings",logout:"Logout",poweredBy:"Powered by",deleteChat:"Delete Chat?",deleteConfirm:"This action cannot be undone.",cancel:"Cancel",delete:"Delete"},rightPanel:{agentRole:"Agent Role",hardware:"Hardware Score",model:"Active Model",connected:"Gateway Connected",rank:{master:"Master",planner:"Planner",worker:"Worker"}},workflow:{title:"Active Workflow",idle:"Idle — awaiting task",goal:"Goal",steps:{browse:"Opening browser",write:"Writing file",think:"Thinking",exec:"Executing command"}},dashboard:{placeholder:"Send a message to Must-b...",thinking:"Must-b is thinking..."},layout:{chats:"Chats",system:"System",openChats:"Open chat history",openSystem:"Open system panel",closePanel:"Close panel"},chat:{inputPlaceholder:"Ask Must-b anything…",listening:"Listening…",thoughtProcess:"Thought Process",saveAsSkill:"Save as Skill",skillSaved:"Skill saved to your library!",saving:"Saving…",retry:"Retry",save:"Save",guidance:"Guidance",errorBoundary:"Chat rendering error — reloading…",disclaimer:"Must-b is a cognitive assistant; verify critical outputs for accuracy.",placeholder:"What do you want to know?",tools:"Tools",attachFile:"Attach file",startDictation:"Start voice dictation",stopDictation:"Stop dictation",settingsAck:"Got it, settings updated permanently.",professionAck:"I've completed the necessary research on your profession and noted it in my mind (must-b.md). I'm now ready as your **{profession}** assistant."},nav:{chat:"Chat",browser:"Browser",workflows:"Workflows",voice:"Voice",settings:"Settings",files:"Files",memory:"Memory",apiKeys:"API Keys",skills:"Skills",plugins:"Plugins",mind:"Must-b Mind",channels:"Channels"},voice:{title:"Must-b Voice Command",back:"Go Back",wakeHint:'Say "Hey Must-b" to get started.',tapHint:"Tap the microphone to begin.",heard:"I hear you…",listening:"Listening…",stopHint:"Click to stop",thinking:"Processing…",cmdHint:"Go ahead, I'm listening…",speakingHint:"Must-b is speaking…"},dock:{chat:"Chat",files:"Files",browser:"Browser",skills:"Skills",memory:"Memory",plugins:"Plugins",workflows:"Workflows",settings:"Settings",system:"System",close:"Close",cat_webTools:"Web Tools",cat_fileMedia:"File & Media",cat_aiAgents:"AI & Agents",cat_systemTools:"System Tools",skill_webSearch:"Web Search",skill_webFetch:"Web Fetch",skill_browserControl:"Browser Control",skill_pdfReader:"PDF Reader",skill_imageAnalysis:"Image Analysis",skill_imageGeneration:"Image Generation",skill_tts:"Text-to-Speech",skill_spawnAgent:"Spawn Sub-Agent",skill_agentSessions:"Agent Sessions",skill_canvas:"Canvas",skill_git:"Git Operations",skill_gateway:"Gateway",skill_fileManager:"File Manager",skill_cron:"Cron Scheduler",skill_messages:"Messages",desc_webSearch:"Real-time web search (multi-provider)",desc_webFetch:"Fetch any URL as clean text",desc_browserControl:"Full Playwright browser automation",desc_pdfReader:"Extract & analyse PDF documents",desc_imageAnalysis:"Describe and analyse images",desc_imageGeneration:"Create AI-generated images",desc_tts:"Convert text to natural speech",desc_spawnAgent:"Launch a new autonomous agent session",desc_agentSessions:"List and manage active sessions",desc_canvas:"Visual drawing & whiteboard workspace",desc_git:"Commit, branch, diff, push/pull",desc_gateway:"Inter-system & A2A communication",desc_fileManager:"Read, write & manage files",desc_cron:"Schedule recurring tasks",desc_messages:"Send & receive inter-agent messages",cat_knowledgeBase:"Knowledge Base",cat_personalOrg:"Personal Organisation",mem_browse:"Browse Memories",mem_search:"Search Memory",mem_add:"Add Memory",mem_contacts:"Contacts",mem_calendar:"Calendar",desc_memBrowse:"View all stored knowledge entries",desc_memSearch:"Semantic search across your KB",desc_memAdd:"Store new facts and knowledge",desc_contacts:"Manage people and organisations",desc_calendar:"Schedule and manage events",cat_pluginManager:"Plugin Manager",cat_developer:"Developer",plug_marketplace:"Marketplace",plug_installed:"Installed",plug_mcp:"MCP Servers",plug_bundleMcp:"Bundle MCP",plug_cliCmds:"CLI Commands",desc_marketplace:"Discover plugins on ClawHub",desc_installed:"Manage and configure installed plugins",desc_mcp:"Model Context Protocol integrations",desc_bundleMcp:"Package & deploy MCP tool bundles",desc_cliCmds:"Custom slash command registration",cat_automation:"Automation",cat_advanced:"Advanced",wf_automations:"Automations",wf_scheduled:"Scheduled Tasks",wf_commands:"Commands",wf_nodes:"Nodes Workflow",wf_multiAgent:"Multi-Agent",desc_automations:"Build and run automated workflows",desc_scheduled:"Manage all cron schedules",desc_commands:"Custom slash commands",desc_nodes:"Visual node-graph pipelines",desc_multiAgent:"Orchestrate agent collaboration"},systemHealth:{lite:"LITE",safe:"SAFE",critical:"Critical",warning:"Warning",info:"Info",title:"System Health",moreModels:"More Models / API Settings",kinds:{cpu:"CPU",ram:"RAM",memory:"Memory",storage:"Storage",network:"Network",process:"Process",battery:"Battery",thermal:"Thermal",disk:"Disk"},alerts:{cpu_high:"High CPU usage — LLM load is saturating the system.",ram_high:"High memory usage — performance may degrade.",ram_critical:"Memory critical — system lockup risk."},recommendations:{cpu_high:"Close background processes or switch to a smaller model.",ram_high:"Consider switching to a lighter model.",ram_critical:"Switch to an 8B or 14B model immediately."}},panels:{memory:{title:"Memory Insights",indexLabel:"Index:",clearIndex:"Clear Index",searchPlaceholder:"Search your memory…",searchHint:"Semantic similarity search — press Enter or click",emptyTitle:"Search your AI memory",emptyNoResults:"No memories found",emptyHint:"Type a phrase to find semantically similar skills, conversations, and workspace files.",emptyNoResultsHint:"Try a different phrase or index more content using the controls above.",refreshStats:"Refresh stats",indexControls:"Index controls",vectors:"vectors",skills:"skills",files:"files",indexed:"Indexed",indexCleared:"Index cleared",opFailed:"Operation failed",reqError:"Request error"},plugins:{title:"Plugin Architect",newPlugin:"New Plugin",buildTitle:"Build New Plugin",namePlaceholder:"Plugin name (e.g. weather-monitor)",goalPlaceholder:"Goal (e.g. poll OpenWeather API every 5 min)",contextPlaceholder:"Optional context / notes",generatePlugin:"Generate Plugin",emptyTitle:"No plugins installed",emptyHint:'Click "New Plugin" to generate your first plugin.',installed:"installed",running:"RUNNING",stop:"Stop",run:"Run",opFailed:"Operation failed",reqError:"Request error",buildFailed:"Build failed",refresh:"Refresh"},skills:{title:"Skill Library",loading:"Loading skills…",emptyTitle:"No skills saved yet",emptyHint:"Complete a workflow in the Chat tab, then click",saveAsSkill:"Save as Skill",emptyHint2:"to build your library.",runningStatus:"Running skill…",completedStatus:"Skill completed",failedStatus:"Skill run failed",never:"Never",deleteConfirm:"Delete?",yes:"Yes",no:"No",runBtn:"Run",runningBtn:"Running…",doneBtn:"Done",lastRun:"last run"},settings:{title:"Settings",hardwareScore:"Hardware Score",searchPlaceholder:"Search providers…",allProviders:"All",apiKey:"API Key",baseUrl:"Base URL",model:"Model",testConnection:"Test Connection",save:"Save",testOk:"Connection successful",testFail:"Connection failed",saved:"Saved",saving:"Saving…",testing:"Testing…",apiKeyWarning:"API key required — update your key to continue."}}},UC={welcome:{tagline:"Yapay Zeka Beyniniz",title:"Must-b",sleeping:"Uyuyor...",waking:"Uyandırılıyor...",awake:"Uyanıyor...",wakeBtn:"Must-b'yi Uyandır",wakeHint:"Devam etmek için uyandır",reconfigure:"Yeniden Yapılandır",footer:"© 2026 Must-b — Auto Step Platform"},sidebar:{newChat:"Yeni Sohbet",recentChats:"Son Sohbetler",primary:"Birincil",personalization:"Kişiselleştirme",platform:"Platform",system:"Sistem",automations:"Otomasyonlarım",activeWorkflows:"Aktif İş Akışları",products:"Araçlar & Eklentiler",clients:"Müşteri Yönetimi",integrations:"Entegrasyonlar",logs:"Kayıtlar & Aktivite",settings:"Ayarlar",logout:"Çıkış",poweredBy:"Altyapısı:",deleteChat:"Sohbet Silinsin mi?",deleteConfirm:"Bu işlem geri alınamaz.",cancel:"İptal",delete:"Sil"},rightPanel:{agentRole:"Ajan Rolü",hardware:"Donanım Puanı",model:"Aktif Model",connected:"Gateway Bağlı",rank:{master:"Usta",planner:"Planlayıcı",worker:"İşçi"}},workflow:{title:"Aktif İş Akışı",idle:"Boşta — görev bekleniyor",goal:"Hedef",steps:{browse:"Tarayıcı açılıyor",write:"Dosya yazılıyor",think:"Düşünülüyor",exec:"Komut çalıştırılıyor"}},dashboard:{placeholder:"Must-b'ye bir mesaj gönderin...",thinking:"Must-b düşünüyor..."},layout:{chats:"Sohbetler",system:"Sistem",openChats:"Sohbet geçmişini aç",openSystem:"Sistem panelini aç",closePanel:"Paneli kapat"},chat:{inputPlaceholder:"Must-b'ye her şeyi sorun…",listening:"Dinleniyor…",thoughtProcess:"Düşünce Süreci",saveAsSkill:"Beceri Olarak Kaydet",skillSaved:"Beceri kütüphanenize kaydedildi!",saving:"Kaydediliyor…",retry:"Tekrar Dene",save:"Kaydet",guidance:"Rehberlik",errorBoundary:"Sohbet render hatası — yeniden yükleniyor…",disclaimer:"Must-b bilişsel bir asistandır; kritik çıktıları doğrulamanız önerilir.",placeholder:"Ne öğrenmek istiyorsunuz?",tools:"Araçlar",attachFile:"Dosya ekle",startDictation:"Sesli giriş başlat",stopDictation:"Durdur",settingsAck:"Anlaşıldı, ayarlar kalıcı olarak güncellendi.",professionAck:"Mesleğiniz hakkında gerekli araştırmaları yaptım ve zihnime (must-b.md) not aldım. Artık bir **{profession}** asistanı olarak hazırım."},nav:{chat:"Sohbet",browser:"Tarayıcı",workflows:"İş Akışları",voice:"Sesli",settings:"Ayarlar",files:"Dosyalar",memory:"Bellek",apiKeys:"API Anahtarları",skills:"Beceriler",plugins:"Eklentiler",mind:"Must-b Zihni",channels:"Kanallar"},voice:{title:"Must-b Sesli Komuta",back:"Geri Dön",wakeHint:'"Hey Must-b" demeyi dene.',tapHint:"Başlamak için mikrofona dokunun.",heard:"Sizi duyuyorum…",listening:"Dinleniyor…",stopHint:"Durdurmak için tıklayın",thinking:"İşleniyor…",cmdHint:"Buyurun, dinliyorum…",speakingHint:"Must-b konuşuyor…"},systemHealth:{lite:"LITE",safe:"GÜVENLİ",critical:"Kritik",warning:"Uyarı",info:"Bilgi",title:"Sistem Durumu",moreModels:"Daha Fazla Model / API Ayarları",kinds:{cpu:"İşlemci",ram:"RAM",memory:"Bellek",storage:"Depolama",network:"Ağ",process:"İşlem",battery:"Batarya",thermal:"Isı",disk:"Disk"},alerts:{cpu_high:"İşlemci kullanımı yüksek — LLM yükü sistemi doyuruyor.",ram_high:"Bellek kullanımı yüksek — performans düşebilir.",ram_critical:"Bellek kritik — sistem kilitlenme riski var."},recommendations:{cpu_high:"Arka plan işlemlerini kapatın veya daha küçük bir modele geçin.",ram_high:"Daha hafif bir modele geçmeyi düşünün.",ram_critical:"Hemen 8B veya 14B bir modele geçin."}},dock:{chat:"Sohbet",files:"Dosyalar",browser:"Tarayıcı",skills:"Beceriler",memory:"Bellek",plugins:"Eklentiler",workflows:"İş Akışları",settings:"Ayarlar",system:"Sistem",close:"Kapat",cat_webTools:"Web Araçları",cat_fileMedia:"Dosya & Medya",cat_aiAgents:"Yapay Zeka & Ajanlar",cat_systemTools:"Sistem Araçları",skill_webSearch:"Web Arama",skill_webFetch:"Web Çekme",skill_browserControl:"Tarayıcı Kontrolü",skill_pdfReader:"PDF Okuyucu",skill_imageAnalysis:"Görüntü Analizi",skill_imageGeneration:"Görüntü Oluşturma",skill_tts:"Metinden Sese",skill_spawnAgent:"Alt Ajan Başlat",skill_agentSessions:"Ajan Oturumları",skill_canvas:"Tuval",skill_git:"Git İşlemleri",skill_gateway:"Ağ Geçidi",skill_fileManager:"Dosya Yöneticisi",skill_cron:"Zamanlayıcı",skill_messages:"Mesajlar",desc_webSearch:"Gerçek zamanlı web araması (çoklu sağlayıcı)",desc_webFetch:"Herhangi bir URL'yi metin olarak çek",desc_browserControl:"Tam Playwright tarayıcı otomasyonu",desc_pdfReader:"PDF belgelerini çıkar ve analiz et",desc_imageAnalysis:"Görüntüleri tanımla ve analiz et",desc_imageGeneration:"Yapay zeka ile görüntü oluştur",desc_tts:"Metni doğal sese dönüştür",desc_spawnAgent:"Yeni özerk ajan oturumu başlat",desc_agentSessions:"Aktif oturumları listele ve yönet",desc_canvas:"Görsel çizim & beyaz tahta",desc_git:"Commit, branch, diff, push/pull",desc_gateway:"Sistemler arası & A2A iletişim",desc_fileManager:"Dosyaları oku, yaz ve yönet",desc_cron:"Tekrarlayan görevleri zamanla",desc_messages:"Ajanlar arası mesaj gönder ve al",cat_knowledgeBase:"Bilgi Tabanı",cat_personalOrg:"Kişisel Organizasyon",mem_browse:"Belleklere Göz At",mem_search:"Bellekte Ara",mem_add:"Bellek Ekle",mem_contacts:"Kişiler",mem_calendar:"Takvim",desc_memBrowse:"Tüm saklanan bilgi girişlerini görüntüle",desc_memSearch:"Bilgi tabanında anlamsal arama",desc_memAdd:"Yeni bilgi ve gerçekleri sakla",desc_contacts:"Kişileri ve kuruluşları yönet",desc_calendar:"Etkinlikleri zamanla ve yönet",cat_pluginManager:"Eklenti Yöneticisi",cat_developer:"Geliştirici",plug_marketplace:"Pazar Yeri",plug_installed:"Yüklü Eklentiler",plug_mcp:"MCP Sunucuları",plug_bundleMcp:"MCP Paketi",plug_cliCmds:"CLI Komutları",desc_marketplace:"ClawHub'da eklentileri keşfet",desc_installed:"Yüklü eklentileri yönet ve yapılandır",desc_mcp:"Model Context Protocol entegrasyonları",desc_bundleMcp:"MCP araç paketlerini oluştur ve dağıt",desc_cliCmds:"Özel eğik çizgi komutları kaydı",cat_automation:"Otomasyon",cat_advanced:"Gelişmiş",wf_automations:"Otomasyonlar",wf_scheduled:"Zamanlanmış Görevler",wf_commands:"Komutlar",wf_nodes:"Düğüm İş Akışı",wf_multiAgent:"Çoklu Ajan",desc_automations:"Otomatik iş akışları oluştur ve çalıştır",desc_scheduled:"Tüm cron zamanlamalarını yönet",desc_commands:"Özel eğik çizgi komutları",desc_nodes:"Görsel düğüm-grafik iş hatları",desc_multiAgent:"Ajan işbirliğini düzenle"},panels:{memory:{title:"Bellek Görüşleri",indexLabel:"İndeks:",clearIndex:"İndeksi Temizle",searchPlaceholder:"Belleğinizde arayın…",searchHint:"Anlamsal benzerlik araması — Enter'a basın veya tıklayın",emptyTitle:"Yapay Zeka Belleğinizi Arayın",emptyNoResults:"Bellek bulunamadı",emptyHint:"Beceriler, sohbetler ve dosyalarda anlamsal olarak benzer içerik bulmak için bir ifade yazın.",emptyNoResultsHint:"Farklı bir ifade deneyin veya yukarıdaki kontrollerle daha fazla içerik ekleyin.",refreshStats:"İstatistikleri yenile",indexControls:"İndeks kontrolleri",vectors:"vektör",skills:"beceri",files:"dosya",indexed:"İndekslendi",indexCleared:"İndeks temizlendi",opFailed:"İşlem başarısız",reqError:"İstek hatası"},plugins:{title:"Eklenti Mimarı",newPlugin:"Yeni Eklenti",buildTitle:"Yeni Eklenti Oluştur",namePlaceholder:"Eklenti adı (örn. hava-durumu-monitörü)",goalPlaceholder:"Hedef (örn. OpenWeather API'yi 5 dakikada bir sorgula)",contextPlaceholder:"İsteğe bağlı bağlam / notlar",generatePlugin:"Eklenti Oluştur",emptyTitle:"Yüklü eklenti yok",emptyHint:'İlk eklentinizi oluşturmak için "Yeni Eklenti"ye tıklayın.',installed:"yüklü",running:"ÇALIŞIYOR",stop:"Durdur",run:"Çalıştır",opFailed:"İşlem başarısız",reqError:"İstek hatası",buildFailed:"Oluşturma başarısız",refresh:"Yenile"},skills:{title:"Beceri Kütüphanesi",loading:"Beceriler yükleniyor…",emptyTitle:"Henüz kaydedilmiş beceri yok",emptyHint:"Sohbet sekmesinde bir iş akışını tamamlayın, ardından tıklayın",saveAsSkill:"Beceri Olarak Kaydet",emptyHint2:"kütüphanenizi oluşturmak için.",runningStatus:"Beceri çalışıyor…",completedStatus:"Beceri tamamlandı",failedStatus:"Beceri çalıştırma başarısız",never:"Hiçbir zaman",deleteConfirm:"Sil?",yes:"Evet",no:"Hayır",runBtn:"Çalıştır",runningBtn:"Çalışıyor…",doneBtn:"Tamamlandı",lastRun:"son çalıştırma"},settings:{title:"Ayarlar",hardwareScore:"Donanım Puanı",searchPlaceholder:"Sağlayıcı ara…",allProviders:"Tümü",apiKey:"API Anahtarı",baseUrl:"Temel URL",model:"Model",testConnection:"Bağlantıyı Test Et",save:"Kaydet",testOk:"Bağlantı başarılı",testFail:"Bağlantı başarısız",saved:"Kaydedildi",saving:"Kaydediliyor…",testing:"Test ediliyor…",apiKeyWarning:"API anahtarı gerekli — devam etmek için anahtarınızı güncelleyin."}}},HC={welcome:{tagline:"Ihr KI-Gehirn",title:"Must-b",sleeping:"Schläft...",waking:"Wird geweckt...",awake:"Erwacht...",wakeBtn:"Must-b wecken",wakeHint:"Tippen zum Fortfahren",reconfigure:"Neu konfigurieren",footer:"© 2026 Must-b — Auto Step Platform"},sidebar:{newChat:"Neuer Chat",recentChats:"Letzte Chats",platform:"Plattform",system:"System",automations:"Meine Automatisierungen",activeWorkflows:"Aktive Workflows",products:"Skills & Plugins",clients:"Kundenverwaltung",integrations:"Integrationen",logs:"Protokolle & Aktivität",settings:"Einstellungen",logout:"Abmelden",poweredBy:"Betrieben von",deleteChat:"Chat löschen?",deleteConfirm:"Diese Aktion kann nicht rückgängig gemacht werden.",cancel:"Abbrechen",delete:"Löschen"},rightPanel:{agentRole:"Agentenrolle",hardware:"Hardware-Score",model:"Aktives Modell",connected:"Gateway verbunden",rank:{master:"Meister",planner:"Planer",worker:"Arbeiter"}},workflow:{title:"Aktiver Workflow",idle:"Leerlauf — wartet auf Aufgabe",goal:"Ziel",steps:{browse:"Browser wird geöffnet",write:"Datei wird geschrieben",think:"Wird nachgedacht",exec:"Befehl wird ausgeführt"}},dashboard:{placeholder:"Nachricht an Must-b senden...",thinking:"Must-b denkt nach..."},layout:{chats:"Chats",system:"System",openChats:"Chatverlauf öffnen",openSystem:"Systembereich öffnen",closePanel:"Bereich schließen"},chat:{inputPlaceholder:"Fragen Sie Must-b alles…",listening:"Höre zu…",thoughtProcess:"Denkprozess",saveAsSkill:"Als Fähigkeit speichern",skillSaved:"Fähigkeit in Ihrer Bibliothek gespeichert!",saving:"Speichere…",retry:"Erneut versuchen",save:"Speichern",guidance:"Hinweis",errorBoundary:"Chat rendering error — reloading…",disclaimer:"Must-b is a cognitive assistant; verify critical outputs for accuracy.",placeholder:"What do you want to know?",tools:"Tools",attachFile:"Attach file",startDictation:"Start voice dictation",stopDictation:"Stop dictation"},nav:{chat:"Chat",browser:"Browser",workflows:"Workflows",voice:"Voice",settings:"Settings",files:"Files",memory:"Memory",apiKeys:"API Keys",channels:"Kanäle"},voice:{title:"Must-b Voice Command",back:"Go Back",wakeHint:'Say "Hey Must-b" to get started.',tapHint:"Tap the microphone to begin.",heard:"I hear you…",listening:"Listening…",stopHint:"Click to stop",thinking:"Processing…",cmdHint:"Go ahead, I am listening…",speakingHint:"Must-b is speaking…"},dock:{chat:"Chat",files:"Dateien",browser:"Browser",skills:"Fähigkeiten",memory:"Gedächtnis",plugins:"Plugins",workflows:"Workflows",settings:"Einstellungen",system:"System",close:"Schließen",cat_webTools:"Web-Werkzeuge",cat_fileMedia:"Datei & Medien",cat_aiAgents:"KI & Agenten",cat_systemTools:"Systemwerkzeuge",skill_webSearch:"Websuche",skill_webFetch:"Web-Abruf",skill_browserControl:"Browser-Steuerung",skill_pdfReader:"PDF-Leser",skill_imageAnalysis:"Bildanalyse",skill_imageGeneration:"Bilderzeugung",skill_tts:"Text-zu-Sprache",skill_spawnAgent:"Unteragent starten",skill_agentSessions:"Agentensitzungen",skill_canvas:"Leinwand",skill_git:"Git-Operationen",skill_gateway:"Gateway",skill_fileManager:"Dateimanager",skill_cron:"Aufgabenplaner",skill_messages:"Nachrichten",desc_webSearch:"Echtzeit-Websuche (Multi-Provider)",desc_webFetch:"Beliebige URL als sauberen Text abrufen",desc_browserControl:"Vollständige Playwright-Browserautomatisierung",desc_pdfReader:"PDF-Dokumente extrahieren & analysieren",desc_imageAnalysis:"Bilder beschreiben und analysieren",desc_imageGeneration:"KI-generierte Bilder erstellen",desc_tts:"Text in natürliche Sprache umwandeln",desc_spawnAgent:"Neue autonome Agentensitzung starten",desc_agentSessions:"Aktive Sitzungen auflisten und verwalten",desc_canvas:"Visueller Zeichen- & Whiteboard-Bereich",desc_git:"Commit, Branch, Diff, Push/Pull",desc_gateway:"Systemübergreifende & A2A-Kommunikation",desc_fileManager:"Dateien lesen, schreiben & verwalten",desc_cron:"Wiederkehrende Aufgaben planen",desc_messages:"Agenten-Nachrichten senden & empfangen",cat_knowledgeBase:"Wissensdatenbank",cat_personalOrg:"Persönliche Organisation",mem_browse:"Erinnerungen durchsuchen",mem_search:"Gedächtnis suchen",mem_add:"Erinnerung hinzufügen",mem_contacts:"Kontakte",mem_calendar:"Kalender",desc_memBrowse:"Alle gespeicherten Wissenseinträge anzeigen",desc_memSearch:"Semantische Suche in der Wissensdatenbank",desc_memAdd:"Neue Fakten und Wissen speichern",desc_contacts:"Personen und Organisationen verwalten",desc_calendar:"Termine planen und verwalten",cat_pluginManager:"Plugin-Manager",cat_developer:"Entwickler",plug_marketplace:"Marktplatz",plug_installed:"Installiert",plug_mcp:"MCP-Server",plug_bundleMcp:"MCP bündeln",plug_cliCmds:"CLI-Befehle",desc_marketplace:"Plugins auf ClawHub entdecken",desc_installed:"Installierte Plugins verwalten und konfigurieren",desc_mcp:"Model Context Protocol-Integrationen",desc_bundleMcp:"MCP-Werkzeugpakete erstellen & bereitstellen",desc_cliCmds:"Benutzerdefinierte Schrägstrichbefehle registrieren",cat_automation:"Automatisierung",cat_advanced:"Erweitert",wf_automations:"Automatisierungen",wf_scheduled:"Geplante Aufgaben",wf_commands:"Befehle",wf_nodes:"Knoten-Workflow",wf_multiAgent:"Multi-Agent",desc_automations:"Automatisierte Workflows erstellen und ausführen",desc_scheduled:"Alle Cron-Zeitpläne verwalten",desc_commands:"Benutzerdefinierte Schrägstrichbefehle",desc_nodes:"Visuelle Knoten-Graph-Pipelines",desc_multiAgent:"Agentenzusammenarbeit orchestrieren"},systemHealth:{lite:"LITE",safe:"SAFE",critical:"Critical",warning:"Warning",info:"Info",title:"System Health",kinds:{cpu:"CPU",ram:"RAM",memory:"Memory",storage:"Storage",network:"Network",process:"Process",battery:"Battery",thermal:"Thermal",disk:"Disk"},moreModels:"More Models / API Settings"},panels:{memory:{title:"Gedächtnisübersicht",indexLabel:"Index:",clearIndex:"Index löschen",searchPlaceholder:"Gedächtnis durchsuchen…",searchHint:"Semantische Ähnlichkeitssuche — Enter drücken oder klicken",emptyTitle:"KI-Gedächtnis durchsuchen",emptyNoResults:"Keine Erinnerungen gefunden",emptyHint:"Geben Sie einen Begriff ein, um semantisch ähnliche Fähigkeiten, Gespräche und Dateien zu finden.",emptyNoResultsHint:"Versuchen Sie eine andere Formulierung oder indizieren Sie mehr Inhalte.",refreshStats:"Statistiken aktualisieren",indexControls:"Indexsteuerung",vectors:"Vektoren",skills:"Fähigkeiten",files:"Dateien",indexed:"Indiziert",indexCleared:"Index gelöscht",opFailed:"Vorgang fehlgeschlagen",reqError:"Anfragefehler"},plugins:{title:"Plugin-Architekt",newPlugin:"Neues Plugin",buildTitle:"Neues Plugin erstellen",namePlaceholder:"Plugin-Name (z.B. wetter-monitor)",goalPlaceholder:"Ziel (z.B. OpenWeather API alle 5 Min. abfragen)",contextPlaceholder:"Optionaler Kontext / Notizen",generatePlugin:"Plugin generieren",emptyTitle:"Keine Plugins installiert",emptyHint:'Klicken Sie auf "Neues Plugin", um Ihr erstes Plugin zu erstellen.',installed:"installiert",running:"LÄUFT",stop:"Stoppen",run:"Ausführen",opFailed:"Vorgang fehlgeschlagen",reqError:"Anfragefehler",buildFailed:"Erstellung fehlgeschlagen",refresh:"Aktualisieren"},skills:{title:"Fähigkeitenbibliothek",loading:"Fähigkeiten werden geladen…",emptyTitle:"Noch keine Fähigkeiten gespeichert",emptyHint:"Schließen Sie einen Workflow im Chat-Tab ab, dann klicken Sie auf",saveAsSkill:"Als Fähigkeit speichern",emptyHint2:"um Ihre Bibliothek aufzubauen.",runningStatus:"Fähigkeit wird ausgeführt…",completedStatus:"Fähigkeit abgeschlossen",failedStatus:"Ausführung fehlgeschlagen",never:"Nie",deleteConfirm:"Löschen?",yes:"Ja",no:"Nein",runBtn:"Ausführen",runningBtn:"Läuft…",doneBtn:"Fertig",lastRun:"letzter Lauf"},settings:{title:"Einstellungen",hardwareScore:"Hardware-Score",searchPlaceholder:"Anbieter suchen…",allProviders:"Alle",apiKey:"API-Schlüssel",baseUrl:"Basis-URL",model:"Modell",testConnection:"Verbindung testen",save:"Speichern",testOk:"Verbindung erfolgreich",testFail:"Verbindung fehlgeschlagen",saved:"Gespeichert",saving:"Speichern…",testing:"Teste…",apiKeyWarning:"API-Schlüssel erforderlich — aktualisieren Sie Ihren Schlüssel."}}},WC={welcome:{tagline:"Votre cerveau IA",title:"Must-b",sleeping:"En veille...",waking:"Réveil en cours...",awake:"Éveil...",wakeBtn:"Réveiller Must-b",wakeHint:"Appuyez pour continuer",reconfigure:"Reconfigurer",footer:"© 2026 Must-b — Plateforme Auto Step"},sidebar:{newChat:"Nouvelle discussion",recentChats:"Discussions récentes",platform:"Plateforme",system:"Système",automations:"Mes automatisations",activeWorkflows:"Flux de travail actifs",products:"Skills & Plugins",clients:"Gestion des clients",integrations:"Intégrations",logs:"Journaux & Activité",settings:"Paramètres",logout:"Déconnexion",poweredBy:"Propulsé par",deleteChat:"Supprimer la discussion ?",deleteConfirm:"Cette action est irréversible.",cancel:"Annuler",delete:"Supprimer"},rightPanel:{agentRole:"Rôle de l'agent",hardware:"Score matériel",model:"Modèle actif",connected:"Passerelle connectée",rank:{master:"Maître",planner:"Planificateur",worker:"Exécutant"}},workflow:{title:"Flux de travail actif",idle:"Inactif — en attente d'une tâche",goal:"Objectif",steps:{browse:"Ouverture du navigateur",write:"Écriture du fichier",think:"Réflexion",exec:"Exécution de la commande"}},dashboard:{placeholder:"Envoyer un message à Must-b...",thinking:"Must-b réfléchit..."},layout:{chats:"Discussions",system:"Système",openChats:"Ouvrir l'historique des discussions",openSystem:"Ouvrir le panneau système",closePanel:"Fermer le panneau"},chat:{inputPlaceholder:"Posez n'importe quelle question à Must-b…",listening:"Écoute en cours…",thoughtProcess:"Processus de réflexion",saveAsSkill:"Enregistrer comme compétence",skillSaved:"Compétence enregistrée dans votre bibliothèque !",saving:"Enregistrement…",retry:"Réessayer",save:"Enregistrer",guidance:"Conseils",errorBoundary:"Chat rendering error — reloading…",disclaimer:"Must-b is a cognitive assistant; verify critical outputs for accuracy.",placeholder:"What do you want to know?",tools:"Tools",attachFile:"Attach file",startDictation:"Start voice dictation",stopDictation:"Stop dictation"},nav:{chat:"Chat",browser:"Browser",workflows:"Workflows",voice:"Voice",settings:"Settings",files:"Files",memory:"Memory",apiKeys:"API Keys",channels:"Canaux"},voice:{title:"Must-b Voice Command",back:"Go Back",wakeHint:'Say "Hey Must-b" to get started.',tapHint:"Tap the microphone to begin.",heard:"I hear you…",listening:"Listening…",stopHint:"Click to stop",thinking:"Processing…",cmdHint:"Go ahead, I am listening…",speakingHint:"Must-b is speaking…"},dock:{chat:"Discussion",files:"Fichiers",browser:"Navigateur",skills:"Compétences",memory:"Mémoire",plugins:"Plugins",workflows:"Flux de travail",settings:"Paramètres",system:"Système",close:"Fermer",cat_webTools:"Outils web",cat_fileMedia:"Fichiers & Médias",cat_aiAgents:"IA & Agents",cat_systemTools:"Outils système",skill_webSearch:"Recherche web",skill_webFetch:"Récupération web",skill_browserControl:"Contrôle du navigateur",skill_pdfReader:"Lecteur PDF",skill_imageAnalysis:"Analyse d'image",skill_imageGeneration:"Génération d'image",skill_tts:"Synthèse vocale",skill_spawnAgent:"Créer un sous-agent",skill_agentSessions:"Sessions d'agents",skill_canvas:"Tableau de travail",skill_git:"Opérations Git",skill_gateway:"Passerelle",skill_fileManager:"Gestionnaire de fichiers",skill_cron:"Planificateur Cron",skill_messages:"Messages",desc_webSearch:"Recherche web en temps réel (multi-fournisseur)",desc_webFetch:"Récupérer n'importe quelle URL en texte brut",desc_browserControl:"Automatisation complète du navigateur Playwright",desc_pdfReader:"Extraire et analyser des documents PDF",desc_imageAnalysis:"Décrire et analyser des images",desc_imageGeneration:"Créer des images générées par IA",desc_tts:"Convertir du texte en parole naturelle",desc_spawnAgent:"Lancer une nouvelle session d'agent autonome",desc_agentSessions:"Lister et gérer les sessions actives",desc_canvas:"Espace de dessin visuel et tableau blanc",desc_git:"Commit, branche, diff, push/pull",desc_gateway:"Communication inter-systèmes & A2A",desc_fileManager:"Lire, écrire et gérer des fichiers",desc_cron:"Planifier des tâches récurrentes",desc_messages:"Envoyer & recevoir des messages inter-agents",cat_knowledgeBase:"Base de connaissances",cat_personalOrg:"Organisation personnelle",mem_browse:"Parcourir les souvenirs",mem_search:"Rechercher dans la mémoire",mem_add:"Ajouter un souvenir",mem_contacts:"Contacts",mem_calendar:"Calendrier",desc_memBrowse:"Voir toutes les entrées de connaissances stockées",desc_memSearch:"Recherche sémantique dans votre base de connaissances",desc_memAdd:"Stocker de nouveaux faits et connaissances",desc_contacts:"Gérer les personnes et organisations",desc_calendar:"Planifier et gérer des événements",cat_pluginManager:"Gestionnaire de plugins",cat_developer:"Développeur",plug_marketplace:"Marché",plug_installed:"Installés",plug_mcp:"Serveurs MCP",plug_bundleMcp:"Bundle MCP",plug_cliCmds:"Commandes CLI",desc_marketplace:"Découvrir des plugins sur ClawHub",desc_installed:"Gérer et configurer les plugins installés",desc_mcp:"Intégrations du protocole de contexte de modèle",desc_bundleMcp:"Empaqueter et déployer des bundles d'outils MCP",desc_cliCmds:"Enregistrement de commandes slash personnalisées",cat_automation:"Automatisation",cat_advanced:"Avancé",wf_automations:"Automatisations",wf_scheduled:"Tâches planifiées",wf_commands:"Commandes",wf_nodes:"Flux de nœuds",wf_multiAgent:"Multi-Agent",desc_automations:"Créer et exécuter des flux de travail automatisés",desc_scheduled:"Gérer tous les plannings cron",desc_commands:"Commandes slash personnalisées",desc_nodes:"Pipelines visuels en graphe de nœuds",desc_multiAgent:"Orchestrer la collaboration entre agents"},systemHealth:{lite:"LITE",safe:"SAFE",critical:"Critical",warning:"Warning",info:"Info",title:"System Health",kinds:{cpu:"CPU",ram:"RAM",memory:"Memory",storage:"Storage",network:"Network",process:"Process",battery:"Battery",thermal:"Thermal",disk:"Disk"},moreModels:"More Models / API Settings"},panels:{memory:{title:"Aperçus de la mémoire",indexLabel:"Index :",clearIndex:"Effacer l'index",searchPlaceholder:"Rechercher dans votre mémoire…",searchHint:"Recherche par similarité sémantique — appuyez sur Entrée ou cliquez",emptyTitle:"Recherchez dans votre mémoire IA",emptyNoResults:"Aucun souvenir trouvé",emptyHint:"Saisissez une phrase pour trouver des compétences, conversations et fichiers sémantiquement similaires.",emptyNoResultsHint:"Essayez une phrase différente ou indexez plus de contenu via les contrôles ci-dessus.",refreshStats:"Actualiser les statistiques",indexControls:"Contrôles de l'index",vectors:"vecteurs",skills:"compétences",files:"fichiers",indexed:"Indexé",indexCleared:"Index effacé",opFailed:"Opération échouée",reqError:"Erreur de requête"},plugins:{title:"Architecte de plugins",newPlugin:"Nouveau plugin",buildTitle:"Créer un nouveau plugin",namePlaceholder:"Nom du plugin (ex. weather-monitor)",goalPlaceholder:"Objectif (ex. interroger l'API OpenWeather toutes les 5 min)",contextPlaceholder:"Contexte / notes optionnels",generatePlugin:"Générer le plugin",emptyTitle:"Aucun plugin installé",emptyHint:"Cliquez sur « Nouveau plugin » pour générer votre premier plugin.",installed:"installé",running:"EN COURS",stop:"Arrêter",run:"Exécuter",opFailed:"Opération échouée",reqError:"Erreur de requête",buildFailed:"Échec de la compilation",refresh:"Actualiser"},skills:{title:"Bibliothèque de compétences",loading:"Chargement des compétences…",emptyTitle:"Aucune compétence enregistrée",emptyHint:"Terminez un flux de travail dans l'onglet Discussion, puis cliquez sur",saveAsSkill:"Enregistrer comme compétence",emptyHint2:"pour constituer votre bibliothèque.",runningStatus:"Exécution de la compétence…",completedStatus:"Compétence terminée",failedStatus:"Échec de l'exécution",never:"Jamais",deleteConfirm:"Supprimer ?",yes:"Oui",no:"Non",runBtn:"Exécuter",runningBtn:"En cours…",doneBtn:"Terminé",lastRun:"dernière exécution"},settings:{title:"Paramètres",hardwareScore:"Score matériel",searchPlaceholder:"Rechercher des fournisseurs…",allProviders:"Tous",apiKey:"Clé API",baseUrl:"URL de base",model:"Modèle",testConnection:"Tester la connexion",save:"Enregistrer",testOk:"Connexion réussie",testFail:"Échec de la connexion",saved:"Enregistré",saving:"Enregistrement…",testing:"Test en cours…",apiKeyWarning:"Clé API requise — mettez à jour votre clé pour continuer."}}},KC={welcome:{tagline:"Tu cerebro de IA",title:"Must-b",sleeping:"Durmiendo...",waking:"Despertando...",awake:"Despertando...",wakeBtn:"Despertar Must-b",wakeHint:"Toca para continuar",reconfigure:"Reconfigurar",footer:"© 2026 Must-b — Plataforma Auto Step"},sidebar:{newChat:"Nueva conversación",recentChats:"Conversaciones recientes",platform:"Plataforma",system:"Sistema",automations:"Mis automatizaciones",activeWorkflows:"Flujos de trabajo activos",products:"Skills & Plugins",clients:"Gestión de clientes",integrations:"Integraciones",logs:"Registros y actividad",settings:"Configuración",logout:"Cerrar sesión",poweredBy:"Desarrollado por",deleteChat:"¿Eliminar conversación?",deleteConfirm:"Esta acción no se puede deshacer.",cancel:"Cancelar",delete:"Eliminar"},rightPanel:{agentRole:"Rol del agente",hardware:"Puntuación de hardware",model:"Modelo activo",connected:"Puerta de enlace conectada",rank:{master:"Maestro",planner:"Planificador",worker:"Trabajador"}},workflow:{title:"Flujo de trabajo activo",idle:"Inactivo — esperando tarea",goal:"Objetivo",steps:{browse:"Abriendo navegador",write:"Escribiendo archivo",think:"Pensando",exec:"Ejecutando comando"}},dashboard:{placeholder:"Envía un mensaje a Must-b...",thinking:"Must-b está pensando..."},layout:{chats:"Conversaciones",system:"Sistema",openChats:"Abrir historial de conversaciones",openSystem:"Abrir panel del sistema",closePanel:"Cerrar panel"},chat:{inputPlaceholder:"Pregunta cualquier cosa a Must-b…",listening:"Escuchando…",thoughtProcess:"Proceso de pensamiento",saveAsSkill:"Guardar como habilidad",skillSaved:"¡Habilidad guardada en tu biblioteca!",saving:"Guardando…",retry:"Reintentar",save:"Guardar",guidance:"Orientación",errorBoundary:"Chat rendering error — reloading…",disclaimer:"Must-b is a cognitive assistant; verify critical outputs for accuracy.",placeholder:"What do you want to know?",tools:"Tools",attachFile:"Attach file",startDictation:"Start voice dictation",stopDictation:"Stop dictation"},nav:{chat:"Chat",browser:"Browser",workflows:"Workflows",voice:"Voice",settings:"Settings",files:"Files",memory:"Memory",apiKeys:"API Keys",channels:"Canales"},voice:{title:"Must-b Voice Command",back:"Go Back",wakeHint:'Say "Hey Must-b" to get started.',tapHint:"Tap the microphone to begin.",heard:"I hear you…",listening:"Listening…",stopHint:"Click to stop",thinking:"Processing…",cmdHint:"Go ahead, I am listening…",speakingHint:"Must-b is speaking…"},dock:{chat:"Conversación",files:"Archivos",browser:"Navegador",skills:"Habilidades",memory:"Memoria",plugins:"Plugins",workflows:"Flujos de trabajo",settings:"Configuración",system:"Sistema",close:"Cerrar",cat_webTools:"Herramientas web",cat_fileMedia:"Archivos y medios",cat_aiAgents:"IA y agentes",cat_systemTools:"Herramientas del sistema",skill_webSearch:"Búsqueda web",skill_webFetch:"Recuperación web",skill_browserControl:"Control del navegador",skill_pdfReader:"Lector de PDF",skill_imageAnalysis:"Análisis de imagen",skill_imageGeneration:"Generación de imágenes",skill_tts:"Texto a voz",skill_spawnAgent:"Crear subagente",skill_agentSessions:"Sesiones de agentes",skill_canvas:"Lienzo",skill_git:"Operaciones Git",skill_gateway:"Puerta de enlace",skill_fileManager:"Gestor de archivos",skill_cron:"Planificador Cron",skill_messages:"Mensajes",desc_webSearch:"Búsqueda web en tiempo real (multi-proveedor)",desc_webFetch:"Obtener cualquier URL como texto limpio",desc_browserControl:"Automatización completa del navegador con Playwright",desc_pdfReader:"Extraer y analizar documentos PDF",desc_imageAnalysis:"Describir y analizar imágenes",desc_imageGeneration:"Crear imágenes generadas por IA",desc_tts:"Convertir texto en habla natural",desc_spawnAgent:"Iniciar una nueva sesión de agente autónomo",desc_agentSessions:"Listar y gestionar sesiones activas",desc_canvas:"Espacio de dibujo visual y pizarra",desc_git:"Commit, rama, diff, push/pull",desc_gateway:"Comunicación entre sistemas y A2A",desc_fileManager:"Leer, escribir y gestionar archivos",desc_cron:"Programar tareas recurrentes",desc_messages:"Enviar y recibir mensajes entre agentes",cat_knowledgeBase:"Base de conocimientos",cat_personalOrg:"Organización personal",mem_browse:"Explorar recuerdos",mem_search:"Buscar en memoria",mem_add:"Agregar recuerdo",mem_contacts:"Contactos",mem_calendar:"Calendario",desc_memBrowse:"Ver todas las entradas de conocimiento almacenadas",desc_memSearch:"Búsqueda semántica en tu base de conocimientos",desc_memAdd:"Almacenar nuevos hechos y conocimientos",desc_contacts:"Gestionar personas y organizaciones",desc_calendar:"Programar y gestionar eventos",cat_pluginManager:"Gestor de plugins",cat_developer:"Desarrollador",plug_marketplace:"Mercado",plug_installed:"Instalados",plug_mcp:"Servidores MCP",plug_bundleMcp:"Bundle MCP",plug_cliCmds:"Comandos CLI",desc_marketplace:"Descubrir plugins en ClawHub",desc_installed:"Gestionar y configurar plugins instalados",desc_mcp:"Integraciones del Protocolo de Contexto de Modelo",desc_bundleMcp:"Empaquetar y desplegar bundles de herramientas MCP",desc_cliCmds:"Registro de comandos slash personalizados",cat_automation:"Automatización",cat_advanced:"Avanzado",wf_automations:"Automatizaciones",wf_scheduled:"Tareas programadas",wf_commands:"Comandos",wf_nodes:"Flujo de nodos",wf_multiAgent:"Multi-Agente",desc_automations:"Crear y ejecutar flujos de trabajo automatizados",desc_scheduled:"Gestionar todos los programas cron",desc_commands:"Comandos slash personalizados",desc_nodes:"Pipelines visuales en grafo de nodos",desc_multiAgent:"Orquestar la colaboración entre agentes"},systemHealth:{lite:"LITE",safe:"SAFE",critical:"Critical",warning:"Warning",info:"Info",title:"System Health",kinds:{cpu:"CPU",ram:"RAM",memory:"Memory",storage:"Storage",network:"Network",process:"Process",battery:"Battery",thermal:"Thermal",disk:"Disk"},moreModels:"More Models / API Settings"},panels:{memory:{title:"Perspectivas de memoria",indexLabel:"Índice:",clearIndex:"Limpiar índice",searchPlaceholder:"Buscar en tu memoria…",searchHint:"Búsqueda por similitud semántica — presiona Enter o haz clic",emptyTitle:"Busca en tu memoria de IA",emptyNoResults:"No se encontraron recuerdos",emptyHint:"Escribe una frase para encontrar habilidades, conversaciones y archivos semánticamente similares.",emptyNoResultsHint:"Prueba una frase diferente o indexa más contenido usando los controles de arriba.",refreshStats:"Actualizar estadísticas",indexControls:"Controles de índice",vectors:"vectores",skills:"habilidades",files:"archivos",indexed:"Indexado",indexCleared:"Índice limpiado",opFailed:"Operación fallida",reqError:"Error de solicitud"},plugins:{title:"Arquitecto de plugins",newPlugin:"Nuevo plugin",buildTitle:"Crear nuevo plugin",namePlaceholder:"Nombre del plugin (ej. weather-monitor)",goalPlaceholder:"Objetivo (ej. consultar la API OpenWeather cada 5 min)",contextPlaceholder:"Contexto / notas opcionales",generatePlugin:"Generar plugin",emptyTitle:"No hay plugins instalados",emptyHint:"Haz clic en «Nuevo plugin» para generar tu primer plugin.",installed:"instalado",running:"EN EJECUCIÓN",stop:"Detener",run:"Ejecutar",opFailed:"Operación fallida",reqError:"Error de solicitud",buildFailed:"Error de compilación",refresh:"Actualizar"},skills:{title:"Biblioteca de habilidades",loading:"Cargando habilidades…",emptyTitle:"No hay habilidades guardadas aún",emptyHint:"Completa un flujo de trabajo en la pestaña Conversación, luego haz clic en",saveAsSkill:"Guardar como habilidad",emptyHint2:"para construir tu biblioteca.",runningStatus:"Ejecutando habilidad…",completedStatus:"Habilidad completada",failedStatus:"Fallo en la ejecución",never:"Nunca",deleteConfirm:"¿Eliminar?",yes:"Sí",no:"No",runBtn:"Ejecutar",runningBtn:"Ejecutando…",doneBtn:"Listo",lastRun:"última ejecución"},settings:{title:"Configuración",hardwareScore:"Puntuación de hardware",searchPlaceholder:"Buscar proveedores…",allProviders:"Todos",apiKey:"Clave API",baseUrl:"URL base",model:"Modelo",testConnection:"Probar conexión",save:"Guardar",testOk:"Conexión exitosa",testFail:"Conexión fallida",saved:"Guardado",saving:"Guardando…",testing:"Probando…",apiKeyWarning:"Clave API requerida — actualiza tu clave para continuar."}}},GC={welcome:{tagline:"あなたのAIブレイン",title:"Must-b",sleeping:"スリープ中...",waking:"起動中...",awake:"覚醒中...",wakeBtn:"Must-bを起動",wakeHint:"タップして続行",reconfigure:"再設定",footer:"© 2026 Must-b — Auto Step Platform"},sidebar:{newChat:"新しいチャット",recentChats:"最近のチャット",platform:"プラットフォーム",system:"システム",automations:"マイオートメーション",activeWorkflows:"アクティブなワークフロー",products:"スキル & プラグイン",clients:"クライアント管理",integrations:"インテグレーション",logs:"ログ・アクティビティ",settings:"設定",logout:"ログアウト",poweredBy:"提供:",deleteChat:"チャットを削除しますか?",deleteConfirm:"この操作は元に戻せません。",cancel:"キャンセル",delete:"削除"},rightPanel:{agentRole:"エージェントの役割",hardware:"ハードウェアスコア",model:"アクティブモデル",connected:"ゲートウェイ接続済み",rank:{master:"マスター",planner:"プランナー",worker:"ワーカー"}},workflow:{title:"アクティブなワークフロー",idle:"待機中 — タスクを待っています",goal:"目標",steps:{browse:"ブラウザを開いています",write:"ファイルを書き込んでいます",think:"考えています",exec:"コマンドを実行しています"}},dashboard:{placeholder:"Must-bにメッセージを送信...",thinking:"Must-bが考えています..."},layout:{chats:"チャット",system:"システム",openChats:"チャット履歴を開く",openSystem:"システムパネルを開く",closePanel:"パネルを閉じる"},chat:{inputPlaceholder:"Must-bに何でも聞いてください…",listening:"聞いています…",thoughtProcess:"思考プロセス",saveAsSkill:"スキルとして保存",skillSaved:"スキルがライブラリに保存されました!",saving:"保存中…",retry:"再試行",save:"保存",guidance:"ガイダンス",errorBoundary:"Chat rendering error — reloading…",disclaimer:"Must-b is a cognitive assistant; verify critical outputs for accuracy.",placeholder:"What do you want to know?",tools:"Tools",attachFile:"Attach file",startDictation:"Start voice dictation",stopDictation:"Stop dictation"},nav:{chat:"Chat",browser:"Browser",workflows:"Workflows",voice:"Voice",settings:"Settings",files:"Files",memory:"Memory",apiKeys:"API Keys",channels:"チャンネル"},voice:{title:"Must-b Voice Command",back:"Go Back",wakeHint:'Say "Hey Must-b" to get started.',tapHint:"Tap the microphone to begin.",heard:"I hear you…",listening:"Listening…",stopHint:"Click to stop",thinking:"Processing…",cmdHint:"Go ahead, I am listening…",speakingHint:"Must-b is speaking…"},dock:{chat:"チャット",files:"ファイル",browser:"ブラウザ",skills:"スキル",memory:"メモリ",plugins:"プラグイン",workflows:"ワークフロー",settings:"設定",system:"システム",close:"閉じる",cat_webTools:"ウェブツール",cat_fileMedia:"ファイル・メディア",cat_aiAgents:"AI・エージェント",cat_systemTools:"システムツール",skill_webSearch:"ウェブ検索",skill_webFetch:"ウェブ取得",skill_browserControl:"ブラウザ制御",skill_pdfReader:"PDFリーダー",skill_imageAnalysis:"画像分析",skill_imageGeneration:"画像生成",skill_tts:"テキスト読み上げ",skill_spawnAgent:"サブエージェント作成",skill_agentSessions:"エージェントセッション",skill_canvas:"キャンバス",skill_git:"Git操作",skill_gateway:"ゲートウェイ",skill_fileManager:"ファイルマネージャー",skill_cron:"Cronスケジューラー",skill_messages:"メッセージ",desc_webSearch:"リアルタイムウェブ検索(マルチプロバイダー)",desc_webFetch:"任意のURLをクリーンなテキストとして取得",desc_browserControl:"Playwrightによる完全なブラウザ自動化",desc_pdfReader:"PDFドキュメントの抽出と分析",desc_imageAnalysis:"画像の説明と分析",desc_imageGeneration:"AI生成画像の作成",desc_tts:"テキストを自然な音声に変換",desc_spawnAgent:"新しい自律エージェントセッションを起動",desc_agentSessions:"アクティブセッションの一覧と管理",desc_canvas:"ビジュアル描画・ホワイトボードワークスペース",desc_git:"コミット、ブランチ、差分、プッシュ/プル",desc_gateway:"システム間・A2A通信",desc_fileManager:"ファイルの読み取り、書き込み、管理",desc_cron:"定期タスクのスケジュール",desc_messages:"エージェント間メッセージの送受信",cat_knowledgeBase:"ナレッジベース",cat_personalOrg:"個人管理",mem_browse:"メモリを閲覧",mem_search:"メモリを検索",mem_add:"メモリを追加",mem_contacts:"連絡先",mem_calendar:"カレンダー",desc_memBrowse:"保存されたすべての知識エントリを表示",desc_memSearch:"ナレッジベース全体のセマンティック検索",desc_memAdd:"新しい事実と知識を保存",desc_contacts:"人物と組織の管理",desc_calendar:"イベントのスケジュールと管理",cat_pluginManager:"プラグインマネージャー",cat_developer:"開発者",plug_marketplace:"マーケットプレイス",plug_installed:"インストール済み",plug_mcp:"MCPサーバー",plug_bundleMcp:"MCPバンドル",plug_cliCmds:"CLIコマンド",desc_marketplace:"ClawHubでプラグインを探す",desc_installed:"インストール済みプラグインの管理と設定",desc_mcp:"モデルコンテキストプロトコル統合",desc_bundleMcp:"MCPツールバンドルのパッケージ化とデプロイ",desc_cliCmds:"カスタムスラッシュコマンドの登録",cat_automation:"自動化",cat_advanced:"高度な設定",wf_automations:"自動化",wf_scheduled:"スケジュールタスク",wf_commands:"コマンド",wf_nodes:"ノードワークフロー",wf_multiAgent:"マルチエージェント",desc_automations:"自動化されたワークフローの構築と実行",desc_scheduled:"すべてのCronスケジュールを管理",desc_commands:"カスタムスラッシュコマンド",desc_nodes:"ビジュアルノードグラフパイプライン",desc_multiAgent:"エージェント間の協調をオーケストレーション"},systemHealth:{lite:"LITE",safe:"SAFE",critical:"Critical",warning:"Warning",info:"Info",title:"System Health",kinds:{cpu:"CPU",ram:"RAM",memory:"Memory",storage:"Storage",network:"Network",process:"Process",battery:"Battery",thermal:"Thermal",disk:"Disk"},moreModels:"More Models / API Settings"},panels:{memory:{title:"メモリインサイト",indexLabel:"インデックス:",clearIndex:"インデックスをクリア",searchPlaceholder:"メモリを検索…",searchHint:"セマンティック類似性検索 — Enterキーを押すかクリック",emptyTitle:"AIメモリを検索",emptyNoResults:"メモリが見つかりません",emptyHint:"フレーズを入力して、意味的に類似したスキル、会話、ワークスペースファイルを見つけてください。",emptyNoResultsHint:"別のフレーズを試すか、上のコントロールを使ってより多くのコンテンツをインデックスしてください。",refreshStats:"統計を更新",indexControls:"インデックスコントロール",vectors:"ベクター",skills:"スキル",files:"ファイル",indexed:"インデックス済み",indexCleared:"インデックスをクリアしました",opFailed:"操作に失敗しました",reqError:"リクエストエラー"},plugins:{title:"プラグインアーキテクト",newPlugin:"新しいプラグイン",buildTitle:"新しいプラグインを作成",namePlaceholder:"プラグイン名(例:weather-monitor)",goalPlaceholder:"目標(例:5分ごとにOpenWeather APIをポーリング)",contextPlaceholder:"オプションのコンテキスト / メモ",generatePlugin:"プラグインを生成",emptyTitle:"プラグインがインストールされていません",emptyHint:"「新しいプラグイン」をクリックして最初のプラグインを生成してください。",installed:"インストール済み",running:"実行中",stop:"停止",run:"実行",opFailed:"操作に失敗しました",reqError:"リクエストエラー",buildFailed:"ビルド失敗",refresh:"更新"},skills:{title:"スキルライブラリ",loading:"スキルを読み込んでいます…",emptyTitle:"スキルがまだ保存されていません",emptyHint:"チャットタブでワークフローを完了したら、クリック",saveAsSkill:"スキルとして保存",emptyHint2:"してライブラリを構築してください。",runningStatus:"スキルを実行中…",completedStatus:"スキル完了",failedStatus:"スキルの実行に失敗しました",never:"なし",deleteConfirm:"削除しますか?",yes:"はい",no:"いいえ",runBtn:"実行",runningBtn:"実行中…",doneBtn:"完了",lastRun:"最終実行"},settings:{title:"設定",hardwareScore:"ハードウェアスコア",searchPlaceholder:"プロバイダーを検索…",allProviders:"すべて",apiKey:"APIキー",baseUrl:"ベースURL",model:"モデル",testConnection:"接続をテスト",save:"保存",testOk:"接続成功",testFail:"接続失敗",saved:"保存済み",saving:"保存中…",testing:"テスト中…",apiKeyWarning:"APIキーが必要です — 続行するにはキーを更新してください。"}}},qC={welcome:{tagline:"您的AI大脑",title:"Must-b",sleeping:"休眠中...",waking:"唤醒中...",awake:"正在觉醒...",wakeBtn:"唤醒 Must-b",wakeHint:"点击继续",reconfigure:"重新配置",footer:"© 2026 Must-b — Auto Step 平台"},sidebar:{newChat:"新建对话",recentChats:"最近对话",platform:"平台",system:"系统",automations:"我的自动化",activeWorkflows:"活跃工作流",products:"技能与插件",clients:"客户管理",integrations:"集成",logs:"日志与活动",settings:"设置",logout:"退出登录",poweredBy:"技术支持:",deleteChat:"删除对话?",deleteConfirm:"此操作无法撤销。",cancel:"取消",delete:"删除"},rightPanel:{agentRole:"代理角色",hardware:"硬件评分",model:"活跃模型",connected:"网关已连接",rank:{master:"主控",planner:"规划者",worker:"执行者"}},workflow:{title:"活跃工作流",idle:"空闲中 — 等待任务",goal:"目标",steps:{browse:"正在打开浏览器",write:"正在写入文件",think:"正在思考",exec:"正在执行命令"}},dashboard:{placeholder:"向 Must-b 发送消息...",thinking:"Must-b 正在思考..."},layout:{chats:"对话",system:"系统",openChats:"打开对话历史",openSystem:"打开系统面板",closePanel:"关闭面板"},chat:{inputPlaceholder:"向 Must-b 提问任何问题…",listening:"正在聆听…",thoughtProcess:"思考过程",saveAsSkill:"保存为技能",skillSaved:"技能已保存到您的库中!",saving:"保存中…",retry:"重试",save:"保存",guidance:"指导",errorBoundary:"Chat rendering error — reloading…",disclaimer:"Must-b is a cognitive assistant; verify critical outputs for accuracy.",placeholder:"What do you want to know?",tools:"Tools",attachFile:"Attach file",startDictation:"Start voice dictation",stopDictation:"Stop dictation"},nav:{chat:"Chat",browser:"Browser",workflows:"Workflows",voice:"Voice",settings:"Settings",files:"Files",memory:"Memory",apiKeys:"API Keys",channels:"频道"},voice:{title:"Must-b Voice Command",back:"Go Back",wakeHint:'Say "Hey Must-b" to get started.',tapHint:"Tap the microphone to begin.",heard:"I hear you…",listening:"Listening…",stopHint:"Click to stop",thinking:"Processing…",cmdHint:"Go ahead, I am listening…",speakingHint:"Must-b is speaking…"},dock:{chat:"对话",files:"文件",browser:"浏览器",skills:"技能",memory:"记忆",plugins:"插件",workflows:"工作流",settings:"设置",system:"系统",close:"关闭",cat_webTools:"网络工具",cat_fileMedia:"文件与媒体",cat_aiAgents:"AI与代理",cat_systemTools:"系统工具",skill_webSearch:"网络搜索",skill_webFetch:"网络获取",skill_browserControl:"浏览器控制",skill_pdfReader:"PDF阅读器",skill_imageAnalysis:"图像分析",skill_imageGeneration:"图像生成",skill_tts:"文字转语音",skill_spawnAgent:"创建子代理",skill_agentSessions:"代理会话",skill_canvas:"画布",skill_git:"Git操作",skill_gateway:"网关",skill_fileManager:"文件管理器",skill_cron:"Cron调度器",skill_messages:"消息",desc_webSearch:"实时网络搜索(多供应商)",desc_webFetch:"将任意URL获取为纯文本",desc_browserControl:"完整的Playwright浏览器自动化",desc_pdfReader:"提取和分析PDF文档",desc_imageAnalysis:"描述和分析图像",desc_imageGeneration:"创建AI生成的图像",desc_tts:"将文本转换为自然语音",desc_spawnAgent:"启动新的自主代理会话",desc_agentSessions:"列出并管理活跃会话",desc_canvas:"可视化绘图与白板工作区",desc_git:"提交、分支、差异、推送/拉取",desc_gateway:"系统间与A2A通信",desc_fileManager:"读取、写入和管理文件",desc_cron:"调度定期任务",desc_messages:"发送和接收代理间消息",cat_knowledgeBase:"知识库",cat_personalOrg:"个人组织",mem_browse:"浏览记忆",mem_search:"搜索记忆",mem_add:"添加记忆",mem_contacts:"联系人",mem_calendar:"日历",desc_memBrowse:"查看所有存储的知识条目",desc_memSearch:"在知识库中进行语义搜索",desc_memAdd:"存储新的事实和知识",desc_contacts:"管理人员和组织",desc_calendar:"安排和管理事件",cat_pluginManager:"插件管理器",cat_developer:"开发者",plug_marketplace:"市场",plug_installed:"已安装",plug_mcp:"MCP服务器",plug_bundleMcp:"MCP捆绑包",plug_cliCmds:"CLI命令",desc_marketplace:"在ClawHub上发现插件",desc_installed:"管理和配置已安装的插件",desc_mcp:"模型上下文协议集成",desc_bundleMcp:"打包和部署MCP工具捆绑包",desc_cliCmds:"自定义斜杠命令注册",cat_automation:"自动化",cat_advanced:"高级",wf_automations:"自动化",wf_scheduled:"计划任务",wf_commands:"命令",wf_nodes:"节点工作流",wf_multiAgent:"多代理",desc_automations:"构建和运行自动化工作流",desc_scheduled:"管理所有Cron计划",desc_commands:"自定义斜杠命令",desc_nodes:"可视化节点图管道",desc_multiAgent:"协调代理间协作"},systemHealth:{lite:"LITE",safe:"SAFE",critical:"Critical",warning:"Warning",info:"Info",title:"System Health",kinds:{cpu:"CPU",ram:"RAM",memory:"Memory",storage:"Storage",network:"Network",process:"Process",battery:"Battery",thermal:"Thermal",disk:"Disk"},moreModels:"More Models / API Settings"},panels:{memory:{title:"记忆洞察",indexLabel:"索引:",clearIndex:"清除索引",searchPlaceholder:"搜索您的记忆…",searchHint:"语义相似性搜索 — 按回车键或点击",emptyTitle:"搜索您的AI记忆",emptyNoResults:"未找到记忆",emptyHint:"输入短语以查找语义相似的技能、对话和工作区文件。",emptyNoResultsHint:"尝试不同的短语,或使用上方控件索引更多内容。",refreshStats:"刷新统计",indexControls:"索引控件",vectors:"向量",skills:"技能",files:"文件",indexed:"已索引",indexCleared:"索引已清除",opFailed:"操作失败",reqError:"请求错误"},plugins:{title:"插件架构师",newPlugin:"新建插件",buildTitle:"创建新插件",namePlaceholder:"插件名称(例:weather-monitor)",goalPlaceholder:"目标(例:每5分钟轮询OpenWeather API)",contextPlaceholder:"可选上下文 / 备注",generatePlugin:"生成插件",emptyTitle:"未安装任何插件",emptyHint:"点击「新建插件」生成您的第一个插件。",installed:"已安装",running:"运行中",stop:"停止",run:"运行",opFailed:"操作失败",reqError:"请求错误",buildFailed:"构建失败",refresh:"刷新"},skills:{title:"技能库",loading:"正在加载技能…",emptyTitle:"尚未保存任何技能",emptyHint:"在对话标签中完成工作流,然后点击",saveAsSkill:"保存为技能",emptyHint2:"来构建您的技能库。",runningStatus:"正在运行技能…",completedStatus:"技能已完成",failedStatus:"技能运行失败",never:"从未",deleteConfirm:"删除?",yes:"是",no:"否",runBtn:"运行",runningBtn:"运行中…",doneBtn:"完成",lastRun:"上次运行"},settings:{title:"设置",hardwareScore:"硬件评分",searchPlaceholder:"搜索供应商…",allProviders:"全部",apiKey:"API密钥",baseUrl:"基础URL",model:"模型",testConnection:"测试连接",save:"保存",testOk:"连接成功",testFail:"连接失败",saved:"已保存",saving:"保存中…",testing:"测试中…",apiKeyWarning:"需要API密钥 — 请更新您的密钥以继续。"}}},YC={welcome:{tagline:"Seu cérebro de IA",title:"Must-b",sleeping:"Dormindo...",waking:"Acordando...",awake:"Despertando...",wakeBtn:"Acordar Must-b",wakeHint:"Toque para continuar",reconfigure:"Reconfigurar",footer:"© 2026 Must-b — Plataforma Auto Step"},sidebar:{newChat:"Nova conversa",recentChats:"Conversas recentes",platform:"Plataforma",system:"Sistema",automations:"Minhas automações",activeWorkflows:"Fluxos de trabalho ativos",products:"Skills & Plugins",clients:"Gestão de clientes",integrations:"Integrações",logs:"Registros e atividade",settings:"Configurações",logout:"Sair",poweredBy:"Desenvolvido por",deleteChat:"Excluir conversa?",deleteConfirm:"Esta ação não pode ser desfeita.",cancel:"Cancelar",delete:"Excluir"},rightPanel:{agentRole:"Função do agente",hardware:"Pontuação de hardware",model:"Modelo ativo",connected:"Gateway conectado",rank:{master:"Mestre",planner:"Planejador",worker:"Trabalhador"}},workflow:{title:"Fluxo de trabalho ativo",idle:"Ocioso — aguardando tarefa",goal:"Objetivo",steps:{browse:"Abrindo navegador",write:"Escrevendo arquivo",think:"Pensando",exec:"Executando comando"}},dashboard:{placeholder:"Envie uma mensagem para Must-b...",thinking:"Must-b está pensando..."},layout:{chats:"Conversas",system:"Sistema",openChats:"Abrir histórico de conversas",openSystem:"Abrir painel do sistema",closePanel:"Fechar painel"},chat:{inputPlaceholder:"Pergunte qualquer coisa ao Must-b…",listening:"Ouvindo…",thoughtProcess:"Processo de pensamento",saveAsSkill:"Salvar como habilidade",skillSaved:"Habilidade salva na sua biblioteca!",saving:"Salvando…",retry:"Tentar novamente",save:"Salvar",guidance:"Orientação",errorBoundary:"Chat rendering error — reloading…",disclaimer:"Must-b is a cognitive assistant; verify critical outputs for accuracy.",placeholder:"What do you want to know?",tools:"Tools",attachFile:"Attach file",startDictation:"Start voice dictation",stopDictation:"Stop dictation"},nav:{chat:"Chat",browser:"Browser",workflows:"Workflows",voice:"Voice",settings:"Settings",files:"Files",memory:"Memory",apiKeys:"API Keys",channels:"Canais"},voice:{title:"Must-b Voice Command",back:"Go Back",wakeHint:'Say "Hey Must-b" to get started.',tapHint:"Tap the microphone to begin.",heard:"I hear you…",listening:"Listening…",stopHint:"Click to stop",thinking:"Processing…",cmdHint:"Go ahead, I am listening…",speakingHint:"Must-b is speaking…"},dock:{chat:"Conversa",files:"Arquivos",browser:"Navegador",skills:"Habilidades",memory:"Memória",plugins:"Plugins",workflows:"Fluxos de trabalho",settings:"Configurações",system:"Sistema",close:"Fechar",cat_webTools:"Ferramentas web",cat_fileMedia:"Arquivos e mídia",cat_aiAgents:"IA e agentes",cat_systemTools:"Ferramentas do sistema",skill_webSearch:"Pesquisa web",skill_webFetch:"Busca web",skill_browserControl:"Controle do navegador",skill_pdfReader:"Leitor de PDF",skill_imageAnalysis:"Análise de imagem",skill_imageGeneration:"Geração de imagens",skill_tts:"Texto para fala",skill_spawnAgent:"Criar subagente",skill_agentSessions:"Sessões de agentes",skill_canvas:"Canvas",skill_git:"Operações Git",skill_gateway:"Gateway",skill_fileManager:"Gerenciador de arquivos",skill_cron:"Agendador Cron",skill_messages:"Mensagens",desc_webSearch:"Pesquisa web em tempo real (multi-provedor)",desc_webFetch:"Buscar qualquer URL como texto limpo",desc_browserControl:"Automação completa do navegador com Playwright",desc_pdfReader:"Extrair e analisar documentos PDF",desc_imageAnalysis:"Descrever e analisar imagens",desc_imageGeneration:"Criar imagens geradas por IA",desc_tts:"Converter texto em fala natural",desc_spawnAgent:"Iniciar uma nova sessão de agente autônomo",desc_agentSessions:"Listar e gerenciar sessões ativas",desc_canvas:"Espaço de desenho visual e quadro branco",desc_git:"Commit, branch, diff, push/pull",desc_gateway:"Comunicação entre sistemas e A2A",desc_fileManager:"Ler, escrever e gerenciar arquivos",desc_cron:"Agendar tarefas recorrentes",desc_messages:"Enviar e receber mensagens entre agentes",cat_knowledgeBase:"Base de conhecimento",cat_personalOrg:"Organização pessoal",mem_browse:"Explorar memórias",mem_search:"Pesquisar memória",mem_add:"Adicionar memória",mem_contacts:"Contatos",mem_calendar:"Calendário",desc_memBrowse:"Ver todas as entradas de conhecimento armazenadas",desc_memSearch:"Pesquisa semântica na sua base de conhecimento",desc_memAdd:"Armazenar novos fatos e conhecimentos",desc_contacts:"Gerenciar pessoas e organizações",desc_calendar:"Agendar e gerenciar eventos",cat_pluginManager:"Gerenciador de plugins",cat_developer:"Desenvolvedor",plug_marketplace:"Marketplace",plug_installed:"Instalados",plug_mcp:"Servidores MCP",plug_bundleMcp:"Bundle MCP",plug_cliCmds:"Comandos CLI",desc_marketplace:"Descobrir plugins no ClawHub",desc_installed:"Gerenciar e configurar plugins instalados",desc_mcp:"Integrações do Protocolo de Contexto de Modelo",desc_bundleMcp:"Empacotar e implantar bundles de ferramentas MCP",desc_cliCmds:"Registro de comandos slash personalizados",cat_automation:"Automação",cat_advanced:"Avançado",wf_automations:"Automações",wf_scheduled:"Tarefas agendadas",wf_commands:"Comandos",wf_nodes:"Fluxo de nós",wf_multiAgent:"Multi-Agente",desc_automations:"Criar e executar fluxos de trabalho automatizados",desc_scheduled:"Gerenciar todos os agendamentos cron",desc_commands:"Comandos slash personalizados",desc_nodes:"Pipelines visuais em grafo de nós",desc_multiAgent:"Orquestrar colaboração entre agentes"},systemHealth:{lite:"LITE",safe:"SAFE",critical:"Critical",warning:"Warning",info:"Info",title:"System Health",kinds:{cpu:"CPU",ram:"RAM",memory:"Memory",storage:"Storage",network:"Network",process:"Process",battery:"Battery",thermal:"Thermal",disk:"Disk"},moreModels:"More Models / API Settings"},panels:{memory:{title:"Insights de memória",indexLabel:"Índice:",clearIndex:"Limpar índice",searchPlaceholder:"Pesquisar na sua memória…",searchHint:"Pesquisa por similaridade semântica — pressione Enter ou clique",emptyTitle:"Pesquise na sua memória de IA",emptyNoResults:"Nenhuma memória encontrada",emptyHint:"Digite uma frase para encontrar habilidades, conversas e arquivos semanticamente similares.",emptyNoResultsHint:"Tente uma frase diferente ou indexe mais conteúdo usando os controles acima.",refreshStats:"Atualizar estatísticas",indexControls:"Controles de índice",vectors:"vetores",skills:"habilidades",files:"arquivos",indexed:"Indexado",indexCleared:"Índice limpo",opFailed:"Operação falhou",reqError:"Erro de requisição"},plugins:{title:"Arquiteto de plugins",newPlugin:"Novo plugin",buildTitle:"Criar novo plugin",namePlaceholder:"Nome do plugin (ex.: weather-monitor)",goalPlaceholder:"Objetivo (ex.: consultar a API OpenWeather a cada 5 min)",contextPlaceholder:"Contexto / notas opcionais",generatePlugin:"Gerar plugin",emptyTitle:"Nenhum plugin instalado",emptyHint:"Clique em «Novo plugin» para gerar seu primeiro plugin.",installed:"instalado",running:"EM EXECUÇÃO",stop:"Parar",run:"Executar",opFailed:"Operação falhou",reqError:"Erro de requisição",buildFailed:"Falha na compilação",refresh:"Atualizar"},skills:{title:"Biblioteca de habilidades",loading:"Carregando habilidades…",emptyTitle:"Nenhuma habilidade salva ainda",emptyHint:"Conclua um fluxo de trabalho na aba Conversa, depois clique em",saveAsSkill:"Salvar como habilidade",emptyHint2:"para construir sua biblioteca.",runningStatus:"Executando habilidade…",completedStatus:"Habilidade concluída",failedStatus:"Falha na execução",never:"Nunca",deleteConfirm:"Excluir?",yes:"Sim",no:"Não",runBtn:"Executar",runningBtn:"Executando…",doneBtn:"Concluído",lastRun:"última execução"},settings:{title:"Configurações",hardwareScore:"Pontuação de hardware",searchPlaceholder:"Pesquisar provedores…",allProviders:"Todos",apiKey:"Chave API",baseUrl:"URL base",model:"Modelo",testConnection:"Testar conexão",save:"Salvar",testOk:"Conexão bem-sucedida",testFail:"Falha na conexão",saved:"Salvo",saving:"Salvando…",testing:"Testando…",apiKeyWarning:"Chave API necessária — atualize sua chave para continuar."}}},Ac={en:xv,tr:UC,de:HC,fr:WC,es:KC,ja:GC,zh:qC,pt:YC},yv=h.createContext({locale:"en",t:xv,setLocale:()=>{}});function XC({children:e}){const t=typeof localStorage<"u"?localStorage.getItem("mustb-lang"):null,[n,s]=h.useState(t&&t in Ac?t:"en"),i=a=>{s(a);try{localStorage.setItem("mustb-lang",a)}catch{}fetch("/api/settings/language",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({language:a})}).catch(()=>{})};return h.useEffect(()=>{fetch("/api/setup/status").then(a=>a.ok?a.json():null).then(a=>{if(!(a!=null&&a.activeLanguage))return;const o=a.activeLanguage;if(o in Ac&&o!==n){s(o);try{localStorage.setItem("mustb-lang",o)}catch{}}}).catch(()=>{})},[]),r.jsx(yv.Provider,{value:{locale:n,t:Ac[n],setLocale:i},children:e})}const pt=()=>h.useContext(yv);function c0(){const e=mn(),{t}=pt(),[n,s]=h.useState("sleeping"),i=async()=>{if(n==="sleeping"){s("exiting");try{const a=await fetch("/api/setup/status");if(a.ok&&!(await a.json()).configured){e("/setup",{replace:!0});return}await fetch("/api/auth/local").catch(()=>{})}catch{}setTimeout(()=>e("/app/chat",{replace:!0}),450)}};return r.jsxs("div",{className:"relative min-h-screen overflow-hidden flex flex-col",children:[r.jsx(se,{children:n==="sleeping"&&r.jsxs(H.div,{className:"fixed inset-0 z-40 flex flex-col items-center justify-center",initial:{opacity:1},exit:{opacity:0,filter:"blur(24px)"},transition:{duration:.65,ease:"easeInOut"},children:[r.jsx("div",{className:"absolute inset-0 bg-cover bg-center bg-no-repeat",style:{backgroundImage:"url(/avatar/sleep.png)"}}),r.jsx("div",{className:"absolute inset-0 bg-black/55"}),r.jsxs("div",{className:"relative z-10 flex flex-col items-center gap-8 px-6",children:[r.jsxs("div",{className:"flex flex-col items-center gap-2",children:[r.jsx(H.div,{animate:{opacity:[.5,1,.5]},transition:{duration:3,repeat:1/0,ease:"easeInOut"},children:r.jsx(Rl,{size:20,className:"text-orange-400/70"})}),r.jsx("span",{className:"text-white/30 text-sm font-semibold tracking-widest uppercase select-none",children:"Must-b"})]}),r.jsxs(H.button,{onClick:i,disabled:n==="exiting",className:`group relative flex items-center gap-3 px-8 py-4 rounded-2xl
716
+ */const ze=D("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),xv={welcome:{tagline:"Your AI Brain",title:"Must-b",sleeping:"Sleeping...",waking:"Waking up...",awake:"Awakening...",wakeBtn:"Wake Must-b",wakeHint:"Tap to continue",reconfigure:"Reconfigure",footer:"© 2026 Must-b — Auto Step Platform"},sidebar:{newChat:"New Chat",recentChats:"Recent Chats",primary:"Primary",personalization:"Personalization",platform:"Platform",system:"System",automations:"My Automations",activeWorkflows:"Active Workflows",products:"Skills & Plugins",clients:"Client Management",integrations:"Integrations",logs:"Logs & Activity",settings:"Settings",logout:"Logout",poweredBy:"Powered by",deleteChat:"Delete Chat?",deleteConfirm:"This action cannot be undone.",cancel:"Cancel",delete:"Delete"},rightPanel:{agentRole:"Agent Role",hardware:"Hardware Score",model:"Active Model",connected:"Gateway Connected",rank:{master:"Master",planner:"Planner",worker:"Worker"}},workflow:{title:"Active Workflow",idle:"Idle — awaiting task",goal:"Goal",steps:{browse:"Opening browser",write:"Writing file",think:"Thinking",exec:"Executing command"}},dashboard:{placeholder:"Send a message to Must-b...",thinking:"Must-b is thinking..."},layout:{chats:"Chats",system:"System",openChats:"Open chat history",openSystem:"Open system panel",closePanel:"Close panel"},chat:{inputPlaceholder:"Ask Must-b anything…",listening:"Listening…",thoughtProcess:"Thought Process",saveAsSkill:"Save as Skill",skillSaved:"Skill saved to your library!",saving:"Saving…",retry:"Retry",save:"Save",guidance:"Guidance",errorBoundary:"Chat rendering error — reloading…",disclaimer:"Must-b is a cognitive assistant; verify critical outputs for accuracy.",placeholder:"What do you want to know?",tools:"Tools",attachFile:"Attach file",startDictation:"Start voice dictation",stopDictation:"Stop dictation",settingsAck:"Got it, settings updated permanently.",professionAck:"I've completed the necessary research on your profession and noted it in my mind (must-b.md). I'm now ready as your **{profession}** assistant."},nav:{chat:"Chat",browser:"Browser",workflows:"Workflows",voice:"Voice",settings:"Settings",files:"Files",memory:"Memory",apiKeys:"API Keys",skills:"Skills",plugins:"Plugins",mind:"Must-b Mind",channels:"Channels"},voice:{title:"Must-b Voice Command",back:"Go Back",wakeHint:'Say "Hey Must-b" to get started.',tapHint:"Tap the microphone to begin.",heard:"I hear you…",listening:"Listening…",stopHint:"Click to stop",thinking:"Processing…",cmdHint:"Go ahead, I'm listening…",speakingHint:"Must-b is speaking…"},dock:{chat:"Chat",files:"Files",browser:"Browser",skills:"Skills",memory:"Memory",plugins:"Plugins",workflows:"Workflows",settings:"Settings",system:"System",close:"Close",cat_webTools:"Web Tools",cat_fileMedia:"File & Media",cat_aiAgents:"AI & Agents",cat_systemTools:"System Tools",skill_webSearch:"Web Search",skill_webFetch:"Web Fetch",skill_browserControl:"Browser Control",skill_pdfReader:"PDF Reader",skill_imageAnalysis:"Image Analysis",skill_imageGeneration:"Image Generation",skill_tts:"Text-to-Speech",skill_spawnAgent:"Spawn Sub-Agent",skill_agentSessions:"Agent Sessions",skill_canvas:"Canvas",skill_git:"Git Operations",skill_gateway:"Gateway",skill_fileManager:"File Manager",skill_cron:"Cron Scheduler",skill_messages:"Messages",desc_webSearch:"Real-time web search (multi-provider)",desc_webFetch:"Fetch any URL as clean text",desc_browserControl:"Full Playwright browser automation",desc_pdfReader:"Extract & analyse PDF documents",desc_imageAnalysis:"Describe and analyse images",desc_imageGeneration:"Create AI-generated images",desc_tts:"Convert text to natural speech",desc_spawnAgent:"Launch a new autonomous agent session",desc_agentSessions:"List and manage active sessions",desc_canvas:"Visual drawing & whiteboard workspace",desc_git:"Commit, branch, diff, push/pull",desc_gateway:"Inter-system & A2A communication",desc_fileManager:"Read, write & manage files",desc_cron:"Schedule recurring tasks",desc_messages:"Send & receive inter-agent messages",cat_knowledgeBase:"Knowledge Base",cat_personalOrg:"Personal Organisation",mem_browse:"Browse Memories",mem_search:"Search Memory",mem_add:"Add Memory",mem_contacts:"Contacts",mem_calendar:"Calendar",desc_memBrowse:"View all stored knowledge entries",desc_memSearch:"Semantic search across your KB",desc_memAdd:"Store new facts and knowledge",desc_contacts:"Manage people and organisations",desc_calendar:"Schedule and manage events",cat_pluginManager:"Plugin Manager",cat_developer:"Developer",plug_marketplace:"Marketplace",plug_installed:"Installed",plug_mcp:"MCP Servers",plug_bundleMcp:"Bundle MCP",plug_cliCmds:"CLI Commands",desc_marketplace:"Discover plugins on ClawHub",desc_installed:"Manage and configure installed plugins",desc_mcp:"Model Context Protocol integrations",desc_bundleMcp:"Package & deploy MCP tool bundles",desc_cliCmds:"Custom slash command registration",cat_automation:"Automation",cat_advanced:"Advanced",wf_automations:"Automations",wf_scheduled:"Scheduled Tasks",wf_commands:"Commands",wf_nodes:"Nodes Workflow",wf_multiAgent:"Multi-Agent",desc_automations:"Build and run automated workflows",desc_scheduled:"Manage all cron schedules",desc_commands:"Custom slash commands",desc_nodes:"Visual node-graph pipelines",desc_multiAgent:"Orchestrate agent collaboration"},systemHealth:{lite:"LITE",safe:"SAFE",critical:"Critical",warning:"Warning",info:"Info",title:"System Health",moreModels:"More Models / API Settings",kinds:{cpu:"CPU",ram:"RAM",memory:"Memory",storage:"Storage",network:"Network",process:"Process",battery:"Battery",thermal:"Thermal",disk:"Disk"},alerts:{cpu_high:"High CPU usage — LLM load is saturating the system.",ram_high:"High memory usage — performance may degrade.",ram_critical:"Memory critical — system lockup risk."},recommendations:{cpu_high:"Close background processes or switch to a smaller model.",ram_high:"Consider switching to a lighter model.",ram_critical:"Switch to an 8B or 14B model immediately."}},panels:{memory:{title:"Memory Insights",indexLabel:"Index:",clearIndex:"Clear Index",searchPlaceholder:"Search your memory…",searchHint:"Semantic similarity search — press Enter or click",emptyTitle:"Search your AI memory",emptyNoResults:"No memories found",emptyHint:"Type a phrase to find semantically similar skills, conversations, and workspace files.",emptyNoResultsHint:"Try a different phrase or index more content using the controls above.",refreshStats:"Refresh stats",indexControls:"Index controls",vectors:"vectors",skills:"skills",files:"files",indexed:"Indexed",indexCleared:"Index cleared",opFailed:"Operation failed",reqError:"Request error"},plugins:{title:"Plugin Architect",newPlugin:"New Plugin",buildTitle:"Build New Plugin",namePlaceholder:"Plugin name (e.g. weather-monitor)",goalPlaceholder:"Goal (e.g. poll OpenWeather API every 5 min)",contextPlaceholder:"Optional context / notes",generatePlugin:"Generate Plugin",emptyTitle:"No plugins installed",emptyHint:'Click "New Plugin" to generate your first plugin.',installed:"installed",running:"RUNNING",stop:"Stop",run:"Run",opFailed:"Operation failed",reqError:"Request error",buildFailed:"Build failed",refresh:"Refresh"},skills:{title:"Skill Library",loading:"Loading skills…",emptyTitle:"No skills saved yet",emptyHint:"Complete a workflow in the Chat tab, then click",saveAsSkill:"Save as Skill",emptyHint2:"to build your library.",runningStatus:"Running skill…",completedStatus:"Skill completed",failedStatus:"Skill run failed",never:"Never",deleteConfirm:"Delete?",yes:"Yes",no:"No",runBtn:"Run",runningBtn:"Running…",doneBtn:"Done",lastRun:"last run"},settings:{title:"Settings",hardwareScore:"Hardware Score",searchPlaceholder:"Search providers…",allProviders:"All",apiKey:"API Key",baseUrl:"Base URL",model:"Model",testConnection:"Test Connection",save:"Save",testOk:"Connection successful",testFail:"Connection failed",saved:"Saved",saving:"Saving…",testing:"Testing…",apiKeyWarning:"API key required — update your key to continue."}}},UC={welcome:{tagline:"Yapay Zeka Beyniniz",title:"Must-b",sleeping:"Uyuyor...",waking:"Uyandırılıyor...",awake:"Uyanıyor...",wakeBtn:"Must-b'yi Uyandır",wakeHint:"Devam etmek için uyandır",reconfigure:"Yeniden Yapılandır",footer:"© 2026 Must-b — Auto Step Platform"},sidebar:{newChat:"Yeni Sohbet",recentChats:"Son Sohbetler",primary:"Birincil",personalization:"Kişiselleştirme",platform:"Platform",system:"Sistem",automations:"Otomasyonlarım",activeWorkflows:"Aktif İş Akışları",products:"Araçlar & Eklentiler",clients:"Müşteri Yönetimi",integrations:"Entegrasyonlar",logs:"Kayıtlar & Aktivite",settings:"Ayarlar",logout:"Çıkış",poweredBy:"Altyapısı:",deleteChat:"Sohbet Silinsin mi?",deleteConfirm:"Bu işlem geri alınamaz.",cancel:"İptal",delete:"Sil"},rightPanel:{agentRole:"Ajan Rolü",hardware:"Donanım Puanı",model:"Aktif Model",connected:"Gateway Bağlı",rank:{master:"Usta",planner:"Planlayıcı",worker:"İşçi"}},workflow:{title:"Aktif İş Akışı",idle:"Boşta — görev bekleniyor",goal:"Hedef",steps:{browse:"Tarayıcı açılıyor",write:"Dosya yazılıyor",think:"Düşünülüyor",exec:"Komut çalıştırılıyor"}},dashboard:{placeholder:"Must-b'ye bir mesaj gönderin...",thinking:"Must-b düşünüyor..."},layout:{chats:"Sohbetler",system:"Sistem",openChats:"Sohbet geçmişini aç",openSystem:"Sistem panelini aç",closePanel:"Paneli kapat"},chat:{inputPlaceholder:"Must-b'ye her şeyi sorun…",listening:"Dinleniyor…",thoughtProcess:"Düşünce Süreci",saveAsSkill:"Beceri Olarak Kaydet",skillSaved:"Beceri kütüphanenize kaydedildi!",saving:"Kaydediliyor…",retry:"Tekrar Dene",save:"Kaydet",guidance:"Rehberlik",errorBoundary:"Sohbet render hatası — yeniden yükleniyor…",disclaimer:"Must-b bilişsel bir asistandır; kritik çıktıları doğrulamanız önerilir.",placeholder:"Ne öğrenmek istiyorsunuz?",tools:"Araçlar",attachFile:"Dosya ekle",startDictation:"Sesli giriş başlat",stopDictation:"Durdur",settingsAck:"Anlaşıldı, ayarlar kalıcı olarak güncellendi.",professionAck:"Mesleğiniz hakkında gerekli araştırmaları yaptım ve zihnime (must-b.md) not aldım. Artık bir **{profession}** asistanı olarak hazırım."},nav:{chat:"Sohbet",browser:"Tarayıcı",workflows:"İş Akışları",voice:"Sesli",settings:"Ayarlar",files:"Dosyalar",memory:"Bellek",apiKeys:"API Anahtarları",skills:"Beceriler",plugins:"Eklentiler",mind:"Must-b Zihni",channels:"Kanallar"},voice:{title:"Must-b Sesli Komuta",back:"Geri Dön",wakeHint:'"Hey Must-b" demeyi dene.',tapHint:"Başlamak için mikrofona dokunun.",heard:"Sizi duyuyorum…",listening:"Dinleniyor…",stopHint:"Durdurmak için tıklayın",thinking:"İşleniyor…",cmdHint:"Buyurun, dinliyorum…",speakingHint:"Must-b konuşuyor…"},systemHealth:{lite:"LITE",safe:"GÜVENLİ",critical:"Kritik",warning:"Uyarı",info:"Bilgi",title:"Sistem Durumu",moreModels:"Daha Fazla Model / API Ayarları",kinds:{cpu:"İşlemci",ram:"RAM",memory:"Bellek",storage:"Depolama",network:"Ağ",process:"İşlem",battery:"Batarya",thermal:"Isı",disk:"Disk"},alerts:{cpu_high:"İşlemci kullanımı yüksek — LLM yükü sistemi doyuruyor.",ram_high:"Bellek kullanımı yüksek — performans düşebilir.",ram_critical:"Bellek kritik — sistem kilitlenme riski var."},recommendations:{cpu_high:"Arka plan işlemlerini kapatın veya daha küçük bir modele geçin.",ram_high:"Daha hafif bir modele geçmeyi düşünün.",ram_critical:"Hemen 8B veya 14B bir modele geçin."}},dock:{chat:"Sohbet",files:"Dosyalar",browser:"Tarayıcı",skills:"Beceriler",memory:"Bellek",plugins:"Eklentiler",workflows:"İş Akışları",settings:"Ayarlar",system:"Sistem",close:"Kapat",cat_webTools:"Web Araçları",cat_fileMedia:"Dosya & Medya",cat_aiAgents:"Yapay Zeka & Ajanlar",cat_systemTools:"Sistem Araçları",skill_webSearch:"Web Arama",skill_webFetch:"Web Çekme",skill_browserControl:"Tarayıcı Kontrolü",skill_pdfReader:"PDF Okuyucu",skill_imageAnalysis:"Görüntü Analizi",skill_imageGeneration:"Görüntü Oluşturma",skill_tts:"Metinden Sese",skill_spawnAgent:"Alt Ajan Başlat",skill_agentSessions:"Ajan Oturumları",skill_canvas:"Tuval",skill_git:"Git İşlemleri",skill_gateway:"Ağ Geçidi",skill_fileManager:"Dosya Yöneticisi",skill_cron:"Zamanlayıcı",skill_messages:"Mesajlar",desc_webSearch:"Gerçek zamanlı web araması (çoklu sağlayıcı)",desc_webFetch:"Herhangi bir URL'yi metin olarak çek",desc_browserControl:"Tam Playwright tarayıcı otomasyonu",desc_pdfReader:"PDF belgelerini çıkar ve analiz et",desc_imageAnalysis:"Görüntüleri tanımla ve analiz et",desc_imageGeneration:"Yapay zeka ile görüntü oluştur",desc_tts:"Metni doğal sese dönüştür",desc_spawnAgent:"Yeni özerk ajan oturumu başlat",desc_agentSessions:"Aktif oturumları listele ve yönet",desc_canvas:"Görsel çizim & beyaz tahta",desc_git:"Commit, branch, diff, push/pull",desc_gateway:"Sistemler arası & A2A iletişim",desc_fileManager:"Dosyaları oku, yaz ve yönet",desc_cron:"Tekrarlayan görevleri zamanla",desc_messages:"Ajanlar arası mesaj gönder ve al",cat_knowledgeBase:"Bilgi Tabanı",cat_personalOrg:"Kişisel Organizasyon",mem_browse:"Belleklere Göz At",mem_search:"Bellekte Ara",mem_add:"Bellek Ekle",mem_contacts:"Kişiler",mem_calendar:"Takvim",desc_memBrowse:"Tüm saklanan bilgi girişlerini görüntüle",desc_memSearch:"Bilgi tabanında anlamsal arama",desc_memAdd:"Yeni bilgi ve gerçekleri sakla",desc_contacts:"Kişileri ve kuruluşları yönet",desc_calendar:"Etkinlikleri zamanla ve yönet",cat_pluginManager:"Eklenti Yöneticisi",cat_developer:"Geliştirici",plug_marketplace:"Pazar Yeri",plug_installed:"Yüklü Eklentiler",plug_mcp:"MCP Sunucuları",plug_bundleMcp:"MCP Paketi",plug_cliCmds:"CLI Komutları",desc_marketplace:"ClawHub'da eklentileri keşfet",desc_installed:"Yüklü eklentileri yönet ve yapılandır",desc_mcp:"Model Context Protocol entegrasyonları",desc_bundleMcp:"MCP araç paketlerini oluştur ve dağıt",desc_cliCmds:"Özel eğik çizgi komutları kaydı",cat_automation:"Otomasyon",cat_advanced:"Gelişmiş",wf_automations:"Otomasyonlar",wf_scheduled:"Zamanlanmış Görevler",wf_commands:"Komutlar",wf_nodes:"Düğüm İş Akışı",wf_multiAgent:"Çoklu Ajan",desc_automations:"Otomatik iş akışları oluştur ve çalıştır",desc_scheduled:"Tüm cron zamanlamalarını yönet",desc_commands:"Özel eğik çizgi komutları",desc_nodes:"Görsel düğüm-grafik iş hatları",desc_multiAgent:"Ajan işbirliğini düzenle"},panels:{memory:{title:"Bellek Görüşleri",indexLabel:"İndeks:",clearIndex:"İndeksi Temizle",searchPlaceholder:"Belleğinizde arayın…",searchHint:"Anlamsal benzerlik araması — Enter'a basın veya tıklayın",emptyTitle:"Yapay Zeka Belleğinizi Arayın",emptyNoResults:"Bellek bulunamadı",emptyHint:"Beceriler, sohbetler ve dosyalarda anlamsal olarak benzer içerik bulmak için bir ifade yazın.",emptyNoResultsHint:"Farklı bir ifade deneyin veya yukarıdaki kontrollerle daha fazla içerik ekleyin.",refreshStats:"İstatistikleri yenile",indexControls:"İndeks kontrolleri",vectors:"vektör",skills:"beceri",files:"dosya",indexed:"İndekslendi",indexCleared:"İndeks temizlendi",opFailed:"İşlem başarısız",reqError:"İstek hatası"},plugins:{title:"Eklenti Mimarı",newPlugin:"Yeni Eklenti",buildTitle:"Yeni Eklenti Oluştur",namePlaceholder:"Eklenti adı (örn. hava-durumu-monitörü)",goalPlaceholder:"Hedef (örn. OpenWeather API'yi 5 dakikada bir sorgula)",contextPlaceholder:"İsteğe bağlı bağlam / notlar",generatePlugin:"Eklenti Oluştur",emptyTitle:"Yüklü eklenti yok",emptyHint:'İlk eklentinizi oluşturmak için "Yeni Eklenti"ye tıklayın.',installed:"yüklü",running:"ÇALIŞIYOR",stop:"Durdur",run:"Çalıştır",opFailed:"İşlem başarısız",reqError:"İstek hatası",buildFailed:"Oluşturma başarısız",refresh:"Yenile"},skills:{title:"Beceri Kütüphanesi",loading:"Beceriler yükleniyor…",emptyTitle:"Henüz kaydedilmiş beceri yok",emptyHint:"Sohbet sekmesinde bir iş akışını tamamlayın, ardından tıklayın",saveAsSkill:"Beceri Olarak Kaydet",emptyHint2:"kütüphanenizi oluşturmak için.",runningStatus:"Beceri çalışıyor…",completedStatus:"Beceri tamamlandı",failedStatus:"Beceri çalıştırma başarısız",never:"Hiçbir zaman",deleteConfirm:"Sil?",yes:"Evet",no:"Hayır",runBtn:"Çalıştır",runningBtn:"Çalışıyor…",doneBtn:"Tamamlandı",lastRun:"son çalıştırma"},settings:{title:"Ayarlar",hardwareScore:"Donanım Puanı",searchPlaceholder:"Sağlayıcı ara…",allProviders:"Tümü",apiKey:"API Anahtarı",baseUrl:"Temel URL",model:"Model",testConnection:"Bağlantıyı Test Et",save:"Kaydet",testOk:"Bağlantı başarılı",testFail:"Bağlantı başarısız",saved:"Kaydedildi",saving:"Kaydediliyor…",testing:"Test ediliyor…",apiKeyWarning:"API anahtarı gerekli — devam etmek için anahtarınızı güncelleyin."}}},HC={welcome:{tagline:"Ihr KI-Gehirn",title:"Must-b",sleeping:"Schläft...",waking:"Wird geweckt...",awake:"Erwacht...",wakeBtn:"Must-b wecken",wakeHint:"Tippen zum Fortfahren",reconfigure:"Neu konfigurieren",footer:"© 2026 Must-b — Auto Step Platform"},sidebar:{newChat:"Neuer Chat",recentChats:"Letzte Chats",platform:"Plattform",system:"System",automations:"Meine Automatisierungen",activeWorkflows:"Aktive Workflows",products:"Skills & Plugins",clients:"Kundenverwaltung",integrations:"Integrationen",logs:"Protokolle & Aktivität",settings:"Einstellungen",logout:"Abmelden",poweredBy:"Betrieben von",deleteChat:"Chat löschen?",deleteConfirm:"Diese Aktion kann nicht rückgängig gemacht werden.",cancel:"Abbrechen",delete:"Löschen"},rightPanel:{agentRole:"Agentenrolle",hardware:"Hardware-Score",model:"Aktives Modell",connected:"Gateway verbunden",rank:{master:"Meister",planner:"Planer",worker:"Arbeiter"}},workflow:{title:"Aktiver Workflow",idle:"Leerlauf — wartet auf Aufgabe",goal:"Ziel",steps:{browse:"Browser wird geöffnet",write:"Datei wird geschrieben",think:"Wird nachgedacht",exec:"Befehl wird ausgeführt"}},dashboard:{placeholder:"Nachricht an Must-b senden...",thinking:"Must-b denkt nach..."},layout:{chats:"Chats",system:"System",openChats:"Chatverlauf öffnen",openSystem:"Systembereich öffnen",closePanel:"Bereich schließen"},chat:{inputPlaceholder:"Fragen Sie Must-b alles…",listening:"Höre zu…",thoughtProcess:"Denkprozess",saveAsSkill:"Als Fähigkeit speichern",skillSaved:"Fähigkeit in Ihrer Bibliothek gespeichert!",saving:"Speichere…",retry:"Erneut versuchen",save:"Speichern",guidance:"Hinweis",errorBoundary:"Chat rendering error — reloading…",disclaimer:"Must-b is a cognitive assistant; verify critical outputs for accuracy.",placeholder:"What do you want to know?",tools:"Tools",attachFile:"Attach file",startDictation:"Start voice dictation",stopDictation:"Stop dictation"},nav:{chat:"Chat",browser:"Browser",workflows:"Workflows",voice:"Voice",settings:"Settings",files:"Files",memory:"Memory",apiKeys:"API Keys",channels:"Kanäle"},voice:{title:"Must-b Voice Command",back:"Go Back",wakeHint:'Say "Hey Must-b" to get started.',tapHint:"Tap the microphone to begin.",heard:"I hear you…",listening:"Listening…",stopHint:"Click to stop",thinking:"Processing…",cmdHint:"Go ahead, I am listening…",speakingHint:"Must-b is speaking…"},dock:{chat:"Chat",files:"Dateien",browser:"Browser",skills:"Fähigkeiten",memory:"Gedächtnis",plugins:"Plugins",workflows:"Workflows",settings:"Einstellungen",system:"System",close:"Schließen",cat_webTools:"Web-Werkzeuge",cat_fileMedia:"Datei & Medien",cat_aiAgents:"KI & Agenten",cat_systemTools:"Systemwerkzeuge",skill_webSearch:"Websuche",skill_webFetch:"Web-Abruf",skill_browserControl:"Browser-Steuerung",skill_pdfReader:"PDF-Leser",skill_imageAnalysis:"Bildanalyse",skill_imageGeneration:"Bilderzeugung",skill_tts:"Text-zu-Sprache",skill_spawnAgent:"Unteragent starten",skill_agentSessions:"Agentensitzungen",skill_canvas:"Leinwand",skill_git:"Git-Operationen",skill_gateway:"Gateway",skill_fileManager:"Dateimanager",skill_cron:"Aufgabenplaner",skill_messages:"Nachrichten",desc_webSearch:"Echtzeit-Websuche (Multi-Provider)",desc_webFetch:"Beliebige URL als sauberen Text abrufen",desc_browserControl:"Vollständige Playwright-Browserautomatisierung",desc_pdfReader:"PDF-Dokumente extrahieren & analysieren",desc_imageAnalysis:"Bilder beschreiben und analysieren",desc_imageGeneration:"KI-generierte Bilder erstellen",desc_tts:"Text in natürliche Sprache umwandeln",desc_spawnAgent:"Neue autonome Agentensitzung starten",desc_agentSessions:"Aktive Sitzungen auflisten und verwalten",desc_canvas:"Visueller Zeichen- & Whiteboard-Bereich",desc_git:"Commit, Branch, Diff, Push/Pull",desc_gateway:"Systemübergreifende & A2A-Kommunikation",desc_fileManager:"Dateien lesen, schreiben & verwalten",desc_cron:"Wiederkehrende Aufgaben planen",desc_messages:"Agenten-Nachrichten senden & empfangen",cat_knowledgeBase:"Wissensdatenbank",cat_personalOrg:"Persönliche Organisation",mem_browse:"Erinnerungen durchsuchen",mem_search:"Gedächtnis suchen",mem_add:"Erinnerung hinzufügen",mem_contacts:"Kontakte",mem_calendar:"Kalender",desc_memBrowse:"Alle gespeicherten Wissenseinträge anzeigen",desc_memSearch:"Semantische Suche in der Wissensdatenbank",desc_memAdd:"Neue Fakten und Wissen speichern",desc_contacts:"Personen und Organisationen verwalten",desc_calendar:"Termine planen und verwalten",cat_pluginManager:"Plugin-Manager",cat_developer:"Entwickler",plug_marketplace:"Marktplatz",plug_installed:"Installiert",plug_mcp:"MCP-Server",plug_bundleMcp:"MCP bündeln",plug_cliCmds:"CLI-Befehle",desc_marketplace:"Plugins auf ClawHub entdecken",desc_installed:"Installierte Plugins verwalten und konfigurieren",desc_mcp:"Model Context Protocol-Integrationen",desc_bundleMcp:"MCP-Werkzeugpakete erstellen & bereitstellen",desc_cliCmds:"Benutzerdefinierte Schrägstrichbefehle registrieren",cat_automation:"Automatisierung",cat_advanced:"Erweitert",wf_automations:"Automatisierungen",wf_scheduled:"Geplante Aufgaben",wf_commands:"Befehle",wf_nodes:"Knoten-Workflow",wf_multiAgent:"Multi-Agent",desc_automations:"Automatisierte Workflows erstellen und ausführen",desc_scheduled:"Alle Cron-Zeitpläne verwalten",desc_commands:"Benutzerdefinierte Schrägstrichbefehle",desc_nodes:"Visuelle Knoten-Graph-Pipelines",desc_multiAgent:"Agentenzusammenarbeit orchestrieren"},systemHealth:{lite:"LITE",safe:"SAFE",critical:"Critical",warning:"Warning",info:"Info",title:"System Health",kinds:{cpu:"CPU",ram:"RAM",memory:"Memory",storage:"Storage",network:"Network",process:"Process",battery:"Battery",thermal:"Thermal",disk:"Disk"},moreModels:"More Models / API Settings"},panels:{memory:{title:"Gedächtnisübersicht",indexLabel:"Index:",clearIndex:"Index löschen",searchPlaceholder:"Gedächtnis durchsuchen…",searchHint:"Semantische Ähnlichkeitssuche — Enter drücken oder klicken",emptyTitle:"KI-Gedächtnis durchsuchen",emptyNoResults:"Keine Erinnerungen gefunden",emptyHint:"Geben Sie einen Begriff ein, um semantisch ähnliche Fähigkeiten, Gespräche und Dateien zu finden.",emptyNoResultsHint:"Versuchen Sie eine andere Formulierung oder indizieren Sie mehr Inhalte.",refreshStats:"Statistiken aktualisieren",indexControls:"Indexsteuerung",vectors:"Vektoren",skills:"Fähigkeiten",files:"Dateien",indexed:"Indiziert",indexCleared:"Index gelöscht",opFailed:"Vorgang fehlgeschlagen",reqError:"Anfragefehler"},plugins:{title:"Plugin-Architekt",newPlugin:"Neues Plugin",buildTitle:"Neues Plugin erstellen",namePlaceholder:"Plugin-Name (z.B. wetter-monitor)",goalPlaceholder:"Ziel (z.B. OpenWeather API alle 5 Min. abfragen)",contextPlaceholder:"Optionaler Kontext / Notizen",generatePlugin:"Plugin generieren",emptyTitle:"Keine Plugins installiert",emptyHint:'Klicken Sie auf "Neues Plugin", um Ihr erstes Plugin zu erstellen.',installed:"installiert",running:"LÄUFT",stop:"Stoppen",run:"Ausführen",opFailed:"Vorgang fehlgeschlagen",reqError:"Anfragefehler",buildFailed:"Erstellung fehlgeschlagen",refresh:"Aktualisieren"},skills:{title:"Fähigkeitenbibliothek",loading:"Fähigkeiten werden geladen…",emptyTitle:"Noch keine Fähigkeiten gespeichert",emptyHint:"Schließen Sie einen Workflow im Chat-Tab ab, dann klicken Sie auf",saveAsSkill:"Als Fähigkeit speichern",emptyHint2:"um Ihre Bibliothek aufzubauen.",runningStatus:"Fähigkeit wird ausgeführt…",completedStatus:"Fähigkeit abgeschlossen",failedStatus:"Ausführung fehlgeschlagen",never:"Nie",deleteConfirm:"Löschen?",yes:"Ja",no:"Nein",runBtn:"Ausführen",runningBtn:"Läuft…",doneBtn:"Fertig",lastRun:"letzter Lauf"},settings:{title:"Einstellungen",hardwareScore:"Hardware-Score",searchPlaceholder:"Anbieter suchen…",allProviders:"Alle",apiKey:"API-Schlüssel",baseUrl:"Basis-URL",model:"Modell",testConnection:"Verbindung testen",save:"Speichern",testOk:"Verbindung erfolgreich",testFail:"Verbindung fehlgeschlagen",saved:"Gespeichert",saving:"Speichern…",testing:"Teste…",apiKeyWarning:"API-Schlüssel erforderlich — aktualisieren Sie Ihren Schlüssel."}}},WC={welcome:{tagline:"Votre cerveau IA",title:"Must-b",sleeping:"En veille...",waking:"Réveil en cours...",awake:"Éveil...",wakeBtn:"Réveiller Must-b",wakeHint:"Appuyez pour continuer",reconfigure:"Reconfigurer",footer:"© 2026 Must-b — Plateforme Auto Step"},sidebar:{newChat:"Nouvelle discussion",recentChats:"Discussions récentes",platform:"Plateforme",system:"Système",automations:"Mes automatisations",activeWorkflows:"Flux de travail actifs",products:"Skills & Plugins",clients:"Gestion des clients",integrations:"Intégrations",logs:"Journaux & Activité",settings:"Paramètres",logout:"Déconnexion",poweredBy:"Propulsé par",deleteChat:"Supprimer la discussion ?",deleteConfirm:"Cette action est irréversible.",cancel:"Annuler",delete:"Supprimer"},rightPanel:{agentRole:"Rôle de l'agent",hardware:"Score matériel",model:"Modèle actif",connected:"Passerelle connectée",rank:{master:"Maître",planner:"Planificateur",worker:"Exécutant"}},workflow:{title:"Flux de travail actif",idle:"Inactif — en attente d'une tâche",goal:"Objectif",steps:{browse:"Ouverture du navigateur",write:"Écriture du fichier",think:"Réflexion",exec:"Exécution de la commande"}},dashboard:{placeholder:"Envoyer un message à Must-b...",thinking:"Must-b réfléchit..."},layout:{chats:"Discussions",system:"Système",openChats:"Ouvrir l'historique des discussions",openSystem:"Ouvrir le panneau système",closePanel:"Fermer le panneau"},chat:{inputPlaceholder:"Posez n'importe quelle question à Must-b…",listening:"Écoute en cours…",thoughtProcess:"Processus de réflexion",saveAsSkill:"Enregistrer comme compétence",skillSaved:"Compétence enregistrée dans votre bibliothèque !",saving:"Enregistrement…",retry:"Réessayer",save:"Enregistrer",guidance:"Conseils",errorBoundary:"Chat rendering error — reloading…",disclaimer:"Must-b is a cognitive assistant; verify critical outputs for accuracy.",placeholder:"What do you want to know?",tools:"Tools",attachFile:"Attach file",startDictation:"Start voice dictation",stopDictation:"Stop dictation"},nav:{chat:"Chat",browser:"Browser",workflows:"Workflows",voice:"Voice",settings:"Settings",files:"Files",memory:"Memory",apiKeys:"API Keys",channels:"Canaux"},voice:{title:"Must-b Voice Command",back:"Go Back",wakeHint:'Say "Hey Must-b" to get started.',tapHint:"Tap the microphone to begin.",heard:"I hear you…",listening:"Listening…",stopHint:"Click to stop",thinking:"Processing…",cmdHint:"Go ahead, I am listening…",speakingHint:"Must-b is speaking…"},dock:{chat:"Discussion",files:"Fichiers",browser:"Navigateur",skills:"Compétences",memory:"Mémoire",plugins:"Plugins",workflows:"Flux de travail",settings:"Paramètres",system:"Système",close:"Fermer",cat_webTools:"Outils web",cat_fileMedia:"Fichiers & Médias",cat_aiAgents:"IA & Agents",cat_systemTools:"Outils système",skill_webSearch:"Recherche web",skill_webFetch:"Récupération web",skill_browserControl:"Contrôle du navigateur",skill_pdfReader:"Lecteur PDF",skill_imageAnalysis:"Analyse d'image",skill_imageGeneration:"Génération d'image",skill_tts:"Synthèse vocale",skill_spawnAgent:"Créer un sous-agent",skill_agentSessions:"Sessions d'agents",skill_canvas:"Tableau de travail",skill_git:"Opérations Git",skill_gateway:"Passerelle",skill_fileManager:"Gestionnaire de fichiers",skill_cron:"Planificateur Cron",skill_messages:"Messages",desc_webSearch:"Recherche web en temps réel (multi-fournisseur)",desc_webFetch:"Récupérer n'importe quelle URL en texte brut",desc_browserControl:"Automatisation complète du navigateur Playwright",desc_pdfReader:"Extraire et analyser des documents PDF",desc_imageAnalysis:"Décrire et analyser des images",desc_imageGeneration:"Créer des images générées par IA",desc_tts:"Convertir du texte en parole naturelle",desc_spawnAgent:"Lancer une nouvelle session d'agent autonome",desc_agentSessions:"Lister et gérer les sessions actives",desc_canvas:"Espace de dessin visuel et tableau blanc",desc_git:"Commit, branche, diff, push/pull",desc_gateway:"Communication inter-systèmes & A2A",desc_fileManager:"Lire, écrire et gérer des fichiers",desc_cron:"Planifier des tâches récurrentes",desc_messages:"Envoyer & recevoir des messages inter-agents",cat_knowledgeBase:"Base de connaissances",cat_personalOrg:"Organisation personnelle",mem_browse:"Parcourir les souvenirs",mem_search:"Rechercher dans la mémoire",mem_add:"Ajouter un souvenir",mem_contacts:"Contacts",mem_calendar:"Calendrier",desc_memBrowse:"Voir toutes les entrées de connaissances stockées",desc_memSearch:"Recherche sémantique dans votre base de connaissances",desc_memAdd:"Stocker de nouveaux faits et connaissances",desc_contacts:"Gérer les personnes et organisations",desc_calendar:"Planifier et gérer des événements",cat_pluginManager:"Gestionnaire de plugins",cat_developer:"Développeur",plug_marketplace:"Marché",plug_installed:"Installés",plug_mcp:"Serveurs MCP",plug_bundleMcp:"Bundle MCP",plug_cliCmds:"Commandes CLI",desc_marketplace:"Découvrir des plugins sur ClawHub",desc_installed:"Gérer et configurer les plugins installés",desc_mcp:"Intégrations du protocole de contexte de modèle",desc_bundleMcp:"Empaqueter et déployer des bundles d'outils MCP",desc_cliCmds:"Enregistrement de commandes slash personnalisées",cat_automation:"Automatisation",cat_advanced:"Avancé",wf_automations:"Automatisations",wf_scheduled:"Tâches planifiées",wf_commands:"Commandes",wf_nodes:"Flux de nœuds",wf_multiAgent:"Multi-Agent",desc_automations:"Créer et exécuter des flux de travail automatisés",desc_scheduled:"Gérer tous les plannings cron",desc_commands:"Commandes slash personnalisées",desc_nodes:"Pipelines visuels en graphe de nœuds",desc_multiAgent:"Orchestrer la collaboration entre agents"},systemHealth:{lite:"LITE",safe:"SAFE",critical:"Critical",warning:"Warning",info:"Info",title:"System Health",kinds:{cpu:"CPU",ram:"RAM",memory:"Memory",storage:"Storage",network:"Network",process:"Process",battery:"Battery",thermal:"Thermal",disk:"Disk"},moreModels:"More Models / API Settings"},panels:{memory:{title:"Aperçus de la mémoire",indexLabel:"Index :",clearIndex:"Effacer l'index",searchPlaceholder:"Rechercher dans votre mémoire…",searchHint:"Recherche par similarité sémantique — appuyez sur Entrée ou cliquez",emptyTitle:"Recherchez dans votre mémoire IA",emptyNoResults:"Aucun souvenir trouvé",emptyHint:"Saisissez une phrase pour trouver des compétences, conversations et fichiers sémantiquement similaires.",emptyNoResultsHint:"Essayez une phrase différente ou indexez plus de contenu via les contrôles ci-dessus.",refreshStats:"Actualiser les statistiques",indexControls:"Contrôles de l'index",vectors:"vecteurs",skills:"compétences",files:"fichiers",indexed:"Indexé",indexCleared:"Index effacé",opFailed:"Opération échouée",reqError:"Erreur de requête"},plugins:{title:"Architecte de plugins",newPlugin:"Nouveau plugin",buildTitle:"Créer un nouveau plugin",namePlaceholder:"Nom du plugin (ex. weather-monitor)",goalPlaceholder:"Objectif (ex. interroger l'API OpenWeather toutes les 5 min)",contextPlaceholder:"Contexte / notes optionnels",generatePlugin:"Générer le plugin",emptyTitle:"Aucun plugin installé",emptyHint:"Cliquez sur « Nouveau plugin » pour générer votre premier plugin.",installed:"installé",running:"EN COURS",stop:"Arrêter",run:"Exécuter",opFailed:"Opération échouée",reqError:"Erreur de requête",buildFailed:"Échec de la compilation",refresh:"Actualiser"},skills:{title:"Bibliothèque de compétences",loading:"Chargement des compétences…",emptyTitle:"Aucune compétence enregistrée",emptyHint:"Terminez un flux de travail dans l'onglet Discussion, puis cliquez sur",saveAsSkill:"Enregistrer comme compétence",emptyHint2:"pour constituer votre bibliothèque.",runningStatus:"Exécution de la compétence…",completedStatus:"Compétence terminée",failedStatus:"Échec de l'exécution",never:"Jamais",deleteConfirm:"Supprimer ?",yes:"Oui",no:"Non",runBtn:"Exécuter",runningBtn:"En cours…",doneBtn:"Terminé",lastRun:"dernière exécution"},settings:{title:"Paramètres",hardwareScore:"Score matériel",searchPlaceholder:"Rechercher des fournisseurs…",allProviders:"Tous",apiKey:"Clé API",baseUrl:"URL de base",model:"Modèle",testConnection:"Tester la connexion",save:"Enregistrer",testOk:"Connexion réussie",testFail:"Échec de la connexion",saved:"Enregistré",saving:"Enregistrement…",testing:"Test en cours…",apiKeyWarning:"Clé API requise — mettez à jour votre clé pour continuer."}}},KC={welcome:{tagline:"Tu cerebro de IA",title:"Must-b",sleeping:"Durmiendo...",waking:"Despertando...",awake:"Despertando...",wakeBtn:"Despertar Must-b",wakeHint:"Toca para continuar",reconfigure:"Reconfigurar",footer:"© 2026 Must-b — Plataforma Auto Step"},sidebar:{newChat:"Nueva conversación",recentChats:"Conversaciones recientes",platform:"Plataforma",system:"Sistema",automations:"Mis automatizaciones",activeWorkflows:"Flujos de trabajo activos",products:"Skills & Plugins",clients:"Gestión de clientes",integrations:"Integraciones",logs:"Registros y actividad",settings:"Configuración",logout:"Cerrar sesión",poweredBy:"Desarrollado por",deleteChat:"¿Eliminar conversación?",deleteConfirm:"Esta acción no se puede deshacer.",cancel:"Cancelar",delete:"Eliminar"},rightPanel:{agentRole:"Rol del agente",hardware:"Puntuación de hardware",model:"Modelo activo",connected:"Puerta de enlace conectada",rank:{master:"Maestro",planner:"Planificador",worker:"Trabajador"}},workflow:{title:"Flujo de trabajo activo",idle:"Inactivo — esperando tarea",goal:"Objetivo",steps:{browse:"Abriendo navegador",write:"Escribiendo archivo",think:"Pensando",exec:"Ejecutando comando"}},dashboard:{placeholder:"Envía un mensaje a Must-b...",thinking:"Must-b está pensando..."},layout:{chats:"Conversaciones",system:"Sistema",openChats:"Abrir historial de conversaciones",openSystem:"Abrir panel del sistema",closePanel:"Cerrar panel"},chat:{inputPlaceholder:"Pregunta cualquier cosa a Must-b…",listening:"Escuchando…",thoughtProcess:"Proceso de pensamiento",saveAsSkill:"Guardar como habilidad",skillSaved:"¡Habilidad guardada en tu biblioteca!",saving:"Guardando…",retry:"Reintentar",save:"Guardar",guidance:"Orientación",errorBoundary:"Chat rendering error — reloading…",disclaimer:"Must-b is a cognitive assistant; verify critical outputs for accuracy.",placeholder:"What do you want to know?",tools:"Tools",attachFile:"Attach file",startDictation:"Start voice dictation",stopDictation:"Stop dictation"},nav:{chat:"Chat",browser:"Browser",workflows:"Workflows",voice:"Voice",settings:"Settings",files:"Files",memory:"Memory",apiKeys:"API Keys",channels:"Canales"},voice:{title:"Must-b Voice Command",back:"Go Back",wakeHint:'Say "Hey Must-b" to get started.',tapHint:"Tap the microphone to begin.",heard:"I hear you…",listening:"Listening…",stopHint:"Click to stop",thinking:"Processing…",cmdHint:"Go ahead, I am listening…",speakingHint:"Must-b is speaking…"},dock:{chat:"Conversación",files:"Archivos",browser:"Navegador",skills:"Habilidades",memory:"Memoria",plugins:"Plugins",workflows:"Flujos de trabajo",settings:"Configuración",system:"Sistema",close:"Cerrar",cat_webTools:"Herramientas web",cat_fileMedia:"Archivos y medios",cat_aiAgents:"IA y agentes",cat_systemTools:"Herramientas del sistema",skill_webSearch:"Búsqueda web",skill_webFetch:"Recuperación web",skill_browserControl:"Control del navegador",skill_pdfReader:"Lector de PDF",skill_imageAnalysis:"Análisis de imagen",skill_imageGeneration:"Generación de imágenes",skill_tts:"Texto a voz",skill_spawnAgent:"Crear subagente",skill_agentSessions:"Sesiones de agentes",skill_canvas:"Lienzo",skill_git:"Operaciones Git",skill_gateway:"Puerta de enlace",skill_fileManager:"Gestor de archivos",skill_cron:"Planificador Cron",skill_messages:"Mensajes",desc_webSearch:"Búsqueda web en tiempo real (multi-proveedor)",desc_webFetch:"Obtener cualquier URL como texto limpio",desc_browserControl:"Automatización completa del navegador con Playwright",desc_pdfReader:"Extraer y analizar documentos PDF",desc_imageAnalysis:"Describir y analizar imágenes",desc_imageGeneration:"Crear imágenes generadas por IA",desc_tts:"Convertir texto en habla natural",desc_spawnAgent:"Iniciar una nueva sesión de agente autónomo",desc_agentSessions:"Listar y gestionar sesiones activas",desc_canvas:"Espacio de dibujo visual y pizarra",desc_git:"Commit, rama, diff, push/pull",desc_gateway:"Comunicación entre sistemas y A2A",desc_fileManager:"Leer, escribir y gestionar archivos",desc_cron:"Programar tareas recurrentes",desc_messages:"Enviar y recibir mensajes entre agentes",cat_knowledgeBase:"Base de conocimientos",cat_personalOrg:"Organización personal",mem_browse:"Explorar recuerdos",mem_search:"Buscar en memoria",mem_add:"Agregar recuerdo",mem_contacts:"Contactos",mem_calendar:"Calendario",desc_memBrowse:"Ver todas las entradas de conocimiento almacenadas",desc_memSearch:"Búsqueda semántica en tu base de conocimientos",desc_memAdd:"Almacenar nuevos hechos y conocimientos",desc_contacts:"Gestionar personas y organizaciones",desc_calendar:"Programar y gestionar eventos",cat_pluginManager:"Gestor de plugins",cat_developer:"Desarrollador",plug_marketplace:"Mercado",plug_installed:"Instalados",plug_mcp:"Servidores MCP",plug_bundleMcp:"Bundle MCP",plug_cliCmds:"Comandos CLI",desc_marketplace:"Descubrir plugins en ClawHub",desc_installed:"Gestionar y configurar plugins instalados",desc_mcp:"Integraciones del Protocolo de Contexto de Modelo",desc_bundleMcp:"Empaquetar y desplegar bundles de herramientas MCP",desc_cliCmds:"Registro de comandos slash personalizados",cat_automation:"Automatización",cat_advanced:"Avanzado",wf_automations:"Automatizaciones",wf_scheduled:"Tareas programadas",wf_commands:"Comandos",wf_nodes:"Flujo de nodos",wf_multiAgent:"Multi-Agente",desc_automations:"Crear y ejecutar flujos de trabajo automatizados",desc_scheduled:"Gestionar todos los programas cron",desc_commands:"Comandos slash personalizados",desc_nodes:"Pipelines visuales en grafo de nodos",desc_multiAgent:"Orquestar la colaboración entre agentes"},systemHealth:{lite:"LITE",safe:"SAFE",critical:"Critical",warning:"Warning",info:"Info",title:"System Health",kinds:{cpu:"CPU",ram:"RAM",memory:"Memory",storage:"Storage",network:"Network",process:"Process",battery:"Battery",thermal:"Thermal",disk:"Disk"},moreModels:"More Models / API Settings"},panels:{memory:{title:"Perspectivas de memoria",indexLabel:"Índice:",clearIndex:"Limpiar índice",searchPlaceholder:"Buscar en tu memoria…",searchHint:"Búsqueda por similitud semántica — presiona Enter o haz clic",emptyTitle:"Busca en tu memoria de IA",emptyNoResults:"No se encontraron recuerdos",emptyHint:"Escribe una frase para encontrar habilidades, conversaciones y archivos semánticamente similares.",emptyNoResultsHint:"Prueba una frase diferente o indexa más contenido usando los controles de arriba.",refreshStats:"Actualizar estadísticas",indexControls:"Controles de índice",vectors:"vectores",skills:"habilidades",files:"archivos",indexed:"Indexado",indexCleared:"Índice limpiado",opFailed:"Operación fallida",reqError:"Error de solicitud"},plugins:{title:"Arquitecto de plugins",newPlugin:"Nuevo plugin",buildTitle:"Crear nuevo plugin",namePlaceholder:"Nombre del plugin (ej. weather-monitor)",goalPlaceholder:"Objetivo (ej. consultar la API OpenWeather cada 5 min)",contextPlaceholder:"Contexto / notas opcionales",generatePlugin:"Generar plugin",emptyTitle:"No hay plugins instalados",emptyHint:"Haz clic en «Nuevo plugin» para generar tu primer plugin.",installed:"instalado",running:"EN EJECUCIÓN",stop:"Detener",run:"Ejecutar",opFailed:"Operación fallida",reqError:"Error de solicitud",buildFailed:"Error de compilación",refresh:"Actualizar"},skills:{title:"Biblioteca de habilidades",loading:"Cargando habilidades…",emptyTitle:"No hay habilidades guardadas aún",emptyHint:"Completa un flujo de trabajo en la pestaña Conversación, luego haz clic en",saveAsSkill:"Guardar como habilidad",emptyHint2:"para construir tu biblioteca.",runningStatus:"Ejecutando habilidad…",completedStatus:"Habilidad completada",failedStatus:"Fallo en la ejecución",never:"Nunca",deleteConfirm:"¿Eliminar?",yes:"Sí",no:"No",runBtn:"Ejecutar",runningBtn:"Ejecutando…",doneBtn:"Listo",lastRun:"última ejecución"},settings:{title:"Configuración",hardwareScore:"Puntuación de hardware",searchPlaceholder:"Buscar proveedores…",allProviders:"Todos",apiKey:"Clave API",baseUrl:"URL base",model:"Modelo",testConnection:"Probar conexión",save:"Guardar",testOk:"Conexión exitosa",testFail:"Conexión fallida",saved:"Guardado",saving:"Guardando…",testing:"Probando…",apiKeyWarning:"Clave API requerida — actualiza tu clave para continuar."}}},GC={welcome:{tagline:"あなたのAIブレイン",title:"Must-b",sleeping:"スリープ中...",waking:"起動中...",awake:"覚醒中...",wakeBtn:"Must-bを起動",wakeHint:"タップして続行",reconfigure:"再設定",footer:"© 2026 Must-b — Auto Step Platform"},sidebar:{newChat:"新しいチャット",recentChats:"最近のチャット",platform:"プラットフォーム",system:"システム",automations:"マイオートメーション",activeWorkflows:"アクティブなワークフロー",products:"スキル & プラグイン",clients:"クライアント管理",integrations:"インテグレーション",logs:"ログ・アクティビティ",settings:"設定",logout:"ログアウト",poweredBy:"提供:",deleteChat:"チャットを削除しますか?",deleteConfirm:"この操作は元に戻せません。",cancel:"キャンセル",delete:"削除"},rightPanel:{agentRole:"エージェントの役割",hardware:"ハードウェアスコア",model:"アクティブモデル",connected:"ゲートウェイ接続済み",rank:{master:"マスター",planner:"プランナー",worker:"ワーカー"}},workflow:{title:"アクティブなワークフロー",idle:"待機中 — タスクを待っています",goal:"目標",steps:{browse:"ブラウザを開いています",write:"ファイルを書き込んでいます",think:"考えています",exec:"コマンドを実行しています"}},dashboard:{placeholder:"Must-bにメッセージを送信...",thinking:"Must-bが考えています..."},layout:{chats:"チャット",system:"システム",openChats:"チャット履歴を開く",openSystem:"システムパネルを開く",closePanel:"パネルを閉じる"},chat:{inputPlaceholder:"Must-bに何でも聞いてください…",listening:"聞いています…",thoughtProcess:"思考プロセス",saveAsSkill:"スキルとして保存",skillSaved:"スキルがライブラリに保存されました!",saving:"保存中…",retry:"再試行",save:"保存",guidance:"ガイダンス",errorBoundary:"Chat rendering error — reloading…",disclaimer:"Must-b is a cognitive assistant; verify critical outputs for accuracy.",placeholder:"What do you want to know?",tools:"Tools",attachFile:"Attach file",startDictation:"Start voice dictation",stopDictation:"Stop dictation"},nav:{chat:"Chat",browser:"Browser",workflows:"Workflows",voice:"Voice",settings:"Settings",files:"Files",memory:"Memory",apiKeys:"API Keys",channels:"チャンネル"},voice:{title:"Must-b Voice Command",back:"Go Back",wakeHint:'Say "Hey Must-b" to get started.',tapHint:"Tap the microphone to begin.",heard:"I hear you…",listening:"Listening…",stopHint:"Click to stop",thinking:"Processing…",cmdHint:"Go ahead, I am listening…",speakingHint:"Must-b is speaking…"},dock:{chat:"チャット",files:"ファイル",browser:"ブラウザ",skills:"スキル",memory:"メモリ",plugins:"プラグイン",workflows:"ワークフロー",settings:"設定",system:"システム",close:"閉じる",cat_webTools:"ウェブツール",cat_fileMedia:"ファイル・メディア",cat_aiAgents:"AI・エージェント",cat_systemTools:"システムツール",skill_webSearch:"ウェブ検索",skill_webFetch:"ウェブ取得",skill_browserControl:"ブラウザ制御",skill_pdfReader:"PDFリーダー",skill_imageAnalysis:"画像分析",skill_imageGeneration:"画像生成",skill_tts:"テキスト読み上げ",skill_spawnAgent:"サブエージェント作成",skill_agentSessions:"エージェントセッション",skill_canvas:"キャンバス",skill_git:"Git操作",skill_gateway:"ゲートウェイ",skill_fileManager:"ファイルマネージャー",skill_cron:"Cronスケジューラー",skill_messages:"メッセージ",desc_webSearch:"リアルタイムウェブ検索(マルチプロバイダー)",desc_webFetch:"任意のURLをクリーンなテキストとして取得",desc_browserControl:"Playwrightによる完全なブラウザ自動化",desc_pdfReader:"PDFドキュメントの抽出と分析",desc_imageAnalysis:"画像の説明と分析",desc_imageGeneration:"AI生成画像の作成",desc_tts:"テキストを自然な音声に変換",desc_spawnAgent:"新しい自律エージェントセッションを起動",desc_agentSessions:"アクティブセッションの一覧と管理",desc_canvas:"ビジュアル描画・ホワイトボードワークスペース",desc_git:"コミット、ブランチ、差分、プッシュ/プル",desc_gateway:"システム間・A2A通信",desc_fileManager:"ファイルの読み取り、書き込み、管理",desc_cron:"定期タスクのスケジュール",desc_messages:"エージェント間メッセージの送受信",cat_knowledgeBase:"ナレッジベース",cat_personalOrg:"個人管理",mem_browse:"メモリを閲覧",mem_search:"メモリを検索",mem_add:"メモリを追加",mem_contacts:"連絡先",mem_calendar:"カレンダー",desc_memBrowse:"保存されたすべての知識エントリを表示",desc_memSearch:"ナレッジベース全体のセマンティック検索",desc_memAdd:"新しい事実と知識を保存",desc_contacts:"人物と組織の管理",desc_calendar:"イベントのスケジュールと管理",cat_pluginManager:"プラグインマネージャー",cat_developer:"開発者",plug_marketplace:"マーケットプレイス",plug_installed:"インストール済み",plug_mcp:"MCPサーバー",plug_bundleMcp:"MCPバンドル",plug_cliCmds:"CLIコマンド",desc_marketplace:"ClawHubでプラグインを探す",desc_installed:"インストール済みプラグインの管理と設定",desc_mcp:"モデルコンテキストプロトコル統合",desc_bundleMcp:"MCPツールバンドルのパッケージ化とデプロイ",desc_cliCmds:"カスタムスラッシュコマンドの登録",cat_automation:"自動化",cat_advanced:"高度な設定",wf_automations:"自動化",wf_scheduled:"スケジュールタスク",wf_commands:"コマンド",wf_nodes:"ノードワークフロー",wf_multiAgent:"マルチエージェント",desc_automations:"自動化されたワークフローの構築と実行",desc_scheduled:"すべてのCronスケジュールを管理",desc_commands:"カスタムスラッシュコマンド",desc_nodes:"ビジュアルノードグラフパイプライン",desc_multiAgent:"エージェント間の協調をオーケストレーション"},systemHealth:{lite:"LITE",safe:"SAFE",critical:"Critical",warning:"Warning",info:"Info",title:"System Health",kinds:{cpu:"CPU",ram:"RAM",memory:"Memory",storage:"Storage",network:"Network",process:"Process",battery:"Battery",thermal:"Thermal",disk:"Disk"},moreModels:"More Models / API Settings"},panels:{memory:{title:"メモリインサイト",indexLabel:"インデックス:",clearIndex:"インデックスをクリア",searchPlaceholder:"メモリを検索…",searchHint:"セマンティック類似性検索 — Enterキーを押すかクリック",emptyTitle:"AIメモリを検索",emptyNoResults:"メモリが見つかりません",emptyHint:"フレーズを入力して、意味的に類似したスキル、会話、ワークスペースファイルを見つけてください。",emptyNoResultsHint:"別のフレーズを試すか、上のコントロールを使ってより多くのコンテンツをインデックスしてください。",refreshStats:"統計を更新",indexControls:"インデックスコントロール",vectors:"ベクター",skills:"スキル",files:"ファイル",indexed:"インデックス済み",indexCleared:"インデックスをクリアしました",opFailed:"操作に失敗しました",reqError:"リクエストエラー"},plugins:{title:"プラグインアーキテクト",newPlugin:"新しいプラグイン",buildTitle:"新しいプラグインを作成",namePlaceholder:"プラグイン名(例:weather-monitor)",goalPlaceholder:"目標(例:5分ごとにOpenWeather APIをポーリング)",contextPlaceholder:"オプションのコンテキスト / メモ",generatePlugin:"プラグインを生成",emptyTitle:"プラグインがインストールされていません",emptyHint:"「新しいプラグイン」をクリックして最初のプラグインを生成してください。",installed:"インストール済み",running:"実行中",stop:"停止",run:"実行",opFailed:"操作に失敗しました",reqError:"リクエストエラー",buildFailed:"ビルド失敗",refresh:"更新"},skills:{title:"スキルライブラリ",loading:"スキルを読み込んでいます…",emptyTitle:"スキルがまだ保存されていません",emptyHint:"チャットタブでワークフローを完了したら、クリック",saveAsSkill:"スキルとして保存",emptyHint2:"してライブラリを構築してください。",runningStatus:"スキルを実行中…",completedStatus:"スキル完了",failedStatus:"スキルの実行に失敗しました",never:"なし",deleteConfirm:"削除しますか?",yes:"はい",no:"いいえ",runBtn:"実行",runningBtn:"実行中…",doneBtn:"完了",lastRun:"最終実行"},settings:{title:"設定",hardwareScore:"ハードウェアスコア",searchPlaceholder:"プロバイダーを検索…",allProviders:"すべて",apiKey:"APIキー",baseUrl:"ベースURL",model:"モデル",testConnection:"接続をテスト",save:"保存",testOk:"接続成功",testFail:"接続失敗",saved:"保存済み",saving:"保存中…",testing:"テスト中…",apiKeyWarning:"APIキーが必要です — 続行するにはキーを更新してください。"}}},qC={welcome:{tagline:"您的AI大脑",title:"Must-b",sleeping:"休眠中...",waking:"唤醒中...",awake:"正在觉醒...",wakeBtn:"唤醒 Must-b",wakeHint:"点击继续",reconfigure:"重新配置",footer:"© 2026 Must-b — Auto Step 平台"},sidebar:{newChat:"新建对话",recentChats:"最近对话",platform:"平台",system:"系统",automations:"我的自动化",activeWorkflows:"活跃工作流",products:"技能与插件",clients:"客户管理",integrations:"集成",logs:"日志与活动",settings:"设置",logout:"退出登录",poweredBy:"技术支持:",deleteChat:"删除对话?",deleteConfirm:"此操作无法撤销。",cancel:"取消",delete:"删除"},rightPanel:{agentRole:"代理角色",hardware:"硬件评分",model:"活跃模型",connected:"网关已连接",rank:{master:"主控",planner:"规划者",worker:"执行者"}},workflow:{title:"活跃工作流",idle:"空闲中 — 等待任务",goal:"目标",steps:{browse:"正在打开浏览器",write:"正在写入文件",think:"正在思考",exec:"正在执行命令"}},dashboard:{placeholder:"向 Must-b 发送消息...",thinking:"Must-b 正在思考..."},layout:{chats:"对话",system:"系统",openChats:"打开对话历史",openSystem:"打开系统面板",closePanel:"关闭面板"},chat:{inputPlaceholder:"向 Must-b 提问任何问题…",listening:"正在聆听…",thoughtProcess:"思考过程",saveAsSkill:"保存为技能",skillSaved:"技能已保存到您的库中!",saving:"保存中…",retry:"重试",save:"保存",guidance:"指导",errorBoundary:"Chat rendering error — reloading…",disclaimer:"Must-b is a cognitive assistant; verify critical outputs for accuracy.",placeholder:"What do you want to know?",tools:"Tools",attachFile:"Attach file",startDictation:"Start voice dictation",stopDictation:"Stop dictation"},nav:{chat:"Chat",browser:"Browser",workflows:"Workflows",voice:"Voice",settings:"Settings",files:"Files",memory:"Memory",apiKeys:"API Keys",channels:"频道"},voice:{title:"Must-b Voice Command",back:"Go Back",wakeHint:'Say "Hey Must-b" to get started.',tapHint:"Tap the microphone to begin.",heard:"I hear you…",listening:"Listening…",stopHint:"Click to stop",thinking:"Processing…",cmdHint:"Go ahead, I am listening…",speakingHint:"Must-b is speaking…"},dock:{chat:"对话",files:"文件",browser:"浏览器",skills:"技能",memory:"记忆",plugins:"插件",workflows:"工作流",settings:"设置",system:"系统",close:"关闭",cat_webTools:"网络工具",cat_fileMedia:"文件与媒体",cat_aiAgents:"AI与代理",cat_systemTools:"系统工具",skill_webSearch:"网络搜索",skill_webFetch:"网络获取",skill_browserControl:"浏览器控制",skill_pdfReader:"PDF阅读器",skill_imageAnalysis:"图像分析",skill_imageGeneration:"图像生成",skill_tts:"文字转语音",skill_spawnAgent:"创建子代理",skill_agentSessions:"代理会话",skill_canvas:"画布",skill_git:"Git操作",skill_gateway:"网关",skill_fileManager:"文件管理器",skill_cron:"Cron调度器",skill_messages:"消息",desc_webSearch:"实时网络搜索(多供应商)",desc_webFetch:"将任意URL获取为纯文本",desc_browserControl:"完整的Playwright浏览器自动化",desc_pdfReader:"提取和分析PDF文档",desc_imageAnalysis:"描述和分析图像",desc_imageGeneration:"创建AI生成的图像",desc_tts:"将文本转换为自然语音",desc_spawnAgent:"启动新的自主代理会话",desc_agentSessions:"列出并管理活跃会话",desc_canvas:"可视化绘图与白板工作区",desc_git:"提交、分支、差异、推送/拉取",desc_gateway:"系统间与A2A通信",desc_fileManager:"读取、写入和管理文件",desc_cron:"调度定期任务",desc_messages:"发送和接收代理间消息",cat_knowledgeBase:"知识库",cat_personalOrg:"个人组织",mem_browse:"浏览记忆",mem_search:"搜索记忆",mem_add:"添加记忆",mem_contacts:"联系人",mem_calendar:"日历",desc_memBrowse:"查看所有存储的知识条目",desc_memSearch:"在知识库中进行语义搜索",desc_memAdd:"存储新的事实和知识",desc_contacts:"管理人员和组织",desc_calendar:"安排和管理事件",cat_pluginManager:"插件管理器",cat_developer:"开发者",plug_marketplace:"市场",plug_installed:"已安装",plug_mcp:"MCP服务器",plug_bundleMcp:"MCP捆绑包",plug_cliCmds:"CLI命令",desc_marketplace:"在ClawHub上发现插件",desc_installed:"管理和配置已安装的插件",desc_mcp:"模型上下文协议集成",desc_bundleMcp:"打包和部署MCP工具捆绑包",desc_cliCmds:"自定义斜杠命令注册",cat_automation:"自动化",cat_advanced:"高级",wf_automations:"自动化",wf_scheduled:"计划任务",wf_commands:"命令",wf_nodes:"节点工作流",wf_multiAgent:"多代理",desc_automations:"构建和运行自动化工作流",desc_scheduled:"管理所有Cron计划",desc_commands:"自定义斜杠命令",desc_nodes:"可视化节点图管道",desc_multiAgent:"协调代理间协作"},systemHealth:{lite:"LITE",safe:"SAFE",critical:"Critical",warning:"Warning",info:"Info",title:"System Health",kinds:{cpu:"CPU",ram:"RAM",memory:"Memory",storage:"Storage",network:"Network",process:"Process",battery:"Battery",thermal:"Thermal",disk:"Disk"},moreModels:"More Models / API Settings"},panels:{memory:{title:"记忆洞察",indexLabel:"索引:",clearIndex:"清除索引",searchPlaceholder:"搜索您的记忆…",searchHint:"语义相似性搜索 — 按回车键或点击",emptyTitle:"搜索您的AI记忆",emptyNoResults:"未找到记忆",emptyHint:"输入短语以查找语义相似的技能、对话和工作区文件。",emptyNoResultsHint:"尝试不同的短语,或使用上方控件索引更多内容。",refreshStats:"刷新统计",indexControls:"索引控件",vectors:"向量",skills:"技能",files:"文件",indexed:"已索引",indexCleared:"索引已清除",opFailed:"操作失败",reqError:"请求错误"},plugins:{title:"插件架构师",newPlugin:"新建插件",buildTitle:"创建新插件",namePlaceholder:"插件名称(例:weather-monitor)",goalPlaceholder:"目标(例:每5分钟轮询OpenWeather API)",contextPlaceholder:"可选上下文 / 备注",generatePlugin:"生成插件",emptyTitle:"未安装任何插件",emptyHint:"点击「新建插件」生成您的第一个插件。",installed:"已安装",running:"运行中",stop:"停止",run:"运行",opFailed:"操作失败",reqError:"请求错误",buildFailed:"构建失败",refresh:"刷新"},skills:{title:"技能库",loading:"正在加载技能…",emptyTitle:"尚未保存任何技能",emptyHint:"在对话标签中完成工作流,然后点击",saveAsSkill:"保存为技能",emptyHint2:"来构建您的技能库。",runningStatus:"正在运行技能…",completedStatus:"技能已完成",failedStatus:"技能运行失败",never:"从未",deleteConfirm:"删除?",yes:"是",no:"否",runBtn:"运行",runningBtn:"运行中…",doneBtn:"完成",lastRun:"上次运行"},settings:{title:"设置",hardwareScore:"硬件评分",searchPlaceholder:"搜索供应商…",allProviders:"全部",apiKey:"API密钥",baseUrl:"基础URL",model:"模型",testConnection:"测试连接",save:"保存",testOk:"连接成功",testFail:"连接失败",saved:"已保存",saving:"保存中…",testing:"测试中…",apiKeyWarning:"需要API密钥 — 请更新您的密钥以继续。"}}},YC={welcome:{tagline:"Seu cérebro de IA",title:"Must-b",sleeping:"Dormindo...",waking:"Acordando...",awake:"Despertando...",wakeBtn:"Acordar Must-b",wakeHint:"Toque para continuar",reconfigure:"Reconfigurar",footer:"© 2026 Must-b — Plataforma Auto Step"},sidebar:{newChat:"Nova conversa",recentChats:"Conversas recentes",platform:"Plataforma",system:"Sistema",automations:"Minhas automações",activeWorkflows:"Fluxos de trabalho ativos",products:"Skills & Plugins",clients:"Gestão de clientes",integrations:"Integrações",logs:"Registros e atividade",settings:"Configurações",logout:"Sair",poweredBy:"Desenvolvido por",deleteChat:"Excluir conversa?",deleteConfirm:"Esta ação não pode ser desfeita.",cancel:"Cancelar",delete:"Excluir"},rightPanel:{agentRole:"Função do agente",hardware:"Pontuação de hardware",model:"Modelo ativo",connected:"Gateway conectado",rank:{master:"Mestre",planner:"Planejador",worker:"Trabalhador"}},workflow:{title:"Fluxo de trabalho ativo",idle:"Ocioso — aguardando tarefa",goal:"Objetivo",steps:{browse:"Abrindo navegador",write:"Escrevendo arquivo",think:"Pensando",exec:"Executando comando"}},dashboard:{placeholder:"Envie uma mensagem para Must-b...",thinking:"Must-b está pensando..."},layout:{chats:"Conversas",system:"Sistema",openChats:"Abrir histórico de conversas",openSystem:"Abrir painel do sistema",closePanel:"Fechar painel"},chat:{inputPlaceholder:"Pergunte qualquer coisa ao Must-b…",listening:"Ouvindo…",thoughtProcess:"Processo de pensamento",saveAsSkill:"Salvar como habilidade",skillSaved:"Habilidade salva na sua biblioteca!",saving:"Salvando…",retry:"Tentar novamente",save:"Salvar",guidance:"Orientação",errorBoundary:"Chat rendering error — reloading…",disclaimer:"Must-b is a cognitive assistant; verify critical outputs for accuracy.",placeholder:"What do you want to know?",tools:"Tools",attachFile:"Attach file",startDictation:"Start voice dictation",stopDictation:"Stop dictation"},nav:{chat:"Chat",browser:"Browser",workflows:"Workflows",voice:"Voice",settings:"Settings",files:"Files",memory:"Memory",apiKeys:"API Keys",channels:"Canais"},voice:{title:"Must-b Voice Command",back:"Go Back",wakeHint:'Say "Hey Must-b" to get started.',tapHint:"Tap the microphone to begin.",heard:"I hear you…",listening:"Listening…",stopHint:"Click to stop",thinking:"Processing…",cmdHint:"Go ahead, I am listening…",speakingHint:"Must-b is speaking…"},dock:{chat:"Conversa",files:"Arquivos",browser:"Navegador",skills:"Habilidades",memory:"Memória",plugins:"Plugins",workflows:"Fluxos de trabalho",settings:"Configurações",system:"Sistema",close:"Fechar",cat_webTools:"Ferramentas web",cat_fileMedia:"Arquivos e mídia",cat_aiAgents:"IA e agentes",cat_systemTools:"Ferramentas do sistema",skill_webSearch:"Pesquisa web",skill_webFetch:"Busca web",skill_browserControl:"Controle do navegador",skill_pdfReader:"Leitor de PDF",skill_imageAnalysis:"Análise de imagem",skill_imageGeneration:"Geração de imagens",skill_tts:"Texto para fala",skill_spawnAgent:"Criar subagente",skill_agentSessions:"Sessões de agentes",skill_canvas:"Canvas",skill_git:"Operações Git",skill_gateway:"Gateway",skill_fileManager:"Gerenciador de arquivos",skill_cron:"Agendador Cron",skill_messages:"Mensagens",desc_webSearch:"Pesquisa web em tempo real (multi-provedor)",desc_webFetch:"Buscar qualquer URL como texto limpo",desc_browserControl:"Automação completa do navegador com Playwright",desc_pdfReader:"Extrair e analisar documentos PDF",desc_imageAnalysis:"Descrever e analisar imagens",desc_imageGeneration:"Criar imagens geradas por IA",desc_tts:"Converter texto em fala natural",desc_spawnAgent:"Iniciar uma nova sessão de agente autônomo",desc_agentSessions:"Listar e gerenciar sessões ativas",desc_canvas:"Espaço de desenho visual e quadro branco",desc_git:"Commit, branch, diff, push/pull",desc_gateway:"Comunicação entre sistemas e A2A",desc_fileManager:"Ler, escrever e gerenciar arquivos",desc_cron:"Agendar tarefas recorrentes",desc_messages:"Enviar e receber mensagens entre agentes",cat_knowledgeBase:"Base de conhecimento",cat_personalOrg:"Organização pessoal",mem_browse:"Explorar memórias",mem_search:"Pesquisar memória",mem_add:"Adicionar memória",mem_contacts:"Contatos",mem_calendar:"Calendário",desc_memBrowse:"Ver todas as entradas de conhecimento armazenadas",desc_memSearch:"Pesquisa semântica na sua base de conhecimento",desc_memAdd:"Armazenar novos fatos e conhecimentos",desc_contacts:"Gerenciar pessoas e organizações",desc_calendar:"Agendar e gerenciar eventos",cat_pluginManager:"Gerenciador de plugins",cat_developer:"Desenvolvedor",plug_marketplace:"Marketplace",plug_installed:"Instalados",plug_mcp:"Servidores MCP",plug_bundleMcp:"Bundle MCP",plug_cliCmds:"Comandos CLI",desc_marketplace:"Descobrir plugins no ClawHub",desc_installed:"Gerenciar e configurar plugins instalados",desc_mcp:"Integrações do Protocolo de Contexto de Modelo",desc_bundleMcp:"Empacotar e implantar bundles de ferramentas MCP",desc_cliCmds:"Registro de comandos slash personalizados",cat_automation:"Automação",cat_advanced:"Avançado",wf_automations:"Automações",wf_scheduled:"Tarefas agendadas",wf_commands:"Comandos",wf_nodes:"Fluxo de nós",wf_multiAgent:"Multi-Agente",desc_automations:"Criar e executar fluxos de trabalho automatizados",desc_scheduled:"Gerenciar todos os agendamentos cron",desc_commands:"Comandos slash personalizados",desc_nodes:"Pipelines visuais em grafo de nós",desc_multiAgent:"Orquestrar colaboração entre agentes"},systemHealth:{lite:"LITE",safe:"SAFE",critical:"Critical",warning:"Warning",info:"Info",title:"System Health",kinds:{cpu:"CPU",ram:"RAM",memory:"Memory",storage:"Storage",network:"Network",process:"Process",battery:"Battery",thermal:"Thermal",disk:"Disk"},moreModels:"More Models / API Settings"},panels:{memory:{title:"Insights de memória",indexLabel:"Índice:",clearIndex:"Limpar índice",searchPlaceholder:"Pesquisar na sua memória…",searchHint:"Pesquisa por similaridade semântica — pressione Enter ou clique",emptyTitle:"Pesquise na sua memória de IA",emptyNoResults:"Nenhuma memória encontrada",emptyHint:"Digite uma frase para encontrar habilidades, conversas e arquivos semanticamente similares.",emptyNoResultsHint:"Tente uma frase diferente ou indexe mais conteúdo usando os controles acima.",refreshStats:"Atualizar estatísticas",indexControls:"Controles de índice",vectors:"vetores",skills:"habilidades",files:"arquivos",indexed:"Indexado",indexCleared:"Índice limpo",opFailed:"Operação falhou",reqError:"Erro de requisição"},plugins:{title:"Arquiteto de plugins",newPlugin:"Novo plugin",buildTitle:"Criar novo plugin",namePlaceholder:"Nome do plugin (ex.: weather-monitor)",goalPlaceholder:"Objetivo (ex.: consultar a API OpenWeather a cada 5 min)",contextPlaceholder:"Contexto / notas opcionais",generatePlugin:"Gerar plugin",emptyTitle:"Nenhum plugin instalado",emptyHint:"Clique em «Novo plugin» para gerar seu primeiro plugin.",installed:"instalado",running:"EM EXECUÇÃO",stop:"Parar",run:"Executar",opFailed:"Operação falhou",reqError:"Erro de requisição",buildFailed:"Falha na compilação",refresh:"Atualizar"},skills:{title:"Biblioteca de habilidades",loading:"Carregando habilidades…",emptyTitle:"Nenhuma habilidade salva ainda",emptyHint:"Conclua um fluxo de trabalho na aba Conversa, depois clique em",saveAsSkill:"Salvar como habilidade",emptyHint2:"para construir sua biblioteca.",runningStatus:"Executando habilidade…",completedStatus:"Habilidade concluída",failedStatus:"Falha na execução",never:"Nunca",deleteConfirm:"Excluir?",yes:"Sim",no:"Não",runBtn:"Executar",runningBtn:"Executando…",doneBtn:"Concluído",lastRun:"última execução"},settings:{title:"Configurações",hardwareScore:"Pontuação de hardware",searchPlaceholder:"Pesquisar provedores…",allProviders:"Todos",apiKey:"Chave API",baseUrl:"URL base",model:"Modelo",testConnection:"Testar conexão",save:"Salvar",testOk:"Conexão bem-sucedida",testFail:"Falha na conexão",saved:"Salvo",saving:"Salvando…",testing:"Testando…",apiKeyWarning:"Chave API necessária — atualize sua chave para continuar."}}},Mc={en:xv,tr:UC,de:HC,fr:WC,es:KC,ja:GC,zh:qC,pt:YC},yv=h.createContext({locale:"en",t:xv,setLocale:()=>{}});function XC({children:e}){const t=typeof localStorage<"u"?localStorage.getItem("mustb-lang"):null,[n,s]=h.useState(t&&t in Mc?t:"en"),i=a=>{s(a);try{localStorage.setItem("mustb-lang",a)}catch{}fetch("/api/settings/language",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({language:a})}).catch(()=>{})};return h.useEffect(()=>{fetch("/api/setup/status").then(a=>a.ok?a.json():null).then(a=>{if(!(a!=null&&a.activeLanguage))return;const o=a.activeLanguage;if(o in Mc&&o!==n){s(o);try{localStorage.setItem("mustb-lang",o)}catch{}}}).catch(()=>{})},[]),r.jsx(yv.Provider,{value:{locale:n,t:Mc[n],setLocale:i},children:e})}const pt=()=>h.useContext(yv);function c0(){const e=mn(),{t}=pt(),[n,s]=h.useState("sleeping"),i=async()=>{if(n==="sleeping"){s("exiting");try{const a=await fetch("/api/setup/status");if(a.ok&&!(await a.json()).configured){e("/setup",{replace:!0});return}await fetch("/api/auth/local").catch(()=>{})}catch{}setTimeout(()=>e("/app/chat",{replace:!0}),450)}};return r.jsxs("div",{className:"relative min-h-screen overflow-hidden flex flex-col",children:[r.jsx(se,{children:n==="sleeping"&&r.jsxs(H.div,{className:"fixed inset-0 z-40 flex flex-col items-center justify-center",initial:{opacity:1},exit:{opacity:0,filter:"blur(24px)"},transition:{duration:.65,ease:"easeInOut"},children:[r.jsx("div",{className:"absolute inset-0 bg-cover bg-center bg-no-repeat",style:{backgroundImage:"url(/avatar/sleep.png)"}}),r.jsx("div",{className:"absolute inset-0 bg-black/55"}),r.jsxs("div",{className:"relative z-10 flex flex-col items-center gap-8 px-6",children:[r.jsxs("div",{className:"flex flex-col items-center gap-2",children:[r.jsx(H.div,{animate:{opacity:[.5,1,.5]},transition:{duration:3,repeat:1/0,ease:"easeInOut"},children:r.jsx(Rl,{size:20,className:"text-orange-400/70"})}),r.jsx("span",{className:"text-white/30 text-sm font-semibold tracking-widest uppercase select-none",children:"Must-b"})]}),r.jsxs(H.button,{onClick:i,disabled:n==="exiting",className:`group relative flex items-center gap-3 px-8 py-4 rounded-2xl
717
717
  bg-orange-500/15 border border-orange-500/35 text-orange-300
718
718
  backdrop-blur-md hover:bg-orange-500/25 hover:border-orange-500/60
719
- transition-all duration-300 disabled:opacity-50 select-none`,animate:{y:[0,-6,0]},transition:{duration:4,repeat:1/0,ease:"easeInOut"},whileHover:{scale:1.04},whileTap:{scale:.97},children:[r.jsx("span",{className:"text-[15px] font-bold tracking-wider",children:t.welcome.wakeBtn}),r.jsx("div",{className:"w-8 h-8 rounded-full bg-orange-500/20 border border-orange-500/40 flex items-center justify-center",children:r.jsx(tC,{size:14,className:"text-orange-400"})})]}),r.jsx("p",{className:"text-white/20 text-[11px] tracking-widest uppercase select-none",children:t.welcome.wakeHint})]})]},"sleep-screen")}),r.jsx(se,{children:n==="exiting"&&r.jsx(H.div,{className:"fixed inset-0 z-50 pointer-events-none",style:{background:"linear-gradient(180deg, #1a0802 0%, #f97316 40%, #0d0602 100%)"},initial:{opacity:0},animate:{opacity:1},transition:{duration:.45}})})]})}function vv(e){var t,n,s="";if(typeof e=="string"||typeof e=="number")s+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=vv(e[t]))&&(s&&(s+=" "),s+=n)}else for(n in e)e[n]&&(s&&(s+=" "),s+=n);return s}function Xe(){for(var e,t,n=0,s="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=vv(e))&&(s&&(s+=" "),s+=t);return s}const QC={frontier:"⚡ Frontier",gateway:"🌐 Gateway",fast:"🚀 Fast Inference",local:"💻 Local / Offline",open:"🔓 Open Source Cloud",specialist:"🎯 Specialist",regional:"🌏 Regional",enterprise:"🏢 Enterprise",custom:"⚙️ Custom"},JC=["frontier","gateway","fast","local","open","specialist","regional","enterprise","custom"],u0=[{value:"en-US",label:"English (US)"},{value:"tr-TR",label:"Türkçe"},{value:"de-DE",label:"Deutsch"},{value:"es-ES",label:"Español"},{value:"fr-FR",label:"Français"},{value:"zh-CN",label:"中文 (简体)"},{value:"ja-JP",label:"日本語"},{value:"ar-SA",label:"العربية"}],bo=["Identity","AI Engine","Workspace","Voice","Channels","Finalize"],Rc=[{id:"meta-llama/llama-4-scout:free",label:"Llama 4 Scout (Free)",desc:"Meta's latest · 10M ctx · fast & free",free:!0},{id:"nvidia/llama-3.1-nemotron-ultra-253b:free",label:"Nemotron Ultra 253B (Free)",desc:"NVIDIA's flagship open-source model — highly capable",free:!0},{id:"meta-llama/llama-4-maverick:free",label:"Llama 4 Maverick (Free)",desc:"Meta's latest Llama 4 release — free tier",free:!0},{id:"mistralai/mistral-small-3.1-24b-instruct:free",label:"Mistral Small 3.1 (Free)",desc:"Mistral's efficient 24B instruction model",free:!0},{id:"deepseek/deepseek-r1:free",label:"DeepSeek R1 (Free)",desc:"Strong reasoning model — open weights",free:!0},{id:"openai/gpt-4o-mini",label:"GPT-4o Mini",desc:"OpenAI's fast & affordable flagship mini",free:!1},{id:"anthropic/claude-3-5-haiku",label:"Claude 3.5 Haiku",desc:"Anthropic's fastest Claude model",free:!1},{id:"google/gemini-flash-1.5",label:"Gemini Flash 1.5",desc:"Google's ultra-fast flash model",free:!1}],d0=[{id:"telegram",label:"Telegram",emoji:"✈️",hint:"Create a bot at t.me/BotFather",fields:[{key:"TELEGRAM_BOT_TOKEN",label:"Bot Token",placeholder:"123456789:AAF...",secret:!0}]},{id:"discord",label:"Discord",emoji:"🎮",hint:"discord.com/developers → Applications",fields:[{key:"DISCORD_BOT_TOKEN",label:"Bot Token",placeholder:"MT…",secret:!0},{key:"DISCORD_CLIENT_ID",label:"Client ID",placeholder:"012…",secret:!1}]},{id:"slack",label:"Slack",emoji:"💬",hint:"api.slack.com/apps → OAuth & Permissions",fields:[{key:"SLACK_BOT_TOKEN",label:"Bot Token",placeholder:"xoxb-…",secret:!0},{key:"SLACK_SIGNING_SECRET",label:"Signing Secret",placeholder:"abc123…",secret:!0}]},{id:"whatsapp",label:"WhatsApp",emoji:"📱",hint:"developers.facebook.com → WhatsApp",fields:[{key:"WHATSAPP_API_KEY",label:"API Token",placeholder:"EAA…",secret:!0},{key:"WHATSAPP_PHONE_ID",label:"Phone ID",placeholder:"1234567890",secret:!1}]}];function ZC({index:e,current:t}){const n=e<t,s=e===t;return r.jsxs("div",{className:"flex items-center",children:[r.jsx("div",{className:Xe("w-8 h-8 rounded-full flex items-center justify-center text-xs font-bold transition-all duration-300",n?"bg-orange-500 text-white":s?"bg-orange-500/20 border-2 border-orange-500 text-orange-400":"bg-white/5 border border-white/10 text-gray-400"),children:n?r.jsx(zt,{size:13}):e+1}),e<bo.length-1&&r.jsx("div",{className:Xe("w-8 h-px transition-colors duration-300",n?"bg-orange-500/50":"bg-white/10")})]})}function e3({label:e}){return r.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-bold bg-white/5 text-gray-400 border border-white/8",children:e})}function t3({fit:e}){return e==="recommended"?r.jsxs("span",{className:"flex items-center gap-1 text-[10px] font-bold text-green-400 bg-green-500/10 border border-green-500/20 px-1.5 py-0.5 rounded",children:[r.jsx(zt,{size:9})," Recommended"]}):e==="marginal"?r.jsxs("span",{className:"flex items-center gap-1 text-[10px] font-bold text-orange-400 bg-orange-500/10 border border-orange-500/20 px-1.5 py-0.5 rounded",children:[r.jsx(ze,{size:9})," Marginal"]}):r.jsxs("span",{className:"flex items-center gap-1 text-[10px] font-bold text-red-400 bg-red-500/10 border border-red-500/20 px-1.5 py-0.5 rounded",children:[r.jsx(os,{size:9})," Heavy"]})}function h0({checked:e,onChange:t,label:n,description:s}){return r.jsxs("button",{type:"button",onClick:()=>t(!e),className:Xe("w-full flex items-center gap-4 px-4 py-4 rounded-xl border transition-all text-left",e?"bg-orange-500/10 border-orange-500/30 text-white":"bg-white/3 border-white/8 text-gray-400 hover:border-white/20 hover:text-white"),children:[r.jsx("div",{className:Xe("relative flex-shrink-0 w-11 h-6 rounded-full transition-colors duration-200",e?"bg-orange-500":"bg-white/15"),children:r.jsx("div",{className:Xe("absolute top-1 w-4 h-4 rounded-full bg-white shadow transition-all duration-200",e?"left-6":"left-1")})}),r.jsxs("div",{children:[r.jsx("p",{className:"font-semibold text-sm",children:n}),s&&r.jsx("p",{className:"text-xs text-gray-400 mt-0.5",children:s})]})]})}function n3(){var Qr,Zt;mn();const[e,t]=h.useState([]),[n,s]=h.useState([]),[i,a]=h.useState(null),[o,l]=h.useState(!0),[c,u]=h.useState("~/Mustb-Projects"),[d,p]=h.useState(0),[f,m]=h.useState(""),[b,y]=h.useState("en-US"),[v,g]=h.useState("openrouter"),[x,w]=h.useState(""),[j,k]=h.useState(""),[N,S]=h.useState(Rc[0].id),[E,P]=h.useState(Rc),[M,T]=h.useState(!1),[V,R]=h.useState("http://localhost:11434"),[I,L]=h.useState(""),[z,B]=h.useState(""),[C,A]=h.useState(!1),[_,U]=h.useState(!1),[K,Y]=h.useState({}),[J,le]=h.useState({}),[oe,re]=h.useState({}),[De,ot]=h.useState("idle"),[G,Q]=h.useState(!1),[Lt,Xr]=h.useState(null);h.useEffect(()=>{fetch("/api/setup/providers").then(O=>O.ok?O.json():{providers:[]}).then(O=>{var ee;(ee=O.providers)!=null&&ee.length&&t(O.providers)}).catch(()=>{}).finally(()=>l(!1)),fetch("/api/setup/workspace-default").then(O=>O.ok?O.json():null).then(O=>{O!=null&&O.suggested&&(u(O.suggested),B(O.suggested))}).catch(()=>{})},[]),h.useEffect(()=>{v==="openrouter"&&(T(!0),fetch("/api/openrouter/free-models").then(O=>O.ok?O.json():null).then(O=>{if(O!=null&&O.models&&O.models.length>0){const ee=O.models.slice(0,16).map(Ie=>({id:Ie.id,label:Ie.label??Ie.name??Ie.id,desc:Ie.desc??Ie.description??"",free:Ie.id.endsWith(":free")})),Z=new Set(ee.map(Ie=>Ie.id)),_e=Rc.filter(Ie=>!Z.has(Ie.id));P([...ee,..._e])}}).catch(()=>{}).finally(()=>T(!1)))},[v]),h.useEffect(()=>{v==="ollama"&&fetch("/api/setup/ollama-models").then(O=>O.ok?O.json():null).then(O=>{O!=null&&O.models&&s(O.models),O!=null&&O.hardware&&a(O.hardware)}).catch(()=>{})},[v]);const Ks=v==="ollama",tt=e.find(O=>O.id===v),Gs=h.useMemo(()=>{const O=x.toLowerCase().trim();return O?e.filter(ee=>ee.label.toLowerCase().includes(O)||ee.description.toLowerCase().includes(O)||ee.tags.some(Z=>Z.toLowerCase().includes(O))):e},[e,x]),Vl=h.useMemo(()=>{const O={};for(const ee of Gs)O[ee.category]||(O[ee.category]=[]),O[ee.category].push(ee);return O},[Gs]),qs=()=>{switch(d){case 0:return f.trim().length>0;case 1:{if(Ks){const O=n.length===0||I.trim().length>0;return V.trim().length>0&&O}return v==="openrouter"?j.trim().length>0&&N.trim().length>0:tt!=null&&tt.envKeyIsUrl?!0:j.trim().length>0}case 2:return z.trim().length>0;default:return!0}},$l=async()=>{ot("testing");try{(await navigator.mediaDevices.getUserMedia({audio:!0})).getTracks().forEach(ee=>ee.stop()),ot("granted")}catch{ot("denied")}},wa=async O=>{re(ee=>({...ee,[O]:"testing"}));try{const Z=await(await fetch(`/api/channels/${O}/status`)).json().catch(()=>({}));re(_e=>({..._e,[O]:Z.configured?"ok":"fail"}))}catch{re(ee=>({...ee,[O]:"fail"}))}},ms=async()=>{Q(!0),Xr(null);try{const O={};for(const _e of d0)if(K[_e.id]){for(const Ie of _e.fields){const ka=(J[Ie.key]??"").trim();ka&&(O[Ie.key]=ka)}O[`CHANNEL_${_e.id.toUpperCase()}_ENABLED`]="true"}const ee={name:f.trim()||"User",language:b,provider:v,apiKey:Ks?V:j,model:Ks?I:v==="openrouter"?N:tt==null?void 0:tt.defaultModel,skills:["browser","terminal","memory","web_search","filesystem","git","vision","input","telegram","analyzer"],mode:"local",workspacePath:z.trim()||c,wakeWord:C,telemetry:_,channels:O};let Z=await fetch("/api/setup/save",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(ee)});if(!Z.ok&&Z.status===404&&(Z=await fetch("/api/setup",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(ee)})),!Z.ok){const _e=await Z.json().catch(()=>({}));throw new Error(_e.error??"Setup failed")}localStorage.setItem("mustb_boot_report","1"),localStorage.setItem("mustb_setup_complete","1"),window.location.href="/app"}catch(O){Xr(O instanceof Error?O.message:"Unknown error"),Q(!1)}};return r.jsxs("div",{className:"min-h-screen bg-[#02040a] flex flex-col items-center justify-center px-4 py-12 relative overflow-hidden",children:[r.jsx("div",{className:"absolute inset-0 pointer-events-none",children:r.jsx("div",{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[600px] h-[600px] bg-orange-900/12 rounded-full blur-[120px]"})}),r.jsxs("div",{className:"relative z-10 w-full max-w-xl",children:[r.jsxs("div",{className:"text-center mb-8",children:[r.jsx("div",{className:"flex justify-center mb-4",children:r.jsxs("div",{className:"relative w-14 h-14",children:[r.jsx("div",{className:"absolute inset-0 bg-orange-500 rounded-full blur-lg opacity-40 animate-pulse"}),r.jsx("img",{src:"/logo.png",alt:"Must-b",className:"w-full h-full object-contain relative z-10"})]})}),r.jsx("h1",{className:"text-3xl font-extrabold text-white tracking-tight",children:"Setup Must-b"}),r.jsx("p",{className:"text-gray-400 mt-1.5 text-sm",children:"First-time configuration · 6 steps"})]}),r.jsx("div",{className:"flex justify-center items-center mb-6",children:bo.map((O,ee)=>r.jsxs("div",{className:"flex flex-col items-center gap-1",children:[r.jsx(ZC,{index:ee,current:d}),r.jsx("span",{className:Xe("text-[9px] font-bold uppercase tracking-widest transition-colors",ee===d?"text-orange-400":ee<d?"text-orange-500/50":"text-gray-700"),children:O})]},ee))}),r.jsx(se,{mode:"wait",children:r.jsxs(H.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},exit:{opacity:0,x:-20},transition:{duration:.18},className:"glass rounded-2xl p-6 border border-white/8",children:[r.jsxs("p",{className:"text-[10px] font-bold text-orange-500/60 uppercase tracking-widest mb-1",children:["Step ",d+1," of ",bo.length]}),r.jsx("h2",{className:"text-xl font-bold text-white mb-5",children:bo[d]}),d===0&&r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx("label",{className:"text-xs text-gray-400 uppercase tracking-widest font-bold",children:"Your name"}),r.jsx("input",{autoFocus:!0,type:"text",value:f,onChange:O=>m(O.target.value),onKeyDown:O=>O.key==="Enter"&&qs()&&p(1),placeholder:"e.g. Burak",className:"w-full bg-white/5 border border-white/10 rounded-xl px-4 py-3 text-white placeholder-gray-600 focus:outline-none focus:ring-1 focus:ring-orange-500/50 transition-all text-base"}),r.jsx("p",{className:"text-gray-400 text-xs",children:"Used in greetings and memory. Editable anytime in Settings."})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx("label",{className:"text-xs text-gray-400 uppercase tracking-widest font-bold",children:"Language"}),r.jsxs("div",{className:"relative",children:[r.jsx(We,{size:14,className:"absolute left-3.5 top-1/2 -translate-y-1/2 text-gray-400 pointer-events-none"}),r.jsx("select",{value:b,onChange:O=>y(O.target.value),className:"w-full bg-white/5 border border-white/10 rounded-xl pl-9 pr-4 py-3 text-white focus:outline-none focus:ring-1 focus:ring-orange-500/50 transition-all text-sm appearance-none cursor-pointer",children:u0.map(O=>r.jsx("option",{value:O.value,className:"bg-[#0d1117] text-white",children:O.label},O.value))}),r.jsx(dn,{size:13,className:"absolute right-3.5 top-1/2 -translate-y-1/2 text-gray-400 pointer-events-none rotate-90"})]})]})]}),d===1&&r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"relative",children:[r.jsx(Xt,{size:13,className:"absolute left-3 top-1/2 -translate-y-1/2 text-gray-400"}),r.jsx("input",{type:"text",value:x,onChange:O=>w(O.target.value),placeholder:"Search providers…",className:"w-full bg-white/5 border border-white/10 rounded-xl pl-9 pr-4 py-2.5 text-white placeholder-gray-600 focus:outline-none focus:ring-1 focus:ring-orange-500/50 text-sm"})]}),r.jsxs("div",{className:"max-h-[260px] overflow-y-auto space-y-4 pr-1 scrollbar-thin scrollbar-thumb-white/10 scrollbar-track-transparent",children:[o?r.jsx("p",{className:"text-center py-6 text-gray-400 text-sm",children:"Loading providers…"}):JC.map(O=>{const ee=Vl[O];return ee!=null&&ee.length?r.jsxs("div",{children:[r.jsx("p",{className:"text-[10px] font-bold text-gray-400 uppercase tracking-widest mb-1.5 px-1",children:QC[O]}),r.jsx("div",{className:"space-y-1",children:ee.map(Z=>r.jsxs("button",{onClick:()=>{g(Z.id),k("")},className:Xe("w-full flex items-center gap-3 px-3 py-2.5 rounded-xl border transition-all text-left",v===Z.id?"bg-orange-500/10 border-orange-500/40 text-white":"bg-white/3 border-white/8 text-gray-400 hover:border-white/20 hover:text-white"),children:[r.jsx("div",{className:Xe("w-3 h-3 rounded-full border-2 flex-shrink-0 transition-all",v===Z.id?"border-orange-500 bg-orange-500":"border-gray-600")}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("p",{className:"font-semibold text-sm leading-tight",children:Z.label}),r.jsx("p",{className:"text-xs text-gray-400 truncate",children:Z.description})]}),r.jsx("div",{className:"flex flex-wrap gap-1 justify-end flex-shrink-0 max-w-[120px]",children:Z.tags.slice(0,2).map(_e=>r.jsx(e3,{label:_e},_e))})]},Z.id))})]},O):null}),!o&&Gs.length===0&&r.jsxs("p",{className:"text-center py-6 text-gray-400 text-sm",children:['No providers match "',x,'"']})]}),Ks?r.jsxs("div",{className:"space-y-3 pt-1 border-t border-white/6",children:[r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("label",{className:"text-xs text-gray-400 uppercase tracking-widest font-bold",children:"Ollama Base URL"}),r.jsx("input",{type:"url",value:V,onChange:O=>R(O.target.value),placeholder:"http://localhost:11434",className:"w-full bg-white/5 border border-white/10 rounded-xl px-4 py-2.5 text-white placeholder-gray-600 focus:outline-none focus:ring-1 focus:ring-orange-500/50 font-mono text-sm"})]}),i&&r.jsxs("div",{className:"flex items-center gap-4 rounded-xl bg-white/3 border border-white/8 px-3 py-2 text-xs text-gray-400",children:[r.jsxs("span",{className:"flex items-center gap-1.5",children:[r.jsx(lv,{size:11,className:"text-orange-400"}),i.ramGb.toFixed(1)," GB RAM"]}),r.jsxs("span",{className:"flex items-center gap-1.5",children:[r.jsx(fn,{size:11,className:"text-orange-400"}),i.cpuCount," CPUs"]}),r.jsxs("span",{className:"flex items-center gap-1.5",children:[r.jsx(ze,{size:11,className:"text-orange-400"}),"Score ",i.score," · ",i.tier]})]}),n.length>0&&r.jsx("div",{className:"max-h-[180px] overflow-y-auto space-y-1.5 pr-1",children:n.map(O=>r.jsxs("button",{onClick:()=>L(O.modelId),className:Xe("w-full flex items-center gap-3 px-3 py-2.5 rounded-xl border transition-all text-left",I===O.modelId?"bg-orange-500/10 border-orange-500/40 text-white":"bg-white/3 border-white/8 text-gray-400 hover:border-white/20 hover:text-white"),children:[r.jsx("div",{className:Xe("w-3 h-3 rounded-full border-2 flex-shrink-0",I===O.modelId?"border-orange-500 bg-orange-500":"border-gray-600")}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("p",{className:"font-semibold text-sm",children:O.name}),r.jsx("span",{className:"text-[10px] text-gray-400 font-mono",children:O.params})]}),r.jsx("p",{className:"text-xs text-gray-400 truncate",children:O.description})]}),r.jsxs("div",{className:"flex flex-col items-end gap-1 flex-shrink-0",children:[r.jsx(t3,{fit:O.fit}),r.jsxs("span",{className:"text-[10px] text-gray-400",children:[O.ramGb," GB"]})]})]},O.id))})]}):tt?r.jsxs("div",{className:"space-y-2 pt-1 border-t border-white/6",children:[r.jsx("label",{className:"text-xs text-gray-400 uppercase tracking-widest font-bold",children:tt.envKeyIsUrl?"Base URL":`${tt.label} API Key`}),r.jsx("input",{type:tt.envKeyIsUrl?"url":"password",value:j,onChange:O=>k(O.target.value),placeholder:tt.placeholder,className:"w-full bg-white/5 border border-white/10 rounded-xl px-4 py-2.5 text-white placeholder-gray-600 focus:outline-none focus:ring-1 focus:ring-orange-500/50 font-mono text-sm"}),v==="openrouter"&&r.jsxs("div",{className:"space-y-2 pt-2",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("label",{className:"text-xs text-gray-400 uppercase tracking-widest font-bold flex-1",children:"Select Model"}),M&&r.jsx("span",{className:"text-[10px] text-orange-400/60 animate-pulse",children:"Loading live models…"}),r.jsx("span",{className:"text-[10px] text-green-500/60",children:"✓ Offline list always ready"})]}),r.jsx("div",{className:"max-h-[200px] overflow-y-auto space-y-1.5 pr-1",children:E.map(O=>r.jsxs("button",{type:"button",onClick:()=>S(O.id),className:Xe("w-full flex items-start gap-3 px-3 py-2.5 rounded-xl border transition-all text-left",N===O.id?"bg-orange-500/12 border-orange-500/40 text-white":"bg-white/3 border-white/8 text-gray-400 hover:border-white/20 hover:text-white"),children:[r.jsx("div",{className:Xe("w-3 h-3 rounded-full border-2 flex-shrink-0 mt-0.5",N===O.id?"border-orange-500 bg-orange-500":"border-gray-600")}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[r.jsx("p",{className:"font-semibold text-sm leading-tight",children:O.label}),O.free&&r.jsx("span",{className:"text-[9px] font-bold px-1.5 py-0.5 rounded bg-green-500/15 text-green-400 border border-green-500/20",children:"FREE"})]}),r.jsx("p",{className:"text-[11px] text-gray-500 truncate",children:O.desc})]})]},O.id))}),!N&&r.jsxs("p",{className:"text-xs text-orange-400 flex items-center gap-1.5",children:[r.jsx(os,{size:11})," Select a model to continue"]})]}),v!=="openrouter"&&tt.latestModels.length>0&&r.jsx("div",{className:"flex flex-wrap gap-1.5 pt-1",children:tt.latestModels.slice(0,4).map(O=>r.jsx("span",{className:"text-[11px] font-mono text-orange-400/60 bg-orange-500/5 border border-orange-500/10 px-2 py-0.5 rounded-lg",children:O},O))}),r.jsxs("p",{className:"text-gray-400 text-xs",children:["Stored locally in ",r.jsx("code",{className:"text-orange-500/60",children:".env"})," — never sent to external servers."]})]}):null]}),d===2&&r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx("label",{className:"text-xs text-gray-400 uppercase tracking-widest font-bold",children:"Workspace Directory"}),r.jsxs("div",{className:"relative",children:[r.jsx(uC,{size:13,className:"absolute left-3.5 top-1/2 -translate-y-1/2 text-gray-400 pointer-events-none"}),r.jsx("input",{autoFocus:!0,type:"text",value:z,onChange:O=>B(O.target.value),placeholder:c,className:"w-full bg-white/5 border border-white/10 rounded-xl pl-9 pr-4 py-3 text-white placeholder-gray-600 focus:outline-none focus:ring-1 focus:ring-orange-500/50 font-mono text-sm"})]}),r.jsxs("p",{className:"text-gray-400 text-xs",children:["Must-b will read and write files ",r.jsx("span",{className:"text-orange-500/70 font-medium",children:"only within this directory"}),". The folder will be created if it doesn't exist."]})]}),r.jsxs("div",{className:"flex items-start gap-3 rounded-xl bg-white/3 border border-white/8 px-4 py-3",children:[r.jsx(fv,{size:15,className:"text-green-400 flex-shrink-0 mt-0.5"}),r.jsx("p",{className:"text-xs text-gray-400 leading-relaxed",children:"Must-b operates in a sandboxed workspace. It cannot access files outside this directory unless you explicitly provide a path in a prompt."})]})]}),d===3&&r.jsxs("div",{className:"space-y-4",children:[r.jsx(h0,{checked:C,onChange:A,label:'Enable "Hey Must-b" Wake Word',description:"Always-on voice activation — must-b-ui listens passively via your microphone."}),r.jsx("div",{className:"rounded-xl bg-white/3 border border-white/8 px-4 py-4",children:r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-semibold text-white",children:"Test Microphone Permission"}),r.jsxs("p",{className:"text-xs text-gray-400 mt-0.5",children:[De==="idle"&&"Click to verify your browser can access the microphone.",De==="testing"&&"Requesting permission…",De==="granted"&&"Microphone access granted ✓",De==="denied"&&"Permission denied — check browser settings."]})]}),r.jsx("button",{onClick:$l,disabled:De==="testing",className:Xe("flex items-center gap-2 px-4 py-2 rounded-xl text-xs font-bold transition-all shrink-0",De==="granted"?"bg-green-500/10 border border-green-500/20 text-green-400 cursor-default":De==="denied"?"bg-red-500/10 border border-red-500/20 text-red-400":"bg-white/5 border border-white/10 text-gray-300 hover:border-white/25 hover:text-white"),children:De==="granted"?r.jsxs(r.Fragment,{children:[r.jsx(zt,{size:12})," Granted"]}):De==="denied"?r.jsxs(r.Fragment,{children:[r.jsx(nf,{size:12})," Denied"]}):r.jsxs(r.Fragment,{children:[r.jsx(Ds,{size:12})," Test"]})})]})}),r.jsx("p",{className:"text-gray-700 text-xs px-1",children:"Wake word and microphone can be reconfigured at any time in Settings → Voice."})]}),d===4&&r.jsxs("div",{className:"space-y-4",children:[r.jsx("p",{className:"text-[12px] text-gray-500",children:"Connect messaging channels so Must-b can send and receive messages on your behalf. All tokens are stored locally. You can skip and configure later in Settings."}),d0.map(O=>{const ee=!!K[O.id];return r.jsxs("div",{className:"rounded-xl border transition-all overflow-hidden",style:{borderColor:ee?"rgba(234,88,12,0.35)":"rgba(255,255,255,0.07)",background:ee?"rgba(234,88,12,0.06)":"rgba(255,255,255,0.02)"},children:[r.jsxs("div",{className:"flex items-center",children:[r.jsxs("button",{onClick:()=>Y(Z=>({...Z,[O.id]:!ee})),className:"flex-1 flex items-center justify-between px-4 py-3",children:[r.jsxs("span",{className:"flex items-center gap-2.5 text-[13px] font-semibold text-gray-200",children:[r.jsx("span",{className:"text-base",children:O.emoji}),O.label,r.jsx("span",{className:"text-[10px] text-gray-600 font-normal",children:O.hint}),oe[O.id]==="ok"&&r.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-green-400 flex-shrink-0"}),oe[O.id]==="fail"&&r.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-red-400 flex-shrink-0"}),oe[O.id]==="testing"&&r.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-yellow-400 animate-pulse flex-shrink-0"})]}),r.jsx("span",{className:"w-8 h-4 rounded-full relative transition-all flex-shrink-0",style:{background:ee?"#ea580c":"rgba(255,255,255,0.1)"},children:r.jsx("span",{className:"absolute top-0.5 w-3 h-3 bg-white rounded-full transition-all shadow-sm",style:{left:ee?"calc(100% - 14px)":"2px"}})})]}),ee&&O.fields.some(Z=>(J[Z.key]??"").trim())&&r.jsx("button",{onClick:Z=>{Z.stopPropagation(),wa(O.id)},disabled:oe[O.id]==="testing",className:"mr-3 px-2 py-1 rounded-lg text-[10px] font-semibold transition-all disabled:opacity-40",style:{background:"rgba(234,88,12,0.12)",border:"1px solid rgba(234,88,12,0.25)",color:"#fb923c"},children:oe[O.id]==="testing"?"…":"Test"})]}),ee&&r.jsx("div",{className:"px-4 pb-3 space-y-2 border-t",style:{borderColor:"rgba(234,88,12,0.15)"},children:O.fields.map(Z=>r.jsxs("div",{children:[r.jsx("label",{className:"block text-[10px] font-semibold text-gray-500 uppercase tracking-widest mb-1 mt-2",children:Z.label}),r.jsx("input",{type:Z.secret?"password":"text",value:J[Z.key]??"",onChange:_e=>le(Ie=>({...Ie,[Z.key]:_e.target.value})),placeholder:Z.placeholder,className:"w-full px-3 py-2 rounded-lg text-[12px] text-gray-200 placeholder-gray-700 outline-none transition-all",style:{background:"rgba(255,255,255,0.05)",border:"1px solid rgba(255,255,255,0.08)"}})]},Z.key))})]},O.id)})]}),d===5&&r.jsxs("div",{className:"space-y-5",children:[r.jsx(h0,{checked:_,onChange:U,label:"Send anonymous crash reports",description:"Helps improve Must-b. No personal data, no conversation content — only error traces."}),r.jsxs("div",{className:"rounded-xl bg-white/3 border border-white/6 px-4 py-4 space-y-2",children:[r.jsx("p",{className:"text-[11px] font-bold text-gray-400 uppercase tracking-widest mb-2",children:"Configuration Summary"}),[{label:"Name",value:f||"—"},{label:"Language",value:((Qr=u0.find(O=>O.value===b))==null?void 0:Qr.label)??b},{label:"Provider",value:((Zt=e.find(O=>O.id===v))==null?void 0:Zt.label)??v},{label:"Workspace",value:(z||c).replace(/^.*\/([^/]+\/[^/]+)$/,"…/$1")},{label:"Wake Word",value:C?"Enabled":"Disabled"}].map(O=>r.jsxs("div",{className:"flex items-center justify-between text-xs",children:[r.jsx("span",{className:"text-gray-400",children:O.label}),r.jsx("span",{className:"text-gray-300 font-mono truncate max-w-[200px]",children:O.value})]},O.label))]}),Lt&&r.jsx("div",{className:"rounded-xl bg-red-500/10 border border-red-500/20 px-4 py-3 text-red-400 text-sm",children:Lt}),r.jsx("button",{onClick:ms,disabled:G,className:"w-full flex items-center justify-center gap-3 px-8 py-4 rounded-2xl bg-gradient-to-r from-orange-600 to-amber-600 hover:from-orange-500 hover:to-amber-500 text-white font-bold text-base transition-all shadow-lg shadow-orange-500/25 active:scale-[0.98] disabled:opacity-50 disabled:cursor-not-allowed",children:G?r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"w-5 h-5 border-2 border-white/40 border-t-white rounded-full animate-spin"})," Initializing…"]}):r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"text-lg",children:"🚀"})," Initialize Must-b"]})})]})]},d)}),d<5&&r.jsxs("div",{className:"flex items-center justify-between mt-5",children:[r.jsxs("button",{onClick:()=>p(O=>O-1),disabled:d===0,className:"flex items-center gap-2 px-5 py-2.5 rounded-xl text-gray-400 hover:text-white hover:bg-white/5 transition-all disabled:opacity-25 disabled:cursor-not-allowed text-sm font-medium",children:[r.jsx(r0,{size:16})," Back"]}),r.jsxs("button",{onClick:()=>p(O=>O+1),disabled:!qs(),className:"flex items-center gap-2 px-6 py-2.5 rounded-xl bg-orange-600 hover:bg-orange-500 text-white font-semibold text-sm transition-all shadow-lg shadow-orange-500/20 active:scale-[0.97] disabled:opacity-40 disabled:cursor-not-allowed",children:["Continue ",r.jsx(dn,{size:16})]})]}),d===5&&r.jsx("div",{className:"flex justify-start mt-5",children:r.jsxs("button",{onClick:()=>p(4),className:"flex items-center gap-2 px-5 py-2.5 rounded-xl text-gray-400 hover:text-white hover:bg-white/5 transition-all text-sm font-medium",children:[r.jsx(r0,{size:16})," Back"]})}),r.jsxs("p",{className:"text-center text-xs text-gray-700 mt-5",children:["All settings saved locally · Run ",r.jsx("code",{className:"text-orange-500/60",children:"must-b doctor"})," to verify"]})]})]})}const pn=Object.create(null);pn.open="0";pn.close="1";pn.ping="2";pn.pong="3";pn.message="4";pn.upgrade="5";pn.noop="6";const wo=Object.create(null);Object.keys(pn).forEach(e=>{wo[pn[e]]=e});const dd={type:"error",data:"parser error"},bv=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",wv=typeof ArrayBuffer=="function",kv=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,cf=({type:e,data:t},n,s)=>bv&&t instanceof Blob?n?s(t):f0(t,s):wv&&(t instanceof ArrayBuffer||kv(t))?n?s(t):f0(new Blob([t]),s):s(pn[e]+(t||"")),f0=(e,t)=>{const n=new FileReader;return n.onload=function(){const s=n.result.split(",")[1];t("b"+(s||""))},n.readAsDataURL(e)};function p0(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let zc;function s3(e,t){if(bv&&e.data instanceof Blob)return e.data.arrayBuffer().then(p0).then(t);if(wv&&(e.data instanceof ArrayBuffer||kv(e.data)))return t(p0(e.data));cf(e,!1,n=>{zc||(zc=new TextEncoder),t(zc.encode(n))})}const m0="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",gi=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<m0.length;e++)gi[m0.charCodeAt(e)]=e;const r3=e=>{let t=e.length*.75,n=e.length,s,i=0,a,o,l,c;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const u=new ArrayBuffer(t),d=new Uint8Array(u);for(s=0;s<n;s+=4)a=gi[e.charCodeAt(s)],o=gi[e.charCodeAt(s+1)],l=gi[e.charCodeAt(s+2)],c=gi[e.charCodeAt(s+3)],d[i++]=a<<2|o>>4,d[i++]=(o&15)<<4|l>>2,d[i++]=(l&3)<<6|c&63;return u},i3=typeof ArrayBuffer=="function",uf=(e,t)=>{if(typeof e!="string")return{type:"message",data:jv(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:a3(e.substring(1),t)}:wo[n]?e.length>1?{type:wo[n],data:e.substring(1)}:{type:wo[n]}:dd},a3=(e,t)=>{if(i3){const n=r3(e);return jv(n,t)}else return{base64:!0,data:e}},jv=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},Nv="",o3=(e,t)=>{const n=e.length,s=new Array(n);let i=0;e.forEach((a,o)=>{cf(a,!1,l=>{s[o]=l,++i===n&&t(s.join(Nv))})})},l3=(e,t)=>{const n=e.split(Nv),s=[];for(let i=0;i<n.length;i++){const a=uf(n[i],t);if(s.push(a),a.type==="error")break}return s};function c3(){return new TransformStream({transform(e,t){s3(e,n=>{const s=n.length;let i;if(s<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,s);else if(s<65536){i=new Uint8Array(3);const a=new DataView(i.buffer);a.setUint8(0,126),a.setUint16(1,s)}else{i=new Uint8Array(9);const a=new DataView(i.buffer);a.setUint8(0,127),a.setBigUint64(1,BigInt(s))}e.data&&typeof e.data!="string"&&(i[0]|=128),t.enqueue(i),t.enqueue(n)})}})}let Lc;function Ga(e){return e.reduce((t,n)=>t+n.length,0)}function qa(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let s=0;for(let i=0;i<t;i++)n[i]=e[0][s++],s===e[0].length&&(e.shift(),s=0);return e.length&&s<e[0].length&&(e[0]=e[0].slice(s)),n}function u3(e,t){Lc||(Lc=new TextDecoder);const n=[];let s=0,i=-1,a=!1;return new TransformStream({transform(o,l){for(n.push(o);;){if(s===0){if(Ga(n)<1)break;const c=qa(n,1);a=(c[0]&128)===128,i=c[0]&127,i<126?s=3:i===126?s=1:s=2}else if(s===1){if(Ga(n)<2)break;const c=qa(n,2);i=new DataView(c.buffer,c.byteOffset,c.length).getUint16(0),s=3}else if(s===2){if(Ga(n)<8)break;const c=qa(n,8),u=new DataView(c.buffer,c.byteOffset,c.length),d=u.getUint32(0);if(d>Math.pow(2,21)-1){l.enqueue(dd);break}i=d*Math.pow(2,32)+u.getUint32(4),s=3}else{if(Ga(n)<i)break;const c=qa(n,i);l.enqueue(uf(a?c:Lc.decode(c),t)),s=0}if(i===0||i>e){l.enqueue(dd);break}}}})}const Sv=4;function Re(e){if(e)return d3(e)}function d3(e){for(var t in Re.prototype)e[t]=Re.prototype[t];return e}Re.prototype.on=Re.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};Re.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};Re.prototype.off=Re.prototype.removeListener=Re.prototype.removeAllListeners=Re.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var s,i=0;i<n.length;i++)if(s=n[i],s===t||s.fn===t){n.splice(i,1);break}return n.length===0&&delete this._callbacks["$"+e],this};Re.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],s=1;s<arguments.length;s++)t[s-1]=arguments[s];if(n){n=n.slice(0);for(var s=0,i=n.length;s<i;++s)n[s].apply(this,t)}return this};Re.prototype.emitReserved=Re.prototype.emit;Re.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};Re.prototype.hasListeners=function(e){return!!this.listeners(e).length};const Ol=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),_t=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),h3="arraybuffer";function Cv(e,...t){return t.reduce((n,s)=>(e.hasOwnProperty(s)&&(n[s]=e[s]),n),{})}const f3=_t.setTimeout,p3=_t.clearTimeout;function Dl(e,t){t.useNativeTimers?(e.setTimeoutFn=f3.bind(_t),e.clearTimeoutFn=p3.bind(_t)):(e.setTimeoutFn=_t.setTimeout.bind(_t),e.clearTimeoutFn=_t.clearTimeout.bind(_t))}const m3=1.33;function g3(e){return typeof e=="string"?x3(e):Math.ceil((e.byteLength||e.size)*m3)}function x3(e){let t=0,n=0;for(let s=0,i=e.length;s<i;s++)t=e.charCodeAt(s),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(s++,n+=4);return n}function Ev(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function y3(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function v3(e){let t={},n=e.split("&");for(let s=0,i=n.length;s<i;s++){let a=n[s].split("=");t[decodeURIComponent(a[0])]=decodeURIComponent(a[1])}return t}class b3 extends Error{constructor(t,n,s){super(t),this.description=n,this.context=s,this.type="TransportError"}}class df extends Re{constructor(t){super(),this.writable=!1,Dl(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,n,s){return super.emitReserved("error",new b3(t,n,s)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=uf(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,n={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port)!==443||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const n=y3(t);return n.length?"?"+n:""}}class w3 extends df{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(t){this.readyState="pausing";const n=()=>{this.readyState="paused",t()};if(this._polling||!this.writable){let s=0;this._polling&&(s++,this.once("pollComplete",function(){--s||n()})),this.writable||(s++,this.once("drain",function(){--s||n()}))}else n()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=s=>{if(this.readyState==="opening"&&s.type==="open"&&this.onOpen(),s.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(s)};l3(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,o3(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=Ev()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let _v=!1;try{_v=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const k3=_v;function j3(){}class N3 extends w3{constructor(t){if(super(t),typeof location<"u"){const n=location.protocol==="https:";let s=location.port;s||(s=n?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||s!==t.port}}doWrite(t,n){const s=this.request({method:"POST",data:t});s.on("success",n),s.on("error",(i,a)=>{this.onError("xhr post error",i,a)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,s)=>{this.onError("xhr poll error",n,s)}),this.pollXhr=t}}class un extends Re{constructor(t,n,s){super(),this.createRequest=t,Dl(this,s),this._opts=s,this._method=s.method||"GET",this._uri=n,this._data=s.data!==void 0?s.data:null,this._create()}_create(){var t;const n=Cv(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this._opts.xd;const s=this._xhr=this.createRequest(n);try{s.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){s.setDisableHeaderCheck&&s.setDisableHeaderCheck(!0);for(let i in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(i)&&s.setRequestHeader(i,this._opts.extraHeaders[i])}}catch{}if(this._method==="POST")try{s.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{s.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(s),"withCredentials"in s&&(s.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(s.timeout=this._opts.requestTimeout),s.onreadystatechange=()=>{var i;s.readyState===3&&((i=this._opts.cookieJar)===null||i===void 0||i.parseCookies(s.getResponseHeader("set-cookie"))),s.readyState===4&&(s.status===200||s.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof s.status=="number"?s.status:0)},0))},s.send(this._data)}catch(i){this.setTimeoutFn(()=>{this._onError(i)},0);return}typeof document<"u"&&(this._index=un.requestsCount++,un.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=j3,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete un.requests[this._index],this._xhr=null}}_onLoad(){const t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}un.requestsCount=0;un.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",g0);else if(typeof addEventListener=="function"){const e="onpagehide"in _t?"pagehide":"unload";addEventListener(e,g0,!1)}}function g0(){for(let e in un.requests)un.requests.hasOwnProperty(e)&&un.requests[e].abort()}const S3=function(){const e=Tv({xdomain:!1});return e&&e.responseType!==null}();class C3 extends N3{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=S3&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new un(Tv,this.uri(),t)}}function Tv(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||k3))return new XMLHttpRequest}catch{}if(!t)try{return new _t[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const Pv=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class E3 extends df{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,s=Pv?{}:Cv(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(s.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,n,s)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const s=t[n],i=n===t.length-1;cf(s,this.supportsBinary,a=>{try{this.doWrite(s,a)}catch{}i&&Ol(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=Ev()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const Oc=_t.WebSocket||_t.MozWebSocket;class _3 extends E3{createSocket(t,n,s){return Pv?new Oc(t,n,s):n?new Oc(t,n):new Oc(t)}doWrite(t,n){this.ws.send(n)}}class T3 extends df{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{const n=u3(Number.MAX_SAFE_INTEGER,this.socket.binaryType),s=t.readable.pipeThrough(n).getReader(),i=c3();i.readable.pipeTo(t.writable),this._writer=i.writable.getWriter();const a=()=>{s.read().then(({done:l,value:c})=>{l||(this.onPacket(c),a())}).catch(l=>{})};a();const o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this._writer.write(o).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const s=t[n],i=n===t.length-1;this._writer.write(s).then(()=>{i&&Ol(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const P3={websocket:_3,webtransport:T3,polling:C3},M3=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,A3=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function hd(e){if(e.length>8e3)throw"URI too long";const t=e,n=e.indexOf("["),s=e.indexOf("]");n!=-1&&s!=-1&&(e=e.substring(0,n)+e.substring(n,s).replace(/:/g,";")+e.substring(s,e.length));let i=M3.exec(e||""),a={},o=14;for(;o--;)a[A3[o]]=i[o]||"";return n!=-1&&s!=-1&&(a.source=t,a.host=a.host.substring(1,a.host.length-1).replace(/;/g,":"),a.authority=a.authority.replace("[","").replace("]","").replace(/;/g,":"),a.ipv6uri=!0),a.pathNames=R3(a,a.path),a.queryKey=z3(a,a.query),a}function R3(e,t){const n=/\/{2,9}/g,s=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&s.splice(0,1),t.slice(-1)=="/"&&s.splice(s.length-1,1),s}function z3(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(s,i,a){i&&(n[i]=a)}),n}const fd=typeof addEventListener=="function"&&typeof removeEventListener=="function",ko=[];fd&&addEventListener("offline",()=>{ko.forEach(e=>e())},!1);class es extends Re{constructor(t,n){if(super(),this.binaryType=h3,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(n=t,t=null),t){const s=hd(t);n.hostname=s.host,n.secure=s.protocol==="https"||s.protocol==="wss",n.port=s.port,s.query&&(n.query=s.query)}else n.host&&(n.hostname=hd(n.host).host);Dl(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},n.transports.forEach(s=>{const i=s.prototype.name;this.transports.push(i),this._transportsByName[i]=s}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=v3(this.opts.query)),fd&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},ko.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=Sv,n.transport=t,this.id&&(n.sid=this.id);const s=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](s)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&es.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const n=this.createTransport(t);n.open(),this.setTransport(n)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",n=>this._onClose("transport close",n))}onOpen(){this.readyState="open",es.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const n=new Error("server error");n.code=t.data,this._onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let s=0;s<this.writeBuffer.length;s++){const i=this.writeBuffer[s].data;if(i&&(n+=g3(i)),s>0&&n>this._maxPayload)return this.writeBuffer.slice(0,s);n+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,Ol(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,n,s){return this._sendPacket("message",t,n,s),this}send(t,n,s){return this._sendPacket("message",t,n,s),this}_sendPacket(t,n,s,i){if(typeof n=="function"&&(i=n,n=void 0),typeof s=="function"&&(i=s,s=null),this.readyState==="closing"||this.readyState==="closed")return;s=s||{},s.compress=s.compress!==!1;const a={type:t,data:n,options:s};this.emitReserved("packetCreate",a),this.writeBuffer.push(a),i&&this.once("flush",i),this.flush()}close(){const t=()=>{this._onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},s=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?s():t()}):this.upgrading?s():t()),this}_onError(t){if(es.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,n){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),fd&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const s=ko.indexOf(this._offlineEventListener);s!==-1&&ko.splice(s,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}es.protocol=Sv;class L3 extends es{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t<this._upgrades.length;t++)this._probe(this._upgrades[t])}_probe(t){let n=this.createTransport(t),s=!1;es.priorWebsocketSuccess=!1;const i=()=>{s||(n.send([{type:"ping",data:"probe"}]),n.once("packet",p=>{if(!s)if(p.type==="pong"&&p.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;es.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{s||this.readyState!=="closed"&&(d(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const f=new Error("probe error");f.transport=n.name,this.emitReserved("upgradeError",f)}}))};function a(){s||(s=!0,d(),n.close(),n=null)}const o=p=>{const f=new Error("probe error: "+p);f.transport=n.name,a(),this.emitReserved("upgradeError",f)};function l(){o("transport closed")}function c(){o("socket closed")}function u(p){n&&p.name!==n.name&&a()}const d=()=>{n.removeListener("open",i),n.removeListener("error",o),n.removeListener("close",l),this.off("close",c),this.off("upgrading",u)};n.once("open",i),n.once("error",o),n.once("close",l),this.once("close",c),this.once("upgrading",u),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{s||n.open()},200):n.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const n=[];for(let s=0;s<t.length;s++)~this.transports.indexOf(t[s])&&n.push(t[s]);return n}}let O3=class extends L3{constructor(t,n={}){const s=typeof t=="object"?t:n;(!s.transports||s.transports&&typeof s.transports[0]=="string")&&(s.transports=(s.transports||["polling","websocket","webtransport"]).map(i=>P3[i]).filter(i=>!!i)),super(t,s)}};function D3(e,t="",n){let s=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),s=hd(e)),s.port||(/^(http|ws)$/.test(s.protocol)?s.port="80":/^(http|ws)s$/.test(s.protocol)&&(s.port="443")),s.path=s.path||"/";const a=s.host.indexOf(":")!==-1?"["+s.host+"]":s.host;return s.id=s.protocol+"://"+a+":"+s.port+t,s.href=s.protocol+"://"+a+(n&&n.port===s.port?"":":"+s.port),s}const I3=typeof ArrayBuffer=="function",B3=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,Mv=Object.prototype.toString,F3=typeof Blob=="function"||typeof Blob<"u"&&Mv.call(Blob)==="[object BlobConstructor]",V3=typeof File=="function"||typeof File<"u"&&Mv.call(File)==="[object FileConstructor]";function hf(e){return I3&&(e instanceof ArrayBuffer||B3(e))||F3&&e instanceof Blob||V3&&e instanceof File}function jo(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,s=e.length;n<s;n++)if(jo(e[n]))return!0;return!1}if(hf(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return jo(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&jo(e[n]))return!0;return!1}function $3(e){const t=[],n=e.data,s=e;return s.data=pd(n,t),s.attachments=t.length,{packet:s,buffers:t}}function pd(e,t){if(!e)return e;if(hf(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){const n=new Array(e.length);for(let s=0;s<e.length;s++)n[s]=pd(e[s],t);return n}else if(typeof e=="object"&&!(e instanceof Date)){const n={};for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&(n[s]=pd(e[s],t));return n}return e}function U3(e,t){return e.data=md(e.data,t),delete e.attachments,e}function md(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=md(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=md(e[n],t));return e}const H3=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var ae;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(ae||(ae={}));class W3{constructor(t){this.replacer=t}encode(t){return(t.type===ae.EVENT||t.type===ae.ACK)&&jo(t)?this.encodeAsBinary({type:t.type===ae.EVENT?ae.BINARY_EVENT:ae.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===ae.BINARY_EVENT||t.type===ae.BINARY_ACK)&&(n+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(n+=t.nsp+","),t.id!=null&&(n+=t.id),t.data!=null&&(n+=JSON.stringify(t.data,this.replacer)),n}encodeAsBinary(t){const n=$3(t),s=this.encodeAsString(n.packet),i=n.buffers;return i.unshift(s),i}}class ff extends Re{constructor(t){super(),this.reviver=t}add(t){let n;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(t);const s=n.type===ae.BINARY_EVENT;s||n.type===ae.BINARY_ACK?(n.type=s?ae.EVENT:ae.ACK,this.reconstructor=new K3(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(hf(t)||t.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(t),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let n=0;const s={type:Number(t.charAt(0))};if(ae[s.type]===void 0)throw new Error("unknown packet type "+s.type);if(s.type===ae.BINARY_EVENT||s.type===ae.BINARY_ACK){const a=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const o=t.substring(a,n);if(o!=Number(o)||t.charAt(n)!=="-")throw new Error("Illegal attachments");s.attachments=Number(o)}if(t.charAt(n+1)==="/"){const a=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););s.nsp=t.substring(a,n)}else s.nsp="/";const i=t.charAt(n+1);if(i!==""&&Number(i)==i){const a=n+1;for(;++n;){const o=t.charAt(n);if(o==null||Number(o)!=o){--n;break}if(n===t.length)break}s.id=Number(t.substring(a,n+1))}if(t.charAt(++n)){const a=this.tryParse(t.substr(n));if(ff.isPayloadValid(s.type,a))s.data=a;else throw new Error("invalid payload")}return s}tryParse(t){try{return JSON.parse(t,this.reviver)}catch{return!1}}static isPayloadValid(t,n){switch(t){case ae.CONNECT:return x0(n);case ae.DISCONNECT:return n===void 0;case ae.CONNECT_ERROR:return typeof n=="string"||x0(n);case ae.EVENT:case ae.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&H3.indexOf(n[0])===-1);case ae.ACK:case ae.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class K3{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=U3(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}function x0(e){return Object.prototype.toString.call(e)==="[object Object]"}const G3=Object.freeze(Object.defineProperty({__proto__:null,Decoder:ff,Encoder:W3,get PacketType(){return ae}},Symbol.toStringTag,{value:"Module"}));function Ht(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const q3=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Av extends Re{constructor(t,n,s){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,s&&s.auth&&(this.auth=s.auth),this._opts=Object.assign({},s),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[Ht(t,"open",this.onopen.bind(this)),Ht(t,"packet",this.onpacket.bind(this)),Ht(t,"error",this.onerror.bind(this)),Ht(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){var s,i,a;if(q3.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const o={type:ae.EVENT,data:n};if(o.options={},o.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const d=this.ids++,p=n.pop();this._registerAckCallback(d,p),o.id=d}const l=(i=(s=this.io.engine)===null||s===void 0?void 0:s.transport)===null||i===void 0?void 0:i.writable,c=this.connected&&!(!((a=this.io.engine)===null||a===void 0)&&a._hasPingExpired());return this.flags.volatile&&!l||(c?(this.notifyOutgoingListeners(o),this.packet(o)):this.sendBuffer.push(o)),this.flags={},this}_registerAckCallback(t,n){var s;const i=(s=this.flags.timeout)!==null&&s!==void 0?s:this._opts.ackTimeout;if(i===void 0){this.acks[t]=n;return}const a=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let l=0;l<this.sendBuffer.length;l++)this.sendBuffer[l].id===t&&this.sendBuffer.splice(l,1);n.call(this,new Error("operation has timed out"))},i),o=(...l)=>{this.io.clearTimeoutFn(a),n.apply(this,l)};o.withError=!0,this.acks[t]=o}emitWithAck(t,...n){return new Promise((s,i)=>{const a=(o,l)=>o?i(o):s(l);a.withError=!0,n.push(a),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const s={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((i,...a)=>(this._queue[0],i!==null?s.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(i)):(this._queue.shift(),n&&n(null,...a)),s.pending=!1,this._drainQueue())),this._queue.push(s),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:ae.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(s=>String(s.id)===t)){const s=this.acks[t];delete this.acks[t],s.withError&&s.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case ae.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case ae.EVENT:case ae.BINARY_EVENT:this.onevent(t);break;case ae.ACK:case ae.BINARY_ACK:this.onack(t);break;case ae.DISCONNECT:this.ondisconnect();break;case ae.CONNECT_ERROR:this.destroy();const s=new Error(t.data.message);s.data=t.data.data,this.emitReserved("connect_error",s);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const s of n)s.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let s=!1;return function(...i){s||(s=!0,n.packet({type:ae.ACK,id:t,data:i}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(delete this.acks[t.id],n.withError&&t.data.unshift(null),n.apply(this,t.data))}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:ae.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let s=0;s<n.length;s++)if(t===n[s])return n.splice(s,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let s=0;s<n.length;s++)if(t===n[s])return n.splice(s,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const s of n)s.apply(this,t.data)}}}function Yr(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}Yr.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+n:e-n}return Math.min(e,this.max)|0};Yr.prototype.reset=function(){this.attempts=0};Yr.prototype.setMin=function(e){this.ms=e};Yr.prototype.setMax=function(e){this.max=e};Yr.prototype.setJitter=function(e){this.jitter=e};class gd extends Re{constructor(t,n){var s;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,Dl(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((s=n.randomizationFactor)!==null&&s!==void 0?s:.5),this.backoff=new Yr({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const i=n.parser||G3;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new O3(this.uri,this.opts);const n=this.engine,s=this;this._readyState="opening",this.skipReconnect=!1;const i=Ht(n,"open",function(){s.onopen(),t&&t()}),a=l=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",l),t?t(l):this.maybeReconnectOnOpen()},o=Ht(n,"error",a);if(this._timeout!==!1){const l=this._timeout,c=this.setTimeoutFn(()=>{i(),a(new Error("timeout")),n.close()},l);this.opts.autoUnref&&c.unref(),this.subs.push(()=>{this.clearTimeoutFn(c)})}return this.subs.push(i),this.subs.push(o),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(Ht(t,"ping",this.onping.bind(this)),Ht(t,"data",this.ondata.bind(this)),Ht(t,"error",this.onerror.bind(this)),Ht(t,"close",this.onclose.bind(this)),Ht(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){Ol(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let s=this.nsps[t];return s?this._autoConnect&&!s.active&&s.connect():(s=new Av(this,t,n),this.nsps[t]=s),s}_destroy(t){const n=Object.keys(this.nsps);for(const s of n)if(this.nsps[s].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let s=0;s<n.length;s++)this.engine.write(n[s],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,n){var s;this.cleanup(),(s=this.engine)===null||s===void 0||s.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const s=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(i=>{i?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",i)):t.onreconnect()}))},n);this.opts.autoUnref&&s.unref(),this.subs.push(()=>{this.clearTimeoutFn(s)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const oi={};function Ri(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=D3(e,t.path||"/socket.io"),s=n.source,i=n.id,a=n.path,o=oi[i]&&a in oi[i].nsps,l=t.forceNew||t["force new connection"]||t.multiplex===!1||o;let c;return l?c=new gd(s,t):(oi[i]||(oi[i]=new gd(s,t)),c=oi[i]),n.query&&!t.query&&(t.query=n.queryKey),c.socket(n.path,t)}Object.assign(Ri,{Manager:gd,Socket:Av,io:Ri,connect:Ri});const Y3={};let ys=null;function X3(){const e=Y3;if(e!=null&&e.VITE_BACKEND_URL)return e.VITE_BACKEND_URL.replace(/\/$/,"");const t=window.location.hostname;return t==="localhost"||t==="127.0.0.1"||/^\d{1,3}(\.\d{1,3}){3}$/.test(t)?window.location.origin:"http://localhost:4309"}function at(){return ys||(ys=Ri(X3(),{transports:["websocket","polling"],withCredentials:!0,reconnection:!0,reconnectionAttempts:1/0,reconnectionDelay:1e3,reconnectionDelayMax:5e3,randomizationFactor:.3,timeout:1e4}),ys.on("agentUpdate",e=>{try{e!=null&&window.dispatchEvent(new CustomEvent("mustb:agentUpdate",{detail:e}))}catch{}}),ys.on("connect",()=>{window.dispatchEvent(new CustomEvent("mustb:connected"))}),ys.on("disconnect",e=>{window.dispatchEvent(new CustomEvent("mustb:disconnected",{detail:{reason:e}}))}),ys.io.on("reconnect",e=>{window.dispatchEvent(new CustomEvent("mustb:reconnected",{detail:{attemptNumber:e}}))})),ys}const Q3={};let xi=null;const J3=(()=>{const e=Q3,t=(e==null?void 0:e.VITE_BACKEND_URL)??"";return t&&!t.includes(window.location.hostname)?t.replace(/\/$/,""):""})();function Rv(e){return e.startsWith("http")?e:`${J3}${e}`}async function Z3(){if(xi)return xi;try{const e=await fetch(Rv("/api/auth/local"));if(e.ok)return xi=(await e.json()).token??null,xi}catch{}return null}async function $(e,t={},{retries:n=3,retryDelay:s=800}={}){const i=await Z3(),a={"Content-Type":"application/json",...t.headers};i&&(a.Authorization=`Bearer ${i}`);const o=Rv(e);let l;for(let c=1;c<=n;c++)try{const u=await fetch(o,{...t,headers:a});return u.status===401&&(xi=null,window.dispatchEvent(new CustomEvent("mustb:401",{detail:{url:o}}))),u}catch(u){l=u,c<n&&await new Promise(d=>setTimeout(d,s*c))}throw window.dispatchEvent(new CustomEvent("mustb:offline",{detail:{url:o}})),l}function y0(e){const t=e.toLowerCase();if(t.includes("gemini-2")||t.includes("gemini-flash"))return 9999;if(t.includes("llama-3")&&(t.includes("70b")||t.includes("405b")))return 9998;if(t.includes("gpt-4o"))return 8888;if(t.includes("claude-3-5")||t.includes("claude-3.5"))return 8887;if(t.includes("gemini-pro")||t.includes("gemini-1.5-pro"))return 8886;const n=t.match(/(\d+)x(\d+)b/);if(n)return parseFloat(n[1])*parseFloat(n[2]);const s=t.match(/(\d+(?:\.\d+)?)b/);return s?parseFloat(s[1]):0}function Dc(e){return[...e].sort((t,n)=>y0(n.id)-y0(t.id))}function eE(){const{t:e}=pt(),[t,n]=h.useState(!1),[s,i]=h.useState(()=>localStorage.getItem("mustb_active_model")??"Loading…"),[a,o]=h.useState([]),l=h.useRef(null);h.useEffect(()=>{const f=localStorage.getItem("mustb_active_model");f&&f!=="Loading…"&&$("/api/settings/model",{method:"POST",body:JSON.stringify({model:f})}).catch(()=>{}),$("/api/setup/status").then(m=>m.ok?m.json():null).then(m=>{if(!m)return;const b=localStorage.getItem("mustb_active_model");m.activeModel&&(!b||b==="Loading…")&&(i(m.activeModel),localStorage.setItem("mustb_active_model",m.activeModel)),(m.activeProvider??"openrouter").toLowerCase()==="ollama"?$("/api/models").then(v=>v.ok?v.json():[]).then(v=>{const x=(Array.isArray(v)?v:[]).map(w=>({id:w.id??String(w),name:w.name??w.id??String(w),free:!0}));o(Dc(x))}).catch(()=>{}):$("/api/providers/openrouter/models").then(v=>v.ok?v.json():{}).then(v=>{const g=Dc((v.free??[]).map(j=>({id:j.id,name:j.name??j.id,free:!0}))),x=Dc((v.power??[]).map(j=>({id:j.id,name:j.name??j.id,free:!1}))),w=[...g,...x];o(w),!(m!=null&&m.activeModel)&&w.length>0&&i(w[0].id)}).catch(()=>{})}).catch(()=>{})},[]),h.useEffect(()=>{if(!t)return;const f=m=>{l.current&&!l.current.contains(m.target)&&n(!1)};return document.addEventListener("mousedown",f),()=>document.removeEventListener("mousedown",f)},[t]);const c=async f=>{i(f),localStorage.setItem("mustb_active_model",f),n(!1),await $("/api/settings/model",{method:"POST",body:JSON.stringify({model:f})}).catch(()=>{})},u=a.filter(f=>f.free),d=a.filter(f=>!f.free),p=s.length>28?s.slice(0,26)+"…":s;return r.jsxs("div",{ref:l,className:"relative",children:[r.jsxs("button",{onClick:()=>n(f=>!f),className:"flex items-center gap-1 px-2 py-1 rounded-lg border border-white/10 bg-white/5 hover:bg-white/10 text-white/50 hover:text-white/80 text-[11px] font-medium transition-all",children:[r.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-orange-500 shrink-0"}),r.jsx("span",{className:"truncate max-w-[110px]",children:p}),r.jsx(Kr,{size:10,className:`transition-transform duration-200 shrink-0 text-white/30 ${t?"rotate-180":""}`})]}),r.jsx(se,{children:t&&r.jsxs(H.div,{initial:{opacity:0,y:6,scale:.97},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:4,scale:.97},transition:{duration:.14,ease:[.22,1,.36,1]},className:"absolute bottom-full mb-2 left-0 z-50 w-72 rounded-xl shadow-xl border border-white/10 flex flex-col",style:{background:"rgba(18,8,2,0.97)",backdropFilter:"blur(24px)",maxHeight:"400px"},children:[r.jsxs("div",{className:"overflow-y-auto flex-1 p-1.5",children:[u.length>0&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"px-2.5 pt-2 pb-1 text-[9.5px] font-black uppercase tracking-[0.12em] text-emerald-500/80",children:"Free"}),u.slice(0,5).map(f=>r.jsxs("button",{onClick:()=>c(f.id),className:`w-full flex items-center gap-2 px-2.5 py-2 rounded-lg text-left transition-colors ${s===f.id?"bg-orange-500/15 text-orange-300":"text-white/60 hover:bg-white/5 hover:text-white/90"}`,children:[r.jsx("span",{className:`w-1.5 h-1.5 rounded-full shrink-0 ${s===f.id?"bg-orange-500":"bg-emerald-400"}`}),r.jsx("span",{className:"text-[12px] font-medium truncate",children:f.name}),s===f.id&&r.jsx("span",{className:"ml-auto text-[9px] font-semibold text-orange-400 shrink-0",children:"active"})]},f.id))]}),d.length>0&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"px-2.5 pt-2 pb-1 text-[9.5px] font-black uppercase tracking-[0.12em] text-orange-400/80",children:"Pro"}),d.map(f=>r.jsxs("button",{onClick:()=>c(f.id),className:`w-full flex items-center gap-2 px-2.5 py-2 rounded-lg text-left transition-colors ${s===f.id?"bg-orange-500/15 text-orange-300":"text-white/60 hover:bg-white/5 hover:text-white/90"}`,children:[r.jsx("span",{className:`w-1.5 h-1.5 rounded-full shrink-0 ${s===f.id?"bg-orange-500":"bg-orange-300"}`}),r.jsx("span",{className:"text-[12px] font-medium truncate",children:f.name}),s===f.id&&r.jsx("span",{className:"ml-auto text-[9px] font-semibold text-orange-400 shrink-0",children:"active"})]},f.id))]}),a.length===0&&r.jsx("div",{className:"px-3 py-4 text-[12px] text-white/30 text-center",children:"No models available"})]}),r.jsx("div",{className:"shrink-0 border-t border-white/8 p-1.5",children:r.jsxs(Ei,{to:"/app/settings",onClick:()=>n(!1),className:"flex items-center justify-center gap-1.5 w-full px-2.5 py-2 rounded-lg text-[11px] font-medium text-white/35 hover:text-orange-400 hover:bg-orange-500/8 transition-colors",children:[r.jsx(af,{size:11}),e.systemHealth.moreModels]})})]})})]})}function sn(e){if(typeof e=="string")return e;if(e==null)return"";if(typeof e=="object"){const t=e,n=t.message??t.error??t.text??t.content??t.result;return n!==void 0?sn(n):JSON.stringify(e)}return String(e)}function tE(e,t){switch(e){case"planGenerated":{const n=t.steps;return`Plan ready — ${(n==null?void 0:n.length)??0} step(s)`}case"stepStart":{const n=t.step;return`▶ ${(n==null?void 0:n.description)??sn(t.step)}`}case"stepFinish":{if(t.status==="error")return`✗ ${sn(t.error)}`;const n=t.step,s=t.result!==void 0?sn(t.result):void 0,i=(n==null?void 0:n.description)??"Step complete";return s&&s.length<180?`✓ ${i} → ${s}`:`✓ ${i}`}case"agentRepair":{const n=sn(t.action),s=t.reason?` — ${sn(t.reason).slice(0,120)}`:"";return`⟳ Repair: ${n}${s}`}default:return null}}function nE(e){return new Promise((t,n)=>{const s=new FileReader;s.onload=()=>t(s.result),s.onerror=n,s.readAsDataURL(e)})}function sE({lang:e,code:t}){const[n,s]=h.useState(!1);return r.jsxs("div",{className:"my-3 rounded-xl overflow-hidden border border-white/8 bg-[#1a0800]/90",children:[r.jsxs("div",{className:"flex items-center justify-between px-4 py-1.5 border-b border-white/6 select-none",children:[r.jsx("span",{className:"text-[11px] font-mono text-orange-300/50",children:e||"code"}),r.jsx("button",{onClick:()=>{navigator.clipboard.writeText(t).catch(()=>{}),s(!0),setTimeout(()=>s(!1),2e3)},className:"flex items-center gap-1.5 text-[11px] text-orange-300/50 hover:text-orange-200 transition-colors",children:n?r.jsxs(r.Fragment,{children:[r.jsx(zt,{size:10,className:"text-orange-400"}),r.jsx("span",{className:"text-orange-400",children:"Copied"})]}):r.jsxs(r.Fragment,{children:[r.jsx(aa,{size:10}),"Copy"]})})]}),r.jsx("pre",{className:"overflow-x-auto px-4 py-3 text-[13px] text-orange-50 font-mono leading-relaxed whitespace-pre",children:r.jsx("code",{children:t})})]})}function Js(e,t){return e.split(/(`[^`\n]+`)/).map((s,i)=>{if(s.startsWith("`")&&s.endsWith("`")&&s.length>2)return r.jsx("code",{className:"px-1.5 py-0.5 rounded bg-black/15 text-orange-700 font-mono text-[12px]",children:s.slice(1,-1)},`${t}-ic${i}`);const a=s.split(/(\*\*[^*\n]+\*\*|\*[^*\n]+\*)/);return r.jsx(h.Fragment,{children:a.map((o,l)=>o.startsWith("**")&&o.endsWith("**")&&o.length>4?r.jsx("strong",{className:"font-bold text-inherit dark:text-gray-100",children:o.slice(2,-2)},`${t}-b${i}-${l}`):o.startsWith("*")&&o.endsWith("*")&&o.length>2?r.jsx("em",{className:"italic",children:o.slice(1,-1)},`${t}-em${i}-${l}`):r.jsx("span",{children:o},`${t}-s${i}-${l}`))},`${t}-bi${i}`)})}function rE({text:e,dark:t=!1}){const n=t?"text-orange-50":"text-[#3d1a06]",s=[],i=e.split(`
720
- `);let a=0,o=0;const l=()=>`md-${o++}`;for(;a<i.length;){const c=i[a],u=c.match(/^```(\w*)/);if(u){const b=u[1]??"",y=[];for(a++;a<i.length&&!i[a].startsWith("```");)y.push(i[a]),a++;a<i.length&&a++,s.push(r.jsx(sE,{lang:b,code:y.join(`
721
- `)},l()));continue}const d=c.match(/^### (.+)/);if(d){s.push(r.jsx("h3",{className:`text-sm font-bold mt-4 mb-1 ${n}`,children:Js(d[1],l())},l())),a++;continue}const p=c.match(/^## (.+)/);if(p){s.push(r.jsx("h2",{className:`text-base font-bold mt-5 mb-1.5 ${n}`,children:Js(p[1],l())},l())),a++;continue}const f=c.match(/^# (.+)/);if(f){s.push(r.jsx("h1",{className:`text-lg font-bold mt-6 mb-2 ${n}`,children:Js(f[1],l())},l())),a++;continue}if(c.match(/^[-*]{3,}$/)){s.push(r.jsx("hr",{className:"border-black/10 my-4"},l())),a++;continue}if(c.match(/^[-*•] /)){const b=[];for(;a<i.length&&i[a].match(/^[-*•] /);)b.push(i[a].replace(/^[-*•] /,"")),a++;s.push(r.jsx("ul",{className:"my-2 space-y-1.5 pl-1",children:b.map((y,v)=>r.jsxs("li",{className:`flex items-start gap-2.5 text-[14px] leading-relaxed ${n}`,children:[r.jsx("span",{className:"mt-[7px] w-1.5 h-1.5 rounded-full bg-orange-500/60 flex-shrink-0"}),r.jsx("span",{children:Js(y,`ul-${v}`)})]},v))},l()));continue}if(c.match(/^\d+\. /)){const b=[];for(;a<i.length&&i[a].match(/^\d+\. /);)b.push(i[a].replace(/^\d+\. /,"")),a++;s.push(r.jsx("ol",{className:"my-2 space-y-1.5 pl-1",children:b.map((y,v)=>r.jsxs("li",{className:`flex items-start gap-2.5 text-[14px] leading-relaxed ${n}`,children:[r.jsxs("span",{className:"flex-shrink-0 mt-px font-mono text-[12px] w-5 text-right text-orange-600/60",children:[v+1,"."]}),r.jsx("span",{children:Js(y,`ol-${v}`)})]},v))},l()));continue}if(c.trim()===""){a++;continue}const m=[];for(;a<i.length&&i[a].trim()!==""&&!i[a].match(/^(```|#{1,3} |[-*•] |\d+\. |[-*]{3,}$)/);)m.push(i[a]),a++;m.length&&s.push(r.jsx("p",{className:`text-[14px] leading-[1.75] my-1.5 ${n}`,children:Js(m.join(" "),`p-${o}`)},l()))}return r.jsx("div",{children:s})}function iE(){const[e,t]=h.useState(0);h.useEffect(()=>{const i=setInterval(()=>t(a=>a+1),1e3);return()=>clearInterval(i)},[]);const n=String(Math.floor(e/60)).padStart(2,"0"),s=String(e%60).padStart(2,"0");return r.jsxs("span",{className:"text-[10px] text-white/20 font-mono ml-1",children:["[",n,":",s,"]"]})}function aE({startedAt:e}){const[t,n]=h.useState(()=>e?Math.floor((Date.now()-e)/1e3):0);h.useEffect(()=>{if(!e)return;const a=setInterval(()=>n(Math.floor((Date.now()-e)/1e3)),1e3);return()=>clearInterval(a)},[e]);const s=Math.floor(t/60),i=t%60;return r.jsxs("span",{className:"text-[10px] text-orange-400/40 font-mono",children:["Working… ",s>0?`${s}m ${i}s`:`${i}s`]})}function oE({logs:e,isRunning:t}){const n=h.useRef(null);return h.useEffect(()=>{t&&n.current&&(n.current.scrollTop=n.current.scrollHeight)},[e.length,t]),r.jsx("div",{ref:n,className:"ml-[19px] mt-0.5 rounded-lg bg-black/75 border border-white/6 px-2.5 py-1.5 max-h-28 overflow-y-auto scrollbar-hide",children:e.map((s,i)=>r.jsx("div",{className:`text-[10px] font-mono leading-relaxed whitespace-pre-wrap break-all ${s.startsWith("$ ")?"text-yellow-300/80":s.startsWith("[stderr]")?"text-red-400/70":"text-green-300/55"}`,children:s},i))})}function lE({workflow:e,onDismiss:t}){const[n,s]=h.useState("idle"),[i,a]=h.useState(e.goal.slice(0,52)+(e.goal.length>52?"…":"")),o=async()=>{s("saving");try{const l=await $("/api/skills/save",{method:"POST",body:JSON.stringify({goal:e.goal,answer:e.answer,steps:e.steps,name:i.trim()||void 0})});if(!l.ok)throw new Error(`HTTP ${l.status}`);s("saved"),setTimeout(t,1800)}catch{s("error"),setTimeout(()=>s("idle"),3e3)}};return r.jsx(H.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},exit:{opacity:0,y:4},transition:{duration:.2},className:"mt-3",children:r.jsx("div",{className:"flex items-center gap-3 px-4 py-2.5 rounded-xl bg-orange-900/20 border border-orange-600/30",children:n==="saved"?r.jsxs(r.Fragment,{children:[r.jsx(Ve,{size:13,className:"text-orange-400 shrink-0"}),r.jsx("span",{className:"text-xs font-medium text-orange-400",children:"Skill saved!"})]}):r.jsxs(r.Fragment,{children:[r.jsx(ev,{size:13,className:"text-orange-600 shrink-0"}),r.jsx("span",{className:"text-[11px] text-orange-200 shrink-0 font-medium",children:"Save as Skill:"}),r.jsx("input",{value:i,onChange:l=>a(l.target.value),onKeyDown:l=>l.key==="Enter"&&n==="idle"&&o(),placeholder:"Skill name…",className:"flex-1 bg-transparent text-[12px] text-orange-100 outline-none placeholder-orange-600/50 min-w-0"}),r.jsx("button",{onClick:o,disabled:n!=="idle",className:"flex items-center gap-1 px-3 py-1 rounded-lg bg-orange-900/30 hover:bg-orange-900/50 border border-orange-800/40 text-orange-200 text-[11px] font-semibold transition-all shrink-0 disabled:opacity-50",children:n==="saving"?r.jsxs(r.Fragment,{children:[r.jsx(ne,{size:10,className:"animate-spin"})," Saving…"]}):n==="error"?"Retry":"Save"}),r.jsx("button",{onClick:t,className:"text-orange-700 hover:text-orange-500 transition-colors text-[11px] shrink-0",children:"✕"})]})})})}function cE({src:e,onClose:t}){const[n,s]=h.useState(!1);h.useEffect(()=>{const o=l=>{l.key==="Escape"&&t()};return document.addEventListener("keydown",o),()=>document.removeEventListener("keydown",o)},[t]);const i=()=>{const o=document.createElement("a");o.href=e,o.download=`mustb-image-${Date.now()}.jpg`,o.click()},a=async()=>{try{await navigator.clipboard.writeText(e),s(!0),setTimeout(()=>s(!1),2e3)}catch{}};return r.jsxs("div",{className:"fixed inset-0 z-[9999] flex flex-col items-center justify-center bg-black/90 backdrop-blur-sm",onClick:t,children:[r.jsxs("div",{className:"absolute top-5 right-5 flex items-center gap-2",onClick:o=>o.stopPropagation(),children:[r.jsxs("button",{onClick:a,title:"Copy link",className:"flex items-center gap-1.5 px-3 py-1.5 rounded-full bg-white/10 hover:bg-white/20 text-white/80 hover:text-white text-[12px] font-medium transition-all",children:[n?r.jsx(zt,{size:14,className:"text-green-400"}):r.jsx(aa,{size:14}),n?"Copied!":"Copy"]}),r.jsxs("button",{onClick:i,title:"Download image",className:"flex items-center gap-1.5 px-3 py-1.5 rounded-full bg-white/10 hover:bg-white/20 text-white/80 hover:text-white text-[12px] font-medium transition-all",children:[r.jsx(Ai,{size:14}),"Download"]}),r.jsx("button",{onClick:t,className:"w-9 h-9 flex items-center justify-center rounded-full bg-white/10 hover:bg-white/20 text-white/80 hover:text-white transition-all",children:r.jsx(et,{size:18})})]}),r.jsx("img",{src:e,alt:"Preview",className:"max-w-[90vw] max-h-[85vh] object-contain rounded-2xl shadow-2xl",onClick:o=>o.stopPropagation()})]})}class uE extends h.Component{constructor(t){super(t),this.state={error:null}}static getDerivedStateFromError(t){return{error:t.message??"Unknown error"}}componentDidCatch(t,n){console.error("[ChatErrorBoundary]",t,n.componentStack)}render(){return this.state.error?r.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-3 p-8 text-center",children:[r.jsx("span",{className:"text-2xl",children:"⚠️"}),r.jsx("p",{className:"text-red-400 font-bold text-sm",children:"Chat render error"}),r.jsx("p",{className:"text-orange-200/70 text-xs font-mono max-w-sm break-all",children:this.state.error}),r.jsx("button",{onClick:()=>this.setState({error:null}),className:"mt-1 px-4 py-2 rounded-xl bg-orange-900/20 border border-orange-800/30 text-orange-200 text-xs font-bold hover:bg-orange-900/40 transition-all",children:"Retry"})]}):this.props.children}}const v0=[{id:"terminal",label:"Terminal",Icon:as},{id:"browser",label:"Browser",Icon:We},{id:"image-gen",label:"Görsel Üret",Icon:uv},{id:"web-search",label:"Web Search",Icon:Xt},{id:"file-manager",label:"Files",Icon:ps},{id:"code",label:"Code",Icon:hn},{id:"screen-sense",label:"Ekranı Gör",Icon:sf}];function dE({onSend:e,onStop:t,disabled:n}){const{t:s}=pt(),[i,a]=h.useState(""),[o,l]=h.useState(!1),[c,u]=h.useState(""),[d,p]=h.useState([]),[f,m]=h.useState([]),[b,y]=h.useState(!1),v=h.useRef(null),g=h.useRef(!1),x=h.useRef(null),w=h.useRef(null),j=typeof window<"u"&&!!(window.SpeechRecognition||window.webkitSpeechRecognition),k=()=>{const L=window.SpeechRecognition||window.webkitSpeechRecognition;if(!L)return;const z=new L;z.continuous=!0,z.interimResults=!0,z.lang="tr-TR",z.onresult=B=>{let C="",A="";for(let _=B.resultIndex;_<B.results.length;_++)B.results[_].isFinal?C+=B.results[_][0].transcript:A+=B.results[_][0].transcript;C?(a(_=>(_.trim()?_.trimEnd()+" ":"")+C.trim()),u("")):u(A)},z.onend=()=>{u(""),g.current?setTimeout(k,150):(l(!1),v.current=null)},z.onerror=B=>{B.error!=="no-speech"&&l(!1),u(""),g.current&&B.error!=="not-allowed"&&setTimeout(k,500)},v.current=z;try{z.start()}catch{}},N=()=>{var L;o?(g.current=!1,(L=v.current)==null||L.stop(),u("")):(g.current=!0,l(!0),k())},S=L=>{p(z=>[...z,...Array.from(L)])},E=L=>{const z=Array.from(L.clipboardData.files);z.length&&(L.preventDefault(),S(z))},P=L=>{L.preventDefault(),S(L.dataTransfer.files)},M=L=>p(z=>z.filter((B,C)=>C!==L));h.useEffect(()=>{if(!b)return;const L=z=>{w.current&&!w.current.contains(z.target)&&y(!1)};return document.addEventListener("mousedown",L),()=>document.removeEventListener("mousedown",L)},[b]);const T=async()=>{try{const L=await navigator.mediaDevices.getDisplayMedia({video:!0}),z=document.createElement("video");z.srcObject=L,z.muted=!0,await new Promise(C=>{z.onloadedmetadata=()=>{z.play(),C()}}),await new Promise(C=>setTimeout(C,120));const B=document.createElement("canvas");B.width=z.videoWidth,B.height=z.videoHeight,B.getContext("2d").drawImage(z,0,0),L.getTracks().forEach(C=>C.stop()),B.toBlob(C=>{if(!C)return;const A=new File([C],`ekran-${Date.now()}.png`,{type:"image/png"});S([A]),a(_=>_.trim()?_:"Bu ekranı analiz et ve ne gördüğünü açıkla."),ue.success("Ekran yakalandı — göndermek için ▶ basın.")},"image/png",.9)}catch(L){(L==null?void 0:L.name)!=="NotAllowedError"&&ue.error("Ekran yakalanamadı.")}},V=L=>{if(L==="screen-sense"){T(),y(!1);return}m(z=>z.includes(L)?z.filter(B=>B!==L):[...z,L])},R=()=>{var B;const L=i.trim();if(!L||n)return;o&&(g.current=!1,(B=v.current)==null||B.stop(),u(""));const z=[...d];a(""),p([]),e(L,f.length>0?f:void 0,z.length>0?z:void 0)};h.useEffect(()=>{x.current&&(x.current.style.height="auto",x.current.style.height=`${Math.min(x.current.scrollHeight,160)}px`)},[i]),h.useEffect(()=>{const L=z=>{var C;const B=((C=z.detail)==null?void 0:C.text)??"";a(B),setTimeout(()=>{var A;return(A=x.current)==null?void 0:A.focus()},60)};return window.addEventListener("mustb:prefill",L),()=>window.removeEventListener("mustb:prefill",L)},[]);const I=o?c||s.chat.listening:"What do you want to know?";return r.jsx("div",{className:"max-w-3xl mx-auto w-full",children:r.jsxs("div",{className:"glass-input rounded-2xl flex flex-col px-4 pt-3 pb-3 gap-2.5",onPaste:E,onDrop:P,onDragOver:L=>L.preventDefault(),children:[d.length>0&&r.jsx("div",{className:"flex flex-wrap gap-2 px-1",children:d.map((L,z)=>r.jsxs("div",{className:"relative group w-12 h-12",children:[L.type.startsWith("image/")?r.jsx("img",{src:URL.createObjectURL(L),alt:L.name,className:"w-12 h-12 object-cover rounded-lg border border-orange-500/20"}):r.jsx("div",{className:"w-12 h-12 rounded-lg border border-orange-500/20 bg-orange-500/10 flex items-center justify-center",children:r.jsx(Qt,{size:16,className:"text-orange-400"})}),r.jsx("button",{onClick:()=>M(z),className:"absolute -top-1 -right-1 w-4 h-4 rounded-full bg-red-500 text-white flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity",children:r.jsx(et,{size:9})})]},z))}),r.jsxs("div",{className:"flex items-end gap-2",children:[r.jsxs("div",{ref:w,className:"flex items-center gap-0.5 mb-0.5 shrink-0 relative",children:[r.jsx("button",{type:"button",onClick:()=>y(L=>!L),title:"Araçlar",className:`p-2 rounded-full transition-all ${b||f.length>0?"text-orange-400 bg-orange-500/15 border border-orange-500/25":"text-white/30 hover:text-white/70 hover:bg-white/8"}`,children:r.jsx(lf,{size:16})}),r.jsx(se,{children:b&&r.jsxs(H.div,{initial:{opacity:0,y:8,scale:.97},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:6,scale:.97},transition:{duration:.14,ease:[.22,1,.36,1]},className:"absolute bottom-full mb-2 left-0 z-50 w-52 rounded-2xl p-2 shadow-2xl",style:{background:"rgba(16,7,2,0.97)",border:"1px solid rgba(249,115,22,0.18)",backdropFilter:"blur(24px)"},children:[r.jsx("p",{className:"px-2.5 pt-1.5 pb-1 text-[9.5px] font-black uppercase tracking-[0.14em] text-orange-400/60",children:"Araçlar"}),v0.map(({id:L,label:z,Icon:B})=>{const C=f.includes(L);return r.jsxs("button",{onClick:()=>V(L),className:`w-full flex items-center gap-2.5 px-2.5 py-2 rounded-xl transition-all text-left ${C?"bg-orange-500/15 text-orange-300":"text-white/55 hover:bg-white/6 hover:text-white/90"}`,children:[r.jsx(B,{size:13,className:C?"text-orange-400":"text-white/30"}),r.jsx("span",{className:"text-[12px] font-medium",children:z}),C&&r.jsx("span",{className:"ml-auto w-3.5 h-3.5 rounded-full bg-orange-500/30 border border-orange-500/60 flex items-center justify-center text-[8px] text-orange-300",children:"✓"})]},L)})]})}),r.jsxs("label",{className:"p-2 rounded-full cursor-pointer text-white/30 hover:text-white/70 hover:bg-white/8 transition-all",title:s.chat.attachFile,children:[r.jsx(_C,{size:16}),r.jsx("input",{type:"file",multiple:!0,className:"hidden",onChange:L=>L.target.files&&S(L.target.files)})]})]}),r.jsx("textarea",{ref:x,value:i,onChange:L=>a(L.target.value),onKeyDown:L=>{L.key==="Enter"&&!L.shiftKey&&(L.preventDefault(),R())},placeholder:I,disabled:n,rows:1,className:"flex-1 bg-transparent text-white/90 placeholder-white/35 text-[15px] outline-none resize-none min-h-[28px] max-h-[160px] scrollbar-hide leading-relaxed"}),r.jsxs("div",{className:"flex items-center gap-1.5 mb-0.5 shrink-0",children:[j&&r.jsx("button",{onClick:N,title:o?"Stop dictation":"Start voice dictation (append mode)",className:`p-2 rounded-full transition-all ${o?"text-red-400 bg-red-500/15 border border-red-500/30 shadow-[0_0_10px_rgba(239,68,68,0.3)]":"text-white/40 hover:text-white/70 hover:bg-white/8"}`,children:o?r.jsx(nC,{size:17,className:"animate-pulse"}):r.jsx(Ds,{size:17})}),n?r.jsx("button",{onClick:t,title:"Durdur",className:"w-9 h-9 rounded-full flex items-center justify-center transition-all bg-red-600/80 hover:bg-red-500 text-white shadow-[0_0_12px_rgba(239,68,68,0.5)] active:scale-95",children:r.jsx(of,{size:14})}):r.jsx("button",{onClick:R,disabled:!i.trim(),className:`w-9 h-9 rounded-full flex items-center justify-center transition-all ${i.trim()?"bg-orange-600 hover:bg-orange-500 text-white shadow-[0_0_15px_rgba(249,115,22,0.4)] active:scale-95":"bg-white/10 text-white/25 cursor-not-allowed"}`,children:r.jsx(hv,{size:16})})]})]}),r.jsxs("div",{className:"flex items-center justify-between gap-2",children:[f.length>0?r.jsx("div",{className:"flex flex-wrap gap-1.5 flex-1",children:f.map(L=>{const z=v0.find(A=>A.id===L);if(!z)return null;const{Icon:B,label:C}=z;return r.jsxs("span",{className:"flex items-center gap-1 pl-2 pr-1 py-0.5 rounded-full bg-orange-500/15 border border-orange-500/25 text-orange-300 text-[11px] font-medium",children:[r.jsx(B,{size:10}),r.jsx("span",{children:C}),r.jsx("button",{type:"button",onClick:()=>V(L),className:"ml-0.5 p-0.5 rounded-full hover:bg-orange-500/20 text-orange-400/60 hover:text-orange-300 transition-colors",children:r.jsx(et,{size:9})})]},L)})}):r.jsx("div",{className:"flex-1"}),r.jsx(eE,{})]})]})})}function Ic(e){return`mustb_chat_turns_${e}`}function hE(){const{t:e,setLocale:t}=pt(),n=h.useRef(e);h.useEffect(()=>{n.current=e},[e]);const[s]=Yk(),i=mn(),a=s.get("chat")??"default",o=h.useRef(null),[l,c]=h.useState(null),[u,d]=h.useState(null),[p,f]=h.useState(""),[m,b]=h.useState(null),[y,v]=h.useState(()=>{try{const R=localStorage.getItem(Ic(a));if(R)return JSON.parse(R)}catch{}return[]}),g=h.useRef(null),x=h.useRef(null),w=h.useRef(a),[j,k]=h.useState(!1),[N,S]=h.useState(null),E=y.some(R=>R.kind==="assistant"&&R.status==="pending");h.useEffect(()=>{w.current=a;try{const R=localStorage.getItem(Ic(a));v(R?JSON.parse(R):[])}catch{v([])}g.current=null},[a]),h.useEffect(()=>{if(a==="default"||!o.current)return;const R=o.current;o.current=null,setTimeout(()=>T(R.text,R.tools,R.files),0)},[a]),h.useEffect(()=>{const R=at();return R.on("agentUpdate",I=>{const{type:L,...z}=I;if(L==="memorySearch")return;if(L==="planStart"){const A=`asst-${Date.now()}-${Math.random().toString(36).slice(2)}`;g.current=A,v(_=>[..._,{id:A,kind:"assistant",content:"",thoughts:[],steps:[],status:"pending",startedAt:Date.now()}]);return}if(L==="stepStart"){const A=g.current;if(!A)return;const _=z.step,U=(_==null?void 0:_.description)??sn(z.step);v(K=>K.map(Y=>Y.id===A?{...Y,steps:[...Y.steps??[],{label:U,status:"running"}]}:Y));return}if(L==="stepFinish"){const A=g.current;if(!A)return;const _=z.status==="error",U=z.step,K=(U==null?void 0:U.description)??"Step",Y=z.result!==void 0?sn(z.result):void 0,J=Y&&Y.length>120?Y.slice(0,120)+"…":Y;v(le=>le.map(oe=>{if(oe.id!==A)return oe;const re=[...oe.steps??[]],De=re.map(ot=>ot.status).lastIndexOf("running");return De>=0&&(re[De]={label:K,status:_?"error":"done",result:J}),{...oe,steps:re}}));return}if(L==="terminalLog"){const A=g.current;if(!A)return;const _=sn(z.line??"");if(!_)return;v(U=>U.map(K=>{if(K.id!==A)return K;const Y=[...K.steps??[]],J=Y.map(re=>re.status).lastIndexOf("running");if(J<0)return K;const le=Y[J],oe=le.logs??[];return oe.length>=100?K:(Y[J]={...le,logs:[...oe,_]},{...K,steps:Y})}));return}if(L==="finalAnswer"){const A=g.current;if(!A)return;v(_=>_.map(U=>U.id===A?{...U,content:sn(z.answer??"Done.")}:U));return}if(L==="planFinish"){k(!1);const A=g.current;if(!A)return;const _=z.status==="failed"?"error":"done",U=z.status==="completed"?{goal:String(z.goal??""),answer:String(z.answer??""),steps:z.steps??[]}:void 0;v(K=>K.map(Y=>Y.id===A?{...Y,status:_,...U?{workflow:U}:{}}:Y)),g.current=null;return}if(L==="professionResearched"){const A=String(z.profession??"");if(!A)return;const _=n.current.chat.professionAck.replace("{profession}",A);v(U=>[...U,{id:`prof-ack-${Date.now()}`,kind:"assistant",content:_,thoughts:[],status:"done"}]);return}const B=tE(L,z);if(!B)return;const C=g.current;C&&v(A=>A.map(_=>_.id===C?{..._,thoughts:[..._.thoughts,B]}:_))}),()=>{R.off("agentUpdate")}},[]),h.useEffect(()=>{var R;(R=x.current)==null||R.scrollIntoView({behavior:"smooth"})},[y]),h.useEffect(()=>{const R=I=>{var C;const L=(C=I.detail)==null?void 0:C.skill;if(!L)return;const B={"web-search":"Search the web for: ","web-fetch":"Fetch and summarize this URL: ",browser:"Open the browser and navigate to: ",pdf:"Read and summarize this PDF: ","image-analysis":"Analyze this image: ","image-generate":"Generate an image of: ",tts:"Convert this text to speech: ","spawn-agent":"Spawn a new agent to: ",sessions:"List all active agent sessions",canvas:"Open the canvas workspace",git:"Run a git operation: ",gateway:"Connect to Must-b gateway node: ","file-manager":"Open the file manager",cron:"Create a scheduled task: ",messages:"Check and reply to messages","memory-add":"Save this to memory: ",contacts:"Look up contact: ",calendar:"Check my calendar for: ",automations:"Create an automation that: ","scheduled-tasks":"List all scheduled tasks",commands:"Run this command: ",nodes:"List all gateway nodes","multi-agent":"Start a multi-agent workflow to: ","chat-focus":""}[L]??`Run skill "${L}": `;window.dispatchEvent(new CustomEvent("mustb:prefill",{detail:{text:B}}))};return window.addEventListener("mustb:invoke-skill",R),()=>window.removeEventListener("mustb:invoke-skill",R)},[]),h.useEffect(()=>{if(w.current===a)try{localStorage.setItem(Ic(a),JSON.stringify(y))}catch{}},[y,a]),h.useEffect(()=>{if(!j)return;let R=null;const I=setTimeout(()=>{R=setInterval(async()=>{try{const L=await $("/api/status");if(!L.ok)return;(await L.json()).busy===!1&&(R&&(clearInterval(R),R=null),k(!1),v(B=>B.map(C=>C.status!=="pending"?C:{...C,status:C.content?"done":"error",content:C.content||"Task completed but the result was not received (connection lost). Please retry if needed."})),g.current=null)}catch{}},5e3)},1e4);return()=>{clearTimeout(I),R&&clearInterval(R)}},[j]),h.useEffect(()=>{const R=y[y.length-1];if(!R||R.kind!=="assistant"||R.status!=="done"||!R.content)return;const I=[...y].reverse().find(z=>z.kind==="user");if(!I)return;const L=`Q: ${I.content}
722
- A: ${R.content.slice(0,400)}`;fetch("/api/memory/ltm/semantic",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:L,tags:["chat","autosave"]})}).catch(()=>{})},[y.length]);const P=R=>{const I=[[/\b(spanish mode|speak spanish|habla español|en español)\b/i,"es"],[/\b(french mode|speak french|en français|parle français)\b/i,"fr"],[/\b(german mode|speak german|auf deutsch|deutsch mode)\b/i,"de"],[/\b(japanese mode|speak japanese|日本語モード)\b/i,"ja"],[/\b(chinese mode|speak chinese|中文模式)\b/i,"zh"],[/\b(portuguese mode|fala português)\b/i,"pt"],[/\b(turkish mode|türkçe mode|türkçe konuş)\b/i,"tr"],[/\b(english mode|switch to english|speak english)\b/i,"en"]],L={tr:"Anlaşıldı, ayarlar kalıcı olarak güncellendi.",en:"Got it, settings updated permanently.",es:"Entendido, configuración actualizada permanentemente.",fr:"Compris, paramètres mis à jour définitivement.",de:"Verstanden, Einstellungen dauerhaft aktualisiert.",ja:"了解です。設定が永久に更新されました。",zh:"明白,设置已永久更新。",pt:"Entendido, configurações atualizadas permanentemente."};for(const[B,C]of I)if(B.test(R)){t(C);const A=L[C]??L.en;return v(_=>[..._,{id:`cfg-lang-${Date.now()}`,kind:"assistant",content:A,thoughts:[],status:"done"}]),!0}const z=[[/use\s+gpt[-\s]?4o?\b/i,"openai/gpt-4o"],[/use\s+(claude[-\s]?3\.5|claude[-\s]?sonnet|claude[-\s]?opus)\b/i,"anthropic/claude-3-5-sonnet"],[/use\s+(gemini[-\s]?flash|gemini[-\s]?pro|gemini)\b/i,"google/gemini-flash"],[/use\s+(llama[-\s]?3|llama)\b/i,"meta-llama/llama-3-70b-instruct:free"],[/use\s+mistral\b/i,"mistralai/mistral-7b-instruct:free"],[/use\s+deepseek\b/i,"deepseek/deepseek-chat"]];for(const[B,C]of z)if(B.test(R))return $("/api/settings/model",{method:"POST",body:JSON.stringify({model:C})}).catch(()=>{}),v(A=>[...A,{id:`cfg-model-${Date.now()}`,kind:"assistant",content:e.chat.settingsAck,thoughts:[],status:"done"}]),!0;return!1},M=R=>{const I=[[/\bi(?:'m| am)\s+a(?:n)?\s+(lawyer|attorney|solicitor|barrister)\b/i,"lawyer"],[/\bi(?:'m| am)\s+a(?:n)?\s+(doctor|physician|nurse|surgeon|pharmacist)\b/i,"medical"],[/\bi(?:'m| am)\s+a(?:n?)?\s+(software engineer|developer|programmer|coder)\b/i,"software-engineer"],[/\bi(?:'m| am)\s+a(?:n)?\s+(teacher|professor|educator|instructor)\b/i,"educator"],[/\bi(?:'m| am)\s+a(?:n)?\s+(accountant|auditor|financial advisor|analyst)\b/i,"finance"],[/\bi(?:'m| am)\s+a(?:n)?\s+(architect|civil engineer|structural engineer)\b/i,"engineering"],[/\bi(?:'m| am)\s+a(?:n)?\s+(designer|ux designer|graphic designer)\b/i,"designer"],[/\bi(?:'m| am)\s+a(?:n?)?\s+(data scientist|ml engineer|ai researcher)\b/i,"data-science"],[/\bben\s+bir?\s+avukat\b/i,"lawyer"],[/\bavukat(?:ım|ım)?\b/i,"lawyer"],[/\bben\s+bir?\s+doktor\b/i,"medical"],[/\bdoktor(?:um|um)?\b/i,"medical"],[/\bben\s+bir?\s+hemşire\b/i,"medical"],[/\bben\s+bir?\s+mühendis\b/i,"engineering"],[/\bmühendis(?:im|im)?\b/i,"engineering"],[/\bben\s+bir?\s+yazılımcı\b/i,"software-engineer"],[/\byazılımcı(?:yım|yım)?\b/i,"software-engineer"],[/\bben\s+bir?\s+öğretmen\b/i,"educator"],[/\böğretmen(?:im|im)?\b/i,"educator"],[/\bben\s+bir?\s+muhasebeci\b/i,"finance"],[/\bmuhasebeci(?:yim|yim)?\b/i,"finance"],[/\bben\s+bir?\s+tasarımcı\b/i,"designer"],[/\btasarımcı(?:yım|yım)?\b/i,"designer"],[/\bben\s+bir?\s+mimar\b/i,"engineering"],[/\bmimar(?:ım|ım)?\b/i,"engineering"]];for(const[L,z]of I)if(L.test(R)){$("/api/memory/profession-research",{method:"POST",body:JSON.stringify({profession:z,userMessage:R})}).catch(()=>{});break}},T=async(R,I,L)=>{if(R.startsWith("__GUIDANCE__")){const _=R.slice(12);v(U=>[...U,{id:`guidance-${Date.now()}`,kind:"assistant",content:`ℹ ${_}`,thoughts:[],status:"done"}]);return}if(P(R))return;M(R);let z=R;if(I!=null&&I.includes("image-gen")&&!R.toLowerCase().startsWith("generate")&&!R.toLowerCase().startsWith("create")&&(z=`Görsel oluştur: ${R}`),a==="default")try{const _=R.trim().split(/\s+/).slice(0,4).join(" "),U=await $("/api/chats",{method:"POST",body:JSON.stringify({title:_})});if(U.ok){const K=await U.json();o.current={text:z,tools:I,files:L},i(`/app?chat=${K.id}`);return}}catch{}if(!y.some(_=>_.kind==="user")&&a!=="default"){const _=R.trim().split(/\s+/).slice(0,4).join(" ");_&&$(`/api/chats/${a}`,{method:"PATCH",body:JSON.stringify({title:_})}).then(()=>{window.dispatchEvent(new CustomEvent("mustb:chat-renamed",{detail:{id:a,title:_}}))}).catch(()=>{})}v(_=>_.map(U=>({...U,workflow:void 0})));const C=L==null?void 0:L.filter(_=>_.type.startsWith("image/")).map(_=>URL.createObjectURL(_));v(_=>[..._,{id:`user-${Date.now()}`,kind:"user",content:R,thoughts:[],status:"done",...C!=null&&C.length?{attachments:C}:{}}]);const A={goal:z};if(I&&I.length>0&&(A.focus_tools=I),L&&L.length>0)try{A.attachments=await Promise.all(L.map(async _=>({name:_.name,type:_.type,data:await nE(_)})))}catch{}k(!0);try{await $("/api/goal",{method:"POST",body:JSON.stringify(A)})}catch{k(!1)}},V=y.length>0;return r.jsxs(uE,{children:[l&&r.jsx(cE,{src:l,onClose:()=>c(null)}),r.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[r.jsx("div",{className:"flex-1 overflow-y-auto scrollbar-hide",children:V?r.jsxs("div",{className:"max-w-3xl mx-auto w-full px-5 pt-6 pb-4",children:[y.map(R=>{if(R.kind==="user"){const _=u===R.id;return r.jsx("div",{className:"flex justify-end mb-5 group/userturn",children:r.jsxs("div",{className:_?"w-full max-w-3xl flex flex-col items-end gap-2":"max-w-[78%] flex flex-col items-end gap-2",children:[R.attachments&&R.attachments.length>0&&r.jsx("div",{className:"flex flex-wrap gap-2 justify-end",children:R.attachments.map((U,K)=>r.jsxs("div",{className:"relative group w-24 h-24 shrink-0",children:[r.jsx("img",{src:U,alt:`attachment-${K}`,onClick:()=>c(U),width:96,height:96,className:"w-24 h-24 object-cover rounded-xl border border-orange-500/25 hover:opacity-90 transition-opacity duration-150 cursor-zoom-in",style:{minWidth:96,minHeight:96}}),r.jsx("button",{onClick:Y=>{Y.stopPropagation(),T("Bu görseli analiz et ve açıkla",void 0,void 0)},title:"Düzenle / Analiz Et",className:"absolute bottom-1 right-1 w-6 h-6 flex items-center justify-center rounded-full bg-black/70 hover:bg-orange-600 opacity-0 group-hover:opacity-100 transition-all duration-150 text-white",children:r.jsx(o0,{size:11})})]},K))}),_?r.jsxs("div",{className:"w-full flex flex-col gap-2",children:[r.jsx("textarea",{autoFocus:!0,value:p,onChange:U=>f(U.target.value),onKeyDown:U=>{if(U.key==="Enter"&&!U.shiftKey){U.preventDefault();const K=p.trim();if(!K)return;const Y=y.findIndex(J=>J.id===R.id);v(J=>J.slice(0,Y)),d(null),setTimeout(()=>T(K),0)}U.key==="Escape"&&d(null)},rows:Math.min(8,p.split(`
723
- `).length+1),className:"w-full rounded-2xl px-5 py-3 text-white text-[14px] leading-relaxed resize-none outline-none",style:{background:"rgba(25,10,2,0.85)",border:"1px solid rgba(249,115,22,0.5)",backdropFilter:"blur(12px)"}}),r.jsxs("div",{className:"flex gap-2 justify-end",children:[r.jsx("button",{onClick:()=>d(null),className:"px-3 py-1.5 rounded-xl text-[12px] text-white/40 hover:text-white/70 border border-white/10 hover:bg-white/5 transition-all",children:"Cancel"}),r.jsx("button",{onClick:()=>{const U=p.trim();if(!U)return;const K=y.findIndex(Y=>Y.id===R.id);v(Y=>Y.slice(0,K)),d(null),setTimeout(()=>T(U),0)},className:"px-3 py-1.5 rounded-xl text-[12px] bg-orange-600 hover:bg-orange-500 text-white font-semibold transition-all",children:"Resend"})]})]}):r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"rounded-2xl rounded-br-sm px-5 py-3 text-white text-[14px] leading-relaxed whitespace-pre-wrap",style:{background:"rgba(25,10,2,0.72)",border:"1px solid rgba(249,115,22,0.22)",backdropFilter:"blur(12px)"},children:R.content}),r.jsxs("div",{className:"flex gap-1 opacity-0 group-hover/userturn:opacity-100 transition-opacity duration-150",children:[r.jsx("button",{onClick:()=>{navigator.clipboard.writeText(R.content).catch(()=>{}),b(R.id),setTimeout(()=>b(null),2e3)},title:"Copy message",className:"flex items-center gap-1 px-2 py-1 rounded-lg text-[11px] text-white/30 hover:text-white/70 hover:bg-white/6 border border-white/6 transition-all",children:m===R.id?r.jsxs(r.Fragment,{children:[r.jsx(zt,{size:10,className:"text-green-400"}),r.jsx("span",{className:"text-green-400",children:"Copied"})]}):r.jsxs(r.Fragment,{children:[r.jsx(aa,{size:10}),"Copy"]})}),r.jsxs("button",{onClick:()=>{d(R.id),f(R.content)},title:"Edit and resend",className:"flex items-center gap-1 px-2 py-1 rounded-lg text-[11px] text-white/30 hover:text-orange-400 hover:bg-orange-500/8 border border-white/6 transition-all",children:[r.jsx(o0,{size:10}),"Edit"]})]})]})]})},R.id)}const I=R.thoughts.length>0,L=R.content.length>0,z=R.status==="pending",B=R.status==="error"&&!L,C=R.steps??[],A=C.length>0;return r.jsxs("div",{className:"mb-8",children:[r.jsxs("div",{className:"flex items-center gap-2 mb-2.5",children:[r.jsxs("div",{className:"relative w-5 h-5 shrink-0",children:[r.jsx("div",{className:"absolute inset-0 bg-orange-600/30 rounded-full blur-sm"}),r.jsx("img",{src:"/logo.png",alt:"Must-b",className:"w-full h-full object-contain relative z-10"})]}),r.jsx("span",{className:"text-[12px] font-semibold text-white/70 tracking-wide",children:"Must-b"}),I&&r.jsxs("span",{className:"text-[10px] text-white/35 font-mono",children:[R.thoughts.length," step",R.thoughts.length!==1?"s":""]})]}),A&&r.jsxs("div",{className:"mb-3 rounded-xl overflow-hidden",style:{background:"rgba(0,0,0,0.35)",border:"1px solid rgba(255,255,255,0.06)"},children:[r.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1.5 border-b border-white/5",children:[r.jsx(as,{size:10,className:"text-orange-400/60 shrink-0"}),r.jsx("span",{className:"text-[10px] font-mono text-orange-400/50 tracking-widest uppercase",children:"execution log"}),z&&r.jsxs("div",{className:"ml-auto flex items-center gap-2 shrink-0",children:[r.jsx(aE,{startedAt:R.startedAt}),r.jsx(ne,{size:10,className:"animate-spin text-orange-400/50 shrink-0"})]})]}),r.jsx("div",{className:"px-3 py-2 space-y-2",children:C.map((_,U)=>r.jsxs("div",{children:[r.jsxs("div",{className:"flex items-start gap-2 font-mono text-[11px] leading-relaxed",children:[_.status==="running"&&r.jsx(ne,{size:11,className:"animate-spin text-orange-400 shrink-0 mt-0.5"}),_.status==="done"&&r.jsx(Ve,{size:11,className:"text-emerald-400 shrink-0 mt-0.5"}),_.status==="error"&&r.jsx("span",{className:"text-red-400 shrink-0 leading-none mt-0.5",children:"✗"}),r.jsxs("span",{className:_.status==="running"?"text-orange-300/90":_.status==="done"?"text-white/45":"text-red-300/70",children:[_.label,_.result&&r.jsxs("span",{className:"text-white/25",children:[" → ",_.result]})]})]}),_.logs&&_.logs.length>0&&r.jsx(oE,{logs:_.logs,isRunning:_.status==="running"})]},U))})]}),I&&r.jsxs("details",{className:"mb-3 group",style:{background:"rgba(255,255,255,0.025)",borderRadius:"10px",padding:"6px 10px"},children:[r.jsxs("summary",{className:"flex items-center gap-1.5 cursor-pointer list-none select-none w-fit",children:[r.jsx(dn,{size:10,className:"text-orange-400/50 group-open:rotate-90 transition-transform duration-150 flex-shrink-0"}),r.jsxs("span",{className:"text-[10px] font-semibold text-orange-300/50 hover:text-orange-300/80 transition-colors tracking-wide uppercase",children:[R.thoughts.length," detail",R.thoughts.length!==1?"s":""," · Thought process"]})]}),r.jsx("div",{className:"mt-2 ml-3.5 pl-3 border-l border-orange-500/15 space-y-1",children:R.thoughts.map((_,U)=>r.jsx("p",{className:"text-[11px] font-mono text-white/30 leading-relaxed break-all",children:_},U))})]}),L?r.jsxs("div",{className:"w-full py-2",children:[r.jsx(rE,{text:R.content,dark:!0}),r.jsx("div",{className:"flex justify-end mt-3",children:r.jsx("button",{onClick:()=>{navigator.clipboard.writeText(R.content).catch(()=>{}),S(R.id),setTimeout(()=>S(null),2e3)},className:"flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg text-white/30 hover:text-white/70 hover:bg-white/6 text-[11px] transition-all border border-white/6",children:N===R.id?r.jsxs(r.Fragment,{children:[r.jsx(zt,{size:12,className:"text-green-400"})," Kopyalandı"]}):r.jsxs(r.Fragment,{children:[r.jsx(aa,{size:12})," Kopyala"]})})})]}):z?A?null:r.jsxs("div",{className:"flex items-center gap-2 py-2 px-1",children:[[0,120,240].map(_=>r.jsx("div",{className:"w-1.5 h-1.5 rounded-full animate-bounce",style:{background:"rgba(251,146,60,0.7)",animationDelay:`${_}ms`}},_)),r.jsx("span",{className:"text-[11px] text-white/25 ml-1",children:"Planning…"}),r.jsx(iE,{})]}):B?r.jsxs("div",{className:"rounded-xl px-4 py-3 flex items-center gap-2",style:{background:"rgba(239,68,68,0.08)",border:"1px solid rgba(239,68,68,0.2)"},children:[r.jsx("span",{className:"text-red-400 text-sm",children:"⚠"}),r.jsx("p",{className:"text-sm text-red-300/80",children:"Something went wrong. Please try again."})]}):null,r.jsx(se,{children:R.workflow&&!z&&r.jsx(lE,{workflow:R.workflow,onDismiss:()=>v(_=>_.map(U=>U.id===R.id?{...U,workflow:void 0}:U))})})]},R.id)}),r.jsx("div",{ref:x,className:"h-2"})]}):r.jsx("div",{className:"flex flex-col items-center justify-center h-full px-6 select-none",children:r.jsx(se,{children:r.jsx(H.div,{initial:{opacity:0,y:16},animate:{opacity:1,y:0},exit:{opacity:0,y:-10,scale:.96},transition:{duration:.55,ease:"easeOut"},className:"flex flex-col items-center gap-4 mb-10",children:r.jsx("span",{className:"font-black tracking-tighter select-none leading-none px-2 w-full text-center",style:{fontSize:"clamp(56px, 16vw, 120px)",background:"linear-gradient(135deg, rgba(249,115,22,0.92) 0%, rgba(253,186,116,0.75) 40%, rgba(255,255,255,0.30) 100%)",WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent",backgroundClip:"text",paddingBottom:"0.05em",paddingRight:"20px"},children:"Must-b"})},"hero")})})}),r.jsxs("div",{className:"shrink-0 px-4 pb-3 pt-2",children:[r.jsx(dE,{onSend:(R,I,L)=>T(R,I,L),onStop:()=>{k(!1),$("/api/goal/abort",{method:"POST"}).catch(()=>{}),v(R=>R.map(I=>{if(I.status!=="pending")return I;const L=I.content||(I.thoughts.length>0?`⏹ Durduruldu.
719
+ transition-all duration-300 disabled:opacity-50 select-none`,animate:{y:[0,-6,0]},transition:{duration:4,repeat:1/0,ease:"easeInOut"},whileHover:{scale:1.04},whileTap:{scale:.97},children:[r.jsx("span",{className:"text-[15px] font-bold tracking-wider",children:t.welcome.wakeBtn}),r.jsx("div",{className:"w-8 h-8 rounded-full bg-orange-500/20 border border-orange-500/40 flex items-center justify-center",children:r.jsx(tC,{size:14,className:"text-orange-400"})})]}),r.jsx("p",{className:"text-white/20 text-[11px] tracking-widest uppercase select-none",children:t.welcome.wakeHint})]})]},"sleep-screen")}),r.jsx(se,{children:n==="exiting"&&r.jsx(H.div,{className:"fixed inset-0 z-50 pointer-events-none",style:{background:"linear-gradient(180deg, #1a0802 0%, #f97316 40%, #0d0602 100%)"},initial:{opacity:0},animate:{opacity:1},transition:{duration:.45}})})]})}function vv(e){var t,n,s="";if(typeof e=="string"||typeof e=="number")s+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=vv(e[t]))&&(s&&(s+=" "),s+=n)}else for(n in e)e[n]&&(s&&(s+=" "),s+=n);return s}function Xe(){for(var e,t,n=0,s="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=vv(e))&&(s&&(s+=" "),s+=t);return s}const QC={frontier:"⚡ Frontier",gateway:"🌐 Gateway",fast:"🚀 Fast Inference",local:"💻 Local / Offline",open:"🔓 Open Source Cloud",specialist:"🎯 Specialist",regional:"🌏 Regional",enterprise:"🏢 Enterprise",custom:"⚙️ Custom"},JC=["frontier","gateway","fast","local","open","specialist","regional","enterprise","custom"],u0=[{value:"en-US",label:"English (US)"},{value:"tr-TR",label:"Türkçe"},{value:"de-DE",label:"Deutsch"},{value:"es-ES",label:"Español"},{value:"fr-FR",label:"Français"},{value:"zh-CN",label:"中文 (简体)"},{value:"ja-JP",label:"日本語"},{value:"ar-SA",label:"العربية"}],bo=["Identity","AI Engine","Workspace","Voice","Channels","Finalize"],Rc=[{id:"meta-llama/llama-4-scout:free",label:"Llama 4 Scout (Free)",desc:"Meta's latest · 10M ctx · fast & free",free:!0},{id:"nvidia/llama-3.1-nemotron-ultra-253b:free",label:"Nemotron Ultra 253B (Free)",desc:"NVIDIA's flagship open-source model — highly capable",free:!0},{id:"meta-llama/llama-4-maverick:free",label:"Llama 4 Maverick (Free)",desc:"Meta's latest Llama 4 release — free tier",free:!0},{id:"mistralai/mistral-small-3.1-24b-instruct:free",label:"Mistral Small 3.1 (Free)",desc:"Mistral's efficient 24B instruction model",free:!0},{id:"deepseek/deepseek-r1:free",label:"DeepSeek R1 (Free)",desc:"Strong reasoning model — open weights",free:!0},{id:"openai/gpt-4o-mini",label:"GPT-4o Mini",desc:"OpenAI's fast & affordable flagship mini",free:!1},{id:"anthropic/claude-3-5-haiku",label:"Claude 3.5 Haiku",desc:"Anthropic's fastest Claude model",free:!1},{id:"google/gemini-flash-1.5",label:"Gemini Flash 1.5",desc:"Google's ultra-fast flash model",free:!1}],d0=[{id:"telegram",label:"Telegram",emoji:"✈️",hint:"Create a bot at t.me/BotFather",fields:[{key:"TELEGRAM_BOT_TOKEN",label:"Bot Token",placeholder:"123456789:AAF...",secret:!0}]},{id:"discord",label:"Discord",emoji:"🎮",hint:"discord.com/developers → Applications",fields:[{key:"DISCORD_BOT_TOKEN",label:"Bot Token",placeholder:"MT…",secret:!0},{key:"DISCORD_CLIENT_ID",label:"Client ID",placeholder:"012…",secret:!1}]},{id:"slack",label:"Slack",emoji:"💬",hint:"api.slack.com/apps → OAuth & Permissions",fields:[{key:"SLACK_BOT_TOKEN",label:"Bot Token",placeholder:"xoxb-…",secret:!0},{key:"SLACK_SIGNING_SECRET",label:"Signing Secret",placeholder:"abc123…",secret:!0}]},{id:"whatsapp",label:"WhatsApp",emoji:"📱",hint:"developers.facebook.com → WhatsApp",fields:[{key:"WHATSAPP_API_KEY",label:"API Token",placeholder:"EAA…",secret:!0},{key:"WHATSAPP_PHONE_ID",label:"Phone ID",placeholder:"1234567890",secret:!1}]}];function ZC({index:e,current:t}){const n=e<t,s=e===t;return r.jsxs("div",{className:"flex items-center",children:[r.jsx("div",{className:Xe("w-8 h-8 rounded-full flex items-center justify-center text-xs font-bold transition-all duration-300",n?"bg-orange-500 text-white":s?"bg-orange-500/20 border-2 border-orange-500 text-orange-400":"bg-white/5 border border-white/10 text-gray-400"),children:n?r.jsx(zt,{size:13}):e+1}),e<bo.length-1&&r.jsx("div",{className:Xe("w-8 h-px transition-colors duration-300",n?"bg-orange-500/50":"bg-white/10")})]})}function e3({label:e}){return r.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-bold bg-white/5 text-gray-400 border border-white/8",children:e})}function t3({fit:e}){return e==="recommended"?r.jsxs("span",{className:"flex items-center gap-1 text-[10px] font-bold text-green-400 bg-green-500/10 border border-green-500/20 px-1.5 py-0.5 rounded",children:[r.jsx(zt,{size:9})," Recommended"]}):e==="marginal"?r.jsxs("span",{className:"flex items-center gap-1 text-[10px] font-bold text-orange-400 bg-orange-500/10 border border-orange-500/20 px-1.5 py-0.5 rounded",children:[r.jsx(ze,{size:9})," Marginal"]}):r.jsxs("span",{className:"flex items-center gap-1 text-[10px] font-bold text-red-400 bg-red-500/10 border border-red-500/20 px-1.5 py-0.5 rounded",children:[r.jsx(os,{size:9})," Heavy"]})}function h0({checked:e,onChange:t,label:n,description:s}){return r.jsxs("button",{type:"button",onClick:()=>t(!e),className:Xe("w-full flex items-center gap-4 px-4 py-4 rounded-xl border transition-all text-left",e?"bg-orange-500/10 border-orange-500/30 text-white":"bg-white/3 border-white/8 text-gray-400 hover:border-white/20 hover:text-white"),children:[r.jsx("div",{className:Xe("relative flex-shrink-0 w-11 h-6 rounded-full transition-colors duration-200",e?"bg-orange-500":"bg-white/15"),children:r.jsx("div",{className:Xe("absolute top-1 w-4 h-4 rounded-full bg-white shadow transition-all duration-200",e?"left-6":"left-1")})}),r.jsxs("div",{children:[r.jsx("p",{className:"font-semibold text-sm",children:n}),s&&r.jsx("p",{className:"text-xs text-gray-400 mt-0.5",children:s})]})]})}function n3(){var Qr,Zt;mn();const[e,t]=h.useState([]),[n,s]=h.useState([]),[i,a]=h.useState(null),[o,l]=h.useState(!0),[c,u]=h.useState("~/Mustb-Projects"),[d,p]=h.useState(0),[f,m]=h.useState(""),[v,y]=h.useState("en-US"),[b,g]=h.useState("openrouter"),[x,w]=h.useState(""),[j,k]=h.useState(""),[N,S]=h.useState(Rc[0].id),[E,P]=h.useState(Rc),[A,T]=h.useState(!1),[V,R]=h.useState("http://localhost:11434"),[I,L]=h.useState(""),[z,B]=h.useState(""),[C,M]=h.useState(!1),[_,U]=h.useState(!1),[K,Y]=h.useState({}),[J,ce]=h.useState({}),[oe,re]=h.useState({}),[De,ot]=h.useState("idle"),[G,Q]=h.useState(!1),[Lt,Xr]=h.useState(null);h.useEffect(()=>{fetch("/api/setup/providers").then(O=>O.ok?O.json():{providers:[]}).then(O=>{var ee;(ee=O.providers)!=null&&ee.length&&t(O.providers)}).catch(()=>{}).finally(()=>l(!1)),fetch("/api/setup/workspace-default").then(O=>O.ok?O.json():null).then(O=>{O!=null&&O.suggested&&(u(O.suggested),B(O.suggested))}).catch(()=>{})},[]),h.useEffect(()=>{b==="openrouter"&&(T(!0),fetch("/api/openrouter/free-models").then(O=>O.ok?O.json():null).then(O=>{if(O!=null&&O.models&&O.models.length>0){const ee=O.models.slice(0,16).map(Ie=>({id:Ie.id,label:Ie.label??Ie.name??Ie.id,desc:Ie.desc??Ie.description??"",free:Ie.id.endsWith(":free")})),Z=new Set(ee.map(Ie=>Ie.id)),_e=Rc.filter(Ie=>!Z.has(Ie.id));P([...ee,..._e])}}).catch(()=>{}).finally(()=>T(!1)))},[b]),h.useEffect(()=>{b==="ollama"&&fetch("/api/setup/ollama-models").then(O=>O.ok?O.json():null).then(O=>{O!=null&&O.models&&s(O.models),O!=null&&O.hardware&&a(O.hardware)}).catch(()=>{})},[b]);const Gs=b==="ollama",tt=e.find(O=>O.id===b),qs=h.useMemo(()=>{const O=x.toLowerCase().trim();return O?e.filter(ee=>ee.label.toLowerCase().includes(O)||ee.description.toLowerCase().includes(O)||ee.tags.some(Z=>Z.toLowerCase().includes(O))):e},[e,x]),Vl=h.useMemo(()=>{const O={};for(const ee of qs)O[ee.category]||(O[ee.category]=[]),O[ee.category].push(ee);return O},[qs]),Ys=()=>{switch(d){case 0:return f.trim().length>0;case 1:{if(Gs){const O=n.length===0||I.trim().length>0;return V.trim().length>0&&O}return b==="openrouter"?j.trim().length>0&&N.trim().length>0:tt!=null&&tt.envKeyIsUrl?!0:j.trim().length>0}case 2:return z.trim().length>0;default:return!0}},$l=async()=>{ot("testing");try{(await navigator.mediaDevices.getUserMedia({audio:!0})).getTracks().forEach(ee=>ee.stop()),ot("granted")}catch{ot("denied")}},wa=async O=>{re(ee=>({...ee,[O]:"testing"}));try{const Z=await(await fetch(`/api/channels/${O}/status`)).json().catch(()=>({}));re(_e=>({..._e,[O]:Z.configured?"ok":"fail"}))}catch{re(ee=>({...ee,[O]:"fail"}))}},ms=async()=>{Q(!0),Xr(null);try{const O={};for(const _e of d0)if(K[_e.id]){for(const Ie of _e.fields){const ka=(J[Ie.key]??"").trim();ka&&(O[Ie.key]=ka)}O[`CHANNEL_${_e.id.toUpperCase()}_ENABLED`]="true"}const ee={name:f.trim()||"User",language:v,provider:b,apiKey:Gs?V:j,model:Gs?I:b==="openrouter"?N:tt==null?void 0:tt.defaultModel,skills:["browser","terminal","memory","web_search","filesystem","git","vision","input","telegram","analyzer"],mode:"local",workspacePath:z.trim()||c,wakeWord:C,telemetry:_,channels:O};let Z=await fetch("/api/setup/save",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(ee)});if(!Z.ok&&Z.status===404&&(Z=await fetch("/api/setup",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(ee)})),!Z.ok){const _e=await Z.json().catch(()=>({}));throw new Error(_e.error??"Setup failed")}localStorage.setItem("mustb_boot_report","1"),localStorage.setItem("mustb_setup_complete","1"),window.location.href="/app"}catch(O){Xr(O instanceof Error?O.message:"Unknown error"),Q(!1)}};return r.jsxs("div",{className:"min-h-screen bg-[#02040a] flex flex-col items-center justify-center px-4 py-12 relative overflow-hidden",children:[r.jsx("div",{className:"absolute inset-0 pointer-events-none",children:r.jsx("div",{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[600px] h-[600px] bg-orange-900/12 rounded-full blur-[120px]"})}),r.jsxs("div",{className:"relative z-10 w-full max-w-xl",children:[r.jsxs("div",{className:"text-center mb-8",children:[r.jsx("div",{className:"flex justify-center mb-4",children:r.jsxs("div",{className:"relative w-14 h-14",children:[r.jsx("div",{className:"absolute inset-0 bg-orange-500 rounded-full blur-lg opacity-40 animate-pulse"}),r.jsx("img",{src:"/logo.png",alt:"Must-b",className:"w-full h-full object-contain relative z-10"})]})}),r.jsx("h1",{className:"text-3xl font-extrabold text-white tracking-tight",children:"Setup Must-b"}),r.jsx("p",{className:"text-gray-400 mt-1.5 text-sm",children:"First-time configuration · 6 steps"})]}),r.jsx("div",{className:"flex justify-center items-center mb-6",children:bo.map((O,ee)=>r.jsxs("div",{className:"flex flex-col items-center gap-1",children:[r.jsx(ZC,{index:ee,current:d}),r.jsx("span",{className:Xe("text-[9px] font-bold uppercase tracking-widest transition-colors",ee===d?"text-orange-400":ee<d?"text-orange-500/50":"text-gray-700"),children:O})]},ee))}),r.jsx(se,{mode:"wait",children:r.jsxs(H.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},exit:{opacity:0,x:-20},transition:{duration:.18},className:"glass rounded-2xl p-6 border border-white/8",children:[r.jsxs("p",{className:"text-[10px] font-bold text-orange-500/60 uppercase tracking-widest mb-1",children:["Step ",d+1," of ",bo.length]}),r.jsx("h2",{className:"text-xl font-bold text-white mb-5",children:bo[d]}),d===0&&r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx("label",{className:"text-xs text-gray-400 uppercase tracking-widest font-bold",children:"Your name"}),r.jsx("input",{autoFocus:!0,type:"text",value:f,onChange:O=>m(O.target.value),onKeyDown:O=>O.key==="Enter"&&Ys()&&p(1),placeholder:"e.g. Burak",className:"w-full bg-white/5 border border-white/10 rounded-xl px-4 py-3 text-white placeholder-gray-600 focus:outline-none focus:ring-1 focus:ring-orange-500/50 transition-all text-base"}),r.jsx("p",{className:"text-gray-400 text-xs",children:"Used in greetings and memory. Editable anytime in Settings."})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx("label",{className:"text-xs text-gray-400 uppercase tracking-widest font-bold",children:"Language"}),r.jsxs("div",{className:"relative",children:[r.jsx(We,{size:14,className:"absolute left-3.5 top-1/2 -translate-y-1/2 text-gray-400 pointer-events-none"}),r.jsx("select",{value:v,onChange:O=>y(O.target.value),className:"w-full bg-white/5 border border-white/10 rounded-xl pl-9 pr-4 py-3 text-white focus:outline-none focus:ring-1 focus:ring-orange-500/50 transition-all text-sm appearance-none cursor-pointer",children:u0.map(O=>r.jsx("option",{value:O.value,className:"bg-[#0d1117] text-white",children:O.label},O.value))}),r.jsx(dn,{size:13,className:"absolute right-3.5 top-1/2 -translate-y-1/2 text-gray-400 pointer-events-none rotate-90"})]})]})]}),d===1&&r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"relative",children:[r.jsx(Xt,{size:13,className:"absolute left-3 top-1/2 -translate-y-1/2 text-gray-400"}),r.jsx("input",{type:"text",value:x,onChange:O=>w(O.target.value),placeholder:"Search providers…",className:"w-full bg-white/5 border border-white/10 rounded-xl pl-9 pr-4 py-2.5 text-white placeholder-gray-600 focus:outline-none focus:ring-1 focus:ring-orange-500/50 text-sm"})]}),r.jsxs("div",{className:"max-h-[260px] overflow-y-auto space-y-4 pr-1 scrollbar-thin scrollbar-thumb-white/10 scrollbar-track-transparent",children:[o?r.jsx("p",{className:"text-center py-6 text-gray-400 text-sm",children:"Loading providers…"}):JC.map(O=>{const ee=Vl[O];return ee!=null&&ee.length?r.jsxs("div",{children:[r.jsx("p",{className:"text-[10px] font-bold text-gray-400 uppercase tracking-widest mb-1.5 px-1",children:QC[O]}),r.jsx("div",{className:"space-y-1",children:ee.map(Z=>r.jsxs("button",{onClick:()=>{g(Z.id),k("")},className:Xe("w-full flex items-center gap-3 px-3 py-2.5 rounded-xl border transition-all text-left",b===Z.id?"bg-orange-500/10 border-orange-500/40 text-white":"bg-white/3 border-white/8 text-gray-400 hover:border-white/20 hover:text-white"),children:[r.jsx("div",{className:Xe("w-3 h-3 rounded-full border-2 flex-shrink-0 transition-all",b===Z.id?"border-orange-500 bg-orange-500":"border-gray-600")}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("p",{className:"font-semibold text-sm leading-tight",children:Z.label}),r.jsx("p",{className:"text-xs text-gray-400 truncate",children:Z.description})]}),r.jsx("div",{className:"flex flex-wrap gap-1 justify-end flex-shrink-0 max-w-[120px]",children:Z.tags.slice(0,2).map(_e=>r.jsx(e3,{label:_e},_e))})]},Z.id))})]},O):null}),!o&&qs.length===0&&r.jsxs("p",{className:"text-center py-6 text-gray-400 text-sm",children:['No providers match "',x,'"']})]}),Gs?r.jsxs("div",{className:"space-y-3 pt-1 border-t border-white/6",children:[r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("label",{className:"text-xs text-gray-400 uppercase tracking-widest font-bold",children:"Ollama Base URL"}),r.jsx("input",{type:"url",value:V,onChange:O=>R(O.target.value),placeholder:"http://localhost:11434",className:"w-full bg-white/5 border border-white/10 rounded-xl px-4 py-2.5 text-white placeholder-gray-600 focus:outline-none focus:ring-1 focus:ring-orange-500/50 font-mono text-sm"})]}),i&&r.jsxs("div",{className:"flex items-center gap-4 rounded-xl bg-white/3 border border-white/8 px-3 py-2 text-xs text-gray-400",children:[r.jsxs("span",{className:"flex items-center gap-1.5",children:[r.jsx(lv,{size:11,className:"text-orange-400"}),i.ramGb.toFixed(1)," GB RAM"]}),r.jsxs("span",{className:"flex items-center gap-1.5",children:[r.jsx(fn,{size:11,className:"text-orange-400"}),i.cpuCount," CPUs"]}),r.jsxs("span",{className:"flex items-center gap-1.5",children:[r.jsx(ze,{size:11,className:"text-orange-400"}),"Score ",i.score," · ",i.tier]})]}),n.length>0&&r.jsx("div",{className:"max-h-[180px] overflow-y-auto space-y-1.5 pr-1",children:n.map(O=>r.jsxs("button",{onClick:()=>L(O.modelId),className:Xe("w-full flex items-center gap-3 px-3 py-2.5 rounded-xl border transition-all text-left",I===O.modelId?"bg-orange-500/10 border-orange-500/40 text-white":"bg-white/3 border-white/8 text-gray-400 hover:border-white/20 hover:text-white"),children:[r.jsx("div",{className:Xe("w-3 h-3 rounded-full border-2 flex-shrink-0",I===O.modelId?"border-orange-500 bg-orange-500":"border-gray-600")}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("p",{className:"font-semibold text-sm",children:O.name}),r.jsx("span",{className:"text-[10px] text-gray-400 font-mono",children:O.params})]}),r.jsx("p",{className:"text-xs text-gray-400 truncate",children:O.description})]}),r.jsxs("div",{className:"flex flex-col items-end gap-1 flex-shrink-0",children:[r.jsx(t3,{fit:O.fit}),r.jsxs("span",{className:"text-[10px] text-gray-400",children:[O.ramGb," GB"]})]})]},O.id))})]}):tt?r.jsxs("div",{className:"space-y-2 pt-1 border-t border-white/6",children:[r.jsx("label",{className:"text-xs text-gray-400 uppercase tracking-widest font-bold",children:tt.envKeyIsUrl?"Base URL":`${tt.label} API Key`}),r.jsx("input",{type:tt.envKeyIsUrl?"url":"password",value:j,onChange:O=>k(O.target.value),placeholder:tt.placeholder,className:"w-full bg-white/5 border border-white/10 rounded-xl px-4 py-2.5 text-white placeholder-gray-600 focus:outline-none focus:ring-1 focus:ring-orange-500/50 font-mono text-sm"}),b==="openrouter"&&r.jsxs("div",{className:"space-y-2 pt-2",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("label",{className:"text-xs text-gray-400 uppercase tracking-widest font-bold flex-1",children:"Select Model"}),A&&r.jsx("span",{className:"text-[10px] text-orange-400/60 animate-pulse",children:"Loading live models…"}),r.jsx("span",{className:"text-[10px] text-green-500/60",children:"✓ Offline list always ready"})]}),r.jsx("div",{className:"max-h-[200px] overflow-y-auto space-y-1.5 pr-1",children:E.map(O=>r.jsxs("button",{type:"button",onClick:()=>S(O.id),className:Xe("w-full flex items-start gap-3 px-3 py-2.5 rounded-xl border transition-all text-left",N===O.id?"bg-orange-500/12 border-orange-500/40 text-white":"bg-white/3 border-white/8 text-gray-400 hover:border-white/20 hover:text-white"),children:[r.jsx("div",{className:Xe("w-3 h-3 rounded-full border-2 flex-shrink-0 mt-0.5",N===O.id?"border-orange-500 bg-orange-500":"border-gray-600")}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[r.jsx("p",{className:"font-semibold text-sm leading-tight",children:O.label}),O.free&&r.jsx("span",{className:"text-[9px] font-bold px-1.5 py-0.5 rounded bg-green-500/15 text-green-400 border border-green-500/20",children:"FREE"})]}),r.jsx("p",{className:"text-[11px] text-gray-500 truncate",children:O.desc})]})]},O.id))}),!N&&r.jsxs("p",{className:"text-xs text-orange-400 flex items-center gap-1.5",children:[r.jsx(os,{size:11})," Select a model to continue"]})]}),b!=="openrouter"&&tt.latestModels.length>0&&r.jsx("div",{className:"flex flex-wrap gap-1.5 pt-1",children:tt.latestModels.slice(0,4).map(O=>r.jsx("span",{className:"text-[11px] font-mono text-orange-400/60 bg-orange-500/5 border border-orange-500/10 px-2 py-0.5 rounded-lg",children:O},O))}),r.jsxs("p",{className:"text-gray-400 text-xs",children:["Stored locally in ",r.jsx("code",{className:"text-orange-500/60",children:".env"})," — never sent to external servers."]})]}):null]}),d===2&&r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx("label",{className:"text-xs text-gray-400 uppercase tracking-widest font-bold",children:"Workspace Directory"}),r.jsxs("div",{className:"relative",children:[r.jsx(uC,{size:13,className:"absolute left-3.5 top-1/2 -translate-y-1/2 text-gray-400 pointer-events-none"}),r.jsx("input",{autoFocus:!0,type:"text",value:z,onChange:O=>B(O.target.value),placeholder:c,className:"w-full bg-white/5 border border-white/10 rounded-xl pl-9 pr-4 py-3 text-white placeholder-gray-600 focus:outline-none focus:ring-1 focus:ring-orange-500/50 font-mono text-sm"})]}),r.jsxs("p",{className:"text-gray-400 text-xs",children:["Must-b will read and write files ",r.jsx("span",{className:"text-orange-500/70 font-medium",children:"only within this directory"}),". The folder will be created if it doesn't exist."]})]}),r.jsxs("div",{className:"flex items-start gap-3 rounded-xl bg-white/3 border border-white/8 px-4 py-3",children:[r.jsx(fv,{size:15,className:"text-green-400 flex-shrink-0 mt-0.5"}),r.jsx("p",{className:"text-xs text-gray-400 leading-relaxed",children:"Must-b operates in a sandboxed workspace. It cannot access files outside this directory unless you explicitly provide a path in a prompt."})]})]}),d===3&&r.jsxs("div",{className:"space-y-4",children:[r.jsx(h0,{checked:C,onChange:M,label:'Enable "Hey Must-b" Wake Word',description:"Always-on voice activation — must-b-ui listens passively via your microphone."}),r.jsx("div",{className:"rounded-xl bg-white/3 border border-white/8 px-4 py-4",children:r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-semibold text-white",children:"Test Microphone Permission"}),r.jsxs("p",{className:"text-xs text-gray-400 mt-0.5",children:[De==="idle"&&"Click to verify your browser can access the microphone.",De==="testing"&&"Requesting permission…",De==="granted"&&"Microphone access granted ✓",De==="denied"&&"Permission denied — check browser settings."]})]}),r.jsx("button",{onClick:$l,disabled:De==="testing",className:Xe("flex items-center gap-2 px-4 py-2 rounded-xl text-xs font-bold transition-all shrink-0",De==="granted"?"bg-green-500/10 border border-green-500/20 text-green-400 cursor-default":De==="denied"?"bg-red-500/10 border border-red-500/20 text-red-400":"bg-white/5 border border-white/10 text-gray-300 hover:border-white/25 hover:text-white"),children:De==="granted"?r.jsxs(r.Fragment,{children:[r.jsx(zt,{size:12})," Granted"]}):De==="denied"?r.jsxs(r.Fragment,{children:[r.jsx(nf,{size:12})," Denied"]}):r.jsxs(r.Fragment,{children:[r.jsx(Ds,{size:12})," Test"]})})]})}),r.jsx("p",{className:"text-gray-700 text-xs px-1",children:"Wake word and microphone can be reconfigured at any time in Settings → Voice."})]}),d===4&&r.jsxs("div",{className:"space-y-4",children:[r.jsx("p",{className:"text-[12px] text-gray-500",children:"Connect messaging channels so Must-b can send and receive messages on your behalf. All tokens are stored locally. You can skip and configure later in Settings."}),d0.map(O=>{const ee=!!K[O.id];return r.jsxs("div",{className:"rounded-xl border transition-all overflow-hidden",style:{borderColor:ee?"rgba(234,88,12,0.35)":"rgba(255,255,255,0.07)",background:ee?"rgba(234,88,12,0.06)":"rgba(255,255,255,0.02)"},children:[r.jsxs("div",{className:"flex items-center",children:[r.jsxs("button",{onClick:()=>Y(Z=>({...Z,[O.id]:!ee})),className:"flex-1 flex items-center justify-between px-4 py-3",children:[r.jsxs("span",{className:"flex items-center gap-2.5 text-[13px] font-semibold text-gray-200",children:[r.jsx("span",{className:"text-base",children:O.emoji}),O.label,r.jsx("span",{className:"text-[10px] text-gray-600 font-normal",children:O.hint}),oe[O.id]==="ok"&&r.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-green-400 flex-shrink-0"}),oe[O.id]==="fail"&&r.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-red-400 flex-shrink-0"}),oe[O.id]==="testing"&&r.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-yellow-400 animate-pulse flex-shrink-0"})]}),r.jsx("span",{className:"w-8 h-4 rounded-full relative transition-all flex-shrink-0",style:{background:ee?"#ea580c":"rgba(255,255,255,0.1)"},children:r.jsx("span",{className:"absolute top-0.5 w-3 h-3 bg-white rounded-full transition-all shadow-sm",style:{left:ee?"calc(100% - 14px)":"2px"}})})]}),ee&&O.fields.some(Z=>(J[Z.key]??"").trim())&&r.jsx("button",{onClick:Z=>{Z.stopPropagation(),wa(O.id)},disabled:oe[O.id]==="testing",className:"mr-3 px-2 py-1 rounded-lg text-[10px] font-semibold transition-all disabled:opacity-40",style:{background:"rgba(234,88,12,0.12)",border:"1px solid rgba(234,88,12,0.25)",color:"#fb923c"},children:oe[O.id]==="testing"?"…":"Test"})]}),ee&&r.jsx("div",{className:"px-4 pb-3 space-y-2 border-t",style:{borderColor:"rgba(234,88,12,0.15)"},children:O.fields.map(Z=>r.jsxs("div",{children:[r.jsx("label",{className:"block text-[10px] font-semibold text-gray-500 uppercase tracking-widest mb-1 mt-2",children:Z.label}),r.jsx("input",{type:Z.secret?"password":"text",value:J[Z.key]??"",onChange:_e=>ce(Ie=>({...Ie,[Z.key]:_e.target.value})),placeholder:Z.placeholder,className:"w-full px-3 py-2 rounded-lg text-[12px] text-gray-200 placeholder-gray-700 outline-none transition-all",style:{background:"rgba(255,255,255,0.05)",border:"1px solid rgba(255,255,255,0.08)"}})]},Z.key))})]},O.id)})]}),d===5&&r.jsxs("div",{className:"space-y-5",children:[r.jsx(h0,{checked:_,onChange:U,label:"Send anonymous crash reports",description:"Helps improve Must-b. No personal data, no conversation content — only error traces."}),r.jsxs("div",{className:"rounded-xl bg-white/3 border border-white/6 px-4 py-4 space-y-2",children:[r.jsx("p",{className:"text-[11px] font-bold text-gray-400 uppercase tracking-widest mb-2",children:"Configuration Summary"}),[{label:"Name",value:f||"—"},{label:"Language",value:((Qr=u0.find(O=>O.value===v))==null?void 0:Qr.label)??v},{label:"Provider",value:((Zt=e.find(O=>O.id===b))==null?void 0:Zt.label)??b},{label:"Workspace",value:(z||c).replace(/^.*\/([^/]+\/[^/]+)$/,"…/$1")},{label:"Wake Word",value:C?"Enabled":"Disabled"}].map(O=>r.jsxs("div",{className:"flex items-center justify-between text-xs",children:[r.jsx("span",{className:"text-gray-400",children:O.label}),r.jsx("span",{className:"text-gray-300 font-mono truncate max-w-[200px]",children:O.value})]},O.label))]}),Lt&&r.jsx("div",{className:"rounded-xl bg-red-500/10 border border-red-500/20 px-4 py-3 text-red-400 text-sm",children:Lt}),r.jsx("button",{onClick:ms,disabled:G,className:"w-full flex items-center justify-center gap-3 px-8 py-4 rounded-2xl bg-gradient-to-r from-orange-600 to-amber-600 hover:from-orange-500 hover:to-amber-500 text-white font-bold text-base transition-all shadow-lg shadow-orange-500/25 active:scale-[0.98] disabled:opacity-50 disabled:cursor-not-allowed",children:G?r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"w-5 h-5 border-2 border-white/40 border-t-white rounded-full animate-spin"})," Initializing…"]}):r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"text-lg",children:"🚀"})," Initialize Must-b"]})})]})]},d)}),d<5&&r.jsxs("div",{className:"flex items-center justify-between mt-5",children:[r.jsxs("button",{onClick:()=>p(O=>O-1),disabled:d===0,className:"flex items-center gap-2 px-5 py-2.5 rounded-xl text-gray-400 hover:text-white hover:bg-white/5 transition-all disabled:opacity-25 disabled:cursor-not-allowed text-sm font-medium",children:[r.jsx(r0,{size:16})," Back"]}),r.jsxs("button",{onClick:()=>p(O=>O+1),disabled:!Ys(),className:"flex items-center gap-2 px-6 py-2.5 rounded-xl bg-orange-600 hover:bg-orange-500 text-white font-semibold text-sm transition-all shadow-lg shadow-orange-500/20 active:scale-[0.97] disabled:opacity-40 disabled:cursor-not-allowed",children:["Continue ",r.jsx(dn,{size:16})]})]}),d===5&&r.jsx("div",{className:"flex justify-start mt-5",children:r.jsxs("button",{onClick:()=>p(4),className:"flex items-center gap-2 px-5 py-2.5 rounded-xl text-gray-400 hover:text-white hover:bg-white/5 transition-all text-sm font-medium",children:[r.jsx(r0,{size:16})," Back"]})}),r.jsxs("p",{className:"text-center text-xs text-gray-700 mt-5",children:["All settings saved locally · Run ",r.jsx("code",{className:"text-orange-500/60",children:"must-b doctor"})," to verify"]})]})]})}const pn=Object.create(null);pn.open="0";pn.close="1";pn.ping="2";pn.pong="3";pn.message="4";pn.upgrade="5";pn.noop="6";const wo=Object.create(null);Object.keys(pn).forEach(e=>{wo[pn[e]]=e});const dd={type:"error",data:"parser error"},bv=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",wv=typeof ArrayBuffer=="function",kv=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,cf=({type:e,data:t},n,s)=>bv&&t instanceof Blob?n?s(t):f0(t,s):wv&&(t instanceof ArrayBuffer||kv(t))?n?s(t):f0(new Blob([t]),s):s(pn[e]+(t||"")),f0=(e,t)=>{const n=new FileReader;return n.onload=function(){const s=n.result.split(",")[1];t("b"+(s||""))},n.readAsDataURL(e)};function p0(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let zc;function s3(e,t){if(bv&&e.data instanceof Blob)return e.data.arrayBuffer().then(p0).then(t);if(wv&&(e.data instanceof ArrayBuffer||kv(e.data)))return t(p0(e.data));cf(e,!1,n=>{zc||(zc=new TextEncoder),t(zc.encode(n))})}const m0="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",gi=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<m0.length;e++)gi[m0.charCodeAt(e)]=e;const r3=e=>{let t=e.length*.75,n=e.length,s,i=0,a,o,l,c;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const u=new ArrayBuffer(t),d=new Uint8Array(u);for(s=0;s<n;s+=4)a=gi[e.charCodeAt(s)],o=gi[e.charCodeAt(s+1)],l=gi[e.charCodeAt(s+2)],c=gi[e.charCodeAt(s+3)],d[i++]=a<<2|o>>4,d[i++]=(o&15)<<4|l>>2,d[i++]=(l&3)<<6|c&63;return u},i3=typeof ArrayBuffer=="function",uf=(e,t)=>{if(typeof e!="string")return{type:"message",data:jv(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:a3(e.substring(1),t)}:wo[n]?e.length>1?{type:wo[n],data:e.substring(1)}:{type:wo[n]}:dd},a3=(e,t)=>{if(i3){const n=r3(e);return jv(n,t)}else return{base64:!0,data:e}},jv=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},Nv="",o3=(e,t)=>{const n=e.length,s=new Array(n);let i=0;e.forEach((a,o)=>{cf(a,!1,l=>{s[o]=l,++i===n&&t(s.join(Nv))})})},l3=(e,t)=>{const n=e.split(Nv),s=[];for(let i=0;i<n.length;i++){const a=uf(n[i],t);if(s.push(a),a.type==="error")break}return s};function c3(){return new TransformStream({transform(e,t){s3(e,n=>{const s=n.length;let i;if(s<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,s);else if(s<65536){i=new Uint8Array(3);const a=new DataView(i.buffer);a.setUint8(0,126),a.setUint16(1,s)}else{i=new Uint8Array(9);const a=new DataView(i.buffer);a.setUint8(0,127),a.setBigUint64(1,BigInt(s))}e.data&&typeof e.data!="string"&&(i[0]|=128),t.enqueue(i),t.enqueue(n)})}})}let Lc;function Ga(e){return e.reduce((t,n)=>t+n.length,0)}function qa(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let s=0;for(let i=0;i<t;i++)n[i]=e[0][s++],s===e[0].length&&(e.shift(),s=0);return e.length&&s<e[0].length&&(e[0]=e[0].slice(s)),n}function u3(e,t){Lc||(Lc=new TextDecoder);const n=[];let s=0,i=-1,a=!1;return new TransformStream({transform(o,l){for(n.push(o);;){if(s===0){if(Ga(n)<1)break;const c=qa(n,1);a=(c[0]&128)===128,i=c[0]&127,i<126?s=3:i===126?s=1:s=2}else if(s===1){if(Ga(n)<2)break;const c=qa(n,2);i=new DataView(c.buffer,c.byteOffset,c.length).getUint16(0),s=3}else if(s===2){if(Ga(n)<8)break;const c=qa(n,8),u=new DataView(c.buffer,c.byteOffset,c.length),d=u.getUint32(0);if(d>Math.pow(2,21)-1){l.enqueue(dd);break}i=d*Math.pow(2,32)+u.getUint32(4),s=3}else{if(Ga(n)<i)break;const c=qa(n,i);l.enqueue(uf(a?c:Lc.decode(c),t)),s=0}if(i===0||i>e){l.enqueue(dd);break}}}})}const Sv=4;function Re(e){if(e)return d3(e)}function d3(e){for(var t in Re.prototype)e[t]=Re.prototype[t];return e}Re.prototype.on=Re.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};Re.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};Re.prototype.off=Re.prototype.removeListener=Re.prototype.removeAllListeners=Re.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var s,i=0;i<n.length;i++)if(s=n[i],s===t||s.fn===t){n.splice(i,1);break}return n.length===0&&delete this._callbacks["$"+e],this};Re.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],s=1;s<arguments.length;s++)t[s-1]=arguments[s];if(n){n=n.slice(0);for(var s=0,i=n.length;s<i;++s)n[s].apply(this,t)}return this};Re.prototype.emitReserved=Re.prototype.emit;Re.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};Re.prototype.hasListeners=function(e){return!!this.listeners(e).length};const Ol=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),_t=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),h3="arraybuffer";function Cv(e,...t){return t.reduce((n,s)=>(e.hasOwnProperty(s)&&(n[s]=e[s]),n),{})}const f3=_t.setTimeout,p3=_t.clearTimeout;function Dl(e,t){t.useNativeTimers?(e.setTimeoutFn=f3.bind(_t),e.clearTimeoutFn=p3.bind(_t)):(e.setTimeoutFn=_t.setTimeout.bind(_t),e.clearTimeoutFn=_t.clearTimeout.bind(_t))}const m3=1.33;function g3(e){return typeof e=="string"?x3(e):Math.ceil((e.byteLength||e.size)*m3)}function x3(e){let t=0,n=0;for(let s=0,i=e.length;s<i;s++)t=e.charCodeAt(s),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(s++,n+=4);return n}function Ev(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function y3(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function v3(e){let t={},n=e.split("&");for(let s=0,i=n.length;s<i;s++){let a=n[s].split("=");t[decodeURIComponent(a[0])]=decodeURIComponent(a[1])}return t}class b3 extends Error{constructor(t,n,s){super(t),this.description=n,this.context=s,this.type="TransportError"}}class df extends Re{constructor(t){super(),this.writable=!1,Dl(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,n,s){return super.emitReserved("error",new b3(t,n,s)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=uf(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,n={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port)!==443||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const n=y3(t);return n.length?"?"+n:""}}class w3 extends df{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(t){this.readyState="pausing";const n=()=>{this.readyState="paused",t()};if(this._polling||!this.writable){let s=0;this._polling&&(s++,this.once("pollComplete",function(){--s||n()})),this.writable||(s++,this.once("drain",function(){--s||n()}))}else n()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=s=>{if(this.readyState==="opening"&&s.type==="open"&&this.onOpen(),s.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(s)};l3(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,o3(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=Ev()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let _v=!1;try{_v=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const k3=_v;function j3(){}class N3 extends w3{constructor(t){if(super(t),typeof location<"u"){const n=location.protocol==="https:";let s=location.port;s||(s=n?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||s!==t.port}}doWrite(t,n){const s=this.request({method:"POST",data:t});s.on("success",n),s.on("error",(i,a)=>{this.onError("xhr post error",i,a)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,s)=>{this.onError("xhr poll error",n,s)}),this.pollXhr=t}}class un extends Re{constructor(t,n,s){super(),this.createRequest=t,Dl(this,s),this._opts=s,this._method=s.method||"GET",this._uri=n,this._data=s.data!==void 0?s.data:null,this._create()}_create(){var t;const n=Cv(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this._opts.xd;const s=this._xhr=this.createRequest(n);try{s.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){s.setDisableHeaderCheck&&s.setDisableHeaderCheck(!0);for(let i in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(i)&&s.setRequestHeader(i,this._opts.extraHeaders[i])}}catch{}if(this._method==="POST")try{s.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{s.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(s),"withCredentials"in s&&(s.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(s.timeout=this._opts.requestTimeout),s.onreadystatechange=()=>{var i;s.readyState===3&&((i=this._opts.cookieJar)===null||i===void 0||i.parseCookies(s.getResponseHeader("set-cookie"))),s.readyState===4&&(s.status===200||s.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof s.status=="number"?s.status:0)},0))},s.send(this._data)}catch(i){this.setTimeoutFn(()=>{this._onError(i)},0);return}typeof document<"u"&&(this._index=un.requestsCount++,un.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=j3,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete un.requests[this._index],this._xhr=null}}_onLoad(){const t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}un.requestsCount=0;un.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",g0);else if(typeof addEventListener=="function"){const e="onpagehide"in _t?"pagehide":"unload";addEventListener(e,g0,!1)}}function g0(){for(let e in un.requests)un.requests.hasOwnProperty(e)&&un.requests[e].abort()}const S3=function(){const e=Tv({xdomain:!1});return e&&e.responseType!==null}();class C3 extends N3{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=S3&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new un(Tv,this.uri(),t)}}function Tv(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||k3))return new XMLHttpRequest}catch{}if(!t)try{return new _t[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const Pv=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class E3 extends df{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,s=Pv?{}:Cv(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(s.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,n,s)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const s=t[n],i=n===t.length-1;cf(s,this.supportsBinary,a=>{try{this.doWrite(s,a)}catch{}i&&Ol(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=Ev()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const Oc=_t.WebSocket||_t.MozWebSocket;class _3 extends E3{createSocket(t,n,s){return Pv?new Oc(t,n,s):n?new Oc(t,n):new Oc(t)}doWrite(t,n){this.ws.send(n)}}class T3 extends df{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{const n=u3(Number.MAX_SAFE_INTEGER,this.socket.binaryType),s=t.readable.pipeThrough(n).getReader(),i=c3();i.readable.pipeTo(t.writable),this._writer=i.writable.getWriter();const a=()=>{s.read().then(({done:l,value:c})=>{l||(this.onPacket(c),a())}).catch(l=>{})};a();const o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this._writer.write(o).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const s=t[n],i=n===t.length-1;this._writer.write(s).then(()=>{i&&Ol(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const P3={websocket:_3,webtransport:T3,polling:C3},A3=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,M3=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function hd(e){if(e.length>8e3)throw"URI too long";const t=e,n=e.indexOf("["),s=e.indexOf("]");n!=-1&&s!=-1&&(e=e.substring(0,n)+e.substring(n,s).replace(/:/g,";")+e.substring(s,e.length));let i=A3.exec(e||""),a={},o=14;for(;o--;)a[M3[o]]=i[o]||"";return n!=-1&&s!=-1&&(a.source=t,a.host=a.host.substring(1,a.host.length-1).replace(/;/g,":"),a.authority=a.authority.replace("[","").replace("]","").replace(/;/g,":"),a.ipv6uri=!0),a.pathNames=R3(a,a.path),a.queryKey=z3(a,a.query),a}function R3(e,t){const n=/\/{2,9}/g,s=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&s.splice(0,1),t.slice(-1)=="/"&&s.splice(s.length-1,1),s}function z3(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(s,i,a){i&&(n[i]=a)}),n}const fd=typeof addEventListener=="function"&&typeof removeEventListener=="function",ko=[];fd&&addEventListener("offline",()=>{ko.forEach(e=>e())},!1);class es extends Re{constructor(t,n){if(super(),this.binaryType=h3,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(n=t,t=null),t){const s=hd(t);n.hostname=s.host,n.secure=s.protocol==="https"||s.protocol==="wss",n.port=s.port,s.query&&(n.query=s.query)}else n.host&&(n.hostname=hd(n.host).host);Dl(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},n.transports.forEach(s=>{const i=s.prototype.name;this.transports.push(i),this._transportsByName[i]=s}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=v3(this.opts.query)),fd&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},ko.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=Sv,n.transport=t,this.id&&(n.sid=this.id);const s=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](s)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&es.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const n=this.createTransport(t);n.open(),this.setTransport(n)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",n=>this._onClose("transport close",n))}onOpen(){this.readyState="open",es.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const n=new Error("server error");n.code=t.data,this._onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let s=0;s<this.writeBuffer.length;s++){const i=this.writeBuffer[s].data;if(i&&(n+=g3(i)),s>0&&n>this._maxPayload)return this.writeBuffer.slice(0,s);n+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,Ol(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,n,s){return this._sendPacket("message",t,n,s),this}send(t,n,s){return this._sendPacket("message",t,n,s),this}_sendPacket(t,n,s,i){if(typeof n=="function"&&(i=n,n=void 0),typeof s=="function"&&(i=s,s=null),this.readyState==="closing"||this.readyState==="closed")return;s=s||{},s.compress=s.compress!==!1;const a={type:t,data:n,options:s};this.emitReserved("packetCreate",a),this.writeBuffer.push(a),i&&this.once("flush",i),this.flush()}close(){const t=()=>{this._onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},s=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?s():t()}):this.upgrading?s():t()),this}_onError(t){if(es.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,n){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),fd&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const s=ko.indexOf(this._offlineEventListener);s!==-1&&ko.splice(s,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}es.protocol=Sv;class L3 extends es{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t<this._upgrades.length;t++)this._probe(this._upgrades[t])}_probe(t){let n=this.createTransport(t),s=!1;es.priorWebsocketSuccess=!1;const i=()=>{s||(n.send([{type:"ping",data:"probe"}]),n.once("packet",p=>{if(!s)if(p.type==="pong"&&p.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;es.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{s||this.readyState!=="closed"&&(d(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const f=new Error("probe error");f.transport=n.name,this.emitReserved("upgradeError",f)}}))};function a(){s||(s=!0,d(),n.close(),n=null)}const o=p=>{const f=new Error("probe error: "+p);f.transport=n.name,a(),this.emitReserved("upgradeError",f)};function l(){o("transport closed")}function c(){o("socket closed")}function u(p){n&&p.name!==n.name&&a()}const d=()=>{n.removeListener("open",i),n.removeListener("error",o),n.removeListener("close",l),this.off("close",c),this.off("upgrading",u)};n.once("open",i),n.once("error",o),n.once("close",l),this.once("close",c),this.once("upgrading",u),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{s||n.open()},200):n.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const n=[];for(let s=0;s<t.length;s++)~this.transports.indexOf(t[s])&&n.push(t[s]);return n}}let O3=class extends L3{constructor(t,n={}){const s=typeof t=="object"?t:n;(!s.transports||s.transports&&typeof s.transports[0]=="string")&&(s.transports=(s.transports||["polling","websocket","webtransport"]).map(i=>P3[i]).filter(i=>!!i)),super(t,s)}};function D3(e,t="",n){let s=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),s=hd(e)),s.port||(/^(http|ws)$/.test(s.protocol)?s.port="80":/^(http|ws)s$/.test(s.protocol)&&(s.port="443")),s.path=s.path||"/";const a=s.host.indexOf(":")!==-1?"["+s.host+"]":s.host;return s.id=s.protocol+"://"+a+":"+s.port+t,s.href=s.protocol+"://"+a+(n&&n.port===s.port?"":":"+s.port),s}const I3=typeof ArrayBuffer=="function",B3=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,Av=Object.prototype.toString,F3=typeof Blob=="function"||typeof Blob<"u"&&Av.call(Blob)==="[object BlobConstructor]",V3=typeof File=="function"||typeof File<"u"&&Av.call(File)==="[object FileConstructor]";function hf(e){return I3&&(e instanceof ArrayBuffer||B3(e))||F3&&e instanceof Blob||V3&&e instanceof File}function jo(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,s=e.length;n<s;n++)if(jo(e[n]))return!0;return!1}if(hf(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return jo(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&jo(e[n]))return!0;return!1}function $3(e){const t=[],n=e.data,s=e;return s.data=pd(n,t),s.attachments=t.length,{packet:s,buffers:t}}function pd(e,t){if(!e)return e;if(hf(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){const n=new Array(e.length);for(let s=0;s<e.length;s++)n[s]=pd(e[s],t);return n}else if(typeof e=="object"&&!(e instanceof Date)){const n={};for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&(n[s]=pd(e[s],t));return n}return e}function U3(e,t){return e.data=md(e.data,t),delete e.attachments,e}function md(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=md(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=md(e[n],t));return e}const H3=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var ae;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(ae||(ae={}));class W3{constructor(t){this.replacer=t}encode(t){return(t.type===ae.EVENT||t.type===ae.ACK)&&jo(t)?this.encodeAsBinary({type:t.type===ae.EVENT?ae.BINARY_EVENT:ae.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===ae.BINARY_EVENT||t.type===ae.BINARY_ACK)&&(n+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(n+=t.nsp+","),t.id!=null&&(n+=t.id),t.data!=null&&(n+=JSON.stringify(t.data,this.replacer)),n}encodeAsBinary(t){const n=$3(t),s=this.encodeAsString(n.packet),i=n.buffers;return i.unshift(s),i}}class ff extends Re{constructor(t){super(),this.reviver=t}add(t){let n;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(t);const s=n.type===ae.BINARY_EVENT;s||n.type===ae.BINARY_ACK?(n.type=s?ae.EVENT:ae.ACK,this.reconstructor=new K3(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(hf(t)||t.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(t),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let n=0;const s={type:Number(t.charAt(0))};if(ae[s.type]===void 0)throw new Error("unknown packet type "+s.type);if(s.type===ae.BINARY_EVENT||s.type===ae.BINARY_ACK){const a=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const o=t.substring(a,n);if(o!=Number(o)||t.charAt(n)!=="-")throw new Error("Illegal attachments");s.attachments=Number(o)}if(t.charAt(n+1)==="/"){const a=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););s.nsp=t.substring(a,n)}else s.nsp="/";const i=t.charAt(n+1);if(i!==""&&Number(i)==i){const a=n+1;for(;++n;){const o=t.charAt(n);if(o==null||Number(o)!=o){--n;break}if(n===t.length)break}s.id=Number(t.substring(a,n+1))}if(t.charAt(++n)){const a=this.tryParse(t.substr(n));if(ff.isPayloadValid(s.type,a))s.data=a;else throw new Error("invalid payload")}return s}tryParse(t){try{return JSON.parse(t,this.reviver)}catch{return!1}}static isPayloadValid(t,n){switch(t){case ae.CONNECT:return x0(n);case ae.DISCONNECT:return n===void 0;case ae.CONNECT_ERROR:return typeof n=="string"||x0(n);case ae.EVENT:case ae.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&H3.indexOf(n[0])===-1);case ae.ACK:case ae.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class K3{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=U3(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}function x0(e){return Object.prototype.toString.call(e)==="[object Object]"}const G3=Object.freeze(Object.defineProperty({__proto__:null,Decoder:ff,Encoder:W3,get PacketType(){return ae}},Symbol.toStringTag,{value:"Module"}));function Ht(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const q3=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Mv extends Re{constructor(t,n,s){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,s&&s.auth&&(this.auth=s.auth),this._opts=Object.assign({},s),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[Ht(t,"open",this.onopen.bind(this)),Ht(t,"packet",this.onpacket.bind(this)),Ht(t,"error",this.onerror.bind(this)),Ht(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){var s,i,a;if(q3.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const o={type:ae.EVENT,data:n};if(o.options={},o.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const d=this.ids++,p=n.pop();this._registerAckCallback(d,p),o.id=d}const l=(i=(s=this.io.engine)===null||s===void 0?void 0:s.transport)===null||i===void 0?void 0:i.writable,c=this.connected&&!(!((a=this.io.engine)===null||a===void 0)&&a._hasPingExpired());return this.flags.volatile&&!l||(c?(this.notifyOutgoingListeners(o),this.packet(o)):this.sendBuffer.push(o)),this.flags={},this}_registerAckCallback(t,n){var s;const i=(s=this.flags.timeout)!==null&&s!==void 0?s:this._opts.ackTimeout;if(i===void 0){this.acks[t]=n;return}const a=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let l=0;l<this.sendBuffer.length;l++)this.sendBuffer[l].id===t&&this.sendBuffer.splice(l,1);n.call(this,new Error("operation has timed out"))},i),o=(...l)=>{this.io.clearTimeoutFn(a),n.apply(this,l)};o.withError=!0,this.acks[t]=o}emitWithAck(t,...n){return new Promise((s,i)=>{const a=(o,l)=>o?i(o):s(l);a.withError=!0,n.push(a),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const s={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((i,...a)=>(this._queue[0],i!==null?s.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(i)):(this._queue.shift(),n&&n(null,...a)),s.pending=!1,this._drainQueue())),this._queue.push(s),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:ae.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(s=>String(s.id)===t)){const s=this.acks[t];delete this.acks[t],s.withError&&s.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case ae.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case ae.EVENT:case ae.BINARY_EVENT:this.onevent(t);break;case ae.ACK:case ae.BINARY_ACK:this.onack(t);break;case ae.DISCONNECT:this.ondisconnect();break;case ae.CONNECT_ERROR:this.destroy();const s=new Error(t.data.message);s.data=t.data.data,this.emitReserved("connect_error",s);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const s of n)s.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let s=!1;return function(...i){s||(s=!0,n.packet({type:ae.ACK,id:t,data:i}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(delete this.acks[t.id],n.withError&&t.data.unshift(null),n.apply(this,t.data))}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:ae.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let s=0;s<n.length;s++)if(t===n[s])return n.splice(s,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let s=0;s<n.length;s++)if(t===n[s])return n.splice(s,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const s of n)s.apply(this,t.data)}}}function Yr(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}Yr.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+n:e-n}return Math.min(e,this.max)|0};Yr.prototype.reset=function(){this.attempts=0};Yr.prototype.setMin=function(e){this.ms=e};Yr.prototype.setMax=function(e){this.max=e};Yr.prototype.setJitter=function(e){this.jitter=e};class gd extends Re{constructor(t,n){var s;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,Dl(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((s=n.randomizationFactor)!==null&&s!==void 0?s:.5),this.backoff=new Yr({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const i=n.parser||G3;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new O3(this.uri,this.opts);const n=this.engine,s=this;this._readyState="opening",this.skipReconnect=!1;const i=Ht(n,"open",function(){s.onopen(),t&&t()}),a=l=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",l),t?t(l):this.maybeReconnectOnOpen()},o=Ht(n,"error",a);if(this._timeout!==!1){const l=this._timeout,c=this.setTimeoutFn(()=>{i(),a(new Error("timeout")),n.close()},l);this.opts.autoUnref&&c.unref(),this.subs.push(()=>{this.clearTimeoutFn(c)})}return this.subs.push(i),this.subs.push(o),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(Ht(t,"ping",this.onping.bind(this)),Ht(t,"data",this.ondata.bind(this)),Ht(t,"error",this.onerror.bind(this)),Ht(t,"close",this.onclose.bind(this)),Ht(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){Ol(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let s=this.nsps[t];return s?this._autoConnect&&!s.active&&s.connect():(s=new Mv(this,t,n),this.nsps[t]=s),s}_destroy(t){const n=Object.keys(this.nsps);for(const s of n)if(this.nsps[s].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let s=0;s<n.length;s++)this.engine.write(n[s],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,n){var s;this.cleanup(),(s=this.engine)===null||s===void 0||s.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const s=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(i=>{i?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",i)):t.onreconnect()}))},n);this.opts.autoUnref&&s.unref(),this.subs.push(()=>{this.clearTimeoutFn(s)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const oi={};function Ri(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=D3(e,t.path||"/socket.io"),s=n.source,i=n.id,a=n.path,o=oi[i]&&a in oi[i].nsps,l=t.forceNew||t["force new connection"]||t.multiplex===!1||o;let c;return l?c=new gd(s,t):(oi[i]||(oi[i]=new gd(s,t)),c=oi[i]),n.query&&!t.query&&(t.query=n.queryKey),c.socket(n.path,t)}Object.assign(Ri,{Manager:gd,Socket:Mv,io:Ri,connect:Ri});const Y3={};let ys=null;function X3(){const e=Y3;if(e!=null&&e.VITE_BACKEND_URL)return e.VITE_BACKEND_URL.replace(/\/$/,"");const t=window.location.hostname;return t==="localhost"||t==="127.0.0.1"||/^\d{1,3}(\.\d{1,3}){3}$/.test(t)?window.location.origin:"http://localhost:4309"}function at(){return ys||(ys=Ri(X3(),{transports:["websocket","polling"],withCredentials:!0,reconnection:!0,reconnectionAttempts:1/0,reconnectionDelay:1e3,reconnectionDelayMax:5e3,randomizationFactor:.3,timeout:1e4}),ys.on("agentUpdate",e=>{try{e!=null&&window.dispatchEvent(new CustomEvent("mustb:agentUpdate",{detail:e}))}catch{}}),ys.on("connect",()=>{window.dispatchEvent(new CustomEvent("mustb:connected"))}),ys.on("disconnect",e=>{window.dispatchEvent(new CustomEvent("mustb:disconnected",{detail:{reason:e}}))}),ys.io.on("reconnect",e=>{window.dispatchEvent(new CustomEvent("mustb:reconnected",{detail:{attemptNumber:e}}))})),ys}const Q3={};let xi=null;const J3=(()=>{const e=Q3,t=(e==null?void 0:e.VITE_BACKEND_URL)??"";return t&&!t.includes(window.location.hostname)?t.replace(/\/$/,""):""})();function Rv(e){return e.startsWith("http")?e:`${J3}${e}`}async function Z3(){if(xi)return xi;try{const e=await fetch(Rv("/api/auth/local"));if(e.ok)return xi=(await e.json()).token??null,xi}catch{}return null}async function $(e,t={},{retries:n=3,retryDelay:s=800}={}){const i=await Z3(),a={"Content-Type":"application/json",...t.headers};i&&(a.Authorization=`Bearer ${i}`);const o=Rv(e);let l;for(let c=1;c<=n;c++)try{const u=await fetch(o,{...t,headers:a});return u.status===401&&(xi=null,window.dispatchEvent(new CustomEvent("mustb:401",{detail:{url:o}}))),u}catch(u){l=u,c<n&&await new Promise(d=>setTimeout(d,s*c))}throw window.dispatchEvent(new CustomEvent("mustb:offline",{detail:{url:o}})),l}function y0(e){const t=e.toLowerCase();if(t.includes("gemini-2")||t.includes("gemini-flash"))return 9999;if(t.includes("llama-3")&&(t.includes("70b")||t.includes("405b")))return 9998;if(t.includes("gpt-4o"))return 8888;if(t.includes("claude-3-5")||t.includes("claude-3.5"))return 8887;if(t.includes("gemini-pro")||t.includes("gemini-1.5-pro"))return 8886;const n=t.match(/(\d+)x(\d+)b/);if(n)return parseFloat(n[1])*parseFloat(n[2]);const s=t.match(/(\d+(?:\.\d+)?)b/);return s?parseFloat(s[1]):0}function Dc(e){return[...e].sort((t,n)=>y0(n.id)-y0(t.id))}function eE(){const{t:e}=pt(),[t,n]=h.useState(!1),[s,i]=h.useState(()=>localStorage.getItem("mustb_active_model")??"Loading…"),[a,o]=h.useState([]),l=h.useRef(null);h.useEffect(()=>{const f=localStorage.getItem("mustb_active_model");f&&f!=="Loading…"&&$("/api/settings/model",{method:"POST",body:JSON.stringify({model:f})}).catch(()=>{}),$("/api/setup/status").then(m=>m.ok?m.json():null).then(m=>{if(!m)return;const v=localStorage.getItem("mustb_active_model");m.activeModel&&(!v||v==="Loading…")&&(i(m.activeModel),localStorage.setItem("mustb_active_model",m.activeModel)),(m.activeProvider??"openrouter").toLowerCase()==="ollama"?$("/api/models").then(b=>b.ok?b.json():[]).then(b=>{const x=(Array.isArray(b)?b:[]).map(w=>({id:w.id??String(w),name:w.name??w.id??String(w),free:!0}));o(Dc(x))}).catch(()=>{}):$("/api/providers/openrouter/models").then(b=>b.ok?b.json():{}).then(b=>{const g=Dc((b.free??[]).map(j=>({id:j.id,name:j.name??j.id,free:!0}))),x=Dc((b.power??[]).map(j=>({id:j.id,name:j.name??j.id,free:!1}))),w=[...g,...x];o(w),!(m!=null&&m.activeModel)&&w.length>0&&i(w[0].id)}).catch(()=>{})}).catch(()=>{})},[]),h.useEffect(()=>{if(!t)return;const f=m=>{l.current&&!l.current.contains(m.target)&&n(!1)};return document.addEventListener("mousedown",f),()=>document.removeEventListener("mousedown",f)},[t]);const c=async f=>{i(f),localStorage.setItem("mustb_active_model",f),n(!1),await $("/api/settings/model",{method:"POST",body:JSON.stringify({model:f})}).catch(()=>{})},u=a.filter(f=>f.free),d=a.filter(f=>!f.free),p=s.length>28?s.slice(0,26)+"…":s;return r.jsxs("div",{ref:l,className:"relative",children:[r.jsxs("button",{onClick:()=>n(f=>!f),className:"flex items-center gap-1 px-2 py-1 rounded-lg border border-white/10 bg-white/5 hover:bg-white/10 text-white/50 hover:text-white/80 text-[11px] font-medium transition-all",children:[r.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-orange-500 shrink-0"}),r.jsx("span",{className:"truncate max-w-[110px]",children:p}),r.jsx(Gr,{size:10,className:`transition-transform duration-200 shrink-0 text-white/30 ${t?"rotate-180":""}`})]}),r.jsx(se,{children:t&&r.jsxs(H.div,{initial:{opacity:0,y:6,scale:.97},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:4,scale:.97},transition:{duration:.14,ease:[.22,1,.36,1]},className:"absolute bottom-full mb-2 left-0 z-50 w-72 rounded-xl shadow-xl border border-white/10 flex flex-col",style:{background:"rgba(18,8,2,0.97)",backdropFilter:"blur(24px)",maxHeight:"400px"},children:[r.jsxs("div",{className:"overflow-y-auto flex-1 p-1.5",children:[u.length>0&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"px-2.5 pt-2 pb-1 text-[9.5px] font-black uppercase tracking-[0.12em] text-emerald-500/80",children:"Free"}),u.slice(0,5).map(f=>r.jsxs("button",{onClick:()=>c(f.id),className:`w-full flex items-center gap-2 px-2.5 py-2 rounded-lg text-left transition-colors ${s===f.id?"bg-orange-500/15 text-orange-300":"text-white/60 hover:bg-white/5 hover:text-white/90"}`,children:[r.jsx("span",{className:`w-1.5 h-1.5 rounded-full shrink-0 ${s===f.id?"bg-orange-500":"bg-emerald-400"}`}),r.jsx("span",{className:"text-[12px] font-medium truncate",children:f.name}),s===f.id&&r.jsx("span",{className:"ml-auto text-[9px] font-semibold text-orange-400 shrink-0",children:"active"})]},f.id))]}),d.length>0&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"px-2.5 pt-2 pb-1 text-[9.5px] font-black uppercase tracking-[0.12em] text-orange-400/80",children:"Pro"}),d.map(f=>r.jsxs("button",{onClick:()=>c(f.id),className:`w-full flex items-center gap-2 px-2.5 py-2 rounded-lg text-left transition-colors ${s===f.id?"bg-orange-500/15 text-orange-300":"text-white/60 hover:bg-white/5 hover:text-white/90"}`,children:[r.jsx("span",{className:`w-1.5 h-1.5 rounded-full shrink-0 ${s===f.id?"bg-orange-500":"bg-orange-300"}`}),r.jsx("span",{className:"text-[12px] font-medium truncate",children:f.name}),s===f.id&&r.jsx("span",{className:"ml-auto text-[9px] font-semibold text-orange-400 shrink-0",children:"active"})]},f.id))]}),a.length===0&&r.jsx("div",{className:"px-3 py-4 text-[12px] text-white/30 text-center",children:"No models available"})]}),r.jsx("div",{className:"shrink-0 border-t border-white/8 p-1.5",children:r.jsxs(Ei,{to:"/app/settings",onClick:()=>n(!1),className:"flex items-center justify-center gap-1.5 w-full px-2.5 py-2 rounded-lg text-[11px] font-medium text-white/35 hover:text-orange-400 hover:bg-orange-500/8 transition-colors",children:[r.jsx(af,{size:11}),e.systemHealth.moreModels]})})]})})]})}function sn(e){if(typeof e=="string")return e;if(e==null)return"";if(typeof e=="object"){const t=e,n=t.message??t.error??t.text??t.content??t.result;return n!==void 0?sn(n):JSON.stringify(e)}return String(e)}function tE(e,t){switch(e){case"planGenerated":{const n=t.steps;return`Plan ready — ${(n==null?void 0:n.length)??0} step(s)`}case"stepStart":{const n=t.step;return`▶ ${(n==null?void 0:n.description)??sn(t.step)}`}case"stepFinish":{if(t.status==="error")return`✗ ${sn(t.error)}`;const n=t.step,s=t.result!==void 0?sn(t.result):void 0,i=(n==null?void 0:n.description)??"Step complete";return s&&s.length<180?`✓ ${i} → ${s}`:`✓ ${i}`}case"agentRepair":{const n=sn(t.action),s=t.reason?` — ${sn(t.reason).slice(0,120)}`:"";return`⟳ Repair: ${n}${s}`}default:return null}}function nE(e){return new Promise((t,n)=>{const s=new FileReader;s.onload=()=>t(s.result),s.onerror=n,s.readAsDataURL(e)})}function sE({lang:e,code:t}){const[n,s]=h.useState(!1);return r.jsxs("div",{className:"my-3 rounded-xl overflow-hidden border border-white/8 bg-[#1a0800]/90",children:[r.jsxs("div",{className:"flex items-center justify-between px-4 py-1.5 border-b border-white/6 select-none",children:[r.jsx("span",{className:"text-[11px] font-mono text-orange-300/50",children:e||"code"}),r.jsx("button",{onClick:()=>{navigator.clipboard.writeText(t).catch(()=>{}),s(!0),setTimeout(()=>s(!1),2e3)},className:"flex items-center gap-1.5 text-[11px] text-orange-300/50 hover:text-orange-200 transition-colors",children:n?r.jsxs(r.Fragment,{children:[r.jsx(zt,{size:10,className:"text-orange-400"}),r.jsx("span",{className:"text-orange-400",children:"Copied"})]}):r.jsxs(r.Fragment,{children:[r.jsx(aa,{size:10}),"Copy"]})})]}),r.jsx("pre",{className:"overflow-x-auto px-4 py-3 text-[13px] text-orange-50 font-mono leading-relaxed whitespace-pre",children:r.jsx("code",{children:t})})]})}function Zs(e,t){return e.split(/(`[^`\n]+`)/).map((s,i)=>{if(s.startsWith("`")&&s.endsWith("`")&&s.length>2)return r.jsx("code",{className:"px-1.5 py-0.5 rounded bg-black/15 text-orange-700 font-mono text-[12px]",children:s.slice(1,-1)},`${t}-ic${i}`);const a=s.split(/(\*\*[^*\n]+\*\*|\*[^*\n]+\*)/);return r.jsx(h.Fragment,{children:a.map((o,l)=>o.startsWith("**")&&o.endsWith("**")&&o.length>4?r.jsx("strong",{className:"font-bold text-inherit dark:text-gray-100",children:o.slice(2,-2)},`${t}-b${i}-${l}`):o.startsWith("*")&&o.endsWith("*")&&o.length>2?r.jsx("em",{className:"italic",children:o.slice(1,-1)},`${t}-em${i}-${l}`):r.jsx("span",{children:o},`${t}-s${i}-${l}`))},`${t}-bi${i}`)})}function rE({text:e,dark:t=!1}){const n=t?"text-orange-50":"text-[#3d1a06]",s=[],i=e.split(`
720
+ `);let a=0,o=0;const l=()=>`md-${o++}`;for(;a<i.length;){const c=i[a],u=c.match(/^```(\w*)/);if(u){const v=u[1]??"",y=[];for(a++;a<i.length&&!i[a].startsWith("```");)y.push(i[a]),a++;a<i.length&&a++,s.push(r.jsx(sE,{lang:v,code:y.join(`
721
+ `)},l()));continue}const d=c.match(/^### (.+)/);if(d){s.push(r.jsx("h3",{className:`text-sm font-bold mt-4 mb-1 ${n}`,children:Zs(d[1],l())},l())),a++;continue}const p=c.match(/^## (.+)/);if(p){s.push(r.jsx("h2",{className:`text-base font-bold mt-5 mb-1.5 ${n}`,children:Zs(p[1],l())},l())),a++;continue}const f=c.match(/^# (.+)/);if(f){s.push(r.jsx("h1",{className:`text-lg font-bold mt-6 mb-2 ${n}`,children:Zs(f[1],l())},l())),a++;continue}if(c.match(/^[-*]{3,}$/)){s.push(r.jsx("hr",{className:"border-black/10 my-4"},l())),a++;continue}if(c.match(/^[-*•] /)){const v=[];for(;a<i.length&&i[a].match(/^[-*•] /);)v.push(i[a].replace(/^[-*•] /,"")),a++;s.push(r.jsx("ul",{className:"my-2 space-y-1.5 pl-1",children:v.map((y,b)=>r.jsxs("li",{className:`flex items-start gap-2.5 text-[14px] leading-relaxed ${n}`,children:[r.jsx("span",{className:"mt-[7px] w-1.5 h-1.5 rounded-full bg-orange-500/60 flex-shrink-0"}),r.jsx("span",{children:Zs(y,`ul-${b}`)})]},b))},l()));continue}if(c.match(/^\d+\. /)){const v=[];for(;a<i.length&&i[a].match(/^\d+\. /);)v.push(i[a].replace(/^\d+\. /,"")),a++;s.push(r.jsx("ol",{className:"my-2 space-y-1.5 pl-1",children:v.map((y,b)=>r.jsxs("li",{className:`flex items-start gap-2.5 text-[14px] leading-relaxed ${n}`,children:[r.jsxs("span",{className:"flex-shrink-0 mt-px font-mono text-[12px] w-5 text-right text-orange-600/60",children:[b+1,"."]}),r.jsx("span",{children:Zs(y,`ol-${b}`)})]},b))},l()));continue}if(c.trim()===""){a++;continue}const m=[];for(;a<i.length&&i[a].trim()!==""&&!i[a].match(/^(```|#{1,3} |[-*•] |\d+\. |[-*]{3,}$)/);)m.push(i[a]),a++;m.length&&s.push(r.jsx("p",{className:`text-[14px] leading-[1.75] my-1.5 ${n}`,children:Zs(m.join(" "),`p-${o}`)},l()))}return r.jsx("div",{children:s})}function iE(){const[e,t]=h.useState(0);h.useEffect(()=>{const i=setInterval(()=>t(a=>a+1),1e3);return()=>clearInterval(i)},[]);const n=String(Math.floor(e/60)).padStart(2,"0"),s=String(e%60).padStart(2,"0");return r.jsxs("span",{className:"text-[10px] text-white/20 font-mono ml-1",children:["[",n,":",s,"]"]})}function aE({startedAt:e}){const[t,n]=h.useState(()=>e?Math.floor((Date.now()-e)/1e3):0);h.useEffect(()=>{if(!e)return;const a=setInterval(()=>n(Math.floor((Date.now()-e)/1e3)),1e3);return()=>clearInterval(a)},[e]);const s=Math.floor(t/60),i=t%60;return r.jsxs("span",{className:"text-[10px] text-orange-400/40 font-mono",children:["Working… ",s>0?`${s}m ${i}s`:`${i}s`]})}function oE({logs:e,isRunning:t}){const n=h.useRef(null);return h.useEffect(()=>{t&&n.current&&(n.current.scrollTop=n.current.scrollHeight)},[e.length,t]),r.jsx("div",{ref:n,className:"ml-[19px] mt-0.5 rounded-lg bg-black/75 border border-white/6 px-2.5 py-1.5 max-h-28 overflow-y-auto scrollbar-hide",children:e.map((s,i)=>r.jsx("div",{className:`text-[10px] font-mono leading-relaxed whitespace-pre-wrap break-all ${s.startsWith("$ ")?"text-yellow-300/80":s.startsWith("[stderr]")?"text-red-400/70":"text-green-300/55"}`,children:s},i))})}function lE({workflow:e,onDismiss:t}){const[n,s]=h.useState("idle"),[i,a]=h.useState(e.goal.slice(0,52)+(e.goal.length>52?"…":"")),o=async()=>{s("saving");try{const l=await $("/api/skills/save",{method:"POST",body:JSON.stringify({goal:e.goal,answer:e.answer,steps:e.steps,name:i.trim()||void 0})});if(!l.ok)throw new Error(`HTTP ${l.status}`);s("saved"),setTimeout(t,1800)}catch{s("error"),setTimeout(()=>s("idle"),3e3)}};return r.jsx(H.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},exit:{opacity:0,y:4},transition:{duration:.2},className:"mt-3",children:r.jsx("div",{className:"flex items-center gap-3 px-4 py-2.5 rounded-xl bg-orange-900/20 border border-orange-600/30",children:n==="saved"?r.jsxs(r.Fragment,{children:[r.jsx(Ve,{size:13,className:"text-orange-400 shrink-0"}),r.jsx("span",{className:"text-xs font-medium text-orange-400",children:"Skill saved!"})]}):r.jsxs(r.Fragment,{children:[r.jsx(ev,{size:13,className:"text-orange-600 shrink-0"}),r.jsx("span",{className:"text-[11px] text-orange-200 shrink-0 font-medium",children:"Save as Skill:"}),r.jsx("input",{value:i,onChange:l=>a(l.target.value),onKeyDown:l=>l.key==="Enter"&&n==="idle"&&o(),placeholder:"Skill name…",className:"flex-1 bg-transparent text-[12px] text-orange-100 outline-none placeholder-orange-600/50 min-w-0"}),r.jsx("button",{onClick:o,disabled:n!=="idle",className:"flex items-center gap-1 px-3 py-1 rounded-lg bg-orange-900/30 hover:bg-orange-900/50 border border-orange-800/40 text-orange-200 text-[11px] font-semibold transition-all shrink-0 disabled:opacity-50",children:n==="saving"?r.jsxs(r.Fragment,{children:[r.jsx(ne,{size:10,className:"animate-spin"})," Saving…"]}):n==="error"?"Retry":"Save"}),r.jsx("button",{onClick:t,className:"text-orange-700 hover:text-orange-500 transition-colors text-[11px] shrink-0",children:"✕"})]})})})}function cE({src:e,onClose:t}){const[n,s]=h.useState(!1);h.useEffect(()=>{const o=l=>{l.key==="Escape"&&t()};return document.addEventListener("keydown",o),()=>document.removeEventListener("keydown",o)},[t]);const i=()=>{const o=document.createElement("a");o.href=e,o.download=`mustb-image-${Date.now()}.jpg`,o.click()},a=async()=>{try{await navigator.clipboard.writeText(e),s(!0),setTimeout(()=>s(!1),2e3)}catch{}};return r.jsxs("div",{className:"fixed inset-0 z-[9999] flex flex-col items-center justify-center bg-black/90 backdrop-blur-sm",onClick:t,children:[r.jsxs("div",{className:"absolute top-5 right-5 flex items-center gap-2",onClick:o=>o.stopPropagation(),children:[r.jsxs("button",{onClick:a,title:"Copy link",className:"flex items-center gap-1.5 px-3 py-1.5 rounded-full bg-white/10 hover:bg-white/20 text-white/80 hover:text-white text-[12px] font-medium transition-all",children:[n?r.jsx(zt,{size:14,className:"text-green-400"}):r.jsx(aa,{size:14}),n?"Copied!":"Copy"]}),r.jsxs("button",{onClick:i,title:"Download image",className:"flex items-center gap-1.5 px-3 py-1.5 rounded-full bg-white/10 hover:bg-white/20 text-white/80 hover:text-white text-[12px] font-medium transition-all",children:[r.jsx(Mi,{size:14}),"Download"]}),r.jsx("button",{onClick:t,className:"w-9 h-9 flex items-center justify-center rounded-full bg-white/10 hover:bg-white/20 text-white/80 hover:text-white transition-all",children:r.jsx(et,{size:18})})]}),r.jsx("img",{src:e,alt:"Preview",className:"max-w-[90vw] max-h-[85vh] object-contain rounded-2xl shadow-2xl",onClick:o=>o.stopPropagation()})]})}class uE extends h.Component{constructor(t){super(t),this.state={error:null}}static getDerivedStateFromError(t){return{error:t.message??"Unknown error"}}componentDidCatch(t,n){console.error("[ChatErrorBoundary]",t,n.componentStack)}render(){return this.state.error?r.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-3 p-8 text-center",children:[r.jsx("span",{className:"text-2xl",children:"⚠️"}),r.jsx("p",{className:"text-red-400 font-bold text-sm",children:"Chat render error"}),r.jsx("p",{className:"text-orange-200/70 text-xs font-mono max-w-sm break-all",children:this.state.error}),r.jsx("button",{onClick:()=>this.setState({error:null}),className:"mt-1 px-4 py-2 rounded-xl bg-orange-900/20 border border-orange-800/30 text-orange-200 text-xs font-bold hover:bg-orange-900/40 transition-all",children:"Retry"})]}):this.props.children}}const v0=[{id:"terminal",label:"Terminal",Icon:as},{id:"browser",label:"Browser",Icon:We},{id:"image-gen",label:"Görsel Üret",Icon:uv},{id:"web-search",label:"Web Search",Icon:Xt},{id:"file-manager",label:"Files",Icon:ps},{id:"code",label:"Code",Icon:hn},{id:"screen-sense",label:"Ekranı Gör",Icon:sf}];function dE({onSend:e,onStop:t,disabled:n}){const{t:s}=pt(),[i,a]=h.useState(""),[o,l]=h.useState(!1),[c,u]=h.useState(""),[d,p]=h.useState([]),[f,m]=h.useState([]),[v,y]=h.useState(!1),b=h.useRef(null),g=h.useRef(!1),x=h.useRef(null),w=h.useRef(null),j=typeof window<"u"&&!!(window.SpeechRecognition||window.webkitSpeechRecognition),k=()=>{const L=window.SpeechRecognition||window.webkitSpeechRecognition;if(!L)return;const z=new L;z.continuous=!0,z.interimResults=!0,z.lang="tr-TR",z.onresult=B=>{let C="",M="";for(let _=B.resultIndex;_<B.results.length;_++)B.results[_].isFinal?C+=B.results[_][0].transcript:M+=B.results[_][0].transcript;C?(a(_=>(_.trim()?_.trimEnd()+" ":"")+C.trim()),u("")):u(M)},z.onend=()=>{u(""),g.current?setTimeout(k,150):(l(!1),b.current=null)},z.onerror=B=>{B.error!=="no-speech"&&l(!1),u(""),g.current&&B.error!=="not-allowed"&&setTimeout(k,500)},b.current=z;try{z.start()}catch{}},N=()=>{var L;o?(g.current=!1,(L=b.current)==null||L.stop(),u("")):(g.current=!0,l(!0),k())},S=L=>{p(z=>[...z,...Array.from(L)])},E=L=>{const z=Array.from(L.clipboardData.files);z.length&&(L.preventDefault(),S(z))},P=L=>{L.preventDefault(),S(L.dataTransfer.files)},A=L=>p(z=>z.filter((B,C)=>C!==L));h.useEffect(()=>{if(!v)return;const L=z=>{w.current&&!w.current.contains(z.target)&&y(!1)};return document.addEventListener("mousedown",L),()=>document.removeEventListener("mousedown",L)},[v]);const T=async()=>{try{const L=await navigator.mediaDevices.getDisplayMedia({video:!0}),z=document.createElement("video");z.srcObject=L,z.muted=!0,await new Promise(C=>{z.onloadedmetadata=()=>{z.play(),C()}}),await new Promise(C=>setTimeout(C,120));const B=document.createElement("canvas");B.width=z.videoWidth,B.height=z.videoHeight,B.getContext("2d").drawImage(z,0,0),L.getTracks().forEach(C=>C.stop()),B.toBlob(C=>{if(!C)return;const M=new File([C],`ekran-${Date.now()}.png`,{type:"image/png"});S([M]),a(_=>_.trim()?_:"Bu ekranı analiz et ve ne gördüğünü açıkla."),le.success("Ekran yakalandı — göndermek için ▶ basın.")},"image/png",.9)}catch(L){(L==null?void 0:L.name)!=="NotAllowedError"&&le.error("Ekran yakalanamadı.")}},V=L=>{if(L==="screen-sense"){T(),y(!1);return}m(z=>z.includes(L)?z.filter(B=>B!==L):[...z,L])},R=()=>{var B;const L=i.trim();if(!L||n)return;o&&(g.current=!1,(B=b.current)==null||B.stop(),u(""));const z=[...d];a(""),p([]),e(L,f.length>0?f:void 0,z.length>0?z:void 0)};h.useEffect(()=>{x.current&&(x.current.style.height="auto",x.current.style.height=`${Math.min(x.current.scrollHeight,160)}px`)},[i]),h.useEffect(()=>{const L=z=>{var C;const B=((C=z.detail)==null?void 0:C.text)??"";a(B),setTimeout(()=>{var M;return(M=x.current)==null?void 0:M.focus()},60)};return window.addEventListener("mustb:prefill",L),()=>window.removeEventListener("mustb:prefill",L)},[]);const I=o?c||s.chat.listening:"What do you want to know?";return r.jsx("div",{className:"max-w-3xl mx-auto w-full",children:r.jsxs("div",{className:"glass-input rounded-2xl flex flex-col px-4 pt-3 pb-3 gap-2.5",onPaste:E,onDrop:P,onDragOver:L=>L.preventDefault(),children:[d.length>0&&r.jsx("div",{className:"flex flex-wrap gap-2 px-1",children:d.map((L,z)=>r.jsxs("div",{className:"relative group w-12 h-12",children:[L.type.startsWith("image/")?r.jsx("img",{src:URL.createObjectURL(L),alt:L.name,className:"w-12 h-12 object-cover rounded-lg border border-orange-500/20"}):r.jsx("div",{className:"w-12 h-12 rounded-lg border border-orange-500/20 bg-orange-500/10 flex items-center justify-center",children:r.jsx(Qt,{size:16,className:"text-orange-400"})}),r.jsx("button",{onClick:()=>A(z),className:"absolute -top-1 -right-1 w-4 h-4 rounded-full bg-red-500 text-white flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity",children:r.jsx(et,{size:9})})]},z))}),r.jsxs("div",{className:"flex items-end gap-2",children:[r.jsxs("div",{ref:w,className:"flex items-center gap-0.5 mb-0.5 shrink-0 relative",children:[r.jsx("button",{type:"button",onClick:()=>y(L=>!L),title:"Araçlar",className:`p-2 rounded-full transition-all ${v||f.length>0?"text-orange-400 bg-orange-500/15 border border-orange-500/25":"text-white/30 hover:text-white/70 hover:bg-white/8"}`,children:r.jsx(lf,{size:16})}),r.jsx(se,{children:v&&r.jsxs(H.div,{initial:{opacity:0,y:8,scale:.97},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:6,scale:.97},transition:{duration:.14,ease:[.22,1,.36,1]},className:"absolute bottom-full mb-2 left-0 z-50 w-52 rounded-2xl p-2 shadow-2xl",style:{background:"rgba(16,7,2,0.97)",border:"1px solid rgba(249,115,22,0.18)",backdropFilter:"blur(24px)"},children:[r.jsx("p",{className:"px-2.5 pt-1.5 pb-1 text-[9.5px] font-black uppercase tracking-[0.14em] text-orange-400/60",children:"Araçlar"}),v0.map(({id:L,label:z,Icon:B})=>{const C=f.includes(L);return r.jsxs("button",{onClick:()=>V(L),className:`w-full flex items-center gap-2.5 px-2.5 py-2 rounded-xl transition-all text-left ${C?"bg-orange-500/15 text-orange-300":"text-white/55 hover:bg-white/6 hover:text-white/90"}`,children:[r.jsx(B,{size:13,className:C?"text-orange-400":"text-white/30"}),r.jsx("span",{className:"text-[12px] font-medium",children:z}),C&&r.jsx("span",{className:"ml-auto w-3.5 h-3.5 rounded-full bg-orange-500/30 border border-orange-500/60 flex items-center justify-center text-[8px] text-orange-300",children:"✓"})]},L)})]})}),r.jsxs("label",{className:"p-2 rounded-full cursor-pointer text-white/30 hover:text-white/70 hover:bg-white/8 transition-all",title:s.chat.attachFile,children:[r.jsx(_C,{size:16}),r.jsx("input",{type:"file",multiple:!0,className:"hidden",onChange:L=>L.target.files&&S(L.target.files)})]})]}),r.jsx("textarea",{ref:x,value:i,onChange:L=>a(L.target.value),onKeyDown:L=>{L.key==="Enter"&&!L.shiftKey&&(L.preventDefault(),R())},placeholder:I,disabled:n,rows:1,className:"flex-1 bg-transparent text-white/90 placeholder-white/35 text-[15px] outline-none resize-none min-h-[28px] max-h-[160px] scrollbar-hide leading-relaxed"}),r.jsxs("div",{className:"flex items-center gap-1.5 mb-0.5 shrink-0",children:[j&&r.jsx("button",{onClick:N,title:o?"Stop dictation":"Start voice dictation (append mode)",className:`p-2 rounded-full transition-all ${o?"text-red-400 bg-red-500/15 border border-red-500/30 shadow-[0_0_10px_rgba(239,68,68,0.3)]":"text-white/40 hover:text-white/70 hover:bg-white/8"}`,children:o?r.jsx(nC,{size:17,className:"animate-pulse"}):r.jsx(Ds,{size:17})}),n?r.jsx("button",{onClick:t,title:"Durdur",className:"w-9 h-9 rounded-full flex items-center justify-center transition-all bg-red-600/80 hover:bg-red-500 text-white shadow-[0_0_12px_rgba(239,68,68,0.5)] active:scale-95",children:r.jsx(of,{size:14})}):r.jsx("button",{onClick:R,disabled:!i.trim(),className:`w-9 h-9 rounded-full flex items-center justify-center transition-all ${i.trim()?"bg-orange-600 hover:bg-orange-500 text-white shadow-[0_0_15px_rgba(249,115,22,0.4)] active:scale-95":"bg-white/10 text-white/25 cursor-not-allowed"}`,children:r.jsx(hv,{size:16})})]})]}),r.jsxs("div",{className:"flex items-center justify-between gap-2",children:[f.length>0?r.jsx("div",{className:"flex flex-wrap gap-1.5 flex-1",children:f.map(L=>{const z=v0.find(M=>M.id===L);if(!z)return null;const{Icon:B,label:C}=z;return r.jsxs("span",{className:"flex items-center gap-1 pl-2 pr-1 py-0.5 rounded-full bg-orange-500/15 border border-orange-500/25 text-orange-300 text-[11px] font-medium",children:[r.jsx(B,{size:10}),r.jsx("span",{children:C}),r.jsx("button",{type:"button",onClick:()=>V(L),className:"ml-0.5 p-0.5 rounded-full hover:bg-orange-500/20 text-orange-400/60 hover:text-orange-300 transition-colors",children:r.jsx(et,{size:9})})]},L)})}):r.jsx("div",{className:"flex-1"}),r.jsx(eE,{})]})]})})}function Ic(e){return`mustb_chat_turns_${e}`}function hE(){const{t:e,setLocale:t}=pt(),n=h.useRef(e);h.useEffect(()=>{n.current=e},[e]);const[s]=Yk(),i=mn(),a=s.get("chat")??"default",o=h.useRef(null),[l,c]=h.useState(null),[u,d]=h.useState(null),[p,f]=h.useState(""),[m,v]=h.useState(null),[y,b]=h.useState(()=>{try{const R=localStorage.getItem(Ic(a));if(R)return JSON.parse(R)}catch{}return[]}),g=h.useRef(null),x=h.useRef(null),w=h.useRef(a),[j,k]=h.useState(!1),[N,S]=h.useState(null),E=y.some(R=>R.kind==="assistant"&&R.status==="pending");h.useEffect(()=>{w.current=a;try{const R=localStorage.getItem(Ic(a));b(R?JSON.parse(R):[])}catch{b([])}g.current=null},[a]),h.useEffect(()=>{if(a==="default"||!o.current)return;const R=o.current;o.current=null,setTimeout(()=>T(R.text,R.tools,R.files),0)},[a]),h.useEffect(()=>{const R=at();return R.on("agentUpdate",I=>{const{type:L,...z}=I;if(L==="memorySearch")return;if(L==="planStart"){const M=`asst-${Date.now()}-${Math.random().toString(36).slice(2)}`;g.current=M,b(_=>[..._,{id:M,kind:"assistant",content:"",thoughts:[],steps:[],status:"pending",startedAt:Date.now()}]);return}if(L==="stepStart"){const M=g.current;if(!M)return;const _=z.step,U=(_==null?void 0:_.description)??sn(z.step);b(K=>K.map(Y=>Y.id===M?{...Y,steps:[...Y.steps??[],{label:U,status:"running"}]}:Y));return}if(L==="stepFinish"){const M=g.current;if(!M)return;const _=z.status==="error",U=z.step,K=(U==null?void 0:U.description)??"Step",Y=z.result!==void 0?sn(z.result):void 0,J=Y&&Y.length>120?Y.slice(0,120)+"…":Y;b(ce=>ce.map(oe=>{if(oe.id!==M)return oe;const re=[...oe.steps??[]],De=re.map(ot=>ot.status).lastIndexOf("running");return De>=0&&(re[De]={label:K,status:_?"error":"done",result:J}),{...oe,steps:re}}));return}if(L==="terminalLog"){const M=g.current;if(!M)return;const _=sn(z.line??"");if(!_)return;b(U=>U.map(K=>{if(K.id!==M)return K;const Y=[...K.steps??[]],J=Y.map(re=>re.status).lastIndexOf("running");if(J<0)return K;const ce=Y[J],oe=ce.logs??[];return oe.length>=100?K:(Y[J]={...ce,logs:[...oe,_]},{...K,steps:Y})}));return}if(L==="finalAnswer"){const M=g.current;if(!M)return;b(_=>_.map(U=>U.id===M?{...U,content:sn(z.answer??"Done.")}:U));return}if(L==="planFinish"){k(!1);const M=g.current;if(!M)return;const _=z.status==="failed"?"error":"done",U=z.status==="completed"?{goal:String(z.goal??""),answer:String(z.answer??""),steps:z.steps??[]}:void 0;b(K=>K.map(Y=>Y.id===M?{...Y,status:_,...U?{workflow:U}:{}}:Y)),g.current=null;return}if(L==="professionResearched"){const M=String(z.profession??"");if(!M)return;const _=n.current.chat.professionAck.replace("{profession}",M);b(U=>[...U,{id:`prof-ack-${Date.now()}`,kind:"assistant",content:_,thoughts:[],status:"done"}]);return}const B=tE(L,z);if(!B)return;const C=g.current;C&&b(M=>M.map(_=>_.id===C?{..._,thoughts:[..._.thoughts,B]}:_))}),()=>{R.off("agentUpdate")}},[]),h.useEffect(()=>{var R;(R=x.current)==null||R.scrollIntoView({behavior:"smooth"})},[y]),h.useEffect(()=>{const R=I=>{var C;const L=(C=I.detail)==null?void 0:C.skill;if(!L)return;const B={"web-search":"Search the web for: ","web-fetch":"Fetch and summarize this URL: ",browser:"Open the browser and navigate to: ",pdf:"Read and summarize this PDF: ","image-analysis":"Analyze this image: ","image-generate":"Generate an image of: ",tts:"Convert this text to speech: ","spawn-agent":"Spawn a new agent to: ",sessions:"List all active agent sessions",canvas:"Open the canvas workspace",git:"Run a git operation: ",gateway:"Connect to Must-b gateway node: ","file-manager":"Open the file manager",cron:"Create a scheduled task: ",messages:"Check and reply to messages","memory-add":"Save this to memory: ",contacts:"Look up contact: ",calendar:"Check my calendar for: ",automations:"Create an automation that: ","scheduled-tasks":"List all scheduled tasks",commands:"Run this command: ",nodes:"List all gateway nodes","multi-agent":"Start a multi-agent workflow to: ","chat-focus":""}[L]??`Run skill "${L}": `;window.dispatchEvent(new CustomEvent("mustb:prefill",{detail:{text:B}}))};return window.addEventListener("mustb:invoke-skill",R),()=>window.removeEventListener("mustb:invoke-skill",R)},[]),h.useEffect(()=>{if(w.current===a)try{localStorage.setItem(Ic(a),JSON.stringify(y))}catch{}},[y,a]),h.useEffect(()=>{if(!j)return;let R=null;const I=setTimeout(()=>{R=setInterval(async()=>{try{const L=await $("/api/status");if(!L.ok)return;(await L.json()).busy===!1&&(R&&(clearInterval(R),R=null),k(!1),b(B=>B.map(C=>C.status!=="pending"?C:{...C,status:C.content?"done":"error",content:C.content||"Task completed but the result was not received (connection lost). Please retry if needed."})),g.current=null)}catch{}},5e3)},1e4);return()=>{clearTimeout(I),R&&clearInterval(R)}},[j]),h.useEffect(()=>{const R=y[y.length-1];if(!R||R.kind!=="assistant"||R.status!=="done"||!R.content)return;const I=[...y].reverse().find(z=>z.kind==="user");if(!I)return;const L=`Q: ${I.content}
722
+ A: ${R.content.slice(0,400)}`;fetch("/api/memory/ltm/semantic",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:L,tags:["chat","autosave"]})}).catch(()=>{})},[y.length]);const P=R=>{const I=[[/\b(spanish mode|speak spanish|habla español|en español)\b/i,"es"],[/\b(french mode|speak french|en français|parle français)\b/i,"fr"],[/\b(german mode|speak german|auf deutsch|deutsch mode)\b/i,"de"],[/\b(japanese mode|speak japanese|日本語モード)\b/i,"ja"],[/\b(chinese mode|speak chinese|中文模式)\b/i,"zh"],[/\b(portuguese mode|fala português)\b/i,"pt"],[/\b(turkish mode|türkçe mode|türkçe konuş)\b/i,"tr"],[/\b(english mode|switch to english|speak english)\b/i,"en"]],L={tr:"Anlaşıldı, ayarlar kalıcı olarak güncellendi.",en:"Got it, settings updated permanently.",es:"Entendido, configuración actualizada permanentemente.",fr:"Compris, paramètres mis à jour définitivement.",de:"Verstanden, Einstellungen dauerhaft aktualisiert.",ja:"了解です。設定が永久に更新されました。",zh:"明白,设置已永久更新。",pt:"Entendido, configurações atualizadas permanentemente."};for(const[B,C]of I)if(B.test(R)){t(C);const M=L[C]??L.en;return b(_=>[..._,{id:`cfg-lang-${Date.now()}`,kind:"assistant",content:M,thoughts:[],status:"done"}]),!0}const z=[[/use\s+gpt[-\s]?4o?\b/i,"openai/gpt-4o"],[/use\s+(claude[-\s]?3\.5|claude[-\s]?sonnet|claude[-\s]?opus)\b/i,"anthropic/claude-3-5-sonnet"],[/use\s+(gemini[-\s]?flash|gemini[-\s]?pro|gemini)\b/i,"google/gemini-flash"],[/use\s+(llama[-\s]?3|llama)\b/i,"meta-llama/llama-3-70b-instruct:free"],[/use\s+mistral\b/i,"mistralai/mistral-7b-instruct:free"],[/use\s+deepseek\b/i,"deepseek/deepseek-chat"]];for(const[B,C]of z)if(B.test(R))return $("/api/settings/model",{method:"POST",body:JSON.stringify({model:C})}).catch(()=>{}),b(M=>[...M,{id:`cfg-model-${Date.now()}`,kind:"assistant",content:e.chat.settingsAck,thoughts:[],status:"done"}]),!0;return!1},A=R=>{const I=[[/\bi(?:'m| am)\s+a(?:n)?\s+(lawyer|attorney|solicitor|barrister)\b/i,"lawyer"],[/\bi(?:'m| am)\s+a(?:n)?\s+(doctor|physician|nurse|surgeon|pharmacist)\b/i,"medical"],[/\bi(?:'m| am)\s+a(?:n?)?\s+(software engineer|developer|programmer|coder)\b/i,"software-engineer"],[/\bi(?:'m| am)\s+a(?:n)?\s+(teacher|professor|educator|instructor)\b/i,"educator"],[/\bi(?:'m| am)\s+a(?:n)?\s+(accountant|auditor|financial advisor|analyst)\b/i,"finance"],[/\bi(?:'m| am)\s+a(?:n)?\s+(architect|civil engineer|structural engineer)\b/i,"engineering"],[/\bi(?:'m| am)\s+a(?:n)?\s+(designer|ux designer|graphic designer)\b/i,"designer"],[/\bi(?:'m| am)\s+a(?:n?)?\s+(data scientist|ml engineer|ai researcher)\b/i,"data-science"],[/\bben\s+bir?\s+avukat\b/i,"lawyer"],[/\bavukat(?:ım|ım)?\b/i,"lawyer"],[/\bben\s+bir?\s+doktor\b/i,"medical"],[/\bdoktor(?:um|um)?\b/i,"medical"],[/\bben\s+bir?\s+hemşire\b/i,"medical"],[/\bben\s+bir?\s+mühendis\b/i,"engineering"],[/\bmühendis(?:im|im)?\b/i,"engineering"],[/\bben\s+bir?\s+yazılımcı\b/i,"software-engineer"],[/\byazılımcı(?:yım|yım)?\b/i,"software-engineer"],[/\bben\s+bir?\s+öğretmen\b/i,"educator"],[/\böğretmen(?:im|im)?\b/i,"educator"],[/\bben\s+bir?\s+muhasebeci\b/i,"finance"],[/\bmuhasebeci(?:yim|yim)?\b/i,"finance"],[/\bben\s+bir?\s+tasarımcı\b/i,"designer"],[/\btasarımcı(?:yım|yım)?\b/i,"designer"],[/\bben\s+bir?\s+mimar\b/i,"engineering"],[/\bmimar(?:ım|ım)?\b/i,"engineering"]];for(const[L,z]of I)if(L.test(R)){$("/api/memory/profession-research",{method:"POST",body:JSON.stringify({profession:z,userMessage:R})}).catch(()=>{});break}},T=async(R,I,L)=>{if(R.startsWith("__GUIDANCE__")){const _=R.slice(12);b(U=>[...U,{id:`guidance-${Date.now()}`,kind:"assistant",content:`ℹ ${_}`,thoughts:[],status:"done"}]);return}if(P(R))return;A(R);let z=R;if(I!=null&&I.includes("image-gen")&&!R.toLowerCase().startsWith("generate")&&!R.toLowerCase().startsWith("create")&&(z=`Görsel oluştur: ${R}`),a==="default")try{const _=R.trim().split(/\s+/).slice(0,4).join(" "),U=await $("/api/chats",{method:"POST",body:JSON.stringify({title:_})});if(U.ok){const K=await U.json();o.current={text:z,tools:I,files:L},i(`/app?chat=${K.id}`);return}}catch{}if(!y.some(_=>_.kind==="user")&&a!=="default"){const _=R.trim().split(/\s+/).slice(0,4).join(" ");_&&$(`/api/chats/${a}`,{method:"PATCH",body:JSON.stringify({title:_})}).then(()=>{window.dispatchEvent(new CustomEvent("mustb:chat-renamed",{detail:{id:a,title:_}}))}).catch(()=>{})}b(_=>_.map(U=>({...U,workflow:void 0})));const C=L==null?void 0:L.filter(_=>_.type.startsWith("image/")).map(_=>URL.createObjectURL(_));b(_=>[..._,{id:`user-${Date.now()}`,kind:"user",content:R,thoughts:[],status:"done",...C!=null&&C.length?{attachments:C}:{}}]);const M={goal:z};if(I&&I.length>0&&(M.focus_tools=I),L&&L.length>0)try{M.attachments=await Promise.all(L.map(async _=>({name:_.name,type:_.type,data:await nE(_)})))}catch{}k(!0);try{await $("/api/goal",{method:"POST",body:JSON.stringify(M)})}catch{k(!1)}},V=y.length>0;return r.jsxs(uE,{children:[l&&r.jsx(cE,{src:l,onClose:()=>c(null)}),r.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[r.jsx("div",{className:"flex-1 overflow-y-auto scrollbar-hide",children:V?r.jsxs("div",{className:"max-w-3xl mx-auto w-full px-5 pt-6 pb-4",children:[y.map(R=>{if(R.kind==="user"){const _=u===R.id;return r.jsx("div",{className:"flex justify-end mb-5 group/userturn",children:r.jsxs("div",{className:_?"w-full max-w-3xl flex flex-col items-end gap-2":"max-w-[78%] flex flex-col items-end gap-2",children:[R.attachments&&R.attachments.length>0&&r.jsx("div",{className:"flex flex-wrap gap-2 justify-end",children:R.attachments.map((U,K)=>r.jsxs("div",{className:"relative group w-24 h-24 shrink-0",children:[r.jsx("img",{src:U,alt:`attachment-${K}`,onClick:()=>c(U),width:96,height:96,className:"w-24 h-24 object-cover rounded-xl border border-orange-500/25 hover:opacity-90 transition-opacity duration-150 cursor-zoom-in",style:{minWidth:96,minHeight:96}}),r.jsx("button",{onClick:Y=>{Y.stopPropagation(),T("Bu görseli analiz et ve açıkla",void 0,void 0)},title:"Düzenle / Analiz Et",className:"absolute bottom-1 right-1 w-6 h-6 flex items-center justify-center rounded-full bg-black/70 hover:bg-orange-600 opacity-0 group-hover:opacity-100 transition-all duration-150 text-white",children:r.jsx(o0,{size:11})})]},K))}),_?r.jsxs("div",{className:"w-full flex flex-col gap-2",children:[r.jsx("textarea",{autoFocus:!0,value:p,onChange:U=>f(U.target.value),onKeyDown:U=>{if(U.key==="Enter"&&!U.shiftKey){U.preventDefault();const K=p.trim();if(!K)return;const Y=y.findIndex(J=>J.id===R.id);b(J=>J.slice(0,Y)),d(null),setTimeout(()=>T(K),0)}U.key==="Escape"&&d(null)},rows:Math.min(8,p.split(`
723
+ `).length+1),className:"w-full rounded-2xl px-5 py-3 text-white text-[14px] leading-relaxed resize-none outline-none",style:{background:"rgba(25,10,2,0.85)",border:"1px solid rgba(249,115,22,0.5)",backdropFilter:"blur(12px)"}}),r.jsxs("div",{className:"flex gap-2 justify-end",children:[r.jsx("button",{onClick:()=>d(null),className:"px-3 py-1.5 rounded-xl text-[12px] text-white/40 hover:text-white/70 border border-white/10 hover:bg-white/5 transition-all",children:"Cancel"}),r.jsx("button",{onClick:()=>{const U=p.trim();if(!U)return;const K=y.findIndex(Y=>Y.id===R.id);b(Y=>Y.slice(0,K)),d(null),setTimeout(()=>T(U),0)},className:"px-3 py-1.5 rounded-xl text-[12px] bg-orange-600 hover:bg-orange-500 text-white font-semibold transition-all",children:"Resend"})]})]}):r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"rounded-2xl rounded-br-sm px-5 py-3 text-white text-[14px] leading-relaxed whitespace-pre-wrap",style:{background:"rgba(25,10,2,0.72)",border:"1px solid rgba(249,115,22,0.22)",backdropFilter:"blur(12px)"},children:R.content}),r.jsxs("div",{className:"flex gap-1 opacity-0 group-hover/userturn:opacity-100 transition-opacity duration-150",children:[r.jsx("button",{onClick:()=>{navigator.clipboard.writeText(R.content).catch(()=>{}),v(R.id),setTimeout(()=>v(null),2e3)},title:"Copy message",className:"flex items-center gap-1 px-2 py-1 rounded-lg text-[11px] text-white/30 hover:text-white/70 hover:bg-white/6 border border-white/6 transition-all",children:m===R.id?r.jsxs(r.Fragment,{children:[r.jsx(zt,{size:10,className:"text-green-400"}),r.jsx("span",{className:"text-green-400",children:"Copied"})]}):r.jsxs(r.Fragment,{children:[r.jsx(aa,{size:10}),"Copy"]})}),r.jsxs("button",{onClick:()=>{d(R.id),f(R.content)},title:"Edit and resend",className:"flex items-center gap-1 px-2 py-1 rounded-lg text-[11px] text-white/30 hover:text-orange-400 hover:bg-orange-500/8 border border-white/6 transition-all",children:[r.jsx(o0,{size:10}),"Edit"]})]})]})]})},R.id)}const I=R.thoughts.length>0,L=R.content.length>0,z=R.status==="pending",B=R.status==="error"&&!L,C=R.steps??[],M=C.length>0;return r.jsxs("div",{className:"mb-8",children:[r.jsxs("div",{className:"flex items-center gap-2 mb-2.5",children:[r.jsxs("div",{className:"relative w-5 h-5 shrink-0",children:[r.jsx("div",{className:"absolute inset-0 bg-orange-600/30 rounded-full blur-sm"}),r.jsx("img",{src:"/logo.png",alt:"Must-b",className:"w-full h-full object-contain relative z-10"})]}),r.jsx("span",{className:"text-[12px] font-semibold text-white/70 tracking-wide",children:"Must-b"}),I&&r.jsxs("span",{className:"text-[10px] text-white/35 font-mono",children:[R.thoughts.length," step",R.thoughts.length!==1?"s":""]})]}),M&&r.jsxs("div",{className:"mb-3 rounded-xl overflow-hidden",style:{background:"rgba(0,0,0,0.35)",border:"1px solid rgba(255,255,255,0.06)"},children:[r.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1.5 border-b border-white/5",children:[r.jsx(as,{size:10,className:"text-orange-400/60 shrink-0"}),r.jsx("span",{className:"text-[10px] font-mono text-orange-400/50 tracking-widest uppercase",children:"execution log"}),z&&r.jsxs("div",{className:"ml-auto flex items-center gap-2 shrink-0",children:[r.jsx(aE,{startedAt:R.startedAt}),r.jsx(ne,{size:10,className:"animate-spin text-orange-400/50 shrink-0"})]})]}),r.jsx("div",{className:"px-3 py-2 space-y-2",children:C.map((_,U)=>r.jsxs("div",{children:[r.jsxs("div",{className:"flex items-start gap-2 font-mono text-[11px] leading-relaxed",children:[_.status==="running"&&r.jsx(ne,{size:11,className:"animate-spin text-orange-400 shrink-0 mt-0.5"}),_.status==="done"&&r.jsx(Ve,{size:11,className:"text-emerald-400 shrink-0 mt-0.5"}),_.status==="error"&&r.jsx("span",{className:"text-red-400 shrink-0 leading-none mt-0.5",children:"✗"}),r.jsxs("span",{className:_.status==="running"?"text-orange-300/90":_.status==="done"?"text-white/45":"text-red-300/70",children:[_.label,_.result&&r.jsxs("span",{className:"text-white/25",children:[" → ",_.result]})]})]}),_.logs&&_.logs.length>0&&r.jsx(oE,{logs:_.logs,isRunning:_.status==="running"})]},U))})]}),I&&r.jsxs("details",{className:"mb-3 group",style:{background:"rgba(255,255,255,0.025)",borderRadius:"10px",padding:"6px 10px"},children:[r.jsxs("summary",{className:"flex items-center gap-1.5 cursor-pointer list-none select-none w-fit",children:[r.jsx(dn,{size:10,className:"text-orange-400/50 group-open:rotate-90 transition-transform duration-150 flex-shrink-0"}),r.jsxs("span",{className:"text-[10px] font-semibold text-orange-300/50 hover:text-orange-300/80 transition-colors tracking-wide uppercase",children:[R.thoughts.length," detail",R.thoughts.length!==1?"s":""," · Thought process"]})]}),r.jsx("div",{className:"mt-2 ml-3.5 pl-3 border-l border-orange-500/15 space-y-1",children:R.thoughts.map((_,U)=>r.jsx("p",{className:"text-[11px] font-mono text-white/30 leading-relaxed break-all",children:_},U))})]}),L?r.jsxs("div",{className:"w-full py-2",children:[r.jsx(rE,{text:R.content,dark:!0}),r.jsx("div",{className:"flex justify-end mt-3",children:r.jsx("button",{onClick:()=>{navigator.clipboard.writeText(R.content).catch(()=>{}),S(R.id),setTimeout(()=>S(null),2e3)},className:"flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg text-white/30 hover:text-white/70 hover:bg-white/6 text-[11px] transition-all border border-white/6",children:N===R.id?r.jsxs(r.Fragment,{children:[r.jsx(zt,{size:12,className:"text-green-400"})," Kopyalandı"]}):r.jsxs(r.Fragment,{children:[r.jsx(aa,{size:12})," Kopyala"]})})})]}):z?M?null:r.jsxs("div",{className:"flex items-center gap-2 py-2 px-1",children:[[0,120,240].map(_=>r.jsx("div",{className:"w-1.5 h-1.5 rounded-full animate-bounce",style:{background:"rgba(251,146,60,0.7)",animationDelay:`${_}ms`}},_)),r.jsx("span",{className:"text-[11px] text-white/25 ml-1",children:"Planning…"}),r.jsx(iE,{})]}):B?r.jsxs("div",{className:"rounded-xl px-4 py-3 flex items-center gap-2",style:{background:"rgba(239,68,68,0.08)",border:"1px solid rgba(239,68,68,0.2)"},children:[r.jsx("span",{className:"text-red-400 text-sm",children:"⚠"}),r.jsx("p",{className:"text-sm text-red-300/80",children:"Something went wrong. Please try again."})]}):null,r.jsx(se,{children:R.workflow&&!z&&r.jsx(lE,{workflow:R.workflow,onDismiss:()=>b(_=>_.map(U=>U.id===R.id?{...U,workflow:void 0}:U))})})]},R.id)}),r.jsx("div",{ref:x,className:"h-2"})]}):r.jsx("div",{className:"flex flex-col items-center justify-center h-full px-6 select-none",children:r.jsx(se,{children:r.jsx(H.div,{initial:{opacity:0,y:16},animate:{opacity:1,y:0},exit:{opacity:0,y:-10,scale:.96},transition:{duration:.55,ease:"easeOut"},className:"flex flex-col items-center gap-4 mb-10",children:r.jsx("span",{className:"font-black tracking-tighter select-none leading-none px-2 w-full text-center",style:{fontSize:"clamp(56px, 16vw, 120px)",background:"linear-gradient(135deg, rgba(249,115,22,0.92) 0%, rgba(253,186,116,0.75) 40%, rgba(255,255,255,0.30) 100%)",WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent",backgroundClip:"text",paddingBottom:"0.05em",paddingRight:"20px"},children:"Must-b"})},"hero")})})}),r.jsxs("div",{className:"shrink-0 px-4 pb-3 pt-2",children:[r.jsx(dE,{onSend:(R,I,L)=>T(R,I,L),onStop:()=>{k(!1),$("/api/goal/abort",{method:"POST"}).catch(()=>{}),b(R=>R.map(I=>{if(I.status!=="pending")return I;const L=I.content||(I.thoughts.length>0?`⏹ Durduruldu.
724
724
 
725
725
  **Tamamlanan adımlar:**
726
726
  ${I.thoughts.join(`
727
- `)}`:"⏹ Durduruldu.");return{...I,status:"done",content:L}})),g.current=null},disabled:j||E}),r.jsx("p",{className:"text-center text-[11px] text-white/20 mt-2 select-none",children:e.chat.disclaimer})]})]})]})}function fE(){const[e,t]=h.useState(!1);return h.useEffect(()=>{const n=at();return n.on("agentUpdate",s=>{s.type==="SCREEN_CAPTURE_START"&&t(!0),(s.type==="SCREEN_CAPTURED"||s.type==="SCREEN_CAPTURE_END")&&setTimeout(()=>t(!1),700)}),()=>{n.off("agentUpdate")}},[]),r.jsx(se,{children:e&&r.jsxs(H.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.25},className:"fixed inset-0 z-[9999] pointer-events-none",children:[r.jsxs("div",{className:"absolute inset-0",children:[r.jsx("div",{className:"absolute top-0 left-0 w-12 h-12 border-t-2 border-l-2 border-orange-500/70"}),r.jsx("div",{className:"absolute top-0 right-0 w-12 h-12 border-t-2 border-r-2 border-orange-500/70"}),r.jsx("div",{className:"absolute bottom-0 left-0 w-12 h-12 border-b-2 border-l-2 border-orange-500/70"}),r.jsx("div",{className:"absolute bottom-0 right-0 w-12 h-12 border-b-2 border-r-2 border-orange-500/70"})]}),r.jsx(H.div,{className:"absolute left-0 right-0 h-[2px] bg-gradient-to-r from-transparent via-orange-500/60 to-transparent",animate:{top:["0%","100%"]},transition:{duration:1.4,repeat:1/0,ease:"linear"}}),r.jsx("div",{className:"absolute top-4 left-1/2 -translate-x-1/2",children:r.jsxs(H.div,{initial:{y:-10,opacity:0},animate:{y:0,opacity:1},className:"flex items-center gap-2 px-4 py-2 bg-black/80 border border-orange-500/30 rounded-full shadow-[0_0_20px_rgba(234,88,12,0.3)] backdrop-blur-xl",children:[r.jsxs("span",{className:"relative flex h-2 w-2",children:[r.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-orange-400 opacity-75"}),r.jsx("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-orange-500"})]}),r.jsx(oa,{size:12,className:"text-orange-400 animate-spin"}),r.jsx("span",{className:"text-orange-300 text-xs font-semibold tracking-wide",children:"Scanning screen…"})]})})]},"scan-overlay")})}const Ya={button:"rgba(234,88,12,0.7)",input:"rgba(59,130,246,0.7)",image:"rgba(168,85,247,0.6)",unknown:"rgba(255,255,255,0.3)"},pE={browse:We,write:Qt,think:Yt,exec:as},mE={running:"bg-orange-500/8 border border-orange-500/20 text-orange-300",done:"bg-green-500/5 border border-green-500/10 text-gray-500",queued:"bg-white/2 border border-white/5 text-gray-600"},gE={mouseMove:CC,mouseClick:cv,typeText:gC,visionClick:Ls},xE={mouseMove:"text-gray-500",mouseClick:"text-orange-400",typeText:"text-blue-400",visionClick:"text-purple-400"};function yE(){const{t:e}=pt(),[t,n]=h.useState(!1),[s,i]=h.useState(null),[a,o]=h.useState(null),[l,c]=h.useState(!1),u=h.useRef(null),[d,p]=h.useState(null),[f,m]=h.useState(!1),[b,y]=h.useState(()=>new Array(3).fill(null)),[v,g]=h.useState(0),[x,w]=h.useState([]),[j,k]=h.useState(null),[N,S]=h.useState([]),E=h.useRef(null),[P,M]=h.useState(!1),[T,V]=h.useState(!1);h.useEffect(()=>{if(!s||!u.current)return;const z=u.current,B=z.getContext("2d");if(!B)return;const C=new Image;C.onload=()=>{var A;if(z.width=C.width,z.height=C.height,B.drawImage(C,0,0),(A=s.elements)!=null&&A.length)for(const _ of s.elements)B.strokeStyle=Ya[_.type]??Ya.unknown,B.lineWidth=Math.max(2,Math.round(C.width/400)),B.strokeRect(_.x,_.y,_.width,_.height),B.fillStyle=Ya[_.type]??Ya.unknown,B.font=`${Math.max(10,Math.round(C.width/120))}px monospace`,B.fillText(_.type,_.x+4,_.y+14)},C.src=`data:image/png;base64,${s.base64}`},[s]),h.useEffect(()=>{const z=at(),B=C=>{if(C.type==="SCREEN_CAPTURE_START"&&n(!0),C.type==="SCREEN_CAPTURED"&&(n(!1),i({base64:C.base64,width:C.width,height:C.height,source:C.source,elements:C.elements}),M(!1),V(!1)),C.type==="workflowStart"&&(k(C.goal??null),w(C.steps??[]),M(!1),V(!1)),C.type==="workflowStep"&&C.step){const A=C.step;w(_=>_.map(U=>U.id===A.id?A:U))}if(C.type==="workflowDone"&&setTimeout(()=>{w([]),k(null)},2500),C.type==="shadowFrame"&&typeof C.slot!="number"&&(p(C.base64),m(!0),M(!1)),C.type==="shadowToggle"&&typeof C.slot!="number"&&(m(C.enabled),C.enabled||p(null)),C.type==="ghostFrame"){const A=typeof C.slot=="number"?C.slot:-1;A>=0&&A<=2&&typeof C.base64=="string"&&(y(_=>{const U=[..._];return U[A]=C.base64,U}),M(!1))}if(C.type==="ghostSlot"){const A=typeof C.slot=="number"?C.slot:-1;A>=0&&A<=2&&g(A)}if(C.type==="shadowToggle"&&typeof C.slot=="number"){const A=C.slot;A>=0&&A<=2&&!C.enabled&&y(_=>{const U=[..._];return U[A]=null,U})}if(C.type==="inputAction"){const A={id:`${Date.now()}-${Math.random()}`,action:C.action??"mouseClick",label:C.label??"",timestamp:C.timestamp??Date.now()};S(_=>[..._.slice(-11),A]),M(!1),V(!1)}};return z.on("agentUpdate",B),()=>{z.off("agentUpdate",B)}},[]),h.useEffect(()=>{var z;(z=E.current)==null||z.scrollIntoView({behavior:"smooth"})},[N]);const R=async()=>{if(!t){try{const z=await $("/api/system/vision-guidance");if(z.ok){const B=await z.json();B.warn&&B.message&&o(B.message)}}catch{}await $("/api/system/screenshot",{method:"POST",body:JSON.stringify({detect:!0})}).catch(()=>{})}},I=b.some(z=>z!==null);return!(s||x.length>0||N.length>0||t||f||I)||T?null:r.jsx(se,{children:r.jsxs(H.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.22},className:"mx-4 mb-3 bg-[#0a0d16] border border-orange-500/12 rounded-2xl overflow-hidden shadow-xl shadow-orange-500/4 shrink-0",children:[r.jsxs("div",{className:"flex items-center justify-between px-4 py-2 border-b border-white/5",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("span",{className:"w-2 h-2 rounded-full bg-orange-500 animate-pulse"}),r.jsx("span",{className:"text-[10px] font-bold text-orange-400 uppercase tracking-widest",children:"War Room"}),s&&r.jsxs("span",{className:"text-[10px] text-gray-600 font-mono",children:[s.width,"×",s.height]}),f&&r.jsxs("span",{className:"flex items-center gap-1 text-[10px] font-bold text-purple-400 bg-purple-500/10 border border-purple-500/25 px-2 py-0.5 rounded-full",children:[r.jsx(Ka,{size:9,className:"animate-pulse"}),"Shadow Active"]})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsxs("button",{onClick:R,disabled:t,className:`flex items-center gap-1 px-2.5 py-1 rounded-lg text-[11px] font-medium transition-all ${t?"text-orange-400 bg-orange-500/10 animate-pulse cursor-not-allowed":"text-gray-600 hover:text-orange-400 hover:bg-orange-500/8 border border-white/5"}`,children:[r.jsx(oa,{size:10}),t?"Scanning…":"Capture"]}),s&&r.jsx("button",{onClick:()=>c(z=>!z),className:"text-gray-700 hover:text-gray-400 transition-colors",title:l?"Collapse preview":"Expand preview",children:l?r.jsx(Zh,{size:12}):r.jsx(Ls,{size:12})}),r.jsx("button",{onClick:()=>M(z=>!z),className:"text-gray-700 hover:text-gray-400 transition-colors",title:P?"Expand war room":"Collapse war room",children:P?r.jsx(Kr,{size:12}):r.jsx(Ml,{size:12})}),r.jsx("button",{onClick:()=>V(!0),className:"text-gray-700 hover:text-red-400 transition-colors",title:"Dismiss war room",children:r.jsx(et,{size:12})})]})]}),r.jsx(se,{children:!P&&r.jsxs(H.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.2},className:"overflow-hidden",children:[a&&r.jsxs("div",{className:"px-4 py-2 bg-amber-500/8 border-b border-amber-500/15 flex items-start justify-between gap-2",children:[r.jsx("p",{className:"text-[11px] text-amber-400 leading-relaxed flex-1",children:a}),r.jsx("button",{onClick:()=>o(null),className:"text-[10px] text-amber-600 hover:text-amber-400 shrink-0",children:"Dismiss"})]}),r.jsxs("div",{className:"flex gap-0 divide-x divide-white/5",children:[r.jsx("div",{className:"w-1/2 shrink-0",children:I&&b[v]?r.jsxs("div",{className:"flex flex-col",children:[r.jsx("div",{className:"flex border-b border-white/5",children:[0,1,2].map(z=>b[z]!==null&&r.jsxs("button",{onClick:()=>g(z),className:`flex items-center gap-0.5 px-2 py-1 text-[9px] font-bold transition-colors ${v===z?"text-purple-400 border-b-2 border-purple-500":"text-gray-600 hover:text-gray-400"}`,children:[r.jsx(Ka,{size:7})," G",z+1]},z))}),r.jsxs("div",{className:`relative overflow-hidden transition-all duration-300 ${l?"max-h-[300px]":"max-h-[110px]"}`,children:[r.jsx("img",{src:`data:image/jpeg;base64,${b[v]}`,alt:`Ghost ${v+1}`,className:"w-full object-contain"}),r.jsxs("div",{className:"absolute top-1.5 left-1.5 flex items-center gap-1 px-2 py-0.5 bg-black/75 rounded-lg text-[9px] font-bold text-purple-400 border border-purple-500/30",children:[r.jsx(Ka,{size:8,className:"animate-pulse"})," G",v+1]}),r.jsx("div",{className:"absolute bottom-1.5 right-1.5 px-1.5 py-0.5 bg-black/70 rounded text-[8px] font-mono text-purple-300 border border-purple-500/20",children:"LIVE"})]})]}):f&&d?r.jsxs("div",{className:`relative overflow-hidden transition-all duration-300 ${l?"max-h-[300px]":"max-h-[120px]"}`,children:[r.jsx("img",{src:`data:image/jpeg;base64,${d}`,alt:"Shadow browser",className:"w-full object-contain"}),r.jsxs("div",{className:"absolute top-1.5 left-1.5 flex items-center gap-1 px-2 py-0.5 bg-black/75 rounded-lg text-[9px] font-bold text-purple-400 border border-purple-500/30",children:[r.jsx(Ka,{size:8,className:"animate-pulse"})," SHADOW"]}),r.jsx("div",{className:"absolute bottom-1.5 right-1.5 px-1.5 py-0.5 bg-black/70 rounded text-[8px] font-mono text-purple-300 border border-purple-500/20",children:"LIVE"})]}):s?r.jsxs("div",{className:`relative overflow-hidden transition-all duration-300 ${l?"max-h-[300px]":"max-h-[120px]"}`,children:[r.jsx("canvas",{ref:u,className:"w-full object-contain",style:{imageRendering:"auto"}}),s.elements&&s.elements.length>0&&r.jsxs("div",{className:"absolute bottom-1.5 right-1.5 px-2 py-0.5 bg-black/70 rounded text-[9px] font-mono text-orange-400 border border-orange-500/20",children:[s.elements.length," elements"]})]}):t?r.jsxs("div",{className:"flex items-center justify-center gap-2 py-8 text-orange-400 text-xs animate-pulse",children:[r.jsx(oa,{size:13,className:"animate-spin"})," Scanning…"]}):r.jsx("div",{className:"flex items-center justify-center py-8 text-gray-700 text-[11px]",children:"No capture yet"})}),r.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[x.length>0&&r.jsxs("div",{className:"border-b border-white/5",children:[j&&r.jsx("div",{className:"px-3 py-1.5 border-b border-white/4 bg-white/[0.01]",children:r.jsxs("p",{className:"text-[10px] text-gray-500 truncate",children:[e.workflow.goal,": ",r.jsx("span",{className:"text-gray-300",children:j})]})}),r.jsx("div",{className:"p-2 space-y-1 max-h-[100px] overflow-y-auto scrollbar-hide",children:x.map(z=>{const B=pE[z.type]??Yt;return r.jsxs("div",{className:`flex items-center gap-2 px-2.5 py-1.5 rounded-xl text-[11px] font-medium ${mE[z.status]}`,children:[z.status==="running"?r.jsx(ne,{size:11,className:"animate-spin text-orange-400 shrink-0"}):z.status==="done"?r.jsx(Ve,{size:11,className:"text-green-500 shrink-0"}):r.jsx(B,{size:11,className:"text-gray-600 shrink-0"}),r.jsx("span",{className:"flex-1 truncate",children:z.label})]},z.id)})})]}),N.length>0&&r.jsxs("div",{className:"flex-1 overflow-hidden",children:[r.jsx("div",{className:"px-3 py-1 border-b border-white/4",children:r.jsx("span",{className:"text-[9px] font-bold text-gray-600 uppercase tracking-widest",children:"Control Feed"})}),r.jsxs("div",{className:"px-2 py-1 space-y-px overflow-y-auto max-h-[100px] scrollbar-hide font-mono",children:[N.map(z=>{const B=gE[z.action]??cv,C=xE[z.action]??"text-gray-500";return r.jsxs("div",{className:"flex items-center gap-1.5 py-0.5",children:[r.jsx(B,{size:10,className:`${C} shrink-0`}),r.jsx("span",{className:`text-[10px] ${C} truncate flex-1`,children:z.label}),r.jsx("span",{className:"text-[9px] text-gray-700 shrink-0 tabular-nums",children:new Date(z.timestamp).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})})]},z.id)}),r.jsx("div",{ref:E})]})]})]})]})]})})]})})}const b0="mustb_briefing_shown",vE=14*60*60*1e3,xd={CodeHealth:{label:"Kod Sağlığı",Icon:hn,color:"#fb923c"},DepAudit:{label:"Bağımlılık Denetimi",Icon:qr,color:"#a78bfa"},LogAnalysis:{label:"Log Analizi",Icon:Qt,color:"#38bdf8"},LTMGap:{label:"Bellek Boşluğu",Icon:Yt,color:"#34d399"},WorkspaceDiff:{label:"Değişiklik Özeti",Icon:rv,color:"#fbbf24"}};function bE(e){const t=Object.keys(xd).find(n=>e.toLowerCase().includes(n.toLowerCase()));return t?xd[t]:{label:e,Icon:Ll,color:"#fb923c"}}function wE(e){const t=new Set(["NightShift-Insights","nightshift-insights","nightshift","night-shift"]);return e.find(n=>!t.has(n))??"General"}function w0(e){if(!e)return"—";const t=Math.round(e/1e3);return t<60?`${t} sn`:`${Math.floor(t/60)} dk ${t%60} sn`}function kE(e){const t=Date.now()-e,n=Math.floor(t/36e5),s=Math.floor(t%36e5/6e4);return n>0?`${n} saat ${s} dk önce`:s>0?`${s} dk önce`:"Az önce"}const jE={hidden:{opacity:0},show:{opacity:1,transition:{duration:.4}},exit:{opacity:0,transition:{duration:.35}}},NE={hidden:{opacity:0,y:32,scale:.97},show:{opacity:1,y:0,scale:1,transition:{type:"spring",stiffness:260,damping:26}},exit:{opacity:0,y:20,scale:.97,transition:{duration:.25}}},SE={hidden:{},show:{transition:{staggerChildren:.11,delayChildren:.45}}},CE={hidden:{opacity:0,x:24},show:{opacity:1,x:0,transition:{type:"spring",stiffness:300,damping:28}}};function EE(){const[e,t]=h.useState(!1),[n,s]=h.useState(null),[i,a]=h.useState([]),[o,l]=h.useState(!0),c=h.useRef(!1);h.useEffect(()=>{c.current||(c.current=!0,(async()=>{try{const d=await $("/api/automation/nightowl/status");if(!d.ok)return;const p=await d.json();if(!p.lastShiftTs||Date.now()-p.lastShiftTs>vE||localStorage.getItem(b0)===String(p.lastShiftTs)||p.totalFindings===0)return;const f=await $("/api/memory/ltm/search?q=NightShift-Insights&limit=15&category=semantic"),b=(f.ok?await f.json():{results:[]}).results.filter(y=>y.tags.some(v=>v.toLowerCase().includes("nightshift"))).slice(0,8).map(y=>({task:wE(y.tags),summary:y.content.replace(/\n/g," ").slice(0,180)}));s(p),a(b),l(!1),t(!0),localStorage.setItem(b0,String(p.lastShiftTs))}catch{}})())},[]);const u=()=>t(!1);return r.jsx(se,{children:e&&r.jsx(H.div,{variants:jE,initial:"hidden",animate:"show",exit:"exit",className:"fixed inset-0 z-[400] flex items-center justify-center px-4",style:{background:"rgba(4,1,0,0.82)",backdropFilter:"blur(8px)"},onClick:d=>{d.target===d.currentTarget&&u()},children:r.jsxs(H.div,{variants:NE,initial:"hidden",animate:"show",exit:"exit",className:"relative w-full max-w-[620px] max-h-[88vh] flex flex-col rounded-3xl overflow-hidden",style:{background:"rgba(14,6,1,0.92)",border:"1px solid rgba(249,115,22,0.22)",backdropFilter:"blur(32px)",boxShadow:"0 24px 80px rgba(0,0,0,0.7), 0 0 0 1px rgba(249,115,22,0.08), inset 0 1px 0 rgba(255,255,255,0.04)"},children:[r.jsx("button",{onClick:u,className:"absolute top-4 right-4 z-10 w-7 h-7 rounded-full flex items-center justify-center text-white/25 hover:text-white/70 hover:bg-white/8 transition-all",children:r.jsx(et,{size:14})}),r.jsxs("div",{className:"flex-shrink-0 px-8 pt-8 pb-6",style:{borderBottom:"1px solid rgba(249,115,22,0.10)"},children:[r.jsxs(H.div,{initial:{opacity:0,y:-12},animate:{opacity:1,y:0},transition:{delay:.1,duration:.5},className:"flex items-start gap-4",children:[r.jsx("div",{className:"w-12 h-12 rounded-2xl flex items-center justify-center flex-shrink-0",style:{background:"rgba(249,115,22,0.12)",border:"1px solid rgba(249,115,22,0.25)",boxShadow:"0 0 24px rgba(249,115,22,0.15)"},children:r.jsx(Rl,{size:22,className:"text-orange-400"})}),r.jsxs("div",{children:[r.jsx("p",{className:"text-[11px] font-semibold text-orange-400/60 tracking-widest uppercase mb-1",children:"Sabah Raporu"}),r.jsx("h2",{className:"text-[22px] font-black text-white/90 leading-tight tracking-tight",children:"Gece Vardiyası Tamamlandı"}),(n==null?void 0:n.lastShiftTs)&&r.jsxs("p",{className:"text-[12px] text-white/35 mt-1",children:[kE(n.lastShiftTs)," · ",w0(n.lastShiftMs)," sürdü"]})]})]}),n&&r.jsx(H.div,{initial:{opacity:0},animate:{opacity:1},transition:{delay:.3},className:"flex items-center gap-4 mt-5",children:[{label:"Bulgu",value:String(n.totalFindings)},{label:"Görev",value:String(Object.keys(xd).length)},{label:"Süre",value:w0(n.lastShiftMs)}].map(d=>r.jsxs("div",{className:"flex-1 rounded-xl px-3 py-2.5 text-center",style:{background:"rgba(249,115,22,0.06)",border:"1px solid rgba(249,115,22,0.12)"},children:[r.jsx("p",{className:"text-[18px] font-black text-orange-400",children:d.value}),r.jsx("p",{className:"text-[10px] text-white/30 font-medium mt-0.5",children:d.label})]},d.label))})]}),r.jsxs("div",{className:"flex-1 overflow-y-auto px-8 py-5 space-y-2.5",style:{scrollbarWidth:"none"},children:[o&&r.jsx("div",{className:"flex items-center justify-center py-12",children:r.jsx("div",{className:"flex gap-1.5",children:[0,1,2].map(d=>r.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-orange-400/40 animate-bounce",style:{animationDelay:`${d*.15}s`}},d))})}),!o&&i.length===0&&r.jsx("p",{className:"text-center text-[13px] text-white/30 py-10",children:"Kayıtlı bulgu bulunamadı."}),!o&&i.length>0&&r.jsx(H.div,{variants:SE,initial:"hidden",animate:"show",className:"space-y-2.5",children:i.map((d,p)=>{const f=bE(d.task),m=f.Icon;return r.jsx(H.div,{variants:CE,children:r.jsxs("div",{className:"flex items-start gap-3 p-4 rounded-2xl",style:{background:"rgba(255,255,255,0.03)",border:`1px solid ${f.color}22`},children:[r.jsx("div",{className:"w-8 h-8 rounded-xl flex items-center justify-center flex-shrink-0 mt-0.5",style:{background:`${f.color}15`,border:`1px solid ${f.color}30`},children:r.jsx(m,{size:14,style:{color:f.color}})}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("p",{className:"text-[11px] font-bold mb-1 tracking-wide",style:{color:f.color},children:f.label}),r.jsx("p",{className:"text-[12.5px] text-white/65 leading-relaxed",children:d.summary})]}),r.jsx(dn,{size:13,className:"text-white/15 flex-shrink-0 mt-1"})]})},p)})})]}),r.jsx(H.div,{initial:{opacity:0},animate:{opacity:1},transition:{delay:.6},className:"flex-shrink-0 px-8 py-5",style:{borderTop:"1px solid rgba(249,115,22,0.10)"},children:r.jsxs("button",{onClick:u,className:"w-full py-3 rounded-2xl flex items-center justify-center gap-2 font-bold text-[14px] transition-all active:scale-[0.98]",style:{background:"rgba(249,115,22,0.15)",border:"1px solid rgba(249,115,22,0.30)",color:"#fdba74"},onMouseEnter:d=>d.currentTarget.style.background="rgba(249,115,22,0.22)",onMouseLeave:d=>d.currentTarget.style.background="rgba(249,115,22,0.15)",children:[r.jsx(ze,{size:15}),"Günün başlasın"]})})]})},"morning-briefing-overlay")})}const k0={CodeHealth:{label:"Kod Sağlığı",Icon:hn,color:"#fb923c"},DepAudit:{label:"Bağımlılık",Icon:qr,color:"#a78bfa"},LogAnalysis:{label:"Log Analizi",Icon:Qt,color:"#38bdf8"},LTMGap:{label:"Bellek",Icon:Yt,color:"#34d399"},WorkspaceDiff:{label:"Değişiklikler",Icon:rv,color:"#fbbf24"}};function _E(e){const t=Object.keys(k0).find(n=>e.toLowerCase().includes(n.toLowerCase()));return t?k0[t]:{label:e,Icon:Ll,color:"#fb923c"}}function TE(e){const t=Math.round(e/1e3);return t<60?`${t}s`:`${Math.floor(t/60)}m ${t%60}s`}const PE={hidden:{opacity:0,x:24,scale:.96},show:{opacity:1,x:0,scale:1,transition:{type:"spring",stiffness:320,damping:28}},exit:{opacity:0,x:24,scale:.96,transition:{duration:.22}}},ME={hidden:{opacity:0,y:-6},show:{opacity:1,y:0,transition:{duration:.22}}};function AE(){const[e,t]=h.useState("idle"),[n,s]=h.useState([]),[i,a]=h.useState(null),[o,l]=h.useState(!1),[c,u]=h.useState(!1),d=h.useRef(null),p=h.useRef(0),f=h.useCallback((b=2e4)=>{d.current&&clearTimeout(d.current),d.current=setTimeout(()=>{l(!1),setTimeout(()=>u(!1),600)},b)},[]);if(h.useEffect(()=>{const b=at();return b.on("nightOwlEvent",y=>{if(y.type==="shiftStart"){d.current&&clearTimeout(d.current),t("scanning"),s([]),a(null),u(!0),l(!0);return}if(y.type==="finding"){const v={id:`${++p.current}`,task:String(y.task??"General"),summary:String(y.summary??"").slice(0,120),ts:Number(y.ts??Date.now())};s(g=>[v,...g].slice(0,20));return}if(y.type==="shiftEnd"){t("done"),a({findingsCount:Number(y.findingsCount??0),durationMs:Number(y.durationMs??0),ts:Number(y.ts??Date.now())}),f(2e4);return}}),()=>{b.off("nightOwlEvent"),d.current&&clearTimeout(d.current)}},[f]),!c)return null;const m="#fb923c";return r.jsx(se,{children:r.jsx(H.div,{variants:PE,initial:"hidden",animate:"show",exit:"exit",className:"fixed z-[130] flex flex-col",style:{top:"80px",right:"20px",width:"300px",maxHeight:"70vh",pointerEvents:"auto"},children:r.jsxs("div",{className:"rounded-2xl overflow-hidden flex flex-col",style:{background:"rgba(10,4,1,0.90)",border:`1px solid ${m}28`,backdropFilter:"blur(24px)",boxShadow:"0 12px 40px rgba(0,0,0,0.60), inset 0 1px 0 rgba(255,255,255,0.04)"},children:[r.jsxs("button",{onClick:()=>{l(b=>!b),d.current&&clearTimeout(d.current)},className:"flex items-center justify-between px-4 py-3 w-full select-none",style:{borderBottom:o?`1px solid ${m}10`:"none"},children:[r.jsxs("div",{className:"flex items-center gap-2.5",children:[e==="scanning"?r.jsxs("span",{className:"relative flex-shrink-0",children:[r.jsx("span",{className:"block w-2 h-2 rounded-full bg-orange-400"}),r.jsx("span",{className:"absolute inset-0 rounded-full bg-orange-400 animate-ping opacity-70"})]}):e==="done"?r.jsx(Ve,{size:13,className:"text-green-400 flex-shrink-0"}):r.jsx(Rl,{size:13,className:"text-orange-300/50 flex-shrink-0"}),r.jsx("span",{className:"text-[12px] font-semibold text-white/75",children:e==="scanning"?"Gece Vardiyası":"Vardiya Logu"}),e==="scanning"&&r.jsx("span",{className:"text-[10px] text-orange-400/70 font-mono animate-pulse",children:"taranıyor…"}),e==="done"&&i&&r.jsxs("span",{className:"text-[10px] text-white/30 font-mono",children:[i.findingsCount," bulgu · ",TE(i.durationMs)]})]}),o?r.jsx(Ml,{size:12,className:"text-white/25"}):r.jsx(Kr,{size:12,className:"text-white/25"})]}),r.jsx(se,{children:o&&r.jsxs(H.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.22},className:"overflow-hidden",children:[r.jsxs("div",{className:"overflow-y-auto",style:{maxHeight:"52vh",scrollbarWidth:"none"},children:[e==="scanning"&&n.length===0&&r.jsxs("div",{className:"flex items-center justify-center py-8 gap-2",children:[r.jsx("div",{className:"flex gap-1",children:[0,1,2].map(b=>r.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-orange-400/50 animate-bounce",style:{animationDelay:`${b*.15}s`}},b))}),r.jsx("span",{className:"text-[11px] text-white/30",children:"Sistem analiz ediliyor…"})]}),r.jsx(se,{initial:!1,children:n.map(b=>{const y=_E(b.task),v=y.Icon;return r.jsxs(H.div,{variants:ME,initial:"hidden",animate:"show",exit:{opacity:0,height:0},className:"flex items-start gap-3 px-4 py-3",style:{borderBottom:"1px solid rgba(255,255,255,0.04)"},children:[r.jsx("div",{className:"w-6 h-6 rounded-lg flex items-center justify-center flex-shrink-0 mt-0.5",style:{background:`${y.color}15`,border:`1px solid ${y.color}30`},children:r.jsx(v,{size:11,style:{color:y.color}})}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("p",{className:"text-[10px] font-bold mb-0.5",style:{color:y.color},children:y.label}),r.jsx("p",{className:"text-[11px] text-white/50 leading-snug line-clamp-3",children:b.summary})]})]},b.id)})}),e==="done"&&n.length===0&&r.jsx("p",{className:"text-center text-[12px] text-white/25 py-8",children:"Kayda değer bulgu yok."})]}),e==="done"&&i&&r.jsxs("div",{className:"px-4 py-2.5 flex items-center justify-between",style:{borderTop:`1px solid ${m}10`},children:[r.jsx("span",{className:"text-[10px] text-white/25 font-mono",children:new Date(i.ts).toLocaleTimeString("tr-TR")}),r.jsx("span",{className:"text-[10px] text-green-400/70 font-semibold",children:"✓ Tamamlandı"})]})]},"log-body")})]})},"night-shift-log")})}const j0="mustb_boot_report",N0=14e3;function RE({value:e,max:t=10}){const n=Math.round(e/t*100),s=n>=70?"#22c55e":n>=40?"#f97316":"#ef4444";return r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("div",{className:"flex-1 h-1.5 rounded-full overflow-hidden",style:{background:"rgba(255,255,255,0.08)"},children:r.jsx("div",{className:"h-full rounded-full transition-all duration-700",style:{width:`${n}%`,background:s}})}),r.jsx("span",{className:"text-[11px] font-mono",style:{color:s},children:e.toFixed(1)})]})}function zE(){const[e,t]=h.useState(!1),[n,s]=h.useState(null),i=h.useCallback(()=>{t(!1),localStorage.removeItem(j0)},[]);return h.useEffect(()=>{if(localStorage.getItem(j0)!=="1")return;t(!0),$("/api/status").then(o=>o.ok?o.json():null).then(o=>{o&&s(o)}).catch(()=>{});const a=setTimeout(i,N0);return()=>clearTimeout(a)},[i]),r.jsx(se,{children:e&&r.jsx(H.div,{initial:{opacity:0,scale:.96,y:16},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.96,y:16},transition:{duration:.28,ease:"easeOut"},className:"fixed inset-0 z-[500] flex items-center justify-center p-4",style:{background:"rgba(0,0,0,0.55)",backdropFilter:"blur(8px)"},children:r.jsxs("div",{className:"relative w-full max-w-sm rounded-2xl overflow-hidden",style:{background:"rgba(14,6,2,0.92)",border:"1px solid rgba(234,88,12,0.30)",boxShadow:"0 24px 80px rgba(0,0,0,0.7), 0 0 0 1px rgba(234,88,12,0.10)",backdropFilter:"blur(24px)"},children:[r.jsx("button",{onClick:i,className:"absolute top-3 right-3 text-white/25 hover:text-white/60 transition-colors z-10",children:r.jsx(et,{size:14})}),r.jsxs("div",{className:"px-5 pt-5 pb-3 flex items-center gap-3",children:[r.jsx("div",{className:"w-9 h-9 rounded-xl flex items-center justify-center flex-shrink-0",style:{background:"rgba(234,88,12,0.15)",border:"1px solid rgba(234,88,12,0.25)"},children:r.jsx(Ve,{size:18,style:{color:"#22c55e"}})}),r.jsxs("div",{children:[r.jsx("p",{className:"text-[13px] font-bold text-white/90",children:"System Ready"}),r.jsx("p",{className:"text-[11px] text-white/40",children:"Must-b initialised successfully"})]})]}),r.jsx("div",{style:{height:1,background:"rgba(255,255,255,0.05)",margin:"0 20px"}}),r.jsxs("div",{className:"px-5 py-4 space-y-3",children:[r.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[r.jsxs("div",{className:"rounded-xl px-3 py-2.5",style:{background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.07)"},children:[r.jsx("p",{className:"text-[9px] font-semibold uppercase tracking-widest text-white/30 mb-1",children:"Agent"}),r.jsx("p",{className:"text-[12px] font-semibold text-white/80 truncate",children:(n==null?void 0:n.role)??"—"})]}),r.jsxs("div",{className:"rounded-xl px-3 py-2.5",style:{background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.07)"},children:[r.jsx("p",{className:"text-[9px] font-semibold uppercase tracking-widest text-white/30 mb-1",children:"Model"}),r.jsx("p",{className:"text-[12px] font-semibold text-white/80 truncate",children:(n==null?void 0:n.model)??"—"})]})]}),r.jsxs("div",{className:"rounded-xl px-3 py-2.5 space-y-2",style:{background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.07)"},children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("span",{className:"flex items-center gap-1.5 text-[10px] font-semibold text-white/40",children:[r.jsx(fn,{size:10})," CPU"]}),r.jsxs("span",{className:"text-[10px] font-mono text-white/50",children:[(n==null?void 0:n.cpuPct)??0,"%"]})]}),r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("span",{className:"flex items-center gap-1.5 text-[10px] font-semibold text-white/40",children:[r.jsx(lv,{size:10})," RAM"]}),r.jsxs("span",{className:"text-[10px] font-mono text-white/50",children:[((n==null?void 0:n.ramGb)??0).toFixed(2)," GB"]})]}),n&&r.jsxs("div",{className:"flex items-center justify-between pt-1",children:[r.jsxs("span",{className:"flex items-center gap-1.5 text-[10px] font-semibold text-white/40",children:[r.jsx(ze,{size:10})," Score"]}),r.jsx(RE,{value:n.score})]})]}),r.jsxs("div",{className:"flex items-center justify-between px-1",children:[r.jsx("span",{className:"text-[10px] text-white/30",children:"Dashboard port"}),r.jsxs("span",{className:"text-[11px] font-mono text-orange-400/70",children:[":",(n==null?void 0:n.port)??4309]})]})]}),r.jsx("div",{className:"px-5 pb-4",style:{borderTop:"1px solid rgba(255,255,255,0.05)",paddingTop:"12px"},children:r.jsx("button",{onClick:i,className:"w-full py-2 rounded-xl text-[12px] font-semibold transition-all",style:{background:"rgba(234,88,12,0.15)",border:"1px solid rgba(234,88,12,0.30)",color:"#fb923c"},children:"Open Dashboard"})}),r.jsx(H.div,{initial:{scaleX:1},animate:{scaleX:0},transition:{duration:N0/1e3,ease:"linear"},style:{position:"absolute",bottom:0,left:0,right:0,height:2,background:"rgba(234,88,12,0.50)",transformOrigin:"left"}})]})},"boot-report")})}function S0(){return h.useEffect(()=>{at()},[]),r.jsxs("div",{className:"flex flex-col h-[calc(100vh-72px)] overflow-hidden",children:[r.jsx(fE,{}),r.jsx(yE,{}),r.jsx(hE,{}),r.jsx(zE,{}),r.jsx(EE,{}),r.jsx(AE,{})]})}function ba(){const[e,t]=h.useState(!1),[n,s]=h.useState(!0),i=h.useRef(!0),a=h.useCallback(async()=>{try{const o=await $("/api/gateway/status",{},{retries:1,retryDelay:500});if(!i.current)return;const l=await o.json().catch(()=>({}));t(!!(l!=null&&l.online))}catch{i.current&&t(!1)}finally{i.current&&s(!1)}},[]);return h.useEffect(()=>{i.current=!0,a();const o=setInterval(a,15e3),l=()=>{a()},c=()=>{a()},u=()=>{i.current&&t(!1)};try{at()}catch{}return window.addEventListener("mustb:connected",l),window.addEventListener("mustb:reconnected",c),window.addEventListener("mustb:disconnected",u),()=>{i.current=!1,clearInterval(o),window.removeEventListener("mustb:connected",l),window.removeEventListener("mustb:reconnected",c),window.removeEventListener("mustb:disconnected",u)}},[a]),{online:e,loading:n}}function C0({connected:e,configured:t}){return e?r.jsx("span",{className:"w-2 h-2 rounded-full bg-green-400 flex-shrink-0"}):t?r.jsx("span",{className:"w-2 h-2 rounded-full bg-orange-400 flex-shrink-0"}):r.jsx("span",{className:"w-2 h-2 rounded-full bg-gray-600 flex-shrink-0"})}function LE(){const{online:e}=ba(),[t,n]=h.useState(null),[s,i]=h.useState([]),[a,o]=h.useState(null),[l,c]=h.useState(null),[u,d]=h.useState(!0);h.useEffect(()=>{(async()=>{var g;d(!0);try{const w=await(await $("/api/gateway/channels")).json();n(w),(g=w.channelOrder)!=null&&g.length&&o(w.channelOrder[0])}catch{n({offline:!0,channelOrder:[],channelLabels:{},channelAccounts:{}})}finally{d(!1)}})()},[e]),h.useEffect(()=>{t!=null&&t.offline&&$("/api/channels").then(v=>v.json()).then(i).catch(()=>i([]))},[t==null?void 0:t.offline]);const p=async(v,g)=>{c(`${v}-${g}`);try{await $(`/api/gateway/channels/${v}/logout`,{method:"POST",body:JSON.stringify({accountId:g})});const x=await $("/api/gateway/channels");n(await x.json())}catch{}finally{c(null)}};if(u)return r.jsxs("div",{className:"flex items-center justify-center py-12",children:[r.jsx(de,{size:18,className:"animate-spin text-orange-400"}),r.jsx("span",{className:"ml-2 text-sm text-gray-500",children:"Kanallar yükleniyor…"})]});if(t!=null&&t.offline)return r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5 rounded-xl bg-orange-500/8 border border-orange-500/20",children:[r.jsx(Hs,{size:14,className:"text-orange-400 flex-shrink-0"}),r.jsx("p",{className:"text-[12px] text-orange-300",children:"Must-b gateway çevrimdışı — yerel kanallar gösteriliyor."})]}),s.length===0?r.jsx("p",{className:"text-center text-sm text-gray-600 py-6",children:"Yapılandırılmış kanal yok."}):r.jsx("div",{className:"grid grid-cols-2 gap-2",children:s.map(v=>r.jsxs("div",{className:"px-3 py-2.5 rounded-xl bg-white/3 border border-white/6",children:[r.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[r.jsx(C0,{configured:v.configured,connected:!1}),r.jsx("span",{className:"text-[13px] font-semibold text-gray-200",children:v.name}),v.configured&&r.jsx("span",{className:"ml-auto text-[9px] font-bold px-1.5 py-0.5 rounded-md bg-orange-500/10 border border-orange-500/20 text-orange-400",children:"Yapılandırıldı"})]}),r.jsx("p",{className:"text-[11px] text-gray-500 line-clamp-2",children:v.description})]},v.id))})]});const f=(t==null?void 0:t.channelOrder)??[],m=(t==null?void 0:t.channelLabels)??{},b=(t==null?void 0:t.channelAccounts)??{};if(f.length===0)return r.jsx("p",{className:"text-center text-sm text-gray-600 py-8",children:"Yapılandırılmış kanal bulunamadı."});const y=a?b[a]??[]:[];return r.jsxs("div",{className:"flex gap-4 min-h-[320px]",children:[r.jsx("div",{className:"w-48 flex-shrink-0 space-y-1",children:f.map(v=>{const g=b[v]??[],x=g.some(j=>j.connected),w=g.some(j=>j.configured);return r.jsx("button",{onClick:()=>o(v),className:`w-full text-left px-3 py-2 rounded-xl border transition-all ${a===v?"bg-orange-500/12 border-orange-500/30":"bg-white/3 border-white/6 hover:bg-white/5 hover:border-white/12"}`,children:r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(C0,{connected:x,configured:w}),r.jsx("span",{className:"text-[12px] font-semibold text-gray-200 truncate",children:m[v]??v}),g.length>0&&r.jsx("span",{className:"ml-auto text-[10px] font-bold text-gray-500",children:g.length})]})},v)})}),r.jsx("div",{className:"flex-1 min-w-0",children:a?y.length===0?r.jsxs("div",{className:"px-4 py-4 rounded-xl bg-white/3 border border-white/6",children:[r.jsx("p",{className:"text-[13px] font-semibold text-gray-300 mb-1",children:m[a]??a}),r.jsx("p",{className:"text-[12px] text-gray-500",children:"Henüz bağlı hesap yok."})]}):r.jsx("div",{className:"space-y-2",children:y.map(v=>r.jsxs("div",{className:"px-4 py-3 rounded-xl bg-white/3 border border-white/6",children:[r.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[v.connected?r.jsx(Ve,{size:13,className:"text-green-400 flex-shrink-0"}):v.lastError?r.jsx(nv,{size:13,className:"text-red-400 flex-shrink-0"}):r.jsx(os,{size:13,className:"text-orange-400 flex-shrink-0"}),r.jsx("span",{className:"text-[13px] font-semibold text-gray-200 truncate",children:v.name??v.accountId}),r.jsxs("button",{onClick:()=>p(a,v.accountId),disabled:l===`${a}-${v.accountId}`,className:"ml-auto flex items-center gap-1 px-2 py-1 rounded-lg bg-red-500/8 border border-red-500/20 text-red-400 text-[10px] font-semibold hover:bg-red-500/15 transition-all disabled:opacity-40",children:[r.jsx(tf,{size:9}),"Logout"]})]}),r.jsxs("div",{className:"space-y-1",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"text-[10px] text-gray-600 w-20 flex-shrink-0",children:"Status"}),r.jsx("span",{className:`text-[11px] font-semibold ${v.connected?"text-green-400":"text-gray-500"}`,children:v.connected?"Connected":"Disconnected"})]}),v.lastConnectedAt&&r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"text-[10px] text-gray-600 w-20 flex-shrink-0",children:"Last seen"}),r.jsx("span",{className:"text-[11px] text-gray-400",children:new Date(v.lastConnectedAt).toLocaleString()})]}),v.lastError&&r.jsxs("div",{className:"flex items-start gap-2",children:[r.jsx("span",{className:"text-[10px] text-gray-600 w-20 flex-shrink-0 pt-0.5",children:"Error"}),r.jsx("span",{className:"text-[11px] text-red-400 break-all",children:v.lastError})]})]})]},v.accountId))}):r.jsx("p",{className:"text-sm text-gray-600 pt-4",children:"Bir kanal seçin."})})]})}function OE(e){return e===0?"Free":e<1?`$${e.toFixed(3)}/1M`:`$${e.toFixed(2)}/1M`}function DE(e){return e?e>=1e3?`${(e/1e3).toFixed(0)}M`:`${e}k`:"—"}const E0={free:{label:"Free",icon:r.jsx(dC,{size:11}),color:"#22c55e",bg:"rgba(34,197,94,0.12)"},balanced:{label:"Balanced",icon:r.jsx(AC,{size:11}),color:"#60a5fa",bg:"rgba(96,165,250,0.12)"},power:{label:"Power",icon:r.jsx(ze,{size:11}),color:"#f59e0b",bg:"rgba(245,158,11,0.12)"}};function IE({currentModel:e,onSelect:t,className:n}){const[s,i]=h.useState(null),[a,o]=h.useState(!0),[l,c]=h.useState(null),[u,d]=h.useState("free"),[p,f]=h.useState(""),m=h.useRef(null),b=(g=!1)=>{o(!0),c(null),fetch(`/api/providers/openrouter/models${g?"?refresh=1":""}`).then(x=>x.ok?x.json():Promise.reject(new Error(`HTTP ${x.status}`))).then(x=>{if(i(x),e){const w=x.free.some(j=>j.id===e)?"free":x.balanced.some(j=>j.id===e)?"balanced":x.power.some(j=>j.id===e)?"power":"free";d(w)}o(!1)}).catch(x=>{c(x.message),o(!1)})};h.useEffect(()=>{b()},[]),h.useEffect(()=>{m.current&&m.current.scrollIntoView({block:"nearest",behavior:"smooth"})},[u,s]);const y=(s==null?void 0:s[u])??[],v=p?y.filter(g=>g.name.toLowerCase().includes(p.toLowerCase())||g.id.toLowerCase().includes(p.toLowerCase())):y;return r.jsxs("div",{className:`flex flex-col rounded-xl overflow-hidden ${n??""}`,style:{background:"rgba(12,5,2,0.85)",border:"1px solid rgba(255,255,255,0.07)"},children:[r.jsxs("div",{className:"flex items-center justify-between px-3 pt-3 pb-2",children:[r.jsx("span",{className:"text-[11px] font-bold text-gray-400 uppercase tracking-widest",children:"OpenRouter Models"}),r.jsx("button",{onClick:()=>b(!0),className:"text-gray-600 hover:text-orange-400 transition-colors p-1 rounded",title:"Refresh catalog",disabled:a,children:r.jsx(de,{size:11,className:a?"animate-spin":""})})]}),r.jsx("div",{className:"flex gap-1 px-3 pb-2",children:["free","balanced","power"].map(g=>{var k;const x=E0[g],w=((k=s==null?void 0:s.totals)==null?void 0:k[g])??0,j=u===g;return r.jsxs("button",{onClick:()=>d(g),className:"flex items-center gap-1.5 px-2.5 py-1 rounded-lg text-[11px] font-semibold transition-all",style:{background:j?x.bg:"transparent",color:j?x.color:"#6b7280",border:`1px solid ${j?x.color+"40":"transparent"}`},children:[x.icon,x.label,w>0&&r.jsx("span",{className:"text-[9px] font-bold opacity-60",children:w})]},g)})}),r.jsx("div",{className:"px-3 pb-2",children:r.jsxs("div",{className:"relative",children:[r.jsx(Xt,{size:11,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-gray-600"}),r.jsx("input",{value:p,onChange:g=>f(g.target.value),placeholder:"Search models…",className:"w-full pl-7 pr-3 py-1.5 rounded-lg text-[11px] text-gray-300 placeholder-gray-600 outline-none",style:{background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.07)"}})]})}),r.jsxs("div",{className:"overflow-y-auto",style:{maxHeight:"320px"},children:[a&&r.jsxs("div",{className:"py-8 text-center text-[11px] text-gray-600",children:[r.jsx(de,{size:14,className:"animate-spin mx-auto mb-2"}),"Fetching live catalog…"]}),!a&&l&&r.jsxs("div",{className:"py-6 px-4 text-center text-[11px] text-red-400",children:[l,r.jsx("br",{}),r.jsx("button",{onClick:()=>b(!0),className:"mt-2 underline text-orange-400 hover:text-orange-300",children:"Retry"})]}),!a&&!l&&v.length===0&&r.jsx("div",{className:"py-8 text-center text-[11px] text-gray-600",children:"No models found."}),!a&&!l&&v.map(g=>{const x=g.id===e,w=E0[g.tier];return r.jsx("button",{ref:x?m:void 0,onClick:()=>t(g.id),className:"w-full text-left px-3 py-2 transition-all",style:{background:x?"rgba(234,88,12,0.10)":"transparent",borderLeft:x?"2px solid #ea580c":"2px solid transparent"},children:r.jsxs("div",{className:"flex items-start justify-between gap-2",children:[r.jsxs("div",{className:"min-w-0 flex-1",children:[r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx("span",{className:`text-[12px] font-semibold truncate ${x?"text-orange-300":"text-gray-300"}`,children:g.name}),g.hasVision&&r.jsx(Ls,{size:9,className:"text-purple-400 flex-shrink-0",title:"Vision / multimodal"})]}),r.jsx("span",{className:"text-[9px] text-gray-600 font-mono truncate block",children:g.id}),g.description&&r.jsx("span",{className:"text-[10px] text-gray-600 line-clamp-1 mt-0.5",children:g.description})]}),r.jsxs("div",{className:"flex flex-col items-end gap-1 flex-shrink-0",children:[r.jsx("span",{className:"text-[9px] font-bold",style:{color:w.color},children:OE(g.costPer1M)}),r.jsxs("span",{className:"text-[9px] text-gray-600",children:[DE(g.contextK)," ctx"]})]})]})},g.id)})]}),s&&r.jsx("div",{className:"px-3 py-1.5 border-t",style:{borderColor:"rgba(255,255,255,0.04)"},children:r.jsxs("span",{className:"text-[9px] text-gray-700 font-mono",children:["Catalog cached · ",new Date(s.fetchedAt).toLocaleTimeString()]})})]})}const Bc=[{code:"en",label:"English",flag:"🇬🇧",native:"English"},{code:"tr",label:"Turkish",flag:"🇹🇷",native:"Türkçe"},{code:"de",label:"German",flag:"🇩🇪",native:"Deutsch"},{code:"fr",label:"French",flag:"🇫🇷",native:"Français"},{code:"es",label:"Spanish",flag:"🇪🇸",native:"Español"},{code:"pt",label:"Portuguese (Brazil)",flag:"🇧🇷",native:"Português"},{code:"ja",label:"Japanese",flag:"🇯🇵",native:"日本語"},{code:"zh",label:"Chinese (Simplified)",flag:"🇨🇳",native:"简体中文"}];function BE(){const{locale:e,setLocale:t}=pt(),[n,s]=h.useState(!1),i=h.useRef(null),a=Bc.find(o=>o.code===e)??Bc[0];return h.useEffect(()=>{if(!n)return;const o=l=>{l.key==="Escape"&&s(!1)};return document.addEventListener("keydown",o),()=>document.removeEventListener("keydown",o)},[n]),r.jsxs("div",{ref:i,className:"relative",children:[r.jsxs("button",{onClick:()=>s(o=>!o),"aria-label":"Switch language",className:`flex items-center gap-1.5 px-2.5 py-1.5 rounded-full border text-[12px] font-semibold transition-all select-none ${n?"bg-orange-500/15 border-orange-400/30 text-orange-700":"text-black/65 border-transparent hover:text-black hover:bg-black/6"}`,children:[r.jsx(xC,{size:12,className:"text-orange-400 shrink-0"}),r.jsx("span",{children:a.flag}),r.jsx("span",{className:"tracking-wide",children:a.code.toUpperCase()})]}),r.jsx(se,{children:n&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"fixed inset-0 z-10",onClick:()=>s(!1)}),r.jsxs(H.div,{initial:{opacity:0,y:-6,scale:.96},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-6,scale:.96},transition:{duration:.13,ease:"easeOut"},className:"absolute right-0 top-full mt-2 z-20 w-52 bg-[#100806]/96 backdrop-blur-2xl border border-orange-500/15 rounded-xl shadow-2xl shadow-black/60 overflow-hidden max-h-72 overflow-y-auto",children:[r.jsx("div",{className:"px-3 py-2 border-b border-white/6",children:r.jsx("p",{className:"text-[9px] font-bold text-gray-600 uppercase tracking-widest",children:"Language"})}),Bc.map(o=>{const l=e===o.code;return r.jsxs("button",{onClick:()=>{t(o.code),s(!1)},className:`w-full flex items-center gap-3 px-3 py-2.5 text-[12px] font-medium transition-colors ${l?"bg-orange-500/12 text-orange-400":"text-gray-300 hover:bg-white/5 hover:text-white"}`,children:[r.jsx("span",{className:"text-base leading-none",children:o.flag}),r.jsxs("div",{className:"text-left flex-1",children:[r.jsx("p",{className:"leading-none",children:o.native}),!l&&r.jsx("p",{className:"text-[10px] text-gray-600 mt-0.5",children:o.label})]}),l&&r.jsx(zt,{size:12,className:"text-orange-400 shrink-0"})]},o.code)})]})]})})]})}const _0={frontier:"⚡ Frontier",gateway:"🌐 Gateway",fast:"🚀 Fast",local:"💻 Local",open:"🔓 Open Source",specialist:"🎯 Specialist",regional:"🌏 Regional",enterprise:"🏢 Enterprise",custom:"⚙️ Custom"},T0=["frontier","gateway","fast","local","open","specialist","regional","enterprise","custom"];function zv({tag:e}){return r.jsx("span",{className:"px-1.5 py-0.5 rounded-md bg-white/5 border border-white/8 text-[9px] text-gray-400 font-medium",children:e})}function FE({p:e,active:t,onClick:n}){return r.jsx("button",{onClick:n,className:`w-full text-left px-3 py-2.5 rounded-xl border transition-all ${t?"bg-orange-500/12 border-orange-500/30":"bg-white/3 border-white/6 hover:bg-white/5 hover:border-white/12"}`,children:r.jsxs("div",{className:"flex items-start justify-between gap-2",children:[r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("p",{className:`text-[13px] font-semibold leading-tight truncate ${t?"text-orange-300":"text-gray-200"}`,children:e.label}),r.jsx("p",{className:"text-[11px] text-gray-400 mt-0.5 leading-snug line-clamp-2",children:e.description}),r.jsx("div",{className:"flex flex-wrap gap-1 mt-1.5",children:e.tags.slice(0,3).map(s=>r.jsx(zv,{tag:s},s))})]}),t&&r.jsx(dn,{size:13,className:"text-orange-400 shrink-0 mt-1"})]})})}function VE(){const{t:e}=pt(),t=e.panels.settings,[n,s]=h.useState([]),[i,a]=h.useState(null),[o,l]=h.useState([]),[c,u]=h.useState("all"),[d,p]=h.useState(""),[f,m]=h.useState(null),[b,y]=h.useState(""),[v,g]=h.useState(""),[x,w]=h.useState(!1),[j,k]=h.useState(!1),[N,S]=h.useState(!1),[E,P]=h.useState(null),[M,T]=h.useState(null),[V,R]=h.useState(!!window.__MUSTB_NEED_API_KEY),[I,L]=h.useState(null),[z,B]=h.useState("providers"),C=h.useRef(null);h.useEffect(()=>{$("/api/setup/providers").then(Q=>Q.ok?Q.json():null).then(Q=>{Q!=null&&Q.providers&&s(Q.providers)}).catch(()=>{}),$("/api/setup/status").then(Q=>Q.ok?Q.json():null).then(Q=>{Q&&a(Q)}).catch(()=>{}),$("/api/setup/ollama-models").then(Q=>Q.ok?Q.json():null).then(Q=>{Q!=null&&Q.models&&l(Q.models)}).catch(()=>{});const G=()=>{R(!0),window.__MUSTB_NEED_API_KEY=!0};return window.addEventListener("mustb:401",G),()=>window.removeEventListener("mustb:401",G)},[]),h.useEffect(()=>{f&&y(f.defaultModel)},[f]);const A=d.toLowerCase(),_=n.filter(G=>!(c!=="all"&&G.category!==c||A&&!G.label.toLowerCase().includes(A)&&!G.description.toLowerCase().includes(A))),U={};for(const G of _)U[G.category]||(U[G.category]=[]),U[G.category].push(G);const K=async()=>{if(f){k(!0),P(null);try{const Q=await(await $("/api/setup/test-key",{method:"POST",body:JSON.stringify({provider:f.id,apiKey:v||void 0,model:b||void 0})})).json();P({ok:Q.ok,msg:Q.message??(Q.ok?"Connection successful":"Connection failed")})}catch{P({ok:!1,msg:"Gateway unreachable"})}k(!1)}},Y=async()=>{if(!(!f||!f.envKeyIsUrl&&!v.trim())){S(!0),T(null);try{const Q=await $("/api/setup/update-key",{method:"POST",body:JSON.stringify({provider:f.id,apiKey:v||void 0,model:b||void 0})});if(Q.ok){T("Saved successfully."),g(""),window.__MUSTB_NEED_API_KEY=!1,R(!1);const Lt=await $("/api/setup/status");Lt.ok&&a(await Lt.json())}else{const Lt=await Q.json();T(Lt.error??"Failed to save.")}}catch{T("Gateway unreachable.")}S(!1),setTimeout(()=>T(null),6e3)}},J=G=>{L(G),$("/api/setup/save",{method:"POST",body:JSON.stringify({provider:"ollama",model:G})}).finally(()=>{setTimeout(()=>L(null),3e3)})},le=(f==null?void 0:f.envKeyIsUrl)??!1,oe=(f==null?void 0:f.id)==="ollama",re=(f==null?void 0:f.id)==="openrouter",De=T0.filter(G=>n.some(Q=>Q.category===G)),ot=i?i.score>=70?"text-green-400":i.score>=40?"text-amber-400":"text-red-400":"text-gray-400";return r.jsxs("div",{className:"h-full flex flex-col overflow-hidden font-sans",children:[r.jsxs("div",{className:"shrink-0 flex items-center justify-between px-5 py-3 border-b border-white/6",children:[r.jsxs("div",{className:"flex items-center gap-2.5",children:[r.jsx("div",{className:"w-8 h-8 rounded-xl bg-orange-500/10 border border-orange-500/20 flex items-center justify-center",children:r.jsx(af,{size:15,className:"text-orange-400"})}),r.jsxs("div",{children:[r.jsx("h1",{className:"text-[14px] font-bold text-white leading-tight",children:t.title}),r.jsxs("p",{className:"text-[10px] text-gray-400 leading-tight",children:[i!=null&&i.configured?`Active · ${i.provider??"unknown"}`:"Not configured",i!=null&&i.mode?` · ${i.mode}`:""]})]})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(BE,{}),i&&r.jsxs("div",{className:"flex items-center gap-1.5 px-2.5 py-1 rounded-lg bg-white/4 border border-white/8",children:[r.jsx(fn,{size:11,className:ot}),r.jsxs("span",{className:`text-[11px] font-semibold ${ot}`,children:["HW ",i.score]}),r.jsxs("span",{className:"text-[10px] text-gray-400",children:["· ",i.tier]})]})]})]}),V&&r.jsxs("div",{className:"shrink-0 mx-4 mt-3 flex items-start gap-2.5 px-3.5 py-2.5 rounded-xl bg-red-500/10 border border-red-500/25 text-red-300",children:[r.jsx(os,{size:14,className:"shrink-0 mt-0.5"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-[12px] font-semibold",children:"API key missing or invalid"}),r.jsx("p",{className:"text-[10px] text-red-400/70 mt-0.5",children:"A request returned 401 Unauthorized. Select a provider and update your key below."})]})]}),r.jsxs("div",{className:"shrink-0 flex items-center gap-1.5 px-5 pt-3 pb-0",children:[r.jsxs("button",{onClick:()=>B("providers"),className:`flex items-center gap-1.5 px-3 py-1.5 rounded-xl text-[11px] font-semibold border transition-all ${z==="providers"?"bg-orange-500/15 border-orange-500/30 text-orange-300":"bg-white/3 border-white/6 text-gray-400 hover:text-gray-300 hover:border-white/12"}`,children:[r.jsx(fn,{size:11})," LLM Providers"]}),r.jsxs("button",{onClick:()=>B("channels"),className:`flex items-center gap-1.5 px-3 py-1.5 rounded-xl text-[11px] font-semibold border transition-all ${z==="channels"?"bg-orange-500/15 border-orange-500/30 text-orange-300":"bg-white/3 border-white/6 text-gray-400 hover:text-gray-300 hover:border-white/12"}`,children:[r.jsx(vo,{size:11})," Kanallar"]})]}),z==="channels"&&r.jsx("div",{className:"flex-1 overflow-y-auto p-5",children:r.jsx(LE,{})}),z==="providers"&&r.jsxs("div",{className:"flex flex-1 min-h-0 gap-0",children:[r.jsxs("div",{className:"w-[52%] flex flex-col border-r border-white/6 min-h-0",children:[r.jsxs("div",{className:"shrink-0 px-4 pt-3 pb-2 space-y-2.5",children:[r.jsxs("div",{className:"relative",children:[r.jsx(Xt,{size:12,className:"absolute left-3 top-1/2 -translate-y-1/2 text-gray-400"}),r.jsx("input",{ref:C,type:"text",value:d,onChange:G=>p(G.target.value),placeholder:t.searchPlaceholder,className:"w-full bg-white/4 border border-white/8 rounded-xl pl-8 pr-3 py-2 text-[12px] text-white placeholder:text-gray-400 outline-none focus:border-orange-500/40 transition-colors"})]}),r.jsxs("div",{className:"flex flex-wrap gap-1",children:[r.jsx("button",{onClick:()=>u("all"),className:`px-2 py-0.5 rounded-lg text-[10px] font-semibold border transition-all ${c==="all"?"bg-orange-500/15 border-orange-500/30 text-orange-300":"bg-white/4 border-white/8 text-gray-400 hover:text-gray-300"}`,children:t.allProviders}),De.map(G=>r.jsx("button",{onClick:()=>u(G),className:`px-2 py-0.5 rounded-lg text-[10px] font-semibold border transition-all ${c===G?"bg-orange-500/15 border-orange-500/30 text-orange-300":"bg-white/4 border-white/8 text-gray-400 hover:text-gray-300"}`,children:_0[G]},G))]})]}),r.jsxs("div",{className:"flex-1 overflow-y-auto px-4 pb-4 space-y-4",children:[n.length===0&&r.jsxs("div",{className:"flex items-center gap-2 py-6 text-gray-400 text-[12px]",children:[r.jsx(ne,{size:13,className:"animate-spin"})," Loading providers…"]}),T0.filter(G=>{var Q;return(Q=U[G])==null?void 0:Q.length}).map(G=>r.jsxs("div",{children:[r.jsx("p",{className:"text-[9px] font-bold text-gray-400 uppercase tracking-widest mb-1.5 px-1",children:_0[G]}),r.jsx("div",{className:"space-y-1.5",children:U[G].map(Q=>r.jsx(FE,{p:Q,active:(f==null?void 0:f.id)===Q.id,onClick:()=>{m(Q),P(null),g("")}},Q.id))})]},G)),n.length>0&&_.length===0&&r.jsxs("p",{className:"text-[12px] text-gray-400 py-4 text-center",children:['No providers match "',d,'"']})]})]}),r.jsx("div",{className:"flex-1 flex flex-col min-h-0 overflow-y-auto",children:f?r.jsxs("div",{className:"p-5 space-y-5",children:[r.jsxs("div",{className:"flex items-start justify-between gap-3",children:[r.jsxs("div",{children:[r.jsx("h2",{className:"text-[16px] font-bold text-white",children:f.label}),r.jsx("p",{className:"text-[12px] text-gray-400 mt-0.5 leading-snug",children:f.description}),r.jsx("div",{className:"flex flex-wrap gap-1 mt-1.5",children:f.tags.map(G=>r.jsx(zv,{tag:G},G))})]}),r.jsxs("a",{href:f.docsUrl,target:"_blank",rel:"noopener noreferrer",className:"shrink-0 flex items-center gap-1 px-2.5 py-1.5 rounded-lg bg-white/4 border border-white/8 text-[11px] text-gray-400 hover:text-white transition-colors",children:["Docs ",r.jsx(Al,{size:10})]})]}),oe&&o.length>0&&r.jsxs("div",{className:"space-y-2",children:[r.jsx("p",{className:"text-[10px] font-bold text-gray-400 uppercase tracking-widest",children:"Recommended Models for Your Hardware"}),r.jsx("div",{className:"space-y-1.5",children:o.map(G=>{const Q=G.fit==="recommended"?"text-green-400 border-green-500/20 bg-green-500/6":G.fit==="marginal"?"text-amber-400 border-amber-500/20 bg-amber-500/6":"text-red-400 border-red-500/20 bg-red-500/6";return r.jsxs("div",{className:"flex items-center justify-between px-3 py-2 rounded-xl bg-white/3 border border-white/6",children:[r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("p",{className:"text-[12px] font-semibold text-gray-200 truncate",children:G.label}),r.jsxs("p",{className:"text-[10px] text-gray-400",children:[G.sizeGb," GB"]})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:`text-[9px] font-bold px-1.5 py-0.5 rounded-md border ${Q}`,children:G.fit}),r.jsxs("button",{onClick:()=>{y(G.id),J(G.id)},disabled:I===G.id,className:"flex items-center gap-1 px-2 py-1 rounded-lg bg-orange-500/10 border border-orange-500/20 text-orange-400 text-[10px] font-semibold hover:bg-orange-500/15 transition-all disabled:opacity-40",children:[I===G.id?r.jsx(ne,{size:10,className:"animate-spin"}):r.jsx(Ai,{size:10}),I===G.id?"Pulling…":"Pull"]})]})]},G.id)})})]}),r.jsxs("div",{className:"space-y-1.5",children:[r.jsxs("p",{className:"text-[10px] font-bold text-gray-400 uppercase tracking-widest flex items-center gap-1.5",children:[le?r.jsx(RC,{size:9}):r.jsx(mC,{size:9}),le?t.baseUrl:t.apiKey]}),oe&&!le?r.jsx("div",{className:"px-3.5 py-2.5 rounded-xl bg-green-500/6 border border-green-500/15 text-green-400 text-[12px]",children:"Ollama runs locally — no API key required. Just make sure Ollama is running."}):r.jsxs("div",{className:"relative",children:[r.jsx("input",{type:x||le?"text":"password",value:v,onChange:G=>{g(G.target.value),P(null)},placeholder:f.placeholder,className:"w-full bg-white/4 border border-white/10 rounded-xl px-4 py-2.5 pr-10 text-[12px] text-white placeholder:text-gray-400 outline-none focus:border-orange-500/40 transition-colors"}),!le&&r.jsx("button",{onClick:()=>w(G=>!G),className:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-300 transition-colors",children:x?r.jsx(Zh,{size:13}):r.jsx(Ls,{size:13})})]}),r.jsx("p",{className:"text-[10px] text-gray-400 px-1",children:le?`Stored in .env as ${f.envKey}. Default: ${f.placeholder}`:`Stored locally in .env as ${f.envKey} — never sent to external servers.`})]}),r.jsxs("div",{className:"space-y-1.5",children:[r.jsxs("p",{className:"text-[10px] font-bold text-gray-400 uppercase tracking-widest flex items-center gap-1.5",children:[r.jsx(ze,{size:9}),t.model]}),re?r.jsx(IE,{currentModel:b,onSelect:y,className:"rounded-xl border border-white/10 bg-white/3"}):r.jsx("select",{value:b,onChange:G=>y(G.target.value),className:"w-full bg-white/4 border border-white/10 rounded-xl px-3 py-2.5 text-[12px] text-white outline-none focus:border-orange-500/40 transition-colors appearance-none",children:f.latestModels.map(G=>r.jsx("option",{value:G,className:"bg-[#1a0c06]",children:G},G))})]}),r.jsxs("div",{className:"flex items-center gap-2.5 pt-1",children:[!oe&&r.jsxs("button",{onClick:K,disabled:j||!v&&!(i!=null&&i.configured),className:"flex items-center gap-1.5 px-3.5 py-2 rounded-xl bg-white/5 border border-white/10 text-[12px] text-gray-300 font-medium hover:bg-white/8 hover:text-white transition-all disabled:opacity-40",children:[r.jsx(de,{size:12,className:j?"animate-spin":""}),j?t.testing:t.testConnection]}),r.jsxs("button",{onClick:Y,disabled:N||!v.trim()&&!le&&!oe,className:"flex items-center gap-1.5 px-3.5 py-2 rounded-xl bg-orange-600 hover:bg-orange-500 text-white text-[12px] font-semibold transition-all disabled:opacity-40 shadow-lg shadow-orange-500/20",children:[r.jsx(dv,{size:12,className:N?"animate-spin":""}),N?t.saving:t.save]})]}),E&&r.jsxs("div",{className:`flex items-start gap-2 px-3.5 py-2.5 rounded-xl border text-[12px] ${E.ok?"bg-green-500/8 border-green-500/20 text-green-300":"bg-red-500/8 border-red-500/20 text-red-300"}`,children:[E.ok?r.jsx(Ve,{size:13,className:"shrink-0 mt-0.5"}):r.jsx(os,{size:13,className:"shrink-0 mt-0.5"}),E.msg]}),M&&r.jsxs("div",{className:"flex items-center gap-2 px-3.5 py-2.5 rounded-xl bg-orange-500/8 border border-orange-500/20 text-orange-300 text-[12px]",children:[r.jsx(Ve,{size:13,className:"shrink-0"}),M]}),oe&&r.jsxs("div",{className:"pt-1 space-y-1.5",children:[r.jsxs("p",{className:"text-[10px] font-bold text-gray-400 uppercase tracking-widest flex items-center gap-1.5",children:[r.jsx(pC,{size:9}),"Custom Base URL (optional)"]}),r.jsx("input",{type:"text",value:v,onChange:G=>g(G.target.value),placeholder:"http://localhost:11434",className:"w-full bg-white/4 border border-white/10 rounded-xl px-4 py-2.5 text-[12px] text-white placeholder:text-gray-400 outline-none focus:border-orange-500/40 transition-colors"}),r.jsx("p",{className:"text-[10px] text-gray-400 px-1",children:"Leave blank to use the default http://localhost:11434"})]})]}):r.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-3 text-center px-8",children:[r.jsx("div",{className:"w-12 h-12 rounded-2xl bg-orange-500/8 border border-orange-500/15 flex items-center justify-center",children:r.jsx(We,{size:20,className:"text-orange-500/50"})}),r.jsx("p",{className:"text-[13px] text-gray-400",children:"Select a provider from the left to configure your API key"})]})})]})]})}function $E(e){if(!e)return"—";const t=Date.now()-e;return t<6e4?`${Math.floor(t/1e3)}s önce`:t<36e5?`${Math.floor(t/6e4)}dk önce`:`${Math.floor(t/36e5)}sa önce`}function UE(){const{online:e}=ba(),[t,n]=h.useState([]),[s,i]=h.useState(!0),[a,o]=h.useState("all"),l=async()=>{i(!0);try{const p=await(await $("/api/gateway/sessions?limit=50&includeDerivedTitles=true&includeLastMessage=true")).json(),f=Array.isArray(p)?p:Array.isArray(p==null?void 0:p.sessions)?p.sessions:[];n(f)}catch{n([])}finally{i(!1)}};h.useEffect(()=>{l()},[e]);const c=d=>!!d.runningAtMs&&Date.now()-d.runningAtMs<12e4,u=t.filter(d=>a==="running"?c(d):a==="idle"?!c(d):!0);return r.jsxs("div",{className:"flex-1 overflow-y-auto p-6 space-y-5",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:"w-8 h-8 rounded-xl bg-orange-500/15 border border-orange-500/25 flex items-center justify-center",children:r.jsx(We,{size:16,className:"text-orange-400"})}),r.jsxs("div",{children:[r.jsx("h1",{className:"text-xl font-bold text-white",children:"Aktif Oturumlar"}),r.jsxs("p",{className:"text-[11px] text-gray-500",children:[t.length," oturum"]})]})]}),r.jsxs("button",{onClick:l,disabled:s,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-xl bg-white/4 border border-white/8 text-[11px] text-gray-400 hover:text-white hover:border-white/16 transition-all disabled:opacity-40",children:[r.jsx(de,{size:12,className:s?"animate-spin":""}),"Yenile"]})]}),!e&&r.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5 rounded-xl bg-orange-500/8 border border-orange-500/20",children:[r.jsx(Hs,{size:13,className:"text-orange-400 flex-shrink-0"}),r.jsx("p",{className:"text-[12px] text-orange-300",children:"Gateway çevrimdışı — oturum verisi alınamıyor."})]}),r.jsx("div",{className:"flex gap-1.5",children:["all","running","idle"].map(d=>r.jsx("button",{onClick:()=>o(d),className:`px-3 py-1.5 rounded-xl text-[11px] font-semibold border transition-all ${a===d?"bg-orange-500/15 border-orange-500/30 text-orange-300":"bg-white/3 border-white/6 text-gray-500 hover:text-gray-300 hover:border-white/12"}`,children:d==="all"?"Tümü":d==="running"?"Çalışıyor":"Boşta"},d))}),s?r.jsx("div",{className:"flex items-center justify-center py-12",children:r.jsx(de,{size:18,className:"animate-spin text-orange-400"})}):u.length===0?r.jsxs("div",{className:"flex flex-col items-center justify-center py-16 gap-3",children:[r.jsx(Os,{size:32,className:"text-gray-700"}),r.jsx("p",{className:"text-sm text-gray-600",children:e?"Aktif oturum bulunamadı.":"Gateway çevrimdışı."})]}):r.jsx("div",{className:"space-y-2",children:u.map(d=>{const p=c(d);return r.jsx("div",{className:"px-4 py-3 rounded-xl bg-white/[0.025] border border-white/6 hover:border-white/10 transition-all",children:r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx("div",{className:"mt-0.5 flex-shrink-0",children:p?r.jsx("span",{className:"block w-2 h-2 rounded-full bg-orange-400 animate-pulse"}):r.jsx("span",{className:"block w-2 h-2 rounded-full bg-gray-700"})}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[r.jsx("p",{className:"text-[13px] font-semibold text-gray-200 truncate",children:d.derivedTitle??d.label??d.key.slice(0,20)+"…"}),d.agentId&&r.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-gray-600 flex-shrink-0",children:[r.jsx(fn,{size:9}),d.agentId]})]}),d.lastMessage&&r.jsx("p",{className:"text-[11px] text-gray-500 truncate mb-1",children:d.lastMessage}),r.jsxs("div",{className:"flex items-center gap-3",children:[d.messageCount!==void 0&&r.jsxs("span",{className:"text-[10px] text-gray-600",children:[d.messageCount," mesaj"]}),r.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-gray-600",children:[r.jsx(Pt,{size:9}),$E(d.lastActivityAt)]})]})]})]})},d.key)})})]})}function HE(e){if(!e||typeof e!="object")return String(e??"—");const t=e;return t.type==="every"&&t.intervalMs?`Her ${Math.round(t.intervalMs/6e4)} dakika`:t.type==="at"&&t.time?`Her gün ${t.time}`:t.type==="cron"&&t.expression?`Cron: ${t.expression}`:JSON.stringify(e).slice(0,40)}function WE(e){if(!e)return"—";const t=e-Date.now();return t<0?"Geçti":t<6e4?`${Math.floor(t/1e3)}s sonra`:t<36e5?`${Math.floor(t/6e4)}dk sonra`:`${Math.floor(t/36e5)}sa sonra`}function KE(){const{online:e}=ba(),[t,n]=h.useState([]),[s,i]=h.useState(!0),[a,o]=h.useState("all"),[l,c]=h.useState(null),[u,d]=h.useState(null),p=async()=>{i(!0);try{const x=await(await $("/api/gateway/automations?enabled=all&limit=50")).json();n(Array.isArray(x==null?void 0:x.jobs)?x.jobs:Array.isArray(x)?x:[])}catch{n([])}finally{i(!1)}};h.useEffect(()=>{p()},[e]);const f=async g=>{try{await $(`/api/gateway/automations/${g.id}`,{method:"PATCH",body:JSON.stringify({patch:{enabled:!g.enabled}})}),n(x=>x.map(w=>w.id===g.id?{...w,enabled:!w.enabled}:w))}catch{}},m=async g=>{c(g);try{await $(`/api/gateway/automations/${g}/run`,{method:"POST"}),await p()}catch{}finally{c(null)}},b=async g=>{if(window.confirm("Bu otomasyon silinsin mi?")){d(g);try{await $(`/api/gateway/automations/${g}`,{method:"DELETE"}),n(x=>x.filter(w=>w.id!==g))}catch{}finally{d(null)}}},y=t.filter(g=>a==="enabled"?g.enabled:a==="disabled"?!g.enabled:!0),v=g=>g==="ok"?r.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-green-400",children:[r.jsx(Ve,{size:9})," Başarılı"]}):g==="error"?r.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-red-400",children:[r.jsx(nv,{size:9})," Hata"]}):r.jsx("span",{className:"text-[10px] text-gray-600",children:"—"});return r.jsxs("div",{className:"flex-1 overflow-y-auto p-6 space-y-5",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:"w-8 h-8 rounded-xl bg-orange-500/15 border border-orange-500/25 flex items-center justify-center",children:r.jsx(ze,{size:16,className:"text-orange-400"})}),r.jsxs("div",{children:[r.jsx("h1",{className:"text-xl font-bold text-white",children:"Otomasyonlar"}),r.jsxs("p",{className:"text-[11px] text-gray-500",children:[t.length," zamanlanmış görev"]})]})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[!e&&r.jsxs("span",{className:"flex items-center gap-1.5 px-2.5 py-1 rounded-full text-[11px] bg-red-500/8 border border-red-500/20 text-red-400",children:[r.jsx(Hs,{size:10})," Çevrimdışı"]}),r.jsxs("button",{onClick:p,disabled:s,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-xl bg-white/4 border border-white/8 text-[11px] text-gray-400 hover:text-white hover:border-white/16 transition-all disabled:opacity-40",children:[r.jsx(de,{size:12,className:s?"animate-spin":""})," Yenile"]})]})]}),r.jsx("div",{className:"flex gap-1.5",children:["all","enabled","disabled"].map(g=>r.jsx("button",{onClick:()=>o(g),className:`px-3 py-1.5 rounded-xl text-[11px] font-semibold border transition-all ${a===g?"bg-orange-500/15 border-orange-500/30 text-orange-300":"bg-white/3 border-white/6 text-gray-500 hover:text-gray-300 hover:border-white/12"}`,children:g==="all"?"Tümü":g==="enabled"?"Aktif":"Pasif"},g))}),s?r.jsx("div",{className:"flex justify-center py-12",children:r.jsx(de,{size:18,className:"animate-spin text-orange-400"})}):y.length===0?r.jsxs("div",{className:"flex flex-col items-center justify-center py-16 gap-3",children:[r.jsx(ze,{size:32,className:"text-gray-700"}),r.jsx("p",{className:"text-sm text-gray-600",children:e?"Otomasyon bulunamadı.":"Gateway çevrimdışı."})]}):r.jsx("div",{className:"space-y-2",children:y.map(g=>{var x,w;return r.jsx("div",{className:`px-4 py-3 rounded-xl border transition-all ${g.enabled?"bg-white/[0.025] border-white/6":"bg-white/[0.01] border-white/4"}`,children:r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx("button",{onClick:()=>f(g),disabled:!e,className:"mt-0.5 text-gray-500 hover:text-orange-400 transition-colors disabled:opacity-40",title:g.enabled?"Devre dışı bırak":"Etkinleştir",children:g.enabled?r.jsx(IC,{size:18,className:"text-orange-400"}):r.jsx(DC,{size:18})}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[r.jsx("p",{className:`text-[13px] font-semibold truncate ${g.enabled?"text-gray-200":"text-gray-500"}`,children:g.name??g.id}),v((x=g.state)==null?void 0:x.lastRunStatus)]}),r.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[r.jsxs("span",{className:"flex items-center gap-1 text-[11px] text-gray-500",children:[r.jsx(Pt,{size:9})," ",HE(g.schedule)]}),((w=g.state)==null?void 0:w.nextRunAtMs)&&r.jsx("span",{className:"text-[11px] text-gray-600",children:WE(g.state.nextRunAtMs)})]})]}),r.jsxs("div",{className:"flex items-center gap-1.5 flex-shrink-0",children:[r.jsxs("button",{onClick:()=>m(g.id),disabled:!e||l===g.id,className:"flex items-center gap-1 px-2 py-1 rounded-lg bg-orange-500/8 border border-orange-500/20 text-orange-400 text-[10px] font-semibold hover:bg-orange-500/15 transition-all disabled:opacity-40",children:[l===g.id?r.jsx(de,{size:9,className:"animate-spin"}):r.jsx($s,{size:9}),"Çalıştır"]}),r.jsxs("button",{onClick:()=>b(g.id),disabled:!e||u===g.id,className:"flex items-center gap-1 px-2 py-1 rounded-lg bg-red-500/8 border border-red-500/20 text-red-400 text-[10px] font-semibold hover:bg-red-500/15 transition-all disabled:opacity-40",children:[u===g.id?r.jsx(de,{size:9,className:"animate-spin"}):r.jsx(Us,{size:9}),"Sil"]})]})]})},g.id)})})]})}function GE(e){var t;return(t=e.presence)!=null&&t.ts?Date.now()-e.presence.ts<6e4:!1}function qE({platform:e}){const t=(e??"").toLowerCase();return t.includes("ios")||t.includes("iphone")?r.jsx(l0,{size:14,className:"text-gray-400"}):t.includes("android")?r.jsx(l0,{size:14,className:"text-green-500"}):t.includes("mac")||t.includes("darwin")?r.jsx(Z1,{size:14,className:"text-gray-300"}):t.includes("win")?r.jsx(sf,{size:14,className:"text-blue-400"}):r.jsx(yC,{size:14,className:"text-gray-500"})}function YE(){const{online:e}=ba(),[t,n]=h.useState([]),[s,i]=h.useState(!0),[a,o]=h.useState(null),[l,c]=h.useState(""),u=async()=>{i(!0);try{const f=await(await $("/api/gateway/clients")).json();n(Array.isArray(f==null?void 0:f.nodes)?f.nodes:Array.isArray(f)?f:[])}catch{n([])}finally{i(!1)}};h.useEffect(()=>{u()},[e]);const d=async p=>{if(!l.trim()){o(null);return}try{await $(`/api/gateway/clients/${p}/rename`,{method:"POST",body:JSON.stringify({displayName:l.trim()})}),n(f=>f.map(m=>m.nodeId===p?{...m,displayName:l.trim()}:m))}catch{}finally{o(null)}};return r.jsxs("div",{className:"flex-1 overflow-y-auto p-6 space-y-5",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:"w-8 h-8 rounded-xl bg-orange-500/15 border border-orange-500/25 flex items-center justify-center",children:r.jsx(ud,{size:16,className:"text-orange-400"})}),r.jsxs("div",{children:[r.jsx("h1",{className:"text-xl font-bold text-white",children:"Bağlı Nodlar"}),r.jsxs("p",{className:"text-[11px] text-gray-500",children:[t.length," cihaz"]})]})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[!e&&r.jsxs("span",{className:"flex items-center gap-1.5 px-2.5 py-1 rounded-full text-[11px] bg-red-500/8 border border-red-500/20 text-red-400",children:[r.jsx(Hs,{size:10})," Çevrimdışı"]}),r.jsxs("button",{onClick:u,disabled:s,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-xl bg-white/4 border border-white/8 text-[11px] text-gray-400 hover:text-white hover:border-white/16 transition-all disabled:opacity-40",children:[r.jsx(de,{size:12,className:s?"animate-spin":""})," Yenile"]})]})]}),s?r.jsx("div",{className:"flex justify-center py-12",children:r.jsx(de,{size:18,className:"animate-spin text-orange-400"})}):t.length===0?r.jsxs("div",{className:"flex flex-col items-center justify-center py-16 gap-3",children:[r.jsx(ud,{size:32,className:"text-gray-700"}),r.jsx("p",{className:"text-sm text-gray-600",children:e?"Bağlı node yok.":"Gateway çevrimdışı."})]}):r.jsx("div",{className:"grid grid-cols-2 gap-3",children:t.map(p=>r.jsxs("div",{className:"px-4 py-3 rounded-xl bg-white/[0.025] border border-white/6 hover:border-white/10 transition-all",children:[r.jsxs("div",{className:"flex items-start gap-2 mb-2",children:[r.jsx(qE,{platform:p.platform}),r.jsx("div",{className:"flex-1 min-w-0",children:a===p.nodeId?r.jsx("input",{autoFocus:!0,value:l,onChange:f=>c(f.target.value),onBlur:()=>d(p.nodeId),onKeyDown:f=>{f.key==="Enter"&&d(p.nodeId),f.key==="Escape"&&o(null)},className:"w-full bg-white/6 border border-orange-500/30 rounded-lg px-2 py-0.5 text-[13px] text-white outline-none"}):r.jsx("p",{className:"text-[13px] font-semibold text-gray-200 truncate cursor-text",onDoubleClick:()=>{o(p.nodeId),c(p.displayName??"")},title:"Çift tıklayarak düzenle",children:p.displayName??p.nodeId})}),r.jsx("span",{className:`flex-shrink-0 w-2 h-2 rounded-full mt-1 ${GE(p)?"bg-green-400 animate-pulse":"bg-gray-700"}`})]}),r.jsxs("div",{className:"space-y-1",children:[p.platform&&r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"text-[10px] text-gray-600 w-16",children:"Platform"}),r.jsx("span",{className:"text-[11px] text-gray-400",children:p.platform})]}),p.version&&r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"text-[10px] text-gray-600 w-16",children:"Versiyon"}),r.jsx("span",{className:"text-[11px] text-gray-400",children:p.version})]}),(p.caps??[]).length>0&&r.jsxs("div",{className:"flex items-center gap-1 flex-wrap mt-1",children:[(p.caps??[]).slice(0,3).map(f=>r.jsx("span",{className:"px-1.5 py-0.5 rounded-md bg-orange-500/8 border border-orange-500/15 text-[9px] text-orange-400 font-medium",children:f},f)),(p.caps??[]).length>3&&r.jsxs("span",{className:"text-[9px] text-gray-600",children:["+",(p.caps??[]).length-3]})]})]})]},p.nodeId))})]})}function XE({online:e}){var u;const[t,n]=h.useState({}),[s,i]=h.useState(!0),a=h.useRef(0),o=h.useRef(null),l=async(d=0)=>{try{const f=await(await $(`/api/gateway/logs?cursor=${d}&limit=200`)).json();d===0?(n(f),a.current=f.cursor??0):(n(m=>({...f,lines:[...m.lines??[],...f.lines??[]]})),a.current=f.cursor??a.current)}catch{}finally{i(!1)}};h.useEffect(()=>{l(0)},[e]),h.useEffect(()=>{const d=setInterval(()=>l(a.current),1e4);return()=>clearInterval(d)},[e]),h.useEffect(()=>{o.current&&(o.current.scrollTop=o.current.scrollHeight)},[(u=t.lines)==null?void 0:u.length]);const c=d=>d.includes("error")||d.includes("ERROR")?"text-red-400":d.includes("warn")||d.includes("WARN")?"text-amber-400":d.includes("info")||d.includes("INFO")?"text-green-400":"text-gray-400";return r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("p",{className:"text-[11px] text-gray-600",children:[(t.lines??[]).length," satır"]}),r.jsxs("div",{className:"flex gap-2",children:[r.jsxs("button",{onClick:()=>navigator.clipboard.writeText((t.lines??[]).join(`
728
- `)),className:"flex items-center gap-1 px-2.5 py-1 rounded-lg bg-white/4 border border-white/8 text-[10px] text-gray-400 hover:text-white transition-all",children:[r.jsx(aa,{size:10})," Kopyala"]}),r.jsxs("button",{onClick:()=>{a.current=0,l(0)},className:"flex items-center gap-1 px-2.5 py-1 rounded-lg bg-white/4 border border-white/8 text-[10px] text-gray-400 hover:text-white transition-all",children:[r.jsx(de,{size:10})," Sıfırla"]})]})]}),r.jsx("div",{ref:o,className:"h-96 overflow-y-auto rounded-xl bg-black/40 border border-white/6 p-3 font-mono text-[11px] space-y-0.5",children:s?r.jsx("p",{className:"text-gray-600",children:"Yükleniyor…"}):!e||t.offline?r.jsx("p",{className:"text-orange-500",children:"Gateway çevrimdışı — log verisi alınamıyor."}):(t.lines??[]).length===0?r.jsx("p",{className:"text-gray-600",children:"Henüz log yok."}):(t.lines??[]).map((d,p)=>r.jsx("p",{className:`whitespace-pre-wrap break-all leading-5 ${c(d)}`,children:d},p))})]})}function QE({online:e}){var l,c;const[t,n]=h.useState({}),[s,i]=h.useState(!0);h.useEffect(()=>{i(!0),$("/api/gateway/usage/cost").then(u=>u.json()).then(n).catch(()=>n({})).finally(()=>i(!1))},[e]);const a=t.daily??[],o=Math.max(1,...a.map(u=>u.tokens??0));return r.jsxs("div",{className:"space-y-4",children:[(!e||t.offline)&&r.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 rounded-xl bg-orange-500/8 border border-orange-500/20",children:[r.jsx(Hs,{size:12,className:"text-orange-400"}),r.jsx("p",{className:"text-[11px] text-orange-300",children:"Gateway çevrimdışı."})]}),r.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[r.jsxs("div",{className:"px-4 py-3 rounded-xl bg-white/[0.025] border border-white/6",children:[r.jsx("p",{className:"text-[10px] text-gray-600 mb-1 uppercase tracking-widest",children:"Toplam Token"}),r.jsx("p",{className:"text-xl font-bold text-white",children:s?"—":(((l=t.total)==null?void 0:l.tokens)??0).toLocaleString()})]}),r.jsxs("div",{className:"px-4 py-3 rounded-xl bg-white/[0.025] border border-white/6",children:[r.jsxs("p",{className:"text-[10px] text-gray-600 mb-1 uppercase tracking-widest flex items-center gap-1",children:[r.jsx(oC,{size:8})," Tahmini Maliyet"]}),r.jsx("p",{className:"text-xl font-bold text-orange-400",children:s?"—":`$${(((c=t.total)==null?void 0:c.cost)??0).toFixed(4)}`})]})]}),(t.providers??[]).length>0&&r.jsxs("div",{className:"rounded-xl bg-white/[0.02] border border-white/6 overflow-hidden",children:[r.jsxs("div",{className:"grid grid-cols-4 px-4 py-2 border-b border-white/6 text-[10px] font-bold text-gray-600 uppercase tracking-widest",children:[r.jsx("span",{children:"Provider"}),r.jsx("span",{className:"text-right",children:"Giriş"}),r.jsx("span",{className:"text-right",children:"Çıkış"}),r.jsx("span",{className:"text-right",children:"Maliyet"})]}),(t.providers??[]).map((u,d)=>r.jsxs("div",{className:"grid grid-cols-4 px-4 py-2 border-b border-white/4 last:border-0 text-[12px]",children:[r.jsx("span",{className:"text-gray-300 font-medium truncate",children:u.provider}),r.jsx("span",{className:"text-right text-gray-500",children:(u.inputTokens??0).toLocaleString()}),r.jsx("span",{className:"text-right text-gray-500",children:(u.outputTokens??0).toLocaleString()}),r.jsxs("span",{className:"text-right text-orange-400",children:["$",(u.cost??0).toFixed(4)]})]},d))]}),a.length>0&&r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("p",{className:"text-[10px] text-gray-600 uppercase tracking-widest",children:"Günlük Kullanım"}),r.jsx("div",{className:"flex items-end gap-1 h-16 px-1",children:a.slice(-14).map((u,d)=>{var f;const p=Math.max(2,Math.round((u.tokens??0)/o*56));return r.jsxs("div",{className:"flex-1 flex flex-col items-center gap-0.5",children:[r.jsx("div",{style:{height:p},className:"w-full rounded-sm bg-orange-500/40 hover:bg-orange-500/60 transition-all",title:`${u.date}: ${(u.tokens??0).toLocaleString()} token`}),r.jsx("span",{className:"text-[8px] text-gray-700 truncate w-full text-center",children:(f=u.date)==null?void 0:f.slice(5)})]},d)})})]})]})}function JE({online:e}){const[t,n]=h.useState([]),[s,i]=h.useState(!0);return h.useEffect(()=>{i(!0),$("/api/gateway/sessions/usage?limit=30").then(a=>a.json()).then(a=>n(Array.isArray(a)?a:(a==null?void 0:a.sessions)??[])).catch(()=>n([])).finally(()=>i(!1))},[e]),r.jsxs("div",{className:"rounded-xl bg-white/[0.02] border border-white/6 overflow-hidden",children:[r.jsxs("div",{className:"grid grid-cols-4 px-4 py-2 border-b border-white/6 text-[10px] font-bold text-gray-600 uppercase tracking-widest",children:[r.jsx("span",{className:"col-span-2",children:"Oturum"}),r.jsx("span",{className:"text-right",children:"Token"}),r.jsx("span",{className:"text-right",children:"Maliyet"})]}),s?r.jsx("div",{className:"flex justify-center py-6",children:r.jsx(de,{size:14,className:"animate-spin text-orange-400"})}):t.length===0?r.jsx("p",{className:"text-center text-sm text-gray-600 py-6",children:e?"Oturum bulunamadı.":"Gateway çevrimdışı."}):t.map((a,o)=>{var l;return r.jsxs("div",{className:"grid grid-cols-4 px-4 py-2 border-b border-white/4 last:border-0 text-[12px]",children:[r.jsx("span",{className:"col-span-2 text-gray-300 truncate font-mono text-[10px]",children:((l=a.key)==null?void 0:l.slice(0,28))??"—"}),r.jsx("span",{className:"text-right text-gray-500",children:(a.tokens??0).toLocaleString()}),r.jsxs("span",{className:"text-right text-orange-400",children:["$",(a.cost??0).toFixed(4)]})]},o)})]})}function ZE(){const{online:e}=ba(),[t,n]=h.useState("logs");return r.jsxs("div",{className:"flex-1 overflow-y-auto p-6 space-y-5",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:"w-8 h-8 rounded-xl bg-orange-500/15 border border-orange-500/25 flex items-center justify-center",children:r.jsx(iC,{size:16,className:"text-orange-400"})}),r.jsxs("div",{children:[r.jsx("h1",{className:"text-xl font-bold text-white",children:"Loglar & Aktivite"}),r.jsx("p",{className:"text-[11px] text-gray-500",children:"Must-b gateway log, kullanım ve oturum istatistikleri"})]}),!e&&r.jsxs("span",{className:"ml-auto flex items-center gap-1.5 px-2.5 py-1 rounded-full text-[11px] bg-red-500/8 border border-red-500/20 text-red-400",children:[r.jsx(Hs,{size:10})," Çevrimdışı"]})]}),r.jsx("div",{className:"flex gap-1.5",children:["logs","usage","sessions"].map(s=>r.jsx("button",{onClick:()=>n(s),className:`px-3 py-1.5 rounded-xl text-[11px] font-semibold border transition-all ${t===s?"bg-orange-500/15 border-orange-500/30 text-orange-300":"bg-white/3 border-white/6 text-gray-500 hover:text-gray-300 hover:border-white/12"}`,children:s==="logs"?"Loglar":s==="usage"?"Kullanım":"Oturumlar"},s))}),t==="logs"&&r.jsx(XE,{online:e}),t==="usage"&&r.jsx(QE,{online:e}),t==="sessions"&&r.jsx(JE,{online:e})]})}function e_(){const[e,t]=h.useState([]),[n,s]=h.useState(!0),[i,a]=h.useState("all"),[o,l]=h.useState(new Set);h.useEffect(()=>{s(!0),$("/api/tools").then(d=>d.json()).then(d=>{const p=Array.isArray(d==null?void 0:d.groups)?d.groups:[];t(p),l(new Set(p.slice(0,3).map(f=>f.id)))}).catch(()=>t([])).finally(()=>s(!1))},[]);const c=e.map(d=>({...d,tools:(d.tools??[]).filter(p=>i==="core"?p.source!=="plugin":i==="plugin"?p.source==="plugin":!0)})).filter(d=>d.tools.length>0),u=d=>{l(p=>{const f=new Set(p);return f.has(d)?f.delete(d):f.add(d),f})};return r.jsxs("div",{className:"space-y-3",children:[r.jsx("div",{className:"flex gap-1.5",children:["all","core","plugin"].map(d=>r.jsx("button",{onClick:()=>a(d),className:`px-3 py-1.5 rounded-xl text-[11px] font-semibold border transition-all ${i===d?"bg-orange-500/15 border-orange-500/30 text-orange-300":"bg-white/3 border-white/6 text-gray-500 hover:text-gray-300 hover:border-white/12"}`,children:d==="all"?"All":d==="core"?"Core":"Plugin"},d))}),n?r.jsx("div",{className:"flex justify-center py-10",children:r.jsx(de,{size:18,className:"animate-spin text-orange-400"})}):c.length===0?r.jsx("p",{className:"text-center text-sm text-gray-600 py-8",children:"No tools found."}):r.jsx("div",{className:"space-y-2",children:c.map(d=>{var p;return r.jsxs("div",{className:"rounded-xl bg-white/[0.02] border border-white/6 overflow-hidden",children:[r.jsxs("button",{onClick:()=>u(d.id),className:"w-full flex items-center justify-between px-4 py-2.5 hover:bg-white/3 transition-colors",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(lf,{size:12,className:"text-orange-400"}),r.jsx("span",{className:"text-[12px] font-semibold text-gray-300",children:d.label??d.id}),r.jsxs("span",{className:"text-[10px] text-gray-600",children:[((p=d.tools)==null?void 0:p.length)??0," tools"]})]}),o.has(d.id)?r.jsx(Kr,{size:12,className:"text-gray-600"}):r.jsx(dn,{size:12,className:"text-gray-600"})]}),o.has(d.id)&&r.jsx("div",{className:"border-t border-white/5 divide-y divide-white/4",children:(d.tools??[]).map((f,m)=>r.jsxs("div",{className:"px-4 py-2 flex items-start justify-between gap-3",children:[r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("p",{className:"text-[12px] font-semibold text-gray-300",children:f.label??f.name}),f.description&&r.jsx("p",{className:"text-[11px] text-gray-600 line-clamp-1",children:f.description})]}),r.jsx("div",{className:"flex items-center gap-1 flex-shrink-0",children:r.jsx("span",{className:`text-[9px] font-bold px-1.5 py-0.5 rounded-md border ${f.source==="plugin"?"bg-blue-500/8 border-blue-500/20 text-blue-400":"bg-orange-500/8 border-orange-500/20 text-orange-400"}`,children:f.source==="plugin"?"plugin":"core"})})]},m))})]},d.id)})})]})}function t_(){const[e,t]=h.useState([]),[n,s]=h.useState(!0);return h.useEffect(()=>{s(!0),$("/api/agents").then(i=>i.json()).then(i=>t(Array.isArray(i==null?void 0:i.agents)?i.agents:[])).catch(()=>t([])).finally(()=>s(!1))},[]),n?r.jsx("div",{className:"flex justify-center py-10",children:r.jsx(de,{size:18,className:"animate-spin text-orange-400"})}):e.length===0?r.jsx("p",{className:"text-center text-sm text-gray-600 py-8",children:"No agents found."}):r.jsx("div",{className:"grid grid-cols-2 gap-3",children:e.map(i=>r.jsxs("div",{className:"px-4 py-3 rounded-xl bg-white/[0.025] border border-white/6",children:[r.jsxs("div",{className:"flex items-center gap-2 mb-1.5",children:[r.jsx("span",{className:"text-xl",children:i.emoji??"🤖"}),r.jsx("div",{className:"flex-1 min-w-0",children:r.jsx("p",{className:"text-[13px] font-semibold text-gray-200 truncate",children:i.name??i.id})}),i.isDefault&&r.jsx("span",{className:"text-[9px] font-bold px-1.5 py-0.5 rounded-md bg-orange-500/12 border border-orange-500/25 text-orange-400",children:"Default"})]}),i.description&&r.jsx("p",{className:"text-[11px] text-gray-500 line-clamp-2",children:i.description})]},i.id))})}function n_(){const[e,t]=h.useState("tools");return r.jsxs("div",{className:"flex-1 overflow-y-auto p-6 space-y-5",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:"w-8 h-8 rounded-xl bg-orange-500/15 border border-orange-500/25 flex items-center justify-center",children:r.jsx(qr,{size:16,className:"text-orange-400"})}),r.jsxs("div",{children:[r.jsx("h1",{className:"text-xl font-bold text-white",children:"Skills & Plugins"}),r.jsx("p",{className:"text-[11px] text-gray-500",children:"Must-b tool catalog and agent management"})]})]}),r.jsx("div",{className:"flex gap-1.5",children:["tools","agents"].map(n=>r.jsxs("button",{onClick:()=>t(n),className:`flex items-center gap-1.5 px-3 py-1.5 rounded-xl text-[11px] font-semibold border transition-all ${e===n?"bg-orange-500/15 border-orange-500/30 text-orange-300":"bg-white/3 border-white/6 text-gray-500 hover:text-gray-300 hover:border-white/12"}`,children:[n==="tools"?r.jsx(lf,{size:11}):r.jsx(ia,{size:11}),n==="tools"?"Tools":"Agents"]},n))}),e==="tools"&&r.jsx(e_,{}),e==="agents"&&r.jsx(t_,{})]})}const P0=[{key:"all",label:"Tümü",icon:va,test:()=>!0},{key:"nightowl",label:"NightOwl Bulguları",icon:Rl,test:e=>e.tags.some(t=>/nightshift|nightowl/i.test(t))},{key:"preferences",label:"Kullanıcı Tercihleri",icon:gv,test:e=>e.category==="semantic"&&!e.tags.some(t=>/project|workspace|nightshift|nightowl/i.test(t))},{key:"architecture",label:"Proje Mimarisi",icon:ov,test:e=>e.tags.some(t=>/project|workspace|context|summary/i.test(t))},{key:"episodic",label:"Episodik",icon:Pt,test:e=>e.category==="episodic"},{key:"semantic",label:"Semantik",icon:Yt,test:e=>e.category==="semantic"}],s_={episodic:{border:"rgba(249,115,22,0.30)",bg:"rgba(249,115,22,0.08)",dot:"#f97316",label:"Episodik"},semantic:{border:"rgba(99,102,241,0.30)",bg:"rgba(99,102,241,0.08)",dot:"#6366f1",label:"Semantik"}};function r_(e){const n=(Date.now()-new Date(e+"Z").getTime())/1e3,s=n/60,i=s/60,a=i/24;return n<60?{label:"az önce",tier:"fresh"}:s<60?{label:`${Math.floor(s)}d önce`,tier:"fresh"}:i<24?{label:`${Math.floor(i)}s önce`,tier:"recent"}:a<7?{label:`${Math.floor(a)}g önce`,tier:"recent"}:a<30?{label:`${Math.floor(a/7)}h önce`,tier:"old"}:{label:`${Math.floor(a/30)}ay önce`,tier:"ancient"}}const i_={fresh:"#34d399",recent:"#f97316",old:"#a78bfa",ancient:"#6b7280"};function M0(e,t){return t.trim()?e.split(new RegExp(`(${t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")})`,"gi")).map((s,i)=>s.toLowerCase()===t.toLowerCase()?r.jsx("mark",{className:"bg-orange-500/30 text-orange-300 rounded px-0.5",children:s},i):s):e}function a_({entry:e,query:t,index:n,onDelete:s}){const[i,a]=h.useState(!1),[o,l]=h.useState(!1),c=r_(e.createdAt),u=s_[e.category],d=e.content.slice(0,180),p=e.content.length>180,f=async m=>{m.stopPropagation(),l(!0);try{(await $(`/api/memory/ltm/delete/${e.id}`,{method:"DELETE"})).ok?(s(e.id),ue.success("Kayıt silindi.")):ue.error("Silinemedi.")}catch{ue.error("Bağlantı hatası.")}l(!1)};return r.jsxs(H.div,{layout:!0,initial:{opacity:0,y:16},animate:{opacity:1,y:0},exit:{opacity:0,y:-8,scale:.97},transition:{delay:Math.min(n*.03,.3),duration:.25},className:"rounded-2xl overflow-hidden cursor-pointer group",style:{background:"rgba(10,4,1,0.78)",border:`1px solid ${u.border}`,backdropFilter:"blur(20px)",boxShadow:`0 4px 24px rgba(0,0,0,0.45), 0 0 0 1px ${u.bg}, inset 0 1px 0 rgba(255,255,255,0.03)`},onClick:()=>a(m=>!m),children:[r.jsxs("div",{className:"flex items-start gap-3 px-4 pt-3.5 pb-2.5",style:{borderBottom:`1px solid ${u.bg}`},children:[r.jsx("span",{className:"mt-0.5 w-2 h-2 rounded-full flex-shrink-0",style:{background:u.dot,boxShadow:`0 0 6px ${u.dot}`}}),r.jsx("div",{className:"flex-1 min-w-0",children:r.jsx("p",{className:"text-[13px] text-white/80 leading-relaxed break-words",children:M0(i?e.content:d+(p?"…":""),t)})}),p&&r.jsx(H.span,{animate:{rotate:i?90:0},transition:{duration:.18},className:"flex-shrink-0 text-white/20",children:r.jsx(dn,{size:14})}),r.jsx("button",{onClick:f,disabled:o,className:"flex-shrink-0 p-1 rounded-lg opacity-0 group-hover:opacity-100 text-white/25 hover:text-red-400 hover:bg-red-500/12 transition-all disabled:opacity-30",title:"Bu kaydı sil",children:r.jsx(Us,{size:13})})]}),r.jsxs("div",{className:"flex items-center gap-3 px-4 py-2 flex-wrap",children:[r.jsx("span",{className:"text-[10px] font-semibold tracking-widest uppercase px-2 py-0.5 rounded-full",style:{color:u.dot,background:u.bg,border:`1px solid ${u.border}`},children:u.label}),e.tags.slice(0,3).map(m=>r.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-white/35 px-1.5 py-0.5 rounded-md",style:{background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.08)"},children:[r.jsx(mv,{size:8,className:"opacity-60"}),m]},m)),r.jsx("span",{className:"flex-1"}),r.jsxs("span",{className:"flex items-center gap-1 text-[10px] font-medium",style:{color:i_[c.tier]},title:e.createdAt,children:[r.jsx(Pt,{size:9}),c.label]})]})]})}function o_({entries:e}){const t=e.filter(a=>a.category==="episodic").length,n=e.filter(a=>a.category==="semantic").length,s=e.filter(a=>a.tags.some(o=>/nightshift|nightowl/i.test(o))).length,i=[{label:`${e.length} toplam`,color:"#f97316"},{label:`${t} episodik`,color:"#f97316"},{label:`${n} semantik`,color:"#6366f1"},{label:`${s} NightOwl`,color:"#a78bfa"}];return r.jsx("div",{className:"flex items-center gap-3 flex-wrap",children:i.map(a=>r.jsx("span",{className:"text-[11px] font-semibold px-2.5 py-1 rounded-full",style:{color:a.color,background:`${a.color}14`,border:`1px solid ${a.color}30`},children:a.label},a.label))})}function l_({onConfirm:e,onCancel:t}){return r.jsx("div",{className:"fixed inset-0 z-[100] flex items-center justify-center bg-black/70 p-4",children:r.jsxs(H.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},transition:{duration:.15},className:"rounded-2xl p-6 w-full max-w-sm shadow-2xl",style:{background:"rgba(18,8,2,0.97)",border:"1px solid rgba(249,115,22,0.25)"},children:[r.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[r.jsx("div",{className:"w-10 h-10 rounded-xl flex items-center justify-center shrink-0",style:{background:"rgba(239,68,68,0.12)",border:"1px solid rgba(239,68,68,0.25)"},children:r.jsx(os,{size:18,className:"text-red-400"})}),r.jsxs("div",{children:[r.jsx("h3",{className:"text-[15px] font-bold text-white/90",children:"Tüm Hafızayı Temizle"}),r.jsx("p",{className:"text-[11px] text-white/35",children:"Bu işlem geri alınamaz"})]}),r.jsx("button",{onClick:t,className:"ml-auto p-1.5 rounded-lg text-white/30 hover:text-white/60 hover:bg-white/6 transition-all",children:r.jsx(et,{size:15})})]}),r.jsx("p",{className:"text-[13px] text-white/50 mb-5 leading-relaxed",children:"Tüm episodik ve semantik hafıza kayıtları kalıcı olarak silinecek. Bu işlem geri alınamaz."}),r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("button",{onClick:t,className:"flex-1 px-4 py-2.5 rounded-xl bg-white/8 hover:bg-white/12 text-white/70 text-[13px] font-medium transition-colors",children:"İptal"}),r.jsx("button",{onClick:e,className:"flex-1 px-4 py-2.5 rounded-xl bg-red-600/80 hover:bg-red-600 text-white text-[13px] font-semibold transition-colors border border-red-500/30",children:"Tümünü Sil"})]})]})})}function c_(){const[e,t]=h.useState([]),[n,s]=h.useState(!0),[i,a]=h.useState(""),[o,l]=h.useState("all"),[c,u]=h.useState(!1),[d,p]=h.useState(!1),f=h.useCallback(async()=>{s(!0);try{const v=await $("/api/memory/ltm/explore?category=all&limit=200");if(v.ok){const g=await v.json();t(g.entries??[])}}catch{}s(!1)},[]);h.useEffect(()=>{f()},[f]);const m=v=>{t(g=>g.filter(x=>x.id!==v))},b=async()=>{p(!0);try{const v=await $("/api/memory/ltm/clear-all",{method:"DELETE"});if(v.ok){const g=await v.json();t([]),ue.success(`${g.deleted??0} kayıt temizlendi.`)}else ue.error("Temizleme başarısız.")}catch{ue.error("Bağlantı hatası.")}p(!1),u(!1)},y=h.useMemo(()=>{var x;const v=((x=P0.find(w=>w.key===o))==null?void 0:x.test)??(()=>!0),g=i.trim().toLowerCase();return e.filter(v).filter(w=>!g||w.content.toLowerCase().includes(g)||w.tags.some(j=>j.includes(g)))},[e,o,i]);return r.jsxs("div",{className:"h-[calc(100vh-72px)] overflow-y-auto px-6 py-6 space-y-6",children:[r.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-4",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("span",{className:"w-9 h-9 rounded-xl flex items-center justify-center flex-shrink-0",style:{background:"rgba(249,115,22,0.12)",border:"1px solid rgba(249,115,22,0.28)",boxShadow:"0 0 16px rgba(249,115,22,0.12)"},children:r.jsx(Yt,{size:18,className:"text-orange-400"})}),r.jsxs("div",{children:[r.jsx("h1",{className:"text-[15px] font-bold text-white/90 tracking-tight",children:"Hafıza Tüneli"}),r.jsx("p",{className:"text-[11px] text-white/35",children:"Long-Term Memory Explorer — semantik & episodik"})]})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsxs("button",{onClick:()=>u(!0),disabled:d||e.length===0,className:"flex items-center gap-1.5 text-[11px] font-semibold px-3 py-1.5 rounded-lg transition-all border border-red-500/20 text-red-400/70 hover:text-red-400 hover:bg-red-500/10 disabled:opacity-30 disabled:cursor-not-allowed",style:{background:"rgba(239,68,68,0.04)"},children:[r.jsx(Us,{size:11}),"Tüm Hafızayı Temizle"]}),r.jsxs("button",{onClick:()=>void f(),disabled:n,className:"flex items-center gap-1.5 text-[11px] text-white/40 hover:text-white/70 transition-colors px-3 py-1.5 rounded-lg",style:{border:"1px solid rgba(255,255,255,0.08)",background:"rgba(255,255,255,0.03)"},children:[r.jsx(de,{size:11,className:n?"animate-spin":""}),"Yenile"]})]})]}),!n&&r.jsx(o_,{entries:e}),r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{className:"flex items-center gap-2 rounded-xl px-3 py-2.5",style:{background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.10)",backdropFilter:"blur(12px)"},children:[r.jsx(Xt,{size:13,className:"text-white/30 flex-shrink-0"}),r.jsx("input",{type:"text",value:i,onChange:v=>a(v.target.value),placeholder:"Hafızada ara…",className:"flex-1 bg-transparent text-[13px] text-white/80 placeholder:text-white/25 outline-none"}),i&&r.jsx("button",{onClick:()=>a(""),className:"text-white/25 hover:text-white/60 text-xs",children:"✕"})]}),r.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[r.jsx(cC,{size:11,className:"text-white/25"}),P0.map(v=>{const g=v.icon,x=o===v.key,w=e.filter(v.test).length;return r.jsxs("button",{onClick:()=>l(v.key),className:"flex items-center gap-1.5 text-[11px] font-medium px-2.5 py-1 rounded-full transition-all",style:{background:x?"rgba(249,115,22,0.16)":"rgba(255,255,255,0.04)",border:x?"1px solid rgba(249,115,22,0.40)":"1px solid rgba(255,255,255,0.08)",color:x?"#fb923c":"rgba(255,255,255,0.45)"},children:[r.jsx(g,{size:10}),v.label,r.jsxs("span",{style:{opacity:.6},children:["(",w,")"]})]},v.key)})]})]}),n?r.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 py-24",children:[r.jsx(H.div,{animate:{rotate:360},transition:{repeat:1/0,duration:1.5,ease:"linear"},children:r.jsx(Yt,{size:28,className:"text-orange-500/50"})}),r.jsx("p",{className:"text-[12px] text-white/30",children:"Hafıza taranıyor…"})]}):y.length===0?r.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 py-24",children:[r.jsx(Ll,{size:28,className:"text-white/15"}),r.jsx("p",{className:"text-[13px] text-white/30",children:e.length===0?"Henüz hafıza yok. İlk konuşmadan sonra dolmaya başlar.":"Filtrene uyan kayıt yok."})]}):r.jsxs("div",{className:"space-y-3 pb-8",children:[r.jsxs("p",{className:"text-[11px] text-white/25",children:[y.length," kayıt gösteriliyor",i&&r.jsxs(r.Fragment,{children:[" · ",r.jsxs("span",{className:"text-orange-400/60",children:['"',i,'"']})," araması"]})]}),r.jsx(se,{mode:"popLayout",children:y.map((v,g)=>r.jsx(a_,{entry:v,query:i,index:g,onDelete:m},v.id))})]}),r.jsx(se,{children:c&&r.jsx(l_,{onConfirm:b,onCancel:()=>u(!1)})})]})}const Xa=`# Must-b Zihni
727
+ `)}`:"⏹ Durduruldu.");return{...I,status:"done",content:L}})),g.current=null},disabled:j||E}),r.jsx("p",{className:"text-center text-[11px] text-white/20 mt-2 select-none",children:e.chat.disclaimer})]})]})]})}function fE(){const[e,t]=h.useState(!1);return h.useEffect(()=>{const n=at();return n.on("agentUpdate",s=>{s.type==="SCREEN_CAPTURE_START"&&t(!0),(s.type==="SCREEN_CAPTURED"||s.type==="SCREEN_CAPTURE_END")&&setTimeout(()=>t(!1),700)}),()=>{n.off("agentUpdate")}},[]),r.jsx(se,{children:e&&r.jsxs(H.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.25},className:"fixed inset-0 z-[9999] pointer-events-none",children:[r.jsxs("div",{className:"absolute inset-0",children:[r.jsx("div",{className:"absolute top-0 left-0 w-12 h-12 border-t-2 border-l-2 border-orange-500/70"}),r.jsx("div",{className:"absolute top-0 right-0 w-12 h-12 border-t-2 border-r-2 border-orange-500/70"}),r.jsx("div",{className:"absolute bottom-0 left-0 w-12 h-12 border-b-2 border-l-2 border-orange-500/70"}),r.jsx("div",{className:"absolute bottom-0 right-0 w-12 h-12 border-b-2 border-r-2 border-orange-500/70"})]}),r.jsx(H.div,{className:"absolute left-0 right-0 h-[2px] bg-gradient-to-r from-transparent via-orange-500/60 to-transparent",animate:{top:["0%","100%"]},transition:{duration:1.4,repeat:1/0,ease:"linear"}}),r.jsx("div",{className:"absolute top-4 left-1/2 -translate-x-1/2",children:r.jsxs(H.div,{initial:{y:-10,opacity:0},animate:{y:0,opacity:1},className:"flex items-center gap-2 px-4 py-2 bg-black/80 border border-orange-500/30 rounded-full shadow-[0_0_20px_rgba(234,88,12,0.3)] backdrop-blur-xl",children:[r.jsxs("span",{className:"relative flex h-2 w-2",children:[r.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-orange-400 opacity-75"}),r.jsx("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-orange-500"})]}),r.jsx(oa,{size:12,className:"text-orange-400 animate-spin"}),r.jsx("span",{className:"text-orange-300 text-xs font-semibold tracking-wide",children:"Scanning screen…"})]})})]},"scan-overlay")})}const Ya={button:"rgba(234,88,12,0.7)",input:"rgba(59,130,246,0.7)",image:"rgba(168,85,247,0.6)",unknown:"rgba(255,255,255,0.3)"},pE={browse:We,write:Qt,think:Yt,exec:as},mE={running:"bg-orange-500/8 border border-orange-500/20 text-orange-300",done:"bg-green-500/5 border border-green-500/10 text-gray-500",queued:"bg-white/2 border border-white/5 text-gray-600"},gE={mouseMove:CC,mouseClick:cv,typeText:gC,visionClick:Ls},xE={mouseMove:"text-gray-500",mouseClick:"text-orange-400",typeText:"text-blue-400",visionClick:"text-purple-400"};function yE(){const{t:e}=pt(),[t,n]=h.useState(!1),[s,i]=h.useState(null),[a,o]=h.useState(null),[l,c]=h.useState(!1),u=h.useRef(null),[d,p]=h.useState(null),[f,m]=h.useState(!1),[v,y]=h.useState(()=>new Array(3).fill(null)),[b,g]=h.useState(0),[x,w]=h.useState([]),[j,k]=h.useState(null),[N,S]=h.useState([]),E=h.useRef(null),[P,A]=h.useState(!1),[T,V]=h.useState(!1);h.useEffect(()=>{if(!s||!u.current)return;const z=u.current,B=z.getContext("2d");if(!B)return;const C=new Image;C.onload=()=>{var M;if(z.width=C.width,z.height=C.height,B.drawImage(C,0,0),(M=s.elements)!=null&&M.length)for(const _ of s.elements)B.strokeStyle=Ya[_.type]??Ya.unknown,B.lineWidth=Math.max(2,Math.round(C.width/400)),B.strokeRect(_.x,_.y,_.width,_.height),B.fillStyle=Ya[_.type]??Ya.unknown,B.font=`${Math.max(10,Math.round(C.width/120))}px monospace`,B.fillText(_.type,_.x+4,_.y+14)},C.src=`data:image/png;base64,${s.base64}`},[s]),h.useEffect(()=>{const z=at(),B=C=>{if(C.type==="SCREEN_CAPTURE_START"&&n(!0),C.type==="SCREEN_CAPTURED"&&(n(!1),i({base64:C.base64,width:C.width,height:C.height,source:C.source,elements:C.elements}),A(!1),V(!1)),C.type==="workflowStart"&&(k(C.goal??null),w(C.steps??[]),A(!1),V(!1)),C.type==="workflowStep"&&C.step){const M=C.step;w(_=>_.map(U=>U.id===M.id?M:U))}if(C.type==="workflowDone"&&setTimeout(()=>{w([]),k(null)},2500),C.type==="shadowFrame"&&typeof C.slot!="number"&&(p(C.base64),m(!0),A(!1)),C.type==="shadowToggle"&&typeof C.slot!="number"&&(m(C.enabled),C.enabled||p(null)),C.type==="ghostFrame"){const M=typeof C.slot=="number"?C.slot:-1;M>=0&&M<=2&&typeof C.base64=="string"&&(y(_=>{const U=[..._];return U[M]=C.base64,U}),A(!1))}if(C.type==="ghostSlot"){const M=typeof C.slot=="number"?C.slot:-1;M>=0&&M<=2&&g(M)}if(C.type==="shadowToggle"&&typeof C.slot=="number"){const M=C.slot;M>=0&&M<=2&&!C.enabled&&y(_=>{const U=[..._];return U[M]=null,U})}if(C.type==="inputAction"){const M={id:`${Date.now()}-${Math.random()}`,action:C.action??"mouseClick",label:C.label??"",timestamp:C.timestamp??Date.now()};S(_=>[..._.slice(-11),M]),A(!1),V(!1)}};return z.on("agentUpdate",B),()=>{z.off("agentUpdate",B)}},[]),h.useEffect(()=>{var z;(z=E.current)==null||z.scrollIntoView({behavior:"smooth"})},[N]);const R=async()=>{if(!t){try{const z=await $("/api/system/vision-guidance");if(z.ok){const B=await z.json();B.warn&&B.message&&o(B.message)}}catch{}await $("/api/system/screenshot",{method:"POST",body:JSON.stringify({detect:!0})}).catch(()=>{})}},I=v.some(z=>z!==null);return!(s||x.length>0||N.length>0||t||f||I)||T?null:r.jsx(se,{children:r.jsxs(H.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.22},className:"mx-4 mb-3 bg-[#0a0d16] border border-orange-500/12 rounded-2xl overflow-hidden shadow-xl shadow-orange-500/4 shrink-0",children:[r.jsxs("div",{className:"flex items-center justify-between px-4 py-2 border-b border-white/5",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("span",{className:"w-2 h-2 rounded-full bg-orange-500 animate-pulse"}),r.jsx("span",{className:"text-[10px] font-bold text-orange-400 uppercase tracking-widest",children:"War Room"}),s&&r.jsxs("span",{className:"text-[10px] text-gray-600 font-mono",children:[s.width,"×",s.height]}),f&&r.jsxs("span",{className:"flex items-center gap-1 text-[10px] font-bold text-purple-400 bg-purple-500/10 border border-purple-500/25 px-2 py-0.5 rounded-full",children:[r.jsx(Ka,{size:9,className:"animate-pulse"}),"Shadow Active"]})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsxs("button",{onClick:R,disabled:t,className:`flex items-center gap-1 px-2.5 py-1 rounded-lg text-[11px] font-medium transition-all ${t?"text-orange-400 bg-orange-500/10 animate-pulse cursor-not-allowed":"text-gray-600 hover:text-orange-400 hover:bg-orange-500/8 border border-white/5"}`,children:[r.jsx(oa,{size:10}),t?"Scanning…":"Capture"]}),s&&r.jsx("button",{onClick:()=>c(z=>!z),className:"text-gray-700 hover:text-gray-400 transition-colors",title:l?"Collapse preview":"Expand preview",children:l?r.jsx(Zh,{size:12}):r.jsx(Ls,{size:12})}),r.jsx("button",{onClick:()=>A(z=>!z),className:"text-gray-700 hover:text-gray-400 transition-colors",title:P?"Expand war room":"Collapse war room",children:P?r.jsx(Gr,{size:12}):r.jsx(Al,{size:12})}),r.jsx("button",{onClick:()=>V(!0),className:"text-gray-700 hover:text-red-400 transition-colors",title:"Dismiss war room",children:r.jsx(et,{size:12})})]})]}),r.jsx(se,{children:!P&&r.jsxs(H.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.2},className:"overflow-hidden",children:[a&&r.jsxs("div",{className:"px-4 py-2 bg-amber-500/8 border-b border-amber-500/15 flex items-start justify-between gap-2",children:[r.jsx("p",{className:"text-[11px] text-amber-400 leading-relaxed flex-1",children:a}),r.jsx("button",{onClick:()=>o(null),className:"text-[10px] text-amber-600 hover:text-amber-400 shrink-0",children:"Dismiss"})]}),r.jsxs("div",{className:"flex gap-0 divide-x divide-white/5",children:[r.jsx("div",{className:"w-1/2 shrink-0",children:I&&v[b]?r.jsxs("div",{className:"flex flex-col",children:[r.jsx("div",{className:"flex border-b border-white/5",children:[0,1,2].map(z=>v[z]!==null&&r.jsxs("button",{onClick:()=>g(z),className:`flex items-center gap-0.5 px-2 py-1 text-[9px] font-bold transition-colors ${b===z?"text-purple-400 border-b-2 border-purple-500":"text-gray-600 hover:text-gray-400"}`,children:[r.jsx(Ka,{size:7})," G",z+1]},z))}),r.jsxs("div",{className:`relative overflow-hidden transition-all duration-300 ${l?"max-h-[300px]":"max-h-[110px]"}`,children:[r.jsx("img",{src:`data:image/jpeg;base64,${v[b]}`,alt:`Ghost ${b+1}`,className:"w-full object-contain"}),r.jsxs("div",{className:"absolute top-1.5 left-1.5 flex items-center gap-1 px-2 py-0.5 bg-black/75 rounded-lg text-[9px] font-bold text-purple-400 border border-purple-500/30",children:[r.jsx(Ka,{size:8,className:"animate-pulse"})," G",b+1]}),r.jsx("div",{className:"absolute bottom-1.5 right-1.5 px-1.5 py-0.5 bg-black/70 rounded text-[8px] font-mono text-purple-300 border border-purple-500/20",children:"LIVE"})]})]}):f&&d?r.jsxs("div",{className:`relative overflow-hidden transition-all duration-300 ${l?"max-h-[300px]":"max-h-[120px]"}`,children:[r.jsx("img",{src:`data:image/jpeg;base64,${d}`,alt:"Shadow browser",className:"w-full object-contain"}),r.jsxs("div",{className:"absolute top-1.5 left-1.5 flex items-center gap-1 px-2 py-0.5 bg-black/75 rounded-lg text-[9px] font-bold text-purple-400 border border-purple-500/30",children:[r.jsx(Ka,{size:8,className:"animate-pulse"})," SHADOW"]}),r.jsx("div",{className:"absolute bottom-1.5 right-1.5 px-1.5 py-0.5 bg-black/70 rounded text-[8px] font-mono text-purple-300 border border-purple-500/20",children:"LIVE"})]}):s?r.jsxs("div",{className:`relative overflow-hidden transition-all duration-300 ${l?"max-h-[300px]":"max-h-[120px]"}`,children:[r.jsx("canvas",{ref:u,className:"w-full object-contain",style:{imageRendering:"auto"}}),s.elements&&s.elements.length>0&&r.jsxs("div",{className:"absolute bottom-1.5 right-1.5 px-2 py-0.5 bg-black/70 rounded text-[9px] font-mono text-orange-400 border border-orange-500/20",children:[s.elements.length," elements"]})]}):t?r.jsxs("div",{className:"flex items-center justify-center gap-2 py-8 text-orange-400 text-xs animate-pulse",children:[r.jsx(oa,{size:13,className:"animate-spin"})," Scanning…"]}):r.jsx("div",{className:"flex items-center justify-center py-8 text-gray-700 text-[11px]",children:"No capture yet"})}),r.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[x.length>0&&r.jsxs("div",{className:"border-b border-white/5",children:[j&&r.jsx("div",{className:"px-3 py-1.5 border-b border-white/4 bg-white/[0.01]",children:r.jsxs("p",{className:"text-[10px] text-gray-500 truncate",children:[e.workflow.goal,": ",r.jsx("span",{className:"text-gray-300",children:j})]})}),r.jsx("div",{className:"p-2 space-y-1 max-h-[100px] overflow-y-auto scrollbar-hide",children:x.map(z=>{const B=pE[z.type]??Yt;return r.jsxs("div",{className:`flex items-center gap-2 px-2.5 py-1.5 rounded-xl text-[11px] font-medium ${mE[z.status]}`,children:[z.status==="running"?r.jsx(ne,{size:11,className:"animate-spin text-orange-400 shrink-0"}):z.status==="done"?r.jsx(Ve,{size:11,className:"text-green-500 shrink-0"}):r.jsx(B,{size:11,className:"text-gray-600 shrink-0"}),r.jsx("span",{className:"flex-1 truncate",children:z.label})]},z.id)})})]}),N.length>0&&r.jsxs("div",{className:"flex-1 overflow-hidden",children:[r.jsx("div",{className:"px-3 py-1 border-b border-white/4",children:r.jsx("span",{className:"text-[9px] font-bold text-gray-600 uppercase tracking-widest",children:"Control Feed"})}),r.jsxs("div",{className:"px-2 py-1 space-y-px overflow-y-auto max-h-[100px] scrollbar-hide font-mono",children:[N.map(z=>{const B=gE[z.action]??cv,C=xE[z.action]??"text-gray-500";return r.jsxs("div",{className:"flex items-center gap-1.5 py-0.5",children:[r.jsx(B,{size:10,className:`${C} shrink-0`}),r.jsx("span",{className:`text-[10px] ${C} truncate flex-1`,children:z.label}),r.jsx("span",{className:"text-[9px] text-gray-700 shrink-0 tabular-nums",children:new Date(z.timestamp).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})})]},z.id)}),r.jsx("div",{ref:E})]})]})]})]})]})})]})})}const b0="mustb_briefing_shown",vE=14*60*60*1e3,xd={CodeHealth:{label:"Kod Sağlığı",Icon:hn,color:"#fb923c"},DepAudit:{label:"Bağımlılık Denetimi",Icon:$s,color:"#a78bfa"},LogAnalysis:{label:"Log Analizi",Icon:Qt,color:"#38bdf8"},LTMGap:{label:"Bellek Boşluğu",Icon:Yt,color:"#34d399"},WorkspaceDiff:{label:"Değişiklik Özeti",Icon:rv,color:"#fbbf24"}};function bE(e){const t=Object.keys(xd).find(n=>e.toLowerCase().includes(n.toLowerCase()));return t?xd[t]:{label:e,Icon:Ll,color:"#fb923c"}}function wE(e){const t=new Set(["NightShift-Insights","nightshift-insights","nightshift","night-shift"]);return e.find(n=>!t.has(n))??"General"}function w0(e){if(!e)return"—";const t=Math.round(e/1e3);return t<60?`${t} sn`:`${Math.floor(t/60)} dk ${t%60} sn`}function kE(e){const t=Date.now()-e,n=Math.floor(t/36e5),s=Math.floor(t%36e5/6e4);return n>0?`${n} saat ${s} dk önce`:s>0?`${s} dk önce`:"Az önce"}const jE={hidden:{opacity:0},show:{opacity:1,transition:{duration:.4}},exit:{opacity:0,transition:{duration:.35}}},NE={hidden:{opacity:0,y:32,scale:.97},show:{opacity:1,y:0,scale:1,transition:{type:"spring",stiffness:260,damping:26}},exit:{opacity:0,y:20,scale:.97,transition:{duration:.25}}},SE={hidden:{},show:{transition:{staggerChildren:.11,delayChildren:.45}}},CE={hidden:{opacity:0,x:24},show:{opacity:1,x:0,transition:{type:"spring",stiffness:300,damping:28}}};function EE(){const[e,t]=h.useState(!1),[n,s]=h.useState(null),[i,a]=h.useState([]),[o,l]=h.useState(!0),c=h.useRef(!1);h.useEffect(()=>{c.current||(c.current=!0,(async()=>{try{const d=await $("/api/automation/nightowl/status");if(!d.ok)return;const p=await d.json();if(!p.lastShiftTs||Date.now()-p.lastShiftTs>vE||localStorage.getItem(b0)===String(p.lastShiftTs)||p.totalFindings===0)return;const f=await $("/api/memory/ltm/search?q=NightShift-Insights&limit=15&category=semantic"),v=(f.ok?await f.json():{results:[]}).results.filter(y=>y.tags.some(b=>b.toLowerCase().includes("nightshift"))).slice(0,8).map(y=>({task:wE(y.tags),summary:y.content.replace(/\n/g," ").slice(0,180)}));s(p),a(v),l(!1),t(!0),localStorage.setItem(b0,String(p.lastShiftTs))}catch{}})())},[]);const u=()=>t(!1);return r.jsx(se,{children:e&&r.jsx(H.div,{variants:jE,initial:"hidden",animate:"show",exit:"exit",className:"fixed inset-0 z-[400] flex items-center justify-center px-4",style:{background:"rgba(4,1,0,0.82)",backdropFilter:"blur(8px)"},onClick:d=>{d.target===d.currentTarget&&u()},children:r.jsxs(H.div,{variants:NE,initial:"hidden",animate:"show",exit:"exit",className:"relative w-full max-w-[620px] max-h-[88vh] flex flex-col rounded-3xl overflow-hidden",style:{background:"rgba(14,6,1,0.92)",border:"1px solid rgba(249,115,22,0.22)",backdropFilter:"blur(32px)",boxShadow:"0 24px 80px rgba(0,0,0,0.7), 0 0 0 1px rgba(249,115,22,0.08), inset 0 1px 0 rgba(255,255,255,0.04)"},children:[r.jsx("button",{onClick:u,className:"absolute top-4 right-4 z-10 w-7 h-7 rounded-full flex items-center justify-center text-white/25 hover:text-white/70 hover:bg-white/8 transition-all",children:r.jsx(et,{size:14})}),r.jsxs("div",{className:"flex-shrink-0 px-8 pt-8 pb-6",style:{borderBottom:"1px solid rgba(249,115,22,0.10)"},children:[r.jsxs(H.div,{initial:{opacity:0,y:-12},animate:{opacity:1,y:0},transition:{delay:.1,duration:.5},className:"flex items-start gap-4",children:[r.jsx("div",{className:"w-12 h-12 rounded-2xl flex items-center justify-center flex-shrink-0",style:{background:"rgba(249,115,22,0.12)",border:"1px solid rgba(249,115,22,0.25)",boxShadow:"0 0 24px rgba(249,115,22,0.15)"},children:r.jsx(Rl,{size:22,className:"text-orange-400"})}),r.jsxs("div",{children:[r.jsx("p",{className:"text-[11px] font-semibold text-orange-400/60 tracking-widest uppercase mb-1",children:"Sabah Raporu"}),r.jsx("h2",{className:"text-[22px] font-black text-white/90 leading-tight tracking-tight",children:"Gece Vardiyası Tamamlandı"}),(n==null?void 0:n.lastShiftTs)&&r.jsxs("p",{className:"text-[12px] text-white/35 mt-1",children:[kE(n.lastShiftTs)," · ",w0(n.lastShiftMs)," sürdü"]})]})]}),n&&r.jsx(H.div,{initial:{opacity:0},animate:{opacity:1},transition:{delay:.3},className:"flex items-center gap-4 mt-5",children:[{label:"Bulgu",value:String(n.totalFindings)},{label:"Görev",value:String(Object.keys(xd).length)},{label:"Süre",value:w0(n.lastShiftMs)}].map(d=>r.jsxs("div",{className:"flex-1 rounded-xl px-3 py-2.5 text-center",style:{background:"rgba(249,115,22,0.06)",border:"1px solid rgba(249,115,22,0.12)"},children:[r.jsx("p",{className:"text-[18px] font-black text-orange-400",children:d.value}),r.jsx("p",{className:"text-[10px] text-white/30 font-medium mt-0.5",children:d.label})]},d.label))})]}),r.jsxs("div",{className:"flex-1 overflow-y-auto px-8 py-5 space-y-2.5",style:{scrollbarWidth:"none"},children:[o&&r.jsx("div",{className:"flex items-center justify-center py-12",children:r.jsx("div",{className:"flex gap-1.5",children:[0,1,2].map(d=>r.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-orange-400/40 animate-bounce",style:{animationDelay:`${d*.15}s`}},d))})}),!o&&i.length===0&&r.jsx("p",{className:"text-center text-[13px] text-white/30 py-10",children:"Kayıtlı bulgu bulunamadı."}),!o&&i.length>0&&r.jsx(H.div,{variants:SE,initial:"hidden",animate:"show",className:"space-y-2.5",children:i.map((d,p)=>{const f=bE(d.task),m=f.Icon;return r.jsx(H.div,{variants:CE,children:r.jsxs("div",{className:"flex items-start gap-3 p-4 rounded-2xl",style:{background:"rgba(255,255,255,0.03)",border:`1px solid ${f.color}22`},children:[r.jsx("div",{className:"w-8 h-8 rounded-xl flex items-center justify-center flex-shrink-0 mt-0.5",style:{background:`${f.color}15`,border:`1px solid ${f.color}30`},children:r.jsx(m,{size:14,style:{color:f.color}})}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("p",{className:"text-[11px] font-bold mb-1 tracking-wide",style:{color:f.color},children:f.label}),r.jsx("p",{className:"text-[12.5px] text-white/65 leading-relaxed",children:d.summary})]}),r.jsx(dn,{size:13,className:"text-white/15 flex-shrink-0 mt-1"})]})},p)})})]}),r.jsx(H.div,{initial:{opacity:0},animate:{opacity:1},transition:{delay:.6},className:"flex-shrink-0 px-8 py-5",style:{borderTop:"1px solid rgba(249,115,22,0.10)"},children:r.jsxs("button",{onClick:u,className:"w-full py-3 rounded-2xl flex items-center justify-center gap-2 font-bold text-[14px] transition-all active:scale-[0.98]",style:{background:"rgba(249,115,22,0.15)",border:"1px solid rgba(249,115,22,0.30)",color:"#fdba74"},onMouseEnter:d=>d.currentTarget.style.background="rgba(249,115,22,0.22)",onMouseLeave:d=>d.currentTarget.style.background="rgba(249,115,22,0.15)",children:[r.jsx(ze,{size:15}),"Günün başlasın"]})})]})},"morning-briefing-overlay")})}const k0={CodeHealth:{label:"Kod Sağlığı",Icon:hn,color:"#fb923c"},DepAudit:{label:"Bağımlılık",Icon:$s,color:"#a78bfa"},LogAnalysis:{label:"Log Analizi",Icon:Qt,color:"#38bdf8"},LTMGap:{label:"Bellek",Icon:Yt,color:"#34d399"},WorkspaceDiff:{label:"Değişiklikler",Icon:rv,color:"#fbbf24"}};function _E(e){const t=Object.keys(k0).find(n=>e.toLowerCase().includes(n.toLowerCase()));return t?k0[t]:{label:e,Icon:Ll,color:"#fb923c"}}function TE(e){const t=Math.round(e/1e3);return t<60?`${t}s`:`${Math.floor(t/60)}m ${t%60}s`}const PE={hidden:{opacity:0,x:24,scale:.96},show:{opacity:1,x:0,scale:1,transition:{type:"spring",stiffness:320,damping:28}},exit:{opacity:0,x:24,scale:.96,transition:{duration:.22}}},AE={hidden:{opacity:0,y:-6},show:{opacity:1,y:0,transition:{duration:.22}}};function ME(){const[e,t]=h.useState("idle"),[n,s]=h.useState([]),[i,a]=h.useState(null),[o,l]=h.useState(!1),[c,u]=h.useState(!1),d=h.useRef(null),p=h.useRef(0),f=h.useCallback((v=2e4)=>{d.current&&clearTimeout(d.current),d.current=setTimeout(()=>{l(!1),setTimeout(()=>u(!1),600)},v)},[]);if(h.useEffect(()=>{const v=at();return v.on("nightOwlEvent",y=>{if(y.type==="shiftStart"){d.current&&clearTimeout(d.current),t("scanning"),s([]),a(null),u(!0),l(!0);return}if(y.type==="finding"){const b={id:`${++p.current}`,task:String(y.task??"General"),summary:String(y.summary??"").slice(0,120),ts:Number(y.ts??Date.now())};s(g=>[b,...g].slice(0,20));return}if(y.type==="shiftEnd"){t("done"),a({findingsCount:Number(y.findingsCount??0),durationMs:Number(y.durationMs??0),ts:Number(y.ts??Date.now())}),f(2e4);return}}),()=>{v.off("nightOwlEvent"),d.current&&clearTimeout(d.current)}},[f]),!c)return null;const m="#fb923c";return r.jsx(se,{children:r.jsx(H.div,{variants:PE,initial:"hidden",animate:"show",exit:"exit",className:"fixed z-[130] flex flex-col",style:{top:"80px",right:"20px",width:"300px",maxHeight:"70vh",pointerEvents:"auto"},children:r.jsxs("div",{className:"rounded-2xl overflow-hidden flex flex-col",style:{background:"rgba(10,4,1,0.90)",border:`1px solid ${m}28`,backdropFilter:"blur(24px)",boxShadow:"0 12px 40px rgba(0,0,0,0.60), inset 0 1px 0 rgba(255,255,255,0.04)"},children:[r.jsxs("button",{onClick:()=>{l(v=>!v),d.current&&clearTimeout(d.current)},className:"flex items-center justify-between px-4 py-3 w-full select-none",style:{borderBottom:o?`1px solid ${m}10`:"none"},children:[r.jsxs("div",{className:"flex items-center gap-2.5",children:[e==="scanning"?r.jsxs("span",{className:"relative flex-shrink-0",children:[r.jsx("span",{className:"block w-2 h-2 rounded-full bg-orange-400"}),r.jsx("span",{className:"absolute inset-0 rounded-full bg-orange-400 animate-ping opacity-70"})]}):e==="done"?r.jsx(Ve,{size:13,className:"text-green-400 flex-shrink-0"}):r.jsx(Rl,{size:13,className:"text-orange-300/50 flex-shrink-0"}),r.jsx("span",{className:"text-[12px] font-semibold text-white/75",children:e==="scanning"?"Gece Vardiyası":"Vardiya Logu"}),e==="scanning"&&r.jsx("span",{className:"text-[10px] text-orange-400/70 font-mono animate-pulse",children:"taranıyor…"}),e==="done"&&i&&r.jsxs("span",{className:"text-[10px] text-white/30 font-mono",children:[i.findingsCount," bulgu · ",TE(i.durationMs)]})]}),o?r.jsx(Al,{size:12,className:"text-white/25"}):r.jsx(Gr,{size:12,className:"text-white/25"})]}),r.jsx(se,{children:o&&r.jsxs(H.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.22},className:"overflow-hidden",children:[r.jsxs("div",{className:"overflow-y-auto",style:{maxHeight:"52vh",scrollbarWidth:"none"},children:[e==="scanning"&&n.length===0&&r.jsxs("div",{className:"flex items-center justify-center py-8 gap-2",children:[r.jsx("div",{className:"flex gap-1",children:[0,1,2].map(v=>r.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-orange-400/50 animate-bounce",style:{animationDelay:`${v*.15}s`}},v))}),r.jsx("span",{className:"text-[11px] text-white/30",children:"Sistem analiz ediliyor…"})]}),r.jsx(se,{initial:!1,children:n.map(v=>{const y=_E(v.task),b=y.Icon;return r.jsxs(H.div,{variants:AE,initial:"hidden",animate:"show",exit:{opacity:0,height:0},className:"flex items-start gap-3 px-4 py-3",style:{borderBottom:"1px solid rgba(255,255,255,0.04)"},children:[r.jsx("div",{className:"w-6 h-6 rounded-lg flex items-center justify-center flex-shrink-0 mt-0.5",style:{background:`${y.color}15`,border:`1px solid ${y.color}30`},children:r.jsx(b,{size:11,style:{color:y.color}})}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("p",{className:"text-[10px] font-bold mb-0.5",style:{color:y.color},children:y.label}),r.jsx("p",{className:"text-[11px] text-white/50 leading-snug line-clamp-3",children:v.summary})]})]},v.id)})}),e==="done"&&n.length===0&&r.jsx("p",{className:"text-center text-[12px] text-white/25 py-8",children:"Kayda değer bulgu yok."})]}),e==="done"&&i&&r.jsxs("div",{className:"px-4 py-2.5 flex items-center justify-between",style:{borderTop:`1px solid ${m}10`},children:[r.jsx("span",{className:"text-[10px] text-white/25 font-mono",children:new Date(i.ts).toLocaleTimeString("tr-TR")}),r.jsx("span",{className:"text-[10px] text-green-400/70 font-semibold",children:"✓ Tamamlandı"})]})]},"log-body")})]})},"night-shift-log")})}const j0="mustb_boot_report",N0=14e3;function RE({value:e,max:t=10}){const n=Math.round(e/t*100),s=n>=70?"#22c55e":n>=40?"#f97316":"#ef4444";return r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("div",{className:"flex-1 h-1.5 rounded-full overflow-hidden",style:{background:"rgba(255,255,255,0.08)"},children:r.jsx("div",{className:"h-full rounded-full transition-all duration-700",style:{width:`${n}%`,background:s}})}),r.jsx("span",{className:"text-[11px] font-mono",style:{color:s},children:e.toFixed(1)})]})}function zE(){const[e,t]=h.useState(!1),[n,s]=h.useState(null),i=h.useCallback(()=>{t(!1),localStorage.removeItem(j0)},[]);return h.useEffect(()=>{if(localStorage.getItem(j0)!=="1")return;t(!0),$("/api/status").then(o=>o.ok?o.json():null).then(o=>{o&&s(o)}).catch(()=>{});const a=setTimeout(i,N0);return()=>clearTimeout(a)},[i]),r.jsx(se,{children:e&&r.jsx(H.div,{initial:{opacity:0,scale:.96,y:16},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.96,y:16},transition:{duration:.28,ease:"easeOut"},className:"fixed inset-0 z-[500] flex items-center justify-center p-4",style:{background:"rgba(0,0,0,0.55)",backdropFilter:"blur(8px)"},children:r.jsxs("div",{className:"relative w-full max-w-sm rounded-2xl overflow-hidden",style:{background:"rgba(14,6,2,0.92)",border:"1px solid rgba(234,88,12,0.30)",boxShadow:"0 24px 80px rgba(0,0,0,0.7), 0 0 0 1px rgba(234,88,12,0.10)",backdropFilter:"blur(24px)"},children:[r.jsx("button",{onClick:i,className:"absolute top-3 right-3 text-white/25 hover:text-white/60 transition-colors z-10",children:r.jsx(et,{size:14})}),r.jsxs("div",{className:"px-5 pt-5 pb-3 flex items-center gap-3",children:[r.jsx("div",{className:"w-9 h-9 rounded-xl flex items-center justify-center flex-shrink-0",style:{background:"rgba(234,88,12,0.15)",border:"1px solid rgba(234,88,12,0.25)"},children:r.jsx(Ve,{size:18,style:{color:"#22c55e"}})}),r.jsxs("div",{children:[r.jsx("p",{className:"text-[13px] font-bold text-white/90",children:"System Ready"}),r.jsx("p",{className:"text-[11px] text-white/40",children:"Must-b initialised successfully"})]})]}),r.jsx("div",{style:{height:1,background:"rgba(255,255,255,0.05)",margin:"0 20px"}}),r.jsxs("div",{className:"px-5 py-4 space-y-3",children:[r.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[r.jsxs("div",{className:"rounded-xl px-3 py-2.5",style:{background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.07)"},children:[r.jsx("p",{className:"text-[9px] font-semibold uppercase tracking-widest text-white/30 mb-1",children:"Agent"}),r.jsx("p",{className:"text-[12px] font-semibold text-white/80 truncate",children:(n==null?void 0:n.role)??"—"})]}),r.jsxs("div",{className:"rounded-xl px-3 py-2.5",style:{background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.07)"},children:[r.jsx("p",{className:"text-[9px] font-semibold uppercase tracking-widest text-white/30 mb-1",children:"Model"}),r.jsx("p",{className:"text-[12px] font-semibold text-white/80 truncate",children:(n==null?void 0:n.model)??"—"})]})]}),r.jsxs("div",{className:"rounded-xl px-3 py-2.5 space-y-2",style:{background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.07)"},children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("span",{className:"flex items-center gap-1.5 text-[10px] font-semibold text-white/40",children:[r.jsx(fn,{size:10})," CPU"]}),r.jsxs("span",{className:"text-[10px] font-mono text-white/50",children:[(n==null?void 0:n.cpuPct)??0,"%"]})]}),r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("span",{className:"flex items-center gap-1.5 text-[10px] font-semibold text-white/40",children:[r.jsx(lv,{size:10})," RAM"]}),r.jsxs("span",{className:"text-[10px] font-mono text-white/50",children:[((n==null?void 0:n.ramGb)??0).toFixed(2)," GB"]})]}),n&&r.jsxs("div",{className:"flex items-center justify-between pt-1",children:[r.jsxs("span",{className:"flex items-center gap-1.5 text-[10px] font-semibold text-white/40",children:[r.jsx(ze,{size:10})," Score"]}),r.jsx(RE,{value:n.score})]})]}),r.jsxs("div",{className:"flex items-center justify-between px-1",children:[r.jsx("span",{className:"text-[10px] text-white/30",children:"Dashboard port"}),r.jsxs("span",{className:"text-[11px] font-mono text-orange-400/70",children:[":",(n==null?void 0:n.port)??4309]})]})]}),r.jsx("div",{className:"px-5 pb-4",style:{borderTop:"1px solid rgba(255,255,255,0.05)",paddingTop:"12px"},children:r.jsx("button",{onClick:i,className:"w-full py-2 rounded-xl text-[12px] font-semibold transition-all",style:{background:"rgba(234,88,12,0.15)",border:"1px solid rgba(234,88,12,0.30)",color:"#fb923c"},children:"Open Dashboard"})}),r.jsx(H.div,{initial:{scaleX:1},animate:{scaleX:0},transition:{duration:N0/1e3,ease:"linear"},style:{position:"absolute",bottom:0,left:0,right:0,height:2,background:"rgba(234,88,12,0.50)",transformOrigin:"left"}})]})},"boot-report")})}function S0(){return h.useEffect(()=>{at()},[]),r.jsxs("div",{className:"flex flex-col h-[calc(100vh-72px)] overflow-hidden",children:[r.jsx(fE,{}),r.jsx(yE,{}),r.jsx(hE,{}),r.jsx(zE,{}),r.jsx(EE,{}),r.jsx(ME,{})]})}function ba(){const[e,t]=h.useState(!1),[n,s]=h.useState(!0),i=h.useRef(!0),a=h.useCallback(async()=>{try{const o=await $("/api/gateway/status",{},{retries:1,retryDelay:500});if(!i.current)return;const l=await o.json().catch(()=>({}));t(!!(l!=null&&l.online))}catch{i.current&&t(!1)}finally{i.current&&s(!1)}},[]);return h.useEffect(()=>{i.current=!0,a();const o=setInterval(a,15e3),l=()=>{a()},c=()=>{a()},u=()=>{i.current&&t(!1)};try{at()}catch{}return window.addEventListener("mustb:connected",l),window.addEventListener("mustb:reconnected",c),window.addEventListener("mustb:disconnected",u),()=>{i.current=!1,clearInterval(o),window.removeEventListener("mustb:connected",l),window.removeEventListener("mustb:reconnected",c),window.removeEventListener("mustb:disconnected",u)}},[a]),{online:e,loading:n}}function C0({connected:e,configured:t}){return e?r.jsx("span",{className:"w-2 h-2 rounded-full bg-green-400 flex-shrink-0"}):t?r.jsx("span",{className:"w-2 h-2 rounded-full bg-orange-400 flex-shrink-0"}):r.jsx("span",{className:"w-2 h-2 rounded-full bg-gray-600 flex-shrink-0"})}function LE(){const{online:e}=ba(),[t,n]=h.useState(null),[s,i]=h.useState([]),[a,o]=h.useState(null),[l,c]=h.useState(null),[u,d]=h.useState(!0);h.useEffect(()=>{(async()=>{var g;d(!0);try{const w=await(await $("/api/gateway/channels")).json();n(w),(g=w.channelOrder)!=null&&g.length&&o(w.channelOrder[0])}catch{n({offline:!0,channelOrder:[],channelLabels:{},channelAccounts:{}})}finally{d(!1)}})()},[e]),h.useEffect(()=>{t!=null&&t.offline&&$("/api/channels").then(b=>b.json()).then(i).catch(()=>i([]))},[t==null?void 0:t.offline]);const p=async(b,g)=>{c(`${b}-${g}`);try{await $(`/api/gateway/channels/${b}/logout`,{method:"POST",body:JSON.stringify({accountId:g})});const x=await $("/api/gateway/channels");n(await x.json())}catch{}finally{c(null)}};if(u)return r.jsxs("div",{className:"flex items-center justify-center py-12",children:[r.jsx(de,{size:18,className:"animate-spin text-orange-400"}),r.jsx("span",{className:"ml-2 text-sm text-gray-500",children:"Kanallar yükleniyor…"})]});if(t!=null&&t.offline)return r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5 rounded-xl bg-orange-500/8 border border-orange-500/20",children:[r.jsx(Ws,{size:14,className:"text-orange-400 flex-shrink-0"}),r.jsx("p",{className:"text-[12px] text-orange-300",children:"Must-b gateway çevrimdışı — yerel kanallar gösteriliyor."})]}),s.length===0?r.jsx("p",{className:"text-center text-sm text-gray-600 py-6",children:"Yapılandırılmış kanal yok."}):r.jsx("div",{className:"grid grid-cols-2 gap-2",children:s.map(b=>r.jsxs("div",{className:"px-3 py-2.5 rounded-xl bg-white/3 border border-white/6",children:[r.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[r.jsx(C0,{configured:b.configured,connected:!1}),r.jsx("span",{className:"text-[13px] font-semibold text-gray-200",children:b.name}),b.configured&&r.jsx("span",{className:"ml-auto text-[9px] font-bold px-1.5 py-0.5 rounded-md bg-orange-500/10 border border-orange-500/20 text-orange-400",children:"Yapılandırıldı"})]}),r.jsx("p",{className:"text-[11px] text-gray-500 line-clamp-2",children:b.description})]},b.id))})]});const f=(t==null?void 0:t.channelOrder)??[],m=(t==null?void 0:t.channelLabels)??{},v=(t==null?void 0:t.channelAccounts)??{};if(f.length===0)return r.jsx("p",{className:"text-center text-sm text-gray-600 py-8",children:"Yapılandırılmış kanal bulunamadı."});const y=a?v[a]??[]:[];return r.jsxs("div",{className:"flex gap-4 min-h-[320px]",children:[r.jsx("div",{className:"w-48 flex-shrink-0 space-y-1",children:f.map(b=>{const g=v[b]??[],x=g.some(j=>j.connected),w=g.some(j=>j.configured);return r.jsx("button",{onClick:()=>o(b),className:`w-full text-left px-3 py-2 rounded-xl border transition-all ${a===b?"bg-orange-500/12 border-orange-500/30":"bg-white/3 border-white/6 hover:bg-white/5 hover:border-white/12"}`,children:r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(C0,{connected:x,configured:w}),r.jsx("span",{className:"text-[12px] font-semibold text-gray-200 truncate",children:m[b]??b}),g.length>0&&r.jsx("span",{className:"ml-auto text-[10px] font-bold text-gray-500",children:g.length})]})},b)})}),r.jsx("div",{className:"flex-1 min-w-0",children:a?y.length===0?r.jsxs("div",{className:"px-4 py-4 rounded-xl bg-white/3 border border-white/6",children:[r.jsx("p",{className:"text-[13px] font-semibold text-gray-300 mb-1",children:m[a]??a}),r.jsx("p",{className:"text-[12px] text-gray-500",children:"Henüz bağlı hesap yok."})]}):r.jsx("div",{className:"space-y-2",children:y.map(b=>r.jsxs("div",{className:"px-4 py-3 rounded-xl bg-white/3 border border-white/6",children:[r.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[b.connected?r.jsx(Ve,{size:13,className:"text-green-400 flex-shrink-0"}):b.lastError?r.jsx(nv,{size:13,className:"text-red-400 flex-shrink-0"}):r.jsx(os,{size:13,className:"text-orange-400 flex-shrink-0"}),r.jsx("span",{className:"text-[13px] font-semibold text-gray-200 truncate",children:b.name??b.accountId}),r.jsxs("button",{onClick:()=>p(a,b.accountId),disabled:l===`${a}-${b.accountId}`,className:"ml-auto flex items-center gap-1 px-2 py-1 rounded-lg bg-red-500/8 border border-red-500/20 text-red-400 text-[10px] font-semibold hover:bg-red-500/15 transition-all disabled:opacity-40",children:[r.jsx(tf,{size:9}),"Logout"]})]}),r.jsxs("div",{className:"space-y-1",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"text-[10px] text-gray-600 w-20 flex-shrink-0",children:"Status"}),r.jsx("span",{className:`text-[11px] font-semibold ${b.connected?"text-green-400":"text-gray-500"}`,children:b.connected?"Connected":"Disconnected"})]}),b.lastConnectedAt&&r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"text-[10px] text-gray-600 w-20 flex-shrink-0",children:"Last seen"}),r.jsx("span",{className:"text-[11px] text-gray-400",children:new Date(b.lastConnectedAt).toLocaleString()})]}),b.lastError&&r.jsxs("div",{className:"flex items-start gap-2",children:[r.jsx("span",{className:"text-[10px] text-gray-600 w-20 flex-shrink-0 pt-0.5",children:"Error"}),r.jsx("span",{className:"text-[11px] text-red-400 break-all",children:b.lastError})]})]})]},b.accountId))}):r.jsx("p",{className:"text-sm text-gray-600 pt-4",children:"Bir kanal seçin."})})]})}function OE(e){return e===0?"Free":e<1?`$${e.toFixed(3)}/1M`:`$${e.toFixed(2)}/1M`}function DE(e){return e?e>=1e3?`${(e/1e3).toFixed(0)}M`:`${e}k`:"—"}const E0={free:{label:"Free",icon:r.jsx(dC,{size:11}),color:"#22c55e",bg:"rgba(34,197,94,0.12)"},balanced:{label:"Balanced",icon:r.jsx(MC,{size:11}),color:"#60a5fa",bg:"rgba(96,165,250,0.12)"},power:{label:"Power",icon:r.jsx(ze,{size:11}),color:"#f59e0b",bg:"rgba(245,158,11,0.12)"}};function IE({currentModel:e,onSelect:t,className:n}){const[s,i]=h.useState(null),[a,o]=h.useState(!0),[l,c]=h.useState(null),[u,d]=h.useState("free"),[p,f]=h.useState(""),m=h.useRef(null),v=(g=!1)=>{o(!0),c(null),fetch(`/api/providers/openrouter/models${g?"?refresh=1":""}`).then(x=>x.ok?x.json():Promise.reject(new Error(`HTTP ${x.status}`))).then(x=>{if(i(x),e){const w=x.free.some(j=>j.id===e)?"free":x.balanced.some(j=>j.id===e)?"balanced":x.power.some(j=>j.id===e)?"power":"free";d(w)}o(!1)}).catch(x=>{c(x.message),o(!1)})};h.useEffect(()=>{v()},[]),h.useEffect(()=>{m.current&&m.current.scrollIntoView({block:"nearest",behavior:"smooth"})},[u,s]);const y=(s==null?void 0:s[u])??[],b=p?y.filter(g=>g.name.toLowerCase().includes(p.toLowerCase())||g.id.toLowerCase().includes(p.toLowerCase())):y;return r.jsxs("div",{className:`flex flex-col rounded-xl overflow-hidden ${n??""}`,style:{background:"rgba(12,5,2,0.85)",border:"1px solid rgba(255,255,255,0.07)"},children:[r.jsxs("div",{className:"flex items-center justify-between px-3 pt-3 pb-2",children:[r.jsx("span",{className:"text-[11px] font-bold text-gray-400 uppercase tracking-widest",children:"OpenRouter Models"}),r.jsx("button",{onClick:()=>v(!0),className:"text-gray-600 hover:text-orange-400 transition-colors p-1 rounded",title:"Refresh catalog",disabled:a,children:r.jsx(de,{size:11,className:a?"animate-spin":""})})]}),r.jsx("div",{className:"flex gap-1 px-3 pb-2",children:["free","balanced","power"].map(g=>{var k;const x=E0[g],w=((k=s==null?void 0:s.totals)==null?void 0:k[g])??0,j=u===g;return r.jsxs("button",{onClick:()=>d(g),className:"flex items-center gap-1.5 px-2.5 py-1 rounded-lg text-[11px] font-semibold transition-all",style:{background:j?x.bg:"transparent",color:j?x.color:"#6b7280",border:`1px solid ${j?x.color+"40":"transparent"}`},children:[x.icon,x.label,w>0&&r.jsx("span",{className:"text-[9px] font-bold opacity-60",children:w})]},g)})}),r.jsx("div",{className:"px-3 pb-2",children:r.jsxs("div",{className:"relative",children:[r.jsx(Xt,{size:11,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-gray-600"}),r.jsx("input",{value:p,onChange:g=>f(g.target.value),placeholder:"Search models…",className:"w-full pl-7 pr-3 py-1.5 rounded-lg text-[11px] text-gray-300 placeholder-gray-600 outline-none",style:{background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.07)"}})]})}),r.jsxs("div",{className:"overflow-y-auto",style:{maxHeight:"320px"},children:[a&&r.jsxs("div",{className:"py-8 text-center text-[11px] text-gray-600",children:[r.jsx(de,{size:14,className:"animate-spin mx-auto mb-2"}),"Fetching live catalog…"]}),!a&&l&&r.jsxs("div",{className:"py-6 px-4 text-center text-[11px] text-red-400",children:[l,r.jsx("br",{}),r.jsx("button",{onClick:()=>v(!0),className:"mt-2 underline text-orange-400 hover:text-orange-300",children:"Retry"})]}),!a&&!l&&b.length===0&&r.jsx("div",{className:"py-8 text-center text-[11px] text-gray-600",children:"No models found."}),!a&&!l&&b.map(g=>{const x=g.id===e,w=E0[g.tier];return r.jsx("button",{ref:x?m:void 0,onClick:()=>t(g.id),className:"w-full text-left px-3 py-2 transition-all",style:{background:x?"rgba(234,88,12,0.10)":"transparent",borderLeft:x?"2px solid #ea580c":"2px solid transparent"},children:r.jsxs("div",{className:"flex items-start justify-between gap-2",children:[r.jsxs("div",{className:"min-w-0 flex-1",children:[r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx("span",{className:`text-[12px] font-semibold truncate ${x?"text-orange-300":"text-gray-300"}`,children:g.name}),g.hasVision&&r.jsx(Ls,{size:9,className:"text-purple-400 flex-shrink-0",title:"Vision / multimodal"})]}),r.jsx("span",{className:"text-[9px] text-gray-600 font-mono truncate block",children:g.id}),g.description&&r.jsx("span",{className:"text-[10px] text-gray-600 line-clamp-1 mt-0.5",children:g.description})]}),r.jsxs("div",{className:"flex flex-col items-end gap-1 flex-shrink-0",children:[r.jsx("span",{className:"text-[9px] font-bold",style:{color:w.color},children:OE(g.costPer1M)}),r.jsxs("span",{className:"text-[9px] text-gray-600",children:[DE(g.contextK)," ctx"]})]})]})},g.id)})]}),s&&r.jsx("div",{className:"px-3 py-1.5 border-t",style:{borderColor:"rgba(255,255,255,0.04)"},children:r.jsxs("span",{className:"text-[9px] text-gray-700 font-mono",children:["Catalog cached · ",new Date(s.fetchedAt).toLocaleTimeString()]})})]})}const Bc=[{code:"en",label:"English",flag:"🇬🇧",native:"English"},{code:"tr",label:"Turkish",flag:"🇹🇷",native:"Türkçe"},{code:"de",label:"German",flag:"🇩🇪",native:"Deutsch"},{code:"fr",label:"French",flag:"🇫🇷",native:"Français"},{code:"es",label:"Spanish",flag:"🇪🇸",native:"Español"},{code:"pt",label:"Portuguese (Brazil)",flag:"🇧🇷",native:"Português"},{code:"ja",label:"Japanese",flag:"🇯🇵",native:"日本語"},{code:"zh",label:"Chinese (Simplified)",flag:"🇨🇳",native:"简体中文"}];function BE(){const{locale:e,setLocale:t}=pt(),[n,s]=h.useState(!1),i=h.useRef(null),a=Bc.find(o=>o.code===e)??Bc[0];return h.useEffect(()=>{if(!n)return;const o=l=>{l.key==="Escape"&&s(!1)};return document.addEventListener("keydown",o),()=>document.removeEventListener("keydown",o)},[n]),r.jsxs("div",{ref:i,className:"relative",children:[r.jsxs("button",{onClick:()=>s(o=>!o),"aria-label":"Switch language",className:`flex items-center gap-1.5 px-2.5 py-1.5 rounded-full border text-[12px] font-semibold transition-all select-none ${n?"bg-orange-500/15 border-orange-400/30 text-orange-700":"text-black/65 border-transparent hover:text-black hover:bg-black/6"}`,children:[r.jsx(xC,{size:12,className:"text-orange-400 shrink-0"}),r.jsx("span",{children:a.flag}),r.jsx("span",{className:"tracking-wide",children:a.code.toUpperCase()})]}),r.jsx(se,{children:n&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"fixed inset-0 z-10",onClick:()=>s(!1)}),r.jsxs(H.div,{initial:{opacity:0,y:-6,scale:.96},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-6,scale:.96},transition:{duration:.13,ease:"easeOut"},className:"absolute right-0 top-full mt-2 z-20 w-52 bg-[#100806]/96 backdrop-blur-2xl border border-orange-500/15 rounded-xl shadow-2xl shadow-black/60 overflow-hidden max-h-72 overflow-y-auto",children:[r.jsx("div",{className:"px-3 py-2 border-b border-white/6",children:r.jsx("p",{className:"text-[9px] font-bold text-gray-600 uppercase tracking-widest",children:"Language"})}),Bc.map(o=>{const l=e===o.code;return r.jsxs("button",{onClick:()=>{t(o.code),s(!1)},className:`w-full flex items-center gap-3 px-3 py-2.5 text-[12px] font-medium transition-colors ${l?"bg-orange-500/12 text-orange-400":"text-gray-300 hover:bg-white/5 hover:text-white"}`,children:[r.jsx("span",{className:"text-base leading-none",children:o.flag}),r.jsxs("div",{className:"text-left flex-1",children:[r.jsx("p",{className:"leading-none",children:o.native}),!l&&r.jsx("p",{className:"text-[10px] text-gray-600 mt-0.5",children:o.label})]}),l&&r.jsx(zt,{size:12,className:"text-orange-400 shrink-0"})]},o.code)})]})]})})]})}const _0={frontier:"⚡ Frontier",gateway:"🌐 Gateway",fast:"🚀 Fast",local:"💻 Local",open:"🔓 Open Source",specialist:"🎯 Specialist",regional:"🌏 Regional",enterprise:"🏢 Enterprise",custom:"⚙️ Custom"},T0=["frontier","gateway","fast","local","open","specialist","regional","enterprise","custom"];function zv({tag:e}){return r.jsx("span",{className:"px-1.5 py-0.5 rounded-md bg-white/5 border border-white/8 text-[9px] text-gray-400 font-medium",children:e})}function FE({p:e,active:t,onClick:n}){return r.jsx("button",{onClick:n,className:`w-full text-left px-3 py-2.5 rounded-xl border transition-all ${t?"bg-orange-500/12 border-orange-500/30":"bg-white/3 border-white/6 hover:bg-white/5 hover:border-white/12"}`,children:r.jsxs("div",{className:"flex items-start justify-between gap-2",children:[r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("p",{className:`text-[13px] font-semibold leading-tight truncate ${t?"text-orange-300":"text-gray-200"}`,children:e.label}),r.jsx("p",{className:"text-[11px] text-gray-400 mt-0.5 leading-snug line-clamp-2",children:e.description}),r.jsx("div",{className:"flex flex-wrap gap-1 mt-1.5",children:e.tags.slice(0,3).map(s=>r.jsx(zv,{tag:s},s))})]}),t&&r.jsx(dn,{size:13,className:"text-orange-400 shrink-0 mt-1"})]})})}function VE(){const{t:e}=pt(),t=e.panels.settings,[n,s]=h.useState([]),[i,a]=h.useState(null),[o,l]=h.useState([]),[c,u]=h.useState("all"),[d,p]=h.useState(""),[f,m]=h.useState(null),[v,y]=h.useState(""),[b,g]=h.useState(""),[x,w]=h.useState(!1),[j,k]=h.useState(!1),[N,S]=h.useState(!1),[E,P]=h.useState(null),[A,T]=h.useState(null),[V,R]=h.useState(!!window.__MUSTB_NEED_API_KEY),[I,L]=h.useState(null),[z,B]=h.useState("providers"),C=h.useRef(null);h.useEffect(()=>{$("/api/setup/providers").then(Q=>Q.ok?Q.json():null).then(Q=>{Q!=null&&Q.providers&&s(Q.providers)}).catch(()=>{}),$("/api/setup/status").then(Q=>Q.ok?Q.json():null).then(Q=>{Q&&a(Q)}).catch(()=>{}),$("/api/setup/ollama-models").then(Q=>Q.ok?Q.json():null).then(Q=>{Q!=null&&Q.models&&l(Q.models)}).catch(()=>{});const G=()=>{R(!0),window.__MUSTB_NEED_API_KEY=!0};return window.addEventListener("mustb:401",G),()=>window.removeEventListener("mustb:401",G)},[]),h.useEffect(()=>{f&&y(f.defaultModel)},[f]);const M=d.toLowerCase(),_=n.filter(G=>!(c!=="all"&&G.category!==c||M&&!G.label.toLowerCase().includes(M)&&!G.description.toLowerCase().includes(M))),U={};for(const G of _)U[G.category]||(U[G.category]=[]),U[G.category].push(G);const K=async()=>{if(f){k(!0),P(null);try{const Q=await(await $("/api/setup/test-key",{method:"POST",body:JSON.stringify({provider:f.id,apiKey:b||void 0,model:v||void 0})})).json();P({ok:Q.ok,msg:Q.message??(Q.ok?"Connection successful":"Connection failed")})}catch{P({ok:!1,msg:"Gateway unreachable"})}k(!1)}},Y=async()=>{if(!(!f||!f.envKeyIsUrl&&!b.trim())){S(!0),T(null);try{const Q=await $("/api/setup/update-key",{method:"POST",body:JSON.stringify({provider:f.id,apiKey:b||void 0,model:v||void 0})});if(Q.ok){T("Saved successfully."),g(""),window.__MUSTB_NEED_API_KEY=!1,R(!1);const Lt=await $("/api/setup/status");Lt.ok&&a(await Lt.json())}else{const Lt=await Q.json();T(Lt.error??"Failed to save.")}}catch{T("Gateway unreachable.")}S(!1),setTimeout(()=>T(null),6e3)}},J=G=>{L(G),$("/api/setup/save",{method:"POST",body:JSON.stringify({provider:"ollama",model:G})}).finally(()=>{setTimeout(()=>L(null),3e3)})},ce=(f==null?void 0:f.envKeyIsUrl)??!1,oe=(f==null?void 0:f.id)==="ollama",re=(f==null?void 0:f.id)==="openrouter",De=T0.filter(G=>n.some(Q=>Q.category===G)),ot=i?i.score>=70?"text-green-400":i.score>=40?"text-amber-400":"text-red-400":"text-gray-400";return r.jsxs("div",{className:"h-full flex flex-col overflow-hidden font-sans",children:[r.jsxs("div",{className:"shrink-0 flex items-center justify-between px-5 py-3 border-b border-white/6",children:[r.jsxs("div",{className:"flex items-center gap-2.5",children:[r.jsx("div",{className:"w-8 h-8 rounded-xl bg-orange-500/10 border border-orange-500/20 flex items-center justify-center",children:r.jsx(af,{size:15,className:"text-orange-400"})}),r.jsxs("div",{children:[r.jsx("h1",{className:"text-[14px] font-bold text-white leading-tight",children:t.title}),r.jsxs("p",{className:"text-[10px] text-gray-400 leading-tight",children:[i!=null&&i.configured?`Active · ${i.provider??"unknown"}`:"Not configured",i!=null&&i.mode?` · ${i.mode}`:""]})]})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(BE,{}),i&&r.jsxs("div",{className:"flex items-center gap-1.5 px-2.5 py-1 rounded-lg bg-white/4 border border-white/8",children:[r.jsx(fn,{size:11,className:ot}),r.jsxs("span",{className:`text-[11px] font-semibold ${ot}`,children:["HW ",i.score]}),r.jsxs("span",{className:"text-[10px] text-gray-400",children:["· ",i.tier]})]})]})]}),V&&r.jsxs("div",{className:"shrink-0 mx-4 mt-3 flex items-start gap-2.5 px-3.5 py-2.5 rounded-xl bg-red-500/10 border border-red-500/25 text-red-300",children:[r.jsx(os,{size:14,className:"shrink-0 mt-0.5"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-[12px] font-semibold",children:"API key missing or invalid"}),r.jsx("p",{className:"text-[10px] text-red-400/70 mt-0.5",children:"A request returned 401 Unauthorized. Select a provider and update your key below."})]})]}),r.jsxs("div",{className:"shrink-0 flex items-center gap-1.5 px-5 pt-3 pb-0",children:[r.jsxs("button",{onClick:()=>B("providers"),className:`flex items-center gap-1.5 px-3 py-1.5 rounded-xl text-[11px] font-semibold border transition-all ${z==="providers"?"bg-orange-500/15 border-orange-500/30 text-orange-300":"bg-white/3 border-white/6 text-gray-400 hover:text-gray-300 hover:border-white/12"}`,children:[r.jsx(fn,{size:11})," LLM Providers"]}),r.jsxs("button",{onClick:()=>B("channels"),className:`flex items-center gap-1.5 px-3 py-1.5 rounded-xl text-[11px] font-semibold border transition-all ${z==="channels"?"bg-orange-500/15 border-orange-500/30 text-orange-300":"bg-white/3 border-white/6 text-gray-400 hover:text-gray-300 hover:border-white/12"}`,children:[r.jsx(vo,{size:11})," Kanallar"]})]}),z==="channels"&&r.jsx("div",{className:"flex-1 overflow-y-auto p-5",children:r.jsx(LE,{})}),z==="providers"&&r.jsxs("div",{className:"flex flex-1 min-h-0 gap-0",children:[r.jsxs("div",{className:"w-[52%] flex flex-col border-r border-white/6 min-h-0",children:[r.jsxs("div",{className:"shrink-0 px-4 pt-3 pb-2 space-y-2.5",children:[r.jsxs("div",{className:"relative",children:[r.jsx(Xt,{size:12,className:"absolute left-3 top-1/2 -translate-y-1/2 text-gray-400"}),r.jsx("input",{ref:C,type:"text",value:d,onChange:G=>p(G.target.value),placeholder:t.searchPlaceholder,className:"w-full bg-white/4 border border-white/8 rounded-xl pl-8 pr-3 py-2 text-[12px] text-white placeholder:text-gray-400 outline-none focus:border-orange-500/40 transition-colors"})]}),r.jsxs("div",{className:"flex flex-wrap gap-1",children:[r.jsx("button",{onClick:()=>u("all"),className:`px-2 py-0.5 rounded-lg text-[10px] font-semibold border transition-all ${c==="all"?"bg-orange-500/15 border-orange-500/30 text-orange-300":"bg-white/4 border-white/8 text-gray-400 hover:text-gray-300"}`,children:t.allProviders}),De.map(G=>r.jsx("button",{onClick:()=>u(G),className:`px-2 py-0.5 rounded-lg text-[10px] font-semibold border transition-all ${c===G?"bg-orange-500/15 border-orange-500/30 text-orange-300":"bg-white/4 border-white/8 text-gray-400 hover:text-gray-300"}`,children:_0[G]},G))]})]}),r.jsxs("div",{className:"flex-1 overflow-y-auto px-4 pb-4 space-y-4",children:[n.length===0&&r.jsxs("div",{className:"flex items-center gap-2 py-6 text-gray-400 text-[12px]",children:[r.jsx(ne,{size:13,className:"animate-spin"})," Loading providers…"]}),T0.filter(G=>{var Q;return(Q=U[G])==null?void 0:Q.length}).map(G=>r.jsxs("div",{children:[r.jsx("p",{className:"text-[9px] font-bold text-gray-400 uppercase tracking-widest mb-1.5 px-1",children:_0[G]}),r.jsx("div",{className:"space-y-1.5",children:U[G].map(Q=>r.jsx(FE,{p:Q,active:(f==null?void 0:f.id)===Q.id,onClick:()=>{m(Q),P(null),g("")}},Q.id))})]},G)),n.length>0&&_.length===0&&r.jsxs("p",{className:"text-[12px] text-gray-400 py-4 text-center",children:['No providers match "',d,'"']})]})]}),r.jsx("div",{className:"flex-1 flex flex-col min-h-0 overflow-y-auto",children:f?r.jsxs("div",{className:"p-5 space-y-5",children:[r.jsxs("div",{className:"flex items-start justify-between gap-3",children:[r.jsxs("div",{children:[r.jsx("h2",{className:"text-[16px] font-bold text-white",children:f.label}),r.jsx("p",{className:"text-[12px] text-gray-400 mt-0.5 leading-snug",children:f.description}),r.jsx("div",{className:"flex flex-wrap gap-1 mt-1.5",children:f.tags.map(G=>r.jsx(zv,{tag:G},G))})]}),r.jsxs("a",{href:f.docsUrl,target:"_blank",rel:"noopener noreferrer",className:"shrink-0 flex items-center gap-1 px-2.5 py-1.5 rounded-lg bg-white/4 border border-white/8 text-[11px] text-gray-400 hover:text-white transition-colors",children:["Docs ",r.jsx(Ml,{size:10})]})]}),oe&&o.length>0&&r.jsxs("div",{className:"space-y-2",children:[r.jsx("p",{className:"text-[10px] font-bold text-gray-400 uppercase tracking-widest",children:"Recommended Models for Your Hardware"}),r.jsx("div",{className:"space-y-1.5",children:o.map(G=>{const Q=G.fit==="recommended"?"text-green-400 border-green-500/20 bg-green-500/6":G.fit==="marginal"?"text-amber-400 border-amber-500/20 bg-amber-500/6":"text-red-400 border-red-500/20 bg-red-500/6";return r.jsxs("div",{className:"flex items-center justify-between px-3 py-2 rounded-xl bg-white/3 border border-white/6",children:[r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("p",{className:"text-[12px] font-semibold text-gray-200 truncate",children:G.label}),r.jsxs("p",{className:"text-[10px] text-gray-400",children:[G.sizeGb," GB"]})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:`text-[9px] font-bold px-1.5 py-0.5 rounded-md border ${Q}`,children:G.fit}),r.jsxs("button",{onClick:()=>{y(G.id),J(G.id)},disabled:I===G.id,className:"flex items-center gap-1 px-2 py-1 rounded-lg bg-orange-500/10 border border-orange-500/20 text-orange-400 text-[10px] font-semibold hover:bg-orange-500/15 transition-all disabled:opacity-40",children:[I===G.id?r.jsx(ne,{size:10,className:"animate-spin"}):r.jsx(Mi,{size:10}),I===G.id?"Pulling…":"Pull"]})]})]},G.id)})})]}),r.jsxs("div",{className:"space-y-1.5",children:[r.jsxs("p",{className:"text-[10px] font-bold text-gray-400 uppercase tracking-widest flex items-center gap-1.5",children:[ce?r.jsx(RC,{size:9}):r.jsx(mC,{size:9}),ce?t.baseUrl:t.apiKey]}),oe&&!ce?r.jsx("div",{className:"px-3.5 py-2.5 rounded-xl bg-green-500/6 border border-green-500/15 text-green-400 text-[12px]",children:"Ollama runs locally — no API key required. Just make sure Ollama is running."}):r.jsxs("div",{className:"relative",children:[r.jsx("input",{type:x||ce?"text":"password",value:b,onChange:G=>{g(G.target.value),P(null)},placeholder:f.placeholder,className:"w-full bg-white/4 border border-white/10 rounded-xl px-4 py-2.5 pr-10 text-[12px] text-white placeholder:text-gray-400 outline-none focus:border-orange-500/40 transition-colors"}),!ce&&r.jsx("button",{onClick:()=>w(G=>!G),className:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-300 transition-colors",children:x?r.jsx(Zh,{size:13}):r.jsx(Ls,{size:13})})]}),r.jsx("p",{className:"text-[10px] text-gray-400 px-1",children:ce?`Stored in .env as ${f.envKey}. Default: ${f.placeholder}`:`Stored locally in .env as ${f.envKey} — never sent to external servers.`})]}),r.jsxs("div",{className:"space-y-1.5",children:[r.jsxs("p",{className:"text-[10px] font-bold text-gray-400 uppercase tracking-widest flex items-center gap-1.5",children:[r.jsx(ze,{size:9}),t.model]}),re?r.jsx(IE,{currentModel:v,onSelect:y,className:"rounded-xl border border-white/10 bg-white/3"}):r.jsx("select",{value:v,onChange:G=>y(G.target.value),className:"w-full bg-white/4 border border-white/10 rounded-xl px-3 py-2.5 text-[12px] text-white outline-none focus:border-orange-500/40 transition-colors appearance-none",children:f.latestModels.map(G=>r.jsx("option",{value:G,className:"bg-[#1a0c06]",children:G},G))})]}),r.jsxs("div",{className:"flex items-center gap-2.5 pt-1",children:[!oe&&r.jsxs("button",{onClick:K,disabled:j||!b&&!(i!=null&&i.configured),className:"flex items-center gap-1.5 px-3.5 py-2 rounded-xl bg-white/5 border border-white/10 text-[12px] text-gray-300 font-medium hover:bg-white/8 hover:text-white transition-all disabled:opacity-40",children:[r.jsx(de,{size:12,className:j?"animate-spin":""}),j?t.testing:t.testConnection]}),r.jsxs("button",{onClick:Y,disabled:N||!b.trim()&&!ce&&!oe,className:"flex items-center gap-1.5 px-3.5 py-2 rounded-xl bg-orange-600 hover:bg-orange-500 text-white text-[12px] font-semibold transition-all disabled:opacity-40 shadow-lg shadow-orange-500/20",children:[r.jsx(dv,{size:12,className:N?"animate-spin":""}),N?t.saving:t.save]})]}),E&&r.jsxs("div",{className:`flex items-start gap-2 px-3.5 py-2.5 rounded-xl border text-[12px] ${E.ok?"bg-green-500/8 border-green-500/20 text-green-300":"bg-red-500/8 border-red-500/20 text-red-300"}`,children:[E.ok?r.jsx(Ve,{size:13,className:"shrink-0 mt-0.5"}):r.jsx(os,{size:13,className:"shrink-0 mt-0.5"}),E.msg]}),A&&r.jsxs("div",{className:"flex items-center gap-2 px-3.5 py-2.5 rounded-xl bg-orange-500/8 border border-orange-500/20 text-orange-300 text-[12px]",children:[r.jsx(Ve,{size:13,className:"shrink-0"}),A]}),oe&&r.jsxs("div",{className:"pt-1 space-y-1.5",children:[r.jsxs("p",{className:"text-[10px] font-bold text-gray-400 uppercase tracking-widest flex items-center gap-1.5",children:[r.jsx(pC,{size:9}),"Custom Base URL (optional)"]}),r.jsx("input",{type:"text",value:b,onChange:G=>g(G.target.value),placeholder:"http://localhost:11434",className:"w-full bg-white/4 border border-white/10 rounded-xl px-4 py-2.5 text-[12px] text-white placeholder:text-gray-400 outline-none focus:border-orange-500/40 transition-colors"}),r.jsx("p",{className:"text-[10px] text-gray-400 px-1",children:"Leave blank to use the default http://localhost:11434"})]})]}):r.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-3 text-center px-8",children:[r.jsx("div",{className:"w-12 h-12 rounded-2xl bg-orange-500/8 border border-orange-500/15 flex items-center justify-center",children:r.jsx(We,{size:20,className:"text-orange-500/50"})}),r.jsx("p",{className:"text-[13px] text-gray-400",children:"Select a provider from the left to configure your API key"})]})})]})]})}function $E(e){if(!e)return"—";const t=Date.now()-e;return t<6e4?`${Math.floor(t/1e3)}s önce`:t<36e5?`${Math.floor(t/6e4)}dk önce`:`${Math.floor(t/36e5)}sa önce`}function UE(){const{online:e}=ba(),[t,n]=h.useState([]),[s,i]=h.useState(!0),[a,o]=h.useState("all"),l=async()=>{i(!0);try{const p=await(await $("/api/gateway/sessions?limit=50&includeDerivedTitles=true&includeLastMessage=true")).json(),f=Array.isArray(p)?p:Array.isArray(p==null?void 0:p.sessions)?p.sessions:[];n(f)}catch{n([])}finally{i(!1)}};h.useEffect(()=>{l()},[e]);const c=d=>!!d.runningAtMs&&Date.now()-d.runningAtMs<12e4,u=t.filter(d=>a==="running"?c(d):a==="idle"?!c(d):!0);return r.jsxs("div",{className:"flex-1 overflow-y-auto p-6 space-y-5",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:"w-8 h-8 rounded-xl bg-orange-500/15 border border-orange-500/25 flex items-center justify-center",children:r.jsx(We,{size:16,className:"text-orange-400"})}),r.jsxs("div",{children:[r.jsx("h1",{className:"text-xl font-bold text-white",children:"Aktif Oturumlar"}),r.jsxs("p",{className:"text-[11px] text-gray-500",children:[t.length," oturum"]})]})]}),r.jsxs("button",{onClick:l,disabled:s,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-xl bg-white/4 border border-white/8 text-[11px] text-gray-400 hover:text-white hover:border-white/16 transition-all disabled:opacity-40",children:[r.jsx(de,{size:12,className:s?"animate-spin":""}),"Yenile"]})]}),!e&&r.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5 rounded-xl bg-orange-500/8 border border-orange-500/20",children:[r.jsx(Ws,{size:13,className:"text-orange-400 flex-shrink-0"}),r.jsx("p",{className:"text-[12px] text-orange-300",children:"Gateway çevrimdışı — oturum verisi alınamıyor."})]}),r.jsx("div",{className:"flex gap-1.5",children:["all","running","idle"].map(d=>r.jsx("button",{onClick:()=>o(d),className:`px-3 py-1.5 rounded-xl text-[11px] font-semibold border transition-all ${a===d?"bg-orange-500/15 border-orange-500/30 text-orange-300":"bg-white/3 border-white/6 text-gray-500 hover:text-gray-300 hover:border-white/12"}`,children:d==="all"?"Tümü":d==="running"?"Çalışıyor":"Boşta"},d))}),s?r.jsx("div",{className:"flex items-center justify-center py-12",children:r.jsx(de,{size:18,className:"animate-spin text-orange-400"})}):u.length===0?r.jsxs("div",{className:"flex flex-col items-center justify-center py-16 gap-3",children:[r.jsx(Os,{size:32,className:"text-gray-700"}),r.jsx("p",{className:"text-sm text-gray-600",children:e?"Aktif oturum bulunamadı.":"Gateway çevrimdışı."})]}):r.jsx("div",{className:"space-y-2",children:u.map(d=>{const p=c(d);return r.jsx("div",{className:"px-4 py-3 rounded-xl bg-white/[0.025] border border-white/6 hover:border-white/10 transition-all",children:r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx("div",{className:"mt-0.5 flex-shrink-0",children:p?r.jsx("span",{className:"block w-2 h-2 rounded-full bg-orange-400 animate-pulse"}):r.jsx("span",{className:"block w-2 h-2 rounded-full bg-gray-700"})}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[r.jsx("p",{className:"text-[13px] font-semibold text-gray-200 truncate",children:d.derivedTitle??d.label??d.key.slice(0,20)+"…"}),d.agentId&&r.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-gray-600 flex-shrink-0",children:[r.jsx(fn,{size:9}),d.agentId]})]}),d.lastMessage&&r.jsx("p",{className:"text-[11px] text-gray-500 truncate mb-1",children:d.lastMessage}),r.jsxs("div",{className:"flex items-center gap-3",children:[d.messageCount!==void 0&&r.jsxs("span",{className:"text-[10px] text-gray-600",children:[d.messageCount," mesaj"]}),r.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-gray-600",children:[r.jsx(Pt,{size:9}),$E(d.lastActivityAt)]})]})]})]})},d.key)})})]})}function HE(e){if(!e||typeof e!="object")return String(e??"—");const t=e;return t.type==="every"&&t.intervalMs?`Her ${Math.round(t.intervalMs/6e4)} dakika`:t.type==="at"&&t.time?`Her gün ${t.time}`:t.type==="cron"&&t.expression?`Cron: ${t.expression}`:JSON.stringify(e).slice(0,40)}function WE(e){if(!e)return"—";const t=e-Date.now();return t<0?"Geçti":t<6e4?`${Math.floor(t/1e3)}s sonra`:t<36e5?`${Math.floor(t/6e4)}dk sonra`:`${Math.floor(t/36e5)}sa sonra`}function KE(){const{online:e}=ba(),[t,n]=h.useState([]),[s,i]=h.useState(!0),[a,o]=h.useState("all"),[l,c]=h.useState(null),[u,d]=h.useState(null),p=async()=>{i(!0);try{const x=await(await $("/api/gateway/automations?enabled=all&limit=50")).json();n(Array.isArray(x==null?void 0:x.jobs)?x.jobs:Array.isArray(x)?x:[])}catch{n([])}finally{i(!1)}};h.useEffect(()=>{p()},[e]);const f=async g=>{try{await $(`/api/gateway/automations/${g.id}`,{method:"PATCH",body:JSON.stringify({patch:{enabled:!g.enabled}})}),n(x=>x.map(w=>w.id===g.id?{...w,enabled:!w.enabled}:w))}catch{}},m=async g=>{c(g);try{await $(`/api/gateway/automations/${g}/run`,{method:"POST"}),await p()}catch{}finally{c(null)}},v=async g=>{if(window.confirm("Bu otomasyon silinsin mi?")){d(g);try{await $(`/api/gateway/automations/${g}`,{method:"DELETE"}),n(x=>x.filter(w=>w.id!==g))}catch{}finally{d(null)}}},y=t.filter(g=>a==="enabled"?g.enabled:a==="disabled"?!g.enabled:!0),b=g=>g==="ok"?r.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-green-400",children:[r.jsx(Ve,{size:9})," Başarılı"]}):g==="error"?r.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-red-400",children:[r.jsx(nv,{size:9})," Hata"]}):r.jsx("span",{className:"text-[10px] text-gray-600",children:"—"});return r.jsxs("div",{className:"flex-1 overflow-y-auto p-6 space-y-5",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:"w-8 h-8 rounded-xl bg-orange-500/15 border border-orange-500/25 flex items-center justify-center",children:r.jsx(ze,{size:16,className:"text-orange-400"})}),r.jsxs("div",{children:[r.jsx("h1",{className:"text-xl font-bold text-white",children:"Otomasyonlar"}),r.jsxs("p",{className:"text-[11px] text-gray-500",children:[t.length," zamanlanmış görev"]})]})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[!e&&r.jsxs("span",{className:"flex items-center gap-1.5 px-2.5 py-1 rounded-full text-[11px] bg-red-500/8 border border-red-500/20 text-red-400",children:[r.jsx(Ws,{size:10})," Çevrimdışı"]}),r.jsxs("button",{onClick:p,disabled:s,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-xl bg-white/4 border border-white/8 text-[11px] text-gray-400 hover:text-white hover:border-white/16 transition-all disabled:opacity-40",children:[r.jsx(de,{size:12,className:s?"animate-spin":""})," Yenile"]})]})]}),r.jsx("div",{className:"flex gap-1.5",children:["all","enabled","disabled"].map(g=>r.jsx("button",{onClick:()=>o(g),className:`px-3 py-1.5 rounded-xl text-[11px] font-semibold border transition-all ${a===g?"bg-orange-500/15 border-orange-500/30 text-orange-300":"bg-white/3 border-white/6 text-gray-500 hover:text-gray-300 hover:border-white/12"}`,children:g==="all"?"Tümü":g==="enabled"?"Aktif":"Pasif"},g))}),s?r.jsx("div",{className:"flex justify-center py-12",children:r.jsx(de,{size:18,className:"animate-spin text-orange-400"})}):y.length===0?r.jsxs("div",{className:"flex flex-col items-center justify-center py-16 gap-3",children:[r.jsx(ze,{size:32,className:"text-gray-700"}),r.jsx("p",{className:"text-sm text-gray-600",children:e?"Otomasyon bulunamadı.":"Gateway çevrimdışı."})]}):r.jsx("div",{className:"space-y-2",children:y.map(g=>{var x,w;return r.jsx("div",{className:`px-4 py-3 rounded-xl border transition-all ${g.enabled?"bg-white/[0.025] border-white/6":"bg-white/[0.01] border-white/4"}`,children:r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx("button",{onClick:()=>f(g),disabled:!e,className:"mt-0.5 text-gray-500 hover:text-orange-400 transition-colors disabled:opacity-40",title:g.enabled?"Devre dışı bırak":"Etkinleştir",children:g.enabled?r.jsx(IC,{size:18,className:"text-orange-400"}):r.jsx(DC,{size:18})}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[r.jsx("p",{className:`text-[13px] font-semibold truncate ${g.enabled?"text-gray-200":"text-gray-500"}`,children:g.name??g.id}),b((x=g.state)==null?void 0:x.lastRunStatus)]}),r.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[r.jsxs("span",{className:"flex items-center gap-1 text-[11px] text-gray-500",children:[r.jsx(Pt,{size:9})," ",HE(g.schedule)]}),((w=g.state)==null?void 0:w.nextRunAtMs)&&r.jsx("span",{className:"text-[11px] text-gray-600",children:WE(g.state.nextRunAtMs)})]})]}),r.jsxs("div",{className:"flex items-center gap-1.5 flex-shrink-0",children:[r.jsxs("button",{onClick:()=>m(g.id),disabled:!e||l===g.id,className:"flex items-center gap-1 px-2 py-1 rounded-lg bg-orange-500/8 border border-orange-500/20 text-orange-400 text-[10px] font-semibold hover:bg-orange-500/15 transition-all disabled:opacity-40",children:[l===g.id?r.jsx(de,{size:9,className:"animate-spin"}):r.jsx(Us,{size:9}),"Çalıştır"]}),r.jsxs("button",{onClick:()=>v(g.id),disabled:!e||u===g.id,className:"flex items-center gap-1 px-2 py-1 rounded-lg bg-red-500/8 border border-red-500/20 text-red-400 text-[10px] font-semibold hover:bg-red-500/15 transition-all disabled:opacity-40",children:[u===g.id?r.jsx(de,{size:9,className:"animate-spin"}):r.jsx(Hs,{size:9}),"Sil"]})]})]})},g.id)})})]})}function GE(e){var t;return(t=e.presence)!=null&&t.ts?Date.now()-e.presence.ts<6e4:!1}function qE({platform:e}){const t=(e??"").toLowerCase();return t.includes("ios")||t.includes("iphone")?r.jsx(l0,{size:14,className:"text-gray-400"}):t.includes("android")?r.jsx(l0,{size:14,className:"text-green-500"}):t.includes("mac")||t.includes("darwin")?r.jsx(Z1,{size:14,className:"text-gray-300"}):t.includes("win")?r.jsx(sf,{size:14,className:"text-blue-400"}):r.jsx(yC,{size:14,className:"text-gray-500"})}function YE(){const{online:e}=ba(),[t,n]=h.useState([]),[s,i]=h.useState(!0),[a,o]=h.useState(null),[l,c]=h.useState(""),u=async()=>{i(!0);try{const f=await(await $("/api/gateway/clients")).json();n(Array.isArray(f==null?void 0:f.nodes)?f.nodes:Array.isArray(f)?f:[])}catch{n([])}finally{i(!1)}};h.useEffect(()=>{u()},[e]);const d=async p=>{if(!l.trim()){o(null);return}try{await $(`/api/gateway/clients/${p}/rename`,{method:"POST",body:JSON.stringify({displayName:l.trim()})}),n(f=>f.map(m=>m.nodeId===p?{...m,displayName:l.trim()}:m))}catch{}finally{o(null)}};return r.jsxs("div",{className:"flex-1 overflow-y-auto p-6 space-y-5",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:"w-8 h-8 rounded-xl bg-orange-500/15 border border-orange-500/25 flex items-center justify-center",children:r.jsx(ud,{size:16,className:"text-orange-400"})}),r.jsxs("div",{children:[r.jsx("h1",{className:"text-xl font-bold text-white",children:"Bağlı Nodlar"}),r.jsxs("p",{className:"text-[11px] text-gray-500",children:[t.length," cihaz"]})]})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[!e&&r.jsxs("span",{className:"flex items-center gap-1.5 px-2.5 py-1 rounded-full text-[11px] bg-red-500/8 border border-red-500/20 text-red-400",children:[r.jsx(Ws,{size:10})," Çevrimdışı"]}),r.jsxs("button",{onClick:u,disabled:s,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-xl bg-white/4 border border-white/8 text-[11px] text-gray-400 hover:text-white hover:border-white/16 transition-all disabled:opacity-40",children:[r.jsx(de,{size:12,className:s?"animate-spin":""})," Yenile"]})]})]}),s?r.jsx("div",{className:"flex justify-center py-12",children:r.jsx(de,{size:18,className:"animate-spin text-orange-400"})}):t.length===0?r.jsxs("div",{className:"flex flex-col items-center justify-center py-16 gap-3",children:[r.jsx(ud,{size:32,className:"text-gray-700"}),r.jsx("p",{className:"text-sm text-gray-600",children:e?"Bağlı node yok.":"Gateway çevrimdışı."})]}):r.jsx("div",{className:"grid grid-cols-2 gap-3",children:t.map(p=>r.jsxs("div",{className:"px-4 py-3 rounded-xl bg-white/[0.025] border border-white/6 hover:border-white/10 transition-all",children:[r.jsxs("div",{className:"flex items-start gap-2 mb-2",children:[r.jsx(qE,{platform:p.platform}),r.jsx("div",{className:"flex-1 min-w-0",children:a===p.nodeId?r.jsx("input",{autoFocus:!0,value:l,onChange:f=>c(f.target.value),onBlur:()=>d(p.nodeId),onKeyDown:f=>{f.key==="Enter"&&d(p.nodeId),f.key==="Escape"&&o(null)},className:"w-full bg-white/6 border border-orange-500/30 rounded-lg px-2 py-0.5 text-[13px] text-white outline-none"}):r.jsx("p",{className:"text-[13px] font-semibold text-gray-200 truncate cursor-text",onDoubleClick:()=>{o(p.nodeId),c(p.displayName??"")},title:"Çift tıklayarak düzenle",children:p.displayName??p.nodeId})}),r.jsx("span",{className:`flex-shrink-0 w-2 h-2 rounded-full mt-1 ${GE(p)?"bg-green-400 animate-pulse":"bg-gray-700"}`})]}),r.jsxs("div",{className:"space-y-1",children:[p.platform&&r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"text-[10px] text-gray-600 w-16",children:"Platform"}),r.jsx("span",{className:"text-[11px] text-gray-400",children:p.platform})]}),p.version&&r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"text-[10px] text-gray-600 w-16",children:"Versiyon"}),r.jsx("span",{className:"text-[11px] text-gray-400",children:p.version})]}),(p.caps??[]).length>0&&r.jsxs("div",{className:"flex items-center gap-1 flex-wrap mt-1",children:[(p.caps??[]).slice(0,3).map(f=>r.jsx("span",{className:"px-1.5 py-0.5 rounded-md bg-orange-500/8 border border-orange-500/15 text-[9px] text-orange-400 font-medium",children:f},f)),(p.caps??[]).length>3&&r.jsxs("span",{className:"text-[9px] text-gray-600",children:["+",(p.caps??[]).length-3]})]})]})]},p.nodeId))})]})}function XE({online:e}){var u;const[t,n]=h.useState({}),[s,i]=h.useState(!0),a=h.useRef(0),o=h.useRef(null),l=async(d=0)=>{try{const f=await(await $(`/api/gateway/logs?cursor=${d}&limit=200`)).json();d===0?(n(f),a.current=f.cursor??0):(n(m=>({...f,lines:[...m.lines??[],...f.lines??[]]})),a.current=f.cursor??a.current)}catch{}finally{i(!1)}};h.useEffect(()=>{l(0)},[e]),h.useEffect(()=>{const d=setInterval(()=>l(a.current),1e4);return()=>clearInterval(d)},[e]),h.useEffect(()=>{o.current&&(o.current.scrollTop=o.current.scrollHeight)},[(u=t.lines)==null?void 0:u.length]);const c=d=>d.includes("error")||d.includes("ERROR")?"text-red-400":d.includes("warn")||d.includes("WARN")?"text-amber-400":d.includes("info")||d.includes("INFO")?"text-green-400":"text-gray-400";return r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("p",{className:"text-[11px] text-gray-600",children:[(t.lines??[]).length," satır"]}),r.jsxs("div",{className:"flex gap-2",children:[r.jsxs("button",{onClick:()=>navigator.clipboard.writeText((t.lines??[]).join(`
728
+ `)),className:"flex items-center gap-1 px-2.5 py-1 rounded-lg bg-white/4 border border-white/8 text-[10px] text-gray-400 hover:text-white transition-all",children:[r.jsx(aa,{size:10})," Kopyala"]}),r.jsxs("button",{onClick:()=>{a.current=0,l(0)},className:"flex items-center gap-1 px-2.5 py-1 rounded-lg bg-white/4 border border-white/8 text-[10px] text-gray-400 hover:text-white transition-all",children:[r.jsx(de,{size:10})," Sıfırla"]})]})]}),r.jsx("div",{ref:o,className:"h-96 overflow-y-auto rounded-xl bg-black/40 border border-white/6 p-3 font-mono text-[11px] space-y-0.5",children:s?r.jsx("p",{className:"text-gray-600",children:"Yükleniyor…"}):!e||t.offline?r.jsx("p",{className:"text-orange-500",children:"Gateway çevrimdışı — log verisi alınamıyor."}):(t.lines??[]).length===0?r.jsx("p",{className:"text-gray-600",children:"Henüz log yok."}):(t.lines??[]).map((d,p)=>r.jsx("p",{className:`whitespace-pre-wrap break-all leading-5 ${c(d)}`,children:d},p))})]})}function QE({online:e}){var l,c;const[t,n]=h.useState({}),[s,i]=h.useState(!0);h.useEffect(()=>{i(!0),$("/api/gateway/usage/cost").then(u=>u.json()).then(n).catch(()=>n({})).finally(()=>i(!1))},[e]);const a=t.daily??[],o=Math.max(1,...a.map(u=>u.tokens??0));return r.jsxs("div",{className:"space-y-4",children:[(!e||t.offline)&&r.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 rounded-xl bg-orange-500/8 border border-orange-500/20",children:[r.jsx(Ws,{size:12,className:"text-orange-400"}),r.jsx("p",{className:"text-[11px] text-orange-300",children:"Gateway çevrimdışı."})]}),r.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[r.jsxs("div",{className:"px-4 py-3 rounded-xl bg-white/[0.025] border border-white/6",children:[r.jsx("p",{className:"text-[10px] text-gray-600 mb-1 uppercase tracking-widest",children:"Toplam Token"}),r.jsx("p",{className:"text-xl font-bold text-white",children:s?"—":(((l=t.total)==null?void 0:l.tokens)??0).toLocaleString()})]}),r.jsxs("div",{className:"px-4 py-3 rounded-xl bg-white/[0.025] border border-white/6",children:[r.jsxs("p",{className:"text-[10px] text-gray-600 mb-1 uppercase tracking-widest flex items-center gap-1",children:[r.jsx(oC,{size:8})," Tahmini Maliyet"]}),r.jsx("p",{className:"text-xl font-bold text-orange-400",children:s?"—":`$${(((c=t.total)==null?void 0:c.cost)??0).toFixed(4)}`})]})]}),(t.providers??[]).length>0&&r.jsxs("div",{className:"rounded-xl bg-white/[0.02] border border-white/6 overflow-hidden",children:[r.jsxs("div",{className:"grid grid-cols-4 px-4 py-2 border-b border-white/6 text-[10px] font-bold text-gray-600 uppercase tracking-widest",children:[r.jsx("span",{children:"Provider"}),r.jsx("span",{className:"text-right",children:"Giriş"}),r.jsx("span",{className:"text-right",children:"Çıkış"}),r.jsx("span",{className:"text-right",children:"Maliyet"})]}),(t.providers??[]).map((u,d)=>r.jsxs("div",{className:"grid grid-cols-4 px-4 py-2 border-b border-white/4 last:border-0 text-[12px]",children:[r.jsx("span",{className:"text-gray-300 font-medium truncate",children:u.provider}),r.jsx("span",{className:"text-right text-gray-500",children:(u.inputTokens??0).toLocaleString()}),r.jsx("span",{className:"text-right text-gray-500",children:(u.outputTokens??0).toLocaleString()}),r.jsxs("span",{className:"text-right text-orange-400",children:["$",(u.cost??0).toFixed(4)]})]},d))]}),a.length>0&&r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("p",{className:"text-[10px] text-gray-600 uppercase tracking-widest",children:"Günlük Kullanım"}),r.jsx("div",{className:"flex items-end gap-1 h-16 px-1",children:a.slice(-14).map((u,d)=>{var f;const p=Math.max(2,Math.round((u.tokens??0)/o*56));return r.jsxs("div",{className:"flex-1 flex flex-col items-center gap-0.5",children:[r.jsx("div",{style:{height:p},className:"w-full rounded-sm bg-orange-500/40 hover:bg-orange-500/60 transition-all",title:`${u.date}: ${(u.tokens??0).toLocaleString()} token`}),r.jsx("span",{className:"text-[8px] text-gray-700 truncate w-full text-center",children:(f=u.date)==null?void 0:f.slice(5)})]},d)})})]})]})}function JE({online:e}){const[t,n]=h.useState([]),[s,i]=h.useState(!0);return h.useEffect(()=>{i(!0),$("/api/gateway/sessions/usage?limit=30").then(a=>a.json()).then(a=>n(Array.isArray(a)?a:(a==null?void 0:a.sessions)??[])).catch(()=>n([])).finally(()=>i(!1))},[e]),r.jsxs("div",{className:"rounded-xl bg-white/[0.02] border border-white/6 overflow-hidden",children:[r.jsxs("div",{className:"grid grid-cols-4 px-4 py-2 border-b border-white/6 text-[10px] font-bold text-gray-600 uppercase tracking-widest",children:[r.jsx("span",{className:"col-span-2",children:"Oturum"}),r.jsx("span",{className:"text-right",children:"Token"}),r.jsx("span",{className:"text-right",children:"Maliyet"})]}),s?r.jsx("div",{className:"flex justify-center py-6",children:r.jsx(de,{size:14,className:"animate-spin text-orange-400"})}):t.length===0?r.jsx("p",{className:"text-center text-sm text-gray-600 py-6",children:e?"Oturum bulunamadı.":"Gateway çevrimdışı."}):t.map((a,o)=>{var l;return r.jsxs("div",{className:"grid grid-cols-4 px-4 py-2 border-b border-white/4 last:border-0 text-[12px]",children:[r.jsx("span",{className:"col-span-2 text-gray-300 truncate font-mono text-[10px]",children:((l=a.key)==null?void 0:l.slice(0,28))??"—"}),r.jsx("span",{className:"text-right text-gray-500",children:(a.tokens??0).toLocaleString()}),r.jsxs("span",{className:"text-right text-orange-400",children:["$",(a.cost??0).toFixed(4)]})]},o)})]})}function ZE(){const{online:e}=ba(),[t,n]=h.useState("logs");return r.jsxs("div",{className:"flex-1 overflow-y-auto p-6 space-y-5",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:"w-8 h-8 rounded-xl bg-orange-500/15 border border-orange-500/25 flex items-center justify-center",children:r.jsx(iC,{size:16,className:"text-orange-400"})}),r.jsxs("div",{children:[r.jsx("h1",{className:"text-xl font-bold text-white",children:"Loglar & Aktivite"}),r.jsx("p",{className:"text-[11px] text-gray-500",children:"Must-b gateway log, kullanım ve oturum istatistikleri"})]}),!e&&r.jsxs("span",{className:"ml-auto flex items-center gap-1.5 px-2.5 py-1 rounded-full text-[11px] bg-red-500/8 border border-red-500/20 text-red-400",children:[r.jsx(Ws,{size:10})," Çevrimdışı"]})]}),r.jsx("div",{className:"flex gap-1.5",children:["logs","usage","sessions"].map(s=>r.jsx("button",{onClick:()=>n(s),className:`px-3 py-1.5 rounded-xl text-[11px] font-semibold border transition-all ${t===s?"bg-orange-500/15 border-orange-500/30 text-orange-300":"bg-white/3 border-white/6 text-gray-500 hover:text-gray-300 hover:border-white/12"}`,children:s==="logs"?"Loglar":s==="usage"?"Kullanım":"Oturumlar"},s))}),t==="logs"&&r.jsx(XE,{online:e}),t==="usage"&&r.jsx(QE,{online:e}),t==="sessions"&&r.jsx(JE,{online:e})]})}function e_(){const[e,t]=h.useState([]),[n,s]=h.useState(!0),[i,a]=h.useState("all"),[o,l]=h.useState(new Set);h.useEffect(()=>{s(!0),$("/api/tools").then(d=>d.json()).then(d=>{const p=Array.isArray(d==null?void 0:d.groups)?d.groups:[];t(p),l(new Set(p.slice(0,3).map(f=>f.id)))}).catch(()=>t([])).finally(()=>s(!1))},[]);const c=e.map(d=>({...d,tools:(d.tools??[]).filter(p=>i==="core"?p.source!=="plugin":i==="plugin"?p.source==="plugin":!0)})).filter(d=>d.tools.length>0),u=d=>{l(p=>{const f=new Set(p);return f.has(d)?f.delete(d):f.add(d),f})};return r.jsxs("div",{className:"space-y-3",children:[r.jsx("div",{className:"flex gap-1.5",children:["all","core","plugin"].map(d=>r.jsx("button",{onClick:()=>a(d),className:`px-3 py-1.5 rounded-xl text-[11px] font-semibold border transition-all ${i===d?"bg-orange-500/15 border-orange-500/30 text-orange-300":"bg-white/3 border-white/6 text-gray-500 hover:text-gray-300 hover:border-white/12"}`,children:d==="all"?"All":d==="core"?"Core":"Plugin"},d))}),n?r.jsx("div",{className:"flex justify-center py-10",children:r.jsx(de,{size:18,className:"animate-spin text-orange-400"})}):c.length===0?r.jsx("p",{className:"text-center text-sm text-gray-600 py-8",children:"No tools found."}):r.jsx("div",{className:"space-y-2",children:c.map(d=>{var p;return r.jsxs("div",{className:"rounded-xl bg-white/[0.02] border border-white/6 overflow-hidden",children:[r.jsxs("button",{onClick:()=>u(d.id),className:"w-full flex items-center justify-between px-4 py-2.5 hover:bg-white/3 transition-colors",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(lf,{size:12,className:"text-orange-400"}),r.jsx("span",{className:"text-[12px] font-semibold text-gray-300",children:d.label??d.id}),r.jsxs("span",{className:"text-[10px] text-gray-600",children:[((p=d.tools)==null?void 0:p.length)??0," tools"]})]}),o.has(d.id)?r.jsx(Gr,{size:12,className:"text-gray-600"}):r.jsx(dn,{size:12,className:"text-gray-600"})]}),o.has(d.id)&&r.jsx("div",{className:"border-t border-white/5 divide-y divide-white/4",children:(d.tools??[]).map((f,m)=>r.jsxs("div",{className:"px-4 py-2 flex items-start justify-between gap-3",children:[r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("p",{className:"text-[12px] font-semibold text-gray-300",children:f.label??f.name}),f.description&&r.jsx("p",{className:"text-[11px] text-gray-600 line-clamp-1",children:f.description})]}),r.jsx("div",{className:"flex items-center gap-1 flex-shrink-0",children:r.jsx("span",{className:`text-[9px] font-bold px-1.5 py-0.5 rounded-md border ${f.source==="plugin"?"bg-blue-500/8 border-blue-500/20 text-blue-400":"bg-orange-500/8 border-orange-500/20 text-orange-400"}`,children:f.source==="plugin"?"plugin":"core"})})]},m))})]},d.id)})})]})}function t_(){const[e,t]=h.useState([]),[n,s]=h.useState(!0);return h.useEffect(()=>{s(!0),$("/api/agents").then(i=>i.json()).then(i=>t(Array.isArray(i==null?void 0:i.agents)?i.agents:[])).catch(()=>t([])).finally(()=>s(!1))},[]),n?r.jsx("div",{className:"flex justify-center py-10",children:r.jsx(de,{size:18,className:"animate-spin text-orange-400"})}):e.length===0?r.jsx("p",{className:"text-center text-sm text-gray-600 py-8",children:"No agents found."}):r.jsx("div",{className:"grid grid-cols-2 gap-3",children:e.map(i=>r.jsxs("div",{className:"px-4 py-3 rounded-xl bg-white/[0.025] border border-white/6",children:[r.jsxs("div",{className:"flex items-center gap-2 mb-1.5",children:[r.jsx("span",{className:"text-xl",children:i.emoji??"🤖"}),r.jsx("div",{className:"flex-1 min-w-0",children:r.jsx("p",{className:"text-[13px] font-semibold text-gray-200 truncate",children:i.name??i.id})}),i.isDefault&&r.jsx("span",{className:"text-[9px] font-bold px-1.5 py-0.5 rounded-md bg-orange-500/12 border border-orange-500/25 text-orange-400",children:"Default"})]}),i.description&&r.jsx("p",{className:"text-[11px] text-gray-500 line-clamp-2",children:i.description})]},i.id))})}function n_(){const[e,t]=h.useState("tools");return r.jsxs("div",{className:"flex-1 overflow-y-auto p-6 space-y-5",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:"w-8 h-8 rounded-xl bg-orange-500/15 border border-orange-500/25 flex items-center justify-center",children:r.jsx($s,{size:16,className:"text-orange-400"})}),r.jsxs("div",{children:[r.jsx("h1",{className:"text-xl font-bold text-white",children:"Skills & Plugins"}),r.jsx("p",{className:"text-[11px] text-gray-500",children:"Must-b tool catalog and agent management"})]})]}),r.jsx("div",{className:"flex gap-1.5",children:["tools","agents"].map(n=>r.jsxs("button",{onClick:()=>t(n),className:`flex items-center gap-1.5 px-3 py-1.5 rounded-xl text-[11px] font-semibold border transition-all ${e===n?"bg-orange-500/15 border-orange-500/30 text-orange-300":"bg-white/3 border-white/6 text-gray-500 hover:text-gray-300 hover:border-white/12"}`,children:[n==="tools"?r.jsx(lf,{size:11}):r.jsx(ia,{size:11}),n==="tools"?"Tools":"Agents"]},n))}),e==="tools"&&r.jsx(e_,{}),e==="agents"&&r.jsx(t_,{})]})}const P0=[{key:"all",label:"Tümü",icon:va,test:()=>!0},{key:"nightowl",label:"NightOwl Bulguları",icon:Rl,test:e=>e.tags.some(t=>/nightshift|nightowl/i.test(t))},{key:"preferences",label:"Kullanıcı Tercihleri",icon:gv,test:e=>e.category==="semantic"&&!e.tags.some(t=>/project|workspace|nightshift|nightowl/i.test(t))},{key:"architecture",label:"Proje Mimarisi",icon:ov,test:e=>e.tags.some(t=>/project|workspace|context|summary/i.test(t))},{key:"episodic",label:"Episodik",icon:Pt,test:e=>e.category==="episodic"},{key:"semantic",label:"Semantik",icon:Yt,test:e=>e.category==="semantic"}],s_={episodic:{border:"rgba(249,115,22,0.30)",bg:"rgba(249,115,22,0.08)",dot:"#f97316",label:"Episodik"},semantic:{border:"rgba(99,102,241,0.30)",bg:"rgba(99,102,241,0.08)",dot:"#6366f1",label:"Semantik"}};function r_(e){const n=(Date.now()-new Date(e+"Z").getTime())/1e3,s=n/60,i=s/60,a=i/24;return n<60?{label:"az önce",tier:"fresh"}:s<60?{label:`${Math.floor(s)}d önce`,tier:"fresh"}:i<24?{label:`${Math.floor(i)}s önce`,tier:"recent"}:a<7?{label:`${Math.floor(a)}g önce`,tier:"recent"}:a<30?{label:`${Math.floor(a/7)}h önce`,tier:"old"}:{label:`${Math.floor(a/30)}ay önce`,tier:"ancient"}}const i_={fresh:"#34d399",recent:"#f97316",old:"#a78bfa",ancient:"#6b7280"};function A0(e,t){return t.trim()?e.split(new RegExp(`(${t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")})`,"gi")).map((s,i)=>s.toLowerCase()===t.toLowerCase()?r.jsx("mark",{className:"bg-orange-500/30 text-orange-300 rounded px-0.5",children:s},i):s):e}function a_({entry:e,query:t,index:n,onDelete:s}){const[i,a]=h.useState(!1),[o,l]=h.useState(!1),c=r_(e.createdAt),u=s_[e.category],d=e.content.slice(0,180),p=e.content.length>180,f=async m=>{m.stopPropagation(),l(!0);try{(await $(`/api/memory/ltm/delete/${e.id}`,{method:"DELETE"})).ok?(s(e.id),le.success("Kayıt silindi.")):le.error("Silinemedi.")}catch{le.error("Bağlantı hatası.")}l(!1)};return r.jsxs(H.div,{layout:!0,initial:{opacity:0,y:16},animate:{opacity:1,y:0},exit:{opacity:0,y:-8,scale:.97},transition:{delay:Math.min(n*.03,.3),duration:.25},className:"rounded-2xl overflow-hidden cursor-pointer group",style:{background:"rgba(10,4,1,0.78)",border:`1px solid ${u.border}`,backdropFilter:"blur(20px)",boxShadow:`0 4px 24px rgba(0,0,0,0.45), 0 0 0 1px ${u.bg}, inset 0 1px 0 rgba(255,255,255,0.03)`},onClick:()=>a(m=>!m),children:[r.jsxs("div",{className:"flex items-start gap-3 px-4 pt-3.5 pb-2.5",style:{borderBottom:`1px solid ${u.bg}`},children:[r.jsx("span",{className:"mt-0.5 w-2 h-2 rounded-full flex-shrink-0",style:{background:u.dot,boxShadow:`0 0 6px ${u.dot}`}}),r.jsx("div",{className:"flex-1 min-w-0",children:r.jsx("p",{className:"text-[13px] text-white/80 leading-relaxed break-words",children:A0(i?e.content:d+(p?"…":""),t)})}),p&&r.jsx(H.span,{animate:{rotate:i?90:0},transition:{duration:.18},className:"flex-shrink-0 text-white/20",children:r.jsx(dn,{size:14})}),r.jsx("button",{onClick:f,disabled:o,className:"flex-shrink-0 p-1 rounded-lg opacity-0 group-hover:opacity-100 text-white/25 hover:text-red-400 hover:bg-red-500/12 transition-all disabled:opacity-30",title:"Bu kaydı sil",children:r.jsx(Hs,{size:13})})]}),r.jsxs("div",{className:"flex items-center gap-3 px-4 py-2 flex-wrap",children:[r.jsx("span",{className:"text-[10px] font-semibold tracking-widest uppercase px-2 py-0.5 rounded-full",style:{color:u.dot,background:u.bg,border:`1px solid ${u.border}`},children:u.label}),e.tags.slice(0,3).map(m=>r.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-white/35 px-1.5 py-0.5 rounded-md",style:{background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.08)"},children:[r.jsx(mv,{size:8,className:"opacity-60"}),m]},m)),r.jsx("span",{className:"flex-1"}),r.jsxs("span",{className:"flex items-center gap-1 text-[10px] font-medium",style:{color:i_[c.tier]},title:e.createdAt,children:[r.jsx(Pt,{size:9}),c.label]})]})]})}function o_({entries:e}){const t=e.filter(a=>a.category==="episodic").length,n=e.filter(a=>a.category==="semantic").length,s=e.filter(a=>a.tags.some(o=>/nightshift|nightowl/i.test(o))).length,i=[{label:`${e.length} toplam`,color:"#f97316"},{label:`${t} episodik`,color:"#f97316"},{label:`${n} semantik`,color:"#6366f1"},{label:`${s} NightOwl`,color:"#a78bfa"}];return r.jsx("div",{className:"flex items-center gap-3 flex-wrap",children:i.map(a=>r.jsx("span",{className:"text-[11px] font-semibold px-2.5 py-1 rounded-full",style:{color:a.color,background:`${a.color}14`,border:`1px solid ${a.color}30`},children:a.label},a.label))})}function l_({onConfirm:e,onCancel:t}){return r.jsx("div",{className:"fixed inset-0 z-[100] flex items-center justify-center bg-black/70 p-4",children:r.jsxs(H.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},transition:{duration:.15},className:"rounded-2xl p-6 w-full max-w-sm shadow-2xl",style:{background:"rgba(18,8,2,0.97)",border:"1px solid rgba(249,115,22,0.25)"},children:[r.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[r.jsx("div",{className:"w-10 h-10 rounded-xl flex items-center justify-center shrink-0",style:{background:"rgba(239,68,68,0.12)",border:"1px solid rgba(239,68,68,0.25)"},children:r.jsx(os,{size:18,className:"text-red-400"})}),r.jsxs("div",{children:[r.jsx("h3",{className:"text-[15px] font-bold text-white/90",children:"Tüm Hafızayı Temizle"}),r.jsx("p",{className:"text-[11px] text-white/35",children:"Bu işlem geri alınamaz"})]}),r.jsx("button",{onClick:t,className:"ml-auto p-1.5 rounded-lg text-white/30 hover:text-white/60 hover:bg-white/6 transition-all",children:r.jsx(et,{size:15})})]}),r.jsx("p",{className:"text-[13px] text-white/50 mb-5 leading-relaxed",children:"Tüm episodik ve semantik hafıza kayıtları kalıcı olarak silinecek. Bu işlem geri alınamaz."}),r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("button",{onClick:t,className:"flex-1 px-4 py-2.5 rounded-xl bg-white/8 hover:bg-white/12 text-white/70 text-[13px] font-medium transition-colors",children:"İptal"}),r.jsx("button",{onClick:e,className:"flex-1 px-4 py-2.5 rounded-xl bg-red-600/80 hover:bg-red-600 text-white text-[13px] font-semibold transition-colors border border-red-500/30",children:"Tümünü Sil"})]})]})})}function c_(){const[e,t]=h.useState([]),[n,s]=h.useState(!0),[i,a]=h.useState(""),[o,l]=h.useState("all"),[c,u]=h.useState(!1),[d,p]=h.useState(!1),f=h.useCallback(async()=>{s(!0);try{const b=await $("/api/memory/ltm/explore?category=all&limit=200");if(b.ok){const g=await b.json();t(g.entries??[])}}catch{}s(!1)},[]);h.useEffect(()=>{f()},[f]);const m=b=>{t(g=>g.filter(x=>x.id!==b))},v=async()=>{p(!0);try{const b=await $("/api/memory/ltm/clear-all",{method:"DELETE"});if(b.ok){const g=await b.json();t([]),le.success(`${g.deleted??0} kayıt temizlendi.`)}else le.error("Temizleme başarısız.")}catch{le.error("Bağlantı hatası.")}p(!1),u(!1)},y=h.useMemo(()=>{var x;const b=((x=P0.find(w=>w.key===o))==null?void 0:x.test)??(()=>!0),g=i.trim().toLowerCase();return e.filter(b).filter(w=>!g||w.content.toLowerCase().includes(g)||w.tags.some(j=>j.includes(g)))},[e,o,i]);return r.jsxs("div",{className:"h-[calc(100vh-72px)] overflow-y-auto px-6 py-6 space-y-6",children:[r.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-4",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("span",{className:"w-9 h-9 rounded-xl flex items-center justify-center flex-shrink-0",style:{background:"rgba(249,115,22,0.12)",border:"1px solid rgba(249,115,22,0.28)",boxShadow:"0 0 16px rgba(249,115,22,0.12)"},children:r.jsx(Yt,{size:18,className:"text-orange-400"})}),r.jsxs("div",{children:[r.jsx("h1",{className:"text-[15px] font-bold text-white/90 tracking-tight",children:"Hafıza Tüneli"}),r.jsx("p",{className:"text-[11px] text-white/35",children:"Long-Term Memory Explorer — semantik & episodik"})]})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsxs("button",{onClick:()=>u(!0),disabled:d||e.length===0,className:"flex items-center gap-1.5 text-[11px] font-semibold px-3 py-1.5 rounded-lg transition-all border border-red-500/20 text-red-400/70 hover:text-red-400 hover:bg-red-500/10 disabled:opacity-30 disabled:cursor-not-allowed",style:{background:"rgba(239,68,68,0.04)"},children:[r.jsx(Hs,{size:11}),"Tüm Hafızayı Temizle"]}),r.jsxs("button",{onClick:()=>void f(),disabled:n,className:"flex items-center gap-1.5 text-[11px] text-white/40 hover:text-white/70 transition-colors px-3 py-1.5 rounded-lg",style:{border:"1px solid rgba(255,255,255,0.08)",background:"rgba(255,255,255,0.03)"},children:[r.jsx(de,{size:11,className:n?"animate-spin":""}),"Yenile"]})]})]}),!n&&r.jsx(o_,{entries:e}),r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{className:"flex items-center gap-2 rounded-xl px-3 py-2.5",style:{background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.10)",backdropFilter:"blur(12px)"},children:[r.jsx(Xt,{size:13,className:"text-white/30 flex-shrink-0"}),r.jsx("input",{type:"text",value:i,onChange:b=>a(b.target.value),placeholder:"Hafızada ara…",className:"flex-1 bg-transparent text-[13px] text-white/80 placeholder:text-white/25 outline-none"}),i&&r.jsx("button",{onClick:()=>a(""),className:"text-white/25 hover:text-white/60 text-xs",children:"✕"})]}),r.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[r.jsx(cC,{size:11,className:"text-white/25"}),P0.map(b=>{const g=b.icon,x=o===b.key,w=e.filter(b.test).length;return r.jsxs("button",{onClick:()=>l(b.key),className:"flex items-center gap-1.5 text-[11px] font-medium px-2.5 py-1 rounded-full transition-all",style:{background:x?"rgba(249,115,22,0.16)":"rgba(255,255,255,0.04)",border:x?"1px solid rgba(249,115,22,0.40)":"1px solid rgba(255,255,255,0.08)",color:x?"#fb923c":"rgba(255,255,255,0.45)"},children:[r.jsx(g,{size:10}),b.label,r.jsxs("span",{style:{opacity:.6},children:["(",w,")"]})]},b.key)})]})]}),n?r.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 py-24",children:[r.jsx(H.div,{animate:{rotate:360},transition:{repeat:1/0,duration:1.5,ease:"linear"},children:r.jsx(Yt,{size:28,className:"text-orange-500/50"})}),r.jsx("p",{className:"text-[12px] text-white/30",children:"Hafıza taranıyor…"})]}):y.length===0?r.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 py-24",children:[r.jsx(Ll,{size:28,className:"text-white/15"}),r.jsx("p",{className:"text-[13px] text-white/30",children:e.length===0?"Henüz hafıza yok. İlk konuşmadan sonra dolmaya başlar.":"Filtrene uyan kayıt yok."})]}):r.jsxs("div",{className:"space-y-3 pb-8",children:[r.jsxs("p",{className:"text-[11px] text-white/25",children:[y.length," kayıt gösteriliyor",i&&r.jsxs(r.Fragment,{children:[" · ",r.jsxs("span",{className:"text-orange-400/60",children:['"',i,'"']})," araması"]})]}),r.jsx(se,{mode:"popLayout",children:y.map((b,g)=>r.jsx(a_,{entry:b,query:i,index:g,onDelete:m},b.id))})]}),r.jsx(se,{children:c&&r.jsx(l_,{onConfirm:v,onCancel:()=>u(!1)})})]})}const Xa=`# Must-b Zihni
729
729
  Burada senin hakkında öğrendiğim bilgiler yer alır.
730
730
 
731
731
  ## Genel Bilgiler
@@ -736,18 +736,18 @@ Burada senin hakkında öğrendiğim bilgiler yer alır.
736
736
 
737
737
  ## Kullanıcı Stili
738
738
  <!-- Sana özgü iletişim ve çalışma tarzı notları. -->
739
- `,u_=["meslek","profession","user style","kullanıcı stili","expertise","uzmanlık","role","rol"];function nr(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function A0(e){const t=e.toLowerCase();return u_.some(n=>t.includes(n))}function d_(e){const t=e.split(`
740
- `),n=[];let s=!1,i=[],a=!1;const o=()=>{a&&(n.push("</ul>"),a=!1)};for(let l=0;l<t.length;l++){const c=t[l];if(c.startsWith("```")){s?(o(),n.push(`<pre class="bg-white/5 border border-white/10 rounded-lg p-3 my-2 text-[12px] text-orange-200/80 font-mono overflow-x-auto"><code>${nr(i.join(`
741
- `))}</code></pre>`),i=[],s=!1):(o(),s=!0);continue}if(s){i.push(c);continue}const u=c.match(/^### (.+)$/);if(u){o();const m=nr(u[1]),b=A0(u[1]);n.push(`<h3 class="text-[13px] font-bold text-white/70 mt-4 mb-1.5 flex items-center gap-2">
739
+ `,u_=["meslek","profession","user style","kullanıcı stili","expertise","uzmanlık","role","rol"];function sr(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function M0(e){const t=e.toLowerCase();return u_.some(n=>t.includes(n))}function d_(e){const t=e.split(`
740
+ `),n=[];let s=!1,i=[],a=!1;const o=()=>{a&&(n.push("</ul>"),a=!1)};for(let l=0;l<t.length;l++){const c=t[l];if(c.startsWith("```")){s?(o(),n.push(`<pre class="bg-white/5 border border-white/10 rounded-lg p-3 my-2 text-[12px] text-orange-200/80 font-mono overflow-x-auto"><code>${sr(i.join(`
741
+ `))}</code></pre>`),i=[],s=!1):(o(),s=!0);continue}if(s){i.push(c);continue}const u=c.match(/^### (.+)$/);if(u){o();const m=sr(u[1]),v=M0(u[1]);n.push(`<h3 class="text-[13px] font-bold text-white/70 mt-4 mb-1.5 flex items-center gap-2">
742
742
  ${m}
743
- ${b?'<span class="cognitive-tag">Cognitive</span>':""}
744
- </h3>`);continue}const d=c.match(/^## (.+)$/);if(d){o();const m=nr(d[1]),b=A0(d[1]);n.push(`<h2 class="text-[15px] font-bold text-orange-300/90 mt-5 mb-2 pb-1 border-b border-orange-500/20 flex items-center gap-2${b?" cognitive-heading":""}">
743
+ ${v?'<span class="cognitive-tag">Cognitive</span>':""}
744
+ </h3>`);continue}const d=c.match(/^## (.+)$/);if(d){o();const m=sr(d[1]),v=M0(d[1]);n.push(`<h2 class="text-[15px] font-bold text-orange-300/90 mt-5 mb-2 pb-1 border-b border-orange-500/20 flex items-center gap-2${v?" cognitive-heading":""}">
745
745
  ${m}
746
- ${b?'<span class="cognitive-tag">Cognitive Tag</span>':""}
746
+ ${v?'<span class="cognitive-tag">Cognitive Tag</span>':""}
747
747
  </h2>`);continue}const p=c.match(/^# (.+)$/);if(p){o(),n.push(`<h1 class="text-[20px] font-black text-white/95 mt-2 mb-3 tracking-tight leading-tight">
748
- ${nr(p[1])}
749
- </h1>`);continue}if(/^---+$/.test(c.trim())){o(),n.push('<hr class="border-white/10 my-4" />');continue}const f=c.match(/^[\-\*\+] (.+)$/);if(f){a||(n.push('<ul class="list-none pl-0 my-1 space-y-0.5">'),a=!0),n.push(`<li class="flex items-start gap-2 text-[13px] text-white/65"><span class="text-orange-500/60 mt-0.5 shrink-0">▸</span><span>${R0(f[1])}</span></li>`);continue}if(o(),c.trim()===""){n.push('<div class="h-2"></div>');continue}if(c.trim().startsWith("<!--")){const m=c.replace(/<!--\s?/,"").replace(/\s?-->/,"");n.push(`<p class="text-[11px] text-white/20 italic pl-2 border-l border-white/8 my-1">${nr(m)}</p>`);continue}n.push(`<p class="text-[13px] text-white/65 leading-relaxed my-1">${R0(c)}</p>`)}return o(),n.join(`
750
- `)}function R0(e){return nr(e).replace(/\*\*(.+?)\*\*/g,'<strong class="text-white/90 font-semibold">$1</strong>').replace(/\*(.+?)\*/g,'<em class="text-orange-300/80">$1</em>').replace(/`(.+?)`/g,'<code class="bg-white/8 text-orange-200/80 text-[11px] px-1 py-0.5 rounded font-mono">$1</code>')}function h_(){const[e,t]=h.useState(""),[n,s]=h.useState(!1),[i,a]=h.useState(!1),[o,l]=h.useState(!0),c=h.useRef(null),u=h.useRef(null);h.useEffect(()=>{$("/api/memory/persona").then(m=>m.ok?m.json():null).then(m=>{var b;t((b=m==null?void 0:m.content)!=null&&b.trim()?m.content:Xa)}).catch(()=>t(Xa)).finally(()=>l(!1))},[]);const d=h.useCallback(async m=>{s(!0);try{if(!(await $("/api/memory/persona",{method:"PATCH",body:JSON.stringify({content:m})})).ok)throw new Error("save failed");a(!0),u.current&&clearTimeout(u.current),u.current=setTimeout(()=>a(!1),2500)}catch{ue.error("Kaydedilemedi — backend bağlantısını kontrol edin.")}finally{s(!1)}},[]),p=m=>{t(m),a(!1),c.current&&clearTimeout(c.current),c.current=setTimeout(()=>d(m),2e3)};if(h.useEffect(()=>()=>{c.current&&clearTimeout(c.current),u.current&&clearTimeout(u.current)},[]),o)return r.jsx("div",{className:"flex items-center justify-center h-full min-h-[60vh]",children:r.jsx(ne,{size:22,className:"animate-spin text-orange-500/60"})});const f=d_(e);return r.jsxs("div",{className:"flex flex-col h-full min-h-[calc(100vh-64px)] bg-transparent",children:[r.jsxs("div",{className:"flex items-center justify-between px-6 py-3 border-b border-orange-500/12 shrink-0",style:{background:"rgba(13,7,3,0.6)",backdropFilter:"blur(12px)"},children:[r.jsxs("div",{className:"flex items-center gap-2.5",children:[r.jsx("div",{className:"w-8 h-8 rounded-xl flex items-center justify-center",style:{background:"rgba(249,115,22,0.12)",border:"1px solid rgba(249,115,22,0.25)"},children:r.jsx(Yt,{size:16,className:"text-orange-400"})}),r.jsxs("div",{children:[r.jsx("h1",{className:"text-[14px] font-bold text-white/90 leading-none",children:"Must-b Zihni"}),r.jsx("p",{className:"text-[10px] text-white/30 mt-0.5",children:"memory/must-b.md"})]})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"text-[10px] text-white/25 mr-1",children:n?"Kaydediliyor…":i?"Kaydedildi":"Otomatik kayıt: 2s"}),r.jsx("button",{onClick:()=>{l(!0),$("/api/memory/persona").then(m=>m.ok?m.json():null).then(m=>t((m==null?void 0:m.content)??Xa)).catch(()=>{}).finally(()=>l(!1))},title:"Yenile",className:"p-2 rounded-lg text-white/30 hover:text-white/70 hover:bg-white/6 transition-all",children:r.jsx(de,{size:14})}),r.jsxs("button",{onClick:()=>d(e),disabled:n,className:`flex items-center gap-1.5 px-4 py-2 rounded-xl text-[12px] font-semibold transition-all ${i?"bg-green-500/15 border border-green-500/30 text-green-400":"bg-orange-500/15 border border-orange-500/30 text-orange-400 hover:bg-orange-500/25 hover:text-orange-300"}`,children:[n?r.jsx(ne,{size:13,className:"animate-spin"}):i?r.jsx(zt,{size:13}):r.jsx(dv,{size:13}),i?"Kaydedildi":"Kaydet"]})]})]}),r.jsxs("div",{className:"flex flex-1 min-h-0 divide-x divide-orange-500/10",children:[r.jsxs("div",{className:"flex flex-col flex-1 min-w-0",children:[r.jsxs("div",{className:"px-4 py-2 border-b border-white/5 flex items-center gap-1.5 shrink-0",style:{background:"rgba(13,7,3,0.4)"},children:[r.jsx("span",{className:"w-2 h-2 rounded-full bg-orange-500/50"}),r.jsx("span",{className:"text-[10px] font-bold uppercase tracking-[0.12em] text-white/25 select-none",children:"Markdown Editörü"})]}),r.jsx("textarea",{value:e,onChange:m=>p(m.target.value),spellCheck:!1,className:"flex-1 w-full resize-none outline-none font-mono text-[13px] text-white/75 leading-relaxed p-5 bg-transparent placeholder-white/15",style:{background:"rgba(8,4,1,0.85)",caretColor:"rgba(249,115,22,0.9)",lineHeight:"1.7",tabSize:2},placeholder:Xa})]}),r.jsxs("div",{className:"flex flex-col flex-1 min-w-0",children:[r.jsxs("div",{className:"px-4 py-2 border-b border-white/5 flex items-center gap-1.5 shrink-0",style:{background:"rgba(13,7,3,0.4)"},children:[r.jsx("span",{className:"w-2 h-2 rounded-full bg-green-500/40"}),r.jsx("span",{className:"text-[10px] font-bold uppercase tracking-[0.12em] text-white/25 select-none",children:"Canlı Önizleme"}),r.jsx(mv,{size:10,className:"text-orange-500/40 ml-auto"}),r.jsx("span",{className:"text-[9px] text-orange-500/40 font-mono",children:"Bilişsel Etiketler aktif"})]}),r.jsxs("div",{className:"flex-1 overflow-y-auto p-5",style:{background:"rgba(10,5,2,0.7)"},children:[r.jsx("style",{children:`
748
+ ${sr(p[1])}
749
+ </h1>`);continue}if(/^---+$/.test(c.trim())){o(),n.push('<hr class="border-white/10 my-4" />');continue}const f=c.match(/^[\-\*\+] (.+)$/);if(f){a||(n.push('<ul class="list-none pl-0 my-1 space-y-0.5">'),a=!0),n.push(`<li class="flex items-start gap-2 text-[13px] text-white/65"><span class="text-orange-500/60 mt-0.5 shrink-0">▸</span><span>${R0(f[1])}</span></li>`);continue}if(o(),c.trim()===""){n.push('<div class="h-2"></div>');continue}if(c.trim().startsWith("<!--")){const m=c.replace(/<!--\s?/,"").replace(/\s?-->/,"");n.push(`<p class="text-[11px] text-white/20 italic pl-2 border-l border-white/8 my-1">${sr(m)}</p>`);continue}n.push(`<p class="text-[13px] text-white/65 leading-relaxed my-1">${R0(c)}</p>`)}return o(),n.join(`
750
+ `)}function R0(e){return sr(e).replace(/\*\*(.+?)\*\*/g,'<strong class="text-white/90 font-semibold">$1</strong>').replace(/\*(.+?)\*/g,'<em class="text-orange-300/80">$1</em>').replace(/`(.+?)`/g,'<code class="bg-white/8 text-orange-200/80 text-[11px] px-1 py-0.5 rounded font-mono">$1</code>')}function h_(){const[e,t]=h.useState(""),[n,s]=h.useState(!1),[i,a]=h.useState(!1),[o,l]=h.useState(!0),c=h.useRef(null),u=h.useRef(null);h.useEffect(()=>{$("/api/memory/persona").then(m=>m.ok?m.json():null).then(m=>{var v;t((v=m==null?void 0:m.content)!=null&&v.trim()?m.content:Xa)}).catch(()=>t(Xa)).finally(()=>l(!1))},[]);const d=h.useCallback(async m=>{s(!0);try{if(!(await $("/api/memory/persona",{method:"PATCH",body:JSON.stringify({content:m})})).ok)throw new Error("save failed");a(!0),u.current&&clearTimeout(u.current),u.current=setTimeout(()=>a(!1),2500)}catch{le.error("Kaydedilemedi — backend bağlantısını kontrol edin.")}finally{s(!1)}},[]),p=m=>{t(m),a(!1),c.current&&clearTimeout(c.current),c.current=setTimeout(()=>d(m),2e3)};if(h.useEffect(()=>()=>{c.current&&clearTimeout(c.current),u.current&&clearTimeout(u.current)},[]),o)return r.jsx("div",{className:"flex items-center justify-center h-full min-h-[60vh]",children:r.jsx(ne,{size:22,className:"animate-spin text-orange-500/60"})});const f=d_(e);return r.jsxs("div",{className:"flex flex-col h-full min-h-[calc(100vh-64px)] bg-transparent",children:[r.jsxs("div",{className:"flex items-center justify-between px-6 py-3 border-b border-orange-500/12 shrink-0",style:{background:"rgba(13,7,3,0.6)",backdropFilter:"blur(12px)"},children:[r.jsxs("div",{className:"flex items-center gap-2.5",children:[r.jsx("div",{className:"w-8 h-8 rounded-xl flex items-center justify-center",style:{background:"rgba(249,115,22,0.12)",border:"1px solid rgba(249,115,22,0.25)"},children:r.jsx(Yt,{size:16,className:"text-orange-400"})}),r.jsxs("div",{children:[r.jsx("h1",{className:"text-[14px] font-bold text-white/90 leading-none",children:"Must-b Zihni"}),r.jsx("p",{className:"text-[10px] text-white/30 mt-0.5",children:"memory/must-b.md"})]})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"text-[10px] text-white/25 mr-1",children:n?"Kaydediliyor…":i?"Kaydedildi":"Otomatik kayıt: 2s"}),r.jsx("button",{onClick:()=>{l(!0),$("/api/memory/persona").then(m=>m.ok?m.json():null).then(m=>t((m==null?void 0:m.content)??Xa)).catch(()=>{}).finally(()=>l(!1))},title:"Yenile",className:"p-2 rounded-lg text-white/30 hover:text-white/70 hover:bg-white/6 transition-all",children:r.jsx(de,{size:14})}),r.jsxs("button",{onClick:()=>d(e),disabled:n,className:`flex items-center gap-1.5 px-4 py-2 rounded-xl text-[12px] font-semibold transition-all ${i?"bg-green-500/15 border border-green-500/30 text-green-400":"bg-orange-500/15 border border-orange-500/30 text-orange-400 hover:bg-orange-500/25 hover:text-orange-300"}`,children:[n?r.jsx(ne,{size:13,className:"animate-spin"}):i?r.jsx(zt,{size:13}):r.jsx(dv,{size:13}),i?"Kaydedildi":"Kaydet"]})]})]}),r.jsxs("div",{className:"flex flex-1 min-h-0 divide-x divide-orange-500/10",children:[r.jsxs("div",{className:"flex flex-col flex-1 min-w-0",children:[r.jsxs("div",{className:"px-4 py-2 border-b border-white/5 flex items-center gap-1.5 shrink-0",style:{background:"rgba(13,7,3,0.4)"},children:[r.jsx("span",{className:"w-2 h-2 rounded-full bg-orange-500/50"}),r.jsx("span",{className:"text-[10px] font-bold uppercase tracking-[0.12em] text-white/25 select-none",children:"Markdown Editörü"})]}),r.jsx("textarea",{value:e,onChange:m=>p(m.target.value),spellCheck:!1,className:"flex-1 w-full resize-none outline-none font-mono text-[13px] text-white/75 leading-relaxed p-5 bg-transparent placeholder-white/15",style:{background:"rgba(8,4,1,0.85)",caretColor:"rgba(249,115,22,0.9)",lineHeight:"1.7",tabSize:2},placeholder:Xa})]}),r.jsxs("div",{className:"flex flex-col flex-1 min-w-0",children:[r.jsxs("div",{className:"px-4 py-2 border-b border-white/5 flex items-center gap-1.5 shrink-0",style:{background:"rgba(13,7,3,0.4)"},children:[r.jsx("span",{className:"w-2 h-2 rounded-full bg-green-500/40"}),r.jsx("span",{className:"text-[10px] font-bold uppercase tracking-[0.12em] text-white/25 select-none",children:"Canlı Önizleme"}),r.jsx(mv,{size:10,className:"text-orange-500/40 ml-auto"}),r.jsx("span",{className:"text-[9px] text-orange-500/40 font-mono",children:"Bilişsel Etiketler aktif"})]}),r.jsxs("div",{className:"flex-1 overflow-y-auto p-5",style:{background:"rgba(10,5,2,0.7)"},children:[r.jsx("style",{children:`
751
751
  .cognitive-heading {
752
752
  padding: 6px 10px;
753
753
  border-radius: 8px;
@@ -769,12 +769,12 @@ Burada senin hakkında öğrendiğim bilgiler yer alır.
769
769
  color: rgba(251,146,60,0.9);
770
770
  margin-left: auto;
771
771
  }
772
- `}),r.jsx("div",{className:"max-w-full",dangerouslySetInnerHTML:{__html:f}})]})]})]})]})}const f_=[{id:"terminal",label:"Terminal",desc:"Kabuk komutları çalıştır",Icon:as,color:"text-green-400",bg:"bg-green-500/10",border:"border-green-500/20"},{id:"browser",label:"Browser",desc:"Playwright ile tam web otomasyonu",Icon:We,color:"text-blue-400",bg:"bg-blue-500/10",border:"border-blue-500/20"},{id:"web-search",label:"Web Search",desc:"Çoklu sağlayıcıyla gerçek zamanlı arama",Icon:Xt,color:"text-cyan-400",bg:"bg-cyan-500/10",border:"border-cyan-500/20"},{id:"file-manager",label:"Files",desc:"Dosya oku, yaz ve yönet",Icon:ps,color:"text-yellow-400",bg:"bg-yellow-500/10",border:"border-yellow-500/20"},{id:"image-gen",label:"Görsel Üret",desc:"AI ile görsel üret",Icon:uv,color:"text-pink-400",bg:"bg-pink-500/10",border:"border-pink-500/20"},{id:"code",label:"Kod Analizi",desc:"Kod yaz, analiz et ve hata ayıkla",Icon:hn,color:"text-purple-400",bg:"bg-purple-500/10",border:"border-purple-500/20"},{id:"memory",label:"Bellek",desc:"Semantik hafıza arama & kayıt",Icon:Yt,color:"text-orange-400",bg:"bg-orange-500/10",border:"border-orange-500/20"},{id:"vision",label:"Görme",desc:"Ekran ve görsel algı",Icon:cd,color:"text-emerald-400",bg:"bg-emerald-500/10",border:"border-emerald-500/20"},{id:"screen-sense",label:"Ekranı Gör",desc:"Kullanıcı ekranını yakala ve analiz et",Icon:sf,color:"text-indigo-400",bg:"bg-indigo-500/10",border:"border-indigo-500/20"},{id:"gateway",label:"Gateway",desc:"Sistem arası ve A2A iletişim",Icon:rl,color:"text-teal-400",bg:"bg-teal-500/10",border:"border-teal-500/20"},{id:"messages",label:"Mesajlar",desc:"Ajan-arası mesaj gönder & al",Icon:Os,color:"text-rose-400",bg:"bg-rose-500/10",border:"border-rose-500/20"},{id:"git",label:"Git",desc:"Commit, branch, diff, push/pull",Icon:iv,color:"text-amber-400",bg:"bg-amber-500/10",border:"border-amber-500/20"}];function p_(){const[e,t]=h.useState("tools"),[n,s]=h.useState([]),[i,a]=h.useState([]),[o,l]=h.useState({}),[c,u]=h.useState(!1),[d,p]=h.useState(""),f=h.useCallback(async()=>{u(!0);try{const j=await $("/api/skills/list");if(j.ok){const k=await j.json();s(Array.isArray(k)?k:[])}}catch{}u(!1)},[]),m=h.useCallback(async()=>{u(!0);try{const j=await $("/api/skills/catalog");if(j.ok){const k=await j.json(),N=Array.isArray(k)?k:k.skills??[];a(N)}}catch{}u(!1)},[]);h.useEffect(()=>{e==="saved"&&f(),e==="catalog"&&m()},[e,f,m]);const b=async j=>{l(k=>({...k,[j.id]:"running"}));try{const k=await $("/api/skills/run",{method:"POST",body:JSON.stringify({id:j.id})});l(N=>({...N,[j.id]:k.ok?"done":"error"})),ue[k.ok?"success":"error"](k.ok?`"${j.name}" çalıştırıldı`:"Çalıştırma başarısız"),setTimeout(()=>l(N=>({...N,[j.id]:"idle"})),2500)}catch{l(k=>({...k,[j.id]:"error"}))}},y=async j=>{try{await $(`/api/skills/${j}`,{method:"DELETE"}),s(k=>k.filter(N=>N.id!==j)),ue.success("Beceri silindi.")}catch{ue.error("Silinemedi.")}},v=async(j,k)=>{l(N=>({...N,[j]:"running"}));try{const N=await $("/api/v1/skills/invoke",{method:"POST",body:JSON.stringify({skill:j,goal:`${k} becerisini çalıştır`})});l(S=>({...S,[j]:N.ok?"done":"error"})),N.ok&&ue.success(`"${k}" yapay zekanın araç kutusuna eklendi ve aktif edildi`),setTimeout(()=>l(S=>({...S,[j]:"idle"})),2500)}catch{l(N=>({...N,[j]:"error"}))}},g=f_.filter(j=>j.label.toLowerCase().includes(d.toLowerCase())||j.desc.toLowerCase().includes(d.toLowerCase())),x=n.filter(j=>j.name.toLowerCase().includes(d.toLowerCase())||j.goal.toLowerCase().includes(d.toLowerCase())),w=i.filter(j=>j.name.toLowerCase().includes(d.toLowerCase())||j.description.toLowerCase().includes(d.toLowerCase())||(j.pluginName??"").toLowerCase().includes(d.toLowerCase()));return r.jsxs("div",{className:"min-h-screen bg-transparent pt-4 pb-10 px-4 sm:px-6 max-w-5xl mx-auto",children:[r.jsx("div",{className:"mb-6",children:r.jsxs("div",{className:"flex items-center gap-3 mb-1",children:[r.jsx("div",{className:"w-10 h-10 rounded-2xl flex items-center justify-center shrink-0",style:{background:"rgba(249,115,22,0.12)",border:"1px solid rgba(249,115,22,0.25)"},children:r.jsx(ze,{size:18,className:"text-orange-400"})}),r.jsxs("div",{children:[r.jsx("h1",{className:"text-[22px] font-black text-white/95 leading-none",children:"Beceriler & Araçlar"}),r.jsx("p",{className:"text-[12px] text-white/35 mt-0.5",children:"Must-b'nin bilişsel yetenekleri"})]})]})}),r.jsxs("div",{className:"flex items-center gap-3 mb-5",children:[r.jsxs("div",{className:"relative flex-1 max-w-xs",children:[r.jsx(Xt,{size:13,className:"absolute left-3 top-1/2 -translate-y-1/2 text-white/25"}),r.jsx("input",{value:d,onChange:j=>p(j.target.value),placeholder:"Ara…",className:"w-full bg-white/5 border border-white/8 rounded-xl py-2 pl-8 pr-3 text-[13px] text-white/75 outline-none focus:border-orange-500/40 transition-colors placeholder-white/20"})]}),r.jsx("div",{className:"flex rounded-xl overflow-hidden border border-white/8",children:[{key:"tools",label:"Dahili Araçlar"},{key:"saved",label:"Kaydedilen"},{key:"catalog",label:"Katalog"}].map(({key:j,label:k})=>r.jsx("button",{onClick:()=>t(j),className:`px-4 py-2 text-[12px] font-semibold transition-all ${e===j?"bg-orange-500/20 text-orange-300":"text-white/40 hover:text-white/70 hover:bg-white/5"}`,children:k},j))})]}),e==="tools"&&r.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",children:g.map(({id:j,label:k,desc:N,Icon:S,color:E,bg:P,border:M})=>r.jsxs(H.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.18},className:`rounded-2xl p-4 flex gap-3 items-start border ${M}`,style:{background:"rgba(13,7,3,0.6)",backdropFilter:"blur(12px)"},children:[r.jsx("div",{className:`w-9 h-9 rounded-xl flex items-center justify-center shrink-0 ${P} border ${M}`,children:r.jsx(S,{size:16,className:E})}),r.jsxs("div",{className:"min-w-0 flex-1",children:[r.jsx("p",{className:"text-[13px] font-bold text-white/90 leading-tight",children:k}),r.jsx("p",{className:"text-[11px] text-white/40 mt-0.5 leading-tight",children:N})]}),r.jsx("div",{className:"shrink-0 mt-1",children:r.jsx("span",{className:"text-[9px] font-bold uppercase tracking-wider px-1.5 py-0.5 rounded-md bg-green-500/12 border border-green-500/20 text-green-400",children:"Aktif"})})]},j))}),e==="saved"&&r.jsxs("div",{children:[r.jsxs("div",{className:"flex items-center justify-between mb-3",children:[r.jsxs("p",{className:"text-[11px] text-white/30",children:[n.length," kaydedilmiş beceri"]}),r.jsx("button",{onClick:f,className:"p-1.5 text-white/30 hover:text-white/70 rounded-lg hover:bg-white/6 transition-all",children:r.jsx(de,{size:13})})]}),c?r.jsx("div",{className:"flex justify-center py-16",children:r.jsx(ne,{size:20,className:"animate-spin text-orange-500/50"})}):x.length===0?r.jsx("div",{className:"text-center py-16 text-white/20 text-[13px]",children:d?"Eşleşen beceri bulunamadı.":"Henüz kaydedilmiş beceri yok."}):r.jsx("div",{className:"space-y-2",children:x.map(j=>{const k=o[j.id]??"idle";return r.jsxs(H.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},className:"rounded-2xl p-4 border border-orange-500/10",style:{background:"rgba(13,7,3,0.6)",backdropFilter:"blur(12px)"},children:[r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx("div",{className:"w-8 h-8 rounded-xl bg-orange-500/10 border border-orange-500/20 flex items-center justify-center shrink-0 mt-0.5",children:r.jsx(Pl,{size:14,className:"text-orange-400"})}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("p",{className:"text-[13px] font-bold text-white/90",children:j.name}),r.jsx("p",{className:"text-[11px] text-white/40 truncate mt-0.5",children:j.goal}),r.jsxs("div",{className:"flex items-center gap-3 mt-2",children:[r.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-white/25",children:[r.jsx(tv,{size:9})," ",j.runCount," çalıştırma"]}),r.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-white/25",children:[r.jsx(Pt,{size:9})," ",new Date(j.savedAt).toLocaleDateString("tr-TR")]})]})]}),r.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[r.jsx("button",{onClick:()=>b(j),disabled:k==="running",className:`w-8 h-8 rounded-xl flex items-center justify-center transition-all border ${k==="done"?"bg-green-500/15 border-green-500/25 text-green-400":k==="error"?"bg-red-500/15 border-red-500/25 text-red-400":k==="running"?"bg-orange-500/10 border-orange-500/20 text-orange-400":"bg-white/5 border-white/10 text-white/50 hover:bg-orange-500/15 hover:border-orange-500/25 hover:text-orange-300"}`,children:k==="running"?r.jsx(ne,{size:13,className:"animate-spin"}):k==="done"?r.jsx(Ve,{size:13}):k==="error"?r.jsx(wt,{size:13}):r.jsx($s,{size:13})}),r.jsx("button",{onClick:()=>y(j.id),className:"w-8 h-8 rounded-xl flex items-center justify-center border border-white/8 text-white/25 hover:bg-red-500/12 hover:border-red-500/20 hover:text-red-400 transition-all",children:r.jsx(Us,{size:13})})]})]}),(j.tags??[]).length>0&&r.jsx("div",{className:"flex flex-wrap gap-1 mt-2 ml-11",children:(j.tags??[]).map(N=>r.jsx("span",{className:"text-[9px] px-1.5 py-0.5 rounded-md bg-white/5 border border-white/8 text-white/35",children:N},N))})]},j.id)})})]}),e==="catalog"&&r.jsxs("div",{children:[r.jsxs("div",{className:"flex items-center justify-between mb-3",children:[r.jsxs("p",{className:"text-[11px] text-white/30",children:[i.length," beceri"]}),r.jsx("button",{onClick:m,className:"p-1.5 text-white/30 hover:text-white/70 rounded-lg hover:bg-white/6 transition-all",children:r.jsx(de,{size:13})})]}),c?r.jsx("div",{className:"flex justify-center py-16",children:r.jsx(ne,{size:20,className:"animate-spin text-orange-500/50"})}):w.length===0?r.jsx("div",{className:"text-center py-16 text-white/20 text-[13px]",children:d?"Eşleşen beceri bulunamadı.":"Katalog boş."}):r.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:w.map(j=>{var N;const k=o[j.id]??"idle";return r.jsxs(H.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},className:"rounded-2xl p-4 border border-white/8 flex gap-3",style:{background:"rgba(13,7,3,0.55)",backdropFilter:"blur(12px)"},children:[r.jsx("div",{className:"text-[22px] shrink-0",children:j.emoji??"⚡"}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("p",{className:"text-[13px] font-bold text-white/90",children:j.name}),r.jsx("p",{className:"text-[11px] text-white/40 mt-0.5 leading-tight line-clamp-2",children:j.description}),j.pluginName&&r.jsx("p",{className:"text-[10px] text-white/20 mt-1",children:j.pluginName}),(((N=j.requires)==null?void 0:N.bins)??[]).length>0&&r.jsx("div",{className:"flex flex-wrap gap-1 mt-1.5",children:(j.requires.bins??[]).map(S=>r.jsx("span",{className:"text-[9px] px-1.5 py-0.5 rounded-md bg-orange-500/8 border border-orange-500/15 text-orange-400/70",children:S},S))})]}),r.jsx("button",{onClick:()=>v(j.id,j.name),disabled:k==="running",className:`w-8 h-8 rounded-xl flex items-center justify-center shrink-0 transition-all border mt-0.5 ${k==="done"?"bg-green-500/15 border-green-500/25 text-green-400":k==="error"?"bg-red-500/15 border-red-500/25 text-red-400":k==="running"?"bg-orange-500/10 border-orange-500/20 text-orange-400":"bg-white/5 border-white/10 text-white/50 hover:bg-orange-500/15 hover:border-orange-500/25 hover:text-orange-300"}`,children:k==="running"?r.jsx(ne,{size:13,className:"animate-spin"}):k==="done"?r.jsx(Ve,{size:13}):k==="error"?r.jsx(wt,{size:13}):r.jsx(fn,{size:13})})]},j.id)})})]})]})}const m_={node:hn,python:yn,api:Gr,cli:as,web:We,database:va,cloud:sv,agent:ia};function g_(e,t){const n=e.toLowerCase();return n.includes("api")||n.includes("webhook")?Gr:n.includes("db")||n.includes("database")||n.includes("sql")?va:n.includes("cloud")||n.includes("s3")||n.includes("gcs")?sv:n.includes("agent")||n.includes("bot")?ia:n.includes("web")||n.includes("http")?We:m_[t]??qr}function x_(e){const t=new Map;for(const n of e){if(!n.pluginName)continue;const s=t.get(n.pluginName);s?s.skillCount+=1:t.set(n.pluginName,{name:n.pluginName,emoji:n.emoji??"🔧",skillCount:1})}return Array.from(t.values()).sort((n,s)=>n.name.localeCompare(s.name))}function y_(){const[e,t]=h.useState([]),[n,s]=h.useState([]),[i,a]=h.useState(!1),[o,l]=h.useState(null),[c,u]=h.useState(!1),[d,p]=h.useState(""),[f,m]=h.useState(""),[b,y]=h.useState("node"),[v,g]=h.useState(""),[x,w]=h.useState(!1),j=h.useCallback(async()=>{a(!0);try{const[P,M]=await Promise.all([$("/api/plugins/list"),$("/api/skills/catalog")]);if(P.ok){const T=await P.json();t(Array.isArray(T)?T:[])}if(M.ok){const T=await M.json(),V=Array.isArray(T)?T:T.skills??[];s(x_(V))}}catch{}a(!1)},[]);h.useEffect(()=>{j()},[j]);const k=async P=>{l(P.name);try{const M=P.running?"/api/plugins/stop":"/api/plugins/run";(await $(M,{method:"POST",body:JSON.stringify({name:P.name})})).ok?(t(V=>(Array.isArray(V)?V:[]).map(R=>R.name===P.name?{...R,running:!R.running}:R)),ue.success(P.running?`"${P.name}" durduruldu`:`"${P.name}" başlatıldı`)):ue.error("İşlem başarısız.")}catch{ue.error("Bağlantı hatası.")}l(null)},N=async P=>{if(P.preventDefault(),!(!d.trim()||!f.trim())){w(!0);try{const M=await $("/api/plugins/build",{method:"POST",body:JSON.stringify({name:d,goal:f,lang:b,context:v})});if(M.ok){const T=await M.json();ue.success(`"${T.name??d}" eklentisi oluşturuldu!`),p(""),m(""),g(""),u(!1),j()}else{const T=await M.json().catch(()=>({}));ue.error(T.error??"Oluşturma başarısız.")}}catch{ue.error("Gateway bağlantı hatası.")}w(!1)}},S=Array.isArray(e)?e:[],E=S.filter(P=>P.running).length;return r.jsxs("div",{className:"min-h-screen bg-transparent pt-4 pb-10 px-4 sm:px-6 max-w-5xl mx-auto",children:[r.jsxs("div",{className:"flex items-center justify-between mb-6",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:"w-10 h-10 rounded-2xl flex items-center justify-center shrink-0",style:{background:"rgba(249,115,22,0.12)",border:"1px solid rgba(249,115,22,0.25)"},children:r.jsx(Ir,{size:18,className:"text-orange-400"})}),r.jsxs("div",{children:[r.jsx("h1",{className:"text-[22px] font-black text-white/95 leading-none",children:"Eklentiler"}),r.jsxs("p",{className:"text-[12px] text-white/35 mt-0.5",children:[S.length," özel eklenti · ",E," çalışıyor"]})]})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("button",{onClick:j,className:"p-2.5 rounded-xl text-white/30 hover:text-white/70 hover:bg-white/6 border border-white/8 transition-all",children:r.jsx(de,{size:14})}),r.jsxs("button",{onClick:()=>u(P=>!P),className:`flex items-center gap-1.5 px-4 py-2.5 rounded-xl text-[12px] font-semibold transition-all border ${c?"bg-orange-500/20 border-orange-500/30 text-orange-300":"bg-white/6 border-white/10 text-white/60 hover:bg-orange-500/12 hover:border-orange-500/20 hover:text-orange-300"}`,children:[c?r.jsx(et,{size:13}):r.jsx(zl,{size:13}),c?"Kapat":"Yeni Eklenti"]})]})]}),r.jsx(se,{children:c&&r.jsx(H.div,{initial:{opacity:0,y:-10,height:0},animate:{opacity:1,y:0,height:"auto"},exit:{opacity:0,y:-8,height:0},transition:{duration:.2},className:"overflow-hidden mb-5",children:r.jsxs("form",{onSubmit:N,className:"rounded-2xl p-5 border border-orange-500/20",style:{background:"rgba(13,7,3,0.7)",backdropFilter:"blur(16px)"},children:[r.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[r.jsx(ze,{size:14,className:"text-orange-400"}),r.jsx("h3",{className:"text-[13px] font-bold text-white/90",children:"Yeni Eklenti Oluştur"})]}),r.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3 mb-3",children:[r.jsxs("div",{children:[r.jsx("label",{className:"block text-[10px] font-bold text-white/35 uppercase tracking-wider mb-1",children:"Ad"}),r.jsx("input",{value:d,onChange:P=>p(P.target.value),placeholder:"my-plugin",required:!0,className:"w-full bg-white/5 border border-white/8 rounded-xl px-3 py-2 text-[13px] text-white/80 outline-none focus:border-orange-500/40 transition-colors placeholder-white/20"})]}),r.jsxs("div",{children:[r.jsx("label",{className:"block text-[10px] font-bold text-white/35 uppercase tracking-wider mb-1",children:"Dil"}),r.jsx("div",{className:"flex rounded-xl overflow-hidden border border-white/8",children:["node","python"].map(P=>r.jsxs("button",{type:"button",onClick:()=>y(P),className:`flex-1 py-2 text-[12px] font-semibold transition-all flex items-center justify-center gap-1.5 ${b===P?"bg-orange-500/20 text-orange-300":"text-white/40 hover:text-white/70 hover:bg-white/5"}`,children:[P==="node"?r.jsx(hn,{size:12}):r.jsx(yn,{size:12}),P==="node"?"Node.js":"Python"]},P))})]})]}),r.jsxs("div",{className:"mb-3",children:[r.jsx("label",{className:"block text-[10px] font-bold text-white/35 uppercase tracking-wider mb-1",children:"Hedef / Açıklama"}),r.jsx("textarea",{value:f,onChange:P=>m(P.target.value),placeholder:"Bu eklenti ne yapmalı?",required:!0,rows:2,className:"w-full bg-white/5 border border-white/8 rounded-xl px-3 py-2 text-[13px] text-white/80 outline-none focus:border-orange-500/40 transition-colors placeholder-white/20 resize-none"})]}),r.jsxs("div",{className:"mb-4",children:[r.jsx("label",{className:"block text-[10px] font-bold text-white/35 uppercase tracking-wider mb-1",children:"Bağlam (isteğe bağlı)"}),r.jsx("textarea",{value:v,onChange:P=>g(P.target.value),placeholder:"API anahtarları, URL'ler, ek bağlam…",rows:2,className:"w-full bg-white/5 border border-white/8 rounded-xl px-3 py-2 text-[13px] text-white/80 outline-none focus:border-orange-500/40 transition-colors placeholder-white/20 resize-none"})]}),r.jsxs("button",{type:"submit",disabled:x||!d.trim()||!f.trim(),className:"flex items-center gap-2 px-5 py-2.5 rounded-xl bg-orange-600/20 border border-orange-500/30 text-orange-300 text-[13px] font-semibold hover:bg-orange-600/30 transition-all disabled:opacity-40",children:[x?r.jsx(ne,{size:13,className:"animate-spin"}):r.jsx(fn,{size:13}),x?"Oluşturuluyor…":"Oluştur"]})]})})}),n.length>0&&r.jsxs("div",{className:"mb-6",children:[r.jsx("p",{className:"text-[10px] font-bold uppercase tracking-widest text-white/25 mb-3",children:"Yüklü Beceri Paketleri"}),r.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",children:n.map(P=>r.jsxs(H.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},className:"rounded-2xl p-4 flex gap-3 items-center border border-white/8",style:{background:"rgba(13,7,3,0.55)",backdropFilter:"blur(12px)"},children:[r.jsx("div",{className:"text-[22px] shrink-0",children:P.emoji}),r.jsxs("div",{className:"min-w-0 flex-1",children:[r.jsx("p",{className:"text-[13px] font-bold text-white/90 leading-tight truncate",children:P.name}),r.jsxs("p",{className:"text-[10px] text-white/30 mt-0.5",children:[P.skillCount," beceri"]})]}),r.jsx("span",{className:"text-[9px] font-bold uppercase tracking-wider px-1.5 py-0.5 rounded-md bg-green-500/12 border border-green-500/20 text-green-400 shrink-0",children:"Yüklü"})]},P.name))})]}),i?r.jsx("div",{className:"flex justify-center py-20",children:r.jsx(ne,{size:22,className:"animate-spin text-orange-500/50"})}):S.length===0?r.jsxs("div",{className:"rounded-2xl border border-white/8 p-8 text-center",style:{background:"rgba(13,7,3,0.4)"},children:[r.jsx(Ir,{size:28,className:"text-white/15 mx-auto mb-3"}),r.jsx("p",{className:"text-[13px] text-white/30 font-medium",children:"Henüz özel eklenti yok"}),r.jsx("p",{className:"text-[12px] text-white/20 mt-1",children:'Yukarıdaki "Yeni Eklenti" ile kendi konektörünü oluştur.'})]}):r.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",children:S.map(P=>{const M=o===P.name,T=g_(P.name,P.lang),V=P.lang==="node"?hn:yn;return r.jsxs(H.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},className:`rounded-2xl p-4 border transition-all ${P.running?"border-orange-500/25":"border-white/8 hover:border-white/14"}`,style:{background:P.running?"rgba(249,115,22,0.06)":"rgba(13,7,3,0.55)",backdropFilter:"blur(12px)"},children:[r.jsxs("div",{className:"flex items-start justify-between mb-3",children:[r.jsxs("div",{className:"flex items-center gap-2.5",children:[r.jsx("div",{className:`w-9 h-9 rounded-xl flex items-center justify-center shrink-0 ${P.running?"bg-orange-500/15 border border-orange-500/25":"bg-white/6 border border-white/10"}`,children:r.jsx(T,{size:16,className:P.running?"text-orange-400":"text-white/50"})}),r.jsxs("div",{children:[r.jsx("p",{className:"text-[13px] font-bold text-white/90 leading-tight truncate max-w-[120px]",children:P.name}),r.jsxs("div",{className:"flex items-center gap-1 mt-0.5",children:[r.jsx(V,{size:9,className:P.lang==="node"?"text-green-400/60":"text-blue-400/60"}),r.jsx("span",{className:`text-[9px] font-semibold ${P.lang==="node"?"text-green-400/60":"text-blue-400/60"}`,children:P.lang==="node"?"Node.js":"Python"})]})]})]}),r.jsx("span",{className:`text-[9px] font-bold uppercase tracking-wider px-1.5 py-0.5 rounded-md border ${P.running?"bg-orange-500/15 border-orange-500/25 text-orange-400":"bg-white/5 border-white/10 text-white/30"}`,children:P.running?"Çalışıyor":"Durdu"})]}),r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx("span",{className:"text-[10px] text-white/25",children:new Date(P.createdAt).toLocaleDateString("tr-TR")}),r.jsxs("button",{onClick:()=>k(P),disabled:M,className:`flex items-center gap-1.5 px-3 py-1.5 rounded-xl text-[11px] font-semibold transition-all border ${P.running?"bg-red-500/12 border-red-500/20 text-red-400 hover:bg-red-500/20":"bg-orange-500/12 border-orange-500/20 text-orange-400 hover:bg-orange-500/20"} disabled:opacity-40`,children:[M?r.jsx(ne,{size:11,className:"animate-spin"}):P.running?r.jsx(of,{size:11}):r.jsx($s,{size:11}),P.running?"Durdur":"Başlat"]})]})]},P.name)})})]})}function v_(){return new URLSearchParams(window.location.search).get("token")??""}function b_(){const[e,t]=h.useState("connecting"),[n,s]=h.useState([]),[i,a]=h.useState([]),[o,l]=h.useState("idle"),[c,u]=h.useState(null),[d,p]=h.useState(""),f=h.useRef(null),m=h.useRef(null),b=h.useRef([]),y=v_();h.useEffect(()=>{if(!y){t("denied");return}const k=Ri(`${window.location.origin}/mobile`,{query:{token:y},transports:["websocket","polling"]});return f.current=k,k.on("connect",()=>t("connected")),k.on("disconnect",()=>t("disconnected")),k.on("authError",()=>{t("denied"),k.disconnect()}),k.on("agentUpdate",N=>{const{type:S}=N;if(S==="planStart"&&s([]),S==="stepStart"){const E=N.step;s(P=>[...P,{id:`${Date.now()}-${Math.random()}`,description:(E==null?void 0:E.description)??"Working…",status:"running"}])}S==="stepFinish"&&s(E=>{const P=[...E],M=P.findLastIndex(T=>T.status==="running");return M>=0&&(P[M]={...P[M],status:N.status==="error"?"error":"done"}),P}),S==="skillRunStart"&&N.skillId&&u(N.skillId),S==="planFinish"&&u(null)}),()=>{k.disconnect()}},[y]);const v=h.useCallback(async()=>{try{const k=await fetch("/api/skills/list",{headers:{Authorization:`Bearer ${y}`}});if(k.ok){const N=await k.json();a(N.skills??[])}}catch{}},[y]);h.useEffect(()=>{v()},[v]);const g=async()=>{try{const k=await navigator.mediaDevices.getUserMedia({audio:!0}),N=new MediaRecorder(k,{mimeType:"audio/webm"});b.current=[],N.ondataavailable=S=>{S.data.size>0&&b.current.push(S.data)},N.onstop=()=>{k.getTracks().forEach(S=>S.stop()),w()},N.start(),m.current=N,l("recording")}catch{l("idle")}},x=()=>{var k;(k=m.current)==null||k.stop(),l("sending")},w=async()=>{const k=new Blob(b.current,{type:"audio/webm"}),N=new FormData;N.append("audio",k,"voice.webm");try{const S=await fetch("/api/voice/transcribe",{method:"POST",headers:{Authorization:`Bearer ${y}`},body:N});if(S.ok){const{text:E}=await S.json();p(E),await fetch("/api/goal",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${y}`},body:JSON.stringify({goal:E})})}}catch{}l("idle")},j=async k=>{if(!c){u(k.id);try{await fetch("/api/skills/run",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${y}`},body:JSON.stringify({id:k.id})})}catch{u(null)}}};return!y||e==="denied"?r.jsxs("div",{className:"min-h-screen bg-[#02040a] flex flex-col items-center justify-center gap-4 text-center px-8",children:[r.jsx(wt,{size:40,className:"text-red-400"}),r.jsx("p",{className:"text-white font-bold text-xl",children:"Access Denied"}),r.jsxs("p",{className:"text-gray-500 text-sm",children:["This link is invalid or has expired.",r.jsx("br",{}),"Generate a new QR code from your desktop."]})]}):r.jsxs("div",{className:"min-h-screen bg-[#02040a] text-white flex flex-col pb-8",children:[r.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-white/5",children:[r.jsxs("div",{className:"flex items-center gap-2.5",children:[r.jsx("img",{src:"/logo.png",alt:"Must-b",className:"w-8 h-8 object-contain"}),r.jsx("span",{className:"font-bold text-base",children:"Must-b"}),r.jsx("span",{className:"text-[10px] text-orange-400 font-medium bg-orange-400/10 border border-orange-400/20 px-2 py-0.5 rounded-full",children:"Companion"})]}),r.jsx("div",{className:"flex items-center gap-1.5 text-xs",children:e==="connected"?r.jsxs(r.Fragment,{children:[r.jsx(VC,{size:13,className:"text-green-400"}),r.jsx("span",{className:"text-green-400",children:"Connected"})]}):e==="connecting"?r.jsxs(r.Fragment,{children:[r.jsx(ne,{size:13,className:"animate-spin text-orange-400"}),r.jsx("span",{className:"text-orange-400",children:"Connecting…"})]}):r.jsxs(r.Fragment,{children:[r.jsx(Hs,{size:13,className:"text-gray-600"}),r.jsx("span",{className:"text-gray-500",children:"Offline"})]})})]}),r.jsxs("div",{className:"flex flex-col items-center justify-center py-10 px-6 border-b border-white/5",children:[r.jsx("p",{className:"text-[11px] text-gray-500 font-medium uppercase tracking-widest mb-6",children:"Voice Command"}),r.jsxs(H.button,{onPointerDown:g,onPointerUp:x,onPointerLeave:o==="recording"?x:void 0,disabled:o==="sending"||e!=="connected",whileTap:{scale:.93},className:`relative w-28 h-28 rounded-full flex items-center justify-center transition-all select-none ${o==="recording"?"bg-red-500/20 border-2 border-red-500 shadow-[0_0_40px_rgba(239,68,68,0.4)]":o==="sending"?"bg-orange-500/10 border-2 border-orange-500/30":"bg-orange-500/10 border-2 border-orange-500/40 hover:bg-orange-500/20 active:scale-95"} disabled:opacity-40`,children:[o==="sending"?r.jsx(ne,{size:36,className:"text-orange-400 animate-spin"}):o==="recording"?r.jsx(nf,{size:36,className:"text-red-400"}):r.jsx(Ds,{size:36,className:"text-orange-400"}),o==="recording"&&r.jsx(H.span,{className:"absolute inset-0 rounded-full border-2 border-red-500",animate:{scale:[1,1.3,1],opacity:[.8,0,.8]},transition:{duration:1.4,repeat:1/0}})]}),r.jsx("p",{className:"text-[12px] text-gray-600 mt-4",children:o==="recording"?"Listening… release to send":"Hold to speak"}),d&&r.jsxs("p",{className:"text-[11px] text-orange-300 mt-3 text-center max-w-xs",children:['"',d,'"']})]}),r.jsxs("div",{className:"px-5 pt-6 pb-4 border-b border-white/5",children:[r.jsx("p",{className:"text-[10px] text-gray-500 font-bold uppercase tracking-widest mb-3",children:"Live Workflow"}),r.jsx(se,{children:n.length===0?r.jsx("p",{className:"text-[12px] text-gray-700 text-center py-4",children:"No active workflow"}):r.jsx("div",{className:"space-y-2",children:n.slice(-6).map(k=>r.jsxs(H.div,{initial:{opacity:0,x:-10},animate:{opacity:1,x:0},className:`flex items-start gap-2.5 p-3 rounded-xl border text-[12px] ${k.status==="running"?"bg-orange-500/8 border-orange-500/20":k.status==="error"?"bg-red-500/8 border-red-500/15":"bg-white/3 border-white/5"}`,children:[k.status==="running"&&r.jsx(ne,{size:12,className:"animate-spin text-orange-400 mt-0.5 shrink-0"}),k.status==="done"&&r.jsx(Ve,{size:12,className:"text-green-400 mt-0.5 shrink-0"}),k.status==="error"&&r.jsx(wt,{size:12,className:"text-red-400 mt-0.5 shrink-0"}),r.jsx("span",{className:k.status==="running"?"text-orange-300":k.status==="error"?"text-red-300":"text-gray-400",children:k.description})]},k.id))})})]}),r.jsxs("div",{className:"px-5 pt-6",children:[r.jsxs("div",{className:"flex items-center justify-between mb-4",children:[r.jsx("p",{className:"text-[10px] text-gray-500 font-bold uppercase tracking-widest",children:"My Skills"}),r.jsx("button",{onClick:v,className:"text-gray-600 hover:text-gray-400 transition-colors",children:r.jsx(de,{size:12})})]}),i.length===0?r.jsx("p",{className:"text-[12px] text-gray-700 text-center py-6",children:"No skills saved yet"}):r.jsx("div",{className:"space-y-2.5",children:i.map(k=>{const N=c===k.id;return r.jsxs(H.div,{layout:!0,className:`flex items-center gap-3 p-3.5 rounded-2xl border transition-all ${N?"bg-orange-500/10 border-orange-500/25":"bg-[#0c0f18] border-white/6"}`,children:[r.jsx(ze,{size:14,className:"text-orange-400 shrink-0"}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("p",{className:"font-semibold text-[13px] text-white truncate",children:k.name}),r.jsxs("p",{className:"text-[10px] text-gray-600 mt-0.5",children:[k.runCount,"× run"]})]}),r.jsxs("button",{onClick:()=>j(k),disabled:!!c,className:`flex items-center gap-1.5 px-3 py-1.5 rounded-xl text-[11px] font-semibold transition-all ${N?"bg-orange-500/15 text-orange-400 border border-orange-500/25 cursor-not-allowed":"bg-orange-500/10 border border-orange-500/20 text-orange-400 hover:bg-orange-500/20 disabled:opacity-40 disabled:cursor-not-allowed"}`,children:[N?r.jsx(ne,{size:11,className:"animate-spin"}):r.jsx($s,{size:11}),N?"Running":"Run"]})]},k.id)})})]})]})}function w_(){const[e,t]=h.useState([]),[n,s]=h.useState(!0),[i,a]=h.useState(null);return h.useEffect(()=>{$("/api/workspace/files").then(o=>o.ok?o.json():Promise.reject(`HTTP ${o.status}`)).then(o=>{const l=Array.isArray(o==null?void 0:o.files)?o.files:[];t(l.map(c=>({name:c.name,path:c.rel,size:c.size,modified:c.mtime})))}).catch(o=>a(String(o))).finally(()=>s(!1))},[]),r.jsxs("div",{className:"max-w-4xl mx-auto px-6 py-8",children:[r.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[r.jsx(ps,{size:20,className:"text-orange-400"}),r.jsx("h1",{className:"text-lg font-bold text-white",children:"Files"})]}),n&&r.jsxs("div",{className:"flex items-center gap-2 text-gray-400 text-sm",children:[r.jsx(ne,{size:14,className:"animate-spin"}),"Loading files…"]}),i&&r.jsxs("p",{className:"text-red-400 text-sm",children:["Failed to load files: ",i]}),!n&&!i&&e.length===0&&r.jsx("p",{className:"text-gray-500 text-sm",children:"No files found in workspace."}),!n&&e.length>0&&r.jsx("div",{className:"space-y-1",children:e.map(o=>r.jsxs("div",{className:"flex items-center gap-3 px-4 py-2.5 rounded-lg hover:bg-white/5 transition-colors",children:[r.jsx(Qt,{size:14,className:"text-gray-400 shrink-0"}),r.jsx("span",{className:"text-[13px] text-gray-200 flex-1 truncate",children:o.name}),o.size!==void 0&&r.jsxs("span",{className:"text-[11px] text-gray-500",children:[(o.size/1024).toFixed(1)," KB"]})]},o.path))})]})}const k_=[{value:"all",label:"Tüm Veriler",icon:r.jsx(We,{size:13})},{value:"text",label:"Sadece Metin",icon:r.jsx(Qt,{size:13})},{value:"links",label:"Sadece Linkler",icon:r.jsx(Gr,{size:13})},{value:"images",label:"Sadece Görseller",icon:r.jsx(ef,{size:13})}];function j_(e){return e==="text"?r.jsx(Qt,{size:13,className:"text-orange-400 shrink-0 mt-0.5"}):e==="link"?r.jsx(Gr,{size:13,className:"text-blue-400 shrink-0 mt-0.5"}):r.jsx(ef,{size:13,className:"text-purple-400 shrink-0 mt-0.5"})}function N_(e){return e==="text"?"Metin":e==="link"?"Link":"Görsel"}function S_(){const[e,t]=h.useState(""),[n,s]=h.useState("all"),[i,a]=h.useState(!1),[o,l]=h.useState(null),[c,u]=h.useState(null),[d,p]=h.useState(new Set),[f,m]=h.useState(!1),[b,y]=h.useState(!1),v=(c??[]).filter(k=>n==="all"?!0:k.type===(n==="links"?"link":n==="images"?"image":"text")),g=k=>{p(N=>{const S=new Set(N);return S.has(k)?S.delete(k):S.add(k),S})},x=()=>{d.size===v.length?p(new Set):p(new Set(v.map(k=>k.id)))},w=async()=>{const k=e.trim();if(k){a(!0),l(null),u(null),p(new Set),y(!1);try{const N=await $("/api/browser/scrape",{method:"POST",body:JSON.stringify({url:k,mode:n})}),S=await N.json();if(!N.ok||!S.ok)l(S.error??`Sunucu hatası: ${N.status}`);else{const E=S.items??[];u(E),p(new Set(E.map(P=>P.id)))}}catch{l("Ağ bağlantısı kurulamadı. Backend çalışıyor mu?")}finally{a(!1)}}},j=async()=>{const k=(c??[]).filter(N=>d.has(N.id));if(k.length!==0){m(!0);try{await $("/api/memory/import",{method:"POST",body:JSON.stringify({entries:k.map(N=>({type:N.type,content:N.content,source:e}))})}).catch(()=>{}),y(!0)}finally{m(!1)}}};return r.jsxs("div",{className:"max-w-2xl mx-auto px-4 py-10",children:[r.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[r.jsx("div",{className:"w-10 h-10 rounded-xl flex items-center justify-center shrink-0",style:{background:"rgba(234,88,12,0.15)",border:"1px solid rgba(234,88,12,0.3)"},children:r.jsx(We,{size:18,className:"text-orange-400 animate-pulse"})}),r.jsxs("div",{children:[r.jsx("h1",{className:"text-[17px] font-bold text-white/90 leading-tight",children:"Tarayıcı Otomasyonu"}),r.jsx("p",{className:"text-[12px] text-white/40",children:"Web sayfalarını tara, analiz et ve verileri belleğine kaydet"})]})]}),r.jsxs("div",{className:"rounded-xl px-5 py-4 mb-5",style:{background:"rgba(249,115,22,0.05)",border:"1px solid rgba(249,115,22,0.15)"},children:[r.jsx("p",{className:"text-[13px] font-semibold text-white/80 mb-3 leading-snug",children:"Must-b Otonom Tarayıcı ile internetin gücünü belleğinize katın:"}),r.jsx("ol",{className:"space-y-1.5",children:["Hedef URL'yi girin.","Çıkarmak istediğiniz veri türünü seçin (Metin, Link veya Görsel).","Başlat butonuna basarak Must-b'nin siteyi analiz etmesini bekleyin.","Sonuçları inceleyin ve kalıcı hafızaya kaydetmek istediklerinizi seçin."].map((k,N)=>r.jsxs("li",{className:"flex items-start gap-2.5 text-[13px] text-white/80 leading-relaxed",children:[r.jsx("span",{className:"flex items-center justify-center w-5 h-5 rounded-full text-[10px] font-black shrink-0 mt-0.5",style:{background:"rgba(249,115,22,0.25)",color:"#fb923c"},children:N+1}),k]},N))}),r.jsxs("p",{className:"mt-3 text-[11px] text-orange-400/70 flex items-start gap-1.5 leading-relaxed",children:[r.jsx("span",{className:"shrink-0 mt-0.5",children:"🔒"}),r.jsxs("span",{children:[r.jsx("strong",{className:"text-orange-400/90",children:"Güvenlik Notu:"})," ","Tüm işlemler yerel Playwright motorunda gerçekleşir, verileriniz üçüncü taraflara asla iletilmez."]})]})]}),r.jsxs("div",{className:"rounded-2xl p-5 mb-4",style:{background:"rgba(13,7,3,0.80)",border:"1px solid rgba(255,255,255,0.10)",backdropFilter:"blur(20px)",boxShadow:"0 8px 40px rgba(0,0,0,0.45)"},children:[r.jsx("label",{className:"block text-[11px] font-bold text-white/40 uppercase tracking-widest mb-2",children:"Hedef URL"}),r.jsxs("div",{className:"flex gap-2 mb-5",children:[r.jsx("input",{type:"url",value:e,onChange:k=>t(k.target.value),onKeyDown:k=>k.key==="Enter"&&!i&&w(),placeholder:"https://example.com",className:"flex-1 px-4 py-2.5 rounded-xl text-[13px] text-white/85 placeholder-white/20 outline-none transition-all",style:{background:"rgba(255,255,255,0.05)",border:"1px solid rgba(255,255,255,0.12)"},onFocus:k=>k.currentTarget.style.borderColor="rgba(249,115,22,0.55)",onBlur:k=>k.currentTarget.style.borderColor="rgba(255,255,255,0.12)"}),r.jsxs("button",{onClick:w,disabled:i||!e.trim(),className:"flex items-center gap-2 px-5 py-2.5 rounded-xl text-[13px] font-semibold transition-all disabled:opacity-40",style:{background:i||!e.trim()?"rgba(249,115,22,0.25)":"rgba(249,115,22,0.85)",color:"#fff",border:"1px solid rgba(249,115,22,0.4)"},children:[i?r.jsx(ne,{size:14,className:"animate-spin"}):r.jsx(Al,{size:14}),i?"Taranıyor…":"Başlat"]})]}),r.jsxs("div",{children:[r.jsx("p",{className:"text-[11px] font-bold text-white/40 uppercase tracking-widest mb-2.5",children:"Çıkarma Modu"}),r.jsx("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-4",children:k_.map(k=>r.jsxs("button",{onClick:()=>s(k.value),className:"flex items-center gap-2 px-3 py-2 rounded-lg text-[12px] font-medium transition-all",style:{background:n===k.value?"rgba(249,115,22,0.18)":"rgba(255,255,255,0.04)",border:n===k.value?"1px solid rgba(249,115,22,0.45)":"1px solid rgba(255,255,255,0.08)",color:n===k.value?"#fb923c":"rgba(255,255,255,0.45)"},children:[k.icon,k.label]},k.value))})]}),i&&r.jsxs("div",{className:"mt-5 flex items-center gap-3 px-4 py-3 rounded-xl",style:{background:"rgba(249,115,22,0.08)",border:"1px solid rgba(249,115,22,0.2)"},children:[r.jsx(ne,{size:15,className:"animate-spin text-orange-400 shrink-0"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-[12px] font-semibold text-orange-300",children:"Sayfa taranıyor…"}),r.jsx("p",{className:"text-[11px] text-white/35 mt-0.5",children:"Playwright sayfayı açıyor ve içerik çıkarılıyor"})]})]}),o&&r.jsxs("div",{className:"mt-5 flex items-start gap-3 px-4 py-3 rounded-xl",style:{background:"rgba(239,68,68,0.08)",border:"1px solid rgba(239,68,68,0.25)"},children:[r.jsx(wt,{size:15,className:"text-red-400 shrink-0 mt-0.5"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-[12px] font-semibold text-red-300",children:"Hata oluştu"}),r.jsx("p",{className:"text-[11px] text-red-400/70 mt-0.5",children:o})]})]})]}),c!==null&&v.length>0&&r.jsxs("div",{className:"rounded-2xl p-5",style:{background:"rgba(13,7,3,0.75)",border:"1px solid rgba(255,255,255,0.10)",backdropFilter:"blur(20px)",boxShadow:"0 8px 40px rgba(0,0,0,0.40)"},children:[r.jsxs("div",{className:"flex items-center justify-between mb-4",children:[r.jsxs("div",{children:[r.jsx("p",{className:"text-[13px] font-bold text-white/85",children:"Çıkarılan Veriler"}),r.jsxs("p",{className:"text-[11px] text-white/35 mt-0.5",children:[v.length," öğe bulundu · ",d.size," seçili"]})]}),r.jsxs("button",{onClick:x,className:"text-[11px] font-medium text-orange-400/80 hover:text-orange-400 transition-colors flex items-center gap-1",children:[r.jsx(dn,{size:12}),d.size===v.length?"Seçimi Kaldır":"Tümünü Seç"]})]}),["text","link","image"].map(k=>{const N=v.filter(S=>S.type===k);return N.length===0?null:r.jsxs("div",{className:"mb-4 last:mb-0",children:[r.jsxs("p",{className:"text-[10px] font-bold uppercase tracking-widest text-white/25 mb-1.5 px-1",children:[N_(k)," (",N.length,")"]}),r.jsx("div",{className:"space-y-1",children:N.map(S=>r.jsxs("label",{className:"flex items-start gap-3 px-3 py-2.5 rounded-lg cursor-pointer transition-all",style:{background:d.has(S.id)?"rgba(249,115,22,0.08)":"rgba(255,255,255,0.03)",border:d.has(S.id)?"1px solid rgba(249,115,22,0.22)":"1px solid rgba(255,255,255,0.06)"},children:[r.jsx("div",{className:"w-4 h-4 rounded flex items-center justify-center shrink-0 mt-0.5 transition-all",style:{background:d.has(S.id)?"rgba(249,115,22,0.8)":"rgba(255,255,255,0.08)",border:d.has(S.id)?"1px solid rgba(249,115,22,0.9)":"1px solid rgba(255,255,255,0.18)"},onClick:()=>g(S.id),children:d.has(S.id)&&r.jsx(zt,{size:10,className:"text-white"})}),j_(S.type),r.jsx("span",{className:"text-[12px] text-white/65 leading-relaxed break-all",children:S.content})]},S.id))})]},k)}),r.jsx("div",{className:"mt-5 pt-4 border-t border-white/8",children:b?r.jsxs("div",{className:"flex items-center justify-center gap-2 py-2.5 rounded-xl text-[13px] font-semibold",style:{background:"rgba(34,197,94,0.12)",border:"1px solid rgba(34,197,94,0.25)",color:"#4ade80"},children:[r.jsx(zt,{size:14}),d.size," öğe belleğe kaydedildi"]}):r.jsx("button",{onClick:j,disabled:f||d.size===0,className:"w-full flex items-center justify-center gap-2 py-2.5 rounded-xl text-[13px] font-semibold transition-all disabled:opacity-40",style:{background:"rgba(249,115,22,0.18)",border:"1px solid rgba(249,115,22,0.35)",color:"#fb923c"},children:f?r.jsxs(r.Fragment,{children:[r.jsx(ne,{size:14,className:"animate-spin"})," Kaydediliyor…"]}):r.jsxs(r.Fragment,{children:[r.jsx(ev,{size:14})," Seçilenleri Belleğe Kaydet (",d.size,")"]})})})]}),c!==null&&v.length===0&&r.jsx("div",{className:"text-center py-10 text-[13px] text-white/25",children:"Bu modda çıkarılacak veri bulunamadı."})]})}function C_(e){return e.replace(/hey\s+must\s*-?\s*be\b/gi,"Hey Must-b").replace(/hey\s+mustbe\b/gi,"Hey Must-b").replace(/hey\s+most\s+be\b/gi,"Hey Must-b").replace(/hey\s+must\s+b\b/gi,"Hey Must-b").replace(/hey\s+must\s+bee\b/gi,"Hey Must-b").replace(/hay\s+mas+bi\b/gi,"Hey Must-b").replace(/hey\s+mas+bi\b/gi,"Hey Must-b").replace(/hey\s+mast\s*b[ei]?\b/gi,"Hey Must-b").replace(/hey\s+m[au]s[t]?\s*b[ei]?\b/gi,"Hey Must-b").replace(/hey\s+must\s*b[eiy]+\b/gi,"Hey Must-b").replace(/hey\s+moos+\s*b[ei]?\b/gi,"Hey Must-b")}function E_(e){const t=window.speechSynthesis.getVoices(),n=e.toLowerCase();return t.find(s=>s.name.toLowerCase().includes("google")&&s.lang.toLowerCase().startsWith(n))||t.find(s=>s.lang.toLowerCase().startsWith(n)&&!s.localService)||t.find(s=>s.lang.toLowerCase().startsWith(n))||null}function __(){const e=mn(),{t,locale:n}=pt(),[s,i]=h.useState("wake-listening"),[a,o]=h.useState("Must-b"),[l,c]=h.useState(""),[u,d]=h.useState(""),p=h.useRef(null),f=h.useRef(!1),m=h.useRef(""),b=h.useRef(null),y=h.useRef("wake-listening");h.useEffect(()=>{y.current=s},[s]),h.useEffect(()=>{$("/api/identity").then(N=>N.json()).then(N=>{N.name&&o(N.name)}).catch(()=>{})},[]);const v=h.useCallback(N=>{if(!window.speechSynthesis)return;window.speechSynthesis.cancel();const S=new SpeechSynthesisUtterance(N),E=n==="tr"?"tr-TR":n==="de"?"de-DE":n==="fr"?"fr-FR":n==="es"?"es-ES":n==="ja"?"ja-JP":n==="zh"?"zh-CN":n==="pt"?"pt-PT":"en-US";S.lang=E,S.rate=1.05,S.pitch=1;const P=()=>{const M=E_(E.split("-")[0]);M&&(S.voice=M)};P(),!S.voice&&window.speechSynthesis.onvoiceschanged!==void 0&&(window.speechSynthesis.onvoiceschanged=P),S.onend=()=>{i("wake-listening"),d(""),c("")},S.onerror=()=>i("wake-listening"),i("speaking"),window.speechSynthesis.speak(S)},[n]),g=h.useCallback(async N=>{if(!N.trim()){i("wake-listening");return}i("thinking"),c(N);try{const E=await(await $("/api/goal",{method:"POST",body:JSON.stringify({goal:N,voice:!0})})).json(),P=E.result??E.reply??E.response??E.output??"Done.";d(P),v(P)}catch{i("wake-listening")}},[v]),x=h.useCallback(()=>{const N=window.SpeechRecognition||window.webkitSpeechRecognition;if(!N||!f.current)return;const S=new N;S.continuous=!0,S.interimResults=!0,S.lang=n==="tr"?"tr-TR":"en-US",S.onresult=E=>{var V,R;let P="";for(let I=E.resultIndex;I<E.results.length;I++)P+=E.results[I][0].transcript;const M=C_(P),T=y.current;if(c(M),T==="wake-listening"){const I=`hey ${a}`.toLowerCase();if(M.toLowerCase().includes(I)){const L=((V=M.toLowerCase().split(I)[1])==null?void 0:V.trim())??"";m.current=L,i("cmd-listening"),b.current&&clearTimeout(b.current),b.current=setTimeout(()=>{if(m.current.trim()&&y.current==="cmd-listening"){const z=m.current;m.current="",g(z)}},1800)}}else if(T==="cmd-listening"){const I=`hey ${a}`.toLowerCase(),L=M.toLowerCase().includes(I)?((R=M.toLowerCase().split(I)[1])==null?void 0:R.trim())??M:M;m.current=L,b.current&&clearTimeout(b.current),b.current=setTimeout(()=>{if(m.current.trim()&&y.current==="cmd-listening"){const z=m.current;m.current="",g(z)}},2200)}},S.onend=()=>{const E=y.current;f.current&&E!=="thinking"&&E!=="speaking"?setTimeout(x,200):f.current||(i("off"),p.current=null)},S.onerror=E=>{E.error!=="no-speech"&&i("wake-listening"),f.current&&E.error!=="not-allowed"&&setTimeout(x,600)},p.current=S;try{S.start()}catch{}},[a,n,g]),w=()=>{var N,S;s!=="off"?(f.current=!1,(N=p.current)==null||N.stop(),(S=window.speechSynthesis)==null||S.cancel(),b.current&&clearTimeout(b.current),i("off"),c("")):(f.current=!0,i("wake-listening"),x())};h.useEffect(()=>(f.current=!0,i("wake-listening"),x(),()=>{var N,S;f.current=!1,(N=p.current)==null||N.stop(),(S=window.speechSynthesis)==null||S.cancel(),b.current&&clearTimeout(b.current)}),[]);const j=s==="wake-listening"||s==="cmd-listening",k=s==="off";return r.jsxs("div",{className:"fixed inset-0 flex flex-col items-center justify-center overflow-hidden",style:{background:"radial-gradient(ellipse at 50% 45%, rgba(249,115,22,0.22) 0%, #060301 55%)"},children:[r.jsxs("button",{onClick:()=>e("/app"),className:"absolute top-20 left-6 flex items-center gap-2 px-3 py-2 rounded-xl text-white/40 hover:text-white/80 hover:bg-white/8 transition-all text-[13px] font-medium z-10",children:[r.jsx(eC,{size:15}),r.jsx("span",{children:t.voice.back})]}),r.jsx("p",{className:"absolute top-6 text-[12px] font-bold text-white/25 tracking-[0.18em] uppercase select-none",children:t.voice.title}),[200,290,380].map((N,S)=>r.jsx(H.div,{className:"absolute rounded-full",style:{width:N,height:N,border:`1px solid rgba(249,115,22,${.12-S*.03})`},animate:j?{opacity:[.4,.7,.4],scale:[1,1.04,1]}:{opacity:.2,scale:1},transition:{duration:2.2+S*.6,repeat:1/0,ease:"easeInOut",delay:S*.4}},N)),r.jsx(H.button,{onClick:w,className:"relative w-36 h-36 rounded-full flex items-center justify-center cursor-pointer select-none mb-10",style:{background:j?"radial-gradient(circle at 38% 32%, rgba(249,115,22,0.92), rgba(160,55,8,0.75))":"radial-gradient(circle at 38% 32%, rgba(249,115,22,0.38), rgba(22,10,3,0.88))",border:`1px solid rgba(249,115,22,${j?.5:.28})`,boxShadow:j?"0 0 70px rgba(249,115,22,0.55), 0 0 140px rgba(249,115,22,0.18), inset 0 1px 0 rgba(255,255,255,0.12)":"0 0 30px rgba(249,115,22,0.12), inset 0 1px 0 rgba(255,255,255,0.05)"},animate:j?{scale:[1,1.06,1]}:{scale:1},transition:{duration:1.6,repeat:j?1/0:0,ease:"easeInOut"},whileHover:{scale:1.04},whileTap:{scale:.95},children:s==="thinking"?r.jsx(H.div,{animate:{rotate:360},transition:{duration:1,repeat:1/0,ease:"linear"},className:"w-10 h-10 rounded-full border-2 border-orange-500/30 border-t-orange-400"}):s==="speaking"?r.jsx(H.span,{animate:{scale:[.9,1.1,.9]},transition:{duration:.7,repeat:1/0,ease:"easeInOut"},className:"text-4xl",children:"🔊"}):s==="cmd-listening"?r.jsx(H.span,{animate:{opacity:[.6,1,.6]},transition:{duration:.5,repeat:1/0},children:r.jsx(Ds,{size:38,className:"text-white/95"})}):k?r.jsx(Ds,{size:38,className:"text-orange-300/90"}):r.jsx(nf,{size:38,className:"text-white/90"})}),r.jsx(se,{mode:"wait",children:r.jsxs(H.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},className:"flex flex-col items-center gap-3 px-6 text-center",children:[s==="thinking"&&r.jsx("p",{className:"text-[17px] font-medium text-white/65",children:t.voice.thinking}),s==="speaking"&&r.jsxs(r.Fragment,{children:[r.jsx("p",{className:"text-[17px] font-medium text-orange-300",children:t.voice.speakingHint}),u&&r.jsxs("p",{className:"text-[12px] text-white/35 italic max-w-sm line-clamp-3",children:["“",u.slice(0,140),u.length>140?"…":"","”"]})]}),s==="cmd-listening"&&r.jsxs(r.Fragment,{children:[r.jsx("p",{className:"text-[17px] font-medium text-white/75",children:t.voice.cmdHint}),l&&r.jsxs("p",{className:"text-[13px] text-white/40 italic max-w-sm",children:["“",l,"”"]})]}),s==="wake-listening"&&r.jsxs(r.Fragment,{children:[r.jsx("p",{className:"text-[17px] font-medium text-white/65",children:t.voice.wakeHint}),l&&r.jsxs("p",{className:"text-[13px] text-white/35 italic max-w-sm",children:["“",l,"”"]}),r.jsx("p",{className:"text-[11px] text-white/25",children:t.voice.stopHint})]}),s==="off"&&r.jsx("p",{className:"text-[17px] font-medium text-white/40",children:t.voice.tapHint}),j&&r.jsx("div",{className:"flex items-center gap-1 mt-1",children:[0,1,2,3,4].map(N=>r.jsx(H.div,{className:"w-0.5 rounded-full bg-orange-500/60",animate:{height:["6px","18px","6px"]},transition:{duration:.8,repeat:1/0,delay:N*.12,ease:"easeInOut"}},N))})]},s)})]})}function T_({id:e,size:t=16}){const n="shrink-0";switch(e){case"telegram":return r.jsx(hv,{size:t,className:n});case"whatsapp":return r.jsx(vo,{size:t,className:n});case"discord":return r.jsx(a0,{size:t,className:n});case"slack":return r.jsx(a0,{size:t,className:n});case"signal":return r.jsx(fv,{size:t,className:n});case"imessage":case"bluebubbles":return r.jsx(Os,{size:t,className:n});case"line":return r.jsx(Os,{size:t,className:n});case"msteams":return r.jsx(ud,{size:t,className:n});case"matrix":case"mattermost":case"irc":case"nextcloud-talk":return r.jsx(rl,{size:t,className:n});case"voice-call":case"talk-voice":case"phone-control":return r.jsx(PC,{size:t,className:n});case"twitch":return r.jsx(BC,{size:t,className:n});case"nostr":return r.jsx(rf,{size:t,className:n});case"googlechat":return r.jsx(vo,{size:t,className:n});case"feishu":return r.jsx(rC,{size:t,className:n});case"tlon":return r.jsx(We,{size:t,className:n});case"zalo":case"zalouser":return r.jsx(vo,{size:t,className:n});case"synology-chat":return r.jsx(vC,{size:t,className:n});case"lobster":return r.jsx(Ds,{size:t,className:n});case"memory-lancedb":case"memory-core":return r.jsx(va,{size:t,className:n});case"ollama":case"sglang":case"vllm":case"copilot-proxy":return r.jsx(fn,{size:t,className:n});case"open-prose":return r.jsx(Pl,{size:t,className:n});default:return r.jsx(MC,{size:t,className:n})}}function P_({ext:e}){var n,s,i;return e.active?r.jsxs("span",{className:"flex items-center gap-1.5 px-2 py-0.5 rounded-full text-[10px] font-bold border bg-green-500/10 border-green-500/25 text-green-400",children:[r.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-green-400 animate-pulse"}),"Active"]}):((n=e.loadError)==null?void 0:n.includes("Cannot find module"))||((s=e.loadError)==null?void 0:s.includes("MODULE_NOT_FOUND"))||((i=e.loadError)==null?void 0:i.includes("ERR_MODULE_NOT_FOUND"))?r.jsxs("span",{className:"flex items-center gap-1.5 px-2 py-0.5 rounded-full text-[10px] font-bold border bg-white/4 border-white/10 text-gray-500",children:[r.jsx(EC,{size:9,className:"shrink-0"}),"Missing Deps"]}):e.loadError?r.jsxs("span",{className:"flex items-center gap-1.5 px-2 py-0.5 rounded-full text-[10px] font-bold border bg-amber-500/8 border-amber-500/20 text-amber-500",children:[r.jsx(wt,{size:9,className:"shrink-0"}),"Error"]}):r.jsxs("span",{className:"flex items-center gap-1.5 px-2 py-0.5 rounded-full text-[10px] font-bold border bg-white/4 border-white/10 text-gray-500",children:[r.jsx(Pt,{size:9,className:"shrink-0"}),"Deferred"]})}function M_({ext:e}){var i;const t=((i=e.channel)==null?void 0:i.label)??e.id,n=e.active?"text-orange-400":"text-white/30",s=e.active?"border-orange-500/20 hover:border-orange-500/35":"border-white/6 hover:border-white/10";return r.jsxs("div",{className:`group relative flex flex-col gap-3 p-4 rounded-2xl bg-white/[0.025] border transition-all ${s}`,children:[r.jsxs("div",{className:"flex items-start justify-between gap-2",children:[r.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[r.jsx("div",{className:`w-9 h-9 rounded-xl flex items-center justify-center shrink-0 ${e.active?"bg-orange-500/12 border border-orange-500/20":"bg-white/4 border border-white/8"}`,children:r.jsx("span",{className:n,children:r.jsx(T_,{id:e.id,size:16})})}),r.jsxs("div",{className:"min-w-0",children:[r.jsx("p",{className:"text-[13px] font-semibold text-white/85 truncate leading-tight",children:t}),r.jsxs("p",{className:"text-[10px] text-gray-600 mt-0.5 font-mono",children:["v",e.version]})]})]}),r.jsx(P_,{ext:e})]}),e.description&&r.jsx("p",{className:"text-[11px] text-gray-500 leading-relaxed line-clamp-2",children:e.description}),!e.active&&e.loadError&&!e.loadError.includes("Cannot find module")&&r.jsx("p",{className:"text-[10px] text-amber-600/80 font-mono truncate border-t border-white/5 pt-2",children:e.loadError.slice(0,80)})]})}function z0({title:e,items:t}){if(t.length===0)return null;const n=t.filter(s=>s.active).length;return r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("h2",{className:"text-[11px] font-bold text-white/40 uppercase tracking-widest",children:e}),r.jsxs("span",{className:"text-[10px] text-gray-600",children:[t.length," total"]}),n>0&&r.jsxs("span",{className:"text-[10px] text-green-500 font-semibold",children:[n," active"]})]}),r.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",children:t.map(s=>r.jsx(M_,{ext:s},s.id))})]})}function A_(){return r.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",children:Array.from({length:9}).map((e,t)=>r.jsx("div",{className:"h-[100px] rounded-2xl bg-white/[0.025] border border-white/6 animate-pulse"},t))})}function R_(){const[e,t]=h.useState(null),[n,s]=h.useState(!0),[i,a]=h.useState(null),o=h.useCallback(async()=>{s(!0),a(null);try{const p=await $("/api/extensions");if(!p.ok)throw new Error(`HTTP ${p.status}`);t(await p.json())}catch(p){a(String(p))}finally{s(!1)}},[]);h.useEffect(()=>{o()},[o]);const l=(e==null?void 0:e.extensions.filter(p=>p.channel!==null).sort((p,f)=>{var m,b;return(((m=p.channel)==null?void 0:m.order)??99)-(((b=f.channel)==null?void 0:b.order)??99)}))??[],c=(e==null?void 0:e.extensions.filter(p=>p.channel===null))??[],u=(e==null?void 0:e.loaded)??0,d=(e==null?void 0:e.catalogSize)??0;return r.jsxs("div",{className:"flex-1 overflow-y-auto p-6 space-y-6",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:"w-8 h-8 rounded-xl bg-orange-500/15 border border-orange-500/25 flex items-center justify-center",children:r.jsx(rf,{size:16,className:"text-orange-400"})}),r.jsxs("div",{children:[r.jsx("h1",{className:"text-xl font-bold text-white",children:"Channels & Extensions"}),r.jsxs("p",{className:"text-[11px] text-gray-500",children:["Phase B — ",d," extensions discovered"]})]})]}),r.jsxs("div",{className:"flex items-center gap-3",children:[e&&r.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 rounded-xl bg-white/[0.025] border border-white/8",children:[u>0?r.jsxs(r.Fragment,{children:[r.jsx(Ve,{size:13,className:"text-green-400 shrink-0"}),r.jsxs("span",{className:"text-[11px] font-semibold text-green-400",children:[u," active"]})]}):r.jsxs(r.Fragment,{children:[r.jsx(Pt,{size:13,className:"text-gray-500 shrink-0"}),r.jsx("span",{className:"text-[11px] font-semibold text-gray-500",children:"0 active"})]}),r.jsx("span",{className:"text-white/15",children:"·"}),r.jsxs("span",{className:"text-[11px] text-gray-600",children:[d-u," deferred"]})]}),r.jsxs("button",{onClick:o,disabled:n,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-xl bg-white/4 border border-white/8 text-gray-400 hover:text-white/80 hover:bg-white/6 hover:border-white/12 transition-all text-[11px] font-medium disabled:opacity-40",children:[r.jsx(de,{size:12,className:n?"animate-spin":""}),"Refresh"]})]})]}),!n&&e&&u===0&&r.jsxs("div",{className:"flex items-start gap-3 p-4 rounded-xl bg-amber-500/5 border border-amber-500/15",children:[r.jsx(wt,{size:15,className:"text-amber-500 shrink-0 mt-0.5"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-[12px] font-semibold text-amber-400",children:"Extensions deferred — dependencies not installed"}),r.jsxs("p",{className:"text-[11px] text-amber-600/80 mt-0.5",children:["Channel extensions require their SDK packages (e.g. ",r.jsx("code",{className:"font-mono",children:"must-b/plugin-sdk/*"}),") and memory-lancedb requires ",r.jsx("code",{className:"font-mono",children:"@lancedb/lancedb"}),". The ExtensionLoader catalog is ready — install dependencies to activate extensions at next boot."]})]})]}),n&&!e&&r.jsx(A_,{}),i&&r.jsxs("div",{className:"flex items-center gap-3 p-4 rounded-xl bg-red-500/8 border border-red-500/15",children:[r.jsx(wt,{size:15,className:"text-red-400 shrink-0"}),r.jsx("p",{className:"text-[12px] text-red-400",children:i})]}),e&&r.jsxs("div",{className:"space-y-8",children:[r.jsx(z0,{title:"Messaging Channels",items:l}),r.jsx(z0,{title:"System Plugins",items:c})]})]})}function ts(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function L0(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function pf(...e){return t=>{let n=!1;const s=e.map(i=>{const a=L0(i,t);return!n&&typeof a=="function"&&(n=!0),a});if(n)return()=>{for(let i=0;i<s.length;i++){const a=s[i];typeof a=="function"?a():L0(e[i],null)}}}}function Ws(...e){return h.useCallback(pf(...e),e)}function z_(e,t){const n=h.createContext(t),s=a=>{const{children:o,...l}=a,c=h.useMemo(()=>l,Object.values(l));return r.jsx(n.Provider,{value:c,children:o})};s.displayName=e+"Provider";function i(a){const o=h.useContext(n);if(o)return o;if(t!==void 0)return t;throw new Error(`\`${a}\` must be used within \`${e}\``)}return[s,i]}function L_(e,t=[]){let n=[];function s(a,o){const l=h.createContext(o),c=n.length;n=[...n,o];const u=p=>{var g;const{scope:f,children:m,...b}=p,y=((g=f==null?void 0:f[e])==null?void 0:g[c])||l,v=h.useMemo(()=>b,Object.values(b));return r.jsx(y.Provider,{value:v,children:m})};u.displayName=a+"Provider";function d(p,f){var y;const m=((y=f==null?void 0:f[e])==null?void 0:y[c])||l,b=h.useContext(m);if(b)return b;if(o!==void 0)return o;throw new Error(`\`${p}\` must be used within \`${a}\``)}return[u,d]}const i=()=>{const a=n.map(o=>h.createContext(o));return function(l){const c=(l==null?void 0:l[e])||a;return h.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return i.scopeName=e,[s,O_(i,...t)]}function O_(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const s=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(a){const o=s.reduce((l,{useScope:c,scopeName:u})=>{const p=c(a)[`__scope${u}`];return{...l,...p}},{});return h.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}var la=globalThis!=null&&globalThis.document?h.useLayoutEffect:()=>{},D_=Nd[" useId ".trim().toString()]||(()=>{}),I_=0;function Fc(e){const[t,n]=h.useState(D_());return la(()=>{n(s=>s??String(I_++))},[e]),e||(t?`radix-${t}`:"")}var B_=Nd[" useInsertionEffect ".trim().toString()]||la;function F_({prop:e,defaultProp:t,onChange:n=()=>{},caller:s}){const[i,a,o]=V_({defaultProp:t,onChange:n}),l=e!==void 0,c=l?e:i;{const d=h.useRef(e!==void 0);h.useEffect(()=>{const p=d.current;p!==l&&console.warn(`${s} is changing from ${p?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),d.current=l},[l,s])}const u=h.useCallback(d=>{var p;if(l){const f=$_(d)?d(e):d;f!==e&&((p=o.current)==null||p.call(o,f))}else a(d)},[l,e,a,o]);return[c,u]}function V_({defaultProp:e,onChange:t}){const[n,s]=h.useState(e),i=h.useRef(n),a=h.useRef(t);return B_(()=>{a.current=t},[t]),h.useEffect(()=>{var o;i.current!==n&&((o=a.current)==null||o.call(a,n),i.current=n)},[n,i]),[n,s,a]}function $_(e){return typeof e=="function"}function U_(e){const t=H_(e),n=h.forwardRef((s,i)=>{const{children:a,...o}=s,l=h.Children.toArray(a),c=l.find(K_);if(c){const u=c.props.children,d=l.map(p=>p===c?h.Children.count(u)>1?h.Children.only(null):h.isValidElement(u)?u.props.children:null:p);return r.jsx(t,{...o,ref:i,children:h.isValidElement(u)?h.cloneElement(u,void 0,d):null})}return r.jsx(t,{...o,ref:i,children:a})});return n.displayName=`${e}.Slot`,n}function H_(e){const t=h.forwardRef((n,s)=>{const{children:i,...a}=n;if(h.isValidElement(i)){const o=q_(i),l=G_(a,i.props);return i.type!==h.Fragment&&(l.ref=s?pf(s,o):o),h.cloneElement(i,l)}return h.Children.count(i)>1?h.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var W_=Symbol("radix.slottable");function K_(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===W_}function G_(e,t){const n={...t};for(const s in t){const i=e[s],a=t[s];/^on[A-Z]/.test(s)?i&&a?n[s]=(...l)=>{const c=a(...l);return i(...l),c}:i&&(n[s]=i):s==="style"?n[s]={...i,...a}:s==="className"&&(n[s]=[i,a].filter(Boolean).join(" "))}return{...e,...n}}function q_(e){var s,i;let t=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Y_=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Mn=Y_.reduce((e,t)=>{const n=U_(`Primitive.${t}`),s=h.forwardRef((i,a)=>{const{asChild:o,...l}=i,c=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),r.jsx(c,{...l,ref:a})});return s.displayName=`Primitive.${t}`,{...e,[t]:s}},{});function X_(e,t){e&&mh.flushSync(()=>e.dispatchEvent(t))}function ca(e){const t=h.useRef(e);return h.useEffect(()=>{t.current=e}),h.useMemo(()=>(...n)=>{var s;return(s=t.current)==null?void 0:s.call(t,...n)},[])}function Q_(e,t=globalThis==null?void 0:globalThis.document){const n=ca(e);h.useEffect(()=>{const s=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",s,{capture:!0}),()=>t.removeEventListener("keydown",s,{capture:!0})},[n,t])}var J_="DismissableLayer",yd="dismissableLayer.update",Z_="dismissableLayer.pointerDownOutside",eT="dismissableLayer.focusOutside",O0,Lv=h.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ov=h.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:l,...c}=e,u=h.useContext(Lv),[d,p]=h.useState(null),f=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,m]=h.useState({}),b=Ws(t,S=>p(S)),y=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),g=y.indexOf(v),x=d?y.indexOf(d):-1,w=u.layersWithOutsidePointerEventsDisabled.size>0,j=x>=g,k=sT(S=>{const E=S.target,P=[...u.branches].some(M=>M.contains(E));!j||P||(i==null||i(S),o==null||o(S),S.defaultPrevented||l==null||l())},f),N=rT(S=>{const E=S.target;[...u.branches].some(M=>M.contains(E))||(a==null||a(S),o==null||o(S),S.defaultPrevented||l==null||l())},f);return Q_(S=>{x===u.layers.size-1&&(s==null||s(S),!S.defaultPrevented&&l&&(S.preventDefault(),l()))},f),h.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(O0=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),D0(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=O0)}},[d,f,n,u]),h.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),D0())},[d,u]),h.useEffect(()=>{const S=()=>m({});return document.addEventListener(yd,S),()=>document.removeEventListener(yd,S)},[]),r.jsx(Mn.div,{...c,ref:b,style:{pointerEvents:w?j?"auto":"none":void 0,...e.style},onFocusCapture:ts(e.onFocusCapture,N.onFocusCapture),onBlurCapture:ts(e.onBlurCapture,N.onBlurCapture),onPointerDownCapture:ts(e.onPointerDownCapture,k.onPointerDownCapture)})});Ov.displayName=J_;var tT="DismissableLayerBranch",nT=h.forwardRef((e,t)=>{const n=h.useContext(Lv),s=h.useRef(null),i=Ws(t,s);return h.useEffect(()=>{const a=s.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),r.jsx(Mn.div,{...e,ref:i})});nT.displayName=tT;function sT(e,t=globalThis==null?void 0:globalThis.document){const n=ca(e),s=h.useRef(!1),i=h.useRef(()=>{});return h.useEffect(()=>{const a=l=>{if(l.target&&!s.current){let c=function(){Dv(Z_,n,u,{discrete:!0})};const u={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=c,t.addEventListener("click",i.current,{once:!0})):c()}else t.removeEventListener("click",i.current);s.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",a),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>s.current=!0}}function rT(e,t=globalThis==null?void 0:globalThis.document){const n=ca(e),s=h.useRef(!1);return h.useEffect(()=>{const i=a=>{a.target&&!s.current&&Dv(eT,n,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>s.current=!0,onBlurCapture:()=>s.current=!1}}function D0(){const e=new CustomEvent(yd);document.dispatchEvent(e)}function Dv(e,t,n,{discrete:s}){const i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),s?X_(i,a):i.dispatchEvent(a)}var Vc="focusScope.autoFocusOnMount",$c="focusScope.autoFocusOnUnmount",I0={bubbles:!1,cancelable:!0},iT="FocusScope",Iv=h.forwardRef((e,t)=>{const{loop:n=!1,trapped:s=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[l,c]=h.useState(null),u=ca(i),d=ca(a),p=h.useRef(null),f=Ws(t,y=>c(y)),m=h.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;h.useEffect(()=>{if(s){let y=function(w){if(m.paused||!l)return;const j=w.target;l.contains(j)?p.current=j:Dn(p.current,{select:!0})},v=function(w){if(m.paused||!l)return;const j=w.relatedTarget;j!==null&&(l.contains(j)||Dn(p.current,{select:!0}))},g=function(w){if(document.activeElement===document.body)for(const k of w)k.removedNodes.length>0&&Dn(l)};document.addEventListener("focusin",y),document.addEventListener("focusout",v);const x=new MutationObserver(g);return l&&x.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",y),document.removeEventListener("focusout",v),x.disconnect()}}},[s,l,m.paused]),h.useEffect(()=>{if(l){F0.add(m);const y=document.activeElement;if(!l.contains(y)){const g=new CustomEvent(Vc,I0);l.addEventListener(Vc,u),l.dispatchEvent(g),g.defaultPrevented||(aT(dT(Bv(l)),{select:!0}),document.activeElement===y&&Dn(l))}return()=>{l.removeEventListener(Vc,u),setTimeout(()=>{const g=new CustomEvent($c,I0);l.addEventListener($c,d),l.dispatchEvent(g),g.defaultPrevented||Dn(y??document.body,{select:!0}),l.removeEventListener($c,d),F0.remove(m)},0)}}},[l,u,d,m]);const b=h.useCallback(y=>{if(!n&&!s||m.paused)return;const v=y.key==="Tab"&&!y.altKey&&!y.ctrlKey&&!y.metaKey,g=document.activeElement;if(v&&g){const x=y.currentTarget,[w,j]=oT(x);w&&j?!y.shiftKey&&g===j?(y.preventDefault(),n&&Dn(w,{select:!0})):y.shiftKey&&g===w&&(y.preventDefault(),n&&Dn(j,{select:!0})):g===x&&y.preventDefault()}},[n,s,m.paused]);return r.jsx(Mn.div,{tabIndex:-1,...o,ref:f,onKeyDown:b})});Iv.displayName=iT;function aT(e,{select:t=!1}={}){const n=document.activeElement;for(const s of e)if(Dn(s,{select:t}),document.activeElement!==n)return}function oT(e){const t=Bv(e),n=B0(t,e),s=B0(t.reverse(),e);return[n,s]}function Bv(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:s=>{const i=s.tagName==="INPUT"&&s.type==="hidden";return s.disabled||s.hidden||i?NodeFilter.FILTER_SKIP:s.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function B0(e,t){for(const n of e)if(!lT(n,{upTo:t}))return n}function lT(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function cT(e){return e instanceof HTMLInputElement&&"select"in e}function Dn(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&cT(e)&&t&&e.select()}}var F0=uT();function uT(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=V0(e,t),e.unshift(t)},remove(t){var n;e=V0(e,t),(n=e[0])==null||n.resume()}}}function V0(e,t){const n=[...e],s=n.indexOf(t);return s!==-1&&n.splice(s,1),n}function dT(e){return e.filter(t=>t.tagName!=="A")}var hT="Portal",Fv=h.forwardRef((e,t)=>{var l;const{container:n,...s}=e,[i,a]=h.useState(!1);la(()=>a(!0),[]);const o=n||i&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return o?dy.createPortal(r.jsx(Mn.div,{...s,ref:t}),o):null});Fv.displayName=hT;function fT(e,t){return h.useReducer((n,s)=>t[n][s]??n,e)}var Il=e=>{const{present:t,children:n}=e,s=pT(t),i=typeof n=="function"?n({present:s.isPresent}):h.Children.only(n),a=Ws(s.ref,mT(i));return typeof n=="function"||s.isPresent?h.cloneElement(i,{ref:a}):null};Il.displayName="Presence";function pT(e){const[t,n]=h.useState(),s=h.useRef(null),i=h.useRef(e),a=h.useRef("none"),o=e?"mounted":"unmounted",[l,c]=fT(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return h.useEffect(()=>{const u=Qa(s.current);a.current=l==="mounted"?u:"none"},[l]),la(()=>{const u=s.current,d=i.current;if(d!==e){const f=a.current,m=Qa(u);e?c("MOUNT"):m==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(d&&f!==m?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,c]),la(()=>{if(t){let u;const d=t.ownerDocument.defaultView??window,p=m=>{const y=Qa(s.current).includes(CSS.escape(m.animationName));if(m.target===t&&y&&(c("ANIMATION_END"),!i.current)){const v=t.style.animationFillMode;t.style.animationFillMode="forwards",u=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=v)})}},f=m=>{m.target===t&&(a.current=Qa(s.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{d.clearTimeout(u),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:h.useCallback(u=>{s.current=u?getComputedStyle(u):null,n(u)},[])}}function Qa(e){return(e==null?void 0:e.animationName)||"none"}function mT(e){var s,i;let t=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Uc=0;function gT(){h.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??$0()),document.body.insertAdjacentElement("beforeend",e[1]??$0()),Uc++,()=>{Uc===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Uc--}},[])}function $0(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var rn=function(){return rn=Object.assign||function(t){for(var n,s=1,i=arguments.length;s<i;s++){n=arguments[s];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},rn.apply(this,arguments)};function Vv(e,t){var n={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0&&(n[s]=e[s]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,s=Object.getOwnPropertySymbols(e);i<s.length;i++)t.indexOf(s[i])<0&&Object.prototype.propertyIsEnumerable.call(e,s[i])&&(n[s[i]]=e[s[i]]);return n}function xT(e,t,n){if(n||arguments.length===2)for(var s=0,i=t.length,a;s<i;s++)(a||!(s in t))&&(a||(a=Array.prototype.slice.call(t,0,s)),a[s]=t[s]);return e.concat(a||Array.prototype.slice.call(t))}var No="right-scroll-bar-position",So="width-before-scroll-bar",yT="with-scroll-bars-hidden",vT="--removed-body-scroll-bar-size";function Hc(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function bT(e,t){var n=h.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(s){var i=n.value;i!==s&&(n.value=s,n.callback(s,i))}}}})[0];return n.callback=t,n.facade}var wT=typeof window<"u"?h.useLayoutEffect:h.useEffect,U0=new WeakMap;function kT(e,t){var n=bT(null,function(s){return e.forEach(function(i){return Hc(i,s)})});return wT(function(){var s=U0.get(n);if(s){var i=new Set(s),a=new Set(e),o=n.current;i.forEach(function(l){a.has(l)||Hc(l,null)}),a.forEach(function(l){i.has(l)||Hc(l,o)})}U0.set(n,e)},[e]),n}function jT(e){return e}function NT(e,t){t===void 0&&(t=jT);var n=[],s=!1,i={read:function(){if(s)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(a){var o=t(a,s);return n.push(o),function(){n=n.filter(function(l){return l!==o})}},assignSyncMedium:function(a){for(s=!0;n.length;){var o=n;n=[],o.forEach(a)}n={push:function(l){return a(l)},filter:function(){return n}}},assignMedium:function(a){s=!0;var o=[];if(n.length){var l=n;n=[],l.forEach(a),o=n}var c=function(){var d=o;o=[],d.forEach(a)},u=function(){return Promise.resolve().then(c)};u(),n={push:function(d){o.push(d),u()},filter:function(d){return o=o.filter(d),n}}}};return i}function ST(e){e===void 0&&(e={});var t=NT(null);return t.options=rn({async:!0,ssr:!1},e),t}var $v=function(e){var t=e.sideCar,n=Vv(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var s=t.read();if(!s)throw new Error("Sidecar medium not found");return h.createElement(s,rn({},n))};$v.isSideCarExport=!0;function CT(e,t){return e.useMedium(t),$v}var Uv=ST(),Wc=function(){},Bl=h.forwardRef(function(e,t){var n=h.useRef(null),s=h.useState({onScrollCapture:Wc,onWheelCapture:Wc,onTouchMoveCapture:Wc}),i=s[0],a=s[1],o=e.forwardProps,l=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,p=e.shards,f=e.sideCar,m=e.noRelative,b=e.noIsolation,y=e.inert,v=e.allowPinchZoom,g=e.as,x=g===void 0?"div":g,w=e.gapMode,j=Vv(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),k=f,N=kT([n,t]),S=rn(rn({},j),i);return h.createElement(h.Fragment,null,d&&h.createElement(k,{sideCar:Uv,removeScrollBar:u,shards:p,noRelative:m,noIsolation:b,inert:y,setCallbacks:a,allowPinchZoom:!!v,lockRef:n,gapMode:w}),o?h.cloneElement(h.Children.only(l),rn(rn({},S),{ref:N})):h.createElement(x,rn({},S,{className:c,ref:N}),l))});Bl.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Bl.classNames={fullWidth:So,zeroRight:No};var ET=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function _T(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=ET();return t&&e.setAttribute("nonce",t),e}function TT(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function PT(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var MT=function(){var e=0,t=null;return{add:function(n){e==0&&(t=_T())&&(TT(t,n),PT(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},AT=function(){var e=MT();return function(t,n){h.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Hv=function(){var e=AT(),t=function(n){var s=n.styles,i=n.dynamic;return e(s,i),null};return t},RT={left:0,top:0,right:0,gap:0},Kc=function(e){return parseInt(e||"",10)||0},zT=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],s=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[Kc(n),Kc(s),Kc(i)]},LT=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return RT;var t=zT(e),n=document.documentElement.clientWidth,s=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,s-n+t[2]-t[0])}},OT=Hv(),Er="data-scroll-locked",DT=function(e,t,n,s){var i=e.left,a=e.top,o=e.right,l=e.gap;return n===void 0&&(n="margin"),`
772
+ `}),r.jsx("div",{className:"max-w-full",dangerouslySetInnerHTML:{__html:f}})]})]})]})]})}const f_=[{id:"terminal",label:"Terminal",desc:"Kabuk komutları çalıştır",Icon:as,color:"text-green-400",bg:"bg-green-500/10",border:"border-green-500/20"},{id:"browser",label:"Browser",desc:"Playwright ile tam web otomasyonu",Icon:We,color:"text-blue-400",bg:"bg-blue-500/10",border:"border-blue-500/20"},{id:"web-search",label:"Web Search",desc:"Çoklu sağlayıcıyla gerçek zamanlı arama",Icon:Xt,color:"text-cyan-400",bg:"bg-cyan-500/10",border:"border-cyan-500/20"},{id:"file-manager",label:"Files",desc:"Dosya oku, yaz ve yönet",Icon:ps,color:"text-yellow-400",bg:"bg-yellow-500/10",border:"border-yellow-500/20"},{id:"image-gen",label:"Görsel Üret",desc:"AI ile görsel üret",Icon:uv,color:"text-pink-400",bg:"bg-pink-500/10",border:"border-pink-500/20"},{id:"code",label:"Kod Analizi",desc:"Kod yaz, analiz et ve hata ayıkla",Icon:hn,color:"text-purple-400",bg:"bg-purple-500/10",border:"border-purple-500/20"},{id:"memory",label:"Bellek",desc:"Semantik hafıza arama & kayıt",Icon:Yt,color:"text-orange-400",bg:"bg-orange-500/10",border:"border-orange-500/20"},{id:"vision",label:"Görme",desc:"Ekran ve görsel algı",Icon:cd,color:"text-emerald-400",bg:"bg-emerald-500/10",border:"border-emerald-500/20"},{id:"screen-sense",label:"Ekranı Gör",desc:"Kullanıcı ekranını yakala ve analiz et",Icon:sf,color:"text-indigo-400",bg:"bg-indigo-500/10",border:"border-indigo-500/20"},{id:"gateway",label:"Gateway",desc:"Sistem arası ve A2A iletişim",Icon:rl,color:"text-teal-400",bg:"bg-teal-500/10",border:"border-teal-500/20"},{id:"messages",label:"Mesajlar",desc:"Ajan-arası mesaj gönder & al",Icon:Os,color:"text-rose-400",bg:"bg-rose-500/10",border:"border-rose-500/20"},{id:"git",label:"Git",desc:"Commit, branch, diff, push/pull",Icon:iv,color:"text-amber-400",bg:"bg-amber-500/10",border:"border-amber-500/20"}];function p_(){const[e,t]=h.useState("tools"),[n,s]=h.useState([]),[i,a]=h.useState([]),[o,l]=h.useState({}),[c,u]=h.useState(!1),[d,p]=h.useState(""),f=h.useCallback(async()=>{u(!0);try{const j=await $("/api/skills/list");if(j.ok){const k=await j.json();s(Array.isArray(k)?k:[])}}catch{}u(!1)},[]),m=h.useCallback(async()=>{u(!0);try{const j=await $("/api/skills/catalog");if(j.ok){const k=await j.json(),N=Array.isArray(k)?k:k.skills??[];a(N)}}catch{}u(!1)},[]);h.useEffect(()=>{e==="saved"&&f(),e==="catalog"&&m()},[e,f,m]);const v=async j=>{l(k=>({...k,[j.id]:"running"}));try{const k=await $("/api/skills/run",{method:"POST",body:JSON.stringify({id:j.id})});l(N=>({...N,[j.id]:k.ok?"done":"error"})),le[k.ok?"success":"error"](k.ok?`"${j.name}" çalıştırıldı`:"Çalıştırma başarısız"),setTimeout(()=>l(N=>({...N,[j.id]:"idle"})),2500)}catch{l(k=>({...k,[j.id]:"error"}))}},y=async j=>{try{await $(`/api/skills/${j}`,{method:"DELETE"}),s(k=>k.filter(N=>N.id!==j)),le.success("Beceri silindi.")}catch{le.error("Silinemedi.")}},b=async(j,k)=>{l(N=>({...N,[j]:"running"}));try{const N=await $("/api/v1/skills/invoke",{method:"POST",body:JSON.stringify({skill:j,goal:`${k} becerisini çalıştır`})});l(S=>({...S,[j]:N.ok?"done":"error"})),N.ok&&le.success(`"${k}" yapay zekanın araç kutusuna eklendi ve aktif edildi`),setTimeout(()=>l(S=>({...S,[j]:"idle"})),2500)}catch{l(N=>({...N,[j]:"error"}))}},g=f_.filter(j=>j.label.toLowerCase().includes(d.toLowerCase())||j.desc.toLowerCase().includes(d.toLowerCase())),x=n.filter(j=>j.name.toLowerCase().includes(d.toLowerCase())||j.goal.toLowerCase().includes(d.toLowerCase())),w=i.filter(j=>j.name.toLowerCase().includes(d.toLowerCase())||j.description.toLowerCase().includes(d.toLowerCase())||(j.pluginName??"").toLowerCase().includes(d.toLowerCase()));return r.jsxs("div",{className:"min-h-screen bg-transparent pt-4 pb-10 px-4 sm:px-6 max-w-5xl mx-auto",children:[r.jsx("div",{className:"mb-6",children:r.jsxs("div",{className:"flex items-center gap-3 mb-1",children:[r.jsx("div",{className:"w-10 h-10 rounded-2xl flex items-center justify-center shrink-0",style:{background:"rgba(249,115,22,0.12)",border:"1px solid rgba(249,115,22,0.25)"},children:r.jsx(ze,{size:18,className:"text-orange-400"})}),r.jsxs("div",{children:[r.jsx("h1",{className:"text-[22px] font-black text-white/95 leading-none",children:"Beceriler & Araçlar"}),r.jsx("p",{className:"text-[12px] text-white/35 mt-0.5",children:"Must-b'nin bilişsel yetenekleri"})]})]})}),r.jsxs("div",{className:"flex items-center gap-3 mb-5",children:[r.jsxs("div",{className:"relative flex-1 max-w-xs",children:[r.jsx(Xt,{size:13,className:"absolute left-3 top-1/2 -translate-y-1/2 text-white/25"}),r.jsx("input",{value:d,onChange:j=>p(j.target.value),placeholder:"Ara…",className:"w-full bg-white/5 border border-white/8 rounded-xl py-2 pl-8 pr-3 text-[13px] text-white/75 outline-none focus:border-orange-500/40 transition-colors placeholder-white/20"})]}),r.jsx("div",{className:"flex rounded-xl overflow-hidden border border-white/8",children:[{key:"tools",label:"Dahili Araçlar"},{key:"saved",label:"Kaydedilen"},{key:"catalog",label:"Katalog"}].map(({key:j,label:k})=>r.jsx("button",{onClick:()=>t(j),className:`px-4 py-2 text-[12px] font-semibold transition-all ${e===j?"bg-orange-500/20 text-orange-300":"text-white/40 hover:text-white/70 hover:bg-white/5"}`,children:k},j))})]}),e==="tools"&&r.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",children:g.map(({id:j,label:k,desc:N,Icon:S,color:E,bg:P,border:A})=>r.jsxs(H.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.18},className:`rounded-2xl p-4 flex gap-3 items-start border ${A}`,style:{background:"rgba(13,7,3,0.6)",backdropFilter:"blur(12px)"},children:[r.jsx("div",{className:`w-9 h-9 rounded-xl flex items-center justify-center shrink-0 ${P} border ${A}`,children:r.jsx(S,{size:16,className:E})}),r.jsxs("div",{className:"min-w-0 flex-1",children:[r.jsx("p",{className:"text-[13px] font-bold text-white/90 leading-tight",children:k}),r.jsx("p",{className:"text-[11px] text-white/40 mt-0.5 leading-tight",children:N})]}),r.jsx("div",{className:"shrink-0 mt-1",children:r.jsx("span",{className:"text-[9px] font-bold uppercase tracking-wider px-1.5 py-0.5 rounded-md bg-green-500/12 border border-green-500/20 text-green-400",children:"Aktif"})})]},j))}),e==="saved"&&r.jsxs("div",{children:[r.jsxs("div",{className:"flex items-center justify-between mb-3",children:[r.jsxs("p",{className:"text-[11px] text-white/30",children:[n.length," kaydedilmiş beceri"]}),r.jsx("button",{onClick:f,className:"p-1.5 text-white/30 hover:text-white/70 rounded-lg hover:bg-white/6 transition-all",children:r.jsx(de,{size:13})})]}),c?r.jsx("div",{className:"flex justify-center py-16",children:r.jsx(ne,{size:20,className:"animate-spin text-orange-500/50"})}):x.length===0?r.jsx("div",{className:"text-center py-16 text-white/20 text-[13px]",children:d?"Eşleşen beceri bulunamadı.":"Henüz kaydedilmiş beceri yok."}):r.jsx("div",{className:"space-y-2",children:x.map(j=>{const k=o[j.id]??"idle";return r.jsxs(H.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},className:"rounded-2xl p-4 border border-orange-500/10",style:{background:"rgba(13,7,3,0.6)",backdropFilter:"blur(12px)"},children:[r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx("div",{className:"w-8 h-8 rounded-xl bg-orange-500/10 border border-orange-500/20 flex items-center justify-center shrink-0 mt-0.5",children:r.jsx(Pl,{size:14,className:"text-orange-400"})}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("p",{className:"text-[13px] font-bold text-white/90",children:j.name}),r.jsx("p",{className:"text-[11px] text-white/40 truncate mt-0.5",children:j.goal}),r.jsxs("div",{className:"flex items-center gap-3 mt-2",children:[r.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-white/25",children:[r.jsx(tv,{size:9})," ",j.runCount," çalıştırma"]}),r.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-white/25",children:[r.jsx(Pt,{size:9})," ",new Date(j.savedAt).toLocaleDateString("tr-TR")]})]})]}),r.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[r.jsx("button",{onClick:()=>v(j),disabled:k==="running",className:`w-8 h-8 rounded-xl flex items-center justify-center transition-all border ${k==="done"?"bg-green-500/15 border-green-500/25 text-green-400":k==="error"?"bg-red-500/15 border-red-500/25 text-red-400":k==="running"?"bg-orange-500/10 border-orange-500/20 text-orange-400":"bg-white/5 border-white/10 text-white/50 hover:bg-orange-500/15 hover:border-orange-500/25 hover:text-orange-300"}`,children:k==="running"?r.jsx(ne,{size:13,className:"animate-spin"}):k==="done"?r.jsx(Ve,{size:13}):k==="error"?r.jsx(wt,{size:13}):r.jsx(Us,{size:13})}),r.jsx("button",{onClick:()=>y(j.id),className:"w-8 h-8 rounded-xl flex items-center justify-center border border-white/8 text-white/25 hover:bg-red-500/12 hover:border-red-500/20 hover:text-red-400 transition-all",children:r.jsx(Hs,{size:13})})]})]}),(j.tags??[]).length>0&&r.jsx("div",{className:"flex flex-wrap gap-1 mt-2 ml-11",children:(j.tags??[]).map(N=>r.jsx("span",{className:"text-[9px] px-1.5 py-0.5 rounded-md bg-white/5 border border-white/8 text-white/35",children:N},N))})]},j.id)})})]}),e==="catalog"&&r.jsxs("div",{children:[r.jsxs("div",{className:"flex items-center justify-between mb-3",children:[r.jsxs("p",{className:"text-[11px] text-white/30",children:[i.length," beceri"]}),r.jsx("button",{onClick:m,className:"p-1.5 text-white/30 hover:text-white/70 rounded-lg hover:bg-white/6 transition-all",children:r.jsx(de,{size:13})})]}),c?r.jsx("div",{className:"flex justify-center py-16",children:r.jsx(ne,{size:20,className:"animate-spin text-orange-500/50"})}):w.length===0?r.jsx("div",{className:"text-center py-16 text-white/20 text-[13px]",children:d?"Eşleşen beceri bulunamadı.":"Katalog boş."}):r.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:w.map(j=>{var N;const k=o[j.id]??"idle";return r.jsxs(H.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},className:"rounded-2xl p-4 border border-white/8 flex gap-3",style:{background:"rgba(13,7,3,0.55)",backdropFilter:"blur(12px)"},children:[r.jsx("div",{className:"text-[22px] shrink-0",children:j.emoji??"⚡"}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("p",{className:"text-[13px] font-bold text-white/90",children:j.name}),r.jsx("p",{className:"text-[11px] text-white/40 mt-0.5 leading-tight line-clamp-2",children:j.description}),j.pluginName&&r.jsx("p",{className:"text-[10px] text-white/20 mt-1",children:j.pluginName}),(((N=j.requires)==null?void 0:N.bins)??[]).length>0&&r.jsx("div",{className:"flex flex-wrap gap-1 mt-1.5",children:(j.requires.bins??[]).map(S=>r.jsx("span",{className:"text-[9px] px-1.5 py-0.5 rounded-md bg-orange-500/8 border border-orange-500/15 text-orange-400/70",children:S},S))})]}),r.jsx("button",{onClick:()=>b(j.id,j.name),disabled:k==="running",className:`w-8 h-8 rounded-xl flex items-center justify-center shrink-0 transition-all border mt-0.5 ${k==="done"?"bg-green-500/15 border-green-500/25 text-green-400":k==="error"?"bg-red-500/15 border-red-500/25 text-red-400":k==="running"?"bg-orange-500/10 border-orange-500/20 text-orange-400":"bg-white/5 border-white/10 text-white/50 hover:bg-orange-500/15 hover:border-orange-500/25 hover:text-orange-300"}`,children:k==="running"?r.jsx(ne,{size:13,className:"animate-spin"}):k==="done"?r.jsx(Ve,{size:13}):k==="error"?r.jsx(wt,{size:13}):r.jsx(fn,{size:13})})]},j.id)})})]})]})}const m_={node:hn,python:yn,api:qr,cli:as,web:We,database:va,cloud:sv,agent:ia};function g_(e,t){const n=e.toLowerCase();return n.includes("api")||n.includes("webhook")?qr:n.includes("db")||n.includes("database")||n.includes("sql")?va:n.includes("cloud")||n.includes("s3")||n.includes("gcs")?sv:n.includes("agent")||n.includes("bot")?ia:n.includes("web")||n.includes("http")?We:m_[t]??$s}function x_(e){const t=new Map;for(const n of e){if(!n.pluginName)continue;const s=t.get(n.pluginName);s?s.skillCount+=1:t.set(n.pluginName,{name:n.pluginName,emoji:n.emoji??"🔧",skillCount:1})}return Array.from(t.values()).sort((n,s)=>n.name.localeCompare(s.name))}function y_(){const[e,t]=h.useState([]),[n,s]=h.useState([]),[i,a]=h.useState(!1),[o,l]=h.useState(null),[c,u]=h.useState(!1),[d,p]=h.useState(""),[f,m]=h.useState(""),[v,y]=h.useState("node"),[b,g]=h.useState(""),[x,w]=h.useState(!1),j=h.useCallback(async()=>{a(!0);try{const[P,A]=await Promise.all([$("/api/plugins/list"),$("/api/skills/catalog")]);if(P.ok){const T=await P.json();t(Array.isArray(T)?T:[])}if(A.ok){const T=await A.json(),V=Array.isArray(T)?T:T.skills??[];s(x_(V))}}catch{}a(!1)},[]);h.useEffect(()=>{j()},[j]);const k=async P=>{l(P.name);try{const A=P.running?"/api/plugins/stop":"/api/plugins/run";(await $(A,{method:"POST",body:JSON.stringify({name:P.name})})).ok?(t(V=>(Array.isArray(V)?V:[]).map(R=>R.name===P.name?{...R,running:!R.running}:R)),le.success(P.running?`"${P.name}" durduruldu`:`"${P.name}" başlatıldı`)):le.error("İşlem başarısız.")}catch{le.error("Bağlantı hatası.")}l(null)},N=async P=>{if(P.preventDefault(),!(!d.trim()||!f.trim())){w(!0);try{const A=await $("/api/plugins/build",{method:"POST",body:JSON.stringify({name:d,goal:f,lang:v,context:b})});if(A.ok){const T=await A.json();le.success(`"${T.name??d}" eklentisi oluşturuldu!`),p(""),m(""),g(""),u(!1),j()}else{const T=await A.json().catch(()=>({}));le.error(T.error??"Oluşturma başarısız.")}}catch{le.error("Gateway bağlantı hatası.")}w(!1)}},S=Array.isArray(e)?e:[],E=S.filter(P=>P.running).length;return r.jsxs("div",{className:"min-h-screen bg-transparent pt-4 pb-10 px-4 sm:px-6 max-w-5xl mx-auto",children:[r.jsxs("div",{className:"flex items-center justify-between mb-6",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:"w-10 h-10 rounded-2xl flex items-center justify-center shrink-0",style:{background:"rgba(249,115,22,0.12)",border:"1px solid rgba(249,115,22,0.25)"},children:r.jsx(Br,{size:18,className:"text-orange-400"})}),r.jsxs("div",{children:[r.jsx("h1",{className:"text-[22px] font-black text-white/95 leading-none",children:"Eklentiler"}),r.jsxs("p",{className:"text-[12px] text-white/35 mt-0.5",children:[S.length," özel eklenti · ",E," çalışıyor"]})]})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("button",{onClick:j,className:"p-2.5 rounded-xl text-white/30 hover:text-white/70 hover:bg-white/6 border border-white/8 transition-all",children:r.jsx(de,{size:14})}),r.jsxs("button",{onClick:()=>u(P=>!P),className:`flex items-center gap-1.5 px-4 py-2.5 rounded-xl text-[12px] font-semibold transition-all border ${c?"bg-orange-500/20 border-orange-500/30 text-orange-300":"bg-white/6 border-white/10 text-white/60 hover:bg-orange-500/12 hover:border-orange-500/20 hover:text-orange-300"}`,children:[c?r.jsx(et,{size:13}):r.jsx(zl,{size:13}),c?"Kapat":"Yeni Eklenti"]})]})]}),r.jsx(se,{children:c&&r.jsx(H.div,{initial:{opacity:0,y:-10,height:0},animate:{opacity:1,y:0,height:"auto"},exit:{opacity:0,y:-8,height:0},transition:{duration:.2},className:"overflow-hidden mb-5",children:r.jsxs("form",{onSubmit:N,className:"rounded-2xl p-5 border border-orange-500/20",style:{background:"rgba(13,7,3,0.7)",backdropFilter:"blur(16px)"},children:[r.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[r.jsx(ze,{size:14,className:"text-orange-400"}),r.jsx("h3",{className:"text-[13px] font-bold text-white/90",children:"Yeni Eklenti Oluştur"})]}),r.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3 mb-3",children:[r.jsxs("div",{children:[r.jsx("label",{className:"block text-[10px] font-bold text-white/35 uppercase tracking-wider mb-1",children:"Ad"}),r.jsx("input",{value:d,onChange:P=>p(P.target.value),placeholder:"my-plugin",required:!0,className:"w-full bg-white/5 border border-white/8 rounded-xl px-3 py-2 text-[13px] text-white/80 outline-none focus:border-orange-500/40 transition-colors placeholder-white/20"})]}),r.jsxs("div",{children:[r.jsx("label",{className:"block text-[10px] font-bold text-white/35 uppercase tracking-wider mb-1",children:"Dil"}),r.jsx("div",{className:"flex rounded-xl overflow-hidden border border-white/8",children:["node","python"].map(P=>r.jsxs("button",{type:"button",onClick:()=>y(P),className:`flex-1 py-2 text-[12px] font-semibold transition-all flex items-center justify-center gap-1.5 ${v===P?"bg-orange-500/20 text-orange-300":"text-white/40 hover:text-white/70 hover:bg-white/5"}`,children:[P==="node"?r.jsx(hn,{size:12}):r.jsx(yn,{size:12}),P==="node"?"Node.js":"Python"]},P))})]})]}),r.jsxs("div",{className:"mb-3",children:[r.jsx("label",{className:"block text-[10px] font-bold text-white/35 uppercase tracking-wider mb-1",children:"Hedef / Açıklama"}),r.jsx("textarea",{value:f,onChange:P=>m(P.target.value),placeholder:"Bu eklenti ne yapmalı?",required:!0,rows:2,className:"w-full bg-white/5 border border-white/8 rounded-xl px-3 py-2 text-[13px] text-white/80 outline-none focus:border-orange-500/40 transition-colors placeholder-white/20 resize-none"})]}),r.jsxs("div",{className:"mb-4",children:[r.jsx("label",{className:"block text-[10px] font-bold text-white/35 uppercase tracking-wider mb-1",children:"Bağlam (isteğe bağlı)"}),r.jsx("textarea",{value:b,onChange:P=>g(P.target.value),placeholder:"API anahtarları, URL'ler, ek bağlam…",rows:2,className:"w-full bg-white/5 border border-white/8 rounded-xl px-3 py-2 text-[13px] text-white/80 outline-none focus:border-orange-500/40 transition-colors placeholder-white/20 resize-none"})]}),r.jsxs("button",{type:"submit",disabled:x||!d.trim()||!f.trim(),className:"flex items-center gap-2 px-5 py-2.5 rounded-xl bg-orange-600/20 border border-orange-500/30 text-orange-300 text-[13px] font-semibold hover:bg-orange-600/30 transition-all disabled:opacity-40",children:[x?r.jsx(ne,{size:13,className:"animate-spin"}):r.jsx(fn,{size:13}),x?"Oluşturuluyor…":"Oluştur"]})]})})}),n.length>0&&r.jsxs("div",{className:"mb-6",children:[r.jsx("p",{className:"text-[10px] font-bold uppercase tracking-widest text-white/25 mb-3",children:"Yüklü Beceri Paketleri"}),r.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",children:n.map(P=>r.jsxs(H.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},className:"rounded-2xl p-4 flex gap-3 items-center border border-white/8",style:{background:"rgba(13,7,3,0.55)",backdropFilter:"blur(12px)"},children:[r.jsx("div",{className:"text-[22px] shrink-0",children:P.emoji}),r.jsxs("div",{className:"min-w-0 flex-1",children:[r.jsx("p",{className:"text-[13px] font-bold text-white/90 leading-tight truncate",children:P.name}),r.jsxs("p",{className:"text-[10px] text-white/30 mt-0.5",children:[P.skillCount," beceri"]})]}),r.jsx("span",{className:"text-[9px] font-bold uppercase tracking-wider px-1.5 py-0.5 rounded-md bg-green-500/12 border border-green-500/20 text-green-400 shrink-0",children:"Yüklü"})]},P.name))})]}),i?r.jsx("div",{className:"flex justify-center py-20",children:r.jsx(ne,{size:22,className:"animate-spin text-orange-500/50"})}):S.length===0?r.jsxs("div",{className:"rounded-2xl border border-white/8 p-8 text-center",style:{background:"rgba(13,7,3,0.4)"},children:[r.jsx(Br,{size:28,className:"text-white/15 mx-auto mb-3"}),r.jsx("p",{className:"text-[13px] text-white/30 font-medium",children:"Henüz özel eklenti yok"}),r.jsx("p",{className:"text-[12px] text-white/20 mt-1",children:'Yukarıdaki "Yeni Eklenti" ile kendi konektörünü oluştur.'})]}):r.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",children:S.map(P=>{const A=o===P.name,T=g_(P.name,P.lang),V=P.lang==="node"?hn:yn;return r.jsxs(H.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},className:`rounded-2xl p-4 border transition-all ${P.running?"border-orange-500/25":"border-white/8 hover:border-white/14"}`,style:{background:P.running?"rgba(249,115,22,0.06)":"rgba(13,7,3,0.55)",backdropFilter:"blur(12px)"},children:[r.jsxs("div",{className:"flex items-start justify-between mb-3",children:[r.jsxs("div",{className:"flex items-center gap-2.5",children:[r.jsx("div",{className:`w-9 h-9 rounded-xl flex items-center justify-center shrink-0 ${P.running?"bg-orange-500/15 border border-orange-500/25":"bg-white/6 border border-white/10"}`,children:r.jsx(T,{size:16,className:P.running?"text-orange-400":"text-white/50"})}),r.jsxs("div",{children:[r.jsx("p",{className:"text-[13px] font-bold text-white/90 leading-tight truncate max-w-[120px]",children:P.name}),r.jsxs("div",{className:"flex items-center gap-1 mt-0.5",children:[r.jsx(V,{size:9,className:P.lang==="node"?"text-green-400/60":"text-blue-400/60"}),r.jsx("span",{className:`text-[9px] font-semibold ${P.lang==="node"?"text-green-400/60":"text-blue-400/60"}`,children:P.lang==="node"?"Node.js":"Python"})]})]})]}),r.jsx("span",{className:`text-[9px] font-bold uppercase tracking-wider px-1.5 py-0.5 rounded-md border ${P.running?"bg-orange-500/15 border-orange-500/25 text-orange-400":"bg-white/5 border-white/10 text-white/30"}`,children:P.running?"Çalışıyor":"Durdu"})]}),r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx("span",{className:"text-[10px] text-white/25",children:new Date(P.createdAt).toLocaleDateString("tr-TR")}),r.jsxs("button",{onClick:()=>k(P),disabled:A,className:`flex items-center gap-1.5 px-3 py-1.5 rounded-xl text-[11px] font-semibold transition-all border ${P.running?"bg-red-500/12 border-red-500/20 text-red-400 hover:bg-red-500/20":"bg-orange-500/12 border-orange-500/20 text-orange-400 hover:bg-orange-500/20"} disabled:opacity-40`,children:[A?r.jsx(ne,{size:11,className:"animate-spin"}):P.running?r.jsx(of,{size:11}):r.jsx(Us,{size:11}),P.running?"Durdur":"Başlat"]})]})]},P.name)})})]})}function v_(){return new URLSearchParams(window.location.search).get("token")??""}function b_(){const[e,t]=h.useState("connecting"),[n,s]=h.useState([]),[i,a]=h.useState([]),[o,l]=h.useState("idle"),[c,u]=h.useState(null),[d,p]=h.useState(""),f=h.useRef(null),m=h.useRef(null),v=h.useRef([]),y=v_();h.useEffect(()=>{if(!y){t("denied");return}const k=Ri(`${window.location.origin}/mobile`,{query:{token:y},transports:["websocket","polling"]});return f.current=k,k.on("connect",()=>t("connected")),k.on("disconnect",()=>t("disconnected")),k.on("authError",()=>{t("denied"),k.disconnect()}),k.on("agentUpdate",N=>{const{type:S}=N;if(S==="planStart"&&s([]),S==="stepStart"){const E=N.step;s(P=>[...P,{id:`${Date.now()}-${Math.random()}`,description:(E==null?void 0:E.description)??"Working…",status:"running"}])}S==="stepFinish"&&s(E=>{const P=[...E],A=P.findLastIndex(T=>T.status==="running");return A>=0&&(P[A]={...P[A],status:N.status==="error"?"error":"done"}),P}),S==="skillRunStart"&&N.skillId&&u(N.skillId),S==="planFinish"&&u(null)}),()=>{k.disconnect()}},[y]);const b=h.useCallback(async()=>{try{const k=await fetch("/api/skills/list",{headers:{Authorization:`Bearer ${y}`}});if(k.ok){const N=await k.json();a(N.skills??[])}}catch{}},[y]);h.useEffect(()=>{b()},[b]);const g=async()=>{try{const k=await navigator.mediaDevices.getUserMedia({audio:!0}),N=new MediaRecorder(k,{mimeType:"audio/webm"});v.current=[],N.ondataavailable=S=>{S.data.size>0&&v.current.push(S.data)},N.onstop=()=>{k.getTracks().forEach(S=>S.stop()),w()},N.start(),m.current=N,l("recording")}catch{l("idle")}},x=()=>{var k;(k=m.current)==null||k.stop(),l("sending")},w=async()=>{const k=new Blob(v.current,{type:"audio/webm"}),N=new FormData;N.append("audio",k,"voice.webm");try{const S=await fetch("/api/voice/transcribe",{method:"POST",headers:{Authorization:`Bearer ${y}`},body:N});if(S.ok){const{text:E}=await S.json();p(E),await fetch("/api/goal",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${y}`},body:JSON.stringify({goal:E})})}}catch{}l("idle")},j=async k=>{if(!c){u(k.id);try{await fetch("/api/skills/run",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${y}`},body:JSON.stringify({id:k.id})})}catch{u(null)}}};return!y||e==="denied"?r.jsxs("div",{className:"min-h-screen bg-[#02040a] flex flex-col items-center justify-center gap-4 text-center px-8",children:[r.jsx(wt,{size:40,className:"text-red-400"}),r.jsx("p",{className:"text-white font-bold text-xl",children:"Access Denied"}),r.jsxs("p",{className:"text-gray-500 text-sm",children:["This link is invalid or has expired.",r.jsx("br",{}),"Generate a new QR code from your desktop."]})]}):r.jsxs("div",{className:"min-h-screen bg-[#02040a] text-white flex flex-col pb-8",children:[r.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-white/5",children:[r.jsxs("div",{className:"flex items-center gap-2.5",children:[r.jsx("img",{src:"/logo.png",alt:"Must-b",className:"w-8 h-8 object-contain"}),r.jsx("span",{className:"font-bold text-base",children:"Must-b"}),r.jsx("span",{className:"text-[10px] text-orange-400 font-medium bg-orange-400/10 border border-orange-400/20 px-2 py-0.5 rounded-full",children:"Companion"})]}),r.jsx("div",{className:"flex items-center gap-1.5 text-xs",children:e==="connected"?r.jsxs(r.Fragment,{children:[r.jsx(VC,{size:13,className:"text-green-400"}),r.jsx("span",{className:"text-green-400",children:"Connected"})]}):e==="connecting"?r.jsxs(r.Fragment,{children:[r.jsx(ne,{size:13,className:"animate-spin text-orange-400"}),r.jsx("span",{className:"text-orange-400",children:"Connecting…"})]}):r.jsxs(r.Fragment,{children:[r.jsx(Ws,{size:13,className:"text-gray-600"}),r.jsx("span",{className:"text-gray-500",children:"Offline"})]})})]}),r.jsxs("div",{className:"flex flex-col items-center justify-center py-10 px-6 border-b border-white/5",children:[r.jsx("p",{className:"text-[11px] text-gray-500 font-medium uppercase tracking-widest mb-6",children:"Voice Command"}),r.jsxs(H.button,{onPointerDown:g,onPointerUp:x,onPointerLeave:o==="recording"?x:void 0,disabled:o==="sending"||e!=="connected",whileTap:{scale:.93},className:`relative w-28 h-28 rounded-full flex items-center justify-center transition-all select-none ${o==="recording"?"bg-red-500/20 border-2 border-red-500 shadow-[0_0_40px_rgba(239,68,68,0.4)]":o==="sending"?"bg-orange-500/10 border-2 border-orange-500/30":"bg-orange-500/10 border-2 border-orange-500/40 hover:bg-orange-500/20 active:scale-95"} disabled:opacity-40`,children:[o==="sending"?r.jsx(ne,{size:36,className:"text-orange-400 animate-spin"}):o==="recording"?r.jsx(nf,{size:36,className:"text-red-400"}):r.jsx(Ds,{size:36,className:"text-orange-400"}),o==="recording"&&r.jsx(H.span,{className:"absolute inset-0 rounded-full border-2 border-red-500",animate:{scale:[1,1.3,1],opacity:[.8,0,.8]},transition:{duration:1.4,repeat:1/0}})]}),r.jsx("p",{className:"text-[12px] text-gray-600 mt-4",children:o==="recording"?"Listening… release to send":"Hold to speak"}),d&&r.jsxs("p",{className:"text-[11px] text-orange-300 mt-3 text-center max-w-xs",children:['"',d,'"']})]}),r.jsxs("div",{className:"px-5 pt-6 pb-4 border-b border-white/5",children:[r.jsx("p",{className:"text-[10px] text-gray-500 font-bold uppercase tracking-widest mb-3",children:"Live Workflow"}),r.jsx(se,{children:n.length===0?r.jsx("p",{className:"text-[12px] text-gray-700 text-center py-4",children:"No active workflow"}):r.jsx("div",{className:"space-y-2",children:n.slice(-6).map(k=>r.jsxs(H.div,{initial:{opacity:0,x:-10},animate:{opacity:1,x:0},className:`flex items-start gap-2.5 p-3 rounded-xl border text-[12px] ${k.status==="running"?"bg-orange-500/8 border-orange-500/20":k.status==="error"?"bg-red-500/8 border-red-500/15":"bg-white/3 border-white/5"}`,children:[k.status==="running"&&r.jsx(ne,{size:12,className:"animate-spin text-orange-400 mt-0.5 shrink-0"}),k.status==="done"&&r.jsx(Ve,{size:12,className:"text-green-400 mt-0.5 shrink-0"}),k.status==="error"&&r.jsx(wt,{size:12,className:"text-red-400 mt-0.5 shrink-0"}),r.jsx("span",{className:k.status==="running"?"text-orange-300":k.status==="error"?"text-red-300":"text-gray-400",children:k.description})]},k.id))})})]}),r.jsxs("div",{className:"px-5 pt-6",children:[r.jsxs("div",{className:"flex items-center justify-between mb-4",children:[r.jsx("p",{className:"text-[10px] text-gray-500 font-bold uppercase tracking-widest",children:"My Skills"}),r.jsx("button",{onClick:b,className:"text-gray-600 hover:text-gray-400 transition-colors",children:r.jsx(de,{size:12})})]}),i.length===0?r.jsx("p",{className:"text-[12px] text-gray-700 text-center py-6",children:"No skills saved yet"}):r.jsx("div",{className:"space-y-2.5",children:i.map(k=>{const N=c===k.id;return r.jsxs(H.div,{layout:!0,className:`flex items-center gap-3 p-3.5 rounded-2xl border transition-all ${N?"bg-orange-500/10 border-orange-500/25":"bg-[#0c0f18] border-white/6"}`,children:[r.jsx(ze,{size:14,className:"text-orange-400 shrink-0"}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("p",{className:"font-semibold text-[13px] text-white truncate",children:k.name}),r.jsxs("p",{className:"text-[10px] text-gray-600 mt-0.5",children:[k.runCount,"× run"]})]}),r.jsxs("button",{onClick:()=>j(k),disabled:!!c,className:`flex items-center gap-1.5 px-3 py-1.5 rounded-xl text-[11px] font-semibold transition-all ${N?"bg-orange-500/15 text-orange-400 border border-orange-500/25 cursor-not-allowed":"bg-orange-500/10 border border-orange-500/20 text-orange-400 hover:bg-orange-500/20 disabled:opacity-40 disabled:cursor-not-allowed"}`,children:[N?r.jsx(ne,{size:11,className:"animate-spin"}):r.jsx(Us,{size:11}),N?"Running":"Run"]})]},k.id)})})]})]})}function w_(){const[e,t]=h.useState([]),[n,s]=h.useState(!0),[i,a]=h.useState(null);return h.useEffect(()=>{$("/api/workspace/files").then(o=>o.ok?o.json():Promise.reject(`HTTP ${o.status}`)).then(o=>{const l=Array.isArray(o==null?void 0:o.files)?o.files:[];t(l.map(c=>({name:c.name,path:c.rel,size:c.size,modified:c.mtime})))}).catch(o=>a(String(o))).finally(()=>s(!1))},[]),r.jsxs("div",{className:"max-w-4xl mx-auto px-6 py-8",children:[r.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[r.jsx(ps,{size:20,className:"text-orange-400"}),r.jsx("h1",{className:"text-lg font-bold text-white",children:"Files"})]}),n&&r.jsxs("div",{className:"flex items-center gap-2 text-gray-400 text-sm",children:[r.jsx(ne,{size:14,className:"animate-spin"}),"Loading files…"]}),i&&r.jsxs("p",{className:"text-red-400 text-sm",children:["Failed to load files: ",i]}),!n&&!i&&e.length===0&&r.jsx("p",{className:"text-gray-500 text-sm",children:"No files found in workspace."}),!n&&e.length>0&&r.jsx("div",{className:"space-y-1",children:e.map(o=>r.jsxs("div",{className:"flex items-center gap-3 px-4 py-2.5 rounded-lg hover:bg-white/5 transition-colors",children:[r.jsx(Qt,{size:14,className:"text-gray-400 shrink-0"}),r.jsx("span",{className:"text-[13px] text-gray-200 flex-1 truncate",children:o.name}),o.size!==void 0&&r.jsxs("span",{className:"text-[11px] text-gray-500",children:[(o.size/1024).toFixed(1)," KB"]})]},o.path))})]})}const k_=[{value:"all",label:"Tüm Veriler",icon:r.jsx(We,{size:13})},{value:"text",label:"Sadece Metin",icon:r.jsx(Qt,{size:13})},{value:"links",label:"Sadece Linkler",icon:r.jsx(qr,{size:13})},{value:"images",label:"Sadece Görseller",icon:r.jsx(ef,{size:13})}];function j_(e){return e==="text"?r.jsx(Qt,{size:13,className:"text-orange-400 shrink-0 mt-0.5"}):e==="link"?r.jsx(qr,{size:13,className:"text-blue-400 shrink-0 mt-0.5"}):r.jsx(ef,{size:13,className:"text-purple-400 shrink-0 mt-0.5"})}function N_(e){return e==="text"?"Metin":e==="link"?"Link":"Görsel"}function S_(){const[e,t]=h.useState(""),[n,s]=h.useState("all"),[i,a]=h.useState(!1),[o,l]=h.useState(null),[c,u]=h.useState(null),[d,p]=h.useState(new Set),[f,m]=h.useState(!1),[v,y]=h.useState(!1),b=(c??[]).filter(k=>n==="all"?!0:k.type===(n==="links"?"link":n==="images"?"image":"text")),g=k=>{p(N=>{const S=new Set(N);return S.has(k)?S.delete(k):S.add(k),S})},x=()=>{d.size===b.length?p(new Set):p(new Set(b.map(k=>k.id)))},w=async()=>{const k=e.trim();if(k){a(!0),l(null),u(null),p(new Set),y(!1);try{const N=await $("/api/browser/scrape",{method:"POST",body:JSON.stringify({url:k,mode:n})}),S=await N.json();if(!N.ok||!S.ok)l(S.error??`Sunucu hatası: ${N.status}`);else{const E=S.items??[];u(E),p(new Set(E.map(P=>P.id)))}}catch{l("Ağ bağlantısı kurulamadı. Backend çalışıyor mu?")}finally{a(!1)}}},j=async()=>{const k=(c??[]).filter(N=>d.has(N.id));if(k.length!==0){m(!0);try{await $("/api/memory/import",{method:"POST",body:JSON.stringify({entries:k.map(N=>({type:N.type,content:N.content,source:e}))})}).catch(()=>{}),y(!0)}finally{m(!1)}}};return r.jsxs("div",{className:"max-w-2xl mx-auto px-4 py-10",children:[r.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[r.jsx("div",{className:"w-10 h-10 rounded-xl flex items-center justify-center shrink-0",style:{background:"rgba(234,88,12,0.15)",border:"1px solid rgba(234,88,12,0.3)"},children:r.jsx(We,{size:18,className:"text-orange-400 animate-pulse"})}),r.jsxs("div",{children:[r.jsx("h1",{className:"text-[17px] font-bold text-white/90 leading-tight",children:"Tarayıcı Otomasyonu"}),r.jsx("p",{className:"text-[12px] text-white/40",children:"Web sayfalarını tara, analiz et ve verileri belleğine kaydet"})]})]}),r.jsxs("div",{className:"rounded-xl px-5 py-4 mb-5",style:{background:"rgba(249,115,22,0.05)",border:"1px solid rgba(249,115,22,0.15)"},children:[r.jsx("p",{className:"text-[13px] font-semibold text-white/80 mb-3 leading-snug",children:"Must-b Otonom Tarayıcı ile internetin gücünü belleğinize katın:"}),r.jsx("ol",{className:"space-y-1.5",children:["Hedef URL'yi girin.","Çıkarmak istediğiniz veri türünü seçin (Metin, Link veya Görsel).","Başlat butonuna basarak Must-b'nin siteyi analiz etmesini bekleyin.","Sonuçları inceleyin ve kalıcı hafızaya kaydetmek istediklerinizi seçin."].map((k,N)=>r.jsxs("li",{className:"flex items-start gap-2.5 text-[13px] text-white/80 leading-relaxed",children:[r.jsx("span",{className:"flex items-center justify-center w-5 h-5 rounded-full text-[10px] font-black shrink-0 mt-0.5",style:{background:"rgba(249,115,22,0.25)",color:"#fb923c"},children:N+1}),k]},N))}),r.jsxs("p",{className:"mt-3 text-[11px] text-orange-400/70 flex items-start gap-1.5 leading-relaxed",children:[r.jsx("span",{className:"shrink-0 mt-0.5",children:"🔒"}),r.jsxs("span",{children:[r.jsx("strong",{className:"text-orange-400/90",children:"Güvenlik Notu:"})," ","Tüm işlemler yerel Playwright motorunda gerçekleşir, verileriniz üçüncü taraflara asla iletilmez."]})]})]}),r.jsxs("div",{className:"rounded-2xl p-5 mb-4",style:{background:"rgba(13,7,3,0.80)",border:"1px solid rgba(255,255,255,0.10)",backdropFilter:"blur(20px)",boxShadow:"0 8px 40px rgba(0,0,0,0.45)"},children:[r.jsx("label",{className:"block text-[11px] font-bold text-white/40 uppercase tracking-widest mb-2",children:"Hedef URL"}),r.jsxs("div",{className:"flex gap-2 mb-5",children:[r.jsx("input",{type:"url",value:e,onChange:k=>t(k.target.value),onKeyDown:k=>k.key==="Enter"&&!i&&w(),placeholder:"https://example.com",className:"flex-1 px-4 py-2.5 rounded-xl text-[13px] text-white/85 placeholder-white/20 outline-none transition-all",style:{background:"rgba(255,255,255,0.05)",border:"1px solid rgba(255,255,255,0.12)"},onFocus:k=>k.currentTarget.style.borderColor="rgba(249,115,22,0.55)",onBlur:k=>k.currentTarget.style.borderColor="rgba(255,255,255,0.12)"}),r.jsxs("button",{onClick:w,disabled:i||!e.trim(),className:"flex items-center gap-2 px-5 py-2.5 rounded-xl text-[13px] font-semibold transition-all disabled:opacity-40",style:{background:i||!e.trim()?"rgba(249,115,22,0.25)":"rgba(249,115,22,0.85)",color:"#fff",border:"1px solid rgba(249,115,22,0.4)"},children:[i?r.jsx(ne,{size:14,className:"animate-spin"}):r.jsx(Ml,{size:14}),i?"Taranıyor…":"Başlat"]})]}),r.jsxs("div",{children:[r.jsx("p",{className:"text-[11px] font-bold text-white/40 uppercase tracking-widest mb-2.5",children:"Çıkarma Modu"}),r.jsx("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-4",children:k_.map(k=>r.jsxs("button",{onClick:()=>s(k.value),className:"flex items-center gap-2 px-3 py-2 rounded-lg text-[12px] font-medium transition-all",style:{background:n===k.value?"rgba(249,115,22,0.18)":"rgba(255,255,255,0.04)",border:n===k.value?"1px solid rgba(249,115,22,0.45)":"1px solid rgba(255,255,255,0.08)",color:n===k.value?"#fb923c":"rgba(255,255,255,0.45)"},children:[k.icon,k.label]},k.value))})]}),i&&r.jsxs("div",{className:"mt-5 flex items-center gap-3 px-4 py-3 rounded-xl",style:{background:"rgba(249,115,22,0.08)",border:"1px solid rgba(249,115,22,0.2)"},children:[r.jsx(ne,{size:15,className:"animate-spin text-orange-400 shrink-0"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-[12px] font-semibold text-orange-300",children:"Sayfa taranıyor…"}),r.jsx("p",{className:"text-[11px] text-white/35 mt-0.5",children:"Playwright sayfayı açıyor ve içerik çıkarılıyor"})]})]}),o&&r.jsxs("div",{className:"mt-5 flex items-start gap-3 px-4 py-3 rounded-xl",style:{background:"rgba(239,68,68,0.08)",border:"1px solid rgba(239,68,68,0.25)"},children:[r.jsx(wt,{size:15,className:"text-red-400 shrink-0 mt-0.5"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-[12px] font-semibold text-red-300",children:"Hata oluştu"}),r.jsx("p",{className:"text-[11px] text-red-400/70 mt-0.5",children:o})]})]})]}),c!==null&&b.length>0&&r.jsxs("div",{className:"rounded-2xl p-5",style:{background:"rgba(13,7,3,0.75)",border:"1px solid rgba(255,255,255,0.10)",backdropFilter:"blur(20px)",boxShadow:"0 8px 40px rgba(0,0,0,0.40)"},children:[r.jsxs("div",{className:"flex items-center justify-between mb-4",children:[r.jsxs("div",{children:[r.jsx("p",{className:"text-[13px] font-bold text-white/85",children:"Çıkarılan Veriler"}),r.jsxs("p",{className:"text-[11px] text-white/35 mt-0.5",children:[b.length," öğe bulundu · ",d.size," seçili"]})]}),r.jsxs("button",{onClick:x,className:"text-[11px] font-medium text-orange-400/80 hover:text-orange-400 transition-colors flex items-center gap-1",children:[r.jsx(dn,{size:12}),d.size===b.length?"Seçimi Kaldır":"Tümünü Seç"]})]}),["text","link","image"].map(k=>{const N=b.filter(S=>S.type===k);return N.length===0?null:r.jsxs("div",{className:"mb-4 last:mb-0",children:[r.jsxs("p",{className:"text-[10px] font-bold uppercase tracking-widest text-white/25 mb-1.5 px-1",children:[N_(k)," (",N.length,")"]}),r.jsx("div",{className:"space-y-1",children:N.map(S=>r.jsxs("label",{className:"flex items-start gap-3 px-3 py-2.5 rounded-lg cursor-pointer transition-all",style:{background:d.has(S.id)?"rgba(249,115,22,0.08)":"rgba(255,255,255,0.03)",border:d.has(S.id)?"1px solid rgba(249,115,22,0.22)":"1px solid rgba(255,255,255,0.06)"},children:[r.jsx("div",{className:"w-4 h-4 rounded flex items-center justify-center shrink-0 mt-0.5 transition-all",style:{background:d.has(S.id)?"rgba(249,115,22,0.8)":"rgba(255,255,255,0.08)",border:d.has(S.id)?"1px solid rgba(249,115,22,0.9)":"1px solid rgba(255,255,255,0.18)"},onClick:()=>g(S.id),children:d.has(S.id)&&r.jsx(zt,{size:10,className:"text-white"})}),j_(S.type),r.jsx("span",{className:"text-[12px] text-white/65 leading-relaxed break-all",children:S.content})]},S.id))})]},k)}),r.jsx("div",{className:"mt-5 pt-4 border-t border-white/8",children:v?r.jsxs("div",{className:"flex items-center justify-center gap-2 py-2.5 rounded-xl text-[13px] font-semibold",style:{background:"rgba(34,197,94,0.12)",border:"1px solid rgba(34,197,94,0.25)",color:"#4ade80"},children:[r.jsx(zt,{size:14}),d.size," öğe belleğe kaydedildi"]}):r.jsx("button",{onClick:j,disabled:f||d.size===0,className:"w-full flex items-center justify-center gap-2 py-2.5 rounded-xl text-[13px] font-semibold transition-all disabled:opacity-40",style:{background:"rgba(249,115,22,0.18)",border:"1px solid rgba(249,115,22,0.35)",color:"#fb923c"},children:f?r.jsxs(r.Fragment,{children:[r.jsx(ne,{size:14,className:"animate-spin"})," Kaydediliyor…"]}):r.jsxs(r.Fragment,{children:[r.jsx(ev,{size:14})," Seçilenleri Belleğe Kaydet (",d.size,")"]})})})]}),c!==null&&b.length===0&&r.jsx("div",{className:"text-center py-10 text-[13px] text-white/25",children:"Bu modda çıkarılacak veri bulunamadı."})]})}function C_(e){return e.replace(/hey\s+must\s*-?\s*be\b/gi,"Hey Must-b").replace(/hey\s+mustbe\b/gi,"Hey Must-b").replace(/hey\s+most\s+be\b/gi,"Hey Must-b").replace(/hey\s+must\s+b\b/gi,"Hey Must-b").replace(/hey\s+must\s+bee\b/gi,"Hey Must-b").replace(/hay\s+mas+bi\b/gi,"Hey Must-b").replace(/hey\s+mas+bi\b/gi,"Hey Must-b").replace(/hey\s+mast\s*b[ei]?\b/gi,"Hey Must-b").replace(/hey\s+m[au]s[t]?\s*b[ei]?\b/gi,"Hey Must-b").replace(/hey\s+must\s*b[eiy]+\b/gi,"Hey Must-b").replace(/hey\s+moos+\s*b[ei]?\b/gi,"Hey Must-b")}function E_(e){const t=window.speechSynthesis.getVoices(),n=e.toLowerCase();return t.find(s=>s.name.toLowerCase().includes("google")&&s.lang.toLowerCase().startsWith(n))||t.find(s=>s.lang.toLowerCase().startsWith(n)&&!s.localService)||t.find(s=>s.lang.toLowerCase().startsWith(n))||null}function __(){const e=mn(),{t,locale:n}=pt(),[s,i]=h.useState("wake-listening"),[a,o]=h.useState("Must-b"),[l,c]=h.useState(""),[u,d]=h.useState(""),p=h.useRef(null),f=h.useRef(!1),m=h.useRef(""),v=h.useRef(null),y=h.useRef("wake-listening");h.useEffect(()=>{y.current=s},[s]),h.useEffect(()=>{$("/api/identity").then(N=>N.json()).then(N=>{N.name&&o(N.name)}).catch(()=>{})},[]);const b=h.useCallback(N=>{if(!window.speechSynthesis)return;window.speechSynthesis.cancel();const S=new SpeechSynthesisUtterance(N),E=n==="tr"?"tr-TR":n==="de"?"de-DE":n==="fr"?"fr-FR":n==="es"?"es-ES":n==="ja"?"ja-JP":n==="zh"?"zh-CN":n==="pt"?"pt-PT":"en-US";S.lang=E,S.rate=1.05,S.pitch=1;const P=()=>{const A=E_(E.split("-")[0]);A&&(S.voice=A)};P(),!S.voice&&window.speechSynthesis.onvoiceschanged!==void 0&&(window.speechSynthesis.onvoiceschanged=P),S.onend=()=>{i("wake-listening"),d(""),c("")},S.onerror=()=>i("wake-listening"),i("speaking"),window.speechSynthesis.speak(S)},[n]),g=h.useCallback(async N=>{if(!N.trim()){i("wake-listening");return}i("thinking"),c(N);try{const E=await(await $("/api/goal",{method:"POST",body:JSON.stringify({goal:N,voice:!0})})).json(),P=E.result??E.reply??E.response??E.output??"Done.";d(P),b(P)}catch{i("wake-listening")}},[b]),x=h.useCallback(()=>{const N=window.SpeechRecognition||window.webkitSpeechRecognition;if(!N||!f.current)return;const S=new N;S.continuous=!0,S.interimResults=!0,S.lang=n==="tr"?"tr-TR":"en-US",S.onresult=E=>{var V,R;let P="";for(let I=E.resultIndex;I<E.results.length;I++)P+=E.results[I][0].transcript;const A=C_(P),T=y.current;if(c(A),T==="wake-listening"){const I=`hey ${a}`.toLowerCase();if(A.toLowerCase().includes(I)){const L=((V=A.toLowerCase().split(I)[1])==null?void 0:V.trim())??"";m.current=L,i("cmd-listening"),v.current&&clearTimeout(v.current),v.current=setTimeout(()=>{if(m.current.trim()&&y.current==="cmd-listening"){const z=m.current;m.current="",g(z)}},1800)}}else if(T==="cmd-listening"){const I=`hey ${a}`.toLowerCase(),L=A.toLowerCase().includes(I)?((R=A.toLowerCase().split(I)[1])==null?void 0:R.trim())??A:A;m.current=L,v.current&&clearTimeout(v.current),v.current=setTimeout(()=>{if(m.current.trim()&&y.current==="cmd-listening"){const z=m.current;m.current="",g(z)}},2200)}},S.onend=()=>{const E=y.current;f.current&&E!=="thinking"&&E!=="speaking"?setTimeout(x,200):f.current||(i("off"),p.current=null)},S.onerror=E=>{E.error!=="no-speech"&&i("wake-listening"),f.current&&E.error!=="not-allowed"&&setTimeout(x,600)},p.current=S;try{S.start()}catch{}},[a,n,g]),w=()=>{var N,S;s!=="off"?(f.current=!1,(N=p.current)==null||N.stop(),(S=window.speechSynthesis)==null||S.cancel(),v.current&&clearTimeout(v.current),i("off"),c("")):(f.current=!0,i("wake-listening"),x())};h.useEffect(()=>(f.current=!0,i("wake-listening"),x(),()=>{var N,S;f.current=!1,(N=p.current)==null||N.stop(),(S=window.speechSynthesis)==null||S.cancel(),v.current&&clearTimeout(v.current)}),[]);const j=s==="wake-listening"||s==="cmd-listening",k=s==="off";return r.jsxs("div",{className:"fixed inset-0 flex flex-col items-center justify-center overflow-hidden",style:{background:"radial-gradient(ellipse at 50% 45%, rgba(249,115,22,0.22) 0%, #060301 55%)"},children:[r.jsxs("button",{onClick:()=>e("/app"),className:"absolute top-20 left-6 flex items-center gap-2 px-3 py-2 rounded-xl text-white/40 hover:text-white/80 hover:bg-white/8 transition-all text-[13px] font-medium z-10",children:[r.jsx(eC,{size:15}),r.jsx("span",{children:t.voice.back})]}),r.jsx("p",{className:"absolute top-6 text-[12px] font-bold text-white/25 tracking-[0.18em] uppercase select-none",children:t.voice.title}),[200,290,380].map((N,S)=>r.jsx(H.div,{className:"absolute rounded-full",style:{width:N,height:N,border:`1px solid rgba(249,115,22,${.12-S*.03})`},animate:j?{opacity:[.4,.7,.4],scale:[1,1.04,1]}:{opacity:.2,scale:1},transition:{duration:2.2+S*.6,repeat:1/0,ease:"easeInOut",delay:S*.4}},N)),r.jsx(H.button,{onClick:w,className:"relative w-36 h-36 rounded-full flex items-center justify-center cursor-pointer select-none mb-10",style:{background:j?"radial-gradient(circle at 38% 32%, rgba(249,115,22,0.92), rgba(160,55,8,0.75))":"radial-gradient(circle at 38% 32%, rgba(249,115,22,0.38), rgba(22,10,3,0.88))",border:`1px solid rgba(249,115,22,${j?.5:.28})`,boxShadow:j?"0 0 70px rgba(249,115,22,0.55), 0 0 140px rgba(249,115,22,0.18), inset 0 1px 0 rgba(255,255,255,0.12)":"0 0 30px rgba(249,115,22,0.12), inset 0 1px 0 rgba(255,255,255,0.05)"},animate:j?{scale:[1,1.06,1]}:{scale:1},transition:{duration:1.6,repeat:j?1/0:0,ease:"easeInOut"},whileHover:{scale:1.04},whileTap:{scale:.95},children:s==="thinking"?r.jsx(H.div,{animate:{rotate:360},transition:{duration:1,repeat:1/0,ease:"linear"},className:"w-10 h-10 rounded-full border-2 border-orange-500/30 border-t-orange-400"}):s==="speaking"?r.jsx(H.span,{animate:{scale:[.9,1.1,.9]},transition:{duration:.7,repeat:1/0,ease:"easeInOut"},className:"text-4xl",children:"🔊"}):s==="cmd-listening"?r.jsx(H.span,{animate:{opacity:[.6,1,.6]},transition:{duration:.5,repeat:1/0},children:r.jsx(Ds,{size:38,className:"text-white/95"})}):k?r.jsx(Ds,{size:38,className:"text-orange-300/90"}):r.jsx(nf,{size:38,className:"text-white/90"})}),r.jsx(se,{mode:"wait",children:r.jsxs(H.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},className:"flex flex-col items-center gap-3 px-6 text-center",children:[s==="thinking"&&r.jsx("p",{className:"text-[17px] font-medium text-white/65",children:t.voice.thinking}),s==="speaking"&&r.jsxs(r.Fragment,{children:[r.jsx("p",{className:"text-[17px] font-medium text-orange-300",children:t.voice.speakingHint}),u&&r.jsxs("p",{className:"text-[12px] text-white/35 italic max-w-sm line-clamp-3",children:["“",u.slice(0,140),u.length>140?"…":"","”"]})]}),s==="cmd-listening"&&r.jsxs(r.Fragment,{children:[r.jsx("p",{className:"text-[17px] font-medium text-white/75",children:t.voice.cmdHint}),l&&r.jsxs("p",{className:"text-[13px] text-white/40 italic max-w-sm",children:["“",l,"”"]})]}),s==="wake-listening"&&r.jsxs(r.Fragment,{children:[r.jsx("p",{className:"text-[17px] font-medium text-white/65",children:t.voice.wakeHint}),l&&r.jsxs("p",{className:"text-[13px] text-white/35 italic max-w-sm",children:["“",l,"”"]}),r.jsx("p",{className:"text-[11px] text-white/25",children:t.voice.stopHint})]}),s==="off"&&r.jsx("p",{className:"text-[17px] font-medium text-white/40",children:t.voice.tapHint}),j&&r.jsx("div",{className:"flex items-center gap-1 mt-1",children:[0,1,2,3,4].map(N=>r.jsx(H.div,{className:"w-0.5 rounded-full bg-orange-500/60",animate:{height:["6px","18px","6px"]},transition:{duration:.8,repeat:1/0,delay:N*.12,ease:"easeInOut"}},N))})]},s)})]})}function T_({id:e,size:t=16}){const n="shrink-0";switch(e){case"telegram":return r.jsx(hv,{size:t,className:n});case"whatsapp":return r.jsx(vo,{size:t,className:n});case"discord":return r.jsx(a0,{size:t,className:n});case"slack":return r.jsx(a0,{size:t,className:n});case"signal":return r.jsx(fv,{size:t,className:n});case"imessage":case"bluebubbles":return r.jsx(Os,{size:t,className:n});case"line":return r.jsx(Os,{size:t,className:n});case"msteams":return r.jsx(ud,{size:t,className:n});case"matrix":case"mattermost":case"irc":case"nextcloud-talk":return r.jsx(rl,{size:t,className:n});case"voice-call":case"talk-voice":case"phone-control":return r.jsx(PC,{size:t,className:n});case"twitch":return r.jsx(BC,{size:t,className:n});case"nostr":return r.jsx(rf,{size:t,className:n});case"googlechat":return r.jsx(vo,{size:t,className:n});case"feishu":return r.jsx(rC,{size:t,className:n});case"tlon":return r.jsx(We,{size:t,className:n});case"zalo":case"zalouser":return r.jsx(vo,{size:t,className:n});case"synology-chat":return r.jsx(vC,{size:t,className:n});case"lobster":return r.jsx(Ds,{size:t,className:n});case"memory-lancedb":case"memory-core":return r.jsx(va,{size:t,className:n});case"ollama":case"sglang":case"vllm":case"copilot-proxy":return r.jsx(fn,{size:t,className:n});case"open-prose":return r.jsx(Pl,{size:t,className:n});default:return r.jsx(AC,{size:t,className:n})}}function P_({ext:e}){var n,s,i;return e.active?r.jsxs("span",{className:"flex items-center gap-1.5 px-2 py-0.5 rounded-full text-[10px] font-bold border bg-green-500/10 border-green-500/25 text-green-400",children:[r.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-green-400 animate-pulse"}),"Active"]}):((n=e.loadError)==null?void 0:n.includes("Cannot find module"))||((s=e.loadError)==null?void 0:s.includes("MODULE_NOT_FOUND"))||((i=e.loadError)==null?void 0:i.includes("ERR_MODULE_NOT_FOUND"))?r.jsxs("span",{className:"flex items-center gap-1.5 px-2 py-0.5 rounded-full text-[10px] font-bold border bg-white/4 border-white/10 text-gray-500",children:[r.jsx(EC,{size:9,className:"shrink-0"}),"Missing Deps"]}):e.loadError?r.jsxs("span",{className:"flex items-center gap-1.5 px-2 py-0.5 rounded-full text-[10px] font-bold border bg-amber-500/8 border-amber-500/20 text-amber-500",children:[r.jsx(wt,{size:9,className:"shrink-0"}),"Error"]}):r.jsxs("span",{className:"flex items-center gap-1.5 px-2 py-0.5 rounded-full text-[10px] font-bold border bg-white/4 border-white/10 text-gray-500",children:[r.jsx(Pt,{size:9,className:"shrink-0"}),"Deferred"]})}function A_({ext:e}){var i;const t=((i=e.channel)==null?void 0:i.label)??e.id,n=e.active?"text-orange-400":"text-white/30",s=e.active?"border-orange-500/20 hover:border-orange-500/35":"border-white/6 hover:border-white/10";return r.jsxs("div",{className:`group relative flex flex-col gap-3 p-4 rounded-2xl bg-white/[0.025] border transition-all ${s}`,children:[r.jsxs("div",{className:"flex items-start justify-between gap-2",children:[r.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[r.jsx("div",{className:`w-9 h-9 rounded-xl flex items-center justify-center shrink-0 ${e.active?"bg-orange-500/12 border border-orange-500/20":"bg-white/4 border border-white/8"}`,children:r.jsx("span",{className:n,children:r.jsx(T_,{id:e.id,size:16})})}),r.jsxs("div",{className:"min-w-0",children:[r.jsx("p",{className:"text-[13px] font-semibold text-white/85 truncate leading-tight",children:t}),r.jsxs("p",{className:"text-[10px] text-gray-600 mt-0.5 font-mono",children:["v",e.version]})]})]}),r.jsx(P_,{ext:e})]}),e.description&&r.jsx("p",{className:"text-[11px] text-gray-500 leading-relaxed line-clamp-2",children:e.description}),!e.active&&e.loadError&&!e.loadError.includes("Cannot find module")&&r.jsx("p",{className:"text-[10px] text-amber-600/80 font-mono truncate border-t border-white/5 pt-2",children:e.loadError.slice(0,80)})]})}function z0({title:e,items:t}){if(t.length===0)return null;const n=t.filter(s=>s.active).length;return r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("h2",{className:"text-[11px] font-bold text-white/40 uppercase tracking-widest",children:e}),r.jsxs("span",{className:"text-[10px] text-gray-600",children:[t.length," total"]}),n>0&&r.jsxs("span",{className:"text-[10px] text-green-500 font-semibold",children:[n," active"]})]}),r.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",children:t.map(s=>r.jsx(A_,{ext:s},s.id))})]})}function M_(){return r.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",children:Array.from({length:9}).map((e,t)=>r.jsx("div",{className:"h-[100px] rounded-2xl bg-white/[0.025] border border-white/6 animate-pulse"},t))})}function R_(){const[e,t]=h.useState(null),[n,s]=h.useState(!0),[i,a]=h.useState(null),o=h.useCallback(async()=>{s(!0),a(null);try{const p=await $("/api/extensions");if(!p.ok)throw new Error(`HTTP ${p.status}`);t(await p.json())}catch(p){a(String(p))}finally{s(!1)}},[]);h.useEffect(()=>{o()},[o]);const l=(e==null?void 0:e.extensions.filter(p=>p.channel!==null).sort((p,f)=>{var m,v;return(((m=p.channel)==null?void 0:m.order)??99)-(((v=f.channel)==null?void 0:v.order)??99)}))??[],c=(e==null?void 0:e.extensions.filter(p=>p.channel===null))??[],u=(e==null?void 0:e.loaded)??0,d=(e==null?void 0:e.catalogSize)??0;return r.jsxs("div",{className:"flex-1 overflow-y-auto p-6 space-y-6",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:"w-8 h-8 rounded-xl bg-orange-500/15 border border-orange-500/25 flex items-center justify-center",children:r.jsx(rf,{size:16,className:"text-orange-400"})}),r.jsxs("div",{children:[r.jsx("h1",{className:"text-xl font-bold text-white",children:"Channels & Extensions"}),r.jsxs("p",{className:"text-[11px] text-gray-500",children:["Phase B — ",d," extensions discovered"]})]})]}),r.jsxs("div",{className:"flex items-center gap-3",children:[e&&r.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 rounded-xl bg-white/[0.025] border border-white/8",children:[u>0?r.jsxs(r.Fragment,{children:[r.jsx(Ve,{size:13,className:"text-green-400 shrink-0"}),r.jsxs("span",{className:"text-[11px] font-semibold text-green-400",children:[u," active"]})]}):r.jsxs(r.Fragment,{children:[r.jsx(Pt,{size:13,className:"text-gray-500 shrink-0"}),r.jsx("span",{className:"text-[11px] font-semibold text-gray-500",children:"0 active"})]}),r.jsx("span",{className:"text-white/15",children:"·"}),r.jsxs("span",{className:"text-[11px] text-gray-600",children:[d-u," deferred"]})]}),r.jsxs("button",{onClick:o,disabled:n,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-xl bg-white/4 border border-white/8 text-gray-400 hover:text-white/80 hover:bg-white/6 hover:border-white/12 transition-all text-[11px] font-medium disabled:opacity-40",children:[r.jsx(de,{size:12,className:n?"animate-spin":""}),"Refresh"]})]})]}),!n&&e&&u===0&&r.jsxs("div",{className:"flex items-start gap-3 p-4 rounded-xl bg-amber-500/5 border border-amber-500/15",children:[r.jsx(wt,{size:15,className:"text-amber-500 shrink-0 mt-0.5"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-[12px] font-semibold text-amber-400",children:"Extensions deferred — dependencies not installed"}),r.jsxs("p",{className:"text-[11px] text-amber-600/80 mt-0.5",children:["Channel extensions require their SDK packages (e.g. ",r.jsx("code",{className:"font-mono",children:"must-b/plugin-sdk/*"}),") and memory-lancedb requires ",r.jsx("code",{className:"font-mono",children:"@lancedb/lancedb"}),". The ExtensionLoader catalog is ready — install dependencies to activate extensions at next boot."]})]})]}),n&&!e&&r.jsx(M_,{}),i&&r.jsxs("div",{className:"flex items-center gap-3 p-4 rounded-xl bg-red-500/8 border border-red-500/15",children:[r.jsx(wt,{size:15,className:"text-red-400 shrink-0"}),r.jsx("p",{className:"text-[12px] text-red-400",children:i})]}),e&&r.jsxs("div",{className:"space-y-8",children:[r.jsx(z0,{title:"Messaging Channels",items:l}),r.jsx(z0,{title:"System Plugins",items:c})]})]})}function ts(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function L0(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function pf(...e){return t=>{let n=!1;const s=e.map(i=>{const a=L0(i,t);return!n&&typeof a=="function"&&(n=!0),a});if(n)return()=>{for(let i=0;i<s.length;i++){const a=s[i];typeof a=="function"?a():L0(e[i],null)}}}}function Ks(...e){return h.useCallback(pf(...e),e)}function z_(e,t){const n=h.createContext(t),s=a=>{const{children:o,...l}=a,c=h.useMemo(()=>l,Object.values(l));return r.jsx(n.Provider,{value:c,children:o})};s.displayName=e+"Provider";function i(a){const o=h.useContext(n);if(o)return o;if(t!==void 0)return t;throw new Error(`\`${a}\` must be used within \`${e}\``)}return[s,i]}function L_(e,t=[]){let n=[];function s(a,o){const l=h.createContext(o),c=n.length;n=[...n,o];const u=p=>{var g;const{scope:f,children:m,...v}=p,y=((g=f==null?void 0:f[e])==null?void 0:g[c])||l,b=h.useMemo(()=>v,Object.values(v));return r.jsx(y.Provider,{value:b,children:m})};u.displayName=a+"Provider";function d(p,f){var y;const m=((y=f==null?void 0:f[e])==null?void 0:y[c])||l,v=h.useContext(m);if(v)return v;if(o!==void 0)return o;throw new Error(`\`${p}\` must be used within \`${a}\``)}return[u,d]}const i=()=>{const a=n.map(o=>h.createContext(o));return function(l){const c=(l==null?void 0:l[e])||a;return h.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return i.scopeName=e,[s,O_(i,...t)]}function O_(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const s=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(a){const o=s.reduce((l,{useScope:c,scopeName:u})=>{const p=c(a)[`__scope${u}`];return{...l,...p}},{});return h.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}var la=globalThis!=null&&globalThis.document?h.useLayoutEffect:()=>{},D_=Nd[" useId ".trim().toString()]||(()=>{}),I_=0;function Fc(e){const[t,n]=h.useState(D_());return la(()=>{n(s=>s??String(I_++))},[e]),e||(t?`radix-${t}`:"")}var B_=Nd[" useInsertionEffect ".trim().toString()]||la;function F_({prop:e,defaultProp:t,onChange:n=()=>{},caller:s}){const[i,a,o]=V_({defaultProp:t,onChange:n}),l=e!==void 0,c=l?e:i;{const d=h.useRef(e!==void 0);h.useEffect(()=>{const p=d.current;p!==l&&console.warn(`${s} is changing from ${p?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),d.current=l},[l,s])}const u=h.useCallback(d=>{var p;if(l){const f=$_(d)?d(e):d;f!==e&&((p=o.current)==null||p.call(o,f))}else a(d)},[l,e,a,o]);return[c,u]}function V_({defaultProp:e,onChange:t}){const[n,s]=h.useState(e),i=h.useRef(n),a=h.useRef(t);return B_(()=>{a.current=t},[t]),h.useEffect(()=>{var o;i.current!==n&&((o=a.current)==null||o.call(a,n),i.current=n)},[n,i]),[n,s,a]}function $_(e){return typeof e=="function"}function U_(e){const t=H_(e),n=h.forwardRef((s,i)=>{const{children:a,...o}=s,l=h.Children.toArray(a),c=l.find(K_);if(c){const u=c.props.children,d=l.map(p=>p===c?h.Children.count(u)>1?h.Children.only(null):h.isValidElement(u)?u.props.children:null:p);return r.jsx(t,{...o,ref:i,children:h.isValidElement(u)?h.cloneElement(u,void 0,d):null})}return r.jsx(t,{...o,ref:i,children:a})});return n.displayName=`${e}.Slot`,n}function H_(e){const t=h.forwardRef((n,s)=>{const{children:i,...a}=n;if(h.isValidElement(i)){const o=q_(i),l=G_(a,i.props);return i.type!==h.Fragment&&(l.ref=s?pf(s,o):o),h.cloneElement(i,l)}return h.Children.count(i)>1?h.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var W_=Symbol("radix.slottable");function K_(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===W_}function G_(e,t){const n={...t};for(const s in t){const i=e[s],a=t[s];/^on[A-Z]/.test(s)?i&&a?n[s]=(...l)=>{const c=a(...l);return i(...l),c}:i&&(n[s]=i):s==="style"?n[s]={...i,...a}:s==="className"&&(n[s]=[i,a].filter(Boolean).join(" "))}return{...e,...n}}function q_(e){var s,i;let t=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Y_=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],An=Y_.reduce((e,t)=>{const n=U_(`Primitive.${t}`),s=h.forwardRef((i,a)=>{const{asChild:o,...l}=i,c=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),r.jsx(c,{...l,ref:a})});return s.displayName=`Primitive.${t}`,{...e,[t]:s}},{});function X_(e,t){e&&mh.flushSync(()=>e.dispatchEvent(t))}function ca(e){const t=h.useRef(e);return h.useEffect(()=>{t.current=e}),h.useMemo(()=>(...n)=>{var s;return(s=t.current)==null?void 0:s.call(t,...n)},[])}function Q_(e,t=globalThis==null?void 0:globalThis.document){const n=ca(e);h.useEffect(()=>{const s=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",s,{capture:!0}),()=>t.removeEventListener("keydown",s,{capture:!0})},[n,t])}var J_="DismissableLayer",yd="dismissableLayer.update",Z_="dismissableLayer.pointerDownOutside",eT="dismissableLayer.focusOutside",O0,Lv=h.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ov=h.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:l,...c}=e,u=h.useContext(Lv),[d,p]=h.useState(null),f=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,m]=h.useState({}),v=Ks(t,S=>p(S)),y=Array.from(u.layers),[b]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),g=y.indexOf(b),x=d?y.indexOf(d):-1,w=u.layersWithOutsidePointerEventsDisabled.size>0,j=x>=g,k=sT(S=>{const E=S.target,P=[...u.branches].some(A=>A.contains(E));!j||P||(i==null||i(S),o==null||o(S),S.defaultPrevented||l==null||l())},f),N=rT(S=>{const E=S.target;[...u.branches].some(A=>A.contains(E))||(a==null||a(S),o==null||o(S),S.defaultPrevented||l==null||l())},f);return Q_(S=>{x===u.layers.size-1&&(s==null||s(S),!S.defaultPrevented&&l&&(S.preventDefault(),l()))},f),h.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(O0=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),D0(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=O0)}},[d,f,n,u]),h.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),D0())},[d,u]),h.useEffect(()=>{const S=()=>m({});return document.addEventListener(yd,S),()=>document.removeEventListener(yd,S)},[]),r.jsx(An.div,{...c,ref:v,style:{pointerEvents:w?j?"auto":"none":void 0,...e.style},onFocusCapture:ts(e.onFocusCapture,N.onFocusCapture),onBlurCapture:ts(e.onBlurCapture,N.onBlurCapture),onPointerDownCapture:ts(e.onPointerDownCapture,k.onPointerDownCapture)})});Ov.displayName=J_;var tT="DismissableLayerBranch",nT=h.forwardRef((e,t)=>{const n=h.useContext(Lv),s=h.useRef(null),i=Ks(t,s);return h.useEffect(()=>{const a=s.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),r.jsx(An.div,{...e,ref:i})});nT.displayName=tT;function sT(e,t=globalThis==null?void 0:globalThis.document){const n=ca(e),s=h.useRef(!1),i=h.useRef(()=>{});return h.useEffect(()=>{const a=l=>{if(l.target&&!s.current){let c=function(){Dv(Z_,n,u,{discrete:!0})};const u={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=c,t.addEventListener("click",i.current,{once:!0})):c()}else t.removeEventListener("click",i.current);s.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",a),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>s.current=!0}}function rT(e,t=globalThis==null?void 0:globalThis.document){const n=ca(e),s=h.useRef(!1);return h.useEffect(()=>{const i=a=>{a.target&&!s.current&&Dv(eT,n,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>s.current=!0,onBlurCapture:()=>s.current=!1}}function D0(){const e=new CustomEvent(yd);document.dispatchEvent(e)}function Dv(e,t,n,{discrete:s}){const i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),s?X_(i,a):i.dispatchEvent(a)}var Vc="focusScope.autoFocusOnMount",$c="focusScope.autoFocusOnUnmount",I0={bubbles:!1,cancelable:!0},iT="FocusScope",Iv=h.forwardRef((e,t)=>{const{loop:n=!1,trapped:s=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[l,c]=h.useState(null),u=ca(i),d=ca(a),p=h.useRef(null),f=Ks(t,y=>c(y)),m=h.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;h.useEffect(()=>{if(s){let y=function(w){if(m.paused||!l)return;const j=w.target;l.contains(j)?p.current=j:Dn(p.current,{select:!0})},b=function(w){if(m.paused||!l)return;const j=w.relatedTarget;j!==null&&(l.contains(j)||Dn(p.current,{select:!0}))},g=function(w){if(document.activeElement===document.body)for(const k of w)k.removedNodes.length>0&&Dn(l)};document.addEventListener("focusin",y),document.addEventListener("focusout",b);const x=new MutationObserver(g);return l&&x.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",y),document.removeEventListener("focusout",b),x.disconnect()}}},[s,l,m.paused]),h.useEffect(()=>{if(l){F0.add(m);const y=document.activeElement;if(!l.contains(y)){const g=new CustomEvent(Vc,I0);l.addEventListener(Vc,u),l.dispatchEvent(g),g.defaultPrevented||(aT(dT(Bv(l)),{select:!0}),document.activeElement===y&&Dn(l))}return()=>{l.removeEventListener(Vc,u),setTimeout(()=>{const g=new CustomEvent($c,I0);l.addEventListener($c,d),l.dispatchEvent(g),g.defaultPrevented||Dn(y??document.body,{select:!0}),l.removeEventListener($c,d),F0.remove(m)},0)}}},[l,u,d,m]);const v=h.useCallback(y=>{if(!n&&!s||m.paused)return;const b=y.key==="Tab"&&!y.altKey&&!y.ctrlKey&&!y.metaKey,g=document.activeElement;if(b&&g){const x=y.currentTarget,[w,j]=oT(x);w&&j?!y.shiftKey&&g===j?(y.preventDefault(),n&&Dn(w,{select:!0})):y.shiftKey&&g===w&&(y.preventDefault(),n&&Dn(j,{select:!0})):g===x&&y.preventDefault()}},[n,s,m.paused]);return r.jsx(An.div,{tabIndex:-1,...o,ref:f,onKeyDown:v})});Iv.displayName=iT;function aT(e,{select:t=!1}={}){const n=document.activeElement;for(const s of e)if(Dn(s,{select:t}),document.activeElement!==n)return}function oT(e){const t=Bv(e),n=B0(t,e),s=B0(t.reverse(),e);return[n,s]}function Bv(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:s=>{const i=s.tagName==="INPUT"&&s.type==="hidden";return s.disabled||s.hidden||i?NodeFilter.FILTER_SKIP:s.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function B0(e,t){for(const n of e)if(!lT(n,{upTo:t}))return n}function lT(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function cT(e){return e instanceof HTMLInputElement&&"select"in e}function Dn(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&cT(e)&&t&&e.select()}}var F0=uT();function uT(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=V0(e,t),e.unshift(t)},remove(t){var n;e=V0(e,t),(n=e[0])==null||n.resume()}}}function V0(e,t){const n=[...e],s=n.indexOf(t);return s!==-1&&n.splice(s,1),n}function dT(e){return e.filter(t=>t.tagName!=="A")}var hT="Portal",Fv=h.forwardRef((e,t)=>{var l;const{container:n,...s}=e,[i,a]=h.useState(!1);la(()=>a(!0),[]);const o=n||i&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return o?dy.createPortal(r.jsx(An.div,{...s,ref:t}),o):null});Fv.displayName=hT;function fT(e,t){return h.useReducer((n,s)=>t[n][s]??n,e)}var Il=e=>{const{present:t,children:n}=e,s=pT(t),i=typeof n=="function"?n({present:s.isPresent}):h.Children.only(n),a=Ks(s.ref,mT(i));return typeof n=="function"||s.isPresent?h.cloneElement(i,{ref:a}):null};Il.displayName="Presence";function pT(e){const[t,n]=h.useState(),s=h.useRef(null),i=h.useRef(e),a=h.useRef("none"),o=e?"mounted":"unmounted",[l,c]=fT(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return h.useEffect(()=>{const u=Qa(s.current);a.current=l==="mounted"?u:"none"},[l]),la(()=>{const u=s.current,d=i.current;if(d!==e){const f=a.current,m=Qa(u);e?c("MOUNT"):m==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(d&&f!==m?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,c]),la(()=>{if(t){let u;const d=t.ownerDocument.defaultView??window,p=m=>{const y=Qa(s.current).includes(CSS.escape(m.animationName));if(m.target===t&&y&&(c("ANIMATION_END"),!i.current)){const b=t.style.animationFillMode;t.style.animationFillMode="forwards",u=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},f=m=>{m.target===t&&(a.current=Qa(s.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{d.clearTimeout(u),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:h.useCallback(u=>{s.current=u?getComputedStyle(u):null,n(u)},[])}}function Qa(e){return(e==null?void 0:e.animationName)||"none"}function mT(e){var s,i;let t=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Uc=0;function gT(){h.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??$0()),document.body.insertAdjacentElement("beforeend",e[1]??$0()),Uc++,()=>{Uc===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Uc--}},[])}function $0(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var rn=function(){return rn=Object.assign||function(t){for(var n,s=1,i=arguments.length;s<i;s++){n=arguments[s];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},rn.apply(this,arguments)};function Vv(e,t){var n={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0&&(n[s]=e[s]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,s=Object.getOwnPropertySymbols(e);i<s.length;i++)t.indexOf(s[i])<0&&Object.prototype.propertyIsEnumerable.call(e,s[i])&&(n[s[i]]=e[s[i]]);return n}function xT(e,t,n){if(n||arguments.length===2)for(var s=0,i=t.length,a;s<i;s++)(a||!(s in t))&&(a||(a=Array.prototype.slice.call(t,0,s)),a[s]=t[s]);return e.concat(a||Array.prototype.slice.call(t))}var No="right-scroll-bar-position",So="width-before-scroll-bar",yT="with-scroll-bars-hidden",vT="--removed-body-scroll-bar-size";function Hc(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function bT(e,t){var n=h.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(s){var i=n.value;i!==s&&(n.value=s,n.callback(s,i))}}}})[0];return n.callback=t,n.facade}var wT=typeof window<"u"?h.useLayoutEffect:h.useEffect,U0=new WeakMap;function kT(e,t){var n=bT(null,function(s){return e.forEach(function(i){return Hc(i,s)})});return wT(function(){var s=U0.get(n);if(s){var i=new Set(s),a=new Set(e),o=n.current;i.forEach(function(l){a.has(l)||Hc(l,null)}),a.forEach(function(l){i.has(l)||Hc(l,o)})}U0.set(n,e)},[e]),n}function jT(e){return e}function NT(e,t){t===void 0&&(t=jT);var n=[],s=!1,i={read:function(){if(s)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(a){var o=t(a,s);return n.push(o),function(){n=n.filter(function(l){return l!==o})}},assignSyncMedium:function(a){for(s=!0;n.length;){var o=n;n=[],o.forEach(a)}n={push:function(l){return a(l)},filter:function(){return n}}},assignMedium:function(a){s=!0;var o=[];if(n.length){var l=n;n=[],l.forEach(a),o=n}var c=function(){var d=o;o=[],d.forEach(a)},u=function(){return Promise.resolve().then(c)};u(),n={push:function(d){o.push(d),u()},filter:function(d){return o=o.filter(d),n}}}};return i}function ST(e){e===void 0&&(e={});var t=NT(null);return t.options=rn({async:!0,ssr:!1},e),t}var $v=function(e){var t=e.sideCar,n=Vv(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var s=t.read();if(!s)throw new Error("Sidecar medium not found");return h.createElement(s,rn({},n))};$v.isSideCarExport=!0;function CT(e,t){return e.useMedium(t),$v}var Uv=ST(),Wc=function(){},Bl=h.forwardRef(function(e,t){var n=h.useRef(null),s=h.useState({onScrollCapture:Wc,onWheelCapture:Wc,onTouchMoveCapture:Wc}),i=s[0],a=s[1],o=e.forwardProps,l=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,p=e.shards,f=e.sideCar,m=e.noRelative,v=e.noIsolation,y=e.inert,b=e.allowPinchZoom,g=e.as,x=g===void 0?"div":g,w=e.gapMode,j=Vv(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),k=f,N=kT([n,t]),S=rn(rn({},j),i);return h.createElement(h.Fragment,null,d&&h.createElement(k,{sideCar:Uv,removeScrollBar:u,shards:p,noRelative:m,noIsolation:v,inert:y,setCallbacks:a,allowPinchZoom:!!b,lockRef:n,gapMode:w}),o?h.cloneElement(h.Children.only(l),rn(rn({},S),{ref:N})):h.createElement(x,rn({},S,{className:c,ref:N}),l))});Bl.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Bl.classNames={fullWidth:So,zeroRight:No};var ET=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function _T(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=ET();return t&&e.setAttribute("nonce",t),e}function TT(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function PT(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var AT=function(){var e=0,t=null;return{add:function(n){e==0&&(t=_T())&&(TT(t,n),PT(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},MT=function(){var e=AT();return function(t,n){h.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Hv=function(){var e=MT(),t=function(n){var s=n.styles,i=n.dynamic;return e(s,i),null};return t},RT={left:0,top:0,right:0,gap:0},Kc=function(e){return parseInt(e||"",10)||0},zT=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],s=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[Kc(n),Kc(s),Kc(i)]},LT=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return RT;var t=zT(e),n=document.documentElement.clientWidth,s=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,s-n+t[2]-t[0])}},OT=Hv(),_r="data-scroll-locked",DT=function(e,t,n,s){var i=e.left,a=e.top,o=e.right,l=e.gap;return n===void 0&&(n="margin"),`
773
773
  .`.concat(yT,` {
774
774
  overflow: hidden `).concat(s,`;
775
775
  padding-right: `).concat(l,"px ").concat(s,`;
776
776
  }
777
- body[`).concat(Er,`] {
777
+ body[`).concat(_r,`] {
778
778
  overflow: hidden `).concat(s,`;
779
779
  overscroll-behavior: contain;
780
780
  `).concat([t&&"position: relative ".concat(s,";"),n==="margin"&&`
@@ -803,31 +803,31 @@ Burada senin hakkında öğrendiğim bilgiler yer alır.
803
803
  margin-right: 0 `).concat(s,`;
804
804
  }
805
805
 
806
- body[`).concat(Er,`] {
806
+ body[`).concat(_r,`] {
807
807
  `).concat(vT,": ").concat(l,`px;
808
808
  }
809
- `)},H0=function(){var e=parseInt(document.body.getAttribute(Er)||"0",10);return isFinite(e)?e:0},IT=function(){h.useEffect(function(){return document.body.setAttribute(Er,(H0()+1).toString()),function(){var e=H0()-1;e<=0?document.body.removeAttribute(Er):document.body.setAttribute(Er,e.toString())}},[])},BT=function(e){var t=e.noRelative,n=e.noImportant,s=e.gapMode,i=s===void 0?"margin":s;IT();var a=h.useMemo(function(){return LT(i)},[i]);return h.createElement(OT,{styles:DT(a,!t,i,n?"":"!important")})},vd=!1;if(typeof window<"u")try{var Ja=Object.defineProperty({},"passive",{get:function(){return vd=!0,!0}});window.addEventListener("test",Ja,Ja),window.removeEventListener("test",Ja,Ja)}catch{vd=!1}var Zs=vd?{passive:!1}:!1,FT=function(e){return e.tagName==="TEXTAREA"},Wv=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!FT(e)&&n[t]==="visible")},VT=function(e){return Wv(e,"overflowY")},$T=function(e){return Wv(e,"overflowX")},W0=function(e,t){var n=t.ownerDocument,s=t;do{typeof ShadowRoot<"u"&&s instanceof ShadowRoot&&(s=s.host);var i=Kv(e,s);if(i){var a=Gv(e,s),o=a[1],l=a[2];if(o>l)return!0}s=s.parentNode}while(s&&s!==n.body);return!1},UT=function(e){var t=e.scrollTop,n=e.scrollHeight,s=e.clientHeight;return[t,n,s]},HT=function(e){var t=e.scrollLeft,n=e.scrollWidth,s=e.clientWidth;return[t,n,s]},Kv=function(e,t){return e==="v"?VT(t):$T(t)},Gv=function(e,t){return e==="v"?UT(t):HT(t)},WT=function(e,t){return e==="h"&&t==="rtl"?-1:1},KT=function(e,t,n,s,i){var a=WT(e,window.getComputedStyle(t).direction),o=a*s,l=n.target,c=t.contains(l),u=!1,d=o>0,p=0,f=0;do{if(!l)break;var m=Gv(e,l),b=m[0],y=m[1],v=m[2],g=y-v-a*b;(b||g)&&Kv(e,l)&&(p+=g,f+=b);var x=l.parentNode;l=x&&x.nodeType===Node.DOCUMENT_FRAGMENT_NODE?x.host:x}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(d&&Math.abs(p)<1||!d&&Math.abs(f)<1)&&(u=!0),u},Za=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},K0=function(e){return[e.deltaX,e.deltaY]},G0=function(e){return e&&"current"in e?e.current:e},GT=function(e,t){return e[0]===t[0]&&e[1]===t[1]},qT=function(e){return`
809
+ `)},H0=function(){var e=parseInt(document.body.getAttribute(_r)||"0",10);return isFinite(e)?e:0},IT=function(){h.useEffect(function(){return document.body.setAttribute(_r,(H0()+1).toString()),function(){var e=H0()-1;e<=0?document.body.removeAttribute(_r):document.body.setAttribute(_r,e.toString())}},[])},BT=function(e){var t=e.noRelative,n=e.noImportant,s=e.gapMode,i=s===void 0?"margin":s;IT();var a=h.useMemo(function(){return LT(i)},[i]);return h.createElement(OT,{styles:DT(a,!t,i,n?"":"!important")})},vd=!1;if(typeof window<"u")try{var Ja=Object.defineProperty({},"passive",{get:function(){return vd=!0,!0}});window.addEventListener("test",Ja,Ja),window.removeEventListener("test",Ja,Ja)}catch{vd=!1}var er=vd?{passive:!1}:!1,FT=function(e){return e.tagName==="TEXTAREA"},Wv=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!FT(e)&&n[t]==="visible")},VT=function(e){return Wv(e,"overflowY")},$T=function(e){return Wv(e,"overflowX")},W0=function(e,t){var n=t.ownerDocument,s=t;do{typeof ShadowRoot<"u"&&s instanceof ShadowRoot&&(s=s.host);var i=Kv(e,s);if(i){var a=Gv(e,s),o=a[1],l=a[2];if(o>l)return!0}s=s.parentNode}while(s&&s!==n.body);return!1},UT=function(e){var t=e.scrollTop,n=e.scrollHeight,s=e.clientHeight;return[t,n,s]},HT=function(e){var t=e.scrollLeft,n=e.scrollWidth,s=e.clientWidth;return[t,n,s]},Kv=function(e,t){return e==="v"?VT(t):$T(t)},Gv=function(e,t){return e==="v"?UT(t):HT(t)},WT=function(e,t){return e==="h"&&t==="rtl"?-1:1},KT=function(e,t,n,s,i){var a=WT(e,window.getComputedStyle(t).direction),o=a*s,l=n.target,c=t.contains(l),u=!1,d=o>0,p=0,f=0;do{if(!l)break;var m=Gv(e,l),v=m[0],y=m[1],b=m[2],g=y-b-a*v;(v||g)&&Kv(e,l)&&(p+=g,f+=v);var x=l.parentNode;l=x&&x.nodeType===Node.DOCUMENT_FRAGMENT_NODE?x.host:x}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(d&&Math.abs(p)<1||!d&&Math.abs(f)<1)&&(u=!0),u},Za=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},K0=function(e){return[e.deltaX,e.deltaY]},G0=function(e){return e&&"current"in e?e.current:e},GT=function(e,t){return e[0]===t[0]&&e[1]===t[1]},qT=function(e){return`
810
810
  .block-interactivity-`.concat(e,` {pointer-events: none;}
811
811
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
812
- `)},YT=0,er=[];function XT(e){var t=h.useRef([]),n=h.useRef([0,0]),s=h.useRef(),i=h.useState(YT++)[0],a=h.useState(Hv)[0],o=h.useRef(e);h.useEffect(function(){o.current=e},[e]),h.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var y=xT([e.lockRef.current],(e.shards||[]).map(G0),!0).filter(Boolean);return y.forEach(function(v){return v.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),y.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var l=h.useCallback(function(y,v){if("touches"in y&&y.touches.length===2||y.type==="wheel"&&y.ctrlKey)return!o.current.allowPinchZoom;var g=Za(y),x=n.current,w="deltaX"in y?y.deltaX:x[0]-g[0],j="deltaY"in y?y.deltaY:x[1]-g[1],k,N=y.target,S=Math.abs(w)>Math.abs(j)?"h":"v";if("touches"in y&&S==="h"&&N.type==="range")return!1;var E=window.getSelection(),P=E&&E.anchorNode,M=P?P===N||P.contains(N):!1;if(M)return!1;var T=W0(S,N);if(!T)return!0;if(T?k=S:(k=S==="v"?"h":"v",T=W0(S,N)),!T)return!1;if(!s.current&&"changedTouches"in y&&(w||j)&&(s.current=k),!k)return!0;var V=s.current||k;return KT(V,v,y,V==="h"?w:j)},[]),c=h.useCallback(function(y){var v=y;if(!(!er.length||er[er.length-1]!==a)){var g="deltaY"in v?K0(v):Za(v),x=t.current.filter(function(k){return k.name===v.type&&(k.target===v.target||v.target===k.shadowParent)&&GT(k.delta,g)})[0];if(x&&x.should){v.cancelable&&v.preventDefault();return}if(!x){var w=(o.current.shards||[]).map(G0).filter(Boolean).filter(function(k){return k.contains(v.target)}),j=w.length>0?l(v,w[0]):!o.current.noIsolation;j&&v.cancelable&&v.preventDefault()}}},[]),u=h.useCallback(function(y,v,g,x){var w={name:y,delta:v,target:g,should:x,shadowParent:QT(g)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(j){return j!==w})},1)},[]),d=h.useCallback(function(y){n.current=Za(y),s.current=void 0},[]),p=h.useCallback(function(y){u(y.type,K0(y),y.target,l(y,e.lockRef.current))},[]),f=h.useCallback(function(y){u(y.type,Za(y),y.target,l(y,e.lockRef.current))},[]);h.useEffect(function(){return er.push(a),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:f}),document.addEventListener("wheel",c,Zs),document.addEventListener("touchmove",c,Zs),document.addEventListener("touchstart",d,Zs),function(){er=er.filter(function(y){return y!==a}),document.removeEventListener("wheel",c,Zs),document.removeEventListener("touchmove",c,Zs),document.removeEventListener("touchstart",d,Zs)}},[]);var m=e.removeScrollBar,b=e.inert;return h.createElement(h.Fragment,null,b?h.createElement(a,{styles:qT(i)}):null,m?h.createElement(BT,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function QT(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const JT=CT(Uv,XT);var qv=h.forwardRef(function(e,t){return h.createElement(Bl,rn({},e,{ref:t,sideCar:JT}))});qv.classNames=Bl.classNames;var ZT=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},tr=new WeakMap,eo=new WeakMap,to={},Gc=0,Yv=function(e){return e&&(e.host||Yv(e.parentNode))},eP=function(e,t){return t.map(function(n){if(e.contains(n))return n;var s=Yv(n);return s&&e.contains(s)?s:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},tP=function(e,t,n,s){var i=eP(t,Array.isArray(e)?e:[e]);to[n]||(to[n]=new WeakMap);var a=to[n],o=[],l=new Set,c=new Set(i),u=function(p){!p||l.has(p)||(l.add(p),u(p.parentNode))};i.forEach(u);var d=function(p){!p||c.has(p)||Array.prototype.forEach.call(p.children,function(f){if(l.has(f))d(f);else try{var m=f.getAttribute(s),b=m!==null&&m!=="false",y=(tr.get(f)||0)+1,v=(a.get(f)||0)+1;tr.set(f,y),a.set(f,v),o.push(f),y===1&&b&&eo.set(f,!0),v===1&&f.setAttribute(n,"true"),b||f.setAttribute(s,"true")}catch(g){console.error("aria-hidden: cannot operate on ",f,g)}})};return d(t),l.clear(),Gc++,function(){o.forEach(function(p){var f=tr.get(p)-1,m=a.get(p)-1;tr.set(p,f),a.set(p,m),f||(eo.has(p)||p.removeAttribute(s),eo.delete(p)),m||p.removeAttribute(n)}),Gc--,Gc||(tr=new WeakMap,tr=new WeakMap,eo=new WeakMap,to={})}},nP=function(e,t,n){n===void 0&&(n="data-aria-hidden");var s=Array.from(Array.isArray(e)?e:[e]),i=ZT(e);return i?(s.push.apply(s,Array.from(i.querySelectorAll("[aria-live], script"))),tP(s,i,n,"aria-hidden")):function(){return null}};function sP(e){const t=rP(e),n=h.forwardRef((s,i)=>{const{children:a,...o}=s,l=h.Children.toArray(a),c=l.find(aP);if(c){const u=c.props.children,d=l.map(p=>p===c?h.Children.count(u)>1?h.Children.only(null):h.isValidElement(u)?u.props.children:null:p);return r.jsx(t,{...o,ref:i,children:h.isValidElement(u)?h.cloneElement(u,void 0,d):null})}return r.jsx(t,{...o,ref:i,children:a})});return n.displayName=`${e}.Slot`,n}function rP(e){const t=h.forwardRef((n,s)=>{const{children:i,...a}=n;if(h.isValidElement(i)){const o=lP(i),l=oP(a,i.props);return i.type!==h.Fragment&&(l.ref=s?pf(s,o):o),h.cloneElement(i,l)}return h.Children.count(i)>1?h.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var iP=Symbol("radix.slottable");function aP(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===iP}function oP(e,t){const n={...t};for(const s in t){const i=e[s],a=t[s];/^on[A-Z]/.test(s)?i&&a?n[s]=(...l)=>{const c=a(...l);return i(...l),c}:i&&(n[s]=i):s==="style"?n[s]={...i,...a}:s==="className"&&(n[s]=[i,a].filter(Boolean).join(" "))}return{...e,...n}}function lP(e){var s,i;let t=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Fl="Dialog",[Xv]=L_(Fl),[cP,Jt]=Xv(Fl),Qv=e=>{const{__scopeDialog:t,children:n,open:s,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,l=h.useRef(null),c=h.useRef(null),[u,d]=F_({prop:s,defaultProp:i??!1,onChange:a,caller:Fl});return r.jsx(cP,{scope:t,triggerRef:l,contentRef:c,contentId:Fc(),titleId:Fc(),descriptionId:Fc(),open:u,onOpenChange:d,onOpenToggle:h.useCallback(()=>d(p=>!p),[d]),modal:o,children:n})};Qv.displayName=Fl;var Jv="DialogTrigger",uP=h.forwardRef((e,t)=>{const{__scopeDialog:n,...s}=e,i=Jt(Jv,n),a=Ws(t,i.triggerRef);return r.jsx(Mn.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":xf(i.open),...s,ref:a,onClick:ts(e.onClick,i.onOpenToggle)})});uP.displayName=Jv;var mf="DialogPortal",[dP,Zv]=Xv(mf,{forceMount:void 0}),eb=e=>{const{__scopeDialog:t,forceMount:n,children:s,container:i}=e,a=Jt(mf,t);return r.jsx(dP,{scope:t,forceMount:n,children:h.Children.map(s,o=>r.jsx(Il,{present:n||a.open,children:r.jsx(Fv,{asChild:!0,container:i,children:o})}))})};eb.displayName=mf;var il="DialogOverlay",tb=h.forwardRef((e,t)=>{const n=Zv(il,e.__scopeDialog),{forceMount:s=n.forceMount,...i}=e,a=Jt(il,e.__scopeDialog);return a.modal?r.jsx(Il,{present:s||a.open,children:r.jsx(fP,{...i,ref:t})}):null});tb.displayName=il;var hP=sP("DialogOverlay.RemoveScroll"),fP=h.forwardRef((e,t)=>{const{__scopeDialog:n,...s}=e,i=Jt(il,n);return r.jsx(qv,{as:hP,allowPinchZoom:!0,shards:[i.contentRef],children:r.jsx(Mn.div,{"data-state":xf(i.open),...s,ref:t,style:{pointerEvents:"auto",...s.style}})})}),Is="DialogContent",nb=h.forwardRef((e,t)=>{const n=Zv(Is,e.__scopeDialog),{forceMount:s=n.forceMount,...i}=e,a=Jt(Is,e.__scopeDialog);return r.jsx(Il,{present:s||a.open,children:a.modal?r.jsx(pP,{...i,ref:t}):r.jsx(mP,{...i,ref:t})})});nb.displayName=Is;var pP=h.forwardRef((e,t)=>{const n=Jt(Is,e.__scopeDialog),s=h.useRef(null),i=Ws(t,n.contentRef,s);return h.useEffect(()=>{const a=s.current;if(a)return nP(a)},[]),r.jsx(sb,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ts(e.onCloseAutoFocus,a=>{var o;a.preventDefault(),(o=n.triggerRef.current)==null||o.focus()}),onPointerDownOutside:ts(e.onPointerDownOutside,a=>{const o=a.detail.originalEvent,l=o.button===0&&o.ctrlKey===!0;(o.button===2||l)&&a.preventDefault()}),onFocusOutside:ts(e.onFocusOutside,a=>a.preventDefault())})}),mP=h.forwardRef((e,t)=>{const n=Jt(Is,e.__scopeDialog),s=h.useRef(!1),i=h.useRef(!1);return r.jsx(sb,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var o,l;(o=e.onCloseAutoFocus)==null||o.call(e,a),a.defaultPrevented||(s.current||(l=n.triggerRef.current)==null||l.focus(),a.preventDefault()),s.current=!1,i.current=!1},onInteractOutside:a=>{var c,u;(c=e.onInteractOutside)==null||c.call(e,a),a.defaultPrevented||(s.current=!0,a.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const o=a.target;((u=n.triggerRef.current)==null?void 0:u.contains(o))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&i.current&&a.preventDefault()}})}),sb=h.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,l=Jt(Is,n),c=h.useRef(null),u=Ws(t,c);return gT(),r.jsxs(r.Fragment,{children:[r.jsx(Iv,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:i,onUnmountAutoFocus:a,children:r.jsx(Ov,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":xf(l.open),...o,ref:u,onDismiss:()=>l.onOpenChange(!1)})}),r.jsxs(r.Fragment,{children:[r.jsx(gP,{titleId:l.titleId}),r.jsx(yP,{contentRef:c,descriptionId:l.descriptionId})]})]})}),gf="DialogTitle",rb=h.forwardRef((e,t)=>{const{__scopeDialog:n,...s}=e,i=Jt(gf,n);return r.jsx(Mn.h2,{id:i.titleId,...s,ref:t})});rb.displayName=gf;var ib="DialogDescription",ab=h.forwardRef((e,t)=>{const{__scopeDialog:n,...s}=e,i=Jt(ib,n);return r.jsx(Mn.p,{id:i.descriptionId,...s,ref:t})});ab.displayName=ib;var ob="DialogClose",lb=h.forwardRef((e,t)=>{const{__scopeDialog:n,...s}=e,i=Jt(ob,n);return r.jsx(Mn.button,{type:"button",...s,ref:t,onClick:ts(e.onClick,()=>i.onOpenChange(!1))})});lb.displayName=ob;function xf(e){return e?"open":"closed"}var cb="DialogTitleWarning",[O6,ub]=z_(cb,{contentName:Is,titleName:gf,docsSlug:"dialog"}),gP=({titleId:e})=>{const t=ub(cb),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
812
+ `)},YT=0,tr=[];function XT(e){var t=h.useRef([]),n=h.useRef([0,0]),s=h.useRef(),i=h.useState(YT++)[0],a=h.useState(Hv)[0],o=h.useRef(e);h.useEffect(function(){o.current=e},[e]),h.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var y=xT([e.lockRef.current],(e.shards||[]).map(G0),!0).filter(Boolean);return y.forEach(function(b){return b.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),y.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var l=h.useCallback(function(y,b){if("touches"in y&&y.touches.length===2||y.type==="wheel"&&y.ctrlKey)return!o.current.allowPinchZoom;var g=Za(y),x=n.current,w="deltaX"in y?y.deltaX:x[0]-g[0],j="deltaY"in y?y.deltaY:x[1]-g[1],k,N=y.target,S=Math.abs(w)>Math.abs(j)?"h":"v";if("touches"in y&&S==="h"&&N.type==="range")return!1;var E=window.getSelection(),P=E&&E.anchorNode,A=P?P===N||P.contains(N):!1;if(A)return!1;var T=W0(S,N);if(!T)return!0;if(T?k=S:(k=S==="v"?"h":"v",T=W0(S,N)),!T)return!1;if(!s.current&&"changedTouches"in y&&(w||j)&&(s.current=k),!k)return!0;var V=s.current||k;return KT(V,b,y,V==="h"?w:j)},[]),c=h.useCallback(function(y){var b=y;if(!(!tr.length||tr[tr.length-1]!==a)){var g="deltaY"in b?K0(b):Za(b),x=t.current.filter(function(k){return k.name===b.type&&(k.target===b.target||b.target===k.shadowParent)&&GT(k.delta,g)})[0];if(x&&x.should){b.cancelable&&b.preventDefault();return}if(!x){var w=(o.current.shards||[]).map(G0).filter(Boolean).filter(function(k){return k.contains(b.target)}),j=w.length>0?l(b,w[0]):!o.current.noIsolation;j&&b.cancelable&&b.preventDefault()}}},[]),u=h.useCallback(function(y,b,g,x){var w={name:y,delta:b,target:g,should:x,shadowParent:QT(g)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(j){return j!==w})},1)},[]),d=h.useCallback(function(y){n.current=Za(y),s.current=void 0},[]),p=h.useCallback(function(y){u(y.type,K0(y),y.target,l(y,e.lockRef.current))},[]),f=h.useCallback(function(y){u(y.type,Za(y),y.target,l(y,e.lockRef.current))},[]);h.useEffect(function(){return tr.push(a),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:f}),document.addEventListener("wheel",c,er),document.addEventListener("touchmove",c,er),document.addEventListener("touchstart",d,er),function(){tr=tr.filter(function(y){return y!==a}),document.removeEventListener("wheel",c,er),document.removeEventListener("touchmove",c,er),document.removeEventListener("touchstart",d,er)}},[]);var m=e.removeScrollBar,v=e.inert;return h.createElement(h.Fragment,null,v?h.createElement(a,{styles:qT(i)}):null,m?h.createElement(BT,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function QT(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const JT=CT(Uv,XT);var qv=h.forwardRef(function(e,t){return h.createElement(Bl,rn({},e,{ref:t,sideCar:JT}))});qv.classNames=Bl.classNames;var ZT=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},nr=new WeakMap,eo=new WeakMap,to={},Gc=0,Yv=function(e){return e&&(e.host||Yv(e.parentNode))},eP=function(e,t){return t.map(function(n){if(e.contains(n))return n;var s=Yv(n);return s&&e.contains(s)?s:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},tP=function(e,t,n,s){var i=eP(t,Array.isArray(e)?e:[e]);to[n]||(to[n]=new WeakMap);var a=to[n],o=[],l=new Set,c=new Set(i),u=function(p){!p||l.has(p)||(l.add(p),u(p.parentNode))};i.forEach(u);var d=function(p){!p||c.has(p)||Array.prototype.forEach.call(p.children,function(f){if(l.has(f))d(f);else try{var m=f.getAttribute(s),v=m!==null&&m!=="false",y=(nr.get(f)||0)+1,b=(a.get(f)||0)+1;nr.set(f,y),a.set(f,b),o.push(f),y===1&&v&&eo.set(f,!0),b===1&&f.setAttribute(n,"true"),v||f.setAttribute(s,"true")}catch(g){console.error("aria-hidden: cannot operate on ",f,g)}})};return d(t),l.clear(),Gc++,function(){o.forEach(function(p){var f=nr.get(p)-1,m=a.get(p)-1;nr.set(p,f),a.set(p,m),f||(eo.has(p)||p.removeAttribute(s),eo.delete(p)),m||p.removeAttribute(n)}),Gc--,Gc||(nr=new WeakMap,nr=new WeakMap,eo=new WeakMap,to={})}},nP=function(e,t,n){n===void 0&&(n="data-aria-hidden");var s=Array.from(Array.isArray(e)?e:[e]),i=ZT(e);return i?(s.push.apply(s,Array.from(i.querySelectorAll("[aria-live], script"))),tP(s,i,n,"aria-hidden")):function(){return null}};function sP(e){const t=rP(e),n=h.forwardRef((s,i)=>{const{children:a,...o}=s,l=h.Children.toArray(a),c=l.find(aP);if(c){const u=c.props.children,d=l.map(p=>p===c?h.Children.count(u)>1?h.Children.only(null):h.isValidElement(u)?u.props.children:null:p);return r.jsx(t,{...o,ref:i,children:h.isValidElement(u)?h.cloneElement(u,void 0,d):null})}return r.jsx(t,{...o,ref:i,children:a})});return n.displayName=`${e}.Slot`,n}function rP(e){const t=h.forwardRef((n,s)=>{const{children:i,...a}=n;if(h.isValidElement(i)){const o=lP(i),l=oP(a,i.props);return i.type!==h.Fragment&&(l.ref=s?pf(s,o):o),h.cloneElement(i,l)}return h.Children.count(i)>1?h.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var iP=Symbol("radix.slottable");function aP(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===iP}function oP(e,t){const n={...t};for(const s in t){const i=e[s],a=t[s];/^on[A-Z]/.test(s)?i&&a?n[s]=(...l)=>{const c=a(...l);return i(...l),c}:i&&(n[s]=i):s==="style"?n[s]={...i,...a}:s==="className"&&(n[s]=[i,a].filter(Boolean).join(" "))}return{...e,...n}}function lP(e){var s,i;let t=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Fl="Dialog",[Xv]=L_(Fl),[cP,Jt]=Xv(Fl),Qv=e=>{const{__scopeDialog:t,children:n,open:s,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,l=h.useRef(null),c=h.useRef(null),[u,d]=F_({prop:s,defaultProp:i??!1,onChange:a,caller:Fl});return r.jsx(cP,{scope:t,triggerRef:l,contentRef:c,contentId:Fc(),titleId:Fc(),descriptionId:Fc(),open:u,onOpenChange:d,onOpenToggle:h.useCallback(()=>d(p=>!p),[d]),modal:o,children:n})};Qv.displayName=Fl;var Jv="DialogTrigger",uP=h.forwardRef((e,t)=>{const{__scopeDialog:n,...s}=e,i=Jt(Jv,n),a=Ks(t,i.triggerRef);return r.jsx(An.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":xf(i.open),...s,ref:a,onClick:ts(e.onClick,i.onOpenToggle)})});uP.displayName=Jv;var mf="DialogPortal",[dP,Zv]=Xv(mf,{forceMount:void 0}),eb=e=>{const{__scopeDialog:t,forceMount:n,children:s,container:i}=e,a=Jt(mf,t);return r.jsx(dP,{scope:t,forceMount:n,children:h.Children.map(s,o=>r.jsx(Il,{present:n||a.open,children:r.jsx(Fv,{asChild:!0,container:i,children:o})}))})};eb.displayName=mf;var il="DialogOverlay",tb=h.forwardRef((e,t)=>{const n=Zv(il,e.__scopeDialog),{forceMount:s=n.forceMount,...i}=e,a=Jt(il,e.__scopeDialog);return a.modal?r.jsx(Il,{present:s||a.open,children:r.jsx(fP,{...i,ref:t})}):null});tb.displayName=il;var hP=sP("DialogOverlay.RemoveScroll"),fP=h.forwardRef((e,t)=>{const{__scopeDialog:n,...s}=e,i=Jt(il,n);return r.jsx(qv,{as:hP,allowPinchZoom:!0,shards:[i.contentRef],children:r.jsx(An.div,{"data-state":xf(i.open),...s,ref:t,style:{pointerEvents:"auto",...s.style}})})}),Is="DialogContent",nb=h.forwardRef((e,t)=>{const n=Zv(Is,e.__scopeDialog),{forceMount:s=n.forceMount,...i}=e,a=Jt(Is,e.__scopeDialog);return r.jsx(Il,{present:s||a.open,children:a.modal?r.jsx(pP,{...i,ref:t}):r.jsx(mP,{...i,ref:t})})});nb.displayName=Is;var pP=h.forwardRef((e,t)=>{const n=Jt(Is,e.__scopeDialog),s=h.useRef(null),i=Ks(t,n.contentRef,s);return h.useEffect(()=>{const a=s.current;if(a)return nP(a)},[]),r.jsx(sb,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ts(e.onCloseAutoFocus,a=>{var o;a.preventDefault(),(o=n.triggerRef.current)==null||o.focus()}),onPointerDownOutside:ts(e.onPointerDownOutside,a=>{const o=a.detail.originalEvent,l=o.button===0&&o.ctrlKey===!0;(o.button===2||l)&&a.preventDefault()}),onFocusOutside:ts(e.onFocusOutside,a=>a.preventDefault())})}),mP=h.forwardRef((e,t)=>{const n=Jt(Is,e.__scopeDialog),s=h.useRef(!1),i=h.useRef(!1);return r.jsx(sb,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var o,l;(o=e.onCloseAutoFocus)==null||o.call(e,a),a.defaultPrevented||(s.current||(l=n.triggerRef.current)==null||l.focus(),a.preventDefault()),s.current=!1,i.current=!1},onInteractOutside:a=>{var c,u;(c=e.onInteractOutside)==null||c.call(e,a),a.defaultPrevented||(s.current=!0,a.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const o=a.target;((u=n.triggerRef.current)==null?void 0:u.contains(o))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&i.current&&a.preventDefault()}})}),sb=h.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,l=Jt(Is,n),c=h.useRef(null),u=Ks(t,c);return gT(),r.jsxs(r.Fragment,{children:[r.jsx(Iv,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:i,onUnmountAutoFocus:a,children:r.jsx(Ov,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":xf(l.open),...o,ref:u,onDismiss:()=>l.onOpenChange(!1)})}),r.jsxs(r.Fragment,{children:[r.jsx(gP,{titleId:l.titleId}),r.jsx(yP,{contentRef:c,descriptionId:l.descriptionId})]})]})}),gf="DialogTitle",rb=h.forwardRef((e,t)=>{const{__scopeDialog:n,...s}=e,i=Jt(gf,n);return r.jsx(An.h2,{id:i.titleId,...s,ref:t})});rb.displayName=gf;var ib="DialogDescription",ab=h.forwardRef((e,t)=>{const{__scopeDialog:n,...s}=e,i=Jt(ib,n);return r.jsx(An.p,{id:i.descriptionId,...s,ref:t})});ab.displayName=ib;var ob="DialogClose",lb=h.forwardRef((e,t)=>{const{__scopeDialog:n,...s}=e,i=Jt(ob,n);return r.jsx(An.button,{type:"button",...s,ref:t,onClick:ts(e.onClick,()=>i.onOpenChange(!1))})});lb.displayName=ob;function xf(e){return e?"open":"closed"}var cb="DialogTitleWarning",[D6,ub]=z_(cb,{contentName:Is,titleName:gf,docsSlug:"dialog"}),gP=({titleId:e})=>{const t=ub(cb),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
813
813
 
814
814
  If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
815
815
 
816
- For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return h.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},xP="DialogDescriptionWarning",yP=({contentRef:e,descriptionId:t})=>{const s=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${ub(xP).contentName}}.`;return h.useEffect(()=>{var a;const i=(a=e.current)==null?void 0:a.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(s))},[s,e,t]),null},vP=Qv,bP=eb,wP=tb,kP=nb,jP=rb,NP=ab,q0=lb;const SP={Messaging:{icon:"💬",accent:"text-blue-300",border:"border-blue-500/20",bg:"bg-blue-500/10"},Finance:{icon:"📈",accent:"text-emerald-300",border:"border-emerald-500/20",bg:"bg-emerald-500/10"},System:{icon:"⚙️",accent:"text-orange-300",border:"border-orange-500/20",bg:"bg-orange-500/10"}};function CP(e){return SP[e]??{icon:"🔌",accent:"text-gray-300",border:"border-white/10",bg:"bg-white/5"}}function EP({name:e}){return r.jsx("span",{className:"inline-block px-2 py-0.5 rounded-md text-[10px] font-mono bg-white/5 text-gray-400 border border-white/8",children:e})}function _P({pack:e,installing:t,installLog:n,onInstall:s,onConfigure:i}){const[a,o]=h.useState(!1),l=CP(e.category),c=e.extensions.length===0;return r.jsxs("div",{className:`flex flex-col bg-white/[0.03] border ${l.border} rounded-2xl p-5 gap-3 hover:bg-white/[0.05] transition-all duration-200`,children:[r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx("div",{className:`w-12 h-12 rounded-xl ${l.bg} flex items-center justify-center text-[24px] shrink-0 select-none border ${l.border}`,children:l.icon}),r.jsxs("div",{className:"min-w-0 flex-1",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("h3",{className:"text-white font-bold text-[15px] leading-snug",children:e.name}),e.installed&&r.jsx(br,{size:14,className:"text-emerald-400 shrink-0"})]}),r.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[r.jsx("span",{className:`text-[10px] font-semibold uppercase tracking-wider ${l.accent}`,children:e.category}),!c&&r.jsxs("span",{className:"text-[10px] text-gray-500",children:[e.extensions.length," extension",e.extensions.length!==1?"s":""]}),c&&r.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded-md bg-yellow-500/10 text-yellow-500 border border-yellow-500/20 font-medium",children:"Coming Soon"})]})]})]}),r.jsx("p",{className:"text-gray-400 text-[13px] leading-relaxed",children:e.description}),r.jsx("p",{className:"text-[11px] font-mono text-gray-600",children:e.npmPackage}),e.extensions.length>0&&r.jsxs("div",{children:[r.jsxs("button",{onClick:()=>o(u=>!u),className:"flex items-center gap-1 text-[11px] text-gray-500 hover:text-gray-300 transition-colors mb-2",children:[a?r.jsx(Ml,{size:12}):r.jsx(Kr,{size:12}),a?"Hide":"Show"," included extensions"]}),a&&r.jsx("div",{className:"flex flex-wrap gap-1.5",children:e.extensions.map(u=>r.jsx(EP,{name:u},u))})]}),t&&n&&r.jsx("pre",{className:"text-[10px] text-gray-500 bg-black/30 rounded-lg p-2.5 max-h-[72px] overflow-y-auto font-mono whitespace-pre-wrap break-all",children:n}),r.jsx("div",{className:"mt-auto pt-1",children:c?r.jsx("div",{className:"w-full py-2 rounded-xl text-[12px] font-medium text-center bg-white/3 text-gray-600 border border-white/8 cursor-default select-none",children:"Not yet available"}):e.installed?r.jsx("button",{onClick:i,className:"w-full py-2 rounded-xl text-[12px] font-medium bg-emerald-500/10 text-emerald-400 border border-emerald-500/20 hover:bg-emerald-500/15 hover:border-emerald-500/30 transition-colors",children:"Installed — Configure Keys"}):r.jsx("button",{onClick:s,disabled:t,className:`w-full flex items-center justify-center gap-2 py-2 rounded-xl text-[12px] font-medium ${l.bg} ${l.accent} border ${l.border} hover:brightness-125 disabled:opacity-50 disabled:cursor-not-allowed transition-all`,children:t?r.jsxs(r.Fragment,{children:[r.jsx(ne,{size:13,className:"animate-spin shrink-0"}),r.jsx("span",{children:"Installing pack…"})]}):r.jsxs(r.Fragment,{children:[r.jsx(qr,{size:13,className:"shrink-0"}),r.jsx("span",{children:"Install Pack"})]})})})]})}function TP({pack:e,onClose:t}){const[n,s]=h.useState({}),[i,a]=h.useState(!1);h.useEffect(()=>{e&&s({})},[e]);const o=async()=>{if(e){a(!0);try{if(!(await $("/api/store/configure",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({keys:n})})).ok)throw new Error("Configure request failed");ue.success(`${e.name} configured — keys saved to .env`),t()}catch(c){ue.error(c instanceof Error?c.message:"Configure failed")}finally{a(!1)}}},l={};for(const c of(e==null?void 0:e.requiredKeys)??[]){const u=c.forExtension??"general";(l[u]??(l[u]=[])).push(c)}return r.jsx(vP,{open:!!e,onOpenChange:c=>{c||t()},children:r.jsxs(bP,{children:[r.jsx(wP,{className:"fixed inset-0 z-50 bg-black/70 backdrop-blur-sm"}),r.jsxs(kP,{className:"fixed z-50 left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 w-full max-w-[460px] mx-4 bg-[#0d1117] border border-white/10 rounded-2xl p-6 shadow-2xl max-h-[85vh] overflow-y-auto",children:[r.jsxs("div",{className:"flex items-center justify-between mb-1",children:[r.jsxs(jP,{className:"text-white font-semibold text-[15px]",children:["Configure ",e==null?void 0:e.name]}),r.jsx(q0,{className:"w-7 h-7 flex items-center justify-center rounded-lg text-gray-500 hover:text-gray-300 hover:bg-white/5 transition-colors",children:r.jsx(et,{size:15})})]}),r.jsxs(NP,{className:"text-gray-400 text-[12px] mb-5 leading-relaxed",children:["Fill in the keys for the extensions you want to use. Leave others blank — they can be added later. Keys are saved to your local"," ",r.jsx("code",{className:"font-mono text-gray-300 bg-white/5 px-1 rounded",children:".env"})," file."]}),r.jsx("div",{className:"space-y-5",children:Object.entries(l).map(([c,u])=>r.jsxs("div",{children:[r.jsx("p",{className:"text-[10px] font-bold uppercase tracking-widest text-gray-600 mb-2.5",children:c}),r.jsx("div",{className:"space-y-3",children:u.map(d=>r.jsxs("div",{children:[r.jsx("label",{className:"block text-[12px] font-medium text-gray-300 mb-1",children:d.label}),d.hint&&r.jsx("p",{className:"text-[11px] text-gray-500 mb-1.5",children:d.hint}),r.jsx("input",{type:"password",autoComplete:"off",value:n[d.env]??"",onChange:p=>s(f=>({...f,[d.env]:p.target.value})),className:"w-full bg-white/5 border border-white/10 rounded-xl px-3 py-2.5 text-sm text-white placeholder-gray-700 focus:outline-none focus:border-orange-500/40 focus:bg-white/[0.06] transition-colors font-mono",placeholder:`Enter ${d.label}`})]},d.env))})]},c))}),r.jsxs("div",{className:"flex items-center gap-3 mt-6",children:[r.jsxs("button",{onClick:o,disabled:i,className:"flex-1 flex items-center justify-center gap-2 bg-orange-600 hover:bg-orange-500 disabled:opacity-60 text-white rounded-xl py-2.5 text-[13px] font-semibold transition-all active:scale-[0.97]",children:[i?r.jsx(ne,{size:14,className:"animate-spin"}):r.jsx(br,{size:14}),"Save & Activate"]}),r.jsx(q0,{className:"px-4 py-2.5 text-[13px] text-gray-400 hover:text-gray-300 transition-colors rounded-xl hover:bg-white/5",children:"Skip"})]})]})]})})}function PP(){const[e,t]=h.useState([]),[n,s]=h.useState(!0),[i,a]=h.useState(null),[o,l]=h.useState({}),[c,u]=h.useState(null),d=h.useCallback(async()=>{try{const m=await $("/api/store/extensions");m.ok&&t(await m.json())}catch{}finally{s(!1)}},[]);h.useEffect(()=>{d()},[d]);const p=h.useCallback(async m=>{a(m.id);try{const b=await $("/api/store/install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:m.id})});if(!b.body)throw new Error("No response stream");const y=b.body.getReader(),v=new TextDecoder;let g="";for(;;){const{done:x,value:w}=await y.read();if(x)break;g+=v.decode(w),l(j=>({...j,[m.id]:g}))}g.includes("__MUSTB_INSTALL_OK__")?(ue.success(`${m.name} installed!`),t(x=>x.map(w=>w.id===m.id?{...w,installed:!0}:w)),m.requiredKeys.length>0&&u(m)):ue.error(`${m.name} installation failed.`)}catch(b){ue.error(b instanceof Error?b.message:"Install failed")}finally{a(null)}},[]),f=e.filter(m=>m.installed).length;return r.jsxs("div",{className:"min-h-screen bg-[#02040a] px-6 py-10",children:[r.jsxs("div",{className:"max-w-5xl mx-auto",children:[r.jsxs("div",{className:"flex items-start justify-between gap-4 mb-3",children:[r.jsxs("div",{children:[r.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[r.jsx(pv,{size:22,className:"text-orange-400"}),r.jsx("h1",{className:"text-[22px] font-bold text-white tracking-tight",children:"Extension Store"}),f>0&&r.jsxs("span",{className:"text-[11px] px-2 py-0.5 rounded-full bg-emerald-500/10 text-emerald-400 border border-emerald-500/20 font-medium",children:[f," installed"]})]}),r.jsxs("p",{className:"text-gray-400 text-[13px] leading-relaxed max-w-2xl",children:["Extensions are grouped into themed packs."," ","Install one pack to get all its integrations — fetched directly from npm into"," ",r.jsx("code",{className:"font-mono text-gray-300 bg-white/5 px-1.5 py-0.5 rounded text-[11px]",children:"~/.must-b/extensions/"})]})]}),r.jsx("button",{onClick:()=>{s(!0),d()},title:"Refresh",className:"p-2 rounded-lg text-gray-600 hover:text-gray-300 hover:bg-white/5 transition-colors shrink-0",children:r.jsx(de,{size:15})})]}),r.jsxs("div",{className:"mb-8 px-3 py-2.5 rounded-xl bg-white/[0.02] border border-white/8 flex items-center gap-3",children:[r.jsx("code",{className:"text-[11px] font-mono text-gray-500 shrink-0",children:"CLI:"}),r.jsxs("code",{className:"text-[12px] font-mono text-gray-400",children:[r.jsx("span",{className:"text-orange-400",children:"must-b ext list"})," · ",r.jsx("span",{className:"text-orange-400",children:"must-b ext install channels"})," · ",r.jsx("span",{className:"text-orange-400",children:"must-b ext install system"})]})]}),n?r.jsxs("div",{className:"flex flex-col items-center justify-center py-24 gap-3",children:[r.jsx(ne,{size:22,className:"animate-spin text-orange-400"}),r.jsx("p",{className:"text-gray-500 text-[13px]",children:"Loading extension store…"})]}):r.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-5",children:e.map(m=>r.jsx(_P,{pack:m,installing:i===m.id,installLog:o[m.id]??"",onInstall:()=>p(m),onConfigure:()=>u(m)},m.id))}),r.jsxs("p",{className:"text-center text-gray-700 text-[11px] mt-12",children:["Packs are built with"," ",r.jsx("code",{className:"font-mono bg-white/5 px-1 rounded",children:"npm run build:packs"})," ","and published to npm. Run"," ",r.jsx("code",{className:"font-mono bg-white/5 px-1 rounded",children:"must-b ext list"})," ","for the CLI interface."]})]}),r.jsx(TP,{pack:c,onClose:()=>u(null)})]})}function Y0(e){return e>=90?"#ef4444":e>=70?"#f97316":"#22c55e"}function li(e){return e==="critical"?"#ef4444":e==="warning"?"#f97316":"#60a5fa"}function MP(){const{t:e,locale:t}=pt(),n=e.systemHealth,[s,i]=h.useState(null),[a,o]=h.useState(null),[l,c]=h.useState(!1),u=h.useCallback(()=>o(null),[]);h.useEffect(()=>{window.dispatchEvent(new CustomEvent("mustb:safeMode",{detail:{active:(s==null?void 0:s.safeMode)??!1}}))},[s==null?void 0:s.safeMode]),h.useEffect(()=>{const f=at();return f.on("systemStats",m=>i(m)),f.on("systemHealth",m=>{if(o(m),c(!0),m.level!=="critical"){const b=m.level==="info"?6e3:12e3;setTimeout(()=>o(null),b)}}),()=>{f.off("systemStats"),f.off("systemHealth")}},[]);const d=(s==null?void 0:s.cpu)??0,p=(s==null?void 0:s.ram)??0;return r.jsxs("div",{className:"relative flex items-center",children:[r.jsxs("button",{onClick:()=>a&&c(f=>!f),className:"flex items-center gap-1.5 select-none transition-all rounded-md",style:{cursor:a?"pointer":"default"},title:a?a.message:n.title,children:[a?r.jsx("span",{className:"w-2 h-2 rounded-full flex-shrink-0 animate-pulse",style:{background:li(a.level)}}):r.jsx(fn,{size:12,className:"text-orange-400/70"}),s&&r.jsxs("span",{className:"hidden sm:flex items-center gap-1.5",children:[r.jsx("span",{className:"text-[10px] font-semibold text-white/45",children:"CPU"}),r.jsx("span",{className:"w-9 h-1 rounded-full bg-white/10 overflow-hidden flex-shrink-0",children:r.jsx("span",{className:"h-full rounded-full block transition-all duration-700",style:{width:`${d}%`,background:Y0(d)}})}),r.jsxs("span",{className:"text-[9px] font-mono text-white/40 w-6 text-right",children:[d,"%"]}),r.jsx("span",{className:"w-px h-3 bg-white/10"}),r.jsx("span",{className:"text-[10px] font-semibold text-white/45",children:"RAM"}),r.jsx("span",{className:"w-9 h-1 rounded-full bg-white/10 overflow-hidden flex-shrink-0",children:r.jsx("span",{className:"h-full rounded-full block transition-all duration-700",style:{width:`${p}%`,background:Y0(p)}})}),r.jsxs("span",{className:"text-[9px] font-mono text-white/40 w-6 text-right",children:[p,"%"]}),s.liteMode&&!s.safeMode&&r.jsx("span",{className:"text-[8px] font-bold px-1 py-0.5 rounded bg-orange-500/20 text-orange-400 ml-0.5",children:n.lite}),s.safeMode&&r.jsx("span",{className:"text-[8px] font-bold px-1 py-0.5 rounded bg-red-500/20 text-red-400 ml-0.5",children:n.safe})]}),!s&&r.jsx("span",{className:"text-[10px] font-semibold hidden sm:inline text-white/35",children:n.title})]}),r.jsx(se,{children:l&&a&&r.jsxs(H.div,{initial:{opacity:0,y:8,scale:.96},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:8,scale:.96},transition:{duration:.2,ease:"easeOut"},className:"absolute top-full right-0 mt-2 w-72 z-[200] rounded-2xl overflow-hidden",style:{background:"rgba(20,8,2,0.88)",border:`1px solid ${li(a.level)}44`,backdropFilter:"blur(20px)",boxShadow:`0 8px 32px rgba(0,0,0,0.5), 0 0 0 1px ${li(a.level)}22`},children:[r.jsxs("div",{className:"flex items-start justify-between px-4 pt-3 pb-2",style:{borderBottom:`1px solid ${li(a.level)}22`},children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(os,{size:13,style:{color:li(a.level)}}),r.jsxs("span",{className:"text-[12px] font-bold text-white/90 capitalize",children:[n[a.level]??a.level," — ",n.kinds[a.kind]??a.kind]})]}),r.jsx("button",{onClick:u,className:"text-white/30 hover:text-white/70 transition-colors",children:r.jsx(et,{size:13})})]}),r.jsxs("div",{className:"px-4 py-3 space-y-2",children:[r.jsx("p",{className:"text-[13px] text-white/80 leading-relaxed",children:n.alerts[a.kind]??a.message}),r.jsx("p",{className:"text-[11px] text-white/45 leading-relaxed italic",children:n.recommendations[a.kind]??a.recommendation})]}),r.jsx("div",{className:"px-4 pb-3",children:r.jsx("span",{className:"text-[10px] text-white/25 font-mono",children:new Date(a.ts).toLocaleTimeString()})})]},"health-popover")})]})}function AP(e){return`${Math.round(e*100)}%`}const X0={skill:{label:"Skill",icon:ze,color:"text-orange-400"},conversation:{label:"Conversation",icon:Os,color:"text-blue-400"},workspace:{label:"Workspace",icon:ps,color:"text-green-400"},custom:{label:"Custom",icon:Qt,color:"text-gray-400"}};function RP(){const{t:e}=pt(),t=e.panels.memory,[n,s]=h.useState(""),[i,a]=h.useState([]),[o,l]=h.useState(null),[c,u]=h.useState(!1),[d,p]=h.useState(null),[f,m]=h.useState(null),[b,y]=h.useState(!1),v=h.useRef(null),g=h.useCallback(async k=>{const N=k.trim();if(N){u(!0),a([]);try{const S=await $(`/api/memory/search?q=${encodeURIComponent(N)}&limit=10`);if(S.ok){const E=await S.json();a(E.results??[])}}catch{}u(!1)}},[]),x=k=>{k.key==="Enter"&&g(n)},w=h.useCallback(async()=>{try{const k=await $("/api/memory/stats");k.ok&&l(await k.json())}catch{}},[]),j=async k=>{p(k),m(null);try{const N=k==="clear"?await $("/api/memory/clear-index",{method:"DELETE"}):await $(`/api/memory/index-${k}`,{method:"POST"});if(N.ok){const S=await N.json(),E=k==="clear"?t.indexCleared:`${t.indexed} ${S.indexed??0} ${k==="skills"?t.skills:t.files}`;m({ok:!0,msg:E}),w(),k==="clear"&&a([])}else m({ok:!1,msg:t.opFailed})}catch{m({ok:!1,msg:t.reqError})}p(null),setTimeout(()=>m(null),4e3)};return r.jsxs("div",{className:"h-full flex flex-col overflow-hidden bg-[#080b12]",children:[r.jsxs("div",{className:"flex items-center justify-between px-6 py-3 border-b border-white/5 shrink-0",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Yt,{size:14,className:"text-orange-400"}),r.jsx("span",{className:"text-[13px] font-bold text-gray-300",children:t.title}),o&&r.jsxs("span",{className:"text-[10px] text-gray-600 bg-white/5 px-2 py-0.5 rounded-full font-mono",children:[o.items.toLocaleString()," ",t.vectors]})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("button",{onClick:()=>{y(k=>!k),o||w()},className:`text-gray-600 hover:text-gray-400 transition-colors ${b?"text-orange-400":""}`,title:t.indexControls,children:r.jsx(OC,{size:13})}),r.jsx("button",{onClick:w,className:"text-gray-600 hover:text-gray-400 transition-colors",title:t.refreshStats,children:r.jsx(de,{size:13})})]})]}),r.jsx(se,{children:b&&r.jsxs(H.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},className:"border-b border-white/5 bg-white/2 overflow-hidden shrink-0",children:[r.jsxs("div",{className:"px-6 py-3 flex flex-wrap items-center gap-2",children:[r.jsx("span",{className:"text-[10px] text-gray-600 uppercase tracking-widest font-bold shrink-0",children:t.indexLabel}),["skills","workspace"].map(k=>r.jsxs("button",{onClick:()=>j(k),disabled:d!==null,className:"flex items-center gap-1 px-2.5 py-1 rounded-lg bg-white/4 border border-white/6 text-[11px] text-gray-400 hover:text-gray-200 hover:bg-white/8 transition-all disabled:opacity-40 capitalize",children:[d===k?r.jsx(ne,{size:10,className:"animate-spin"}):k==="skills"?r.jsx(ze,{size:10}):r.jsx(ps,{size:10}),k]},k)),r.jsxs("button",{onClick:()=>j("clear"),disabled:d!==null,className:"flex items-center gap-1 px-2.5 py-1 rounded-lg bg-red-500/8 border border-red-500/15 text-[11px] text-red-400 hover:bg-red-500/15 transition-all disabled:opacity-40 ml-auto",children:[d==="clear"?r.jsx(ne,{size:10,className:"animate-spin"}):r.jsx(Us,{size:10}),t.clearIndex]})]}),r.jsx(se,{children:f&&r.jsxs(H.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:`flex items-center gap-1.5 px-6 pb-3 text-[11px] font-medium ${f.ok?"text-green-400":"text-red-400"}`,children:[f.ok?r.jsx(Ve,{size:11}):r.jsx(wt,{size:11}),f.msg]})})]})}),r.jsxs("div",{className:"px-6 py-3 border-b border-white/5 shrink-0",children:[r.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 rounded-xl bg-white/4 border border-white/8 focus-within:border-orange-500/30 transition-colors",children:[r.jsx(Xt,{size:13,className:"text-gray-600 shrink-0"}),r.jsx("input",{ref:v,value:n,onChange:k=>s(k.target.value),onKeyDown:x,placeholder:t.searchPlaceholder,className:"flex-1 bg-transparent text-[13px] text-gray-200 outline-none placeholder-gray-700"}),c?r.jsx(ne,{size:13,className:"text-orange-400 animate-spin shrink-0"}):r.jsx("button",{onClick:()=>g(n),disabled:!n.trim(),className:"text-[10px] px-2 py-0.5 rounded-lg bg-orange-500/12 text-orange-400 font-semibold hover:bg-orange-500/22 border border-orange-500/20 transition-all disabled:opacity-30",children:"⌘↵"})]}),r.jsx("p",{className:"text-[10px] text-gray-700 mt-1.5 ml-1",children:t.searchHint})]}),r.jsxs("div",{className:"flex-1 overflow-y-auto scrollbar-hide p-4 space-y-3",children:[i.length===0&&!c&&r.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[r.jsx(Yt,{size:36,className:"text-gray-700 mb-4"}),r.jsx("p",{className:"text-sm font-semibold text-gray-500",children:n.trim()?t.emptyNoResults:t.emptyTitle}),r.jsx("p",{className:"text-xs text-gray-700 mt-1 max-w-xs leading-relaxed",children:n.trim()?t.emptyNoResultsHint:t.emptyHint})]}),i.map((k,N)=>{const S=X0[k.metadata.source]??X0.custom,E=S.icon;return r.jsxs(H.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{delay:N*.04},className:"rounded-2xl border border-white/6 bg-[#0c0f18] p-4 hover:border-white/12 transition-all",children:[r.jsxs("div",{className:"flex items-start justify-between gap-2 mb-2",children:[r.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[r.jsx(E,{size:11,className:`${S.color} shrink-0`}),r.jsx("p",{className:"text-[12px] font-semibold text-gray-300 truncate",children:k.metadata.title})]}),r.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[r.jsx("span",{className:`text-[9px] font-bold px-1.5 py-0.5 rounded-full border ${k.score>=.85?"bg-green-500/10 border-green-500/20 text-green-400":k.score>=.65?"bg-orange-500/10 border-orange-500/20 text-orange-400":"bg-white/4 border-white/6 text-gray-500"}`,children:AP(k.score)}),r.jsx("span",{className:`text-[9px] px-1.5 py-0.5 rounded-full bg-white/4 border border-white/6 font-medium ${S.color}`,children:S.label})]})]}),r.jsx("p",{className:"text-[11px] text-gray-500 leading-relaxed line-clamp-3 mb-2",children:k.text}),k.metadata.tags&&k.metadata.tags.length>0&&r.jsx("div",{className:"flex flex-wrap gap-1",children:k.metadata.tags.map((P,M)=>r.jsx("span",{className:"text-[9px] px-1.5 py-0.5 rounded-md bg-white/4 text-gray-600 font-mono",children:P},M))}),r.jsx("div",{className:"mt-2 h-0.5 bg-white/4 rounded-full overflow-hidden",children:r.jsx("div",{className:"h-full rounded-full bg-gradient-to-r from-orange-600 to-amber-400",style:{width:`${k.score*100}%`}})})]},N)})]})]})}const zP={node:hn,python:yn},LP={node:"text-green-400",python:"text-blue-400"};function OP(){const{t:e}=pt(),t=e.panels.plugins,[n,s]=h.useState([]),[i,a]=h.useState(!1),[o,l]=h.useState(null),[c,u]=h.useState(null),[d,p]=h.useState(!1),[f,m]=h.useState(""),[b,y]=h.useState(""),[v,g]=h.useState("node"),[x,w]=h.useState(""),[j,k]=h.useState(!1),N=(M,T)=>{u({ok:M,msg:T}),setTimeout(()=>u(null),4e3)},S=h.useCallback(async()=>{a(!0);try{const M=await $("/api/plugins/list");if(M.ok){const T=await M.json();s(T.plugins??[])}}catch{}a(!1)},[]);h.useEffect(()=>{S()},[S]);const E=async(M,T)=>{l(M);try{(await $(T?"/api/plugins/stop":"/api/plugins/run",{method:"POST",body:JSON.stringify({name:M})})).ok?(N(!0,T?`${M} stopped`:`${M} launched`),await S()):N(!1,t.opFailed)}catch{N(!1,t.reqError)}l(null)},P=async()=>{if(!(!f.trim()||!b.trim())){k(!0);try{(await $("/api/plugins/build",{method:"POST",body:JSON.stringify({name:f.trim(),goal:b.trim(),lang:v,context:x.trim()||void 0})})).ok?(N(!0,`Plugin "${f}" created`),m(""),y(""),w(""),p(!1),await S()):N(!1,t.buildFailed)}catch{N(!1,t.reqError)}k(!1)}};return r.jsxs("div",{className:"h-full flex flex-col overflow-hidden bg-[#080b12]",children:[r.jsxs("div",{className:"flex items-center justify-between px-6 py-3 border-b border-white/5 shrink-0",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Ir,{size:14,className:"text-orange-400"}),r.jsx("span",{className:"text-[13px] font-bold text-gray-300",children:t.title}),r.jsxs("span",{className:"text-[10px] text-gray-600 bg-white/5 px-2 py-0.5 rounded-full font-mono",children:[n.length," ",t.installed]})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("button",{onClick:S,className:"text-gray-600 hover:text-gray-400 transition-colors",title:t.refresh,children:r.jsx(de,{size:13,className:i?"animate-spin":""})}),r.jsxs("button",{onClick:()=>p(M=>!M),className:`flex items-center gap-1 text-[10px] px-2.5 py-1 rounded-lg border font-semibold transition-all ${d?"bg-orange-500/15 border-orange-500/25 text-orange-400":"bg-white/4 border-white/8 text-gray-500 hover:text-gray-300"}`,children:[r.jsx(zl,{size:10}),t.newPlugin]})]})]}),r.jsx(se,{children:c&&r.jsxs(H.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:`flex items-center gap-1.5 px-6 py-2 text-[11px] font-medium shrink-0 ${c.ok?"text-green-400":"text-red-400"}`,children:[c.ok?r.jsx(Ve,{size:11}):r.jsx(wt,{size:11}),c.msg]})}),r.jsx(se,{children:d&&r.jsx(H.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},className:"border-b border-white/5 bg-white/2 overflow-hidden shrink-0",children:r.jsxs("div",{className:"px-6 py-4 space-y-3",children:[r.jsx("p",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-widest",children:t.buildTitle}),r.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[r.jsx("input",{value:f,onChange:M=>m(M.target.value),placeholder:t.namePlaceholder,className:"col-span-2 px-3 py-2 rounded-lg bg-white/4 border border-white/8 text-[12px] text-gray-200 outline-none placeholder-gray-700 focus:border-orange-500/30 transition-colors"}),r.jsx("input",{value:b,onChange:M=>y(M.target.value),placeholder:t.goalPlaceholder,className:"col-span-2 px-3 py-2 rounded-lg bg-white/4 border border-white/8 text-[12px] text-gray-200 outline-none placeholder-gray-700 focus:border-orange-500/30 transition-colors"}),r.jsx("input",{value:x,onChange:M=>w(M.target.value),placeholder:t.contextPlaceholder,className:"col-span-2 px-3 py-2 rounded-lg bg-white/4 border border-white/8 text-[12px] text-gray-200 outline-none placeholder-gray-700 focus:border-orange-500/30 transition-colors"}),r.jsx("div",{className:"flex gap-2",children:["node","python"].map(M=>r.jsx("button",{onClick:()=>g(M),className:`flex-1 py-1.5 rounded-lg border text-[11px] font-semibold transition-all capitalize ${v===M?"bg-orange-500/15 border-orange-500/25 text-orange-400":"bg-white/4 border-white/8 text-gray-500"}`,children:M},M))}),r.jsxs("button",{onClick:P,disabled:j||!f.trim()||!b.trim(),className:"flex items-center justify-center gap-1.5 py-2 rounded-lg bg-orange-500/12 border border-orange-500/20 text-orange-400 text-[11px] font-bold hover:bg-orange-500/20 transition-all disabled:opacity-40",children:[j?r.jsx(ne,{size:11,className:"animate-spin"}):r.jsx(ze,{size:11}),t.generatePlugin]})]})]})})}),r.jsxs("div",{className:"flex-1 overflow-y-auto scrollbar-hide p-4 space-y-2",children:[n.length===0&&!i&&r.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[r.jsx(Ir,{size:36,className:"text-gray-700 mb-4"}),r.jsx("p",{className:"text-sm font-semibold text-gray-500",children:t.emptyTitle}),r.jsx("p",{className:"text-xs text-gray-700 mt-1",children:t.emptyHint})]}),n.map((M,T)=>{const V=zP[M.lang]??hn,R=o===M.name;return r.jsxs(H.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{delay:T*.04},className:`flex items-center gap-3 p-3 rounded-2xl border transition-all ${M.running?"bg-green-500/5 border-green-500/15 hover:border-green-500/25":"bg-[#0c0f18] border-white/6 hover:border-white/12"}`,children:[r.jsx(V,{size:13,className:LP[M.lang]??"text-gray-400"}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("p",{className:"text-[12px] font-semibold text-gray-300 truncate",children:M.name}),r.jsx("p",{className:"text-[10px] text-gray-600 font-mono",children:M.filename})]}),M.running&&r.jsx("span",{className:"text-[9px] px-1.5 py-0.5 rounded-full bg-green-500/12 border border-green-500/20 text-green-400 font-bold",children:t.running}),r.jsxs("button",{disabled:R,onClick:()=>E(M.name,M.running),className:`flex items-center gap-1 px-2.5 py-1.5 rounded-lg border text-[10px] font-bold transition-all disabled:opacity-40 ${M.running?"bg-red-500/8 border-red-500/15 text-red-400 hover:bg-red-500/15":"bg-green-500/8 border-green-500/15 text-green-400 hover:bg-green-500/15"}`,children:[R?r.jsx(ne,{size:10,className:"animate-spin"}):M.running?r.jsx(of,{size:10}):r.jsx($s,{size:10}),M.running?t.stop:t.run]})]},M.name)})]})]})}function DP(e){if(!e)return"Never";try{return new Date(e).toLocaleString("en-US",{dateStyle:"short",timeStyle:"short"})}catch{return e}}function IP(e){const t=Date.now()-new Date(e).getTime(),n=Math.floor(t/6e4);if(n<1)return"just now";if(n<60)return`${n}m ago`;const s=Math.floor(n/60);return s<24?`${s}h ago`:`${Math.floor(s/24)}d ago`}function BP({skill:e}){const[t,n]=h.useState(!1),[s,i]=h.useState(!1),[a,o]=h.useState(""),[l,c]=h.useState(!1),u=async()=>{if(!l){c(!0);return}if(a.trim()){n(!0);try{await $("/api/v1/skills/invoke",{method:"POST",body:JSON.stringify({skill:e.id,params:{goal:a.trim(),_autoRun:!0}})}),i(!0),c(!1),o(""),setTimeout(()=>i(!1),3e3)}catch{}n(!1)}},d=(e.requires.bins??[]).length>0,p=(e.requires.config??[]).length>0;return r.jsx(H.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},className:"rounded-2xl border border-white/6 bg-[#0c0f18] hover:border-white/12 transition-all",children:r.jsxs("div",{className:"p-3",children:[r.jsxs("div",{className:"flex items-start gap-2 mb-1.5",children:[r.jsx("span",{className:"text-base leading-none mt-0.5 shrink-0",children:e.emoji??"⚡"}),r.jsx("div",{className:"flex-1 min-w-0",children:r.jsx("p",{className:"text-[12px] font-bold text-gray-200 truncate capitalize",children:e.name})}),e.hasScripts&&r.jsx(as,{size:10,className:"text-gray-700 shrink-0 mt-0.5"})]}),r.jsx("p",{className:"text-[10px] text-gray-500 leading-relaxed line-clamp-2 mb-2 ml-6",children:e.description}),(d||p)&&r.jsxs("div",{className:"flex flex-wrap gap-1 mb-2 ml-6",children:[(e.requires.bins??[]).map(f=>r.jsxs("span",{className:"text-[9px] px-1.5 py-0.5 rounded bg-blue-500/8 border border-blue-500/15 text-blue-400 font-mono",children:["bin:",f]},f)),(e.requires.config??[]).map(f=>r.jsxs("span",{className:"text-[9px] px-1.5 py-0.5 rounded bg-purple-500/8 border border-purple-500/15 text-purple-400 font-mono",children:["cfg:",f]},f))]}),r.jsx(se,{children:l&&r.jsx(H.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},className:"overflow-hidden mb-2",children:r.jsx("input",{autoFocus:!0,value:a,onChange:f=>o(f.target.value),onKeyDown:f=>{f.key==="Enter"&&u(),f.key==="Escape"&&(c(!1),o(""))},placeholder:`Goal for ${e.name}…`,className:"w-full px-2.5 py-1.5 rounded-lg bg-white/4 border border-white/10 text-[11px] text-gray-200 placeholder-gray-700 outline-none focus:border-orange-500/30 transition-colors"})})}),r.jsxs("div",{className:"flex items-center justify-end gap-1 ml-6",children:[l&&r.jsx("button",{onClick:()=>{c(!1),o("")},className:"text-[10px] px-2 py-1 rounded-lg bg-white/4 text-gray-600 hover:text-gray-400 transition-colors",children:"Cancel"}),r.jsx("button",{onClick:u,disabled:t||l&&!a.trim(),className:`flex items-center gap-1 px-2.5 py-1 rounded-lg text-[10px] font-semibold border transition-all disabled:opacity-40 ${s?"bg-green-500/10 border-green-500/20 text-green-400":"bg-orange-500/8 border-orange-500/15 text-orange-400 hover:bg-orange-500/15"}`,children:t?r.jsx(ne,{size:9,className:"animate-spin"}):s?r.jsxs(r.Fragment,{children:[r.jsx(Ve,{size:9})," Sent"]}):l?r.jsxs(r.Fragment,{children:[r.jsx(dn,{size:9})," Run"]}):r.jsxs(r.Fragment,{children:[r.jsx(zC,{size:9})," Use"]})})]})]})})}function FP(){const{t:e}=pt(),t=e.panels.skills,[n,s]=h.useState("saved"),[i,a]=h.useState([]),[o,l]=h.useState(!1),[c,u]=h.useState(null),[d,p]=h.useState("idle"),[f,m]=h.useState(null),[b,y]=h.useState(null),[v,g]=h.useState([]),[x,w]=h.useState(!1),[j,k]=h.useState(""),N=h.useCallback(async()=>{l(!0);try{const T=await $("/api/skills/list");if(T.ok){const V=await T.json();a(V.skills??[])}}catch{}l(!1)},[]),S=h.useCallback(async()=>{w(!0);try{const T=await $("/api/skills/catalog");if(T.ok){const V=await T.json();g(V.skills??[])}}catch{}w(!1)},[]);h.useEffect(()=>{N()},[N]),h.useEffect(()=>{n==="library"&&v.length===0&&S()},[n,v.length,S]),h.useEffect(()=>{const T=at(),V=R=>{R.type==="skillRunStart"&&R.skillId&&(u(R.skillId),p("running")),R.type==="planFinish"&&(p("done"),u(null),N(),setTimeout(()=>p("idle"),2500))};return T.on("agentUpdate",V),()=>{T.off("agentUpdate",V)}},[N]);const E=async T=>{if(!c){u(T.id),p("running");try{const V=await $("/api/skills/run",{method:"POST",body:JSON.stringify({id:T.id})});if(!V.ok)throw new Error(`HTTP ${V.status}`)}catch{p("error"),u(null),setTimeout(()=>p("idle"),3e3)}}},P=async T=>{m(T);try{await $(`/api/skills/${T}`,{method:"DELETE"}),a(V=>V.filter(R=>R.id!==T))}catch{}m(null),y(null)},M=j.trim()?v.filter(T=>T.name.toLowerCase().includes(j.toLowerCase())||T.description.toLowerCase().includes(j.toLowerCase())):v;return r.jsxs("div",{className:"h-full flex flex-col overflow-hidden bg-[#080b12]",children:[r.jsxs("div",{className:"flex items-center justify-between px-6 py-3 border-b border-white/5 shrink-0",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Pl,{size:14,className:"text-orange-400"}),r.jsx("span",{className:"text-[13px] font-bold text-gray-300",children:t.title})]}),r.jsxs("div",{className:"flex items-center gap-1 bg-white/4 rounded-lg p-0.5",children:[r.jsxs("button",{onClick:()=>s("saved"),className:`flex items-center gap-1 px-2.5 py-1 rounded-md text-[10px] font-semibold transition-all ${n==="saved"?"bg-orange-500/15 text-orange-400":"text-gray-600 hover:text-gray-400"}`,children:[r.jsx(ze,{size:9}),"Saved",i.length>0&&r.jsx("span",{className:"text-[9px] font-mono text-gray-600",children:i.length})]}),r.jsxs("button",{onClick:()=>s("library"),className:`flex items-center gap-1 px-2.5 py-1 rounded-md text-[10px] font-semibold transition-all ${n==="library"?"bg-orange-500/15 text-orange-400":"text-gray-600 hover:text-gray-400"}`,children:[r.jsx(Mc,{size:9}),"Library",v.length>0&&r.jsx("span",{className:"text-[9px] font-mono text-gray-600",children:v.length})]})]}),r.jsx("button",{onClick:n==="saved"?N:S,disabled:n==="saved"?o:x,className:"text-gray-600 hover:text-gray-400 transition-colors",title:"Refresh",children:r.jsx(de,{size:13,className:(n==="saved"?o:x)?"animate-spin":""})})]}),n==="saved"&&r.jsxs(r.Fragment,{children:[r.jsx(se,{children:d!=="idle"&&r.jsxs(H.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},className:`px-6 py-2 border-b flex items-center gap-2 text-xs font-medium ${d==="running"?"bg-orange-500/8 border-orange-500/15 text-orange-400":d==="done"?"bg-green-500/8 border-green-500/15 text-green-400":"bg-red-500/8 border-red-500/15 text-red-400"}`,children:[d==="running"&&r.jsx(ne,{size:12,className:"animate-spin"}),d==="done"&&r.jsx(Ve,{size:12}),d==="error"&&r.jsx(wt,{size:12}),d==="running"?t.runningStatus:d==="done"?t.completedStatus:t.failedStatus]})}),r.jsx("div",{className:"flex-1 overflow-y-auto scrollbar-hide p-4 space-y-3",children:o&&i.length===0?r.jsxs("div",{className:"flex items-center justify-center py-16 text-gray-700 text-xs gap-2",children:[r.jsx(ne,{size:13,className:"animate-spin"})," ",t.loading]}):i.length===0?r.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[r.jsx(ze,{size:36,className:"text-gray-700 mb-4"}),r.jsx("p",{className:"text-sm font-semibold text-gray-500",children:t.emptyTitle}),r.jsxs("p",{className:"text-xs text-gray-700 mt-1 max-w-xs",children:[t.emptyHint," ",r.jsx("span",{className:"text-orange-400 font-medium",children:t.saveAsSkill})," ",t.emptyHint2]}),r.jsxs("button",{onClick:()=>s("library"),className:"mt-4 flex items-center gap-1.5 text-[11px] text-orange-400 hover:text-orange-300 transition-colors",children:[r.jsx(Mc,{size:11})," Browse skill library"]})]}):i.map((T,V)=>{const R=c===T.id&&d==="running",I=c===T.id&&d==="done",L=f===T.id;return r.jsx(H.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:V*.04},className:`rounded-2xl border bg-[#0c0f18] transition-all ${R?"border-orange-500/30 shadow-[0_0_12px_rgba(234,88,12,0.12)]":I?"border-green-500/20":"border-white/6 hover:border-white/12"}`,children:r.jsxs("div",{className:"p-4",children:[r.jsxs("div",{className:"flex items-start justify-between gap-2 mb-2",children:[r.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[r.jsx(ze,{size:13,className:"text-orange-400 shrink-0 mt-0.5"}),r.jsx("p",{className:"text-[13px] font-bold text-white truncate",children:T.name})]}),r.jsxs("div",{className:"flex items-center gap-1.5 text-[10px] text-gray-600 shrink-0 font-mono",children:[r.jsx(tv,{size:9}),T.runCount,"×"]})]}),r.jsx("p",{className:"text-[11px] text-gray-500 leading-relaxed mb-2 line-clamp-2",children:T.goal}),T.steps.length>0&&r.jsxs("div",{className:"flex flex-wrap gap-1 mb-3",children:[T.steps.slice(0,4).map((z,B)=>r.jsx("span",{className:"text-[9px] px-1.5 py-0.5 rounded-md bg-white/4 text-gray-600 font-mono",children:z.tool??"step"},B)),T.steps.length>4&&r.jsxs("span",{className:"text-[9px] px-1.5 py-0.5 rounded-md bg-white/4 text-gray-600 font-mono",children:["+",T.steps.length-4," more"]})]}),r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"flex items-center gap-1 text-[10px] text-gray-700",children:[r.jsx(Pt,{size:9}),r.jsx("span",{children:IP(T.savedAt)}),T.lastRunAt&&r.jsxs("span",{className:"text-gray-800",children:["· ",t.lastRun," ",DP(T.lastRunAt)]})]}),r.jsxs("div",{className:"flex items-center gap-1",children:[b===T.id?r.jsxs("div",{className:"flex items-center gap-1",children:[r.jsx("span",{className:"text-[10px] text-red-400",children:t.deleteConfirm}),r.jsx("button",{onClick:()=>P(T.id),disabled:L,className:"text-[10px] px-2 py-0.5 rounded bg-red-500/15 text-red-400 hover:bg-red-500/25 transition-colors",children:L?"…":t.yes}),r.jsx("button",{onClick:()=>y(null),className:"text-[10px] px-2 py-0.5 rounded bg-white/5 text-gray-500 hover:bg-white/8",children:t.no})]}):r.jsx("button",{onClick:()=>y(T.id),className:"p-1.5 rounded-lg text-gray-700 hover:text-red-400 hover:bg-red-500/8 transition-all",title:"Delete skill",children:r.jsx(Us,{size:12})}),r.jsx("button",{onClick:()=>E(T),disabled:!!c,className:`flex items-center gap-1.5 px-3 py-1.5 rounded-xl text-[11px] font-semibold transition-all ${R?"bg-orange-500/15 text-orange-400 border border-orange-500/25 cursor-not-allowed":I?"bg-green-500/12 text-green-400 border border-green-500/20":"bg-orange-500/10 hover:bg-orange-500/20 text-orange-400 border border-orange-500/20 hover:border-orange-500/35 disabled:opacity-40 disabled:cursor-not-allowed"}`,children:R?r.jsxs(r.Fragment,{children:[r.jsx(ne,{size:11,className:"animate-spin"})," ",t.runningBtn]}):I?r.jsxs(r.Fragment,{children:[r.jsx(Ve,{size:11})," ",t.doneBtn]}):r.jsxs(r.Fragment,{children:[r.jsx($s,{size:11})," ",t.runBtn]})})]})]})]})},T.id)})})]}),n==="library"&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"px-4 py-2.5 border-b border-white/5 shrink-0",children:r.jsx("input",{value:j,onChange:T=>k(T.target.value),placeholder:"Search skills…",className:"w-full px-3 py-1.5 rounded-lg bg-white/4 border border-white/8 text-[11px] text-gray-300 placeholder-gray-700 outline-none focus:border-orange-500/25 transition-colors"})}),r.jsx("div",{className:"flex-1 overflow-y-auto scrollbar-hide p-3 grid grid-cols-1 gap-2",children:x&&v.length===0?r.jsxs("div",{className:"flex items-center justify-center py-16 text-gray-700 text-xs gap-2 col-span-1",children:[r.jsx(ne,{size:13,className:"animate-spin"})," Loading skill library…"]}):M.length===0?r.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center col-span-1",children:[r.jsx(Mc,{size:36,className:"text-gray-700 mb-3"}),r.jsx("p",{className:"text-sm font-semibold text-gray-500",children:"No skills found"}),j&&r.jsx("button",{onClick:()=>k(""),className:"mt-2 text-[11px] text-orange-400 hover:text-orange-300",children:"Clear filter"})]}):M.map((T,V)=>r.jsx(H.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{delay:Math.min(V*.02,.4)},children:r.jsx(BP,{skill:T})},T.id))}),v.length>0&&r.jsx("div",{className:"px-4 py-2 border-t border-white/5 shrink-0 flex items-center gap-1.5",children:r.jsxs("span",{className:"text-[10px] text-gray-700 font-mono",children:[M.length," / ",v.length," skills"]})})]})]})}const VP={html:i0,htm:i0,json:yn,js:yn,ts:yn,tsx:yn,jsx:yn};function $P(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function UP(e){try{return new Date(e).toLocaleString("en-US",{dateStyle:"short",timeStyle:"short"})}catch{return e}}function HP(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)/g,t=>{let n="color:#86efac";return/^"/.test(t)&&(n=/:$/.test(t)?"color:#93c5fd":"color:#fca5a5"),/true|false/.test(t)&&(n="color:#f97316"),/null/.test(t)&&(n="color:#6b7280"),`<span style="${n}">${t}</span>`})}function WP(){const[e,t]=h.useState([]),[n,s]=h.useState(null),[i,a]=h.useState(null),[o,l]=h.useState(!1),[c,u]=h.useState(null),[d,p]=h.useState(!1),f=h.useCallback(async()=>{p(!0);try{const v=await $("/api/workspace/files");if(v.ok){const g=await v.json();t(g.files??[])}}catch{}p(!1)},[]);h.useEffect(()=>{f()},[f]);const m=async v=>{s(v),a(null),u(null),l(!0);try{const g=await $(`/api/workspace/file?p=${encodeURIComponent(v.rel)}`);if(!g.ok)throw new Error(`HTTP ${g.status}`);const x=await g.json();a(x.content+(x.truncated?`
816
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return h.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},xP="DialogDescriptionWarning",yP=({contentRef:e,descriptionId:t})=>{const s=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${ub(xP).contentName}}.`;return h.useEffect(()=>{var a;const i=(a=e.current)==null?void 0:a.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(s))},[s,e,t]),null},vP=Qv,bP=eb,wP=tb,kP=nb,jP=rb,NP=ab,q0=lb;const SP={Messaging:{icon:"💬",accent:"text-blue-300",border:"border-blue-500/20",bg:"bg-blue-500/10",iconBg:"bg-blue-500/10"},Finance:{icon:"📈",accent:"text-emerald-300",border:"border-emerald-500/20",bg:"bg-emerald-500/10",iconBg:"bg-emerald-500/10"},System:{icon:"⚙️",accent:"text-orange-300",border:"border-orange-500/20",bg:"bg-orange-500/10",iconBg:"bg-orange-500/10"}};function CP(e){return SP[e]??{icon:"🔌",accent:"text-white/60",border:"border-white/10",bg:"bg-white/5",iconBg:"bg-white/5"}}function EP({name:e}){return r.jsx("span",{className:"inline-block px-2 py-0.5 rounded-md text-[10px] font-mono bg-white/5 text-white/40 border border-white/8",children:e})}function _P({pack:e,installing:t,installLog:n,onInstall:s,onConfigure:i}){const[a,o]=h.useState(!1),l=CP(e.category),c=e.extensions.length===0;return r.jsxs("div",{className:"flex flex-col bg-white/5 border border-white/8 rounded-2xl p-5 gap-3 hover:bg-white/[0.07] hover:border-white/12 transition-all duration-200",children:[r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx("div",{className:`w-12 h-12 rounded-xl ${l.iconBg} flex items-center justify-center text-[24px] shrink-0 select-none border ${l.border}`,children:l.icon}),r.jsxs("div",{className:"min-w-0 flex-1",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("h3",{className:"text-white/90 font-bold text-[15px] leading-snug",children:e.name}),e.installed&&r.jsx(wr,{size:14,className:"text-emerald-400 shrink-0"})]}),r.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[r.jsx("span",{className:`text-[10px] font-bold uppercase tracking-widest ${l.accent}`,children:e.category}),!c&&r.jsxs("span",{className:"text-[10px] text-white/30",children:[e.extensions.length," extension",e.extensions.length!==1?"s":""]}),c&&r.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded-md bg-yellow-500/10 text-yellow-400 border border-yellow-500/20 font-medium",children:"Coming Soon"})]})]})]}),r.jsx("p",{className:"text-white/45 text-[13px] leading-relaxed",children:e.description}),r.jsx("p",{className:"text-[11px] font-mono text-white/25",children:e.npmPackage}),e.extensions.length>0&&r.jsxs("div",{children:[r.jsxs("button",{onClick:()=>o(u=>!u),className:"flex items-center gap-1 text-[11px] text-white/30 hover:text-white/60 transition-colors mb-2",children:[a?r.jsx(Al,{size:12}):r.jsx(Gr,{size:12}),a?"Hide":"Show"," included extensions"]}),a&&r.jsx("div",{className:"flex flex-wrap gap-1.5",children:e.extensions.map(u=>r.jsx(EP,{name:u},u))})]}),t&&n&&r.jsx("pre",{className:"text-[10px] text-white/40 bg-black/40 rounded-xl p-2.5 max-h-[72px] overflow-y-auto font-mono whitespace-pre-wrap break-all border border-white/6",children:n}),r.jsx("div",{className:"mt-auto pt-1",children:c?r.jsx("div",{className:"w-full py-2 rounded-xl text-[12px] font-medium text-center bg-white/4 text-white/25 border border-white/8 cursor-default select-none",children:"Not yet available"}):e.installed?r.jsx("button",{onClick:i,className:"w-full py-2 rounded-xl text-[12px] font-medium bg-emerald-500/10 text-emerald-400 border border-emerald-500/20 hover:bg-emerald-500/15 hover:border-emerald-500/30 transition-colors",children:"Installed — Configure Keys"}):r.jsx("button",{onClick:s,disabled:t,className:`w-full flex items-center justify-center gap-2 py-2 rounded-xl text-[12px] font-semibold ${l.bg} ${l.accent} border ${l.border} hover:brightness-125 disabled:opacity-50 disabled:cursor-not-allowed transition-all`,children:t?r.jsxs(r.Fragment,{children:[r.jsx(ne,{size:13,className:"animate-spin shrink-0"}),r.jsx("span",{children:"Installing…"})]}):r.jsxs(r.Fragment,{children:[r.jsx($s,{size:13,className:"shrink-0"}),r.jsx("span",{children:"Install Pack"})]})})})]})}function TP({pack:e,onClose:t}){const[n,s]=h.useState({}),[i,a]=h.useState(!1);h.useEffect(()=>{e&&s({})},[e]);const o=async()=>{if(e){a(!0);try{if(!(await $("/api/store/configure",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({keys:n})})).ok)throw new Error("Configure request failed");le.success(`${e.name} configured — keys saved to .env`),t()}catch(c){le.error(c instanceof Error?c.message:"Configure failed")}finally{a(!1)}}},l={};for(const c of(e==null?void 0:e.requiredKeys)??[]){const u=c.forExtension??"general";(l[u]??(l[u]=[])).push(c)}return r.jsx(vP,{open:!!e,onOpenChange:c=>{c||t()},children:r.jsxs(bP,{children:[r.jsx(wP,{className:"fixed inset-0 z-50 bg-black/70 backdrop-blur-sm"}),r.jsxs(kP,{className:"fixed z-50 left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 w-full max-w-[460px] mx-4 bg-[#0d0f14] border border-white/10 rounded-2xl p-6 shadow-2xl max-h-[85vh] overflow-y-auto",children:[r.jsxs("div",{className:"flex items-center justify-between mb-1",children:[r.jsxs(jP,{className:"text-white/90 font-semibold text-[15px]",children:["Configure ",e==null?void 0:e.name]}),r.jsx(q0,{className:"w-7 h-7 flex items-center justify-center rounded-lg text-white/30 hover:text-white/70 hover:bg-white/6 transition-colors",children:r.jsx(et,{size:15})})]}),r.jsxs(NP,{className:"text-white/40 text-[12px] mb-5 leading-relaxed",children:["Fill in the keys for the extensions you want to use. Leave others blank — they can be added later. Keys are saved to your local"," ",r.jsx("code",{className:"font-mono text-white/60 bg-white/8 px-1 rounded",children:".env"})," file."]}),r.jsx("div",{className:"space-y-5",children:Object.entries(l).map(([c,u])=>r.jsxs("div",{children:[r.jsx("p",{className:"text-[10px] font-bold uppercase tracking-widest text-white/30 mb-2.5",children:c}),r.jsx("div",{className:"space-y-3",children:u.map(d=>r.jsxs("div",{children:[r.jsx("label",{className:"block text-[12px] font-medium text-white/70 mb-1",children:d.label}),d.hint&&r.jsx("p",{className:"text-[11px] text-white/35 mb-1.5",children:d.hint}),r.jsx("input",{type:"password",autoComplete:"off",value:n[d.env]??"",onChange:p=>s(f=>({...f,[d.env]:p.target.value})),className:"w-full bg-white/5 border border-white/8 rounded-xl px-3 py-2.5 text-sm text-white/80 placeholder-white/20 focus:outline-none focus:border-orange-500/40 focus:bg-white/[0.07] transition-colors font-mono",placeholder:`Enter ${d.label}`})]},d.env))})]},c))}),r.jsxs("div",{className:"flex items-center gap-3 mt-6",children:[r.jsxs("button",{onClick:o,disabled:i,className:"flex-1 flex items-center justify-center gap-2 bg-orange-500/20 hover:bg-orange-500/30 border border-orange-500/30 hover:border-orange-500/50 disabled:opacity-60 text-orange-300 rounded-xl py-2.5 text-[13px] font-semibold transition-all active:scale-[0.97]",children:[i?r.jsx(ne,{size:14,className:"animate-spin"}):r.jsx(wr,{size:14}),"Save & Activate"]}),r.jsx(q0,{className:"px-4 py-2.5 text-[13px] text-white/35 hover:text-white/60 transition-colors rounded-xl hover:bg-white/5",children:"Skip"})]})]})]})})}const PP=12e4;function AP(){const[e,t]=h.useState([]),[n,s]=h.useState(!0),[i,a]=h.useState(null),[o,l]=h.useState({}),[c,u]=h.useState(null),d=h.useRef(null),p=h.useCallback(async()=>{s(!0);try{const v=await $("/api/store/extensions");v.ok&&t(await v.json())}catch{}finally{s(!1)}},[]);h.useEffect(()=>{p()},[p]);const f=h.useCallback(async v=>{var g;(g=d.current)==null||g.abort();const y=new AbortController;d.current=y,a(v.id),l(x=>({...x,[v.id]:""}));const b=setTimeout(()=>{y.abort()},PP);try{const x=await $("/api/store/install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:v.id}),signal:y.signal},{retries:1,retryDelay:0});if(!x.body)throw new Error("No response stream");const w=x.body.getReader(),j=new TextDecoder;let k="";for(;;){const{done:N,value:S}=await w.read();if(N)break;const E=j.decode(S,{stream:!0});k+=E,l(P=>({...P,[v.id]:k}))}k.includes("__MUSTB_INSTALL_OK__")?(le.success(`${v.name} installed!`),t(N=>N.map(S=>S.id===v.id?{...S,installed:!0}:S)),v.requiredKeys.length>0&&u(v)):k.includes("__MUSTB_INSTALL_FAILED__")?le.error(`${v.name} installation failed — check the log above.`):le.error(`${v.name} installation failed.`)}catch(x){x.name==="AbortError"?le.error(`Install timed out — is ${v.npmPackage} published to npm?`):le.error(x instanceof Error?x.message:"Install failed")}finally{clearTimeout(b),a(null)}},[]),m=e.filter(v=>v.installed).length;return r.jsxs("div",{className:"min-h-screen bg-transparent pt-4 pb-10 px-4 sm:px-6 max-w-5xl mx-auto",children:[r.jsxs("div",{className:"flex items-start justify-between gap-4 mb-3",children:[r.jsxs("div",{children:[r.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[r.jsx("div",{className:"w-10 h-10 rounded-2xl bg-orange-500/10 border border-orange-500/20 flex items-center justify-center shrink-0",children:r.jsx(pv,{size:18,className:"text-orange-400"})}),r.jsxs("div",{children:[r.jsx("h1",{className:"text-[22px] font-black text-white/95 leading-none",children:"Extension Store"}),m>0&&r.jsxs("span",{className:"text-[11px] text-emerald-400/80 font-medium",children:[m," pack",m!==1?"s":""," installed"]})]})]}),r.jsxs("p",{className:"text-white/40 text-[13px] leading-relaxed max-w-2xl mt-1",children:["Extensions are grouped into themed packs."," ","Install one pack to get all its integrations — fetched directly from npm into"," ",r.jsx("code",{className:"font-mono text-white/60 bg-white/5 px-1.5 py-0.5 rounded text-[11px] border border-white/8",children:"~/.must-b/extensions/"})]})]}),r.jsx("button",{onClick:p,title:"Refresh",className:"p-2.5 rounded-xl text-white/30 hover:text-white/70 hover:bg-white/6 border border-white/8 transition-all shrink-0",children:r.jsx(de,{size:15})})]}),r.jsxs("div",{className:"mb-8 px-3 py-2.5 rounded-xl bg-white/5 border border-white/8 flex items-center gap-3",children:[r.jsx("code",{className:"text-[11px] font-mono text-white/30 shrink-0",children:"CLI:"}),r.jsxs("code",{className:"text-[12px] font-mono text-white/50",children:[r.jsx("span",{className:"text-orange-400",children:"must-b ext list"})," · ",r.jsx("span",{className:"text-orange-400",children:"must-b ext install channels"})," · ",r.jsx("span",{className:"text-orange-400",children:"must-b ext install system"})]})]}),n?r.jsxs("div",{className:"flex flex-col items-center justify-center py-24 gap-3",children:[r.jsx(ne,{size:22,className:"animate-spin text-orange-400"}),r.jsx("p",{className:"text-white/35 text-[13px]",children:"Loading extension store…"})]}):e.length===0?r.jsxs("div",{className:"flex flex-col items-center justify-center py-24 gap-3",children:[r.jsx($s,{size:28,className:"text-white/20"}),r.jsx("p",{className:"text-white/35 text-[13px]",children:"No packs available — backend may not be running."}),r.jsx("button",{onClick:p,className:"mt-1 px-4 py-2 rounded-xl bg-orange-500/10 border border-orange-500/20 text-orange-400 text-[12px] font-medium hover:bg-orange-500/20 transition-colors",children:"Retry"})]}):r.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-5",children:e.map(v=>r.jsx(_P,{pack:v,installing:i===v.id,installLog:o[v.id]??"",onInstall:()=>f(v),onConfigure:()=>u(v)},v.id))}),r.jsxs("p",{className:"text-center text-white/20 text-[11px] mt-12",children:["Packs are built with"," ",r.jsx("code",{className:"font-mono bg-white/5 px-1 rounded border border-white/8",children:"npm run build:packs"})," ","and published to npm. Run"," ",r.jsx("code",{className:"font-mono bg-white/5 px-1 rounded border border-white/8",children:"must-b ext list"})," ","for the CLI interface."]}),r.jsx(TP,{pack:c,onClose:()=>u(null)})]})}function Y0(e){return e>=90?"#ef4444":e>=70?"#f97316":"#22c55e"}function li(e){return e==="critical"?"#ef4444":e==="warning"?"#f97316":"#60a5fa"}function MP(){const{t:e,locale:t}=pt(),n=e.systemHealth,[s,i]=h.useState(null),[a,o]=h.useState(null),[l,c]=h.useState(!1),u=h.useCallback(()=>o(null),[]);h.useEffect(()=>{window.dispatchEvent(new CustomEvent("mustb:safeMode",{detail:{active:(s==null?void 0:s.safeMode)??!1}}))},[s==null?void 0:s.safeMode]),h.useEffect(()=>{const f=at();return f.on("systemStats",m=>i(m)),f.on("systemHealth",m=>{if(o(m),c(!0),m.level!=="critical"){const v=m.level==="info"?6e3:12e3;setTimeout(()=>o(null),v)}}),()=>{f.off("systemStats"),f.off("systemHealth")}},[]);const d=(s==null?void 0:s.cpu)??0,p=(s==null?void 0:s.ram)??0;return r.jsxs("div",{className:"relative flex items-center",children:[r.jsxs("button",{onClick:()=>a&&c(f=>!f),className:"flex items-center gap-1.5 select-none transition-all rounded-md",style:{cursor:a?"pointer":"default"},title:a?a.message:n.title,children:[a?r.jsx("span",{className:"w-2 h-2 rounded-full flex-shrink-0 animate-pulse",style:{background:li(a.level)}}):r.jsx(fn,{size:12,className:"text-orange-400/70"}),s&&r.jsxs("span",{className:"hidden sm:flex items-center gap-1.5",children:[r.jsx("span",{className:"text-[10px] font-semibold text-white/45",children:"CPU"}),r.jsx("span",{className:"w-9 h-1 rounded-full bg-white/10 overflow-hidden flex-shrink-0",children:r.jsx("span",{className:"h-full rounded-full block transition-all duration-700",style:{width:`${d}%`,background:Y0(d)}})}),r.jsxs("span",{className:"text-[9px] font-mono text-white/40 w-6 text-right",children:[d,"%"]}),r.jsx("span",{className:"w-px h-3 bg-white/10"}),r.jsx("span",{className:"text-[10px] font-semibold text-white/45",children:"RAM"}),r.jsx("span",{className:"w-9 h-1 rounded-full bg-white/10 overflow-hidden flex-shrink-0",children:r.jsx("span",{className:"h-full rounded-full block transition-all duration-700",style:{width:`${p}%`,background:Y0(p)}})}),r.jsxs("span",{className:"text-[9px] font-mono text-white/40 w-6 text-right",children:[p,"%"]}),s.liteMode&&!s.safeMode&&r.jsx("span",{className:"text-[8px] font-bold px-1 py-0.5 rounded bg-orange-500/20 text-orange-400 ml-0.5",children:n.lite}),s.safeMode&&r.jsx("span",{className:"text-[8px] font-bold px-1 py-0.5 rounded bg-red-500/20 text-red-400 ml-0.5",children:n.safe})]}),!s&&r.jsx("span",{className:"text-[10px] font-semibold hidden sm:inline text-white/35",children:n.title})]}),r.jsx(se,{children:l&&a&&r.jsxs(H.div,{initial:{opacity:0,y:8,scale:.96},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:8,scale:.96},transition:{duration:.2,ease:"easeOut"},className:"absolute top-full right-0 mt-2 w-72 z-[200] rounded-2xl overflow-hidden",style:{background:"rgba(20,8,2,0.88)",border:`1px solid ${li(a.level)}44`,backdropFilter:"blur(20px)",boxShadow:`0 8px 32px rgba(0,0,0,0.5), 0 0 0 1px ${li(a.level)}22`},children:[r.jsxs("div",{className:"flex items-start justify-between px-4 pt-3 pb-2",style:{borderBottom:`1px solid ${li(a.level)}22`},children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(os,{size:13,style:{color:li(a.level)}}),r.jsxs("span",{className:"text-[12px] font-bold text-white/90 capitalize",children:[n[a.level]??a.level," — ",n.kinds[a.kind]??a.kind]})]}),r.jsx("button",{onClick:u,className:"text-white/30 hover:text-white/70 transition-colors",children:r.jsx(et,{size:13})})]}),r.jsxs("div",{className:"px-4 py-3 space-y-2",children:[r.jsx("p",{className:"text-[13px] text-white/80 leading-relaxed",children:n.alerts[a.kind]??a.message}),r.jsx("p",{className:"text-[11px] text-white/45 leading-relaxed italic",children:n.recommendations[a.kind]??a.recommendation})]}),r.jsx("div",{className:"px-4 pb-3",children:r.jsx("span",{className:"text-[10px] text-white/25 font-mono",children:new Date(a.ts).toLocaleTimeString()})})]},"health-popover")})]})}function RP(e){return`${Math.round(e*100)}%`}const X0={skill:{label:"Skill",icon:ze,color:"text-orange-400"},conversation:{label:"Conversation",icon:Os,color:"text-blue-400"},workspace:{label:"Workspace",icon:ps,color:"text-green-400"},custom:{label:"Custom",icon:Qt,color:"text-gray-400"}};function zP(){const{t:e}=pt(),t=e.panels.memory,[n,s]=h.useState(""),[i,a]=h.useState([]),[o,l]=h.useState(null),[c,u]=h.useState(!1),[d,p]=h.useState(null),[f,m]=h.useState(null),[v,y]=h.useState(!1),b=h.useRef(null),g=h.useCallback(async k=>{const N=k.trim();if(N){u(!0),a([]);try{const S=await $(`/api/memory/search?q=${encodeURIComponent(N)}&limit=10`);if(S.ok){const E=await S.json();a(E.results??[])}}catch{}u(!1)}},[]),x=k=>{k.key==="Enter"&&g(n)},w=h.useCallback(async()=>{try{const k=await $("/api/memory/stats");k.ok&&l(await k.json())}catch{}},[]),j=async k=>{p(k),m(null);try{const N=k==="clear"?await $("/api/memory/clear-index",{method:"DELETE"}):await $(`/api/memory/index-${k}`,{method:"POST"});if(N.ok){const S=await N.json(),E=k==="clear"?t.indexCleared:`${t.indexed} ${S.indexed??0} ${k==="skills"?t.skills:t.files}`;m({ok:!0,msg:E}),w(),k==="clear"&&a([])}else m({ok:!1,msg:t.opFailed})}catch{m({ok:!1,msg:t.reqError})}p(null),setTimeout(()=>m(null),4e3)};return r.jsxs("div",{className:"h-full flex flex-col overflow-hidden bg-[#080b12]",children:[r.jsxs("div",{className:"flex items-center justify-between px-6 py-3 border-b border-white/5 shrink-0",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Yt,{size:14,className:"text-orange-400"}),r.jsx("span",{className:"text-[13px] font-bold text-gray-300",children:t.title}),o&&r.jsxs("span",{className:"text-[10px] text-gray-600 bg-white/5 px-2 py-0.5 rounded-full font-mono",children:[o.items.toLocaleString()," ",t.vectors]})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("button",{onClick:()=>{y(k=>!k),o||w()},className:`text-gray-600 hover:text-gray-400 transition-colors ${v?"text-orange-400":""}`,title:t.indexControls,children:r.jsx(OC,{size:13})}),r.jsx("button",{onClick:w,className:"text-gray-600 hover:text-gray-400 transition-colors",title:t.refreshStats,children:r.jsx(de,{size:13})})]})]}),r.jsx(se,{children:v&&r.jsxs(H.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},className:"border-b border-white/5 bg-white/2 overflow-hidden shrink-0",children:[r.jsxs("div",{className:"px-6 py-3 flex flex-wrap items-center gap-2",children:[r.jsx("span",{className:"text-[10px] text-gray-600 uppercase tracking-widest font-bold shrink-0",children:t.indexLabel}),["skills","workspace"].map(k=>r.jsxs("button",{onClick:()=>j(k),disabled:d!==null,className:"flex items-center gap-1 px-2.5 py-1 rounded-lg bg-white/4 border border-white/6 text-[11px] text-gray-400 hover:text-gray-200 hover:bg-white/8 transition-all disabled:opacity-40 capitalize",children:[d===k?r.jsx(ne,{size:10,className:"animate-spin"}):k==="skills"?r.jsx(ze,{size:10}):r.jsx(ps,{size:10}),k]},k)),r.jsxs("button",{onClick:()=>j("clear"),disabled:d!==null,className:"flex items-center gap-1 px-2.5 py-1 rounded-lg bg-red-500/8 border border-red-500/15 text-[11px] text-red-400 hover:bg-red-500/15 transition-all disabled:opacity-40 ml-auto",children:[d==="clear"?r.jsx(ne,{size:10,className:"animate-spin"}):r.jsx(Hs,{size:10}),t.clearIndex]})]}),r.jsx(se,{children:f&&r.jsxs(H.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:`flex items-center gap-1.5 px-6 pb-3 text-[11px] font-medium ${f.ok?"text-green-400":"text-red-400"}`,children:[f.ok?r.jsx(Ve,{size:11}):r.jsx(wt,{size:11}),f.msg]})})]})}),r.jsxs("div",{className:"px-6 py-3 border-b border-white/5 shrink-0",children:[r.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 rounded-xl bg-white/4 border border-white/8 focus-within:border-orange-500/30 transition-colors",children:[r.jsx(Xt,{size:13,className:"text-gray-600 shrink-0"}),r.jsx("input",{ref:b,value:n,onChange:k=>s(k.target.value),onKeyDown:x,placeholder:t.searchPlaceholder,className:"flex-1 bg-transparent text-[13px] text-gray-200 outline-none placeholder-gray-700"}),c?r.jsx(ne,{size:13,className:"text-orange-400 animate-spin shrink-0"}):r.jsx("button",{onClick:()=>g(n),disabled:!n.trim(),className:"text-[10px] px-2 py-0.5 rounded-lg bg-orange-500/12 text-orange-400 font-semibold hover:bg-orange-500/22 border border-orange-500/20 transition-all disabled:opacity-30",children:"⌘↵"})]}),r.jsx("p",{className:"text-[10px] text-gray-700 mt-1.5 ml-1",children:t.searchHint})]}),r.jsxs("div",{className:"flex-1 overflow-y-auto scrollbar-hide p-4 space-y-3",children:[i.length===0&&!c&&r.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[r.jsx(Yt,{size:36,className:"text-gray-700 mb-4"}),r.jsx("p",{className:"text-sm font-semibold text-gray-500",children:n.trim()?t.emptyNoResults:t.emptyTitle}),r.jsx("p",{className:"text-xs text-gray-700 mt-1 max-w-xs leading-relaxed",children:n.trim()?t.emptyNoResultsHint:t.emptyHint})]}),i.map((k,N)=>{const S=X0[k.metadata.source]??X0.custom,E=S.icon;return r.jsxs(H.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{delay:N*.04},className:"rounded-2xl border border-white/6 bg-[#0c0f18] p-4 hover:border-white/12 transition-all",children:[r.jsxs("div",{className:"flex items-start justify-between gap-2 mb-2",children:[r.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[r.jsx(E,{size:11,className:`${S.color} shrink-0`}),r.jsx("p",{className:"text-[12px] font-semibold text-gray-300 truncate",children:k.metadata.title})]}),r.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[r.jsx("span",{className:`text-[9px] font-bold px-1.5 py-0.5 rounded-full border ${k.score>=.85?"bg-green-500/10 border-green-500/20 text-green-400":k.score>=.65?"bg-orange-500/10 border-orange-500/20 text-orange-400":"bg-white/4 border-white/6 text-gray-500"}`,children:RP(k.score)}),r.jsx("span",{className:`text-[9px] px-1.5 py-0.5 rounded-full bg-white/4 border border-white/6 font-medium ${S.color}`,children:S.label})]})]}),r.jsx("p",{className:"text-[11px] text-gray-500 leading-relaxed line-clamp-3 mb-2",children:k.text}),k.metadata.tags&&k.metadata.tags.length>0&&r.jsx("div",{className:"flex flex-wrap gap-1",children:k.metadata.tags.map((P,A)=>r.jsx("span",{className:"text-[9px] px-1.5 py-0.5 rounded-md bg-white/4 text-gray-600 font-mono",children:P},A))}),r.jsx("div",{className:"mt-2 h-0.5 bg-white/4 rounded-full overflow-hidden",children:r.jsx("div",{className:"h-full rounded-full bg-gradient-to-r from-orange-600 to-amber-400",style:{width:`${k.score*100}%`}})})]},N)})]})]})}const LP={node:hn,python:yn},OP={node:"text-green-400",python:"text-blue-400"};function DP(){const{t:e}=pt(),t=e.panels.plugins,[n,s]=h.useState([]),[i,a]=h.useState(!1),[o,l]=h.useState(null),[c,u]=h.useState(null),[d,p]=h.useState(!1),[f,m]=h.useState(""),[v,y]=h.useState(""),[b,g]=h.useState("node"),[x,w]=h.useState(""),[j,k]=h.useState(!1),N=(A,T)=>{u({ok:A,msg:T}),setTimeout(()=>u(null),4e3)},S=h.useCallback(async()=>{a(!0);try{const A=await $("/api/plugins/list");if(A.ok){const T=await A.json();s(T.plugins??[])}}catch{}a(!1)},[]);h.useEffect(()=>{S()},[S]);const E=async(A,T)=>{l(A);try{(await $(T?"/api/plugins/stop":"/api/plugins/run",{method:"POST",body:JSON.stringify({name:A})})).ok?(N(!0,T?`${A} stopped`:`${A} launched`),await S()):N(!1,t.opFailed)}catch{N(!1,t.reqError)}l(null)},P=async()=>{if(!(!f.trim()||!v.trim())){k(!0);try{(await $("/api/plugins/build",{method:"POST",body:JSON.stringify({name:f.trim(),goal:v.trim(),lang:b,context:x.trim()||void 0})})).ok?(N(!0,`Plugin "${f}" created`),m(""),y(""),w(""),p(!1),await S()):N(!1,t.buildFailed)}catch{N(!1,t.reqError)}k(!1)}};return r.jsxs("div",{className:"h-full flex flex-col overflow-hidden bg-[#080b12]",children:[r.jsxs("div",{className:"flex items-center justify-between px-6 py-3 border-b border-white/5 shrink-0",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Br,{size:14,className:"text-orange-400"}),r.jsx("span",{className:"text-[13px] font-bold text-gray-300",children:t.title}),r.jsxs("span",{className:"text-[10px] text-gray-600 bg-white/5 px-2 py-0.5 rounded-full font-mono",children:[n.length," ",t.installed]})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("button",{onClick:S,className:"text-gray-600 hover:text-gray-400 transition-colors",title:t.refresh,children:r.jsx(de,{size:13,className:i?"animate-spin":""})}),r.jsxs("button",{onClick:()=>p(A=>!A),className:`flex items-center gap-1 text-[10px] px-2.5 py-1 rounded-lg border font-semibold transition-all ${d?"bg-orange-500/15 border-orange-500/25 text-orange-400":"bg-white/4 border-white/8 text-gray-500 hover:text-gray-300"}`,children:[r.jsx(zl,{size:10}),t.newPlugin]})]})]}),r.jsx(se,{children:c&&r.jsxs(H.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:`flex items-center gap-1.5 px-6 py-2 text-[11px] font-medium shrink-0 ${c.ok?"text-green-400":"text-red-400"}`,children:[c.ok?r.jsx(Ve,{size:11}):r.jsx(wt,{size:11}),c.msg]})}),r.jsx(se,{children:d&&r.jsx(H.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},className:"border-b border-white/5 bg-white/2 overflow-hidden shrink-0",children:r.jsxs("div",{className:"px-6 py-4 space-y-3",children:[r.jsx("p",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-widest",children:t.buildTitle}),r.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[r.jsx("input",{value:f,onChange:A=>m(A.target.value),placeholder:t.namePlaceholder,className:"col-span-2 px-3 py-2 rounded-lg bg-white/4 border border-white/8 text-[12px] text-gray-200 outline-none placeholder-gray-700 focus:border-orange-500/30 transition-colors"}),r.jsx("input",{value:v,onChange:A=>y(A.target.value),placeholder:t.goalPlaceholder,className:"col-span-2 px-3 py-2 rounded-lg bg-white/4 border border-white/8 text-[12px] text-gray-200 outline-none placeholder-gray-700 focus:border-orange-500/30 transition-colors"}),r.jsx("input",{value:x,onChange:A=>w(A.target.value),placeholder:t.contextPlaceholder,className:"col-span-2 px-3 py-2 rounded-lg bg-white/4 border border-white/8 text-[12px] text-gray-200 outline-none placeholder-gray-700 focus:border-orange-500/30 transition-colors"}),r.jsx("div",{className:"flex gap-2",children:["node","python"].map(A=>r.jsx("button",{onClick:()=>g(A),className:`flex-1 py-1.5 rounded-lg border text-[11px] font-semibold transition-all capitalize ${b===A?"bg-orange-500/15 border-orange-500/25 text-orange-400":"bg-white/4 border-white/8 text-gray-500"}`,children:A},A))}),r.jsxs("button",{onClick:P,disabled:j||!f.trim()||!v.trim(),className:"flex items-center justify-center gap-1.5 py-2 rounded-lg bg-orange-500/12 border border-orange-500/20 text-orange-400 text-[11px] font-bold hover:bg-orange-500/20 transition-all disabled:opacity-40",children:[j?r.jsx(ne,{size:11,className:"animate-spin"}):r.jsx(ze,{size:11}),t.generatePlugin]})]})]})})}),r.jsxs("div",{className:"flex-1 overflow-y-auto scrollbar-hide p-4 space-y-2",children:[n.length===0&&!i&&r.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[r.jsx(Br,{size:36,className:"text-gray-700 mb-4"}),r.jsx("p",{className:"text-sm font-semibold text-gray-500",children:t.emptyTitle}),r.jsx("p",{className:"text-xs text-gray-700 mt-1",children:t.emptyHint})]}),n.map((A,T)=>{const V=LP[A.lang]??hn,R=o===A.name;return r.jsxs(H.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{delay:T*.04},className:`flex items-center gap-3 p-3 rounded-2xl border transition-all ${A.running?"bg-green-500/5 border-green-500/15 hover:border-green-500/25":"bg-[#0c0f18] border-white/6 hover:border-white/12"}`,children:[r.jsx(V,{size:13,className:OP[A.lang]??"text-gray-400"}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("p",{className:"text-[12px] font-semibold text-gray-300 truncate",children:A.name}),r.jsx("p",{className:"text-[10px] text-gray-600 font-mono",children:A.filename})]}),A.running&&r.jsx("span",{className:"text-[9px] px-1.5 py-0.5 rounded-full bg-green-500/12 border border-green-500/20 text-green-400 font-bold",children:t.running}),r.jsxs("button",{disabled:R,onClick:()=>E(A.name,A.running),className:`flex items-center gap-1 px-2.5 py-1.5 rounded-lg border text-[10px] font-bold transition-all disabled:opacity-40 ${A.running?"bg-red-500/8 border-red-500/15 text-red-400 hover:bg-red-500/15":"bg-green-500/8 border-green-500/15 text-green-400 hover:bg-green-500/15"}`,children:[R?r.jsx(ne,{size:10,className:"animate-spin"}):A.running?r.jsx(of,{size:10}):r.jsx(Us,{size:10}),A.running?t.stop:t.run]})]},A.name)})]})]})}function IP(e){if(!e)return"Never";try{return new Date(e).toLocaleString("en-US",{dateStyle:"short",timeStyle:"short"})}catch{return e}}function BP(e){const t=Date.now()-new Date(e).getTime(),n=Math.floor(t/6e4);if(n<1)return"just now";if(n<60)return`${n}m ago`;const s=Math.floor(n/60);return s<24?`${s}h ago`:`${Math.floor(s/24)}d ago`}function FP({skill:e}){const[t,n]=h.useState(!1),[s,i]=h.useState(!1),[a,o]=h.useState(""),[l,c]=h.useState(!1),u=async()=>{if(!l){c(!0);return}if(a.trim()){n(!0);try{await $("/api/v1/skills/invoke",{method:"POST",body:JSON.stringify({skill:e.id,params:{goal:a.trim(),_autoRun:!0}})}),i(!0),c(!1),o(""),setTimeout(()=>i(!1),3e3)}catch{}n(!1)}},d=(e.requires.bins??[]).length>0,p=(e.requires.config??[]).length>0;return r.jsx(H.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},className:"rounded-2xl border border-white/6 bg-[#0c0f18] hover:border-white/12 transition-all",children:r.jsxs("div",{className:"p-3",children:[r.jsxs("div",{className:"flex items-start gap-2 mb-1.5",children:[r.jsx("span",{className:"text-base leading-none mt-0.5 shrink-0",children:e.emoji??"⚡"}),r.jsx("div",{className:"flex-1 min-w-0",children:r.jsx("p",{className:"text-[12px] font-bold text-gray-200 truncate capitalize",children:e.name})}),e.hasScripts&&r.jsx(as,{size:10,className:"text-gray-700 shrink-0 mt-0.5"})]}),r.jsx("p",{className:"text-[10px] text-gray-500 leading-relaxed line-clamp-2 mb-2 ml-6",children:e.description}),(d||p)&&r.jsxs("div",{className:"flex flex-wrap gap-1 mb-2 ml-6",children:[(e.requires.bins??[]).map(f=>r.jsxs("span",{className:"text-[9px] px-1.5 py-0.5 rounded bg-blue-500/8 border border-blue-500/15 text-blue-400 font-mono",children:["bin:",f]},f)),(e.requires.config??[]).map(f=>r.jsxs("span",{className:"text-[9px] px-1.5 py-0.5 rounded bg-purple-500/8 border border-purple-500/15 text-purple-400 font-mono",children:["cfg:",f]},f))]}),r.jsx(se,{children:l&&r.jsx(H.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},className:"overflow-hidden mb-2",children:r.jsx("input",{autoFocus:!0,value:a,onChange:f=>o(f.target.value),onKeyDown:f=>{f.key==="Enter"&&u(),f.key==="Escape"&&(c(!1),o(""))},placeholder:`Goal for ${e.name}…`,className:"w-full px-2.5 py-1.5 rounded-lg bg-white/4 border border-white/10 text-[11px] text-gray-200 placeholder-gray-700 outline-none focus:border-orange-500/30 transition-colors"})})}),r.jsxs("div",{className:"flex items-center justify-end gap-1 ml-6",children:[l&&r.jsx("button",{onClick:()=>{c(!1),o("")},className:"text-[10px] px-2 py-1 rounded-lg bg-white/4 text-gray-600 hover:text-gray-400 transition-colors",children:"Cancel"}),r.jsx("button",{onClick:u,disabled:t||l&&!a.trim(),className:`flex items-center gap-1 px-2.5 py-1 rounded-lg text-[10px] font-semibold border transition-all disabled:opacity-40 ${s?"bg-green-500/10 border-green-500/20 text-green-400":"bg-orange-500/8 border-orange-500/15 text-orange-400 hover:bg-orange-500/15"}`,children:t?r.jsx(ne,{size:9,className:"animate-spin"}):s?r.jsxs(r.Fragment,{children:[r.jsx(Ve,{size:9})," Sent"]}):l?r.jsxs(r.Fragment,{children:[r.jsx(dn,{size:9})," Run"]}):r.jsxs(r.Fragment,{children:[r.jsx(zC,{size:9})," Use"]})})]})]})})}function VP(){const{t:e}=pt(),t=e.panels.skills,[n,s]=h.useState("saved"),[i,a]=h.useState([]),[o,l]=h.useState(!1),[c,u]=h.useState(null),[d,p]=h.useState("idle"),[f,m]=h.useState(null),[v,y]=h.useState(null),[b,g]=h.useState([]),[x,w]=h.useState(!1),[j,k]=h.useState(""),N=h.useCallback(async()=>{l(!0);try{const T=await $("/api/skills/list");if(T.ok){const V=await T.json();a(V.skills??[])}}catch{}l(!1)},[]),S=h.useCallback(async()=>{w(!0);try{const T=await $("/api/skills/catalog");if(T.ok){const V=await T.json();g(V.skills??[])}}catch{}w(!1)},[]);h.useEffect(()=>{N()},[N]),h.useEffect(()=>{n==="library"&&b.length===0&&S()},[n,b.length,S]),h.useEffect(()=>{const T=at(),V=R=>{R.type==="skillRunStart"&&R.skillId&&(u(R.skillId),p("running")),R.type==="planFinish"&&(p("done"),u(null),N(),setTimeout(()=>p("idle"),2500))};return T.on("agentUpdate",V),()=>{T.off("agentUpdate",V)}},[N]);const E=async T=>{if(!c){u(T.id),p("running");try{const V=await $("/api/skills/run",{method:"POST",body:JSON.stringify({id:T.id})});if(!V.ok)throw new Error(`HTTP ${V.status}`)}catch{p("error"),u(null),setTimeout(()=>p("idle"),3e3)}}},P=async T=>{m(T);try{await $(`/api/skills/${T}`,{method:"DELETE"}),a(V=>V.filter(R=>R.id!==T))}catch{}m(null),y(null)},A=j.trim()?b.filter(T=>T.name.toLowerCase().includes(j.toLowerCase())||T.description.toLowerCase().includes(j.toLowerCase())):b;return r.jsxs("div",{className:"h-full flex flex-col overflow-hidden bg-[#080b12]",children:[r.jsxs("div",{className:"flex items-center justify-between px-6 py-3 border-b border-white/5 shrink-0",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Pl,{size:14,className:"text-orange-400"}),r.jsx("span",{className:"text-[13px] font-bold text-gray-300",children:t.title})]}),r.jsxs("div",{className:"flex items-center gap-1 bg-white/4 rounded-lg p-0.5",children:[r.jsxs("button",{onClick:()=>s("saved"),className:`flex items-center gap-1 px-2.5 py-1 rounded-md text-[10px] font-semibold transition-all ${n==="saved"?"bg-orange-500/15 text-orange-400":"text-gray-600 hover:text-gray-400"}`,children:[r.jsx(ze,{size:9}),"Saved",i.length>0&&r.jsx("span",{className:"text-[9px] font-mono text-gray-600",children:i.length})]}),r.jsxs("button",{onClick:()=>s("library"),className:`flex items-center gap-1 px-2.5 py-1 rounded-md text-[10px] font-semibold transition-all ${n==="library"?"bg-orange-500/15 text-orange-400":"text-gray-600 hover:text-gray-400"}`,children:[r.jsx(Ac,{size:9}),"Library",b.length>0&&r.jsx("span",{className:"text-[9px] font-mono text-gray-600",children:b.length})]})]}),r.jsx("button",{onClick:n==="saved"?N:S,disabled:n==="saved"?o:x,className:"text-gray-600 hover:text-gray-400 transition-colors",title:"Refresh",children:r.jsx(de,{size:13,className:(n==="saved"?o:x)?"animate-spin":""})})]}),n==="saved"&&r.jsxs(r.Fragment,{children:[r.jsx(se,{children:d!=="idle"&&r.jsxs(H.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},className:`px-6 py-2 border-b flex items-center gap-2 text-xs font-medium ${d==="running"?"bg-orange-500/8 border-orange-500/15 text-orange-400":d==="done"?"bg-green-500/8 border-green-500/15 text-green-400":"bg-red-500/8 border-red-500/15 text-red-400"}`,children:[d==="running"&&r.jsx(ne,{size:12,className:"animate-spin"}),d==="done"&&r.jsx(Ve,{size:12}),d==="error"&&r.jsx(wt,{size:12}),d==="running"?t.runningStatus:d==="done"?t.completedStatus:t.failedStatus]})}),r.jsx("div",{className:"flex-1 overflow-y-auto scrollbar-hide p-4 space-y-3",children:o&&i.length===0?r.jsxs("div",{className:"flex items-center justify-center py-16 text-gray-700 text-xs gap-2",children:[r.jsx(ne,{size:13,className:"animate-spin"})," ",t.loading]}):i.length===0?r.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[r.jsx(ze,{size:36,className:"text-gray-700 mb-4"}),r.jsx("p",{className:"text-sm font-semibold text-gray-500",children:t.emptyTitle}),r.jsxs("p",{className:"text-xs text-gray-700 mt-1 max-w-xs",children:[t.emptyHint," ",r.jsx("span",{className:"text-orange-400 font-medium",children:t.saveAsSkill})," ",t.emptyHint2]}),r.jsxs("button",{onClick:()=>s("library"),className:"mt-4 flex items-center gap-1.5 text-[11px] text-orange-400 hover:text-orange-300 transition-colors",children:[r.jsx(Ac,{size:11})," Browse skill library"]})]}):i.map((T,V)=>{const R=c===T.id&&d==="running",I=c===T.id&&d==="done",L=f===T.id;return r.jsx(H.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:V*.04},className:`rounded-2xl border bg-[#0c0f18] transition-all ${R?"border-orange-500/30 shadow-[0_0_12px_rgba(234,88,12,0.12)]":I?"border-green-500/20":"border-white/6 hover:border-white/12"}`,children:r.jsxs("div",{className:"p-4",children:[r.jsxs("div",{className:"flex items-start justify-between gap-2 mb-2",children:[r.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[r.jsx(ze,{size:13,className:"text-orange-400 shrink-0 mt-0.5"}),r.jsx("p",{className:"text-[13px] font-bold text-white truncate",children:T.name})]}),r.jsxs("div",{className:"flex items-center gap-1.5 text-[10px] text-gray-600 shrink-0 font-mono",children:[r.jsx(tv,{size:9}),T.runCount,"×"]})]}),r.jsx("p",{className:"text-[11px] text-gray-500 leading-relaxed mb-2 line-clamp-2",children:T.goal}),T.steps.length>0&&r.jsxs("div",{className:"flex flex-wrap gap-1 mb-3",children:[T.steps.slice(0,4).map((z,B)=>r.jsx("span",{className:"text-[9px] px-1.5 py-0.5 rounded-md bg-white/4 text-gray-600 font-mono",children:z.tool??"step"},B)),T.steps.length>4&&r.jsxs("span",{className:"text-[9px] px-1.5 py-0.5 rounded-md bg-white/4 text-gray-600 font-mono",children:["+",T.steps.length-4," more"]})]}),r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"flex items-center gap-1 text-[10px] text-gray-700",children:[r.jsx(Pt,{size:9}),r.jsx("span",{children:BP(T.savedAt)}),T.lastRunAt&&r.jsxs("span",{className:"text-gray-800",children:["· ",t.lastRun," ",IP(T.lastRunAt)]})]}),r.jsxs("div",{className:"flex items-center gap-1",children:[v===T.id?r.jsxs("div",{className:"flex items-center gap-1",children:[r.jsx("span",{className:"text-[10px] text-red-400",children:t.deleteConfirm}),r.jsx("button",{onClick:()=>P(T.id),disabled:L,className:"text-[10px] px-2 py-0.5 rounded bg-red-500/15 text-red-400 hover:bg-red-500/25 transition-colors",children:L?"…":t.yes}),r.jsx("button",{onClick:()=>y(null),className:"text-[10px] px-2 py-0.5 rounded bg-white/5 text-gray-500 hover:bg-white/8",children:t.no})]}):r.jsx("button",{onClick:()=>y(T.id),className:"p-1.5 rounded-lg text-gray-700 hover:text-red-400 hover:bg-red-500/8 transition-all",title:"Delete skill",children:r.jsx(Hs,{size:12})}),r.jsx("button",{onClick:()=>E(T),disabled:!!c,className:`flex items-center gap-1.5 px-3 py-1.5 rounded-xl text-[11px] font-semibold transition-all ${R?"bg-orange-500/15 text-orange-400 border border-orange-500/25 cursor-not-allowed":I?"bg-green-500/12 text-green-400 border border-green-500/20":"bg-orange-500/10 hover:bg-orange-500/20 text-orange-400 border border-orange-500/20 hover:border-orange-500/35 disabled:opacity-40 disabled:cursor-not-allowed"}`,children:R?r.jsxs(r.Fragment,{children:[r.jsx(ne,{size:11,className:"animate-spin"})," ",t.runningBtn]}):I?r.jsxs(r.Fragment,{children:[r.jsx(Ve,{size:11})," ",t.doneBtn]}):r.jsxs(r.Fragment,{children:[r.jsx(Us,{size:11})," ",t.runBtn]})})]})]})]})},T.id)})})]}),n==="library"&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"px-4 py-2.5 border-b border-white/5 shrink-0",children:r.jsx("input",{value:j,onChange:T=>k(T.target.value),placeholder:"Search skills…",className:"w-full px-3 py-1.5 rounded-lg bg-white/4 border border-white/8 text-[11px] text-gray-300 placeholder-gray-700 outline-none focus:border-orange-500/25 transition-colors"})}),r.jsx("div",{className:"flex-1 overflow-y-auto scrollbar-hide p-3 grid grid-cols-1 gap-2",children:x&&b.length===0?r.jsxs("div",{className:"flex items-center justify-center py-16 text-gray-700 text-xs gap-2 col-span-1",children:[r.jsx(ne,{size:13,className:"animate-spin"})," Loading skill library…"]}):A.length===0?r.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center col-span-1",children:[r.jsx(Ac,{size:36,className:"text-gray-700 mb-3"}),r.jsx("p",{className:"text-sm font-semibold text-gray-500",children:"No skills found"}),j&&r.jsx("button",{onClick:()=>k(""),className:"mt-2 text-[11px] text-orange-400 hover:text-orange-300",children:"Clear filter"})]}):A.map((T,V)=>r.jsx(H.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{delay:Math.min(V*.02,.4)},children:r.jsx(FP,{skill:T})},T.id))}),b.length>0&&r.jsx("div",{className:"px-4 py-2 border-t border-white/5 shrink-0 flex items-center gap-1.5",children:r.jsxs("span",{className:"text-[10px] text-gray-700 font-mono",children:[A.length," / ",b.length," skills"]})})]})]})}const $P={html:i0,htm:i0,json:yn,js:yn,ts:yn,tsx:yn,jsx:yn};function UP(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function HP(e){try{return new Date(e).toLocaleString("en-US",{dateStyle:"short",timeStyle:"short"})}catch{return e}}function WP(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)/g,t=>{let n="color:#86efac";return/^"/.test(t)&&(n=/:$/.test(t)?"color:#93c5fd":"color:#fca5a5"),/true|false/.test(t)&&(n="color:#f97316"),/null/.test(t)&&(n="color:#6b7280"),`<span style="${n}">${t}</span>`})}function KP(){const[e,t]=h.useState([]),[n,s]=h.useState(null),[i,a]=h.useState(null),[o,l]=h.useState(!1),[c,u]=h.useState(null),[d,p]=h.useState(!1),f=h.useCallback(async()=>{p(!0);try{const b=await $("/api/workspace/files");if(b.ok){const g=await b.json();t(g.files??[])}}catch{}p(!1)},[]);h.useEffect(()=>{f()},[f]);const m=async b=>{s(b),a(null),u(null),l(!0);try{const g=await $(`/api/workspace/file?p=${encodeURIComponent(b.rel)}`);if(!g.ok)throw new Error(`HTTP ${g.status}`);const x=await g.json();a(x.content+(x.truncated?`
817
817
 
818
- [… file truncated at 1.5 MB …]`:""))}catch(g){u(g instanceof Error?g.message:"Failed to load file")}l(!1)},b=v=>{const g=VP[v]??Qt;return r.jsx(g,{size:12,className:"shrink-0 text-gray-500"})},y=()=>{if(o)return r.jsxs("div",{className:"flex items-center justify-center h-full text-gray-600 text-xs gap-2",children:[r.jsx(de,{size:14,className:"animate-spin"})," Loading…"]});if(c)return r.jsxs("div",{className:"flex items-center justify-center h-full gap-2 text-red-400 text-xs",children:[r.jsx(wt,{size:14})," ",c]});if(!i)return r.jsx("div",{className:"flex items-center justify-center h-full text-gray-700 text-xs",children:"Select a file to preview"});const v=(n==null?void 0:n.ext)??"";if(v==="html"||v==="htm")return r.jsx("iframe",{srcDoc:i,sandbox:"allow-scripts",className:"w-full h-full border-0 bg-white",title:"workspace-preview"});const g=v==="json"?HP(i):i.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");return r.jsx("pre",{className:"w-full h-full overflow-auto p-4 text-[11px] font-mono text-gray-300 leading-relaxed whitespace-pre-wrap break-words bg-transparent",dangerouslySetInnerHTML:{__html:g}})};return r.jsxs("div",{className:"flex h-full overflow-hidden bg-[#080b12]",children:[r.jsxs("div",{className:"w-52 shrink-0 border-r border-white/5 flex flex-col overflow-hidden",children:[r.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-white/5",children:[r.jsxs("div",{className:"flex items-center gap-1.5 text-[10px] font-bold text-gray-500 uppercase tracking-widest",children:[r.jsx(ps,{size:11,className:"text-orange-400"}),"Workspace"]}),r.jsx("button",{onClick:f,disabled:d,className:"text-gray-700 hover:text-gray-400 transition-colors",title:"Refresh",children:r.jsx(de,{size:11,className:d?"animate-spin":""})})]}),r.jsx("div",{className:"flex-1 overflow-y-auto py-1 scrollbar-hide",children:e.length===0?r.jsx("p",{className:"text-[10px] text-gray-700 text-center py-6",children:"No files in workspace yet"}):e.map(v=>r.jsxs("button",{onClick:()=>m(v),className:`w-full flex items-center gap-2 px-3 py-1.5 text-left transition-colors group ${(n==null?void 0:n.rel)===v.rel?"bg-orange-500/10 text-orange-300":"text-gray-500 hover:text-gray-300 hover:bg-white/3"}`,children:[b(v.ext),r.jsx("span",{className:"text-[11px] truncate flex-1",children:v.name}),r.jsx(dn,{size:10,className:`shrink-0 opacity-0 group-hover:opacity-100 transition-opacity ${(n==null?void 0:n.rel)===v.rel?"opacity-100 text-orange-400":""}`})]},v.rel))})]}),r.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[r.jsxs("div",{className:"flex items-center justify-between px-4 py-2 border-b border-white/5 bg-white/[0.015] shrink-0",children:[r.jsx(se,{mode:"wait",children:n?r.jsxs(H.div,{initial:{opacity:0,x:-8},animate:{opacity:1,x:0},exit:{opacity:0},className:"flex items-center gap-2 min-w-0",children:[r.jsx("span",{className:"text-[11px] font-mono text-gray-400 truncate",children:n.rel}),r.jsxs("span",{className:"text-[9px] text-gray-700 shrink-0",children:[$P(n.size)," · ",UP(n.mtime)]})]},n.rel):r.jsx("span",{className:"text-[11px] text-gray-700",children:"No file selected"})}),n&&(n.ext==="html"||n.ext==="htm")&&r.jsx("button",{onClick:()=>window.open(`/api/workspace/file?p=${encodeURIComponent(n.rel)}&raw=1`,"_blank"),className:"text-gray-600 hover:text-gray-300 transition-colors shrink-0 ml-2",title:"Open in new tab",children:r.jsx(Al,{size:12})})]}),r.jsx("div",{className:"flex-1 overflow-hidden relative",children:y()})]})]})}const no={button:"rgba(234,88,12,0.7)",input:"rgba(59,130,246,0.7)",image:"rgba(168,85,247,0.6)",unknown:"rgba(255,255,255,0.3)"};function KP(){const[e,t]=h.useState(!1),[n,s]=h.useState(null),[i,a]=h.useState(null),[o,l]=h.useState(!1),c=h.useRef(null);h.useEffect(()=>{if(!n||!c.current)return;const d=c.current,p=d.getContext("2d");if(!p)return;const f=new Image;f.onload=()=>{var m;if(d.width=f.width,d.height=f.height,p.drawImage(f,0,0),(m=n.elements)!=null&&m.length)for(const b of n.elements)p.strokeStyle=no[b.type]??no.unknown,p.lineWidth=Math.max(2,Math.round(f.width/400)),p.strokeRect(b.x,b.y,b.width,b.height),p.fillStyle=no[b.type]??no.unknown,p.font=`${Math.max(10,Math.round(f.width/120))}px monospace`,p.fillText(b.type,b.x+4,b.y+14)},f.src=`data:image/png;base64,${n.base64}`},[n]),h.useEffect(()=>{const d=at();return d.on("agentUpdate",p=>{p.type==="SCREEN_CAPTURE_START"?t(!0):p.type==="SCREEN_CAPTURED"&&(t(!1),s({base64:p.base64,width:p.width,height:p.height,source:p.source,elements:p.elements}))}),()=>{d.off("agentUpdate")}},[]);const u=async()=>{if(!e){try{const d=await $("/api/system/vision-guidance");if(d.ok){const p=await d.json();p.warn&&p.message&&a(p.message)}}catch{}await $("/api/system/screenshot",{method:"POST",body:JSON.stringify({detect:!0})}).catch(()=>{})}};return r.jsxs("div",{className:"border border-white/5 rounded-2xl bg-[#0a0d16]/60 overflow-hidden",children:[r.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-white/5",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Ls,{size:14,className:"text-orange-400"}),r.jsx("span",{className:"text-xs font-bold text-gray-400 tracking-widest uppercase",children:"Live Sight"}),n&&r.jsxs("span",{className:"text-[10px] text-gray-600 font-mono",children:[n.width,"×",n.height," · ",n.source]})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[n&&r.jsx("button",{onClick:()=>l(d=>!d),className:"text-gray-600 hover:text-gray-300 transition-colors",title:o?"Collapse":"Expand",children:o?r.jsx(Zh,{size:13}):r.jsx(Ls,{size:13})}),r.jsxs("button",{onClick:u,disabled:e,className:`flex items-center gap-1.5 px-3 py-1 rounded-lg text-xs font-medium transition-all ${e?"text-orange-400 bg-orange-500/10 animate-pulse cursor-not-allowed":"text-gray-500 hover:text-orange-400 hover:bg-orange-500/10 border border-white/5"}`,children:[r.jsx(oa,{size:11}),e?"Scanning…":"Capture"]})]})]}),r.jsx(se,{children:i&&r.jsxs(H.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},className:"px-4 py-3 bg-amber-500/8 border-b border-amber-500/15",children:[r.jsx("p",{className:"text-[11px] text-amber-400 leading-relaxed",children:i}),r.jsx("button",{onClick:()=>a(null),className:"text-[10px] text-amber-600 hover:text-amber-400 mt-1 transition-colors",children:"Dismiss"})]})}),r.jsx(se,{children:n&&r.jsxs(H.div,{initial:{opacity:0},animate:{opacity:1},className:`relative overflow-hidden transition-all duration-300 ${o?"max-h-[500px]":"max-h-[140px]"}`,children:[r.jsx("canvas",{ref:c,className:"w-full object-contain",style:{imageRendering:"auto"}}),n.elements&&n.elements.length>0&&r.jsxs("div",{className:"absolute bottom-2 right-2 px-2 py-0.5 bg-black/70 rounded-md text-[10px] font-mono text-orange-400 border border-orange-500/20",children:[n.elements.length," elements"]})]})}),!n&&!e&&r.jsx("div",{className:"flex items-center justify-center py-8 text-gray-700 text-xs",children:"Press Capture to see what Must-b sees"}),e&&r.jsxs("div",{className:"flex items-center justify-center gap-2 py-8 text-orange-400 text-xs animate-pulse",children:[r.jsx(oa,{size:14,className:"animate-spin"}),"Scanning screen…"]})]})}const GP=4,Q0=1e4;function qP(){const[e,t]=h.useState([]),n=h.useId(),s=h.useCallback(i=>{t(a=>a.filter(o=>o.id!==i))},[]);return h.useEffect(()=>{const i=at();return i.on("projectInsight",a=>{const o={id:`${n}-${a.ts}-${Math.random().toString(36).slice(2,7)}`,message:a.message,filePath:a.filePath,ts:a.ts};t(l=>[o,...l].slice(0,GP)),setTimeout(()=>s(o.id),Q0)}),()=>{i.off("projectInsight")}},[s,n]),e.length===0?null:r.jsx("div",{className:"fixed bottom-6 right-5 z-[150] flex flex-col gap-2.5 items-end",style:{maxWidth:"340px",pointerEvents:"none"},children:r.jsx(se,{mode:"popLayout",children:e.map((i,a)=>r.jsx(H.div,{layout:!0,initial:{opacity:0,x:60,scale:.94},animate:{opacity:1,x:0,scale:1},exit:{opacity:0,x:60,scale:.92},transition:{type:"spring",stiffness:340,damping:28},style:{pointerEvents:"auto",opacity:a===0?1:1-a*.12},className:"w-full",children:r.jsxs("div",{className:"rounded-2xl overflow-hidden",style:{background:"rgba(15,6,1,0.82)",border:"1px solid rgba(249,115,22,0.28)",backdropFilter:"blur(24px)",boxShadow:"0 8px 32px rgba(0,0,0,0.55), 0 0 0 1px rgba(249,115,22,0.08), inset 0 1px 0 rgba(255,255,255,0.04)"},children:[r.jsxs("div",{className:"flex items-center justify-between px-4 pt-3 pb-2",style:{borderBottom:"1px solid rgba(249,115,22,0.12)"},children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"w-5 h-5 rounded-full flex items-center justify-center flex-shrink-0",style:{background:"rgba(249,115,22,0.18)",border:"1px solid rgba(249,115,22,0.30)"},children:r.jsx(Ll,{size:10,className:"text-orange-400"})}),r.jsx("span",{className:"text-[11px] font-semibold text-orange-300/80 tracking-wide uppercase",children:"Must-b fısıldıyor"})]}),r.jsx("button",{onClick:()=>s(i.id),className:"text-white/25 hover:text-white/60 transition-colors",children:r.jsx(et,{size:12})})]}),r.jsxs("div",{className:"px-4 py-3 space-y-2",children:[r.jsx("p",{className:"text-[13px] text-white/80 leading-relaxed",children:i.message}),i.filePath&&r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx(Qt,{size:10,className:"text-white/25 flex-shrink-0"}),r.jsx("span",{className:"text-[10px] font-mono text-white/35 truncate",children:i.filePath.replace(/\\/g,"/")})]})]}),r.jsx("div",{className:"h-px w-full",style:{background:"rgba(249,115,22,0.10)"},children:r.jsx(H.div,{className:"h-full",style:{background:"rgba(249,115,22,0.45)"},initial:{width:"100%"},animate:{width:"0%"},transition:{duration:Q0/1e3,ease:"linear"}})})]})},i.id))})})}const YP=6e3,XP=/https?:\/\/[^\s"'>)]+/,QP=new Set(["browser_navigate","browser_click","browser_type","browser_scroll","browser_wait","browser_perceive","browser_extract","browser_snapshot","browser_screenshot","web_fetch","web-fetch","web-search"]);function JP(e){const t=e.match(XP);return t?t[0].replace(/[.,;)]+$/,""):null}function ZP(e,t=52){try{const n=new URL(e),s=n.hostname.replace(/^www\./,""),i=n.pathname.length>1?n.pathname:"",a=s+i;return a.length>t?a.slice(0,t-1)+"…":a}catch{return e.length>t?e.slice(0,t-1)+"…":e}}function e6(){const[e,t]=h.useState(null),[n,s]=h.useState(!1),[i,a]=h.useState(!1),[o,l]=h.useState(null),[c,u]=h.useState(null),[d,p]=h.useState(!1),f=h.useRef(null),m=h.useRef(!1),b=h.useCallback(()=>{f.current&&clearTimeout(f.current),f.current=setTimeout(()=>{s(!1),t(null),l(null),u(null),m.current=!1},YP)},[]);return h.useEffect(()=>{const y=at(),v=g=>{if(g.type==="shadowFrame"&&typeof g.slot!="number"||g.type==="ghostFrame"){const x=g.base64;if(!x)return;t(x),p(!1),m.current||(m.current=!0,s(!0),a(!1)),b();return}if(g.type==="shadowToggle"){!g.enabled&&typeof g.slot!="number"?(s(!1),t(null),l(null),u(null),m.current=!1,f.current&&clearTimeout(f.current)):g.enabled&&typeof g.slot!="number"&&(p(!0),s(!0),a(!1),m.current=!0);return}if(g.type==="ghostNav"){const x=g.url;x&&x!=="about:blank"&&l(x);return}if(g.type==="stepStart"){const x=g.step,w=(x==null?void 0:x.description)??"",j=(x==null?void 0:x.tool)??"";if(QP.has(j)||/navigate|click|type|browse|fetch|search/i.test(w)){const k=w.length>72?w.slice(0,71)+"…":w;u(k);const N=JP(w);N&&l(N)}return}if(g.type==="stepFinish"){u(null);return}if(g.type==="planFinish"){u(null),b();return}};return y.on("agentUpdate",v),()=>{y.off("agentUpdate",v),f.current&&clearTimeout(f.current)}},[b]),r.jsx(se,{children:n&&r.jsx(H.div,{initial:{opacity:0,y:24,scale:.94},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:16,scale:.92},transition:{type:"spring",stiffness:340,damping:30},className:"fixed bottom-6 left-5 z-[140] flex flex-col",style:{width:i?"auto":"320px",pointerEvents:"auto"},children:r.jsxs("div",{className:"rounded-2xl overflow-hidden flex flex-col",style:{background:"rgba(10,4,1,0.88)",border:"1px solid rgba(249,115,22,0.28)",backdropFilter:"blur(24px) saturate(180%)",boxShadow:"0 12px 40px rgba(0,0,0,0.65), 0 0 0 1px rgba(249,115,22,0.08), inset 0 1px 0 rgba(255,255,255,0.04)"},children:[r.jsxs("div",{className:"flex items-center justify-between px-3 py-2 select-none flex-shrink-0",style:{borderBottom:i?"none":"1px solid rgba(249,115,22,0.12)"},children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsxs("span",{className:"relative flex-shrink-0",children:[r.jsx("span",{className:"block w-2 h-2 rounded-full bg-orange-500"}),r.jsx("span",{className:"absolute inset-0 rounded-full bg-orange-500 animate-ping opacity-60"})]}),r.jsx(We,{size:11,className:"text-orange-400/70"}),r.jsx("span",{className:"text-[11px] font-semibold text-white/70 tracking-wide",children:"Live Browser"})]}),r.jsxs("div",{className:"flex items-center gap-1",children:[r.jsx("button",{onClick:()=>a(y=>!y),className:"w-5 h-5 rounded-full flex items-center justify-center text-white/25 hover:text-white/60 hover:bg-white/8 transition-all",title:i?"Expand":"Minimize",children:i?r.jsx(jC,{size:10}):r.jsx(SC,{size:10})}),r.jsx("button",{onClick:()=>{s(!1),m.current=!1},className:"w-5 h-5 rounded-full flex items-center justify-center text-white/25 hover:text-white/60 hover:bg-white/8 transition-all",title:"Close",children:r.jsx(et,{size:10})})]})]}),r.jsx(se,{children:!i&&r.jsxs(H.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.22},className:"overflow-hidden",children:[r.jsxs("div",{className:"relative w-full overflow-hidden",style:{aspectRatio:"16 / 10",background:"#08030100"},children:[d&&!e?r.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:r.jsx(ne,{size:20,className:"text-orange-400/50 animate-spin"})}):e?r.jsx("img",{src:`data:image/jpeg;base64,${e}`,alt:"Browser preview",className:"w-full h-full object-cover",style:{imageRendering:"auto"}}):r.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center gap-2",children:[r.jsx(We,{size:22,className:"text-orange-400/20"}),r.jsx("span",{className:"text-[11px] text-white/20",children:"Browser waiting…"})]}),e&&r.jsx("div",{className:"absolute inset-0 pointer-events-none",style:{background:"repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,0.04) 2px, rgba(0,0,0,0.04) 4px)"}})]}),o&&r.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5",style:{borderTop:"1px solid rgba(249,115,22,0.10)"},children:[r.jsx(We,{size:9,className:"text-orange-400/40 flex-shrink-0"}),r.jsx("span",{className:"text-[10px] font-mono text-white/40 truncate flex-1",children:ZP(o)})]}),r.jsx(se,{children:c&&r.jsxs(H.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.18},className:"px-3 py-2 flex items-start gap-2",style:{borderTop:"1px solid rgba(249,115,22,0.08)"},children:[r.jsx("div",{className:"flex items-center gap-0.5 mt-1 flex-shrink-0",children:[0,1,2].map(y=>r.jsx("span",{className:"block w-1 h-1 rounded-full bg-orange-400/60 animate-bounce",style:{animationDelay:`${y*.15}s`}},y))}),r.jsx("p",{className:"text-[10.5px] text-white/50 leading-snug line-clamp-2",children:c})]},"action-bar")})]},"pip-content")})]})},"live-browser-pip")})}const qc={authenticated:!1,userEmail:null,userName:null,avatarUrl:null,expiresAt:null};function t6(e,t){return e?e.split(" ").map(n=>n[0]).join("").slice(0,2).toUpperCase():t?t[0].toUpperCase():"?"}function n6(){const[e,t]=h.useState(!1),[n,s]=h.useState(qc),[i,a]=h.useState(!1),o=h.useRef(null),l=h.useCallback(()=>{fetch("/api/auth/user-status").then(b=>b.json()).then(b=>s(b)).catch(()=>{})},[]);h.useEffect(()=>{l()},[l]),h.useEffect(()=>{const b=at(),y=v=>{v.authenticated?s(g=>({...g,authenticated:!0,userEmail:v.userEmail??g.userEmail,userName:v.userName??g.userName,avatarUrl:v.avatarUrl??g.avatarUrl})):s(qc)};return b.on("authStateChanged",y),()=>{b.off("authStateChanged",y)}},[]),h.useEffect(()=>{const b=y=>{y.data==="mustb:auth:done"&&l()};return window.addEventListener("message",b),()=>window.removeEventListener("message",b)},[l]),h.useEffect(()=>{if(!e)return;const b=y=>{o.current&&!o.current.contains(y.target)&&t(!1)};return document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[e]),h.useEffect(()=>{if(!e)return;const b=y=>{y.key==="Escape"&&t(!1)};return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[e]);const c="https://must-b.com",u=b=>{window.open(`${c}/auth/connect?provider=${b}`,"mustb-auth","width=540,height=660,scrollbars=yes")},d=async()=>{a(!0);try{await fetch("/api/auth/signout",{method:"POST"}),s(qc),t(!1)}finally{a(!1)}},p=b=>{window.open(`${c}${b}`,"_blank","noopener,noreferrer")},f=t6(n.userName,n.userEmail),m=n.authenticated;return r.jsxs("div",{ref:o,className:"relative flex flex-col items-end",children:[m?r.jsxs("button",{onClick:()=>t(b=>!b),title:n.userEmail??"Account",className:"relative w-9 h-9 rounded-full flex items-center justify-center select-none transition-all duration-200 focus:outline-none bg-white/10 border border-white/20 hover:border-orange-400/50 hover:bg-white/15 shadow-[0_4px_16px_rgba(0,0,0,0.5)]",children:[n.avatarUrl?r.jsx("img",{src:n.avatarUrl,alt:"avatar",className:"w-full h-full rounded-full object-cover"}):r.jsx("span",{className:"text-[13px] font-black text-orange-400",children:f}),r.jsx("span",{className:"absolute bottom-0 right-0 w-2.5 h-2.5 rounded-full bg-emerald-400 border-2 border-black"})]}):r.jsxs("button",{onClick:()=>t(b=>!b),title:"Sign in to must-b",className:"flex items-center gap-2 px-3.5 py-2 rounded-xl font-semibold text-[13px] select-none transition-all duration-200 focus:outline-none bg-orange-600 hover:bg-orange-500 text-white shadow-[0_4px_20px_rgba(249,115,22,0.45)] active:scale-[0.97]",children:[r.jsx(bC,{size:14}),"Sign In"]}),r.jsx(se,{children:e&&r.jsxs(H.div,{initial:{opacity:0,scale:.93,y:-8},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.93,y:-6},transition:{duration:.17,ease:[.22,1,.36,1]},className:`absolute top-full right-0 mt-2 w-72 glass-panel rounded-2xl overflow-hidden
818
+ [… file truncated at 1.5 MB …]`:""))}catch(g){u(g instanceof Error?g.message:"Failed to load file")}l(!1)},v=b=>{const g=$P[b]??Qt;return r.jsx(g,{size:12,className:"shrink-0 text-gray-500"})},y=()=>{if(o)return r.jsxs("div",{className:"flex items-center justify-center h-full text-gray-600 text-xs gap-2",children:[r.jsx(de,{size:14,className:"animate-spin"})," Loading…"]});if(c)return r.jsxs("div",{className:"flex items-center justify-center h-full gap-2 text-red-400 text-xs",children:[r.jsx(wt,{size:14})," ",c]});if(!i)return r.jsx("div",{className:"flex items-center justify-center h-full text-gray-700 text-xs",children:"Select a file to preview"});const b=(n==null?void 0:n.ext)??"";if(b==="html"||b==="htm")return r.jsx("iframe",{srcDoc:i,sandbox:"allow-scripts",className:"w-full h-full border-0 bg-white",title:"workspace-preview"});const g=b==="json"?WP(i):i.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");return r.jsx("pre",{className:"w-full h-full overflow-auto p-4 text-[11px] font-mono text-gray-300 leading-relaxed whitespace-pre-wrap break-words bg-transparent",dangerouslySetInnerHTML:{__html:g}})};return r.jsxs("div",{className:"flex h-full overflow-hidden bg-[#080b12]",children:[r.jsxs("div",{className:"w-52 shrink-0 border-r border-white/5 flex flex-col overflow-hidden",children:[r.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-white/5",children:[r.jsxs("div",{className:"flex items-center gap-1.5 text-[10px] font-bold text-gray-500 uppercase tracking-widest",children:[r.jsx(ps,{size:11,className:"text-orange-400"}),"Workspace"]}),r.jsx("button",{onClick:f,disabled:d,className:"text-gray-700 hover:text-gray-400 transition-colors",title:"Refresh",children:r.jsx(de,{size:11,className:d?"animate-spin":""})})]}),r.jsx("div",{className:"flex-1 overflow-y-auto py-1 scrollbar-hide",children:e.length===0?r.jsx("p",{className:"text-[10px] text-gray-700 text-center py-6",children:"No files in workspace yet"}):e.map(b=>r.jsxs("button",{onClick:()=>m(b),className:`w-full flex items-center gap-2 px-3 py-1.5 text-left transition-colors group ${(n==null?void 0:n.rel)===b.rel?"bg-orange-500/10 text-orange-300":"text-gray-500 hover:text-gray-300 hover:bg-white/3"}`,children:[v(b.ext),r.jsx("span",{className:"text-[11px] truncate flex-1",children:b.name}),r.jsx(dn,{size:10,className:`shrink-0 opacity-0 group-hover:opacity-100 transition-opacity ${(n==null?void 0:n.rel)===b.rel?"opacity-100 text-orange-400":""}`})]},b.rel))})]}),r.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[r.jsxs("div",{className:"flex items-center justify-between px-4 py-2 border-b border-white/5 bg-white/[0.015] shrink-0",children:[r.jsx(se,{mode:"wait",children:n?r.jsxs(H.div,{initial:{opacity:0,x:-8},animate:{opacity:1,x:0},exit:{opacity:0},className:"flex items-center gap-2 min-w-0",children:[r.jsx("span",{className:"text-[11px] font-mono text-gray-400 truncate",children:n.rel}),r.jsxs("span",{className:"text-[9px] text-gray-700 shrink-0",children:[UP(n.size)," · ",HP(n.mtime)]})]},n.rel):r.jsx("span",{className:"text-[11px] text-gray-700",children:"No file selected"})}),n&&(n.ext==="html"||n.ext==="htm")&&r.jsx("button",{onClick:()=>window.open(`/api/workspace/file?p=${encodeURIComponent(n.rel)}&raw=1`,"_blank"),className:"text-gray-600 hover:text-gray-300 transition-colors shrink-0 ml-2",title:"Open in new tab",children:r.jsx(Ml,{size:12})})]}),r.jsx("div",{className:"flex-1 overflow-hidden relative",children:y()})]})]})}const no={button:"rgba(234,88,12,0.7)",input:"rgba(59,130,246,0.7)",image:"rgba(168,85,247,0.6)",unknown:"rgba(255,255,255,0.3)"};function GP(){const[e,t]=h.useState(!1),[n,s]=h.useState(null),[i,a]=h.useState(null),[o,l]=h.useState(!1),c=h.useRef(null);h.useEffect(()=>{if(!n||!c.current)return;const d=c.current,p=d.getContext("2d");if(!p)return;const f=new Image;f.onload=()=>{var m;if(d.width=f.width,d.height=f.height,p.drawImage(f,0,0),(m=n.elements)!=null&&m.length)for(const v of n.elements)p.strokeStyle=no[v.type]??no.unknown,p.lineWidth=Math.max(2,Math.round(f.width/400)),p.strokeRect(v.x,v.y,v.width,v.height),p.fillStyle=no[v.type]??no.unknown,p.font=`${Math.max(10,Math.round(f.width/120))}px monospace`,p.fillText(v.type,v.x+4,v.y+14)},f.src=`data:image/png;base64,${n.base64}`},[n]),h.useEffect(()=>{const d=at();return d.on("agentUpdate",p=>{p.type==="SCREEN_CAPTURE_START"?t(!0):p.type==="SCREEN_CAPTURED"&&(t(!1),s({base64:p.base64,width:p.width,height:p.height,source:p.source,elements:p.elements}))}),()=>{d.off("agentUpdate")}},[]);const u=async()=>{if(!e){try{const d=await $("/api/system/vision-guidance");if(d.ok){const p=await d.json();p.warn&&p.message&&a(p.message)}}catch{}await $("/api/system/screenshot",{method:"POST",body:JSON.stringify({detect:!0})}).catch(()=>{})}};return r.jsxs("div",{className:"border border-white/5 rounded-2xl bg-[#0a0d16]/60 overflow-hidden",children:[r.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-white/5",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Ls,{size:14,className:"text-orange-400"}),r.jsx("span",{className:"text-xs font-bold text-gray-400 tracking-widest uppercase",children:"Live Sight"}),n&&r.jsxs("span",{className:"text-[10px] text-gray-600 font-mono",children:[n.width,"×",n.height," · ",n.source]})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[n&&r.jsx("button",{onClick:()=>l(d=>!d),className:"text-gray-600 hover:text-gray-300 transition-colors",title:o?"Collapse":"Expand",children:o?r.jsx(Zh,{size:13}):r.jsx(Ls,{size:13})}),r.jsxs("button",{onClick:u,disabled:e,className:`flex items-center gap-1.5 px-3 py-1 rounded-lg text-xs font-medium transition-all ${e?"text-orange-400 bg-orange-500/10 animate-pulse cursor-not-allowed":"text-gray-500 hover:text-orange-400 hover:bg-orange-500/10 border border-white/5"}`,children:[r.jsx(oa,{size:11}),e?"Scanning…":"Capture"]})]})]}),r.jsx(se,{children:i&&r.jsxs(H.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},className:"px-4 py-3 bg-amber-500/8 border-b border-amber-500/15",children:[r.jsx("p",{className:"text-[11px] text-amber-400 leading-relaxed",children:i}),r.jsx("button",{onClick:()=>a(null),className:"text-[10px] text-amber-600 hover:text-amber-400 mt-1 transition-colors",children:"Dismiss"})]})}),r.jsx(se,{children:n&&r.jsxs(H.div,{initial:{opacity:0},animate:{opacity:1},className:`relative overflow-hidden transition-all duration-300 ${o?"max-h-[500px]":"max-h-[140px]"}`,children:[r.jsx("canvas",{ref:c,className:"w-full object-contain",style:{imageRendering:"auto"}}),n.elements&&n.elements.length>0&&r.jsxs("div",{className:"absolute bottom-2 right-2 px-2 py-0.5 bg-black/70 rounded-md text-[10px] font-mono text-orange-400 border border-orange-500/20",children:[n.elements.length," elements"]})]})}),!n&&!e&&r.jsx("div",{className:"flex items-center justify-center py-8 text-gray-700 text-xs",children:"Press Capture to see what Must-b sees"}),e&&r.jsxs("div",{className:"flex items-center justify-center gap-2 py-8 text-orange-400 text-xs animate-pulse",children:[r.jsx(oa,{size:14,className:"animate-spin"}),"Scanning screen…"]})]})}const qP=4,Q0=1e4;function YP(){const[e,t]=h.useState([]),n=h.useId(),s=h.useCallback(i=>{t(a=>a.filter(o=>o.id!==i))},[]);return h.useEffect(()=>{const i=at();return i.on("projectInsight",a=>{const o={id:`${n}-${a.ts}-${Math.random().toString(36).slice(2,7)}`,message:a.message,filePath:a.filePath,ts:a.ts};t(l=>[o,...l].slice(0,qP)),setTimeout(()=>s(o.id),Q0)}),()=>{i.off("projectInsight")}},[s,n]),e.length===0?null:r.jsx("div",{className:"fixed bottom-6 right-5 z-[150] flex flex-col gap-2.5 items-end",style:{maxWidth:"340px",pointerEvents:"none"},children:r.jsx(se,{mode:"popLayout",children:e.map((i,a)=>r.jsx(H.div,{layout:!0,initial:{opacity:0,x:60,scale:.94},animate:{opacity:1,x:0,scale:1},exit:{opacity:0,x:60,scale:.92},transition:{type:"spring",stiffness:340,damping:28},style:{pointerEvents:"auto",opacity:a===0?1:1-a*.12},className:"w-full",children:r.jsxs("div",{className:"rounded-2xl overflow-hidden",style:{background:"rgba(15,6,1,0.82)",border:"1px solid rgba(249,115,22,0.28)",backdropFilter:"blur(24px)",boxShadow:"0 8px 32px rgba(0,0,0,0.55), 0 0 0 1px rgba(249,115,22,0.08), inset 0 1px 0 rgba(255,255,255,0.04)"},children:[r.jsxs("div",{className:"flex items-center justify-between px-4 pt-3 pb-2",style:{borderBottom:"1px solid rgba(249,115,22,0.12)"},children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"w-5 h-5 rounded-full flex items-center justify-center flex-shrink-0",style:{background:"rgba(249,115,22,0.18)",border:"1px solid rgba(249,115,22,0.30)"},children:r.jsx(Ll,{size:10,className:"text-orange-400"})}),r.jsx("span",{className:"text-[11px] font-semibold text-orange-300/80 tracking-wide uppercase",children:"Must-b fısıldıyor"})]}),r.jsx("button",{onClick:()=>s(i.id),className:"text-white/25 hover:text-white/60 transition-colors",children:r.jsx(et,{size:12})})]}),r.jsxs("div",{className:"px-4 py-3 space-y-2",children:[r.jsx("p",{className:"text-[13px] text-white/80 leading-relaxed",children:i.message}),i.filePath&&r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx(Qt,{size:10,className:"text-white/25 flex-shrink-0"}),r.jsx("span",{className:"text-[10px] font-mono text-white/35 truncate",children:i.filePath.replace(/\\/g,"/")})]})]}),r.jsx("div",{className:"h-px w-full",style:{background:"rgba(249,115,22,0.10)"},children:r.jsx(H.div,{className:"h-full",style:{background:"rgba(249,115,22,0.45)"},initial:{width:"100%"},animate:{width:"0%"},transition:{duration:Q0/1e3,ease:"linear"}})})]})},i.id))})})}const XP=6e3,QP=/https?:\/\/[^\s"'>)]+/,JP=new Set(["browser_navigate","browser_click","browser_type","browser_scroll","browser_wait","browser_perceive","browser_extract","browser_snapshot","browser_screenshot","web_fetch","web-fetch","web-search"]);function ZP(e){const t=e.match(QP);return t?t[0].replace(/[.,;)]+$/,""):null}function e6(e,t=52){try{const n=new URL(e),s=n.hostname.replace(/^www\./,""),i=n.pathname.length>1?n.pathname:"",a=s+i;return a.length>t?a.slice(0,t-1)+"…":a}catch{return e.length>t?e.slice(0,t-1)+"…":e}}function t6(){const[e,t]=h.useState(null),[n,s]=h.useState(!1),[i,a]=h.useState(!1),[o,l]=h.useState(null),[c,u]=h.useState(null),[d,p]=h.useState(!1),f=h.useRef(null),m=h.useRef(!1),v=h.useCallback(()=>{f.current&&clearTimeout(f.current),f.current=setTimeout(()=>{s(!1),t(null),l(null),u(null),m.current=!1},XP)},[]);return h.useEffect(()=>{const y=at(),b=g=>{if(g.type==="shadowFrame"&&typeof g.slot!="number"||g.type==="ghostFrame"){const x=g.base64;if(!x)return;t(x),p(!1),m.current||(m.current=!0,s(!0),a(!1)),v();return}if(g.type==="shadowToggle"){!g.enabled&&typeof g.slot!="number"?(s(!1),t(null),l(null),u(null),m.current=!1,f.current&&clearTimeout(f.current)):g.enabled&&typeof g.slot!="number"&&(p(!0),s(!0),a(!1),m.current=!0);return}if(g.type==="ghostNav"){const x=g.url;x&&x!=="about:blank"&&l(x);return}if(g.type==="stepStart"){const x=g.step,w=(x==null?void 0:x.description)??"",j=(x==null?void 0:x.tool)??"";if(JP.has(j)||/navigate|click|type|browse|fetch|search/i.test(w)){const k=w.length>72?w.slice(0,71)+"…":w;u(k);const N=ZP(w);N&&l(N)}return}if(g.type==="stepFinish"){u(null);return}if(g.type==="planFinish"){u(null),v();return}};return y.on("agentUpdate",b),()=>{y.off("agentUpdate",b),f.current&&clearTimeout(f.current)}},[v]),r.jsx(se,{children:n&&r.jsx(H.div,{initial:{opacity:0,y:24,scale:.94},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:16,scale:.92},transition:{type:"spring",stiffness:340,damping:30},className:"fixed bottom-6 left-5 z-[140] flex flex-col",style:{width:i?"auto":"320px",pointerEvents:"auto"},children:r.jsxs("div",{className:"rounded-2xl overflow-hidden flex flex-col",style:{background:"rgba(10,4,1,0.88)",border:"1px solid rgba(249,115,22,0.28)",backdropFilter:"blur(24px) saturate(180%)",boxShadow:"0 12px 40px rgba(0,0,0,0.65), 0 0 0 1px rgba(249,115,22,0.08), inset 0 1px 0 rgba(255,255,255,0.04)"},children:[r.jsxs("div",{className:"flex items-center justify-between px-3 py-2 select-none flex-shrink-0",style:{borderBottom:i?"none":"1px solid rgba(249,115,22,0.12)"},children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsxs("span",{className:"relative flex-shrink-0",children:[r.jsx("span",{className:"block w-2 h-2 rounded-full bg-orange-500"}),r.jsx("span",{className:"absolute inset-0 rounded-full bg-orange-500 animate-ping opacity-60"})]}),r.jsx(We,{size:11,className:"text-orange-400/70"}),r.jsx("span",{className:"text-[11px] font-semibold text-white/70 tracking-wide",children:"Live Browser"})]}),r.jsxs("div",{className:"flex items-center gap-1",children:[r.jsx("button",{onClick:()=>a(y=>!y),className:"w-5 h-5 rounded-full flex items-center justify-center text-white/25 hover:text-white/60 hover:bg-white/8 transition-all",title:i?"Expand":"Minimize",children:i?r.jsx(jC,{size:10}):r.jsx(SC,{size:10})}),r.jsx("button",{onClick:()=>{s(!1),m.current=!1},className:"w-5 h-5 rounded-full flex items-center justify-center text-white/25 hover:text-white/60 hover:bg-white/8 transition-all",title:"Close",children:r.jsx(et,{size:10})})]})]}),r.jsx(se,{children:!i&&r.jsxs(H.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.22},className:"overflow-hidden",children:[r.jsxs("div",{className:"relative w-full overflow-hidden",style:{aspectRatio:"16 / 10",background:"#08030100"},children:[d&&!e?r.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:r.jsx(ne,{size:20,className:"text-orange-400/50 animate-spin"})}):e?r.jsx("img",{src:`data:image/jpeg;base64,${e}`,alt:"Browser preview",className:"w-full h-full object-cover",style:{imageRendering:"auto"}}):r.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center gap-2",children:[r.jsx(We,{size:22,className:"text-orange-400/20"}),r.jsx("span",{className:"text-[11px] text-white/20",children:"Browser waiting…"})]}),e&&r.jsx("div",{className:"absolute inset-0 pointer-events-none",style:{background:"repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,0.04) 2px, rgba(0,0,0,0.04) 4px)"}})]}),o&&r.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5",style:{borderTop:"1px solid rgba(249,115,22,0.10)"},children:[r.jsx(We,{size:9,className:"text-orange-400/40 flex-shrink-0"}),r.jsx("span",{className:"text-[10px] font-mono text-white/40 truncate flex-1",children:e6(o)})]}),r.jsx(se,{children:c&&r.jsxs(H.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.18},className:"px-3 py-2 flex items-start gap-2",style:{borderTop:"1px solid rgba(249,115,22,0.08)"},children:[r.jsx("div",{className:"flex items-center gap-0.5 mt-1 flex-shrink-0",children:[0,1,2].map(y=>r.jsx("span",{className:"block w-1 h-1 rounded-full bg-orange-400/60 animate-bounce",style:{animationDelay:`${y*.15}s`}},y))}),r.jsx("p",{className:"text-[10.5px] text-white/50 leading-snug line-clamp-2",children:c})]},"action-bar")})]},"pip-content")})]})},"live-browser-pip")})}const qc={authenticated:!1,userEmail:null,userName:null,avatarUrl:null,expiresAt:null};function n6(e,t){return e?e.split(" ").map(n=>n[0]).join("").slice(0,2).toUpperCase():t?t[0].toUpperCase():"?"}function s6(){const[e,t]=h.useState(!1),[n,s]=h.useState(qc),[i,a]=h.useState(!1),o=h.useRef(null),l=h.useCallback(()=>{fetch("/api/auth/user-status").then(v=>v.json()).then(v=>s(v)).catch(()=>{})},[]);h.useEffect(()=>{l()},[l]),h.useEffect(()=>{const v=at(),y=b=>{b.authenticated?s(g=>({...g,authenticated:!0,userEmail:b.userEmail??g.userEmail,userName:b.userName??g.userName,avatarUrl:b.avatarUrl??g.avatarUrl})):s(qc)};return v.on("authStateChanged",y),()=>{v.off("authStateChanged",y)}},[]),h.useEffect(()=>{const v=y=>{y.data==="mustb:auth:done"&&l()};return window.addEventListener("message",v),()=>window.removeEventListener("message",v)},[l]),h.useEffect(()=>{if(!e)return;const v=y=>{o.current&&!o.current.contains(y.target)&&t(!1)};return document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[e]),h.useEffect(()=>{if(!e)return;const v=y=>{y.key==="Escape"&&t(!1)};return document.addEventListener("keydown",v),()=>document.removeEventListener("keydown",v)},[e]);const c="https://must-b.com",u=v=>{window.open(`${c}/auth/connect?provider=${v}`,"mustb-auth","width=540,height=660,scrollbars=yes")},d=async()=>{a(!0);try{await fetch("/api/auth/signout",{method:"POST"}),s(qc),t(!1)}finally{a(!1)}},p=v=>{window.open(`${c}${v}`,"_blank","noopener,noreferrer")},f=n6(n.userName,n.userEmail),m=n.authenticated;return r.jsxs("div",{ref:o,className:"relative flex flex-col items-end",children:[m?r.jsxs("button",{onClick:()=>t(v=>!v),title:n.userEmail??"Account",className:"relative w-9 h-9 rounded-full flex items-center justify-center select-none transition-all duration-200 focus:outline-none bg-white/10 border border-white/20 hover:border-orange-400/50 hover:bg-white/15 shadow-[0_4px_16px_rgba(0,0,0,0.5)]",children:[n.avatarUrl?r.jsx("img",{src:n.avatarUrl,alt:"avatar",className:"w-full h-full rounded-full object-cover"}):r.jsx("span",{className:"text-[13px] font-black text-orange-400",children:f}),r.jsx("span",{className:"absolute bottom-0 right-0 w-2.5 h-2.5 rounded-full bg-emerald-400 border-2 border-black"})]}):r.jsxs("button",{onClick:()=>t(v=>!v),title:"Sign in to must-b",className:"flex items-center gap-2 px-3.5 py-2 rounded-xl font-semibold text-[13px] select-none transition-all duration-200 focus:outline-none bg-orange-600 hover:bg-orange-500 text-white shadow-[0_4px_20px_rgba(249,115,22,0.45)] active:scale-[0.97]",children:[r.jsx(bC,{size:14}),"Sign In"]}),r.jsx(se,{children:e&&r.jsxs(H.div,{initial:{opacity:0,scale:.93,y:-8},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.93,y:-6},transition:{duration:.17,ease:[.22,1,.36,1]},className:`absolute top-full right-0 mt-2 w-72 glass-panel rounded-2xl overflow-hidden
819
819
  shadow-[0_24px_64px_rgba(0,0,0,0.75),0_0_0_1px_rgba(249,115,22,0.18)] z-[60]`,children:[r.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-white/8",children:[r.jsx("span",{className:"text-[11px] font-black uppercase tracking-[0.1em] text-orange-400/70",children:m?"Account":"Sign in to must-b"}),r.jsx("button",{onClick:()=>t(!1),className:`w-6 h-6 flex items-center justify-center rounded-full
820
- hover:bg-white/8 text-white/30 hover:text-white/60 transition-colors`,children:r.jsx(et,{size:12})})]}),!m&&r.jsxs("div",{className:"p-4 flex flex-col gap-2",children:[r.jsx("p",{className:"text-[12px] text-white/50 text-center mb-1",children:"Cloud backup, multi-device sync and profile settings."}),r.jsxs("button",{onClick:()=>u("github"),className:"w-full flex items-center justify-center gap-2.5 px-4 py-2.5 rounded-xl bg-white/10 border border-white/15 text-white/80 text-[13px] font-semibold hover:bg-white/15 hover:text-white transition-all duration-200",children:[r.jsx(fC,{size:15}),"Continue with GitHub"]}),r.jsxs("button",{onClick:()=>u("google"),className:"w-full flex items-center justify-center gap-2.5 px-4 py-2.5 rounded-xl bg-white/5 border border-white/10 text-white/60 text-[13px] font-semibold hover:bg-white/10 hover:text-white/80 transition-all duration-200",children:[r.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",children:[r.jsx("path",{d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z",fill:"#4285F4"}),r.jsx("path",{d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z",fill:"#34A853"}),r.jsx("path",{d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z",fill:"#FBBC05"}),r.jsx("path",{d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z",fill:"#EA4335"})]}),"Continue with Google"]}),r.jsxs("button",{onClick:()=>u("apple"),className:"w-full flex items-center justify-center gap-2.5 px-4 py-2.5 rounded-xl bg-white/5 border border-white/10 text-white/60 text-[13px] font-semibold hover:bg-white/10 hover:text-white/80 transition-all duration-200",children:[r.jsx(Z1,{size:15}),"Continue with Apple"]}),r.jsxs("div",{className:"relative flex items-center gap-2 my-1",children:[r.jsx("div",{className:"flex-1 h-px bg-white/8"}),r.jsx("span",{className:"text-[10px] text-white/25 shrink-0",children:"or"}),r.jsx("div",{className:"flex-1 h-px bg-white/8"})]}),r.jsxs("button",{onClick:()=>p("/login?method=email"),className:"w-full flex items-center justify-center gap-2.5 px-4 py-2.5 rounded-xl bg-orange-500/20 border border-orange-400/35 text-orange-300 text-[13px] font-semibold hover:bg-orange-500/30 hover:border-orange-400/55 transition-all duration-200 shadow-[0_0_14px_rgba(249,115,22,0.18)]",children:[r.jsx(wC,{size:15}),"Sign in with Email"]}),r.jsxs("p",{className:"text-center text-[11px] text-white/30 mt-1",children:["Don't have an account?"," ",r.jsx("button",{onClick:()=>p("/signup"),className:"text-orange-400 hover:text-orange-300 font-semibold transition-colors underline-offset-2 hover:underline",children:"Sign up free"})]})]}),m&&r.jsxs("div",{className:"p-2",children:[r.jsxs("div",{className:"flex items-center gap-3 px-3 py-2.5 mb-1",children:[r.jsx("div",{className:"w-9 h-9 rounded-full bg-orange-500/20 border border-orange-400/30 flex items-center justify-center shrink-0 overflow-hidden",children:n.avatarUrl?r.jsx("img",{src:n.avatarUrl,alt:"avatar",className:"w-full h-full object-cover rounded-full"}):r.jsx("span",{className:"text-[14px] font-black text-orange-400",children:f})}),r.jsxs("div",{className:"min-w-0",children:[n.userName&&r.jsx("p",{className:"text-[13px] font-semibold text-white/90 truncate leading-tight",children:n.userName}),r.jsx("p",{className:"text-[11px] text-white/45 truncate",children:n.userEmail??"—"})]})]}),r.jsx("div",{className:"h-px bg-white/6 mx-2 mb-1"}),[{icon:r.jsx(gv,{size:13}),label:"Profile Settings",sub:"Web",action:()=>p("/profile/settings")},{icon:r.jsx(av,{size:13}),label:"Change Password",sub:"Web",action:()=>p("/profile/security")}].map(b=>r.jsxs("button",{onClick:()=>{b.action(),t(!1)},className:`w-full flex items-center gap-2.5 px-3 py-2 rounded-xl
820
+ hover:bg-white/8 text-white/30 hover:text-white/60 transition-colors`,children:r.jsx(et,{size:12})})]}),!m&&r.jsxs("div",{className:"p-4 flex flex-col gap-2",children:[r.jsx("p",{className:"text-[12px] text-white/50 text-center mb-1",children:"Cloud backup, multi-device sync and profile settings."}),r.jsxs("button",{onClick:()=>u("github"),className:"w-full flex items-center justify-center gap-2.5 px-4 py-2.5 rounded-xl bg-white/10 border border-white/15 text-white/80 text-[13px] font-semibold hover:bg-white/15 hover:text-white transition-all duration-200",children:[r.jsx(fC,{size:15}),"Continue with GitHub"]}),r.jsxs("button",{onClick:()=>u("google"),className:"w-full flex items-center justify-center gap-2.5 px-4 py-2.5 rounded-xl bg-white/5 border border-white/10 text-white/60 text-[13px] font-semibold hover:bg-white/10 hover:text-white/80 transition-all duration-200",children:[r.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",children:[r.jsx("path",{d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z",fill:"#4285F4"}),r.jsx("path",{d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z",fill:"#34A853"}),r.jsx("path",{d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z",fill:"#FBBC05"}),r.jsx("path",{d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z",fill:"#EA4335"})]}),"Continue with Google"]}),r.jsxs("button",{onClick:()=>u("apple"),className:"w-full flex items-center justify-center gap-2.5 px-4 py-2.5 rounded-xl bg-white/5 border border-white/10 text-white/60 text-[13px] font-semibold hover:bg-white/10 hover:text-white/80 transition-all duration-200",children:[r.jsx(Z1,{size:15}),"Continue with Apple"]}),r.jsxs("div",{className:"relative flex items-center gap-2 my-1",children:[r.jsx("div",{className:"flex-1 h-px bg-white/8"}),r.jsx("span",{className:"text-[10px] text-white/25 shrink-0",children:"or"}),r.jsx("div",{className:"flex-1 h-px bg-white/8"})]}),r.jsxs("button",{onClick:()=>p("/login?method=email"),className:"w-full flex items-center justify-center gap-2.5 px-4 py-2.5 rounded-xl bg-orange-500/20 border border-orange-400/35 text-orange-300 text-[13px] font-semibold hover:bg-orange-500/30 hover:border-orange-400/55 transition-all duration-200 shadow-[0_0_14px_rgba(249,115,22,0.18)]",children:[r.jsx(wC,{size:15}),"Sign in with Email"]}),r.jsxs("p",{className:"text-center text-[11px] text-white/30 mt-1",children:["Don't have an account?"," ",r.jsx("button",{onClick:()=>p("/signup"),className:"text-orange-400 hover:text-orange-300 font-semibold transition-colors underline-offset-2 hover:underline",children:"Sign up free"})]})]}),m&&r.jsxs("div",{className:"p-2",children:[r.jsxs("div",{className:"flex items-center gap-3 px-3 py-2.5 mb-1",children:[r.jsx("div",{className:"w-9 h-9 rounded-full bg-orange-500/20 border border-orange-400/30 flex items-center justify-center shrink-0 overflow-hidden",children:n.avatarUrl?r.jsx("img",{src:n.avatarUrl,alt:"avatar",className:"w-full h-full object-cover rounded-full"}):r.jsx("span",{className:"text-[14px] font-black text-orange-400",children:f})}),r.jsxs("div",{className:"min-w-0",children:[n.userName&&r.jsx("p",{className:"text-[13px] font-semibold text-white/90 truncate leading-tight",children:n.userName}),r.jsx("p",{className:"text-[11px] text-white/45 truncate",children:n.userEmail??"—"})]})]}),r.jsx("div",{className:"h-px bg-white/6 mx-2 mb-1"}),[{icon:r.jsx(gv,{size:13}),label:"Profile Settings",sub:"Web",action:()=>p("/profile/settings")},{icon:r.jsx(av,{size:13}),label:"Change Password",sub:"Web",action:()=>p("/profile/security")}].map(v=>r.jsxs("button",{onClick:()=>{v.action(),t(!1)},className:`w-full flex items-center gap-2.5 px-3 py-2 rounded-xl
821
821
  hover:bg-white/6 transition-colors group text-left`,children:[r.jsx("span",{className:`w-6 h-6 flex items-center justify-center rounded-lg
822
822
  bg-white/5 text-white/40 group-hover:text-orange-400
823
- group-hover:bg-orange-500/10 transition-all shrink-0`,children:b.icon}),r.jsx("span",{className:"text-[12px] font-semibold text-white/70 group-hover:text-white/90 transition-colors flex-1",children:b.label}),r.jsxs("span",{className:"flex items-center gap-1 text-[9px] text-white/25 group-hover:text-orange-400/60 transition-colors",children:[r.jsx(Al,{size:9}),b.sub]})]},b.label)),r.jsx("div",{className:"h-px bg-white/6 mx-2 my-1"}),r.jsxs("button",{onClick:d,disabled:i,className:`w-full flex items-center gap-2.5 px-3 py-2 rounded-xl
823
+ group-hover:bg-orange-500/10 transition-all shrink-0`,children:v.icon}),r.jsx("span",{className:"text-[12px] font-semibold text-white/70 group-hover:text-white/90 transition-colors flex-1",children:v.label}),r.jsxs("span",{className:"flex items-center gap-1 text-[9px] text-white/25 group-hover:text-orange-400/60 transition-colors",children:[r.jsx(Ml,{size:9}),v.sub]})]},v.label)),r.jsx("div",{className:"h-px bg-white/6 mx-2 my-1"}),r.jsxs("button",{onClick:d,disabled:i,className:`w-full flex items-center gap-2.5 px-3 py-2 rounded-xl
824
824
  hover:bg-red-500/10 transition-colors group text-left
825
825
  disabled:opacity-50 disabled:cursor-not-allowed`,children:[r.jsx("span",{className:`w-6 h-6 flex items-center justify-center rounded-lg
826
826
  bg-white/5 text-white/30 group-hover:text-red-400
827
- group-hover:bg-red-500/10 transition-all shrink-0`,children:r.jsx(tf,{size:13})}),r.jsx("span",{className:"text-[12px] font-semibold text-white/50 group-hover:text-red-400 transition-colors",children:i?"Signing out…":"Sign Out"})]})]}),r.jsx("div",{className:"px-4 py-2 border-t border-white/6",children:r.jsx("p",{className:"text-[9.5px] text-white/18 text-center",children:"must-b.com · Secure OAuth connection"})})]},"profile-panel")})]})}const s6=4,r6=3e3;function i6(){return r.jsxs(H.div,{className:"fixed inset-0 z-[200] pointer-events-none flex items-center justify-center",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.25},children:[r.jsx("div",{className:"absolute inset-0 bg-black/35"}),Array.from({length:s6}).map((e,t)=>r.jsx(H.span,{className:"absolute rounded-full",style:{border:"1.5px solid rgba(249,115,22,0.70)",boxShadow:"0 0 20px rgba(249,115,22,0.25)"},initial:{width:64,height:64,opacity:.9,scale:1},animate:{width:64+t*0,height:64+t*0,scale:[1,3.5+t*1.2],opacity:[.8,0]},transition:{duration:1.8,delay:t*.22,ease:"easeOut",repeat:1/0,repeatDelay:.1}},t)),r.jsx(H.div,{className:"relative z-10 w-16 h-16 rounded-full flex items-center justify-center",style:{background:"rgba(249,115,22,0.18)",border:"1.5px solid rgba(249,115,22,0.55)",backdropFilter:"blur(16px)",boxShadow:"0 0 32px rgba(249,115,22,0.35), 0 0 64px rgba(249,115,22,0.15)"},animate:{scale:[1,1.06,1]},transition:{duration:1.2,repeat:1/0,ease:"easeInOut"},children:r.jsx(Ds,{size:26,className:"text-orange-400"})}),r.jsx(H.p,{className:"absolute text-[12px] font-semibold text-orange-300/80 tracking-widest uppercase",style:{top:"calc(50% + 52px)"},initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{delay:.15,duration:.3},children:"Dinliyorum…"})]})}function a6(){const[e,t]=h.useState(!1),n=h.useRef(null),s=h.useCallback(()=>{t(!0),n.current&&clearTimeout(n.current),n.current=setTimeout(()=>t(!1),r6)},[]);return h.useEffect(()=>(window.addEventListener("mustb:wake",s),()=>{window.removeEventListener("mustb:wake",s),n.current&&clearTimeout(n.current)}),[s]),r.jsx(se,{children:e&&r.jsx(i6,{},"wake-aura")})}const o6={browser_navigate:"navigate",web_search:"search",http_request:"request"},l6=20,c6=5e3;function u6(e){try{return new URL(e).hostname.replace(/^www\./,"")}catch{return e.slice(0,30)}}function d6(e){try{return new URL(e).pathname.slice(0,40)||"/"}catch{return""}}function h6(e){return e==="search"?r.jsx(Xt,{size:10}):e==="request"?r.jsx(Gr,{size:10}):r.jsx(We,{size:10})}function db(e){return e==="search"?"#a78bfa":e==="request"?"#94a3b8":"#38bdf8"}function f6({domain:e,kind:t}){var i;const n=((i=e[0])==null?void 0:i.toUpperCase())??"?",s=db(t);return r.jsx("span",{className:"w-6 h-6 rounded-lg flex items-center justify-center flex-shrink-0 text-[10px] font-black",style:{background:`${s}18`,border:`1px solid ${s}30`,color:s},children:n})}function p6({entry:e,isLatest:t}){var a;const n=db(e.kind),s=e.domain??"",i=e.query??(e.url?d6(e.url):"");return r.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-2",style:{borderLeft:t?`2px solid ${n}`:"2px solid transparent",background:t?`${n}08`:"transparent"},children:[r.jsx(f6,{domain:s||"?",kind:e.kind}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("p",{className:"text-[11px] font-semibold text-white/80 truncate leading-tight",children:s||((a=e.query)==null?void 0:a.slice(0,30))||"—"}),i&&r.jsx("p",{className:"text-[9px] text-white/35 truncate font-mono mt-0.5",children:i})]}),r.jsx("span",{style:{color:n,opacity:.6},className:"flex-shrink-0",children:h6(e.kind)}),r.jsx("span",{className:"text-[9px] text-white/20 font-mono flex-shrink-0",children:new Date(e.ts).toLocaleTimeString("tr-TR",{hour:"2-digit",minute:"2-digit",second:"2-digit"})})]})}function m6(){const[e,t]=h.useState([]),[n,s]=h.useState(!1),[i,a]=h.useState(!1),[o,l]=h.useState(!1),c=h.useRef(null),u=h.useCallback(()=>{c.current&&clearTimeout(c.current),c.current=setTimeout(()=>{s(!1),t([]),l(!1)},c6)},[]);return h.useEffect(()=>{const d=at(),p=f=>{const{type:m}=f;if(m==="planStart"){c.current&&clearTimeout(c.current),l(!0);return}if(m==="planFinish"){l(!1),t(b=>b.map(y=>({...y,done:!0}))),u();return}if(m==="stepStart"&&f.step){const b=f.step,y=b.tool?o6[b.tool]:void 0;if(!y)return;const v=b.parameters??{},g=String(v.url??v.endpoint??"").trim(),x=String(v.query??"").trim();if(!g&&!x)return;const w={id:`v-${Date.now()}-${Math.random().toString(36).slice(2,5)}`,kind:y,url:g||void 0,query:x||void 0,domain:g?u6(g):void 0,ts:Date.now(),done:!1};t(j=>[w,...j].slice(0,l6)),s(!0),a(!1)}};return d.on("agentUpdate",p),()=>{d.off("agentUpdate",p),c.current&&clearTimeout(c.current)}},[u]),!n||e.length===0?null:r.jsx(H.div,{className:"fixed right-4 z-[120] w-[300px]",style:{top:"88px"},initial:{opacity:0,x:20,scale:.95},animate:{opacity:1,x:0,scale:1},exit:{opacity:0,x:16,scale:.96},transition:{type:"spring",stiffness:360,damping:30},children:r.jsxs("div",{className:"rounded-2xl overflow-hidden",style:{background:"rgba(5,3,1,0.88)",border:"1px solid rgba(56,189,248,0.22)",backdropFilter:"blur(24px)",boxShadow:"0 8px 40px rgba(0,0,0,0.65), 0 0 0 1px rgba(56,189,248,0.06), inset 0 1px 0 rgba(255,255,255,0.03)"},children:[r.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 cursor-pointer select-none",style:{borderBottom:i?"none":"1px solid rgba(255,255,255,0.06)"},onClick:()=>a(d=>!d),children:[r.jsx(kC,{size:11,className:"text-sky-400/70 flex-shrink-0"}),r.jsx("span",{className:"text-[11px] font-bold text-white/60 flex-1 tracking-wide uppercase",children:"Gezi Haritası"}),o&&r.jsxs("span",{className:"flex items-center gap-1.5 flex-shrink-0",children:[r.jsx(H.span,{className:"w-1.5 h-1.5 rounded-full bg-sky-400",animate:{opacity:[1,.3,1]},transition:{duration:1,repeat:1/0}}),r.jsx("span",{className:"text-[10px] text-sky-400/70 font-medium",children:"taranıyor"})]}),r.jsx("span",{className:"text-[10px] text-white/25 flex-shrink-0 font-mono ml-1",children:e.length}),r.jsx("button",{onClick:d=>{d.stopPropagation(),s(!1),t([])},className:"text-white/20 hover:text-white/50 transition-colors flex-shrink-0 ml-1",children:r.jsx(et,{size:10})}),r.jsx("span",{className:"text-white/20 flex-shrink-0",children:i?r.jsx(Ml,{size:10}):r.jsx(Kr,{size:10})})]}),r.jsx(se,{children:!i&&r.jsxs(H.div,{initial:{height:0},animate:{height:"auto"},exit:{height:0},transition:{duration:.18},className:"overflow-hidden",children:[r.jsx("div",{className:"overflow-y-auto divide-y divide-white/4",style:{maxHeight:"260px"},children:r.jsx(se,{mode:"popLayout",children:e.map((d,p)=>r.jsx(H.div,{layout:!0,initial:{opacity:0,x:16},animate:{opacity:1,x:0},exit:{opacity:0,x:-8},transition:{duration:.15},children:r.jsx(p6,{entry:d,isLatest:p===0&&o})},d.id))})}),r.jsx("div",{className:"px-3 py-1.5 flex items-center justify-between",style:{borderTop:"1px solid rgba(255,255,255,0.04)"},children:r.jsxs("span",{className:"text-[9px] text-white/20 font-mono",children:[e.filter(d=>d.kind==="navigate").length," gezinti ·"," ",e.filter(d=>d.kind==="search").length," arama ·"," ",e.filter(d=>d.kind==="request").length," istek"]})})]})})]})})}function g6(e){if(!e.created_at)return"Older";const t=new Date,n=new Date(e.created_at),s=(t.getTime()-n.getTime())/864e5;return s<1&&t.getDate()===n.getDate()?"Today":s<2&&t.getDate()-n.getDate()===1?"Yesterday":s<7?"Last 7 Days":"Older"}const x6=["Today","Yesterday","Last 7 Days","Older"],y6="flex items-center gap-2.5 px-2.5 py-2 rounded-lg transition-all text-[13px] font-medium mb-0.5 w-full text-left",v6="bg-orange-500/15 text-orange-300 border border-orange-500/25",b6="text-white/80 hover:text-white/95 hover:bg-white/6";function w6(e){return Xe(y6,e?v6:b6)}function k6(e){return e?"text-orange-400 shrink-0":"text-white/70 shrink-0"}function j6({onClose:e}){const{t}=pt(),n=hs(),s=mn(),i=n.pathname,[a,o]=h.useState([]),[l,c]=h.useState(null),[u,d]=h.useState(""),[p,f]=h.useState(null),[m,b]=h.useState(null),[y,v]=h.useState(""),[g,x]=h.useState(""),[w,j]=h.useState(!1),k=h.useCallback(async()=>{try{const T=await $("/api/chats");if(!T.ok)return;const V=await T.json();o(V);const R=new Set([...V.map(I=>I.id),"default"]);for(let I=localStorage.length-1;I>=0;I--){const L=localStorage.key(I);L!=null&&L.startsWith("mustb_chat_turns_")&&!R.has(L.slice(17))&&localStorage.removeItem(L)}}catch{}},[]);h.useEffect(()=>{k();const T=setInterval(k,1e4);return()=>clearInterval(T)},[k]),h.useEffect(()=>{const T=V=>{const{id:R,title:I}=V.detail;o(L=>L.map(z=>z.id===R?{...z,title:I}:z))};return window.addEventListener("mustb:chat-renamed",T),()=>window.removeEventListener("mustb:chat-renamed",T)},[]),h.useEffect(()=>{$("/api/setup/status").then(T=>T.ok?T.json():null).then(T=>{T&&(v(T.activeProvider??""),x(T.activeModel??""))}).catch(()=>{}),fetch("/api/auth/user-status").then(T=>T.json()).then(T=>j(!!T.authenticated)).catch(()=>{})},[]);const N=async()=>{try{const T=await $("/api/chats",{method:"POST",body:JSON.stringify({title:"New Chat"})});if(!T.ok){ue.error("Failed to create chat.");return}const V=await T.json();o(R=>[V,...R]),s(`/app?chat=${V.id}`),e()}catch{ue.error("Gateway unreachable.")}},S=async()=>{if(p){try{await $(`/api/chats/${p}`,{method:"DELETE"}),o(T=>T.filter(V=>V.id!==p)),ue.success("Chat deleted."),i.includes(p)&&s("/app")}catch{ue.error("Failed to delete chat.")}f(null)}},E=async T=>{b(null);try{await $(`/api/chats/${T}`,{method:"PATCH",body:JSON.stringify({archived:!0})}),o(V=>V.filter(R=>R.id!==T)),ue.success("Chat archived.")}catch{ue.error("Failed to archive chat.")}},P=async()=>{if(!l||!u.trim()){c(null);return}try{await $(`/api/chats/${l}`,{method:"PATCH",body:JSON.stringify({title:u})}),o(T=>T.map(V=>V.id===l?{...V,title:u}:V)),ue.success("Chat renamed.")}catch{ue.error("Failed to rename chat.")}c(null)},M=[{to:"/app/browser",icon:r.jsx(We,{size:14}),label:t.nav.browser},{to:"/app/automations",icon:r.jsx($C,{size:14}),label:t.nav.workflows},{to:"/app/skills",icon:r.jsx(ze,{size:14}),label:t.nav.skills},{to:"/app/plugins",icon:r.jsx(Ir,{size:14}),label:t.nav.plugins},{to:"/app/store",icon:r.jsx(pv,{size:14}),label:"Store"},{to:"/app/channels",icon:r.jsx(rf,{size:14}),label:t.nav.channels},{to:"/app/files",icon:r.jsx(ps,{size:14}),label:t.nav.files},{to:"/app/memory",icon:r.jsx(va,{size:14}),label:t.nav.memory,exact:!0},{to:"/app/settings",icon:r.jsx(af,{size:14}),label:t.nav.settings,exact:!0},{to:"/app/settings?tab=api-keys",icon:r.jsx(av,{size:14}),label:t.nav.apiKeys}];return r.jsxs("aside",{className:"w-[280px] h-full bg-[#0d0703] border-r border-orange-500/10 flex flex-col overflow-hidden",children:[r.jsx("div",{className:"flex items-center h-[60px] pl-14 pr-4 shrink-0",children:r.jsxs(Ei,{to:"/app",onClick:e,className:"flex items-center gap-2.5 hover:opacity-80 transition-opacity",children:[r.jsxs("div",{className:"relative w-7 h-7 shrink-0",children:[r.jsx("div",{className:"absolute inset-0 bg-orange-500 rounded-full blur-sm opacity-40"}),r.jsx("img",{src:"/logo.png",alt:"Must-b",className:"w-full h-full object-contain relative z-10"})]}),r.jsx("span",{className:"text-[18px] font-black tracking-tight text-white/90 leading-none select-none",children:"Must-b"})]})}),r.jsx("p",{className:"text-[10px] font-bold text-white/30 uppercase tracking-widest px-3 mb-2",children:"Sohbet"}),r.jsx("div",{className:"px-3 pb-3 shrink-0",children:r.jsxs("button",{onClick:N,className:"flex items-center justify-center gap-2 w-full px-3 py-1.5 rounded-lg border border-orange-500/20 bg-orange-500/10 text-orange-400 hover:bg-orange-500/20 hover:border-orange-500/30 transition-all text-[12px] font-medium",children:[r.jsx(zl,{size:14}),t.sidebar.newChat]})}),r.jsxs("div",{className:"flex-1 overflow-y-auto scrollbar-hide px-2 pb-4",onClick:()=>m&&b(null),children:[(()=>{const T={Today:[],Yesterday:[],"Last 7 Days":[],Older:[]};for(const V of a)T[g6(V)].push(V);return x6.map(V=>{const R=T[V];return R.length===0?null:r.jsxs("div",{children:[r.jsx("p",{className:"px-2 mt-3 mb-1 text-[9.5px] font-bold text-white/20 uppercase tracking-widest",children:V}),r.jsx("div",{className:"space-y-0.5",children:R.map(I=>r.jsx("div",{className:"group relative",children:l===I.id?r.jsxs("div",{className:"flex items-center gap-1 px-2 py-1.5 bg-orange-500/10 rounded-lg border border-orange-500/25",children:[r.jsx("input",{value:u,onChange:L=>d(L.target.value),className:"flex-1 bg-transparent text-[13px] text-white/80 outline-none min-w-0",autoFocus:!0,onKeyDown:L=>{L.key==="Enter"&&P(),L.key==="Escape"&&c(null)}}),r.jsx("button",{onClick:P,className:"p-1 text-green-400 hover:bg-green-400/10 rounded transition-colors",children:r.jsx(zt,{size:12})}),r.jsx("button",{onClick:()=>c(null),className:"p-1 text-red-400 hover:bg-red-400/10 rounded transition-colors",children:r.jsx(et,{size:12})})]}):r.jsxs(r.Fragment,{children:[r.jsxs(Ei,{to:`/app?chat=${I.id}`,onClick:e,className:Xe("flex items-center gap-2.5 px-2.5 py-2 rounded-lg transition-all text-[13px] font-medium pr-8",i.includes(I.id)?"bg-orange-500/15 text-orange-300 border border-orange-500/25":"text-white/55 hover:text-white/85 hover:bg-white/6"),children:[r.jsx(Os,{size:13,className:i.includes(I.id)?"text-orange-400 shrink-0":"text-white/30 shrink-0"}),r.jsx("span",{className:"flex-1 truncate",children:I.title})]}),r.jsx("button",{onClick:L=>{L.preventDefault(),L.stopPropagation(),b(m===I.id?null:I.id)},className:"absolute right-1 top-1/2 -translate-y-1/2 p-1 rounded text-white/25 hover:text-white/70 hover:bg-white/8 opacity-0 group-hover:opacity-100 transition-all",children:r.jsx(lC,{size:14})}),m===I.id&&r.jsxs("div",{className:"absolute right-0 top-full mt-1 z-50 min-w-[150px] rounded-xl py-1 overflow-hidden",style:{background:"rgba(16,6,2,0.97)",border:"1px solid rgba(249,115,22,0.15)",backdropFilter:"blur(20px)"},onClick:L=>L.stopPropagation(),children:[r.jsxs("button",{onClick:()=>{b(null),c(I.id),d(I.title)},className:"flex items-center gap-2.5 w-full px-3 py-2 text-[12px] text-white/60 hover:bg-white/5 transition-colors",children:[r.jsx(TC,{size:12,className:"text-white/35 shrink-0"})," Rename"]}),r.jsxs("button",{onClick:()=>E(I.id),className:"flex items-center gap-2.5 w-full px-3 py-2 text-[12px] text-white/60 hover:bg-white/5 transition-colors",children:[r.jsx(Z4,{size:12,className:"text-white/35 shrink-0"})," Archive"]}),r.jsx("hr",{className:"my-1 border-white/8"}),r.jsxs("button",{onClick:L=>{L.preventDefault(),L.stopPropagation(),b(null),f(I.id)},className:"flex items-center gap-2.5 w-full px-3 py-2 text-[12px] text-red-400 hover:bg-red-500/10 transition-colors",children:[r.jsx(Us,{size:12,className:"shrink-0"})," Delete"]})]})]})},I.id))})]},V)})})(),r.jsx("hr",{className:"my-3 border-white/10"}),M.map(({to:T,icon:V,label:R,exact:I})=>{const L=T.split("?")[0],z=I?i===L:i.startsWith(L);return r.jsxs(Ei,{to:T,onClick:e,className:w6(z),children:[r.jsx("span",{className:k6(z),children:V}),R]},T)})]}),r.jsxs("div",{className:"border-t border-orange-500/10 p-3 shrink-0",children:[g&&r.jsxs("div",{className:"mb-2 px-1",children:[r.jsx("p",{className:"text-[9px] text-white/25 font-bold uppercase tracking-[0.2em] mb-0.5",children:"Active Model"}),r.jsx("p",{className:"text-orange-400 text-[11px] font-bold truncate",children:g}),y&&r.jsx("p",{className:"text-white/30 text-[10px] capitalize",children:y})]}),w&&r.jsxs("button",{onClick:async()=>{try{await fetch("/api/auth/signout",{method:"POST"})}catch{}e(),s("/app"),window.location.reload()},className:"w-full flex items-center gap-2 px-2.5 py-2 rounded-lg text-white/30 hover:text-red-400 hover:bg-red-500/10 transition-all text-xs font-medium",children:[r.jsx(tf,{size:13}),t.sidebar.logout]}),r.jsxs("p",{className:"mt-2 text-[10px] text-white/20 px-1",children:[t.sidebar.poweredBy," ",r.jsx("span",{className:"text-orange-500/70 font-semibold",children:"Auto Step"})]})]}),p&&r.jsx("div",{className:"fixed inset-0 z-[100] flex items-center justify-center bg-black/60 p-4",children:r.jsxs("div",{className:"rounded-2xl p-6 w-full max-w-sm shadow-2xl",style:{background:"rgba(16,6,2,0.97)",border:"1px solid rgba(249,115,22,0.18)"},children:[r.jsx("h3",{className:"text-lg font-bold text-white/90 mb-2",children:t.sidebar.deleteChat}),r.jsx("p",{className:"text-white/45 text-sm mb-6",children:t.sidebar.deleteConfirm}),r.jsxs("div",{className:"flex gap-3",children:[r.jsx("button",{onClick:()=>f(null),className:"flex-1 px-4 py-2 rounded-xl bg-white/8 hover:bg-white/12 text-white/70 text-sm font-medium transition-colors",children:t.sidebar.cancel}),r.jsx("button",{onClick:S,className:"flex-1 px-4 py-2 rounded-xl bg-red-600 hover:bg-red-500 text-white text-sm font-medium transition-colors",children:t.sidebar.delete})]})]})})]})}function pe(e){window.dispatchEvent(new CustomEvent("mustb:invoke-skill",{detail:{skill:e}})),setTimeout(()=>{var t;return(t=document.querySelector("textarea"))==null?void 0:t.focus()},80)}function N6({panel:e,title:t,onClose:n}){return h.useEffect(()=>{const s=i=>{i.key==="Escape"&&n()};return document.addEventListener("keydown",s),()=>document.removeEventListener("keydown",s)},[n]),r.jsxs(se,{children:[r.jsx(H.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.18},className:"fixed inset-0 z-40 bg-black/55 backdrop-blur-[3px]",onClick:n},"stage-backdrop"),r.jsxs(H.div,{initial:{opacity:0,scale:.95,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:12},transition:{type:"spring",stiffness:380,damping:32},className:`fixed z-50 top-[72px] left-1/2 -translate-x-1/2
827
+ group-hover:bg-red-500/10 transition-all shrink-0`,children:r.jsx(tf,{size:13})}),r.jsx("span",{className:"text-[12px] font-semibold text-white/50 group-hover:text-red-400 transition-colors",children:i?"Signing out…":"Sign Out"})]})]}),r.jsx("div",{className:"px-4 py-2 border-t border-white/6",children:r.jsx("p",{className:"text-[9.5px] text-white/18 text-center",children:"must-b.com · Secure OAuth connection"})})]},"profile-panel")})]})}const r6=4,i6=3e3;function a6(){return r.jsxs(H.div,{className:"fixed inset-0 z-[200] pointer-events-none flex items-center justify-center",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.25},children:[r.jsx("div",{className:"absolute inset-0 bg-black/35"}),Array.from({length:r6}).map((e,t)=>r.jsx(H.span,{className:"absolute rounded-full",style:{border:"1.5px solid rgba(249,115,22,0.70)",boxShadow:"0 0 20px rgba(249,115,22,0.25)"},initial:{width:64,height:64,opacity:.9,scale:1},animate:{width:64+t*0,height:64+t*0,scale:[1,3.5+t*1.2],opacity:[.8,0]},transition:{duration:1.8,delay:t*.22,ease:"easeOut",repeat:1/0,repeatDelay:.1}},t)),r.jsx(H.div,{className:"relative z-10 w-16 h-16 rounded-full flex items-center justify-center",style:{background:"rgba(249,115,22,0.18)",border:"1.5px solid rgba(249,115,22,0.55)",backdropFilter:"blur(16px)",boxShadow:"0 0 32px rgba(249,115,22,0.35), 0 0 64px rgba(249,115,22,0.15)"},animate:{scale:[1,1.06,1]},transition:{duration:1.2,repeat:1/0,ease:"easeInOut"},children:r.jsx(Ds,{size:26,className:"text-orange-400"})}),r.jsx(H.p,{className:"absolute text-[12px] font-semibold text-orange-300/80 tracking-widest uppercase",style:{top:"calc(50% + 52px)"},initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{delay:.15,duration:.3},children:"Dinliyorum…"})]})}function o6(){const[e,t]=h.useState(!1),n=h.useRef(null),s=h.useCallback(()=>{t(!0),n.current&&clearTimeout(n.current),n.current=setTimeout(()=>t(!1),i6)},[]);return h.useEffect(()=>(window.addEventListener("mustb:wake",s),()=>{window.removeEventListener("mustb:wake",s),n.current&&clearTimeout(n.current)}),[s]),r.jsx(se,{children:e&&r.jsx(a6,{},"wake-aura")})}const l6={browser_navigate:"navigate",web_search:"search",http_request:"request"},c6=20,u6=5e3;function d6(e){try{return new URL(e).hostname.replace(/^www\./,"")}catch{return e.slice(0,30)}}function h6(e){try{return new URL(e).pathname.slice(0,40)||"/"}catch{return""}}function f6(e){return e==="search"?r.jsx(Xt,{size:10}):e==="request"?r.jsx(qr,{size:10}):r.jsx(We,{size:10})}function db(e){return e==="search"?"#a78bfa":e==="request"?"#94a3b8":"#38bdf8"}function p6({domain:e,kind:t}){var i;const n=((i=e[0])==null?void 0:i.toUpperCase())??"?",s=db(t);return r.jsx("span",{className:"w-6 h-6 rounded-lg flex items-center justify-center flex-shrink-0 text-[10px] font-black",style:{background:`${s}18`,border:`1px solid ${s}30`,color:s},children:n})}function m6({entry:e,isLatest:t}){var a;const n=db(e.kind),s=e.domain??"",i=e.query??(e.url?h6(e.url):"");return r.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-2",style:{borderLeft:t?`2px solid ${n}`:"2px solid transparent",background:t?`${n}08`:"transparent"},children:[r.jsx(p6,{domain:s||"?",kind:e.kind}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("p",{className:"text-[11px] font-semibold text-white/80 truncate leading-tight",children:s||((a=e.query)==null?void 0:a.slice(0,30))||"—"}),i&&r.jsx("p",{className:"text-[9px] text-white/35 truncate font-mono mt-0.5",children:i})]}),r.jsx("span",{style:{color:n,opacity:.6},className:"flex-shrink-0",children:f6(e.kind)}),r.jsx("span",{className:"text-[9px] text-white/20 font-mono flex-shrink-0",children:new Date(e.ts).toLocaleTimeString("tr-TR",{hour:"2-digit",minute:"2-digit",second:"2-digit"})})]})}function g6(){const[e,t]=h.useState([]),[n,s]=h.useState(!1),[i,a]=h.useState(!1),[o,l]=h.useState(!1),c=h.useRef(null),u=h.useCallback(()=>{c.current&&clearTimeout(c.current),c.current=setTimeout(()=>{s(!1),t([]),l(!1)},u6)},[]);return h.useEffect(()=>{const d=at(),p=f=>{const{type:m}=f;if(m==="planStart"){c.current&&clearTimeout(c.current),l(!0);return}if(m==="planFinish"){l(!1),t(v=>v.map(y=>({...y,done:!0}))),u();return}if(m==="stepStart"&&f.step){const v=f.step,y=v.tool?l6[v.tool]:void 0;if(!y)return;const b=v.parameters??{},g=String(b.url??b.endpoint??"").trim(),x=String(b.query??"").trim();if(!g&&!x)return;const w={id:`v-${Date.now()}-${Math.random().toString(36).slice(2,5)}`,kind:y,url:g||void 0,query:x||void 0,domain:g?d6(g):void 0,ts:Date.now(),done:!1};t(j=>[w,...j].slice(0,c6)),s(!0),a(!1)}};return d.on("agentUpdate",p),()=>{d.off("agentUpdate",p),c.current&&clearTimeout(c.current)}},[u]),!n||e.length===0?null:r.jsx(H.div,{className:"fixed right-4 z-[120] w-[300px]",style:{top:"88px"},initial:{opacity:0,x:20,scale:.95},animate:{opacity:1,x:0,scale:1},exit:{opacity:0,x:16,scale:.96},transition:{type:"spring",stiffness:360,damping:30},children:r.jsxs("div",{className:"rounded-2xl overflow-hidden",style:{background:"rgba(5,3,1,0.88)",border:"1px solid rgba(56,189,248,0.22)",backdropFilter:"blur(24px)",boxShadow:"0 8px 40px rgba(0,0,0,0.65), 0 0 0 1px rgba(56,189,248,0.06), inset 0 1px 0 rgba(255,255,255,0.03)"},children:[r.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 cursor-pointer select-none",style:{borderBottom:i?"none":"1px solid rgba(255,255,255,0.06)"},onClick:()=>a(d=>!d),children:[r.jsx(kC,{size:11,className:"text-sky-400/70 flex-shrink-0"}),r.jsx("span",{className:"text-[11px] font-bold text-white/60 flex-1 tracking-wide uppercase",children:"Gezi Haritası"}),o&&r.jsxs("span",{className:"flex items-center gap-1.5 flex-shrink-0",children:[r.jsx(H.span,{className:"w-1.5 h-1.5 rounded-full bg-sky-400",animate:{opacity:[1,.3,1]},transition:{duration:1,repeat:1/0}}),r.jsx("span",{className:"text-[10px] text-sky-400/70 font-medium",children:"taranıyor"})]}),r.jsx("span",{className:"text-[10px] text-white/25 flex-shrink-0 font-mono ml-1",children:e.length}),r.jsx("button",{onClick:d=>{d.stopPropagation(),s(!1),t([])},className:"text-white/20 hover:text-white/50 transition-colors flex-shrink-0 ml-1",children:r.jsx(et,{size:10})}),r.jsx("span",{className:"text-white/20 flex-shrink-0",children:i?r.jsx(Al,{size:10}):r.jsx(Gr,{size:10})})]}),r.jsx(se,{children:!i&&r.jsxs(H.div,{initial:{height:0},animate:{height:"auto"},exit:{height:0},transition:{duration:.18},className:"overflow-hidden",children:[r.jsx("div",{className:"overflow-y-auto divide-y divide-white/4",style:{maxHeight:"260px"},children:r.jsx(se,{mode:"popLayout",children:e.map((d,p)=>r.jsx(H.div,{layout:!0,initial:{opacity:0,x:16},animate:{opacity:1,x:0},exit:{opacity:0,x:-8},transition:{duration:.15},children:r.jsx(m6,{entry:d,isLatest:p===0&&o})},d.id))})}),r.jsx("div",{className:"px-3 py-1.5 flex items-center justify-between",style:{borderTop:"1px solid rgba(255,255,255,0.04)"},children:r.jsxs("span",{className:"text-[9px] text-white/20 font-mono",children:[e.filter(d=>d.kind==="navigate").length," gezinti ·"," ",e.filter(d=>d.kind==="search").length," arama ·"," ",e.filter(d=>d.kind==="request").length," istek"]})})]})})]})})}function x6(e){if(!e.created_at)return"Older";const t=new Date,n=new Date(e.created_at),s=(t.getTime()-n.getTime())/864e5;return s<1&&t.getDate()===n.getDate()?"Today":s<2&&t.getDate()-n.getDate()===1?"Yesterday":s<7?"Last 7 Days":"Older"}const y6=["Today","Yesterday","Last 7 Days","Older"],v6="flex items-center gap-2.5 px-2.5 py-2 rounded-lg transition-all text-[13px] font-medium mb-0.5 w-full text-left",b6="bg-orange-500/15 text-orange-300 border border-orange-500/25",w6="text-white/80 hover:text-white/95 hover:bg-white/6";function k6(e){return Xe(v6,e?b6:w6)}function j6(e){return e?"text-orange-400 shrink-0":"text-white/70 shrink-0"}function N6({onClose:e}){const{t}=pt(),n=hs(),s=mn(),i=n.pathname,[a,o]=h.useState([]),[l,c]=h.useState(null),[u,d]=h.useState(""),[p,f]=h.useState(null),[m,v]=h.useState(null),[y,b]=h.useState(""),[g,x]=h.useState(""),[w,j]=h.useState(!1),k=h.useCallback(async()=>{try{const T=await $("/api/chats");if(!T.ok)return;const V=await T.json();o(V);const R=new Set([...V.map(I=>I.id),"default"]);for(let I=localStorage.length-1;I>=0;I--){const L=localStorage.key(I);L!=null&&L.startsWith("mustb_chat_turns_")&&!R.has(L.slice(17))&&localStorage.removeItem(L)}}catch{}},[]);h.useEffect(()=>{k();const T=setInterval(k,1e4);return()=>clearInterval(T)},[k]),h.useEffect(()=>{const T=V=>{const{id:R,title:I}=V.detail;o(L=>L.map(z=>z.id===R?{...z,title:I}:z))};return window.addEventListener("mustb:chat-renamed",T),()=>window.removeEventListener("mustb:chat-renamed",T)},[]),h.useEffect(()=>{$("/api/setup/status").then(T=>T.ok?T.json():null).then(T=>{T&&(b(T.activeProvider??""),x(T.activeModel??""))}).catch(()=>{}),fetch("/api/auth/user-status").then(T=>T.json()).then(T=>j(!!T.authenticated)).catch(()=>{})},[]);const N=async()=>{try{const T=await $("/api/chats",{method:"POST",body:JSON.stringify({title:"New Chat"})});if(!T.ok){le.error("Failed to create chat.");return}const V=await T.json();o(R=>[V,...R]),s(`/app?chat=${V.id}`),e()}catch{le.error("Gateway unreachable.")}},S=async()=>{if(p){try{await $(`/api/chats/${p}`,{method:"DELETE"}),o(T=>T.filter(V=>V.id!==p)),le.success("Chat deleted."),i.includes(p)&&s("/app")}catch{le.error("Failed to delete chat.")}f(null)}},E=async T=>{v(null);try{await $(`/api/chats/${T}`,{method:"PATCH",body:JSON.stringify({archived:!0})}),o(V=>V.filter(R=>R.id!==T)),le.success("Chat archived.")}catch{le.error("Failed to archive chat.")}},P=async()=>{if(!l||!u.trim()){c(null);return}try{await $(`/api/chats/${l}`,{method:"PATCH",body:JSON.stringify({title:u})}),o(T=>T.map(V=>V.id===l?{...V,title:u}:V)),le.success("Chat renamed.")}catch{le.error("Failed to rename chat.")}c(null)},A=[{to:"/app/browser",icon:r.jsx(We,{size:14}),label:t.nav.browser},{to:"/app/automations",icon:r.jsx($C,{size:14}),label:t.nav.workflows},{to:"/app/skills",icon:r.jsx(ze,{size:14}),label:t.nav.skills},{to:"/app/plugins",icon:r.jsx(Br,{size:14}),label:t.nav.plugins},{to:"/app/store",icon:r.jsx(pv,{size:14}),label:"Store"},{to:"/app/channels",icon:r.jsx(rf,{size:14}),label:t.nav.channels},{to:"/app/files",icon:r.jsx(ps,{size:14}),label:t.nav.files},{to:"/app/memory",icon:r.jsx(va,{size:14}),label:t.nav.memory,exact:!0},{to:"/app/settings",icon:r.jsx(af,{size:14}),label:t.nav.settings,exact:!0},{to:"/app/settings?tab=api-keys",icon:r.jsx(av,{size:14}),label:t.nav.apiKeys}];return r.jsxs("aside",{className:"w-[280px] h-full bg-[#0d0703] border-r border-orange-500/10 flex flex-col overflow-hidden",children:[r.jsx("div",{className:"flex items-center h-[60px] pl-14 pr-4 shrink-0",children:r.jsxs(Ei,{to:"/app",onClick:e,className:"flex items-center gap-2.5 hover:opacity-80 transition-opacity",children:[r.jsxs("div",{className:"relative w-7 h-7 shrink-0",children:[r.jsx("div",{className:"absolute inset-0 bg-orange-500 rounded-full blur-sm opacity-40"}),r.jsx("img",{src:"/logo.png",alt:"Must-b",className:"w-full h-full object-contain relative z-10"})]}),r.jsx("span",{className:"text-[18px] font-black tracking-tight text-white/90 leading-none select-none",children:"Must-b"})]})}),r.jsx("p",{className:"text-[10px] font-bold text-white/30 uppercase tracking-widest px-3 mb-2",children:"Sohbet"}),r.jsx("div",{className:"px-3 pb-3 shrink-0",children:r.jsxs("button",{onClick:N,className:"flex items-center justify-center gap-2 w-full px-3 py-1.5 rounded-lg border border-orange-500/20 bg-orange-500/10 text-orange-400 hover:bg-orange-500/20 hover:border-orange-500/30 transition-all text-[12px] font-medium",children:[r.jsx(zl,{size:14}),t.sidebar.newChat]})}),r.jsxs("div",{className:"flex-1 overflow-y-auto scrollbar-hide px-2 pb-4",onClick:()=>m&&v(null),children:[(()=>{const T={Today:[],Yesterday:[],"Last 7 Days":[],Older:[]};for(const V of a)T[x6(V)].push(V);return y6.map(V=>{const R=T[V];return R.length===0?null:r.jsxs("div",{children:[r.jsx("p",{className:"px-2 mt-3 mb-1 text-[9.5px] font-bold text-white/20 uppercase tracking-widest",children:V}),r.jsx("div",{className:"space-y-0.5",children:R.map(I=>r.jsx("div",{className:"group relative",children:l===I.id?r.jsxs("div",{className:"flex items-center gap-1 px-2 py-1.5 bg-orange-500/10 rounded-lg border border-orange-500/25",children:[r.jsx("input",{value:u,onChange:L=>d(L.target.value),className:"flex-1 bg-transparent text-[13px] text-white/80 outline-none min-w-0",autoFocus:!0,onKeyDown:L=>{L.key==="Enter"&&P(),L.key==="Escape"&&c(null)}}),r.jsx("button",{onClick:P,className:"p-1 text-green-400 hover:bg-green-400/10 rounded transition-colors",children:r.jsx(zt,{size:12})}),r.jsx("button",{onClick:()=>c(null),className:"p-1 text-red-400 hover:bg-red-400/10 rounded transition-colors",children:r.jsx(et,{size:12})})]}):r.jsxs(r.Fragment,{children:[r.jsxs(Ei,{to:`/app?chat=${I.id}`,onClick:e,className:Xe("flex items-center gap-2.5 px-2.5 py-2 rounded-lg transition-all text-[13px] font-medium pr-8",i.includes(I.id)?"bg-orange-500/15 text-orange-300 border border-orange-500/25":"text-white/55 hover:text-white/85 hover:bg-white/6"),children:[r.jsx(Os,{size:13,className:i.includes(I.id)?"text-orange-400 shrink-0":"text-white/30 shrink-0"}),r.jsx("span",{className:"flex-1 truncate",children:I.title})]}),r.jsx("button",{onClick:L=>{L.preventDefault(),L.stopPropagation(),v(m===I.id?null:I.id)},className:"absolute right-1 top-1/2 -translate-y-1/2 p-1 rounded text-white/25 hover:text-white/70 hover:bg-white/8 opacity-0 group-hover:opacity-100 transition-all",children:r.jsx(lC,{size:14})}),m===I.id&&r.jsxs("div",{className:"absolute right-0 top-full mt-1 z-50 min-w-[150px] rounded-xl py-1 overflow-hidden",style:{background:"rgba(16,6,2,0.97)",border:"1px solid rgba(249,115,22,0.15)",backdropFilter:"blur(20px)"},onClick:L=>L.stopPropagation(),children:[r.jsxs("button",{onClick:()=>{v(null),c(I.id),d(I.title)},className:"flex items-center gap-2.5 w-full px-3 py-2 text-[12px] text-white/60 hover:bg-white/5 transition-colors",children:[r.jsx(TC,{size:12,className:"text-white/35 shrink-0"})," Rename"]}),r.jsxs("button",{onClick:()=>E(I.id),className:"flex items-center gap-2.5 w-full px-3 py-2 text-[12px] text-white/60 hover:bg-white/5 transition-colors",children:[r.jsx(Z4,{size:12,className:"text-white/35 shrink-0"})," Archive"]}),r.jsx("hr",{className:"my-1 border-white/8"}),r.jsxs("button",{onClick:L=>{L.preventDefault(),L.stopPropagation(),v(null),f(I.id)},className:"flex items-center gap-2.5 w-full px-3 py-2 text-[12px] text-red-400 hover:bg-red-500/10 transition-colors",children:[r.jsx(Hs,{size:12,className:"shrink-0"})," Delete"]})]})]})},I.id))})]},V)})})(),r.jsx("hr",{className:"my-3 border-white/10"}),A.map(({to:T,icon:V,label:R,exact:I})=>{const L=T.split("?")[0],z=I?i===L:i.startsWith(L);return r.jsxs(Ei,{to:T,onClick:e,className:k6(z),children:[r.jsx("span",{className:j6(z),children:V}),R]},T)})]}),r.jsxs("div",{className:"border-t border-orange-500/10 p-3 shrink-0",children:[g&&r.jsxs("div",{className:"mb-2 px-1",children:[r.jsx("p",{className:"text-[9px] text-white/25 font-bold uppercase tracking-[0.2em] mb-0.5",children:"Active Model"}),r.jsx("p",{className:"text-orange-400 text-[11px] font-bold truncate",children:g}),y&&r.jsx("p",{className:"text-white/30 text-[10px] capitalize",children:y})]}),w&&r.jsxs("button",{onClick:async()=>{try{await fetch("/api/auth/signout",{method:"POST"})}catch{}e(),s("/app"),window.location.reload()},className:"w-full flex items-center gap-2 px-2.5 py-2 rounded-lg text-white/30 hover:text-red-400 hover:bg-red-500/10 transition-all text-xs font-medium",children:[r.jsx(tf,{size:13}),t.sidebar.logout]}),r.jsxs("p",{className:"mt-2 text-[10px] text-white/20 px-1",children:[t.sidebar.poweredBy," ",r.jsx("span",{className:"text-orange-500/70 font-semibold",children:"Auto Step"})]})]}),p&&r.jsx("div",{className:"fixed inset-0 z-[100] flex items-center justify-center bg-black/60 p-4",children:r.jsxs("div",{className:"rounded-2xl p-6 w-full max-w-sm shadow-2xl",style:{background:"rgba(16,6,2,0.97)",border:"1px solid rgba(249,115,22,0.18)"},children:[r.jsx("h3",{className:"text-lg font-bold text-white/90 mb-2",children:t.sidebar.deleteChat}),r.jsx("p",{className:"text-white/45 text-sm mb-6",children:t.sidebar.deleteConfirm}),r.jsxs("div",{className:"flex gap-3",children:[r.jsx("button",{onClick:()=>f(null),className:"flex-1 px-4 py-2 rounded-xl bg-white/8 hover:bg-white/12 text-white/70 text-sm font-medium transition-colors",children:t.sidebar.cancel}),r.jsx("button",{onClick:S,className:"flex-1 px-4 py-2 rounded-xl bg-red-600 hover:bg-red-500 text-white text-sm font-medium transition-colors",children:t.sidebar.delete})]})]})})]})}function pe(e){window.dispatchEvent(new CustomEvent("mustb:invoke-skill",{detail:{skill:e}})),setTimeout(()=>{var t;return(t=document.querySelector("textarea"))==null?void 0:t.focus()},80)}function S6({panel:e,title:t,onClose:n}){return h.useEffect(()=>{const s=i=>{i.key==="Escape"&&n()};return document.addEventListener("keydown",s),()=>document.removeEventListener("keydown",s)},[n]),r.jsxs(se,{children:[r.jsx(H.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.18},className:"fixed inset-0 z-40 bg-black/55 backdrop-blur-[3px]",onClick:n},"stage-backdrop"),r.jsxs(H.div,{initial:{opacity:0,scale:.95,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:12},transition:{type:"spring",stiffness:380,damping:32},className:`fixed z-50 top-[72px] left-1/2 -translate-x-1/2
828
828
  w-full max-w-2xl max-h-[calc(100vh-92px)]
829
829
  glass-panel rounded-3xl overflow-hidden flex flex-col
830
- shadow-[0_24px_80px_rgba(0,0,0,0.7),0_0_0_1px_rgba(249,115,22,0.18)]`,onClick:s=>s.stopPropagation(),children:[r.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-b border-orange-500/12 shrink-0",children:[r.jsx("span",{className:"text-[13px] font-bold text-white/80",children:t}),r.jsx("button",{onClick:n,className:"w-7 h-7 flex items-center justify-center rounded-full hover:bg-white/8 text-white/40 hover:text-white/70 transition-colors",children:r.jsx(et,{size:14})})]}),r.jsxs("div",{className:"flex-1 overflow-hidden min-h-0",children:[e==="memory"&&r.jsx(RP,{}),e==="plugins"&&r.jsx(OP,{}),e==="skills"&&r.jsx(FP,{}),e==="workspace"&&r.jsx(WP,{}),e==="livesight"&&r.jsx(KP,{})]})]},"stage-card")]})}function S6(){const{t:e}=pt(),t=hs(),n=mn(),[s,i]=h.useState(!1),[a,o]=h.useState(""),[l,c]=h.useState(null),[u,d]=h.useState(!1);h.useEffect(()=>{const b=y=>{d(y.detail.active)};return window.addEventListener("mustb:safeMode",b),()=>window.removeEventListener("mustb:safeMode",b)},[]),h.useEffect(()=>{i(!1)},[t.pathname]),t.pathname,h.useCallback(b=>o(y=>y===b?"":b),[]),h.useCallback(b=>{c(b),o("")},[]);const p=h.useCallback(()=>c(null),[]),f=e.dock;f.cat_webTools,f.skill_webSearch,f.desc_webSearch,f.skill_webFetch,f.desc_webFetch,f.skill_browserControl,f.desc_browserControl,f.cat_fileMedia,f.skill_pdfReader,f.desc_pdfReader,f.skill_imageAnalysis,f.desc_imageAnalysis,f.skill_imageGeneration,f.desc_imageGeneration,f.skill_tts,f.desc_tts,f.cat_aiAgents,f.skills,f.skill_spawnAgent,f.desc_spawnAgent,f.skill_agentSessions,f.desc_agentSessions,f.skill_canvas,f.desc_canvas,f.skill_git,f.desc_git,f.cat_systemTools,f.skill_gateway,f.desc_gateway,f.skill_fileManager,f.desc_fileManager,f.skill_cron,f.desc_cron,f.skill_messages,f.desc_messages,f.cat_knowledgeBase,f.mem_browse,f.desc_memBrowse,f.mem_search,f.desc_memSearch,f.mem_add,f.desc_memAdd,f.cat_personalOrg,f.mem_contacts,f.desc_contacts,f.mem_calendar,f.desc_calendar,f.cat_pluginManager,f.plug_marketplace,f.desc_marketplace,f.plug_installed,f.desc_installed,f.plug_mcp,f.desc_mcp,f.cat_developer,f.plug_bundleMcp,f.desc_bundleMcp,f.plug_cliCmds,f.desc_cliCmds,f.cat_automation,f.wf_automations,f.desc_automations,f.wf_scheduled,f.desc_scheduled,f.wf_commands,f.desc_commands,f.cat_advanced,f.wf_nodes,f.desc_nodes,f.wf_multiAgent,f.desc_multiAgent;const m={memory:f.memory,plugins:f.plugins,skills:f.skills,workspace:f.files,livesight:"Visual Audit"};return r.jsx(R5,{reducedMotion:u?"always":"never",children:r.jsxs("div",{className:"relative min-h-screen overflow-x-hidden font-sans bg-transparent",children:[l&&r.jsx(N6,{panel:l,title:m[l],onClose:p}),r.jsx("div",{className:"fixed top-[14px] left-4 z-40 overflow-hidden",children:r.jsx("button",{onClick:()=>i(b=>!b),"aria-label":"Toggle sidebar",className:"p-2 rounded-full text-white/45 hover:text-white/90 hover:bg-white/8 transition-all leading-none",style:{backdropFilter:"blur(8px)",fontSize:0},children:r.jsx(NC,{size:17,"aria-hidden":"true",focusable:"false"})})}),r.jsxs("header",{className:"fixed top-0 inset-x-0 z-50 h-16 flex items-center justify-between px-6 pointer-events-none",children:[r.jsx("div",{}),r.jsxs("div",{className:"flex items-center gap-2.5 shrink-0 pointer-events-auto",children:[r.jsxs(Ei,{to:"/app/voice",className:`flex items-center gap-1.5 px-3 py-1.5 rounded-full text-[12px] font-medium transition-all select-none ${t.pathname==="/app/voice"?"bg-orange-500/20 text-orange-300 border border-orange-500/30":"text-white/45 hover:text-white/85 hover:bg-white/8"}`,title:e.nav.voice,children:[r.jsx(sC,{size:14}),r.jsx("span",{className:"hidden sm:inline",children:e.nav.voice})]}),r.jsx(H.div,{initial:{opacity:0,x:12},animate:{opacity:1,x:0},transition:{duration:.4,delay:.15},className:"flex items-center gap-1 px-2 py-1.5 rounded-full",style:{background:"rgba(255,255,255,0.05)",border:"1px solid rgba(255,255,255,0.09)"},children:r.jsx(MP,{})}),r.jsx(n6,{})]})]}),r.jsx(se,{children:s&&r.jsx(H.div,{initial:{x:-280},animate:{x:0},exit:{x:-280},transition:{type:"spring",stiffness:340,damping:34},className:"fixed top-0 left-0 bottom-0 z-30 w-[280px]",children:r.jsx(j6,{onClose:()=>i(!1)})},"sidebar-panel")}),r.jsx("main",{className:"relative min-h-screen pt-16 transition-[margin] duration-300 bg-transparent",style:{marginLeft:s?280:0},children:r.jsx(Lk,{})}),r.jsx(qP,{}),r.jsx(e6,{}),r.jsx(a6,{}),r.jsx(m6,{})]})})}const C6=[{decision:"duplicate",label:"Create New Agent",sublabel:"Keep both — cloud data is copied to a separate folder",icon:hC,accent:"border-blue-500/30 bg-blue-500/8 hover:border-blue-500/50 text-blue-400"},{decision:"restore",label:"Use Cloud (Overwrite)",sublabel:"Cloud wins — local memory is replaced with cloud version",icon:aC,accent:"border-orange-500/30 bg-orange-500/8 hover:border-orange-500/50 text-orange-400"},{decision:"upload",label:"Keep Mine",sublabel:"Local wins — cloud memory is overwritten with local data",icon:LC,accent:"border-green-500/30 bg-green-500/8 hover:border-green-500/50 text-green-400"}];function E6(){const[e,t]=h.useState(null),[n,s]=h.useState(!1),[i,a]=h.useState(!1);h.useEffect(()=>{const c=at(),u=d=>{d.type==="CONFLICT_DETECTED"&&(t({localAgentName:d.localAgentName??null,cloudAgentName:d.cloudAgentName??null,localMtime:d.localMtime??null,cloudTimestamp:d.cloudTimestamp??null}),a(!1)),d.type==="syncResolveFinish"&&(a(!0),setTimeout(()=>{t(null),a(!1)},1800))};return c.on("agentUpdate",u),()=>{c.off("agentUpdate",u)}},[]);const o=async c=>{if(!n){s(!0);try{await fetch("/api/setup/sync-resolve",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({decision:c})})}catch{}s(!1)}},l=c=>{if(!c)return"—";try{return new Date(c).toLocaleString("en-US",{dateStyle:"medium",timeStyle:"short"})}catch{return c}};return r.jsx(se,{children:e&&r.jsx(H.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-[200] flex items-center justify-center bg-black/70 backdrop-blur-sm px-4",children:r.jsxs(H.div,{initial:{opacity:0,y:24,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:24,scale:.95},transition:{duration:.25},className:"w-full max-w-md bg-[#0c0f18] border border-white/10 rounded-2xl shadow-2xl overflow-hidden",children:[r.jsxs("div",{className:"flex items-center gap-3 px-6 py-5 border-b border-white/8 bg-amber-500/5",children:[r.jsx("div",{className:"w-9 h-9 rounded-full bg-amber-500/15 flex items-center justify-center flex-shrink-0",children:r.jsx(os,{size:18,className:"text-amber-400"})}),r.jsxs("div",{children:[r.jsx("h2",{className:"text-white font-bold text-base",children:"Memory Conflict Detected"}),r.jsx("p",{className:"text-gray-500 text-xs mt-0.5",children:"Two agent identities found — action required"})]})]}),r.jsxs("div",{className:"grid grid-cols-2 gap-3 px-6 pt-5 pb-2",children:[r.jsxs("div",{className:"rounded-xl border border-white/8 bg-white/3 px-4 py-3",children:[r.jsx("p",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-widest mb-1",children:"Local Agent"}),r.jsx("p",{className:"text-white font-bold text-sm",children:e.localAgentName??"—"}),r.jsx("p",{className:"text-gray-600 text-[10px] mt-1",children:l(e.localMtime)})]}),r.jsxs("div",{className:"rounded-xl border border-orange-500/20 bg-orange-500/5 px-4 py-3",children:[r.jsx("p",{className:"text-[10px] font-bold text-orange-400/60 uppercase tracking-widest mb-1",children:"Cloud Agent"}),r.jsx("p",{className:"text-orange-300 font-bold text-sm",children:e.cloudAgentName??"—"}),r.jsx("p",{className:"text-orange-400/40 text-[10px] mt-1",children:l(e.cloudTimestamp)})]})]}),r.jsx("div",{className:"px-6 py-4 space-y-2",children:i?r.jsxs("div",{className:"flex items-center justify-center gap-2 py-6 text-green-400 text-sm font-semibold",children:[r.jsx("span",{className:"w-4 h-4 rounded-full border-2 border-green-400 flex items-center justify-center text-[10px]",children:"✓"}),"Conflict resolved"]}):C6.map(c=>{const u=c.icon;return r.jsxs("button",{onClick:()=>o(c.decision),disabled:n,className:`w-full flex items-center gap-3 px-4 py-3 rounded-xl border transition-all text-left disabled:opacity-50 disabled:cursor-not-allowed ${c.accent}`,children:[n?r.jsx(ne,{size:16,className:"animate-spin flex-shrink-0"}):r.jsx(u,{size:16,className:"flex-shrink-0"}),r.jsxs("div",{children:[r.jsx("p",{className:"font-semibold text-sm text-white",children:c.label}),r.jsx("p",{className:"text-[11px] text-gray-500 mt-0.5",children:c.sublabel})]})]},c.decision)})}),r.jsx("div",{className:"px-6 pb-5 pt-1",children:r.jsx("p",{className:"text-[10px] text-gray-700 text-center",children:'This action cannot be undone · If unsure, choose "Create New Agent" first'})})]})})})}const _6="1.72.20";function T6(){const[e,t]=h.useState("idle"),[n,s]=h.useState(null),[i,a]=h.useState(""),[o,l]=h.useState(""),c=h.useRef(!1),u=h.useCallback(async()=>{var m,b;t("checking"),a("");try{const y=await $("/api/system/version");if(!y.ok)throw new Error(`Server returned ${y.status}`);const g=await y.json(),x=(g==null?void 0:g.current)??((m=g==null?void 0:g.data)==null?void 0:m.current),w=(g==null?void 0:g.latest)??((b=g==null?void 0:g.data)==null?void 0:b.latest);if(!x||!w)throw new Error("Version endpoint returned incomplete data");s({current:x,latest:w}),P6(w,x)>0?t("update-available"):(t("up-to-date"),setTimeout(()=>t("idle"),3e3))}catch(y){a((y==null?void 0:y.message)??"Check failed"),t("error"),setTimeout(()=>{t("idle"),a("")},4e3)}},[]);h.useEffect(()=>{if(e!=="restarting")return;const m=setTimeout(()=>window.close(),1e4),b=setInterval(async()=>{try{(await fetch("/api/system/health",{credentials:"include"})).ok&&(clearInterval(b),clearTimeout(m),c.current=!0,t("done"),window.close())}catch{}},3e3);return()=>{clearInterval(b),clearTimeout(m)}},[e]),h.useEffect(()=>{const b=setInterval(()=>{t(y=>((y==="idle"||y==="up-to-date")&&u(),y))},288e5);return()=>clearInterval(b)},[u]);const d=h.useCallback(async()=>{t("downloading"),l("");try{const m=await fetch("/api/system/update",{method:"POST",credentials:"include"});if(!m.body)throw new Error("No response body");const b=m.body.getReader(),y=new TextDecoder;let v="";for(;;){const{done:g,value:x}=await b.read();if(g)break;const w=y.decode(x);v+=w,l(j=>j+w)}v.includes("__MUSTB_SHUTTING_DOWN__")?t("restarting"):v.includes("❌")?(a("Install failed — see log above"),t("error"),setTimeout(()=>{t("idle"),a("")},5e3)):t("done")}catch(m){a((m==null?void 0:m.message)??"Update failed"),t("error")}},[]),p=h.useCallback(async()=>{t("restarting");try{await $("/api/system/restart",{method:"POST"})}catch{}const m=at();let b=0;const y=setInterval(()=>{b++,m.connected&&(clearInterval(y),window.location.reload()),b>60&&clearInterval(y)},500)},[]),f=(n==null?void 0:n.current)??_6;return r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"fixed bottom-4 right-4 z-50 flex flex-col items-end gap-2",children:[!["update-available","downloading","done","restarting"].includes(e)&&r.jsxs("button",{onClick:e==="idle"||e==="up-to-date"||e==="error"?u:void 0,disabled:["checking","downloading","restarting"].includes(e),title:"Check for updates",className:Xe("flex items-center gap-2","py-2 px-4 rounded-full shadow-2xl","text-xs font-medium","transition-all duration-200",e==="update-available"?"bg-red-900/90 backdrop-blur-md border border-red-500/50 text-white hover:bg-red-800 hover:border-red-400/60":e==="error"?"bg-amber-900/90 backdrop-blur-md border border-amber-500/60 text-white hover:bg-amber-800 hover:border-amber-400/70":"bg-gray-900/90 backdrop-blur-md border border-gray-700/50 text-gray-300 hover:bg-gray-800 hover:border-gray-600/60 hover:text-white",["checking","downloading","restarting"].includes(e)&&"cursor-wait opacity-80"),children:[e==="checking"&&r.jsx(ne,{size:13,className:"animate-spin text-orange-400 shrink-0"}),e==="update-available"&&r.jsx(Ai,{size:13,className:"text-red-300 shrink-0"}),e==="up-to-date"&&r.jsx(br,{size:13,className:"text-emerald-400 shrink-0"}),e==="downloading"&&r.jsx(ne,{size:13,className:"animate-spin text-orange-400 shrink-0"}),e==="done"&&r.jsx(br,{size:13,className:"text-emerald-400 shrink-0"}),e==="restarting"&&r.jsx(ne,{size:13,className:"animate-spin text-orange-400 shrink-0"}),e==="error"&&r.jsx(wt,{size:13,className:"text-amber-300 shrink-0"}),e==="idle"&&r.jsx(de,{size:13,className:"text-gray-500 shrink-0"}),r.jsxs("span",{className:"tabular-nums",children:[r.jsx("span",{children:"Must-b v"}),r.jsx("span",{children:f})]}),e==="checking"&&r.jsx("span",{className:"text-orange-400/80",children:"Checking…"}),e==="up-to-date"&&r.jsx("span",{className:"text-emerald-400/80",children:"Up to date"}),e==="downloading"&&r.jsx("span",{className:"text-orange-400/80",children:"Installing…"}),e==="done"&&r.jsx("span",{className:"text-emerald-400/80",children:"Installed!"}),e==="restarting"&&r.jsx("span",{className:"text-orange-400/80",children:"Restarting…"}),e==="error"&&r.jsxs("span",{className:"text-amber-300/90 max-w-[140px] truncate",children:["Check failed",i?` — ${i}`:""]})]}),e==="update-available"&&n&&r.jsxs("div",{className:"flex flex-col gap-3 p-4 rounded-2xl bg-gray-900/95 border border-orange-500/30 backdrop-blur-md shadow-2xl w-60",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Ai,{size:16,className:"text-orange-400 shrink-0"}),r.jsx("span",{className:"text-orange-300 font-semibold text-sm",children:"Update Available"})]}),r.jsxs("div",{className:"text-gray-400 text-xs leading-relaxed",children:[r.jsx("span",{children:"Version "}),r.jsx("span",{className:"font-mono text-white",children:n.latest}),r.jsx("span",{children:" is ready to install."})]}),r.jsxs("div",{className:"flex items-center justify-between text-[11px] text-gray-500",children:[r.jsxs("span",{children:["Current: ",r.jsx("span",{className:"font-mono",children:n.current})]}),r.jsxs("span",{children:["Latest: ",r.jsx("span",{className:"font-mono text-orange-300",children:n.latest})]})]}),r.jsxs("button",{onClick:d,className:"flex items-center justify-center gap-2 bg-orange-600 hover:bg-orange-500 active:scale-95 text-white rounded-xl py-2 text-xs font-semibold transition-all duration-150 shadow-lg shadow-orange-900/30",children:[r.jsx(Ai,{size:13}),r.jsx("span",{children:"Download & Install"})]}),r.jsx("button",{onClick:()=>t("idle"),className:"text-center text-[11px] text-gray-600 hover:text-gray-400 transition-colors",children:r.jsx("span",{children:"Dismiss"})})]}),e==="downloading"&&r.jsxs("div",{className:"p-4 rounded-2xl bg-gray-900/95 border border-white/10 backdrop-blur-md shadow-2xl w-60",children:[r.jsxs("div",{className:"flex items-center gap-2 text-xs text-orange-300 mb-3",children:[r.jsx(ne,{size:13,className:"animate-spin shrink-0"}),r.jsx("span",{children:"Installing update…"})]}),r.jsx("pre",{className:"text-[10px] text-gray-400 max-h-24 overflow-y-auto whitespace-pre-wrap break-all font-mono bg-black/30 rounded-lg p-2",children:r.jsx("span",{children:o||"Connecting to npm registry…"})})]}),e==="done"&&!c.current&&r.jsxs("div",{className:"flex flex-col gap-3 p-4 rounded-2xl bg-gray-900/95 border border-emerald-500/30 backdrop-blur-md shadow-2xl w-60",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(br,{size:16,className:"text-emerald-400 shrink-0"}),r.jsx("span",{className:"text-emerald-300 font-semibold text-sm",children:"Update Installed!"})]}),r.jsx("p",{className:"text-gray-400 text-xs",children:r.jsx("span",{children:"Restart Must-b to apply the new version."})}),r.jsxs("button",{onClick:p,className:"flex items-center justify-center gap-2 bg-emerald-700 hover:bg-emerald-600 active:scale-95 text-white rounded-xl py-2 text-xs font-semibold transition-all duration-150",children:[r.jsx(de,{size:13}),r.jsx("span",{children:"Restart Now"})]})]})]}),e==="done"&&c.current&&r.jsx("div",{className:"fixed inset-0 z-[9999] flex flex-col items-center justify-center bg-black",children:r.jsxs("div",{className:"font-mono text-center px-8 max-w-xl w-full",children:[r.jsxs("div",{className:"flex items-center justify-center gap-2 mb-8",children:[r.jsx(br,{size:18,className:"text-green-400 shrink-0"}),r.jsx("span",{className:"text-green-400 text-xs tracking-widest uppercase",children:"must-b terminal"})]}),r.jsx("pre",{className:"text-green-400 text-sm leading-relaxed text-left inline-block",children:`╔══════════════════════════════════════════════════════╗
830
+ shadow-[0_24px_80px_rgba(0,0,0,0.7),0_0_0_1px_rgba(249,115,22,0.18)]`,onClick:s=>s.stopPropagation(),children:[r.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-b border-orange-500/12 shrink-0",children:[r.jsx("span",{className:"text-[13px] font-bold text-white/80",children:t}),r.jsx("button",{onClick:n,className:"w-7 h-7 flex items-center justify-center rounded-full hover:bg-white/8 text-white/40 hover:text-white/70 transition-colors",children:r.jsx(et,{size:14})})]}),r.jsxs("div",{className:"flex-1 overflow-hidden min-h-0",children:[e==="memory"&&r.jsx(zP,{}),e==="plugins"&&r.jsx(DP,{}),e==="skills"&&r.jsx(VP,{}),e==="workspace"&&r.jsx(KP,{}),e==="livesight"&&r.jsx(GP,{})]})]},"stage-card")]})}function C6(){const{t:e}=pt(),t=hs(),n=mn(),[s,i]=h.useState(!1),[a,o]=h.useState(""),[l,c]=h.useState(null),[u,d]=h.useState(!1);h.useEffect(()=>{const v=y=>{d(y.detail.active)};return window.addEventListener("mustb:safeMode",v),()=>window.removeEventListener("mustb:safeMode",v)},[]),h.useEffect(()=>{i(!1)},[t.pathname]),t.pathname,h.useCallback(v=>o(y=>y===v?"":v),[]),h.useCallback(v=>{c(v),o("")},[]);const p=h.useCallback(()=>c(null),[]),f=e.dock;f.cat_webTools,f.skill_webSearch,f.desc_webSearch,f.skill_webFetch,f.desc_webFetch,f.skill_browserControl,f.desc_browserControl,f.cat_fileMedia,f.skill_pdfReader,f.desc_pdfReader,f.skill_imageAnalysis,f.desc_imageAnalysis,f.skill_imageGeneration,f.desc_imageGeneration,f.skill_tts,f.desc_tts,f.cat_aiAgents,f.skills,f.skill_spawnAgent,f.desc_spawnAgent,f.skill_agentSessions,f.desc_agentSessions,f.skill_canvas,f.desc_canvas,f.skill_git,f.desc_git,f.cat_systemTools,f.skill_gateway,f.desc_gateway,f.skill_fileManager,f.desc_fileManager,f.skill_cron,f.desc_cron,f.skill_messages,f.desc_messages,f.cat_knowledgeBase,f.mem_browse,f.desc_memBrowse,f.mem_search,f.desc_memSearch,f.mem_add,f.desc_memAdd,f.cat_personalOrg,f.mem_contacts,f.desc_contacts,f.mem_calendar,f.desc_calendar,f.cat_pluginManager,f.plug_marketplace,f.desc_marketplace,f.plug_installed,f.desc_installed,f.plug_mcp,f.desc_mcp,f.cat_developer,f.plug_bundleMcp,f.desc_bundleMcp,f.plug_cliCmds,f.desc_cliCmds,f.cat_automation,f.wf_automations,f.desc_automations,f.wf_scheduled,f.desc_scheduled,f.wf_commands,f.desc_commands,f.cat_advanced,f.wf_nodes,f.desc_nodes,f.wf_multiAgent,f.desc_multiAgent;const m={memory:f.memory,plugins:f.plugins,skills:f.skills,workspace:f.files,livesight:"Visual Audit"};return r.jsx(R5,{reducedMotion:u?"always":"never",children:r.jsxs("div",{className:"relative min-h-screen overflow-x-hidden font-sans bg-transparent",children:[l&&r.jsx(S6,{panel:l,title:m[l],onClose:p}),r.jsx("div",{className:"fixed top-[14px] left-4 z-40 overflow-hidden",children:r.jsx("button",{onClick:()=>i(v=>!v),"aria-label":"Toggle sidebar",className:"p-2 rounded-full text-white/45 hover:text-white/90 hover:bg-white/8 transition-all leading-none",style:{backdropFilter:"blur(8px)",fontSize:0},children:r.jsx(NC,{size:17,"aria-hidden":"true",focusable:"false"})})}),r.jsxs("header",{className:"fixed top-0 inset-x-0 z-50 h-16 flex items-center justify-between px-6 pointer-events-none",children:[r.jsx("div",{}),r.jsxs("div",{className:"flex items-center gap-2.5 shrink-0 pointer-events-auto",children:[r.jsxs(Ei,{to:"/app/voice",className:`flex items-center gap-1.5 px-3 py-1.5 rounded-full text-[12px] font-medium transition-all select-none ${t.pathname==="/app/voice"?"bg-orange-500/20 text-orange-300 border border-orange-500/30":"text-white/45 hover:text-white/85 hover:bg-white/8"}`,title:e.nav.voice,children:[r.jsx(sC,{size:14}),r.jsx("span",{className:"hidden sm:inline",children:e.nav.voice})]}),r.jsx(H.div,{initial:{opacity:0,x:12},animate:{opacity:1,x:0},transition:{duration:.4,delay:.15},className:"flex items-center gap-1 px-2 py-1.5 rounded-full",style:{background:"rgba(255,255,255,0.05)",border:"1px solid rgba(255,255,255,0.09)"},children:r.jsx(MP,{})}),r.jsx(s6,{})]})]}),r.jsx(se,{children:s&&r.jsx(H.div,{initial:{x:-280},animate:{x:0},exit:{x:-280},transition:{type:"spring",stiffness:340,damping:34},className:"fixed top-0 left-0 bottom-0 z-30 w-[280px]",children:r.jsx(N6,{onClose:()=>i(!1)})},"sidebar-panel")}),r.jsx("main",{className:"relative min-h-screen pt-16 transition-[margin] duration-300 bg-transparent",style:{marginLeft:s?280:0},children:r.jsx(Lk,{})}),r.jsx(YP,{}),r.jsx(t6,{}),r.jsx(o6,{}),r.jsx(g6,{})]})})}const E6=[{decision:"duplicate",label:"Create New Agent",sublabel:"Keep both — cloud data is copied to a separate folder",icon:hC,accent:"border-blue-500/30 bg-blue-500/8 hover:border-blue-500/50 text-blue-400"},{decision:"restore",label:"Use Cloud (Overwrite)",sublabel:"Cloud wins — local memory is replaced with cloud version",icon:aC,accent:"border-orange-500/30 bg-orange-500/8 hover:border-orange-500/50 text-orange-400"},{decision:"upload",label:"Keep Mine",sublabel:"Local wins — cloud memory is overwritten with local data",icon:LC,accent:"border-green-500/30 bg-green-500/8 hover:border-green-500/50 text-green-400"}];function _6(){const[e,t]=h.useState(null),[n,s]=h.useState(!1),[i,a]=h.useState(!1);h.useEffect(()=>{const c=at(),u=d=>{d.type==="CONFLICT_DETECTED"&&(t({localAgentName:d.localAgentName??null,cloudAgentName:d.cloudAgentName??null,localMtime:d.localMtime??null,cloudTimestamp:d.cloudTimestamp??null}),a(!1)),d.type==="syncResolveFinish"&&(a(!0),setTimeout(()=>{t(null),a(!1)},1800))};return c.on("agentUpdate",u),()=>{c.off("agentUpdate",u)}},[]);const o=async c=>{if(!n){s(!0);try{await fetch("/api/setup/sync-resolve",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({decision:c})})}catch{}s(!1)}},l=c=>{if(!c)return"—";try{return new Date(c).toLocaleString("en-US",{dateStyle:"medium",timeStyle:"short"})}catch{return c}};return r.jsx(se,{children:e&&r.jsx(H.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-[200] flex items-center justify-center bg-black/70 backdrop-blur-sm px-4",children:r.jsxs(H.div,{initial:{opacity:0,y:24,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:24,scale:.95},transition:{duration:.25},className:"w-full max-w-md bg-[#0c0f18] border border-white/10 rounded-2xl shadow-2xl overflow-hidden",children:[r.jsxs("div",{className:"flex items-center gap-3 px-6 py-5 border-b border-white/8 bg-amber-500/5",children:[r.jsx("div",{className:"w-9 h-9 rounded-full bg-amber-500/15 flex items-center justify-center flex-shrink-0",children:r.jsx(os,{size:18,className:"text-amber-400"})}),r.jsxs("div",{children:[r.jsx("h2",{className:"text-white font-bold text-base",children:"Memory Conflict Detected"}),r.jsx("p",{className:"text-gray-500 text-xs mt-0.5",children:"Two agent identities found — action required"})]})]}),r.jsxs("div",{className:"grid grid-cols-2 gap-3 px-6 pt-5 pb-2",children:[r.jsxs("div",{className:"rounded-xl border border-white/8 bg-white/3 px-4 py-3",children:[r.jsx("p",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-widest mb-1",children:"Local Agent"}),r.jsx("p",{className:"text-white font-bold text-sm",children:e.localAgentName??"—"}),r.jsx("p",{className:"text-gray-600 text-[10px] mt-1",children:l(e.localMtime)})]}),r.jsxs("div",{className:"rounded-xl border border-orange-500/20 bg-orange-500/5 px-4 py-3",children:[r.jsx("p",{className:"text-[10px] font-bold text-orange-400/60 uppercase tracking-widest mb-1",children:"Cloud Agent"}),r.jsx("p",{className:"text-orange-300 font-bold text-sm",children:e.cloudAgentName??"—"}),r.jsx("p",{className:"text-orange-400/40 text-[10px] mt-1",children:l(e.cloudTimestamp)})]})]}),r.jsx("div",{className:"px-6 py-4 space-y-2",children:i?r.jsxs("div",{className:"flex items-center justify-center gap-2 py-6 text-green-400 text-sm font-semibold",children:[r.jsx("span",{className:"w-4 h-4 rounded-full border-2 border-green-400 flex items-center justify-center text-[10px]",children:"✓"}),"Conflict resolved"]}):E6.map(c=>{const u=c.icon;return r.jsxs("button",{onClick:()=>o(c.decision),disabled:n,className:`w-full flex items-center gap-3 px-4 py-3 rounded-xl border transition-all text-left disabled:opacity-50 disabled:cursor-not-allowed ${c.accent}`,children:[n?r.jsx(ne,{size:16,className:"animate-spin flex-shrink-0"}):r.jsx(u,{size:16,className:"flex-shrink-0"}),r.jsxs("div",{children:[r.jsx("p",{className:"font-semibold text-sm text-white",children:c.label}),r.jsx("p",{className:"text-[11px] text-gray-500 mt-0.5",children:c.sublabel})]})]},c.decision)})}),r.jsx("div",{className:"px-6 pb-5 pt-1",children:r.jsx("p",{className:"text-[10px] text-gray-700 text-center",children:'This action cannot be undone · If unsure, choose "Create New Agent" first'})})]})})})}const T6="1.72.21";function P6(){const[e,t]=h.useState("idle"),[n,s]=h.useState(null),[i,a]=h.useState(""),[o,l]=h.useState(""),c=h.useRef(!1),u=h.useCallback(async()=>{var m,v;t("checking"),a("");try{const y=await $("/api/system/version");if(!y.ok)throw new Error(`Server returned ${y.status}`);const g=await y.json(),x=(g==null?void 0:g.current)??((m=g==null?void 0:g.data)==null?void 0:m.current),w=(g==null?void 0:g.latest)??((v=g==null?void 0:g.data)==null?void 0:v.latest);if(!x||!w)throw new Error("Version endpoint returned incomplete data");s({current:x,latest:w}),A6(w,x)>0?t("update-available"):(t("up-to-date"),setTimeout(()=>t("idle"),3e3))}catch(y){a((y==null?void 0:y.message)??"Check failed"),t("error"),setTimeout(()=>{t("idle"),a("")},4e3)}},[]);h.useEffect(()=>{if(e!=="restarting")return;const m=setTimeout(()=>window.close(),1e4),v=setInterval(async()=>{try{(await fetch("/api/system/health",{credentials:"include"})).ok&&(clearInterval(v),clearTimeout(m),c.current=!0,t("done"),window.close())}catch{}},3e3);return()=>{clearInterval(v),clearTimeout(m)}},[e]),h.useEffect(()=>{const v=setInterval(()=>{t(y=>((y==="idle"||y==="up-to-date")&&u(),y))},288e5);return()=>clearInterval(v)},[u]);const d=h.useCallback(async()=>{t("downloading"),l("");try{const m=await fetch("/api/system/update",{method:"POST",credentials:"include"});if(!m.body)throw new Error("No response body");const v=m.body.getReader(),y=new TextDecoder;let b="";for(;;){const{done:g,value:x}=await v.read();if(g)break;const w=y.decode(x);b+=w,l(j=>j+w)}b.includes("__MUSTB_SHUTTING_DOWN__")?t("restarting"):b.includes("❌")?(a("Install failed — see log above"),t("error"),setTimeout(()=>{t("idle"),a("")},5e3)):t("done")}catch(m){a((m==null?void 0:m.message)??"Update failed"),t("error")}},[]),p=h.useCallback(async()=>{t("restarting");try{await $("/api/system/restart",{method:"POST"})}catch{}const m=at();let v=0;const y=setInterval(()=>{v++,m.connected&&(clearInterval(y),window.location.reload()),v>60&&clearInterval(y)},500)},[]),f=(n==null?void 0:n.current)??T6;return r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"fixed bottom-4 right-4 z-50 flex flex-col items-end gap-2",children:[!["update-available","downloading","done","restarting"].includes(e)&&r.jsxs("button",{onClick:e==="idle"||e==="up-to-date"||e==="error"?u:void 0,disabled:["checking","downloading","restarting"].includes(e),title:"Check for updates",className:Xe("flex items-center gap-2","py-2 px-4 rounded-full shadow-2xl","text-xs font-medium","transition-all duration-200",e==="update-available"?"bg-red-900/90 backdrop-blur-md border border-red-500/50 text-white hover:bg-red-800 hover:border-red-400/60":e==="error"?"bg-amber-900/90 backdrop-blur-md border border-amber-500/60 text-white hover:bg-amber-800 hover:border-amber-400/70":"bg-gray-900/90 backdrop-blur-md border border-gray-700/50 text-gray-300 hover:bg-gray-800 hover:border-gray-600/60 hover:text-white",["checking","downloading","restarting"].includes(e)&&"cursor-wait opacity-80"),children:[e==="checking"&&r.jsx(ne,{size:13,className:"animate-spin text-orange-400 shrink-0"}),e==="update-available"&&r.jsx(Mi,{size:13,className:"text-red-300 shrink-0"}),e==="up-to-date"&&r.jsx(wr,{size:13,className:"text-emerald-400 shrink-0"}),e==="downloading"&&r.jsx(ne,{size:13,className:"animate-spin text-orange-400 shrink-0"}),e==="done"&&r.jsx(wr,{size:13,className:"text-emerald-400 shrink-0"}),e==="restarting"&&r.jsx(ne,{size:13,className:"animate-spin text-orange-400 shrink-0"}),e==="error"&&r.jsx(wt,{size:13,className:"text-amber-300 shrink-0"}),e==="idle"&&r.jsx(de,{size:13,className:"text-gray-500 shrink-0"}),r.jsxs("span",{className:"tabular-nums",children:[r.jsx("span",{children:"Must-b v"}),r.jsx("span",{children:f})]}),e==="checking"&&r.jsx("span",{className:"text-orange-400/80",children:"Checking…"}),e==="up-to-date"&&r.jsx("span",{className:"text-emerald-400/80",children:"Up to date"}),e==="downloading"&&r.jsx("span",{className:"text-orange-400/80",children:"Installing…"}),e==="done"&&r.jsx("span",{className:"text-emerald-400/80",children:"Installed!"}),e==="restarting"&&r.jsx("span",{className:"text-orange-400/80",children:"Restarting…"}),e==="error"&&r.jsxs("span",{className:"text-amber-300/90 max-w-[140px] truncate",children:["Check failed",i?` — ${i}`:""]})]}),e==="update-available"&&n&&r.jsxs("div",{className:"flex flex-col gap-3 p-4 rounded-2xl bg-gray-900/95 border border-orange-500/30 backdrop-blur-md shadow-2xl w-60",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Mi,{size:16,className:"text-orange-400 shrink-0"}),r.jsx("span",{className:"text-orange-300 font-semibold text-sm",children:"Update Available"})]}),r.jsxs("div",{className:"text-gray-400 text-xs leading-relaxed",children:[r.jsx("span",{children:"Version "}),r.jsx("span",{className:"font-mono text-white",children:n.latest}),r.jsx("span",{children:" is ready to install."})]}),r.jsxs("div",{className:"flex items-center justify-between text-[11px] text-gray-500",children:[r.jsxs("span",{children:["Current: ",r.jsx("span",{className:"font-mono",children:n.current})]}),r.jsxs("span",{children:["Latest: ",r.jsx("span",{className:"font-mono text-orange-300",children:n.latest})]})]}),r.jsxs("button",{onClick:d,className:"flex items-center justify-center gap-2 bg-orange-600 hover:bg-orange-500 active:scale-95 text-white rounded-xl py-2 text-xs font-semibold transition-all duration-150 shadow-lg shadow-orange-900/30",children:[r.jsx(Mi,{size:13}),r.jsx("span",{children:"Download & Install"})]}),r.jsx("button",{onClick:()=>t("idle"),className:"text-center text-[11px] text-gray-600 hover:text-gray-400 transition-colors",children:r.jsx("span",{children:"Dismiss"})})]}),e==="downloading"&&r.jsxs("div",{className:"p-4 rounded-2xl bg-gray-900/95 border border-white/10 backdrop-blur-md shadow-2xl w-60",children:[r.jsxs("div",{className:"flex items-center gap-2 text-xs text-orange-300 mb-3",children:[r.jsx(ne,{size:13,className:"animate-spin shrink-0"}),r.jsx("span",{children:"Installing update…"})]}),r.jsx("pre",{className:"text-[10px] text-gray-400 max-h-24 overflow-y-auto whitespace-pre-wrap break-all font-mono bg-black/30 rounded-lg p-2",children:r.jsx("span",{children:o||"Connecting to npm registry…"})})]}),e==="done"&&!c.current&&r.jsxs("div",{className:"flex flex-col gap-3 p-4 rounded-2xl bg-gray-900/95 border border-emerald-500/30 backdrop-blur-md shadow-2xl w-60",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(wr,{size:16,className:"text-emerald-400 shrink-0"}),r.jsx("span",{className:"text-emerald-300 font-semibold text-sm",children:"Update Installed!"})]}),r.jsx("p",{className:"text-gray-400 text-xs",children:r.jsx("span",{children:"Restart Must-b to apply the new version."})}),r.jsxs("button",{onClick:p,className:"flex items-center justify-center gap-2 bg-emerald-700 hover:bg-emerald-600 active:scale-95 text-white rounded-xl py-2 text-xs font-semibold transition-all duration-150",children:[r.jsx(de,{size:13}),r.jsx("span",{children:"Restart Now"})]})]})]}),e==="done"&&c.current&&r.jsx("div",{className:"fixed inset-0 z-[9999] flex flex-col items-center justify-center bg-black",children:r.jsxs("div",{className:"font-mono text-center px-8 max-w-xl w-full",children:[r.jsxs("div",{className:"flex items-center justify-center gap-2 mb-8",children:[r.jsx(wr,{size:18,className:"text-green-400 shrink-0"}),r.jsx("span",{className:"text-green-400 text-xs tracking-widest uppercase",children:"must-b terminal"})]}),r.jsx("pre",{className:"text-green-400 text-sm leading-relaxed text-left inline-block",children:`╔══════════════════════════════════════════════════════╗
831
831
  ║ ║
832
832
  ║ MUST-B IS BACK ONLINE ║
833
833
  ║ ───────────────────────────────────────────── ║
@@ -848,4 +848,4 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
848
848
  ║ ║
849
849
  ║ Press [ ↑ ] UP arrow key + ENTER to restart. ║
850
850
  ║ ║
851
- ╚══════════════════════════════════════════════════════╝`}),r.jsx("div",{className:"mt-6 flex flex-col items-center gap-2",children:r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"text-green-600 text-xs",children:"waiting for backend — will auto-reload when online"}),r.jsx("span",{className:"inline-block w-2 h-4 bg-green-400 animate-pulse"})]})})]})})]})}function P6(e,t){const n=a=>a.replace(/[^0-9.]/g,"").split(".").map(Number),[s,i]=[n(e),n(t)];for(let a=0;a<Math.max(s.length,i.length);a++){const o=(s[a]??0)-(i[a]??0);if(o!==0)return o}return 0}class M6 extends h.Component{constructor(t){super(t),this.state={error:null}}static getDerivedStateFromError(t){return{error:t}}componentDidCatch(t,n){console.error("[ErrorBoundary]",t,n.componentStack)}render(){return this.state.error?r.jsxs("div",{className:"min-h-screen bg-[#02040a] flex flex-col items-center justify-center gap-4 text-center px-6",children:[r.jsx("span",{className:"text-3xl",children:"⚠️"}),r.jsx("p",{className:"text-orange-400 font-bold text-sm",children:"Something went wrong"}),r.jsx("p",{className:"text-gray-600 text-xs font-mono max-w-sm break-all",children:this.state.error.message}),r.jsx("button",{onClick:()=>this.setState({error:null}),className:"mt-2 px-4 py-2 rounded-xl bg-orange-500/10 border border-orange-500/20 text-orange-400 text-xs font-bold hover:bg-orange-500/20 transition-all",children:"Retry"})]}):this.props.children}}const Yc="mustb_setup_complete";function A6({children:e}){const t=mn(),[n,s]=h.useState(()=>localStorage.getItem(Yc)==="1");return h.useEffect(()=>{if(localStorage.getItem(Yc)==="1"){s(!0);return}let i=!1;return fetch("/api/setup/status").then(a=>a.ok?a.json():{configured:!0}).then(a=>{i||(a.configured?(localStorage.setItem(Yc,"1"),s(!0)):t("/setup",{replace:!0}))}).catch(()=>{i||s(!0)}),()=>{i=!0}},[t]),n?r.jsx(r.Fragment,{children:e}):null}function R6(){return r.jsx(M6,{children:r.jsx(XC,{children:r.jsxs(Wk,{children:[r.jsx(k5,{position:"top-right",theme:"dark",closeButton:!0,richColors:!0}),r.jsx(E6,{}),r.jsx(T6,{}),r.jsxs(Dk,{children:[r.jsx(xe,{path:"/",element:r.jsx(c0,{})}),r.jsx(xe,{path:"/welcome",element:r.jsx(c0,{})}),r.jsx(xe,{path:"/setup",element:r.jsx(n3,{})}),r.jsxs(xe,{path:"/app",element:r.jsx(A6,{children:r.jsx(S6,{})}),children:[r.jsx(xe,{index:!0,element:r.jsx(S0,{})}),r.jsx(xe,{path:"chat",element:r.jsx(S0,{})}),r.jsx(xe,{path:"settings",element:r.jsx(VE,{})}),r.jsx(xe,{path:"active",element:r.jsx(UE,{})}),r.jsx(xe,{path:"automations",element:r.jsx(KE,{})}),r.jsx(xe,{path:"clients",element:r.jsx(YE,{})}),r.jsx(xe,{path:"logs",element:r.jsx(ZE,{})}),r.jsx(xe,{path:"products",element:r.jsx(n_,{})}),r.jsx(xe,{path:"memory",element:r.jsx(c_,{})}),r.jsx(xe,{path:"memory/persona",element:r.jsx(h_,{})}),r.jsx(xe,{path:"skills",element:r.jsx(p_,{})}),r.jsx(xe,{path:"plugins",element:r.jsx(y_,{})}),r.jsx(xe,{path:"files",element:r.jsx(w_,{})}),r.jsx(xe,{path:"browser",element:r.jsx(S_,{})}),r.jsx(xe,{path:"voice",element:r.jsx(__,{})}),r.jsx(xe,{path:"channels",element:r.jsx(R_,{})}),r.jsx(xe,{path:"store",element:r.jsx(PP,{})}),r.jsx(xe,{path:"*",element:r.jsx(Dp,{to:"/app",replace:!0})})]}),r.jsx(xe,{path:"/mobile",element:r.jsx(b_,{})}),r.jsx(xe,{path:"*",element:r.jsx(Dp,{to:"/",replace:!0})})]})]})})})}hy(document.getElementById("root")).render(r.jsx(h.StrictMode,{children:r.jsx(R6,{})}));
851
+ ╚══════════════════════════════════════════════════════╝`}),r.jsx("div",{className:"mt-6 flex flex-col items-center gap-2",children:r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"text-green-600 text-xs",children:"waiting for backend — will auto-reload when online"}),r.jsx("span",{className:"inline-block w-2 h-4 bg-green-400 animate-pulse"})]})})]})})]})}function A6(e,t){const n=a=>a.replace(/[^0-9.]/g,"").split(".").map(Number),[s,i]=[n(e),n(t)];for(let a=0;a<Math.max(s.length,i.length);a++){const o=(s[a]??0)-(i[a]??0);if(o!==0)return o}return 0}class M6 extends h.Component{constructor(t){super(t),this.state={error:null}}static getDerivedStateFromError(t){return{error:t}}componentDidCatch(t,n){console.error("[ErrorBoundary]",t,n.componentStack)}render(){return this.state.error?r.jsxs("div",{className:"min-h-screen bg-[#02040a] flex flex-col items-center justify-center gap-4 text-center px-6",children:[r.jsx("span",{className:"text-3xl",children:"⚠️"}),r.jsx("p",{className:"text-orange-400 font-bold text-sm",children:"Something went wrong"}),r.jsx("p",{className:"text-gray-600 text-xs font-mono max-w-sm break-all",children:this.state.error.message}),r.jsx("button",{onClick:()=>this.setState({error:null}),className:"mt-2 px-4 py-2 rounded-xl bg-orange-500/10 border border-orange-500/20 text-orange-400 text-xs font-bold hover:bg-orange-500/20 transition-all",children:"Retry"})]}):this.props.children}}const Yc="mustb_setup_complete";function R6({children:e}){const t=mn(),[n,s]=h.useState(()=>localStorage.getItem(Yc)==="1");return h.useEffect(()=>{if(localStorage.getItem(Yc)==="1"){s(!0);return}let i=!1;return fetch("/api/setup/status").then(a=>a.ok?a.json():{configured:!0}).then(a=>{i||(a.configured?(localStorage.setItem(Yc,"1"),s(!0)):t("/setup",{replace:!0}))}).catch(()=>{i||s(!0)}),()=>{i=!0}},[t]),n?r.jsx(r.Fragment,{children:e}):null}function z6(){return r.jsx(M6,{children:r.jsx(XC,{children:r.jsxs(Wk,{children:[r.jsx(k5,{position:"top-right",theme:"dark",closeButton:!0,richColors:!0}),r.jsx(_6,{}),r.jsx(P6,{}),r.jsxs(Dk,{children:[r.jsx(xe,{path:"/",element:r.jsx(c0,{})}),r.jsx(xe,{path:"/welcome",element:r.jsx(c0,{})}),r.jsx(xe,{path:"/setup",element:r.jsx(n3,{})}),r.jsxs(xe,{path:"/app",element:r.jsx(R6,{children:r.jsx(C6,{})}),children:[r.jsx(xe,{index:!0,element:r.jsx(S0,{})}),r.jsx(xe,{path:"chat",element:r.jsx(S0,{})}),r.jsx(xe,{path:"settings",element:r.jsx(VE,{})}),r.jsx(xe,{path:"active",element:r.jsx(UE,{})}),r.jsx(xe,{path:"automations",element:r.jsx(KE,{})}),r.jsx(xe,{path:"clients",element:r.jsx(YE,{})}),r.jsx(xe,{path:"logs",element:r.jsx(ZE,{})}),r.jsx(xe,{path:"products",element:r.jsx(n_,{})}),r.jsx(xe,{path:"memory",element:r.jsx(c_,{})}),r.jsx(xe,{path:"memory/persona",element:r.jsx(h_,{})}),r.jsx(xe,{path:"skills",element:r.jsx(p_,{})}),r.jsx(xe,{path:"plugins",element:r.jsx(y_,{})}),r.jsx(xe,{path:"files",element:r.jsx(w_,{})}),r.jsx(xe,{path:"browser",element:r.jsx(S_,{})}),r.jsx(xe,{path:"voice",element:r.jsx(__,{})}),r.jsx(xe,{path:"channels",element:r.jsx(R_,{})}),r.jsx(xe,{path:"store",element:r.jsx(AP,{})}),r.jsx(xe,{path:"*",element:r.jsx(Dp,{to:"/app",replace:!0})})]}),r.jsx(xe,{path:"/mobile",element:r.jsx(b_,{})}),r.jsx(xe,{path:"*",element:r.jsx(Dp,{to:"/",replace:!0})})]})]})})})}hy(document.getElementById("root")).render(r.jsx(h.StrictMode,{children:r.jsx(z6,{})}));