meeting_memory/nanobot/web/dist/assets/index-CDsuleQI.js

556 lines
1.0 MiB
Raw Blame History

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/syntax-highlight-CQw1bBY6.js","assets/markdown-vendor-BC7Vi29N.js","assets/katex-BSBacQyE.js","assets/katex-wklAmtGL.css","assets/MarkdownTextRenderer-Cg7UrKJ7.js"])))=>i.map(i=>d[i]);
var RS=Object.defineProperty;var MS=(e,t,n)=>t in e?RS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var He=(e,t,n)=>MS(e,typeof t!="symbol"?t+"":t,n);import{j as s}from"./markdown-vendor-BC7Vi29N.js";import{r as u,g as ES,R as wm,a as Pa,_ as Dl}from"./syntax-highlight-CQw1bBY6.js";import"./katex-BSBacQyE.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))r(a);new MutationObserver(a=>{for(const o of a)if(o.type==="childList")for(const i of o.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(a){const o={};return a.integrity&&(o.integrity=a.integrity),a.referrerPolicy&&(o.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?o.credentials="include":a.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(a){if(a.ep)return;a.ep=!0;const o=n(a);fetch(a.href,o)}})();var Yd={},Kx={exports:{}},Mn={},Vx={exports:{}},Gx={};/**
* @license React
* scheduler.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/(function(e){function t(P,D){var G=P.length;P.push(D);e:for(;0<G;){var Y=G-1>>>1,oe=P[Y];if(0<a(oe,D))P[Y]=D,P[G]=oe,G=Y;else break e}}function n(P){return P.length===0?null:P[0]}function r(P){if(P.length===0)return null;var D=P[0],G=P.pop();if(G!==D){P[0]=G;e:for(var Y=0,oe=P.length,de=oe>>>1;Y<de;){var pe=2*(Y+1)-1,le=P[pe],I=pe+1,Q=P[I];if(0>a(le,G))I<oe&&0>a(Q,le)?(P[Y]=Q,P[I]=G,Y=I):(P[Y]=le,P[pe]=G,Y=pe);else if(I<oe&&0>a(Q,G))P[Y]=Q,P[I]=G,Y=I;else break e}}return D}function a(P,D){var G=P.sortIndex-D.sortIndex;return G!==0?G:P.id-D.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var i=Date,l=i.now();e.unstable_now=function(){return i.now()-l}}var c=[],d=[],p=1,m=null,f=3,h=!1,y=!1,x=!1,b=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,g=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(P){for(var D=n(d);D!==null;){if(D.callback===null)r(d);else if(D.startTime<=P)r(d),D.sortIndex=D.expirationTime,t(c,D);else break;D=n(d)}}function k(P){if(x=!1,w(P),!y)if(n(c)!==null)y=!0,$(C);else{var D=n(d);D!==null&&W(k,D.startTime-P)}}function C(P,D){y=!1,x&&(x=!1,v(A),A=-1),h=!0;var G=f;try{for(w(D),m=n(c);m!==null&&(!(m.expirationTime>D)||P&&!R());){var Y=m.callback;if(typeof Y=="function"){m.callback=null,f=m.priorityLevel;var oe=Y(m.expirationTime<=D);D=e.unstable_now(),typeof oe=="function"?m.callback=oe:m===n(c)&&r(c),w(D)}else r(c);m=n(c)}if(m!==null)var de=!0;else{var pe=n(d);pe!==null&&W(k,pe.startTime-D),de=!1}return de}finally{m=null,f=G,h=!1}}var N=!1,S=null,A=-1,E=5,_=-1;function R(){return!(e.unstable_now()-_<E)}function T(){if(S!==null){var P=e.unstable_now();_=P;var D=!0;try{D=S(!0,P)}finally{D?F():(N=!1,S=null)}}else N=!1}var F;if(typeof g=="function")F=function(){g(T)};else if(typeof MessageChannel<"u"){var z=new MessageChannel,K=z.port2;z.port1.onmessage=T,F=function(){K.postMessage(null)}}else F=function(){b(T,0)};function $(P){S=P,N||(N=!0,F())}function W(P,D){A=b(function(){P(e.unstable_now())},D)}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(P){P.callback=null},e.unstable_continueExecution=function(){y||h||(y=!0,$(C))},e.unstable_forceFrameRate=function(P){0>P||125<P?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):E=0<P?Math.floor(1e3/P):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(P){switch(f){case 1:case 2:case 3:var D=3;break;default:D=f}var G=f;f=D;try{return P()}finally{f=G}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(P,D){switch(P){case 1:case 2:case 3:case 4:case 5:break;default:P=3}var G=f;f=P;try{return D()}finally{f=G}},e.unstable_scheduleCallback=function(P,D,G){var Y=e.unstable_now();switch(typeof G=="object"&&G!==null?(G=G.delay,G=typeof G=="number"&&0<G?Y+G:Y):G=Y,P){case 1:var oe=-1;break;case 2:oe=250;break;case 5:oe=1073741823;break;case 4:oe=1e4;break;default:oe=5e3}return oe=G+oe,P={id:p++,callback:D,priorityLevel:P,startTime:G,expirationTime:oe,sortIndex:-1},G>Y?(P.sortIndex=G,t(d,P),n(c)===null&&P===n(d)&&(x?(v(A),A=-1):x=!0,W(k,G-Y))):(P.sortIndex=oe,t(c,P),y||h||(y=!0,$(C))),P},e.unstable_shouldYield=R,e.unstable_wrapCallback=function(P){var D=f;return function(){var G=f;f=D;try{return P.apply(this,arguments)}finally{f=G}}}})(Gx);Vx.exports=Gx;var IS=Vx.exports;/**
* @license React
* react-dom.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var LS=u,Rn=IS;function te(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 Yx=new Set,li={};function to(e,t){Go(e,t),Go(e+"Capture",t)}function Go(e,t){for(li[e]=t,e=0;e<t.length;e++)Yx.add(t[e])}var Lr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Qd=Object.prototype.hasOwnProperty,DS=/^[: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]*$/,ah={},oh={};function OS(e){return Qd.call(oh,e)?!0:Qd.call(ah,e)?!1:DS.test(e)?oh[e]=!0:(ah[e]=!0,!1)}function FS(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function zS(e,t,n,r){if(t===null||typeof t>"u"||FS(e,t,n,r))return!0;if(r)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 on(e,t,n,r,a,o,i){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=a,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=i}var qt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){qt[e]=new on(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];qt[t]=new on(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){qt[e]=new on(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){qt[e]=new on(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){qt[e]=new on(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){qt[e]=new on(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){qt[e]=new on(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){qt[e]=new on(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){qt[e]=new on(e,5,!1,e.toLowerCase(),null,!1,!1)});var km=/[\-:]([a-z])/g;function Cm(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(km,Cm);qt[t]=new on(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(km,Cm);qt[t]=new on(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(km,Cm);qt[t]=new on(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){qt[e]=new on(e,1,!1,e.toLowerCase(),null,!1,!1)});qt.xlinkHref=new on("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){qt[e]=new on(e,1,!1,e.toLowerCase(),null,!0,!0)});function Sm(e,t,n,r){var a=qt.hasOwnProperty(t)?qt[t]:null;(a!==null?a.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(zS(t,n,a,r)&&(n=null),r||a===null?OS(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):a.mustUseProperty?e[a.propertyName]=n===null?a.type===3?!1:"":n:(t=a.attributeName,r=a.attributeNamespace,n===null?e.removeAttribute(t):(a=a.type,n=a===3||a===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var Hr=LS.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,il=Symbol.for("react.element"),yo=Symbol.for("react.portal"),bo=Symbol.for("react.fragment"),Nm=Symbol.for("react.strict_mode"),Xd=Symbol.for("react.profiler"),Qx=Symbol.for("react.provider"),Xx=Symbol.for("react.context"),jm=Symbol.for("react.forward_ref"),Jd=Symbol.for("react.suspense"),Zd=Symbol.for("react.suspense_list"),Am=Symbol.for("react.memo"),ta=Symbol.for("react.lazy"),Jx=Symbol.for("react.offscreen"),sh=Symbol.iterator;function js(e){return e===null||typeof e!="object"?null:(e=sh&&e[sh]||e["@@iterator"],typeof e=="function"?e:null)}var dt=Object.assign,Wu;function Fs(e){if(Wu===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Wu=t&&t[1]||""}return`
`+Wu+e}var qu=!1;function Ku(e,t){if(!e||qu)return"";qu=!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 r=d}Reflect.construct(e,[],t)}else{try{t.call()}catch(d){r=d}e.call(t.prototype)}else{try{throw Error()}catch(d){r=d}e()}}catch(d){if(d&&r&&typeof d.stack=="string"){for(var a=d.stack.split(`
`),o=r.stack.split(`
`),i=a.length-1,l=o.length-1;1<=i&&0<=l&&a[i]!==o[l];)l--;for(;1<=i&&0<=l;i--,l--)if(a[i]!==o[l]){if(i!==1||l!==1)do if(i--,l--,0>l||a[i]!==o[l]){var c=`
`+a[i].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=i&&0<=l);break}}}finally{qu=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Fs(e):""}function $S(e){switch(e.tag){case 5:return Fs(e.type);case 16:return Fs("Lazy");case 13:return Fs("Suspense");case 19:return Fs("SuspenseList");case 0:case 2:case 15:return e=Ku(e.type,!1),e;case 11:return e=Ku(e.type.render,!1),e;case 1:return e=Ku(e.type,!0),e;default:return""}}function ep(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 bo:return"Fragment";case yo:return"Portal";case Xd:return"Profiler";case Nm:return"StrictMode";case Jd:return"Suspense";case Zd:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Xx:return(e.displayName||"Context")+".Consumer";case Qx:return(e._context.displayName||"Context")+".Provider";case jm:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Am:return t=e.displayName||null,t!==null?t:ep(e.type)||"Memo";case ta:t=e._payload,e=e._init;try{return ep(e(t))}catch{}}return null}function US(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 ep(t);case 8:return t===Nm?"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 va(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Zx(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function BS(e){var t=Zx(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var a=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return a.call(this)},set:function(i){r=""+i,o.call(this,i)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(i){r=""+i},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ll(e){e._valueTracker||(e._valueTracker=BS(e))}function ey(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Zx(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function nc(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 tp(e,t){var n=t.checked;return dt({},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,r=t.checked!=null?t.checked:t.defaultChecked;n=va(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function ty(e,t){t=t.checked,t!=null&&Sm(e,"checked",t,!1)}function np(e,t){ty(e,t);var n=va(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?rp(e,t.type,n):t.hasOwnProperty("defaultValue")&&rp(e,t.type,va(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function lh(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="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 rp(e,t,n){(t!=="number"||nc(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var zs=Array.isArray;function Io(e,t,n,r){if(e=e.options,t){t={};for(var a=0;a<n.length;a++)t["$"+n[a]]=!0;for(n=0;n<e.length;n++)a=t.hasOwnProperty("$"+e[n].value),e[n].selected!==a&&(e[n].selected=a),a&&r&&(e[n].defaultSelected=!0)}else{for(n=""+va(n),t=null,a=0;a<e.length;a++){if(e[a].value===n){e[a].selected=!0,r&&(e[a].defaultSelected=!0);return}t!==null||e[a].disabled||(t=e[a])}t!==null&&(t.selected=!0)}}function ap(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(te(91));return dt({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function ch(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(te(92));if(zs(n)){if(1<n.length)throw Error(te(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:va(n)}}function ny(e,t){var n=va(t.value),r=va(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function uh(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function ry(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 op(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?ry(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var cl,ay=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,a){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,a)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(cl=cl||document.createElement("div"),cl.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=cl.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function ci(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Vs={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},HS=["Webkit","ms","Moz","O"];Object.keys(Vs).forEach(function(e){HS.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Vs[t]=Vs[e]})});function oy(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Vs.hasOwnProperty(e)&&Vs[e]?(""+t).trim():t+"px"}function sy(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,a=oy(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,a):e[n]=a}}var WS=dt({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 sp(e,t){if(t){if(WS[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(te(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(te(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(te(61))}if(t.style!=null&&typeof t.style!="object")throw Error(te(62))}}function ip(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 lp=null;function _m(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var cp=null,Lo=null,Do=null;function dh(e){if(e=Bi(e)){if(typeof cp!="function")throw Error(te(280));var t=e.stateNode;t&&(t=Xc(t),cp(e.stateNode,e.type,t))}}function iy(e){Lo?Do?Do.push(e):Do=[e]:Lo=e}function ly(){if(Lo){var e=Lo,t=Do;if(Do=Lo=null,dh(e),t)for(e=0;e<t.length;e++)dh(t[e])}}function cy(e,t){return e(t)}function uy(){}var Vu=!1;function dy(e,t,n){if(Vu)return e(t,n);Vu=!0;try{return cy(e,t,n)}finally{Vu=!1,(Lo!==null||Do!==null)&&(uy(),ly())}}function ui(e,t){var n=e.stateNode;if(n===null)return null;var r=Xc(n);if(r===null)return null;n=r[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":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(te(231,t,typeof n));return n}var up=!1;if(Lr)try{var As={};Object.defineProperty(As,"passive",{get:function(){up=!0}}),window.addEventListener("test",As,As),window.removeEventListener("test",As,As)}catch{up=!1}function qS(e,t,n,r,a,o,i,l,c){var d=Array.prototype.slice.call(arguments,3);try{t.apply(n,d)}catch(p){this.onError(p)}}var Gs=!1,rc=null,ac=!1,dp=null,KS={onError:function(e){Gs=!0,rc=e}};function VS(e,t,n,r,a,o,i,l,c){Gs=!1,rc=null,qS.apply(KS,arguments)}function GS(e,t,n,r,a,o,i,l,c){if(VS.apply(this,arguments),Gs){if(Gs){var d=rc;Gs=!1,rc=null}else throw Error(te(198));ac||(ac=!0,dp=d)}}function no(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 py(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 ph(e){if(no(e)!==e)throw Error(te(188))}function YS(e){var t=e.alternate;if(!t){if(t=no(e),t===null)throw Error(te(188));return t!==e?null:e}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var o=a.alternate;if(o===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===o.child){for(o=a.child;o;){if(o===n)return ph(a),e;if(o===r)return ph(a),t;o=o.sibling}throw Error(te(188))}if(n.return!==r.return)n=a,r=o;else{for(var i=!1,l=a.child;l;){if(l===n){i=!0,n=a,r=o;break}if(l===r){i=!0,r=a,n=o;break}l=l.sibling}if(!i){for(l=o.child;l;){if(l===n){i=!0,n=o,r=a;break}if(l===r){i=!0,r=o,n=a;break}l=l.sibling}if(!i)throw Error(te(189))}}if(n.alternate!==r)throw Error(te(190))}if(n.tag!==3)throw Error(te(188));return n.stateNode.current===n?e:t}function my(e){return e=YS(e),e!==null?fy(e):null}function fy(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=fy(e);if(t!==null)return t;e=e.sibling}return null}var hy=Rn.unstable_scheduleCallback,mh=Rn.unstable_cancelCallback,QS=Rn.unstable_shouldYield,XS=Rn.unstable_requestPaint,bt=Rn.unstable_now,JS=Rn.unstable_getCurrentPriorityLevel,Pm=Rn.unstable_ImmediatePriority,gy=Rn.unstable_UserBlockingPriority,oc=Rn.unstable_NormalPriority,ZS=Rn.unstable_LowPriority,vy=Rn.unstable_IdlePriority,Vc=null,hr=null;function eN(e){if(hr&&typeof hr.onCommitFiberRoot=="function")try{hr.onCommitFiberRoot(Vc,e,void 0,(e.current.flags&128)===128)}catch{}}var Qn=Math.clz32?Math.clz32:rN,tN=Math.log,nN=Math.LN2;function rN(e){return e>>>=0,e===0?32:31-(tN(e)/nN|0)|0}var ul=64,dl=4194304;function $s(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 sc(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,a=e.suspendedLanes,o=e.pingedLanes,i=n&268435455;if(i!==0){var l=i&~a;l!==0?r=$s(l):(o&=i,o!==0&&(r=$s(o)))}else i=n&~a,i!==0?r=$s(i):o!==0&&(r=$s(o));if(r===0)return 0;if(t!==0&&t!==r&&!(t&a)&&(a=r&-r,o=t&-t,a>=o||a===16&&(o&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-Qn(t),a=1<<n,r|=e[n],t&=~a;return r}function aN(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 oN(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,a=e.expirationTimes,o=e.pendingLanes;0<o;){var i=31-Qn(o),l=1<<i,c=a[i];c===-1?(!(l&n)||l&r)&&(a[i]=aN(l,t)):c<=t&&(e.expiredLanes|=l),o&=~l}}function pp(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function xy(){var e=ul;return ul<<=1,!(ul&4194240)&&(ul=64),e}function Gu(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function $i(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Qn(t),e[t]=n}function sN(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 r=e.eventTimes;for(e=e.expirationTimes;0<n;){var a=31-Qn(n),o=1<<a;t[a]=0,r[a]=-1,e[a]=-1,n&=~o}}function Tm(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Qn(n),a=1<<r;a&t|e[r]&t&&(e[r]|=t),n&=~a}}var Xe=0;function yy(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var by,Rm,wy,ky,Cy,mp=!1,pl=[],la=null,ca=null,ua=null,di=new Map,pi=new Map,ra=[],iN="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 fh(e,t){switch(e){case"focusin":case"focusout":la=null;break;case"dragenter":case"dragleave":ca=null;break;case"mouseover":case"mouseout":ua=null;break;case"pointerover":case"pointerout":di.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":pi.delete(t.pointerId)}}function _s(e,t,n,r,a,o){return e===null||e.nativeEvent!==o?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:o,targetContainers:[a]},t!==null&&(t=Bi(t),t!==null&&Rm(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,a!==null&&t.indexOf(a)===-1&&t.push(a),e)}function lN(e,t,n,r,a){switch(t){case"focusin":return la=_s(la,e,t,n,r,a),!0;case"dragenter":return ca=_s(ca,e,t,n,r,a),!0;case"mouseover":return ua=_s(ua,e,t,n,r,a),!0;case"pointerover":var o=a.pointerId;return di.set(o,_s(di.get(o)||null,e,t,n,r,a)),!0;case"gotpointercapture":return o=a.pointerId,pi.set(o,_s(pi.get(o)||null,e,t,n,r,a)),!0}return!1}function Sy(e){var t=Ia(e.target);if(t!==null){var n=no(t);if(n!==null){if(t=n.tag,t===13){if(t=py(n),t!==null){e.blockedOn=t,Cy(e.priority,function(){wy(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 Ol(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=fp(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);lp=r,n.target.dispatchEvent(r),lp=null}else return t=Bi(n),t!==null&&Rm(t),e.blockedOn=n,!1;t.shift()}return!0}function hh(e,t,n){Ol(e)&&n.delete(t)}function cN(){mp=!1,la!==null&&Ol(la)&&(la=null),ca!==null&&Ol(ca)&&(ca=null),ua!==null&&Ol(ua)&&(ua=null),di.forEach(hh),pi.forEach(hh)}function Ps(e,t){e.blockedOn===t&&(e.blockedOn=null,mp||(mp=!0,Rn.unstable_scheduleCallback(Rn.unstable_NormalPriority,cN)))}function mi(e){function t(a){return Ps(a,e)}if(0<pl.length){Ps(pl[0],e);for(var n=1;n<pl.length;n++){var r=pl[n];r.blockedOn===e&&(r.blockedOn=null)}}for(la!==null&&Ps(la,e),ca!==null&&Ps(ca,e),ua!==null&&Ps(ua,e),di.forEach(t),pi.forEach(t),n=0;n<ra.length;n++)r=ra[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<ra.length&&(n=ra[0],n.blockedOn===null);)Sy(n),n.blockedOn===null&&ra.shift()}var Oo=Hr.ReactCurrentBatchConfig,ic=!0;function uN(e,t,n,r){var a=Xe,o=Oo.transition;Oo.transition=null;try{Xe=1,Mm(e,t,n,r)}finally{Xe=a,Oo.transition=o}}function dN(e,t,n,r){var a=Xe,o=Oo.transition;Oo.transition=null;try{Xe=4,Mm(e,t,n,r)}finally{Xe=a,Oo.transition=o}}function Mm(e,t,n,r){if(ic){var a=fp(e,t,n,r);if(a===null)ad(e,t,r,lc,n),fh(e,r);else if(lN(a,e,t,n,r))r.stopPropagation();else if(fh(e,r),t&4&&-1<iN.indexOf(e)){for(;a!==null;){var o=Bi(a);if(o!==null&&by(o),o=fp(e,t,n,r),o===null&&ad(e,t,r,lc,n),o===a)break;a=o}a!==null&&r.stopPropagation()}else ad(e,t,r,null,n)}}var lc=null;function fp(e,t,n,r){if(lc=null,e=_m(r),e=Ia(e),e!==null)if(t=no(e),t===null)e=null;else if(n=t.tag,n===13){if(e=py(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 lc=e,null}function Ny(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(JS()){case Pm:return 1;case gy:return 4;case oc:case ZS:return 16;case vy:return 536870912;default:return 16}default:return 16}}var sa=null,Em=null,Fl=null;function jy(){if(Fl)return Fl;var e,t=Em,n=t.length,r,a="value"in sa?sa.value:sa.textContent,o=a.length;for(e=0;e<n&&t[e]===a[e];e++);var i=n-e;for(r=1;r<=i&&t[n-r]===a[o-r];r++);return Fl=a.slice(e,1<r?1-r:void 0)}function zl(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 ml(){return!0}function gh(){return!1}function En(e){function t(n,r,a,o,i){this._reactName=n,this._targetInst=a,this.type=r,this.nativeEvent=o,this.target=i,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(n=e[l],this[l]=n?n(o):o[l]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?ml:gh,this.isPropagationStopped=gh,this}return dt(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=ml)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=ml)},persist:function(){},isPersistent:ml}),t}var ps={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Im=En(ps),Ui=dt({},ps,{view:0,detail:0}),pN=En(Ui),Yu,Qu,Ts,Gc=dt({},Ui,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Lm,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!==Ts&&(Ts&&e.type==="mousemove"?(Yu=e.screenX-Ts.screenX,Qu=e.screenY-Ts.screenY):Qu=Yu=0,Ts=e),Yu)},movementY:function(e){return"movementY"in e?e.movementY:Qu}}),vh=En(Gc),mN=dt({},Gc,{dataTransfer:0}),fN=En(mN),hN=dt({},Ui,{relatedTarget:0}),Xu=En(hN),gN=dt({},ps,{animationName:0,elapsedTime:0,pseudoElement:0}),vN=En(gN),xN=dt({},ps,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),yN=En(xN),bN=dt({},ps,{data:0}),xh=En(bN),wN={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},kN={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"},CN={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function SN(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=CN[e])?!!t[e]:!1}function Lm(){return SN}var NN=dt({},Ui,{key:function(e){if(e.key){var t=wN[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=zl(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?kN[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Lm,charCode:function(e){return e.type==="keypress"?zl(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?zl(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),jN=En(NN),AN=dt({},Gc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),yh=En(AN),_N=dt({},Ui,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Lm}),PN=En(_N),TN=dt({},ps,{propertyName:0,elapsedTime:0,pseudoElement:0}),RN=En(TN),MN=dt({},Gc,{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}),EN=En(MN),IN=[9,13,27,32],Dm=Lr&&"CompositionEvent"in window,Ys=null;Lr&&"documentMode"in document&&(Ys=document.documentMode);var LN=Lr&&"TextEvent"in window&&!Ys,Ay=Lr&&(!Dm||Ys&&8<Ys&&11>=Ys),bh=" ",wh=!1;function _y(e,t){switch(e){case"keyup":return IN.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Py(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var wo=!1;function DN(e,t){switch(e){case"compositionend":return Py(t);case"keypress":return t.which!==32?null:(wh=!0,bh);case"textInput":return e=t.data,e===bh&&wh?null:e;default:return null}}function ON(e,t){if(wo)return e==="compositionend"||!Dm&&_y(e,t)?(e=jy(),Fl=Em=sa=null,wo=!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 Ay&&t.locale!=="ko"?null:t.data;default:return null}}var FN={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 kh(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!FN[e.type]:t==="textarea"}function Ty(e,t,n,r){iy(r),t=cc(t,"onChange"),0<t.length&&(n=new Im("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Qs=null,fi=null;function zN(e){Uy(e,0)}function Yc(e){var t=So(e);if(ey(t))return e}function $N(e,t){if(e==="change")return t}var Ry=!1;if(Lr){var Ju;if(Lr){var Zu="oninput"in document;if(!Zu){var Ch=document.createElement("div");Ch.setAttribute("oninput","return;"),Zu=typeof Ch.oninput=="function"}Ju=Zu}else Ju=!1;Ry=Ju&&(!document.documentMode||9<document.documentMode)}function Sh(){Qs&&(Qs.detachEvent("onpropertychange",My),fi=Qs=null)}function My(e){if(e.propertyName==="value"&&Yc(fi)){var t=[];Ty(t,fi,e,_m(e)),dy(zN,t)}}function UN(e,t,n){e==="focusin"?(Sh(),Qs=t,fi=n,Qs.attachEvent("onpropertychange",My)):e==="focusout"&&Sh()}function BN(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Yc(fi)}function HN(e,t){if(e==="click")return Yc(t)}function WN(e,t){if(e==="input"||e==="change")return Yc(t)}function qN(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Jn=typeof Object.is=="function"?Object.is:qN;function hi(e,t){if(Jn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var a=n[r];if(!Qd.call(t,a)||!Jn(e[a],t[a]))return!1}return!0}function Nh(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function jh(e,t){var n=Nh(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Nh(n)}}function Ey(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Ey(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Iy(){for(var e=window,t=nc();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=nc(e.document)}return t}function Om(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 KN(e){var t=Iy(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Ey(n.ownerDocument.documentElement,n)){if(r!==null&&Om(n)){if(t=r.start,e=r.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 a=n.textContent.length,o=Math.min(r.start,a);r=r.end===void 0?o:Math.min(r.end,a),!e.extend&&o>r&&(a=r,r=o,o=a),a=jh(n,o);var i=jh(n,r);a&&i&&(e.rangeCount!==1||e.anchorNode!==a.node||e.anchorOffset!==a.offset||e.focusNode!==i.node||e.focusOffset!==i.offset)&&(t=t.createRange(),t.setStart(a.node,a.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(i.node,i.offset)):(t.setEnd(i.node,i.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 VN=Lr&&"documentMode"in document&&11>=document.documentMode,ko=null,hp=null,Xs=null,gp=!1;function Ah(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;gp||ko==null||ko!==nc(r)||(r=ko,"selectionStart"in r&&Om(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Xs&&hi(Xs,r)||(Xs=r,r=cc(hp,"onSelect"),0<r.length&&(t=new Im("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=ko)))}function fl(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Co={animationend:fl("Animation","AnimationEnd"),animationiteration:fl("Animation","AnimationIteration"),animationstart:fl("Animation","AnimationStart"),transitionend:fl("Transition","TransitionEnd")},ed={},Ly={};Lr&&(Ly=document.createElement("div").style,"AnimationEvent"in window||(delete Co.animationend.animation,delete Co.animationiteration.animation,delete Co.animationstart.animation),"TransitionEvent"in window||delete Co.transitionend.transition);function Qc(e){if(ed[e])return ed[e];if(!Co[e])return e;var t=Co[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Ly)return ed[e]=t[n];return e}var Dy=Qc("animationend"),Oy=Qc("animationiteration"),Fy=Qc("animationstart"),zy=Qc("transitionend"),$y=new Map,_h="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 Ca(e,t){$y.set(e,t),to(t,[e])}for(var td=0;td<_h.length;td++){var nd=_h[td],GN=nd.toLowerCase(),YN=nd[0].toUpperCase()+nd.slice(1);Ca(GN,"on"+YN)}Ca(Dy,"onAnimationEnd");Ca(Oy,"onAnimationIteration");Ca(Fy,"onAnimationStart");Ca("dblclick","onDoubleClick");Ca("focusin","onFocus");Ca("focusout","onBlur");Ca(zy,"onTransitionEnd");Go("onMouseEnter",["mouseout","mouseover"]);Go("onMouseLeave",["mouseout","mouseover"]);Go("onPointerEnter",["pointerout","pointerover"]);Go("onPointerLeave",["pointerout","pointerover"]);to("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));to("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));to("onBeforeInput",["compositionend","keypress","textInput","paste"]);to("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));to("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));to("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Us="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(" "),QN=new Set("cancel close invalid load scroll toggle".split(" ").concat(Us));function Ph(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,GS(r,t,void 0,e),e.currentTarget=null}function Uy(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],a=r.event;r=r.listeners;e:{var o=void 0;if(t)for(var i=r.length-1;0<=i;i--){var l=r[i],c=l.instance,d=l.currentTarget;if(l=l.listener,c!==o&&a.isPropagationStopped())break e;Ph(a,l,d),o=c}else for(i=0;i<r.length;i++){if(l=r[i],c=l.instance,d=l.currentTarget,l=l.listener,c!==o&&a.isPropagationStopped())break e;Ph(a,l,d),o=c}}}if(ac)throw e=dp,ac=!1,dp=null,e}function ot(e,t){var n=t[wp];n===void 0&&(n=t[wp]=new Set);var r=e+"__bubble";n.has(r)||(By(t,e,2,!1),n.add(r))}function rd(e,t,n){var r=0;t&&(r|=4),By(n,e,r,t)}var hl="_reactListening"+Math.random().toString(36).slice(2);function gi(e){if(!e[hl]){e[hl]=!0,Yx.forEach(function(n){n!=="selectionchange"&&(QN.has(n)||rd(n,!1,e),rd(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[hl]||(t[hl]=!0,rd("selectionchange",!1,t))}}function By(e,t,n,r){switch(Ny(t)){case 1:var a=uN;break;case 4:a=dN;break;default:a=Mm}n=a.bind(null,t,n,e),a=void 0,!up||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(a=!0),r?a!==void 0?e.addEventListener(t,n,{capture:!0,passive:a}):e.addEventListener(t,n,!0):a!==void 0?e.addEventListener(t,n,{passive:a}):e.addEventListener(t,n,!1)}function ad(e,t,n,r,a){var o=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var i=r.tag;if(i===3||i===4){var l=r.stateNode.containerInfo;if(l===a||l.nodeType===8&&l.parentNode===a)break;if(i===4)for(i=r.return;i!==null;){var c=i.tag;if((c===3||c===4)&&(c=i.stateNode.containerInfo,c===a||c.nodeType===8&&c.parentNode===a))return;i=i.return}for(;l!==null;){if(i=Ia(l),i===null)return;if(c=i.tag,c===5||c===6){r=o=i;continue e}l=l.parentNode}}r=r.return}dy(function(){var d=o,p=_m(n),m=[];e:{var f=$y.get(e);if(f!==void 0){var h=Im,y=e;switch(e){case"keypress":if(zl(n)===0)break e;case"keydown":case"keyup":h=jN;break;case"focusin":y="focus",h=Xu;break;case"focusout":y="blur",h=Xu;break;case"beforeblur":case"afterblur":h=Xu;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":h=vh;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=fN;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=PN;break;case Dy:case Oy:case Fy:h=vN;break;case zy:h=RN;break;case"scroll":h=pN;break;case"wheel":h=EN;break;case"copy":case"cut":case"paste":h=yN;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=yh}var x=(t&4)!==0,b=!x&&e==="scroll",v=x?f!==null?f+"Capture":null:f;x=[];for(var g=d,w;g!==null;){w=g;var k=w.stateNode;if(w.tag===5&&k!==null&&(w=k,v!==null&&(k=ui(g,v),k!=null&&x.push(vi(g,k,w)))),b)break;g=g.return}0<x.length&&(f=new h(f,y,null,n,p),m.push({event:f,listeners:x}))}}if(!(t&7)){e:{if(f=e==="mouseover"||e==="pointerover",h=e==="mouseout"||e==="pointerout",f&&n!==lp&&(y=n.relatedTarget||n.fromElement)&&(Ia(y)||y[Dr]))break e;if((h||f)&&(f=p.window===p?p:(f=p.ownerDocument)?f.defaultView||f.parentWindow:window,h?(y=n.relatedTarget||n.toElement,h=d,y=y?Ia(y):null,y!==null&&(b=no(y),y!==b||y.tag!==5&&y.tag!==6)&&(y=null)):(h=null,y=d),h!==y)){if(x=vh,k="onMouseLeave",v="onMouseEnter",g="mouse",(e==="pointerout"||e==="pointerover")&&(x=yh,k="onPointerLeave",v="onPointerEnter",g="pointer"),b=h==null?f:So(h),w=y==null?f:So(y),f=new x(k,g+"leave",h,n,p),f.target=b,f.relatedTarget=w,k=null,Ia(p)===d&&(x=new x(v,g+"enter",y,n,p),x.target=w,x.relatedTarget=b,k=x),b=k,h&&y)t:{for(x=h,v=y,g=0,w=x;w;w=uo(w))g++;for(w=0,k=v;k;k=uo(k))w++;for(;0<g-w;)x=uo(x),g--;for(;0<w-g;)v=uo(v),w--;for(;g--;){if(x===v||v!==null&&x===v.alternate)break t;x=uo(x),v=uo(v)}x=null}else x=null;h!==null&&Th(m,f,h,x,!1),y!==null&&b!==null&&Th(m,b,y,x,!0)}}e:{if(f=d?So(d):window,h=f.nodeName&&f.nodeName.toLowerCase(),h==="select"||h==="input"&&f.type==="file")var C=$N;else if(kh(f))if(Ry)C=WN;else{C=BN;var N=UN}else(h=f.nodeName)&&h.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(C=HN);if(C&&(C=C(e,d))){Ty(m,C,n,p);break e}N&&N(e,f,d),e==="focusout"&&(N=f._wrapperState)&&N.controlled&&f.type==="number"&&rp(f,"number",f.value)}switch(N=d?So(d):window,e){case"focusin":(kh(N)||N.contentEditable==="true")&&(ko=N,hp=d,Xs=null);break;case"focusout":Xs=hp=ko=null;break;case"mousedown":gp=!0;break;case"contextmenu":case"mouseup":case"dragend":gp=!1,Ah(m,n,p);break;case"selectionchange":if(VN)break;case"keydown":case"keyup":Ah(m,n,p)}var S;if(Dm)e:{switch(e){case"compositionstart":var A="onCompositionStart";break e;case"compositionend":A="onCompositionEnd";break e;case"compositionupdate":A="onCompositionUpdate";break e}A=void 0}else wo?_y(e,n)&&(A="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(A="onCompositionStart");A&&(Ay&&n.locale!=="ko"&&(wo||A!=="onCompositionStart"?A==="onCompositionEnd"&&wo&&(S=jy()):(sa=p,Em="value"in sa?sa.value:sa.textContent,wo=!0)),N=cc(d,A),0<N.length&&(A=new xh(A,e,null,n,p),m.push({event:A,listeners:N}),S?A.data=S:(S=Py(n),S!==null&&(A.data=S)))),(S=LN?DN(e,n):ON(e,n))&&(d=cc(d,"onBeforeInput"),0<d.length&&(p=new xh("onBeforeInput","beforeinput",null,n,p),m.push({event:p,listeners:d}),p.data=S))}Uy(m,t)})}function vi(e,t,n){return{instance:e,listener:t,currentTarget:n}}function cc(e,t){for(var n=t+"Capture",r=[];e!==null;){var a=e,o=a.stateNode;a.tag===5&&o!==null&&(a=o,o=ui(e,n),o!=null&&r.unshift(vi(e,o,a)),o=ui(e,t),o!=null&&r.push(vi(e,o,a))),e=e.return}return r}function uo(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Th(e,t,n,r,a){for(var o=t._reactName,i=[];n!==null&&n!==r;){var l=n,c=l.alternate,d=l.stateNode;if(c!==null&&c===r)break;l.tag===5&&d!==null&&(l=d,a?(c=ui(n,o),c!=null&&i.unshift(vi(n,c,l))):a||(c=ui(n,o),c!=null&&i.push(vi(n,c,l)))),n=n.return}i.length!==0&&e.push({event:t,listeners:i})}var XN=/\r\n?/g,JN=/\u0000|\uFFFD/g;function Rh(e){return(typeof e=="string"?e:""+e).replace(XN,`
`).replace(JN,"")}function gl(e,t,n){if(t=Rh(t),Rh(e)!==t&&n)throw Error(te(425))}function uc(){}var vp=null,xp=null;function yp(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 bp=typeof setTimeout=="function"?setTimeout:void 0,ZN=typeof clearTimeout=="function"?clearTimeout:void 0,Mh=typeof Promise=="function"?Promise:void 0,ej=typeof queueMicrotask=="function"?queueMicrotask:typeof Mh<"u"?function(e){return Mh.resolve(null).then(e).catch(tj)}:bp;function tj(e){setTimeout(function(){throw e})}function od(e,t){var n=t,r=0;do{var a=n.nextSibling;if(e.removeChild(n),a&&a.nodeType===8)if(n=a.data,n==="/$"){if(r===0){e.removeChild(a),mi(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=a}while(n);mi(t)}function da(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 Eh(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 ms=Math.random().toString(36).slice(2),dr="__reactFiber$"+ms,xi="__reactProps$"+ms,Dr="__reactContainer$"+ms,wp="__reactEvents$"+ms,nj="__reactListeners$"+ms,rj="__reactHandles$"+ms;function Ia(e){var t=e[dr];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Dr]||n[dr]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Eh(e);e!==null;){if(n=e[dr])return n;e=Eh(e)}return t}e=n,n=e.parentNode}return null}function Bi(e){return e=e[dr]||e[Dr],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function So(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(te(33))}function Xc(e){return e[xi]||null}var kp=[],No=-1;function Sa(e){return{current:e}}function st(e){0>No||(e.current=kp[No],kp[No]=null,No--)}function tt(e,t){No++,kp[No]=e.current,e.current=t}var xa={},Zt=Sa(xa),mn=Sa(!1),Ha=xa;function Yo(e,t){var n=e.type.contextTypes;if(!n)return xa;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var a={},o;for(o in n)a[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=a),a}function fn(e){return e=e.childContextTypes,e!=null}function dc(){st(mn),st(Zt)}function Ih(e,t,n){if(Zt.current!==xa)throw Error(te(168));tt(Zt,t),tt(mn,n)}function Hy(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var a in r)if(!(a in t))throw Error(te(108,US(e)||"Unknown",a));return dt({},n,r)}function pc(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||xa,Ha=Zt.current,tt(Zt,e),tt(mn,mn.current),!0}function Lh(e,t,n){var r=e.stateNode;if(!r)throw Error(te(169));n?(e=Hy(e,t,Ha),r.__reactInternalMemoizedMergedChildContext=e,st(mn),st(Zt),tt(Zt,e)):st(mn),tt(mn,n)}var Rr=null,Jc=!1,sd=!1;function Wy(e){Rr===null?Rr=[e]:Rr.push(e)}function aj(e){Jc=!0,Wy(e)}function Na(){if(!sd&&Rr!==null){sd=!0;var e=0,t=Xe;try{var n=Rr;for(Xe=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}Rr=null,Jc=!1}catch(a){throw Rr!==null&&(Rr=Rr.slice(e+1)),hy(Pm,Na),a}finally{Xe=t,sd=!1}}return null}var jo=[],Ao=0,mc=null,fc=0,Dn=[],On=0,Wa=null,Mr=1,Er="";function Ma(e,t){jo[Ao++]=fc,jo[Ao++]=mc,mc=e,fc=t}function qy(e,t,n){Dn[On++]=Mr,Dn[On++]=Er,Dn[On++]=Wa,Wa=e;var r=Mr;e=Er;var a=32-Qn(r)-1;r&=~(1<<a),n+=1;var o=32-Qn(t)+a;if(30<o){var i=a-a%5;o=(r&(1<<i)-1).toString(32),r>>=i,a-=i,Mr=1<<32-Qn(t)+a|n<<a|r,Er=o+e}else Mr=1<<o|n<<a|r,Er=e}function Fm(e){e.return!==null&&(Ma(e,1),qy(e,1,0))}function zm(e){for(;e===mc;)mc=jo[--Ao],jo[Ao]=null,fc=jo[--Ao],jo[Ao]=null;for(;e===Wa;)Wa=Dn[--On],Dn[On]=null,Er=Dn[--On],Dn[On]=null,Mr=Dn[--On],Dn[On]=null}var Pn=null,_n=null,it=!1,Yn=null;function Ky(e,t){var n=Fn(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 Dh(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,Pn=e,_n=da(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Pn=e,_n=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Wa!==null?{id:Mr,overflow:Er}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Fn(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Pn=e,_n=null,!0):!1;default:return!1}}function Cp(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Sp(e){if(it){var t=_n;if(t){var n=t;if(!Dh(e,t)){if(Cp(e))throw Error(te(418));t=da(n.nextSibling);var r=Pn;t&&Dh(e,t)?Ky(r,n):(e.flags=e.flags&-4097|2,it=!1,Pn=e)}}else{if(Cp(e))throw Error(te(418));e.flags=e.flags&-4097|2,it=!1,Pn=e}}}function Oh(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Pn=e}function vl(e){if(e!==Pn)return!1;if(!it)return Oh(e),it=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!yp(e.type,e.memoizedProps)),t&&(t=_n)){if(Cp(e))throw Vy(),Error(te(418));for(;t;)Ky(e,t),t=da(t.nextSibling)}if(Oh(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(te(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){_n=da(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}_n=null}}else _n=Pn?da(e.stateNode.nextSibling):null;return!0}function Vy(){for(var e=_n;e;)e=da(e.nextSibling)}function Qo(){_n=Pn=null,it=!1}function $m(e){Yn===null?Yn=[e]:Yn.push(e)}var oj=Hr.ReactCurrentBatchConfig;function Rs(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(te(309));var r=n.stateNode}if(!r)throw Error(te(147,e));var a=r,o=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===o?t.ref:(t=function(i){var l=a.refs;i===null?delete l[o]:l[o]=i},t._stringRef=o,t)}if(typeof e!="string")throw Error(te(284));if(!n._owner)throw Error(te(290,e))}return e}function xl(e,t){throw e=Object.prototype.toString.call(t),Error(te(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Fh(e){var t=e._init;return t(e._payload)}function Gy(e){function t(v,g){if(e){var w=v.deletions;w===null?(v.deletions=[g],v.flags|=16):w.push(g)}}function n(v,g){if(!e)return null;for(;g!==null;)t(v,g),g=g.sibling;return null}function r(v,g){for(v=new Map;g!==null;)g.key!==null?v.set(g.key,g):v.set(g.index,g),g=g.sibling;return v}function a(v,g){return v=ha(v,g),v.index=0,v.sibling=null,v}function o(v,g,w){return v.index=w,e?(w=v.alternate,w!==null?(w=w.index,w<g?(v.flags|=2,g):w):(v.flags|=2,g)):(v.flags|=1048576,g)}function i(v){return e&&v.alternate===null&&(v.flags|=2),v}function l(v,g,w,k){return g===null||g.tag!==6?(g=md(w,v.mode,k),g.return=v,g):(g=a(g,w),g.return=v,g)}function c(v,g,w,k){var C=w.type;return C===bo?p(v,g,w.props.children,k,w.key):g!==null&&(g.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===ta&&Fh(C)===g.type)?(k=a(g,w.props),k.ref=Rs(v,g,w),k.return=v,k):(k=Kl(w.type,w.key,w.props,null,v.mode,k),k.ref=Rs(v,g,w),k.return=v,k)}function d(v,g,w,k){return g===null||g.tag!==4||g.stateNode.containerInfo!==w.containerInfo||g.stateNode.implementation!==w.implementation?(g=fd(w,v.mode,k),g.return=v,g):(g=a(g,w.children||[]),g.return=v,g)}function p(v,g,w,k,C){return g===null||g.tag!==7?(g=za(w,v.mode,k,C),g.return=v,g):(g=a(g,w),g.return=v,g)}function m(v,g,w){if(typeof g=="string"&&g!==""||typeof g=="number")return g=md(""+g,v.mode,w),g.return=v,g;if(typeof g=="object"&&g!==null){switch(g.$$typeof){case il:return w=Kl(g.type,g.key,g.props,null,v.mode,w),w.ref=Rs(v,null,g),w.return=v,w;case yo:return g=fd(g,v.mode,w),g.return=v,g;case ta:var k=g._init;return m(v,k(g._payload),w)}if(zs(g)||js(g))return g=za(g,v.mode,w,null),g.return=v,g;xl(v,g)}return null}function f(v,g,w,k){var C=g!==null?g.key:null;if(typeof w=="string"&&w!==""||typeof w=="number")return C!==null?null:l(v,g,""+w,k);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case il:return w.key===C?c(v,g,w,k):null;case yo:return w.key===C?d(v,g,w,k):null;case ta:return C=w._init,f(v,g,C(w._payload),k)}if(zs(w)||js(w))return C!==null?null:p(v,g,w,k,null);xl(v,w)}return null}function h(v,g,w,k,C){if(typeof k=="string"&&k!==""||typeof k=="number")return v=v.get(w)||null,l(g,v,""+k,C);if(typeof k=="object"&&k!==null){switch(k.$$typeof){case il:return v=v.get(k.key===null?w:k.key)||null,c(g,v,k,C);case yo:return v=v.get(k.key===null?w:k.key)||null,d(g,v,k,C);case ta:var N=k._init;return h(v,g,w,N(k._payload),C)}if(zs(k)||js(k))return v=v.get(w)||null,p(g,v,k,C,null);xl(g,k)}return null}function y(v,g,w,k){for(var C=null,N=null,S=g,A=g=0,E=null;S!==null&&A<w.length;A++){S.index>A?(E=S,S=null):E=S.sibling;var _=f(v,S,w[A],k);if(_===null){S===null&&(S=E);break}e&&S&&_.alternate===null&&t(v,S),g=o(_,g,A),N===null?C=_:N.sibling=_,N=_,S=E}if(A===w.length)return n(v,S),it&&Ma(v,A),C;if(S===null){for(;A<w.length;A++)S=m(v,w[A],k),S!==null&&(g=o(S,g,A),N===null?C=S:N.sibling=S,N=S);return it&&Ma(v,A),C}for(S=r(v,S);A<w.length;A++)E=h(S,v,A,w[A],k),E!==null&&(e&&E.alternate!==null&&S.delete(E.key===null?A:E.key),g=o(E,g,A),N===null?C=E:N.sibling=E,N=E);return e&&S.forEach(function(R){return t(v,R)}),it&&Ma(v,A),C}function x(v,g,w,k){var C=js(w);if(typeof C!="function")throw Error(te(150));if(w=C.call(w),w==null)throw Error(te(151));for(var N=C=null,S=g,A=g=0,E=null,_=w.next();S!==null&&!_.done;A++,_=w.next()){S.index>A?(E=S,S=null):E=S.sibling;var R=f(v,S,_.value,k);if(R===null){S===null&&(S=E);break}e&&S&&R.alternate===null&&t(v,S),g=o(R,g,A),N===null?C=R:N.sibling=R,N=R,S=E}if(_.done)return n(v,S),it&&Ma(v,A),C;if(S===null){for(;!_.done;A++,_=w.next())_=m(v,_.value,k),_!==null&&(g=o(_,g,A),N===null?C=_:N.sibling=_,N=_);return it&&Ma(v,A),C}for(S=r(v,S);!_.done;A++,_=w.next())_=h(S,v,A,_.value,k),_!==null&&(e&&_.alternate!==null&&S.delete(_.key===null?A:_.key),g=o(_,g,A),N===null?C=_:N.sibling=_,N=_);return e&&S.forEach(function(T){return t(v,T)}),it&&Ma(v,A),C}function b(v,g,w,k){if(typeof w=="object"&&w!==null&&w.type===bo&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case il:e:{for(var C=w.key,N=g;N!==null;){if(N.key===C){if(C=w.type,C===bo){if(N.tag===7){n(v,N.sibling),g=a(N,w.props.children),g.return=v,v=g;break e}}else if(N.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===ta&&Fh(C)===N.type){n(v,N.sibling),g=a(N,w.props),g.ref=Rs(v,N,w),g.return=v,v=g;break e}n(v,N);break}else t(v,N);N=N.sibling}w.type===bo?(g=za(w.props.children,v.mode,k,w.key),g.return=v,v=g):(k=Kl(w.type,w.key,w.props,null,v.mode,k),k.ref=Rs(v,g,w),k.return=v,v=k)}return i(v);case yo:e:{for(N=w.key;g!==null;){if(g.key===N)if(g.tag===4&&g.stateNode.containerInfo===w.containerInfo&&g.stateNode.implementation===w.implementation){n(v,g.sibling),g=a(g,w.children||[]),g.return=v,v=g;break e}else{n(v,g);break}else t(v,g);g=g.sibling}g=fd(w,v.mode,k),g.return=v,v=g}return i(v);case ta:return N=w._init,b(v,g,N(w._payload),k)}if(zs(w))return y(v,g,w,k);if(js(w))return x(v,g,w,k);xl(v,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,g!==null&&g.tag===6?(n(v,g.sibling),g=a(g,w),g.return=v,v=g):(n(v,g),g=md(w,v.mode,k),g.return=v,v=g),i(v)):n(v,g)}return b}var Xo=Gy(!0),Yy=Gy(!1),hc=Sa(null),gc=null,_o=null,Um=null;function Bm(){Um=_o=gc=null}function Hm(e){var t=hc.current;st(hc),e._currentValue=t}function Np(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Fo(e,t){gc=e,Um=_o=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(pn=!0),e.firstContext=null)}function Un(e){var t=e._currentValue;if(Um!==e)if(e={context:e,memoizedValue:t,next:null},_o===null){if(gc===null)throw Error(te(308));_o=e,gc.dependencies={lanes:0,firstContext:e}}else _o=_o.next=e;return t}var La=null;function Wm(e){La===null?La=[e]:La.push(e)}function Qy(e,t,n,r){var a=t.interleaved;return a===null?(n.next=n,Wm(t)):(n.next=a.next,a.next=n),t.interleaved=n,Or(e,r)}function Or(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 na=!1;function qm(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Xy(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 Ir(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function pa(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Ge&2){var a=r.pending;return a===null?t.next=t:(t.next=a.next,a.next=t),r.pending=t,Or(e,n)}return a=r.interleaved,a===null?(t.next=t,Wm(r)):(t.next=a.next,a.next=t),r.interleaved=t,Or(e,n)}function $l(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Tm(e,n)}}function zh(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var a=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var i={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?a=o=i:o=o.next=i,n=n.next}while(n!==null);o===null?a=o=t:o=o.next=t}else a=o=t;n={baseState:r.baseState,firstBaseUpdate:a,lastBaseUpdate:o,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function vc(e,t,n,r){var a=e.updateQueue;na=!1;var o=a.firstBaseUpdate,i=a.lastBaseUpdate,l=a.shared.pending;if(l!==null){a.shared.pending=null;var c=l,d=c.next;c.next=null,i===null?o=d:i.next=d,i=c;var p=e.alternate;p!==null&&(p=p.updateQueue,l=p.lastBaseUpdate,l!==i&&(l===null?p.firstBaseUpdate=d:l.next=d,p.lastBaseUpdate=c))}if(o!==null){var m=a.baseState;i=0,p=d=c=null,l=o;do{var f=l.lane,h=l.eventTime;if((r&f)===f){p!==null&&(p=p.next={eventTime:h,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var y=e,x=l;switch(f=t,h=n,x.tag){case 1:if(y=x.payload,typeof y=="function"){m=y.call(h,m,f);break e}m=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=x.payload,f=typeof y=="function"?y.call(h,m,f):y,f==null)break e;m=dt({},m,f);break e;case 2:na=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,f=a.effects,f===null?a.effects=[l]:f.push(l))}else h={eventTime:h,lane:f,tag:l.tag,payload:l.payload,callback:l.callback,next:null},p===null?(d=p=h,c=m):p=p.next=h,i|=f;if(l=l.next,l===null){if(l=a.shared.pending,l===null)break;f=l,l=f.next,f.next=null,a.lastBaseUpdate=f,a.shared.pending=null}}while(!0);if(p===null&&(c=m),a.baseState=c,a.firstBaseUpdate=d,a.lastBaseUpdate=p,t=a.shared.interleaved,t!==null){a=t;do i|=a.lane,a=a.next;while(a!==t)}else o===null&&(a.shared.lanes=0);Ka|=i,e.lanes=i,e.memoizedState=m}}function $h(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],a=r.callback;if(a!==null){if(r.callback=null,r=n,typeof a!="function")throw Error(te(191,a));a.call(r)}}}var Hi={},gr=Sa(Hi),yi=Sa(Hi),bi=Sa(Hi);function Da(e){if(e===Hi)throw Error(te(174));return e}function Km(e,t){switch(tt(bi,t),tt(yi,e),tt(gr,Hi),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:op(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=op(t,e)}st(gr),tt(gr,t)}function Jo(){st(gr),st(yi),st(bi)}function Jy(e){Da(bi.current);var t=Da(gr.current),n=op(t,e.type);t!==n&&(tt(yi,e),tt(gr,n))}function Vm(e){yi.current===e&&(st(gr),st(yi))}var ct=Sa(0);function xc(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 id=[];function Gm(){for(var e=0;e<id.length;e++)id[e]._workInProgressVersionPrimary=null;id.length=0}var Ul=Hr.ReactCurrentDispatcher,ld=Hr.ReactCurrentBatchConfig,qa=0,ut=null,Rt=null,Ot=null,yc=!1,Js=!1,wi=0,sj=0;function Yt(){throw Error(te(321))}function Ym(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Jn(e[n],t[n]))return!1;return!0}function Qm(e,t,n,r,a,o){if(qa=o,ut=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Ul.current=e===null||e.memoizedState===null?uj:dj,e=n(r,a),Js){o=0;do{if(Js=!1,wi=0,25<=o)throw Error(te(301));o+=1,Ot=Rt=null,t.updateQueue=null,Ul.current=pj,e=n(r,a)}while(Js)}if(Ul.current=bc,t=Rt!==null&&Rt.next!==null,qa=0,Ot=Rt=ut=null,yc=!1,t)throw Error(te(300));return e}function Xm(){var e=wi!==0;return wi=0,e}function ur(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ot===null?ut.memoizedState=Ot=e:Ot=Ot.next=e,Ot}function Bn(){if(Rt===null){var e=ut.alternate;e=e!==null?e.memoizedState:null}else e=Rt.next;var t=Ot===null?ut.memoizedState:Ot.next;if(t!==null)Ot=t,Rt=e;else{if(e===null)throw Error(te(310));Rt=e,e={memoizedState:Rt.memoizedState,baseState:Rt.baseState,baseQueue:Rt.baseQueue,queue:Rt.queue,next:null},Ot===null?ut.memoizedState=Ot=e:Ot=Ot.next=e}return Ot}function ki(e,t){return typeof t=="function"?t(e):t}function cd(e){var t=Bn(),n=t.queue;if(n===null)throw Error(te(311));n.lastRenderedReducer=e;var r=Rt,a=r.baseQueue,o=n.pending;if(o!==null){if(a!==null){var i=a.next;a.next=o.next,o.next=i}r.baseQueue=a=o,n.pending=null}if(a!==null){o=a.next,r=r.baseState;var l=i=null,c=null,d=o;do{var p=d.lane;if((qa&p)===p)c!==null&&(c=c.next={lane:0,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null}),r=d.hasEagerState?d.eagerState:e(r,d.action);else{var m={lane:p,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null};c===null?(l=c=m,i=r):c=c.next=m,ut.lanes|=p,Ka|=p}d=d.next}while(d!==null&&d!==o);c===null?i=r:c.next=l,Jn(r,t.memoizedState)||(pn=!0),t.memoizedState=r,t.baseState=i,t.baseQueue=c,n.lastRenderedState=r}if(e=n.interleaved,e!==null){a=e;do o=a.lane,ut.lanes|=o,Ka|=o,a=a.next;while(a!==e)}else a===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function ud(e){var t=Bn(),n=t.queue;if(n===null)throw Error(te(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var i=a=a.next;do o=e(o,i.action),i=i.next;while(i!==a);Jn(o,t.memoizedState)||(pn=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Zy(){}function eb(e,t){var n=ut,r=Bn(),a=t(),o=!Jn(r.memoizedState,a);if(o&&(r.memoizedState=a,pn=!0),r=r.queue,Jm(rb.bind(null,n,r,e),[e]),r.getSnapshot!==t||o||Ot!==null&&Ot.memoizedState.tag&1){if(n.flags|=2048,Ci(9,nb.bind(null,n,r,a,t),void 0,null),Ft===null)throw Error(te(349));qa&30||tb(n,t,a)}return a}function tb(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=ut.updateQueue,t===null?(t={lastEffect:null,stores:null},ut.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function nb(e,t,n,r){t.value=n,t.getSnapshot=r,ab(t)&&ob(e)}function rb(e,t,n){return n(function(){ab(t)&&ob(e)})}function ab(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Jn(e,n)}catch{return!0}}function ob(e){var t=Or(e,1);t!==null&&Xn(t,e,1,-1)}function Uh(e){var t=ur();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ki,lastRenderedState:e},t.queue=e,e=e.dispatch=cj.bind(null,ut,e),[t.memoizedState,e]}function Ci(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=ut.updateQueue,t===null?(t={lastEffect:null,stores:null},ut.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function sb(){return Bn().memoizedState}function Bl(e,t,n,r){var a=ur();ut.flags|=e,a.memoizedState=Ci(1|t,n,void 0,r===void 0?null:r)}function Zc(e,t,n,r){var a=Bn();r=r===void 0?null:r;var o=void 0;if(Rt!==null){var i=Rt.memoizedState;if(o=i.destroy,r!==null&&Ym(r,i.deps)){a.memoizedState=Ci(t,n,o,r);return}}ut.flags|=e,a.memoizedState=Ci(1|t,n,o,r)}function Bh(e,t){return Bl(8390656,8,e,t)}function Jm(e,t){return Zc(2048,8,e,t)}function ib(e,t){return Zc(4,2,e,t)}function lb(e,t){return Zc(4,4,e,t)}function cb(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 ub(e,t,n){return n=n!=null?n.concat([e]):null,Zc(4,4,cb.bind(null,t,e),n)}function Zm(){}function db(e,t){var n=Bn();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Ym(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function pb(e,t){var n=Bn();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Ym(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function mb(e,t,n){return qa&21?(Jn(n,t)||(n=xy(),ut.lanes|=n,Ka|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,pn=!0),e.memoizedState=n)}function ij(e,t){var n=Xe;Xe=n!==0&&4>n?n:4,e(!0);var r=ld.transition;ld.transition={};try{e(!1),t()}finally{Xe=n,ld.transition=r}}function fb(){return Bn().memoizedState}function lj(e,t,n){var r=fa(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},hb(e))gb(t,n);else if(n=Qy(e,t,n,r),n!==null){var a=an();Xn(n,e,r,a),vb(n,t,r)}}function cj(e,t,n){var r=fa(e),a={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(hb(e))gb(t,a);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var i=t.lastRenderedState,l=o(i,n);if(a.hasEagerState=!0,a.eagerState=l,Jn(l,i)){var c=t.interleaved;c===null?(a.next=a,Wm(t)):(a.next=c.next,c.next=a),t.interleaved=a;return}}catch{}finally{}n=Qy(e,t,a,r),n!==null&&(a=an(),Xn(n,e,r,a),vb(n,t,r))}}function hb(e){var t=e.alternate;return e===ut||t!==null&&t===ut}function gb(e,t){Js=yc=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function vb(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Tm(e,n)}}var bc={readContext:Un,useCallback:Yt,useContext:Yt,useEffect:Yt,useImperativeHandle:Yt,useInsertionEffect:Yt,useLayoutEffect:Yt,useMemo:Yt,useReducer:Yt,useRef:Yt,useState:Yt,useDebugValue:Yt,useDeferredValue:Yt,useTransition:Yt,useMutableSource:Yt,useSyncExternalStore:Yt,useId:Yt,unstable_isNewReconciler:!1},uj={readContext:Un,useCallback:function(e,t){return ur().memoizedState=[e,t===void 0?null:t],e},useContext:Un,useEffect:Bh,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Bl(4194308,4,cb.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Bl(4194308,4,e,t)},useInsertionEffect:function(e,t){return Bl(4,2,e,t)},useMemo:function(e,t){var n=ur();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=ur();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=lj.bind(null,ut,e),[r.memoizedState,e]},useRef:function(e){var t=ur();return e={current:e},t.memoizedState=e},useState:Uh,useDebugValue:Zm,useDeferredValue:function(e){return ur().memoizedState=e},useTransition:function(){var e=Uh(!1),t=e[0];return e=ij.bind(null,e[1]),ur().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=ut,a=ur();if(it){if(n===void 0)throw Error(te(407));n=n()}else{if(n=t(),Ft===null)throw Error(te(349));qa&30||tb(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,Bh(rb.bind(null,r,o,e),[e]),r.flags|=2048,Ci(9,nb.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=ur(),t=Ft.identifierPrefix;if(it){var n=Er,r=Mr;n=(r&~(1<<32-Qn(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=wi++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=sj++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},dj={readContext:Un,useCallback:db,useContext:Un,useEffect:Jm,useImperativeHandle:ub,useInsertionEffect:ib,useLayoutEffect:lb,useMemo:pb,useReducer:cd,useRef:sb,useState:function(){return cd(ki)},useDebugValue:Zm,useDeferredValue:function(e){var t=Bn();return mb(t,Rt.memoizedState,e)},useTransition:function(){var e=cd(ki)[0],t=Bn().memoizedState;return[e,t]},useMutableSource:Zy,useSyncExternalStore:eb,useId:fb,unstable_isNewReconciler:!1},pj={readContext:Un,useCallback:db,useContext:Un,useEffect:Jm,useImperativeHandle:ub,useInsertionEffect:ib,useLayoutEffect:lb,useMemo:pb,useReducer:ud,useRef:sb,useState:function(){return ud(ki)},useDebugValue:Zm,useDeferredValue:function(e){var t=Bn();return Rt===null?t.memoizedState=e:mb(t,Rt.memoizedState,e)},useTransition:function(){var e=ud(ki)[0],t=Bn().memoizedState;return[e,t]},useMutableSource:Zy,useSyncExternalStore:eb,useId:fb,unstable_isNewReconciler:!1};function Vn(e,t){if(e&&e.defaultProps){t=dt({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function jp(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:dt({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var eu={isMounted:function(e){return(e=e._reactInternals)?no(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=an(),a=fa(e),o=Ir(r,a);o.payload=t,n!=null&&(o.callback=n),t=pa(e,o,a),t!==null&&(Xn(t,e,a,r),$l(t,e,a))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=an(),a=fa(e),o=Ir(r,a);o.tag=1,o.payload=t,n!=null&&(o.callback=n),t=pa(e,o,a),t!==null&&(Xn(t,e,a,r),$l(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=an(),r=fa(e),a=Ir(n,r);a.tag=2,t!=null&&(a.callback=t),t=pa(e,a,r),t!==null&&(Xn(t,e,r,n),$l(t,e,r))}};function Hh(e,t,n,r,a,o,i){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,o,i):t.prototype&&t.prototype.isPureReactComponent?!hi(n,r)||!hi(a,o):!0}function xb(e,t,n){var r=!1,a=xa,o=t.contextType;return typeof o=="object"&&o!==null?o=Un(o):(a=fn(t)?Ha:Zt.current,r=t.contextTypes,o=(r=r!=null)?Yo(e,a):xa),t=new t(n,o),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=eu,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=a,e.__reactInternalMemoizedMaskedChildContext=o),t}function Wh(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&eu.enqueueReplaceState(t,t.state,null)}function Ap(e,t,n,r){var a=e.stateNode;a.props=n,a.state=e.memoizedState,a.refs={},qm(e);var o=t.contextType;typeof o=="object"&&o!==null?a.context=Un(o):(o=fn(t)?Ha:Zt.current,a.context=Yo(e,o)),a.state=e.memoizedState,o=t.getDerivedStateFromProps,typeof o=="function"&&(jp(e,t,o,n),a.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof a.getSnapshotBeforeUpdate=="function"||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(t=a.state,typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount(),t!==a.state&&eu.enqueueReplaceState(a,a.state,null),vc(e,n,a,r),a.state=e.memoizedState),typeof a.componentDidMount=="function"&&(e.flags|=4194308)}function Zo(e,t){try{var n="",r=t;do n+=$S(r),r=r.return;while(r);var a=n}catch(o){a=`
Error generating stack: `+o.message+`
`+o.stack}return{value:e,source:t,stack:a,digest:null}}function dd(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function _p(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var mj=typeof WeakMap=="function"?WeakMap:Map;function yb(e,t,n){n=Ir(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){kc||(kc=!0,Fp=r),_p(e,t)},n}function bb(e,t,n){n=Ir(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var a=t.value;n.payload=function(){return r(a)},n.callback=function(){_p(e,t)}}var o=e.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(n.callback=function(){_p(e,t),typeof r!="function"&&(ma===null?ma=new Set([this]):ma.add(this));var i=t.stack;this.componentDidCatch(t.value,{componentStack:i!==null?i:""})}),n}function qh(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new mj;var a=new Set;r.set(t,a)}else a=r.get(t),a===void 0&&(a=new Set,r.set(t,a));a.has(n)||(a.add(n),e=Aj.bind(null,e,t,n),t.then(e,e))}function Kh(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 Vh(e,t,n,r,a){return e.mode&1?(e.flags|=65536,e.lanes=a,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=Ir(-1,1),t.tag=2,pa(n,t,1))),n.lanes|=1),e)}var fj=Hr.ReactCurrentOwner,pn=!1;function rn(e,t,n,r){t.child=e===null?Yy(t,null,n,r):Xo(t,e.child,n,r)}function Gh(e,t,n,r,a){n=n.render;var o=t.ref;return Fo(t,a),r=Qm(e,t,n,r,o,a),n=Xm(),e!==null&&!pn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,Fr(e,t,a)):(it&&n&&Fm(t),t.flags|=1,rn(e,t,r,a),t.child)}function Yh(e,t,n,r,a){if(e===null){var o=n.type;return typeof o=="function"&&!lf(o)&&o.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=o,wb(e,t,o,r,a)):(e=Kl(n.type,null,r,t,t.mode,a),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,!(e.lanes&a)){var i=o.memoizedProps;if(n=n.compare,n=n!==null?n:hi,n(i,r)&&e.ref===t.ref)return Fr(e,t,a)}return t.flags|=1,e=ha(o,r),e.ref=t.ref,e.return=t,t.child=e}function wb(e,t,n,r,a){if(e!==null){var o=e.memoizedProps;if(hi(o,r)&&e.ref===t.ref)if(pn=!1,t.pendingProps=r=o,(e.lanes&a)!==0)e.flags&131072&&(pn=!0);else return t.lanes=e.lanes,Fr(e,t,a)}return Pp(e,t,n,r,a)}function kb(e,t,n){var r=t.pendingProps,a=r.children,o=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},tt(To,Nn),Nn|=n;else{if(!(n&1073741824))return e=o!==null?o.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,tt(To,Nn),Nn|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=o!==null?o.baseLanes:n,tt(To,Nn),Nn|=r}else o!==null?(r=o.baseLanes|n,t.memoizedState=null):r=n,tt(To,Nn),Nn|=r;return rn(e,t,a,n),t.child}function Cb(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Pp(e,t,n,r,a){var o=fn(n)?Ha:Zt.current;return o=Yo(t,o),Fo(t,a),n=Qm(e,t,n,r,o,a),r=Xm(),e!==null&&!pn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,Fr(e,t,a)):(it&&r&&Fm(t),t.flags|=1,rn(e,t,n,a),t.child)}function Qh(e,t,n,r,a){if(fn(n)){var o=!0;pc(t)}else o=!1;if(Fo(t,a),t.stateNode===null)Hl(e,t),xb(t,n,r),Ap(t,n,r,a),r=!0;else if(e===null){var i=t.stateNode,l=t.memoizedProps;i.props=l;var c=i.context,d=n.contextType;typeof d=="object"&&d!==null?d=Un(d):(d=fn(n)?Ha:Zt.current,d=Yo(t,d));var p=n.getDerivedStateFromProps,m=typeof p=="function"||typeof i.getSnapshotBeforeUpdate=="function";m||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(l!==r||c!==d)&&Wh(t,i,r,d),na=!1;var f=t.memoizedState;i.state=f,vc(t,r,i,a),c=t.memoizedState,l!==r||f!==c||mn.current||na?(typeof p=="function"&&(jp(t,n,p,r),c=t.memoizedState),(l=na||Hh(t,n,l,r,f,c,d))?(m||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount()),typeof i.componentDidMount=="function"&&(t.flags|=4194308)):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=c),i.props=r,i.state=c,i.context=d,r=l):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{i=t.stateNode,Xy(e,t),l=t.memoizedProps,d=t.type===t.elementType?l:Vn(t.type,l),i.props=d,m=t.pendingProps,f=i.context,c=n.contextType,typeof c=="object"&&c!==null?c=Un(c):(c=fn(n)?Ha:Zt.current,c=Yo(t,c));var h=n.getDerivedStateFromProps;(p=typeof h=="function"||typeof i.getSnapshotBeforeUpdate=="function")||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(l!==m||f!==c)&&Wh(t,i,r,c),na=!1,f=t.memoizedState,i.state=f,vc(t,r,i,a);var y=t.memoizedState;l!==m||f!==y||mn.current||na?(typeof h=="function"&&(jp(t,n,h,r),y=t.memoizedState),(d=na||Hh(t,n,d,r,f,y,c)||!1)?(p||typeof i.UNSAFE_componentWillUpdate!="function"&&typeof i.componentWillUpdate!="function"||(typeof i.componentWillUpdate=="function"&&i.componentWillUpdate(r,y,c),typeof i.UNSAFE_componentWillUpdate=="function"&&i.UNSAFE_componentWillUpdate(r,y,c)),typeof i.componentDidUpdate=="function"&&(t.flags|=4),typeof i.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof i.componentDidUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=y),i.props=r,i.state=y,i.context=c,r=d):(typeof i.componentDidUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return Tp(e,t,n,r,o,a)}function Tp(e,t,n,r,a,o){Cb(e,t);var i=(t.flags&128)!==0;if(!r&&!i)return a&&Lh(t,n,!1),Fr(e,t,o);r=t.stateNode,fj.current=t;var l=i&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&i?(t.child=Xo(t,e.child,null,o),t.child=Xo(t,null,l,o)):rn(e,t,l,o),t.memoizedState=r.state,a&&Lh(t,n,!0),t.child}function Sb(e){var t=e.stateNode;t.pendingContext?Ih(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Ih(e,t.context,!1),Km(e,t.containerInfo)}function Xh(e,t,n,r,a){return Qo(),$m(a),t.flags|=256,rn(e,t,n,r),t.child}var Rp={dehydrated:null,treeContext:null,retryLane:0};function Mp(e){return{baseLanes:e,cachePool:null,transitions:null}}function Nb(e,t,n){var r=t.pendingProps,a=ct.current,o=!1,i=(t.flags&128)!==0,l;if((l=i)||(l=e!==null&&e.memoizedState===null?!1:(a&2)!==0),l?(o=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(a|=1),tt(ct,a&1),e===null)return Sp(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):(i=r.children,e=r.fallback,o?(r=t.mode,o=t.child,i={mode:"hidden",children:i},!(r&1)&&o!==null?(o.childLanes=0,o.pendingProps=i):o=ru(i,r,0,null),e=za(e,r,n,null),o.return=t,e.return=t,o.sibling=e,t.child=o,t.child.memoizedState=Mp(n),t.memoizedState=Rp,e):ef(t,i));if(a=e.memoizedState,a!==null&&(l=a.dehydrated,l!==null))return hj(e,t,i,r,l,a,n);if(o){o=r.fallback,i=t.mode,a=e.child,l=a.sibling;var c={mode:"hidden",children:r.children};return!(i&1)&&t.child!==a?(r=t.child,r.childLanes=0,r.pendingProps=c,t.deletions=null):(r=ha(a,c),r.subtreeFlags=a.subtreeFlags&14680064),l!==null?o=ha(l,o):(o=za(o,i,n,null),o.flags|=2),o.return=t,r.return=t,r.sibling=o,t.child=r,r=o,o=t.child,i=e.child.memoizedState,i=i===null?Mp(n):{baseLanes:i.baseLanes|n,cachePool:null,transitions:i.transitions},o.memoizedState=i,o.childLanes=e.childLanes&~n,t.memoizedState=Rp,r}return o=e.child,e=o.sibling,r=ha(o,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function ef(e,t){return t=ru({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function yl(e,t,n,r){return r!==null&&$m(r),Xo(t,e.child,null,n),e=ef(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function hj(e,t,n,r,a,o,i){if(n)return t.flags&256?(t.flags&=-257,r=dd(Error(te(422))),yl(e,t,i,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(o=r.fallback,a=t.mode,r=ru({mode:"visible",children:r.children},a,0,null),o=za(o,a,i,null),o.flags|=2,r.return=t,o.return=t,r.sibling=o,t.child=r,t.mode&1&&Xo(t,e.child,null,i),t.child.memoizedState=Mp(i),t.memoizedState=Rp,o);if(!(t.mode&1))return yl(e,t,i,null);if(a.data==="$!"){if(r=a.nextSibling&&a.nextSibling.dataset,r)var l=r.dgst;return r=l,o=Error(te(419)),r=dd(o,r,void 0),yl(e,t,i,r)}if(l=(i&e.childLanes)!==0,pn||l){if(r=Ft,r!==null){switch(i&-i){case 4:a=2;break;case 16:a=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:a=32;break;case 536870912:a=268435456;break;default:a=0}a=a&(r.suspendedLanes|i)?0:a,a!==0&&a!==o.retryLane&&(o.retryLane=a,Or(e,a),Xn(r,e,a,-1))}return sf(),r=dd(Error(te(421))),yl(e,t,i,r)}return a.data==="$?"?(t.flags|=128,t.child=e.child,t=_j.bind(null,e),a._reactRetry=t,null):(e=o.treeContext,_n=da(a.nextSibling),Pn=t,it=!0,Yn=null,e!==null&&(Dn[On++]=Mr,Dn[On++]=Er,Dn[On++]=Wa,Mr=e.id,Er=e.overflow,Wa=t),t=ef(t,r.children),t.flags|=4096,t)}function Jh(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Np(e.return,t,n)}function pd(e,t,n,r,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=a)}function jb(e,t,n){var r=t.pendingProps,a=r.revealOrder,o=r.tail;if(rn(e,t,r.children,n),r=ct.current,r&2)r=r&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&&Jh(e,n,t);else if(e.tag===19)Jh(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}r&=1}if(tt(ct,r),!(t.mode&1))t.memoizedState=null;else switch(a){case"forwards":for(n=t.child,a=null;n!==null;)e=n.alternate,e!==null&&xc(e)===null&&(a=n),n=n.sibling;n=a,n===null?(a=t.child,t.child=null):(a=n.sibling,n.sibling=null),pd(t,!1,a,n,o);break;case"backwards":for(n=null,a=t.child,t.child=null;a!==null;){if(e=a.alternate,e!==null&&xc(e)===null){t.child=a;break}e=a.sibling,a.sibling=n,n=a,a=e}pd(t,!0,n,null,o);break;case"together":pd(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Hl(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Fr(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Ka|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(te(153));if(t.child!==null){for(e=t.child,n=ha(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ha(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function gj(e,t,n){switch(t.tag){case 3:Sb(t),Qo();break;case 5:Jy(t);break;case 1:fn(t.type)&&pc(t);break;case 4:Km(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,a=t.memoizedProps.value;tt(hc,r._currentValue),r._currentValue=a;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(tt(ct,ct.current&1),t.flags|=128,null):n&t.child.childLanes?Nb(e,t,n):(tt(ct,ct.current&1),e=Fr(e,t,n),e!==null?e.sibling:null);tt(ct,ct.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return jb(e,t,n);t.flags|=128}if(a=t.memoizedState,a!==null&&(a.rendering=null,a.tail=null,a.lastEffect=null),tt(ct,ct.current),r)break;return null;case 22:case 23:return t.lanes=0,kb(e,t,n)}return Fr(e,t,n)}var Ab,Ep,_b,Pb;Ab=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}};Ep=function(){};_b=function(e,t,n,r){var a=e.memoizedProps;if(a!==r){e=t.stateNode,Da(gr.current);var o=null;switch(n){case"input":a=tp(e,a),r=tp(e,r),o=[];break;case"select":a=dt({},a,{value:void 0}),r=dt({},r,{value:void 0}),o=[];break;case"textarea":a=ap(e,a),r=ap(e,r),o=[];break;default:typeof a.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=uc)}sp(n,r);var i;n=null;for(d in a)if(!r.hasOwnProperty(d)&&a.hasOwnProperty(d)&&a[d]!=null)if(d==="style"){var l=a[d];for(i in l)l.hasOwnProperty(i)&&(n||(n={}),n[i]="")}else d!=="dangerouslySetInnerHTML"&&d!=="children"&&d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&d!=="autoFocus"&&(li.hasOwnProperty(d)?o||(o=[]):(o=o||[]).push(d,null));for(d in r){var c=r[d];if(l=a!=null?a[d]:void 0,r.hasOwnProperty(d)&&c!==l&&(c!=null||l!=null))if(d==="style")if(l){for(i in l)!l.hasOwnProperty(i)||c&&c.hasOwnProperty(i)||(n||(n={}),n[i]="");for(i in c)c.hasOwnProperty(i)&&l[i]!==c[i]&&(n||(n={}),n[i]=c[i])}else n||(o||(o=[]),o.push(d,n)),n=c;else d==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,l=l?l.__html:void 0,c!=null&&l!==c&&(o=o||[]).push(d,c)):d==="children"?typeof c!="string"&&typeof c!="number"||(o=o||[]).push(d,""+c):d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&(li.hasOwnProperty(d)?(c!=null&&d==="onScroll"&&ot("scroll",e),o||l===c||(o=[])):(o=o||[]).push(d,c))}n&&(o=o||[]).push("style",n);var d=o;(t.updateQueue=d)&&(t.flags|=4)}};Pb=function(e,t,n,r){n!==r&&(t.flags|=4)};function Ms(e,t){if(!it)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 r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Qt(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var a=e.child;a!==null;)n|=a.lanes|a.childLanes,r|=a.subtreeFlags&14680064,r|=a.flags&14680064,a.return=e,a=a.sibling;else for(a=e.child;a!==null;)n|=a.lanes|a.childLanes,r|=a.subtreeFlags,r|=a.flags,a.return=e,a=a.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function vj(e,t,n){var r=t.pendingProps;switch(zm(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Qt(t),null;case 1:return fn(t.type)&&dc(),Qt(t),null;case 3:return r=t.stateNode,Jo(),st(mn),st(Zt),Gm(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(vl(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Yn!==null&&(Up(Yn),Yn=null))),Ep(e,t),Qt(t),null;case 5:Vm(t);var a=Da(bi.current);if(n=t.type,e!==null&&t.stateNode!=null)_b(e,t,n,r,a),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(te(166));return Qt(t),null}if(e=Da(gr.current),vl(t)){r=t.stateNode,n=t.type;var o=t.memoizedProps;switch(r[dr]=t,r[xi]=o,e=(t.mode&1)!==0,n){case"dialog":ot("cancel",r),ot("close",r);break;case"iframe":case"object":case"embed":ot("load",r);break;case"video":case"audio":for(a=0;a<Us.length;a++)ot(Us[a],r);break;case"source":ot("error",r);break;case"img":case"image":case"link":ot("error",r),ot("load",r);break;case"details":ot("toggle",r);break;case"input":ih(r,o),ot("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!o.multiple},ot("invalid",r);break;case"textarea":ch(r,o),ot("invalid",r)}sp(n,o),a=null;for(var i in o)if(o.hasOwnProperty(i)){var l=o[i];i==="children"?typeof l=="string"?r.textContent!==l&&(o.suppressHydrationWarning!==!0&&gl(r.textContent,l,e),a=["children",l]):typeof l=="number"&&r.textContent!==""+l&&(o.suppressHydrationWarning!==!0&&gl(r.textContent,l,e),a=["children",""+l]):li.hasOwnProperty(i)&&l!=null&&i==="onScroll"&&ot("scroll",r)}switch(n){case"input":ll(r),lh(r,o,!0);break;case"textarea":ll(r),uh(r);break;case"select":case"option":break;default:typeof o.onClick=="function"&&(r.onclick=uc)}r=a,t.updateQueue=r,r!==null&&(t.flags|=4)}else{i=a.nodeType===9?a:a.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=ry(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=i.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=i.createElement(n,{is:r.is}):(e=i.createElement(n),n==="select"&&(i=e,r.multiple?i.multiple=!0:r.size&&(i.size=r.size))):e=i.createElementNS(e,n),e[dr]=t,e[xi]=r,Ab(e,t,!1,!1),t.stateNode=e;e:{switch(i=ip(n,r),n){case"dialog":ot("cancel",e),ot("close",e),a=r;break;case"iframe":case"object":case"embed":ot("load",e),a=r;break;case"video":case"audio":for(a=0;a<Us.length;a++)ot(Us[a],e);a=r;break;case"source":ot("error",e),a=r;break;case"img":case"image":case"link":ot("error",e),ot("load",e),a=r;break;case"details":ot("toggle",e),a=r;break;case"input":ih(e,r),a=tp(e,r),ot("invalid",e);break;case"option":a=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},a=dt({},r,{value:void 0}),ot("invalid",e);break;case"textarea":ch(e,r),a=ap(e,r),ot("invalid",e);break;default:a=r}sp(n,a),l=a;for(o in l)if(l.hasOwnProperty(o)){var c=l[o];o==="style"?sy(e,c):o==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&ay(e,c)):o==="children"?typeof c=="string"?(n!=="textarea"||c!=="")&&ci(e,c):typeof c=="number"&&ci(e,""+c):o!=="suppressContentEditableWarning"&&o!=="suppressHydrationWarning"&&o!=="autoFocus"&&(li.hasOwnProperty(o)?c!=null&&o==="onScroll"&&ot("scroll",e):c!=null&&Sm(e,o,c,i))}switch(n){case"input":ll(e),lh(e,r,!1);break;case"textarea":ll(e),uh(e);break;case"option":r.value!=null&&e.setAttribute("value",""+va(r.value));break;case"select":e.multiple=!!r.multiple,o=r.value,o!=null?Io(e,!!r.multiple,o,!1):r.defaultValue!=null&&Io(e,!!r.multiple,r.defaultValue,!0);break;default:typeof a.onClick=="function"&&(e.onclick=uc)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Qt(t),null;case 6:if(e&&t.stateNode!=null)Pb(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(te(166));if(n=Da(bi.current),Da(gr.current),vl(t)){if(r=t.stateNode,n=t.memoizedProps,r[dr]=t,(o=r.nodeValue!==n)&&(e=Pn,e!==null))switch(e.tag){case 3:gl(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&gl(r.nodeValue,n,(e.mode&1)!==0)}o&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[dr]=t,t.stateNode=r}return Qt(t),null;case 13:if(st(ct),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(it&&_n!==null&&t.mode&1&&!(t.flags&128))Vy(),Qo(),t.flags|=98560,o=!1;else if(o=vl(t),r!==null&&r.dehydrated!==null){if(e===null){if(!o)throw Error(te(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(te(317));o[dr]=t}else Qo(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Qt(t),o=!1}else Yn!==null&&(Up(Yn),Yn=null),o=!0;if(!o)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||ct.current&1?Mt===0&&(Mt=3):sf())),t.updateQueue!==null&&(t.flags|=4),Qt(t),null);case 4:return Jo(),Ep(e,t),e===null&&gi(t.stateNode.containerInfo),Qt(t),null;case 10:return Hm(t.type._context),Qt(t),null;case 17:return fn(t.type)&&dc(),Qt(t),null;case 19:if(st(ct),o=t.memoizedState,o===null)return Qt(t),null;if(r=(t.flags&128)!==0,i=o.rendering,i===null)if(r)Ms(o,!1);else{if(Mt!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(i=xc(e),i!==null){for(t.flags|=128,Ms(o,!1),r=i.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)o=n,e=r,o.flags&=14680066,i=o.alternate,i===null?(o.childLanes=0,o.lanes=e,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=i.childLanes,o.lanes=i.lanes,o.child=i.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=i.memoizedProps,o.memoizedState=i.memoizedState,o.updateQueue=i.updateQueue,o.type=i.type,e=i.dependencies,o.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return tt(ct,ct.current&1|2),t.child}e=e.sibling}o.tail!==null&&bt()>es&&(t.flags|=128,r=!0,Ms(o,!1),t.lanes=4194304)}else{if(!r)if(e=xc(i),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Ms(o,!0),o.tail===null&&o.tailMode==="hidden"&&!i.alternate&&!it)return Qt(t),null}else 2*bt()-o.renderingStartTime>es&&n!==1073741824&&(t.flags|=128,r=!0,Ms(o,!1),t.lanes=4194304);o.isBackwards?(i.sibling=t.child,t.child=i):(n=o.last,n!==null?n.sibling=i:t.child=i,o.last=i)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=bt(),t.sibling=null,n=ct.current,tt(ct,r?n&1|2:n&1),t):(Qt(t),null);case 22:case 23:return of(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Nn&1073741824&&(Qt(t),t.subtreeFlags&6&&(t.flags|=8192)):Qt(t),null;case 24:return null;case 25:return null}throw Error(te(156,t.tag))}function xj(e,t){switch(zm(t),t.tag){case 1:return fn(t.type)&&dc(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Jo(),st(mn),st(Zt),Gm(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Vm(t),null;case 13:if(st(ct),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(te(340));Qo()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return st(ct),null;case 4:return Jo(),null;case 10:return Hm(t.type._context),null;case 22:case 23:return of(),null;case 24:return null;default:return null}}var bl=!1,Xt=!1,yj=typeof WeakSet=="function"?WeakSet:Set,ge=null;function Po(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){ht(e,t,r)}else n.current=null}function Ip(e,t,n){try{n()}catch(r){ht(e,t,r)}}var Zh=!1;function bj(e,t){if(vp=ic,e=Iy(),Om(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var i=0,l=-1,c=-1,d=0,p=0,m=e,f=null;t:for(;;){for(var h;m!==n||a!==0&&m.nodeType!==3||(l=i+a),m!==o||r!==0&&m.nodeType!==3||(c=i+r),m.nodeType===3&&(i+=m.nodeValue.length),(h=m.firstChild)!==null;)f=m,m=h;for(;;){if(m===e)break t;if(f===n&&++d===a&&(l=i),f===o&&++p===r&&(c=i),(h=m.nextSibling)!==null)break;m=f,f=m.parentNode}m=h}n=l===-1||c===-1?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(xp={focusedElem:e,selectionRange:n},ic=!1,ge=t;ge!==null;)if(t=ge,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ge=e;else for(;ge!==null;){t=ge;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 x=y.memoizedProps,b=y.memoizedState,v=t.stateNode,g=v.getSnapshotBeforeUpdate(t.elementType===t.type?x:Vn(t.type,x),b);v.__reactInternalSnapshotBeforeUpdate=g}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(te(163))}}catch(k){ht(t,t.return,k)}if(e=t.sibling,e!==null){e.return=t.return,ge=e;break}ge=t.return}return y=Zh,Zh=!1,y}function Zs(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var a=r=r.next;do{if((a.tag&e)===e){var o=a.destroy;a.destroy=void 0,o!==void 0&&Ip(t,n,o)}a=a.next}while(a!==r)}}function tu(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 r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Lp(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 Tb(e){var t=e.alternate;t!==null&&(e.alternate=null,Tb(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[dr],delete t[xi],delete t[wp],delete t[nj],delete t[rj])),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 Rb(e){return e.tag===5||e.tag===3||e.tag===4}function eg(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Rb(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 Dp(e,t,n){var r=e.tag;if(r===5||r===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=uc));else if(r!==4&&(e=e.child,e!==null))for(Dp(e,t,n),e=e.sibling;e!==null;)Dp(e,t,n),e=e.sibling}function Op(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Op(e,t,n),e=e.sibling;e!==null;)Op(e,t,n),e=e.sibling}var Bt=null,Gn=!1;function Qr(e,t,n){for(n=n.child;n!==null;)Mb(e,t,n),n=n.sibling}function Mb(e,t,n){if(hr&&typeof hr.onCommitFiberUnmount=="function")try{hr.onCommitFiberUnmount(Vc,n)}catch{}switch(n.tag){case 5:Xt||Po(n,t);case 6:var r=Bt,a=Gn;Bt=null,Qr(e,t,n),Bt=r,Gn=a,Bt!==null&&(Gn?(e=Bt,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Bt.removeChild(n.stateNode));break;case 18:Bt!==null&&(Gn?(e=Bt,n=n.stateNode,e.nodeType===8?od(e.parentNode,n):e.nodeType===1&&od(e,n),mi(e)):od(Bt,n.stateNode));break;case 4:r=Bt,a=Gn,Bt=n.stateNode.containerInfo,Gn=!0,Qr(e,t,n),Bt=r,Gn=a;break;case 0:case 11:case 14:case 15:if(!Xt&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){a=r=r.next;do{var o=a,i=o.destroy;o=o.tag,i!==void 0&&(o&2||o&4)&&Ip(n,t,i),a=a.next}while(a!==r)}Qr(e,t,n);break;case 1:if(!Xt&&(Po(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){ht(n,t,l)}Qr(e,t,n);break;case 21:Qr(e,t,n);break;case 22:n.mode&1?(Xt=(r=Xt)||n.memoizedState!==null,Qr(e,t,n),Xt=r):Qr(e,t,n);break;default:Qr(e,t,n)}}function tg(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new yj),t.forEach(function(r){var a=Pj.bind(null,e,r);n.has(r)||(n.add(r),r.then(a,a))})}}function Kn(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r];try{var o=e,i=t,l=i;e:for(;l!==null;){switch(l.tag){case 5:Bt=l.stateNode,Gn=!1;break e;case 3:Bt=l.stateNode.containerInfo,Gn=!0;break e;case 4:Bt=l.stateNode.containerInfo,Gn=!0;break e}l=l.return}if(Bt===null)throw Error(te(160));Mb(o,i,a),Bt=null,Gn=!1;var c=a.alternate;c!==null&&(c.return=null),a.return=null}catch(d){ht(a,t,d)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Eb(t,e),t=t.sibling}function Eb(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Kn(t,e),lr(e),r&4){try{Zs(3,e,e.return),tu(3,e)}catch(x){ht(e,e.return,x)}try{Zs(5,e,e.return)}catch(x){ht(e,e.return,x)}}break;case 1:Kn(t,e),lr(e),r&512&&n!==null&&Po(n,n.return);break;case 5:if(Kn(t,e),lr(e),r&512&&n!==null&&Po(n,n.return),e.flags&32){var a=e.stateNode;try{ci(a,"")}catch(x){ht(e,e.return,x)}}if(r&4&&(a=e.stateNode,a!=null)){var o=e.memoizedProps,i=n!==null?n.memoizedProps:o,l=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{l==="input"&&o.type==="radio"&&o.name!=null&&ty(a,o),ip(l,i);var d=ip(l,o);for(i=0;i<c.length;i+=2){var p=c[i],m=c[i+1];p==="style"?sy(a,m):p==="dangerouslySetInnerHTML"?ay(a,m):p==="children"?ci(a,m):Sm(a,p,m,d)}switch(l){case"input":np(a,o);break;case"textarea":ny(a,o);break;case"select":var f=a._wrapperState.wasMultiple;a._wrapperState.wasMultiple=!!o.multiple;var h=o.value;h!=null?Io(a,!!o.multiple,h,!1):f!==!!o.multiple&&(o.defaultValue!=null?Io(a,!!o.multiple,o.defaultValue,!0):Io(a,!!o.multiple,o.multiple?[]:"",!1))}a[xi]=o}catch(x){ht(e,e.return,x)}}break;case 6:if(Kn(t,e),lr(e),r&4){if(e.stateNode===null)throw Error(te(162));a=e.stateNode,o=e.memoizedProps;try{a.nodeValue=o}catch(x){ht(e,e.return,x)}}break;case 3:if(Kn(t,e),lr(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{mi(t.containerInfo)}catch(x){ht(e,e.return,x)}break;case 4:Kn(t,e),lr(e);break;case 13:Kn(t,e),lr(e),a=e.child,a.flags&8192&&(o=a.memoizedState!==null,a.stateNode.isHidden=o,!o||a.alternate!==null&&a.alternate.memoizedState!==null||(rf=bt())),r&4&&tg(e);break;case 22:if(p=n!==null&&n.memoizedState!==null,e.mode&1?(Xt=(d=Xt)||p,Kn(t,e),Xt=d):Kn(t,e),lr(e),r&8192){if(d=e.memoizedState!==null,(e.stateNode.isHidden=d)&&!p&&e.mode&1)for(ge=e,p=e.child;p!==null;){for(m=ge=p;ge!==null;){switch(f=ge,h=f.child,f.tag){case 0:case 11:case 14:case 15:Zs(4,f,f.return);break;case 1:Po(f,f.return);var y=f.stateNode;if(typeof y.componentWillUnmount=="function"){r=f,n=f.return;try{t=r,y.props=t.memoizedProps,y.state=t.memoizedState,y.componentWillUnmount()}catch(x){ht(r,n,x)}}break;case 5:Po(f,f.return);break;case 22:if(f.memoizedState!==null){rg(m);continue}}h!==null?(h.return=f,ge=h):rg(m)}p=p.sibling}e:for(p=null,m=e;;){if(m.tag===5){if(p===null){p=m;try{a=m.stateNode,d?(o=a.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none"):(l=m.stateNode,c=m.memoizedProps.style,i=c!=null&&c.hasOwnProperty("display")?c.display:null,l.style.display=oy("display",i))}catch(x){ht(e,e.return,x)}}}else if(m.tag===6){if(p===null)try{m.stateNode.nodeValue=d?"":m.memoizedProps}catch(x){ht(e,e.return,x)}}else if((m.tag!==22&&m.tag!==23||m.memoizedState===null||m===e)&&m.child!==null){m.child.return=m,m=m.child;continue}if(m===e)break e;for(;m.sibling===null;){if(m.return===null||m.return===e)break e;p===m&&(p=null),m=m.return}p===m&&(p=null),m.sibling.return=m.return,m=m.sibling}}break;case 19:Kn(t,e),lr(e),r&4&&tg(e);break;case 21:break;default:Kn(t,e),lr(e)}}function lr(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(Rb(n)){var r=n;break e}n=n.return}throw Error(te(160))}switch(r.tag){case 5:var a=r.stateNode;r.flags&32&&(ci(a,""),r.flags&=-33);var o=eg(e);Op(e,o,a);break;case 3:case 4:var i=r.stateNode.containerInfo,l=eg(e);Dp(e,l,i);break;default:throw Error(te(161))}}catch(c){ht(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function wj(e,t,n){ge=e,Ib(e)}function Ib(e,t,n){for(var r=(e.mode&1)!==0;ge!==null;){var a=ge,o=a.child;if(a.tag===22&&r){var i=a.memoizedState!==null||bl;if(!i){var l=a.alternate,c=l!==null&&l.memoizedState!==null||Xt;l=bl;var d=Xt;if(bl=i,(Xt=c)&&!d)for(ge=a;ge!==null;)i=ge,c=i.child,i.tag===22&&i.memoizedState!==null?ag(a):c!==null?(c.return=i,ge=c):ag(a);for(;o!==null;)ge=o,Ib(o),o=o.sibling;ge=a,bl=l,Xt=d}ng(e)}else a.subtreeFlags&8772&&o!==null?(o.return=a,ge=o):ng(e)}}function ng(e){for(;ge!==null;){var t=ge;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Xt||tu(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Xt)if(n===null)r.componentDidMount();else{var a=t.elementType===t.type?n.memoizedProps:Vn(t.type,n.memoizedProps);r.componentDidUpdate(a,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var o=t.updateQueue;o!==null&&$h(t,o,r);break;case 3:var i=t.updateQueue;if(i!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}$h(t,i,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 p=d.memoizedState;if(p!==null){var m=p.dehydrated;m!==null&&mi(m)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(te(163))}Xt||t.flags&512&&Lp(t)}catch(f){ht(t,t.return,f)}}if(t===e){ge=null;break}if(n=t.sibling,n!==null){n.return=t.return,ge=n;break}ge=t.return}}function rg(e){for(;ge!==null;){var t=ge;if(t===e){ge=null;break}var n=t.sibling;if(n!==null){n.return=t.return,ge=n;break}ge=t.return}}function ag(e){for(;ge!==null;){var t=ge;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{tu(4,t)}catch(c){ht(t,n,c)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var a=t.return;try{r.componentDidMount()}catch(c){ht(t,a,c)}}var o=t.return;try{Lp(t)}catch(c){ht(t,o,c)}break;case 5:var i=t.return;try{Lp(t)}catch(c){ht(t,i,c)}}}catch(c){ht(t,t.return,c)}if(t===e){ge=null;break}var l=t.sibling;if(l!==null){l.return=t.return,ge=l;break}ge=t.return}}var kj=Math.ceil,wc=Hr.ReactCurrentDispatcher,tf=Hr.ReactCurrentOwner,zn=Hr.ReactCurrentBatchConfig,Ge=0,Ft=null,Nt=null,Wt=0,Nn=0,To=Sa(0),Mt=0,Si=null,Ka=0,nu=0,nf=0,ei=null,dn=null,rf=0,es=1/0,Tr=null,kc=!1,Fp=null,ma=null,wl=!1,ia=null,Cc=0,ti=0,zp=null,Wl=-1,ql=0;function an(){return Ge&6?bt():Wl!==-1?Wl:Wl=bt()}function fa(e){return e.mode&1?Ge&2&&Wt!==0?Wt&-Wt:oj.transition!==null?(ql===0&&(ql=xy()),ql):(e=Xe,e!==0||(e=window.event,e=e===void 0?16:Ny(e.type)),e):1}function Xn(e,t,n,r){if(50<ti)throw ti=0,zp=null,Error(te(185));$i(e,n,r),(!(Ge&2)||e!==Ft)&&(e===Ft&&(!(Ge&2)&&(nu|=n),Mt===4&&aa(e,Wt)),hn(e,r),n===1&&Ge===0&&!(t.mode&1)&&(es=bt()+500,Jc&&Na()))}function hn(e,t){var n=e.callbackNode;oN(e,t);var r=sc(e,e===Ft?Wt:0);if(r===0)n!==null&&mh(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&mh(n),t===1)e.tag===0?aj(og.bind(null,e)):Wy(og.bind(null,e)),ej(function(){!(Ge&6)&&Na()}),n=null;else{switch(yy(r)){case 1:n=Pm;break;case 4:n=gy;break;case 16:n=oc;break;case 536870912:n=vy;break;default:n=oc}n=Bb(n,Lb.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Lb(e,t){if(Wl=-1,ql=0,Ge&6)throw Error(te(327));var n=e.callbackNode;if(zo()&&e.callbackNode!==n)return null;var r=sc(e,e===Ft?Wt:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Sc(e,r);else{t=r;var a=Ge;Ge|=2;var o=Ob();(Ft!==e||Wt!==t)&&(Tr=null,es=bt()+500,Fa(e,t));do try{Nj();break}catch(l){Db(e,l)}while(!0);Bm(),wc.current=o,Ge=a,Nt!==null?t=0:(Ft=null,Wt=0,t=Mt)}if(t!==0){if(t===2&&(a=pp(e),a!==0&&(r=a,t=$p(e,a))),t===1)throw n=Si,Fa(e,0),aa(e,r),hn(e,bt()),n;if(t===6)aa(e,r);else{if(a=e.current.alternate,!(r&30)&&!Cj(a)&&(t=Sc(e,r),t===2&&(o=pp(e),o!==0&&(r=o,t=$p(e,o))),t===1))throw n=Si,Fa(e,0),aa(e,r),hn(e,bt()),n;switch(e.finishedWork=a,e.finishedLanes=r,t){case 0:case 1:throw Error(te(345));case 2:Ea(e,dn,Tr);break;case 3:if(aa(e,r),(r&130023424)===r&&(t=rf+500-bt(),10<t)){if(sc(e,0)!==0)break;if(a=e.suspendedLanes,(a&r)!==r){an(),e.pingedLanes|=e.suspendedLanes&a;break}e.timeoutHandle=bp(Ea.bind(null,e,dn,Tr),t);break}Ea(e,dn,Tr);break;case 4:if(aa(e,r),(r&4194240)===r)break;for(t=e.eventTimes,a=-1;0<r;){var i=31-Qn(r);o=1<<i,i=t[i],i>a&&(a=i),r&=~o}if(r=a,r=bt()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*kj(r/1960))-r,10<r){e.timeoutHandle=bp(Ea.bind(null,e,dn,Tr),r);break}Ea(e,dn,Tr);break;case 5:Ea(e,dn,Tr);break;default:throw Error(te(329))}}}return hn(e,bt()),e.callbackNode===n?Lb.bind(null,e):null}function $p(e,t){var n=ei;return e.current.memoizedState.isDehydrated&&(Fa(e,t).flags|=256),e=Sc(e,t),e!==2&&(t=dn,dn=n,t!==null&&Up(t)),e}function Up(e){dn===null?dn=e:dn.push.apply(dn,e)}function Cj(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var a=n[r],o=a.getSnapshot;a=a.value;try{if(!Jn(o(),a))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 aa(e,t){for(t&=~nf,t&=~nu,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Qn(t),r=1<<n;e[n]=-1,t&=~r}}function og(e){if(Ge&6)throw Error(te(327));zo();var t=sc(e,0);if(!(t&1))return hn(e,bt()),null;var n=Sc(e,t);if(e.tag!==0&&n===2){var r=pp(e);r!==0&&(t=r,n=$p(e,r))}if(n===1)throw n=Si,Fa(e,0),aa(e,t),hn(e,bt()),n;if(n===6)throw Error(te(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Ea(e,dn,Tr),hn(e,bt()),null}function af(e,t){var n=Ge;Ge|=1;try{return e(t)}finally{Ge=n,Ge===0&&(es=bt()+500,Jc&&Na())}}function Va(e){ia!==null&&ia.tag===0&&!(Ge&6)&&zo();var t=Ge;Ge|=1;var n=zn.transition,r=Xe;try{if(zn.transition=null,Xe=1,e)return e()}finally{Xe=r,zn.transition=n,Ge=t,!(Ge&6)&&Na()}}function of(){Nn=To.current,st(To)}function Fa(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,ZN(n)),Nt!==null)for(n=Nt.return;n!==null;){var r=n;switch(zm(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&dc();break;case 3:Jo(),st(mn),st(Zt),Gm();break;case 5:Vm(r);break;case 4:Jo();break;case 13:st(ct);break;case 19:st(ct);break;case 10:Hm(r.type._context);break;case 22:case 23:of()}n=n.return}if(Ft=e,Nt=e=ha(e.current,null),Wt=Nn=t,Mt=0,Si=null,nf=nu=Ka=0,dn=ei=null,La!==null){for(t=0;t<La.length;t++)if(n=La[t],r=n.interleaved,r!==null){n.interleaved=null;var a=r.next,o=n.pending;if(o!==null){var i=o.next;o.next=a,r.next=i}n.pending=r}La=null}return e}function Db(e,t){do{var n=Nt;try{if(Bm(),Ul.current=bc,yc){for(var r=ut.memoizedState;r!==null;){var a=r.queue;a!==null&&(a.pending=null),r=r.next}yc=!1}if(qa=0,Ot=Rt=ut=null,Js=!1,wi=0,tf.current=null,n===null||n.return===null){Mt=1,Si=t,Nt=null;break}e:{var o=e,i=n.return,l=n,c=t;if(t=Wt,l.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var d=c,p=l,m=p.tag;if(!(p.mode&1)&&(m===0||m===11||m===15)){var f=p.alternate;f?(p.updateQueue=f.updateQueue,p.memoizedState=f.memoizedState,p.lanes=f.lanes):(p.updateQueue=null,p.memoizedState=null)}var h=Kh(i);if(h!==null){h.flags&=-257,Vh(h,i,l,o,t),h.mode&1&&qh(o,d,t),t=h,c=d;var y=t.updateQueue;if(y===null){var x=new Set;x.add(c),t.updateQueue=x}else y.add(c);break e}else{if(!(t&1)){qh(o,d,t),sf();break e}c=Error(te(426))}}else if(it&&l.mode&1){var b=Kh(i);if(b!==null){!(b.flags&65536)&&(b.flags|=256),Vh(b,i,l,o,t),$m(Zo(c,l));break e}}o=c=Zo(c,l),Mt!==4&&(Mt=2),ei===null?ei=[o]:ei.push(o),o=i;do{switch(o.tag){case 3:o.flags|=65536,t&=-t,o.lanes|=t;var v=yb(o,c,t);zh(o,v);break e;case 1:l=c;var g=o.type,w=o.stateNode;if(!(o.flags&128)&&(typeof g.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(ma===null||!ma.has(w)))){o.flags|=65536,t&=-t,o.lanes|=t;var k=bb(o,l,t);zh(o,k);break e}}o=o.return}while(o!==null)}zb(n)}catch(C){t=C,Nt===n&&n!==null&&(Nt=n=n.return);continue}break}while(!0)}function Ob(){var e=wc.current;return wc.current=bc,e===null?bc:e}function sf(){(Mt===0||Mt===3||Mt===2)&&(Mt=4),Ft===null||!(Ka&268435455)&&!(nu&268435455)||aa(Ft,Wt)}function Sc(e,t){var n=Ge;Ge|=2;var r=Ob();(Ft!==e||Wt!==t)&&(Tr=null,Fa(e,t));do try{Sj();break}catch(a){Db(e,a)}while(!0);if(Bm(),Ge=n,wc.current=r,Nt!==null)throw Error(te(261));return Ft=null,Wt=0,Mt}function Sj(){for(;Nt!==null;)Fb(Nt)}function Nj(){for(;Nt!==null&&!QS();)Fb(Nt)}function Fb(e){var t=Ub(e.alternate,e,Nn);e.memoizedProps=e.pendingProps,t===null?zb(e):Nt=t,tf.current=null}function zb(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=xj(n,t),n!==null){n.flags&=32767,Nt=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Mt=6,Nt=null;return}}else if(n=vj(n,t,Nn),n!==null){Nt=n;return}if(t=t.sibling,t!==null){Nt=t;return}Nt=t=e}while(t!==null);Mt===0&&(Mt=5)}function Ea(e,t,n){var r=Xe,a=zn.transition;try{zn.transition=null,Xe=1,jj(e,t,n,r)}finally{zn.transition=a,Xe=r}return null}function jj(e,t,n,r){do zo();while(ia!==null);if(Ge&6)throw Error(te(327));n=e.finishedWork;var a=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(te(177));e.callbackNode=null,e.callbackPriority=0;var o=n.lanes|n.childLanes;if(sN(e,o),e===Ft&&(Nt=Ft=null,Wt=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||wl||(wl=!0,Bb(oc,function(){return zo(),null})),o=(n.flags&15990)!==0,n.subtreeFlags&15990||o){o=zn.transition,zn.transition=null;var i=Xe;Xe=1;var l=Ge;Ge|=4,tf.current=null,bj(e,n),Eb(n,e),KN(xp),ic=!!vp,xp=vp=null,e.current=n,wj(n),XS(),Ge=l,Xe=i,zn.transition=o}else e.current=n;if(wl&&(wl=!1,ia=e,Cc=a),o=e.pendingLanes,o===0&&(ma=null),eN(n.stateNode),hn(e,bt()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)a=t[n],r(a.value,{componentStack:a.stack,digest:a.digest});if(kc)throw kc=!1,e=Fp,Fp=null,e;return Cc&1&&e.tag!==0&&zo(),o=e.pendingLanes,o&1?e===zp?ti++:(ti=0,zp=e):ti=0,Na(),null}function zo(){if(ia!==null){var e=yy(Cc),t=zn.transition,n=Xe;try{if(zn.transition=null,Xe=16>e?16:e,ia===null)var r=!1;else{if(e=ia,ia=null,Cc=0,Ge&6)throw Error(te(331));var a=Ge;for(Ge|=4,ge=e.current;ge!==null;){var o=ge,i=o.child;if(ge.flags&16){var l=o.deletions;if(l!==null){for(var c=0;c<l.length;c++){var d=l[c];for(ge=d;ge!==null;){var p=ge;switch(p.tag){case 0:case 11:case 15:Zs(8,p,o)}var m=p.child;if(m!==null)m.return=p,ge=m;else for(;ge!==null;){p=ge;var f=p.sibling,h=p.return;if(Tb(p),p===d){ge=null;break}if(f!==null){f.return=h,ge=f;break}ge=h}}}var y=o.alternate;if(y!==null){var x=y.child;if(x!==null){y.child=null;do{var b=x.sibling;x.sibling=null,x=b}while(x!==null)}}ge=o}}if(o.subtreeFlags&2064&&i!==null)i.return=o,ge=i;else e:for(;ge!==null;){if(o=ge,o.flags&2048)switch(o.tag){case 0:case 11:case 15:Zs(9,o,o.return)}var v=o.sibling;if(v!==null){v.return=o.return,ge=v;break e}ge=o.return}}var g=e.current;for(ge=g;ge!==null;){i=ge;var w=i.child;if(i.subtreeFlags&2064&&w!==null)w.return=i,ge=w;else e:for(i=g;ge!==null;){if(l=ge,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:tu(9,l)}}catch(C){ht(l,l.return,C)}if(l===i){ge=null;break e}var k=l.sibling;if(k!==null){k.return=l.return,ge=k;break e}ge=l.return}}if(Ge=a,Na(),hr&&typeof hr.onPostCommitFiberRoot=="function")try{hr.onPostCommitFiberRoot(Vc,e)}catch{}r=!0}return r}finally{Xe=n,zn.transition=t}}return!1}function sg(e,t,n){t=Zo(n,t),t=yb(e,t,1),e=pa(e,t,1),t=an(),e!==null&&($i(e,1,t),hn(e,t))}function ht(e,t,n){if(e.tag===3)sg(e,e,n);else for(;t!==null;){if(t.tag===3){sg(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(ma===null||!ma.has(r))){e=Zo(n,e),e=bb(t,e,1),t=pa(t,e,1),e=an(),t!==null&&($i(t,1,e),hn(t,e));break}}t=t.return}}function Aj(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=an(),e.pingedLanes|=e.suspendedLanes&n,Ft===e&&(Wt&n)===n&&(Mt===4||Mt===3&&(Wt&130023424)===Wt&&500>bt()-rf?Fa(e,0):nf|=n),hn(e,t)}function $b(e,t){t===0&&(e.mode&1?(t=dl,dl<<=1,!(dl&130023424)&&(dl=4194304)):t=1);var n=an();e=Or(e,t),e!==null&&($i(e,t,n),hn(e,n))}function _j(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),$b(e,n)}function Pj(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(te(314))}r!==null&&r.delete(t),$b(e,n)}var Ub;Ub=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||mn.current)pn=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return pn=!1,gj(e,t,n);pn=!!(e.flags&131072)}else pn=!1,it&&t.flags&1048576&&qy(t,fc,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Hl(e,t),e=t.pendingProps;var a=Yo(t,Zt.current);Fo(t,n),a=Qm(null,t,r,e,a,n);var o=Xm();return t.flags|=1,typeof a=="object"&&a!==null&&typeof a.render=="function"&&a.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,fn(r)?(o=!0,pc(t)):o=!1,t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,qm(t),a.updater=eu,t.stateNode=a,a._reactInternals=t,Ap(t,r,e,n),t=Tp(null,t,r,!0,o,n)):(t.tag=0,it&&o&&Fm(t),rn(null,t,a,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Hl(e,t),e=t.pendingProps,a=r._init,r=a(r._payload),t.type=r,a=t.tag=Rj(r),e=Vn(r,e),a){case 0:t=Pp(null,t,r,e,n);break e;case 1:t=Qh(null,t,r,e,n);break e;case 11:t=Gh(null,t,r,e,n);break e;case 14:t=Yh(null,t,r,Vn(r.type,e),n);break e}throw Error(te(306,r,""))}return t;case 0:return r=t.type,a=t.pendingProps,a=t.elementType===r?a:Vn(r,a),Pp(e,t,r,a,n);case 1:return r=t.type,a=t.pendingProps,a=t.elementType===r?a:Vn(r,a),Qh(e,t,r,a,n);case 3:e:{if(Sb(t),e===null)throw Error(te(387));r=t.pendingProps,o=t.memoizedState,a=o.element,Xy(e,t),vc(t,r,null,n);var i=t.memoizedState;if(r=i.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:i.cache,pendingSuspenseBoundaries:i.pendingSuspenseBoundaries,transitions:i.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){a=Zo(Error(te(423)),t),t=Xh(e,t,r,n,a);break e}else if(r!==a){a=Zo(Error(te(424)),t),t=Xh(e,t,r,n,a);break e}else for(_n=da(t.stateNode.containerInfo.firstChild),Pn=t,it=!0,Yn=null,n=Yy(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Qo(),r===a){t=Fr(e,t,n);break e}rn(e,t,r,n)}t=t.child}return t;case 5:return Jy(t),e===null&&Sp(t),r=t.type,a=t.pendingProps,o=e!==null?e.memoizedProps:null,i=a.children,yp(r,a)?i=null:o!==null&&yp(r,o)&&(t.flags|=32),Cb(e,t),rn(e,t,i,n),t.child;case 6:return e===null&&Sp(t),null;case 13:return Nb(e,t,n);case 4:return Km(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Xo(t,null,r,n):rn(e,t,r,n),t.child;case 11:return r=t.type,a=t.pendingProps,a=t.elementType===r?a:Vn(r,a),Gh(e,t,r,a,n);case 7:return rn(e,t,t.pendingProps,n),t.child;case 8:return rn(e,t,t.pendingProps.children,n),t.child;case 12:return rn(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,a=t.pendingProps,o=t.memoizedProps,i=a.value,tt(hc,r._currentValue),r._currentValue=i,o!==null)if(Jn(o.value,i)){if(o.children===a.children&&!mn.current){t=Fr(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var l=o.dependencies;if(l!==null){i=o.child;for(var c=l.firstContext;c!==null;){if(c.context===r){if(o.tag===1){c=Ir(-1,n&-n),c.tag=2;var d=o.updateQueue;if(d!==null){d=d.shared;var p=d.pending;p===null?c.next=c:(c.next=p.next,p.next=c),d.pending=c}}o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),Np(o.return,n,t),l.lanes|=n;break}c=c.next}}else if(o.tag===10)i=o.type===t.type?null:o.child;else if(o.tag===18){if(i=o.return,i===null)throw Error(te(341));i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),Np(i,n,t),i=o.sibling}else i=o.child;if(i!==null)i.return=o;else for(i=o;i!==null;){if(i===t){i=null;break}if(o=i.sibling,o!==null){o.return=i.return,i=o;break}i=i.return}o=i}rn(e,t,a.children,n),t=t.child}return t;case 9:return a=t.type,r=t.pendingProps.children,Fo(t,n),a=Un(a),r=r(a),t.flags|=1,rn(e,t,r,n),t.child;case 14:return r=t.type,a=Vn(r,t.pendingProps),a=Vn(r.type,a),Yh(e,t,r,a,n);case 15:return wb(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,a=t.pendingProps,a=t.elementType===r?a:Vn(r,a),Hl(e,t),t.tag=1,fn(r)?(e=!0,pc(t)):e=!1,Fo(t,n),xb(t,r,a),Ap(t,r,a,n),Tp(null,t,r,!0,e,n);case 19:return jb(e,t,n);case 22:return kb(e,t,n)}throw Error(te(156,t.tag))};function Bb(e,t){return hy(e,t)}function Tj(e,t,n,r){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=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Fn(e,t,n,r){return new Tj(e,t,n,r)}function lf(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Rj(e){if(typeof e=="function")return lf(e)?1:0;if(e!=null){if(e=e.$$typeof,e===jm)return 11;if(e===Am)return 14}return 2}function ha(e,t){var n=e.alternate;return n===null?(n=Fn(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 Kl(e,t,n,r,a,o){var i=2;if(r=e,typeof e=="function")lf(e)&&(i=1);else if(typeof e=="string")i=5;else e:switch(e){case bo:return za(n.children,a,o,t);case Nm:i=8,a|=8;break;case Xd:return e=Fn(12,n,t,a|2),e.elementType=Xd,e.lanes=o,e;case Jd:return e=Fn(13,n,t,a),e.elementType=Jd,e.lanes=o,e;case Zd:return e=Fn(19,n,t,a),e.elementType=Zd,e.lanes=o,e;case Jx:return ru(n,a,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Qx:i=10;break e;case Xx:i=9;break e;case jm:i=11;break e;case Am:i=14;break e;case ta:i=16,r=null;break e}throw Error(te(130,e==null?e:typeof e,""))}return t=Fn(i,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function za(e,t,n,r){return e=Fn(7,e,r,t),e.lanes=n,e}function ru(e,t,n,r){return e=Fn(22,e,r,t),e.elementType=Jx,e.lanes=n,e.stateNode={isHidden:!1},e}function md(e,t,n){return e=Fn(6,e,null,t),e.lanes=n,e}function fd(e,t,n){return t=Fn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Mj(e,t,n,r,a){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=Gu(0),this.expirationTimes=Gu(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Gu(0),this.identifierPrefix=r,this.onRecoverableError=a,this.mutableSourceEagerHydrationData=null}function cf(e,t,n,r,a,o,i,l,c){return e=new Mj(e,t,n,l,c),t===1?(t=1,o===!0&&(t|=8)):t=0,o=Fn(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},qm(o),e}function Ej(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:yo,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function Hb(e){if(!e)return xa;e=e._reactInternals;e:{if(no(e)!==e||e.tag!==1)throw Error(te(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(fn(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(te(171))}if(e.tag===1){var n=e.type;if(fn(n))return Hy(e,n,t)}return t}function Wb(e,t,n,r,a,o,i,l,c){return e=cf(n,r,!0,e,a,o,i,l,c),e.context=Hb(null),n=e.current,r=an(),a=fa(n),o=Ir(r,a),o.callback=t??null,pa(n,o,a),e.current.lanes=a,$i(e,a,r),hn(e,r),e}function au(e,t,n,r){var a=t.current,o=an(),i=fa(a);return n=Hb(n),t.context===null?t.context=n:t.pendingContext=n,t=Ir(o,i),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=pa(a,t,i),e!==null&&(Xn(e,a,i,o),$l(e,a,i)),i}function Nc(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 ig(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function uf(e,t){ig(e,t),(e=e.alternate)&&ig(e,t)}function Ij(){return null}var qb=typeof reportError=="function"?reportError:function(e){console.error(e)};function df(e){this._internalRoot=e}ou.prototype.render=df.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(te(409));au(e,t,null,null)};ou.prototype.unmount=df.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Va(function(){au(null,e,null,null)}),t[Dr]=null}};function ou(e){this._internalRoot=e}ou.prototype.unstable_scheduleHydration=function(e){if(e){var t=ky();e={blockedOn:null,target:e,priority:t};for(var n=0;n<ra.length&&t!==0&&t<ra[n].priority;n++);ra.splice(n,0,e),n===0&&Sy(e)}};function pf(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function su(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function lg(){}function Lj(e,t,n,r,a){if(a){if(typeof r=="function"){var o=r;r=function(){var d=Nc(i);o.call(d)}}var i=Wb(t,r,e,0,null,!1,!1,"",lg);return e._reactRootContainer=i,e[Dr]=i.current,gi(e.nodeType===8?e.parentNode:e),Va(),i}for(;a=e.lastChild;)e.removeChild(a);if(typeof r=="function"){var l=r;r=function(){var d=Nc(c);l.call(d)}}var c=cf(e,0,!1,null,null,!1,!1,"",lg);return e._reactRootContainer=c,e[Dr]=c.current,gi(e.nodeType===8?e.parentNode:e),Va(function(){au(t,c,n,r)}),c}function iu(e,t,n,r,a){var o=n._reactRootContainer;if(o){var i=o;if(typeof a=="function"){var l=a;a=function(){var c=Nc(i);l.call(c)}}au(t,i,e,a)}else i=Lj(n,t,e,a,r);return Nc(i)}by=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=$s(t.pendingLanes);n!==0&&(Tm(t,n|1),hn(t,bt()),!(Ge&6)&&(es=bt()+500,Na()))}break;case 13:Va(function(){var r=Or(e,1);if(r!==null){var a=an();Xn(r,e,1,a)}}),uf(e,1)}};Rm=function(e){if(e.tag===13){var t=Or(e,134217728);if(t!==null){var n=an();Xn(t,e,134217728,n)}uf(e,134217728)}};wy=function(e){if(e.tag===13){var t=fa(e),n=Or(e,t);if(n!==null){var r=an();Xn(n,e,t,r)}uf(e,t)}};ky=function(){return Xe};Cy=function(e,t){var n=Xe;try{return Xe=e,t()}finally{Xe=n}};cp=function(e,t,n){switch(t){case"input":if(np(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 r=n[t];if(r!==e&&r.form===e.form){var a=Xc(r);if(!a)throw Error(te(90));ey(r),np(r,a)}}}break;case"textarea":ny(e,n);break;case"select":t=n.value,t!=null&&Io(e,!!n.multiple,t,!1)}};cy=af;uy=Va;var Dj={usingClientEntryPoint:!1,Events:[Bi,So,Xc,iy,ly,af]},Es={findFiberByHostInstance:Ia,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Oj={bundleType:Es.bundleType,version:Es.version,rendererPackageName:Es.rendererPackageName,rendererConfig:Es.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Hr.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=my(e),e===null?null:e.stateNode},findFiberByHostInstance:Es.findFiberByHostInstance||Ij,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 kl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!kl.isDisabled&&kl.supportsFiber)try{Vc=kl.inject(Oj),hr=kl}catch{}}Mn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Dj;Mn.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!pf(t))throw Error(te(200));return Ej(e,t,null,n)};Mn.createRoot=function(e,t){if(!pf(e))throw Error(te(299));var n=!1,r="",a=qb;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(a=t.onRecoverableError)),t=cf(e,1,!1,null,null,n,!1,r,a),e[Dr]=t.current,gi(e.nodeType===8?e.parentNode:e),new df(t)};Mn.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(te(188)):(e=Object.keys(e).join(","),Error(te(268,e)));return e=my(t),e=e===null?null:e.stateNode,e};Mn.flushSync=function(e){return Va(e)};Mn.hydrate=function(e,t,n){if(!su(t))throw Error(te(200));return iu(null,e,t,!0,n)};Mn.hydrateRoot=function(e,t,n){if(!pf(e))throw Error(te(405));var r=n!=null&&n.hydratedSources||null,a=!1,o="",i=qb;if(n!=null&&(n.unstable_strictMode===!0&&(a=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onRecoverableError!==void 0&&(i=n.onRecoverableError)),t=Wb(t,null,e,1,n??null,a,!1,o,i),e[Dr]=t.current,gi(e),r)for(e=0;e<r.length;e++)n=r[e],a=n._getVersion,a=a(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,a]:t.mutableSourceEagerHydrationData.push(n,a);return new ou(t)};Mn.render=function(e,t,n){if(!su(t))throw Error(te(200));return iu(null,e,t,!1,n)};Mn.unmountComponentAtNode=function(e){if(!su(e))throw Error(te(40));return e._reactRootContainer?(Va(function(){iu(null,null,e,!1,function(){e._reactRootContainer=null,e[Dr]=null})}),!0):!1};Mn.unstable_batchedUpdates=af;Mn.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!su(n))throw Error(te(200));if(e==null||e._reactInternals===void 0)throw Error(te(38));return iu(e,t,n,!1,r)};Mn.version="18.3.1-next-f1338f8080-20240426";function Kb(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Kb)}catch(e){console.error(e)}}Kb(),Kx.exports=Mn;var lu=Kx.exports;const Fj=ES(lu);var cg=lu;Yd.createRoot=cg.createRoot,Yd.hydrateRoot=cg.hydrateRoot;/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const zj=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Vb=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/var $j={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Uj=u.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:a="",children:o,iconNode:i,...l},c)=>u.createElement("svg",{ref:c,...$j,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Vb("lucide",a),...l},[...i.map(([d,p])=>u.createElement(d,p)),...Array.isArray(o)?o:[o]]));/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const ae=(e,t)=>{const n=u.forwardRef(({className:r,...a},o)=>u.createElement(Uj,{ref:o,iconNode:t,className:Vb(`lucide-${zj(e)}`,r),...a}));return n.displayName=`${e}`,n};/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Gb=ae("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"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Bj=ae("ArchiveRestore",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h2",key:"tvwodi"}],["path",{d:"M20 8v11a2 2 0 0 1-2 2h-2",key:"1gkqxj"}],["path",{d:"m9 15 3-3 3 3",key:"1pd0qc"}],["path",{d:"M12 12v9",key:"192myk"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Yb=ae("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"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Hj=ae("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Wj=ae("ArrowUpDown",[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const qj=ae("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Bp=ae("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Qb=ae("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Ga=ae("Brain",[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Kj=ae("CalendarClock",[["path",{d:"M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5",key:"1osxxc"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M3 10h5",key:"r794hk"}],["path",{d:"M17.5 17.5 16 16.3V14",key:"akvzfd"}],["circle",{cx:"16",cy:"16",r:"6",key:"qoo3c4"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Et=ae("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const yr=ae("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const mf=ae("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Wr=ae("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Vj=ae("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const ja=ae("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const ug=ae("CircleArrowUp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 12-4-4-4 4",key:"177agl"}],["path",{d:"M12 16V8",key:"1sbj14"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Xb=ae("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Jb=ae("CircleDashed",[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const ff=ae("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Gj=ae("CirclePause",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"10",x2:"10",y1:"15",y2:"9",key:"c1nkhi"}],["line",{x1:"14",x2:"14",y1:"15",y2:"9",key:"h65svq"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const jc=ae("CirclePlay",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polygon",{points:"10 8 16 12 10 16 10 8",key:"1cimsy"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Yj=ae("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Qj=ae("Clock3",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16.5 12",key:"1aq6pp"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const po=ae("Cloud",[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Zb=ae("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Xj=ae("CornerDownRight",[["polyline",{points:"15 10 20 15 15 20",key:"1q7qjw"}],["path",{d:"M4 4v7a4 4 0 0 0 4 4h12",key:"z08zvw"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const mo=ae("Cpu",[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Ac=ae("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const ew=ae("Earth",[["path",{d:"M21.54 15H17a2 2 0 0 0-2 2v4.54",key:"1djwo0"}],["path",{d:"M7 3.34V5a3 3 0 0 0 3 3a2 2 0 0 1 2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.1.9-2 2-2h3.17",key:"1tzkfa"}],["path",{d:"M11 21.95V18a2 2 0 0 0-2-2a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05",key:"14pb5j"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const tw=ae("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"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const nw=ae("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const rw=ae("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const aw=ae("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Vl=ae("FileImage",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["circle",{cx:"10",cy:"12",r:"2",key:"737tya"}],["path",{d:"m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22",key:"wt3hpn"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Jj=ae("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Zj=ae("File",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Gl=ae("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"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const eA=ae("Gem",[["path",{d:"M6 3h12l4 6-10 13L2 9Z",key:"1pcd5k"}],["path",{d:"M11 3 8 9l4 13 4-13-3-6",key:"1fcu3u"}],["path",{d:"M2 9h20",key:"16fsjt"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const tA=ae("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const nA=ae("Grid3x3",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const rA=ae("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const dg=ae("Hand",[["path",{d:"M18 11V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2",key:"1fvzgz"}],["path",{d:"M14 10V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2",key:"1kc0my"}],["path",{d:"M10 10.5V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2v8",key:"10h0bg"}],["path",{d:"M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15",key:"1s1gnw"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const aA=ae("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"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const hf=ae("Hexagon",[["path",{d:"M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z",key:"yt0hxn"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const oA=ae("History",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Wi=ae("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const pg=ae("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"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Ni=ae("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:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const sA=ae("ListTodo",[["rect",{x:"3",y:"5",width:"6",height:"6",rx:"1",key:"1defrl"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const iA=ae("ListTree",[["path",{d:"M21 12h-8",key:"1bmf0i"}],["path",{d:"M21 6H8",key:"1pqkrb"}],["path",{d:"M21 18h-8",key:"1tm79t"}],["path",{d:"M3 6v4c0 1.1.9 2 2 2h3",key:"1ywdgy"}],["path",{d:"M3 10v6c0 1.1.9 2 2 2h3",key:"2wc746"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const pt=ae("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const lA=ae("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const ow=ae("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"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const gf=ae("Mic",[["path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z",key:"131961"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const vf=ae("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const cA=ae("Orbit",[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["circle",{cx:"19",cy:"5",r:"2",key:"mhkx31"}],["circle",{cx:"5",cy:"19",r:"2",key:"v8kfzx"}],["path",{d:"M10.4 21.9a10 10 0 0 0 9.941-15.416",key:"eohfx2"}],["path",{d:"M13.5 2.1a10 10 0 0 0-9.841 15.416",key:"19pvbm"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const uA=ae("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"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const dA=ae("PanelLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const fs=ae("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const pA=ae("PinOff",[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89",key:"znwnzq"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11",key:"c9qhm2"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const mA=ae("Pin",[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z",key:"1nkz8b"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const ga=ae("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const fA=ae("RefreshCcw",[["path",{d:"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"14sxne"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16",key:"1hlbsb"}],["path",{d:"M16 16h5v5",key:"ccwih5"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const qi=ae("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const hA=ae("RotateCw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Tt=ae("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const ts=ae("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"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const gA=ae("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"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const vA=ae("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"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const sw=ae("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"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const $o=ae("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const xf=ae("SquarePen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const xA=ae("SquarePlay",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"m9 8 6 4-6 4Z",key:"f1r3lt"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Hp=ae("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const iw=ae("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const yA=ae("Target",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const _c=ae("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const ya=ae("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Wp=ae("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const bA=ae("Triangle",[["path",{d:"M13.73 4a2 2 0 0 0-3.46 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z",key:"14u9p9"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const wA=ae("Undo2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const kA=ae("Waves",[["path",{d:"M2 6c.6.5 1.2 1 2.5 1C7 7 7 5 9.5 5c2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1",key:"knzxuh"}],["path",{d:"M2 12c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1",key:"2jd2cc"}],["path",{d:"M2 18c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1",key:"rd2r6e"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const lw=ae("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const xr=ae("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const mg=ae("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"}]]),Pe=e=>typeof e=="string",Is=()=>{let e,t;const n=new Promise((r,a)=>{e=r,t=a});return n.resolve=e,n.reject=t,n},fg=e=>e==null?"":String(e),CA=(e,t,n)=>{e.forEach(r=>{t[r]&&(n[r]=t[r])})},SA=/###/g,hg=e=>e&&e.includes("###")?e.replace(SA,"."):e,gg=e=>!e||Pe(e),ni=(e,t,n)=>{const r=Pe(t)?t.split("."):t;let a=0;for(;a<r.length-1;){if(gg(e))return{};const o=hg(r[a]);!e[o]&&n&&(e[o]=new n),Object.prototype.hasOwnProperty.call(e,o)?e=e[o]:e={},++a}return gg(e)?{}:{obj:e,k:hg(r[a])}},vg=(e,t,n)=>{const{obj:r,k:a}=ni(e,t,Object);if(r!==void 0||t.length===1){r[a]=n;return}let o=t[t.length-1],i=t.slice(0,t.length-1),l=ni(e,i,Object);for(;l.obj===void 0&&i.length;)o=`${i[i.length-1]}.${o}`,i=i.slice(0,i.length-1),l=ni(e,i,Object),l!=null&&l.obj&&typeof l.obj[`${l.k}.${o}`]<"u"&&(l.obj=void 0);l.obj[`${l.k}.${o}`]=n},NA=(e,t,n,r)=>{const{obj:a,k:o}=ni(e,t,Object);a[o]=a[o]||[],a[o].push(n)},Pc=(e,t)=>{const{obj:n,k:r}=ni(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},jA=(e,t,n)=>{const r=Pc(e,n);return r!==void 0?r:Pc(t,n)},cw=(e,t,n)=>{for(const r in t)r!=="__proto__"&&r!=="constructor"&&(r in e?Pe(e[r])||e[r]instanceof String||Pe(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):cw(e[r],t[r],n):e[r]=t[r]);return e},_r=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),AA={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"},_A=e=>Pe(e)?e.replace(/[&<>"'\/]/g,t=>AA[t]):e;class PA{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const n=this.regExpMap.get(t);if(n!==void 0)return n;const r=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,r),this.regExpQueue.push(t),r}}const TA=[" ",",","?","!",";"],RA=new PA(20),MA=(e,t,n)=>{t=t||"",n=n||"";const r=TA.filter(i=>!t.includes(i)&&!n.includes(i));if(r.length===0)return!0;const a=RA.getRegExp(`(${r.map(i=>i==="?"?"\\?":i).join("|")})`);let o=!a.test(e);if(!o){const i=e.indexOf(n);i>0&&!a.test(e.substring(0,i))&&(o=!0)}return o},qp=(e,t,n=".")=>{if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;const r=t.split(n);let a=e;for(let o=0;o<r.length;){if(!a||typeof a!="object")return;let i,l="";for(let c=o;c<r.length;++c)if(c!==o&&(l+=n),l+=r[c],i=a[l],i!==void 0){if(["string","number","boolean"].includes(typeof i)&&c<r.length-1)continue;o+=c-o+1;break}a=i}return a},ji=e=>e==null?void 0:e.replace(/_/g,"-"),EA={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){var n,r;(r=(n=console==null?void 0:console[e])==null?void 0:n.apply)==null||r.call(n,console,t)}};class Tc{constructor(t,n={}){this.init(t,n)}init(t,n={}){this.prefix=n.prefix||"i18next:",this.logger=t||EA,this.options=n,this.debug=n.debug}log(...t){return this.forward(t,"log","",!0)}warn(...t){return this.forward(t,"warn","",!0)}error(...t){return this.forward(t,"error","")}deprecate(...t){return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(t,n,r,a){return a&&!this.debug?null:(t=t.map(o=>Pe(o)?o.replace(/[\r\n\x00-\x1F\x7F]/g," "):o),Pe(t[0])&&(t[0]=`${r}${this.prefix} ${t[0]}`),this.logger[n](t))}create(t){return new Tc(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new Tc(this.logger,t)}}var mr=new Tc;class cu{constructor(){this.observers={}}on(t,n){return t.split(" ").forEach(r=>{this.observers[r]||(this.observers[r]=new Map);const a=this.observers[r].get(n)||0;this.observers[r].set(n,a+1)}),this}off(t,n){if(this.observers[t]){if(!n){delete this.observers[t];return}this.observers[t].delete(n)}}once(t,n){const r=(...a)=>{n(...a),this.off(t,r)};return this.on(t,r),this}emit(t,...n){this.observers[t]&&Array.from(this.observers[t].entries()).forEach(([a,o])=>{for(let i=0;i<o;i++)a(...n)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([a,o])=>{for(let i=0;i<o;i++)a(t,...n)})}}class xg extends cu{constructor(t,n={ns:["translation"],defaultNS:"translation"}){super(),this.data=t||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.includes(t)||this.options.ns.push(t)}removeNamespaces(t){const n=this.options.ns.indexOf(t);n>-1&&this.options.ns.splice(n,1)}getResource(t,n,r,a={}){var d,p;const o=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator,i=a.ignoreJSONStructure!==void 0?a.ignoreJSONStructure:this.options.ignoreJSONStructure;let l;t.includes(".")?l=t.split("."):(l=[t,n],r&&(Array.isArray(r)?l.push(...r):Pe(r)&&o?l.push(...r.split(o)):l.push(r)));const c=Pc(this.data,l);return!c&&!n&&!r&&t.includes(".")&&(t=l[0],n=l[1],r=l.slice(2).join(".")),c||!i||!Pe(r)?c:qp((p=(d=this.data)==null?void 0:d[t])==null?void 0:p[n],r,o)}addResource(t,n,r,a,o={silent:!1}){const i=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator;let l=[t,n];r&&(l=l.concat(i?r.split(i):r)),t.includes(".")&&(l=t.split("."),a=n,n=l[1]),this.addNamespaces(n),vg(this.data,l,a),o.silent||this.emit("added",t,n,r,a)}addResources(t,n,r,a={silent:!1}){for(const o in r)(Pe(r[o])||Array.isArray(r[o]))&&this.addResource(t,n,o,r[o],{silent:!0});a.silent||this.emit("added",t,n,r)}addResourceBundle(t,n,r,a,o,i={silent:!1,skipCopy:!1}){let l=[t,n];t.includes(".")&&(l=t.split("."),a=r,r=n,n=l[1]),this.addNamespaces(n);let c=Pc(this.data,l)||{};i.skipCopy||(r=JSON.parse(JSON.stringify(r))),a?cw(c,r,o):c={...c,...r},vg(this.data,l,c),i.silent||this.emit("added",t,n,r)}removeResourceBundle(t,n){this.hasResourceBundle(t,n)&&delete this.data[t][n],this.removeNamespaces(n),this.emit("removed",t,n)}hasResourceBundle(t,n){return this.getResource(t,n)!==void 0}getResourceBundle(t,n){return n||(n=this.options.defaultNS),this.getResource(t,n)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const n=this.getDataByLanguage(t);return!!(n&&Object.keys(n)||[]).find(a=>n[a]&&Object.keys(n[a]).length>0)}toJSON(){return this.data}}var uw={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,a){return e.forEach(o=>{var i;t=((i=this.processors[o])==null?void 0:i.process(t,n,r,a))??t}),t}};const dw=Symbol("i18next/PATH_KEY");function IA(){const e=[],t=Object.create(null);let n;return t.get=(r,a)=>{var o;return(o=n==null?void 0:n.revoke)==null||o.call(n),a===dw?e:(e.push(a),n=Proxy.revocable(r,t),n.proxy)},Proxy.revocable(Object.create(null),t).proxy}function Uo(e,t){const{[dw]:n}=e(IA()),r=(t==null?void 0:t.keySeparator)??".",a=(t==null?void 0:t.nsSeparator)??":";if(n.length>1&&a){const o=t==null?void 0:t.ns,i=Array.isArray(o)?o:null;if(i&&i.length>1&&i.slice(1).includes(n[0]))return`${n[0]}${a}${n.slice(1).join(r)}`}return n.join(r)}const hd=e=>!Pe(e)&&typeof e!="boolean"&&typeof e!="number";class Rc extends cu{constructor(t,n={}){super(),CA(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=mr.create("translator"),this.checkedLoadedFor={}}changeLanguage(t){t&&(this.language=t)}exists(t,n={interpolation:{}}){const r={...n};if(t==null)return!1;const a=this.resolve(t,r);if((a==null?void 0:a.res)===void 0)return!1;const o=hd(a.res);return!(r.returnObjects===!1&&o)}extractFromKey(t,n){let r=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const a=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let o=n.ns||this.options.defaultNS||[];const i=r&&t.includes(r),l=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!MA(t,r,a);if(i&&!l){const c=t.match(this.interpolator.nestingRegexp);if(c&&c.length>0)return{key:t,namespaces:Pe(o)?[o]:o};const d=t.split(r);(r!==a||r===a&&this.options.ns.includes(d[0]))&&(o=d.shift()),t=d.join(a)}return{key:t,namespaces:Pe(o)?[o]:o}}translate(t,n,r){let a=typeof n=="object"?{...n}:n;if(typeof a!="object"&&this.options.overloadTranslationOptionHandler&&(a=this.options.overloadTranslationOptionHandler(arguments)),typeof a=="object"&&(a={...a}),a||(a={}),t==null)return"";typeof t=="function"&&(t=Uo(t,{...this.options,...a})),Array.isArray(t)||(t=[String(t)]),t=t.map(F=>typeof F=="function"?Uo(F,{...this.options,...a}):String(F));const o=a.returnDetails!==void 0?a.returnDetails:this.options.returnDetails,i=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator,{key:l,namespaces:c}=this.extractFromKey(t[t.length-1],a),d=c[c.length-1];let p=a.nsSeparator!==void 0?a.nsSeparator:this.options.nsSeparator;p===void 0&&(p=":");const m=a.lng||this.language,f=a.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((m==null?void 0:m.toLowerCase())==="cimode")return f?o?{res:`${d}${p}${l}`,usedKey:l,exactUsedKey:l,usedLng:m,usedNS:d,usedParams:this.getUsedParamsDetails(a)}:`${d}${p}${l}`:o?{res:l,usedKey:l,exactUsedKey:l,usedLng:m,usedNS:d,usedParams:this.getUsedParamsDetails(a)}:l;const h=this.resolve(t,a);let y=h==null?void 0:h.res;const x=(h==null?void 0:h.usedKey)||l,b=(h==null?void 0:h.exactUsedKey)||l,v=["[object Number]","[object Function]","[object RegExp]"],g=a.joinArrays!==void 0?a.joinArrays:this.options.joinArrays,w=!this.i18nFormat||this.i18nFormat.handleAsObject,k=a.count!==void 0&&!Pe(a.count),C=Rc.hasDefaultValue(a),N=k?this.pluralResolver.getSuffix(m,a.count,a):"",S=a.ordinal&&k?this.pluralResolver.getSuffix(m,a.count,{ordinal:!1}):"",A=k&&!a.ordinal&&a.count===0,E=A&&a[`defaultValue${this.options.pluralSeparator}zero`]||a[`defaultValue${N}`]||a[`defaultValue${S}`]||a.defaultValue;let _=y;w&&!y&&C&&(_=E);const R=hd(_),T=Object.prototype.toString.apply(_);if(w&&_&&R&&!v.includes(T)&&!(Pe(g)&&Array.isArray(_))){if(!a.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const F=this.options.returnedObjectHandler?this.options.returnedObjectHandler(x,_,{...a,ns:c}):`key '${l} (${this.language})' returned an object instead of string.`;return o?(h.res=F,h.usedParams=this.getUsedParamsDetails(a),h):F}if(i){const F=Array.isArray(_),z=F?[]:{},K=F?b:x;for(const $ in _)if(Object.prototype.hasOwnProperty.call(_,$)){const W=`${K}${i}${$}`;C&&!y?z[$]=this.translate(W,{...a,defaultValue:hd(E)?E[$]:void 0,joinArrays:!1,ns:c}):z[$]=this.translate(W,{...a,joinArrays:!1,ns:c}),z[$]===W&&(z[$]=_[$])}y=z}}else if(w&&Pe(g)&&Array.isArray(y))y=y.join(g),y&&(y=this.extendTranslation(y,t,a,r));else{let F=!1,z=!1;!this.isValidLookup(y)&&C&&(F=!0,y=E),this.isValidLookup(y)||(z=!0,y=l);const $=(a.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&z?void 0:y,W=C&&E!==y&&this.options.updateMissing;if(z||F||W){if(this.logger.log(W?"updateKey":"missingKey",m,d,l,W?E:y),i){const Y=this.resolve(l,{...a,keySeparator:!1});Y&&Y.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let P=[];const D=this.languageUtils.getFallbackCodes(this.options.fallbackLng,a.lng||this.language);if(this.options.saveMissingTo==="fallback"&&D&&D[0])for(let Y=0;Y<D.length;Y++)P.push(D[Y]);else this.options.saveMissingTo==="all"?P=this.languageUtils.toResolveHierarchy(a.lng||this.language):P.push(a.lng||this.language);const G=(Y,oe,de)=>{var le;const pe=C&&de!==y?de:$;this.options.missingKeyHandler?this.options.missingKeyHandler(Y,d,oe,pe,W,a):(le=this.backendConnector)!=null&&le.saveMissing&&this.backendConnector.saveMissing(Y,d,oe,pe,W,a),this.emit("missingKey",Y,d,oe,y)};this.options.saveMissing&&(this.options.saveMissingPlurals&&k?P.forEach(Y=>{const oe=this.pluralResolver.getSuffixes(Y,a);A&&a[`defaultValue${this.options.pluralSeparator}zero`]&&!oe.includes(`${this.options.pluralSeparator}zero`)&&oe.push(`${this.options.pluralSeparator}zero`),oe.forEach(de=>{G([Y],l+de,a[`defaultValue${de}`]||E)})}):G(P,l,E))}y=this.extendTranslation(y,t,a,h,r),z&&y===l&&this.options.appendNamespaceToMissingKey&&(y=`${d}${p}${l}`),(z||F)&&this.options.parseMissingKeyHandler&&(y=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${d}${p}${l}`:l,F?y:void 0,a))}return o?(h.res=y,h.usedParams=this.getUsedParamsDetails(a),h):y}extendTranslation(t,n,r,a,o){var c,d;if((c=this.i18nFormat)!=null&&c.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||a.usedLng,a.usedNS,a.usedKey,{resolved:a});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const p=Pe(t)&&(((d=r==null?void 0:r.interpolation)==null?void 0:d.skipOnVariables)!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let m;if(p){const h=t.match(this.interpolator.nestingRegexp);m=h&&h.length}let f=r.replace&&!Pe(r.replace)?r.replace:r;if(this.options.interpolation.defaultVariables&&(f={...this.options.interpolation.defaultVariables,...f}),t=this.interpolator.interpolate(t,f,r.lng||this.language||a.usedLng,r),p){const h=t.match(this.interpolator.nestingRegexp),y=h&&h.length;m<y&&(r.nest=!1)}!r.lng&&a&&a.res&&(r.lng=this.language||a.usedLng),r.nest!==!1&&(t=this.interpolator.nest(t,(...h)=>(o==null?void 0:o[0])===h[0]&&!r.context?(this.logger.warn(`It seems you are nesting recursively key: ${h[0]} in key: ${n[0]}`),null):this.translate(...h,n),r)),r.interpolation&&this.interpolator.reset()}const i=r.postProcess||this.options.postProcess,l=Pe(i)?[i]:i;return t!=null&&(l!=null&&l.length)&&r.applyPostProcessor!==!1&&(t=uw.handle(l,t,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...a,usedParams:this.getUsedParamsDetails(r)},...r}:r,this)),t}resolve(t,n={}){let r,a,o,i,l;return Pe(t)&&(t=[t]),Array.isArray(t)&&(t=t.map(c=>typeof c=="function"?Uo(c,{...this.options,...n}):c)),t.forEach(c=>{if(this.isValidLookup(r))return;const d=this.extractFromKey(c,n),p=d.key;a=p;let m=d.namespaces;this.options.fallbackNS&&(m=m.concat(this.options.fallbackNS));const f=n.count!==void 0&&!Pe(n.count),h=f&&!n.ordinal&&n.count===0,y=n.context!==void 0&&(Pe(n.context)||typeof n.context=="number")&&n.context!=="",x=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);m.forEach(b=>{var v,g;this.isValidLookup(r)||(l=b,!this.checkedLoadedFor[`${x[0]}-${b}`]&&((v=this.utils)!=null&&v.hasLoadedNamespace)&&!((g=this.utils)!=null&&g.hasLoadedNamespace(l))&&(this.checkedLoadedFor[`${x[0]}-${b}`]=!0,this.logger.warn(`key "${a}" for languages "${x.join(", ")}" won't get resolved as namespace "${l}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),x.forEach(w=>{var N;if(this.isValidLookup(r))return;i=w;const k=[p];if((N=this.i18nFormat)!=null&&N.addLookupKeys)this.i18nFormat.addLookupKeys(k,p,w,b,n);else{let S;f&&(S=this.pluralResolver.getSuffix(w,n.count,n));const A=`${this.options.pluralSeparator}zero`,E=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(f&&(n.ordinal&&S.startsWith(E)&&k.push(p+S.replace(E,this.options.pluralSeparator)),k.push(p+S),h&&k.push(p+A)),y){const _=`${p}${this.options.contextSeparator||"_"}${n.context}`;k.push(_),f&&(n.ordinal&&S.startsWith(E)&&k.push(_+S.replace(E,this.options.pluralSeparator)),k.push(_+S),h&&k.push(_+A))}}let C;for(;C=k.pop();)this.isValidLookup(r)||(o=C,r=this.getResource(w,b,C,n))}))})}),{res:r,usedKey:a,exactUsedKey:o,usedLng:i,usedNS:l}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,n,r,a={}){var o;return(o=this.i18nFormat)!=null&&o.getResource?this.i18nFormat.getResource(t,n,r,a):this.resourceStore.getResource(t,n,r,a)}getUsedParamsDetails(t={}){const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=t.replace&&!Pe(t.replace);let a=r?t.replace:t;if(r&&typeof t.count<"u"&&(a.count=t.count),this.options.interpolation.defaultVariables&&(a={...this.options.interpolation.defaultVariables,...a}),!r){a={...a};for(const o of n)delete a[o]}return a}static hasDefaultValue(t){const n="defaultValue";for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&r.startsWith(n)&&t[r]!==void 0)return!0;return!1}}class yg{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=mr.create("languageUtils")}getScriptPartFromCode(t){if(t=ji(t),!t||!t.includes("-"))return null;const n=t.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(t){if(t=ji(t),!t||!t.includes("-"))return t;const n=t.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(t){if(Pe(t)&&t.includes("-")){let n;try{n=Intl.getCanonicalLocales(t)[0]}catch{}return n&&this.options.lowerCaseLng&&(n=n.toLowerCase()),n||(this.options.lowerCaseLng?t.toLowerCase():t)}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.includes(t)}getBestMatchFromCodes(t){if(!t)return null;let n;return t.forEach(r=>{if(n)return;const a=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(a))&&(n=a)}),!n&&this.options.supportedLngs&&t.forEach(r=>{if(n)return;const a=this.getScriptPartFromCode(r);if(this.isSupportedCode(a))return n=a;const o=this.getLanguagePartFromCode(r);if(this.isSupportedCode(o))return n=o;n=this.options.supportedLngs.find(i=>i===o?!0:!i.includes("-")&&!o.includes("-")?!1:!!(i.includes("-")&&!o.includes("-")&&i.slice(0,i.indexOf("-"))===o||i.startsWith(o)&&o.length>1))}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(t,n){if(!t)return[];if(typeof t=="function"&&(t=t(n)),Pe(t)&&(t=[t]),Array.isArray(t))return t;if(!n)return t.default||[];let r=t[n];return r||(r=t[this.getScriptPartFromCode(n)]),r||(r=t[this.formatLanguageCode(n)]),r||(r=t[this.getLanguagePartFromCode(n)]),r||(r=t.default),r||[]}toResolveHierarchy(t,n){const r=this.getFallbackCodes((n===!1?[]:n)||this.options.fallbackLng||[],t),a=[],o=i=>{i&&(this.isSupportedCode(i)?a.push(i):this.logger.warn(`rejecting language code not found in supportedLngs: ${i}`))};return Pe(t)&&(t.includes("-")||t.includes("_"))?(this.options.load!=="languageOnly"&&o(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&o(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&o(this.getLanguagePartFromCode(t))):Pe(t)&&o(this.formatLanguageCode(t)),r.forEach(i=>{a.includes(i)||o(this.formatLanguageCode(i))}),a}}const bg={zero:0,one:1,two:2,few:3,many:4,other:5},wg={select:e=>e===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class LA{constructor(t,n={}){this.languageUtils=t,this.options=n,this.logger=mr.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(t,n={}){const r=ji(t==="dev"?"en":t),a=n.ordinal?"ordinal":"cardinal",o=JSON.stringify({cleanedCode:r,type:a});if(o in this.pluralRulesCache)return this.pluralRulesCache[o];let i;try{i=new Intl.PluralRules(r,{type:a})}catch{if(typeof Intl>"u")return this.logger.error("No Intl support, please use an Intl polyfill!"),wg;if(!t.match(/-|_/))return wg;const c=this.languageUtils.getLanguagePartFromCode(t);i=this.getRule(c,n)}return this.pluralRulesCache[o]=i,i}needsPlural(t,n={}){let r=this.getRule(t,n);return r||(r=this.getRule("dev",n)),(r==null?void 0:r.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(t,n,r={}){return this.getSuffixes(t,r).map(a=>`${n}${a}`)}getSuffixes(t,n={}){let r=this.getRule(t,n);return r||(r=this.getRule("dev",n)),r?r.resolvedOptions().pluralCategories.sort((a,o)=>bg[a]-bg[o]).map(a=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${a}`):[]}getSuffix(t,n,r={}){const a=this.getRule(t,r);return a?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${a.select(n)}`:(this.logger.warn(`no plural rule found for: ${t}`),this.getSuffix("dev",n,r))}}const kg=(e,t,n,r=".",a=!0)=>{let o=jA(e,t,n);return!o&&a&&Pe(n)&&(o=qp(e,n,r),o===void 0&&(o=qp(t,n,r))),o},gd=e=>e.replace(/\$/g,"$$$$");class Cg{constructor(t={}){var n;this.logger=mr.create("interpolator"),this.options=t,this.format=((n=t==null?void 0:t.interpolation)==null?void 0:n.format)||(r=>r),this.init(t)}init(t={}){t.interpolation||(t.interpolation={escapeValue:!0});const{escape:n,escapeValue:r,useRawValueToEscape:a,prefix:o,prefixEscaped:i,suffix:l,suffixEscaped:c,formatSeparator:d,unescapeSuffix:p,unescapePrefix:m,nestingPrefix:f,nestingPrefixEscaped:h,nestingSuffix:y,nestingSuffixEscaped:x,nestingOptionsSeparator:b,maxReplaces:v,alwaysFormat:g}=t.interpolation;this.escape=n!==void 0?n:_A,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=a!==void 0?a:!1,this.prefix=o?_r(o):i||"{{",this.suffix=l?_r(l):c||"}}",this.formatSeparator=d||",",this.unescapePrefix=p?"":m?_r(m):"-",this.unescapeSuffix=this.unescapePrefix?"":p?_r(p):"",this.nestingPrefix=f?_r(f):h||_r("$t("),this.nestingSuffix=y?_r(y):x||_r(")"),this.nestingOptionsSeparator=b||",",this.maxReplaces=v||1e3,this.alwaysFormat=g!==void 0?g:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(n,r)=>(n==null?void 0:n.source)===r?(n.lastIndex=0,n):new RegExp(r,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(t,n,r,a){var h;let o,i,l;const c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},d=y=>{if(!y.includes(this.formatSeparator)){const g=kg(n,c,y,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(g,void 0,r,{...a,...n,interpolationkey:y}):g}const x=y.split(this.formatSeparator),b=x.shift().trim(),v=x.join(this.formatSeparator).trim();return this.format(kg(n,c,b,this.options.keySeparator,this.options.ignoreJSONStructure),v,r,{...a,...n,interpolationkey:b})};this.resetRegExp(),!this.escapeValue&&typeof t=="string"&&/\$t\([^)]*\{[^}]*\{\{/.test(t)&&this.logger.warn("nesting options string contains interpolated variables with escapeValue: false — if any of those values are attacker-controlled they can inject additional nesting options (e.g. redirect lng/ns). Sanitise untrusted input before passing it to t(), or keep escapeValue: true.");const p=(a==null?void 0:a.missingInterpolationHandler)||this.options.missingInterpolationHandler,m=((h=a==null?void 0:a.interpolation)==null?void 0:h.skipOnVariables)!==void 0?a.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:y=>gd(y)},{regex:this.regexp,safeValue:y=>this.escapeValue?gd(this.escape(y)):gd(y)}].forEach(y=>{for(l=0;o=y.regex.exec(t);){const x=o[1].trim();if(i=d(x),i===void 0)if(typeof p=="function"){const v=p(t,o,a);i=Pe(v)?v:""}else if(a&&Object.prototype.hasOwnProperty.call(a,x))i="";else if(m){i=o[0];continue}else this.logger.warn(`missed to pass in variable ${x} for interpolating ${t}`),i="";else!Pe(i)&&!this.useRawValueToEscape&&(i=fg(i));const b=y.safeValue(i);if(t=t.replace(o[0],b),m?(y.regex.lastIndex+=i.length,y.regex.lastIndex-=o[0].length):y.regex.lastIndex=0,l++,l>=this.maxReplaces)break}}),t}nest(t,n,r={}){let a,o,i;const l=(c,d)=>{const p=this.nestingOptionsSeparator;if(!c.includes(p))return c;const m=c.split(new RegExp(`${_r(p)}[ ]*{`));let f=`{${m[1]}`;c=m[0],f=this.interpolate(f,i);const h=f.match(/'/g),y=f.match(/"/g);(((h==null?void 0:h.length)??0)%2===0&&!y||((y==null?void 0:y.length)??0)%2!==0)&&(f=f.replace(/'/g,'"'));try{i=JSON.parse(f),d&&(i={...d,...i})}catch(x){return this.logger.warn(`failed parsing options string in nesting for key ${c}`,x),`${c}${p}${f}`}return i.defaultValue&&i.defaultValue.includes(this.prefix)&&delete i.defaultValue,c};for(;a=this.nestingRegexp.exec(t);){let c=[];i={...r},i=i.replace&&!Pe(i.replace)?i.replace:i,i.applyPostProcessor=!1,delete i.defaultValue;const d=/{.*}/.test(a[1])?a[1].lastIndexOf("}")+1:a[1].indexOf(this.formatSeparator);if(d!==-1&&(c=a[1].slice(d).split(this.formatSeparator).map(p=>p.trim()).filter(Boolean),a[1]=a[1].slice(0,d)),o=n(l.call(this,a[1].trim(),i),i),o&&a[0]===t&&!Pe(o))return o;Pe(o)||(o=fg(o)),o||(this.logger.warn(`missed to resolve ${a[1]} for nesting ${t}`),o=""),c.length&&(o=c.reduce((p,m)=>this.format(p,m,r.lng,{...r,interpolationkey:a[1].trim()}),o.trim())),t=t.replace(a[0],o),this.regexp.lastIndex=0}return t}}const DA=e=>{let t=e.toLowerCase().trim();const n={};if(e.includes("(")){const r=e.split("(");t=r[0].toLowerCase().trim();const a=r[1].slice(0,-1);t==="currency"&&!a.includes(":")?n.currency||(n.currency=a.trim()):t==="relativetime"&&!a.includes(":")?n.range||(n.range=a.trim()):a.split(";").forEach(i=>{if(i){const[l,...c]=i.split(":"),d=c.join(":").trim().replace(/^'+|'+$/g,""),p=l.trim();n[p]||(n[p]=d),d==="false"&&(n[p]=!1),d==="true"&&(n[p]=!0),isNaN(d)||(n[p]=parseInt(d,10))}})}return{formatName:t,formatOptions:n}},Sg=e=>{const t={};return(n,r,a)=>{let o=a;a&&a.interpolationkey&&a.formatParams&&a.formatParams[a.interpolationkey]&&a[a.interpolationkey]&&(o={...o,[a.interpolationkey]:void 0});const i=r+JSON.stringify(o);let l=t[i];return l||(l=e(ji(r),a),t[i]=l),l(n)}},OA=e=>(t,n,r)=>e(ji(n),r)(t);class FA{constructor(t={}){this.logger=mr.create("formatter"),this.options=t,this.init(t)}init(t,n={interpolation:{}}){this.formatSeparator=n.interpolation.formatSeparator||",";const r=n.cacheInBuiltFormats?Sg:OA;this.formats={number:r((a,o)=>{const i=new Intl.NumberFormat(a,{...o});return l=>i.format(l)}),currency:r((a,o)=>{const i=new Intl.NumberFormat(a,{...o,style:"currency"});return l=>i.format(l)}),datetime:r((a,o)=>{const i=new Intl.DateTimeFormat(a,{...o});return l=>i.format(l)}),relativetime:r((a,o)=>{const i=new Intl.RelativeTimeFormat(a,{...o});return l=>i.format(l,o.range||"day")}),list:r((a,o)=>{const i=new Intl.ListFormat(a,{...o});return l=>i.format(l)})}}add(t,n){this.formats[t.toLowerCase().trim()]=n}addCached(t,n){this.formats[t.toLowerCase().trim()]=Sg(n)}format(t,n,r,a={}){if(!n||t==null)return t;const o=n.split(this.formatSeparator);if(o.length>1&&o[0].indexOf("(")>1&&!o[0].includes(")")&&o.find(l=>l.includes(")"))){const l=o.findIndex(c=>c.includes(")"));o[0]=[o[0],...o.splice(1,l)].join(this.formatSeparator)}return o.reduce((l,c)=>{var m;const{formatName:d,formatOptions:p}=DA(c);if(this.formats[d]){let f=l;try{const h=((m=a==null?void 0:a.formatParams)==null?void 0:m[a.interpolationkey])||{},y=h.locale||h.lng||a.locale||a.lng||r;f=this.formats[d](l,y,{...p,...a,...h})}catch(h){this.logger.warn(h)}return f}else this.logger.warn(`there was no format function for ${d}`);return l},t)}}const zA=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class $A extends cu{constructor(t,n,r,a={}){var o,i;super(),this.backend=t,this.store=n,this.services=r,this.languageUtils=r.languageUtils,this.options=a,this.logger=mr.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=a.maxParallelReads||10,this.readingCalls=0,this.maxRetries=a.maxRetries>=0?a.maxRetries:5,this.retryTimeout=a.retryTimeout>=1?a.retryTimeout:350,this.state={},this.queue=[],(i=(o=this.backend)==null?void 0:o.init)==null||i.call(o,r,a.backend,a)}queueLoad(t,n,r,a){const o={},i={},l={},c={};return t.forEach(d=>{let p=!0;n.forEach(m=>{const f=`${d}|${m}`;!r.reload&&this.store.hasResourceBundle(d,m)?this.state[f]=2:this.state[f]<0||(this.state[f]===1?i[f]===void 0&&(i[f]=!0):(this.state[f]=1,p=!1,i[f]===void 0&&(i[f]=!0),o[f]===void 0&&(o[f]=!0),c[m]===void 0&&(c[m]=!0)))}),p||(l[d]=!0)}),(Object.keys(o).length||Object.keys(i).length)&&this.queue.push({pending:i,pendingCount:Object.keys(i).length,loaded:{},errors:[],callback:a}),{toLoad:Object.keys(o),pending:Object.keys(i),toLoadLanguages:Object.keys(l),toLoadNamespaces:Object.keys(c)}}loaded(t,n,r){const a=t.split("|"),o=a[0],i=a[1];n&&this.emit("failedLoading",o,i,n),!n&&r&&this.store.addResourceBundle(o,i,r,void 0,void 0,{skipCopy:!0}),this.state[t]=n?-1:2,n&&r&&(this.state[t]=0);const l={};this.queue.forEach(c=>{NA(c.loaded,[o],i),zA(c,t),n&&c.errors.push(n),c.pendingCount===0&&!c.done&&(Object.keys(c.loaded).forEach(d=>{l[d]||(l[d]={});const p=c.loaded[d];p.length&&p.forEach(m=>{l[d][m]===void 0&&(l[d][m]=!0)})}),c.done=!0,c.errors.length?c.callback(c.errors):c.callback())}),this.emit("loaded",l),this.queue=this.queue.filter(c=>!c.done)}read(t,n,r,a=0,o=this.retryTimeout,i){if(!t.length)return i(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:n,fcName:r,tried:a,wait:o,callback:i});return}this.readingCalls++;const l=(d,p)=>{if(this.readingCalls--,this.waitingReads.length>0){const m=this.waitingReads.shift();this.read(m.lng,m.ns,m.fcName,m.tried,m.wait,m.callback)}if(d&&p&&a<this.maxRetries){setTimeout(()=>{this.read(t,n,r,a+1,o*2,i)},o);return}i(d,p)},c=this.backend[r].bind(this.backend);if(c.length===2){try{const d=c(t,n);d&&typeof d.then=="function"?d.then(p=>l(null,p)).catch(l):l(null,d)}catch(d){l(d)}return}return c(t,n,l)}prepareLoading(t,n,r={},a){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),a&&a();Pe(t)&&(t=this.languageUtils.toResolveHierarchy(t)),Pe(n)&&(n=[n]);const o=this.queueLoad(t,n,r,a);if(!o.toLoad.length)return o.pending.length||a(),null;o.toLoad.forEach(i=>{this.loadOne(i)})}load(t,n,r){this.prepareLoading(t,n,{},r)}reload(t,n,r){this.prepareLoading(t,n,{reload:!0},r)}loadOne(t,n=""){const r=t.split("|"),a=r[0],o=r[1];this.read(a,o,"read",void 0,void 0,(i,l)=>{i&&this.logger.warn(`${n}loading namespace ${o} for language ${a} failed`,i),!i&&l&&this.logger.log(`${n}loaded namespace ${o} for language ${a}`,l),this.loaded(t,i,l)})}saveMissing(t,n,r,a,o,i={},l=()=>{}){var c,d,p,m,f;if((d=(c=this.services)==null?void 0:c.utils)!=null&&d.hasLoadedNamespace&&!((m=(p=this.services)==null?void 0:p.utils)!=null&&m.hasLoadedNamespace(n))){this.logger.warn(`did not save key "${r}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(r==null||r==="")){if((f=this.backend)!=null&&f.create){const h={...i,isUpdate:o},y=this.backend.create.bind(this.backend);if(y.length<6)try{let x;y.length===5?x=y(t,n,r,a,h):x=y(t,n,r,a),x&&typeof x.then=="function"?x.then(b=>l(null,b)).catch(l):l(null,x)}catch(x){l(x)}else y(t,n,r,a,l,h)}!t||!t[0]||this.store.addResource(t[0],n,r,a)}}}const vd=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]=="object"&&(t=e[1]),Pe(e[1])&&(t.defaultValue=e[1]),Pe(e[2])&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const n=e[3]||e[2];Object.keys(n).forEach(r=>{t[r]=n[r]})}return t},interpolation:{escapeValue:!0,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),Ng=e=>(Pe(e.ns)&&(e.ns=[e.ns]),Pe(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),Pe(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&!e.supportedLngs.includes("cimode")&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e),Cl=()=>{},UA=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})};class ri extends cu{constructor(t={},n){if(super(),this.options=Ng(t),this.services={},this.logger=mr,this.modules={external:[]},UA(this),n&&!this.isInitialized&&!t.isClone){if(!this.options.initAsync)return this.init(t,n),this;setTimeout(()=>{this.init(t,n)},0)}}init(t={},n){this.isInitializing=!0,typeof t=="function"&&(n=t,t={}),t.defaultNS==null&&t.ns&&(Pe(t.ns)?t.defaultNS=t.ns:t.ns.includes("translation")||(t.defaultNS=t.ns[0]));const r=vd();this.options={...r,...this.options,...Ng(t)},this.options.interpolation={...r.interpolation,...this.options.interpolation},t.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=t.keySeparator),t.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=t.nsSeparator),typeof this.options.overloadTranslationOptionHandler!="function"&&(this.options.overloadTranslationOptionHandler=r.overloadTranslationOptionHandler);const a=d=>d?typeof d=="function"?new d:d:null;if(!this.options.isClone){this.modules.logger?mr.init(a(this.modules.logger),this.options):mr.init(null,this.options);let d;this.modules.formatter?d=this.modules.formatter:d=FA;const p=new yg(this.options);this.store=new xg(this.options.resources,this.options);const m=this.services;m.logger=mr,m.resourceStore=this.store,m.languageUtils=p,m.pluralResolver=new LA(p,{prepend:this.options.pluralSeparator}),d&&(m.formatter=a(d),m.formatter.init&&m.formatter.init(m,this.options),this.options.interpolation.format=m.formatter.format.bind(m.formatter)),m.interpolator=new Cg(this.options),m.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},m.backendConnector=new $A(a(this.modules.backend),m.resourceStore,m,this.options),m.backendConnector.on("*",(f,...h)=>{this.emit(f,...h)}),this.modules.languageDetector&&(m.languageDetector=a(this.modules.languageDetector),m.languageDetector.init&&m.languageDetector.init(m,this.options.detection,this.options)),this.modules.i18nFormat&&(m.i18nFormat=a(this.modules.i18nFormat),m.i18nFormat.init&&m.i18nFormat.init(this)),this.translator=new Rc(this.services,this.options),this.translator.on("*",(f,...h)=>{this.emit(f,...h)}),this.modules.external.forEach(f=>{f.init&&f.init(this)})}if(this.format=this.options.interpolation.format,n||(n=Cl),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const d=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);d.length>0&&d[0]!=="dev"&&(this.options.lng=d[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(d=>{this[d]=(...p)=>this.store[d](...p)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(d=>{this[d]=(...p)=>(this.store[d](...p),this)});const l=Is(),c=()=>{const d=(p,m)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),l.resolve(m),n(p,m)};if((this.languages||this.isLanguageChangingTo)&&!this.isInitialized)return d(null,this.t.bind(this));this.changeLanguage(this.options.lng,d)};return this.options.resources||!this.options.initAsync?c():setTimeout(c,0),l}loadResources(t,n=Cl){var o,i;let r=n;const a=Pe(t)?t:this.language;if(typeof t=="function"&&(r=t),!this.options.resources||this.options.partialBundledLanguages){if((a==null?void 0:a.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();const l=[],c=d=>{if(!d||d==="cimode")return;this.services.languageUtils.toResolveHierarchy(d).forEach(m=>{m!=="cimode"&&(l.includes(m)||l.push(m))})};a?c(a):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(p=>c(p)),(i=(o=this.options.preload)==null?void 0:o.forEach)==null||i.call(o,d=>c(d)),this.services.backendConnector.load(l,this.options.ns,d=>{!d&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(d)})}else r(null)}reloadResources(t,n,r){const a=Is();return typeof t=="function"&&(r=t,t=void 0),typeof n=="function"&&(r=n,n=void 0),t||(t=this.languages),n||(n=this.options.ns),r||(r=Cl),this.services.backendConnector.reload(t,n,o=>{a.resolve(),r(o)}),a}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&uw.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!["cimode","dev"].includes(t)){for(let n=0;n<this.languages.length;n++){const r=this.languages[n];if(!["cimode","dev"].includes(r)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}!this.resolvedLanguage&&!this.languages.includes(t)&&this.store.hasLanguageSomeTranslations(t)&&(this.resolvedLanguage=t,this.languages.unshift(t))}}changeLanguage(t,n){this.isLanguageChangingTo=t;const r=Is();this.emit("languageChanging",t);const a=l=>{this.language=l,this.languages=this.services.languageUtils.toResolveHierarchy(l),this.resolvedLanguage=void 0,this.setResolvedLanguage(l)},o=(l,c)=>{c?this.isLanguageChangingTo===t&&(a(c),this.translator.changeLanguage(c),this.isLanguageChangingTo=void 0,this.emit("languageChanged",c),this.logger.log("languageChanged",c)):this.isLanguageChangingTo=void 0,r.resolve((...d)=>this.t(...d)),n&&n(l,(...d)=>this.t(...d))},i=l=>{var p,m;!t&&!l&&this.services.languageDetector&&(l=[]);const c=Pe(l)?l:l&&l[0],d=this.store.hasLanguageSomeTranslations(c)?c:this.services.languageUtils.getBestMatchFromCodes(Pe(l)?[l]:l);d&&(this.language||a(d),this.translator.language||this.translator.changeLanguage(d),(m=(p=this.services.languageDetector)==null?void 0:p.cacheUserLanguage)==null||m.call(p,d)),this.loadResources(d,f=>{o(f,d)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?i(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(i):this.services.languageDetector.detect(i):i(t),r}getFixedT(t,n,r){const a=(o,i,...l)=>{let c;typeof i!="object"?c=this.options.overloadTranslationOptionHandler([o,i].concat(l)):c={...i},c.lng=c.lng||a.lng,c.lngs=c.lngs||a.lngs,c.ns=c.ns||a.ns,c.keyPrefix!==""&&(c.keyPrefix=c.keyPrefix||r||a.keyPrefix);const d={...this.options,...c};typeof c.keyPrefix=="function"&&(c.keyPrefix=Uo(c.keyPrefix,d));const p=this.options.keySeparator||".";let m;return c.keyPrefix&&Array.isArray(o)?m=o.map(f=>(typeof f=="function"&&(f=Uo(f,d)),`${c.keyPrefix}${p}${f}`)):(typeof o=="function"&&(o=Uo(o,d)),m=c.keyPrefix?`${c.keyPrefix}${p}${o}`:o),this.t(m,c)};return Pe(t)?a.lng=t:a.lngs=t,a.ns=n,a.keyPrefix=r,a}t(...t){var n;return(n=this.translator)==null?void 0:n.translate(...t)}exists(...t){var n;return(n=this.translator)==null?void 0:n.exists(...t)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t,n={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const r=n.lng||this.resolvedLanguage||this.languages[0],a=this.options?this.options.fallbackLng:!1,o=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const i=(l,c)=>{const d=this.services.backendConnector.state[`${l}|${c}`];return d===-1||d===0||d===2};if(n.precheck){const l=n.precheck(this,i);if(l!==void 0)return l}return!!(this.hasResourceBundle(r,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||i(r,t)&&(!a||i(o,t)))}loadNamespaces(t,n){const r=Is();return this.options.ns?(Pe(t)&&(t=[t]),t.forEach(a=>{this.options.ns.includes(a)||this.options.ns.push(a)}),this.loadResources(a=>{r.resolve(),n&&n(a)}),r):(n&&n(),Promise.resolve())}loadLanguages(t,n){const r=Is();Pe(t)&&(t=[t]);const a=this.options.preload||[],o=t.filter(i=>!a.includes(i)&&this.services.languageUtils.isSupportedCode(i));return o.length?(this.options.preload=a.concat(o),this.loadResources(i=>{r.resolve(),n&&n(i)}),r):(n&&n(),Promise.resolve())}dir(t){var a,o;if(t||(t=this.resolvedLanguage||(((a=this.languages)==null?void 0:a.length)>0?this.languages[0]:this.language)),!t)return"rtl";try{const i=new Intl.Locale(t);if(i&&i.getTextInfo){const l=i.getTextInfo();if(l&&l.direction)return l.direction}}catch{}const n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],r=((o=this.services)==null?void 0:o.languageUtils)||new yg(vd());return t.toLowerCase().indexOf("-latn")>1?"ltr":n.includes(r.getLanguagePartFromCode(t))||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(t={},n){const r=new ri(t,n);return r.createInstance=ri.createInstance,r}cloneInstance(t={},n=Cl){const r=t.forkResourceStore;r&&delete t.forkResourceStore;const a={...this.options,...t,isClone:!0},o=new ri(a);if((t.debug!==void 0||t.prefix!==void 0)&&(o.logger=o.logger.clone(t)),["store","services","language"].forEach(l=>{o[l]=this[l]}),o.services={...this.services},o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},r){const l=Object.keys(this.store.data).reduce((c,d)=>(c[d]={...this.store.data[d]},c[d]=Object.keys(c[d]).reduce((p,m)=>(p[m]={...c[d][m]},p),c[d]),c),{});o.store=new xg(l,a),o.services.resourceStore=o.store}if(t.interpolation){const c={...vd().interpolation,...this.options.interpolation,...t.interpolation},d={...a,interpolation:c};o.services.interpolator=new Cg(d)}return o.translator=new Rc(o.services,a),o.translator.on("*",(l,...c)=>{o.emit(l,...c)}),o.init(a,n),o.translator.options=a,o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const vt=ri.createInstance();vt.createInstance;vt.dir;vt.init;vt.loadResources;vt.reloadResources;vt.use;vt.changeLanguage;vt.getFixedT;vt.t;vt.exists;vt.setDefaultNamespace;vt.hasLoadedNamespace;vt.loadNamespaces;vt.loadLanguages;const BA=(e,t,n,r)=>{var o,i,l,c;const a=[n,{code:t,...r||{}}];if((i=(o=e==null?void 0:e.services)==null?void 0:o.logger)!=null&&i.forward)return e.services.logger.forward(a,"warn","react-i18next::",!0);Ya(a[0])&&(a[0]=`react-i18next:: ${a[0]}`),(c=(l=e==null?void 0:e.services)==null?void 0:l.logger)!=null&&c.warn?e.services.logger.warn(...a):console!=null&&console.warn&&console.warn(...a)},jg={},Kp=(e,t,n,r)=>{Ya(n)&&jg[n]||(Ya(n)&&(jg[n]=new Date),BA(e,t,n,r))},pw=(e,t)=>()=>{if(e.isInitialized)t();else{const n=()=>{setTimeout(()=>{e.off("initialized",n)},0),t()};e.on("initialized",n)}},Vp=(e,t,n)=>{e.loadNamespaces(t,pw(e,n))},Ag=(e,t,n,r)=>{if(Ya(n)&&(n=[n]),e.options.preload&&e.options.preload.indexOf(t)>-1)return Vp(e,n,r);n.forEach(a=>{e.options.ns.indexOf(a)<0&&e.options.ns.push(a)}),e.loadLanguages(t,pw(e,r))},HA=(e,t,n={})=>!t.languages||!t.languages.length?(Kp(t,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:t.languages}),!0):t.hasLoadedNamespace(e,{lng:n.lng,precheck:(r,a)=>{if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&r.services.backendConnector.backend&&r.isLanguageChangingTo&&!a(r.isLanguageChangingTo,e))return!1}}),Ya=e=>typeof e=="string",WA=e=>typeof e=="object"&&e!==null,qA=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,KA={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},VA=e=>KA[e],GA=e=>e.replace(qA,VA);let Gp={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:GA,transDefaultProps:void 0};const YA=(e={})=>{Gp={...Gp,...e}},QA=()=>Gp;let mw;const XA=e=>{mw=e},JA=()=>mw,ZA={type:"3rdParty",init(e){YA(e.options.react),XA(e)}},e2=u.createContext();class t2{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}var fw={exports:{}},hw={};/**
* @license React
* use-sync-external-store-shim.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var ns=u;function n2(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var r2=typeof Object.is=="function"?Object.is:n2,a2=ns.useState,o2=ns.useEffect,s2=ns.useLayoutEffect,i2=ns.useDebugValue;function l2(e,t){var n=t(),r=a2({inst:{value:n,getSnapshot:t}}),a=r[0].inst,o=r[1];return s2(function(){a.value=n,a.getSnapshot=t,xd(a)&&o({inst:a})},[e,n,t]),o2(function(){return xd(a)&&o({inst:a}),e(function(){xd(a)&&o({inst:a})})},[e]),i2(n),n}function xd(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r2(e,n)}catch{return!0}}function c2(e,t){return t()}var u2=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c2:l2;hw.useSyncExternalStore=ns.useSyncExternalStore!==void 0?ns.useSyncExternalStore:u2;fw.exports=hw;var d2=fw.exports;const p2=(e,t)=>{if(Ya(t))return t;if(WA(t)&&Ya(t.defaultValue))return t.defaultValue;if(typeof e=="function")return"";if(Array.isArray(e)){const n=e[e.length-1];return typeof n=="function"?"":n}return e},m2={t:p2,ready:!1},f2=()=>()=>{},ie=(e,t={})=>{var E,_,R;const{i18n:n}=t,{i18n:r,defaultNS:a}=u.useContext(e2)||{},o=n||r||JA();o&&!o.reportNamespaces&&(o.reportNamespaces=new t2),o||Kp(o,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const i=u.useMemo(()=>{var T;return{...QA(),...(T=o==null?void 0:o.options)==null?void 0:T.react,...t}},[o,t]),{useSuspense:l,keyPrefix:c}=i,d=e||a||((E=o==null?void 0:o.options)==null?void 0:E.defaultNS),p=Ya(d)?[d]:d||["translation"],m=u.useMemo(()=>p,p);(R=(_=o==null?void 0:o.reportNamespaces)==null?void 0:_.addUsedNamespaces)==null||R.call(_,m);const f=u.useRef(0),h=u.useCallback(T=>{if(!o)return f2;const{bindI18n:F,bindI18nStore:z}=i,K=()=>{f.current+=1,T()};return F&&o.on(F,K),z&&o.store.on(z,K),()=>{F&&F.split(" ").forEach($=>o.off($,K)),z&&z.split(" ").forEach($=>o.store.off($,K))}},[o,i]),y=u.useRef(),x=u.useCallback(()=>{if(!o)return m2;const T=!!(o.isInitialized||o.initializedStoreOnce)&&m.every(P=>HA(P,o,i)),F=t.lng||o.language,z=f.current,K=y.current;if(K&&K.ready===T&&K.lng===F&&K.keyPrefix===c&&K.revision===z)return K;const W={t:o.getFixedT(F,i.nsMode==="fallback"?m:m[0],c),ready:T,lng:F,keyPrefix:c,revision:z};return y.current=W,W},[o,m,c,i,t.lng]),[b,v]=u.useState(0),{t:g,ready:w}=d2.useSyncExternalStore(h,x,x);u.useEffect(()=>{if(o&&!w&&!l){const T=()=>v(F=>F+1);t.lng?Ag(o,t.lng,m,T):Vp(o,m,T)}},[o,t.lng,m,w,l,b]);const k=o||{},C=u.useRef(null),N=u.useRef(),S=T=>{const F=Object.getOwnPropertyDescriptors(T);F.__original&&delete F.__original;const z=Object.create(Object.getPrototypeOf(T),F);if(!Object.prototype.hasOwnProperty.call(z,"__original"))try{Object.defineProperty(z,"__original",{value:T,writable:!1,enumerable:!1,configurable:!1})}catch{}return z},A=u.useMemo(()=>{const T=k,F=T==null?void 0:T.language;let z=T;T&&(C.current&&C.current.__original===T?N.current!==F?(z=S(T),C.current=z,N.current=F):z=C.current:(z=S(T),C.current=z,N.current=F));const K=!w&&!l?(...W)=>(Kp(o,"USE_T_BEFORE_READY","useTranslation: t was called before ready. When using useSuspense: false, make sure to check the ready flag before using t."),g(...W)):g,$=[K,z,w];return $.t=K,$.i18n=z,$.ready=w,$},[g,k,w,k.resolvedLanguage,k.language,k.languages]);if(o&&l&&!w)throw new Promise(T=>{const F=()=>T();t.lng?Ag(o,t.lng,m,F):Vp(o,m,F)});return A};function h2(e,t){const n=u.createContext(t),r=o=>{const{children:i,...l}=o,c=u.useMemo(()=>l,Object.values(l));return s.jsx(n.Provider,{value:c,children:i})};r.displayName=e+"Provider";function a(o){const i=u.useContext(n);if(i)return i;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[r,a]}function Aa(e,t=[]){let n=[];function r(o,i){const l=u.createContext(i),c=n.length;n=[...n,i];const d=m=>{var v;const{scope:f,children:h,...y}=m,x=((v=f==null?void 0:f[e])==null?void 0:v[c])||l,b=u.useMemo(()=>y,Object.values(y));return s.jsx(x.Provider,{value:b,children:h})};d.displayName=o+"Provider";function p(m,f){var x;const h=((x=f==null?void 0:f[e])==null?void 0:x[c])||l,y=u.useContext(h);if(y)return y;if(i!==void 0)return i;throw new Error(`\`${m}\` must be used within \`${o}\``)}return[d,p]}const a=()=>{const o=n.map(i=>u.createContext(i));return function(l){const c=(l==null?void 0:l[e])||o;return u.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return a.scopeName=e,[r,g2(a,...t)]}function g2(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(o){const i=r.reduce((l,{useScope:c,scopeName:d})=>{const m=c(o)[`__scope${d}`];return{...l,...m}},{});return u.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}function _g(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function _a(...e){return t=>{let n=!1;const r=e.map(a=>{const o=_g(a,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let a=0;a<r.length;a++){const o=r[a];typeof o=="function"?o():_g(e[a],null)}}}}function wt(...e){return u.useCallback(_a(...e),e)}function Re(e,t,{checkForDefaultPrevented:n=!0}={}){return function(a){if(e==null||e(a),n===!1||!a.defaultPrevented)return t==null?void 0:t(a)}}var ba=globalThis!=null&&globalThis.document?u.useLayoutEffect:()=>{},v2=wm[" useId ".trim().toString()]||(()=>{}),x2=0;function $a(e){const[t,n]=u.useState(v2());return ba(()=>{n(r=>r??String(x2++))},[e]),t?`radix-${t}`:""}var y2=wm[" useInsertionEffect ".trim().toString()]||ba;function uu({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[a,o,i]=b2({defaultProp:t,onChange:n}),l=e!==void 0,c=l?e:a;{const p=u.useRef(e!==void 0);u.useEffect(()=>{const m=p.current;m!==l&&console.warn(`${r} is changing from ${m?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),p.current=l},[l,r])}const d=u.useCallback(p=>{var m;if(l){const f=w2(p)?p(e):p;f!==e&&((m=i.current)==null||m.call(i,f))}else o(p)},[l,e,o,i]);return[c,d]}function b2({defaultProp:e,onChange:t}){const[n,r]=u.useState(e),a=u.useRef(n),o=u.useRef(t);return y2(()=>{o.current=t},[t]),u.useEffect(()=>{var i;a.current!==n&&((i=o.current)==null||i.call(o,n),a.current=n)},[n,a]),[n,r,o]}function w2(e){return typeof e=="function"}function k2(e){const t=C2(e),n=u.forwardRef((r,a)=>{const{children:o,...i}=r,l=u.Children.toArray(o),c=l.find(N2);if(c){const d=c.props.children,p=l.map(m=>m===c?u.Children.count(d)>1?u.Children.only(null):u.isValidElement(d)?d.props.children:null:m);return s.jsx(t,{...i,ref:a,children:u.isValidElement(d)?u.cloneElement(d,void 0,p):null})}return s.jsx(t,{...i,ref:a,children:o})});return n.displayName=`${e}.Slot`,n}function C2(e){const t=u.forwardRef((n,r)=>{const{children:a,...o}=n;if(u.isValidElement(a)){const i=A2(a),l=j2(o,a.props);return a.type!==u.Fragment&&(l.ref=r?_a(r,i):i),u.cloneElement(a,l)}return u.Children.count(a)>1?u.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var S2=Symbol("radix.slottable");function N2(e){return u.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===S2}function j2(e,t){const n={...t};for(const r in t){const a=e[r],o=t[r];/^on[A-Z]/.test(r)?a&&o?n[r]=(...l)=>{const c=o(...l);return a(...l),c}:a&&(n[r]=a):r==="style"?n[r]={...a,...o}:r==="className"&&(n[r]=[a,o].filter(Boolean).join(" "))}return{...e,...n}}function A2(e){var r,a;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var _2=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],xt=_2.reduce((e,t)=>{const n=k2(`Primitive.${t}`),r=u.forwardRef((a,o)=>{const{asChild:i,...l}=a,c=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(c,{...l,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function gw(e,t){e&&lu.flushSync(()=>e.dispatchEvent(t))}function zr(e){const t=u.useRef(e);return u.useEffect(()=>{t.current=e}),u.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function P2(e,t=globalThis==null?void 0:globalThis.document){const n=zr(e);u.useEffect(()=>{const r=a=>{a.key==="Escape"&&n(a)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var T2="DismissableLayer",Yp="dismissableLayer.update",R2="dismissableLayer.pointerDownOutside",M2="dismissableLayer.focusOutside",Pg,vw=u.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),du=u.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:i,onDismiss:l,...c}=e,d=u.useContext(vw),[p,m]=u.useState(null),f=(p==null?void 0:p.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,h]=u.useState({}),y=wt(t,S=>m(S)),x=Array.from(d.layers),[b]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),v=x.indexOf(b),g=p?x.indexOf(p):-1,w=d.layersWithOutsidePointerEventsDisabled.size>0,k=g>=v,C=L2(S=>{const A=S.target,E=[...d.branches].some(_=>_.contains(A));!k||E||(a==null||a(S),i==null||i(S),S.defaultPrevented||l==null||l())},f),N=D2(S=>{const A=S.target;[...d.branches].some(_=>_.contains(A))||(o==null||o(S),i==null||i(S),S.defaultPrevented||l==null||l())},f);return P2(S=>{g===d.layers.size-1&&(r==null||r(S),!S.defaultPrevented&&l&&(S.preventDefault(),l()))},f),u.useEffect(()=>{if(p)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(Pg=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(p)),d.layers.add(p),Tg(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=Pg)}},[p,f,n,d]),u.useEffect(()=>()=>{p&&(d.layers.delete(p),d.layersWithOutsidePointerEventsDisabled.delete(p),Tg())},[p,d]),u.useEffect(()=>{const S=()=>h({});return document.addEventListener(Yp,S),()=>document.removeEventListener(Yp,S)},[]),s.jsx(xt.div,{...c,ref:y,style:{pointerEvents:w?k?"auto":"none":void 0,...e.style},onFocusCapture:Re(e.onFocusCapture,N.onFocusCapture),onBlurCapture:Re(e.onBlurCapture,N.onBlurCapture),onPointerDownCapture:Re(e.onPointerDownCapture,C.onPointerDownCapture)})});du.displayName=T2;var E2="DismissableLayerBranch",I2=u.forwardRef((e,t)=>{const n=u.useContext(vw),r=u.useRef(null),a=wt(t,r);return u.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),s.jsx(xt.div,{...e,ref:a})});I2.displayName=E2;function L2(e,t=globalThis==null?void 0:globalThis.document){const n=zr(e),r=u.useRef(!1),a=u.useRef(()=>{});return u.useEffect(()=>{const o=l=>{if(l.target&&!r.current){let c=function(){xw(R2,n,d,{discrete:!0})};const d={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",a.current),a.current=c,t.addEventListener("click",a.current,{once:!0})):c()}else t.removeEventListener("click",a.current);r.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",o),t.removeEventListener("click",a.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function D2(e,t=globalThis==null?void 0:globalThis.document){const n=zr(e),r=u.useRef(!1);return u.useEffect(()=>{const a=o=>{o.target&&!r.current&&xw(M2,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",a),()=>t.removeEventListener("focusin",a)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Tg(){const e=new CustomEvent(Yp);document.dispatchEvent(e)}function xw(e,t,n,{discrete:r}){const a=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),r?gw(a,o):a.dispatchEvent(o)}var yd="focusScope.autoFocusOnMount",bd="focusScope.autoFocusOnUnmount",Rg={bubbles:!1,cancelable:!0},O2="FocusScope",yf=u.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:a,onUnmountAutoFocus:o,...i}=e,[l,c]=u.useState(null),d=zr(a),p=zr(o),m=u.useRef(null),f=wt(t,x=>c(x)),h=u.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;u.useEffect(()=>{if(r){let x=function(w){if(h.paused||!l)return;const k=w.target;l.contains(k)?m.current=k:ea(m.current,{select:!0})},b=function(w){if(h.paused||!l)return;const k=w.relatedTarget;k!==null&&(l.contains(k)||ea(m.current,{select:!0}))},v=function(w){if(document.activeElement===document.body)for(const C of w)C.removedNodes.length>0&&ea(l)};document.addEventListener("focusin",x),document.addEventListener("focusout",b);const g=new MutationObserver(v);return l&&g.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",x),document.removeEventListener("focusout",b),g.disconnect()}}},[r,l,h.paused]),u.useEffect(()=>{if(l){Eg.add(h);const x=document.activeElement;if(!l.contains(x)){const v=new CustomEvent(yd,Rg);l.addEventListener(yd,d),l.dispatchEvent(v),v.defaultPrevented||(F2(H2(yw(l)),{select:!0}),document.activeElement===x&&ea(l))}return()=>{l.removeEventListener(yd,d),setTimeout(()=>{const v=new CustomEvent(bd,Rg);l.addEventListener(bd,p),l.dispatchEvent(v),v.defaultPrevented||ea(x??document.body,{select:!0}),l.removeEventListener(bd,p),Eg.remove(h)},0)}}},[l,d,p,h]);const y=u.useCallback(x=>{if(!n&&!r||h.paused)return;const b=x.key==="Tab"&&!x.altKey&&!x.ctrlKey&&!x.metaKey,v=document.activeElement;if(b&&v){const g=x.currentTarget,[w,k]=z2(g);w&&k?!x.shiftKey&&v===k?(x.preventDefault(),n&&ea(w,{select:!0})):x.shiftKey&&v===w&&(x.preventDefault(),n&&ea(k,{select:!0})):v===g&&x.preventDefault()}},[n,r,h.paused]);return s.jsx(xt.div,{tabIndex:-1,...i,ref:f,onKeyDown:y})});yf.displayName=O2;function F2(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(ea(r,{select:t}),document.activeElement!==n)return}function z2(e){const t=yw(e),n=Mg(t,e),r=Mg(t.reverse(),e);return[n,r]}function yw(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const a=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||a?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Mg(e,t){for(const n of e)if(!$2(n,{upTo:t}))return n}function $2(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function U2(e){return e instanceof HTMLInputElement&&"select"in e}function ea(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&U2(e)&&t&&e.select()}}var Eg=B2();function B2(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Ig(e,t),e.unshift(t)},remove(t){var n;e=Ig(e,t),(n=e[0])==null||n.resume()}}}function Ig(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function H2(e){return e.filter(t=>t.tagName!=="A")}var W2="Portal",pu=u.forwardRef((e,t)=>{var l;const{container:n,...r}=e,[a,o]=u.useState(!1);ba(()=>o(!0),[]);const i=n||a&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return i?Fj.createPortal(s.jsx(xt.div,{...r,ref:t}),i):null});pu.displayName=W2;function q2(e,t){return u.useReducer((n,r)=>t[n][r]??n,e)}var br=e=>{const{present:t,children:n}=e,r=K2(t),a=typeof n=="function"?n({present:r.isPresent}):u.Children.only(n),o=wt(r.ref,V2(a));return typeof n=="function"||r.isPresent?u.cloneElement(a,{ref:o}):null};br.displayName="Presence";function K2(e){const[t,n]=u.useState(),r=u.useRef(null),a=u.useRef(e),o=u.useRef("none"),i=e?"mounted":"unmounted",[l,c]=q2(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return u.useEffect(()=>{const d=Sl(r.current);o.current=l==="mounted"?d:"none"},[l]),ba(()=>{const d=r.current,p=a.current;if(p!==e){const f=o.current,h=Sl(d);e?c("MOUNT"):h==="none"||(d==null?void 0:d.display)==="none"?c("UNMOUNT"):c(p&&f!==h?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,c]),ba(()=>{if(t){let d;const p=t.ownerDocument.defaultView??window,m=h=>{const x=Sl(r.current).includes(CSS.escape(h.animationName));if(h.target===t&&x&&(c("ANIMATION_END"),!a.current)){const b=t.style.animationFillMode;t.style.animationFillMode="forwards",d=p.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},f=h=>{h.target===t&&(o.current=Sl(r.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",m),t.addEventListener("animationend",m),()=>{p.clearTimeout(d),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",m),t.removeEventListener("animationend",m)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:u.useCallback(d=>{r.current=d?getComputedStyle(d):null,n(d)},[])}}function Sl(e){return(e==null?void 0:e.animationName)||"none"}function V2(e){var r,a;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var wd=0;function bw(){u.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Lg()),document.body.insertAdjacentElement("beforeend",e[1]??Lg()),wd++,()=>{wd===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),wd--}},[])}function Lg(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var pr=function(){return pr=Object.assign||function(t){for(var n,r=1,a=arguments.length;r<a;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},pr.apply(this,arguments)};function ww(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]]);return n}function G2(e,t,n){if(n||arguments.length===2)for(var r=0,a=t.length,o;r<a;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}var Yl="right-scroll-bar-position",Ql="width-before-scroll-bar",Y2="with-scroll-bars-hidden",Q2="--removed-body-scroll-bar-size";function kd(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function X2(e,t){var n=u.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var a=n.value;a!==r&&(n.value=r,n.callback(r,a))}}}})[0];return n.callback=t,n.facade}var J2=typeof window<"u"?u.useLayoutEffect:u.useEffect,Dg=new WeakMap;function Z2(e,t){var n=X2(null,function(r){return e.forEach(function(a){return kd(a,r)})});return J2(function(){var r=Dg.get(n);if(r){var a=new Set(r),o=new Set(e),i=n.current;a.forEach(function(l){o.has(l)||kd(l,null)}),o.forEach(function(l){a.has(l)||kd(l,i)})}Dg.set(n,e)},[e]),n}function e_(e){return e}function t_(e,t){t===void 0&&(t=e_);var n=[],r=!1,a={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(o){var i=t(o,r);return n.push(i),function(){n=n.filter(function(l){return l!==i})}},assignSyncMedium:function(o){for(r=!0;n.length;){var i=n;n=[],i.forEach(o)}n={push:function(l){return o(l)},filter:function(){return n}}},assignMedium:function(o){r=!0;var i=[];if(n.length){var l=n;n=[],l.forEach(o),i=n}var c=function(){var p=i;i=[],p.forEach(o)},d=function(){return Promise.resolve().then(c)};d(),n={push:function(p){i.push(p),d()},filter:function(p){return i=i.filter(p),n}}}};return a}function n_(e){e===void 0&&(e={});var t=t_(null);return t.options=pr({async:!0,ssr:!1},e),t}var kw=function(e){var t=e.sideCar,n=ww(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return u.createElement(r,pr({},n))};kw.isSideCarExport=!0;function r_(e,t){return e.useMedium(t),kw}var Cw=n_(),Cd=function(){},mu=u.forwardRef(function(e,t){var n=u.useRef(null),r=u.useState({onScrollCapture:Cd,onWheelCapture:Cd,onTouchMoveCapture:Cd}),a=r[0],o=r[1],i=e.forwardProps,l=e.children,c=e.className,d=e.removeScrollBar,p=e.enabled,m=e.shards,f=e.sideCar,h=e.noRelative,y=e.noIsolation,x=e.inert,b=e.allowPinchZoom,v=e.as,g=v===void 0?"div":v,w=e.gapMode,k=ww(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=f,N=Z2([n,t]),S=pr(pr({},k),a);return u.createElement(u.Fragment,null,p&&u.createElement(C,{sideCar:Cw,removeScrollBar:d,shards:m,noRelative:h,noIsolation:y,inert:x,setCallbacks:o,allowPinchZoom:!!b,lockRef:n,gapMode:w}),i?u.cloneElement(u.Children.only(l),pr(pr({},S),{ref:N})):u.createElement(g,pr({},S,{className:c,ref:N}),l))});mu.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};mu.classNames={fullWidth:Ql,zeroRight:Yl};var a_=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function o_(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=a_();return t&&e.setAttribute("nonce",t),e}function s_(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function i_(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var l_=function(){var e=0,t=null;return{add:function(n){e==0&&(t=o_())&&(s_(t,n),i_(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},c_=function(){var e=l_();return function(t,n){u.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Sw=function(){var e=c_(),t=function(n){var r=n.styles,a=n.dynamic;return e(r,a),null};return t},u_={left:0,top:0,right:0,gap:0},Sd=function(e){return parseInt(e||"",10)||0},d_=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],a=t[e==="padding"?"paddingRight":"marginRight"];return[Sd(n),Sd(r),Sd(a)]},p_=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return u_;var t=d_(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},m_=Sw(),Bo="data-scroll-locked",f_=function(e,t,n,r){var a=e.left,o=e.top,i=e.right,l=e.gap;return n===void 0&&(n="margin"),`
.`.concat(Y2,` {
overflow: hidden `).concat(r,`;
padding-right: `).concat(l,"px ").concat(r,`;
}
body[`).concat(Bo,`] {
overflow: hidden `).concat(r,`;
overscroll-behavior: contain;
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
padding-left: `.concat(a,`px;
padding-top: `).concat(o,`px;
padding-right: `).concat(i,`px;
margin-left:0;
margin-top:0;
margin-right: `).concat(l,"px ").concat(r,`;
`),n==="padding"&&"padding-right: ".concat(l,"px ").concat(r,";")].filter(Boolean).join(""),`
}
.`).concat(Yl,` {
right: `).concat(l,"px ").concat(r,`;
}
.`).concat(Ql,` {
margin-right: `).concat(l,"px ").concat(r,`;
}
.`).concat(Yl," .").concat(Yl,` {
right: 0 `).concat(r,`;
}
.`).concat(Ql," .").concat(Ql,` {
margin-right: 0 `).concat(r,`;
}
body[`).concat(Bo,`] {
`).concat(Q2,": ").concat(l,`px;
}
`)},Og=function(){var e=parseInt(document.body.getAttribute(Bo)||"0",10);return isFinite(e)?e:0},h_=function(){u.useEffect(function(){return document.body.setAttribute(Bo,(Og()+1).toString()),function(){var e=Og()-1;e<=0?document.body.removeAttribute(Bo):document.body.setAttribute(Bo,e.toString())}},[])},g_=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,a=r===void 0?"margin":r;h_();var o=u.useMemo(function(){return p_(a)},[a]);return u.createElement(m_,{styles:f_(o,!t,a,n?"":"!important")})},Qp=!1;if(typeof window<"u")try{var Nl=Object.defineProperty({},"passive",{get:function(){return Qp=!0,!0}});window.addEventListener("test",Nl,Nl),window.removeEventListener("test",Nl,Nl)}catch{Qp=!1}var fo=Qp?{passive:!1}:!1,v_=function(e){return e.tagName==="TEXTAREA"},Nw=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!v_(e)&&n[t]==="visible")},x_=function(e){return Nw(e,"overflowY")},y_=function(e){return Nw(e,"overflowX")},Fg=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var a=jw(e,r);if(a){var o=Aw(e,r),i=o[1],l=o[2];if(i>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},b_=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},w_=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},jw=function(e,t){return e==="v"?x_(t):y_(t)},Aw=function(e,t){return e==="v"?b_(t):w_(t)},k_=function(e,t){return e==="h"&&t==="rtl"?-1:1},C_=function(e,t,n,r,a){var o=k_(e,window.getComputedStyle(t).direction),i=o*r,l=n.target,c=t.contains(l),d=!1,p=i>0,m=0,f=0;do{if(!l)break;var h=Aw(e,l),y=h[0],x=h[1],b=h[2],v=x-b-o*y;(y||v)&&jw(e,l)&&(m+=v,f+=y);var g=l.parentNode;l=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(p&&Math.abs(m)<1||!p&&Math.abs(f)<1)&&(d=!0),d},jl=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},zg=function(e){return[e.deltaX,e.deltaY]},$g=function(e){return e&&"current"in e?e.current:e},S_=function(e,t){return e[0]===t[0]&&e[1]===t[1]},N_=function(e){return`
.block-interactivity-`.concat(e,` {pointer-events: none;}
.allow-interactivity-`).concat(e,` {pointer-events: all;}
`)},j_=0,ho=[];function A_(e){var t=u.useRef([]),n=u.useRef([0,0]),r=u.useRef(),a=u.useState(j_++)[0],o=u.useState(Sw)[0],i=u.useRef(e);u.useEffect(function(){i.current=e},[e]),u.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var x=G2([e.lockRef.current],(e.shards||[]).map($g),!0).filter(Boolean);return x.forEach(function(b){return b.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),x.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var l=u.useCallback(function(x,b){if("touches"in x&&x.touches.length===2||x.type==="wheel"&&x.ctrlKey)return!i.current.allowPinchZoom;var v=jl(x),g=n.current,w="deltaX"in x?x.deltaX:g[0]-v[0],k="deltaY"in x?x.deltaY:g[1]-v[1],C,N=x.target,S=Math.abs(w)>Math.abs(k)?"h":"v";if("touches"in x&&S==="h"&&N.type==="range")return!1;var A=window.getSelection(),E=A&&A.anchorNode,_=E?E===N||E.contains(N):!1;if(_)return!1;var R=Fg(S,N);if(!R)return!0;if(R?C=S:(C=S==="v"?"h":"v",R=Fg(S,N)),!R)return!1;if(!r.current&&"changedTouches"in x&&(w||k)&&(r.current=C),!C)return!0;var T=r.current||C;return C_(T,b,x,T==="h"?w:k)},[]),c=u.useCallback(function(x){var b=x;if(!(!ho.length||ho[ho.length-1]!==o)){var v="deltaY"in b?zg(b):jl(b),g=t.current.filter(function(C){return C.name===b.type&&(C.target===b.target||b.target===C.shadowParent)&&S_(C.delta,v)})[0];if(g&&g.should){b.cancelable&&b.preventDefault();return}if(!g){var w=(i.current.shards||[]).map($g).filter(Boolean).filter(function(C){return C.contains(b.target)}),k=w.length>0?l(b,w[0]):!i.current.noIsolation;k&&b.cancelable&&b.preventDefault()}}},[]),d=u.useCallback(function(x,b,v,g){var w={name:x,delta:b,target:v,should:g,shadowParent:__(v)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(k){return k!==w})},1)},[]),p=u.useCallback(function(x){n.current=jl(x),r.current=void 0},[]),m=u.useCallback(function(x){d(x.type,zg(x),x.target,l(x,e.lockRef.current))},[]),f=u.useCallback(function(x){d(x.type,jl(x),x.target,l(x,e.lockRef.current))},[]);u.useEffect(function(){return ho.push(o),e.setCallbacks({onScrollCapture:m,onWheelCapture:m,onTouchMoveCapture:f}),document.addEventListener("wheel",c,fo),document.addEventListener("touchmove",c,fo),document.addEventListener("touchstart",p,fo),function(){ho=ho.filter(function(x){return x!==o}),document.removeEventListener("wheel",c,fo),document.removeEventListener("touchmove",c,fo),document.removeEventListener("touchstart",p,fo)}},[]);var h=e.removeScrollBar,y=e.inert;return u.createElement(u.Fragment,null,y?u.createElement(o,{styles:N_(a)}):null,h?u.createElement(g_,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function __(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const P_=r_(Cw,A_);var bf=u.forwardRef(function(e,t){return u.createElement(mu,pr({},e,{ref:t,sideCar:P_}))});bf.classNames=mu.classNames;var T_=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},go=new WeakMap,Al=new WeakMap,_l={},Nd=0,_w=function(e){return e&&(e.host||_w(e.parentNode))},R_=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=_w(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},M_=function(e,t,n,r){var a=R_(t,Array.isArray(e)?e:[e]);_l[n]||(_l[n]=new WeakMap);var o=_l[n],i=[],l=new Set,c=new Set(a),d=function(m){!m||l.has(m)||(l.add(m),d(m.parentNode))};a.forEach(d);var p=function(m){!m||c.has(m)||Array.prototype.forEach.call(m.children,function(f){if(l.has(f))p(f);else try{var h=f.getAttribute(r),y=h!==null&&h!=="false",x=(go.get(f)||0)+1,b=(o.get(f)||0)+1;go.set(f,x),o.set(f,b),i.push(f),x===1&&y&&Al.set(f,!0),b===1&&f.setAttribute(n,"true"),y||f.setAttribute(r,"true")}catch(v){console.error("aria-hidden: cannot operate on ",f,v)}})};return p(t),l.clear(),Nd++,function(){i.forEach(function(m){var f=go.get(m)-1,h=o.get(m)-1;go.set(m,f),o.set(m,h),f||(Al.has(m)||m.removeAttribute(r),Al.delete(m)),h||m.removeAttribute(n)}),Nd--,Nd||(go=new WeakMap,go=new WeakMap,Al=new WeakMap,_l={})}},Pw=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),a=T_(e);return a?(r.push.apply(r,Array.from(a.querySelectorAll("[aria-live], script"))),M_(r,a,n,"aria-hidden")):function(){return null}};function E_(e){const t=I_(e),n=u.forwardRef((r,a)=>{const{children:o,...i}=r,l=u.Children.toArray(o),c=l.find(D_);if(c){const d=c.props.children,p=l.map(m=>m===c?u.Children.count(d)>1?u.Children.only(null):u.isValidElement(d)?d.props.children:null:m);return s.jsx(t,{...i,ref:a,children:u.isValidElement(d)?u.cloneElement(d,void 0,p):null})}return s.jsx(t,{...i,ref:a,children:o})});return n.displayName=`${e}.Slot`,n}function I_(e){const t=u.forwardRef((n,r)=>{const{children:a,...o}=n;if(u.isValidElement(a)){const i=F_(a),l=O_(o,a.props);return a.type!==u.Fragment&&(l.ref=r?_a(r,i):i),u.cloneElement(a,l)}return u.Children.count(a)>1?u.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var L_=Symbol("radix.slottable");function D_(e){return u.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===L_}function O_(e,t){const n={...t};for(const r in t){const a=e[r],o=t[r];/^on[A-Z]/.test(r)?a&&o?n[r]=(...l)=>{const c=o(...l);return a(...l),c}:a&&(n[r]=a):r==="style"?n[r]={...a,...o}:r==="className"&&(n[r]=[a,o].filter(Boolean).join(" "))}return{...e,...n}}function F_(e){var r,a;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var fu="Dialog",[Tw,Rw]=Aa(fu),[z_,tr]=Tw(fu),Mw=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:a,onOpenChange:o,modal:i=!0}=e,l=u.useRef(null),c=u.useRef(null),[d,p]=uu({prop:r,defaultProp:a??!1,onChange:o,caller:fu});return s.jsx(z_,{scope:t,triggerRef:l,contentRef:c,contentId:$a(),titleId:$a(),descriptionId:$a(),open:d,onOpenChange:p,onOpenToggle:u.useCallback(()=>p(m=>!m),[p]),modal:i,children:n})};Mw.displayName=fu;var Ew="DialogTrigger",Iw=u.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=tr(Ew,n),o=wt(t,a.triggerRef);return s.jsx(xt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":Cf(a.open),...r,ref:o,onClick:Re(e.onClick,a.onOpenToggle)})});Iw.displayName=Ew;var wf="DialogPortal",[$_,Lw]=Tw(wf,{forceMount:void 0}),Dw=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:a}=e,o=tr(wf,t);return s.jsx($_,{scope:t,forceMount:n,children:u.Children.map(r,i=>s.jsx(br,{present:n||o.open,children:s.jsx(pu,{asChild:!0,container:a,children:i})}))})};Dw.displayName=wf;var Mc="DialogOverlay",Ow=u.forwardRef((e,t)=>{const n=Lw(Mc,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,o=tr(Mc,e.__scopeDialog);return o.modal?s.jsx(br,{present:r||o.open,children:s.jsx(B_,{...a,ref:t})}):null});Ow.displayName=Mc;var U_=E_("DialogOverlay.RemoveScroll"),B_=u.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=tr(Mc,n);return s.jsx(bf,{as:U_,allowPinchZoom:!0,shards:[a.contentRef],children:s.jsx(xt.div,{"data-state":Cf(a.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Qa="DialogContent",Fw=u.forwardRef((e,t)=>{const n=Lw(Qa,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,o=tr(Qa,e.__scopeDialog);return s.jsx(br,{present:r||o.open,children:o.modal?s.jsx(H_,{...a,ref:t}):s.jsx(W_,{...a,ref:t})})});Fw.displayName=Qa;var H_=u.forwardRef((e,t)=>{const n=tr(Qa,e.__scopeDialog),r=u.useRef(null),a=wt(t,n.contentRef,r);return u.useEffect(()=>{const o=r.current;if(o)return Pw(o)},[]),s.jsx(zw,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Re(e.onCloseAutoFocus,o=>{var i;o.preventDefault(),(i=n.triggerRef.current)==null||i.focus()}),onPointerDownOutside:Re(e.onPointerDownOutside,o=>{const i=o.detail.originalEvent,l=i.button===0&&i.ctrlKey===!0;(i.button===2||l)&&o.preventDefault()}),onFocusOutside:Re(e.onFocusOutside,o=>o.preventDefault())})}),W_=u.forwardRef((e,t)=>{const n=tr(Qa,e.__scopeDialog),r=u.useRef(!1),a=u.useRef(!1);return s.jsx(zw,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var i,l;(i=e.onCloseAutoFocus)==null||i.call(e,o),o.defaultPrevented||(r.current||(l=n.triggerRef.current)==null||l.focus(),o.preventDefault()),r.current=!1,a.current=!1},onInteractOutside:o=>{var c,d;(c=e.onInteractOutside)==null||c.call(e,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const i=o.target;((d=n.triggerRef.current)==null?void 0:d.contains(i))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&a.current&&o.preventDefault()}})}),zw=u.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:o,...i}=e,l=tr(Qa,n),c=u.useRef(null),d=wt(t,c);return bw(),s.jsxs(s.Fragment,{children:[s.jsx(yf,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:o,children:s.jsx(du,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":Cf(l.open),...i,ref:d,onDismiss:()=>l.onOpenChange(!1)})}),s.jsxs(s.Fragment,{children:[s.jsx(K_,{titleId:l.titleId}),s.jsx(G_,{contentRef:c,descriptionId:l.descriptionId})]})]})}),kf="DialogTitle",$w=u.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=tr(kf,n);return s.jsx(xt.h2,{id:a.titleId,...r,ref:t})});$w.displayName=kf;var Uw="DialogDescription",Bw=u.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=tr(Uw,n);return s.jsx(xt.p,{id:a.descriptionId,...r,ref:t})});Bw.displayName=Uw;var Hw="DialogClose",Ww=u.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=tr(Hw,n);return s.jsx(xt.button,{type:"button",...r,ref:t,onClick:Re(e.onClick,()=>a.onOpenChange(!1))})});Ww.displayName=Hw;function Cf(e){return e?"open":"closed"}var qw="DialogTitleWarning",[q_,Kw]=h2(qw,{contentName:Qa,titleName:kf,docsSlug:"dialog"}),K_=({titleId:e})=>{const t=Kw(qw),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return u.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},V_="DialogDescriptionWarning",G_=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Kw(V_).contentName}}.`;return u.useEffect(()=>{var o;const a=(o=e.current)==null?void 0:o.getAttribute("aria-describedby");t&&a&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},hu=Mw,Y_=Iw,gu=Dw,hs=Ow,gs=Fw,vs=$w,Ki=Bw,Vi=Ww,Q_=Symbol("radix.slottable");function X_(e){const t=({children:n})=>s.jsx(s.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=Q_,t}var Vw="AlertDialog",[J_]=Aa(Vw,[Rw]),qr=Rw(),Gw=e=>{const{__scopeAlertDialog:t,...n}=e,r=qr(t);return s.jsx(hu,{...r,...n,modal:!0})};Gw.displayName=Vw;var Z_="AlertDialogTrigger",eP=u.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=qr(n);return s.jsx(Y_,{...a,...r,ref:t})});eP.displayName=Z_;var tP="AlertDialogPortal",Yw=e=>{const{__scopeAlertDialog:t,...n}=e,r=qr(t);return s.jsx(gu,{...r,...n})};Yw.displayName=tP;var nP="AlertDialogOverlay",Qw=u.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=qr(n);return s.jsx(hs,{...a,...r,ref:t})});Qw.displayName=nP;var Ho="AlertDialogContent",[rP,aP]=J_(Ho),oP=X_("AlertDialogContent"),Xw=u.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...a}=e,o=qr(n),i=u.useRef(null),l=wt(t,i),c=u.useRef(null);return s.jsx(q_,{contentName:Ho,titleName:Jw,docsSlug:"alert-dialog",children:s.jsx(rP,{scope:n,cancelRef:c,children:s.jsxs(gs,{role:"alertdialog",...o,...a,ref:l,onOpenAutoFocus:Re(a.onOpenAutoFocus,d=>{var p;d.preventDefault(),(p=c.current)==null||p.focus({preventScroll:!0})}),onPointerDownOutside:d=>d.preventDefault(),onInteractOutside:d=>d.preventDefault(),children:[s.jsx(oP,{children:r}),s.jsx(iP,{contentRef:i})]})})})});Xw.displayName=Ho;var Jw="AlertDialogTitle",Zw=u.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=qr(n);return s.jsx(vs,{...a,...r,ref:t})});Zw.displayName=Jw;var e0="AlertDialogDescription",t0=u.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=qr(n);return s.jsx(Ki,{...a,...r,ref:t})});t0.displayName=e0;var sP="AlertDialogAction",n0=u.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=qr(n);return s.jsx(Vi,{...a,...r,ref:t})});n0.displayName=sP;var r0="AlertDialogCancel",a0=u.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:a}=aP(r0,n),o=qr(n),i=wt(t,a);return s.jsx(Vi,{...o,...r,ref:i})});a0.displayName=r0;var iP=({contentRef:e})=>{const t=`\`${Ho}\` requires a description for the component to be accessible for screen reader users.
You can add a description to the \`${Ho}\` by passing a \`${e0}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${Ho}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return u.useEffect(()=>{var r;document.getElementById((r=e.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},lP=Gw,cP=Yw,o0=Qw,s0=Xw,i0=n0,l0=a0,c0=Zw,u0=t0;function d0(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(n=d0(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function p0(){for(var e,t,n=0,r="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=d0(e))&&(r&&(r+=" "),r+=t);return r}const Sf="-",uP=e=>{const t=pP(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{const l=i.split(Sf);return l[0]===""&&l.length!==1&&l.shift(),m0(l,t)||dP(i)},getConflictingClassGroupIds:(i,l)=>{const c=n[i]||[];return l&&r[i]?[...c,...r[i]]:c}}},m0=(e,t)=>{var i;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),a=r?m0(e.slice(1),r):void 0;if(a)return a;if(t.validators.length===0)return;const o=e.join(Sf);return(i=t.validators.find(({validator:l})=>l(o)))==null?void 0:i.classGroupId},Ug=/^\[(.+)\]$/,dP=e=>{if(Ug.test(e)){const t=Ug.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},pP=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return fP(Object.entries(e.classGroups),n).forEach(([o,i])=>{Xp(i,r,o,t)}),r},Xp=(e,t,n,r)=>{e.forEach(a=>{if(typeof a=="string"){const o=a===""?t:Bg(t,a);o.classGroupId=n;return}if(typeof a=="function"){if(mP(a)){Xp(a(r),t,n,r);return}t.validators.push({validator:a,classGroupId:n});return}Object.entries(a).forEach(([o,i])=>{Xp(i,Bg(t,o),n,r)})})},Bg=(e,t)=>{let n=e;return t.split(Sf).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},mP=e=>e.isThemeGetter,fP=(e,t)=>t?e.map(([n,r])=>{const a=r.map(o=>typeof o=="string"?t+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([i,l])=>[t+i,l])):o);return[n,a]}):e,hP=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const a=(o,i)=>{n.set(o,i),t++,t>e&&(t=0,r=n,n=new Map)};return{get(o){let i=n.get(o);if(i!==void 0)return i;if((i=r.get(o))!==void 0)return a(o,i),i},set(o,i){n.has(o)?n.set(o,i):a(o,i)}}},f0="!",gP=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,a=t[0],o=t.length,i=l=>{const c=[];let d=0,p=0,m;for(let b=0;b<l.length;b++){let v=l[b];if(d===0){if(v===a&&(r||l.slice(b,b+o)===t)){c.push(l.slice(p,b)),p=b+o;continue}if(v==="/"){m=b;continue}}v==="["?d++:v==="]"&&d--}const f=c.length===0?l:l.substring(p),h=f.startsWith(f0),y=h?f.substring(1):f,x=m&&m>p?m-p:void 0;return{modifiers:c,hasImportantModifier:h,baseClassName:y,maybePostfixModifierPosition:x}};return n?l=>n({className:l,parseClassName:i}):i},vP=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},xP=e=>({cache:hP(e.cacheSize),parseClassName:gP(e),...uP(e)}),yP=/\s+/,bP=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:a}=t,o=[],i=e.trim().split(yP);let l="";for(let c=i.length-1;c>=0;c-=1){const d=i[c],{modifiers:p,hasImportantModifier:m,baseClassName:f,maybePostfixModifierPosition:h}=n(d);let y=!!h,x=r(y?f.substring(0,h):f);if(!x){if(!y){l=d+(l.length>0?" "+l:l);continue}if(x=r(f),!x){l=d+(l.length>0?" "+l:l);continue}y=!1}const b=vP(p).join(":"),v=m?b+f0:b,g=v+x;if(o.includes(g))continue;o.push(g);const w=a(x,y);for(let k=0;k<w.length;++k){const C=w[k];o.push(v+C)}l=d+(l.length>0?" "+l:l)}return l};function wP(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=h0(t))&&(r&&(r+=" "),r+=n);return r}const h0=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=h0(e[r]))&&(n&&(n+=" "),n+=t);return n};function kP(e,...t){let n,r,a,o=i;function i(c){const d=t.reduce((p,m)=>m(p),e());return n=xP(d),r=n.cache.get,a=n.cache.set,o=l,l(c)}function l(c){const d=r(c);if(d)return d;const p=bP(c,n);return a(c,p),p}return function(){return o(wP.apply(null,arguments))}}const at=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},g0=/^\[(?:([a-z-]+):)?(.+)\]$/i,CP=/^\d+\/\d+$/,SP=new Set(["px","full","screen"]),NP=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,jP=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,AP=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,_P=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,PP=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Pr=e=>Wo(e)||SP.has(e)||CP.test(e),Xr=e=>xs(e,"length",OP),Wo=e=>!!e&&!Number.isNaN(Number(e)),jd=e=>xs(e,"number",Wo),Ls=e=>!!e&&Number.isInteger(Number(e)),TP=e=>e.endsWith("%")&&Wo(e.slice(0,-1)),Ue=e=>g0.test(e),Jr=e=>NP.test(e),RP=new Set(["length","size","percentage"]),MP=e=>xs(e,RP,v0),EP=e=>xs(e,"position",v0),IP=new Set(["image","url"]),LP=e=>xs(e,IP,zP),DP=e=>xs(e,"",FP),Ds=()=>!0,xs=(e,t,n)=>{const r=g0.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},OP=e=>jP.test(e)&&!AP.test(e),v0=()=>!1,FP=e=>_P.test(e),zP=e=>PP.test(e),$P=()=>{const e=at("colors"),t=at("spacing"),n=at("blur"),r=at("brightness"),a=at("borderColor"),o=at("borderRadius"),i=at("borderSpacing"),l=at("borderWidth"),c=at("contrast"),d=at("grayscale"),p=at("hueRotate"),m=at("invert"),f=at("gap"),h=at("gradientColorStops"),y=at("gradientColorStopPositions"),x=at("inset"),b=at("margin"),v=at("opacity"),g=at("padding"),w=at("saturate"),k=at("scale"),C=at("sepia"),N=at("skew"),S=at("space"),A=at("translate"),E=()=>["auto","contain","none"],_=()=>["auto","hidden","clip","visible","scroll"],R=()=>["auto",Ue,t],T=()=>[Ue,t],F=()=>["",Pr,Xr],z=()=>["auto",Wo,Ue],K=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],$=()=>["solid","dashed","dotted","double","none"],W=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],P=()=>["start","end","center","between","around","evenly","stretch"],D=()=>["","0",Ue],G=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Y=()=>[Wo,Ue];return{cacheSize:500,separator:":",theme:{colors:[Ds],spacing:[Pr,Xr],blur:["none","",Jr,Ue],brightness:Y(),borderColor:[e],borderRadius:["none","","full",Jr,Ue],borderSpacing:T(),borderWidth:F(),contrast:Y(),grayscale:D(),hueRotate:Y(),invert:D(),gap:T(),gradientColorStops:[e],gradientColorStopPositions:[TP,Xr],inset:R(),margin:R(),opacity:Y(),padding:T(),saturate:Y(),scale:Y(),sepia:D(),skew:Y(),space:T(),translate:T()},classGroups:{aspect:[{aspect:["auto","square","video",Ue]}],container:["container"],columns:[{columns:[Jr]}],"break-after":[{"break-after":G()}],"break-before":[{"break-before":G()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...K(),Ue]}],overflow:[{overflow:_()}],"overflow-x":[{"overflow-x":_()}],"overflow-y":[{"overflow-y":_()}],overscroll:[{overscroll:E()}],"overscroll-x":[{"overscroll-x":E()}],"overscroll-y":[{"overscroll-y":E()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[x]}],"inset-x":[{"inset-x":[x]}],"inset-y":[{"inset-y":[x]}],start:[{start:[x]}],end:[{end:[x]}],top:[{top:[x]}],right:[{right:[x]}],bottom:[{bottom:[x]}],left:[{left:[x]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Ls,Ue]}],basis:[{basis:R()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Ue]}],grow:[{grow:D()}],shrink:[{shrink:D()}],order:[{order:["first","last","none",Ls,Ue]}],"grid-cols":[{"grid-cols":[Ds]}],"col-start-end":[{col:["auto",{span:["full",Ls,Ue]},Ue]}],"col-start":[{"col-start":z()}],"col-end":[{"col-end":z()}],"grid-rows":[{"grid-rows":[Ds]}],"row-start-end":[{row:["auto",{span:[Ls,Ue]},Ue]}],"row-start":[{"row-start":z()}],"row-end":[{"row-end":z()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Ue]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Ue]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...P()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...P(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...P(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[g]}],px:[{px:[g]}],py:[{py:[g]}],ps:[{ps:[g]}],pe:[{pe:[g]}],pt:[{pt:[g]}],pr:[{pr:[g]}],pb:[{pb:[g]}],pl:[{pl:[g]}],m:[{m:[b]}],mx:[{mx:[b]}],my:[{my:[b]}],ms:[{ms:[b]}],me:[{me:[b]}],mt:[{mt:[b]}],mr:[{mr:[b]}],mb:[{mb:[b]}],ml:[{ml:[b]}],"space-x":[{"space-x":[S]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[S]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Ue,t]}],"min-w":[{"min-w":[Ue,t,"min","max","fit"]}],"max-w":[{"max-w":[Ue,t,"none","full","min","max","fit","prose",{screen:[Jr]},Jr]}],h:[{h:[Ue,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Ue,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Ue,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Ue,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Jr,Xr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",jd]}],"font-family":[{font:[Ds]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Ue]}],"line-clamp":[{"line-clamp":["none",Wo,jd]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Pr,Ue]}],"list-image":[{"list-image":["none",Ue]}],"list-style-type":[{list:["none","disc","decimal",Ue]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[v]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[v]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...$(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Pr,Xr]}],"underline-offset":[{"underline-offset":["auto",Pr,Ue]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:T()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ue]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ue]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[v]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...K(),EP]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",MP]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},LP]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[y]}],"gradient-via-pos":[{via:[y]}],"gradient-to-pos":[{to:[y]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[l]}],"border-w-x":[{"border-x":[l]}],"border-w-y":[{"border-y":[l]}],"border-w-s":[{"border-s":[l]}],"border-w-e":[{"border-e":[l]}],"border-w-t":[{"border-t":[l]}],"border-w-r":[{"border-r":[l]}],"border-w-b":[{"border-b":[l]}],"border-w-l":[{"border-l":[l]}],"border-opacity":[{"border-opacity":[v]}],"border-style":[{border:[...$(),"hidden"]}],"divide-x":[{"divide-x":[l]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[l]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[v]}],"divide-style":[{divide:$()}],"border-color":[{border:[a]}],"border-color-x":[{"border-x":[a]}],"border-color-y":[{"border-y":[a]}],"border-color-s":[{"border-s":[a]}],"border-color-e":[{"border-e":[a]}],"border-color-t":[{"border-t":[a]}],"border-color-r":[{"border-r":[a]}],"border-color-b":[{"border-b":[a]}],"border-color-l":[{"border-l":[a]}],"divide-color":[{divide:[a]}],"outline-style":[{outline:["",...$()]}],"outline-offset":[{"outline-offset":[Pr,Ue]}],"outline-w":[{outline:[Pr,Xr]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:F()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[v]}],"ring-offset-w":[{"ring-offset":[Pr,Xr]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Jr,DP]}],"shadow-color":[{shadow:[Ds]}],opacity:[{opacity:[v]}],"mix-blend":[{"mix-blend":[...W(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":W()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",Jr,Ue]}],grayscale:[{grayscale:[d]}],"hue-rotate":[{"hue-rotate":[p]}],invert:[{invert:[m]}],saturate:[{saturate:[w]}],sepia:[{sepia:[C]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[d]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[p]}],"backdrop-invert":[{"backdrop-invert":[m]}],"backdrop-opacity":[{"backdrop-opacity":[v]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[C]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Ue]}],duration:[{duration:Y()}],ease:[{ease:["linear","in","out","in-out",Ue]}],delay:[{delay:Y()}],animate:[{animate:["none","spin","ping","pulse","bounce",Ue]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[k]}],"scale-x":[{"scale-x":[k]}],"scale-y":[{"scale-y":[k]}],rotate:[{rotate:[Ls,Ue]}],"translate-x":[{"translate-x":[A]}],"translate-y":[{"translate-y":[A]}],"skew-x":[{"skew-x":[N]}],"skew-y":[{"skew-y":[N]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Ue]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ue]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":T()}],"scroll-mx":[{"scroll-mx":T()}],"scroll-my":[{"scroll-my":T()}],"scroll-ms":[{"scroll-ms":T()}],"scroll-me":[{"scroll-me":T()}],"scroll-mt":[{"scroll-mt":T()}],"scroll-mr":[{"scroll-mr":T()}],"scroll-mb":[{"scroll-mb":T()}],"scroll-ml":[{"scroll-ml":T()}],"scroll-p":[{"scroll-p":T()}],"scroll-px":[{"scroll-px":T()}],"scroll-py":[{"scroll-py":T()}],"scroll-ps":[{"scroll-ps":T()}],"scroll-pe":[{"scroll-pe":T()}],"scroll-pt":[{"scroll-pt":T()}],"scroll-pr":[{"scroll-pr":T()}],"scroll-pb":[{"scroll-pb":T()}],"scroll-pl":[{"scroll-pl":T()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ue]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Pr,Xr,jd]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},UP=kP($P);function j(...e){return UP(p0(e))}var BP=Symbol.for("react.lazy"),Ec=wm[" use ".trim().toString()];function HP(e){return typeof e=="object"&&e!==null&&"then"in e}function x0(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===BP&&"_payload"in e&&HP(e._payload)}function y0(e){const t=qP(e),n=u.forwardRef((r,a)=>{let{children:o,...i}=r;x0(o)&&typeof Ec=="function"&&(o=Ec(o._payload));const l=u.Children.toArray(o),c=l.find(VP);if(c){const d=c.props.children,p=l.map(m=>m===c?u.Children.count(d)>1?u.Children.only(null):u.isValidElement(d)?d.props.children:null:m);return s.jsx(t,{...i,ref:a,children:u.isValidElement(d)?u.cloneElement(d,void 0,p):null})}return s.jsx(t,{...i,ref:a,children:o})});return n.displayName=`${e}.Slot`,n}var WP=y0("Slot");function qP(e){const t=u.forwardRef((n,r)=>{let{children:a,...o}=n;if(x0(a)&&typeof Ec=="function"&&(a=Ec(a._payload)),u.isValidElement(a)){const i=YP(a),l=GP(o,a.props);return a.type!==u.Fragment&&(l.ref=r?_a(r,i):i),u.cloneElement(a,l)}return u.Children.count(a)>1?u.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var KP=Symbol("radix.slottable");function VP(e){return u.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===KP}function GP(e,t){const n={...t};for(const r in t){const a=e[r],o=t[r];/^on[A-Z]/.test(r)?a&&o?n[r]=(...l)=>{const c=o(...l);return a(...l),c}:a&&(n[r]=a):r==="style"?n[r]={...a,...o}:r==="className"&&(n[r]=[a,o].filter(Boolean).join(" "))}return{...e,...n}}function YP(e){var r,a;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const Hg=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Wg=p0,b0=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return Wg(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:a,defaultVariants:o}=t,i=Object.keys(a).map(d=>{const p=n==null?void 0:n[d],m=o==null?void 0:o[d];if(p===null)return null;const f=Hg(p)||Hg(m);return a[d][f]}),l=n&&Object.entries(n).reduce((d,p)=>{let[m,f]=p;return f===void 0||(d[m]=f),d},{}),c=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((d,p)=>{let{class:m,className:f,...h}=p;return Object.entries(h).every(y=>{let[x,b]=y;return Array.isArray(b)?b.includes({...o,...l}[x]):{...o,...l}[x]===b})?[...d,m,f]:d},[]);return Wg(e,i,c,n==null?void 0:n.class,n==null?void 0:n.className)},Nf=b0("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),fe=u.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...a},o)=>{const i=r?WP:"button";return s.jsx(i,{className:j(Nf({variant:t,size:n,className:e})),ref:o,...a})});fe.displayName="Button";const QP=lP,XP=cP,w0=u.forwardRef(({className:e,...t},n)=>s.jsx(o0,{ref:n,className:j("fixed inset-0 z-50 bg-background/45 backdrop-blur-[3px] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));w0.displayName=o0.displayName;const k0=u.forwardRef(({className:e,...t},n)=>s.jsxs(XP,{children:[s.jsx(w0,{}),s.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:s.jsx(s0,{ref:n,className:j("grid w-full max-w-lg origin-center gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 sm:rounded-lg",e),...t})})]}));k0.displayName=s0.displayName;const C0=({className:e,...t})=>s.jsx("div",{className:j("flex flex-col space-y-2 text-center sm:text-left",e),...t});C0.displayName="AlertDialogHeader";const S0=({className:e,...t})=>s.jsx("div",{className:j("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});S0.displayName="AlertDialogFooter";const N0=u.forwardRef(({className:e,...t},n)=>s.jsx(c0,{ref:n,className:j("text-lg font-semibold",e),...t}));N0.displayName=c0.displayName;const j0=u.forwardRef(({className:e,...t},n)=>s.jsx(u0,{ref:n,className:j("text-sm text-muted-foreground",e),...t}));j0.displayName=u0.displayName;const A0=u.forwardRef(({className:e,...t},n)=>s.jsx(i0,{ref:n,className:j(Nf(),e),...t}));A0.displayName=i0.displayName;const _0=u.forwardRef(({className:e,...t},n)=>s.jsx(l0,{ref:n,className:j(Nf({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));_0.displayName=l0.displayName;const JP="nanobot.locale",Ai=[{code:"en",label:"English",nativeLabel:"English"},{code:"zh-CN",label:"Chinese (Simplified)",nativeLabel:"简体中文"},{code:"zh-TW",label:"Chinese (Traditional)",nativeLabel:"繁體中文"},{code:"fr",label:"French",nativeLabel:"Français"},{code:"ja",label:"Japanese",nativeLabel:"日本語"},{code:"ko",label:"Korean",nativeLabel:"한국어"},{code:"es",label:"Spanish",nativeLabel:"Español"},{code:"vi",label:"Vietnamese",nativeLabel:"Tiếng Việt"},{code:"id",label:"Indonesian",nativeLabel:"Bahasa Indonesia"}],ai="zh-CN",ZP="zh-CN";function P0(e){if(!e)return ai;const t=e.trim();if(!t)return ai;const n=Ai.find(i=>i.code===t);if(n)return n.code;const r=t.toLowerCase();if(r==="zh"||r.startsWith("zh-cn")||r.startsWith("zh-sg"))return"zh-CN";if(r.startsWith("zh-tw")||r.startsWith("zh-hk")||r.startsWith("zh-mo")||r.startsWith("zh-hant"))return"zh-TW";const a=r.split("-")[0],o=Ai.find(i=>i.code.toLowerCase()===a);return(o==null?void 0:o.code)??ai}function eT(){return ai}function tT(e){if(!(typeof window>"u"))try{window.localStorage.setItem(JP,e)}catch{}}function nT(e){typeof document>"u"||(document.documentElement.lang=e)}function rT(e){return Ai.find(t=>t.code===e)??Ai[0]}const aT={brand:"nanobot",loading:{connecting:"Connecting to nanobot…",boot:"Loading nanobot…"},error:{title:"Couldn't reach nanobot",gatewayHint:"Make sure the gateway is running (`nanobot gateway`) and that this page is open on the same machine."},auth:{title:"Authentication required",hint:"Enter the secret configured as tokenIssueSecret in your gateway config.",placeholder:"Password",submit:"Connect",invalid:"Invalid password. Try again."},account:{section:"Account",logoutHint:"Disconnect this browser from the gateway.",logout:"Sign out"},system:{section:"System",restartHint:"Restart nanobot to apply runtime changes.",restart:"Restart nanobot",restarting:"Restarting...",restartEngine:"Restart engine",restartingEngine:"Restarting engine..."},restart:{completed:"Restart completed in {{seconds}}s."},documentTitle:{base:"nanobot",chat:"{{title}} · nanobot"},meta:{description:"nanobot web UI — chat with your nanobot workspace."}},oT={navigation:"Sidebar navigation",collapse:"Collapse sidebar",newChat:"New chat",searchAria:"Search",searchPlaceholder:"Search",searchResults:"Results",noSearchResults:"No matching chats.",recent:"Recent",settings:"Settings",language:{label:"Language",ariaLabel:"Change language"},apps:"Apps",automations:"Automations",skills:{title:"Skills"}},sT={backToChat:"Back to chat",sidebar:{title:"Settings",ariaLabel:"Settings sections"},nav:{general:"General",byok:"BYOK",overview:"Overview",appearance:"Appearance",models:"Models",providers:"Providers",image:"Image",voice:"Voice",browser:"Web",cliApps:"CLI Apps",mcp:"MCP",runtime:"System",advanced:"Security",apps:"Apps",automations:"Automations",skills:"Skills"},sections:{interface:"Interface",ai:"AI",system:"System",about:"About",status:"Status",localPreferences:"Local preferences",presets:"Presets",imageGeneration:"Image generation",imageDefaults:"Defaults",webSearch:"Web search",webBehavior:"Behavior",cliApps:"CLI apps",mcp:"MCP services",identity:"Identity",webuiSafety:"Web safety",capabilities:"Capabilities",apps:"Apps",nativeHost:"Native host",hostSafety:"App safety",voiceInput:"Voice input"},models:{selectModel:"Select model",addConfiguration:"Add configuration",newConfiguration:"New model configuration",newConfigurationHelp:"Save a provider and model as a one-click option.",configurationName:"Configuration name",configurationNameHelp:"Rename this saved model configuration.",configurationNamePlaceholder:"Fast writing",searchModels:"Search or type model ID",useCustomModel:"Use",loadingModels:"Loading models...",searchCatalog:"Search provider catalog to choose a model.",modelsAvailable:"available",noModelResults:"No matching models.",loadFailed:"Model list unavailable.",unsupportedModelList:"Type a model ID manually.",providerNotConfigured:"Configure this provider before loading models.",autoProviderCustomOnly:"Auto provider mode uses custom model IDs."},rows:{theme:"Theme",language:"Language",provider:"Provider",model:"Model",restart:"Restart nanobot",configPath:"Config path",activePreset:"Active preset",gateway:"Gateway",restartState:"Restart state",pendingChanges:"Pending changes",currentModel:"Current configuration",selectedPreset:"Selected preset",presetModel:"Preset model",density:"Density",activityMode:"Activity detail",codeWrap:"Code wrapping",brandLogos:"Brand logos",maxResults:"Max results",timeout:"Timeout",jinaReader:"Jina reader",imageGeneration:"Image generation",imageProvider:"Image provider",imageProviderStatus:"Provider status",imageProviderBase:"Provider base",imageModel:"Image model",defaultAspectRatio:"Default aspect",defaultImageSize:"Default size",maxImagesPerTurn:"Max images per turn",imageSaveDir:"Save directory",botName:"Bot name",botIcon:"Bot icon",timezone:"Timezone",workspacePath:"Default workspace",localServiceAccess:"Local services",webuiDefaultAccess:"Default access",cliAppsCatalog:"Catalog",cliAppsFilter:"Filter",engine:"Engine",logs:"Logs",diagnostics:"Diagnostics",contextWindow:"Context window",transcription:"Transcription",transcriptionProvider:"Provider",transcriptionProviderStatus:"Provider status",transcriptionModel:"Model",transcriptionLanguage:"Language",voiceLimits:"Limits"},help:{theme:"Switch between light and dark appearance.",language:"Choose the language used by the WebUI.",provider:"Select the provider that should serve new model requests.",model:"Set the default model name used by nanobot.",configPath:"The gateway configuration file currently in use.",currentModel:"Used for new replies.",selectedModelProvider:"Set by the selected model.",selectedModelValue:"Set by the selected model.",selectedPreset:"Named presets are read-only here; edit them in config.json.",presetModel:"Switch to Default to edit model and provider from the WebUI.",density:"Stored only in this browser.",activityMode:"Choose how much agent activity chrome to show by default.",codeWrap:"Keep long code lines readable on smaller screens.",brandLogos:"Show third-party provider and CLI logos in Settings.",maxResults:"Results returned by each web_search call.",timeout:"Seconds before a search provider request times out.",jinaReader:"Use Jina Reader for web_fetch when available.",imageGeneration:"Expose generate_image in chats when a configured image provider is available.",imageProvider:"Choose the registry provider used by generate_image.",imageProviderStatus:"Image generation reuses provider credentials from Providers.",imageModel:"Model name sent to the selected image provider.",defaultAspectRatio:"Used when the prompt does not choose an aspect ratio.",defaultImageSize:"Size hint sent to providers that support it.",maxImagesPerTurn:"Upper bound for one generate_image request.",botName:"Shown wherever nanobot uses a display name.",botIcon:"Short emoji or text shown with the bot name.",timezone:"Used for schedules and time-aware replies.",cliAppsCatalog:"Install only the app-specific CLI adapters nanobot can run locally; native apps stay untouched.",cliAppsFilter:"Search by app, category, or capability.",localServiceAccess:"Allow Full Access shell commands to reach localhost services.",webuiDefaultAccess:"Used by web chats without a project-specific permission.",securityManagedControls:"Web fetches always protect local, private, and metadata services. Core channel safety stays in config.json.",logs:"Open the native engine log folder.",diagnostics:"Export a small runtime report for support.",localServiceAccessNative:"Allow Full Access shell commands to reach services on this Mac.",webuiDefaultAccessNative:"Used by native chats without a project-specific permission.",contextWindow:"Choose the default context budget for this model configuration.",transcription:"Transcribe microphone input before sending it. Chat channel voice messages use the same settings.",transcriptionProvider:"Uses the matching provider credentials from Providers.",transcriptionProviderStatus:"API keys stay under providers, not in transcription settings.",transcriptionModel:"Leave as the resolved default unless your provider needs a custom model id.",transcriptionLanguage:"Optional ISO-639 hint such as en, zh, ja, or ko."},timezone:{select:"Select timezone",search:"Search timezone",empty:"No matching timezones."},cliApps:{allCategories:"All categories",availableCount:"{{count}} apps",installedCount:"{{count}} CLIs installed",summary:"{{installed}} of {{total}} CLIs installed",filterAll:"All",filterInstalled:"Installed CLIs",filterNotInstalled:"Not installed",searchPlaceholder:"Search CLIs",loading:"Loading CLI Apps...",empty:"No CLI Apps match this filter.",statusInstalled:"CLI installed",statusMissing:"Missing",statusAvailable:"Available",statusUnsupported:"Unsupported",statusNotInstalled:"CLI not installed",requires:"Requires",test:"Test CLI",update:"Update CLI",uninstall:"Uninstall CLI",install:"Install CLI",readyTitle:"@{{name}} is ready",readyStatus:"Ready",readyTry:"Try @{{name}}",readyCopied:"Copied",readyPrompt:"Use @{{name}} to inspect what this CLI can do.",openChat:"Open chat",unsupported:"Unsupported",unavailable:"Unavailable",noDescription:"No description available."},about:{version:"Version",checking:"Checking...",checkForUpdates:"Check for updates",upToDate:"You're up to date",updateAvailable:"Update available v{{version}}"},mcp:{allCategories:"All categories",summary:"{{installed}} of {{total}} presets enabled",filterAll:"All",filterInstalled:"Enabled",filterNotInstalled:"Not enabled",searchPlaceholder:"Search MCP presets",moreOptions:"More MCP options",moreOptionsSubtitle:"Add a custom server or import mcp.json.",customTitle:"Custom MCP",customSubtitle:"Add any stdio, HTTP, or SSE MCP server.",customAction:"Custom",importAction:"Import",serverName:"Server name",serverUrl:"URL",transport:"Transport",command:"Command",args:"Args JSON",headers:"Headers JSON",env:"Env JSON",timeout:"Tool timeout",advancedOptions:"Advanced options",hideAdvanced:"Hide advanced",saveCustom:"Save MCP",configImport:"Import mcp.json",importConfig:"Import",restartRequired:"Restart nanobot to connect updated MCP tools.",toolsFound:"{{count}} tools",loading:"Loading MCP presets...",empty:"No MCP presets match this filter.",openDocs:"Open docs",test:"Test",remove:"Remove",enable:"Enable",enabled:"Enabled",setup:"Connect",configure:"Connect",connectTitle:"Connect {{name}}",connectHint:"Add the key from your account settings.",saveAndEnable:"Save and enable",updateSetup:"Update setup",configured:"configured",keepExisting:"Leave blank to keep existing",statusConfigured:"Configured",statusMissingCredentials:"Needs key",statusMissingDependency:"Needs dependency",statusComingSoon:"Coming soon",statusNotInstalled:"Not enabled",toolScope:"Tools",allTools:"All",noTools:"None",testForTools:"Run Test to inspect and choose individual tools."},values:{light:"Light",dark:"Dark",notAvailable:"Not available",enabled:"Enabled",disabled:"Disabled",restartPending:"Restart pending",ready:"Ready",privateEngine:"Private engine",unixSocket:"Unix socket",defaultWorkspace:"Default workspace",comfortable:"Comfortable",compact:"Compact",auto:"Auto",expanded:"Expanded",on:"On",off:"Off",defaultPermission:"Default Permission",fullAccess:"Full Access",configured:"Configured",notConfigured:"Not configured",pending:"Pending",restartingEngine:"Restarting"},status:{loading:"Loading settings...",loadError:"Could not load settings",unsaved:"Unsaved changes.",upToDate:"Up to date.",savedRestart:"Saved. Restart nanobot to apply.",restartAfterSaving:"Save changes, then restart when ready.",savedRestartApply:"Saved. Restart when ready.",imageProviderRestart:"Image provider changes saved. Restart when ready.",hostRestartAfterSaving:"Save changes and nanobot will restart its engine.",hostRestartPending:"Saved. Restarting engine when ready.",hostApiUnavailable:"Host actions are only available inside the native app.",logsOpened:"Opened logs folder.",logsOpenFailed:"Could not open logs folder.",diagnosticsExported:"Diagnostics exported to {{path}}.",diagnosticsExportFailed:"Could not export diagnostics."},actions:{save:"Save",saving:"Saving",edit:"Edit",cancel:"Cancel",open:"Open",export:"Export",opening:"Opening...",exporting:"Exporting..."},byok:{description:"Bring your own provider keys. Nanobot reads these values from the current config and only configured providers can be selected in General.",configured:"Configured",notConfigured:"Not configured",configuredSection:"Configured",notConfiguredSection:"Not configured",showMore:"Show {{count}} more",showLess:"Show fewer",apiKey:"API key",apiBase:"API base",apiKeyPlaceholder:"Enter API key",apiKeyConfiguredPlaceholder:"Leave blank to keep the current key",configuredKeyHint:"Configured key",apiBasePlaceholder:"Use provider default",apiKeyRequired:"API key is required to configure this provider.",showApiKey:"Show API key",hideApiKey:"Hide API key",noConfiguredProviders:"No configured providers",configureFirst:"Configure a provider in BYOK first.",openByok:"Open BYOK",tabs:{ariaLabel:"BYOK credential type",llm:"LLM",webSearch:"Web Search"},webSearch:{provider:"Search provider",providerHelp:"Choose the backend used by the web search tool.",selectProvider:"Select provider",credentials:"Credentials",noCredentialRequired:"No key required",noCredentialHelp:"DuckDuckGo works without a saved API key.",apiKeyHelp:"Stored in config and masked after saving.",baseUrl:"Base URL",baseUrlHelp:"SearXNG needs the URL of your own instance.",baseUrlPlaceholder:"https://search.example.com",apiKeyRequired:"API key is required for this search provider.",baseUrlRequired:"Base URL is required for SearXNG.",missingCredential:"Add the required credential before saving.",saveHint:"Changes apply to new web search requests."}},overview:{model:"Current model",providers:"Providers",configuredCount:"{{count}} configured",totalProviders:"{{count}} available",webSearch:"Web search",imageGeneration:"Image generation",voiceInput:"Voice input",workspace:"Workspace"},usage:{title:"Token activity",shortTitle:"Token Usage",subtitle:"Provider-reported usage over the last 12 months.",empty:"Token activity will appear after new model replies.",totalTokens:"Total tokens",peakTokens:"Peak tokens",thirtyDayTokens:"30-day tokens",currentStreak:"Current streak",longestStreak:"Longest streak",daysValue:"{{count}}d",last30:"30 days",activeDays:"Active days",requests:"Requests",estimated:"estimated",includesEstimates:"includes estimates",cellTitle:"{{date}}: {{tokens}} tokens, {{requests}} requests",sources:{user:"Chat",api:"API",cron:"Automations",dream:"Memory",system:"System"}},providers:{searchPlaceholder:"Search providers",noMatches:"No providers match this search.",saveProvider:"Save provider"},legal:{thirdPartyBrands:"Product names, logos, and brands are property of their respective owners. Use is for identification only and does not imply endorsement."},image:{selectProvider:"Select provider",selectAspect:"Select aspect",selectSize:"Select size",configureProvider:"Configure provider",missingCredential:"Configure this provider before enabling image generation."},apps:{description:"Add app CLIs and MCP services nanobot can use from chat.",cliLabel:"CLI",mcpLabel:"MCP",filterAll:"All",filterCli:"CLI apps",filterMcp:"MCP services",enabledSummary:"{{count}} enabled",caption:"{{cli}} CLI · {{mcp}} MCP",searchPlaceholder:"Search Apps",featured:"Featured",loading:"Loading Apps...",empty:"No apps match this filter."},automations:{filters:{all:"All",active:"Active",paused:"Paused",failed:"Needs attention",system:"System"},sort:{next:"Next run",last:"Last run",updated:"Updated",name:"Name"},search:"Search task, message, linked chat, or schedule",queue:"Queue",loading:"Loading automations...",noMatches:"No automations match this view.",empty:"No automations yet.",emptyHint:"Create one from where it should run so nanobot keeps the right context.",oneShot:"One-time",systemTask:"System-managed automation",labels:{schedule:"Schedule",next:"Next",origin:"Linked chat",created:"Created",updated:"Updated"},runNow:"Run now",pause:"Pause",resume:"Resume",edit:"Edit",delete:"Delete",protected:"Protected",editTitle:"Edit automation",save:"Save",deleteTitle:"Delete automation",deleteDescription:"This removes {{name}} from the cron store. Past chat messages stay in the session.",cancel:"Cancel",status:{system:"System",running:"Running now",paused:"Paused",failed:"Failed",completed:"Completed",noSchedule:"No schedule",active:"Active"},origin:{system:"System",unknown:"No linked chat"},channels:{api:"API",cli:"CLI",dingtalk:"DingTalk",discord:"Discord",email:"Email",feishu:"Feishu",matrix:"Matrix",msteams:"Microsoft Teams",qq:"QQ",slack:"Slack",telegram:"Telegram",wechat:"WeChat",wecom:"WeCom",weixin:"WeChat",whatsapp:"WhatsApp"},schedule:{at:"At {{time}}",every:"Every {{duration}}",cron:"Cron {{expr}}",cronWithTz:"Cron {{expr}} · {{tz}}",withTz:"{{summary}} · {{tz}}",dailyAt:"Daily at {{time}}",weekdaysAt:"Weekdays at {{time}}",hourlyAt:"Hourly at :{{minute}}",hourlyWindow:"Hourly {{start}}-{{end}} at :{{minute}}",custom:"Custom schedule"},next:{paused:"Paused",pending:"Running now",none:"No next run"},message:{showMore:"Show full message",showLess:"Show less"},fields:{name:"Name",message:"Message",scheduleType:"Schedule type",every:"Every",unit:"Unit",cronExpression:"Cron expression",timezone:"Timezone",runAt:"Run at"},scheduleTypes:{every:"Interval",cron:"Cron",at:"Once"},everyUnits:{second:"Seconds",minute:"Minutes",hour:"Hours",day:"Days"},validation:{nameRequired:"Name is required.",messageRequired:"Message is required.",intervalRequired:"Interval must be a positive number.",cronRequired:"Cron expression is required.",timeRequired:"Run time is required.",futureRequired:"Run time must be in the future."}},oauth:{authentication:"OAuth authentication",signIn:"Sign in",signingIn:"Signing in...",signInAgain:"Sign in again",signOut:"Sign out",signedInAs:"Signed in as {{account}}",signInHelp:"Sign in from this device; no API key is stored in config.",signInRequired:"Sign in required",signInBeforeSaving:"Sign in before saving this OAuth provider as the active model provider.",signedIn:"Signed in",notSignedIn:"Not signed in"},skills:{description:"Review the instruction skills this agent can load during a conversation.",caption:"{{available}} available · {{total}} total",featured:"Agent skills",empty:"No skills are available.",sourceWorkspace:"Custom",sourceBuiltin:"Built-in",statusAvailable:"Available",statusUnavailable:"Unavailable",unavailableReason:"Missing: {{reason}}",openDetails:"Open details for {{name}}",loadingDetail:"Loading skill details...",loadFailed:"Could not load skill details.",descriptionTitle:"Description",source:"Source",status:"Status",requirements:"Requirements",noRequirements:"No explicit requirements.",commands:"Commands",environment:"Environment variables",missingCommands:"Missing CLI",missingEnvironment:"Missing ENV",unavailableReasonLabel:"Unavailable reason",rawInstructions:"Raw SKILL.md",rawInstructionsEmpty:"No raw instructions.",detailDescription:"Details for {{name}}."},voice:{selectProvider:"Select provider",configureProvider:"Configure provider",languageAuto:"Auto"}},iT={fallbackTitle:"Chat {{id}}",forkTitle:"Fork: {{title}}",loading:"Loading…",noSessions:"No sessions yet.",showMore:"Show {{count}} more",collapsed:"{{count}} hidden chats",showLess:"Show less",actions:"Chat actions for {{title}}",newInProject:"Start a new chat in {{project}}",activity:{running:"Agent running",complete:"Agent finished",updated:"New activity"},pin:"Pin",unpin:"Unpin",rename:"Rename",renameTitle:"Rename chat",renameDescription:"Choose a local sidebar name for this chat.",renamePlaceholder:"Chat name",renameProjectTitle:"Rename project",renameProjectDescription:"Choose a local sidebar name for this project.",renameProjectPlaceholder:"Project name",renameSave:"Save",archive:"Archive",unarchive:"Unarchive",showArchived:"Show archived",hideArchived:"Hide archived",delete:"Delete",newChat:"New chat",groups:{pinned:"Pinned",all:"Chats",projects:"Projects",today:"Today",yesterday:"Yesterday",earlier:"Earlier",archived:"Archived"}},lT={title:"Delete this chat?",description:"This action cannot be undone.",cancel:"Cancel",confirm:"Delete",automationsDescription:"This chat has scheduled automations. Deleting it will also delete them.",moreAutomations:"+ {{count}} more",confirmWithAutomations:"Delete",schedule:{at:"{{time}}",every:"Every {{duration}}",cron:"Cron {{expr}}",cronWithTz:"Cron {{expr}} · {{tz}}",unknown:"Custom schedule"},next:{label:"Next: {{time}}",disabled:"Paused",none:"No next run"}},cT={idle:"Idle",connecting:"Connecting…",open:"Connected",reconnecting:"Reconnecting…",closed:"Disconnected",error:"Connection error"},uT={loadingConversation:"Loading conversation…",empty:{greetings:{workOn:"What should we work on?",start:"Where should we start?",build:"What are we building today?",tackle:"What should we tackle together?"},quickActions:{plan:{title:"Create a project plan",prompt:"Create a concise project plan for what I should build next."},analyze:{title:"Analyze this data",prompt:"Help me analyze this data and call out the most important patterns."},brainstorm:{title:"Brainstorm ideas",prompt:"Brainstorm a few practical ideas and tradeoffs for this problem."},code:{title:"Write code",prompt:"Help me write the code for this task, starting with the smallest useful change."},summarize:{title:"Summarize this document",prompt:"Summarize this document and list the key takeaways."},more:{title:"More",prompt:"Show me a few useful ways you can help in this workspace."}},imageQuickActions:{icon:{title:"Design an app icon",prompt:"Generate a clean 1:1 app icon for nanobot: friendly robot, simple vector style, soft blue and white palette, no text."},sticker:{title:"Make a sticker",prompt:"Generate a cute sticker-style image of a tiny robot assistant, transparent-looking background, expressive and playful."},poster:{title:"Create a poster",prompt:"Generate a polished poster concept for a personal AI assistant, modern composition, strong visual hierarchy, suitable for a landing page."},product:{title:"Product mockup",prompt:"Generate a clean product mockup image for a conversational AI web app, minimal interface, premium lighting, realistic device frame."},portrait:{title:"Stylized portrait",prompt:"Generate a stylized portrait of a friendly AI companion, soft lighting, detailed but approachable, modern illustration style."},edit:{title:"Edit an image",prompt:"Help me edit an image. Ask me to upload or reference the image first, then generate the edited result."}}},header:{toggleSidebar:"Toggle sidebar",newChat:"Start a new chat",toggleTheme:"Toggle theme from header",settings:"Open settings",sessionInfo:"Session details"},sessionInfo:{title:"Session",untitled:"Untitled chat",automations:"Automations",count:"{{count}}",loading:"Loading automations...",loadFailed:"Could not load automations.",empty:"No automations in this session yet.",disabled:"Off",schedule:{at:"{{time}}",every:"Every {{duration}}",cron:"Cron {{expr}}",cronWithTz:"Cron {{expr}} · {{tz}}",unknown:"Custom schedule"},next:{label:"{{time}}",pending:"Runs shortly",disabled:"Paused",none:"No next run"}},composer:{placeholderThread:"Type your message…",placeholderHero:"Ask anything...",placeholderOpening:"Opening a new chat…",placeholderStreaming:"Model is responding…",inputAria:"Message input",sendHint:"Enter to send · Shift+Enter for newline",runRuntimeTitle:"Running · {{elapsed}}",goalStateStrip:"Goal · {{label}}",goalStateFallback:"Goal",goalStateExpandAria:"Show full goal",goalStateSheetTitle:"Goal",goalStateCloseAria:"Close goal",send:"Send message",stop:"Stop response",modelNotConfigured:"Model not configured",configureModel:"Configure model",queued:{label:"Queued guidance",guide:"Guide",delete:"Delete guidance",edit:"Edit guidance",drag:"Drag to reorder"},attachImage:"Attach image",imageMode:{label:"Image Generation",toggle:"Toggle image generation mode",placeholder:"Describe or edit an image…",aspectAria:"Image aspect ratio",aspectLabel:"Image aspect",aspect:{auto:"Auto","1_1":"Square 1:1","3_4":"Portrait 3:4","9_16":"Story 9:16","4_3":"Landscape 4:3","16_9":"Wide 16:9"}},tools:{search:"Search",reason:"Reason",deepResearch:"Deep research",voice:"Voice input"},voice:{hint:"Click to dictate or hold",stop:"Stop recording",transcribing:"Transcribing...",recordingStatus:"Recording {{time}}"},voiceErrors:{unsupported:"Voice input is not supported in this browser.",permission:"Microphone permission is required.",notConfigured:"Configure a transcription provider first.",tooLong:"Recording is too long.",tooShort:"Hold a little longer to record voice.",noInput:"No microphone input detected.",failed:"Could not transcribe audio."},slash:{ariaLabel:"Slash commands",label:"commands",navigateHint:"↑↓ Navigate",selectHint:"Enter/Tab Select",closeHint:"Esc Close",badges:{current:"Current",recent:"Recent"},details:{goalActive:"Goal is running",goalReady:"Start a sustained objective",history:"Show recent messages",stopRunning:"Running now"},commands:{new:{title:"New chat",description:"Stop the current task and start a fresh conversation."},stop:{title:"Stop current task",description:"Cancel the active agent turn for this chat."},restart:{title:"Restart nanobot",description:"Restart the bot process in place."},status:{title:"Show status",description:"Display runtime, provider, and channel status."},model:{title:"Model",description:"Show or switch the active model preset."},history:{title:"Show conversation history",description:"Print the last N persisted conversation messages."},dream:{title:"Run Dream",description:"Manually trigger memory consolidation."},dream_log:{title:"Show Dream log",description:"Show what the last Dream consolidation changed."},dream_restore:{title:"Restore memory",description:"Revert memory to a previous Dream snapshot."},goal:{title:"Long-running goal",description:"Tell the agent to treat this as a sustained multi-step goal."},help:{title:"Show help",description:"List available slash commands."},pairing:{title:"Pairing",description:"Manage pairing requests."}}},mentions:{ariaLabel:"Apps",label:"Apps",cliGroup:"CLI apps",mcpGroup:"MCP services",cliBadge:"CLI",mcpBadge:"MCP",cliDescription:"Use @{{name}} as a local CLI app",mcpDescription:"Use @{{name}} as an MCP server"},encoding:"Encoding…",remove:"Remove attachment",normalizedSizeHint:"{{orig}} → {{current}} (auto)",imageRejected:{unsupported_type:"Unsupported file type",too_many_images:"Max {{max}} images per message",magic_mismatch:"File doesn't look like a real image",decode_failed:"Couldn't decode this image",too_large:"Image is too large — try a smaller one",io:"Couldn't read this file"},workspace:{accessAria:"Workspace access mode",projectAria:"Choose project",projectPlaceholder:"Select project",default:"Default Permission",full:"Full Access"}},scrollToBottom:"Scroll to bottom",loadEarlier:"Load earlier messages",forkedFromHistory:"Forked from history",promptNavigator:{open:"Open prompt navigator",title:"Prompts",search:"Search prompts",noResults:"No matching prompts.",jumpTo:"Jump to prompt: {{label}}"}},dT={streaming:"streaming",assistantTyping:"Assistant is typing",toolSingle:"Using a tool",toolMany:"Used {{count}} tools",toolSummary:"{{count}} tool",toolSummaryMany:"{{count}} tools",reasoningTools:"Reasoning · {{count}} tools",reasoningToolsSingular:"Reasoning · 1 tool",reasoning:"Thinking",reasoningStreaming:"Thinking…",reasoningSummary:"Reasoning",agentActivitySummary:"{{reasoning}} steps · {{tools}} tool calls",agentActivityToolsOnly:"{{tools}} tool calls",agentActivityLiveSummary:"Working… · {{reasoning}} steps · {{tools}} tool calls",agentActivityLiveToolsOnly:"Working… · {{tools}} tool calls",activityThinkingFor:"Thinking for {{duration}}",activityThought:"Thought",activityThoughtFor:"Thought for {{duration}}",activityWorkingFor:"Working for {{duration}}",activityWorked:"Worked",activityWorkedFor:"Worked for {{duration}}",cliActivityRunningOne:"Using @{{name}}",cliActivityRanOne:"Used @{{name}}",cliActivityFailedOne:"Failed @{{name}}",cliActivityRunningMany:"Using {{count}} CLI apps",cliActivityRanMany:"Used {{count}} CLI apps",cliActivityFailedMany:"{{count}} CLI apps failed",cliRunRunning:"Using",cliRunRan:"Used",cliRunFailed:"Failed",imageAttachment:"Image attachment",automationSourceFallback:"Automation",automationTriggered:"Triggered automatically",forkFromHere:"Fork",copyReply:"Copy",copiedReply:"Copied",turnLatencyTitle:"Response time (end-to-end)"},pT={title:"Image preview",open:"View image",prev:"Previous image",next:"Next image",close:"Close image preview"},mT={aria:"File preview",close:"Close file preview",loading:"Loading preview...",failed:"Could not preview this file.",routeMissing:"File preview needs the latest gateway. Restart nanobot gateway and try again.",resize:"Resize file preview",truncated:"Preview is truncated because this file is large."},fT={fallbackLanguage:"code",copyAria:"Copy code",copy:"Copy",copied:"Copied"},hT={dismiss:"Dismiss"},gT={messageTooBig:{title:"Message too large",body:"The server rejected your last message because it exceeded the size limit. Remove some images or try smaller files, then send again."},workspaceScopeRejected:{title:"Workspace was not changed",body:"Nanobot kept the previous workspace because the requested project or access mode was rejected by the gateway."}},vT={dialog:{defaultProject:"Default workspace",manual:"Paste path",manualPlaceholder:"/Users/name/project",usePath:"Use Path",absolutePathRequired:"Enter an absolute folder path on this machine."}},xT={app:aT,sidebar:oT,settings:sT,chat:iT,deleteConfirm:lT,connection:cT,thread:uT,message:dT,lightbox:pT,filePreview:mT,code:fT,common:hT,errors:gT,workspace:vT},yT={brand:"nanobot",loading:{connecting:"正在连接 nanobot…",boot:"正在加载 nanobot…"},error:{title:"无法连接到 nanobot",gatewayHint:"请确认 gateway 已启动(`nanobot gateway`),并且当前页面与 gateway 运行在同一台机器上。"},auth:{title:"需要验证",hint:"请输入 gateway 配置中的 tokenIssueSecret。",placeholder:"密码",submit:"连接",invalid:"密码无效,请重试。"},account:{section:"账户",logoutHint:"断开此浏览器与 gateway 的连接。",logout:"退出登录"},system:{section:"系统",restartHint:"重启 nanobot 以应用运行时更改。",restart:"重启 nanobot",restarting:"正在重启...",restartEngine:"重启引擎",restartingEngine:"正在重启引擎..."},restart:{completed:"重启已完成,用时 {{seconds}} 秒。"},documentTitle:{base:"nanobot",chat:"{{title}} · nanobot"},meta:{description:"nanobot Web UI —— 与你的 nanobot 工作区对话。"}},bT={navigation:"侧边栏导航",collapse:"收起侧边栏",newChat:"新建对话",searchAria:"搜索",searchPlaceholder:"搜索",searchResults:"搜索结果",noSearchResults:"没有匹配的会话。",recent:"最近对话",settings:"设置",language:{label:"语言",ariaLabel:"切换语言"},apps:"应用",automations:"自动任务",skills:{title:"技能"}},wT={backToChat:"返回聊天",sidebar:{title:"设置",ariaLabel:"设置分区"},nav:{general:"通用",byok:"BYOK",overview:"概览",appearance:"外观",models:"模型",providers:"提供商",image:"图片",voice:"语音",browser:"网页",cliApps:"CLI 应用",mcp:"MCP",runtime:"系统",advanced:"安全",apps:"应用",automations:"自动任务",skills:"技能"},sections:{interface:"界面",ai:"AI",system:"系统",about:"关于",status:"状态",localPreferences:"本地偏好",presets:"预设",imageGeneration:"图片生成",imageDefaults:"默认值",webSearch:"网页搜索",webBehavior:"行为",cliApps:"CLI 应用",mcp:"MCP 服务",identity:"身份",webuiSafety:"WebUI 安全",capabilities:"能力",apps:"应用",nativeHost:"原生宿主",hostSafety:"应用安全",voiceInput:"语音识别"},models:{selectModel:"选择模型",addConfiguration:"添加配置",newConfiguration:"新建模型配置",newConfigurationHelp:"把提供商和模型保存成一键选项。",configurationName:"配置名称",configurationNameHelp:"重命名这个已保存的模型配置。",configurationNamePlaceholder:"快速写作",searchModels:"搜索或输入模型 ID",useCustomModel:"使用",loadingModels:"正在加载模型...",searchCatalog:"搜索提供商目录来选择模型。",modelsAvailable:"可用",noModelResults:"没有匹配的模型。",loadFailed:"模型列表不可用。",unsupportedModelList:"手动输入模型 ID。",providerNotConfigured:"加载模型前请先配置此提供商。",autoProviderCustomOnly:"自动提供商模式使用自定义模型 ID。"},rows:{theme:"主题",language:"语言",provider:"提供商",model:"模型",restart:"重启 nanobot",configPath:"配置路径",activePreset:"当前预设",gateway:"网关",restartState:"重启状态",pendingChanges:"待应用更改",currentModel:"当前配置",selectedPreset:"选中的预设",presetModel:"预设模型",density:"密度",activityMode:"活动详情",codeWrap:"代码换行",brandLogos:"品牌 Logo",maxResults:"最大结果数",timeout:"超时",jinaReader:"Jina 阅读器",imageGeneration:"图片生成",imageProvider:"图片提供商",imageProviderStatus:"提供商状态",imageProviderBase:"提供商地址",imageModel:"图片模型",defaultAspectRatio:"默认比例",defaultImageSize:"默认尺寸",maxImagesPerTurn:"每轮最大图片数",imageSaveDir:"保存目录",botName:"Bot 名称",botIcon:"Bot 图标",timezone:"时区",workspacePath:"默认工作区",localServiceAccess:"本机服务",webuiDefaultAccess:"默认权限",cliAppsCatalog:"目录",cliAppsFilter:"筛选",engine:"引擎",logs:"日志",diagnostics:"诊断",contextWindow:"上下文窗口",transcription:"语音转写",transcriptionProvider:"提供商",transcriptionProviderStatus:"提供商状态",transcriptionModel:"模型",transcriptionLanguage:"语言",voiceLimits:"限制"},help:{theme:"在浅色和深色外观之间切换。",language:"选择 WebUI 使用的语言。",provider:"选择处理新模型请求的提供商。",model:"设置 nanobot 默认使用的模型名称。",configPath:"当前网关正在使用的配置文件。",currentModel:"用于新的回复。",selectedModelProvider:"由选中的模型决定。",selectedModelValue:"由选中的模型决定。",selectedPreset:"命名预设在这里只读;请在 config.json 中编辑。",presetModel:"切回 Default 后可在 WebUI 中编辑模型和提供商。",density:"只保存在此浏览器中。",activityMode:"选择默认显示多少 agent 活动细节。",codeWrap:"让长代码行在小屏幕上也易读。",brandLogos:"在设置中显示第三方提供商和 CLI 图标。",maxResults:"每次 web_search 调用返回的结果数。",timeout:"搜索提供商请求超时前的秒数。",jinaReader:"可用时为 web_fetch 使用 Jina Reader。",imageGeneration:"配置图片提供商后,在聊天中开放 generate_image。",imageProvider:"选择 generate_image 使用的注册提供商。",imageProviderStatus:"图片生成会复用「提供商」里的凭据。",imageModel:"发送给所选图片提供商的模型名称。",defaultAspectRatio:"当提示词没有指定比例时使用。",defaultImageSize:"发送给支持此选项的提供商的尺寸提示。",maxImagesPerTurn:"单次 generate_image 请求可生成的图片上限。",botName:"显示在 nanobot 使用展示名称的地方。",botIcon:"显示在 Bot 名称旁的短 emoji 或文字。",timezone:"用于日程和需要时间感知的回复。",cliAppsCatalog:"只安装 nanobot 可本地运行的应用 CLI 适配器;不会改动原生应用。",cliAppsFilter:"按应用、类别或能力搜索。",localServiceAccess:"允许完全访问权限下的 shell 命令访问 localhost 服务。",webuiDefaultAccess:"用于没有单独项目权限的 Web 聊天。",securityManagedControls:"网页抓取始终保护本机、内网和元数据服务。核心渠道安全仍由 config.json 管理。",logs:"打开原生引擎日志文件夹。",diagnostics:"导出一份用于支持排查的小型运行报告。",localServiceAccessNative:"允许完全访问权限下的 shell 命令访问这台 Mac 上的服务。",webuiDefaultAccessNative:"用于没有单独项目权限的原生聊天。",contextWindow:"选择此模型配置的默认上下文预算。",transcription:"发送前先把麦克风输入转写到输入框。聊天渠道里的语音消息也使用同一套设置。",transcriptionProvider:"使用「提供商」中对应提供商的凭据。",transcriptionProviderStatus:"API Key 仍保存在 providers 里,不写进 transcription 设置。",transcriptionModel:"除非提供商需要自定义模型 ID否则保持解析后的默认值即可。",transcriptionLanguage:"可选 ISO-639 语言提示,例如 en、zh、ja 或 ko。"},timezone:{select:"选择时区",search:"搜索时区",empty:"没有匹配的时区。"},cliApps:{allCategories:"全部分类",availableCount:"{{count}} 个应用",installedCount:"已安装 {{count}} 个 CLI",summary:"CLI 已安装 {{installed}} / {{total}}",filterAll:"全部",filterInstalled:"已装 CLI",filterNotInstalled:"未装 CLI",searchPlaceholder:"搜索 CLI",loading:"正在加载 CLI 应用...",empty:"没有匹配的 CLI 应用。",statusInstalled:"CLI 已安装",statusMissing:"缺失",statusAvailable:"可用",statusUnsupported:"暂不支持",statusNotInstalled:"CLI 未安装",requires:"依赖",test:"测试 CLI",update:"更新 CLI",uninstall:"卸载 CLI",install:"安装 CLI",readyTitle:"@{{name}} 已就绪",readyStatus:"就绪",readyTry:"试试 @{{name}}",readyCopied:"已复制",readyPrompt:"用 @{{name}} 看看这个 CLI 能做什么。",openChat:"回到对话",unsupported:"暂不支持",unavailable:"不可用",noDescription:"暂无描述。"},about:{version:"版本",checking:"正在检查...",checkForUpdates:"检查更新",upToDate:"已是最新版本",updateAvailable:"有可用更新 v{{version}}"},mcp:{allCategories:"全部分类",summary:"已启用 {{installed}} / {{total}} 个预设",filterAll:"全部",filterInstalled:"已启用",filterNotInstalled:"未启用",searchPlaceholder:"搜索 MCP 预设",moreOptions:"更多 MCP 选项",moreOptionsSubtitle:"添加自定义服务,或导入 mcp.json。",customTitle:"自定义 MCP",customSubtitle:"添加任意 stdio、HTTP 或 SSE MCP 服务。",customAction:"自定义",importAction:"导入",serverName:"服务名",serverUrl:"URL",transport:"传输方式",command:"命令",args:"Args JSON",headers:"Headers JSON",env:"Env JSON",timeout:"工具超时",advancedOptions:"高级选项",hideAdvanced:"收起高级",saveCustom:"保存 MCP",configImport:"导入 mcp.json",importConfig:"导入",restartRequired:"重启 nanobot 以连接更新后的 MCP 工具。",toolsFound:"{{count}} 个工具",loading:"正在加载 MCP 预设...",empty:"没有匹配的 MCP 预设。",openDocs:"打开文档",test:"测试",remove:"移除",enable:"启用",enabled:"已启用",setup:"连接",configure:"连接",connectTitle:"连接 {{name}}",connectHint:"填入你账户里的 key。",saveAndEnable:"保存并启用",updateSetup:"更新配置",configured:"已配置",keepExisting:"留空则保留当前值",statusConfigured:"已配置",statusMissingCredentials:"需要 key",statusMissingDependency:"缺少依赖",statusComingSoon:"暂不支持",statusNotInstalled:"未启用",toolScope:"工具",allTools:"全部",noTools:"不暴露",testForTools:"运行测试后,可以查看并选择单个工具。"},values:{light:"浅色",dark:"深色",notAvailable:"不可用",enabled:"已启用",disabled:"已禁用",restartPending:"等待重启",ready:"就绪",privateEngine:"私有引擎",unixSocket:"Unix socket",defaultWorkspace:"默认工作区",comfortable:"舒适",compact:"紧凑",auto:"自动",expanded:"展开",on:"开启",off:"关闭",defaultPermission:"默认权限",fullAccess:"完全访问权限",configured:"已配置",notConfigured:"未配置",pending:"等待中",restartingEngine:"正在重启"},status:{loading:"正在加载设置...",loadError:"无法加载设置",unsaved:"有未保存的更改。",upToDate:"已是最新。",savedRestart:"已保存。重启 nanobot 后生效。",restartAfterSaving:"保存更改后,在合适时重启。",savedRestartApply:"已保存。准备好后重启。",imageProviderRestart:"图片提供商更改已保存。准备好后重启。",hostRestartAfterSaving:"保存后 nanobot 会重启引擎。",hostRestartPending:"已保存。准备好后会重启引擎。",hostApiUnavailable:"宿主操作仅在原生应用中可用。",logsOpened:"已打开日志文件夹。",logsOpenFailed:"无法打开日志文件夹。",diagnosticsExported:"诊断已导出到 {{path}}。",diagnosticsExportFailed:"无法导出诊断。"},actions:{save:"保存",saving:"正在保存",edit:"编辑",cancel:"取消",open:"打开",export:"导出",opening:"正在打开...",exporting:"正在导出..."},byok:{description:"自带服务商密钥。Nanobot 会从当前 config 读取这些值,只有已配置的服务商才能在通用设置里选择。",configured:"已配置",notConfigured:"未配置",configuredSection:"已配置",notConfiguredSection:"未配置",showMore:"再显示 {{count}} 个",showLess:"收起",apiKey:"API key",apiBase:"API base",apiKeyPlaceholder:"输入 API key",apiKeyConfiguredPlaceholder:"留空则保留当前 key",configuredKeyHint:"已配置的 key",apiBasePlaceholder:"使用服务商默认地址",apiKeyRequired:"需要 API key 才能配置此服务商。",showApiKey:"显示 API key",hideApiKey:"隐藏 API key",noConfiguredProviders:"没有已配置的服务商",configureFirst:"请先在 BYOK 里配置服务商。",openByok:"打开 BYOK",tabs:{ariaLabel:"BYOK 凭证类型",llm:"LLM",webSearch:"网页搜索"},webSearch:{provider:"搜索服务商",providerHelp:"选择网页搜索工具使用的后端。",selectProvider:"选择服务商",credentials:"凭证",noCredentialRequired:"无需 key",noCredentialHelp:"DuckDuckGo 不需要保存 API key。",apiKeyHelp:"保存到 config 后只显示掩码提示。",baseUrl:"Base URL",baseUrlHelp:"SearXNG 需要你自己的实例地址。",baseUrlPlaceholder:"https://search.example.com",apiKeyRequired:"这个搜索服务商需要 API key。",baseUrlRequired:"SearXNG 需要 Base URL。",missingCredential:"填写所需凭证后才能保存。",saveHint:"改动会应用到新的网页搜索请求。"}},overview:{model:"当前模型",providers:"提供商",configuredCount:"已配置 {{count}} 个",totalProviders:"共 {{count}} 个可用",webSearch:"网页搜索",imageGeneration:"图片生成",voiceInput:"语音识别",workspace:"工作区"},usage:{title:"Token 活动",shortTitle:"Token Usage",subtitle:"最近 12 个月由提供商上报的 token 用量。",empty:"新的模型回复产生后,这里会显示 token 活动。",totalTokens:"累计 Token 数",peakTokens:"峰值 Token 数",thirtyDayTokens:"30 天 Token 数",currentStreak:"当前连续天数",longestStreak:"最长连续天数",daysValue:"{{count}} 天",last30:"30 天",activeDays:"活跃天数",requests:"请求数",estimated:"估算",includesEstimates:"包含估算",cellTitle:"{{date}}{{tokens}} tokens{{requests}} 次请求",sources:{user:"对话",api:"API",cron:"自动任务",dream:"记忆整理",system:"系统"}},providers:{searchPlaceholder:"搜索提供商",noMatches:"没有匹配的提供商。",saveProvider:"保存提供商"},legal:{thirdPartyBrands:"产品名称、Logo 和品牌归各自所有者所有;此处仅用于识别,不代表背书或合作。"},image:{selectProvider:"选择提供商",selectAspect:"选择比例",selectSize:"选择尺寸",configureProvider:"配置提供商",missingCredential:"启用图片生成前请先配置此提供商。"},apps:{description:"添加 nanobot 可在聊天中使用的 App CLI 和 MCP 服务。",cliLabel:"CLI",mcpLabel:"MCP",filterAll:"全部",filterCli:"CLI 应用",filterMcp:"MCP 服务",enabledSummary:"已启用 {{count}} 个",caption:"{{cli}} 个 CLI · {{mcp}} 个 MCP",searchPlaceholder:"搜索应用",featured:"精选",loading:"正在加载应用...",empty:"没有匹配的应用。"},automations:{filters:{all:"全部",active:"运行中",paused:"已暂停",failed:"异常",system:"系统"},sort:{next:"下次运行",last:"上次运行",updated:"更新时间",name:"名称"},search:"搜索任务、消息、关联会话或计划",queue:"任务队列",loading:"正在加载自动任务...",noMatches:"当前视图没有匹配的自动任务。",empty:"暂无自动任务。",emptyHint:"请从它应该运行的来源处创建,这样 nanobot 才能保留正确上下文。",oneShot:"一次性",systemTask:"系统管理的自动任务",labels:{schedule:"计划",next:"下次",origin:"关联会话",created:"创建于",updated:"更新于"},runNow:"立即运行",pause:"暂停",resume:"恢复",edit:"编辑",delete:"删除",protected:"受保护",editTitle:"编辑自动任务",save:"保存",deleteTitle:"删除自动任务",deleteDescription:"这会从 cron 存储中删除 {{name}},历史聊天消息会保留在会话中。",cancel:"取消",status:{system:"系统",running:"正在运行",paused:"已暂停",failed:"失败",completed:"已完成",noSchedule:"无计划",active:"运行中"},origin:{system:"系统",unknown:"未关联会话"},channels:{api:"API",cli:"CLI",dingtalk:"钉钉",discord:"Discord",email:"邮件",feishu:"飞书",matrix:"Matrix",msteams:"Microsoft Teams",qq:"QQ",slack:"Slack",telegram:"Telegram",wechat:"微信",wecom:"企业微信",weixin:"微信",whatsapp:"WhatsApp"},schedule:{at:"在 {{time}}",every:"每 {{duration}}",cron:"Cron {{expr}}",cronWithTz:"Cron {{expr}} · {{tz}}",withTz:"{{summary}} · {{tz}}",dailyAt:"每天 {{time}}",weekdaysAt:"工作日 {{time}}",hourlyAt:"每小时第 {{minute}} 分钟",hourlyWindow:"{{start}}-{{end}} 点每小时第 {{minute}} 分钟",custom:"自定义计划"},next:{paused:"已暂停",pending:"正在运行",none:"没有下次运行"},message:{showMore:"查看完整消息",showLess:"收起消息"},fields:{name:"名称",message:"消息",scheduleType:"计划类型",every:"每隔",unit:"单位",cronExpression:"Cron 表达式",timezone:"时区",runAt:"运行时间"},scheduleTypes:{every:"间隔",cron:"Cron",at:"一次性"},everyUnits:{second:"秒",minute:"分钟",hour:"小时",day:"天"},validation:{nameRequired:"名称不能为空。",messageRequired:"消息不能为空。",intervalRequired:"间隔必须是正整数。",cronRequired:"Cron 表达式不能为空。",timeRequired:"运行时间不能为空。",futureRequired:"运行时间必须晚于当前时间。"}},oauth:{authentication:"OAuth 认证",signIn:"登录",signingIn:"登录中...",signInAgain:"重新登录",signOut:"退出登录",signedInAs:"已登录为 {{account}}",signInHelp:"从这台设备登录;不会在配置中保存 API key。",signInRequired:"需要登录",signInBeforeSaving:"将此 OAuth 提供商设为当前模型提供商前,请先登录。",signedIn:"已登录",notSignedIn:"未登录"},skills:{description:"查看此 agent 在对话中可以加载的指令技能。",caption:"{{available}} 个可用 · 共 {{total}} 个",featured:"Agent 技能",empty:"暂无可用技能。",sourceWorkspace:"自定义",sourceBuiltin:"内置",statusAvailable:"可用",statusUnavailable:"不可用",unavailableReason:"缺少:{{reason}}",openDetails:"查看 {{name}} 详情",loadingDetail:"正在加载技能详情...",loadFailed:"无法加载技能详情。",descriptionTitle:"完整描述",source:"来源",status:"状态",requirements:"需求",noRequirements:"没有显式需求。",commands:"命令",environment:"环境变量",missingCommands:"缺 CLI",missingEnvironment:"缺 ENV",unavailableReasonLabel:"不可用原因",rawInstructions:"原始 SKILL.md",rawInstructionsEmpty:"没有原始说明。",detailDescription:"{{name}} 的详情。"},voice:{selectProvider:"选择提供商",configureProvider:"配置提供商",languageAuto:"自动"}},kT={fallbackTitle:"对话 {{id}}",forkTitle:"分叉:{{title}}",loading:"加载中…",noSessions:"还没有会话。",showMore:"再显示 {{count}} 个",collapsed:"已折叠 {{count}} 个对话",showLess:"收起",actions:"“{{title}}” 的会话操作",newInProject:"在 {{project}} 中开始新对话",activity:{running:"Agent 正在运行",complete:"Agent 已完成",updated:"有新内容"},pin:"置顶",unpin:"取消置顶",rename:"重命名",renameTitle:"重命名对话",renameDescription:"为这个对话设置一个仅用于 WebUI 侧边栏的名称。",renamePlaceholder:"对话名称",renameProjectTitle:"重命名项目",renameProjectDescription:"为这个项目设置一个仅用于 WebUI 侧边栏的名称。",renameProjectPlaceholder:"项目名称",renameSave:"保存",archive:"归档",unarchive:"取消归档",showArchived:"显示归档",hideArchived:"隐藏归档",delete:"删除",newChat:"新建对话",groups:{pinned:"置顶",all:"对话",projects:"项目",today:"今天",yesterday:"昨天",earlier:"更早",archived:"已归档"}},CT={title:"删除这个对话?",description:"此操作无法撤销。",cancel:"取消",confirm:"删除",automationsDescription:"这个对话有关联的自动任务。删除对话也会删除这些自动任务。",moreAutomations:"另有 {{count}} 个",confirmWithAutomations:"删除",schedule:{at:"{{time}}",every:"每 {{duration}}",cron:"Cron {{expr}}",cronWithTz:"Cron {{expr}} · {{tz}}",unknown:"自定义计划"},next:{label:"下次:{{time}}",disabled:"已暂停",none:"没有下次运行"}},ST={idle:"空闲",connecting:"连接中…",open:"已连接",reconnecting:"重连中…",closed:"已断开",error:"连接出错"},NT={loadingConversation:"正在加载对话…",empty:{greetings:{workOn:"我们要一起做点什么?",start:"今天从哪里开始?",build:"今天一起构建什么?",tackle:"我们要一起解决什么?"},quickActions:{plan:{title:"创建项目计划",prompt:"帮我为接下来要做的事情写一份简洁的项目计划。"},analyze:{title:"分析这些数据",prompt:"帮我分析这些数据,并指出最重要的模式。"},brainstorm:{title:"头脑风暴想法",prompt:"围绕这个问题头脑风暴几个实用方案,并说明取舍。"},code:{title:"编写代码",prompt:"帮我为这个任务写代码,先从最小可用改动开始。"},summarize:{title:"总结这份文档",prompt:"帮我总结这份文档,并列出关键要点。"},more:{title:"更多",prompt:"展示几个你在这个工作区里可以帮我的实用方式。"}},imageQuickActions:{icon:{title:"设计应用图标",prompt:"生成一个干净的 1:1 nanobot 应用图标:友好的机器人,简洁矢量风格,蓝白柔和配色,不要文字。"},sticker:{title:"制作贴纸",prompt:"生成一张可爱的贴纸风小机器人助手图片,背景像透明贴纸,表情活泼有趣。"},poster:{title:"创建海报",prompt:"生成一张个人 AI 助手的精致海报概念图,现代构图,视觉层级清晰,适合落地页展示。"},product:{title:"产品样机",prompt:"生成一张对话式 AI Web 应用的干净产品样机图,极简界面,高级光影,真实设备边框。"},portrait:{title:"风格化头像",prompt:"生成一个友好的 AI 伙伴风格化头像,柔和光线,细节丰富但亲切,现代插画风格。"},edit:{title:"编辑图片",prompt:"帮我编辑一张图片。先让我上传或指定要编辑的图片,然后生成编辑后的结果。"}}},header:{toggleSidebar:"切换侧边栏",newChat:"从顶部新建对话",toggleTheme:"从顶部切换主题",settings:"打开设置",sessionInfo:"会话详情"},sessionInfo:{title:"会话",untitled:"未命名对话",automations:"自动任务",count:"{{count}}",loading:"正在加载自动任务...",loadFailed:"无法加载自动任务。",empty:"这个会话暂时没有自动任务。",disabled:"已关闭",schedule:{at:"{{time}}",every:"每 {{duration}}",cron:"Cron {{expr}}",cronWithTz:"Cron {{expr}} · {{tz}}",unknown:"自定义计划"},next:{label:"下次 {{time}}",pending:"即将执行",disabled:"已暂停",none:"没有下次运行"}},composer:{placeholderThread:"输入消息…",placeholderHero:"问任何问题...",placeholderOpening:"正在打开新对话…",placeholderStreaming:"模型正在回复…",inputAria:"消息输入框",sendHint:"Enter 发送 · Shift+Enter 换行",runRuntimeTitle:"运行中 · {{elapsed}}",goalStateStrip:"目标 · {{label}}",goalStateFallback:"目标",goalStateExpandAria:"查看完整目标",goalStateSheetTitle:"目标",send:"发送消息",stop:"停止响应",modelNotConfigured:"模型未配置",configureModel:"配置模型",queued:{label:"待引导提示",guide:"引导",delete:"删除引导",edit:"编辑引导",drag:"拖动排序"},attachImage:"添加图片",imageMode:{label:"图片生成",toggle:"切换图片生成模式",placeholder:"描述或编辑图片…",aspectAria:"图片画幅",aspectLabel:"图片画幅",aspect:{auto:"自动","1_1":"方形 1:1","3_4":"竖版 3:4","9_16":"故事版 9:16","4_3":"横版 4:3","16_9":"宽屏 16:9"}},tools:{search:"搜索",reason:"推理",deepResearch:"深度研究",voice:"语音输入"},voice:{hint:"点击进行听写或长按",stop:"停止录音",transcribing:"正在转写...",recordingStatus:"正在录音 {{time}}"},voiceErrors:{unsupported:"当前浏览器不支持语音输入。",permission:"需要麦克风权限。",notConfigured:"请先配置转写提供商。",tooLong:"录音时间太长。",tooShort:"请稍微多录一会儿。",noInput:"没有检测到麦克风输入。",failed:"语音转写失败。"},slash:{ariaLabel:"斜杠命令",label:"命令",navigateHint:"↑↓ 选择",selectHint:"Enter/Tab 填入",closeHint:"Esc 关闭",badges:{current:"当前",recent:"最近"},details:{goalActive:"目标正在运行",goalReady:"开始一个持续目标",history:"查看最近消息",stopRunning:"正在运行"},commands:{new:{title:"新建对话",description:"停止当前任务,并开始一个新的对话。"},stop:{title:"停止当前任务",description:"取消这个对话中正在运行的 agent 回合。"},restart:{title:"重启 nanobot",description:"原地重启 bot 进程。"},status:{title:"查看状态",description:"显示运行时、服务商和通道状态。"},model:{title:"模型",description:"查看或切换当前模型预设。"},history:{title:"查看对话历史",description:"打印最近 N 条已持久化的对话消息。"},dream:{title:"运行 Dream",description:"手动触发记忆整理。"},dream_log:{title:"查看 Dream 日志",description:"查看上一次 Dream 整理改变了什么。"},dream_restore:{title:"恢复记忆",description:"将记忆恢复到之前的 Dream 快照。"},goal:{title:"长期目标",description:"让助手把当前请求当作需要多步骤持续推进的目标。"},help:{title:"查看帮助",description:"列出可用的斜杠命令。"},pairing:{title:"配对",description:"管理配对请求。"}}},mentions:{ariaLabel:"应用",label:"应用",cliGroup:"CLI 应用",mcpGroup:"MCP 服务",cliBadge:"CLI",mcpBadge:"MCP",cliDescription:"使用 @{{name}} 调用本地 CLI",mcpDescription:"使用 @{{name}} 调用 MCP 服务"},encoding:"处理中…",remove:"移除附件",normalizedSizeHint:"{{orig}} → {{current}}(已自动压缩)",imageRejected:{unsupported_type:"不支持的文件类型",too_many_images:"每条消息最多 {{max}} 张图片",magic_mismatch:"文件看起来不像真实的图片",decode_failed:"无法解码这张图片",too_large:"图片太大,请换一张小一点的",io:"无法读取该文件"},goalStateCloseAria:"关闭目标",workspace:{accessAria:"工作区访问权限",projectAria:"选择项目",projectPlaceholder:"选择项目",default:"默认权限",full:"完全访问权限"}},scrollToBottom:"滚动到底部",loadEarlier:"加载更早消息",forkedFromHistory:"从历史消息分叉",promptNavigator:{open:"打开输入导航",title:"输入列表",search:"搜索输入",noResults:"没有匹配的输入。",jumpTo:"跳转到输入:{{label}}"}},jT={streaming:"流式输出中",assistantTyping:"助手正在输入",toolSingle:"正在使用工具",toolMany:"已使用 {{count}} 个工具",toolSummary:"{{count}} 个工具",toolSummaryMany:"{{count}} 个工具",reasoningTools:"推理 · {{count}} 个工具",reasoningToolsSingular:"推理 · 1 个工具",reasoning:"思考过程",reasoningStreaming:"正在思考…",reasoningSummary:"推理",agentActivitySummary:"{{reasoning}} 步 · {{tools}} 次工具调用",agentActivityToolsOnly:"{{tools}} 次工具调用",agentActivityLiveSummary:"进行中… · {{reasoning}} 步 · {{tools}} 次工具调用",agentActivityLiveToolsOnly:"进行中… · {{tools}} 次工具调用",activityThinkingFor:"思考中 {{duration}}",activityThought:"已思考",activityThoughtFor:"思考了 {{duration}}",activityWorkingFor:"处理中 {{duration}}",activityWorked:"已处理",activityWorkedFor:"处理了 {{duration}}",cliActivityRunningOne:"正在使用 @{{name}}",cliActivityRanOne:"已使用 @{{name}}",cliActivityFailedOne:"使用 @{{name}} 失败",cliActivityRunningMany:"正在使用 {{count}} 个 CLI 应用",cliActivityRanMany:"已使用 {{count}} 个 CLI 应用",cliActivityFailedMany:"{{count}} 个 CLI 应用失败",cliRunRunning:"正在使用",cliRunRan:"已使用",cliRunFailed:"失败",imageAttachment:"图片附件",automationSourceFallback:"自动化",automationTriggered:"自动触发",forkFromHere:"分叉",copyReply:"复制",copiedReply:"已复制",turnLatencyTitle:"本轮耗时(端到端)"},AT={title:"图片预览",open:"查看图片",prev:"上一张",next:"下一张",close:"关闭预览"},_T={aria:"文件预览",close:"关闭文件预览",loading:"正在加载预览...",failed:"无法预览这个文件。",routeMissing:"文件预览需要最新的 gateway。请重启 nanobot gateway 后再试。",resize:"调整文件预览宽度",truncated:"文件较大,当前只显示前半部分预览。"},PT={fallbackLanguage:"代码",copyAria:"复制代码",copy:"复制",copied:"已复制"},TT={dismiss:"关闭"},RT={messageTooBig:{title:"消息过大",body:"服务端因超过大小限制拒收了上一条消息。可移除部分图片或使用更小的图片后重试。"},workspaceScopeRejected:{title:"工作区未更改",body:"网关拒绝了请求的项目或访问权限Nanobot 已继续使用之前的工作区。"}},MT={dialog:{defaultProject:"默认工作区",manual:"粘贴路径",manualPlaceholder:"/Users/name/project",usePath:"使用路径",absolutePathRequired:"请输入这台机器上的绝对文件夹路径。"}},ET={app:yT,sidebar:bT,settings:wT,chat:kT,deleteConfirm:CT,connection:ST,thread:NT,message:jT,lightbox:AT,filePreview:_T,code:PT,common:TT,errors:RT,workspace:MT},IT={brand:"nanobot",loading:{connecting:"正在連線到 nanobot…",boot:"正在載入 nanobot…"},error:{title:"無法連線到 nanobot",gatewayHint:"請確認 gateway 已啟動(`nanobot gateway`),並且目前頁面與 gateway 在同一台機器上開啟。"},auth:{title:"需要驗證",hint:"輸入 gateway 設定中 tokenIssueSecret 配置的密鑰。",placeholder:"密碼",submit:"連線",invalid:"密碼無效,請再試一次。"},account:{section:"帳戶",logoutHint:"中斷此瀏覽器與 gateway 的連線。",logout:"登出"},system:{section:"系統",restartHint:"重新啟動 nanobot 以套用執行階段變更。",restart:"重新啟動 nanobot",restarting:"正在重新啟動...",restartEngine:"重新啟動引擎",restartingEngine:"正在重新啟動引擎..."},restart:{completed:"重新啟動已完成,耗時 {{seconds}} 秒。"},documentTitle:{base:"nanobot",chat:"{{title}} · nanobot"},meta:{description:"nanobot Web UI —— 與你的 nanobot 工作區對話。"}},LT={navigation:"側邊欄導覽",collapse:"收合側邊欄",newChat:"新增對話",searchAria:"搜尋",searchPlaceholder:"搜尋",searchResults:"搜尋結果",noSearchResults:"沒有符合的對話。",recent:"最近對話",settings:"設定",language:{label:"語言",ariaLabel:"切換語言"},apps:"應用",automations:"自動任務",skills:{title:"技能"}},DT={backToChat:"返回聊天",sidebar:{title:"設定",ariaLabel:"設定分區"},nav:{general:"一般",byok:"BYOK",overview:"概覽",appearance:"外觀",models:"模型",providers:"提供商",image:"圖片",voice:"語音",browser:"網頁",runtime:"系統",advanced:"安全",cliApps:"CLI 應用",mcp:"MCP",apps:"應用",automations:"自動任務",skills:"技能"},sections:{interface:"介面",ai:"AI",system:"系統",about:"關於",status:"狀態",localPreferences:"本機偏好",presets:"預設",imageGeneration:"圖片生成",imageDefaults:"預設值",webSearch:"網頁搜尋",webBehavior:"行為",identity:"身分",webuiSafety:"WebUI 安全",capabilities:"能力",cliApps:"CLI 應用",mcp:"MCP 服務",apps:"應用",nativeHost:"原生宿主",hostSafety:"App 安全",voiceInput:"語音辨識"},rows:{theme:"主題",language:"語言",provider:"供應商",model:"模型",restart:"重新啟動 nanobot",configPath:"配置路徑",activePreset:"目前預設",gateway:"閘道",restartState:"重啟狀態",pendingChanges:"待套用更改",selectedPreset:"已選預設",presetModel:"預設模型",density:"密度",activityMode:"活動細節",codeWrap:"程式碼換行",maxResults:"最大結果數",timeout:"逾時",jinaReader:"Jina 閱讀器",imageGeneration:"圖片生成",imageProvider:"圖片供應商",imageProviderStatus:"供應商狀態",imageProviderBase:"供應商位址",imageModel:"圖片模型",defaultAspectRatio:"預設比例",defaultImageSize:"預設尺寸",maxImagesPerTurn:"每輪最大圖片數",imageSaveDir:"儲存目錄",botName:"Bot 名稱",botIcon:"Bot 圖示",timezone:"時區",workspacePath:"預設工作區",localServiceAccess:"本機服務",webuiDefaultAccess:"預設權限",currentModel:"目前設定",brandLogos:"品牌 Logo",cliAppsCatalog:"目錄",cliAppsFilter:"篩選",engine:"引擎",logs:"日誌",diagnostics:"診斷",contextWindow:"上下文視窗",transcription:"語音轉寫",transcriptionProvider:"提供商",transcriptionProviderStatus:"提供商狀態",transcriptionModel:"模型",transcriptionLanguage:"語言",voiceLimits:"限制"},help:{theme:"在淺色與深色外觀之間切換。",language:"選擇 WebUI 使用的語言。",provider:"選擇處理新模型請求的供應商。",model:"設定 nanobot 預設使用的模型名稱。",configPath:"目前閘道使用中的配置檔。",selectedPreset:"命名預設在此為唯讀;請在 config.json 中編輯。",presetModel:"切回 Default 後可在 WebUI 中編輯模型與供應商。",density:"只儲存在此瀏覽器中。",activityMode:"選擇預設顯示多少 agent 活動細節。",codeWrap:"讓長程式碼行在小螢幕上也易讀。",maxResults:"每次 web_search 呼叫返回的結果數。",timeout:"搜尋供應商請求逾時前的秒數。",jinaReader:"可用時為 web_fetch 使用 Jina Reader。",imageGeneration:"配置圖片供應商後,在聊天中開放 generate_image。",imageProvider:"選擇 generate_image 使用的註冊供應商。",imageProviderStatus:"圖片生成會重用「供應商」中的憑證。",imageModel:"傳送給所選圖片供應商的模型名稱。",defaultAspectRatio:"提示詞未指定比例時使用。",defaultImageSize:"傳送給支援此選項的供應商的尺寸提示。",maxImagesPerTurn:"單次 generate_image 請求可生成的圖片上限。",botName:"顯示在 nanobot 使用顯示名稱的位置。",botIcon:"顯示在 Bot 名稱旁的短 emoji 或文字。",timezone:"用於排程和需要時間感知的回覆。",localServiceAccess:"允許完全訪問權限下的 shell 命令訪問 localhost 服務。",webuiDefaultAccess:"用於沒有單獨專案權限的 Web 聊天。",securityManagedControls:"網頁抓取始終保護本機、內網和 metadata 服務。核心渠道安全仍由 config.json 管理。",currentModel:"用於新的回覆。",selectedModelProvider:"由選取的模型決定。",selectedModelValue:"由選取的模型決定。",brandLogos:"在設定中顯示第三方提供商和 CLI 圖示。",cliAppsCatalog:"只安裝 nanobot 可在本機執行的應用 CLI 轉接器;不會改動原生應用。",cliAppsFilter:"按應用、類別或能力搜尋。",logs:"開啟原生引擎日誌資料夾。",diagnostics:"匯出一份用於支援排查的小型執行報告。",localServiceAccessNative:"允許完全訪問權限下的 shell 命令訪問這台 Mac 上的服務。",webuiDefaultAccessNative:"用於沒有單獨專案權限的原生聊天。",contextWindow:"選擇此模型配置的預設上下文預算。",transcription:"送出前先把麥克風輸入轉寫到輸入框。聊天渠道的語音訊息也使用同一組設定。",transcriptionProvider:"使用「提供商」中對應提供商的憑證。",transcriptionProviderStatus:"API Key 仍保存在 providers 裡,不寫進 transcription 設定。",transcriptionModel:"除非提供商需要自訂模型 ID否則保持解析後的預設值即可。",transcriptionLanguage:"可選 ISO-639 語言提示,例如 en、zh、ja 或 ko。"},values:{light:"淺色",dark:"深色",notAvailable:"不可用",enabled:"已啟用",disabled:"已停用",restartPending:"等待重啟",ready:"就緒",privateEngine:"私有引擎",unixSocket:"Unix socket",defaultWorkspace:"預設工作區",comfortable:"舒適",compact:"緊湊",auto:"自動",expanded:"展開",on:"開啟",off:"關閉",defaultPermission:"預設權限",fullAccess:"完全訪問權限",configured:"已配置",notConfigured:"未配置",pending:"等待中",restartingEngine:"正在重啟"},status:{loading:"正在載入設定...",loadError:"無法載入設定",unsaved:"有未儲存的更改。",upToDate:"已是最新。",savedRestart:"已儲存。重新啟動 nanobot 後生效。",restartAfterSaving:"儲存更改後,在合適時重啟。",savedRestartApply:"已儲存。準備好後重啟。",imageProviderRestart:"圖片供應商更改已儲存。準備好後重啟。",hostRestartAfterSaving:"儲存後 nanobot 會重啟引擎。",hostRestartPending:"已儲存。準備好後會重啟引擎。",hostApiUnavailable:"宿主操作僅在原生應用中可用。",logsOpened:"已開啟日誌資料夾。",logsOpenFailed:"無法開啟日誌資料夾。",diagnosticsExported:"診斷已匯出到 {{path}}。",diagnosticsExportFailed:"無法匯出診斷。"},actions:{save:"儲存",saving:"正在儲存",edit:"編輯",cancel:"取消",open:"開啟",export:"匯出",opening:"正在開啟...",exporting:"正在匯出..."},byok:{description:"自帶 provider key。Nanobot 會從目前 config 讀取這些值,只有已設定的 provider 才能在一般設定中選擇。",configured:"已設定",notConfigured:"未設定",configuredSection:"已設定",notConfiguredSection:"未設定",showMore:"再顯示 {{count}} 個",showLess:"收合",apiKey:"API key",apiBase:"API base",apiKeyPlaceholder:"輸入 API key",apiKeyConfiguredPlaceholder:"留空則保留目前 key",configuredKeyHint:"已設定的 key",apiBasePlaceholder:"使用 provider 預設地址",apiKeyRequired:"需要 API key 才能設定此 provider。",showApiKey:"顯示 API key",hideApiKey:"隱藏 API key",noConfiguredProviders:"沒有已設定的 provider",configureFirst:"請先在 BYOK 設定 provider。",openByok:"開啟 BYOK",tabs:{ariaLabel:"BYOK 憑證類型",llm:"LLM",webSearch:"網頁搜尋"},webSearch:{provider:"搜尋 provider",providerHelp:"選擇 web search 工具使用的後端。",selectProvider:"選擇 provider",credentials:"憑證",noCredentialRequired:"不需要 key",noCredentialHelp:"DuckDuckGo 不需要儲存 API key。",apiKeyHelp:"儲存到 config 後只顯示遮罩提示。",baseUrl:"Base URL",baseUrlHelp:"SearXNG 需要你自己的實例網址。",baseUrlPlaceholder:"https://search.example.com",apiKeyRequired:"此搜尋 provider 需要 API key。",baseUrlRequired:"SearXNG 需要 Base URL。",missingCredential:"填寫必要憑證後才能儲存。",saveHint:"變更會套用到新的 web search 請求。"}},overview:{model:"目前模型",providers:"供應商",configuredCount:"已配置 {{count}} 個",totalProviders:"共 {{count}} 個可用",webSearch:"網頁搜尋",imageGeneration:"圖片生成",voiceInput:"語音辨識",workspace:"工作區"},usage:{title:"Token 活動",shortTitle:"Token Usage",subtitle:"最近 12 個月由供應商回報的 token 用量。",empty:"新的模型回覆產生後,這裡會顯示 token 活動。",totalTokens:"累計 Token 數",peakTokens:"峰值 Token 數",thirtyDayTokens:"30 天 Token 數",currentStreak:"目前連續天數",longestStreak:"最長連續天數",daysValue:"{{count}} 天",last30:"30 天",activeDays:"活躍天數",requests:"請求數",estimated:"估算",includesEstimates:"包含估算",cellTitle:"{{date}}{{tokens}} tokens{{requests}} 次請求",sources:{user:"對話",api:"API",cron:"自動任務",dream:"記憶整理",system:"系統"}},providers:{searchPlaceholder:"搜尋供應商",noMatches:"沒有符合的供應商。",saveProvider:"儲存供應商"},image:{selectProvider:"選擇供應商",selectAspect:"選擇比例",selectSize:"選擇尺寸",configureProvider:"配置供應商",missingCredential:"啟用圖片生成前請先配置此供應商。"},models:{selectModel:"選擇模型",addConfiguration:"新增配置",newConfiguration:"新增模型配置",newConfigurationHelp:"將供應商與模型儲存為一鍵選項。",configurationName:"配置名稱",configurationNameHelp:"重新命名這個已儲存的模型配置。",configurationNamePlaceholder:"快速寫作",searchModels:"搜尋或輸入模型 ID",useCustomModel:"使用",loadingModels:"正在載入模型...",searchCatalog:"搜尋供應商目錄來選擇模型。",modelsAvailable:"可用",noModelResults:"沒有符合的模型。",loadFailed:"模型列表不可用。",unsupportedModelList:"手動輸入模型 ID。",providerNotConfigured:"載入模型前請先配置此供應商。",autoProviderCustomOnly:"自動供應商模式使用自訂模型 ID。"},timezone:{select:"選擇時區",search:"搜尋時區",empty:"沒有符合的時區。"},cliApps:{allCategories:"全部分類",availableCount:"{{count}} 個應用",installedCount:"已安裝 {{count}} 個",summary:"已安裝 {{installed}} / {{total}} 個 CLI",filterAll:"全部",filterInstalled:"已安裝的 CLI",filterNotInstalled:"未安裝",searchPlaceholder:"搜尋 CLI",statusInstalled:"已安裝",statusAvailable:"可用",statusMissing:"缺少相依項",statusUnsupported:"不支援",statusNotInstalled:"未安裝",unsupported:"不支援",loading:"正在載入 CLI 應用...",empty:"沒有符合此篩選條件的 CLI 應用。",readyTitle:"@{{name}} 已就緒",readyStatus:"就緒",readyPrompt:"使用 @{{name}} 查看這個 CLI 能做什麼。",readyTry:"試用 @{{name}}",readyCopied:"已複製",openChat:"開啟聊天",requires:"需要",test:"測試 CLI",update:"更新 CLI",uninstall:"解除安裝 CLI",install:"安裝 CLI",unavailable:"不可用",noDescription:"暫無描述。"},about:{version:"版本",checking:"正在檢查...",checkForUpdates:"檢查更新",upToDate:"已是最新版本",updateAvailable:"有可用更新 v{{version}}"},mcp:{allCategories:"全部分類",summary:"已啟用 {{installed}} / {{total}} 個預設",filterAll:"全部",filterInstalled:"已啟用",filterNotInstalled:"未啟用",searchPlaceholder:"搜尋 MCP 預設",moreOptions:"更多 MCP 選項",moreOptionsSubtitle:"新增自訂服務,或匯入 mcp.json。",customTitle:"自訂 MCP",customSubtitle:"新增任意 stdio、HTTP 或 SSE MCP 服務。",customAction:"自訂",importAction:"匯入",serverName:"服務名稱",serverUrl:"URL",transport:"傳輸方式",command:"指令",args:"Args JSON",headers:"Headers JSON",env:"Env JSON",timeout:"工具逾時",advancedOptions:"進階選項",hideAdvanced:"隱藏進階",saveCustom:"儲存 MCP",configImport:"匯入 mcp.json",importConfig:"匯入",restartRequired:"重新啟動 nanobot 以連接更新後的 MCP 工具。",toolsFound:"{{count}} 個工具",loading:"正在載入 MCP 預設...",empty:"沒有符合此篩選條件的 MCP 預設。",openDocs:"開啟文件",test:"測試",remove:"移除",enable:"啟用",enabled:"已啟用",setup:"連接",configure:"連接",connectTitle:"連接 {{name}}",connectHint:"從你的帳號設定中加入金鑰。",saveAndEnable:"儲存並啟用",updateSetup:"更新設定",configured:"已設定",keepExisting:"留空以保留目前值",statusConfigured:"已設定",statusMissingCredentials:"需要金鑰",statusMissingDependency:"需要相依項",statusComingSoon:"即將推出",statusNotInstalled:"未啟用",toolScope:"工具",allTools:"全部",noTools:"無",testForTools:"執行測試以檢查並選擇個別工具。"},legal:{thirdPartyBrands:"產品名稱、標誌與品牌均屬於其各自擁有者。使用僅為識別用途,並不代表背書。"},apps:{description:"新增 nanobot 可在聊天中使用的 App CLI 和 MCP 服務。",cliLabel:"CLI",mcpLabel:"MCP",filterAll:"全部",filterCli:"CLI 應用",filterMcp:"MCP 服務",enabledSummary:"已啟用 {{count}} 個",caption:"{{cli}} 個 CLI · {{mcp}} 個 MCP",searchPlaceholder:"搜尋應用",featured:"精選",loading:"正在載入應用...",empty:"沒有符合的應用。"},automations:{filters:{all:"全部",active:"執行中",paused:"已暫停",failed:"異常",system:"系統"},sort:{next:"下次執行",last:"上次執行",updated:"更新時間",name:"名稱"},search:"搜尋任務、訊息、關聯對話或排程",queue:"任務佇列",loading:"正在載入自動任務...",noMatches:"目前檢視沒有符合的自動任務。",empty:"尚無自動任務。",emptyHint:"請從它應該執行的來源處建立,這樣 nanobot 才能保留正確上下文。",oneShot:"一次性",systemTask:"系統管理的自動任務",labels:{schedule:"排程",next:"下次",origin:"關聯會話",created:"建立於",updated:"更新於"},runNow:"立即執行",pause:"暫停",resume:"恢復",edit:"編輯",delete:"刪除",protected:"受保護",editTitle:"編輯自動任務",save:"儲存",deleteTitle:"刪除自動任務",deleteDescription:"這會從 cron 儲存中刪除 {{name}},歷史聊天訊息會保留在會話中。",cancel:"取消",status:{system:"系統",running:"正在執行",paused:"已暫停",failed:"失敗",completed:"已完成",noSchedule:"無排程",active:"執行中"},origin:{system:"系統",unknown:"未關聯會話"},channels:{api:"API",cli:"CLI",dingtalk:"釘釘",discord:"Discord",email:"電子郵件",feishu:"飛書",matrix:"Matrix",msteams:"Microsoft Teams",qq:"QQ",slack:"Slack",telegram:"Telegram",wechat:"微信",wecom:"企業微信",weixin:"微信",whatsapp:"WhatsApp"},schedule:{at:"於 {{time}}",every:"每 {{duration}}",cron:"Cron {{expr}}",cronWithTz:"Cron {{expr}} · {{tz}}",withTz:"{{summary}} · {{tz}}",dailyAt:"每天 {{time}}",weekdaysAt:"工作日 {{time}}",hourlyAt:"每小時第 {{minute}} 分鐘",hourlyWindow:"{{start}}-{{end}} 點每小時第 {{minute}} 分鐘",custom:"自訂排程"},next:{paused:"已暫停",pending:"正在執行",none:"沒有下次執行"},message:{showMore:"查看完整訊息",showLess:"收起訊息"},fields:{name:"名稱",message:"訊息",scheduleType:"排程類型",every:"每隔",unit:"單位",cronExpression:"Cron 表達式",timezone:"時區",runAt:"執行時間"},scheduleTypes:{every:"間隔",cron:"Cron",at:"一次性"},everyUnits:{second:"秒",minute:"分鐘",hour:"小時",day:"天"},validation:{nameRequired:"名稱不能為空。",messageRequired:"訊息不能為空。",intervalRequired:"間隔必須是正整數。",cronRequired:"Cron 表達式不能為空。",timeRequired:"執行時間不能為空。",futureRequired:"執行時間必須晚於目前時間。"}},oauth:{authentication:"OAuth 認證",signIn:"登入",signingIn:"登入中...",signInAgain:"重新登入",signOut:"登出",signedInAs:"已登入為 {{account}}",signInHelp:"從這台裝置登入;不會在配置中儲存 API key。",signInRequired:"需要登入",signInBeforeSaving:"將此 OAuth 供應商設為目前模型供應商前,請先登入。",signedIn:"已登入",notSignedIn:"未登入"},skills:{description:"查看此 agent 在對話中可以載入的指令技能。",caption:"{{available}} 個可用 · 共 {{total}} 個",featured:"Agent 技能",empty:"暫無可用技能。",sourceWorkspace:"自訂",sourceBuiltin:"內建",statusAvailable:"可用",statusUnavailable:"不可用",unavailableReason:"缺少:{{reason}}",openDetails:"查看 {{name}} 詳情",loadingDetail:"正在載入技能詳情...",loadFailed:"無法載入技能詳情。",descriptionTitle:"完整描述",source:"來源",status:"狀態",requirements:"需求",noRequirements:"沒有明確需求。",commands:"命令",environment:"環境變數",missingCommands:"缺 CLI",missingEnvironment:"缺 ENV",unavailableReasonLabel:"不可用原因",rawInstructions:"原始 SKILL.md",rawInstructionsEmpty:"沒有原始說明。",detailDescription:"{{name}} 的詳細資訊。"},voice:{selectProvider:"選擇提供商",configureProvider:"設定提供商",languageAuto:"自動"}},OT={fallbackTitle:"對話 {{id}}",forkTitle:"分叉:{{title}}",loading:"載入中…",noSessions:"目前還沒有會話。",showMore:"再顯示 {{count}} 個",collapsed:"已折疊 {{count}} 個對話",showLess:"收起",actions:"「{{title}}」的會話操作",newInProject:"在 {{project}} 中開始新對話",activity:{running:"Agent 正在執行",complete:"Agent 已完成",updated:"有新內容"},pin:"置頂",unpin:"取消置頂",rename:"重新命名",renameTitle:"重新命名對話",renameDescription:"為這個對話設定僅用於 WebUI 側邊欄的名稱。",renamePlaceholder:"對話名稱",renameProjectTitle:"重新命名專案",renameProjectDescription:"為這個專案設定僅用於 WebUI 側邊欄的名稱。",renameProjectPlaceholder:"專案名稱",renameSave:"儲存",archive:"封存",unarchive:"取消封存",showArchived:"顯示封存",hideArchived:"隱藏封存",delete:"刪除",newChat:"新增對話",groups:{pinned:"置頂",all:"對話",projects:"專案",today:"今天",yesterday:"昨天",earlier:"更早",archived:"已封存"}},FT={title:"刪除這個對話?",description:"此操作無法復原。",cancel:"取消",confirm:"刪除",automationsDescription:"這個對話有關聯的自動任務。刪除對話也會刪除這些自動任務。",moreAutomations:"另有 {{count}} 個",confirmWithAutomations:"刪除",schedule:{at:"{{time}}",every:"每 {{duration}}",cron:"Cron {{expr}}",cronWithTz:"Cron {{expr}} · {{tz}}",unknown:"自訂計畫"},next:{label:"下次:{{time}}",disabled:"已暫停",none:"沒有下次執行"}},zT={idle:"閒置",connecting:"連線中…",open:"已連線",reconnecting:"重新連線中…",closed:"已中斷",error:"連線錯誤"},$T={loadingConversation:"正在載入對話…",empty:{greetings:{workOn:"我們要一起做點什麼?",start:"今天從哪裡開始?",build:"今天一起構建什麼?",tackle:"我們要一起解決什麼?"},quickActions:{plan:{title:"建立專案計畫",prompt:"幫我為接下來要做的事情寫一份簡潔的專案計畫。"},analyze:{title:"分析這些資料",prompt:"幫我分析這些資料,並指出最重要的模式。"},brainstorm:{title:"腦力激盪想法",prompt:"圍繞這個問題腦力激盪幾個實用方案,並說明取捨。"},code:{title:"撰寫程式碼",prompt:"幫我為這個任務撰寫程式碼,先從最小可用改動開始。"},summarize:{title:"總結這份文件",prompt:"幫我總結這份文件,並列出關鍵重點。"},more:{title:"更多",prompt:"展示幾個你在這個工作區裡可以幫我的實用方式。"}},imageQuickActions:{icon:{title:"設計應用程式圖示",prompt:"生成一個乾淨的 1:1 nanobot 應用程式圖示:友善的機器人、簡潔向量風格、柔和藍白配色,不要文字。"},sticker:{title:"製作貼圖",prompt:"生成一張可愛貼圖風格的小型機器人助理圖片,背景像透明貼紙,表情活潑有趣。"},poster:{title:"建立海報",prompt:"生成一張個人 AI 助理的精緻海報概念圖,現代構圖、清楚的視覺層級,適合登陸頁展示。"},product:{title:"產品樣機",prompt:"生成一張對話式 AI Web 應用的乾淨產品樣機圖,極簡介面、高級光影、真實裝置邊框。"},portrait:{title:"風格化頭像",prompt:"生成一個友善 AI 夥伴的風格化頭像,柔和光線、細節豐富但親切,現代插畫風格。"},edit:{title:"編輯圖片",prompt:"幫我編輯一張圖片。先請我上傳或指定要編輯的圖片,然後生成編輯後的結果。"}}},header:{toggleSidebar:"切換側邊欄",newChat:"開始新對話",toggleTheme:"從頂部切換主題",settings:"開啟設定",sessionInfo:"會話詳情"},sessionInfo:{title:"會話",untitled:"未命名對話",automations:"自動任務",count:"{{count}}",loading:"正在載入自動任務...",loadFailed:"無法載入自動任務。",empty:"這個會話暫時沒有自動任務。",disabled:"已關閉",schedule:{at:"{{time}}",every:"每 {{duration}}",cron:"Cron {{expr}}",cronWithTz:"Cron {{expr}} · {{tz}}",unknown:"自訂計畫"},next:{label:"下次 {{time}}",pending:"即將執行",disabled:"已暫停",none:"沒有下次執行"}},composer:{placeholderThread:"輸入訊息…",placeholderHero:"你在想什麼?",placeholderOpening:"正在開啟新對話…",placeholderStreaming:"模型正在回覆…",inputAria:"訊息輸入框",sendHint:"Enter 送出 · Shift+Enter 換行",runRuntimeTitle:"執行中 · {{elapsed}}",goalStateStrip:"目標 · {{label}}",goalStateFallback:"目標",goalStateExpandAria:"查看完整目標",goalStateSheetTitle:"目標",goalStateCloseAria:"關閉目標",send:"送出訊息",stop:"停止回覆",modelNotConfigured:"模型未配置",configureModel:"配置模型",queued:{label:"待引導提示",guide:"引導",delete:"刪除引導",edit:"編輯引導",drag:"拖曳排序"},attachImage:"附加圖片",imageMode:{label:"圖片生成",toggle:"切換圖片生成模式",placeholder:"描述或編輯圖片…",aspectAria:"圖片畫幅",aspectLabel:"圖片畫幅",aspect:{auto:"自動","1_1":"方形 1:1","3_4":"直式 3:4","9_16":"故事版 9:16","4_3":"橫式 4:3","16_9":"寬螢幕 16:9"}},tools:{search:"搜尋",reason:"推理",deepResearch:"深度研究",voice:"語音輸入"},voice:{hint:"點擊進行聽寫或長按",stop:"停止錄音",transcribing:"正在轉寫...",recordingStatus:"正在錄音 {{time}}"},voiceErrors:{unsupported:"目前瀏覽器不支援語音輸入。",permission:"需要麥克風權限。",notConfigured:"請先設定轉寫提供商。",tooLong:"錄音時間太長。",tooShort:"請稍微多錄一會兒。",noInput:"沒有偵測到麥克風輸入。",failed:"語音轉寫失敗。"},slash:{ariaLabel:"斜線命令",label:"命令",navigateHint:"↑↓ 選擇",selectHint:"Enter/Tab 填入",closeHint:"Esc 關閉",commands:{new:{title:"新增對話",description:"停止目前任務,並開始新的對話。"},stop:{title:"停止目前任務",description:"取消這個對話中正在執行的 agent 回合。"},restart:{title:"重新啟動 nanobot",description:"原地重新啟動 bot 進程。"},status:{title:"查看狀態",description:"顯示執行環境、provider 和 channel 狀態。"},model:{title:"模型",description:"查看或切換目前模型預設。"},history:{title:"查看對話歷史",description:"列印最近 N 則已持久化的對話訊息。"},dream:{title:"執行 Dream",description:"手動觸發記憶整理。"},dream_log:{title:"查看 Dream 日誌",description:"查看上一次 Dream 整理變更了什麼。"},dream_restore:{title:"恢復記憶",description:"將記憶恢復到之前的 Dream 快照。"},goal:{title:"長期目標",description:"請助理把這則請求當成需要多步驟持續推進的目標。"},help:{title:"查看說明",description:"列出可用的斜線命令。"},pairing:{title:"配對",description:"管理配對請求。"}},badges:{current:"目前",recent:"最近"},details:{goalActive:"目標正在執行",goalReady:"開始一個持續目標",history:"查看最近訊息",stopRunning:"正在執行"}},encoding:"處理中…",remove:"移除附件",normalizedSizeHint:"{{orig}} → {{current}}(已自動壓縮)",imageRejected:{unsupported_type:"不支援的檔案類型",too_many_images:"每則訊息最多 {{max}} 張圖片",magic_mismatch:"檔案看起來不像真正的圖片",decode_failed:"無法解碼這張圖片",too_large:"圖片太大,請換一張小一點的",io:"無法讀取這個檔案"},mentions:{ariaLabel:"應用",label:"應用",cliGroup:"CLI 應用",mcpGroup:"MCP 服務",cliBadge:"CLI",mcpBadge:"MCP",cliDescription:"使用 @{{name}} 呼叫本機 CLI",mcpDescription:"使用 @{{name}} 呼叫 MCP 服務"},workspace:{accessAria:"工作區存取權限",projectAria:"選擇專案",projectPlaceholder:"選擇專案",default:"預設權限",full:"完全存取權限"}},scrollToBottom:"捲動到底部",loadEarlier:"載入更早訊息",forkedFromHistory:"從歷史訊息分叉",promptNavigator:{open:"開啟輸入導覽",title:"輸入列表",search:"搜尋輸入",noResults:"沒有符合的輸入。",jumpTo:"跳到輸入:{{label}}"}},UT={streaming:"串流輸出中",assistantTyping:"助理正在輸入",toolSingle:"正在使用工具",toolMany:"已使用 {{count}} 個工具",toolSummary:"{{count}} 個工具",toolSummaryMany:"{{count}} 個工具",reasoningTools:"推理 · {{count}} 個工具",reasoningToolsSingular:"推理 · 1 個工具",reasoning:"思考過程",reasoningStreaming:"正在思考…",reasoningSummary:"推理",agentActivitySummary:"{{reasoning}} 步 · {{tools}} 次工具呼叫",agentActivityToolsOnly:"{{tools}} 次工具呼叫",agentActivityLiveSummary:"進行中… · {{reasoning}} 步 · {{tools}} 次工具呼叫",agentActivityLiveToolsOnly:"進行中… · {{tools}} 次工具呼叫",imageAttachment:"圖片附件",forkFromHere:"分叉",copyReply:"複製",copiedReply:"已複製",turnLatencyTitle:"本輪耗時(端到端)",activityThinkingFor:"思考中,已 {{duration}}",activityThought:"已思考",activityThoughtFor:"已思考 {{duration}}",activityWorkingFor:"處理中,已 {{duration}}",activityWorked:"已處理",activityWorkedFor:"已處理 {{duration}}",cliActivityRunningOne:"正在使用 @{{name}}",cliActivityRanOne:"已使用 @{{name}}",cliActivityFailedOne:"@{{name}} 失敗",cliActivityRunningMany:"正在使用 {{count}} 個 CLI 應用",cliActivityRanMany:"已使用 {{count}} 個 CLI 應用",cliActivityFailedMany:"{{count}} 個 CLI 應用失敗",cliRunRunning:"使用中",cliRunRan:"已使用",cliRunFailed:"失敗",automationSourceFallback:"自動化",automationTriggered:"自動觸發"},BT={title:"圖片預覽",open:"檢視圖片",prev:"上一張",next:"下一張",close:"關閉預覽"},HT={aria:"檔案預覽",close:"關閉檔案預覽",loading:"正在載入預覽...",failed:"無法預覽這個檔案。",routeMissing:"檔案預覽需要最新的 gateway。請重啟 nanobot gateway 後再試。",resize:"調整檔案預覽寬度",truncated:"檔案較大,目前只顯示前半部分預覽。"},WT={fallbackLanguage:"程式碼",copyAria:"複製程式碼",copy:"複製",copied:"已複製"},qT={dismiss:"關閉"},KT={messageTooBig:{title:"訊息過大",body:"伺服器因超過大小限制拒收了上一則訊息。可移除部分圖片或改用較小的圖片後再試。"},workspaceScopeRejected:{title:"工作區未變更",body:"閘道拒絕了要求的專案或存取權限Nanobot 已繼續使用先前的工作區。"}},VT={dialog:{defaultProject:"預設工作區",manual:"貼上路徑",manualPlaceholder:"/Users/name/project",usePath:"使用路徑",absolutePathRequired:"請輸入這台機器上的絕對資料夾路徑。"}},GT={app:IT,sidebar:LT,settings:DT,chat:OT,deleteConfirm:FT,connection:zT,thread:$T,message:UT,lightbox:BT,filePreview:HT,code:WT,common:qT,errors:KT,workspace:VT},YT={brand:"nanobot",loading:{connecting:"Connexion à nanobot…",boot:"Chargement de nanobot…"},error:{title:"Impossible de joindre nanobot",gatewayHint:"Assurez-vous que la gateway est en cours dexécution (`nanobot gateway`) et que cette page est ouverte sur la même machine."},auth:{title:"Authentification requise",hint:"Saisissez le secret configuré comme tokenIssueSecret dans la configuration de votre gateway.",placeholder:"Mot de passe",submit:"Se connecter",invalid:"Mot de passe invalide. Réessayez."},account:{section:"Compte",logoutHint:"Déconnecter ce navigateur du gateway.",logout:"Se déconnecter"},system:{section:"Système",restartHint:"Redémarrez nanobot pour appliquer les changements dexécution.",restart:"Redémarrer nanobot",restarting:"Redémarrage...",restartEngine:"Redémarrer le moteur",restartingEngine:"Redémarrage du moteur..."},restart:{completed:"Redémarrage terminé en {{seconds}} s."},documentTitle:{base:"nanobot",chat:"{{title}} · nanobot"},meta:{description:"Interface web nanobot — discutez avec votre espace de travail nanobot."}},QT={navigation:"Navigation de la barre latérale",collapse:"Réduire la barre latérale",newChat:"Nouvelle discussion",searchAria:"Rechercher",searchPlaceholder:"Rechercher",searchResults:"Résultats",noSearchResults:"Aucun chat correspondant.",recent:"Récentes",settings:"Paramètres",language:{label:"Langue",ariaLabel:"Changer de langue"},apps:"Apps",automations:"Automatisations",skills:{title:"Compétences"}},XT={backToChat:"Retour au chat",sidebar:{title:"Réglages",ariaLabel:"Sections des réglages"},nav:{general:"Général",byok:"BYOK",overview:"Aperçu",appearance:"Apparence",models:"Modèles",providers:"Fournisseurs",image:"Images",voice:"Voix",browser:"Internet",runtime:"Système",advanced:"Sécurité",cliApps:"Apps CLI",mcp:"MCP",apps:"Applications",automations:"Automatisations",skills:"Compétences"},sections:{interface:"Interface utilisateur",ai:"AI",system:"Système",about:"À propos",status:"État",localPreferences:"Préférences locales",presets:"Préréglages",imageGeneration:"Génération dimages",imageDefaults:"Valeurs par défaut",webSearch:"Recherche web",webBehavior:"Comportement",identity:"Identité",webuiSafety:"Sécurité WebUI",capabilities:"Capacités",cliApps:"Applications CLI",mcp:"Services MCP",apps:"Applications",nativeHost:"Hôte natif",hostSafety:"Sécurité de lapp",voiceInput:"Saisie vocale"},rows:{theme:"Thème",language:"Langue",provider:"Fournisseur",model:"Modèle",restart:"Redémarrer nanobot",configPath:"Chemin de config",activePreset:"Préréglage actif",gateway:"Passerelle",restartState:"État du redémarrage",pendingChanges:"Modifications en attente",selectedPreset:"Préréglage sélectionné",presetModel:"Modèle du préréglage",density:"Densité",activityMode:"Détail dactivité",codeWrap:"Retour à la ligne du code",maxResults:"Résultats max.",timeout:"Délai dattente",jinaReader:"Lecteur Jina",imageGeneration:"Génération dimages",imageProvider:"Fournisseur dimages",imageProviderStatus:"État du fournisseur",imageProviderBase:"Base du fournisseur",imageModel:"Modèle dimage",defaultAspectRatio:"Ratio par défaut",defaultImageSize:"Taille par défaut",maxImagesPerTurn:"Images max. par tour",imageSaveDir:"Dossier denregistrement",botName:"Nom du bot",botIcon:"Icône du bot",timezone:"Fuseau horaire",workspacePath:"Espace de travail par défaut",localServiceAccess:"Services locaux",webuiDefaultAccess:"Accès par défaut",currentModel:"Configuration actuelle",brandLogos:"Logos de marque",cliAppsCatalog:"Catalogue",cliAppsFilter:"Filtre",engine:"Moteur",logs:"Journaux",diagnostics:"Diagnostic",contextWindow:"Fenêtre de contexte",transcription:"Transcription",transcriptionProvider:"Fournisseur",transcriptionProviderStatus:"Etat du fournisseur",transcriptionModel:"Modele",transcriptionLanguage:"Langue",voiceLimits:"Limites"},help:{theme:"Basculer entre lapparence claire et sombre.",language:"Choisissez la langue utilisée par WebUI.",provider:"Sélectionnez le fournisseur à utiliser pour les nouvelles requêtes de modèle.",model:"Définissez le nom du modèle utilisé par défaut par nanobot.",configPath:"Le fichier de configuration actuellement utilisé par la passerelle.",selectedPreset:"Les préréglages nommés sont en lecture seule ici ; modifiez-les dans config.json.",presetModel:"Passez à Default pour modifier le modèle et le fournisseur depuis WebUI.",density:"Enregistré seulement dans ce navigateur.",activityMode:"Choisissez le niveau de détail dactivité agent affiché par défaut.",codeWrap:"Garde les longues lignes de code lisibles sur les petits écrans.",maxResults:"Résultats renvoyés par chaque appel web_search.",timeout:"Nombre de secondes avant lexpiration dune requête de recherche.",jinaReader:"Utilise Jina Reader pour web_fetch lorsque disponible.",imageGeneration:"Expose generate_image dans les chats lorsquun fournisseur dimage configuré est disponible.",imageProvider:"Choisissez le fournisseur inscrit utilisé par generate_image.",imageProviderStatus:"La génération dimages réutilise les identifiants des fournisseurs.",imageModel:"Nom du modèle envoyé au fournisseur dimages sélectionné.",defaultAspectRatio:"Utilisé lorsque le prompt ne choisit pas de ratio.",defaultImageSize:"Indication de taille envoyée aux fournisseurs compatibles.",maxImagesPerTurn:"Limite supérieure pour une requête generate_image.",botName:"Affiché là où nanobot utilise un nom visible.",botIcon:"Emoji ou texte court affiché avec le nom du bot.",timezone:"Utilisé pour les horaires et les réponses tenant compte du temps.",localServiceAccess:"Autorise les commandes shell Full Access à atteindre les services localhost.",webuiDefaultAccess:"Utilisé par les chats web sans permission propre au projet.",securityManagedControls:"Les récupérations web protègent toujours les services locaux, privés et de métadonnées. La sécurité des canaux principaux reste gérée dans config.json.",currentModel:"Utilisée pour les nouvelles réponses.",selectedModelProvider:"Défini par le modèle sélectionné.",selectedModelValue:"Défini par le modèle sélectionné.",brandLogos:"Affiche les logos de fournisseurs tiers et CLI dans les Réglages.",cliAppsCatalog:"Installe uniquement les adaptateurs CLI dapps que nanobot peut exécuter localement ; les apps natives restent inchangées.",cliAppsFilter:"Recherchez par app, catégorie ou capacité.",logs:"Ouvre le dossier des journaux du moteur natif.",diagnostics:"Exporte un petit rapport dexécution pour le support.",localServiceAccessNative:"Autorise les commandes shell Full Access à atteindre les services sur ce Mac.",webuiDefaultAccessNative:"Utilisé par les chats natifs sans permission propre au projet.",contextWindow:"Choisissez le budget de contexte par défaut pour cette configuration de modèle.",transcription:"Transcrit l'entree micro avant l'envoi. Les messages vocaux des canaux utilisent les memes reglages.",transcriptionProvider:"Utilise les identifiants du fournisseur correspondant dans Fournisseurs.",transcriptionProviderStatus:"Les cles API restent dans les fournisseurs, pas dans les reglages de transcription.",transcriptionModel:"Laissez le modele resolu par defaut sauf si votre fournisseur exige un id personnalise.",transcriptionLanguage:"Indice ISO-639 facultatif, comme en, zh, ja ou ko."},values:{light:"Clair",dark:"Sombre",notAvailable:"Indisponible",enabled:"Activé",disabled:"Désactivé",restartPending:"Redémarrage en attente",ready:"Prêt",privateEngine:"Moteur privé",unixSocket:"Socket Unix",defaultWorkspace:"Espace par défaut",comfortable:"Confortable",compact:"Compacte",auto:"Automatique",expanded:"Développé",on:"Activé",off:"Désactivé",defaultPermission:"Autorisation par défaut",fullAccess:"Accès complet",configured:"Configuré",notConfigured:"Non configuré",pending:"En attente",restartingEngine:"Redémarrage"},status:{loading:"Chargement des réglages...",loadError:"Impossible de charger les réglages",unsaved:"Modifications non enregistrées.",upToDate:"À jour.",savedRestart:"Enregistré. Redémarrez nanobot pour appliquer.",restartAfterSaving:"Enregistrez les changements, puis redémarrez quand vous êtes prêt.",savedRestartApply:"Enregistré. Redémarrez quand vous êtes prêt.",imageProviderRestart:"Changements du fournisseur dimage enregistrés. Redémarrez quand vous êtes prêt.",hostRestartAfterSaving:"En enregistrant, nanobot redémarrera son moteur.",hostRestartPending:"Enregistré. Le moteur redémarrera lorsquil sera prêt.",hostApiUnavailable:"Les actions de lhôte ne sont disponibles que dans lapp native.",logsOpened:"Dossier des journaux ouvert.",logsOpenFailed:"Impossible douvrir le dossier des journaux.",diagnosticsExported:"Diagnostic exporté vers {{path}}.",diagnosticsExportFailed:"Impossible dexporter le diagnostic."},actions:{save:"Enregistrer",saving:"Enregistrement",edit:"Modifier",cancel:"Annuler",open:"Ouvrir",export:"Exporter",opening:"Ouverture...",exporting:"Exportation..."},byok:{description:"Utilisez vos propres clés de fournisseur. Nanobot lit ces valeurs depuis la configuration actuelle, et seuls les fournisseurs configurés peuvent être sélectionnés dans Général.",configured:"Configuré",notConfigured:"Non configuré",configuredSection:"Configurés",notConfiguredSection:"Non configurés",showMore:"Afficher {{count}} de plus",showLess:"Afficher moins",apiKey:"API key",apiBase:"API base",apiKeyPlaceholder:"Saisir l'API key",apiKeyConfiguredPlaceholder:"Laisser vide pour conserver la key actuelle",configuredKeyHint:"Key configurée",apiBasePlaceholder:"Utiliser la valeur par défaut du fournisseur",apiKeyRequired:"Une API key est requise pour configurer ce fournisseur.",showApiKey:"Afficher l'API key",hideApiKey:"Masquer l'API key",noConfiguredProviders:"Aucun fournisseur configuré",configureFirst:"Configurez d'abord un fournisseur dans BYOK.",openByok:"Ouvrir BYOK",tabs:{ariaLabel:"Type d'identifiants BYOK",llm:"LLM",webSearch:"Recherche web"},webSearch:{provider:"Fournisseur de recherche",providerHelp:"Choisissez le backend utilisé par l'outil web search.",selectProvider:"Choisir un fournisseur",credentials:"Identifiants",noCredentialRequired:"Aucune key requise",noCredentialHelp:"DuckDuckGo fonctionne sans API key enregistrée.",apiKeyHelp:"Enregistrée dans la config et masquée après l'enregistrement.",baseUrl:"Base URL",baseUrlHelp:"SearXNG nécessite l'URL de votre propre instance.",baseUrlPlaceholder:"https://search.example.com",apiKeyRequired:"Ce fournisseur de recherche nécessite une API key.",baseUrlRequired:"SearXNG nécessite une Base URL.",missingCredential:"Ajoutez l'identifiant requis avant d'enregistrer.",saveHint:"Les changements s'appliquent aux nouvelles requêtes web search."}},overview:{model:"Modèle actuel",providers:"Fournisseurs",configuredCount:"{{count}} configurés",totalProviders:"{{count}} disponibles",webSearch:"Recherche web",imageGeneration:"Génération dimages",voiceInput:"Saisie vocale",workspace:"Espace de travail"},usage:{title:"Activité des tokens",shortTitle:"Token Usage",subtitle:"Usage signalé par le fournisseur sur les 12 derniers mois.",empty:"Lactivité des tokens apparaîtra après les nouvelles réponses du modèle.",totalTokens:"Tokens cumulés",peakTokens:"Pic de tokens",thirtyDayTokens:"Tokens sur 30 jours",currentStreak:"Série actuelle",longestStreak:"Plus longue série",daysValue:"{{count}} j",last30:"30 jours",activeDays:"Jours actifs",requests:"Requêtes",estimated:"estimé",includesEstimates:"inclut des estimations",cellTitle:"{{date}} : {{tokens}} tokens, {{requests}} requêtes",sources:{user:"Chat",api:"API",cron:"Automatisations",dream:"Mémoire",system:"Système"}},providers:{searchPlaceholder:"Rechercher des fournisseurs",noMatches:"Aucun fournisseur ne correspond.",saveProvider:"Enregistrer le fournisseur"},image:{selectProvider:"Choisir un fournisseur",selectAspect:"Choisir un ratio",selectSize:"Choisir une taille",configureProvider:"Configurer le fournisseur",missingCredential:"Configura este proveedor antes de activar la generación de imágenes."},models:{selectModel:"Choisir un modèle",addConfiguration:"Ajouter une configuration",newConfiguration:"Nouvelle configuration de modèle",newConfigurationHelp:"Enregistre un fournisseur et un modèle comme option en un clic.",configurationName:"Nom de la configuration",configurationNameHelp:"Renomme cette configuration de modèle enregistrée.",configurationNamePlaceholder:"Rédaction rapide",searchModels:"Rechercher ou saisir un ID de modèle",useCustomModel:"Utiliser",loadingModels:"Chargement des modèles...",searchCatalog:"Rechercher dans le catalogue du fournisseur pour choisir un modèle.",modelsAvailable:"disponibles",noModelResults:"Aucun modèle correspondant.",loadFailed:"Liste des modèles indisponible.",unsupportedModelList:"Saisissez manuellement un ID de modèle.",providerNotConfigured:"Configurez ce fournisseur avant de charger les modèles.",autoProviderCustomOnly:"Le mode fournisseur automatique utilise des IDs de modèle personnalisés."},timezone:{select:"Choisir un fuseau horaire",search:"Rechercher un fuseau horaire",empty:"Aucun fuseau horaire correspondant."},cliApps:{allCategories:"Toutes les catégories",availableCount:"{{count}} applications",installedCount:"{{count}} installées",summary:"{{installed}} CLIs installées sur {{total}}",filterAll:"Tout",filterInstalled:"CLIs installées",filterNotInstalled:"Non installées",searchPlaceholder:"Rechercher des CLIs",statusInstalled:"Installée",statusAvailable:"Disponible",statusMissing:"Dépendance manquante",statusUnsupported:"Non compatible",statusNotInstalled:"Non installée",unsupported:"Non compatible",loading:"Chargement des apps CLI...",empty:"Aucune app CLI ne correspond à ce filtre.",readyTitle:"@{{name}} est prêt",readyStatus:"Prêt",readyPrompt:"Utilisez @{{name}} pour voir ce que ce CLI peut faire.",readyTry:"Essayer @{{name}}",readyCopied:"Copié",openChat:"Ouvrir le chat",requires:"Requiert",test:"Tester le CLI",update:"Mettre à jour le CLI",uninstall:"Désinstaller le CLI",install:"Installer le CLI",unavailable:"Indisponible",noDescription:"Aucune description disponible."},about:{version:"Version",checking:"Recherche de mises à jour...",checkForUpdates:"Rechercher les mises à jour",upToDate:"Vous êtes à jour",updateAvailable:"Mise à jour disponible v{{version}}"},mcp:{allCategories:"Toutes les catégories",summary:"{{installed}} presets activés sur {{total}}",filterAll:"Tout",filterInstalled:"Activés",filterNotInstalled:"Non activés",searchPlaceholder:"Rechercher des presets MCP",moreOptions:"Plus d'options MCP",moreOptionsSubtitle:"Ajoutez un serveur personnalisé ou importez mcp.json.",customTitle:"MCP personnalisé",customSubtitle:"Ajoutez n'importe quel serveur MCP stdio, HTTP ou SSE.",customAction:"Personnalisé",importAction:"Importer",serverName:"Nom du serveur",serverUrl:"URL",transport:"Transport",command:"Commande",args:"Args JSON",headers:"Headers JSON",env:"Env JSON",timeout:"Délai d'outil",advancedOptions:"Options avancées",hideAdvanced:"Masquer les options avancées",saveCustom:"Enregistrer MCP",configImport:"Importer mcp.json",importConfig:"Importer",restartRequired:"Redémarrez nanobot pour connecter les outils MCP mis à jour.",toolsFound:"{{count}} outils",loading:"Chargement des presets MCP...",empty:"Aucun preset MCP ne correspond à ce filtre.",openDocs:"Ouvrir la doc",test:"Tester",remove:"Supprimer",enable:"Activer",enabled:"Activé",setup:"Connecter",configure:"Connecter",connectTitle:"Connecter {{name}}",connectHint:"Ajoutez la clé depuis les paramètres de votre compte.",saveAndEnable:"Enregistrer et activer",updateSetup:"Mettre à jour la configuration",configured:"configuré",keepExisting:"Laissez vide pour conserver la valeur actuelle",statusConfigured:"Configuré",statusMissingCredentials:"Clé requise",statusMissingDependency:"Dépendance requise",statusComingSoon:"Bientôt disponible",statusNotInstalled:"Non activé",toolScope:"Outils",allTools:"Tous",noTools:"Aucun",testForTools:"Exécutez Tester pour inspecter et choisir des outils individuels."},legal:{thirdPartyBrands:"Les noms, logos et marques de produits appartiennent à leurs propriétaires respectifs. Leur utilisation sert uniquement à l'identification et n'implique aucune approbation."},apps:{description:"Ajoutez des CLI dapps et services MCP utilisables par nanobot depuis le chat.",cliLabel:"CLI",mcpLabel:"MCP",filterAll:"Tout",filterCli:"Apps CLI",filterMcp:"Services MCP",enabledSummary:"{{count}} activés",caption:"{{cli}} CLI · {{mcp}} MCP",searchPlaceholder:"Rechercher des apps",featured:"À la une",loading:"Chargement des apps...",empty:"Aucune app ne correspond."},automations:{filters:{all:"Toutes",active:"Actives",paused:"En pause",failed:"À traiter",system:"Système"},sort:{next:"Prochaine exécution",last:"Dernière exécution",updated:"Mise à jour",name:"Nom"},search:"Rechercher tâche, message, discussion liée ou planning",queue:"File",loading:"Chargement des automatisations...",noMatches:"Aucune automatisation ne correspond à cette vue.",empty:"Aucune automatisation pour le moment.",emptyHint:"Créez-la depuis son point d'exécution pour que nanobot conserve le bon contexte.",oneShot:"Ponctuelle",systemTask:"Automatisation gérée par le système",labels:{schedule:"Planning",next:"Prochaine",origin:"Discussion liée",created:"Créée",updated:"Modifiée"},runNow:"Exécuter maintenant",pause:"Mettre en pause",resume:"Reprendre",edit:"Modifier",delete:"Supprimer",protected:"Protégée",editTitle:"Modifier lautomatisation",save:"Enregistrer",deleteTitle:"Supprimer lautomatisation",deleteDescription:"Cela supprime {{name}} du stockage cron. Les anciens messages de chat restent dans la session.",cancel:"Annuler",status:{system:"Système",running:"En cours dexécution",paused:"En pause",failed:"Échouée",completed:"Terminée",noSchedule:"Aucun planning",active:"En cours"},origin:{system:"Système",unknown:"Aucune discussion liée"},channels:{api:"API",cli:"CLI",dingtalk:"DingTalk",discord:"Discord",email:"Email",feishu:"Feishu",matrix:"Matrix",msteams:"Microsoft Teams",qq:"QQ",slack:"Slack",telegram:"Telegram",wechat:"WeChat",wecom:"WeCom",weixin:"WeChat",whatsapp:"WhatsApp"},schedule:{at:"À {{time}}",every:"Toutes les {{duration}}",cron:"Cron {{expr}}",cronWithTz:"Cron {{expr}} · {{tz}}",withTz:"{{summary}} · {{tz}}",dailyAt:"Chaque jour à {{time}}",weekdaysAt:"Jours ouvrés à {{time}}",hourlyAt:"Toutes les heures à :{{minute}}",hourlyWindow:"Toutes les heures {{start}}-{{end}} à :{{minute}}",custom:"Planning personnalisé"},next:{paused:"En pause",pending:"En cours dexécution",none:"Aucune prochaine exécution"},message:{showMore:"Afficher le message complet",showLess:"Afficher moins"},fields:{name:"Nom",message:"Message",scheduleType:"Type de planning",every:"Toutes les",unit:"Unité",cronExpression:"Expression cron",timezone:"Fuseau horaire",runAt:"Exécuter à"},scheduleTypes:{every:"Intervalle",cron:"Cron",at:"Une fois"},everyUnits:{second:"Secondes",minute:"Minutes",hour:"Heures",day:"Jours"},validation:{nameRequired:"Le nom est obligatoire.",messageRequired:"Le message est obligatoire.",intervalRequired:"Lintervalle doit être un nombre positif.",cronRequired:"Lexpression cron est obligatoire.",timeRequired:"Lheure dexécution est obligatoire.",futureRequired:"Lheure dexécution doit être dans le futur."}},oauth:{authentication:"Authentification OAuth",signIn:"Se connecter",signingIn:"Connexion...",signInAgain:"Se reconnecter",signOut:"Se déconnecter",signedInAs:"Connecté en tant que {{account}}",signInHelp:"Inicia sesión desde este dispositivo; no se guarda API key en config.",signInRequired:"Connexion requise",signInBeforeSaving:"Inicia sesión antes de guardar este proveedor OAuth como proveedor activo.",signedIn:"Connecté",notSignedIn:"Non connecté"},skills:{description:"Consultez les compétences dinstruction que cet agent peut charger pendant une conversation.",caption:"{{available}} disponibles · {{total}} au total",featured:"Compétences agent",empty:"Aucune compétence disponible.",sourceWorkspace:"Personnalisée",sourceBuiltin:"Intégrée",statusAvailable:"Disponible",statusUnavailable:"Indisponible",unavailableReason:"Manquant : {{reason}}",openDetails:"Ouvrir les détails de {{name}}",loadingDetail:"Chargement des détails...",loadFailed:"Impossible de charger les détails.",descriptionTitle:"Description",source:"Source",status:"Statut",requirements:"Prérequis",noRequirements:"Aucun prérequis explicite.",commands:"Commandes",environment:"Variables denvironnement",missingCommands:"CLI manquant",missingEnvironment:"ENV manquant",unavailableReasonLabel:"Raison dindisponibilité",rawInstructions:"SKILL.md brut",rawInstructionsEmpty:"Aucune instruction brute.",detailDescription:"Détails de {{name}}."},voice:{selectProvider:"Choisir un fournisseur",configureProvider:"Configurer le fournisseur",languageAuto:"Auto"}},JT={fallbackTitle:"Discussion {{id}}",forkTitle:"Branche : {{title}}",loading:"Chargement…",noSessions:"Aucune session pour le moment.",showMore:"Afficher {{count}} de plus",collapsed:"{{count}} discussions masquées",showLess:"Afficher moins",actions:"Actions de la discussion {{title}}",newInProject:"Démarrer une nouvelle discussion dans {{project}}",activity:{running:"Agent running",complete:"Agent finished",updated:"New activity"},pin:"Pin",unpin:"Unpin",rename:"Rename",renameTitle:"Rename chat",renameDescription:"Choose a local sidebar name for this chat.",renamePlaceholder:"Chat name",renameProjectTitle:"Rename project",renameProjectDescription:"Choose a local sidebar name for this project.",renameProjectPlaceholder:"Project name",renameSave:"Save",archive:"Archive",unarchive:"Unarchive",showArchived:"Show archived",hideArchived:"Hide archived",delete:"Supprimer",newChat:"Nouvelle discussion",groups:{pinned:"Pinned",all:"Chats",projects:"Projects",today:"Today",yesterday:"Yesterday",earlier:"Earlier",archived:"Archived"}},ZT={title:"Supprimer cette discussion ?",description:"Cette action est irréversible.",cancel:"Annuler",confirm:"Supprimer",automationsDescription:"Cette discussion contient des automatisations planifiées. La supprimer les supprimera aussi.",moreAutomations:"+ {{count}} autres",confirmWithAutomations:"Supprimer",schedule:{at:"{{time}}",every:"Tous les {{duration}}",cron:"Cron {{expr}}",cronWithTz:"Cron {{expr}} · {{tz}}",unknown:"Planification personnalisée"},next:{label:"Prochaine exécution : {{time}}",disabled:"En pause",none:"Aucune prochaine exécution"}},eR={idle:"Inactif",connecting:"Connexion…",open:"Connecté",reconnecting:"Reconnexion…",closed:"Déconnecté",error:"Erreur de connexion"},tR={loadingConversation:"Chargement de la conversation…",empty:{greetings:{workOn:"Sur quoi travaillons-nous ensemble ?",start:"Par où commence-t-on ?",build:"Que construisons-nous aujourd'hui ?",tackle:"Que résout-on ensemble ?"},quickActions:{plan:{title:"Créer un plan de projet",prompt:"Créez un plan de projet concis pour ce que je devrais construire ensuite."},analyze:{title:"Analyser ces données",prompt:"Aidez-moi à analyser ces données et à faire ressortir les tendances les plus importantes."},brainstorm:{title:"Trouver des idées",prompt:"Proposez quelques idées pratiques et leurs compromis pour ce problème."},code:{title:"Écrire du code",prompt:"Aidez-moi à écrire le code pour cette tâche, en commençant par le plus petit changement utile."},summarize:{title:"Résumer ce document",prompt:"Résumez ce document et listez les points clés à retenir."},more:{title:"Plus",prompt:"Montrez-moi quelques façons utiles dont vous pouvez maider dans cet espace de travail."}},imageQuickActions:{icon:{title:"Créer une icône dapp",prompt:"Générez une icône dapplication 1:1 propre pour nanobot : robot sympathique, style vectoriel simple, palette douce bleu et blanc, sans texte."},sticker:{title:"Créer un sticker",prompt:"Générez une image façon sticker dun petit assistant robot, avec un fond dapparence transparente, expressive et ludique."},poster:{title:"Créer une affiche",prompt:"Générez un concept daffiche soigné pour un assistant IA personnel, composition moderne, hiérarchie visuelle forte, adapté à une landing page."},product:{title:"Maquette produit",prompt:"Générez une maquette produit propre pour une application web dIA conversationnelle, interface minimale, éclairage premium, cadre dappareil réaliste."},portrait:{title:"Portrait stylisé",prompt:"Générez un portrait stylisé dun compagnon IA sympathique, lumière douce, détaillé mais accessible, style illustration moderne."},edit:{title:"Modifier une image",prompt:"Aidez-moi à modifier une image. Demandez-moi dabord de téléverser ou dindiquer limage, puis générez le résultat modifié."}}},header:{toggleSidebar:"Afficher ou masquer la barre latérale",newChat:"Démarrer un nouveau chat",toggleTheme:"Changer le thème depuis len-tête",settings:"Ouvrir les paramètres",sessionInfo:"Détails de la session"},sessionInfo:{title:"Session",untitled:"Chat sans titre",automations:"Automatisations",count:"{{count}}",loading:"Chargement des automatisations...",loadFailed:"Impossible de charger les automatisations.",empty:"Aucune automatisation dans cette session pour le moment.",disabled:"Désactivé",schedule:{at:"À {{time}}",every:"Toutes les {{duration}}",cron:"Cron {{expr}}",cronWithTz:"Cron {{expr}} · {{tz}}",unknown:"Planification personnalisée"},next:{label:"Prochaine {{time}}",pending:"Exécution imminente",disabled:"En pause",none:"Aucune prochaine exécution"}},composer:{placeholderThread:"Saisissez votre message…",placeholderHero:"Quavez-vous en tête ?",placeholderOpening:"Ouverture dune nouvelle discussion…",placeholderStreaming:"Le modèle est en train de répondre…",inputAria:"Champ de message",sendHint:"Entrée pour envoyer · Maj+Entrée pour un retour à la ligne",runRuntimeTitle:"Exécution · {{elapsed}}",goalStateStrip:"Objectif · {{label}}",goalStateFallback:"Objectif",goalStateExpandAria:"Afficher lobjectif complet",goalStateSheetTitle:"Objectif",goalStateCloseAria:"Fermer lobjectif",send:"Envoyer le message",stop:"Arrêter la réponse",modelNotConfigured:"Modèle non configuré",configureModel:"Configurer le modèle",queued:{label:"Guidage en attente",guide:"Guider",delete:"Supprimer le guidage",edit:"Modifier le guidage",drag:"Faire glisser pour réordonner"},attachImage:"Joindre une image",imageMode:{label:"Génération dimage",toggle:"Activer ou désactiver le mode génération dimage",placeholder:"Décrire ou modifier une image…",aspectAria:"Format de limage",aspectLabel:"Format de limage",aspect:{auto:"Auto","1_1":"Carré 1:1","3_4":"Portrait 3:4","9_16":"Story 9:16","4_3":"Paysage 4:3","16_9":"Large 16:9"}},tools:{search:"Rechercher",reason:"Raisonner",deepResearch:"Recherche approfondie",voice:"Entrée vocale"},voice:{hint:"Cliquez pour dicter ou maintenez",stop:"Arrêter l'enregistrement",transcribing:"Transcription...",recordingStatus:"Enregistrement {{time}}"},voiceErrors:{unsupported:"La saisie vocale n'est pas prise en charge par ce navigateur.",permission:"L'autorisation du microphone est requise.",notConfigured:"Configurez d'abord un fournisseur de transcription.",tooLong:"L'enregistrement est trop long.",tooShort:"Maintenez un peu plus longtemps pour enregistrer la voix.",noInput:"Aucune entrée microphone détectée.",failed:"Impossible de transcrire l'audio."},slash:{ariaLabel:"Commandes slash",label:"commandes",navigateHint:"↑↓ Naviguer",selectHint:"Entrée/Tab Insérer",closeHint:"Échap Fermer",commands:{new:{title:"Nouvelle discussion",description:"Arrêter la tâche en cours et démarrer une nouvelle conversation."},stop:{title:"Arrêter la tâche en cours",description:"Annuler le tour agent actif pour cette discussion."},restart:{title:"Redémarrer nanobot",description:"Redémarrer le processus du bot sur place."},status:{title:"Afficher létat",description:"Afficher létat du runtime, du provider et des channels."},model:{title:"Modèle",description:"Afficher ou changer le préréglage de modèle actif."},history:{title:"Afficher lhistorique",description:"Afficher les N derniers messages persistés de la conversation."},dream:{title:"Lancer Dream",description:"Déclencher manuellement la consolidation de la mémoire."},dream_log:{title:"Afficher le journal Dream",description:"Afficher ce que la dernière consolidation Dream a changé."},dream_restore:{title:"Restaurer la mémoire",description:"Revenir à un instantané Dream précédent."},goal:{title:"Objectif long terme",description:"Demandez à lagent de traiter ceci comme un objectif multiétapes durable."},help:{title:"Afficher laide",description:"Lister les commandes slash disponibles."},pairing:{title:"Appairage",description:"Gérer les demandes dappairage."}},badges:{current:"Actuel",recent:"Récent"},details:{goalActive:"Lobjectif est en cours",goalReady:"Démarrer un objectif durable",history:"Afficher les messages récents",stopRunning:"En cours"}},encoding:"Traitement…",remove:"Retirer la pièce jointe",normalizedSizeHint:"{{orig}} → {{current}} (auto)",imageRejected:{unsupported_type:"Type de fichier non pris en charge",too_many_images:"Maximum {{max}} images par message",magic_mismatch:"Ce fichier n'est pas une image",decode_failed:"Impossible de décoder cette image",too_large:"Image trop grande — essayez-en une plus petite",io:"Impossible de lire ce fichier"},mentions:{ariaLabel:"Apps",label:"Apps",cliGroup:"Apps CLI",mcpGroup:"Services MCP",cliBadge:"CLI",mcpBadge:"MCP",cliDescription:"Utiliser @{{name}} comme app CLI locale",mcpDescription:"Utiliser @{{name}} comme serveur MCP"},workspace:{accessAria:"Workspace access mode",projectAria:"Choisir un projet",projectPlaceholder:"Sélectionner un projet",default:"Default Permission",full:"Full Access"}},scrollToBottom:"Faire défiler vers le bas",loadEarlier:"Charger les messages précédents",forkedFromHistory:"Bifurqué depuis l'historique",promptNavigator:{open:"Ouvrir le navigateur de prompts",title:"Prompts",search:"Rechercher des prompts",noResults:"Aucun prompt correspondant.",jumpTo:"Aller au prompt : {{label}}"}},nR={streaming:"en cours de génération",assistantTyping:"Lassistant est en train décrire",toolSingle:"Utilisation dun outil",toolMany:"{{count}} outils utilisés",toolSummary:"{{count}} outil",toolSummaryMany:"{{count}} outils",reasoningTools:"Raisonnement · {{count}} outils",reasoningToolsSingular:"Raisonnement · 1 outil",reasoning:"Raisonnement",reasoningStreaming:"En réflexion…",reasoningSummary:"Raisonnement",agentActivitySummary:"{{reasoning}} étapes · {{tools}} appels doutils",agentActivityToolsOnly:"{{tools}} appels doutils",agentActivityLiveSummary:"En cours… · {{reasoning}} étapes · {{tools}} appels doutils",agentActivityLiveToolsOnly:"En cours… · {{tools}} appels doutils",imageAttachment:"Pièce jointe image",forkFromHere:"Bifurquer",copyReply:"Copier",copiedReply:"Copié",turnLatencyTitle:"Temps de réponse (de bout en bout)",activityThinkingFor:"Réflexion pendant {{duration}}",activityThought:"Réflexion terminée",activityThoughtFor:"Réflexion terminée en {{duration}}",activityWorkingFor:"Travail en cours depuis {{duration}}",activityWorked:"Travail terminé",activityWorkedFor:"Travail terminé en {{duration}}",cliActivityRunningOne:"Utilisation de @{{name}}",cliActivityRanOne:"@{{name}} utilisé",cliActivityFailedOne:"Échec de @{{name}}",cliActivityRunningMany:"Utilisation de {{count}} apps CLI",cliActivityRanMany:"{{count}} apps CLI utilisées",cliActivityFailedMany:"Échec de {{count}} apps CLI",cliRunRunning:"Utilisation",cliRunRan:"Utilisé",cliRunFailed:"Échec",automationSourceFallback:"Automatisation",automationTriggered:"Déclenché automatiquement"},rR={title:"Aperçu de limage",open:"Voir limage",prev:"Image précédente",next:"Image suivante",close:"Fermer laperçu"},aR={aria:"Aperçu du fichier",close:"Fermer laperçu du fichier",loading:"Chargement de laperçu...",failed:"Impossible de prévisualiser ce fichier.",routeMissing:"Laperçu du fichier nécessite le dernier gateway. Redémarrez nanobot gateway puis réessayez.",resize:"Redimensionner laperçu du fichier",truncated:"Laperçu est tronqué car le fichier est volumineux."},oR={fallbackLanguage:"code",copyAria:"Copier le code",copy:"Copier",copied:"Copié"},sR={dismiss:"Fermer"},iR={messageTooBig:{title:"Message trop volumineux",body:"Le serveur a rejeté votre dernier message car il dépasse la taille autorisée. Retirez des images ou choisissez des fichiers plus légers, puis renvoyez-le."},workspaceScopeRejected:{title:"Workspace was not changed",body:"Nanobot kept the previous workspace because the requested project or access mode was rejected by the gateway."}},lR={dialog:{defaultProject:"Default workspace",manual:"Coller un chemin",manualPlaceholder:"/Users/name/project",usePath:"Use Path",absolutePathRequired:"Enter an absolute folder path on this machine."}},cR={app:YT,sidebar:QT,settings:XT,chat:JT,deleteConfirm:ZT,connection:eR,thread:tR,message:nR,lightbox:rR,filePreview:aR,code:oR,common:sR,errors:iR,workspace:lR},uR={brand:"nanobot",loading:{connecting:"nanobot に接続中…",boot:"nanobot を読み込み中…"},error:{title:"nanobot に接続できませんでした",gatewayHint:"gateway`nanobot gateway`)が起動しており、このページが同じマシン上で開かれていることを確認してください。"},auth:{title:"認証が必要です",hint:"gateway 設定の tokenIssueSecret に指定されたシークレットを入力してください。",placeholder:"パスワード",submit:"接続",invalid:"パスワードが無効です。もう一度お試しください。"},account:{section:"アカウント",logoutHint:"このブラウザーを gateway から切断します。",logout:"サインアウト"},system:{section:"システム",restartHint:"実行時の変更を適用するには nanobot を再起動します。",restart:"nanobot を再起動",restarting:"再起動中...",restartEngine:"エンジンを再起動",restartingEngine:"エンジンを再起動中..."},restart:{completed:"{{seconds}} 秒で再起動が完了しました。"},documentTitle:{base:"nanobot",chat:"{{title}} · nanobot"},meta:{description:"nanobot Web UI — nanobot ワークスペースと会話します。"}},dR={navigation:"サイドバーのナビゲーション",collapse:"サイドバーを閉じる",newChat:"新しいチャット",searchAria:"検索",searchPlaceholder:"検索",searchResults:"検索結果",noSearchResults:"一致するチャットはありません。",recent:"最近のチャット",settings:"設定",language:{label:"言語",ariaLabel:"言語を変更"},apps:"アプリ",automations:"自動タスク",skills:{title:"スキル"}},pR={backToChat:"チャットに戻る",sidebar:{title:"設定",ariaLabel:"設定セクション"},nav:{general:"一般",byok:"BYOK",overview:"概要",appearance:"外観",models:"モデル",providers:"プロバイダー",image:"画像",voice:"音声",browser:"ウェブ",runtime:"システム",advanced:"セキュリティ",cliApps:"CLI アプリ",mcp:"MCP",apps:"アプリ",automations:"自動タスク",skills:"スキル"},sections:{interface:"インターフェース",ai:"AI",system:"システム",about:"情報",status:"状態",localPreferences:"ローカル設定",presets:"プリセット",imageGeneration:"画像生成",imageDefaults:"既定値",webSearch:"ウェブ検索",webBehavior:"動作",identity:"ID",webuiSafety:"WebUI の安全性",capabilities:"機能",cliApps:"CLI アプリ",mcp:"MCP サービス",apps:"アプリ",nativeHost:"ネイティブホスト",hostSafety:"アプリの安全性",voiceInput:"音声入力"},rows:{theme:"テーマ",language:"言語",provider:"プロバイダー",model:"モデル",restart:"nanobot を再起動",configPath:"設定パス",activePreset:"アクティブなプリセット",gateway:"ゲートウェイ",restartState:"再起動状態",pendingChanges:"保留中の変更",selectedPreset:"選択中のプリセット",presetModel:"プリセットモデル",density:"表示密度",activityMode:"アクティビティ詳細",codeWrap:"コードの折り返し",maxResults:"最大結果数",timeout:"タイムアウト",jinaReader:"Jina リーダー",imageGeneration:"画像生成",imageProvider:"画像プロバイダー",imageProviderStatus:"プロバイダー状態",imageProviderBase:"プロバイダー URL",imageModel:"画像モデル",defaultAspectRatio:"既定の比率",defaultImageSize:"既定のサイズ",maxImagesPerTurn:"1 ターンの最大画像数",imageSaveDir:"保存先ディレクトリ",botName:"Bot 名",botIcon:"Bot アイコン",timezone:"タイムゾーン",workspacePath:"既定のワークスペース",localServiceAccess:"ローカルサービス",webuiDefaultAccess:"既定の権限",currentModel:"現在の設定",brandLogos:"ブランドロゴ",cliAppsCatalog:"カタログ",cliAppsFilter:"フィルター",engine:"エンジン",logs:"ログ",diagnostics:"診断",contextWindow:"コンテキストウィンドウ",transcription:"文字起こし",transcriptionProvider:"プロバイダー",transcriptionProviderStatus:"プロバイダー状態",transcriptionModel:"モデル",transcriptionLanguage:"言語",voiceLimits:"制限"},help:{theme:"ライト表示とダーク表示を切り替えます。",language:"WebUI で使用する言語を選択します。",provider:"新しいモデルリクエストに使うプロバイダーを選択します。",model:"nanobot が既定で使用するモデル名を設定します。",configPath:"現在ゲートウェイが使用している設定ファイルです。",selectedPreset:"名前付きプリセットはここでは読み取り専用です。編集するには config.json を変更してください。",presetModel:"Default に切り替えると、WebUI からモデルとプロバイダーを編集できます。",density:"このブラウザーにのみ保存されます。",activityMode:"既定で表示する agent アクティビティの詳細量を選択します。",codeWrap:"小さな画面でも長いコード行を読みやすくします。",maxResults:"各 web_search 呼び出しで返す結果数です。",timeout:"検索プロバイダーのリクエストがタイムアウトするまでの秒数です。",jinaReader:"利用可能な場合、web_fetch に Jina Reader を使います。",imageGeneration:"画像プロバイダーが設定済みのとき、チャットで generate_image を有効にします。",imageProvider:"generate_image で使用する登録済みプロバイダーを選択します。",imageProviderStatus:"画像生成は「プロバイダー」の認証情報を再利用します。",imageModel:"選択した画像プロバイダーへ送信するモデル名です。",defaultAspectRatio:"プロンプトで比率が指定されていない場合に使用します。",defaultImageSize:"対応しているプロバイダーへ送信するサイズ指定です。",maxImagesPerTurn:"1 回の generate_image リクエストで生成できる画像数の上限です。",botName:"nanobot が表示名を使う場所に表示されます。",botIcon:"Bot 名の横に表示する短い emoji またはテキストです。",timezone:"スケジュールと時刻を考慮する返信に使用します。",localServiceAccess:"Full Access の shell コマンドが localhost サービスにアクセスできるようにします。",webuiDefaultAccess:"プロジェクト固有の権限がない Web チャットで使用します。",securityManagedControls:"Web 取得は常にローカル、プライベート、メタデータサービスを保護します。コアチャネルの安全性は config.json で管理されます。",currentModel:"新しい返信に使用します。",selectedModelProvider:"選択したモデルによって設定されます。",selectedModelValue:"選択したモデルによって設定されます。",brandLogos:"設定で第三者プロバイダーと CLI のロゴを表示します。",cliAppsCatalog:"nanobot がローカルで実行できるアプリ CLI アダプターだけをインストールします。ネイティブアプリは変更しません。",cliAppsFilter:"アプリ、カテゴリ、機能で検索します。",logs:"ネイティブエンジンのログフォルダーを開きます。",diagnostics:"サポート用の小さなランタイムレポートを書き出します。",localServiceAccessNative:"Full Access の shell コマンドがこの Mac 上のサービスにアクセスできるようにします。",webuiDefaultAccessNative:"プロジェクト固有の権限がないネイティブチャットで使用します。",contextWindow:"このモデル設定で使う既定のコンテキスト予算を選択します。",transcription:"マイク入力を送信前に文字起こしします。チャネルの音声メッセージも同じ設定を使います。",transcriptionProvider:"プロバイダー設定にある対応する認証情報を使います。",transcriptionProviderStatus:"APIキーは文字起こし設定ではなくプロバイダー側に保存されます。",transcriptionModel:"プロバイダーがカスタムモデルIDを必要としない限り、解決済みのデフォルトのままにします。",transcriptionLanguage:"en、zh、ja、ko などの任意の ISO-639 ヒント。"},values:{light:"ライト",dark:"ダーク",notAvailable:"利用不可",enabled:"有効",disabled:"無効",restartPending:"再起動待ち",ready:"準備完了",privateEngine:"プライベートエンジン",unixSocket:"Unix ソケット",defaultWorkspace:"デフォルトワークスペース",comfortable:"標準",compact:"コンパクト",auto:"自動",expanded:"展開",on:"オン",off:"オフ",defaultPermission:"既定の権限",fullAccess:"完全アクセス",configured:"設定済み",notConfigured:"未設定",pending:"保留中",restartingEngine:"再起動中"},status:{loading:"設定を読み込んでいます...",loadError:"設定を読み込めませんでした",unsaved:"未保存の変更があります。",upToDate:"最新です。",savedRestart:"保存しました。反映するには nanobot を再起動してください。",restartAfterSaving:"変更を保存してから、準備ができたら再起動してください。",savedRestartApply:"保存しました。準備ができたら再起動してください。",imageProviderRestart:"画像プロバイダーの変更を保存しました。準備ができたら再起動してください。",hostRestartAfterSaving:"保存すると nanobot がエンジンを再起動します。",hostRestartPending:"保存しました。準備ができたらエンジンを再起動します。",hostApiUnavailable:"ホスト操作はネイティブアプリ内でのみ利用できます。",logsOpened:"ログフォルダーを開きました。",logsOpenFailed:"ログフォルダーを開けませんでした。",diagnosticsExported:"診断を {{path}} に書き出しました。",diagnosticsExportFailed:"診断を書き出せませんでした。"},actions:{save:"保存",saving:"保存中",edit:"編集",cancel:"キャンセル",open:"開く",export:"書き出す",opening:"開いています...",exporting:"書き出しています..."},byok:{description:"自分の provider キーを使います。Nanobot は現在の config から値を読み込み、設定済みの provider だけを一般設定で選択できます。",configured:"設定済み",notConfigured:"未設定",configuredSection:"設定済み",notConfiguredSection:"未設定",showMore:"さらに {{count}} 件表示",showLess:"折りたたむ",apiKey:"API key",apiBase:"API base",apiKeyPlaceholder:"API key を入力",apiKeyConfiguredPlaceholder:"空欄のままなら現在の key を保持",configuredKeyHint:"設定済み key",apiBasePlaceholder:"provider の既定値を使用",apiKeyRequired:"この provider を設定するには API key が必要です。",showApiKey:"API key を表示",hideApiKey:"API key を隠す",noConfiguredProviders:"設定済み provider がありません",configureFirst:"先に BYOK で provider を設定してください。",openByok:"BYOK を開く",tabs:{ariaLabel:"BYOK 認証情報タイプ",llm:"LLM",webSearch:"ウェブ検索"},webSearch:{provider:"検索 provider",providerHelp:"web search ツールで使うバックエンドを選択します。",selectProvider:"provider を選択",credentials:"認証情報",noCredentialRequired:"key は不要",noCredentialHelp:"DuckDuckGo は API key を保存せずに使えます。",apiKeyHelp:"config に保存され、保存後はマスク表示されます。",baseUrl:"Base URL",baseUrlHelp:"SearXNG には自分のインスタンス URL が必要です。",baseUrlPlaceholder:"https://search.example.com",apiKeyRequired:"この検索 provider には API key が必要です。",baseUrlRequired:"SearXNG には Base URL が必要です。",missingCredential:"保存する前に必要な認証情報を入力してください。",saveHint:"変更は新しい web search リクエストに適用されます。"}},overview:{model:"現在のモデル",providers:"プロバイダー",configuredCount:"{{count}} 個設定済み",totalProviders:"{{count}} 個利用可能",webSearch:"Web 検索",imageGeneration:"画像生成",voiceInput:"音声入力",workspace:"ワークスペース"},usage:{title:"Token アクティビティ",shortTitle:"Token Usage",subtitle:"直近 12 か月にプロバイダーが報告した使用量。",empty:"新しいモデル返信の後に token アクティビティが表示されます。",totalTokens:"累計 Token 数",peakTokens:"ピーク Token 数",thirtyDayTokens:"30 日 Token 数",currentStreak:"現在の連続日数",longestStreak:"最長連続日数",daysValue:"{{count}} 日",last30:"30 日",activeDays:"アクティブ日数",requests:"リクエスト",estimated:"推定",includesEstimates:"推定を含む",cellTitle:"{{date}}: {{tokens}} tokens, {{requests}} 件のリクエスト",sources:{user:"チャット",api:"API",cron:"自動タスク",dream:"メモリ整理",system:"システム"}},providers:{searchPlaceholder:"プロバイダーを検索",noMatches:"一致するプロバイダーはありません。",saveProvider:"プロバイダーを保存"},image:{selectProvider:"プロバイダーを選択",selectAspect:"比率を選択",selectSize:"サイズを選択",configureProvider:"プロバイダーを設定",missingCredential:"画像生成を有効にする前に、このプロバイダーを設定してください。"},models:{selectModel:"モデルを選択",addConfiguration:"設定を追加",newConfiguration:"新しいモデル設定",newConfigurationHelp:"プロバイダーとモデルをワンクリックの選択肢として保存します。",configurationName:"設定名",configurationNameHelp:"保存済みのモデル設定の名前を変更します。",configurationNamePlaceholder:"高速執筆",searchModels:"モデル ID を検索または入力",useCustomModel:"使用",loadingModels:"モデルを読み込んでいます...",searchCatalog:"プロバイダーのカタログからモデルを選択します。",modelsAvailable:"利用可能",noModelResults:"一致するモデルはありません。",loadFailed:"モデル一覧を利用できません。",unsupportedModelList:"モデル ID を手動で入力してください。",providerNotConfigured:"モデルを読み込む前にこのプロバイダーを設定してください。",autoProviderCustomOnly:"自動プロバイダーモードではカスタムモデル ID を使用します。"},timezone:{select:"タイムゾーンを選択",search:"タイムゾーンを検索",empty:"一致するタイムゾーンはありません。"},cliApps:{allCategories:"すべてのカテゴリ",availableCount:"{{count}} 個のアプリ",installedCount:"{{count}} 個インストール済み",summary:"{{total}} 個中 {{installed}} 個の CLI がインストール済み",filterAll:"すべて",filterInstalled:"インストール済み CLI",filterNotInstalled:"未インストール",searchPlaceholder:"CLI を検索",statusInstalled:"インストール済み",statusAvailable:"利用可能",statusMissing:"依存関係が不足",statusUnsupported:"未対応",statusNotInstalled:"未インストール",unsupported:"未対応",loading:"CLI アプリを読み込み中...",empty:"この条件に一致する CLI アプリはありません。",readyTitle:"@{{name}} の準備ができました",readyStatus:"準備完了",readyPrompt:"@{{name}} を使って、この CLI でできることを確認します。",readyTry:"@{{name}} を試す",readyCopied:"コピーしました",openChat:"チャットを開く",requires:"必要条件",test:"CLI をテスト",update:"CLI を更新",uninstall:"CLI をアンインストール",install:"CLI をインストール",unavailable:"利用不可",noDescription:"説明はありません。"},about:{version:"バージョン",checking:"確認中...",checkForUpdates:"アップデートを確認",upToDate:"最新の状態です",updateAvailable:"アップデートがあります v{{version}}"},mcp:{allCategories:"すべてのカテゴリ",summary:"{{total}} 個中 {{installed}} 個のプリセットが有効",filterAll:"すべて",filterInstalled:"有効",filterNotInstalled:"未有効",searchPlaceholder:"MCP プリセットを検索",moreOptions:"その他の MCP オプション",moreOptionsSubtitle:"カスタムサーバーを追加するか mcp.json をインポートします。",customTitle:"カスタム MCP",customSubtitle:"任意の stdio、HTTP、SSE MCP サーバーを追加します。",customAction:"カスタム",importAction:"インポート",serverName:"サーバー名",serverUrl:"URL",transport:"トランスポート",command:"コマンド",args:"Args JSON",headers:"Headers JSON",env:"Env JSON",timeout:"ツールのタイムアウト",advancedOptions:"詳細オプション",hideAdvanced:"詳細を隠す",saveCustom:"MCP を保存",configImport:"mcp.json をインポート",importConfig:"インポート",restartRequired:"更新された MCP ツールに接続するには nanobot を再起動してください。",toolsFound:"{{count}} 個のツール",loading:"MCP プリセットを読み込み中...",empty:"この条件に一致する MCP プリセットはありません。",openDocs:"ドキュメントを開く",test:"テスト",remove:"削除",enable:"有効化",enabled:"有効",setup:"接続",configure:"接続",connectTitle:"{{name}} に接続",connectHint:"アカウント設定からキーを追加します。",saveAndEnable:"保存して有効化",updateSetup:"設定を更新",configured:"設定済み",keepExisting:"既存の値を維持するには空欄のままにします",statusConfigured:"設定済み",statusMissingCredentials:"キーが必要",statusMissingDependency:"依存関係が必要",statusComingSoon:"近日公開",statusNotInstalled:"未有効",toolScope:"ツール",allTools:"すべて",noTools:"なし",testForTools:"テストを実行して個別のツールを確認・選択します。"},legal:{thirdPartyBrands:"製品名、ロゴ、ブランドはそれぞれの所有者に帰属します。使用は識別のみを目的とし、承認を意味するものではありません。"},apps:{description:"nanobot がチャットで使用できる App CLI と MCP サービスを追加します。",cliLabel:"CLI",mcpLabel:"MCP",filterAll:"すべて",filterCli:"CLI アプリ",filterMcp:"MCP サービス",enabledSummary:"{{count}} 件有効",caption:"CLI {{cli}} 件 · MCP {{mcp}} 件",searchPlaceholder:"アプリを検索",featured:"注目",loading:"アプリを読み込み中...",empty:"一致するアプリはありません。"},automations:{filters:{all:"すべて",active:"実行中",paused:"一時停止",failed:"要対応",system:"システム"},sort:{next:"次回実行",last:"前回実行",updated:"更新日時",name:"名前"},search:"タスク、メッセージ、関連チャット、予定を検索",queue:"キュー",loading:"自動タスクを読み込み中...",noMatches:"この表示に一致する自動タスクはありません。",empty:"自動タスクはまだありません。",emptyHint:"実行元から作成すると、nanobot が正しいコンテキストを保持できます。",oneShot:"一回限り",systemTask:"システム管理の自動タスク",labels:{schedule:"スケジュール",next:"次回",origin:"関連チャット",created:"作成",updated:"更新"},runNow:"今すぐ実行",pause:"一時停止",resume:"再開",edit:"編集",delete:"削除",protected:"保護済み",editTitle:"自動タスクを編集",save:"保存",deleteTitle:"自動タスクを削除",deleteDescription:"{{name}} を cron ストアから削除します。過去のチャットメッセージはセッションに残ります。",cancel:"キャンセル",status:{system:"システム",running:"実行中",paused:"一時停止",failed:"失敗",completed:"完了",noSchedule:"スケジュールなし",active:"実行中"},origin:{system:"システム",unknown:"関連チャットなし"},channels:{api:"API",cli:"CLI",dingtalk:"DingTalk",discord:"Discord",email:"Email",feishu:"Feishu",matrix:"Matrix",msteams:"Microsoft Teams",qq:"QQ",slack:"Slack",telegram:"Telegram",wechat:"WeChat",wecom:"WeCom",weixin:"WeChat",whatsapp:"WhatsApp"},schedule:{at:"{{time}}",every:"{{duration}} ごと",cron:"Cron {{expr}}",cronWithTz:"Cron {{expr}} · {{tz}}",withTz:"{{summary}} · {{tz}}",dailyAt:"毎日 {{time}}",weekdaysAt:"平日 {{time}}",hourlyAt:"毎時 :{{minute}}",hourlyWindow:"{{start}}-{{end}} の毎時 :{{minute}}",custom:"カスタムスケジュール"},next:{paused:"一時停止",pending:"実行中",none:"次回実行なし"},message:{showMore:"メッセージ全文を表示",showLess:"折りたたむ"},fields:{name:"名前",message:"メッセージ",scheduleType:"スケジュール種別",every:"間隔",unit:"単位",cronExpression:"Cron 式",timezone:"タイムゾーン",runAt:"実行日時"},scheduleTypes:{every:"間隔",cron:"Cron",at:"一回限り"},everyUnits:{second:"秒",minute:"分",hour:"時間",day:"日"},validation:{nameRequired:"名前は必須です。",messageRequired:"メッセージは必須です。",intervalRequired:"間隔は正の数で指定してください。",cronRequired:"Cron 式は必須です。",timeRequired:"実行日時は必須です。",futureRequired:"実行日時は現在より後にしてください。"}},oauth:{authentication:"OAuth 認証",signIn:"サインイン",signingIn:"サインイン中...",signInAgain:"再度サインイン",signOut:"サインアウト",signedInAs:"{{account}} としてサインイン済み",signInHelp:"このデバイスからサインインします。API key は config に保存されません。",signInRequired:"サインインが必要です",signInBeforeSaving:"この OAuth プロバイダーをアクティブなモデルプロバイダーとして保存する前にサインインしてください。",signedIn:"サインイン済み",notSignedIn:"未サインイン"},skills:{description:"このエージェントが会話中に読み込める指示スキルを確認します。",caption:"{{available}} 利用可能 · 合計 {{total}}",featured:"エージェントスキル",empty:"利用可能なスキルはありません。",sourceWorkspace:"カスタム",sourceBuiltin:"組み込み",statusAvailable:"利用可能",statusUnavailable:"利用不可",unavailableReason:"不足: {{reason}}",openDetails:"{{name}} の詳細を開く",loadingDetail:"スキル詳細を読み込み中...",loadFailed:"スキル詳細を読み込めませんでした。",descriptionTitle:"説明",source:"ソース",status:"状態",requirements:"要件",noRequirements:"明示的な要件はありません。",commands:"コマンド",environment:"環境変数",missingCommands:"CLI 不足",missingEnvironment:"ENV 不足",unavailableReasonLabel:"利用不可の理由",rawInstructions:"元の SKILL.md",rawInstructionsEmpty:"元の説明はありません。",detailDescription:"{{name}} の詳細。"},voice:{selectProvider:"プロバイダーを選択",configureProvider:"プロバイダーを設定",languageAuto:"自動"}},mR={fallbackTitle:"チャット {{id}}",forkTitle:"分岐:{{title}}",loading:"読み込み中…",noSessions:"まだセッションがありません。",showMore:"さらに {{count}} 件表示",collapsed:"{{count}} 件のチャットを折りたたみ中",showLess:"折りたたむ",actions:"「{{title}}」のチャット操作",newInProject:"「{{project}}」で新しいチャットを開始",activity:{running:"Agent running",complete:"Agent finished",updated:"New activity"},pin:"Pin",unpin:"Unpin",rename:"Rename",renameTitle:"Rename chat",renameDescription:"Choose a local sidebar name for this chat.",renamePlaceholder:"Chat name",renameProjectTitle:"Rename project",renameProjectDescription:"Choose a local sidebar name for this project.",renameProjectPlaceholder:"Project name",renameSave:"Save",archive:"Archive",unarchive:"Unarchive",showArchived:"Show archived",hideArchived:"Hide archived",delete:"削除",newChat:"新しいチャット",groups:{pinned:"Pinned",all:"Chats",projects:"Projects",today:"Today",yesterday:"Yesterday",earlier:"Earlier",archived:"Archived"}},fR={title:"このチャットを削除しますか?",description:"この操作は元に戻せません。",cancel:"キャンセル",confirm:"削除",automationsDescription:"このチャットにはスケジュール済みの自動タスクがあります。削除するとそれらも削除されます。",moreAutomations:"他 {{count}} 件",confirmWithAutomations:"削除",schedule:{at:"{{time}}",every:"{{duration}} ごと",cron:"Cron {{expr}}",cronWithTz:"Cron {{expr}} · {{tz}}",unknown:"カスタムスケジュール"},next:{label:"次回: {{time}}",disabled:"一時停止中",none:"次回実行なし"}},hR={idle:"待機中",connecting:"接続中…",open:"接続済み",reconnecting:"再接続中…",closed:"切断済み",error:"接続エラー"},gR={loadingConversation:"会話を読み込み中…",empty:{greetings:{workOn:"一緒に何に取り組みましょうか?",start:"今日はどこから始めましょう?",build:"今日は何を作りましょうか?",tackle:"一緒に何を解決しましょう?"},quickActions:{plan:{title:"プロジェクト計画を作成",prompt:"次に作るものについて、簡潔なプロジェクト計画を作成してください。"},analyze:{title:"このデータを分析",prompt:"このデータを分析し、最も重要なパターンを指摘してください。"},brainstorm:{title:"アイデアを出す",prompt:"この問題について、実用的なアイデアとトレードオフをいくつか出してください。"},code:{title:"コードを書く",prompt:"このタスクのコードを書くのを手伝ってください。まず最小限の有用な変更から始めてください。"},summarize:{title:"この文書を要約",prompt:"この文書を要約し、重要なポイントを列挙してください。"},more:{title:"その他",prompt:"このワークスペースであなたが手伝える便利な方法をいくつか見せてください。"}},imageQuickActions:{icon:{title:"アプリアイコンを作る",prompt:"nanobot のクリーンな 1:1 アプリアイコンを生成してください。親しみやすいロボット、シンプルなベクター風、柔らかい青と白の配色、文字なし。"},sticker:{title:"ステッカーを作る",prompt:"小さなロボットアシスタントのかわいいステッカー風画像を生成してください。透明風の背景で、表情豊かで遊び心のある雰囲気。"},poster:{title:"ポスターを作る",prompt:"個人向け AI アシスタントの洗練されたポスター案を生成してください。モダンな構図、強い視覚階層、ランディングページ向け。"},product:{title:"製品モックアップ",prompt:"会話型 AI Web アプリのクリーンな製品モックアップ画像を生成してください。ミニマルな UI、上質なライティング、リアルなデバイスフレーム。"},portrait:{title:"スタイル付きポートレート",prompt:"親しみやすい AI コンパニオンのスタイル付きポートレートを生成してください。柔らかい光、細部は豊かで近づきやすい、モダンなイラスト風。"},edit:{title:"画像を編集",prompt:"画像編集を手伝ってください。まず編集する画像のアップロードまたは指定を求め、その後に編集後の結果を生成してください。"}}},header:{toggleSidebar:"サイドバーを切り替える",newChat:"新しいチャットを開始",toggleTheme:"ヘッダーからテーマを切り替える",settings:"設定を開く",sessionInfo:"セッション詳細"},sessionInfo:{title:"セッション",untitled:"無題のチャット",automations:"自動タスク",count:"{{count}}",loading:"自動タスクを読み込み中...",loadFailed:"自動タスクを読み込めませんでした。",empty:"このセッションにはまだ自動タスクがありません。",disabled:"オフ",schedule:{at:"{{time}}",every:"{{duration}}ごと",cron:"Cron {{expr}}",cronWithTz:"Cron {{expr}} · {{tz}}",unknown:"カスタムスケジュール"},next:{label:"次回 {{time}}",pending:"まもなく実行",disabled:"一時停止",none:"次回実行なし"}},composer:{placeholderThread:"メッセージを入力…",placeholderHero:"何を考えていますか?",placeholderOpening:"新しいチャットを開いています…",placeholderStreaming:"モデルが応答しています…",inputAria:"メッセージ入力欄",sendHint:"Enter で送信 · Shift+Enter で改行",runRuntimeTitle:"実行中 · {{elapsed}}",goalStateStrip:"目標 · {{label}}",goalStateFallback:"目標",goalStateExpandAria:"目標の全文を表示",goalStateSheetTitle:"目標",goalStateCloseAria:"目標を閉じる",send:"メッセージを送信",stop:"応答を停止",modelNotConfigured:"モデルが未設定です",configureModel:"モデルを設定",queued:{label:"保留中のガイド",guide:"ガイド",delete:"ガイドを削除",edit:"ガイドを編集",drag:"ドラッグして並べ替え"},attachImage:"画像を添付",imageMode:{label:"画像生成",toggle:"画像生成モードを切り替え",placeholder:"画像を説明または編集…",aspectAria:"画像のアスペクト比",aspectLabel:"画像の比率",aspect:{auto:"自動","1_1":"正方形 1:1","3_4":"縦長 3:4","9_16":"ストーリー 9:16","4_3":"横長 4:3","16_9":"ワイド 16:9"}},tools:{search:"検索",reason:"推論",deepResearch:"詳細調査",voice:"音声入力"},voice:{hint:"クリックして音声入力、または長押し",stop:"録音を停止",transcribing:"文字起こし中...",recordingStatus:"録音中 {{time}}"},voiceErrors:{unsupported:"このブラウザーは音声入力に対応していません。",permission:"マイクの許可が必要です。",notConfigured:"先に文字起こしプロバイダーを設定してください。",tooLong:"録音が長すぎます。",tooShort:"もう少し長く録音してください。",noInput:"マイク入力が検出されませんでした。",failed:"音声を文字起こしできませんでした。"},slash:{ariaLabel:"スラッシュコマンド",label:"コマンド",navigateHint:"↑↓ 選択",selectHint:"Enter/Tab 入力",closeHint:"Esc 閉じる",commands:{new:{title:"新しいチャット",description:"現在のタスクを停止して、新しい会話を開始します。"},stop:{title:"現在のタスクを停止",description:"このチャットで実行中の agent ターンをキャンセルします。"},restart:{title:"nanobot を再起動",description:"bot プロセスをその場で再起動します。"},status:{title:"ステータスを表示",description:"ランタイム、provider、channel の状態を表示します。"},model:{title:"モデル",description:"有効なモデルプリセットを表示または切り替えます。"},history:{title:"会話履歴を表示",description:"保存済みの直近 N 件の会話メッセージを表示します。"},dream:{title:"Dream を実行",description:"メモリ統合を手動で開始します。"},dream_log:{title:"Dream ログを表示",description:"直近の Dream 統合で変更された内容を表示します。"},dream_restore:{title:"メモリを復元",description:"以前の Dream スナップショットへメモリを戻します。"},goal:{title:"長期目標",description:"持続的な複数ステップの目標として扱うようエージェントに伝えます。"},help:{title:"ヘルプを表示",description:"利用可能なスラッシュコマンドを一覧表示します。"},pairing:{title:"ペアリング",description:"ペアリングリクエストを管理します。"}},badges:{current:"現在",recent:"最近"},details:{goalActive:"目標が実行中",goalReady:"継続的な目標を開始",history:"最近のメッセージを表示",stopRunning:"実行中"}},encoding:"処理中…",remove:"添付を削除",normalizedSizeHint:"{{orig}} → {{current}}(自動圧縮)",imageRejected:{unsupported_type:"対応していないファイル形式です",too_many_images:"1 メッセージにつき最大 {{max}} 枚です",magic_mismatch:"画像ファイルではないようです",decode_failed:"この画像をデコードできません",too_large:"画像が大きすぎます。小さいものを選んでください",io:"このファイルを読み込めません"},mentions:{ariaLabel:"アプリ",label:"アプリ",cliGroup:"CLI アプリ",mcpGroup:"MCP サービス",cliBadge:"CLI",mcpBadge:"MCP",cliDescription:"@{{name}} をローカル CLI アプリとして使用",mcpDescription:"@{{name}} を MCP サーバーとして使用"},workspace:{accessAria:"Workspace access mode",projectAria:"プロジェクトを選択",projectPlaceholder:"プロジェクトを選択",default:"Default Permission",full:"Full Access"}},scrollToBottom:"一番下へスクロール",loadEarlier:"以前のメッセージを読み込む",forkedFromHistory:"履歴から分岐",promptNavigator:{open:"プロンプトナビゲーターを開く",title:"プロンプト",search:"プロンプトを検索",noResults:"一致するプロンプトがありません。",jumpTo:"プロンプトへ移動: {{label}}"}},vR={streaming:"生成中",assistantTyping:"アシスタントが入力中",toolSingle:"ツールを使用中",toolMany:"{{count}} 個のツールを使用",toolSummary:"{{count}} 個のツール",toolSummaryMany:"{{count}} 個のツール",reasoningTools:"思考 · {{count}} 個のツール",reasoningToolsSingular:"思考 · 1 個のツール",reasoning:"思考",reasoningStreaming:"思考中…",reasoningSummary:"思考",agentActivitySummary:"{{reasoning}} ステップ · ツール呼び出し {{tools}} 回",agentActivityToolsOnly:"ツール呼び出し {{tools}} 回",agentActivityLiveSummary:"実行中… · {{reasoning}} ステップ · ツール呼び出し {{tools}} 回",agentActivityLiveToolsOnly:"実行中… · ツール呼び出し {{tools}} 回",imageAttachment:"画像の添付",forkFromHere:"分岐",copyReply:"コピー",copiedReply:"コピー済み",turnLatencyTitle:"応答時間(全行程)",activityThinkingFor:"{{duration}}考えています",activityThought:"思考しました",activityThoughtFor:"{{duration}}考えました",activityWorkingFor:"{{duration}}作業中",activityWorked:"作業しました",activityWorkedFor:"{{duration}}作業しました",cliActivityRunningOne:"@{{name}} を使用中",cliActivityRanOne:"@{{name}} を使用しました",cliActivityFailedOne:"@{{name}} が失敗しました",cliActivityRunningMany:"{{count}} 個の CLI アプリを使用中",cliActivityRanMany:"{{count}} 個の CLI アプリを使用しました",cliActivityFailedMany:"{{count}} 個の CLI アプリが失敗しました",cliRunRunning:"使用中",cliRunRan:"使用済み",cliRunFailed:"失敗",automationSourceFallback:"自動化",automationTriggered:"自動実行"},xR={title:"画像プレビュー",open:"画像を表示",prev:"前の画像",next:"次の画像",close:"プレビューを閉じる"},yR={aria:"ファイルプレビュー",close:"ファイルプレビューを閉じる",loading:"プレビューを読み込み中...",failed:"このファイルをプレビューできませんでした。",routeMissing:"ファイルプレビューには最新の gateway が必要です。nanobot gateway を再起動してから再試行してください。",resize:"ファイルプレビューの幅を変更",truncated:"ファイルが大きいため、プレビューは途中まで表示されています。"},bR={fallbackLanguage:"コード",copyAria:"コードをコピー",copy:"コピー",copied:"コピーしました"},wR={dismiss:"閉じる"},kR={messageTooBig:{title:"メッセージが大きすぎます",body:"サイズ上限を超えたため、直前のメッセージはサーバーに拒否されました。画像を減らすか、より小さいファイルに差し替えて再送してください。"},workspaceScopeRejected:{title:"Workspace was not changed",body:"Nanobot kept the previous workspace because the requested project or access mode was rejected by the gateway."}},CR={dialog:{defaultProject:"Default workspace",manual:"パスを貼り付け",manualPlaceholder:"/Users/name/project",usePath:"Use Path",absolutePathRequired:"Enter an absolute folder path on this machine."}},SR={app:uR,sidebar:dR,settings:pR,chat:mR,deleteConfirm:fR,connection:hR,thread:gR,message:vR,lightbox:xR,filePreview:yR,code:bR,common:wR,errors:kR,workspace:CR},NR={brand:"nanobot",loading:{connecting:"nanobot에 연결 중…",boot:"nanobot 불러오는 중…"},error:{title:"nanobot에 연결할 수 없습니다",gatewayHint:"gateway(`nanobot gateway`)가 실행 중인지, 그리고 이 페이지가 같은 머신에서 열려 있는지 확인하세요."},auth:{title:"인증이 필요합니다",hint:"gateway 설정의 tokenIssueSecret에 구성된 비밀 값을 입력하세요.",placeholder:"비밀번호",submit:"연결",invalid:"비밀번호가 올바르지 않습니다. 다시 시도하세요."},account:{section:"계정",logoutHint:"이 브라우저를 gateway에서 연결 해제합니다.",logout:"로그아웃"},system:{section:"시스템",restartHint:"런타임 변경 사항을 적용하려면 nanobot을 다시 시작하세요.",restart:"nanobot 다시 시작",restarting:"다시 시작 중...",restartEngine:"엔진 다시 시작",restartingEngine:"엔진 다시 시작 중..."},restart:{completed:"{{seconds}}초 만에 다시 시작되었습니다."},documentTitle:{base:"nanobot",chat:"{{title}} · nanobot"},meta:{description:"nanobot 웹 UI — nanobot 작업공간과 대화하세요."}},jR={navigation:"사이드바 탐색",collapse:"사이드바 접기",newChat:"새 채팅",searchAria:"검색",searchPlaceholder:"검색",searchResults:"결과",noSearchResults:"일치하는 채팅이 없습니다.",recent:"최근 대화",settings:"설정",language:{label:"언어",ariaLabel:"언어 변경"},apps:"앱",automations:"자동화",skills:{title:"스킬"}},AR={backToChat:"채팅으로 돌아가기",sidebar:{title:"설정",ariaLabel:"설정 섹션"},nav:{general:"일반",byok:"BYOK",overview:"개요",appearance:"외관",models:"모델",providers:"제공자",image:"이미지",voice:"음성",browser:"웹",runtime:"시스템",advanced:"보안",cliApps:"CLI 앱",mcp:"MCP",apps:"앱",automations:"자동화",skills:"스킬"},sections:{interface:"인터페이스",ai:"AI",system:"시스템",about:"정보",status:"상태",localPreferences:"로컬 환경설정",presets:"프리셋",imageGeneration:"이미지 생성",imageDefaults:"기본값",webSearch:"웹 검색",webBehavior:"동작",identity:"ID",webuiSafety:"WebUI 보안",capabilities:"기능",cliApps:"CLI 앱",mcp:"MCP 서비스",apps:"앱",nativeHost:"네이티브 호스트",hostSafety:"앱 보안",voiceInput:"음성 입력"},rows:{theme:"테마",language:"언어",provider:"제공자",model:"모델",restart:"nanobot 재시작",configPath:"설정 경로",activePreset:"활성 프리셋",gateway:"게이트웨이",restartState:"재시작 상태",pendingChanges:"대기 중인 변경",selectedPreset:"선택한 프리셋",presetModel:"프리셋 모델",density:"밀도",activityMode:"활동 상세",codeWrap:"코드 줄바꿈",maxResults:"최대 결과 수",timeout:"타임아웃",jinaReader:"Jina 리더",imageGeneration:"이미지 생성",imageProvider:"이미지 제공자",imageProviderStatus:"제공자 상태",imageProviderBase:"제공자 주소",imageModel:"이미지 모델",defaultAspectRatio:"기본 비율",defaultImageSize:"기본 크기",maxImagesPerTurn:"턴당 최대 이미지 수",imageSaveDir:"저장 디렉터리",botName:"Bot 이름",botIcon:"Bot 아이콘",timezone:"시간대",workspacePath:"기본 작업공간",localServiceAccess:"로컬 서비스",webuiDefaultAccess:"기본 권한",currentModel:"현재 구성",brandLogos:"브랜드 로고",cliAppsCatalog:"카탈로그",cliAppsFilter:"필터",engine:"엔진",logs:"로그",diagnostics:"진단",contextWindow:"컨텍스트 창",transcription:"전사",transcriptionProvider:"제공자",transcriptionProviderStatus:"제공자 상태",transcriptionModel:"모델",transcriptionLanguage:"언어",voiceLimits:"제한"},help:{theme:"밝은 모드와 어두운 모드를 전환합니다.",language:"WebUI에서 사용할 언어를 선택합니다.",provider:"새 모델 요청을 처리할 제공자를 선택합니다.",model:"nanobot이 기본으로 사용할 모델 이름을 설정합니다.",configPath:"현재 게이트웨이가 사용하는 설정 파일입니다.",selectedPreset:"이름 있는 프리셋은 여기서 읽기 전용입니다. config.json에서 편집하세요.",presetModel:"Default로 전환하면 WebUI에서 모델과 제공자를 편집할 수 있습니다.",density:"이 브라우저에만 저장됩니다.",activityMode:"기본으로 표시할 agent 활동 세부 수준을 선택합니다.",codeWrap:"작은 화면에서도 긴 코드 줄을 읽기 쉽게 유지합니다.",maxResults:"각 web_search 호출에서 반환되는 결과 수입니다.",timeout:"검색 제공자 요청이 타임아웃되기 전의 초입니다.",jinaReader:"가능할 때 web_fetch에 Jina Reader를 사용합니다.",imageGeneration:"구성된 이미지 제공자가 있을 때 채팅에서 generate_image를 노출합니다.",imageProvider:"generate_image에 사용할 등록 제공자를 선택합니다.",imageProviderStatus:"이미지 생성은 제공자 자격 증명을 재사용합니다.",imageModel:"선택한 이미지 제공자에 보낼 모델 이름입니다.",defaultAspectRatio:"프롬프트가 비율을 선택하지 않을 때 사용됩니다.",defaultImageSize:"지원하는 제공자에 보낼 크기 힌트입니다.",maxImagesPerTurn:"한 번의 generate_image 요청에서 생성할 수 있는 이미지 상한입니다.",botName:"nanobot이 표시 이름을 사용하는 곳에 표시됩니다.",botIcon:"Bot 이름 옆에 표시할 짧은 emoji 또는 텍스트입니다.",timezone:"일정과 시간 인식 답변에 사용됩니다.",localServiceAccess:"Full Access shell 명령이 localhost 서비스에 접근할 수 있게 합니다.",webuiDefaultAccess:"프로젝트별 권한이 없는 Web 채팅에 사용됩니다.",securityManagedControls:"웹 가져오기는 항상 로컬, 사설, 메타데이터 서비스를 보호합니다. 핵심 채널 보안은 config.json에서 관리됩니다.",currentModel:"새 응답에 사용됩니다.",selectedModelProvider:"선택한 모델에 의해 설정됩니다.",selectedModelValue:"선택한 모델에 의해 설정됩니다.",brandLogos:"설정에서 타사 제공자와 CLI 로고를 표시합니다.",cliAppsCatalog:"nanobot이 로컬에서 실행할 수 있는 앱 CLI 어댑터만 설치합니다. 네이티브 앱은 변경하지 않습니다.",cliAppsFilter:"앱, 카테고리 또는 기능으로 검색합니다.",logs:"네이티브 엔진 로그 폴더를 엽니다.",diagnostics:"지원용 작은 런타임 보고서를 내보냅니다.",localServiceAccessNative:"Full Access shell 명령이 이 Mac의 서비스에 접근할 수 있게 합니다.",webuiDefaultAccessNative:"프로젝트별 권한이 없는 네이티브 채팅에 사용됩니다.",contextWindow:"이 모델 구성의 기본 컨텍스트 예산을 선택합니다.",transcription:"마이크 입력을 보내기 전에 텍스트로 변환합니다. 채널 음성 메시지도 같은 설정을 사용합니다.",transcriptionProvider:"Providers에 저장된 해당 제공자의 인증 정보를 사용합니다.",transcriptionProviderStatus:"API 키는 transcription 설정이 아니라 providers 아래에 유지됩니다.",transcriptionModel:"제공자가 사용자 지정 모델 ID를 요구하지 않으면 해석된 기본값을 사용하세요.",transcriptionLanguage:"en, zh, ja, ko 같은 선택적 ISO-639 힌트입니다."},values:{light:"라이트",dark:"다크",notAvailable:"사용 불가",enabled:"활성화됨",disabled:"비활성화됨",restartPending:"재시작 대기",ready:"준비됨",privateEngine:"비공개 엔진",unixSocket:"Unix 소켓",defaultWorkspace:"기본 작업 공간",comfortable:"편안함",compact:"컴팩트",auto:"자동",expanded:"펼침",on:"켜짐",off:"꺼짐",defaultPermission:"기본 권한",fullAccess:"전체 접근",configured:"구성됨",notConfigured:"미구성",pending:"대기 중",restartingEngine:"재시작 중"},status:{loading:"설정을 불러오는 중...",loadError:"설정을 불러올 수 없습니다",unsaved:"저장되지 않은 변경 사항이 있습니다.",upToDate:"최신 상태입니다.",savedRestart:"저장했습니다. 적용하려면 nanobot을 재시작하세요.",restartAfterSaving:"변경 사항을 저장한 뒤 준비되면 재시작하세요.",savedRestartApply:"저장했습니다. 준비되면 재시작하세요.",imageProviderRestart:"이미지 제공자 변경 사항을 저장했습니다. 준비되면 재시작하세요.",hostRestartAfterSaving:"저장하면 nanobot이 엔진을 재시작합니다.",hostRestartPending:"저장했습니다. 준비되면 엔진을 재시작합니다.",hostApiUnavailable:"호스트 작업은 네이티브 앱 안에서만 사용할 수 있습니다.",logsOpened:"로그 폴더를 열었습니다.",logsOpenFailed:"로그 폴더를 열 수 없습니다.",diagnosticsExported:"진단을 {{path}}에 내보냈습니다.",diagnosticsExportFailed:"진단을 내보낼 수 없습니다."},actions:{save:"저장",saving:"저장 중",edit:"편집",cancel:"취소",open:"열기",export:"내보내기",opening:"여는 중...",exporting:"내보내는 중..."},byok:{description:"직접 provider 키를 가져옵니다. Nanobot은 현재 config에서 값을 읽고, 설정된 provider만 일반 설정에서 선택할 수 있습니다.",configured:"설정됨",notConfigured:"설정 안 됨",configuredSection:"설정됨",notConfiguredSection:"설정 안 됨",showMore:"{{count}}개 더 보기",showLess:"접기",apiKey:"API key",apiBase:"API base",apiKeyPlaceholder:"API key 입력",apiKeyConfiguredPlaceholder:"비워 두면 현재 key 유지",configuredKeyHint:"설정된 key",apiBasePlaceholder:"provider 기본값 사용",apiKeyRequired:"이 provider를 설정하려면 API key가 필요합니다.",showApiKey:"API key 표시",hideApiKey:"API key 숨기기",noConfiguredProviders:"설정된 provider가 없습니다",configureFirst:"먼저 BYOK에서 provider를 설정하세요.",openByok:"BYOK 열기",tabs:{ariaLabel:"BYOK 자격 증명 유형",llm:"LLM",webSearch:"웹 검색"},webSearch:{provider:"검색 provider",providerHelp:"web search 도구가 사용할 백엔드를 선택합니다.",selectProvider:"provider 선택",credentials:"자격 증명",noCredentialRequired:"key 필요 없음",noCredentialHelp:"DuckDuckGo는 API key를 저장하지 않고 사용할 수 있습니다.",apiKeyHelp:"config에 저장되며 저장 후에는 마스킹되어 표시됩니다.",baseUrl:"Base URL",baseUrlHelp:"SearXNG에는 자체 인스턴스 URL이 필요합니다.",baseUrlPlaceholder:"https://search.example.com",apiKeyRequired:"이 검색 provider에는 API key가 필요합니다.",baseUrlRequired:"SearXNG에는 Base URL이 필요합니다.",missingCredential:"저장하기 전에 필요한 자격 증명을 입력하세요.",saveHint:"변경 사항은 새 web search 요청에 적용됩니다."}},overview:{model:"현재 모델",providers:"제공자",configuredCount:"{{count}}개 구성됨",totalProviders:"{{count}}개 사용 가능",webSearch:"웹 검색",imageGeneration:"이미지 생성",voiceInput:"음성 입력",workspace:"작업공간"},usage:{title:"Token 활동",shortTitle:"Token Usage",subtitle:"최근 12개월 동안 제공자가 보고한 사용량입니다.",empty:"새 모델 응답 이후 token 활동이 표시됩니다.",totalTokens:"누적 Token 수",peakTokens:"최고 Token 수",thirtyDayTokens:"30일 Token 수",currentStreak:"현재 연속 일수",longestStreak:"최장 연속 일수",daysValue:"{{count}}일",last30:"30일",activeDays:"활성 일수",requests:"요청",estimated:"추정",includesEstimates:"추정 포함",cellTitle:"{{date}}: {{tokens}} tokens, 요청 {{requests}}회",sources:{user:"채팅",api:"API",cron:"자동화",dream:"메모리 정리",system:"시스템"}},providers:{searchPlaceholder:"제공자 검색",noMatches:"일치하는 제공자가 없습니다.",saveProvider:"제공자 저장"},image:{selectProvider:"제공자 선택",selectAspect:"비율 선택",selectSize:"크기 선택",configureProvider:"제공자 구성",missingCredential:"이미지 생성을 활성화하기 전에 이 제공자를 구성하세요."},models:{selectModel:"모델 선택",addConfiguration:"구성 추가",newConfiguration:"새 모델 구성",newConfigurationHelp:"제공자와 모델을 원클릭 옵션으로 저장합니다.",configurationName:"구성 이름",configurationNameHelp:"저장된 모델 구성의 이름을 변경합니다.",configurationNamePlaceholder:"빠른 작성",searchModels:"모델 ID 검색 또는 입력",useCustomModel:"사용",loadingModels:"모델 불러오는 중...",searchCatalog:"제공자 카탈로그에서 모델을 선택합니다.",modelsAvailable:"사용 가능",noModelResults:"일치하는 모델이 없습니다.",loadFailed:"모델 목록을 사용할 수 없습니다.",unsupportedModelList:"모델 ID를 직접 입력하세요.",providerNotConfigured:"모델을 불러오기 전에 이 제공자를 설정하세요.",autoProviderCustomOnly:"자동 제공자 모드는 사용자 지정 모델 ID를 사용합니다."},timezone:{select:"시간대 선택",search:"시간대 검색",empty:"일치하는 시간대가 없습니다."},cliApps:{allCategories:"모든 카테고리",availableCount:"앱 {{count}}개",installedCount:"{{count}}개 설치됨",summary:"CLI {{total}}개 중 {{installed}}개 설치됨",filterAll:"전체",filterInstalled:"설치된 CLI",filterNotInstalled:"미설치",searchPlaceholder:"CLI 검색",statusInstalled:"설치됨",statusAvailable:"사용 가능",statusMissing:"의존성 필요",statusUnsupported:"지원 안 함",statusNotInstalled:"미설치",unsupported:"지원 안 함",loading:"CLI 앱 로드 중...",empty:"이 필터와 일치하는 CLI 앱이 없습니다.",readyTitle:"@{{name}} 준비됨",readyStatus:"준비됨",readyPrompt:"@{{name}}을 사용해 이 CLI가 무엇을 할 수 있는지 확인하세요.",readyTry:"@{{name}} 사용해 보기",readyCopied:"복사됨",openChat:"채팅 열기",requires:"필요 항목",test:"CLI 테스트",update:"CLI 업데이트",uninstall:"CLI 제거",install:"CLI 설치",unavailable:"사용 불가",noDescription:"설명이 없습니다."},about:{version:"버전",checking:"확인 중...",checkForUpdates:"업데이트 확인",upToDate:"최신 버전입니다",updateAvailable:"업데이트 사용 가능 v{{version}}"},mcp:{allCategories:"모든 카테고리",summary:"프리셋 {{total}}개 중 {{installed}}개 활성화됨",filterAll:"전체",filterInstalled:"활성화됨",filterNotInstalled:"비활성",searchPlaceholder:"MCP 프리셋 검색",moreOptions:"추가 MCP 옵션",moreOptionsSubtitle:"사용자 지정 서버를 추가하거나 mcp.json을 가져옵니다.",customTitle:"사용자 지정 MCP",customSubtitle:"stdio, HTTP 또는 SSE MCP 서버를 추가합니다.",customAction:"사용자 지정",importAction:"가져오기",serverName:"서버 이름",serverUrl:"URL",transport:"전송 방식",command:"명령",args:"Args JSON",headers:"Headers JSON",env:"Env JSON",timeout:"도구 제한 시간",advancedOptions:"고급 옵션",hideAdvanced:"고급 숨기기",saveCustom:"MCP 저장",configImport:"mcp.json 가져오기",importConfig:"가져오기",restartRequired:"업데이트된 MCP 도구를 연결하려면 nanobot을 다시 시작하세요.",toolsFound:"도구 {{count}}개",loading:"MCP 프리셋 로드 중...",empty:"이 필터와 일치하는 MCP 프리셋이 없습니다.",openDocs:"문서 열기",test:"테스트",remove:"제거",enable:"활성화",enabled:"활성화됨",setup:"연결",configure:"연결",connectTitle:"{{name}} 연결",connectHint:"계정 설정에서 키를 추가하세요.",saveAndEnable:"저장 후 활성화",updateSetup:"설정 업데이트",configured:"구성됨",keepExisting:"기존 값을 유지하려면 비워 두세요",statusConfigured:"구성됨",statusMissingCredentials:"키 필요",statusMissingDependency:"의존성 필요",statusComingSoon:"곧 제공",statusNotInstalled:"비활성",toolScope:"도구",allTools:"전체",noTools:"없음",testForTools:"테스트를 실행해 개별 도구를 확인하고 선택하세요."},legal:{thirdPartyBrands:"제품 이름, 로고 및 브랜드는 각 소유자의 자산입니다. 사용은 식별 목적일 뿐 보증이나 제휴를 의미하지 않습니다."},apps:{description:"nanobot이 채팅에서 사용할 수 있는 App CLI와 MCP 서비스를 추가합니다.",cliLabel:"CLI",mcpLabel:"MCP",filterAll:"전체",filterCli:"CLI 앱",filterMcp:"MCP 서비스",enabledSummary:"{{count}}개 활성화됨",caption:"CLI {{cli}}개 · MCP {{mcp}}개",searchPlaceholder:"앱 검색",featured:"추천",loading:"앱을 불러오는 중...",empty:"일치하는 앱이 없습니다."},automations:{filters:{all:"전체",active:"활성",paused:"일시 중지",failed:"확인 필요",system:"시스템"},sort:{next:"다음 실행",last:"마지막 실행",updated:"업데이트",name:"이름"},search:"작업, 메시지, 연결된 채팅 또는 일정 검색",queue:"대기열",loading:"자동화를 불러오는 중...",noMatches:"이 보기와 일치하는 자동화가 없습니다.",empty:"아직 자동화가 없습니다.",emptyHint:"실행될 위치에서 만들면 nanobot이 올바른 컨텍스트를 유지합니다.",oneShot:"일회성",systemTask:"시스템 관리 자동화",labels:{schedule:"일정",next:"다음",origin:"연결된 채팅",created:"생성",updated:"업데이트"},runNow:"지금 실행",pause:"일시 중지",resume:"재개",edit:"편집",delete:"삭제",protected:"보호됨",editTitle:"자동화 편집",save:"저장",deleteTitle:"자동화 삭제",deleteDescription:"{{name}}을 cron 저장소에서 삭제합니다. 이전 채팅 메시지는 세션에 남습니다.",cancel:"취소",status:{system:"시스템",running:"실행 중",paused:"일시 중지",failed:"실패",completed:"완료",noSchedule:"일정 없음",active:"활성"},origin:{system:"시스템",unknown:"연결된 채팅 없음"},channels:{api:"API",cli:"CLI",dingtalk:"DingTalk",discord:"Discord",email:"Email",feishu:"Feishu",matrix:"Matrix",msteams:"Microsoft Teams",qq:"QQ",slack:"Slack",telegram:"Telegram",wechat:"WeChat",wecom:"WeCom",weixin:"WeChat",whatsapp:"WhatsApp"},schedule:{at:"{{time}}",every:"{{duration}}마다",cron:"Cron {{expr}}",cronWithTz:"Cron {{expr}} · {{tz}}",withTz:"{{summary}} · {{tz}}",dailyAt:"매일 {{time}}",weekdaysAt:"평일 {{time}}",hourlyAt:"매시간 :{{minute}}",hourlyWindow:"{{start}}-{{end}} 사이 매시간 :{{minute}}",custom:"사용자 지정 일정"},next:{paused:"일시 중지",pending:"실행 중",none:"다음 실행 없음"},message:{showMore:"전체 메시지 보기",showLess:"접기"},fields:{name:"이름",message:"메시지",scheduleType:"일정 유형",every:"간격",unit:"단위",cronExpression:"Cron 식",timezone:"시간대",runAt:"실행 시간"},scheduleTypes:{every:"간격",cron:"Cron",at:"일회성"},everyUnits:{second:"초",minute:"분",hour:"시간",day:"일"},validation:{nameRequired:"이름은 필수입니다.",messageRequired:"메시지는 필수입니다.",intervalRequired:"간격은 양수여야 합니다.",cronRequired:"Cron 식은 필수입니다.",timeRequired:"실행 시간은 필수입니다.",futureRequired:"실행 시간은 현재보다 이후여야 합니다."}},oauth:{authentication:"OAuth 인증",signIn:"로그인",signingIn:"로그인 중...",signInAgain:"다시 로그인",signOut:"로그아웃",signedInAs:"{{account}}로 로그인됨",signInHelp:"이 기기에서 로그인합니다. API key는 config에 저장되지 않습니다.",signInRequired:"로그인이 필요합니다",signInBeforeSaving:"이 OAuth 제공자를 활성 모델 제공자로 저장하기 전에 로그인하세요.",signedIn:"로그인됨",notSignedIn:"로그인 안 됨"},skills:{description:"이 에이전트가 대화 중에 불러올 수 있는 지시 스킬을 확인합니다.",caption:"{{available}}개 사용 가능 · 총 {{total}}개",featured:"에이전트 스킬",empty:"사용 가능한 스킬이 없습니다.",sourceWorkspace:"사용자 지정",sourceBuiltin:"내장",statusAvailable:"사용 가능",statusUnavailable:"사용 불가",unavailableReason:"누락: {{reason}}",openDetails:"{{name}} 상세 열기",loadingDetail:"스킬 상세를 불러오는 중...",loadFailed:"스킬 상세를 불러올 수 없습니다.",descriptionTitle:"설명",source:"출처",status:"상태",requirements:"요구 사항",noRequirements:"명시된 요구 사항이 없습니다.",commands:"명령",environment:"환경 변수",missingCommands:"CLI 누락",missingEnvironment:"ENV 누락",unavailableReasonLabel:"사용 불가 이유",rawInstructions:"원본 SKILL.md",rawInstructionsEmpty:"원본 지침이 없습니다.",detailDescription:"{{name}} 세부 정보."},voice:{selectProvider:"제공자 선택",configureProvider:"제공자 설정",languageAuto:"자동"}},_R={fallbackTitle:"채팅 {{id}}",forkTitle:"분기: {{title}}",loading:"불러오는 중…",noSessions:"아직 세션이 없습니다.",showMore:"{{count}}개 더 보기",collapsed:"{{count}}개 채팅 접힘",showLess:"접기",actions:"{{title}} 채팅 작업",newInProject:"{{project}}에서 새 채팅 시작",activity:{running:"Agent running",complete:"Agent finished",updated:"New activity"},pin:"Pin",unpin:"Unpin",rename:"Rename",renameTitle:"Rename chat",renameDescription:"Choose a local sidebar name for this chat.",renamePlaceholder:"Chat name",renameProjectTitle:"Rename project",renameProjectDescription:"Choose a local sidebar name for this project.",renameProjectPlaceholder:"Project name",renameSave:"Save",archive:"Archive",unarchive:"Unarchive",showArchived:"Show archived",hideArchived:"Hide archived",delete:"삭제",newChat:"새 채팅",groups:{pinned:"Pinned",all:"Chats",projects:"Projects",today:"Today",yesterday:"Yesterday",earlier:"Earlier",archived:"Archived"}},PR={title:"이 채팅을 삭제할까요?",description:"이 작업은 되돌릴 수 없습니다.",cancel:"취소",confirm:"삭제",automationsDescription:"이 채팅에는 예약된 자동화가 있습니다. 채팅을 삭제하면 자동화도 함께 삭제됩니다.",moreAutomations:"+ {{count}}개 더",confirmWithAutomations:"삭제",schedule:{at:"{{time}}",every:"{{duration}}마다",cron:"Cron {{expr}}",cronWithTz:"Cron {{expr}} · {{tz}}",unknown:"사용자 지정 일정"},next:{label:"다음: {{time}}",disabled:"일시 중지됨",none:"다음 실행 없음"}},TR={idle:"대기 중",connecting:"연결 중…",open:"연결됨",reconnecting:"재연결 중…",closed:"연결 끊김",error:"연결 오류"},RR={loadingConversation:"대화 불러오는 중…",empty:{greetings:{workOn:"우리 무엇을 함께 해볼까요?",start:"오늘은 어디서 시작할까요?",build:"오늘은 무엇을 만들어볼까요?",tackle:"함께 무엇을 해결할까요?"},quickActions:{plan:{title:"프로젝트 계획 만들기",prompt:"다음에 만들 것에 대한 간결한 프로젝트 계획을 작성해 주세요."},analyze:{title:"이 데이터 분석하기",prompt:"이 데이터를 분석하고 가장 중요한 패턴을 짚어 주세요."},brainstorm:{title:"아이디어 브레인스토밍",prompt:"이 문제에 대한 실용적인 아이디어와 트레이드오프를 몇 가지 제안해 주세요."},code:{title:"코드 작성하기",prompt:"이 작업을 위한 코드를 작성해 주세요. 가장 작은 유용한 변경부터 시작해 주세요."},summarize:{title:"문서 요약하기",prompt:"이 문서를 요약하고 핵심 내용을 정리해 주세요."},more:{title:"더 보기",prompt:"이 워크스페이스에서 도와줄 수 있는 유용한 방법을 몇 가지 보여 주세요."}},imageQuickActions:{icon:{title:"앱 아이콘 디자인",prompt:"nanobot을 위한 깔끔한 1:1 앱 아이콘을 생성해 주세요. 친근한 로봇, 단순한 벡터 스타일, 부드러운 파란색과 흰색 팔레트, 텍스트 없음."},sticker:{title:"스티커 만들기",prompt:"작은 로봇 도우미의 귀여운 스티커 스타일 이미지를 생성해 주세요. 투명해 보이는 배경, 표정이 풍부하고 장난스러운 느낌."},poster:{title:"포스터 만들기",prompt:"개인 AI 도우미를 위한 세련된 포스터 콘셉트를 생성해 주세요. 현대적인 구성, 강한 시각적 계층, 랜딩 페이지에 어울리는 스타일."},product:{title:"제품 목업",prompt:"대화형 AI 웹 앱을 위한 깔끔한 제품 목업 이미지를 생성해 주세요. 미니멀한 인터페이스, 고급스러운 조명, 현실적인 기기 프레임."},portrait:{title:"스타일화된 초상화",prompt:"친근한 AI 동반자의 스타일화된 초상화를 생성해 주세요. 부드러운 조명, 세밀하지만 다가가기 쉬운 분위기, 현대적인 일러스트 스타일."},edit:{title:"이미지 편집",prompt:"이미지 편집을 도와주세요. 먼저 편집할 이미지를 업로드하거나 지정하게 한 뒤, 편집된 결과를 생성해 주세요."}}},header:{toggleSidebar:"사이드바 전환",newChat:"새 채팅 시작",toggleTheme:"헤더에서 테마 전환",settings:"설정 열기",sessionInfo:"세션 세부 정보"},sessionInfo:{title:"세션",untitled:"제목 없는 채팅",automations:"자동화",count:"{{count}}",loading:"자동화를 불러오는 중...",loadFailed:"자동화를 불러오지 못했습니다.",empty:"이 세션에는 아직 자동화가 없습니다.",disabled:"꺼짐",schedule:{at:"{{time}}",every:"{{duration}}마다",cron:"Cron {{expr}}",cronWithTz:"Cron {{expr}} · {{tz}}",unknown:"사용자 지정 일정"},next:{label:"다음 {{time}}",pending:"곧 실행됨",disabled:"일시 중지됨",none:"다음 실행 없음"}},composer:{placeholderThread:"메시지를 입력하세요…",placeholderHero:"무슨 생각을 하고 있나요?",placeholderOpening:"새 채팅을 여는 중…",placeholderStreaming:"모델이 응답 중입니다…",inputAria:"메시지 입력",sendHint:"Enter로 전송 · Shift+Enter로 줄바꿈",runRuntimeTitle:"실행 중 · {{elapsed}}",goalStateStrip:"목표 · {{label}}",goalStateFallback:"목표",goalStateExpandAria:"전체 목표 보기",goalStateSheetTitle:"목표",goalStateCloseAria:"목표 닫기",send:"메시지 보내기",stop:"응답 중지",modelNotConfigured:"모델이 설정되지 않음",configureModel:"모델 설정",queued:{label:"대기 중인 안내",guide:"안내",delete:"안내 삭제",edit:"안내 수정",drag:"드래그하여 순서 변경"},attachImage:"이미지 첨부",imageMode:{label:"이미지 생성",toggle:"이미지 생성 모드 전환",placeholder:"이미지를 설명하거나 편집하세요…",aspectAria:"이미지 화면 비율",aspectLabel:"이미지 비율",aspect:{auto:"자동","1_1":"정사각형 1:1","3_4":"세로 3:4","9_16":"스토리 9:16","4_3":"가로 4:3","16_9":"와이드 16:9"}},tools:{search:"검색",reason:"추론",deepResearch:"심층 조사",voice:"음성 입력"},voice:{hint:"클릭해 받아쓰거나 길게 누르기",stop:"녹음 중지",transcribing:"변환 중...",recordingStatus:"녹음 중 {{time}}"},voiceErrors:{unsupported:"이 브라우저는 음성 입력을 지원하지 않습니다.",permission:"마이크 권한이 필요합니다.",notConfigured:"먼저 음성 변환 제공업체를 설정하세요.",tooLong:"녹음 시간이 너무 깁니다.",tooShort:"음성을 녹음하려면 조금 더 길게 눌러 주세요.",noInput:"마이크 입력이 감지되지 않았습니다.",failed:"오디오를 변환하지 못했습니다."},slash:{ariaLabel:"슬래시 명령",label:"명령",navigateHint:"↑↓ 선택",selectHint:"Enter/Tab 입력",closeHint:"Esc 닫기",commands:{new:{title:"새 채팅",description:"현재 작업을 중지하고 새 대화를 시작합니다."},stop:{title:"현재 작업 중지",description:"이 채팅에서 실행 중인 agent 턴을 취소합니다."},restart:{title:"nanobot 재시작",description:"bot 프로세스를 제자리에서 재시작합니다."},status:{title:"상태 보기",description:"런타임, provider, channel 상태를 표시합니다."},model:{title:"모델",description:"활성 모델 프리셋을 보거나 전환합니다."},history:{title:"대화 기록 보기",description:"저장된 최근 N개의 대화 메시지를 출력합니다."},dream:{title:"Dream 실행",description:"메모리 정리를 수동으로 트리거합니다."},dream_log:{title:"Dream 로그 보기",description:"마지막 Dream 정리에서 변경된 내용을 표시합니다."},dream_restore:{title:"메모리 복원",description:"이전 Dream 스냅샷으로 메모리를 되돌립니다."},goal:{title:"장기 목표",description:"에이전트에게 지속적인 다단계 목표로 처리하도록 지시합니다."},help:{title:"도움말 보기",description:"사용 가능한 슬래시 명령을 나열합니다."},pairing:{title:"페어링",description:"페어링 요청을 관리합니다."}},badges:{current:"현재",recent:"최근"},details:{goalActive:"목표 실행 중",goalReady:"지속 목표 시작",history:"최근 메시지 보기",stopRunning:"실행 중"}},encoding:"처리 중…",remove:"첨부 제거",normalizedSizeHint:"{{orig}} → {{current}} (자동 압축)",imageRejected:{unsupported_type:"지원하지 않는 파일 형식입니다",too_many_images:"메시지당 최대 {{max}}장까지 가능합니다",magic_mismatch:"이미지 파일이 아닌 것 같습니다",decode_failed:"이 이미지를 디코딩할 수 없습니다",too_large:"이미지가 너무 큽니다. 더 작은 걸로 시도해 주세요",io:"이 파일을 읽을 수 없습니다"},mentions:{ariaLabel:"앱",label:"앱",cliGroup:"CLI 앱",mcpGroup:"MCP 서비스",cliBadge:"CLI",mcpBadge:"MCP",cliDescription:"@{{name}}을 로컬 CLI 앱으로 사용",mcpDescription:"@{{name}}을 MCP 서버로 사용"},workspace:{accessAria:"Workspace access mode",projectAria:"프로젝트 선택",projectPlaceholder:"프로젝트 선택",default:"Default Permission",full:"Full Access"}},scrollToBottom:"맨 아래로 스크롤",loadEarlier:"이전 메시지 불러오기",forkedFromHistory:"기록에서 분기됨",promptNavigator:{open:"프롬프트 탐색기 열기",title:"프롬프트",search:"프롬프트 검색",noResults:"일치하는 프롬프트가 없습니다.",jumpTo:"프롬프트로 이동: {{label}}"}},MR={streaming:"생성 중",assistantTyping:"도우미가 입력 중",toolSingle:"도구 사용 중",toolMany:"도구 {{count}}개 사용됨",toolSummary:"도구 {{count}}개",toolSummaryMany:"도구 {{count}}개",reasoningTools:"추론 · 도구 {{count}}개",reasoningToolsSingular:"추론 · 도구 1개",reasoning:"추론",reasoningStreaming:"추론 중…",reasoningSummary:"추론",agentActivitySummary:"{{reasoning}}단계 · 도구 호출 {{tools}}회",agentActivityToolsOnly:"도구 호출 {{tools}}회",agentActivityLiveSummary:"진행 중… · {{reasoning}}단계 · 도구 호출 {{tools}}회",agentActivityLiveToolsOnly:"진행 중… · 도구 호출 {{tools}}회",imageAttachment:"이미지 첨부",forkFromHere:"분기",copyReply:"복사",copiedReply:"복사됨",turnLatencyTitle:"응답 시간(엔드투엔드)",activityThinkingFor:"{{duration}} 동안 생각 중",activityThought:"생각함",activityThoughtFor:"{{duration}} 동안 생각함",activityWorkingFor:"{{duration}} 동안 작업 중",activityWorked:"작업함",activityWorkedFor:"{{duration}} 동안 작업함",cliActivityRunningOne:"@{{name}} 사용 중",cliActivityRanOne:"@{{name}} 사용함",cliActivityFailedOne:"@{{name}} 실패",cliActivityRunningMany:"CLI 앱 {{count}}개 사용 중",cliActivityRanMany:"CLI 앱 {{count}}개 사용함",cliActivityFailedMany:"CLI 앱 {{count}}개 실패",cliRunRunning:"사용 중",cliRunRan:"사용함",cliRunFailed:"실패",automationSourceFallback:"자동화",automationTriggered:"자동 실행됨"},ER={title:"이미지 미리보기",open:"이미지 보기",prev:"이전 이미지",next:"다음 이미지",close:"미리보기 닫기"},IR={aria:"파일 미리보기",close:"파일 미리보기 닫기",loading:"미리보기 로딩 중...",failed:"이 파일을 미리 볼 수 없습니다.",routeMissing:"파일 미리보기에는 최신 gateway가 필요합니다. nanobot gateway를 다시 시작한 뒤 다시 시도하세요.",resize:"파일 미리보기 크기 조절",truncated:"파일이 커서 미리보기가 잘렸습니다."},LR={fallbackLanguage:"코드",copyAria:"코드 복사",copy:"복사",copied:"복사됨"},DR={dismiss:"닫기"},OR={messageTooBig:{title:"메시지가 너무 큽니다",body:"마지막 메시지가 서버의 크기 제한을 초과하여 거부되었습니다. 이미지를 줄이거나 더 작은 파일로 바꿔서 다시 보내 주세요."},workspaceScopeRejected:{title:"Workspace was not changed",body:"Nanobot kept the previous workspace because the requested project or access mode was rejected by the gateway."}},FR={dialog:{defaultProject:"Default workspace",manual:"경로 붙여넣기",manualPlaceholder:"/Users/name/project",usePath:"Use Path",absolutePathRequired:"Enter an absolute folder path on this machine."}},zR={app:NR,sidebar:jR,settings:AR,chat:_R,deleteConfirm:PR,connection:TR,thread:RR,message:MR,lightbox:ER,filePreview:IR,code:LR,common:DR,errors:OR,workspace:FR},$R={brand:"nanobot",loading:{connecting:"Conectando con nanobot…",boot:"Cargando nanobot…"},error:{title:"No se pudo conectar con nanobot",gatewayHint:"Asegúrate de que la gateway esté en ejecución (`nanobot gateway`) y de que esta página esté abierta en la misma máquina."},auth:{title:"Autenticación requerida",hint:"Introduce el secreto configurado como tokenIssueSecret en la configuración del gateway.",placeholder:"Contraseña",submit:"Conectar",invalid:"Contraseña no válida. Inténtalo de nuevo."},account:{section:"Cuenta",logoutHint:"Desconecta este navegador del gateway.",logout:"Cerrar sesión"},system:{section:"Sistema",restartHint:"Reinicia nanobot para aplicar los cambios de ejecución.",restart:"Reiniciar nanobot",restarting:"Reiniciando...",restartEngine:"Reiniciar motor",restartingEngine:"Reiniciando motor..."},restart:{completed:"Reinicio completado en {{seconds}} s."},documentTitle:{base:"nanobot",chat:"{{title}} · nanobot"},meta:{description:"Interfaz web de nanobot: conversa con tu espacio de trabajo de nanobot."}},UR={navigation:"Navegación de la barra lateral",collapse:"Contraer barra lateral",newChat:"Nuevo chat",searchAria:"Buscar",searchPlaceholder:"Buscar",searchResults:"Resultados",noSearchResults:"No hay chats coincidentes.",recent:"Recientes",settings:"Configuración",language:{label:"Idioma",ariaLabel:"Cambiar idioma"},apps:"Apps",automations:"Automatizaciones",skills:{title:"Habilidades"}},BR={backToChat:"Volver al chat",sidebar:{title:"Ajustes",ariaLabel:"Secciones de ajustes"},nav:{general:"General",byok:"BYOK",overview:"Resumen",appearance:"Apariencia",models:"Modelos",providers:"Proveedores",image:"Imagen",voice:"Voz",browser:"Internet",runtime:"Sistema",advanced:"Seguridad",cliApps:"Apps CLI",mcp:"MCP",apps:"Aplicaciones",automations:"Automatizaciones",skills:"Habilidades"},sections:{interface:"Interfaz",ai:"AI",system:"Sistema",about:"Acerca de",status:"Estado",localPreferences:"Preferencias locales",presets:"Preajustes",imageGeneration:"Generación de imágenes",imageDefaults:"Valores predeterminados",webSearch:"Búsqueda web",webBehavior:"Comportamiento",identity:"Identidad",webuiSafety:"Seguridad de WebUI",capabilities:"Capacidades",cliApps:"Aplicaciones CLI",mcp:"Servicios MCP",apps:"Aplicaciones",nativeHost:"Host nativo",hostSafety:"Seguridad de la app",voiceInput:"Entrada de voz"},rows:{theme:"Tema",language:"Idioma",provider:"Proveedor",model:"Modelo",restart:"Reiniciar nanobot",configPath:"Ruta de configuración",activePreset:"Preajuste activo",gateway:"Pasarela",restartState:"Estado de reinicio",pendingChanges:"Cambios pendientes",selectedPreset:"Preajuste seleccionado",presetModel:"Modelo del preajuste",density:"Densidad",activityMode:"Detalle de actividad",codeWrap:"Ajuste de código",maxResults:"Resultados máximos",timeout:"Tiempo de espera",jinaReader:"Lector Jina",imageGeneration:"Generación de imágenes",imageProvider:"Proveedor de imágenes",imageProviderStatus:"Estado del proveedor",imageProviderBase:"Base del proveedor",imageModel:"Modelo de imagen",defaultAspectRatio:"Proporción predeterminada",defaultImageSize:"Tamaño predeterminado",maxImagesPerTurn:"Máx. imágenes por turno",imageSaveDir:"Directorio de guardado",botName:"Nombre del bot",botIcon:"Icono del bot",timezone:"Zona horaria",workspacePath:"Workspace predeterminado",localServiceAccess:"Servicios locales",webuiDefaultAccess:"Acceso predeterminado",currentModel:"Configuración actual",brandLogos:"Logos de marca",cliAppsCatalog:"Catálogo",cliAppsFilter:"Filtro",engine:"Motor",logs:"Registros",diagnostics:"Diagnóstico",contextWindow:"Ventana de contexto",transcription:"Transcripcion",transcriptionProvider:"Proveedor",transcriptionProviderStatus:"Estado del proveedor",transcriptionModel:"Modelo",transcriptionLanguage:"Idioma",voiceLimits:"Limites"},help:{theme:"Cambia entre apariencia clara y oscura.",language:"Elige el idioma usado por WebUI.",provider:"Selecciona el proveedor para nuevas solicitudes de modelo.",model:"Define el nombre de modelo predeterminado de nanobot.",configPath:"Archivo de configuración que usa actualmente el gateway.",selectedPreset:"Los preajustes con nombre son de solo lectura aquí; edítalos en config.json.",presetModel:"Cambia a Default para editar modelo y proveedor desde WebUI.",density:"Solo se guarda en este navegador.",activityMode:"Elige cuánto detalle de actividad del agente se muestra por defecto.",codeWrap:"Mantiene legibles las líneas largas de código en pantallas pequeñas.",maxResults:"Resultados devueltos por cada llamada web_search.",timeout:"Segundos antes de que una solicitud de búsqueda expire.",jinaReader:"Usa Jina Reader para web_fetch cuando esté disponible.",imageGeneration:"Expone generate_image en chats cuando hay un proveedor de imagen configurado.",imageProvider:"Elige el proveedor registrado usado por generate_image.",imageProviderStatus:"La generación de imágenes reutiliza credenciales de Proveedores.",imageModel:"Nombre del modelo enviado al proveedor de imágenes seleccionado.",defaultAspectRatio:"Se usa cuando el prompt no elige una proporción.",defaultImageSize:"Pista de tamaño enviada a proveedores compatibles.",maxImagesPerTurn:"Límite superior para una solicitud generate_image.",botName:"Se muestra donde nanobot usa un nombre visible.",botIcon:"Emoji o texto corto junto al nombre del bot.",timezone:"Se usa para horarios y respuestas con conciencia temporal.",localServiceAccess:"Permite que comandos shell con Full Access alcancen servicios localhost.",webuiDefaultAccess:"Usado por chats web sin permiso específico de proyecto.",securityManagedControls:"Las capturas web siempre protegen servicios locales, privados y metadata. La seguridad de canales core se gestiona en config.json.",currentModel:"Se usa para nuevas respuestas.",selectedModelProvider:"Definido por el modelo seleccionado.",selectedModelValue:"Definido por el modelo seleccionado.",brandLogos:"Muestra logos de proveedores de terceros y CLI en Ajustes.",cliAppsCatalog:"Instala solo adaptadores CLI de apps que nanobot puede ejecutar localmente; las apps nativas no se modifican.",cliAppsFilter:"Busca por app, categoría o capacidad.",logs:"Abre la carpeta de registros del motor nativo.",diagnostics:"Exporta un pequeño informe de runtime para soporte.",localServiceAccessNative:"Permite que comandos shell con Full Access alcancen servicios en este Mac.",webuiDefaultAccessNative:"Usado por chats nativos sin permiso específico de proyecto.",contextWindow:"Elige el presupuesto de contexto predeterminado para esta configuración de modelo.",transcription:"Transcribe la entrada del microfono antes de enviarla. Los mensajes de voz de los canales usan la misma configuracion.",transcriptionProvider:"Usa las credenciales del proveedor correspondiente en Proveedores.",transcriptionProviderStatus:"Las claves API permanecen en proveedores, no en la configuracion de transcripcion.",transcriptionModel:"Dejalo como el valor predeterminado resuelto salvo que el proveedor necesite un id de modelo personalizado.",transcriptionLanguage:"Pista ISO-639 opcional, como en, zh, ja o ko."},values:{light:"Claro",dark:"Oscuro",notAvailable:"No disponible",enabled:"Activado",disabled:"Desactivado",restartPending:"Reinicio pendiente",ready:"Listo",privateEngine:"Motor privado",unixSocket:"Socket Unix",defaultWorkspace:"Espacio predeterminado",comfortable:"Cómodo",compact:"Compacto",auto:"Automático",expanded:"Expandido",on:"Activado",off:"Desactivado",defaultPermission:"Permiso predeterminado",fullAccess:"Acceso completo",configured:"Configurado",notConfigured:"Sin configurar",pending:"Pendiente",restartingEngine:"Reiniciando"},status:{loading:"Cargando ajustes...",loadError:"No se pudieron cargar los ajustes",unsaved:"Cambios sin guardar.",upToDate:"Actualizado.",savedRestart:"Guardado. Reinicia nanobot para aplicar.",restartAfterSaving:"Guarda los cambios y reinicia cuando puedas.",savedRestartApply:"Guardado. Reinicia cuando puedas.",imageProviderRestart:"Cambios del proveedor de imagen guardados. Reinicia cuando puedas.",hostRestartAfterSaving:"Al guardar, nanobot reiniciará su motor.",hostRestartPending:"Guardado. El motor se reiniciará cuando esté listo.",hostApiUnavailable:"Las acciones del host solo están disponibles en la app nativa.",logsOpened:"Carpeta de registros abierta.",logsOpenFailed:"No se pudo abrir la carpeta de registros.",diagnosticsExported:"Diagnóstico exportado a {{path}}.",diagnosticsExportFailed:"No se pudo exportar el diagnóstico."},actions:{save:"Guardar",saving:"Guardando",edit:"Editar",cancel:"Cancelar",open:"Abrir",export:"Exportar",opening:"Abriendo...",exporting:"Exportando..."},byok:{description:"Usa tus propias claves de proveedor. Nanobot lee estos valores desde la configuración actual, y solo los proveedores configurados se pueden elegir en General.",configured:"Configurado",notConfigured:"Sin configurar",configuredSection:"Configurados",notConfiguredSection:"Sin configurar",showMore:"Mostrar {{count}} más",showLess:"Mostrar menos",apiKey:"API key",apiBase:"API base",apiKeyPlaceholder:"Introduce la API key",apiKeyConfiguredPlaceholder:"Deja vacío para conservar la key actual",configuredKeyHint:"Key configurada",apiBasePlaceholder:"Usar el valor predeterminado del proveedor",apiKeyRequired:"Se requiere una API key para configurar este proveedor.",showApiKey:"Mostrar API key",hideApiKey:"Ocultar API key",noConfiguredProviders:"No hay proveedores configurados",configureFirst:"Configura primero un proveedor en BYOK.",openByok:"Abrir BYOK",tabs:{ariaLabel:"Tipo de credencial BYOK",llm:"LLM",webSearch:"Búsqueda web"},webSearch:{provider:"Proveedor de búsqueda",providerHelp:"Elige el backend que usará la herramienta web search.",selectProvider:"Seleccionar proveedor",credentials:"Credenciales",noCredentialRequired:"No requiere key",noCredentialHelp:"DuckDuckGo funciona sin guardar una API key.",apiKeyHelp:"Se guarda en config y se muestra enmascarada después de guardar.",baseUrl:"Base URL",baseUrlHelp:"SearXNG necesita la URL de tu propia instancia.",baseUrlPlaceholder:"https://search.example.com",apiKeyRequired:"Este proveedor de búsqueda requiere una API key.",baseUrlRequired:"SearXNG requiere una Base URL.",missingCredential:"Añade la credencial requerida antes de guardar.",saveHint:"Los cambios se aplican a nuevas solicitudes de web search."}},overview:{model:"Modelo actual",providers:"Proveedores",configuredCount:"{{count}} configurados",totalProviders:"{{count}} disponibles",webSearch:"Búsqueda web",imageGeneration:"Generación de imágenes",voiceInput:"Entrada de voz",workspace:"Espacio de trabajo"},usage:{title:"Actividad de tokens",shortTitle:"Token Usage",subtitle:"Uso reportado por el proveedor durante los últimos 12 meses.",empty:"La actividad de tokens aparecerá después de nuevas respuestas del modelo.",totalTokens:"Tokens totales",peakTokens:"Pico de tokens",thirtyDayTokens:"Tokens en 30 días",currentStreak:"Racha actual",longestStreak:"Racha más larga",daysValue:"{{count}} d",last30:"30 días",activeDays:"Días activos",requests:"Solicitudes",estimated:"estimado",includesEstimates:"incluye estimaciones",cellTitle:"{{date}}: {{tokens}} tokens, {{requests}} solicitudes",sources:{user:"Chat",api:"API",cron:"Automatizaciones",dream:"Memoria",system:"Sistema"}},providers:{searchPlaceholder:"Buscar proveedores",noMatches:"Ningún proveedor coincide con esta búsqueda.",saveProvider:"Guardar proveedor"},image:{selectProvider:"Seleccionar proveedor",selectAspect:"Seleccionar proporción",selectSize:"Seleccionar tamaño",configureProvider:"Configurar proveedor",missingCredential:"Configura este proveedor antes de activar la generación de imágenes."},models:{selectModel:"Seleccionar modelo",addConfiguration:"Agregar configuración",newConfiguration:"Nueva configuración de modelo",newConfigurationHelp:"Guarda un proveedor y modelo como opción de un clic.",configurationName:"Nombre de configuración",configurationNameHelp:"Renombra esta configuración de modelo guardada.",configurationNamePlaceholder:"Escritura rápida",searchModels:"Buscar o escribir ID de modelo",useCustomModel:"Usar",loadingModels:"Cargando modelos...",searchCatalog:"Busca el catálogo del proveedor para elegir un modelo.",modelsAvailable:"disponibles",noModelResults:"No hay modelos coincidentes.",loadFailed:"Lista de modelos no disponible.",unsupportedModelList:"Escribe un ID de modelo manualmente.",providerNotConfigured:"Configura este proveedor antes de cargar modelos.",autoProviderCustomOnly:"El modo de proveedor automático usa IDs de modelo personalizados."},timezone:{select:"Seleccionar zona horaria",search:"Buscar zona horaria",empty:"No hay zonas horarias coincidentes."},cliApps:{allCategories:"Todas las categorías",availableCount:"{{count}} aplicaciones",installedCount:"{{count}} instaladas",summary:"{{installed}} de {{total}} CLIs instaladas",filterAll:"Todas",filterInstalled:"CLIs instaladas",filterNotInstalled:"No instaladas",searchPlaceholder:"Buscar CLIs",statusInstalled:"Instalada",statusAvailable:"Disponible",statusMissing:"Falta dependencia",statusUnsupported:"No compatible",statusNotInstalled:"No instalada",unsupported:"No compatible",loading:"Cargando apps CLI...",empty:"Ninguna app CLI coincide con este filtro.",readyTitle:"@{{name}} está listo",readyStatus:"Listo",readyPrompt:"Usa @{{name}} para ver qué puede hacer este CLI.",readyTry:"Probar @{{name}}",readyCopied:"Copiado",openChat:"Abrir chat",requires:"Requiere",test:"Probar CLI",update:"Actualizar CLI",uninstall:"Desinstalar CLI",install:"Instalar CLI",unavailable:"No disponible",noDescription:"Sin descripción disponible."},about:{version:"Versión",checking:"Buscando actualizaciones...",checkForUpdates:"Buscar actualizaciones",upToDate:"Estás al día",updateAvailable:"Actualización disponible v{{version}}"},mcp:{allCategories:"Todas las categorías",summary:"{{installed}} de {{total}} presets habilitados",filterAll:"Todos",filterInstalled:"Habilitados",filterNotInstalled:"No habilitados",searchPlaceholder:"Buscar presets MCP",moreOptions:"Más opciones de MCP",moreOptionsSubtitle:"Añade un servidor personalizado o importa mcp.json.",customTitle:"MCP personalizado",customSubtitle:"Añade cualquier servidor MCP stdio, HTTP o SSE.",customAction:"Personalizado",importAction:"Importar",serverName:"Nombre del servidor",serverUrl:"URL",transport:"Transporte",command:"Comando",args:"Args JSON",headers:"Headers JSON",env:"Env JSON",timeout:"Tiempo límite de herramienta",advancedOptions:"Opciones avanzadas",hideAdvanced:"Ocultar avanzado",saveCustom:"Guardar MCP",configImport:"Importar mcp.json",importConfig:"Importar",restartRequired:"Reinicia nanobot para conectar las herramientas MCP actualizadas.",toolsFound:"{{count}} herramientas",loading:"Cargando presets MCP...",empty:"Ningún preset MCP coincide con este filtro.",openDocs:"Abrir docs",test:"Probar",remove:"Eliminar",enable:"Habilitar",enabled:"Habilitado",setup:"Conectar",configure:"Conectar",connectTitle:"Conectar {{name}}",connectHint:"Añade la clave desde la configuración de tu cuenta.",saveAndEnable:"Guardar y habilitar",updateSetup:"Actualizar configuración",configured:"configurado",keepExisting:"Déjalo en blanco para conservar el valor actual",statusConfigured:"Configurado",statusMissingCredentials:"Necesita clave",statusMissingDependency:"Necesita dependencia",statusComingSoon:"Próximamente",statusNotInstalled:"No habilitado",toolScope:"Herramientas",allTools:"Todas",noTools:"Ninguna",testForTools:"Ejecuta Probar para inspeccionar y elegir herramientas individuales."},legal:{thirdPartyBrands:"Los nombres, logotipos y marcas de productos pertenecen a sus respectivos propietarios. Su uso es solo identificativo y no implica respaldo."},apps:{description:"Agrega CLI de apps y servicios MCP que nanobot puede usar desde el chat.",cliLabel:"CLI",mcpLabel:"MCP",filterAll:"Todo",filterCli:"Apps CLI",filterMcp:"Servicios MCP",enabledSummary:"{{count}} activados",caption:"{{cli}} CLI · {{mcp}} MCP",searchPlaceholder:"Buscar apps",featured:"Destacadas",loading:"Cargando apps...",empty:"Ninguna app coincide con este filtro."},automations:{filters:{all:"Todas",active:"Activas",paused:"Pausadas",failed:"Requieren atención",system:"Sistema"},sort:{next:"Próxima ejecución",last:"Última ejecución",updated:"Actualizada",name:"Nombre"},search:"Buscar tarea, mensaje, chat vinculado u horario",queue:"Cola",loading:"Cargando automatizaciones...",noMatches:"No hay automatizaciones que coincidan con esta vista.",empty:"Aún no hay automatizaciones.",emptyHint:"Créala desde donde debe ejecutarse para que nanobot conserve el contexto correcto.",oneShot:"Una vez",systemTask:"Automatización administrada por el sistema",labels:{schedule:"Programación",next:"Siguiente",origin:"Chat vinculado",created:"Creada",updated:"Actualizada"},runNow:"Ejecutar ahora",pause:"Pausar",resume:"Reanudar",edit:"Editar",delete:"Eliminar",protected:"Protegida",editTitle:"Editar automatización",save:"Guardar",deleteTitle:"Eliminar automatización",deleteDescription:"Esto elimina {{name}} del almacén cron. Los mensajes de chat anteriores permanecen en la sesión.",cancel:"Cancelar",status:{system:"Sistema",running:"Ejecutándose ahora",paused:"Pausada",failed:"Fallida",completed:"Completada",noSchedule:"Sin programación",active:"Activa"},origin:{system:"Sistema",unknown:"Sin chat vinculado"},channels:{api:"API",cli:"CLI",dingtalk:"DingTalk",discord:"Discord",email:"Email",feishu:"Feishu",matrix:"Matrix",msteams:"Microsoft Teams",qq:"QQ",slack:"Slack",telegram:"Telegram",wechat:"WeChat",wecom:"WeCom",weixin:"WeChat",whatsapp:"WhatsApp"},schedule:{at:"A las {{time}}",every:"Cada {{duration}}",cron:"Cron {{expr}}",cronWithTz:"Cron {{expr}} · {{tz}}",withTz:"{{summary}} · {{tz}}",dailyAt:"Diaria a las {{time}}",weekdaysAt:"Días laborables a las {{time}}",hourlyAt:"Cada hora en :{{minute}}",hourlyWindow:"Cada hora {{start}}-{{end}} en :{{minute}}",custom:"Programación personalizada"},next:{paused:"Pausada",pending:"Ejecutándose ahora",none:"Sin próxima ejecución"},message:{showMore:"Mostrar mensaje completo",showLess:"Mostrar menos"},fields:{name:"Nombre",message:"Mensaje",scheduleType:"Tipo de programación",every:"Cada",unit:"Unidad",cronExpression:"Expresión cron",timezone:"Zona horaria",runAt:"Ejecutar a las"},scheduleTypes:{every:"Intervalo",cron:"Cron",at:"Una vez"},everyUnits:{second:"Segundos",minute:"Minutos",hour:"Horas",day:"Días"},validation:{nameRequired:"El nombre es obligatorio.",messageRequired:"El mensaje es obligatorio.",intervalRequired:"El intervalo debe ser un número positivo.",cronRequired:"La expresión cron es obligatoria.",timeRequired:"La hora de ejecución es obligatoria.",futureRequired:"La hora de ejecución debe estar en el futuro."}},oauth:{authentication:"Autenticación OAuth",signIn:"Iniciar sesión",signingIn:"Iniciando sesión...",signInAgain:"Iniciar sesión de nuevo",signOut:"Cerrar sesión",signedInAs:"Sesión iniciada como {{account}}",signInHelp:"Inicia sesión desde este dispositivo; no se guarda API key en config.",signInRequired:"Inicio de sesión requerido",signInBeforeSaving:"Inicia sesión antes de guardar este proveedor OAuth como proveedor activo.",signedIn:"Sesión iniciada",notSignedIn:"Sin sesión"},skills:{description:"Revisa las habilidades de instrucciones que este agente puede cargar durante una conversación.",caption:"{{available}} disponibles · {{total}} en total",featured:"Habilidades del agente",empty:"No hay habilidades disponibles.",sourceWorkspace:"Personalizada",sourceBuiltin:"Integradas",statusAvailable:"Disponible",statusUnavailable:"No disponible",unavailableReason:"Falta: {{reason}}",openDetails:"Abrir detalles de {{name}}",loadingDetail:"Cargando detalles de la habilidad...",loadFailed:"No se pudieron cargar los detalles.",descriptionTitle:"Descripción",source:"Origen",status:"Estado",requirements:"Requisitos",noRequirements:"Sin requisitos explícitos.",commands:"Comandos",environment:"Variables de entorno",missingCommands:"Falta CLI",missingEnvironment:"Falta ENV",unavailableReasonLabel:"Motivo de indisponibilidad",rawInstructions:"SKILL.md original",rawInstructionsEmpty:"No hay instrucciones originales.",detailDescription:"Detalles de {{name}}."},voice:{selectProvider:"Seleccionar proveedor",configureProvider:"Configurar proveedor",languageAuto:"Auto"}},HR={fallbackTitle:"Chat {{id}}",forkTitle:"Bifurcación: {{title}}",loading:"Cargando…",noSessions:"Todavía no hay sesiones.",showMore:"Mostrar {{count}} más",collapsed:"{{count}} chats ocultos",showLess:"Mostrar menos",actions:"Acciones del chat {{title}}",newInProject:"Iniciar un chat nuevo en {{project}}",activity:{running:"Agent running",complete:"Agent finished",updated:"New activity"},pin:"Pin",unpin:"Unpin",rename:"Rename",renameTitle:"Rename chat",renameDescription:"Choose a local sidebar name for this chat.",renamePlaceholder:"Chat name",renameProjectTitle:"Rename project",renameProjectDescription:"Choose a local sidebar name for this project.",renameProjectPlaceholder:"Project name",renameSave:"Save",archive:"Archive",unarchive:"Unarchive",showArchived:"Show archived",hideArchived:"Hide archived",delete:"Eliminar",newChat:"Nuevo chat",groups:{pinned:"Pinned",all:"Chats",projects:"Projects",today:"Today",yesterday:"Yesterday",earlier:"Earlier",archived:"Archived"}},WR={title:"¿Eliminar este chat?",description:"Esta acción no se puede deshacer.",cancel:"Cancelar",confirm:"Eliminar",automationsDescription:"Este chat tiene automatizaciones programadas. Al eliminarlo también se eliminarán.",moreAutomations:"+ {{count}} más",confirmWithAutomations:"Eliminar",schedule:{at:"{{time}}",every:"Cada {{duration}}",cron:"Cron {{expr}}",cronWithTz:"Cron {{expr}} · {{tz}}",unknown:"Programación personalizada"},next:{label:"Siguiente: {{time}}",disabled:"Pausada",none:"Sin próxima ejecución"}},qR={idle:"Inactivo",connecting:"Conectando…",open:"Conectado",reconnecting:"Reconectando…",closed:"Desconectado",error:"Error de conexión"},KR={loadingConversation:"Cargando conversación…",empty:{greetings:{workOn:"¿En qué trabajamos juntos?",start:"¿Por dónde empezamos?",build:"¿Qué construimos hoy?",tackle:"¿Qué resolvemos juntos?"},quickActions:{plan:{title:"Crear un plan de proyecto",prompt:"Crea un plan de proyecto conciso para lo que debería construir después."},analyze:{title:"Analizar estos datos",prompt:"Ayúdame a analizar estos datos y destaca los patrones más importantes."},brainstorm:{title:"Lluvia de ideas",prompt:"Propón algunas ideas prácticas y sus compensaciones para este problema."},code:{title:"Escribir código",prompt:"Ayúdame a escribir el código para esta tarea, empezando por el cambio útil más pequeño."},summarize:{title:"Resumir este documento",prompt:"Resume este documento y enumera las conclusiones clave."},more:{title:"Más",prompt:"Muéstrame algunas formas útiles en las que puedes ayudar en este workspace."}},imageQuickActions:{icon:{title:"Diseñar un icono de app",prompt:"Genera un icono de app 1:1 limpio para nanobot: robot amigable, estilo vectorial simple, paleta suave azul y blanca, sin texto."},sticker:{title:"Crear un sticker",prompt:"Genera una imagen estilo sticker de un pequeño asistente robot, con fondo de apariencia transparente, expresivo y divertido."},poster:{title:"Crear un póster",prompt:"Genera un concepto de póster pulido para un asistente personal de IA, composición moderna, jerarquía visual fuerte, apto para una landing page."},product:{title:"Mockup de producto",prompt:"Genera una imagen limpia de mockup de producto para una app web de IA conversacional, interfaz mínima, iluminación premium, marco de dispositivo realista."},portrait:{title:"Retrato estilizado",prompt:"Genera un retrato estilizado de un compañero de IA amigable, luz suave, detallado pero cercano, estilo de ilustración moderna."},edit:{title:"Editar una imagen",prompt:"Ayúdame a editar una imagen. Primero pídeme que suba o indique la imagen, y luego genera el resultado editado."}}},header:{toggleSidebar:"Mostrar u ocultar la barra lateral",newChat:"Iniciar un chat nuevo",toggleTheme:"Cambiar tema desde el encabezado",settings:"Abrir configuración",sessionInfo:"Detalles de la sesión"},sessionInfo:{title:"Sesión",untitled:"Chat sin título",automations:"Automatizaciones",count:"{{count}}",loading:"Cargando automatizaciones...",loadFailed:"No se pudieron cargar las automatizaciones.",empty:"Esta sesión aún no tiene automatizaciones.",disabled:"Desactivado",schedule:{at:"A las {{time}}",every:"Cada {{duration}}",cron:"Cron {{expr}}",cronWithTz:"Cron {{expr}} · {{tz}}",unknown:"Programación personalizada"},next:{label:"Siguiente {{time}}",pending:"Se ejecutará pronto",disabled:"En pausa",none:"Sin próxima ejecución"}},composer:{placeholderThread:"Escribe tu mensaje…",placeholderHero:"¿Qué tienes en mente?",placeholderOpening:"Abriendo un nuevo chat…",placeholderStreaming:"El modelo está respondiendo…",inputAria:"Entrada de mensaje",sendHint:"Enter para enviar · Shift+Enter para nueva línea",runRuntimeTitle:"En ejecución · {{elapsed}}",goalStateStrip:"Objetivo · {{label}}",goalStateFallback:"Objetivo",goalStateExpandAria:"Ver objetivo completo",goalStateSheetTitle:"Objetivo",goalStateCloseAria:"Cerrar objetivo",send:"Enviar mensaje",stop:"Detener respuesta",modelNotConfigured:"Modelo no configurado",configureModel:"Configurar modelo",queued:{label:"Guía en cola",guide:"Guiar",delete:"Eliminar guía",edit:"Editar guía",drag:"Arrastrar para reordenar"},attachImage:"Adjuntar imagen",imageMode:{label:"Generar imagen",toggle:"Activar o desactivar modo de generación de imágenes",placeholder:"Describe o edita una imagen…",aspectAria:"Relación de aspecto de imagen",aspectLabel:"Formato de imagen",aspect:{auto:"Auto","1_1":"Cuadrado 1:1","3_4":"Vertical 3:4","9_16":"Historia 9:16","4_3":"Horizontal 4:3","16_9":"Panorámico 16:9"}},tools:{search:"Buscar",reason:"Razonar",deepResearch:"Investigación profunda",voice:"Entrada de voz"},voice:{hint:"Haz clic para dictar o mantén",stop:"Detener grabación",transcribing:"Transcribiendo...",recordingStatus:"Grabando {{time}}"},voiceErrors:{unsupported:"Este navegador no admite entrada de voz.",permission:"Se requiere permiso de micrófono.",notConfigured:"Configura primero un proveedor de transcripción.",tooLong:"La grabación es demasiado larga.",tooShort:"Mantén pulsado un poco más para grabar voz.",noInput:"No se detectó entrada del micrófono.",failed:"No se pudo transcribir el audio."},slash:{ariaLabel:"Comandos slash",label:"comandos",navigateHint:"↑↓ Navegar",selectHint:"Enter/Tab Insertar",closeHint:"Esc Cerrar",commands:{new:{title:"Nuevo chat",description:"Detiene la tarea actual e inicia una conversación nueva."},stop:{title:"Detener tarea actual",description:"Cancela el turno activo del agent en este chat."},restart:{title:"Reiniciar nanobot",description:"Reinicia el proceso del bot en el mismo lugar."},status:{title:"Mostrar estado",description:"Muestra el estado del runtime, provider y channels."},model:{title:"Modelo",description:"Muestra o cambia el preset de modelo activo."},history:{title:"Mostrar historial",description:"Imprime los últimos N mensajes persistidos de la conversación."},dream:{title:"Ejecutar Dream",description:"Activa manualmente la consolidación de memoria."},dream_log:{title:"Mostrar registro de Dream",description:"Muestra qué cambió la última consolidación Dream."},dream_restore:{title:"Restaurar memoria",description:"Revierte la memoria a una instantánea Dream anterior."},goal:{title:"Objetivo a largo plazo",description:"Indica al agente que trate esto como un objetivo sostenido en varios pasos."},help:{title:"Mostrar ayuda",description:"Lista los comandos slash disponibles."},pairing:{title:"Emparejamiento",description:"Gestiona solicitudes de emparejamiento."}},badges:{current:"Actual",recent:"Reciente"},details:{goalActive:"El objetivo está en curso",goalReady:"Iniciar un objetivo sostenido",history:"Mostrar mensajes recientes",stopRunning:"En ejecución"}},encoding:"Procesando…",remove:"Quitar adjunto",normalizedSizeHint:"{{orig}} → {{current}} (auto)",imageRejected:{unsupported_type:"Tipo de archivo no compatible",too_many_images:"Máximo {{max}} imágenes por mensaje",magic_mismatch:"El archivo no parece una imagen real",decode_failed:"No se pudo decodificar esta imagen",too_large:"Imagen demasiado grande — prueba una más pequeña",io:"No se pudo leer este archivo"},mentions:{ariaLabel:"Apps",label:"Apps",cliGroup:"Apps CLI",mcpGroup:"Servicios MCP",cliBadge:"CLI",mcpBadge:"MCP",cliDescription:"Usar @{{name}} como app CLI local",mcpDescription:"Usar @{{name}} como servidor MCP"},workspace:{accessAria:"Workspace access mode",projectAria:"Elegir proyecto",projectPlaceholder:"Seleccionar proyecto",default:"Default Permission",full:"Full Access"}},scrollToBottom:"Desplazarse al final",loadEarlier:"Cargar mensajes anteriores",forkedFromHistory:"Bifurcado desde el historial",promptNavigator:{open:"Abrir navegador de prompts",title:"Prompts",search:"Buscar prompts",noResults:"No hay prompts coincidentes.",jumpTo:"Ir al prompt: {{label}}"}},VR={streaming:"transmitiendo",assistantTyping:"El asistente está escribiendo",toolSingle:"Usando una herramienta",toolMany:"Se usaron {{count}} herramientas",toolSummary:"{{count}} herramienta",toolSummaryMany:"{{count}} herramientas",reasoningTools:"Razonamiento · {{count}} herramientas",reasoningToolsSingular:"Razonamiento · 1 herramienta",reasoning:"Razonamiento",reasoningStreaming:"Pensando…",reasoningSummary:"Razonamiento",agentActivitySummary:"{{reasoning}} pasos · {{tools}} llamadas a herramientas",agentActivityToolsOnly:"{{tools}} llamadas a herramientas",agentActivityLiveSummary:"En curso… · {{reasoning}} pasos · {{tools}} llamadas a herramientas",agentActivityLiveToolsOnly:"En curso… · {{tools}} llamadas a herramientas",imageAttachment:"Imagen adjunta",forkFromHere:"Bifurcar",copyReply:"Copiar",copiedReply:"Copiado",turnLatencyTitle:"Tiempo de respuesta (extremo a extremo)",activityThinkingFor:"Pensando durante {{duration}}",activityThought:"Pensamiento completado",activityThoughtFor:"Pensó durante {{duration}}",activityWorkingFor:"Trabajando durante {{duration}}",activityWorked:"Trabajo completado",activityWorkedFor:"Trabajó durante {{duration}}",cliActivityRunningOne:"Usando @{{name}}",cliActivityRanOne:"Usó @{{name}}",cliActivityFailedOne:"Falló @{{name}}",cliActivityRunningMany:"Usando {{count}} apps CLI",cliActivityRanMany:"Usó {{count}} apps CLI",cliActivityFailedMany:"Fallaron {{count}} apps CLI",cliRunRunning:"Usando",cliRunRan:"Usado",cliRunFailed:"Falló",automationSourceFallback:"Automatización",automationTriggered:"Activada automáticamente"},GR={title:"Vista previa de imagen",open:"Ver imagen",prev:"Imagen anterior",next:"Imagen siguiente",close:"Cerrar vista previa"},YR={aria:"Vista previa de archivo",close:"Cerrar vista previa de archivo",loading:"Cargando vista previa...",failed:"No se pudo previsualizar este archivo.",routeMissing:"La vista previa necesita el gateway más reciente. Reinicia nanobot gateway e inténtalo de nuevo.",resize:"Cambiar el tamaño de la vista previa",truncated:"La vista previa está truncada porque el archivo es grande."},QR={fallbackLanguage:"código",copyAria:"Copiar código",copy:"Copiar",copied:"Copiado"},XR={dismiss:"Cerrar"},JR={messageTooBig:{title:"Mensaje demasiado grande",body:"El servidor rechazó tu último mensaje por superar el tamaño permitido. Quita algunas imágenes o usa archivos más pequeños y vuelve a enviarlo."},workspaceScopeRejected:{title:"Workspace was not changed",body:"Nanobot kept the previous workspace because the requested project or access mode was rejected by the gateway."}},ZR={dialog:{defaultProject:"Default workspace",manual:"Pegar ruta",manualPlaceholder:"/Users/name/project",usePath:"Use Path",absolutePathRequired:"Enter an absolute folder path on this machine."}},eM={app:$R,sidebar:UR,settings:BR,chat:HR,deleteConfirm:WR,connection:qR,thread:KR,message:VR,lightbox:GR,filePreview:YR,code:QR,common:XR,errors:JR,workspace:ZR},tM={brand:"nanobot",loading:{connecting:"Đang kết nối tới nanobot…",boot:"Đang tải nanobot…"},error:{title:"Không thể kết nối tới nanobot",gatewayHint:"Hãy chắc chắn gateway đang chạy (`nanobot gateway`) và trang này được mở trên cùng máy."},auth:{title:"Cần xác thực",hint:"Nhập secret được cấu hình là tokenIssueSecret trong cấu hình gateway.",placeholder:"Mật khẩu",submit:"Kết nối",invalid:"Mật khẩu không hợp lệ. Hãy thử lại."},account:{section:"Tài khoản",logoutHint:"Ngắt kết nối trình duyệt này khỏi gateway.",logout:"Đăng xuất"},system:{section:"Hệ thống",restartHint:"Khởi động lại nanobot để áp dụng thay đổi runtime.",restart:"Khởi động lại nanobot",restarting:"Đang khởi động lại...",restartEngine:"Khởi động lại engine",restartingEngine:"Đang khởi động lại engine..."},restart:{completed:"Khởi động lại hoàn tất sau {{seconds}} giây."},documentTitle:{base:"nanobot",chat:"{{title}} · nanobot"},meta:{description:"Giao diện web nanobot — trò chuyện với workspace nanobot của bạn."}},nM={navigation:"Điều hướng thanh bên",collapse:"Thu gọn thanh bên",newChat:"Cuộc trò chuyện mới",searchAria:"Tìm kiếm",searchPlaceholder:"Tìm kiếm",searchResults:"Kết quả",noSearchResults:"Không có cuộc trò chuyện phù hợp.",recent:"Gần đây",settings:"Cài đặt",language:{label:"Ngôn ngữ",ariaLabel:"Đổi ngôn ngữ"},apps:"Ứng dụng",automations:"Tự động hóa",skills:{title:"Kỹ năng"}},rM={backToChat:"Quay lại chat",sidebar:{title:"Cài đặt",ariaLabel:"Mục cài đặt"},nav:{general:"Chung",byok:"BYOK",overview:"Tổng quan",appearance:"Giao diện",models:"Mô hình",providers:"Nhà cung cấp",image:"Hình ảnh",voice:"Giọng nói",browser:"Trang web",runtime:"Hệ thống",advanced:"Bảo mật",cliApps:"Ứng dụng CLI",mcp:"MCP",apps:"Ứng dụng",automations:"Tự động hóa",skills:"Kỹ năng"},sections:{interface:"Giao diện",ai:"AI",system:"Hệ thống",about:"Giới thiệu",status:"Trạng thái",localPreferences:"Tùy chọn cục bộ",presets:"Preset",imageGeneration:"Tạo hình ảnh",imageDefaults:"Mặc định",webSearch:"Tìm kiếm web",webBehavior:"Hành vi",identity:"Danh tính",webuiSafety:"An toàn WebUI",capabilities:"Khả năng",cliApps:"Ứng dụng CLI",mcp:"Dịch vụ MCP",apps:"Ứng dụng",nativeHost:"Host gốc",hostSafety:"An toàn ứng dụng",voiceInput:"Nhap giong noi"},rows:{theme:"Chủ đề",language:"Ngôn ngữ",provider:"Nhà cung cấp",model:"Mô hình",restart:"Khởi động lại nanobot",configPath:"Đường dẫn cấu hình",activePreset:"Preset đang dùng",gateway:"Cổng",restartState:"Trạng thái khởi động lại",pendingChanges:"Thay đổi chờ áp dụng",selectedPreset:"Preset đã chọn",presetModel:"Mô hình preset",density:"Mật độ",activityMode:"Chi tiết hoạt động",codeWrap:"Xuống dòng mã",maxResults:"Kết quả tối đa",timeout:"Thời gian chờ",jinaReader:"Trình đọc Jina",imageGeneration:"Tạo hình ảnh",imageProvider:"Nhà cung cấp hình ảnh",imageProviderStatus:"Trạng thái nhà cung cấp",imageProviderBase:"Địa chỉ nhà cung cấp",imageModel:"Mô hình hình ảnh",defaultAspectRatio:"Tỷ lệ mặc định",defaultImageSize:"Kích thước mặc định",maxImagesPerTurn:"Ảnh tối đa mỗi lượt",imageSaveDir:"Thư mục lưu",botName:"Tên bot",botIcon:"Biểu tượng bot",timezone:"Múi giờ",workspacePath:"Workspace mặc định",localServiceAccess:"Dịch vụ cục bộ",webuiDefaultAccess:"Quyền mặc định",currentModel:"Cấu hình hiện tại",brandLogos:"Logo thương hiệu",cliAppsCatalog:"Danh mục",cliAppsFilter:"Bộ lọc",engine:"Bộ máy",logs:"Nhật ký",diagnostics:"Chẩn đoán",contextWindow:"Cửa sổ ngữ cảnh",transcription:"Phien am",transcriptionProvider:"Nha cung cap",transcriptionProviderStatus:"Trang thai nha cung cap",transcriptionModel:"Mo hinh",transcriptionLanguage:"Ngon ngu",voiceLimits:"Gioi han"},help:{theme:"Chuyển giữa giao diện sáng và tối.",language:"Chọn ngôn ngữ dùng trong WebUI.",provider:"Selecciona el proveedor para nuevas solicitudes de modelo.",model:"Define el nombre de modelo predeterminado de nanobot.",configPath:"Archivo de configuración que usa actualmente el gateway.",selectedPreset:"Los preajustes con nombre son de solo lectura aquí; edítalos en config.json.",presetModel:"Chuyển sang Default để chỉnh sửa mô hình và nhà cung cấp từ WebUI.",density:"Chỉ lưu trong trình duyệt này.",activityMode:"Chọn mức chi tiết hoạt động agent hiển thị mặc định.",codeWrap:"Giữ các dòng mã dài dễ đọc trên màn hình nhỏ.",maxResults:"Resultados devueltos por cada llamada web_search.",timeout:"Segundos antes de que una solicitud de búsqueda expire.",jinaReader:"Usa Jina Reader para web_fetch cuando esté disponible.",imageGeneration:"Expone generate_image en chats cuando hay un proveedor de imagen configurado.",imageProvider:"Elige el proveedor registrado usado por generate_image.",imageProviderStatus:"La generación de imágenes reutiliza credenciales de Proveedores.",imageModel:"Nombre del modelo enviado al proveedor de imágenes seleccionado.",defaultAspectRatio:"Se usa cuando el prompt no elige una proporción.",defaultImageSize:"Gợi ý kích thước gửi tới nhà cung cấp hỗ trợ.",maxImagesPerTurn:"Giới hạn trên cho một yêu cầu generate_image.",botName:"Se muestra donde nanobot usa un nombre visible.",botIcon:"Emoji o texto corto junto al nombre del bot.",timezone:"Se usa para horarios y respuestas con conciencia temporal.",localServiceAccess:"Cho phép lệnh shell Full Access truy cập dịch vụ localhost.",webuiDefaultAccess:"Dùng cho chat web không có quyền riêng theo dự án.",securityManagedControls:"Las capturas web siempre protegen servicios locales, privados y metadata. La seguridad de canales core se gestiona en config.json.",currentModel:"Dùng cho các phản hồi mới.",selectedModelProvider:"Definido por el modelo seleccionado.",selectedModelValue:"Definido por el modelo seleccionado.",brandLogos:"Hiển thị logo nhà cung cấp bên thứ ba và CLI trong Cài đặt.",cliAppsCatalog:"Instala solo adaptadores CLI de apps que nanobot puede ejecutar localmente; las apps nativas no se modifican.",cliAppsFilter:"Busca por app, categoría o capacidad.",logs:"Abre la carpeta de registros del motor nativo.",diagnostics:"Exporta un pequeño informe de runtime para soporte.",localServiceAccessNative:"Permite que comandos shell con Full Access alcancen servicios en este Mac.",webuiDefaultAccessNative:"Usado por chats nativos sin permiso específico de proyecto.",contextWindow:"Chọn ngân sách ngữ cảnh mặc định cho cấu hình mô hình này.",transcription:"Phien am dau vao micro truoc khi gui. Tin nhan giong noi tu kenh chat dung cung cai dat.",transcriptionProvider:"Dung thong tin xac thuc cua nha cung cap tu Providers.",transcriptionProviderStatus:"API key nam trong providers, khong nam trong cai dat transcription.",transcriptionModel:"Giu mac dinh da resolve tru khi nha cung cap can id model tuy chinh.",transcriptionLanguage:"Goi y ISO-639 tuy chon, nhu en, zh, ja hoac ko."},values:{light:"Sáng",dark:"Tối",notAvailable:"Không khả dụng",enabled:"Đã bật",disabled:"Đã tắt",restartPending:"Chờ khởi động lại",ready:"Sẵn sàng",privateEngine:"Bộ máy riêng",unixSocket:"Socket Unix",defaultWorkspace:"Workspace mặc định",comfortable:"Thoải mái",compact:"Gọn",auto:"Tự động",expanded:"Mở rộng",on:"Bật",off:"Tắt",defaultPermission:"Quyền mặc định",fullAccess:"Toàn quyền",configured:"Đã cấu hình",notConfigured:"Chưa cấu hình",pending:"Đang chờ",restartingEngine:"Đang khởi động lại"},status:{loading:"Đang tải cài đặt...",loadError:"Không thể tải cài đặt",unsaved:"Có thay đổi chưa lưu.",upToDate:"Đã cập nhật.",savedRestart:"Guardado. Reinicia nanobot para aplicar.",restartAfterSaving:"Guarda los cambios y reinicia cuando puedas.",savedRestartApply:"Guardado. Reinicia cuando puedas.",imageProviderRestart:"Cambios del proveedor de imagen guardados. Reinicia cuando puedas.",hostRestartAfterSaving:"Al guardar, nanobot reiniciará su motor.",hostRestartPending:"Guardado. El motor se reiniciará cuando esté listo.",hostApiUnavailable:"Las acciones del host solo están disponibles en la app nativa.",logsOpened:"Carpeta de registros abierta.",logsOpenFailed:"No se pudo abrir la carpeta de registros.",diagnosticsExported:"Diagnóstico exportado a {{path}}.",diagnosticsExportFailed:"No se pudo exportar el diagnóstico."},actions:{save:"Lưu",saving:"Đang lưu",edit:"Sửa",cancel:"Hủy",open:"Mở",export:"Xuất",opening:"Đang mở...",exporting:"Đang xuất..."},byok:{description:"Dùng key provider của riêng bạn. Nanobot đọc các giá trị này từ config hiện tại, và chỉ provider đã cấu hình mới có thể chọn trong Chung.",configured:"Đã cấu hình",notConfigured:"Chưa cấu hình",configuredSection:"Đã cấu hình",notConfiguredSection:"Chưa cấu hình",showMore:"Hiển thị thêm {{count}}",showLess:"Thu gọn",apiKey:"API key",apiBase:"API base",apiKeyPlaceholder:"Nhập API key",apiKeyConfiguredPlaceholder:"Để trống để giữ key hiện tại",configuredKeyHint:"Key đã cấu hình",apiBasePlaceholder:"Dùng mặc định của provider",apiKeyRequired:"Cần API key để cấu hình provider này.",showApiKey:"Hiển thị API key",hideApiKey:"Ẩn API key",noConfiguredProviders:"Chưa có provider đã cấu hình",configureFirst:"Hãy cấu hình provider trong BYOK trước.",openByok:"Mở BYOK",tabs:{ariaLabel:"Loại thông tin xác thực BYOK",llm:"LLM",webSearch:"Tìm kiếm web"},webSearch:{provider:"Nhà cung cấp tìm kiếm",providerHelp:"Chọn backend mà công cụ web search sẽ dùng.",selectProvider:"Chọn provider",credentials:"Thông tin xác thực",noCredentialRequired:"Không cần key",noCredentialHelp:"DuckDuckGo hoạt động mà không cần lưu API key.",apiKeyHelp:"Được lưu trong config và chỉ hiện dạng che sau khi lưu.",baseUrl:"Base URL",baseUrlHelp:"SearXNG cần URL instance của bạn.",baseUrlPlaceholder:"https://search.example.com",apiKeyRequired:"Provider tìm kiếm này cần API key.",baseUrlRequired:"SearXNG cần Base URL.",missingCredential:"Thêm thông tin bắt buộc trước khi lưu.",saveHint:"Thay đổi áp dụng cho các yêu cầu web search mới."}},overview:{model:"Mô hình hiện tại",providers:"Nhà cung cấp",configuredCount:"{{count}} đã cấu hình",totalProviders:"{{count}} khả dụng",webSearch:"Tìm kiếm web",imageGeneration:"Tạo hình ảnh",voiceInput:"Nhập bằng giọng nói",workspace:"Không gian làm việc"},usage:{title:"Hoạt động token",shortTitle:"Token Usage",subtitle:"Mức dùng do nhà cung cấp báo cáo trong 12 tháng gần nhất.",empty:"Hoạt động token sẽ xuất hiện sau các phản hồi mô hình mới.",totalTokens:"Tổng token",peakTokens:"Đỉnh token",thirtyDayTokens:"Token 30 ngày",currentStreak:"Chuỗi hiện tại",longestStreak:"Chuỗi dài nhất",daysValue:"{{count}} ngày",last30:"30 ngày",activeDays:"Ngày hoạt động",requests:"Yêu cầu",estimated:"ước tính",includesEstimates:"bao gồm ước tính",cellTitle:"{{date}}: {{tokens}} tokens, {{requests}} yêu cầu",sources:{user:"Trò chuyện",api:"API",cron:"Tự động hóa",dream:"Bộ nhớ",system:"Hệ thống"}},providers:{searchPlaceholder:"Tìm nhà cung cấp",noMatches:"Không có nhà cung cấp phù hợp.",saveProvider:"Lưu nhà cung cấp"},image:{selectProvider:"Chọn nhà cung cấp",selectAspect:"Chọn tỷ lệ",selectSize:"Chọn kích thước",configureProvider:"Cấu hình nhà cung cấp",missingCredential:"Configura este proveedor antes de activar la generación de imágenes."},models:{selectModel:"Chọn mô hình",addConfiguration:"Thêm cấu hình",newConfiguration:"Cấu hình mô hình mới",newConfigurationHelp:"Lưu nhà cung cấp và mô hình thành một lựa chọn nhanh.",configurationName:"Tên cấu hình",configurationNameHelp:"Đổi tên cấu hình mô hình đã lưu này.",configurationNamePlaceholder:"Viết nhanh",searchModels:"Tìm kiếm hoặc nhập ID mô hình",useCustomModel:"Dùng",loadingModels:"Đang tải mô hình...",searchCatalog:"Tìm trong danh mục nhà cung cấp để chọn mô hình.",modelsAvailable:"khả dụng",noModelResults:"Không có mô hình phù hợp.",loadFailed:"Không tải được danh sách mô hình.",unsupportedModelList:"Nhập ID mô hình thủ công.",providerNotConfigured:"Hãy cấu hình nhà cung cấp này trước khi tải mô hình.",autoProviderCustomOnly:"Chế độ nhà cung cấp tự động dùng ID mô hình tùy chỉnh."},timezone:{select:"Chọn múi giờ",search:"Tìm múi giờ",empty:"Không có múi giờ phù hợp."},cliApps:{allCategories:"Tất cả danh mục",availableCount:"{{count}} ứng dụng",installedCount:"Đã cài {{count}}",summary:"Đã cài {{installed}} / {{total}} CLI",filterAll:"Tất cả",filterInstalled:"CLI đã cài",filterNotInstalled:"Chưa cài",searchPlaceholder:"Tìm CLI",statusInstalled:"Đã cài",statusAvailable:"Có sẵn",statusMissing:"Thiếu phụ thuộc",statusUnsupported:"Không hỗ trợ",statusNotInstalled:"Chưa cài",unsupported:"Không hỗ trợ",loading:"Đang tải ứng dụng CLI...",empty:"Không có ứng dụng CLI nào khớp bộ lọc này.",readyTitle:"@{{name}} đã sẵn sàng",readyStatus:"Sẵn sàng",readyPrompt:"Dùng @{{name}} để xem CLI này làm được gì.",readyTry:"Thử @{{name}}",readyCopied:"Đã sao chép",openChat:"Mở chat",requires:"Yêu cầu",test:"Kiểm tra CLI",update:"Cập nhật CLI",uninstall:"Gỡ CLI",install:"Cài CLI",unavailable:"Không khả dụng",noDescription:"Không có mô tả."},about:{version:"Phiên bản",checking:"Đang kiểm tra...",checkForUpdates:"Kiểm tra bản cập nhật",upToDate:"Bạn đang dùng phiên bản mới nhất",updateAvailable:"Có bản cập nhật v{{version}}"},mcp:{allCategories:"Tất cả danh mục",summary:"Đã bật {{installed}} / {{total}} preset",filterAll:"Tất cả",filterInstalled:"Đã bật",filterNotInstalled:"Chưa bật",searchPlaceholder:"Tìm preset MCP",moreOptions:"Tùy chọn MCP khác",moreOptionsSubtitle:"Thêm máy chủ tùy chỉnh hoặc nhập mcp.json.",customTitle:"MCP tùy chỉnh",customSubtitle:"Thêm bất kỳ máy chủ MCP stdio, HTTP hoặc SSE nào.",customAction:"Tùy chỉnh",importAction:"Nhập",serverName:"Tên máy chủ",serverUrl:"URL",transport:"Giao thức truyền",command:"Lệnh",args:"Args JSON",headers:"Headers JSON",env:"Env JSON",timeout:"Thời gian chờ công cụ",advancedOptions:"Tùy chọn nâng cao",hideAdvanced:"Ẩn nâng cao",saveCustom:"Lưu MCP",configImport:"Nhập mcp.json",importConfig:"Nhập",restartRequired:"Khởi động lại nanobot để kết nối các công cụ MCP đã cập nhật.",toolsFound:"{{count}} công cụ",loading:"Đang tải preset MCP...",empty:"Không có preset MCP nào khớp bộ lọc này.",openDocs:"Mở tài liệu",test:"Kiểm tra",remove:"Xóa",enable:"Bật",enabled:"Đã bật",setup:"Kết nối",configure:"Kết nối",connectTitle:"Kết nối {{name}}",connectHint:"Thêm khóa từ phần cài đặt tài khoản của bạn.",saveAndEnable:"Lưu và bật",updateSetup:"Cập nhật thiết lập",configured:"đã cấu hình",keepExisting:"Để trống để giữ giá trị hiện tại",statusConfigured:"Đã cấu hình",statusMissingCredentials:"Cần khóa",statusMissingDependency:"Cần phụ thuộc",statusComingSoon:"Sắp ra mắt",statusNotInstalled:"Chưa bật",toolScope:"Công cụ",allTools:"Tất cả",noTools:"Không có",testForTools:"Chạy Kiểm tra để xem và chọn từng công cụ."},legal:{thirdPartyBrands:"Tên sản phẩm, logo và thương hiệu thuộc về chủ sở hữu tương ứng. Việc sử dụng chỉ nhằm nhận diện và không ngụ ý được xác nhận."},apps:{description:"Thêm CLI ứng dụng và dịch vụ MCP mà nanobot có thể dùng trong chat.",cliLabel:"CLI",mcpLabel:"MCP",filterAll:"Tất cả",filterCli:"Ứng dụng CLI",filterMcp:"Dịch vụ MCP",enabledSummary:"{{count}} đã bật",caption:"{{cli}} CLI · {{mcp}} MCP",searchPlaceholder:"Tìm ứng dụng",featured:"Nổi bật",loading:"Đang tải ứng dụng...",empty:"Không có ứng dụng phù hợp."},automations:{filters:{all:"Tất cả",active:"Đang chạy",paused:"Đã tạm dừng",failed:"Cần xử lý",system:"Hệ thống"},sort:{next:"Lần chạy tiếp theo",last:"Lần chạy trước",updated:"Đã cập nhật",name:"Tên"},search:"Tìm tác vụ, tin nhắn, cuộc trò chuyện liên kết hoặc lịch",queue:"Hàng đợi",loading:"Đang tải tự động hóa...",noMatches:"Không có tự động hóa phù hợp với chế độ xem này.",empty:"Chưa có tự động hóa.",emptyHint:"Tạo từ nơi tác vụ sẽ chạy để nanobot giữ đúng ngữ cảnh.",oneShot:"Một lần",systemTask:"Tự động hóa do hệ thống quản lý",labels:{schedule:"Lịch",next:"Tiếp theo",origin:"Cuộc trò chuyện liên kết",created:"Đã tạo",updated:"Đã cập nhật"},runNow:"Chạy ngay",pause:"Tạm dừng",resume:"Tiếp tục",edit:"Sửa",delete:"Xóa",protected:"Được bảo vệ",editTitle:"Sửa tự động hóa",save:"Lưu",deleteTitle:"Xóa tự động hóa",deleteDescription:"Thao tác này xóa {{name}} khỏi kho cron. Tin nhắn chat trước đó vẫn ở trong phiên.",cancel:"Hủy",status:{system:"Hệ thống",running:"Đang chạy",paused:"Đã tạm dừng",failed:"Thất bại",completed:"Hoàn tất",noSchedule:"Không có lịch",active:"Đang chạy"},origin:{system:"Hệ thống",unknown:"Chưa liên kết cuộc trò chuyện"},channels:{api:"API",cli:"CLI",dingtalk:"DingTalk",discord:"Discord",email:"Email",feishu:"Feishu",matrix:"Matrix",msteams:"Microsoft Teams",qq:"QQ",slack:"Slack",telegram:"Telegram",wechat:"WeChat",wecom:"WeCom",weixin:"WeChat",whatsapp:"WhatsApp"},schedule:{at:"Vào {{time}}",every:"Mỗi {{duration}}",cron:"Cron {{expr}}",cronWithTz:"Cron {{expr}} · {{tz}}",withTz:"{{summary}} · {{tz}}",dailyAt:"Hằng ngày lúc {{time}}",weekdaysAt:"Ngày làm việc lúc {{time}}",hourlyAt:"Mỗi giờ tại :{{minute}}",hourlyWindow:"Mỗi giờ {{start}}-{{end}} tại :{{minute}}",custom:"Lịch tùy chỉnh"},next:{paused:"Đã tạm dừng",pending:"Đang chạy",none:"Không có lần chạy tiếp theo"},message:{showMore:"Hiển thị toàn bộ tin nhắn",showLess:"Thu gọn"},fields:{name:"Tên",message:"Tin nhắn",scheduleType:"Loại lịch",every:"Mỗi",unit:"Đơn vị",cronExpression:"Biểu thức cron",timezone:"Múi giờ",runAt:"Chạy lúc"},scheduleTypes:{every:"Khoảng lặp",cron:"Cron",at:"Một lần"},everyUnits:{second:"Giây",minute:"Phút",hour:"Giờ",day:"Ngày"},validation:{nameRequired:"Tên là bắt buộc.",messageRequired:"Tin nhắn là bắt buộc.",intervalRequired:"Khoảng lặp phải là số dương.",cronRequired:"Biểu thức cron là bắt buộc.",timeRequired:"Thời gian chạy là bắt buộc.",futureRequired:"Thời gian chạy phải ở tương lai."}},oauth:{authentication:"Xác thực OAuth",signIn:"Đăng nhập",signingIn:"Đang đăng nhập...",signInAgain:"Đăng nhập lại",signOut:"Đăng xuất",signedInAs:"Đã đăng nhập bằng {{account}}",signInHelp:"Inicia sesión desde este dispositivo; no se guarda API key en config.",signInRequired:"Cần đăng nhập",signInBeforeSaving:"Inicia sesión antes de guardar este proveedor OAuth como proveedor activo.",signedIn:"Đã đăng nhập",notSignedIn:"Chưa đăng nhập"},skills:{description:"Xem các kỹ năng chỉ dẫn mà agent này có thể tải trong cuộc trò chuyện.",caption:"{{available}} khả dụng · tổng {{total}}",featured:"Kỹ năng agent",empty:"Không có kỹ năng nào khả dụng.",sourceWorkspace:"Tùy chỉnh",sourceBuiltin:"Tích hợp",statusAvailable:"Khả dụng",statusUnavailable:"Không khả dụng",unavailableReason:"Thiếu: {{reason}}",openDetails:"Mở chi tiết {{name}}",loadingDetail:"Đang tải chi tiết kỹ năng...",loadFailed:"Không tải được chi tiết kỹ năng.",descriptionTitle:"Mô tả",source:"Nguồn",status:"Trạng thái",requirements:"Yêu cầu",noRequirements:"Không có yêu cầu rõ ràng.",commands:"Lệnh",environment:"Biến môi trường",missingCommands:"Thiếu CLI",missingEnvironment:"Thiếu ENV",unavailableReasonLabel:"Lý do không khả dụng",rawInstructions:"SKILL.md gốc",rawInstructionsEmpty:"Không có hướng dẫn gốc.",detailDescription:"Chi tiết cho {{name}}."},voice:{selectProvider:"Chon nha cung cap",configureProvider:"Cau hinh nha cung cap",languageAuto:"Tu dong"}},aM={fallbackTitle:"Trò chuyện {{id}}",forkTitle:"Nhánh: {{title}}",loading:"Đang tải…",noSessions:"Chưa có phiên nào.",showMore:"Hiển thị thêm {{count}}",collapsed:"Đã thu gọn {{count}} cuộc trò chuyện",showLess:"Thu gọn",actions:"Tác vụ cho cuộc trò chuyện {{title}}",newInProject:"Bắt đầu cuộc trò chuyện mới trong {{project}}",activity:{running:"Agent running",complete:"Agent finished",updated:"New activity"},pin:"Pin",unpin:"Unpin",rename:"Rename",renameTitle:"Rename chat",renameDescription:"Choose a local sidebar name for this chat.",renamePlaceholder:"Chat name",renameProjectTitle:"Rename project",renameProjectDescription:"Choose a local sidebar name for this project.",renameProjectPlaceholder:"Project name",renameSave:"Save",archive:"Archive",unarchive:"Unarchive",showArchived:"Show archived",hideArchived:"Hide archived",delete:"Xóa",newChat:"Cuộc trò chuyện mới",groups:{pinned:"Pinned",all:"Chats",projects:"Projects",today:"Today",yesterday:"Yesterday",earlier:"Earlier",archived:"Archived"}},oM={title:"Xóa cuộc trò chuyện này?",description:"Không thể hoàn tác thao tác này.",cancel:"Hủy",confirm:"Xóa",automationsDescription:"Cuộc trò chuyện này có các tự động hóa đã lên lịch. Xóa cuộc trò chuyện cũng sẽ xóa chúng.",moreAutomations:"+ {{count}} mục nữa",confirmWithAutomations:"Xóa",schedule:{at:"{{time}}",every:"Mỗi {{duration}}",cron:"Cron {{expr}}",cronWithTz:"Cron {{expr}} · {{tz}}",unknown:"Lịch tùy chỉnh"},next:{label:"Tiếp theo: {{time}}",disabled:"Đã tạm dừng",none:"Không có lần chạy tiếp theo"}},sM={idle:"Rảnh",connecting:"Đang kết nối…",open:"Đã kết nối",reconnecting:"Đang kết nối lại…",closed:"Đã ngắt kết nối",error:"Lỗi kết nối"},iM={loadingConversation:"Đang tải cuộc trò chuyện…",empty:{greetings:{workOn:"Mình cùng làm gì tiếp?",start:"Hôm nay bắt đầu từ đâu?",build:"Hôm nay mình xây dựng gì?",tackle:"Mình cùng xử lý việc gì?"},quickActions:{plan:{title:"Tạo kế hoạch dự án",prompt:"Tạo một kế hoạch dự án ngắn gọn cho việc tôi nên xây dựng tiếp theo."},analyze:{title:"Phân tích dữ liệu này",prompt:"Giúp tôi phân tích dữ liệu này và chỉ ra các mẫu quan trọng nhất."},brainstorm:{title:"Động não ý tưởng",prompt:"Động não vài ý tưởng thực tế và các đánh đổi cho vấn đề này."},code:{title:"Viết mã",prompt:"Giúp tôi viết mã cho nhiệm vụ này, bắt đầu từ thay đổi hữu ích nhỏ nhất."},summarize:{title:"Tóm tắt tài liệu này",prompt:"Tóm tắt tài liệu này và liệt kê các ý chính."},more:{title:"Thêm",prompt:"Cho tôi xem vài cách hữu ích mà bạn có thể giúp trong workspace này."}},imageQuickActions:{icon:{title:"Thiết kế biểu tượng app",prompt:"Tạo một biểu tượng ứng dụng 1:1 gọn gàng cho nanobot: robot thân thiện, phong cách vector đơn giản, bảng màu xanh trắng dịu, không có chữ."},sticker:{title:"Tạo sticker",prompt:"Tạo một hình kiểu sticker dễ thương của trợ lý robot nhỏ, nền trông như trong suốt, biểu cảm và vui nhộn."},poster:{title:"Tạo poster",prompt:"Tạo một ý tưởng poster chỉn chu cho trợ lý AI cá nhân, bố cục hiện đại, phân cấp thị giác rõ, phù hợp cho landing page."},product:{title:"Mockup sản phẩm",prompt:"Tạo một hình mockup sản phẩm gọn gàng cho ứng dụng web AI hội thoại, giao diện tối giản, ánh sáng cao cấp, khung thiết bị chân thực."},portrait:{title:"Chân dung cách điệu",prompt:"Tạo chân dung cách điệu của một người bạn đồng hành AI thân thiện, ánh sáng mềm, chi tiết nhưng dễ gần, phong cách minh họa hiện đại."},edit:{title:"Chỉnh sửa ảnh",prompt:"Giúp tôi chỉnh sửa một ảnh. Trước tiên hãy yêu cầu tôi tải lên hoặc chỉ định ảnh, rồi tạo kết quả đã chỉnh sửa."}}},header:{toggleSidebar:"Bật/tắt thanh bên",newChat:"Bắt đầu chat mới",toggleTheme:"Chuyển chủ đề từ header",settings:"Mở cài đặt",sessionInfo:"Chi tiết phiên"},sessionInfo:{title:"Phiên",untitled:"Chat chưa đặt tên",automations:"Tự động hóa",count:"{{count}}",loading:"Đang tải tự động hóa...",loadFailed:"Không thể tải tự động hóa.",empty:"Phiên này chưa có tự động hóa.",disabled:"Tắt",schedule:{at:"Lúc {{time}}",every:"Mỗi {{duration}}",cron:"Cron {{expr}}",cronWithTz:"Cron {{expr}} · {{tz}}",unknown:"Lịch tùy chỉnh"},next:{label:"Tiếp theo {{time}}",pending:"Sắp chạy",disabled:"Đã tạm dừng",none:"Không có lần chạy tiếp theo"}},composer:{placeholderThread:"Nhập tin nhắn…",placeholderHero:"Bạn đang nghĩ gì?",placeholderOpening:"Đang mở cuộc trò chuyện mới…",placeholderStreaming:"Mô hình đang trả lời…",inputAria:"Ô nhập tin nhắn",sendHint:"Enter để gửi · Shift+Enter để xuống dòng",runRuntimeTitle:"Đang chạy · {{elapsed}}",goalStateStrip:"Mục tiêu · {{label}}",goalStateFallback:"Mục tiêu",goalStateExpandAria:"Xem đầy đủ mục tiêu",goalStateSheetTitle:"Mục tiêu",goalStateCloseAria:"Đóng mục tiêu",send:"Gửi tin nhắn",stop:"Dừng phản hồi",modelNotConfigured:"Chưa cấu hình mô hình",configureModel:"Cấu hình mô hình",queued:{label:"Hướng dẫn đang chờ",guide:"Hướng dẫn",delete:"Xóa hướng dẫn",edit:"Sửa hướng dẫn",drag:"Kéo để sắp xếp"},attachImage:"Đính kèm ảnh",imageMode:{label:"Tạo ảnh",toggle:"Bật/tắt chế độ tạo ảnh",placeholder:"Mô tả hoặc chỉnh sửa ảnh…",aspectAria:"Tỷ lệ khung hình ảnh",aspectLabel:"Tỷ lệ ảnh",aspect:{auto:"Tự động","1_1":"Vuông 1:1","3_4":"Dọc 3:4","9_16":"Story 9:16","4_3":"Ngang 4:3","16_9":"Rộng 16:9"}},tools:{search:"Tìm kiếm",reason:"Suy luận",deepResearch:"Nghiên cứu sâu",voice:"Nhập bằng giọng nói"},voice:{hint:"Bấm để đọc chính tả hoặc nhấn giữ",stop:"Dừng ghi âm",transcribing:"Đang chép lời...",recordingStatus:"Đang ghi {{time}}"},voiceErrors:{unsupported:"Trình duyệt này không hỗ trợ nhập bằng giọng nói.",permission:"Cần quyền truy cập micrô.",notConfigured:"Hãy cấu hình nhà cung cấp chép lời trước.",tooLong:"Bản ghi âm quá dài.",tooShort:"Giữ lâu hơn một chút để ghi âm giọng nói.",noInput:"Không phát hiện đầu vào micrô.",failed:"Không thể chép lời âm thanh."},slash:{ariaLabel:"Lệnh slash",label:"lệnh",navigateHint:"↑↓ Chọn",selectHint:"Enter/Tab Chèn",closeHint:"Esc Đóng",commands:{new:{title:"Cuộc trò chuyện mới",description:"Dừng tác vụ hiện tại và bắt đầu một cuộc trò chuyện mới."},stop:{title:"Dừng tác vụ hiện tại",description:"Hủy lượt agent đang chạy trong cuộc trò chuyện này."},restart:{title:"Khởi động lại nanobot",description:"Khởi động lại tiến trình bot tại chỗ."},status:{title:"Hiển thị trạng thái",description:"Hiển thị trạng thái runtime, provider và channel."},model:{title:"Mô hình",description:"Hiển thị hoặc chuyển preset mô hình đang hoạt động."},history:{title:"Hiển thị lịch sử",description:"In N tin nhắn hội thoại đã lưu gần nhất."},dream:{title:"Chạy Dream",description:"Kích hoạt thủ công quá trình hợp nhất bộ nhớ."},dream_log:{title:"Hiển thị nhật ký Dream",description:"Hiển thị những gì lần hợp nhất Dream gần nhất đã thay đổi."},dream_restore:{title:"Khôi phục bộ nhớ",description:"Đưa bộ nhớ về một snapshot Dream trước đó."},goal:{title:"Mục tiêu dài hạn",description:"Yêu cầu agent xử lý đây là mục tiêu nhiều bước kéo dài."},help:{title:"Hiển thị trợ giúp",description:"Liệt kê các lệnh slash có sẵn."},pairing:{title:"Ghép nối",description:"Quản lý yêu cầu ghép nối."}},badges:{current:"Hiện tại",recent:"Gần đây"},details:{goalActive:"Mục tiêu đang chạy",goalReady:"Bắt đầu mục tiêu duy trì",history:"Hiển thị tin nhắn gần đây",stopRunning:"Đang chạy"}},encoding:"Đang xử lý…",remove:"Xóa tệp đính kèm",normalizedSizeHint:"{{orig}} → {{current}} (tự động)",imageRejected:{unsupported_type:"Loại tệp không được hỗ trợ",too_many_images:"Tối đa {{max}} ảnh mỗi tin nhắn",magic_mismatch:"Tệp này không phải là một ảnh thực",decode_failed:"Không thể giải mã ảnh này",too_large:"Ảnh quá lớn — hãy thử ảnh nhỏ hơn",io:"Không thể đọc tệp này"},mentions:{ariaLabel:"Ứng dụng",label:"Ứng dụng",cliGroup:"Ứng dụng CLI",mcpGroup:"Dịch vụ MCP",cliBadge:"CLI",mcpBadge:"MCP",cliDescription:"Dùng @{{name}} như ứng dụng CLI cục bộ",mcpDescription:"Dùng @{{name}} như máy chủ MCP"},workspace:{accessAria:"Workspace access mode",projectAria:"Chọn dự án",projectPlaceholder:"Chọn dự án",default:"Default Permission",full:"Full Access"}},scrollToBottom:"Cuộn xuống cuối",loadEarlier:"Tải tin nhắn trước đó",forkedFromHistory:"Tách nhánh từ lịch sử",promptNavigator:{open:"Mở trình điều hướng prompt",title:"Prompt",search:"Tìm prompt",noResults:"Không có prompt phù hợp.",jumpTo:"Nhảy tới prompt: {{label}}"}},lM={streaming:"đang truyền",assistantTyping:"Trợ lý đang nhập",toolSingle:"Đang dùng một công cụ",toolMany:"Đã dùng {{count}} công cụ",toolSummary:"{{count}} công cụ",toolSummaryMany:"{{count}} công cụ",reasoningTools:"Suy luận · {{count}} công cụ",reasoningToolsSingular:"Suy luận · 1 công cụ",reasoning:"Suy luận",reasoningStreaming:"Đang suy nghĩ…",reasoningSummary:"Suy luận",agentActivitySummary:"{{reasoning}} bước · {{tools}} lần gọi công cụ",agentActivityToolsOnly:"{{tools}} lần gọi công cụ",agentActivityLiveSummary:"Đang chạy… · {{reasoning}} bước · {{tools}} lần gọi công cụ",agentActivityLiveToolsOnly:"Đang chạy… · {{tools}} lần gọi công cụ",imageAttachment:"Tệp hình ảnh đính kèm",forkFromHere:"Tách nhánh",copyReply:"Sao chép",copiedReply:"Đã sao chép",turnLatencyTitle:"Thời gian phản hồi (end-to-end)",activityThinkingFor:"Đang suy nghĩ trong {{duration}}",activityThought:"Đã suy nghĩ",activityThoughtFor:"Đã suy nghĩ trong {{duration}}",activityWorkingFor:"Đang xử lý trong {{duration}}",activityWorked:"Đã xử lý",activityWorkedFor:"Đã xử lý trong {{duration}}",cliActivityRunningOne:"Đang dùng @{{name}}",cliActivityRanOne:"Đã dùng @{{name}}",cliActivityFailedOne:"@{{name}} thất bại",cliActivityRunningMany:"Đang dùng {{count}} ứng dụng CLI",cliActivityRanMany:"Đã dùng {{count}} ứng dụng CLI",cliActivityFailedMany:"{{count}} ứng dụng CLI thất bại",cliRunRunning:"Đang dùng",cliRunRan:"Đã dùng",cliRunFailed:"Thất bại",automationSourceFallback:"Tự động hóa",automationTriggered:"Tự động kích hoạt"},cM={title:"Xem trước ảnh",open:"Xem ảnh",prev:"Ảnh trước",next:"Ảnh tiếp theo",close:"Đóng xem trước"},uM={aria:"Xem trước tệp",close:"Đóng xem trước tệp",loading:"Đang tải bản xem trước...",failed:"Không thể xem trước tệp này.",routeMissing:"Xem trước tệp cần gateway mới nhất. Hãy khởi động lại nanobot gateway rồi thử lại.",resize:"Đổi kích thước bản xem trước tệp",truncated:"Bản xem trước bị cắt vì tệp này lớn."},dM={fallbackLanguage:"mã",copyAria:"Sao chép mã",copy:"Sao chép",copied:"Đã sao chép"},pM={dismiss:"Đóng"},mM={messageTooBig:{title:"Tin nhắn quá lớn",body:"Máy chủ đã từ chối tin nhắn trước vì vượt quá giới hạn kích thước. Hãy bớt ảnh hoặc chọn tệp nhỏ hơn rồi thử lại."},workspaceScopeRejected:{title:"Workspace was not changed",body:"Nanobot kept the previous workspace because the requested project or access mode was rejected by the gateway."}},fM={dialog:{defaultProject:"Default workspace",manual:"Dán đường dẫn",manualPlaceholder:"/Users/name/project",usePath:"Use Path",absolutePathRequired:"Enter an absolute folder path on this machine."}},hM={app:tM,sidebar:nM,settings:rM,chat:aM,deleteConfirm:oM,connection:sM,thread:iM,message:lM,lightbox:cM,filePreview:uM,code:dM,common:pM,errors:mM,workspace:fM},gM={brand:"nanobot",loading:{connecting:"Menghubungkan ke nanobot…",boot:"Memuat nanobot…"},error:{title:"Tidak dapat menjangkau nanobot",gatewayHint:"Pastikan gateway sedang berjalan (`nanobot gateway`) dan halaman ini dibuka pada mesin yang sama."},auth:{title:"Autentikasi diperlukan",hint:"Masukkan secret yang dikonfigurasi sebagai tokenIssueSecret di konfigurasi gateway.",placeholder:"Kata sandi",submit:"Hubungkan",invalid:"Kata sandi tidak valid. Coba lagi."},account:{section:"Akun",logoutHint:"Putuskan browser ini dari gateway.",logout:"Keluar"},system:{section:"Sistem",restartHint:"Mulai ulang nanobot untuk menerapkan perubahan runtime.",restart:"Mulai ulang nanobot",restarting:"Memulai ulang...",restartEngine:"Mulai ulang engine",restartingEngine:"Memulai ulang engine..."},restart:{completed:"Mulai ulang selesai dalam {{seconds}} dtk."},documentTitle:{base:"nanobot",chat:"{{title}} · nanobot"},meta:{description:"UI web nanobot — ngobrol dengan workspace nanobot Anda."}},vM={navigation:"Navigasi bilah samping",collapse:"Ciutkan sidebar",newChat:"Obrolan baru",searchAria:"Cari",searchPlaceholder:"Cari",searchResults:"Hasil",noSearchResults:"Tidak ada chat yang cocok.",recent:"Terbaru",settings:"Pengaturan",language:{label:"Bahasa",ariaLabel:"Ganti bahasa"},apps:"Aplikasi",automations:"Otomasi",skills:{title:"Skill"}},xM={backToChat:"Kembali ke chat",sidebar:{title:"Pengaturan",ariaLabel:"Bagian pengaturan"},nav:{general:"Umum",byok:"BYOK",overview:"Ikhtisar",appearance:"Tampilan",models:"Model",providers:"Penyedia",image:"Gambar",voice:"Suara",browser:"Internet",runtime:"Sistem",advanced:"Keamanan",cliApps:"Aplikasi CLI",mcp:"MCP",apps:"Aplikasi",automations:"Otomasi",skills:"Skill"},sections:{interface:"Antarmuka",ai:"AI",system:"Sistem",about:"Tentang",status:"Status",localPreferences:"Preferensi lokal",presets:"Preset",imageGeneration:"Pembuatan gambar",imageDefaults:"Default",webSearch:"Pencarian web",webBehavior:"Perilaku",identity:"Identitas",webuiSafety:"Keamanan WebUI",capabilities:"Kemampuan",cliApps:"Aplikasi CLI",mcp:"Layanan MCP",apps:"Aplikasi",nativeHost:"Host native",hostSafety:"Keamanan aplikasi",voiceInput:"Input suara"},rows:{theme:"Tema",language:"Bahasa",provider:"Penyedia",model:"Model",restart:"Mulai ulang nanobot",configPath:"Path konfigurasi",activePreset:"Preset aktif",gateway:"Gerbang",restartState:"Status mulai ulang",pendingChanges:"Perubahan tertunda",selectedPreset:"Preset terpilih",presetModel:"Model preset",density:"Kerapatan",activityMode:"Detail aktivitas",codeWrap:"Bungkus kode",maxResults:"Hasil maksimum",timeout:"Batas waktu",jinaReader:"Pembaca Jina",imageGeneration:"Pembuatan gambar",imageProvider:"Penyedia gambar",imageProviderStatus:"Status penyedia",imageProviderBase:"Basis penyedia",imageModel:"Model gambar",defaultAspectRatio:"Rasio default",defaultImageSize:"Ukuran default",maxImagesPerTurn:"Maks. gambar per giliran",imageSaveDir:"Direktori simpan",botName:"Nama bot",botIcon:"Ikon bot",timezone:"Zona waktu",workspacePath:"Workspace default",localServiceAccess:"Layanan lokal",webuiDefaultAccess:"Akses default",currentModel:"Konfigurasi saat ini",brandLogos:"Logo merek",cliAppsCatalog:"Katalog",cliAppsFilter:"Saring",engine:"Mesin",logs:"Log",diagnostics:"Diagnostik",contextWindow:"Jendela konteks",transcription:"Transkripsi",transcriptionProvider:"Penyedia",transcriptionProviderStatus:"Status penyedia",transcriptionModel:"Model",transcriptionLanguage:"Bahasa",voiceLimits:"Batas"},help:{theme:"Beralih antara tampilan terang dan gelap.",language:"Pilih bahasa yang digunakan WebUI.",provider:"Selecciona el proveedor para nuevas solicitudes de modelo.",model:"Define el nombre de modelo predeterminado de nanobot.",configPath:"Archivo de configuración que usa actualmente el gateway.",selectedPreset:"Los preajustes con nombre son de solo lectura aquí; edítalos en config.json.",presetModel:"Beralih ke Default untuk mengedit model dan penyedia dari WebUI.",density:"Hanya disimpan di browser ini.",activityMode:"Pilih seberapa banyak detail aktivitas agen yang ditampilkan secara default.",codeWrap:"Menjaga baris kode panjang tetap terbaca di layar kecil.",maxResults:"Resultados devueltos por cada llamada web_search.",timeout:"Segundos antes de que una solicitud de búsqueda expire.",jinaReader:"Usa Jina Reader para web_fetch cuando esté disponible.",imageGeneration:"Expone generate_image en chats cuando hay un proveedor de imagen configurado.",imageProvider:"Elige el proveedor registrado usado por generate_image.",imageProviderStatus:"La generación de imágenes reutiliza credenciales de Proveedores.",imageModel:"Nombre del modelo enviado al proveedor de imágenes seleccionado.",defaultAspectRatio:"Se usa cuando el prompt no elige una proporción.",defaultImageSize:"Petunjuk ukuran yang dikirim ke penyedia yang mendukungnya.",maxImagesPerTurn:"Batas atas untuk satu permintaan generate_image.",botName:"Se muestra donde nanobot usa un nombre visible.",botIcon:"Emoji o texto corto junto al nombre del bot.",timezone:"Se usa para horarios y respuestas con conciencia temporal.",localServiceAccess:"Izinkan perintah shell Full Access menjangkau layanan localhost.",webuiDefaultAccess:"Digunakan oleh chat web tanpa izin khusus proyek.",securityManagedControls:"Las capturas web siempre protegen servicios locales, privados y metadata. La seguridad de canales core se gestiona en config.json.",currentModel:"Digunakan untuk balasan baru.",selectedModelProvider:"Definido por el modelo seleccionado.",selectedModelValue:"Definido por el modelo seleccionado.",brandLogos:"Tampilkan logo penyedia pihak ketiga dan CLI di Pengaturan.",cliAppsCatalog:"Instala solo adaptadores CLI de apps que nanobot puede ejecutar localmente; las apps nativas no se modifican.",cliAppsFilter:"Busca por app, categoría o capacidad.",logs:"Abre la carpeta de registros del motor nativo.",diagnostics:"Exporta un pequeño informe de runtime para soporte.",localServiceAccessNative:"Permite que comandos shell con Full Access alcancen servicios en este Mac.",webuiDefaultAccessNative:"Usado por chats nativos sin permiso específico de proyecto.",contextWindow:"Pilih anggaran konteks default untuk konfigurasi model ini.",transcription:"Transkripsikan input mikrofon sebelum dikirim. Pesan suara channel memakai pengaturan yang sama.",transcriptionProvider:"Menggunakan kredensial penyedia yang sesuai dari Providers.",transcriptionProviderStatus:"API key tetap berada di providers, bukan di pengaturan transkripsi.",transcriptionModel:"Biarkan memakai default yang teresolusi kecuali penyedia membutuhkan id model khusus.",transcriptionLanguage:"Petunjuk ISO-639 opsional, seperti en, zh, ja, atau ko."},values:{light:"Terang",dark:"Gelap",notAvailable:"Tidak tersedia",enabled:"Aktif",disabled:"Nonaktif",restartPending:"Menunggu mulai ulang",ready:"Siap",privateEngine:"Mesin privat",unixSocket:"Soket Unix",defaultWorkspace:"Workspace default",comfortable:"Nyaman",compact:"Ringkas",auto:"Otomatis",expanded:"Diperluas",on:"Aktif",off:"Nonaktif",defaultPermission:"Izin default",fullAccess:"Akses penuh",configured:"Terkonfigurasi",notConfigured:"Belum dikonfigurasi",pending:"Tertunda",restartingEngine:"Memulai ulang"},status:{loading:"Memuat pengaturan...",loadError:"Tidak dapat memuat pengaturan",unsaved:"Perubahan belum disimpan.",upToDate:"Sudah terbaru.",savedRestart:"Guardado. Reinicia nanobot para aplicar.",restartAfterSaving:"Guarda los cambios y reinicia cuando puedas.",savedRestartApply:"Guardado. Reinicia cuando puedas.",imageProviderRestart:"Cambios del proveedor de imagen guardados. Reinicia cuando puedas.",hostRestartAfterSaving:"Al guardar, nanobot reiniciará su motor.",hostRestartPending:"Guardado. El motor se reiniciará cuando esté listo.",hostApiUnavailable:"Las acciones del host solo están disponibles en la app nativa.",logsOpened:"Carpeta de registros abierta.",logsOpenFailed:"No se pudo abrir la carpeta de registros.",diagnosticsExported:"Diagnóstico exportado a {{path}}.",diagnosticsExportFailed:"No se pudo exportar el diagnóstico."},actions:{save:"Simpan",saving:"Menyimpan",edit:"Edit",cancel:"Batal",open:"Buka",export:"Ekspor",opening:"Membuka...",exporting:"Mengekspor..."},byok:{description:"Gunakan kunci provider Anda sendiri. Nanobot membaca nilai ini dari config saat ini, dan hanya provider yang sudah dikonfigurasi yang bisa dipilih di Umum.",configured:"Terkonfigurasi",notConfigured:"Belum dikonfigurasi",configuredSection:"Terkonfigurasi",notConfiguredSection:"Belum dikonfigurasi",showMore:"Tampilkan {{count}} lagi",showLess:"Tampilkan lebih sedikit",apiKey:"API key",apiBase:"API base",apiKeyPlaceholder:"Masukkan API key",apiKeyConfiguredPlaceholder:"Kosongkan untuk mempertahankan key saat ini",configuredKeyHint:"Key terkonfigurasi",apiBasePlaceholder:"Gunakan default provider",apiKeyRequired:"API key diperlukan untuk mengonfigurasi provider ini.",showApiKey:"Tampilkan API key",hideApiKey:"Sembunyikan API key",noConfiguredProviders:"Belum ada provider terkonfigurasi",configureFirst:"Konfigurasikan provider di BYOK terlebih dahulu.",openByok:"Buka BYOK",tabs:{ariaLabel:"Jenis kredensial BYOK",llm:"LLM",webSearch:"Pencarian web"},webSearch:{provider:"Penyedia pencarian",providerHelp:"Pilih backend yang digunakan alat web search.",selectProvider:"Pilih provider",credentials:"Kredensial",noCredentialRequired:"Tidak perlu key",noCredentialHelp:"DuckDuckGo berfungsi tanpa menyimpan API key.",apiKeyHelp:"Disimpan di config dan ditampilkan tersamarkan setelah disimpan.",baseUrl:"Base URL",baseUrlHelp:"SearXNG memerlukan URL instance Anda sendiri.",baseUrlPlaceholder:"https://search.example.com",apiKeyRequired:"Provider pencarian ini memerlukan API key.",baseUrlRequired:"SearXNG memerlukan Base URL.",missingCredential:"Tambahkan kredensial yang diperlukan sebelum menyimpan.",saveHint:"Perubahan berlaku untuk permintaan web search baru."}},overview:{model:"Model saat ini",providers:"Penyedia",configuredCount:"{{count}} dikonfigurasi",totalProviders:"{{count}} tersedia",webSearch:"Pencarian web",imageGeneration:"Pembuatan gambar",voiceInput:"Input suara",workspace:"Ruang kerja"},usage:{title:"Aktivitas token",shortTitle:"Token Usage",subtitle:"Penggunaan yang dilaporkan penyedia selama 12 bulan terakhir.",empty:"Aktivitas token akan muncul setelah balasan model baru.",totalTokens:"Total token",peakTokens:"Puncak token",thirtyDayTokens:"Token 30 hari",currentStreak:"Rentetan saat ini",longestStreak:"Rentetan terpanjang",daysValue:"{{count}} h",last30:"30 hari",activeDays:"Hari aktif",requests:"Permintaan",estimated:"perkiraan",includesEstimates:"termasuk perkiraan",cellTitle:"{{date}}: {{tokens}} token, {{requests}} permintaan",sources:{user:"Chat",api:"API",cron:"Otomasi",dream:"Memori",system:"Sistem"}},providers:{searchPlaceholder:"Cari penyedia",noMatches:"Tidak ada penyedia yang cocok.",saveProvider:"Simpan penyedia"},image:{selectProvider:"Pilih penyedia",selectAspect:"Pilih rasio",selectSize:"Pilih ukuran",configureProvider:"Konfigurasi penyedia",missingCredential:"Configura este proveedor antes de activar la generación de imágenes."},models:{selectModel:"Pilih model",addConfiguration:"Tambah konfigurasi",newConfiguration:"Konfigurasi model baru",newConfigurationHelp:"Simpan penyedia dan model sebagai opsi sekali klik.",configurationName:"Nama konfigurasi",configurationNameHelp:"Ganti nama konfigurasi model tersimpan ini.",configurationNamePlaceholder:"Menulis cepat",searchModels:"Cari atau ketik ID model",useCustomModel:"Gunakan",loadingModels:"Memuat model...",searchCatalog:"Cari katalog penyedia untuk memilih model.",modelsAvailable:"tersedia",noModelResults:"Tidak ada model yang cocok.",loadFailed:"Daftar model tidak tersedia.",unsupportedModelList:"Ketik ID model secara manual.",providerNotConfigured:"Konfigurasikan penyedia ini sebelum memuat model.",autoProviderCustomOnly:"Mode penyedia otomatis memakai ID model kustom."},timezone:{select:"Pilih zona waktu",search:"Cari zona waktu",empty:"Tidak ada zona waktu yang cocok."},cliApps:{allCategories:"Semua kategori",availableCount:"{{count}} aplikasi",installedCount:"{{count}} terpasang",summary:"{{installed}} dari {{total}} CLI terpasang",filterAll:"Semua",filterInstalled:"CLI terpasang",filterNotInstalled:"Belum terpasang",searchPlaceholder:"Cari CLI",statusInstalled:"Terpasang",statusAvailable:"Tersedia",statusMissing:"Dependensi hilang",statusUnsupported:"Tidak didukung",statusNotInstalled:"Belum terpasang",unsupported:"Tidak didukung",loading:"Memuat aplikasi CLI...",empty:"Tidak ada aplikasi CLI yang cocok dengan filter ini.",readyTitle:"@{{name}} siap",readyStatus:"Siap",readyPrompt:"Gunakan @{{name}} untuk melihat kemampuan CLI ini.",readyTry:"Coba @{{name}}",readyCopied:"Disalin",openChat:"Buka chat",requires:"Membutuhkan",test:"Uji CLI",update:"Perbarui CLI",uninstall:"Copot CLI",install:"Pasang CLI",unavailable:"Tidak tersedia",noDescription:"Tidak ada deskripsi."},about:{version:"Versi",checking:"Memeriksa pembaruan...",checkForUpdates:"Periksa pembaruan",upToDate:"Anda sudah menggunakan versi terbaru",updateAvailable:"Pembaruan tersedia v{{version}}"},mcp:{allCategories:"Semua kategori",summary:"{{installed}} dari {{total}} preset diaktifkan",filterAll:"Semua",filterInstalled:"Aktif",filterNotInstalled:"Tidak aktif",searchPlaceholder:"Cari preset MCP",moreOptions:"Opsi MCP lainnya",moreOptionsSubtitle:"Tambahkan server khusus atau impor mcp.json.",customTitle:"MCP khusus",customSubtitle:"Tambahkan server MCP stdio, HTTP, atau SSE apa pun.",customAction:"Khusus",importAction:"Impor",serverName:"Nama server",serverUrl:"URL",transport:"Transport",command:"Perintah",args:"Args JSON",headers:"Headers JSON",env:"Env JSON",timeout:"Batas waktu alat",advancedOptions:"Opsi lanjutan",hideAdvanced:"Sembunyikan lanjutan",saveCustom:"Simpan MCP",configImport:"Impor mcp.json",importConfig:"Impor",restartRequired:"Mulai ulang nanobot untuk menyambungkan alat MCP yang diperbarui.",toolsFound:"{{count}} alat",loading:"Memuat preset MCP...",empty:"Tidak ada preset MCP yang cocok dengan filter ini.",openDocs:"Buka dokumentasi",test:"Uji",remove:"Hapus",enable:"Aktifkan",enabled:"Aktif",setup:"Hubungkan",configure:"Hubungkan",connectTitle:"Hubungkan {{name}}",connectHint:"Tambahkan kunci dari pengaturan akun Anda.",saveAndEnable:"Simpan dan aktifkan",updateSetup:"Perbarui konfigurasi",configured:"terkonfigurasi",keepExisting:"Biarkan kosong untuk mempertahankan nilai saat ini",statusConfigured:"Terkonfigurasi",statusMissingCredentials:"Butuh kunci",statusMissingDependency:"Butuh dependensi",statusComingSoon:"Segera hadir",statusNotInstalled:"Tidak aktif",toolScope:"Alat",allTools:"Semua",noTools:"Tidak ada",testForTools:"Jalankan Uji untuk memeriksa dan memilih alat individual."},legal:{thirdPartyBrands:"Nama produk, logo, dan merek adalah milik pemiliknya masing-masing. Penggunaan hanya untuk identifikasi dan tidak menyiratkan dukungan."},apps:{description:"Tambahkan CLI aplikasi dan layanan MCP yang dapat digunakan nanobot dari chat.",cliLabel:"CLI",mcpLabel:"MCP",filterAll:"Semua",filterCli:"Aplikasi CLI",filterMcp:"Layanan MCP",enabledSummary:"{{count}} aktif",caption:"{{cli}} CLI · {{mcp}} MCP",searchPlaceholder:"Cari aplikasi",featured:"Unggulan",loading:"Memuat aplikasi...",empty:"Tidak ada aplikasi yang cocok."},automations:{filters:{all:"Semua",active:"Aktif",paused:"Dijeda",failed:"Perlu ditangani",system:"Sistem"},sort:{next:"Jalankan berikutnya",last:"Jalankan terakhir",updated:"Diperbarui",name:"Nama"},search:"Cari tugas, pesan, chat terkait, atau jadwal",queue:"Antrean",loading:"Memuat otomasi...",noMatches:"Tidak ada otomasi yang cocok dengan tampilan ini.",empty:"Belum ada otomasi.",emptyHint:"Buat dari tempat tugas ini berjalan agar nanobot menyimpan konteks yang tepat.",oneShot:"Satu kali",systemTask:"Automasi yang dikelola sistem",labels:{schedule:"Jadwal",next:"Berikutnya",origin:"Chat tertaut",created:"Dibuat",updated:"Diperbarui"},runNow:"Jalankan sekarang",pause:"Jeda",resume:"Lanjutkan",edit:"Edit",delete:"Hapus",protected:"Terlindungi",editTitle:"Edit otomasi",save:"Simpan",deleteTitle:"Hapus otomasi",deleteDescription:"Ini menghapus {{name}} dari penyimpanan cron. Pesan chat sebelumnya tetap ada di sesi.",cancel:"Batal",status:{system:"Sistem",running:"Sedang berjalan",paused:"Dijeda",failed:"Gagal",completed:"Selesai",noSchedule:"Tanpa jadwal",active:"Aktif"},origin:{system:"Sistem",unknown:"Tidak ada chat tertaut"},channels:{api:"API",cli:"CLI",dingtalk:"DingTalk",discord:"Discord",email:"Email",feishu:"Feishu",matrix:"Matrix",msteams:"Microsoft Teams",qq:"QQ",slack:"Slack",telegram:"Telegram",wechat:"WeChat",wecom:"WeCom",weixin:"WeChat",whatsapp:"WhatsApp"},schedule:{at:"Pada {{time}}",every:"Setiap {{duration}}",cron:"Cron {{expr}}",cronWithTz:"Cron {{expr}} · {{tz}}",withTz:"{{summary}} · {{tz}}",dailyAt:"Setiap hari pukul {{time}}",weekdaysAt:"Hari kerja pukul {{time}}",hourlyAt:"Setiap jam pada :{{minute}}",hourlyWindow:"Setiap jam {{start}}-{{end}} pada :{{minute}}",custom:"Jadwal khusus"},next:{paused:"Dijeda",pending:"Sedang berjalan",none:"Tidak ada jadwal berikutnya"},message:{showMore:"Tampilkan pesan lengkap",showLess:"Tampilkan lebih sedikit"},fields:{name:"Nama",message:"Pesan",scheduleType:"Jenis jadwal",every:"Setiap",unit:"Unit",cronExpression:"Ekspresi cron",timezone:"Zona waktu",runAt:"Jalankan pada"},scheduleTypes:{every:"Interval",cron:"Cron",at:"Sekali"},everyUnits:{second:"Detik",minute:"Menit",hour:"Jam",day:"Hari"},validation:{nameRequired:"Nama wajib diisi.",messageRequired:"Pesan wajib diisi.",intervalRequired:"Interval harus berupa angka positif.",cronRequired:"Ekspresi cron wajib diisi.",timeRequired:"Waktu eksekusi wajib diisi.",futureRequired:"Waktu eksekusi harus berada di masa depan."}},oauth:{authentication:"Autentikasi OAuth",signIn:"Masuk",signingIn:"Masuk...",signInAgain:"Masuk lagi",signOut:"Keluar",signedInAs:"Masuk sebagai {{account}}",signInHelp:"Inicia sesión desde este dispositivo; no se guarda API key en config.",signInRequired:"Perlu masuk",signInBeforeSaving:"Inicia sesión antes de guardar este proveedor OAuth como proveedor activo.",signedIn:"Sudah masuk",notSignedIn:"Belum masuk"},skills:{description:"Tinjau skill instruksi yang dapat dimuat agent ini selama percakapan.",caption:"{{available}} tersedia · {{total}} total",featured:"Skill agent",empty:"Tidak ada skill yang tersedia.",sourceWorkspace:"Kustom",sourceBuiltin:"Bawaan",statusAvailable:"Tersedia",statusUnavailable:"Tidak tersedia",unavailableReason:"Kurang: {{reason}}",openDetails:"Buka detail {{name}}",loadingDetail:"Memuat detail skill...",loadFailed:"Tidak dapat memuat detail skill.",descriptionTitle:"Deskripsi",source:"Sumber",status:"Status",requirements:"Kebutuhan",noRequirements:"Tidak ada kebutuhan eksplisit.",commands:"Perintah",environment:"Variabel lingkungan",missingCommands:"CLI hilang",missingEnvironment:"ENV hilang",unavailableReasonLabel:"Alasan tidak tersedia",rawInstructions:"SKILL.md mentah",rawInstructionsEmpty:"Tidak ada instruksi mentah.",detailDescription:"Detail untuk {{name}}."},voice:{selectProvider:"Pilih penyedia",configureProvider:"Konfigurasi penyedia",languageAuto:"Auto"}},yM={fallbackTitle:"Obrolan {{id}}",forkTitle:"Cabang: {{title}}",loading:"Memuat…",noSessions:"Belum ada sesi.",showMore:"Tampilkan {{count}} lagi",collapsed:"{{count}} obrolan diciutkan",showLess:"Tampilkan lebih sedikit",actions:"Aksi obrolan untuk {{title}}",newInProject:"Mulai obrolan baru di {{project}}",activity:{running:"Agent running",complete:"Agent finished",updated:"New activity"},pin:"Pin",unpin:"Unpin",rename:"Rename",renameTitle:"Rename chat",renameDescription:"Choose a local sidebar name for this chat.",renamePlaceholder:"Chat name",renameProjectTitle:"Rename project",renameProjectDescription:"Choose a local sidebar name for this project.",renameProjectPlaceholder:"Project name",renameSave:"Save",archive:"Archive",unarchive:"Unarchive",showArchived:"Show archived",hideArchived:"Hide archived",delete:"Hapus",newChat:"Obrolan baru",groups:{pinned:"Pinned",all:"Chats",projects:"Projects",today:"Today",yesterday:"Yesterday",earlier:"Earlier",archived:"Archived"}},bM={title:"Hapus obrolan ini?",description:"Tindakan ini tidak dapat dibatalkan.",cancel:"Batal",confirm:"Hapus",automationsDescription:"Obrolan ini memiliki automasi terjadwal. Menghapusnya juga akan menghapus automasi tersebut.",moreAutomations:"+ {{count}} lagi",confirmWithAutomations:"Hapus",schedule:{at:"{{time}}",every:"Setiap {{duration}}",cron:"Cron {{expr}}",cronWithTz:"Cron {{expr}} · {{tz}}",unknown:"Jadwal khusus"},next:{label:"Berikutnya: {{time}}",disabled:"Dijeda",none:"Tidak ada jadwal berikutnya"}},wM={idle:"Idle",connecting:"Menghubungkan…",open:"Terhubung",reconnecting:"Menyambung ulang…",closed:"Terputus",error:"Kesalahan koneksi"},kM={loadingConversation:"Memuat percakapan…",empty:{greetings:{workOn:"Apa yang kita kerjakan bersama?",start:"Kita mulai dari mana?",build:"Apa yang kita bangun hari ini?",tackle:"Apa yang kita selesaikan bersama?"},quickActions:{plan:{title:"Buat rencana proyek",prompt:"Buat rencana proyek ringkas untuk apa yang sebaiknya saya bangun berikutnya."},analyze:{title:"Analisis data ini",prompt:"Bantu saya menganalisis data ini dan soroti pola yang paling penting."},brainstorm:{title:"Brainstorm ide",prompt:"Brainstorm beberapa ide praktis dan tradeoff untuk masalah ini."},code:{title:"Tulis kode",prompt:"Bantu saya menulis kode untuk tugas ini, mulai dari perubahan berguna yang paling kecil."},summarize:{title:"Ringkas dokumen ini",prompt:"Ringkas dokumen ini dan daftar poin-poin utamanya."},more:{title:"Lainnya",prompt:"Tunjukkan beberapa cara berguna Anda dapat membantu di workspace ini."}},imageQuickActions:{icon:{title:"Desain ikon aplikasi",prompt:"Buat ikon aplikasi 1:1 yang bersih untuk nanobot: robot ramah, gaya vektor sederhana, palet biru dan putih lembut, tanpa teks."},sticker:{title:"Buat stiker",prompt:"Buat gambar gaya stiker yang lucu dari asisten robot kecil, latar terlihat transparan, ekspresif dan menyenangkan."},poster:{title:"Buat poster",prompt:"Buat konsep poster yang rapi untuk asisten AI pribadi, komposisi modern, hierarki visual kuat, cocok untuk landing page."},product:{title:"Mockup produk",prompt:"Buat gambar mockup produk yang bersih untuk aplikasi web AI percakapan, antarmuka minimal, pencahayaan premium, bingkai perangkat realistis."},portrait:{title:"Potret bergaya",prompt:"Buat potret bergaya dari pendamping AI yang ramah, pencahayaan lembut, detail tetapi tetap mudah didekati, gaya ilustrasi modern."},edit:{title:"Edit gambar",prompt:"Bantu saya mengedit gambar. Minta saya mengunggah atau menyebutkan gambar terlebih dahulu, lalu buat hasil editnya."}}},header:{toggleSidebar:"Tampilkan atau sembunyikan sidebar",newChat:"Mulai chat baru",toggleTheme:"Alihkan tema dari header",settings:"Buka pengaturan",sessionInfo:"Detail sesi"},sessionInfo:{title:"Sesi",untitled:"Chat tanpa judul",automations:"Otomasi",count:"{{count}}",loading:"Memuat otomasi...",loadFailed:"Tidak dapat memuat otomasi.",empty:"Belum ada otomasi dalam sesi ini.",disabled:"Mati",schedule:{at:"Pada {{time}}",every:"Setiap {{duration}}",cron:"Cron {{expr}}",cronWithTz:"Cron {{expr}} · {{tz}}",unknown:"Jadwal khusus"},next:{label:"Berikutnya {{time}}",pending:"Segera berjalan",disabled:"Dijeda",none:"Tidak ada jadwal berikutnya"}},composer:{placeholderThread:"Ketik pesan Anda…",placeholderHero:"Apa yang sedang Anda pikirkan?",placeholderOpening:"Membuka obrolan baru…",placeholderStreaming:"Model sedang merespons…",inputAria:"Input pesan",sendHint:"Enter untuk kirim · Shift+Enter untuk baris baru",runRuntimeTitle:"Berjalan · {{elapsed}}",goalStateStrip:"Tujuan · {{label}}",goalStateFallback:"Tujuan",goalStateExpandAria:"Lihat tujuan lengkap",goalStateSheetTitle:"Tujuan",goalStateCloseAria:"Tutup tujuan",send:"Kirim pesan",stop:"Hentikan respons",modelNotConfigured:"Model belum dikonfigurasi",configureModel:"Konfigurasi model",queued:{label:"Panduan antrean",guide:"Pandu",delete:"Hapus panduan",edit:"Edit panduan",drag:"Seret untuk mengurutkan"},attachImage:"Lampirkan gambar",imageMode:{label:"Buat gambar",toggle:"Alihkan mode pembuatan gambar",placeholder:"Deskripsikan atau edit gambar…",aspectAria:"Rasio aspek gambar",aspectLabel:"Rasio gambar",aspect:{auto:"Otomatis","1_1":"Persegi 1:1","3_4":"Potret 3:4","9_16":"Story 9:16","4_3":"Lanskap 4:3","16_9":"Lebar 16:9"}},tools:{search:"Cari",reason:"Bernalar",deepResearch:"Riset mendalam",voice:"Input suara"},voice:{hint:"Klik untuk mendikte atau tahan",stop:"Hentikan rekaman",transcribing:"Mentranskripsi...",recordingStatus:"Merekam {{time}}"},voiceErrors:{unsupported:"Input suara tidak didukung di browser ini.",permission:"Izin mikrofon diperlukan.",notConfigured:"Konfigurasikan penyedia transkripsi terlebih dahulu.",tooLong:"Rekaman terlalu panjang.",tooShort:"Tahan sedikit lebih lama untuk merekam suara.",noInput:"Tidak ada input mikrofon yang terdeteksi.",failed:"Tidak dapat mentranskripsi audio."},slash:{ariaLabel:"Perintah slash",label:"perintah",navigateHint:"↑↓ Pilih",selectHint:"Enter/Tab Sisipkan",closeHint:"Esc Tutup",commands:{new:{title:"Obrolan baru",description:"Hentikan tugas saat ini dan mulai percakapan baru."},stop:{title:"Hentikan tugas saat ini",description:"Batalkan giliran agent yang sedang aktif di chat ini."},restart:{title:"Mulai ulang nanobot",description:"Mulai ulang proses bot di tempat."},status:{title:"Tampilkan status",description:"Tampilkan status runtime, provider, dan channel."},model:{title:"Model",description:"Tampilkan atau ganti preset model aktif."},history:{title:"Tampilkan riwayat",description:"Cetak N pesan percakapan tersimpan terbaru."},dream:{title:"Jalankan Dream",description:"Picu konsolidasi memori secara manual."},dream_log:{title:"Tampilkan log Dream",description:"Tampilkan perubahan dari konsolidasi Dream terakhir."},dream_restore:{title:"Pulihkan memori",description:"Kembalikan memori ke snapshot Dream sebelumnya."},goal:{title:"Tujuan jangka panjang",description:"Instruksikan agen memperlakukan ini sebagai tujuan multi-langkah yang berkelanjutan."},help:{title:"Tampilkan bantuan",description:"Daftar perintah slash yang tersedia."},pairing:{title:"Pemasangan",description:"Kelola permintaan pemasangan."}},badges:{current:"Saat ini",recent:"Terbaru"},details:{goalActive:"Tujuan sedang berjalan",goalReady:"Mulai tujuan berkelanjutan",history:"Tampilkan pesan terbaru",stopRunning:"Sedang berjalan"}},encoding:"Memproses…",remove:"Hapus lampiran",normalizedSizeHint:"{{orig}} → {{current}} (auto)",imageRejected:{unsupported_type:"Tipe file tidak didukung",too_many_images:"Maksimal {{max}} gambar per pesan",magic_mismatch:"File ini tampaknya bukan gambar asli",decode_failed:"Tidak dapat mendekode gambar ini",too_large:"Gambar terlalu besar — coba yang lebih kecil",io:"Tidak dapat membaca file ini"},mentions:{ariaLabel:"Aplikasi",label:"Aplikasi",cliGroup:"App CLI",mcpGroup:"Layanan MCP",cliBadge:"CLI",mcpBadge:"MCP",cliDescription:"Gunakan @{{name}} sebagai aplikasi CLI lokal",mcpDescription:"Gunakan @{{name}} sebagai server MCP"},workspace:{accessAria:"Workspace access mode",projectAria:"Pilih proyek",projectPlaceholder:"Pilih proyek",default:"Default Permission",full:"Full Access"}},scrollToBottom:"Gulir ke bawah",loadEarlier:"Muat pesan sebelumnya",forkedFromHistory:"Fork dari riwayat",promptNavigator:{open:"Buka navigator prompt",title:"Prompt",search:"Cari prompt",noResults:"Tidak ada prompt yang cocok.",jumpTo:"Lompat ke prompt: {{label}}"}},CM={streaming:"sedang mengalir",assistantTyping:"Asisten sedang mengetik",toolSingle:"Menggunakan sebuah alat",toolMany:"Menggunakan {{count}} alat",toolSummary:"{{count}} alat",toolSummaryMany:"{{count}} alat",reasoningTools:"Penalaran · {{count}} alat",reasoningToolsSingular:"Penalaran · 1 alat",reasoning:"Penalaran",reasoningStreaming:"Berpikir…",reasoningSummary:"Penalaran",agentActivitySummary:"{{reasoning}} langkah · {{tools}} panggilan alat",agentActivityToolsOnly:"{{tools}} panggilan alat",agentActivityLiveSummary:"Berjalan… · {{reasoning}} langkah · {{tools}} panggilan alat",agentActivityLiveToolsOnly:"Berjalan… · {{tools}} panggilan alat",imageAttachment:"Lampiran gambar",forkFromHere:"Fork",copyReply:"Salin",copiedReply:"Disalin",turnLatencyTitle:"Waktu respons (ujung ke ujung)",activityThinkingFor:"Berpikir selama {{duration}}",activityThought:"Selesai berpikir",activityThoughtFor:"Selesai berpikir dalam {{duration}}",activityWorkingFor:"Memproses selama {{duration}}",activityWorked:"Selesai memproses",activityWorkedFor:"Diproses selama {{duration}}",cliActivityRunningOne:"Menggunakan @{{name}}",cliActivityRanOne:"Menggunakan @{{name}} selesai",cliActivityFailedOne:"@{{name}} gagal",cliActivityRunningMany:"Menggunakan {{count}} aplikasi CLI",cliActivityRanMany:"{{count}} aplikasi CLI digunakan",cliActivityFailedMany:"{{count}} aplikasi CLI gagal",cliRunRunning:"Menggunakan",cliRunRan:"Digunakan",cliRunFailed:"Gagal",automationSourceFallback:"Otomatisasi",automationTriggered:"Dipicu otomatis"},SM={title:"Pratinjau gambar",open:"Lihat gambar",prev:"Gambar sebelumnya",next:"Gambar berikutnya",close:"Tutup pratinjau"},NM={aria:"Pratinjau file",close:"Tutup pratinjau file",loading:"Memuat pratinjau...",failed:"Tidak dapat mempratinjau file ini.",routeMissing:"Pratinjau file memerlukan gateway terbaru. Mulai ulang nanobot gateway lalu coba lagi.",resize:"Ubah ukuran pratinjau file",truncated:"Pratinjau dipotong karena file ini besar."},jM={fallbackLanguage:"kode",copyAria:"Salin kode",copy:"Salin",copied:"Tersalin"},AM={dismiss:"Tutup"},_M={messageTooBig:{title:"Pesan terlalu besar",body:"Server menolak pesan terakhir karena melebihi batas ukuran. Hapus beberapa gambar atau gunakan berkas yang lebih kecil, lalu coba lagi."},workspaceScopeRejected:{title:"Workspace was not changed",body:"Nanobot kept the previous workspace because the requested project or access mode was rejected by the gateway."}},PM={dialog:{defaultProject:"Default workspace",manual:"Tempel path",manualPlaceholder:"/Users/name/project",usePath:"Use Path",absolutePathRequired:"Enter an absolute folder path on this machine."}},TM={app:gM,sidebar:vM,settings:xM,chat:yM,deleteConfirm:bM,connection:wM,thread:kM,message:CM,lightbox:SM,filePreview:NM,code:jM,common:AM,errors:_M,workspace:PM},qg={en:{common:xT},"zh-CN":{common:ET},"zh-TW":{common:GT},fr:{common:cR},ja:{common:SR},ko:{common:zR},es:{common:eM},vi:{common:hM},id:{common:TM}};function ys(){return P0(vt.resolvedLanguage??vt.language??ai)}async function RM(e){await vt.changeLanguage(e)}vt.isInitialized||vt.use(ZA).init({resources:qg,lng:eT(),fallbackLng:ZP,defaultNS:"common",ns:["common"],interpolation:{escapeValue:!1},returnNull:!1,supportedLngs:Object.keys(qg)});const T0=e=>{const t=P0(e);nT(t),tT(t)};T0(ys());vt.on("languageChanged",T0);const MM=new Set(["hi","hello","hey","hello nano","hello nanobot","hi nano","hi nanobot","你好","您好","嗨","哈喽","哈啰","在吗"]);function EM(e){const t=e.toLowerCase().replace(/[.!?。!?~\s]+$/g,"").trim();return t.startsWith("/")||MM.has(t)}function Gi(e,t){if(!e)return t;const n=e.replace(/\s+/g," ").trim();return!n||EM(n)?t:n.length>60?`${n.slice(0,57)}…`:n}function R0(e){if(e==null||e==="")return null;const t=new Date(e);return Number.isNaN(t.getTime())?null:t}const IM=[[60,"second"],[60,"minute"],[24,"hour"],[7,"day"],[4.345,"week"],[12,"month"],[Number.POSITIVE_INFINITY,"year"]],Kg=new Map,Vg=new Map;function jf(e){return e||vt.resolvedLanguage||vt.language||ys()}function LM(e){const t=Kg.get(e);if(t)return t;const n=new Intl.RelativeTimeFormat(e,{numeric:"auto"});return Kg.set(e,n),n}function DM(e){const t=Vg.get(e);if(t)return t;const n=new Intl.DateTimeFormat(e,{dateStyle:"medium",timeStyle:"short"});return Vg.set(e,n),n}function Af(e,t){const n=R0(e);if(!n)return"";let r=(n.getTime()-Date.now())/1e3;const a=LM(jf(t));for(const[o,i]of IM){if(Math.abs(r)<o)return a.format(Math.round(r),i);r/=o}return a.format(Math.round(r),"year")}function $r(e,t){const n=R0(e);return n?DM(jf(t)).format(n):""}function OM(e,t){const n=jf(t),a=Math.max(0,e)/1e3;if(a<60)return new Intl.NumberFormat(n,{style:"unit",unit:"second",unitDisplay:"narrow",maximumFractionDigits:a<10?1:0,minimumFractionDigits:0}).format(a);const o=Math.floor(a/60),i=Math.max(0,Math.round(a-o*60)),l=new Intl.NumberFormat(n,{style:"unit",unit:"minute",unitDisplay:"narrow"}).format(o),c=new Intl.NumberFormat(n,{style:"unit",unit:"second",unitDisplay:"narrow",maximumFractionDigits:0}).format(i);return`${l} ${c}`}function FM({open:e,title:t,automations:n=[],onCancel:r,onConfirm:a}){const{t:o}=ie(),i=ys(),l=n.length>0,c=n.slice(0,4),d=Math.max(0,n.length-c.length);return s.jsx(QP,{open:e,onOpenChange:p=>p?void 0:r(),children:s.jsxs(k0,{className:"w-[min(calc(100vw-2rem),24rem)] gap-0 rounded-[28px] border border-white/70 bg-card/95 p-5 text-center shadow-[0_24px_80px_rgba(15,23,42,0.20)] backdrop-blur-xl data-[state=open]:zoom-in-95 sm:rounded-[28px]",children:[s.jsxs(C0,{className:"items-center space-y-0 text-center",children:[s.jsx("div",{className:"mb-5 grid h-16 w-16 place-items-center rounded-full bg-destructive/10 text-destructive",children:s.jsx("div",{className:"grid h-9 w-9 place-items-center rounded-full border border-destructive/20 bg-destructive/5",children:s.jsx(ya,{className:"h-5 w-5",strokeWidth:2.4,"aria-hidden":!0})})}),s.jsx(N0,{className:"text-center text-[20px] font-semibold leading-tight tracking-[-0.02em] text-foreground",children:o("deleteConfirm.title",{title:t})}),s.jsx(j0,{className:"mt-3 max-w-[17rem] text-center text-[14px] leading-6 text-muted-foreground",children:o(l?"deleteConfirm.automationsDescription":"deleteConfirm.description")}),l?s.jsxs("div",{className:"mt-4 max-h-40 w-full overflow-y-auto rounded-2xl bg-muted/55 px-3 py-2 text-left",children:[c.map(p=>s.jsxs("div",{className:"min-w-0 py-1.5",children:[s.jsx("div",{className:"truncate text-[13px] font-medium leading-5 text-foreground",children:p.name||p.id}),s.jsxs("div",{className:"mt-0.5 flex min-w-0 flex-wrap items-center gap-x-2 gap-y-0.5 text-[11.5px] leading-5 text-muted-foreground",children:[s.jsx("span",{className:"truncate",children:zM(p,o,i)}),s.jsx("span",{"aria-hidden":!0,children:"·"}),s.jsx("span",{className:"truncate",children:$M(p,o,i)})]})]},p.id)),d>0?s.jsx("div",{className:"text-[13px] leading-6 text-muted-foreground",children:o("deleteConfirm.moreAutomations",{count:d})}):null]}):null]}),s.jsxs(S0,{className:"mt-7 !grid grid-cols-1 gap-3 space-x-0 sm:grid-cols-2 sm:space-x-0",children:[s.jsx(_0,{onClick:r,className:"mt-0 h-11 w-full min-w-0 rounded-full border-0 bg-muted/70 px-5 text-[15px] font-semibold text-foreground shadow-none hover:bg-muted",children:o("deleteConfirm.cancel")}),s.jsx(A0,{onClick:a,className:"h-11 w-full min-w-0 !whitespace-normal rounded-full bg-destructive px-5 text-center text-[15px] font-semibold text-destructive-foreground shadow-[0_10px_25px_rgba(239,68,68,0.28)] hover:bg-destructive/90",children:o(l?"deleteConfirm.confirmWithAutomations":"deleteConfirm.confirm")})]})]})})}function zM(e,t,n){return e.schedule.kind==="at"&&e.schedule.at_ms?t("deleteConfirm.schedule.at",{time:$r(e.schedule.at_ms,n)}):e.schedule.kind==="every"&&e.schedule.every_ms?t("deleteConfirm.schedule.every",{duration:UM(e.schedule.every_ms,n)}):e.schedule.kind==="cron"&&e.schedule.expr?e.schedule.tz?t("deleteConfirm.schedule.cronWithTz",{expr:e.schedule.expr,tz:e.schedule.tz}):t("deleteConfirm.schedule.cron",{expr:e.schedule.expr}):t("deleteConfirm.schedule.unknown")}function $M(e,t,n){if(!e.enabled)return t("deleteConfirm.next.disabled");const r=e.state.next_run_at_ms;return r?t("deleteConfirm.next.label",{time:$r(r,n)}):t("deleteConfirm.next.none")}function UM(e,t){const n=[["day",864e5],["hour",36e5],["minute",6e4],["second",1e3]];for(const[r,a]of n)if(e>=a&&e%a===0)return new Intl.NumberFormat(t,{style:"unit",unit:r,unitDisplay:"long",maximumFractionDigits:0}).format(e/a);return new Intl.NumberFormat(t,{style:"unit",unit:"minute",unitDisplay:"long",maximumFractionDigits:1}).format(e/6e4)}const Yi=hu,BM=gu,M0=u.forwardRef(({className:e,...t},n)=>s.jsx(hs,{ref:n,className:j("fixed inset-0 z-50 bg-black/60 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));M0.displayName=hs.displayName;const bs=u.forwardRef(({className:e,children:t,showCloseButton:n=!0,...r},a)=>s.jsxs(BM,{children:[s.jsx(M0,{}),s.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:s.jsxs(gs,{ref:a,className:j("grid w-full max-w-lg origin-center gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 sm:rounded-lg",e),...r,children:[t,n?s.jsxs(Vi,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none",children:[s.jsx(xr,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Close"})]}):null]})})]}));bs.displayName=gs.displayName;const Qi=({className:e,...t})=>s.jsx("div",{className:j("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Qi.displayName="DialogHeader";const Xi=({className:e,...t})=>s.jsx("div",{className:j("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Xi.displayName="DialogFooter";const ws=u.forwardRef(({className:e,...t},n)=>s.jsx(vs,{ref:n,className:j("text-lg font-semibold leading-none tracking-tight",e),...t}));ws.displayName=vs.displayName;const Ji=u.forwardRef(({className:e,...t},n)=>s.jsx(Ki,{ref:n,className:j("text-sm text-muted-foreground",e),...t}));Ji.displayName=Ki.displayName;const Ye=u.forwardRef(({className:e,type:t,...n},r)=>s.jsx("input",{type:t,className:j("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...n}));Ye.displayName="Input";function Gg({open:e,title:t,dialogTitle:n,description:r,placeholder:a,onCancel:o,onConfirm:i}){const{t:l}=ie(),[c,d]=u.useState(t);u.useEffect(()=>{e&&d(t)},[e,t]);const p=c.trim();return s.jsx(Yi,{open:e,onOpenChange:m=>{m||o()},children:s.jsx(bs,{className:"max-w-sm rounded-[22px] border-border/70 bg-popover p-5 shadow-2xl",children:s.jsxs("form",{className:"grid gap-4",onSubmit:m=>{m.preventDefault(),p&&i(p)},children:[s.jsxs(Qi,{className:"text-left",children:[s.jsx(ws,{children:n??l("chat.renameTitle")}),s.jsx(Ji,{children:r??l("chat.renameDescription")})]}),s.jsx(Ye,{value:c,onChange:m=>d(m.target.value),placeholder:a??l("chat.renamePlaceholder"),autoFocus:!0,maxLength:160}),s.jsxs(Xi,{className:"gap-2 sm:space-x-0",children:[s.jsx(fe,{type:"button",variant:"outline",onClick:o,children:l("deleteConfirm.cancel")}),s.jsx(fe,{type:"submit",disabled:!p,children:l("chat.renameSave")})]})]})})})}function Yg(e){const t=HM(e),n=u.forwardRef((r,a)=>{const{children:o,...i}=r,l=u.Children.toArray(o),c=l.find(qM);if(c){const d=c.props.children,p=l.map(m=>m===c?u.Children.count(d)>1?u.Children.only(null):u.isValidElement(d)?d.props.children:null:m);return s.jsx(t,{...i,ref:a,children:u.isValidElement(d)?u.cloneElement(d,void 0,p):null})}return s.jsx(t,{...i,ref:a,children:o})});return n.displayName=`${e}.Slot`,n}function HM(e){const t=u.forwardRef((n,r)=>{const{children:a,...o}=n;if(u.isValidElement(a)){const i=VM(a),l=KM(o,a.props);return a.type!==u.Fragment&&(l.ref=r?_a(r,i):i),u.cloneElement(a,l)}return u.Children.count(a)>1?u.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var WM=Symbol("radix.slottable");function qM(e){return u.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===WM}function KM(e,t){const n={...t};for(const r in t){const a=e[r],o=t[r];/^on[A-Z]/.test(r)?a&&o?n[r]=(...l)=>{const c=o(...l);return a(...l),c}:a&&(n[r]=a):r==="style"?n[r]={...a,...o}:r==="className"&&(n[r]=[a,o].filter(Boolean).join(" "))}return{...e,...n}}function VM(e){var r,a;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function E0(e){const t=e+"CollectionProvider",[n,r]=Aa(t),[a,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=x=>{const{scope:b,children:v}=x,g=Pa.useRef(null),w=Pa.useRef(new Map).current;return s.jsx(a,{scope:b,itemMap:w,collectionRef:g,children:v})};i.displayName=t;const l=e+"CollectionSlot",c=Yg(l),d=Pa.forwardRef((x,b)=>{const{scope:v,children:g}=x,w=o(l,v),k=wt(b,w.collectionRef);return s.jsx(c,{ref:k,children:g})});d.displayName=l;const p=e+"CollectionItemSlot",m="data-radix-collection-item",f=Yg(p),h=Pa.forwardRef((x,b)=>{const{scope:v,children:g,...w}=x,k=Pa.useRef(null),C=wt(b,k),N=o(p,v);return Pa.useEffect(()=>(N.itemMap.set(k,{ref:k,...w}),()=>void N.itemMap.delete(k))),s.jsx(f,{[m]:"",ref:C,children:g})});h.displayName=p;function y(x){const b=o(e+"CollectionConsumer",x);return Pa.useCallback(()=>{const g=b.collectionRef.current;if(!g)return[];const w=Array.from(g.querySelectorAll(`[${m}]`));return Array.from(b.itemMap.values()).sort((N,S)=>w.indexOf(N.ref.current)-w.indexOf(S.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:i,Slot:d,ItemSlot:h},y,r]}var GM=u.createContext(void 0);function I0(e){const t=u.useContext(GM);return e||t||"ltr"}const YM=["top","right","bottom","left"],wa=Math.min,jn=Math.max,Ic=Math.round,Pl=Math.floor,vr=e=>({x:e,y:e}),QM={left:"right",right:"left",bottom:"top",top:"bottom"};function Jp(e,t,n){return jn(e,wa(t,n))}function Ur(e,t){return typeof e=="function"?e(t):e}function Br(e){return e.split("-")[0]}function ks(e){return e.split("-")[1]}function _f(e){return e==="x"?"y":"x"}function Pf(e){return e==="y"?"height":"width"}function fr(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Tf(e){return _f(fr(e))}function XM(e,t,n){n===void 0&&(n=!1);const r=ks(e),a=Tf(e),o=Pf(a);let i=a==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(i=Lc(i)),[i,Lc(i)]}function JM(e){const t=Lc(e);return[Zp(e),t,Zp(t)]}function Zp(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Qg=["left","right"],Xg=["right","left"],ZM=["top","bottom"],eE=["bottom","top"];function tE(e,t,n){switch(e){case"top":case"bottom":return n?t?Xg:Qg:t?Qg:Xg;case"left":case"right":return t?ZM:eE;default:return[]}}function nE(e,t,n,r){const a=ks(e);let o=tE(Br(e),n==="start",r);return a&&(o=o.map(i=>i+"-"+a),t&&(o=o.concat(o.map(Zp)))),o}function Lc(e){const t=Br(e);return QM[t]+e.slice(t.length)}function rE(e){return{top:0,right:0,bottom:0,left:0,...e}}function L0(e){return typeof e!="number"?rE(e):{top:e,right:e,bottom:e,left:e}}function Dc(e){const{x:t,y:n,width:r,height:a}=e;return{width:r,height:a,top:n,left:t,right:t+r,bottom:n+a,x:t,y:n}}function Jg(e,t,n){let{reference:r,floating:a}=e;const o=fr(t),i=Tf(t),l=Pf(i),c=Br(t),d=o==="y",p=r.x+r.width/2-a.width/2,m=r.y+r.height/2-a.height/2,f=r[l]/2-a[l]/2;let h;switch(c){case"top":h={x:p,y:r.y-a.height};break;case"bottom":h={x:p,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:m};break;case"left":h={x:r.x-a.width,y:m};break;default:h={x:r.x,y:r.y}}switch(ks(t)){case"start":h[i]-=f*(n&&d?-1:1);break;case"end":h[i]+=f*(n&&d?-1:1);break}return h}async function aE(e,t){var n;t===void 0&&(t={});const{x:r,y:a,platform:o,rects:i,elements:l,strategy:c}=e,{boundary:d="clippingAncestors",rootBoundary:p="viewport",elementContext:m="floating",altBoundary:f=!1,padding:h=0}=Ur(t,e),y=L0(h),b=l[f?m==="floating"?"reference":"floating":m],v=Dc(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(b)))==null||n?b:b.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(l.floating)),boundary:d,rootBoundary:p,strategy:c})),g=m==="floating"?{x:r,y:a,width:i.floating.width,height:i.floating.height}:i.reference,w=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l.floating)),k=await(o.isElement==null?void 0:o.isElement(w))?await(o.getScale==null?void 0:o.getScale(w))||{x:1,y:1}:{x:1,y:1},C=Dc(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:g,offsetParent:w,strategy:c}):g);return{top:(v.top-C.top+y.top)/k.y,bottom:(C.bottom-v.bottom+y.bottom)/k.y,left:(v.left-C.left+y.left)/k.x,right:(C.right-v.right+y.right)/k.x}}const oE=50,sE=async(e,t,n)=>{const{placement:r="bottom",strategy:a="absolute",middleware:o=[],platform:i}=n,l=i.detectOverflow?i:{...i,detectOverflow:aE},c=await(i.isRTL==null?void 0:i.isRTL(t));let d=await i.getElementRects({reference:e,floating:t,strategy:a}),{x:p,y:m}=Jg(d,r,c),f=r,h=0;const y={};for(let x=0;x<o.length;x++){const b=o[x];if(!b)continue;const{name:v,fn:g}=b,{x:w,y:k,data:C,reset:N}=await g({x:p,y:m,initialPlacement:r,placement:f,strategy:a,middlewareData:y,rects:d,platform:l,elements:{reference:e,floating:t}});p=w??p,m=k??m,y[v]={...y[v],...C},N&&h<oE&&(h++,typeof N=="object"&&(N.placement&&(f=N.placement),N.rects&&(d=N.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:a}):N.rects),{x:p,y:m}=Jg(d,f,c)),x=-1)}return{x:p,y:m,placement:f,strategy:a,middlewareData:y}},iE=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:a,rects:o,platform:i,elements:l,middlewareData:c}=t,{element:d,padding:p=0}=Ur(e,t)||{};if(d==null)return{};const m=L0(p),f={x:n,y:r},h=Tf(a),y=Pf(h),x=await i.getDimensions(d),b=h==="y",v=b?"top":"left",g=b?"bottom":"right",w=b?"clientHeight":"clientWidth",k=o.reference[y]+o.reference[h]-f[h]-o.floating[y],C=f[h]-o.reference[h],N=await(i.getOffsetParent==null?void 0:i.getOffsetParent(d));let S=N?N[w]:0;(!S||!await(i.isElement==null?void 0:i.isElement(N)))&&(S=l.floating[w]||o.floating[y]);const A=k/2-C/2,E=S/2-x[y]/2-1,_=wa(m[v],E),R=wa(m[g],E),T=_,F=S-x[y]-R,z=S/2-x[y]/2+A,K=Jp(T,z,F),$=!c.arrow&&ks(a)!=null&&z!==K&&o.reference[y]/2-(z<T?_:R)-x[y]/2<0,W=$?z<T?z-T:z-F:0;return{[h]:f[h]+W,data:{[h]:K,centerOffset:z-K-W,...$&&{alignmentOffset:W}},reset:$}}}),lE=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:a,middlewareData:o,rects:i,initialPlacement:l,platform:c,elements:d}=t,{mainAxis:p=!0,crossAxis:m=!0,fallbackPlacements:f,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:x=!0,...b}=Ur(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const v=Br(a),g=fr(l),w=Br(l)===l,k=await(c.isRTL==null?void 0:c.isRTL(d.floating)),C=f||(w||!x?[Lc(l)]:JM(l)),N=y!=="none";!f&&N&&C.push(...nE(l,x,y,k));const S=[l,...C],A=await c.detectOverflow(t,b),E=[];let _=((r=o.flip)==null?void 0:r.overflows)||[];if(p&&E.push(A[v]),m){const z=XM(a,i,k);E.push(A[z[0]],A[z[1]])}if(_=[..._,{placement:a,overflows:E}],!E.every(z=>z<=0)){var R,T;const z=(((R=o.flip)==null?void 0:R.index)||0)+1,K=S[z];if(K&&(!(m==="alignment"?g!==fr(K):!1)||_.every(P=>fr(P.placement)===g?P.overflows[0]>0:!0)))return{data:{index:z,overflows:_},reset:{placement:K}};let $=(T=_.filter(W=>W.overflows[0]<=0).sort((W,P)=>W.overflows[1]-P.overflows[1])[0])==null?void 0:T.placement;if(!$)switch(h){case"bestFit":{var F;const W=(F=_.filter(P=>{if(N){const D=fr(P.placement);return D===g||D==="y"}return!0}).map(P=>[P.placement,P.overflows.filter(D=>D>0).reduce((D,G)=>D+G,0)]).sort((P,D)=>P[1]-D[1])[0])==null?void 0:F[0];W&&($=W);break}case"initialPlacement":$=l;break}if(a!==$)return{reset:{placement:$}}}return{}}}};function Zg(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ev(e){return YM.some(t=>e[t]>=0)}const cE=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:a="referenceHidden",...o}=Ur(e,t);switch(a){case"referenceHidden":{const i=await r.detectOverflow(t,{...o,elementContext:"reference"}),l=Zg(i,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:ev(l)}}}case"escaped":{const i=await r.detectOverflow(t,{...o,altBoundary:!0}),l=Zg(i,n.floating);return{data:{escapedOffsets:l,escaped:ev(l)}}}default:return{}}}}},D0=new Set(["left","top"]);async function uE(e,t){const{placement:n,platform:r,elements:a}=e,o=await(r.isRTL==null?void 0:r.isRTL(a.floating)),i=Br(n),l=ks(n),c=fr(n)==="y",d=D0.has(i)?-1:1,p=o&&c?-1:1,m=Ur(t,e);let{mainAxis:f,crossAxis:h,alignmentAxis:y}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};return l&&typeof y=="number"&&(h=l==="end"?y*-1:y),c?{x:h*p,y:f*d}:{x:f*d,y:h*p}}const dE=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:a,y:o,placement:i,middlewareData:l}=t,c=await uE(t,e);return i===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:a+c.x,y:o+c.y,data:{...c,placement:i}}}}},pE=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:a,platform:o}=t,{mainAxis:i=!0,crossAxis:l=!1,limiter:c={fn:v=>{let{x:g,y:w}=v;return{x:g,y:w}}},...d}=Ur(e,t),p={x:n,y:r},m=await o.detectOverflow(t,d),f=fr(Br(a)),h=_f(f);let y=p[h],x=p[f];if(i){const v=h==="y"?"top":"left",g=h==="y"?"bottom":"right",w=y+m[v],k=y-m[g];y=Jp(w,y,k)}if(l){const v=f==="y"?"top":"left",g=f==="y"?"bottom":"right",w=x+m[v],k=x-m[g];x=Jp(w,x,k)}const b=c.fn({...t,[h]:y,[f]:x});return{...b,data:{x:b.x-n,y:b.y-r,enabled:{[h]:i,[f]:l}}}}}},mE=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:a,rects:o,middlewareData:i}=t,{offset:l=0,mainAxis:c=!0,crossAxis:d=!0}=Ur(e,t),p={x:n,y:r},m=fr(a),f=_f(m);let h=p[f],y=p[m];const x=Ur(l,t),b=typeof x=="number"?{mainAxis:x,crossAxis:0}:{mainAxis:0,crossAxis:0,...x};if(c){const w=f==="y"?"height":"width",k=o.reference[f]-o.floating[w]+b.mainAxis,C=o.reference[f]+o.reference[w]-b.mainAxis;h<k?h=k:h>C&&(h=C)}if(d){var v,g;const w=f==="y"?"width":"height",k=D0.has(Br(a)),C=o.reference[m]-o.floating[w]+(k&&((v=i.offset)==null?void 0:v[m])||0)+(k?0:b.crossAxis),N=o.reference[m]+o.reference[w]+(k?0:((g=i.offset)==null?void 0:g[m])||0)-(k?b.crossAxis:0);y<C?y=C:y>N&&(y=N)}return{[f]:h,[m]:y}}}},fE=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:a,rects:o,platform:i,elements:l}=t,{apply:c=()=>{},...d}=Ur(e,t),p=await i.detectOverflow(t,d),m=Br(a),f=ks(a),h=fr(a)==="y",{width:y,height:x}=o.floating;let b,v;m==="top"||m==="bottom"?(b=m,v=f===(await(i.isRTL==null?void 0:i.isRTL(l.floating))?"start":"end")?"left":"right"):(v=m,b=f==="end"?"top":"bottom");const g=x-p.top-p.bottom,w=y-p.left-p.right,k=wa(x-p[b],g),C=wa(y-p[v],w),N=!t.middlewareData.shift;let S=k,A=C;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(A=w),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(S=g),N&&!f){const _=jn(p.left,0),R=jn(p.right,0),T=jn(p.top,0),F=jn(p.bottom,0);h?A=y-2*(_!==0||R!==0?_+R:jn(p.left,p.right)):S=x-2*(T!==0||F!==0?T+F:jn(p.top,p.bottom))}await c({...t,availableWidth:A,availableHeight:S});const E=await i.getDimensions(l.floating);return y!==E.width||x!==E.height?{reset:{rects:!0}}:{}}}};function vu(){return typeof window<"u"}function Cs(e){return O0(e)?(e.nodeName||"").toLowerCase():"#document"}function Tn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function wr(e){var t;return(t=(O0(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function O0(e){return vu()?e instanceof Node||e instanceof Tn(e).Node:!1}function Zn(e){return vu()?e instanceof Element||e instanceof Tn(e).Element:!1}function Kr(e){return vu()?e instanceof HTMLElement||e instanceof Tn(e).HTMLElement:!1}function tv(e){return!vu()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Tn(e).ShadowRoot}function Zi(e){const{overflow:t,overflowX:n,overflowY:r,display:a}=er(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&a!=="inline"&&a!=="contents"}function hE(e){return/^(table|td|th)$/.test(Cs(e))}function xu(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const gE=/transform|translate|scale|rotate|perspective|filter/,vE=/paint|layout|strict|content/,Ta=e=>!!e&&e!=="none";let Ad;function Rf(e){const t=Zn(e)?er(e):e;return Ta(t.transform)||Ta(t.translate)||Ta(t.scale)||Ta(t.rotate)||Ta(t.perspective)||!Mf()&&(Ta(t.backdropFilter)||Ta(t.filter))||gE.test(t.willChange||"")||vE.test(t.contain||"")}function xE(e){let t=ka(e);for(;Kr(t)&&!rs(t);){if(Rf(t))return t;if(xu(t))return null;t=ka(t)}return null}function Mf(){return Ad==null&&(Ad=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Ad}function rs(e){return/^(html|body|#document)$/.test(Cs(e))}function er(e){return Tn(e).getComputedStyle(e)}function yu(e){return Zn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ka(e){if(Cs(e)==="html")return e;const t=e.assignedSlot||e.parentNode||tv(e)&&e.host||wr(e);return tv(t)?t.host:t}function F0(e){const t=ka(e);return rs(t)?e.ownerDocument?e.ownerDocument.body:e.body:Kr(t)&&Zi(t)?t:F0(t)}function _i(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const a=F0(e),o=a===((r=e.ownerDocument)==null?void 0:r.body),i=Tn(a);if(o){const l=em(i);return t.concat(i,i.visualViewport||[],Zi(a)?a:[],l&&n?_i(l):[])}else return t.concat(a,_i(a,[],n))}function em(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function z0(e){const t=er(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const a=Kr(e),o=a?e.offsetWidth:n,i=a?e.offsetHeight:r,l=Ic(n)!==o||Ic(r)!==i;return l&&(n=o,r=i),{width:n,height:r,$:l}}function Ef(e){return Zn(e)?e:e.contextElement}function qo(e){const t=Ef(e);if(!Kr(t))return vr(1);const n=t.getBoundingClientRect(),{width:r,height:a,$:o}=z0(t);let i=(o?Ic(n.width):n.width)/r,l=(o?Ic(n.height):n.height)/a;return(!i||!Number.isFinite(i))&&(i=1),(!l||!Number.isFinite(l))&&(l=1),{x:i,y:l}}const yE=vr(0);function $0(e){const t=Tn(e);return!Mf()||!t.visualViewport?yE:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function bE(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Tn(e)?!1:t}function Xa(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),o=Ef(e);let i=vr(1);t&&(r?Zn(r)&&(i=qo(r)):i=qo(e));const l=bE(o,n,r)?$0(o):vr(0);let c=(a.left+l.x)/i.x,d=(a.top+l.y)/i.y,p=a.width/i.x,m=a.height/i.y;if(o){const f=Tn(o),h=r&&Zn(r)?Tn(r):r;let y=f,x=em(y);for(;x&&r&&h!==y;){const b=qo(x),v=x.getBoundingClientRect(),g=er(x),w=v.left+(x.clientLeft+parseFloat(g.paddingLeft))*b.x,k=v.top+(x.clientTop+parseFloat(g.paddingTop))*b.y;c*=b.x,d*=b.y,p*=b.x,m*=b.y,c+=w,d+=k,y=Tn(x),x=em(y)}}return Dc({width:p,height:m,x:c,y:d})}function bu(e,t){const n=yu(e).scrollLeft;return t?t.left+n:Xa(wr(e)).left+n}function U0(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-bu(e,n),a=n.top+t.scrollTop;return{x:r,y:a}}function wE(e){let{elements:t,rect:n,offsetParent:r,strategy:a}=e;const o=a==="fixed",i=wr(r),l=t?xu(t.floating):!1;if(r===i||l&&o)return n;let c={scrollLeft:0,scrollTop:0},d=vr(1);const p=vr(0),m=Kr(r);if((m||!m&&!o)&&((Cs(r)!=="body"||Zi(i))&&(c=yu(r)),m)){const h=Xa(r);d=qo(r),p.x=h.x+r.clientLeft,p.y=h.y+r.clientTop}const f=i&&!m&&!o?U0(i,c):vr(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-c.scrollLeft*d.x+p.x+f.x,y:n.y*d.y-c.scrollTop*d.y+p.y+f.y}}function kE(e){return Array.from(e.getClientRects())}function CE(e){const t=wr(e),n=yu(e),r=e.ownerDocument.body,a=jn(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=jn(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+bu(e);const l=-n.scrollTop;return er(r).direction==="rtl"&&(i+=jn(t.clientWidth,r.clientWidth)-a),{width:a,height:o,x:i,y:l}}const nv=25;function SE(e,t){const n=Tn(e),r=wr(e),a=n.visualViewport;let o=r.clientWidth,i=r.clientHeight,l=0,c=0;if(a){o=a.width,i=a.height;const p=Mf();(!p||p&&t==="fixed")&&(l=a.offsetLeft,c=a.offsetTop)}const d=bu(r);if(d<=0){const p=r.ownerDocument,m=p.body,f=getComputedStyle(m),h=p.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,y=Math.abs(r.clientWidth-m.clientWidth-h);y<=nv&&(o-=y)}else d<=nv&&(o+=d);return{width:o,height:i,x:l,y:c}}function NE(e,t){const n=Xa(e,!0,t==="fixed"),r=n.top+e.clientTop,a=n.left+e.clientLeft,o=Kr(e)?qo(e):vr(1),i=e.clientWidth*o.x,l=e.clientHeight*o.y,c=a*o.x,d=r*o.y;return{width:i,height:l,x:c,y:d}}function rv(e,t,n){let r;if(t==="viewport")r=SE(e,n);else if(t==="document")r=CE(wr(e));else if(Zn(t))r=NE(t,n);else{const a=$0(e);r={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return Dc(r)}function B0(e,t){const n=ka(e);return n===t||!Zn(n)||rs(n)?!1:er(n).position==="fixed"||B0(n,t)}function jE(e,t){const n=t.get(e);if(n)return n;let r=_i(e,[],!1).filter(l=>Zn(l)&&Cs(l)!=="body"),a=null;const o=er(e).position==="fixed";let i=o?ka(e):e;for(;Zn(i)&&!rs(i);){const l=er(i),c=Rf(i);!c&&l.position==="fixed"&&(a=null),(o?!c&&!a:!c&&l.position==="static"&&!!a&&(a.position==="absolute"||a.position==="fixed")||Zi(i)&&!c&&B0(e,i))?r=r.filter(p=>p!==i):a=l,i=ka(i)}return t.set(e,r),r}function AE(e){let{element:t,boundary:n,rootBoundary:r,strategy:a}=e;const i=[...n==="clippingAncestors"?xu(t)?[]:jE(t,this._c):[].concat(n),r],l=rv(t,i[0],a);let c=l.top,d=l.right,p=l.bottom,m=l.left;for(let f=1;f<i.length;f++){const h=rv(t,i[f],a);c=jn(h.top,c),d=wa(h.right,d),p=wa(h.bottom,p),m=jn(h.left,m)}return{width:d-m,height:p-c,x:m,y:c}}function _E(e){const{width:t,height:n}=z0(e);return{width:t,height:n}}function PE(e,t,n){const r=Kr(t),a=wr(t),o=n==="fixed",i=Xa(e,!0,o,t);let l={scrollLeft:0,scrollTop:0};const c=vr(0);function d(){c.x=bu(a)}if(r||!r&&!o)if((Cs(t)!=="body"||Zi(a))&&(l=yu(t)),r){const h=Xa(t,!0,o,t);c.x=h.x+t.clientLeft,c.y=h.y+t.clientTop}else a&&d();o&&!r&&a&&d();const p=a&&!r&&!o?U0(a,l):vr(0),m=i.left+l.scrollLeft-c.x-p.x,f=i.top+l.scrollTop-c.y-p.y;return{x:m,y:f,width:i.width,height:i.height}}function _d(e){return er(e).position==="static"}function av(e,t){if(!Kr(e)||er(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return wr(e)===n&&(n=n.ownerDocument.body),n}function H0(e,t){const n=Tn(e);if(xu(e))return n;if(!Kr(e)){let a=ka(e);for(;a&&!rs(a);){if(Zn(a)&&!_d(a))return a;a=ka(a)}return n}let r=av(e,t);for(;r&&hE(r)&&_d(r);)r=av(r,t);return r&&rs(r)&&_d(r)&&!Rf(r)?n:r||xE(e)||n}const TE=async function(e){const t=this.getOffsetParent||H0,n=this.getDimensions,r=await n(e.floating);return{reference:PE(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function RE(e){return er(e).direction==="rtl"}const ME={convertOffsetParentRelativeRectToViewportRelativeRect:wE,getDocumentElement:wr,getClippingRect:AE,getOffsetParent:H0,getElementRects:TE,getClientRects:kE,getDimensions:_E,getScale:qo,isElement:Zn,isRTL:RE};function W0(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function EE(e,t){let n=null,r;const a=wr(e);function o(){var l;clearTimeout(r),(l=n)==null||l.disconnect(),n=null}function i(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),o();const d=e.getBoundingClientRect(),{left:p,top:m,width:f,height:h}=d;if(l||t(),!f||!h)return;const y=Pl(m),x=Pl(a.clientWidth-(p+f)),b=Pl(a.clientHeight-(m+h)),v=Pl(p),w={rootMargin:-y+"px "+-x+"px "+-b+"px "+-v+"px",threshold:jn(0,wa(1,c))||1};let k=!0;function C(N){const S=N[0].intersectionRatio;if(S!==c){if(!k)return i();S?i(!1,S):r=setTimeout(()=>{i(!1,1e-7)},1e3)}S===1&&!W0(d,e.getBoundingClientRect())&&i(),k=!1}try{n=new IntersectionObserver(C,{...w,root:a.ownerDocument})}catch{n=new IntersectionObserver(C,w)}n.observe(e)}return i(!0),o}function IE(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:a=!0,ancestorResize:o=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,d=Ef(e),p=a||o?[...d?_i(d):[],...t?_i(t):[]]:[];p.forEach(v=>{a&&v.addEventListener("scroll",n,{passive:!0}),o&&v.addEventListener("resize",n)});const m=d&&l?EE(d,n):null;let f=-1,h=null;i&&(h=new ResizeObserver(v=>{let[g]=v;g&&g.target===d&&h&&t&&(h.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var w;(w=h)==null||w.observe(t)})),n()}),d&&!c&&h.observe(d),t&&h.observe(t));let y,x=c?Xa(e):null;c&&b();function b(){const v=Xa(e);x&&!W0(x,v)&&n(),x=v,y=requestAnimationFrame(b)}return n(),()=>{var v;p.forEach(g=>{a&&g.removeEventListener("scroll",n),o&&g.removeEventListener("resize",n)}),m==null||m(),(v=h)==null||v.disconnect(),h=null,c&&cancelAnimationFrame(y)}}const LE=dE,DE=pE,OE=lE,FE=fE,zE=cE,ov=iE,$E=mE,UE=(e,t,n)=>{const r=new Map,a={platform:ME,...n},o={...a.platform,_c:r};return sE(e,t,{...a,platform:o})};var BE=typeof document<"u",HE=function(){},Xl=BE?u.useLayoutEffect:HE;function Oc(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,a;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Oc(e[r],t[r]))return!1;return!0}if(a=Object.keys(e),n=a.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,a[r]))return!1;for(r=n;r--!==0;){const o=a[r];if(!(o==="_owner"&&e.$$typeof)&&!Oc(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function q0(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function sv(e,t){const n=q0(e);return Math.round(t*n)/n}function Pd(e){const t=u.useRef(e);return Xl(()=>{t.current=e}),t}function WE(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:a,elements:{reference:o,floating:i}={},transform:l=!0,whileElementsMounted:c,open:d}=e,[p,m]=u.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,h]=u.useState(r);Oc(f,r)||h(r);const[y,x]=u.useState(null),[b,v]=u.useState(null),g=u.useCallback(P=>{P!==N.current&&(N.current=P,x(P))},[]),w=u.useCallback(P=>{P!==S.current&&(S.current=P,v(P))},[]),k=o||y,C=i||b,N=u.useRef(null),S=u.useRef(null),A=u.useRef(p),E=c!=null,_=Pd(c),R=Pd(a),T=Pd(d),F=u.useCallback(()=>{if(!N.current||!S.current)return;const P={placement:t,strategy:n,middleware:f};R.current&&(P.platform=R.current),UE(N.current,S.current,P).then(D=>{const G={...D,isPositioned:T.current!==!1};z.current&&!Oc(A.current,G)&&(A.current=G,lu.flushSync(()=>{m(G)}))})},[f,t,n,R,T]);Xl(()=>{d===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,m(P=>({...P,isPositioned:!1})))},[d]);const z=u.useRef(!1);Xl(()=>(z.current=!0,()=>{z.current=!1}),[]),Xl(()=>{if(k&&(N.current=k),C&&(S.current=C),k&&C){if(_.current)return _.current(k,C,F);F()}},[k,C,F,_,E]);const K=u.useMemo(()=>({reference:N,floating:S,setReference:g,setFloating:w}),[g,w]),$=u.useMemo(()=>({reference:k,floating:C}),[k,C]),W=u.useMemo(()=>{const P={position:n,left:0,top:0};if(!$.floating)return P;const D=sv($.floating,p.x),G=sv($.floating,p.y);return l?{...P,transform:"translate("+D+"px, "+G+"px)",...q0($.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:D,top:G}},[n,l,$.floating,p.x,p.y]);return u.useMemo(()=>({...p,update:F,refs:K,elements:$,floatingStyles:W}),[p,F,K,$,W])}const qE=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:a}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?ov({element:r.current,padding:a}).fn(n):{}:r?ov({element:r,padding:a}).fn(n):{}}}},KE=(e,t)=>{const n=LE(e);return{name:n.name,fn:n.fn,options:[e,t]}},VE=(e,t)=>{const n=DE(e);return{name:n.name,fn:n.fn,options:[e,t]}},GE=(e,t)=>({fn:$E(e).fn,options:[e,t]}),YE=(e,t)=>{const n=OE(e);return{name:n.name,fn:n.fn,options:[e,t]}},QE=(e,t)=>{const n=FE(e);return{name:n.name,fn:n.fn,options:[e,t]}},XE=(e,t)=>{const n=zE(e);return{name:n.name,fn:n.fn,options:[e,t]}},JE=(e,t)=>{const n=qE(e);return{name:n.name,fn:n.fn,options:[e,t]}};var ZE="Arrow",K0=u.forwardRef((e,t)=>{const{children:n,width:r=10,height:a=5,...o}=e;return s.jsx(xt.svg,{...o,ref:t,width:r,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:s.jsx("polygon",{points:"0,0 30,0 15,10"})})});K0.displayName=ZE;var eI=K0;function tI(e){const[t,n]=u.useState(void 0);return ba(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;const o=a[0];let i,l;if("borderBoxSize"in o){const c=o.borderBoxSize,d=Array.isArray(c)?c[0]:c;i=d.inlineSize,l=d.blockSize}else i=e.offsetWidth,l=e.offsetHeight;n({width:i,height:l})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var If="Popper",[V0,wu]=Aa(If),[nI,G0]=V0(If),Y0=e=>{const{__scopePopper:t,children:n}=e,[r,a]=u.useState(null);return s.jsx(nI,{scope:t,anchor:r,onAnchorChange:a,children:n})};Y0.displayName=If;var Q0="PopperAnchor",X0=u.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...a}=e,o=G0(Q0,n),i=u.useRef(null),l=wt(t,i),c=u.useRef(null);return u.useEffect(()=>{const d=c.current;c.current=(r==null?void 0:r.current)||i.current,d!==c.current&&o.onAnchorChange(c.current)}),r?null:s.jsx(xt.div,{...a,ref:l})});X0.displayName=Q0;var Lf="PopperContent",[rI,aI]=V0(Lf),J0=u.forwardRef((e,t)=>{var Q,O,ne,he,ve,me;const{__scopePopper:n,side:r="bottom",sideOffset:a=0,align:o="center",alignOffset:i=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:d=[],collisionPadding:p=0,sticky:m="partial",hideWhenDetached:f=!1,updatePositionStrategy:h="optimized",onPlaced:y,...x}=e,b=G0(Lf,n),[v,g]=u.useState(null),w=wt(t,ee=>g(ee)),[k,C]=u.useState(null),N=tI(k),S=(N==null?void 0:N.width)??0,A=(N==null?void 0:N.height)??0,E=r+(o!=="center"?"-"+o:""),_=typeof p=="number"?p:{top:0,right:0,bottom:0,left:0,...p},R=Array.isArray(d)?d:[d],T=R.length>0,F={padding:_,boundary:R.filter(sI),altBoundary:T},{refs:z,floatingStyles:K,placement:$,isPositioned:W,middlewareData:P}=WE({strategy:"fixed",placement:E,whileElementsMounted:(...ee)=>IE(...ee,{animationFrame:h==="always"}),elements:{reference:b.anchor},middleware:[KE({mainAxis:a+A,alignmentAxis:i}),c&&VE({mainAxis:!0,crossAxis:!1,limiter:m==="partial"?GE():void 0,...F}),c&&YE({...F}),QE({...F,apply:({elements:ee,rects:we,availableWidth:je,availableHeight:xe})=>{const{width:Ee,height:$e}=we.reference,Se=ee.floating.style;Se.setProperty("--radix-popper-available-width",`${je}px`),Se.setProperty("--radix-popper-available-height",`${xe}px`),Se.setProperty("--radix-popper-anchor-width",`${Ee}px`),Se.setProperty("--radix-popper-anchor-height",`${$e}px`)}}),k&&JE({element:k,padding:l}),iI({arrowWidth:S,arrowHeight:A}),f&&XE({strategy:"referenceHidden",...F})]}),[D,G]=tk($),Y=zr(y);ba(()=>{W&&(Y==null||Y())},[W,Y]);const oe=(Q=P.arrow)==null?void 0:Q.x,de=(O=P.arrow)==null?void 0:O.y,pe=((ne=P.arrow)==null?void 0:ne.centerOffset)!==0,[le,I]=u.useState();return ba(()=>{v&&I(window.getComputedStyle(v).zIndex)},[v]),s.jsx("div",{ref:z.setFloating,"data-radix-popper-content-wrapper":"",style:{...K,transform:W?K.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:le,"--radix-popper-transform-origin":[(he=P.transformOrigin)==null?void 0:he.x,(ve=P.transformOrigin)==null?void 0:ve.y].join(" "),...((me=P.hide)==null?void 0:me.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:s.jsx(rI,{scope:n,placedSide:D,onArrowChange:C,arrowX:oe,arrowY:de,shouldHideArrow:pe,children:s.jsx(xt.div,{"data-side":D,"data-align":G,...x,ref:w,style:{...x.style,animation:W?void 0:"none"}})})})});J0.displayName=Lf;var Z0="PopperArrow",oI={top:"bottom",right:"left",bottom:"top",left:"right"},ek=u.forwardRef(function(t,n){const{__scopePopper:r,...a}=t,o=aI(Z0,r),i=oI[o.placedSide];return s.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:s.jsx(eI,{...a,ref:n,style:{...a.style,display:"block"}})})});ek.displayName=Z0;function sI(e){return e!==null}var iI=e=>({name:"transformOrigin",options:e,fn(t){var b,v,g;const{placement:n,rects:r,middlewareData:a}=t,i=((b=a.arrow)==null?void 0:b.centerOffset)!==0,l=i?0:e.arrowWidth,c=i?0:e.arrowHeight,[d,p]=tk(n),m={start:"0%",center:"50%",end:"100%"}[p],f=(((v=a.arrow)==null?void 0:v.x)??0)+l/2,h=(((g=a.arrow)==null?void 0:g.y)??0)+c/2;let y="",x="";return d==="bottom"?(y=i?m:`${f}px`,x=`${-c}px`):d==="top"?(y=i?m:`${f}px`,x=`${r.floating.height+c}px`):d==="right"?(y=`${-c}px`,x=i?m:`${h}px`):d==="left"&&(y=`${r.floating.width+c}px`,x=i?m:`${h}px`),{data:{x:y,y:x}}}});function tk(e){const[t,n="center"]=e.split("-");return[t,n]}var nk=Y0,rk=X0,ak=J0,ok=ek,Td="rovingFocusGroup.onEntryFocus",lI={bubbles:!1,cancelable:!0},el="RovingFocusGroup",[tm,sk,cI]=E0(el),[uI,ik]=Aa(el,[cI]),[dI,pI]=uI(el),lk=u.forwardRef((e,t)=>s.jsx(tm.Provider,{scope:e.__scopeRovingFocusGroup,children:s.jsx(tm.Slot,{scope:e.__scopeRovingFocusGroup,children:s.jsx(mI,{...e,ref:t})})}));lk.displayName=el;var mI=u.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:a=!1,dir:o,currentTabStopId:i,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:d,preventScrollOnEntryFocus:p=!1,...m}=e,f=u.useRef(null),h=wt(t,f),y=I0(o),[x,b]=uu({prop:i,defaultProp:l??null,onChange:c,caller:el}),[v,g]=u.useState(!1),w=zr(d),k=sk(n),C=u.useRef(!1),[N,S]=u.useState(0);return u.useEffect(()=>{const A=f.current;if(A)return A.addEventListener(Td,w),()=>A.removeEventListener(Td,w)},[w]),s.jsx(dI,{scope:n,orientation:r,dir:y,loop:a,currentTabStopId:x,onItemFocus:u.useCallback(A=>b(A),[b]),onItemShiftTab:u.useCallback(()=>g(!0),[]),onFocusableItemAdd:u.useCallback(()=>S(A=>A+1),[]),onFocusableItemRemove:u.useCallback(()=>S(A=>A-1),[]),children:s.jsx(xt.div,{tabIndex:v||N===0?-1:0,"data-orientation":r,...m,ref:h,style:{outline:"none",...e.style},onMouseDown:Re(e.onMouseDown,()=>{C.current=!0}),onFocus:Re(e.onFocus,A=>{const E=!C.current;if(A.target===A.currentTarget&&E&&!v){const _=new CustomEvent(Td,lI);if(A.currentTarget.dispatchEvent(_),!_.defaultPrevented){const R=k().filter($=>$.focusable),T=R.find($=>$.active),F=R.find($=>$.id===x),K=[T,F,...R].filter(Boolean).map($=>$.ref.current);dk(K,p)}}C.current=!1}),onBlur:Re(e.onBlur,()=>g(!1))})})}),ck="RovingFocusGroupItem",uk=u.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:a=!1,tabStopId:o,children:i,...l}=e,c=$a(),d=o||c,p=pI(ck,n),m=p.currentTabStopId===d,f=sk(n),{onFocusableItemAdd:h,onFocusableItemRemove:y,currentTabStopId:x}=p;return u.useEffect(()=>{if(r)return h(),()=>y()},[r,h,y]),s.jsx(tm.ItemSlot,{scope:n,id:d,focusable:r,active:a,children:s.jsx(xt.span,{tabIndex:m?0:-1,"data-orientation":p.orientation,...l,ref:t,onMouseDown:Re(e.onMouseDown,b=>{r?p.onItemFocus(d):b.preventDefault()}),onFocus:Re(e.onFocus,()=>p.onItemFocus(d)),onKeyDown:Re(e.onKeyDown,b=>{if(b.key==="Tab"&&b.shiftKey){p.onItemShiftTab();return}if(b.target!==b.currentTarget)return;const v=gI(b,p.orientation,p.dir);if(v!==void 0){if(b.metaKey||b.ctrlKey||b.altKey||b.shiftKey)return;b.preventDefault();let w=f().filter(k=>k.focusable).map(k=>k.ref.current);if(v==="last")w.reverse();else if(v==="prev"||v==="next"){v==="prev"&&w.reverse();const k=w.indexOf(b.currentTarget);w=p.loop?vI(w,k+1):w.slice(k+1)}setTimeout(()=>dk(w))}}),children:typeof i=="function"?i({isCurrentTabStop:m,hasTabStop:x!=null}):i})})});uk.displayName=ck;var fI={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function hI(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function gI(e,t,n){const r=hI(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return fI[r]}function dk(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function vI(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var xI=lk,yI=uk;function bI(e){const t=wI(e),n=u.forwardRef((r,a)=>{const{children:o,...i}=r,l=u.Children.toArray(o),c=l.find(CI);if(c){const d=c.props.children,p=l.map(m=>m===c?u.Children.count(d)>1?u.Children.only(null):u.isValidElement(d)?d.props.children:null:m);return s.jsx(t,{...i,ref:a,children:u.isValidElement(d)?u.cloneElement(d,void 0,p):null})}return s.jsx(t,{...i,ref:a,children:o})});return n.displayName=`${e}.Slot`,n}function wI(e){const t=u.forwardRef((n,r)=>{const{children:a,...o}=n;if(u.isValidElement(a)){const i=NI(a),l=SI(o,a.props);return a.type!==u.Fragment&&(l.ref=r?_a(r,i):i),u.cloneElement(a,l)}return u.Children.count(a)>1?u.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var kI=Symbol("radix.slottable");function CI(e){return u.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===kI}function SI(e,t){const n={...t};for(const r in t){const a=e[r],o=t[r];/^on[A-Z]/.test(r)?a&&o?n[r]=(...l)=>{const c=o(...l);return a(...l),c}:a&&(n[r]=a):r==="style"?n[r]={...a,...o}:r==="className"&&(n[r]=[a,o].filter(Boolean).join(" "))}return{...e,...n}}function NI(e){var r,a;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var nm=["Enter"," "],jI=["ArrowDown","PageUp","Home"],pk=["ArrowUp","PageDown","End"],AI=[...jI,...pk],_I={ltr:[...nm,"ArrowRight"],rtl:[...nm,"ArrowLeft"]},PI={ltr:["ArrowLeft"],rtl:["ArrowRight"]},tl="Menu",[Pi,TI,RI]=E0(tl),[ro,mk]=Aa(tl,[RI,wu,ik]),ku=wu(),fk=ik(),[MI,ao]=ro(tl),[EI,nl]=ro(tl),hk=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:a,onOpenChange:o,modal:i=!0}=e,l=ku(t),[c,d]=u.useState(null),p=u.useRef(!1),m=zr(o),f=I0(a);return u.useEffect(()=>{const h=()=>{p.current=!0,document.addEventListener("pointerdown",y,{capture:!0,once:!0}),document.addEventListener("pointermove",y,{capture:!0,once:!0})},y=()=>p.current=!1;return document.addEventListener("keydown",h,{capture:!0}),()=>{document.removeEventListener("keydown",h,{capture:!0}),document.removeEventListener("pointerdown",y,{capture:!0}),document.removeEventListener("pointermove",y,{capture:!0})}},[]),s.jsx(nk,{...l,children:s.jsx(MI,{scope:t,open:n,onOpenChange:m,content:c,onContentChange:d,children:s.jsx(EI,{scope:t,onClose:u.useCallback(()=>m(!1),[m]),isUsingKeyboardRef:p,dir:f,modal:i,children:r})})})};hk.displayName=tl;var II="MenuAnchor",Df=u.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,a=ku(n);return s.jsx(rk,{...a,...r,ref:t})});Df.displayName=II;var Of="MenuPortal",[LI,gk]=ro(Of,{forceMount:void 0}),vk=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:a}=e,o=ao(Of,t);return s.jsx(LI,{scope:t,forceMount:n,children:s.jsx(br,{present:n||o.open,children:s.jsx(pu,{asChild:!0,container:a,children:r})})})};vk.displayName=Of;var $n="MenuContent",[DI,Ff]=ro($n),xk=u.forwardRef((e,t)=>{const n=gk($n,e.__scopeMenu),{forceMount:r=n.forceMount,...a}=e,o=ao($n,e.__scopeMenu),i=nl($n,e.__scopeMenu);return s.jsx(Pi.Provider,{scope:e.__scopeMenu,children:s.jsx(br,{present:r||o.open,children:s.jsx(Pi.Slot,{scope:e.__scopeMenu,children:i.modal?s.jsx(OI,{...a,ref:t}):s.jsx(FI,{...a,ref:t})})})})}),OI=u.forwardRef((e,t)=>{const n=ao($n,e.__scopeMenu),r=u.useRef(null),a=wt(t,r);return u.useEffect(()=>{const o=r.current;if(o)return Pw(o)},[]),s.jsx(zf,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Re(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),FI=u.forwardRef((e,t)=>{const n=ao($n,e.__scopeMenu);return s.jsx(zf,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),zI=bI("MenuContent.ScrollLock"),zf=u.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:a,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:l,onEntryFocus:c,onEscapeKeyDown:d,onPointerDownOutside:p,onFocusOutside:m,onInteractOutside:f,onDismiss:h,disableOutsideScroll:y,...x}=e,b=ao($n,n),v=nl($n,n),g=ku(n),w=fk(n),k=TI(n),[C,N]=u.useState(null),S=u.useRef(null),A=wt(t,S,b.onContentChange),E=u.useRef(0),_=u.useRef(""),R=u.useRef(0),T=u.useRef(null),F=u.useRef("right"),z=u.useRef(0),K=y?bf:u.Fragment,$=y?{as:zI,allowPinchZoom:!0}:void 0,W=D=>{var Q,O;const G=_.current+D,Y=k().filter(ne=>!ne.disabled),oe=document.activeElement,de=(Q=Y.find(ne=>ne.ref.current===oe))==null?void 0:Q.textValue,pe=Y.map(ne=>ne.textValue),le=XI(pe,G,de),I=(O=Y.find(ne=>ne.textValue===le))==null?void 0:O.ref.current;(function ne(he){_.current=he,window.clearTimeout(E.current),he!==""&&(E.current=window.setTimeout(()=>ne(""),1e3))})(G),I&&setTimeout(()=>I.focus())};u.useEffect(()=>()=>window.clearTimeout(E.current),[]),bw();const P=u.useCallback(D=>{var Y,oe;return F.current===((Y=T.current)==null?void 0:Y.side)&&ZI(D,(oe=T.current)==null?void 0:oe.area)},[]);return s.jsx(DI,{scope:n,searchRef:_,onItemEnter:u.useCallback(D=>{P(D)&&D.preventDefault()},[P]),onItemLeave:u.useCallback(D=>{var G;P(D)||((G=S.current)==null||G.focus(),N(null))},[P]),onTriggerLeave:u.useCallback(D=>{P(D)&&D.preventDefault()},[P]),pointerGraceTimerRef:R,onPointerGraceIntentChange:u.useCallback(D=>{T.current=D},[]),children:s.jsx(K,{...$,children:s.jsx(yf,{asChild:!0,trapped:a,onMountAutoFocus:Re(o,D=>{var G;D.preventDefault(),(G=S.current)==null||G.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:s.jsx(du,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:d,onPointerDownOutside:p,onFocusOutside:m,onInteractOutside:f,onDismiss:h,children:s.jsx(xI,{asChild:!0,...w,dir:v.dir,orientation:"vertical",loop:r,currentTabStopId:C,onCurrentTabStopIdChange:N,onEntryFocus:Re(c,D=>{v.isUsingKeyboardRef.current||D.preventDefault()}),preventScrollOnEntryFocus:!0,children:s.jsx(ak,{role:"menu","aria-orientation":"vertical","data-state":Ik(b.open),"data-radix-menu-content":"",dir:v.dir,...g,...x,ref:A,style:{outline:"none",...x.style},onKeyDown:Re(x.onKeyDown,D=>{const Y=D.target.closest("[data-radix-menu-content]")===D.currentTarget,oe=D.ctrlKey||D.altKey||D.metaKey,de=D.key.length===1;Y&&(D.key==="Tab"&&D.preventDefault(),!oe&&de&&W(D.key));const pe=S.current;if(D.target!==pe||!AI.includes(D.key))return;D.preventDefault();const I=k().filter(Q=>!Q.disabled).map(Q=>Q.ref.current);pk.includes(D.key)&&I.reverse(),YI(I)}),onBlur:Re(e.onBlur,D=>{D.currentTarget.contains(D.target)||(window.clearTimeout(E.current),_.current="")}),onPointerMove:Re(e.onPointerMove,Ti(D=>{const G=D.target,Y=z.current!==D.clientX;if(D.currentTarget.contains(G)&&Y){const oe=D.clientX>z.current?"right":"left";F.current=oe,z.current=D.clientX}}))})})})})})})});xk.displayName=$n;var $I="MenuGroup",$f=u.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return s.jsx(xt.div,{role:"group",...r,ref:t})});$f.displayName=$I;var UI="MenuLabel",yk=u.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return s.jsx(xt.div,{...r,ref:t})});yk.displayName=UI;var Fc="MenuItem",iv="menu.itemSelect",Cu=u.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...a}=e,o=u.useRef(null),i=nl(Fc,e.__scopeMenu),l=Ff(Fc,e.__scopeMenu),c=wt(t,o),d=u.useRef(!1),p=()=>{const m=o.current;if(!n&&m){const f=new CustomEvent(iv,{bubbles:!0,cancelable:!0});m.addEventListener(iv,h=>r==null?void 0:r(h),{once:!0}),gw(m,f),f.defaultPrevented?d.current=!1:i.onClose()}};return s.jsx(bk,{...a,ref:c,disabled:n,onClick:Re(e.onClick,p),onPointerDown:m=>{var f;(f=e.onPointerDown)==null||f.call(e,m),d.current=!0},onPointerUp:Re(e.onPointerUp,m=>{var f;d.current||(f=m.currentTarget)==null||f.click()}),onKeyDown:Re(e.onKeyDown,m=>{const f=l.searchRef.current!=="";n||f&&m.key===" "||nm.includes(m.key)&&(m.currentTarget.click(),m.preventDefault())})})});Cu.displayName=Fc;var bk=u.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:a,...o}=e,i=Ff(Fc,n),l=fk(n),c=u.useRef(null),d=wt(t,c),[p,m]=u.useState(!1),[f,h]=u.useState("");return u.useEffect(()=>{const y=c.current;y&&h((y.textContent??"").trim())},[o.children]),s.jsx(Pi.ItemSlot,{scope:n,disabled:r,textValue:a??f,children:s.jsx(yI,{asChild:!0,...l,focusable:!r,children:s.jsx(xt.div,{role:"menuitem","data-highlighted":p?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...o,ref:d,onPointerMove:Re(e.onPointerMove,Ti(y=>{r?i.onItemLeave(y):(i.onItemEnter(y),y.defaultPrevented||y.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Re(e.onPointerLeave,Ti(y=>i.onItemLeave(y))),onFocus:Re(e.onFocus,()=>m(!0)),onBlur:Re(e.onBlur,()=>m(!1))})})})}),BI="MenuCheckboxItem",wk=u.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...a}=e;return s.jsx(jk,{scope:e.__scopeMenu,checked:n,children:s.jsx(Cu,{role:"menuitemcheckbox","aria-checked":zc(n)?"mixed":n,...a,ref:t,"data-state":Bf(n),onSelect:Re(a.onSelect,()=>r==null?void 0:r(zc(n)?!0:!n),{checkForDefaultPrevented:!1})})})});wk.displayName=BI;var kk="MenuRadioGroup",[HI,WI]=ro(kk,{value:void 0,onValueChange:()=>{}}),Ck=u.forwardRef((e,t)=>{const{value:n,onValueChange:r,...a}=e,o=zr(r);return s.jsx(HI,{scope:e.__scopeMenu,value:n,onValueChange:o,children:s.jsx($f,{...a,ref:t})})});Ck.displayName=kk;var Sk="MenuRadioItem",Nk=u.forwardRef((e,t)=>{const{value:n,...r}=e,a=WI(Sk,e.__scopeMenu),o=n===a.value;return s.jsx(jk,{scope:e.__scopeMenu,checked:o,children:s.jsx(Cu,{role:"menuitemradio","aria-checked":o,...r,ref:t,"data-state":Bf(o),onSelect:Re(r.onSelect,()=>{var i;return(i=a.onValueChange)==null?void 0:i.call(a,n)},{checkForDefaultPrevented:!1})})})});Nk.displayName=Sk;var Uf="MenuItemIndicator",[jk,qI]=ro(Uf,{checked:!1}),Ak=u.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...a}=e,o=qI(Uf,n);return s.jsx(br,{present:r||zc(o.checked)||o.checked===!0,children:s.jsx(xt.span,{...a,ref:t,"data-state":Bf(o.checked)})})});Ak.displayName=Uf;var KI="MenuSeparator",_k=u.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return s.jsx(xt.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});_k.displayName=KI;var VI="MenuArrow",Pk=u.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,a=ku(n);return s.jsx(ok,{...a,...r,ref:t})});Pk.displayName=VI;var GI="MenuSub",[k6,Tk]=ro(GI),Bs="MenuSubTrigger",Rk=u.forwardRef((e,t)=>{const n=ao(Bs,e.__scopeMenu),r=nl(Bs,e.__scopeMenu),a=Tk(Bs,e.__scopeMenu),o=Ff(Bs,e.__scopeMenu),i=u.useRef(null),{pointerGraceTimerRef:l,onPointerGraceIntentChange:c}=o,d={__scopeMenu:e.__scopeMenu},p=u.useCallback(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);return u.useEffect(()=>p,[p]),u.useEffect(()=>{const m=l.current;return()=>{window.clearTimeout(m),c(null)}},[l,c]),s.jsx(Df,{asChild:!0,...d,children:s.jsx(bk,{id:a.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":a.contentId,"data-state":Ik(n.open),...e,ref:_a(t,a.onTriggerChange),onClick:m=>{var f;(f=e.onClick)==null||f.call(e,m),!(e.disabled||m.defaultPrevented)&&(m.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Re(e.onPointerMove,Ti(m=>{o.onItemEnter(m),!m.defaultPrevented&&!e.disabled&&!n.open&&!i.current&&(o.onPointerGraceIntentChange(null),i.current=window.setTimeout(()=>{n.onOpenChange(!0),p()},100))})),onPointerLeave:Re(e.onPointerLeave,Ti(m=>{var h,y;p();const f=(h=n.content)==null?void 0:h.getBoundingClientRect();if(f){const x=(y=n.content)==null?void 0:y.dataset.side,b=x==="right",v=b?-5:5,g=f[b?"left":"right"],w=f[b?"right":"left"];o.onPointerGraceIntentChange({area:[{x:m.clientX+v,y:m.clientY},{x:g,y:f.top},{x:w,y:f.top},{x:w,y:f.bottom},{x:g,y:f.bottom}],side:x}),window.clearTimeout(l.current),l.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(m),m.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:Re(e.onKeyDown,m=>{var h;const f=o.searchRef.current!=="";e.disabled||f&&m.key===" "||_I[r.dir].includes(m.key)&&(n.onOpenChange(!0),(h=n.content)==null||h.focus(),m.preventDefault())})})})});Rk.displayName=Bs;var Mk="MenuSubContent",Ek=u.forwardRef((e,t)=>{const n=gk($n,e.__scopeMenu),{forceMount:r=n.forceMount,...a}=e,o=ao($n,e.__scopeMenu),i=nl($n,e.__scopeMenu),l=Tk(Mk,e.__scopeMenu),c=u.useRef(null),d=wt(t,c);return s.jsx(Pi.Provider,{scope:e.__scopeMenu,children:s.jsx(br,{present:r||o.open,children:s.jsx(Pi.Slot,{scope:e.__scopeMenu,children:s.jsx(zf,{id:l.contentId,"aria-labelledby":l.triggerId,...a,ref:d,align:"start",side:i.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:p=>{var m;i.isUsingKeyboardRef.current&&((m=c.current)==null||m.focus()),p.preventDefault()},onCloseAutoFocus:p=>p.preventDefault(),onFocusOutside:Re(e.onFocusOutside,p=>{p.target!==l.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:Re(e.onEscapeKeyDown,p=>{i.onClose(),p.preventDefault()}),onKeyDown:Re(e.onKeyDown,p=>{var h;const m=p.currentTarget.contains(p.target),f=PI[i.dir].includes(p.key);m&&f&&(o.onOpenChange(!1),(h=l.trigger)==null||h.focus(),p.preventDefault())})})})})})});Ek.displayName=Mk;function Ik(e){return e?"open":"closed"}function zc(e){return e==="indeterminate"}function Bf(e){return zc(e)?"indeterminate":e?"checked":"unchecked"}function YI(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function QI(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function XI(e,t,n){const a=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let i=QI(e,Math.max(o,0));a.length===1&&(i=i.filter(d=>d!==n));const c=i.find(d=>d.toLowerCase().startsWith(a.toLowerCase()));return c!==n?c:void 0}function JI(e,t){const{x:n,y:r}=e;let a=!1;for(let o=0,i=t.length-1;o<t.length;i=o++){const l=t[o],c=t[i],d=l.x,p=l.y,m=c.x,f=c.y;p>r!=f>r&&n<(m-d)*(r-p)/(f-p)+d&&(a=!a)}return a}function ZI(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return JI(n,t)}function Ti(e){return t=>t.pointerType==="mouse"?e(t):void 0}var e5=hk,t5=Df,n5=vk,r5=xk,a5=$f,o5=yk,s5=Cu,i5=wk,l5=Ck,c5=Nk,u5=Ak,d5=_k,p5=Pk,m5=Rk,f5=Ek,Su="DropdownMenu",[h5]=Aa(Su,[mk]),sn=mk(),[g5,Lk]=h5(Su),Dk=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:a,defaultOpen:o,onOpenChange:i,modal:l=!0}=e,c=sn(t),d=u.useRef(null),[p,m]=uu({prop:a,defaultProp:o??!1,onChange:i,caller:Su});return s.jsx(g5,{scope:t,triggerId:$a(),triggerRef:d,contentId:$a(),open:p,onOpenChange:m,onOpenToggle:u.useCallback(()=>m(f=>!f),[m]),modal:l,children:s.jsx(e5,{...c,open:p,onOpenChange:m,dir:r,modal:l,children:n})})};Dk.displayName=Su;var Ok="DropdownMenuTrigger",Fk=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...a}=e,o=Lk(Ok,n),i=sn(n);return s.jsx(t5,{asChild:!0,...i,children:s.jsx(xt.button,{type:"button",id:o.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...a,ref:_a(t,o.triggerRef),onPointerDown:Re(e.onPointerDown,l=>{!r&&l.button===0&&l.ctrlKey===!1&&(o.onOpenToggle(),o.open||l.preventDefault())}),onKeyDown:Re(e.onKeyDown,l=>{r||(["Enter"," "].includes(l.key)&&o.onOpenToggle(),l.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(l.key)&&l.preventDefault())})})})});Fk.displayName=Ok;var v5="DropdownMenuPortal",zk=e=>{const{__scopeDropdownMenu:t,...n}=e,r=sn(t);return s.jsx(n5,{...r,...n})};zk.displayName=v5;var $k="DropdownMenuContent",Uk=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Lk($k,n),o=sn(n),i=u.useRef(!1);return s.jsx(r5,{id:a.contentId,"aria-labelledby":a.triggerId,...o,...r,ref:t,onCloseAutoFocus:Re(e.onCloseAutoFocus,l=>{var c;i.current||(c=a.triggerRef.current)==null||c.focus(),i.current=!1,l.preventDefault()}),onInteractOutside:Re(e.onInteractOutside,l=>{const c=l.detail.originalEvent,d=c.button===0&&c.ctrlKey===!0,p=c.button===2||d;(!a.modal||p)&&(i.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Uk.displayName=$k;var x5="DropdownMenuGroup",y5=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=sn(n);return s.jsx(a5,{...a,...r,ref:t})});y5.displayName=x5;var b5="DropdownMenuLabel",Bk=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=sn(n);return s.jsx(o5,{...a,...r,ref:t})});Bk.displayName=b5;var w5="DropdownMenuItem",Hk=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=sn(n);return s.jsx(s5,{...a,...r,ref:t})});Hk.displayName=w5;var k5="DropdownMenuCheckboxItem",Wk=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=sn(n);return s.jsx(i5,{...a,...r,ref:t})});Wk.displayName=k5;var C5="DropdownMenuRadioGroup",qk=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=sn(n);return s.jsx(l5,{...a,...r,ref:t})});qk.displayName=C5;var S5="DropdownMenuRadioItem",Kk=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=sn(n);return s.jsx(c5,{...a,...r,ref:t})});Kk.displayName=S5;var N5="DropdownMenuItemIndicator",Vk=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=sn(n);return s.jsx(u5,{...a,...r,ref:t})});Vk.displayName=N5;var j5="DropdownMenuSeparator",Gk=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=sn(n);return s.jsx(d5,{...a,...r,ref:t})});Gk.displayName=j5;var A5="DropdownMenuArrow",_5=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=sn(n);return s.jsx(p5,{...a,...r,ref:t})});_5.displayName=A5;var P5="DropdownMenuSubTrigger",Yk=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=sn(n);return s.jsx(m5,{...a,...r,ref:t})});Yk.displayName=P5;var T5="DropdownMenuSubContent",Qk=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=sn(n);return s.jsx(f5,{...a,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Qk.displayName=T5;var R5=Dk,M5=Fk,E5=zk,Xk=Uk,Jk=Bk,Zk=Hk,e1=Wk,I5=qk,t1=Kk,n1=Vk,r1=Gk,a1=Yk,o1=Qk;const gn=R5,vn=M5,L5=I5,s1="z-50 max-h-[min(var(--radix-dropdown-menu-content-available-height),28rem)] min-w-[10rem] overflow-x-hidden overflow-y-auto overscroll-contain rounded-[18px] border border-border/65 bg-popover/96 p-1.5 text-popover-foreground shadow-[0_18px_55px_rgba(15,23,42,0.18)] backdrop-blur-xl scrollbar-thin scrollbar-track-transparent dark:border-white/10 dark:shadow-[0_22px_55px_rgba(0,0,0,0.45)]",Nu="relative flex min-h-8 cursor-default select-none items-center gap-2 rounded-[12px] px-2.5 py-2 text-[13px] outline-none transition-colors focus:bg-foreground/[0.055] focus:text-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 dark:focus:bg-white/[0.08]",D5=u.forwardRef(({className:e,inset:t,children:n,...r},a)=>s.jsxs(a1,{ref:a,className:j(Nu,"data-[state=open]:bg-foreground/[0.055] dark:data-[state=open]:bg-white/[0.08]",t&&"pl-8",e),...r,children:[n,s.jsx(Wr,{className:"ml-auto h-3.5 w-3.5 text-muted-foreground"})]}));D5.displayName=a1.displayName;const O5=u.forwardRef(({className:e,...t},n)=>s.jsx(o1,{ref:n,className:j(s1,e),...t}));O5.displayName=o1.displayName;const ln=u.forwardRef(({className:e,sideOffset:t=4,portalContainer:n,...r},a)=>s.jsx(E5,{container:n??void 0,children:s.jsx(Xk,{ref:a,sideOffset:t,className:j(s1,"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...r})}));ln.displayName=Xk.displayName;const gt=u.forwardRef(({className:e,inset:t,...n},r)=>s.jsx(Zk,{ref:r,className:j(Nu,t&&"pl-8",e),...n}));gt.displayName=Zk.displayName;const F5=u.forwardRef(({className:e,children:t,checked:n,...r},a)=>s.jsxs(e1,{ref:a,className:j(Nu,"pl-8 pr-2.5",e),checked:n,...r,children:[s.jsx("span",{className:"absolute left-2.5 flex h-3.5 w-3.5 items-center justify-center",children:s.jsx(n1,{children:s.jsx(Et,{className:"h-3.5 w-3.5"})})}),t]}));F5.displayName=e1.displayName;const i1=u.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(t1,{ref:r,className:j(Nu,"pl-8 pr-2.5",e),...n,children:[s.jsx("span",{className:"absolute left-2.5 flex h-3.5 w-3.5 items-center justify-center",children:s.jsx(n1,{children:s.jsx(Yj,{className:"h-2 w-2 fill-current"})})}),t]}));i1.displayName=t1.displayName;const l1=u.forwardRef(({className:e,inset:t,...n},r)=>s.jsx(Jk,{ref:r,className:j("px-2.5 pb-1.5 pt-1 text-[12px] font-semibold text-muted-foreground",t&&"pl-8",e),...n}));l1.displayName=Jk.displayName;const Hf=u.forwardRef(({className:e,...t},n)=>s.jsx(r1,{ref:n,className:j("-mx-1.5 my-1.5 h-px bg-border/50",e),...t}));Hf.displayName=r1.displayName;function z5(e,t){return{...e,access_mode:t,restrict_to_workspace:t==="restricted"}}function Ri(e){return e.replace(/\\/g,"/").replace(/\/+$/,"").split("/").filter(Boolean).pop()||e}function c1(e){const n=e.replace(/\\/g,"/").split("/").filter(Boolean);return n.length<=3?e:`.../${n.slice(-3).join("/")}`}function $5(e){const t=e.trim();return t==="~"||t.startsWith("~/")||t.startsWith("~\\")||t.startsWith("/")||/^[A-Za-z]:[\\/]/.test(t)}function U5(e,t){return!e||!t||u1(e.project_path,t.project_path)?null:e}function rm(e){return(e??"").replace(/\\/g,"/").replace(/\/+$/,"")||"/"}function u1(e,t){return!e||!t?!1:rm(e)===rm(t)}const Wf=8;function B5(e,t,n){if(e.some(h=>{var y;return(y=h.workspaceScope)==null?void 0:y.project_path}))return q5(e,t,n);const r=new Date,a=new Date(r.getFullYear(),r.getMonth(),r.getDate()).getTime(),o=a-24*60*60*1e3,i=new Map,l=new Set(n.pinnedKeys),c=new Set(n.archivedKeys),d=[],p=[],m=[];for(const h of e){if(c.has(h.key)){n.showArchived&&p.push(h);continue}if(l.has(h.key)){d.push(h);continue}if(n.sort==="title_asc"){m.push(h);continue}const y=Date.parse(h.updatedAt??h.createdAt??""),x=Number.isFinite(y)&&y>=a?t.today:Number.isFinite(y)&&y>=o?t.yesterday:t.earlier,b=i.get(x)??[];b.push(h),i.set(x,b)}const f=[t.today,t.yesterday,t.earlier].map(h=>({id:`date:${h}`,label:h,sessions:Hs(i.get(h)??[],n.sort,n.titleOverrides)})).filter(h=>h.sessions.length>0);return n.sort==="title_asc"&&m.length&&f.push({id:"date:all",label:t.all,sessions:Hs(m,n.sort,n.titleOverrides)}),d.length&&f.unshift({id:"pinned",label:t.pinned,sessions:Hs(d,n.sort,n.titleOverrides)}),p.length&&f.push({id:"archived",label:t.archived,sessions:Hs(p,n.sort,n.titleOverrides)}),f}function H5(e,t,n,r){let a=Math.max(0,t),o=!n;const i=[];for(const l of e){if(am(l,r)){i.push({...l,sessions:[]});continue}const c=a>0?l.sessions.slice(0,a):[];a-=c.length,n&&c.some(d=>d.key===n)&&(o=!0),c.length>0&&i.push({...l,sessions:c})}if(o||!n)return i;for(const l of e){if(am(l,r))continue;const c=l.sessions.find(p=>p.key===n);if(!c)continue;const d=i.find(p=>p.id===l.id);return d?d.sessions=[...d.sessions,c]:i.push({...l,sessions:[c]}),i}return i}function am(e,t){return e.kind==="project"&&!!t[e.id]}function d1(e){return e.id==="workspace:chats"||e.id==="date:all"}function p1(e,t){return d1(e)&&e.sessions.length>Wf&&t[e.id]!==!1}function W5(e,t,n){if(!p1(e,n))return e.sessions;const r=e.sessions.slice(0,Wf);if(!t||r.some(o=>o.key===t))return r;const a=e.sessions.find(o=>o.key===t);return a?[...r,a]:r}function m1(e,t,n){var r,a;return((r=t[e.key])==null?void 0:r.trim())||((a=e.title)==null?void 0:a.trim())||Gi(e.preview,n)}function q5(e,t,n){var c,d;const r=new Set(n.archivedKeys),a=[],o=new Map;for(const p of e){if(r.has(p.key)&&!n.showArchived)continue;const m=p.workspaceScope,f=(m==null?void 0:m.project_path)||"";if(!f||u1(f,n.defaultWorkspacePath)){a.push(p);continue}const h=rm(f),y=((c=n.projectNameOverrides[h])==null?void 0:c.trim())||((d=m==null?void 0:m.project_name)==null?void 0:d.trim())||Ri(f),x=o.get(h)??{path:f,label:y,sessions:[],updatedAt:null};x.sessions.push(p);const b=p.updatedAt??p.createdAt??null;cv(b,x.updatedAt)&&(x.updatedAt=b),o.set(h,x)}const i=new Set(n.pinnedKeys),l=Array.from(o.entries()).map(([p,m])=>({id:`project:${p}`,label:m.label,kind:"project",projectPath:m.path,projectKey:p,updatedAt:m.updatedAt,sessions:lv(m.sessions,n.sort,n.titleOverrides,i,r)}));if(a.length){const p=a.reduce((m,f)=>{const h=f.updatedAt??f.createdAt??null;return cv(h,m)?h:m},null);l.push({id:"workspace:chats",label:t.all,updatedAt:p,sessions:lv(a,n.sort,n.titleOverrides,i,r)})}return l.sort((p,m)=>{const f=$c(m.updatedAt)-$c(p.updatedAt);return f!==0?f:p.label.localeCompare(m.label,"en",{numeric:!0,sensitivity:"base"})}),l}function lv(e,t,n,r,a){return Hs(e,t,n).sort((o,i)=>{const l=Number(r.has(i.key))-Number(r.has(o.key));if(l!==0)return l;const c=Number(a.has(o.key))-Number(a.has(i.key));return c!==0?c:0})}function Hs(e,t,n){const r=[...e];return r.sort((a,o)=>{if(t==="title_asc"){const c=uv(a,n).localeCompare(uv(o,n),"en",{numeric:!0,sensitivity:"base"});return c!==0?c:Tl(o,"updatedAt")-Tl(a,"updatedAt")}const i=Tl(a,t==="created_desc"?"createdAt":"updatedAt");return Tl(o,t==="created_desc"?"createdAt":"updatedAt")-i}),r}function cv(e,t){return $c(e)>$c(t)}function $c(e){const t=Date.parse(e??"");return Number.isFinite(t)?t:0}function uv(e,t){var n,r;return(((n=t[e.key])==null?void 0:n.trim())||((r=e.title)==null?void 0:r.trim())||Gi(e.preview,"new chat")).toLocaleLowerCase("en")}function Tl(e,t){const n=Date.parse(e[t]??"");return Number.isFinite(n)?n:0}const dv=160,K5=160,f1="w-[8.5rem] min-w-[8.5rem]",Ws="grid w-[7.75rem] grid-cols-[1rem_minmax(0,1fr)] items-center gap-2",V5=u.memo(function({sessions:t,activeKey:n,onSelect:r,onRequestDelete:a,onTogglePin:o,onRequestRename:i,onToggleArchive:l,onToggleGroup:c,onRequestRenameProject:d,onNewChatInProject:p,pinnedKeys:m=[],archivedKeys:f=[],titleOverrides:h={},projectNameOverrides:y={},collapsedGroups:x={},runningChatIds:b=[],updatedChatIds:v=[],density:g="comfortable",showPreviews:w=!1,showTimestamps:k=!1,sort:C="updated_desc",showArchived:N=!1,defaultWorkspacePath:S,actionMenuPortalContainer:A,loading:E,emptyLabel:_}){const{t:R}=ie(),[T,F]=u.useState(dv),z=u.useMemo(()=>({pinned:R("chat.groups.pinned"),all:R("chat.groups.all"),today:R("chat.groups.today"),yesterday:R("chat.groups.yesterday"),earlier:R("chat.groups.earlier"),archived:R("chat.groups.archived"),projects:R("chat.groups.projects"),fallbackTitle:R("chat.newChat")}),[R]),K=u.useMemo(()=>B5(t,z,{pinnedKeys:m,archivedKeys:f,titleOverrides:h,projectNameOverrides:y,showArchived:N,sort:C,defaultWorkspacePath:S}),[f,z,m,t,N,C,h,y,S]),$=u.useMemo(()=>H5(K,T,n,x),[n,x,K,T]),W=u.useMemo(()=>K.reduce((I,Q)=>I+(am(Q,x)?0:Q.sessions.length),0),[x,K]),P=u.useMemo(()=>$.reduce((I,Q)=>I+Q.sessions.length,0),[$]),D=Math.max(0,W-P);if(u.useEffect(()=>{F(dv)},[N,C]),E&&t.length===0)return s.jsx("div",{className:"px-3 py-6 text-[12px] text-muted-foreground",children:R("chat.loading")});if(t.length===0)return s.jsx("div",{className:"px-3 py-6 text-[12px] leading-5 text-muted-foreground/80",children:_??R("chat.noSessions")});const G=new Set(m),Y=new Set(f),oe=new Set(b),de=new Set(v),pe=g==="compact",le=$.findIndex(I=>I.kind==="project");return s.jsx("div",{className:"h-full min-h-0 min-w-0 overflow-x-hidden overflow-y-auto overscroll-contain scrollbar-thin scrollbar-track-transparent",children:s.jsxs("div",{className:"min-w-0 space-y-3 px-2 py-1.5",children:[$.map((I,Q)=>{const O=d1(I),ne=p1(I,x),he=W5(I,n,x),ve=Math.max(0,I.sessions.length-he.length),me=I.sessions.length>Wf;return s.jsxs("section",{"aria-label":I.label,children:[Q===le?s.jsx("div",{className:"px-2 pb-1 text-[12px] font-medium text-muted-foreground/65",children:z.projects}):null,I.kind==="project"?s.jsx(G5,{label:I.label,path:I.projectPath,collapsed:!!x[I.id],onToggle:()=>c==null?void 0:c(I.id),onRequestRename:I.projectKey&&d?()=>d(I.projectKey??"",I.label):void 0,onNewChat:I.projectPath&&p?()=>p(I.projectPath??"",I.label):void 0,actionMenuPortalContainer:A,updatedAt:k?I.updatedAt:null}):s.jsx(Y5,{label:I.label}),I.kind==="project"&&x[I.id]?null:s.jsx("ul",{className:"space-y-0.5",children:he.map(ee=>{var Ne,Je;const we=ee.key===n,je=R("chat.fallbackTitle",{id:ee.chatId.slice(0,6)}),xe=((Ne=ee.title)==null?void 0:Ne.trim())||"",Ee=m1(ee,h,R("chat.newChat")),$e=((Je=h[ee.key])==null?void 0:Je.trim())||xe||Gi(ee.preview,je),Se=G.has(ee.key),Fe=Y.has(ee.key),B=ee.preview.trim(),X=w&&B&&B!==Ee,J=k?Af(ee.updatedAt??ee.createdAt):"",ye=I.kind==="project",Ie=oe.has(ee.chatId)?"running":de.has(ee.chatId)&&!we?"updated":null;return s.jsx("li",{className:"min-w-0",children:s.jsxs("div",{className:j("group flex min-w-0 max-w-full items-center gap-2 rounded-xl px-2 text-[13px] transition-colors",pe?"min-h-7":"min-h-8",we?"bg-sidebar-accent/70 text-sidebar-accent-foreground shadow-[inset_0_0_0_1px_hsl(var(--sidebar-border)/0.28)]":"text-sidebar-foreground/82 hover:bg-sidebar-accent/50 hover:text-sidebar-foreground"),children:[s.jsxs("button",{type:"button",onClick:()=>r(ee.key),title:$e,className:j("min-w-0 flex-1 overflow-hidden text-left",pe?"py-1":"py-1.5",ye&&"pl-7"),children:[ye?s.jsxs("span",{className:"flex w-full min-w-0 items-baseline gap-2",children:[s.jsx("span",{className:"min-w-0 flex-1 truncate font-medium leading-5",children:Ee}),J?s.jsx("span",{className:"shrink-0 text-[11.5px] font-medium text-muted-foreground/58",children:J}):null]}):s.jsx("span",{className:"block w-full truncate font-medium leading-5",children:Ee}),X?s.jsx("span",{className:"block w-full truncate text-[11.5px] leading-4 text-muted-foreground/72",children:B}):null,J&&!ye?s.jsx("span",{className:"block w-full truncate text-[11px] leading-4 text-muted-foreground/58",children:J}):null]}),s.jsx(X5,{state:Ie}),s.jsxs(gn,{modal:!1,children:[s.jsx(vn,{className:j("inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-md text-muted-foreground/75 opacity-40 transition-opacity","hover:bg-sidebar-accent hover:text-sidebar-foreground group-hover:opacity-100","focus-visible:opacity-100",we&&"opacity-100"),"aria-label":R("chat.actions",{title:Ee}),children:s.jsx(tw,{className:"h-3.5 w-3.5"})}),s.jsxs(ln,{align:"end",className:f1,portalContainer:A,onCloseAutoFocus:ue=>ue.preventDefault(),children:[s.jsxs(gt,{onSelect:()=>o(ee.key),className:Ws,children:[Se?s.jsx(pA,{className:"h-4 w-4 shrink-0"}):s.jsx(mA,{className:"h-4 w-4 shrink-0"}),R(Se?"chat.unpin":"chat.pin")]}),s.jsxs(gt,{onSelect:()=>i(ee.key,Ee),className:Ws,children:[s.jsx(fs,{className:"h-4 w-4 shrink-0"}),R("chat.rename")]}),s.jsxs(gt,{onSelect:()=>l(ee.key),className:Ws,children:[Fe?s.jsx(Bj,{className:"h-4 w-4 shrink-0"}):s.jsx(Yb,{className:"h-4 w-4 shrink-0"}),R(Fe?"chat.unarchive":"chat.archive")]}),s.jsxs(gt,{onSelect:()=>{window.setTimeout(()=>a(ee.key,Ee),0)},className:j(Ws,"text-destructive focus:text-destructive"),children:[s.jsx(ya,{className:"h-4 w-4 shrink-0"}),R("chat.delete")]})]})]})]})},ee.key)})}),O&&me?s.jsx(Q5,{folded:ne,hiddenCount:ve,onToggle:()=>c==null?void 0:c(I.id)}):null]},I.id)}),D>0?s.jsx("div",{className:"px-2 pb-2 pt-1",children:s.jsx("button",{type:"button",onClick:()=>F(I=>Math.min(W,I+K5)),className:"h-8 w-full rounded-full text-[12px] font-medium text-muted-foreground/65 transition-colors hover:bg-sidebar-accent/65 hover:text-muted-foreground",children:R("chat.showMore",{count:D})})}):null]})})});function G5({label:e,path:t,collapsed:n,onToggle:r,onRequestRename:a,onNewChat:o,actionMenuPortalContainer:i,updatedAt:l}){const{t:c}=ie();return s.jsxs("div",{title:t,className:"group flex min-w-0 items-center gap-1 px-1 pb-1 pt-1 text-[12px] font-medium text-muted-foreground/78",children:[s.jsxs("button",{type:"button","aria-expanded":!n,onClick:r,className:"flex min-w-0 flex-1 items-center gap-2 rounded-lg px-1.5 py-1 text-left transition-colors hover:bg-sidebar-accent/45 hover:text-sidebar-foreground",children:[s.jsx(Gl,{className:"h-3.5 w-3.5 shrink-0","aria-hidden":!0}),s.jsx("span",{className:"min-w-0 flex-1 truncate",children:e})]}),l?s.jsx("span",{className:"shrink-0 text-[11px] text-muted-foreground/55",children:Af(l)}):null,a?s.jsxs(gn,{modal:!1,children:[s.jsx(vn,{className:j("inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-md text-muted-foreground/70 opacity-40 transition-opacity","hover:bg-sidebar-accent hover:text-sidebar-foreground group-hover:opacity-100 focus-visible:opacity-100"),"aria-label":c("chat.actions",{title:e}),onClick:d=>d.stopPropagation(),children:s.jsx(tw,{className:"h-3.5 w-3.5"})}),s.jsx(ln,{align:"end",className:f1,portalContainer:i,onCloseAutoFocus:d=>d.preventDefault(),children:s.jsxs(gt,{onSelect:a,className:Ws,children:[s.jsx(fs,{className:"h-4 w-4 shrink-0"}),c("chat.rename")]})})]}):null,o?s.jsx("button",{type:"button","aria-label":c("chat.newInProject",{project:e}),title:c("chat.newInProject",{project:e}),onClick:d=>{d.stopPropagation(),o()},className:j("inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-md text-muted-foreground/70 opacity-40 transition-opacity","hover:bg-sidebar-accent hover:text-sidebar-foreground group-hover:opacity-100 focus-visible:opacity-100"),children:s.jsx(ga,{className:"h-3.5 w-3.5"})}):null]})}function Y5({label:e}){return s.jsx("div",{className:"px-2 pb-1 text-[12px] font-medium text-muted-foreground/65",children:e})}function Q5({folded:e,hiddenCount:t,onToggle:n}){var i;const{t:r,i18n:a}=ie(),o=(i=a.resolvedLanguage)!=null&&i.startsWith("zh")?`已折叠 ${t} 个对话`:`${t} hidden chats`;return s.jsx("div",{className:"px-2 pb-1 pt-1",children:s.jsx("button",{type:"button",onClick:n,className:"h-7 w-full rounded-xl text-left text-[12px] font-medium text-muted-foreground/65 transition-colors hover:bg-sidebar-accent/50 hover:text-muted-foreground",children:s.jsx("span",{className:"px-2",children:e?r("chat.collapsed",{count:t,defaultValue:o}):r("chat.showLess")})})})}function X5({state:e}){const{t}=ie();if(e==="running"){const n=t("chat.activity.running");return s.jsx("span",{"aria-label":n,title:n,className:"grid h-4 w-4 shrink-0 place-items-center",children:s.jsx("span",{className:"h-3 w-3 animate-spin rounded-full border border-blue-500/25 border-t-blue-500 [animation-duration:1.4s] motion-reduce:animate-none dark:border-blue-400/25 dark:border-t-blue-400"})})}if(e==="updated"){const n=t("chat.activity.updated");return s.jsx("span",{"aria-label":n,title:n,className:"grid h-4 w-4 shrink-0 place-items-center",children:s.jsx("span",{className:"h-2 w-2 rounded-full bg-[#ff8a3d] shadow-[0_0_0_2px_rgba(255,138,61,0.16)]"})})}return s.jsx("span",{className:"h-4 w-4 shrink-0","aria-hidden":"true"})}const h1=u.createContext(null);function J5({client:e,token:t,modelName:n=null,children:r}){return s.jsx(h1.Provider,{value:{client:e,token:t,modelName:n},children:r})}function kr(){const e=u.useContext(h1);if(!e)throw new Error("useClient must be used within a ClientProvider");return e}const Z5={idle:{color:"text-muted-foreground"},connecting:{color:"text-amber-700 dark:text-amber-300"},open:{color:"text-emerald-700 dark:text-emerald-400"},reconnecting:{color:"text-amber-700 dark:text-amber-300"},closed:{color:"text-muted-foreground"},error:{color:"text-destructive"}};function eL(){const{t:e}=ie(),{client:t}=kr(),[n,r]=u.useState(t.status);u.useEffect(()=>t.onStatus(r),[t]);const a=Z5[n],o=n==="connecting"||n==="reconnecting"||n==="error",i=e(`connection.${n}`);return s.jsxs("span",{className:j("inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-full transition-colors","text-muted-foreground/70 hover:bg-sidebar-accent/65",a.color),"aria-live":"polite",role:"status",title:i,children:[s.jsxs("span",{className:"relative flex h-2 w-2","aria-hidden":!0,children:[o&&s.jsx("span",{className:"absolute inline-flex h-full w-full animate-ping rounded-full bg-current opacity-75"}),s.jsx("span",{className:"relative inline-flex h-2 w-2 rounded-full bg-current"})]}),s.jsx("span",{className:"sr-only",children:i})]})}var tL=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],nL=tL.reduce((e,t)=>{const n=y0(`Primitive.${t}`),r=u.forwardRef((a,o)=>{const{asChild:i,...l}=a,c=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(c,{...l,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),rL="Separator",pv="horizontal",aL=["horizontal","vertical"],g1=u.forwardRef((e,t)=>{const{decorative:n,orientation:r=pv,...a}=e,o=oL(r)?r:pv,l=n?{role:"none"}:{"aria-orientation":o==="vertical"?o:void 0,role:"separator"};return s.jsx(nL.div,{"data-orientation":o,...l,...a,ref:t})});g1.displayName=rL;function oL(e){return aL.includes(e)}var v1=g1;const x1=u.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},a)=>s.jsx(v1,{ref:a,decorative:n,orientation:t,className:j("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));x1.displayName=v1.displayName;function sL(){var n;if(typeof navigator>"u")return!1;const e=navigator.platform||"",t=((n=navigator.userAgentData)==null?void 0:n.platform)||"";return/mac|iphone|ipad|ipod/i.test(`${e} ${t}`)}function iL(){return sL()?"Cmd+Shift+O":"Ctrl+Shift+O"}function Rd(e){var l,c,d,p;const{t}=ie(),[n,r]=u.useState(null),a=!!e.collapsed,o=t("thread.header.toggleSidebar"),i=iL();return s.jsxs("nav",{ref:e.containActionMenus?r:void 0,"aria-label":t("sidebar.navigation"),className:j("flex h-full w-full min-w-0 flex-col text-sidebar-foreground",e.hostChromeInset?"bg-transparent":"bg-sidebar",!e.hostChromeInset&&"border-r border-sidebar-border/60"),children:[s.jsxs("div",{className:j("flex items-center px-3 pb-2.5",e.hostChromeInset?"pt-[2.85rem]":"pt-3",a?"w-14 justify-start":"justify-between"),children:[s.jsx("button",{type:"button","aria-label":a?o:void 0,"aria-hidden":a?void 0:!0,title:a?o:void 0,onClick:a?e.onExpand:void 0,tabIndex:a?0:-1,className:j("flex h-9 w-9 shrink-0 items-center justify-center overflow-hidden rounded-xl transition-colors",a?"-ml-0.5 hover:bg-sidebar-accent/75":"pointer-events-none -ml-0.5"),children:s.jsx("img",{src:"/brand/nanobot_icon.png",alt:"",className:"h-8 w-8 select-none object-contain",draggable:!1})}),!a&&!e.hostChromeInset&&s.jsx(fe,{variant:"ghost",size:"icon","aria-label":t("sidebar.collapse"),onClick:e.onCollapse,className:"h-7 w-7 rounded-lg text-muted-foreground/85 hover:bg-sidebar-accent/75 hover:text-sidebar-foreground",children:s.jsx(ow,{className:"h-3.5 w-3.5"})})]}),s.jsxs("div",{className:j("space-y-1.5 px-2 pb-2",a&&"flex w-14 flex-col items-center px-0"),children:[s.jsx(Md,{collapsed:a,label:t("sidebar.newChat"),onClick:e.onNewChat,icon:s.jsx(xf,{className:"h-4 w-4"}),shortcut:i,ariaKeyShortcuts:"Meta+Shift+O Control+Shift+O"}),s.jsx(Md,{collapsed:a,label:t("sidebar.searchAria"),onClick:e.onOpenSearch,icon:s.jsx(Tt,{className:"h-4 w-4"})}),e.archivedCount?s.jsx(Md,{collapsed:a,label:e.showArchived?t("chat.hideArchived"):t("chat.showArchived"),onClick:e.onToggleArchived,icon:s.jsx(Yb,{className:"h-4 w-4"})}):null]}),s.jsx("div",{className:j("flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden transition-opacity duration-200",a&&"pointer-events-none opacity-0"),children:!a&&s.jsx(V5,{sessions:e.sessions,activeKey:e.activeKey,loading:e.loading,emptyLabel:t("chat.noSessions"),onSelect:e.onSelect,onRequestDelete:e.onRequestDelete,onTogglePin:e.onTogglePin,onRequestRename:e.onRequestRename,onToggleArchive:e.onToggleArchive,onToggleGroup:e.onToggleGroup,onRequestRenameProject:e.onRequestRenameProject,onNewChatInProject:e.onNewChatInProject,pinnedKeys:e.pinnedKeys,archivedKeys:e.archivedKeys,titleOverrides:e.titleOverrides,projectNameOverrides:e.projectNameOverrides,collapsedGroups:e.collapsedGroups,runningChatIds:e.runningChatIds,updatedChatIds:e.updatedChatIds,density:(l=e.viewState)==null?void 0:l.density,showPreviews:(c=e.viewState)==null?void 0:c.show_previews,showTimestamps:(d=e.viewState)==null?void 0:d.show_timestamps,sort:(p=e.viewState)==null?void 0:p.sort,showArchived:e.showArchived,defaultWorkspacePath:e.defaultWorkspacePath,actionMenuPortalContainer:e.containActionMenus?n:void 0})}),s.jsx(x1,{className:"bg-sidebar-border/50"}),s.jsx("div",{className:j("flex items-center gap-1 px-2.5 py-2.5 text-xs",a&&"w-14 flex-col px-0"),children:s.jsx(eL,{})})]})}function Md({collapsed:e,label:t,icon:n,onClick:r,active:a=!1,className:o,shortcut:i,ariaKeyShortcuts:l}){const c=i?`${t} (${i})`:e?t:void 0;return s.jsxs(fe,{type:"button",variant:"ghost","aria-label":t,"aria-current":a?"page":void 0,"aria-keyshortcuts":l,title:c,onClick:()=>r(),className:j("group h-8 min-w-0 gap-2 overflow-hidden rounded-full font-medium text-sidebar-foreground/85 hover:bg-sidebar-accent/75 hover:text-sidebar-foreground","transition-[width,padding,border-radius,color,background-color] duration-300 ease-out",e?"w-9 justify-center gap-0 rounded-xl px-0":"w-full justify-start gap-2 px-3 text-[12.5px]",a&&"bg-sidebar-accent text-sidebar-foreground shadow-[inset_0_0_0_1px_hsl(var(--sidebar-border)/0.55)]",o),children:[s.jsx("span",{className:j("flex shrink-0 items-center justify-center transition-transform duration-300 ease-out","translate-x-0"),"aria-hidden":!0,children:n}),s.jsx("span",{className:j("min-w-0 overflow-hidden truncate whitespace-nowrap transition-[max-width,opacity,transform] duration-200 ease-out",e?"max-w-0 -translate-x-1 opacity-0":"max-w-[12rem] translate-x-0 opacity-100"),children:t})]})}function lL({open:e,sessions:t,activeKey:n,loading:r,titleOverrides:a={},onOpenChange:o,onSelect:i}){const{t:l}=ie(),c=u.useRef(null),d=u.useRef([]),[p,m]=u.useState(""),[f,h]=u.useState(0),y=p.trim().toLowerCase(),x=u.useMemo(()=>{if(!e)return[];if(!y)return t;const C=y.split(/\s+/).filter(Boolean);return t.filter(N=>cL(N,C,a[N.key]))},[y,e,t,a]),b=x.length;u.useEffect(()=>{e&&(m(""),h(0),window.setTimeout(()=>{var C;return(C=c.current)==null?void 0:C.focus()},0))},[e]),u.useEffect(()=>{h(0)},[y]),u.useEffect(()=>{h(C=>b===0?0:Math.min(C,b-1))},[b]),u.useEffect(()=>{d.current=d.current.slice(0,b)},[b]),u.useEffect(()=>{var C;e&&((C=d.current[f])==null||C.scrollIntoView({block:"nearest",inline:"nearest"}))},[f,e]);const v=C=>{o(!1),i(C)},g=C=>{if(C.key==="ArrowDown"){C.preventDefault(),h(N=>b===0?0:(N+1)%b);return}if(C.key==="ArrowUp"){C.preventDefault(),h(N=>b===0?0:(N-1+b)%b);return}if(C.key==="Enter"){const N=x[f];if(!N)return;C.preventDefault(),v(N.key)}},w=l(y?"sidebar.noSearchResults":"chat.noSessions"),k=l(y?"sidebar.searchResults":"sidebar.recent");return e?s.jsx(Yi,{open:e,onOpenChange:o,children:s.jsxs(bs,{showCloseButton:!1,className:j("flex max-h-[min(40rem,calc(100vh-2rem))] w-[calc(100vw-2rem)] max-w-[42rem] flex-col gap-0 overflow-hidden p-0","rounded-[22px] border border-border bg-background text-foreground shadow-[0_22px_70px_rgba(0,0,0,0.22)]","dark:border-white/14 dark:bg-[#2b2b2b] dark:shadow-[0_26px_90px_rgba(0,0,0,0.44)] sm:rounded-[22px]"),children:[s.jsx(ws,{className:"sr-only",children:l("sidebar.searchAria")}),s.jsx(Ji,{className:"sr-only",children:l("sidebar.searchPlaceholder")}),s.jsxs("div",{className:"flex h-[62px] shrink-0 items-center gap-3 border-b border-border px-[18px]",children:[s.jsx(Tt,{className:"h-[18px] w-[18px] shrink-0 text-muted-foreground","aria-hidden":!0}),s.jsx("input",{ref:c,value:p,onChange:C=>m(C.target.value),onKeyDown:g,placeholder:l("sidebar.searchPlaceholder"),"aria-label":l("sidebar.searchAria"),className:"h-full min-w-0 flex-1 bg-transparent text-[19px] font-normal leading-none text-foreground outline-none placeholder:text-muted-foreground"})]}),s.jsx("div",{"data-testid":"session-search-scroll",className:"min-h-0 flex-1 overflow-y-auto overscroll-contain p-2.5 scrollbar-thin scrollbar-track-transparent",children:s.jsxs("section",{children:[s.jsx("div",{className:"px-2.5 pb-1.5 pt-1 text-[12px] font-medium text-muted-foreground",children:k}),r&&t.length===0?s.jsx("div",{className:"px-3 py-7 text-[13px] text-muted-foreground",children:l("chat.loading")}):x.length===0?s.jsx("div",{className:"px-3 py-7 text-[13px] text-muted-foreground",children:w}):s.jsx("ul",{className:"space-y-0.5",children:x.map((C,N)=>{var T,F;const S=((T=a[C.key])==null?void 0:T.trim())||((F=C.title)==null?void 0:F.trim())||Gi(C.preview,l("chat.newChat")),A=C.preview.trim(),E=A.length>0&&A.toLowerCase()!==S.trim().toLowerCase(),_=N===f,R=C.key===n;return s.jsx("li",{children:s.jsxs("button",{ref:z=>{d.current[N]=z},type:"button",onClick:()=>v(C.key),onMouseEnter:()=>h(N),"aria-current":R?"page":void 0,className:j("grid min-h-[54px] w-full min-w-0 grid-cols-[minmax(0,1fr)_auto] items-center gap-3 rounded-[11px] px-3 py-2 text-left transition-colors",_?"bg-muted text-foreground":"text-foreground hover:bg-muted"),children:[s.jsxs("span",{className:"min-w-0 flex-1",children:[s.jsx("span",{className:"block truncate text-[14px] font-medium leading-5",children:S}),E?s.jsx("span",{className:"block truncate text-[12px] leading-4 text-muted-foreground",children:A}):null]}),R?s.jsx("span",{className:"shrink-0 rounded-full bg-muted-foreground/10 px-2 py-0.5 text-[11px] font-medium text-muted-foreground",children:l("common.current",{defaultValue:"Current"})}):null]})},C.key)})})]})})]})}):null}function cL(e,t,n){const r=[n,e.title,e.preview].filter(Boolean).join(" ").toLowerCase();return t.every(a=>r.includes(a))}function uL(){const{t:e}=ie(),t=ys(),n=rT(t);return s.jsxs(gn,{children:[s.jsx(vn,{asChild:!0,children:s.jsxs(fe,{variant:"ghost",size:"sm","aria-label":e("sidebar.language.ariaLabel"),className:"h-7 gap-1.5 rounded-md px-2 text-[11px] text-muted-foreground hover:bg-sidebar-accent hover:text-sidebar-foreground",children:[s.jsx(tA,{className:"h-3.5 w-3.5"}),s.jsx("span",{className:"max-w-[7rem] truncate",children:n.nativeLabel})]})}),s.jsxs(ln,{align:"end",children:[s.jsx(l1,{children:e("sidebar.language.label")}),s.jsx(Hf,{}),s.jsx(L5,{value:t,onValueChange:r=>{RM(r)},children:Ai.map(r=>s.jsx(i1,{value:r.code,children:s.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[s.jsx("span",{children:r.nativeLabel}),r.nativeLabel!==r.label?s.jsx("span",{className:"truncate text-xs text-muted-foreground",children:r.label}):null]})},r.code))})]})]})}const qf=hu,dL=gu,y1=u.forwardRef(({className:e,...t},n)=>s.jsx(hs,{ref:n,className:j("fixed inset-0 z-50 bg-black/40 backdrop-blur-sm","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));y1.displayName=hs.displayName;const pL=b0("fixed z-50 flex flex-col gap-4 bg-background shadow-lg transition ease-in-out",{variants:{side:{top:j("inset-x-0 top-0 border-b","data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top"),bottom:j("inset-x-0 bottom-0 border-t","data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom"),left:j("inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm","data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left"),right:j("inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm","data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right")}},defaultVariants:{side:"right"}}),ju=u.forwardRef(({side:e="right",className:t,children:n,showCloseButton:r=!0,...a},o)=>s.jsxs(dL,{children:[s.jsx(y1,{}),s.jsxs(gs,{ref:o,className:j(pL({side:e}),"data-[state=open]:animate-in data-[state=closed]:animate-out","duration-300",t),...a,children:[n,r?s.jsxs(Vi,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none",children:[s.jsx(xr,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Close"})]}):null]})]}));ju.displayName=gs.displayName;const Au=u.forwardRef(({className:e,...t},n)=>s.jsx(vs,{ref:n,className:j("text-lg font-semibold text-foreground",e),...t}));Au.displayName=vs.displayName;const b1=u.forwardRef(({className:e,...t},n)=>s.jsx(Ki,{ref:n,className:j("text-sm text-muted-foreground",e),...t}));b1.displayName=Ki.displayName;const mL=2e4;async function Kf(e,t={},n=mL){if(!Number.isFinite(n)||n<=0)return fetch(e,t);const r=typeof AbortController<"u"?new AbortController:null;let a;const o=fetch(e,{...t,signal:(r==null?void 0:r.signal)??t.signal}),i=new Promise((l,c)=>{a=setTimeout(()=>{c(new Error(`Request timed out after ${n}ms`)),r==null||r.abort()},n)});try{return await Promise.race([o,i])}finally{a!==void 0&&clearTimeout(a)}}const Kt=2e4;class as extends Error{constructor(n,r){super(r);He(this,"status");this.status=n,this.name="ApiError"}}async function Ve(e,t,n,r=0){var i,l;const a=await Kf(e,{...n??{},headers:{...(n==null?void 0:n.headers)??{},Authorization:`Bearer ${t}`},credentials:"same-origin"},r);if(!a.ok){const c=typeof a.text=="function"?(await a.text()).trim():"";throw new as(a.status,c||`HTTP ${a.status}`)}const o=((l=(i=a.headers)==null?void 0:i.get)==null?void 0:l.call(i,"content-type"))??"";if(o&&!o.toLowerCase().includes("application/json")){const d=(typeof a.text=="function"?await a.text():"").trimStart().toLowerCase().startsWith("<!doctype");throw new as(a.status,d?"Gateway returned WebUI HTML instead of JSON. Restart nanobot gateway and try again.":"Gateway returned a non-JSON response.")}return await a.json()}function _u(e){const t={};if(Object.entries(e).forEach(([n,r])=>{if(r!=null){if(typeof r=="string"){const a=r.trim();a&&(t[n]=a);return}t[n]=r}}),!!Object.keys(t).length)return{"X-Nanobot-MCP-Values":JSON.stringify(t)}}function fL(e){return{"X-Nanobot-Automation-Values":encodeURIComponent(JSON.stringify(e))}}function hL(e){const t=e.indexOf(":");return t===-1?{channel:"",chatId:e}:{channel:e.slice(0,t),chatId:e.slice(t+1)}}async function gL(e,t=""){return(await Ve(`${t}/api/sessions`,e,void 0,Kt)).sessions.map(r=>({key:r.key,...hL(r.key),createdAt:r.created_at,updatedAt:r.updated_at,title:r.title??"",preview:r.preview??"",runStartedAt:r.run_started_at??null,workspaceScope:r.workspace_scope??null}))}async function mv(e,t,n,r=""){const a=typeof n=="string"?void 0:n,o=typeof n=="string"?n:r,i=new URLSearchParams;(a==null?void 0:a.limit)!==void 0&&i.set("limit",String(a.limit)),a!=null&&a.direction&&i.set("direction",a.direction),a!=null&&a.before&&i.set("before",a.before);const l=i.toString(),c=l?`?${l}`:"",d=`${o}/api/sessions/${encodeURIComponent(t)}/webui-thread${c}`,p=await Kf(d,{headers:{Authorization:`Bearer ${e}`},credentials:"same-origin"});if(p.status===404)return null;if(!p.ok)throw new as(p.status,`HTTP ${p.status}`);return await p.json()}async function vL(e,t,n,r=""){const a=new URLSearchParams;return a.set("path",n),Ve(`${r}/api/sessions/${encodeURIComponent(t)}/file-preview?${a}`,e,void 0,Kt)}async function w1(e,t,n=""){return Ve(`${n}/api/sessions/${encodeURIComponent(t)}/automations`,e,void 0,Kt)}async function fv(e,t=""){return Ve(`${t}/api/webui/automations`,e,void 0,Kt)}async function xL(e,t,n,r=""){const a=new URLSearchParams;return a.set("id",n),Ve(`${r}/api/webui/automations/${t}?${a}`,e,void 0,Kt)}async function yL(e,t,n,r=""){const a=new URLSearchParams;return a.set("id",t),Ve(`${r}/api/webui/automations/update?${a}`,e,{headers:fL(n)},Kt)}async function bL(e,t=""){return Ve(`${t}/api/webui/skills`,e,void 0,Kt)}async function wL(e,t,n=""){return Ve(`${n}/api/webui/skills/${encodeURIComponent(t)}`,e,void 0,Kt)}async function kL(e,t,n,r=""){const a=typeof n=="string"?void 0:n,o=typeof n=="string"?n:r,i=new URLSearchParams;a!=null&&a.deleteAutomations&&i.set("delete_automations","true");const l=i.toString()?`?${i}`:"";return Ve(`${o}/api/sessions/${encodeURIComponent(t)}/delete${l}`,e)}async function oi(e,t=""){return Ve(`${t}/api/settings`,e,void 0,Kt)}async function CL(e,t=""){return Ve(`${t}/api/settings/usage`,e,void 0,Kt)}async function SL(e,t=""){return Ve(`${t}/api/settings/version-check`,e,void 0,1e4)}async function NL(e,t=""){return Ve(`${t}/api/workspaces`,e,void 0,Kt)}async function jL(e,t=""){return Ve(`${t}/api/settings/cli-apps`,e,void 0,Kt)}async function AL(e,t=""){return Ve(`${t}/api/settings/cli-apps?installed_only=1`,e,void 0,Kt)}async function _L(e,t,n,r=""){const a=new URLSearchParams;return a.set("name",n),Ve(`${r}/api/settings/cli-apps/${t}?${a}`,e)}async function k1(e,t=""){return Ve(`${t}/api/settings/mcp-presets`,e,void 0,Kt)}async function PL(e,t,n=""){const r=new URLSearchParams;return r.set("provider",t),Ve(`${n}/api/settings/provider-models?${r}`,e,void 0,Kt)}async function TL(e,t,n,r={},a=""){const o=new URLSearchParams;return o.set("name",n),Ve(`${a}/api/settings/mcp-presets/${t}?${o}`,e,{headers:_u(r)})}async function RL(e,t,n=""){return Ve(`${n}/api/settings/mcp-presets/custom`,e,{headers:_u(t)})}async function ML(e,t,n=""){return Ve(`${n}/api/settings/mcp-presets/import`,e,{headers:_u({config:t})})}async function EL(e,t,n,r=""){return Ve(`${r}/api/settings/mcp-presets/tools`,e,{headers:_u({name:t,enabled_tools:n})})}async function IL(e,t=""){return(await Ve(`${t}/api/commands`,e,void 0,Kt)).commands.filter(r=>!["/stop","/restart"].includes(r.command)).map(r=>({command:r.command,title:r.title,description:r.description,icon:r.icon,argHint:r.arg_hint??""}))}async function LL(e,t=""){return Ve(`${t}/api/webui/sidebar-state`,e,void 0,Kt)}async function DL(e,t,n=""){const r=new URLSearchParams;return r.set("state",JSON.stringify(t)),Ve(`${n}/api/webui/sidebar-state/update?${r}`,e)}async function hv(e,t,n=""){const r=new URLSearchParams;return t.modelPreset!==void 0&&r.set("model_preset",t.modelPreset??"default"),t.model!==void 0&&r.set("model",t.model),t.provider!==void 0&&r.set("provider",t.provider),t.contextWindowTokens!==void 0&&r.set("context_window_tokens",String(t.contextWindowTokens)),t.timezone!==void 0&&r.set("timezone",t.timezone),t.botName!==void 0&&r.set("bot_name",t.botName),t.botIcon!==void 0&&r.set("bot_icon",t.botIcon),t.toolHintMaxLength!==void 0&&r.set("tool_hint_max_length",String(t.toolHintMaxLength)),Ve(`${n}/api/settings/update?${r}`,e)}async function OL(e,t,n=""){const r=new URLSearchParams;return t.name!==void 0&&r.set("name",t.name),r.set("label",t.label),r.set("provider",t.provider),r.set("model",t.model),Ve(`${n}/api/settings/model-configurations/create?${r}`,e)}async function FL(e,t,n=""){const r=new URLSearchParams;return r.set("name",t.name),t.label!==void 0&&r.set("label",t.label),t.provider!==void 0&&r.set("provider",t.provider),t.model!==void 0&&r.set("model",t.model),t.contextWindowTokens!==void 0&&r.set("context_window_tokens",String(t.contextWindowTokens)),Ve(`${n}/api/settings/model-configurations/update?${r}`,e)}async function zL(e,t,n=""){const r=new URLSearchParams;return r.set("provider",t.provider),t.apiKey!==void 0&&r.set("api_key",t.apiKey),t.apiBase!==void 0&&r.set("api_base",t.apiBase),t.apiType!==void 0&&r.set("api_type",t.apiType),Ve(`${n}/api/settings/provider/update?${r}`,e)}async function $L(e,t,n=""){const r=new URLSearchParams;return r.set("provider",t),Ve(`${n}/api/settings/provider/oauth-login?${r}`,e)}async function UL(e,t,n=""){const r=new URLSearchParams;return r.set("provider",t),Ve(`${n}/api/settings/provider/oauth-logout?${r}`,e)}async function BL(e,t,n=""){const r=new URLSearchParams;return r.set("provider",t.provider),t.apiKey!==void 0&&r.set("api_key",t.apiKey),t.baseUrl!==void 0&&r.set("base_url",t.baseUrl),t.maxResults!==void 0&&r.set("max_results",String(t.maxResults)),t.timeout!==void 0&&r.set("timeout",String(t.timeout)),t.useJinaReader!==void 0&&r.set("use_jina_reader",String(t.useJinaReader)),Ve(`${n}/api/settings/web-search/update?${r}`,e)}async function HL(e,t,n=""){const r=new URLSearchParams;return r.set("webui_allow_local_service_access",String(t.webuiAllowLocalServiceAccess)),r.set("webui_default_access_mode",t.webuiDefaultAccessMode),Ve(`${n}/api/settings/network-safety/update?${r}`,e)}async function WL(e,t,n=""){const r=new URLSearchParams;return r.set("enabled",String(t.enabled)),r.set("provider",t.provider),r.set("model",t.model),r.set("default_aspect_ratio",t.defaultAspectRatio),r.set("default_image_size",t.defaultImageSize),r.set("max_images_per_turn",String(t.maxImagesPerTurn)),Ve(`${n}/api/settings/image-generation/update?${r}`,e)}async function qL(e,t,n=""){const r=new URLSearchParams;return r.set("enabled",String(t.enabled)),r.set("provider",t.provider),r.set("model",t.model),r.set("language",t.language),r.set("max_duration_sec",String(t.maxDurationSec)),r.set("max_upload_mb",String(t.maxUploadMb)),Ve(`${n}/api/settings/transcription/update?${r}`,e)}function KL({skills:e}){const{t}=ie(),n=e.filter(o=>o.available).length,[r,a]=u.useState(null);return s.jsxs("div",{className:"space-y-7",children:[s.jsxs("section",{className:"flex flex-col gap-2 sm:flex-row sm:items-end sm:justify-between",children:[s.jsx("p",{className:"max-w-[680px] text-[13px] leading-5 text-muted-foreground",children:t("settings.skills.description",{defaultValue:"Review the instruction skills this agent can load during a conversation."})}),s.jsx("span",{className:"text-[12px] font-medium text-muted-foreground",children:t("settings.skills.caption",{available:n,total:e.length,defaultValue:"{{available}} available · {{total}} total"})})]}),s.jsxs("section",{children:[s.jsxs("div",{className:"flex items-center justify-between border-b border-border/45 pb-3",children:[s.jsx("h2",{className:"mb-2 px-1 text-[13px] font-semibold tracking-[-0.01em] text-foreground/85",children:t("settings.skills.featured",{defaultValue:"Agent skills"})}),s.jsx("span",{className:"rounded-full bg-muted px-2.5 py-1 text-[12px] font-medium text-muted-foreground",children:e.length})]}),e.length?s.jsx("div",{className:"grid gap-x-10 gap-y-1 py-3 md:grid-cols-2",children:e.map(o=>s.jsx(VL,{skill:o,onSelect:a},`${o.source}:${o.name}`))}):s.jsx("div",{className:"px-3 py-12 text-center text-sm text-muted-foreground",children:t("settings.skills.empty",{defaultValue:"No skills are available."})})]}),s.jsx(GL,{skill:r,open:r!==null,onOpenChange:o=>{o||a(null)}})]})}function VL({skill:e,onSelect:t}){const{t:n}=ie(),r=C1(e.source,n),a=e.available?Et:ja,o=e.available?n("settings.skills.statusAvailable",{defaultValue:"Available"}):n("settings.skills.statusUnavailable",{defaultValue:"Unavailable"});return s.jsxs("button",{type:"button","aria-label":n("settings.skills.openDetails",{name:e.name,defaultValue:"Open details for {{name}}"}),onClick:()=>t(e),className:j("group flex min-w-0 items-center gap-3 rounded-[16px] px-3 py-3 text-left transition-colors","hover:bg-muted/45 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",!e.available&&"opacity-65"),children:[s.jsx("div",{className:"flex h-12 w-12 shrink-0 items-center justify-center rounded-[14px] bg-muted/70 text-muted-foreground",children:s.jsx(Ga,{className:"h-5 w-5",strokeWidth:1.8,"aria-hidden":!0})}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[s.jsx("h3",{className:"truncate text-[15px] font-semibold leading-5 text-foreground",children:e.name}),s.jsx("span",{className:"shrink-0 rounded-full bg-muted px-1.5 py-0.5 text-[10px] font-semibold leading-none text-muted-foreground",children:r})]}),s.jsx("p",{className:"mt-1 line-clamp-2 text-[13px] leading-5 text-muted-foreground",children:e.description}),!e.available&&e.unavailable_reason?s.jsx("p",{className:"mt-1 truncate text-[12px] leading-4 text-muted-foreground/80",children:n("settings.skills.unavailableReason",{reason:e.unavailable_reason,defaultValue:"Missing: {{reason}}"})}):null]}),s.jsxs("span",{title:!e.available&&e.unavailable_reason?e.unavailable_reason:void 0,className:j("hidden shrink-0 items-center gap-1 rounded-full px-2.5 py-1 text-[12px] font-medium sm:inline-flex",e.available?"bg-emerald-500/10 text-emerald-700 dark:text-emerald-300":"bg-muted text-muted-foreground"),children:[s.jsx(a,{className:"h-3.5 w-3.5","aria-hidden":!0}),o]})]})}function GL({skill:e,open:t,onOpenChange:n}){const{token:r}=kr(),{t:a}=ie(),[o,i]=u.useState(null),[l,c]=u.useState(!1),[d,p]=u.useState(!1);if(u.useEffect(()=>{if(!t||!e)return;let y=!1;return i(null),c(!0),p(!1),wL(r,e.name).then(x=>{y||i(x)}).catch(()=>{y||p(!0)}).finally(()=>{y||c(!1)}),()=>{y=!0}},[t,e,r]),!e)return null;const m=o??e,f=C1(m.source,a),h=m.available?a("settings.skills.statusAvailable",{defaultValue:"Available"}):a("settings.skills.statusUnavailable",{defaultValue:"Unavailable"});return s.jsx(qf,{open:t,onOpenChange:n,children:s.jsx(ju,{side:"right",className:"w-[min(34rem,calc(100vw-1rem))] max-w-none gap-0 overflow-hidden p-0 sm:max-w-none",children:s.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto px-5 py-5",children:[s.jsxs("div",{className:"flex items-start gap-3 pr-8",children:[s.jsx("div",{className:"flex h-12 w-12 shrink-0 items-center justify-center rounded-[15px] bg-muted/70 text-muted-foreground",children:s.jsx(Ga,{className:"h-5 w-5",strokeWidth:1.8,"aria-hidden":!0})}),s.jsxs("div",{className:"min-w-0",children:[s.jsx(Au,{className:"truncate text-[20px] font-semibold",children:m.name}),s.jsx(b1,{className:"sr-only",children:a("settings.skills.detailDescription",{name:m.name,defaultValue:"Details for {{name}}."})}),s.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-1.5 text-[12px] text-muted-foreground",children:[s.jsx(sm,{children:f}),s.jsx(sm,{tone:m.available?"success":"muted",children:h})]})]})]}),l?s.jsxs("div",{className:"mt-8 flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(pt,{className:"h-4 w-4 animate-spin","aria-hidden":!0}),a("settings.skills.loadingDetail",{defaultValue:"Loading skill details..."})]}):d?s.jsx("div",{className:"mt-8 rounded-[16px] bg-destructive/10 px-3 py-3 text-sm text-destructive",children:a("settings.skills.loadFailed",{defaultValue:"Could not load skill details."})}):s.jsxs("div",{className:"mt-7 space-y-6",children:[s.jsx(om,{title:a("settings.skills.descriptionTitle",{defaultValue:"Description"}),children:s.jsx("p",{className:"text-[14px] leading-6 text-muted-foreground",children:m.description})}),s.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[s.jsx(gv,{label:a("settings.skills.source",{defaultValue:"Source"}),value:f}),s.jsx(gv,{label:a("settings.skills.status",{defaultValue:"Status"}),value:h})]}),!m.available&&m.unavailable_reason?s.jsx(om,{title:a("settings.skills.unavailableReasonLabel",{defaultValue:"Unavailable reason"}),children:s.jsx("p",{className:"text-[13px] leading-5 text-destructive/85",children:m.unavailable_reason})}):null,o?s.jsx(QL,{detail:o}):null,o?s.jsx(YL,{markdown:o.raw_markdown}):null]})]})})})}function YL({markdown:e}){const{t}=ie(),n=e||t("settings.skills.rawInstructionsEmpty",{defaultValue:"No raw instructions."});return s.jsxs("details",{className:"group rounded-[18px] border border-border/45 bg-muted/20 px-3 py-3",children:[s.jsx("summary",{className:"cursor-pointer select-none text-[13px] font-medium text-foreground/90 transition-colors hover:text-foreground",children:t("settings.skills.rawInstructions",{defaultValue:"Raw SKILL.md"})}),s.jsx("div",{className:"mt-3 overflow-hidden rounded-[14px] border border-border/35 bg-background/70",children:s.jsx("pre",{className:j("max-h-[min(42vh,32rem)] overflow-auto overscroll-contain px-3.5 py-3 pr-4","whitespace-pre-wrap break-words font-mono text-[12px] leading-[1.7] text-foreground/62","scrollbar-thin scrollbar-track-transparent","[&::-webkit-scrollbar]:h-1.5 [&::-webkit-scrollbar]:w-1.5","[&::-webkit-scrollbar-thumb]:bg-muted-foreground/25"),children:n})})]})}function gv({label:e,value:t}){return s.jsxs("div",{className:"rounded-[16px] bg-muted/35 px-3 py-2.5",children:[s.jsx("div",{className:"text-[11px] text-muted-foreground",children:e}),s.jsx("div",{className:"mt-0.5 truncate text-[13px] font-medium text-foreground",children:t})]})}function QL({detail:e}){const{t}=ie(),{bins:n,env:r,missing_bins:a,missing_env:o}=e.requirements,i=n.length>0||r.length>0;return s.jsx(om,{title:t("settings.skills.requirements",{defaultValue:"Requirements"}),children:i?s.jsxs("div",{className:"space-y-3",children:[a.length?s.jsx(Rl,{title:t("settings.skills.missingCommands",{defaultValue:"Missing CLI"}),items:a,tone:"danger",icon:s.jsx(_c,{className:"h-3.5 w-3.5","aria-hidden":!0})}):null,o.length?s.jsx(Rl,{title:t("settings.skills.missingEnvironment",{defaultValue:"Missing ENV"}),items:o,tone:"danger",icon:s.jsx(pg,{className:"h-3.5 w-3.5","aria-hidden":!0})}):null,n.length?s.jsx(Rl,{title:t("settings.skills.commands",{defaultValue:"Commands"}),items:n,icon:s.jsx(_c,{className:"h-3.5 w-3.5","aria-hidden":!0})}):null,r.length?s.jsx(Rl,{title:t("settings.skills.environment",{defaultValue:"Environment variables"}),items:r,icon:s.jsx(pg,{className:"h-3.5 w-3.5","aria-hidden":!0})}):null]}):s.jsx("p",{className:"text-[13px] text-muted-foreground",children:t("settings.skills.noRequirements",{defaultValue:"No explicit requirements."})})})}function om({title:e,children:t}){return s.jsxs("section",{children:[s.jsx("h3",{className:"mb-2 text-[12px] font-medium text-muted-foreground",children:e}),t]})}function Rl({title:e,items:t,icon:n,tone:r="muted"}){return s.jsxs("div",{className:"space-y-1.5",children:[s.jsxs("div",{className:j("flex items-center gap-1.5 text-[12px]",r==="danger"?"text-destructive":"text-muted-foreground"),children:[n,e]}),s.jsx("div",{className:"flex flex-wrap gap-1.5",children:t.map(a=>s.jsx(sm,{children:a},a))})]})}function sm({children:e,tone:t="muted"}){return s.jsx("span",{className:j("inline-flex max-w-full items-center rounded-full px-2 py-0.5 text-[11px] font-medium",t==="success"?"bg-emerald-500/10 text-emerald-700 dark:text-emerald-300":"bg-muted text-muted-foreground"),children:e})}function C1(e,t){return e==="workspace"?t("settings.skills.sourceWorkspace",{defaultValue:"Custom"}):e==="builtin"?t("settings.skills.sourceBuiltin",{defaultValue:"Built-in"}):e}var XL=Symbol("radix.slottable");function JL(e){const t=({children:n})=>s.jsx(s.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=XL,t}var ZL=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),e3="VisuallyHidden",S1=u.forwardRef((e,t)=>s.jsx(xt.span,{...e,ref:t,style:{...ZL,...e.style}}));S1.displayName=e3;var t3=S1,[Pu]=Aa("Tooltip",[wu]),Tu=wu(),N1="TooltipProvider",n3=700,im="tooltip.open",[r3,Vf]=Pu(N1),j1=e=>{const{__scopeTooltip:t,delayDuration:n=n3,skipDelayDuration:r=300,disableHoverableContent:a=!1,children:o}=e,i=u.useRef(!0),l=u.useRef(!1),c=u.useRef(0);return u.useEffect(()=>{const d=c.current;return()=>window.clearTimeout(d)},[]),s.jsx(r3,{scope:t,isOpenDelayedRef:i,delayDuration:n,onOpen:u.useCallback(()=>{window.clearTimeout(c.current),i.current=!1},[]),onClose:u.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>i.current=!0,r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:u.useCallback(d=>{l.current=d},[]),disableHoverableContent:a,children:o})};j1.displayName=N1;var Mi="Tooltip",[a3,rl]=Pu(Mi),A1=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:a,onOpenChange:o,disableHoverableContent:i,delayDuration:l}=e,c=Vf(Mi,e.__scopeTooltip),d=Tu(t),[p,m]=u.useState(null),f=$a(),h=u.useRef(0),y=i??c.disableHoverableContent,x=l??c.delayDuration,b=u.useRef(!1),[v,g]=uu({prop:r,defaultProp:a??!1,onChange:S=>{S?(c.onOpen(),document.dispatchEvent(new CustomEvent(im))):c.onClose(),o==null||o(S)},caller:Mi}),w=u.useMemo(()=>v?b.current?"delayed-open":"instant-open":"closed",[v]),k=u.useCallback(()=>{window.clearTimeout(h.current),h.current=0,b.current=!1,g(!0)},[g]),C=u.useCallback(()=>{window.clearTimeout(h.current),h.current=0,g(!1)},[g]),N=u.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{b.current=!0,g(!0),h.current=0},x)},[x,g]);return u.useEffect(()=>()=>{h.current&&(window.clearTimeout(h.current),h.current=0)},[]),s.jsx(nk,{...d,children:s.jsx(a3,{scope:t,contentId:f,open:v,stateAttribute:w,trigger:p,onTriggerChange:m,onTriggerEnter:u.useCallback(()=>{c.isOpenDelayedRef.current?N():k()},[c.isOpenDelayedRef,N,k]),onTriggerLeave:u.useCallback(()=>{y?C():(window.clearTimeout(h.current),h.current=0)},[C,y]),onOpen:k,onClose:C,disableHoverableContent:y,children:n})})};A1.displayName=Mi;var lm="TooltipTrigger",_1=u.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,a=rl(lm,n),o=Vf(lm,n),i=Tu(n),l=u.useRef(null),c=wt(t,l,a.onTriggerChange),d=u.useRef(!1),p=u.useRef(!1),m=u.useCallback(()=>d.current=!1,[]);return u.useEffect(()=>()=>document.removeEventListener("pointerup",m),[m]),s.jsx(rk,{asChild:!0,...i,children:s.jsx(xt.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...r,ref:c,onPointerMove:Re(e.onPointerMove,f=>{f.pointerType!=="touch"&&!p.current&&!o.isPointerInTransitRef.current&&(a.onTriggerEnter(),p.current=!0)}),onPointerLeave:Re(e.onPointerLeave,()=>{a.onTriggerLeave(),p.current=!1}),onPointerDown:Re(e.onPointerDown,()=>{a.open&&a.onClose(),d.current=!0,document.addEventListener("pointerup",m,{once:!0})}),onFocus:Re(e.onFocus,()=>{d.current||a.onOpen()}),onBlur:Re(e.onBlur,a.onClose),onClick:Re(e.onClick,a.onClose)})})});_1.displayName=lm;var Gf="TooltipPortal",[o3,s3]=Pu(Gf,{forceMount:void 0}),P1=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:a}=e,o=rl(Gf,t);return s.jsx(o3,{scope:t,forceMount:n,children:s.jsx(br,{present:n||o.open,children:s.jsx(pu,{asChild:!0,container:a,children:r})})})};P1.displayName=Gf;var os="TooltipContent",T1=u.forwardRef((e,t)=>{const n=s3(os,e.__scopeTooltip),{forceMount:r=n.forceMount,side:a="top",...o}=e,i=rl(os,e.__scopeTooltip);return s.jsx(br,{present:r||i.open,children:i.disableHoverableContent?s.jsx(R1,{side:a,...o,ref:t}):s.jsx(i3,{side:a,...o,ref:t})})}),i3=u.forwardRef((e,t)=>{const n=rl(os,e.__scopeTooltip),r=Vf(os,e.__scopeTooltip),a=u.useRef(null),o=wt(t,a),[i,l]=u.useState(null),{trigger:c,onClose:d}=n,p=a.current,{onPointerInTransitChange:m}=r,f=u.useCallback(()=>{l(null),m(!1)},[m]),h=u.useCallback((y,x)=>{const b=y.currentTarget,v={x:y.clientX,y:y.clientY},g=p3(v,b.getBoundingClientRect()),w=m3(v,g),k=f3(x.getBoundingClientRect()),C=g3([...w,...k]);l(C),m(!0)},[m]);return u.useEffect(()=>()=>f(),[f]),u.useEffect(()=>{if(c&&p){const y=b=>h(b,p),x=b=>h(b,c);return c.addEventListener("pointerleave",y),p.addEventListener("pointerleave",x),()=>{c.removeEventListener("pointerleave",y),p.removeEventListener("pointerleave",x)}}},[c,p,h,f]),u.useEffect(()=>{if(i){const y=x=>{const b=x.target,v={x:x.clientX,y:x.clientY},g=(c==null?void 0:c.contains(b))||(p==null?void 0:p.contains(b)),w=!h3(v,i);g?f():w&&(f(),d())};return document.addEventListener("pointermove",y),()=>document.removeEventListener("pointermove",y)}},[c,p,i,d,f]),s.jsx(R1,{...e,ref:o})}),[l3,c3]=Pu(Mi,{isInside:!1}),u3=JL("TooltipContent"),R1=u.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":a,onEscapeKeyDown:o,onPointerDownOutside:i,...l}=e,c=rl(os,n),d=Tu(n),{onClose:p}=c;return u.useEffect(()=>(document.addEventListener(im,p),()=>document.removeEventListener(im,p)),[p]),u.useEffect(()=>{if(c.trigger){const m=f=>{const h=f.target;h!=null&&h.contains(c.trigger)&&p()};return window.addEventListener("scroll",m,{capture:!0}),()=>window.removeEventListener("scroll",m,{capture:!0})}},[c.trigger,p]),s.jsx(du,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:m=>m.preventDefault(),onDismiss:p,children:s.jsxs(ak,{"data-state":c.stateAttribute,...d,...l,ref:t,style:{...l.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[s.jsx(u3,{children:r}),s.jsx(l3,{scope:n,isInside:!0,children:s.jsx(t3,{id:c.contentId,role:"tooltip",children:a||r})})]})})});T1.displayName=os;var M1="TooltipArrow",d3=u.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,a=Tu(n);return c3(M1,n).isInside?null:s.jsx(ok,{...a,...r,ref:t})});d3.displayName=M1;function p3(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),a=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(n,r,a,o)){case o:return"left";case a:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function m3(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function f3(e){const{top:t,right:n,bottom:r,left:a}=e;return[{x:a,y:t},{x:n,y:t},{x:n,y:r},{x:a,y:r}]}function h3(e,t){const{x:n,y:r}=e;let a=!1;for(let o=0,i=t.length-1;o<t.length;i=o++){const l=t[o],c=t[i],d=l.x,p=l.y,m=c.x,f=c.y;p>r!=f>r&&n<(m-d)*(r-p)/(f-p)+d&&(a=!a)}return a}function g3(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),v3(t)}function v3(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const a=e[r];for(;t.length>=2;){const o=t[t.length-1],i=t[t.length-2];if((o.x-i.x)*(a.y-i.y)>=(o.y-i.y)*(a.x-i.x))t.pop();else break}t.push(a)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const a=e[r];for(;n.length>=2;){const o=n[n.length-1],i=n[n.length-2];if((o.x-i.x)*(a.y-i.y)>=(o.y-i.y)*(a.x-i.x))n.pop();else break}n.push(a)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var x3=j1,y3=A1,b3=_1,w3=P1,E1=T1;const Ru=x3,Ei=y3,Ii=b3,ss=u.forwardRef(({className:e,sideOffset:t=4,...n},r)=>s.jsx(w3,{children:s.jsx(E1,{ref:r,sideOffset:t,className:j("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-xs text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95",e),...n})}));ss.displayName=E1.displayName;const I1=371,vv=Math.ceil(I1/7),xv=["user","api","cron","dream","system"];function Ed(e,t){const n=new Date(e);return n.setUTCDate(n.getUTCDate()+t),n}function cm(e){return e.toISOString().slice(0,10)}function k3(e){const[t,n,r]=e.split("-").map(Number);return new Date(Date.UTC(t,n-1,r))}function C3(e,t){if(!t)return cm(e);try{const n=new Intl.DateTimeFormat("en",{calendar:"gregory",numberingSystem:"latn",timeZone:t,year:"numeric",month:"2-digit",day:"2-digit"}).formatToParts(e),r=Object.fromEntries(n.map(a=>[a.type,a.value]));if(r.year&&r.month&&r.day)return[r.year.padStart(4,"0"),r.month.padStart(2,"0"),r.day.padStart(2,"0")].join("-")}catch{}return cm(e)}function S3(e,t,n){const r=new Map((e??[]).map(d=>[d.date,d])),a=k3(C3(new Date,n)),o=Ed(a,6-a.getUTCDay()),i=Ed(o,-370),l=[];return{cells:Array.from({length:I1},(d,p)=>{const m=Ed(i,p),f=cm(m),h=r.get(f);return m.getUTCDate()===1&&l.push({label:t.format(m),column:Math.floor(p/7)+1}),{date:f,total:(h==null?void 0:h.total_tokens)??0,estimated:(h==null?void 0:h.estimated_tokens)??0,requests:(h==null?void 0:h.requests)??0,sources:(h==null?void 0:h.sources)??{},future:m>a}}),monthLabels:l}}function N3(e,t){return e==="user"?t("settings.usage.sources.user","Chat"):e==="api"?t("settings.usage.sources.api","API"):e==="cron"?t("settings.usage.sources.cron","Automations"):e==="dream"?t("settings.usage.sources.dream","Memory"):t("settings.usage.sources.system","System")}function j3(e,t){const n=xv.filter(a=>{var o;return((o=e.sources[a])==null?void 0:o.total_tokens)>0}),r=Object.keys(e.sources).filter(a=>!xv.includes(a)).filter(a=>{var o;return((o=e.sources[a])==null?void 0:o.total_tokens)>0}).sort();return[...n,...r].map(a=>{var l;const o=N3(a,t),i=L1(((l=e.sources[a])==null?void 0:l.total_tokens)??0);return`${o} ${i}`}).join(" · ")}function L1(e){return e>=1e6?`${(e/1e6).toFixed(e>=1e7?0:1)}M`:e>=1e3?`${(e/1e3).toFixed(e>=1e4?0:1)}K`:String(e)}function A3(e,t){if(e<=0||t<=0)return 0;const n=e/t;return n>=.75?4:n>=.45?3:n>=.2?2:1}function _3(e,t){return t?"bg-transparent ring-1 ring-neutral-200/70 dark:ring-white/[0.045]":e===4?"bg-sky-300 dark:bg-sky-300":e===3?"bg-sky-400/85 dark:bg-sky-500/80":e===2?"bg-sky-500/60 dark:bg-sky-700/85":e===1?"bg-sky-500/30 dark:bg-sky-900/80":"bg-neutral-200/70 ring-1 ring-black/[0.025] dark:bg-white/[0.08] dark:ring-white/[0.035]"}function P3({usage:e,timeZone:t}){const{t:n,i18n:r}=ie(),a=(d,p,m)=>n(d,{defaultValue:p,...m??{}}),o=u.useMemo(()=>new Intl.DateTimeFormat(r.language,{month:"short",timeZone:"UTC"}),[r.language]),{cells:i,monthLabels:l}=u.useMemo(()=>S3(e==null?void 0:e.days,o,t),[o,t,e==null?void 0:e.days]),c=Math.max(0,...i.map(d=>d.total));return s.jsx("div",{className:"overflow-x-auto pb-1 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:s.jsxs("div",{className:"mx-auto w-full min-w-0 max-w-[1054px] px-0.5 sm:min-w-[760px]",children:[s.jsx("div",{className:"mb-2 flex justify-end",children:s.jsx("span",{className:"text-[11px] font-normal leading-none text-muted-foreground/64",children:a("settings.usage.shortTitle","Token Usage")})}),s.jsx("div",{className:"relative mb-2 h-4 text-[10px] font-normal leading-4 text-muted-foreground/62","aria-hidden":!0,children:l.map(d=>s.jsx("span",{className:"absolute top-0 whitespace-nowrap",style:{left:`${(d.column-1)/vv*100}%`},children:d.label},`${d.label}-${d.column}`))}),s.jsx("div",{className:"grid grid-flow-col grid-rows-7 gap-[3px] sm:gap-1.5",style:{gridTemplateColumns:`repeat(${vv}, minmax(0, 1fr))`},"aria-label":a("settings.usage.title","Token activity"),children:s.jsx(Ru,{delayDuration:120,skipDelayDuration:80,children:i.map(d=>{const p=A3(d.total,c),m=d.future?d.date:a("settings.usage.cellTitle","{{date}}: {{tokens}} tokens, {{requests}} requests",{date:d.date,tokens:L1(d.total),requests:d.requests}),f=d.future||d.estimated<=0?m:`${m} · ${d.estimated>=d.total?a("settings.usage.estimated","estimated"):a("settings.usage.includesEstimates","includes estimates")}`,h=d.future?"":j3(d,a),y=h?`${f} · ${h}`:f;return s.jsxs(Ei,{children:[s.jsx(Ii,{asChild:!0,children:s.jsx("span",{"aria-label":y,className:j("aspect-square w-full rounded-[2px] transition-transform hover:scale-110 sm:rounded-[4px]",_3(p,d.future))})}),s.jsxs(ss,{side:"top",align:"center",className:"rounded-[10px] border-border/45 bg-popover px-2.5 py-1.5 text-[11px] font-normal text-popover-foreground shadow-lg",children:[s.jsx("span",{className:"block",children:f}),h?s.jsx("span",{className:"mt-1 block text-muted-foreground",children:h}):null]})]},d.date)})})})]})})}const Ro=u.forwardRef(({className:e,...t},n)=>s.jsx("textarea",{className:j("flex min-h-[60px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...t}));Ro.displayName="Textarea";const D1="nanobot:cli-apps-changed";function T3(e){return!!e&&typeof e=="object"&&Array.isArray(e.apps)}function R3(e){return e.apps.filter(t=>t.installed)}function M3(e){typeof window>"u"||window.dispatchEvent(new CustomEvent(D1,{detail:e}))}const E3=0,yv=1,bv=2,Ml=3;function Ja(){return typeof window>"u"?null:window.nanobotHost??null}function wv(e){return e==="native"?"native":"browser"}function kv(e,t){const n=Ja(),r={can_export_diagnostics:!1,can_open_logs:!1,can_pick_folder:!1,can_restart_engine:!1,...t??{}},a=F1();return{surface:e,capabilities:r,socketFactory:a?O1:void 0,pickFolder:n==null?void 0:n.pickFolder,restartEngine:n==null?void 0:n.restartEngine,openLogs:n==null?void 0:n.openLogs,exportDiagnostics:n==null?void 0:n.exportDiagnostics}}function O1(e){const t=F1();if(!t)throw new Error("Host WebSocket bridge is not available");return new I3(t,e)}function F1(){const e=Ja();return!(e!=null&&e.openSocket)||!e.sendSocket||!e.closeSocket||!e.onSocketEvent?null:{closeSocket:e.closeSocket,onSocketEvent:e.onSocketEvent,openSocket:e.openSocket,sendSocket:e.sendSocket}}class I3{constructor(t,n){He(this,"binaryType","blob");He(this,"onclose",null);He(this,"onerror",null);He(this,"onmessage",null);He(this,"onopen",null);He(this,"readyState",E3);He(this,"url");He(this,"id",null);He(this,"queued",[]);He(this,"unsubscribe");this.api=t,this.url=n,this.unsubscribe=t.onSocketEvent(r=>this.handleEvent(r)),t.openSocket(n).then(r=>{this.id=r},()=>{var r,a;this.readyState=Ml,(r=this.onerror)==null||r.call(this,new Event("error")),(a=this.onclose)==null||a.call(this,Cv()),this.unsubscribe()})}close(){this.readyState===bv||this.readyState===Ml||(this.readyState=bv,this.id?this.api.closeSocket(this.id):(this.readyState=Ml,this.unsubscribe()))}send(t){if(typeof t!="string")throw new Error("Host WebSocket bridge only supports text frames");if(this.readyState===yv&&this.id){this.api.sendSocket(this.id,t);return}this.queued.push(t)}handleEvent(t){var n,r,a,o;if(!(!this.id||t.id!==this.id)){if(t.type==="open"){for(this.readyState=yv,(n=this.onopen)==null||n.call(this,new Event("open"));this.queued.length>0&&this.id;){const i=this.queued.shift();i!==void 0&&this.api.sendSocket(this.id,i)}return}if(t.type==="message"){(r=this.onmessage)==null||r.call(this,new MessageEvent("message",{data:t.data}));return}if(t.type==="error"){(a=this.onerror)==null||a.call(this,new Event("error"));return}this.readyState=Ml,(o=this.onclose)==null||o.call(this,Cv(t.code,t.reason)),this.unsubscribe()}}}function Cv(e=1006,t=""){return typeof CloseEvent<"u"?new CloseEvent("close",{code:e,reason:t}):new Event("close")}const z1="nanobot:mcp-presets-changed";function L3(e){return!!e&&typeof e=="object"&&Array.isArray(e.presets)}function D3(e){return e.presets.filter(t=>t.installed&&t.configured)}function El(e){typeof window>"u"||window.dispatchEvent(new CustomEvent(z1,{detail:e}))}function O3(e){return`https://${e}/favicon.ico`}function F3(e){return`https://icons.duckduckgo.com/ip3/${encodeURIComponent(e)}.ico`}function z3(e){return`https://www.google.com/s2/favicons?domain=${encodeURIComponent(e)}&sz=64`}function Uc(e){const t=U3(e);return[O3(t),F3(t),z3(e)]}function De(e,t,n,r=[]){const a=[...r];return Uc(e).forEach(o=>qs(a,o)),{logoUrl:a[0],logoUrls:a,color:t,initials:n}}function qs(e,t){const n=t==null?void 0:t.trim();n&&!e.includes(n)&&e.push(n)}function $3(e){if(e.startsWith("/"))return null;try{const t=new URL(e);if(!/^https?:$/.test(t.protocol))return null;const n=t.hostname.toLowerCase();if(n==="www.google.com"||n==="google.com")return t.searchParams.get("domain");if(n==="icons.duckduckgo.com"){const r=t.pathname.match(/^\/ip3\/(.+)\.ico$/);return r?decodeURIComponent(r[1]):null}return n.replace(/^www\./,"")}catch{return null}}function U3(e){var n;return((n=e.split("/")[0])==null?void 0:n.trim())||e}function oo(e){const t=e==null?void 0:e.trim();if(!t)return[];if(t.startsWith("/"))return[t];const n=[],r=$3(t),a=/^(https?:\/\/)?(www\.google\.com|google\.com|icons\.duckduckgo\.com)\//i.test(t);return r&&a?(qs(n,t),Uc(r).forEach(o=>qs(n,o)),n):(qs(n,t),r&&Uc(r).forEach(o=>qs(n,o)),n)}const B3={brave_search:"brave",byteplus_coding_plan:"byteplus",mimo:"xiaomi_mimo",minimaxAnthropic:"minimax",minimax_anthropic:"minimax",openai_codex:"openai",xiaomi:"xiaomi_mimo",volcengine_coding_plan:"volcengine"},H3={brave_search:"Brave Search",byteplus_coding_plan:"BytePlus",minimaxAnthropic:"MiniMax",minimax_anthropic:"MiniMax",openai_codex:"OpenAI",volcengine_coding_plan:"Volcengine"},W3={aihubmix:De("aihubmix.com","#111827","AH"),ant_ling:De("ant-ling.com","#7C3AED","AL"),anthropic:De("anthropic.com","#D97757","A"),assemblyai:De("assemblyai.com","#111827","AA"),atomic_chat:De("atomic.chat","#111827","AC"),azure_openai:De("azure.microsoft.com","#0078D4","AZ"),bedrock:De("aws.amazon.com","#FF9900","AWS"),bocha:De("bochaai.com","#2563EB","B"),brave:De("brave.com","#FB542B","B"),byteplus:De("byteplus.com","#325CFF","BP"),dashscope:De("dashscope.aliyun.com","#FF6A00","DS"),deepseek:De("deepseek.com","#4D6BFE","DS"),duckduckgo:De("duckduckgo.com","#DE5833","DDG"),exa:De("exa.ai","#5B5BF6","E"),gemini:De("gemini.google.com","#4285F4","G"),github_copilot:De("github.com","#24292F","GH"),groq:De("groq.com","#F55036","GQ"),huggingface:De("huggingface.co","#FF9D00","HF"),jina:De("jina.ai","#7C3AED","J"),kagi:De("kagi.com","#FFB319","K"),keenable:De("keenable.ai","#0EA5E9","K"),lm_studio:De("lmstudio.ai","#111827","LM"),longcat:De("longcatai.org","#4F8CFF","LC",["https://www.longcatai.org/favicon.svg"]),minimax:De("minimax.io","#111827","MM"),mistral:De("mistral.ai","#FA520F","M"),moonshot:De("moonshot.ai","#111827","MS"),novita:De("novita.ai","#7C3AED","N"),olostep:De("olostep.com","#111827","O"),nvidia:De("nvidia.com","#76B900","NV"),ollama:De("ollama.com","#111827","O"),openai:De("openai.com","#111827","AI"),openrouter:De("openrouter.ai","#111827","OR"),ovms:De("openvino.ai","#0071C5","OV"),qianfan:De("cloud.baidu.com","#2932E1","QF"),searxng:De("searxng.org","#3050FF","SX"),siliconflow:De("siliconflow.cn","#111827","SF"),skywork:De("skywork.ai","#5B5BF6","SW"),stepfun:De("stepfun.com","#2F6BFF","SF",["https://www.stepfun.com/step_favicon.svg"]),tavily:De("tavily.com","#111827","T"),volcengine:De("volcengine.com","#1664FF","VE"),vllm:De("vllm.ai","#2563EB","VL"),xiaomi_mimo:De("mimo.xiaomi.com","#FF6900","MI",["https://mimo.xiaomi.com/mimo-v2-pro/assets/logo.svg"]),zhipu:De("z.ai","#155EEF","Z",["https://z-cdn.chatglm.cn/z-ai/static/logo.svg","https://www.google.com/s2/favicons?domain=z.ai&sz=64"])};function al(e){if(!e)return null;const t=B3[e]??e;return W3[t]??null}function Mo(e,t){var n;return t?((n=e.find(r=>r.name===t))==null?void 0:n.label)??H3[t]??t:""}function um(e){const t=(e??"").trim().toLowerCase();if(!t)return null;const n=t.split(/[/:]/)[0];return al(n)?n:/claude|anthropic/.test(t)?"anthropic":/gpt-|^o\d|chatgpt|openai/.test(t)?"openai":/deepseek/.test(t)?"deepseek":/gemini/.test(t)?"gemini":/qwen|dashscope/.test(t)?"dashscope":/kimi|moonshot/.test(t)?"moonshot":/minimax/.test(t)?"minimax":/mistral|mixtral/.test(t)?"mistral":/skywork|skyclaw/.test(t)?"skywork":/ring-/.test(t)?"ant_ling":null}const q3=[65536,2e5,262144],K3=new Set(["aihubmix","atomic_chat","byteplus","byteplus_coding_plan","huggingface","lm_studio","novita","ollama","openrouter","ovms","siliconflow","vllm","volcengine","volcengine_coding_plan"]),V3=2,G3=2e3,Y3=30,Q3=["UTC","Asia/Shanghai","Asia/Hong_Kong","Asia/Tokyo","Asia/Seoul","Asia/Singapore","Asia/Taipei","Asia/Dubai","Asia/Kolkata","Europe/London","Europe/Paris","Europe/Berlin","Europe/Amsterdam","America/New_York","America/Chicago","America/Denver","America/Los_Angeles","America/Toronto","America/Sao_Paulo","Australia/Sydney","Pacific/Auckland"],$1="nanobot-webui.settings-preferences",Sv={density:"comfortable",activityMode:"auto",codeWrap:!0,brandLogos:!0},Nv=[{value:"auto",label:"Auto"},{value:"chat_completions",label:"Chat Completions"},{value:"responses",label:"Responses"}],X3=new Map(["vllm","ollama","lm_studio","atomic_chat","ovms"].map((e,t)=>[e,t])),J3=["1:1","3:4","9:16","4:3","16:9","3:2","2:3","21:9"],Z3=["1K","2K","4K","1024x1024","1536x1024","1024x1536"],Id={runtime:!1,browser:!1,image:!1},jv={name:"",transport:"stdio",command:"",args:"",url:"",env:"",headers:"",toolTimeout:"30"};function eD(){try{const e=window.localStorage.getItem($1);if(!e)return Sv;const t=JSON.parse(e);return{density:t.density==="compact"?"compact":"comfortable",activityMode:t.activityMode==="expanded"?"expanded":"auto",codeWrap:t.codeWrap!==!1,brandLogos:t.brandLogos!==!1}}catch{return Sv}}function U1(e){return e.agent.model_preset||"default"}function Li(e){return e.model_presets.find(t=>t.is_default)??null}function Di(e){return typeof e=="number"&&Number.isFinite(e)&&e>0?e:2e5}function Oi(e){const t=Li(e);return(t==null?void 0:t.provider)??e.agent.provider??e.agent.resolved_provider??""}function dm(e,t){return t?e.providers.find(n=>n.name===t)??null:null}function Mu(e,t){const n=dm(e,t);if(n)return n.configured;if(t==="auto"){const r=dm(e,e.agent.resolved_provider??e.agent.provider);if(r)return r.configured}return e.agent.has_api_key}const tD={model:"",provider:"",modelPreset:"default",presetLabel:"Default",contextWindowTokens:2e5,timezone:"UTC",botName:"nanobot",botIcon:"",toolHintMaxLength:40},nD={provider:"duckduckgo",apiKey:"",baseUrl:"",maxResults:5,timeout:30,useJinaReader:!0},rD={enabled:!1,provider:"openrouter",model:"openai/gpt-5.4-image-2",defaultAspectRatio:"1:1",defaultImageSize:"1K",maxImagesPerTurn:4},aD={enabled:!0,provider:"groq",model:"",language:"",maxDurationSec:120,maxUploadMb:25},Eu={enabled:!0,provider:"groq",provider_configured:!1,model:"whisper-large-v3",language:null,max_duration_sec:120,max_upload_mb:25,providers:[]},oD={webuiAllowLocalServiceAccess:!0,webuiDefaultAccessMode:"default"};function Av(e){const t=Li(e),n=U1(e),r=e.model_presets.find(a=>a.name===n)??t;return{model:(r==null?void 0:r.model)??e.agent.model,provider:r!=null&&r.is_default?Oi(e):(r==null?void 0:r.provider)??Oi(e),modelPreset:n,presetLabel:(r==null?void 0:r.label)??n,contextWindowTokens:Di((r==null?void 0:r.context_window_tokens)??e.agent.context_window_tokens),timezone:e.agent.timezone,botName:e.agent.bot_name,botIcon:e.agent.bot_icon,toolHintMaxLength:e.agent.tool_hint_max_length}}function _v(e,t){return{provider:e.web_search.provider,apiKey:(t==null?void 0:t.provider)===e.web_search.provider?t.apiKey??"":"",baseUrl:e.web_search.base_url??"",maxResults:e.web_search.max_results,timeout:e.web_search.timeout,useJinaReader:e.web.fetch.use_jina_reader}}function si(e){return(e==null?void 0:e.credential)==="api_key"||(e==null?void 0:e.credential)==="optional_api_key"}function B1(e){return(e==null?void 0:e.credential)==="api_key"}function Pv(e){return{enabled:e.image_generation.enabled,provider:e.image_generation.provider,model:e.image_generation.model,defaultAspectRatio:e.image_generation.default_aspect_ratio,defaultImageSize:e.image_generation.default_image_size,maxImagesPerTurn:e.image_generation.max_images_per_turn}}function Tv(e){const t=e.transcription??Eu;return{enabled:t.enabled,provider:t.provider,model:t.model,language:t.language??"",maxDurationSec:t.max_duration_sec,maxUploadMb:t.max_upload_mb}}function Rv(e){return{webuiAllowLocalServiceAccess:e.advanced.webui_allow_local_service_access??e.advanced.allow_local_preview_access??!0,webuiDefaultAccessMode:W1(e.advanced.webui_default_access_mode)}}function sD(e){const t=e.restart_required_sections??[];return{runtime:t.includes("runtime"),browser:t.includes("browser"),image:t.includes("image")}}function iD({theme:e,initialSection:t="overview",initialSettings:n=null,showSidebar:r=!0,onToggleTheme:a,onBackToChat:o,onModelNameChange:i,onSettingsChange:l,skills:c=[],onWorkspaceSettingsChange:d,onSectionChange:p,onLogout:m,onRestart:f,onNativeEngineRestart:h,isRestarting:y=!1,hostChromeInset:x=!1}){const{t:b}=ie(),{token:v}=kr(),[g,w]=u.useState(()=>n),[k,C]=u.useState(null),[N,S]=u.useState(null),[A,E]=u.useState(null),[_,R]=u.useState(()=>n===null),[T,F]=u.useState(!0),[z,K]=u.useState(!0),[$,W]=u.useState(!1),[P,D]=u.useState(!1),[G,Y]=u.useState(!1),[oe,de]=u.useState(!1),[pe,le]=u.useState({label:"",provider:"",model:""}),[I,Q]=u.useState(null),[O,ne]=u.useState(null),[he,ve]=u.useState(null),[me,ee]=u.useState(!1),[we,je]=u.useState(!1),[xe,Ee]=u.useState(!1),[$e,Se]=u.useState(!1),[Fe,B]=u.useState(!1),[X,J]=u.useState(null),[ye,Ie]=u.useState(t),[Ne,Je]=u.useState(null),[ue,Be]=u.useState(""),[ze,We]=u.useState(""),[nr,xn]=u.useState(""),[Qe,yn]=u.useState("all"),[rr,cn]=u.useState("next"),[zt,jt]=u.useState(null),[Vr,kt]=u.useState(null),[ar,Cr]=u.useState(null),[Hn,bn]=u.useState("all"),[or,Ze]=u.useState(null),[Sr,et]=u.useState(null),[$t,nt]=u.useState(null),[At,In]=u.useState(null),[wn,un]=u.useState(null),[Wn,sr]=u.useState(null),[Gr,Nr]=u.useState({}),[en,be]=u.useState(jv),[Ae,mt]=u.useState(""),[Vt,Me]=u.useState({}),[yt,tn]=u.useState({}),[Gt,It]=u.useState({}),[ft,Ct]=u.useState(Id),[Lt,ir]=u.useState(()=>eD()),[St,Ut]=u.useState(()=>n?_v(n):nD),[nn,lo]=u.useState(()=>n?Pv(n):rD),[kn,co]=u.useState(()=>n?Tv(n):aD),[H,q]=u.useState(()=>n?Rv(n):oD);u.useEffect(()=>{Ie(t)},[t]);const se=u.useCallback(M=>{Ie(M),p==null||p(M)},[p]),[ke,Le]=u.useState(!1),[Dt,jr]=u.useState(!1),[qe,Cn]=u.useState(()=>n?Av(n):tD),Ar=u.useCallback((M,V,re)=>b(M,{defaultValue:V,...re??{}}),[b]),_t=u.useCallback(M=>{w(M),Cn(Av(M)),Ut(V=>_v(M,V)),lo(Pv(M)),co(Tv(M)),q(Rv(M)),M.restart_required_sections&&Ct(sD(M)),l==null||l(M)},[l]);u.useEffect(()=>{!n||g!==null||(_t(n),R(!1))},[_t,n,g]),u.useEffect(()=>{let M=!1;const V=g===null;return V&&R(!0),oi(v).then(re=>{M||(_t(re),J(null))}).catch(re=>{!M&&V&&J(re.message)}).finally(()=>{M||R(!1)}),()=>{M=!0}},[_t,v]);const Ss=g!==null;u.useEffect(()=>{if(ye!=="overview"||!Ss)return;let M=!1;const V=()=>{CL(v).then(_e=>{M||w(lt=>lt&&{...lt,usage:_e})}).catch(()=>{})};V();const re=window.setInterval(V,5e3),ce=()=>V(),Te=()=>{document.visibilityState==="visible"&&V()};return window.addEventListener("focus",ce),document.addEventListener("visibilitychange",Te),()=>{M=!0,window.clearInterval(re),window.removeEventListener("focus",ce),document.removeEventListener("visibilitychange",Te)}},[ye,Ss,v]),u.useEffect(()=>{if(ye!=="apps")return;let M=!1,V=null,re=0;const ce=Te=>{Te&&F(!0),jL(v).then(_e=>{M||(_e.catalog_refresh_pending&&re<Y3&&(re+=1,V=window.setTimeout(()=>{V=null,ce(!1)},G3)),C(_e),kt(null),F(!1))}).catch(_e=>{M||(kt(_e.message),F(!1))})};return ce(!0),()=>{M=!0,V!==null&&window.clearTimeout(V)}},[ye,v]),u.useEffect(()=>{if(ye!=="apps")return;let M=!1;return K(!0),k1(v).then(V=>{M||(S(V),et(null))}).catch(V=>{M||et(V.message)}).finally(()=>{M||K(!1)}),()=>{M=!0}},[ye,v]);const L=u.useCallback(async(M=!1)=>{M&&W(!0);try{const V=await fv(v);E(V),nt(null)}catch(V){nt(V.message)}finally{M&&W(!1)}},[v]);u.useEffect(()=>{if(ye!=="automations")return;let M=!1;const V=async(Te=!1)=>{if(!M){Te&&W(!0);try{const _e=await fv(v);if(M)return;E(_e),nt(null)}catch(_e){M||nt(_e.message)}finally{!M&&Te&&W(!1)}}};V(!0);const re=window.setInterval(()=>void V(!1),5e3),ce=()=>{document.visibilityState!=="hidden"&&V(!1)};return window.addEventListener("focus",ce),document.addEventListener("visibilitychange",ce),()=>{M=!0,window.clearInterval(re),window.removeEventListener("focus",ce),document.removeEventListener("visibilitychange",ce)}},[ye,v]),u.useEffect(()=>{try{window.localStorage.setItem($1,JSON.stringify(Lt))}catch{}},[Lt]),u.useEffect(()=>{g&&Me(M=>{var re,ce,Te;const V={...M};for(const _e of g.providers)V[_e.name]={apiKey:((re=V[_e.name])==null?void 0:re.apiKey)??"",apiBase:((ce=V[_e.name])==null?void 0:ce.apiBase)??_e.api_base??_e.default_api_base??"",apiType:((Te=V[_e.name])==null?void 0:Te.apiType)??_e.api_type??"auto"};return V})},[g]);const U=u.useMemo(()=>{if(!g)return!1;const M=U1(g),V=g.model_presets.find(ce=>ce.name===qe.modelPreset);if(!V)return qe.modelPreset!==M;const re=V.is_default?Oi(g):V.provider;return qe.modelPreset!==M||qe.model!==V.model||qe.provider!==re||qe.contextWindowTokens!==Di(V.context_window_tokens)||!V.is_default&&qe.presetLabel.trim()!==V.label},[qe,g]),Z=u.useMemo(()=>g?qe.timezone!==g.agent.timezone||qe.botName!==g.agent.bot_name||qe.botIcon!==g.agent.bot_icon:!1,[qe,g]),Ce=u.useMemo(()=>g?nn.enabled!==g.image_generation.enabled||nn.provider!==g.image_generation.provider||nn.model!==g.image_generation.model||nn.defaultAspectRatio!==g.image_generation.default_aspect_ratio||nn.defaultImageSize!==g.image_generation.default_image_size||nn.maxImagesPerTurn!==g.image_generation.max_images_per_turn:!1,[nn,g]),Ke=u.useMemo(()=>{if(!g)return!1;const M=g.transcription??Eu;return kn.enabled!==M.enabled||kn.provider!==M.provider||kn.model!==M.model||kn.language!==(M.language??"")||kn.maxDurationSec!==M.max_duration_sec||kn.maxUploadMb!==M.max_upload_mb},[g,kn]),rt=u.useMemo(()=>{if(!g)return!1;const M=g.advanced.webui_allow_local_service_access??g.advanced.allow_local_preview_access??!0,V=W1(g.advanced.webui_default_access_mode);return H.webuiAllowLocalServiceAccess!==M||H.webuiDefaultAccessMode!==V},[H,g]),Ln=u.useMemo(()=>(g==null?void 0:g.providers.filter(M=>M.configured&&M.model_selectable!==!1).map(M=>({name:M.name,label:M.label})))??[],[g]),qn=u.useMemo(()=>!!(g!=null&&g.requires_restart)||ft.runtime||ft.browser||ft.image,[ft,g==null?void 0:g.requires_restart]),Pt=u.useCallback(async()=>{var V;if(((g==null?void 0:g.surface)??(g==null?void 0:g.runtime_surface))==="native"&&((V=g==null?void 0:g.runtime_capabilities)!=null&&V.can_restart_engine)&&h){B(!0);try{const re=await h(),ce=await oi(re);_t(ce),Ct(Id),J(null)}catch(re){J(re.message)}finally{B(!1)}return}f==null||f()},[_t,h,f,g]),Sn=u.useCallback(async M=>{const V=M.surface??M.runtime_surface??(g==null?void 0:g.surface)??(g==null?void 0:g.runtime_surface),re=M.runtime_capabilities??(g==null?void 0:g.runtime_capabilities),ce=V==="native";if(!(!M.requires_restart||!ce||!(re!=null&&re.can_restart_engine)||!h)){B(!0);try{const Te=await h(),_e=await oi(Te);_t(_e),Ct(Id),J(null)}catch(Te){J(Te.message)}finally{B(!1)}}},[_t,h,g]),Ns=async()=>{var M,V;if(!(!g||!U||P)){D(!0);try{const re=g.model_presets.find(Te=>Te.name===qe.modelPreset);let ce;if(re&&!re.is_default)ce=await FL(v,{name:re.name,label:qe.presetLabel.trim(),model:qe.model,provider:qe.provider,...qe.contextWindowTokens!==re.context_window_tokens?{contextWindowTokens:qe.contextWindowTokens}:{}});else{const Te=((M=Li(g))==null?void 0:M.model)??g.agent.model,_e=Oi(g),lt=Di(((V=Li(g))==null?void 0:V.context_window_tokens)??g.agent.context_window_tokens);ce=await hv(v,{modelPreset:qe.modelPreset,...qe.model!==Te?{model:qe.model}:{},...qe.provider!==_e?{provider:qe.provider}:{},...qe.contextWindowTokens!==lt?{contextWindowTokens:qe.contextWindowTokens}:{}})}_t(ce),i(ce.agent.model||null),J(null)}catch(re){J(re.message)}finally{D(!1)}}},dS=()=>{var re,ce;if(!g)return;const M=g.agent.provider,V=((re=Ln.find(Te=>Te.name===M))==null?void 0:re.name)??((ce=Ln[0])==null?void 0:ce.name)??"";le({label:"",provider:V,model:""}),Y(!0)},pS=async()=>{if(oe)return;const M=pe.label.trim(),V=pe.provider.trim(),re=pe.model.trim();if(!(!M||!V||!re)){de(!0);try{const ce=await OL(v,{label:M,provider:V,model:re});_t(ce),i(ce.agent.model||null),Y(!1),J(null)}catch(ce){J(ce.message)}finally{de(!1)}}},mS=async()=>{if(!(!g||!Z||P)){D(!0);try{const M=await hv(v,{timezone:qe.timezone,botName:qe.botName,botIcon:qe.botIcon});_t(M),M.requires_restart&&Ct(V=>({...V,runtime:!0})),await(d==null?void 0:d()),await Sn(M),J(null)}catch(M){J(M.message)}finally{D(!1)}}},fS=async()=>{if(!(!g||!Ce||we)){je(!0);try{const M=await WL(v,nn);_t(M),M.requires_restart&&Ct(V=>({...V,image:!0})),await Sn(M),J(null)}catch(M){J(M.message)}finally{je(!1)}}},hS=async()=>{if(!(!g||!Ke||xe)){Ee(!0);try{const M=await qL(v,kn);_t(M),M.requires_restart&&Ct(V=>({...V,browser:!0})),await Sn(M),J(null)}catch(M){J(M.message)}finally{Ee(!1)}}},gS=async()=>{if(!(!g||!rt||$e)){Se(!0);try{const M=await HL(v,H);_t(M),M.requires_restart&&Ct(V=>({...V,runtime:!0})),await Sn(M),J(null)}catch(M){J(M.message)}finally{Se(!1)}}},vS=async M=>{if(he)return;const V=g==null?void 0:g.providers.find(_e=>_e.name===M);if(!V||V.auth_type==="oauth")return;const re=Vt[M]??{apiKey:"",apiBase:"",apiType:"auto"},ce=re.apiKey.trim(),Te=V.api_key_required??!0;if(!V.configured&&Te&&!ce){J(b("settings.byok.apiKeyRequired"));return}ve(M);try{const _e=await zL(v,{provider:M,apiKey:ce||void 0,apiBase:re.apiBase.trim(),apiType:re.apiType});_t(_e),_e.requires_restart&&Ct(lt=>({...lt,image:!0})),await Sn(_e),Me(lt=>({...lt,[M]:{apiKey:"",apiBase:re.apiBase.trim(),apiType:re.apiType}})),tn(lt=>({...lt,[M]:!1})),It(lt=>({...lt,[M]:!1})),J(null)}catch(_e){J(_e.message)}finally{ve(null)}},$u=async(M,V)=>{if(!he){ve(M);try{const re=V==="login"?await $L(v,M):await UL(v,M);_t(re),Je(M),J(null)}catch(re){J(re.message)}finally{ve(null)}}},xS=async()=>{var Te,_e;if(!g||me)return;const M=g.web_search.providers.find(lt=>lt.name===St.provider);if(!M)return;const V=((Te=St.apiKey)==null?void 0:Te.trim())??"",re=((_e=St.baseUrl)==null?void 0:_e.trim())??"",ce=si(M)&&St.provider===g.web_search.provider&&!!g.web_search.api_key_hint;if(B1(M)&&!V&&!ce){J(b("settings.byok.webSearch.apiKeyRequired"));return}if(M.credential==="base_url"&&!re){J(b("settings.byok.webSearch.baseUrlRequired"));return}ee(!0);try{const lt=(St.useJinaReader??g.web.fetch.use_jina_reader)!==g.web.fetch.use_jina_reader,Bu={provider:St.provider,maxResults:St.maxResults,timeout:St.timeout,useJinaReader:St.useJinaReader};si(M)&&(V||M.credential==="optional_api_key"&&Dt)&&(Bu.apiKey=V),M.credential==="base_url"&&(Bu.baseUrl=re);const Yr=await BL(v,Bu);_t(Yr),(Yr.requires_restart||lt)&&Ct(Hu=>({...Hu,browser:!0})),await Sn(Yr),Ut(Hu=>({provider:Yr.web_search.provider,apiKey:"",baseUrl:Yr.web_search.base_url??Hu.baseUrl??"",maxResults:Yr.web_search.max_results,timeout:Yr.web_search.timeout,useJinaReader:Yr.web.fetch.use_jina_reader})),Le(!1),jr(!1),J(null)}catch(lt){J(lt.message)}finally{ee(!1)}},Uu=u.useCallback(M=>{const V=g==null?void 0:g.providers.find(re=>re.name===M);V&&(Me(re=>({...re,[M]:{apiKey:"",apiBase:V.api_base??V.default_api_base??"",apiType:V.api_type??"auto"}})),tn(re=>({...re,[M]:!1})),It(re=>({...re,[M]:!1})))},[g]),yS=u.useCallback(M=>{Ne&&Uu(Ne),Je(Ne===M?null:M)},[Ne,Uu]),bS=u.useCallback(()=>{g&&(Ut({provider:g.web_search.provider,apiKey:"",baseUrl:g.web_search.base_url??"",maxResults:g.web_search.max_results,timeout:g.web_search.timeout,useJinaReader:g.web.fetch.use_jina_reader}),Le(!1),jr(!1))},[g]),wS=u.useCallback(M=>{g&&(Ut(V=>({provider:M,apiKey:"",baseUrl:M===g.web_search.provider?g.web_search.base_url??"":"",maxResults:V.maxResults??g.web_search.max_results,timeout:V.timeout??g.web_search.timeout,useJinaReader:V.useJinaReader??g.web.fetch.use_jina_reader})),Le(!1),jr(!1))},[g]),kS=M=>{const V=yt[M];tn(re=>({...re,[M]:!V}))},CS=M=>{It(V=>{const re=!V[M];return re||(Me(ce=>{var Te,_e;return{...ce,[M]:{apiKey:"",apiBase:((Te=ce[M])==null?void 0:Te.apiBase)??"",apiType:((_e=ce[M])==null?void 0:_e.apiType)??"auto"}}}),tn(ce=>({...ce,[M]:!1}))),{...V,[M]:re}})},SS=async(M,V)=>{var ce;const re=`${M}:${V}`;Q(re),jt(null),kt(null);try{const Te=await _L(v,M,V);C(Te),M!=="test"&&M3(Te),jt(((ce=Te.last_action)==null?void 0:ce.message)??null),Cr(M==="uninstall"?null:V)}catch(Te){kt(Te.message)}finally{Q(null)}},rh=async(M,V)=>{const re=`${M}:${V.id}`;In(re),nt(null);try{const ce=await xL(v,M,V.id);E(ce),M==="delete"&&un(null),M==="run"&&(window.setTimeout(()=>void L(!1),1200),window.setTimeout(()=>void L(!1),4e3))}catch(ce){nt(ce.message)}finally{In(null)}},NS=async(M,V)=>{const re=`update:${M.id}`;In(re),nt(null);try{const ce=await yL(v,M.id,V);E(ce),sr(null)}catch(ce){nt(ce.message)}finally{In(null)}},jS=async(M,V,re={})=>{var Te;const ce=`${M}:${V}`;ne(ce),Ze(null),et(null);try{const _e=await TL(v,M,V,re);S(_e),Ze(((Te=_e.last_action)==null?void 0:Te.message)??null),M!=="test"&&El(_e),_e.requires_restart&&Ct(lt=>({...lt,runtime:!0})),await Sn(_e),M==="enable"&&Nr(lt=>({...lt,[V]:{}}))}catch(_e){et(_e.message)}finally{ne(null)}},AS=async()=>{var re;const M=en.name.trim(),V=`custom:${M||"new"}`;ne(V),Ze(null),et(null);try{const ce=await RL(v,{name:M,transport:en.transport,command:en.command,args:en.args,url:en.url,env:en.env,headers:en.headers,tool_timeout:en.toolTimeout});S(ce),Ze(((re=ce.last_action)==null?void 0:re.message)??null),El(ce),ce.requires_restart&&Ct(Te=>({...Te,runtime:!0})),await Sn(ce),be(Te=>({...jv,transport:Te.transport}))}catch(ce){et(ce.message)}finally{ne(null)}},_S=async()=>{var M;ne("import"),Ze(null),et(null);try{const V=await ML(v,Ae);S(V),Ze(((M=V.last_action)==null?void 0:M.message)??null),El(V),V.requires_restart&&Ct(re=>({...re,runtime:!0})),await Sn(V),mt("")}catch(V){et(V.message)}finally{ne(null)}},PS=async(M,V)=>{var re;ne(`tools:${M}`),Ze(null),et(null);try{const ce=await EL(v,M,V);S(ce),Ze(((re=ce.last_action)==null?void 0:re.message)??null),El(ce),ce.requires_restart&&Ct(Te=>({...Te,runtime:!0})),await Sn(ce)}catch(ce){et(ce.message)}finally{ne(null)}},TS=()=>{if(!g)return null;switch(ye){case"overview":return s.jsx(uD,{settings:g,requiresRestart:qn,showBrandLogos:Lt.brandLogos,onSelectSection:se});case"appearance":return s.jsx(pD,{theme:e,onToggleTheme:a,localPrefs:Lt,onChangeLocalPrefs:ir});case"models":return s.jsxs("div",{className:"space-y-8",children:[s.jsx(fD,{token:v,form:qe,setForm:Cn,settings:g,dirty:U,saving:P,showBrandLogos:Lt.brandLogos,providerSaving:he,onProviderOAuthLogin:M=>$u(M,"login"),onSave:Ns,onCreateConfiguration:dS}),s.jsx(hD,{settings:g,expandedProvider:Ne,providerForms:Vt,visibleProviderKeys:yt,editingProviderKeys:Gt,providerSaving:he,query:ue,showBrandLogos:Lt.brandLogos,onQueryChange:Be,onToggleProvider:yS,onToggleProviderKey:kS,onToggleProviderKeyEditing:CS,onChangeProviderForm:(M,V)=>Me(re=>{var ce,Te,_e;return{...re,[M]:{apiKey:((ce=re[M])==null?void 0:ce.apiKey)??"",apiBase:((Te=re[M])==null?void 0:Te.apiBase)??"",apiType:((_e=re[M])==null?void 0:_e.apiType)??"auto",...V}}}),onSaveProvider:vS,onProviderOAuthLogin:M=>$u(M,"login"),onProviderOAuthLogout:M=>$u(M,"logout"),onResetProviderDraft:Uu,imageProviderRestartPending:ft.image,onRestart:Pt,isRestarting:y||Fe})]});case"image":return s.jsx(gD,{settings:g,form:nn,dirty:Ce,saving:we,onChangeForm:lo,onSave:fS,onOpenProviders:()=>se("models"),showBrandLogos:Lt.brandLogos,onRestart:Pt,isRestarting:y||Fe,requiresRestartPending:ft.image});case"voice":return s.jsx(vD,{settings:g,form:kn,dirty:Ke,saving:xe,onChangeForm:co,onSave:hS,onOpenProviders:()=>se("models"),showBrandLogos:Lt.brandLogos,onRestart:Pt,isRestarting:y||Fe,requiresRestartPending:ft.browser});case"browser":return s.jsx(xD,{settings:g,form:St,keyVisible:ke,keyEditing:Dt,saving:me,onChangeForm:Ut,onChangeProvider:wS,onToggleKey:()=>Le(M=>!M),onToggleKeyEditing:()=>{jr(M=>!M),Le(!1),Ut(M=>({...M,apiKey:""}))},onReset:bS,onSave:xS,showBrandLogos:Lt.brandLogos,onRestart:Pt,isRestarting:y||Fe,requiresRestartPending:ft.browser});case"apps":return s.jsx(qD,{cliApps:k,mcpPresets:N,cliAppsLoading:T,mcpPresetsLoading:z,query:ze,filter:Hn,cliActionKey:I,mcpActionKey:O,cliMessage:zt,cliError:Vr,cliFocusName:ar,mcpMessage:or,mcpError:Sr,mcpFieldValues:Gr,customMcpForm:en,mcpConfigImport:Ae,showBrandLogos:Lt.brandLogos,requiresRestartPending:ft.runtime,onQueryChange:We,onFilterChange:bn,onCliAction:SS,onMcpAction:jS,onDismissStatus:()=>{jt(null),kt(null),Ze(null),et(null)},onBackToChat:o,onMcpFieldChange:(M,V,re)=>{Nr(ce=>({...ce,[M]:{...ce[M]??{},[V]:re}}))},onCustomMcpFormChange:be,onMcpConfigImportChange:mt,onSaveCustomMcp:AS,onImportMcpConfig:_S,onMcpToolsChange:PS,onRestart:Pt,isRestarting:y||Fe});case"automations":return s.jsx(yD,{payload:A,loading:$,query:nr,filter:Qe,sort:rr,actionKey:At,error:$t,onQueryChange:xn,onFilterChange:yn,onSortChange:cn,onAction:rh,onRequestEdit:sr,onRequestDelete:un});case"skills":return s.jsx(KL,{skills:c});case"runtime":return s.jsx(ZD,{form:qe,setForm:Cn,settings:g,dirty:Z,saving:P,onSave:mS,onRestart:Pt,isRestarting:y||Fe,requiresRestartPending:ft.runtime});case"advanced":return s.jsx(e4,{form:H,dirty:rt,saving:$e,isNativeHostSurface:(g.surface??g.runtime_surface)==="native",onChangeForm:q,onSave:gS,onRestart:Pt,isRestarting:y||Fe,requiresRestartPending:ft.runtime});default:return null}};return s.jsxs("div",{className:j("flex min-h-0 flex-1 flex-col overflow-hidden md:flex-row",r?"bg-[radial-gradient(circle_at_50%_0%,hsl(var(--muted))_0%,hsl(var(--background))_42%)]":"bg-background"),children:[r?s.jsx(cD,{activeSection:ye,onSelectSection:se,onBackToChat:o,onLogout:m,hostChromeInset:x}):null,s.jsx(mD,{open:G,draft:pe,providers:Ln,saving:oe,showProviderLogos:Lt.brandLogos,onOpenChange:Y,onChangeDraft:le,onSave:pS}),s.jsx(ND,{job:wn,deleting:At===`delete:${(wn==null?void 0:wn.id)??""}`,onOpenChange:M=>{M||un(null)},onConfirm:M=>rh("delete",M)}),s.jsx(SD,{job:Wn,saving:At===`update:${(Wn==null?void 0:Wn.id)??""}`,onOpenChange:M=>{M||sr(null)},onSave:NS}),s.jsx("main",{className:"min-w-0 flex-1 overflow-y-auto [scrollbar-gutter:stable]",children:s.jsxs("div",{className:j("mx-auto w-full max-w-[920px] px-4 py-6 sm:px-8 sm:py-8 lg:py-12",x&&"pt-[4.25rem] sm:pt-[4.25rem] lg:pt-[4.75rem]"),children:[s.jsxs("div",{className:"mb-7",children:[r?null:s.jsxs("button",{type:"button",onClick:o,className:"mb-4 inline-flex items-center gap-1.5 rounded-full px-2.5 py-1.5 text-[12px] font-medium text-muted-foreground transition-colors hover:bg-muted/70 hover:text-foreground lg:hidden",children:[s.jsx(mf,{className:"h-3.5 w-3.5","aria-hidden":!0}),b("settings.backToChat")]}),r?s.jsx("p",{className:"mb-2 text-[12px] font-normal text-muted-foreground",children:b("settings.sidebar.title")}):null,s.jsx("h1",{className:"text-[24px] font-normal leading-tight tracking-normal text-foreground sm:text-[28px]",children:Ar(`settings.nav.${ye}`,lD(ye))})]}),_?s.jsxs("div",{className:"flex h-48 items-center justify-center rounded-[24px] border border-border/50 bg-card/75 text-sm text-muted-foreground shadow-[0_20px_70px_rgba(15,23,42,0.07)]",children:[s.jsx(pt,{className:"mr-2 h-4 w-4 animate-spin"}),b("settings.status.loading")]}):X&&!g?s.jsx(Ht,{children:s.jsx(Oe,{title:b("settings.status.loadError"),children:s.jsx("span",{className:"max-w-[520px] text-sm text-muted-foreground",children:X})})}):g?s.jsxs("div",{className:"space-y-5",children:[X?s.jsx("div",{className:"rounded-[18px] border border-destructive/20 bg-destructive/5 px-4 py-3 text-[13px] text-destructive",children:X}):null,TS()]}):null]})})]})}const H1=[{key:"overview",icon:Gb,fallback:"Overview"},{key:"appearance",icon:uA,fallback:"Appearance"},{key:"models",icon:sw,fallback:"Models"},{key:"image",icon:Wi,fallback:"Image"},{key:"voice",icon:gf,fallback:"Voice"},{key:"browser",icon:ew,fallback:"Web"},{key:"runtime",icon:ts,fallback:"System"},{key:"advanced",icon:gA,fallback:"Security"}];function W1(e){return e==="full"?"full":"default"}function lD(e){var t;return((t=H1.find(n=>n.key===e))==null?void 0:t.fallback)??"Settings"}function cD({activeSection:e,onSelectSection:t,onBackToChat:n,onLogout:r,hostChromeInset:a}){const{t:o}=ie();return s.jsxs("aside",{className:j("flex w-full shrink-0 flex-col border-b border-border/55 bg-card/62 px-3 pb-2 shadow-[inset_0_-1px_0_rgba(255,255,255,0.55)] backdrop-blur-xl dark:bg-card/45 dark:shadow-none md:w-[17rem] md:border-b-0 md:border-r md:px-3 md:pb-4 md:shadow-[inset_-1px_0_0_rgba(255,255,255,0.55)]",a?"pt-[4.25rem] md:pt-[4.25rem]":"pt-4 md:pt-4"),children:[s.jsxs("button",{type:"button",onClick:n,className:"mb-2 inline-flex w-fit items-center gap-1.5 rounded-full px-2.5 py-1.5 text-[12px] font-medium text-muted-foreground transition-colors hover:bg-muted/70 hover:text-foreground md:mb-3",children:[s.jsx(mf,{className:"h-3.5 w-3.5","aria-hidden":!0}),o("settings.backToChat")]}),s.jsx("div",{className:"mb-3 px-1 md:mb-4 md:px-2",children:s.jsx("h2",{className:"text-[18px] font-normal tracking-normal text-foreground",children:o("settings.sidebar.title")})}),s.jsx("nav",{"aria-label":o("settings.sidebar.ariaLabel"),className:"-mx-1 flex gap-2 overflow-x-auto px-1 pb-1 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden md:mx-0 md:block md:space-y-1 md:overflow-visible md:px-0 md:pb-0",children:H1.map(({key:i,icon:l,fallback:c})=>{const d=i===e;return s.jsxs("button",{type:"button","aria-current":d?"page":void 0,onClick:()=>t(i),className:j("flex h-9 w-auto shrink-0 items-center gap-2 rounded-full px-3 text-left text-[13px] font-medium transition-colors md:w-full md:rounded-[10px] md:px-2.5",d?"bg-muted/90 text-foreground shadow-[inset_0_0_0_1px_rgba(0,0,0,0.025)]":"text-muted-foreground/78 hover:bg-muted/45 hover:text-foreground"),children:[s.jsx(l,{className:"h-4 w-4 shrink-0",strokeWidth:2,"aria-hidden":!0}),s.jsx("span",{className:"truncate",children:o(`settings.nav.${i}`,{defaultValue:c})})]},i)})}),s.jsx("div",{className:"hidden md:mt-auto md:block md:pt-4",children:r&&!a?s.jsxs(fe,{type:"button",variant:"ghost",onClick:r,className:"h-9 w-full justify-start gap-2 rounded-[10px] px-2.5 text-[13px] font-medium text-muted-foreground hover:bg-destructive/8 hover:text-destructive",children:[s.jsx(lA,{className:"h-4 w-4","aria-hidden":!0}),o("app.account.logout")]}):null})]})}function uD({settings:e,requiresRestart:t,onSelectSection:n,showBrandLogos:r}){var R;const{t:a}=ie(),o=(T,F)=>a(T,{defaultValue:F}),i=e.agent.model_preset||"default",l=e.agent.resolved_provider??e.agent.provider,c=Mu(e,l),d=Mo(e.providers,l),p=c?e.agent.model:o("settings.values.notConfigured","Not configured"),m=c?`${l} · ${i}`:d||e.agent.model?[d,e.agent.model].filter(Boolean).join(" · "):o("settings.byok.noConfiguredProviders","No configured providers"),f=e.web.enable?o("settings.values.enabled","Enabled"):o("settings.values.disabled","Disabled"),h=e.web_search.providers.find(T=>T.name===e.web_search.provider)??e.web_search.providers[0],y=Mo(e.web_search.providers,e.web_search.provider),x=(h==null?void 0:h.credential)==="none"?o("settings.byok.webSearch.noCredentialRequired","No key required"):(h==null?void 0:h.credential)==="optional_api_key"?e.web_search.api_key_hint?o("settings.values.configured","Configured"):o("settings.byok.webSearch.noCredentialRequired","No key required"):(h==null?void 0:h.credential)==="base_url"?e.web_search.base_url?o("settings.values.configured","Configured"):o("settings.values.notConfigured","Not configured"):e.web_search.api_key_hint?o("settings.values.configured","Configured"):o("settings.values.notConfigured","Not configured"),b=`${y} · ${x}`,v=e.image_generation.enabled?o("settings.values.enabled","Enabled"):o("settings.values.disabled","Disabled"),g=`${Mo(e.image_generation.providers,e.image_generation.provider)} · ${e.image_generation.provider_configured?o("settings.values.configured","Configured"):o("settings.values.notConfigured","Not configured")}`,w=e.transcription??Eu,k=w.enabled?o("settings.values.enabled","Enabled"):o("settings.values.disabled","Disabled"),C=`${Mo(w.providers,w.provider)} · ${w.provider_configured?o("settings.values.configured","Configured"):o("settings.values.notConfigured","Not configured")}`,N=(e.surface??e.runtime_surface)==="native",S=c1(e.runtime.workspace_path),A=N?o("settings.rows.engine","Engine"):o("settings.rows.gateway","Gateway"),E=N?o("settings.values.privateEngine","Private engine"):`${e.runtime.gateway_host}:${e.runtime.gateway_port}`,_=N?o("settings.values.unixSocket","Unix socket"):t?o("settings.values.restartPending","Restart pending"):o("settings.values.ready","Ready");return s.jsxs("div",{className:"space-y-7",children:[s.jsx("section",{children:s.jsx(P3,{usage:e.usage,timeZone:e.agent.timezone})}),s.jsxs("section",{children:[s.jsx(Jt,{children:o("settings.sections.ai","AI")}),s.jsx(Ht,{children:s.jsx(vo,{icon:Qb,valueLogoProvider:l,title:o("settings.overview.model","Current model"),value:p,caption:m,showBrandLogos:r,onClick:()=>n("models")})})]}),s.jsxs("section",{children:[s.jsx(Jt,{children:o("settings.sections.capabilities","Capabilities")}),s.jsxs(Ht,{children:[s.jsx(vo,{icon:ew,valueLogoProvider:e.web_search.provider,title:o("settings.overview.webSearch","Web search"),value:f,caption:b,showBrandLogos:r,onClick:()=>n("browser")}),s.jsx(vo,{icon:Wi,valueLogoProvider:e.image_generation.provider,title:o("settings.overview.imageGeneration","Image generation"),value:v,caption:g,showBrandLogos:r,onClick:()=>n("image")}),s.jsx(vo,{icon:gf,valueLogoProvider:w.provider,title:o("settings.overview.voiceInput","Voice input"),value:k,caption:C,showBrandLogos:r,onClick:()=>n("voice")})]})]}),s.jsxs("section",{children:[s.jsx(Jt,{children:o("settings.sections.system","System")}),s.jsxs(Ht,{children:[s.jsx(vo,{icon:ts,title:A,value:E,caption:_,onClick:()=>n("runtime")}),s.jsx(vo,{icon:aA,title:o("settings.overview.workspace","Workspace"),value:o("settings.values.defaultWorkspace","Default workspace"),caption:S,onClick:()=>n("runtime")})]})]}),s.jsxs("section",{children:[s.jsx(Jt,{children:o("settings.sections.about","About")}),s.jsx(Ht,{children:s.jsx(dD,{currentVersion:(R=e.version)==null?void 0:R.current})})]})]})}function dD({currentVersion:e}){const{t}=ie(),n=(d,p)=>t(d,{defaultValue:p}),{token:r}=kr(),[a,o]=u.useState(!1),[i,l]=u.useState(null),c=async()=>{o(!0),l(null);try{const d=await SL(r);d.updateAvailable?l({type:"update",latestVersion:d.updateAvailable.latestVersion,pypiUrl:d.updateAvailable.pypiUrl}):l({type:"up-to-date"})}catch(d){l({type:"error",message:d.message})}finally{o(!1)}};return s.jsxs("div",{className:"flex min-h-[62px] flex-col gap-3 px-4 py-3.5 sm:flex-row sm:items-center sm:justify-between sm:px-5",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"text-[14px] font-medium leading-5 text-foreground",children:n("settings.about.version","Version")}),s.jsx("div",{className:"mt-0.5 text-[12px] leading-5 text-muted-foreground",children:e?`v${e}`:"nanobot"})]}),s.jsxs("div",{className:"flex shrink-0 flex-col items-end gap-2",children:[s.jsxs(fe,{size:"sm",variant:"outline",onClick:()=>void c(),disabled:a,className:"rounded-full",children:[a?s.jsx(pt,{className:"mr-1.5 h-3.5 w-3.5 animate-spin","aria-hidden":!0}):s.jsx(ug,{className:"mr-1.5 h-3.5 w-3.5","aria-hidden":!0}),a?n("settings.about.checking","Checking..."):n("settings.about.checkForUpdates","Check for updates")]}),(i==null?void 0:i.type)==="up-to-date"?s.jsxs("span",{className:"inline-flex items-center gap-1.5 text-[12px] text-emerald-600 dark:text-emerald-300",children:[s.jsx(Et,{className:"h-3 w-3","aria-hidden":!0}),n("settings.about.upToDate","You're up to date")]}):null,(i==null?void 0:i.type)==="update"?s.jsxs("span",{className:"inline-flex items-center gap-1.5 text-[12px] text-blue-600 dark:text-blue-300",children:[s.jsx(ug,{className:"h-3 w-3","aria-hidden":!0}),t("settings.about.updateAvailable",{defaultValue:"Update available v{{version}}",version:i.latestVersion}),i.pypiUrl?s.jsxs("a",{href:i.pypiUrl,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-0.5 underline-offset-2 hover:underline",children:["PyPI",s.jsx(nw,{className:"h-2.5 w-2.5","aria-hidden":!0})]}):null]}):null,(i==null?void 0:i.type)==="error"?s.jsx("span",{className:"text-[12px] text-destructive",children:i.message}):null]})]})}function pD({theme:e,onToggleTheme:t,localPrefs:n,onChangeLocalPrefs:r}){const{t:a}=ie(),o=(i,l)=>a(i,{defaultValue:l});return s.jsxs("div",{className:"space-y-7",children:[s.jsxs("section",{children:[s.jsx(Jt,{children:a("settings.sections.interface")}),s.jsxs(Ht,{children:[s.jsx(Oe,{title:a("settings.rows.theme"),description:a("settings.help.theme"),children:s.jsxs("button",{type:"button",onClick:t,className:"inline-flex h-8 items-center rounded-full bg-muted p-0.5 text-[12px] font-medium text-muted-foreground",children:[s.jsx("span",{className:j("rounded-full px-3 py-1 transition-colors",e==="light"&&"bg-background text-foreground shadow-sm"),children:a("settings.values.light")}),s.jsx("span",{className:j("rounded-full px-3 py-1 transition-colors",e==="dark"&&"bg-background text-foreground shadow-sm"),children:a("settings.values.dark")})]})}),s.jsx(Oe,{title:a("settings.rows.language"),description:a("settings.help.language"),children:s.jsx(uL,{})})]})]}),s.jsxs("section",{children:[s.jsx(Jt,{children:o("settings.sections.localPreferences","Local preferences")}),s.jsxs(Ht,{children:[s.jsx(Oe,{title:o("settings.rows.density","Density"),description:o("settings.help.density","Stored only in this browser."),children:s.jsx(eo,{value:n.density,options:[{value:"comfortable",label:o("settings.values.comfortable","Comfortable")},{value:"compact",label:o("settings.values.compact","Compact")}],onChange:i=>r(l=>({...l,density:i}))})}),s.jsx(Oe,{title:o("settings.rows.activityMode","Activity detail"),description:o("settings.help.activityMode","Choose how much agent activity chrome to show by default."),children:s.jsx(eo,{value:n.activityMode,options:[{value:"auto",label:o("settings.values.auto","Auto")},{value:"expanded",label:o("settings.values.expanded","Expanded")}],onChange:i=>r(l=>({...l,activityMode:i}))})}),s.jsx(Oe,{title:o("settings.rows.codeWrap","Code wrapping"),description:o("settings.help.codeWrap","Keep long code lines readable on smaller screens."),children:s.jsx(is,{checked:n.codeWrap,onChange:i=>r(l=>({...l,codeWrap:i})),ariaLabel:o("settings.rows.codeWrap","Code wrapping"),label:n.codeWrap?o("settings.values.on","On"):o("settings.values.off","Off")})}),s.jsx(Oe,{title:o("settings.rows.brandLogos","Brand logos"),description:o("settings.help.brandLogos","Show third-party provider and CLI logos in Settings."),children:s.jsx(is,{checked:n.brandLogos,onChange:i=>r(l=>({...l,brandLogos:i})),ariaLabel:o("settings.rows.brandLogos","Brand logos"),label:n.brandLogos?o("settings.values.on","On"):o("settings.values.off","Off")})})]})]})]})}function mD({open:e,draft:t,providers:n,saving:r,showProviderLogos:a,onOpenChange:o,onChangeDraft:i,onSave:l}){const{t:c}=ie(),d=(m,f)=>c(m,{defaultValue:f}),p=!!(t.label.trim()&&t.provider.trim()&&t.model.trim());return s.jsx(Yi,{open:e,onOpenChange:o,children:s.jsx(bs,{className:"max-w-[520px] rounded-[28px] border-border/55 bg-card/95 p-0 shadow-[0_28px_90px_rgba(15,23,42,0.20)] backdrop-blur-xl dark:border-white/10",children:s.jsxs("form",{onSubmit:m=>{m.preventDefault(),l()},children:[s.jsxs(Qi,{className:"border-b border-border/45 px-5 py-4 text-left",children:[s.jsx(ws,{className:"text-[18px] font-semibold tracking-[-0.01em]",children:d("settings.models.newConfiguration","New model configuration")}),s.jsx(Ji,{className:"text-[12.5px] leading-5",children:d("settings.models.newConfigurationHelp","Save a provider and model as a one-click option.")})]}),s.jsxs("div",{className:"space-y-4 px-5 py-5",children:[s.jsxs("label",{className:"block",children:[s.jsx("span",{className:"mb-1.5 block text-[12px] font-medium text-muted-foreground",children:d("settings.models.configurationName","Configuration name")}),s.jsx(Ye,{autoFocus:!0,value:t.label,placeholder:d("settings.models.configurationNamePlaceholder","Fast writing"),onChange:m=>i(f=>({...f,label:m.target.value})),className:"h-10 rounded-full px-4 text-[14px]"})]}),s.jsxs("div",{className:"grid gap-4 sm:grid-cols-[1fr_auto] sm:items-end",children:[s.jsxs("label",{className:"block",children:[s.jsx("span",{className:"mb-1.5 block text-[12px] font-medium text-muted-foreground",children:d("settings.rows.model","Model")}),s.jsx(Ye,{value:t.model,placeholder:"openai/gpt-4.1",onChange:m=>i(f=>({...f,model:m.target.value})),className:"h-10 rounded-full px-4 text-[14px]"})]}),s.jsxs("div",{className:"block",children:[s.jsx("span",{className:"mb-1.5 block text-[12px] font-medium text-muted-foreground",children:d("settings.rows.provider","Provider")}),s.jsx(Ua,{providers:n,value:t.provider,emptyLabel:d("settings.byok.noConfiguredProviders","No configured providers"),showProviderLogos:a,onChange:m=>i(f=>({...f,provider:m}))})]})]})]}),s.jsxs(Xi,{className:"border-t border-border/45 px-5 py-4 sm:space-x-2",children:[s.jsx(fe,{type:"button",variant:"ghost",className:"rounded-full",disabled:r,onClick:()=>o(!1),children:d("settings.actions.cancel","Cancel")}),s.jsxs(fe,{type:"submit",variant:"outline",className:"rounded-full",disabled:!p||r||n.length===0,children:[r?s.jsx(pt,{className:"mr-1.5 h-3.5 w-3.5 animate-spin","aria-hidden":!0}):null,r?d("settings.actions.saving","Saving..."):d("settings.actions.save","Save")]})]})]})})})}function fD({token:e,form:t,setForm:n,settings:r,dirty:a,saving:o,showBrandLogos:i,providerSaving:l,onProviderOAuthLogin:c,onSave:d,onCreateConfiguration:p}){var A;const{t:m}=ie(),f=(E,_)=>m(E,{defaultValue:_}),h=r.providers.filter(E=>E.configured),y=((A=Li(r))==null?void 0:A.provider)==="auto"||t.provider==="auto",x=i4(h),b=y?[{name:"auto",label:f("settings.values.auto","Auto")},...x]:x,v=b.some(E=>E.name===t.provider)?t.provider:"",g=r.model_presets.find(E=>E.name===t.modelPreset)??null,w=r.providers.find(E=>E.name===t.provider),k=(w==null?void 0:w.auth_type)==="oauth"&&!w.configured,C=l===(w==null?void 0:w.name),N=Mu(r,t.provider),S=!t.model.trim()||!t.provider.trim()||!!(g&&!g.is_default&&!t.presetLabel.trim());return s.jsx("div",{className:"space-y-7",children:s.jsx("section",{children:s.jsxs(Ht,{children:[s.jsx(Oe,{title:f("settings.rows.currentModel","Current configuration"),description:f("settings.help.currentModel","Used for new replies."),children:s.jsx(g4,{presets:r.model_presets,value:t.modelPreset,settings:r,draftModel:t.model,draftProvider:t.provider,providerConfigured:N,showProviderLogos:i,onChange:E=>{const _=r.model_presets.find(R=>R.name===E);n(R=>({...R,modelPreset:E,model:(_==null?void 0:_.model)??R.model,provider:_!=null&&_.is_default?Oi(r):(_==null?void 0:_.provider)??R.provider,presetLabel:(_==null?void 0:_.label)??E,contextWindowTokens:Di((_==null?void 0:_.context_window_tokens)??R.contextWindowTokens)}))},onCreateConfiguration:p})}),g&&!g.is_default?s.jsx(Oe,{title:f("settings.models.configurationName","Configuration name"),description:f("settings.models.configurationNameHelp","Rename this saved model configuration."),children:s.jsx(Ye,{value:t.presetLabel,onChange:E=>n(_=>({..._,presetLabel:E.target.value})),className:"h-8 w-[min(280px,70vw)] rounded-full text-[13px]"})}):null,s.jsx(Oe,{title:m("settings.rows.provider"),description:m("settings.help.provider"),children:s.jsx(Ua,{providers:b,value:v,emptyLabel:m("settings.byok.noConfiguredProviders"),showProviderLogos:i,onChange:E=>n(_=>({..._,provider:E,model:E===_.provider?_.model:""}))})}),k?s.jsx(Oe,{title:f("settings.oauth.signInRequired","Sign in required"),description:f("settings.oauth.signInBeforeSaving","Sign in before saving this OAuth provider as the active model provider."),children:s.jsxs(fe,{size:"sm",variant:"outline",onClick:()=>w&&c(w.name),disabled:!(w!=null&&w.oauth_login_supported)||C,className:"rounded-full",children:[C?s.jsx(pt,{className:"mr-1.5 h-3.5 w-3.5 animate-spin","aria-hidden":!0}):null,C?f("settings.oauth.signingIn","Signing in..."):f("settings.oauth.signIn","Sign in")]})}):null,s.jsx(Oe,{title:m("settings.rows.model"),description:m("settings.help.model"),children:s.jsx(n4,{token:e,settings:r,provider:t.provider,value:t.model,showProviderLogos:i,onChange:E=>n(_=>({..._,model:E}))})}),s.jsx(Oe,{title:f("settings.rows.contextWindow","Context window"),description:f("settings.help.contextWindow","Choose the default context budget for this model configuration."),children:s.jsx(eo,{value:String(t.contextWindowTokens),options:q3.map(E=>({value:String(E),label:E===262144?"256K":E===2e5?"200K":"64K"})),onChange:E=>n(_=>({..._,contextWindowTokens:Di(Number(E))}))})}),s.jsx(v4,{dirty:a,saving:o,saved:!1,disabled:k||S,message:k?f("settings.oauth.signInBeforeSaving","Sign in before saving this OAuth provider as the active model provider."):void 0,onSave:d})]})})})}function hD({settings:e,expandedProvider:t,providerForms:n,visibleProviderKeys:r,editingProviderKeys:a,providerSaving:o,query:i,showBrandLogos:l,onQueryChange:c,onToggleProvider:d,onToggleProviderKey:p,onToggleProviderKeyEditing:m,onChangeProviderForm:f,onSaveProvider:h,onProviderOAuthLogin:y,onProviderOAuthLogout:x,onResetProviderDraft:b,imageProviderRestartPending:v,onRestart:g,isRestarting:w}){const{t:k}=ie(),C=(R,T)=>k(R,{defaultValue:T}),N=e.providers.filter(R=>R.configured),S=u.useMemo(()=>s4(e.providers.filter(R=>!R.configured)),[e.providers]),A=Uv(N,i),E=Uv(S,i),_=R=>{var de;const T=t===R.name,F=n[R.name]??{apiKey:"",apiBase:R.api_base??R.default_api_base??"",apiType:R.api_type??"auto"},z=o===R.name,K=R.auth_type==="oauth",$=!!r[R.name],W=!R.configured||!!a[R.name],P=R.api_key_required??!0,D=F.apiKey.trim(),G=F.apiBase.trim(),Y=!K&&P&&!R.configured&&!D,oe=!K&&!P&&!R.configured&&!D&&!G;return s.jsxs("div",{className:"divide-y divide-border/45",children:[s.jsxs("button",{type:"button",onClick:()=>d(R.name),className:"flex min-h-[70px] w-full items-center justify-between gap-4 px-4 py-3 text-left transition-colors hover:bg-muted/35 sm:px-5",children:[s.jsxs("span",{className:"flex min-w-0 items-center gap-3",children:[s.jsx(m4,{provider:R.name,showBrandLogos:l}),s.jsxs("span",{className:"min-w-0",children:[s.jsx("span",{className:"block truncate text-[15px] font-semibold leading-5 text-foreground",children:R.label}),s.jsx("span",{className:"block truncate text-[12px] text-muted-foreground",children:R.api_base||R.default_api_base||R.name})]})]}),s.jsx(Iu,{tone:R.configured?"success":"neutral",children:K?R.configured?C("settings.oauth.signedIn","Signed in"):C("settings.oauth.notSignedIn","Not signed in"):R.configured?k("settings.byok.configured"):k("settings.byok.notConfigured")})]}),T?s.jsx("div",{className:"space-y-3 bg-muted/18 px-4 py-4 sm:px-5",children:K?s.jsxs("div",{className:"flex flex-col gap-3 rounded-[18px] border border-border/45 bg-background/75 px-4 py-3 sm:flex-row sm:items-center sm:justify-between",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx("p",{className:"text-[13px] font-semibold text-foreground",children:C("settings.oauth.authentication","OAuth authentication")}),s.jsx("p",{className:"mt-1 truncate text-[12px] text-muted-foreground",children:R.configured?k("settings.oauth.signedInAs",{account:R.oauth_account||R.label,defaultValue:"Signed in as {{account}}"}):C("settings.oauth.signInHelp","Sign in from this device; no API key is stored in config.")})]}),s.jsxs("div",{className:"flex shrink-0 justify-end gap-2",children:[R.configured?s.jsx(fe,{size:"sm",variant:"ghost",onClick:()=>x(R.name),disabled:z,className:"rounded-full",children:C("settings.oauth.signOut","Sign out")}):null,s.jsxs(fe,{size:"sm",variant:"outline",onClick:()=>y(R.name),disabled:z||!R.oauth_login_supported,className:"rounded-full",children:[z?s.jsx(pt,{className:"mr-1.5 h-3.5 w-3.5 animate-spin","aria-hidden":!0}):null,z?C("settings.oauth.signingIn","Signing in..."):R.configured?C("settings.oauth.signInAgain","Sign in again"):C("settings.oauth.signIn","Sign in")]})]})]}):s.jsxs(s.Fragment,{children:[s.jsxs("label",{className:"block space-y-1.5",children:[s.jsx("span",{className:"text-[12px] font-medium text-muted-foreground",children:k("settings.byok.apiKey")}),s.jsx("div",{className:"relative",children:W?s.jsxs(s.Fragment,{children:[s.jsx(Ye,{type:$?"text":"password",value:F.apiKey,onChange:pe=>f(R.name,{apiKey:pe.target.value}),placeholder:R.configured?k("settings.byok.apiKeyConfiguredPlaceholder"):k("settings.byok.apiKeyPlaceholder"),className:"h-9 rounded-full pr-11 text-[13px]"}),s.jsx(fe,{type:"button",variant:"ghost",size:"icon",onClick:()=>p(R.name),"aria-label":k($?"settings.byok.hideApiKey":"settings.byok.showApiKey"),className:"absolute right-1 top-1/2 h-7 w-7 -translate-y-1/2 rounded-full text-muted-foreground hover:bg-muted hover:text-foreground",children:$?s.jsx(rw,{className:"h-3.5 w-3.5","aria-hidden":!0}):s.jsx(aw,{className:"h-3.5 w-3.5","aria-hidden":!0})})]}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"flex h-9 items-center rounded-full border border-input bg-background px-3 pr-11 text-[13px] text-muted-foreground",children:R.api_key_hint??k("settings.byok.configuredKeyHint")}),s.jsx(fe,{type:"button",variant:"ghost",size:"icon",onClick:()=>m(R.name),"aria-label":k("settings.actions.edit"),className:"absolute right-1 top-1/2 h-7 w-7 -translate-y-1/2 rounded-full text-muted-foreground hover:bg-muted hover:text-foreground",children:s.jsx(fs,{className:"h-3.5 w-3.5","aria-hidden":!0})})]})})]}),s.jsxs("label",{className:"block space-y-1.5",children:[s.jsx("span",{className:"text-[12px] font-medium text-muted-foreground",children:k("settings.byok.apiBase")}),s.jsx(Ye,{value:F.apiBase,onChange:pe=>f(R.name,{apiBase:pe.target.value}),placeholder:R.default_api_base??k("settings.byok.apiBasePlaceholder"),className:"h-9 rounded-full text-[13px]"})]}),R.name==="openai"?s.jsxs("label",{className:"block space-y-1.5",children:[s.jsx("span",{className:"text-[12px] font-medium text-muted-foreground",children:C("settings.byok.apiType","API type")}),s.jsxs(gn,{children:[s.jsx(vn,{asChild:!0,children:s.jsxs(fe,{type:"button",variant:"outline",className:"h-9 w-full justify-between rounded-full px-3 text-[13px]",children:[s.jsx("span",{children:((de=Nv.find(pe=>pe.value===F.apiType))==null?void 0:de.label)??F.apiType}),s.jsx(yr,{className:"h-3.5 w-3.5 text-muted-foreground","aria-hidden":!0})]})}),s.jsx(ln,{align:"start",className:"min-w-[220px]",children:Nv.map(pe=>s.jsx(gt,{onSelect:()=>f(R.name,{apiType:pe.value}),children:pe.label},pe.value))})]})]}):null,s.jsxs("div",{className:"flex items-center justify-end gap-2",children:[s.jsx(fe,{size:"sm",variant:"ghost",onClick:()=>b(R.name),className:"rounded-full",children:k("settings.actions.cancel")}),s.jsx(fe,{size:"sm",variant:"outline",onClick:()=>h(R.name),disabled:z||Y||oe,className:"rounded-full",children:z?k("settings.actions.saving"):C("settings.providers.saveProvider","Save provider")})]})]})}):null]},R.name)};return s.jsxs("div",{className:"space-y-6",children:[s.jsx("p",{className:"max-w-[42rem] text-[13px] leading-6 text-muted-foreground",children:k("settings.byok.description")}),v&&g?s.jsxs("div",{className:"flex min-h-[48px] items-center justify-between gap-3 border-y border-border/55 py-3",children:[s.jsx("p",{className:"text-[13px] leading-5 text-muted-foreground",children:C("settings.status.imageProviderRestart","Image provider changes saved. Restart when ready.")}),s.jsx("div",{className:"shrink-0",children:s.jsxs(fe,{size:"sm",variant:"ghost",onClick:g,disabled:w,className:"rounded-full",children:[w?s.jsx(pt,{className:"mr-1.5 h-3.5 w-3.5 animate-spin","aria-hidden":!0}):s.jsx(qi,{className:"mr-1.5 h-3.5 w-3.5","aria-hidden":!0}),k(w?"app.system.restarting":"app.system.restart")]})})]}):null,s.jsxs("div",{className:"relative",children:[s.jsx(Tt,{className:"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground","aria-hidden":!0}),s.jsx(Ye,{value:i,onChange:R=>c(R.target.value),placeholder:C("settings.providers.searchPlaceholder","Search providers"),className:"h-10 rounded-full pl-9 text-[13px]"})]}),s.jsx(zv,{title:k("settings.byok.configuredSection"),count:A.length,empty:k("settings.byok.noConfiguredProviders"),children:A.map(_)}),s.jsx(zv,{title:k("settings.byok.notConfiguredSection"),count:E.length,empty:C("settings.providers.noMatches","No providers match this search."),children:E.map(_)}),s.jsx(tC,{})]})}function gD({settings:e,form:t,dirty:n,saving:r,onChangeForm:a,onSave:o,onOpenProviders:i,showBrandLogos:l,onRestart:c,isRestarting:d,requiresRestartPending:p}){const{t:m}=ie(),f=(g,w)=>m(g,{defaultValue:w}),h=e.image_generation.providers.find(g=>g.name===t.provider)??e.image_generation.providers[0],y=!!(h!=null&&h.configured),x=t.enabled&&!y,b=Bv(J3.map(g=>({name:g,label:g})),t.defaultAspectRatio),v=Bv(Z3.map(g=>({name:g,label:g})),t.defaultImageSize);return s.jsxs("div",{className:"space-y-7",children:[s.jsxs("section",{children:[s.jsx(Jt,{children:f("settings.sections.imageGeneration","Image generation")}),s.jsxs(Ht,{children:[s.jsx(Oe,{title:f("settings.rows.imageGeneration","Image generation"),description:f("settings.help.imageGeneration","Expose generate_image in chats when a configured image provider is available."),children:s.jsx(is,{checked:t.enabled,onChange:g=>a(w=>({...w,enabled:g})),ariaLabel:f("settings.rows.imageGeneration","Image generation"),label:t.enabled?f("settings.values.on","On"):f("settings.values.off","Off")})}),s.jsx(Oe,{title:f("settings.rows.imageProvider","Image provider"),description:f("settings.help.imageProvider","Choose the registry provider used by generate_image."),children:s.jsx(Ua,{providers:e.image_generation.providers,value:t.provider,emptyLabel:f("settings.image.selectProvider","Select provider"),showProviderLogos:l,onChange:g=>a(w=>({...w,provider:g}))})}),s.jsx(Oe,{title:f("settings.rows.imageProviderStatus","Provider status"),description:f("settings.help.imageProviderStatus","Image generation reuses provider credentials from Providers."),children:s.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-2",children:[s.jsx(Iu,{tone:y?"success":"neutral",children:y?f("settings.values.configured","Configured"):f("settings.values.notConfigured","Not configured")}),y?null:s.jsx(fe,{size:"sm",variant:"outline",onClick:i,className:"rounded-full",children:f("settings.image.configureProvider","Configure provider")})]})}),s.jsx(Oe,{title:f("settings.rows.imageProviderBase","Provider base"),children:s.jsx("span",{className:"max-w-[320px] truncate text-right text-[13px] text-muted-foreground",children:(h==null?void 0:h.api_base)||(h==null?void 0:h.default_api_base)||(h==null?void 0:h.name)||f("settings.values.notAvailable","Not available")})})]})]}),s.jsxs("section",{children:[s.jsx(Jt,{children:f("settings.sections.imageDefaults","Defaults")}),s.jsxs(Ht,{children:[s.jsx(Oe,{title:f("settings.rows.imageModel","Image model"),description:f("settings.help.imageModel","Model name sent to the selected image provider."),children:s.jsx(Ye,{value:t.model,onChange:g=>a(w=>({...w,model:g.target.value})),className:"h-8 w-[min(300px,70vw)] rounded-full text-[13px]"})}),s.jsx(Oe,{title:f("settings.rows.defaultAspectRatio","Default aspect"),description:f("settings.help.defaultAspectRatio","Used when the prompt does not choose an aspect ratio."),children:s.jsx(Ua,{providers:b,value:t.defaultAspectRatio,emptyLabel:f("settings.image.selectAspect","Select aspect"),onChange:g=>a(w=>({...w,defaultAspectRatio:g}))})}),s.jsx(Oe,{title:f("settings.rows.defaultImageSize","Default size"),description:f("settings.help.defaultImageSize","Size hint sent to providers that support it."),children:s.jsx(Ua,{providers:v,value:t.defaultImageSize,emptyLabel:f("settings.image.selectSize","Select size"),onChange:g=>a(w=>({...w,defaultImageSize:g}))})}),s.jsx(Oe,{title:f("settings.rows.maxImagesPerTurn","Max images per turn"),description:f("settings.help.maxImagesPerTurn","Upper bound for one generate_image request."),children:s.jsx(zi,{value:t.maxImagesPerTurn,min:1,max:8,onChange:g=>a(w=>({...w,maxImagesPerTurn:g}))})}),s.jsx(Ks,{title:f("settings.rows.imageSaveDir","Save directory"),value:e.image_generation.save_dir}),s.jsx(ol,{dirty:n,saving:r,pendingRestart:p,disabled:x,message:x?f("settings.image.missingCredential","Configure this provider before enabling image generation."):void 0,dirtyMessage:f("settings.status.restartAfterSaving","Save changes, then restart when ready."),pendingMessage:f("settings.status.savedRestartApply","Saved. Restart when ready."),onSave:o,onRestart:c,isRestarting:d})]})]})]})}function vD({settings:e,form:t,dirty:n,saving:r,onChangeForm:a,onSave:o,onOpenProviders:i,showBrandLogos:l,onRestart:c,isRestarting:d,requiresRestartPending:p}){const{t:m}=ie(),f=(b,v)=>m(b,{defaultValue:v}),h=e.transcription??Eu,y=h.providers.find(b=>b.name===t.provider)??h.providers[0],x=!!(y!=null&&y.configured);return s.jsxs("section",{children:[s.jsx(Jt,{children:f("settings.sections.voiceInput","Voice input")}),s.jsxs(Ht,{children:[s.jsx(Oe,{title:f("settings.rows.transcription","Transcription"),description:f("settings.help.transcription","Transcribe microphone input before sending it. Chat channel voice messages use the same settings."),children:s.jsx(is,{checked:t.enabled,onChange:b=>a(v=>({...v,enabled:b})),ariaLabel:f("settings.rows.transcription","Transcription"),label:t.enabled?f("settings.values.on","On"):f("settings.values.off","Off")})}),s.jsx(Oe,{title:f("settings.rows.transcriptionProvider","Provider"),description:f("settings.help.transcriptionProvider","Uses the matching provider credentials from Providers."),children:s.jsx(Ua,{providers:h.providers,value:t.provider,emptyLabel:f("settings.voice.selectProvider","Select provider"),showProviderLogos:l,onChange:b=>a(v=>({...v,provider:b}))})}),s.jsx(Oe,{title:f("settings.rows.transcriptionProviderStatus","Provider status"),description:f("settings.help.transcriptionProviderStatus","API keys stay under providers, not in transcription settings."),children:s.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-2",children:[s.jsx(Iu,{tone:x?"success":"neutral",children:x?f("settings.values.configured","Configured"):f("settings.values.notConfigured","Not configured")}),x?null:s.jsx(fe,{size:"sm",variant:"outline",onClick:i,className:"rounded-full",children:f("settings.voice.configureProvider","Configure provider")})]})}),s.jsx(Oe,{title:f("settings.rows.transcriptionModel","Model"),description:f("settings.help.transcriptionModel","Leave as the resolved default unless your provider needs a custom model id."),children:s.jsx(Ye,{value:t.model,onChange:b=>a(v=>({...v,model:b.target.value})),className:"h-8 w-[min(300px,70vw)] rounded-full text-[13px]"})}),s.jsx(Oe,{title:f("settings.rows.transcriptionLanguage","Language"),description:f("settings.help.transcriptionLanguage","Optional ISO-639 hint such as en, zh, ja, or ko."),children:s.jsx(Ye,{value:t.language,onChange:b=>a(v=>({...v,language:b.target.value})),placeholder:f("settings.voice.languageAuto","Auto"),className:"h-8 w-[min(180px,60vw)] rounded-full text-[13px]"})}),s.jsx(Oe,{title:f("settings.rows.voiceLimits","Limits"),children:s.jsxs("div",{className:"flex flex-wrap justify-end gap-2",children:[s.jsx(zi,{value:t.maxDurationSec,min:1,max:600,suffix:"s",onChange:b=>a(v=>({...v,maxDurationSec:b}))}),s.jsx(zi,{value:t.maxUploadMb,min:1,max:100,suffix:"MB",onChange:b=>a(v=>({...v,maxUploadMb:b}))})]})}),s.jsx(ol,{dirty:n,saving:r,pendingRestart:p,dirtyMessage:f("settings.status.restartAfterSaving","Save changes, then restart when ready."),pendingMessage:f("settings.status.savedRestartApply","Saved. Restart when ready."),onSave:o,onRestart:c,isRestarting:d})]})]})}function xD({settings:e,form:t,keyVisible:n,keyEditing:r,saving:a,onChangeForm:o,onChangeProvider:i,onToggleKey:l,onToggleKeyEditing:c,onReset:d,onSave:p,showBrandLogos:m,onRestart:f,isRestarting:h,requiresRestartPending:y}){var _,R;const{t:x}=ie(),b=(T,F)=>x(T,{defaultValue:F}),v=e.web_search.providers.find(T=>T.name===t.provider)??e.web_search.providers[0],g=si(v)&&t.provider===e.web_search.provider&&!!e.web_search.api_key_hint,w=si(v)&&(!g||r),k=((_=t.apiKey)==null?void 0:_.trim())??"",C=((R=t.baseUrl)==null?void 0:R.trim())??"",N=t.useJinaReader??e.web.fetch.use_jina_reader,S=t.provider!==e.web_search.provider||k.length>0||C!==(e.web_search.base_url??"")||t.maxResults!==e.web_search.max_results||t.timeout!==e.web_search.timeout||N!==e.web.fetch.use_jina_reader,A=N!==e.web.fetch.use_jina_reader,E=B1(v)?!k&&!g:(v==null?void 0:v.credential)==="base_url"?!C:!1;return s.jsxs("div",{className:"space-y-7",children:[s.jsxs("section",{children:[s.jsx(Jt,{children:b("settings.sections.webSearch","Web search")}),s.jsxs(Ht,{children:[s.jsx(Oe,{title:x("settings.byok.webSearch.provider"),description:x("settings.byok.webSearch.providerHelp"),children:s.jsx(Ua,{providers:e.web_search.providers,value:t.provider,emptyLabel:x("settings.byok.webSearch.selectProvider"),showProviderLogos:m,onChange:i})}),(v==null?void 0:v.credential)==="none"?s.jsx(Oe,{title:x("settings.byok.webSearch.credentials"),description:x("settings.byok.webSearch.noCredentialHelp"),children:s.jsx(Iu,{tone:"success",children:x("settings.byok.webSearch.noCredentialRequired")})}):null,si(v)?s.jsx(Oe,{title:x("settings.byok.apiKey"),description:x("settings.byok.webSearch.apiKeyHelp"),children:s.jsx("div",{className:"relative w-[280px] max-w-full",children:w?s.jsxs(s.Fragment,{children:[s.jsx(Ye,{type:n?"text":"password",value:t.apiKey??"",onChange:T=>o(F=>({...F,apiKey:T.target.value})),placeholder:x(g?"settings.byok.apiKeyConfiguredPlaceholder":"settings.byok.apiKeyPlaceholder"),className:"h-9 rounded-full pr-11 text-[13px]"}),s.jsx(fe,{type:"button",variant:"ghost",size:"icon",onClick:l,"aria-label":x(n?"settings.byok.hideApiKey":"settings.byok.showApiKey"),className:"absolute right-1 top-1/2 h-7 w-7 -translate-y-1/2 rounded-full text-muted-foreground hover:bg-muted hover:text-foreground",children:n?s.jsx(rw,{className:"h-3.5 w-3.5","aria-hidden":!0}):s.jsx(aw,{className:"h-3.5 w-3.5","aria-hidden":!0})})]}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"flex h-9 items-center rounded-full border border-input bg-background px-3 pr-11 text-[13px] text-muted-foreground",children:e.web_search.api_key_hint??x("settings.byok.configuredKeyHint")}),s.jsx(fe,{type:"button",variant:"ghost",size:"icon",onClick:c,"aria-label":x("settings.actions.edit"),className:"absolute right-1 top-1/2 h-7 w-7 -translate-y-1/2 rounded-full text-muted-foreground hover:bg-muted hover:text-foreground",children:s.jsx(fs,{className:"h-3.5 w-3.5","aria-hidden":!0})})]})})}):null,(v==null?void 0:v.credential)==="base_url"?s.jsx(Oe,{title:x("settings.byok.webSearch.baseUrl"),description:x("settings.byok.webSearch.baseUrlHelp"),children:s.jsx(Ye,{value:t.baseUrl??"",onChange:T=>o(F=>({...F,baseUrl:T.target.value})),placeholder:x("settings.byok.webSearch.baseUrlPlaceholder"),className:"h-9 w-[280px] rounded-full text-[13px]"})}):null]})]}),s.jsxs("section",{children:[s.jsx(Jt,{children:b("settings.sections.webBehavior","Behavior")}),s.jsxs(Ht,{children:[s.jsx(Oe,{title:b("settings.rows.maxResults","Max results"),description:b("settings.help.maxResults","Results returned by each web_search call."),children:s.jsx(zi,{value:t.maxResults??e.web_search.max_results,min:1,max:10,onChange:T=>o(F=>({...F,maxResults:T}))})}),s.jsx(Oe,{title:b("settings.rows.timeout","Timeout"),description:b("settings.help.timeout","Seconds before a search provider request times out."),children:s.jsx(zi,{value:t.timeout??e.web_search.timeout,min:1,max:120,onChange:T=>o(F=>({...F,timeout:T})),suffix:"s"})}),s.jsx(Oe,{title:b("settings.rows.jinaReader","Jina reader"),description:b("settings.help.jinaReader","Use Jina Reader for web_fetch when available."),children:s.jsx(is,{checked:N,onChange:T=>o(F=>({...F,useJinaReader:T})),ariaLabel:b("settings.rows.jinaReader","Jina reader"),label:N?b("settings.values.on","On"):b("settings.values.off","Off")})}),s.jsx(ol,{dirty:S,saving:a,pendingRestart:y,disabled:E,message:E?x("settings.byok.webSearch.missingCredential"):y&&!S?b("settings.status.savedRestartApply","Saved. Restart when ready."):A?b("settings.status.restartAfterSaving","Save changes, then restart when ready."):S?x("settings.byok.webSearch.saveHint"):void 0,onSave:p,onRestart:f,onReset:d,isRestarting:h})]})]})]})}function yD({payload:e,loading:t,query:n,filter:r,sort:a,actionKey:o,error:i,onQueryChange:l,onFilterChange:c,onSortChange:d,onAction:p,onRequestEdit:m,onRequestDelete:f}){const{t:h,i18n:y}=ie(),x=(T,F,z)=>h(T,{defaultValue:F}),b=(e==null?void 0:e.jobs)??[],v=y.resolvedLanguage||y.language,[g,w]=u.useState(null),k=u.useMemo(()=>{const T=RD(n);return jD(b,a).filter(F=>FD(F,r)).filter(F=>!T.length||MD(F,T))},[r,b,n,a]),C=b.filter(T=>{const F=Za(T);return F==="active"||F==="running"}).length,N=b.filter(T=>Za(T)==="paused").length,S=b.filter(q1).length,A=b.filter(T=>T.protected).length,E=[{value:"all",label:x("settings.automations.filters.all","All"),count:b.length},{value:"active",label:x("settings.automations.filters.active","Active"),count:C},{value:"paused",label:x("settings.automations.filters.paused","Paused"),count:N},{value:"failed",label:x("settings.automations.filters.failed","Needs attention"),count:S},{value:"system",label:x("settings.automations.filters.system","System"),count:A}],_={next:x("settings.automations.sort.next","Next run"),last:x("settings.automations.sort.last","Last run"),updated:x("settings.automations.sort.updated","Updated"),name:x("settings.automations.sort.name","Name")},R=k.find(T=>T.id===g)??k[0]??null;return u.useEffect(()=>{if(!k.length){g!==null&&w(null);return}(!g||!k.some(T=>T.id===g))&&w(k[0].id)},[k,g]),s.jsxs("div",{className:"space-y-5",children:[s.jsx("section",{className:"shrink-0",children:s.jsxs("div",{className:"mx-auto flex w-full max-w-[56rem] flex-col gap-3",children:[s.jsx("div",{className:"-mx-1 overflow-x-auto px-1 pb-0.5",children:s.jsx("div",{className:"grid w-full min-w-[36rem] grid-cols-5 gap-1 rounded-[15px] bg-muted/42 p-1 shadow-[inset_0_0_0_1px_rgba(15,23,42,0.035)] dark:bg-background/30",children:E.map(T=>s.jsxs("button",{type:"button",onClick:()=>c(T.value),className:j("inline-flex h-8 min-w-0 shrink-0 items-center justify-center gap-2 whitespace-nowrap rounded-[11px] px-3 text-[12px] font-medium text-muted-foreground transition-colors",r===T.value&&"bg-background text-foreground shadow-[0_8px_20px_rgba(15,23,42,0.07)] dark:bg-background/80",zD(T.value,T.count,r===T.value)),children:[s.jsx("span",{children:T.label}),s.jsx("span",{className:j("min-w-5 shrink-0 rounded-full bg-background/75 px-1.5 py-0.5 text-center text-[11px] tabular-nums text-muted-foreground",$D(T.value,T.count)),children:T.count})]},T.value))})}),s.jsxs("div",{className:"grid min-w-0 gap-2 sm:grid-cols-[minmax(0,1fr)_auto] sm:items-center",children:[s.jsxs("div",{className:"relative min-w-0",children:[s.jsx(Tt,{className:"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground/70"}),s.jsx(Ye,{value:n,onChange:T=>l(T.target.value),placeholder:x("settings.automations.search","Search task, message, linked chat, or schedule"),className:"h-9 w-full rounded-[13px] border-border/45 bg-background/85 pl-9 text-[13px] shadow-[0_8px_22px_rgba(15,23,42,0.04)] dark:border-white/10 dark:bg-background/40"})]}),s.jsxs(gn,{children:[s.jsx(vn,{asChild:!0,children:s.jsxs("button",{type:"button",className:"inline-flex h-9 min-w-[8.5rem] items-center justify-center gap-1.5 whitespace-nowrap rounded-[13px] border border-border/45 bg-background/85 px-3 text-[12px] font-medium text-muted-foreground shadow-[0_8px_22px_rgba(15,23,42,0.04)] transition-colors hover:bg-muted/70 hover:text-foreground dark:border-white/10 dark:bg-background/40 sm:w-auto",children:[s.jsx(Wj,{className:"h-3.5 w-3.5","aria-hidden":!0}),s.jsx("span",{children:_[a]}),s.jsx(yr,{className:"h-3.5 w-3.5","aria-hidden":!0})]})}),s.jsx(ln,{align:"end",className:"min-w-40",children:Object.keys(_).map(T=>s.jsxs(gt,{onClick:()=>d(T),children:[s.jsx("span",{children:_[T]}),a===T?s.jsx(Et,{className:"ml-auto h-3.5 w-3.5","aria-hidden":!0}):null]},T))})]})]})]})}),i?s.jsxs("div",{className:"flex items-center gap-2 rounded-[18px] border border-destructive/20 bg-destructive/5 px-4 py-3 text-[13px] text-destructive",children:[s.jsx(ja,{className:"h-4 w-4 shrink-0","aria-hidden":!0}),s.jsx("span",{children:i})]}):null,t&&!e?s.jsxs("div",{className:"flex h-44 items-center justify-center rounded-[24px] border border-border/45 bg-card/80 text-[13px] text-muted-foreground shadow-[0_22px_70px_rgba(15,23,42,0.055)]",children:[s.jsx(pt,{className:"mr-2 h-4 w-4 animate-spin","aria-hidden":!0}),x("settings.automations.loading","Loading automations...")]}):k.length&&R?s.jsxs("section",{className:"grid min-h-0 overflow-hidden rounded-[22px] border border-border/45 bg-transparent shadow-none dark:border-white/10 xl:grid-cols-[minmax(16rem,18rem)_minmax(0,1fr)] xl:items-stretch",children:[s.jsxs("aside",{className:"flex min-h-0 flex-col overflow-hidden border-b border-border/35 bg-background/36 dark:border-white/10 dark:bg-background/18 xl:border-b-0 xl:border-r",children:[s.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-3 px-4 py-3",children:[s.jsx("h2",{className:"text-[13px] font-semibold tracking-[-0.01em] text-foreground/85",children:x("settings.automations.queue","Queue")}),s.jsx("span",{className:"rounded-full bg-orange-100/60 px-2 py-0.5 text-[11px] text-orange-800/70 tabular-nums dark:bg-orange-300/10 dark:text-orange-200/75",children:k.length})]}),s.jsx("div",{className:"max-h-[28rem] space-y-1 overflow-y-auto overscroll-contain px-2 pb-2 xl:max-h-[calc(100vh-24rem)]",role:"list","aria-label":x("settings.automations.queue","Queue"),children:k.map(T=>s.jsx(bD,{job:T,locale:v,selected:T.id===R.id,onSelect:()=>w(T.id)},T.id))})]}),s.jsx(wD,{job:R,locale:v,actionKey:o,onAction:p,onRequestEdit:m,onRequestDelete:f})]}):s.jsxs("div",{className:"rounded-[24px] border border-border/45 bg-card/80 px-5 py-12 text-center text-[13px] text-muted-foreground shadow-[0_22px_70px_rgba(15,23,42,0.055)]",children:[s.jsx("div",{children:b.length?x("settings.automations.noMatches","No automations match this view."):x("settings.automations.empty","No automations yet.")}),b.length?null:s.jsx("div",{className:"mx-auto mt-2 max-w-[28rem] text-[12px] leading-5",children:x("settings.automations.emptyHint","Create one from where it should run so nanobot keeps the right context.")})]})]})}function bD({job:e,locale:t,selected:n,onSelect:r}){const{t:a}=ie(),o=(d,p,m)=>a(d,{defaultValue:p,...m??{}}),i=Q1(e,o),l=X1(e,o),c=Qf(e,o);return s.jsx("div",{role:"listitem",children:s.jsxs("button",{type:"button","aria-pressed":n,onClick:r,className:j("group grid w-full grid-cols-[minmax(0,1fr)_auto] gap-3 rounded-[18px] px-3 py-3.5 text-left transition-colors",n?"bg-background text-foreground shadow-[0_10px_28px_rgba(15,23,42,0.055)] ring-1 ring-border/45 dark:bg-background/45 dark:ring-white/10":"text-muted-foreground hover:bg-white/48 hover:text-foreground dark:hover:bg-background/24"),children:[s.jsxs("span",{className:"min-w-0",children:[s.jsxs("span",{className:"flex min-w-0 items-center gap-2.5",children:[s.jsx("span",{className:j("h-2 w-2 shrink-0 rounded-full",HD(e)),"aria-hidden":!0}),s.jsx("span",{className:"truncate text-[13.5px] font-medium text-foreground",children:e.name||e.id})]}),s.jsx("span",{className:"mt-1.5 line-clamp-2 text-[12px] leading-5 text-muted-foreground",children:e.payload.message||o("settings.automations.systemTask","System-managed automation")}),s.jsxs("span",{className:"mt-2.5 flex min-w-0 items-center gap-2 text-[11.5px] leading-none text-muted-foreground",children:[s.jsx("span",{className:"truncate",title:J1(e,t,o),children:c}),s.jsx("span",{className:"h-1 w-1 shrink-0 rounded-full bg-muted-foreground/35","aria-hidden":!0}),s.jsx("span",{className:"truncate",children:l})]})]}),s.jsxs("span",{className:"flex shrink-0 flex-col items-end gap-2 pt-0.5",children:[s.jsx("span",{className:"rounded-full bg-white/65 px-2 py-0.5 text-[11px] font-medium text-muted-foreground shadow-[inset_0_0_0_1px_rgba(120,72,25,0.055)] dark:bg-background/35",children:i.label}),e.delete_after_run?s.jsx("span",{className:"rounded-full bg-background/80 px-2 py-0.5 text-[11px] font-medium text-muted-foreground",children:o("settings.automations.oneShot","One-time")}):null,s.jsx(Wr,{className:j("h-3.5 w-3.5 text-muted-foreground/55 transition-opacity",n?"opacity-100":"opacity-0 group-hover:opacity-70"),"aria-hidden":!0})]})]})})}function wD({job:e,locale:t,actionKey:n,onAction:r,onRequestEdit:a,onRequestDelete:o}){var g;const{t:i}=ie(),l=(w,k,C)=>i(w,{defaultValue:k,...C??{}}),c=Q1(e,l),d=X1(e,l),p=((g=e.origin)==null?void 0:g.channel)==="websocket"&&e.origin.session_key?`#/chat/${encodeURIComponent(e.origin.session_key)}`:null,m=e.created_at_ms?$r(e.created_at_ms,t):null,f=e.updated_at_ms?$r(e.updated_at_ms,t):null,h=e.payload.message||l("settings.automations.systemTask","System-managed automation"),y=UD(e,t,l),[x,b]=u.useState(!1),v=CD(h);return u.useEffect(()=>{b(!1)},[e.id]),s.jsxs("article",{className:"flex min-h-0 min-w-0 flex-col overflow-hidden bg-background/42 dark:bg-background/18",children:[s.jsx("div",{className:"shrink-0 border-b border-border/35 px-4 py-3.5 dark:border-white/10 sm:px-5",children:s.jsxs("div",{className:"flex flex-col gap-3 lg:flex-row lg:items-start lg:justify-between",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[s.jsx("h3",{className:"min-w-0 truncate text-[18px] font-medium leading-7 text-foreground",children:e.name||e.id}),s.jsx(Mv,{tone:c.tone,children:c.label}),e.delete_after_run?s.jsx(Mv,{children:l("settings.automations.oneShot","One-time")}):null]}),s.jsxs("p",{className:"mt-1 truncate text-[12.5px] leading-5 text-muted-foreground",children:[y," · ",d]})]}),s.jsx(kD,{job:e,actionKey:n,onAction:r,onRequestEdit:a,onRequestDelete:o})]})}),s.jsxs("div",{className:"grid min-h-0 min-w-0 flex-1 overflow-hidden lg:grid-cols-[minmax(0,1fr)_14.5rem]",children:[s.jsxs("div",{className:"min-h-0 min-w-0 space-y-3 overflow-y-auto overscroll-contain p-4 sm:p-5",children:[s.jsxs("section",{className:"rounded-[20px] border border-border/35 bg-background/62 px-4 py-3.5 shadow-[inset_0_1px_0_rgba(255,255,255,0.58)] dark:border-white/10 dark:bg-background/24",children:[s.jsx("div",{className:"text-[11px] font-medium leading-none text-muted-foreground/75",children:l("settings.automations.fields.message","Message")}),s.jsx("div",{className:j("mt-3 whitespace-pre-wrap break-words text-[13px] leading-6 text-foreground/85",!x&&v&&"line-clamp-6"),children:h}),v?s.jsx("button",{type:"button",className:"mt-3 inline-flex text-[12px] font-medium text-muted-foreground underline-offset-2 hover:text-foreground hover:underline",onClick:()=>b(w=>!w),children:x?l("settings.automations.message.showLess","Show less"):l("settings.automations.message.showMore","Show full message")}):null]}),s.jsxs("div",{className:"grid gap-3 md:grid-cols-2",children:[s.jsx(Ld,{label:l("settings.automations.labels.next","Next"),title:J1(e,t,l),children:Qf(e,l)}),s.jsx(Ld,{label:l("settings.automations.labels.origin","Linked chat"),title:d,children:p?s.jsxs("a",{className:"inline-flex max-w-full items-center gap-1 text-foreground/80 underline-offset-2 hover:underline",href:p,children:[s.jsx("span",{className:"truncate",children:d}),s.jsx(nw,{className:"h-3 w-3 shrink-0","aria-hidden":!0})]}):d})]}),e.state.last_error?s.jsx("div",{className:"rounded-[16px] border border-destructive/20 bg-destructive/8 px-3 py-2 text-[12px] leading-5 text-destructive",children:e.state.last_error}):null]}),s.jsx("aside",{className:"min-h-0 overflow-y-auto overscroll-contain border-t border-border/35 bg-muted/20 p-4 text-[12px] text-muted-foreground dark:border-white/10 dark:bg-background/16 lg:border-l lg:border-t-0",children:s.jsxs("div",{className:"grid gap-3",children:[s.jsx(Ld,{label:l("settings.automations.labels.schedule","Schedule"),title:y,children:y}),s.jsx("div",{className:"rounded-[18px] bg-background/55 p-3",children:s.jsxs("div",{className:"grid gap-3",children:[m?s.jsxs("div",{children:[s.jsx("div",{className:"text-[11px] leading-none text-muted-foreground/75",children:l("settings.automations.labels.created","Created")}),s.jsx("div",{className:"mt-1.5 text-[12.5px] leading-5 text-foreground/80",children:m})]}):null,f?s.jsxs("div",{children:[s.jsx("div",{className:"text-[11px] leading-none text-muted-foreground/75",children:l("settings.automations.labels.updated","Updated")}),s.jsx("div",{className:"mt-1.5 text-[12.5px] leading-5 text-foreground/80",children:f})]}):null,s.jsxs("div",{children:[s.jsx("div",{className:"text-[11px] leading-none text-muted-foreground/75",children:"ID"}),s.jsx("div",{className:"mt-1.5 break-all font-mono text-[11.5px] leading-5 text-foreground/70",children:e.id})]})]})})]})})]})]})}function kD({job:e,actionKey:t,onAction:n,onRequestEdit:r,onRequestDelete:a}){const{t:o}=ie(),i=(h,y,x)=>o(h,{defaultValue:y}),l=!e.protected,c=!!e.origin,d=l&&c&&e.enabled&&!e.state.pending,p=e.enabled?"disable":"enable",m=l&&(e.enabled||c),f=t===`${p}:${e.id}`;return l?s.jsxs("div",{className:"flex shrink-0 items-center gap-1 rounded-full border border-border/35 bg-background/70 p-1 shadow-[0_10px_26px_rgba(15,23,42,0.055)] dark:border-white/10 dark:bg-background/35",children:[s.jsx(An,{ariaLabel:i("settings.automations.edit","Edit"),disabled:!!t,onClick:()=>r(e),children:s.jsx(fs,{className:"h-4 w-4","aria-hidden":!0})}),s.jsx(An,{ariaLabel:i("settings.automations.runNow","Run now"),busy:t===`run:${e.id}`,disabled:!d,onClick:()=>void n("run",e),children:s.jsx(jc,{className:"h-4 w-4","aria-hidden":!0})}),s.jsx(An,{ariaLabel:e.enabled?i("settings.automations.pause","Pause"):i("settings.automations.resume","Resume"),busy:f,disabled:!m,onClick:()=>void n(p,e),children:e.enabled?s.jsx(Gj,{className:"h-4 w-4","aria-hidden":!0}):s.jsx(jc,{className:"h-4 w-4","aria-hidden":!0})}),s.jsx(An,{ariaLabel:i("settings.automations.delete","Delete"),tone:"danger",disabled:!!t,onClick:()=>a(e),children:s.jsx(ya,{className:"h-4 w-4","aria-hidden":!0})})]}):s.jsx("span",{className:"inline-flex h-9 items-center rounded-full bg-muted px-3 text-[12px] font-medium text-muted-foreground",children:i("settings.automations.protected","Protected")})}function Mv({tone:e="neutral",children:t}){return s.jsx("span",{className:j("inline-flex h-6 items-center rounded-full px-2.5 text-[11.5px] font-medium shadow-[inset_0_0_0_1px_rgba(120,72,25,0.055)]",e==="success"&&"bg-orange-100/72 text-orange-800 dark:bg-orange-300/12 dark:text-orange-200",e==="warning"&&"bg-amber-100/80 text-amber-800 dark:bg-amber-300/14 dark:text-amber-200",e==="neutral"&&"bg-white/64 text-muted-foreground dark:bg-background/35 dark:text-muted-foreground"),children:t})}function CD(e){return e.length>360||e.split(/\r?\n/).length>6}function Ld({label:e,title:t,secondary:n,children:r}){return s.jsxs("div",{className:"min-w-0 rounded-[17px] bg-background/52 px-3 py-3 shadow-[inset_0_0_0_1px_rgba(15,23,42,0.035)] dark:bg-background/22",children:[s.jsx("div",{className:"text-[11px] font-medium leading-none text-muted-foreground/75",children:e}),s.jsxs("div",{className:"mt-1.5 min-w-0",children:[s.jsx("div",{className:"line-clamp-2 text-[13px] leading-5 text-foreground/85",title:t,children:r}),n?s.jsx("div",{className:"mt-0.5 truncate text-[11.5px] leading-4 text-muted-foreground",title:t,children:n}):null]})]})}const Yf=[{value:"second",ms:1e3},{value:"minute",ms:6e4},{value:"hour",ms:36e5},{value:"day",ms:864e5}];function SD({job:e,saving:t,onOpenChange:n,onSave:r}){const{t:a}=ie(),o=(f,h,y)=>a(f,{defaultValue:h,...y??{}}),[i,l]=u.useState(()=>Ev(null));u.useEffect(()=>{l(Ev(e))},[e]);const c=_D(i,e,o),d=[{value:"every",label:o("settings.automations.scheduleTypes.every","Interval")},{value:"cron",label:o("settings.automations.scheduleTypes.cron","Cron")},{value:"at",label:o("settings.automations.scheduleTypes.at","Once")}],p={second:o("settings.automations.everyUnits.second","Seconds"),minute:o("settings.automations.everyUnits.minute","Minutes"),hour:o("settings.automations.everyUnits.hour","Hours"),day:o("settings.automations.everyUnits.day","Days")},m=f=>{f.preventDefault();const h=PD(i,e);!e||typeof h=="string"||r(e,h)};return s.jsx(Yi,{open:!!e,onOpenChange:n,children:e?s.jsx(bs,{"aria-describedby":void 0,className:"w-[min(calc(100vw-2rem),34rem)] rounded-[26px]",children:s.jsxs("form",{className:"space-y-5",onSubmit:m,children:[s.jsx(Qi,{children:s.jsx(ws,{children:o("settings.automations.editTitle","Edit automation")})}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("label",{className:"block space-y-1.5",children:[s.jsx("span",{className:"text-[12px] font-medium text-muted-foreground",children:o("settings.automations.fields.name","Name")}),s.jsx(Ye,{value:i.name,onChange:f=>l(h=>({...h,name:f.target.value})),className:"h-10 rounded-[12px]"})]}),s.jsxs("label",{className:"block space-y-1.5",children:[s.jsx("span",{className:"text-[12px] font-medium text-muted-foreground",children:o("settings.automations.fields.message","Message")}),s.jsx(Ro,{value:i.message,onChange:f=>l(h=>({...h,message:f.target.value})),className:"min-h-[160px] resize-none rounded-[12px] text-[13px] leading-5"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx("span",{className:"text-[12px] font-medium text-muted-foreground",children:o("settings.automations.fields.scheduleType","Schedule type")}),s.jsx(eo,{value:i.scheduleKind,options:d,onChange:f=>l(h=>({...h,scheduleKind:f}))})]}),i.scheduleKind==="every"?s.jsxs("div",{className:"grid gap-2 sm:grid-cols-[minmax(0,1fr)_10rem]",children:[s.jsxs("label",{className:"block space-y-1.5",children:[s.jsx("span",{className:"text-[12px] font-medium text-muted-foreground",children:o("settings.automations.fields.every","Every")}),s.jsx(Ye,{type:"number",min:1,step:1,value:i.everyValue,onChange:f=>l(h=>({...h,everyValue:f.target.value})),className:"h-10 rounded-[12px]"})]}),s.jsxs("label",{className:"block space-y-1.5",children:[s.jsx("span",{className:"text-[12px] font-medium text-muted-foreground",children:o("settings.automations.fields.unit","Unit")}),s.jsx("select",{value:i.everyUnit,onChange:f=>l(h=>({...h,everyUnit:f.target.value})),className:"h-10 w-full rounded-[12px] border border-input bg-background px-3 text-[13px] text-foreground shadow-sm outline-none transition-colors focus-visible:ring-2 focus-visible:ring-ring",children:Yf.map(f=>s.jsx("option",{value:f.value,children:p[f.value]},f.value))})]})]}):null,i.scheduleKind==="cron"?s.jsxs("div",{className:"grid gap-2 sm:grid-cols-[minmax(0,1fr)_12rem]",children:[s.jsxs("label",{className:"block space-y-1.5",children:[s.jsx("span",{className:"text-[12px] font-medium text-muted-foreground",children:o("settings.automations.fields.cronExpression","Cron expression")}),s.jsx(Ye,{value:i.cronExpr,onChange:f=>l(h=>({...h,cronExpr:f.target.value})),placeholder:"0 9 * * *",className:"h-10 rounded-[12px] font-mono text-[13px]"})]}),s.jsxs("label",{className:"block space-y-1.5",children:[s.jsx("span",{className:"text-[12px] font-medium text-muted-foreground",children:o("settings.automations.fields.timezone","Timezone")}),s.jsx(Ye,{value:i.tz,onChange:f=>l(h=>({...h,tz:f.target.value})),placeholder:"Asia/Shanghai",className:"h-10 rounded-[12px] text-[13px]"})]})]}):null,i.scheduleKind==="at"?s.jsxs("label",{className:"block space-y-1.5",children:[s.jsx("span",{className:"text-[12px] font-medium text-muted-foreground",children:o("settings.automations.fields.runAt","Run at")}),s.jsx(Ye,{type:"datetime-local",value:i.atLocal,onChange:f=>l(h=>({...h,atLocal:f.target.value})),className:"h-10 rounded-[12px]"})]}):null,c?s.jsx("div",{className:"rounded-[12px] bg-destructive/8 px-3 py-2 text-[12px] text-destructive",children:c}):null]}),s.jsxs(Xi,{children:[s.jsx(fe,{type:"button",variant:"ghost",onClick:()=>n(!1),disabled:t,className:"rounded-full",children:o("settings.automations.cancel","Cancel")}),s.jsxs(fe,{type:"submit",disabled:!!c||t,className:"rounded-full",children:[t?s.jsx(pt,{className:"mr-2 h-4 w-4 animate-spin","aria-hidden":!0}):null,o("settings.automations.save","Save")]})]})]})}):null})}function ND({job:e,deleting:t,onOpenChange:n,onConfirm:r}){const{t:a}=ie(),o=(i,l,c)=>a(i,{defaultValue:l,...c??{}});return s.jsx(Yi,{open:!!e,onOpenChange:n,children:s.jsxs(bs,{className:"w-[min(calc(100vw-2rem),26rem)] rounded-[26px]",children:[s.jsxs(Qi,{children:[s.jsx(ws,{children:o("settings.automations.deleteTitle","Delete automation")}),s.jsx(Ji,{children:o("settings.automations.deleteDescription","This removes {{name}} from the cron store. Past chat messages stay in the session.",{name:(e==null?void 0:e.name)||(e==null?void 0:e.id)||""})})]}),s.jsxs(Xi,{children:[s.jsx(fe,{type:"button",variant:"ghost",onClick:()=>n(!1),disabled:t,className:"rounded-full",children:o("settings.automations.cancel","Cancel")}),s.jsxs(fe,{type:"button",variant:"destructive",onClick:()=>e&&void r(e),disabled:!e||t,className:"rounded-full",children:[t?s.jsx(pt,{className:"mr-2 h-4 w-4 animate-spin","aria-hidden":!0}):null,o("settings.automations.delete","Delete")]})]})]})})}function q1(e){return e.state.last_status==="error"}function Za(e){return e.protected?"system":e.state.pending?"running":e.enabled?e.state.last_status==="error"?"failed":e.delete_after_run&&!e.state.next_run_at_ms&&e.state.last_status==="ok"?"completed":e.state.next_run_at_ms?"active":"idle":"paused"}function jD(e,t){const n=(r,a)=>(r.name||r.id).localeCompare(a.name||a.id);return[...e].sort((r,a)=>{if(t==="name")return n(r,a);if(t==="last")return(a.state.last_run_at_ms??0)-(r.state.last_run_at_ms??0)||n(r,a);if(t==="updated")return(a.updated_at_ms??0)-(r.updated_at_ms??0)||n(r,a);const o=r.state.next_run_at_ms??Number.MAX_SAFE_INTEGER,i=a.state.next_run_at_ms??Number.MAX_SAFE_INTEGER;return o-i||n(r,a)})}function Ev(e){const t=AD((e==null?void 0:e.schedule.every_ms)??36e5),n=(e==null?void 0:e.schedule.kind)==="at"||(e==null?void 0:e.schedule.kind)==="cron"?e.schedule.kind:"every";return{name:(e==null?void 0:e.name)??"",message:(e==null?void 0:e.payload.message)??"",scheduleKind:n,everyValue:t.value,everyUnit:t.unit,cronExpr:(e==null?void 0:e.schedule.expr)??"0 9 * * *",tz:(e==null?void 0:e.schedule.tz)??"",atLocal:K1((e==null?void 0:e.schedule.at_ms)??Date.now()+36e5)}}function AD(e){for(const t of[...Yf].reverse())if(e>=t.ms&&e%t.ms===0)return{value:String(e/t.ms),unit:t.value};return{value:String(Math.max(1,Math.round(e/6e4))),unit:"minute"}}function K1(e){const t=new Date(e);return Number.isFinite(t.getTime())?new Date(e-t.getTimezoneOffset()*6e4).toISOString().slice(0,16):""}function _D(e,t,n){if(!e.name.trim())return n("settings.automations.validation.nameRequired","Name is required.");if(!e.message.trim())return n("settings.automations.validation.messageRequired","Message is required.");if(e.scheduleKind==="every"){const r=Number(e.everyValue);if(!Number.isInteger(r)||r<=0)return n("settings.automations.validation.intervalRequired","Interval must be a positive number.")}if(e.scheduleKind==="cron"&&!e.cronExpr.trim())return n("settings.automations.validation.cronRequired","Cron expression is required.");if(e.scheduleKind==="at"){const r=new Date(e.atLocal).getTime();if(!Number.isFinite(r))return n("settings.automations.validation.timeRequired","Run time is required.");if(r<=Date.now()&&G1(e,t))return n("settings.automations.validation.futureRequired","Run time must be in the future.")}return null}function PD(e,t){const n=e.name.trim(),r=e.message.trim();if(!n||!r)return"invalid";const a={name:n,message:r},o=V1(e);return typeof o=="string"?o:(G1(e,t,o)&&(a.schedule=o),a)}function V1(e){if(e.scheduleKind==="every"){const t=Yf.find(r=>r.value===e.everyUnit),n=Number(e.everyValue);return!t||!Number.isInteger(n)||n<=0?"invalid":{kind:"every",every_ms:n*t.ms}}else if(e.scheduleKind==="cron"){const t=e.cronExpr.trim();return t?{kind:"cron",expr:t,...e.tz.trim()?{tz:e.tz.trim()}:{}}:"invalid"}else{const t=new Date(e.atLocal).getTime();return Number.isFinite(t)?{kind:"at",at_ms:t}:"invalid"}}function G1(e,t,n=V1(e)){return!t||typeof n=="string"||n.kind!==t.schedule.kind?!0:n.kind==="every"?n.every_ms!==t.schedule.every_ms:n.kind==="cron"?n.expr!==(t.schedule.expr??"")||(n.tz??null)!==(t.schedule.tz??null):e.atLocal!==K1(t.schedule.at_ms??NaN)}const TD=new Set(["id","name","message","chat","cron","schedule","status"]),pm={api:"API",cli:"CLI",dingtalk:"DingTalk",discord:"Discord",email:"Email",feishu:"Feishu",matrix:"Matrix",msteams:"Microsoft Teams",qq:"QQ",slack:"Slack",telegram:"Telegram",wechat:"WeChat",wecom:"WeCom",weixin:"WeChat",whatsapp:"WhatsApp"};function RD(e){return(e.match(/[^\s:]+:"[^"]+"|"[^"]+"|\S+/g)??[]).map(t=>{const n=Iv(t);if(!n)return null;const r=n.match(/^([A-Za-z]+):(.*)$/);if(!r)return{field:null,value:n.toLowerCase()};const a=r[1].toLowerCase(),o=Iv(r[2]).toLowerCase();return o?TD.has(a)?{field:a,value:o}:{field:null,value:n.toLowerCase()}:null}).filter(t=>!!t)}function Iv(e){return e.trim().replace(/^"|"$/g,"").trim()}function MD(e,t){return t.every(n=>ED(e,n.field).includes(n.value))}function ED(e,t=null){return ID(e,t).filter(Boolean).join(" ").toLowerCase()}function ID(e,t){const n=LD(e),r=DD(e);return t==="id"?[e.id]:t==="name"?[e.name,e.id]:t==="message"?[e.payload.message]:t==="chat"?n:t==="cron"||t==="schedule"?r:t==="status"?[Za(e),e.enabled?"enabled":"disabled"]:[e.id,e.name,e.payload.message,...r,Za(e),...n]}function LD(e){const t=e.origin;if(!t)return[];const n=t.channel.trim().toLowerCase();return[t.session_key,t.title,t.preview,t.channel,pm[n]]}function DD(e){const t=e.schedule,n=[t.kind,t.expr,t.tz,t.every_ms,t.at_ms];return t.kind==="cron"&&t.expr&&n.push(...OD(t.expr)),n}function OD(e){const t=e.trim().split(/\s+/);if(t.length!==5)return[];const[n,r,a,o,i]=t,l=a==="*"&&o==="*"&&i==="*",c=Bc(n,59),d=Bc(r,23);if(c===null)return[];const p=String(c).padStart(2,"0");if(d!==null)return[`${String(d).padStart(2,"0")}:${p}`,`:${p}`];if(l&&r==="*")return[`:${p}`,`hourly at :${p}`];const m=/^(\d{1,2})-(\d{1,2})$/.exec(r);if(!l||!m)return[];const f=Number(m[1]),h=Number(m[2]);if(f>23||h>23)return[];const y=`${String(f).padStart(2,"0")}-${String(h).padStart(2,"0")}`,x=`${f}-${h}`;return[y,x,`:${p}`,`${y} at :${p}`,`hourly ${y} at :${p}`]}function FD(e,t){const n=Za(e);return t==="active"?n==="active"||n==="running":t==="paused"?n==="paused":t==="failed"?q1(e):t==="system"?!!e.protected:!0}const Y1={active:{text:"text-emerald-600 dark:text-emerald-400",selectedText:"text-emerald-700 dark:text-emerald-300",count:"bg-emerald-500/10 text-emerald-700 dark:text-emerald-300"},paused:{text:"text-amber-600 dark:text-amber-400",selectedText:"text-amber-700 dark:text-amber-300",count:"bg-amber-500/10 text-amber-700 dark:text-amber-300"},failed:{text:"text-rose-600 dark:text-rose-400",selectedText:"text-rose-700 dark:text-rose-300",count:"bg-rose-500/10 text-rose-700 dark:text-rose-300"},system:{text:"text-sky-600 dark:text-sky-400",selectedText:"text-sky-700 dark:text-sky-300",count:"bg-sky-500/10 text-sky-700 dark:text-sky-300"}};function zD(e,t,n){const r=Y1[e];return t<=0||!r?"":n?r.selectedText:r.text}function $D(e,t){const n=Y1[e];return t>0&&n?n.count:""}function Q1(e,t){const n=Za(e);return n==="system"?{label:t("settings.automations.status.system","System"),tone:"neutral"}:n==="running"?{label:t("settings.automations.status.running","Running now"),tone:"warning"}:n==="paused"?{label:t("settings.automations.status.paused","Paused"),tone:"neutral"}:n==="failed"?{label:t("settings.automations.status.failed","Failed"),tone:"warning"}:n==="completed"?{label:t("settings.automations.status.completed","Completed"),tone:"neutral"}:n==="idle"?{label:t("settings.automations.status.noSchedule","No schedule"),tone:"neutral"}:{label:t("settings.automations.status.active","Active"),tone:"success"}}function X1(e,t){if(e.protected)return t("settings.automations.origin.system","System");const n=e.origin;return n?n.channel!=="websocket"?Lv(n.channel,t):n.title||n.preview||n.session_key||Lv(n.channel,t):t("settings.automations.origin.unknown","No linked chat")}function Lv(e,t){const n=e.trim().toLowerCase();return pm[n]?t(`settings.automations.channels.${n}`,pm[n]):e}function UD(e,t,n){if(e.schedule.kind==="at"&&e.schedule.at_ms)return n("settings.automations.schedule.at","At {{time}}",{time:$r(e.schedule.at_ms,t)});if(e.schedule.kind==="every"&&e.schedule.every_ms)return n("settings.automations.schedule.every","Every {{duration}}",{duration:WD(e.schedule.every_ms,t)});if(e.schedule.kind==="cron"&&e.schedule.expr){const r=BD(e.schedule.expr,n);return r?e.schedule.tz?n("settings.automations.schedule.withTz","{{summary}} · {{tz}}",{summary:r,tz:e.schedule.tz}):r:e.schedule.tz?n("settings.automations.schedule.cronWithTz","Cron {{expr}} · {{tz}}",{expr:e.schedule.expr,tz:e.schedule.tz}):n("settings.automations.schedule.cron","Cron {{expr}}",{expr:e.schedule.expr})}return n("settings.automations.schedule.custom","Custom schedule")}function BD(e,t){const n=e.trim().split(/\s+/);if(n.length!==5)return null;const[r,a,o,i,l]=n,c=Bc(r,59),d=Bc(a,23),p=o==="*"&&i==="*"&&l==="*",m=o==="*"&&i==="*"&&["1-5","MON-FRI","mon-fri"].includes(l);if(c!==null&&d!==null){const h=`${String(d).padStart(2,"0")}:${String(c).padStart(2,"0")}`;if(p)return t("settings.automations.schedule.dailyAt","Daily at {{time}}",{time:h});if(m)return t("settings.automations.schedule.weekdaysAt","Weekdays at {{time}}",{time:h})}if(p&&c!==null&&a==="*")return t("settings.automations.schedule.hourlyAt","Hourly at :{{minute}}",{minute:String(c).padStart(2,"0")});const f=/^(\d{1,2})-(\d{1,2})$/.exec(a);if(p&&c!==null&&f){const h=Number(f[1]),y=Number(f[2]);return h>23||y>23?null:t("settings.automations.schedule.hourlyWindow","Hourly {{start}}-{{end}} at :{{minute}}",{start:String(h).padStart(2,"0"),end:String(y).padStart(2,"0"),minute:String(c).padStart(2,"0")})}return null}function Bc(e,t){if(!/^\d{1,2}$/.test(e))return null;const n=Number(e);return n<=t?n:null}function Qf(e,t){return e.enabled?e.state.pending?t("settings.automations.next.pending","Running now"):e.state.next_run_at_ms?Af(e.state.next_run_at_ms):t("settings.automations.next.none","No next run"):t("settings.automations.next.paused","Paused")}function J1(e,t,n){return e.state.next_run_at_ms?$r(e.state.next_run_at_ms,t):Qf(e,n)}function HD(e){const t=Za(e);return t==="active"||t==="running"?"bg-orange-500 shadow-[0_0_0_3px_rgba(249,115,22,0.12)]":t==="failed"?"bg-amber-500 shadow-[0_0_0_3px_rgba(245,158,11,0.13)]":"bg-muted-foreground/45"}function Dv(e,t,n,r=0){return new Intl.NumberFormat(n,{style:"unit",unit:t,unitDisplay:"long",maximumFractionDigits:r}).format(e)}function WD(e,t){const n=[["day",864e5],["hour",36e5],["minute",6e4],["second",1e3]];for(const[o,i]of n)if(e>=i&&e%i===0)return Dv(e/i,o,t);const r=e<6e4?"second":"minute";return Dv(e/(r==="second"?1e3:6e4),r,t,1)}function qD({cliApps:e,mcpPresets:t,cliAppsLoading:n,mcpPresetsLoading:r,query:a,filter:o,cliActionKey:i,mcpActionKey:l,cliMessage:c,cliError:d,cliFocusName:p,mcpMessage:m,mcpError:f,mcpFieldValues:h,customMcpForm:y,mcpConfigImport:x,showBrandLogos:b,requiresRestartPending:v,onQueryChange:g,onFilterChange:w,onCliAction:k,onMcpAction:C,onDismissStatus:N,onBackToChat:S,onMcpFieldChange:A,onCustomMcpFormChange:E,onMcpConfigImportChange:_,onSaveCustomMcp:R,onImportMcpConfig:T,onMcpToolsChange:F,onRestart:z,isRestarting:K}){const{t:$}=ie(),W=(I,Q)=>$(I,{defaultValue:Q}),P=[{value:"all",label:W("settings.apps.filterAll","All")},{value:"cli",label:W("settings.apps.filterCli","App CLIs")},{value:"mcp",label:W("settings.apps.filterMcp","MCP services")}],D=a.trim().toLowerCase(),G=[...((e==null?void 0:e.apps)??[]).map(I=>({id:`cli:${I.name}`,kind:"cli",app:I})),...((t==null?void 0:t.presets)??[]).map(I=>({id:`mcp:${I.name}`,kind:"mcp",preset:I}))].filter(I=>o==="all"||I.kind===o).filter(I=>!D||GD(I).includes(D)).sort((I,Q)=>+!Fv(I)-+!Fv(Q)||Ov(I).localeCompare(Ov(Q))),Y=p?((e==null?void 0:e.apps)??[]).find(I=>I.name===p&&I.installed):null,oe=(n||r)&&!e&&!t,de=d||f||(Y?null:c||m),pe=!!(d||f),le=$("settings.apps.caption",{cli:(e==null?void 0:e.installed_count)??0,mcp:(t==null?void 0:t.installed_count)??0,defaultValue:"{{cli}} CLI · {{mcp}} MCP"});return s.jsxs("div",{className:"space-y-7",children:[s.jsxs("section",{className:"space-y-4",children:[s.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-end sm:justify-between",children:[s.jsx("p",{className:"max-w-[680px] text-[13px] leading-5 text-muted-foreground",children:W("settings.apps.description","Add local app adapters and connected tool servers that nanobot can use from chat.")}),s.jsx("span",{className:"text-[12px] font-medium text-muted-foreground",children:le})]}),s.jsxs("div",{className:"flex flex-col gap-3 lg:flex-row lg:items-center",children:[s.jsxs("div",{className:"relative flex-1",children:[s.jsx(Tt,{className:"pointer-events-none absolute left-4 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground","aria-hidden":!0}),s.jsx(Ye,{value:a,onChange:I=>g(I.target.value),placeholder:W("settings.apps.searchPlaceholder","Search Apps"),className:"h-12 rounded-[14px] border-border/70 bg-card/90 pl-11 text-[15px] shadow-sm"})]}),s.jsx(eo,{value:o,options:P,onChange:I=>w(I)})]})]}),de?s.jsxs("div",{className:j("flex items-center justify-between gap-3 rounded-[12px] border py-2.5 pl-4 pr-2 text-[13px]",pe?"border-destructive/20 bg-destructive/5 text-destructive":"border-border/55 bg-muted/35 text-muted-foreground"),children:[s.jsx("span",{className:"min-w-0",children:de}),s.jsx("button",{type:"button","aria-label":W("settings.actions.dismiss","Dismiss"),title:W("settings.actions.dismiss","Dismiss"),onClick:N,className:j("flex h-8 w-8 shrink-0 items-center justify-center rounded-full transition-colors",pe?"text-destructive/70 hover:bg-destructive/10 hover:text-destructive":"text-muted-foreground/70 hover:bg-muted hover:text-foreground"),children:s.jsx(xr,{className:"h-3.5 w-3.5","aria-hidden":!0})})]}):null,Y?s.jsx(JD,{app:Y,showBrandLogos:b,onBackToChat:S}):null,v?s.jsxs("div",{className:"flex flex-col gap-3 rounded-[12px] border border-amber-500/20 bg-amber-500/8 px-4 py-3 text-[12.5px] text-amber-800 dark:text-amber-200 sm:flex-row sm:items-center sm:justify-between",children:[s.jsx("span",{children:W("settings.mcp.restartRequired","Restart nanobot to connect updated MCP tools.")}),z?s.jsxs(fe,{type:"button",size:"sm",variant:"outline",onClick:z,disabled:K,className:"h-8 rounded-full bg-background/80 px-3 text-[12px] font-semibold",children:[K?s.jsx(pt,{className:"mr-1.5 h-3.5 w-3.5 animate-spin","aria-hidden":!0}):s.jsx(qi,{className:"mr-1.5 h-3.5 w-3.5","aria-hidden":!0}),$(K?"app.system.restarting":"app.system.restart")]}):null]}):null,s.jsxs("section",{children:[s.jsxs("div",{className:"flex items-center justify-between border-b border-border/45 pb-3",children:[s.jsx(Jt,{children:W("settings.apps.featured","Featured")}),s.jsx("span",{className:"rounded-full bg-muted px-2.5 py-1 text-[12px] font-medium text-muted-foreground",children:G.length})]}),oe?s.jsxs("div",{className:"flex h-36 items-center justify-center text-sm text-muted-foreground",children:[s.jsx(pt,{className:"mr-2 h-4 w-4 animate-spin","aria-hidden":!0}),W("settings.apps.loading","Loading Apps...")]}):G.length?s.jsx("div",{className:"grid gap-x-10 gap-y-1 py-3 md:grid-cols-2",children:G.map(I=>I.kind==="cli"?s.jsx(KD,{app:I.app,actionKey:i,showBrandLogos:b,onAction:k},I.id):s.jsx(VD,{preset:I.preset,values:h[I.preset.name]??{},actionKey:l,showBrandLogos:b,onFieldChange:A,onAction:C,onToolsChange:F},I.id))}):s.jsx("div",{className:"px-3 py-12 text-center text-sm text-muted-foreground",children:W("settings.apps.empty","No apps match this filter.")})]}),o!=="cli"?s.jsx(YD,{form:y,configImport:x,actionKey:l,onFormChange:E,onConfigImportChange:_,onSave:R,onImportConfig:T}):null,s.jsx(tC,{})]})}function KD({app:e,actionKey:t,showBrandLogos:n,onAction:r}){const{t:a}=ie(),o=(f,h)=>a(f,{defaultValue:h}),i=t===`install:${e.name}`,l=t===`update:${e.name}`,c=t===`uninstall:${e.name}`,d=t===`test:${e.name}`,p=i||l||c||d,m=e.description||e.requires||e.entry_point||e.name;return s.jsxs("article",{className:"group flex min-w-0 items-center gap-3 rounded-[14px] px-3 py-3 transition-colors hover:bg-muted/45",children:[s.jsx(eC,{app:e,showBrandLogos:n}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs("div",{className:"flex min-w-0 items-baseline gap-2",children:[s.jsx("h3",{className:"truncate text-[14px] font-semibold leading-5 text-foreground",children:e.display_name}),s.jsx(Z1,{children:o("settings.apps.cliLabel","CLI")})]}),s.jsx("p",{className:"mt-0.5 truncate text-[12.5px] leading-5 text-muted-foreground",children:m})]}),s.jsx("div",{className:"flex shrink-0 items-center gap-1",children:e.installed?s.jsxs(s.Fragment,{children:[s.jsxs(gn,{children:[s.jsx(vn,{asChild:!0,children:s.jsx(An,{ariaLabel:o("settings.cliApps.statusInstalled","CLI installed"),busy:d||l,disabled:p,tone:"installed",children:s.jsx(Et,{className:"h-4 w-4","aria-hidden":!0})})}),s.jsxs(ln,{align:"end",children:[s.jsxs(gt,{disabled:p,onClick:()=>r("test",e.name),children:[s.jsx(jc,{className:"mr-2 h-3.5 w-3.5","aria-hidden":!0}),o("settings.cliApps.test","Test CLI")]}),s.jsxs(gt,{disabled:p,onClick:()=>r("update",e.name),children:[s.jsx(qi,{className:"mr-2 h-3.5 w-3.5","aria-hidden":!0}),o("settings.cliApps.update","Update CLI")]}),s.jsxs(gt,{disabled:p,onClick:()=>r("uninstall",e.name),children:[s.jsx(ya,{className:"mr-2 h-3.5 w-3.5","aria-hidden":!0}),o("settings.cliApps.uninstall","Uninstall CLI")]})]})]}),s.jsx(An,{ariaLabel:o("settings.cliApps.uninstall","Uninstall CLI"),busy:c,disabled:p&&!c,tone:"danger",onClick:()=>r("uninstall",e.name),children:s.jsx(ya,{className:"h-4 w-4","aria-hidden":!0})})]}):e.install_supported?s.jsx(An,{ariaLabel:o("settings.cliApps.install","Install CLI"),busy:i,onClick:()=>r("install",e.name),children:s.jsx(ga,{className:"h-4 w-4","aria-hidden":!0})}):s.jsx(An,{ariaLabel:o("settings.cliApps.unavailable","Unavailable"),disabled:!0,children:s.jsx(ga,{className:"h-4 w-4","aria-hidden":!0})})})]})}function VD({preset:e,values:t,actionKey:n,showBrandLogos:r,onFieldChange:a,onAction:o,onToolsChange:i}){const{t:l}=ie(),c=(W,P)=>l(W,{defaultValue:P}),[d,p]=u.useState(!1),[m,f]=u.useState(!1),h=n===`enable:${e.name}`,y=n===`remove:${e.name}`,x=n===`test:${e.name}`,b=n===`tools:${e.name}`,v=h||y||x||b,g=e.required_fields.filter(W=>W.required&&!W.configured),w=e.required_fields.length>0,k=g.length>0,C=e.installed&&e.configured,N=e.install_supported&&(g.length===0||g.every(W=>{var P;return!!((P=t[W.name])!=null&&P.trim())})),S=e.tool_names??[],A=e.enabled_tools??["*"],E=A.includes("*"),_=new Set(E?S:A),R=e.description||e.note||e.requires||e.name,T=QD(e.status,c);u.useEffect(()=>{(e.configured||!e.install_supported)&&p(!1)},[e.configured,e.install_supported]);const F=()=>{if(k||e.installed&&!e.configured&&w){p(!0);return}o("enable",e.name,t)},z=()=>{N&&o("enable",e.name,t)},K=W=>i(e.name,W),$=W=>{const P=new Set(E?S:A);P.has(W)?P.delete(W):P.add(W);const D=Array.from(P);K(D.length===S.length?["*"]:D)};return s.jsxs("article",{className:"rounded-[14px] transition-colors hover:bg-muted/45",children:[s.jsxs("div",{className:"group flex min-w-0 items-center gap-3 px-3 py-3",children:[s.jsx(XD,{preset:e,showBrandLogos:r}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs("div",{className:"flex min-w-0 items-baseline gap-2",children:[s.jsx("h3",{className:"truncate text-[14px] font-semibold leading-5 text-foreground",children:e.display_name}),s.jsx(Z1,{children:c("settings.apps.mcpLabel","MCP")})]}),s.jsx("p",{className:"mt-0.5 truncate text-[12.5px] leading-5 text-muted-foreground",children:R})]}),s.jsx("div",{className:"flex shrink-0 items-center gap-1",children:C?s.jsxs(s.Fragment,{children:[s.jsxs(gn,{children:[s.jsx(vn,{asChild:!0,children:s.jsx(An,{ariaLabel:T,busy:x||b,disabled:v,tone:"installed",children:s.jsx(Et,{className:"h-4 w-4","aria-hidden":!0})})}),s.jsxs(ln,{align:"end",children:[s.jsxs(gt,{disabled:v,onClick:()=>o("test",e.name),children:[s.jsx(jc,{className:"mr-2 h-3.5 w-3.5","aria-hidden":!0}),c("settings.mcp.test","Test")]}),S.length?s.jsxs(gt,{disabled:v,onClick:()=>f(W=>!W),children:[s.jsx(sw,{className:"mr-2 h-3.5 w-3.5","aria-hidden":!0}),c("settings.mcp.toolScope","Tools")]}):null,s.jsxs(gt,{disabled:v,onClick:()=>o("remove",e.name),children:[s.jsx(ya,{className:"mr-2 h-3.5 w-3.5","aria-hidden":!0}),c("settings.mcp.remove","Remove")]})]})]}),s.jsx(An,{ariaLabel:c("settings.mcp.remove","Remove"),busy:y,disabled:v&&!y,tone:"danger",onClick:()=>o("remove",e.name),children:s.jsx(ya,{className:"h-4 w-4","aria-hidden":!0})})]}):e.installed&&!e.configured?s.jsx(An,{ariaLabel:w?c("settings.mcp.configure","Configure"):c("settings.mcp.enable","Enable"),busy:h,onClick:()=>{w?p(!0):o("enable",e.name,t)},children:s.jsx(ga,{className:"h-4 w-4","aria-hidden":!0})}):e.install_supported?s.jsx(An,{ariaLabel:k?c("settings.mcp.setup","Set up"):c("settings.mcp.enable","Enable"),busy:h,onClick:F,children:s.jsx(ga,{className:"h-4 w-4","aria-hidden":!0})}):s.jsx(An,{ariaLabel:c("settings.mcp.comingSoon","Coming soon"),disabled:!0,children:s.jsx(ga,{className:"h-4 w-4","aria-hidden":!0})})})]}),d&&e.install_supported&&w?s.jsxs("div",{className:"mx-3 mb-3 rounded-[14px] border border-border/45 bg-card/85 p-3 shadow-sm",children:[s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"truncate text-[12.5px] font-semibold text-foreground",children:l("settings.mcp.connectTitle",{name:e.display_name,defaultValue:"Connect {{name}}"})}),s.jsx("p",{className:"mt-0.5 text-[11.5px] text-muted-foreground",children:c("settings.mcp.connectHint","Add the key from your account settings.")})]}),s.jsx(fe,{type:"button",size:"sm",variant:"ghost",disabled:v,onClick:()=>p(!1),className:"h-7 rounded-full px-2.5 text-[11.5px] font-semibold text-muted-foreground",children:c("actions.cancel","Cancel")})]}),s.jsx("div",{className:"mt-3 grid gap-2",children:e.required_fields.map(W=>s.jsxs("label",{className:"min-w-0",children:[s.jsxs("span",{className:"mb-1 block text-[11.5px] font-medium text-muted-foreground",children:[W.label,W.configured?s.jsx("span",{className:"ml-1 font-normal text-emerald-600 dark:text-emerald-300",children:c("settings.mcp.configured","configured")}):null]}),s.jsx(Ye,{type:W.secret?"password":"text",value:t[W.name]??"",onChange:P=>a(e.name,W.name,P.target.value),placeholder:W.configured?c("settings.mcp.keepExisting","Leave blank to keep existing"):W.placeholder,className:"h-9 rounded-full bg-background/80 text-[12.5px]"})]},W.name))}),s.jsx("div",{className:"mt-3 flex justify-end",children:s.jsxs(fe,{type:"button",size:"sm",disabled:v||!N,onClick:z,className:"h-8 rounded-full px-3 text-[12px] font-semibold",children:[h?s.jsx(pt,{className:"mr-1.5 h-3.5 w-3.5 animate-spin","aria-hidden":!0}):s.jsx(Et,{className:"mr-1.5 h-3.5 w-3.5","aria-hidden":!0}),e.installed?c("settings.mcp.updateSetup","Update setup"):c("settings.mcp.saveAndEnable","Save and enable")]})})]}):null,m&&C&&S.length?s.jsxs("div",{className:"mx-3 mb-3 rounded-[14px] border border-border/45 bg-card/85 p-3 shadow-sm",children:[s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[s.jsx("div",{className:"text-[11.5px] font-medium text-muted-foreground",children:c("settings.mcp.toolScope","Tools")}),s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(fe,{type:"button",size:"sm",variant:E?"default":"outline",disabled:b,onClick:()=>K(["*"]),className:"h-7 rounded-full px-2.5 text-[11.5px] font-semibold",children:c("settings.mcp.allTools","All")}),s.jsx(fe,{type:"button",size:"sm",variant:!E&&_.size===0?"default":"outline",disabled:b,onClick:()=>K([]),className:"h-7 rounded-full px-2.5 text-[11.5px] font-semibold",children:c("settings.mcp.noTools","None")})]})]}),s.jsx("div",{className:"mt-2 flex flex-wrap gap-1.5",children:S.map(W=>{const P=_.has(W);return s.jsx("button",{type:"button",disabled:b,onClick:()=>$(W),className:j("max-w-full rounded-full border px-2.5 py-1 font-mono text-[11px] transition-colors",P?"border-blue-500/25 bg-blue-500/10 text-blue-700 dark:text-blue-300":"border-border/55 bg-muted/30 text-muted-foreground hover:bg-muted/60"),children:s.jsx("span",{className:"block max-w-[220px] truncate",children:W})},W)})})]}):null]})}function Z1({children:e}){return s.jsx("span",{className:"shrink-0 rounded-full bg-muted px-1.5 py-0.5 text-[10px] font-semibold uppercase leading-none tracking-[0.06em] text-muted-foreground",children:e})}const An=u.forwardRef(function({ariaLabel:t,busy:n,disabled:r,tone:a="default",onClick:o,children:i},l){return s.jsx(fe,{ref:l,type:"button",size:"icon",variant:"ghost","aria-label":t,title:t,disabled:r||n,onClick:o,className:j("h-9 w-9 rounded-full text-muted-foreground transition-colors",a==="installed"&&"bg-transparent hover:bg-muted/70 hover:text-foreground",a==="danger"&&"bg-transparent hover:bg-destructive/10 hover:text-destructive",a==="default"&&"bg-muted/70 hover:bg-muted hover:text-foreground"),children:n?s.jsx(pt,{className:"h-4 w-4 animate-spin","aria-hidden":!0}):i})});function Ov(e){return e.kind==="cli"?e.app.display_name:e.preset.display_name}function Fv(e){return e.kind==="cli"?e.app.installed:e.preset.installed&&e.preset.configured}function GD(e){if(e.kind==="cli"){const n=e.app;return[n.display_name,n.name,n.category,n.description,n.requires,n.entry_point,n.source].join(" ").toLowerCase()}const t=e.preset;return[t.display_name,t.name,t.category,t.description,t.requires,t.note,t.transport,t.source??""].join(" ").toLowerCase()}function YD({form:e,configImport:t,actionKey:n,onFormChange:r,onConfigImportChange:a,onSave:o,onImportConfig:i}){const{t:l}=ie(),c=(w,k)=>l(w,{defaultValue:k}),[d,p]=u.useState(null),[m,f]=u.useState(!1),h=(n==null?void 0:n.startsWith("custom:"))??!1,y=n==="import"||n==="import-cursor",x=e.transport!=="stdio",b=!!e.name.trim()&&(x?!!e.url.trim():!!e.command.trim()),v=(w,k)=>{r(C=>({...C,[w]:k}))},g=[{value:"stdio",label:"stdio"},{value:"streamableHttp",label:"HTTP"},{value:"sse",label:"SSE"}];return s.jsxs("section",{className:"overflow-hidden rounded-[16px] border border-border/45 bg-card/72 shadow-[0_10px_30px_rgba(15,23,42,0.045)]",children:[s.jsxs("div",{className:"flex flex-col gap-3 px-3 py-3 sm:flex-row sm:items-center sm:justify-between",children:[s.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[s.jsx("span",{className:"grid h-9 w-9 shrink-0 place-items-center rounded-[11px] bg-muted text-muted-foreground",children:s.jsx(ts,{className:"h-4 w-4","aria-hidden":!0})}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("h3",{className:"text-[13px] font-semibold leading-5 text-foreground",children:c("settings.mcp.moreOptions","More MCP options")}),s.jsx("p",{className:"truncate text-[12px] text-muted-foreground",children:c("settings.mcp.moreOptionsSubtitle","Add a custom server or import mcp.json.")})]})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-2 sm:flex sm:shrink-0",children:[s.jsxs(fe,{type:"button",size:"sm",variant:d==="custom"?"default":"outline",onClick:()=>p(w=>w==="custom"?null:"custom"),className:"h-8 rounded-full px-3 text-[12px] font-semibold",children:[s.jsx(ts,{className:"mr-1.5 h-3.5 w-3.5","aria-hidden":!0}),c("settings.mcp.customAction","Custom")]}),s.jsxs(fe,{type:"button",size:"sm",variant:d==="import"?"default":"outline",onClick:()=>p(w=>w==="import"?null:"import"),className:"h-8 rounded-full px-3 text-[12px] font-semibold",children:[s.jsx(Ac,{className:"mr-1.5 h-3.5 w-3.5","aria-hidden":!0}),c("settings.mcp.importAction","Import")]})]})]}),d==="custom"?s.jsxs("div",{className:"border-t border-border/35 bg-muted/18 px-3 py-3",children:[s.jsxs("div",{className:"flex flex-col gap-3 lg:flex-row lg:items-end",children:[s.jsxs("label",{className:"min-w-0 flex-1",children:[s.jsx("span",{className:"mb-1.5 block text-[11.5px] font-medium text-muted-foreground",children:c("settings.mcp.serverName","Server name")}),s.jsx(Ye,{value:e.name,onChange:w=>v("name",w.target.value),placeholder:"docs",className:"h-9 rounded-full bg-background/80 text-[12.5px]"})]}),s.jsxs("div",{className:"min-w-[228px]",children:[s.jsx("span",{className:"mb-1.5 block text-[11.5px] font-medium text-muted-foreground",children:c("settings.mcp.transport","Transport")}),s.jsx(eo,{value:e.transport,options:g,onChange:w=>v("transport",w)})]}),x?s.jsxs("label",{className:"min-w-0 flex-[1.4]",children:[s.jsx("span",{className:"mb-1.5 block text-[11.5px] font-medium text-muted-foreground",children:c("settings.mcp.serverUrl","URL")}),s.jsx(Ye,{value:e.url,onChange:w=>v("url",w.target.value),placeholder:e.transport==="sse"?"https://example.com/sse":"https://example.com/mcp",className:"h-9 rounded-full bg-background/80 text-[12.5px]"})]}):s.jsxs("label",{className:"min-w-0 flex-[1.4]",children:[s.jsx("span",{className:"mb-1.5 block text-[11.5px] font-medium text-muted-foreground",children:c("settings.mcp.command","Command")}),s.jsx(Ye,{value:e.command,onChange:w=>v("command",w.target.value),placeholder:"npx",className:"h-9 rounded-full bg-background/80 text-[12.5px]"})]}),s.jsxs(fe,{type:"button",size:"sm",onClick:o,disabled:!b||h,className:"h-9 shrink-0 rounded-full px-4 text-[12.5px] font-semibold",children:[h?s.jsx(pt,{className:"mr-1.5 h-3.5 w-3.5 animate-spin","aria-hidden":!0}):s.jsx(Et,{className:"mr-1.5 h-3.5 w-3.5","aria-hidden":!0}),c("settings.mcp.saveCustom","Save MCP")]})]}),s.jsxs(fe,{type:"button",size:"sm",variant:"ghost",onClick:()=>f(w=>!w),className:"mt-2 h-8 rounded-full px-2 text-[12px] font-medium text-muted-foreground hover:text-foreground",children:[s.jsx(yr,{className:j("mr-1.5 h-3.5 w-3.5 transition-transform",m?"rotate-180":""),"aria-hidden":!0}),m?c("settings.mcp.hideAdvanced","Hide advanced"):c("settings.mcp.advancedOptions","Advanced options")]}),m?s.jsxs("div",{className:"mt-2 grid gap-2 lg:grid-cols-[minmax(0,1.2fr)_minmax(0,1fr)_180px]",children:[x?s.jsxs("label",{className:"min-w-0",children:[s.jsx("span",{className:"mb-1 block text-[11.5px] font-medium text-muted-foreground",children:c("settings.mcp.headers","Headers JSON")}),s.jsx(Ro,{value:e.headers,onChange:w=>v("headers",w.target.value),placeholder:'{"Authorization":"Bearer ..."}',className:"min-h-[68px] resize-y rounded-[12px] bg-background/80 font-mono text-[12px]"})]}):s.jsxs("label",{className:"min-w-0",children:[s.jsx("span",{className:"mb-1 block text-[11.5px] font-medium text-muted-foreground",children:c("settings.mcp.args","Args JSON")}),s.jsx(Ro,{value:e.args,onChange:w=>v("args",w.target.value),placeholder:'["-y", "docs-mcp"]',className:"min-h-[68px] resize-y rounded-[12px] bg-background/80 font-mono text-[12px]"})]}),s.jsxs("label",{className:"min-w-0",children:[s.jsx("span",{className:"mb-1 block text-[11.5px] font-medium text-muted-foreground",children:c("settings.mcp.env","Env JSON")}),s.jsx(Ro,{value:e.env,onChange:w=>v("env",w.target.value),placeholder:'{"API_KEY":"..."}',className:"min-h-[68px] resize-y rounded-[12px] bg-background/80 font-mono text-[12px]"})]}),s.jsxs("label",{className:"min-w-0",children:[s.jsx("span",{className:"mb-1 block text-[11.5px] font-medium text-muted-foreground",children:c("settings.mcp.timeout","Tool timeout")}),s.jsx(Ye,{value:e.toolTimeout,onChange:w=>v("toolTimeout",w.target.value),inputMode:"numeric",className:"h-9 rounded-full bg-background/80 text-[12.5px]"})]})]}):null]}):null,d==="import"?s.jsx("div",{className:"border-t border-border/35 bg-muted/18 px-3 py-3",children:s.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row lg:items-end",children:[s.jsxs("label",{className:"min-w-0 flex-1",children:[s.jsx("span",{className:"mb-1.5 block text-[11.5px] font-medium text-muted-foreground",children:c("settings.mcp.configImport","Import mcp.json")}),s.jsx(Ro,{value:t,onChange:w=>a(w.target.value),placeholder:'{"mcpServers":{"docs":{"command":"npx","args":["-y","docs-mcp"]}}}',className:"min-h-[84px] resize-y rounded-[12px] bg-background/80 font-mono text-[12px]"})]}),s.jsxs(fe,{type:"button",size:"sm",onClick:i,disabled:!t.trim()||y,className:"h-9 shrink-0 rounded-full px-4 text-[12.5px] font-semibold",children:[y?s.jsx(pt,{className:"mr-1.5 h-3.5 w-3.5 animate-spin","aria-hidden":!0}):s.jsx(Ac,{className:"mr-1.5 h-3.5 w-3.5","aria-hidden":!0}),c("settings.mcp.importConfig","Import")]})]})}):null]})}function QD(e,t){switch(e){case"configured":return t("settings.mcp.statusConfigured","Configured");case"missing_credentials":return t("settings.mcp.statusMissingCredentials","Needs key");case"missing_dependency":return t("settings.mcp.statusMissingDependency","Needs dependency");case"coming_soon":return t("settings.mcp.statusComingSoon","Coming soon");default:return t("settings.mcp.statusNotInstalled","Not enabled")}}function XD({preset:e,showBrandLogos:t}){const[n,r]=u.useState(0),a=e.brand_color||"hsl(var(--muted))",i=u.useMemo(()=>oo(e.logo_url),[e.logo_url])[n],l=e.display_name.split(/\s+/).filter(Boolean).slice(0,2).map(c=>{var d;return(d=c[0])==null?void 0:d.toUpperCase()}).join("")||e.name.slice(0,2).toUpperCase();return u.useEffect(()=>r(0),[e.logo_url]),t&&i?s.jsx("span",{className:"grid h-11 w-11 shrink-0 place-items-center rounded-[8px] border border-border/45 bg-background",style:{boxShadow:`inset 0 0 0 1px ${e.brand_color??"transparent"}22`},children:s.jsx("img",{src:i,alt:"",className:"h-6 w-6 object-contain",onError:()=>r(c=>c+1)})}):s.jsx("span",{className:"grid h-11 w-11 shrink-0 place-items-center rounded-[8px] text-[13px] font-semibold text-white",style:{backgroundColor:a},children:l})}function JD({app:e,showBrandLogos:t,onBackToChat:n}){const{t:r}=ie(),[a,o]=u.useState(!1),i=r("settings.cliApps.readyPrompt",{name:e.name,defaultValue:"Use @{{name}} to inspect what this CLI can do."}),l=()=>{navigator.clipboard&&navigator.clipboard.writeText(i).then(()=>{o(!0),window.setTimeout(()=>o(!1),1400)})};return s.jsx("section",{className:j("rounded-[12px] border border-border/55 bg-card/88 px-4 py-3","shadow-[0_8px_26px_rgba(15,23,42,0.055)]"),children:s.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center",children:[s.jsx(eC,{app:e,showBrandLogos:t}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[s.jsx("h3",{className:"truncate text-[14px] font-semibold leading-5 text-foreground",children:e.display_name}),s.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1 rounded-full bg-muted px-2 py-0.5 text-[10.5px] font-medium text-muted-foreground",children:[s.jsx(Et,{className:"h-3 w-3 text-emerald-600 dark:text-emerald-300","aria-hidden":!0}),r("settings.cliApps.readyStatus",{defaultValue:"Ready"})]})]}),s.jsxs("div",{className:"mt-0.5 flex min-w-0 flex-wrap items-center gap-1.5 text-[12px] text-muted-foreground",children:[s.jsxs("span",{className:"font-mono",children:["@",e.name]}),s.jsx("span",{"aria-hidden":!0,children:"·"}),s.jsx("span",{className:"truncate font-mono",children:e.entry_point||e.name}),s.jsx("span",{"aria-hidden":!0,children:"·"}),s.jsx("span",{children:e.category})]})]}),s.jsxs("div",{className:"flex shrink-0 flex-wrap gap-2",children:[s.jsxs(fe,{type:"button",size:"sm",variant:"ghost",onClick:l,className:"h-8 rounded-full px-3 text-[12px] font-medium text-muted-foreground hover:bg-muted/65 hover:text-foreground",children:[a?s.jsx(Et,{className:"mr-1.5 h-3.5 w-3.5","aria-hidden":!0}):null,a?r("settings.cliApps.readyCopied",{defaultValue:"Copied"}):r("settings.cliApps.readyTry",{name:e.name,defaultValue:"Try @{{name}}"})]}),s.jsxs(fe,{type:"button",size:"sm",onClick:n,className:"h-8 rounded-full px-3 text-[12px] font-semibold",children:[r("settings.cliApps.openChat",{defaultValue:"Open chat"}),s.jsx(Wr,{className:"ml-1.5 h-3.5 w-3.5","aria-hidden":!0})]})]})]})})}function eC({app:e,showBrandLogos:t}){const[n,r]=u.useState(0),a=e.brand_color||"hsl(var(--muted))",i=u.useMemo(()=>oo(e.logo_url),[e.logo_url])[n],l=e.display_name.split(/\s+/).filter(Boolean).slice(0,2).map(c=>{var d;return(d=c[0])==null?void 0:d.toUpperCase()}).join("")||e.name.slice(0,2).toUpperCase();return u.useEffect(()=>r(0),[e.logo_url]),t&&i?s.jsx("span",{className:"grid h-11 w-11 shrink-0 place-items-center rounded-[8px] border border-border/45 bg-background",style:{boxShadow:`inset 0 0 0 1px ${e.brand_color??"transparent"}22`},children:s.jsx("img",{src:i,alt:"",className:"h-6 w-6 object-contain",onError:()=>r(c=>c+1)})}):s.jsx("span",{className:"grid h-11 w-11 shrink-0 place-items-center rounded-[8px] text-[13px] font-semibold text-white",style:{backgroundColor:a},children:l})}function ZD({form:e,setForm:t,settings:n,dirty:r,saving:a,onSave:o,onRestart:i,isRestarting:l,requiresRestartPending:c}){var S,A,E;const{t:d}=ie(),p=(_,R)=>d(_,{defaultValue:R}),m=Ja()!==null||(n.surface??n.runtime_surface)==="native",f=m?p("app.system.restartEngine","Restart engine"):d("app.system.restart"),h=m?p("app.system.restartingEngine","Restarting engine..."):d("app.system.restarting"),[y,x]=u.useState(null),[b,v]=u.useState(null),[g,w]=u.useState(null),k=Ja(),C=l?p("settings.values.restartingEngine","Restarting"):((S=n.apply_state)==null?void 0:S.status)==="pending"?p("settings.values.pending","Pending"):p("settings.values.ready","Ready"),N=async(_,R,T,F)=>{if(!k){v({target:_,message:p("settings.status.hostApiUnavailable","Host actions are only available inside the native app.")});return}w(_),v(null);try{const z=await R();v({target:_,message:T(z)})}catch{v({target:_,message:F})}finally{w(null)}};return s.jsxs("div",{className:"space-y-7",children:[s.jsxs("section",{children:[s.jsx(Jt,{children:p("settings.sections.identity","Identity")}),s.jsxs(Ht,{children:[s.jsx(Oe,{title:p("settings.rows.botName","Bot name"),description:p("settings.help.botName","Shown wherever nanobot uses a display name."),children:s.jsx(Ye,{value:e.botName,onChange:_=>t(R=>({...R,botName:_.target.value})),className:"h-8 w-[220px] rounded-full text-[13px]"})}),s.jsx(Oe,{title:p("settings.rows.botIcon","Bot icon"),description:p("settings.help.botIcon","Short emoji or text shown with the bot name."),children:s.jsx(Ye,{value:e.botIcon,onChange:_=>t(R=>({...R,botIcon:_.target.value})),className:"h-8 w-[120px] rounded-full text-center text-[13px]"})}),s.jsx(Oe,{title:p("settings.rows.timezone","Timezone"),description:p("settings.help.timezone","Used for schedules and time-aware replies."),children:s.jsx(t4,{value:e.timezone,onChange:_=>t(R=>({...R,timezone:_}))})}),s.jsx(ol,{dirty:r,saving:a,pendingRestart:c,dirtyMessage:m?p("settings.status.hostRestartAfterSaving","Save changes and nanobot will restart its engine."):p("settings.status.restartAfterSaving","Save changes, then restart when ready."),pendingMessage:m?p("settings.status.hostRestartPending","Saved. Restarting engine when ready."):p("settings.status.savedRestartApply","Saved. Restart when ready."),onSave:o,onRestart:i,isRestarting:l})]})]}),m?s.jsxs("section",{children:[s.jsx(Jt,{children:p("settings.sections.nativeHost","Native host")}),s.jsxs(Ht,{children:[s.jsx(Ks,{title:p("settings.rows.engine","Engine"),value:C}),(A=n.runtime_capabilities)!=null&&A.can_open_logs?s.jsx(Oe,{title:p("settings.rows.logs","Logs"),description:(b==null?void 0:b.target)==="logs"?b.message:p("settings.help.logs","Open the native engine log folder."),children:s.jsx(fe,{size:"sm",variant:"outline",onClick:()=>void N("logs",()=>k.openLogs(),()=>p("settings.status.logsOpened","Opened logs folder."),p("settings.status.logsOpenFailed","Could not open logs folder.")),disabled:g!==null,className:"rounded-full",children:g==="logs"?p("settings.actions.opening","Opening..."):p("settings.actions.open","Open")})}):null,(E=n.runtime_capabilities)!=null&&E.can_export_diagnostics?s.jsx(Oe,{title:p("settings.rows.diagnostics","Diagnostics"),description:(b==null?void 0:b.target)==="diagnostics"?b.message:y||p("settings.help.diagnostics","Export a small runtime report for support."),children:s.jsx(fe,{size:"sm",variant:"outline",onClick:()=>void N("diagnostics",async()=>{const _=await k.exportDiagnostics();return x(_),_},_=>d("settings.status.diagnosticsExported",{path:String(_??""),defaultValue:"Diagnostics exported to {{path}}."}),p("settings.status.diagnosticsExportFailed","Could not export diagnostics.")),disabled:g!==null,className:"rounded-full",children:g==="diagnostics"?p("settings.actions.exporting","Exporting..."):p("settings.actions.export","Export")})}):null]})]}):null,s.jsxs("section",{children:[s.jsx(Jt,{children:d("settings.sections.system")}),s.jsxs(Ht,{children:[m?null:s.jsx(Ks,{title:p("settings.rows.gateway","Gateway"),value:`${n.runtime.gateway_host}:${n.runtime.gateway_port}`}),s.jsx(Ks,{title:d("settings.rows.configPath"),value:n.runtime.config_path}),s.jsx(Ks,{title:p("settings.rows.workspacePath","Default workspace"),value:n.runtime.workspace_path}),i&&!c?s.jsx(Oe,{title:d("settings.rows.restart"),description:d("app.system.restartHint"),children:s.jsxs(fe,{size:"sm",variant:"outline",onClick:i,disabled:l,className:"rounded-full",children:[l?s.jsx(pt,{className:"mr-1.5 h-3.5 w-3.5 animate-spin","aria-hidden":!0}):s.jsx(qi,{className:"mr-1.5 h-3.5 w-3.5","aria-hidden":!0}),l?h:f]})}):null]})]})]})}function e4({form:e,dirty:t,saving:n,requiresRestartPending:r,isNativeHostSurface:a,onChangeForm:o,onSave:i,onRestart:l,isRestarting:c}){const{t:d}=ie(),p=(m,f)=>d(m,{defaultValue:f});return s.jsxs("div",{className:"space-y-7",children:[s.jsxs("section",{children:[s.jsx(Jt,{children:a?p("settings.sections.hostSafety","App safety"):p("settings.sections.webuiSafety","Web safety")}),s.jsxs(Ht,{children:[s.jsx(Oe,{title:p("settings.rows.localServiceAccess","Local Service Access"),description:p(a?"settings.help.localServiceAccessNative":"settings.help.localServiceAccess",a?"Allow Full Access shell commands to reach services on this Mac.":"Allow Full Access shell commands to reach localhost services."),children:s.jsx(is,{checked:e.webuiAllowLocalServiceAccess,onChange:m=>o(f=>({...f,webuiAllowLocalServiceAccess:m})),ariaLabel:p("settings.rows.localServiceAccess","Local Service Access"),label:e.webuiAllowLocalServiceAccess?p("settings.values.on","On"):p("settings.values.off","Off")})}),s.jsx(Oe,{title:p("settings.rows.webuiDefaultAccess","Default access"),description:p(a?"settings.help.webuiDefaultAccessNative":"settings.help.webuiDefaultAccess",a?"Used by native chats without a project-specific permission.":"Used by web chats without a project-specific permission."),children:s.jsx(eo,{value:e.webuiDefaultAccessMode,options:[{value:"default",label:p("settings.values.defaultPermission","Default Permission")},{value:"full",label:p("settings.values.fullAccess","Full Access")}],onChange:m=>o(f=>({...f,webuiDefaultAccessMode:m}))})}),s.jsx(ol,{dirty:t,saving:n,pendingRestart:r,onSave:i,onRestart:l,isRestarting:c})]})]}),s.jsx("p",{className:"max-w-3xl px-1 text-sm leading-6 text-muted-foreground",children:p("settings.help.securityManagedControls","Web fetches always protect local, private, and metadata services. Core channel safety stays in config.json.")})]})}function t4({value:e,onChange:t}){const{t:n}=ie(),r=(c,d)=>n(c,{defaultValue:d}),[a,o]=u.useState(""),i=u.useMemo(()=>l4(e),[e]),l=u.useMemo(()=>u4(i,a),[i,a]);return s.jsxs(gn,{onOpenChange:c=>!c&&o(""),children:[s.jsx(vn,{asChild:!0,children:s.jsxs(fe,{type:"button",variant:"outline",className:j("h-8 w-[220px] justify-between rounded-full border-input bg-background px-3 text-[13px] font-normal shadow-none","hover:bg-accent/55 focus-visible:ring-2 focus-visible:ring-ring"),children:[s.jsx("span",{className:"truncate",children:e||r("settings.timezone.select","Select timezone")}),s.jsx(yr,{className:"ml-2 h-3.5 w-3.5 shrink-0 text-muted-foreground","aria-hidden":!0})]})}),s.jsxs(ln,{align:"end",className:"w-[340px] max-w-[calc(100vw-2rem)]",children:[s.jsx("div",{className:"sticky top-0 z-10 bg-popover px-1 pb-1",children:s.jsxs("div",{className:"flex h-9 items-center gap-2 rounded-full border border-input bg-background px-3",children:[s.jsx(Tt,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground","aria-hidden":!0}),s.jsx(Ye,{autoFocus:!0,value:a,onChange:c=>o(c.target.value),onKeyDown:c=>c.stopPropagation(),placeholder:r("settings.timezone.search","Search timezone"),className:"h-7 border-0 bg-transparent px-0 text-[13px] shadow-none focus-visible:ring-0"})]})}),s.jsx("div",{className:"mt-1 max-h-[18rem] overflow-y-auto pr-0.5 scrollbar-thin scrollbar-track-transparent","data-testid":"timezone-picker-list",children:l.length?l.map(c=>{const d=c.name===e;return s.jsxs(gt,{onSelect:()=>t(c.name),className:j("flex h-9 cursor-default items-center justify-between gap-3 rounded-[12px] px-2.5 text-[13px]","focus:bg-muted/85 focus:text-foreground",d&&"bg-muted/80 text-foreground focus:bg-muted"),children:[s.jsx("span",{className:"min-w-0 truncate font-medium text-foreground",children:c.name}),s.jsxs("span",{className:"ml-auto flex shrink-0 items-center gap-2",children:[s.jsx("span",{className:"text-[11.5px] font-medium text-muted-foreground/80",children:c.offset}),d?s.jsx(Et,{className:"h-3.5 w-3.5 shrink-0","aria-hidden":!0}):null]})]},c.name)}):s.jsx("div",{className:"px-3 py-5 text-center text-[12px] text-muted-foreground",children:r("settings.timezone.empty","No matching timezones.")})})]})]})}function Ua({providers:e,value:t,emptyLabel:n,showProviderLogos:r=!1,onChange:a}){const o=e.find(l=>l.name===t)??null,i=e.length===0;return s.jsxs(gn,{modal:!1,children:[s.jsx(vn,{asChild:!0,disabled:i,children:s.jsxs(fe,{type:"button",variant:"outline",disabled:i,className:j("h-8 w-[210px] justify-between rounded-full border-input bg-background px-3 text-[13px] font-normal shadow-none","hover:bg-accent/55 focus-visible:ring-2 focus-visible:ring-ring",i&&"text-muted-foreground"),children:[s.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[o&&r?s.jsx(Fi,{provider:o.name,showBrandLogos:r}):null,s.jsx("span",{className:"truncate",children:(o==null?void 0:o.label)??n})]}),s.jsx(yr,{className:"ml-2 h-3.5 w-3.5 shrink-0 text-muted-foreground","aria-hidden":!0})]})}),s.jsx(ln,{align:"end",className:"max-h-[18rem] w-[240px] overflow-y-auto scrollbar-thin scrollbar-track-transparent",children:e.map(l=>{const c=l.name===t;return s.jsxs(gt,{onSelect:()=>a(l.name),className:j("flex cursor-default items-center justify-between gap-2 rounded-[12px] px-2.5 py-2 text-[13px]","focus:bg-muted/85 focus:text-foreground",c&&"bg-muted/80 text-foreground focus:bg-muted"),children:[s.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[r?s.jsx(Fi,{provider:l.name,showBrandLogos:r}):null,s.jsx("span",{className:"truncate",children:l.label})]}),c?s.jsx(Et,{className:"h-3.5 w-3.5 shrink-0","aria-hidden":!0}):null]},l.name)})})]})}function n4({token:e,settings:t,provider:n,value:r,showProviderLogos:a,onChange:o}){const{t:i}=ie(),l=(I,Q)=>i(I,{defaultValue:Q}),[c,d]=u.useState(!1),[p,m]=u.useState(""),[f,h]=u.useState(null),[y,x]=u.useState(!1),[b,v]=u.useState(null),g=n==="auto"?t.agent.resolved_provider??n:n,w=!!(g&&g!=="auto"),k=dm(t,g),C=Mu(t,g),N=w&&!C,S=w&&C&&(k==null?void 0:k.auth_type)==="oauth",A=w&&C&&!S,E=p.trim().toLowerCase(),_=(f==null?void 0:f.models)??[],R=_.filter(I=>E?[I.id,I.label??"",I.owned_by??""].some(Q=>Q.toLowerCase().includes(E)):!0).slice(0,80),T=(f==null?void 0:f.catalog_kind)==="catalog",F=K3.has(g),z=E.length>=V3,K=A&&(!F||z),$=c&&A&&F&&!z,P=!!((f==null?void 0:f.status)==="available"&&f&&(!T||E)),D=p.trim(),G=!N,Y=_.some(I=>I.id===D),oe=(f==null?void 0:f.model_count)??_.length,de=!r.trim()||!C;u.useEffect(()=>{c&&m(S||!w?r:"")},[c,g,w,S,r]),u.useEffect(()=>{if(!c||!K){h(null),v(null),x(!1);return}let I=!1;return h(null),v(null),x(!0),PL(e,g).then(Q=>{I||h(Q)}).catch(Q=>{I||v(Q.message)}).finally(()=>{I||x(!1)}),()=>{I=!0}},[g,c,K,e]);const pe=I=>{o(I),d(!1)},le=(I,Q={})=>s.jsxs(gt,{onSelect:()=>pe(I.id),className:j("flex cursor-default items-center justify-between gap-2 rounded-[12px] px-2 py-1.5 text-[12px]","focus:bg-muted/85 focus:text-foreground",Q.selected&&"bg-muted/80 text-foreground focus:bg-muted"),children:[s.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[s.jsx(Fi,{provider:g,showBrandLogos:a,unconfigured:!C}),s.jsx("span",{className:"min-w-0 truncate font-medium text-foreground",children:I.label??I.id})]}),s.jsxs("span",{className:"ml-2 flex shrink-0 items-center gap-2 text-[11px] text-muted-foreground",children:[I.context_window?s.jsx("span",{children:r4(I.context_window)}):null,Q.selected?s.jsx(Et,{className:"h-3.5 w-3.5 text-foreground","aria-hidden":!0}):null]})]},I.id);return s.jsxs(gn,{open:c,onOpenChange:d,children:[s.jsx(vn,{asChild:!0,children:s.jsxs(fe,{type:"button",variant:"outline",className:j("h-9 w-[min(360px,70vw)] justify-between rounded-full border-input bg-background px-3 text-[12px] font-normal shadow-none","hover:bg-accent/55 focus-visible:ring-2 focus-visible:ring-ring"),children:[s.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[s.jsx(Fi,{provider:g,showBrandLogos:a,unconfigured:de}),s.jsx("span",{className:j("min-w-0 truncate font-medium",r?"text-foreground":"text-muted-foreground"),children:r||l("settings.models.selectModel","Select model")})]}),s.jsx(yr,{className:"ml-2 h-3.5 w-3.5 shrink-0 text-muted-foreground","aria-hidden":!0})]})}),s.jsxs(ln,{align:"end",className:"w-[360px] max-w-[calc(100vw-2rem)] p-1.5",children:[s.jsx("div",{className:"p-1 pb-1.5",children:s.jsxs("div",{className:"relative",children:[s.jsx(Tt,{className:"pointer-events-none absolute left-3 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground","aria-hidden":!0}),s.jsx(Ye,{value:p,onChange:I=>m(I.target.value),onKeyDown:I=>I.stopPropagation(),placeholder:l("settings.models.searchModels","Search or type model ID"),className:"h-8 rounded-full pl-8 pr-3 text-[12px]"})]})}),N?s.jsx("div",{className:"px-2 py-1.5 text-[11px] leading-4 text-muted-foreground",children:l("settings.models.providerNotConfigured","Configure this provider before loading models.")}):S?s.jsx("div",{className:"px-2 py-1.5 text-[11px] leading-4 text-muted-foreground",children:l("settings.models.unsupportedModelList","Type a model ID manually.")}):A?$?s.jsx("div",{className:"px-2 py-1.5 text-[11px] leading-4 text-muted-foreground",children:l("settings.models.searchCatalog","Search provider catalog to choose a model.")}):y?s.jsxs("div",{className:"flex items-center gap-2 px-2 py-1.5 text-[11px] text-muted-foreground",children:[s.jsx(pt,{className:"h-3.5 w-3.5 animate-spin","aria-hidden":!0}),l("settings.models.loadingModels","Loading models...")]}):b||(f==null?void 0:f.status)==="error"?s.jsx("div",{className:"px-2 py-1.5 text-[11px] leading-4 text-muted-foreground",children:(f==null?void 0:f.message)||b||l("settings.models.loadFailed","Model list unavailable.")}):(f==null?void 0:f.status)==="not_configured"?s.jsx("div",{className:"px-2 py-1.5 text-[11px] leading-4 text-muted-foreground",children:l("settings.models.providerNotConfigured","Configure this provider before loading models.")}):(f==null?void 0:f.status)==="unsupported"||(f==null?void 0:f.status)==="missing_api_base"?s.jsx("div",{className:"px-2 py-1.5 text-[11px] leading-4 text-muted-foreground",children:f.message||l("settings.models.unsupportedModelList","Type a model ID manually.")}):T&&!E?s.jsxs("div",{className:"px-2 py-1.5 text-[11px] leading-4 text-muted-foreground",children:[l("settings.models.searchCatalog","Search provider catalog to choose a model."),oe?` ${oe} ${l("settings.models.modelsAvailable","available")}.`:""]}):null:s.jsx("div",{className:"px-2 py-1.5 text-[11px] leading-4 text-muted-foreground",children:l("settings.models.autoProviderCustomOnly","Auto provider mode uses custom model IDs.")}),P&&R.length?s.jsx("div",{className:"max-h-[16rem] overflow-y-auto pr-0.5 scrollbar-thin scrollbar-track-transparent",children:R.map(I=>le(I,{selected:I.id===r}))}):P?s.jsx("div",{className:"px-2 py-1.5 text-[11px] text-muted-foreground",children:l("settings.models.noModelResults","No matching models.")}):null,G&&D&&!Y&&D!==r?s.jsxs(s.Fragment,{children:[P?s.jsx(Hf,{}):null,s.jsxs(gt,{onSelect:()=>pe(D),className:"flex cursor-default items-center gap-2 rounded-[12px] px-2 py-1.5 text-[12px] focus:bg-muted/85",children:[s.jsx("span",{className:"grid h-5 w-5 shrink-0 place-items-center rounded-md bg-muted/80 text-muted-foreground",children:s.jsx(fs,{className:"h-3 w-3","aria-hidden":!0})}),s.jsxs("span",{className:"min-w-0 truncate",children:[l("settings.models.useCustomModel","Use")," ",s.jsxs("span",{className:"font-medium text-foreground",children:["“",D,"”"]})]})]})]}):null]})]})}function r4(e){if(e>=1e6){const t=e/1e6;return`${Number.isInteger(t)?t.toFixed(0):t.toFixed(1)}M`}if(e>=1e3){const t=e/1e3;return`${Number.isInteger(t)?t.toFixed(0):t.toFixed(1)}K`}return String(e)}function Fi({provider:e,showBrandLogos:t,unconfigured:n=!1}){const[r,a]=u.useState(0),o=al(e),i=nC[e]??hf,l=o==null?void 0:o.logoUrls[r];return u.useEffect(()=>a(0),[e]),n?s.jsx("span",{"data-testid":"provider-picker-unconfigured-icon",className:"grid h-5 w-5 shrink-0 place-items-center text-amber-700 dark:text-amber-200","aria-hidden":!0,children:s.jsx(ja,{className:"h-4 w-4",strokeWidth:1.8})}):t&&l?s.jsx("span",{"data-testid":`provider-picker-logo-${e}`,className:"grid h-5 w-5 shrink-0 place-items-center overflow-hidden rounded-md border border-border/35 bg-background shadow-[inset_0_0_0_1px_rgba(0,0,0,0.02)]",style:{boxShadow:`inset 0 0 0 1px ${o.color}22`},"aria-hidden":!0,children:s.jsx("img",{src:l,alt:"",className:"h-3.5 w-3.5 object-contain",onError:()=>a(c=>c+1)})}):t&&o?s.jsx("span",{"data-testid":`provider-picker-logo-fallback-${e}`,className:"grid h-5 w-5 shrink-0 place-items-center rounded-md text-[7.5px] font-semibold text-white shadow-[inset_0_0_0_1px_rgba(255,255,255,0.18)]",style:{backgroundColor:o.color},"aria-hidden":!0,children:o.initials}):s.jsx("span",{className:"grid h-5 w-5 shrink-0 place-items-center rounded-md bg-muted text-muted-foreground","aria-hidden":!0,children:s.jsx(i,{className:"h-3 w-3",strokeWidth:2})})}function zv({title:e,count:t,empty:n,children:r}){return s.jsxs("section",{className:"space-y-3",children:[s.jsx(a4,{title:e,count:t}),s.jsx("div",{className:"overflow-hidden rounded-[22px] border border-border/45 bg-card/86 shadow-[0_18px_65px_rgba(15,23,42,0.07)] backdrop-blur-xl dark:border-white/10 dark:shadow-[0_18px_65px_rgba(0,0,0,0.22)]",children:t>0?s.jsx("div",{className:"divide-y divide-border/45",children:r}):s.jsx(o4,{children:n})})]})}function a4({title:e,count:t}){return s.jsxs("div",{className:"flex items-center justify-between px-1",children:[s.jsx("h2",{className:"text-[13px] font-semibold tracking-[-0.01em] text-foreground/85",children:e}),s.jsx("span",{className:"rounded-full bg-muted px-2 py-0.5 text-[11.5px] font-medium text-muted-foreground",children:t})]})}function o4({children:e}){return s.jsx("div",{className:"rounded-[18px] border border-dashed border-border/65 bg-card/45 px-4 py-5 text-[13px] text-muted-foreground",children:e})}function tC(){const{t:e}=ie();return s.jsx("p",{className:"px-1 text-[11.5px] leading-5 text-muted-foreground/75",children:e("settings.legal.thirdPartyBrands",{defaultValue:"Product names, logos, and brands are property of their respective owners. Use is for identification only and does not imply endorsement."})})}function s4(e){return e.map((t,n)=>({provider:t,index:n})).sort((t,n)=>$v(t.provider)-$v(n.provider)||t.index-n.index).map(({provider:t})=>t)}function i4(e){const t=new Set;return e.filter(n=>t.has(n.name)?!1:(t.add(n.name),!0))}function $v(e){const t=X3.get(e.name);return t!==void 0?t:(e.api_key_required??!0)===!1?100:200}function Uv(e,t){const n=t.trim().toLowerCase();return n?e.filter(r=>`${r.name} ${r.label} ${r.api_base??""} ${r.default_api_base??""}`.toLowerCase().includes(n)):e}function l4(e){return c4(e).map(t=>{const n=d4(t);return{name:t,offset:n,searchText:`${t} ${t.replace(/_/g," ")} ${n}`.toLowerCase()}})}function c4(e){var a;const t=Intl;let n;try{n=((a=t.supportedValuesOf)==null?void 0:a.call(t,"timeZone"))??[]}catch{n=[]}const r=new Set([...Q3,...n,e].filter(Boolean));return Array.from(r).sort((o,i)=>o==="UTC"?-1:i==="UTC"?1:o.localeCompare(i))}function u4(e,t){const n=t.trim().toLowerCase();return n?e.filter(r=>r.searchText.includes(n)):e}function d4(e){var t;try{const r=(t=new Intl.DateTimeFormat("en-US",{timeZone:e,timeZoneName:"shortOffset",hour:"2-digit",minute:"2-digit"}).formatToParts(new Date).find(a=>a.type==="timeZoneName"))==null?void 0:t.value;return r?r.replace(/^GMT$/,"UTC").replace(/^GMT/,"UTC"):"UTC"}catch{return"Custom timezone"}}function Bv(e,t){return!t||e.some(n=>n.name===t)?e:[{name:t,label:t},...e]}function p4(e,t,n={}){const r=n.draftProvider??e.provider;return r==="auto"?t.agent.resolved_provider||t.agent.provider||e.provider:r}const nC={custom:hf,openrouter:$o,skywork:$o,aihubmix:bA,anthropic:Ga,openai:Qb,deepseek:kA,zhipu:nA,dashscope:po,moonshot:vf,minimax:mg,minimax_anthropic:Ga,groq:mo,huggingface:Ni,gemini:eA,mistral:cA,siliconflow:Ni,volcengine:po,volcengine_coding_plan:po,byteplus:po,byteplus_coding_plan:po,qianfan:Ac,ant_ling:$o,azure_openai:po,bedrock:Ac,bocha:Tt,brave:Tt,duckduckgo:Tt,exa:Tt,jina:Tt,kagi:Tt,olostep:Tt,searxng:Tt,tavily:Tt,vllm:mo,ollama:mo,lm_studio:mo,atomic_chat:mo,ovms:mo,nvidia:mg};function m4({provider:e,showBrandLogos:t}){const[n,r]=u.useState(0),a=al(e),o=nC[e]??hf,i=a==null?void 0:a.logoUrls[n];return u.useEffect(()=>r(0),[e]),t&&i?s.jsx("span",{"data-testid":`provider-logo-${e}`,className:"grid h-10 w-10 shrink-0 place-items-center overflow-hidden rounded-[14px] border border-border/45 bg-background shadow-[inset_0_0_0_1px_rgba(0,0,0,0.025)]",style:{boxShadow:`inset 0 0 0 1px ${a.color}22`},children:s.jsx("img",{src:i,alt:"",className:"h-6 w-6 object-contain",onError:()=>r(l=>l+1)})}):t&&a?s.jsx("span",{"data-testid":`provider-logo-fallback-${e}`,className:"grid h-10 w-10 shrink-0 place-items-center rounded-[14px] text-[11px] font-semibold text-white shadow-[inset_0_0_0_1px_rgba(255,255,255,0.18)]",style:{backgroundColor:a.color},"aria-hidden":!0,children:a.initials}):s.jsx("span",{className:"grid h-10 w-10 shrink-0 place-items-center rounded-2xl bg-muted text-foreground/82 shadow-[inset_0_0_0_1px_rgba(0,0,0,0.025)] dark:bg-muted/70",children:s.jsx(o,{className:"h-5 w-5",strokeWidth:2,"aria-hidden":!0})})}function f4({icon:e}){return s.jsx("span",{className:"grid h-9 w-9 shrink-0 place-items-center rounded-[12px] bg-muted text-foreground/82 transition-colors group-hover:bg-muted/80 dark:bg-muted/70",children:s.jsx(e,{className:"h-4 w-4","aria-hidden":!0})})}function h4({provider:e,showBrandLogos:t}){const[n,r]=u.useState(0),a=e?al(e):null,o=a==null?void 0:a.logoUrls[n];return u.useEffect(()=>r(0),[e]),!e||!t||!a?null:o?s.jsx("span",{"data-testid":`overview-logo-${e}`,className:"grid h-5 w-5 shrink-0 place-items-center overflow-hidden rounded-md border border-border/35 bg-background shadow-[inset_0_0_0_1px_rgba(0,0,0,0.02)]",style:{boxShadow:`inset 0 0 0 1px ${a.color}22`},"aria-hidden":!0,children:s.jsx("img",{src:o,alt:"",className:"h-3.5 w-3.5 object-contain",onError:()=>r(i=>i+1)})}):s.jsx("span",{"data-testid":`overview-logo-fallback-${e}`,className:"grid h-5 w-5 shrink-0 place-items-center rounded-md text-[7.5px] font-semibold text-white shadow-[inset_0_0_0_1px_rgba(255,255,255,0.18)]",style:{backgroundColor:a.color},"aria-hidden":!0,children:a.initials})}function vo({icon:e,valueLogoProvider:t,title:n,value:r,caption:a,showBrandLogos:o=!1,onClick:i}){return s.jsxs("button",{type:"button",onClick:i,className:"group flex min-h-[68px] w-full items-center gap-3 px-4 py-3.5 text-left transition-colors hover:bg-muted/30 sm:px-5",children:[s.jsx(f4,{icon:e}),s.jsxs("span",{className:"min-w-0 flex-1",children:[s.jsx("span",{className:"block text-[14px] font-medium leading-5 text-foreground",children:n}),s.jsx("span",{className:"mt-0.5 block truncate text-[12px] leading-5 text-muted-foreground",children:a})]}),s.jsxs("span",{className:"ml-auto flex min-w-0 max-w-[48%] items-center gap-2",children:[s.jsx(h4,{provider:t,showBrandLogos:o}),s.jsx("span",{className:"truncate text-right text-[13px] leading-5 text-muted-foreground",children:r}),s.jsx(Wr,{className:"h-4 w-4 shrink-0 text-muted-foreground/60 transition-transform group-hover:translate-x-0.5","aria-hidden":!0})]})]})}function Jt({children:e}){return s.jsx("h2",{className:"mb-2 px-1 text-[13px] font-semibold tracking-[-0.01em] text-foreground/85",children:e})}function Ht({children:e}){return s.jsx("div",{className:"overflow-hidden rounded-[22px] border border-border/45 bg-card/86 shadow-[0_18px_65px_rgba(15,23,42,0.075)] backdrop-blur-xl dark:border-white/10 dark:shadow-[0_18px_65px_rgba(0,0,0,0.24)]",children:s.jsx("div",{className:"divide-y divide-border/45",children:e})})}function Oe({title:e,description:t,children:n}){return s.jsxs("div",{className:"flex min-h-[62px] flex-col gap-3 px-4 py-3.5 sm:flex-row sm:items-center sm:justify-between sm:px-5",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"text-[14px] font-medium leading-5 text-foreground",children:e}),t?s.jsx("div",{className:"mt-0.5 max-w-[28rem] text-[12px] leading-5 text-muted-foreground",children:t}):null]}),n?s.jsx("div",{className:"min-w-0 sm:ml-6 sm:shrink-0",children:n}):null]})}function Ks({title:e,value:t,description:n}){return s.jsx(Oe,{title:e,description:n,children:s.jsx("span",{className:"block max-w-full truncate text-left text-[13px] text-muted-foreground sm:max-w-[320px] sm:text-right",children:t})})}function g4({presets:e,value:t,settings:n,draftModel:r,draftProvider:a,providerConfigured:o,showProviderLogos:i,onChange:l,onCreateConfiguration:c}){const{t:d}=ie(),p=(f,h)=>d(f,{defaultValue:h}),m=e.find(f=>f.name===t)??e[0]??null;return s.jsxs(gn,{modal:!1,children:[s.jsx(vn,{asChild:!0,disabled:!e.length,children:s.jsxs(fe,{type:"button",variant:"outline","aria-label":p("settings.rows.currentModel","Current configuration"),disabled:!e.length,className:j("h-12 w-[min(430px,72vw)] justify-between rounded-full border-input bg-background px-3.5 text-[13px] font-normal shadow-none","hover:bg-accent/55 focus-visible:ring-2 focus-visible:ring-ring"),children:[m?s.jsx(Hv,{preset:m,settings:n,draftModel:r,draftProvider:a,forceUnconfigured:m!=null&&m.is_default?!o:void 0,showProviderLogos:i,compact:!0}):s.jsx("span",{className:"truncate text-muted-foreground",children:p("settings.models.selectModel","Select model")}),s.jsx(yr,{className:"ml-2 h-3.5 w-3.5 shrink-0 text-muted-foreground","aria-hidden":!0})]})}),s.jsxs(ln,{align:"end",className:"max-h-[20rem] w-[430px] max-w-[calc(100vw-2rem)] overflow-y-auto scrollbar-thin scrollbar-track-transparent",children:[e.map(f=>{const h=f.name===t;return s.jsxs(gt,{onSelect:()=>l(f.name),className:j("flex cursor-default items-center justify-between gap-3 rounded-[12px] px-2.5 py-2 text-[13px]","focus:bg-muted/85 focus:text-foreground",h&&"bg-muted/80 text-foreground focus:bg-muted"),children:[s.jsx(Hv,{preset:f,settings:n,draftModel:r,draftProvider:a,showProviderLogos:i}),h?s.jsx(Et,{className:"h-3.5 w-3.5 shrink-0","aria-hidden":!0}):null]},f.name)}),s.jsx("div",{className:"mt-1 border-t border-border/55 pt-1",children:s.jsxs(gt,{onSelect:()=>{window.setTimeout(c,0)},className:j("flex cursor-default items-center gap-2 rounded-[12px] px-2.5 py-2 text-[13px] font-medium","text-foreground focus:bg-muted/85 focus:text-foreground"),children:[s.jsx("span",{className:"grid h-5 w-5 shrink-0 place-items-center rounded-md bg-muted text-muted-foreground",children:s.jsx(ga,{className:"h-3.5 w-3.5","aria-hidden":!0})}),s.jsx("span",{children:p("settings.models.addConfiguration","Add configuration")})]})})]})]})}function Hv({preset:e,settings:t,draftModel:n,draftProvider:r,forceUnconfigured:a,showProviderLogos:o,compact:i=!1}){const{t:l}=ie(),c=(x,b)=>l(x,{defaultValue:b}),d=p4(e,t,{draftProvider:e.is_default?r:void 0}),p=e.is_default?n:e.model,m=Mo(t.providers,d),f=a===void 0?Mu(t,d):!a,h=f?p||e.label:c("settings.values.notConfigured","Not configured"),y=f?`${m}${e.label?` · ${e.label}`:""}`:m||p||e.label?[m,p||e.label].filter(Boolean).join(" · "):c("settings.byok.noConfiguredProviders","No configured providers");return s.jsxs("span",{className:"flex min-w-0 items-center gap-2.5",children:[s.jsx(Fi,{provider:d,showBrandLogos:o,unconfigured:!f}),s.jsxs("span",{className:"min-w-0 text-left leading-tight",children:[s.jsx("span",{className:j("block truncate font-medium",f?"text-foreground":"text-amber-800 dark:text-amber-200"),children:h}),s.jsx("span",{className:j("mt-0.5 block truncate text-muted-foreground",i?"text-[11.5px]":"text-[12px]"),children:y})]})]})}function ol({dirty:e,saving:t,pendingRestart:n,disabled:r=!1,message:a,dirtyMessage:o,pendingMessage:i,onSave:l,onRestart:c,onReset:d,isRestarting:p}){const{t:m}=ie(),f=(g,w)=>m(g,{defaultValue:w}),h=Ja()!==null,y=h?f("app.system.restartEngine","Restart engine"):m("app.system.restart"),x=h?f("app.system.restartingEngine","Restarting engine..."):m("app.system.restarting"),b=a??(n&&!e?i??f("settings.status.savedRestartApply","Saved. Restart when ready."):e?o??m("settings.status.unsaved"):void 0),v=r?"danger":e||n?"accent":void 0;return s.jsxs("div",{className:"flex min-h-[58px] flex-col gap-3 px-4 py-3 sm:flex-row sm:items-center sm:justify-between sm:px-5",children:[s.jsx("div",{className:"min-w-0 text-[13px] leading-5 text-muted-foreground",children:s.jsx(rC,{tone:v,children:b})}),s.jsxs("div",{className:"flex w-full shrink-0 flex-wrap justify-end gap-2 sm:w-auto",children:[n&&!e&&c?s.jsxs(fe,{size:"sm",variant:"ghost",onClick:c,disabled:p,className:"rounded-full",children:[p?s.jsx(pt,{className:"mr-1.5 h-3.5 w-3.5 animate-spin","aria-hidden":!0}):s.jsx(qi,{className:"mr-1.5 h-3.5 w-3.5","aria-hidden":!0}),p?x:y]}):null,d?s.jsx(fe,{size:"sm",variant:"ghost",onClick:d,disabled:!e||t,className:"rounded-full",children:m("settings.actions.cancel")}):null,s.jsx(fe,{size:"sm",variant:"outline",onClick:l,disabled:!e||r||t,className:"rounded-full",children:m(t?"settings.actions.saving":"settings.actions.save")})]})]})}function v4({dirty:e,saving:t,saved:n,disabled:r=!1,message:a,onSave:o}){const{t:i}=ie(),c=a??(e?i("settings.status.unsaved"):n?i("settings.status.savedRestart"):((d,p)=>i(d,{defaultValue:p}))("settings.status.upToDate","Up to date."));return s.jsxs("div",{className:"flex min-h-[58px] flex-col gap-3 px-4 py-3 sm:flex-row sm:items-center sm:justify-between sm:px-5",children:[s.jsx("div",{className:"text-[13px] text-muted-foreground",children:s.jsx(rC,{tone:r?"danger":e||n?"accent":void 0,children:c})}),s.jsx("div",{className:"flex justify-end",children:s.jsx(fe,{size:"sm",variant:"outline",onClick:o,disabled:!e||r||t,className:"rounded-full",children:i(t?"settings.actions.saving":"settings.actions.save")})})]})}function rC({children:e,tone:t}){return e?s.jsxs("span",{className:j("inline-flex items-center gap-2",t==="accent"&&"font-medium text-blue-600 dark:text-blue-300",t==="danger"&&"font-medium text-destructive"),children:[t?s.jsx("span",{className:j("h-1.5 w-1.5 shrink-0 rounded-full",t==="accent"&&"bg-blue-500 shadow-[0_0_0_3px_rgba(59,130,246,0.14)] dark:bg-blue-400 dark:shadow-[0_0_0_3px_rgba(96,165,250,0.18)]",t==="danger"&&"bg-destructive/70"),"aria-hidden":!0}):null,s.jsx("span",{children:e})]}):null}function Iu({children:e,tone:t="neutral"}){return s.jsx("span",{className:j("inline-flex max-w-[260px] items-center rounded-full px-2.5 py-1 text-[12px] font-medium",t==="success"&&"bg-emerald-500/10 text-emerald-700 dark:text-emerald-300",t==="warning"&&"bg-amber-500/10 text-amber-700 dark:text-amber-300",t==="neutral"&&"bg-muted text-muted-foreground"),children:s.jsx("span",{className:"truncate",children:e})})}function eo({value:e,options:t,onChange:n}){return s.jsx("div",{className:"inline-flex h-8 items-center rounded-full bg-muted p-0.5 text-[12px] font-medium text-muted-foreground",children:t.map(r=>s.jsx("button",{type:"button",onClick:()=>n(r.value),className:j("rounded-full px-3 py-1 transition-colors",e===r.value&&"bg-background text-foreground shadow-sm"),children:r.label},r.value))})}function is({checked:e,onChange:t,ariaLabel:n,label:r}){return s.jsxs("button",{type:"button",role:"switch","aria-checked":e,"aria-label":n??r,onClick:()=>t(!e),className:j("relative inline-flex h-[22px] w-[38px] shrink-0 items-center rounded-full p-[2px]","transition-colors duration-200 ease-out focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e?"bg-[#2997FF] shadow-[inset_0_0_0_1px_rgba(0,0,0,0.035)]":"bg-muted shadow-[inset_0_0_0_1px_rgba(0,0,0,0.035)] hover:bg-muted/80"),children:[s.jsx("span",{"aria-hidden":!0,className:j("h-[18px] w-[18px] rounded-full bg-background shadow-[0_1px_2px_rgba(0,0,0,0.18),0_2px_7px_rgba(0,0,0,0.11)]","transition-transform duration-200 ease-out",e?"translate-x-[16px]":"translate-x-0")}),s.jsx("span",{className:"sr-only",children:r})]})}function zi({value:e,min:t,max:n,onChange:r,suffix:a}){return s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ye,{type:"number",min:t,max:n,value:e,onChange:o=>{const i=Number(o.target.value);Number.isFinite(i)&&r(i)},className:"h-8 w-24 max-w-full rounded-full text-[13px]"}),a?s.jsx("span",{className:"text-[12px] text-muted-foreground",children:a}):null]})}const aC="nanobot-webui.theme",oC=u.createContext("light");function x4(){try{const e=localStorage.getItem(aC);return e==="light"||e==="dark"?e:null}catch{return null}}function y4(e){const t=document.documentElement;e==="dark"?t.classList.add("dark"):t.classList.remove("dark")}function b4(){const[e,t]=u.useState(()=>{const a=x4();return a||(typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light")});u.useEffect(()=>{y4(e);try{localStorage.setItem(aC,e)}catch{}},[e]);const n=u.useCallback(a=>t(a),[]),r=u.useCallback(()=>t(a=>a==="dark"?"light":"dark"),[]);return{theme:e,toggle:r,setTheme:n}}function w4({theme:e,children:t}){return u.createElement(oC.Provider,{value:e},t)}function k4(){return u.useContext(oC)}const C4="\x1B",ls=new RegExp(`${C4}\\[[0-?]*[ -/]*[@-~]`,"g"),mm=["#000000","#cd3131","#0dbc79","#e5e510","#2472c8","#bc3fbc","#11a8cd","#e5e5e5"],fm=["#666666","#f14c4c","#23d18b","#f5f543","#3b8eea","#d670d6","#29b8db","#ffffff"],Dd=[0,95,135,175,215,255];function S4(e){return ls.lastIndex=0,ls.test(e)}function N4(e){return ls.lastIndex=0,e.replace(ls,"")}function sC(){return{bold:!1,dim:!1,inverse:!1,italic:!1,underline:!1}}function j4(e){if(e<0||e>255)return;if(e<8)return mm[e];if(e<16)return fm[e-8];if(e<232){const n=e-16,r=Dd[Math.floor(n/36)],a=Dd[Math.floor(n%36/6)],o=Dd[n%6];return`rgb(${r}, ${a}, ${o})`}const t=8+(e-232)*10;return`rgb(${t}, ${t}, ${t})`}function A4(e,t,n){if(![e,t,n].some(r=>!Number.isFinite(r)||r<0||r>255))return`rgb(${e}, ${t}, ${n})`}function _4(e){if(!e.endsWith("m"))return null;const t=e.slice(2,-1).trim();return t?t.split(/[;:]/).map(n=>{const r=Number.parseInt(n||"0",10);return Number.isFinite(r)?r:0}):[0]}function Wv(e,t,n,r){const a=t[n+1];if(a===5){const o=j4(t[n+2]);return o&&(e[r]=o),n+2}if(a===2){const o=A4(t[n+2],t[n+3],t[n+4]);return o&&(e[r]=o),n+4}return n}function P4(e,t){for(let n=0;n<t.length;n+=1){const r=t[n];r===0?Object.assign(e,sC()):r===1?(e.bold=!0,e.dim=!1):r===2?(e.dim=!0,e.bold=!1):r===3?e.italic=!0:r===4?e.underline=!0:r===7?e.inverse=!0:r===22?(e.bold=!1,e.dim=!1):r===23?e.italic=!1:r===24?e.underline=!1:r===27?e.inverse=!1:r===39?delete e.color:r===49?delete e.backgroundColor:r>=30&&r<=37?e.color=mm[r-30]:r>=40&&r<=47?e.backgroundColor=mm[r-40]:r>=90&&r<=97?e.color=fm[r-90]:r>=100&&r<=107?e.backgroundColor=fm[r-100]:r===38?n=Wv(e,t,n,"color"):r===48&&(n=Wv(e,t,n,"backgroundColor"))}}function qv(e){const t=e.inverse?e.backgroundColor:e.color,n=e.inverse?e.color:e.backgroundColor,r={};return t&&(r.color=t),n&&(r.backgroundColor=n),e.bold&&(r.fontWeight=700),e.dim&&(r.opacity=.72),e.italic&&(r.fontStyle="italic"),e.underline&&(r.textDecorationLine="underline"),Object.keys(r).length?r:void 0}function T4(e){const t=[],n=sC();let r=0;ls.lastIndex=0;for(const a of e.matchAll(ls)){const o=a.index??0;o>r&&t.push({text:e.slice(r,o),style:qv(n)});const i=_4(a[0]);i&&P4(n,i),r=o+a[0].length}return r<e.length&&t.push({text:e.slice(r),style:qv(n)}),t.filter(a=>a.text.length>0)}const Od=['"JetBrains Mono"','"SFMono-Regular"','"SF Mono"','"Fira Code"','"Cascadia Code"','"Source Code Pro"',"Menlo","Consolas","monospace"].join(", "),R4=new Set(["ansi","ansi-output"]),M4="#f4f4f5",E4="#27272a",I4=u.lazy(async()=>{const[{default:e},{default:t},{default:n}]=await Promise.all([Dl(()=>import("./syntax-highlight-CQw1bBY6.js").then(r=>r.p),__vite__mapDeps([0,1,2,3])),Dl(()=>import("./syntax-highlight-CQw1bBY6.js").then(r=>r.o),__vite__mapDeps([0,1,2,3])),Dl(()=>import("./syntax-highlight-CQw1bBY6.js").then(r=>r.b),__vite__mapDeps([0,1,2,3]))]);return{default({language:r,code:a,isDark:o,chrome:i,showLineNumbers:l,wrapLongLines:c}){const d=o?t:n,p=i==="none"?{...d,'pre[class*="language-"]':{...d['pre[class*="language-"]'],background:"transparent"},'code[class*="language-"]':{...d['code[class*="language-"]'],background:"transparent"}}:d;return s.jsx(e,{language:r||"text",style:p,customStyle:{background:i==="none"?"transparent":o?E4:M4,margin:0,padding:i==="none"?"0.75rem 1rem":"1rem",fontFamily:Od,fontSize:i==="none"?"13px":"0.875rem",lineHeight:i==="none"?1.55:1.6,tabSize:2},codeTagProps:{style:{background:"transparent",fontFamily:Od}},lineNumberStyle:{minWidth:"2.6em",paddingRight:"1.15rem",color:o?"rgba(212, 212, 216, 0.45)":"rgba(63, 63, 70, 0.68)",fontFamily:Od,userSelect:"none"},PreTag:"pre",showLineNumbers:l,wrapLongLines:c,children:a})}}});function L4(e){return e}function D4(e){return T4(e).map((t,n)=>s.jsx("span",{style:t.style,children:t.text},n))}function Fd({code:e,chrome:t,showLineNumbers:n,testId:r,className:a,renderText:o=L4}){const i=e.split(`
`);return s.jsx("pre",{className:j("m-0 overflow-x-auto p-4 font-mono text-sm leading-[1.6] text-foreground/90",n?"whitespace-pre":"whitespace-pre-wrap",t==="default"?"bg-zinc-100 dark:bg-zinc-800":"bg-transparent",t==="none"&&"p-3 text-[13px] leading-[1.55]",a),"data-testid":r,children:s.jsx("code",{className:"text-inherit",children:n?i.map((l,c)=>s.jsxs("span",{className:"flex min-w-max",children:[s.jsx("span",{className:"w-10 shrink-0 select-none pr-4 text-right text-muted-foreground/60",children:c+1}),s.jsx("span",{className:"whitespace-pre",children:o(l||" ")}),c<i.length-1?`
`:null]},c)):o(e)})})}function O4(e,t){const n=e==null?void 0:e.trim().toLowerCase();return!!(n&&R4.has(n)||S4(t))}function F4({language:e,code:t,className:n,chrome:r="default",highlight:a=!0,showLineNumbers:o=!1,wrapLongLines:i=!0}){const{t:l}=ie(),[c,d]=u.useState(!1),p=k4()==="dark",m=r==="default",f=O4(e,t),h=u.useCallback(()=>{navigator.clipboard&&navigator.clipboard.writeText(f?N4(t):t).then(()=>{d(!0),setTimeout(()=>d(!1),1500)})},[t,f]);return s.jsxs("div",{className:j("not-prose overflow-hidden",m&&"rounded-lg border",m&&(p?"border-white/10":"border-black/10"),n),children:[m?s.jsxs("div",{className:j("flex items-center justify-between px-4 pb-1.5 pt-2 text-xs font-medium",p?"bg-zinc-800 text-zinc-300":"bg-zinc-100 text-zinc-600"),children:[s.jsx("span",{className:"lowercase font-mono",children:e||l("code.fallbackLanguage")}),s.jsxs("button",{type:"button",onClick:h,className:j("inline-flex items-center gap-1 rounded px-1.5 py-0.5 font-mono transition-colors",p?"text-zinc-400 hover:bg-zinc-700 hover:text-zinc-200":"text-zinc-500 hover:bg-zinc-200 hover:text-zinc-700"),"aria-label":l("code.copyAria"),children:[c?s.jsx(Et,{className:"h-3.5 w-3.5"}):s.jsx(Zb,{className:"h-3.5 w-3.5"}),s.jsx("span",{children:l(c?"code.copied":"code.copy")})]})]}):null,f?s.jsx(Fd,{code:t,chrome:r,showLineNumbers:o,testId:"ansi-code",renderText:D4}):a?s.jsx(u.Suspense,{fallback:s.jsx(Fd,{code:t,chrome:r,showLineNumbers:o,testId:"plain-code-fallback"}),children:s.jsx(I4,{language:e,code:t,isDark:p,chrome:r,showLineNumbers:o,wrapLongLines:i})}):s.jsx(Fd,{code:t,chrome:r,showLineNumbers:o,testId:"plain-code-fallback"})]})}function Xf({path:e,tooltipPath:t,display:n="name",active:r=!1,className:a,textClassName:o,previewPath:i,onOpen:l,testId:c="inline-file-path"}){const{directory:d,name:p}=iC(e),m=$4(e),f=n==="path"?e.replace(/\\/g,"/"):p,h=t||e,y=i||t||e,x=!!l,b=g=>{l&&(g.preventDefault(),g.stopPropagation(),l(y))},v=g=>{g.key!=="Enter"&&g.key!==" "||b(g)};return s.jsx(Ru,{delayDuration:500,skipDelayDuration:100,children:s.jsxs(Ei,{children:[s.jsx(Ii,{asChild:!0,children:s.jsx("span",{className:j("not-prose inline-flex max-w-full align-baseline leading-[inherit]",a),children:s.jsxs("span",{"data-testid":c,"aria-label":h,role:x?"button":void 0,tabIndex:x?0:void 0,onClick:x?b:void 0,onKeyDown:x?v:void 0,className:j("inline-flex max-w-full items-baseline gap-[0.28em] font-medium leading-[inherit]","text-sky-600 transition-colors hover:text-sky-700","dark:text-sky-300 dark:hover:text-sky-200",x&&["cursor-pointer rounded-[5px]","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-sky-400/45"]),children:[s.jsx(U4,{kind:m}),s.jsx("span",{"data-sheen-text":r?f:void 0,className:j("min-w-0 max-w-full truncate",r&&"streaming-text-sheen file-reference-sheen",o),children:n==="path"&&d?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"text-muted-foreground/65",children:d}),s.jsx("span",{className:"font-semibold text-sky-700 dark:text-sky-200",children:p})]}):f})]})})}),s.jsx(ss,{side:"top",align:"center",sideOffset:8,collisionPadding:12,className:j("max-w-[min(38rem,calc(100vw-2rem))] rounded-[10px]","border-border/60 bg-popover/95 px-2.5 py-1.5","break-all font-mono text-[11px] leading-snug text-popover-foreground","shadow-lg backdrop-blur"),children:h})]})})}function C6(e){const t=e.trim();if(!t||t.includes(`
`)||/^[a-z][a-z0-9+.-]*:\/\//i.test(t)||z4(t)||!/[\\/]/.test(t)&&!/^(dockerfile|makefile|readme|package-lock\.json)$/i.test(t))return!1;const n=t.replace(/\\/g,"/"),r=n.split("/").filter(Boolean).pop()??n;return!r||r==="."||r===".."?!1:/^(dockerfile|makefile|readme|package-lock\.json)$/i.test(r)?!0:/\.[a-z0-9][a-z0-9_-]{0,12}$/i.test(r)}function z4(e){return/[*?[\]{}]/.test(e.trim())}function iC(e){const t=e.replace(/\\/g,"/"),n=t.lastIndexOf("/");return n<0?{directory:"",name:e}:{directory:t.slice(0,n+1),name:t.slice(n+1)||t}}function $4(e){const t=e.toLowerCase(),n=t.split(/[\\/]/).pop()??t,r=n.includes(".")?n.split(".").pop()??"":"";if(n==="dockerfile")return"default";switch(r){case"py":case"pyi":return"python";case"jsx":case"tsx":return"react";case"js":case"mjs":case"cjs":return"javascript";case"ts":case"mts":case"cts":return"typescript";case"html":case"htm":return"html";case"css":case"scss":case"sass":return"css";case"json":case"jsonl":return"json";case"md":case"mdx":return"markdown";case"ipynb":return"notebook";default:return"default"}}function U4({kind:e}){if(e==="python")return s.jsxs("svg",{"aria-hidden":!0,className:"h-[1em] w-[1em] shrink-0 translate-y-[0.12em]",viewBox:"0 0 24 24",children:[s.jsx("path",{d:"M11.9 2.3c-3 0-4.5.8-4.5 2.3v2.1h4.8v.8H5.5C4 7.5 3 8.8 3 10.8v2.1c0 1.8 1.1 3 2.7 3h1.6v-2.3c0-1.7 1.4-3.1 3.1-3.1h4.2c1.3 0 2.3-1 2.3-2.3V4.6c0-1.4-1.5-2.3-4.6-2.3h-.4Z",fill:"#3776AB"}),s.jsx("path",{d:"M12.1 21.7c3 0 4.5-.8 4.5-2.3v-2.1h-4.8v-.8h6.7c1.5 0 2.5-1.3 2.5-3.3v-2.1c0-1.8-1.1-3-2.7-3h-1.6v2.3c0 1.7-1.4 3.1-3.1 3.1H9.4c-1.3 0-2.3 1-2.3 2.3v3.6c0 1.4 1.5 2.3 4.6 2.3h.4Z",fill:"#FFD43B"}),s.jsx("circle",{cx:"9",cy:"5.1",r:"0.8",fill:"#fff"}),s.jsx("circle",{cx:"15",cy:"18.9",r:"0.8",fill:"#5C3B00",opacity:"0.85"})]});if(e==="react")return s.jsxs("svg",{"aria-hidden":!0,className:"h-[0.92em] w-[0.92em] shrink-0 translate-y-[0.11em] text-sky-500 dark:text-sky-300",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round",children:[s.jsx("circle",{cx:"12",cy:"12",r:"1.9",fill:"currentColor",stroke:"none"}),s.jsx("ellipse",{cx:"12",cy:"12",rx:"9",ry:"3.7"}),s.jsx("ellipse",{cx:"12",cy:"12",rx:"9",ry:"3.7",transform:"rotate(60 12 12)"}),s.jsx("ellipse",{cx:"12",cy:"12",rx:"9",ry:"3.7",transform:"rotate(120 12 12)"})]});if(e==="default")return s.jsxs("svg",{"aria-hidden":!0,className:"h-[0.92em] w-[0.92em] shrink-0 translate-y-[0.11em] text-sky-500 dark:text-sky-300",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.9",strokeLinecap:"round",strokeLinejoin:"round",children:[s.jsx("path",{d:"M14 2H7a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V7z"}),s.jsx("path",{d:"M14 2v5h5"})]});const t=B4(e);return s.jsxs("svg",{"aria-hidden":!0,className:"h-[0.96em] w-[0.96em] shrink-0 translate-y-[0.12em] text-sky-500 dark:text-sky-300",viewBox:"0 0 24 24",fill:"none",children:[s.jsx("path",{d:"M7 3.5h6.6L18 7.9V19a1.5 1.5 0 0 1-1.5 1.5h-9A1.5 1.5 0 0 1 6 19V5a1.5 1.5 0 0 1 1.5-1.5Z",fill:"currentColor",opacity:"0.12"}),s.jsx("path",{d:"M13.5 3.75V8h4.25M7 3.5h6.6L18 7.9V19a1.5 1.5 0 0 1-1.5 1.5h-9A1.5 1.5 0 0 1 6 19V5a1.5 1.5 0 0 1 1.5-1.5Z",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"}),s.jsx("text",{x:"12",y:"15.7",textAnchor:"middle",fill:"currentColor",fontSize:t.length>1?"5.8":"7.2",fontWeight:"800",letterSpacing:"-0.2",children:t})]})}function B4(e){switch(e){case"css":return"#";case"html":return"H";case"javascript":return"JS";case"json":return"{}";case"markdown":return"M";case"notebook":return"N";case"python":return"PY";case"typescript":return"TS";default:return""}}function H4(){return typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia("(hover: hover) and (pointer: fine)").matches}function W4({sessionKey:e,path:t,token:n,desktopWidth:r=544,isClosing:a=!1,onResizeStart:o,onClose:i}){const{t:l}=ie(),[c,d]=u.useState({status:"loading"}),[p,m]=u.useState(!1),[f,h]=u.useState(H4);u.useEffect(()=>{const N=window.requestAnimationFrame(()=>m(!0));return()=>window.cancelAnimationFrame(N)},[]),u.useEffect(()=>{if(typeof window.matchMedia!="function")return;const N=window.matchMedia("(hover: hover) and (pointer: fine)"),S=()=>h(N.matches);return S(),typeof N.addEventListener=="function"?(N.addEventListener("change",S),()=>N.removeEventListener("change",S)):(N.addListener(S),()=>N.removeListener(S))},[]),u.useEffect(()=>{let N=!1;return d({status:"loading"}),vL(n,e,t).then(S=>{N||d({status:"ready",payload:S})}).catch(S=>{if(N)return;const A=S instanceof as?S.status===404&&/API route not found/i.test(S.message)?l("filePreview.routeMissing",{defaultValue:"File preview needs the latest gateway. Restart nanobot gateway and try again."}):S.message:l("filePreview.failed",{defaultValue:"Could not preview this file."});d({status:"error",message:A})}),()=>{N=!0}},[t,e,l,n]);const y=c.status==="ready"?c.payload.display_path:t,x=c.status==="ready"?c.payload.path:y,b=x.replace(/\\/g,"/"),v=b.startsWith("/"),{name:g}=iC(y),w=u.useMemo(()=>b.split("/").filter(Boolean),[b]),k=u.useMemo(()=>w.length>2?w.slice(-2):w,[w]),C=w.length>k.length;return s.jsx("aside",{"aria-label":l("filePreview.aria",{defaultValue:"File preview"}),style:{"--file-preview-width":`${r}px`,"--file-preview-slot-width":!p||a?"0px":`${r}px`},className:j("absolute inset-y-0 right-0 z-30 w-[min(100vw,var(--file-preview-slot-width))] overflow-hidden","transition-[width] duration-300 ease-out will-change-[width]","md:relative md:z-auto md:w-[var(--file-preview-slot-width)] md:min-w-0 md:shrink-0",a&&"pointer-events-none"),"data-testid":"file-preview-panel","data-file-preview-panel":!0,children:s.jsxs("div",{className:j("absolute inset-y-0 right-0 flex w-[min(100vw,var(--file-preview-width))] flex-col overflow-hidden pb-[env(safe-area-inset-bottom)] md:w-[var(--file-preview-width)] md:pb-0","border-l border-border/70 bg-background shadow-2xl md:shadow-none","transition-[opacity,transform] duration-300 ease-out will-change-transform",!p||a?"translate-x-full opacity-0":"translate-x-0 opacity-100","motion-reduce:translate-x-0"),children:[o?s.jsx("button",{type:"button","aria-label":l("filePreview.resize",{defaultValue:"Resize file preview"}),className:j("group absolute inset-y-0 left-0 z-20 hidden w-3 -translate-x-1/2 cursor-col-resize touch-none md:flex","items-stretch justify-center focus-visible:outline-none"),onPointerDown:o,children:s.jsx("span",{"aria-hidden":!0,className:j("h-full w-px bg-foreground/25 opacity-0 transition-opacity","group-hover:opacity-100 group-focus-visible:bg-ring group-focus-visible:opacity-100")})}):null,s.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[s.jsx("div",{className:"flex h-12 shrink-0 items-center gap-2 border-b border-border/60 px-3",children:f?s.jsxs("div",{className:j("group inline-flex max-w-full min-w-0 items-center gap-2 rounded-[12px]","bg-muted/70 px-2.5 py-1.5 text-sm font-medium"),title:g||y,children:[s.jsxs("button",{type:"button",onClick:i,className:j("relative inline-flex h-5 w-5 shrink-0 items-center justify-center overflow-hidden rounded-full","text-muted-foreground/75 transition-[background-color,color,opacity] duration-150 ease-out","group-hover:bg-foreground group-hover:text-background group-hover:opacity-100","group-focus-within:bg-foreground group-focus-within:text-background","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"),"aria-label":l("filePreview.close",{defaultValue:"Close file preview"}),children:[s.jsx(Jj,{className:j("absolute h-4 w-4 transition-all duration-150 ease-out","opacity-100 group-hover:scale-75 group-hover:opacity-0","group-focus-within:scale-75 group-focus-within:opacity-0"),"aria-hidden":!0}),s.jsx(xr,{className:j("absolute h-3.5 w-3.5 scale-75 opacity-0 transition-all duration-150 ease-out","group-hover:scale-100 group-hover:opacity-100","group-focus-within:scale-100 group-focus-within:opacity-100"),"aria-hidden":!0})]}),s.jsx("span",{className:"min-w-0 truncate",children:g||y})]}):s.jsxs(s.Fragment,{children:[s.jsx("button",{type:"button",onClick:i,className:j("inline-flex h-10 w-10 shrink-0 items-center justify-center rounded-full","text-muted-foreground transition-colors hover:bg-muted hover:text-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"),"aria-label":l("filePreview.close",{defaultValue:"Close file preview"}),children:s.jsx(xr,{className:"h-5 w-5","aria-hidden":!0})}),s.jsx("span",{className:"min-w-0 truncate text-sm font-medium",children:g||y})]})}),s.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[s.jsx("div",{className:j("flex min-h-10 shrink-0 items-center gap-1.5 overflow-hidden","border-b border-border/45 px-4 text-[13px] text-muted-foreground"),title:x,children:s.jsxs("div",{className:"flex min-w-0 items-center gap-1.5",children:[C?s.jsx("span",{className:"shrink-0 text-muted-foreground/55",children:"..."}):v?s.jsx("span",{className:"shrink-0 text-muted-foreground/55",children:"/"}):null,k.length>0?k.map((N,S)=>s.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[S>0||C||v?s.jsx(Wr,{className:"h-3 w-3 shrink-0 text-muted-foreground/40","aria-hidden":!0}):null,s.jsx("span",{className:j("min-w-0 truncate",S===k.length-1?"font-medium text-foreground":"max-w-[42vw] shrink text-muted-foreground/76"),children:N})]},`${N}-${S}`)):s.jsx("span",{className:"truncate",children:x})]})}),s.jsx("div",{className:"min-h-0 flex-1 overflow-auto",children:c.status==="loading"?s.jsxs("div",{className:"flex h-full items-center justify-center gap-2 text-sm text-muted-foreground",children:[s.jsx(pt,{className:"h-4 w-4 animate-spin","aria-hidden":!0}),l("filePreview.loading",{defaultValue:"Loading preview..."})]}):c.status==="error"?s.jsx("div",{className:"flex h-full items-center justify-center px-8 text-center text-sm text-muted-foreground",children:s.jsxs("div",{className:"max-w-sm",children:[s.jsx(ja,{className:"mx-auto mb-3 h-5 w-5 text-muted-foreground/70","aria-hidden":!0}),s.jsx("p",{children:c.message})]})}):s.jsxs("div",{className:"min-h-full",children:[c.payload.truncated?s.jsx("div",{className:"mx-4 mt-3 rounded-md border border-amber-500/25 bg-amber-500/10 px-3 py-2 text-xs text-amber-700 dark:text-amber-200",children:l("filePreview.truncated",{defaultValue:"Preview is truncated because this file is large."})}):null,s.jsx(F4,{language:c.payload.language,code:c.payload.content,chrome:"none",showLineNumbers:!0,wrapLongLines:!1,className:"min-h-full"})]})})]})]})]})})}function lC(e){let t=0;return e.flatMap(n=>{if(n.role!=="user")return[];const r={id:n.id,label:q4(n.content,t),preview:K4(n.content,t),createdAt:n.createdAt,index:t};return t+=1,[r]})}function q4(e,t){const n=e.replace(/\s+/g," ").trim();return n?n.length>80?`${n.slice(0,77)}...`:n:`Prompt ${t+1}`}function K4(e,t){const n=e.replace(/\n{3,}/g,`
`).trim();return n?n.length>320?`${n.slice(0,317)}...`:n:`Prompt ${t+1}`}function hm(e,t){if(!e||!t)return;const n=ii(e,t);n&&e.scrollTo({top:Math.max(0,Jf(e,n)-16),behavior:"smooth"})}function ii(e,t){const n=e.querySelectorAll("[data-user-prompt-id]");return Array.from(n).find(r=>r.dataset.userPromptId===t)??null}function Jf(e,t){const n=e.getBoundingClientRect(),r=t.getBoundingClientRect();return n.top!==0||r.top!==0?r.top-n.top+e.scrollTop:t.offsetTop}function V4({messages:e,onJumpToPrompt:t}){const{i18n:n,t:r}=ie(),a=u.useMemo(()=>lC(e),[e]),[o,i]=u.useState(!1),[l,c]=u.useState(""),d=u.useMemo(()=>{const m=l.trim().toLocaleLowerCase();return m?a.filter(f=>`${f.label}
${f.preview}`.toLocaleLowerCase().includes(m)):a},[a,l]);if(a.length===0)return null;const p=m=>{i(!1),t(m)};return s.jsxs(s.Fragment,{children:[s.jsx(fe,{type:"button",variant:"ghost",size:"icon",className:j("host-no-drag h-8 w-8 rounded-full text-muted-foreground/80","hover:bg-accent/40 hover:text-foreground"),"aria-label":r("thread.promptNavigator.open"),onClick:()=>i(!0),children:s.jsx(iA,{className:"h-4 w-4"})}),s.jsx(qf,{open:o,onOpenChange:i,children:s.jsxs(ju,{side:"right","aria-describedby":void 0,className:"w-[min(92vw,24rem)] gap-0 p-0 sm:max-w-[24rem]",children:[s.jsxs("div",{className:"border-b px-5 pb-4 pt-5",children:[s.jsx(Au,{className:"text-base font-medium",children:r("thread.promptNavigator.title")}),s.jsxs("div",{className:"relative mt-4",children:[s.jsx(Tt,{"aria-hidden":!0,className:"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),s.jsx("input",{value:l,onChange:m=>c(m.target.value),"aria-label":r("thread.promptNavigator.search"),placeholder:r("thread.promptNavigator.search"),className:j("h-10 w-full rounded-full border border-border bg-background pl-9 pr-3 text-sm","outline-none transition focus:border-ring focus:ring-2 focus:ring-ring/20")})]})]}),s.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto px-2 py-2",children:d.length>0?s.jsx("div",{className:"space-y-1",children:d.map(m=>s.jsx(G4,{locale:n.resolvedLanguage||n.language,prompt:m,onJump:p},m.id))}):s.jsx("div",{className:"px-3 py-10 text-center text-sm text-muted-foreground",children:r("thread.promptNavigator.noResults")})})]})})]})}function G4({locale:e,onJump:t,prompt:n}){const{t:r}=ie(),a=$r(n.createdAt,e);return s.jsxs("button",{type:"button",className:j("w-full rounded-xl px-3 py-3 text-left transition","hover:bg-accent focus-visible:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/30"),"aria-label":r("thread.promptNavigator.jumpTo",{label:n.label}),onClick:()=>t(n.id),children:[s.jsx("div",{className:"max-h-20 overflow-hidden whitespace-pre-wrap break-words text-sm leading-5 text-foreground",children:n.preview}),a?s.jsx("div",{className:"mt-1 text-[10px] leading-4 text-muted-foreground/75",children:a}):null]})}const Y4=3e3;function Q4(e,t,n){const[r,a]=u.useState([]),[o,i]=u.useState(!1),[l,c]=u.useState(!1),[d,p]=u.useState(()=>Date.now());return u.useEffect(()=>{if(!e)return;let m=!1,f=!1;const h=async(b=!1)=>{b&&(i(!0),c(!1),a([]));try{const v=await w1(t,n);if(m)return;a(v.jobs),c(!1),f=!0}catch{!m&&!f&&c(!0)}finally{!m&&b&&i(!1)}};h(!0);const y=window.setInterval(()=>void h(!1),Y4),x=()=>{document.visibilityState!=="hidden"&&h(!1)};return window.addEventListener("focus",x),document.addEventListener("visibilitychange",x),()=>{m=!0,window.clearInterval(y),window.removeEventListener("focus",x),document.removeEventListener("visibilitychange",x)}},[e,n,t]),u.useEffect(()=>{if(!e)return;p(Date.now());const m=window.setInterval(()=>p(Date.now()),1e3);return()=>window.clearInterval(m)},[e]),{jobs:r,loading:o,loadFailed:l,now:d}}const X4=[[60,"second"],[60,"minute"],[24,"hour"],[7,"day"],[4.345,"week"],[12,"month"],[Number.POSITIVE_INFINITY,"year"]];function J4({sessionKey:e,token:t,title:n}){const{t:r}=ie("common"),[a,o]=u.useState(!1),{jobs:i,loading:l,loadFailed:c,now:d}=Q4(a,t,e),p=l?s.jsxs("div",{className:"flex items-center gap-2 rounded-[16px] bg-muted/45 px-3 py-3 text-[12.5px] text-muted-foreground",children:[s.jsx(fA,{className:"h-3.5 w-3.5 animate-spin"}),r("thread.sessionInfo.loading")]}):c?s.jsxs("div",{className:"flex items-center gap-2 rounded-[16px] bg-destructive/10 px-3 py-3 text-[12.5px] text-destructive",children:[s.jsx(ja,{className:"h-3.5 w-3.5"}),r("thread.sessionInfo.loadFailed")]}):i.length?s.jsx("div",{className:"space-y-1.5",children:i.map(m=>s.jsx(Z4,{job:m,now:d},m.id))}):s.jsx("div",{className:"rounded-[16px] bg-muted/35 px-3 py-3 text-[12.5px] leading-relaxed text-muted-foreground",children:r("thread.sessionInfo.empty")});return s.jsxs(gn,{modal:!1,open:a,onOpenChange:o,children:[s.jsx(vn,{asChild:!0,children:s.jsx(fe,{variant:"ghost",size:"icon","aria-label":r("thread.header.sessionInfo"),className:j("host-no-drag h-8 w-8 rounded-full text-muted-foreground/85","hover:bg-accent/40 hover:text-foreground"),children:s.jsx(sA,{className:"h-4 w-4 stroke-[1.75]"})})}),s.jsx(ln,{align:"end",sideOffset:8,className:"w-[min(23rem,calc(100vw-1.5rem))] rounded-[24px] p-0",children:s.jsxs("div",{className:"space-y-3 px-4 py-3.5",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"text-[12px] font-normal text-muted-foreground/75",children:r("thread.sessionInfo.title")}),s.jsx("div",{className:"mt-0.5 truncate text-[14px] font-medium text-foreground",children:n||r("thread.sessionInfo.untitled")})]}),s.jsx("div",{className:"h-px bg-border/45"}),s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[s.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[s.jsx(Kj,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground/80"}),s.jsx("span",{className:"truncate text-[13px] font-medium text-foreground",children:r("thread.sessionInfo.automations")})]}),s.jsx("span",{className:"rounded-full bg-muted/70 px-2 py-0.5 text-[11px] text-muted-foreground",children:r("thread.sessionInfo.count",{count:i.length})})]}),p]})})]})}function Z4({job:e,now:t}){const{t:n}=ie("common"),r=eO(e,n),a=tO(e,n,t),o=e.enabled?e.state.last_status==="error"?"bg-destructive":"bg-emerald-500":"bg-muted-foreground/35";return s.jsx("div",{className:"rounded-[16px] px-3 py-2.5 transition-colors hover:bg-muted/40",children:s.jsxs("div",{className:"flex items-start gap-2.5",children:[s.jsx("span",{className:j("mt-1.5 h-1.5 w-1.5 shrink-0 rounded-full",o)}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[s.jsx("span",{className:"truncate text-[13px] font-medium text-foreground",children:e.name}),e.enabled?null:s.jsx("span",{className:"shrink-0 rounded-full bg-muted px-1.5 py-0.5 text-[10.5px] text-muted-foreground",children:n("thread.sessionInfo.disabled")})]}),s.jsx("div",{className:"mt-1 line-clamp-2 text-[12px] leading-snug text-muted-foreground",children:e.payload.message}),s.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-x-2 gap-y-1 text-[11.5px] text-muted-foreground/80",children:[s.jsx("span",{children:r}),s.jsx("span",{"aria-hidden":!0,children:"·"}),s.jsx("span",{title:a.title,children:a.label})]})]})]})})}function eO(e,t){const n=ys();return e.schedule.kind==="at"&&e.schedule.at_ms?t("thread.sessionInfo.schedule.at",{time:$r(e.schedule.at_ms,n)}):e.schedule.kind==="every"&&e.schedule.every_ms?t("thread.sessionInfo.schedule.every",{duration:rO(e.schedule.every_ms,n)}):e.schedule.kind==="cron"&&e.schedule.expr?e.schedule.tz?t("thread.sessionInfo.schedule.cronWithTz",{expr:e.schedule.expr,tz:e.schedule.tz}):t("thread.sessionInfo.schedule.cron",{expr:e.schedule.expr}):t("thread.sessionInfo.schedule.unknown")}function tO(e,t,n){const r=ys();if(!e.enabled)return{label:t("thread.sessionInfo.next.disabled"),title:""};if(e.state.pending)return{label:t("thread.sessionInfo.next.pending"),title:""};const a=e.state.next_run_at_ms;return a?{label:t("thread.sessionInfo.next.label",{time:nO(a,n,r)}),title:$r(a,r)}:{label:t("thread.sessionInfo.next.none"),title:""}}function nO(e,t,n){let r=(e-t)/1e3;const a=new Intl.RelativeTimeFormat(n,{numeric:"auto"});for(const[o,i]of X4){if(Math.abs(r)<o)return a.format(Math.round(r),i);r/=o}return a.format(Math.round(r),"year")}function rO(e,t){const n=[["day",864e5],["hour",36e5],["minute",6e4],["second",1e3]];for(const[r,a]of n)if(e>=a&&e%a===0)return new Intl.NumberFormat(t,{style:"unit",unit:r,unitDisplay:"long",maximumFractionDigits:0}).format(e/a);return new Intl.NumberFormat(t,{style:"unit",unit:"minute",unitDisplay:"long",maximumFractionDigits:1}).format(e/6e4)}const cC=()=>Dl(()=>import("./MarkdownTextRenderer-Cg7UrKJ7.js"),__vite__mapDeps([4,1,0,2,3])),aO=u.lazy(cC),oO=u.memo(function({source:t,className:n,highlightCode:r,onOpenFilePreview:a}){return s.jsx(aO,{className:n,highlightCode:r,onOpenFilePreview:a,children:t})}),sO=80,iO=140,lO=220,cO=16e3;class uO extends u.Component{constructor(){super(...arguments);He(this,"state",{failed:!1})}static getDerivedStateFromError(){return{failed:!0}}render(){return this.state.failed?this.props.fallback:this.props.children}}function Lu(){cC()}function Du({children:e,className:t,streaming:n=!1,onOpenFilePreview:r}){const a=dO(e,n),o=n?a.length<=cO:a===e;u.useEffect(()=>{n&&Lu()},[n]);const i=s.jsx("div",{className:j("whitespace-pre-wrap break-words leading-relaxed text-foreground/92",t),children:a});return s.jsx(uO,{fallback:i,children:s.jsx(u.Suspense,{fallback:i,children:s.jsx(oO,{source:a,className:t,highlightCode:o,onOpenFilePreview:r})})})}function dO(e,t){const[n,r]=u.useState(e),a=u.useRef(e),o=u.useRef(e),i=u.useRef(null),l=u.useCallback(()=>{i.current!==null&&(window.clearTimeout(i.current),i.current=null)},[]),c=u.useCallback((p,m)=>{if(o.current!==p){if(o.current=p,m){r(p);return}u.startTransition(()=>r(p))}},[]),d=u.useCallback(()=>{i.current===null&&(i.current=window.setTimeout(()=>{i.current=null,c(a.current,!1)},pO(a.current.length)))},[c]);return a.current=e,u.useLayoutEffect(()=>{a.current=e,t||(l(),c(e,!0))},[l,c,e,t]),u.useEffect(()=>{a.current=e,t&&d()},[d,e,t]),u.useEffect(()=>l,[l]),n}function pO(e){return e>24e3?lO:e>8e3?iO:sO}function uC(e){return(e.display_name||e.name).split(/\s+/).filter(Boolean).slice(0,2).map(n=>{var r;return(r=n[0])==null?void 0:r.toUpperCase()}).join("")||e.name.slice(0,2).toUpperCase()}function dC(e){return(e.display_name||e.name).split(/\s+/).filter(Boolean).slice(0,2).map(n=>{var r;return(r=n[0])==null?void 0:r.toUpperCase()}).join("")||e.name.slice(0,2).toUpperCase()}function pC(e,t,n=[]){if(!e||t.length===0&&n.length===0)return e?[{kind:"text",text:e}]:[];const r=new Map(t.filter(d=>d.installed).map(d=>[d.name.toLowerCase(),d])),a=new Map(n.filter(d=>d.installed&&d.configured).map(d=>[d.name.toLowerCase(),d]));if(r.size===0&&a.size===0)return[{kind:"text",text:e}];const o=[],i=/(^|[\s([{])@([a-z0-9_-]+)\b/gi;let l=0,c;for(;(c=i.exec(e))!==null;){const d=c[1]??"",p=c[2]??"",m=p.toLowerCase(),f=r.get(m),h=f?null:a.get(m);if(!f&&!h)continue;const y=c.index+d.length,x=y+p.length+1;y>l&&o.push({kind:"text",text:e.slice(l,y)}),f?o.push({kind:"cli",text:e.slice(y,x),app:f}):h&&o.push({kind:"mcp",text:e.slice(y,x),preset:h}),l=x}return l<e.length&&o.push({kind:"text",text:e.slice(l)}),o.length?o:[{kind:"text",text:e}]}function mO({text:e,cliApps:t,mcpPresets:n=[]}){const r=pC(e,t,n);return r.some(a=>a.kind==="cli"||a.kind==="mcp")?s.jsx(s.Fragment,{children:r.map((a,o)=>a.kind==="text"?s.jsx("span",{children:a.text},`text-${o}`):a.kind==="cli"?s.jsx(mC,{app:a.app,label:a.text,variant:"message"},`cli-${a.app.name}-${o}`):s.jsx(fC,{preset:a.preset,label:a.text,variant:"message"},`mcp-${a.preset.name}-${o}`))}):s.jsx(s.Fragment,{children:e})}function mC({app:e,label:t,variant:n,isHero:r=!1}){const[a,o]=u.useState(0),i=e.brand_color||"hsl(var(--primary))",l=t.startsWith("@")?t.slice(1):t,d=u.useMemo(()=>oo(e.logo_url),[e.logo_url])[a],p=!!d,m=n==="composer"?"composer":"message";return u.useEffect(()=>o(0),[e.logo_url]),s.jsxs("span",{"data-testid":`${m}-cli-mention-${e.name}`,title:`CLI app: ${e.display_name||e.name}`,className:"relative inline transition-[color,text-shadow] duration-150",style:{color:i,textShadow:`0 0 10px ${hC(i,24)}`},children:[s.jsxs("span",{className:j("relative inline-block",p&&"text-transparent"),style:{lineHeight:"inherit"},children:["@",p?s.jsx("span",{"data-testid":`${m}-cli-mention-logo-${e.name}`,className:j("absolute left-1/2 top-1/2 grid place-items-center overflow-hidden rounded-[3px]","-translate-x-1/2 -translate-y-1/2",r?"h-[0.74em] w-[0.74em]":"h-[0.72em] w-[0.72em]"),children:s.jsx("img",{src:d??"",alt:"",className:"h-full w-full object-contain",onError:()=>o(f=>f+1)})}):null]}),l]})}function fC({preset:e,label:t,variant:n,isHero:r=!1}){const[a,o]=u.useState(0),i=e.brand_color||"hsl(var(--primary))",l=t.startsWith("@")?t.slice(1):t,d=u.useMemo(()=>oo(e.logo_url),[e.logo_url])[a],p=!!d,m=n==="composer"?"composer":"message";return u.useEffect(()=>o(0),[e.logo_url]),s.jsxs("span",{"data-testid":`${m}-mcp-mention-${e.name}`,title:`MCP server: ${e.display_name||e.name}`,className:"relative inline transition-[color,text-shadow] duration-150",style:{color:i,textShadow:`0 0 10px ${hC(i,24)}`},children:[s.jsxs("span",{className:j("relative inline-block",p&&"text-transparent"),style:{lineHeight:"inherit"},children:["@",p?s.jsx("span",{"data-testid":`${m}-mcp-mention-logo-${e.name}`,className:j("absolute left-1/2 top-1/2 grid place-items-center overflow-hidden rounded-[3px]","-translate-x-1/2 -translate-y-1/2",r?"h-[0.74em] w-[0.74em]":"h-[0.72em] w-[0.72em]"),children:s.jsx("img",{src:d??"",alt:"",className:"h-full w-full object-contain",onError:()=>o(f=>f+1)})}):null]}),l]})}function hC(e,t){if(/^#[0-9a-f]{6}$/i.test(e)){const n=Math.round(t/100*255).toString(16).padStart(2,"0");return`${e}${n}`}return`color-mix(in srgb, ${e} ${t}%, transparent)`}function fO({isHero:e,disabled:t,scope:n,defaultScope:r,controls:a,error:o,onChange:i}){const{t:l}=ie(),[c,d]=u.useState(!1),[p,m]=u.useState(""),[f,h]=u.useState(null),[y,x]=u.useState(!1),b=U5(n,r),v=b?b.project_name||Ri(b.project_path):l("thread.composer.workspace.projectPlaceholder"),g=e&&!!r&&!!i&&(a==null?void 0:a.can_change_project)!==!1,w=Ja(),k=!!w;u.useEffect(()=>{c&&(m((b==null?void 0:b.project_path)??""),h(null))},[b==null?void 0:b.project_path,c]),u.useEffect(()=>{o&&g&&d(!0)},[o,g]);const C=u.useCallback((S,A)=>{const E=n??r,_=S.trim();if(!(!E||!i)){if(!_||!$5(_)){h(l("workspace.dialog.absolutePathRequired"));return}i({...E,project_path:_,project_name:A||Ri(_),restrict_to_workspace:E.access_mode==="restricted"}),h(null),d(!1)}},[r,i,n,l]),N=u.useCallback(async()=>{if(!(!w||t)){x(!0);try{const S=await w.pickFolder();S&&C(S)}catch(S){h(S.message)}finally{x(!1)}}},[C,t,w]);return!g||!r||!i?null:k?s.jsxs("div",{className:"flex min-w-0 items-center rounded-b-[28px] border-t border-border/25 bg-muted/60 px-3 py-1.5 dark:bg-white/[0.055] sm:px-4",children:[s.jsxs("button",{type:"button",disabled:t||y,"aria-label":l("thread.composer.workspace.projectAria"),title:b==null?void 0:b.project_path,onClick:()=>void N(),className:j("inline-flex h-7 max-w-full items-center gap-2 rounded-full px-2.5 sm:max-w-[18rem]","text-[12px] font-medium text-muted-foreground/90 transition-colors","hover:bg-background/70 hover:text-foreground disabled:pointer-events-none disabled:opacity-55",b&&"text-foreground/82"),children:[s.jsx(Gl,{className:j("h-3.5 w-3.5 shrink-0",b&&"text-primary")}),s.jsx("span",{className:"truncate",children:v})]}),f||o?s.jsx("span",{role:"alert",className:"ml-2 min-w-0 truncate text-[11.5px] font-medium text-destructive",children:f??o}):null]}):s.jsx("div",{className:"flex min-w-0 items-center rounded-b-[28px] border-t border-border/25 bg-muted/60 px-3 py-1.5 dark:bg-white/[0.055] sm:px-4",children:s.jsxs(gn,{open:c,onOpenChange:d,children:[s.jsx(vn,{asChild:!0,children:s.jsxs("button",{type:"button",disabled:t,"aria-label":l("thread.composer.workspace.projectAria"),className:j("inline-flex h-7 max-w-full items-center gap-2 rounded-full px-2.5 sm:max-w-[18rem]","text-[12px] font-medium text-muted-foreground/90 transition-colors","hover:bg-background/70 hover:text-foreground disabled:pointer-events-none disabled:opacity-55",b&&"text-foreground/82"),children:[s.jsx(Gl,{className:j("h-3.5 w-3.5 shrink-0",b&&"text-primary")}),s.jsx("span",{className:"truncate",children:v}),s.jsx(yr,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"})]})}),s.jsxs(ln,{align:"start",side:"bottom",sideOffset:8,className:"w-[min(25rem,calc(100vw-2rem))] rounded-[22px]",children:[s.jsxs(gt,{onSelect:()=>C(r.project_path,r.project_name),className:"flex min-h-[48px] cursor-default gap-3 rounded-[16px] px-3 py-2.5 focus:bg-muted/55",children:[s.jsx("span",{className:"grid h-8 w-8 shrink-0 place-items-center rounded-[12px] bg-muted text-foreground/80",children:s.jsx(Gl,{className:"h-4 w-4"})}),s.jsxs("span",{className:"min-w-0 flex-1",children:[s.jsx("span",{className:"block truncate text-[13px] font-semibold text-foreground",children:l("workspace.dialog.defaultProject")}),s.jsx("span",{className:"block truncate text-[11.5px] text-muted-foreground",children:c1(r.project_path)})]}),b?null:s.jsx(Et,{className:"h-4 w-4 text-foreground/80"})]}),s.jsx("div",{className:"my-1 h-px bg-border/45"}),s.jsxs("div",{className:"space-y-1.5 px-1.5 py-1.5",onKeyDown:S=>{S.key!=="Escape"&&S.stopPropagation()},children:[s.jsxs("form",{className:"flex items-center gap-2",onSubmit:S=>{S.preventDefault(),C(p)},children:[s.jsx(Ye,{value:p,disabled:t,onChange:S=>{m(S.target.value),h(null)},placeholder:l("workspace.dialog.manualPlaceholder"),"aria-label":l("workspace.dialog.manual"),className:j("h-9 rounded-full border-border/55 bg-background/80 px-3 text-[12.5px]","focus-visible:ring-1 focus-visible:ring-foreground/10 focus-visible:ring-offset-0")}),s.jsx(fe,{type:"submit",disabled:t||!p.trim(),className:"h-9 shrink-0 rounded-full px-3 text-[12px]",children:l("workspace.dialog.usePath")})]}),f||o?s.jsx("p",{role:"alert",className:"px-1 text-[11.5px] font-medium text-destructive",children:f??o}):null]})]})]})})}function hO({scope:e,disabled:t,canUseFullAccess:n,isHero:r,onChange:a}){const{t:o}=ie(),i=e.access_mode,l=i==="full",c=d=>{d==="full"&&!n||d!==i&&(a==null||a(z5(e,d)))};return s.jsxs(gn,{children:[s.jsx(vn,{asChild:!0,disabled:t||!a,children:s.jsxs(fe,{type:"button",variant:"ghost","aria-label":o("thread.composer.workspace.accessAria"),className:j("max-w-[min(12.5rem,42vw)] rounded-[10px] border border-transparent font-semibold shadow-none",r?"h-8 px-2.5 text-[12px]":"h-9 px-3 text-[12.5px]",l?"bg-transparent text-orange-600 hover:bg-orange-500/8 dark:text-orange-300 dark:hover:bg-orange-400/10":"bg-transparent text-muted-foreground hover:bg-foreground/[0.045] hover:text-foreground dark:hover:bg-white/[0.06]"),children:[l?s.jsx(Wp,{className:j("mr-1.5 shrink-0","h-3.5 w-3.5")}):s.jsx(dg,{className:j("mr-1.5 shrink-0","h-3.5 w-3.5")}),s.jsx("span",{className:"truncate",children:o(l?"thread.composer.workspace.full":"thread.composer.workspace.default")}),s.jsx(yr,{className:j("ml-1.5 shrink-0","h-3 w-3")})]})}),s.jsxs(ln,{align:"start",className:"w-56",children:[s.jsx(Kv,{icon:s.jsx(dg,{className:"h-4 w-4"}),label:o("thread.composer.workspace.default"),selected:i==="restricted",onSelect:()=>c("restricted")}),s.jsx(Kv,{icon:s.jsx(Wp,{className:"h-4 w-4"}),label:o("thread.composer.workspace.full"),selected:i==="full",disabled:!n,warning:!0,onSelect:()=>c("full")})]})]})}function Kv({icon:e,label:t,selected:n,disabled:r,warning:a,onSelect:o}){return s.jsxs(gt,{disabled:r,onSelect:o,className:j("flex h-10 items-center gap-3 rounded-xl px-3 text-[13.5px] font-semibold",a&&"text-orange-600 focus:text-orange-600 dark:text-orange-300 dark:focus:text-orange-300"),children:[s.jsx("span",{className:"grid h-5 w-5 shrink-0 place-items-center text-current","aria-hidden":!0,children:e}),s.jsx("span",{className:"min-w-0 flex-1 truncate",children:t}),n?s.jsx(Et,{className:"h-4 w-4 shrink-0","aria-hidden":!0}):null]})}const gC=6*1024*1024,gO=2048,vO=.85,xO=new Set(["image/jpeg","image/webp"]),Vv=new Set(["image/png","image/jpeg","image/webp","image/gif"]);function yO(e){if(e.length>=8&&e[0]===137&&e[1]===80&&e[2]===78&&e[3]===71&&e[4]===13&&e[5]===10&&e[6]===26&&e[7]===10)return"image/png";if(e.length>=3&&e[0]===255&&e[1]===216&&e[2]===255)return"image/jpeg";if(e.length>=6&&e[0]===71&&e[1]===73&&e[2]===70&&e[3]===56&&e[5]===97&&(e[4]===55||e[4]===57))return"image/gif";if(e.length>=12){const t=e[0]===82&&e[1]===73&&e[2]===70&&e[3]===70,n=e[8]===87&&e[9]===69&&e[10]===66&&e[11]===80;if(t&&n)return"image/webp"}return null}function vC(e){const t=new Uint8Array(e);let n="";const r=32768;for(let a=0;a<t.length;a+=r)n+=String.fromCharCode.apply(null,t.subarray(a,a+r));return self.btoa(n)}function bO(e,t,n){const r=Math.max(e,t);if(r<=n)return{w:e,h:t};const a=n/r;return{w:Math.max(1,Math.round(e*a)),h:Math.max(1,Math.round(t*a))}}async function wO(e,t){const n=xO.has(t)?"image/webp":"image/png";let r;try{r=await createImageBitmap(e)}catch{return{error:"decode_failed"}}const{w:a,h:o}=bO(r.width,r.height,gO);try{const i=new OffscreenCanvas(a,o),l=i.getContext("2d",{alpha:!0});if(!l)return r.close(),{error:"decode_failed"};l.imageSmoothingQuality="high",l.drawImage(r,0,0,a,o),r.close();const c={type:n};n==="image/webp"&&(c.quality=vO);const d=await i.convertToBlob(c);if(d.size>gC)return{error:"too_large_after_normalize"};const p=await d.arrayBuffer();return{dataUrl:`data:${n};base64,${vC(p)}`,mime:n,bytes:d.size}}catch{try{r.close()}catch{}return{error:"decode_failed"}}}async function xC(e){const{id:t,file:n}=e,r=n.size;let a;try{a=await n.arrayBuffer()}catch{return{id:t,ok:!1,reason:"io"}}const o=new Uint8Array(a.slice(0,12)),i=yO(o);if(!i)return{id:t,ok:!1,reason:"magic_mismatch"};if(!Vv.has(i))return{id:t,ok:!1,reason:"invalid_mime"};if(n.type&&Vv.has(n.type)&&n.type,r<=gC){const c=`data:${i};base64,${vC(a)}`;return{id:t,ok:!0,dataUrl:c,mime:i,bytes:r,origBytes:r,normalized:!1}}const l=await wO(n,i);return"error"in l?{id:t,ok:!1,reason:l.error}:{id:t,ok:!0,dataUrl:l.dataUrl,mime:l.mime,bytes:l.bytes,origBytes:r,normalized:!0}}typeof self<"u"&&typeof self.importScripts=="function"&&self.addEventListener("message",async e=>{const t=await xC(e.data);self.postMessage(t)});let cr=null,Gv=!1;const Eo=new Map;function kO(){if(Gv)return cr;if(Gv=!0,typeof Worker>"u")return null;try{return cr=new Worker(new URL("/assets/imageEncode.worker-Cs1P3eq4.js",import.meta.url),{type:"module"}),cr.addEventListener("message",e=>{const t=Eo.get(e.data.id);t&&(Eo.delete(e.data.id),t.resolve(e.data))}),cr.addEventListener("error",e=>{for(const[,t]of Eo)t.reject(new Error(`image encoder worker error: ${e.message}`));Eo.clear(),cr==null||cr.terminate(),cr=null}),cr}catch{return cr=null,null}}function CO(){return typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID():`img-${Date.now()}-${Math.random().toString(36).slice(2)}`}async function SO(e){const t=CO(),n=kO();return n?new Promise((r,a)=>{Eo.set(t,{resolve:r,reject:a});try{n.postMessage({id:t,file:e})}catch(o){Eo.delete(t),a(o instanceof Error?o:new Error(String(o)))}}):xC({id:t,file:e})}const Ko=4,Yv=new Set(["image/png","image/jpeg","image/webp","image/gif"]);function yC(e){const t=/^data:([^;,]+)[;,]/.exec(e);return(t==null?void 0:t[1])||"image/png"}function NO(e,t){const n=yC(e),r=`image.${n.split("/")[1]||"png"}`;try{const[,a=""]=e.split(",",2),o=atob(a),i=new Uint8Array(o.length);for(let l=0;l<o.length;l+=1)i[l]=o.charCodeAt(l);return new File([i],t||r,{type:n})}catch{return new File([],t||r,{type:n})}}function Qv(){return typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID():`img-${Date.now()}-${Math.random().toString(36).slice(2)}`}function jO(e){switch(e){case"invalid_mime":case"magic_mismatch":return"magic_mismatch";case"too_large_after_normalize":return"too_large";case"io":return"io";case"decode_failed":default:return"decode_failed"}}function AO(){const[e,t]=u.useState([]),n=u.useRef([]);n.current=e;const r=u.useCallback((p,m)=>{t(f=>{const h=f.map(y=>y.id===p?{...y,...m}:y);return n.current=h,h})},[]),a=u.useCallback(p=>{const m=[],f=[];let h=Ko-n.current.length;for(const y of p){if(!Yv.has(y.type)){m.push({file:y,reason:"unsupported_type"});continue}if(h<=0){m.push({file:y,reason:"too_many_images"});continue}h-=1,f.push({id:Qv(),file:y,previewUrl:URL.createObjectURL(y),status:"encoding"})}if(f.length>0){const y=[...n.current,...f];n.current=y,t(y);for(const x of f)queueMicrotask(()=>{SO(x.file).then(b=>{b.ok?r(x.id,{status:"ready",dataUrl:b.dataUrl,encodedBytes:b.bytes,normalized:b.normalized}):r(x.id,{status:"error",error:jO(b.reason)})},()=>{r(x.id,{status:"error",error:"decode_failed"})})})}return{rejected:m}},[r]),o=u.useCallback(p=>{let m=null;return t(f=>{const h=f.findIndex(v=>v.id===p);if(h===-1)return f;const y=f[h];try{URL.revokeObjectURL(y.previewUrl)}catch{}const x=[...f.slice(0,h),...f.slice(h+1)];n.current=x;const b=x[h]??x[h-1];return m=(b==null?void 0:b.id)??null,x}),{nextFocusId:m}},[]),i=u.useCallback(()=>{t(p=>{for(const m of p)try{URL.revokeObjectURL(m.previewUrl)}catch{}return n.current=[],[]})},[]),l=u.useCallback(p=>{const m=p.filter(f=>Yv.has(yC(f.dataUrl))).slice(0,Ko).map(f=>{const h=NO(f.dataUrl,f.name);return{id:Qv(),file:h,previewUrl:f.dataUrl,status:"ready",dataUrl:f.dataUrl,encodedBytes:h.size}});t(f=>{for(const h of f)try{URL.revokeObjectURL(h.previewUrl)}catch{}return n.current=m,m})},[]);u.useEffect(()=>()=>{for(const p of n.current)try{URL.revokeObjectURL(p.previewUrl)}catch{}},[]);const c=e.some(p=>p.status==="encoding"),d=e.length>=Ko;return{images:e,enqueue:a,remove:o,clear:i,restoreReadyImages:l,encoding:c,full:d}}function _O(e){const t=e.clipboardData??e.clipboardData;if(!t)return[];const n=[];for(const r of Array.from(t.items)){if(r.kind!=="file"||!r.type.startsWith("image/"))continue;const a=r.getAsFile();a&&n.push(a)}return n}function PO(e){const t=e.dataTransfer??e.dataTransfer;if(!t)return[];const n=[];for(const r of Array.from(t.files))r.type.startsWith("image/")&&n.push(r);return n}function TO(e){const[t,n]=u.useState(!1),r=u.useRef(0),a=u.useCallback(d=>{const p=_O(d);p.length!==0&&(d.preventDefault(),e(p))},[e]),o=u.useCallback(d=>{Array.from(d.dataTransfer.types??[]).includes("Files")&&(d.preventDefault(),r.current+=1,n(!0))},[]),i=u.useCallback(d=>{Array.from(d.dataTransfer.types??[]).includes("Files")&&(d.preventDefault(),d.dataTransfer.dropEffect="copy")},[]),l=u.useCallback(d=>{Array.from(d.dataTransfer.types??[]).includes("Files")&&(d.preventDefault(),r.current=Math.max(0,r.current-1),r.current===0&&n(!1))},[]),c=u.useCallback(d=>{r.current=0,n(!1);const p=PO(d);p.length!==0&&(d.preventDefault(),e(p))},[e]);return{isDragging:t,onPaste:a,onDragEnter:o,onDragOver:i,onDragLeave:l,onDrop:c}}const RO=12e4,MO=650,EO=1100,IO=140,LO=64,bC=3,Xv=7,DO=34,Vo=.018,Jv=Array.from({length:LO},()=>bC),OO=["audio/webm;codecs=opus","audio/webm","audio/mp4","audio/ogg;codecs=opus"];function FO({disabled:e,onClearError:t,onError:n,onTranscript:r,onTranscribeAudio:a}){const o=u.useRef(null),i=u.useRef([]),l=u.useRef(null),c=u.useRef(null),d=u.useRef(0),p=u.useRef(null),m=u.useRef(null),f=u.useRef(null),h=u.useRef(!1),y=u.useRef(!1),x=u.useRef(!1),b=u.useRef(!1),v=u.useRef(null),g=u.useRef(!1),w=u.useRef(!1),k=u.useRef(0),C=u.useRef(!1),N=u.useRef(!1),[S,A]=u.useState("idle"),[E,_]=u.useState(0),[R,T]=u.useState(Jv),F=u.useCallback(()=>xo(m),[]),z=u.useCallback(()=>xo(v),[]),K=u.useCallback(()=>{z(),b.current=!0,v.current=setTimeout(()=>{b.current=!1,v.current=null},500)},[z]),$=u.useCallback(()=>{const O=c.current;c.current=null,O&&(O.frame!==null&&cancelAnimationFrame(O.frame),O.source.disconnect(),O.analyser.disconnect(),O.context.close().catch(()=>{}))},[]),W=u.useCallback(O=>{const ne=UO();if(ne){$(),T(Jv);try{const he=new ne,ve=he.createMediaStreamSource(O),me=he.createAnalyser();me.fftSize=256,me.smoothingTimeConstant=.68,ve.connect(me);const ee={analyser:me,context:he,data:new Uint8Array(me.fftSize),frame:null,source:ve},we=()=>{const je=c.current;if(!je)return;if(je.context.state!=="running"){je.context.resume().catch(()=>{}),je.frame=requestAnimationFrame(we);return}je.analyser.getByteTimeDomainData(je.data);const xe=BO(je.data);C.current=!0,w.current=!0,k.current=Math.max(k.current,xe),xe>=Vo&&(F(),N.current&&(N.current=!1,t())),T(Ee=>[...Ee.slice(1),HO(xe)]),je.frame=requestAnimationFrame(we)};c.current=ee,he.resume().catch(()=>{}),ee.frame=requestAnimationFrame(we)}catch{$()}}},[F,t,$]),P=u.useCallback(()=>{var O;xo(f),F(),xo(p),$(),(O=l.current)==null||O.getTracks().forEach(ne=>ne.stop()),l.current=null,o.current=null,y.current=!1,g.current=!1,N.current=!1},[F,$]),D=u.useCallback(()=>{const O=o.current;!O||O.state==="inactive"||O.stop()},[]),G=u.useCallback(()=>{const O=o.current;O&&O.state!=="inactive"?D():y.current&&(x.current=!0)},[D]),Y=u.useCallback(async()=>{var O;if(!(!a||S!=="idle"||y.current)){if(!((O=navigator.mediaDevices)!=null&&O.getUserMedia)||typeof MediaRecorder>"u"){n("unsupported");return}y.current=!0;try{const ne=await navigator.mediaDevices.getUserMedia({audio:!0}),he=new MediaRecorder(ne,zO());i.current=[],l.current=ne,o.current=he,d.current=Date.now(),w.current=!1,k.current=0,C.current=!1,N.current=!1,_(0),W(ne),he.ondataavailable=ve=>{ve.data.size>0&&i.current.push(ve.data)},he.onstop=()=>{const ve=i.current.splice(0),me=Math.max(0,Date.now()-d.current),ee=he.mimeType||"audio/webm",we=C.current&&w.current&&k.current<Vo;if(P(),ve.length===0){A("idle");return}if(me<MO){A("idle"),n("tooShort");return}if(we){A("idle"),n("noInput");return}A("transcribing"),WO(new Blob(ve,{type:ee})).then(je=>a(je,{durationMs:me})).then(r).catch(je=>n(qO(je))).finally(()=>A("idle"))},he.start(),A("recording"),t(),p.current=setTimeout(D,RO),m.current=setTimeout(()=>{var me;!(((me=o.current)==null?void 0:me.state)==="recording")||!C.current||!w.current||k.current>=Vo||(N.current=!0,n("noInput"))},EO)}catch{P(),A("idle"),n("permission")}}},[P,t,n,a,r,W,S,D]),oe=u.useCallback(()=>{x.current=!1,Y().then(()=>{x.current&&(x.current=!1,D())})},[Y,D]),de=u.useCallback(O=>{if(!(O.pointerType==="mouse"&&O.button!==0)&&!(!a||e||S!=="idle")){xo(f);try{O.currentTarget.setPointerCapture(O.pointerId)}catch{}f.current=setTimeout(()=>{f.current=null,h.current=!0,K(),oe()},IO)}},[e,a,oe,S,K]),pe=u.useCallback(()=>{const O=h.current;xo(f),O&&(h.current=!1,K(),G())},[G,K]),le=u.useCallback(()=>{if(b.current){z(),b.current=!1;return}S==="recording"?D():Y()},[z,Y,S,D]),I=u.useCallback(()=>{!a||e||S!=="idle"||g.current||(g.current=!0,oe())},[e,a,oe,S]),Q=u.useCallback(()=>{g.current&&(g.current=!1,G())},[G]);return u.useEffect(()=>{if(S!=="recording"){_(0);return}const O=()=>{_(Math.max(0,Date.now()-d.current))};O();const ne=window.setInterval(O,250);return()=>window.clearInterval(ne)},[S]),u.useEffect(()=>P,[P]),u.useEffect(()=>()=>z(),[z]),{beginShortcutHold:I,beginPress:de,buttonDisabled:e||S==="transcribing",elapsedLabel:$O(E),endShortcutHold:Q,endPress:pe,handleClick:le,isRecording:S==="recording",levels:R,state:S}}function xo(e){e.current!==null&&(clearTimeout(e.current),e.current=null)}function zO(){if(typeof MediaRecorder>"u")return;const e=OO.find(t=>MediaRecorder.isTypeSupported(t));return e?{mimeType:e}:void 0}function $O(e){const t=Math.max(0,Math.floor(e/1e3));return`${Math.floor(t/60)}:${String(t%60).padStart(2,"0")}`}function UO(){if(!(typeof window>"u"))return window.AudioContext??window.webkitAudioContext}function BO(e){if(e.length===0)return 0;let t=0;for(let r=0;r<e.length;r+=1){const a=(e[r]-128)/128;t+=a*a}const n=Math.sqrt(t/e.length);return Math.min(1,Math.pow(n*4.2,.72))}function HO(e){if(e<Vo)return bC;const t=Math.min(1,(e-Vo)/(1-Vo));return Math.round(Xv+t*(DO-Xv))}function WO(e){return new Promise((t,n)=>{const r=new FileReader;r.onload=()=>{typeof r.result=="string"?t(r.result):n(new Error("invalid_data_url"))},r.onerror=()=>n(r.error??new Error("read_failed")),r.readAsDataURL(e)})}function qO(e){const t=e instanceof Error?e.message:"";return t==="not_configured"?"notConfigured":t==="duration"?"tooLong":"failed"}const KO="image/png,image/jpeg,image/webp,image/gif",VO=".md,.txt,text/markdown,text/plain",Hc=6,Zv=2e5,wC="KeyD",GO="Control+Shift+D";function Jl(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function YO(e){return e.code===wC&&e.ctrlKey&&e.shiftKey&&!e.altKey&&!e.metaKey}function QO(e){return e.code===wC||e.key==="Control"||e.key==="Shift"}function XO(){if(typeof navigator>"u")return"other";const e=navigator.userAgentData,t=[e==null?void 0:e.platform,navigator.platform,navigator.userAgent].filter(Boolean).join(" ").toLowerCase();return navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1||/mac|iphone|ipad|ipod/.test(t)?"apple":/win/.test(t)?"windows":/cros/.test(t)?"chromeos":/linux|x11|android/.test(t)?"linux":"other"}function JO(){switch(XO()){case"apple":return"⌃⇧D";case"chromeos":case"linux":case"windows":case"other":return"Ctrl ⇧ D"}}const ZO={activity:Gb,"book-open":Bp,brain:Ga,"circle-help":ff,history:oA,"rotate-cw":hA,shield:vA,sparkles:$o,square:Hp,"square-pen":xf,"undo-2":wA},ex=8,tx=288,eF=144,kC=12,CC="nanobot.webui.slashCommandRecents",Zf=5,tF="nanobot.webui.composerQueuedGuidance.v1:",SC=20,NC=4e3;function nF({ariaLabel:e,className:t,elapsedLabel:n,isHero:r,levels:a}){return s.jsxs("div",{className:j("flex min-w-0 items-center gap-2 text-neutral-700 dark:text-white",r?"h-8":"h-9",t),"aria-live":"polite","aria-label":e,children:[s.jsx("span",{className:"flex h-5 min-w-0 flex-1 items-center justify-between overflow-hidden","aria-hidden":!0,children:a.map((o,i)=>s.jsx("span",{className:"w-[2px] rounded-full bg-current opacity-85 transition-[height] duration-75 ease-linear motion-reduce:transition-none",style:{height:o}},i))}),s.jsx("span",{className:"min-w-[2.1rem] text-right text-[12px] font-medium tabular-nums text-muted-foreground",children:n})]})}function gm(e){return e.replace(/^\//,"").replace(/-/g,"_")}function rF(){if(typeof window>"u")return[];try{const e=window.localStorage.getItem(CC),t=e?JSON.parse(e):[];return Array.isArray(t)?t.filter(n=>typeof n=="string").slice(0,Zf):[]}catch{return[]}}function aF(e){if(!(typeof window>"u"))try{window.localStorage.setItem(CC,JSON.stringify(e.slice(0,Zf)))}catch{}}function oF(e){const t=e==null?void 0:e.trim();return t?`${tF}${t}`:null}function sF(e,t){if(!e||typeof e!="object")return null;const n=e;if(typeof n.text!="string")return null;const r=n.text.trim().slice(0,NC),a=Array.isArray(n.images)?n.images.flatMap(i=>{if(!i||typeof i!="object")return[];const l=i;return typeof l.dataUrl!="string"||!l.dataUrl.startsWith("data:image/")?[]:[{dataUrl:l.dataUrl,...typeof l.name=="string"&&l.name.trim()?{name:l.name.trim()}:{}}]}).slice(0,Ko):[];return!r&&a.length===0?null:{id:typeof n.id=="string"&&n.id.trim()?n.id:`queued-prompt-restored-${t}`,text:r,...a.length>0?{images:a}:{}}}function iF(e){if(typeof window>"u")return[];try{const t=window.localStorage.getItem(e),n=t?JSON.parse(t):[];return Array.isArray(n)?n.map((r,a)=>sF(r,a)).filter(r=>r!=null).slice(0,SC):[]}catch{return[]}}function lF(e,t){if(!(typeof window>"u"))try{if(t.length===0){window.localStorage.removeItem(e);return}window.localStorage.setItem(e,JSON.stringify(t.slice(0,SC).map(n=>{var r;return{id:n.id,text:n.text.slice(0,NC),...(r=n.images)!=null&&r.length?{images:n.images.slice(0,Ko)}:{}}})))}catch{}}function cF(e){return e.map(t=>({dataUrl:t.dataUrl,name:t.file.name}))}function nx(e){if(e!=null&&e.length)return e.map(t=>({media:{data_url:t.dataUrl,...t.name?{name:t.name}:{}},preview:{url:t.dataUrl,...t.name?{name:t.name}:{}}}))}function uF(e){var n;const t=e.text.trim();return t||((n=e.images)==null?void 0:n.map(r=>r.name).filter(Boolean).join(", "))||"Image attachment"}function dF(e){return e.name.toLowerCase().endsWith(".md")||e.type==="text/markdown"?"text/markdown":"text/plain"}async function pF(e){if(e.length>Hc)return{ok:!1,error:`最多添加 ${Hc} 个文本附件。`};const t=[];for(const n of e){const r=await n.text();if(r.length>Zv)return{ok:!1,error:`${n.name} 过大,请控制在 ${Math.round(Zv/1e3)}KB 文本以内。`};t.push({id:`${n.name}-${n.size}-${n.lastModified}`,file:n,content:r,kind:dF(n)})}return{ok:!0,attachments:t}}function mF(e){if(typeof document>"u"||typeof e.setDragImage!="function")return;const t=document.createElement("div");t.style.position="fixed",t.style.left="-9999px",t.style.top="-9999px",t.style.width="1px",t.style.height="1px",t.style.opacity="0",document.body.appendChild(t);try{e.setDragImage(t,0,0)}catch{t.remove();return}window.setTimeout(()=>t.remove(),0)}function jC(){const e=window.visualViewport;if(!e)return{top:0,bottom:window.innerHeight,height:window.innerHeight};const t=Math.max(0,e.offsetTop),n=Math.max(0,e.height);return{top:t,bottom:t+n,height:n}}function fF(e){const t=jC();let n=t.top,r=t.bottom,a=e.parentElement;for(;a;){const o=window.getComputedStyle(a);if(/(auto|scroll|hidden|clip)/.test(o.overflowY)){const i=a.getBoundingClientRect();n=Math.max(n,i.top),r=Math.min(r,i.bottom)}a=a.parentElement}return{top:n,bottom:r}}function hF(e,t){var a,o;if(!(e!=null&&e.active))return null;const n=(a=e.ui_summary)==null?void 0:a.trim();if(n)return n;const r=(o=e.objective)==null?void 0:o.trim();return r?r.length>72?`${r.slice(0,72)}…`:r:t("thread.composer.goalStateFallback")}const gF=20,vF=10,xF=112,yF=.62;function bF(e){const t=jC(),n=e-t.top-gF-vF;return Math.min(Math.max(n,xF),Math.floor(t.height*yF))}function wF(e,t){const n=e.trim(),r=t.trim();return n&&r?`${n}
---
${r}`:r||n}function kF(e){return{name:e.name,display_name:e.display_name,category:e.category,entry_point:e.entry_point,logo_url:e.logo_url??null,brand_color:e.brand_color??null}}function CF(e){return{name:e.name,display_name:e.display_name,category:e.category,transport:e.transport,status:e.status,configured:e.configured,logo_url:e.logo_url??null,brand_color:e.brand_color??null}}function SF(){return s.jsxs("span",{className:"run-pulse-icon relative flex h-4 w-4 shrink-0 items-center justify-center","aria-hidden":!0,children:[s.jsx("span",{className:"run-pulse-icon__ring"}),s.jsx("span",{className:"run-pulse-icon__dot"})]})}function NF({startedAt:e,goalState:t}){var Y,oe;const{t:n}=ie(),[r,a]=u.useState(!1),o=e!=null,i=hF(t,n),l=!!(i!=null&&i.trim()),c=o||l,[d,p]=u.useState(c),[m,f]=u.useState(!1),[,h]=u.useState(0),y=u.useRef(null),x=u.useRef(null),b=u.useRef(null),v=u.useRef(null),[g,w]=u.useState(280);c&&(v.current={startedAt:e,goalState:t,stripLabel:i}),u.useEffect(()=>{if(c){p(!0),f(!1);return}if(a(!1),!d)return;f(!0);const de=window.setTimeout(()=>{p(!1),f(!1)},180);return()=>window.clearTimeout(de)},[c,d]),u.useEffect(()=>{if(e==null)return;const de=window.setInterval(()=>h(pe=>pe+1),1e3);return()=>window.clearInterval(de)},[e]);const k=c?{startedAt:e,goalState:t,stripLabel:i}:v.current,C=(k==null?void 0:k.startedAt)??null,N=k==null?void 0:k.goalState,S=(k==null?void 0:k.stripLabel)??null,A=C!=null,E=!!(S!=null&&S.trim()),_=((Y=N==null?void 0:N.objective)==null?void 0:Y.trim())??"",R=((oe=N==null?void 0:N.ui_summary)==null?void 0:oe.trim())??"",T=!!(c&&(N!=null&&N.active)&&(_||R)),F=_||R?wF(R,_):"";if(u.useLayoutEffect(()=>{if(!r)return;function de(){const I=y.current;if(!I)return;const Q=I.getBoundingClientRect().top;w(bF(Q))}de(),Lu();const pe=typeof ResizeObserver<"u"?new ResizeObserver(()=>de()):null;y.current&&pe&&pe.observe(y.current);const le=window.visualViewport;return le==null||le.addEventListener("resize",de),le==null||le.addEventListener("scroll",de),window.addEventListener("resize",de),window.addEventListener("scroll",de,!0),()=>{pe==null||pe.disconnect(),le==null||le.removeEventListener("resize",de),le==null||le.removeEventListener("scroll",de),window.removeEventListener("resize",de),window.removeEventListener("scroll",de,!0)}},[r]),u.useEffect(()=>{if(!r)return;function de(le){var Q,O;const I=le.target;I&&((Q=x.current)!=null&&Q.contains(I)||(O=b.current)!=null&&O.contains(I)||a(!1))}function pe(le){le.key==="Escape"&&a(!1)}return window.addEventListener("mousedown",de),window.addEventListener("keydown",pe),()=>{window.removeEventListener("mousedown",de),window.removeEventListener("keydown",pe)}},[r]),!d||!k)return null;const z=C!=null?Math.max(0,Math.floor(Date.now()/1e3-C)):0,K=Math.floor(z/60),$=z%60,W=K>0?`${K}:${$.toString().padStart(2,"0")}`:`${$}s`,P=A?n("thread.composer.runRuntimeTitle",{elapsed:W}):null,G=[P,E?S:null].filter(Boolean).join(" · ");return s.jsxs("div",{ref:y,className:"composer-status-strip relative z-30","data-state":m?"exit":"enter",children:[r&&T&&F?s.jsxs("div",{ref:x,id:"nanobot-goal-panel-root",role:"dialog","aria-modal":"false","aria-labelledby":"nanobot-goal-panel-title",tabIndex:-1,className:j("absolute bottom-[calc(100%+8px)] left-3 right-3 z-[50] flex max-w-none flex-col overflow-hidden","rounded-2xl border border-black/[0.08] bg-card shadow-[0_12px_40px_rgba(15,23,42,0.14)]","backdrop-blur-sm dark:border-white/[0.1] dark:shadow-[0_16px_48px_rgba(0,0,0,0.45)]"),style:{maxHeight:`${Math.round(g)}px`},children:[s.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-2 border-b border-black/[0.06] px-3 py-2 dark:border-white/[0.08]",children:[s.jsx("h2",{id:"nanobot-goal-panel-title",className:"min-w-0 truncate text-[13px] font-semibold tracking-tight text-foreground",children:n("thread.composer.goalStateSheetTitle")}),s.jsx("button",{type:"button",className:j("inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-full","text-muted-foreground transition-colors hover:bg-muted/65 hover:text-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"),"aria-label":n("thread.composer.goalStateCloseAria"),onClick:()=>a(!1),children:s.jsx(xr,{className:"h-4 w-4","aria-hidden":!0})})]}),s.jsx("div",{id:"nanobot-goal-panel-scroll",className:"min-h-0 flex-1 overflow-y-auto scrollbar-thin px-3 pb-3 pt-2",children:s.jsx(Du,{className:"max-w-none text-[13.5px] leading-relaxed text-foreground/90",children:F})})]}):null,s.jsxs("div",{className:"flex min-h-[36px] items-center gap-2 border-b border-black/[0.04] px-3 py-2 dark:border-white/[0.06]",role:"status","aria-label":G,children:[A?s.jsx(SF,{}):s.jsx(yA,{className:"h-4 w-4 shrink-0 text-primary/75","aria-hidden":!0}),s.jsxs("span",{className:"flex min-w-0 flex-1 items-center gap-1.5 text-[12px] font-medium text-foreground/75",children:[P?s.jsx("span",{className:"shrink-0",children:P}):null,P&&E?s.jsx("span",{className:"shrink-0 text-muted-foreground/45","aria-hidden":!0,children:"·"}):null,E?s.jsx("span",{className:"truncate",children:n("thread.composer.goalStateStrip",{label:S})}):null]}),T?s.jsx("button",{ref:b,type:"button",className:j("inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-full","text-muted-foreground transition-colors hover:bg-muted/55 hover:text-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"),"aria-expanded":r,"aria-controls":r?"nanobot-goal-panel-root":void 0,"aria-label":n("thread.composer.goalStateExpandAria"),title:n("thread.composer.goalStateExpandAria"),onClick:()=>a(de=>!de),children:r?s.jsx(yr,{className:"h-4 w-4","aria-hidden":!0}):s.jsx(Vj,{className:"h-4 w-4","aria-hidden":!0})}):null]})]})}function rx({onSend:e,disabled:t,placeholder:n,isStreaming:r=!1,modelLabel:a=null,modelProvider:o=null,modelProviderLabel:i=null,modelNeedsSetup:l=!1,onModelBadgeClick:c,variant:d="thread",slashCommands:p=[],cliApps:m=[],mcpPresets:f=[],onStop:h,onTranscribeAudio:y,runStartedAt:x=null,goalState:b,workspaceScope:v=null,workspaceDefaultScope:g=null,workspaceControls:w=null,workspaceScopeDisabled:k=!1,workspaceError:C=null,onWorkspaceScopeChange:N,pendingQueueKey:S=null}){const{t:A}=ie(),[E,_]=u.useState(""),[R,T]=u.useState(null),[F,z]=u.useState(!1),[K,$]=u.useState(0),[W,P]=u.useState(!1),[D,G]=u.useState(0),[Y,oe]=u.useState(0),[de,pe]=u.useState(()=>rF()),[le,I]=u.useState([]),Q=u.useRef(null),O=u.useRef(null),ne=u.useRef(null),he=u.useRef(null),ve=u.useRef(new Map),me=u.useRef(0),ee=u.useRef(null),we=u.useRef(S),je=u.useRef(r),xe=u.useRef(!1),Ee=u.useRef(!1),$e=u.useRef(!1),[Se,Fe]=u.useState([]),B=d==="hero",X=u.useMemo(JO,[]),J=u.useMemo(()=>oF(S),[S]),ye=B&&!!g&&!!N&&(w==null?void 0:w.can_change_project)!==!1;u.useEffect(()=>{Ee.current=!0,I(J?iF(J):[])},[J]),u.useEffect(()=>{if(J){if(Ee.current){Ee.current=!1;return}lF(J,le)}},[J,le]);const Ie=r?A("thread.composer.placeholderStreaming"):n??A("thread.composer.placeholderThread"),{images:Ne,enqueue:Je,remove:ue,clear:Be,restoreReadyImages:ze,encoding:We,full:nr}=AO(),xn=u.useCallback(L=>{const U=`thread.composer.imageRejected.${L}`;return A(U,{max:Ko})},[A]),Qe=u.useCallback(L=>{if(L.length===0)return;const{rejected:U}=Je(L);U.length>0?T(xn(U[0].reason)):T(null)},[Je,xn]),{isDragging:yn,onPaste:rr,onDragEnter:cn,onDragOver:zt,onDragLeave:jt,onDrop:Vr}=TO(Qe);u.useEffect(()=>{if(t)return;const L=Q.current;if(!L)return;const U=requestAnimationFrame(()=>L.focus());return()=>cancelAnimationFrame(U)},[t]);const kt=u.useMemo(()=>Ne.filter(L=>L.status==="ready"&&typeof L.dataUrl=="string"),[Ne]),ar=Ne.some(L=>L.status==="error"),Cr=E.trim().length>0||kt.length>0||Se.length>0,Hn=!t&&!l&&!We&&!ar&&Cr,bn=!!(l&&c&&!t),or=r&&!t&&!l&&!We&&!ar&&Se.length===0&&Cr&&!E.trimStart().startsWith("/"),Ze=u.useMemo(()=>{if(t||F||!E.startsWith("/"))return null;const L=E.slice(1);return/\s/.test(L)?null:L.toLowerCase()},[t,F,E]),Sr=u.useMemo(()=>{const L=p.filter(Z=>Z.command!=="/stop");return r&&h?[p.find(Z=>Z.command==="/stop")??{command:"/stop",title:"Stop current task",description:"Cancel the active agent turn for this chat.",icon:"square"},...L]:L},[r,h,p]),et=u.useMemo(()=>Ze===null?[]:Sr.filter(U=>{const Z=gm(U.command),Ce=A(`thread.composer.slash.commands.${Z}.title`,{defaultValue:U.title}),Ke=A(`thread.composer.slash.commands.${Z}.description`,{defaultValue:U.description});return[U.command,U.title,U.description,U.argHint??"",Ce,Ke].join(" ").toLowerCase().includes(Ze)}).map(U=>{const Z=gm(U.command);let Ke=A(`thread.composer.slash.commands.${Z}.description`,{defaultValue:U.description}),rt;return U.command==="/model"&&a?(Ke=a,rt=A("thread.composer.slash.badges.current")):U.command==="/goal"?Ke=b!=null&&b.active?A("thread.composer.slash.details.goalActive"):A("thread.composer.slash.details.goalReady"):U.command==="/stop"&&r?Ke=A("thread.composer.slash.details.stopRunning"):U.command==="/history"&&(Ke=A("thread.composer.slash.details.history")),{...U,detail:Ke,badge:rt,recent:de.includes(U.command)}}).sort((U,Z)=>{if(r){if(U.command==="/stop")return-1;if(Z.command==="/stop")return 1}if(Ze!=="")return 0;const Ce=de.indexOf(U.command),Ke=de.indexOf(Z.command);return Ce!==-1||Ke!==-1?Ce===-1?1:Ke===-1?-1:Ce-Ke:0}).slice(0,8),[b==null?void 0:b.active,r,a,de,Ze,A,Sr]),$t=et.length>0,nt=u.useMemo(()=>{if(t||W)return null;const L=Math.min(Math.max(Y,0),E.length),U=E.slice(0,L),Z=/(?:^|\s)@([a-z0-9_-]*)$/i.exec(U);if(!Z)return null;const Ce=Z[1].toLowerCase();return{query:Ce,start:L-Ce.length-1,end:L}},[W,Y,t,E]),At=u.useMemo(()=>{if(!nt)return[];const L=m.filter(Z=>Z.installed).filter(Z=>[Z.name,Z.display_name,Z.category,Z.description,Z.entry_point].join(" ").toLowerCase().includes(nt.query)).map(Z=>({kind:"cli",name:Z.name,app:Z})),U=f.filter(Z=>Z.installed&&Z.configured).filter(Z=>[Z.name,Z.display_name,Z.category,Z.description,Z.transport].join(" ").toLowerCase().includes(nt.query)).map(Z=>({kind:"mcp",name:Z.name,preset:Z}));return[...L,...U].slice(0,8)},[nt,m,f]),In=At.length>0,wn=$t||In,un=u.useMemo(()=>pC(E,m,f),[m,f,E]),Wn=un.some(L=>L.kind==="cli"||L.kind==="mcp"),sr=u.useMemo(()=>{const L=new Set;return un.flatMap(U=>U.kind!=="cli"||L.has(U.app.name)?[]:(L.add(U.app.name),[U.app]))},[un]),Gr=u.useMemo(()=>{const L=new Set;return un.flatMap(U=>U.kind!=="mcp"||L.has(U.preset.name)?[]:(L.add(U.preset.name),[U.preset]))},[un]),[Nr,en]=u.useState({placement:"above",maxHeight:tx});u.useEffect(()=>{$(0)},[Ze]),u.useEffect(()=>{G(0)},[nt==null?void 0:nt.query]),u.useEffect(()=>{K>=et.length&&$(0)},[et.length,K]),u.useEffect(()=>{D>=At.length&&G(0)},[At.length,D]),u.useEffect(()=>{if(!wn)return;const L=U=>{var Ce;const Z=U.target;Z instanceof Node&&((Ce=O.current)!=null&&Ce.contains(Z))||(z(!0),P(!0))};return document.addEventListener("pointerdown",L,!0),()=>{document.removeEventListener("pointerdown",L,!0)}},[wn]),u.useLayoutEffect(()=>{if(!wn)return;const L=()=>{const Z=O.current;if(!Z)return;const Ce=Z.getBoundingClientRect();if(Ce.width===0&&Ce.height===0)return;const Ke=fF(Z),rt=Math.max(0,Ce.top-Ke.top-ex),Ln=Math.max(0,Ke.bottom-Ce.bottom-ex),qn=rt>=eF||rt>=Ln?"above":"below",Sn=Math.min(tx,qn==="above"?rt:Ln);en(Ns=>Ns.placement===qn&&Ns.maxHeight===Sn?Ns:{placement:qn,maxHeight:Sn})};L();const U=window.visualViewport;return U==null||U.addEventListener("resize",L),U==null||U.addEventListener("scroll",L),window.addEventListener("resize",L),document.addEventListener("scroll",L,!0),()=>{U==null||U.removeEventListener("resize",L),U==null||U.removeEventListener("scroll",L),window.removeEventListener("resize",L),document.removeEventListener("scroll",L,!0)}},[At.length,et.length,wn]);const be=u.useCallback(()=>{requestAnimationFrame(()=>{const L=Q.current;L&&(L.style.height="auto",L.style.height=`${Math.min(L.scrollHeight,260)}px`,L.focus())})},[]);u.useLayoutEffect(()=>{we.current!==S&&(we.current=S,_(""),Fe([]),T(null),z(!1),P(!1),oe(0),Be(),requestAnimationFrame(()=>{const L=Q.current;L&&(L.style.height="auto",L.style.height=`${Math.min(L.scrollHeight,260)}px`)}))},[Be,S]);const Ae=u.useCallback(L=>{const U=L.trim();U&&(_(Z=>{if(!Z.trim())return U;const Ce=/[\s\n]$/.test(Z)?"":" ";return`${Z}${Ce}${U}`}),z(!1),P(!1),T(null),be())},[be]),mt=u.useCallback(()=>T(null),[]),Vt=u.useCallback(L=>{T(A(`thread.composer.voiceErrors.${L}`))},[A]),Me=FO({disabled:t,onClearError:mt,onError:Vt,onTranscript:Ae,onTranscribeAudio:y});u.useEffect(()=>{if(!y)return;function L(Ce){!YO(Ce)||Ce.repeat||$e.current||(Ce.preventDefault(),$e.current=!0,Me.beginShortcutHold())}function U(Ce){!$e.current||!QO(Ce)||(Ce.preventDefault(),$e.current=!1,Me.endShortcutHold())}function Z(){$e.current&&($e.current=!1,Me.endShortcutHold())}return window.addEventListener("keydown",L),window.addEventListener("keyup",U),window.addEventListener("blur",Z),()=>{window.removeEventListener("keydown",L),window.removeEventListener("keyup",U),window.removeEventListener("blur",Z)}},[y,Me.beginShortcutHold,Me.endShortcutHold]);const yt=u.useCallback(L=>{if(L.command==="/stop"&&r&&h){h(),_(""),z(!0),P(!1),T(null),be();return}const U=[L.command,...de.filter(Z=>Z!==L.command)].slice(0,Zf);pe(U),aF(U),_(L.argHint?`${L.command} `:L.command),z(!0),P(!1),T(null),be()},[r,h,de,be]),tn=u.useCallback(L=>{if(!nt)return;const U=E.slice(nt.end),Z=`@${L.name}${U.startsWith(" ")?"":" "}`,Ce=`${E.slice(0,nt.start)}${Z}${U}`,Ke=nt.start+Z.length;_(Ce),oe(Ke),P(!0),z(!1),T(null),be(),requestAnimationFrame(()=>{const rt=Q.current;rt&&(rt.focus(),rt.setSelectionRange(Ke,Ke))})},[nt,be,E]),Gt=u.useCallback(()=>{_(""),T(null),z(!1),P(!1),oe(0),be()},[be]),It=u.useCallback(()=>{const L=E.trim();if(!or||!L&&kt.length===0)return;const U=cF(kt);me.current+=1,I(Z=>[...Z,{id:`queued-prompt-${Date.now()}-${me.current}`,text:L,...U.length>0?{images:U}:{}}]),Be(),Gt()},[or,Be,Gt,kt,E]),ft=u.useCallback(L=>{I(U=>U.filter(Z=>Z.id!==L)),requestAnimationFrame(()=>{var U;return(U=Q.current)==null?void 0:U.focus()})},[]),Ct=u.useCallback(L=>{var U;I(Z=>Z.filter(Ce=>Ce.id!==L.id)),_(L.text),T(null),z(!1),P(!1),oe(L.text.length),(U=L.images)!=null&&U.length?ze(L.images):Be(),be(),requestAnimationFrame(()=>{const Z=Q.current;Z&&(Z.focus(),Z.setSelectionRange(L.text.length,L.text.length))})},[Be,be,ze]),Lt=u.useCallback((L,U)=>{L!==U&&I(Z=>{const Ce=Z.findIndex(qn=>qn.id===L),Ke=Z.findIndex(qn=>qn.id===U);if(Ce===-1||Ke===-1)return Z;const rt=[...Z],[Ln]=rt.splice(Ce,1);return rt.splice(Ke,0,Ln),rt})},[]),ir=u.useCallback(L=>{const U=L.text.trim(),Z=nx(L.images);I(Ce=>Ce.filter(Ke=>Ke.id!==L.id)),(U||Z!=null&&Z.length)&&(Z!=null&&Z.length?e(U,Z):e(U)),requestAnimationFrame(()=>{var Ce;return(Ce=Q.current)==null?void 0:Ce.focus()})},[e]),St=u.useCallback(()=>{if(le.length===0)return;const L=le.find(Z=>Z.text.trim());if(!L){I([]);return}I(Z=>Z.filter(Ce=>Ce.id!==L.id));const U=nx(L.images);U!=null&&U.length?e(L.text.trim(),U):e(L.text.trim()),requestAnimationFrame(()=>{var Z;return(Z=Q.current)==null?void 0:Z.focus()})},[e,le]);u.useEffect(()=>{const L=je.current;if(je.current=r,!(!L||r||le.length===0)){if(xe.current){xe.current=!1;return}St()}},[St,r,le.length]);const Ut=u.useCallback(()=>{le.length>0&&(xe.current=!0),h==null||h()},[h,le.length]),nn=u.useCallback(()=>{if(l){c==null||c();return}if(!Hn)return;const U=E.trim(),Z=kt.length>0?kt.map(Pt=>({media:{data_url:Pt.dataUrl,name:Pt.file.name},preview:{url:Pt.dataUrl,name:Pt.file.name}})):void 0,Ce=sr.map(kF),Ke=Gr.map(CF),rt=Se.map(Pt=>({name:Pt.file.name,content:Pt.content,kind:Pt.kind})),Ln=Se.map(Pt=>({kind:"file",name:Pt.file.name})),qn=Ce.length>0||Ke.length>0||rt.length>0?{...Ce.length>0?{cliApps:Ce}:{},...Ke.length>0?{mcpPresets:Ke}:{},...rt.length>0?{attachments:rt,attachmentMedia:Ln}:{}}:void 0;e(U,Z,qn),I([]),Fe([]),Be(),Gt()},[sr,Gr,Hn,Be,Gt,l,c,e,kt,Se,E]),lo=L=>{if(In){if(L.key==="ArrowDown"){L.preventDefault(),G(U=>(U+1)%At.length);return}if(L.key==="ArrowUp"){L.preventDefault(),G(U=>(U-1+At.length)%At.length);return}if(L.key==="Tab"||L.key==="Enter"&&!L.shiftKey){L.preventDefault(),tn(At[D]);return}if(L.key==="Escape"){L.preventDefault(),P(!0);return}}if($t){if(L.key==="ArrowDown"){L.preventDefault(),$(U=>(U+1)%et.length);return}if(L.key==="ArrowUp"){L.preventDefault(),$(U=>(U-1+et.length)%et.length);return}if(L.key==="Tab"||L.key==="Enter"&&!L.shiftKey){L.preventDefault(),yt(et[K]);return}if(L.key==="Escape"){L.preventDefault(),z(!0);return}}if(L.key==="Enter"&&!L.shiftKey&&!L.nativeEvent.isComposing){if(L.preventDefault(),or){It();return}nn()}},kn=L=>{const U=L.currentTarget;U.style.height="auto",U.style.height=`${Math.min(U.scrollHeight,260)}px`},co=L=>{const U=Array.from(L.target.files??[]);L.target.value="",Qe(U)},H=async L=>{const U=Array.from(L.target.files??[]);if(L.target.value="",U.length===0)return;const Z=await pF(U);if(!Z.ok){T(Z.error);return}Fe(Ce=>{const Ke=[...Ce];for(const rt of Z.attachments)if(!Ke.some(Ln=>Ln.id===rt.id)){if(Ke.length>=Hc)break;Ke.push(rt)}return Ke}),T(null)},q=u.useCallback(L=>{Fe(U=>U.filter(Z=>Z.id!==L)),T(null),requestAnimationFrame(()=>{var U;return(U=Q.current)==null?void 0:U.focus()})},[]),se=u.useCallback(L=>{const{nextFocusId:U}=ue(L);T(null),requestAnimationFrame(()=>{var Ce;const Z=U?ve.current.get(U):null;Z?Z.focus():(Ce=Q.current)==null||Ce.focus()})},[ue]),ke=u.useCallback(L=>U=>{(U.key==="Delete"||U.key==="Backspace"||U.key==="Enter"||U.key===" ")&&(U.preventDefault(),se(L))},[se]),Le=t||nr,Dt=!!y,jr=A("thread.composer.voice.recordingStatus",{time:Me.elapsedLabel,defaultValue:`Recording ${Me.elapsedLabel}`}),qe=Me.state==="recording"?A("thread.composer.voice.stop"):Me.state==="transcribing"?A("thread.composer.voice.transcribing"):A("thread.composer.tools.voice"),Cn=Me.state==="recording"?A("thread.composer.voice.stop"):Me.state==="transcribing"?A("thread.composer.voice.transcribing"):A("thread.composer.voice.hint"),Ar=r&&!!h,_t=B&&Ne.length===0&&!r,Ss=j("w-full resize-none bg-transparent",B?j("min-h-[78px] px-4 text-[15px] leading-6 sm:px-5",_t?"pb-2 pt-[27px]":"pb-1.5 pt-4"):"min-h-[50px] px-3.5 pb-1.5 pt-3 text-[13.5px] leading-5 sm:px-4");return s.jsxs("form",{ref:O,onSubmit:L=>{L.preventDefault(),nn()},onDragEnter:cn,onDragOver:zt,onDragLeave:jt,onDrop:Vr,className:j("relative w-full",B?"px-0":"px-1 pb-1.5 pt-1 sm:px-0"),children:[$t?s.jsx(MF,{commands:et,selectedIndex:K,layout:Nr,isHero:B,onHover:$,onChoose:yt}):null,In?s.jsx(TF,{candidates:At,selectedIndex:D,layout:Nr,isHero:B,onHover:G,onChoose:tn}):null,s.jsxs("div",{className:j("group/composer relative mx-auto flex w-full flex-col overflow-visible transition-all duration-200","after:pointer-events-none after:absolute after:inset-[-1px] after:rounded-[inherit] after:border after:border-blue-300/75 after:opacity-0 after:transition-opacity after:duration-200 focus-within:after:opacity-100 dark:after:border-blue-400/55",B?"max-w-[58rem] rounded-[28px] border border-black/[0.035] bg-card shadow-[0_20px_55px_rgba(15,23,42,0.08)] dark:border-white/[0.06] dark:shadow-[0_24px_55px_rgba(0,0,0,0.34)]":"max-w-[49.5rem] rounded-[22px] border border-black/[0.035] bg-card shadow-[0_12px_30px_rgba(15,23,42,0.07)] dark:border-white/[0.06] dark:shadow-[0_16px_34px_rgba(0,0,0,0.28)]","focus-within:border-blue-300/75 dark:focus-within:border-blue-400/55",t&&"opacity-60",yn&&"ring-2 ring-primary/40 motion-reduce:ring-0 motion-reduce:border-primary",(b==null?void 0:b.active)&&"goal-shell-glow ring-1 ring-sky-400/35 motion-reduce:ring-sky-400/25 dark:ring-sky-400/45"),children:[le.length>0?s.jsx(jF,{prompts:le,isHero:B,label:A("thread.composer.queued.label"),guideLabel:A("thread.composer.queued.guide"),deleteLabel:A("thread.composer.queued.delete"),dragLabel:A("thread.composer.queued.drag"),editLabel:A("thread.composer.queued.edit"),onGuide:ir,onDelete:ft,onEdit:Ct,onDragStart:L=>{ee.current=L},onDragEnd:()=>{ee.current=null},onDrop:L=>{const U=ee.current;U&&Lt(U,L)}}):null,Ne.length>0?s.jsx("div",{className:"flex flex-wrap gap-2 px-3 pt-3","aria-label":A("thread.composer.attachImage"),children:Ne.map(L=>s.jsx(EF,{image:L,labelRemove:A("thread.composer.remove"),labelEncoding:A("thread.composer.encoding"),normalizedHint:(U,Z)=>A("thread.composer.normalizedSizeHint",{orig:Jl(U),current:Jl(Z)}),formatError:xn,onRemove:()=>se(L.id),onKeyDown:ke(L.id),registerRef:U=>{U?ve.current.set(L.id,U):ve.current.delete(L.id)}},L.id))}):null,Se.length>0?s.jsx("div",{className:"flex flex-wrap gap-2 px-3 pt-3","aria-label":"Text attachments",children:Se.map(L=>s.jsxs("button",{type:"button",onClick:()=>q(L.id),className:j("inline-flex items-center gap-2 rounded-[12px] border border-border/70 bg-muted/55 px-3 py-2","text-left text-[12px] text-foreground/88 transition-colors hover:bg-muted/75"),title:`${L.file.name}
${Jl(L.file.size)}`,children:[s.jsx(Bp,{className:"h-4 w-4 shrink-0 text-sky-600 dark:text-sky-300"}),s.jsx("span",{className:"max-w-[16rem] truncate",children:L.file.name}),s.jsx(xr,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"})]},L.id))}):null,s.jsx(NF,{startedAt:x,goalState:b}),s.jsxs("div",{className:"relative",children:[Wn?s.jsx(PF,{segments:un,isHero:B,className:Ss}):null,s.jsx("textarea",{ref:Q,value:E,onChange:L=>{_(L.target.value),z(!1),P(!1),oe(L.target.selectionStart??L.target.value.length)},onInput:kn,onKeyDown:lo,onKeyUp:L=>oe(L.currentTarget.selectionStart??L.currentTarget.value.length),onSelect:L=>oe(L.currentTarget.selectionStart??L.currentTarget.value.length),onClick:L=>oe(L.currentTarget.selectionStart??L.currentTarget.value.length),onPaste:rr,rows:1,placeholder:Ie,disabled:t,"aria-label":A("thread.composer.inputAria"),className:j(Ss,"relative z-10 caret-foreground placeholder:text-muted-foreground/70","focus:outline-none focus-visible:outline-none","disabled:cursor-not-allowed",Wn&&"text-transparent selection:bg-primary/20")})]}),R?s.jsx("div",{role:"alert",className:j("mx-3 mb-1 rounded-md border border-destructive/40 bg-destructive/8 px-2.5 py-1","text-[11.5px] font-medium text-destructive"),children:R}):null,s.jsxs("div",{className:j("flex flex-wrap items-center justify-between gap-y-2",B?j("gap-x-1.5 px-3 sm:px-4",ye?"pb-1.5":"pb-3.5"):"gap-x-2 px-2.5 pb-2 sm:px-3"),children:[s.jsxs("div",{className:j("flex min-w-0 flex-1 basis-[8rem] items-center",B?"gap-1.5":"gap-2"),children:[s.jsx("input",{ref:ne,type:"file",accept:KO,multiple:!0,hidden:!0,onChange:co}),s.jsx("input",{ref:he,type:"file",accept:VO,multiple:!0,hidden:!0,onChange:H}),s.jsx(fe,{type:"button",size:"icon",variant:"ghost",disabled:Le,"aria-label":A("thread.composer.attachImage"),onClick:()=>{var L;return(L=ne.current)==null?void 0:L.click()},className:j("rounded-full text-muted-foreground hover:text-foreground",B?"h-8 w-8 border border-border/55 bg-card shadow-[0_2px_8px_rgba(15,23,42,0.05)] hover:bg-card":"h-9 w-9 border border-border/55 bg-card shadow-[0_2px_8px_rgba(15,23,42,0.05)] hover:bg-card"),children:s.jsx(ga,{className:j(B?"h-[18px] w-[18px]":"h-4 w-4")})}),s.jsx(fe,{type:"button",size:"icon",variant:"ghost",disabled:t||Se.length>=Hc,"aria-label":"Attach markdown or text",onClick:()=>{var L;return(L=he.current)==null?void 0:L.click()},className:j("rounded-full text-muted-foreground hover:text-foreground",B?"h-8 w-8 border border-border/55 bg-card shadow-[0_2px_8px_rgba(15,23,42,0.05)] hover:bg-card":"h-9 w-9 border border-border/55 bg-card shadow-[0_2px_8px_rgba(15,23,42,0.05)] hover:bg-card"),children:s.jsx(Bp,{className:j(B?"h-[17px] w-[17px]":"h-4 w-4")})}),Me.isRecording?s.jsx(nF,{ariaLabel:jr,className:"mx-1 flex-1",elapsedLabel:Me.elapsedLabel,isHero:B,levels:Me.levels}):v?s.jsx(hO,{scope:v,disabled:t||k,canUseFullAccess:(w==null?void 0:w.can_use_full_access)!==!1,isHero:B,onChange:N}):null]}),s.jsxs("div",{className:j("ml-auto flex min-w-0 shrink-0 items-center",B?"gap-1.5":"gap-2"),children:[a&&!Me.isRecording?s.jsx(_F,{label:a,provider:o,providerLabel:i,needsSetup:l,isHero:B,onClick:l?c:void 0}):null,Dt?s.jsx(Ru,{delayDuration:220,skipDelayDuration:80,children:s.jsxs(Ei,{children:[s.jsx(Ii,{asChild:!0,children:s.jsx(fe,{type:"button",size:"icon",variant:"ghost",disabled:Me.buttonDisabled,"aria-label":qe,"aria-keyshortcuts":GO,title:Cn,onPointerDown:Me.beginPress,onPointerUp:Me.endPress,onPointerCancel:Me.endPress,onClick:Me.handleClick,className:j("rounded-full border border-transparent text-muted-foreground hover:bg-muted/65 hover:text-foreground",B?"h-8 w-8":"h-9 w-9",Me.isRecording&&"bg-red-500 text-white shadow-[0_8px_20px_rgba(239,68,68,0.22)] hover:bg-red-500 hover:text-white"),children:Me.state==="transcribing"?s.jsx(pt,{className:j("h-4 w-4","animate-spin")}):Me.isRecording?s.jsx(Hp,{className:j("h-3.5 w-3.5"),fill:"currentColor"}):s.jsx(gf,{className:j("h-4 w-4")})})}),s.jsxs(ss,{side:"top",align:"center",className:"flex items-center gap-2 rounded-full border border-border/70 bg-background px-3 py-1.5 text-[13px] font-medium text-foreground shadow-[0_8px_24px_rgba(15,23,42,0.13)] dark:border-white/10 dark:bg-neutral-900 dark:text-white",children:[s.jsx("span",{children:Cn}),Me.state==="idle"?s.jsx("kbd",{className:"rounded-full bg-muted px-2 py-0.5 font-sans text-[12px] font-semibold leading-none text-muted-foreground dark:bg-white/10 dark:text-white/80",children:X}):null]})]})}):null,s.jsx(fe,{type:Ar||l?"button":"submit",size:"icon",disabled:Ar?t:!Hn&&!bn,"aria-label":Ar?A("thread.composer.stop"):l?A("thread.composer.configureModel",{defaultValue:"Configure model"}):A("thread.composer.send"),onClick:Ar?Ut:l?c:void 0,className:j("rounded-full transition-transform",Ar?"border border-border/70 bg-card text-foreground/85 shadow-[0_3px_10px_rgba(15,23,42,0.08)] hover:bg-muted/65 hover:text-foreground disabled:text-muted-foreground/50":B?"border border-foreground bg-foreground text-background shadow-[0_4px_12px_rgba(15,23,42,0.20)] hover:bg-foreground/90 disabled:border-foreground disabled:bg-foreground disabled:text-background":"border border-foreground bg-foreground text-background shadow-[0_3px_10px_rgba(15,23,42,0.18)] hover:bg-foreground/90 disabled:border-foreground disabled:bg-foreground disabled:text-background",B?"h-8 w-8":"h-9 w-9",(Hn||bn||Ar)&&"hover:scale-[1.03] active:scale-95"),children:Ar?s.jsx(Hp,{className:j("fill-current stroke-current",B?"h-3 w-3":"h-3.5 w-3.5")}):r?s.jsx(pt,{className:j("h-4 w-4","animate-spin")}):s.jsx(qj,{className:j("h-4 w-4")})})]})]}),s.jsx(fO,{isHero:B,disabled:t||k,scope:v,defaultScope:g,controls:w,error:C,onChange:N})]})]})}function jF({prompts:e,isHero:t,label:n,guideLabel:r,deleteLabel:a,dragLabel:o,editLabel:i,onGuide:l,onDelete:c,onEdit:d,onDragStart:p,onDragEnd:m,onDrop:f}){const h=Math.min(240,14+e.length*34+Math.max(0,e.length-1)*4);return s.jsx("div",{role:"group","data-state":"enter",className:j("composer-status-strip relative z-20 mx-3 mt-3 overflow-hidden rounded-[18px]","border border-black/[0.05] bg-popover/90 p-1.5","shadow-[0_10px_28px_rgba(15,23,42,0.07)] backdrop-blur-md","dark:border-white/[0.08] dark:bg-popover/90 dark:shadow-[0_14px_34px_rgba(0,0,0,0.30)]","max-w-none"),style:{"--composer-strip-max-height":`${h}px`},"aria-label":n,children:s.jsx("div",{className:"flex max-h-[216px] flex-col gap-1 overflow-y-auto",children:e.map(y=>s.jsx(AF,{prompt:y,isHero:t,guideLabel:r,deleteLabel:a,dragLabel:o,editLabel:i,onGuide:l,onDelete:c,onEdit:d,onDragStart:p,onDragEnd:m,onDrop:f},y.id))})})}function AF({prompt:e,isHero:t,guideLabel:n,deleteLabel:r,dragLabel:a,editLabel:o,onGuide:i,onDelete:l,onEdit:c,onDragStart:d,onDragEnd:p,onDrop:m}){const f=uF(e);return s.jsxs("div",{"data-queued-prompt-row":"true",onDragEnter:h=>{h.preventDefault(),m(e.id)},onDragOver:h=>{h.preventDefault(),h.dataTransfer.dropEffect="move"},onDrop:h=>{h.preventDefault(),m(e.id)},onDragEnd:p,className:j("queued-prompt-row group/queued flex min-h-8 items-center gap-1.5 rounded-[12px] px-2 py-0.5","text-[13px] transition-colors hover:bg-muted/55 dark:hover:bg-white/[0.055]",t&&"text-[13.5px]"),children:[s.jsx("span",{draggable:!0,role:"button",tabIndex:0,"aria-label":a,onDragStart:h=>{h.dataTransfer.effectAllowed="move",h.dataTransfer.setData("text/plain",e.id),mF(h.dataTransfer),d(e.id)},onDragEnd:p,className:j("inline-flex h-7 w-7 shrink-0 cursor-grab items-center justify-center rounded-lg","text-muted-foreground/45 transition-colors hover:bg-background/80 hover:text-muted-foreground","active:cursor-grabbing dark:hover:bg-white/[0.06]"),children:s.jsx(rA,{className:"pointer-events-none h-3.5 w-3.5","aria-hidden":!0})}),s.jsx("div",{className:"flex min-h-7 min-w-0 flex-1 items-center",children:s.jsx("p",{title:f,className:j("line-clamp-3 whitespace-pre-wrap break-words font-medium leading-[1.28] text-foreground/88",t&&"text-[13.5px]"),children:f})}),s.jsxs(fe,{type:"button",variant:"ghost",size:"sm",className:"h-7 shrink-0 rounded-full px-2 text-[11.5px] font-medium text-muted-foreground hover:bg-muted/70 hover:text-foreground dark:hover:bg-white/[0.07]",onClick:()=>i(e),children:[s.jsx(Xj,{className:"mr-1 h-3 w-3","aria-hidden":!0}),n]}),s.jsx(fe,{type:"button",variant:"ghost",size:"icon","aria-label":o,title:o,className:"h-7 w-7 shrink-0 rounded-full text-muted-foreground hover:bg-background/85 hover:text-foreground dark:hover:bg-white/[0.07]",onClick:()=>c(e),children:s.jsx(xf,{className:"h-3.5 w-3.5","aria-hidden":!0})}),s.jsx(fe,{type:"button",variant:"ghost",size:"icon","aria-label":r,className:"h-7 w-7 shrink-0 rounded-full text-muted-foreground hover:bg-background/85 hover:text-destructive dark:hover:bg-white/[0.07]",onClick:()=>l(e.id),children:s.jsx(ya,{className:"h-3 w-3","aria-hidden":!0})})]})}function _F({label:e,provider:t,providerLabel:n,needsSetup:r,isHero:a,onClick:o}){const i=r?null:t||um(e),l=al(i),[c,d]=u.useState(0),p=l==null?void 0:l.logoUrls[c],m=!!p,f=n?`${e} · ${n}`:e,h=!!o,y=h?"button":"span";return u.useEffect(()=>d(0),[i]),s.jsxs(y,{title:f,type:h?"button":void 0,onClick:o,className:j("inline-flex min-w-0 items-center rounded-full border border-border/55 bg-card font-medium text-foreground/82","shadow-[0_2px_8px_rgba(15,23,42,0.045)]",h&&"cursor-pointer hover:bg-accent/55 hover:text-foreground",r&&"border-amber-500/35 bg-amber-50/70 text-amber-900 dark:bg-amber-500/10 dark:text-amber-200",a?"h-8 max-w-[min(12.5rem,44vw)] gap-1.5 px-2 text-[11.5px]":"h-9 max-w-[min(12rem,44vw)] gap-2 px-2.5 text-[12px]"),children:[s.jsx("span",{"data-testid":r?"composer-model-setup-icon":i?`composer-model-logo-${i}`:"composer-model-logo",className:j("grid shrink-0 place-items-center overflow-hidden",r?"text-amber-800 dark:text-amber-200":"rounded-full border bg-background",a?"h-[18px] w-[18px]":"h-5 w-5"),style:{borderColor:!r&&l?`${l.color}28`:void 0,boxShadow:!r&&l?`inset 0 0 0 1px ${l.color}18`:void 0},"aria-hidden":!0,children:r?s.jsx(ff,{className:j(a?"h-3 w-3":"h-3.5 w-3.5"),strokeWidth:1.8}):m?s.jsx("img",{src:p,alt:"",className:j("object-contain",a?"h-3 w-3":"h-3.5 w-3.5"),onError:()=>d(x=>x+1)}):l?s.jsx("span",{className:j("grid h-full w-full place-items-center rounded-full text-white",a?"text-[7.5px]":"text-[8px]"),style:{backgroundColor:l.color},children:l.initials.slice(0,2)}):s.jsx($o,{className:j("text-muted-foreground/65","h-3 w-3")})}),s.jsx("span",{className:"truncate",children:e})]})}function PF({segments:e,isHero:t,className:n}){return s.jsx("div",{"aria-hidden":!0,className:j(n,"pointer-events-none absolute inset-0 z-0 overflow-hidden whitespace-pre-wrap break-words text-foreground"),children:e.map((r,a)=>r.kind==="text"?s.jsx("span",{children:r.text},`text-${a}`):r.kind==="cli"?s.jsx(mC,{app:r.app,label:r.text,variant:"composer",isHero:t},`cli-${r.app.name}-${a}`):s.jsx(fC,{preset:r.preset,label:r.text,variant:"composer",isHero:t},`mcp-${r.preset.name}-${a}`))})}function AC(e){const t=u.useRef(null);return u.useLayoutEffect(()=>{const n=t.current;if(!n)return;const r=n.querySelector(`[data-palette-index="${e}"]`);typeof(r==null?void 0:r.scrollIntoView)=="function"&&r.scrollIntoView({block:"nearest"})},[e]),t}function TF({candidates:e,selectedIndex:t,layout:n,isHero:r,onHover:a,onChoose:o}){const{t:i}=ie(),l=Math.max(0,n.maxHeight-kC),c=AC(t);return s.jsxs("div",{role:"listbox","aria-label":i("thread.composer.mentions.ariaLabel"),style:{maxHeight:n.maxHeight},className:j("absolute left-1/2 z-30 w-[calc(100%-0.5rem)] -translate-x-1/2 overflow-hidden rounded-[22px] border",n.placement==="above"?"bottom-full mb-2":"top-full mt-2","border-border/70 bg-popover p-2 text-popover-foreground shadow-[0_20px_60px_rgba(15,23,42,0.12)]","dark:border-white/10 dark:shadow-[0_24px_60px_rgba(0,0,0,0.42)]",r?"max-w-[58rem]":"max-w-[49.5rem]"),children:[s.jsx("div",{className:"px-2 pb-1.5 pt-0.5 text-[13px] font-semibold text-muted-foreground/78",children:i("thread.composer.mentions.label")}),s.jsx("div",{ref:c,className:"overflow-y-auto",style:{maxHeight:l},children:e.map((d,p)=>{const m=p===t,f=d.name,h=d.kind==="cli"?d.app.display_name:d.preset.display_name,y=d.kind==="cli"?i("thread.composer.mentions.cliBadge"):i("thread.composer.mentions.mcpBadge"),x=d.kind==="cli"?i("thread.composer.mentions.cliDescription",{name:f}):i("thread.composer.mentions.mcpDescription",{name:f});return s.jsxs("button",{type:"button",role:"option","data-palette-index":p,"aria-selected":m,"aria-label":`${h} @${f} ${x} ${y}`,onMouseEnter:()=>a(p),onMouseDown:b=>{b.preventDefault(),o(d)},className:j("flex min-h-10 w-full items-center gap-2.5 rounded-[13px] px-2.5 py-1.5 text-left transition-colors",m?"bg-foreground/[0.055] text-foreground":"text-foreground/90 hover:bg-foreground/[0.04]"),children:[s.jsx(RF,{candidate:d,selected:m}),s.jsxs("span",{className:"flex min-w-0 flex-1 items-baseline gap-2",children:[s.jsx("span",{className:"min-w-0 truncate text-[15px] font-medium tracking-normal text-foreground",children:h}),s.jsxs("span",{className:"truncate text-[15px] font-normal tracking-normal text-muted-foreground/72",children:["@",f]})]}),s.jsx("span",{className:j("ml-2 shrink-0 rounded-full px-2 py-0.5 text-[11px] font-semibold tracking-normal",d.kind==="cli"?"bg-orange-500/10 text-orange-600 dark:text-orange-300":"bg-sky-500/10 text-sky-600 dark:text-sky-300"),children:y})]},`${d.kind}-${f}`)})})]})}function RF({candidate:e,selected:t}){const[n,r]=u.useState(0),a=(e.kind==="cli"?e.app.brand_color:e.preset.brand_color)||"hsl(var(--primary))",o=e.kind==="cli"?e.app.logo_url:e.preset.logo_url,l=u.useMemo(()=>oo(o),[o])[n];return u.useEffect(()=>r(0),[o]),l?s.jsx("span",{className:j("flex h-5 w-5 shrink-0 items-center justify-center overflow-hidden rounded-[5px]",t?"bg-background/55":"bg-transparent"),children:s.jsx("img",{src:l,alt:"",className:"h-5 w-5 object-contain",onError:()=>r(c=>c+1)})}):s.jsx("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center rounded-[5px] text-[7.5px] font-semibold text-white",style:{backgroundColor:a},children:e.kind==="cli"?uC(e.app):dC(e.preset)})}function MF({commands:e,selectedIndex:t,layout:n,isHero:r,onHover:a,onChoose:o}){const{t:i}=ie(),l=Math.max(0,n.maxHeight-kC),c=AC(t);return s.jsx("div",{role:"listbox","aria-label":i("thread.composer.slash.ariaLabel"),style:{maxHeight:n.maxHeight},className:j("absolute left-1/2 z-30 w-[calc(100%-0.5rem)] -translate-x-1/2 overflow-hidden rounded-[18px] border",n.placement==="above"?"bottom-full mb-2":"top-full mt-2","border-border/65 bg-popover p-1.5 text-popover-foreground shadow-[0_18px_55px_rgba(15,23,42,0.16)]","dark:border-white/10 dark:shadow-[0_22px_55px_rgba(0,0,0,0.45)]",r?"max-w-[58rem]":"max-w-[49.5rem]"),children:s.jsx("div",{ref:c,className:"overflow-y-auto pr-0.5",style:{maxHeight:l},children:e.map((d,p)=>{const m=ZO[d.icon]??ff,f=p===t,h=gm(d.command),y=i(`thread.composer.slash.commands.${h}.title`,{defaultValue:d.title}),x=i(`thread.composer.slash.commands.${h}.description`,{defaultValue:d.description});return s.jsxs("button",{type:"button",role:"option","data-palette-index":p,"aria-selected":f,onMouseEnter:()=>a(p),onMouseDown:b=>{b.preventDefault(),o(d)},className:j("flex min-h-[44px] w-full items-center gap-3 rounded-[13px] px-3 py-2 text-left transition-colors",f?"bg-foreground/[0.065] text-foreground dark:bg-white/[0.09]":"text-foreground/86 hover:bg-foreground/[0.045] dark:hover:bg-white/[0.065]"),children:[s.jsx("span",{className:j("flex h-7 w-7 shrink-0 items-center justify-center text-muted-foreground transition-colors",f&&"text-foreground"),children:s.jsx(m,{className:"h-4 w-4"})}),s.jsxs("span",{className:"flex min-w-0 flex-1 flex-col gap-0.5 sm:flex-row sm:items-baseline sm:gap-2",children:[s.jsx("span",{className:"min-w-0 truncate text-[13.5px] font-semibold tracking-normal text-foreground",children:y}),s.jsx("span",{className:"min-w-0 truncate text-[13px] text-muted-foreground",children:d.detail||x})]}),s.jsxs("span",{className:"ml-2 flex max-w-[42%] shrink-0 items-center gap-1.5 sm:max-w-none",children:[d.badge||d.recent?s.jsx("span",{className:"hidden rounded-full bg-foreground/[0.055] px-2 py-1 text-[11px] font-medium text-muted-foreground sm:inline-flex",children:d.badge??i("thread.composer.slash.badges.recent")}):null,s.jsx("span",{className:"font-mono text-[12px] text-muted-foreground/60",children:d.argHint?`${d.command} ${d.argHint}`:d.command})]})]},d.command)})})})}function EF({image:e,labelRemove:t,labelEncoding:n,normalizedHint:r,formatError:a,onRemove:o,onKeyDown:i,registerRef:l}){const c=e.status==="ready"&&e.normalized&&e.encodedBytes?r(e.file.size,e.encodedBytes):Jl(e.file.size),d=e.status==="error"?"border-destructive/40 bg-destructive/5 text-destructive":"border-border/70 bg-muted/60";return s.jsxs("div",{className:j("group relative flex items-center gap-2 rounded-[12px] border px-2 py-1.5","transition-colors motion-reduce:transition-none",d),"data-testid":"composer-chip",children:[s.jsxs("div",{className:"relative h-10 w-10 overflow-hidden rounded-md bg-background",children:[e.previewUrl?s.jsx("img",{src:e.previewUrl,alt:"","aria-hidden":!0,loading:"eager",draggable:!1,className:"h-full w-full object-cover"}):s.jsx("div",{className:"flex h-full w-full items-center justify-center",children:s.jsx(Wi,{className:"h-4 w-4 text-muted-foreground","aria-hidden":!0})}),e.status==="encoding"?s.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-background/60","aria-label":n,children:s.jsx(pt,{className:"h-4 w-4 animate-spin motion-reduce:animate-none","aria-hidden":!0})}):null]}),s.jsxs("div",{className:"flex min-w-0 flex-col text-[11.5px] leading-4",children:[s.jsx("span",{className:"max-w-[min(14rem,calc(100vw-8rem))] truncate font-medium",title:e.file.name,children:e.file.name}),s.jsx("span",{className:"truncate text-muted-foreground",children:e.status==="error"&&e.error?a(e.error):c})]}),s.jsx("button",{type:"button",ref:l,onClick:o,onKeyDown:i,"aria-label":t,className:j("ml-1 grid h-5 w-5 flex-none place-items-center rounded-full","text-muted-foreground/80 hover:bg-foreground/8 hover:text-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-foreground/30"),children:s.jsx(xr,{className:"h-3.5 w-3.5","aria-hidden":!0})})]})}function IF({title:e,onToggleSidebar:t,theme:n,onToggleTheme:r,hideSidebarToggleForHostChrome:a=!1,hostChromeTitleInset:o=!1,hideThemeButton:i=!1,minimal:l=!1,promptNavigatorAction:c,sessionInfoAction:d}){const{t:p}=ie();return s.jsxs("div",{className:j("relative z-10 flex items-center justify-between gap-3 px-3 py-2",l&&"h-11",!l&&o&&"lg:pl-[128px]"),children:[s.jsxs("div",{className:"relative flex min-w-0 items-center gap-2",children:[s.jsx(fe,{variant:"ghost",size:"icon","aria-label":p("thread.header.toggleSidebar"),onClick:t,className:j("h-7 w-7 rounded-md text-muted-foreground hover:bg-accent/35 hover:text-foreground",a&&"lg:hidden"),children:s.jsx(ow,{className:"h-3.5 w-3.5"})}),l?null:s.jsx("div",{className:"flex min-w-0 items-center rounded-md px-1.5 py-1 text-[12px] font-medium text-muted-foreground",children:s.jsx("span",{className:"max-w-[min(60vw,32rem)] truncate",children:e})})]}),s.jsxs("div",{className:"ml-auto flex shrink-0 items-center gap-1",children:[d,c,i?null:s.jsx(LF,{theme:n,onToggleTheme:r,label:p("thread.header.toggleTheme")})]}),l?null:s.jsx("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-x-0 top-full h-4"})]})}function LF({theme:e,onToggleTheme:t,label:n,className:r}){return s.jsx(fe,{variant:"ghost",size:"icon","aria-label":n,onClick:t,className:j("host-no-drag h-8 w-8 rounded-full text-muted-foreground/85 hover:bg-accent/40 hover:text-foreground",r),children:e==="dark"?s.jsx(iw,{className:"h-4 w-4"}):s.jsx(vf,{className:"h-4 w-4"})})}function DF({error:e,onDismiss:t}){const{t:n}=ie(),{title:r,body:a}=OF(e,n);return s.jsxs("div",{role:"alert","aria-live":"assertive",className:j("mb-2 flex items-start gap-2 rounded-lg border border-destructive/30","bg-destructive/10 px-3 py-2 text-[12px] leading-5 text-destructive","animate-in fade-in-0 slide-in-from-bottom-1"),children:[s.jsx(Wp,{className:"mt-0.5 h-4 w-4 shrink-0","aria-hidden":!0}),s.jsxs("div",{className:"flex-1",children:[s.jsx("p",{className:"font-medium",children:r}),s.jsx("p",{className:"mt-0.5 text-destructive/80",children:a})]}),s.jsx(fe,{variant:"ghost",size:"icon",onClick:t,"aria-label":n("common.dismiss"),className:"h-6 w-6 shrink-0 text-destructive hover:bg-destructive/15 hover:text-destructive",children:s.jsx(xr,{className:"h-3.5 w-3.5"})})]})}function OF(e,t){switch(e.kind){case"message_too_big":return{title:t("errors.messageTooBig.title"),body:t("errors.messageTooBig.body")};case"workspace_scope_rejected":return{title:t("errors.workspaceScopeRejected.title"),body:t("errors.workspaceScopeRejected.body")};default:return{title:String(e),body:""}}}const FF=3,zF=80,$F=30,UF=12,BF=32,HF=42,WF=9,zd=16,qF=28,KF=4,VF=1400;function GF({bottomOffset:e,messages:t,scrollRef:n}){const r=u.useRef(null),a=u.useMemo(()=>lC(t),[t]),[o,i]=u.useState([]),[l,c]=u.useState(null),[d,p]=u.useState(!1),m=u.useRef(null),f=u.useCallback(()=>{p(!0),m.current!==null&&window.clearTimeout(m.current),m.current=window.setTimeout(()=>{p(!1),m.current=null},VF)},[]),h=u.useCallback(()=>{var w;const b=n.current;if(!b||a.length<FF){i([]),c(null);return}const v=b.scrollHeight-b.clientHeight;if(v<zF){i([]),c(null);return}const g=YF(b,a,v);i(QF(g,((w=r.current)==null?void 0:w.clientHeight)??0)),c(JF(g,b.scrollTop))},[a,n]);if(u.useEffect(()=>{let b=0,v=KF;const g=()=>{h(),v-=1,v>0&&(b=window.requestAnimationFrame(g))};return g(),()=>window.cancelAnimationFrame(b)},[e,h]),u.useEffect(()=>{const b=n.current;if(!b)return;let v=0;const g=()=>{window.cancelAnimationFrame(v),f(),v=window.requestAnimationFrame(h)};return b.addEventListener("scroll",g,{passive:!0}),window.addEventListener("resize",g),()=>{window.cancelAnimationFrame(v),b.removeEventListener("scroll",g),window.removeEventListener("resize",g)}},[f,n,h]),u.useEffect(()=>{const b=n.current;if(!b||typeof ResizeObserver>"u")return;const v=new ResizeObserver(()=>h());return v.observe(b),b.firstElementChild&&v.observe(b.firstElementChild),()=>v.disconnect()},[n,h]),u.useEffect(()=>()=>{m.current!==null&&window.clearTimeout(m.current)},[]),o.length===0)return null;const y=Math.max(...o.map(b=>b.count)),x=o.findIndex(b=>b.ids.includes(l??""));return s.jsx("div",{ref:r,"aria-label":"User prompt navigation",className:j("group pointer-events-auto absolute right-4 top-14 z-20 hidden w-8 opacity-70 md:block","transition-opacity duration-200 hover:opacity-100","motion-safe:animate-in motion-safe:fade-in-0 motion-safe:duration-200"),style:{bottom:Math.max(80,e)},children:o.map((b,v)=>{const g=b.ids.includes(l??""),w=x<0||Math.abs(v-x)<=1;return s.jsxs("button",{type:"button","aria-label":`Jump to prompt: ${b.label}`,onClick:()=>hm(n.current,b.ids[b.ids.length-1]),className:j("group/marker absolute right-0 h-5 -translate-y-1/2 overflow-visible rounded-full","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-400/60"),style:{top:`${b.topPercent}%`,width:ZF(b.count,y,g)},children:[s.jsx("span",{"aria-hidden":!0,className:j("absolute right-0 top-1/2 h-[3px] w-full -translate-y-1/2 rounded-full","bg-foreground/20 transition-[background-color,opacity,transform,height] duration-200","group-hover/marker:bg-blue-500/70 group-hover/marker:opacity-100 group-hover/marker:scale-x-110","group-focus-visible/marker:bg-blue-500 group-focus-visible/marker:opacity-100 group-focus-visible/marker:scale-x-110",b.count>1&&"bg-foreground/30",g&&"h-1 bg-foreground/65 opacity-80 shadow-sm",!g&&w&&"opacity-25 group-hover:opacity-55",!g&&!w&&!d&&"opacity-0 group-hover:opacity-40",!g&&!w&&d&&"opacity-35")}),s.jsx("span",{"aria-hidden":!0,className:j("pointer-events-none absolute right-9 top-1/2 z-30 w-64 -translate-y-1/2 rounded-lg px-3 py-2 text-left","bg-background/95 text-xs leading-5 text-foreground shadow-lg ring-1 ring-border/80 backdrop-blur","opacity-0 translate-x-1 transition-[opacity,transform] duration-150","group-hover/marker:opacity-100 group-hover/marker:translate-x-0","group-focus-visible/marker:opacity-100 group-focus-visible/marker:translate-x-0"),children:s.jsx("span",{className:"block max-h-24 overflow-hidden whitespace-pre-wrap break-words",children:b.preview})})]},b.ids.join("|"))})})}function YF(e,t,n){return t.flatMap(r=>{const a=ii(e,r.id);if(!a)return[];const o=Math.max(0,Math.min(n,Jf(e,a)-16));return[{...r,top:o,topPercent:vm(o/n*100,2,98)}]})}function QF(e,t){if(e.length===0)return[];if(e.length>=$F)return XF(e,t);const n=t>0?WF/t*100:2,r=[];for(const a of e){const o=r[r.length-1];if(o&&a.topPercent-o.topPercent<n){o.count+=1,o.ids.push(a.id),o.label=_C(o.count,a.label),o.preview=PC(o.count,a.preview);continue}r.push({count:1,ids:[a.id],label:a.label,preview:a.preview,topPercent:a.topPercent})}return r}function XF(e,t){const n=t>0?vm(Math.floor(t/UF),1,HF):BF,r=Array.from({length:n},()=>[]);for(const a of e){const o=vm(Math.floor(a.topPercent/100*n),0,n-1);r[o].push(a)}return r.flatMap(a=>{if(a.length===0)return[];const o=a[a.length-1],i=a.reduce((l,c)=>l+c.topPercent,0)/a.length;return[{count:a.length,ids:a.map(l=>l.id),label:a.length===1?o.label:_C(a.length,o.label),preview:a.length===1?o.preview:PC(a.length,o.preview),topPercent:i}]})}function JF(e,t){if(e.length===0)return null;let n=e[0];const r=t+96;for(const a of e){if(a.top<=r){n=a;continue}break}return n.id}function _C(e,t){return`${e} prompts, latest: ${t}`}function PC(e,t){return`${e} prompts
${t}`}function ZF(e,t,n){if(t<=1)return n?34:zd;const r=Math.log2(e+1)/Math.log2(t+1),a=zd+(qF-zd)*r;return Math.round(n?a+4:a)}function vm(e,t,n){return Math.max(t,Math.min(n,e))}function TC({attachment:e,className:t,inline:n=!1,variant:r="default"}){const{t:a}=ie(),[o,i]=u.useState(!1),l=typeof e.url=="string"&&e.url.length>0,c=ez(e,a);if(e.kind==="image"&&l&&!o)return s.jsx(ax,{attachment:e,className:t,inline:n,variant:r,children:s.jsx("a",{href:e.url,target:"_blank",rel:"noreferrer noopener",className:"block bg-muted/20","aria-label":e.name?`Open ${e.name}`:a("lightbox.open",{defaultValue:"Open image"}),children:s.jsx("img",{src:e.url,alt:e.name??"",loading:"lazy",decoding:"async",draggable:!1,onError:()=>i(!0),className:j("block h-auto max-w-full bg-background object-contain",r==="compact"?"max-h-40":"max-h-[34rem]")})})});if(e.kind==="video"&&l)return s.jsx(ax,{attachment:e,className:t,inline:n,variant:r,children:s.jsx("video",{src:e.url,controls:!0,preload:"auto",className:j("block w-full bg-black",r==="compact"?"max-h-40":"max-h-[26rem]"),"aria-label":e.name?`${a("message.videoAttachment",{defaultValue:"Video attachment"})}: ${e.name}`:a("message.videoAttachment",{defaultValue:"Video attachment"})})});const d=e.kind==="video"?xA:e.kind==="image"?Wi:Zj,p=s.jsxs(s.Fragment,{children:[s.jsx(d,{className:"h-4 w-4 flex-none","aria-hidden":!0}),s.jsx("span",{className:"min-w-0 truncate",children:e.name??c})]});return l&&!o?s.jsx("a",{href:e.url,download:e.name??c,title:e.name??void 0,"aria-label":c,className:j("flex max-w-[18rem] items-center gap-2 rounded-[14px]","border border-border/60 bg-muted/40 px-3 py-2 text-xs text-muted-foreground","transition-colors hover:bg-muted/55 hover:text-foreground",r==="compact"&&"max-w-[14rem] rounded-xl px-2.5 py-1.5 text-[11.5px]",t),children:p}):s.jsxs("div",{className:j("flex max-w-[18rem] items-center gap-2 rounded-[14px]","border border-border/60 bg-muted/35 px-3 py-2 text-xs text-muted-foreground",r==="compact"&&"max-w-[14rem] rounded-xl px-2.5 py-1.5 text-[11.5px]",t),title:e.name??void 0,"aria-label":c,children:[p,s.jsx("span",{className:"sr-only",children:a("message.attachmentUnavailable",{defaultValue:"Attachment unavailable"})})]})}function ax({attachment:e,children:t,className:n,inline:r=!1,variant:a="default"}){const o=j("not-prose my-3 block w-fit max-w-full overflow-hidden rounded-[14px]","border border-border/60 bg-muted/40",e.kind==="image"&&"bg-background/85",e.kind==="video"?"w-[min(100%,32rem)]":"",a==="compact"&&"my-1 rounded-xl shadow-none",a==="compact"&&e.kind==="video"&&"w-[min(100%,20rem)]",n),i="block max-w-full",l=r?s.jsx("span",{className:i,children:t}):s.jsx("div",{className:i,children:t});return r?s.jsx("span",{className:o,children:l}):s.jsx("figure",{className:o,children:l})}function ez(e,t){return e.kind==="video"?t("message.videoAttachment",{defaultValue:"Video attachment"}):e.kind==="image"?t("message.imageAttachment",{defaultValue:"Image attachment"}):t("message.fileAttachment",{defaultValue:"File attachment"})}function tz({images:e,index:t,onIndexChange:n,onOpenChange:r}){const{t:a}=ie(),o=t!==null,i=e.length,l=t!==null?e[t]:null,c=u.useCallback(f=>{if(t===null||i<=1)return;const h=(t+f+i)%i;n(h)},[t,n,i]);u.useEffect(()=>{if(!o)return;const f=h=>{h.key==="ArrowLeft"?(h.preventDefault(),c(-1)):h.key==="ArrowRight"?(h.preventDefault(),c(1)):h.key==="Home"?(h.preventDefault(),n(0)):h.key==="End"&&(h.preventDefault(),n(i-1))};return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[c,n,o,i]);const d=u.useMemo(()=>{if(t===null||i<=1)return[];const f=e[(t-1+i)%i],h=e[(t+1)%i];return[f,h].filter(y=>y&&y.url)},[e,t,i]);if(!l||!l.url)return null;const p=i>1,m=p?`${t+1} / ${i}`:null;return s.jsx(hu,{open:o,onOpenChange:r,children:s.jsxs(gu,{children:[s.jsx(hs,{className:j("fixed inset-0 z-50 bg-black/80 backdrop-blur-sm","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","motion-reduce:data-[state=open]:animate-none motion-reduce:data-[state=closed]:animate-none")}),s.jsxs(gs,{"aria-label":l.name??a("lightbox.title"),className:j("fixed inset-0 z-50 flex items-center justify-center","focus:outline-none","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95","motion-reduce:data-[state=open]:animate-none motion-reduce:data-[state=closed]:animate-none"),children:[s.jsx(vs,{className:"sr-only",children:l.name??a("lightbox.title")}),s.jsx("div",{className:"relative flex max-h-[92vh] max-w-[94vw] items-center justify-center",style:{transform:"translate3d(0,0,0)",willChange:"transform"},children:s.jsx("img",{src:l.url,alt:l.name??"",decoding:"async",draggable:!1,className:"max-h-[92vh] max-w-[94vw] select-none rounded-[6px] object-contain shadow-2xl"},l.url)}),p?s.jsxs(s.Fragment,{children:[s.jsx(ox,{side:"left",label:a("lightbox.prev"),onClick:f=>{f.stopPropagation(),c(-1)}}),s.jsx(ox,{side:"right",label:a("lightbox.next"),onClick:f=>{f.stopPropagation(),c(1)}}),s.jsx("div",{className:"pointer-events-none absolute bottom-5 left-1/2 -translate-x-1/2 rounded-full bg-black/55 px-3 py-1 text-xs font-medium text-white/90 tabular-nums",children:m})]}):null,s.jsx(Vi,{"aria-label":a("lightbox.close"),className:j("absolute right-4 top-4 grid h-9 w-9 place-items-center rounded-full","bg-black/55 text-white/90 hover:bg-black/70 hover:text-white","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/70","transition-colors motion-reduce:transition-none"),children:s.jsx(xr,{className:"h-4 w-4","aria-hidden":!0})}),s.jsx("div",{"aria-hidden":!0,className:"hidden",children:d.map((f,h)=>s.jsx("img",{src:f.url,alt:""},`${f.url}-${h}`))})]})]})})}function ox({side:e,label:t,onClick:n}){const r=e==="left"?mf:Wr;return s.jsx("button",{type:"button",onClick:n,"aria-label":t,className:j("absolute top-1/2 -translate-y-1/2 grid h-11 w-11 place-items-center rounded-full","bg-black/55 text-white/90 hover:bg-black/70 hover:text-white","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/70","transition-colors motion-reduce:transition-none",e==="left"?"left-4":"right-4"),children:s.jsx(r,{className:"h-5 w-5","aria-hidden":!0})})}async function nz(e){var t;try{if((t=navigator.clipboard)!=null&&t.writeText)return await navigator.clipboard.writeText(e),!0}catch{}return rz(e)}function rz(e){if(typeof document.execCommand!="function")return!1;const t=document.createElement("textarea");t.value=e,t.setAttribute("readonly",""),t.style.position="fixed",t.style.top="-9999px",t.style.left="-9999px",t.style.opacity="0",document.body.appendChild(t),t.focus(),t.select(),t.setSelectionRange(0,t.value.length);try{return document.execCommand("copy")}catch{return!1}finally{document.body.removeChild(t)}}const az=new Set([".png",".jpg",".jpeg",".gif",".webp",".bmp",".ico",".svg",".tif",".tiff"]),oz=new Set([".mp4",".webm",".mov",".m4v",".avi",".mkv",".3gp"]);function sz(e){var t;return((t=e.split(/[?#]/,1)[0])==null?void 0:t.toLowerCase())??""}function sx(e){if(!e)return"";const t=sz(e),n=t.lastIndexOf(".");return n<0?"":t.slice(n)}function RC(e){const t=e.url??"";if(t.startsWith("data:image/"))return"image";if(t.startsWith("data:video/"))return"video";const n=sx(e.name)||sx(t);return n?az.has(n)?"image":oz.has(n)?"video":"file":null}function S6(e){return RC(e)??"file"}function cs(e){return{kind:RC(e)??e.kind??"file",url:e.url,name:e.name}}function iz({className:e}){return s.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:e,"aria-hidden":!0,children:[s.jsx("path",{d:"M16 3h5v5"}),s.jsx("path",{d:"M8 3H3v5"}),s.jsx("path",{d:"m21 3-7.536 7.536A5 5 0 0 0 12 14.07V21"}),s.jsx("path",{d:"m3 3 7.536 7.536A5 5 0 0 1 12 14.07V15"})]})}function lz({message:e,showAssistantCopyAction:t=!0,cliApps:n=[],mcpPresets:r=[],onOpenFilePreview:a,onForkFromHere:o}){var F,z;const{t:i}=ie(),[l,c]=u.useState(!1),d=u.useRef(null),p="animate-in fade-in-0 slide-in-from-bottom-1 duration-300",m=u.useMemo(()=>dz(n,e.cliApps),[n,e.cliApps]),f=u.useMemo(()=>uz(r,e.mcpPresets),[r,e.mcpPresets]);u.useEffect(()=>()=>{d.current!==null&&window.clearTimeout(d.current)},[]);const h=u.useCallback(()=>{nz(e.content).then(K=>{K&&(c(!0),d.current!==null&&window.clearTimeout(d.current),d.current=window.setTimeout(()=>{c(!1),d.current=null},1500))})},[e.content]);if(e.kind==="trace")return s.jsx(hz,{message:e,animClass:p});if(e.role==="user"){const K=e.images??[],$=e.media??[],W=K.length>0,P=$.length>0,D=e.content.trim().length>0;return s.jsxs("div",{className:j("group ml-auto flex max-w-[min(85%,36rem)] flex-col items-end gap-1.5",p),children:[W?s.jsx(MC,{images:K,align:"right"}):null,P?s.jsx(ix,{media:$,align:"right"}):null,D?s.jsx("p",{className:j("ml-auto w-fit rounded-[18px] bg-secondary/70 px-4 py-2","text-left text-[16px]/[1.75] whitespace-pre-wrap break-words"),children:s.jsx(mO,{text:e.content,cliApps:m,mcpPresets:f})}):null]})}const y=e.content.trim().length===0,x=e.media??[],b=e.role==="assistant"?e.reasoning??"":"",v=!!(e.role==="assistant"&&e.reasoningStreaming),g=b.length>0||v,w=((F=e.source)==null?void 0:F.kind)==="cron"?((z=e.source.label)==null?void 0:z.trim())||i("message.automationSourceFallback"):"",k=i("message.automationTriggered"),C=e.role==="assistant"&&!e.isStreaming&&!y,N=t&&C,S=C&&!!o,A=i(l?"message.copiedReply":"message.copyReply"),E=i("message.forkFromHere"),_=e.latencyMs,R=e.role==="assistant"&&_!=null&&!e.isStreaming&&(!y||g||x.length>0),T=N||S||R;return s.jsxs("div",{className:j("w-full text-[15px]",p),style:{lineHeight:"var(--cjk-line-height)"},children:[g?s.jsx(fz,{text:b,streaming:v,hasBodyBelow:!y,onOpenFilePreview:a}):null,y&&e.isStreaming&&!g?s.jsx(mz,{}):y&&e.isStreaming?null:s.jsxs(s.Fragment,{children:[w?s.jsx(cz,{label:w,triggerLabel:k}):null,s.jsx(Du,{streaming:!!e.isStreaming,onOpenFilePreview:a,children:e.content}),x.length>0?s.jsx(ix,{media:x,align:"left"}):null,T?s.jsx(Ru,{delayDuration:220,skipDelayDuration:80,children:s.jsxs("div",{className:"mt-2 flex min-h-8 flex-wrap items-center gap-x-2 gap-y-1 text-muted-foreground",children:[N?s.jsxs(Ei,{children:[s.jsx(Ii,{asChild:!0,children:s.jsx("button",{type:"button",onClick:h,"aria-label":A,className:j("inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-full","transition-colors hover:bg-muted/55 hover:text-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"),children:l?s.jsx(Et,{className:"h-4 w-4","aria-hidden":!0}):s.jsx(Zb,{className:"h-4 w-4","aria-hidden":!0})})}),s.jsx(ss,{side:"top",align:"center",children:A})]}):null,S?s.jsxs(Ei,{children:[s.jsx(Ii,{asChild:!0,children:s.jsx("button",{type:"button",onClick:o,"aria-label":E,className:j("inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-full","transition-colors hover:bg-muted/55 hover:text-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"),children:s.jsx(iz,{className:"h-4 w-4"})})}),s.jsx(ss,{side:"top",align:"center",children:E})]}):null,R?s.jsx("span",{className:"text-[11px] leading-none text-muted-foreground/70 tabular-nums",title:i("message.turnLatencyTitle"),children:OM(_)}):null]})}):null]})]})}function cz({label:e,triggerLabel:t}){return s.jsxs("div",{className:j("mb-2 inline-flex max-w-full items-center gap-1.5 rounded-full px-2 py-1","border border-sky-500/15 bg-sky-500/[0.06]","text-[11px] font-medium leading-none text-sky-700","dark:border-sky-300/15 dark:bg-sky-300/[0.08] dark:text-sky-200/80"),title:t,children:[s.jsx(Qj,{className:"h-3 w-3 shrink-0","aria-hidden":!0}),s.jsx("span",{className:"min-w-0 truncate",children:e}),s.jsx("span",{className:"text-current/45","aria-hidden":!0,children:"·"}),s.jsx("span",{className:"shrink-0",children:t})]})}function uz(e,t){var r;if(!(t!=null&&t.length))return e;const n=new Map(e.map(a=>[a.name.toLowerCase(),a]));for(const a of t){const o=(r=a.name)==null?void 0:r.trim();if(!o)continue;const i=n.get(o.toLowerCase());n.set(o.toLowerCase(),{name:o,display_name:a.display_name||(i==null?void 0:i.display_name)||o,category:a.category||(i==null?void 0:i.category)||"mcp",description:(i==null?void 0:i.description)||"",docs_url:(i==null?void 0:i.docs_url)||"",transport:a.transport||(i==null?void 0:i.transport)||"mcp",requires:(i==null?void 0:i.requires)||"",note:(i==null?void 0:i.note)||"",install_supported:(i==null?void 0:i.install_supported)??!0,installed:!0,configured:a.configured??(i==null?void 0:i.configured)??!0,available:(i==null?void 0:i.available)??!0,status:a.status||(i==null?void 0:i.status)||"configured",logo_url:a.logo_url??(i==null?void 0:i.logo_url)??null,brand_color:a.brand_color??(i==null?void 0:i.brand_color)??null,required_fields:(i==null?void 0:i.required_fields)||[],connection_summary:(i==null?void 0:i.connection_summary)||""})}return Array.from(n.values())}function dz(e,t){var r;if(!(t!=null&&t.length))return e;const n=new Map(e.map(a=>[a.name.toLowerCase(),a]));for(const a of t){const o=(r=a.name)==null?void 0:r.trim();if(!o)continue;const i=n.get(o.toLowerCase());n.set(o.toLowerCase(),{name:o,display_name:a.display_name||(i==null?void 0:i.display_name)||o,category:a.category||(i==null?void 0:i.category)||"cli",description:(i==null?void 0:i.description)||"",requires:(i==null?void 0:i.requires)||"",source:(i==null?void 0:i.source)||"attached",entry_point:a.entry_point||(i==null?void 0:i.entry_point)||"",install_supported:(i==null?void 0:i.install_supported)??!0,installed:!0,available:(i==null?void 0:i.available)??!0,status:(i==null?void 0:i.status)||"installed",logo_url:a.logo_url??(i==null?void 0:i.logo_url)??null,brand_color:a.brand_color??(i==null?void 0:i.brand_color)??null,skill_installed:(i==null?void 0:i.skill_installed)??!0})}return Array.from(n.values())}function ix({media:e,align:t}){if(e.length===0)return null;const n=[],r=[];for(const a of e){const o=cs(a);o.kind==="image"?n.push({url:o.url,name:o.name}):r.push(o)}return s.jsxs("div",{className:j("mt-2 flex flex-wrap gap-2",t==="right"?"justify-end":"justify-start"),children:[n.length>0?s.jsx(MC,{images:n,align:t,size:t==="left"?"large":"compact"}):null,r.map((a,o)=>s.jsx(TC,{attachment:a},`${a.url??a.name??a.kind}-${o}`))]})}function MC({images:e,align:t="right",size:n="compact"}){const{t:r}=ie(),a=[],o=new Map;for(let c=0;c<e.length;c+=1){const d=e[c];typeof d.url!="string"||d.url.length===0||(o.set(c,a.length),a.push(d))}const[i,l]=u.useState(null);return s.jsxs(s.Fragment,{children:[s.jsx("div",{className:j("flex flex-wrap items-end gap-2",n==="large"&&"gap-3",t==="right"?"ml-auto justify-end":"mr-auto justify-start"),children:e.map((c,d)=>s.jsx(pz,{image:c,size:n,placeholderLabel:r("message.imageAttachment"),openLabel:r("lightbox.open"),onOpen:o.has(d)?()=>l(o.get(d)):void 0},`${c.url??"placeholder"}-${d}`))}),s.jsx(tz,{images:a,index:i,onIndexChange:l,onOpenChange:c=>{c||l(null)}})]})}function pz({image:e,size:t,placeholderLabel:n,openLabel:r,onOpen:a}){const o=typeof e.url=="string"&&e.url.length>0,i=j("relative overflow-hidden border border-border/60 bg-muted/40",t==="large"?"w-[min(100%,34rem)] rounded-[20px] bg-transparent":"h-24 w-24 rounded-[14px]","shadow-[0_6px_18px_-14px_rgba(0,0,0,0.45)]");return o&&a?s.jsx("button",{type:"button",onClick:a,"aria-label":e.name?`${r}: ${e.name}`:r,className:j(i,"block cursor-zoom-in p-0 transition-transform duration-150 motion-reduce:transition-none","hover:scale-[1.01] hover:ring-2 hover:ring-primary/25","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/50"),children:s.jsx("img",{src:e.url,alt:e.name??"",loading:"lazy",decoding:"async",draggable:!1,className:j("block",t==="large"?"h-auto max-h-[36rem] w-full rounded-[inherit] object-contain":"h-full w-full object-cover")})}):s.jsx("div",{className:i,title:e.name??void 0,children:s.jsxs("div",{className:"flex h-full w-full flex-col items-center justify-center gap-1 px-2 text-[11px] text-muted-foreground","aria-label":n,children:[s.jsx(Wi,{className:"h-4 w-4 flex-none","aria-hidden":!0}),s.jsx("span",{className:"line-clamp-2 text-center leading-tight",children:e.name??n})]})})}function mz(){const{t:e}=ie();return s.jsxs("span",{"aria-label":e("message.assistantTyping"),className:"inline-flex items-center gap-1 py-1",children:[s.jsx($d,{delay:"0ms"}),s.jsx($d,{delay:"150ms"}),s.jsx($d,{delay:"300ms"})]})}function $d({delay:e}){return s.jsx("span",{style:{animationDelay:e},className:j("inline-block h-1.5 w-1.5 rounded-full bg-muted-foreground/60","animate-bounce")})}function Ou({children:e,active:t,className:n}){const r=typeof e=="string"||typeof e=="number"?String(e):void 0;return s.jsx("span",{className:j("block min-w-0 overflow-hidden py-px",n),children:s.jsx("span",{"data-sheen-text":t?r:void 0,className:j("block w-fit max-w-full truncate font-medium leading-normal",t?"streaming-text-sheen":"text-muted-foreground"),children:e})})}function fz({text:e,streaming:t,hasBodyBelow:n,embeddedInCluster:r=!1,onOpenFilePreview:a}){const{t:o}=ie(),[i,l]=u.useState(!1),[c,d]=u.useState(!0),p=i?c:t,m=()=>{l(!0),d(f=>i?!f:!p)};return u.useEffect(()=>{p&&e.length>0&&Lu()},[p,e.length]),s.jsxs("div",{className:j("w-full",!r&&"animate-in fade-in-0 slide-in-from-top-1 duration-200",n&&"mb-2"),children:[s.jsxs("button",{type:"button",onClick:m,className:j("group flex w-full items-center gap-2 rounded-md px-2 py-1.5","text-xs text-muted-foreground transition-colors hover:bg-muted/45"),"aria-expanded":p,"aria-live":t?"polite":void 0,children:[s.jsx($o,{className:j("h-3.5 w-3.5",t&&"animate-pulse"),"aria-hidden":!0}),s.jsx(Ou,{active:t,className:"min-w-0 flex-1 text-left",children:t?o("message.reasoningStreaming",{defaultValue:"Thinking…"}):o("message.reasoning",{defaultValue:"Thinking"})}),s.jsx(Wr,{"aria-hidden":!0,className:j("ml-auto h-3.5 w-3.5 transition-transform duration-200",p&&"rotate-90")})]}),p&&e.length>0&&s.jsx("div",{className:j("mt-1 min-w-0 border-l border-muted-foreground/20 pl-3",!r&&"animate-in fade-in-0 slide-in-from-top-1 duration-200"),children:s.jsx(Du,{streaming:t,onOpenFilePreview:a,className:j("text-[12.5px] italic text-muted-foreground/88","prose-p:my-1.5 prose-li:my-0.5","prose-headings:mt-2 prose-headings:mb-1 prose-headings:font-medium","prose-headings:text-muted-foreground/92 prose-strong:text-muted-foreground","prose-h1:text-[15px] prose-h2:text-[13.5px] prose-h3:text-[12.5px] prose-h4:text-[12px]","prose-a:text-blue-500 prose-a:underline hover:prose-a:text-blue-600 dark:prose-a:text-blue-300 dark:hover:prose-a:text-blue-200","prose-code:text-[0.92em]"),children:e})})]})}function hz({message:e,animClass:t}){const{t:n}=ie(),r=e.traces??[e.content],a=r.length,[o,i]=u.useState(!1);return s.jsxs("div",{className:j("w-full",t),children:[s.jsxs("button",{type:"button",onClick:()=>i(l=>!l),className:j("group flex w-full items-center gap-2 rounded-md px-2 py-1.5","text-xs text-muted-foreground transition-colors hover:bg-muted/45"),"aria-expanded":o,children:[s.jsx(lw,{className:"h-3.5 w-3.5","aria-hidden":!0}),s.jsx("span",{className:"font-medium",children:a===1?n("message.toolSingle"):n("message.toolMany",{count:a})}),s.jsx(Wr,{"aria-hidden":!0,className:j("ml-auto h-3.5 w-3.5 transition-transform duration-200",o&&"rotate-90")})]}),o&&s.jsx("ul",{className:j("mt-1 space-y-0.5 border-l border-muted-foreground/20 pl-3","animate-in fade-in-0 slide-in-from-top-1 duration-200"),children:r.map((l,c)=>s.jsx("li",{className:"whitespace-pre-wrap break-words font-mono text-[11.5px] leading-relaxed text-muted-foreground/90",children:l},c))})]})}function EC({evidence:e,className:t}){return e.length===0?null:s.jsx("div",{"data-testid":"activity-evidence-preview",className:j("flex max-w-full flex-wrap items-start gap-2 pt-0.5","motion-safe:animate-in motion-safe:fade-in-0 motion-safe:slide-in-from-top-1 motion-safe:duration-200",t),children:e.slice(0,4).map(n=>s.jsx(TC,{attachment:n.attachment,variant:"compact",className:j(n.attachment.kind==="image"||n.attachment.kind==="video"?"max-w-[min(100%,20rem)]":"max-w-[14rem]")},n.id))})}function IC({title:e,icon:t,children:n,className:r}){return s.jsxs("section",{className:j("min-w-0 py-1 motion-safe:animate-in motion-safe:fade-in-0 motion-safe:slide-in-from-bottom-1 motion-safe:duration-200",r),children:[s.jsxs("div",{className:"mb-1 flex min-w-0 items-center gap-1.5 pl-0.5 text-[12px] font-medium text-muted-foreground/70",children:[t?s.jsx(t,{className:"h-3.5 w-3.5 shrink-0","aria-hidden":!0}):null,s.jsx("span",{className:"min-w-0 truncate",children:e})]}),s.jsx("div",{className:"min-w-0",children:n})]})}function so({as:e="div",icon:t,marker:n,label:r,detail:a,aside:o,children:i,active:l=!1,tone:c=l?"active":"neutral",title:d,className:p,contentClassName:m,markerClassName:f,style:h}){return s.jsxs(e,{className:j("group/activity-step relative grid min-w-0 grid-cols-[1.125rem_minmax(0,1fr)] gap-2 py-0.5 text-[13px] leading-5",p),title:d,style:h,children:[s.jsx("span",{className:j("relative flex h-5 w-[1.125rem] shrink-0 items-start justify-center pt-[3px]","after:absolute after:left-1/2 after:top-[1.25rem] after:h-[calc(100%+0.375rem)] after:w-px after:-translate-x-1/2 after:bg-muted-foreground/14 group-last/activity-step:after:hidden"),"aria-hidden":!0,children:n??s.jsx("span",{className:j("grid h-3.5 w-3.5 place-items-center rounded-full border bg-background transition-colors",c==="active"&&"border-muted-foreground/28 text-muted-foreground/72",c==="success"&&"border-emerald-500/28 text-emerald-500/78",c==="error"&&"border-destructive/30 text-destructive/78",c==="neutral"&&"border-muted-foreground/18 text-muted-foreground/50",f),children:t?s.jsx(t,{className:"h-2.5 w-2.5",strokeWidth:2.15}):null})}),s.jsxs("div",{className:j("min-w-0",m),children:[s.jsxs("div",{className:"flex min-w-0 items-baseline gap-1.5",children:[s.jsx(Ou,{active:l,className:j("min-w-0 shrink-0 font-medium",c==="error"?"text-destructive/78":"text-muted-foreground/85"),children:r}),a?s.jsx("span",{className:"min-w-0 break-words text-foreground/82",children:a}):null,o?s.jsx("span",{className:"ml-auto shrink-0",children:o}):null]}),i?s.jsx("div",{className:"mt-1 min-w-0",children:i}):null]})]})}function eh({added:e,deleted:t}){return s.jsxs("span",{className:"inline-flex shrink-0 items-baseline gap-1.5 leading-[inherit] tabular-nums","data-testid":"activity-diff-pair",children:[s.jsx(lx,{sign:"+",value:e,className:"text-emerald-600/75 dark:text-emerald-300/75"}),s.jsx(lx,{sign:"-",value:t,className:"text-rose-600/70 dark:text-rose-300/75"})]})}function lx({sign:e,value:t,className:n}){const r=Number.isFinite(t)?Math.max(0,Math.round(t)):0;return s.jsxs("span",{className:j("inline-flex items-baseline leading-[inherit]",n),"aria-label":`${e}${r}`,children:[s.jsxs("span",{className:"inline-flex items-baseline leading-none","aria-hidden":!0,children:[e,s.jsx(gz,{value:r})]}),s.jsxs("span",{className:"sr-only",children:[e,r]})]})}function gz({value:e}){const t=Number.isFinite(e)?Math.max(0,Math.round(e)):0,[n,r]=u.useState(0),a=u.useRef(0),o=u.useCallback(i=>{a.current=i,r(i)},[]);return u.useEffect(()=>{var h;if((h=window.matchMedia)==null?void 0:h.call(window,"(prefers-reduced-motion: reduce)").matches){o(t);return}const l=a.current,c=t-l;if(c===0){o(t);return}const d=260,p=performance.now();let m=0;const f=y=>{const x=Math.min(1,(y-p)/d),b=1-Math.pow(1-x,3);if(o(Math.round(l+c*b)),x<1){m=window.requestAnimationFrame(f);return}a.current=t};return m=window.requestAnimationFrame(f),()=>window.cancelAnimationFrame(m)},[t,o]),s.jsx(vz,{value:n})}function vz({value:e}){const t=String(e).split("");return s.jsx("span",{className:"inline-flex items-baseline leading-none","aria-hidden":!0,children:t.map((n,r)=>s.jsx(xz,{digit:Number(n)},`${t.length}-${r}`))})}function xz({digit:e}){const t=Number.isFinite(e)?Math.min(9,Math.max(0,e)):0;return s.jsxs("span",{className:"relative inline-block h-[1em] w-[0.62em] overflow-hidden align-baseline leading-none",children:[s.jsx("span",{className:"invisible block h-[1em] leading-none",children:"0"}),s.jsx("span",{className:"absolute inset-x-0 top-0 flex flex-col transition-transform duration-200 ease-out will-change-transform",style:{transform:`translateY(-${t}em)`},children:Array.from({length:10},(n,r)=>s.jsx("span",{className:"block h-[1em] leading-none",children:r},r))})]})}function LC({edits:e,onOpenFilePreview:t}){return e.length===0?null:s.jsx("ul",{className:"space-y-1",children:e.map(n=>s.jsx(yz,{edit:n,onOpenFilePreview:t},n.key))})}function yz({edit:e,onOpenFilePreview:t}){const{t:n}=ie(),r=e.status==="editing",a=e.status==="error",o=!a&&!e.binary&&DC(e),i=a?OC(e.error):"",l=a?bz(e.error)||n("message.fileEditFailedFallback",{defaultValue:"File change was not applied."}):"",c=a?s.jsx(ja,{className:"h-3 w-3","aria-hidden":!0}):r?s.jsx(Jb,{className:"h-3 w-3 animate-spin","aria-hidden":!0}):s.jsx(Xb,{className:"h-3 w-3","aria-hidden":!0});return s.jsx(so,{as:"li",marker:s.jsx("span",{className:j("grid h-3.5 w-3.5 place-items-center rounded-full border bg-background transition-colors",a&&"border-destructive/30 text-destructive/78",r&&"border-muted-foreground/24 text-muted-foreground/65",!a&&!r&&"border-emerald-500/28 text-emerald-500/78"),children:c}),active:r,tone:a?"error":r?"active":"success",className:"text-xs",contentClassName:a?"min-w-0":"grid grid-cols-[minmax(0,1fr)_auto] items-center gap-3",title:i||e.absolute_path||e.path,label:e.pending&&!e.path?n("message.fileEditPreparing",{defaultValue:"Preparing file edit…"}):s.jsx(Xf,{path:e.path,tooltipPath:e.absolute_path,previewPath:e.absolute_path||e.path,onOpen:t,display:"path",active:r,className:"min-w-0",textClassName:"text-[12px]",testId:"activity-file-reference"}),detail:null,aside:o?s.jsx(eh,{added:e.added,deleted:e.deleted}):null,children:a?s.jsx("span",{className:"block max-w-[42rem] truncate text-[11px] leading-4 text-destructive/75",children:l}):null})}function DC(e){return e.added>0||e.deleted>0}function OC(e){const t=(e||"").replace(/\s+/g," ").trim();return t?t.replace(/^Error applying patch:\s*/i,"").replace(/^Error writing file:\s*/i,"").replace(/^Error editing file:\s*/i,"").replace(/^Error:\s*/i,""):""}function bz(e){const t=OC(e);return t?/\bpermission denied\b/i.test(t)||/\boperation not permitted\b/i.test(t)?"No permission to change this location.":t.replace(/^old_text not found in (.+)$/i,"Target text was not found in $1.").replace(/^old_text appears multiple times in (.+)$/i,"Target text matched multiple places in $1.").replace(/^file to (?:update|delete) does not exist: (.+)$/i,"File does not exist: $1.").replace(/^path to (?:update|delete) is not a file: (.+)$/i,"Path is not a file: $1.").slice(0,180):""}function wz({text:e,streaming:t,onOpenFilePreview:n}){const{t:r}=ie();return u.useEffect(()=>{e.length>0&&Lu()},[e.length]),s.jsx(so,{marker:s.jsx(kz,{streaming:t}),active:t,tone:t?"active":"success",label:t?r("message.reasoningStreaming",{defaultValue:"Thinking…"}):r("message.reasoning",{defaultValue:"Thinking"}),children:e.trim()?s.jsx(Du,{streaming:t,onOpenFilePreview:n,className:j("min-w-0 text-[12.5px] italic text-muted-foreground/78","prose-p:my-1 prose-li:my-0.5","prose-headings:mt-2 prose-headings:mb-1 prose-headings:font-medium","prose-headings:text-muted-foreground/88 prose-strong:text-muted-foreground","prose-h1:text-[15px] prose-h2:text-[13.5px] prose-h3:text-[12.5px] prose-h4:text-[12px]","prose-a:text-blue-500 prose-a:underline hover:prose-a:text-blue-600 dark:prose-a:text-blue-300 dark:hover:prose-a:text-blue-200","prose-code:text-[0.92em]"),children:e}):null})}function kz({streaming:e}){const t=u.useRef(e),[n,r]=u.useState(!1);return u.useEffect(()=>{if(t.current&&!e){r(!0);const a=window.setTimeout(()=>r(!1),650);return t.current=e,()=>window.clearTimeout(a)}t.current=e},[e]),e?s.jsx(Jb,{"data-testid":"activity-reasoning-marker","data-state":"thinking",className:"h-3.5 w-3.5 shrink-0 animate-spin text-muted-foreground/55",strokeWidth:1.8,"aria-hidden":!0}):s.jsx("span",{"data-testid":"activity-reasoning-marker","data-state":"done",className:j("grid h-3.5 w-3.5 shrink-0 place-items-center rounded-full border border-emerald-500/28 text-emerald-500/78","bg-emerald-500/[0.035] transition-[border-color,background-color,box-shadow,transform] duration-300 ease-out",n&&"animate-in fade-in-0 zoom-in-75 shadow-[0_0_0_3px_rgba(16,185,129,0.10)] motion-reduce:animate-none"),"aria-hidden":!0,children:s.jsx(Et,{className:j("h-2.5 w-2.5 stroke-[2.4]",n&&"animate-in fade-in-0 zoom-in-50 duration-300 motion-reduce:animate-none")})})}function Fu(e){var t;return e.role!=="assistant"||e.kind==="trace"||e.content.trim().length>0?!1:!!((t=e.reasoning)!=null&&t.length||e.reasoningStreaming||e.isStreaming)}function Ba(e){return Fu(e)||e.kind==="trace"}function Wc(e){if(e.length===0)return!1;const t=e[e.length-1];if(!Ba(t))return!1;let n=e.length-1;for(;n>0&&Ba(e[n-1]);)n-=1;const r=e.slice(n);if(r.some(i=>i.isStreaming||i.reasoningStreaming))return!0;const a=e[n-1];if(!a||a.role!=="assistant"||Ba(a))return!0;const o=new Set(r.map(i=>i.turnId).filter(i=>typeof i=="string"&&i.length>0));return a.turnId?o.size>0&&!o.has(a.turnId):o.size>0}function Cz(e,t={}){const n=[];let r=[],a;const o=(i={})=>{if(r.length===0)return;const l=[],c=Sz(r),d=jz(c);let p=0,m=[];const f=()=>{m.length&&(Az(l,m,d.slice(p)),m=[])};for(const h of c){if(Ba(h)){m.push(h);continue}if(FC(h)){m.push(Pz(h)),f(),l.push({type:"message",message:zC(h)}),p+=1;continue}f(),l.push({type:"message",message:h}),p+=1}f(),n.push(...Nz(l,i)),r=[],a=void 0};for(const i of e){if(i.role==="user"){o(),n.push({type:"message",message:i}),a=i.turnId;continue}i.turnId&&a&&i.turnId!==a&&o(),i.turnId&&(a=i.turnId),r.push(i)}return o(t),n}function Sz(e){return e.length<2||!e.every(t=>Number.isFinite(t.turnSeq))?e:e.map((t,n)=>({message:t,index:n})).sort((t,n)=>(t.message.turnSeq??0)-(n.message.turnSeq??0)||t.index-n.index).map(({message:t})=>t)}function Nz(e,t){var a,o;if(t.preserveTrailingActivity||e.length<2||((a=e[e.length-1])==null?void 0:a.type)!=="activity")return e;let n=e.length-1;for(;n>0&&((o=e[n-1])==null?void 0:o.type)==="activity";)n-=1;const r=e[n-1];return!r||r.type!=="message"||r.message.role!=="assistant"?e:[...e.slice(0,n-1),...e.slice(n),r]}function jz(e){const t=[];for(const n of e)Ba(n)||t.push(FC(n)?zC(n):n);return t}function Az(e,t,n){let r=[],a,o;const i=()=>{r.length&&(e.push({type:"activity",messages:r,items:r.flatMap(Tz),turnLatencyMs:Rz(r,n)}),r=[],a=void 0,o=void 0)};for(const l of t){const c=_z(l)?"file":"other",d=l.activitySegmentId;(a&&c!==a||c==="file"&&a==="file"&&!!o&&!!d&&o!==d)&&i(),a=c,d&&(o=d),r.push(l)}i()}function _z(e){var t;return e.kind==="trace"&&!!((t=e.fileEdits)!=null&&t.length)}function FC(e){var t;return e.role==="assistant"&&e.kind!=="trace"&&e.content.trim().length>0&&(!!((t=e.reasoning)!=null&&t.trim())||!!e.reasoningStreaming)}function Pz(e){return{id:`${e.id}-reasoning`,role:"assistant",content:"",createdAt:e.createdAt,reasoning:e.reasoning,reasoningStreaming:e.reasoningStreaming,isStreaming:e.reasoningStreaming,activitySegmentId:e.activitySegmentId,latencyMs:e.latencyMs}}function zC(e){const t={...e};return delete t.reasoning,delete t.reasoningStreaming,t}function Tz(e){var n,r,a;if(Fu(e))return[{type:"reasoning",message:e}];if(e.kind!=="trace")return[];const t=[];(n=e.fileEdits)!=null&&n.length&&t.push({type:"file_edit",message:e});for(const o of e.toolEvents??[]){const i=String(o.name??"").toLowerCase();i==="run_cli_app"?t.push({type:"cli",message:e}):i==="mcp"?t.push({type:"mcp",message:e}):t.push({type:"tool",message:e})}return t.length===0&&((r=e.traces)!=null&&r.length||e.content.trim())&&t.push({type:"tool",message:e}),(a=e.media)!=null&&a.length&&t.push({type:"media",message:e}),t}function Rz(e,t){for(let n=t.length-1;n>=0;n-=1){const r=t[n].latencyMs;if(cx(r))return r}for(let n=e.length-1;n>=0;n-=1){const r=e[n].latencyMs;if(cx(r))return r}}function cx(e){return typeof e=="number"&&Number.isFinite(e)&&e>=0}function Mz(e){const t=Iz(dx(e)),n=[];return[...ux(e.embeds),...ux(e.files)].forEach((a,o)=>{const i=Lz(a);i&&n.push({id:`${e.call_id||dx(e)||"tool"}:${o}:${i.url||i.name||i.kind}`,attachment:i,caption:i.name,source:t})}),n}function Ez(e){return(e.media??[]).map((t,n)=>({id:`${e.id}:media:${n}:${t.url||t.name||t.kind}`,attachment:t,caption:t.name,source:"media"}))}function ux(e){return Array.isArray(e)?e:[]}function dx(e){var t,n;return typeof((t=e.function)==null?void 0:t.name)=="string"?String((n=e.function)==null?void 0:n.name):typeof e.name=="string"?e.name:""}function Iz(e){const t=e.toLowerCase();return t.includes("browser")||t.includes("screenshot")?"browser":t.includes("web")||t.includes("search")||t.includes("fetch")||t.includes("read")?"web":t.includes("exec")||t.includes("shell")||t.includes("cli")?"shell":t.startsWith("mcp_")||t==="mcp"?"mcp":t.includes("file")||t.includes("patch")?"file":t.includes("image")||t.includes("video")||t.includes("media")?"media":"tool"}function Lz(e){if(typeof e=="string"){const i=e.trim();return i?cs({url:Oz(i)?i:void 0,name:px(i)}):null}if(!e||typeof e!="object"||Array.isArray(e))return null;const t=e,n=Zl(t,["url","href","src","uri","signed_url","thumbnail_url"]),r=Zl(t,["path","absolute_path","file","filename"]),a=Zl(t,["name","filename","title","label"])??px(n??r??""),o=Dz(t,n,a);return cs({url:n,name:a,kind:o})}function Zl(e,t){for(const n of t){const r=e[n];if(typeof r=="string"&&r.trim())return r.trim()}}function Dz(e,t,n){var a;const r=((a=Zl(e,["kind","type","mime","mime_type","content_type"]))==null?void 0:a.toLowerCase())??"";return r.includes("image")||r.includes("screenshot")?"image":r.includes("video")||r.includes("mp4")||r.includes("quicktime")?"video":r.includes("file")||r.includes("document")?"file":cs({url:t,name:n}).kind}function Oz(e){return/^(https?:|data:|\/api\/|blob:)/i.test(e)}function px(e){return(e.split(/[?#]/,1)[0]??"").split(/[\\/]/).filter(Boolean).pop()||void 0}function sl(e){var a,o;if(!e||typeof e!="object")return null;const t=e,n=typeof((a=t.function)==null?void 0:a.name)=="string"?t.function.name:typeof t.name=="string"?t.name:"";if(!n)return null;const r=((o=t.function)==null?void 0:o.arguments)??t.arguments;return typeof r=="string"&&r.trim()?`${n}(${r})`:r&&typeof r=="object"?`${n}(${JSON.stringify(r)})`:`${n}()`}const Fz=new Set(["start","end","error"]),mx={start:1,end:2,error:3};function $C(e){var n,r;if(!Array.isArray(e))return[];const t=[];for(const a of e){if(!a||typeof a!="object")continue;const o=a,i=o.phase;if(!(i&&typeof i=="string"&&Fz.has(i)))continue;const l=typeof o.name=="string"?o.name:"",c=typeof((n=o.function)==null?void 0:n.name)=="string"?String((r=o.function)==null?void 0:r.name):"";!l&&!c||t.push(o)}return t}function fx(e){return e.call_id?`call:${e.call_id}`:sl(e)??JSON.stringify(e)}function zz(e,t){if(!(e!=null&&e.length))return t;if(!t.length)return e;const n=[...e],r=new Map(n.map((a,o)=>[fx(a),o]));for(const a of t){const o=fx(a),i=r.get(o);if(i===void 0){r.set(o,n.length),n.push(a);continue}const l=n[i],c=mx[String(a.phase)]??0,d=mx[String(l.phase)]??0;n[i]=c>=d?{...l,...a}:l}return n}function UC(e){const t=new Set,n=[];for(const r of $C(e)){const a=r.call_id;if(a&&typeof a=="string"){if(t.has(a))continue;t.add(a)}const o=sl(r);o&&n.push(o)}return n}function $z(e,t){const n=new Set(e),r=[...e];let a=!1;for(const o of t)n.has(o)||(n.add(o),r.push(o),a=!0);return{traces:r,added:a}}const Uz="max-h-52",Bz=24;function Hz(e,t,n,r){let a=0,o=0;const i=n.length,l=r.length,c=n[n.length-1],d=c==null?void 0:c.name,p=c==null?void 0:c.status,m=r[r.length-1];for(const k of e){if(Fu(k)){a+=1;continue}if(k.kind==="trace"){const C=io(k);for(const N of C)!y$(N)&&!b$(N)&&(o+=1)}}let f=0,h=0,y=!1,x=!1,b=0,v=0,g,w;for(const k of t)g=k.path,w=k.absolute_path||k.path,k.status==="editing"&&(x=!0),k.status==="error"&&(b+=1),k.operation==="delete"&&(v+=1),!(k.status==="error"||k.binary)&&DC(k)&&(y=!0,f+=k.added,h+=k.deleted);return{reasoningSteps:a,toolCalls:o,cliCount:i,mcpCount:l,fileCount:t.length,added:f,deleted:h,hasDiffStats:y,hasEditingFiles:x,hasFailedFiles:t.length>0&&b===t.length,hasDeletedFiles:t.length>0&&v===t.length,primaryFilePath:g,primaryFileTooltipPath:w,primaryCliName:d,primaryCliStatus:p,primaryMcpName:m==null?void 0:m.presetName,primaryMcpDisplayName:m==null?void 0:m.displayName,primaryMcpStatus:m==null?void 0:m.status}}function Wz({messages:e,isTurnStreaming:t,hasBodyBelow:n,turnLatencyMs:r,cliApps:a=[],mcpPresets:o=[],onOpenFilePreview:i}){const{t:l}=ie(),c=u.useMemo(()=>K$(W$(e),t),[e,t]),d=u.useMemo(()=>C$(e),[e]),p=u.useMemo(()=>j$(e),[e]),m=u.useMemo(()=>new Map(a.map(ue=>[ue.name.toLowerCase(),ue])),[a]),f=u.useMemo(()=>new Map(o.map(ue=>[ue.name.toLowerCase(),ue])),[o]),{reasoningSteps:h,toolCalls:y,cliCount:x,mcpCount:b,fileCount:v,added:g,deleted:w,hasDiffStats:k,hasEditingFiles:C,hasFailedFiles:N,hasDeletedFiles:S,primaryFilePath:A,primaryFileTooltipPath:E,primaryCliName:_,primaryCliStatus:R,primaryMcpDisplayName:T,primaryMcpStatus:F}=Hz(e,c,d,p),z=c.some(ue=>ue.pending),[K,$]=u.useState(!1),[W,P]=u.useState(!1),[D,G]=u.useState(!1),[Y,oe]=u.useState(()=>Date.now()),de=u.useRef(null),pe=u.useRef(null),le=u.useRef(!0),I=u.useRef(null),Q=u.useRef(t),O=Q.current,ne=K?W:t||D||O&&!t,he=t&&C,ve=v===1?A:void 0,me=v===1?E:void 0,ee=h>0||y>0||x>0||b>0||v>0,we=v>0&&e.every(qz),je=y>0||x>0||b>0||v>0,xe=Gz(e,t,Y,r),Ee=Yz(xe),$e=je?t?l("message.activityWorkingFor",{duration:Ee,defaultValue:"Working for {{duration}}"}):xe<=0?l("message.activityWorked",{defaultValue:"Worked"}):l("message.activityWorkedFor",{duration:Ee,defaultValue:"Worked for {{duration}}"}):t?l("message.activityThinkingFor",{duration:Ee,defaultValue:"Thinking for {{duration}}"}):xe<=0?l("message.activityThought",{defaultValue:"Thought"}):l("message.activityThoughtFor",{duration:Ee,defaultValue:"Thought for {{duration}}"}),Se=v>0?z&&!ve?l("message.fileActivityPreparing",{defaultValue:"Preparing edit…"}):ve?l(U$(he,N,S),{file:Vz(ve),defaultValue:`${ec(he,N,S)} {{file}}`}):l(B$(he,N,S),{count:v,defaultValue:`${ec(he,N,S)} {{count}} files`}):"",Fe=x>0?x===1&&_?l(P$(R,t),{name:_,defaultValue:T$(R,t)}):l(R$(d,t),{count:x,defaultValue:M$(d,t)}):"",B=b>0?b===1&&T?l(L$(F,t),{name:T,defaultValue:D$(F,t)}):l(O$(p,t),{count:b,defaultValue:F$(p,t)}):"",X=v>0?Se:x>0?Fe:b>0?B:t?h>0?l("message.agentActivityLiveSummary",{reasoning:h,tools:y,defaultValue:"Working… · {{reasoning}} steps · {{tools}} tool calls"}):y===0&&v>0?l("message.agentActivityLiveFilesOnly",{defaultValue:"Working…"}):l("message.agentActivityLiveToolsOnly",{tools:y,defaultValue:"Working… · {{tools}} tool calls"}):h>0?l("message.agentActivitySummary",{reasoning:h,tools:y,defaultValue:"{{reasoning}} steps · {{tools}} tool calls"}):y===0&&v>0?l("message.agentActivityFilesOnly",{defaultValue:"File changes"}):l("message.agentActivityToolsOnly",{tools:y,defaultValue:"{{tools}} tool calls"}),J=u.useCallback(()=>{I.current!==null&&(window.cancelAnimationFrame(I.current),I.current=null)},[]),ye=u.useCallback(()=>{const ue=de.current;ue&&(ue.scrollTop=Math.max(0,ue.scrollHeight-ue.clientHeight))},[]),Ie=u.useCallback(()=>{J(),I.current=window.requestAnimationFrame(()=>{I.current=null,ye()})},[J,ye]),Ne=()=>{const ue=K?!W:!ne;ue&&(le.current=!0),$(!0),P(ue)};u.useLayoutEffect(()=>{!ne||!le.current||Ie()},[ne,e,t,Ie]),u.useEffect(()=>{if(!ne){le.current=!0;return}const ue=pe.current;if(!ue||typeof ResizeObserver>"u")return;const Be=new ResizeObserver(()=>{le.current&&Ie()});return Be.observe(ue),()=>Be.disconnect()},[ne,Ie]),u.useEffect(()=>J,[J]),u.useEffect(()=>{if(!t)return;const ue=window.setInterval(()=>oe(Date.now()),500);return()=>window.clearInterval(ue)},[t]),u.useEffect(()=>{const ue=Q.current;if(Q.current=t,t){G(!1);return}if(!ue||K)return;G(!0);const Be=window.setTimeout(()=>G(!1),900);return()=>window.clearTimeout(Be)},[t,K]);const Je=u.useCallback(()=>{const ue=de.current;if(!ue)return;const Be=ue.scrollHeight-ue.scrollTop-ue.clientHeight;le.current=Be<Bz},[]);return ee?we?s.jsx(Kz,{edits:c,active:t,hasBodyBelow:n,summary:X,singleFilePath:ve,singleFileTooltipPath:me,hasLiveEditingFiles:he,hasFailedFiles:N,hasDeletedFiles:S,added:g,deleted:w,hasDiffStats:k,onOpenFilePreview:i}):s.jsxs("div",{className:j("w-full",n&&"mb-2"),children:[s.jsxs("button",{type:"button",onClick:Ne,className:j("group flex max-w-full items-center gap-1.5 rounded-md px-1 py-1","text-[12.5px] text-muted-foreground/72 transition-colors hover:text-muted-foreground"),"aria-expanded":ne,"aria-label":X,children:[s.jsx(Ou,{active:t,className:"min-w-0",children:ve?ec(he,N,S):$e}),ve?s.jsx(Xf,{path:ve,tooltipPath:me,previewPath:me||ve,onOpen:i,active:he,className:"-my-0.5 min-w-0",textClassName:"text-xs",testId:"activity-header-file-reference"}):null,s.jsx("span",{className:"flex min-w-0 flex-wrap items-center gap-x-1.5 gap-y-0.5 text-left",children:v>0&&k&&s.jsx("span",{className:"inline-flex min-w-0 items-center gap-1 text-muted-foreground/85",children:s.jsx(eh,{added:g,deleted:w})})}),s.jsx(Wr,{"aria-hidden":!0,className:j("h-3.5 w-3.5 shrink-0 transition-transform duration-200",ne&&"rotate-90")})]}),ne&&s.jsx("div",{className:j("ml-1 mt-1 overflow-hidden pl-1"),children:s.jsx("div",{ref:de,"data-testid":"agent-activity-scroll",onScroll:Je,className:j(Uz,"overflow-y-auto py-1 pr-1 scrollbar-thin scrollbar-track-transparent"),children:s.jsxs("div",{ref:pe,className:"flex flex-col gap-0.5",children:[e.map(ue=>Fu(ue)?s.jsx(wz,{text:ue.reasoning??"",streaming:t&&!!ue.reasoningStreaming,onOpenFilePreview:i},ue.id):ue.kind==="trace"?s.jsx(Jz,{message:ue,active:t,cliAppsByName:m,mcpPresetsByName:f},ue.id):null),c.length?s.jsx(LC,{edits:c,onOpenFilePreview:i}):null]})})})]}):null}function qz(e){var t;return e.kind!=="trace"||!((t=e.fileEdits)!=null&&t.length)?!1:io(e).every(n=>!n.trim()||w$(n))}function Kz({edits:e,active:t,hasBodyBelow:n,summary:r,singleFilePath:a,singleFileTooltipPath:o,hasLiveEditingFiles:i,hasFailedFiles:l,hasDeletedFiles:c,added:d,deleted:p,hasDiffStats:m,onOpenFilePreview:f}){const h=e.length>1||e.some(y=>y.status==="error"||y.pending);return s.jsxs("div",{className:j("w-full",n&&"mb-2"),"aria-label":r,children:[s.jsxs("div",{className:j("flex max-w-full items-center gap-1.5 px-1 py-1","text-[12.5px] text-muted-foreground/72"),children:[s.jsx(Ou,{active:t,className:"min-w-0",children:a?ec(i,l,c):r}),a?s.jsx(Xf,{path:a,tooltipPath:o,previewPath:o||a,onOpen:f,active:i,className:"-my-0.5 min-w-0",textClassName:"text-xs",testId:"activity-header-file-reference"}):null,m?s.jsx("span",{className:"inline-flex min-w-0 items-center gap-1 text-muted-foreground/85",children:s.jsx(eh,{added:d,deleted:p})}):null]}),h?s.jsx("div",{className:"mt-0.5 pl-4",children:s.jsx(LC,{edits:e,onOpenFilePreview:f})}):null]})}function Vz(e){return e.split(/[\\/]/).pop()||e}function Gz(e,t,n,r){if(!t&&Number.isFinite(r)&&r>=0)return Math.round(r);const a=e.map(l=>l.createdAt).filter(l=>Number.isFinite(l));if(!a.length)return 0;const o=Math.min(...a),i=t&&o>1e12?n:Math.max(...a);return Math.max(0,i-o)}function Yz(e){const t=e>0&&e<1e3?1:Math.max(0,Math.round(e/1e3));if(t<60)return`${t}s`;const n=Math.floor(t/60),r=t%60;return r?`${n}m ${r}s`:`${n}m`}function io(e){var t;return(t=e.traces)!=null&&t.length?e.traces:e.content.trim()?[e.content]:[]}function BC(e){return(e.agentUi??[]).filter(t=>t.kind.startsWith("subagent_"))}function Qz(e){return BC(e).length>0}function Xz({lines:e,active:t,evidenceByLine:n}){return s.jsx("ul",{className:"space-y-1",children:e.map((r,a)=>s.jsx(e$,{line:r,active:t&&a===e.length-1,evidence:(n==null?void 0:n.get(r))??[]},`${r}-${a}`))})}function Jz({message:e,active:t,cliAppsByName:n,mcpPresetsByName:r}){if(Qz(e))return s.jsx(Zz,{message:e,active:t});const a=io(e),o=k$(e),i=N$(e),l=n$(e),c=Ez(e),d=new Set,p=[];let m=[];const f=y=>{m.length&&(p.push(s.jsx(Xz,{lines:m,active:t,evidenceByLine:l},`${e.id}:trace:${y}`)),m=[])};a.forEach((y,x)=>{const b=o.get(y)??qC(y);if(b){f(String(x)),d.add(b.key),p.push(s.jsx(yx,{runs:[b],active:t,cliAppsByName:n},`${e.id}:cli:${b.key}:${x}`));const g=l.get(y)??[];g.length&&p.push(s.jsx(Ud,{evidence:g},`${e.id}:cli-evidence:${b.key}:${x}`));return}const v=i.get(y)??tS(y);if(v){f(String(x)),d.add(v.key),p.push(s.jsx(bx,{runs:[v],active:t,mcpPresetsByName:r},`${e.id}:mcp:${v.key}:${x}`));const g=l.get(y)??[];g.length&&p.push(s.jsx(Ud,{evidence:g},`${e.id}:mcp-evidence:${v.key}:${x}`));return}m.push(y)}),f("tail");for(const y of o.values())d.has(y.key)||p.push(s.jsx(yx,{runs:[y],active:t,cliAppsByName:n},`${e.id}:cli:${y.key}:event`));for(const y of i.values())d.has(y.key)||p.push(s.jsx(bx,{runs:[y],active:t,mcpPresetsByName:r},`${e.id}:mcp:${y.key}:event`));if(c.length&&p.push(s.jsx(Ud,{evidence:c},`${e.id}:media-evidence`)),!p.length)return null;const h=a$(e,l,c);return s.jsx(IC,{title:h.title,icon:h.icon,children:p})}function Zz({message:e,active:t}){const n=BC(e),r=io(e),a=r.map((o,i)=>{const l=n[Math.min(i,Math.max(n.length-1,0))],c=(l==null?void 0:l.kind)??"subagent_status",d=typeof(l==null?void 0:l.data)=="object"&&(l!=null&&l.data)&&"phase"in l.data?String(l.data.phase??""):"",p=c==="subagent_reasoning"?"子 Agent 分析":c==="subagent_output"?"子 Agent 输出":"子 Agent 状态";return s.jsx(so,{as:"li",icon:Ga,active:t&&i===r.length-1,tone:c==="subagent_output"?"success":"active",label:p,detail:d?`${d} · ${o}`:o,className:"subagent-activity-step",contentClassName:"subagent-activity-content",markerClassName:"subagent-activity-marker"},`${e.id}:subagent:${i}`)});return s.jsx(IC,{title:"会议整理子 Agent",icon:Ga,children:s.jsx("ul",{className:"space-y-1",children:a})})}function e$({line:e,active:t,evidence:n=[]}){const r=i$(e),a=r.kind==="search"?Tt:r.kind==="done"?Xb:r.kind==="tool"?lw:Ni;return s.jsx(so,{as:"li",marker:s.jsx(s$,{trace:r,fallbackIcon:a,active:t}),active:t&&r.kind!=="done",tone:r.kind==="done"?"success":t?"active":"neutral",label:r.label,detail:r.detail,title:`${r.label}${r.detail?` ${r.detail}`:""}`,children:s.jsx(EC,{evidence:n})})}function Ud({evidence:e}){return s.jsx("ul",{className:"space-y-1",children:s.jsx(so,{as:"li",icon:Vl,tone:"success",label:t$(e),children:s.jsx(EC,{evidence:e})})})}function t$(e){var n;const t=(n=e[0])==null?void 0:n.attachment.kind;return t==="image"?e.length>1?"Found images":"Found image":t==="video"?e.length>1?"Found videos":"Found video":e.length>1?"Found files":"Found file"}function n$(e){const t=new Map;for(const n of e.toolEvents??[]){const r=Mz(n);if(!r.length)continue;const a=sl(n);if(!a)continue;const o=t.get(a)??[];t.set(a,[...o,...r])}return t}function r$(e){return[...e.values()].flat()}function a$(e,t,n){var i;const r=[...io(e).map(l=>{var c;return((c=/^([a-zA-Z0-9_.-]+)\(/.exec(l.trim()))==null?void 0:c[1])??l}),...(e.toolEvents??[]).map(o$)].map(l=>l.toLowerCase()),a=[...r$(t),...n];return a.some(l=>l.attachment.kind==="image"||l.attachment.kind==="video")&&r.some(l=>/browser|screenshot|vision|image|video/.test(l))?{title:"Vision",icon:Vl}:r.some(l=>/browser|screenshot/.test(l))?{title:"Browser",icon:Vl}:r.some(l=>/web|search|fetch|read|open/.test(l))?{title:"Web",icon:Tt}:r.some(l=>/exec|shell|terminal|bash|run_cli_app|cli_anything/.test(l))?{title:"Shell",icon:_c}:r.some(l=>/^mcp_|mcp/.test(l))?{title:"MCP",icon:ts}:(i=e.fileEdits)!=null&&i.length?{title:"Files",icon:Ni}:a.length?{title:"Media",icon:Vl}:{title:"Working",icon:Ni}}function o$(e){var t,n;return typeof((t=e.function)==null?void 0:t.name)=="string"?String((n=e.function)==null?void 0:n.name):typeof e.name=="string"?e.name:""}function s$({trace:e,fallbackIcon:t,active:n}){const[r,a]=u.useState(0),o=e.host?Uc(e.host)[r]:void 0;return u.useEffect(()=>a(0),[e.host]),e.url&&e.host&&o?s.jsx("span",{"data-testid":`activity-web-favicon-${e.host}`,className:j("grid h-4 w-4 shrink-0 place-items-center overflow-hidden rounded-[4px] border border-border/45 bg-background shadow-[inset_0_0_0_1px_rgba(0,0,0,0.02)]",n&&"animate-pulse"),"aria-hidden":!0,children:s.jsx("img",{src:o,alt:"",className:"h-3.5 w-3.5 object-contain",onError:()=>a(i=>i+1)})}):s.jsx(t,{className:j("h-3.5 w-3.5 shrink-0",e.kind==="done"?"text-emerald-500/75":n?"text-muted-foreground/75":"text-muted-foreground/45"),"aria-hidden":!0})}function i$(e){const t=e.trim(),n=/^([a-zA-Z0-9_.-]+)\((.*)\)$/.exec(t),r=(n==null?void 0:n[1])??"",a=(n==null?void 0:n[2])??"",o=h$(a,t),i=o?v$(o):"",l=!!o&&/\b(fetch(?:ing|ed)?|read(?:ing)?|opened?|opening)\b/i.test(t);return/search/i.test(r)?{kind:"search",label:"Searching",detail:gx(a,t)}:/fetch|read|open/i.test(r)||l?{kind:"tool",label:"Reading",detail:i||gx(a,t),url:o==null?void 0:o.href,host:o?WC(o.hostname):void 0}:l$(r)?{kind:"tool",label:"Command",detail:c$(a,t)}:r?{kind:"tool",label:"Using",detail:r}:/done|complete|success/i.test(t)?{kind:"done",label:"Done",detail:t}:{kind:"trace",label:"Working",detail:t}}function l$(e){const t=e.toLowerCase().split(".").pop()||e.toLowerCase();return new Set(["exec","exec_command","execute_command","run_command","run_shell","shell","terminal","bash","sh"]).has(t)}function c$(e,t){const n=u$(e)||t;return d$(n)}function u$(e){const t=e.trim();if(!t)return"";try{const n=JSON.parse(t);if(typeof n=="string")return n;if(!n||typeof n!="object"||Array.isArray(n))return"";const r=n;for(const a of["command","cmd","script","input"]){const o=r[a];if(typeof o=="string"&&o.trim())return o}}catch{return t.replace(/^["']|["']$/g,"")}return""}function d$(e){const n=p$(e.replace(/\r\n/g,`
`)).split(`
`).map(o=>o.trim()).filter(Boolean),r=m$(n[0]||"command"),a=f$(r,92);return n.length<=1?a:`${a} · script, ${n.length} lines`}function p$(e){return e.replace(/\b((?:[A-Z0-9_]*)(?:API[_-]?KEY|TOKEN|SECRET|PASSWORD|PASS|AUTH)(?:[A-Z0-9_]*))=(?:"[^"]*"|'[^']*'|[^\s]+)/gi,"$1=••••").replace(/\b(Bearer)\s+[A-Za-z0-9._~+/=-]+/gi,"$1 ••••").replace(/(--(?:api-?key|token|secret|password)(?:=|\s+))(?:"[^"]*"|'[^']*'|[^\s]+)/gi,"$1••••").replace(/([?&](?:api_?key|token|secret|password)=)[^&\s]+/gi,"$1••••")}function m$(e){return e.replace(/\/Users\/[^/\s"']+/g,"~").replace(/\/private\/tmp\/[^\s"']+/g,"/tmp/…").replace(/\/var\/folders\/[^\s"']+/g,"/var/folders/…")}function f$(e,t){if(e.length<=t)return e;const n=Math.ceil((t-1)*.62),r=Math.floor((t-1)*.38);return`${e.slice(0,n)}…${e.slice(-r)}`}function h$(e,t){var a;const n=[],r=e.trim();if(r)try{HC(JSON.parse(r),n)}catch{n.push(r.replace(/^["']|["']$/g,""))}n.push(t);for(const o of n){const i=hx(o);if(i)return i;const l=(a=o.match(/https?:\/\/[^\s"'<>),]+/i))==null?void 0:a[0];if(l){const c=hx(l);if(c)return c}}return null}function HC(e,t){if(typeof e=="string"){t.push(e);return}if(!e||typeof e!="object")return;if(Array.isArray(e)){for(const r of e.slice(0,6))HC(r,t);return}const n=e;for(const r of["url","uri","href","link"])typeof n[r]=="string"&&t.push(n[r])}function hx(e){try{const t=new URL(e);return t.protocol!=="http:"&&t.protocol!=="https:"||g$(t.hostname)?null:t}catch{return null}}function g$(e){const t=e.replace(/^\[|\]$/g,"").toLowerCase();if(!t||t==="localhost"||t.endsWith(".local")||!t.includes(".")&&!t.includes(":"))return!0;const n=/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/.exec(t);if(n){const[,r,a]=n,o=Number(r),i=Number(a);return o===0||o===10||o===127||o===100&&i>=64&&i<=127||o===169&&i===254||o===172&&i>=16&&i<=31||o===192&&i===168}return t==="::1"||t.startsWith("fc")||t.startsWith("fd")||t.startsWith("fe80:")}function WC(e){return e.replace(/^www\./i,"").toLowerCase()}function v$(e){const t=WC(e.hostname),n=e.pathname&&e.pathname!=="/"?e.pathname:"";return`${t}${n}`}function gx(e,t){const n=e.trim();if(!n)return t;try{const r=JSON.parse(n),a=ZC(r);if(a)return a}catch{}return n.replace(/^["']|["']$/g,"")}const x$=new Set(["run_cli_app","cli_anything_run"]),vx={running:1,done:2,error:3},xx={running:1,done:2,error:3},zu=/^mcp_([a-z0-9_-]+?)_(.+)$/i;function y$(e){return/^(run_cli_app|cli_anything_run)\(/.test(e.trim())}function b$(e){return zu.test(e.trim().split("(",1)[0]??"")}function w$(e){return/^(write_file|edit_file|apply_patch)\(/.test(e.trim())}function qC(e,t="running"){const n=/^(run_cli_app|cli_anything_run)\((.*)\)$/.exec(e.trim());if(!n)return null;const r=n[2].trim();let a={};if(r)try{a=JSON.parse(r)}catch{return{key:e,name:"cli",args:[r],json:!1,status:t}}return QC(a,{key:e,status:t})}function KC(e){var r;const n=((r=e.function)==null?void 0:r.arguments)??e.arguments;if(typeof n!="string")return n??{};if(!n.trim())return{};try{return JSON.parse(n)}catch{return{args:[n]}}}function VC(e){return e==="error"?"error":e==="end"?"done":"running"}function GC(e){const t=e.error;if(typeof t=="string")return t;if(t&&typeof t=="object")return JSON.stringify(t)}function YC(e){var t,n;return typeof((t=e.function)==null?void 0:t.name)=="string"?String((n=e.function)==null?void 0:n.name):typeof e.name=="string"?e.name:""}function QC(e,t){if(!e||typeof e!="object"||Array.isArray(e))return{key:t.key,name:"cli",args:[],json:!1,status:t.status,error:t.error};const n=e,r=typeof n.name=="string"&&n.name.trim()?n.name.trim():"cli",o=(Array.isArray(n.args)?n.args:[]).filter(i=>typeof i=="string");return{key:t.key,name:r,args:o,json:n.json===!0||n.json==="true",workingDir:typeof n.working_dir=="string"?n.working_dir:void 0,status:t.status,error:t.error}}function XC(e){const t=YC(e);if(!x$.has(t))return null;const n=KC(e),r=e.call_id?`call:${e.call_id}`:`${t}:${JSON.stringify(n)}`;return QC(n,{key:r,status:VC(e.phase),error:GC(e)})}function k$(e){const t=new Map;for(const n of e.toolEvents??[]){const r=XC(n);if(!r)continue;const a=sl(n);a&&t.set(a,JC(t.get(a),r))}return t}function JC(e,t){return e?vx[t.status]>=vx[e.status]?{...e,...t}:e:t}function C$(e){const t=new Map;for(const n of e){if(n.kind!=="trace")continue;let r=!1;for(const a of n.toolEvents??[]){const o=XC(a);o&&(r=!0,t.set(o.key,JC(t.get(o.key),o)))}if(!r)for(const a of io(n)){const o=qC(a);!o||t.has(o.key)||t.set(o.key,o)}}return[...t.values()]}function S$(e){return e.split(/[-_]/).filter(Boolean).map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")||e}function Il(e){return typeof e=="string"&&e.trim()?e.trim():typeof e=="number"||typeof e=="boolean"?String(e):null}function ZC(e){if(!e||typeof e!="object"||Array.isArray(e))return Il(e)??"";const t=e;for(const r of["url","query","q","path","name","id","title","message","text"]){const a=Il(t[r]);if(a)return`${r}: ${a}`}return Object.entries(t).filter(([,r])=>Il(r)!==null).slice(0,2).map(([r,a])=>`${r}: ${Il(a)}`).join(" · ")}function eS(e,t,n){const r=zu.exec(e);if(!r)return null;const a=r[1].toLowerCase();return{key:n.key,presetName:a,displayName:S$(a),toolName:r[2],argsPreview:ZC(t),status:n.status,error:n.error}}function tS(e,t="running"){const n=/^([a-z0-9_-]+)\((.*)\)$/i.exec(e.trim());if(!n||!zu.test(n[1]))return null;const r=n[2].trim();let a={};if(r)try{a=JSON.parse(r)}catch{a=r}return eS(n[1],a,{key:e,status:t})}function nS(e){const t=YC(e);if(!zu.test(t))return null;const n=KC(e),r=e.call_id?`call:${e.call_id}`:`${t}:${JSON.stringify(n)}`;return eS(t,n,{key:r,status:VC(e.phase),error:GC(e)})}function N$(e){const t=new Map;for(const n of e.toolEvents??[]){const r=nS(n);if(!r)continue;const a=sl(n);a&&t.set(a,rS(t.get(a),r))}return t}function rS(e,t){return e?xx[t.status]>=xx[e.status]?{...e,...t}:e:t}function j$(e){const t=new Map;for(const n of e){if(n.kind!=="trace")continue;let r=!1;for(const a of n.toolEvents??[]){const o=nS(a);o&&(r=!0,t.set(o.key,rS(t.get(o.key),o)))}if(!r)for(const a of io(n)){const o=tS(a);!o||t.has(o.key)||t.set(o.key,o)}}return[...t.values()]}function A$(e){return/\s/.test(e)?JSON.stringify(e):e}function _$(e){return[...e.json?["--json"]:[],...e.args].map(A$).join(" ")}function P$(e,t){return e==="error"?"message.cliActivityFailedOne":t&&e==="running"?"message.cliActivityRunningOne":"message.cliActivityRanOne"}function T$(e,t){return e==="error"?"Failed @{{name}}":`${t&&e==="running"?"Using":"Used"} @{{name}}`}function R$(e,t){return e.some(n=>n.status==="error")?"message.cliActivityFailedMany":t&&e.some(n=>n.status==="running")?"message.cliActivityRunningMany":"message.cliActivityRanMany"}function M$(e,t){return e.some(n=>n.status==="error")?"{{count}} CLI apps failed":`${t&&e.some(n=>n.status==="running")?"Using":"Used"} {{count}} CLI apps`}function E$(e,t){return e.status==="error"?"message.cliRunFailed":t&&e.status==="running"?"message.cliRunRunning":"message.cliRunRan"}function I$(e,t){return e.status==="error"?"Failed":t&&e.status==="running"?"Using":"Used"}function L$(e,t){return e==="error"?"message.mcpActivityFailedOne":t&&e==="running"?"message.mcpActivityRunningOne":"message.mcpActivityRanOne"}function D$(e,t){return e==="error"?"Failed {{name}}":`${t&&e==="running"?"Using":"Used"} {{name}}`}function O$(e,t){return e.some(n=>n.status==="error")?"message.mcpActivityFailedMany":t&&e.some(n=>n.status==="running")?"message.mcpActivityRunningMany":"message.mcpActivityRanMany"}function F$(e,t){return e.some(n=>n.status==="error")?"{{count}} MCP calls failed":`${t&&e.some(n=>n.status==="running")?"Using":"Used"} {{count}} MCP tools`}function z$(e,t){return e.status==="error"?"message.mcpRunFailed":t&&e.status==="running"?"message.mcpRunRunning":"message.mcpRunRan"}function $$(e,t){return e.status==="error"?"Failed":t&&e.status==="running"?"Using":"Used"}function ec(e,t,n){return t?"Failed":n?e?"Deleting":"Deleted":e?"Editing":"Edited"}function U$(e,t,n){return t?"message.fileActivityFailedOne":n?e?"message.fileActivityDeletingOne":"message.fileActivityDeletedOne":e?"message.fileActivityEditingOne":"message.fileActivityEditedOne"}function B$(e,t,n){return t?"message.fileActivityFailedMany":n?e?"message.fileActivityDeletingMany":"message.fileActivityDeletedMany":e?"message.fileActivityEditingMany":"message.fileActivityEditedMany"}function H$(e){return e.call_id?`${e.call_id}|${e.tool}`:`${e.tool}|${e.path}`}function W$(e){var n;const t=[];for(const r of e)r.kind==="trace"&&((n=r.fileEdits)!=null&&n.length)&&t.push(...r.fileEdits);return t}function q$(e){const t=[],n=new Map;for(const r of e){const a=H$(r);n.has(a)||t.push(a),n.set(a,r)}return t.map(r=>n.get(r)).filter(Boolean)}function K$(e,t){const n=[],r=new Map;for(const a of q$(e)){const o=a.path||a.call_id||a.tool;let i=r.get(o);if(i||(i={key:o,path:a.path||"",absolute_path:a.absolute_path,added:0,deleted:0,approximate:!1,binary:!1,pending:!1,hasSuccessfulChange:!1,hasActiveEditing:!1,hasFailed:!1,operation:void 0},r.set(o,i),n.push(o)),a.path&&!i.path&&(i.path=a.path),a.absolute_path&&(i.absolute_path=a.absolute_path),a.operation==="delete"&&(i.operation="delete"),i.pending=i.pending||!!a.pending||!a.path,!a.path&&a.pending){t&&a.status==="editing"&&(i.hasActiveEditing=!0,i.approximate=i.approximate||!!a.approximate,a.binary||(i.added+=a.added,i.deleted+=a.deleted));continue}if(t&&a.status==="editing"){i.hasActiveEditing=!0,i.binary=i.binary||!!a.binary,i.approximate=i.approximate||!!a.approximate,a.binary||(i.added+=a.added,i.deleted+=a.deleted);continue}if(a.status==="error"){i.hasFailed=!0,i.error=a.error??i.error;continue}i.hasSuccessfulChange=!0,i.binary=i.binary||!!a.binary,i.approximate=t&&(i.approximate||!!a.approximate),a.binary||(i.added+=a.added,i.deleted+=a.deleted)}return n.flatMap(a=>{const o=r.get(a);if(!o.path&&!o.hasActiveEditing&&!o.hasSuccessfulChange&&!o.hasFailed)return[];const i=o.hasActiveEditing?"editing":o.hasSuccessfulChange?"done":o.hasFailed?"error":"done";return[{key:o.key,path:o.path,absolute_path:o.absolute_path,added:o.added,deleted:o.deleted,approximate:o.approximate,binary:o.binary,status:i,operation:o.operation,pending:o.pending&&!o.path,error:o.error}]})}function yx({runs:e,active:t,cliAppsByName:n}){return e.length===0?null:s.jsx("ul",{className:"space-y-1","data-testid":"activity-cli-runs",children:e.map(r=>s.jsx(V$,{run:r,active:t,app:n.get(r.name.toLowerCase())},r.key))})}function V$({run:e,active:t,app:n}){const{t:r}=ie(),[a,o]=u.useState(0),i=_$(e),l=e.status==="error",c=t&&e.status==="running",d=l?"#DC2626":(n==null?void 0:n.brand_color)||"#0891B2",m=u.useMemo(()=>oo(n==null?void 0:n.logo_url),[n==null?void 0:n.logo_url])[a],f=r(E$(e,t),{defaultValue:I$(e,t)});return u.useEffect(()=>o(0),[n==null?void 0:n.logo_url]),s.jsx(so,{as:"li",active:c,tone:l?"error":c?"active":e.status==="done"?"success":"neutral",title:`${f} @${e.name}${i?` ${i}`:""}${e.error?` ${e.error}`:""}`,label:f,marker:s.jsx("span",{"data-testid":`activity-cli-logo-${e.name.toLowerCase()}`,className:j("grid h-4 w-4 shrink-0 place-items-center overflow-hidden rounded-[4px] border text-[6.5px] font-semibold text-white",c&&"animate-pulse"),style:{borderColor:qc(d,22),backgroundColor:m?"hsl(var(--background))":d,boxShadow:c?`0 0 0 3px ${qc(d,9)}`:void 0},"aria-hidden":!0,children:m?s.jsx("img",{src:m,alt:"",className:"h-[78%] w-[78%] object-contain",onError:()=>o(h=>h+1)}):n?uC(n).slice(0,2):s.jsx(_c,{className:"h-3 w-3","aria-hidden":!0})}),children:s.jsxs("div",{className:"-mt-0.5 flex min-w-0 flex-wrap items-baseline gap-x-1.5 gap-y-0.5",children:[s.jsxs("span",{className:"max-w-[11rem] shrink-0 truncate font-mono text-[12.5px] font-semibold text-foreground/90",children:["@",e.name]}),l?s.jsx(ja,{className:"h-3 w-3 shrink-0 translate-y-[0.16em] text-destructive/75","aria-hidden":!0}):null,i?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"shrink-0 text-muted-foreground/36",children:"·"}),s.jsx("span",{className:"min-w-0 truncate font-mono text-[12px] text-muted-foreground/72",children:i})]}):null,e.error?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"shrink-0 text-muted-foreground/30",children:"·"}),s.jsx("span",{className:"min-w-0 truncate text-[12px] text-destructive/72",children:e.error})]}):null,e.workingDir&&!e.error?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"shrink-0 text-muted-foreground/30",children:"·"}),s.jsx("span",{className:"min-w-0 truncate text-[12px] text-muted-foreground/55",children:e.workingDir})]}):null]})})}function bx({runs:e,active:t,mcpPresetsByName:n}){return e.length===0?null:s.jsx("ul",{className:"space-y-1","data-testid":"activity-mcp-runs",children:e.map(r=>s.jsx(G$,{run:r,active:t,preset:n.get(r.presetName.toLowerCase())},r.key))})}function G$({run:e,active:t,preset:n}){const{t:r}=ie(),[a,o]=u.useState(0),i=e.status==="error",l=t&&e.status==="running",c=i?"#DC2626":(n==null?void 0:n.brand_color)||"#6D5DF6",p=u.useMemo(()=>oo(n==null?void 0:n.logo_url),[n==null?void 0:n.logo_url])[a],m=(n==null?void 0:n.display_name)||e.displayName,f=r(z$(e,t),{defaultValue:$$(e,t)});return u.useEffect(()=>o(0),[n==null?void 0:n.logo_url]),s.jsx(so,{as:"li",active:l,tone:i?"error":l?"active":e.status==="done"?"success":"neutral",title:`${f} ${m} ${e.toolName}${e.argsPreview?` ${e.argsPreview}`:""}${e.error?` ${e.error}`:""}`,label:f,marker:s.jsx("span",{"data-testid":`activity-mcp-logo-${e.presetName.toLowerCase()}`,className:j("grid h-4 w-4 shrink-0 place-items-center overflow-hidden rounded-[4px] border text-[6.5px] font-semibold text-white",l&&"animate-pulse"),style:{borderColor:qc(c,22),backgroundColor:p?"hsl(var(--background))":c,boxShadow:l?`0 0 0 3px ${qc(c,9)}`:void 0},"aria-hidden":!0,children:p?s.jsx("img",{src:p,alt:"",className:"h-[78%] w-[78%] object-contain",onError:()=>o(h=>h+1)}):n?dC(n).slice(0,2):s.jsx(ts,{className:"h-3 w-3","aria-hidden":!0})}),children:s.jsxs("div",{className:"-mt-0.5 flex min-w-0 flex-wrap items-baseline gap-x-1.5 gap-y-0.5",children:[s.jsx("span",{className:"max-w-[12rem] shrink-0 truncate text-[12.5px] font-semibold text-foreground/90",children:m}),i?s.jsx(ja,{className:"h-3 w-3 shrink-0 translate-y-[0.16em] text-destructive/75","aria-hidden":!0}):null,s.jsx("span",{className:"shrink-0 text-muted-foreground/36",children:"·"}),s.jsxs("span",{className:"min-w-0 truncate font-mono text-[12px] text-muted-foreground/72",children:[e.toolName,e.argsPreview?` · ${e.argsPreview}`:""]}),e.error?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"shrink-0 text-muted-foreground/30",children:"·"}),s.jsx("span",{className:"min-w-0 truncate text-[12px] text-destructive/72",children:e.error})]}):null]})})}function qc(e,t){if(/^#[0-9a-f]{6}$/i.test(e)){const n=Math.round(t/100*255).toString(16).padStart(2,"0");return`${e}${n}`}return`color-mix(in srgb, ${e} ${t}%, transparent)`}function Y$(e,t=!1){return Cz(e,{preserveTrailingActivity:t})}function Q$(e){const t=new Array(e.length).fill(!0);let n=!1;for(let r=e.length-1;r>=0;r-=1){const a=e[r];if(a.type==="message"&&a.message.role==="user"){n=!1;continue}a.type==="message"&&a.message.role==="assistant"&&(t[r]=!n),n=!0}return t}function X$({messages:e,isStreaming:t=!1,hiddenUserMessageCount:n=0,cliApps:r=[],mcpPresets:a=[],forkBoundaryMessageCount:o=null,onOpenFilePreview:i,onForkFromMessage:l}){const{t:c}=ie(),d=u.useMemo(()=>Y$(e,t),[t,e]),p=u.useMemo(()=>J$(d,o),[o,d]),m=u.useMemo(()=>Q$(d),[d]),f=u.useMemo(()=>t?e8(d):new Set,[t,d]),h=u.useMemo(()=>t8(d),[d]);let y=n;return s.jsx("div",{className:"flex w-full flex-col",children:d.map((x,b)=>{const v=d[b-1],g=b>0?r8(v):"",w=d[b+1],k=x.type==="activity"&&(w==null?void 0:w.type)==="message"&&w.message.role==="assistant",C=x.type==="message"&&x.message.role==="user"?x.message.id:void 0,N=x.type==="message"&&x.message.role==="assistant"&&m[b]?y:void 0;return x.type==="message"&&x.message.role==="user"&&(y+=1),s.jsxs(u.Fragment,{children:[s.jsx("div",{className:g,"data-user-prompt-id":C,children:x.type==="activity"?s.jsx(Wz,{messages:x.messages,isTurnStreaming:f.has(b),hasBodyBelow:k,turnLatencyMs:x.turnLatencyMs,cliApps:r,mcpPresets:a,onOpenFilePreview:i}):s.jsx(lz,{message:x.message,showAssistantCopyAction:x.message.role==="assistant"?m[b]:!0,cliApps:r,mcpPresets:a,onOpenFilePreview:i,onForkFromHere:l&&N!==void 0?()=>l(N):void 0})}),b===p?s.jsx(Z$,{label:c("thread.forkedFromHistory")}):null]},h[b])})})}function J$(e,t){if(t==null||t<=0)return null;let n=0;for(let r=0;r<e.length;r+=1){const a=e[r];if(n+=a.type==="activity"?a.messages.length:1,n>=t)return r}return null}function Z$({label:e}){return s.jsxs("div",{className:"my-5 flex items-center gap-3 text-[11px] text-muted-foreground/80",children:[s.jsx("span",{"aria-hidden":!0,className:"h-px flex-1 bg-border/70"}),s.jsx("span",{className:"shrink-0",children:e}),s.jsx("span",{"aria-hidden":!0,className:"h-px flex-1 bg-border/70"})]})}function e8(e){const t=new Set;let n=!1;for(let r=e.length-1;r>=0;r-=1){const a=e[r];if(a.type==="activity"){n||(t.add(r),n=!0);continue}if(!(a.message.role==="assistant"&&a.message.isStreaming)&&a.message.role==="user")break}return t}function t8(e){const t=new Map;return e.map((n,r)=>{const a=n8(n,r);if(!a.startsWith("turn-")||a.endsWith("-user"))return a;const o=(t.get(a)??0)+1;return t.set(a,o),`${a}-${o}`})}function n8(e,t){if(e.type==="activity"){const r=e.messages[0],a=wx(r,"activity");if(a)return a;const o=r==null?void 0:r.id;return o!=null?`activity-${o}`:`activity-idx-${t}`}const n=wx(e.message);return n||e.message.id}function wx(e,t){if(!(e!=null&&e.turnId))return null;const n=e.turnPhase??t??e.kind??e.role;return e.role==="user"?`turn-${e.turnId}-user`:e.kind==="trace"?`turn-${e.turnId}-${n}-${e.activitySegmentId??"activity"}`:`turn-${e.turnId}-${n}`}function r8(e){if(e.type==="activity")return"mt-4";const t=e.message;return t.kind==="trace"||t.role==="assistant"&&t.content.trim().length===0&&(!!t.reasoning||!!t.reasoningStreaming)?"mt-2":"mt-5"}const kx=48,a8=96,o8=192,s8=16,i8=80,Bd=18,Cx=160,Sx=120;function l8(e,t){if(e.length<=t)return e;let n=Math.max(0,e.length-t);for(;n>0&&Ba(e[n])&&Ba(e[n-1]);)n-=1;return e.slice(n)}function xm(e){return e instanceof HTMLElement?e.isContentEditable||e instanceof HTMLTextAreaElement?!0:e instanceof HTMLInputElement?!["button","checkbox","color","file","hidden","image","radio","range","reset","submit"].includes(e.type):!1:!1}function c8(e){const t=window.visualViewport;if(!t)return 0;const n=document.activeElement;if(!xm(n)||!(e!=null&&e.contains(n)))return 0;const a=(window.innerHeight||document.documentElement.clientHeight)-t.height-t.offsetTop;return a>=i8?Math.ceil(a):0}const u8=u.forwardRef(function({messages:t,isStreaming:n,composer:r,emptyState:a,scrollToBottomSignal:o=0,scrollToLatestUserPromptSignal:i=0,conversationKey:l=null,showScrollToBottomButton:c=!0,cliApps:d=[],mcpPresets:p=[],forkBoundaryMessageCount:m=null,hasMoreBefore:f=!1,loadingOlder:h=!1,userMessageOffset:y=0,onLoadOlder:x,onOpenFilePreview:b,onForkFromMessage:v},g){const{t:w}=ie(),k=u.useRef(null),C=u.useRef(null),N=u.useRef(null),S=u.useRef(null),A=u.useRef(l),E=u.useRef(!0),_=u.useRef(null),R=u.useRef([]),T=u.useRef(null),F=u.useRef(0),z=u.useRef(null),K=u.useRef(null),$=u.useRef(!1),[W,P]=u.useState(!0),[D,G]=u.useState(0),[Y,oe]=u.useState(0),[de,pe]=u.useState(Cx),le=t.length>0,I=u.useMemo(()=>l8(t,de),[t,de]),Q=t.length-I.length,O=y+(Q>0?t.slice(0,Q).filter(B=>B.role==="user").length:0),ne=m!==null&&m>Q?m-Q:null,he=Y+(D>0?D+s8:o8),ve=Y>0?{bottom:Y}:void 0,me=u.useCallback(()=>{for(const B of R.current)window.cancelAnimationFrame(B);R.current=[]},[]),ee=u.useCallback(B=>{T.current=B},[]),we=u.useCallback((B=!1)=>{var Ie;const X=k.current,J=S.current,ye=B?"smooth":"auto";if(X){const Ne=Math.max(0,X.scrollHeight-X.clientHeight);try{(Ie=X.scrollTo)==null||Ie.call(X,{top:Ne,behavior:ye}),B||(X.scrollTop=Ne)}catch{try{X.scrollTop=Ne}catch{}}}else J&&J.scrollIntoView({block:"end",behavior:ye});$.current=!1,P(!0)},[]),je=u.useCallback(B=>{var Ne;const X=k.current;if(!X)return!1;const J=ii(X,B);if(!J)return!1;const ye=Math.max(0,Jf(X,J)-16);ee(ye);try{(Ne=X.scrollTo)==null||Ne.call(X,{top:ye,behavior:"auto"}),X.scrollTop=ye}catch{try{X.scrollTop=ye}catch{}}const Ie=X.scrollHeight-ye-X.clientHeight<kx;return $.current=!1,P(Ie),!0},[ee]),xe=u.useCallback((B=!1,X=1,J)=>{const ye=(J==null?void 0:J.force)??!1;me();const Ie=()=>{!ye&&$.current||we(B)},Ne=Je=>{if(Je<=0)return;const ue=window.requestAnimationFrame(()=>{R.current=R.current.filter(Be=>Be!==ue),!(!ye&&$.current)&&(we(B),Ne(Je-1))});R.current.push(ue)};Ie(),Ne(X-1)},[me,we]),Ee=u.useCallback(()=>{const B=k.current;if(B&&(K.current={height:B.scrollHeight,top:B.scrollTop}),$.current=!0,z.current=null,P(!1),Q>0){pe(X=>Math.min(t.length,X+Sx));return}f&&x&&!h&&(pe(X=>X+Sx),x())},[f,Q,h,t.length,x]),$e=u.useCallback(()=>{const B=k.current;!B||!le||E.current||$.current&&(B.scrollTop>a8||Q<=0&&!f||Ee())},[le,f,Q,Ee]),Se=u.useCallback(B=>{const X=k.current;if(X&&ii(X,B)){hm(X,B);return}const J=t.findIndex(ye=>ye.id===B);J<0||(_.current=B,$.current=!0,z.current=null,P(!1),pe(ye=>Math.max(ye,t.length-J)))},[t]);u.useImperativeHandle(g,()=>({jumpToUserPrompt:Se}),[Se]);const Fe=u.useCallback(()=>{const B=N.current;if(!B)return;const X=B.getBoundingClientRect().height||B.offsetHeight;G(J=>Math.abs(J-X)<1?J:X)},[]);return u.useLayoutEffect(()=>{const B=()=>{const J=k.current,ye=c8(J),Ie=document.activeElement,Ne=le&&xm(Ie)&&!!(J!=null&&J.contains(Ie));oe(Je=>Math.abs(Je-ye)<1?Je:ye),Ne&&($.current=!1,xe(!1,Bd,{force:!0}))};B();const X=window.visualViewport;return X==null||X.addEventListener("resize",B),X==null||X.addEventListener("scroll",B),window.addEventListener("resize",B),document.addEventListener("focusin",B),document.addEventListener("focusout",B),()=>{X==null||X.removeEventListener("resize",B),X==null||X.removeEventListener("scroll",B),window.removeEventListener("resize",B),document.removeEventListener("focusin",B),document.removeEventListener("focusout",B)}},[le,xe]),u.useLayoutEffect(()=>{if(Y>0){$.current=!1,xe(!1,Bd,{force:!0});return}$.current||xe(!1,4)},[Y,xe]),u.useEffect(()=>{const B=k.current;if(!B)return;const X=()=>{const J=document.activeElement;!le||!xm(J)||!B.contains(J)||($.current=!1,xe(!1,Bd,{force:!0}))};return document.addEventListener("focusin",X),()=>document.removeEventListener("focusin",X)},[le,xe]),u.useEffect(()=>{o<=0||($.current=!1,xe(!1,8))},[o,xe]),u.useLayoutEffect(()=>{if(i<=F.current)return;const B=t[t.length-1];!B||B.role!=="user"||(F.current=i,me(),z.current=B.id,je(B.id)||(z.current=null))},[me,t,i,je]),u.useLayoutEffect(()=>{A.current!==l&&(A.current=l,E.current=!0,$.current=!1,z.current=null,P(!0),pe(Cx))},[l]),u.useLayoutEffect(()=>{const B=z.current;if(!B||$.current)return;const X=t.findIndex(ye=>ye.id===B);if(X<0){z.current=null;return}t.slice(X+1).some(ye=>ye.role!=="user")&&xe(!1,n?3:1)},[n,t,xe]),u.useLayoutEffect(()=>{var Ie;const B=K.current;if(!B)return;const X=k.current;if(K.current=null,!X)return;const J=X.scrollHeight-B.height,ye=B.top+J;try{X.scrollTop=ye}catch{try{(Ie=X.scrollTo)==null||Ie.call(X,{top:ye,behavior:"auto"})}catch{}}},[I.length,t.length]),u.useLayoutEffect(()=>{const B=_.current,X=k.current;if(!B||!X||!ii(X,B))return;_.current=null;const J=window.requestAnimationFrame(()=>hm(X,B));return()=>window.cancelAnimationFrame(J)},[I.length]),u.useLayoutEffect(()=>{if(E.current){if(!l){E.current=!1,xe(!1,4);return}xe(!1,8),le&&(E.current=!1)}},[l,le,t,xe]),u.useLayoutEffect(()=>{Fe()},[r,le,Fe]),u.useEffect(()=>me,[me]),u.useEffect(()=>{const B=N.current;if(!B||typeof ResizeObserver>"u")return;const X=new ResizeObserver(()=>Fe());return X.observe(B),()=>X.disconnect()},[le,Fe]),u.useEffect(()=>{const B=k.current;if(!B)return;const X=(ye=!0)=>{const Ne=B.scrollHeight-B.scrollTop-B.clientHeight<kx,Je=T.current,ue=Je!==null&&Math.abs(B.scrollTop-Je)<2;if(P(Ne),ue){T.current=null,Ne&&($.current=!1);return}T.current=null,$.current=!Ne,Ne||(z.current=null),ye&&!Ne&&$e()};X(!1);const J=()=>X(!0);return B.addEventListener("scroll",J,{passive:!0}),()=>B.removeEventListener("scroll",J)},[$e]),s.jsxs("div",{className:"relative flex min-h-0 flex-1 overflow-hidden",children:[s.jsxs("div",{ref:k,className:j("thread-viewport-scrollbar absolute inset-0 overflow-y-auto scroll-auto scrollbar-thin","[&::-webkit-scrollbar]:w-1.5","[&::-webkit-scrollbar-thumb]:rounded-full","[&::-webkit-scrollbar-thumb]:bg-muted-foreground/30","[&::-webkit-scrollbar-track]:bg-transparent"),style:ve,children:[le?s.jsxs("div",{ref:C,className:"mx-auto flex min-h-full w-full max-w-[64rem] flex-col",children:[s.jsx("div",{"data-testid":"thread-message-region",className:"flex min-h-0 flex-1 flex-col justify-start px-3 pb-4 pt-4 sm:px-4",children:s.jsx("div",{className:"mx-auto w-full max-w-[49.5rem]",children:s.jsx(X$,{messages:I,isStreaming:n,hiddenUserMessageCount:O,cliApps:d,mcpPresets:p,forkBoundaryMessageCount:ne,onOpenFilePreview:b,onForkFromMessage:v})})}),s.jsx("div",{ref:N,"data-testid":"thread-composer-dock",className:"sticky bottom-0 z-10 bg-background",children:s.jsx("div",{className:"px-3 pb-[calc(0.75rem+env(safe-area-inset-bottom))] sm:px-4",children:r})})]}):s.jsx("div",{ref:C,className:"mx-auto flex min-h-full w-full max-w-[72rem] flex-col px-3 sm:px-4",children:s.jsx("div",{className:"flex w-full flex-1 items-center justify-center py-6 sm:py-12",children:s.jsxs("div",{className:"relative flex w-full max-w-[58rem] flex-col items-center gap-5 sm:block",children:[s.jsx("div",{className:"flex justify-center sm:absolute sm:inset-x-0 sm:bottom-[calc(100%+1.5rem)]",children:a}),s.jsx("div",{className:"w-full",children:r})]})})}),s.jsx("div",{ref:S,"aria-hidden":!0,className:"h-px"})]}),s.jsx("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-x-0 top-0 h-6 bg-gradient-to-b from-background to-transparent"}),le?s.jsx(GF,{messages:I,scrollRef:k,bottomOffset:he}):null,c&&!W&&s.jsx("div",{className:"absolute left-1/2 z-20 -translate-x-1/2",style:{bottom:he},children:s.jsx(fe,{variant:"outline",size:"icon",onClick:()=>xe(!0,1,{force:!0}),className:j("h-8 w-8 rounded-full shadow-md","bg-background/90 backdrop-blur","animate-in fade-in-0 zoom-in-95"),"aria-label":w("thread.scrollToBottom"),children:s.jsx(Hj,{className:"h-4 w-4"})})})]})}),d8=new Set(["write_file","edit_file","apply_patch"]);function Ra(e,t){const n={};typeof e.turn_id=="string"&&e.turn_id.length>0&&(n.turnId=e.turn_id);const r=e.turn_phase??t;return r&&(n.turnPhase=r),typeof e.turn_seq=="number"&&Number.isFinite(e.turn_seq)&&(n.turnSeq=e.turn_seq),n}function us(e,t){return!t.turnId||!e.turnId||e.turnId===t.turnId}function Nx(e,t,n={}){for(let r=e.length-1;r>=0;r-=1){const a=e[r];if(a.kind!=="trace"){if(a.role==="assistant"&&a.isStreaming&&!t.has(a.id)&&us(a,n))return r;if(a.role==="user")break}}return null}function jx(e,t,n,r={}){for(let o=e.length-1;o>=0;o-=1){const i=e[o];if(i.role==="user"||i.kind==="trace")break;if(i.role!=="assistant")continue;if(!us(i,r))break;const l=i.activitySegmentId??(n==null?void 0:n.ensure());if(i.content.length>0)break;if(i.reasoningStreaming||i.reasoning!==void 0||i.isStreaming){const d={...i,reasoning:(i.reasoning??"")+t,reasoningStreaming:!0,...l?{activitySegmentId:l}:{},...r};return[...e.slice(0,o),d,...e.slice(o+1)]}break}const a=n==null?void 0:n.ensure();return[...e,{id:crypto.randomUUID(),role:"assistant",content:"",isStreaming:!0,reasoning:t,reasoningStreaming:!0,...a?{activitySegmentId:a}:{},...r,createdAt:Date.now()}]}function p8(e,t={}){const n=e[e.length-1];return!n||n.role!=="assistant"||n.kind==="trace"||n.content.length>0||!n.isStreaming||!us(n,t)?null:e.length-1}function Hd(e,t,n){const r=e.slice();return r[t]=n,r}function Ax(e){for(let t=e.length-1;t>=0;t-=1){const n=e[t];if(!n.reasoningStreaming)continue;const r=n.latencyMs===void 0&&Number.isFinite(n.createdAt)&&n.createdAt>1e12?Math.max(0,Math.round(Date.now()-n.createdAt)):n.latencyMs,a={...n,reasoningStreaming:!1,...r!==void 0?{latencyMs:r}:{}};return[...e.slice(0,t),a,...e.slice(t+1)]}return e}function aS(e){var t;return e.role==="assistant"&&e.kind!=="trace"&&e.content.trim().length===0&&!!e.reasoning&&!e.reasoningStreaming&&!((t=e.media)!=null&&t.length)}function m8(e){return(e==null?void 0:e.kind)==="trace"}function _x(e){return e.filter((t,n)=>aS(t)?m8(e[n+1]):!0)}function f8(e,t,n){for(let r=e.length-1;r>=0;r-=1){const a=e[r];if(a.role==="assistant"&&a.kind!=="trace"&&(!n||!a.turnId||a.turnId===n)){const o={...a,latencyMs:t,isStreaming:!1};return[...e.slice(0,r),o,...e.slice(r+1)]}}return e}function h8(e,t){const n=e[e.length-1];return!n||!aS(n)||!us(n,t)?[...e,{id:crypto.randomUUID(),role:"assistant",createdAt:Date.now(),...t}]:[...e.slice(0,-1),{...n,...t,isStreaming:!1,reasoningStreaming:!1}]}function ds(e){return e.call_id?`${e.call_id}|${e.tool}`:`${e.tool}|${e.path}`}function th(e){const t=e.function,n=typeof e.name=="string"?e.name:typeof(t==null?void 0:t.name)=="string"?t.name:"",r=typeof e.call_id=="string"?e.call_id:"";return!n||!r||!d8.has(n)?null:`${r}|${n}`}function g8(e,t){const n=th(t);return n?e.some(r=>{var a;return(a=r.fileEdits)==null?void 0:a.some(o=>ds(o)===n)}):!1}function v8(e,t){return t.length===0?t:t.filter(n=>!g8(e,n))}function x8(e,t){var d;const n=new Set(t.map(ds)),r=e.toolEvents??[];if(!r.length||n.size===0)return e;const a=new Set,o=[];let i=!1;for(const p of r){const m=th(p);if(m&&n.has(m)){i=!0;for(const f of UC([p]))a.add(f);continue}o.push(p)}if(!i)return e;const c=((d=e.traces)!=null&&d.length?e.traces:e.content?[e.content]:[]).filter(p=>!a.has(p));return{...e,traces:c,content:c[c.length-1]??"",toolEvents:o.length?o:void 0}}function y8(e){if(!e||!e.tool||!e.path&&!e.pending)return null;const t=e.phase==="error"?"error":e.phase==="end"?"done":"editing",n={...e,call_id:e.call_id||`${e.tool}:${e.path}`,added:Number.isFinite(e.added)?Math.max(0,Math.round(e.added)):0,deleted:Number.isFinite(e.deleted)?Math.max(0,Math.round(e.deleted)):0,status:e.status==="error"||e.status==="done"||e.status==="editing"?e.status:t};return e.pending&&!e.path&&(n.pending=!0),n}function Px(e,t){const n=[...e??[]],r=new Map(n.map((a,o)=>[ds(a),o]));for(const a of t){const o=y8(a);if(!o)continue;const i=ds(o),l=r.get(i);if(l===void 0){r.set(i,n.length),n.push(o);continue}const c={...n[l],...o};o.path&&!o.pending&&delete c.pending,n[l]=c}return n}function b8(e,t,n){const r=new Set(n.map(ds));for(let a=e.length-1;a>=0;a-=1){const o=e[a];if(o.role==="user")break;if(o.kind==="trace"){if(t&&o.activitySegmentId===t)return a;for(const i of o.fileEdits??[])if(r.has(ds(i)))return a;for(const i of o.toolEvents??[]){const l=th(i);if(l&&r.has(l))return a}}}return null}function w8(e,t){const n=[...e??[]];for(const r of t??[])n.push(r);return n.length?n:void 0}function k8(e,t=[],n=!1,r){const{client:a}=kr(),[o,i]=u.useState(t),l=Wc(t),[c,d]=u.useState(l||n),[p,m]=u.useState(null),[f,h]=u.useState(void 0),[y,x]=u.useState(null),b=u.useRef(null),v=u.useRef(null),g=u.useRef(new Set),w=u.useRef(null),k=u.useRef(null),C=u.useRef(0),N=u.useRef([]),S=u.useRef(null),A=u.useRef(!1),E=u.useRef(null);u.useEffect(()=>a.onError(I=>x(I)),[a]);const _=u.useCallback(()=>x(null),[]),R=u.useCallback(()=>{S.current!==null&&(window.cancelAnimationFrame(S.current),S.current=null),N.current=[]},[]),T=u.useCallback((I=!0)=>{C.current+=1;const Q=`activity-${C.current}`;return I&&(w.current=Q),Q},[]),F=u.useCallback(()=>T(!0),[T]),z=u.useCallback(()=>T(!1),[T]),K=u.useCallback(()=>w.current?w.current:F(),[F]),$=u.useCallback(()=>{w.current=null,k.current=null},[]),W=u.useCallback(()=>{var Q,O;const I=((Q=b.current)==null?void 0:Q.messageId)??((O=v.current)==null?void 0:O.id);return I&&g.current.add(I),b.current=null,v.current=null,!!I},[]),P=u.useCallback((I,Q={})=>{const O=v.current;if(!O)return null;const ne=I[O.index];if((ne==null?void 0:ne.id)===O.id&&ne.role==="assistant"&&ne.kind!=="trace"&&ne.isStreaming&&us(ne,Q))return O.index;const he=I.findIndex(me=>me.id===O.id);if(he===-1)return v.current=null,null;const ve=I[he];return ve.role!=="assistant"||ve.kind==="trace"||!ve.isStreaming||!us(ve,Q)?(v.current=null,null):(v.current={id:O.id,index:he},he)},[]),D=u.useCallback((I,Q,O={})=>{let ne=I,he=P(ne,O);if(he===null&&(he=p8(ne,O)),he===null&&(he=Nx(ne,g.current,O)),he===null){const ee=crypto.randomUUID();ne=[...ne,{id:ee,role:"assistant",content:"",isStreaming:!0,createdAt:Date.now()}],he=ne.length-1}const ve=ne[he],me={...ve,content:ve.content+Q,isStreaming:!0,...O};return g.current.delete(me.id),v.current={id:me.id,index:he},b.current={messageId:me.id},Hd(ne,he,me)},[P]),G=u.useCallback((I,Q)=>{let O=I;for(const ne of Q)ne.kind==="delta"?O=D(O,ne.text,ne.turn):(W()&&$(),O=jx(O,ne.text,{ensure:K},ne.turn));return O},[D,$,W,K]),Y=u.useCallback(I=>{S.current!==null&&(window.cancelAnimationFrame(S.current),S.current=null);const Q=N.current,O=I==null?void 0:I.finalAnswerText,ne=(I==null?void 0:I.turn)??{};if(Q.length===0&&O===void 0){I!=null&&I.closeAnswerSegment&&W();return}N.current=[],i(he=>{let ve=Q.length>0?G(he,Q):he;if(O!==void 0){const me=P(ve,ne)??Nx(ve,g.current,ne);if(me!==null){const ee=ve[me];ve=Hd(ve,me,{...ee,content:O,isStreaming:!0,...ne})}else{const ee=crypto.randomUUID();g.current.add(ee),ve=[...ve,{id:ee,role:"assistant",content:O,isStreaming:!0,...ne,createdAt:Date.now()}]}}return I!=null&&I.closeAnswerSegment&&W(),ve})},[G,W,P]),oe=u.useCallback(()=>{S.current===null&&(S.current=window.requestAnimationFrame(()=>{S.current=null;const I=N.current;I.length!==0&&(N.current=[],i(Q=>G(Q,I)))}))},[G]);u.useEffect(()=>{i(t),d(Wc(t)||n),x(null),m(e?a.getRunStartedAt(e):null),h(e?a.getGoalState(e):void 0),b.current=null,v.current=null,g.current.clear(),$(),R(),A.current=!1,E.current!==null&&(clearTimeout(E.current),E.current=null)},[e,a,$,R]),u.useEffect(()=>{n&&d(!0)},[n]),u.useEffect(()=>{if(!e)return;const I=O=>{var he,ve;if(E.current!==null&&(clearTimeout(E.current),E.current=null),O.event==="delta"){if(A.current)return;const me=typeof O.text=="string"?O.text:"";if(!me)return;$(),d(!0),N.current.push({kind:"delta",text:me,turn:Ra(O,"answer")}),oe();return}if(O.event==="reasoning_delta"){if(A.current)return;const me=O.text;if(!me)return;k.current&&$(),d(!0),N.current.push({kind:"reasoning",text:me,turn:Ra(O,"reasoning")}),oe();return}if(O.event==="stream_end")return Y({closeAnswerSegment:!0,...typeof O.text=="string"?{finalAnswerText:O.text}:{},turn:Ra(O,"answer")}),A.current,void 0;const ne=O.event==="file_edit"||O.event==="message"&&(O.kind==="tool_hint"||O.kind==="progress");if(Y({closeAnswerSegment:ne}),O.event==="reasoning_end"){if(A.current)return;i(me=>Ax(me));return}if(O.event==="goal_state"){h(O.goal_state);return}if(O.event==="goal_status"){O.status==="running"&&typeof O.started_at=="number"?m(O.started_at):m(null);return}if(O.event==="turn_end"){"goal_state"in O&&O.goal_state!=null&&typeof O.goal_state=="object"&&h(O.goal_state),m(null),E.current!==null&&(clearTimeout(E.current),E.current=null),d(!1),i(me=>{let ee=me.map(we=>we.isStreaming?{...we,isStreaming:!1}:we);return ee=_x(ee),typeof O.latency_ms=="number"&&O.latency_ms>=0&&(ee=f8(ee,Math.round(O.latency_ms),O.turn_id)),b.current=null,v.current=null,$(),g.current.clear(),ee}),A.current=!1,r==null||r();return}if(O.event==="message"){if(A.current&&(O.kind==="tool_hint"||O.kind==="progress"||O.kind==="reasoning"))return;if(O.kind==="reasoning"){const we=O.text;if(!we)return;k.current&&$(),i(je=>Ax(jx(je,we,{ensure:K},Ra(O,"reasoning"))));return}if(O.kind==="tool_hint"||O.kind==="progress"){const we=$C(O.tool_events),je=Ra(O,"activity"),xe=O.agent_ui?[O.agent_ui]:[];i(Ee=>{var ye,Ie,Ne,Je,ue,Be;const $e=K(),Se=Ee,Fe=v8(Se,we),B=UC(Fe),X=B.length>0?B:we.length>0?[]:O.text?[O.text]:[];if(X.length===0)return Se;const J=Se[Se.length-1];if(J&&J.kind==="trace"&&!J.isStreaming&&(!J.activitySegmentId||J.activitySegmentId===$e)){const ze=(ye=J.traces)!=null&&ye.length?J.traces:J.content?[J.content]:[],We=xe.length>0&&X.length===1&&ze.length>0&&(((Ne=(Ie=xe[0])==null?void 0:Ie.kind)==null?void 0:Ne.startsWith("subagent_"))??!1)&&((ue=(Je=J.agentUi)==null?void 0:Je[J.agentUi.length-1])==null?void 0:ue.kind)===((Be=xe[0])==null?void 0:Be.kind),nr=Fe.length>0?$z(ze,B):null,xn=nr?nr.traces:We?[...ze.slice(0,-1),`${ze[ze.length-1]}${X[0]}`]:[...ze,...X],Qe={...J,traces:xn,content:xn[xn.length-1],toolEvents:Fe.length?zz(J.toolEvents,Fe):J.toolEvents,agentUi:w8(J.agentUi,xe),activitySegmentId:J.activitySegmentId??$e,...je};return[...Se.slice(0,-1),Qe]}return[...Se,{id:crypto.randomUUID(),role:"tool",kind:"trace",content:X[X.length-1],traces:X,...Fe.length?{toolEvents:Fe}:{},...xe.length?{agentUi:xe}:{},activitySegmentId:$e,...je,createdAt:Date.now()}]});return}const me=(he=O.media_urls)!=null&&he.length?O.media_urls.map(we=>cs(we)):(ve=O.media)==null?void 0:ve.map(we=>cs({url:we})),ee=!!me&&me.length>0;$(),i(we=>{var Se;const je=(Se=b.current)==null?void 0:Se.messageId;b.current=null,v.current=null;const xe=je?we.filter(Fe=>Fe.id!==je):we,Ee=O.text,$e=typeof O.latency_ms=="number"&&O.latency_ms>=0?Math.round(O.latency_ms):void 0;return h8(xe,{content:Ee,...ee?{media:me}:{},...$e!==void 0?{latencyMs:$e}:{},...O.source?{source:O.source}:{},...Ra(O,"answer")})}),ee&&(A.current=!0);return}if(O.event==="file_edit"){const me=Array.isArray(O.edits)?O.edits:[];if(me.length===0)return;const ee=Px(void 0,me);if(ee.length===0)return;const we=Ra(O,"activity"),je=ee.some(Ee=>Ee.status==="editing"||Ee.phase==="start");let xe=k.current;!xe&&je&&(xe=z(),k.current=xe),i(Ee=>{let $e=xe;const Se=Ee,Fe=b8(Se,$e,ee);if(Fe!==null){const B=Se[Fe];$e=B.activitySegmentId??$e??z(),je&&(k.current=$e);const X=x8(B,ee),J={...X,fileEdits:Px(X.fileEdits,ee),activitySegmentId:$e,...we};return Hd(Se,Fe,J)}return $e=$e??z(),je&&(k.current=$e),[...Se,{id:crypto.randomUUID(),role:"tool",kind:"trace",content:"",traces:[],fileEdits:ee,activitySegmentId:$e,...we,createdAt:Date.now()}]});return}},Q=a.onChat(e,I);return()=>{Q(),b.current=null,v.current=null,g.current.clear(),$(),R(),E.current!==null&&(clearTimeout(E.current),E.current=null)}},[e,a,$,R,z,K,Y,r,oe]);const de=u.useCallback((I,Q,O)=>{if(!e)return;const ne=!!Q&&Q.length>0;if(!ne&&!I.trim())return;Y();const he=crypto.randomUUID(),ve=ne?Q.map(ee=>ee.preview):void 0;i(ee=>{var we,je,xe;return b.current=null,v.current=null,g.current.clear(),$(),[..._x(ee),{id:crypto.randomUUID(),role:"user",content:I,turnId:he,turnPhase:"user",turnSeq:0,createdAt:Date.now(),...ve?{images:ve}:{},...(we=O==null?void 0:O.attachmentMedia)!=null&&we.length?{media:O.attachmentMedia}:{},...(je=O==null?void 0:O.cliApps)!=null&&je.length?{cliApps:O.cliApps}:{},...(xe=O==null?void 0:O.mcpPresets)!=null&&xe.length?{mcpPresets:O.mcpPresets}:{}}]}),d(!0);const me=ne?Q.map(ee=>ee.media):void 0;a.sendMessage(e,I,me,{...O,turnId:he})},[e,$,a,Y]),pe=u.useCallback(()=>{e&&(Y(),d(!1),i(I=>(b.current=null,v.current=null,g.current.clear(),$(),I.map(Q=>Q.isStreaming?{...Q,isStreaming:!1}:Q))),A.current=!1,a.sendMessage(e,"/stop"))},[e,$,a,Y]),le=u.useCallback((I,Q)=>a.transcribeAudio(I,Q),[a]);return{messages:o,isStreaming:c,runStartedAt:p,goalState:f,send:de,transcribeAudio:le,stop:pe,setMessages:i,streamError:y,dismissStreamError:_}}const Tx=[],C8=160,S8=120,Rx=6e4;function Mx(e){return e.map((t,n)=>({...t,id:t.id??`hist-${n}`,createdAt:typeof t.createdAt=="number"?t.createdAt:Date.now()}))}function N8(e,t){return typeof(e==null?void 0:e.has_pending_tool_calls)=="boolean"?e.has_pending_tool_calls:Wc(t)}function j8(){const{client:e,token:t}=kr(),[n,r]=u.useState([]),[a,o]=u.useState(!0),[i,l]=u.useState(null),c=u.useRef(t),d=u.useRef(new Set);c.current=t;const p=u.useCallback(async()=>{try{o(!0);const x=await gL(c.current),b=new Set(x.map(v=>v.key));r(v=>[...x,...v.filter(g=>d.current.has(g.key)&&!b.has(g.key))]);for(const v of Array.from(d.current))b.has(v)&&d.current.delete(v);l(null)}catch(x){const b=x instanceof as?`HTTP ${x.status}`:x.message;l(b)}finally{o(!1)}},[]);u.useEffect(()=>{p()},[p]),u.useEffect(()=>e.onSessionUpdate(()=>{p()}),[e,p]);const m=u.useCallback(async x=>{const b=await e.newChat(Rx,x),v=`websocket:${b}`;return d.current.add(v),r(g=>[{key:v,channel:"websocket",chatId:b,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),title:"",preview:"",workspaceScope:x??null},...g.filter(w=>w.key!==v)]),b},[e]),f=u.useCallback(async(x,b,v)=>{const g=await e.forkChat(x,b,v,Rx),w=`websocket:${g}`;return d.current.add(w),r(k=>[{key:w,channel:"websocket",chatId:g,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),title:v??"",preview:"",workspaceScope:null},...k.filter(C=>C.key!==w)]),g},[e]),h=u.useCallback(async(x,b)=>{const v=await kL(c.current,x,b);return v.deleted&&(d.current.delete(x),r(g=>g.filter(w=>w.key!==x))),v},[]),y=u.useCallback(async x=>(await w1(c.current,x)).jobs,[]);return{sessions:n,loading:a,error:i,refresh:p,createChat:m,forkChat:f,deleteChat:h,getSessionAutomations:y}}function A8(e){const{token:t}=kr(),n=u.useRef(!1),[r,a]=u.useState(0),o=u.useCallback(()=>{a(d=>d+1)},[]),[i,l]=u.useState({key:null,messages:[],loading:!1,loadingOlder:!1,error:null,hasPendingToolCalls:!1,forkBoundaryMessageCount:null,beforeCursor:null,hasMoreBefore:!1,userMessageOffset:0,version:0});u.useEffect(()=>{if(!e){l({key:null,messages:[],loading:!1,loadingOlder:!1,error:null,hasPendingToolCalls:!1,forkBoundaryMessageCount:null,beforeCursor:null,hasMoreBefore:!1,userMessageOffset:0,version:0});return}let d=!1;return l(p=>p.key===e?{...p,loading:!0,loadingOlder:!1,error:null}:{key:e,messages:[],loading:!0,loadingOlder:!1,error:null,hasPendingToolCalls:!1,forkBoundaryMessageCount:null,beforeCursor:null,hasMoreBefore:!1,userMessageOffset:0,version:0}),(async()=>{var p;try{const m=await mv(t,e,{limit:C8,direction:"latest"});if(d)return;if(!((p=m==null?void 0:m.messages)!=null&&p.length)){l(x=>({key:e,messages:[],loading:!1,loadingOlder:!1,error:null,hasPendingToolCalls:!1,forkBoundaryMessageCount:null,beforeCursor:null,hasMoreBefore:!1,userMessageOffset:0,version:x.key===e?x.version+1:1}));return}const f=Mx(m.messages),h=N8(m,f),y=typeof m.fork_boundary_message_count=="number"?Math.max(0,Math.min(m.fork_boundary_message_count,f.length)):null;l(x=>{var b,v,g;return{key:e,messages:f,loading:!1,loadingOlder:!1,error:null,hasPendingToolCalls:h,forkBoundaryMessageCount:y,beforeCursor:((b=m.page)==null?void 0:b.before_cursor)??null,hasMoreBefore:((v=m.page)==null?void 0:v.has_more_before)===!0,userMessageOffset:Math.max(0,((g=m.page)==null?void 0:g.user_message_offset)??0),version:x.key===e?x.version+1:1}})}catch(m){if(d)return;m instanceof as&&m.status===404?l(f=>({key:e,messages:[],loading:!1,loadingOlder:!1,error:null,hasPendingToolCalls:!1,forkBoundaryMessageCount:null,beforeCursor:null,hasMoreBefore:!1,userMessageOffset:0,version:f.key===e?f.version+1:1})):l(f=>({key:e,messages:[],loading:!1,loadingOlder:!1,error:m.message,hasPendingToolCalls:!1,forkBoundaryMessageCount:null,beforeCursor:null,hasMoreBefore:!1,userMessageOffset:0,version:f.key===e?f.version:0}))}})(),()=>{d=!0}},[e,t,r]);const c=u.useCallback(async()=>{if(!e||n.current)return;const d=i.key===e?i.beforeCursor:null;if(!(!d||!i.hasMoreBefore)){n.current=!0,l(p=>p.key===e?{...p,loadingOlder:!0,error:null}:p);try{const p=await mv(t,e,{limit:S8,before:d});l(m=>{var b,v,g,w;if(m.key!==e)return m;if(!((b=p==null?void 0:p.messages)!=null&&b.length))return{...m,loadingOlder:!1,hasMoreBefore:!1,beforeCursor:null};const f=Mx(p.messages),h=typeof p.fork_boundary_message_count=="number"?Math.max(0,Math.min(p.fork_boundary_message_count,f.length)):null,y=m.forkBoundaryMessageCount===null?null:m.forkBoundaryMessageCount+f.length,x=[...f,...m.messages];return{...m,messages:x,loadingOlder:!1,error:null,hasPendingToolCalls:Wc(x),forkBoundaryMessageCount:h??y,beforeCursor:((v=p.page)==null?void 0:v.before_cursor)??null,hasMoreBefore:((g=p.page)==null?void 0:g.has_more_before)===!0,userMessageOffset:Math.max(0,((w=p.page)==null?void 0:w.user_message_offset)??0),version:m.version+1}})}catch(p){l(m=>m.key===e?{...m,loadingOlder:!1,error:p.message}:m)}finally{n.current=!1}}},[e,i.beforeCursor,i.hasMoreBefore,i.key,t]);return e?i.key!==e?{messages:Tx,loading:!0,loadingOlder:!1,error:null,refresh:o,loadOlder:c,hasMoreBefore:!1,userMessageOffset:0,version:0,forkBoundaryMessageCount:null,hasPendingToolCalls:!1}:{messages:i.messages,loading:i.loading,loadingOlder:i.loadingOlder,error:i.error,refresh:o,loadOlder:c,hasMoreBefore:i.hasMoreBefore,userMessageOffset:i.userMessageOffset,version:i.version,forkBoundaryMessageCount:i.forkBoundaryMessageCount,hasPendingToolCalls:i.hasPendingToolCalls}:{messages:Tx,loading:!1,loadingOlder:!1,error:null,refresh:o,loadOlder:c,hasMoreBefore:!1,userMessageOffset:0,version:0,forkBoundaryMessageCount:null,hasPendingToolCalls:!1}}function _8(e){return e.map(t=>{if(t.kind!=="long_task")return t;const r=(t.content??"").trim()||"(legacy thread activity)";return{id:t.id,role:"tool",kind:"trace",content:r,traces:[r],createdAt:t.createdAt}})}const P8=800;function T8(e,t=P8){const n=e.replace(/\r\n/g,`
`).trim(),r=n.split(`
`);let a="";r.length>0&&r[0].startsWith("[Subagent")&&(a=r[0].trim());const o=n.toLowerCase();let i=`
result:
`,l=o.indexOf(i);if(l===-1&&(i=`
result:`,l=o.indexOf(i)),l===-1)return a||n;let c=n.slice(l+i.length).replace(/^\s+/,"");const p=c.toLowerCase().indexOf("summarize this naturally");p!==-1&&(c=c.slice(0,p).trimEnd());let m=c.trim();return t>0&&m.length>t&&(m=`${m.slice(0,t-1).trimEnd()}…`),a&&m?`${a}
${m}`:a||m||n}function R8(e){return e.map(t=>{if(t.role!=="assistant"||typeof t.content!="string"||!t.content.includes("[Subagent"))return t;const n=T8(t.content);return n===t.content?t:{...t,content:n}})}function Zr(e){return R8(_8(e))}function oS(e,t){return e.role===t.role&&(e.kind??"")===(t.kind??"")&&e.content===t.content}function Ex(e){var t;return e.kind==="trace"||e.role!=="user"&&e.role!=="assistant"||e.role==="assistant"&&!e.content.trim()&&!((t=e.media)!=null&&t.length)?null:{role:e.role,kind:e.kind,content:e.content}}function M8(e,t){const n=e.map(Ex).filter(o=>o!==null);if(n.length===0)return!0;const r=t.map(Ex).filter(o=>o!==null);let a=0;for(const o of n){let i=!1;for(;a<r.length;){const l=r[a];if(a+=1,oS(o,l)){i=!0;break}}if(!i)return!1}return!0}function Ll(e,t){return e.length===0?!1:t.length===0||!M8(e,t)?!0:t.length>=e.length?!1:t.every((n,r)=>oS(e[r],n))}const Ix=544,sS=360,E8=860,I8=420,L8=320;function Lx(e,t){return Math.min(Math.max(e,sS),t)}function Dx(e){return Math.max(sS,Math.min(E8,e-I8))}function D8(e){if(!e)return null;const t=e.trim();return t?(t.split("/").pop()??t)||t:null}function O8(e){if(!e)return null;const t=e.agent.model_preset||"default";return e.model_presets.find(n=>n.name===t)??e.model_presets.find(n=>n.active)??null}function F8(e,t){const n=O8(e),r=(n==null?void 0:n.provider)||(e==null?void 0:e.agent.provider)||null;return r==="auto"?(e==null?void 0:e.agent.resolved_provider)||um(t)||null:r||um(t)}function z8(e,t){const n=e||(t==null?void 0:t.agent.model)||null,r=D8(n),a=F8(t,n),o=a?t==null?void 0:t.providers.find(l=>l.name===a):null,i=!!(t&&(!n||!a||!o||!o.configured));return{label:r,provider:a,providerLabel:a?Mo((t==null?void 0:t.providers)??[],a):null,needsSetup:i}}const Wd=["thread.empty.greetings.workOn","thread.empty.greetings.start","thread.empty.greetings.build","thread.empty.greetings.tackle"];function Ox(){const e=Math.floor(Math.random()*Wd.length);return Wd[e]??Wd[0]}function Fx({token:e,eventName:t,fetchPayload:n,isPayload:r,selectItems:a}){const[o,i]=u.useState([]),l=u.useCallback(async c=>{try{const d=await n(e);c!=null&&c()||i(a(d))}catch{c!=null&&c()||i([])}},[n,a,e]);return u.useEffect(()=>{let c=!1;l(()=>c);const d=()=>{document.visibilityState!=="hidden"&&l()},p=m=>{const f=m.detail;if(r(f)){i(a(f));return}l()};return window.addEventListener("focus",d),document.addEventListener("visibilitychange",d),window.addEventListener(t,p),()=>{c=!0,window.removeEventListener("focus",d),document.removeEventListener("visibilitychange",d),window.removeEventListener(t,p)}},[t,r,l,a]),o}function $8({session:e,title:t,onToggleSidebar:n,onCreateChat:r,onForkChat:a,onTurnEnd:o,theme:i="light",onToggleTheme:l=()=>{},hideSidebarToggleForHostChrome:c=!1,hostChromeTitleInset:d=!1,hideThemeButton:p=!1,hideHeader:m=!1,workspaceScope:f=null,workspaceDefaultScope:h=null,workspaceControls:y=null,workspaceScopeDisabled:x=!1,workspaceError:b=null,onWorkspaceScopeChange:v,settingsSnapshot:g=null,onOpenModelSettings:w}){const{t:k}=ie(),C=(e==null?void 0:e.chatId)??null,N=(e==null?void 0:e.key)??null,{messages:S,loading:A,loadingOlder:E,loadOlder:_,hasMoreBefore:R,userMessageOffset:T,hasPendingToolCalls:F,refresh:z,version:K,forkBoundaryMessageCount:$}=A8(N),{client:W,modelName:P,token:D}=kr(),[G,Y]=u.useState(!1),[oe,de]=u.useState([]),pe=Fx({token:D,eventName:D1,fetchPayload:AL,isPayload:T3,selectItems:R3}),le=Fx({token:D,eventName:z1,fetchPayload:k1,isPayload:L3,selectItems:D3}),[I,Q]=u.useState(g),[O,ne]=u.useState(Ox),[he,ve]=u.useState(0),[me,ee]=u.useState(0),[we,je]=u.useState(null),[xe,Ee]=u.useState(!1),[$e,Se]=u.useState(Ix),Fe=u.useRef(null),B=u.useRef(Ix),X=u.useRef(null),J=u.useRef(null),ye=u.useRef(null),Ie=u.useRef(new Map),Ne=u.useRef(null),Je=u.useRef(!1),ue=u.useRef(new Map),Be=u.useRef(new Set),ze=u.useRef(new Map),We=u.useRef(null),nr=u.useMemo(()=>C?Ie.current.get(C)??S:S,[C,S]),xn=u.useCallback(()=>{o==null||o()},[o]),{messages:Qe,isStreaming:yn,runStartedAt:rr,goalState:cn,send:zt,transcribeAudio:jt,stop:Vr,setMessages:kt,streamError:ar,dismissStreamError:Cr}=k8(C,nr,F,xn);u.useEffect(()=>{C&&N&&ze.current.set(C,N)},[C,N]),u.useEffect(()=>{B.current=$e},[$e]),u.useEffect(()=>{X.current!==null&&(window.clearTimeout(X.current),X.current=null),Ee(!1),je(null)},[N]),u.useEffect(()=>()=>{X.current!==null&&window.clearTimeout(X.current)},[]);const Hn=u.useMemo(()=>Zr(Qe),[Qe]),bn=Qe.length===0&&!A,or=u.useRef(bn),Ze=u.useMemo(()=>z8(P,I),[P,I]),Sr=Ze.needsSetup?k("thread.composer.modelNotConfigured",{defaultValue:"Model not configured"}):Ze.label;u.useEffect(()=>{bn&&!or.current&&ne(Ox()),or.current=bn},[bn]);const et=u.useCallback(be=>f?{...be??{},workspaceScope:f}:be,[f]),$t=u.useCallback(async()=>{try{Q(await oi(D))}catch{g||Q(null)}},[g,D]);u.useEffect(()=>{if(g){Q(g);return}$t()},[$t,g]),u.useEffect(()=>W.onRuntimeModelUpdate(()=>{$t()}),[W,$t]),u.useEffect(()=>{if(!C||A)return;const be=Ie.current.get(C),Ae=ue.current.get(C)??0,Vt=Be.current.has(C)&&K>Ae;kt(Me=>{const yt=Zr(S),tn=Gt=>{const It=Zr(Gt);return Ie.current.set(C,It),It};if(Vt&&S.length>0)return Ll(Me,yt)?tn(Me):(Be.current.delete(C),ue.current.set(C,K),Ie.current.set(C,yt),yt);if(be&&be.length>0){const Gt=Zr(be);return yt.length>Gt.length&&!Ll(Me,yt)?(Ie.current.set(C,yt),ue.current.set(C,K),yt):Ll(Me,Gt)?tn(Me):Gt}return Ll(Me,yt)?tn(Me):(ue.current.set(C,K),yt.length>0&&Ie.current.set(C,yt),yt)})},[A,C,S,K]),u.useEffect(()=>{if(C)return W.onSessionUpdate((be,Ae)=>{be===C&&Ae!=="metadata"&&(Be.current.add(C),z())})},[C,W,z]),u.useEffect(()=>{if(!C){We.current=null;return}A||We.current===C||(We.current=C,ve(be=>be+1))},[C,A]),u.useEffect(()=>{C||kt(Zr(S))},[C,S,kt]),u.useLayoutEffect(()=>{if(C){const be=Ne.current;be&&be!==C&&(Ie.current.set(be,Zr(Qe)),Je.current=!0),Ne.current=C}else Ne.current&&(Ie.current.set(Ne.current,Zr(Qe)),Je.current=!0),Ne.current=null},[C,Qe]),u.useEffect(()=>{if(C){if(Je.current){Je.current=!1;return}A||Ie.current.set(C,Zr(Qe))}},[C,A,Qe]),u.useEffect(()=>{if(!C)return;const be=J.current;be&&(J.current=null,ee(Ae=>Ae+1),zt(be.content,be.images,be.options),Y(!1))},[C,zt]),u.useEffect(()=>{let be=!1;return(async()=>{try{const Ae=await IL(D);be||de(Ae)}catch{be||de([])}})(),()=>{be=!0}},[D]);const nt=u.useCallback(async(be,Ae,mt)=>{if(G)return;Y(!0),J.current={content:be,images:Ae,options:et(mt)},await(r==null?void 0:r(f))||(J.current=null,Y(!1))},[G,r,et,f]),At=u.useCallback((be,Ae,mt)=>{ee(Vt=>Vt+1),zt(be,Ae,et(mt))},[zt,et]),In=u.useCallback(be=>{X.current!==null&&(window.clearTimeout(X.current),X.current=null),Ee(!1),je(be)},[]),wn=u.useCallback(()=>{!we||xe||(Ee(!0),X.current=window.setTimeout(()=>{X.current=null,je(null),Ee(!1)},L8))},[xe,we]),un=u.useCallback(be=>{var St;be.preventDefault(),be.stopPropagation();const Ae=be.currentTarget.closest("[data-file-preview-panel]"),mt=(St=Fe.current)==null?void 0:St.getBoundingClientRect(),Vt=(mt==null?void 0:mt.right)??window.innerWidth,Me=Dx((mt==null?void 0:mt.width)??window.innerWidth),yt=document.body.style.cursor,tn=document.body.style.userSelect,Gt=(Ae==null?void 0:Ae.style.transition)??"";let It=B.current,ft=null;document.body.style.cursor="col-resize",document.body.style.userSelect="none",Ae&&(Ae.style.transition="none");const Ct=Ut=>{It=Lx(Vt-Ut,Me),B.current=It,ft===null&&(ft=window.requestAnimationFrame(()=>{ft=null,Ae==null||Ae.style.setProperty("--file-preview-width",`${It}px`),Ae==null||Ae.style.setProperty("--file-preview-slot-width",`${It}px`)}))},Lt=Ut=>{Ut.preventDefault(),Ct(Ut.clientX)},ir=()=>{ft!==null&&(window.cancelAnimationFrame(ft),ft=null),Ae==null||Ae.style.setProperty("--file-preview-width",`${It}px`),Ae==null||Ae.style.setProperty("--file-preview-slot-width",`${It}px`),Ae&&(Ae.style.transition=Gt),Se(It),document.body.style.cursor=yt,document.body.style.userSelect=tn,window.removeEventListener("pointermove",Lt),window.removeEventListener("pointerup",ir),window.removeEventListener("pointercancel",ir)};Ct(be.clientX),window.addEventListener("pointermove",Lt),window.addEventListener("pointerup",ir),window.addEventListener("pointercancel",ir)},[]);u.useEffect(()=>{if(!we)return;const be=()=>{var Me;const Ae=((Me=Fe.current)==null?void 0:Me.getBoundingClientRect().width)??window.innerWidth,mt=Dx(Ae),Vt=Lx(B.current,mt);B.current=Vt,Se(Vt)};return be(),window.addEventListener("resize",be),()=>{window.removeEventListener("resize",be)}},[we]);const Wn=u.useCallback(async be=>{if(!C||!a)return;const Ae=await a(C,be);Ae&&(Ie.current.delete(Ae),ue.current.delete(Ae),Be.current.add(Ae))},[C,a]),sr=s.jsxs(s.Fragment,{children:[ar?s.jsx(DF,{error:ar,onDismiss:Cr}):null,e?s.jsx(rx,{onSend:At,disabled:!C,isStreaming:yn,placeholder:k(bn?"thread.composer.placeholderHero":"thread.composer.placeholderThread"),modelLabel:Sr,modelProvider:Ze.provider,modelProviderLabel:Ze.providerLabel,modelNeedsSetup:Ze.needsSetup,onModelBadgeClick:Ze.needsSetup?w:void 0,variant:bn?"hero":"thread",slashCommands:oe,cliApps:pe,mcpPresets:le,onStop:Vr,onTranscribeAudio:jt,runStartedAt:rr,goalState:cn,workspaceScope:f,workspaceDefaultScope:h,workspaceControls:y,workspaceScopeDisabled:x,workspaceError:b,onWorkspaceScopeChange:v,pendingQueueKey:C}):s.jsx(rx,{onSend:nt,disabled:G,isStreaming:yn,placeholder:k(G?"thread.composer.placeholderOpening":"thread.composer.placeholderHero"),modelLabel:Sr,modelProvider:Ze.provider,modelProviderLabel:Ze.providerLabel,modelNeedsSetup:Ze.needsSetup,onModelBadgeClick:Ze.needsSetup?w:void 0,variant:"hero",slashCommands:oe,cliApps:pe,mcpPresets:le,runStartedAt:rr,onTranscribeAudio:jt,goalState:cn,workspaceScope:f,workspaceDefaultScope:h,workspaceControls:y,workspaceScopeDisabled:x,workspaceError:b,onWorkspaceScopeChange:v})]}),Gr=A?s.jsx("div",{className:"flex h-full items-center justify-center text-sm text-muted-foreground",children:k("thread.loadingConversation")}):s.jsx("div",{className:"flex w-full flex-col items-center text-center animate-in fade-in-0 slide-in-from-bottom-2 duration-500",children:s.jsx("h1",{className:"max-w-[44rem] text-balance text-[34px] font-normal leading-[1.08] tracking-normal text-foreground sm:text-[48px] sm:leading-tight",children:k(O)})}),Nr=N?s.jsx(J4,{sessionKey:N,token:D,title:t}):void 0,en=N?s.jsx(V4,{messages:Hn,onJumpToPrompt:be=>{var Ae;return(Ae=ye.current)==null?void 0:Ae.jumpToUserPrompt(be)}}):void 0;return s.jsxs("section",{ref:Fe,className:"relative flex min-h-0 flex-1 overflow-hidden",children:[s.jsxs("div",{className:"relative flex min-w-0 flex-1 flex-col overflow-hidden",children:[m?null:s.jsx(IF,{title:t,onToggleSidebar:n,theme:i,onToggleTheme:l,hideSidebarToggleForHostChrome:c,hostChromeTitleInset:d,hideThemeButton:p,minimal:!e&&!A,promptNavigatorAction:en,sessionInfoAction:Nr}),s.jsx(u8,{ref:ye,messages:Hn,isStreaming:yn,emptyState:Gr,composer:sr,scrollToBottomSignal:he,scrollToLatestUserPromptSignal:me,conversationKey:N,showScrollToBottomButton:!!e,cliApps:pe,mcpPresets:le,forkBoundaryMessageCount:$,hasMoreBefore:R,loadingOlder:E,userMessageOffset:T,onLoadOlder:_,onOpenFilePreview:N?In:void 0,onForkFromMessage:a?Wn:void 0})]}),we&&N?s.jsx(W4,{sessionKey:N,path:we,token:D,desktopWidth:$e,isClosing:xe,onResizeStart:un,onClose:wn}):null]})}const U8=[1e3,3e3,7e3];function qd(e){var t;return!!((t=e==null?void 0:e.title)!=null&&t.trim())}function B8(e,t,n=U8){const r=u.useRef(e),a=u.useRef([]);r.current=e;const o=u.useCallback(()=>{for(const i of a.current)clearTimeout(i);a.current=[]},[]);return u.useEffect(()=>o,[o]),u.useEffect(()=>{o()},[e==null?void 0:e.key,o]),u.useEffect(()=>{qd(e)&&o()},[e,o]),u.useCallback(()=>{t();const i=r.current;if(!(!i||qd(i))){o();for(const l of n){const c=setTimeout(()=>{const d=r.current;!d||d.key!==i.key||qd(d)||t()},l);a.current.push(c)}}},[o,t,n])}const Oa={schema_version:1,pinned_keys:[],archived_keys:[],title_overrides:{},project_name_overrides:{},tags_by_key:{},collapsed_groups:{},view:{density:"comfortable",show_previews:!1,show_timestamps:!1,show_archived:!1,sort:"updated_desc"},updated_at:null};function ym(e){if(!Array.isArray(e))return[];const t=[],n=new Set;for(const r of e){if(typeof r!="string")continue;const a=r.trim();!a||n.has(a)||(n.add(a),t.push(a))}return t}function zx(e){if(!e||typeof e!="object"||Array.isArray(e))return{};const t={};for(const[n,r]of Object.entries(e)){if(typeof r!="string")continue;const a=n.trim(),o=r.trim();!a||!o||(t[a]=o)}return t}function H8(e){if(!e||typeof e!="object"||Array.isArray(e))return{};const t={};for(const[n,r]of Object.entries(e)){const a=n.trim();if(!a)continue;const o=ym(r).slice(0,12);o.length&&(t[a]=o)}return t}function W8(e){if(!e||typeof e!="object"||Array.isArray(e))return{};const t={};for(const[n,r]of Object.entries(e)){const a=n.trim();a&&(t[a]=!!r)}return t}function Kd(e){if(!e||typeof e!="object"||Array.isArray(e))return{...Oa,view:{...Oa.view}};const t=e,n=t.view&&typeof t.view=="object"?t.view:Oa.view,r=n.density==="compact"?"compact":"comfortable",a=["updated_desc","created_desc","title_asc"].includes(n.sort)?n.sort:"updated_desc";return{schema_version:1,pinned_keys:ym(t.pinned_keys),archived_keys:ym(t.archived_keys),title_overrides:zx(t.title_overrides),project_name_overrides:zx(t.project_name_overrides),tags_by_key:H8(t.tags_by_key),collapsed_groups:W8(t.collapsed_groups),view:{density:r,show_previews:!!n.show_previews,show_timestamps:!!n.show_timestamps,show_archived:!!n.show_archived,sort:a},updated_at:typeof t.updated_at=="string"?t.updated_at:null}}function q8(e,t){const n=new Set(t.map(o=>o.key)),r=o=>o.filter(i=>n.has(i)),a=o=>{const i={};for(const[l,c]of Object.entries(o))n.has(l)&&(i[l]=c);return i};return{...e,pinned_keys:r(e.pinned_keys),archived_keys:r(e.archived_keys),title_overrides:a(e.title_overrides),tags_by_key:a(e.tags_by_key)}}function K8(e,t){return JSON.stringify(e)===JSON.stringify(t)}function V8(e,t){const{token:n}=kr(),r=u.useRef(n),a=u.useRef(Oa),o=u.useRef(0),[i,l]=u.useState(Oa),[c,d]=u.useState(!0);r.current=n,a.current=i,u.useEffect(()=>{let f=!1;return d(!0),(async()=>{try{const h=Kd(await LL(r.current));if(f)return;a.current=h,l(h)}catch{if(f)return;a.current=Oa,l(Oa)}finally{f||d(!1)}})(),()=>{f=!0}},[]);const p=u.useCallback(async f=>{const h=Kd(f(a.current)),y=o.current+1;o.current=y,a.current=h,l(h);try{const x=Kd(await DL(r.current,h));if(o.current!==y)return;a.current=x,l(x)}catch{}},[]),m=u.useMemo(()=>!t||c?i:q8(i,e),[c,e,t,i]);return u.useEffect(()=>{!t||c||K8(m,i)||p(()=>m)},[c,m,t,i,p]),{state:i,loading:c,update:p}}function G8(e){const[t,n]=u.useState([]);return u.useEffect(()=>{let r=!1;return bL(e).then(({skills:a})=>!r&&n(a)).catch(()=>!r&&n([])),()=>{r=!0}},[e]),t}const nh="nanobot-webui.bootstrap-secret";function Y8(){if(typeof window>"u")return"";try{return window.localStorage.getItem(nh)??""}catch{return""}}function Q8(e){try{window.localStorage.setItem(nh,e)}catch{}}function X8(){try{window.localStorage.removeItem(nh)}catch{}}async function $x(e="",t="",n){const r={};t&&(r["X-Nanobot-Auth"]=t);const a=await Kf(`${e}/webui/bootstrap`,{method:"GET",credentials:"same-origin",headers:r},n);if(!a.ok)throw new Error(`bootstrap failed: HTTP ${a.status}`);const o=await a.json();if(!o.token||!o.ws_path)throw new Error("bootstrap response missing token or ws_path");return o}function Ux(e,t,n){const r=`?token=${encodeURIComponent(t)}`,a=e&&e.startsWith("/")?e:`/${e||""}`;if(typeof window<"u"&&window.location.port==="5173")return`ws://${window.location.hostname.includes(":")?`[${window.location.hostname}]`:window.location.hostname}:8765${a}${r}`;if(n&&/^(wss?|nanobot-host):\/\//i.test(n)){const l=n.includes("?")?"&":"?";return`${n}${l}token=${encodeURIComponent(t)}`}if(typeof window>"u")return`ws://127.0.0.1:8765${a}${r}`;const o=window.location.protocol==="https:"?"wss":"ws",i=window.location.host;return`${o}://${i}${a}${r}`}const Bx=1,J8=2,Z8="nanobot-host://";function e6(e){return e.startsWith(Z8)?O1(e):new WebSocket(e)}function Hx(){var e;if(typeof globalThis>"u")return!1;try{const t=globalThis.localStorage,n=((e=t==null?void 0:t.getItem("nanobot_debug_ws"))==null?void 0:e.trim().toLowerCase())??"";return n==="0"||n==="false"||n==="off"||n==="no"?!1:n==="1"||n==="true"||n==="on"||n==="yes"}catch{return!1}}function t6(e){const t=e.event;if(t!=="delta"&&t!=="reasoning_delta")return e;const n={...e},r=typeof n.text=="string"?n.text:"",a=240;return r.length>a&&(n.text=`${r.slice(0,a)}… (${r.length} chars)`),n}const Kc=class Kc{constructor(t){He(this,"socket",null);He(this,"statusHandlers",new Set);He(this,"runtimeModelHandlers",new Set);He(this,"sessionUpdateHandlers",new Set);He(this,"runStatusHandlers",new Set);He(this,"errorHandlers",new Set);He(this,"chatHandlers",new Map);He(this,"pendingInboundByChat",new Map);He(this,"knownChats",new Set);He(this,"runStartedAtByChatId",new Map);He(this,"goalStateByChatId",new Map);He(this,"pendingNewChat",null);He(this,"pendingTranscriptions",new Map);He(this,"sendQueue",[]);He(this,"reconnectAttempts",0);He(this,"reconnectTimer",null);He(this,"shouldReconnect");He(this,"maxBackoffMs");He(this,"socketFactory");He(this,"currentUrl");He(this,"status_","idle");He(this,"readyChatId",null);He(this,"intentionallyClosed",!1);this.options=t,this.shouldReconnect=t.reconnect??!0,this.maxBackoffMs=t.maxBackoffMs??15e3,this.socketFactory=t.socketFactory??e6,this.currentUrl=t.url}get status(){return this.status_}get defaultChatId(){return this.readyChatId}updateUrl(t,n){this.currentUrl=t,n&&(this.socketFactory=n)}onStatus(t){return this.statusHandlers.add(t),t(this.status_),()=>{this.statusHandlers.delete(t)}}onRuntimeModelUpdate(t){return this.runtimeModelHandlers.add(t),()=>{this.runtimeModelHandlers.delete(t)}}onSessionUpdate(t){return this.sessionUpdateHandlers.add(t),()=>{this.sessionUpdateHandlers.delete(t)}}onRunStatus(t){this.runStatusHandlers.add(t);for(const[n,r]of this.runStartedAtByChatId)t(n,r);return()=>{this.runStatusHandlers.delete(t)}}onError(t){return this.errorHandlers.add(t),()=>{this.errorHandlers.delete(t)}}getRunStartedAt(t){const n=this.runStartedAtByChatId.get(t);return n===void 0?null:n}getGoalState(t){return this.goalStateByChatId.get(t)}recordGoalStatusForRunStrip(t,n){if(n.event==="turn_end"){this.runStartedAtByChatId.has(t)&&(this.runStartedAtByChatId.delete(t),this.emitRunStatus(t,null));return}if(n.event==="goal_status")if(n.status==="running"&&typeof n.started_at=="number"){const r=this.runStartedAtByChatId.get(t);this.runStartedAtByChatId.set(t,n.started_at),r!==n.started_at&&this.emitRunStatus(t,n.started_at)}else this.runStartedAtByChatId.has(t)&&(this.runStartedAtByChatId.delete(t),this.emitRunStatus(t,null))}recordGoalStateSnapshot(t,n){if(n.event==="goal_state"){this.goalStateByChatId.set(t,n.goal_state);return}n.event==="turn_end"&&n.goal_state!=null&&typeof n.goal_state=="object"&&this.goalStateByChatId.set(t,n.goal_state)}onChat(t,n){let r=this.chatHandlers.get(t);r||(r=new Set,this.chatHandlers.set(t,r)),r.add(n);const a=this.pendingInboundByChat.get(t);if(a!==void 0&&a.length>0){const o=a.splice(0);this.pendingInboundByChat.delete(t);for(const i of o)n(i)}return this.attach(t),()=>{const o=this.chatHandlers.get(t);o&&(o.delete(n),o.size===0&&this.chatHandlers.delete(t))}}connect(){if(this.socket&&this.socket.readyState<J8)return;this.intentionallyClosed=!1,this.setStatus("connecting");const t=this.socketFactory(this.currentUrl);this.socket=t,t.onopen=()=>this.handleOpen(),t.onmessage=n=>this.handleMessage(n),t.onerror=()=>this.setStatus("error"),t.onclose=n=>this.handleClose(n)}close(){this.intentionallyClosed=!0,this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null);const t=this.socket;this.socket=null;try{t==null||t.close()}catch{}this.setStatus("closed")}newChat(t=5e3,n){return this.pendingNewChat?Promise.reject(new Error("newChat already in flight")):new Promise((r,a)=>{const o=setTimeout(()=>{this.pendingNewChat=null,a(new Error("newChat timed out"))},t);this.pendingNewChat={resolve:r,reject:a,timer:o},this.queueSend({type:"new_chat",...n?{workspace_scope:n}:{}})})}transcribeAudio(t,n){const r=crypto.randomUUID(),a=(n==null?void 0:n.timeoutMs)??12e4;return new Promise((o,i)=>{const l=setTimeout(()=>{this.pendingTranscriptions.delete(r),i(new Error("transcription timed out"))},a);this.pendingTranscriptions.set(r,{resolve:o,reject:i,timer:l}),this.queueSend({type:"transcribe_audio",request_id:r,data_url:t,...(n==null?void 0:n.durationMs)!==void 0?{duration_ms:n.durationMs}:{}})})}forkChat(t,n,r,a=5e3){return this.pendingNewChat?Promise.reject(new Error("newChat already in flight")):new Promise((o,i)=>{const l=setTimeout(()=>{this.pendingNewChat=null,i(new Error("forkChat timed out"))},a);this.pendingNewChat={resolve:o,reject:i,timer:l},this.queueSend({type:"fork_chat",source_chat_id:t,before_user_index:n,...r!=null&&r.trim()?{title:r.trim()}:{}})})}attach(t){var n;this.knownChats.add(t),((n=this.socket)==null?void 0:n.readyState)===Bx&&this.queueSend({type:"attach",chat_id:t})}sendMessage(t,n,r,a){var i,l,c;this.knownChats.add(t);const o={type:"message",chat_id:t,content:n,...r&&r.length>0?{media:r}:{},...(i=a==null?void 0:a.attachments)!=null&&i.length?{attachments:a.attachments}:{},...a!=null&&a.imageGeneration?{image_generation:a.imageGeneration}:{},...(l=a==null?void 0:a.cliApps)!=null&&l.length?{cli_apps:a.cliApps}:{},...(c=a==null?void 0:a.mcpPresets)!=null&&c.length?{mcp_presets:a.mcpPresets}:{},...a!=null&&a.workspaceScope?{workspace_scope:a.workspaceScope}:{},...a!=null&&a.turnId?{turn_id:a.turnId}:{},webui:!0};this.queueSend(o)}setWorkspaceScope(t,n){this.knownChats.add(t),this.queueSend({type:"set_workspace_scope",chat_id:t,workspace_scope:n})}setStatus(t){if(this.status_!==t){this.status_=t;for(const n of this.statusHandlers)n(t)}}handleOpen(){this.setStatus("open"),this.reconnectAttempts=0;for(const n of this.knownChats)this.rawSend({type:"attach",chat_id:n});const t=this.sendQueue.splice(0);for(const n of t)this.rawSend(n)}handleMessage(t){let n;try{n=JSON.parse(typeof t.data=="string"?t.data:"")}catch{if(Hx()){const a=typeof t.data=="string"?t.data:String(t.data);console.warn("[nanobot ws inbound] invalid JSON",a.length>400?`${a.slice(0,400)}… (${a.length} chars)`:a)}return}if(Hx()&&console.log("[nanobot ws inbound]",t6(n)),n.event==="ready"){this.readyChatId=n.chat_id,this.knownChats.add(n.chat_id);return}if(n.event==="attached"){this.knownChats.add(n.chat_id),this.pendingNewChat&&(clearTimeout(this.pendingNewChat.timer),this.pendingNewChat.resolve(n.chat_id),this.pendingNewChat=null),this.dispatch(n.chat_id,n);return}if(n.event==="runtime_model_updated"){this.emitRuntimeModelUpdate(n.model_name||null,n.model_preset??null);return}if(n.event==="transcription_result"){this.resolveTranscription(n.request_id,n.text);return}if(n.event==="transcription_error"){this.rejectTranscription(n.request_id,n.detail||"error");return}if(n.event==="session_updated"){this.emitSessionUpdate(n.chat_id,n.scope,n.workspace_scope);return}if(n.event==="error"&&n.detail==="workspace_scope_rejected"&&(this.emitError({kind:"workspace_scope_rejected",reason:n.reason,chatId:n.chat_id}),this.pendingNewChat&&(clearTimeout(this.pendingNewChat.timer),this.pendingNewChat.reject(new Error(`workspace_scope_rejected:${n.reason||""}`)),this.pendingNewChat=null)),n.event==="error"&&this.pendingNewChat){clearTimeout(this.pendingNewChat.timer);const a=typeof n.detail=="string"?n.detail:"server error",o=typeof n.reason=="string"&&n.reason?`:${n.reason}`:"";this.pendingNewChat.reject(new Error(`${a}${o}`)),this.pendingNewChat=null}const r=n.chat_id;r&&(this.recordGoalStatusForRunStrip(r,n),this.recordGoalStateSnapshot(r,n),this.dispatch(r,n))}emitRuntimeModelUpdate(t,n){for(const r of this.runtimeModelHandlers)r(t,n)}emitSessionUpdate(t,n,r){for(const a of this.sessionUpdateHandlers)a(t,n,r)}emitRunStatus(t,n){for(const r of this.runStatusHandlers)r(t,n)}dispatch(t,n){const r=this.chatHandlers.get(t);if(r!==void 0&&r.size>0){for(const i of r)i(n);return}let a=this.pendingInboundByChat.get(t);a||(a=[],this.pendingInboundByChat.set(t,a)),a.push(n);const o=a.length-Kc.PENDING_INBOUND_MAX;o>0&&a.splice(0,o)}handleClose(t){if(this.socket=null,this.pendingNewChat&&(clearTimeout(this.pendingNewChat.timer),this.pendingNewChat.reject(new Error("socket closed")),this.pendingNewChat=null),this.rejectAllTranscriptions("socket closed"),(t==null?void 0:t.code)===1009&&this.emitError({kind:"message_too_big"}),this.intentionallyClosed||!this.shouldReconnect){this.setStatus("closed");return}this.scheduleReconnect()}emitError(t){for(const n of this.errorHandlers)try{n(t)}catch{}}resolveTranscription(t,n){const r=this.pendingTranscriptions.get(t);r&&(clearTimeout(r.timer),this.pendingTranscriptions.delete(t),r.resolve(n))}rejectTranscription(t,n){if(!t){this.rejectAllTranscriptions(n);return}const r=this.pendingTranscriptions.get(t);r&&(clearTimeout(r.timer),this.pendingTranscriptions.delete(t),r.reject(new Error(n)))}rejectAllTranscriptions(t){for(const[n,r]of this.pendingTranscriptions)clearTimeout(r.timer),r.reject(new Error(t)),this.pendingTranscriptions.delete(n)}scheduleReconnect(){this.setStatus("reconnecting");const t=this.reconnectAttempts++,n=Math.min(500*2**t,this.maxBackoffMs);this.reconnectTimer=setTimeout(async()=>{if(this.reconnectTimer=null,this.options.onReauth)try{const r=await this.options.onReauth();r&&(this.currentUrl=r)}catch{}this.connect()},n)}queueSend(t){var n;((n=this.socket)==null?void 0:n.readyState)===Bx?this.rawSend(t):this.sendQueue.push(t)}rawSend(t){if(this.socket)try{this.socket.send(JSON.stringify(t))}catch{this.sendQueue.push(t)}}};He(Kc,"PENDING_INBOUND_MAX",2e3);let bm=Kc;const iS="nanobot-webui.sidebar",lS="nanobot-webui.sidebar.session-updates.v1",n6="nanobot-webui.sidebar.completed-runs.v1",Vd="nanobot-webui.restartStartedAt",tc=272,r6=56,Wx=`min(${tc}px, calc(100vw - 0.75rem))`,a6=3e4,o6=5e3,s6=["overview","appearance","models","image","voice","browser","apps","automations","skills","runtime","advanced"];function i6(e){return s6.includes(e)}function oa(){return{view:"chat",activeKey:null,settingsSection:"overview"}}function cS(e){return e==="apps"||e==="automations"||e==="skills"?e:"settings"}function Gd(){var l;if(typeof window>"u")return oa();const e=window.location.hash.startsWith("#")?window.location.hash.slice(1):window.location.hash;if(!e||e==="/"||e==="/new")return oa();const[t,n=""]=e.split("?",2),r=new URLSearchParams(n),a=r.get("section"),o=i6(a)?a:"overview",i=((l=r.get("chat"))==null?void 0:l.trim())||null;if(t==="/settings")return{view:cS(o),activeKey:i,settingsSection:o};if(t==="/apps")return{view:"apps",activeKey:i,settingsSection:"apps"};if(t==="/automations")return{view:"automations",activeKey:i,settingsSection:"automations"};if(t==="/skills")return{view:"skills",activeKey:i,settingsSection:"skills"};if(t.startsWith("/chat/")){const c=t.slice(6);try{const d=decodeURIComponent(c).trim();return d?{view:"chat",activeKey:d,settingsSection:"overview"}:oa()}catch{return oa()}}return oa()}function l6(e){if(e.view==="chat")return e.activeKey?`#/chat/${encodeURIComponent(e.activeKey)}`:"#/new";const t=new URLSearchParams;e.activeKey&&t.set("chat",e.activeKey),e.view==="settings"&&e.settingsSection!=="overview"&&t.set("section",e.settingsSection);const n=t.toString();return`#/${e.view}${n?`?${n}`:""}`}function c6(e,t=!1){if(typeof window>"u")return;const n=l6(e);if(window.location.hash!==n){if(t){window.history.replaceState(null,"",`${window.location.pathname}${window.location.search}${n}`);return}window.location.hash=n}}function qx(e){return Date.now()+Math.max(0,e)*1e3}function u6(e){const t=Math.max(0,e-Date.now()),n=Math.min(a6,Math.max(1e3,t/2));return Math.max(o6,t-n)}function d6({failed:e,onSecret:t}){const{t:n}=ie(),[r,a]=u.useState(""),[o,i]=u.useState(!1),l=c=>{c.preventDefault();const d=r.trim();d&&(i(!0),t(d))};return s.jsx("div",{className:"flex h-full w-full items-center justify-center px-6",children:s.jsxs("form",{onSubmit:l,className:"flex w-full max-w-sm flex-col gap-4",children:[s.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[s.jsx("p",{className:"text-lg font-semibold",children:n("app.auth.title")}),s.jsx("p",{className:"text-sm text-muted-foreground",children:n("app.auth.hint")})]}),e&&s.jsx("p",{className:"text-center text-sm text-destructive",children:n("app.auth.invalid")}),s.jsx(Ye,{type:"password",placeholder:n("app.auth.placeholder"),value:r,onChange:c=>a(c.target.value),disabled:o,autoFocus:!0}),s.jsx(fe,{type:"submit",className:"w-full",disabled:!r.trim()||o,children:n("app.auth.submit")})]})})}function p6(){if(typeof window>"u")return!0;try{const e=window.localStorage.getItem(iS);return e===null?!0:e==="1"}catch{return!0}}function m6(){if(typeof window>"u")return new Set;try{const e=window.localStorage.getItem(lS)??window.localStorage.getItem(n6),t=e?JSON.parse(e):[];return Array.isArray(t)?new Set(t.filter(n=>typeof n=="string")):new Set}catch{return new Set}}function f6(e){try{window.localStorage.setItem(lS,JSON.stringify(Array.from(e)))}catch{}}function Os(e){const t=e.access_mode==="restricted"?"restricted":"full";return{...e,project_name:e.project_name??Ri(e.project_path),access_mode:t,restrict_to_workspace:t==="restricted"}}function h6({onToggleSidebar:e,onSidebarPreviewEnter:t,onSidebarPreviewLeave:n,sidebarOpen:r=!0,rightAction:a}){const{t:o}=ie();return s.jsxs("header",{className:"host-drag-region pointer-events-none absolute inset-x-0 top-0 z-40 h-11 bg-transparent text-foreground/90",children:[e?s.jsx(fe,{type:"button",variant:"ghost",size:"icon","aria-label":o("thread.header.toggleSidebar"),"data-testid":"host-sidebar-toggle",onClick:e,onFocus:r?void 0:t,onBlur:r?void 0:n,onMouseEnter:r?void 0:t,onMouseLeave:r?void 0:n,className:"host-no-drag pointer-events-auto absolute left-[88px] top-[8px] h-7 w-7 rounded-lg bg-transparent text-muted-foreground/85 shadow-none hover:bg-transparent hover:text-foreground",children:s.jsx(dA,{className:"h-[15px] w-[15px]",strokeWidth:1.75})}):null,a?s.jsx("div",{className:"host-no-drag pointer-events-auto absolute right-3 top-2",children:a}):null]})}function g6(){const{t:e}=ie(),[t,n]=u.useState({status:"loading"}),r=u.useRef(""),a=u.useCallback(async(d,p)=>{const m=await $x("",r.current),f=Ux(m.ws_path,m.token,m.ws_url),h=m.runtime_surface?wv(m.runtime_surface):p,y=kv(h,m.runtime_capabilities),x=qx(m.expires_in);return y.socketFactory?d.updateUrl(f,y.socketFactory):d.updateUrl(f),n(b=>b.status==="ready"&&b.client===d?{...b,token:m.token,tokenExpiresAt:x,modelName:m.model_name??b.modelName,runtimeSurface:h}:b),{token:m.token,url:f}},[]),o=u.useCallback(d=>{let p=!1;return(async()=>{n({status:"loading"});try{const m=await $x("",d);if(p)return;d&&Q8(d);const f=Ux(m.ws_path,m.token,m.ws_url),h=wv(m.runtime_surface),y=kv(h,m.runtime_capabilities),x=new bm({url:f,socketFactory:y.socketFactory,onReauth:async()=>{try{return(await a(x,h)).url}catch{return null}}});r.current=d,x.connect(),n({status:"ready",client:x,token:m.token,tokenExpiresAt:qx(m.expires_in),modelName:m.model_name??null,runtimeSurface:h})}catch(m){if(p)return;const f=m.message;f.includes("HTTP 401")||f.includes("HTTP 403")?n({status:"auth",failed:!!d}):n({status:"error",message:f})}})(),()=>{p=!0}},[a]);if(u.useEffect(()=>{if(t.status!=="ready")return;const d=t.client,p=window.setTimeout(async()=>{try{await a(d,t.runtimeSurface)}catch(m){const f=m.message;(f.includes("HTTP 401")||f.includes("HTTP 403"))&&n({status:"auth",failed:!!r.current})}},u6(t.tokenExpiresAt));return()=>window.clearTimeout(p)},[a,t]),u.useEffect(()=>{const d=Y8();return o(d)},[o]),t.status==="loading")return s.jsx("div",{className:"flex h-full w-full items-center justify-center",children:s.jsx("div",{className:"flex flex-col items-center gap-3 animate-in fade-in-0 duration-300",children:s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsxs("span",{className:"relative flex h-2 w-2",children:[s.jsx("span",{className:"absolute inline-flex h-full w-full animate-ping rounded-full bg-foreground/40"}),s.jsx("span",{className:"relative inline-flex h-2 w-2 rounded-full bg-foreground/60"})]}),e("app.loading.connecting")]})})});if(t.status==="auth")return s.jsx(d6,{failed:!!t.failed,onSecret:d=>o(d)});if(t.status==="error")return s.jsx("div",{className:"flex h-full w-full items-center justify-center px-4 text-center",children:s.jsxs("div",{className:"flex max-w-md flex-col items-center gap-3",children:[s.jsx("p",{className:"text-lg font-semibold",children:e("app.error.title")}),s.jsx("p",{className:"text-sm text-muted-foreground",children:t.message}),s.jsx("p",{className:"text-xs text-muted-foreground",children:e("app.error.gatewayHint")})]})});const i=d=>{n(p=>p.status==="ready"?{...p,modelName:d}:p)},l=()=>{t.status==="ready"&&t.client.close(),X8(),n({status:"auth"})},c=async()=>{const d=Ja();if(!(d!=null&&d.restartEngine))throw new Error("native engine restart is unavailable");return await d.restartEngine(),(await a(t.client,t.runtimeSurface)).token};return s.jsx(J5,{client:t.client,token:t.token,modelName:t.modelName,children:s.jsx(v6,{runtimeSurface:t.runtimeSurface,onModelNameChange:i,onLogout:l,onNativeEngineRestart:c})})}function v6({runtimeSurface:e,onModelNameChange:t,onLogout:n,onNativeEngineRestart:r}){const{t:a,i18n:o}=ie(),{client:i,token:l}=kr(),{theme:c,toggle:d}=b4(),{sessions:p,loading:m,refresh:f,createChat:h,forkChat:y,deleteChat:x,getSessionAutomations:b}=j8(),{state:v,update:g}=V8(p,!m),w=u.useRef(null);w.current||(w.current=Gd());const[k,C]=u.useState(w.current.activeKey),[N,S]=u.useState(w.current.view),[A,E]=u.useState(w.current.settingsSection),[_,R]=u.useState(p6),[T,F]=u.useState(!1),[z,K]=u.useState(!1),[$,W]=u.useState(!1),[P,D]=u.useState(null),[G,Y]=u.useState(null),[oe,de]=u.useState(null),pe=u.useRef(!1),[le,I]=u.useState(null),[Q,O]=u.useState(!1),[ne,he]=u.useState(()=>new Set),[ve,me]=u.useState(m6),[ee,we]=u.useState(null),je=G8(l),[xe,Ee]=u.useState(null),[$e,Se]=u.useState(null),[Fe,B]=u.useState(null),[X,J]=u.useState({}),ye=u.useRef(new Set),Ie=u.useRef(null),Ne=u.useRef(null),ue=((xe==null?void 0:xe.surface)??(xe==null?void 0:xe.runtime_surface)??e)==="native",Be=N!=="settings",ze=u.useCallback((H,q)=>{C(H.activeKey),S(H.view),E(H.settingsSection),c6(H,q==null?void 0:q.replace)},[]);u.useEffect(()=>{const H=()=>{const q=Gd();C(q.activeKey),S(q.view),E(q.settingsSection),Se(null),q.view==="chat"&&!q.activeKey&&B(null)};return window.addEventListener("hashchange",H),()=>window.removeEventListener("hashchange",H)},[]),u.useEffect(()=>{let H=!1;return oi(l).then(q=>{H||Ee(q)}).catch(()=>{H||Ee(null)}),()=>{H=!0}},[l]),u.useEffect(()=>{try{window.localStorage.setItem(iS,_?"1":"0")}catch{}},[_]),u.useEffect(()=>{f6(ve)},[ve]);const We=u.useMemo(()=>k?p.find(H=>H.key===k)??null:null,[p,k]),nr=u.useMemo(()=>Array.from(ne),[ne]),xn=u.useMemo(()=>Array.from(ve),[ve]),Qe=(We==null?void 0:We.chatId)??null;u.useEffect(()=>{Ie.current=Qe,Qe&&me(H=>{if(!H.has(Qe))return H;const q=new Set(H);return q.delete(Qe),q})},[Qe]);const yn=u.useMemo(()=>Qe&&X[Qe]?X[Qe]:We!=null&&We.workspaceScope?We.workspaceScope:Fe??(ee==null?void 0:ee.default_scope)??null,[Qe,We==null?void 0:We.workspaceScope,Fe,X,ee==null?void 0:ee.default_scope]),rr=Qe?ne.has(Qe):!1,cn=u.useCallback(async()=>{try{const H=await NL(l);we(H)}catch{we(null)}},[l]);u.useEffect(()=>{cn()},[cn]),u.useEffect(()=>{if(m)return;const H=new Set(p.map(q=>q.chatId));me(q=>{const se=new Set(Array.from(q).filter(ke=>H.has(ke)));return se.size===q.size?q:se}),J(q=>{const se=Object.entries(q).filter(([ke])=>H.has(ke));return se.length===Object.keys(q).length?q:Object.fromEntries(se)})},[m,p]),u.useEffect(()=>{if(m||!k||p.some(q=>q.key===k))return;const H=Gd();ze(H.view==="chat"?oa():{...H,activeKey:null},{replace:!0})},[k,m,ze,p]),u.useEffect(()=>i.onSessionUpdate((H,q,se)=>{if(q==="thread"&&me(Le=>{const Dt=new Set(Le);return Ie.current===H?Dt.delete(H):Dt.add(H),Dt.size===Le.size&&Dt.has(H)===Le.has(H)?Le:Dt}),!se)return;const ke=Os(se);J(Le=>({...Le,[H]:ke})),B(ke),Se(null),cn()}),[i,cn]),u.useEffect(()=>i.onError(H=>{H.kind==="workspace_scope_rejected"&&(Se(a("errors.workspaceScopeRejected.body")),cn())}),[i,cn,a]),u.useEffect(()=>{if(m)return;const H=p.filter(q=>typeof q.runStartedAt=="number").map(q=>q.chatId);if(H.length!==0){for(const q of H)i.attach(q);he(q=>{let se=!1;const ke=new Set(q);for(const Le of H)ke.has(Le)||(se=!0),ke.add(Le);return se?(ye.current=ke,ke):q}),me(q=>{let se=!1;const ke=new Set(q);for(const Le of H)ke.delete(Le)&&(se=!0);return se?ke:q})}},[i,m,p]);const zt=u.useCallback(()=>{Ne.current!==null&&(window.clearTimeout(Ne.current),Ne.current=null)},[]),jt=u.useCallback(()=>{zt(),F(!1)},[zt]),Vr=u.useCallback(()=>{!ue||!Be||_||(zt(),F(!0))},[zt,_,ue,Be]),kt=u.useCallback(()=>{if(zt(),!ue||!Be||_){F(!1);return}Ne.current=window.setTimeout(()=>{F(!1),Ne.current=null},160)},[zt,_,ue,Be]);u.useEffect(()=>()=>zt(),[zt]),u.useEffect(()=>{(!ue||!Be||_)&&jt()},[jt,_,ue,Be]);const ar=u.useCallback(()=>{jt(),R(!1)},[jt]),Cr=u.useCallback(()=>{jt(),R(!0)},[jt]),Hn=u.useCallback(()=>{jt(),R(H=>!H)},[jt]),bn=u.useCallback(()=>{K(!1)},[]),or=u.useCallback(()=>{typeof window<"u"&&window.matchMedia("(min-width: 1024px)").matches?(jt(),R(q=>!q)):K(q=>!q)},[jt]),Ze=u.useCallback(H=>{const q=Os(H);if(Se(null),Qe){rr||i.setWorkspaceScope(Qe,q);return}B(q)},[Qe,rr,i]),Sr=u.useCallback(async H=>{try{const q=H??yn,se=await h(q);return ze({view:"chat",activeKey:`websocket:${se}`,settingsSection:"overview"}),K(!1),q&&J(ke=>({...ke,[se]:Os(q)})),se}catch(q){return console.error("Failed to create chat",q),q instanceof Error&&q.message.startsWith("workspace_scope_rejected:")&&Se(a("errors.workspaceScopeRejected.body")),null}},[yn,h,ze,a]),et=u.useCallback(async(H,q)=>{try{const se=p.find(Dt=>Dt.chatId===H),ke=se?m1(se,v.title_overrides,a("chat.newChat")):a("chat.newChat"),Le=await y(H,q,a("chat.forkTitle",{title:ke}));return ze({view:"chat",activeKey:`websocket:${Le}`,settingsSection:"overview"}),K(!1),Le}catch(se){return console.error("Failed to fork chat",se),null}},[y,ze,p,v.title_overrides,a]),$t=u.useCallback(()=>{ze(oa()),B(null),Se(null),W(!1),K(!1)},[ze]),nt=u.useCallback((H,q)=>{const se=(ee==null?void 0:ee.default_scope)??yn,ke=H.trim();if(!se||!ke){$t();return}ze(oa()),B(Os({project_path:ke,project_name:q||Ri(ke),access_mode:se.access_mode,restrict_to_workspace:se.access_mode==="restricted"})),Se(null),K(!1)},[yn,ze,$t,ee==null?void 0:ee.default_scope]),At=u.useCallback(H=>{const q=p.find(ke=>ke.key===H),se=q==null?void 0:q.chatId;se&&me(ke=>{if(!ke.has(se))return ke;const Le=new Set(ke);return Le.delete(se),Le}),q!=null&&q.workspaceScope?B(Os(q.workspaceScope)):B(null),Se(null),ze({view:"chat",activeKey:H,settingsSection:"overview"}),K(!1)},[ze,p]),In=u.useCallback(H=>{g(q=>{const se=new Set(q.pinned_keys);return se.has(H)?se.delete(H):se.add(H),{...q,pinned_keys:Array.from(se)}})},[g]),wn=u.useCallback((H,q)=>{Y({key:H,label:q})},[]),un=u.useCallback(H=>{if(!G)return;const q=G.key;Y(null),g(se=>{const ke={...se.title_overrides},Le=H.trim();return Le?ke[q]=Le:delete ke[q],{...se,title_overrides:ke}})},[G,g]),Wn=u.useCallback(H=>{g(q=>{const se={...q.collapsed_groups};return H==="workspace:chats"||H==="date:all"?(se[H]===!1?delete se[H]:se[H]=!1,{...q,collapsed_groups:se}):(se[H]?delete se[H]:se[H]=!0,{...q,collapsed_groups:se})})},[g]),sr=u.useCallback((H,q)=>{de({key:H,label:q})},[]),Gr=u.useCallback(H=>{if(!oe)return;const q=oe.key;de(null),g(se=>{const ke={...se.project_name_overrides},Le=H.trim();return Le?ke[q]=Le:delete ke[q],{...se,project_name_overrides:ke}})},[oe,g]),Nr=u.useCallback(H=>{if(g(q=>{const se=new Set(q.archived_keys),ke=q.pinned_keys.filter(Le=>Le!==H);return se.has(H)?se.delete(H):se.add(H),{...q,pinned_keys:ke,archived_keys:Array.from(se)}}),k===H&&!v.archived_keys.includes(H)){const q=new Set([...v.archived_keys,H]),se=p.find(ke=>!q.has(ke.key));ze({view:"chat",activeKey:(se==null?void 0:se.key)??null,settingsSection:"overview"})}},[k,ze,p,v.archived_keys,g]),en=u.useCallback(()=>{g(H=>({...H,view:{...H.view,show_archived:!H.view.show_archived}}))},[g]),be=u.useCallback(()=>{K(!1),W(!0)},[]);u.useEffect(()=>{const H=q=>{if(q.defaultPrevented)return;if((q.metaKey||q.ctrlKey)&&q.shiftKey&&!q.altKey&&q.key.toLowerCase()==="o"){q.preventDefault(),$t();return}(q.metaKey||q.ctrlKey)&&!q.altKey&&!q.shiftKey&&q.key.toLowerCase()==="k"&&(q.preventDefault(),be())};return window.addEventListener("keydown",H),()=>window.removeEventListener("keydown",H)},[$t,be]);const Ae=u.useCallback(H=>{W(!1),At(H)},[At]),mt=u.useCallback((H="overview")=>{W(!1),ze({view:"settings",activeKey:k,settingsSection:H}),K(!1)},[k,ze]),Vt=u.useCallback(()=>{mt("models")},[mt]),Me=u.useCallback(()=>{W(!1),ze({view:"apps",activeKey:k,settingsSection:"apps"}),K(!1)},[k,ze]),yt=u.useCallback(()=>{W(!1),ze({view:"automations",activeKey:k,settingsSection:"automations"}),K(!1)},[k,ze]),tn=u.useCallback(()=>{W(!1),ze({view:"skills",activeKey:k,settingsSection:"skills"}),K(!1)},[k,ze]),Gt=u.useCallback(H=>{ze({view:cS(H),activeKey:k,settingsSection:H})},[k,ze]),It=u.useCallback(()=>{K(!1);const H=(()=>{var q;return k?p.some(se=>se.key===k)?k:((q=p[0])==null?void 0:q.key)??null:null})();ze({view:"chat",activeKey:H,settingsSection:"overview"})},[k,ze,p]),ft=u.useCallback(()=>{const H=(We==null?void 0:We.chatId)??i.defaultChatId;if(H){pe.current=!1,O(!0);try{window.localStorage.setItem(Vd,String(Date.now()))}catch{}i.sendMessage(H,"/restart")}},[We==null?void 0:We.chatId,i]);u.useEffect(()=>i.onRuntimeModelUpdate(H=>{t(H)}),[i,t]),u.useEffect(()=>i.onRunStatus((H,q)=>{if(q!=null){const ke=new Set(ye.current);ke.add(H),ye.current=ke,he(ke),me(Le=>{if(!Le.has(H))return Le;const Dt=new Set(Le);return Dt.delete(H),Dt});return}if(!ye.current.has(H))return;const se=new Set(ye.current);se.delete(H),ye.current=se,he(se),me(ke=>{const Le=new Set(ke);return Ie.current===H?Le.delete(H):Le.add(H),Le})}),[i]),u.useEffect(()=>i.onStatus(H=>{const q=(()=>{try{return Number(window.localStorage.getItem(Vd)??"0")}catch{return 0}})();if(!q)return;if(H!=="open"){pe.current=!0;return}const se=Date.now()-q;if(!(!pe.current&&se<1500)){try{window.localStorage.removeItem(Vd)}catch{}O(!1),I(a("app.restart.completed",{seconds:(se/1e3).toFixed(1)})),window.setTimeout(()=>I(null),3500)}}),[i,a]);const Ct=B8(We,f),Lt=u.useCallback(async()=>{var Dt,jr,qe;if(!P)return;const H=P.key,q=(((Dt=P.automations)==null?void 0:Dt.length)??0)>0,se=k===H,ke=p.findIndex(Cn=>Cn.key===H),Le=se?((jr=p[ke+1])==null?void 0:jr.key)??((qe=p[ke-1])==null?void 0:qe.key)??null:k;try{const Cn=await x(H,q?{deleteAutomations:!0}:void 0);if(Cn.blocked_by_automations){D({...P,automations:Cn.automations??[]});return}D(null),se&&ze({view:"chat",activeKey:Le,settingsSection:"overview"},{replace:!0})}catch(Cn){console.error("Failed to delete session",Cn)}},[P,x,k,ze,p]),ir=u.useCallback(async(H,q)=>{let se=[];try{se=await b(H)}catch{}D({key:H,label:q,automations:se})},[b]),St=We?v.title_overrides[We.key]||We.title||Gi(We.preview,a("chat.newChat")):a("app.brand");u.useEffect(()=>{if(N==="settings"){document.title=a("app.documentTitle.chat",{title:a("settings.sidebar.title")});return}if(N==="apps"){document.title=a("app.documentTitle.chat",{title:a("settings.nav.apps",{defaultValue:"Apps"})});return}if(N==="automations"){document.title=a("app.documentTitle.chat",{title:a("settings.nav.automations",{defaultValue:"Automations"})});return}if(N==="skills"){document.title=a("app.documentTitle.chat",{title:a("settings.nav.skills",{defaultValue:"Skills"})});return}document.title=We?a("app.documentTitle.chat",{title:St}):a("app.documentTitle.base")},[We,St,o.resolvedLanguage,a,N]);const Ut={sessions:p,activeKey:k,loading:m,onNewChat:$t,onSelect:At,onRequestDelete:ir,onTogglePin:In,onRequestRename:wn,onToggleArchive:Nr,onToggleGroup:Wn,onRequestRenameProject:sr,onNewChatInProject:nt,onOpenSettings:mt,onOpenApps:Me,onOpenAutomations:yt,onOpenSkills:tn,onOpenSearch:be,activeUtility:N==="apps"||N==="automations"||N==="skills"?N:null,onToggleArchived:en,pinnedKeys:v.pinned_keys,archivedKeys:v.archived_keys,titleOverrides:v.title_overrides,projectNameOverrides:v.project_name_overrides,collapsedGroups:v.collapsed_groups,runningChatIds:nr,updatedChatIds:xn,viewState:v.view,showArchived:v.view.show_archived,archivedCount:v.archived_keys.length,defaultWorkspacePath:(ee==null?void 0:ee.default_scope.project_path)??null},nn=ue&&!_,lo=Be&&nn&&T,kn=ue?_?tc:0:_?tc:r6,co=!ue||_;return u.useEffect(()=>(document.documentElement.classList.toggle("native-host",ue),()=>{document.documentElement.classList.remove("native-host")}),[ue]),s.jsx(w4,{theme:c,children:s.jsxs("div",{className:j("relative h-full w-full overflow-hidden",ue&&"host-window-shell"),children:[ue?s.jsx(h6,{onToggleSidebar:Be?Hn:void 0,onSidebarPreviewEnter:Vr,onSidebarPreviewLeave:kt,sidebarOpen:_,rightAction:N==="chat"?void 0:s.jsx(fe,{type:"button",variant:"ghost",size:"icon","aria-label":a("thread.header.toggleTheme"),onClick:d,className:"h-8 w-8 rounded-full text-muted-foreground/85 hover:bg-accent/40 hover:text-foreground",children:c==="dark"?s.jsx(iw,{className:"h-4 w-4"}):s.jsx(vf,{className:"h-4 w-4"})})}):null,s.jsxs("div",{className:j("relative flex h-full w-full overflow-hidden"),children:[Be?s.jsx("aside",{"data-testid":"host-sidebar-flow",className:j("relative z-20 hidden shrink-0 overflow-hidden lg:block","transition-[width] duration-300 ease-out"),style:{width:kn},children:co?s.jsx("div",{className:j("absolute inset-y-0 left-0 h-full w-full overflow-hidden",ue?"host-sidebar-glass":"bg-sidebar shadow-inner-right"),children:s.jsx(Rd,{...Ut,collapsed:!ue&&!_,hostChromeInset:ue,onCollapse:ar,onExpand:Cr})}):null}):null,lo?s.jsx("aside",{"data-testid":"host-sidebar-preview",className:"absolute inset-y-0 left-0 z-30 hidden overflow-hidden lg:block animate-in fade-in-0 slide-in-from-left-2 duration-150",style:{width:tc},onMouseEnter:Vr,onMouseLeave:kt,children:s.jsx("div",{className:"h-full w-full overflow-hidden host-sidebar-glass shadow-2xl",children:s.jsx(Rd,{...Ut,hostChromeInset:ue,onCollapse:ar,onExpand:Cr})})}):null,Be?s.jsx(qf,{open:z,onOpenChange:H=>K(H),children:s.jsxs(ju,{side:"left",showCloseButton:!1,"aria-describedby":void 0,className:"p-0 lg:hidden",style:{width:Wx,maxWidth:Wx},children:[s.jsx(Au,{className:"sr-only",children:a("sidebar.navigation")}),s.jsx(Rd,{...Ut,onCollapse:bn,containActionMenus:!0})]})}):null,s.jsx(lL,{open:$,onOpenChange:W,sessions:p,activeKey:k,loading:m,titleOverrides:v.title_overrides,onSelect:Ae}),s.jsxs("main",{className:j("relative flex h-full min-w-0 flex-1 flex-col overflow-hidden bg-background",ue&&_&&"border-l border-border/55"),children:[s.jsx("div",{className:j("absolute inset-0 flex flex-col",N!=="chat"&&"invisible pointer-events-none"),children:s.jsx($8,{session:We,title:St,onToggleSidebar:or,onNewChat:$t,onCreateChat:Sr,onForkChat:et,onTurnEnd:Ct,theme:c,onToggleTheme:d,hideSidebarToggleForHostChrome:!0,hostChromeTitleInset:nn,hideHeader:!1,workspaceScope:yn,workspaceDefaultScope:(ee==null?void 0:ee.default_scope)??null,workspaceControls:(ee==null?void 0:ee.controls)??null,workspaceScopeDisabled:rr,workspaceError:$e,onWorkspaceScopeChange:Ze,settingsSnapshot:xe,onOpenModelSettings:Vt})}),N!=="chat"&&s.jsx("div",{className:"absolute inset-0 flex flex-col",children:s.jsx(iD,{theme:c,initialSection:A,initialSettings:xe,showSidebar:N==="settings",onToggleTheme:d,onBackToChat:It,onModelNameChange:t,onSettingsChange:Ee,skills:je,onWorkspaceSettingsChange:cn,onSectionChange:Gt,onLogout:n,onRestart:ft,onNativeEngineRestart:r,isRestarting:Q,hostChromeInset:ue})})]})]}),s.jsx(FM,{open:!!P,title:(P==null?void 0:P.label)??"",automations:P==null?void 0:P.automations,onCancel:()=>D(null),onConfirm:Lt}),s.jsx(Gg,{open:!!G,title:(G==null?void 0:G.label)??"",onCancel:()=>Y(null),onConfirm:un}),s.jsx(Gg,{open:!!oe,title:(oe==null?void 0:oe.label)??"",dialogTitle:a("chat.renameProjectTitle"),description:a("chat.renameProjectDescription"),placeholder:a("chat.renameProjectPlaceholder"),onCancel:()=>de(null),onConfirm:Gr}),le?s.jsx("div",{role:"status",className:"fixed left-1/2 top-[calc(0.75rem+env(safe-area-inset-top))] z-50 max-w-[calc(100vw-1rem)] -translate-x-1/2 rounded-full border border-border/70 bg-popover px-4 py-2 text-sm font-medium text-popover-foreground shadow-lg",children:le}):null]})})}typeof globalThis.crypto<"u"&&!("randomUUID"in globalThis.crypto)&&Object.defineProperty(globalThis.crypto,"randomUUID",{value:()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)}),configurable:!0});const uS=document.getElementById("root");if(!uS)throw new Error("root element missing");Yd.createRoot(uS).render(s.jsx(g6,{}));export{TC as A,Et as C,ew as E,Xf as F,F4 as a,S6 as b,j as c,z4 as d,Uc as f,C6 as i};