@must-b/must-b 1.71.21 → 1.71.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/BUILD.json +3 -3
- package/dist/embedded-skills.json +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/public/assets/{index-B8hAVOHm.js → index-7TwDAfKC.js} +89 -89
- package/dist/public/assets/index-Bn0FAD1a.css +1 -0
- package/dist/public/index.html +2 -2
- package/package.json +3 -5
- package/dist/public/assets/index-BZB2GEBs.css +0 -1
- package/install.cmd +0 -73
- package/install.ps1 +0 -150
- package/install.sh +0 -150
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function
|
|
1
|
+
function R1(e,t){for(var n=0;n<t.length;n++){const s=t[n];if(typeof s!="string"&&!Array.isArray(s)){for(const i in s)if(i!=="default"&&!(i in e)){const a=Object.getOwnPropertyDescriptor(s,i);a&&Object.defineProperty(e,i,a.get?a:{enumerable:!0,get:()=>s[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))s(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&s(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function s(i){if(i.ep)return;i.ep=!0;const a=n(i);fetch(i.href,a)}})();function qm(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ym={exports:{}},Lo={},Xm={exports:{}},re={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react.production.min.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@ function L1(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 Ki=Symbol.for("react.element"),
|
|
9
|
+
*/var Ki=Symbol.for("react.element"),L1=Symbol.for("react.portal"),D1=Symbol.for("react.fragment"),O1=Symbol.for("react.strict_mode"),I1=Symbol.for("react.profiler"),B1=Symbol.for("react.provider"),F1=Symbol.for("react.context"),V1=Symbol.for("react.forward_ref"),$1=Symbol.for("react.suspense"),U1=Symbol.for("react.memo"),H1=Symbol.for("react.lazy"),Mh=Symbol.iterator;function W1(e){return e===null||typeof e!="object"?null:(e=Mh&&e[Mh]||e["@@iterator"],typeof e=="function"?e:null)}var Qm={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Jm=Object.assign,Zm={};function Cr(e,t,n){this.props=e,this.context=t,this.refs=Zm,this.updater=n||Qm}Cr.prototype.isReactComponent={};Cr.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")};Cr.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function e0(){}e0.prototype=Cr.prototype;function Dd(e,t,n){this.props=e,this.context=t,this.refs=Zm,this.updater=n||Qm}var Od=Dd.prototype=new e0;Od.constructor=Dd;Jm(Od,Cr.prototype);Od.isPureReactComponent=!0;var zh=Array.isArray,t0=Object.prototype.hasOwnProperty,Id={current:null},n0={key:!0,ref:!0,__self:!0,__source:!0};function s0(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)t0.call(t,s)&&!n0.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),d=0;d<l;d++)c[d]=arguments[d+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:Ki,type:e,key:a,ref:o,props:i,_owner:Id.current}}function G1(e,t){return{$$typeof:Ki,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Bd(e){return typeof e=="object"&&e!==null&&e.$$typeof===Ki}function K1(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Rh=/\/+/g;function gl(e,t){return typeof e=="object"&&e!==null&&e.key!=null?K1(""+e.key):t.toString(36)}function Oa(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 Ki:case L1:o=!0}}if(o)return o=e,i=i(o),e=s===""?"."+gl(o,0):s,zh(i)?(n="",e!=null&&(n=e.replace(Rh,"$&/")+"/"),Oa(i,t,n,"",function(d){return d})):i!=null&&(Bd(i)&&(i=G1(i,n+(!i.key||o&&o.key===i.key?"":(""+i.key).replace(Rh,"$&/")+"/")+e)),t.push(i)),1;if(o=0,s=s===""?".":s+":",zh(e))for(var l=0;l<e.length;l++){a=e[l];var c=s+gl(a,l);o+=Oa(a,t,n,c,i)}else if(c=W1(e),typeof c=="function")for(e=c.call(e),l=0;!(a=e.next()).done;)a=a.value,c=s+gl(a,l++),o+=Oa(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 ca(e,t,n){if(e==null)return e;var s=[],i=0;return Oa(e,s,"","",function(a){return t.call(n,a,i++)}),s}function q1(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},Ia={transition:null},Y1={ReactCurrentDispatcher:rt,ReactCurrentBatchConfig:Ia,ReactCurrentOwner:Id};function r0(){throw Error("act(...) is not supported in production builds of React.")}re.Children={map:ca,forEach:function(e,t,n){ca(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return ca(e,function(){t++}),t},toArray:function(e){return ca(e,function(t){return t})||[]},only:function(e){if(!Bd(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};re.Component=Cr;re.Fragment=D1;re.Profiler=I1;re.PureComponent=Dd;re.StrictMode=O1;re.Suspense=$1;re.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Y1;re.act=r0;re.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=Jm({},e.props),i=e.key,a=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(a=t.ref,o=Id.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(c in t)t0.call(t,c)&&!n0.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 d=0;d<c;d++)l[d]=arguments[d+2];s.children=l}return{$$typeof:Ki,type:e.type,key:i,ref:a,props:s,_owner:o}};re.createContext=function(e){return e={$$typeof:F1,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:B1,_context:e},e.Consumer=e};re.createElement=s0;re.createFactory=function(e){var t=s0.bind(null,e);return t.type=e,t};re.createRef=function(){return{current:null}};re.forwardRef=function(e){return{$$typeof:V1,render:e}};re.isValidElement=Bd;re.lazy=function(e){return{$$typeof:H1,_payload:{_status:-1,_result:e},_init:q1}};re.memo=function(e,t){return{$$typeof:U1,type:e,compare:t===void 0?null:t}};re.startTransition=function(e){var t=Ia.transition;Ia.transition={};try{e()}finally{Ia.transition=t}};re.unstable_act=r0;re.useCallback=function(e,t){return rt.current.useCallback(e,t)};re.useContext=function(e){return rt.current.useContext(e)};re.useDebugValue=function(){};re.useDeferredValue=function(e){return rt.current.useDeferredValue(e)};re.useEffect=function(e,t){return rt.current.useEffect(e,t)};re.useId=function(){return rt.current.useId()};re.useImperativeHandle=function(e,t,n){return rt.current.useImperativeHandle(e,t,n)};re.useInsertionEffect=function(e,t){return rt.current.useInsertionEffect(e,t)};re.useLayoutEffect=function(e,t){return rt.current.useLayoutEffect(e,t)};re.useMemo=function(e,t){return rt.current.useMemo(e,t)};re.useReducer=function(e,t,n){return rt.current.useReducer(e,t,n)};re.useRef=function(e){return rt.current.useRef(e)};re.useState=function(e){return rt.current.useState(e)};re.useSyncExternalStore=function(e,t,n){return rt.current.useSyncExternalStore(e,t,n)};re.useTransition=function(){return rt.current.useTransition()};re.version="18.3.1";Xm.exports=re;var f=Xm.exports;const H=qm(f),X1=R1({__proto__:null,default:H},[f]);/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.production.min.js
|
|
12
12
|
*
|
|
@@ -14,7 +14,7 @@ function L1(e,t){for(var n=0;n<t.length;n++){const s=t[n];if(typeof s!="string"&
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var
|
|
17
|
+
*/var Q1=f,J1=Symbol.for("react.element"),Z1=Symbol.for("react.fragment"),ev=Object.prototype.hasOwnProperty,tv=Q1.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,nv={key:!0,ref:!0,__self:!0,__source:!0};function i0(e,t,n){var s,i={},a=null,o=null;n!==void 0&&(a=""+n),t.key!==void 0&&(a=""+t.key),t.ref!==void 0&&(o=t.ref);for(s in t)ev.call(t,s)&&!nv.hasOwnProperty(s)&&(i[s]=t[s]);if(e&&e.defaultProps)for(s in t=e.defaultProps,t)i[s]===void 0&&(i[s]=t[s]);return{$$typeof:J1,type:e,key:a,ref:o,props:i,_owner:tv.current}}Lo.Fragment=Z1;Lo.jsx=i0;Lo.jsxs=i0;Ym.exports=Lo;var r=Ym.exports,a0={exports:{}},bt={},o0={exports:{}},l0={};/**
|
|
18
18
|
* @license React
|
|
19
19
|
* scheduler.production.min.js
|
|
20
20
|
*
|
|
@@ -22,7 +22,7 @@ function L1(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,E){var L=C.length;C.push(E);e:for(;0<L;){var W=L-1>>>1,q=C[W];if(0<i(q,E))C[W]=E,C[L]=q,L=W;else break e}}function n(C){return C.length===0?null:C[0]}function s(C){if(C.length===0)return null;var E=C[0],L=C.pop();if(L!==E){C[0]=L;e:for(var W=0,q=C.length,te=q>>>1;W<te;){var se=2*(W+1)-1,de=C[se],fe=se+1,ae=C[fe];if(0>i(de,L))fe<q&&0>i(ae,de)?(C[W]=ae,C[fe]=L,W=fe):(C[W]=de,C[se]=L,W=se);else if(fe<q&&0>i(ae,L))C[W]=ae,C[fe]=L,W=fe;else break e}}return E}function i(C,E){var L=C.sortIndex-E.sortIndex;return L!==0?L:C.id-E.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=[],d=[],u=1,p=null,h=3,m=!1,y=!1,b=!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 E=n(d);E!==null;){if(E.callback===null)s(d);else if(E.startTime<=C)s(d),E.sortIndex=E.expirationTime,t(c,E);else break;E=n(d)}}function j(C){if(b=!1,w(C),!y)if(n(c)!==null)y=!0,R(k);else{var E=n(d);E!==null&&B(j,E.startTime-C)}}function k(C,E){y=!1,b&&(b=!1,g(_),_=-1),m=!0;var L=h;try{for(w(E),p=n(c);p!==null&&(!(p.expirationTime>E)||C&&!T());){var W=p.callback;if(typeof W=="function"){p.callback=null,h=p.priorityLevel;var q=W(p.expirationTime<=E);E=e.unstable_now(),typeof q=="function"?p.callback=q:p===n(c)&&s(c),w(E)}else s(c);p=n(c)}if(p!==null)var te=!0;else{var se=n(d);se!==null&&B(j,se.startTime-E),te=!1}return te}finally{p=null,h=L,m=!1}}var N=!1,S=null,_=-1,A=5,P=-1;function T(){return!(e.unstable_now()-P<A)}function V(){if(S!==null){var C=e.unstable_now();P=C;var E=!0;try{E=S(!0,C)}finally{E?M():(N=!1,S=null)}}else N=!1}var M;if(typeof x=="function")M=function(){x(V)};else if(typeof MessageChannel<"u"){var I=new MessageChannel,z=I.port2;I.port1.onmessage=V,M=function(){z.postMessage(null)}}else M=function(){v(V,0)};function R(C){S=C,N||(N=!0,M())}function B(C,E){_=v(function(){C(e.unstable_now())},E)}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(){y||m||(y=!0,R(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"):A=0<C?Math.floor(1e3/C):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(C){switch(h){case 1:case 2:case 3:var E=3;break;default:E=h}var L=h;h=E;try{return C()}finally{h=L}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(C,E){switch(C){case 1:case 2:case 3:case 4:case 5:break;default:C=3}var L=h;h=C;try{return E()}finally{h=L}},e.unstable_scheduleCallback=function(C,E,L){var W=e.unstable_now();switch(typeof L=="object"&&L!==null?(L=L.delay,L=typeof L=="number"&&0<L?W+L:W):L=W,C){case 1:var q=-1;break;case 2:q=250;break;case 5:q=1073741823;break;case 4:q=1e4;break;default:q=5e3}return q=L+q,C={id:u++,callback:E,priorityLevel:C,startTime:L,expirationTime:q,sortIndex:-1},L>W?(C.sortIndex=L,t(d,C),n(c)===null&&C===n(d)&&(b?(g(_),_=-1):b=!0,B(j,L-W))):(C.sortIndex=q,t(c,C),y||m||(y=!0,R(k))),C},e.unstable_shouldYield=T,e.unstable_wrapCallback=function(C){var E=h;return function(){var L=h;h=E;try{return C.apply(this,arguments)}finally{h=L}}}})(
|
|
25
|
+
*/(function(e){function t(C,E){var L=C.length;C.push(E);e:for(;0<L;){var W=L-1>>>1,q=C[W];if(0<i(q,E))C[W]=E,C[L]=q,L=W;else break e}}function n(C){return C.length===0?null:C[0]}function s(C){if(C.length===0)return null;var E=C[0],L=C.pop();if(L!==E){C[0]=L;e:for(var W=0,q=C.length,te=q>>>1;W<te;){var se=2*(W+1)-1,de=C[se],fe=se+1,ae=C[fe];if(0>i(de,L))fe<q&&0>i(ae,de)?(C[W]=ae,C[fe]=L,W=fe):(C[W]=de,C[se]=L,W=se);else if(fe<q&&0>i(ae,L))C[W]=ae,C[fe]=L,W=fe;else break e}}return E}function i(C,E){var L=C.sortIndex-E.sortIndex;return L!==0?L:C.id-E.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=[],d=[],u=1,p=null,h=3,m=!1,y=!1,b=!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 E=n(d);E!==null;){if(E.callback===null)s(d);else if(E.startTime<=C)s(d),E.sortIndex=E.expirationTime,t(c,E);else break;E=n(d)}}function j(C){if(b=!1,w(C),!y)if(n(c)!==null)y=!0,R(k);else{var E=n(d);E!==null&&B(j,E.startTime-C)}}function k(C,E){y=!1,b&&(b=!1,g(_),_=-1),m=!0;var L=h;try{for(w(E),p=n(c);p!==null&&(!(p.expirationTime>E)||C&&!T());){var W=p.callback;if(typeof W=="function"){p.callback=null,h=p.priorityLevel;var q=W(p.expirationTime<=E);E=e.unstable_now(),typeof q=="function"?p.callback=q:p===n(c)&&s(c),w(E)}else s(c);p=n(c)}if(p!==null)var te=!0;else{var se=n(d);se!==null&&B(j,se.startTime-E),te=!1}return te}finally{p=null,h=L,m=!1}}var N=!1,S=null,_=-1,A=5,P=-1;function T(){return!(e.unstable_now()-P<A)}function V(){if(S!==null){var C=e.unstable_now();P=C;var E=!0;try{E=S(!0,C)}finally{E?M():(N=!1,S=null)}}else N=!1}var M;if(typeof x=="function")M=function(){x(V)};else if(typeof MessageChannel<"u"){var I=new MessageChannel,z=I.port2;I.port1.onmessage=V,M=function(){z.postMessage(null)}}else M=function(){v(V,0)};function R(C){S=C,N||(N=!0,M())}function B(C,E){_=v(function(){C(e.unstable_now())},E)}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(){y||m||(y=!0,R(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"):A=0<C?Math.floor(1e3/C):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(C){switch(h){case 1:case 2:case 3:var E=3;break;default:E=h}var L=h;h=E;try{return C()}finally{h=L}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(C,E){switch(C){case 1:case 2:case 3:case 4:case 5:break;default:C=3}var L=h;h=C;try{return E()}finally{h=L}},e.unstable_scheduleCallback=function(C,E,L){var W=e.unstable_now();switch(typeof L=="object"&&L!==null?(L=L.delay,L=typeof L=="number"&&0<L?W+L:W):L=W,C){case 1:var q=-1;break;case 2:q=250;break;case 5:q=1073741823;break;case 4:q=1e4;break;default:q=5e3}return q=L+q,C={id:u++,callback:E,priorityLevel:C,startTime:L,expirationTime:q,sortIndex:-1},L>W?(C.sortIndex=L,t(d,C),n(c)===null&&C===n(d)&&(b?(g(_),_=-1):b=!0,B(j,L-W))):(C.sortIndex=q,t(c,C),y||m||(y=!0,R(k))),C},e.unstable_shouldYield=T,e.unstable_wrapCallback=function(C){var E=h;return function(){var L=h;h=E;try{return C.apply(this,arguments)}finally{h=L}}}})(l0);o0.exports=l0;var sv=o0.exports;/**
|
|
26
26
|
* @license React
|
|
27
27
|
* react-dom.production.min.js
|
|
28
28
|
*
|
|
@@ -30,14 +30,14 @@ function L1(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
|
|
33
|
+
*/var rv=f,yt=sv;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 c0=new Set,vi={};function As(e,t){fr(e,t),fr(e+"Capture",t)}function fr(e,t){for(vi[e]=t,e=0;e<t.length;e++)c0.add(t[e])}var bn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),fc=Object.prototype.hasOwnProperty,iv=/^[: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]*$/,Lh={},Dh={};function av(e){return fc.call(Dh,e)?!0:fc.call(Lh,e)?!1:iv.test(e)?Dh[e]=!0:(Lh[e]=!0,!1)}function ov(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 lv(e,t,n,s){if(t===null||typeof t>"u"||ov(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 Ue={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Ue[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];Ue[t]=new it(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Ue[e]=new it(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Ue[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){Ue[e]=new it(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Ue[e]=new it(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Ue[e]=new it(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Ue[e]=new it(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Ue[e]=new it(e,5,!1,e.toLowerCase(),null,!1,!1)});var Fd=/[\-:]([a-z])/g;function Vd(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(Fd,Vd);Ue[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(Fd,Vd);Ue[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(Fd,Vd);Ue[t]=new it(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Ue[e]=new it(e,1,!1,e.toLowerCase(),null,!1,!1)});Ue.xlinkHref=new it("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Ue[e]=new it(e,1,!1,e.toLowerCase(),null,!0,!0)});function $d(e,t,n,s){var i=Ue.hasOwnProperty(t)?Ue[t]:null;(i!==null?i.type!==0:s||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(lv(t,n,i,s)&&(n=null),s||i===null?av(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 Cn=rv.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,da=Symbol.for("react.element"),Ws=Symbol.for("react.portal"),Gs=Symbol.for("react.fragment"),Ud=Symbol.for("react.strict_mode"),mc=Symbol.for("react.profiler"),d0=Symbol.for("react.provider"),u0=Symbol.for("react.context"),Hd=Symbol.for("react.forward_ref"),gc=Symbol.for("react.suspense"),xc=Symbol.for("react.suspense_list"),Wd=Symbol.for("react.memo"),zn=Symbol.for("react.lazy"),h0=Symbol.for("react.offscreen"),Oh=Symbol.iterator;function Or(e){return e===null||typeof e!="object"?null:(e=Oh&&e[Oh]||e["@@iterator"],typeof e=="function"?e:null)}var Se=Object.assign,xl;function qr(e){if(xl===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);xl=t&&t[1]||""}return`
|
|
34
34
|
`+xl+e}var yl=!1;function vl(e,t){if(!e||yl)return"";yl=!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(d){var s=d}Reflect.construct(e,[],t)}else{try{t.call()}catch(d){s=d}e.call(t.prototype)}else{try{throw Error()}catch(d){s=d}e()}}catch(d){if(d&&s&&typeof d.stack=="string"){for(var i=d.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{yl=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?qr(e):""}function dv(e){switch(e.tag){case 5:return qr(e.type);case 16:return qr("Lazy");case 13:return qr("Suspense");case 19:return qr("SuspenseList");case 0:case 2:case 15:return e=vl(e.type,!1),e;case 11:return e=vl(e.type.render,!1),e;case 1:return e=vl(e.type,!0),e;default:return""}}function yc(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 Gs:return"Fragment";case Ws:return"Portal";case mc:return"Profiler";case Ud:return"StrictMode";case gc:return"Suspense";case xc:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case h0:return(e.displayName||"Context")+".Consumer";case u0:return(e._context.displayName||"Context")+".Provider";case Hd:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Wd:return t=e.displayName||null,t!==null?t:yc(e.type)||"Memo";case zn:t=e._payload,e=e._init;try{return yc(e(t))}catch{}}return null}function uv(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 yc(t);case 8:return t===Ud?"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 Xn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function f0(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function hv(e){var t=f0(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 ua(e){e._valueTracker||(e._valueTracker=hv(e))}function m0(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),s="";return e&&(s=f0(e)?e.checked?"true":"false":e.value),e=s,e!==n?(t.setValue(e),!0):!1}function no(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 vc(e,t){var n=t.checked;return Se({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Ih(e,t){var n=t.defaultValue==null?"":t.defaultValue,s=t.checked!=null?t.checked:t.defaultChecked;n=Xn(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 g0(e,t){t=t.checked,t!=null&&$d(e,"checked",t,!1)}function bc(e,t){g0(e,t);var n=Xn(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")?wc(e,t.type,n):t.hasOwnProperty("defaultValue")&&wc(e,t.type,Xn(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Bh(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 wc(e,t,n){(t!=="number"||no(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Yr=Array.isArray;function lr(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=""+Xn(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 kc(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(F(91));return Se({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Fh(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(Yr(n)){if(1<n.length)throw Error(F(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Xn(n)}}function x0(e,t){var n=Xn(t.value),s=Xn(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 Vh(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function y0(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 jc(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?y0(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var ha,v0=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(ha=ha||document.createElement("div"),ha.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=ha.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function bi(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var si={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},pv=["Webkit","ms","Moz","O"];Object.keys(si).forEach(function(e){pv.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),si[t]=si[e]})});function b0(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||si.hasOwnProperty(e)&&si[e]?(""+t).trim():t+"px"}function w0(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var s=n.indexOf("--")===0,i=b0(n,t[n],s);n==="float"&&(n="cssFloat"),s?e.setProperty(n,i):e[n]=i}}var fv=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 Nc(e,t){if(t){if(fv[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 Sc(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 Cc=null;function Gd(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var _c=null,cr=null,dr=null;function $h(e){if(e=Xi(e)){if(typeof _c!="function")throw Error(F(280));var t=e.stateNode;t&&(t=Fo(t),_c(e.stateNode,e.type,t))}}function k0(e){cr?dr?dr.push(e):dr=[e]:cr=e}function j0(){if(cr){var e=cr,t=dr;if(dr=cr=null,$h(e),t)for(e=0;e<t.length;e++)$h(t[e])}}function N0(e,t){return e(t)}function S0(){}var bl=!1;function C0(e,t,n){if(bl)return e(t,n);bl=!0;try{return N0(e,t,n)}finally{bl=!1,(cr!==null||dr!==null)&&(S0(),j0())}}function wi(e,t){var n=e.stateNode;if(n===null)return null;var s=Fo(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 Ec=!1;if(bn)try{var Ir={};Object.defineProperty(Ir,"passive",{get:function(){Ec=!0}}),window.addEventListener("test",Ir,Ir),window.removeEventListener("test",Ir,Ir)}catch{Ec=!1}function mv(e,t,n,s,i,a,o,l,c){var d=Array.prototype.slice.call(arguments,3);try{t.apply(n,d)}catch(u){this.onError(u)}}var ri=!1,so=null,ro=!1,Tc=null,gv={onError:function(e){ri=!0,so=e}};function xv(e,t,n,s,i,a,o,l,c){ri=!1,so=null,mv.apply(gv,arguments)}function yv(e,t,n,s,i,a,o,l,c){if(xv.apply(this,arguments),ri){if(ri){var d=so;ri=!1,so=null}else throw Error(F(198));ro||(ro=!0,Tc=d)}}function Ms(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 _0(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 Uh(e){if(Ms(e)!==e)throw Error(F(188))}function vv(e){var t=e.alternate;if(!t){if(t=Ms(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 Uh(i),e;if(a===s)return Uh(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 E0(e){return e=vv(e),e!==null?T0(e):null}function T0(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=T0(e);if(t!==null)return t;e=e.sibling}return null}var P0=yt.unstable_scheduleCallback,Hh=yt.unstable_cancelCallback,bv=yt.unstable_shouldYield,wv=yt.unstable_requestPaint,Pe=yt.unstable_now,kv=yt.unstable_getCurrentPriorityLevel,Kd=yt.unstable_ImmediatePriority,A0=yt.unstable_UserBlockingPriority,io=yt.unstable_NormalPriority,jv=yt.unstable_LowPriority,M0=yt.unstable_IdlePriority,Do=null,tn=null;function Nv(e){if(tn&&typeof tn.onCommitFiberRoot=="function")try{tn.onCommitFiberRoot(Do,e,void 0,(e.current.flags&128)===128)}catch{}}var Ht=Math.clz32?Math.clz32:_v,Sv=Math.log,Cv=Math.LN2;function _v(e){return e>>>=0,e===0?32:31-(Sv(e)/Cv|0)|0}var pa=64,fa=4194304;function Xr(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 ao(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=Xr(l):(a&=o,a!==0&&(s=Xr(a)))}else o=n&~i,o!==0?s=Xr(o):a!==0&&(s=Xr(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-Ht(t),i=1<<n,s|=e[n],t&=~i;return s}function Ev(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 Tv(e,t){for(var n=e.suspendedLanes,s=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes;0<a;){var o=31-Ht(a),l=1<<o,c=i[o];c===-1?(!(l&n)||l&s)&&(i[o]=Ev(l,t)):c<=t&&(e.expiredLanes|=l),a&=~l}}function Pc(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function z0(){var e=pa;return pa<<=1,!(pa&4194240)&&(pa=64),e}function wl(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function qi(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Ht(t),e[t]=n}function Pv(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-Ht(n),a=1<<i;t[i]=0,s[i]=-1,e[i]=-1,n&=~a}}function qd(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var s=31-Ht(n),i=1<<s;i&t|e[s]&t&&(e[s]|=t),n&=~i}}var ce=0;function R0(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var L0,Yd,D0,O0,I0,Ac=!1,ma=[],Fn=null,Vn=null,$n=null,ki=new Map,ji=new Map,Ln=[],Av="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 Wh(e,t){switch(e){case"focusin":case"focusout":Fn=null;break;case"dragenter":case"dragleave":Vn=null;break;case"mouseover":case"mouseout":$n=null;break;case"pointerover":case"pointerout":ki.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ji.delete(t.pointerId)}}function Br(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=Xi(t),t!==null&&Yd(t)),e):(e.eventSystemFlags|=s,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Mv(e,t,n,s,i){switch(t){case"focusin":return Fn=Br(Fn,e,t,n,s,i),!0;case"dragenter":return Vn=Br(Vn,e,t,n,s,i),!0;case"mouseover":return $n=Br($n,e,t,n,s,i),!0;case"pointerover":var a=i.pointerId;return ki.set(a,Br(ki.get(a)||null,e,t,n,s,i)),!0;case"gotpointercapture":return a=i.pointerId,ji.set(a,Br(ji.get(a)||null,e,t,n,s,i)),!0}return!1}function B0(e){var t=xs(e.target);if(t!==null){var n=Ms(t);if(n!==null){if(t=n.tag,t===13){if(t=_0(n),t!==null){e.blockedOn=t,I0(e.priority,function(){D0(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 Ba(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Mc(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var s=new n.constructor(n.type,n);Cc=s,n.target.dispatchEvent(s),Cc=null}else return t=Xi(n),t!==null&&Yd(t),e.blockedOn=n,!1;t.shift()}return!0}function Gh(e,t,n){Ba(e)&&n.delete(t)}function zv(){Ac=!1,Fn!==null&&Ba(Fn)&&(Fn=null),Vn!==null&&Ba(Vn)&&(Vn=null),$n!==null&&Ba($n)&&($n=null),ki.forEach(Gh),ji.forEach(Gh)}function Fr(e,t){e.blockedOn===t&&(e.blockedOn=null,Ac||(Ac=!0,yt.unstable_scheduleCallback(yt.unstable_NormalPriority,zv)))}function Ni(e){function t(i){return Fr(i,e)}if(0<ma.length){Fr(ma[0],e);for(var n=1;n<ma.length;n++){var s=ma[n];s.blockedOn===e&&(s.blockedOn=null)}}for(Fn!==null&&Fr(Fn,e),Vn!==null&&Fr(Vn,e),$n!==null&&Fr($n,e),ki.forEach(t),ji.forEach(t),n=0;n<Ln.length;n++)s=Ln[n],s.blockedOn===e&&(s.blockedOn=null);for(;0<Ln.length&&(n=Ln[0],n.blockedOn===null);)B0(n),n.blockedOn===null&&Ln.shift()}var ur=Cn.ReactCurrentBatchConfig,oo=!0;function Rv(e,t,n,s){var i=ce,a=ur.transition;ur.transition=null;try{ce=1,Xd(e,t,n,s)}finally{ce=i,ur.transition=a}}function Lv(e,t,n,s){var i=ce,a=ur.transition;ur.transition=null;try{ce=4,Xd(e,t,n,s)}finally{ce=i,ur.transition=a}}function Xd(e,t,n,s){if(oo){var i=Mc(e,t,n,s);if(i===null)Al(e,t,s,lo,n),Wh(e,s);else if(Mv(i,e,t,n,s))s.stopPropagation();else if(Wh(e,s),t&4&&-1<Av.indexOf(e)){for(;i!==null;){var a=Xi(i);if(a!==null&&L0(a),a=Mc(e,t,n,s),a===null&&Al(e,t,s,lo,n),a===i)break;i=a}i!==null&&s.stopPropagation()}else Al(e,t,s,null,n)}}var lo=null;function Mc(e,t,n,s){if(lo=null,e=Gd(s),e=xs(e),e!==null)if(t=Ms(e),t===null)e=null;else if(n=t.tag,n===13){if(e=_0(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 lo=e,null}function F0(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(kv()){case Kd:return 1;case A0:return 4;case io:case jv:return 16;case M0:return 536870912;default:return 16}default:return 16}}var On=null,Qd=null,Fa=null;function V0(){if(Fa)return Fa;var e,t=Qd,n=t.length,s,i="value"in On?On.value:On.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 Fa=i.slice(e,1<s?1-s:void 0)}function Va(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 ga(){return!0}function Kh(){return!1}function wt(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)?ga:Kh,this.isPropagationStopped=Kh,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=ga)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=ga)},persist:function(){},isPersistent:ga}),t}var _r={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Jd=wt(_r),Yi=Se({},_r,{view:0,detail:0}),Dv=wt(Yi),kl,jl,Vr,Oo=Se({},Yi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Zd,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!==Vr&&(Vr&&e.type==="mousemove"?(kl=e.screenX-Vr.screenX,jl=e.screenY-Vr.screenY):jl=kl=0,Vr=e),kl)},movementY:function(e){return"movementY"in e?e.movementY:jl}}),qh=wt(Oo),Ov=Se({},Oo,{dataTransfer:0}),Iv=wt(Ov),Bv=Se({},Yi,{relatedTarget:0}),Nl=wt(Bv),Fv=Se({},_r,{animationName:0,elapsedTime:0,pseudoElement:0}),Vv=wt(Fv),$v=Se({},_r,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Uv=wt($v),Hv=Se({},_r,{data:0}),Yh=wt(Hv),Wv={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Gv={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"},Kv={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function qv(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Kv[e])?!!t[e]:!1}function Zd(){return qv}var Yv=Se({},Yi,{key:function(e){if(e.key){var t=Wv[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Va(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Gv[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Zd,charCode:function(e){return e.type==="keypress"?Va(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Va(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Xv=wt(Yv),Qv=Se({},Oo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Xh=wt(Qv),Jv=Se({},Yi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Zd}),Zv=wt(Jv),eb=Se({},_r,{propertyName:0,elapsedTime:0,pseudoElement:0}),tb=wt(eb),nb=Se({},Oo,{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}),sb=wt(nb),rb=[9,13,27,32],eu=bn&&"CompositionEvent"in window,ii=null;bn&&"documentMode"in document&&(ii=document.documentMode);var ib=bn&&"TextEvent"in window&&!ii,$0=bn&&(!eu||ii&&8<ii&&11>=ii),Qh=" ",Jh=!1;function U0(e,t){switch(e){case"keyup":return rb.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function H0(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ks=!1;function ab(e,t){switch(e){case"compositionend":return H0(t);case"keypress":return t.which!==32?null:(Jh=!0,Qh);case"textInput":return e=t.data,e===Qh&&Jh?null:e;default:return null}}function ob(e,t){if(Ks)return e==="compositionend"||!eu&&U0(e,t)?(e=V0(),Fa=Qd=On=null,Ks=!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 $0&&t.locale!=="ko"?null:t.data;default:return null}}var lb={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 Zh(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!lb[e.type]:t==="textarea"}function W0(e,t,n,s){k0(s),t=co(t,"onChange"),0<t.length&&(n=new Jd("onChange","change",null,n,s),e.push({event:n,listeners:t}))}var ai=null,Si=null;function cb(e){ng(e,0)}function Io(e){var t=Xs(e);if(m0(t))return e}function db(e,t){if(e==="change")return t}var G0=!1;if(bn){var Sl;if(bn){var Cl="oninput"in document;if(!Cl){var ep=document.createElement("div");ep.setAttribute("oninput","return;"),Cl=typeof ep.oninput=="function"}Sl=Cl}else Sl=!1;G0=Sl&&(!document.documentMode||9<document.documentMode)}function tp(){ai&&(ai.detachEvent("onpropertychange",K0),Si=ai=null)}function K0(e){if(e.propertyName==="value"&&Io(Si)){var t=[];W0(t,Si,e,Gd(e)),C0(cb,t)}}function ub(e,t,n){e==="focusin"?(tp(),ai=t,Si=n,ai.attachEvent("onpropertychange",K0)):e==="focusout"&&tp()}function hb(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Io(Si)}function pb(e,t){if(e==="click")return Io(t)}function fb(e,t){if(e==="input"||e==="change")return Io(t)}function mb(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Gt=typeof Object.is=="function"?Object.is:mb;function Ci(e,t){if(Gt(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(!fc.call(t,i)||!Gt(e[i],t[i]))return!1}return!0}function np(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function sp(e,t){var n=np(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=np(n)}}function q0(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?q0(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Y0(){for(var e=window,t=no();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=no(e.document)}return t}function tu(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 gb(e){var t=Y0(),n=e.focusedElem,s=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&q0(n.ownerDocument.documentElement,n)){if(s!==null&&tu(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=sp(n,a);var o=sp(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 xb=bn&&"documentMode"in document&&11>=document.documentMode,qs=null,zc=null,oi=null,Rc=!1;function rp(e,t,n){var s=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Rc||qs==null||qs!==no(s)||(s=qs,"selectionStart"in s&&tu(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}),oi&&Ci(oi,s)||(oi=s,s=co(zc,"onSelect"),0<s.length&&(t=new Jd("onSelect","select",null,t,n),e.push({event:t,listeners:s}),t.target=qs)))}function xa(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Ys={animationend:xa("Animation","AnimationEnd"),animationiteration:xa("Animation","AnimationIteration"),animationstart:xa("Animation","AnimationStart"),transitionend:xa("Transition","TransitionEnd")},_l={},X0={};bn&&(X0=document.createElement("div").style,"AnimationEvent"in window||(delete Ys.animationend.animation,delete Ys.animationiteration.animation,delete Ys.animationstart.animation),"TransitionEvent"in window||delete Ys.transitionend.transition);function Bo(e){if(_l[e])return _l[e];if(!Ys[e])return e;var t=Ys[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in X0)return _l[e]=t[n];return e}var Q0=Bo("animationend"),J0=Bo("animationiteration"),Z0=Bo("animationstart"),eg=Bo("transitionend"),tg=new Map,ip="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 ts(e,t){tg.set(e,t),As(t,[e])}for(var El=0;El<ip.length;El++){var Tl=ip[El],yb=Tl.toLowerCase(),vb=Tl[0].toUpperCase()+Tl.slice(1);ts(yb,"on"+vb)}ts(Q0,"onAnimationEnd");ts(J0,"onAnimationIteration");ts(Z0,"onAnimationStart");ts("dblclick","onDoubleClick");ts("focusin","onFocus");ts("focusout","onBlur");ts(eg,"onTransitionEnd");fr("onMouseEnter",["mouseout","mouseover"]);fr("onMouseLeave",["mouseout","mouseover"]);fr("onPointerEnter",["pointerout","pointerover"]);fr("onPointerLeave",["pointerout","pointerover"]);As("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));As("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));As("onBeforeInput",["compositionend","keypress","textInput","paste"]);As("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));As("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));As("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Qr="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(" "),bb=new Set("cancel close invalid load scroll toggle".split(" ").concat(Qr));function ap(e,t,n){var s=e.type||"unknown-event";e.currentTarget=n,yv(s,t,void 0,e),e.currentTarget=null}function ng(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,d=l.currentTarget;if(l=l.listener,c!==a&&i.isPropagationStopped())break e;ap(i,l,d),a=c}else for(o=0;o<s.length;o++){if(l=s[o],c=l.instance,d=l.currentTarget,l=l.listener,c!==a&&i.isPropagationStopped())break e;ap(i,l,d),a=c}}}if(ro)throw e=Tc,ro=!1,Tc=null,e}function ge(e,t){var n=t[Bc];n===void 0&&(n=t[Bc]=new Set);var s=e+"__bubble";n.has(s)||(sg(t,e,2,!1),n.add(s))}function Pl(e,t,n){var s=0;t&&(s|=4),sg(n,e,s,t)}var ya="_reactListening"+Math.random().toString(36).slice(2);function _i(e){if(!e[ya]){e[ya]=!0,d0.forEach(function(n){n!=="selectionchange"&&(bb.has(n)||Pl(n,!1,e),Pl(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ya]||(t[ya]=!0,Pl("selectionchange",!1,t))}}function sg(e,t,n,s){switch(F0(t)){case 1:var i=Rv;break;case 4:i=Lv;break;default:i=Xd}n=i.bind(null,t,n,e),i=void 0,!Ec||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 Al(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=xs(l),o===null)return;if(c=o.tag,c===5||c===6){s=a=o;continue e}l=l.parentNode}}s=s.return}C0(function(){var d=a,u=Gd(n),p=[];e:{var h=tg.get(e);if(h!==void 0){var m=Jd,y=e;switch(e){case"keypress":if(Va(n)===0)break e;case"keydown":case"keyup":m=Xv;break;case"focusin":y="focus",m=Nl;break;case"focusout":y="blur",m=Nl;break;case"beforeblur":case"afterblur":m=Nl;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=qh;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":m=Iv;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":m=Zv;break;case Q0:case J0:case Z0:m=Vv;break;case eg:m=tb;break;case"scroll":m=Dv;break;case"wheel":m=sb;break;case"copy":case"cut":case"paste":m=Uv;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":m=Xh}var b=(t&4)!==0,v=!b&&e==="scroll",g=b?h!==null?h+"Capture":null:h;b=[];for(var x=d,w;x!==null;){w=x;var j=w.stateNode;if(w.tag===5&&j!==null&&(w=j,g!==null&&(j=wi(x,g),j!=null&&b.push(Ei(x,j,w)))),v)break;x=x.return}0<b.length&&(h=new m(h,y,null,n,u),p.push({event:h,listeners:b}))}}if(!(t&7)){e:{if(h=e==="mouseover"||e==="pointerover",m=e==="mouseout"||e==="pointerout",h&&n!==Cc&&(y=n.relatedTarget||n.fromElement)&&(xs(y)||y[wn]))break e;if((m||h)&&(h=u.window===u?u:(h=u.ownerDocument)?h.defaultView||h.parentWindow:window,m?(y=n.relatedTarget||n.toElement,m=d,y=y?xs(y):null,y!==null&&(v=Ms(y),y!==v||y.tag!==5&&y.tag!==6)&&(y=null)):(m=null,y=d),m!==y)){if(b=qh,j="onMouseLeave",g="onMouseEnter",x="mouse",(e==="pointerout"||e==="pointerover")&&(b=Xh,j="onPointerLeave",g="onPointerEnter",x="pointer"),v=m==null?h:Xs(m),w=y==null?h:Xs(y),h=new b(j,x+"leave",m,n,u),h.target=v,h.relatedTarget=w,j=null,xs(u)===d&&(b=new b(g,x+"enter",y,n,u),b.target=w,b.relatedTarget=v,j=b),v=j,m&&y)t:{for(b=m,g=y,x=0,w=b;w;w=$s(w))x++;for(w=0,j=g;j;j=$s(j))w++;for(;0<x-w;)b=$s(b),x--;for(;0<w-x;)g=$s(g),w--;for(;x--;){if(b===g||g!==null&&b===g.alternate)break t;b=$s(b),g=$s(g)}b=null}else b=null;m!==null&&op(p,h,m,b,!1),y!==null&&v!==null&&op(p,v,y,b,!0)}}e:{if(h=d?Xs(d):window,m=h.nodeName&&h.nodeName.toLowerCase(),m==="select"||m==="input"&&h.type==="file")var k=db;else if(Zh(h))if(G0)k=fb;else{k=hb;var N=ub}else(m=h.nodeName)&&m.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(k=pb);if(k&&(k=k(e,d))){W0(p,k,n,u);break e}N&&N(e,h,d),e==="focusout"&&(N=h._wrapperState)&&N.controlled&&h.type==="number"&&wc(h,"number",h.value)}switch(N=d?Xs(d):window,e){case"focusin":(Zh(N)||N.contentEditable==="true")&&(qs=N,zc=d,oi=null);break;case"focusout":oi=zc=qs=null;break;case"mousedown":Rc=!0;break;case"contextmenu":case"mouseup":case"dragend":Rc=!1,rp(p,n,u);break;case"selectionchange":if(xb)break;case"keydown":case"keyup":rp(p,n,u)}var S;if(eu)e:{switch(e){case"compositionstart":var _="onCompositionStart";break e;case"compositionend":_="onCompositionEnd";break e;case"compositionupdate":_="onCompositionUpdate";break e}_=void 0}else Ks?U0(e,n)&&(_="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(_="onCompositionStart");_&&($0&&n.locale!=="ko"&&(Ks||_!=="onCompositionStart"?_==="onCompositionEnd"&&Ks&&(S=V0()):(On=u,Qd="value"in On?On.value:On.textContent,Ks=!0)),N=co(d,_),0<N.length&&(_=new Yh(_,e,null,n,u),p.push({event:_,listeners:N}),S?_.data=S:(S=H0(n),S!==null&&(_.data=S)))),(S=ib?ab(e,n):ob(e,n))&&(d=co(d,"onBeforeInput"),0<d.length&&(u=new Yh("onBeforeInput","beforeinput",null,n,u),p.push({event:u,listeners:d}),u.data=S))}ng(p,t)})}function Ei(e,t,n){return{instance:e,listener:t,currentTarget:n}}function co(e,t){for(var n=t+"Capture",s=[];e!==null;){var i=e,a=i.stateNode;i.tag===5&&a!==null&&(i=a,a=wi(e,n),a!=null&&s.unshift(Ei(e,a,i)),a=wi(e,t),a!=null&&s.push(Ei(e,a,i))),e=e.return}return s}function $s(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function op(e,t,n,s,i){for(var a=t._reactName,o=[];n!==null&&n!==s;){var l=n,c=l.alternate,d=l.stateNode;if(c!==null&&c===s)break;l.tag===5&&d!==null&&(l=d,i?(c=wi(n,a),c!=null&&o.unshift(Ei(n,c,l))):i||(c=wi(n,a),c!=null&&o.push(Ei(n,c,l)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var wb=/\r\n?/g,kb=/\u0000|\uFFFD/g;function lp(e){return(typeof e=="string"?e:""+e).replace(wb,`
|
|
38
|
-
`).replace(kb,"")}function va(e,t,n){if(t=lp(t),lp(e)!==t&&n)throw Error(F(425))}function uo(){}var Lc=null,Dc=null;function Oc(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 Ic=typeof setTimeout=="function"?setTimeout:void 0,jb=typeof clearTimeout=="function"?clearTimeout:void 0,cp=typeof Promise=="function"?Promise:void 0,Nb=typeof queueMicrotask=="function"?queueMicrotask:typeof cp<"u"?function(e){return cp.resolve(null).then(e).catch(Sb)}:Ic;function Sb(e){setTimeout(function(){throw e})}function Ml(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),Ni(t);return}s--}else n!=="$"&&n!=="$?"&&n!=="$!"||s++;n=i}while(n);Ni(t)}function Un(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 dp(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 Er=Math.random().toString(36).slice(2),Zt="__reactFiber$"+Er,Ti="__reactProps$"+Er,wn="__reactContainer$"+Er,Bc="__reactEvents$"+Er,Cb="__reactListeners$"+Er,_b="__reactHandles$"+Er;function xs(e){var t=e[Zt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[wn]||n[Zt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=dp(e);e!==null;){if(n=e[Zt])return n;e=dp(e)}return t}e=n,n=e.parentNode}return null}function Xi(e){return e=e[Zt]||e[wn],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Xs(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(F(33))}function Fo(e){return e[Ti]||null}var Fc=[],Qs=-1;function ns(e){return{current:e}}function xe(e){0>Qs||(e.current=Fc[Qs],Fc[Qs]=null,Qs--)}function me(e,t){Qs++,Fc[Qs]=e.current,e.current=t}var Qn={},Qe=ns(Qn),dt=ns(!1),Ns=Qn;function mr(e,t){var n=e.type.contextTypes;if(!n)return Qn;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 ut(e){return e=e.childContextTypes,e!=null}function ho(){xe(dt),xe(Qe)}function up(e,t,n){if(Qe.current!==Qn)throw Error(F(168));me(Qe,t),me(dt,n)}function rg(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,uv(e)||"Unknown",i));return Se({},n,s)}function po(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Qn,Ns=Qe.current,me(Qe,e),me(dt,dt.current),!0}function hp(e,t,n){var s=e.stateNode;if(!s)throw Error(F(169));n?(e=rg(e,t,Ns),s.__reactInternalMemoizedMergedChildContext=e,xe(dt),xe(Qe),me(Qe,e)):xe(dt),me(dt,n)}var pn=null,Vo=!1,zl=!1;function ig(e){pn===null?pn=[e]:pn.push(e)}function Eb(e){Vo=!0,ig(e)}function ss(){if(!zl&&pn!==null){zl=!0;var e=0,t=ce;try{var n=pn;for(ce=1;e<n.length;e++){var s=n[e];do s=s(!0);while(s!==null)}pn=null,Vo=!1}catch(i){throw pn!==null&&(pn=pn.slice(e+1)),P0(Kd,ss),i}finally{ce=t,zl=!1}}return null}var Js=[],Zs=0,fo=null,mo=0,St=[],Ct=0,Ss=null,mn=1,gn="";function hs(e,t){Js[Zs++]=mo,Js[Zs++]=fo,fo=e,mo=t}function ag(e,t,n){St[Ct++]=mn,St[Ct++]=gn,St[Ct++]=Ss,Ss=e;var s=mn;e=gn;var i=32-Ht(s)-1;s&=~(1<<i),n+=1;var a=32-Ht(t)+i;if(30<a){var o=i-i%5;a=(s&(1<<o)-1).toString(32),s>>=o,i-=o,mn=1<<32-Ht(t)+i|n<<i|s,gn=a+e}else mn=1<<a|n<<i|s,gn=e}function nu(e){e.return!==null&&(hs(e,1),ag(e,1,0))}function su(e){for(;e===fo;)fo=Js[--Zs],Js[Zs]=null,mo=Js[--Zs],Js[Zs]=null;for(;e===Ss;)Ss=St[--Ct],St[Ct]=null,gn=St[--Ct],St[Ct]=null,mn=St[--Ct],St[Ct]=null}var gt=null,mt=null,be=!1,Ut=null;function og(e,t){var n=Et(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 pp(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,gt=e,mt=Un(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,gt=e,mt=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Ss!==null?{id:mn,overflow:gn}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Et(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,gt=e,mt=null,!0):!1;default:return!1}}function Vc(e){return(e.mode&1)!==0&&(e.flags&128)===0}function $c(e){if(be){var t=mt;if(t){var n=t;if(!pp(e,t)){if(Vc(e))throw Error(F(418));t=Un(n.nextSibling);var s=gt;t&&pp(e,t)?og(s,n):(e.flags=e.flags&-4097|2,be=!1,gt=e)}}else{if(Vc(e))throw Error(F(418));e.flags=e.flags&-4097|2,be=!1,gt=e}}}function fp(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;gt=e}function ba(e){if(e!==gt)return!1;if(!be)return fp(e),be=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Oc(e.type,e.memoizedProps)),t&&(t=mt)){if(Vc(e))throw lg(),Error(F(418));for(;t;)og(e,t),t=Un(t.nextSibling)}if(fp(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){mt=Un(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}mt=null}}else mt=gt?Un(e.stateNode.nextSibling):null;return!0}function lg(){for(var e=mt;e;)e=Un(e.nextSibling)}function gr(){mt=gt=null,be=!1}function ru(e){Ut===null?Ut=[e]:Ut.push(e)}var Tb=Cn.ReactCurrentBatchConfig;function $r(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 wa(e,t){throw e=Object.prototype.toString.call(t),Error(F(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function mp(e){var t=e._init;return t(e._payload)}function cg(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=Kn(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=Fl(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===Gs?u(g,x,w.props.children,j,w.key):x!==null&&(x.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===zn&&mp(k)===x.type)?(j=i(x,w.props),j.ref=$r(g,x,w),j.return=g,j):(j=qa(w.type,w.key,w.props,null,g.mode,j),j.ref=$r(g,x,w),j.return=g,j)}function d(g,x,w,j){return x===null||x.tag!==4||x.stateNode.containerInfo!==w.containerInfo||x.stateNode.implementation!==w.implementation?(x=Vl(w,g.mode,j),x.return=g,x):(x=i(x,w.children||[]),x.return=g,x)}function u(g,x,w,j,k){return x===null||x.tag!==7?(x=ks(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=Fl(""+x,g.mode,w),x.return=g,x;if(typeof x=="object"&&x!==null){switch(x.$$typeof){case da:return w=qa(x.type,x.key,x.props,null,g.mode,w),w.ref=$r(g,null,x),w.return=g,w;case Ws:return x=Vl(x,g.mode,w),x.return=g,x;case zn:var j=x._init;return p(g,j(x._payload),w)}if(Yr(x)||Or(x))return x=ks(x,g.mode,w,null),x.return=g,x;wa(g,x)}return null}function h(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 da:return w.key===k?c(g,x,w,j):null;case Ws:return w.key===k?d(g,x,w,j):null;case zn:return k=w._init,h(g,x,k(w._payload),j)}if(Yr(w)||Or(w))return k!==null?null:u(g,x,w,j,null);wa(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 da:return g=g.get(j.key===null?w:j.key)||null,c(x,g,j,k);case Ws:return g=g.get(j.key===null?w:j.key)||null,d(x,g,j,k);case zn:var N=j._init;return m(g,x,w,N(j._payload),k)}if(Yr(j)||Or(j))return g=g.get(w)||null,u(x,g,j,k,null);wa(x,j)}return null}function y(g,x,w,j){for(var k=null,N=null,S=x,_=x=0,A=null;S!==null&&_<w.length;_++){S.index>_?(A=S,S=null):A=S.sibling;var P=h(g,S,w[_],j);if(P===null){S===null&&(S=A);break}e&&S&&P.alternate===null&&t(g,S),x=a(P,x,_),N===null?k=P:N.sibling=P,N=P,S=A}if(_===w.length)return n(g,S),be&&hs(g,_),k;if(S===null){for(;_<w.length;_++)S=p(g,w[_],j),S!==null&&(x=a(S,x,_),N===null?k=S:N.sibling=S,N=S);return be&&hs(g,_),k}for(S=s(g,S);_<w.length;_++)A=m(S,g,_,w[_],j),A!==null&&(e&&A.alternate!==null&&S.delete(A.key===null?_:A.key),x=a(A,x,_),N===null?k=A:N.sibling=A,N=A);return e&&S.forEach(function(T){return t(g,T)}),be&&hs(g,_),k}function b(g,x,w,j){var k=Or(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,_=x=0,A=null,P=w.next();S!==null&&!P.done;_++,P=w.next()){S.index>_?(A=S,S=null):A=S.sibling;var T=h(g,S,P.value,j);if(T===null){S===null&&(S=A);break}e&&S&&T.alternate===null&&t(g,S),x=a(T,x,_),N===null?k=T:N.sibling=T,N=T,S=A}if(P.done)return n(g,S),be&&hs(g,_),k;if(S===null){for(;!P.done;_++,P=w.next())P=p(g,P.value,j),P!==null&&(x=a(P,x,_),N===null?k=P:N.sibling=P,N=P);return be&&hs(g,_),k}for(S=s(g,S);!P.done;_++,P=w.next())P=m(S,g,_,P.value,j),P!==null&&(e&&P.alternate!==null&&S.delete(P.key===null?_:P.key),x=a(P,x,_),N===null?k=P:N.sibling=P,N=P);return e&&S.forEach(function(V){return t(g,V)}),be&&hs(g,_),k}function v(g,x,w,j){if(typeof w=="object"&&w!==null&&w.type===Gs&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case da:e:{for(var k=w.key,N=x;N!==null;){if(N.key===k){if(k=w.type,k===Gs){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===zn&&mp(k)===N.type){n(g,N.sibling),x=i(N,w.props),x.ref=$r(g,N,w),x.return=g,g=x;break e}n(g,N);break}else t(g,N);N=N.sibling}w.type===Gs?(x=ks(w.props.children,g.mode,j,w.key),x.return=g,g=x):(j=qa(w.type,w.key,w.props,null,g.mode,j),j.ref=$r(g,x,w),j.return=g,g=j)}return o(g);case Ws: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=Vl(w,g.mode,j),x.return=g,g=x}return o(g);case zn:return N=w._init,v(g,x,N(w._payload),j)}if(Yr(w))return y(g,x,w,j);if(Or(w))return b(g,x,w,j);wa(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=Fl(w,g.mode,j),x.return=g,g=x),o(g)):n(g,x)}return v}var xr=cg(!0),dg=cg(!1),go=ns(null),xo=null,er=null,iu=null;function au(){iu=er=xo=null}function ou(e){var t=go.current;xe(go),e._currentValue=t}function Uc(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 hr(e,t){xo=e,iu=er=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(ct=!0),e.firstContext=null)}function Pt(e){var t=e._currentValue;if(iu!==e)if(e={context:e,memoizedValue:t,next:null},er===null){if(xo===null)throw Error(F(308));er=e,xo.dependencies={lanes:0,firstContext:e}}else er=er.next=e;return t}var ys=null;function lu(e){ys===null?ys=[e]:ys.push(e)}function ug(e,t,n,s){var i=t.interleaved;return i===null?(n.next=n,lu(t)):(n.next=i.next,i.next=n),t.interleaved=n,kn(e,s)}function kn(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 Rn=!1;function cu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function hg(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 xn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Hn(e,t,n){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,oe&2){var i=s.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),s.pending=t,kn(e,n)}return i=s.interleaved,i===null?(t.next=t,lu(s)):(t.next=i.next,i.next=t),s.interleaved=t,kn(e,n)}function $a(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,qd(e,n)}}function gp(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 yo(e,t,n,s){var i=e.updateQueue;Rn=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,l=i.shared.pending;if(l!==null){i.shared.pending=null;var c=l,d=c.next;c.next=null,o===null?a=d:o.next=d,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,l=u.lastBaseUpdate,l!==o&&(l===null?u.firstBaseUpdate=d:l.next=d,u.lastBaseUpdate=c))}if(a!==null){var p=i.baseState;o=0,u=d=c=null,l=a;do{var h=l.lane,m=l.eventTime;if((s&h)===h){u!==null&&(u=u.next={eventTime:m,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var y=e,b=l;switch(h=t,m=n,b.tag){case 1:if(y=b.payload,typeof y=="function"){p=y.call(m,p,h);break e}p=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=b.payload,h=typeof y=="function"?y.call(m,p,h):y,h==null)break e;p=Se({},p,h);break e;case 2:Rn=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,h=i.effects,h===null?i.effects=[l]:h.push(l))}else m={eventTime:m,lane:h,tag:l.tag,payload:l.payload,callback:l.callback,next:null},u===null?(d=u=m,c=p):u=u.next=m,o|=h;if(l=l.next,l===null){if(l=i.shared.pending,l===null)break;h=l,l=h.next,h.next=null,i.lastBaseUpdate=h,i.shared.pending=null}}while(!0);if(u===null&&(c=p),i.baseState=c,i.firstBaseUpdate=d,i.lastBaseUpdate=u,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);_s|=o,e.lanes=o,e.memoizedState=p}}function xp(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 Qi={},nn=ns(Qi),Pi=ns(Qi),Ai=ns(Qi);function vs(e){if(e===Qi)throw Error(F(174));return e}function du(e,t){switch(me(Ai,t),me(Pi,e),me(nn,Qi),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:jc(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=jc(t,e)}xe(nn),me(nn,t)}function yr(){xe(nn),xe(Pi),xe(Ai)}function pg(e){vs(Ai.current);var t=vs(nn.current),n=jc(t,e.type);t!==n&&(me(Pi,e),me(nn,n))}function uu(e){Pi.current===e&&(xe(nn),xe(Pi))}var ke=ns(0);function vo(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 Rl=[];function hu(){for(var e=0;e<Rl.length;e++)Rl[e]._workInProgressVersionPrimary=null;Rl.length=0}var Ua=Cn.ReactCurrentDispatcher,Ll=Cn.ReactCurrentBatchConfig,Cs=0,Ne=null,Le=null,Ie=null,bo=!1,li=!1,Mi=0,Pb=0;function He(){throw Error(F(321))}function pu(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Gt(e[n],t[n]))return!1;return!0}function fu(e,t,n,s,i,a){if(Cs=a,Ne=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Ua.current=e===null||e.memoizedState===null?Rb:Lb,e=n(s,i),li){a=0;do{if(li=!1,Mi=0,25<=a)throw Error(F(301));a+=1,Ie=Le=null,t.updateQueue=null,Ua.current=Db,e=n(s,i)}while(li)}if(Ua.current=wo,t=Le!==null&&Le.next!==null,Cs=0,Ie=Le=Ne=null,bo=!1,t)throw Error(F(300));return e}function mu(){var e=Mi!==0;return Mi=0,e}function Jt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ie===null?Ne.memoizedState=Ie=e:Ie=Ie.next=e,Ie}function At(){if(Le===null){var e=Ne.alternate;e=e!==null?e.memoizedState:null}else e=Le.next;var t=Ie===null?Ne.memoizedState:Ie.next;if(t!==null)Ie=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},Ie===null?Ne.memoizedState=Ie=e:Ie=Ie.next=e}return Ie}function zi(e,t){return typeof t=="function"?t(e):t}function Dl(e){var t=At(),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,d=a;do{var u=d.lane;if((Cs&u)===u)c!==null&&(c=c.next={lane:0,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null}),s=d.hasEagerState?d.eagerState:e(s,d.action);else{var p={lane:u,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null};c===null?(l=c=p,o=s):c=c.next=p,Ne.lanes|=u,_s|=u}d=d.next}while(d!==null&&d!==a);c===null?o=s:c.next=l,Gt(s,t.memoizedState)||(ct=!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,_s|=a,i=i.next;while(i!==e)}else i===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Ol(e){var t=At(),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);Gt(a,t.memoizedState)||(ct=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),n.lastRenderedState=a}return[a,s]}function fg(){}function mg(e,t){var n=Ne,s=At(),i=t(),a=!Gt(s.memoizedState,i);if(a&&(s.memoizedState=i,ct=!0),s=s.queue,gu(yg.bind(null,n,s,e),[e]),s.getSnapshot!==t||a||Ie!==null&&Ie.memoizedState.tag&1){if(n.flags|=2048,Ri(9,xg.bind(null,n,s,i,t),void 0,null),Be===null)throw Error(F(349));Cs&30||gg(n,t,i)}return i}function gg(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 xg(e,t,n,s){t.value=n,t.getSnapshot=s,vg(t)&&bg(e)}function yg(e,t,n){return n(function(){vg(t)&&bg(e)})}function vg(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Gt(e,n)}catch{return!0}}function bg(e){var t=kn(e,1);t!==null&&Wt(t,e,1,-1)}function yp(e){var t=Jt();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:zi,lastRenderedState:e},t.queue=e,e=e.dispatch=zb.bind(null,Ne,e),[t.memoizedState,e]}function Ri(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 wg(){return At().memoizedState}function Ha(e,t,n,s){var i=Jt();Ne.flags|=e,i.memoizedState=Ri(1|t,n,void 0,s===void 0?null:s)}function $o(e,t,n,s){var i=At();s=s===void 0?null:s;var a=void 0;if(Le!==null){var o=Le.memoizedState;if(a=o.destroy,s!==null&&pu(s,o.deps)){i.memoizedState=Ri(t,n,a,s);return}}Ne.flags|=e,i.memoizedState=Ri(1|t,n,a,s)}function vp(e,t){return Ha(8390656,8,e,t)}function gu(e,t){return $o(2048,8,e,t)}function kg(e,t){return $o(4,2,e,t)}function jg(e,t){return $o(4,4,e,t)}function Ng(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 Sg(e,t,n){return n=n!=null?n.concat([e]):null,$o(4,4,Ng.bind(null,t,e),n)}function xu(){}function Cg(e,t){var n=At();t=t===void 0?null:t;var s=n.memoizedState;return s!==null&&t!==null&&pu(t,s[1])?s[0]:(n.memoizedState=[e,t],e)}function _g(e,t){var n=At();t=t===void 0?null:t;var s=n.memoizedState;return s!==null&&t!==null&&pu(t,s[1])?s[0]:(e=e(),n.memoizedState=[e,t],e)}function Eg(e,t,n){return Cs&21?(Gt(n,t)||(n=z0(),Ne.lanes|=n,_s|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,ct=!0),e.memoizedState=n)}function Ab(e,t){var n=ce;ce=n!==0&&4>n?n:4,e(!0);var s=Ll.transition;Ll.transition={};try{e(!1),t()}finally{ce=n,Ll.transition=s}}function Tg(){return At().memoizedState}function Mb(e,t,n){var s=Gn(e);if(n={lane:s,action:n,hasEagerState:!1,eagerState:null,next:null},Pg(e))Ag(t,n);else if(n=ug(e,t,n,s),n!==null){var i=nt();Wt(n,e,s,i),Mg(n,t,s)}}function zb(e,t,n){var s=Gn(e),i={lane:s,action:n,hasEagerState:!1,eagerState:null,next:null};if(Pg(e))Ag(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,Gt(l,o)){var c=t.interleaved;c===null?(i.next=i,lu(t)):(i.next=c.next,c.next=i),t.interleaved=i;return}}catch{}finally{}n=ug(e,t,i,s),n!==null&&(i=nt(),Wt(n,e,s,i),Mg(n,t,s))}}function Pg(e){var t=e.alternate;return e===Ne||t!==null&&t===Ne}function Ag(e,t){li=bo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Mg(e,t,n){if(n&4194240){var s=t.lanes;s&=e.pendingLanes,n|=s,t.lanes=n,qd(e,n)}}var wo={readContext:Pt,useCallback:He,useContext:He,useEffect:He,useImperativeHandle:He,useInsertionEffect:He,useLayoutEffect:He,useMemo:He,useReducer:He,useRef:He,useState:He,useDebugValue:He,useDeferredValue:He,useTransition:He,useMutableSource:He,useSyncExternalStore:He,useId:He,unstable_isNewReconciler:!1},Rb={readContext:Pt,useCallback:function(e,t){return Jt().memoizedState=[e,t===void 0?null:t],e},useContext:Pt,useEffect:vp,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Ha(4194308,4,Ng.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ha(4194308,4,e,t)},useInsertionEffect:function(e,t){return Ha(4,2,e,t)},useMemo:function(e,t){var n=Jt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var s=Jt();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=Mb.bind(null,Ne,e),[s.memoizedState,e]},useRef:function(e){var t=Jt();return e={current:e},t.memoizedState=e},useState:yp,useDebugValue:xu,useDeferredValue:function(e){return Jt().memoizedState=e},useTransition:function(){var e=yp(!1),t=e[0];return e=Ab.bind(null,e[1]),Jt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var s=Ne,i=Jt();if(be){if(n===void 0)throw Error(F(407));n=n()}else{if(n=t(),Be===null)throw Error(F(349));Cs&30||gg(s,t,n)}i.memoizedState=n;var a={value:n,getSnapshot:t};return i.queue=a,vp(yg.bind(null,s,a,e),[e]),s.flags|=2048,Ri(9,xg.bind(null,s,a,n,t),void 0,null),n},useId:function(){var e=Jt(),t=Be.identifierPrefix;if(be){var n=gn,s=mn;n=(s&~(1<<32-Ht(s)-1)).toString(32)+n,t=":"+t+"R"+n,n=Mi++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=Pb++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Lb={readContext:Pt,useCallback:Cg,useContext:Pt,useEffect:gu,useImperativeHandle:Sg,useInsertionEffect:kg,useLayoutEffect:jg,useMemo:_g,useReducer:Dl,useRef:wg,useState:function(){return Dl(zi)},useDebugValue:xu,useDeferredValue:function(e){var t=At();return Eg(t,Le.memoizedState,e)},useTransition:function(){var e=Dl(zi)[0],t=At().memoizedState;return[e,t]},useMutableSource:fg,useSyncExternalStore:mg,useId:Tg,unstable_isNewReconciler:!1},Db={readContext:Pt,useCallback:Cg,useContext:Pt,useEffect:gu,useImperativeHandle:Sg,useInsertionEffect:kg,useLayoutEffect:jg,useMemo:_g,useReducer:Ol,useRef:wg,useState:function(){return Ol(zi)},useDebugValue:xu,useDeferredValue:function(e){var t=At();return Le===null?t.memoizedState=e:Eg(t,Le.memoizedState,e)},useTransition:function(){var e=Ol(zi)[0],t=At().memoizedState;return[e,t]},useMutableSource:fg,useSyncExternalStore:mg,useId:Tg,unstable_isNewReconciler:!1};function Ft(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 Hc(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 Uo={isMounted:function(e){return(e=e._reactInternals)?Ms(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var s=nt(),i=Gn(e),a=xn(s,i);a.payload=t,n!=null&&(a.callback=n),t=Hn(e,a,i),t!==null&&(Wt(t,e,i,s),$a(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var s=nt(),i=Gn(e),a=xn(s,i);a.tag=1,a.payload=t,n!=null&&(a.callback=n),t=Hn(e,a,i),t!==null&&(Wt(t,e,i,s),$a(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=nt(),s=Gn(e),i=xn(n,s);i.tag=2,t!=null&&(i.callback=t),t=Hn(e,i,s),t!==null&&(Wt(t,e,s,n),$a(t,e,s))}};function bp(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?!Ci(n,s)||!Ci(i,a):!0}function zg(e,t,n){var s=!1,i=Qn,a=t.contextType;return typeof a=="object"&&a!==null?a=Pt(a):(i=ut(t)?Ns:Qe.current,s=t.contextTypes,a=(s=s!=null)?mr(e,i):Qn),t=new t(n,a),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Uo,e.stateNode=t,t._reactInternals=e,s&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=a),t}function wp(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&&Uo.enqueueReplaceState(t,t.state,null)}function Wc(e,t,n,s){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},cu(e);var a=t.contextType;typeof a=="object"&&a!==null?i.context=Pt(a):(a=ut(t)?Ns:Qe.current,i.context=mr(e,a)),i.state=e.memoizedState,a=t.getDerivedStateFromProps,typeof a=="function"&&(Hc(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&&Uo.enqueueReplaceState(i,i.state,null),yo(e,n,i,s),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function vr(e,t){try{var n="",s=t;do n+=dv(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{yl=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?qr(e):""}function cv(e){switch(e.tag){case 5:return qr(e.type);case 16:return qr("Lazy");case 13:return qr("Suspense");case 19:return qr("SuspenseList");case 0:case 2:case 15:return e=vl(e.type,!1),e;case 11:return e=vl(e.type.render,!1),e;case 1:return e=vl(e.type,!0),e;default:return""}}function yc(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 Gs:return"Fragment";case Ws:return"Portal";case mc:return"Profiler";case Ud:return"StrictMode";case gc:return"Suspense";case xc:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case u0:return(e.displayName||"Context")+".Consumer";case d0:return(e._context.displayName||"Context")+".Provider";case Hd:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Wd:return t=e.displayName||null,t!==null?t:yc(e.type)||"Memo";case zn:t=e._payload,e=e._init;try{return yc(e(t))}catch{}}return null}function dv(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 yc(t);case 8:return t===Ud?"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 Xn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function p0(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function uv(e){var t=p0(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 ua(e){e._valueTracker||(e._valueTracker=uv(e))}function f0(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),s="";return e&&(s=p0(e)?e.checked?"true":"false":e.value),e=s,e!==n?(t.setValue(e),!0):!1}function no(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 vc(e,t){var n=t.checked;return Se({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Ih(e,t){var n=t.defaultValue==null?"":t.defaultValue,s=t.checked!=null?t.checked:t.defaultChecked;n=Xn(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 m0(e,t){t=t.checked,t!=null&&$d(e,"checked",t,!1)}function bc(e,t){m0(e,t);var n=Xn(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")?wc(e,t.type,n):t.hasOwnProperty("defaultValue")&&wc(e,t.type,Xn(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Bh(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 wc(e,t,n){(t!=="number"||no(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Yr=Array.isArray;function lr(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=""+Xn(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 kc(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(F(91));return Se({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Fh(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(Yr(n)){if(1<n.length)throw Error(F(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Xn(n)}}function g0(e,t){var n=Xn(t.value),s=Xn(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 Vh(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function x0(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 jc(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?x0(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var ha,y0=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(ha=ha||document.createElement("div"),ha.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=ha.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function bi(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var si={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},hv=["Webkit","ms","Moz","O"];Object.keys(si).forEach(function(e){hv.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),si[t]=si[e]})});function v0(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||si.hasOwnProperty(e)&&si[e]?(""+t).trim():t+"px"}function b0(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var s=n.indexOf("--")===0,i=v0(n,t[n],s);n==="float"&&(n="cssFloat"),s?e.setProperty(n,i):e[n]=i}}var pv=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 Nc(e,t){if(t){if(pv[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 Sc(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 Cc=null;function Gd(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var _c=null,cr=null,dr=null;function $h(e){if(e=Xi(e)){if(typeof _c!="function")throw Error(F(280));var t=e.stateNode;t&&(t=Fo(t),_c(e.stateNode,e.type,t))}}function w0(e){cr?dr?dr.push(e):dr=[e]:cr=e}function k0(){if(cr){var e=cr,t=dr;if(dr=cr=null,$h(e),t)for(e=0;e<t.length;e++)$h(t[e])}}function j0(e,t){return e(t)}function N0(){}var bl=!1;function S0(e,t,n){if(bl)return e(t,n);bl=!0;try{return j0(e,t,n)}finally{bl=!1,(cr!==null||dr!==null)&&(N0(),k0())}}function wi(e,t){var n=e.stateNode;if(n===null)return null;var s=Fo(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 Ec=!1;if(bn)try{var Ir={};Object.defineProperty(Ir,"passive",{get:function(){Ec=!0}}),window.addEventListener("test",Ir,Ir),window.removeEventListener("test",Ir,Ir)}catch{Ec=!1}function fv(e,t,n,s,i,a,o,l,c){var d=Array.prototype.slice.call(arguments,3);try{t.apply(n,d)}catch(u){this.onError(u)}}var ri=!1,so=null,ro=!1,Tc=null,mv={onError:function(e){ri=!0,so=e}};function gv(e,t,n,s,i,a,o,l,c){ri=!1,so=null,fv.apply(mv,arguments)}function xv(e,t,n,s,i,a,o,l,c){if(gv.apply(this,arguments),ri){if(ri){var d=so;ri=!1,so=null}else throw Error(F(198));ro||(ro=!0,Tc=d)}}function Ms(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 C0(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 Uh(e){if(Ms(e)!==e)throw Error(F(188))}function yv(e){var t=e.alternate;if(!t){if(t=Ms(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 Uh(i),e;if(a===s)return Uh(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 _0(e){return e=yv(e),e!==null?E0(e):null}function E0(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=E0(e);if(t!==null)return t;e=e.sibling}return null}var T0=yt.unstable_scheduleCallback,Hh=yt.unstable_cancelCallback,vv=yt.unstable_shouldYield,bv=yt.unstable_requestPaint,Pe=yt.unstable_now,wv=yt.unstable_getCurrentPriorityLevel,Kd=yt.unstable_ImmediatePriority,P0=yt.unstable_UserBlockingPriority,io=yt.unstable_NormalPriority,kv=yt.unstable_LowPriority,A0=yt.unstable_IdlePriority,Do=null,tn=null;function jv(e){if(tn&&typeof tn.onCommitFiberRoot=="function")try{tn.onCommitFiberRoot(Do,e,void 0,(e.current.flags&128)===128)}catch{}}var Ht=Math.clz32?Math.clz32:Cv,Nv=Math.log,Sv=Math.LN2;function Cv(e){return e>>>=0,e===0?32:31-(Nv(e)/Sv|0)|0}var pa=64,fa=4194304;function Xr(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 ao(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=Xr(l):(a&=o,a!==0&&(s=Xr(a)))}else o=n&~i,o!==0?s=Xr(o):a!==0&&(s=Xr(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-Ht(t),i=1<<n,s|=e[n],t&=~i;return s}function _v(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 Ev(e,t){for(var n=e.suspendedLanes,s=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes;0<a;){var o=31-Ht(a),l=1<<o,c=i[o];c===-1?(!(l&n)||l&s)&&(i[o]=_v(l,t)):c<=t&&(e.expiredLanes|=l),a&=~l}}function Pc(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function M0(){var e=pa;return pa<<=1,!(pa&4194240)&&(pa=64),e}function wl(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function qi(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Ht(t),e[t]=n}function Tv(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-Ht(n),a=1<<i;t[i]=0,s[i]=-1,e[i]=-1,n&=~a}}function qd(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var s=31-Ht(n),i=1<<s;i&t|e[s]&t&&(e[s]|=t),n&=~i}}var ce=0;function z0(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var R0,Yd,L0,D0,O0,Ac=!1,ma=[],Fn=null,Vn=null,$n=null,ki=new Map,ji=new Map,Ln=[],Pv="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 Wh(e,t){switch(e){case"focusin":case"focusout":Fn=null;break;case"dragenter":case"dragleave":Vn=null;break;case"mouseover":case"mouseout":$n=null;break;case"pointerover":case"pointerout":ki.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ji.delete(t.pointerId)}}function Br(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=Xi(t),t!==null&&Yd(t)),e):(e.eventSystemFlags|=s,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Av(e,t,n,s,i){switch(t){case"focusin":return Fn=Br(Fn,e,t,n,s,i),!0;case"dragenter":return Vn=Br(Vn,e,t,n,s,i),!0;case"mouseover":return $n=Br($n,e,t,n,s,i),!0;case"pointerover":var a=i.pointerId;return ki.set(a,Br(ki.get(a)||null,e,t,n,s,i)),!0;case"gotpointercapture":return a=i.pointerId,ji.set(a,Br(ji.get(a)||null,e,t,n,s,i)),!0}return!1}function I0(e){var t=xs(e.target);if(t!==null){var n=Ms(t);if(n!==null){if(t=n.tag,t===13){if(t=C0(n),t!==null){e.blockedOn=t,O0(e.priority,function(){L0(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 Ba(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Mc(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var s=new n.constructor(n.type,n);Cc=s,n.target.dispatchEvent(s),Cc=null}else return t=Xi(n),t!==null&&Yd(t),e.blockedOn=n,!1;t.shift()}return!0}function Gh(e,t,n){Ba(e)&&n.delete(t)}function Mv(){Ac=!1,Fn!==null&&Ba(Fn)&&(Fn=null),Vn!==null&&Ba(Vn)&&(Vn=null),$n!==null&&Ba($n)&&($n=null),ki.forEach(Gh),ji.forEach(Gh)}function Fr(e,t){e.blockedOn===t&&(e.blockedOn=null,Ac||(Ac=!0,yt.unstable_scheduleCallback(yt.unstable_NormalPriority,Mv)))}function Ni(e){function t(i){return Fr(i,e)}if(0<ma.length){Fr(ma[0],e);for(var n=1;n<ma.length;n++){var s=ma[n];s.blockedOn===e&&(s.blockedOn=null)}}for(Fn!==null&&Fr(Fn,e),Vn!==null&&Fr(Vn,e),$n!==null&&Fr($n,e),ki.forEach(t),ji.forEach(t),n=0;n<Ln.length;n++)s=Ln[n],s.blockedOn===e&&(s.blockedOn=null);for(;0<Ln.length&&(n=Ln[0],n.blockedOn===null);)I0(n),n.blockedOn===null&&Ln.shift()}var ur=Cn.ReactCurrentBatchConfig,oo=!0;function zv(e,t,n,s){var i=ce,a=ur.transition;ur.transition=null;try{ce=1,Xd(e,t,n,s)}finally{ce=i,ur.transition=a}}function Rv(e,t,n,s){var i=ce,a=ur.transition;ur.transition=null;try{ce=4,Xd(e,t,n,s)}finally{ce=i,ur.transition=a}}function Xd(e,t,n,s){if(oo){var i=Mc(e,t,n,s);if(i===null)Al(e,t,s,lo,n),Wh(e,s);else if(Av(i,e,t,n,s))s.stopPropagation();else if(Wh(e,s),t&4&&-1<Pv.indexOf(e)){for(;i!==null;){var a=Xi(i);if(a!==null&&R0(a),a=Mc(e,t,n,s),a===null&&Al(e,t,s,lo,n),a===i)break;i=a}i!==null&&s.stopPropagation()}else Al(e,t,s,null,n)}}var lo=null;function Mc(e,t,n,s){if(lo=null,e=Gd(s),e=xs(e),e!==null)if(t=Ms(e),t===null)e=null;else if(n=t.tag,n===13){if(e=C0(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 lo=e,null}function B0(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(wv()){case Kd:return 1;case P0:return 4;case io:case kv:return 16;case A0:return 536870912;default:return 16}default:return 16}}var On=null,Qd=null,Fa=null;function F0(){if(Fa)return Fa;var e,t=Qd,n=t.length,s,i="value"in On?On.value:On.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 Fa=i.slice(e,1<s?1-s:void 0)}function Va(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 ga(){return!0}function Kh(){return!1}function wt(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)?ga:Kh,this.isPropagationStopped=Kh,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=ga)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=ga)},persist:function(){},isPersistent:ga}),t}var _r={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Jd=wt(_r),Yi=Se({},_r,{view:0,detail:0}),Lv=wt(Yi),kl,jl,Vr,Oo=Se({},Yi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Zd,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!==Vr&&(Vr&&e.type==="mousemove"?(kl=e.screenX-Vr.screenX,jl=e.screenY-Vr.screenY):jl=kl=0,Vr=e),kl)},movementY:function(e){return"movementY"in e?e.movementY:jl}}),qh=wt(Oo),Dv=Se({},Oo,{dataTransfer:0}),Ov=wt(Dv),Iv=Se({},Yi,{relatedTarget:0}),Nl=wt(Iv),Bv=Se({},_r,{animationName:0,elapsedTime:0,pseudoElement:0}),Fv=wt(Bv),Vv=Se({},_r,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),$v=wt(Vv),Uv=Se({},_r,{data:0}),Yh=wt(Uv),Hv={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Wv={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"},Gv={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Kv(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Gv[e])?!!t[e]:!1}function Zd(){return Kv}var qv=Se({},Yi,{key:function(e){if(e.key){var t=Hv[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Va(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Wv[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Zd,charCode:function(e){return e.type==="keypress"?Va(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Va(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Yv=wt(qv),Xv=Se({},Oo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Xh=wt(Xv),Qv=Se({},Yi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Zd}),Jv=wt(Qv),Zv=Se({},_r,{propertyName:0,elapsedTime:0,pseudoElement:0}),eb=wt(Zv),tb=Se({},Oo,{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}),nb=wt(tb),sb=[9,13,27,32],eu=bn&&"CompositionEvent"in window,ii=null;bn&&"documentMode"in document&&(ii=document.documentMode);var rb=bn&&"TextEvent"in window&&!ii,V0=bn&&(!eu||ii&&8<ii&&11>=ii),Qh=" ",Jh=!1;function $0(e,t){switch(e){case"keyup":return sb.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function U0(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ks=!1;function ib(e,t){switch(e){case"compositionend":return U0(t);case"keypress":return t.which!==32?null:(Jh=!0,Qh);case"textInput":return e=t.data,e===Qh&&Jh?null:e;default:return null}}function ab(e,t){if(Ks)return e==="compositionend"||!eu&&$0(e,t)?(e=F0(),Fa=Qd=On=null,Ks=!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 V0&&t.locale!=="ko"?null:t.data;default:return null}}var ob={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 Zh(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!ob[e.type]:t==="textarea"}function H0(e,t,n,s){w0(s),t=co(t,"onChange"),0<t.length&&(n=new Jd("onChange","change",null,n,s),e.push({event:n,listeners:t}))}var ai=null,Si=null;function lb(e){tg(e,0)}function Io(e){var t=Xs(e);if(f0(t))return e}function cb(e,t){if(e==="change")return t}var W0=!1;if(bn){var Sl;if(bn){var Cl="oninput"in document;if(!Cl){var ep=document.createElement("div");ep.setAttribute("oninput","return;"),Cl=typeof ep.oninput=="function"}Sl=Cl}else Sl=!1;W0=Sl&&(!document.documentMode||9<document.documentMode)}function tp(){ai&&(ai.detachEvent("onpropertychange",G0),Si=ai=null)}function G0(e){if(e.propertyName==="value"&&Io(Si)){var t=[];H0(t,Si,e,Gd(e)),S0(lb,t)}}function db(e,t,n){e==="focusin"?(tp(),ai=t,Si=n,ai.attachEvent("onpropertychange",G0)):e==="focusout"&&tp()}function ub(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Io(Si)}function hb(e,t){if(e==="click")return Io(t)}function pb(e,t){if(e==="input"||e==="change")return Io(t)}function fb(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Gt=typeof Object.is=="function"?Object.is:fb;function Ci(e,t){if(Gt(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(!fc.call(t,i)||!Gt(e[i],t[i]))return!1}return!0}function np(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function sp(e,t){var n=np(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=np(n)}}function K0(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?K0(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function q0(){for(var e=window,t=no();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=no(e.document)}return t}function tu(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 mb(e){var t=q0(),n=e.focusedElem,s=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&K0(n.ownerDocument.documentElement,n)){if(s!==null&&tu(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=sp(n,a);var o=sp(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 gb=bn&&"documentMode"in document&&11>=document.documentMode,qs=null,zc=null,oi=null,Rc=!1;function rp(e,t,n){var s=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Rc||qs==null||qs!==no(s)||(s=qs,"selectionStart"in s&&tu(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}),oi&&Ci(oi,s)||(oi=s,s=co(zc,"onSelect"),0<s.length&&(t=new Jd("onSelect","select",null,t,n),e.push({event:t,listeners:s}),t.target=qs)))}function xa(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Ys={animationend:xa("Animation","AnimationEnd"),animationiteration:xa("Animation","AnimationIteration"),animationstart:xa("Animation","AnimationStart"),transitionend:xa("Transition","TransitionEnd")},_l={},Y0={};bn&&(Y0=document.createElement("div").style,"AnimationEvent"in window||(delete Ys.animationend.animation,delete Ys.animationiteration.animation,delete Ys.animationstart.animation),"TransitionEvent"in window||delete Ys.transitionend.transition);function Bo(e){if(_l[e])return _l[e];if(!Ys[e])return e;var t=Ys[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Y0)return _l[e]=t[n];return e}var X0=Bo("animationend"),Q0=Bo("animationiteration"),J0=Bo("animationstart"),Z0=Bo("transitionend"),eg=new Map,ip="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 ts(e,t){eg.set(e,t),As(t,[e])}for(var El=0;El<ip.length;El++){var Tl=ip[El],xb=Tl.toLowerCase(),yb=Tl[0].toUpperCase()+Tl.slice(1);ts(xb,"on"+yb)}ts(X0,"onAnimationEnd");ts(Q0,"onAnimationIteration");ts(J0,"onAnimationStart");ts("dblclick","onDoubleClick");ts("focusin","onFocus");ts("focusout","onBlur");ts(Z0,"onTransitionEnd");fr("onMouseEnter",["mouseout","mouseover"]);fr("onMouseLeave",["mouseout","mouseover"]);fr("onPointerEnter",["pointerout","pointerover"]);fr("onPointerLeave",["pointerout","pointerover"]);As("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));As("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));As("onBeforeInput",["compositionend","keypress","textInput","paste"]);As("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));As("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));As("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Qr="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(" "),vb=new Set("cancel close invalid load scroll toggle".split(" ").concat(Qr));function ap(e,t,n){var s=e.type||"unknown-event";e.currentTarget=n,xv(s,t,void 0,e),e.currentTarget=null}function tg(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,d=l.currentTarget;if(l=l.listener,c!==a&&i.isPropagationStopped())break e;ap(i,l,d),a=c}else for(o=0;o<s.length;o++){if(l=s[o],c=l.instance,d=l.currentTarget,l=l.listener,c!==a&&i.isPropagationStopped())break e;ap(i,l,d),a=c}}}if(ro)throw e=Tc,ro=!1,Tc=null,e}function ge(e,t){var n=t[Bc];n===void 0&&(n=t[Bc]=new Set);var s=e+"__bubble";n.has(s)||(ng(t,e,2,!1),n.add(s))}function Pl(e,t,n){var s=0;t&&(s|=4),ng(n,e,s,t)}var ya="_reactListening"+Math.random().toString(36).slice(2);function _i(e){if(!e[ya]){e[ya]=!0,c0.forEach(function(n){n!=="selectionchange"&&(vb.has(n)||Pl(n,!1,e),Pl(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ya]||(t[ya]=!0,Pl("selectionchange",!1,t))}}function ng(e,t,n,s){switch(B0(t)){case 1:var i=zv;break;case 4:i=Rv;break;default:i=Xd}n=i.bind(null,t,n,e),i=void 0,!Ec||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 Al(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=xs(l),o===null)return;if(c=o.tag,c===5||c===6){s=a=o;continue e}l=l.parentNode}}s=s.return}S0(function(){var d=a,u=Gd(n),p=[];e:{var h=eg.get(e);if(h!==void 0){var m=Jd,y=e;switch(e){case"keypress":if(Va(n)===0)break e;case"keydown":case"keyup":m=Yv;break;case"focusin":y="focus",m=Nl;break;case"focusout":y="blur",m=Nl;break;case"beforeblur":case"afterblur":m=Nl;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=qh;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":m=Ov;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":m=Jv;break;case X0:case Q0:case J0:m=Fv;break;case Z0:m=eb;break;case"scroll":m=Lv;break;case"wheel":m=nb;break;case"copy":case"cut":case"paste":m=$v;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":m=Xh}var b=(t&4)!==0,v=!b&&e==="scroll",g=b?h!==null?h+"Capture":null:h;b=[];for(var x=d,w;x!==null;){w=x;var j=w.stateNode;if(w.tag===5&&j!==null&&(w=j,g!==null&&(j=wi(x,g),j!=null&&b.push(Ei(x,j,w)))),v)break;x=x.return}0<b.length&&(h=new m(h,y,null,n,u),p.push({event:h,listeners:b}))}}if(!(t&7)){e:{if(h=e==="mouseover"||e==="pointerover",m=e==="mouseout"||e==="pointerout",h&&n!==Cc&&(y=n.relatedTarget||n.fromElement)&&(xs(y)||y[wn]))break e;if((m||h)&&(h=u.window===u?u:(h=u.ownerDocument)?h.defaultView||h.parentWindow:window,m?(y=n.relatedTarget||n.toElement,m=d,y=y?xs(y):null,y!==null&&(v=Ms(y),y!==v||y.tag!==5&&y.tag!==6)&&(y=null)):(m=null,y=d),m!==y)){if(b=qh,j="onMouseLeave",g="onMouseEnter",x="mouse",(e==="pointerout"||e==="pointerover")&&(b=Xh,j="onPointerLeave",g="onPointerEnter",x="pointer"),v=m==null?h:Xs(m),w=y==null?h:Xs(y),h=new b(j,x+"leave",m,n,u),h.target=v,h.relatedTarget=w,j=null,xs(u)===d&&(b=new b(g,x+"enter",y,n,u),b.target=w,b.relatedTarget=v,j=b),v=j,m&&y)t:{for(b=m,g=y,x=0,w=b;w;w=$s(w))x++;for(w=0,j=g;j;j=$s(j))w++;for(;0<x-w;)b=$s(b),x--;for(;0<w-x;)g=$s(g),w--;for(;x--;){if(b===g||g!==null&&b===g.alternate)break t;b=$s(b),g=$s(g)}b=null}else b=null;m!==null&&op(p,h,m,b,!1),y!==null&&v!==null&&op(p,v,y,b,!0)}}e:{if(h=d?Xs(d):window,m=h.nodeName&&h.nodeName.toLowerCase(),m==="select"||m==="input"&&h.type==="file")var k=cb;else if(Zh(h))if(W0)k=pb;else{k=ub;var N=db}else(m=h.nodeName)&&m.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(k=hb);if(k&&(k=k(e,d))){H0(p,k,n,u);break e}N&&N(e,h,d),e==="focusout"&&(N=h._wrapperState)&&N.controlled&&h.type==="number"&&wc(h,"number",h.value)}switch(N=d?Xs(d):window,e){case"focusin":(Zh(N)||N.contentEditable==="true")&&(qs=N,zc=d,oi=null);break;case"focusout":oi=zc=qs=null;break;case"mousedown":Rc=!0;break;case"contextmenu":case"mouseup":case"dragend":Rc=!1,rp(p,n,u);break;case"selectionchange":if(gb)break;case"keydown":case"keyup":rp(p,n,u)}var S;if(eu)e:{switch(e){case"compositionstart":var _="onCompositionStart";break e;case"compositionend":_="onCompositionEnd";break e;case"compositionupdate":_="onCompositionUpdate";break e}_=void 0}else Ks?$0(e,n)&&(_="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(_="onCompositionStart");_&&(V0&&n.locale!=="ko"&&(Ks||_!=="onCompositionStart"?_==="onCompositionEnd"&&Ks&&(S=F0()):(On=u,Qd="value"in On?On.value:On.textContent,Ks=!0)),N=co(d,_),0<N.length&&(_=new Yh(_,e,null,n,u),p.push({event:_,listeners:N}),S?_.data=S:(S=U0(n),S!==null&&(_.data=S)))),(S=rb?ib(e,n):ab(e,n))&&(d=co(d,"onBeforeInput"),0<d.length&&(u=new Yh("onBeforeInput","beforeinput",null,n,u),p.push({event:u,listeners:d}),u.data=S))}tg(p,t)})}function Ei(e,t,n){return{instance:e,listener:t,currentTarget:n}}function co(e,t){for(var n=t+"Capture",s=[];e!==null;){var i=e,a=i.stateNode;i.tag===5&&a!==null&&(i=a,a=wi(e,n),a!=null&&s.unshift(Ei(e,a,i)),a=wi(e,t),a!=null&&s.push(Ei(e,a,i))),e=e.return}return s}function $s(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function op(e,t,n,s,i){for(var a=t._reactName,o=[];n!==null&&n!==s;){var l=n,c=l.alternate,d=l.stateNode;if(c!==null&&c===s)break;l.tag===5&&d!==null&&(l=d,i?(c=wi(n,a),c!=null&&o.unshift(Ei(n,c,l))):i||(c=wi(n,a),c!=null&&o.push(Ei(n,c,l)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var bb=/\r\n?/g,wb=/\u0000|\uFFFD/g;function lp(e){return(typeof e=="string"?e:""+e).replace(bb,`
|
|
38
|
+
`).replace(wb,"")}function va(e,t,n){if(t=lp(t),lp(e)!==t&&n)throw Error(F(425))}function uo(){}var Lc=null,Dc=null;function Oc(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 Ic=typeof setTimeout=="function"?setTimeout:void 0,kb=typeof clearTimeout=="function"?clearTimeout:void 0,cp=typeof Promise=="function"?Promise:void 0,jb=typeof queueMicrotask=="function"?queueMicrotask:typeof cp<"u"?function(e){return cp.resolve(null).then(e).catch(Nb)}:Ic;function Nb(e){setTimeout(function(){throw e})}function Ml(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),Ni(t);return}s--}else n!=="$"&&n!=="$?"&&n!=="$!"||s++;n=i}while(n);Ni(t)}function Un(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 dp(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 Er=Math.random().toString(36).slice(2),Zt="__reactFiber$"+Er,Ti="__reactProps$"+Er,wn="__reactContainer$"+Er,Bc="__reactEvents$"+Er,Sb="__reactListeners$"+Er,Cb="__reactHandles$"+Er;function xs(e){var t=e[Zt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[wn]||n[Zt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=dp(e);e!==null;){if(n=e[Zt])return n;e=dp(e)}return t}e=n,n=e.parentNode}return null}function Xi(e){return e=e[Zt]||e[wn],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Xs(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(F(33))}function Fo(e){return e[Ti]||null}var Fc=[],Qs=-1;function ns(e){return{current:e}}function xe(e){0>Qs||(e.current=Fc[Qs],Fc[Qs]=null,Qs--)}function me(e,t){Qs++,Fc[Qs]=e.current,e.current=t}var Qn={},Qe=ns(Qn),dt=ns(!1),Ns=Qn;function mr(e,t){var n=e.type.contextTypes;if(!n)return Qn;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 ut(e){return e=e.childContextTypes,e!=null}function ho(){xe(dt),xe(Qe)}function up(e,t,n){if(Qe.current!==Qn)throw Error(F(168));me(Qe,t),me(dt,n)}function sg(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,dv(e)||"Unknown",i));return Se({},n,s)}function po(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Qn,Ns=Qe.current,me(Qe,e),me(dt,dt.current),!0}function hp(e,t,n){var s=e.stateNode;if(!s)throw Error(F(169));n?(e=sg(e,t,Ns),s.__reactInternalMemoizedMergedChildContext=e,xe(dt),xe(Qe),me(Qe,e)):xe(dt),me(dt,n)}var pn=null,Vo=!1,zl=!1;function rg(e){pn===null?pn=[e]:pn.push(e)}function _b(e){Vo=!0,rg(e)}function ss(){if(!zl&&pn!==null){zl=!0;var e=0,t=ce;try{var n=pn;for(ce=1;e<n.length;e++){var s=n[e];do s=s(!0);while(s!==null)}pn=null,Vo=!1}catch(i){throw pn!==null&&(pn=pn.slice(e+1)),T0(Kd,ss),i}finally{ce=t,zl=!1}}return null}var Js=[],Zs=0,fo=null,mo=0,St=[],Ct=0,Ss=null,mn=1,gn="";function hs(e,t){Js[Zs++]=mo,Js[Zs++]=fo,fo=e,mo=t}function ig(e,t,n){St[Ct++]=mn,St[Ct++]=gn,St[Ct++]=Ss,Ss=e;var s=mn;e=gn;var i=32-Ht(s)-1;s&=~(1<<i),n+=1;var a=32-Ht(t)+i;if(30<a){var o=i-i%5;a=(s&(1<<o)-1).toString(32),s>>=o,i-=o,mn=1<<32-Ht(t)+i|n<<i|s,gn=a+e}else mn=1<<a|n<<i|s,gn=e}function nu(e){e.return!==null&&(hs(e,1),ig(e,1,0))}function su(e){for(;e===fo;)fo=Js[--Zs],Js[Zs]=null,mo=Js[--Zs],Js[Zs]=null;for(;e===Ss;)Ss=St[--Ct],St[Ct]=null,gn=St[--Ct],St[Ct]=null,mn=St[--Ct],St[Ct]=null}var gt=null,mt=null,be=!1,Ut=null;function ag(e,t){var n=Et(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 pp(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,gt=e,mt=Un(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,gt=e,mt=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Ss!==null?{id:mn,overflow:gn}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Et(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,gt=e,mt=null,!0):!1;default:return!1}}function Vc(e){return(e.mode&1)!==0&&(e.flags&128)===0}function $c(e){if(be){var t=mt;if(t){var n=t;if(!pp(e,t)){if(Vc(e))throw Error(F(418));t=Un(n.nextSibling);var s=gt;t&&pp(e,t)?ag(s,n):(e.flags=e.flags&-4097|2,be=!1,gt=e)}}else{if(Vc(e))throw Error(F(418));e.flags=e.flags&-4097|2,be=!1,gt=e}}}function fp(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;gt=e}function ba(e){if(e!==gt)return!1;if(!be)return fp(e),be=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Oc(e.type,e.memoizedProps)),t&&(t=mt)){if(Vc(e))throw og(),Error(F(418));for(;t;)ag(e,t),t=Un(t.nextSibling)}if(fp(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){mt=Un(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}mt=null}}else mt=gt?Un(e.stateNode.nextSibling):null;return!0}function og(){for(var e=mt;e;)e=Un(e.nextSibling)}function gr(){mt=gt=null,be=!1}function ru(e){Ut===null?Ut=[e]:Ut.push(e)}var Eb=Cn.ReactCurrentBatchConfig;function $r(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 wa(e,t){throw e=Object.prototype.toString.call(t),Error(F(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function mp(e){var t=e._init;return t(e._payload)}function lg(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=Kn(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=Fl(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===Gs?u(g,x,w.props.children,j,w.key):x!==null&&(x.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===zn&&mp(k)===x.type)?(j=i(x,w.props),j.ref=$r(g,x,w),j.return=g,j):(j=qa(w.type,w.key,w.props,null,g.mode,j),j.ref=$r(g,x,w),j.return=g,j)}function d(g,x,w,j){return x===null||x.tag!==4||x.stateNode.containerInfo!==w.containerInfo||x.stateNode.implementation!==w.implementation?(x=Vl(w,g.mode,j),x.return=g,x):(x=i(x,w.children||[]),x.return=g,x)}function u(g,x,w,j,k){return x===null||x.tag!==7?(x=ks(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=Fl(""+x,g.mode,w),x.return=g,x;if(typeof x=="object"&&x!==null){switch(x.$$typeof){case da:return w=qa(x.type,x.key,x.props,null,g.mode,w),w.ref=$r(g,null,x),w.return=g,w;case Ws:return x=Vl(x,g.mode,w),x.return=g,x;case zn:var j=x._init;return p(g,j(x._payload),w)}if(Yr(x)||Or(x))return x=ks(x,g.mode,w,null),x.return=g,x;wa(g,x)}return null}function h(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 da:return w.key===k?c(g,x,w,j):null;case Ws:return w.key===k?d(g,x,w,j):null;case zn:return k=w._init,h(g,x,k(w._payload),j)}if(Yr(w)||Or(w))return k!==null?null:u(g,x,w,j,null);wa(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 da:return g=g.get(j.key===null?w:j.key)||null,c(x,g,j,k);case Ws:return g=g.get(j.key===null?w:j.key)||null,d(x,g,j,k);case zn:var N=j._init;return m(g,x,w,N(j._payload),k)}if(Yr(j)||Or(j))return g=g.get(w)||null,u(x,g,j,k,null);wa(x,j)}return null}function y(g,x,w,j){for(var k=null,N=null,S=x,_=x=0,A=null;S!==null&&_<w.length;_++){S.index>_?(A=S,S=null):A=S.sibling;var P=h(g,S,w[_],j);if(P===null){S===null&&(S=A);break}e&&S&&P.alternate===null&&t(g,S),x=a(P,x,_),N===null?k=P:N.sibling=P,N=P,S=A}if(_===w.length)return n(g,S),be&&hs(g,_),k;if(S===null){for(;_<w.length;_++)S=p(g,w[_],j),S!==null&&(x=a(S,x,_),N===null?k=S:N.sibling=S,N=S);return be&&hs(g,_),k}for(S=s(g,S);_<w.length;_++)A=m(S,g,_,w[_],j),A!==null&&(e&&A.alternate!==null&&S.delete(A.key===null?_:A.key),x=a(A,x,_),N===null?k=A:N.sibling=A,N=A);return e&&S.forEach(function(T){return t(g,T)}),be&&hs(g,_),k}function b(g,x,w,j){var k=Or(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,_=x=0,A=null,P=w.next();S!==null&&!P.done;_++,P=w.next()){S.index>_?(A=S,S=null):A=S.sibling;var T=h(g,S,P.value,j);if(T===null){S===null&&(S=A);break}e&&S&&T.alternate===null&&t(g,S),x=a(T,x,_),N===null?k=T:N.sibling=T,N=T,S=A}if(P.done)return n(g,S),be&&hs(g,_),k;if(S===null){for(;!P.done;_++,P=w.next())P=p(g,P.value,j),P!==null&&(x=a(P,x,_),N===null?k=P:N.sibling=P,N=P);return be&&hs(g,_),k}for(S=s(g,S);!P.done;_++,P=w.next())P=m(S,g,_,P.value,j),P!==null&&(e&&P.alternate!==null&&S.delete(P.key===null?_:P.key),x=a(P,x,_),N===null?k=P:N.sibling=P,N=P);return e&&S.forEach(function(V){return t(g,V)}),be&&hs(g,_),k}function v(g,x,w,j){if(typeof w=="object"&&w!==null&&w.type===Gs&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case da:e:{for(var k=w.key,N=x;N!==null;){if(N.key===k){if(k=w.type,k===Gs){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===zn&&mp(k)===N.type){n(g,N.sibling),x=i(N,w.props),x.ref=$r(g,N,w),x.return=g,g=x;break e}n(g,N);break}else t(g,N);N=N.sibling}w.type===Gs?(x=ks(w.props.children,g.mode,j,w.key),x.return=g,g=x):(j=qa(w.type,w.key,w.props,null,g.mode,j),j.ref=$r(g,x,w),j.return=g,g=j)}return o(g);case Ws: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=Vl(w,g.mode,j),x.return=g,g=x}return o(g);case zn:return N=w._init,v(g,x,N(w._payload),j)}if(Yr(w))return y(g,x,w,j);if(Or(w))return b(g,x,w,j);wa(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=Fl(w,g.mode,j),x.return=g,g=x),o(g)):n(g,x)}return v}var xr=lg(!0),cg=lg(!1),go=ns(null),xo=null,er=null,iu=null;function au(){iu=er=xo=null}function ou(e){var t=go.current;xe(go),e._currentValue=t}function Uc(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 hr(e,t){xo=e,iu=er=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(ct=!0),e.firstContext=null)}function Pt(e){var t=e._currentValue;if(iu!==e)if(e={context:e,memoizedValue:t,next:null},er===null){if(xo===null)throw Error(F(308));er=e,xo.dependencies={lanes:0,firstContext:e}}else er=er.next=e;return t}var ys=null;function lu(e){ys===null?ys=[e]:ys.push(e)}function dg(e,t,n,s){var i=t.interleaved;return i===null?(n.next=n,lu(t)):(n.next=i.next,i.next=n),t.interleaved=n,kn(e,s)}function kn(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 Rn=!1;function cu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function ug(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 xn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Hn(e,t,n){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,oe&2){var i=s.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),s.pending=t,kn(e,n)}return i=s.interleaved,i===null?(t.next=t,lu(s)):(t.next=i.next,i.next=t),s.interleaved=t,kn(e,n)}function $a(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,qd(e,n)}}function gp(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 yo(e,t,n,s){var i=e.updateQueue;Rn=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,l=i.shared.pending;if(l!==null){i.shared.pending=null;var c=l,d=c.next;c.next=null,o===null?a=d:o.next=d,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,l=u.lastBaseUpdate,l!==o&&(l===null?u.firstBaseUpdate=d:l.next=d,u.lastBaseUpdate=c))}if(a!==null){var p=i.baseState;o=0,u=d=c=null,l=a;do{var h=l.lane,m=l.eventTime;if((s&h)===h){u!==null&&(u=u.next={eventTime:m,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var y=e,b=l;switch(h=t,m=n,b.tag){case 1:if(y=b.payload,typeof y=="function"){p=y.call(m,p,h);break e}p=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=b.payload,h=typeof y=="function"?y.call(m,p,h):y,h==null)break e;p=Se({},p,h);break e;case 2:Rn=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,h=i.effects,h===null?i.effects=[l]:h.push(l))}else m={eventTime:m,lane:h,tag:l.tag,payload:l.payload,callback:l.callback,next:null},u===null?(d=u=m,c=p):u=u.next=m,o|=h;if(l=l.next,l===null){if(l=i.shared.pending,l===null)break;h=l,l=h.next,h.next=null,i.lastBaseUpdate=h,i.shared.pending=null}}while(!0);if(u===null&&(c=p),i.baseState=c,i.firstBaseUpdate=d,i.lastBaseUpdate=u,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);_s|=o,e.lanes=o,e.memoizedState=p}}function xp(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 Qi={},nn=ns(Qi),Pi=ns(Qi),Ai=ns(Qi);function vs(e){if(e===Qi)throw Error(F(174));return e}function du(e,t){switch(me(Ai,t),me(Pi,e),me(nn,Qi),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:jc(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=jc(t,e)}xe(nn),me(nn,t)}function yr(){xe(nn),xe(Pi),xe(Ai)}function hg(e){vs(Ai.current);var t=vs(nn.current),n=jc(t,e.type);t!==n&&(me(Pi,e),me(nn,n))}function uu(e){Pi.current===e&&(xe(nn),xe(Pi))}var ke=ns(0);function vo(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 Rl=[];function hu(){for(var e=0;e<Rl.length;e++)Rl[e]._workInProgressVersionPrimary=null;Rl.length=0}var Ua=Cn.ReactCurrentDispatcher,Ll=Cn.ReactCurrentBatchConfig,Cs=0,Ne=null,Le=null,Ie=null,bo=!1,li=!1,Mi=0,Tb=0;function He(){throw Error(F(321))}function pu(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Gt(e[n],t[n]))return!1;return!0}function fu(e,t,n,s,i,a){if(Cs=a,Ne=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Ua.current=e===null||e.memoizedState===null?zb:Rb,e=n(s,i),li){a=0;do{if(li=!1,Mi=0,25<=a)throw Error(F(301));a+=1,Ie=Le=null,t.updateQueue=null,Ua.current=Lb,e=n(s,i)}while(li)}if(Ua.current=wo,t=Le!==null&&Le.next!==null,Cs=0,Ie=Le=Ne=null,bo=!1,t)throw Error(F(300));return e}function mu(){var e=Mi!==0;return Mi=0,e}function Jt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ie===null?Ne.memoizedState=Ie=e:Ie=Ie.next=e,Ie}function At(){if(Le===null){var e=Ne.alternate;e=e!==null?e.memoizedState:null}else e=Le.next;var t=Ie===null?Ne.memoizedState:Ie.next;if(t!==null)Ie=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},Ie===null?Ne.memoizedState=Ie=e:Ie=Ie.next=e}return Ie}function zi(e,t){return typeof t=="function"?t(e):t}function Dl(e){var t=At(),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,d=a;do{var u=d.lane;if((Cs&u)===u)c!==null&&(c=c.next={lane:0,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null}),s=d.hasEagerState?d.eagerState:e(s,d.action);else{var p={lane:u,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null};c===null?(l=c=p,o=s):c=c.next=p,Ne.lanes|=u,_s|=u}d=d.next}while(d!==null&&d!==a);c===null?o=s:c.next=l,Gt(s,t.memoizedState)||(ct=!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,_s|=a,i=i.next;while(i!==e)}else i===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Ol(e){var t=At(),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);Gt(a,t.memoizedState)||(ct=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),n.lastRenderedState=a}return[a,s]}function pg(){}function fg(e,t){var n=Ne,s=At(),i=t(),a=!Gt(s.memoizedState,i);if(a&&(s.memoizedState=i,ct=!0),s=s.queue,gu(xg.bind(null,n,s,e),[e]),s.getSnapshot!==t||a||Ie!==null&&Ie.memoizedState.tag&1){if(n.flags|=2048,Ri(9,gg.bind(null,n,s,i,t),void 0,null),Be===null)throw Error(F(349));Cs&30||mg(n,t,i)}return i}function mg(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 gg(e,t,n,s){t.value=n,t.getSnapshot=s,yg(t)&&vg(e)}function xg(e,t,n){return n(function(){yg(t)&&vg(e)})}function yg(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Gt(e,n)}catch{return!0}}function vg(e){var t=kn(e,1);t!==null&&Wt(t,e,1,-1)}function yp(e){var t=Jt();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:zi,lastRenderedState:e},t.queue=e,e=e.dispatch=Mb.bind(null,Ne,e),[t.memoizedState,e]}function Ri(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 bg(){return At().memoizedState}function Ha(e,t,n,s){var i=Jt();Ne.flags|=e,i.memoizedState=Ri(1|t,n,void 0,s===void 0?null:s)}function $o(e,t,n,s){var i=At();s=s===void 0?null:s;var a=void 0;if(Le!==null){var o=Le.memoizedState;if(a=o.destroy,s!==null&&pu(s,o.deps)){i.memoizedState=Ri(t,n,a,s);return}}Ne.flags|=e,i.memoizedState=Ri(1|t,n,a,s)}function vp(e,t){return Ha(8390656,8,e,t)}function gu(e,t){return $o(2048,8,e,t)}function wg(e,t){return $o(4,2,e,t)}function kg(e,t){return $o(4,4,e,t)}function jg(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 Ng(e,t,n){return n=n!=null?n.concat([e]):null,$o(4,4,jg.bind(null,t,e),n)}function xu(){}function Sg(e,t){var n=At();t=t===void 0?null:t;var s=n.memoizedState;return s!==null&&t!==null&&pu(t,s[1])?s[0]:(n.memoizedState=[e,t],e)}function Cg(e,t){var n=At();t=t===void 0?null:t;var s=n.memoizedState;return s!==null&&t!==null&&pu(t,s[1])?s[0]:(e=e(),n.memoizedState=[e,t],e)}function _g(e,t,n){return Cs&21?(Gt(n,t)||(n=M0(),Ne.lanes|=n,_s|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,ct=!0),e.memoizedState=n)}function Pb(e,t){var n=ce;ce=n!==0&&4>n?n:4,e(!0);var s=Ll.transition;Ll.transition={};try{e(!1),t()}finally{ce=n,Ll.transition=s}}function Eg(){return At().memoizedState}function Ab(e,t,n){var s=Gn(e);if(n={lane:s,action:n,hasEagerState:!1,eagerState:null,next:null},Tg(e))Pg(t,n);else if(n=dg(e,t,n,s),n!==null){var i=nt();Wt(n,e,s,i),Ag(n,t,s)}}function Mb(e,t,n){var s=Gn(e),i={lane:s,action:n,hasEagerState:!1,eagerState:null,next:null};if(Tg(e))Pg(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,Gt(l,o)){var c=t.interleaved;c===null?(i.next=i,lu(t)):(i.next=c.next,c.next=i),t.interleaved=i;return}}catch{}finally{}n=dg(e,t,i,s),n!==null&&(i=nt(),Wt(n,e,s,i),Ag(n,t,s))}}function Tg(e){var t=e.alternate;return e===Ne||t!==null&&t===Ne}function Pg(e,t){li=bo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ag(e,t,n){if(n&4194240){var s=t.lanes;s&=e.pendingLanes,n|=s,t.lanes=n,qd(e,n)}}var wo={readContext:Pt,useCallback:He,useContext:He,useEffect:He,useImperativeHandle:He,useInsertionEffect:He,useLayoutEffect:He,useMemo:He,useReducer:He,useRef:He,useState:He,useDebugValue:He,useDeferredValue:He,useTransition:He,useMutableSource:He,useSyncExternalStore:He,useId:He,unstable_isNewReconciler:!1},zb={readContext:Pt,useCallback:function(e,t){return Jt().memoizedState=[e,t===void 0?null:t],e},useContext:Pt,useEffect:vp,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Ha(4194308,4,jg.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ha(4194308,4,e,t)},useInsertionEffect:function(e,t){return Ha(4,2,e,t)},useMemo:function(e,t){var n=Jt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var s=Jt();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=Ab.bind(null,Ne,e),[s.memoizedState,e]},useRef:function(e){var t=Jt();return e={current:e},t.memoizedState=e},useState:yp,useDebugValue:xu,useDeferredValue:function(e){return Jt().memoizedState=e},useTransition:function(){var e=yp(!1),t=e[0];return e=Pb.bind(null,e[1]),Jt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var s=Ne,i=Jt();if(be){if(n===void 0)throw Error(F(407));n=n()}else{if(n=t(),Be===null)throw Error(F(349));Cs&30||mg(s,t,n)}i.memoizedState=n;var a={value:n,getSnapshot:t};return i.queue=a,vp(xg.bind(null,s,a,e),[e]),s.flags|=2048,Ri(9,gg.bind(null,s,a,n,t),void 0,null),n},useId:function(){var e=Jt(),t=Be.identifierPrefix;if(be){var n=gn,s=mn;n=(s&~(1<<32-Ht(s)-1)).toString(32)+n,t=":"+t+"R"+n,n=Mi++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=Tb++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Rb={readContext:Pt,useCallback:Sg,useContext:Pt,useEffect:gu,useImperativeHandle:Ng,useInsertionEffect:wg,useLayoutEffect:kg,useMemo:Cg,useReducer:Dl,useRef:bg,useState:function(){return Dl(zi)},useDebugValue:xu,useDeferredValue:function(e){var t=At();return _g(t,Le.memoizedState,e)},useTransition:function(){var e=Dl(zi)[0],t=At().memoizedState;return[e,t]},useMutableSource:pg,useSyncExternalStore:fg,useId:Eg,unstable_isNewReconciler:!1},Lb={readContext:Pt,useCallback:Sg,useContext:Pt,useEffect:gu,useImperativeHandle:Ng,useInsertionEffect:wg,useLayoutEffect:kg,useMemo:Cg,useReducer:Ol,useRef:bg,useState:function(){return Ol(zi)},useDebugValue:xu,useDeferredValue:function(e){var t=At();return Le===null?t.memoizedState=e:_g(t,Le.memoizedState,e)},useTransition:function(){var e=Ol(zi)[0],t=At().memoizedState;return[e,t]},useMutableSource:pg,useSyncExternalStore:fg,useId:Eg,unstable_isNewReconciler:!1};function Ft(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 Hc(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 Uo={isMounted:function(e){return(e=e._reactInternals)?Ms(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var s=nt(),i=Gn(e),a=xn(s,i);a.payload=t,n!=null&&(a.callback=n),t=Hn(e,a,i),t!==null&&(Wt(t,e,i,s),$a(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var s=nt(),i=Gn(e),a=xn(s,i);a.tag=1,a.payload=t,n!=null&&(a.callback=n),t=Hn(e,a,i),t!==null&&(Wt(t,e,i,s),$a(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=nt(),s=Gn(e),i=xn(n,s);i.tag=2,t!=null&&(i.callback=t),t=Hn(e,i,s),t!==null&&(Wt(t,e,s,n),$a(t,e,s))}};function bp(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?!Ci(n,s)||!Ci(i,a):!0}function Mg(e,t,n){var s=!1,i=Qn,a=t.contextType;return typeof a=="object"&&a!==null?a=Pt(a):(i=ut(t)?Ns:Qe.current,s=t.contextTypes,a=(s=s!=null)?mr(e,i):Qn),t=new t(n,a),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Uo,e.stateNode=t,t._reactInternals=e,s&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=a),t}function wp(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&&Uo.enqueueReplaceState(t,t.state,null)}function Wc(e,t,n,s){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},cu(e);var a=t.contextType;typeof a=="object"&&a!==null?i.context=Pt(a):(a=ut(t)?Ns:Qe.current,i.context=mr(e,a)),i.state=e.memoizedState,a=t.getDerivedStateFromProps,typeof a=="function"&&(Hc(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&&Uo.enqueueReplaceState(i,i.state,null),yo(e,n,i,s),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function vr(e,t){try{var n="",s=t;do n+=cv(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 Il(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Gc(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var Ob=typeof WeakMap=="function"?WeakMap:Map;function Rg(e,t,n){n=xn(-1,n),n.tag=3,n.payload={element:null};var s=t.value;return n.callback=function(){jo||(jo=!0,nd=s),Gc(e,t)},n}function Lg(e,t,n){n=xn(-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(){Gc(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch=="function"&&(n.callback=function(){Gc(e,t),typeof s!="function"&&(Wn===null?Wn=new Set([this]):Wn.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function kp(e,t,n){var s=e.pingCache;if(s===null){s=e.pingCache=new Ob;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=Qb.bind(null,e,t,n),t.then(e,e))}function jp(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 Np(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=xn(-1,1),t.tag=2,Hn(n,t,1))),n.lanes|=1),e)}var Ib=Cn.ReactCurrentOwner,ct=!1;function tt(e,t,n,s){t.child=e===null?dg(t,null,n,s):xr(t,e.child,n,s)}function Sp(e,t,n,s,i){n=n.render;var a=t.ref;return hr(t,i),s=fu(e,t,n,s,a,i),n=mu(),e!==null&&!ct?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,jn(e,t,i)):(be&&n&&nu(t),t.flags|=1,tt(e,t,s,i),t.child)}function Cp(e,t,n,s,i){if(e===null){var a=n.type;return typeof a=="function"&&!Su(a)&&a.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=a,Dg(e,t,a,s,i)):(e=qa(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:Ci,n(o,s)&&e.ref===t.ref)return jn(e,t,i)}return t.flags|=1,e=Kn(a,s),e.ref=t.ref,e.return=t,t.child=e}function Dg(e,t,n,s,i){if(e!==null){var a=e.memoizedProps;if(Ci(a,s)&&e.ref===t.ref)if(ct=!1,t.pendingProps=s=a,(e.lanes&i)!==0)e.flags&131072&&(ct=!0);else return t.lanes=e.lanes,jn(e,t,i)}return Kc(e,t,n,s,i)}function Og(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(nr,ft),ft|=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(nr,ft),ft|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},s=a!==null?a.baseLanes:n,me(nr,ft),ft|=s}else a!==null?(s=a.baseLanes|n,t.memoizedState=null):s=n,me(nr,ft),ft|=s;return tt(e,t,i,n),t.child}function Ig(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Kc(e,t,n,s,i){var a=ut(n)?Ns:Qe.current;return a=mr(t,a),hr(t,i),n=fu(e,t,n,s,a,i),s=mu(),e!==null&&!ct?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,jn(e,t,i)):(be&&s&&nu(t),t.flags|=1,tt(e,t,n,i),t.child)}function _p(e,t,n,s,i){if(ut(n)){var a=!0;po(t)}else a=!1;if(hr(t,i),t.stateNode===null)Wa(e,t),zg(t,n,s),Wc(t,n,s,i),s=!0;else if(e===null){var o=t.stateNode,l=t.memoizedProps;o.props=l;var c=o.context,d=n.contextType;typeof d=="object"&&d!==null?d=Pt(d):(d=ut(n)?Ns:Qe.current,d=mr(t,d));var u=n.getDerivedStateFromProps,p=typeof u=="function"||typeof o.getSnapshotBeforeUpdate=="function";p||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==s||c!==d)&&wp(t,o,s,d),Rn=!1;var h=t.memoizedState;o.state=h,yo(t,s,o,i),c=t.memoizedState,l!==s||h!==c||dt.current||Rn?(typeof u=="function"&&(Hc(t,n,u,s),c=t.memoizedState),(l=Rn||bp(t,n,l,s,h,c,d))?(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=d,s=l):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),s=!1)}else{o=t.stateNode,hg(e,t),l=t.memoizedProps,d=t.type===t.elementType?l:Ft(t.type,l),o.props=d,p=t.pendingProps,h=o.context,c=n.contextType,typeof c=="object"&&c!==null?c=Pt(c):(c=ut(n)?Ns:Qe.current,c=mr(t,c));var m=n.getDerivedStateFromProps;(u=typeof m=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==p||h!==c)&&wp(t,o,s,c),Rn=!1,h=t.memoizedState,o.state=h,yo(t,s,o,i);var y=t.memoizedState;l!==p||h!==y||dt.current||Rn?(typeof m=="function"&&(Hc(t,n,m,s),y=t.memoizedState),(d=Rn||bp(t,n,d,s,h,y,c)||!1)?(u||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(s,y,c),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(s,y,c)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=s,t.memoizedState=y),o.props=s,o.state=y,o.context=c,s=d):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),s=!1)}return qc(e,t,n,s,a,i)}function qc(e,t,n,s,i,a){Ig(e,t);var o=(t.flags&128)!==0;if(!s&&!o)return i&&hp(t,n,!1),jn(e,t,a);s=t.stateNode,Ib.current=t;var l=o&&typeof n.getDerivedStateFromError!="function"?null:s.render();return t.flags|=1,e!==null&&o?(t.child=xr(t,e.child,null,a),t.child=xr(t,null,l,a)):tt(e,t,l,a),t.memoizedState=s.state,i&&hp(t,n,!0),t.child}function Bg(e){var t=e.stateNode;t.pendingContext?up(e,t.pendingContext,t.pendingContext!==t.context):t.context&&up(e,t.context,!1),du(e,t.containerInfo)}function Ep(e,t,n,s,i){return gr(),ru(i),t.flags|=256,tt(e,t,n,s),t.child}var Yc={dehydrated:null,treeContext:null,retryLane:0};function Xc(e){return{baseLanes:e,cachePool:null,transitions:null}}function Fg(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 $c(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=Go(o,s,0,null),e=ks(e,s,n,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=Xc(n),t.memoizedState=Yc,e):yu(t,o));if(i=e.memoizedState,i!==null&&(l=i.dehydrated,l!==null))return Bb(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=Kn(i,c),s.subtreeFlags=i.subtreeFlags&14680064),l!==null?a=Kn(l,a):(a=ks(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?Xc(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},a.memoizedState=o,a.childLanes=e.childLanes&~n,t.memoizedState=Yc,s}return a=e.child,e=a.sibling,s=Kn(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 yu(e,t){return t=Go({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function ka(e,t,n,s){return s!==null&&ru(s),xr(t,e.child,null,n),e=yu(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Bb(e,t,n,s,i,a,o){if(n)return t.flags&256?(t.flags&=-257,s=Il(Error(F(422))),ka(e,t,o,s)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(a=s.fallback,i=t.mode,s=Go({mode:"visible",children:s.children},i,0,null),a=ks(a,i,o,null),a.flags|=2,s.return=t,a.return=t,s.sibling=a,t.child=s,t.mode&1&&xr(t,e.child,null,o),t.child.memoizedState=Xc(o),t.memoizedState=Yc,a);if(!(t.mode&1))return ka(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=Il(a,s,void 0),ka(e,t,o,s)}if(l=(o&e.childLanes)!==0,ct||l){if(s=Be,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,kn(e,i),Wt(s,e,i,-1))}return Nu(),s=Il(Error(F(421))),ka(e,t,o,s)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=Jb.bind(null,e),i._reactRetry=t,null):(e=a.treeContext,mt=Un(i.nextSibling),gt=t,be=!0,Ut=null,e!==null&&(St[Ct++]=mn,St[Ct++]=gn,St[Ct++]=Ss,mn=e.id,gn=e.overflow,Ss=t),t=yu(t,s.children),t.flags|=4096,t)}function Tp(e,t,n){e.lanes|=t;var s=e.alternate;s!==null&&(s.lanes|=t),Uc(e.return,t,n)}function Bl(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 Vg(e,t,n){var s=t.pendingProps,i=s.revealOrder,a=s.tail;if(tt(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&&Tp(e,n,t);else if(e.tag===19)Tp(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&&vo(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Bl(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&&vo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Bl(t,!0,n,null,a);break;case"together":Bl(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Wa(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function jn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),_s|=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=Kn(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Kn(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Fb(e,t,n){switch(t.tag){case 3:Bg(t),gr();break;case 5:pg(t);break;case 1:ut(t.type)&&po(t);break;case 4:du(t,t.stateNode.containerInfo);break;case 10:var s=t.type._context,i=t.memoizedProps.value;me(go,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?Fg(e,t,n):(me(ke,ke.current&1),e=jn(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 Vg(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,Og(e,t,n)}return jn(e,t,n)}var $g,Qc,Ug,Hg;$g=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}};Qc=function(){};Ug=function(e,t,n,s){var i=e.memoizedProps;if(i!==s){e=t.stateNode,vs(nn.current);var a=null;switch(n){case"input":i=vc(e,i),s=vc(e,s),a=[];break;case"select":i=Se({},i,{value:void 0}),s=Se({},s,{value:void 0}),a=[];break;case"textarea":i=kc(e,i),s=kc(e,s),a=[];break;default:typeof i.onClick!="function"&&typeof s.onClick=="function"&&(e.onclick=uo)}Nc(n,s);var o;n=null;for(d in i)if(!s.hasOwnProperty(d)&&i.hasOwnProperty(d)&&i[d]!=null)if(d==="style"){var l=i[d];for(o in l)l.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else d!=="dangerouslySetInnerHTML"&&d!=="children"&&d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&d!=="autoFocus"&&(vi.hasOwnProperty(d)?a||(a=[]):(a=a||[]).push(d,null));for(d in s){var c=s[d];if(l=i!=null?i[d]:void 0,s.hasOwnProperty(d)&&c!==l&&(c!=null||l!=null))if(d==="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(d,n)),n=c;else d==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,l=l?l.__html:void 0,c!=null&&l!==c&&(a=a||[]).push(d,c)):d==="children"?typeof c!="string"&&typeof c!="number"||(a=a||[]).push(d,""+c):d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&(vi.hasOwnProperty(d)?(c!=null&&d==="onScroll"&&ge("scroll",e),a||l===c||(a=[])):(a=a||[]).push(d,c))}n&&(a=a||[]).push("style",n);var d=a;(t.updateQueue=d)&&(t.flags|=4)}};Hg=function(e,t,n,s){n!==s&&(t.flags|=4)};function Ur(e,t){if(!be)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 We(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 Vb(e,t,n){var s=t.pendingProps;switch(su(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return We(t),null;case 1:return ut(t.type)&&ho(),We(t),null;case 3:return s=t.stateNode,yr(),xe(dt),xe(Qe),hu(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(e===null||e.child===null)&&(ba(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Ut!==null&&(id(Ut),Ut=null))),Qc(e,t),We(t),null;case 5:uu(t);var i=vs(Ai.current);if(n=t.type,e!==null&&t.stateNode!=null)Ug(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 We(t),null}if(e=vs(nn.current),ba(t)){s=t.stateNode,n=t.type;var a=t.memoizedProps;switch(s[Zt]=t,s[Ti]=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<Qr.length;i++)ge(Qr[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":Ih(s,a),ge("invalid",s);break;case"select":s._wrapperState={wasMultiple:!!a.multiple},ge("invalid",s);break;case"textarea":Fh(s,a),ge("invalid",s)}Nc(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&&va(s.textContent,l,e),i=["children",l]):typeof l=="number"&&s.textContent!==""+l&&(a.suppressHydrationWarning!==!0&&va(s.textContent,l,e),i=["children",""+l]):vi.hasOwnProperty(o)&&l!=null&&o==="onScroll"&&ge("scroll",s)}switch(n){case"input":ua(s),Bh(s,a,!0);break;case"textarea":ua(s),Vh(s);break;case"select":case"option":break;default:typeof a.onClick=="function"&&(s.onclick=uo)}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=y0(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[Zt]=t,e[Ti]=s,$g(e,t,!1,!1),t.stateNode=e;e:{switch(o=Sc(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<Qr.length;i++)ge(Qr[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":Ih(e,s),i=vc(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":Fh(e,s),i=kc(e,s),ge("invalid",e);break;default:i=s}Nc(n,i),l=i;for(a in l)if(l.hasOwnProperty(a)){var c=l[a];a==="style"?w0(e,c):a==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&v0(e,c)):a==="children"?typeof c=="string"?(n!=="textarea"||c!=="")&&bi(e,c):typeof c=="number"&&bi(e,""+c):a!=="suppressContentEditableWarning"&&a!=="suppressHydrationWarning"&&a!=="autoFocus"&&(vi.hasOwnProperty(a)?c!=null&&a==="onScroll"&&ge("scroll",e):c!=null&&$d(e,a,c,o))}switch(n){case"input":ua(e),Bh(e,s,!1);break;case"textarea":ua(e),Vh(e);break;case"option":s.value!=null&&e.setAttribute("value",""+Xn(s.value));break;case"select":e.multiple=!!s.multiple,a=s.value,a!=null?lr(e,!!s.multiple,a,!1):s.defaultValue!=null&&lr(e,!!s.multiple,s.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=uo)}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 We(t),null;case 6:if(e&&t.stateNode!=null)Hg(e,t,e.memoizedProps,s);else{if(typeof s!="string"&&t.stateNode===null)throw Error(F(166));if(n=vs(Ai.current),vs(nn.current),ba(t)){if(s=t.stateNode,n=t.memoizedProps,s[Zt]=t,(a=s.nodeValue!==n)&&(e=gt,e!==null))switch(e.tag){case 3:va(s.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&va(s.nodeValue,n,(e.mode&1)!==0)}a&&(t.flags|=4)}else s=(n.nodeType===9?n:n.ownerDocument).createTextNode(s),s[Zt]=t,t.stateNode=s}return We(t),null;case 13:if(xe(ke),s=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(be&&mt!==null&&t.mode&1&&!(t.flags&128))lg(),gr(),t.flags|=98560,a=!1;else if(a=ba(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[Zt]=t}else gr(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;We(t),a=!1}else Ut!==null&&(id(Ut),Ut=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?De===0&&(De=3):Nu())),t.updateQueue!==null&&(t.flags|=4),We(t),null);case 4:return yr(),Qc(e,t),e===null&&_i(t.stateNode.containerInfo),We(t),null;case 10:return ou(t.type._context),We(t),null;case 17:return ut(t.type)&&ho(),We(t),null;case 19:if(xe(ke),a=t.memoizedState,a===null)return We(t),null;if(s=(t.flags&128)!==0,o=a.rendering,o===null)if(s)Ur(a,!1);else{if(De!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=vo(e),o!==null){for(t.flags|=128,Ur(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()>br&&(t.flags|=128,s=!0,Ur(a,!1),t.lanes=4194304)}else{if(!s)if(e=vo(o),e!==null){if(t.flags|=128,s=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Ur(a,!0),a.tail===null&&a.tailMode==="hidden"&&!o.alternate&&!be)return We(t),null}else 2*Pe()-a.renderingStartTime>br&&n!==1073741824&&(t.flags|=128,s=!0,Ur(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):(We(t),null);case 22:case 23:return ju(),s=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==s&&(t.flags|=8192),s&&t.mode&1?ft&1073741824&&(We(t),t.subtreeFlags&6&&(t.flags|=8192)):We(t),null;case 24:return null;case 25:return null}throw Error(F(156,t.tag))}function $b(e,t){switch(su(t),t.tag){case 1:return ut(t.type)&&ho(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return yr(),xe(dt),xe(Qe),hu(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return uu(t),null;case 13:if(xe(ke),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(F(340));gr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return xe(ke),null;case 4:return yr(),null;case 10:return ou(t.type._context),null;case 22:case 23:return ju(),null;case 24:return null;default:return null}}var ja=!1,qe=!1,Ub=typeof WeakSet=="function"?WeakSet:Set,K=null;function tr(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(s){_e(e,t,s)}else n.current=null}function Jc(e,t,n){try{n()}catch(s){_e(e,t,s)}}var Pp=!1;function Hb(e,t){if(Lc=oo,e=Y0(),tu(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,d=0,u=0,p=e,h=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;)h=p,p=m;for(;;){if(p===e)break t;if(h===n&&++d===i&&(l=o),h===a&&++u===s&&(c=o),(m=p.nextSibling)!==null)break;p=h,h=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(Dc={focusedElem:e,selectionRange:n},oo=!1,K=t;K!==null;)if(t=K,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,K=e;else for(;K!==null;){t=K;try{var y=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var b=y.memoizedProps,v=y.memoizedState,g=t.stateNode,x=g.getSnapshotBeforeUpdate(t.elementType===t.type?b:Ft(t.type,b),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){_e(t,t.return,j)}if(e=t.sibling,e!==null){e.return=t.return,K=e;break}K=t.return}return y=Pp,Pp=!1,y}function ci(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&&Jc(t,n,a)}i=i.next}while(i!==s)}}function Ho(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 Zc(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 Wg(e){var t=e.alternate;t!==null&&(e.alternate=null,Wg(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Zt],delete t[Ti],delete t[Bc],delete t[Cb],delete t[_b])),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 Gg(e){return e.tag===5||e.tag===3||e.tag===4}function Ap(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Gg(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 ed(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=uo));else if(s!==4&&(e=e.child,e!==null))for(ed(e,t,n),e=e.sibling;e!==null;)ed(e,t,n),e=e.sibling}function td(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(td(e,t,n),e=e.sibling;e!==null;)td(e,t,n),e=e.sibling}var Fe=null,Vt=!1;function An(e,t,n){for(n=n.child;n!==null;)Kg(e,t,n),n=n.sibling}function Kg(e,t,n){if(tn&&typeof tn.onCommitFiberUnmount=="function")try{tn.onCommitFiberUnmount(Do,n)}catch{}switch(n.tag){case 5:qe||tr(n,t);case 6:var s=Fe,i=Vt;Fe=null,An(e,t,n),Fe=s,Vt=i,Fe!==null&&(Vt?(e=Fe,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Fe.removeChild(n.stateNode));break;case 18:Fe!==null&&(Vt?(e=Fe,n=n.stateNode,e.nodeType===8?Ml(e.parentNode,n):e.nodeType===1&&Ml(e,n),Ni(e)):Ml(Fe,n.stateNode));break;case 4:s=Fe,i=Vt,Fe=n.stateNode.containerInfo,Vt=!0,An(e,t,n),Fe=s,Vt=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)&&Jc(n,t,o),i=i.next}while(i!==s)}An(e,t,n);break;case 1:if(!qe&&(tr(n,t),s=n.stateNode,typeof s.componentWillUnmount=="function"))try{s.props=n.memoizedProps,s.state=n.memoizedState,s.componentWillUnmount()}catch(l){_e(n,t,l)}An(e,t,n);break;case 21:An(e,t,n);break;case 22:n.mode&1?(qe=(s=qe)||n.memoizedState!==null,An(e,t,n),qe=s):An(e,t,n);break;default:An(e,t,n)}}function Mp(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Ub),t.forEach(function(s){var i=Zb.bind(null,e,s);n.has(s)||(n.add(s),s.then(i,i))})}}function Ot(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:Fe=l.stateNode,Vt=!1;break e;case 3:Fe=l.stateNode.containerInfo,Vt=!0;break e;case 4:Fe=l.stateNode.containerInfo,Vt=!0;break e}l=l.return}if(Fe===null)throw Error(F(160));Kg(a,o,i),Fe=null,Vt=!1;var c=i.alternate;c!==null&&(c.return=null),i.return=null}catch(d){_e(i,t,d)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)qg(t,e),t=t.sibling}function qg(e,t){var n=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Ot(t,e),Qt(e),s&4){try{ci(3,e,e.return),Ho(3,e)}catch(b){_e(e,e.return,b)}try{ci(5,e,e.return)}catch(b){_e(e,e.return,b)}}break;case 1:Ot(t,e),Qt(e),s&512&&n!==null&&tr(n,n.return);break;case 5:if(Ot(t,e),Qt(e),s&512&&n!==null&&tr(n,n.return),e.flags&32){var i=e.stateNode;try{bi(i,"")}catch(b){_e(e,e.return,b)}}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&&g0(i,a),Sc(l,o);var d=Sc(l,a);for(o=0;o<c.length;o+=2){var u=c[o],p=c[o+1];u==="style"?w0(i,p):u==="dangerouslySetInnerHTML"?v0(i,p):u==="children"?bi(i,p):$d(i,u,p,d)}switch(l){case"input":bc(i,a);break;case"textarea":x0(i,a);break;case"select":var h=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!a.multiple;var m=a.value;m!=null?lr(i,!!a.multiple,m,!1):h!==!!a.multiple&&(a.defaultValue!=null?lr(i,!!a.multiple,a.defaultValue,!0):lr(i,!!a.multiple,a.multiple?[]:"",!1))}i[Ti]=a}catch(b){_e(e,e.return,b)}}break;case 6:if(Ot(t,e),Qt(e),s&4){if(e.stateNode===null)throw Error(F(162));i=e.stateNode,a=e.memoizedProps;try{i.nodeValue=a}catch(b){_e(e,e.return,b)}}break;case 3:if(Ot(t,e),Qt(e),s&4&&n!==null&&n.memoizedState.isDehydrated)try{Ni(t.containerInfo)}catch(b){_e(e,e.return,b)}break;case 4:Ot(t,e),Qt(e);break;case 13:Ot(t,e),Qt(e),i=e.child,i.flags&8192&&(a=i.memoizedState!==null,i.stateNode.isHidden=a,!a||i.alternate!==null&&i.alternate.memoizedState!==null||(wu=Pe())),s&4&&Mp(e);break;case 22:if(u=n!==null&&n.memoizedState!==null,e.mode&1?(qe=(d=qe)||u,Ot(t,e),qe=d):Ot(t,e),Qt(e),s&8192){if(d=e.memoizedState!==null,(e.stateNode.isHidden=d)&&!u&&e.mode&1)for(K=e,u=e.child;u!==null;){for(p=K=u;K!==null;){switch(h=K,m=h.child,h.tag){case 0:case 11:case 14:case 15:ci(4,h,h.return);break;case 1:tr(h,h.return);var y=h.stateNode;if(typeof y.componentWillUnmount=="function"){s=h,n=h.return;try{t=s,y.props=t.memoizedProps,y.state=t.memoizedState,y.componentWillUnmount()}catch(b){_e(s,n,b)}}break;case 5:tr(h,h.return);break;case 22:if(h.memoizedState!==null){Rp(p);continue}}m!==null?(m.return=h,K=m):Rp(p)}u=u.sibling}e:for(u=null,p=e;;){if(p.tag===5){if(u===null){u=p;try{i=p.stateNode,d?(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=b0("display",o))}catch(b){_e(e,e.return,b)}}}else if(p.tag===6){if(u===null)try{p.stateNode.nodeValue=d?"":p.memoizedProps}catch(b){_e(e,e.return,b)}}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;u===p&&(u=null),p=p.return}u===p&&(u=null),p.sibling.return=p.return,p=p.sibling}}break;case 19:Ot(t,e),Qt(e),s&4&&Mp(e);break;case 21:break;default:Ot(t,e),Qt(e)}}function Qt(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(Gg(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&&(bi(i,""),s.flags&=-33);var a=Ap(e);td(e,a,i);break;case 3:case 4:var o=s.stateNode.containerInfo,l=Ap(e);ed(e,l,o);break;default:throw Error(F(161))}}catch(c){_e(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Wb(e,t,n){K=e,Yg(e)}function Yg(e,t,n){for(var s=(e.mode&1)!==0;K!==null;){var i=K,a=i.child;if(i.tag===22&&s){var o=i.memoizedState!==null||ja;if(!o){var l=i.alternate,c=l!==null&&l.memoizedState!==null||qe;l=ja;var d=qe;if(ja=o,(qe=c)&&!d)for(K=i;K!==null;)o=K,c=o.child,o.tag===22&&o.memoizedState!==null?Lp(i):c!==null?(c.return=o,K=c):Lp(i);for(;a!==null;)K=a,Yg(a),a=a.sibling;K=i,ja=l,qe=d}zp(e)}else i.subtreeFlags&8772&&a!==null?(a.return=i,K=a):zp(e)}}function zp(e){for(;K!==null;){var t=K;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:qe||Ho(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:Ft(t.type,n.memoizedProps);s.componentDidUpdate(i,n.memoizedState,s.__reactInternalSnapshotBeforeUpdate)}var a=t.updateQueue;a!==null&&xp(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}xp(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 d=t.alternate;if(d!==null){var u=d.memoizedState;if(u!==null){var p=u.dehydrated;p!==null&&Ni(p)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(F(163))}qe||t.flags&512&&Zc(t)}catch(h){_e(t,t.return,h)}}if(t===e){K=null;break}if(n=t.sibling,n!==null){n.return=t.return,K=n;break}K=t.return}}function Rp(e){for(;K!==null;){var t=K;if(t===e){K=null;break}var n=t.sibling;if(n!==null){n.return=t.return,K=n;break}K=t.return}}function Lp(e){for(;K!==null;){var t=K;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Ho(4,t)}catch(c){_e(t,n,c)}break;case 1:var s=t.stateNode;if(typeof s.componentDidMount=="function"){var i=t.return;try{s.componentDidMount()}catch(c){_e(t,i,c)}}var a=t.return;try{Zc(t)}catch(c){_e(t,a,c)}break;case 5:var o=t.return;try{Zc(t)}catch(c){_e(t,o,c)}}}catch(c){_e(t,t.return,c)}if(t===e){K=null;break}var l=t.sibling;if(l!==null){l.return=t.return,K=l;break}K=t.return}}var Gb=Math.ceil,ko=Cn.ReactCurrentDispatcher,vu=Cn.ReactCurrentOwner,Tt=Cn.ReactCurrentBatchConfig,oe=0,Be=null,Me=null,$e=0,ft=0,nr=ns(0),De=0,Li=null,_s=0,Wo=0,bu=0,di=null,lt=null,wu=0,br=1/0,hn=null,jo=!1,nd=null,Wn=null,Na=!1,In=null,No=0,ui=0,sd=null,Ga=-1,Ka=0;function nt(){return oe&6?Pe():Ga!==-1?Ga:Ga=Pe()}function Gn(e){return e.mode&1?oe&2&&$e!==0?$e&-$e:Tb.transition!==null?(Ka===0&&(Ka=z0()),Ka):(e=ce,e!==0||(e=window.event,e=e===void 0?16:F0(e.type)),e):1}function Wt(e,t,n,s){if(50<ui)throw ui=0,sd=null,Error(F(185));qi(e,n,s),(!(oe&2)||e!==Be)&&(e===Be&&(!(oe&2)&&(Wo|=n),De===4&&Dn(e,$e)),ht(e,s),n===1&&oe===0&&!(t.mode&1)&&(br=Pe()+500,Vo&&ss()))}function ht(e,t){var n=e.callbackNode;Tv(e,t);var s=ao(e,e===Be?$e:0);if(s===0)n!==null&&Hh(n),e.callbackNode=null,e.callbackPriority=0;else if(t=s&-s,e.callbackPriority!==t){if(n!=null&&Hh(n),t===1)e.tag===0?Eb(Dp.bind(null,e)):ig(Dp.bind(null,e)),Nb(function(){!(oe&6)&&ss()}),n=null;else{switch(R0(s)){case 1:n=Kd;break;case 4:n=A0;break;case 16:n=io;break;case 536870912:n=M0;break;default:n=io}n=sx(n,Xg.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Xg(e,t){if(Ga=-1,Ka=0,oe&6)throw Error(F(327));var n=e.callbackNode;if(pr()&&e.callbackNode!==n)return null;var s=ao(e,e===Be?$e:0);if(s===0)return null;if(s&30||s&e.expiredLanes||t)t=So(e,s);else{t=s;var i=oe;oe|=2;var a=Jg();(Be!==e||$e!==t)&&(hn=null,br=Pe()+500,ws(e,t));do try{Yb();break}catch(l){Qg(e,l)}while(!0);au(),ko.current=a,oe=i,Me!==null?t=0:(Be=null,$e=0,t=De)}if(t!==0){if(t===2&&(i=Pc(e),i!==0&&(s=i,t=rd(e,i))),t===1)throw n=Li,ws(e,0),Dn(e,s),ht(e,Pe()),n;if(t===6)Dn(e,s);else{if(i=e.current.alternate,!(s&30)&&!Kb(i)&&(t=So(e,s),t===2&&(a=Pc(e),a!==0&&(s=a,t=rd(e,a))),t===1))throw n=Li,ws(e,0),Dn(e,s),ht(e,Pe()),n;switch(e.finishedWork=i,e.finishedLanes=s,t){case 0:case 1:throw Error(F(345));case 2:ps(e,lt,hn);break;case 3:if(Dn(e,s),(s&130023424)===s&&(t=wu+500-Pe(),10<t)){if(ao(e,0)!==0)break;if(i=e.suspendedLanes,(i&s)!==s){nt(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=Ic(ps.bind(null,e,lt,hn),t);break}ps(e,lt,hn);break;case 4:if(Dn(e,s),(s&4194240)===s)break;for(t=e.eventTimes,i=-1;0<s;){var o=31-Ht(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*Gb(s/1960))-s,10<s){e.timeoutHandle=Ic(ps.bind(null,e,lt,hn),s);break}ps(e,lt,hn);break;case 5:ps(e,lt,hn);break;default:throw Error(F(329))}}}return ht(e,Pe()),e.callbackNode===n?Xg.bind(null,e):null}function rd(e,t){var n=di;return e.current.memoizedState.isDehydrated&&(ws(e,t).flags|=256),e=So(e,t),e!==2&&(t=lt,lt=n,t!==null&&id(t)),e}function id(e){lt===null?lt=e:lt.push.apply(lt,e)}function Kb(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(!Gt(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 Dn(e,t){for(t&=~bu,t&=~Wo,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Ht(t),s=1<<n;e[n]=-1,t&=~s}}function Dp(e){if(oe&6)throw Error(F(327));pr();var t=ao(e,0);if(!(t&1))return ht(e,Pe()),null;var n=So(e,t);if(e.tag!==0&&n===2){var s=Pc(e);s!==0&&(t=s,n=rd(e,s))}if(n===1)throw n=Li,ws(e,0),Dn(e,t),ht(e,Pe()),n;if(n===6)throw Error(F(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,ps(e,lt,hn),ht(e,Pe()),null}function ku(e,t){var n=oe;oe|=1;try{return e(t)}finally{oe=n,oe===0&&(br=Pe()+500,Vo&&ss())}}function Es(e){In!==null&&In.tag===0&&!(oe&6)&&pr();var t=oe;oe|=1;var n=Tt.transition,s=ce;try{if(Tt.transition=null,ce=1,e)return e()}finally{ce=s,Tt.transition=n,oe=t,!(oe&6)&&ss()}}function ju(){ft=nr.current,xe(nr)}function ws(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,jb(n)),Me!==null)for(n=Me.return;n!==null;){var s=n;switch(su(s),s.tag){case 1:s=s.type.childContextTypes,s!=null&&ho();break;case 3:yr(),xe(dt),xe(Qe),hu();break;case 5:uu(s);break;case 4:yr();break;case 13:xe(ke);break;case 19:xe(ke);break;case 10:ou(s.type._context);break;case 22:case 23:ju()}n=n.return}if(Be=e,Me=e=Kn(e.current,null),$e=ft=t,De=0,Li=null,bu=Wo=_s=0,lt=di=null,ys!==null){for(t=0;t<ys.length;t++)if(n=ys[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}ys=null}return e}function Qg(e,t){do{var n=Me;try{if(au(),Ua.current=wo,bo){for(var s=Ne.memoizedState;s!==null;){var i=s.queue;i!==null&&(i.pending=null),s=s.next}bo=!1}if(Cs=0,Ie=Le=Ne=null,li=!1,Mi=0,vu.current=null,n===null||n.return===null){De=1,Li=t,Me=null;break}e:{var a=e,o=n.return,l=n,c=t;if(t=$e,l.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var d=c,u=l,p=u.tag;if(!(u.mode&1)&&(p===0||p===11||p===15)){var h=u.alternate;h?(u.updateQueue=h.updateQueue,u.memoizedState=h.memoizedState,u.lanes=h.lanes):(u.updateQueue=null,u.memoizedState=null)}var m=jp(o);if(m!==null){m.flags&=-257,Np(m,o,l,a,t),m.mode&1&&kp(a,d,t),t=m,c=d;var y=t.updateQueue;if(y===null){var b=new Set;b.add(c),t.updateQueue=b}else y.add(c);break e}else{if(!(t&1)){kp(a,d,t),Nu();break e}c=Error(F(426))}}else if(be&&l.mode&1){var v=jp(o);if(v!==null){!(v.flags&65536)&&(v.flags|=256),Np(v,o,l,a,t),ru(vr(c,l));break e}}a=c=vr(c,l),De!==4&&(De=2),di===null?di=[a]:di.push(a),a=o;do{switch(a.tag){case 3:a.flags|=65536,t&=-t,a.lanes|=t;var g=Rg(a,c,t);gp(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"&&(Wn===null||!Wn.has(w)))){a.flags|=65536,t&=-t,a.lanes|=t;var j=Lg(a,l,t);gp(a,j);break e}}a=a.return}while(a!==null)}ex(n)}catch(k){t=k,Me===n&&n!==null&&(Me=n=n.return);continue}break}while(!0)}function Jg(){var e=ko.current;return ko.current=wo,e===null?wo:e}function Nu(){(De===0||De===3||De===2)&&(De=4),Be===null||!(_s&268435455)&&!(Wo&268435455)||Dn(Be,$e)}function So(e,t){var n=oe;oe|=2;var s=Jg();(Be!==e||$e!==t)&&(hn=null,ws(e,t));do try{qb();break}catch(i){Qg(e,i)}while(!0);if(au(),oe=n,ko.current=s,Me!==null)throw Error(F(261));return Be=null,$e=0,De}function qb(){for(;Me!==null;)Zg(Me)}function Yb(){for(;Me!==null&&!bv();)Zg(Me)}function Zg(e){var t=nx(e.alternate,e,ft);e.memoizedProps=e.pendingProps,t===null?ex(e):Me=t,vu.current=null}function ex(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=$b(n,t),n!==null){n.flags&=32767,Me=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{De=6,Me=null;return}}else if(n=Vb(n,t,ft),n!==null){Me=n;return}if(t=t.sibling,t!==null){Me=t;return}Me=t=e}while(t!==null);De===0&&(De=5)}function ps(e,t,n){var s=ce,i=Tt.transition;try{Tt.transition=null,ce=1,Xb(e,t,n,s)}finally{Tt.transition=i,ce=s}return null}function Xb(e,t,n,s){do pr();while(In!==null);if(oe&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(Pv(e,a),e===Be&&(Me=Be=null,$e=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Na||(Na=!0,sx(io,function(){return pr(),null})),a=(n.flags&15990)!==0,n.subtreeFlags&15990||a){a=Tt.transition,Tt.transition=null;var o=ce;ce=1;var l=oe;oe|=4,vu.current=null,Hb(e,n),qg(n,e),gb(Dc),oo=!!Lc,Dc=Lc=null,e.current=n,Wb(n),wv(),oe=l,ce=o,Tt.transition=a}else e.current=n;if(Na&&(Na=!1,In=e,No=i),a=e.pendingLanes,a===0&&(Wn=null),Nv(n.stateNode),ht(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(jo)throw jo=!1,e=nd,nd=null,e;return No&1&&e.tag!==0&&pr(),a=e.pendingLanes,a&1?e===sd?ui++:(ui=0,sd=e):ui=0,ss(),null}function pr(){if(In!==null){var e=R0(No),t=Tt.transition,n=ce;try{if(Tt.transition=null,ce=16>e?16:e,In===null)var s=!1;else{if(e=In,In=null,No=0,oe&6)throw Error(F(331));var i=oe;for(oe|=4,K=e.current;K!==null;){var a=K,o=a.child;if(K.flags&16){var l=a.deletions;if(l!==null){for(var c=0;c<l.length;c++){var d=l[c];for(K=d;K!==null;){var u=K;switch(u.tag){case 0:case 11:case 15:ci(8,u,a)}var p=u.child;if(p!==null)p.return=u,K=p;else for(;K!==null;){u=K;var h=u.sibling,m=u.return;if(Wg(u),u===d){K=null;break}if(h!==null){h.return=m,K=h;break}K=m}}}var y=a.alternate;if(y!==null){var b=y.child;if(b!==null){y.child=null;do{var v=b.sibling;b.sibling=null,b=v}while(b!==null)}}K=a}}if(a.subtreeFlags&2064&&o!==null)o.return=a,K=o;else e:for(;K!==null;){if(a=K,a.flags&2048)switch(a.tag){case 0:case 11:case 15:ci(9,a,a.return)}var g=a.sibling;if(g!==null){g.return=a.return,K=g;break e}K=a.return}}var x=e.current;for(K=x;K!==null;){o=K;var w=o.child;if(o.subtreeFlags&2064&&w!==null)w.return=o,K=w;else e:for(o=x;K!==null;){if(l=K,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:Ho(9,l)}}catch(k){_e(l,l.return,k)}if(l===o){K=null;break e}var j=l.sibling;if(j!==null){j.return=l.return,K=j;break e}K=l.return}}if(oe=i,ss(),tn&&typeof tn.onPostCommitFiberRoot=="function")try{tn.onPostCommitFiberRoot(Do,e)}catch{}s=!0}return s}finally{ce=n,Tt.transition=t}}return!1}function Op(e,t,n){t=vr(n,t),t=Rg(e,t,1),e=Hn(e,t,1),t=nt(),e!==null&&(qi(e,1,t),ht(e,t))}function _e(e,t,n){if(e.tag===3)Op(e,e,n);else for(;t!==null;){if(t.tag===3){Op(t,e,n);break}else if(t.tag===1){var s=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(Wn===null||!Wn.has(s))){e=vr(n,e),e=Lg(t,e,1),t=Hn(t,e,1),e=nt(),t!==null&&(qi(t,1,e),ht(t,e));break}}t=t.return}}function Qb(e,t,n){var s=e.pingCache;s!==null&&s.delete(t),t=nt(),e.pingedLanes|=e.suspendedLanes&n,Be===e&&($e&n)===n&&(De===4||De===3&&($e&130023424)===$e&&500>Pe()-wu?ws(e,0):bu|=n),ht(e,t)}function tx(e,t){t===0&&(e.mode&1?(t=fa,fa<<=1,!(fa&130023424)&&(fa=4194304)):t=1);var n=nt();e=kn(e,t),e!==null&&(qi(e,t,n),ht(e,n))}function Jb(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),tx(e,n)}function Zb(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),tx(e,n)}var nx;nx=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||dt.current)ct=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return ct=!1,Fb(e,t,n);ct=!!(e.flags&131072)}else ct=!1,be&&t.flags&1048576&&ag(t,mo,t.index);switch(t.lanes=0,t.tag){case 2:var s=t.type;Wa(e,t),e=t.pendingProps;var i=mr(t,Qe.current);hr(t,n),i=fu(null,t,s,e,i,n);var a=mu();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,ut(s)?(a=!0,po(t)):a=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,cu(t),i.updater=Uo,t.stateNode=i,i._reactInternals=t,Wc(t,s,e,n),t=qc(null,t,s,!0,a,n)):(t.tag=0,be&&a&&nu(t),tt(null,t,i,n),t=t.child),t;case 16:s=t.elementType;e:{switch(Wa(e,t),e=t.pendingProps,i=s._init,s=i(s._payload),t.type=s,i=t.tag=tw(s),e=Ft(s,e),i){case 0:t=Kc(null,t,s,e,n);break e;case 1:t=_p(null,t,s,e,n);break e;case 11:t=Sp(null,t,s,e,n);break e;case 14:t=Cp(null,t,s,Ft(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:Ft(s,i),Kc(e,t,s,i,n);case 1:return s=t.type,i=t.pendingProps,i=t.elementType===s?i:Ft(s,i),_p(e,t,s,i,n);case 3:e:{if(Bg(t),e===null)throw Error(F(387));s=t.pendingProps,a=t.memoizedState,i=a.element,hg(e,t),yo(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=vr(Error(F(423)),t),t=Ep(e,t,s,n,i);break e}else if(s!==i){i=vr(Error(F(424)),t),t=Ep(e,t,s,n,i);break e}else for(mt=Un(t.stateNode.containerInfo.firstChild),gt=t,be=!0,Ut=null,n=dg(t,null,s,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(gr(),s===i){t=jn(e,t,n);break e}tt(e,t,s,n)}t=t.child}return t;case 5:return pg(t),e===null&&$c(t),s=t.type,i=t.pendingProps,a=e!==null?e.memoizedProps:null,o=i.children,Oc(s,i)?o=null:a!==null&&Oc(s,a)&&(t.flags|=32),Ig(e,t),tt(e,t,o,n),t.child;case 6:return e===null&&$c(t),null;case 13:return Fg(e,t,n);case 4:return du(t,t.stateNode.containerInfo),s=t.pendingProps,e===null?t.child=xr(t,null,s,n):tt(e,t,s,n),t.child;case 11:return s=t.type,i=t.pendingProps,i=t.elementType===s?i:Ft(s,i),Sp(e,t,s,i,n);case 7:return tt(e,t,t.pendingProps,n),t.child;case 8:return tt(e,t,t.pendingProps.children,n),t.child;case 12:return tt(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(go,s._currentValue),s._currentValue=o,a!==null)if(Gt(a.value,o)){if(a.children===i.children&&!dt.current){t=jn(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=xn(-1,n&-n),c.tag=2;var d=a.updateQueue;if(d!==null){d=d.shared;var u=d.pending;u===null?c.next=c:(c.next=u.next,u.next=c),d.pending=c}}a.lanes|=n,c=a.alternate,c!==null&&(c.lanes|=n),Uc(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),Uc(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}tt(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,s=t.pendingProps.children,hr(t,n),i=Pt(i),s=s(i),t.flags|=1,tt(e,t,s,n),t.child;case 14:return s=t.type,i=Ft(s,t.pendingProps),i=Ft(s.type,i),Cp(e,t,s,i,n);case 15:return Dg(e,t,t.type,t.pendingProps,n);case 17:return s=t.type,i=t.pendingProps,i=t.elementType===s?i:Ft(s,i),Wa(e,t),t.tag=1,ut(s)?(e=!0,po(t)):e=!1,hr(t,n),zg(t,s,i),Wc(t,s,i,n),qc(null,t,s,!0,e,n);case 19:return Vg(e,t,n);case 22:return Og(e,t,n)}throw Error(F(156,t.tag))};function sx(e,t){return P0(e,t)}function ew(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 Et(e,t,n,s){return new ew(e,t,n,s)}function Su(e){return e=e.prototype,!(!e||!e.isReactComponent)}function tw(e){if(typeof e=="function")return Su(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Hd)return 11;if(e===Wd)return 14}return 2}function Kn(e,t){var n=e.alternate;return n===null?(n=Et(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 qa(e,t,n,s,i,a){var o=2;if(s=e,typeof e=="function")Su(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Gs:return ks(n.children,i,a,t);case Ud:o=8,i|=8;break;case mc:return e=Et(12,n,t,i|2),e.elementType=mc,e.lanes=a,e;case gc:return e=Et(13,n,t,i),e.elementType=gc,e.lanes=a,e;case xc:return e=Et(19,n,t,i),e.elementType=xc,e.lanes=a,e;case p0:return Go(n,i,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case u0:o=10;break e;case h0:o=9;break e;case Hd:o=11;break e;case Wd:o=14;break e;case zn:o=16,s=null;break e}throw Error(F(130,e==null?e:typeof e,""))}return t=Et(o,n,t,i),t.elementType=e,t.type=s,t.lanes=a,t}function ks(e,t,n,s){return e=Et(7,e,s,t),e.lanes=n,e}function Go(e,t,n,s){return e=Et(22,e,s,t),e.elementType=p0,e.lanes=n,e.stateNode={isHidden:!1},e}function Fl(e,t,n){return e=Et(6,e,null,t),e.lanes=n,e}function Vl(e,t,n){return t=Et(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function nw(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=wl(0),this.expirationTimes=wl(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=wl(0),this.identifierPrefix=s,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Cu(e,t,n,s,i,a,o,l,c){return e=new nw(e,t,n,l,c),t===1?(t=1,a===!0&&(t|=8)):t=0,a=Et(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:s,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},cu(a),e}function sw(e,t,n){var s=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Ws,key:s==null?null:""+s,children:e,containerInfo:t,implementation:n}}function rx(e){if(!e)return Qn;e=e._reactInternals;e:{if(Ms(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(ut(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(ut(n))return rg(e,n,t)}return t}function ix(e,t,n,s,i,a,o,l,c){return e=Cu(n,s,!0,e,i,a,o,l,c),e.context=rx(null),n=e.current,s=nt(),i=Gn(n),a=xn(s,i),a.callback=t??null,Hn(n,a,i),e.current.lanes=i,qi(e,i,s),ht(e,s),e}function Ko(e,t,n,s){var i=t.current,a=nt(),o=Gn(i);return n=rx(n),t.context===null?t.context=n:t.pendingContext=n,t=xn(a,o),t.payload={element:e},s=s===void 0?null:s,s!==null&&(t.callback=s),e=Hn(i,t,o),e!==null&&(Wt(e,i,o,a),$a(e,i,o)),o}function Co(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 Ip(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function _u(e,t){Ip(e,t),(e=e.alternate)&&Ip(e,t)}function rw(){return null}var ax=typeof reportError=="function"?reportError:function(e){console.error(e)};function Eu(e){this._internalRoot=e}qo.prototype.render=Eu.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(F(409));Ko(e,t,null,null)};qo.prototype.unmount=Eu.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Es(function(){Ko(null,e,null,null)}),t[wn]=null}};function qo(e){this._internalRoot=e}qo.prototype.unstable_scheduleHydration=function(e){if(e){var t=O0();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ln.length&&t!==0&&t<Ln[n].priority;n++);Ln.splice(n,0,e),n===0&&B0(e)}};function Tu(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Yo(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Bp(){}function iw(e,t,n,s,i){if(i){if(typeof s=="function"){var a=s;s=function(){var d=Co(o);a.call(d)}}var o=ix(t,s,e,0,null,!1,!1,"",Bp);return e._reactRootContainer=o,e[wn]=o.current,_i(e.nodeType===8?e.parentNode:e),Es(),o}for(;i=e.lastChild;)e.removeChild(i);if(typeof s=="function"){var l=s;s=function(){var d=Co(c);l.call(d)}}var c=Cu(e,0,!1,null,null,!1,!1,"",Bp);return e._reactRootContainer=c,e[wn]=c.current,_i(e.nodeType===8?e.parentNode:e),Es(function(){Ko(t,c,n,s)}),c}function Xo(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=Co(o);l.call(c)}}Ko(t,o,e,i)}else o=iw(n,t,e,i,s);return Co(o)}L0=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Xr(t.pendingLanes);n!==0&&(qd(t,n|1),ht(t,Pe()),!(oe&6)&&(br=Pe()+500,ss()))}break;case 13:Es(function(){var s=kn(e,1);if(s!==null){var i=nt();Wt(s,e,1,i)}}),_u(e,1)}};Yd=function(e){if(e.tag===13){var t=kn(e,134217728);if(t!==null){var n=nt();Wt(t,e,134217728,n)}_u(e,134217728)}};D0=function(e){if(e.tag===13){var t=Gn(e),n=kn(e,t);if(n!==null){var s=nt();Wt(n,e,t,s)}_u(e,t)}};O0=function(){return ce};I0=function(e,t){var n=ce;try{return ce=e,t()}finally{ce=n}};_c=function(e,t,n){switch(t){case"input":if(bc(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=Fo(s);if(!i)throw Error(F(90));m0(s),bc(s,i)}}}break;case"textarea":x0(e,n);break;case"select":t=n.value,t!=null&&lr(e,!!n.multiple,t,!1)}};N0=ku;S0=Es;var aw={usingClientEntryPoint:!1,Events:[Xi,Xs,Fo,k0,j0,ku]},Hr={findFiberByHostInstance:xs,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},ow={bundleType:Hr.bundleType,version:Hr.version,rendererPackageName:Hr.rendererPackageName,rendererConfig:Hr.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Cn.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=E0(e),e===null?null:e.stateNode},findFiberByHostInstance:Hr.findFiberByHostInstance||rw,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 Sa=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Sa.isDisabled&&Sa.supportsFiber)try{Do=Sa.inject(ow),tn=Sa}catch{}}bt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=aw;bt.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Tu(t))throw Error(F(200));return sw(e,t,null,n)};bt.createRoot=function(e,t){if(!Tu(e))throw Error(F(299));var n=!1,s="",i=ax;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=Cu(e,1,!1,null,null,n,!1,s,i),e[wn]=t.current,_i(e.nodeType===8?e.parentNode:e),new Eu(t)};bt.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=E0(t),e=e===null?null:e.stateNode,e};bt.flushSync=function(e){return Es(e)};bt.hydrate=function(e,t,n){if(!Yo(t))throw Error(F(200));return Xo(null,e,t,!0,n)};bt.hydrateRoot=function(e,t,n){if(!Tu(e))throw Error(F(405));var s=n!=null&&n.hydratedSources||null,i=!1,a="",o=ax;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(a=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),t=ix(t,null,e,1,n??null,i,!1,a,o),e[wn]=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 qo(t)};bt.render=function(e,t,n){if(!Yo(t))throw Error(F(200));return Xo(null,e,t,!1,n)};bt.unmountComponentAtNode=function(e){if(!Yo(e))throw Error(F(40));return e._reactRootContainer?(Es(function(){Xo(null,null,e,!1,function(){e._reactRootContainer=null,e[wn]=null})}),!0):!1};bt.unstable_batchedUpdates=ku;bt.unstable_renderSubtreeIntoContainer=function(e,t,n,s){if(!Yo(n))throw Error(F(200));if(e==null||e._reactInternals===void 0)throw Error(F(38));return Xo(e,t,n,!1,s)};bt.version="18.3.1-next-f1338f8080-20240426";function ox(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(ox)}catch(e){console.error(e)}}ox(),o0.exports=bt;var lx=o0.exports;const lw=Ym(lx);var cx,Fp=lx;cx=Fp.createRoot,Fp.hydrateRoot;/**
|
|
40
|
+
`+a.stack}return{value:e,source:t,stack:i,digest:null}}function Il(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Gc(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var Db=typeof WeakMap=="function"?WeakMap:Map;function zg(e,t,n){n=xn(-1,n),n.tag=3,n.payload={element:null};var s=t.value;return n.callback=function(){jo||(jo=!0,nd=s),Gc(e,t)},n}function Rg(e,t,n){n=xn(-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(){Gc(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch=="function"&&(n.callback=function(){Gc(e,t),typeof s!="function"&&(Wn===null?Wn=new Set([this]):Wn.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function kp(e,t,n){var s=e.pingCache;if(s===null){s=e.pingCache=new Db;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=Xb.bind(null,e,t,n),t.then(e,e))}function jp(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 Np(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=xn(-1,1),t.tag=2,Hn(n,t,1))),n.lanes|=1),e)}var Ob=Cn.ReactCurrentOwner,ct=!1;function tt(e,t,n,s){t.child=e===null?cg(t,null,n,s):xr(t,e.child,n,s)}function Sp(e,t,n,s,i){n=n.render;var a=t.ref;return hr(t,i),s=fu(e,t,n,s,a,i),n=mu(),e!==null&&!ct?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,jn(e,t,i)):(be&&n&&nu(t),t.flags|=1,tt(e,t,s,i),t.child)}function Cp(e,t,n,s,i){if(e===null){var a=n.type;return typeof a=="function"&&!Su(a)&&a.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=a,Lg(e,t,a,s,i)):(e=qa(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:Ci,n(o,s)&&e.ref===t.ref)return jn(e,t,i)}return t.flags|=1,e=Kn(a,s),e.ref=t.ref,e.return=t,t.child=e}function Lg(e,t,n,s,i){if(e!==null){var a=e.memoizedProps;if(Ci(a,s)&&e.ref===t.ref)if(ct=!1,t.pendingProps=s=a,(e.lanes&i)!==0)e.flags&131072&&(ct=!0);else return t.lanes=e.lanes,jn(e,t,i)}return Kc(e,t,n,s,i)}function Dg(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(nr,ft),ft|=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(nr,ft),ft|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},s=a!==null?a.baseLanes:n,me(nr,ft),ft|=s}else a!==null?(s=a.baseLanes|n,t.memoizedState=null):s=n,me(nr,ft),ft|=s;return tt(e,t,i,n),t.child}function Og(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Kc(e,t,n,s,i){var a=ut(n)?Ns:Qe.current;return a=mr(t,a),hr(t,i),n=fu(e,t,n,s,a,i),s=mu(),e!==null&&!ct?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,jn(e,t,i)):(be&&s&&nu(t),t.flags|=1,tt(e,t,n,i),t.child)}function _p(e,t,n,s,i){if(ut(n)){var a=!0;po(t)}else a=!1;if(hr(t,i),t.stateNode===null)Wa(e,t),Mg(t,n,s),Wc(t,n,s,i),s=!0;else if(e===null){var o=t.stateNode,l=t.memoizedProps;o.props=l;var c=o.context,d=n.contextType;typeof d=="object"&&d!==null?d=Pt(d):(d=ut(n)?Ns:Qe.current,d=mr(t,d));var u=n.getDerivedStateFromProps,p=typeof u=="function"||typeof o.getSnapshotBeforeUpdate=="function";p||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==s||c!==d)&&wp(t,o,s,d),Rn=!1;var h=t.memoizedState;o.state=h,yo(t,s,o,i),c=t.memoizedState,l!==s||h!==c||dt.current||Rn?(typeof u=="function"&&(Hc(t,n,u,s),c=t.memoizedState),(l=Rn||bp(t,n,l,s,h,c,d))?(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=d,s=l):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),s=!1)}else{o=t.stateNode,ug(e,t),l=t.memoizedProps,d=t.type===t.elementType?l:Ft(t.type,l),o.props=d,p=t.pendingProps,h=o.context,c=n.contextType,typeof c=="object"&&c!==null?c=Pt(c):(c=ut(n)?Ns:Qe.current,c=mr(t,c));var m=n.getDerivedStateFromProps;(u=typeof m=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==p||h!==c)&&wp(t,o,s,c),Rn=!1,h=t.memoizedState,o.state=h,yo(t,s,o,i);var y=t.memoizedState;l!==p||h!==y||dt.current||Rn?(typeof m=="function"&&(Hc(t,n,m,s),y=t.memoizedState),(d=Rn||bp(t,n,d,s,h,y,c)||!1)?(u||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(s,y,c),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(s,y,c)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=s,t.memoizedState=y),o.props=s,o.state=y,o.context=c,s=d):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),s=!1)}return qc(e,t,n,s,a,i)}function qc(e,t,n,s,i,a){Og(e,t);var o=(t.flags&128)!==0;if(!s&&!o)return i&&hp(t,n,!1),jn(e,t,a);s=t.stateNode,Ob.current=t;var l=o&&typeof n.getDerivedStateFromError!="function"?null:s.render();return t.flags|=1,e!==null&&o?(t.child=xr(t,e.child,null,a),t.child=xr(t,null,l,a)):tt(e,t,l,a),t.memoizedState=s.state,i&&hp(t,n,!0),t.child}function Ig(e){var t=e.stateNode;t.pendingContext?up(e,t.pendingContext,t.pendingContext!==t.context):t.context&&up(e,t.context,!1),du(e,t.containerInfo)}function Ep(e,t,n,s,i){return gr(),ru(i),t.flags|=256,tt(e,t,n,s),t.child}var Yc={dehydrated:null,treeContext:null,retryLane:0};function Xc(e){return{baseLanes:e,cachePool:null,transitions:null}}function Bg(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 $c(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=Go(o,s,0,null),e=ks(e,s,n,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=Xc(n),t.memoizedState=Yc,e):yu(t,o));if(i=e.memoizedState,i!==null&&(l=i.dehydrated,l!==null))return Ib(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=Kn(i,c),s.subtreeFlags=i.subtreeFlags&14680064),l!==null?a=Kn(l,a):(a=ks(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?Xc(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},a.memoizedState=o,a.childLanes=e.childLanes&~n,t.memoizedState=Yc,s}return a=e.child,e=a.sibling,s=Kn(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 yu(e,t){return t=Go({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function ka(e,t,n,s){return s!==null&&ru(s),xr(t,e.child,null,n),e=yu(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Ib(e,t,n,s,i,a,o){if(n)return t.flags&256?(t.flags&=-257,s=Il(Error(F(422))),ka(e,t,o,s)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(a=s.fallback,i=t.mode,s=Go({mode:"visible",children:s.children},i,0,null),a=ks(a,i,o,null),a.flags|=2,s.return=t,a.return=t,s.sibling=a,t.child=s,t.mode&1&&xr(t,e.child,null,o),t.child.memoizedState=Xc(o),t.memoizedState=Yc,a);if(!(t.mode&1))return ka(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=Il(a,s,void 0),ka(e,t,o,s)}if(l=(o&e.childLanes)!==0,ct||l){if(s=Be,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,kn(e,i),Wt(s,e,i,-1))}return Nu(),s=Il(Error(F(421))),ka(e,t,o,s)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=Qb.bind(null,e),i._reactRetry=t,null):(e=a.treeContext,mt=Un(i.nextSibling),gt=t,be=!0,Ut=null,e!==null&&(St[Ct++]=mn,St[Ct++]=gn,St[Ct++]=Ss,mn=e.id,gn=e.overflow,Ss=t),t=yu(t,s.children),t.flags|=4096,t)}function Tp(e,t,n){e.lanes|=t;var s=e.alternate;s!==null&&(s.lanes|=t),Uc(e.return,t,n)}function Bl(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 Fg(e,t,n){var s=t.pendingProps,i=s.revealOrder,a=s.tail;if(tt(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&&Tp(e,n,t);else if(e.tag===19)Tp(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&&vo(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Bl(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&&vo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Bl(t,!0,n,null,a);break;case"together":Bl(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Wa(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function jn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),_s|=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=Kn(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Kn(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Bb(e,t,n){switch(t.tag){case 3:Ig(t),gr();break;case 5:hg(t);break;case 1:ut(t.type)&&po(t);break;case 4:du(t,t.stateNode.containerInfo);break;case 10:var s=t.type._context,i=t.memoizedProps.value;me(go,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?Bg(e,t,n):(me(ke,ke.current&1),e=jn(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 Fg(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,Dg(e,t,n)}return jn(e,t,n)}var Vg,Qc,$g,Ug;Vg=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}};Qc=function(){};$g=function(e,t,n,s){var i=e.memoizedProps;if(i!==s){e=t.stateNode,vs(nn.current);var a=null;switch(n){case"input":i=vc(e,i),s=vc(e,s),a=[];break;case"select":i=Se({},i,{value:void 0}),s=Se({},s,{value:void 0}),a=[];break;case"textarea":i=kc(e,i),s=kc(e,s),a=[];break;default:typeof i.onClick!="function"&&typeof s.onClick=="function"&&(e.onclick=uo)}Nc(n,s);var o;n=null;for(d in i)if(!s.hasOwnProperty(d)&&i.hasOwnProperty(d)&&i[d]!=null)if(d==="style"){var l=i[d];for(o in l)l.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else d!=="dangerouslySetInnerHTML"&&d!=="children"&&d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&d!=="autoFocus"&&(vi.hasOwnProperty(d)?a||(a=[]):(a=a||[]).push(d,null));for(d in s){var c=s[d];if(l=i!=null?i[d]:void 0,s.hasOwnProperty(d)&&c!==l&&(c!=null||l!=null))if(d==="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(d,n)),n=c;else d==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,l=l?l.__html:void 0,c!=null&&l!==c&&(a=a||[]).push(d,c)):d==="children"?typeof c!="string"&&typeof c!="number"||(a=a||[]).push(d,""+c):d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&(vi.hasOwnProperty(d)?(c!=null&&d==="onScroll"&&ge("scroll",e),a||l===c||(a=[])):(a=a||[]).push(d,c))}n&&(a=a||[]).push("style",n);var d=a;(t.updateQueue=d)&&(t.flags|=4)}};Ug=function(e,t,n,s){n!==s&&(t.flags|=4)};function Ur(e,t){if(!be)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 We(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 Fb(e,t,n){var s=t.pendingProps;switch(su(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return We(t),null;case 1:return ut(t.type)&&ho(),We(t),null;case 3:return s=t.stateNode,yr(),xe(dt),xe(Qe),hu(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(e===null||e.child===null)&&(ba(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Ut!==null&&(id(Ut),Ut=null))),Qc(e,t),We(t),null;case 5:uu(t);var i=vs(Ai.current);if(n=t.type,e!==null&&t.stateNode!=null)$g(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 We(t),null}if(e=vs(nn.current),ba(t)){s=t.stateNode,n=t.type;var a=t.memoizedProps;switch(s[Zt]=t,s[Ti]=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<Qr.length;i++)ge(Qr[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":Ih(s,a),ge("invalid",s);break;case"select":s._wrapperState={wasMultiple:!!a.multiple},ge("invalid",s);break;case"textarea":Fh(s,a),ge("invalid",s)}Nc(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&&va(s.textContent,l,e),i=["children",l]):typeof l=="number"&&s.textContent!==""+l&&(a.suppressHydrationWarning!==!0&&va(s.textContent,l,e),i=["children",""+l]):vi.hasOwnProperty(o)&&l!=null&&o==="onScroll"&&ge("scroll",s)}switch(n){case"input":ua(s),Bh(s,a,!0);break;case"textarea":ua(s),Vh(s);break;case"select":case"option":break;default:typeof a.onClick=="function"&&(s.onclick=uo)}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=x0(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[Zt]=t,e[Ti]=s,Vg(e,t,!1,!1),t.stateNode=e;e:{switch(o=Sc(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<Qr.length;i++)ge(Qr[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":Ih(e,s),i=vc(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":Fh(e,s),i=kc(e,s),ge("invalid",e);break;default:i=s}Nc(n,i),l=i;for(a in l)if(l.hasOwnProperty(a)){var c=l[a];a==="style"?b0(e,c):a==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&y0(e,c)):a==="children"?typeof c=="string"?(n!=="textarea"||c!=="")&&bi(e,c):typeof c=="number"&&bi(e,""+c):a!=="suppressContentEditableWarning"&&a!=="suppressHydrationWarning"&&a!=="autoFocus"&&(vi.hasOwnProperty(a)?c!=null&&a==="onScroll"&&ge("scroll",e):c!=null&&$d(e,a,c,o))}switch(n){case"input":ua(e),Bh(e,s,!1);break;case"textarea":ua(e),Vh(e);break;case"option":s.value!=null&&e.setAttribute("value",""+Xn(s.value));break;case"select":e.multiple=!!s.multiple,a=s.value,a!=null?lr(e,!!s.multiple,a,!1):s.defaultValue!=null&&lr(e,!!s.multiple,s.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=uo)}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 We(t),null;case 6:if(e&&t.stateNode!=null)Ug(e,t,e.memoizedProps,s);else{if(typeof s!="string"&&t.stateNode===null)throw Error(F(166));if(n=vs(Ai.current),vs(nn.current),ba(t)){if(s=t.stateNode,n=t.memoizedProps,s[Zt]=t,(a=s.nodeValue!==n)&&(e=gt,e!==null))switch(e.tag){case 3:va(s.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&va(s.nodeValue,n,(e.mode&1)!==0)}a&&(t.flags|=4)}else s=(n.nodeType===9?n:n.ownerDocument).createTextNode(s),s[Zt]=t,t.stateNode=s}return We(t),null;case 13:if(xe(ke),s=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(be&&mt!==null&&t.mode&1&&!(t.flags&128))og(),gr(),t.flags|=98560,a=!1;else if(a=ba(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[Zt]=t}else gr(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;We(t),a=!1}else Ut!==null&&(id(Ut),Ut=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?De===0&&(De=3):Nu())),t.updateQueue!==null&&(t.flags|=4),We(t),null);case 4:return yr(),Qc(e,t),e===null&&_i(t.stateNode.containerInfo),We(t),null;case 10:return ou(t.type._context),We(t),null;case 17:return ut(t.type)&&ho(),We(t),null;case 19:if(xe(ke),a=t.memoizedState,a===null)return We(t),null;if(s=(t.flags&128)!==0,o=a.rendering,o===null)if(s)Ur(a,!1);else{if(De!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=vo(e),o!==null){for(t.flags|=128,Ur(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()>br&&(t.flags|=128,s=!0,Ur(a,!1),t.lanes=4194304)}else{if(!s)if(e=vo(o),e!==null){if(t.flags|=128,s=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Ur(a,!0),a.tail===null&&a.tailMode==="hidden"&&!o.alternate&&!be)return We(t),null}else 2*Pe()-a.renderingStartTime>br&&n!==1073741824&&(t.flags|=128,s=!0,Ur(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):(We(t),null);case 22:case 23:return ju(),s=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==s&&(t.flags|=8192),s&&t.mode&1?ft&1073741824&&(We(t),t.subtreeFlags&6&&(t.flags|=8192)):We(t),null;case 24:return null;case 25:return null}throw Error(F(156,t.tag))}function Vb(e,t){switch(su(t),t.tag){case 1:return ut(t.type)&&ho(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return yr(),xe(dt),xe(Qe),hu(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return uu(t),null;case 13:if(xe(ke),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(F(340));gr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return xe(ke),null;case 4:return yr(),null;case 10:return ou(t.type._context),null;case 22:case 23:return ju(),null;case 24:return null;default:return null}}var ja=!1,qe=!1,$b=typeof WeakSet=="function"?WeakSet:Set,K=null;function tr(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(s){_e(e,t,s)}else n.current=null}function Jc(e,t,n){try{n()}catch(s){_e(e,t,s)}}var Pp=!1;function Ub(e,t){if(Lc=oo,e=q0(),tu(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,d=0,u=0,p=e,h=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;)h=p,p=m;for(;;){if(p===e)break t;if(h===n&&++d===i&&(l=o),h===a&&++u===s&&(c=o),(m=p.nextSibling)!==null)break;p=h,h=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(Dc={focusedElem:e,selectionRange:n},oo=!1,K=t;K!==null;)if(t=K,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,K=e;else for(;K!==null;){t=K;try{var y=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var b=y.memoizedProps,v=y.memoizedState,g=t.stateNode,x=g.getSnapshotBeforeUpdate(t.elementType===t.type?b:Ft(t.type,b),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){_e(t,t.return,j)}if(e=t.sibling,e!==null){e.return=t.return,K=e;break}K=t.return}return y=Pp,Pp=!1,y}function ci(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&&Jc(t,n,a)}i=i.next}while(i!==s)}}function Ho(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 Zc(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 Hg(e){var t=e.alternate;t!==null&&(e.alternate=null,Hg(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Zt],delete t[Ti],delete t[Bc],delete t[Sb],delete t[Cb])),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 Wg(e){return e.tag===5||e.tag===3||e.tag===4}function Ap(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Wg(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 ed(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=uo));else if(s!==4&&(e=e.child,e!==null))for(ed(e,t,n),e=e.sibling;e!==null;)ed(e,t,n),e=e.sibling}function td(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(td(e,t,n),e=e.sibling;e!==null;)td(e,t,n),e=e.sibling}var Fe=null,Vt=!1;function An(e,t,n){for(n=n.child;n!==null;)Gg(e,t,n),n=n.sibling}function Gg(e,t,n){if(tn&&typeof tn.onCommitFiberUnmount=="function")try{tn.onCommitFiberUnmount(Do,n)}catch{}switch(n.tag){case 5:qe||tr(n,t);case 6:var s=Fe,i=Vt;Fe=null,An(e,t,n),Fe=s,Vt=i,Fe!==null&&(Vt?(e=Fe,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Fe.removeChild(n.stateNode));break;case 18:Fe!==null&&(Vt?(e=Fe,n=n.stateNode,e.nodeType===8?Ml(e.parentNode,n):e.nodeType===1&&Ml(e,n),Ni(e)):Ml(Fe,n.stateNode));break;case 4:s=Fe,i=Vt,Fe=n.stateNode.containerInfo,Vt=!0,An(e,t,n),Fe=s,Vt=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)&&Jc(n,t,o),i=i.next}while(i!==s)}An(e,t,n);break;case 1:if(!qe&&(tr(n,t),s=n.stateNode,typeof s.componentWillUnmount=="function"))try{s.props=n.memoizedProps,s.state=n.memoizedState,s.componentWillUnmount()}catch(l){_e(n,t,l)}An(e,t,n);break;case 21:An(e,t,n);break;case 22:n.mode&1?(qe=(s=qe)||n.memoizedState!==null,An(e,t,n),qe=s):An(e,t,n);break;default:An(e,t,n)}}function Mp(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new $b),t.forEach(function(s){var i=Jb.bind(null,e,s);n.has(s)||(n.add(s),s.then(i,i))})}}function Ot(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:Fe=l.stateNode,Vt=!1;break e;case 3:Fe=l.stateNode.containerInfo,Vt=!0;break e;case 4:Fe=l.stateNode.containerInfo,Vt=!0;break e}l=l.return}if(Fe===null)throw Error(F(160));Gg(a,o,i),Fe=null,Vt=!1;var c=i.alternate;c!==null&&(c.return=null),i.return=null}catch(d){_e(i,t,d)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Kg(t,e),t=t.sibling}function Kg(e,t){var n=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Ot(t,e),Qt(e),s&4){try{ci(3,e,e.return),Ho(3,e)}catch(b){_e(e,e.return,b)}try{ci(5,e,e.return)}catch(b){_e(e,e.return,b)}}break;case 1:Ot(t,e),Qt(e),s&512&&n!==null&&tr(n,n.return);break;case 5:if(Ot(t,e),Qt(e),s&512&&n!==null&&tr(n,n.return),e.flags&32){var i=e.stateNode;try{bi(i,"")}catch(b){_e(e,e.return,b)}}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&&m0(i,a),Sc(l,o);var d=Sc(l,a);for(o=0;o<c.length;o+=2){var u=c[o],p=c[o+1];u==="style"?b0(i,p):u==="dangerouslySetInnerHTML"?y0(i,p):u==="children"?bi(i,p):$d(i,u,p,d)}switch(l){case"input":bc(i,a);break;case"textarea":g0(i,a);break;case"select":var h=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!a.multiple;var m=a.value;m!=null?lr(i,!!a.multiple,m,!1):h!==!!a.multiple&&(a.defaultValue!=null?lr(i,!!a.multiple,a.defaultValue,!0):lr(i,!!a.multiple,a.multiple?[]:"",!1))}i[Ti]=a}catch(b){_e(e,e.return,b)}}break;case 6:if(Ot(t,e),Qt(e),s&4){if(e.stateNode===null)throw Error(F(162));i=e.stateNode,a=e.memoizedProps;try{i.nodeValue=a}catch(b){_e(e,e.return,b)}}break;case 3:if(Ot(t,e),Qt(e),s&4&&n!==null&&n.memoizedState.isDehydrated)try{Ni(t.containerInfo)}catch(b){_e(e,e.return,b)}break;case 4:Ot(t,e),Qt(e);break;case 13:Ot(t,e),Qt(e),i=e.child,i.flags&8192&&(a=i.memoizedState!==null,i.stateNode.isHidden=a,!a||i.alternate!==null&&i.alternate.memoizedState!==null||(wu=Pe())),s&4&&Mp(e);break;case 22:if(u=n!==null&&n.memoizedState!==null,e.mode&1?(qe=(d=qe)||u,Ot(t,e),qe=d):Ot(t,e),Qt(e),s&8192){if(d=e.memoizedState!==null,(e.stateNode.isHidden=d)&&!u&&e.mode&1)for(K=e,u=e.child;u!==null;){for(p=K=u;K!==null;){switch(h=K,m=h.child,h.tag){case 0:case 11:case 14:case 15:ci(4,h,h.return);break;case 1:tr(h,h.return);var y=h.stateNode;if(typeof y.componentWillUnmount=="function"){s=h,n=h.return;try{t=s,y.props=t.memoizedProps,y.state=t.memoizedState,y.componentWillUnmount()}catch(b){_e(s,n,b)}}break;case 5:tr(h,h.return);break;case 22:if(h.memoizedState!==null){Rp(p);continue}}m!==null?(m.return=h,K=m):Rp(p)}u=u.sibling}e:for(u=null,p=e;;){if(p.tag===5){if(u===null){u=p;try{i=p.stateNode,d?(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=v0("display",o))}catch(b){_e(e,e.return,b)}}}else if(p.tag===6){if(u===null)try{p.stateNode.nodeValue=d?"":p.memoizedProps}catch(b){_e(e,e.return,b)}}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;u===p&&(u=null),p=p.return}u===p&&(u=null),p.sibling.return=p.return,p=p.sibling}}break;case 19:Ot(t,e),Qt(e),s&4&&Mp(e);break;case 21:break;default:Ot(t,e),Qt(e)}}function Qt(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(Wg(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&&(bi(i,""),s.flags&=-33);var a=Ap(e);td(e,a,i);break;case 3:case 4:var o=s.stateNode.containerInfo,l=Ap(e);ed(e,l,o);break;default:throw Error(F(161))}}catch(c){_e(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Hb(e,t,n){K=e,qg(e)}function qg(e,t,n){for(var s=(e.mode&1)!==0;K!==null;){var i=K,a=i.child;if(i.tag===22&&s){var o=i.memoizedState!==null||ja;if(!o){var l=i.alternate,c=l!==null&&l.memoizedState!==null||qe;l=ja;var d=qe;if(ja=o,(qe=c)&&!d)for(K=i;K!==null;)o=K,c=o.child,o.tag===22&&o.memoizedState!==null?Lp(i):c!==null?(c.return=o,K=c):Lp(i);for(;a!==null;)K=a,qg(a),a=a.sibling;K=i,ja=l,qe=d}zp(e)}else i.subtreeFlags&8772&&a!==null?(a.return=i,K=a):zp(e)}}function zp(e){for(;K!==null;){var t=K;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:qe||Ho(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:Ft(t.type,n.memoizedProps);s.componentDidUpdate(i,n.memoizedState,s.__reactInternalSnapshotBeforeUpdate)}var a=t.updateQueue;a!==null&&xp(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}xp(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 d=t.alternate;if(d!==null){var u=d.memoizedState;if(u!==null){var p=u.dehydrated;p!==null&&Ni(p)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(F(163))}qe||t.flags&512&&Zc(t)}catch(h){_e(t,t.return,h)}}if(t===e){K=null;break}if(n=t.sibling,n!==null){n.return=t.return,K=n;break}K=t.return}}function Rp(e){for(;K!==null;){var t=K;if(t===e){K=null;break}var n=t.sibling;if(n!==null){n.return=t.return,K=n;break}K=t.return}}function Lp(e){for(;K!==null;){var t=K;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Ho(4,t)}catch(c){_e(t,n,c)}break;case 1:var s=t.stateNode;if(typeof s.componentDidMount=="function"){var i=t.return;try{s.componentDidMount()}catch(c){_e(t,i,c)}}var a=t.return;try{Zc(t)}catch(c){_e(t,a,c)}break;case 5:var o=t.return;try{Zc(t)}catch(c){_e(t,o,c)}}}catch(c){_e(t,t.return,c)}if(t===e){K=null;break}var l=t.sibling;if(l!==null){l.return=t.return,K=l;break}K=t.return}}var Wb=Math.ceil,ko=Cn.ReactCurrentDispatcher,vu=Cn.ReactCurrentOwner,Tt=Cn.ReactCurrentBatchConfig,oe=0,Be=null,Me=null,$e=0,ft=0,nr=ns(0),De=0,Li=null,_s=0,Wo=0,bu=0,di=null,lt=null,wu=0,br=1/0,hn=null,jo=!1,nd=null,Wn=null,Na=!1,In=null,No=0,ui=0,sd=null,Ga=-1,Ka=0;function nt(){return oe&6?Pe():Ga!==-1?Ga:Ga=Pe()}function Gn(e){return e.mode&1?oe&2&&$e!==0?$e&-$e:Eb.transition!==null?(Ka===0&&(Ka=M0()),Ka):(e=ce,e!==0||(e=window.event,e=e===void 0?16:B0(e.type)),e):1}function Wt(e,t,n,s){if(50<ui)throw ui=0,sd=null,Error(F(185));qi(e,n,s),(!(oe&2)||e!==Be)&&(e===Be&&(!(oe&2)&&(Wo|=n),De===4&&Dn(e,$e)),ht(e,s),n===1&&oe===0&&!(t.mode&1)&&(br=Pe()+500,Vo&&ss()))}function ht(e,t){var n=e.callbackNode;Ev(e,t);var s=ao(e,e===Be?$e:0);if(s===0)n!==null&&Hh(n),e.callbackNode=null,e.callbackPriority=0;else if(t=s&-s,e.callbackPriority!==t){if(n!=null&&Hh(n),t===1)e.tag===0?_b(Dp.bind(null,e)):rg(Dp.bind(null,e)),jb(function(){!(oe&6)&&ss()}),n=null;else{switch(z0(s)){case 1:n=Kd;break;case 4:n=P0;break;case 16:n=io;break;case 536870912:n=A0;break;default:n=io}n=nx(n,Yg.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Yg(e,t){if(Ga=-1,Ka=0,oe&6)throw Error(F(327));var n=e.callbackNode;if(pr()&&e.callbackNode!==n)return null;var s=ao(e,e===Be?$e:0);if(s===0)return null;if(s&30||s&e.expiredLanes||t)t=So(e,s);else{t=s;var i=oe;oe|=2;var a=Qg();(Be!==e||$e!==t)&&(hn=null,br=Pe()+500,ws(e,t));do try{qb();break}catch(l){Xg(e,l)}while(!0);au(),ko.current=a,oe=i,Me!==null?t=0:(Be=null,$e=0,t=De)}if(t!==0){if(t===2&&(i=Pc(e),i!==0&&(s=i,t=rd(e,i))),t===1)throw n=Li,ws(e,0),Dn(e,s),ht(e,Pe()),n;if(t===6)Dn(e,s);else{if(i=e.current.alternate,!(s&30)&&!Gb(i)&&(t=So(e,s),t===2&&(a=Pc(e),a!==0&&(s=a,t=rd(e,a))),t===1))throw n=Li,ws(e,0),Dn(e,s),ht(e,Pe()),n;switch(e.finishedWork=i,e.finishedLanes=s,t){case 0:case 1:throw Error(F(345));case 2:ps(e,lt,hn);break;case 3:if(Dn(e,s),(s&130023424)===s&&(t=wu+500-Pe(),10<t)){if(ao(e,0)!==0)break;if(i=e.suspendedLanes,(i&s)!==s){nt(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=Ic(ps.bind(null,e,lt,hn),t);break}ps(e,lt,hn);break;case 4:if(Dn(e,s),(s&4194240)===s)break;for(t=e.eventTimes,i=-1;0<s;){var o=31-Ht(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*Wb(s/1960))-s,10<s){e.timeoutHandle=Ic(ps.bind(null,e,lt,hn),s);break}ps(e,lt,hn);break;case 5:ps(e,lt,hn);break;default:throw Error(F(329))}}}return ht(e,Pe()),e.callbackNode===n?Yg.bind(null,e):null}function rd(e,t){var n=di;return e.current.memoizedState.isDehydrated&&(ws(e,t).flags|=256),e=So(e,t),e!==2&&(t=lt,lt=n,t!==null&&id(t)),e}function id(e){lt===null?lt=e:lt.push.apply(lt,e)}function Gb(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(!Gt(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 Dn(e,t){for(t&=~bu,t&=~Wo,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Ht(t),s=1<<n;e[n]=-1,t&=~s}}function Dp(e){if(oe&6)throw Error(F(327));pr();var t=ao(e,0);if(!(t&1))return ht(e,Pe()),null;var n=So(e,t);if(e.tag!==0&&n===2){var s=Pc(e);s!==0&&(t=s,n=rd(e,s))}if(n===1)throw n=Li,ws(e,0),Dn(e,t),ht(e,Pe()),n;if(n===6)throw Error(F(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,ps(e,lt,hn),ht(e,Pe()),null}function ku(e,t){var n=oe;oe|=1;try{return e(t)}finally{oe=n,oe===0&&(br=Pe()+500,Vo&&ss())}}function Es(e){In!==null&&In.tag===0&&!(oe&6)&&pr();var t=oe;oe|=1;var n=Tt.transition,s=ce;try{if(Tt.transition=null,ce=1,e)return e()}finally{ce=s,Tt.transition=n,oe=t,!(oe&6)&&ss()}}function ju(){ft=nr.current,xe(nr)}function ws(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,kb(n)),Me!==null)for(n=Me.return;n!==null;){var s=n;switch(su(s),s.tag){case 1:s=s.type.childContextTypes,s!=null&&ho();break;case 3:yr(),xe(dt),xe(Qe),hu();break;case 5:uu(s);break;case 4:yr();break;case 13:xe(ke);break;case 19:xe(ke);break;case 10:ou(s.type._context);break;case 22:case 23:ju()}n=n.return}if(Be=e,Me=e=Kn(e.current,null),$e=ft=t,De=0,Li=null,bu=Wo=_s=0,lt=di=null,ys!==null){for(t=0;t<ys.length;t++)if(n=ys[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}ys=null}return e}function Xg(e,t){do{var n=Me;try{if(au(),Ua.current=wo,bo){for(var s=Ne.memoizedState;s!==null;){var i=s.queue;i!==null&&(i.pending=null),s=s.next}bo=!1}if(Cs=0,Ie=Le=Ne=null,li=!1,Mi=0,vu.current=null,n===null||n.return===null){De=1,Li=t,Me=null;break}e:{var a=e,o=n.return,l=n,c=t;if(t=$e,l.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var d=c,u=l,p=u.tag;if(!(u.mode&1)&&(p===0||p===11||p===15)){var h=u.alternate;h?(u.updateQueue=h.updateQueue,u.memoizedState=h.memoizedState,u.lanes=h.lanes):(u.updateQueue=null,u.memoizedState=null)}var m=jp(o);if(m!==null){m.flags&=-257,Np(m,o,l,a,t),m.mode&1&&kp(a,d,t),t=m,c=d;var y=t.updateQueue;if(y===null){var b=new Set;b.add(c),t.updateQueue=b}else y.add(c);break e}else{if(!(t&1)){kp(a,d,t),Nu();break e}c=Error(F(426))}}else if(be&&l.mode&1){var v=jp(o);if(v!==null){!(v.flags&65536)&&(v.flags|=256),Np(v,o,l,a,t),ru(vr(c,l));break e}}a=c=vr(c,l),De!==4&&(De=2),di===null?di=[a]:di.push(a),a=o;do{switch(a.tag){case 3:a.flags|=65536,t&=-t,a.lanes|=t;var g=zg(a,c,t);gp(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"&&(Wn===null||!Wn.has(w)))){a.flags|=65536,t&=-t,a.lanes|=t;var j=Rg(a,l,t);gp(a,j);break e}}a=a.return}while(a!==null)}Zg(n)}catch(k){t=k,Me===n&&n!==null&&(Me=n=n.return);continue}break}while(!0)}function Qg(){var e=ko.current;return ko.current=wo,e===null?wo:e}function Nu(){(De===0||De===3||De===2)&&(De=4),Be===null||!(_s&268435455)&&!(Wo&268435455)||Dn(Be,$e)}function So(e,t){var n=oe;oe|=2;var s=Qg();(Be!==e||$e!==t)&&(hn=null,ws(e,t));do try{Kb();break}catch(i){Xg(e,i)}while(!0);if(au(),oe=n,ko.current=s,Me!==null)throw Error(F(261));return Be=null,$e=0,De}function Kb(){for(;Me!==null;)Jg(Me)}function qb(){for(;Me!==null&&!vv();)Jg(Me)}function Jg(e){var t=tx(e.alternate,e,ft);e.memoizedProps=e.pendingProps,t===null?Zg(e):Me=t,vu.current=null}function Zg(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=Vb(n,t),n!==null){n.flags&=32767,Me=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{De=6,Me=null;return}}else if(n=Fb(n,t,ft),n!==null){Me=n;return}if(t=t.sibling,t!==null){Me=t;return}Me=t=e}while(t!==null);De===0&&(De=5)}function ps(e,t,n){var s=ce,i=Tt.transition;try{Tt.transition=null,ce=1,Yb(e,t,n,s)}finally{Tt.transition=i,ce=s}return null}function Yb(e,t,n,s){do pr();while(In!==null);if(oe&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(Tv(e,a),e===Be&&(Me=Be=null,$e=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Na||(Na=!0,nx(io,function(){return pr(),null})),a=(n.flags&15990)!==0,n.subtreeFlags&15990||a){a=Tt.transition,Tt.transition=null;var o=ce;ce=1;var l=oe;oe|=4,vu.current=null,Ub(e,n),Kg(n,e),mb(Dc),oo=!!Lc,Dc=Lc=null,e.current=n,Hb(n),bv(),oe=l,ce=o,Tt.transition=a}else e.current=n;if(Na&&(Na=!1,In=e,No=i),a=e.pendingLanes,a===0&&(Wn=null),jv(n.stateNode),ht(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(jo)throw jo=!1,e=nd,nd=null,e;return No&1&&e.tag!==0&&pr(),a=e.pendingLanes,a&1?e===sd?ui++:(ui=0,sd=e):ui=0,ss(),null}function pr(){if(In!==null){var e=z0(No),t=Tt.transition,n=ce;try{if(Tt.transition=null,ce=16>e?16:e,In===null)var s=!1;else{if(e=In,In=null,No=0,oe&6)throw Error(F(331));var i=oe;for(oe|=4,K=e.current;K!==null;){var a=K,o=a.child;if(K.flags&16){var l=a.deletions;if(l!==null){for(var c=0;c<l.length;c++){var d=l[c];for(K=d;K!==null;){var u=K;switch(u.tag){case 0:case 11:case 15:ci(8,u,a)}var p=u.child;if(p!==null)p.return=u,K=p;else for(;K!==null;){u=K;var h=u.sibling,m=u.return;if(Hg(u),u===d){K=null;break}if(h!==null){h.return=m,K=h;break}K=m}}}var y=a.alternate;if(y!==null){var b=y.child;if(b!==null){y.child=null;do{var v=b.sibling;b.sibling=null,b=v}while(b!==null)}}K=a}}if(a.subtreeFlags&2064&&o!==null)o.return=a,K=o;else e:for(;K!==null;){if(a=K,a.flags&2048)switch(a.tag){case 0:case 11:case 15:ci(9,a,a.return)}var g=a.sibling;if(g!==null){g.return=a.return,K=g;break e}K=a.return}}var x=e.current;for(K=x;K!==null;){o=K;var w=o.child;if(o.subtreeFlags&2064&&w!==null)w.return=o,K=w;else e:for(o=x;K!==null;){if(l=K,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:Ho(9,l)}}catch(k){_e(l,l.return,k)}if(l===o){K=null;break e}var j=l.sibling;if(j!==null){j.return=l.return,K=j;break e}K=l.return}}if(oe=i,ss(),tn&&typeof tn.onPostCommitFiberRoot=="function")try{tn.onPostCommitFiberRoot(Do,e)}catch{}s=!0}return s}finally{ce=n,Tt.transition=t}}return!1}function Op(e,t,n){t=vr(n,t),t=zg(e,t,1),e=Hn(e,t,1),t=nt(),e!==null&&(qi(e,1,t),ht(e,t))}function _e(e,t,n){if(e.tag===3)Op(e,e,n);else for(;t!==null;){if(t.tag===3){Op(t,e,n);break}else if(t.tag===1){var s=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(Wn===null||!Wn.has(s))){e=vr(n,e),e=Rg(t,e,1),t=Hn(t,e,1),e=nt(),t!==null&&(qi(t,1,e),ht(t,e));break}}t=t.return}}function Xb(e,t,n){var s=e.pingCache;s!==null&&s.delete(t),t=nt(),e.pingedLanes|=e.suspendedLanes&n,Be===e&&($e&n)===n&&(De===4||De===3&&($e&130023424)===$e&&500>Pe()-wu?ws(e,0):bu|=n),ht(e,t)}function ex(e,t){t===0&&(e.mode&1?(t=fa,fa<<=1,!(fa&130023424)&&(fa=4194304)):t=1);var n=nt();e=kn(e,t),e!==null&&(qi(e,t,n),ht(e,n))}function Qb(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),ex(e,n)}function Jb(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),ex(e,n)}var tx;tx=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||dt.current)ct=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return ct=!1,Bb(e,t,n);ct=!!(e.flags&131072)}else ct=!1,be&&t.flags&1048576&&ig(t,mo,t.index);switch(t.lanes=0,t.tag){case 2:var s=t.type;Wa(e,t),e=t.pendingProps;var i=mr(t,Qe.current);hr(t,n),i=fu(null,t,s,e,i,n);var a=mu();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,ut(s)?(a=!0,po(t)):a=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,cu(t),i.updater=Uo,t.stateNode=i,i._reactInternals=t,Wc(t,s,e,n),t=qc(null,t,s,!0,a,n)):(t.tag=0,be&&a&&nu(t),tt(null,t,i,n),t=t.child),t;case 16:s=t.elementType;e:{switch(Wa(e,t),e=t.pendingProps,i=s._init,s=i(s._payload),t.type=s,i=t.tag=ew(s),e=Ft(s,e),i){case 0:t=Kc(null,t,s,e,n);break e;case 1:t=_p(null,t,s,e,n);break e;case 11:t=Sp(null,t,s,e,n);break e;case 14:t=Cp(null,t,s,Ft(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:Ft(s,i),Kc(e,t,s,i,n);case 1:return s=t.type,i=t.pendingProps,i=t.elementType===s?i:Ft(s,i),_p(e,t,s,i,n);case 3:e:{if(Ig(t),e===null)throw Error(F(387));s=t.pendingProps,a=t.memoizedState,i=a.element,ug(e,t),yo(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=vr(Error(F(423)),t),t=Ep(e,t,s,n,i);break e}else if(s!==i){i=vr(Error(F(424)),t),t=Ep(e,t,s,n,i);break e}else for(mt=Un(t.stateNode.containerInfo.firstChild),gt=t,be=!0,Ut=null,n=cg(t,null,s,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(gr(),s===i){t=jn(e,t,n);break e}tt(e,t,s,n)}t=t.child}return t;case 5:return hg(t),e===null&&$c(t),s=t.type,i=t.pendingProps,a=e!==null?e.memoizedProps:null,o=i.children,Oc(s,i)?o=null:a!==null&&Oc(s,a)&&(t.flags|=32),Og(e,t),tt(e,t,o,n),t.child;case 6:return e===null&&$c(t),null;case 13:return Bg(e,t,n);case 4:return du(t,t.stateNode.containerInfo),s=t.pendingProps,e===null?t.child=xr(t,null,s,n):tt(e,t,s,n),t.child;case 11:return s=t.type,i=t.pendingProps,i=t.elementType===s?i:Ft(s,i),Sp(e,t,s,i,n);case 7:return tt(e,t,t.pendingProps,n),t.child;case 8:return tt(e,t,t.pendingProps.children,n),t.child;case 12:return tt(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(go,s._currentValue),s._currentValue=o,a!==null)if(Gt(a.value,o)){if(a.children===i.children&&!dt.current){t=jn(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=xn(-1,n&-n),c.tag=2;var d=a.updateQueue;if(d!==null){d=d.shared;var u=d.pending;u===null?c.next=c:(c.next=u.next,u.next=c),d.pending=c}}a.lanes|=n,c=a.alternate,c!==null&&(c.lanes|=n),Uc(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),Uc(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}tt(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,s=t.pendingProps.children,hr(t,n),i=Pt(i),s=s(i),t.flags|=1,tt(e,t,s,n),t.child;case 14:return s=t.type,i=Ft(s,t.pendingProps),i=Ft(s.type,i),Cp(e,t,s,i,n);case 15:return Lg(e,t,t.type,t.pendingProps,n);case 17:return s=t.type,i=t.pendingProps,i=t.elementType===s?i:Ft(s,i),Wa(e,t),t.tag=1,ut(s)?(e=!0,po(t)):e=!1,hr(t,n),Mg(t,s,i),Wc(t,s,i,n),qc(null,t,s,!0,e,n);case 19:return Fg(e,t,n);case 22:return Dg(e,t,n)}throw Error(F(156,t.tag))};function nx(e,t){return T0(e,t)}function Zb(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 Et(e,t,n,s){return new Zb(e,t,n,s)}function Su(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ew(e){if(typeof e=="function")return Su(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Hd)return 11;if(e===Wd)return 14}return 2}function Kn(e,t){var n=e.alternate;return n===null?(n=Et(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 qa(e,t,n,s,i,a){var o=2;if(s=e,typeof e=="function")Su(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Gs:return ks(n.children,i,a,t);case Ud:o=8,i|=8;break;case mc:return e=Et(12,n,t,i|2),e.elementType=mc,e.lanes=a,e;case gc:return e=Et(13,n,t,i),e.elementType=gc,e.lanes=a,e;case xc:return e=Et(19,n,t,i),e.elementType=xc,e.lanes=a,e;case h0:return Go(n,i,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case d0:o=10;break e;case u0:o=9;break e;case Hd:o=11;break e;case Wd:o=14;break e;case zn:o=16,s=null;break e}throw Error(F(130,e==null?e:typeof e,""))}return t=Et(o,n,t,i),t.elementType=e,t.type=s,t.lanes=a,t}function ks(e,t,n,s){return e=Et(7,e,s,t),e.lanes=n,e}function Go(e,t,n,s){return e=Et(22,e,s,t),e.elementType=h0,e.lanes=n,e.stateNode={isHidden:!1},e}function Fl(e,t,n){return e=Et(6,e,null,t),e.lanes=n,e}function Vl(e,t,n){return t=Et(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function tw(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=wl(0),this.expirationTimes=wl(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=wl(0),this.identifierPrefix=s,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Cu(e,t,n,s,i,a,o,l,c){return e=new tw(e,t,n,l,c),t===1?(t=1,a===!0&&(t|=8)):t=0,a=Et(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:s,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},cu(a),e}function nw(e,t,n){var s=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Ws,key:s==null?null:""+s,children:e,containerInfo:t,implementation:n}}function sx(e){if(!e)return Qn;e=e._reactInternals;e:{if(Ms(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(ut(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(ut(n))return sg(e,n,t)}return t}function rx(e,t,n,s,i,a,o,l,c){return e=Cu(n,s,!0,e,i,a,o,l,c),e.context=sx(null),n=e.current,s=nt(),i=Gn(n),a=xn(s,i),a.callback=t??null,Hn(n,a,i),e.current.lanes=i,qi(e,i,s),ht(e,s),e}function Ko(e,t,n,s){var i=t.current,a=nt(),o=Gn(i);return n=sx(n),t.context===null?t.context=n:t.pendingContext=n,t=xn(a,o),t.payload={element:e},s=s===void 0?null:s,s!==null&&(t.callback=s),e=Hn(i,t,o),e!==null&&(Wt(e,i,o,a),$a(e,i,o)),o}function Co(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 Ip(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function _u(e,t){Ip(e,t),(e=e.alternate)&&Ip(e,t)}function sw(){return null}var ix=typeof reportError=="function"?reportError:function(e){console.error(e)};function Eu(e){this._internalRoot=e}qo.prototype.render=Eu.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(F(409));Ko(e,t,null,null)};qo.prototype.unmount=Eu.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Es(function(){Ko(null,e,null,null)}),t[wn]=null}};function qo(e){this._internalRoot=e}qo.prototype.unstable_scheduleHydration=function(e){if(e){var t=D0();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ln.length&&t!==0&&t<Ln[n].priority;n++);Ln.splice(n,0,e),n===0&&I0(e)}};function Tu(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Yo(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Bp(){}function rw(e,t,n,s,i){if(i){if(typeof s=="function"){var a=s;s=function(){var d=Co(o);a.call(d)}}var o=rx(t,s,e,0,null,!1,!1,"",Bp);return e._reactRootContainer=o,e[wn]=o.current,_i(e.nodeType===8?e.parentNode:e),Es(),o}for(;i=e.lastChild;)e.removeChild(i);if(typeof s=="function"){var l=s;s=function(){var d=Co(c);l.call(d)}}var c=Cu(e,0,!1,null,null,!1,!1,"",Bp);return e._reactRootContainer=c,e[wn]=c.current,_i(e.nodeType===8?e.parentNode:e),Es(function(){Ko(t,c,n,s)}),c}function Xo(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=Co(o);l.call(c)}}Ko(t,o,e,i)}else o=rw(n,t,e,i,s);return Co(o)}R0=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Xr(t.pendingLanes);n!==0&&(qd(t,n|1),ht(t,Pe()),!(oe&6)&&(br=Pe()+500,ss()))}break;case 13:Es(function(){var s=kn(e,1);if(s!==null){var i=nt();Wt(s,e,1,i)}}),_u(e,1)}};Yd=function(e){if(e.tag===13){var t=kn(e,134217728);if(t!==null){var n=nt();Wt(t,e,134217728,n)}_u(e,134217728)}};L0=function(e){if(e.tag===13){var t=Gn(e),n=kn(e,t);if(n!==null){var s=nt();Wt(n,e,t,s)}_u(e,t)}};D0=function(){return ce};O0=function(e,t){var n=ce;try{return ce=e,t()}finally{ce=n}};_c=function(e,t,n){switch(t){case"input":if(bc(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=Fo(s);if(!i)throw Error(F(90));f0(s),bc(s,i)}}}break;case"textarea":g0(e,n);break;case"select":t=n.value,t!=null&&lr(e,!!n.multiple,t,!1)}};j0=ku;N0=Es;var iw={usingClientEntryPoint:!1,Events:[Xi,Xs,Fo,w0,k0,ku]},Hr={findFiberByHostInstance:xs,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},aw={bundleType:Hr.bundleType,version:Hr.version,rendererPackageName:Hr.rendererPackageName,rendererConfig:Hr.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Cn.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=_0(e),e===null?null:e.stateNode},findFiberByHostInstance:Hr.findFiberByHostInstance||sw,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 Sa=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Sa.isDisabled&&Sa.supportsFiber)try{Do=Sa.inject(aw),tn=Sa}catch{}}bt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=iw;bt.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Tu(t))throw Error(F(200));return nw(e,t,null,n)};bt.createRoot=function(e,t){if(!Tu(e))throw Error(F(299));var n=!1,s="",i=ix;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=Cu(e,1,!1,null,null,n,!1,s,i),e[wn]=t.current,_i(e.nodeType===8?e.parentNode:e),new Eu(t)};bt.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=_0(t),e=e===null?null:e.stateNode,e};bt.flushSync=function(e){return Es(e)};bt.hydrate=function(e,t,n){if(!Yo(t))throw Error(F(200));return Xo(null,e,t,!0,n)};bt.hydrateRoot=function(e,t,n){if(!Tu(e))throw Error(F(405));var s=n!=null&&n.hydratedSources||null,i=!1,a="",o=ix;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(a=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),t=rx(t,null,e,1,n??null,i,!1,a,o),e[wn]=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 qo(t)};bt.render=function(e,t,n){if(!Yo(t))throw Error(F(200));return Xo(null,e,t,!1,n)};bt.unmountComponentAtNode=function(e){if(!Yo(e))throw Error(F(40));return e._reactRootContainer?(Es(function(){Xo(null,null,e,!1,function(){e._reactRootContainer=null,e[wn]=null})}),!0):!1};bt.unstable_batchedUpdates=ku;bt.unstable_renderSubtreeIntoContainer=function(e,t,n,s){if(!Yo(n))throw Error(F(200));if(e==null||e._reactInternals===void 0)throw Error(F(38));return Xo(e,t,n,!1,s)};bt.version="18.3.1-next-f1338f8080-20240426";function ax(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(ax)}catch(e){console.error(e)}}ax(),a0.exports=bt;var ox=a0.exports;const ow=qm(ox);var lx,Fp=ox;lx=Fp.createRoot,Fp.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 Di(){return Di=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},Di.apply(this,arguments)}var Bn;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Bn||(Bn={}));const Vp="popstate";function
|
|
49
|
+
*/function Di(){return Di=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},Di.apply(this,arguments)}var Bn;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Bn||(Bn={}));const Vp="popstate";function lw(e){e===void 0&&(e={});function t(s,i){let{pathname:a,search:o,hash:l}=s.location;return ad("",{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:_o(i)}return dw(t,n,null,e)}function Ae(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Pu(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function cw(){return Math.random().toString(36).substr(2,8)}function $p(e,t){return{usr:e.state,key:e.key,idx:t}}function ad(e,t,n,s){return n===void 0&&(n=null),Di({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Tr(t):t,{state:n,key:t&&t.key||s||cw()})}function _o(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 Tr(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 dw(e,t,n,s){s===void 0&&(s={});let{window:i=document.defaultView,v5Compat:a=!1}=s,o=i.history,l=Bn.Pop,c=null,d=u();d==null&&(d=0,o.replaceState(Di({},o.state,{idx:d}),""));function u(){return(o.state||{idx:null}).idx}function p(){l=Bn.Pop;let v=u(),g=v==null?null:v-d;d=v,c&&c({action:l,location:b.location,delta:g})}function h(v,g){l=Bn.Push;let x=ad(b.location,v,g);d=u()+1;let w=$p(x,d),j=b.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:b.location,delta:1})}function m(v,g){l=Bn.Replace;let x=ad(b.location,v,g);d=u();let w=$p(x,d),j=b.createHref(x);o.replaceState(w,"",j),a&&c&&c({action:l,location:b.location,delta:0})}function y(v){let g=i.location.origin!=="null"?i.location.origin:i.location.href,x=typeof v=="string"?v:_o(v);return x=x.replace(/ $/,"%20"),Ae(g,"No window.location.(origin|href) available to create URL for href: "+x),new URL(x,g)}let b={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(Vp,p),c=v,()=>{i.removeEventListener(Vp,p),c=null}},createHref(v){return t(i,v)},createURL:y,encodeLocation(v){let g=y(v);return{pathname:g.pathname,search:g.search,hash:g.hash}},push:h,replace:m,go(v){return o.go(v)}};return b}var Up;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Up||(Up={}));function uw(e,t,n){return n===void 0&&(n="/"),hw(e,t,n)}function hw(e,t,n,s){let i=typeof t=="string"?Tr(t):t,a=Au(i.pathname||"/",n);if(a==null)return null;let o=cx(e);pw(o);let l=null;for(let c=0;l==null&&c<o.length;++c){let d=Sw(a);l=kw(o[c],d)}return l}function cx(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 d=qn([s,c.relativePath]),u=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 "'+d+'".')),cx(a.children,t,u,d)),!(a.path==null&&!a.index)&&t.push({path:d,score:bw(d,a.index),routesMeta:u})};return e.forEach((a,o)=>{var l;if(a.path===""||!((l=a.path)!=null&&l.includes("?")))i(a,o);else for(let c of dx(a.path))i(a,o,c)}),t}function dx(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=dx(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 pw(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:ww(t.routesMeta.map(s=>s.childrenIndex),n.routesMeta.map(s=>s.childrenIndex)))}const fw=/^:[\w-]+$/,mw=3,gw=2,xw=1,yw=10,vw=-2,Hp=e=>e==="*";function bw(e,t){let n=e.split("/"),s=n.length;return n.some(Hp)&&(s+=vw),t&&(s+=gw),n.filter(i=>!Hp(i)).reduce((i,a)=>i+(fw.test(a)?mw:a===""?xw:yw),s)}function ww(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 kw(e,t,n){let{routesMeta:s}=e,i={},a="/",o=[];for(let l=0;l<s.length;++l){let c=s[l],d=l===s.length-1,u=a==="/"?t:t.slice(a.length)||"/",p=jw({path:c.relativePath,caseSensitive:c.caseSensitive,end:d},u),h=c.route;if(!p)return null;Object.assign(i,p.params),o.push({params:i,pathname:qn([a,p.pathname]),pathnameBase:Pw(qn([a,p.pathnameBase])),route:h}),p.pathnameBase!=="/"&&(a=qn([a,p.pathnameBase]))}return o}function jw(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,s]=Nw(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((d,u,p)=>{let{paramName:h,isOptional:m}=u;if(h==="*"){let b=l[p]||"";o=a.slice(0,a.length-b.length).replace(/(.)\/+$/,"$1")}const y=l[p];return m&&!y?d[h]=void 0:d[h]=(y||"").replace(/%2F/g,"/"),d},{}),pathname:a,pathnameBase:o,pattern:e}}function Nw(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Pu(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 Sw(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Pu(!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 Au(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 Cw=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,_w=e=>Cw.test(e);function Ew(e,t){t===void 0&&(t="/");let{pathname:n,search:s="",hash:i=""}=typeof e=="string"?Tr(e):e,a;if(n)if(_w(n))a=n;else{if(n.includes("//")){let o=n;n=n.replace(/\/\/+/g,"/"),Pu(!1,"Pathnames cannot have embedded double slashes - normalizing "+(o+" -> "+n))}n.startsWith("/")?a=Wp(n.substring(1),"/"):a=Wp(n,t)}else a=t;return{pathname:a,search:Aw(s),hash:Mw(i)}}function Wp(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 $l(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 Tw(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Mu(e,t){let n=Tw(e);return t?n.map((s,i)=>i===n.length-1?s.pathname:s.pathnameBase):n.map(s=>s.pathnameBase)}function zu(e,t,n,s){s===void 0&&(s=!1);let i;typeof e=="string"?i=Tr(e):(i=Di({},e),Ae(!i.pathname||!i.pathname.includes("?"),$l("?","pathname","search",i)),Ae(!i.pathname||!i.pathname.includes("#"),$l("#","pathname","hash",i)),Ae(!i.search||!i.search.includes("#"),$l("#","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 h=o.split("/");for(;h[0]==="..";)h.shift(),p-=1;i.pathname=h.join("/")}l=p>=0?t[p]:"/"}let c=Ew(i,l),d=o&&o!=="/"&&o.endsWith("/"),u=(a||o===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(d||u)&&(c.pathname+="/"),c}const qn=e=>e.join("/").replace(/\/\/+/g,"/"),Pw=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Aw=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Mw=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function zw(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const ux=["post","put","patch","delete"];new Set(ux);const Rw=["get",...ux];new Set(Rw);/**
|
|
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 Oi(){return Oi=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},Oi.apply(this,arguments)}const Ru=f.createContext(null),
|
|
58
|
+
*/function Oi(){return Oi=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},Oi.apply(this,arguments)}const Ru=f.createContext(null),Lw=f.createContext(null),rs=f.createContext(null),Qo=f.createContext(null),_n=f.createContext({outlet:null,matches:[],isDataRoute:!1}),hx=f.createContext(null);function Dw(e,t){let{relative:n}=t===void 0?{}:t;Pr()||Ae(!1);let{basename:s,navigator:i}=f.useContext(rs),{hash:a,pathname:o,search:l}=fx(e,{relative:n}),c=o;return s!=="/"&&(c=o==="/"?s:qn([s,o])),i.createHref({pathname:c,search:l,hash:a})}function Pr(){return f.useContext(Qo)!=null}function is(){return Pr()||Ae(!1),f.useContext(Qo).location}function px(e){f.useContext(rs).static||f.useLayoutEffect(e)}function un(){let{isDataRoute:e}=f.useContext(_n);return e?Qw():Ow()}function Ow(){Pr()||Ae(!1);let e=f.useContext(Ru),{basename:t,future:n,navigator:s}=f.useContext(rs),{matches:i}=f.useContext(_n),{pathname:a}=is(),o=JSON.stringify(Mu(i,n.v7_relativeSplatPath)),l=f.useRef(!1);return px(()=>{l.current=!0}),f.useCallback(function(d,u){if(u===void 0&&(u={}),!l.current)return;if(typeof d=="number"){s.go(d);return}let p=zu(d,JSON.parse(o),a,u.relative==="path");e==null&&t!=="/"&&(p.pathname=p.pathname==="/"?t:qn([t,p.pathname])),(u.replace?s.replace:s.push)(p,u.state,u)},[t,s,o,a,e])}const Iw=f.createContext(null);function Bw(e){let t=f.useContext(_n).outlet;return t&&f.createElement(Iw.Provider,{value:e},t)}function fx(e,t){let{relative:n}=t===void 0?{}:t,{future:s}=f.useContext(rs),{matches:i}=f.useContext(_n),{pathname:a}=is(),o=JSON.stringify(Mu(i,s.v7_relativeSplatPath));return f.useMemo(()=>zu(e,JSON.parse(o),a,n==="path"),[e,o,a,n])}function Fw(e,t){return Vw(e,t)}function Vw(e,t,n,s){Pr()||Ae(!1);let{navigator:i}=f.useContext(rs),{matches:a}=f.useContext(_n),o=a[a.length-1],l=o?o.params:{};o&&o.pathname;let c=o?o.pathnameBase:"/";o&&o.route;let d=is(),u;if(t){var p;let v=typeof t=="string"?Tr(t):t;c==="/"||(p=v.pathname)!=null&&p.startsWith(c)||Ae(!1),u=v}else u=d;let h=u.pathname||"/",m=h;if(c!=="/"){let v=c.replace(/^\//,"").split("/");m="/"+h.replace(/^\//,"").split("/").slice(v.length).join("/")}let y=uw(e,{pathname:m}),b=Gw(y&&y.map(v=>Object.assign({},v,{params:Object.assign({},l,v.params),pathname:qn([c,i.encodeLocation?i.encodeLocation(v.pathname).pathname:v.pathname]),pathnameBase:v.pathnameBase==="/"?c:qn([c,i.encodeLocation?i.encodeLocation(v.pathnameBase).pathname:v.pathnameBase])})),a,n,s);return t&&b?f.createElement(Qo.Provider,{value:{location:Oi({pathname:"/",search:"",hash:"",state:null,key:"default"},u),navigationType:Bn.Pop}},b):b}function $w(){let e=Xw(),t=zw(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 f.createElement(f.Fragment,null,f.createElement("h2",null,"Unexpected Application Error!"),f.createElement("h3",{style:{fontStyle:"italic"}},t),n?f.createElement("pre",{style:i},n):null,null)}const Uw=f.createElement($w,null);class Hw extends f.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?f.createElement(_n.Provider,{value:this.props.routeContext},f.createElement(hx.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Ww(e){let{routeContext:t,match:n,children:s}=e,i=f.useContext(Ru);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),f.createElement(_n.Provider,{value:t},s)}function Gw(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 u=o.findIndex(p=>p.route.id&&(l==null?void 0:l[p.route.id])!==void 0);u>=0||Ae(!1),o=o.slice(0,Math.min(o.length,u+1))}let c=!1,d=-1;if(n&&s&&s.v7_partialHydration)for(let u=0;u<o.length;u++){let p=o[u];if((p.route.HydrateFallback||p.route.hydrateFallbackElement)&&(d=u),p.route.id){let{loaderData:h,errors:m}=n,y=p.route.loader&&h[p.route.id]===void 0&&(!m||m[p.route.id]===void 0);if(p.route.lazy||y){c=!0,d>=0?o=o.slice(0,d+1):o=[o[0]];break}}}return o.reduceRight((u,p,h)=>{let m,y=!1,b=null,v=null;n&&(m=l&&p.route.id?l[p.route.id]:void 0,b=p.route.errorElement||Uw,c&&(d<0&&h===0?(Jw("route-fallback"),y=!0,v=null):d===h&&(y=!0,v=p.route.hydrateFallbackElement||null)));let g=t.concat(o.slice(0,h+1)),x=()=>{let w;return m?w=b:y?w=v:p.route.Component?w=f.createElement(p.route.Component,null):p.route.element?w=p.route.element:w=u,f.createElement(Ww,{match:p,routeContext:{outlet:u,matches:g,isDataRoute:n!=null},children:w})};return n&&(p.route.ErrorBoundary||p.route.errorElement||h===0)?f.createElement(Hw,{location:n.location,revalidation:n.revalidation,component:b,error:m,children:x(),routeContext:{outlet:null,matches:g,isDataRoute:!0}}):x()},null)}var mx=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(mx||{}),gx=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}(gx||{});function Kw(e){let t=f.useContext(Ru);return t||Ae(!1),t}function qw(e){let t=f.useContext(Lw);return t||Ae(!1),t}function Yw(e){let t=f.useContext(_n);return t||Ae(!1),t}function xx(e){let t=Yw(),n=t.matches[t.matches.length-1];return n.route.id||Ae(!1),n.route.id}function Xw(){var e;let t=f.useContext(hx),n=qw(),s=xx();return t!==void 0?t:(e=n.errors)==null?void 0:e[s]}function Qw(){let{router:e}=Kw(mx.UseNavigateStable),t=xx(gx.UseNavigateStable),n=f.useRef(!1);return px(()=>{n.current=!0}),f.useCallback(function(i,a){a===void 0&&(a={}),n.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,Oi({fromRouteId:t},a)))},[e,t])}const Gp={};function Jw(e,t,n){Gp[e]||(Gp[e]=!0)}function Zw(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function Kp(e){let{to:t,replace:n,state:s,relative:i}=e;Pr()||Ae(!1);let{future:a,static:o}=f.useContext(rs),{matches:l}=f.useContext(_n),{pathname:c}=is(),d=un(),u=zu(t,Mu(l,a.v7_relativeSplatPath),c,i==="path"),p=JSON.stringify(u);return f.useEffect(()=>d(JSON.parse(p),{replace:n,state:s,relative:i}),[d,p,i,n,s]),null}function e2(e){return Bw(e.context)}function we(e){Ae(!1)}function t2(e){let{basename:t="/",children:n=null,location:s,navigationType:i=Bn.Pop,navigator:a,static:o=!1,future:l}=e;Pr()&&Ae(!1);let c=t.replace(/^\/*/,"/"),d=f.useMemo(()=>({basename:c,navigator:a,static:o,future:Oi({v7_relativeSplatPath:!1},l)}),[c,l,a,o]);typeof s=="string"&&(s=Tr(s));let{pathname:u="/",search:p="",hash:h="",state:m=null,key:y="default"}=s,b=f.useMemo(()=>{let v=Au(u,c);return v==null?null:{location:{pathname:v,search:p,hash:h,state:m,key:y},navigationType:i}},[c,u,p,h,m,y,i]);return b==null?null:f.createElement(rs.Provider,{value:d},f.createElement(Qo.Provider,{children:n,value:b}))}function n2(e){let{children:t,location:n}=e;return Fw(od(t),n)}new Promise(()=>{});function od(e,t){t===void 0&&(t=[]);let n=[];return f.Children.forEach(e,(s,i)=>{if(!f.isValidElement(s))return;let a=[...t,i];if(s.type===f.Fragment){n.push.apply(n,od(s.props.children,a));return}s.type!==we&&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=od(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 ld(){return ld=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},ld.apply(this,arguments)}function r2(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 i2(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function a2(e,t){return e.button===0&&(!t||t==="_self")&&!i2(e)}function cd(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 o2(e,t){let n=cd(e);return t&&t.forEach((s,i)=>{n.has(i)||t.getAll(i).forEach(a=>{n.append(i,a)})}),n}const l2=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],c2="6";try{window.__reactRouterVersion=c2}catch{}const d2="startTransition",qp=Q1[d2];function u2(e){let{basename:t,children:n,future:s,window:i}=e,a=f.useRef();a.current==null&&(a.current=cw({window:i,v5Compat:!0}));let o=a.current,[l,c]=f.useState({action:o.action,location:o.location}),{v7_startTransition:d}=s||{},u=f.useCallback(p=>{d&&qp?qp(()=>c(p)):c(p)},[c,d]);return f.useLayoutEffect(()=>o.listen(u),[o,u]),f.useEffect(()=>e2(s),[s]),f.createElement(n2,{basename:t,children:n,location:l.location,navigationType:l.action,navigator:o,future:s})}const h2=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",p2=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,hi=f.forwardRef(function(t,n){let{onClick:s,relative:i,reloadDocument:a,replace:o,state:l,target:c,to:d,preventScrollReset:u,viewTransition:p}=t,h=r2(t,l2),{basename:m}=f.useContext(rs),y,b=!1;if(typeof d=="string"&&p2.test(d)&&(y=d,h2))try{let w=new URL(window.location.href),j=d.startsWith("//")?new URL(w.protocol+d):new URL(d),k=Au(j.pathname,m);j.origin===w.origin&&k!=null?d=k+j.search+j.hash:b=!0}catch{}let v=Ow(d,{relative:i}),g=f2(d,{replace:o,state:l,target:c,preventScrollReset:u,relative:i,viewTransition:p});function x(w){s&&s(w),w.defaultPrevented||g(w)}return f.createElement("a",ld({},h,{href:y||v,onClick:b||a?s:x,ref:n,target:c}))});var Yp;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Yp||(Yp={}));var Xp;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Xp||(Xp={}));function f2(e,t){let{target:n,replace:s,state:i,preventScrollReset:a,relative:o,viewTransition:l}=t===void 0?{}:t,c=un(),d=is(),u=mx(e,{relative:o});return f.useCallback(p=>{if(a2(p,n)){p.preventDefault();let h=s!==void 0?s:_o(d)===_o(u);c(e,{replace:h,state:i,preventScrollReset:a,relative:o,viewTransition:l})}},[d,c,u,s,i,n,e,a,o,l])}function m2(e){let t=f.useRef(cd(e)),n=f.useRef(!1),s=is(),i=f.useMemo(()=>o2(s.search,n.current?null:t.current),[s.search]),a=un(),o=f.useCallback((l,c)=>{const d=cd(typeof l=="function"?l(i):l);n.current=!0,a("?"+d,c)},[a,i]);return[i,o]}var g2=e=>{switch(e){case"success":return v2;case"info":return w2;case"warning":return b2;case"error":return k2;default:return null}},x2=Array(12).fill(0),y2=({visible:e,className:t})=>H.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},H.createElement("div",{className:"sonner-spinner"},x2.map((n,s)=>H.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${s}`})))),v2=H.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},H.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"})),b2=H.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},H.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"})),w2=H.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},H.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"})),k2=H.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},H.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"})),j2=H.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"},H.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),H.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),N2=()=>{let[e,t]=H.useState(document.hidden);return H.useEffect(()=>{let n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},dd=1,S2=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:dd++,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],H.isValidElement(c))i=!1,this.create({id:n,type:"default",message:c});else if(_2(c)&&!c.ok){i=!1;let d=typeof t.error=="function"?await t.error(`HTTP error! status: ${c.status}`):t.error,u=typeof t.description=="function"?await t.description(`HTTP error! status: ${c.status}`):t.description;this.create({id:n,type:"error",message:d,description:u})}else if(t.success!==void 0){i=!1;let d=typeof t.success=="function"?await t.success(c):t.success,u=typeof t.description=="function"?await t.description(c):t.description;this.create({id:n,type:"success",message:d,description:u})}}).catch(async c=>{if(a=["reject",c],t.error!==void 0){i=!1;let d=typeof t.error=="function"?await t.error(c):t.error,u=typeof t.description=="function"?await t.description(c):t.description;this.create({id:n,type:"error",message:d,description:u})}}).finally(()=>{var c;i&&(this.dismiss(n),n=void 0),(c=t.finally)==null||c.call(t)}),l=()=>new Promise((c,d)=>o.then(()=>a[0]==="reject"?d(a[1]):c(a[1])).catch(d));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)||dd++;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}},ot=new S2,C2=(e,t)=>{let n=(t==null?void 0:t.id)||dd++;return ot.addToast({title:e,...t,id:n}),n},_2=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",E2=C2,T2=()=>ot.toasts,P2=()=>ot.getActiveToasts(),pe=Object.assign(E2,{success:ot.success,info:ot.info,warning:ot.warning,error:ot.error,custom:ot.custom,message:ot.message,promise:ot.promise,dismiss:ot.dismiss,loading:ot.loading},{getHistory:T2,getToasts:P2});function A2(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))}A2(`: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 Ca(e){return e.label!==void 0}var M2=3,z2="32px",R2="16px",Qp=4e3,L2=356,D2=14,O2=20,I2=200;function It(...e){return e.filter(Boolean).join(" ")}function B2(e){let[t,n]=e.split("-"),s=[];return t&&s.push(t),n&&s.push(n),s}var F2=e=>{var t,n,s,i,a,o,l,c,d,u,p;let{invert:h,toast:m,unstyled:y,interacting:b,setHeights:v,visibleToasts:g,heights:x,index:w,toasts:j,expanded:k,removeToast:N,defaultRichColors:S,closeButton:_,style:A,cancelButtonStyle:P,actionButtonStyle:T,className:V="",descriptionClassName:M="",duration:I,position:z,gap:R,loadingIcon:B,expandByDefault:C,classNames:E,icons:L,closeButtonAriaLabel:W="Close toast",pauseWhenPageIsHidden:q}=e,[te,se]=H.useState(null),[de,fe]=H.useState(null),[ae,Ze]=H.useState(!1),[kt,G]=H.useState(!1),[X,zt]=H.useState(!1),[Lr,Os]=H.useState(!1),[et,Is]=H.useState(!1),[hl,Bs]=H.useState(0),[pl,aa]=H.useState(0),ls=H.useRef(m.duration||I||Qp),Dr=H.useRef(null),Xt=H.useRef(null),D=w===0,J=w+1<=g,Q=m.type,Ee=m.dismissible!==!1,Oe=m.className||"",oa=m.descriptionClassName||"",la=H.useMemo(()=>x.findIndex(Z=>Z.toastId===m.id)||0,[x,m.id]),P1=H.useMemo(()=>{var Z;return(Z=m.closeButton)!=null?Z:_},[m.closeButton,_]),Eh=H.useMemo(()=>m.duration||I||Qp,[m.duration,I]),fl=H.useRef(0),Fs=H.useRef(0),Th=H.useRef(0),Vs=H.useRef(null),[A1,M1]=z.split("-"),Ph=H.useMemo(()=>x.reduce((Z,ue,ve)=>ve>=la?Z:Z+ue.height,0),[x,la]),Ah=N2(),z1=m.invert||h,ml=Q==="loading";Fs.current=H.useMemo(()=>la*R+Ph,[la,Ph]),H.useEffect(()=>{ls.current=Eh},[Eh]),H.useEffect(()=>{Ze(!0)},[]),H.useEffect(()=>{let Z=Xt.current;if(Z){let ue=Z.getBoundingClientRect().height;return aa(ue),v(ve=>[{toastId:m.id,height:ue,position:m.position},...ve]),()=>v(ve=>ve.filter(Rt=>Rt.toastId!==m.id))}},[v,m.id]),H.useLayoutEffect(()=>{if(!ae)return;let Z=Xt.current,ue=Z.style.height;Z.style.height="auto";let ve=Z.getBoundingClientRect().height;Z.style.height=ue,aa(ve),v(Rt=>Rt.find(Lt=>Lt.toastId===m.id)?Rt.map(Lt=>Lt.toastId===m.id?{...Lt,height:ve}:Lt):[{toastId:m.id,height:ve,position:m.position},...Rt])},[ae,m.title,m.description,v,m.id]);let En=H.useCallback(()=>{G(!0),Bs(Fs.current),v(Z=>Z.filter(ue=>ue.toastId!==m.id)),setTimeout(()=>{N(m)},I2)},[m,N,v,Fs]);H.useEffect(()=>{if(m.promise&&Q==="loading"||m.duration===1/0||m.type==="loading")return;let Z;return k||b||q&&Ah?(()=>{if(Th.current<fl.current){let ue=new Date().getTime()-fl.current;ls.current=ls.current-ue}Th.current=new Date().getTime()})():ls.current!==1/0&&(fl.current=new Date().getTime(),Z=setTimeout(()=>{var ue;(ue=m.onAutoClose)==null||ue.call(m,m),En()},ls.current)),()=>clearTimeout(Z)},[k,b,m,Q,q,Ah,En]),H.useEffect(()=>{m.delete&&En()},[En,m.delete]);function R1(){var Z,ue,ve;return L!=null&&L.loading?H.createElement("div",{className:It(E==null?void 0:E.loader,(Z=m==null?void 0:m.classNames)==null?void 0:Z.loader,"sonner-loader"),"data-visible":Q==="loading"},L.loading):B?H.createElement("div",{className:It(E==null?void 0:E.loader,(ue=m==null?void 0:m.classNames)==null?void 0:ue.loader,"sonner-loader"),"data-visible":Q==="loading"},B):H.createElement(y2,{className:It(E==null?void 0:E.loader,(ve=m==null?void 0:m.classNames)==null?void 0:ve.loader),visible:Q==="loading"})}return H.createElement("li",{tabIndex:0,ref:Xt,className:It(V,Oe,E==null?void 0:E.toast,(t=m==null?void 0:m.classNames)==null?void 0:t.toast,E==null?void 0:E.default,E==null?void 0:E[Q],(n=m==null?void 0:m.classNames)==null?void 0:n[Q]),"data-sonner-toast":"","data-rich-colors":(s=m.richColors)!=null?s:S,"data-styled":!(m.jsx||m.unstyled||y),"data-mounted":ae,"data-promise":!!m.promise,"data-swiped":et,"data-removed":kt,"data-visible":J,"data-y-position":A1,"data-x-position":M1,"data-index":w,"data-front":D,"data-swiping":X,"data-dismissible":Ee,"data-type":Q,"data-invert":z1,"data-swipe-out":Lr,"data-swipe-direction":de,"data-expanded":!!(k||C&&ae),style:{"--index":w,"--toasts-before":w,"--z-index":j.length-w,"--offset":`${kt?hl:Fs.current}px`,"--initial-height":C?"auto":`${pl}px`,...A,...m.style},onDragEnd:()=>{zt(!1),se(null),Vs.current=null},onPointerDown:Z=>{ml||!Ee||(Dr.current=new Date,Bs(Fs.current),Z.target.setPointerCapture(Z.pointerId),Z.target.tagName!=="BUTTON"&&(zt(!0),Vs.current={x:Z.clientX,y:Z.clientY}))},onPointerUp:()=>{var Z,ue,ve,Rt;if(Lr||!Ee)return;Vs.current=null;let Lt=Number(((Z=Xt.current)==null?void 0:Z.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Tn=Number(((ue=Xt.current)==null?void 0:ue.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),cs=new Date().getTime()-((ve=Dr.current)==null?void 0:ve.getTime()),Dt=te==="x"?Lt:Tn,Pn=Math.abs(Dt)/cs;if(Math.abs(Dt)>=O2||Pn>.11){Bs(Fs.current),(Rt=m.onDismiss)==null||Rt.call(m,m),fe(te==="x"?Lt>0?"right":"left":Tn>0?"down":"up"),En(),Os(!0),Is(!1);return}zt(!1),se(null)},onPointerMove:Z=>{var ue,ve,Rt,Lt;if(!Vs.current||!Ee||((ue=window.getSelection())==null?void 0:ue.toString().length)>0)return;let Tn=Z.clientY-Vs.current.y,cs=Z.clientX-Vs.current.x,Dt=(ve=e.swipeDirections)!=null?ve:B2(z);!te&&(Math.abs(cs)>1||Math.abs(Tn)>1)&&se(Math.abs(cs)>Math.abs(Tn)?"x":"y");let Pn={x:0,y:0};te==="y"?(Dt.includes("top")||Dt.includes("bottom"))&&(Dt.includes("top")&&Tn<0||Dt.includes("bottom")&&Tn>0)&&(Pn.y=Tn):te==="x"&&(Dt.includes("left")||Dt.includes("right"))&&(Dt.includes("left")&&cs<0||Dt.includes("right")&&cs>0)&&(Pn.x=cs),(Math.abs(Pn.x)>0||Math.abs(Pn.y)>0)&&Is(!0),(Rt=Xt.current)==null||Rt.style.setProperty("--swipe-amount-x",`${Pn.x}px`),(Lt=Xt.current)==null||Lt.style.setProperty("--swipe-amount-y",`${Pn.y}px`)}},P1&&!m.jsx?H.createElement("button",{"aria-label":W,"data-disabled":ml,"data-close-button":!0,onClick:ml||!Ee?()=>{}:()=>{var Z;En(),(Z=m.onDismiss)==null||Z.call(m,m)},className:It(E==null?void 0:E.closeButton,(i=m==null?void 0:m.classNames)==null?void 0:i.closeButton)},(a=L==null?void 0:L.close)!=null?a:j2):null,m.jsx||f.isValidElement(m.title)?m.jsx?m.jsx:typeof m.title=="function"?m.title():m.title:H.createElement(H.Fragment,null,Q||m.icon||m.promise?H.createElement("div",{"data-icon":"",className:It(E==null?void 0:E.icon,(o=m==null?void 0:m.classNames)==null?void 0:o.icon)},m.promise||m.type==="loading"&&!m.icon?m.icon||R1():null,m.type!=="loading"?m.icon||(L==null?void 0:L[Q])||g2(Q):null):null,H.createElement("div",{"data-content":"",className:It(E==null?void 0:E.content,(l=m==null?void 0:m.classNames)==null?void 0:l.content)},H.createElement("div",{"data-title":"",className:It(E==null?void 0:E.title,(c=m==null?void 0:m.classNames)==null?void 0:c.title)},typeof m.title=="function"?m.title():m.title),m.description?H.createElement("div",{"data-description":"",className:It(M,oa,E==null?void 0:E.description,(d=m==null?void 0:m.classNames)==null?void 0:d.description)},typeof m.description=="function"?m.description():m.description):null),f.isValidElement(m.cancel)?m.cancel:m.cancel&&Ca(m.cancel)?H.createElement("button",{"data-button":!0,"data-cancel":!0,style:m.cancelButtonStyle||P,onClick:Z=>{var ue,ve;Ca(m.cancel)&&Ee&&((ve=(ue=m.cancel).onClick)==null||ve.call(ue,Z),En())},className:It(E==null?void 0:E.cancelButton,(u=m==null?void 0:m.classNames)==null?void 0:u.cancelButton)},m.cancel.label):null,f.isValidElement(m.action)?m.action:m.action&&Ca(m.action)?H.createElement("button",{"data-button":!0,"data-action":!0,style:m.actionButtonStyle||T,onClick:Z=>{var ue,ve;Ca(m.action)&&((ve=(ue=m.action).onClick)==null||ve.call(ue,Z),!Z.defaultPrevented&&En())},className:It(E==null?void 0:E.actionButton,(p=m==null?void 0:m.classNames)==null?void 0:p.actionButton)},m.action.label):null))};function Jp(){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 V2(e,t){let n={};return[e,t].forEach((s,i)=>{let a=i===1,o=a?"--mobile-offset":"--offset",l=a?R2:z2;function c(d){["top","right","bottom","left"].forEach(u=>{n[`${o}-${u}`]=typeof d=="number"?`${d}px`:d})}typeof s=="number"||typeof s=="string"?c(s):typeof s=="object"?["top","right","bottom","left"].forEach(d=>{s[d]===void 0?n[`${o}-${d}`]=l:n[`${o}-${d}`]=typeof s[d]=="number"?`${s[d]}px`:s[d]}):c(l)}),n}var $2=f.forwardRef(function(e,t){let{invert:n,position:s="bottom-right",hotkey:i=["altKey","KeyT"],expand:a,closeButton:o,className:l,offset:c,mobileOffset:d,theme:u="light",richColors:p,duration:h,style:m,visibleToasts:y=M2,toastOptions:b,dir:v=Jp(),gap:g=D2,loadingIcon:x,icons:w,containerAriaLabel:j="Notifications",pauseWhenPageIsHidden:k}=e,[N,S]=H.useState([]),_=H.useMemo(()=>Array.from(new Set([s].concat(N.filter(q=>q.position).map(q=>q.position)))),[N,s]),[A,P]=H.useState([]),[T,V]=H.useState(!1),[M,I]=H.useState(!1),[z,R]=H.useState(u!=="system"?u:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),B=H.useRef(null),C=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),E=H.useRef(null),L=H.useRef(!1),W=H.useCallback(q=>{S(te=>{var se;return(se=te.find(de=>de.id===q.id))!=null&&se.delete||ot.dismiss(q.id),te.filter(({id:de})=>de!==q.id)})},[]);return H.useEffect(()=>ot.subscribe(q=>{if(q.dismiss){S(te=>te.map(se=>se.id===q.id?{...se,delete:!0}:se));return}setTimeout(()=>{lw.flushSync(()=>{S(te=>{let se=te.findIndex(de=>de.id===q.id);return se!==-1?[...te.slice(0,se),{...te[se],...q},...te.slice(se+1)]:[q,...te]})})})}),[]),H.useEffect(()=>{if(u!=="system"){R(u);return}if(u==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?R("dark"):R("light")),typeof window>"u")return;let q=window.matchMedia("(prefers-color-scheme: dark)");try{q.addEventListener("change",({matches:te})=>{R(te?"dark":"light")})}catch{q.addListener(({matches:se})=>{try{R(se?"dark":"light")}catch(de){console.error(de)}})}},[u]),H.useEffect(()=>{N.length<=1&&V(!1)},[N]),H.useEffect(()=>{let q=te=>{var se,de;i.every(fe=>te[fe]||te.code===fe)&&(V(!0),(se=B.current)==null||se.focus()),te.code==="Escape"&&(document.activeElement===B.current||(de=B.current)!=null&&de.contains(document.activeElement))&&V(!1)};return document.addEventListener("keydown",q),()=>document.removeEventListener("keydown",q)},[i]),H.useEffect(()=>{if(B.current)return()=>{E.current&&(E.current.focus({preventScroll:!0}),E.current=null,L.current=!1)}},[B.current]),H.createElement("section",{ref:t,"aria-label":`${j} ${C}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},_.map((q,te)=>{var se;let[de,fe]=q.split("-");return N.length?H.createElement("ol",{key:q,dir:v==="auto"?Jp():v,tabIndex:-1,ref:B,className:l,"data-sonner-toaster":!0,"data-theme":z,"data-y-position":de,"data-lifted":T&&N.length>1&&!a,"data-x-position":fe,style:{"--front-toast-height":`${((se=A[0])==null?void 0:se.height)||0}px`,"--width":`${L2}px`,"--gap":`${g}px`,...m,...V2(c,d)},onBlur:ae=>{L.current&&!ae.currentTarget.contains(ae.relatedTarget)&&(L.current=!1,E.current&&(E.current.focus({preventScroll:!0}),E.current=null))},onFocus:ae=>{ae.target instanceof HTMLElement&&ae.target.dataset.dismissible==="false"||L.current||(L.current=!0,E.current=ae.relatedTarget)},onMouseEnter:()=>V(!0),onMouseMove:()=>V(!0),onMouseLeave:()=>{M||V(!1)},onDragEnd:()=>V(!1),onPointerDown:ae=>{ae.target instanceof HTMLElement&&ae.target.dataset.dismissible==="false"||I(!0)},onPointerUp:()=>I(!1)},N.filter(ae=>!ae.position&&te===0||ae.position===q).map((ae,Ze)=>{var kt,G;return H.createElement(F2,{key:ae.id,icons:w,index:Ze,toast:ae,defaultRichColors:p,duration:(kt=b==null?void 0:b.duration)!=null?kt:h,className:b==null?void 0:b.className,descriptionClassName:b==null?void 0:b.descriptionClassName,invert:n,visibleToasts:y,closeButton:(G=b==null?void 0:b.closeButton)!=null?G:o,interacting:M,position:q,style:b==null?void 0:b.style,unstyled:b==null?void 0:b.unstyled,classNames:b==null?void 0:b.classNames,cancelButtonStyle:b==null?void 0:b.cancelButtonStyle,actionButtonStyle:b==null?void 0:b.actionButtonStyle,removeToast:W,toasts:N.filter(X=>X.position==ae.position),heights:A.filter(X=>X.position==ae.position),setHeights:P,expandByDefault:a,gap:g,loadingIcon:x,expanded:T,pauseWhenPageIsHidden:k,swipeDirections:e.swipeDirections})})):null}))});const Lu=f.createContext({});function Jo(e){const t=f.useRef(null);return t.current===null&&(t.current=e()),t.current}const Zo=f.createContext(null),Ii=f.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class U2 extends f.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 H2({children:e,isPresent:t}){const n=f.useId(),s=f.useRef(null),i=f.useRef({width:0,height:0,top:0,left:0}),{nonce:a}=f.useContext(Ii);return f.useInsertionEffect(()=>{const{width:o,height:l,top:c,left:d}=i.current;if(t||!s.current||!o||!l)return;s.current.dataset.motionPopId=n;const u=document.createElement("style");return a&&(u.nonce=a),document.head.appendChild(u),u.sheet&&u.sheet.insertRule(`
|
|
67
|
+
*/function ld(){return ld=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},ld.apply(this,arguments)}function s2(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 r2(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function i2(e,t){return e.button===0&&(!t||t==="_self")&&!r2(e)}function cd(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 a2(e,t){let n=cd(e);return t&&t.forEach((s,i)=>{n.has(i)||t.getAll(i).forEach(a=>{n.append(i,a)})}),n}const o2=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],l2="6";try{window.__reactRouterVersion=l2}catch{}const c2="startTransition",qp=X1[c2];function d2(e){let{basename:t,children:n,future:s,window:i}=e,a=f.useRef();a.current==null&&(a.current=lw({window:i,v5Compat:!0}));let o=a.current,[l,c]=f.useState({action:o.action,location:o.location}),{v7_startTransition:d}=s||{},u=f.useCallback(p=>{d&&qp?qp(()=>c(p)):c(p)},[c,d]);return f.useLayoutEffect(()=>o.listen(u),[o,u]),f.useEffect(()=>Zw(s),[s]),f.createElement(t2,{basename:t,children:n,location:l.location,navigationType:l.action,navigator:o,future:s})}const u2=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",h2=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,hi=f.forwardRef(function(t,n){let{onClick:s,relative:i,reloadDocument:a,replace:o,state:l,target:c,to:d,preventScrollReset:u,viewTransition:p}=t,h=s2(t,o2),{basename:m}=f.useContext(rs),y,b=!1;if(typeof d=="string"&&h2.test(d)&&(y=d,u2))try{let w=new URL(window.location.href),j=d.startsWith("//")?new URL(w.protocol+d):new URL(d),k=Au(j.pathname,m);j.origin===w.origin&&k!=null?d=k+j.search+j.hash:b=!0}catch{}let v=Dw(d,{relative:i}),g=p2(d,{replace:o,state:l,target:c,preventScrollReset:u,relative:i,viewTransition:p});function x(w){s&&s(w),w.defaultPrevented||g(w)}return f.createElement("a",ld({},h,{href:y||v,onClick:b||a?s:x,ref:n,target:c}))});var Yp;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Yp||(Yp={}));var Xp;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Xp||(Xp={}));function p2(e,t){let{target:n,replace:s,state:i,preventScrollReset:a,relative:o,viewTransition:l}=t===void 0?{}:t,c=un(),d=is(),u=fx(e,{relative:o});return f.useCallback(p=>{if(i2(p,n)){p.preventDefault();let h=s!==void 0?s:_o(d)===_o(u);c(e,{replace:h,state:i,preventScrollReset:a,relative:o,viewTransition:l})}},[d,c,u,s,i,n,e,a,o,l])}function f2(e){let t=f.useRef(cd(e)),n=f.useRef(!1),s=is(),i=f.useMemo(()=>a2(s.search,n.current?null:t.current),[s.search]),a=un(),o=f.useCallback((l,c)=>{const d=cd(typeof l=="function"?l(i):l);n.current=!0,a("?"+d,c)},[a,i]);return[i,o]}var m2=e=>{switch(e){case"success":return y2;case"info":return b2;case"warning":return v2;case"error":return w2;default:return null}},g2=Array(12).fill(0),x2=({visible:e,className:t})=>H.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},H.createElement("div",{className:"sonner-spinner"},g2.map((n,s)=>H.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${s}`})))),y2=H.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},H.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"})),v2=H.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},H.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"})),b2=H.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},H.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"})),w2=H.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},H.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"})),k2=H.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"},H.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),H.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),j2=()=>{let[e,t]=H.useState(document.hidden);return H.useEffect(()=>{let n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},dd=1,N2=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:dd++,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],H.isValidElement(c))i=!1,this.create({id:n,type:"default",message:c});else if(C2(c)&&!c.ok){i=!1;let d=typeof t.error=="function"?await t.error(`HTTP error! status: ${c.status}`):t.error,u=typeof t.description=="function"?await t.description(`HTTP error! status: ${c.status}`):t.description;this.create({id:n,type:"error",message:d,description:u})}else if(t.success!==void 0){i=!1;let d=typeof t.success=="function"?await t.success(c):t.success,u=typeof t.description=="function"?await t.description(c):t.description;this.create({id:n,type:"success",message:d,description:u})}}).catch(async c=>{if(a=["reject",c],t.error!==void 0){i=!1;let d=typeof t.error=="function"?await t.error(c):t.error,u=typeof t.description=="function"?await t.description(c):t.description;this.create({id:n,type:"error",message:d,description:u})}}).finally(()=>{var c;i&&(this.dismiss(n),n=void 0),(c=t.finally)==null||c.call(t)}),l=()=>new Promise((c,d)=>o.then(()=>a[0]==="reject"?d(a[1]):c(a[1])).catch(d));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)||dd++;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}},ot=new N2,S2=(e,t)=>{let n=(t==null?void 0:t.id)||dd++;return ot.addToast({title:e,...t,id:n}),n},C2=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",_2=S2,E2=()=>ot.toasts,T2=()=>ot.getActiveToasts(),pe=Object.assign(_2,{success:ot.success,info:ot.info,warning:ot.warning,error:ot.error,custom:ot.custom,message:ot.message,promise:ot.promise,dismiss:ot.dismiss,loading:ot.loading},{getHistory:E2,getToasts:T2});function P2(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))}P2(`: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 Ca(e){return e.label!==void 0}var A2=3,M2="32px",z2="16px",Qp=4e3,R2=356,L2=14,D2=20,O2=200;function It(...e){return e.filter(Boolean).join(" ")}function I2(e){let[t,n]=e.split("-"),s=[];return t&&s.push(t),n&&s.push(n),s}var B2=e=>{var t,n,s,i,a,o,l,c,d,u,p;let{invert:h,toast:m,unstyled:y,interacting:b,setHeights:v,visibleToasts:g,heights:x,index:w,toasts:j,expanded:k,removeToast:N,defaultRichColors:S,closeButton:_,style:A,cancelButtonStyle:P,actionButtonStyle:T,className:V="",descriptionClassName:M="",duration:I,position:z,gap:R,loadingIcon:B,expandByDefault:C,classNames:E,icons:L,closeButtonAriaLabel:W="Close toast",pauseWhenPageIsHidden:q}=e,[te,se]=H.useState(null),[de,fe]=H.useState(null),[ae,Ze]=H.useState(!1),[kt,G]=H.useState(!1),[X,zt]=H.useState(!1),[Lr,Os]=H.useState(!1),[et,Is]=H.useState(!1),[hl,Bs]=H.useState(0),[pl,aa]=H.useState(0),ls=H.useRef(m.duration||I||Qp),Dr=H.useRef(null),Xt=H.useRef(null),D=w===0,J=w+1<=g,Q=m.type,Ee=m.dismissible!==!1,Oe=m.className||"",oa=m.descriptionClassName||"",la=H.useMemo(()=>x.findIndex(Z=>Z.toastId===m.id)||0,[x,m.id]),T1=H.useMemo(()=>{var Z;return(Z=m.closeButton)!=null?Z:_},[m.closeButton,_]),Eh=H.useMemo(()=>m.duration||I||Qp,[m.duration,I]),fl=H.useRef(0),Fs=H.useRef(0),Th=H.useRef(0),Vs=H.useRef(null),[P1,A1]=z.split("-"),Ph=H.useMemo(()=>x.reduce((Z,ue,ve)=>ve>=la?Z:Z+ue.height,0),[x,la]),Ah=j2(),M1=m.invert||h,ml=Q==="loading";Fs.current=H.useMemo(()=>la*R+Ph,[la,Ph]),H.useEffect(()=>{ls.current=Eh},[Eh]),H.useEffect(()=>{Ze(!0)},[]),H.useEffect(()=>{let Z=Xt.current;if(Z){let ue=Z.getBoundingClientRect().height;return aa(ue),v(ve=>[{toastId:m.id,height:ue,position:m.position},...ve]),()=>v(ve=>ve.filter(Rt=>Rt.toastId!==m.id))}},[v,m.id]),H.useLayoutEffect(()=>{if(!ae)return;let Z=Xt.current,ue=Z.style.height;Z.style.height="auto";let ve=Z.getBoundingClientRect().height;Z.style.height=ue,aa(ve),v(Rt=>Rt.find(Lt=>Lt.toastId===m.id)?Rt.map(Lt=>Lt.toastId===m.id?{...Lt,height:ve}:Lt):[{toastId:m.id,height:ve,position:m.position},...Rt])},[ae,m.title,m.description,v,m.id]);let En=H.useCallback(()=>{G(!0),Bs(Fs.current),v(Z=>Z.filter(ue=>ue.toastId!==m.id)),setTimeout(()=>{N(m)},O2)},[m,N,v,Fs]);H.useEffect(()=>{if(m.promise&&Q==="loading"||m.duration===1/0||m.type==="loading")return;let Z;return k||b||q&&Ah?(()=>{if(Th.current<fl.current){let ue=new Date().getTime()-fl.current;ls.current=ls.current-ue}Th.current=new Date().getTime()})():ls.current!==1/0&&(fl.current=new Date().getTime(),Z=setTimeout(()=>{var ue;(ue=m.onAutoClose)==null||ue.call(m,m),En()},ls.current)),()=>clearTimeout(Z)},[k,b,m,Q,q,Ah,En]),H.useEffect(()=>{m.delete&&En()},[En,m.delete]);function z1(){var Z,ue,ve;return L!=null&&L.loading?H.createElement("div",{className:It(E==null?void 0:E.loader,(Z=m==null?void 0:m.classNames)==null?void 0:Z.loader,"sonner-loader"),"data-visible":Q==="loading"},L.loading):B?H.createElement("div",{className:It(E==null?void 0:E.loader,(ue=m==null?void 0:m.classNames)==null?void 0:ue.loader,"sonner-loader"),"data-visible":Q==="loading"},B):H.createElement(x2,{className:It(E==null?void 0:E.loader,(ve=m==null?void 0:m.classNames)==null?void 0:ve.loader),visible:Q==="loading"})}return H.createElement("li",{tabIndex:0,ref:Xt,className:It(V,Oe,E==null?void 0:E.toast,(t=m==null?void 0:m.classNames)==null?void 0:t.toast,E==null?void 0:E.default,E==null?void 0:E[Q],(n=m==null?void 0:m.classNames)==null?void 0:n[Q]),"data-sonner-toast":"","data-rich-colors":(s=m.richColors)!=null?s:S,"data-styled":!(m.jsx||m.unstyled||y),"data-mounted":ae,"data-promise":!!m.promise,"data-swiped":et,"data-removed":kt,"data-visible":J,"data-y-position":P1,"data-x-position":A1,"data-index":w,"data-front":D,"data-swiping":X,"data-dismissible":Ee,"data-type":Q,"data-invert":M1,"data-swipe-out":Lr,"data-swipe-direction":de,"data-expanded":!!(k||C&&ae),style:{"--index":w,"--toasts-before":w,"--z-index":j.length-w,"--offset":`${kt?hl:Fs.current}px`,"--initial-height":C?"auto":`${pl}px`,...A,...m.style},onDragEnd:()=>{zt(!1),se(null),Vs.current=null},onPointerDown:Z=>{ml||!Ee||(Dr.current=new Date,Bs(Fs.current),Z.target.setPointerCapture(Z.pointerId),Z.target.tagName!=="BUTTON"&&(zt(!0),Vs.current={x:Z.clientX,y:Z.clientY}))},onPointerUp:()=>{var Z,ue,ve,Rt;if(Lr||!Ee)return;Vs.current=null;let Lt=Number(((Z=Xt.current)==null?void 0:Z.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Tn=Number(((ue=Xt.current)==null?void 0:ue.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),cs=new Date().getTime()-((ve=Dr.current)==null?void 0:ve.getTime()),Dt=te==="x"?Lt:Tn,Pn=Math.abs(Dt)/cs;if(Math.abs(Dt)>=D2||Pn>.11){Bs(Fs.current),(Rt=m.onDismiss)==null||Rt.call(m,m),fe(te==="x"?Lt>0?"right":"left":Tn>0?"down":"up"),En(),Os(!0),Is(!1);return}zt(!1),se(null)},onPointerMove:Z=>{var ue,ve,Rt,Lt;if(!Vs.current||!Ee||((ue=window.getSelection())==null?void 0:ue.toString().length)>0)return;let Tn=Z.clientY-Vs.current.y,cs=Z.clientX-Vs.current.x,Dt=(ve=e.swipeDirections)!=null?ve:I2(z);!te&&(Math.abs(cs)>1||Math.abs(Tn)>1)&&se(Math.abs(cs)>Math.abs(Tn)?"x":"y");let Pn={x:0,y:0};te==="y"?(Dt.includes("top")||Dt.includes("bottom"))&&(Dt.includes("top")&&Tn<0||Dt.includes("bottom")&&Tn>0)&&(Pn.y=Tn):te==="x"&&(Dt.includes("left")||Dt.includes("right"))&&(Dt.includes("left")&&cs<0||Dt.includes("right")&&cs>0)&&(Pn.x=cs),(Math.abs(Pn.x)>0||Math.abs(Pn.y)>0)&&Is(!0),(Rt=Xt.current)==null||Rt.style.setProperty("--swipe-amount-x",`${Pn.x}px`),(Lt=Xt.current)==null||Lt.style.setProperty("--swipe-amount-y",`${Pn.y}px`)}},T1&&!m.jsx?H.createElement("button",{"aria-label":W,"data-disabled":ml,"data-close-button":!0,onClick:ml||!Ee?()=>{}:()=>{var Z;En(),(Z=m.onDismiss)==null||Z.call(m,m)},className:It(E==null?void 0:E.closeButton,(i=m==null?void 0:m.classNames)==null?void 0:i.closeButton)},(a=L==null?void 0:L.close)!=null?a:k2):null,m.jsx||f.isValidElement(m.title)?m.jsx?m.jsx:typeof m.title=="function"?m.title():m.title:H.createElement(H.Fragment,null,Q||m.icon||m.promise?H.createElement("div",{"data-icon":"",className:It(E==null?void 0:E.icon,(o=m==null?void 0:m.classNames)==null?void 0:o.icon)},m.promise||m.type==="loading"&&!m.icon?m.icon||z1():null,m.type!=="loading"?m.icon||(L==null?void 0:L[Q])||m2(Q):null):null,H.createElement("div",{"data-content":"",className:It(E==null?void 0:E.content,(l=m==null?void 0:m.classNames)==null?void 0:l.content)},H.createElement("div",{"data-title":"",className:It(E==null?void 0:E.title,(c=m==null?void 0:m.classNames)==null?void 0:c.title)},typeof m.title=="function"?m.title():m.title),m.description?H.createElement("div",{"data-description":"",className:It(M,oa,E==null?void 0:E.description,(d=m==null?void 0:m.classNames)==null?void 0:d.description)},typeof m.description=="function"?m.description():m.description):null),f.isValidElement(m.cancel)?m.cancel:m.cancel&&Ca(m.cancel)?H.createElement("button",{"data-button":!0,"data-cancel":!0,style:m.cancelButtonStyle||P,onClick:Z=>{var ue,ve;Ca(m.cancel)&&Ee&&((ve=(ue=m.cancel).onClick)==null||ve.call(ue,Z),En())},className:It(E==null?void 0:E.cancelButton,(u=m==null?void 0:m.classNames)==null?void 0:u.cancelButton)},m.cancel.label):null,f.isValidElement(m.action)?m.action:m.action&&Ca(m.action)?H.createElement("button",{"data-button":!0,"data-action":!0,style:m.actionButtonStyle||T,onClick:Z=>{var ue,ve;Ca(m.action)&&((ve=(ue=m.action).onClick)==null||ve.call(ue,Z),!Z.defaultPrevented&&En())},className:It(E==null?void 0:E.actionButton,(p=m==null?void 0:m.classNames)==null?void 0:p.actionButton)},m.action.label):null))};function Jp(){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 F2(e,t){let n={};return[e,t].forEach((s,i)=>{let a=i===1,o=a?"--mobile-offset":"--offset",l=a?z2:M2;function c(d){["top","right","bottom","left"].forEach(u=>{n[`${o}-${u}`]=typeof d=="number"?`${d}px`:d})}typeof s=="number"||typeof s=="string"?c(s):typeof s=="object"?["top","right","bottom","left"].forEach(d=>{s[d]===void 0?n[`${o}-${d}`]=l:n[`${o}-${d}`]=typeof s[d]=="number"?`${s[d]}px`:s[d]}):c(l)}),n}var V2=f.forwardRef(function(e,t){let{invert:n,position:s="bottom-right",hotkey:i=["altKey","KeyT"],expand:a,closeButton:o,className:l,offset:c,mobileOffset:d,theme:u="light",richColors:p,duration:h,style:m,visibleToasts:y=A2,toastOptions:b,dir:v=Jp(),gap:g=L2,loadingIcon:x,icons:w,containerAriaLabel:j="Notifications",pauseWhenPageIsHidden:k}=e,[N,S]=H.useState([]),_=H.useMemo(()=>Array.from(new Set([s].concat(N.filter(q=>q.position).map(q=>q.position)))),[N,s]),[A,P]=H.useState([]),[T,V]=H.useState(!1),[M,I]=H.useState(!1),[z,R]=H.useState(u!=="system"?u:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),B=H.useRef(null),C=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),E=H.useRef(null),L=H.useRef(!1),W=H.useCallback(q=>{S(te=>{var se;return(se=te.find(de=>de.id===q.id))!=null&&se.delete||ot.dismiss(q.id),te.filter(({id:de})=>de!==q.id)})},[]);return H.useEffect(()=>ot.subscribe(q=>{if(q.dismiss){S(te=>te.map(se=>se.id===q.id?{...se,delete:!0}:se));return}setTimeout(()=>{ow.flushSync(()=>{S(te=>{let se=te.findIndex(de=>de.id===q.id);return se!==-1?[...te.slice(0,se),{...te[se],...q},...te.slice(se+1)]:[q,...te]})})})}),[]),H.useEffect(()=>{if(u!=="system"){R(u);return}if(u==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?R("dark"):R("light")),typeof window>"u")return;let q=window.matchMedia("(prefers-color-scheme: dark)");try{q.addEventListener("change",({matches:te})=>{R(te?"dark":"light")})}catch{q.addListener(({matches:se})=>{try{R(se?"dark":"light")}catch(de){console.error(de)}})}},[u]),H.useEffect(()=>{N.length<=1&&V(!1)},[N]),H.useEffect(()=>{let q=te=>{var se,de;i.every(fe=>te[fe]||te.code===fe)&&(V(!0),(se=B.current)==null||se.focus()),te.code==="Escape"&&(document.activeElement===B.current||(de=B.current)!=null&&de.contains(document.activeElement))&&V(!1)};return document.addEventListener("keydown",q),()=>document.removeEventListener("keydown",q)},[i]),H.useEffect(()=>{if(B.current)return()=>{E.current&&(E.current.focus({preventScroll:!0}),E.current=null,L.current=!1)}},[B.current]),H.createElement("section",{ref:t,"aria-label":`${j} ${C}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},_.map((q,te)=>{var se;let[de,fe]=q.split("-");return N.length?H.createElement("ol",{key:q,dir:v==="auto"?Jp():v,tabIndex:-1,ref:B,className:l,"data-sonner-toaster":!0,"data-theme":z,"data-y-position":de,"data-lifted":T&&N.length>1&&!a,"data-x-position":fe,style:{"--front-toast-height":`${((se=A[0])==null?void 0:se.height)||0}px`,"--width":`${R2}px`,"--gap":`${g}px`,...m,...F2(c,d)},onBlur:ae=>{L.current&&!ae.currentTarget.contains(ae.relatedTarget)&&(L.current=!1,E.current&&(E.current.focus({preventScroll:!0}),E.current=null))},onFocus:ae=>{ae.target instanceof HTMLElement&&ae.target.dataset.dismissible==="false"||L.current||(L.current=!0,E.current=ae.relatedTarget)},onMouseEnter:()=>V(!0),onMouseMove:()=>V(!0),onMouseLeave:()=>{M||V(!1)},onDragEnd:()=>V(!1),onPointerDown:ae=>{ae.target instanceof HTMLElement&&ae.target.dataset.dismissible==="false"||I(!0)},onPointerUp:()=>I(!1)},N.filter(ae=>!ae.position&&te===0||ae.position===q).map((ae,Ze)=>{var kt,G;return H.createElement(B2,{key:ae.id,icons:w,index:Ze,toast:ae,defaultRichColors:p,duration:(kt=b==null?void 0:b.duration)!=null?kt:h,className:b==null?void 0:b.className,descriptionClassName:b==null?void 0:b.descriptionClassName,invert:n,visibleToasts:y,closeButton:(G=b==null?void 0:b.closeButton)!=null?G:o,interacting:M,position:q,style:b==null?void 0:b.style,unstyled:b==null?void 0:b.unstyled,classNames:b==null?void 0:b.classNames,cancelButtonStyle:b==null?void 0:b.cancelButtonStyle,actionButtonStyle:b==null?void 0:b.actionButtonStyle,removeToast:W,toasts:N.filter(X=>X.position==ae.position),heights:A.filter(X=>X.position==ae.position),setHeights:P,expandByDefault:a,gap:g,loadingIcon:x,expanded:T,pauseWhenPageIsHidden:k,swipeDirections:e.swipeDirections})})):null}))});const Lu=f.createContext({});function Jo(e){const t=f.useRef(null);return t.current===null&&(t.current=e()),t.current}const Zo=f.createContext(null),Ii=f.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class $2 extends f.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 U2({children:e,isPresent:t}){const n=f.useId(),s=f.useRef(null),i=f.useRef({width:0,height:0,top:0,left:0}),{nonce:a}=f.useContext(Ii);return f.useInsertionEffect(()=>{const{width:o,height:l,top:c,left:d}=i.current;if(t||!s.current||!o||!l)return;s.current.dataset.motionPopId=n;const u=document.createElement("style");return a&&(u.nonce=a),document.head.appendChild(u),u.sheet&&u.sheet.insertRule(`
|
|
69
69
|
[data-motion-pop-id="${n}"] {
|
|
70
70
|
position: absolute !important;
|
|
71
71
|
width: ${o}px !important;
|
|
@@ -73,62 +73,62 @@ Error generating stack: `+a.message+`
|
|
|
73
73
|
top: ${c}px !important;
|
|
74
74
|
left: ${d}px !important;
|
|
75
75
|
}
|
|
76
|
-
`),()=>{document.head.removeChild(u)}},[t]),r.jsx(U2,{isPresent:t,childRef:s,sizeRef:i,children:f.cloneElement(e,{ref:s})})}const W2=({children:e,initial:t,isPresent:n,onExitComplete:s,custom:i,presenceAffectsLayout:a,mode:o})=>{const l=Jo(G2),c=f.useId(),d=f.useCallback(p=>{l.set(p,!0);for(const h of l.values())if(!h)return;s&&s()},[l,s]),u=f.useMemo(()=>({id:c,initial:t,isPresent:n,custom:i,onExitComplete:d,register:p=>(l.set(p,!1),()=>l.delete(p))}),a?[Math.random(),d]:[n,d]);return f.useMemo(()=>{l.forEach((p,h)=>l.set(h,!1))},[n]),f.useEffect(()=>{!n&&!l.size&&s&&s()},[n]),o==="popLayout"&&(e=r.jsx(H2,{isPresent:n,children:e})),r.jsx(Zo.Provider,{value:u,children:e})};function G2(){return new Map}function vx(e=!0){const t=f.useContext(Zo);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:s,register:i}=t,a=f.useId();f.useEffect(()=>{e&&i(a)},[e]);const o=f.useCallback(()=>e&&s&&s(a),[a,s,e]);return!n&&s?[!1,o]:[!0]}const _a=e=>e.key||"";function Zp(e){const t=[];return f.Children.forEach(e,n=>{f.isValidElement(n)&&t.push(n)}),t}const Du=typeof window<"u",bx=Du?f.useLayoutEffect:f.useEffect,ee=({children:e,custom:t,initial:n=!0,onExitComplete:s,presenceAffectsLayout:i=!0,mode:a="sync",propagate:o=!1})=>{const[l,c]=vx(o),d=f.useMemo(()=>Zp(e),[e]),u=o&&!l?[]:d.map(_a),p=f.useRef(!0),h=f.useRef(d),m=Jo(()=>new Map),[y,b]=f.useState(d),[v,g]=f.useState(d);bx(()=>{p.current=!1,h.current=d;for(let j=0;j<v.length;j++){const k=_a(v[j]);u.includes(k)?m.delete(k):m.get(k)!==!0&&m.set(k,!1)}},[v,u.length,u.join("-")]);const x=[];if(d!==y){let j=[...d];for(let k=0;k<v.length;k++){const N=v[k],S=_a(N);u.includes(S)||(j.splice(k,0,N),x.push(N))}a==="wait"&&x.length&&(j=x),g(Zp(j)),b(d);return}const{forceRender:w}=f.useContext(Lu);return r.jsx(r.Fragment,{children:v.map(j=>{const k=_a(j),N=o&&!l?!1:d===v||u.includes(k),S=()=>{if(m.has(k))m.set(k,!0);else return;let _=!0;m.forEach(A=>{A||(_=!1)}),_&&(w==null||w(),g(h.current),o&&(c==null||c()),s&&s())};return r.jsx(W2,{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)})})},xt=e=>e;let wx=xt;function Ou(e){let t;return()=>(t===void 0&&(t=e()),t)}const wr=(e,t,n)=>{const s=t-e;return s===0?1:(n-e)/s},yn=e=>e*1e3,vn=e=>e/1e3,K2={useManualTiming:!1};function q2(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(d){a.has(d)&&(c.schedule(d),e()),d(o)}const c={schedule:(d,u=!1,p=!1)=>{const m=p&&s?t:n;return u&&a.add(d),m.has(d)||m.add(d),d},cancel:d=>{n.delete(d),a.delete(d)},process:d=>{if(o=d,s){i=!0;return}s=!0,[t,n]=[n,t],t.forEach(l),t.clear(),s=!1,i&&(i=!1,c.process(d))}};return c}const Ea=["read","resolveKeyframes","update","preRender","render","postRender"],Y2=40;function kx(e,t){let n=!1,s=!0;const i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=Ea.reduce((g,x)=>(g[x]=q2(a),g),{}),{read:l,resolveKeyframes:c,update:d,preRender:u,render:p,postRender:h}=o,m=()=>{const g=performance.now();n=!1,i.delta=s?1e3/60:Math.max(Math.min(g-i.timestamp,Y2),1),i.timestamp=g,i.isProcessing=!0,l.process(i),c.process(i),d.process(i),u.process(i),p.process(i),h.process(i),i.isProcessing=!1,n&&t&&(s=!1,e(m))},y=()=>{n=!0,s=!0,i.isProcessing||e(m)};return{schedule:Ea.reduce((g,x)=>{const w=o[x];return g[x]=(j,k=!1,N=!1)=>(n||y(),w.schedule(j,k,N)),g},{}),cancel:g=>{for(let x=0;x<Ea.length;x++)o[Ea[x]].cancel(g)},state:i,steps:o}}const{schedule:ye,cancel:Jn,state:Ve,steps:Ul}=kx(typeof requestAnimationFrame<"u"?requestAnimationFrame:xt,!0),jx=f.createContext({strict:!1}),ef={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"]},kr={};for(const e in ef)kr[e]={isEnabled:t=>ef[e].some(n=>!!t[n])};function X2(e){for(const t in e)kr[t]={...kr[t],...e[t]}}const Q2=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 Eo(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||Q2.has(e)}let Nx=e=>!Eo(e);function Sx(e){e&&(Nx=t=>t.startsWith("on")?!Eo(t):e(t))}try{Sx(require("@emotion/is-prop-valid").default)}catch{}function J2(e,t,n){const s={};for(const i in e)i==="values"&&typeof e.values=="object"||(Nx(i)||n===!0&&Eo(i)||!t&&!Eo(i)||e.draggable&&i.startsWith("onDrag"))&&(s[i]=e[i]);return s}function Z2({children:e,isValidProp:t,...n}){t&&Sx(t),n={...f.useContext(Ii),...n},n.isStatic=Jo(()=>n.isStatic);const s=f.useMemo(()=>n,[JSON.stringify(n.transition),n.transformPagePoint,n.reducedMotion]);return r.jsx(Ii.Provider,{value:s,children:e})}function ek(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 el=f.createContext({});function Bi(e){return typeof e=="string"||Array.isArray(e)}function tl(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}const Iu=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Bu=["initial",...Iu];function nl(e){return tl(e.animate)||Bu.some(t=>Bi(e[t]))}function Cx(e){return!!(nl(e)||e.variants)}function tk(e,t){if(nl(e)){const{initial:n,animate:s}=e;return{initial:n===!1||Bi(n)?n:void 0,animate:Bi(s)?s:void 0}}return e.inherit!==!1?t:{}}function nk(e){const{initial:t,animate:n}=tk(e,f.useContext(el));return f.useMemo(()=>({initial:t,animate:n}),[tf(t),tf(n)])}function tf(e){return Array.isArray(e)?e.join(" "):e}const sk=Symbol.for("motionComponentSymbol");function sr(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function rk(e,t,n){return f.useCallback(s=>{s&&e.onMount&&e.onMount(s),t&&(s?t.mount(s):t.unmount()),n&&(typeof n=="function"?n(s):sr(n)&&(n.current=s))},[t])}const Fu=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),ik="framerAppearId",_x="data-"+Fu(ik),{schedule:Vu}=kx(queueMicrotask,!1),Ex=f.createContext({});function ak(e,t,n,s,i){var a,o;const{visualElement:l}=f.useContext(el),c=f.useContext(jx),d=f.useContext(Zo),u=f.useContext(Ii).reducedMotion,p=f.useRef(null);s=s||c.renderer,!p.current&&s&&(p.current=s(e,{visualState:t,parent:l,props:n,presenceContext:d,blockInitialAnimation:d?d.initial===!1:!1,reducedMotionConfig:u}));const h=p.current,m=f.useContext(Ex);h&&!h.projection&&i&&(h.type==="html"||h.type==="svg")&&ok(p.current,n,i,m);const y=f.useRef(!1);f.useInsertionEffect(()=>{h&&y.current&&h.update(n,d)});const b=n[_x],v=f.useRef(!!b&&!(!((a=window.MotionHandoffIsComplete)===null||a===void 0)&&a.call(window,b))&&((o=window.MotionHasOptimisedAnimation)===null||o===void 0?void 0:o.call(window,b)));return bx(()=>{h&&(y.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),Vu.render(h.render),v.current&&h.animationState&&h.animationState.animateChanges())}),f.useEffect(()=>{h&&(!v.current&&h.animationState&&h.animationState.animateChanges(),v.current&&(queueMicrotask(()=>{var g;(g=window.MotionHandoffMarkAsComplete)===null||g===void 0||g.call(window,b)}),v.current=!1))}),h}function ok(e,t,n,s){const{layoutId:i,layout:a,drag:o,dragConstraints:l,layoutScroll:c,layoutRoot:d}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Tx(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||l&&sr(l),visualElement:e,animationType:typeof a=="string"?a:"both",initialPromotionConfig:s,layoutScroll:c,layoutRoot:d})}function Tx(e){if(e)return e.options.allowProjection!==!1?e.projection:Tx(e.parent)}function lk({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:s,Component:i}){var a,o;e&&X2(e);function l(d,u){let p;const h={...f.useContext(Ii),...d,layoutId:ck(d)},{isStatic:m}=h,y=nk(d),b=s(d,m);if(!m&&Du){dk();const v=uk(h);p=v.MeasureLayout,y.visualElement=ak(i,b,h,t,v.ProjectionNode)}return r.jsxs(el.Provider,{value:y,children:[p&&y.visualElement?r.jsx(p,{visualElement:y.visualElement,...h}):null,n(i,d,rk(b,y.visualElement,u),b,m,y.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=f.forwardRef(l);return c[sk]=i,c}function ck({layoutId:e}){const t=f.useContext(Lu).id;return t&&e!==void 0?t+"-"+e:e}function dk(e,t){f.useContext(jx).strict}function uk(e){const{drag:t,layout:n}=kr;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 hk=["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 $u(e){return typeof e!="string"||e.includes("-")?!1:!!(hk.indexOf(e)>-1||/[A-Z]/u.test(e))}function nf(e){const t=[{},{}];return e==null||e.values.forEach((n,s)=>{t[0][s]=n.get(),t[1][s]=n.getVelocity()}),t}function Uu(e,t,n,s){if(typeof t=="function"){const[i,a]=nf(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]=nf(s);t=t(n!==void 0?n:e.custom,i,a)}return t}const ud=e=>Array.isArray(e),pk=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),fk=e=>ud(e)?e[e.length-1]||0:e,Ye=e=>!!(e&&e.getVelocity);function Ya(e){const t=Ye(e)?e.get():e;return pk(t)?t.toValue():t}function mk({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},s,i,a){const o={latestValues:gk(s,i,a,e),renderState:t()};return n&&(o.onMount=l=>n({props:s,current:l,...o}),o.onUpdate=l=>n(l)),o}const Px=e=>(t,n)=>{const s=f.useContext(el),i=f.useContext(Zo),a=()=>mk(e,t,s,i);return n?a():Jo(a)};function gk(e,t,n,s){const i={},a=s(e,{});for(const h in a)i[h]=Ya(a[h]);let{initial:o,animate:l}=e;const c=nl(e),d=Cx(e);t&&d&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),l===void 0&&(l=t.animate));let u=n?n.initial===!1:!1;u=u||o===!1;const p=u?l:o;if(p&&typeof p!="boolean"&&!tl(p)){const h=Array.isArray(p)?p:[p];for(let m=0;m<h.length;m++){const y=Uu(e,h[m]);if(y){const{transitionEnd:b,transition:v,...g}=y;for(const x in g){let w=g[x];if(Array.isArray(w)){const j=u?w.length-1:0;w=w[j]}w!==null&&(i[x]=w)}for(const x in b)i[x]=b[x]}}}return i}const Ar=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],zs=new Set(Ar),Ax=e=>t=>typeof t=="string"&&t.startsWith(e),Mx=Ax("--"),xk=Ax("var(--"),Hu=e=>xk(e)?yk.test(e.split("/*")[0].trim()):!1,yk=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,zx=(e,t)=>t&&typeof e=="number"?t.transform(e):e,Nn=(e,t,n)=>n>t?t:n<e?e:n,Mr={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Fi={...Mr,transform:e=>Nn(0,1,e)},Ta={...Mr,default:1},Ji=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Mn=Ji("deg"),sn=Ji("%"),Y=Ji("px"),vk=Ji("vh"),bk=Ji("vw"),sf={...sn,parse:e=>sn.parse(e)/100,transform:e=>sn.transform(e*100)},wk={borderWidth:Y,borderTopWidth:Y,borderRightWidth:Y,borderBottomWidth:Y,borderLeftWidth:Y,borderRadius:Y,radius:Y,borderTopLeftRadius:Y,borderTopRightRadius:Y,borderBottomRightRadius:Y,borderBottomLeftRadius:Y,width:Y,maxWidth:Y,height:Y,maxHeight:Y,top:Y,right:Y,bottom:Y,left:Y,padding:Y,paddingTop:Y,paddingRight:Y,paddingBottom:Y,paddingLeft:Y,margin:Y,marginTop:Y,marginRight:Y,marginBottom:Y,marginLeft:Y,backgroundPositionX:Y,backgroundPositionY:Y},kk={rotate:Mn,rotateX:Mn,rotateY:Mn,rotateZ:Mn,scale:Ta,scaleX:Ta,scaleY:Ta,scaleZ:Ta,skew:Mn,skewX:Mn,skewY:Mn,distance:Y,translateX:Y,translateY:Y,translateZ:Y,x:Y,y:Y,z:Y,perspective:Y,transformPerspective:Y,opacity:Fi,originX:sf,originY:sf,originZ:Y},rf={...Mr,transform:Math.round},Wu={...wk,...kk,zIndex:rf,size:Y,fillOpacity:Fi,strokeOpacity:Fi,numOctaves:rf},jk={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Nk=Ar.length;function Sk(e,t,n){let s="",i=!0;for(let a=0;a<Nk;a++){const o=Ar[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 d=zx(l,Wu[o]);if(!c){i=!1;const u=jk[o]||o;s+=`${u}(${d}) `}n&&(t[o]=d)}}return s=s.trim(),n?s=n(t,i?"":s):i&&(s="none"),s}function Gu(e,t,n){const{style:s,vars:i,transformOrigin:a}=e;let o=!1,l=!1;for(const c in t){const d=t[c];if(zs.has(c)){o=!0;continue}else if(Mx(c)){i[c]=d;continue}else{const u=zx(d,Wu[c]);c.startsWith("origin")?(l=!0,a[c]=u):s[c]=u}}if(t.transform||(o||n?s.transform=Sk(t,e.transform,n):s.transform&&(s.transform="none")),l){const{originX:c="50%",originY:d="50%",originZ:u=0}=a;s.transformOrigin=`${c} ${d} ${u}`}}const Ck={offset:"stroke-dashoffset",array:"stroke-dasharray"},_k={offset:"strokeDashoffset",array:"strokeDasharray"};function Ek(e,t,n=1,s=0,i=!0){e.pathLength=1;const a=i?Ck:_k;e[a.offset]=Y.transform(-s);const o=Y.transform(t),l=Y.transform(n);e[a.array]=`${o} ${l}`}function af(e,t,n){return typeof e=="string"?e:Y.transform(t+n*e)}function Tk(e,t,n){const s=af(t,e.x,e.width),i=af(n,e.y,e.height);return`${s} ${i}`}function Ku(e,{attrX:t,attrY:n,attrScale:s,originX:i,originY:a,pathLength:o,pathSpacing:l=1,pathOffset:c=0,...d},u,p){if(Gu(e,d,p),u){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:h,style:m,dimensions:y}=e;h.transform&&(y&&(m.transform=h.transform),delete h.transform),y&&(i!==void 0||a!==void 0||m.transform)&&(m.transformOrigin=Tk(y,i!==void 0?i:.5,a!==void 0?a:.5)),t!==void 0&&(h.x=t),n!==void 0&&(h.y=n),s!==void 0&&(h.scale=s),o!==void 0&&Ek(h,o,l,c,!1)}const qu=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),Rx=()=>({...qu(),attrs:{}}),Yu=e=>typeof e=="string"&&e.toLowerCase()==="svg";function Lx(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 Dx=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 Ox(e,t,n,s){Lx(e,t,void 0,s);for(const i in t.attrs)e.setAttribute(Dx.has(i)?i:Fu(i),t.attrs[i])}const To={};function Pk(e){Object.assign(To,e)}function Ix(e,{layout:t,layoutId:n}){return zs.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!To[e]||e==="opacity")}function Xu(e,t,n){var s;const{style:i}=e,a={};for(const o in i)(Ye(i[o])||t.style&&Ye(t.style[o])||Ix(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 Bx(e,t,n){const s=Xu(e,t,n);for(const i in e)if(Ye(e[i])||Ye(t[i])){const a=Ar.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;s[a]=e[i]}return s}function Ak(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 of=["x","y","width","height","cx","cy","r"],Mk={useVisualState:Px({scrapeMotionValuesFromProps:Bx,createRenderState:Rx,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(zs.has(l)){a=!0;break}}if(!a)return;let o=!t;if(t)for(let l=0;l<of.length;l++){const c=of[l];e[c]!==t[c]&&(o=!0)}o&&ye.read(()=>{Ak(n,s),ye.render(()=>{Ku(s,i,Yu(n.tagName),e.transformTemplate),Ox(n,s)})})}})},zk={useVisualState:Px({scrapeMotionValuesFromProps:Xu,createRenderState:qu})};function Fx(e,t,n){for(const s in t)!Ye(t[s])&&!Ix(s,n)&&(e[s]=t[s])}function Rk({transformTemplate:e},t){return f.useMemo(()=>{const n=qu();return Gu(n,t,e),Object.assign({},n.vars,n.style)},[t])}function Lk(e,t){const n=e.style||{},s={};return Fx(s,n,e),Object.assign(s,Rk(e,t)),s}function Dk(e,t){const n={},s=Lk(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 Ok(e,t,n,s){const i=f.useMemo(()=>{const a=Rx();return Ku(a,t,Yu(s),e.transformTemplate),{...a.attrs,style:{...a.style}}},[t]);if(e.style){const a={};Fx(a,e.style,e),i.style={...a,...i.style}}return i}function Ik(e=!1){return(n,s,i,{latestValues:a},o)=>{const c=($u(n)?Ok:Dk)(s,a,o,n),d=J2(s,typeof n=="string",e),u=n!==f.Fragment?{...d,...c,ref:i}:{},{children:p}=s,h=f.useMemo(()=>Ye(p)?p.get():p,[p]);return f.createElement(n,{...u,children:h})}}function Bk(e,t){return function(s,{forwardMotionProps:i}={forwardMotionProps:!1}){const o={...$u(s)?Mk:zk,preloadedFeatures:e,useRender:Ik(i),createVisualElement:t,Component:s};return lk(o)}}function Vx(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 sl(e,t,n){const s=e.getProps();return Uu(s,t,n!==void 0?n:s.custom,e)}const Fk=Ou(()=>window.ScrollTimeline!==void 0);class Vk{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(Fk()&&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 $k extends Vk{then(t,n){return Promise.all(this.animations).then(t).catch(n)}}function Qu(e,t){return e?e[t]||e.default||e:void 0}const hd=2e4;function $x(e){let t=0;const n=50;let s=e.next(t);for(;!s.done&&t<hd;)t+=n,s=e.next(t);return t>=hd?1/0:t}function Ju(e){return typeof e=="function"}function lf(e,t){e.timeline=t,e.onfinish=null}const Zu=e=>Array.isArray(e)&&typeof e[0]=="number",Uk={linearEasing:void 0};function Hk(e,t){const n=Ou(e);return()=>{var s;return(s=Uk[t])!==null&&s!==void 0?s:n()}}const Po=Hk(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Ux=(e,t,n=10)=>{let s="";const i=Math.max(Math.round(t/n),2);for(let a=0;a<i;a++)s+=e(wr(0,i-1,a))+", ";return`linear(${s.substring(0,s.length-2)})`};function Hx(e){return!!(typeof e=="function"&&Po()||!e||typeof e=="string"&&(e in pd||Po())||Zu(e)||Array.isArray(e)&&e.every(Hx))}const Jr=([e,t,n,s])=>`cubic-bezier(${e}, ${t}, ${n}, ${s})`,pd={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Jr([0,.65,.55,1]),circOut:Jr([.55,0,1,.45]),backIn:Jr([.31,.01,.66,-.59]),backOut:Jr([.33,1.53,.69,.99])};function Wx(e,t){if(e)return typeof e=="function"&&Po()?Ux(e,t):Zu(e)?Jr(e):Array.isArray(e)?e.map(n=>Wx(n,t)||pd.easeOut):pd[e]}const Bt={x:!1,y:!1};function Gx(){return Bt.x||Bt.y}function Wk(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 Kx(e,t){const n=Wk(e),s=new AbortController,i={passive:!0,...t,signal:s.signal};return[n,i,()=>s.abort()]}function cf(e){return t=>{t.pointerType==="touch"||Gx()||e(t)}}function Gk(e,t,n={}){const[s,i,a]=Kx(e,n),o=cf(l=>{const{target:c}=l,d=t(l);if(typeof d!="function"||!c)return;const u=cf(p=>{d(p),c.removeEventListener("pointerleave",u)});c.addEventListener("pointerleave",u,i)});return s.forEach(l=>{l.addEventListener("pointerenter",o,i)}),a}const qx=(e,t)=>t?e===t?!0:qx(e,t.parentElement):!1,eh=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,Kk=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function qk(e){return Kk.has(e.tagName)||e.tabIndex!==-1}const Zr=new WeakSet;function df(e){return t=>{t.key==="Enter"&&e(t)}}function Hl(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const Yk=(e,t)=>{const n=e.currentTarget;if(!n)return;const s=df(()=>{if(Zr.has(n))return;Hl(n,"down");const i=df(()=>{Hl(n,"up")}),a=()=>Hl(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 uf(e){return eh(e)&&!Gx()}function Xk(e,t,n={}){const[s,i,a]=Kx(e,n),o=l=>{const c=l.currentTarget;if(!uf(l)||Zr.has(c))return;Zr.add(c);const d=t(l),u=(m,y)=>{window.removeEventListener("pointerup",p),window.removeEventListener("pointercancel",h),!(!uf(m)||!Zr.has(c))&&(Zr.delete(c),typeof d=="function"&&d(m,{success:y}))},p=m=>{u(m,n.useGlobalTarget||qx(c,m.target))},h=m=>{u(m,!1)};window.addEventListener("pointerup",p,i),window.addEventListener("pointercancel",h,i)};return s.forEach(l=>{!qk(l)&&l.getAttribute("tabindex")===null&&(l.tabIndex=0),(n.useGlobalTarget?window:l).addEventListener("pointerdown",o,i),l.addEventListener("focus",d=>Yk(d,i),i)}),a}function Qk(e){return e==="x"||e==="y"?Bt[e]?null:(Bt[e]=!0,()=>{Bt[e]=!1}):Bt.x||Bt.y?null:(Bt.x=Bt.y=!0,()=>{Bt.x=Bt.y=!1})}const Yx=new Set(["width","height","top","left","right","bottom",...Ar]);let Xa;function Jk(){Xa=void 0}const rn={now:()=>(Xa===void 0&&rn.set(Ve.isProcessing||K2.useManualTiming?Ve.timestamp:performance.now()),Xa),set:e=>{Xa=e,queueMicrotask(Jk)}};function th(e,t){e.indexOf(t)===-1&&e.push(t)}function nh(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class sh{constructor(){this.subscriptions=[]}add(t){return th(this.subscriptions,t),()=>nh(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 Xx(e,t){return t?e*(1e3/t):0}const hf=30,Zk=e=>!isNaN(parseFloat(e));class e5{constructor(t,n={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(s,i=!0)=>{const a=rn.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=rn.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=Zk(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 sh);const s=this.events[t].add(n);return t==="change"?()=>{s(),ye.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=rn.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>hf)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,hf);return Xx(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 Vi(e,t){return new e5(e,t)}function t5(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Vi(n))}function n5(e,t){const n=sl(e,t);let{transitionEnd:s={},transition:i={},...a}=n||{};a={...a,...s};for(const o in a){const l=fk(a[o]);t5(e,o,l)}}function s5(e){return!!(Ye(e)&&e.add)}function fd(e,t){const n=e.getValue("willChange");if(s5(n))return n.add(t)}function Qx(e){return e.props[_x]}const Jx=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,r5=1e-7,i5=12;function a5(e,t,n,s,i){let a,o,l=0;do o=t+(n-t)/2,a=Jx(o,s,i)-e,a>0?n=o:t=o;while(Math.abs(a)>r5&&++l<i5);return o}function Zi(e,t,n,s){if(e===t&&n===s)return xt;const i=a=>a5(a,0,1,e,n);return a=>a===0||a===1?a:Jx(i(a),t,s)}const Zx=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,ey=e=>t=>1-e(1-t),ty=Zi(.33,1.53,.69,.99),rh=ey(ty),ny=Zx(rh),sy=e=>(e*=2)<1?.5*rh(e):.5*(2-Math.pow(2,-10*(e-1))),ih=e=>1-Math.sin(Math.acos(e)),ry=ey(ih),iy=Zx(ih),ay=e=>/^0[^.\s]+$/u.test(e);function o5(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||ay(e):!0}const pi=e=>Math.round(e*1e5)/1e5,ah=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function l5(e){return e==null}const c5=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,oh=(e,t)=>n=>!!(typeof n=="string"&&c5.test(n)&&n.startsWith(e)||t&&!l5(n)&&Object.prototype.hasOwnProperty.call(n,t)),oy=(e,t,n)=>s=>{if(typeof s!="string")return s;const[i,a,o,l]=s.match(ah);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:l!==void 0?parseFloat(l):1}},d5=e=>Nn(0,255,e),Wl={...Mr,transform:e=>Math.round(d5(e))},bs={test:oh("rgb","red"),parse:oy("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:s=1})=>"rgba("+Wl.transform(e)+", "+Wl.transform(t)+", "+Wl.transform(n)+", "+pi(Fi.transform(s))+")"};function u5(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 md={test:oh("#"),parse:u5,transform:bs.transform},rr={test:oh("hsl","hue"),parse:oy("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:s=1})=>"hsla("+Math.round(e)+", "+sn.transform(pi(t))+", "+sn.transform(pi(n))+", "+pi(Fi.transform(s))+")"},Ge={test:e=>bs.test(e)||md.test(e)||rr.test(e),parse:e=>bs.test(e)?bs.parse(e):rr.test(e)?rr.parse(e):md.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?bs.transform(e):rr.transform(e)},h5=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function p5(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(ah))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(h5))===null||n===void 0?void 0:n.length)||0)>0}const ly="number",cy="color",f5="var",m5="var(",pf="${}",g5=/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 $i(e){const t=e.toString(),n=[],s={color:[],number:[],var:[]},i=[];let a=0;const l=t.replace(g5,c=>(Ge.test(c)?(s.color.push(a),i.push(cy),n.push(Ge.parse(c))):c.startsWith(m5)?(s.var.push(a),i.push(f5),n.push(c)):(s.number.push(a),i.push(ly),n.push(parseFloat(c))),++a,pf)).split(pf);return{values:n,split:l,indexes:s,types:i}}function dy(e){return $i(e).values}function uy(e){const{split:t,types:n}=$i(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===ly?a+=pi(i[o]):l===cy?a+=Ge.transform(i[o]):a+=i[o]}return a}}const x5=e=>typeof e=="number"?0:e;function y5(e){const t=dy(e);return uy(e)(t.map(x5))}const Zn={test:p5,parse:dy,createTransformer:uy,getAnimatableNone:y5},v5=new Set(["brightness","contrast","saturate","opacity"]);function b5(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[s]=n.match(ah)||[];if(!s)return e;const i=n.replace(s,"");let a=v5.has(t)?1:0;return s!==n&&(a*=100),t+"("+a+i+")"}const w5=/\b([a-z-]*)\(.*?\)/gu,gd={...Zn,getAnimatableNone:e=>{const t=e.match(w5);return t?t.map(b5).join(" "):e}},k5={...Wu,color:Ge,backgroundColor:Ge,outlineColor:Ge,fill:Ge,stroke:Ge,borderColor:Ge,borderTopColor:Ge,borderRightColor:Ge,borderBottomColor:Ge,borderLeftColor:Ge,filter:gd,WebkitFilter:gd},lh=e=>k5[e];function hy(e,t){let n=lh(e);return n!==gd&&(n=Zn),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const j5=new Set(["auto","none","0"]);function N5(e,t,n){let s=0,i;for(;s<e.length&&!i;){const a=e[s];typeof a=="string"&&!j5.has(a)&&$i(a).values.length&&(i=e[s]),s++}if(i&&n)for(const a of t)e[a]=hy(n,i)}const ff=e=>e===Mr||e===Y,mf=(e,t)=>parseFloat(e.split(", ")[t]),gf=(e,t)=>(n,{transform:s})=>{if(s==="none"||!s)return 0;const i=s.match(/^matrix3d\((.+)\)$/u);if(i)return mf(i[1],t);{const a=s.match(/^matrix\((.+)\)$/u);return a?mf(a[1],e):0}},S5=new Set(["x","y","z"]),C5=Ar.filter(e=>!S5.has(e));function _5(e){const t=[];return C5.forEach(n=>{const s=e.getValue(n);s!==void 0&&(t.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),t}const jr={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:gf(4,13),y:gf(5,14)};jr.translateX=jr.x;jr.translateY=jr.y;const js=new Set;let xd=!1,yd=!1;function py(){if(yd){const e=Array.from(js).filter(s=>s.needsMeasurement),t=new Set(e.map(s=>s.element)),n=new Map;t.forEach(s=>{const i=_5(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)})}yd=!1,xd=!1,js.forEach(e=>e.complete()),js.clear()}function fy(){js.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(yd=!0)})}function E5(){fy(),py()}class ch{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?(js.add(this),xd||(xd=!0,ye.read(fy),ye.resolveKeyframes(py))):(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),js.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,js.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const my=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),T5=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function P5(e){const t=T5.exec(e);if(!t)return[,];const[,n,s,i]=t;return[`--${n??s}`,i]}function gy(e,t,n=1){const[s,i]=P5(e);if(!s)return;const a=window.getComputedStyle(t).getPropertyValue(s);if(a){const o=a.trim();return my(o)?parseFloat(o):o}return Hu(i)?gy(i,t,n+1):i}const xy=e=>t=>t.test(e),A5={test:e=>e==="auto",parse:e=>e},yy=[Mr,Y,sn,Mn,bk,vk,A5],xf=e=>yy.find(xy(e));class vy extends ch{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 d=t[c];if(typeof d=="string"&&(d=d.trim(),Hu(d))){const u=gy(d,n.current);u!==void 0&&(t[c]=u),c===t.length-1&&(this.finalKeyframe=d)}}if(this.resolveNoneKeyframes(),!Yx.has(s)||t.length!==2)return;const[i,a]=t,o=xf(i),l=xf(a);if(o!==l)if(ff(o)&&ff(l))for(let c=0;c<t.length;c++){const d=t[c];typeof d=="string"&&(t[c]=parseFloat(d))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,s=[];for(let i=0;i<t.length;i++)o5(t[i])&&s.push(i);s.length&&N5(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=jr[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]=jr[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,d])=>{n.getValue(c).set(d)}),this.resolveNoneKeyframes()}}const yf=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Zn.test(e)||e==="0")&&!e.startsWith("url("));function M5(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 z5(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=yf(i,t),l=yf(a,t);return!o||!l?!1:M5(e)||(n==="spring"||Ju(n))&&s}const R5=e=>e!==null;function rl(e,{repeat:t,repeatType:n="loop"},s){const i=e.filter(R5),a=t&&n!=="loop"&&t%2===1?0:i.length-1;return!a||s===void 0?i[a]:s}const L5=40;class by{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=rn.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>L5?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&E5(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=rn.now(),this.hasAttemptedResolve=!0;const{name:s,type:i,velocity:a,delay:o,onComplete:l,onUpdate:c,isGenerator:d}=this.options;if(!d&&!z5(t,s,i,a))if(o)this.options.duration=0;else{c&&c(rl(t,this.options,n)),l&&l(),this.resolveFinishedPromise();return}const u=this.initPlayback(t,n);u!==!1&&(this._resolved={keyframes:t,finalKeyframe:n,...u},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 Gl(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 D5({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=Gl(c,l,e+1/3),a=Gl(c,l,e),o=Gl(c,l,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:s}}function Ao(e,t){return n=>n>0?t:e}const Kl=(e,t,n)=>{const s=e*e,i=n*(t*t-s)+s;return i<0?0:Math.sqrt(i)},O5=[md,bs,rr],I5=e=>O5.find(t=>t.test(e));function vf(e){const t=I5(e);if(!t)return!1;let n=t.parse(e);return t===rr&&(n=D5(n)),n}const bf=(e,t)=>{const n=vf(e),s=vf(t);if(!n||!s)return Ao(e,t);const i={...n};return a=>(i.red=Kl(n.red,s.red,a),i.green=Kl(n.green,s.green,a),i.blue=Kl(n.blue,s.blue,a),i.alpha=je(n.alpha,s.alpha,a),bs.transform(i))},B5=(e,t)=>n=>t(e(n)),ea=(...e)=>e.reduce(B5),vd=new Set(["none","hidden"]);function F5(e,t){return vd.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function V5(e,t){return n=>je(e,t,n)}function dh(e){return typeof e=="number"?V5:typeof e=="string"?Hu(e)?Ao:Ge.test(e)?bf:H5:Array.isArray(e)?wy:typeof e=="object"?Ge.test(e)?bf:$5:Ao}function wy(e,t){const n=[...e],s=n.length,i=e.map((a,o)=>dh(a)(a,t[o]));return a=>{for(let o=0;o<s;o++)n[o]=i[o](a);return n}}function $5(e,t){const n={...e,...t},s={};for(const i in n)e[i]!==void 0&&t[i]!==void 0&&(s[i]=dh(e[i])(e[i],t[i]));return i=>{for(const a in s)n[a]=s[a](i);return n}}function U5(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 H5=(e,t)=>{const n=Zn.createTransformer(t),s=$i(e),i=$i(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?vd.has(e)&&!i.values.length||vd.has(t)&&!s.values.length?F5(e,t):ea(wy(U5(s,i),i.values),n):Ao(e,t)};function ky(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?je(e,t,n):dh(e)(e,t)}const W5=5;function jy(e,t,n){const s=Math.max(t-W5,0);return Xx(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},ql=.001;function G5({duration:e=Ce.duration,bounce:t=Ce.bounce,velocity:n=Ce.velocity,mass:s=Ce.mass}){let i,a,o=1-t;o=Nn(Ce.minDamping,Ce.maxDamping,o),e=Nn(Ce.minDuration,Ce.maxDuration,vn(e)),o<1?(i=d=>{const u=d*o,p=u*e,h=u-n,m=bd(d,o),y=Math.exp(-p);return ql-h/m*y},a=d=>{const p=d*o*e,h=p*n+n,m=Math.pow(o,2)*Math.pow(d,2)*e,y=Math.exp(-p),b=bd(Math.pow(d,2),o);return(-i(d)+ql>0?-1:1)*((h-m)*y)/b}):(i=d=>{const u=Math.exp(-d*e),p=(d-n)*e+1;return-ql+u*p},a=d=>{const u=Math.exp(-d*e),p=(n-d)*(e*e);return u*p});const l=5/e,c=q5(i,a,l);if(e=yn(e),isNaN(c))return{stiffness:Ce.stiffness,damping:Ce.damping,duration:e};{const d=Math.pow(c,2)*s;return{stiffness:d,damping:o*2*Math.sqrt(s*d),duration:e}}}const K5=12;function q5(e,t,n){let s=n;for(let i=1;i<K5;i++)s=s-e(s)/t(s);return s}function bd(e,t){return e*Math.sqrt(1-t*t)}const Y5=["duration","bounce"],X5=["stiffness","damping","mass"];function wf(e,t){return t.some(n=>e[n]!==void 0)}function Q5(e){let t={velocity:Ce.velocity,stiffness:Ce.stiffness,damping:Ce.damping,mass:Ce.mass,isResolvedFromDuration:!1,...e};if(!wf(e,X5)&&wf(e,Y5))if(e.visualDuration){const n=e.visualDuration,s=2*Math.PI/(n*1.2),i=s*s,a=2*Nn(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:Ce.mass,stiffness:i,damping:a}}else{const n=G5(e);t={...t,...n,mass:Ce.mass},t.isResolvedFromDuration=!0}return t}function Ny(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:d,mass:u,duration:p,velocity:h,isResolvedFromDuration:m}=Q5({...n,velocity:-vn(n.velocity||0)}),y=h||0,b=d/(2*Math.sqrt(c*u)),v=o-a,g=vn(Math.sqrt(c/u)),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(b<1){const k=bd(g,b);w=N=>{const S=Math.exp(-b*g*N);return o-S*((y+b*g*v)/k*Math.sin(k*N)+v*Math.cos(k*N))}}else if(b===1)w=k=>o-Math.exp(-g*k)*(v+(y+g*v)*k);else{const k=g*Math.sqrt(b*b-1);w=N=>{const S=Math.exp(-b*g*N),_=Math.min(k*N,300);return o-S*((y+b*g*v)*Math.sinh(_)+k*v*Math.cosh(_))/k}}const j={calculatedDuration:m&&p||null,next:k=>{const N=w(k);if(m)l.done=k>=p;else{let S=0;b<1&&(S=k===0?yn(y):jy(w,k,N));const _=Math.abs(S)<=s,A=Math.abs(o-N)<=i;l.done=_&&A}return l.value=l.done?o:N,l},toString:()=>{const k=Math.min($x(j),hd),N=Ux(S=>j.next(k*S).value,k,30);return k+"ms "+N}};return j}function kf({keyframes:e,velocity:t=0,power:n=.8,timeConstant:s=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:l,max:c,restDelta:d=.5,restSpeed:u}){const p=e[0],h={done:!1,value:p},m=_=>l!==void 0&&_<l||c!==void 0&&_>c,y=_=>l===void 0?c:c===void 0||Math.abs(l-_)<Math.abs(c-_)?l:c;let b=n*t;const v=p+b,g=o===void 0?v:o(v);g!==v&&(b=g-p);const x=_=>-b*Math.exp(-_/s),w=_=>g+x(_),j=_=>{const A=x(_),P=w(_);h.done=Math.abs(A)<=d,h.value=h.done?g:P};let k,N;const S=_=>{m(h.value)&&(k=_,N=Ny({keyframes:[h.value,y(h.value)],velocity:jy(w,_,h.value),damping:i,stiffness:a,restDelta:d,restSpeed:u}))};return S(0),{calculatedDuration:null,next:_=>{let A=!1;return!N&&k===void 0&&(A=!0,j(_),S(_)),k!==void 0&&_>=k?N.next(_-k):(!A&&j(_),h)}}}const J5=Zi(.42,0,1,1),Z5=Zi(0,0,.58,1),Sy=Zi(.42,0,.58,1),ej=e=>Array.isArray(e)&&typeof e[0]!="number",tj={linear:xt,easeIn:J5,easeInOut:Sy,easeOut:Z5,circIn:ih,circInOut:iy,circOut:ry,backIn:rh,backInOut:ny,backOut:ty,anticipate:sy},jf=e=>{if(Zu(e)){wx(e.length===4);const[t,n,s,i]=e;return Zi(t,n,s,i)}else if(typeof e=="string")return tj[e];return e};function nj(e,t,n){const s=[],i=n||ky,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]||xt:t;l=ea(c,l)}s.push(l)}return s}function sj(e,t,{clamp:n=!0,ease:s,mixer:i}={}){const a=e.length;if(wx(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=nj(t,s,i),c=l.length,d=u=>{if(o&&u<e[0])return t[0];let p=0;if(c>1)for(;p<e.length-2&&!(u<e[p+1]);p++);const h=wr(e[p],e[p+1],u);return l[p](h)};return n?u=>d(Nn(e[0],e[a-1],u)):d}function rj(e,t){const n=e[e.length-1];for(let s=1;s<=t;s++){const i=wr(0,t,s);e.push(je(n,1,i))}}function ij(e){const t=[0];return rj(t,e.length-1),t}function aj(e,t){return e.map(n=>n*t)}function oj(e,t){return e.map(()=>t||Sy).splice(0,e.length-1)}function Mo({duration:e=300,keyframes:t,times:n,ease:s="easeInOut"}){const i=ej(s)?s.map(jf):jf(s),a={done:!1,value:t[0]},o=aj(n&&n.length===t.length?n:ij(t),e),l=sj(o,t,{ease:Array.isArray(i)?i:oj(t,i)});return{calculatedDuration:e,next:c=>(a.value=l(c),a.done=c>=e,a)}}const lj=e=>{const t=({timestamp:n})=>e(n);return{start:()=>ye.update(t,!0),stop:()=>Jn(t),now:()=>Ve.isProcessing?Ve.timestamp:rn.now()}},cj={decay:kf,inertia:kf,tween:Mo,keyframes:Mo,spring:Ny},dj=e=>e/100;class uh extends by{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)||ch,l=(c,d)=>this.onKeyframesResolved(c,d);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=Ju(n)?n:cj[n]||Mo;let c,d;l!==Mo&&typeof t[0]!="number"&&(c=ea(dj,ky(t[0],t[1])),t=[0,100]);const u=l({...this.options,keyframes:t});a==="mirror"&&(d=l({...this.options,keyframes:[...t].reverse(),velocity:-o})),u.calculatedDuration===null&&(u.calculatedDuration=$x(u));const{calculatedDuration:p}=u,h=p+i,m=h*(s+1)-i;return{generator:u,mirroredGenerator:d,mapPercentToKeyframes:c,calculatedDuration:p,resolvedDuration:h,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:_}=this.options;return{done:!0,value:_[_.length-1]}}const{finalKeyframe:i,generator:a,mirroredGenerator:o,mapPercentToKeyframes:l,keyframes:c,calculatedDuration:d,totalDuration:u,resolvedDuration:p}=s;if(this.startTime===null)return a.next(0);const{delay:h,repeat:m,repeatType:y,repeatDelay:b,onUpdate:v}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-u/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-h*(this.speed>=0?1:-1),x=this.speed>=0?g<0:g>u;this.currentTime=Math.max(g,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=u);let w=this.currentTime,j=a;if(m){const _=Math.min(this.currentTime,u)/p;let A=Math.floor(_),P=_%1;!P&&_>=1&&(P=1),P===1&&A--,A=Math.min(A,m+1),!!(A%2)&&(y==="reverse"?(P=1-P,b&&(P-=b/p)):y==="mirror"&&(j=o)),w=Nn(0,1,P)*p}const k=x?{done:!1,value:c[0]}:j.next(w);l&&(k.value=l(k.value));let{done:N}=k;!x&&d!==null&&(N=this.speed>=0?this.currentTime>=u:this.currentTime<=0);const S=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&N);return S&&i!==void 0&&(k.value=rl(c,this.options,i)),v&&v(k.value),S&&this.finish(),k}get duration(){const{resolved:t}=this;return t?vn(t.calculatedDuration):0}get time(){return vn(this.currentTime)}set time(t){t=yn(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=vn(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=lj,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 uj=new Set(["opacity","clipPath","filter","transform"]);function hj(e,t,n,{delay:s=0,duration:i=300,repeat:a=0,repeatType:o="loop",ease:l="easeInOut",times:c}={}){const d={[t]:n};c&&(d.offset=c);const u=Wx(l,i);return Array.isArray(u)&&(d.easing=u),e.animate(d,{delay:s,duration:i,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:a+1,direction:o==="reverse"?"alternate":"normal"})}const pj=Ou(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),zo=10,fj=2e4;function mj(e){return Ju(e.type)||e.type==="spring"||!Hx(e.ease)}function gj(e,t){const n=new uh({...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<fj;)s=n.sample(a),i.push(s.value),a+=zo;return{times:void 0,keyframes:i,duration:a-zo,ease:"linear"}}const Cy={anticipate:sy,backInOut:ny,circInOut:iy};function xj(e){return e in Cy}class Nf extends by{constructor(t){super(t);const{name:n,motionValue:s,element:i,keyframes:a}=this.options;this.resolver=new vy(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:d}=this.options;if(!l.owner||!l.owner.current)return!1;if(typeof a=="string"&&Po()&&xj(a)&&(a=Cy[a]),mj(this.options)){const{onComplete:p,onUpdate:h,motionValue:m,element:y,...b}=this.options,v=gj(t,b);t=v.keyframes,t.length===1&&(t[1]=t[0]),s=v.duration,i=v.times,a=v.ease,o="keyframes"}const u=hj(l.owner.current,c,t,{...this.options,duration:s,times:i,ease:a});return u.startTime=d??this.calcStartTime(),this.pendingTimeline?(lf(u,this.pendingTimeline),this.pendingTimeline=void 0):u.onfinish=()=>{const{onComplete:p}=this.options;l.set(rl(t,this.options,n)),p&&p(),this.cancel(),this.resolveFinishedPromise()},{animation:u,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 vn(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return vn(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:s}=n;s.currentTime=yn(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 xt;const{animation:s}=n;lf(s,t)}return xt}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:d,onUpdate:u,onComplete:p,element:h,...m}=this.options,y=new uh({...m,keyframes:s,duration:i,type:a,ease:o,times:l,isGenerator:!0}),b=yn(this.time);d.setWithVelocity(y.sample(b-zo).value,y.sample(b).value,zo)}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:d}=n.owner.getProps();return pj()&&s&&uj.has(s)&&!c&&!d&&!i&&a!=="mirror"&&o!==0&&l!=="inertia"}}const yj={type:"spring",stiffness:500,damping:25,restSpeed:10},vj=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),bj={type:"keyframes",duration:.8},wj={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},kj=(e,{keyframes:t})=>t.length>2?bj:zs.has(e)?e.startsWith("scale")?vj(t[1]):yj:wj;function jj({when:e,delay:t,delayChildren:n,staggerChildren:s,staggerDirection:i,repeat:a,repeatType:o,repeatDelay:l,from:c,elapsed:d,...u}){return!!Object.keys(u).length}const hh=(e,t,n,s={},i,a)=>o=>{const l=Qu(s,e)||{},c=l.delay||s.delay||0;let{elapsed:d=0}=s;d=d-yn(c);let u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...l,delay:-d,onUpdate:h=>{t.set(h),l.onUpdate&&l.onUpdate(h)},onComplete:()=>{o(),l.onComplete&&l.onComplete()},name:e,motionValue:t,element:a?void 0:i};jj(l)||(u={...u,...kj(e,u)}),u.duration&&(u.duration=yn(u.duration)),u.repeatDelay&&(u.repeatDelay=yn(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let p=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(u.duration=0,u.delay===0&&(p=!0)),p&&!a&&t.get()!==void 0){const h=rl(u.keyframes,l);if(h!==void 0)return ye.update(()=>{u.onUpdate(h),u.onComplete()}),new $k([])}return!a&&Nf.supports(u)?new Nf(u):new uh(u)};function Nj({protectedKeys:e,needsAnimating:t},n){const s=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,s}function _y(e,t,{delay:n=0,transitionOverride:s,type:i}={}){var a;let{transition:o=e.getDefaultTransition(),transitionEnd:l,...c}=t;s&&(o=s);const d=[],u=i&&e.animationState&&e.animationState.getState()[i];for(const p in c){const h=e.getValue(p,(a=e.latestValues[p])!==null&&a!==void 0?a:null),m=c[p];if(m===void 0||u&&Nj(u,p))continue;const y={delay:n,...Qu(o||{},p)};let b=!1;if(window.MotionHandoffAnimation){const g=Qx(e);if(g){const x=window.MotionHandoffAnimation(g,p,ye);x!==null&&(y.startTime=x,b=!0)}}fd(e,p),h.start(hh(p,h,m,e.shouldReduceMotion&&Yx.has(p)?{type:!1}:y,e,b));const v=h.animation;v&&d.push(v)}return l&&Promise.all(d).then(()=>{ye.update(()=>{l&&n5(e,l)})}),d}function wd(e,t,n={}){var s;const i=sl(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(_y(e,i,n)):()=>Promise.resolve(),l=e.variantChildren&&e.variantChildren.size?(d=0)=>{const{delayChildren:u=0,staggerChildren:p,staggerDirection:h}=a;return Sj(e,t,u+d,p,h,n)}:()=>Promise.resolve(),{when:c}=a;if(c){const[d,u]=c==="beforeChildren"?[o,l]:[l,o];return d().then(()=>u())}else return Promise.all([o(),l(n.delay)])}function Sj(e,t,n=0,s=0,i=1,a){const o=[],l=(e.variantChildren.size-1)*s,c=i===1?(d=0)=>d*s:(d=0)=>l-d*s;return Array.from(e.variantChildren).sort(Cj).forEach((d,u)=>{d.notify("AnimationStart",t),o.push(wd(d,t,{...a,delay:n+c(u)}).then(()=>d.notify("AnimationComplete",t)))}),Promise.all(o)}function Cj(e,t){return e.sortNodePosition(t)}function _j(e,t,n={}){e.notify("AnimationStart",t);let s;if(Array.isArray(t)){const i=t.map(a=>wd(e,a,n));s=Promise.all(i)}else if(typeof t=="string")s=wd(e,t,n);else{const i=typeof t=="function"?sl(e,t,n.custom):t;s=Promise.all(_y(e,i,n))}return s.then(()=>{e.notify("AnimationComplete",t)})}const Ej=Bu.length;function Ey(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?Ey(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<Ej;n++){const s=Bu[n],i=e.props[s];(Bi(i)||i===!1)&&(t[s]=i)}return t}const Tj=[...Iu].reverse(),Pj=Iu.length;function Aj(e){return t=>Promise.all(t.map(({animation:n,options:s})=>_j(e,n,s)))}function Mj(e){let t=Aj(e),n=Sf(),s=!0;const i=c=>(d,u)=>{var p;const h=sl(e,u,c==="exit"?(p=e.presenceContext)===null||p===void 0?void 0:p.custom:void 0);if(h){const{transition:m,transitionEnd:y,...b}=h;d={...d,...b,...y}}return d};function a(c){t=c(e)}function o(c){const{props:d}=e,u=Ey(e.parent)||{},p=[],h=new Set;let m={},y=1/0;for(let v=0;v<Pj;v++){const g=Tj[v],x=n[g],w=d[g]!==void 0?d[g]:u[g],j=Bi(w),k=g===c?x.isActive:null;k===!1&&(y=v);let N=w===u[g]&&w!==d[g]&&j;if(N&&s&&e.manuallyAnimateOnMount&&(N=!1),x.protectedKeys={...m},!x.isActive&&k===null||!w&&!x.prevProp||tl(w)||typeof w=="boolean")continue;const S=zj(x.prevProp,w);let _=S||g===c&&x.isActive&&!N&&j||v>y&&j,A=!1;const P=Array.isArray(w)?w:[w];let T=P.reduce(i(g),{});k===!1&&(T={});const{prevResolvedValues:V={}}=x,M={...V,...T},I=B=>{_=!0,h.has(B)&&(A=!0,h.delete(B)),x.needsAnimating[B]=!0;const C=e.getValue(B);C&&(C.liveStyle=!1)};for(const B in M){const C=T[B],E=V[B];if(m.hasOwnProperty(B))continue;let L=!1;ud(C)&&ud(E)?L=!Vx(C,E):L=C!==E,L?C!=null?I(B):h.add(B):C!==void 0&&h.has(B)?I(B):x.protectedKeys[B]=!0}x.prevProp=w,x.prevResolvedValues=T,x.isActive&&(m={...m,...T}),s&&e.blockInitialAnimation&&(_=!1),_&&(!(N&&S)||A)&&p.push(...P.map(B=>({animation:B,options:{type:g}})))}if(h.size){const v={};h.forEach(g=>{const x=e.getBaseTarget(g),w=e.getValue(g);w&&(w.liveStyle=!0),v[g]=x??null}),p.push({animation:v})}let b=!!p.length;return s&&(d.initial===!1||d.initial===d.animate)&&!e.manuallyAnimateOnMount&&(b=!1),s=!1,b?t(p):Promise.resolve()}function l(c,d){var u;if(n[c].isActive===d)return Promise.resolve();(u=e.variantChildren)===null||u===void 0||u.forEach(h=>{var m;return(m=h.animationState)===null||m===void 0?void 0:m.setActive(c,d)}),n[c].isActive=d;const p=o(c);for(const h in n)n[h].protectedKeys={};return p}return{animateChanges:o,setActive:l,setAnimateFunction:a,getState:()=>n,reset:()=>{n=Sf(),s=!0}}}function zj(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Vx(t,e):!1}function ds(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Sf(){return{animate:ds(!0),whileInView:ds(),whileHover:ds(),whileTap:ds(),whileDrag:ds(),whileFocus:ds(),exit:ds()}}class as{constructor(t){this.isMounted=!1,this.node=t}update(){}}class Rj extends as{constructor(t){super(t),t.animationState||(t.animationState=Mj(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();tl(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 Lj=0;class Dj extends as{constructor(){super(...arguments),this.id=Lj++}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 Oj={animation:{Feature:Rj},exit:{Feature:Dj}};function Ui(e,t,n,s={passive:!0}){return e.addEventListener(t,n,s),()=>e.removeEventListener(t,n)}function ta(e){return{point:{x:e.pageX,y:e.pageY}}}const Ij=e=>t=>eh(t)&&e(t,ta(t));function fi(e,t,n,s){return Ui(e,t,Ij(n),s)}const Cf=(e,t)=>Math.abs(e-t);function Bj(e,t){const n=Cf(e.x,t.x),s=Cf(e.y,t.y);return Math.sqrt(n**2+s**2)}class Ty{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=Xl(this.lastMoveEventInfo,this.history),h=this.startEvent!==null,m=Bj(p.offset,{x:0,y:0})>=3;if(!h&&!m)return;const{point:y}=p,{timestamp:b}=Ve;this.history.push({...y,timestamp:b});const{onStart:v,onMove:g}=this.handlers;h||(v&&v(this.lastMoveEvent,p),this.startEvent=this.lastMoveEvent),g&&g(this.lastMoveEvent,p)},this.handlePointerMove=(p,h)=>{this.lastMoveEvent=p,this.lastMoveEventInfo=Yl(h,this.transformPagePoint),ye.update(this.updatePoint,!0)},this.handlePointerUp=(p,h)=>{this.end();const{onEnd:m,onSessionEnd:y,resumeAnimation:b}=this.handlers;if(this.dragSnapToOrigin&&b&&b(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const v=Xl(p.type==="pointercancel"?this.lastMoveEventInfo:Yl(h,this.transformPagePoint),this.history);this.startEvent&&m&&m(p,v),y&&y(p,v)},!eh(t))return;this.dragSnapToOrigin=a,this.handlers=n,this.transformPagePoint=s,this.contextWindow=i||window;const o=ta(t),l=Yl(o,this.transformPagePoint),{point:c}=l,{timestamp:d}=Ve;this.history=[{...c,timestamp:d}];const{onSessionStart:u}=n;u&&u(t,Xl(l,this.history)),this.removeListeners=ea(fi(this.contextWindow,"pointermove",this.handlePointerMove),fi(this.contextWindow,"pointerup",this.handlePointerUp),fi(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Jn(this.updatePoint)}}function Yl(e,t){return t?{point:t(e.point)}:e}function _f(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Xl({point:e},t){return{point:e,delta:_f(e,Py(t)),offset:_f(e,Fj(t)),velocity:Vj(t,.1)}}function Fj(e){return e[0]}function Py(e){return e[e.length-1]}function Vj(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,s=null;const i=Py(e);for(;n>=0&&(s=e[n],!(i.timestamp-s.timestamp>yn(t)));)n--;if(!s)return{x:0,y:0};const a=vn(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 Ay=1e-4,$j=1-Ay,Uj=1+Ay,My=.01,Hj=0-My,Wj=0+My;function vt(e){return e.max-e.min}function Gj(e,t,n){return Math.abs(e-t)<=n}function Ef(e,t,n,s=.5){e.origin=s,e.originPoint=je(t.min,t.max,e.origin),e.scale=vt(n)/vt(t),e.translate=je(n.min,n.max,e.origin)-e.originPoint,(e.scale>=$j&&e.scale<=Uj||isNaN(e.scale))&&(e.scale=1),(e.translate>=Hj&&e.translate<=Wj||isNaN(e.translate))&&(e.translate=0)}function mi(e,t,n,s){Ef(e.x,t.x,n.x,s?s.originX:void 0),Ef(e.y,t.y,n.y,s?s.originY:void 0)}function Tf(e,t,n){e.min=n.min+t.min,e.max=e.min+vt(t)}function Kj(e,t,n){Tf(e.x,t.x,n.x),Tf(e.y,t.y,n.y)}function Pf(e,t,n){e.min=t.min-n.min,e.max=e.min+vt(t)}function gi(e,t,n){Pf(e.x,t.x,n.x),Pf(e.y,t.y,n.y)}function qj(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 Af(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 Yj(e,{top:t,left:n,bottom:s,right:i}){return{x:Af(e.x,n,i),y:Af(e.y,t,s)}}function Mf(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 Xj(e,t){return{x:Mf(e.x,t.x),y:Mf(e.y,t.y)}}function Qj(e,t){let n=.5;const s=vt(e),i=vt(t);return i>s?n=wr(t.min,t.max-s,e.min):s>i&&(n=wr(e.min,e.max-i,t.min)),Nn(0,1,n)}function Jj(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 kd=.35;function Zj(e=kd){return e===!1?e=0:e===!0&&(e=kd),{x:zf(e,"left","right"),y:zf(e,"top","bottom")}}function zf(e,t,n){return{min:Rf(e,t),max:Rf(e,n)}}function Rf(e,t){return typeof e=="number"?e:e[t]||0}const Lf=()=>({translate:0,scale:1,origin:0,originPoint:0}),ir=()=>({x:Lf(),y:Lf()}),Df=()=>({min:0,max:0}),Te=()=>({x:Df(),y:Df()});function Nt(e){return[e("x"),e("y")]}function zy({top:e,left:t,right:n,bottom:s}){return{x:{min:t,max:n},y:{min:e,max:s}}}function eN({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function tN(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 Ql(e){return e===void 0||e===1}function jd({scale:e,scaleX:t,scaleY:n}){return!Ql(e)||!Ql(t)||!Ql(n)}function fs(e){return jd(e)||Ry(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Ry(e){return Of(e.x)||Of(e.y)}function Of(e){return e&&e!=="0%"}function Ro(e,t,n){const s=e-n,i=t*s;return n+i}function If(e,t,n,s,i){return i!==void 0&&(e=Ro(e,i,s)),Ro(e,n,s)+t}function Nd(e,t=0,n=1,s,i){e.min=If(e.min,t,n,s,i),e.max=If(e.max,t,n,s,i)}function Ly(e,{x:t,y:n}){Nd(e.x,t.translate,t.scale,t.originPoint),Nd(e.y,n.translate,n.scale,n.originPoint)}const Bf=.999999999999,Ff=1.0000000000001;function nN(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&&or(e,{x:-a.scroll.offset.x,y:-a.scroll.offset.y}),o&&(t.x*=o.x.scale,t.y*=o.y.scale,Ly(e,o)),s&&fs(a.latestValues)&&or(e,a.latestValues))}t.x<Ff&&t.x>Bf&&(t.x=1),t.y<Ff&&t.y>Bf&&(t.y=1)}function ar(e,t){e.min=e.min+t,e.max=e.max+t}function Vf(e,t,n,s,i=.5){const a=je(e.min,e.max,i);Nd(e,t,n,a,s)}function or(e,t){Vf(e.x,t.x,t.scaleX,t.scale,t.originX),Vf(e.y,t.y,t.scaleY,t.scale,t.originY)}function Dy(e,t){return zy(tN(e.getBoundingClientRect(),t))}function sN(e,t,n){const s=Dy(e,n),{scroll:i}=t;return i&&(ar(s.x,i.offset.x),ar(s.y,i.offset.y)),s}const Oy=({current:e})=>e?e.ownerDocument.defaultView:null,rN=new WeakMap;class iN{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=u=>{const{dragSnapToOrigin:p}=this.getProps();p?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(ta(u).point)},a=(u,p)=>{const{drag:h,dragPropagation:m,onDragStart:y}=this.getProps();if(h&&!m&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Qk(h),!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),Nt(v=>{let g=this.getAxisMotionValue(v).get()||0;if(sn.test(g)){const{projection:x}=this.visualElement;if(x&&x.layout){const w=x.layout.layoutBox[v];w&&(g=vt(w)*(parseFloat(g)/100))}}this.originPoint[v]=g}),y&&ye.postRender(()=>y(u,p)),fd(this.visualElement,"transform");const{animationState:b}=this.visualElement;b&&b.setActive("whileDrag",!0)},o=(u,p)=>{const{dragPropagation:h,dragDirectionLock:m,onDirectionLock:y,onDrag:b}=this.getProps();if(!h&&!this.openDragLock)return;const{offset:v}=p;if(m&&this.currentDirection===null){this.currentDirection=aN(v),this.currentDirection!==null&&y&&y(this.currentDirection);return}this.updateAxis("x",p.point,v),this.updateAxis("y",p.point,v),this.visualElement.render(),b&&b(u,p)},l=(u,p)=>this.stop(u,p),c=()=>Nt(u=>{var p;return this.getAnimationState(u)==="paused"&&((p=this.getAxisMotionValue(u).animation)===null||p===void 0?void 0:p.play())}),{dragSnapToOrigin:d}=this.getProps();this.panSession=new Ty(t,{onSessionStart:i,onStart:a,onMove:o,onSessionEnd:l,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:d,contextWindow:Oy(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&&ye.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||!Pa(t,i,this.currentDirection))return;const a=this.getAxisMotionValue(t);let o=this.originPoint[t]+s[t];this.constraints&&this.constraints[t]&&(o=qj(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&&sr(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&i?this.constraints=Yj(i.layoutBox,n):this.constraints=!1,this.elastic=Zj(s),a!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&Nt(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=Jj(i.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!sr(t))return!1;const s=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const a=sN(s,i.root,this.visualElement.getTransformPagePoint());let o=Xj(i.layout.layoutBox,a);if(n){const l=n(eN(o));this.hasMutatedConstraints=!!l,l&&(o=zy(l))}return o}startAnimation(t){const{drag:n,dragMomentum:s,dragElastic:i,dragTransition:a,dragSnapToOrigin:o,onDragTransitionEnd:l}=this.getProps(),c=this.constraints||{},d=Nt(u=>{if(!Pa(u,n,this.currentDirection))return;let p=c&&c[u]||{};o&&(p={min:0,max:0});const h=i?200:1e6,m=i?40:1e7,y={type:"inertia",velocity:s?t[u]:0,bounceStiffness:h,bounceDamping:m,timeConstant:750,restDelta:1,restSpeed:10,...a,...p};return this.startAxisValueAnimation(u,y)});return Promise.all(d).then(l)}startAxisValueAnimation(t,n){const s=this.getAxisMotionValue(t);return fd(this.visualElement,t),s.start(hh(t,s,0,n,this.visualElement,!1))}stopAnimation(){Nt(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Nt(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){Nt(n=>{const{drag:s}=this.getProps();if(!Pa(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(!sr(n)||!s||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Nt(o=>{const l=this.getAxisMotionValue(o);if(l&&this.constraints!==!1){const c=l.get();i[o]=Qj({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(),Nt(o=>{if(!Pa(o,t,null))return;const l=this.getAxisMotionValue(o),{min:c,max:d}=this.constraints[o];l.set(je(c,d,i[o]))})}addListeners(){if(!this.visualElement.current)return;rN.set(this.visualElement,this);const t=this.visualElement.current,n=fi(t,"pointerdown",c=>{const{drag:d,dragListener:u=!0}=this.getProps();d&&u&&this.start(c)}),s=()=>{const{dragConstraints:c}=this.getProps();sr(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()),ye.read(s);const o=Ui(window,"resize",()=>this.scalePositionWithinConstraints()),l=i.addEventListener("didUpdate",({delta:c,hasLayoutChanged:d})=>{this.isDragging&&d&&(Nt(u=>{const p=this.getAxisMotionValue(u);p&&(this.originPoint[u]+=c[u].translate,p.set(p.get()+c[u].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=kd,dragMomentum:l=!0}=t;return{...t,drag:n,dragDirectionLock:s,dragPropagation:i,dragConstraints:a,dragElastic:o,dragMomentum:l}}}function Pa(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function aN(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class oN extends as{constructor(t){super(t),this.removeGroupControls=xt,this.removeListeners=xt,this.controls=new iN(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||xt}unmount(){this.removeGroupControls(),this.removeListeners()}}const $f=e=>(t,n)=>{e&&ye.postRender(()=>e(t,n))};class lN extends as{constructor(){super(...arguments),this.removePointerDownListener=xt}onPointerDown(t){this.session=new Ty(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Oy(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:s,onPanEnd:i}=this.node.getProps();return{onSessionStart:$f(t),onStart:$f(n),onMove:s,onEnd:(a,o)=>{delete this.session,i&&ye.postRender(()=>i(a,o))}}}mount(){this.removePointerDownListener=fi(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 Qa={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Uf(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Wr={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Y.test(e))e=parseFloat(e);else return e;const n=Uf(e,t.target.x),s=Uf(e,t.target.y);return`${n}% ${s}%`}},cN={correct:(e,{treeScale:t,projectionDelta:n})=>{const s=e,i=Zn.parse(e);if(i.length>5)return s;const a=Zn.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 d=je(l,c,.5);return typeof i[2+o]=="number"&&(i[2+o]/=d),typeof i[3+o]=="number"&&(i[3+o]/=d),a(i)}};class dN extends f.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:s,layoutId:i}=this.props,{projection:a}=t;Pk(uN),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()})),Qa.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()||ye.postRender(()=>{const l=o.getStack();(!l||!l.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),Vu.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 Iy(e){const[t,n]=vx(),s=f.useContext(Lu);return r.jsx(dN,{...e,layoutGroup:s,switchLayoutGroup:f.useContext(Ex),isPresent:t,safeToRemove:n})}const uN={borderRadius:{...Wr,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Wr,borderTopRightRadius:Wr,borderBottomLeftRadius:Wr,borderBottomRightRadius:Wr,boxShadow:cN};function hN(e,t,n){const s=Ye(e)?e:Vi(e);return s.start(hh("",s,t,n)),s.animation}function pN(e){return e instanceof SVGElement&&e.tagName!=="svg"}const fN=(e,t)=>e.depth-t.depth;class mN{constructor(){this.children=[],this.isDirty=!1}add(t){th(this.children,t),this.isDirty=!0}remove(t){nh(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(fN),this.isDirty=!1,this.children.forEach(t)}}function gN(e,t){const n=rn.now(),s=({timestamp:i})=>{const a=i-n;a>=t&&(Jn(s),e(a-t))};return ye.read(s,!0),()=>Jn(s)}const By=["TopLeft","TopRight","BottomLeft","BottomRight"],xN=By.length,Hf=e=>typeof e=="string"?parseFloat(e):e,Wf=e=>typeof e=="number"||Y.test(e);function yN(e,t,n,s,i,a){i?(e.opacity=je(0,n.opacity!==void 0?n.opacity:1,vN(s)),e.opacityExit=je(t.opacity!==void 0?t.opacity:1,0,bN(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<xN;o++){const l=`border${By[o]}Radius`;let c=Gf(t,l),d=Gf(n,l);if(c===void 0&&d===void 0)continue;c||(c=0),d||(d=0),c===0||d===0||Wf(c)===Wf(d)?(e[l]=Math.max(je(Hf(c),Hf(d),s),0),(sn.test(d)||sn.test(c))&&(e[l]+="%")):e[l]=d}(t.rotate||n.rotate)&&(e.rotate=je(t.rotate||0,n.rotate||0,s))}function Gf(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const vN=Fy(0,.5,ry),bN=Fy(.5,.95,xt);function Fy(e,t,n){return s=>s<e?0:s>t?1:n(wr(e,t,s))}function Kf(e,t){e.min=t.min,e.max=t.max}function jt(e,t){Kf(e.x,t.x),Kf(e.y,t.y)}function qf(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function Yf(e,t,n,s,i){return e-=t,e=Ro(e,1/n,s),i!==void 0&&(e=Ro(e,1/i,s)),e}function wN(e,t=0,n=1,s=.5,i,a=e,o=e){if(sn.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=Yf(e.min,t,n,l,i),e.max=Yf(e.max,t,n,l,i)}function Xf(e,t,[n,s,i],a,o){wN(e,t[n],t[s],t[i],t.scale,a,o)}const kN=["x","scaleX","originX"],jN=["y","scaleY","originY"];function Qf(e,t,n,s){Xf(e.x,t,kN,n?n.x:void 0,s?s.x:void 0),Xf(e.y,t,jN,n?n.y:void 0,s?s.y:void 0)}function Jf(e){return e.translate===0&&e.scale===1}function Vy(e){return Jf(e.x)&&Jf(e.y)}function Zf(e,t){return e.min===t.min&&e.max===t.max}function NN(e,t){return Zf(e.x,t.x)&&Zf(e.y,t.y)}function em(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function $y(e,t){return em(e.x,t.x)&&em(e.y,t.y)}function tm(e){return vt(e.x)/vt(e.y)}function nm(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class SN{constructor(){this.members=[]}add(t){th(this.members,t),t.scheduleRender()}remove(t){if(nh(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 CN(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:d,rotate:u,rotateX:p,rotateY:h,skewX:m,skewY:y}=n;d&&(s=`perspective(${d}px) ${s}`),u&&(s+=`rotate(${u}deg) `),p&&(s+=`rotateX(${p}deg) `),h&&(s+=`rotateY(${h}deg) `),m&&(s+=`skewX(${m}deg) `),y&&(s+=`skewY(${y}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 ms={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},ei=typeof window<"u"&&window.MotionDebug!==void 0,Jl=["","X","Y","Z"],_N={visibility:"hidden"},sm=1e3;let EN=0;function Zl(e,t,n,s){const{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),s&&(s[e]=0))}function Uy(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=Qx(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:a}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",ye,!(i||a))}const{parent:s}=e;s&&!s.hasCheckedOptimisedAppear&&Uy(s)}function Hy({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:s,resetTransform:i}){return class{constructor(o={},l=t==null?void 0:t()){this.id=EN++,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,ei&&(ms.totalNodes=ms.resolvedTargetDeltas=ms.recalculatedProjection=0),this.nodes.forEach(AN),this.nodes.forEach(DN),this.nodes.forEach(ON),this.nodes.forEach(MN),ei&&window.MotionDebug.record(ms)},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 mN)}addEventListener(o,l){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new sh),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=pN(o),this.instance=o;const{layoutId:c,layout:d,visualElement:u}=this.options;if(u&&!u.current&&u.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),l&&(d||c)&&(this.isLayoutDirty=!0),e){let p;const h=()=>this.root.updateBlockedByResize=!1;e(o,()=>{this.root.updateBlockedByResize=!0,p&&p(),p=gN(h,250),Qa.hasAnimatedSinceResize&&(Qa.hasAnimatedSinceResize=!1,this.nodes.forEach(im))})}c&&this.root.registerSharedNode(c,this),this.options.animate!==!1&&u&&(c||d)&&this.addEventListener("didUpdate",({delta:p,hasLayoutChanged:h,hasRelativeTargetChanged:m,layout:y})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const b=this.options.transition||u.getDefaultTransition()||$N,{onLayoutAnimationStart:v,onLayoutAnimationComplete:g}=u.getProps(),x=!this.targetLayout||!$y(this.targetLayout,y)||m,w=!h&&m;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||w||h&&(x||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(p,w);const j={...Qu(b,"layout"),onPlay:v,onComplete:g};(u.shouldReduceMotion||this.options.layoutRoot)&&(j.delay=0,j.type=!1),this.startAnimation(j)}else h||im(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=y})}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,Jn(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(IN),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&&Uy(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const p=this.path[u];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 d=this.getTransformTemplate();this.prevTransformTemplateValue=d?d(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(rm);return}this.isUpdating||this.nodes.forEach(RN),this.isUpdating=!1,this.nodes.forEach(LN),this.nodes.forEach(TN),this.nodes.forEach(PN),this.clearAllSnapshots();const l=rn.now();Ve.delta=Nn(0,1e3/60,l-Ve.timestamp),Ve.timestamp=l,Ve.isProcessing=!0,Ul.update.process(Ve),Ul.preRender.process(Ve),Ul.render.process(Ve),Ve.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Vu.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(zN),this.sharedNodes.forEach(BN)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,ye.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){ye.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&&!Vy(this.projectionDelta),c=this.getTransformTemplate(),d=c?c(this.latestValues,""):void 0,u=d!==this.prevTransformTemplateValue;o&&(l||fs(this.latestValues)||u)&&(i(this.instance,d),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const l=this.measurePageBox();let c=this.removeElementScroll(l);return o&&(c=this.removeTransform(c)),UN(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(HN))){const{scroll:u}=this.root;u&&(ar(c.x,u.offset.x),ar(c.y,u.offset.y))}return c}removeElementScroll(o){var l;const c=Te();if(jt(c,o),!((l=this.scroll)===null||l===void 0)&&l.wasRoot)return c;for(let d=0;d<this.path.length;d++){const u=this.path[d],{scroll:p,options:h}=u;u!==this.root&&p&&h.layoutScroll&&(p.wasRoot&&jt(c,o),ar(c.x,p.offset.x),ar(c.y,p.offset.y))}return c}applyTransform(o,l=!1){const c=Te();jt(c,o);for(let d=0;d<this.path.length;d++){const u=this.path[d];!l&&u.options.layoutScroll&&u.scroll&&u!==u.root&&or(c,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),fs(u.latestValues)&&or(c,u.latestValues)}return fs(this.latestValues)&&or(c,this.latestValues),c}removeTransform(o){const l=Te();jt(l,o);for(let c=0;c<this.path.length;c++){const d=this.path[c];if(!d.instance||!fs(d.latestValues))continue;jd(d.latestValues)&&d.updateSnapshot();const u=Te(),p=d.measurePageBox();jt(u,p),Qf(l,d.latestValues,d.snapshot?d.snapshot.layoutBox:void 0,u)}return fs(this.latestValues)&&Qf(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!==Ve.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 d=!!this.resumingFrom||this!==c;if(!(o||d&&this.isSharedProjectionDirty||this.isProjectionDirty||!((l=this.parent)===null||l===void 0)&&l.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:p,layoutId:h}=this.options;if(!(!this.layout||!(p||h))){if(this.resolvedRelativeTargetAt=Ve.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(),gi(this.relativeTargetOrigin,this.layout.layoutBox,m.layout.layoutBox),jt(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(),Kj(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):jt(this.target,this.layout.layoutBox),Ly(this.target,this.targetDelta)):jt(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(),gi(this.relativeTargetOrigin,this.target,m.target),jt(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}ei&&ms.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||jd(this.parent.latestValues)||Ry(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 d=!0;if((this.isProjectionDirty||!((o=this.parent)===null||o===void 0)&&o.isProjectionDirty)&&(d=!1),c&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(d=!1),this.resolvedRelativeTargetAt===Ve.timestamp&&(d=!1),d)return;const{layout:u,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||!(u||p))return;jt(this.layoutCorrected,this.layout.layoutBox);const h=this.treeScale.x,m=this.treeScale.y;nN(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:y}=l;if(!y){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(qf(this.prevProjectionDelta.x,this.projectionDelta.x),qf(this.prevProjectionDelta.y,this.projectionDelta.y)),mi(this.projectionDelta,this.layoutCorrected,y,this.latestValues),(this.treeScale.x!==h||this.treeScale.y!==m||!nm(this.projectionDelta.x,this.prevProjectionDelta.x)||!nm(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",y)),ei&&ms.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=ir(),this.projectionDelta=ir(),this.projectionDeltaWithTransform=ir()}setAnimationOrigin(o,l=!1){const c=this.snapshot,d=c?c.latestValues:{},u={...this.latestValues},p=ir();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!l;const h=Te(),m=c?c.source:void 0,y=this.layout?this.layout.source:void 0,b=m!==y,v=this.getStack(),g=!v||v.members.length<=1,x=!!(b&&!g&&this.options.crossfade===!0&&!this.path.some(VN));this.animationProgress=0;let w;this.mixTargetDelta=j=>{const k=j/1e3;am(p.x,o.x,k),am(p.y,o.y,k),this.setTargetDelta(p),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(gi(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox),FN(this.relativeTarget,this.relativeTargetOrigin,h,k),w&&NN(this.relativeTarget,w)&&(this.isProjectionDirty=!1),w||(w=Te()),jt(w,this.relativeTarget)),b&&(this.animationValues=u,yN(u,d,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&&(Jn(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=ye.update(()=>{Qa.hasAnimatedSinceResize=!0,this.currentAnimation=hN(0,sm,{...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(sm),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:l,target:c,layout:d,latestValues:u}=o;if(!(!l||!c||!d)){if(this!==o&&this.layout&&d&&Wy(this.options.animationType,this.layout.layoutBox,d.layoutBox)){c=this.target||Te();const p=vt(this.layout.layoutBox.x);c.x.min=o.target.x.min,c.x.max=c.x.min+p;const h=vt(this.layout.layoutBox.y);c.y.min=o.target.y.min,c.y.max=c.y.min+h}jt(l,c),or(l,u),mi(this.projectionDeltaWithTransform,this.layoutCorrected,l,u)}}registerSharedNode(o,l){this.sharedNodes.has(o)||this.sharedNodes.set(o,new SN),this.sharedNodes.get(o).add(l);const d=l.options.initialPromotionConfig;l.promote({transition:d?d.transition:void 0,preserveFollowOpacity:d&&d.shouldPreserveFollowOpacity?d.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 d=this.getStack();d&&d.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 d={};c.z&&Zl("z",o,d,this.animationValues);for(let u=0;u<Jl.length;u++)Zl(`rotate${Jl[u]}`,o,d,this.animationValues),Zl(`skew${Jl[u]}`,o,d,this.animationValues);o.render();for(const u in d)o.setStaticValue(u,d[u]),this.animationValues&&(this.animationValues[u]=d[u]);o.scheduleRender()}getProjectionStyles(o){var l,c;if(!this.instance||this.isSVG)return;if(!this.isVisible)return _N;const d={visibility:""},u=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,d.opacity="",d.pointerEvents=Ya(o==null?void 0:o.pointerEvents)||"",d.transform=u?u(this.latestValues,""):"none",d;const p=this.getLead();if(!this.projectionDelta||!this.layout||!p.target){const b={};return this.options.layoutId&&(b.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,b.pointerEvents=Ya(o==null?void 0:o.pointerEvents)||""),this.hasProjected&&!fs(this.latestValues)&&(b.transform=u?u({},""):"none",this.hasProjected=!1),b}const h=p.animationValues||p.latestValues;this.applyTransformsToTarget(),d.transform=CN(this.projectionDeltaWithTransform,this.treeScale,h),u&&(d.transform=u(h,d.transform));const{x:m,y}=this.projectionDelta;d.transformOrigin=`${m.origin*100}% ${y.origin*100}% 0`,p.animationValues?d.opacity=p===this?(c=(l=h.opacity)!==null&&l!==void 0?l:this.latestValues.opacity)!==null&&c!==void 0?c:1:this.preserveOpacity?this.latestValues.opacity:h.opacityExit:d.opacity=p===this?h.opacity!==void 0?h.opacity:"":h.opacityExit!==void 0?h.opacityExit:0;for(const b in To){if(h[b]===void 0)continue;const{correct:v,applyTo:g}=To[b],x=d.transform==="none"?h[b]:v(h[b],p);if(g){const w=g.length;for(let j=0;j<w;j++)d[g[j]]=x}else d[b]=x}return this.options.layoutId&&(d.pointerEvents=p===this?Ya(o==null?void 0:o.pointerEvents)||"":"none"),d}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(rm),this.root.sharedNodes.clear()}}}function TN(e){e.updateLayout()}function PN(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"?Nt(p=>{const h=o?n.measuredBox[p]:n.layoutBox[p],m=vt(h);h.min=s[p].min,h.max=h.min+m}):Wy(a,n.layoutBox,s)&&Nt(p=>{const h=o?n.measuredBox[p]:n.layoutBox[p],m=vt(s[p]);h.max=h.min+m,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[p].max=e.relativeTarget[p].min+m)});const l=ir();mi(l,s,n.layoutBox);const c=ir();o?mi(c,e.applyTransform(i,!0),n.measuredBox):mi(c,s,n.layoutBox);const d=!Vy(l);let u=!1;if(!e.resumeFrom){const p=e.getClosestProjectingParent();if(p&&!p.resumeFrom){const{snapshot:h,layout:m}=p;if(h&&m){const y=Te();gi(y,n.layoutBox,h.layoutBox);const b=Te();gi(b,s,m.layoutBox),$y(y,b)||(u=!0),p.options.layoutRoot&&(e.relativeTarget=b,e.relativeTargetOrigin=y,e.relativeParent=p)}}}e.notifyListeners("didUpdate",{layout:s,snapshot:n,delta:c,layoutDelta:l,hasLayoutChanged:d,hasRelativeTargetChanged:u})}else if(e.isLead()){const{onExitComplete:s}=e.options;s&&s()}e.options.transition=void 0}function AN(e){ei&&ms.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 MN(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function zN(e){e.clearSnapshot()}function rm(e){e.clearMeasurements()}function RN(e){e.isLayoutDirty=!1}function LN(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function im(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function DN(e){e.resolveTargetDelta()}function ON(e){e.calcProjection()}function IN(e){e.resetSkewAndRotation()}function BN(e){e.removeLeadSnapshot()}function am(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 om(e,t,n,s){e.min=je(t.min,n.min,s),e.max=je(t.max,n.max,s)}function FN(e,t,n,s){om(e.x,t.x,n.x,s),om(e.y,t.y,n.y,s)}function VN(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const $N={duration:.45,ease:[.4,0,.1,1]},lm=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),cm=lm("applewebkit/")&&!lm("chrome/")?Math.round:xt;function dm(e){e.min=cm(e.min),e.max=cm(e.max)}function UN(e){dm(e.x),dm(e.y)}function Wy(e,t,n){return e==="position"||e==="preserve-aspect"&&!Gj(tm(t),tm(n),.2)}function HN(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}const WN=Hy({attachResizeListener:(e,t)=>Ui(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),ec={current:void 0},Gy=Hy({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!ec.current){const e=new WN({});e.mount(window),e.setOptions({layoutScroll:!0}),ec.current=e}return ec.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),GN={pan:{Feature:lN},drag:{Feature:oN,ProjectionNode:Gy,MeasureLayout:Iy}};function um(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&&ye.postRender(()=>a(t,ta(t)))}class KN extends as{mount(){const{current:t}=this.node;t&&(this.unmount=Gk(t,n=>(um(this.node,n,"Start"),s=>um(this.node,s,"End"))))}unmount(){}}class qN extends as{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=ea(Ui(this.node.current,"focus",()=>this.onFocus()),Ui(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function hm(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&&ye.postRender(()=>a(t,ta(t)))}class YN extends as{mount(){const{current:t}=this.node;t&&(this.unmount=Xk(t,n=>(hm(this.node,n,"Start"),(s,{success:i})=>hm(this.node,s,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Sd=new WeakMap,tc=new WeakMap,XN=e=>{const t=Sd.get(e.target);t&&t(e)},QN=e=>{e.forEach(XN)};function JN({root:e,...t}){const n=e||document;tc.has(n)||tc.set(n,{});const s=tc.get(n),i=JSON.stringify(t);return s[i]||(s[i]=new IntersectionObserver(QN,{root:e,...t})),s[i]}function ZN(e,t,n){const s=JN(t);return Sd.set(e,n),s.observe(e),()=>{Sd.delete(e),s.unobserve(e)}}const eS={some:0,all:1};class tS extends as{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:eS[i]},l=c=>{const{isIntersecting:d}=c;if(this.isInView===d||(this.isInView=d,a&&!d&&this.hasEnteredView))return;d&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",d);const{onViewportEnter:u,onViewportLeave:p}=this.node.getProps(),h=d?u:p;h&&h(c)};return ZN(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(nS(t,n))&&this.startObserver()}unmount(){}}function nS({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const sS={inView:{Feature:tS},tap:{Feature:YN},focus:{Feature:qN},hover:{Feature:KN}},rS={layout:{ProjectionNode:Gy,MeasureLayout:Iy}},Cd={current:null},Ky={current:!1};function iS(){if(Ky.current=!0,!!Du)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Cd.current=e.matches;e.addListener(t),t()}else Cd.current=!1}const aS=[...yy,Ge,Zn],oS=e=>aS.find(xy(e)),pm=new WeakMap;function lS(e,t,n){for(const s in t){const i=t[s],a=n[s];if(Ye(i))e.addValue(s,i);else if(Ye(a))e.addValue(s,Vi(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,Vi(o!==void 0?o:i,{owner:e}))}}for(const s in n)t[s]===void 0&&e.removeValue(s);return t}const fm=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class cS{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=ch,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=rn.now();this.renderScheduledAt<m&&(this.renderScheduledAt=m,ye.render(this.render,!1,!0))};const{latestValues:c,renderState:d,onUpdate:u}=o;this.onUpdate=u,this.latestValues=c,this.baseTarget={...c},this.initialValues=n.initial?{...c}:{},this.renderState=d,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=nl(n),this.isVariantNode=Cx(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:p,...h}=this.scrapeMotionValuesFromProps(n,{},this);for(const m in h){const y=h[m];c[m]!==void 0&&Ye(y)&&y.set(c[m],!1)}}mount(t){this.current=t,pm.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)),Ky.current||iS(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Cd.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){pm.delete(this.current),this.projection&&this.projection.unmount(),Jn(this.notifyUpdate),Jn(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=zs.has(t),i=n.on("change",l=>{this.latestValues[t]=l,this.props.onUpdate&&ye.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 kr){const n=kr[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<fm.length;s++){const i=fm[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=lS(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=Vi(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"&&(my(i)||ay(i))?i=parseFloat(i):!oS(i)&&Zn.test(n)&&(i=hy(t,n)),this.setBaseTarget(t,Ye(i)?i.get():i)),Ye(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=Uu(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&&!Ye(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 sh),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class qy extends cS{constructor(){super(...arguments),this.KeyframeResolver=vy}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;Ye(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function dS(e){return window.getComputedStyle(e)}class uS extends qy{constructor(){super(...arguments),this.type="html",this.renderInstance=Lx}readValueFromInstance(t,n){if(zs.has(n)){const s=lh(n);return s&&s.default||0}else{const s=dS(t),i=(Mx(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return Dy(t,n)}build(t,n,s){Gu(t,n,s.transformTemplate)}scrapeMotionValuesFromProps(t,n,s){return Xu(t,n,s)}}class hS extends qy{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Te}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(zs.has(n)){const s=lh(n);return s&&s.default||0}return n=Dx.has(n)?n:Fu(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,s){return Bx(t,n,s)}build(t,n,s){Ku(t,n,this.isSVGTag,s.transformTemplate)}renderInstance(t,n,s,i){Ox(t,n,s,i)}mount(t){this.isSVGTag=Yu(t.tagName),super.mount(t)}}const pS=(e,t)=>$u(e)?new hS(t):new uS(t,{allowProjection:e!==f.Fragment}),fS=Bk({...Oj,...sS,...GN,...rS},pS),U=ek(fS);/**
|
|
76
|
+
`),()=>{document.head.removeChild(u)}},[t]),r.jsx($2,{isPresent:t,childRef:s,sizeRef:i,children:f.cloneElement(e,{ref:s})})}const H2=({children:e,initial:t,isPresent:n,onExitComplete:s,custom:i,presenceAffectsLayout:a,mode:o})=>{const l=Jo(W2),c=f.useId(),d=f.useCallback(p=>{l.set(p,!0);for(const h of l.values())if(!h)return;s&&s()},[l,s]),u=f.useMemo(()=>({id:c,initial:t,isPresent:n,custom:i,onExitComplete:d,register:p=>(l.set(p,!1),()=>l.delete(p))}),a?[Math.random(),d]:[n,d]);return f.useMemo(()=>{l.forEach((p,h)=>l.set(h,!1))},[n]),f.useEffect(()=>{!n&&!l.size&&s&&s()},[n]),o==="popLayout"&&(e=r.jsx(U2,{isPresent:n,children:e})),r.jsx(Zo.Provider,{value:u,children:e})};function W2(){return new Map}function yx(e=!0){const t=f.useContext(Zo);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:s,register:i}=t,a=f.useId();f.useEffect(()=>{e&&i(a)},[e]);const o=f.useCallback(()=>e&&s&&s(a),[a,s,e]);return!n&&s?[!1,o]:[!0]}const _a=e=>e.key||"";function Zp(e){const t=[];return f.Children.forEach(e,n=>{f.isValidElement(n)&&t.push(n)}),t}const Du=typeof window<"u",vx=Du?f.useLayoutEffect:f.useEffect,ee=({children:e,custom:t,initial:n=!0,onExitComplete:s,presenceAffectsLayout:i=!0,mode:a="sync",propagate:o=!1})=>{const[l,c]=yx(o),d=f.useMemo(()=>Zp(e),[e]),u=o&&!l?[]:d.map(_a),p=f.useRef(!0),h=f.useRef(d),m=Jo(()=>new Map),[y,b]=f.useState(d),[v,g]=f.useState(d);vx(()=>{p.current=!1,h.current=d;for(let j=0;j<v.length;j++){const k=_a(v[j]);u.includes(k)?m.delete(k):m.get(k)!==!0&&m.set(k,!1)}},[v,u.length,u.join("-")]);const x=[];if(d!==y){let j=[...d];for(let k=0;k<v.length;k++){const N=v[k],S=_a(N);u.includes(S)||(j.splice(k,0,N),x.push(N))}a==="wait"&&x.length&&(j=x),g(Zp(j)),b(d);return}const{forceRender:w}=f.useContext(Lu);return r.jsx(r.Fragment,{children:v.map(j=>{const k=_a(j),N=o&&!l?!1:d===v||u.includes(k),S=()=>{if(m.has(k))m.set(k,!0);else return;let _=!0;m.forEach(A=>{A||(_=!1)}),_&&(w==null||w(),g(h.current),o&&(c==null||c()),s&&s())};return r.jsx(H2,{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)})})},xt=e=>e;let bx=xt;function Ou(e){let t;return()=>(t===void 0&&(t=e()),t)}const wr=(e,t,n)=>{const s=t-e;return s===0?1:(n-e)/s},yn=e=>e*1e3,vn=e=>e/1e3,G2={useManualTiming:!1};function K2(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(d){a.has(d)&&(c.schedule(d),e()),d(o)}const c={schedule:(d,u=!1,p=!1)=>{const m=p&&s?t:n;return u&&a.add(d),m.has(d)||m.add(d),d},cancel:d=>{n.delete(d),a.delete(d)},process:d=>{if(o=d,s){i=!0;return}s=!0,[t,n]=[n,t],t.forEach(l),t.clear(),s=!1,i&&(i=!1,c.process(d))}};return c}const Ea=["read","resolveKeyframes","update","preRender","render","postRender"],q2=40;function wx(e,t){let n=!1,s=!0;const i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=Ea.reduce((g,x)=>(g[x]=K2(a),g),{}),{read:l,resolveKeyframes:c,update:d,preRender:u,render:p,postRender:h}=o,m=()=>{const g=performance.now();n=!1,i.delta=s?1e3/60:Math.max(Math.min(g-i.timestamp,q2),1),i.timestamp=g,i.isProcessing=!0,l.process(i),c.process(i),d.process(i),u.process(i),p.process(i),h.process(i),i.isProcessing=!1,n&&t&&(s=!1,e(m))},y=()=>{n=!0,s=!0,i.isProcessing||e(m)};return{schedule:Ea.reduce((g,x)=>{const w=o[x];return g[x]=(j,k=!1,N=!1)=>(n||y(),w.schedule(j,k,N)),g},{}),cancel:g=>{for(let x=0;x<Ea.length;x++)o[Ea[x]].cancel(g)},state:i,steps:o}}const{schedule:ye,cancel:Jn,state:Ve,steps:Ul}=wx(typeof requestAnimationFrame<"u"?requestAnimationFrame:xt,!0),kx=f.createContext({strict:!1}),ef={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"]},kr={};for(const e in ef)kr[e]={isEnabled:t=>ef[e].some(n=>!!t[n])};function Y2(e){for(const t in e)kr[t]={...kr[t],...e[t]}}const X2=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 Eo(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||X2.has(e)}let jx=e=>!Eo(e);function Nx(e){e&&(jx=t=>t.startsWith("on")?!Eo(t):e(t))}try{Nx(require("@emotion/is-prop-valid").default)}catch{}function Q2(e,t,n){const s={};for(const i in e)i==="values"&&typeof e.values=="object"||(jx(i)||n===!0&&Eo(i)||!t&&!Eo(i)||e.draggable&&i.startsWith("onDrag"))&&(s[i]=e[i]);return s}function J2({children:e,isValidProp:t,...n}){t&&Nx(t),n={...f.useContext(Ii),...n},n.isStatic=Jo(()=>n.isStatic);const s=f.useMemo(()=>n,[JSON.stringify(n.transition),n.transformPagePoint,n.reducedMotion]);return r.jsx(Ii.Provider,{value:s,children:e})}function Z2(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 el=f.createContext({});function Bi(e){return typeof e=="string"||Array.isArray(e)}function tl(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}const Iu=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Bu=["initial",...Iu];function nl(e){return tl(e.animate)||Bu.some(t=>Bi(e[t]))}function Sx(e){return!!(nl(e)||e.variants)}function ek(e,t){if(nl(e)){const{initial:n,animate:s}=e;return{initial:n===!1||Bi(n)?n:void 0,animate:Bi(s)?s:void 0}}return e.inherit!==!1?t:{}}function tk(e){const{initial:t,animate:n}=ek(e,f.useContext(el));return f.useMemo(()=>({initial:t,animate:n}),[tf(t),tf(n)])}function tf(e){return Array.isArray(e)?e.join(" "):e}const nk=Symbol.for("motionComponentSymbol");function sr(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function sk(e,t,n){return f.useCallback(s=>{s&&e.onMount&&e.onMount(s),t&&(s?t.mount(s):t.unmount()),n&&(typeof n=="function"?n(s):sr(n)&&(n.current=s))},[t])}const Fu=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),rk="framerAppearId",Cx="data-"+Fu(rk),{schedule:Vu}=wx(queueMicrotask,!1),_x=f.createContext({});function ik(e,t,n,s,i){var a,o;const{visualElement:l}=f.useContext(el),c=f.useContext(kx),d=f.useContext(Zo),u=f.useContext(Ii).reducedMotion,p=f.useRef(null);s=s||c.renderer,!p.current&&s&&(p.current=s(e,{visualState:t,parent:l,props:n,presenceContext:d,blockInitialAnimation:d?d.initial===!1:!1,reducedMotionConfig:u}));const h=p.current,m=f.useContext(_x);h&&!h.projection&&i&&(h.type==="html"||h.type==="svg")&&ak(p.current,n,i,m);const y=f.useRef(!1);f.useInsertionEffect(()=>{h&&y.current&&h.update(n,d)});const b=n[Cx],v=f.useRef(!!b&&!(!((a=window.MotionHandoffIsComplete)===null||a===void 0)&&a.call(window,b))&&((o=window.MotionHasOptimisedAnimation)===null||o===void 0?void 0:o.call(window,b)));return vx(()=>{h&&(y.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),Vu.render(h.render),v.current&&h.animationState&&h.animationState.animateChanges())}),f.useEffect(()=>{h&&(!v.current&&h.animationState&&h.animationState.animateChanges(),v.current&&(queueMicrotask(()=>{var g;(g=window.MotionHandoffMarkAsComplete)===null||g===void 0||g.call(window,b)}),v.current=!1))}),h}function ak(e,t,n,s){const{layoutId:i,layout:a,drag:o,dragConstraints:l,layoutScroll:c,layoutRoot:d}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Ex(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||l&&sr(l),visualElement:e,animationType:typeof a=="string"?a:"both",initialPromotionConfig:s,layoutScroll:c,layoutRoot:d})}function Ex(e){if(e)return e.options.allowProjection!==!1?e.projection:Ex(e.parent)}function ok({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:s,Component:i}){var a,o;e&&Y2(e);function l(d,u){let p;const h={...f.useContext(Ii),...d,layoutId:lk(d)},{isStatic:m}=h,y=tk(d),b=s(d,m);if(!m&&Du){ck();const v=dk(h);p=v.MeasureLayout,y.visualElement=ik(i,b,h,t,v.ProjectionNode)}return r.jsxs(el.Provider,{value:y,children:[p&&y.visualElement?r.jsx(p,{visualElement:y.visualElement,...h}):null,n(i,d,sk(b,y.visualElement,u),b,m,y.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=f.forwardRef(l);return c[nk]=i,c}function lk({layoutId:e}){const t=f.useContext(Lu).id;return t&&e!==void 0?t+"-"+e:e}function ck(e,t){f.useContext(kx).strict}function dk(e){const{drag:t,layout:n}=kr;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 uk=["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 $u(e){return typeof e!="string"||e.includes("-")?!1:!!(uk.indexOf(e)>-1||/[A-Z]/u.test(e))}function nf(e){const t=[{},{}];return e==null||e.values.forEach((n,s)=>{t[0][s]=n.get(),t[1][s]=n.getVelocity()}),t}function Uu(e,t,n,s){if(typeof t=="function"){const[i,a]=nf(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]=nf(s);t=t(n!==void 0?n:e.custom,i,a)}return t}const ud=e=>Array.isArray(e),hk=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),pk=e=>ud(e)?e[e.length-1]||0:e,Ye=e=>!!(e&&e.getVelocity);function Ya(e){const t=Ye(e)?e.get():e;return hk(t)?t.toValue():t}function fk({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},s,i,a){const o={latestValues:mk(s,i,a,e),renderState:t()};return n&&(o.onMount=l=>n({props:s,current:l,...o}),o.onUpdate=l=>n(l)),o}const Tx=e=>(t,n)=>{const s=f.useContext(el),i=f.useContext(Zo),a=()=>fk(e,t,s,i);return n?a():Jo(a)};function mk(e,t,n,s){const i={},a=s(e,{});for(const h in a)i[h]=Ya(a[h]);let{initial:o,animate:l}=e;const c=nl(e),d=Sx(e);t&&d&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),l===void 0&&(l=t.animate));let u=n?n.initial===!1:!1;u=u||o===!1;const p=u?l:o;if(p&&typeof p!="boolean"&&!tl(p)){const h=Array.isArray(p)?p:[p];for(let m=0;m<h.length;m++){const y=Uu(e,h[m]);if(y){const{transitionEnd:b,transition:v,...g}=y;for(const x in g){let w=g[x];if(Array.isArray(w)){const j=u?w.length-1:0;w=w[j]}w!==null&&(i[x]=w)}for(const x in b)i[x]=b[x]}}}return i}const Ar=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],zs=new Set(Ar),Px=e=>t=>typeof t=="string"&&t.startsWith(e),Ax=Px("--"),gk=Px("var(--"),Hu=e=>gk(e)?xk.test(e.split("/*")[0].trim()):!1,xk=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Mx=(e,t)=>t&&typeof e=="number"?t.transform(e):e,Nn=(e,t,n)=>n>t?t:n<e?e:n,Mr={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Fi={...Mr,transform:e=>Nn(0,1,e)},Ta={...Mr,default:1},Ji=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Mn=Ji("deg"),sn=Ji("%"),Y=Ji("px"),yk=Ji("vh"),vk=Ji("vw"),sf={...sn,parse:e=>sn.parse(e)/100,transform:e=>sn.transform(e*100)},bk={borderWidth:Y,borderTopWidth:Y,borderRightWidth:Y,borderBottomWidth:Y,borderLeftWidth:Y,borderRadius:Y,radius:Y,borderTopLeftRadius:Y,borderTopRightRadius:Y,borderBottomRightRadius:Y,borderBottomLeftRadius:Y,width:Y,maxWidth:Y,height:Y,maxHeight:Y,top:Y,right:Y,bottom:Y,left:Y,padding:Y,paddingTop:Y,paddingRight:Y,paddingBottom:Y,paddingLeft:Y,margin:Y,marginTop:Y,marginRight:Y,marginBottom:Y,marginLeft:Y,backgroundPositionX:Y,backgroundPositionY:Y},wk={rotate:Mn,rotateX:Mn,rotateY:Mn,rotateZ:Mn,scale:Ta,scaleX:Ta,scaleY:Ta,scaleZ:Ta,skew:Mn,skewX:Mn,skewY:Mn,distance:Y,translateX:Y,translateY:Y,translateZ:Y,x:Y,y:Y,z:Y,perspective:Y,transformPerspective:Y,opacity:Fi,originX:sf,originY:sf,originZ:Y},rf={...Mr,transform:Math.round},Wu={...bk,...wk,zIndex:rf,size:Y,fillOpacity:Fi,strokeOpacity:Fi,numOctaves:rf},kk={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},jk=Ar.length;function Nk(e,t,n){let s="",i=!0;for(let a=0;a<jk;a++){const o=Ar[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 d=Mx(l,Wu[o]);if(!c){i=!1;const u=kk[o]||o;s+=`${u}(${d}) `}n&&(t[o]=d)}}return s=s.trim(),n?s=n(t,i?"":s):i&&(s="none"),s}function Gu(e,t,n){const{style:s,vars:i,transformOrigin:a}=e;let o=!1,l=!1;for(const c in t){const d=t[c];if(zs.has(c)){o=!0;continue}else if(Ax(c)){i[c]=d;continue}else{const u=Mx(d,Wu[c]);c.startsWith("origin")?(l=!0,a[c]=u):s[c]=u}}if(t.transform||(o||n?s.transform=Nk(t,e.transform,n):s.transform&&(s.transform="none")),l){const{originX:c="50%",originY:d="50%",originZ:u=0}=a;s.transformOrigin=`${c} ${d} ${u}`}}const Sk={offset:"stroke-dashoffset",array:"stroke-dasharray"},Ck={offset:"strokeDashoffset",array:"strokeDasharray"};function _k(e,t,n=1,s=0,i=!0){e.pathLength=1;const a=i?Sk:Ck;e[a.offset]=Y.transform(-s);const o=Y.transform(t),l=Y.transform(n);e[a.array]=`${o} ${l}`}function af(e,t,n){return typeof e=="string"?e:Y.transform(t+n*e)}function Ek(e,t,n){const s=af(t,e.x,e.width),i=af(n,e.y,e.height);return`${s} ${i}`}function Ku(e,{attrX:t,attrY:n,attrScale:s,originX:i,originY:a,pathLength:o,pathSpacing:l=1,pathOffset:c=0,...d},u,p){if(Gu(e,d,p),u){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:h,style:m,dimensions:y}=e;h.transform&&(y&&(m.transform=h.transform),delete h.transform),y&&(i!==void 0||a!==void 0||m.transform)&&(m.transformOrigin=Ek(y,i!==void 0?i:.5,a!==void 0?a:.5)),t!==void 0&&(h.x=t),n!==void 0&&(h.y=n),s!==void 0&&(h.scale=s),o!==void 0&&_k(h,o,l,c,!1)}const qu=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),zx=()=>({...qu(),attrs:{}}),Yu=e=>typeof e=="string"&&e.toLowerCase()==="svg";function Rx(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 Lx=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 Dx(e,t,n,s){Rx(e,t,void 0,s);for(const i in t.attrs)e.setAttribute(Lx.has(i)?i:Fu(i),t.attrs[i])}const To={};function Tk(e){Object.assign(To,e)}function Ox(e,{layout:t,layoutId:n}){return zs.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!To[e]||e==="opacity")}function Xu(e,t,n){var s;const{style:i}=e,a={};for(const o in i)(Ye(i[o])||t.style&&Ye(t.style[o])||Ox(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 Ix(e,t,n){const s=Xu(e,t,n);for(const i in e)if(Ye(e[i])||Ye(t[i])){const a=Ar.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;s[a]=e[i]}return s}function Pk(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 of=["x","y","width","height","cx","cy","r"],Ak={useVisualState:Tx({scrapeMotionValuesFromProps:Ix,createRenderState:zx,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(zs.has(l)){a=!0;break}}if(!a)return;let o=!t;if(t)for(let l=0;l<of.length;l++){const c=of[l];e[c]!==t[c]&&(o=!0)}o&&ye.read(()=>{Pk(n,s),ye.render(()=>{Ku(s,i,Yu(n.tagName),e.transformTemplate),Dx(n,s)})})}})},Mk={useVisualState:Tx({scrapeMotionValuesFromProps:Xu,createRenderState:qu})};function Bx(e,t,n){for(const s in t)!Ye(t[s])&&!Ox(s,n)&&(e[s]=t[s])}function zk({transformTemplate:e},t){return f.useMemo(()=>{const n=qu();return Gu(n,t,e),Object.assign({},n.vars,n.style)},[t])}function Rk(e,t){const n=e.style||{},s={};return Bx(s,n,e),Object.assign(s,zk(e,t)),s}function Lk(e,t){const n={},s=Rk(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 Dk(e,t,n,s){const i=f.useMemo(()=>{const a=zx();return Ku(a,t,Yu(s),e.transformTemplate),{...a.attrs,style:{...a.style}}},[t]);if(e.style){const a={};Bx(a,e.style,e),i.style={...a,...i.style}}return i}function Ok(e=!1){return(n,s,i,{latestValues:a},o)=>{const c=($u(n)?Dk:Lk)(s,a,o,n),d=Q2(s,typeof n=="string",e),u=n!==f.Fragment?{...d,...c,ref:i}:{},{children:p}=s,h=f.useMemo(()=>Ye(p)?p.get():p,[p]);return f.createElement(n,{...u,children:h})}}function Ik(e,t){return function(s,{forwardMotionProps:i}={forwardMotionProps:!1}){const o={...$u(s)?Ak:Mk,preloadedFeatures:e,useRender:Ok(i),createVisualElement:t,Component:s};return ok(o)}}function Fx(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 sl(e,t,n){const s=e.getProps();return Uu(s,t,n!==void 0?n:s.custom,e)}const Bk=Ou(()=>window.ScrollTimeline!==void 0);class Fk{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(Bk()&&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 Vk extends Fk{then(t,n){return Promise.all(this.animations).then(t).catch(n)}}function Qu(e,t){return e?e[t]||e.default||e:void 0}const hd=2e4;function Vx(e){let t=0;const n=50;let s=e.next(t);for(;!s.done&&t<hd;)t+=n,s=e.next(t);return t>=hd?1/0:t}function Ju(e){return typeof e=="function"}function lf(e,t){e.timeline=t,e.onfinish=null}const Zu=e=>Array.isArray(e)&&typeof e[0]=="number",$k={linearEasing:void 0};function Uk(e,t){const n=Ou(e);return()=>{var s;return(s=$k[t])!==null&&s!==void 0?s:n()}}const Po=Uk(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),$x=(e,t,n=10)=>{let s="";const i=Math.max(Math.round(t/n),2);for(let a=0;a<i;a++)s+=e(wr(0,i-1,a))+", ";return`linear(${s.substring(0,s.length-2)})`};function Ux(e){return!!(typeof e=="function"&&Po()||!e||typeof e=="string"&&(e in pd||Po())||Zu(e)||Array.isArray(e)&&e.every(Ux))}const Jr=([e,t,n,s])=>`cubic-bezier(${e}, ${t}, ${n}, ${s})`,pd={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Jr([0,.65,.55,1]),circOut:Jr([.55,0,1,.45]),backIn:Jr([.31,.01,.66,-.59]),backOut:Jr([.33,1.53,.69,.99])};function Hx(e,t){if(e)return typeof e=="function"&&Po()?$x(e,t):Zu(e)?Jr(e):Array.isArray(e)?e.map(n=>Hx(n,t)||pd.easeOut):pd[e]}const Bt={x:!1,y:!1};function Wx(){return Bt.x||Bt.y}function Hk(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 Gx(e,t){const n=Hk(e),s=new AbortController,i={passive:!0,...t,signal:s.signal};return[n,i,()=>s.abort()]}function cf(e){return t=>{t.pointerType==="touch"||Wx()||e(t)}}function Wk(e,t,n={}){const[s,i,a]=Gx(e,n),o=cf(l=>{const{target:c}=l,d=t(l);if(typeof d!="function"||!c)return;const u=cf(p=>{d(p),c.removeEventListener("pointerleave",u)});c.addEventListener("pointerleave",u,i)});return s.forEach(l=>{l.addEventListener("pointerenter",o,i)}),a}const Kx=(e,t)=>t?e===t?!0:Kx(e,t.parentElement):!1,eh=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,Gk=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Kk(e){return Gk.has(e.tagName)||e.tabIndex!==-1}const Zr=new WeakSet;function df(e){return t=>{t.key==="Enter"&&e(t)}}function Hl(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const qk=(e,t)=>{const n=e.currentTarget;if(!n)return;const s=df(()=>{if(Zr.has(n))return;Hl(n,"down");const i=df(()=>{Hl(n,"up")}),a=()=>Hl(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 uf(e){return eh(e)&&!Wx()}function Yk(e,t,n={}){const[s,i,a]=Gx(e,n),o=l=>{const c=l.currentTarget;if(!uf(l)||Zr.has(c))return;Zr.add(c);const d=t(l),u=(m,y)=>{window.removeEventListener("pointerup",p),window.removeEventListener("pointercancel",h),!(!uf(m)||!Zr.has(c))&&(Zr.delete(c),typeof d=="function"&&d(m,{success:y}))},p=m=>{u(m,n.useGlobalTarget||Kx(c,m.target))},h=m=>{u(m,!1)};window.addEventListener("pointerup",p,i),window.addEventListener("pointercancel",h,i)};return s.forEach(l=>{!Kk(l)&&l.getAttribute("tabindex")===null&&(l.tabIndex=0),(n.useGlobalTarget?window:l).addEventListener("pointerdown",o,i),l.addEventListener("focus",d=>qk(d,i),i)}),a}function Xk(e){return e==="x"||e==="y"?Bt[e]?null:(Bt[e]=!0,()=>{Bt[e]=!1}):Bt.x||Bt.y?null:(Bt.x=Bt.y=!0,()=>{Bt.x=Bt.y=!1})}const qx=new Set(["width","height","top","left","right","bottom",...Ar]);let Xa;function Qk(){Xa=void 0}const rn={now:()=>(Xa===void 0&&rn.set(Ve.isProcessing||G2.useManualTiming?Ve.timestamp:performance.now()),Xa),set:e=>{Xa=e,queueMicrotask(Qk)}};function th(e,t){e.indexOf(t)===-1&&e.push(t)}function nh(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class sh{constructor(){this.subscriptions=[]}add(t){return th(this.subscriptions,t),()=>nh(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 Yx(e,t){return t?e*(1e3/t):0}const hf=30,Jk=e=>!isNaN(parseFloat(e));class Zk{constructor(t,n={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(s,i=!0)=>{const a=rn.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=rn.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=Jk(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 sh);const s=this.events[t].add(n);return t==="change"?()=>{s(),ye.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=rn.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>hf)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,hf);return Yx(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 Vi(e,t){return new Zk(e,t)}function e5(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Vi(n))}function t5(e,t){const n=sl(e,t);let{transitionEnd:s={},transition:i={},...a}=n||{};a={...a,...s};for(const o in a){const l=pk(a[o]);e5(e,o,l)}}function n5(e){return!!(Ye(e)&&e.add)}function fd(e,t){const n=e.getValue("willChange");if(n5(n))return n.add(t)}function Xx(e){return e.props[Cx]}const Qx=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,s5=1e-7,r5=12;function i5(e,t,n,s,i){let a,o,l=0;do o=t+(n-t)/2,a=Qx(o,s,i)-e,a>0?n=o:t=o;while(Math.abs(a)>s5&&++l<r5);return o}function Zi(e,t,n,s){if(e===t&&n===s)return xt;const i=a=>i5(a,0,1,e,n);return a=>a===0||a===1?a:Qx(i(a),t,s)}const Jx=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Zx=e=>t=>1-e(1-t),ey=Zi(.33,1.53,.69,.99),rh=Zx(ey),ty=Jx(rh),ny=e=>(e*=2)<1?.5*rh(e):.5*(2-Math.pow(2,-10*(e-1))),ih=e=>1-Math.sin(Math.acos(e)),sy=Zx(ih),ry=Jx(ih),iy=e=>/^0[^.\s]+$/u.test(e);function a5(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||iy(e):!0}const pi=e=>Math.round(e*1e5)/1e5,ah=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function o5(e){return e==null}const l5=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,oh=(e,t)=>n=>!!(typeof n=="string"&&l5.test(n)&&n.startsWith(e)||t&&!o5(n)&&Object.prototype.hasOwnProperty.call(n,t)),ay=(e,t,n)=>s=>{if(typeof s!="string")return s;const[i,a,o,l]=s.match(ah);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:l!==void 0?parseFloat(l):1}},c5=e=>Nn(0,255,e),Wl={...Mr,transform:e=>Math.round(c5(e))},bs={test:oh("rgb","red"),parse:ay("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:s=1})=>"rgba("+Wl.transform(e)+", "+Wl.transform(t)+", "+Wl.transform(n)+", "+pi(Fi.transform(s))+")"};function d5(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 md={test:oh("#"),parse:d5,transform:bs.transform},rr={test:oh("hsl","hue"),parse:ay("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:s=1})=>"hsla("+Math.round(e)+", "+sn.transform(pi(t))+", "+sn.transform(pi(n))+", "+pi(Fi.transform(s))+")"},Ge={test:e=>bs.test(e)||md.test(e)||rr.test(e),parse:e=>bs.test(e)?bs.parse(e):rr.test(e)?rr.parse(e):md.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?bs.transform(e):rr.transform(e)},u5=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function h5(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(ah))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(u5))===null||n===void 0?void 0:n.length)||0)>0}const oy="number",ly="color",p5="var",f5="var(",pf="${}",m5=/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 $i(e){const t=e.toString(),n=[],s={color:[],number:[],var:[]},i=[];let a=0;const l=t.replace(m5,c=>(Ge.test(c)?(s.color.push(a),i.push(ly),n.push(Ge.parse(c))):c.startsWith(f5)?(s.var.push(a),i.push(p5),n.push(c)):(s.number.push(a),i.push(oy),n.push(parseFloat(c))),++a,pf)).split(pf);return{values:n,split:l,indexes:s,types:i}}function cy(e){return $i(e).values}function dy(e){const{split:t,types:n}=$i(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===oy?a+=pi(i[o]):l===ly?a+=Ge.transform(i[o]):a+=i[o]}return a}}const g5=e=>typeof e=="number"?0:e;function x5(e){const t=cy(e);return dy(e)(t.map(g5))}const Zn={test:h5,parse:cy,createTransformer:dy,getAnimatableNone:x5},y5=new Set(["brightness","contrast","saturate","opacity"]);function v5(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[s]=n.match(ah)||[];if(!s)return e;const i=n.replace(s,"");let a=y5.has(t)?1:0;return s!==n&&(a*=100),t+"("+a+i+")"}const b5=/\b([a-z-]*)\(.*?\)/gu,gd={...Zn,getAnimatableNone:e=>{const t=e.match(b5);return t?t.map(v5).join(" "):e}},w5={...Wu,color:Ge,backgroundColor:Ge,outlineColor:Ge,fill:Ge,stroke:Ge,borderColor:Ge,borderTopColor:Ge,borderRightColor:Ge,borderBottomColor:Ge,borderLeftColor:Ge,filter:gd,WebkitFilter:gd},lh=e=>w5[e];function uy(e,t){let n=lh(e);return n!==gd&&(n=Zn),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const k5=new Set(["auto","none","0"]);function j5(e,t,n){let s=0,i;for(;s<e.length&&!i;){const a=e[s];typeof a=="string"&&!k5.has(a)&&$i(a).values.length&&(i=e[s]),s++}if(i&&n)for(const a of t)e[a]=uy(n,i)}const ff=e=>e===Mr||e===Y,mf=(e,t)=>parseFloat(e.split(", ")[t]),gf=(e,t)=>(n,{transform:s})=>{if(s==="none"||!s)return 0;const i=s.match(/^matrix3d\((.+)\)$/u);if(i)return mf(i[1],t);{const a=s.match(/^matrix\((.+)\)$/u);return a?mf(a[1],e):0}},N5=new Set(["x","y","z"]),S5=Ar.filter(e=>!N5.has(e));function C5(e){const t=[];return S5.forEach(n=>{const s=e.getValue(n);s!==void 0&&(t.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),t}const jr={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:gf(4,13),y:gf(5,14)};jr.translateX=jr.x;jr.translateY=jr.y;const js=new Set;let xd=!1,yd=!1;function hy(){if(yd){const e=Array.from(js).filter(s=>s.needsMeasurement),t=new Set(e.map(s=>s.element)),n=new Map;t.forEach(s=>{const i=C5(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)})}yd=!1,xd=!1,js.forEach(e=>e.complete()),js.clear()}function py(){js.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(yd=!0)})}function _5(){py(),hy()}class ch{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?(js.add(this),xd||(xd=!0,ye.read(py),ye.resolveKeyframes(hy))):(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),js.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,js.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const fy=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),E5=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function T5(e){const t=E5.exec(e);if(!t)return[,];const[,n,s,i]=t;return[`--${n??s}`,i]}function my(e,t,n=1){const[s,i]=T5(e);if(!s)return;const a=window.getComputedStyle(t).getPropertyValue(s);if(a){const o=a.trim();return fy(o)?parseFloat(o):o}return Hu(i)?my(i,t,n+1):i}const gy=e=>t=>t.test(e),P5={test:e=>e==="auto",parse:e=>e},xy=[Mr,Y,sn,Mn,vk,yk,P5],xf=e=>xy.find(gy(e));class yy extends ch{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 d=t[c];if(typeof d=="string"&&(d=d.trim(),Hu(d))){const u=my(d,n.current);u!==void 0&&(t[c]=u),c===t.length-1&&(this.finalKeyframe=d)}}if(this.resolveNoneKeyframes(),!qx.has(s)||t.length!==2)return;const[i,a]=t,o=xf(i),l=xf(a);if(o!==l)if(ff(o)&&ff(l))for(let c=0;c<t.length;c++){const d=t[c];typeof d=="string"&&(t[c]=parseFloat(d))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,s=[];for(let i=0;i<t.length;i++)a5(t[i])&&s.push(i);s.length&&j5(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=jr[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]=jr[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,d])=>{n.getValue(c).set(d)}),this.resolveNoneKeyframes()}}const yf=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Zn.test(e)||e==="0")&&!e.startsWith("url("));function A5(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 M5(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=yf(i,t),l=yf(a,t);return!o||!l?!1:A5(e)||(n==="spring"||Ju(n))&&s}const z5=e=>e!==null;function rl(e,{repeat:t,repeatType:n="loop"},s){const i=e.filter(z5),a=t&&n!=="loop"&&t%2===1?0:i.length-1;return!a||s===void 0?i[a]:s}const R5=40;class vy{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=rn.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>R5?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&_5(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=rn.now(),this.hasAttemptedResolve=!0;const{name:s,type:i,velocity:a,delay:o,onComplete:l,onUpdate:c,isGenerator:d}=this.options;if(!d&&!M5(t,s,i,a))if(o)this.options.duration=0;else{c&&c(rl(t,this.options,n)),l&&l(),this.resolveFinishedPromise();return}const u=this.initPlayback(t,n);u!==!1&&(this._resolved={keyframes:t,finalKeyframe:n,...u},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 Gl(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 L5({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=Gl(c,l,e+1/3),a=Gl(c,l,e),o=Gl(c,l,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:s}}function Ao(e,t){return n=>n>0?t:e}const Kl=(e,t,n)=>{const s=e*e,i=n*(t*t-s)+s;return i<0?0:Math.sqrt(i)},D5=[md,bs,rr],O5=e=>D5.find(t=>t.test(e));function vf(e){const t=O5(e);if(!t)return!1;let n=t.parse(e);return t===rr&&(n=L5(n)),n}const bf=(e,t)=>{const n=vf(e),s=vf(t);if(!n||!s)return Ao(e,t);const i={...n};return a=>(i.red=Kl(n.red,s.red,a),i.green=Kl(n.green,s.green,a),i.blue=Kl(n.blue,s.blue,a),i.alpha=je(n.alpha,s.alpha,a),bs.transform(i))},I5=(e,t)=>n=>t(e(n)),ea=(...e)=>e.reduce(I5),vd=new Set(["none","hidden"]);function B5(e,t){return vd.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function F5(e,t){return n=>je(e,t,n)}function dh(e){return typeof e=="number"?F5:typeof e=="string"?Hu(e)?Ao:Ge.test(e)?bf:U5:Array.isArray(e)?by:typeof e=="object"?Ge.test(e)?bf:V5:Ao}function by(e,t){const n=[...e],s=n.length,i=e.map((a,o)=>dh(a)(a,t[o]));return a=>{for(let o=0;o<s;o++)n[o]=i[o](a);return n}}function V5(e,t){const n={...e,...t},s={};for(const i in n)e[i]!==void 0&&t[i]!==void 0&&(s[i]=dh(e[i])(e[i],t[i]));return i=>{for(const a in s)n[a]=s[a](i);return n}}function $5(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 U5=(e,t)=>{const n=Zn.createTransformer(t),s=$i(e),i=$i(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?vd.has(e)&&!i.values.length||vd.has(t)&&!s.values.length?B5(e,t):ea(by($5(s,i),i.values),n):Ao(e,t)};function wy(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?je(e,t,n):dh(e)(e,t)}const H5=5;function ky(e,t,n){const s=Math.max(t-H5,0);return Yx(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},ql=.001;function W5({duration:e=Ce.duration,bounce:t=Ce.bounce,velocity:n=Ce.velocity,mass:s=Ce.mass}){let i,a,o=1-t;o=Nn(Ce.minDamping,Ce.maxDamping,o),e=Nn(Ce.minDuration,Ce.maxDuration,vn(e)),o<1?(i=d=>{const u=d*o,p=u*e,h=u-n,m=bd(d,o),y=Math.exp(-p);return ql-h/m*y},a=d=>{const p=d*o*e,h=p*n+n,m=Math.pow(o,2)*Math.pow(d,2)*e,y=Math.exp(-p),b=bd(Math.pow(d,2),o);return(-i(d)+ql>0?-1:1)*((h-m)*y)/b}):(i=d=>{const u=Math.exp(-d*e),p=(d-n)*e+1;return-ql+u*p},a=d=>{const u=Math.exp(-d*e),p=(n-d)*(e*e);return u*p});const l=5/e,c=K5(i,a,l);if(e=yn(e),isNaN(c))return{stiffness:Ce.stiffness,damping:Ce.damping,duration:e};{const d=Math.pow(c,2)*s;return{stiffness:d,damping:o*2*Math.sqrt(s*d),duration:e}}}const G5=12;function K5(e,t,n){let s=n;for(let i=1;i<G5;i++)s=s-e(s)/t(s);return s}function bd(e,t){return e*Math.sqrt(1-t*t)}const q5=["duration","bounce"],Y5=["stiffness","damping","mass"];function wf(e,t){return t.some(n=>e[n]!==void 0)}function X5(e){let t={velocity:Ce.velocity,stiffness:Ce.stiffness,damping:Ce.damping,mass:Ce.mass,isResolvedFromDuration:!1,...e};if(!wf(e,Y5)&&wf(e,q5))if(e.visualDuration){const n=e.visualDuration,s=2*Math.PI/(n*1.2),i=s*s,a=2*Nn(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:Ce.mass,stiffness:i,damping:a}}else{const n=W5(e);t={...t,...n,mass:Ce.mass},t.isResolvedFromDuration=!0}return t}function jy(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:d,mass:u,duration:p,velocity:h,isResolvedFromDuration:m}=X5({...n,velocity:-vn(n.velocity||0)}),y=h||0,b=d/(2*Math.sqrt(c*u)),v=o-a,g=vn(Math.sqrt(c/u)),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(b<1){const k=bd(g,b);w=N=>{const S=Math.exp(-b*g*N);return o-S*((y+b*g*v)/k*Math.sin(k*N)+v*Math.cos(k*N))}}else if(b===1)w=k=>o-Math.exp(-g*k)*(v+(y+g*v)*k);else{const k=g*Math.sqrt(b*b-1);w=N=>{const S=Math.exp(-b*g*N),_=Math.min(k*N,300);return o-S*((y+b*g*v)*Math.sinh(_)+k*v*Math.cosh(_))/k}}const j={calculatedDuration:m&&p||null,next:k=>{const N=w(k);if(m)l.done=k>=p;else{let S=0;b<1&&(S=k===0?yn(y):ky(w,k,N));const _=Math.abs(S)<=s,A=Math.abs(o-N)<=i;l.done=_&&A}return l.value=l.done?o:N,l},toString:()=>{const k=Math.min(Vx(j),hd),N=$x(S=>j.next(k*S).value,k,30);return k+"ms "+N}};return j}function kf({keyframes:e,velocity:t=0,power:n=.8,timeConstant:s=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:l,max:c,restDelta:d=.5,restSpeed:u}){const p=e[0],h={done:!1,value:p},m=_=>l!==void 0&&_<l||c!==void 0&&_>c,y=_=>l===void 0?c:c===void 0||Math.abs(l-_)<Math.abs(c-_)?l:c;let b=n*t;const v=p+b,g=o===void 0?v:o(v);g!==v&&(b=g-p);const x=_=>-b*Math.exp(-_/s),w=_=>g+x(_),j=_=>{const A=x(_),P=w(_);h.done=Math.abs(A)<=d,h.value=h.done?g:P};let k,N;const S=_=>{m(h.value)&&(k=_,N=jy({keyframes:[h.value,y(h.value)],velocity:ky(w,_,h.value),damping:i,stiffness:a,restDelta:d,restSpeed:u}))};return S(0),{calculatedDuration:null,next:_=>{let A=!1;return!N&&k===void 0&&(A=!0,j(_),S(_)),k!==void 0&&_>=k?N.next(_-k):(!A&&j(_),h)}}}const Q5=Zi(.42,0,1,1),J5=Zi(0,0,.58,1),Ny=Zi(.42,0,.58,1),Z5=e=>Array.isArray(e)&&typeof e[0]!="number",ej={linear:xt,easeIn:Q5,easeInOut:Ny,easeOut:J5,circIn:ih,circInOut:ry,circOut:sy,backIn:rh,backInOut:ty,backOut:ey,anticipate:ny},jf=e=>{if(Zu(e)){bx(e.length===4);const[t,n,s,i]=e;return Zi(t,n,s,i)}else if(typeof e=="string")return ej[e];return e};function tj(e,t,n){const s=[],i=n||wy,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]||xt:t;l=ea(c,l)}s.push(l)}return s}function nj(e,t,{clamp:n=!0,ease:s,mixer:i}={}){const a=e.length;if(bx(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=tj(t,s,i),c=l.length,d=u=>{if(o&&u<e[0])return t[0];let p=0;if(c>1)for(;p<e.length-2&&!(u<e[p+1]);p++);const h=wr(e[p],e[p+1],u);return l[p](h)};return n?u=>d(Nn(e[0],e[a-1],u)):d}function sj(e,t){const n=e[e.length-1];for(let s=1;s<=t;s++){const i=wr(0,t,s);e.push(je(n,1,i))}}function rj(e){const t=[0];return sj(t,e.length-1),t}function ij(e,t){return e.map(n=>n*t)}function aj(e,t){return e.map(()=>t||Ny).splice(0,e.length-1)}function Mo({duration:e=300,keyframes:t,times:n,ease:s="easeInOut"}){const i=Z5(s)?s.map(jf):jf(s),a={done:!1,value:t[0]},o=ij(n&&n.length===t.length?n:rj(t),e),l=nj(o,t,{ease:Array.isArray(i)?i:aj(t,i)});return{calculatedDuration:e,next:c=>(a.value=l(c),a.done=c>=e,a)}}const oj=e=>{const t=({timestamp:n})=>e(n);return{start:()=>ye.update(t,!0),stop:()=>Jn(t),now:()=>Ve.isProcessing?Ve.timestamp:rn.now()}},lj={decay:kf,inertia:kf,tween:Mo,keyframes:Mo,spring:jy},cj=e=>e/100;class uh extends vy{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)||ch,l=(c,d)=>this.onKeyframesResolved(c,d);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=Ju(n)?n:lj[n]||Mo;let c,d;l!==Mo&&typeof t[0]!="number"&&(c=ea(cj,wy(t[0],t[1])),t=[0,100]);const u=l({...this.options,keyframes:t});a==="mirror"&&(d=l({...this.options,keyframes:[...t].reverse(),velocity:-o})),u.calculatedDuration===null&&(u.calculatedDuration=Vx(u));const{calculatedDuration:p}=u,h=p+i,m=h*(s+1)-i;return{generator:u,mirroredGenerator:d,mapPercentToKeyframes:c,calculatedDuration:p,resolvedDuration:h,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:_}=this.options;return{done:!0,value:_[_.length-1]}}const{finalKeyframe:i,generator:a,mirroredGenerator:o,mapPercentToKeyframes:l,keyframes:c,calculatedDuration:d,totalDuration:u,resolvedDuration:p}=s;if(this.startTime===null)return a.next(0);const{delay:h,repeat:m,repeatType:y,repeatDelay:b,onUpdate:v}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-u/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-h*(this.speed>=0?1:-1),x=this.speed>=0?g<0:g>u;this.currentTime=Math.max(g,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=u);let w=this.currentTime,j=a;if(m){const _=Math.min(this.currentTime,u)/p;let A=Math.floor(_),P=_%1;!P&&_>=1&&(P=1),P===1&&A--,A=Math.min(A,m+1),!!(A%2)&&(y==="reverse"?(P=1-P,b&&(P-=b/p)):y==="mirror"&&(j=o)),w=Nn(0,1,P)*p}const k=x?{done:!1,value:c[0]}:j.next(w);l&&(k.value=l(k.value));let{done:N}=k;!x&&d!==null&&(N=this.speed>=0?this.currentTime>=u:this.currentTime<=0);const S=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&N);return S&&i!==void 0&&(k.value=rl(c,this.options,i)),v&&v(k.value),S&&this.finish(),k}get duration(){const{resolved:t}=this;return t?vn(t.calculatedDuration):0}get time(){return vn(this.currentTime)}set time(t){t=yn(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=vn(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=oj,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 dj=new Set(["opacity","clipPath","filter","transform"]);function uj(e,t,n,{delay:s=0,duration:i=300,repeat:a=0,repeatType:o="loop",ease:l="easeInOut",times:c}={}){const d={[t]:n};c&&(d.offset=c);const u=Hx(l,i);return Array.isArray(u)&&(d.easing=u),e.animate(d,{delay:s,duration:i,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:a+1,direction:o==="reverse"?"alternate":"normal"})}const hj=Ou(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),zo=10,pj=2e4;function fj(e){return Ju(e.type)||e.type==="spring"||!Ux(e.ease)}function mj(e,t){const n=new uh({...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<pj;)s=n.sample(a),i.push(s.value),a+=zo;return{times:void 0,keyframes:i,duration:a-zo,ease:"linear"}}const Sy={anticipate:ny,backInOut:ty,circInOut:ry};function gj(e){return e in Sy}class Nf extends vy{constructor(t){super(t);const{name:n,motionValue:s,element:i,keyframes:a}=this.options;this.resolver=new yy(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:d}=this.options;if(!l.owner||!l.owner.current)return!1;if(typeof a=="string"&&Po()&&gj(a)&&(a=Sy[a]),fj(this.options)){const{onComplete:p,onUpdate:h,motionValue:m,element:y,...b}=this.options,v=mj(t,b);t=v.keyframes,t.length===1&&(t[1]=t[0]),s=v.duration,i=v.times,a=v.ease,o="keyframes"}const u=uj(l.owner.current,c,t,{...this.options,duration:s,times:i,ease:a});return u.startTime=d??this.calcStartTime(),this.pendingTimeline?(lf(u,this.pendingTimeline),this.pendingTimeline=void 0):u.onfinish=()=>{const{onComplete:p}=this.options;l.set(rl(t,this.options,n)),p&&p(),this.cancel(),this.resolveFinishedPromise()},{animation:u,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 vn(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return vn(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:s}=n;s.currentTime=yn(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 xt;const{animation:s}=n;lf(s,t)}return xt}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:d,onUpdate:u,onComplete:p,element:h,...m}=this.options,y=new uh({...m,keyframes:s,duration:i,type:a,ease:o,times:l,isGenerator:!0}),b=yn(this.time);d.setWithVelocity(y.sample(b-zo).value,y.sample(b).value,zo)}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:d}=n.owner.getProps();return hj()&&s&&dj.has(s)&&!c&&!d&&!i&&a!=="mirror"&&o!==0&&l!=="inertia"}}const xj={type:"spring",stiffness:500,damping:25,restSpeed:10},yj=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),vj={type:"keyframes",duration:.8},bj={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},wj=(e,{keyframes:t})=>t.length>2?vj:zs.has(e)?e.startsWith("scale")?yj(t[1]):xj:bj;function kj({when:e,delay:t,delayChildren:n,staggerChildren:s,staggerDirection:i,repeat:a,repeatType:o,repeatDelay:l,from:c,elapsed:d,...u}){return!!Object.keys(u).length}const hh=(e,t,n,s={},i,a)=>o=>{const l=Qu(s,e)||{},c=l.delay||s.delay||0;let{elapsed:d=0}=s;d=d-yn(c);let u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...l,delay:-d,onUpdate:h=>{t.set(h),l.onUpdate&&l.onUpdate(h)},onComplete:()=>{o(),l.onComplete&&l.onComplete()},name:e,motionValue:t,element:a?void 0:i};kj(l)||(u={...u,...wj(e,u)}),u.duration&&(u.duration=yn(u.duration)),u.repeatDelay&&(u.repeatDelay=yn(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let p=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(u.duration=0,u.delay===0&&(p=!0)),p&&!a&&t.get()!==void 0){const h=rl(u.keyframes,l);if(h!==void 0)return ye.update(()=>{u.onUpdate(h),u.onComplete()}),new Vk([])}return!a&&Nf.supports(u)?new Nf(u):new uh(u)};function jj({protectedKeys:e,needsAnimating:t},n){const s=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,s}function Cy(e,t,{delay:n=0,transitionOverride:s,type:i}={}){var a;let{transition:o=e.getDefaultTransition(),transitionEnd:l,...c}=t;s&&(o=s);const d=[],u=i&&e.animationState&&e.animationState.getState()[i];for(const p in c){const h=e.getValue(p,(a=e.latestValues[p])!==null&&a!==void 0?a:null),m=c[p];if(m===void 0||u&&jj(u,p))continue;const y={delay:n,...Qu(o||{},p)};let b=!1;if(window.MotionHandoffAnimation){const g=Xx(e);if(g){const x=window.MotionHandoffAnimation(g,p,ye);x!==null&&(y.startTime=x,b=!0)}}fd(e,p),h.start(hh(p,h,m,e.shouldReduceMotion&&qx.has(p)?{type:!1}:y,e,b));const v=h.animation;v&&d.push(v)}return l&&Promise.all(d).then(()=>{ye.update(()=>{l&&t5(e,l)})}),d}function wd(e,t,n={}){var s;const i=sl(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(Cy(e,i,n)):()=>Promise.resolve(),l=e.variantChildren&&e.variantChildren.size?(d=0)=>{const{delayChildren:u=0,staggerChildren:p,staggerDirection:h}=a;return Nj(e,t,u+d,p,h,n)}:()=>Promise.resolve(),{when:c}=a;if(c){const[d,u]=c==="beforeChildren"?[o,l]:[l,o];return d().then(()=>u())}else return Promise.all([o(),l(n.delay)])}function Nj(e,t,n=0,s=0,i=1,a){const o=[],l=(e.variantChildren.size-1)*s,c=i===1?(d=0)=>d*s:(d=0)=>l-d*s;return Array.from(e.variantChildren).sort(Sj).forEach((d,u)=>{d.notify("AnimationStart",t),o.push(wd(d,t,{...a,delay:n+c(u)}).then(()=>d.notify("AnimationComplete",t)))}),Promise.all(o)}function Sj(e,t){return e.sortNodePosition(t)}function Cj(e,t,n={}){e.notify("AnimationStart",t);let s;if(Array.isArray(t)){const i=t.map(a=>wd(e,a,n));s=Promise.all(i)}else if(typeof t=="string")s=wd(e,t,n);else{const i=typeof t=="function"?sl(e,t,n.custom):t;s=Promise.all(Cy(e,i,n))}return s.then(()=>{e.notify("AnimationComplete",t)})}const _j=Bu.length;function _y(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?_y(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<_j;n++){const s=Bu[n],i=e.props[s];(Bi(i)||i===!1)&&(t[s]=i)}return t}const Ej=[...Iu].reverse(),Tj=Iu.length;function Pj(e){return t=>Promise.all(t.map(({animation:n,options:s})=>Cj(e,n,s)))}function Aj(e){let t=Pj(e),n=Sf(),s=!0;const i=c=>(d,u)=>{var p;const h=sl(e,u,c==="exit"?(p=e.presenceContext)===null||p===void 0?void 0:p.custom:void 0);if(h){const{transition:m,transitionEnd:y,...b}=h;d={...d,...b,...y}}return d};function a(c){t=c(e)}function o(c){const{props:d}=e,u=_y(e.parent)||{},p=[],h=new Set;let m={},y=1/0;for(let v=0;v<Tj;v++){const g=Ej[v],x=n[g],w=d[g]!==void 0?d[g]:u[g],j=Bi(w),k=g===c?x.isActive:null;k===!1&&(y=v);let N=w===u[g]&&w!==d[g]&&j;if(N&&s&&e.manuallyAnimateOnMount&&(N=!1),x.protectedKeys={...m},!x.isActive&&k===null||!w&&!x.prevProp||tl(w)||typeof w=="boolean")continue;const S=Mj(x.prevProp,w);let _=S||g===c&&x.isActive&&!N&&j||v>y&&j,A=!1;const P=Array.isArray(w)?w:[w];let T=P.reduce(i(g),{});k===!1&&(T={});const{prevResolvedValues:V={}}=x,M={...V,...T},I=B=>{_=!0,h.has(B)&&(A=!0,h.delete(B)),x.needsAnimating[B]=!0;const C=e.getValue(B);C&&(C.liveStyle=!1)};for(const B in M){const C=T[B],E=V[B];if(m.hasOwnProperty(B))continue;let L=!1;ud(C)&&ud(E)?L=!Fx(C,E):L=C!==E,L?C!=null?I(B):h.add(B):C!==void 0&&h.has(B)?I(B):x.protectedKeys[B]=!0}x.prevProp=w,x.prevResolvedValues=T,x.isActive&&(m={...m,...T}),s&&e.blockInitialAnimation&&(_=!1),_&&(!(N&&S)||A)&&p.push(...P.map(B=>({animation:B,options:{type:g}})))}if(h.size){const v={};h.forEach(g=>{const x=e.getBaseTarget(g),w=e.getValue(g);w&&(w.liveStyle=!0),v[g]=x??null}),p.push({animation:v})}let b=!!p.length;return s&&(d.initial===!1||d.initial===d.animate)&&!e.manuallyAnimateOnMount&&(b=!1),s=!1,b?t(p):Promise.resolve()}function l(c,d){var u;if(n[c].isActive===d)return Promise.resolve();(u=e.variantChildren)===null||u===void 0||u.forEach(h=>{var m;return(m=h.animationState)===null||m===void 0?void 0:m.setActive(c,d)}),n[c].isActive=d;const p=o(c);for(const h in n)n[h].protectedKeys={};return p}return{animateChanges:o,setActive:l,setAnimateFunction:a,getState:()=>n,reset:()=>{n=Sf(),s=!0}}}function Mj(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Fx(t,e):!1}function ds(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Sf(){return{animate:ds(!0),whileInView:ds(),whileHover:ds(),whileTap:ds(),whileDrag:ds(),whileFocus:ds(),exit:ds()}}class as{constructor(t){this.isMounted=!1,this.node=t}update(){}}class zj extends as{constructor(t){super(t),t.animationState||(t.animationState=Aj(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();tl(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 Rj=0;class Lj extends as{constructor(){super(...arguments),this.id=Rj++}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 Dj={animation:{Feature:zj},exit:{Feature:Lj}};function Ui(e,t,n,s={passive:!0}){return e.addEventListener(t,n,s),()=>e.removeEventListener(t,n)}function ta(e){return{point:{x:e.pageX,y:e.pageY}}}const Oj=e=>t=>eh(t)&&e(t,ta(t));function fi(e,t,n,s){return Ui(e,t,Oj(n),s)}const Cf=(e,t)=>Math.abs(e-t);function Ij(e,t){const n=Cf(e.x,t.x),s=Cf(e.y,t.y);return Math.sqrt(n**2+s**2)}class Ey{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=Xl(this.lastMoveEventInfo,this.history),h=this.startEvent!==null,m=Ij(p.offset,{x:0,y:0})>=3;if(!h&&!m)return;const{point:y}=p,{timestamp:b}=Ve;this.history.push({...y,timestamp:b});const{onStart:v,onMove:g}=this.handlers;h||(v&&v(this.lastMoveEvent,p),this.startEvent=this.lastMoveEvent),g&&g(this.lastMoveEvent,p)},this.handlePointerMove=(p,h)=>{this.lastMoveEvent=p,this.lastMoveEventInfo=Yl(h,this.transformPagePoint),ye.update(this.updatePoint,!0)},this.handlePointerUp=(p,h)=>{this.end();const{onEnd:m,onSessionEnd:y,resumeAnimation:b}=this.handlers;if(this.dragSnapToOrigin&&b&&b(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const v=Xl(p.type==="pointercancel"?this.lastMoveEventInfo:Yl(h,this.transformPagePoint),this.history);this.startEvent&&m&&m(p,v),y&&y(p,v)},!eh(t))return;this.dragSnapToOrigin=a,this.handlers=n,this.transformPagePoint=s,this.contextWindow=i||window;const o=ta(t),l=Yl(o,this.transformPagePoint),{point:c}=l,{timestamp:d}=Ve;this.history=[{...c,timestamp:d}];const{onSessionStart:u}=n;u&&u(t,Xl(l,this.history)),this.removeListeners=ea(fi(this.contextWindow,"pointermove",this.handlePointerMove),fi(this.contextWindow,"pointerup",this.handlePointerUp),fi(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Jn(this.updatePoint)}}function Yl(e,t){return t?{point:t(e.point)}:e}function _f(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Xl({point:e},t){return{point:e,delta:_f(e,Ty(t)),offset:_f(e,Bj(t)),velocity:Fj(t,.1)}}function Bj(e){return e[0]}function Ty(e){return e[e.length-1]}function Fj(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,s=null;const i=Ty(e);for(;n>=0&&(s=e[n],!(i.timestamp-s.timestamp>yn(t)));)n--;if(!s)return{x:0,y:0};const a=vn(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 Py=1e-4,Vj=1-Py,$j=1+Py,Ay=.01,Uj=0-Ay,Hj=0+Ay;function vt(e){return e.max-e.min}function Wj(e,t,n){return Math.abs(e-t)<=n}function Ef(e,t,n,s=.5){e.origin=s,e.originPoint=je(t.min,t.max,e.origin),e.scale=vt(n)/vt(t),e.translate=je(n.min,n.max,e.origin)-e.originPoint,(e.scale>=Vj&&e.scale<=$j||isNaN(e.scale))&&(e.scale=1),(e.translate>=Uj&&e.translate<=Hj||isNaN(e.translate))&&(e.translate=0)}function mi(e,t,n,s){Ef(e.x,t.x,n.x,s?s.originX:void 0),Ef(e.y,t.y,n.y,s?s.originY:void 0)}function Tf(e,t,n){e.min=n.min+t.min,e.max=e.min+vt(t)}function Gj(e,t,n){Tf(e.x,t.x,n.x),Tf(e.y,t.y,n.y)}function Pf(e,t,n){e.min=t.min-n.min,e.max=e.min+vt(t)}function gi(e,t,n){Pf(e.x,t.x,n.x),Pf(e.y,t.y,n.y)}function Kj(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 Af(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 qj(e,{top:t,left:n,bottom:s,right:i}){return{x:Af(e.x,n,i),y:Af(e.y,t,s)}}function Mf(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 Yj(e,t){return{x:Mf(e.x,t.x),y:Mf(e.y,t.y)}}function Xj(e,t){let n=.5;const s=vt(e),i=vt(t);return i>s?n=wr(t.min,t.max-s,e.min):s>i&&(n=wr(e.min,e.max-i,t.min)),Nn(0,1,n)}function Qj(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 kd=.35;function Jj(e=kd){return e===!1?e=0:e===!0&&(e=kd),{x:zf(e,"left","right"),y:zf(e,"top","bottom")}}function zf(e,t,n){return{min:Rf(e,t),max:Rf(e,n)}}function Rf(e,t){return typeof e=="number"?e:e[t]||0}const Lf=()=>({translate:0,scale:1,origin:0,originPoint:0}),ir=()=>({x:Lf(),y:Lf()}),Df=()=>({min:0,max:0}),Te=()=>({x:Df(),y:Df()});function Nt(e){return[e("x"),e("y")]}function My({top:e,left:t,right:n,bottom:s}){return{x:{min:t,max:n},y:{min:e,max:s}}}function Zj({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function eN(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 Ql(e){return e===void 0||e===1}function jd({scale:e,scaleX:t,scaleY:n}){return!Ql(e)||!Ql(t)||!Ql(n)}function fs(e){return jd(e)||zy(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function zy(e){return Of(e.x)||Of(e.y)}function Of(e){return e&&e!=="0%"}function Ro(e,t,n){const s=e-n,i=t*s;return n+i}function If(e,t,n,s,i){return i!==void 0&&(e=Ro(e,i,s)),Ro(e,n,s)+t}function Nd(e,t=0,n=1,s,i){e.min=If(e.min,t,n,s,i),e.max=If(e.max,t,n,s,i)}function Ry(e,{x:t,y:n}){Nd(e.x,t.translate,t.scale,t.originPoint),Nd(e.y,n.translate,n.scale,n.originPoint)}const Bf=.999999999999,Ff=1.0000000000001;function tN(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&&or(e,{x:-a.scroll.offset.x,y:-a.scroll.offset.y}),o&&(t.x*=o.x.scale,t.y*=o.y.scale,Ry(e,o)),s&&fs(a.latestValues)&&or(e,a.latestValues))}t.x<Ff&&t.x>Bf&&(t.x=1),t.y<Ff&&t.y>Bf&&(t.y=1)}function ar(e,t){e.min=e.min+t,e.max=e.max+t}function Vf(e,t,n,s,i=.5){const a=je(e.min,e.max,i);Nd(e,t,n,a,s)}function or(e,t){Vf(e.x,t.x,t.scaleX,t.scale,t.originX),Vf(e.y,t.y,t.scaleY,t.scale,t.originY)}function Ly(e,t){return My(eN(e.getBoundingClientRect(),t))}function nN(e,t,n){const s=Ly(e,n),{scroll:i}=t;return i&&(ar(s.x,i.offset.x),ar(s.y,i.offset.y)),s}const Dy=({current:e})=>e?e.ownerDocument.defaultView:null,sN=new WeakMap;class rN{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=u=>{const{dragSnapToOrigin:p}=this.getProps();p?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(ta(u).point)},a=(u,p)=>{const{drag:h,dragPropagation:m,onDragStart:y}=this.getProps();if(h&&!m&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Xk(h),!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),Nt(v=>{let g=this.getAxisMotionValue(v).get()||0;if(sn.test(g)){const{projection:x}=this.visualElement;if(x&&x.layout){const w=x.layout.layoutBox[v];w&&(g=vt(w)*(parseFloat(g)/100))}}this.originPoint[v]=g}),y&&ye.postRender(()=>y(u,p)),fd(this.visualElement,"transform");const{animationState:b}=this.visualElement;b&&b.setActive("whileDrag",!0)},o=(u,p)=>{const{dragPropagation:h,dragDirectionLock:m,onDirectionLock:y,onDrag:b}=this.getProps();if(!h&&!this.openDragLock)return;const{offset:v}=p;if(m&&this.currentDirection===null){this.currentDirection=iN(v),this.currentDirection!==null&&y&&y(this.currentDirection);return}this.updateAxis("x",p.point,v),this.updateAxis("y",p.point,v),this.visualElement.render(),b&&b(u,p)},l=(u,p)=>this.stop(u,p),c=()=>Nt(u=>{var p;return this.getAnimationState(u)==="paused"&&((p=this.getAxisMotionValue(u).animation)===null||p===void 0?void 0:p.play())}),{dragSnapToOrigin:d}=this.getProps();this.panSession=new Ey(t,{onSessionStart:i,onStart:a,onMove:o,onSessionEnd:l,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:d,contextWindow:Dy(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&&ye.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||!Pa(t,i,this.currentDirection))return;const a=this.getAxisMotionValue(t);let o=this.originPoint[t]+s[t];this.constraints&&this.constraints[t]&&(o=Kj(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&&sr(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&i?this.constraints=qj(i.layoutBox,n):this.constraints=!1,this.elastic=Jj(s),a!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&Nt(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=Qj(i.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!sr(t))return!1;const s=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const a=nN(s,i.root,this.visualElement.getTransformPagePoint());let o=Yj(i.layout.layoutBox,a);if(n){const l=n(Zj(o));this.hasMutatedConstraints=!!l,l&&(o=My(l))}return o}startAnimation(t){const{drag:n,dragMomentum:s,dragElastic:i,dragTransition:a,dragSnapToOrigin:o,onDragTransitionEnd:l}=this.getProps(),c=this.constraints||{},d=Nt(u=>{if(!Pa(u,n,this.currentDirection))return;let p=c&&c[u]||{};o&&(p={min:0,max:0});const h=i?200:1e6,m=i?40:1e7,y={type:"inertia",velocity:s?t[u]:0,bounceStiffness:h,bounceDamping:m,timeConstant:750,restDelta:1,restSpeed:10,...a,...p};return this.startAxisValueAnimation(u,y)});return Promise.all(d).then(l)}startAxisValueAnimation(t,n){const s=this.getAxisMotionValue(t);return fd(this.visualElement,t),s.start(hh(t,s,0,n,this.visualElement,!1))}stopAnimation(){Nt(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Nt(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){Nt(n=>{const{drag:s}=this.getProps();if(!Pa(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(!sr(n)||!s||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Nt(o=>{const l=this.getAxisMotionValue(o);if(l&&this.constraints!==!1){const c=l.get();i[o]=Xj({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(),Nt(o=>{if(!Pa(o,t,null))return;const l=this.getAxisMotionValue(o),{min:c,max:d}=this.constraints[o];l.set(je(c,d,i[o]))})}addListeners(){if(!this.visualElement.current)return;sN.set(this.visualElement,this);const t=this.visualElement.current,n=fi(t,"pointerdown",c=>{const{drag:d,dragListener:u=!0}=this.getProps();d&&u&&this.start(c)}),s=()=>{const{dragConstraints:c}=this.getProps();sr(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()),ye.read(s);const o=Ui(window,"resize",()=>this.scalePositionWithinConstraints()),l=i.addEventListener("didUpdate",({delta:c,hasLayoutChanged:d})=>{this.isDragging&&d&&(Nt(u=>{const p=this.getAxisMotionValue(u);p&&(this.originPoint[u]+=c[u].translate,p.set(p.get()+c[u].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=kd,dragMomentum:l=!0}=t;return{...t,drag:n,dragDirectionLock:s,dragPropagation:i,dragConstraints:a,dragElastic:o,dragMomentum:l}}}function Pa(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function iN(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class aN extends as{constructor(t){super(t),this.removeGroupControls=xt,this.removeListeners=xt,this.controls=new rN(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||xt}unmount(){this.removeGroupControls(),this.removeListeners()}}const $f=e=>(t,n)=>{e&&ye.postRender(()=>e(t,n))};class oN extends as{constructor(){super(...arguments),this.removePointerDownListener=xt}onPointerDown(t){this.session=new Ey(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Dy(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:s,onPanEnd:i}=this.node.getProps();return{onSessionStart:$f(t),onStart:$f(n),onMove:s,onEnd:(a,o)=>{delete this.session,i&&ye.postRender(()=>i(a,o))}}}mount(){this.removePointerDownListener=fi(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 Qa={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Uf(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Wr={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Y.test(e))e=parseFloat(e);else return e;const n=Uf(e,t.target.x),s=Uf(e,t.target.y);return`${n}% ${s}%`}},lN={correct:(e,{treeScale:t,projectionDelta:n})=>{const s=e,i=Zn.parse(e);if(i.length>5)return s;const a=Zn.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 d=je(l,c,.5);return typeof i[2+o]=="number"&&(i[2+o]/=d),typeof i[3+o]=="number"&&(i[3+o]/=d),a(i)}};class cN extends f.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:s,layoutId:i}=this.props,{projection:a}=t;Tk(dN),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()})),Qa.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()||ye.postRender(()=>{const l=o.getStack();(!l||!l.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),Vu.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 Oy(e){const[t,n]=yx(),s=f.useContext(Lu);return r.jsx(cN,{...e,layoutGroup:s,switchLayoutGroup:f.useContext(_x),isPresent:t,safeToRemove:n})}const dN={borderRadius:{...Wr,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Wr,borderTopRightRadius:Wr,borderBottomLeftRadius:Wr,borderBottomRightRadius:Wr,boxShadow:lN};function uN(e,t,n){const s=Ye(e)?e:Vi(e);return s.start(hh("",s,t,n)),s.animation}function hN(e){return e instanceof SVGElement&&e.tagName!=="svg"}const pN=(e,t)=>e.depth-t.depth;class fN{constructor(){this.children=[],this.isDirty=!1}add(t){th(this.children,t),this.isDirty=!0}remove(t){nh(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(pN),this.isDirty=!1,this.children.forEach(t)}}function mN(e,t){const n=rn.now(),s=({timestamp:i})=>{const a=i-n;a>=t&&(Jn(s),e(a-t))};return ye.read(s,!0),()=>Jn(s)}const Iy=["TopLeft","TopRight","BottomLeft","BottomRight"],gN=Iy.length,Hf=e=>typeof e=="string"?parseFloat(e):e,Wf=e=>typeof e=="number"||Y.test(e);function xN(e,t,n,s,i,a){i?(e.opacity=je(0,n.opacity!==void 0?n.opacity:1,yN(s)),e.opacityExit=je(t.opacity!==void 0?t.opacity:1,0,vN(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<gN;o++){const l=`border${Iy[o]}Radius`;let c=Gf(t,l),d=Gf(n,l);if(c===void 0&&d===void 0)continue;c||(c=0),d||(d=0),c===0||d===0||Wf(c)===Wf(d)?(e[l]=Math.max(je(Hf(c),Hf(d),s),0),(sn.test(d)||sn.test(c))&&(e[l]+="%")):e[l]=d}(t.rotate||n.rotate)&&(e.rotate=je(t.rotate||0,n.rotate||0,s))}function Gf(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const yN=By(0,.5,sy),vN=By(.5,.95,xt);function By(e,t,n){return s=>s<e?0:s>t?1:n(wr(e,t,s))}function Kf(e,t){e.min=t.min,e.max=t.max}function jt(e,t){Kf(e.x,t.x),Kf(e.y,t.y)}function qf(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function Yf(e,t,n,s,i){return e-=t,e=Ro(e,1/n,s),i!==void 0&&(e=Ro(e,1/i,s)),e}function bN(e,t=0,n=1,s=.5,i,a=e,o=e){if(sn.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=Yf(e.min,t,n,l,i),e.max=Yf(e.max,t,n,l,i)}function Xf(e,t,[n,s,i],a,o){bN(e,t[n],t[s],t[i],t.scale,a,o)}const wN=["x","scaleX","originX"],kN=["y","scaleY","originY"];function Qf(e,t,n,s){Xf(e.x,t,wN,n?n.x:void 0,s?s.x:void 0),Xf(e.y,t,kN,n?n.y:void 0,s?s.y:void 0)}function Jf(e){return e.translate===0&&e.scale===1}function Fy(e){return Jf(e.x)&&Jf(e.y)}function Zf(e,t){return e.min===t.min&&e.max===t.max}function jN(e,t){return Zf(e.x,t.x)&&Zf(e.y,t.y)}function em(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Vy(e,t){return em(e.x,t.x)&&em(e.y,t.y)}function tm(e){return vt(e.x)/vt(e.y)}function nm(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class NN{constructor(){this.members=[]}add(t){th(this.members,t),t.scheduleRender()}remove(t){if(nh(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 SN(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:d,rotate:u,rotateX:p,rotateY:h,skewX:m,skewY:y}=n;d&&(s=`perspective(${d}px) ${s}`),u&&(s+=`rotate(${u}deg) `),p&&(s+=`rotateX(${p}deg) `),h&&(s+=`rotateY(${h}deg) `),m&&(s+=`skewX(${m}deg) `),y&&(s+=`skewY(${y}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 ms={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},ei=typeof window<"u"&&window.MotionDebug!==void 0,Jl=["","X","Y","Z"],CN={visibility:"hidden"},sm=1e3;let _N=0;function Zl(e,t,n,s){const{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),s&&(s[e]=0))}function $y(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=Xx(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:a}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",ye,!(i||a))}const{parent:s}=e;s&&!s.hasCheckedOptimisedAppear&&$y(s)}function Uy({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:s,resetTransform:i}){return class{constructor(o={},l=t==null?void 0:t()){this.id=_N++,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,ei&&(ms.totalNodes=ms.resolvedTargetDeltas=ms.recalculatedProjection=0),this.nodes.forEach(PN),this.nodes.forEach(LN),this.nodes.forEach(DN),this.nodes.forEach(AN),ei&&window.MotionDebug.record(ms)},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 fN)}addEventListener(o,l){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new sh),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=hN(o),this.instance=o;const{layoutId:c,layout:d,visualElement:u}=this.options;if(u&&!u.current&&u.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),l&&(d||c)&&(this.isLayoutDirty=!0),e){let p;const h=()=>this.root.updateBlockedByResize=!1;e(o,()=>{this.root.updateBlockedByResize=!0,p&&p(),p=mN(h,250),Qa.hasAnimatedSinceResize&&(Qa.hasAnimatedSinceResize=!1,this.nodes.forEach(im))})}c&&this.root.registerSharedNode(c,this),this.options.animate!==!1&&u&&(c||d)&&this.addEventListener("didUpdate",({delta:p,hasLayoutChanged:h,hasRelativeTargetChanged:m,layout:y})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const b=this.options.transition||u.getDefaultTransition()||VN,{onLayoutAnimationStart:v,onLayoutAnimationComplete:g}=u.getProps(),x=!this.targetLayout||!Vy(this.targetLayout,y)||m,w=!h&&m;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||w||h&&(x||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(p,w);const j={...Qu(b,"layout"),onPlay:v,onComplete:g};(u.shouldReduceMotion||this.options.layoutRoot)&&(j.delay=0,j.type=!1),this.startAnimation(j)}else h||im(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=y})}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,Jn(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(ON),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&&$y(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const p=this.path[u];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 d=this.getTransformTemplate();this.prevTransformTemplateValue=d?d(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(rm);return}this.isUpdating||this.nodes.forEach(zN),this.isUpdating=!1,this.nodes.forEach(RN),this.nodes.forEach(EN),this.nodes.forEach(TN),this.clearAllSnapshots();const l=rn.now();Ve.delta=Nn(0,1e3/60,l-Ve.timestamp),Ve.timestamp=l,Ve.isProcessing=!0,Ul.update.process(Ve),Ul.preRender.process(Ve),Ul.render.process(Ve),Ve.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Vu.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(MN),this.sharedNodes.forEach(IN)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,ye.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){ye.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&&!Fy(this.projectionDelta),c=this.getTransformTemplate(),d=c?c(this.latestValues,""):void 0,u=d!==this.prevTransformTemplateValue;o&&(l||fs(this.latestValues)||u)&&(i(this.instance,d),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const l=this.measurePageBox();let c=this.removeElementScroll(l);return o&&(c=this.removeTransform(c)),$N(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(UN))){const{scroll:u}=this.root;u&&(ar(c.x,u.offset.x),ar(c.y,u.offset.y))}return c}removeElementScroll(o){var l;const c=Te();if(jt(c,o),!((l=this.scroll)===null||l===void 0)&&l.wasRoot)return c;for(let d=0;d<this.path.length;d++){const u=this.path[d],{scroll:p,options:h}=u;u!==this.root&&p&&h.layoutScroll&&(p.wasRoot&&jt(c,o),ar(c.x,p.offset.x),ar(c.y,p.offset.y))}return c}applyTransform(o,l=!1){const c=Te();jt(c,o);for(let d=0;d<this.path.length;d++){const u=this.path[d];!l&&u.options.layoutScroll&&u.scroll&&u!==u.root&&or(c,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),fs(u.latestValues)&&or(c,u.latestValues)}return fs(this.latestValues)&&or(c,this.latestValues),c}removeTransform(o){const l=Te();jt(l,o);for(let c=0;c<this.path.length;c++){const d=this.path[c];if(!d.instance||!fs(d.latestValues))continue;jd(d.latestValues)&&d.updateSnapshot();const u=Te(),p=d.measurePageBox();jt(u,p),Qf(l,d.latestValues,d.snapshot?d.snapshot.layoutBox:void 0,u)}return fs(this.latestValues)&&Qf(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!==Ve.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 d=!!this.resumingFrom||this!==c;if(!(o||d&&this.isSharedProjectionDirty||this.isProjectionDirty||!((l=this.parent)===null||l===void 0)&&l.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:p,layoutId:h}=this.options;if(!(!this.layout||!(p||h))){if(this.resolvedRelativeTargetAt=Ve.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(),gi(this.relativeTargetOrigin,this.layout.layoutBox,m.layout.layoutBox),jt(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(),Gj(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):jt(this.target,this.layout.layoutBox),Ry(this.target,this.targetDelta)):jt(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(),gi(this.relativeTargetOrigin,this.target,m.target),jt(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}ei&&ms.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||jd(this.parent.latestValues)||zy(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 d=!0;if((this.isProjectionDirty||!((o=this.parent)===null||o===void 0)&&o.isProjectionDirty)&&(d=!1),c&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(d=!1),this.resolvedRelativeTargetAt===Ve.timestamp&&(d=!1),d)return;const{layout:u,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||!(u||p))return;jt(this.layoutCorrected,this.layout.layoutBox);const h=this.treeScale.x,m=this.treeScale.y;tN(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:y}=l;if(!y){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(qf(this.prevProjectionDelta.x,this.projectionDelta.x),qf(this.prevProjectionDelta.y,this.projectionDelta.y)),mi(this.projectionDelta,this.layoutCorrected,y,this.latestValues),(this.treeScale.x!==h||this.treeScale.y!==m||!nm(this.projectionDelta.x,this.prevProjectionDelta.x)||!nm(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",y)),ei&&ms.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=ir(),this.projectionDelta=ir(),this.projectionDeltaWithTransform=ir()}setAnimationOrigin(o,l=!1){const c=this.snapshot,d=c?c.latestValues:{},u={...this.latestValues},p=ir();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!l;const h=Te(),m=c?c.source:void 0,y=this.layout?this.layout.source:void 0,b=m!==y,v=this.getStack(),g=!v||v.members.length<=1,x=!!(b&&!g&&this.options.crossfade===!0&&!this.path.some(FN));this.animationProgress=0;let w;this.mixTargetDelta=j=>{const k=j/1e3;am(p.x,o.x,k),am(p.y,o.y,k),this.setTargetDelta(p),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(gi(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox),BN(this.relativeTarget,this.relativeTargetOrigin,h,k),w&&jN(this.relativeTarget,w)&&(this.isProjectionDirty=!1),w||(w=Te()),jt(w,this.relativeTarget)),b&&(this.animationValues=u,xN(u,d,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&&(Jn(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=ye.update(()=>{Qa.hasAnimatedSinceResize=!0,this.currentAnimation=uN(0,sm,{...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(sm),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:l,target:c,layout:d,latestValues:u}=o;if(!(!l||!c||!d)){if(this!==o&&this.layout&&d&&Hy(this.options.animationType,this.layout.layoutBox,d.layoutBox)){c=this.target||Te();const p=vt(this.layout.layoutBox.x);c.x.min=o.target.x.min,c.x.max=c.x.min+p;const h=vt(this.layout.layoutBox.y);c.y.min=o.target.y.min,c.y.max=c.y.min+h}jt(l,c),or(l,u),mi(this.projectionDeltaWithTransform,this.layoutCorrected,l,u)}}registerSharedNode(o,l){this.sharedNodes.has(o)||this.sharedNodes.set(o,new NN),this.sharedNodes.get(o).add(l);const d=l.options.initialPromotionConfig;l.promote({transition:d?d.transition:void 0,preserveFollowOpacity:d&&d.shouldPreserveFollowOpacity?d.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 d=this.getStack();d&&d.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 d={};c.z&&Zl("z",o,d,this.animationValues);for(let u=0;u<Jl.length;u++)Zl(`rotate${Jl[u]}`,o,d,this.animationValues),Zl(`skew${Jl[u]}`,o,d,this.animationValues);o.render();for(const u in d)o.setStaticValue(u,d[u]),this.animationValues&&(this.animationValues[u]=d[u]);o.scheduleRender()}getProjectionStyles(o){var l,c;if(!this.instance||this.isSVG)return;if(!this.isVisible)return CN;const d={visibility:""},u=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,d.opacity="",d.pointerEvents=Ya(o==null?void 0:o.pointerEvents)||"",d.transform=u?u(this.latestValues,""):"none",d;const p=this.getLead();if(!this.projectionDelta||!this.layout||!p.target){const b={};return this.options.layoutId&&(b.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,b.pointerEvents=Ya(o==null?void 0:o.pointerEvents)||""),this.hasProjected&&!fs(this.latestValues)&&(b.transform=u?u({},""):"none",this.hasProjected=!1),b}const h=p.animationValues||p.latestValues;this.applyTransformsToTarget(),d.transform=SN(this.projectionDeltaWithTransform,this.treeScale,h),u&&(d.transform=u(h,d.transform));const{x:m,y}=this.projectionDelta;d.transformOrigin=`${m.origin*100}% ${y.origin*100}% 0`,p.animationValues?d.opacity=p===this?(c=(l=h.opacity)!==null&&l!==void 0?l:this.latestValues.opacity)!==null&&c!==void 0?c:1:this.preserveOpacity?this.latestValues.opacity:h.opacityExit:d.opacity=p===this?h.opacity!==void 0?h.opacity:"":h.opacityExit!==void 0?h.opacityExit:0;for(const b in To){if(h[b]===void 0)continue;const{correct:v,applyTo:g}=To[b],x=d.transform==="none"?h[b]:v(h[b],p);if(g){const w=g.length;for(let j=0;j<w;j++)d[g[j]]=x}else d[b]=x}return this.options.layoutId&&(d.pointerEvents=p===this?Ya(o==null?void 0:o.pointerEvents)||"":"none"),d}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(rm),this.root.sharedNodes.clear()}}}function EN(e){e.updateLayout()}function TN(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"?Nt(p=>{const h=o?n.measuredBox[p]:n.layoutBox[p],m=vt(h);h.min=s[p].min,h.max=h.min+m}):Hy(a,n.layoutBox,s)&&Nt(p=>{const h=o?n.measuredBox[p]:n.layoutBox[p],m=vt(s[p]);h.max=h.min+m,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[p].max=e.relativeTarget[p].min+m)});const l=ir();mi(l,s,n.layoutBox);const c=ir();o?mi(c,e.applyTransform(i,!0),n.measuredBox):mi(c,s,n.layoutBox);const d=!Fy(l);let u=!1;if(!e.resumeFrom){const p=e.getClosestProjectingParent();if(p&&!p.resumeFrom){const{snapshot:h,layout:m}=p;if(h&&m){const y=Te();gi(y,n.layoutBox,h.layoutBox);const b=Te();gi(b,s,m.layoutBox),Vy(y,b)||(u=!0),p.options.layoutRoot&&(e.relativeTarget=b,e.relativeTargetOrigin=y,e.relativeParent=p)}}}e.notifyListeners("didUpdate",{layout:s,snapshot:n,delta:c,layoutDelta:l,hasLayoutChanged:d,hasRelativeTargetChanged:u})}else if(e.isLead()){const{onExitComplete:s}=e.options;s&&s()}e.options.transition=void 0}function PN(e){ei&&ms.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 AN(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function MN(e){e.clearSnapshot()}function rm(e){e.clearMeasurements()}function zN(e){e.isLayoutDirty=!1}function RN(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function im(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function LN(e){e.resolveTargetDelta()}function DN(e){e.calcProjection()}function ON(e){e.resetSkewAndRotation()}function IN(e){e.removeLeadSnapshot()}function am(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 om(e,t,n,s){e.min=je(t.min,n.min,s),e.max=je(t.max,n.max,s)}function BN(e,t,n,s){om(e.x,t.x,n.x,s),om(e.y,t.y,n.y,s)}function FN(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const VN={duration:.45,ease:[.4,0,.1,1]},lm=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),cm=lm("applewebkit/")&&!lm("chrome/")?Math.round:xt;function dm(e){e.min=cm(e.min),e.max=cm(e.max)}function $N(e){dm(e.x),dm(e.y)}function Hy(e,t,n){return e==="position"||e==="preserve-aspect"&&!Wj(tm(t),tm(n),.2)}function UN(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}const HN=Uy({attachResizeListener:(e,t)=>Ui(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),ec={current:void 0},Wy=Uy({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!ec.current){const e=new HN({});e.mount(window),e.setOptions({layoutScroll:!0}),ec.current=e}return ec.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),WN={pan:{Feature:oN},drag:{Feature:aN,ProjectionNode:Wy,MeasureLayout:Oy}};function um(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&&ye.postRender(()=>a(t,ta(t)))}class GN extends as{mount(){const{current:t}=this.node;t&&(this.unmount=Wk(t,n=>(um(this.node,n,"Start"),s=>um(this.node,s,"End"))))}unmount(){}}class KN extends as{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=ea(Ui(this.node.current,"focus",()=>this.onFocus()),Ui(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function hm(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&&ye.postRender(()=>a(t,ta(t)))}class qN extends as{mount(){const{current:t}=this.node;t&&(this.unmount=Yk(t,n=>(hm(this.node,n,"Start"),(s,{success:i})=>hm(this.node,s,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Sd=new WeakMap,tc=new WeakMap,YN=e=>{const t=Sd.get(e.target);t&&t(e)},XN=e=>{e.forEach(YN)};function QN({root:e,...t}){const n=e||document;tc.has(n)||tc.set(n,{});const s=tc.get(n),i=JSON.stringify(t);return s[i]||(s[i]=new IntersectionObserver(XN,{root:e,...t})),s[i]}function JN(e,t,n){const s=QN(t);return Sd.set(e,n),s.observe(e),()=>{Sd.delete(e),s.unobserve(e)}}const ZN={some:0,all:1};class eS extends as{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:ZN[i]},l=c=>{const{isIntersecting:d}=c;if(this.isInView===d||(this.isInView=d,a&&!d&&this.hasEnteredView))return;d&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",d);const{onViewportEnter:u,onViewportLeave:p}=this.node.getProps(),h=d?u:p;h&&h(c)};return JN(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(tS(t,n))&&this.startObserver()}unmount(){}}function tS({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const nS={inView:{Feature:eS},tap:{Feature:qN},focus:{Feature:KN},hover:{Feature:GN}},sS={layout:{ProjectionNode:Wy,MeasureLayout:Oy}},Cd={current:null},Gy={current:!1};function rS(){if(Gy.current=!0,!!Du)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Cd.current=e.matches;e.addListener(t),t()}else Cd.current=!1}const iS=[...xy,Ge,Zn],aS=e=>iS.find(gy(e)),pm=new WeakMap;function oS(e,t,n){for(const s in t){const i=t[s],a=n[s];if(Ye(i))e.addValue(s,i);else if(Ye(a))e.addValue(s,Vi(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,Vi(o!==void 0?o:i,{owner:e}))}}for(const s in n)t[s]===void 0&&e.removeValue(s);return t}const fm=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class lS{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=ch,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=rn.now();this.renderScheduledAt<m&&(this.renderScheduledAt=m,ye.render(this.render,!1,!0))};const{latestValues:c,renderState:d,onUpdate:u}=o;this.onUpdate=u,this.latestValues=c,this.baseTarget={...c},this.initialValues=n.initial?{...c}:{},this.renderState=d,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=nl(n),this.isVariantNode=Sx(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:p,...h}=this.scrapeMotionValuesFromProps(n,{},this);for(const m in h){const y=h[m];c[m]!==void 0&&Ye(y)&&y.set(c[m],!1)}}mount(t){this.current=t,pm.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)),Gy.current||rS(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Cd.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){pm.delete(this.current),this.projection&&this.projection.unmount(),Jn(this.notifyUpdate),Jn(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=zs.has(t),i=n.on("change",l=>{this.latestValues[t]=l,this.props.onUpdate&&ye.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 kr){const n=kr[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<fm.length;s++){const i=fm[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=oS(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=Vi(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"&&(fy(i)||iy(i))?i=parseFloat(i):!aS(i)&&Zn.test(n)&&(i=uy(t,n)),this.setBaseTarget(t,Ye(i)?i.get():i)),Ye(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=Uu(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&&!Ye(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 sh),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class Ky extends lS{constructor(){super(...arguments),this.KeyframeResolver=yy}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;Ye(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function cS(e){return window.getComputedStyle(e)}class dS extends Ky{constructor(){super(...arguments),this.type="html",this.renderInstance=Rx}readValueFromInstance(t,n){if(zs.has(n)){const s=lh(n);return s&&s.default||0}else{const s=cS(t),i=(Ax(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return Ly(t,n)}build(t,n,s){Gu(t,n,s.transformTemplate)}scrapeMotionValuesFromProps(t,n,s){return Xu(t,n,s)}}class uS extends Ky{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Te}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(zs.has(n)){const s=lh(n);return s&&s.default||0}return n=Lx.has(n)?n:Fu(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,s){return Ix(t,n,s)}build(t,n,s){Ku(t,n,this.isSVGTag,s.transformTemplate)}renderInstance(t,n,s,i){Dx(t,n,s,i)}mount(t){this.isSVGTag=Yu(t.tagName),super.mount(t)}}const hS=(e,t)=>$u(e)?new uS(t):new dS(t,{allowProjection:e!==f.Fragment}),pS=Ik({...Dj,...nS,...WN,...sS},hS),U=Z2(pS);/**
|
|
77
77
|
* @license lucide-react v0.462.0 - ISC
|
|
78
78
|
*
|
|
79
79
|
* This source code is licensed under the ISC license.
|
|
80
80
|
* See the LICENSE file in the root directory of this source tree.
|
|
81
|
-
*/const
|
|
81
|
+
*/const fS=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),qy=(...e)=>e.filter((t,n,s)=>!!t&&t.trim()!==""&&s.indexOf(t)===n).join(" ").trim();/**
|
|
82
82
|
* @license lucide-react v0.462.0 - ISC
|
|
83
83
|
*
|
|
84
84
|
* This source code is licensed under the ISC license.
|
|
85
85
|
* See the LICENSE file in the root directory of this source tree.
|
|
86
|
-
*/var
|
|
86
|
+
*/var mS={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
87
87
|
* @license lucide-react v0.462.0 - ISC
|
|
88
88
|
*
|
|
89
89
|
* This source code is licensed under the ISC license.
|
|
90
90
|
* See the LICENSE file in the root directory of this source tree.
|
|
91
|
-
*/const
|
|
91
|
+
*/const gS=f.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:s,className:i="",children:a,iconNode:o,...l},c)=>f.createElement("svg",{ref:c,...mS,width:t,height:t,stroke:e,strokeWidth:s?Number(n)*24/Number(t):n,className:qy("lucide",i),...l},[...o.map(([d,u])=>f.createElement(d,u)),...Array.isArray(a)?a:[a]]));/**
|
|
92
92
|
* @license lucide-react v0.462.0 - ISC
|
|
93
93
|
*
|
|
94
94
|
* This source code is licensed under the ISC license.
|
|
95
95
|
* See the LICENSE file in the root directory of this source tree.
|
|
96
|
-
*/const O=(e,t)=>{const n=f.forwardRef(({className:s,...i},a)=>f.createElement(
|
|
96
|
+
*/const O=(e,t)=>{const n=f.forwardRef(({className:s,...i},a)=>f.createElement(gS,{ref:a,iconNode:t,className:qy(`lucide-${fS(e)}`,s),...i}));return n.displayName=`${e}`,n};/**
|
|
97
97
|
* @license lucide-react v0.462.0 - ISC
|
|
98
98
|
*
|
|
99
99
|
* This source code is licensed under the ISC license.
|
|
100
100
|
* See the LICENSE file in the root directory of this source tree.
|
|
101
|
-
*/const
|
|
101
|
+
*/const xS=O("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/**
|
|
102
102
|
* @license lucide-react v0.462.0 - ISC
|
|
103
103
|
*
|
|
104
104
|
* This source code is licensed under the ISC license.
|
|
105
105
|
* See the LICENSE file in the root directory of this source tree.
|
|
106
|
-
*/const
|
|
106
|
+
*/const Yy=O("Apple",[["path",{d:"M12 20.94c1.5 0 2.75 1.06 4 1.06 3 0 6-8 6-12.22A4.91 4.91 0 0 0 17 5c-2.22 0-4 1.44-5 2-1-.56-2.78-2-5-2a4.9 4.9 0 0 0-5 4.78C2 14 5 22 8 22c1.25 0 2.5-1.06 4-1.06Z",key:"3s7exb"}],["path",{d:"M10 2c1 .5 2 2 2 5",key:"fcco2y"}]]);/**
|
|
107
107
|
* @license lucide-react v0.462.0 - ISC
|
|
108
108
|
*
|
|
109
109
|
* This source code is licensed under the ISC license.
|
|
110
110
|
* See the LICENSE file in the root directory of this source tree.
|
|
111
|
-
*/const
|
|
111
|
+
*/const yS=O("Archive",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]]);/**
|
|
112
112
|
* @license lucide-react v0.462.0 - ISC
|
|
113
113
|
*
|
|
114
114
|
* This source code is licensed under the ISC license.
|
|
115
115
|
* See the LICENSE file in the root directory of this source tree.
|
|
116
|
-
*/const
|
|
116
|
+
*/const vS=O("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
|
|
117
117
|
* @license lucide-react v0.462.0 - ISC
|
|
118
118
|
*
|
|
119
119
|
* This source code is licensed under the ISC license.
|
|
120
120
|
* See the LICENSE file in the root directory of this source tree.
|
|
121
|
-
*/const
|
|
121
|
+
*/const bS=O("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
|
|
122
122
|
* @license lucide-react v0.462.0 - ISC
|
|
123
123
|
*
|
|
124
124
|
* This source code is licensed under the ISC license.
|
|
125
125
|
* See the LICENSE file in the root directory of this source tree.
|
|
126
|
-
*/const
|
|
126
|
+
*/const wS=O("AudioLines",[["path",{d:"M2 10v3",key:"1fnikh"}],["path",{d:"M6 6v11",key:"11sgs0"}],["path",{d:"M10 3v18",key:"yhl04a"}],["path",{d:"M14 8v7",key:"3a1oy3"}],["path",{d:"M18 5v13",key:"123xd1"}],["path",{d:"M22 10v3",key:"154ddg"}]]);/**
|
|
127
127
|
* @license lucide-react v0.462.0 - ISC
|
|
128
128
|
*
|
|
129
129
|
* This source code is licensed under the ISC license.
|
|
130
130
|
* See the LICENSE file in the root directory of this source tree.
|
|
131
|
-
*/const
|
|
131
|
+
*/const kS=O("AudioWaveform",[["path",{d:"M2 13a2 2 0 0 0 2-2V7a2 2 0 0 1 4 0v13a2 2 0 0 0 4 0V4a2 2 0 0 1 4 0v13a2 2 0 0 0 4 0v-4a2 2 0 0 1 2-2",key:"57tc96"}]]);/**
|
|
132
132
|
* @license lucide-react v0.462.0 - ISC
|
|
133
133
|
*
|
|
134
134
|
* This source code is licensed under the ISC license.
|
|
@@ -138,7 +138,7 @@ Error generating stack: `+a.message+`
|
|
|
138
138
|
*
|
|
139
139
|
* This source code is licensed under the ISC license.
|
|
140
140
|
* See the LICENSE file in the root directory of this source tree.
|
|
141
|
-
*/const
|
|
141
|
+
*/const Xy=O("BookmarkPlus",[["path",{d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z",key:"1fy3hk"}],["line",{x1:"12",x2:"12",y1:"7",y2:"13",key:"1cppfj"}],["line",{x1:"15",x2:"9",y1:"10",y2:"10",key:"1gty7f"}]]);/**
|
|
142
142
|
* @license lucide-react v0.462.0 - ISC
|
|
143
143
|
*
|
|
144
144
|
* This source code is licensed under the ISC license.
|
|
@@ -158,12 +158,12 @@ Error generating stack: `+a.message+`
|
|
|
158
158
|
*
|
|
159
159
|
* This source code is licensed under the ISC license.
|
|
160
160
|
* See the LICENSE file in the root directory of this source tree.
|
|
161
|
-
*/const
|
|
161
|
+
*/const jS=O("ChartColumn",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);/**
|
|
162
162
|
* @license lucide-react v0.462.0 - ISC
|
|
163
163
|
*
|
|
164
164
|
* This source code is licensed under the ISC license.
|
|
165
165
|
* See the LICENSE file in the root directory of this source tree.
|
|
166
|
-
*/const
|
|
166
|
+
*/const Qy=O("ChartNoAxesColumn",[["line",{x1:"18",x2:"18",y1:"20",y2:"10",key:"1xfpm4"}],["line",{x1:"12",x2:"12",y1:"20",y2:"4",key:"be30l9"}],["line",{x1:"6",x2:"6",y1:"20",y2:"14",key:"1r4le6"}]]);/**
|
|
167
167
|
* @license lucide-react v0.462.0 - ISC
|
|
168
168
|
*
|
|
169
169
|
* This source code is licensed under the ISC license.
|
|
@@ -208,7 +208,7 @@ Error generating stack: `+a.message+`
|
|
|
208
208
|
*
|
|
209
209
|
* This source code is licensed under the ISC license.
|
|
210
210
|
* See the LICENSE file in the root directory of this source tree.
|
|
211
|
-
*/const
|
|
211
|
+
*/const Jy=O("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
|
|
212
212
|
* @license lucide-react v0.462.0 - ISC
|
|
213
213
|
*
|
|
214
214
|
* This source code is licensed under the ISC license.
|
|
@@ -218,12 +218,12 @@ Error generating stack: `+a.message+`
|
|
|
218
218
|
*
|
|
219
219
|
* This source code is licensed under the ISC license.
|
|
220
220
|
* See the LICENSE file in the root directory of this source tree.
|
|
221
|
-
*/const
|
|
221
|
+
*/const NS=O("CloudDownload",[["path",{d:"M12 13v8l-4-4",key:"1f5nwf"}],["path",{d:"m12 21 4-4",key:"1lfcce"}],["path",{d:"M4.393 15.269A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.436 8.284",key:"ui1hmy"}]]);/**
|
|
222
222
|
* @license lucide-react v0.462.0 - ISC
|
|
223
223
|
*
|
|
224
224
|
* This source code is licensed under the ISC license.
|
|
225
225
|
* See the LICENSE file in the root directory of this source tree.
|
|
226
|
-
*/const
|
|
226
|
+
*/const Zy=O("Cloud",[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]]);/**
|
|
227
227
|
* @license lucide-react v0.462.0 - ISC
|
|
228
228
|
*
|
|
229
229
|
* This source code is licensed under the ISC license.
|
|
@@ -248,7 +248,7 @@ Error generating stack: `+a.message+`
|
|
|
248
248
|
*
|
|
249
249
|
* This source code is licensed under the ISC license.
|
|
250
250
|
* See the LICENSE file in the root directory of this source tree.
|
|
251
|
-
*/const
|
|
251
|
+
*/const SS=O("DollarSign",[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]]);/**
|
|
252
252
|
* @license lucide-react v0.462.0 - ISC
|
|
253
253
|
*
|
|
254
254
|
* This source code is licensed under the ISC license.
|
|
@@ -263,7 +263,7 @@ Error generating stack: `+a.message+`
|
|
|
263
263
|
*
|
|
264
264
|
* This source code is licensed under the ISC license.
|
|
265
265
|
* See the LICENSE file in the root directory of this source tree.
|
|
266
|
-
*/const
|
|
266
|
+
*/const CS=O("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);/**
|
|
267
267
|
* @license lucide-react v0.462.0 - ISC
|
|
268
268
|
*
|
|
269
269
|
* This source code is licensed under the ISC license.
|
|
@@ -293,12 +293,12 @@ Error generating stack: `+a.message+`
|
|
|
293
293
|
*
|
|
294
294
|
* This source code is licensed under the ISC license.
|
|
295
295
|
* See the LICENSE file in the root directory of this source tree.
|
|
296
|
-
*/const
|
|
296
|
+
*/const _S=O("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/**
|
|
297
297
|
* @license lucide-react v0.462.0 - ISC
|
|
298
298
|
*
|
|
299
299
|
* This source code is licensed under the ISC license.
|
|
300
300
|
* See the LICENSE file in the root directory of this source tree.
|
|
301
|
-
*/const
|
|
301
|
+
*/const e1=O("FolderGit2",[["path",{d:"M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5",key:"1w6njk"}],["circle",{cx:"13",cy:"12",r:"2",key:"1j92g6"}],["path",{d:"M18 19c-2.8 0-5-2.2-5-5v8",key:"pkpw2h"}],["circle",{cx:"20",cy:"19",r:"2",key:"1obnsp"}]]);/**
|
|
302
302
|
* @license lucide-react v0.462.0 - ISC
|
|
303
303
|
*
|
|
304
304
|
* This source code is licensed under the ISC license.
|
|
@@ -308,7 +308,7 @@ Error generating stack: `+a.message+`
|
|
|
308
308
|
*
|
|
309
309
|
* This source code is licensed under the ISC license.
|
|
310
310
|
* See the LICENSE file in the root directory of this source tree.
|
|
311
|
-
*/const
|
|
311
|
+
*/const ES=O("Folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/**
|
|
312
312
|
* @license lucide-react v0.462.0 - ISC
|
|
313
313
|
*
|
|
314
314
|
* This source code is licensed under the ISC license.
|
|
@@ -318,22 +318,22 @@ Error generating stack: `+a.message+`
|
|
|
318
318
|
*
|
|
319
319
|
* This source code is licensed under the ISC license.
|
|
320
320
|
* See the LICENSE file in the root directory of this source tree.
|
|
321
|
-
*/const
|
|
321
|
+
*/const TS=O("Gift",[["rect",{x:"3",y:"8",width:"18",height:"4",rx:"1",key:"bkv52"}],["path",{d:"M12 8v13",key:"1c76mn"}],["path",{d:"M19 12v7a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-7",key:"6wjy6b"}],["path",{d:"M7.5 8a2.5 2.5 0 0 1 0-5A4.8 8 0 0 1 12 8a4.8 8 0 0 1 4.5-5 2.5 2.5 0 0 1 0 5",key:"1ihvrl"}]]);/**
|
|
322
322
|
* @license lucide-react v0.462.0 - ISC
|
|
323
323
|
*
|
|
324
324
|
* This source code is licensed under the ISC license.
|
|
325
325
|
* See the LICENSE file in the root directory of this source tree.
|
|
326
|
-
*/const
|
|
326
|
+
*/const t1=O("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);/**
|
|
327
327
|
* @license lucide-react v0.462.0 - ISC
|
|
328
328
|
*
|
|
329
329
|
* This source code is licensed under the ISC license.
|
|
330
330
|
* See the LICENSE file in the root directory of this source tree.
|
|
331
|
-
*/const
|
|
331
|
+
*/const PS=O("GitMerge",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M6 21V9a9 9 0 0 0 9 9",key:"7kw0sc"}]]);/**
|
|
332
332
|
* @license lucide-react v0.462.0 - ISC
|
|
333
333
|
*
|
|
334
334
|
* This source code is licensed under the ISC license.
|
|
335
335
|
* See the LICENSE file in the root directory of this source tree.
|
|
336
|
-
*/const
|
|
336
|
+
*/const AS=O("Github",[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]);/**
|
|
337
337
|
* @license lucide-react v0.462.0 - ISC
|
|
338
338
|
*
|
|
339
339
|
* This source code is licensed under the ISC license.
|
|
@@ -343,7 +343,7 @@ Error generating stack: `+a.message+`
|
|
|
343
343
|
*
|
|
344
344
|
* This source code is licensed under the ISC license.
|
|
345
345
|
* See the LICENSE file in the root directory of this source tree.
|
|
346
|
-
*/const
|
|
346
|
+
*/const MS=O("HardDrive",[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]]);/**
|
|
347
347
|
* @license lucide-react v0.462.0 - ISC
|
|
348
348
|
*
|
|
349
349
|
* This source code is licensed under the ISC license.
|
|
@@ -353,32 +353,32 @@ Error generating stack: `+a.message+`
|
|
|
353
353
|
*
|
|
354
354
|
* This source code is licensed under the ISC license.
|
|
355
355
|
* See the LICENSE file in the root directory of this source tree.
|
|
356
|
-
*/const
|
|
356
|
+
*/const n1=O("KeyRound",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]);/**
|
|
357
357
|
* @license lucide-react v0.462.0 - ISC
|
|
358
358
|
*
|
|
359
359
|
* This source code is licensed under the ISC license.
|
|
360
360
|
* See the LICENSE file in the root directory of this source tree.
|
|
361
|
-
*/const
|
|
361
|
+
*/const zS=O("Key",[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]]);/**
|
|
362
362
|
* @license lucide-react v0.462.0 - ISC
|
|
363
363
|
*
|
|
364
364
|
* This source code is licensed under the ISC license.
|
|
365
365
|
* See the LICENSE file in the root directory of this source tree.
|
|
366
|
-
*/const
|
|
366
|
+
*/const RS=O("Keyboard",[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]]);/**
|
|
367
367
|
* @license lucide-react v0.462.0 - ISC
|
|
368
368
|
*
|
|
369
369
|
* This source code is licensed under the ISC license.
|
|
370
370
|
* See the LICENSE file in the root directory of this source tree.
|
|
371
|
-
*/const
|
|
371
|
+
*/const LS=O("Languages",[["path",{d:"m5 8 6 6",key:"1wu5hv"}],["path",{d:"m4 14 6-6 2-3",key:"1k1g8d"}],["path",{d:"M2 5h12",key:"or177f"}],["path",{d:"M7 2h1",key:"1t2jsx"}],["path",{d:"m22 22-5-10-5 10",key:"don7ne"}],["path",{d:"M14 18h6",key:"1m8k6r"}]]);/**
|
|
372
372
|
* @license lucide-react v0.462.0 - ISC
|
|
373
373
|
*
|
|
374
374
|
* This source code is licensed under the ISC license.
|
|
375
375
|
* See the LICENSE file in the root directory of this source tree.
|
|
376
|
-
*/const
|
|
376
|
+
*/const DS=O("Laptop",[["path",{d:"M20 16V7a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v9m16 0H4m16 0 1.28 2.55a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45L4 16",key:"tarvll"}]]);/**
|
|
377
377
|
* @license lucide-react v0.462.0 - ISC
|
|
378
378
|
*
|
|
379
379
|
* This source code is licensed under the ISC license.
|
|
380
380
|
* See the LICENSE file in the root directory of this source tree.
|
|
381
|
-
*/const
|
|
381
|
+
*/const s1=O("Layers",[["path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z",key:"8b97xw"}],["path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65",key:"dd6zsq"}],["path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65",key:"ep9fru"}]]);/**
|
|
382
382
|
* @license lucide-react v0.462.0 - ISC
|
|
383
383
|
*
|
|
384
384
|
* This source code is licensed under the ISC license.
|
|
@@ -398,7 +398,7 @@ Error generating stack: `+a.message+`
|
|
|
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
|
|
401
|
+
*/const OS=O("LogIn",[["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}],["polyline",{points:"10 17 15 12 10 7",key:"1ail0h"}],["line",{x1:"15",x2:"3",y1:"12",y2:"12",key:"v6grx8"}]]);/**
|
|
402
402
|
* @license lucide-react v0.462.0 - ISC
|
|
403
403
|
*
|
|
404
404
|
* This source code is licensed under the ISC license.
|
|
@@ -408,32 +408,32 @@ Error generating stack: `+a.message+`
|
|
|
408
408
|
*
|
|
409
409
|
* This source code is licensed under the ISC license.
|
|
410
410
|
* See the LICENSE file in the root directory of this source tree.
|
|
411
|
-
*/const
|
|
411
|
+
*/const IS=O("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]);/**
|
|
412
412
|
* @license lucide-react v0.462.0 - ISC
|
|
413
413
|
*
|
|
414
414
|
* This source code is licensed under the ISC license.
|
|
415
415
|
* See the LICENSE file in the root directory of this source tree.
|
|
416
|
-
*/const
|
|
416
|
+
*/const BS=O("Map",[["path",{d:"M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z",key:"169xi5"}],["path",{d:"M15 5.764v15",key:"1pn4in"}],["path",{d:"M9 3.236v15",key:"1uimfh"}]]);/**
|
|
417
417
|
* @license lucide-react v0.462.0 - ISC
|
|
418
418
|
*
|
|
419
419
|
* This source code is licensed under the ISC license.
|
|
420
420
|
* See the LICENSE file in the root directory of this source tree.
|
|
421
|
-
*/const
|
|
421
|
+
*/const FS=O("Maximize2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/**
|
|
422
422
|
* @license lucide-react v0.462.0 - ISC
|
|
423
423
|
*
|
|
424
424
|
* This source code is licensed under the ISC license.
|
|
425
425
|
* See the LICENSE file in the root directory of this source tree.
|
|
426
|
-
*/const
|
|
426
|
+
*/const r1=O("MemoryStick",[["path",{d:"M6 19v-3",key:"1nvgqn"}],["path",{d:"M10 19v-3",key:"iu8nkm"}],["path",{d:"M14 19v-3",key:"kcehxu"}],["path",{d:"M18 19v-3",key:"1vh91z"}],["path",{d:"M8 11V9",key:"63erz4"}],["path",{d:"M16 11V9",key:"fru6f3"}],["path",{d:"M12 11V9",key:"ha00sb"}],["path",{d:"M2 15h20",key:"16ne18"}],["path",{d:"M2 7a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v1.1a2 2 0 0 0 0 3.837V17a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-5.1a2 2 0 0 0 0-3.837Z",key:"lhddv3"}]]);/**
|
|
427
427
|
* @license lucide-react v0.462.0 - ISC
|
|
428
428
|
*
|
|
429
429
|
* This source code is licensed under the ISC license.
|
|
430
430
|
* See the LICENSE file in the root directory of this source tree.
|
|
431
|
-
*/const
|
|
431
|
+
*/const VS=O("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/**
|
|
432
432
|
* @license lucide-react v0.462.0 - ISC
|
|
433
433
|
*
|
|
434
434
|
* This source code is licensed under the ISC license.
|
|
435
435
|
* See the LICENSE file in the root directory of this source tree.
|
|
436
|
-
*/const
|
|
436
|
+
*/const $S=O("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);/**
|
|
437
437
|
* @license lucide-react v0.462.0 - ISC
|
|
438
438
|
*
|
|
439
439
|
* This source code is licensed under the ISC license.
|
|
@@ -453,7 +453,7 @@ Error generating stack: `+a.message+`
|
|
|
453
453
|
*
|
|
454
454
|
* This source code is licensed under the ISC license.
|
|
455
455
|
* See the LICENSE file in the root directory of this source tree.
|
|
456
|
-
*/const
|
|
456
|
+
*/const US=O("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);/**
|
|
457
457
|
* @license lucide-react v0.462.0 - ISC
|
|
458
458
|
*
|
|
459
459
|
* This source code is licensed under the ISC license.
|
|
@@ -468,12 +468,12 @@ Error generating stack: `+a.message+`
|
|
|
468
468
|
*
|
|
469
469
|
* This source code is licensed under the ISC license.
|
|
470
470
|
* See the LICENSE file in the root directory of this source tree.
|
|
471
|
-
*/const
|
|
471
|
+
*/const HS=O("MousePointer2",[["path",{d:"M4.037 4.688a.495.495 0 0 1 .651-.651l16 6.5a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063z",key:"edeuup"}]]);/**
|
|
472
472
|
* @license lucide-react v0.462.0 - ISC
|
|
473
473
|
*
|
|
474
474
|
* This source code is licensed under the ISC license.
|
|
475
475
|
* See the LICENSE file in the root directory of this source tree.
|
|
476
|
-
*/const
|
|
476
|
+
*/const i1=O("MousePointerClick",[["path",{d:"M14 4.1 12 6",key:"ita8i4"}],["path",{d:"m5.1 8-2.9-.8",key:"1go3kf"}],["path",{d:"m6 12-1.9 2",key:"mnht97"}],["path",{d:"M7.2 2.2 8 5.1",key:"1cfko1"}],["path",{d:"M9.037 9.69a.498.498 0 0 1 .653-.653l11 4.5a.5.5 0 0 1-.074.949l-4.349 1.041a1 1 0 0 0-.74.739l-1.04 4.35a.5.5 0 0 1-.95.074z",key:"s0h3yz"}]]);/**
|
|
477
477
|
* @license lucide-react v0.462.0 - ISC
|
|
478
478
|
*
|
|
479
479
|
* This source code is licensed under the ISC license.
|
|
@@ -488,17 +488,17 @@ Error generating stack: `+a.message+`
|
|
|
488
488
|
*
|
|
489
489
|
* This source code is licensed under the ISC license.
|
|
490
490
|
* See the LICENSE file in the root directory of this source tree.
|
|
491
|
-
*/const
|
|
491
|
+
*/const a1=O("Palette",[["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["path",{d:"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z",key:"12rzf8"}]]);/**
|
|
492
492
|
* @license lucide-react v0.462.0 - ISC
|
|
493
493
|
*
|
|
494
494
|
* This source code is licensed under the ISC license.
|
|
495
495
|
* See the LICENSE file in the root directory of this source tree.
|
|
496
|
-
*/const
|
|
496
|
+
*/const WS=O("Paperclip",[["path",{d:"m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48",key:"1u3ebp"}]]);/**
|
|
497
497
|
* @license lucide-react v0.462.0 - ISC
|
|
498
498
|
*
|
|
499
499
|
* This source code is licensed under the ISC license.
|
|
500
500
|
* See the LICENSE file in the root directory of this source tree.
|
|
501
|
-
*/const
|
|
501
|
+
*/const GS=O("PenLine",[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z",key:"1ykcvy"}]]);/**
|
|
502
502
|
* @license lucide-react v0.462.0 - ISC
|
|
503
503
|
*
|
|
504
504
|
* This source code is licensed under the ISC license.
|
|
@@ -528,12 +528,12 @@ Error generating stack: `+a.message+`
|
|
|
528
528
|
*
|
|
529
529
|
* This source code is licensed under the ISC license.
|
|
530
530
|
* See the LICENSE file in the root directory of this source tree.
|
|
531
|
-
*/const
|
|
531
|
+
*/const o1=O("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/**
|
|
532
532
|
* @license lucide-react v0.462.0 - ISC
|
|
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
|
|
536
|
+
*/const KS=O("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"}]]);/**
|
|
537
537
|
* @license lucide-react v0.462.0 - ISC
|
|
538
538
|
*
|
|
539
539
|
* This source code is licensed under the ISC license.
|
|
@@ -548,17 +548,17 @@ 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
|
|
551
|
+
*/const qS=O("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/**
|
|
552
552
|
* @license lucide-react v0.462.0 - ISC
|
|
553
553
|
*
|
|
554
554
|
* This source code is licensed under the ISC license.
|
|
555
555
|
* See the LICENSE file in the root directory of this source tree.
|
|
556
|
-
*/const
|
|
556
|
+
*/const YS=O("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);/**
|
|
557
557
|
* @license lucide-react v0.462.0 - ISC
|
|
558
558
|
*
|
|
559
559
|
* This source code is licensed under the ISC license.
|
|
560
560
|
* See the LICENSE file in the root directory of this source tree.
|
|
561
|
-
*/const
|
|
561
|
+
*/const XS=O("Settings2",[["path",{d:"M20 7h-9",key:"3s1dr2"}],["path",{d:"M14 17H5",key:"gfn3mx"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]);/**
|
|
562
562
|
* @license lucide-react v0.462.0 - ISC
|
|
563
563
|
*
|
|
564
564
|
* This source code is licensed under the ISC license.
|
|
@@ -568,17 +568,17 @@ 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
|
|
571
|
+
*/const QS=O("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
|
|
572
572
|
* @license lucide-react v0.462.0 - ISC
|
|
573
573
|
*
|
|
574
574
|
* This source code is licensed under the ISC license.
|
|
575
575
|
* See the LICENSE file in the root directory of this source tree.
|
|
576
|
-
*/const
|
|
576
|
+
*/const JS=O("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);/**
|
|
577
577
|
* @license lucide-react v0.462.0 - ISC
|
|
578
578
|
*
|
|
579
579
|
* This source code is licensed under the ISC license.
|
|
580
580
|
* See the LICENSE file in the root directory of this source tree.
|
|
581
|
-
*/const
|
|
581
|
+
*/const ZS=O("SlidersHorizontal",[["line",{x1:"21",x2:"14",y1:"4",y2:"4",key:"obuewd"}],["line",{x1:"10",x2:"3",y1:"4",y2:"4",key:"1q6298"}],["line",{x1:"21",x2:"12",y1:"12",y2:"12",key:"1iu8h1"}],["line",{x1:"8",x2:"3",y1:"12",y2:"12",key:"ntss68"}],["line",{x1:"21",x2:"16",y1:"20",y2:"20",key:"14d8ph"}],["line",{x1:"12",x2:"3",y1:"20",y2:"20",key:"m0wm8r"}],["line",{x1:"14",x2:"14",y1:"2",y2:"6",key:"14e1ph"}],["line",{x1:"8",x2:"8",y1:"10",y2:"14",key:"1i6ji0"}],["line",{x1:"16",x2:"16",y1:"18",y2:"22",key:"1lctlv"}]]);/**
|
|
582
582
|
* @license lucide-react v0.462.0 - ISC
|
|
583
583
|
*
|
|
584
584
|
* This source code is licensed under the ISC license.
|
|
@@ -598,7 +598,7 @@ Error generating stack: `+a.message+`
|
|
|
598
598
|
*
|
|
599
599
|
* This source code is licensed under the ISC license.
|
|
600
600
|
* See the LICENSE file in the root directory of this source tree.
|
|
601
|
-
*/const
|
|
601
|
+
*/const l1=O("Tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);/**
|
|
602
602
|
* @license lucide-react v0.462.0 - ISC
|
|
603
603
|
*
|
|
604
604
|
* This source code is licensed under the ISC license.
|
|
@@ -608,12 +608,12 @@ Error generating stack: `+a.message+`
|
|
|
608
608
|
*
|
|
609
609
|
* This source code is licensed under the ISC license.
|
|
610
610
|
* See the LICENSE file in the root directory of this source tree.
|
|
611
|
-
*/const
|
|
611
|
+
*/const e4=O("ToggleLeft",[["rect",{width:"20",height:"12",x:"2",y:"6",rx:"6",ry:"6",key:"f2vt7d"}],["circle",{cx:"8",cy:"12",r:"2",key:"1nvbw3"}]]);/**
|
|
612
612
|
* @license lucide-react v0.462.0 - ISC
|
|
613
613
|
*
|
|
614
614
|
* This source code is licensed under the ISC license.
|
|
615
615
|
* See the LICENSE file in the root directory of this source tree.
|
|
616
|
-
*/const
|
|
616
|
+
*/const t4=O("ToggleRight",[["rect",{width:"20",height:"12",x:"2",y:"6",rx:"6",ry:"6",key:"f2vt7d"}],["circle",{cx:"16",cy:"12",r:"2",key:"4ma0v8"}]]);/**
|
|
617
617
|
* @license lucide-react v0.462.0 - ISC
|
|
618
618
|
*
|
|
619
619
|
* This source code is licensed under the ISC license.
|
|
@@ -628,7 +628,7 @@ Error generating stack: `+a.message+`
|
|
|
628
628
|
*
|
|
629
629
|
* This source code is licensed under the ISC license.
|
|
630
630
|
* See the LICENSE file in the root directory of this source tree.
|
|
631
|
-
*/const
|
|
631
|
+
*/const c1=O("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/**
|
|
632
632
|
* @license lucide-react v0.462.0 - ISC
|
|
633
633
|
*
|
|
634
634
|
* This source code is licensed under the ISC license.
|
|
@@ -638,7 +638,7 @@ Error generating stack: `+a.message+`
|
|
|
638
638
|
*
|
|
639
639
|
* This source code is licensed under the ISC license.
|
|
640
640
|
* See the LICENSE file in the root directory of this source tree.
|
|
641
|
-
*/const
|
|
641
|
+
*/const n4=O("Volume2",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]]);/**
|
|
642
642
|
* @license lucide-react v0.462.0 - ISC
|
|
643
643
|
*
|
|
644
644
|
* This source code is licensed under the ISC license.
|
|
@@ -648,12 +648,12 @@ Error generating stack: `+a.message+`
|
|
|
648
648
|
*
|
|
649
649
|
* This source code is licensed under the ISC license.
|
|
650
650
|
* See the LICENSE file in the root directory of this source tree.
|
|
651
|
-
*/const
|
|
651
|
+
*/const s4=O("Wifi",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]]);/**
|
|
652
652
|
* @license lucide-react v0.462.0 - ISC
|
|
653
653
|
*
|
|
654
654
|
* This source code is licensed under the ISC license.
|
|
655
655
|
* See the LICENSE file in the root directory of this source tree.
|
|
656
|
-
*/const
|
|
656
|
+
*/const r4=O("Workflow",[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]]);/**
|
|
657
657
|
* @license lucide-react v0.462.0 - ISC
|
|
658
658
|
*
|
|
659
659
|
* This source code is licensed under the ISC license.
|
|
@@ -668,19 +668,19 @@ Error generating stack: `+a.message+`
|
|
|
668
668
|
*
|
|
669
669
|
* This source code is licensed under the ISC license.
|
|
670
670
|
* See the LICENSE file in the root directory of this source tree.
|
|
671
|
-
*/const Re=O("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"}]]),u1={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"},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."}}},a4={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"},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."}}},o4={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"},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."}}},l4={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"},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."}}},c4={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"},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."}}},d4={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"},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キーが必要です — 続行するにはキーを更新してください。"}}},u4={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"},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密钥 — 请更新您的密钥以继续。"}}},h4={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"},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."}}},rc={en:u1,tr:a4,de:o4,fr:l4,es:c4,ja:d4,zh:u4,pt:h4},h1=f.createContext({locale:"en",t:u1,setLocale:()=>{}});function p4({children:e}){const t=typeof localStorage<"u"?localStorage.getItem("mustb-lang"):null,[n,s]=f.useState(t&&t in rc?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 f.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 rc&&o!==n){s(o);try{localStorage.setItem("mustb-lang",o)}catch{}}}).catch(()=>{})},[]),r.jsx(h1.Provider,{value:{locale:n,t:rc[n],setLocale:i},children:e})}const pt=()=>f.useContext(h1);function bm(){const e=un(),{t}=pt(),[n,s]=f.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(ee,{children:n==="sleeping"&&r.jsxs(U.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(U.div,{animate:{opacity:[.5,1,.5]},transition:{duration:3,repeat:1/0,ease:"easeInOut"},children:r.jsx(ol,{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(U.button,{onClick:i,disabled:n==="exiting",className:`group relative flex items-center gap-3 px-8 py-4 rounded-2xl
|
|
671
|
+
*/const Re=O("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"}]]),d1={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"},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."}}},i4={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"},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."}}},a4={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"},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."}}},o4={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"},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."}}},l4={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"},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."}}},c4={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"},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キーが必要です — 続行するにはキーを更新してください。"}}},d4={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"},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密钥 — 请更新您的密钥以继续。"}}},u4={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"},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."}}},rc={en:d1,tr:i4,de:a4,fr:o4,es:l4,ja:c4,zh:d4,pt:u4},u1=f.createContext({locale:"en",t:d1,setLocale:()=>{}});function h4({children:e}){const t=typeof localStorage<"u"?localStorage.getItem("mustb-lang"):null,[n,s]=f.useState(t&&t in rc?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 f.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 rc&&o!==n){s(o);try{localStorage.setItem("mustb-lang",o)}catch{}}}).catch(()=>{})},[]),r.jsx(u1.Provider,{value:{locale:n,t:rc[n],setLocale:i},children:e})}const pt=()=>f.useContext(u1);function bm(){const e=un(),{t}=pt(),[n,s]=f.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(ee,{children:n==="sleeping"&&r.jsxs(U.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(U.div,{animate:{opacity:[.5,1,.5]},transition:{duration:3,repeat:1/0,ease:"easeInOut"},children:r.jsx(ol,{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(U.button,{onClick:i,disabled:n==="exiting",className:`group relative flex items-center gap-3 px-8 py-4 rounded-2xl
|
|
672
672
|
bg-orange-500/15 border border-orange-500/35 text-orange-300
|
|
673
673
|
backdrop-blur-md hover:bg-orange-500/25 hover:border-orange-500/60
|
|
674
|
-
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(wS,{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(ee,{children:n==="exiting"&&r.jsx(U.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 p1(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=p1(e[t]))&&(s&&(s+=" "),s+=n)}else for(n in e)e[n]&&(s&&(s+=" "),s+=n);return s}function Ke(){for(var e,t,n=0,s="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=p1(e))&&(s&&(s+=" "),s+=t);return s}const f4={frontier:"⚡ Frontier",gateway:"🌐 Gateway",fast:"🚀 Fast Inference",local:"💻 Local / Offline",open:"🔓 Open Source Cloud",specialist:"🎯 Specialist",regional:"🌏 Regional",enterprise:"🏢 Enterprise",custom:"⚙️ Custom"},m4=["frontier","gateway","fast","local","open","specialist","regional","enterprise","custom"],wm=[{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:"العربية"}],Ja=["Identity","AI Engine","Workspace","Voice","Channels","Finalize"],ic=[{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}],km=[{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 g4({index:e,current:t}){const n=e<t,s=e===t;return r.jsxs("div",{className:"flex items-center",children:[r.jsx("div",{className:Ke("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(Mt,{size:13}):e+1}),e<Ja.length-1&&r.jsx("div",{className:Ke("w-8 h-px transition-colors duration-300",n?"bg-orange-500/50":"bg-white/10")})]})}function x4({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 y4({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(Mt,{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(Re,{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(es,{size:9})," Heavy"]})}function jm({checked:e,onChange:t,label:n,description:s}){return r.jsxs("button",{type:"button",onClick:()=>t(!e),className:Ke("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:Ke("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:Ke("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 v4(){var Dr,Xt;un();const[e,t]=f.useState([]),[n,s]=f.useState([]),[i,a]=f.useState(null),[o,l]=f.useState(!0),[c,d]=f.useState("~/Mustb-Projects"),[u,p]=f.useState(0),[h,m]=f.useState(""),[y,b]=f.useState("en-US"),[v,g]=f.useState("openrouter"),[x,w]=f.useState(""),[j,k]=f.useState(""),[N,S]=f.useState(ic[0].id),[_,A]=f.useState(ic),[P,T]=f.useState(!1),[V,M]=f.useState("http://localhost:11434"),[I,z]=f.useState(""),[R,B]=f.useState(""),[C,E]=f.useState(!1),[L,W]=f.useState(!1),[q,te]=f.useState({}),[se,de]=f.useState({}),[fe,ae]=f.useState({}),[Ze,kt]=f.useState("idle"),[G,X]=f.useState(!1),[zt,Lr]=f.useState(null);f.useEffect(()=>{fetch("/api/setup/providers").then(D=>D.ok?D.json():{providers:[]}).then(D=>{var J;(J=D.providers)!=null&&J.length&&t(D.providers)}).catch(()=>{}).finally(()=>l(!1)),fetch("/api/setup/workspace-default").then(D=>D.ok?D.json():null).then(D=>{D!=null&&D.suggested&&(d(D.suggested),B(D.suggested))}).catch(()=>{})},[]),f.useEffect(()=>{v==="openrouter"&&(T(!0),fetch("/api/openrouter/free-models").then(D=>D.ok?D.json():null).then(D=>{if(D!=null&&D.models&&D.models.length>0){const J=D.models.slice(0,16).map(Oe=>({id:Oe.id,label:Oe.label??Oe.name??Oe.id,desc:Oe.desc??Oe.description??"",free:Oe.id.endsWith(":free")})),Q=new Set(J.map(Oe=>Oe.id)),Ee=ic.filter(Oe=>!Q.has(Oe.id));A([...J,...Ee])}}).catch(()=>{}).finally(()=>T(!1)))},[v]),f.useEffect(()=>{v==="ollama"&&fetch("/api/setup/ollama-models").then(D=>D.ok?D.json():null).then(D=>{D!=null&&D.models&&s(D.models),D!=null&&D.hardware&&a(D.hardware)}).catch(()=>{})},[v]);const Os=v==="ollama",et=e.find(D=>D.id===v),Is=f.useMemo(()=>{const D=x.toLowerCase().trim();return D?e.filter(J=>J.label.toLowerCase().includes(D)||J.description.toLowerCase().includes(D)||J.tags.some(Q=>Q.toLowerCase().includes(D))):e},[e,x]),hl=f.useMemo(()=>{const D={};for(const J of Is)D[J.category]||(D[J.category]=[]),D[J.category].push(J);return D},[Is]),Bs=()=>{switch(u){case 0:return h.trim().length>0;case 1:{if(Os){const D=n.length===0||I.trim().length>0;return V.trim().length>0&&D}return v==="openrouter"?j.trim().length>0&&N.trim().length>0:et!=null&&et.envKeyIsUrl?!0:j.trim().length>0}case 2:return R.trim().length>0;default:return!0}},pl=async()=>{kt("testing");try{(await navigator.mediaDevices.getUserMedia({audio:!0})).getTracks().forEach(J=>J.stop()),kt("granted")}catch{kt("denied")}},aa=async D=>{ae(J=>({...J,[D]:"testing"}));try{const Q=await(await fetch(`/api/channels/${D}/status`)).json().catch(()=>({}));ae(Ee=>({...Ee,[D]:Q.configured?"ok":"fail"}))}catch{ae(J=>({...J,[D]:"fail"}))}},ls=async()=>{X(!0),Lr(null);try{const D={};for(const Ee of km)if(q[Ee.id]){for(const Oe of Ee.fields){const oa=(se[Oe.key]??"").trim();oa&&(D[Oe.key]=oa)}D[`CHANNEL_${Ee.id.toUpperCase()}_ENABLED`]="true"}const J={name:h.trim()||"User",language:y,provider:v,apiKey:Os?V:j,model:Os?I:v==="openrouter"?N:et==null?void 0:et.defaultModel,skills:["browser","terminal","memory","web_search","filesystem","git","vision","input","telegram","analyzer"],mode:"local",workspacePath:R.trim()||c,wakeWord:C,telemetry:L,channels:D};let Q=await fetch("/api/setup/save",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(J)});if(!Q.ok&&Q.status===404&&(Q=await fetch("/api/setup",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(J)})),!Q.ok){const Ee=await Q.json().catch(()=>({}));throw new Error(Ee.error??"Setup failed")}localStorage.setItem("mustb_boot_report","1"),localStorage.setItem("mustb_setup_complete","1"),window.location.href="/app"}catch(D){Lr(D instanceof Error?D.message:"Unknown error"),X(!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:Ja.map((D,J)=>r.jsxs("div",{className:"flex flex-col items-center gap-1",children:[r.jsx(g4,{index:J,current:u}),r.jsx("span",{className:Ke("text-[9px] font-bold uppercase tracking-widest transition-colors",J===u?"text-orange-400":J<u?"text-orange-500/50":"text-gray-700"),children:D})]},J))}),r.jsx(ee,{mode:"wait",children:r.jsxs(U.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 ",u+1," of ",Ja.length]}),r.jsx("h2",{className:"text-xl font-bold text-white mb-5",children:Ja[u]}),u===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:h,onChange:D=>m(D.target.value),onKeyDown:D=>D.key==="Enter"&&Bs()&&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(Xe,{size:14,className:"absolute left-3.5 top-1/2 -translate-y-1/2 text-gray-400 pointer-events-none"}),r.jsx("select",{value:y,onChange:D=>b(D.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:wm.map(D=>r.jsx("option",{value:D.value,className:"bg-[#0d1117] text-white",children:D.label},D.value))}),r.jsx(on,{size:13,className:"absolute right-3.5 top-1/2 -translate-y-1/2 text-gray-400 pointer-events-none rotate-90"})]})]})]}),u===1&&r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"relative",children:[r.jsx(qt,{size:13,className:"absolute left-3 top-1/2 -translate-y-1/2 text-gray-400"}),r.jsx("input",{type:"text",value:x,onChange:D=>w(D.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…"}):m4.map(D=>{const J=hl[D];return J!=null&&J.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:f4[D]}),r.jsx("div",{className:"space-y-1",children:J.map(Q=>r.jsxs("button",{onClick:()=>{g(Q.id),k("")},className:Ke("w-full flex items-center gap-3 px-3 py-2.5 rounded-xl border transition-all text-left",v===Q.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:Ke("w-3 h-3 rounded-full border-2 flex-shrink-0 transition-all",v===Q.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:Q.label}),r.jsx("p",{className:"text-xs text-gray-400 truncate",children:Q.description})]}),r.jsx("div",{className:"flex flex-wrap gap-1 justify-end flex-shrink-0 max-w-[120px]",children:Q.tags.slice(0,2).map(Ee=>r.jsx(x4,{label:Ee},Ee))})]},Q.id))})]},D):null}),!o&&Is.length===0&&r.jsxs("p",{className:"text-center py-6 text-gray-400 text-sm",children:['No providers match "',x,'"']})]}),Os?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:D=>M(D.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(i1,{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(Sn,{size:11,className:"text-orange-400"}),i.cpuCount," CPUs"]}),r.jsxs("span",{className:"flex items-center gap-1.5",children:[r.jsx(Re,{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(D=>r.jsxs("button",{onClick:()=>z(D.modelId),className:Ke("w-full flex items-center gap-3 px-3 py-2.5 rounded-xl border transition-all text-left",I===D.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:Ke("w-3 h-3 rounded-full border-2 flex-shrink-0",I===D.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:D.name}),r.jsx("span",{className:"text-[10px] text-gray-400 font-mono",children:D.params})]}),r.jsx("p",{className:"text-xs text-gray-400 truncate",children:D.description})]}),r.jsxs("div",{className:"flex flex-col items-end gap-1 flex-shrink-0",children:[r.jsx(y4,{fit:D.fit}),r.jsxs("span",{className:"text-[10px] text-gray-400",children:[D.ramGb," GB"]})]})]},D.id))})]}):et?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:et.envKeyIsUrl?"Base URL":`${et.label} API Key`}),r.jsx("input",{type:et.envKeyIsUrl?"url":"password",value:j,onChange:D=>k(D.target.value),placeholder:et.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"}),P&&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:_.map(D=>r.jsxs("button",{type:"button",onClick:()=>S(D.id),className:Ke("w-full flex items-start gap-3 px-3 py-2.5 rounded-xl border transition-all text-left",N===D.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:Ke("w-3 h-3 rounded-full border-2 flex-shrink-0 mt-0.5",N===D.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:D.label}),D.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:D.desc})]})]},D.id))}),!N&&r.jsxs("p",{className:"text-xs text-orange-400 flex items-center gap-1.5",children:[r.jsx(es,{size:11})," Select a model to continue"]})]}),v!=="openrouter"&&et.latestModels.length>0&&r.jsx("div",{className:"flex flex-wrap gap-1.5 pt-1",children:et.latestModels.slice(0,4).map(D=>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:D},D))}),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]}),u===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(TS,{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:R,onChange:D=>B(D.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(JS,{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."})]})]}),u===3&&r.jsxs("div",{className:"space-y-4",children:[r.jsx(jm,{checked:C,onChange:E,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:[Ze==="idle"&&"Click to verify your browser can access the microphone.",Ze==="testing"&&"Requesting permission…",Ze==="granted"&&"Microphone access granted ✓",Ze==="denied"&&"Permission denied — check browser settings."]})]}),r.jsx("button",{onClick:pl,disabled:Ze==="testing",className:Ke("flex items-center gap-2 px-4 py-2 rounded-xl text-xs font-bold transition-all shrink-0",Ze==="granted"?"bg-green-500/10 border border-green-500/20 text-green-400 cursor-default":Ze==="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:Ze==="granted"?r.jsxs(r.Fragment,{children:[r.jsx(Mt,{size:12})," Granted"]}):Ze==="denied"?r.jsxs(r.Fragment,{children:[r.jsx(yh,{size:12})," Denied"]}):r.jsxs(r.Fragment,{children:[r.jsx(Nr,{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."})]}),u===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."}),km.map(D=>{const J=!!q[D.id];return r.jsxs("div",{className:"rounded-xl border transition-all overflow-hidden",style:{borderColor:J?"rgba(234,88,12,0.35)":"rgba(255,255,255,0.07)",background:J?"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:()=>te(Q=>({...Q,[D.id]:!J})),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:D.emoji}),D.label,r.jsx("span",{className:"text-[10px] text-gray-600 font-normal",children:D.hint}),fe[D.id]==="ok"&&r.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-green-400 flex-shrink-0"}),fe[D.id]==="fail"&&r.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-red-400 flex-shrink-0"}),fe[D.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:J?"#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:J?"calc(100% - 14px)":"2px"}})})]}),J&&D.fields.some(Q=>(se[Q.key]??"").trim())&&r.jsx("button",{onClick:Q=>{Q.stopPropagation(),aa(D.id)},disabled:fe[D.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:fe[D.id]==="testing"?"…":"Test"})]}),J&&r.jsx("div",{className:"px-4 pb-3 space-y-2 border-t",style:{borderColor:"rgba(234,88,12,0.15)"},children:D.fields.map(Q=>r.jsxs("div",{children:[r.jsx("label",{className:"block text-[10px] font-semibold text-gray-500 uppercase tracking-widest mb-1 mt-2",children:Q.label}),r.jsx("input",{type:Q.secret?"password":"text",value:se[Q.key]??"",onChange:Ee=>de(Oe=>({...Oe,[Q.key]:Ee.target.value})),placeholder:Q.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)"}})]},Q.key))})]},D.id)})]}),u===5&&r.jsxs("div",{className:"space-y-5",children:[r.jsx(jm,{checked:L,onChange:W,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:h||"—"},{label:"Language",value:((Dr=wm.find(D=>D.value===y))==null?void 0:Dr.label)??y},{label:"Provider",value:((Xt=e.find(D=>D.id===v))==null?void 0:Xt.label)??v},{label:"Workspace",value:(R||c).replace(/^.*\/([^/]+\/[^/]+)$/,"…/$1")},{label:"Wake Word",value:C?"Enabled":"Disabled"}].map(D=>r.jsxs("div",{className:"flex items-center justify-between text-xs",children:[r.jsx("span",{className:"text-gray-400",children:D.label}),r.jsx("span",{className:"text-gray-300 font-mono truncate max-w-[200px]",children:D.value})]},D.label))]}),zt&&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:zt}),r.jsx("button",{onClick:ls,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"]})})]})]},u)}),u<5&&r.jsxs("div",{className:"flex items-center justify-between mt-5",children:[r.jsxs("button",{onClick:()=>p(D=>D-1),disabled:u===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(mm,{size:16})," Back"]}),r.jsxs("button",{onClick:()=>p(D=>D+1),disabled:!Bs(),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(on,{size:16})]})]}),u===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(mm,{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 dn=Object.create(null);dn.open="0";dn.close="1";dn.ping="2";dn.pong="3";dn.message="4";dn.upgrade="5";dn.noop="6";const Za=Object.create(null);Object.keys(dn).forEach(e=>{Za[dn[e]]=e});const Td={type:"error",data:"parser error"},f1=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",m1=typeof ArrayBuffer=="function",g1=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,jh=({type:e,data:t},n,s)=>f1&&t instanceof Blob?n?s(t):Nm(t,s):m1&&(t instanceof ArrayBuffer||g1(t))?n?s(t):Nm(new Blob([t]),s):s(dn[e]+(t||"")),Nm=(e,t)=>{const n=new FileReader;return n.onload=function(){const s=n.result.split(",")[1];t("b"+(s||""))},n.readAsDataURL(e)};function Sm(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let ac;function b4(e,t){if(f1&&e.data instanceof Blob)return e.data.arrayBuffer().then(Sm).then(t);if(m1&&(e.data instanceof ArrayBuffer||g1(e.data)))return t(Sm(e.data));jh(e,!1,n=>{ac||(ac=new TextEncoder),t(ac.encode(n))})}const Cm="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ti=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<Cm.length;e++)ti[Cm.charCodeAt(e)]=e;const w4=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 d=new ArrayBuffer(t),u=new Uint8Array(d);for(s=0;s<n;s+=4)a=ti[e.charCodeAt(s)],o=ti[e.charCodeAt(s+1)],l=ti[e.charCodeAt(s+2)],c=ti[e.charCodeAt(s+3)],u[i++]=a<<2|o>>4,u[i++]=(o&15)<<4|l>>2,u[i++]=(l&3)<<6|c&63;return d},k4=typeof ArrayBuffer=="function",Nh=(e,t)=>{if(typeof e!="string")return{type:"message",data:x1(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:j4(e.substring(1),t)}:Za[n]?e.length>1?{type:Za[n],data:e.substring(1)}:{type:Za[n]}:Td},j4=(e,t)=>{if(k4){const n=w4(e);return x1(n,t)}else return{base64:!0,data:e}},x1=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},y1="",N4=(e,t)=>{const n=e.length,s=new Array(n);let i=0;e.forEach((a,o)=>{jh(a,!1,l=>{s[o]=l,++i===n&&t(s.join(y1))})})},S4=(e,t)=>{const n=e.split(y1),s=[];for(let i=0;i<n.length;i++){const a=Nh(n[i],t);if(s.push(a),a.type==="error")break}return s};function C4(){return new TransformStream({transform(e,t){b4(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 oc;function Ma(e){return e.reduce((t,n)=>t+n.length,0)}function za(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 _4(e,t){oc||(oc=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(Ma(n)<1)break;const c=za(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(Ma(n)<2)break;const c=za(n,2);i=new DataView(c.buffer,c.byteOffset,c.length).getUint16(0),s=3}else if(s===2){if(Ma(n)<8)break;const c=za(n,8),d=new DataView(c.buffer,c.byteOffset,c.length),u=d.getUint32(0);if(u>Math.pow(2,21)-1){l.enqueue(Td);break}i=u*Math.pow(2,32)+d.getUint32(4),s=3}else{if(Ma(n)<i)break;const c=za(n,i);l.enqueue(Nh(a?c:oc.decode(c),t)),s=0}if(i===0||i>e){l.enqueue(Td);break}}}})}const v1=4;function ze(e){if(e)return E4(e)}function E4(e){for(var t in ze.prototype)e[t]=ze.prototype[t];return e}ze.prototype.on=ze.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};ze.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};ze.prototype.off=ze.prototype.removeListener=ze.prototype.removeAllListeners=ze.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};ze.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};ze.prototype.emitReserved=ze.prototype.emit;ze.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};ze.prototype.hasListeners=function(e){return!!this.listeners(e).length};const dl=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")(),T4="arraybuffer";function b1(e,...t){return t.reduce((n,s)=>(e.hasOwnProperty(s)&&(n[s]=e[s]),n),{})}const P4=_t.setTimeout,A4=_t.clearTimeout;function ul(e,t){t.useNativeTimers?(e.setTimeoutFn=P4.bind(_t),e.clearTimeoutFn=A4.bind(_t)):(e.setTimeoutFn=_t.setTimeout.bind(_t),e.clearTimeoutFn=_t.clearTimeout.bind(_t))}const M4=1.33;function z4(e){return typeof e=="string"?R4(e):Math.ceil((e.byteLength||e.size)*M4)}function R4(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 w1(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function L4(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function D4(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 O4 extends Error{constructor(t,n,s){super(t),this.description=n,this.context=s,this.type="TransportError"}}class Sh extends ze{constructor(t){super(),this.writable=!1,ul(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 O4(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=Nh(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=L4(t);return n.length?"?"+n:""}}class I4 extends Sh{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)};S4(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,N4(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]=w1()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let k1=!1;try{k1=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const B4=k1;function F4(){}class V4 extends I4{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 an extends ze{constructor(t,n,s){super(),this.createRequest=t,ul(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=b1(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=an.requestsCount++,an.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=F4,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete an.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()}}an.requestsCount=0;an.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",_m);else if(typeof addEventListener=="function"){const e="onpagehide"in _t?"pagehide":"unload";addEventListener(e,_m,!1)}}function _m(){for(let e in an.requests)an.requests.hasOwnProperty(e)&&an.requests[e].abort()}const $4=function(){const e=j1({xdomain:!1});return e&&e.responseType!==null}();class U4 extends V4{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=$4&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new an(j1,this.uri(),t)}}function j1(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||B4))return new XMLHttpRequest}catch{}if(!t)try{return new _t[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const N1=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class H4 extends Sh{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,s=N1?{}:b1(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;jh(s,this.supportsBinary,a=>{try{this.doWrite(s,a)}catch{}i&&dl(()=>{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]=w1()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const lc=_t.WebSocket||_t.MozWebSocket;class W4 extends H4{createSocket(t,n,s){return N1?new lc(t,n,s):n?new lc(t,n):new lc(t)}doWrite(t,n){this.ws.send(n)}}class G4 extends Sh{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=_4(Number.MAX_SAFE_INTEGER,this.socket.binaryType),s=t.readable.pipeThrough(n).getReader(),i=C4();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&&dl(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const K4={websocket:W4,webtransport:G4,polling:U4},q4=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Y4=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Pd(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=q4.exec(e||""),a={},o=14;for(;o--;)a[Y4[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=X4(a,a.path),a.queryKey=Q4(a,a.query),a}function X4(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 Q4(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(s,i,a){i&&(n[i]=a)}),n}const Ad=typeof addEventListener=="function"&&typeof removeEventListener=="function",eo=[];Ad&&addEventListener("offline",()=>{eo.forEach(e=>e())},!1);class Yn extends ze{constructor(t,n){if(super(),this.binaryType=T4,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=Pd(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=Pd(n.host).host);ul(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=D4(this.opts.query)),Ad&&(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"})},eo.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=v1,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&&Yn.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",Yn.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+=z4(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,dl(()=>{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(Yn.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(),Ad&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const s=eo.indexOf(this._offlineEventListener);s!==-1&&eo.splice(s,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}Yn.protocol=v1;class J4 extends Yn{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;Yn.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;Yn.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{s||this.readyState!=="closed"&&(u(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const h=new Error("probe error");h.transport=n.name,this.emitReserved("upgradeError",h)}}))};function a(){s||(s=!0,u(),n.close(),n=null)}const o=p=>{const h=new Error("probe error: "+p);h.transport=n.name,a(),this.emitReserved("upgradeError",h)};function l(){o("transport closed")}function c(){o("socket closed")}function d(p){n&&p.name!==n.name&&a()}const u=()=>{n.removeListener("open",i),n.removeListener("error",o),n.removeListener("close",l),this.off("close",c),this.off("upgrading",d)};n.once("open",i),n.once("error",o),n.once("close",l),this.once("close",c),this.once("upgrading",d),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 Z4=class extends J4{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=>K4[i]).filter(i=>!!i)),super(t,s)}};function e3(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=Pd(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 t3=typeof ArrayBuffer=="function",n3=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,S1=Object.prototype.toString,s3=typeof Blob=="function"||typeof Blob<"u"&&S1.call(Blob)==="[object BlobConstructor]",r3=typeof File=="function"||typeof File<"u"&&S1.call(File)==="[object FileConstructor]";function Ch(e){return t3&&(e instanceof ArrayBuffer||n3(e))||s3&&e instanceof Blob||r3&&e instanceof File}function to(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,s=e.length;n<s;n++)if(to(e[n]))return!0;return!1}if(Ch(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return to(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&to(e[n]))return!0;return!1}function i3(e){const t=[],n=e.data,s=e;return s.data=Md(n,t),s.attachments=t.length,{packet:s,buffers:t}}function Md(e,t){if(!e)return e;if(Ch(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]=Md(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]=Md(e[s],t));return n}return e}function a3(e,t){return e.data=zd(e.data,t),delete e.attachments,e}function zd(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]=zd(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=zd(e[n],t));return e}const o3=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var ie;(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"})(ie||(ie={}));class l3{constructor(t){this.replacer=t}encode(t){return(t.type===ie.EVENT||t.type===ie.ACK)&&to(t)?this.encodeAsBinary({type:t.type===ie.EVENT?ie.BINARY_EVENT:ie.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===ie.BINARY_EVENT||t.type===ie.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=i3(t),s=this.encodeAsString(n.packet),i=n.buffers;return i.unshift(s),i}}class _h extends ze{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===ie.BINARY_EVENT;s||n.type===ie.BINARY_ACK?(n.type=s?ie.EVENT:ie.ACK,this.reconstructor=new c3(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(Ch(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(ie[s.type]===void 0)throw new Error("unknown packet type "+s.type);if(s.type===ie.BINARY_EVENT||s.type===ie.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(_h.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 ie.CONNECT:return Em(n);case ie.DISCONNECT:return n===void 0;case ie.CONNECT_ERROR:return typeof n=="string"||Em(n);case ie.EVENT:case ie.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&o3.indexOf(n[0])===-1);case ie.ACK:case ie.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class c3{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=a3(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}function Em(e){return Object.prototype.toString.call(e)==="[object Object]"}const d3=Object.freeze(Object.defineProperty({__proto__:null,Decoder:_h,Encoder:l3,get PacketType(){return ie}},Symbol.toStringTag,{value:"Module"}));function $t(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const u3=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class C1 extends ze{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=[$t(t,"open",this.onopen.bind(this)),$t(t,"packet",this.onpacket.bind(this)),$t(t,"error",this.onerror.bind(this)),$t(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(u3.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:ie.EVENT,data:n};if(o.options={},o.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const u=this.ids++,p=n.pop();this._registerAckCallback(u,p),o.id=u}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:ie.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 ie.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 ie.EVENT:case ie.BINARY_EVENT:this.onevent(t);break;case ie.ACK:case ie.BINARY_ACK:this.onack(t);break;case ie.DISCONNECT:this.ondisconnect();break;case ie.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:ie.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:ie.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 Rr(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}Rr.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};Rr.prototype.reset=function(){this.attempts=0};Rr.prototype.setMin=function(e){this.ms=e};Rr.prototype.setMax=function(e){this.max=e};Rr.prototype.setJitter=function(e){this.jitter=e};class Rd extends ze{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,ul(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 Rr({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||d3;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 Z4(this.uri,this.opts);const n=this.engine,s=this;this._readyState="opening",this.skipReconnect=!1;const i=$t(n,"open",function(){s.onopen(),t&&t()}),a=l=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",l),t?t(l):this.maybeReconnectOnOpen()},o=$t(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($t(t,"ping",this.onping.bind(this)),$t(t,"data",this.ondata.bind(this)),$t(t,"error",this.onerror.bind(this)),$t(t,"close",this.onclose.bind(this)),$t(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){dl(()=>{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 C1(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 Gr={};function yi(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=e3(e,t.path||"/socket.io"),s=n.source,i=n.id,a=n.path,o=Gr[i]&&a in Gr[i].nsps,l=t.forceNew||t["force new connection"]||t.multiplex===!1||o;let c;return l?c=new Rd(s,t):(Gr[i]||(Gr[i]=new Rd(s,t)),c=Gr[i]),n.query&&!t.query&&(t.query=n.queryKey),c.socket(n.path,t)}Object.assign(yi,{Manager:Rd,Socket:C1,io:yi,connect:yi});const h3={};let us=null;function p3(){const e=h3;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 us||(us=yi(p3(),{transports:["websocket","polling"],withCredentials:!0,reconnection:!0,reconnectionAttempts:1/0,reconnectionDelay:1e3,reconnectionDelayMax:5e3,randomizationFactor:.3,timeout:1e4}),us.on("agentUpdate",e=>{try{e!=null&&window.dispatchEvent(new CustomEvent("mustb:agentUpdate",{detail:e}))}catch{}}),us.on("connect",()=>{window.dispatchEvent(new CustomEvent("mustb:connected"))}),us.on("disconnect",e=>{window.dispatchEvent(new CustomEvent("mustb:disconnected",{detail:{reason:e}}))}),us.io.on("reconnect",e=>{window.dispatchEvent(new CustomEvent("mustb:reconnected",{detail:{attemptNumber:e}}))})),us}const f3={};let ni=null;const m3=(()=>{const e=f3,t=(e==null?void 0:e.VITE_BACKEND_URL)??"";return t&&!t.includes(window.location.hostname)?t.replace(/\/$/,""):""})();function _1(e){return e.startsWith("http")?e:`${m3}${e}`}async function g3(){if(ni)return ni;try{const e=await fetch(_1("/api/auth/local"));if(e.ok)return ni=(await e.json()).token??null,ni}catch{}return null}async function $(e,t={},{retries:n=3,retryDelay:s=800}={}){const i=await g3(),a={"Content-Type":"application/json",...t.headers};i&&(a.Authorization=`Bearer ${i}`);const o=_1(e);let l;for(let c=1;c<=n;c++)try{const d=await fetch(o,{...t,headers:a});return d.status===401&&(ni=null,window.dispatchEvent(new CustomEvent("mustb:401",{detail:{url:o}}))),d}catch(d){l=d,c<n&&await new Promise(u=>setTimeout(u,s*c))}throw window.dispatchEvent(new CustomEvent("mustb:offline",{detail:{url:o}})),l}function Tm(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 cc(e){return[...e].sort((t,n)=>Tm(n.id)-Tm(t.id))}function x3(){const{t:e}=pt(),[t,n]=f.useState(!1),[s,i]=f.useState(()=>localStorage.getItem("mustb_active_model")??"Loading…"),[a,o]=f.useState([]),l=f.useRef(null);f.useEffect(()=>{const h=localStorage.getItem("mustb_active_model");h&&h!=="Loading…"&&$("/api/settings/model",{method:"POST",body:JSON.stringify({model:h})}).catch(()=>{}),$("/api/setup/status").then(m=>m.ok?m.json():null).then(m=>{if(!m)return;const y=localStorage.getItem("mustb_active_model");m.activeModel&&(!y||y==="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(cc(x))}).catch(()=>{}):$("/api/providers/openrouter/models").then(v=>v.ok?v.json():{}).then(v=>{const g=cc((v.free??[]).map(j=>({id:j.id,name:j.name??j.id,free:!0}))),x=cc((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(()=>{})},[]),f.useEffect(()=>{if(!t)return;const h=m=>{l.current&&!l.current.contains(m.target)&&n(!1)};return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[t]);const c=async h=>{i(h),localStorage.setItem("mustb_active_model",h),n(!1),await $("/api/settings/model",{method:"POST",body:JSON.stringify({model:h})}).catch(()=>{})},d=a.filter(h=>h.free),u=a.filter(h=>!h.free),p=s.length>28?s.slice(0,26)+"…":s;return r.jsxs("div",{ref:l,className:"relative",children:[r.jsxs("button",{onClick:()=>n(h=>!h),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(na,{size:10,className:`transition-transform duration-200 shrink-0 text-white/30 ${t?"rotate-180":""}`})]}),r.jsx(ee,{children:t&&r.jsxs(U.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:[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-emerald-500/80",children:"Free"}),d.slice(0,5).map(h=>r.jsxs("button",{onClick:()=>c(h.id),className:`w-full flex items-center gap-2 px-2.5 py-2 rounded-lg text-left transition-colors ${s===h.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===h.id?"bg-orange-500":"bg-emerald-400"}`}),r.jsx("span",{className:"text-[12px] font-medium truncate",children:h.name}),s===h.id&&r.jsx("span",{className:"ml-auto text-[9px] font-semibold text-orange-400 shrink-0",children:"active"})]},h.id))]}),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-orange-400/80",children:"Pro"}),u.map(h=>r.jsxs("button",{onClick:()=>c(h.id),className:`w-full flex items-center gap-2 px-2.5 py-2 rounded-lg text-left transition-colors ${s===h.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===h.id?"bg-orange-500":"bg-orange-300"}`}),r.jsx("span",{className:"text-[12px] font-medium truncate",children:h.name}),s===h.id&&r.jsx("span",{className:"ml-auto text-[9px] font-semibold text-orange-400 shrink-0",children:"active"})]},h.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(hi,{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(bh,{size:11}),e.systemHealth.moreModels]})})]})})]})}function gs(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?gs(n):JSON.stringify(e)}return String(e)}function y3(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)??gs(t.step)}`}case"stepFinish":{if(t.status==="error")return`✗ ${gs(t.error)}`;const n=t.step,s=t.result!==void 0?gs(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=gs(t.action),s=t.reason?` — ${gs(t.reason).slice(0,120)}`:"";return`⟳ Repair: ${n}${s}`}default:return null}}function v3(e){return new Promise((t,n)=>{const s=new FileReader;s.onload=()=>t(s.result),s.onerror=n,s.readAsDataURL(e)})}function b3({lang:e,code:t}){const[n,s]=f.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(Mt,{size:10,className:"text-orange-400"}),r.jsx("span",{className:"text-orange-400",children:"Copied"})]}):r.jsxs(r.Fragment,{children:[r.jsx(Wi,{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 Us(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(f.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 w3({text:e,dark:t=!1}){const n=t?"text-orange-50":"text-[#3d1a06]",s=[],i=e.split(`
|
|
675
|
-
`);let a=0,o=0;const l=()=>`md-${o++}`;for(;a<i.length;){const c=i[a],d=c.match(/^```(\w*)/);if(d){const y=d[1]??"",b=[];for(a++;a<i.length&&!i[a].startsWith("```");)b.push(i[a]),a++;a<i.length&&a++,s.push(r.jsx(
|
|
676
|
-
`)},l()));continue}const u=c.match(/^### (.+)/);if(u){s.push(r.jsx("h3",{className:`text-sm font-bold mt-4 mb-1 ${n}`,children:Us(u[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:Us(p[1],l())},l())),a++;continue}const h=c.match(/^# (.+)/);if(h){s.push(r.jsx("h1",{className:`text-lg font-bold mt-6 mb-2 ${n}`,children:Us(h[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 y=[];for(;a<i.length&&i[a].match(/^[-*•] /);)y.push(i[a].replace(/^[-*•] /,"")),a++;s.push(r.jsx("ul",{className:"my-2 space-y-1.5 pl-1",children:y.map((b,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:Us(b,`ul-${v}`)})]},v))},l()));continue}if(c.match(/^\d+\. /)){const y=[];for(;a<i.length&&i[a].match(/^\d+\. /);)y.push(i[a].replace(/^\d+\. /,"")),a++;s.push(r.jsx("ol",{className:"my-2 space-y-1.5 pl-1",children:y.map((b,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:Us(b,`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:Us(m.join(" "),`p-${o}`)},l()))}return r.jsx("div",{children:s})}function k3(){const[e,t]=f.useState(0);f.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 j3({workflow:e,onDismiss:t}){const[n,s]=f.useState("idle"),[i,a]=f.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(U.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(Je,{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(Qy,{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 N3({src:e,onClose:t}){const[n,s]=f.useState(!1);f.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(Mt,{size:14,className:"text-green-400"}):r.jsx(Wi,{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(xi,{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(st,{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 S3 extends f.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 Pm=[{id:"terminal",label:"Terminal",Icon:Ps},{id:"browser",label:"Browser",Icon:Xe},{id:"image-gen",label:"Görsel Üret",Icon:o1},{id:"web-search",label:"Web Search",Icon:qt},{id:"file-manager",label:"Files",Icon:os},{id:"code",label:"Code",Icon:cn},{id:"screen-sense",label:"Ekranı Gör",Icon:vh}];function C3({onSend:e,onStop:t,disabled:n}){const{t:s}=pt(),[i,a]=f.useState(""),[o,l]=f.useState(!1),[c,d]=f.useState(""),[u,p]=f.useState([]),[h,m]=f.useState([]),[y,b]=f.useState(!1),v=f.useRef(null),g=f.useRef(!1),x=f.useRef(null),w=f.useRef(null),j=typeof window<"u"&&!!(window.SpeechRecognition||window.webkitSpeechRecognition),k=()=>{const z=window.SpeechRecognition||window.webkitSpeechRecognition;if(!z)return;const R=new z;R.continuous=!0,R.interimResults=!0,R.lang="tr-TR",R.onresult=B=>{let C="",E="";for(let L=B.resultIndex;L<B.results.length;L++)B.results[L].isFinal?C+=B.results[L][0].transcript:E+=B.results[L][0].transcript;C?(a(L=>(L.trim()?L.trimEnd()+" ":"")+C.trim()),d("")):d(E)},R.onend=()=>{d(""),g.current?setTimeout(k,150):(l(!1),v.current=null)},R.onerror=B=>{B.error!=="no-speech"&&l(!1),d(""),g.current&&B.error!=="not-allowed"&&setTimeout(k,500)},v.current=R;try{R.start()}catch{}},N=()=>{var z;o?(g.current=!1,(z=v.current)==null||z.stop(),d("")):(g.current=!0,l(!0),k())},S=z=>{p(R=>[...R,...Array.from(z)])},_=z=>{const R=Array.from(z.clipboardData.files);R.length&&(z.preventDefault(),S(R))},A=z=>{z.preventDefault(),S(z.dataTransfer.files)},P=z=>p(R=>R.filter((B,C)=>C!==z));f.useEffect(()=>{if(!y)return;const z=R=>{w.current&&!w.current.contains(R.target)&&b(!1)};return document.addEventListener("mousedown",z),()=>document.removeEventListener("mousedown",z)},[y]);const T=async()=>{try{const z=await navigator.mediaDevices.getDisplayMedia({video:!0}),R=document.createElement("video");R.srcObject=z,R.muted=!0,await new Promise(C=>{R.onloadedmetadata=()=>{R.play(),C()}}),await new Promise(C=>setTimeout(C,120));const B=document.createElement("canvas");B.width=R.videoWidth,B.height=R.videoHeight,B.getContext("2d").drawImage(R,0,0),z.getTracks().forEach(C=>C.stop()),B.toBlob(C=>{if(!C)return;const E=new File([C],`ekran-${Date.now()}.png`,{type:"image/png"});S([E]),a(L=>L.trim()?L:"Bu ekranı analiz et ve ne gördüğünü açıkla."),pe.success("Ekran yakalandı — göndermek için ▶ basın.")},"image/png",.9)}catch(z){(z==null?void 0:z.name)!=="NotAllowedError"&&pe.error("Ekran yakalanamadı.")}},V=z=>{if(z==="screen-sense"){T(),b(!1);return}m(R=>R.includes(z)?R.filter(B=>B!==z):[...R,z])},M=()=>{var B;const z=i.trim();if(!z||n)return;o&&(g.current=!1,(B=v.current)==null||B.stop(),d(""));const R=[...u];a(""),p([]),e(z,h.length>0?h:void 0,R.length>0?R:void 0)};f.useEffect(()=>{x.current&&(x.current.style.height="auto",x.current.style.height=`${Math.min(x.current.scrollHeight,160)}px`)},[i]),f.useEffect(()=>{const z=R=>{var C;const B=((C=R.detail)==null?void 0:C.text)??"";a(B),setTimeout(()=>{var E;return(E=x.current)==null?void 0:E.focus()},60)};return window.addEventListener("mustb:prefill",z),()=>window.removeEventListener("mustb:prefill",z)},[]);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:_,onDrop:A,onDragOver:z=>z.preventDefault(),children:[u.length>0&&r.jsx("div",{className:"flex flex-wrap gap-2 px-1",children:u.map((z,R)=>r.jsxs("div",{className:"relative group w-12 h-12",children:[z.type.startsWith("image/")?r.jsx("img",{src:URL.createObjectURL(z),alt:z.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(Yt,{size:16,className:"text-orange-400"})}),r.jsx("button",{onClick:()=>P(R),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(st,{size:9})})]},R))}),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:()=>b(z=>!z),title:"Araçlar",className:`p-2 rounded-full transition-all ${y||h.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(kh,{size:16})}),r.jsx(ee,{children:y&&r.jsxs(U.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"}),Pm.map(({id:z,label:R,Icon:B})=>{const C=h.includes(z);return r.jsxs("button",{onClick:()=>V(z),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:R}),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:"✓"})]},z)})]})}),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(GS,{size:16}),r.jsx("input",{type:"file",multiple:!0,className:"hidden",onChange:z=>z.target.files&&S(z.target.files)})]})]}),r.jsx("textarea",{ref:x,value:i,onChange:z=>a(z.target.value),onKeyDown:z=>{z.key==="Enter"&&!z.shiftKey&&(z.preventDefault(),M())},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(kS,{size:17,className:"animate-pulse"}):r.jsx(Nr,{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(wh,{size:14})}):r.jsx("button",{onClick:M,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(YS,{size:16})})]})]}),r.jsxs("div",{className:"flex items-center justify-between gap-2",children:[h.length>0?r.jsx("div",{className:"flex flex-wrap gap-1.5 flex-1",children:h.map(z=>{const R=Pm.find(E=>E.id===z);if(!R)return null;const{Icon:B,label:C}=R;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(z),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(st,{size:9})})]},z)})}):r.jsx("div",{className:"flex-1"}),r.jsx(x3,{})]})]})})}function dc(e){return`mustb_chat_turns_${e}`}function _3(){const{t:e,setLocale:t}=pt(),n=f.useRef(e);f.useEffect(()=>{n.current=e},[e]);const[s]=m2(),i=un(),a=s.get("chat")??"default",o=f.useRef(null),[l,c]=f.useState(null),[d,u]=f.useState(null),[p,h]=f.useState(""),[m,y]=f.useState(null),[b,v]=f.useState(()=>{try{const M=localStorage.getItem(dc(a));if(M)return JSON.parse(M)}catch{}return[]}),g=f.useRef(null),x=f.useRef(null),w=f.useRef(a),[j,k]=f.useState(!1),[N,S]=f.useState(null),_=b.some(M=>M.kind==="assistant"&&M.status==="pending");f.useEffect(()=>{w.current=a;try{const M=localStorage.getItem(dc(a));v(M?JSON.parse(M):[])}catch{v([])}g.current=null},[a]),f.useEffect(()=>{if(a==="default"||!o.current)return;const M=o.current;o.current=null,setTimeout(()=>T(M.text,M.tools,M.files),0)},[a]),f.useEffect(()=>{const M=at();return M.on("agentUpdate",I=>{const{type:z,...R}=I;if(z==="memorySearch")return;if(z==="planStart"){const E=`asst-${Date.now()}-${Math.random().toString(36).slice(2)}`;g.current=E,v(L=>[...L,{id:E,kind:"assistant",content:"",thoughts:[],status:"pending"}]);return}if(z==="finalAnswer"){const E=g.current;if(!E)return;v(L=>L.map(W=>W.id===E?{...W,content:gs(R.answer??"Done.")}:W));return}if(z==="planFinish"){k(!1);const E=g.current;if(!E)return;const L=R.status==="failed"?"error":"done",W=R.status==="completed"?{goal:String(R.goal??""),answer:String(R.answer??""),steps:R.steps??[]}:void 0;v(q=>q.map(te=>te.id===E?{...te,status:L,...W?{workflow:W}:{}}:te)),g.current=null;return}if(z==="professionResearched"){const E=String(R.profession??"");if(!E)return;const L=n.current.chat.professionAck.replace("{profession}",E);v(W=>[...W,{id:`prof-ack-${Date.now()}`,kind:"assistant",content:L,thoughts:[],status:"done"}]);return}const B=y3(z,R);if(!B)return;const C=g.current;C&&v(E=>E.map(L=>L.id===C?{...L,thoughts:[...L.thoughts,B]}:L))}),()=>{M.off("agentUpdate")}},[]),f.useEffect(()=>{var M;(M=x.current)==null||M.scrollIntoView({behavior:"smooth"})},[b]),f.useEffect(()=>{const M=I=>{var C;const z=(C=I.detail)==null?void 0:C.skill;if(!z)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":""}[z]??`Run skill "${z}": `;window.dispatchEvent(new CustomEvent("mustb:prefill",{detail:{text:B}}))};return window.addEventListener("mustb:invoke-skill",M),()=>window.removeEventListener("mustb:invoke-skill",M)},[]),f.useEffect(()=>{if(w.current===a)try{localStorage.setItem(dc(a),JSON.stringify(b))}catch{}},[b,a]),f.useEffect(()=>{const M=b[b.length-1];if(!M||M.kind!=="assistant"||M.status!=="done"||!M.content)return;const I=[...b].reverse().find(R=>R.kind==="user");if(!I)return;const z=`Q: ${I.content}
|
|
677
|
-
A: ${M.content.slice(0,400)}`;fetch("/api/memory/ltm/semantic",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:z,tags:["chat","autosave"]})}).catch(()=>{})},[b.length]);const A=M=>{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"]],z={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(M)){t(C);const E=z[C]??z.en;return v(L=>[...L,{id:`cfg-lang-${Date.now()}`,kind:"assistant",content:E,thoughts:[],status:"done"}]),!0}const R=[[/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 R)if(B.test(M))return $("/api/settings/model",{method:"POST",body:JSON.stringify({model:C})}).catch(()=>{}),v(E=>[...E,{id:`cfg-model-${Date.now()}`,kind:"assistant",content:e.chat.settingsAck,thoughts:[],status:"done"}]),!0;return!1},P=M=>{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[z,R]of I)if(z.test(M)){$("/api/memory/profession-research",{method:"POST",body:JSON.stringify({profession:R,userMessage:M})}).catch(()=>{});break}},T=async(M,I,z)=>{if(M.startsWith("__GUIDANCE__")){const L=M.slice(12);v(W=>[...W,{id:`guidance-${Date.now()}`,kind:"assistant",content:`ℹ ${L}`,thoughts:[],status:"done"}]);return}if(A(M))return;P(M);let R=M;if(I!=null&&I.includes("image-gen")&&!M.toLowerCase().startsWith("generate")&&!M.toLowerCase().startsWith("create")&&(R=`Görsel oluştur: ${M}`),a==="default")try{const L=M.trim().split(/\s+/).slice(0,4).join(" "),W=await $("/api/chats",{method:"POST",body:JSON.stringify({title:L})});if(W.ok){const q=await W.json();o.current={text:R,tools:I,files:z},i(`/app?chat=${q.id}`);return}}catch{}if(!b.some(L=>L.kind==="user")&&a!=="default"){const L=M.trim().split(/\s+/).slice(0,4).join(" ");L&&$(`/api/chats/${a}`,{method:"PATCH",body:JSON.stringify({title:L})}).then(()=>{window.dispatchEvent(new CustomEvent("mustb:chat-renamed",{detail:{id:a,title:L}}))}).catch(()=>{})}v(L=>L.map(W=>({...W,workflow:void 0})));const C=z==null?void 0:z.filter(L=>L.type.startsWith("image/")).map(L=>URL.createObjectURL(L));v(L=>[...L,{id:`user-${Date.now()}`,kind:"user",content:M,thoughts:[],status:"done",...C!=null&&C.length?{attachments:C}:{}}]);const E={goal:R};if(I&&I.length>0&&(E.focus_tools=I),z&&z.length>0)try{E.attachments=await Promise.all(z.map(async L=>({name:L.name,type:L.type,data:await
|
|
678
|
-
`).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:()=>u(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 E=p.trim();if(!E)return;const L=b.findIndex(W=>W.id===M.id);v(W=>W.slice(0,L)),u(null),setTimeout(()=>T(E),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:M.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(M.content).catch(()=>{}),y(M.id),setTimeout(()=>y(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===M.id?r.jsxs(r.Fragment,{children:[r.jsx(Mt,{size:10,className:"text-green-400"}),r.jsx("span",{className:"text-green-400",children:"Copied"})]}):r.jsxs(r.Fragment,{children:[r.jsx(Wi,{size:10}),"Copy"]})}),r.jsxs("button",{onClick:()=>{u(M.id),h(M.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(xm,{size:10}),"Edit"]})]})]})]})},M.id)}const I=M.thoughts.length>0,z=M.content.length>0,R=M.status==="pending",B=M.status==="error"&&!z;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:[M.thoughts.length," step",M.thoughts.length!==1?"s":""]})]}),I&&r.jsxs("details",{className:"mb-3 group",style:{background:"rgba(255,255,255,0.025)",borderRadius:"10px",padding:"6px 10px"},...z?{}:{open:!0},children:[r.jsxs("summary",{className:"flex items-center gap-1.5 cursor-pointer list-none select-none w-fit",children:[r.jsx(on,{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:[M.thoughts.length," step",M.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:M.thoughts.map((C,E)=>r.jsx("p",{className:"text-[11px] font-mono text-white/30 leading-relaxed break-all",children:C},E))})]}),z?r.jsxs("div",{className:"w-full py-2",children:[r.jsx(
|
|
674
|
+
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(bS,{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(ee,{children:n==="exiting"&&r.jsx(U.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 h1(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=h1(e[t]))&&(s&&(s+=" "),s+=n)}else for(n in e)e[n]&&(s&&(s+=" "),s+=n);return s}function Ke(){for(var e,t,n=0,s="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=h1(e))&&(s&&(s+=" "),s+=t);return s}const p4={frontier:"⚡ Frontier",gateway:"🌐 Gateway",fast:"🚀 Fast Inference",local:"💻 Local / Offline",open:"🔓 Open Source Cloud",specialist:"🎯 Specialist",regional:"🌏 Regional",enterprise:"🏢 Enterprise",custom:"⚙️ Custom"},f4=["frontier","gateway","fast","local","open","specialist","regional","enterprise","custom"],wm=[{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:"العربية"}],Ja=["Identity","AI Engine","Workspace","Voice","Channels","Finalize"],ic=[{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}],km=[{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 m4({index:e,current:t}){const n=e<t,s=e===t;return r.jsxs("div",{className:"flex items-center",children:[r.jsx("div",{className:Ke("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(Mt,{size:13}):e+1}),e<Ja.length-1&&r.jsx("div",{className:Ke("w-8 h-px transition-colors duration-300",n?"bg-orange-500/50":"bg-white/10")})]})}function g4({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 x4({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(Mt,{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(Re,{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(es,{size:9})," Heavy"]})}function jm({checked:e,onChange:t,label:n,description:s}){return r.jsxs("button",{type:"button",onClick:()=>t(!e),className:Ke("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:Ke("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:Ke("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 y4(){var Dr,Xt;un();const[e,t]=f.useState([]),[n,s]=f.useState([]),[i,a]=f.useState(null),[o,l]=f.useState(!0),[c,d]=f.useState("~/Mustb-Projects"),[u,p]=f.useState(0),[h,m]=f.useState(""),[y,b]=f.useState("en-US"),[v,g]=f.useState("openrouter"),[x,w]=f.useState(""),[j,k]=f.useState(""),[N,S]=f.useState(ic[0].id),[_,A]=f.useState(ic),[P,T]=f.useState(!1),[V,M]=f.useState("http://localhost:11434"),[I,z]=f.useState(""),[R,B]=f.useState(""),[C,E]=f.useState(!1),[L,W]=f.useState(!1),[q,te]=f.useState({}),[se,de]=f.useState({}),[fe,ae]=f.useState({}),[Ze,kt]=f.useState("idle"),[G,X]=f.useState(!1),[zt,Lr]=f.useState(null);f.useEffect(()=>{fetch("/api/setup/providers").then(D=>D.ok?D.json():{providers:[]}).then(D=>{var J;(J=D.providers)!=null&&J.length&&t(D.providers)}).catch(()=>{}).finally(()=>l(!1)),fetch("/api/setup/workspace-default").then(D=>D.ok?D.json():null).then(D=>{D!=null&&D.suggested&&(d(D.suggested),B(D.suggested))}).catch(()=>{})},[]),f.useEffect(()=>{v==="openrouter"&&(T(!0),fetch("/api/openrouter/free-models").then(D=>D.ok?D.json():null).then(D=>{if(D!=null&&D.models&&D.models.length>0){const J=D.models.slice(0,16).map(Oe=>({id:Oe.id,label:Oe.label??Oe.name??Oe.id,desc:Oe.desc??Oe.description??"",free:Oe.id.endsWith(":free")})),Q=new Set(J.map(Oe=>Oe.id)),Ee=ic.filter(Oe=>!Q.has(Oe.id));A([...J,...Ee])}}).catch(()=>{}).finally(()=>T(!1)))},[v]),f.useEffect(()=>{v==="ollama"&&fetch("/api/setup/ollama-models").then(D=>D.ok?D.json():null).then(D=>{D!=null&&D.models&&s(D.models),D!=null&&D.hardware&&a(D.hardware)}).catch(()=>{})},[v]);const Os=v==="ollama",et=e.find(D=>D.id===v),Is=f.useMemo(()=>{const D=x.toLowerCase().trim();return D?e.filter(J=>J.label.toLowerCase().includes(D)||J.description.toLowerCase().includes(D)||J.tags.some(Q=>Q.toLowerCase().includes(D))):e},[e,x]),hl=f.useMemo(()=>{const D={};for(const J of Is)D[J.category]||(D[J.category]=[]),D[J.category].push(J);return D},[Is]),Bs=()=>{switch(u){case 0:return h.trim().length>0;case 1:{if(Os){const D=n.length===0||I.trim().length>0;return V.trim().length>0&&D}return v==="openrouter"?j.trim().length>0&&N.trim().length>0:et!=null&&et.envKeyIsUrl?!0:j.trim().length>0}case 2:return R.trim().length>0;default:return!0}},pl=async()=>{kt("testing");try{(await navigator.mediaDevices.getUserMedia({audio:!0})).getTracks().forEach(J=>J.stop()),kt("granted")}catch{kt("denied")}},aa=async D=>{ae(J=>({...J,[D]:"testing"}));try{const Q=await(await fetch(`/api/channels/${D}/status`)).json().catch(()=>({}));ae(Ee=>({...Ee,[D]:Q.configured?"ok":"fail"}))}catch{ae(J=>({...J,[D]:"fail"}))}},ls=async()=>{X(!0),Lr(null);try{const D={};for(const Ee of km)if(q[Ee.id]){for(const Oe of Ee.fields){const oa=(se[Oe.key]??"").trim();oa&&(D[Oe.key]=oa)}D[`CHANNEL_${Ee.id.toUpperCase()}_ENABLED`]="true"}const J={name:h.trim()||"User",language:y,provider:v,apiKey:Os?V:j,model:Os?I:v==="openrouter"?N:et==null?void 0:et.defaultModel,skills:["browser","terminal","memory","web_search","filesystem","git","vision","input","telegram","analyzer"],mode:"local",workspacePath:R.trim()||c,wakeWord:C,telemetry:L,channels:D};let Q=await fetch("/api/setup/save",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(J)});if(!Q.ok&&Q.status===404&&(Q=await fetch("/api/setup",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(J)})),!Q.ok){const Ee=await Q.json().catch(()=>({}));throw new Error(Ee.error??"Setup failed")}localStorage.setItem("mustb_boot_report","1"),localStorage.setItem("mustb_setup_complete","1"),window.location.href="/app"}catch(D){Lr(D instanceof Error?D.message:"Unknown error"),X(!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:Ja.map((D,J)=>r.jsxs("div",{className:"flex flex-col items-center gap-1",children:[r.jsx(m4,{index:J,current:u}),r.jsx("span",{className:Ke("text-[9px] font-bold uppercase tracking-widest transition-colors",J===u?"text-orange-400":J<u?"text-orange-500/50":"text-gray-700"),children:D})]},J))}),r.jsx(ee,{mode:"wait",children:r.jsxs(U.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 ",u+1," of ",Ja.length]}),r.jsx("h2",{className:"text-xl font-bold text-white mb-5",children:Ja[u]}),u===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:h,onChange:D=>m(D.target.value),onKeyDown:D=>D.key==="Enter"&&Bs()&&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(Xe,{size:14,className:"absolute left-3.5 top-1/2 -translate-y-1/2 text-gray-400 pointer-events-none"}),r.jsx("select",{value:y,onChange:D=>b(D.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:wm.map(D=>r.jsx("option",{value:D.value,className:"bg-[#0d1117] text-white",children:D.label},D.value))}),r.jsx(on,{size:13,className:"absolute right-3.5 top-1/2 -translate-y-1/2 text-gray-400 pointer-events-none rotate-90"})]})]})]}),u===1&&r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"relative",children:[r.jsx(qt,{size:13,className:"absolute left-3 top-1/2 -translate-y-1/2 text-gray-400"}),r.jsx("input",{type:"text",value:x,onChange:D=>w(D.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…"}):f4.map(D=>{const J=hl[D];return J!=null&&J.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:p4[D]}),r.jsx("div",{className:"space-y-1",children:J.map(Q=>r.jsxs("button",{onClick:()=>{g(Q.id),k("")},className:Ke("w-full flex items-center gap-3 px-3 py-2.5 rounded-xl border transition-all text-left",v===Q.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:Ke("w-3 h-3 rounded-full border-2 flex-shrink-0 transition-all",v===Q.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:Q.label}),r.jsx("p",{className:"text-xs text-gray-400 truncate",children:Q.description})]}),r.jsx("div",{className:"flex flex-wrap gap-1 justify-end flex-shrink-0 max-w-[120px]",children:Q.tags.slice(0,2).map(Ee=>r.jsx(g4,{label:Ee},Ee))})]},Q.id))})]},D):null}),!o&&Is.length===0&&r.jsxs("p",{className:"text-center py-6 text-gray-400 text-sm",children:['No providers match "',x,'"']})]}),Os?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:D=>M(D.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(r1,{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(Sn,{size:11,className:"text-orange-400"}),i.cpuCount," CPUs"]}),r.jsxs("span",{className:"flex items-center gap-1.5",children:[r.jsx(Re,{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(D=>r.jsxs("button",{onClick:()=>z(D.modelId),className:Ke("w-full flex items-center gap-3 px-3 py-2.5 rounded-xl border transition-all text-left",I===D.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:Ke("w-3 h-3 rounded-full border-2 flex-shrink-0",I===D.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:D.name}),r.jsx("span",{className:"text-[10px] text-gray-400 font-mono",children:D.params})]}),r.jsx("p",{className:"text-xs text-gray-400 truncate",children:D.description})]}),r.jsxs("div",{className:"flex flex-col items-end gap-1 flex-shrink-0",children:[r.jsx(x4,{fit:D.fit}),r.jsxs("span",{className:"text-[10px] text-gray-400",children:[D.ramGb," GB"]})]})]},D.id))})]}):et?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:et.envKeyIsUrl?"Base URL":`${et.label} API Key`}),r.jsx("input",{type:et.envKeyIsUrl?"url":"password",value:j,onChange:D=>k(D.target.value),placeholder:et.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"}),P&&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:_.map(D=>r.jsxs("button",{type:"button",onClick:()=>S(D.id),className:Ke("w-full flex items-start gap-3 px-3 py-2.5 rounded-xl border transition-all text-left",N===D.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:Ke("w-3 h-3 rounded-full border-2 flex-shrink-0 mt-0.5",N===D.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:D.label}),D.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:D.desc})]})]},D.id))}),!N&&r.jsxs("p",{className:"text-xs text-orange-400 flex items-center gap-1.5",children:[r.jsx(es,{size:11})," Select a model to continue"]})]}),v!=="openrouter"&&et.latestModels.length>0&&r.jsx("div",{className:"flex flex-wrap gap-1.5 pt-1",children:et.latestModels.slice(0,4).map(D=>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:D},D))}),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]}),u===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(ES,{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:R,onChange:D=>B(D.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(QS,{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."})]})]}),u===3&&r.jsxs("div",{className:"space-y-4",children:[r.jsx(jm,{checked:C,onChange:E,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:[Ze==="idle"&&"Click to verify your browser can access the microphone.",Ze==="testing"&&"Requesting permission…",Ze==="granted"&&"Microphone access granted ✓",Ze==="denied"&&"Permission denied — check browser settings."]})]}),r.jsx("button",{onClick:pl,disabled:Ze==="testing",className:Ke("flex items-center gap-2 px-4 py-2 rounded-xl text-xs font-bold transition-all shrink-0",Ze==="granted"?"bg-green-500/10 border border-green-500/20 text-green-400 cursor-default":Ze==="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:Ze==="granted"?r.jsxs(r.Fragment,{children:[r.jsx(Mt,{size:12})," Granted"]}):Ze==="denied"?r.jsxs(r.Fragment,{children:[r.jsx(yh,{size:12})," Denied"]}):r.jsxs(r.Fragment,{children:[r.jsx(Nr,{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."})]}),u===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."}),km.map(D=>{const J=!!q[D.id];return r.jsxs("div",{className:"rounded-xl border transition-all overflow-hidden",style:{borderColor:J?"rgba(234,88,12,0.35)":"rgba(255,255,255,0.07)",background:J?"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:()=>te(Q=>({...Q,[D.id]:!J})),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:D.emoji}),D.label,r.jsx("span",{className:"text-[10px] text-gray-600 font-normal",children:D.hint}),fe[D.id]==="ok"&&r.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-green-400 flex-shrink-0"}),fe[D.id]==="fail"&&r.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-red-400 flex-shrink-0"}),fe[D.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:J?"#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:J?"calc(100% - 14px)":"2px"}})})]}),J&&D.fields.some(Q=>(se[Q.key]??"").trim())&&r.jsx("button",{onClick:Q=>{Q.stopPropagation(),aa(D.id)},disabled:fe[D.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:fe[D.id]==="testing"?"…":"Test"})]}),J&&r.jsx("div",{className:"px-4 pb-3 space-y-2 border-t",style:{borderColor:"rgba(234,88,12,0.15)"},children:D.fields.map(Q=>r.jsxs("div",{children:[r.jsx("label",{className:"block text-[10px] font-semibold text-gray-500 uppercase tracking-widest mb-1 mt-2",children:Q.label}),r.jsx("input",{type:Q.secret?"password":"text",value:se[Q.key]??"",onChange:Ee=>de(Oe=>({...Oe,[Q.key]:Ee.target.value})),placeholder:Q.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)"}})]},Q.key))})]},D.id)})]}),u===5&&r.jsxs("div",{className:"space-y-5",children:[r.jsx(jm,{checked:L,onChange:W,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:h||"—"},{label:"Language",value:((Dr=wm.find(D=>D.value===y))==null?void 0:Dr.label)??y},{label:"Provider",value:((Xt=e.find(D=>D.id===v))==null?void 0:Xt.label)??v},{label:"Workspace",value:(R||c).replace(/^.*\/([^/]+\/[^/]+)$/,"…/$1")},{label:"Wake Word",value:C?"Enabled":"Disabled"}].map(D=>r.jsxs("div",{className:"flex items-center justify-between text-xs",children:[r.jsx("span",{className:"text-gray-400",children:D.label}),r.jsx("span",{className:"text-gray-300 font-mono truncate max-w-[200px]",children:D.value})]},D.label))]}),zt&&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:zt}),r.jsx("button",{onClick:ls,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"]})})]})]},u)}),u<5&&r.jsxs("div",{className:"flex items-center justify-between mt-5",children:[r.jsxs("button",{onClick:()=>p(D=>D-1),disabled:u===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(mm,{size:16})," Back"]}),r.jsxs("button",{onClick:()=>p(D=>D+1),disabled:!Bs(),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(on,{size:16})]})]}),u===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(mm,{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 dn=Object.create(null);dn.open="0";dn.close="1";dn.ping="2";dn.pong="3";dn.message="4";dn.upgrade="5";dn.noop="6";const Za=Object.create(null);Object.keys(dn).forEach(e=>{Za[dn[e]]=e});const Td={type:"error",data:"parser error"},p1=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",f1=typeof ArrayBuffer=="function",m1=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,jh=({type:e,data:t},n,s)=>p1&&t instanceof Blob?n?s(t):Nm(t,s):f1&&(t instanceof ArrayBuffer||m1(t))?n?s(t):Nm(new Blob([t]),s):s(dn[e]+(t||"")),Nm=(e,t)=>{const n=new FileReader;return n.onload=function(){const s=n.result.split(",")[1];t("b"+(s||""))},n.readAsDataURL(e)};function Sm(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let ac;function v4(e,t){if(p1&&e.data instanceof Blob)return e.data.arrayBuffer().then(Sm).then(t);if(f1&&(e.data instanceof ArrayBuffer||m1(e.data)))return t(Sm(e.data));jh(e,!1,n=>{ac||(ac=new TextEncoder),t(ac.encode(n))})}const Cm="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ti=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<Cm.length;e++)ti[Cm.charCodeAt(e)]=e;const b4=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 d=new ArrayBuffer(t),u=new Uint8Array(d);for(s=0;s<n;s+=4)a=ti[e.charCodeAt(s)],o=ti[e.charCodeAt(s+1)],l=ti[e.charCodeAt(s+2)],c=ti[e.charCodeAt(s+3)],u[i++]=a<<2|o>>4,u[i++]=(o&15)<<4|l>>2,u[i++]=(l&3)<<6|c&63;return d},w4=typeof ArrayBuffer=="function",Nh=(e,t)=>{if(typeof e!="string")return{type:"message",data:g1(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:k4(e.substring(1),t)}:Za[n]?e.length>1?{type:Za[n],data:e.substring(1)}:{type:Za[n]}:Td},k4=(e,t)=>{if(w4){const n=b4(e);return g1(n,t)}else return{base64:!0,data:e}},g1=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},x1="",j4=(e,t)=>{const n=e.length,s=new Array(n);let i=0;e.forEach((a,o)=>{jh(a,!1,l=>{s[o]=l,++i===n&&t(s.join(x1))})})},N4=(e,t)=>{const n=e.split(x1),s=[];for(let i=0;i<n.length;i++){const a=Nh(n[i],t);if(s.push(a),a.type==="error")break}return s};function S4(){return new TransformStream({transform(e,t){v4(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 oc;function Ma(e){return e.reduce((t,n)=>t+n.length,0)}function za(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 C4(e,t){oc||(oc=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(Ma(n)<1)break;const c=za(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(Ma(n)<2)break;const c=za(n,2);i=new DataView(c.buffer,c.byteOffset,c.length).getUint16(0),s=3}else if(s===2){if(Ma(n)<8)break;const c=za(n,8),d=new DataView(c.buffer,c.byteOffset,c.length),u=d.getUint32(0);if(u>Math.pow(2,21)-1){l.enqueue(Td);break}i=u*Math.pow(2,32)+d.getUint32(4),s=3}else{if(Ma(n)<i)break;const c=za(n,i);l.enqueue(Nh(a?c:oc.decode(c),t)),s=0}if(i===0||i>e){l.enqueue(Td);break}}}})}const y1=4;function ze(e){if(e)return _4(e)}function _4(e){for(var t in ze.prototype)e[t]=ze.prototype[t];return e}ze.prototype.on=ze.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};ze.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};ze.prototype.off=ze.prototype.removeListener=ze.prototype.removeAllListeners=ze.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};ze.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};ze.prototype.emitReserved=ze.prototype.emit;ze.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};ze.prototype.hasListeners=function(e){return!!this.listeners(e).length};const dl=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")(),E4="arraybuffer";function v1(e,...t){return t.reduce((n,s)=>(e.hasOwnProperty(s)&&(n[s]=e[s]),n),{})}const T4=_t.setTimeout,P4=_t.clearTimeout;function ul(e,t){t.useNativeTimers?(e.setTimeoutFn=T4.bind(_t),e.clearTimeoutFn=P4.bind(_t)):(e.setTimeoutFn=_t.setTimeout.bind(_t),e.clearTimeoutFn=_t.clearTimeout.bind(_t))}const A4=1.33;function M4(e){return typeof e=="string"?z4(e):Math.ceil((e.byteLength||e.size)*A4)}function z4(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 b1(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function R4(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function L4(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 D4 extends Error{constructor(t,n,s){super(t),this.description=n,this.context=s,this.type="TransportError"}}class Sh extends ze{constructor(t){super(),this.writable=!1,ul(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 D4(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=Nh(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=R4(t);return n.length?"?"+n:""}}class O4 extends Sh{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)};N4(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,j4(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]=b1()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let w1=!1;try{w1=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const I4=w1;function B4(){}class F4 extends O4{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 an extends ze{constructor(t,n,s){super(),this.createRequest=t,ul(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=v1(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=an.requestsCount++,an.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=B4,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete an.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()}}an.requestsCount=0;an.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",_m);else if(typeof addEventListener=="function"){const e="onpagehide"in _t?"pagehide":"unload";addEventListener(e,_m,!1)}}function _m(){for(let e in an.requests)an.requests.hasOwnProperty(e)&&an.requests[e].abort()}const V4=function(){const e=k1({xdomain:!1});return e&&e.responseType!==null}();class $4 extends F4{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=V4&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new an(k1,this.uri(),t)}}function k1(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||I4))return new XMLHttpRequest}catch{}if(!t)try{return new _t[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const j1=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class U4 extends Sh{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,s=j1?{}:v1(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;jh(s,this.supportsBinary,a=>{try{this.doWrite(s,a)}catch{}i&&dl(()=>{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]=b1()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const lc=_t.WebSocket||_t.MozWebSocket;class H4 extends U4{createSocket(t,n,s){return j1?new lc(t,n,s):n?new lc(t,n):new lc(t)}doWrite(t,n){this.ws.send(n)}}class W4 extends Sh{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=C4(Number.MAX_SAFE_INTEGER,this.socket.binaryType),s=t.readable.pipeThrough(n).getReader(),i=S4();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&&dl(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const G4={websocket:H4,webtransport:W4,polling:$4},K4=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,q4=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Pd(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=K4.exec(e||""),a={},o=14;for(;o--;)a[q4[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=Y4(a,a.path),a.queryKey=X4(a,a.query),a}function Y4(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 X4(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(s,i,a){i&&(n[i]=a)}),n}const Ad=typeof addEventListener=="function"&&typeof removeEventListener=="function",eo=[];Ad&&addEventListener("offline",()=>{eo.forEach(e=>e())},!1);class Yn extends ze{constructor(t,n){if(super(),this.binaryType=E4,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=Pd(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=Pd(n.host).host);ul(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=L4(this.opts.query)),Ad&&(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"})},eo.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=y1,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&&Yn.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",Yn.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+=M4(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,dl(()=>{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(Yn.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(),Ad&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const s=eo.indexOf(this._offlineEventListener);s!==-1&&eo.splice(s,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}Yn.protocol=y1;class Q4 extends Yn{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;Yn.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;Yn.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{s||this.readyState!=="closed"&&(u(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const h=new Error("probe error");h.transport=n.name,this.emitReserved("upgradeError",h)}}))};function a(){s||(s=!0,u(),n.close(),n=null)}const o=p=>{const h=new Error("probe error: "+p);h.transport=n.name,a(),this.emitReserved("upgradeError",h)};function l(){o("transport closed")}function c(){o("socket closed")}function d(p){n&&p.name!==n.name&&a()}const u=()=>{n.removeListener("open",i),n.removeListener("error",o),n.removeListener("close",l),this.off("close",c),this.off("upgrading",d)};n.once("open",i),n.once("error",o),n.once("close",l),this.once("close",c),this.once("upgrading",d),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 J4=class extends Q4{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=>G4[i]).filter(i=>!!i)),super(t,s)}};function Z4(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=Pd(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 e3=typeof ArrayBuffer=="function",t3=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,N1=Object.prototype.toString,n3=typeof Blob=="function"||typeof Blob<"u"&&N1.call(Blob)==="[object BlobConstructor]",s3=typeof File=="function"||typeof File<"u"&&N1.call(File)==="[object FileConstructor]";function Ch(e){return e3&&(e instanceof ArrayBuffer||t3(e))||n3&&e instanceof Blob||s3&&e instanceof File}function to(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,s=e.length;n<s;n++)if(to(e[n]))return!0;return!1}if(Ch(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return to(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&to(e[n]))return!0;return!1}function r3(e){const t=[],n=e.data,s=e;return s.data=Md(n,t),s.attachments=t.length,{packet:s,buffers:t}}function Md(e,t){if(!e)return e;if(Ch(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]=Md(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]=Md(e[s],t));return n}return e}function i3(e,t){return e.data=zd(e.data,t),delete e.attachments,e}function zd(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]=zd(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=zd(e[n],t));return e}const a3=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var ie;(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"})(ie||(ie={}));class o3{constructor(t){this.replacer=t}encode(t){return(t.type===ie.EVENT||t.type===ie.ACK)&&to(t)?this.encodeAsBinary({type:t.type===ie.EVENT?ie.BINARY_EVENT:ie.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===ie.BINARY_EVENT||t.type===ie.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=r3(t),s=this.encodeAsString(n.packet),i=n.buffers;return i.unshift(s),i}}class _h extends ze{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===ie.BINARY_EVENT;s||n.type===ie.BINARY_ACK?(n.type=s?ie.EVENT:ie.ACK,this.reconstructor=new l3(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(Ch(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(ie[s.type]===void 0)throw new Error("unknown packet type "+s.type);if(s.type===ie.BINARY_EVENT||s.type===ie.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(_h.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 ie.CONNECT:return Em(n);case ie.DISCONNECT:return n===void 0;case ie.CONNECT_ERROR:return typeof n=="string"||Em(n);case ie.EVENT:case ie.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&a3.indexOf(n[0])===-1);case ie.ACK:case ie.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class l3{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=i3(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}function Em(e){return Object.prototype.toString.call(e)==="[object Object]"}const c3=Object.freeze(Object.defineProperty({__proto__:null,Decoder:_h,Encoder:o3,get PacketType(){return ie}},Symbol.toStringTag,{value:"Module"}));function $t(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const d3=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class S1 extends ze{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=[$t(t,"open",this.onopen.bind(this)),$t(t,"packet",this.onpacket.bind(this)),$t(t,"error",this.onerror.bind(this)),$t(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(d3.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:ie.EVENT,data:n};if(o.options={},o.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const u=this.ids++,p=n.pop();this._registerAckCallback(u,p),o.id=u}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:ie.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 ie.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 ie.EVENT:case ie.BINARY_EVENT:this.onevent(t);break;case ie.ACK:case ie.BINARY_ACK:this.onack(t);break;case ie.DISCONNECT:this.ondisconnect();break;case ie.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:ie.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:ie.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 Rr(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}Rr.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};Rr.prototype.reset=function(){this.attempts=0};Rr.prototype.setMin=function(e){this.ms=e};Rr.prototype.setMax=function(e){this.max=e};Rr.prototype.setJitter=function(e){this.jitter=e};class Rd extends ze{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,ul(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 Rr({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||c3;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 J4(this.uri,this.opts);const n=this.engine,s=this;this._readyState="opening",this.skipReconnect=!1;const i=$t(n,"open",function(){s.onopen(),t&&t()}),a=l=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",l),t?t(l):this.maybeReconnectOnOpen()},o=$t(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($t(t,"ping",this.onping.bind(this)),$t(t,"data",this.ondata.bind(this)),$t(t,"error",this.onerror.bind(this)),$t(t,"close",this.onclose.bind(this)),$t(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){dl(()=>{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 S1(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 Gr={};function yi(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=Z4(e,t.path||"/socket.io"),s=n.source,i=n.id,a=n.path,o=Gr[i]&&a in Gr[i].nsps,l=t.forceNew||t["force new connection"]||t.multiplex===!1||o;let c;return l?c=new Rd(s,t):(Gr[i]||(Gr[i]=new Rd(s,t)),c=Gr[i]),n.query&&!t.query&&(t.query=n.queryKey),c.socket(n.path,t)}Object.assign(yi,{Manager:Rd,Socket:S1,io:yi,connect:yi});const u3={};let us=null;function h3(){const e=u3;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 us||(us=yi(h3(),{transports:["websocket","polling"],withCredentials:!0,reconnection:!0,reconnectionAttempts:1/0,reconnectionDelay:1e3,reconnectionDelayMax:5e3,randomizationFactor:.3,timeout:1e4}),us.on("agentUpdate",e=>{try{e!=null&&window.dispatchEvent(new CustomEvent("mustb:agentUpdate",{detail:e}))}catch{}}),us.on("connect",()=>{window.dispatchEvent(new CustomEvent("mustb:connected"))}),us.on("disconnect",e=>{window.dispatchEvent(new CustomEvent("mustb:disconnected",{detail:{reason:e}}))}),us.io.on("reconnect",e=>{window.dispatchEvent(new CustomEvent("mustb:reconnected",{detail:{attemptNumber:e}}))})),us}const p3={};let ni=null;const f3=(()=>{const e=p3,t=(e==null?void 0:e.VITE_BACKEND_URL)??"";return t&&!t.includes(window.location.hostname)?t.replace(/\/$/,""):""})();function C1(e){return e.startsWith("http")?e:`${f3}${e}`}async function m3(){if(ni)return ni;try{const e=await fetch(C1("/api/auth/local"));if(e.ok)return ni=(await e.json()).token??null,ni}catch{}return null}async function $(e,t={},{retries:n=3,retryDelay:s=800}={}){const i=await m3(),a={"Content-Type":"application/json",...t.headers};i&&(a.Authorization=`Bearer ${i}`);const o=C1(e);let l;for(let c=1;c<=n;c++)try{const d=await fetch(o,{...t,headers:a});return d.status===401&&(ni=null,window.dispatchEvent(new CustomEvent("mustb:401",{detail:{url:o}}))),d}catch(d){l=d,c<n&&await new Promise(u=>setTimeout(u,s*c))}throw window.dispatchEvent(new CustomEvent("mustb:offline",{detail:{url:o}})),l}function Tm(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 cc(e){return[...e].sort((t,n)=>Tm(n.id)-Tm(t.id))}function g3(){const{t:e}=pt(),[t,n]=f.useState(!1),[s,i]=f.useState(()=>localStorage.getItem("mustb_active_model")??"Loading…"),[a,o]=f.useState([]),l=f.useRef(null);f.useEffect(()=>{const h=localStorage.getItem("mustb_active_model");h&&h!=="Loading…"&&$("/api/settings/model",{method:"POST",body:JSON.stringify({model:h})}).catch(()=>{}),$("/api/setup/status").then(m=>m.ok?m.json():null).then(m=>{if(!m)return;const y=localStorage.getItem("mustb_active_model");m.activeModel&&(!y||y==="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(cc(x))}).catch(()=>{}):$("/api/providers/openrouter/models").then(v=>v.ok?v.json():{}).then(v=>{const g=cc((v.free??[]).map(j=>({id:j.id,name:j.name??j.id,free:!0}))),x=cc((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(()=>{})},[]),f.useEffect(()=>{if(!t)return;const h=m=>{l.current&&!l.current.contains(m.target)&&n(!1)};return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[t]);const c=async h=>{i(h),localStorage.setItem("mustb_active_model",h),n(!1),await $("/api/settings/model",{method:"POST",body:JSON.stringify({model:h})}).catch(()=>{})},d=a.filter(h=>h.free),u=a.filter(h=>!h.free),p=s.length>28?s.slice(0,26)+"…":s;return r.jsxs("div",{ref:l,className:"relative",children:[r.jsxs("button",{onClick:()=>n(h=>!h),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(na,{size:10,className:`transition-transform duration-200 shrink-0 text-white/30 ${t?"rotate-180":""}`})]}),r.jsx(ee,{children:t&&r.jsxs(U.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:[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-emerald-500/80",children:"Free"}),d.slice(0,5).map(h=>r.jsxs("button",{onClick:()=>c(h.id),className:`w-full flex items-center gap-2 px-2.5 py-2 rounded-lg text-left transition-colors ${s===h.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===h.id?"bg-orange-500":"bg-emerald-400"}`}),r.jsx("span",{className:"text-[12px] font-medium truncate",children:h.name}),s===h.id&&r.jsx("span",{className:"ml-auto text-[9px] font-semibold text-orange-400 shrink-0",children:"active"})]},h.id))]}),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-orange-400/80",children:"Pro"}),u.map(h=>r.jsxs("button",{onClick:()=>c(h.id),className:`w-full flex items-center gap-2 px-2.5 py-2 rounded-lg text-left transition-colors ${s===h.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===h.id?"bg-orange-500":"bg-orange-300"}`}),r.jsx("span",{className:"text-[12px] font-medium truncate",children:h.name}),s===h.id&&r.jsx("span",{className:"ml-auto text-[9px] font-semibold text-orange-400 shrink-0",children:"active"})]},h.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(hi,{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(bh,{size:11}),e.systemHealth.moreModels]})})]})})]})}function gs(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?gs(n):JSON.stringify(e)}return String(e)}function x3(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)??gs(t.step)}`}case"stepFinish":{if(t.status==="error")return`✗ ${gs(t.error)}`;const n=t.step,s=t.result!==void 0?gs(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=gs(t.action),s=t.reason?` — ${gs(t.reason).slice(0,120)}`:"";return`⟳ Repair: ${n}${s}`}default:return null}}function y3(e){return new Promise((t,n)=>{const s=new FileReader;s.onload=()=>t(s.result),s.onerror=n,s.readAsDataURL(e)})}function v3({lang:e,code:t}){const[n,s]=f.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(Mt,{size:10,className:"text-orange-400"}),r.jsx("span",{className:"text-orange-400",children:"Copied"})]}):r.jsxs(r.Fragment,{children:[r.jsx(Wi,{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 Us(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(f.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 b3({text:e,dark:t=!1}){const n=t?"text-orange-50":"text-[#3d1a06]",s=[],i=e.split(`
|
|
675
|
+
`);let a=0,o=0;const l=()=>`md-${o++}`;for(;a<i.length;){const c=i[a],d=c.match(/^```(\w*)/);if(d){const y=d[1]??"",b=[];for(a++;a<i.length&&!i[a].startsWith("```");)b.push(i[a]),a++;a<i.length&&a++,s.push(r.jsx(v3,{lang:y,code:b.join(`
|
|
676
|
+
`)},l()));continue}const u=c.match(/^### (.+)/);if(u){s.push(r.jsx("h3",{className:`text-sm font-bold mt-4 mb-1 ${n}`,children:Us(u[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:Us(p[1],l())},l())),a++;continue}const h=c.match(/^# (.+)/);if(h){s.push(r.jsx("h1",{className:`text-lg font-bold mt-6 mb-2 ${n}`,children:Us(h[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 y=[];for(;a<i.length&&i[a].match(/^[-*•] /);)y.push(i[a].replace(/^[-*•] /,"")),a++;s.push(r.jsx("ul",{className:"my-2 space-y-1.5 pl-1",children:y.map((b,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:Us(b,`ul-${v}`)})]},v))},l()));continue}if(c.match(/^\d+\. /)){const y=[];for(;a<i.length&&i[a].match(/^\d+\. /);)y.push(i[a].replace(/^\d+\. /,"")),a++;s.push(r.jsx("ol",{className:"my-2 space-y-1.5 pl-1",children:y.map((b,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:Us(b,`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:Us(m.join(" "),`p-${o}`)},l()))}return r.jsx("div",{children:s})}function w3(){const[e,t]=f.useState(0);f.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 k3({workflow:e,onDismiss:t}){const[n,s]=f.useState("idle"),[i,a]=f.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(U.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(Je,{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(Xy,{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 j3({src:e,onClose:t}){const[n,s]=f.useState(!1);f.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(Mt,{size:14,className:"text-green-400"}):r.jsx(Wi,{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(xi,{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(st,{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 N3 extends f.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 Pm=[{id:"terminal",label:"Terminal",Icon:Ps},{id:"browser",label:"Browser",Icon:Xe},{id:"image-gen",label:"Görsel Üret",Icon:a1},{id:"web-search",label:"Web Search",Icon:qt},{id:"file-manager",label:"Files",Icon:os},{id:"code",label:"Code",Icon:cn},{id:"screen-sense",label:"Ekranı Gör",Icon:vh}];function S3({onSend:e,onStop:t,disabled:n}){const{t:s}=pt(),[i,a]=f.useState(""),[o,l]=f.useState(!1),[c,d]=f.useState(""),[u,p]=f.useState([]),[h,m]=f.useState([]),[y,b]=f.useState(!1),v=f.useRef(null),g=f.useRef(!1),x=f.useRef(null),w=f.useRef(null),j=typeof window<"u"&&!!(window.SpeechRecognition||window.webkitSpeechRecognition),k=()=>{const z=window.SpeechRecognition||window.webkitSpeechRecognition;if(!z)return;const R=new z;R.continuous=!0,R.interimResults=!0,R.lang="tr-TR",R.onresult=B=>{let C="",E="";for(let L=B.resultIndex;L<B.results.length;L++)B.results[L].isFinal?C+=B.results[L][0].transcript:E+=B.results[L][0].transcript;C?(a(L=>(L.trim()?L.trimEnd()+" ":"")+C.trim()),d("")):d(E)},R.onend=()=>{d(""),g.current?setTimeout(k,150):(l(!1),v.current=null)},R.onerror=B=>{B.error!=="no-speech"&&l(!1),d(""),g.current&&B.error!=="not-allowed"&&setTimeout(k,500)},v.current=R;try{R.start()}catch{}},N=()=>{var z;o?(g.current=!1,(z=v.current)==null||z.stop(),d("")):(g.current=!0,l(!0),k())},S=z=>{p(R=>[...R,...Array.from(z)])},_=z=>{const R=Array.from(z.clipboardData.files);R.length&&(z.preventDefault(),S(R))},A=z=>{z.preventDefault(),S(z.dataTransfer.files)},P=z=>p(R=>R.filter((B,C)=>C!==z));f.useEffect(()=>{if(!y)return;const z=R=>{w.current&&!w.current.contains(R.target)&&b(!1)};return document.addEventListener("mousedown",z),()=>document.removeEventListener("mousedown",z)},[y]);const T=async()=>{try{const z=await navigator.mediaDevices.getDisplayMedia({video:!0}),R=document.createElement("video");R.srcObject=z,R.muted=!0,await new Promise(C=>{R.onloadedmetadata=()=>{R.play(),C()}}),await new Promise(C=>setTimeout(C,120));const B=document.createElement("canvas");B.width=R.videoWidth,B.height=R.videoHeight,B.getContext("2d").drawImage(R,0,0),z.getTracks().forEach(C=>C.stop()),B.toBlob(C=>{if(!C)return;const E=new File([C],`ekran-${Date.now()}.png`,{type:"image/png"});S([E]),a(L=>L.trim()?L:"Bu ekranı analiz et ve ne gördüğünü açıkla."),pe.success("Ekran yakalandı — göndermek için ▶ basın.")},"image/png",.9)}catch(z){(z==null?void 0:z.name)!=="NotAllowedError"&&pe.error("Ekran yakalanamadı.")}},V=z=>{if(z==="screen-sense"){T(),b(!1);return}m(R=>R.includes(z)?R.filter(B=>B!==z):[...R,z])},M=()=>{var B;const z=i.trim();if(!z||n)return;o&&(g.current=!1,(B=v.current)==null||B.stop(),d(""));const R=[...u];a(""),p([]),e(z,h.length>0?h:void 0,R.length>0?R:void 0)};f.useEffect(()=>{x.current&&(x.current.style.height="auto",x.current.style.height=`${Math.min(x.current.scrollHeight,160)}px`)},[i]),f.useEffect(()=>{const z=R=>{var C;const B=((C=R.detail)==null?void 0:C.text)??"";a(B),setTimeout(()=>{var E;return(E=x.current)==null?void 0:E.focus()},60)};return window.addEventListener("mustb:prefill",z),()=>window.removeEventListener("mustb:prefill",z)},[]);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:_,onDrop:A,onDragOver:z=>z.preventDefault(),children:[u.length>0&&r.jsx("div",{className:"flex flex-wrap gap-2 px-1",children:u.map((z,R)=>r.jsxs("div",{className:"relative group w-12 h-12",children:[z.type.startsWith("image/")?r.jsx("img",{src:URL.createObjectURL(z),alt:z.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(Yt,{size:16,className:"text-orange-400"})}),r.jsx("button",{onClick:()=>P(R),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(st,{size:9})})]},R))}),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:()=>b(z=>!z),title:"Araçlar",className:`p-2 rounded-full transition-all ${y||h.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(kh,{size:16})}),r.jsx(ee,{children:y&&r.jsxs(U.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"}),Pm.map(({id:z,label:R,Icon:B})=>{const C=h.includes(z);return r.jsxs("button",{onClick:()=>V(z),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:R}),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:"✓"})]},z)})]})}),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(WS,{size:16}),r.jsx("input",{type:"file",multiple:!0,className:"hidden",onChange:z=>z.target.files&&S(z.target.files)})]})]}),r.jsx("textarea",{ref:x,value:i,onChange:z=>a(z.target.value),onKeyDown:z=>{z.key==="Enter"&&!z.shiftKey&&(z.preventDefault(),M())},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(wS,{size:17,className:"animate-pulse"}):r.jsx(Nr,{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(wh,{size:14})}):r.jsx("button",{onClick:M,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(qS,{size:16})})]})]}),r.jsxs("div",{className:"flex items-center justify-between gap-2",children:[h.length>0?r.jsx("div",{className:"flex flex-wrap gap-1.5 flex-1",children:h.map(z=>{const R=Pm.find(E=>E.id===z);if(!R)return null;const{Icon:B,label:C}=R;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(z),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(st,{size:9})})]},z)})}):r.jsx("div",{className:"flex-1"}),r.jsx(g3,{})]})]})})}function dc(e){return`mustb_chat_turns_${e}`}function C3(){const{t:e,setLocale:t}=pt(),n=f.useRef(e);f.useEffect(()=>{n.current=e},[e]);const[s]=f2(),i=un(),a=s.get("chat")??"default",o=f.useRef(null),[l,c]=f.useState(null),[d,u]=f.useState(null),[p,h]=f.useState(""),[m,y]=f.useState(null),[b,v]=f.useState(()=>{try{const M=localStorage.getItem(dc(a));if(M)return JSON.parse(M)}catch{}return[]}),g=f.useRef(null),x=f.useRef(null),w=f.useRef(a),[j,k]=f.useState(!1),[N,S]=f.useState(null),_=b.some(M=>M.kind==="assistant"&&M.status==="pending");f.useEffect(()=>{w.current=a;try{const M=localStorage.getItem(dc(a));v(M?JSON.parse(M):[])}catch{v([])}g.current=null},[a]),f.useEffect(()=>{if(a==="default"||!o.current)return;const M=o.current;o.current=null,setTimeout(()=>T(M.text,M.tools,M.files),0)},[a]),f.useEffect(()=>{const M=at();return M.on("agentUpdate",I=>{const{type:z,...R}=I;if(z==="memorySearch")return;if(z==="planStart"){const E=`asst-${Date.now()}-${Math.random().toString(36).slice(2)}`;g.current=E,v(L=>[...L,{id:E,kind:"assistant",content:"",thoughts:[],status:"pending"}]);return}if(z==="finalAnswer"){const E=g.current;if(!E)return;v(L=>L.map(W=>W.id===E?{...W,content:gs(R.answer??"Done.")}:W));return}if(z==="planFinish"){k(!1);const E=g.current;if(!E)return;const L=R.status==="failed"?"error":"done",W=R.status==="completed"?{goal:String(R.goal??""),answer:String(R.answer??""),steps:R.steps??[]}:void 0;v(q=>q.map(te=>te.id===E?{...te,status:L,...W?{workflow:W}:{}}:te)),g.current=null;return}if(z==="professionResearched"){const E=String(R.profession??"");if(!E)return;const L=n.current.chat.professionAck.replace("{profession}",E);v(W=>[...W,{id:`prof-ack-${Date.now()}`,kind:"assistant",content:L,thoughts:[],status:"done"}]);return}const B=x3(z,R);if(!B)return;const C=g.current;C&&v(E=>E.map(L=>L.id===C?{...L,thoughts:[...L.thoughts,B]}:L))}),()=>{M.off("agentUpdate")}},[]),f.useEffect(()=>{var M;(M=x.current)==null||M.scrollIntoView({behavior:"smooth"})},[b]),f.useEffect(()=>{const M=I=>{var C;const z=(C=I.detail)==null?void 0:C.skill;if(!z)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":""}[z]??`Run skill "${z}": `;window.dispatchEvent(new CustomEvent("mustb:prefill",{detail:{text:B}}))};return window.addEventListener("mustb:invoke-skill",M),()=>window.removeEventListener("mustb:invoke-skill",M)},[]),f.useEffect(()=>{if(w.current===a)try{localStorage.setItem(dc(a),JSON.stringify(b))}catch{}},[b,a]),f.useEffect(()=>{const M=b[b.length-1];if(!M||M.kind!=="assistant"||M.status!=="done"||!M.content)return;const I=[...b].reverse().find(R=>R.kind==="user");if(!I)return;const z=`Q: ${I.content}
|
|
677
|
+
A: ${M.content.slice(0,400)}`;fetch("/api/memory/ltm/semantic",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:z,tags:["chat","autosave"]})}).catch(()=>{})},[b.length]);const A=M=>{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"]],z={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(M)){t(C);const E=z[C]??z.en;return v(L=>[...L,{id:`cfg-lang-${Date.now()}`,kind:"assistant",content:E,thoughts:[],status:"done"}]),!0}const R=[[/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 R)if(B.test(M))return $("/api/settings/model",{method:"POST",body:JSON.stringify({model:C})}).catch(()=>{}),v(E=>[...E,{id:`cfg-model-${Date.now()}`,kind:"assistant",content:e.chat.settingsAck,thoughts:[],status:"done"}]),!0;return!1},P=M=>{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[z,R]of I)if(z.test(M)){$("/api/memory/profession-research",{method:"POST",body:JSON.stringify({profession:R,userMessage:M})}).catch(()=>{});break}},T=async(M,I,z)=>{if(M.startsWith("__GUIDANCE__")){const L=M.slice(12);v(W=>[...W,{id:`guidance-${Date.now()}`,kind:"assistant",content:`ℹ ${L}`,thoughts:[],status:"done"}]);return}if(A(M))return;P(M);let R=M;if(I!=null&&I.includes("image-gen")&&!M.toLowerCase().startsWith("generate")&&!M.toLowerCase().startsWith("create")&&(R=`Görsel oluştur: ${M}`),a==="default")try{const L=M.trim().split(/\s+/).slice(0,4).join(" "),W=await $("/api/chats",{method:"POST",body:JSON.stringify({title:L})});if(W.ok){const q=await W.json();o.current={text:R,tools:I,files:z},i(`/app?chat=${q.id}`);return}}catch{}if(!b.some(L=>L.kind==="user")&&a!=="default"){const L=M.trim().split(/\s+/).slice(0,4).join(" ");L&&$(`/api/chats/${a}`,{method:"PATCH",body:JSON.stringify({title:L})}).then(()=>{window.dispatchEvent(new CustomEvent("mustb:chat-renamed",{detail:{id:a,title:L}}))}).catch(()=>{})}v(L=>L.map(W=>({...W,workflow:void 0})));const C=z==null?void 0:z.filter(L=>L.type.startsWith("image/")).map(L=>URL.createObjectURL(L));v(L=>[...L,{id:`user-${Date.now()}`,kind:"user",content:M,thoughts:[],status:"done",...C!=null&&C.length?{attachments:C}:{}}]);const E={goal:R};if(I&&I.length>0&&(E.focus_tools=I),z&&z.length>0)try{E.attachments=await Promise.all(z.map(async L=>({name:L.name,type:L.type,data:await y3(L)})))}catch{}k(!0);try{await $("/api/goal",{method:"POST",body:JSON.stringify(E)})}catch{k(!1)}},V=b.length>0;return r.jsxs(N3,{children:[l&&r.jsx(j3,{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:[b.map(M=>{if(M.kind==="user"){const C=d===M.id;return r.jsx("div",{className:"flex justify-end mb-5 group/userturn",children:r.jsxs("div",{className:"max-w-[78%] flex flex-col items-end gap-2",children:[M.attachments&&M.attachments.length>0&&r.jsx("div",{className:"flex flex-wrap gap-2 justify-end",children:M.attachments.map((E,L)=>r.jsxs("div",{className:"relative group w-24 h-24 shrink-0",children:[r.jsx("img",{src:E,alt:`attachment-${L}`,onClick:()=>c(E),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:W=>{W.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(xm,{size:11})})]},L))}),C?r.jsxs("div",{className:"w-full flex flex-col gap-2",children:[r.jsx("textarea",{autoFocus:!0,value:p,onChange:E=>h(E.target.value),onKeyDown:E=>{if(E.key==="Enter"&&!E.shiftKey){E.preventDefault();const L=p.trim();if(!L)return;const W=b.findIndex(q=>q.id===M.id);v(q=>q.slice(0,W)),u(null),setTimeout(()=>T(L),0)}E.key==="Escape"&&u(null)},rows:Math.min(8,p.split(`
|
|
678
|
+
`).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:()=>u(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 E=p.trim();if(!E)return;const L=b.findIndex(W=>W.id===M.id);v(W=>W.slice(0,L)),u(null),setTimeout(()=>T(E),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:M.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(M.content).catch(()=>{}),y(M.id),setTimeout(()=>y(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===M.id?r.jsxs(r.Fragment,{children:[r.jsx(Mt,{size:10,className:"text-green-400"}),r.jsx("span",{className:"text-green-400",children:"Copied"})]}):r.jsxs(r.Fragment,{children:[r.jsx(Wi,{size:10}),"Copy"]})}),r.jsxs("button",{onClick:()=>{u(M.id),h(M.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(xm,{size:10}),"Edit"]})]})]})]})},M.id)}const I=M.thoughts.length>0,z=M.content.length>0,R=M.status==="pending",B=M.status==="error"&&!z;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:[M.thoughts.length," step",M.thoughts.length!==1?"s":""]})]}),I&&r.jsxs("details",{className:"mb-3 group",style:{background:"rgba(255,255,255,0.025)",borderRadius:"10px",padding:"6px 10px"},...z?{}:{open:!0},children:[r.jsxs("summary",{className:"flex items-center gap-1.5 cursor-pointer list-none select-none w-fit",children:[r.jsx(on,{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:[M.thoughts.length," step",M.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:M.thoughts.map((C,E)=>r.jsx("p",{className:"text-[11px] font-mono text-white/30 leading-relaxed break-all",children:C},E))})]}),z?r.jsxs("div",{className:"w-full py-2",children:[r.jsx(b3,{text:M.content,dark:!0}),r.jsx("div",{className:"flex justify-end mt-3",children:r.jsx("button",{onClick:()=>{navigator.clipboard.writeText(M.content).catch(()=>{}),S(M.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===M.id?r.jsxs(r.Fragment,{children:[r.jsx(Mt,{size:12,className:"text-green-400"})," Kopyalandı"]}):r.jsxs(r.Fragment,{children:[r.jsx(Wi,{size:12})," Kopyala"]})})})]}):R?r.jsxs("div",{className:"flex items-center gap-2 py-2 px-1",children:[[0,120,240].map(C=>r.jsx("div",{className:"w-1.5 h-1.5 rounded-full animate-bounce",style:{background:"rgba(251,146,60,0.7)",animationDelay:`${C}ms`}},C)),r.jsx("span",{className:"text-[11px] text-white/25 ml-1",children:"Thinking…"}),r.jsx(w3,{})]}):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(ee,{children:M.workflow&&!R&&r.jsx(k3,{workflow:M.workflow,onDismiss:()=>v(C=>C.map(E=>E.id===M.id?{...E,workflow:void 0}:E))})})]},M.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(ee,{children:r.jsx(U.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(S3,{onSend:(M,I,z)=>T(M,I,z),onStop:()=>{k(!1),$("/api/goal/abort",{method:"POST"}).catch(()=>{}),v(M=>M.map(I=>{if(I.status!=="pending")return I;const z=I.content||(I.thoughts.length>0?`⏹ Durduruldu.
|
|
679
679
|
|
|
680
680
|
**Tamamlanan adımlar:**
|
|
681
681
|
${I.thoughts.join(`
|
|
682
|
-
`)}`:"⏹ Durduruldu.");return{...I,status:"done",content:z}})),g.current=null},disabled:j||_}),r.jsx("p",{className:"text-center text-[11px] text-white/20 mt-2 select-none",children:e.chat.disclaimer})]})]})]})}function E3(){const[e,t]=f.useState(!1);return f.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(ee,{children:e&&r.jsxs(U.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(U.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(U.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(Gi,{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 Ra={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)"},T3={browse:Xe,write:Yt,think:Kt,exec:Ps},P3={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"},A3={mouseMove:WS,mouseClick:a1,typeText:LS,visionClick:Ts},M3={mouseMove:"text-gray-500",mouseClick:"text-orange-400",typeText:"text-blue-400",visionClick:"text-purple-400"};function z3(){const{t:e}=pt(),[t,n]=f.useState(!1),[s,i]=f.useState(null),[a,o]=f.useState(null),[l,c]=f.useState(!1),d=f.useRef(null),[u,p]=f.useState(null),[h,m]=f.useState(!1),[y,b]=f.useState(()=>new Array(3).fill(null)),[v,g]=f.useState(0),[x,w]=f.useState([]),[j,k]=f.useState(null),[N,S]=f.useState([]),_=f.useRef(null),[A,P]=f.useState(!1),[T,V]=f.useState(!1);f.useEffect(()=>{if(!s||!d.current)return;const R=d.current,B=R.getContext("2d");if(!B)return;const C=new Image;C.onload=()=>{var E;if(R.width=C.width,R.height=C.height,B.drawImage(C,0,0),(E=s.elements)!=null&&E.length)for(const L of s.elements)B.strokeStyle=Ra[L.type]??Ra.unknown,B.lineWidth=Math.max(2,Math.round(C.width/400)),B.strokeRect(L.x,L.y,L.width,L.height),B.fillStyle=Ra[L.type]??Ra.unknown,B.font=`${Math.max(10,Math.round(C.width/120))}px monospace`,B.fillText(L.type,L.x+4,L.y+14)},C.src=`data:image/png;base64,${s.base64}`},[s]),f.useEffect(()=>{const R=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}),P(!1),V(!1)),C.type==="workflowStart"&&(k(C.goal??null),w(C.steps??[]),P(!1),V(!1)),C.type==="workflowStep"&&C.step){const E=C.step;w(L=>L.map(W=>W.id===E.id?E:W))}if(C.type==="workflowDone"&&setTimeout(()=>{w([]),k(null)},2500),C.type==="shadowFrame"&&typeof C.slot!="number"&&(p(C.base64),m(!0),P(!1)),C.type==="shadowToggle"&&typeof C.slot!="number"&&(m(C.enabled),C.enabled||p(null)),C.type==="ghostFrame"){const E=typeof C.slot=="number"?C.slot:-1;E>=0&&E<=2&&typeof C.base64=="string"&&(b(L=>{const W=[...L];return W[E]=C.base64,W}),P(!1))}if(C.type==="ghostSlot"){const E=typeof C.slot=="number"?C.slot:-1;E>=0&&E<=2&&g(E)}if(C.type==="shadowToggle"&&typeof C.slot=="number"){const E=C.slot;E>=0&&E<=2&&!C.enabled&&b(L=>{const W=[...L];return W[E]=null,W})}if(C.type==="inputAction"){const E={id:`${Date.now()}-${Math.random()}`,action:C.action??"mouseClick",label:C.label??"",timestamp:C.timestamp??Date.now()};S(L=>[...L.slice(-11),E]),P(!1),V(!1)}};return R.on("agentUpdate",B),()=>{R.off("agentUpdate",B)}},[]),f.useEffect(()=>{var R;(R=_.current)==null||R.scrollIntoView({behavior:"smooth"})},[N]);const M=async()=>{if(!t){try{const R=await $("/api/system/vision-guidance");if(R.ok){const B=await R.json();B.warn&&B.message&&o(B.message)}}catch{}await $("/api/system/screenshot",{method:"POST",body:JSON.stringify({detect:!0})}).catch(()=>{})}},I=y.some(R=>R!==null);return!(s||x.length>0||N.length>0||t||h||I)||T?null:r.jsx(ee,{children:r.jsxs(U.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]}),h&&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(Aa,{size:9,className:"animate-pulse"}),"Shadow Active"]})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsxs("button",{onClick:M,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(Gi,{size:10}),t?"Scanning…":"Capture"]}),s&&r.jsx("button",{onClick:()=>c(R=>!R),className:"text-gray-700 hover:text-gray-400 transition-colors",title:l?"Collapse preview":"Expand preview",children:l?r.jsx(mh,{size:12}):r.jsx(Ts,{size:12})}),r.jsx("button",{onClick:()=>P(R=>!R),className:"text-gray-700 hover:text-gray-400 transition-colors",title:A?"Expand war room":"Collapse war room",children:A?r.jsx(na,{size:12}):r.jsx(fh,{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(st,{size:12})})]})]}),r.jsx(ee,{children:!A&&r.jsxs(U.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&&y[v]?r.jsxs("div",{className:"flex flex-col",children:[r.jsx("div",{className:"flex border-b border-white/5",children:[0,1,2].map(R=>y[R]!==null&&r.jsxs("button",{onClick:()=>g(R),className:`flex items-center gap-0.5 px-2 py-1 text-[9px] font-bold transition-colors ${v===R?"text-purple-400 border-b-2 border-purple-500":"text-gray-600 hover:text-gray-400"}`,children:[r.jsx(Aa,{size:7})," G",R+1]},R))}),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,${y[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(Aa,{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"})]})]}):h&&u?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,${u}`,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(Aa,{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:d,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(Gi,{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(R=>{const B=T3[R.type]??Kt;return r.jsxs("div",{className:`flex items-center gap-2 px-2.5 py-1.5 rounded-xl text-[11px] font-medium ${P3[R.status]}`,children:[R.status==="running"?r.jsx(ne,{size:11,className:"animate-spin text-orange-400 shrink-0"}):R.status==="done"?r.jsx(Je,{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:R.label})]},R.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(R=>{const B=A3[R.action]??a1,C=M3[R.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:R.label}),r.jsx("span",{className:"text-[9px] text-gray-700 shrink-0 tabular-nums",children:new Date(R.timestamp).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})})]},R.id)}),r.jsx("div",{ref:_})]})]})]})]})]})})]})})}const Am="mustb_briefing_shown",R3=14*60*60*1e3,Ld={CodeHealth:{label:"Kod Sağlığı",Icon:cn,color:"#fb923c"},DepAudit:{label:"Bağımlılık Denetimi",Icon:ra,color:"#a78bfa"},LogAnalysis:{label:"Log Analizi",Icon:Yt,color:"#38bdf8"},LTMGap:{label:"Bellek Boşluğu",Icon:Kt,color:"#34d399"},WorkspaceDiff:{label:"Değişiklik Özeti",Icon:t1,color:"#fbbf24"}};function L3(e){const t=Object.keys(Ld).find(n=>e.toLowerCase().includes(n.toLowerCase()));return t?Ld[t]:{label:e,Icon:cl,color:"#fb923c"}}function D3(e){const t=new Set(["NightShift-Insights","nightshift-insights","nightshift","night-shift"]);return e.find(n=>!t.has(n))??"General"}function Mm(e){if(!e)return"—";const t=Math.round(e/1e3);return t<60?`${t} sn`:`${Math.floor(t/60)} dk ${t%60} sn`}function O3(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 I3={hidden:{opacity:0},show:{opacity:1,transition:{duration:.4}},exit:{opacity:0,transition:{duration:.35}}},B3={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}}},F3={hidden:{},show:{transition:{staggerChildren:.11,delayChildren:.45}}},V3={hidden:{opacity:0,x:24},show:{opacity:1,x:0,transition:{type:"spring",stiffness:300,damping:28}}};function $3(){const[e,t]=f.useState(!1),[n,s]=f.useState(null),[i,a]=f.useState([]),[o,l]=f.useState(!0),c=f.useRef(!1);f.useEffect(()=>{c.current||(c.current=!0,(async()=>{try{const u=await $("/api/automation/nightowl/status");if(!u.ok)return;const p=await u.json();if(!p.lastShiftTs||Date.now()-p.lastShiftTs>R3||localStorage.getItem(Am)===String(p.lastShiftTs)||p.totalFindings===0)return;const h=await $("/api/memory/ltm/search?q=NightShift-Insights&limit=15&category=semantic"),y=(h.ok?await h.json():{results:[]}).results.filter(b=>b.tags.some(v=>v.toLowerCase().includes("nightshift"))).slice(0,8).map(b=>({task:D3(b.tags),summary:b.content.replace(/\n/g," ").slice(0,180)}));s(p),a(y),l(!1),t(!0),localStorage.setItem(Am,String(p.lastShiftTs))}catch{}})())},[]);const d=()=>t(!1);return r.jsx(ee,{children:e&&r.jsx(U.div,{variants:I3,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:u=>{u.target===u.currentTarget&&d()},children:r.jsxs(U.div,{variants:B3,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:d,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(st,{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(U.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(ol,{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:[O3(n.lastShiftTs)," · ",Mm(n.lastShiftMs)," sürdü"]})]})]}),n&&r.jsx(U.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(Ld).length)},{label:"Süre",value:Mm(n.lastShiftMs)}].map(u=>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:u.value}),r.jsx("p",{className:"text-[10px] text-white/30 font-medium mt-0.5",children:u.label})]},u.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(u=>r.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-orange-400/40 animate-bounce",style:{animationDelay:`${u*.15}s`}},u))})}),!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(U.div,{variants:F3,initial:"hidden",animate:"show",className:"space-y-2.5",children:i.map((u,p)=>{const h=L3(u.task),m=h.Icon;return r.jsx(U.div,{variants:V3,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 ${h.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:`${h.color}15`,border:`1px solid ${h.color}30`},children:r.jsx(m,{size:14,style:{color:h.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:h.color},children:h.label}),r.jsx("p",{className:"text-[12.5px] text-white/65 leading-relaxed",children:u.summary})]}),r.jsx(on,{size:13,className:"text-white/15 flex-shrink-0 mt-1"})]})},p)})})]}),r.jsx(U.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:d,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:u=>u.currentTarget.style.background="rgba(249,115,22,0.22)",onMouseLeave:u=>u.currentTarget.style.background="rgba(249,115,22,0.15)",children:[r.jsx(Re,{size:15}),"Günün başlasın"]})})]})},"morning-briefing-overlay")})}const zm={CodeHealth:{label:"Kod Sağlığı",Icon:cn,color:"#fb923c"},DepAudit:{label:"Bağımlılık",Icon:ra,color:"#a78bfa"},LogAnalysis:{label:"Log Analizi",Icon:Yt,color:"#38bdf8"},LTMGap:{label:"Bellek",Icon:Kt,color:"#34d399"},WorkspaceDiff:{label:"Değişiklikler",Icon:t1,color:"#fbbf24"}};function U3(e){const t=Object.keys(zm).find(n=>e.toLowerCase().includes(n.toLowerCase()));return t?zm[t]:{label:e,Icon:cl,color:"#fb923c"}}function H3(e){const t=Math.round(e/1e3);return t<60?`${t}s`:`${Math.floor(t/60)}m ${t%60}s`}const W3={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}}},G3={hidden:{opacity:0,y:-6},show:{opacity:1,y:0,transition:{duration:.22}}};function K3(){const[e,t]=f.useState("idle"),[n,s]=f.useState([]),[i,a]=f.useState(null),[o,l]=f.useState(!1),[c,d]=f.useState(!1),u=f.useRef(null),p=f.useRef(0),h=f.useCallback((y=2e4)=>{u.current&&clearTimeout(u.current),u.current=setTimeout(()=>{l(!1),setTimeout(()=>d(!1),600)},y)},[]);if(f.useEffect(()=>{const y=at();return y.on("nightOwlEvent",b=>{if(b.type==="shiftStart"){u.current&&clearTimeout(u.current),t("scanning"),s([]),a(null),d(!0),l(!0);return}if(b.type==="finding"){const v={id:`${++p.current}`,task:String(b.task??"General"),summary:String(b.summary??"").slice(0,120),ts:Number(b.ts??Date.now())};s(g=>[v,...g].slice(0,20));return}if(b.type==="shiftEnd"){t("done"),a({findingsCount:Number(b.findingsCount??0),durationMs:Number(b.durationMs??0),ts:Number(b.ts??Date.now())}),h(2e4);return}}),()=>{y.off("nightOwlEvent"),u.current&&clearTimeout(u.current)}},[h]),!c)return null;const m="#fb923c";return r.jsx(ee,{children:r.jsx(U.div,{variants:W3,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(y=>!y),u.current&&clearTimeout(u.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(Je,{size:13,className:"text-green-400 flex-shrink-0"}):r.jsx(ol,{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 · ",H3(i.durationMs)]})]}),o?r.jsx(fh,{size:12,className:"text-white/25"}):r.jsx(na,{size:12,className:"text-white/25"})]}),r.jsx(ee,{children:o&&r.jsxs(U.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(y=>r.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-orange-400/50 animate-bounce",style:{animationDelay:`${y*.15}s`}},y))}),r.jsx("span",{className:"text-[11px] text-white/30",children:"Sistem analiz ediliyor…"})]}),r.jsx(ee,{initial:!1,children:n.map(y=>{const b=U3(y.task),v=b.Icon;return r.jsxs(U.div,{variants:G3,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:`${b.color}15`,border:`1px solid ${b.color}30`},children:r.jsx(v,{size:11,style:{color:b.color}})}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("p",{className:"text-[10px] font-bold mb-0.5",style:{color:b.color},children:b.label}),r.jsx("p",{className:"text-[11px] text-white/50 leading-snug line-clamp-3",children:y.summary})]})]},y.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 Rm="mustb_boot_report",Lm=14e3;function q3({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 Y3(){const[e,t]=f.useState(!1),[n,s]=f.useState(null),i=f.useCallback(()=>{t(!1),localStorage.removeItem(Rm)},[]);return f.useEffect(()=>{if(localStorage.getItem(Rm)!=="1")return;t(!0),$("/api/status").then(o=>o.ok?o.json():null).then(o=>{o&&s(o)}).catch(()=>{});const a=setTimeout(i,Lm);return()=>clearTimeout(a)},[i]),r.jsx(ee,{children:e&&r.jsx(U.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(st,{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(Je,{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(Sn,{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(i1,{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(Re,{size:10})," Score"]}),r.jsx(q3,{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(U.div,{initial:{scaleX:1},animate:{scaleX:0},transition:{duration:Lm/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 Dm(){return f.useEffect(()=>{at()},[]),r.jsxs("div",{className:"flex flex-col h-[calc(100vh-72px)] overflow-hidden",children:[r.jsx(E3,{}),r.jsx(z3,{}),r.jsx(_3,{}),r.jsx(Y3,{}),r.jsx($3,{}),r.jsx(K3,{})]})}function ia(){const[e,t]=f.useState(!1),[n,s]=f.useState(!0),i=f.useRef(!0),a=f.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 f.useEffect(()=>{i.current=!0,a();const o=setInterval(a,15e3),l=()=>{a()},c=()=>{a()},d=()=>{i.current&&t(!1)};try{at()}catch{}return window.addEventListener("mustb:connected",l),window.addEventListener("mustb:reconnected",c),window.addEventListener("mustb:disconnected",d),()=>{i.current=!1,clearInterval(o),window.removeEventListener("mustb:connected",l),window.removeEventListener("mustb:reconnected",c),window.removeEventListener("mustb:disconnected",d)}},[a]),{online:e,loading:n}}function Om({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 X3(){const{online:e}=ia(),[t,n]=f.useState(null),[s,i]=f.useState([]),[a,o]=f.useState(null),[l,c]=f.useState(null),[d,u]=f.useState(!0);f.useEffect(()=>{(async()=>{var g;u(!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{u(!1)}})()},[e]),f.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(d)return r.jsxs("div",{className:"flex items-center justify-center py-12",children:[r.jsx(le,{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(Ds,{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(Om,{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 h=(t==null?void 0:t.channelOrder)??[],m=(t==null?void 0:t.channelLabels)??{},y=(t==null?void 0:t.channelAccounts)??{};if(h.length===0)return r.jsx("p",{className:"text-center text-sm text-gray-600 py-8",children:"Yapılandırılmış kanal bulunamadı."});const b=a?y[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:h.map(v=>{const g=y[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(Om,{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?b.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:b.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(Je,{size:13,className:"text-green-400 flex-shrink-0"}):v.lastError?r.jsx(Zy,{size:13,className:"text-red-400 flex-shrink-0"}):r.jsx(es,{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(xh,{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 Q3(e){return e===0?"Free":e<1?`$${e.toFixed(3)}/1M`:`$${e.toFixed(2)}/1M`}function J3(e){return e?e>=1e3?`${(e/1e3).toFixed(0)}M`:`${e}k`:"—"}const Im={free:{label:"Free",icon:r.jsx(PS,{size:11}),color:"#22c55e",bg:"rgba(34,197,94,0.12)"},balanced:{label:"Balanced",icon:r.jsx(qS,{size:11}),color:"#60a5fa",bg:"rgba(96,165,250,0.12)"},power:{label:"Power",icon:r.jsx(Re,{size:11}),color:"#f59e0b",bg:"rgba(245,158,11,0.12)"}};function Z3({currentModel:e,onSelect:t,className:n}){const[s,i]=f.useState(null),[a,o]=f.useState(!0),[l,c]=f.useState(null),[d,u]=f.useState("free"),[p,h]=f.useState(""),m=f.useRef(null),y=(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";u(w)}o(!1)}).catch(x=>{c(x.message),o(!1)})};f.useEffect(()=>{y()},[]),f.useEffect(()=>{m.current&&m.current.scrollIntoView({block:"nearest",behavior:"smooth"})},[d,s]);const b=(s==null?void 0:s[d])??[],v=p?b.filter(g=>g.name.toLowerCase().includes(p.toLowerCase())||g.id.toLowerCase().includes(p.toLowerCase())):b;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:()=>y(!0),className:"text-gray-600 hover:text-orange-400 transition-colors p-1 rounded",title:"Refresh catalog",disabled:a,children:r.jsx(le,{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=Im[g],w=((k=s==null?void 0:s.totals)==null?void 0:k[g])??0,j=d===g;return r.jsxs("button",{onClick:()=>u(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(qt,{size:11,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-gray-600"}),r.jsx("input",{value:p,onChange:g=>h(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(le,{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:()=>y(!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=Im[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(Ts,{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:Q3(g.costPer1M)}),r.jsxs("span",{className:"text-[9px] text-gray-600",children:[J3(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 uc=[{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 eC(){const{locale:e,setLocale:t}=pt(),[n,s]=f.useState(!1),i=f.useRef(null),a=uc.find(o=>o.code===e)??uc[0];return f.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(DS,{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(ee,{children:n&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"fixed inset-0 z-10",onClick:()=>s(!1)}),r.jsxs(U.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"})}),uc.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(Mt,{size:12,className:"text-orange-400 shrink-0"})]},o.code)})]})]})})]})}const Bm={frontier:"⚡ Frontier",gateway:"🌐 Gateway",fast:"🚀 Fast",local:"💻 Local",open:"🔓 Open Source",specialist:"🎯 Specialist",regional:"🌏 Regional",enterprise:"🏢 Enterprise",custom:"⚙️ Custom"},Fm=["frontier","gateway","fast","local","open","specialist","regional","enterprise","custom"];function E1({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 tC({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(E1,{tag:s},s))})]}),t&&r.jsx(on,{size:13,className:"text-orange-400 shrink-0 mt-1"})]})})}function nC(){const{t:e}=pt(),t=e.panels.settings,[n,s]=f.useState([]),[i,a]=f.useState(null),[o,l]=f.useState([]),[c,d]=f.useState("all"),[u,p]=f.useState(""),[h,m]=f.useState(null),[y,b]=f.useState(""),[v,g]=f.useState(""),[x,w]=f.useState(!1),[j,k]=f.useState(!1),[N,S]=f.useState(!1),[_,A]=f.useState(null),[P,T]=f.useState(null),[V,M]=f.useState(!!window.__MUSTB_NEED_API_KEY),[I,z]=f.useState(null),[R,B]=f.useState("providers"),C=f.useRef(null);f.useEffect(()=>{$("/api/setup/providers").then(X=>X.ok?X.json():null).then(X=>{X!=null&&X.providers&&s(X.providers)}).catch(()=>{}),$("/api/setup/status").then(X=>X.ok?X.json():null).then(X=>{X&&a(X)}).catch(()=>{}),$("/api/setup/ollama-models").then(X=>X.ok?X.json():null).then(X=>{X!=null&&X.models&&l(X.models)}).catch(()=>{});const G=()=>{M(!0),window.__MUSTB_NEED_API_KEY=!0};return window.addEventListener("mustb:401",G),()=>window.removeEventListener("mustb:401",G)},[]),f.useEffect(()=>{h&&b(h.defaultModel)},[h]);const E=u.toLowerCase(),L=n.filter(G=>!(c!=="all"&&G.category!==c||E&&!G.label.toLowerCase().includes(E)&&!G.description.toLowerCase().includes(E))),W={};for(const G of L)W[G.category]||(W[G.category]=[]),W[G.category].push(G);const q=async()=>{if(h){k(!0),A(null);try{const X=await(await $("/api/setup/test-key",{method:"POST",body:JSON.stringify({provider:h.id,apiKey:v||void 0,model:y||void 0})})).json();A({ok:X.ok,msg:X.message??(X.ok?"Connection successful":"Connection failed")})}catch{A({ok:!1,msg:"Gateway unreachable"})}k(!1)}},te=async()=>{if(!(!h||!h.envKeyIsUrl&&!v.trim())){S(!0),T(null);try{const X=await $("/api/setup/update-key",{method:"POST",body:JSON.stringify({provider:h.id,apiKey:v||void 0,model:y||void 0})});if(X.ok){T("Saved successfully."),g(""),window.__MUSTB_NEED_API_KEY=!1,M(!1);const zt=await $("/api/setup/status");zt.ok&&a(await zt.json())}else{const zt=await X.json();T(zt.error??"Failed to save.")}}catch{T("Gateway unreachable.")}S(!1),setTimeout(()=>T(null),6e3)}},se=G=>{z(G),$("/api/setup/save",{method:"POST",body:JSON.stringify({provider:"ollama",model:G})}).finally(()=>{setTimeout(()=>z(null),3e3)})},de=(h==null?void 0:h.envKeyIsUrl)??!1,fe=(h==null?void 0:h.id)==="ollama",ae=(h==null?void 0:h.id)==="openrouter",Ze=Fm.filter(G=>n.some(X=>X.category===G)),kt=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(bh,{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(eC,{}),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(Sn,{size:11,className:kt}),r.jsxs("span",{className:`text-[11px] font-semibold ${kt}`,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(es,{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 ${R==="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(Sn,{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 ${R==="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(US,{size:11})," Kanallar"]})]}),R==="channels"&&r.jsx("div",{className:"flex-1 overflow-y-auto p-5",children:r.jsx(X3,{})}),R==="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(qt,{size:12,className:"absolute left-3 top-1/2 -translate-y-1/2 text-gray-400"}),r.jsx("input",{ref:C,type:"text",value:u,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:()=>d("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}),Ze.map(G=>r.jsx("button",{onClick:()=>d(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:Bm[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…"]}),Fm.filter(G=>{var X;return(X=W[G])==null?void 0:X.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:Bm[G]}),r.jsx("div",{className:"space-y-1.5",children:W[G].map(X=>r.jsx(tC,{p:X,active:(h==null?void 0:h.id)===X.id,onClick:()=>{m(X),A(null),g("")}},X.id))})]},G)),n.length>0&&L.length===0&&r.jsxs("p",{className:"text-[12px] text-gray-400 py-4 text-center",children:['No providers match "',u,'"']})]})]}),r.jsx("div",{className:"flex-1 flex flex-col min-h-0 overflow-y-auto",children:h?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:h.label}),r.jsx("p",{className:"text-[12px] text-gray-400 mt-0.5 leading-snug",children:h.description}),r.jsx("div",{className:"flex flex-wrap gap-1 mt-1.5",children:h.tags.map(G=>r.jsx(E1,{tag:G},G))})]}),r.jsxs("a",{href:h.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})]})]}),fe&&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 X=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 ${X}`,children:G.fit}),r.jsxs("button",{onClick:()=>{b(G.id),se(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(xi,{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:[de?r.jsx(XS,{size:9}):r.jsx(RS,{size:9}),de?t.baseUrl:t.apiKey]}),fe&&!de?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||de?"text":"password",value:v,onChange:G=>{g(G.target.value),A(null)},placeholder:h.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"}),!de&&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(mh,{size:13}):r.jsx(Ts,{size:13})})]}),r.jsx("p",{className:"text-[10px] text-gray-400 px-1",children:de?`Stored in .env as ${h.envKey}. Default: ${h.placeholder}`:`Stored locally in .env as ${h.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(Re,{size:9}),t.model]}),ae?r.jsx(Z3,{currentModel:y,onSelect:b,className:"rounded-xl border border-white/10 bg-white/3"}):r.jsx("select",{value:y,onChange:G=>b(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:h.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:[!fe&&r.jsxs("button",{onClick:q,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(le,{size:12,className:j?"animate-spin":""}),j?t.testing:t.testConnection]}),r.jsxs("button",{onClick:te,disabled:N||!v.trim()&&!de&&!fe,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(l1,{size:12,className:N?"animate-spin":""}),N?t.saving:t.save]})]}),_&&r.jsxs("div",{className:`flex items-start gap-2 px-3.5 py-2.5 rounded-xl border text-[12px] ${_.ok?"bg-green-500/8 border-green-500/20 text-green-300":"bg-red-500/8 border-red-500/20 text-red-300"}`,children:[_.ok?r.jsx(Je,{size:13,className:"shrink-0 mt-0.5"}):r.jsx(es,{size:13,className:"shrink-0 mt-0.5"}),_.msg]}),P&&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(Je,{size:13,className:"shrink-0"}),P]}),fe&&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(zS,{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(Xe,{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 sC(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 rC(){const{online:e}=ia(),[t,n]=f.useState([]),[s,i]=f.useState(!0),[a,o]=f.useState("all"),l=async()=>{i(!0);try{const p=await(await $("/api/gateway/sessions?limit=50&includeDerivedTitles=true&includeLastMessage=true")).json(),h=Array.isArray(p)?p:Array.isArray(p==null?void 0:p.sessions)?p.sessions:[];n(h)}catch{n([])}finally{i(!1)}};f.useEffect(()=>{l()},[e]);const c=u=>!!u.runningAtMs&&Date.now()-u.runningAtMs<12e4,d=t.filter(u=>a==="running"?c(u):a==="idle"?!c(u):!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(Xe,{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(le,{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(Ds,{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(u=>r.jsx("button",{onClick:()=>o(u),className:`px-3 py-1.5 rounded-xl text-[11px] font-semibold border transition-all ${a===u?"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:u==="all"?"Tümü":u==="running"?"Çalışıyor":"Boşta"},u))}),s?r.jsx("div",{className:"flex items-center justify-center py-12",children:r.jsx(le,{size:18,className:"animate-spin text-orange-400"})}):d.length===0?r.jsxs("div",{className:"flex flex-col items-center justify-center py-16 gap-3",children:[r.jsx(sa,{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:d.map(u=>{const p=c(u);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:u.derivedTitle??u.label??u.key.slice(0,20)+"…"}),u.agentId&&r.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-gray-600 flex-shrink-0",children:[r.jsx(Sn,{size:9}),u.agentId]})]}),u.lastMessage&&r.jsx("p",{className:"text-[11px] text-gray-500 truncate mb-1",children:u.lastMessage}),r.jsxs("div",{className:"flex items-center gap-3",children:[u.messageCount!==void 0&&r.jsxs("span",{className:"text-[10px] text-gray-600",children:[u.messageCount," mesaj"]}),r.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-gray-600",children:[r.jsx(en,{size:9}),sC(u.lastActivityAt)]})]})]})]})},u.key)})})]})}function iC(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 aC(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 oC(){const{online:e}=ia(),[t,n]=f.useState([]),[s,i]=f.useState(!0),[a,o]=f.useState("all"),[l,c]=f.useState(null),[d,u]=f.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)}};f.useEffect(()=>{p()},[e]);const h=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)}},y=async g=>{if(window.confirm("Bu otomasyon silinsin mi?")){u(g);try{await $(`/api/gateway/automations/${g}`,{method:"DELETE"}),n(x=>x.filter(w=>w.id!==g))}catch{}finally{u(null)}}},b=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(Je,{size:9})," Başarılı"]}):g==="error"?r.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-red-400",children:[r.jsx(Zy,{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(Re,{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(Ds,{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(le,{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(le,{size:18,className:"animate-spin text-orange-400"})}):b.length===0?r.jsxs("div",{className:"flex flex-col items-center justify-center py-16 gap-3",children:[r.jsx(Re,{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:b.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:()=>h(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(n4,{size:18,className:"text-orange-400"}):r.jsx(t4,{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(en,{size:9})," ",iC(g.schedule)]}),((w=g.state)==null?void 0:w.nextRunAtMs)&&r.jsx("span",{className:"text-[11px] text-gray-600",children:aC(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(le,{size:9,className:"animate-spin"}):r.jsx(Rs,{size:9}),"Çalıştır"]}),r.jsxs("button",{onClick:()=>y(g.id),disabled:!e||d===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:[d===g.id?r.jsx(le,{size:9,className:"animate-spin"}):r.jsx(Ls,{size:9}),"Sil"]})]})]})},g.id)})})]})}function lC(e){var t;return(t=e.presence)!=null&&t.ts?Date.now()-e.presence.ts<6e4:!1}function cC({platform:e}){const t=(e??"").toLowerCase();return t.includes("ios")||t.includes("iphone")?r.jsx(ym,{size:14,className:"text-gray-400"}):t.includes("android")?r.jsx(ym,{size:14,className:"text-green-500"}):t.includes("mac")||t.includes("darwin")?r.jsx(Xy,{size:14,className:"text-gray-300"}):t.includes("win")?r.jsx(vh,{size:14,className:"text-blue-400"}):r.jsx(OS,{size:14,className:"text-gray-500"})}function dC(){const{online:e}=ia(),[t,n]=f.useState([]),[s,i]=f.useState(!0),[a,o]=f.useState(null),[l,c]=f.useState(""),d=async()=>{i(!0);try{const h=await(await $("/api/gateway/clients")).json();n(Array.isArray(h==null?void 0:h.nodes)?h.nodes:Array.isArray(h)?h:[])}catch{n([])}finally{i(!1)}};f.useEffect(()=>{d()},[e]);const u=async p=>{if(!l.trim()){o(null);return}try{await $(`/api/gateway/clients/${p}/rename`,{method:"POST",body:JSON.stringify({displayName:l.trim()})}),n(h=>h.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(vm,{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(Ds,{size:10})," Çevrimdışı"]}),r.jsxs("button",{onClick:d,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(le,{size:12,className:s?"animate-spin":""})," Yenile"]})]})]}),s?r.jsx("div",{className:"flex justify-center py-12",children:r.jsx(le,{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(vm,{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(cC,{platform:p.platform}),r.jsx("div",{className:"flex-1 min-w-0",children:a===p.nodeId?r.jsx("input",{autoFocus:!0,value:l,onChange:h=>c(h.target.value),onBlur:()=>u(p.nodeId),onKeyDown:h=>{h.key==="Enter"&&u(p.nodeId),h.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 ${lC(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(h=>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:h},h)),(p.caps??[]).length>3&&r.jsxs("span",{className:"text-[9px] text-gray-600",children:["+",(p.caps??[]).length-3]})]})]})]},p.nodeId))})]})}function uC({online:e}){var d;const[t,n]=f.useState({}),[s,i]=f.useState(!0),a=f.useRef(0),o=f.useRef(null),l=async(u=0)=>{try{const h=await(await $(`/api/gateway/logs?cursor=${u}&limit=200`)).json();u===0?(n(h),a.current=h.cursor??0):(n(m=>({...h,lines:[...m.lines??[],...h.lines??[]]})),a.current=h.cursor??a.current)}catch{}finally{i(!1)}};f.useEffect(()=>{l(0)},[e]),f.useEffect(()=>{const u=setInterval(()=>l(a.current),1e4);return()=>clearInterval(u)},[e]),f.useEffect(()=>{o.current&&(o.current.scrollTop=o.current.scrollHeight)},[(d=t.lines)==null?void 0:d.length]);const c=u=>u.includes("error")||u.includes("ERROR")?"text-red-400":u.includes("warn")||u.includes("WARN")?"text-amber-400":u.includes("info")||u.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(`
|
|
683
|
-
`)),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(Wi,{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(le,{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((u,p)=>r.jsx("p",{className:`whitespace-pre-wrap break-all leading-5 ${c(u)}`,children:u},p))})]})}function hC({online:e}){var l,c;const[t,n]=f.useState({}),[s,i]=f.useState(!0);f.useEffect(()=>{i(!0),$("/api/gateway/usage/cost").then(d=>d.json()).then(n).catch(()=>n({})).finally(()=>i(!1))},[e]);const a=t.daily??[],o=Math.max(1,...a.map(d=>d.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(Ds,{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(CS,{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((d,u)=>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:d.provider}),r.jsx("span",{className:"text-right text-gray-500",children:(d.inputTokens??0).toLocaleString()}),r.jsx("span",{className:"text-right text-gray-500",children:(d.outputTokens??0).toLocaleString()}),r.jsxs("span",{className:"text-right text-orange-400",children:["$",(d.cost??0).toFixed(4)]})]},u))]}),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((d,u)=>{var h;const p=Math.max(2,Math.round((d.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:`${d.date}: ${(d.tokens??0).toLocaleString()} token`}),r.jsx("span",{className:"text-[8px] text-gray-700 truncate w-full text-center",children:(h=d.date)==null?void 0:h.slice(5)})]},u)})})]})]})}function pC({online:e}){const[t,n]=f.useState([]),[s,i]=f.useState(!0);return f.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(le,{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 fC(){const{online:e}=ia(),[t,n]=f.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(NS,{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(Ds,{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(uC,{online:e}),t==="usage"&&r.jsx(hC,{online:e}),t==="sessions"&&r.jsx(pC,{online:e})]})}function mC(){const[e,t]=f.useState([]),[n,s]=f.useState(!0),[i,a]=f.useState("all"),[o,l]=f.useState(new Set);f.useEffect(()=>{s(!0),$("/api/tools").then(u=>u.json()).then(u=>{const p=Array.isArray(u==null?void 0:u.groups)?u.groups:[];t(p),l(new Set(p.slice(0,3).map(h=>h.id)))}).catch(()=>t([])).finally(()=>s(!1))},[]);const c=e.map(u=>({...u,tools:(u.tools??[]).filter(p=>i==="core"?p.source!=="plugin":i==="plugin"?p.source==="plugin":!0)})).filter(u=>u.tools.length>0),d=u=>{l(p=>{const h=new Set(p);return h.has(u)?h.delete(u):h.add(u),h})};return r.jsxs("div",{className:"space-y-3",children:[r.jsx("div",{className:"flex gap-1.5",children:["all","core","plugin"].map(u=>r.jsx("button",{onClick:()=>a(u),className:`px-3 py-1.5 rounded-xl text-[11px] font-semibold border transition-all ${i===u?"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:u==="all"?"All":u==="core"?"Core":"Plugin"},u))}),n?r.jsx("div",{className:"flex justify-center py-10",children:r.jsx(le,{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(u=>{var p;return r.jsxs("div",{className:"rounded-xl bg-white/[0.02] border border-white/6 overflow-hidden",children:[r.jsxs("button",{onClick:()=>d(u.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(kh,{size:12,className:"text-orange-400"}),r.jsx("span",{className:"text-[12px] font-semibold text-gray-300",children:u.label??u.id}),r.jsxs("span",{className:"text-[10px] text-gray-600",children:[((p=u.tools)==null?void 0:p.length)??0," tools"]})]}),o.has(u.id)?r.jsx(na,{size:12,className:"text-gray-600"}):r.jsx(on,{size:12,className:"text-gray-600"})]}),o.has(u.id)&&r.jsx("div",{className:"border-t border-white/5 divide-y divide-white/4",children:(u.tools??[]).map((h,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:h.label??h.name}),h.description&&r.jsx("p",{className:"text-[11px] text-gray-600 line-clamp-1",children:h.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 ${h.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:h.source==="plugin"?"plugin":"core"})})]},m))})]},u.id)})})]})}function gC(){const[e,t]=f.useState([]),[n,s]=f.useState(!0);return f.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(le,{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 xC(){const[e,t]=f.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(ra,{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(kh,{size:11}):r.jsx(Hi,{size:11}),n==="tools"?"Tools":"Agents"]},n))}),e==="tools"&&r.jsx(mC,{}),e==="agents"&&r.jsx(gC,{})]})}const Vm=[{key:"all",label:"Tümü",icon:il,test:()=>!0},{key:"nightowl",label:"NightOwl Bulguları",icon:ol,test:e=>e.tags.some(t=>/nightshift|nightowl/i.test(t))},{key:"preferences",label:"Kullanıcı Tercihleri",icon:d1,test:e=>e.category==="semantic"&&!e.tags.some(t=>/project|workspace|nightshift|nightowl/i.test(t))},{key:"architecture",label:"Proje Mimarisi",icon:r1,test:e=>e.tags.some(t=>/project|workspace|context|summary/i.test(t))},{key:"episodic",label:"Episodik",icon:en,test:e=>e.category==="episodic"},{key:"semantic",label:"Semantik",icon:Kt,test:e=>e.category==="semantic"}],yC={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 vC(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 bC={fresh:"#34d399",recent:"#f97316",old:"#a78bfa",ancient:"#6b7280"};function $m(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 wC({entry:e,query:t,index:n,onDelete:s}){const[i,a]=f.useState(!1),[o,l]=f.useState(!1),c=vC(e.createdAt),d=yC[e.category],u=e.content.slice(0,180),p=e.content.length>180,h=async m=>{m.stopPropagation(),l(!0);try{(await $(`/api/memory/ltm/delete/${e.id}`,{method:"DELETE"})).ok?(s(e.id),pe.success("Kayıt silindi.")):pe.error("Silinemedi.")}catch{pe.error("Bağlantı hatası.")}l(!1)};return r.jsxs(U.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 ${d.border}`,backdropFilter:"blur(20px)",boxShadow:`0 4px 24px rgba(0,0,0,0.45), 0 0 0 1px ${d.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 ${d.bg}`},children:[r.jsx("span",{className:"mt-0.5 w-2 h-2 rounded-full flex-shrink-0",style:{background:d.dot,boxShadow:`0 0 6px ${d.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:$m(i?e.content:u+(p?"…":""),t)})}),p&&r.jsx(U.span,{animate:{rotate:i?90:0},transition:{duration:.18},className:"flex-shrink-0 text-white/20",children:r.jsx(on,{size:14})}),r.jsx("button",{onClick:h,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(Ls,{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:d.dot,background:d.bg,border:`1px solid ${d.border}`},children:d.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(c1,{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:bC[c.tier]},title:e.createdAt,children:[r.jsx(en,{size:9}),c.label]})]})]})}function kC({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 jC({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(U.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(es,{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(st,{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 NC(){const[e,t]=f.useState([]),[n,s]=f.useState(!0),[i,a]=f.useState(""),[o,l]=f.useState("all"),[c,d]=f.useState(!1),[u,p]=f.useState(!1),h=f.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)},[]);f.useEffect(()=>{h()},[h]);const m=v=>{t(g=>g.filter(x=>x.id!==v))},y=async()=>{p(!0);try{const v=await $("/api/memory/ltm/clear-all",{method:"DELETE"});if(v.ok){const g=await v.json();t([]),pe.success(`${g.deleted??0} kayıt temizlendi.`)}else pe.error("Temizleme başarısız.")}catch{pe.error("Bağlantı hatası.")}p(!1),d(!1)},b=f.useMemo(()=>{var x;const v=((x=Vm.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(Kt,{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:()=>d(!0),disabled:u||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(Ls,{size:11}),"Tüm Hafızayı Temizle"]}),r.jsxs("button",{onClick:()=>void h(),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(le,{size:11,className:n?"animate-spin":""}),"Yenile"]})]})]}),!n&&r.jsx(kC,{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(qt,{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(ES,{size:11,className:"text-white/25"}),Vm.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(U.div,{animate:{rotate:360},transition:{repeat:1/0,duration:1.5,ease:"linear"},children:r.jsx(Kt,{size:28,className:"text-orange-500/50"})}),r.jsx("p",{className:"text-[12px] text-white/30",children:"Hafıza taranıyor…"})]}):b.length===0?r.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 py-24",children:[r.jsx(cl,{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:[b.length," kayıt gösteriliyor",i&&r.jsxs(r.Fragment,{children:[" · ",r.jsxs("span",{className:"text-orange-400/60",children:['"',i,'"']})," araması"]})]}),r.jsx(ee,{mode:"popLayout",children:b.map((v,g)=>r.jsx(wC,{entry:v,query:i,index:g,onDelete:m},v.id))})]}),r.jsx(ee,{children:c&&r.jsx(jC,{onConfirm:y,onCancel:()=>d(!1)})})]})}const La=`# Must-b Zihni
|
|
682
|
+
`)}`:"⏹ Durduruldu.");return{...I,status:"done",content:z}})),g.current=null},disabled:j||_}),r.jsx("p",{className:"text-center text-[11px] text-white/20 mt-2 select-none",children:e.chat.disclaimer})]})]})]})}function _3(){const[e,t]=f.useState(!1);return f.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(ee,{children:e&&r.jsxs(U.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(U.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(U.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(Gi,{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 Ra={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)"},E3={browse:Xe,write:Yt,think:Kt,exec:Ps},T3={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"},P3={mouseMove:HS,mouseClick:i1,typeText:RS,visionClick:Ts},A3={mouseMove:"text-gray-500",mouseClick:"text-orange-400",typeText:"text-blue-400",visionClick:"text-purple-400"};function M3(){const{t:e}=pt(),[t,n]=f.useState(!1),[s,i]=f.useState(null),[a,o]=f.useState(null),[l,c]=f.useState(!1),d=f.useRef(null),[u,p]=f.useState(null),[h,m]=f.useState(!1),[y,b]=f.useState(()=>new Array(3).fill(null)),[v,g]=f.useState(0),[x,w]=f.useState([]),[j,k]=f.useState(null),[N,S]=f.useState([]),_=f.useRef(null),[A,P]=f.useState(!1),[T,V]=f.useState(!1);f.useEffect(()=>{if(!s||!d.current)return;const R=d.current,B=R.getContext("2d");if(!B)return;const C=new Image;C.onload=()=>{var E;if(R.width=C.width,R.height=C.height,B.drawImage(C,0,0),(E=s.elements)!=null&&E.length)for(const L of s.elements)B.strokeStyle=Ra[L.type]??Ra.unknown,B.lineWidth=Math.max(2,Math.round(C.width/400)),B.strokeRect(L.x,L.y,L.width,L.height),B.fillStyle=Ra[L.type]??Ra.unknown,B.font=`${Math.max(10,Math.round(C.width/120))}px monospace`,B.fillText(L.type,L.x+4,L.y+14)},C.src=`data:image/png;base64,${s.base64}`},[s]),f.useEffect(()=>{const R=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}),P(!1),V(!1)),C.type==="workflowStart"&&(k(C.goal??null),w(C.steps??[]),P(!1),V(!1)),C.type==="workflowStep"&&C.step){const E=C.step;w(L=>L.map(W=>W.id===E.id?E:W))}if(C.type==="workflowDone"&&setTimeout(()=>{w([]),k(null)},2500),C.type==="shadowFrame"&&typeof C.slot!="number"&&(p(C.base64),m(!0),P(!1)),C.type==="shadowToggle"&&typeof C.slot!="number"&&(m(C.enabled),C.enabled||p(null)),C.type==="ghostFrame"){const E=typeof C.slot=="number"?C.slot:-1;E>=0&&E<=2&&typeof C.base64=="string"&&(b(L=>{const W=[...L];return W[E]=C.base64,W}),P(!1))}if(C.type==="ghostSlot"){const E=typeof C.slot=="number"?C.slot:-1;E>=0&&E<=2&&g(E)}if(C.type==="shadowToggle"&&typeof C.slot=="number"){const E=C.slot;E>=0&&E<=2&&!C.enabled&&b(L=>{const W=[...L];return W[E]=null,W})}if(C.type==="inputAction"){const E={id:`${Date.now()}-${Math.random()}`,action:C.action??"mouseClick",label:C.label??"",timestamp:C.timestamp??Date.now()};S(L=>[...L.slice(-11),E]),P(!1),V(!1)}};return R.on("agentUpdate",B),()=>{R.off("agentUpdate",B)}},[]),f.useEffect(()=>{var R;(R=_.current)==null||R.scrollIntoView({behavior:"smooth"})},[N]);const M=async()=>{if(!t){try{const R=await $("/api/system/vision-guidance");if(R.ok){const B=await R.json();B.warn&&B.message&&o(B.message)}}catch{}await $("/api/system/screenshot",{method:"POST",body:JSON.stringify({detect:!0})}).catch(()=>{})}},I=y.some(R=>R!==null);return!(s||x.length>0||N.length>0||t||h||I)||T?null:r.jsx(ee,{children:r.jsxs(U.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]}),h&&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(Aa,{size:9,className:"animate-pulse"}),"Shadow Active"]})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsxs("button",{onClick:M,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(Gi,{size:10}),t?"Scanning…":"Capture"]}),s&&r.jsx("button",{onClick:()=>c(R=>!R),className:"text-gray-700 hover:text-gray-400 transition-colors",title:l?"Collapse preview":"Expand preview",children:l?r.jsx(mh,{size:12}):r.jsx(Ts,{size:12})}),r.jsx("button",{onClick:()=>P(R=>!R),className:"text-gray-700 hover:text-gray-400 transition-colors",title:A?"Expand war room":"Collapse war room",children:A?r.jsx(na,{size:12}):r.jsx(fh,{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(st,{size:12})})]})]}),r.jsx(ee,{children:!A&&r.jsxs(U.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&&y[v]?r.jsxs("div",{className:"flex flex-col",children:[r.jsx("div",{className:"flex border-b border-white/5",children:[0,1,2].map(R=>y[R]!==null&&r.jsxs("button",{onClick:()=>g(R),className:`flex items-center gap-0.5 px-2 py-1 text-[9px] font-bold transition-colors ${v===R?"text-purple-400 border-b-2 border-purple-500":"text-gray-600 hover:text-gray-400"}`,children:[r.jsx(Aa,{size:7})," G",R+1]},R))}),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,${y[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(Aa,{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"})]})]}):h&&u?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,${u}`,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(Aa,{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:d,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(Gi,{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(R=>{const B=E3[R.type]??Kt;return r.jsxs("div",{className:`flex items-center gap-2 px-2.5 py-1.5 rounded-xl text-[11px] font-medium ${T3[R.status]}`,children:[R.status==="running"?r.jsx(ne,{size:11,className:"animate-spin text-orange-400 shrink-0"}):R.status==="done"?r.jsx(Je,{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:R.label})]},R.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(R=>{const B=P3[R.action]??i1,C=A3[R.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:R.label}),r.jsx("span",{className:"text-[9px] text-gray-700 shrink-0 tabular-nums",children:new Date(R.timestamp).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})})]},R.id)}),r.jsx("div",{ref:_})]})]})]})]})]})})]})})}const Am="mustb_briefing_shown",z3=14*60*60*1e3,Ld={CodeHealth:{label:"Kod Sağlığı",Icon:cn,color:"#fb923c"},DepAudit:{label:"Bağımlılık Denetimi",Icon:ra,color:"#a78bfa"},LogAnalysis:{label:"Log Analizi",Icon:Yt,color:"#38bdf8"},LTMGap:{label:"Bellek Boşluğu",Icon:Kt,color:"#34d399"},WorkspaceDiff:{label:"Değişiklik Özeti",Icon:e1,color:"#fbbf24"}};function R3(e){const t=Object.keys(Ld).find(n=>e.toLowerCase().includes(n.toLowerCase()));return t?Ld[t]:{label:e,Icon:cl,color:"#fb923c"}}function L3(e){const t=new Set(["NightShift-Insights","nightshift-insights","nightshift","night-shift"]);return e.find(n=>!t.has(n))??"General"}function Mm(e){if(!e)return"—";const t=Math.round(e/1e3);return t<60?`${t} sn`:`${Math.floor(t/60)} dk ${t%60} sn`}function D3(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 O3={hidden:{opacity:0},show:{opacity:1,transition:{duration:.4}},exit:{opacity:0,transition:{duration:.35}}},I3={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}}},B3={hidden:{},show:{transition:{staggerChildren:.11,delayChildren:.45}}},F3={hidden:{opacity:0,x:24},show:{opacity:1,x:0,transition:{type:"spring",stiffness:300,damping:28}}};function V3(){const[e,t]=f.useState(!1),[n,s]=f.useState(null),[i,a]=f.useState([]),[o,l]=f.useState(!0),c=f.useRef(!1);f.useEffect(()=>{c.current||(c.current=!0,(async()=>{try{const u=await $("/api/automation/nightowl/status");if(!u.ok)return;const p=await u.json();if(!p.lastShiftTs||Date.now()-p.lastShiftTs>z3||localStorage.getItem(Am)===String(p.lastShiftTs)||p.totalFindings===0)return;const h=await $("/api/memory/ltm/search?q=NightShift-Insights&limit=15&category=semantic"),y=(h.ok?await h.json():{results:[]}).results.filter(b=>b.tags.some(v=>v.toLowerCase().includes("nightshift"))).slice(0,8).map(b=>({task:L3(b.tags),summary:b.content.replace(/\n/g," ").slice(0,180)}));s(p),a(y),l(!1),t(!0),localStorage.setItem(Am,String(p.lastShiftTs))}catch{}})())},[]);const d=()=>t(!1);return r.jsx(ee,{children:e&&r.jsx(U.div,{variants:O3,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:u=>{u.target===u.currentTarget&&d()},children:r.jsxs(U.div,{variants:I3,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:d,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(st,{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(U.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(ol,{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:[D3(n.lastShiftTs)," · ",Mm(n.lastShiftMs)," sürdü"]})]})]}),n&&r.jsx(U.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(Ld).length)},{label:"Süre",value:Mm(n.lastShiftMs)}].map(u=>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:u.value}),r.jsx("p",{className:"text-[10px] text-white/30 font-medium mt-0.5",children:u.label})]},u.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(u=>r.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-orange-400/40 animate-bounce",style:{animationDelay:`${u*.15}s`}},u))})}),!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(U.div,{variants:B3,initial:"hidden",animate:"show",className:"space-y-2.5",children:i.map((u,p)=>{const h=R3(u.task),m=h.Icon;return r.jsx(U.div,{variants:F3,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 ${h.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:`${h.color}15`,border:`1px solid ${h.color}30`},children:r.jsx(m,{size:14,style:{color:h.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:h.color},children:h.label}),r.jsx("p",{className:"text-[12.5px] text-white/65 leading-relaxed",children:u.summary})]}),r.jsx(on,{size:13,className:"text-white/15 flex-shrink-0 mt-1"})]})},p)})})]}),r.jsx(U.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:d,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:u=>u.currentTarget.style.background="rgba(249,115,22,0.22)",onMouseLeave:u=>u.currentTarget.style.background="rgba(249,115,22,0.15)",children:[r.jsx(Re,{size:15}),"Günün başlasın"]})})]})},"morning-briefing-overlay")})}const zm={CodeHealth:{label:"Kod Sağlığı",Icon:cn,color:"#fb923c"},DepAudit:{label:"Bağımlılık",Icon:ra,color:"#a78bfa"},LogAnalysis:{label:"Log Analizi",Icon:Yt,color:"#38bdf8"},LTMGap:{label:"Bellek",Icon:Kt,color:"#34d399"},WorkspaceDiff:{label:"Değişiklikler",Icon:e1,color:"#fbbf24"}};function $3(e){const t=Object.keys(zm).find(n=>e.toLowerCase().includes(n.toLowerCase()));return t?zm[t]:{label:e,Icon:cl,color:"#fb923c"}}function U3(e){const t=Math.round(e/1e3);return t<60?`${t}s`:`${Math.floor(t/60)}m ${t%60}s`}const H3={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}}},W3={hidden:{opacity:0,y:-6},show:{opacity:1,y:0,transition:{duration:.22}}};function G3(){const[e,t]=f.useState("idle"),[n,s]=f.useState([]),[i,a]=f.useState(null),[o,l]=f.useState(!1),[c,d]=f.useState(!1),u=f.useRef(null),p=f.useRef(0),h=f.useCallback((y=2e4)=>{u.current&&clearTimeout(u.current),u.current=setTimeout(()=>{l(!1),setTimeout(()=>d(!1),600)},y)},[]);if(f.useEffect(()=>{const y=at();return y.on("nightOwlEvent",b=>{if(b.type==="shiftStart"){u.current&&clearTimeout(u.current),t("scanning"),s([]),a(null),d(!0),l(!0);return}if(b.type==="finding"){const v={id:`${++p.current}`,task:String(b.task??"General"),summary:String(b.summary??"").slice(0,120),ts:Number(b.ts??Date.now())};s(g=>[v,...g].slice(0,20));return}if(b.type==="shiftEnd"){t("done"),a({findingsCount:Number(b.findingsCount??0),durationMs:Number(b.durationMs??0),ts:Number(b.ts??Date.now())}),h(2e4);return}}),()=>{y.off("nightOwlEvent"),u.current&&clearTimeout(u.current)}},[h]),!c)return null;const m="#fb923c";return r.jsx(ee,{children:r.jsx(U.div,{variants:H3,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(y=>!y),u.current&&clearTimeout(u.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(Je,{size:13,className:"text-green-400 flex-shrink-0"}):r.jsx(ol,{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 · ",U3(i.durationMs)]})]}),o?r.jsx(fh,{size:12,className:"text-white/25"}):r.jsx(na,{size:12,className:"text-white/25"})]}),r.jsx(ee,{children:o&&r.jsxs(U.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(y=>r.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-orange-400/50 animate-bounce",style:{animationDelay:`${y*.15}s`}},y))}),r.jsx("span",{className:"text-[11px] text-white/30",children:"Sistem analiz ediliyor…"})]}),r.jsx(ee,{initial:!1,children:n.map(y=>{const b=$3(y.task),v=b.Icon;return r.jsxs(U.div,{variants:W3,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:`${b.color}15`,border:`1px solid ${b.color}30`},children:r.jsx(v,{size:11,style:{color:b.color}})}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("p",{className:"text-[10px] font-bold mb-0.5",style:{color:b.color},children:b.label}),r.jsx("p",{className:"text-[11px] text-white/50 leading-snug line-clamp-3",children:y.summary})]})]},y.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 Rm="mustb_boot_report",Lm=14e3;function K3({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 q3(){const[e,t]=f.useState(!1),[n,s]=f.useState(null),i=f.useCallback(()=>{t(!1),localStorage.removeItem(Rm)},[]);return f.useEffect(()=>{if(localStorage.getItem(Rm)!=="1")return;t(!0),$("/api/status").then(o=>o.ok?o.json():null).then(o=>{o&&s(o)}).catch(()=>{});const a=setTimeout(i,Lm);return()=>clearTimeout(a)},[i]),r.jsx(ee,{children:e&&r.jsx(U.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(st,{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(Je,{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(Sn,{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(r1,{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(Re,{size:10})," Score"]}),r.jsx(K3,{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(U.div,{initial:{scaleX:1},animate:{scaleX:0},transition:{duration:Lm/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 Dm(){return f.useEffect(()=>{at()},[]),r.jsxs("div",{className:"flex flex-col h-[calc(100vh-72px)] overflow-hidden",children:[r.jsx(_3,{}),r.jsx(M3,{}),r.jsx(C3,{}),r.jsx(q3,{}),r.jsx(V3,{}),r.jsx(G3,{})]})}function ia(){const[e,t]=f.useState(!1),[n,s]=f.useState(!0),i=f.useRef(!0),a=f.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 f.useEffect(()=>{i.current=!0,a();const o=setInterval(a,15e3),l=()=>{a()},c=()=>{a()},d=()=>{i.current&&t(!1)};try{at()}catch{}return window.addEventListener("mustb:connected",l),window.addEventListener("mustb:reconnected",c),window.addEventListener("mustb:disconnected",d),()=>{i.current=!1,clearInterval(o),window.removeEventListener("mustb:connected",l),window.removeEventListener("mustb:reconnected",c),window.removeEventListener("mustb:disconnected",d)}},[a]),{online:e,loading:n}}function Om({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 Y3(){const{online:e}=ia(),[t,n]=f.useState(null),[s,i]=f.useState([]),[a,o]=f.useState(null),[l,c]=f.useState(null),[d,u]=f.useState(!0);f.useEffect(()=>{(async()=>{var g;u(!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{u(!1)}})()},[e]),f.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(d)return r.jsxs("div",{className:"flex items-center justify-center py-12",children:[r.jsx(le,{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(Ds,{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(Om,{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 h=(t==null?void 0:t.channelOrder)??[],m=(t==null?void 0:t.channelLabels)??{},y=(t==null?void 0:t.channelAccounts)??{};if(h.length===0)return r.jsx("p",{className:"text-center text-sm text-gray-600 py-8",children:"Yapılandırılmış kanal bulunamadı."});const b=a?y[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:h.map(v=>{const g=y[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(Om,{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?b.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:b.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(Je,{size:13,className:"text-green-400 flex-shrink-0"}):v.lastError?r.jsx(Jy,{size:13,className:"text-red-400 flex-shrink-0"}):r.jsx(es,{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(xh,{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 X3(e){return e===0?"Free":e<1?`$${e.toFixed(3)}/1M`:`$${e.toFixed(2)}/1M`}function Q3(e){return e?e>=1e3?`${(e/1e3).toFixed(0)}M`:`${e}k`:"—"}const Im={free:{label:"Free",icon:r.jsx(TS,{size:11}),color:"#22c55e",bg:"rgba(34,197,94,0.12)"},balanced:{label:"Balanced",icon:r.jsx(KS,{size:11}),color:"#60a5fa",bg:"rgba(96,165,250,0.12)"},power:{label:"Power",icon:r.jsx(Re,{size:11}),color:"#f59e0b",bg:"rgba(245,158,11,0.12)"}};function J3({currentModel:e,onSelect:t,className:n}){const[s,i]=f.useState(null),[a,o]=f.useState(!0),[l,c]=f.useState(null),[d,u]=f.useState("free"),[p,h]=f.useState(""),m=f.useRef(null),y=(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";u(w)}o(!1)}).catch(x=>{c(x.message),o(!1)})};f.useEffect(()=>{y()},[]),f.useEffect(()=>{m.current&&m.current.scrollIntoView({block:"nearest",behavior:"smooth"})},[d,s]);const b=(s==null?void 0:s[d])??[],v=p?b.filter(g=>g.name.toLowerCase().includes(p.toLowerCase())||g.id.toLowerCase().includes(p.toLowerCase())):b;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:()=>y(!0),className:"text-gray-600 hover:text-orange-400 transition-colors p-1 rounded",title:"Refresh catalog",disabled:a,children:r.jsx(le,{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=Im[g],w=((k=s==null?void 0:s.totals)==null?void 0:k[g])??0,j=d===g;return r.jsxs("button",{onClick:()=>u(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(qt,{size:11,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-gray-600"}),r.jsx("input",{value:p,onChange:g=>h(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(le,{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:()=>y(!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=Im[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(Ts,{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:X3(g.costPer1M)}),r.jsxs("span",{className:"text-[9px] text-gray-600",children:[Q3(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 uc=[{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 Z3(){const{locale:e,setLocale:t}=pt(),[n,s]=f.useState(!1),i=f.useRef(null),a=uc.find(o=>o.code===e)??uc[0];return f.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(LS,{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(ee,{children:n&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"fixed inset-0 z-10",onClick:()=>s(!1)}),r.jsxs(U.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"})}),uc.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(Mt,{size:12,className:"text-orange-400 shrink-0"})]},o.code)})]})]})})]})}const Bm={frontier:"⚡ Frontier",gateway:"🌐 Gateway",fast:"🚀 Fast",local:"💻 Local",open:"🔓 Open Source",specialist:"🎯 Specialist",regional:"🌏 Regional",enterprise:"🏢 Enterprise",custom:"⚙️ Custom"},Fm=["frontier","gateway","fast","local","open","specialist","regional","enterprise","custom"];function _1({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 eC({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(_1,{tag:s},s))})]}),t&&r.jsx(on,{size:13,className:"text-orange-400 shrink-0 mt-1"})]})})}function tC(){const{t:e}=pt(),t=e.panels.settings,[n,s]=f.useState([]),[i,a]=f.useState(null),[o,l]=f.useState([]),[c,d]=f.useState("all"),[u,p]=f.useState(""),[h,m]=f.useState(null),[y,b]=f.useState(""),[v,g]=f.useState(""),[x,w]=f.useState(!1),[j,k]=f.useState(!1),[N,S]=f.useState(!1),[_,A]=f.useState(null),[P,T]=f.useState(null),[V,M]=f.useState(!!window.__MUSTB_NEED_API_KEY),[I,z]=f.useState(null),[R,B]=f.useState("providers"),C=f.useRef(null);f.useEffect(()=>{$("/api/setup/providers").then(X=>X.ok?X.json():null).then(X=>{X!=null&&X.providers&&s(X.providers)}).catch(()=>{}),$("/api/setup/status").then(X=>X.ok?X.json():null).then(X=>{X&&a(X)}).catch(()=>{}),$("/api/setup/ollama-models").then(X=>X.ok?X.json():null).then(X=>{X!=null&&X.models&&l(X.models)}).catch(()=>{});const G=()=>{M(!0),window.__MUSTB_NEED_API_KEY=!0};return window.addEventListener("mustb:401",G),()=>window.removeEventListener("mustb:401",G)},[]),f.useEffect(()=>{h&&b(h.defaultModel)},[h]);const E=u.toLowerCase(),L=n.filter(G=>!(c!=="all"&&G.category!==c||E&&!G.label.toLowerCase().includes(E)&&!G.description.toLowerCase().includes(E))),W={};for(const G of L)W[G.category]||(W[G.category]=[]),W[G.category].push(G);const q=async()=>{if(h){k(!0),A(null);try{const X=await(await $("/api/setup/test-key",{method:"POST",body:JSON.stringify({provider:h.id,apiKey:v||void 0,model:y||void 0})})).json();A({ok:X.ok,msg:X.message??(X.ok?"Connection successful":"Connection failed")})}catch{A({ok:!1,msg:"Gateway unreachable"})}k(!1)}},te=async()=>{if(!(!h||!h.envKeyIsUrl&&!v.trim())){S(!0),T(null);try{const X=await $("/api/setup/update-key",{method:"POST",body:JSON.stringify({provider:h.id,apiKey:v||void 0,model:y||void 0})});if(X.ok){T("Saved successfully."),g(""),window.__MUSTB_NEED_API_KEY=!1,M(!1);const zt=await $("/api/setup/status");zt.ok&&a(await zt.json())}else{const zt=await X.json();T(zt.error??"Failed to save.")}}catch{T("Gateway unreachable.")}S(!1),setTimeout(()=>T(null),6e3)}},se=G=>{z(G),$("/api/setup/save",{method:"POST",body:JSON.stringify({provider:"ollama",model:G})}).finally(()=>{setTimeout(()=>z(null),3e3)})},de=(h==null?void 0:h.envKeyIsUrl)??!1,fe=(h==null?void 0:h.id)==="ollama",ae=(h==null?void 0:h.id)==="openrouter",Ze=Fm.filter(G=>n.some(X=>X.category===G)),kt=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(bh,{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(Z3,{}),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(Sn,{size:11,className:kt}),r.jsxs("span",{className:`text-[11px] font-semibold ${kt}`,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(es,{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 ${R==="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(Sn,{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 ${R==="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($S,{size:11})," Kanallar"]})]}),R==="channels"&&r.jsx("div",{className:"flex-1 overflow-y-auto p-5",children:r.jsx(Y3,{})}),R==="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(qt,{size:12,className:"absolute left-3 top-1/2 -translate-y-1/2 text-gray-400"}),r.jsx("input",{ref:C,type:"text",value:u,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:()=>d("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}),Ze.map(G=>r.jsx("button",{onClick:()=>d(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:Bm[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…"]}),Fm.filter(G=>{var X;return(X=W[G])==null?void 0:X.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:Bm[G]}),r.jsx("div",{className:"space-y-1.5",children:W[G].map(X=>r.jsx(eC,{p:X,active:(h==null?void 0:h.id)===X.id,onClick:()=>{m(X),A(null),g("")}},X.id))})]},G)),n.length>0&&L.length===0&&r.jsxs("p",{className:"text-[12px] text-gray-400 py-4 text-center",children:['No providers match "',u,'"']})]})]}),r.jsx("div",{className:"flex-1 flex flex-col min-h-0 overflow-y-auto",children:h?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:h.label}),r.jsx("p",{className:"text-[12px] text-gray-400 mt-0.5 leading-snug",children:h.description}),r.jsx("div",{className:"flex flex-wrap gap-1 mt-1.5",children:h.tags.map(G=>r.jsx(_1,{tag:G},G))})]}),r.jsxs("a",{href:h.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})]})]}),fe&&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 X=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 ${X}`,children:G.fit}),r.jsxs("button",{onClick:()=>{b(G.id),se(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(xi,{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:[de?r.jsx(YS,{size:9}):r.jsx(zS,{size:9}),de?t.baseUrl:t.apiKey]}),fe&&!de?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||de?"text":"password",value:v,onChange:G=>{g(G.target.value),A(null)},placeholder:h.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"}),!de&&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(mh,{size:13}):r.jsx(Ts,{size:13})})]}),r.jsx("p",{className:"text-[10px] text-gray-400 px-1",children:de?`Stored in .env as ${h.envKey}. Default: ${h.placeholder}`:`Stored locally in .env as ${h.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(Re,{size:9}),t.model]}),ae?r.jsx(J3,{currentModel:y,onSelect:b,className:"rounded-xl border border-white/10 bg-white/3"}):r.jsx("select",{value:y,onChange:G=>b(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:h.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:[!fe&&r.jsxs("button",{onClick:q,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(le,{size:12,className:j?"animate-spin":""}),j?t.testing:t.testConnection]}),r.jsxs("button",{onClick:te,disabled:N||!v.trim()&&!de&&!fe,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(o1,{size:12,className:N?"animate-spin":""}),N?t.saving:t.save]})]}),_&&r.jsxs("div",{className:`flex items-start gap-2 px-3.5 py-2.5 rounded-xl border text-[12px] ${_.ok?"bg-green-500/8 border-green-500/20 text-green-300":"bg-red-500/8 border-red-500/20 text-red-300"}`,children:[_.ok?r.jsx(Je,{size:13,className:"shrink-0 mt-0.5"}):r.jsx(es,{size:13,className:"shrink-0 mt-0.5"}),_.msg]}),P&&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(Je,{size:13,className:"shrink-0"}),P]}),fe&&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(MS,{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(Xe,{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 nC(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 sC(){const{online:e}=ia(),[t,n]=f.useState([]),[s,i]=f.useState(!0),[a,o]=f.useState("all"),l=async()=>{i(!0);try{const p=await(await $("/api/gateway/sessions?limit=50&includeDerivedTitles=true&includeLastMessage=true")).json(),h=Array.isArray(p)?p:Array.isArray(p==null?void 0:p.sessions)?p.sessions:[];n(h)}catch{n([])}finally{i(!1)}};f.useEffect(()=>{l()},[e]);const c=u=>!!u.runningAtMs&&Date.now()-u.runningAtMs<12e4,d=t.filter(u=>a==="running"?c(u):a==="idle"?!c(u):!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(Xe,{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(le,{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(Ds,{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(u=>r.jsx("button",{onClick:()=>o(u),className:`px-3 py-1.5 rounded-xl text-[11px] font-semibold border transition-all ${a===u?"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:u==="all"?"Tümü":u==="running"?"Çalışıyor":"Boşta"},u))}),s?r.jsx("div",{className:"flex items-center justify-center py-12",children:r.jsx(le,{size:18,className:"animate-spin text-orange-400"})}):d.length===0?r.jsxs("div",{className:"flex flex-col items-center justify-center py-16 gap-3",children:[r.jsx(sa,{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:d.map(u=>{const p=c(u);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:u.derivedTitle??u.label??u.key.slice(0,20)+"…"}),u.agentId&&r.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-gray-600 flex-shrink-0",children:[r.jsx(Sn,{size:9}),u.agentId]})]}),u.lastMessage&&r.jsx("p",{className:"text-[11px] text-gray-500 truncate mb-1",children:u.lastMessage}),r.jsxs("div",{className:"flex items-center gap-3",children:[u.messageCount!==void 0&&r.jsxs("span",{className:"text-[10px] text-gray-600",children:[u.messageCount," mesaj"]}),r.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-gray-600",children:[r.jsx(en,{size:9}),nC(u.lastActivityAt)]})]})]})]})},u.key)})})]})}function rC(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 iC(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 aC(){const{online:e}=ia(),[t,n]=f.useState([]),[s,i]=f.useState(!0),[a,o]=f.useState("all"),[l,c]=f.useState(null),[d,u]=f.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)}};f.useEffect(()=>{p()},[e]);const h=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)}},y=async g=>{if(window.confirm("Bu otomasyon silinsin mi?")){u(g);try{await $(`/api/gateway/automations/${g}`,{method:"DELETE"}),n(x=>x.filter(w=>w.id!==g))}catch{}finally{u(null)}}},b=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(Je,{size:9})," Başarılı"]}):g==="error"?r.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-red-400",children:[r.jsx(Jy,{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(Re,{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(Ds,{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(le,{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(le,{size:18,className:"animate-spin text-orange-400"})}):b.length===0?r.jsxs("div",{className:"flex flex-col items-center justify-center py-16 gap-3",children:[r.jsx(Re,{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:b.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:()=>h(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(t4,{size:18,className:"text-orange-400"}):r.jsx(e4,{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(en,{size:9})," ",rC(g.schedule)]}),((w=g.state)==null?void 0:w.nextRunAtMs)&&r.jsx("span",{className:"text-[11px] text-gray-600",children:iC(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(le,{size:9,className:"animate-spin"}):r.jsx(Rs,{size:9}),"Çalıştır"]}),r.jsxs("button",{onClick:()=>y(g.id),disabled:!e||d===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:[d===g.id?r.jsx(le,{size:9,className:"animate-spin"}):r.jsx(Ls,{size:9}),"Sil"]})]})]})},g.id)})})]})}function oC(e){var t;return(t=e.presence)!=null&&t.ts?Date.now()-e.presence.ts<6e4:!1}function lC({platform:e}){const t=(e??"").toLowerCase();return t.includes("ios")||t.includes("iphone")?r.jsx(ym,{size:14,className:"text-gray-400"}):t.includes("android")?r.jsx(ym,{size:14,className:"text-green-500"}):t.includes("mac")||t.includes("darwin")?r.jsx(Yy,{size:14,className:"text-gray-300"}):t.includes("win")?r.jsx(vh,{size:14,className:"text-blue-400"}):r.jsx(DS,{size:14,className:"text-gray-500"})}function cC(){const{online:e}=ia(),[t,n]=f.useState([]),[s,i]=f.useState(!0),[a,o]=f.useState(null),[l,c]=f.useState(""),d=async()=>{i(!0);try{const h=await(await $("/api/gateway/clients")).json();n(Array.isArray(h==null?void 0:h.nodes)?h.nodes:Array.isArray(h)?h:[])}catch{n([])}finally{i(!1)}};f.useEffect(()=>{d()},[e]);const u=async p=>{if(!l.trim()){o(null);return}try{await $(`/api/gateway/clients/${p}/rename`,{method:"POST",body:JSON.stringify({displayName:l.trim()})}),n(h=>h.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(vm,{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(Ds,{size:10})," Çevrimdışı"]}),r.jsxs("button",{onClick:d,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(le,{size:12,className:s?"animate-spin":""})," Yenile"]})]})]}),s?r.jsx("div",{className:"flex justify-center py-12",children:r.jsx(le,{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(vm,{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(lC,{platform:p.platform}),r.jsx("div",{className:"flex-1 min-w-0",children:a===p.nodeId?r.jsx("input",{autoFocus:!0,value:l,onChange:h=>c(h.target.value),onBlur:()=>u(p.nodeId),onKeyDown:h=>{h.key==="Enter"&&u(p.nodeId),h.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 ${oC(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(h=>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:h},h)),(p.caps??[]).length>3&&r.jsxs("span",{className:"text-[9px] text-gray-600",children:["+",(p.caps??[]).length-3]})]})]})]},p.nodeId))})]})}function dC({online:e}){var d;const[t,n]=f.useState({}),[s,i]=f.useState(!0),a=f.useRef(0),o=f.useRef(null),l=async(u=0)=>{try{const h=await(await $(`/api/gateway/logs?cursor=${u}&limit=200`)).json();u===0?(n(h),a.current=h.cursor??0):(n(m=>({...h,lines:[...m.lines??[],...h.lines??[]]})),a.current=h.cursor??a.current)}catch{}finally{i(!1)}};f.useEffect(()=>{l(0)},[e]),f.useEffect(()=>{const u=setInterval(()=>l(a.current),1e4);return()=>clearInterval(u)},[e]),f.useEffect(()=>{o.current&&(o.current.scrollTop=o.current.scrollHeight)},[(d=t.lines)==null?void 0:d.length]);const c=u=>u.includes("error")||u.includes("ERROR")?"text-red-400":u.includes("warn")||u.includes("WARN")?"text-amber-400":u.includes("info")||u.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(`
|
|
683
|
+
`)),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(Wi,{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(le,{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((u,p)=>r.jsx("p",{className:`whitespace-pre-wrap break-all leading-5 ${c(u)}`,children:u},p))})]})}function uC({online:e}){var l,c;const[t,n]=f.useState({}),[s,i]=f.useState(!0);f.useEffect(()=>{i(!0),$("/api/gateway/usage/cost").then(d=>d.json()).then(n).catch(()=>n({})).finally(()=>i(!1))},[e]);const a=t.daily??[],o=Math.max(1,...a.map(d=>d.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(Ds,{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(SS,{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((d,u)=>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:d.provider}),r.jsx("span",{className:"text-right text-gray-500",children:(d.inputTokens??0).toLocaleString()}),r.jsx("span",{className:"text-right text-gray-500",children:(d.outputTokens??0).toLocaleString()}),r.jsxs("span",{className:"text-right text-orange-400",children:["$",(d.cost??0).toFixed(4)]})]},u))]}),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((d,u)=>{var h;const p=Math.max(2,Math.round((d.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:`${d.date}: ${(d.tokens??0).toLocaleString()} token`}),r.jsx("span",{className:"text-[8px] text-gray-700 truncate w-full text-center",children:(h=d.date)==null?void 0:h.slice(5)})]},u)})})]})]})}function hC({online:e}){const[t,n]=f.useState([]),[s,i]=f.useState(!0);return f.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(le,{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 pC(){const{online:e}=ia(),[t,n]=f.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(jS,{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(Ds,{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(dC,{online:e}),t==="usage"&&r.jsx(uC,{online:e}),t==="sessions"&&r.jsx(hC,{online:e})]})}function fC(){const[e,t]=f.useState([]),[n,s]=f.useState(!0),[i,a]=f.useState("all"),[o,l]=f.useState(new Set);f.useEffect(()=>{s(!0),$("/api/tools").then(u=>u.json()).then(u=>{const p=Array.isArray(u==null?void 0:u.groups)?u.groups:[];t(p),l(new Set(p.slice(0,3).map(h=>h.id)))}).catch(()=>t([])).finally(()=>s(!1))},[]);const c=e.map(u=>({...u,tools:(u.tools??[]).filter(p=>i==="core"?p.source!=="plugin":i==="plugin"?p.source==="plugin":!0)})).filter(u=>u.tools.length>0),d=u=>{l(p=>{const h=new Set(p);return h.has(u)?h.delete(u):h.add(u),h})};return r.jsxs("div",{className:"space-y-3",children:[r.jsx("div",{className:"flex gap-1.5",children:["all","core","plugin"].map(u=>r.jsx("button",{onClick:()=>a(u),className:`px-3 py-1.5 rounded-xl text-[11px] font-semibold border transition-all ${i===u?"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:u==="all"?"All":u==="core"?"Core":"Plugin"},u))}),n?r.jsx("div",{className:"flex justify-center py-10",children:r.jsx(le,{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(u=>{var p;return r.jsxs("div",{className:"rounded-xl bg-white/[0.02] border border-white/6 overflow-hidden",children:[r.jsxs("button",{onClick:()=>d(u.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(kh,{size:12,className:"text-orange-400"}),r.jsx("span",{className:"text-[12px] font-semibold text-gray-300",children:u.label??u.id}),r.jsxs("span",{className:"text-[10px] text-gray-600",children:[((p=u.tools)==null?void 0:p.length)??0," tools"]})]}),o.has(u.id)?r.jsx(na,{size:12,className:"text-gray-600"}):r.jsx(on,{size:12,className:"text-gray-600"})]}),o.has(u.id)&&r.jsx("div",{className:"border-t border-white/5 divide-y divide-white/4",children:(u.tools??[]).map((h,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:h.label??h.name}),h.description&&r.jsx("p",{className:"text-[11px] text-gray-600 line-clamp-1",children:h.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 ${h.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:h.source==="plugin"?"plugin":"core"})})]},m))})]},u.id)})})]})}function mC(){const[e,t]=f.useState([]),[n,s]=f.useState(!0);return f.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(le,{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 gC(){const[e,t]=f.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(ra,{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(kh,{size:11}):r.jsx(Hi,{size:11}),n==="tools"?"Tools":"Agents"]},n))}),e==="tools"&&r.jsx(fC,{}),e==="agents"&&r.jsx(mC,{})]})}const Vm=[{key:"all",label:"Tümü",icon:il,test:()=>!0},{key:"nightowl",label:"NightOwl Bulguları",icon:ol,test:e=>e.tags.some(t=>/nightshift|nightowl/i.test(t))},{key:"preferences",label:"Kullanıcı Tercihleri",icon:c1,test:e=>e.category==="semantic"&&!e.tags.some(t=>/project|workspace|nightshift|nightowl/i.test(t))},{key:"architecture",label:"Proje Mimarisi",icon:s1,test:e=>e.tags.some(t=>/project|workspace|context|summary/i.test(t))},{key:"episodic",label:"Episodik",icon:en,test:e=>e.category==="episodic"},{key:"semantic",label:"Semantik",icon:Kt,test:e=>e.category==="semantic"}],xC={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 yC(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 vC={fresh:"#34d399",recent:"#f97316",old:"#a78bfa",ancient:"#6b7280"};function $m(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 bC({entry:e,query:t,index:n,onDelete:s}){const[i,a]=f.useState(!1),[o,l]=f.useState(!1),c=yC(e.createdAt),d=xC[e.category],u=e.content.slice(0,180),p=e.content.length>180,h=async m=>{m.stopPropagation(),l(!0);try{(await $(`/api/memory/ltm/delete/${e.id}`,{method:"DELETE"})).ok?(s(e.id),pe.success("Kayıt silindi.")):pe.error("Silinemedi.")}catch{pe.error("Bağlantı hatası.")}l(!1)};return r.jsxs(U.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 ${d.border}`,backdropFilter:"blur(20px)",boxShadow:`0 4px 24px rgba(0,0,0,0.45), 0 0 0 1px ${d.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 ${d.bg}`},children:[r.jsx("span",{className:"mt-0.5 w-2 h-2 rounded-full flex-shrink-0",style:{background:d.dot,boxShadow:`0 0 6px ${d.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:$m(i?e.content:u+(p?"…":""),t)})}),p&&r.jsx(U.span,{animate:{rotate:i?90:0},transition:{duration:.18},className:"flex-shrink-0 text-white/20",children:r.jsx(on,{size:14})}),r.jsx("button",{onClick:h,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(Ls,{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:d.dot,background:d.bg,border:`1px solid ${d.border}`},children:d.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(l1,{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:vC[c.tier]},title:e.createdAt,children:[r.jsx(en,{size:9}),c.label]})]})]})}function wC({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 kC({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(U.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(es,{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(st,{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 jC(){const[e,t]=f.useState([]),[n,s]=f.useState(!0),[i,a]=f.useState(""),[o,l]=f.useState("all"),[c,d]=f.useState(!1),[u,p]=f.useState(!1),h=f.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)},[]);f.useEffect(()=>{h()},[h]);const m=v=>{t(g=>g.filter(x=>x.id!==v))},y=async()=>{p(!0);try{const v=await $("/api/memory/ltm/clear-all",{method:"DELETE"});if(v.ok){const g=await v.json();t([]),pe.success(`${g.deleted??0} kayıt temizlendi.`)}else pe.error("Temizleme başarısız.")}catch{pe.error("Bağlantı hatası.")}p(!1),d(!1)},b=f.useMemo(()=>{var x;const v=((x=Vm.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(Kt,{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:()=>d(!0),disabled:u||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(Ls,{size:11}),"Tüm Hafızayı Temizle"]}),r.jsxs("button",{onClick:()=>void h(),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(le,{size:11,className:n?"animate-spin":""}),"Yenile"]})]})]}),!n&&r.jsx(wC,{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(qt,{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(_S,{size:11,className:"text-white/25"}),Vm.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(U.div,{animate:{rotate:360},transition:{repeat:1/0,duration:1.5,ease:"linear"},children:r.jsx(Kt,{size:28,className:"text-orange-500/50"})}),r.jsx("p",{className:"text-[12px] text-white/30",children:"Hafıza taranıyor…"})]}):b.length===0?r.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 py-24",children:[r.jsx(cl,{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:[b.length," kayıt gösteriliyor",i&&r.jsxs(r.Fragment,{children:[" · ",r.jsxs("span",{className:"text-orange-400/60",children:['"',i,'"']})," araması"]})]}),r.jsx(ee,{mode:"popLayout",children:b.map((v,g)=>r.jsx(bC,{entry:v,query:i,index:g,onDelete:m},v.id))})]}),r.jsx(ee,{children:c&&r.jsx(kC,{onConfirm:y,onCancel:()=>d(!1)})})]})}const La=`# Must-b Zihni
|
|
684
684
|
Burada senin hakkında öğrendiğim bilgiler yer alır.
|
|
685
685
|
|
|
686
686
|
## Genel Bilgiler
|
|
@@ -691,7 +691,7 @@ Burada senin hakkında öğrendiğim bilgiler yer alır.
|
|
|
691
691
|
|
|
692
692
|
## Kullanıcı Stili
|
|
693
693
|
<!-- Sana özgü iletişim ve çalışma tarzı notları. -->
|
|
694
|
-
`,
|
|
694
|
+
`,NC=["meslek","profession","user style","kullanıcı stili","expertise","uzmanlık","role","rol"];function Hs(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function Um(e){const t=e.toLowerCase();return NC.some(n=>t.includes(n))}function SC(e){const t=e.split(`
|
|
695
695
|
`),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>${Hs(i.join(`
|
|
696
696
|
`))}</code></pre>`),i=[],s=!1):(o(),s=!0);continue}if(s){i.push(c);continue}const d=c.match(/^### (.+)$/);if(d){o();const m=Hs(d[1]),y=Um(d[1]);n.push(`<h3 class="text-[13px] font-bold text-white/70 mt-4 mb-1.5 flex items-center gap-2">
|
|
697
697
|
${m}
|
|
@@ -702,7 +702,7 @@ Burada senin hakkında öğrendiğim bilgiler yer alır.
|
|
|
702
702
|
</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">
|
|
703
703
|
${Hs(p[1])}
|
|
704
704
|
</h1>`);continue}if(/^---+$/.test(c.trim())){o(),n.push('<hr class="border-white/10 my-4" />');continue}const h=c.match(/^[\-\*\+] (.+)$/);if(h){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>${Hm(h[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">${Hs(m)}</p>`);continue}n.push(`<p class="text-[13px] text-white/65 leading-relaxed my-1">${Hm(c)}</p>`)}return o(),n.join(`
|
|
705
|
-
`)}function Hm(e){return Hs(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
|
|
705
|
+
`)}function Hm(e){return Hs(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 CC(){const[e,t]=f.useState(""),[n,s]=f.useState(!1),[i,a]=f.useState(!1),[o,l]=f.useState(!0),c=f.useRef(null),d=f.useRef(null);f.useEffect(()=>{$("/api/memory/persona").then(m=>m.ok?m.json():null).then(m=>{var y;t((y=m==null?void 0:m.content)!=null&&y.trim()?m.content:La)}).catch(()=>t(La)).finally(()=>l(!1))},[]);const u=f.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),d.current&&clearTimeout(d.current),d.current=setTimeout(()=>a(!1),2500)}catch{pe.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(()=>u(m),2e3)};if(f.useEffect(()=>()=>{c.current&&clearTimeout(c.current),d.current&&clearTimeout(d.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 h=SC(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(Kt,{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)??La)).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(le,{size:14})}),r.jsxs("button",{onClick:()=>u(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(Mt,{size:13}):r.jsx(o1,{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:La})]}),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(l1,{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:`
|
|
706
706
|
.cognitive-heading {
|
|
707
707
|
padding: 6px 10px;
|
|
708
708
|
border-radius: 8px;
|
|
@@ -724,18 +724,18 @@ Burada senin hakkında öğrendiğim bilgiler yer alır.
|
|
|
724
724
|
color: rgba(251,146,60,0.9);
|
|
725
725
|
margin-left: auto;
|
|
726
726
|
}
|
|
727
|
-
`}),r.jsx("div",{className:"max-w-full",dangerouslySetInnerHTML:{__html:h}})]})]})]})]})}const EC=[{id:"terminal",label:"Terminal",desc:"Kabuk komutları çalıştır",Icon:Ps,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:Xe,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:qt,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:os,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:o1,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:cn,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:Kt,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:_d,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:vh,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:Ed,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:sa,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:n1,color:"text-amber-400",bg:"bg-amber-500/10",border:"border-amber-500/20"}];function TC(){const[e,t]=f.useState("tools"),[n,s]=f.useState([]),[i,a]=f.useState([]),[o,l]=f.useState({}),[c,d]=f.useState(!1),[u,p]=f.useState(""),h=f.useCallback(async()=>{d(!0);try{const j=await $("/api/skills/list");if(j.ok){const k=await j.json();s(Array.isArray(k)?k:[])}}catch{}d(!1)},[]),m=f.useCallback(async()=>{d(!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{}d(!1)},[]);f.useEffect(()=>{e==="saved"&&h(),e==="catalog"&&m()},[e,h,m]);const y=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"})),pe[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"}))}},b=async j=>{try{await $(`/api/skills/${j}`,{method:"DELETE"}),s(k=>k.filter(N=>N.id!==j)),pe.success("Beceri silindi.")}catch{pe.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&&pe.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=EC.filter(j=>j.label.toLowerCase().includes(u.toLowerCase())||j.desc.toLowerCase().includes(u.toLowerCase())),x=n.filter(j=>j.name.toLowerCase().includes(u.toLowerCase())||j.goal.toLowerCase().includes(u.toLowerCase())),w=i.filter(j=>j.name.toLowerCase().includes(u.toLowerCase())||j.description.toLowerCase().includes(u.toLowerCase())||(j.pluginName??"").toLowerCase().includes(u.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(Re,{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(qt,{size:13,className:"absolute left-3 top-1/2 -translate-y-1/2 text-white/25"}),r.jsx("input",{value:u,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:_,bg:A,border:P})=>r.jsxs(U.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 ${P}`,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 ${A} border ${P}`,children:r.jsx(S,{size:16,className:_})}),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:h,className:"p-1.5 text-white/30 hover:text-white/70 rounded-lg hover:bg-white/6 transition-all",children:r.jsx(le,{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:u?"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(U.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(ph,{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(Jy,{size:9})," ",j.runCount," çalıştırma"]}),r.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-white/25",children:[r.jsx(en,{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:()=>y(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(Je,{size:13}):k==="error"?r.jsx(ln,{size:13}):r.jsx(Rs,{size:13})}),r.jsx("button",{onClick:()=>b(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(Ls,{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(le,{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:u?"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(U.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(Je,{size:13}):k==="error"?r.jsx(ln,{size:13}):r.jsx(Sn,{size:13})})]},j.id)})})]})]})}const PC={node:cn,python:fn,api:zr,cli:Ps,web:Xe,database:il,cloud:e1,agent:Hi};function AC(e,t){const n=e.toLowerCase();return n.includes("api")||n.includes("webhook")?zr:n.includes("db")||n.includes("database")||n.includes("sql")?il:n.includes("cloud")||n.includes("s3")||n.includes("gcs")?e1:n.includes("agent")||n.includes("bot")?Hi:n.includes("web")||n.includes("http")?Xe:PC[t]??ra}function MC(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 zC(){const[e,t]=f.useState([]),[n,s]=f.useState([]),[i,a]=f.useState(!1),[o,l]=f.useState(null),[c,d]=f.useState(!1),[u,p]=f.useState(""),[h,m]=f.useState(""),[y,b]=f.useState("node"),[v,g]=f.useState(""),[x,w]=f.useState(!1),j=f.useCallback(async()=>{a(!0);try{const[A,P]=await Promise.all([$("/api/plugins/list"),$("/api/skills/catalog")]);if(A.ok){const T=await A.json();t(Array.isArray(T)?T:[])}if(P.ok){const T=await P.json(),V=Array.isArray(T)?T:T.skills??[];s(MC(V))}}catch{}a(!1)},[]);f.useEffect(()=>{j()},[j]);const k=async A=>{l(A.name);try{const P=A.running?"/api/plugins/stop":"/api/plugins/run";(await $(P,{method:"POST",body:JSON.stringify({name:A.name})})).ok?(t(V=>(Array.isArray(V)?V:[]).map(M=>M.name===A.name?{...M,running:!M.running}:M)),pe.success(A.running?`"${A.name}" durduruldu`:`"${A.name}" başlatıldı`)):pe.error("İşlem başarısız.")}catch{pe.error("Bağlantı hatası.")}l(null)},N=async A=>{if(A.preventDefault(),!(!u.trim()||!h.trim())){w(!0);try{const P=await $("/api/plugins/build",{method:"POST",body:JSON.stringify({name:u,goal:h,lang:y,context:v})});if(P.ok){const T=await P.json();pe.success(`"${T.name??u}" eklentisi oluşturuldu!`),p(""),m(""),g(""),d(!1),j()}else{const T=await P.json().catch(()=>({}));pe.error(T.error??"Oluşturma başarısız.")}}catch{pe.error("Gateway bağlantı hatası.")}w(!1)}},S=Array.isArray(e)?e:[],_=S.filter(A=>A.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(Sr,{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 · ",_," ç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(le,{size:14})}),r.jsxs("button",{onClick:()=>d(A=>!A),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(st,{size:13}):r.jsx(ll,{size:13}),c?"Kapat":"Yeni Eklenti"]})]})]}),r.jsx(ee,{children:c&&r.jsx(U.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(Re,{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:u,onChange:A=>p(A.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(A=>r.jsxs("button",{type:"button",onClick:()=>b(A),className:`flex-1 py-2 text-[12px] font-semibold transition-all flex items-center justify-center gap-1.5 ${y===A?"bg-orange-500/20 text-orange-300":"text-white/40 hover:text-white/70 hover:bg-white/5"}`,children:[A==="node"?r.jsx(cn,{size:12}):r.jsx(fn,{size:12}),A==="node"?"Node.js":"Python"]},A))})]})]}),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:h,onChange:A=>m(A.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:A=>g(A.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||!u.trim()||!h.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(Sn,{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(A=>r.jsxs(U.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:A.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:A.name}),r.jsxs("p",{className:"text-[10px] text-white/30 mt-0.5",children:[A.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ü"})]},A.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(Sr,{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(A=>{const P=o===A.name,T=AC(A.name,A.lang),V=A.lang==="node"?cn:fn;return r.jsxs(U.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},className:`rounded-2xl p-4 border transition-all ${A.running?"border-orange-500/25":"border-white/8 hover:border-white/14"}`,style:{background:A.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 ${A.running?"bg-orange-500/15 border border-orange-500/25":"bg-white/6 border border-white/10"}`,children:r.jsx(T,{size:16,className:A.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:A.name}),r.jsxs("div",{className:"flex items-center gap-1 mt-0.5",children:[r.jsx(V,{size:9,className:A.lang==="node"?"text-green-400/60":"text-blue-400/60"}),r.jsx("span",{className:`text-[9px] font-semibold ${A.lang==="node"?"text-green-400/60":"text-blue-400/60"}`,children:A.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 ${A.running?"bg-orange-500/15 border-orange-500/25 text-orange-400":"bg-white/5 border-white/10 text-white/30"}`,children:A.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(A.createdAt).toLocaleDateString("tr-TR")}),r.jsxs("button",{onClick:()=>k(A),disabled:P,className:`flex items-center gap-1.5 px-3 py-1.5 rounded-xl text-[11px] font-semibold transition-all border ${A.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:[P?r.jsx(ne,{size:11,className:"animate-spin"}):A.running?r.jsx(wh,{size:11}):r.jsx(Rs,{size:11}),A.running?"Durdur":"Başlat"]})]})]},A.name)})})]})}function RC(){return new URLSearchParams(window.location.search).get("token")??""}function LC(){const[e,t]=f.useState("connecting"),[n,s]=f.useState([]),[i,a]=f.useState([]),[o,l]=f.useState("idle"),[c,d]=f.useState(null),[u,p]=f.useState(""),h=f.useRef(null),m=f.useRef(null),y=f.useRef([]),b=RC();f.useEffect(()=>{if(!b){t("denied");return}const k=yi(`${window.location.origin}/mobile`,{query:{token:b},transports:["websocket","polling"]});return h.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 _=N.step;s(A=>[...A,{id:`${Date.now()}-${Math.random()}`,description:(_==null?void 0:_.description)??"Working…",status:"running"}])}S==="stepFinish"&&s(_=>{const A=[..._],P=A.findLastIndex(T=>T.status==="running");return P>=0&&(A[P]={...A[P],status:N.status==="error"?"error":"done"}),A}),S==="skillRunStart"&&N.skillId&&d(N.skillId),S==="planFinish"&&d(null)}),()=>{k.disconnect()}},[b]);const v=f.useCallback(async()=>{try{const k=await fetch("/api/skills/list",{headers:{Authorization:`Bearer ${b}`}});if(k.ok){const N=await k.json();a(N.skills??[])}}catch{}},[b]);f.useEffect(()=>{v()},[v]);const g=async()=>{try{const k=await navigator.mediaDevices.getUserMedia({audio:!0}),N=new MediaRecorder(k,{mimeType:"audio/webm"});y.current=[],N.ondataavailable=S=>{S.data.size>0&&y.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(y.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 ${b}`},body:N});if(S.ok){const{text:_}=await S.json();p(_),await fetch("/api/goal",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${b}`},body:JSON.stringify({goal:_})})}}catch{}l("idle")},j=async k=>{if(!c){d(k.id);try{await fetch("/api/skills/run",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${b}`},body:JSON.stringify({id:k.id})})}catch{d(null)}}};return!b||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(ln,{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(r4,{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(Ds,{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(U.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(yh,{size:36,className:"text-red-400"}):r.jsx(Nr,{size:36,className:"text-orange-400"}),o==="recording"&&r.jsx(U.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"}),u&&r.jsxs("p",{className:"text-[11px] text-orange-300 mt-3 text-center max-w-xs",children:['"',u,'"']})]}),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(ee,{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(U.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(Je,{size:12,className:"text-green-400 mt-0.5 shrink-0"}),k.status==="error"&&r.jsx(ln,{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(le,{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(U.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(Re,{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(Rs,{size:11}),N?"Running":"Run"]})]},k.id)})})]})]})}function DC(){const[e,t]=f.useState([]),[n,s]=f.useState(!0),[i,a]=f.useState(null);return f.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(os,{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(Yt,{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 OC=[{value:"all",label:"Tüm Veriler",icon:r.jsx(Xe,{size:13})},{value:"text",label:"Sadece Metin",icon:r.jsx(Yt,{size:13})},{value:"links",label:"Sadece Linkler",icon:r.jsx(zr,{size:13})},{value:"images",label:"Sadece Görseller",icon:r.jsx(gh,{size:13})}];function IC(e){return e==="text"?r.jsx(Yt,{size:13,className:"text-orange-400 shrink-0 mt-0.5"}):e==="link"?r.jsx(zr,{size:13,className:"text-blue-400 shrink-0 mt-0.5"}):r.jsx(gh,{size:13,className:"text-purple-400 shrink-0 mt-0.5"})}function BC(e){return e==="text"?"Metin":e==="link"?"Link":"Görsel"}function FC(){const[e,t]=f.useState(""),[n,s]=f.useState("all"),[i,a]=f.useState(!1),[o,l]=f.useState(null),[c,d]=f.useState(null),[u,p]=f.useState(new Set),[h,m]=f.useState(!1),[y,b]=f.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=()=>{u.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),d(null),p(new Set),b(!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 _=S.items??[];d(_),p(new Set(_.map(A=>A.id)))}}catch{l("Ağ bağlantısı kurulamadı. Backend çalışıyor mu?")}finally{a(!1)}}},j=async()=>{const k=(c??[]).filter(N=>u.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(()=>{}),b(!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(Xe,{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:OC.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(ln,{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 · ",u.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(on,{size:12}),u.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:[BC(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:u.has(S.id)?"rgba(249,115,22,0.08)":"rgba(255,255,255,0.03)",border:u.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:u.has(S.id)?"rgba(249,115,22,0.8)":"rgba(255,255,255,0.08)",border:u.has(S.id)?"1px solid rgba(249,115,22,0.9)":"1px solid rgba(255,255,255,0.18)"},onClick:()=>g(S.id),children:u.has(S.id)&&r.jsx(Mt,{size:10,className:"text-white"})}),IC(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:y?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(Mt,{size:14}),u.size," öğe belleğe kaydedildi"]}):r.jsx("button",{onClick:j,disabled:h||u.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:h?r.jsxs(r.Fragment,{children:[r.jsx(ne,{size:14,className:"animate-spin"})," Kaydediliyor…"]}):r.jsxs(r.Fragment,{children:[r.jsx(Qy,{size:14})," Seçilenleri Belleğe Kaydet (",u.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 VC(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 $C(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 UC(){const e=un(),{t,locale:n}=pt(),[s,i]=f.useState("wake-listening"),[a,o]=f.useState("Must-b"),[l,c]=f.useState(""),[d,u]=f.useState(""),p=f.useRef(null),h=f.useRef(!1),m=f.useRef(""),y=f.useRef(null),b=f.useRef("wake-listening");f.useEffect(()=>{b.current=s},[s]),f.useEffect(()=>{$("/api/identity").then(N=>N.json()).then(N=>{N.name&&o(N.name)}).catch(()=>{})},[]);const v=f.useCallback(N=>{if(!window.speechSynthesis)return;window.speechSynthesis.cancel();const S=new SpeechSynthesisUtterance(N),_=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=_,S.rate=1.05,S.pitch=1;const A=()=>{const P=$C(_.split("-")[0]);P&&(S.voice=P)};A(),!S.voice&&window.speechSynthesis.onvoiceschanged!==void 0&&(window.speechSynthesis.onvoiceschanged=A),S.onend=()=>{i("wake-listening"),u(""),c("")},S.onerror=()=>i("wake-listening"),i("speaking"),window.speechSynthesis.speak(S)},[n]),g=f.useCallback(async N=>{if(!N.trim()){i("wake-listening");return}i("thinking"),c(N);try{const _=await(await $("/api/goal",{method:"POST",body:JSON.stringify({goal:N,voice:!0})})).json(),A=_.result??_.reply??_.response??_.output??"Done.";u(A),v(A)}catch{i("wake-listening")}},[v]),x=f.useCallback(()=>{const N=window.SpeechRecognition||window.webkitSpeechRecognition;if(!N||!h.current)return;const S=new N;S.continuous=!0,S.interimResults=!0,S.lang=n==="tr"?"tr-TR":"en-US",S.onresult=_=>{var V,M;let A="";for(let I=_.resultIndex;I<_.results.length;I++)A+=_.results[I][0].transcript;const P=VC(A),T=b.current;if(c(P),T==="wake-listening"){const I=`hey ${a}`.toLowerCase();if(P.toLowerCase().includes(I)){const z=((V=P.toLowerCase().split(I)[1])==null?void 0:V.trim())??"";m.current=z,i("cmd-listening"),y.current&&clearTimeout(y.current),y.current=setTimeout(()=>{if(m.current.trim()&&b.current==="cmd-listening"){const R=m.current;m.current="",g(R)}},1800)}}else if(T==="cmd-listening"){const I=`hey ${a}`.toLowerCase(),z=P.toLowerCase().includes(I)?((M=P.toLowerCase().split(I)[1])==null?void 0:M.trim())??P:P;m.current=z,y.current&&clearTimeout(y.current),y.current=setTimeout(()=>{if(m.current.trim()&&b.current==="cmd-listening"){const R=m.current;m.current="",g(R)}},2200)}},S.onend=()=>{const _=b.current;h.current&&_!=="thinking"&&_!=="speaking"?setTimeout(x,200):h.current||(i("off"),p.current=null)},S.onerror=_=>{_.error!=="no-speech"&&i("wake-listening"),h.current&&_.error!=="not-allowed"&&setTimeout(x,600)},p.current=S;try{S.start()}catch{}},[a,n,g]),w=()=>{var N,S;s!=="off"?(h.current=!1,(N=p.current)==null||N.stop(),(S=window.speechSynthesis)==null||S.cancel(),y.current&&clearTimeout(y.current),i("off"),c("")):(h.current=!0,i("wake-listening"),x())};f.useEffect(()=>(h.current=!0,i("wake-listening"),x(),()=>{var N,S;h.current=!1,(N=p.current)==null||N.stop(),(S=window.speechSynthesis)==null||S.cancel(),y.current&&clearTimeout(y.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(bS,{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(U.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(U.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(U.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(U.span,{animate:{scale:[.9,1.1,.9]},transition:{duration:.7,repeat:1/0,ease:"easeInOut"},className:"text-4xl",children:"🔊"}):s==="cmd-listening"?r.jsx(U.span,{animate:{opacity:[.6,1,.6]},transition:{duration:.5,repeat:1/0},children:r.jsx(Nr,{size:38,className:"text-white/95"})}):k?r.jsx(Nr,{size:38,className:"text-orange-300/90"}):r.jsx(yh,{size:38,className:"text-white/90"})}),r.jsx(ee,{mode:"wait",children:r.jsxs(U.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}),d&&r.jsxs("p",{className:"text-[12px] text-white/35 italic max-w-sm line-clamp-3",children:["“",d.slice(0,140),d.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(U.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 Wm(e){return e>=90?"#ef4444":e>=70?"#f97316":"#22c55e"}function Kr(e){return e==="critical"?"#ef4444":e==="warning"?"#f97316":"#60a5fa"}function HC(){const{t:e,locale:t}=pt(),n=e.systemHealth,[s,i]=f.useState(null),[a,o]=f.useState(null),[l,c]=f.useState(!1),d=f.useCallback(()=>o(null),[]);f.useEffect(()=>{window.dispatchEvent(new CustomEvent("mustb:safeMode",{detail:{active:(s==null?void 0:s.safeMode)??!1}}))},[s==null?void 0:s.safeMode]),f.useEffect(()=>{const h=at();return h.on("systemStats",m=>i(m)),h.on("systemHealth",m=>{if(o(m),c(!0),m.level!=="critical"){const y=m.level==="info"?6e3:12e3;setTimeout(()=>o(null),y)}}),()=>{h.off("systemStats"),h.off("systemHealth")}},[]);const u=(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(h=>!h),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:Kr(a.level)}}):r.jsx(Sn,{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:`${u}%`,background:Wm(u)}})}),r.jsxs("span",{className:"text-[9px] font-mono text-white/40 w-6 text-right",children:[u,"%"]}),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:Wm(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(ee,{children:l&&a&&r.jsxs(U.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 ${Kr(a.level)}44`,backdropFilter:"blur(20px)",boxShadow:`0 8px 32px rgba(0,0,0,0.5), 0 0 0 1px ${Kr(a.level)}22`},children:[r.jsxs("div",{className:"flex items-start justify-between px-4 pt-3 pb-2",style:{borderBottom:`1px solid ${Kr(a.level)}22`},children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(es,{size:13,style:{color:Kr(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:d,className:"text-white/30 hover:text-white/70 transition-colors",children:r.jsx(st,{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 WC(e){return`${Math.round(e*100)}%`}const Gm={skill:{label:"Skill",icon:Re,color:"text-orange-400"},conversation:{label:"Conversation",icon:sa,color:"text-blue-400"},workspace:{label:"Workspace",icon:os,color:"text-green-400"},custom:{label:"Custom",icon:Yt,color:"text-gray-400"}};function GC(){const{t:e}=pt(),t=e.panels.memory,[n,s]=f.useState(""),[i,a]=f.useState([]),[o,l]=f.useState(null),[c,d]=f.useState(!1),[u,p]=f.useState(null),[h,m]=f.useState(null),[y,b]=f.useState(!1),v=f.useRef(null),g=f.useCallback(async k=>{const N=k.trim();if(N){d(!0),a([]);try{const S=await $(`/api/memory/search?q=${encodeURIComponent(N)}&limit=10`);if(S.ok){const _=await S.json();a(_.results??[])}}catch{}d(!1)}},[]),x=k=>{k.key==="Enter"&&g(n)},w=f.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(),_=k==="clear"?t.indexCleared:`${t.indexed} ${S.indexed??0} ${k==="skills"?t.skills:t.files}`;m({ok:!0,msg:_}),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(Kt,{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:()=>{b(k=>!k),o||w()},className:`text-gray-600 hover:text-gray-400 transition-colors ${y?"text-orange-400":""}`,title:t.indexControls,children:r.jsx(e4,{size:13})}),r.jsx("button",{onClick:w,className:"text-gray-600 hover:text-gray-400 transition-colors",title:t.refreshStats,children:r.jsx(le,{size:13})})]})]}),r.jsx(ee,{children:y&&r.jsxs(U.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:u!==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:[u===k?r.jsx(ne,{size:10,className:"animate-spin"}):k==="skills"?r.jsx(Re,{size:10}):r.jsx(os,{size:10}),k]},k)),r.jsxs("button",{onClick:()=>j("clear"),disabled:u!==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:[u==="clear"?r.jsx(ne,{size:10,className:"animate-spin"}):r.jsx(Ls,{size:10}),t.clearIndex]})]}),r.jsx(ee,{children:h&&r.jsxs(U.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 ${h.ok?"text-green-400":"text-red-400"}`,children:[h.ok?r.jsx(Je,{size:11}):r.jsx(ln,{size:11}),h.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(qt,{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(Kt,{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=Gm[k.metadata.source]??Gm.custom,_=S.icon;return r.jsxs(U.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(_,{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:WC(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((A,P)=>r.jsx("span",{className:"text-[9px] px-1.5 py-0.5 rounded-md bg-white/4 text-gray-600 font-mono",children:A},P))}),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 KC={node:cn,python:fn},qC={node:"text-green-400",python:"text-blue-400"};function YC(){const{t:e}=pt(),t=e.panels.plugins,[n,s]=f.useState([]),[i,a]=f.useState(!1),[o,l]=f.useState(null),[c,d]=f.useState(null),[u,p]=f.useState(!1),[h,m]=f.useState(""),[y,b]=f.useState(""),[v,g]=f.useState("node"),[x,w]=f.useState(""),[j,k]=f.useState(!1),N=(P,T)=>{d({ok:P,msg:T}),setTimeout(()=>d(null),4e3)},S=f.useCallback(async()=>{a(!0);try{const P=await $("/api/plugins/list");if(P.ok){const T=await P.json();s(T.plugins??[])}}catch{}a(!1)},[]);f.useEffect(()=>{S()},[S]);const _=async(P,T)=>{l(P);try{(await $(T?"/api/plugins/stop":"/api/plugins/run",{method:"POST",body:JSON.stringify({name:P})})).ok?(N(!0,T?`${P} stopped`:`${P} launched`),await S()):N(!1,t.opFailed)}catch{N(!1,t.reqError)}l(null)},A=async()=>{if(!(!h.trim()||!y.trim())){k(!0);try{(await $("/api/plugins/build",{method:"POST",body:JSON.stringify({name:h.trim(),goal:y.trim(),lang:v,context:x.trim()||void 0})})).ok?(N(!0,`Plugin "${h}" created`),m(""),b(""),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(Sr,{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(le,{size:13,className:i?"animate-spin":""})}),r.jsxs("button",{onClick:()=>p(P=>!P),className:`flex items-center gap-1 text-[10px] px-2.5 py-1 rounded-lg border font-semibold transition-all ${u?"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(ll,{size:10}),t.newPlugin]})]})]}),r.jsx(ee,{children:c&&r.jsxs(U.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(Je,{size:11}):r.jsx(ln,{size:11}),c.msg]})}),r.jsx(ee,{children:u&&r.jsx(U.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:h,onChange:P=>m(P.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:y,onChange:P=>b(P.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:P=>w(P.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(P=>r.jsx("button",{onClick:()=>g(P),className:`flex-1 py-1.5 rounded-lg border text-[11px] font-semibold transition-all capitalize ${v===P?"bg-orange-500/15 border-orange-500/25 text-orange-400":"bg-white/4 border-white/8 text-gray-500"}`,children:P},P))}),r.jsxs("button",{onClick:A,disabled:j||!h.trim()||!y.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(Re,{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(Sr,{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((P,T)=>{const V=KC[P.lang]??cn,M=o===P.name;return r.jsxs(U.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 ${P.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:qC[P.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:P.name}),r.jsx("p",{className:"text-[10px] text-gray-600 font-mono",children:P.filename})]}),P.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:M,onClick:()=>_(P.name,P.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 ${P.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:[M?r.jsx(ne,{size:10,className:"animate-spin"}):P.running?r.jsx(wh,{size:10}):r.jsx(Rs,{size:10}),P.running?t.stop:t.run]})]},P.name)})]})]})}function XC(e){if(!e)return"Never";try{return new Date(e).toLocaleString("en-US",{dateStyle:"short",timeStyle:"short"})}catch{return e}}function QC(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 JC({skill:e}){const[t,n]=f.useState(!1),[s,i]=f.useState(!1),[a,o]=f.useState(""),[l,c]=f.useState(!1),d=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)}},u=(e.requires.bins??[]).length>0,p=(e.requires.config??[]).length>0;return r.jsx(U.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(Ps,{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}),(u||p)&&r.jsxs("div",{className:"flex flex-wrap gap-1 mb-2 ml-6",children:[(e.requires.bins??[]).map(h=>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:",h]},h)),(e.requires.config??[]).map(h=>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:",h]},h))]}),r.jsx(ee,{children:l&&r.jsx(U.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:h=>o(h.target.value),onKeyDown:h=>{h.key==="Enter"&&d(),h.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:d,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(Je,{size:9})," Sent"]}):l?r.jsxs(r.Fragment,{children:[r.jsx(on,{size:9})," Run"]}):r.jsxs(r.Fragment,{children:[r.jsx(QS,{size:9})," Use"]})})]})]})})}function ZC(){const{t:e}=pt(),t=e.panels.skills,[n,s]=f.useState("saved"),[i,a]=f.useState([]),[o,l]=f.useState(!1),[c,d]=f.useState(null),[u,p]=f.useState("idle"),[h,m]=f.useState(null),[y,b]=f.useState(null),[v,g]=f.useState([]),[x,w]=f.useState(!1),[j,k]=f.useState(""),N=f.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=f.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)},[]);f.useEffect(()=>{N()},[N]),f.useEffect(()=>{n==="library"&&v.length===0&&S()},[n,v.length,S]),f.useEffect(()=>{const T=at(),V=M=>{M.type==="skillRunStart"&&M.skillId&&(d(M.skillId),p("running")),M.type==="planFinish"&&(p("done"),d(null),N(),setTimeout(()=>p("idle"),2500))};return T.on("agentUpdate",V),()=>{T.off("agentUpdate",V)}},[N]);const _=async T=>{if(!c){d(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"),d(null),setTimeout(()=>p("idle"),3e3)}}},A=async T=>{m(T);try{await $(`/api/skills/${T}`,{method:"DELETE"}),a(V=>V.filter(M=>M.id!==T))}catch{}m(null),b(null)},P=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(ph,{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(Re,{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(sc,{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(le,{size:13,className:(n==="saved"?o:x)?"animate-spin":""})})]}),n==="saved"&&r.jsxs(r.Fragment,{children:[r.jsx(ee,{children:u!=="idle"&&r.jsxs(U.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 ${u==="running"?"bg-orange-500/8 border-orange-500/15 text-orange-400":u==="done"?"bg-green-500/8 border-green-500/15 text-green-400":"bg-red-500/8 border-red-500/15 text-red-400"}`,children:[u==="running"&&r.jsx(ne,{size:12,className:"animate-spin"}),u==="done"&&r.jsx(Je,{size:12}),u==="error"&&r.jsx(ln,{size:12}),u==="running"?t.runningStatus:u==="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(Re,{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(sc,{size:11})," Browse skill library"]})]}):i.map((T,V)=>{const M=c===T.id&&u==="running",I=c===T.id&&u==="done",z=h===T.id;return r.jsx(U.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:V*.04},className:`rounded-2xl border bg-[#0c0f18] transition-all ${M?"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(Re,{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(Jy,{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((R,B)=>r.jsx("span",{className:"text-[9px] px-1.5 py-0.5 rounded-md bg-white/4 text-gray-600 font-mono",children:R.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(en,{size:9}),r.jsx("span",{children:QC(T.savedAt)}),T.lastRunAt&&r.jsxs("span",{className:"text-gray-800",children:["· ",t.lastRun," ",XC(T.lastRunAt)]})]}),r.jsxs("div",{className:"flex items-center gap-1",children:[y===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:()=>A(T.id),disabled:z,className:"text-[10px] px-2 py-0.5 rounded bg-red-500/15 text-red-400 hover:bg-red-500/25 transition-colors",children:z?"…":t.yes}),r.jsx("button",{onClick:()=>b(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:()=>b(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(Ls,{size:12})}),r.jsx("button",{onClick:()=>_(T),disabled:!!c,className:`flex items-center gap-1.5 px-3 py-1.5 rounded-xl text-[11px] font-semibold transition-all ${M?"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:M?r.jsxs(r.Fragment,{children:[r.jsx(ne,{size:11,className:"animate-spin"})," ",t.runningBtn]}):I?r.jsxs(r.Fragment,{children:[r.jsx(Je,{size:11})," ",t.doneBtn]}):r.jsxs(r.Fragment,{children:[r.jsx(Rs,{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…"]}):P.length===0?r.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center col-span-1",children:[r.jsx(sc,{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"})]}):P.map((T,V)=>r.jsx(U.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{delay:Math.min(V*.02,.4)},children:r.jsx(JC,{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:[P.length," / ",v.length," skills"]})})]})]})}const e_={html:gm,htm:gm,json:fn,js:fn,ts:fn,tsx:fn,jsx:fn};function t_(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function n_(e){try{return new Date(e).toLocaleString("en-US",{dateStyle:"short",timeStyle:"short"})}catch{return e}}function s_(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").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 r_(){const[e,t]=f.useState([]),[n,s]=f.useState(null),[i,a]=f.useState(null),[o,l]=f.useState(!1),[c,d]=f.useState(null),[u,p]=f.useState(!1),h=f.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)},[]);f.useEffect(()=>{h()},[h]);const m=async v=>{s(v),a(null),d(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?`
|
|
727
|
+
`}),r.jsx("div",{className:"max-w-full",dangerouslySetInnerHTML:{__html:h}})]})]})]})]})}const _C=[{id:"terminal",label:"Terminal",desc:"Kabuk komutları çalıştır",Icon:Ps,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:Xe,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:qt,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:os,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:a1,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:cn,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:Kt,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:_d,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:vh,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:Ed,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:sa,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:t1,color:"text-amber-400",bg:"bg-amber-500/10",border:"border-amber-500/20"}];function EC(){const[e,t]=f.useState("tools"),[n,s]=f.useState([]),[i,a]=f.useState([]),[o,l]=f.useState({}),[c,d]=f.useState(!1),[u,p]=f.useState(""),h=f.useCallback(async()=>{d(!0);try{const j=await $("/api/skills/list");if(j.ok){const k=await j.json();s(Array.isArray(k)?k:[])}}catch{}d(!1)},[]),m=f.useCallback(async()=>{d(!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{}d(!1)},[]);f.useEffect(()=>{e==="saved"&&h(),e==="catalog"&&m()},[e,h,m]);const y=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"})),pe[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"}))}},b=async j=>{try{await $(`/api/skills/${j}`,{method:"DELETE"}),s(k=>k.filter(N=>N.id!==j)),pe.success("Beceri silindi.")}catch{pe.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&&pe.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=_C.filter(j=>j.label.toLowerCase().includes(u.toLowerCase())||j.desc.toLowerCase().includes(u.toLowerCase())),x=n.filter(j=>j.name.toLowerCase().includes(u.toLowerCase())||j.goal.toLowerCase().includes(u.toLowerCase())),w=i.filter(j=>j.name.toLowerCase().includes(u.toLowerCase())||j.description.toLowerCase().includes(u.toLowerCase())||(j.pluginName??"").toLowerCase().includes(u.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(Re,{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(qt,{size:13,className:"absolute left-3 top-1/2 -translate-y-1/2 text-white/25"}),r.jsx("input",{value:u,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:_,bg:A,border:P})=>r.jsxs(U.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 ${P}`,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 ${A} border ${P}`,children:r.jsx(S,{size:16,className:_})}),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:h,className:"p-1.5 text-white/30 hover:text-white/70 rounded-lg hover:bg-white/6 transition-all",children:r.jsx(le,{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:u?"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(U.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(ph,{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(Qy,{size:9})," ",j.runCount," çalıştırma"]}),r.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-white/25",children:[r.jsx(en,{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:()=>y(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(Je,{size:13}):k==="error"?r.jsx(ln,{size:13}):r.jsx(Rs,{size:13})}),r.jsx("button",{onClick:()=>b(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(Ls,{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(le,{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:u?"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(U.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(Je,{size:13}):k==="error"?r.jsx(ln,{size:13}):r.jsx(Sn,{size:13})})]},j.id)})})]})]})}const TC={node:cn,python:fn,api:zr,cli:Ps,web:Xe,database:il,cloud:Zy,agent:Hi};function PC(e,t){const n=e.toLowerCase();return n.includes("api")||n.includes("webhook")?zr:n.includes("db")||n.includes("database")||n.includes("sql")?il:n.includes("cloud")||n.includes("s3")||n.includes("gcs")?Zy:n.includes("agent")||n.includes("bot")?Hi:n.includes("web")||n.includes("http")?Xe:TC[t]??ra}function AC(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 MC(){const[e,t]=f.useState([]),[n,s]=f.useState([]),[i,a]=f.useState(!1),[o,l]=f.useState(null),[c,d]=f.useState(!1),[u,p]=f.useState(""),[h,m]=f.useState(""),[y,b]=f.useState("node"),[v,g]=f.useState(""),[x,w]=f.useState(!1),j=f.useCallback(async()=>{a(!0);try{const[A,P]=await Promise.all([$("/api/plugins/list"),$("/api/skills/catalog")]);if(A.ok){const T=await A.json();t(Array.isArray(T)?T:[])}if(P.ok){const T=await P.json(),V=Array.isArray(T)?T:T.skills??[];s(AC(V))}}catch{}a(!1)},[]);f.useEffect(()=>{j()},[j]);const k=async A=>{l(A.name);try{const P=A.running?"/api/plugins/stop":"/api/plugins/run";(await $(P,{method:"POST",body:JSON.stringify({name:A.name})})).ok?(t(V=>(Array.isArray(V)?V:[]).map(M=>M.name===A.name?{...M,running:!M.running}:M)),pe.success(A.running?`"${A.name}" durduruldu`:`"${A.name}" başlatıldı`)):pe.error("İşlem başarısız.")}catch{pe.error("Bağlantı hatası.")}l(null)},N=async A=>{if(A.preventDefault(),!(!u.trim()||!h.trim())){w(!0);try{const P=await $("/api/plugins/build",{method:"POST",body:JSON.stringify({name:u,goal:h,lang:y,context:v})});if(P.ok){const T=await P.json();pe.success(`"${T.name??u}" eklentisi oluşturuldu!`),p(""),m(""),g(""),d(!1),j()}else{const T=await P.json().catch(()=>({}));pe.error(T.error??"Oluşturma başarısız.")}}catch{pe.error("Gateway bağlantı hatası.")}w(!1)}},S=Array.isArray(e)?e:[],_=S.filter(A=>A.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(Sr,{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 · ",_," ç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(le,{size:14})}),r.jsxs("button",{onClick:()=>d(A=>!A),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(st,{size:13}):r.jsx(ll,{size:13}),c?"Kapat":"Yeni Eklenti"]})]})]}),r.jsx(ee,{children:c&&r.jsx(U.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(Re,{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:u,onChange:A=>p(A.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(A=>r.jsxs("button",{type:"button",onClick:()=>b(A),className:`flex-1 py-2 text-[12px] font-semibold transition-all flex items-center justify-center gap-1.5 ${y===A?"bg-orange-500/20 text-orange-300":"text-white/40 hover:text-white/70 hover:bg-white/5"}`,children:[A==="node"?r.jsx(cn,{size:12}):r.jsx(fn,{size:12}),A==="node"?"Node.js":"Python"]},A))})]})]}),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:h,onChange:A=>m(A.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:A=>g(A.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||!u.trim()||!h.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(Sn,{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(A=>r.jsxs(U.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:A.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:A.name}),r.jsxs("p",{className:"text-[10px] text-white/30 mt-0.5",children:[A.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ü"})]},A.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(Sr,{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(A=>{const P=o===A.name,T=PC(A.name,A.lang),V=A.lang==="node"?cn:fn;return r.jsxs(U.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},className:`rounded-2xl p-4 border transition-all ${A.running?"border-orange-500/25":"border-white/8 hover:border-white/14"}`,style:{background:A.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 ${A.running?"bg-orange-500/15 border border-orange-500/25":"bg-white/6 border border-white/10"}`,children:r.jsx(T,{size:16,className:A.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:A.name}),r.jsxs("div",{className:"flex items-center gap-1 mt-0.5",children:[r.jsx(V,{size:9,className:A.lang==="node"?"text-green-400/60":"text-blue-400/60"}),r.jsx("span",{className:`text-[9px] font-semibold ${A.lang==="node"?"text-green-400/60":"text-blue-400/60"}`,children:A.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 ${A.running?"bg-orange-500/15 border-orange-500/25 text-orange-400":"bg-white/5 border-white/10 text-white/30"}`,children:A.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(A.createdAt).toLocaleDateString("tr-TR")}),r.jsxs("button",{onClick:()=>k(A),disabled:P,className:`flex items-center gap-1.5 px-3 py-1.5 rounded-xl text-[11px] font-semibold transition-all border ${A.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:[P?r.jsx(ne,{size:11,className:"animate-spin"}):A.running?r.jsx(wh,{size:11}):r.jsx(Rs,{size:11}),A.running?"Durdur":"Başlat"]})]})]},A.name)})})]})}function zC(){return new URLSearchParams(window.location.search).get("token")??""}function RC(){const[e,t]=f.useState("connecting"),[n,s]=f.useState([]),[i,a]=f.useState([]),[o,l]=f.useState("idle"),[c,d]=f.useState(null),[u,p]=f.useState(""),h=f.useRef(null),m=f.useRef(null),y=f.useRef([]),b=zC();f.useEffect(()=>{if(!b){t("denied");return}const k=yi(`${window.location.origin}/mobile`,{query:{token:b},transports:["websocket","polling"]});return h.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 _=N.step;s(A=>[...A,{id:`${Date.now()}-${Math.random()}`,description:(_==null?void 0:_.description)??"Working…",status:"running"}])}S==="stepFinish"&&s(_=>{const A=[..._],P=A.findLastIndex(T=>T.status==="running");return P>=0&&(A[P]={...A[P],status:N.status==="error"?"error":"done"}),A}),S==="skillRunStart"&&N.skillId&&d(N.skillId),S==="planFinish"&&d(null)}),()=>{k.disconnect()}},[b]);const v=f.useCallback(async()=>{try{const k=await fetch("/api/skills/list",{headers:{Authorization:`Bearer ${b}`}});if(k.ok){const N=await k.json();a(N.skills??[])}}catch{}},[b]);f.useEffect(()=>{v()},[v]);const g=async()=>{try{const k=await navigator.mediaDevices.getUserMedia({audio:!0}),N=new MediaRecorder(k,{mimeType:"audio/webm"});y.current=[],N.ondataavailable=S=>{S.data.size>0&&y.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(y.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 ${b}`},body:N});if(S.ok){const{text:_}=await S.json();p(_),await fetch("/api/goal",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${b}`},body:JSON.stringify({goal:_})})}}catch{}l("idle")},j=async k=>{if(!c){d(k.id);try{await fetch("/api/skills/run",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${b}`},body:JSON.stringify({id:k.id})})}catch{d(null)}}};return!b||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(ln,{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(s4,{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(Ds,{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(U.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(yh,{size:36,className:"text-red-400"}):r.jsx(Nr,{size:36,className:"text-orange-400"}),o==="recording"&&r.jsx(U.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"}),u&&r.jsxs("p",{className:"text-[11px] text-orange-300 mt-3 text-center max-w-xs",children:['"',u,'"']})]}),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(ee,{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(U.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(Je,{size:12,className:"text-green-400 mt-0.5 shrink-0"}),k.status==="error"&&r.jsx(ln,{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(le,{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(U.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(Re,{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(Rs,{size:11}),N?"Running":"Run"]})]},k.id)})})]})]})}function LC(){const[e,t]=f.useState([]),[n,s]=f.useState(!0),[i,a]=f.useState(null);return f.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(os,{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(Yt,{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 DC=[{value:"all",label:"Tüm Veriler",icon:r.jsx(Xe,{size:13})},{value:"text",label:"Sadece Metin",icon:r.jsx(Yt,{size:13})},{value:"links",label:"Sadece Linkler",icon:r.jsx(zr,{size:13})},{value:"images",label:"Sadece Görseller",icon:r.jsx(gh,{size:13})}];function OC(e){return e==="text"?r.jsx(Yt,{size:13,className:"text-orange-400 shrink-0 mt-0.5"}):e==="link"?r.jsx(zr,{size:13,className:"text-blue-400 shrink-0 mt-0.5"}):r.jsx(gh,{size:13,className:"text-purple-400 shrink-0 mt-0.5"})}function IC(e){return e==="text"?"Metin":e==="link"?"Link":"Görsel"}function BC(){const[e,t]=f.useState(""),[n,s]=f.useState("all"),[i,a]=f.useState(!1),[o,l]=f.useState(null),[c,d]=f.useState(null),[u,p]=f.useState(new Set),[h,m]=f.useState(!1),[y,b]=f.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=()=>{u.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),d(null),p(new Set),b(!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 _=S.items??[];d(_),p(new Set(_.map(A=>A.id)))}}catch{l("Ağ bağlantısı kurulamadı. Backend çalışıyor mu?")}finally{a(!1)}}},j=async()=>{const k=(c??[]).filter(N=>u.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(()=>{}),b(!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(Xe,{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:DC.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(ln,{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 · ",u.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(on,{size:12}),u.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:[IC(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:u.has(S.id)?"rgba(249,115,22,0.08)":"rgba(255,255,255,0.03)",border:u.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:u.has(S.id)?"rgba(249,115,22,0.8)":"rgba(255,255,255,0.08)",border:u.has(S.id)?"1px solid rgba(249,115,22,0.9)":"1px solid rgba(255,255,255,0.18)"},onClick:()=>g(S.id),children:u.has(S.id)&&r.jsx(Mt,{size:10,className:"text-white"})}),OC(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:y?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(Mt,{size:14}),u.size," öğe belleğe kaydedildi"]}):r.jsx("button",{onClick:j,disabled:h||u.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:h?r.jsxs(r.Fragment,{children:[r.jsx(ne,{size:14,className:"animate-spin"})," Kaydediliyor…"]}):r.jsxs(r.Fragment,{children:[r.jsx(Xy,{size:14})," Seçilenleri Belleğe Kaydet (",u.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 FC(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 VC(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 $C(){const e=un(),{t,locale:n}=pt(),[s,i]=f.useState("wake-listening"),[a,o]=f.useState("Must-b"),[l,c]=f.useState(""),[d,u]=f.useState(""),p=f.useRef(null),h=f.useRef(!1),m=f.useRef(""),y=f.useRef(null),b=f.useRef("wake-listening");f.useEffect(()=>{b.current=s},[s]),f.useEffect(()=>{$("/api/identity").then(N=>N.json()).then(N=>{N.name&&o(N.name)}).catch(()=>{})},[]);const v=f.useCallback(N=>{if(!window.speechSynthesis)return;window.speechSynthesis.cancel();const S=new SpeechSynthesisUtterance(N),_=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=_,S.rate=1.05,S.pitch=1;const A=()=>{const P=VC(_.split("-")[0]);P&&(S.voice=P)};A(),!S.voice&&window.speechSynthesis.onvoiceschanged!==void 0&&(window.speechSynthesis.onvoiceschanged=A),S.onend=()=>{i("wake-listening"),u(""),c("")},S.onerror=()=>i("wake-listening"),i("speaking"),window.speechSynthesis.speak(S)},[n]),g=f.useCallback(async N=>{if(!N.trim()){i("wake-listening");return}i("thinking"),c(N);try{const _=await(await $("/api/goal",{method:"POST",body:JSON.stringify({goal:N,voice:!0})})).json(),A=_.result??_.reply??_.response??_.output??"Done.";u(A),v(A)}catch{i("wake-listening")}},[v]),x=f.useCallback(()=>{const N=window.SpeechRecognition||window.webkitSpeechRecognition;if(!N||!h.current)return;const S=new N;S.continuous=!0,S.interimResults=!0,S.lang=n==="tr"?"tr-TR":"en-US",S.onresult=_=>{var V,M;let A="";for(let I=_.resultIndex;I<_.results.length;I++)A+=_.results[I][0].transcript;const P=FC(A),T=b.current;if(c(P),T==="wake-listening"){const I=`hey ${a}`.toLowerCase();if(P.toLowerCase().includes(I)){const z=((V=P.toLowerCase().split(I)[1])==null?void 0:V.trim())??"";m.current=z,i("cmd-listening"),y.current&&clearTimeout(y.current),y.current=setTimeout(()=>{if(m.current.trim()&&b.current==="cmd-listening"){const R=m.current;m.current="",g(R)}},1800)}}else if(T==="cmd-listening"){const I=`hey ${a}`.toLowerCase(),z=P.toLowerCase().includes(I)?((M=P.toLowerCase().split(I)[1])==null?void 0:M.trim())??P:P;m.current=z,y.current&&clearTimeout(y.current),y.current=setTimeout(()=>{if(m.current.trim()&&b.current==="cmd-listening"){const R=m.current;m.current="",g(R)}},2200)}},S.onend=()=>{const _=b.current;h.current&&_!=="thinking"&&_!=="speaking"?setTimeout(x,200):h.current||(i("off"),p.current=null)},S.onerror=_=>{_.error!=="no-speech"&&i("wake-listening"),h.current&&_.error!=="not-allowed"&&setTimeout(x,600)},p.current=S;try{S.start()}catch{}},[a,n,g]),w=()=>{var N,S;s!=="off"?(h.current=!1,(N=p.current)==null||N.stop(),(S=window.speechSynthesis)==null||S.cancel(),y.current&&clearTimeout(y.current),i("off"),c("")):(h.current=!0,i("wake-listening"),x())};f.useEffect(()=>(h.current=!0,i("wake-listening"),x(),()=>{var N,S;h.current=!1,(N=p.current)==null||N.stop(),(S=window.speechSynthesis)==null||S.cancel(),y.current&&clearTimeout(y.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(vS,{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(U.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(U.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(U.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(U.span,{animate:{scale:[.9,1.1,.9]},transition:{duration:.7,repeat:1/0,ease:"easeInOut"},className:"text-4xl",children:"🔊"}):s==="cmd-listening"?r.jsx(U.span,{animate:{opacity:[.6,1,.6]},transition:{duration:.5,repeat:1/0},children:r.jsx(Nr,{size:38,className:"text-white/95"})}):k?r.jsx(Nr,{size:38,className:"text-orange-300/90"}):r.jsx(yh,{size:38,className:"text-white/90"})}),r.jsx(ee,{mode:"wait",children:r.jsxs(U.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}),d&&r.jsxs("p",{className:"text-[12px] text-white/35 italic max-w-sm line-clamp-3",children:["“",d.slice(0,140),d.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(U.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 Wm(e){return e>=90?"#ef4444":e>=70?"#f97316":"#22c55e"}function Kr(e){return e==="critical"?"#ef4444":e==="warning"?"#f97316":"#60a5fa"}function UC(){const{t:e,locale:t}=pt(),n=e.systemHealth,[s,i]=f.useState(null),[a,o]=f.useState(null),[l,c]=f.useState(!1),d=f.useCallback(()=>o(null),[]);f.useEffect(()=>{window.dispatchEvent(new CustomEvent("mustb:safeMode",{detail:{active:(s==null?void 0:s.safeMode)??!1}}))},[s==null?void 0:s.safeMode]),f.useEffect(()=>{const h=at();return h.on("systemStats",m=>i(m)),h.on("systemHealth",m=>{if(o(m),c(!0),m.level!=="critical"){const y=m.level==="info"?6e3:12e3;setTimeout(()=>o(null),y)}}),()=>{h.off("systemStats"),h.off("systemHealth")}},[]);const u=(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(h=>!h),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:Kr(a.level)}}):r.jsx(Sn,{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:`${u}%`,background:Wm(u)}})}),r.jsxs("span",{className:"text-[9px] font-mono text-white/40 w-6 text-right",children:[u,"%"]}),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:Wm(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(ee,{children:l&&a&&r.jsxs(U.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 ${Kr(a.level)}44`,backdropFilter:"blur(20px)",boxShadow:`0 8px 32px rgba(0,0,0,0.5), 0 0 0 1px ${Kr(a.level)}22`},children:[r.jsxs("div",{className:"flex items-start justify-between px-4 pt-3 pb-2",style:{borderBottom:`1px solid ${Kr(a.level)}22`},children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(es,{size:13,style:{color:Kr(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:d,className:"text-white/30 hover:text-white/70 transition-colors",children:r.jsx(st,{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 HC(e){return`${Math.round(e*100)}%`}const Gm={skill:{label:"Skill",icon:Re,color:"text-orange-400"},conversation:{label:"Conversation",icon:sa,color:"text-blue-400"},workspace:{label:"Workspace",icon:os,color:"text-green-400"},custom:{label:"Custom",icon:Yt,color:"text-gray-400"}};function WC(){const{t:e}=pt(),t=e.panels.memory,[n,s]=f.useState(""),[i,a]=f.useState([]),[o,l]=f.useState(null),[c,d]=f.useState(!1),[u,p]=f.useState(null),[h,m]=f.useState(null),[y,b]=f.useState(!1),v=f.useRef(null),g=f.useCallback(async k=>{const N=k.trim();if(N){d(!0),a([]);try{const S=await $(`/api/memory/search?q=${encodeURIComponent(N)}&limit=10`);if(S.ok){const _=await S.json();a(_.results??[])}}catch{}d(!1)}},[]),x=k=>{k.key==="Enter"&&g(n)},w=f.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(),_=k==="clear"?t.indexCleared:`${t.indexed} ${S.indexed??0} ${k==="skills"?t.skills:t.files}`;m({ok:!0,msg:_}),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(Kt,{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:()=>{b(k=>!k),o||w()},className:`text-gray-600 hover:text-gray-400 transition-colors ${y?"text-orange-400":""}`,title:t.indexControls,children:r.jsx(ZS,{size:13})}),r.jsx("button",{onClick:w,className:"text-gray-600 hover:text-gray-400 transition-colors",title:t.refreshStats,children:r.jsx(le,{size:13})})]})]}),r.jsx(ee,{children:y&&r.jsxs(U.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:u!==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:[u===k?r.jsx(ne,{size:10,className:"animate-spin"}):k==="skills"?r.jsx(Re,{size:10}):r.jsx(os,{size:10}),k]},k)),r.jsxs("button",{onClick:()=>j("clear"),disabled:u!==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:[u==="clear"?r.jsx(ne,{size:10,className:"animate-spin"}):r.jsx(Ls,{size:10}),t.clearIndex]})]}),r.jsx(ee,{children:h&&r.jsxs(U.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 ${h.ok?"text-green-400":"text-red-400"}`,children:[h.ok?r.jsx(Je,{size:11}):r.jsx(ln,{size:11}),h.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(qt,{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(Kt,{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=Gm[k.metadata.source]??Gm.custom,_=S.icon;return r.jsxs(U.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(_,{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:HC(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((A,P)=>r.jsx("span",{className:"text-[9px] px-1.5 py-0.5 rounded-md bg-white/4 text-gray-600 font-mono",children:A},P))}),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 GC={node:cn,python:fn},KC={node:"text-green-400",python:"text-blue-400"};function qC(){const{t:e}=pt(),t=e.panels.plugins,[n,s]=f.useState([]),[i,a]=f.useState(!1),[o,l]=f.useState(null),[c,d]=f.useState(null),[u,p]=f.useState(!1),[h,m]=f.useState(""),[y,b]=f.useState(""),[v,g]=f.useState("node"),[x,w]=f.useState(""),[j,k]=f.useState(!1),N=(P,T)=>{d({ok:P,msg:T}),setTimeout(()=>d(null),4e3)},S=f.useCallback(async()=>{a(!0);try{const P=await $("/api/plugins/list");if(P.ok){const T=await P.json();s(T.plugins??[])}}catch{}a(!1)},[]);f.useEffect(()=>{S()},[S]);const _=async(P,T)=>{l(P);try{(await $(T?"/api/plugins/stop":"/api/plugins/run",{method:"POST",body:JSON.stringify({name:P})})).ok?(N(!0,T?`${P} stopped`:`${P} launched`),await S()):N(!1,t.opFailed)}catch{N(!1,t.reqError)}l(null)},A=async()=>{if(!(!h.trim()||!y.trim())){k(!0);try{(await $("/api/plugins/build",{method:"POST",body:JSON.stringify({name:h.trim(),goal:y.trim(),lang:v,context:x.trim()||void 0})})).ok?(N(!0,`Plugin "${h}" created`),m(""),b(""),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(Sr,{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(le,{size:13,className:i?"animate-spin":""})}),r.jsxs("button",{onClick:()=>p(P=>!P),className:`flex items-center gap-1 text-[10px] px-2.5 py-1 rounded-lg border font-semibold transition-all ${u?"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(ll,{size:10}),t.newPlugin]})]})]}),r.jsx(ee,{children:c&&r.jsxs(U.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(Je,{size:11}):r.jsx(ln,{size:11}),c.msg]})}),r.jsx(ee,{children:u&&r.jsx(U.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:h,onChange:P=>m(P.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:y,onChange:P=>b(P.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:P=>w(P.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(P=>r.jsx("button",{onClick:()=>g(P),className:`flex-1 py-1.5 rounded-lg border text-[11px] font-semibold transition-all capitalize ${v===P?"bg-orange-500/15 border-orange-500/25 text-orange-400":"bg-white/4 border-white/8 text-gray-500"}`,children:P},P))}),r.jsxs("button",{onClick:A,disabled:j||!h.trim()||!y.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(Re,{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(Sr,{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((P,T)=>{const V=GC[P.lang]??cn,M=o===P.name;return r.jsxs(U.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 ${P.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:KC[P.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:P.name}),r.jsx("p",{className:"text-[10px] text-gray-600 font-mono",children:P.filename})]}),P.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:M,onClick:()=>_(P.name,P.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 ${P.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:[M?r.jsx(ne,{size:10,className:"animate-spin"}):P.running?r.jsx(wh,{size:10}):r.jsx(Rs,{size:10}),P.running?t.stop:t.run]})]},P.name)})]})]})}function YC(e){if(!e)return"Never";try{return new Date(e).toLocaleString("en-US",{dateStyle:"short",timeStyle:"short"})}catch{return e}}function XC(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 QC({skill:e}){const[t,n]=f.useState(!1),[s,i]=f.useState(!1),[a,o]=f.useState(""),[l,c]=f.useState(!1),d=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)}},u=(e.requires.bins??[]).length>0,p=(e.requires.config??[]).length>0;return r.jsx(U.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(Ps,{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}),(u||p)&&r.jsxs("div",{className:"flex flex-wrap gap-1 mb-2 ml-6",children:[(e.requires.bins??[]).map(h=>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:",h]},h)),(e.requires.config??[]).map(h=>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:",h]},h))]}),r.jsx(ee,{children:l&&r.jsx(U.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:h=>o(h.target.value),onKeyDown:h=>{h.key==="Enter"&&d(),h.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:d,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(Je,{size:9})," Sent"]}):l?r.jsxs(r.Fragment,{children:[r.jsx(on,{size:9})," Run"]}):r.jsxs(r.Fragment,{children:[r.jsx(XS,{size:9})," Use"]})})]})]})})}function JC(){const{t:e}=pt(),t=e.panels.skills,[n,s]=f.useState("saved"),[i,a]=f.useState([]),[o,l]=f.useState(!1),[c,d]=f.useState(null),[u,p]=f.useState("idle"),[h,m]=f.useState(null),[y,b]=f.useState(null),[v,g]=f.useState([]),[x,w]=f.useState(!1),[j,k]=f.useState(""),N=f.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=f.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)},[]);f.useEffect(()=>{N()},[N]),f.useEffect(()=>{n==="library"&&v.length===0&&S()},[n,v.length,S]),f.useEffect(()=>{const T=at(),V=M=>{M.type==="skillRunStart"&&M.skillId&&(d(M.skillId),p("running")),M.type==="planFinish"&&(p("done"),d(null),N(),setTimeout(()=>p("idle"),2500))};return T.on("agentUpdate",V),()=>{T.off("agentUpdate",V)}},[N]);const _=async T=>{if(!c){d(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"),d(null),setTimeout(()=>p("idle"),3e3)}}},A=async T=>{m(T);try{await $(`/api/skills/${T}`,{method:"DELETE"}),a(V=>V.filter(M=>M.id!==T))}catch{}m(null),b(null)},P=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(ph,{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(Re,{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(sc,{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(le,{size:13,className:(n==="saved"?o:x)?"animate-spin":""})})]}),n==="saved"&&r.jsxs(r.Fragment,{children:[r.jsx(ee,{children:u!=="idle"&&r.jsxs(U.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 ${u==="running"?"bg-orange-500/8 border-orange-500/15 text-orange-400":u==="done"?"bg-green-500/8 border-green-500/15 text-green-400":"bg-red-500/8 border-red-500/15 text-red-400"}`,children:[u==="running"&&r.jsx(ne,{size:12,className:"animate-spin"}),u==="done"&&r.jsx(Je,{size:12}),u==="error"&&r.jsx(ln,{size:12}),u==="running"?t.runningStatus:u==="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(Re,{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(sc,{size:11})," Browse skill library"]})]}):i.map((T,V)=>{const M=c===T.id&&u==="running",I=c===T.id&&u==="done",z=h===T.id;return r.jsx(U.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:V*.04},className:`rounded-2xl border bg-[#0c0f18] transition-all ${M?"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(Re,{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(Qy,{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((R,B)=>r.jsx("span",{className:"text-[9px] px-1.5 py-0.5 rounded-md bg-white/4 text-gray-600 font-mono",children:R.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(en,{size:9}),r.jsx("span",{children:XC(T.savedAt)}),T.lastRunAt&&r.jsxs("span",{className:"text-gray-800",children:["· ",t.lastRun," ",YC(T.lastRunAt)]})]}),r.jsxs("div",{className:"flex items-center gap-1",children:[y===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:()=>A(T.id),disabled:z,className:"text-[10px] px-2 py-0.5 rounded bg-red-500/15 text-red-400 hover:bg-red-500/25 transition-colors",children:z?"…":t.yes}),r.jsx("button",{onClick:()=>b(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:()=>b(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(Ls,{size:12})}),r.jsx("button",{onClick:()=>_(T),disabled:!!c,className:`flex items-center gap-1.5 px-3 py-1.5 rounded-xl text-[11px] font-semibold transition-all ${M?"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:M?r.jsxs(r.Fragment,{children:[r.jsx(ne,{size:11,className:"animate-spin"})," ",t.runningBtn]}):I?r.jsxs(r.Fragment,{children:[r.jsx(Je,{size:11})," ",t.doneBtn]}):r.jsxs(r.Fragment,{children:[r.jsx(Rs,{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…"]}):P.length===0?r.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center col-span-1",children:[r.jsx(sc,{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"})]}):P.map((T,V)=>r.jsx(U.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{delay:Math.min(V*.02,.4)},children:r.jsx(QC,{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:[P.length," / ",v.length," skills"]})})]})]})}const ZC={html:gm,htm:gm,json:fn,js:fn,ts:fn,tsx:fn,jsx:fn};function e_(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function t_(e){try{return new Date(e).toLocaleString("en-US",{dateStyle:"short",timeStyle:"short"})}catch{return e}}function n_(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").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 s_(){const[e,t]=f.useState([]),[n,s]=f.useState(null),[i,a]=f.useState(null),[o,l]=f.useState(!1),[c,d]=f.useState(null),[u,p]=f.useState(!1),h=f.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)},[]);f.useEffect(()=>{h()},[h]);const m=async v=>{s(v),a(null),d(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?`
|
|
728
728
|
|
|
729
|
-
[… file truncated at 1.5 MB …]`:""))}catch(g){d(g instanceof Error?g.message:"Failed to load file")}l(!1)},y=v=>{const g=e_[v]??Yt;return r.jsx(g,{size:12,className:"shrink-0 text-gray-500"})},b=()=>{if(o)return r.jsxs("div",{className:"flex items-center justify-center h-full text-gray-600 text-xs gap-2",children:[r.jsx(le,{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(ln,{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"?s_(i):i.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">");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(os,{size:11,className:"text-orange-400"}),"Workspace"]}),r.jsx("button",{onClick:h,disabled:u,className:"text-gray-700 hover:text-gray-400 transition-colors",title:"Refresh",children:r.jsx(le,{size:11,className:u?"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:[y(v.ext),r.jsx("span",{className:"text-[11px] truncate flex-1",children:v.name}),r.jsx(on,{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(ee,{mode:"wait",children:n?r.jsxs(U.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:[t_(n.size)," · ",n_(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:b()})]})]})}const Da={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 i_(){const[e,t]=f.useState(!1),[n,s]=f.useState(null),[i,a]=f.useState(null),[o,l]=f.useState(!1),c=f.useRef(null);f.useEffect(()=>{if(!n||!c.current)return;const u=c.current,p=u.getContext("2d");if(!p)return;const h=new Image;h.onload=()=>{var m;if(u.width=h.width,u.height=h.height,p.drawImage(h,0,0),(m=n.elements)!=null&&m.length)for(const y of n.elements)p.strokeStyle=Da[y.type]??Da.unknown,p.lineWidth=Math.max(2,Math.round(h.width/400)),p.strokeRect(y.x,y.y,y.width,y.height),p.fillStyle=Da[y.type]??Da.unknown,p.font=`${Math.max(10,Math.round(h.width/120))}px monospace`,p.fillText(y.type,y.x+4,y.y+14)},h.src=`data:image/png;base64,${n.base64}`},[n]),f.useEffect(()=>{const u=at();return u.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}))}),()=>{u.off("agentUpdate")}},[]);const d=async()=>{if(!e){try{const u=await $("/api/system/vision-guidance");if(u.ok){const p=await u.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(Ts,{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(u=>!u),className:"text-gray-600 hover:text-gray-300 transition-colors",title:o?"Collapse":"Expand",children:o?r.jsx(mh,{size:13}):r.jsx(Ts,{size:13})}),r.jsxs("button",{onClick:d,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(Gi,{size:11}),e?"Scanning…":"Capture"]})]})]}),r.jsx(ee,{children:i&&r.jsxs(U.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(ee,{children:n&&r.jsxs(U.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(Gi,{size:14,className:"animate-spin"}),"Scanning screen…"]})]})}const a_=4,Km=1e4;function o_(){const[e,t]=f.useState([]),n=f.useId(),s=f.useCallback(i=>{t(a=>a.filter(o=>o.id!==i))},[]);return f.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,a_)),setTimeout(()=>s(o.id),Km)}),()=>{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(ee,{mode:"popLayout",children:e.map((i,a)=>r.jsx(U.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(cl,{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(st,{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(Yt,{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(U.div,{className:"h-full",style:{background:"rgba(249,115,22,0.45)"},initial:{width:"100%"},animate:{width:"0%"},transition:{duration:Km/1e3,ease:"linear"}})})]})},i.id))})})}const l_=6e3,c_=/https?:\/\/[^\s"'>)]+/,d_=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 u_(e){const t=e.match(c_);return t?t[0].replace(/[.,;)]+$/,""):null}function h_(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 p_(){const[e,t]=f.useState(null),[n,s]=f.useState(!1),[i,a]=f.useState(!1),[o,l]=f.useState(null),[c,d]=f.useState(null),[u,p]=f.useState(!1),h=f.useRef(null),m=f.useRef(!1),y=f.useCallback(()=>{h.current&&clearTimeout(h.current),h.current=setTimeout(()=>{s(!1),t(null),l(null),d(null),m.current=!1},l_)},[]);return f.useEffect(()=>{const b=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)),y();return}if(g.type==="shadowToggle"){!g.enabled&&typeof g.slot!="number"?(s(!1),t(null),l(null),d(null),m.current=!1,h.current&&clearTimeout(h.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(d_.has(j)||/navigate|click|type|browse|fetch|search/i.test(w)){const k=w.length>72?w.slice(0,71)+"…":w;d(k);const N=u_(w);N&&l(N)}return}if(g.type==="stepFinish"){d(null);return}if(g.type==="planFinish"){d(null),y();return}};return b.on("agentUpdate",v),()=>{b.off("agentUpdate",v),h.current&&clearTimeout(h.current)}},[y]),r.jsx(ee,{children:n&&r.jsx(U.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(Xe,{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(b=>!b),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(VS,{size:10}):r.jsx(HS,{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(st,{size:10})})]})]}),r.jsx(ee,{children:!i&&r.jsxs(U.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:[u&&!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(Xe,{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(Xe,{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:h_(o)})]}),r.jsx(ee,{children:c&&r.jsxs(U.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(b=>r.jsx("span",{className:"block w-1 h-1 rounded-full bg-orange-400/60 animate-bounce",style:{animationDelay:`${b*.15}s`}},b))}),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 hc={authenticated:!1,userEmail:null,userName:null,avatarUrl:null,expiresAt:null};function f_(e,t){return e?e.split(" ").map(n=>n[0]).join("").slice(0,2).toUpperCase():t?t[0].toUpperCase():"?"}function m_(){const[e,t]=f.useState(!1),[n,s]=f.useState(hc),[i,a]=f.useState(!1),o=f.useRef(null),l=f.useCallback(()=>{fetch("/api/auth/user-status").then(y=>y.json()).then(y=>s(y)).catch(()=>{})},[]);f.useEffect(()=>{l()},[l]),f.useEffect(()=>{const y=at(),b=v=>{v.authenticated?s(g=>({...g,authenticated:!0,userEmail:v.userEmail??g.userEmail,userName:v.userName??g.userName,avatarUrl:v.avatarUrl??g.avatarUrl})):s(hc)};return y.on("authStateChanged",b),()=>{y.off("authStateChanged",b)}},[]),f.useEffect(()=>{const y=b=>{b.data==="mustb:auth:done"&&l()};return window.addEventListener("message",y),()=>window.removeEventListener("message",y)},[l]),f.useEffect(()=>{if(!e)return;const y=b=>{o.current&&!o.current.contains(b.target)&&t(!1)};return document.addEventListener("mousedown",y),()=>document.removeEventListener("mousedown",y)},[e]),f.useEffect(()=>{if(!e)return;const y=b=>{b.key==="Escape"&&t(!1)};return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[e]);const c="https://must-b.com",d=y=>{window.open(`${c}/auth/connect?provider=${y}`,"mustb-auth","width=540,height=660,scrollbars=yes")},u=async()=>{a(!0);try{await fetch("/api/auth/signout",{method:"POST"}),s(hc),t(!1)}finally{a(!1)}},p=y=>{window.open(`${c}${y}`,"_blank","noopener,noreferrer")},h=f_(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(y=>!y),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:h}),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(y=>!y),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(IS,{size:14}),"Sign In"]}),r.jsx(ee,{children:e&&r.jsxs(U.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
|
|
729
|
+
[… file truncated at 1.5 MB …]`:""))}catch(g){d(g instanceof Error?g.message:"Failed to load file")}l(!1)},y=v=>{const g=ZC[v]??Yt;return r.jsx(g,{size:12,className:"shrink-0 text-gray-500"})},b=()=>{if(o)return r.jsxs("div",{className:"flex items-center justify-center h-full text-gray-600 text-xs gap-2",children:[r.jsx(le,{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(ln,{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"?n_(i):i.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">");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(os,{size:11,className:"text-orange-400"}),"Workspace"]}),r.jsx("button",{onClick:h,disabled:u,className:"text-gray-700 hover:text-gray-400 transition-colors",title:"Refresh",children:r.jsx(le,{size:11,className:u?"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:[y(v.ext),r.jsx("span",{className:"text-[11px] truncate flex-1",children:v.name}),r.jsx(on,{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(ee,{mode:"wait",children:n?r.jsxs(U.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:[e_(n.size)," · ",t_(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:b()})]})]})}const Da={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 r_(){const[e,t]=f.useState(!1),[n,s]=f.useState(null),[i,a]=f.useState(null),[o,l]=f.useState(!1),c=f.useRef(null);f.useEffect(()=>{if(!n||!c.current)return;const u=c.current,p=u.getContext("2d");if(!p)return;const h=new Image;h.onload=()=>{var m;if(u.width=h.width,u.height=h.height,p.drawImage(h,0,0),(m=n.elements)!=null&&m.length)for(const y of n.elements)p.strokeStyle=Da[y.type]??Da.unknown,p.lineWidth=Math.max(2,Math.round(h.width/400)),p.strokeRect(y.x,y.y,y.width,y.height),p.fillStyle=Da[y.type]??Da.unknown,p.font=`${Math.max(10,Math.round(h.width/120))}px monospace`,p.fillText(y.type,y.x+4,y.y+14)},h.src=`data:image/png;base64,${n.base64}`},[n]),f.useEffect(()=>{const u=at();return u.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}))}),()=>{u.off("agentUpdate")}},[]);const d=async()=>{if(!e){try{const u=await $("/api/system/vision-guidance");if(u.ok){const p=await u.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(Ts,{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(u=>!u),className:"text-gray-600 hover:text-gray-300 transition-colors",title:o?"Collapse":"Expand",children:o?r.jsx(mh,{size:13}):r.jsx(Ts,{size:13})}),r.jsxs("button",{onClick:d,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(Gi,{size:11}),e?"Scanning…":"Capture"]})]})]}),r.jsx(ee,{children:i&&r.jsxs(U.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(ee,{children:n&&r.jsxs(U.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(Gi,{size:14,className:"animate-spin"}),"Scanning screen…"]})]})}const i_=4,Km=1e4;function a_(){const[e,t]=f.useState([]),n=f.useId(),s=f.useCallback(i=>{t(a=>a.filter(o=>o.id!==i))},[]);return f.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,i_)),setTimeout(()=>s(o.id),Km)}),()=>{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(ee,{mode:"popLayout",children:e.map((i,a)=>r.jsx(U.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(cl,{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(st,{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(Yt,{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(U.div,{className:"h-full",style:{background:"rgba(249,115,22,0.45)"},initial:{width:"100%"},animate:{width:"0%"},transition:{duration:Km/1e3,ease:"linear"}})})]})},i.id))})})}const o_=6e3,l_=/https?:\/\/[^\s"'>)]+/,c_=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 d_(e){const t=e.match(l_);return t?t[0].replace(/[.,;)]+$/,""):null}function u_(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 h_(){const[e,t]=f.useState(null),[n,s]=f.useState(!1),[i,a]=f.useState(!1),[o,l]=f.useState(null),[c,d]=f.useState(null),[u,p]=f.useState(!1),h=f.useRef(null),m=f.useRef(!1),y=f.useCallback(()=>{h.current&&clearTimeout(h.current),h.current=setTimeout(()=>{s(!1),t(null),l(null),d(null),m.current=!1},o_)},[]);return f.useEffect(()=>{const b=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)),y();return}if(g.type==="shadowToggle"){!g.enabled&&typeof g.slot!="number"?(s(!1),t(null),l(null),d(null),m.current=!1,h.current&&clearTimeout(h.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(c_.has(j)||/navigate|click|type|browse|fetch|search/i.test(w)){const k=w.length>72?w.slice(0,71)+"…":w;d(k);const N=d_(w);N&&l(N)}return}if(g.type==="stepFinish"){d(null);return}if(g.type==="planFinish"){d(null),y();return}};return b.on("agentUpdate",v),()=>{b.off("agentUpdate",v),h.current&&clearTimeout(h.current)}},[y]),r.jsx(ee,{children:n&&r.jsx(U.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(Xe,{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(b=>!b),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(FS,{size:10}):r.jsx(US,{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(st,{size:10})})]})]}),r.jsx(ee,{children:!i&&r.jsxs(U.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:[u&&!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(Xe,{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(Xe,{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:u_(o)})]}),r.jsx(ee,{children:c&&r.jsxs(U.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(b=>r.jsx("span",{className:"block w-1 h-1 rounded-full bg-orange-400/60 animate-bounce",style:{animationDelay:`${b*.15}s`}},b))}),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 hc={authenticated:!1,userEmail:null,userName:null,avatarUrl:null,expiresAt:null};function p_(e,t){return e?e.split(" ").map(n=>n[0]).join("").slice(0,2).toUpperCase():t?t[0].toUpperCase():"?"}function f_(){const[e,t]=f.useState(!1),[n,s]=f.useState(hc),[i,a]=f.useState(!1),o=f.useRef(null),l=f.useCallback(()=>{fetch("/api/auth/user-status").then(y=>y.json()).then(y=>s(y)).catch(()=>{})},[]);f.useEffect(()=>{l()},[l]),f.useEffect(()=>{const y=at(),b=v=>{v.authenticated?s(g=>({...g,authenticated:!0,userEmail:v.userEmail??g.userEmail,userName:v.userName??g.userName,avatarUrl:v.avatarUrl??g.avatarUrl})):s(hc)};return y.on("authStateChanged",b),()=>{y.off("authStateChanged",b)}},[]),f.useEffect(()=>{const y=b=>{b.data==="mustb:auth:done"&&l()};return window.addEventListener("message",y),()=>window.removeEventListener("message",y)},[l]),f.useEffect(()=>{if(!e)return;const y=b=>{o.current&&!o.current.contains(b.target)&&t(!1)};return document.addEventListener("mousedown",y),()=>document.removeEventListener("mousedown",y)},[e]),f.useEffect(()=>{if(!e)return;const y=b=>{b.key==="Escape"&&t(!1)};return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[e]);const c="https://must-b.com",d=y=>{window.open(`${c}/auth/connect?provider=${y}`,"mustb-auth","width=540,height=660,scrollbars=yes")},u=async()=>{a(!0);try{await fetch("/api/auth/signout",{method:"POST"}),s(hc),t(!1)}finally{a(!1)}},p=y=>{window.open(`${c}${y}`,"_blank","noopener,noreferrer")},h=p_(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(y=>!y),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:h}),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(y=>!y),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(OS,{size:14}),"Sign In"]}),r.jsx(ee,{children:e&&r.jsxs(U.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
|
|
730
730
|
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
|
|
731
|
-
hover:bg-white/8 text-white/30 hover:text-white/60 transition-colors`,children:r.jsx(st,{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:()=>d("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(
|
|
731
|
+
hover:bg-white/8 text-white/30 hover:text-white/60 transition-colors`,children:r.jsx(st,{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:()=>d("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(AS,{size:15}),"Continue with GitHub"]}),r.jsxs("button",{onClick:()=>d("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:()=>d("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(Yy,{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(IS,{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:h})}),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(c1,{size:13}),label:"Profile Settings",sub:"Web",action:()=>p("/profile/settings")},{icon:r.jsx(n1,{size:13}),label:"Change Password",sub:"Web",action:()=>p("/profile/security")}].map(y=>r.jsxs("button",{onClick:()=>{y.action(),t(!1)},className:`w-full flex items-center gap-2.5 px-3 py-2 rounded-xl
|
|
732
732
|
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
|
|
733
733
|
bg-white/5 text-white/40 group-hover:text-orange-400
|
|
734
734
|
group-hover:bg-orange-500/10 transition-all shrink-0`,children:y.icon}),r.jsx("span",{className:"text-[12px] font-semibold text-white/70 group-hover:text-white/90 transition-colors flex-1",children:y.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}),y.sub]})]},y.label)),r.jsx("div",{className:"h-px bg-white/6 mx-2 my-1"}),r.jsxs("button",{onClick:u,disabled:i,className:`w-full flex items-center gap-2.5 px-3 py-2 rounded-xl
|
|
735
735
|
hover:bg-red-500/10 transition-colors group text-left
|
|
736
736
|
disabled:opacity-50 disabled:cursor-not-allowed`,children:[r.jsx("span",{className:`w-6 h-6 flex items-center justify-center rounded-lg
|
|
737
737
|
bg-white/5 text-white/30 group-hover:text-red-400
|
|
738
|
-
group-hover:bg-red-500/10 transition-all shrink-0`,children:r.jsx(xh,{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 g_=4,x_=3e3;function y_(){return r.jsxs(U.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:g_}).map((e,t)=>r.jsx(U.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(U.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(Nr,{size:26,className:"text-orange-400"})}),r.jsx(U.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 v_(){const[e,t]=f.useState(!1),n=f.useRef(null),s=f.useCallback(()=>{t(!0),n.current&&clearTimeout(n.current),n.current=setTimeout(()=>t(!1),x_)},[]);return f.useEffect(()=>(window.addEventListener("mustb:wake",s),()=>{window.removeEventListener("mustb:wake",s),n.current&&clearTimeout(n.current)}),[s]),r.jsx(ee,{children:e&&r.jsx(y_,{},"wake-aura")})}const b_={browser_navigate:"navigate",web_search:"search",http_request:"request"},w_=20,k_=5e3;function j_(e){try{return new URL(e).hostname.replace(/^www\./,"")}catch{return e.slice(0,30)}}function N_(e){try{return new URL(e).pathname.slice(0,40)||"/"}catch{return""}}function S_(e){return e==="search"?r.jsx(qt,{size:10}):e==="request"?r.jsx(zr,{size:10}):r.jsx(Xe,{size:10})}function T1(e){return e==="search"?"#a78bfa":e==="request"?"#94a3b8":"#38bdf8"}function C_({domain:e,kind:t}){var i;const n=((i=e[0])==null?void 0:i.toUpperCase())??"?",s=T1(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 __({entry:e,isLatest:t}){var a;const n=T1(e.kind),s=e.domain??"",i=e.query??(e.url?N_(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(C_,{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:S_(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 E_(){const[e,t]=f.useState([]),[n,s]=f.useState(!1),[i,a]=f.useState(!1),[o,l]=f.useState(!1),c=f.useRef(null),d=f.useCallback(()=>{c.current&&clearTimeout(c.current),c.current=setTimeout(()=>{s(!1),t([]),l(!1)},k_)},[]);return f.useEffect(()=>{const u=at(),p=h=>{const{type:m}=h;if(m==="planStart"){c.current&&clearTimeout(c.current),l(!0);return}if(m==="planFinish"){l(!1),t(y=>y.map(b=>({...b,done:!0}))),d();return}if(m==="stepStart"&&h.step){const y=h.step,b=y.tool?b_[y.tool]:void 0;if(!b)return;const v=y.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:b,url:g||void 0,query:x||void 0,domain:g?j_(g):void 0,ts:Date.now(),done:!1};t(j=>[w,...j].slice(0,w_)),s(!0),a(!1)}};return u.on("agentUpdate",p),()=>{u.off("agentUpdate",p),c.current&&clearTimeout(c.current)}},[d]),!n||e.length===0?null:r.jsx(U.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(u=>!u),children:[r.jsx(FS,{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(U.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:u=>{u.stopPropagation(),s(!1),t([])},className:"text-white/20 hover:text-white/50 transition-colors flex-shrink-0 ml-1",children:r.jsx(st,{size:10})}),r.jsx("span",{className:"text-white/20 flex-shrink-0",children:i?r.jsx(fh,{size:10}):r.jsx(na,{size:10})})]}),r.jsx(ee,{children:!i&&r.jsxs(U.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(ee,{mode:"popLayout",children:e.map((u,p)=>r.jsx(U.div,{layout:!0,initial:{opacity:0,x:16},animate:{opacity:1,x:0},exit:{opacity:0,x:-8},transition:{duration:.15},children:r.jsx(__,{entry:u,isLatest:p===0&&o})},u.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(u=>u.kind==="navigate").length," gezinti ·"," ",e.filter(u=>u.kind==="search").length," arama ·"," ",e.filter(u=>u.kind==="request").length," istek"]})})]})})]})})}function T_(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 P_=["Today","Yesterday","Last 7 Days","Older"],A_="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",M_="bg-orange-500/15 text-orange-300 border border-orange-500/25",z_="text-white/80 hover:text-white/95 hover:bg-white/6";function R_(e){return Ke(A_,e?M_:z_)}function L_(e){return e?"text-orange-400 shrink-0":"text-white/70 shrink-0"}function D_({onClose:e}){const{t}=pt(),n=is(),s=un(),i=n.pathname,[a,o]=f.useState([]),[l,c]=f.useState(null),[d,u]=f.useState(""),[p,h]=f.useState(null),[m,y]=f.useState(null),[b,v]=f.useState(""),[g,x]=f.useState(""),[w,j]=f.useState(!1),k=f.useCallback(async()=>{try{const T=await $("/api/chats");if(!T.ok)return;const V=await T.json();o(V);const M=new Set([...V.map(I=>I.id),"default"]);for(let I=localStorage.length-1;I>=0;I--){const z=localStorage.key(I);z!=null&&z.startsWith("mustb_chat_turns_")&&!M.has(z.slice(17))&&localStorage.removeItem(z)}}catch{}},[]);f.useEffect(()=>{k();const T=setInterval(k,1e4);return()=>clearInterval(T)},[k]),f.useEffect(()=>{const T=V=>{const{id:M,title:I}=V.detail;o(z=>z.map(R=>R.id===M?{...R,title:I}:R))};return window.addEventListener("mustb:chat-renamed",T),()=>window.removeEventListener("mustb:chat-renamed",T)},[]),f.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){pe.error("Failed to create chat.");return}const V=await T.json();o(M=>[V,...M]),s(`/app?chat=${V.id}`),e()}catch{pe.error("Gateway unreachable.")}},S=async()=>{if(p){try{await $(`/api/chats/${p}`,{method:"DELETE"}),o(T=>T.filter(V=>V.id!==p)),pe.success("Chat deleted."),i.includes(p)&&s("/app")}catch{pe.error("Failed to delete chat.")}h(null)}},_=async T=>{y(null);try{await $(`/api/chats/${T}`,{method:"PATCH",body:JSON.stringify({archived:!0})}),o(V=>V.filter(M=>M.id!==T)),pe.success("Chat archived.")}catch{pe.error("Failed to archive chat.")}},A=async()=>{if(!l||!d.trim()){c(null);return}try{await $(`/api/chats/${l}`,{method:"PATCH",body:JSON.stringify({title:d})}),o(T=>T.map(V=>V.id===l?{...V,title:d}:V)),pe.success("Chat renamed.")}catch{pe.error("Failed to rename chat.")}c(null)},P=[{to:"/app/browser",icon:r.jsx(Xe,{size:14}),label:t.nav.browser},{to:"/app/automations",icon:r.jsx(i4,{size:14}),label:t.nav.workflows},{to:"/app/skills",icon:r.jsx(Re,{size:14}),label:t.nav.skills},{to:"/app/plugins",icon:r.jsx(Sr,{size:14}),label:t.nav.plugins},{to:"/app/files",icon:r.jsx(os,{size:14}),label:t.nav.files},{to:"/app/memory",icon:r.jsx(il,{size:14}),label:t.nav.memory,exact:!0},{to:"/app/settings",icon:r.jsx(bh,{size:14}),label:t.nav.settings,exact:!0},{to:"/app/settings?tab=api-keys",icon:r.jsx(s1,{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(hi,{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(ll,{size:14}),t.sidebar.newChat]})}),r.jsxs("div",{className:"flex-1 overflow-y-auto scrollbar-hide px-2 pb-4",onClick:()=>m&&y(null),children:[(()=>{const T={Today:[],Yesterday:[],"Last 7 Days":[],Older:[]};for(const V of a)T[T_(V)].push(V);return P_.map(V=>{const M=T[V];return M.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:M.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:d,onChange:z=>u(z.target.value),className:"flex-1 bg-transparent text-[13px] text-white/80 outline-none min-w-0",autoFocus:!0,onKeyDown:z=>{z.key==="Enter"&&A(),z.key==="Escape"&&c(null)}}),r.jsx("button",{onClick:A,className:"p-1 text-green-400 hover:bg-green-400/10 rounded transition-colors",children:r.jsx(Mt,{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(st,{size:12})})]}):r.jsxs(r.Fragment,{children:[r.jsxs(hi,{to:`/app?chat=${I.id}`,onClick:e,className:Ke("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(sa,{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:z=>{z.preventDefault(),z.stopPropagation(),y(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(_S,{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:z=>z.stopPropagation(),children:[r.jsxs("button",{onClick:()=>{y(null),c(I.id),u(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(KS,{size:12,className:"text-white/35 shrink-0"})," Rename"]}),r.jsxs("button",{onClick:()=>_(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(vS,{size:12,className:"text-white/35 shrink-0"})," Archive"]}),r.jsx("hr",{className:"my-1 border-white/8"}),r.jsxs("button",{onClick:z=>{z.preventDefault(),z.stopPropagation(),y(null),h(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(Ls,{size:12,className:"shrink-0"})," Delete"]})]})]})},I.id))})]},V)})})(),r.jsx("hr",{className:"my-3 border-white/10"}),P.map(({to:T,icon:V,label:M,exact:I})=>{const z=T.split("?")[0],R=I?i===z:i.startsWith(z);return r.jsxs(hi,{to:T,onClick:e,className:R_(R),children:[r.jsx("span",{className:L_(R),children:V}),M]},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}),b&&r.jsx("p",{className:"text-white/30 text-[10px] capitalize",children:b})]}),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(xh,{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:()=>h(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 he(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 O_({panel:e,title:t,onClose:n}){return f.useEffect(()=>{const s=i=>{i.key==="Escape"&&n()};return document.addEventListener("keydown",s),()=>document.removeEventListener("keydown",s)},[n]),r.jsxs(ee,{children:[r.jsx(U.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(U.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
|
|
738
|
+
group-hover:bg-red-500/10 transition-all shrink-0`,children:r.jsx(xh,{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 m_=4,g_=3e3;function x_(){return r.jsxs(U.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:m_}).map((e,t)=>r.jsx(U.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(U.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(Nr,{size:26,className:"text-orange-400"})}),r.jsx(U.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 y_(){const[e,t]=f.useState(!1),n=f.useRef(null),s=f.useCallback(()=>{t(!0),n.current&&clearTimeout(n.current),n.current=setTimeout(()=>t(!1),g_)},[]);return f.useEffect(()=>(window.addEventListener("mustb:wake",s),()=>{window.removeEventListener("mustb:wake",s),n.current&&clearTimeout(n.current)}),[s]),r.jsx(ee,{children:e&&r.jsx(x_,{},"wake-aura")})}const v_={browser_navigate:"navigate",web_search:"search",http_request:"request"},b_=20,w_=5e3;function k_(e){try{return new URL(e).hostname.replace(/^www\./,"")}catch{return e.slice(0,30)}}function j_(e){try{return new URL(e).pathname.slice(0,40)||"/"}catch{return""}}function N_(e){return e==="search"?r.jsx(qt,{size:10}):e==="request"?r.jsx(zr,{size:10}):r.jsx(Xe,{size:10})}function E1(e){return e==="search"?"#a78bfa":e==="request"?"#94a3b8":"#38bdf8"}function S_({domain:e,kind:t}){var i;const n=((i=e[0])==null?void 0:i.toUpperCase())??"?",s=E1(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 C_({entry:e,isLatest:t}){var a;const n=E1(e.kind),s=e.domain??"",i=e.query??(e.url?j_(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(S_,{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:N_(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 __(){const[e,t]=f.useState([]),[n,s]=f.useState(!1),[i,a]=f.useState(!1),[o,l]=f.useState(!1),c=f.useRef(null),d=f.useCallback(()=>{c.current&&clearTimeout(c.current),c.current=setTimeout(()=>{s(!1),t([]),l(!1)},w_)},[]);return f.useEffect(()=>{const u=at(),p=h=>{const{type:m}=h;if(m==="planStart"){c.current&&clearTimeout(c.current),l(!0);return}if(m==="planFinish"){l(!1),t(y=>y.map(b=>({...b,done:!0}))),d();return}if(m==="stepStart"&&h.step){const y=h.step,b=y.tool?v_[y.tool]:void 0;if(!b)return;const v=y.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:b,url:g||void 0,query:x||void 0,domain:g?k_(g):void 0,ts:Date.now(),done:!1};t(j=>[w,...j].slice(0,b_)),s(!0),a(!1)}};return u.on("agentUpdate",p),()=>{u.off("agentUpdate",p),c.current&&clearTimeout(c.current)}},[d]),!n||e.length===0?null:r.jsx(U.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(u=>!u),children:[r.jsx(BS,{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(U.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:u=>{u.stopPropagation(),s(!1),t([])},className:"text-white/20 hover:text-white/50 transition-colors flex-shrink-0 ml-1",children:r.jsx(st,{size:10})}),r.jsx("span",{className:"text-white/20 flex-shrink-0",children:i?r.jsx(fh,{size:10}):r.jsx(na,{size:10})})]}),r.jsx(ee,{children:!i&&r.jsxs(U.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(ee,{mode:"popLayout",children:e.map((u,p)=>r.jsx(U.div,{layout:!0,initial:{opacity:0,x:16},animate:{opacity:1,x:0},exit:{opacity:0,x:-8},transition:{duration:.15},children:r.jsx(C_,{entry:u,isLatest:p===0&&o})},u.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(u=>u.kind==="navigate").length," gezinti ·"," ",e.filter(u=>u.kind==="search").length," arama ·"," ",e.filter(u=>u.kind==="request").length," istek"]})})]})})]})})}function E_(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 T_=["Today","Yesterday","Last 7 Days","Older"],P_="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",A_="bg-orange-500/15 text-orange-300 border border-orange-500/25",M_="text-white/80 hover:text-white/95 hover:bg-white/6";function z_(e){return Ke(P_,e?A_:M_)}function R_(e){return e?"text-orange-400 shrink-0":"text-white/70 shrink-0"}function L_({onClose:e}){const{t}=pt(),n=is(),s=un(),i=n.pathname,[a,o]=f.useState([]),[l,c]=f.useState(null),[d,u]=f.useState(""),[p,h]=f.useState(null),[m,y]=f.useState(null),[b,v]=f.useState(""),[g,x]=f.useState(""),[w,j]=f.useState(!1),k=f.useCallback(async()=>{try{const T=await $("/api/chats");if(!T.ok)return;const V=await T.json();o(V);const M=new Set([...V.map(I=>I.id),"default"]);for(let I=localStorage.length-1;I>=0;I--){const z=localStorage.key(I);z!=null&&z.startsWith("mustb_chat_turns_")&&!M.has(z.slice(17))&&localStorage.removeItem(z)}}catch{}},[]);f.useEffect(()=>{k();const T=setInterval(k,1e4);return()=>clearInterval(T)},[k]),f.useEffect(()=>{const T=V=>{const{id:M,title:I}=V.detail;o(z=>z.map(R=>R.id===M?{...R,title:I}:R))};return window.addEventListener("mustb:chat-renamed",T),()=>window.removeEventListener("mustb:chat-renamed",T)},[]),f.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){pe.error("Failed to create chat.");return}const V=await T.json();o(M=>[V,...M]),s(`/app?chat=${V.id}`),e()}catch{pe.error("Gateway unreachable.")}},S=async()=>{if(p){try{await $(`/api/chats/${p}`,{method:"DELETE"}),o(T=>T.filter(V=>V.id!==p)),pe.success("Chat deleted."),i.includes(p)&&s("/app")}catch{pe.error("Failed to delete chat.")}h(null)}},_=async T=>{y(null);try{await $(`/api/chats/${T}`,{method:"PATCH",body:JSON.stringify({archived:!0})}),o(V=>V.filter(M=>M.id!==T)),pe.success("Chat archived.")}catch{pe.error("Failed to archive chat.")}},A=async()=>{if(!l||!d.trim()){c(null);return}try{await $(`/api/chats/${l}`,{method:"PATCH",body:JSON.stringify({title:d})}),o(T=>T.map(V=>V.id===l?{...V,title:d}:V)),pe.success("Chat renamed.")}catch{pe.error("Failed to rename chat.")}c(null)},P=[{to:"/app/browser",icon:r.jsx(Xe,{size:14}),label:t.nav.browser},{to:"/app/automations",icon:r.jsx(r4,{size:14}),label:t.nav.workflows},{to:"/app/skills",icon:r.jsx(Re,{size:14}),label:t.nav.skills},{to:"/app/plugins",icon:r.jsx(Sr,{size:14}),label:t.nav.plugins},{to:"/app/files",icon:r.jsx(os,{size:14}),label:t.nav.files},{to:"/app/memory",icon:r.jsx(il,{size:14}),label:t.nav.memory,exact:!0},{to:"/app/settings",icon:r.jsx(bh,{size:14}),label:t.nav.settings,exact:!0},{to:"/app/settings?tab=api-keys",icon:r.jsx(n1,{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(hi,{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(ll,{size:14}),t.sidebar.newChat]})}),r.jsxs("div",{className:"flex-1 overflow-y-auto scrollbar-hide px-2 pb-4",onClick:()=>m&&y(null),children:[(()=>{const T={Today:[],Yesterday:[],"Last 7 Days":[],Older:[]};for(const V of a)T[E_(V)].push(V);return T_.map(V=>{const M=T[V];return M.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:M.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:d,onChange:z=>u(z.target.value),className:"flex-1 bg-transparent text-[13px] text-white/80 outline-none min-w-0",autoFocus:!0,onKeyDown:z=>{z.key==="Enter"&&A(),z.key==="Escape"&&c(null)}}),r.jsx("button",{onClick:A,className:"p-1 text-green-400 hover:bg-green-400/10 rounded transition-colors",children:r.jsx(Mt,{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(st,{size:12})})]}):r.jsxs(r.Fragment,{children:[r.jsxs(hi,{to:`/app?chat=${I.id}`,onClick:e,className:Ke("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(sa,{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:z=>{z.preventDefault(),z.stopPropagation(),y(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(CS,{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:z=>z.stopPropagation(),children:[r.jsxs("button",{onClick:()=>{y(null),c(I.id),u(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(GS,{size:12,className:"text-white/35 shrink-0"})," Rename"]}),r.jsxs("button",{onClick:()=>_(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(yS,{size:12,className:"text-white/35 shrink-0"})," Archive"]}),r.jsx("hr",{className:"my-1 border-white/8"}),r.jsxs("button",{onClick:z=>{z.preventDefault(),z.stopPropagation(),y(null),h(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(Ls,{size:12,className:"shrink-0"})," Delete"]})]})]})},I.id))})]},V)})})(),r.jsx("hr",{className:"my-3 border-white/10"}),P.map(({to:T,icon:V,label:M,exact:I})=>{const z=T.split("?")[0],R=I?i===z:i.startsWith(z);return r.jsxs(hi,{to:T,onClick:e,className:z_(R),children:[r.jsx("span",{className:R_(R),children:V}),M]},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}),b&&r.jsx("p",{className:"text-white/30 text-[10px] capitalize",children:b})]}),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(xh,{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:()=>h(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 he(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 D_({panel:e,title:t,onClose:n}){return f.useEffect(()=>{const s=i=>{i.key==="Escape"&&n()};return document.addEventListener("keydown",s),()=>document.removeEventListener("keydown",s)},[n]),r.jsxs(ee,{children:[r.jsx(U.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(U.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
|
|
739
739
|
w-full max-w-2xl max-h-[calc(100vh-92px)]
|
|
740
740
|
glass-panel rounded-3xl overflow-hidden flex flex-col
|
|
741
|
-
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(st,{size:14})})]}),r.jsxs("div",{className:"flex-1 overflow-hidden min-h-0",children:[e==="memory"&&r.jsx(GC,{}),e==="plugins"&&r.jsx(YC,{}),e==="skills"&&r.jsx(ZC,{}),e==="workspace"&&r.jsx(r_,{}),e==="livesight"&&r.jsx(i_,{})]})]},"stage-card")]})}function I_(){const{t:e}=pt(),t=is(),n=un(),[s,i]=f.useState(!1),[a,o]=f.useState(""),[l,c]=f.useState(null),[d,u]=f.useState(!1);f.useEffect(()=>{const y=b=>{u(b.detail.active)};return window.addEventListener("mustb:safeMode",y),()=>window.removeEventListener("mustb:safeMode",y)},[]),f.useEffect(()=>{i(!1)},[t.pathname]),t.pathname,f.useCallback(y=>o(b=>b===y?"":y),[]),f.useCallback(y=>{c(y),o("")},[]);const p=f.useCallback(()=>c(null),[]),h=e.dock;h.cat_webTools,h.skill_webSearch,h.desc_webSearch,h.skill_webFetch,h.desc_webFetch,h.skill_browserControl,h.desc_browserControl,h.cat_fileMedia,h.skill_pdfReader,h.desc_pdfReader,h.skill_imageAnalysis,h.desc_imageAnalysis,h.skill_imageGeneration,h.desc_imageGeneration,h.skill_tts,h.desc_tts,h.cat_aiAgents,h.skills,h.skill_spawnAgent,h.desc_spawnAgent,h.skill_agentSessions,h.desc_agentSessions,h.skill_canvas,h.desc_canvas,h.skill_git,h.desc_git,h.cat_systemTools,h.skill_gateway,h.desc_gateway,h.skill_fileManager,h.desc_fileManager,h.skill_cron,h.desc_cron,h.skill_messages,h.desc_messages,h.cat_knowledgeBase,h.mem_browse,h.desc_memBrowse,h.mem_search,h.desc_memSearch,h.mem_add,h.desc_memAdd,h.cat_personalOrg,h.mem_contacts,h.desc_contacts,h.mem_calendar,h.desc_calendar,h.cat_pluginManager,h.plug_marketplace,h.desc_marketplace,h.plug_installed,h.desc_installed,h.plug_mcp,h.desc_mcp,h.cat_developer,h.plug_bundleMcp,h.desc_bundleMcp,h.plug_cliCmds,h.desc_cliCmds,h.cat_automation,h.wf_automations,h.desc_automations,h.wf_scheduled,h.desc_scheduled,h.wf_commands,h.desc_commands,h.cat_advanced,h.wf_nodes,h.desc_nodes,h.wf_multiAgent,h.desc_multiAgent;const m={memory:h.memory,plugins:h.plugins,skills:h.skills,workspace:h.files,livesight:"Visual Audit"};return r.jsx(Z2,{reducedMotion:d?"always":"never",children:r.jsxs("div",{className:"relative min-h-screen overflow-x-hidden font-sans bg-transparent",children:[l&&r.jsx(O_,{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(y=>!y),"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($S,{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(hi,{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(jS,{size:14}),r.jsx("span",{className:"hidden sm:inline",children:e.nav.voice})]}),r.jsx(U.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(HC,{})}),r.jsx(m_,{})]})]}),r.jsx(ee,{children:s&&r.jsx(U.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(D_,{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(t2,{})}),r.jsx(o_,{}),r.jsx(p_,{}),r.jsx(v_,{}),r.jsx(E_,{})]})})}const B_=[{decision:"duplicate",label:"Create New Agent",sublabel:"Keep both — cloud data is copied to a separate folder",icon:AS,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:SS,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:ZS,accent:"border-green-500/30 bg-green-500/8 hover:border-green-500/50 text-green-400"}];function F_(){const[e,t]=f.useState(null),[n,s]=f.useState(!1),[i,a]=f.useState(!1);f.useEffect(()=>{const c=at(),d=u=>{u.type==="CONFLICT_DETECTED"&&(t({localAgentName:u.localAgentName??null,cloudAgentName:u.cloudAgentName??null,localMtime:u.localMtime??null,cloudTimestamp:u.cloudTimestamp??null}),a(!1)),u.type==="syncResolveFinish"&&(a(!0),setTimeout(()=>{t(null),a(!1)},1800))};return c.on("agentUpdate",d),()=>{c.off("agentUpdate",d)}},[]);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(ee,{children:e&&r.jsx(U.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(U.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(es,{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"]}):B_.map(c=>{const d=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(d,{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 qm="1.71.18";function V_(){const[e,t]=f.useState("idle"),[n,s]=f.useState(null),[i,a]=f.useState(""),[o,l]=f.useState(""),c=f.useCallback(async()=>{var h,m;t("checking"),a("");try{const y=await $("/api/system/version"),b=(y==null?void 0:y.current)||((h=y==null?void 0:y.data)==null?void 0:h.current)||qm,v=(y==null?void 0:y.latest)||((m=y==null?void 0:y.data)==null?void 0:m.latest)||b;s({current:b,latest:v}),$_(v,b)>0?t("update-available"):(t("up-to-date"),setTimeout(()=>t("idle"),3e3))}catch(y){a((y==null?void 0:y.message)??"Failed to check"),t("error")}},[]);f.useEffect(()=>{const m=setInterval(()=>{t(y=>((y==="idle"||y==="up-to-date")&&c(),y))},288e5);return()=>clearInterval(m)},[c]);const d=f.useCallback(async()=>{t("downloading"),l("");try{const h=await fetch("/api/system/update",{method:"POST",credentials:"include"});if(!h.body)throw new Error("No response body");const m=h.body.getReader(),y=new TextDecoder;for(;;){const{done:b,value:v}=await m.read();if(b)break;l(g=>g+y.decode(v))}t("done")}catch(h){a((h==null?void 0:h.message)??"Update failed"),t("error")}},[]),u=f.useCallback(async()=>{t("restarting");try{await $("/api/system/restart",{method:"POST"})}catch{}const h=at();let m=0;const y=setInterval(()=>{m++,h.connected&&(clearInterval(y),window.location.reload()),m>60&&clearInterval(y)},500)},[]),p=(n==null?void 0:n.current)??qm;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:[r.jsxs("button",{onClick:e==="idle"||e==="up-to-date"||e==="error"?c:void 0,disabled:["checking","downloading","restarting"].includes(e),title:"Check for updates",className:Ke("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":"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(xi,{size:13,className:"text-red-300 shrink-0"}),e==="up-to-date"&&r.jsx(nc,{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(nc,{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(ln,{size:13,className:"text-red-400 shrink-0"}),e==="idle"&&r.jsx(le,{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:p})]}),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.jsx("span",{className:"text-red-400/80 max-w-[120px] truncate",children: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(xi,{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(xi,{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"&&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(nc,{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:u,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(le,{size:13}),r.jsx("span",{children:"Restart Now"})]})]})]}),e==="restarting"&&r.jsxs("div",{className:"fixed inset-0 z-[9999] flex flex-col items-center justify-center bg-black/80 backdrop-blur-sm",children:[r.jsx(ne,{size:44,className:"animate-spin text-orange-400 mb-5"}),r.jsx("p",{className:"text-white text-lg font-semibold",children:r.jsx("span",{children:"Restarting Must-b…"})}),r.jsx("p",{className:"text-gray-400 text-sm mt-2",children:r.jsx("span",{children:"The dashboard will reload automatically."})})]})]})}function $_(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 U_ extends f.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 pc="mustb_setup_complete";function H_({children:e}){const t=un(),[n,s]=f.useState(()=>localStorage.getItem(pc)==="1");return f.useEffect(()=>{if(localStorage.getItem(pc)==="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(pc,"1"),s(!0)):t("/setup",{replace:!0}))}).catch(()=>{i||s(!0)}),()=>{i=!0}},[t]),n?r.jsx(r.Fragment,{children:e}):null}function W_(){return r.jsx(U_,{children:r.jsx(p4,{children:r.jsxs(u2,{children:[r.jsx($2,{position:"top-right",theme:"dark",closeButton:!0,richColors:!0}),r.jsx(F_,{}),r.jsx(V_,{}),r.jsxs(s2,{children:[r.jsx(we,{path:"/",element:r.jsx(bm,{})}),r.jsx(we,{path:"/welcome",element:r.jsx(bm,{})}),r.jsx(we,{path:"/setup",element:r.jsx(v4,{})}),r.jsxs(we,{path:"/app",element:r.jsx(H_,{children:r.jsx(I_,{})}),children:[r.jsx(we,{index:!0,element:r.jsx(Dm,{})}),r.jsx(we,{path:"chat",element:r.jsx(Dm,{})}),r.jsx(we,{path:"settings",element:r.jsx(nC,{})}),r.jsx(we,{path:"active",element:r.jsx(rC,{})}),r.jsx(we,{path:"automations",element:r.jsx(oC,{})}),r.jsx(we,{path:"clients",element:r.jsx(dC,{})}),r.jsx(we,{path:"logs",element:r.jsx(fC,{})}),r.jsx(we,{path:"products",element:r.jsx(xC,{})}),r.jsx(we,{path:"memory",element:r.jsx(NC,{})}),r.jsx(we,{path:"memory/persona",element:r.jsx(_C,{})}),r.jsx(we,{path:"skills",element:r.jsx(TC,{})}),r.jsx(we,{path:"plugins",element:r.jsx(zC,{})}),r.jsx(we,{path:"files",element:r.jsx(DC,{})}),r.jsx(we,{path:"browser",element:r.jsx(FC,{})}),r.jsx(we,{path:"voice",element:r.jsx(UC,{})}),r.jsx(we,{path:"*",element:r.jsx(Kp,{to:"/app",replace:!0})})]}),r.jsx(we,{path:"/mobile",element:r.jsx(LC,{})}),r.jsx(we,{path:"*",element:r.jsx(Kp,{to:"/",replace:!0})})]})]})})})}cx(document.getElementById("root")).render(r.jsx(f.StrictMode,{children:r.jsx(W_,{})}));
|
|
741
|
+
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(st,{size:14})})]}),r.jsxs("div",{className:"flex-1 overflow-hidden min-h-0",children:[e==="memory"&&r.jsx(WC,{}),e==="plugins"&&r.jsx(qC,{}),e==="skills"&&r.jsx(JC,{}),e==="workspace"&&r.jsx(s_,{}),e==="livesight"&&r.jsx(r_,{})]})]},"stage-card")]})}function O_(){const{t:e}=pt(),t=is(),n=un(),[s,i]=f.useState(!1),[a,o]=f.useState(""),[l,c]=f.useState(null),[d,u]=f.useState(!1);f.useEffect(()=>{const y=b=>{u(b.detail.active)};return window.addEventListener("mustb:safeMode",y),()=>window.removeEventListener("mustb:safeMode",y)},[]),f.useEffect(()=>{i(!1)},[t.pathname]),t.pathname,f.useCallback(y=>o(b=>b===y?"":y),[]),f.useCallback(y=>{c(y),o("")},[]);const p=f.useCallback(()=>c(null),[]),h=e.dock;h.cat_webTools,h.skill_webSearch,h.desc_webSearch,h.skill_webFetch,h.desc_webFetch,h.skill_browserControl,h.desc_browserControl,h.cat_fileMedia,h.skill_pdfReader,h.desc_pdfReader,h.skill_imageAnalysis,h.desc_imageAnalysis,h.skill_imageGeneration,h.desc_imageGeneration,h.skill_tts,h.desc_tts,h.cat_aiAgents,h.skills,h.skill_spawnAgent,h.desc_spawnAgent,h.skill_agentSessions,h.desc_agentSessions,h.skill_canvas,h.desc_canvas,h.skill_git,h.desc_git,h.cat_systemTools,h.skill_gateway,h.desc_gateway,h.skill_fileManager,h.desc_fileManager,h.skill_cron,h.desc_cron,h.skill_messages,h.desc_messages,h.cat_knowledgeBase,h.mem_browse,h.desc_memBrowse,h.mem_search,h.desc_memSearch,h.mem_add,h.desc_memAdd,h.cat_personalOrg,h.mem_contacts,h.desc_contacts,h.mem_calendar,h.desc_calendar,h.cat_pluginManager,h.plug_marketplace,h.desc_marketplace,h.plug_installed,h.desc_installed,h.plug_mcp,h.desc_mcp,h.cat_developer,h.plug_bundleMcp,h.desc_bundleMcp,h.plug_cliCmds,h.desc_cliCmds,h.cat_automation,h.wf_automations,h.desc_automations,h.wf_scheduled,h.desc_scheduled,h.wf_commands,h.desc_commands,h.cat_advanced,h.wf_nodes,h.desc_nodes,h.wf_multiAgent,h.desc_multiAgent;const m={memory:h.memory,plugins:h.plugins,skills:h.skills,workspace:h.files,livesight:"Visual Audit"};return r.jsx(J2,{reducedMotion:d?"always":"never",children:r.jsxs("div",{className:"relative min-h-screen overflow-x-hidden font-sans bg-transparent",children:[l&&r.jsx(D_,{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(y=>!y),"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(VS,{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(hi,{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(kS,{size:14}),r.jsx("span",{className:"hidden sm:inline",children:e.nav.voice})]}),r.jsx(U.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(UC,{})}),r.jsx(f_,{})]})]}),r.jsx(ee,{children:s&&r.jsx(U.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(L_,{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(e2,{})}),r.jsx(a_,{}),r.jsx(h_,{}),r.jsx(y_,{}),r.jsx(__,{})]})})}const I_=[{decision:"duplicate",label:"Create New Agent",sublabel:"Keep both — cloud data is copied to a separate folder",icon:PS,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:NS,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:JS,accent:"border-green-500/30 bg-green-500/8 hover:border-green-500/50 text-green-400"}];function B_(){const[e,t]=f.useState(null),[n,s]=f.useState(!1),[i,a]=f.useState(!1);f.useEffect(()=>{const c=at(),d=u=>{u.type==="CONFLICT_DETECTED"&&(t({localAgentName:u.localAgentName??null,cloudAgentName:u.cloudAgentName??null,localMtime:u.localMtime??null,cloudTimestamp:u.cloudTimestamp??null}),a(!1)),u.type==="syncResolveFinish"&&(a(!0),setTimeout(()=>{t(null),a(!1)},1800))};return c.on("agentUpdate",d),()=>{c.off("agentUpdate",d)}},[]);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(ee,{children:e&&r.jsx(U.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(U.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(es,{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"]}):I_.map(c=>{const d=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(d,{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 F_="1.71.24";function V_(){const[e,t]=f.useState("idle"),[n,s]=f.useState(null),[i,a]=f.useState(""),[o,l]=f.useState(""),c=f.useCallback(async()=>{var h,m;t("checking"),a("");try{const y=await $("/api/system/version");if(!y.ok)throw new Error(`Server returned ${y.status}`);const v=await y.json(),g=(v==null?void 0:v.current)??((h=v==null?void 0:v.data)==null?void 0:h.current),x=(v==null?void 0:v.latest)??((m=v==null?void 0:v.data)==null?void 0:m.latest);if(!g||!x)throw new Error("Version endpoint returned incomplete data");s({current:g,latest:x}),$_(x,g)>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")}},[]);f.useEffect(()=>{const m=setInterval(()=>{t(y=>((y==="idle"||y==="up-to-date")&&c(),y))},288e5);return()=>clearInterval(m)},[c]);const d=f.useCallback(async()=>{t("downloading"),l("");try{const h=await fetch("/api/system/update",{method:"POST",credentials:"include"});if(!h.body)throw new Error("No response body");const m=h.body.getReader(),y=new TextDecoder;for(;;){const{done:b,value:v}=await m.read();if(b)break;l(g=>g+y.decode(v))}t("done")}catch(h){a((h==null?void 0:h.message)??"Update failed"),t("error")}},[]),u=f.useCallback(async()=>{t("restarting");try{await $("/api/system/restart",{method:"POST"})}catch{}const h=at();let m=0;const y=setInterval(()=>{m++,h.connected&&(clearInterval(y),window.location.reload()),m>60&&clearInterval(y)},500)},[]),p=(n==null?void 0:n.current)??F_;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:[r.jsxs("button",{onClick:e==="idle"||e==="up-to-date"||e==="error"?c:void 0,disabled:["checking","downloading","restarting"].includes(e),title:"Check for updates",className:Ke("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(xi,{size:13,className:"text-red-300 shrink-0"}),e==="up-to-date"&&r.jsx(nc,{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(nc,{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(ln,{size:13,className:"text-amber-300 shrink-0"}),e==="idle"&&r.jsx(le,{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:p})]}),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(xi,{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(xi,{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"&&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(nc,{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:u,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(le,{size:13}),r.jsx("span",{children:"Restart Now"})]})]})]}),e==="restarting"&&r.jsxs("div",{className:"fixed inset-0 z-[9999] flex flex-col items-center justify-center bg-black/80 backdrop-blur-sm",children:[r.jsx(ne,{size:44,className:"animate-spin text-orange-400 mb-5"}),r.jsx("p",{className:"text-white text-lg font-semibold",children:r.jsx("span",{children:"Restarting Must-b…"})}),r.jsx("p",{className:"text-gray-400 text-sm mt-2",children:r.jsx("span",{children:"The dashboard will reload automatically."})})]})]})}function $_(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 U_ extends f.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 pc="mustb_setup_complete";function H_({children:e}){const t=un(),[n,s]=f.useState(()=>localStorage.getItem(pc)==="1");return f.useEffect(()=>{if(localStorage.getItem(pc)==="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(pc,"1"),s(!0)):t("/setup",{replace:!0}))}).catch(()=>{i||s(!0)}),()=>{i=!0}},[t]),n?r.jsx(r.Fragment,{children:e}):null}function W_(){return r.jsx(U_,{children:r.jsx(h4,{children:r.jsxs(d2,{children:[r.jsx(V2,{position:"top-right",theme:"dark",closeButton:!0,richColors:!0}),r.jsx(B_,{}),r.jsx(V_,{}),r.jsxs(n2,{children:[r.jsx(we,{path:"/",element:r.jsx(bm,{})}),r.jsx(we,{path:"/welcome",element:r.jsx(bm,{})}),r.jsx(we,{path:"/setup",element:r.jsx(y4,{})}),r.jsxs(we,{path:"/app",element:r.jsx(H_,{children:r.jsx(O_,{})}),children:[r.jsx(we,{index:!0,element:r.jsx(Dm,{})}),r.jsx(we,{path:"chat",element:r.jsx(Dm,{})}),r.jsx(we,{path:"settings",element:r.jsx(tC,{})}),r.jsx(we,{path:"active",element:r.jsx(sC,{})}),r.jsx(we,{path:"automations",element:r.jsx(aC,{})}),r.jsx(we,{path:"clients",element:r.jsx(cC,{})}),r.jsx(we,{path:"logs",element:r.jsx(pC,{})}),r.jsx(we,{path:"products",element:r.jsx(gC,{})}),r.jsx(we,{path:"memory",element:r.jsx(jC,{})}),r.jsx(we,{path:"memory/persona",element:r.jsx(CC,{})}),r.jsx(we,{path:"skills",element:r.jsx(EC,{})}),r.jsx(we,{path:"plugins",element:r.jsx(MC,{})}),r.jsx(we,{path:"files",element:r.jsx(LC,{})}),r.jsx(we,{path:"browser",element:r.jsx(BC,{})}),r.jsx(we,{path:"voice",element:r.jsx($C,{})}),r.jsx(we,{path:"*",element:r.jsx(Kp,{to:"/app",replace:!0})})]}),r.jsx(we,{path:"/mobile",element:r.jsx(RC,{})}),r.jsx(we,{path:"*",element:r.jsx(Kp,{to:"/",replace:!0})})]})]})})})}lx(document.getElementById("root")).render(r.jsx(f.StrictMode,{children:r.jsx(W_,{})}));
|