@xopcai/xopc 0.0.16 → 0.0.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/dist/extensions/feishu/src/transport/client/client.js +1 -1
  2. package/dist/extensions/feishu/src/transport/client/client.js.map +1 -1
  3. package/dist/extensions/feishu/src/transport/webhook/monitor.js +1 -1
  4. package/dist/extensions/feishu/src/transport/webhook/monitor.js.map +1 -1
  5. package/dist/extensions/telegram/xopc.extension.json +1 -1
  6. package/dist/gateway/static/root/assets/{agents-Dy5cGVVQ.js → agents-D1c5jt8x.js} +2 -2
  7. package/dist/gateway/static/root/assets/{agents-Dy5cGVVQ.js.map → agents-D1c5jt8x.js.map} +1 -1
  8. package/dist/gateway/static/root/assets/{apps-page-BOpDR0Lz.js → apps-page-bi53w_qy.js} +2 -2
  9. package/dist/gateway/static/root/assets/{apps-page-BOpDR0Lz.js.map → apps-page-bi53w_qy.js.map} +1 -1
  10. package/dist/gateway/static/root/assets/{channels-settings-CrCesccB.js → channels-settings-CPWWa4rf.js} +2 -2
  11. package/dist/gateway/static/root/assets/{channels-settings-CrCesccB.js.map → channels-settings-CPWWa4rf.js.map} +1 -1
  12. package/dist/gateway/static/root/assets/{cron-page-B_XY0gPt.js → cron-page-CFuU6V8l.js} +2 -2
  13. package/dist/gateway/static/root/assets/{cron-page-B_XY0gPt.js.map → cron-page-CFuU6V8l.js.map} +1 -1
  14. package/dist/gateway/static/root/assets/{cron-utils-BYdnLwhl.js → cron-utils-D7qRCgCo.js} +2 -2
  15. package/dist/gateway/static/root/assets/{cron-utils-BYdnLwhl.js.map → cron-utils-D7qRCgCo.js.map} +1 -1
  16. package/dist/gateway/static/root/assets/{dist-DvaA5uNp.js → dist-CS--Aojm.js} +2 -2
  17. package/dist/gateway/static/root/assets/{dist-DvaA5uNp.js.map → dist-CS--Aojm.js.map} +1 -1
  18. package/dist/gateway/static/root/assets/{extension-debug-page-CPSk7gFW.js → extension-debug-page-DkaqKijm.js} +2 -2
  19. package/dist/gateway/static/root/assets/{extension-debug-page-CPSk7gFW.js.map → extension-debug-page-DkaqKijm.js.map} +1 -1
  20. package/dist/gateway/static/root/assets/{extension-page-COdbk9I6.js → extension-page-5WNq5ZxE.js} +2 -2
  21. package/dist/gateway/static/root/assets/{extension-page-COdbk9I6.js.map → extension-page-5WNq5ZxE.js.map} +1 -1
  22. package/dist/gateway/static/root/assets/{extension-settings-page-BlEz2Ily.js → extension-settings-page-BM4emw9B.js} +2 -2
  23. package/dist/gateway/static/root/assets/{extension-settings-page-BlEz2Ily.js.map → extension-settings-page-BM4emw9B.js.map} +1 -1
  24. package/dist/gateway/static/root/assets/{index-tm9ZY35l.js → index-DJnBAhem.js} +4 -4
  25. package/dist/gateway/static/root/assets/{index-tm9ZY35l.js.map → index-DJnBAhem.js.map} +1 -1
  26. package/dist/gateway/static/root/assets/{logs-page-LSa0jmLO.js → logs-page-Du6UoHCK.js} +2 -2
  27. package/dist/gateway/static/root/assets/{logs-page-LSa0jmLO.js.map → logs-page-Du6UoHCK.js.map} +1 -1
  28. package/dist/gateway/static/root/assets/{sessions-page-cn2fi_V3.js → sessions-page-CzTpNrb3.js} +2 -2
  29. package/dist/gateway/static/root/assets/{sessions-page-cn2fi_V3.js.map → sessions-page-CzTpNrb3.js.map} +1 -1
  30. package/dist/gateway/static/root/assets/{settings-page-CyHd5szQ.js → settings-page-jqrVlTkQ.js} +2 -2
  31. package/dist/gateway/static/root/assets/{settings-page-CyHd5szQ.js.map → settings-page-jqrVlTkQ.js.map} +1 -1
  32. package/dist/gateway/static/root/assets/{skills-page-irjxwW9u.js → skills-page-Dg_Uk_jM.js} +2 -2
  33. package/dist/gateway/static/root/assets/{skills-page-irjxwW9u.js.map → skills-page-Dg_Uk_jM.js.map} +1 -1
  34. package/dist/gateway/static/root/index.html +1 -1
  35. package/dist/package.js +1 -1
  36. package/package.json +2 -1
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/settings-page-CyHd5szQ.js","assets/rolldown-runtime-DWdDZTNf.js","assets/cron-utils-BYdnLwhl.js","assets/vendor-swr-Dp4nzp5h.js","assets/vendor-react-DbimaAId.js","assets/agents-Dy5cGVVQ.js","assets/sessions-page-cn2fi_V3.js","assets/logs-page-LSa0jmLO.js","assets/cron-page-B_XY0gPt.js","assets/dist-DvaA5uNp.js","assets/skills-page-irjxwW9u.js","assets/vendor-codemirror-CXAvob9m.js","assets/attachment-preview-renderer-CebH7fCz.js","assets/excel-worksheet-utils-Dk66snKA.js","assets/attachment-process-heavy-Dbf1--O6.js","assets/channels-settings-CrCesccB.js","assets/apps-page-BOpDR0Lz.js","assets/extension-page-COdbk9I6.js","assets/extension-settings-page-BlEz2Ily.js","assets/extension-debug-page-CPSk7gFW.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/settings-page-jqrVlTkQ.js","assets/rolldown-runtime-DWdDZTNf.js","assets/cron-utils-D7qRCgCo.js","assets/vendor-swr-Dp4nzp5h.js","assets/vendor-react-DbimaAId.js","assets/agents-D1c5jt8x.js","assets/sessions-page-CzTpNrb3.js","assets/logs-page-Du6UoHCK.js","assets/cron-page-CFuU6V8l.js","assets/dist-CS--Aojm.js","assets/skills-page-Dg_Uk_jM.js","assets/vendor-codemirror-CXAvob9m.js","assets/attachment-preview-renderer-CebH7fCz.js","assets/excel-worksheet-utils-Dk66snKA.js","assets/attachment-process-heavy-Dbf1--O6.js","assets/channels-settings-CPWWa4rf.js","assets/apps-page-bi53w_qy.js","assets/extension-page-5WNq5ZxE.js","assets/extension-settings-page-BM4emw9B.js","assets/extension-debug-page-DkaqKijm.js"])))=>i.map(i=>d[i]);
2
2
  import{i as e,n as t,t as n}from"./rolldown-runtime-DWdDZTNf.js";import{i as r,n as i,r as a,t as o}from"./vendor-react-DbimaAId.js";import{a as s,n as c,o as l,r as u,t as d}from"./vendor-swr-Dp4nzp5h.js";import{Cn as f,Sn as p,_n as m,bn as h,cn as g,gn as _,hn as v,in as y,mn as b,on as x,pn as S,sn as C,un as w,vn as T,xn as E,yn as D}from"./vendor-codemirror-CXAvob9m.js";import{a as O,c as k,d as A,i as j,l as M,n as N,o as P,r as F,s as I,t as L,u as R}from"./attachment-utils-core-Dt6UxMPV.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var z=e(r()),B=i(),V=e=>typeof e==`string`,H=()=>{let e,t,n=new Promise((n,r)=>{e=n,t=r});return n.resolve=e,n.reject=t,n},ee=e=>e==null?``:String(e),te=(e,t,n)=>{e.forEach(e=>{t[e]&&(n[e]=t[e])})},U=/###/g,ne=e=>e&&e.includes(`###`)?e.replace(U,`.`):e,re=e=>!e||V(e),W=(e,t,n)=>{let r=V(t)?t.split(`.`):t,i=0;for(;i<r.length-1;){if(re(e))return{};let t=ne(r[i]);!e[t]&&n&&(e[t]=new n),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++i}return re(e)?{}:{obj:e,k:ne(r[i])}},ie=(e,t,n)=>{let{obj:r,k:i}=W(e,t,Object);if(r!==void 0||t.length===1){r[i]=n;return}let a=t[t.length-1],o=t.slice(0,t.length-1),s=W(e,o,Object);for(;s.obj===void 0&&o.length;)a=`${o[o.length-1]}.${a}`,o=o.slice(0,o.length-1),s=W(e,o,Object),s?.obj&&s.obj[`${s.k}.${a}`]!==void 0&&(s.obj=void 0);s.obj[`${s.k}.${a}`]=n},ae=(e,t,n,r)=>{let{obj:i,k:a}=W(e,t,Object);i[a]=i[a]||[],i[a].push(n)},oe=(e,t)=>{let{obj:n,k:r}=W(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},se=(e,t,n)=>{let r=oe(e,n);return r===void 0?oe(t,n):r},ce=(e,t,n)=>{for(let r in t)r!==`__proto__`&&r!==`constructor`&&(r in e?V(e[r])||e[r]instanceof String||V(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):ce(e[r],t[r],n):e[r]=t[r]);return e},le=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,`\\$&`),ue={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`,"/":`&#x2F;`},de=e=>V(e)?e.replace(/[&<>"'\/]/g,e=>ue[e]):e,fe=class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){let t=this.regExpMap.get(e);if(t!==void 0)return t;let n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}},pe=[` `,`,`,`?`,`!`,`;`],me=new fe(20),he=(e,t,n)=>{t||=``,n||=``;let r=pe.filter(e=>!t.includes(e)&&!n.includes(e));if(r.length===0)return!0;let i=me.getRegExp(`(${r.map(e=>e===`?`?`\\?`:e).join(`|`)})`),a=!i.test(e);if(!a){let t=e.indexOf(n);t>0&&!i.test(e.substring(0,t))&&(a=!0)}return a},G=(e,t,n=`.`)=>{if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;let r=t.split(n),i=e;for(let e=0;e<r.length;){if(!i||typeof i!=`object`)return;let t,a=``;for(let o=e;o<r.length;++o)if(o!==e&&(a+=n),a+=r[o],t=i[a],t!==void 0){if([`string`,`number`,`boolean`].includes(typeof t)&&o<r.length-1)continue;e+=o-e+1;break}i=t}return i},ge=e=>e?.replace(/_/g,`-`),_e={type:`logger`,log(e){this.output(`log`,e)},warn(e){this.output(`warn`,e)},error(e){this.output(`error`,e)},output(e,t){console?.[e]?.apply?.(console,t)}},ve=new class e{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||`i18next:`,this.logger=e||_e,this.options=t,this.debug=t.debug}log(...e){return this.forward(e,`log`,``,!0)}warn(...e){return this.forward(e,`warn`,``,!0)}error(...e){return this.forward(e,`error`,``)}deprecate(...e){return this.forward(e,`warn`,`WARNING DEPRECATED: `,!0)}forward(e,t,n,r){return r&&!this.debug?null:(e=e.map(e=>V(e)?e.replace(/[\r\n\x00-\x1F\x7F]/g,` `):e),V(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(t){return new e(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t||=this.options,t.prefix=t.prefix||this.prefix,new e(this.logger,t)}},ye=class{constructor(){this.observers={}}on(e,t){return e.split(` `).forEach(e=>{this.observers[e]||(this.observers[e]=new Map);let n=this.observers[e].get(t)||0;this.observers[e].set(t,n+1)}),this}off(e,t){if(this.observers[e]){if(!t){delete this.observers[e];return}this.observers[e].delete(t)}}once(e,t){let n=(...r)=>{t(...r),this.off(e,n)};return this.on(e,n),this}emit(e,...t){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([e,n])=>{for(let r=0;r<n;r++)e(...t)}),this.observers[`*`]&&Array.from(this.observers[`*`].entries()).forEach(([n,r])=>{for(let i=0;i<r;i++)n(e,...t)})}},be=class extends ye{constructor(e,t={ns:[`translation`],defaultNS:`translation`}){super(),this.data=e||{},this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator=`.`),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.includes(e)||this.options.ns.push(e)}removeNamespaces(e){let t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,n,r={}){let i=r.keySeparator===void 0?this.options.keySeparator:r.keySeparator,a=r.ignoreJSONStructure===void 0?this.options.ignoreJSONStructure:r.ignoreJSONStructure,o;e.includes(`.`)?o=e.split(`.`):(o=[e,t],n&&(Array.isArray(n)?o.push(...n):V(n)&&i?o.push(...n.split(i)):o.push(n)));let s=oe(this.data,o);return!s&&!t&&!n&&e.includes(`.`)&&(e=o[0],t=o[1],n=o.slice(2).join(`.`)),s||!a||!V(n)?s:G(this.data?.[e]?.[t],n,i)}addResource(e,t,n,r,i={silent:!1}){let a=i.keySeparator===void 0?this.options.keySeparator:i.keySeparator,o=[e,t];n&&(o=o.concat(a?n.split(a):n)),e.includes(`.`)&&(o=e.split(`.`),r=t,t=o[1]),this.addNamespaces(t),ie(this.data,o,r),i.silent||this.emit(`added`,e,t,n,r)}addResources(e,t,n,r={silent:!1}){for(let r in n)(V(n[r])||Array.isArray(n[r]))&&this.addResource(e,t,r,n[r],{silent:!0});r.silent||this.emit(`added`,e,t,n)}addResourceBundle(e,t,n,r,i,a={silent:!1,skipCopy:!1}){let o=[e,t];e.includes(`.`)&&(o=e.split(`.`),r=n,n=t,t=o[1]),this.addNamespaces(t);let s=oe(this.data,o)||{};a.skipCopy||(n=JSON.parse(JSON.stringify(n))),r?ce(s,n,i):s={...s,...n},ie(this.data,o,s),a.silent||this.emit(`added`,e,t,n)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit(`removed`,e,t)}hasResourceBundle(e,t){return this.getResource(e,t)!==void 0}getResourceBundle(e,t){return t||=this.options.defaultNS,this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){let t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(e=>t[e]&&Object.keys(t[e]).length>0)}toJSON(){return this.data}},K={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,i){return e.forEach(e=>{t=this.processors[e]?.process(t,n,r,i)??t}),t}},xe=Symbol(`i18next/PATH_KEY`);function Se(){let e=[],t=Object.create(null),n;return t.get=(r,i)=>(n?.revoke?.(),i===xe?e:(e.push(i),n=Proxy.revocable(r,t),n.proxy)),Proxy.revocable(Object.create(null),t).proxy}function Ce(e,t){let{[xe]:n}=e(Se()),r=t?.keySeparator??`.`,i=t?.nsSeparator??`:`;if(n.length>1&&i){let e=t?.ns,a=Array.isArray(e)?e:null;if(a&&a.length>1&&a.slice(1).includes(n[0]))return`${n[0]}${i}${n.slice(1).join(r)}`}return n.join(r)}var we=e=>!V(e)&&typeof e!=`boolean`&&typeof e!=`number`,Te=class e extends ye{constructor(e,t={}){super(),te([`resourceStore`,`languageUtils`,`pluralResolver`,`interpolator`,`backendConnector`,`i18nFormat`,`utils`],e,this),this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator=`.`),this.logger=ve.create(`translator`),this.checkedLoadedFor={}}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){let n={...t};if(e==null)return!1;let r=this.resolve(e,n);if(r?.res===void 0)return!1;let i=we(r.res);return!(n.returnObjects===!1&&i)}extractFromKey(e,t){let n=t.nsSeparator===void 0?this.options.nsSeparator:t.nsSeparator;n===void 0&&(n=`:`);let r=t.keySeparator===void 0?this.options.keySeparator:t.keySeparator,i=t.ns||this.options.defaultNS||[],a=n&&e.includes(n),o=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!he(e,n,r);if(a&&!o){let t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:V(i)?[i]:i};let a=e.split(n);(n!==r||n===r&&this.options.ns.includes(a[0]))&&(i=a.shift()),e=a.join(r)}return{key:e,namespaces:V(i)?[i]:i}}translate(t,n,r){let i=typeof n==`object`?{...n}:n;if(typeof i!=`object`&&this.options.overloadTranslationOptionHandler&&(i=this.options.overloadTranslationOptionHandler(arguments)),typeof i==`object`&&(i={...i}),i||={},t==null)return``;typeof t==`function`&&(t=Ce(t,{...this.options,...i})),Array.isArray(t)||(t=[String(t)]),t=t.map(e=>typeof e==`function`?Ce(e,{...this.options,...i}):String(e));let a=i.returnDetails===void 0?this.options.returnDetails:i.returnDetails,o=i.keySeparator===void 0?this.options.keySeparator:i.keySeparator,{key:s,namespaces:c}=this.extractFromKey(t[t.length-1],i),l=c[c.length-1],u=i.nsSeparator===void 0?this.options.nsSeparator:i.nsSeparator;u===void 0&&(u=`:`);let d=i.lng||this.language,f=i.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(d?.toLowerCase()===`cimode`)return f?a?{res:`${l}${u}${s}`,usedKey:s,exactUsedKey:s,usedLng:d,usedNS:l,usedParams:this.getUsedParamsDetails(i)}:`${l}${u}${s}`:a?{res:s,usedKey:s,exactUsedKey:s,usedLng:d,usedNS:l,usedParams:this.getUsedParamsDetails(i)}:s;let p=this.resolve(t,i),m=p?.res,h=p?.usedKey||s,g=p?.exactUsedKey||s,_=[`[object Number]`,`[object Function]`,`[object RegExp]`],v=i.joinArrays===void 0?this.options.joinArrays:i.joinArrays,y=!this.i18nFormat||this.i18nFormat.handleAsObject,b=i.count!==void 0&&!V(i.count),x=e.hasDefaultValue(i),S=b?this.pluralResolver.getSuffix(d,i.count,i):``,C=i.ordinal&&b?this.pluralResolver.getSuffix(d,i.count,{ordinal:!1}):``,w=b&&!i.ordinal&&i.count===0,T=w&&i[`defaultValue${this.options.pluralSeparator}zero`]||i[`defaultValue${S}`]||i[`defaultValue${C}`]||i.defaultValue,E=m;y&&!m&&x&&(E=T);let D=we(E),O=Object.prototype.toString.apply(E);if(y&&E&&D&&!_.includes(O)&&!(V(v)&&Array.isArray(E))){if(!i.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn(`accessing an object - but returnObjects options is not enabled!`);let e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(h,E,{...i,ns:c}):`key '${s} (${this.language})' returned an object instead of string.`;return a?(p.res=e,p.usedParams=this.getUsedParamsDetails(i),p):e}if(o){let e=Array.isArray(E),t=e?[]:{},n=e?g:h;for(let e in E)if(Object.prototype.hasOwnProperty.call(E,e)){let r=`${n}${o}${e}`;x&&!m?t[e]=this.translate(r,{...i,defaultValue:we(T)?T[e]:void 0,joinArrays:!1,ns:c}):t[e]=this.translate(r,{...i,joinArrays:!1,ns:c}),t[e]===r&&(t[e]=E[e])}m=t}}else if(y&&V(v)&&Array.isArray(m))m=m.join(v),m&&=this.extendTranslation(m,t,i,r);else{let e=!1,n=!1;!this.isValidLookup(m)&&x&&(e=!0,m=T),this.isValidLookup(m)||(n=!0,m=s);let a=(i.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&n?void 0:m,c=x&&T!==m&&this.options.updateMissing;if(n||e||c){if(this.logger.log(c?`updateKey`:`missingKey`,d,l,b&&!c?`${s}${this.pluralResolver.getSuffix(d,i.count,i)}`:s,c?T:m),o){let e=this.resolve(s,{...i,keySeparator:!1});e&&e.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 e=[],t=this.languageUtils.getFallbackCodes(this.options.fallbackLng,i.lng||this.language);if(this.options.saveMissingTo===`fallback`&&t&&t[0])for(let n=0;n<t.length;n++)e.push(t[n]);else this.options.saveMissingTo===`all`?e=this.languageUtils.toResolveHierarchy(i.lng||this.language):e.push(i.lng||this.language);let n=(e,t,n)=>{let r=x&&n!==m?n:a;this.options.missingKeyHandler?this.options.missingKeyHandler(e,l,t,r,c,i):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(e,l,t,r,c,i),this.emit(`missingKey`,e,l,t,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&b?e.forEach(e=>{let t=this.pluralResolver.getSuffixes(e,i);w&&i[`defaultValue${this.options.pluralSeparator}zero`]&&!t.includes(`${this.options.pluralSeparator}zero`)&&t.push(`${this.options.pluralSeparator}zero`),t.forEach(t=>{n([e],s+t,i[`defaultValue${t}`]||T)})}):n(e,s,T))}m=this.extendTranslation(m,t,i,p,r),n&&m===s&&this.options.appendNamespaceToMissingKey&&(m=`${l}${u}${s}`),(n||e)&&this.options.parseMissingKeyHandler&&(m=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}${u}${s}`:s,e?m:void 0,i))}return a?(p.res=m,p.usedParams=this.getUsedParamsDetails(i),p):m}extendTranslation(e,t,n,r,i){if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});let a=V(e)&&(n?.interpolation?.skipOnVariables===void 0?this.options.interpolation.skipOnVariables:n.interpolation.skipOnVariables),o;if(a){let t=e.match(this.interpolator.nestingRegexp);o=t&&t.length}let s=n.replace&&!V(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),e=this.interpolator.interpolate(e,s,n.lng||this.language||r.usedLng,n),a){let t=e.match(this.interpolator.nestingRegexp),r=t&&t.length;o<r&&(n.nest=!1)}!n.lng&&r&&r.res&&(n.lng=this.language||r.usedLng),n.nest!==!1&&(e=this.interpolator.nest(e,(...e)=>i?.[0]===e[0]&&!n.context?(this.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${t[0]}`),null):this.translate(...e,t),n)),n.interpolation&&this.interpolator.reset()}let a=n.postProcess||this.options.postProcess,o=V(a)?[a]:a;return e!=null&&o?.length&&n.applyPostProcessor!==!1&&(e=K.handle(o,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...r,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e,t={}){let n,r,i,a,o;return V(e)&&(e=[e]),Array.isArray(e)&&(e=e.map(e=>typeof e==`function`?Ce(e,{...this.options,...t}):e)),e.forEach(e=>{if(this.isValidLookup(n))return;let s=this.extractFromKey(e,t),c=s.key;r=c;let l=s.namespaces;this.options.fallbackNS&&(l=l.concat(this.options.fallbackNS));let u=t.count!==void 0&&!V(t.count),d=u&&!t.ordinal&&t.count===0,f=t.context!==void 0&&(V(t.context)||typeof t.context==`number`)&&t.context!==``,p=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);l.forEach(e=>{this.isValidLookup(n)||(o=e,!this.checkedLoadedFor[`${p[0]}-${e}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(o)&&(this.checkedLoadedFor[`${p[0]}-${e}`]=!0,this.logger.warn(`key "${r}" for languages "${p.join(`, `)}" won't get resolved as namespace "${o}" 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!!!`)),p.forEach(r=>{if(this.isValidLookup(n))return;a=r;let o=[c];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(o,c,r,e,t);else{let e;u&&(e=this.pluralResolver.getSuffix(r,t.count,t));let n=`${this.options.pluralSeparator}zero`,i=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(u&&(t.ordinal&&e.startsWith(i)&&o.push(c+e.replace(i,this.options.pluralSeparator)),o.push(c+e),d&&o.push(c+n)),f){let r=`${c}${this.options.contextSeparator||`_`}${t.context}`;o.push(r),u&&(t.ordinal&&e.startsWith(i)&&o.push(r+e.replace(i,this.options.pluralSeparator)),o.push(r+e),d&&o.push(r+n))}}let s;for(;s=o.pop();)this.isValidLookup(n)||(i=s,n=this.getResource(r,e,s,t))}))})}),{res:n,usedKey:r,exactUsedKey:i,usedLng:a,usedNS:o}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e===``)}getResource(e,t,n,r={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}getUsedParamsDetails(e={}){let t=[`defaultValue`,`ordinal`,`context`,`replace`,`lng`,`lngs`,`fallbackLng`,`ns`,`keySeparator`,`nsSeparator`,`returnObjects`,`returnDetails`,`joinArrays`,`postProcess`,`interpolation`],n=e.replace&&!V(e.replace),r=n?e.replace:e;if(n&&e.count!==void 0&&(r.count=e.count),this.options.interpolation.defaultVariables&&(r={...this.options.interpolation.defaultVariables,...r}),!n){r={...r};for(let e of t)delete r[e]}return r}static hasDefaultValue(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&t.startsWith(`defaultValue`)&&e[t]!==void 0)return!0;return!1}},Ee=class{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=ve.create(`languageUtils`)}getScriptPartFromCode(e){if(e=ge(e),!e||!e.includes(`-`))return null;let t=e.split(`-`);return t.length===2||(t.pop(),t[t.length-1].toLowerCase()===`x`)?null:this.formatLanguageCode(t.join(`-`))}getLanguagePartFromCode(e){if(e=ge(e),!e||!e.includes(`-`))return e;let t=e.split(`-`);return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(V(e)&&e.includes(`-`)){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch{}return t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load===`languageOnly`||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.includes(e)}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(e=>{if(t)return;let n=this.formatLanguageCode(e);(!this.options.supportedLngs||this.isSupportedCode(n))&&(t=n)}),!t&&this.options.supportedLngs&&e.forEach(e=>{if(t)return;let n=this.getScriptPartFromCode(e);if(this.isSupportedCode(n))return t=n;let r=this.getLanguagePartFromCode(e);if(this.isSupportedCode(r))return t=r;t=this.options.supportedLngs.find(e=>e===r?!0:!e.includes(`-`)&&!r.includes(`-`)?!1:!!(e.includes(`-`)&&!r.includes(`-`)&&e.slice(0,e.indexOf(`-`))===r||e.startsWith(r)&&r.length>1))}),t||=this.getFallbackCodes(this.options.fallbackLng)[0],t}getFallbackCodes(e,t){if(!e)return[];if(typeof e==`function`&&(e=e(t)),V(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let n=e[t];return n||=e[this.getScriptPartFromCode(t)],n||=e[this.formatLanguageCode(t)],n||=e[this.getLanguagePartFromCode(t)],n||=e.default,n||[]}toResolveHierarchy(e,t){let n=this.getFallbackCodes((t===!1?[]:t)||this.options.fallbackLng||[],e),r=[],i=e=>{e&&(this.isSupportedCode(e)?r.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return V(e)&&(e.includes(`-`)||e.includes(`_`))?(this.options.load!==`languageOnly`&&i(this.formatLanguageCode(e)),this.options.load!==`languageOnly`&&this.options.load!==`currentOnly`&&i(this.getScriptPartFromCode(e)),this.options.load!==`currentOnly`&&i(this.getLanguagePartFromCode(e))):V(e)&&i(this.formatLanguageCode(e)),n.forEach(e=>{r.includes(e)||i(this.formatLanguageCode(e))}),r}},De={zero:0,one:1,two:2,few:3,many:4,other:5},Oe={select:e=>e===1?`one`:`other`,resolvedOptions:()=>({pluralCategories:[`one`,`other`]})},ke=class{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=ve.create(`pluralResolver`),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){let n=ge(e===`dev`?`en`:e),r=t.ordinal?`ordinal`:`cardinal`,i=JSON.stringify({cleanedCode:n,type:r});if(i in this.pluralRulesCache)return this.pluralRulesCache[i];let a;try{a=new Intl.PluralRules(n,{type:r})}catch{if(typeof Intl>`u`)return this.logger.error(`No Intl support, please use an Intl polyfill!`),Oe;if(!e.match(/-|_/))return Oe;let n=this.languageUtils.getLanguagePartFromCode(e);a=this.getRule(n,t)}return this.pluralRulesCache[i]=a,a}needsPlural(e,t={}){let n=this.getRule(e,t);return n||=this.getRule(`dev`,t),n?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,t,n={}){return this.getSuffixes(e,n).map(e=>`${t}${e}`)}getSuffixes(e,t={}){let n=this.getRule(e,t);return n||=this.getRule(`dev`,t),n?n.resolvedOptions().pluralCategories.sort((e,t)=>De[e]-De[t]).map(e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:``}${e}`):[]}getSuffix(e,t,n={}){let r=this.getRule(e,n);return r?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:``}${r.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix(`dev`,t,n))}},Ae=(e,t,n,r=`.`,i=!0)=>{let a=se(e,t,n);return!a&&i&&V(n)&&(a=G(e,n,r),a===void 0&&(a=G(t,n,r))),a},je=e=>e.replace(/\$/g,`$$$$`),Me=class{constructor(e={}){this.logger=ve.create(`interpolator`),this.options=e,this.format=e?.interpolation?.format||(e=>e),this.init(e)}init(e={}){e.interpolation||={escapeValue:!0};let{escape:t,escapeValue:n,useRawValueToEscape:r,prefix:i,prefixEscaped:a,suffix:o,suffixEscaped:s,formatSeparator:c,unescapeSuffix:l,unescapePrefix:u,nestingPrefix:d,nestingPrefixEscaped:f,nestingSuffix:p,nestingSuffixEscaped:m,nestingOptionsSeparator:h,maxReplaces:g,alwaysFormat:_}=e.interpolation;this.escape=t===void 0?de:t,this.escapeValue=n===void 0?!0:n,this.useRawValueToEscape=r===void 0?!1:r,this.prefix=i?le(i):a||`{{`,this.suffix=o?le(o):s||`}}`,this.formatSeparator=c||`,`,this.unescapePrefix=l?``:u?le(u):`-`,this.unescapeSuffix=this.unescapePrefix?``:l?le(l):``,this.nestingPrefix=d?le(d):f||le(`$t(`),this.nestingSuffix=p?le(p):m||le(`)`),this.nestingOptionsSeparator=h||`,`,this.maxReplaces=g||1e3,this.alwaysFormat=_===void 0?!1:_,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){let e=(e,t)=>e?.source===t?(e.lastIndex=0,e):new RegExp(t,`g`);this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,t,n,r){let i,a,o,s=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},c=e=>{if(!e.includes(this.formatSeparator)){let i=Ae(t,s,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(i,void 0,n,{...r,...t,interpolationkey:e}):i}let i=e.split(this.formatSeparator),a=i.shift().trim(),o=i.join(this.formatSeparator).trim();return this.format(Ae(t,s,a,this.options.keySeparator,this.options.ignoreJSONStructure),o,n,{...r,...t,interpolationkey:a})};this.resetRegExp(),!this.escapeValue&&typeof e==`string`&&/\$t\([^)]*\{[^}]*\{\{/.test(e)&&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.`);let l=r?.missingInterpolationHandler||this.options.missingInterpolationHandler,u=r?.interpolation?.skipOnVariables===void 0?this.options.interpolation.skipOnVariables:r.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>je(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?je(this.escape(e)):je(e)}].forEach(t=>{for(o=0;i=t.regex.exec(e);){let n=i[1].trim();if(a=c(n),a===void 0)if(typeof l==`function`){let t=l(e,i,r);a=V(t)?t:``}else if(r&&Object.prototype.hasOwnProperty.call(r,n))a=``;else if(u){a=i[0];continue}else this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`),a=``;else !V(a)&&!this.useRawValueToEscape&&(a=ee(a));let s=t.safeValue(a);if(e=e.replace(i[0],s),u?(t.regex.lastIndex+=a.length,t.regex.lastIndex-=i[0].length):t.regex.lastIndex=0,o++,o>=this.maxReplaces)break}}),e}nest(e,t,n={}){let r,i,a,o=(e,t)=>{let n=this.nestingOptionsSeparator;if(!e.includes(n))return e;let r=e.split(RegExp(`${le(n)}[ ]*{`)),i=`{${r[1]}`;e=r[0],i=this.interpolate(i,a);let o=i.match(/'/g),s=i.match(/"/g);((o?.length??0)%2==0&&!s||(s?.length??0)%2!=0)&&(i=i.replace(/'/g,`"`));try{a=JSON.parse(i),t&&(a={...t,...a})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${n}${i}`}return a.defaultValue&&a.defaultValue.includes(this.prefix)&&delete a.defaultValue,e};for(;r=this.nestingRegexp.exec(e);){let s=[];a={...n},a=a.replace&&!V(a.replace)?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;let c=/{.*}/.test(r[1])?r[1].lastIndexOf(`}`)+1:r[1].indexOf(this.formatSeparator);if(c!==-1&&(s=r[1].slice(c).split(this.formatSeparator).map(e=>e.trim()).filter(Boolean),r[1]=r[1].slice(0,c)),i=t(o.call(this,r[1].trim(),a),a),i&&r[0]===e&&!V(i))return i;V(i)||(i=ee(i)),i||=(this.logger.warn(`missed to resolve ${r[1]} for nesting ${e}`),``),s.length&&(i=s.reduce((e,t)=>this.format(e,t,n.lng,{...n,interpolationkey:r[1].trim()}),i.trim())),e=e.replace(r[0],i),this.regexp.lastIndex=0}return e}},Ne=e=>{let t=e.toLowerCase().trim(),n={};if(e.includes(`(`)){let r=e.split(`(`);t=r[0].toLowerCase().trim();let i=r[1].slice(0,-1);t===`currency`&&!i.includes(`:`)?n.currency||=i.trim():t===`relativetime`&&!i.includes(`:`)?n.range||=i.trim():i.split(`;`).forEach(e=>{if(e){let[t,...r]=e.split(`:`),i=r.join(`:`).trim().replace(/^'+|'+$/g,``),a=t.trim();n[a]||(n[a]=i),i===`false`&&(n[a]=!1),i===`true`&&(n[a]=!0),isNaN(i)||(n[a]=parseInt(i,10))}})}return{formatName:t,formatOptions:n}},Pe=e=>{let t={};return(n,r,i)=>{let a=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(a={...a,[i.interpolationkey]:void 0});let o=r+JSON.stringify(a),s=t[o];return s||(s=e(ge(r),i),t[o]=s),s(n)}},Fe=e=>(t,n,r)=>e(ge(n),r)(t),Ie=class{constructor(e={}){this.logger=ve.create(`formatter`),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||`,`;let n=t.cacheInBuiltFormats?Pe:Fe;this.formats={number:n((e,t)=>{let n=new Intl.NumberFormat(e,{...t});return e=>n.format(e)}),currency:n((e,t)=>{let n=new Intl.NumberFormat(e,{...t,style:`currency`});return e=>n.format(e)}),datetime:n((e,t)=>{let n=new Intl.DateTimeFormat(e,{...t});return e=>n.format(e)}),relativetime:n((e,t)=>{let n=new Intl.RelativeTimeFormat(e,{...t});return e=>n.format(e,t.range||`day`)}),list:n((e,t)=>{let n=new Intl.ListFormat(e,{...t});return e=>n.format(e)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=Pe(t)}format(e,t,n,r={}){if(!t||e==null)return e;let i=t.split(this.formatSeparator);if(i.length>1&&i[0].indexOf(`(`)>1&&!i[0].includes(`)`)&&i.find(e=>e.includes(`)`))){let e=i.findIndex(e=>e.includes(`)`));i[0]=[i[0],...i.splice(1,e)].join(this.formatSeparator)}return i.reduce((e,t)=>{let{formatName:i,formatOptions:a}=Ne(t);if(this.formats[i]){let t=e;try{let o=r?.formatParams?.[r.interpolationkey]||{},s=o.locale||o.lng||r.locale||r.lng||n;t=this.formats[i](e,s,{...a,...r,...o})}catch(e){this.logger.warn(e)}return t}else this.logger.warn(`there was no format function for ${i}`);return e},e)}},Le=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)},Re=class extends ye{constructor(e,t,n,r={}){super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=r,this.logger=ve.create(`backendConnector`),this.waitingReads=[],this.maxParallelReads=r.maxParallelReads||10,this.readingCalls=0,this.maxRetries=r.maxRetries>=0?r.maxRetries:5,this.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(n,r.backend,r)}queueLoad(e,t,n,r){let i={},a={},o={},s={};return e.forEach(e=>{let r=!0;t.forEach(t=>{let o=`${e}|${t}`;!n.reload&&this.store.hasResourceBundle(e,t)?this.state[o]=2:this.state[o]<0||(this.state[o]===1?a[o]===void 0&&(a[o]=!0):(this.state[o]=1,r=!1,a[o]===void 0&&(a[o]=!0),i[o]===void 0&&(i[o]=!0),s[t]===void 0&&(s[t]=!0)))}),r||(o[e]=!0)}),(Object.keys(i).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(i),pending:Object.keys(a),toLoadLanguages:Object.keys(o),toLoadNamespaces:Object.keys(s)}}loaded(e,t,n){let r=e.split(`|`),i=r[0],a=r[1];t&&this.emit(`failedLoading`,i,a,t),!t&&n&&this.store.addResourceBundle(i,a,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&n&&(this.state[e]=0);let o={};this.queue.forEach(n=>{ae(n.loaded,[i],a),Le(n,e),t&&n.errors.push(t),n.pendingCount===0&&!n.done&&(Object.keys(n.loaded).forEach(e=>{o[e]||(o[e]={});let t=n.loaded[e];t.length&&t.forEach(t=>{o[e][t]===void 0&&(o[e][t]=!0)})}),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())}),this.emit(`loaded`,o),this.queue=this.queue.filter(e=>!e.done)}read(e,t,n,r=0,i=this.retryTimeout,a){if(!e.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:t,fcName:n,tried:r,wait:i,callback:a});return}this.readingCalls++;let o=(o,s)=>{if(this.readingCalls--,this.waitingReads.length>0){let e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}if(o&&s&&r<this.maxRetries){setTimeout(()=>{this.read(e,t,n,r+1,i*2,a)},i);return}a(o,s)},s=this.backend[n].bind(this.backend);if(s.length===2){try{let n=s(e,t);n&&typeof n.then==`function`?n.then(e=>o(null,e)).catch(o):o(null,n)}catch(e){o(e)}return}return s(e,t,o)}prepareLoading(e,t,n={},r){if(!this.backend)return this.logger.warn(`No backend was added via i18next.use. Will not load resources.`),r&&r();V(e)&&(e=this.languageUtils.toResolveHierarchy(e)),V(t)&&(t=[t]);let i=this.queueLoad(e,t,n,r);if(!i.toLoad.length)return i.pending.length||r(),null;i.toLoad.forEach(e=>{this.loadOne(e)})}load(e,t,n){this.prepareLoading(e,t,{},n)}reload(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}loadOne(e,t=``){let n=e.split(`|`),r=n[0],i=n[1];this.read(r,i,`read`,void 0,void 0,(n,a)=>{n&&this.logger.warn(`${t}loading namespace ${i} for language ${r} failed`,n),!n&&a&&this.logger.log(`${t}loaded namespace ${i} for language ${r}`,a),this.loaded(e,n,a)})}saveMissing(e,t,n,r,i,a={},o=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(t)){this.logger.warn(`did not save key "${n}" as the namespace "${t}" 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(!(n==null||n===``)){if(this.backend?.create){let s={...a,isUpdate:i},c=this.backend.create.bind(this.backend);if(c.length<6)try{let i;i=c.length===5?c(e,t,n,r,s):c(e,t,n,r),i&&typeof i.then==`function`?i.then(e=>o(null,e)).catch(o):o(null,i)}catch(e){o(e)}else c(e,t,n,r,o,s)}!e||!e[0]||this.store.addResource(e[0],t,n,r)}}},ze=()=>({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]),V(e[1])&&(t.defaultValue=e[1]),V(e[2])&&(t.tDescription=e[2]),typeof e[2]==`object`||typeof e[3]==`object`){let n=e[3]||e[2];Object.keys(n).forEach(e=>{t[e]=n[e]})}return t},interpolation:{escapeValue:!0,prefix:`{{`,suffix:`}}`,formatSeparator:`,`,unescapePrefix:`-`,nestingPrefix:`$t(`,nestingSuffix:`)`,nestingOptionsSeparator:`,`,maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),Be=e=>(V(e.ns)&&(e.ns=[e.ns]),V(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),V(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&!e.supportedLngs.includes(`cimode`)&&(e.supportedLngs=e.supportedLngs.concat([`cimode`])),e),Ve=()=>{},He=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(t=>{typeof e[t]==`function`&&(e[t]=e[t].bind(e))})},Ue=class e extends ye{constructor(e={},t){if(super(),this.options=Be(e),this.services={},this.logger=ve,this.modules={external:[]},He(this),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(e={},t){this.isInitializing=!0,typeof e==`function`&&(t=e,e={}),e.defaultNS==null&&e.ns&&(V(e.ns)?e.defaultNS=e.ns:e.ns.includes(`translation`)||(e.defaultNS=e.ns[0]));let n=ze();this.options={...n,...this.options,...Be(e)},this.options.interpolation={...n.interpolation,...this.options.interpolation},e.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=e.keySeparator),e.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=e.nsSeparator),typeof this.options.overloadTranslationOptionHandler!=`function`&&(this.options.overloadTranslationOptionHandler=n.overloadTranslationOptionHandler);let r=e=>e?typeof e==`function`?new e:e:null;if(!this.options.isClone){this.modules.logger?ve.init(r(this.modules.logger),this.options):ve.init(null,this.options);let e;e=this.modules.formatter?this.modules.formatter:Ie;let t=new Ee(this.options);this.store=new be(this.options.resources,this.options);let n=this.services;n.logger=ve,n.resourceStore=this.store,n.languageUtils=t,n.pluralResolver=new ke(t,{prepend:this.options.pluralSeparator}),e&&(n.formatter=r(e),n.formatter.init&&n.formatter.init(n,this.options),this.options.interpolation.format=n.formatter.format.bind(n.formatter)),n.interpolator=new Me(this.options),n.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},n.backendConnector=new Re(r(this.modules.backend),n.resourceStore,n,this.options),n.backendConnector.on(`*`,(e,...t)=>{this.emit(e,...t)}),this.modules.languageDetector&&(n.languageDetector=r(this.modules.languageDetector),n.languageDetector.init&&n.languageDetector.init(n,this.options.detection,this.options)),this.modules.i18nFormat&&(n.i18nFormat=r(this.modules.i18nFormat),n.i18nFormat.init&&n.i18nFormat.init(this)),this.translator=new Te(this.services,this.options),this.translator.on(`*`,(e,...t)=>{this.emit(e,...t)}),this.modules.external.forEach(e=>{e.init&&e.init(this)})}if(this.format=this.options.interpolation.format,t||=Ve,this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){let e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&e[0]!==`dev`&&(this.options.lng=e[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(e=>{this[e]=(...t)=>this.store[e](...t)}),[`addResource`,`addResources`,`addResourceBundle`,`removeResourceBundle`].forEach(e=>{this[e]=(...t)=>(this.store[e](...t),this)});let i=H(),a=()=>{let e=(e,n)=>{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),i.resolve(n),t(e,n)};if((this.languages||this.isLanguageChangingTo)&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initAsync?a():setTimeout(a,0),i}loadResources(e,t=Ve){let n=t,r=V(e)?e:this.language;if(typeof e==`function`&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if(r?.toLowerCase()===`cimode`&&(!this.options.preload||this.options.preload.length===0))return n();let e=[],t=t=>{t&&t!==`cimode`&&this.services.languageUtils.toResolveHierarchy(t).forEach(t=>{t!==`cimode`&&(e.includes(t)||e.push(t))})};r?t(r):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(e=>t(e)),this.options.preload?.forEach?.(e=>t(e)),this.services.backendConnector.load(e,this.options.ns,e=>{!e&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),n(e)})}else n(null)}reloadResources(e,t,n){let r=H();return typeof e==`function`&&(n=e,e=void 0),typeof t==`function`&&(n=t,t=void 0),e||=this.languages,t||=this.options.ns,n||=Ve,this.services.backendConnector.reload(e,t,e=>{r.resolve(),n(e)}),r}use(e){if(!e)throw Error(`You are passing an undefined module! Please check the object you are passing to i18next.use()`);if(!e.type)throw Error(`You are passing a wrong module! Please check the object you are passing to i18next.use()`);return e.type===`backend`&&(this.modules.backend=e),(e.type===`logger`||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type===`languageDetector`&&(this.modules.languageDetector=e),e.type===`i18nFormat`&&(this.modules.i18nFormat=e),e.type===`postProcessor`&&K.addPostProcessor(e),e.type===`formatter`&&(this.modules.formatter=e),e.type===`3rdParty`&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&![`cimode`,`dev`].includes(e)){for(let e=0;e<this.languages.length;e++){let t=this.languages[e];if(![`cimode`,`dev`].includes(t)&&this.store.hasLanguageSomeTranslations(t)){this.resolvedLanguage=t;break}}!this.resolvedLanguage&&!this.languages.includes(e)&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,t){this.isLanguageChangingTo=e;let n=H();this.emit(`languageChanging`,e);let r=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},i=(i,a)=>{a?this.isLanguageChangingTo===e&&(r(a),this.translator.changeLanguage(a),this.isLanguageChangingTo=void 0,this.emit(`languageChanged`,a),this.logger.log(`languageChanged`,a)):this.isLanguageChangingTo=void 0,n.resolve((...e)=>this.t(...e)),t&&t(i,(...e)=>this.t(...e))},a=t=>{!e&&!t&&this.services.languageDetector&&(t=[]);let n=V(t)?t:t&&t[0],a=this.store.hasLanguageSomeTranslations(n)?n:this.services.languageUtils.getBestMatchFromCodes(V(t)?[t]:t);a&&(this.language||r(a),this.translator.language||this.translator.changeLanguage(a),this.services.languageDetector?.cacheUserLanguage?.(a)),this.loadResources(a,e=>{i(e,a)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?a(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(e),n}getFixedT(e,t,n){let r=(e,t,...i)=>{let a;a=typeof t==`object`?{...t}:this.options.overloadTranslationOptionHandler([e,t].concat(i)),a.lng=a.lng||r.lng,a.lngs=a.lngs||r.lngs,a.ns=a.ns||r.ns,a.keyPrefix!==``&&(a.keyPrefix=a.keyPrefix||n||r.keyPrefix);let o={...this.options,...a};typeof a.keyPrefix==`function`&&(a.keyPrefix=Ce(a.keyPrefix,o));let s=this.options.keySeparator||`.`,c;return a.keyPrefix&&Array.isArray(e)?c=e.map(e=>(typeof e==`function`&&(e=Ce(e,o)),`${a.keyPrefix}${s}${e}`)):(typeof e==`function`&&(e=Ce(e,o)),c=a.keyPrefix?`${a.keyPrefix}${s}${e}`:e),this.t(c,a)};return V(e)?r.lng=e:r.lngs=e,r.ns=t,r.keyPrefix=n,r}t(...e){return this.translator?.translate(...e)}exists(...e){return this.translator?.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,t={}){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;let n=t.lng||this.resolvedLanguage||this.languages[0],r=this.options?this.options.fallbackLng:!1,i=this.languages[this.languages.length-1];if(n.toLowerCase()===`cimode`)return!0;let a=(e,t)=>{let n=this.services.backendConnector.state[`${e}|${t}`];return n===-1||n===0||n===2};if(t.precheck){let e=t.precheck(this,a);if(e!==void 0)return e}return!!(this.hasResourceBundle(n,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(n,e)&&(!r||a(i,e)))}loadNamespaces(e,t){let n=H();return this.options.ns?(V(e)&&(e=[e]),e.forEach(e=>{this.options.ns.includes(e)||this.options.ns.push(e)}),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){let n=H();V(e)&&(e=[e]);let r=this.options.preload||[],i=e.filter(e=>!r.includes(e)&&this.services.languageUtils.isSupportedCode(e));return i.length?(this.options.preload=r.concat(i),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}dir(e){if(e||=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language),!e)return`rtl`;try{let t=new Intl.Locale(e);if(t&&t.getTextInfo){let e=t.getTextInfo();if(e&&e.direction)return e.direction}}catch{}let t=`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`.split(`.`),n=this.services?.languageUtils||new Ee(ze());return e.toLowerCase().indexOf(`-latn`)>1?`ltr`:t.includes(n.getLanguagePartFromCode(e))||e.toLowerCase().indexOf(`-arab`)>1?`rtl`:`ltr`}static createInstance(t={},n){let r=new e(t,n);return r.createInstance=e.createInstance,r}cloneInstance(t={},n=Ve){let r=t.forkResourceStore;r&&delete t.forkResourceStore;let i={...this.options,...t,isClone:!0},a=new e(i);if((t.debug!==void 0||t.prefix!==void 0)&&(a.logger=a.logger.clone(t)),[`store`,`services`,`language`].forEach(e=>{a[e]=this[e]}),a.services={...this.services},a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},r&&(a.store=new be(Object.keys(this.store.data).reduce((e,t)=>(e[t]={...this.store.data[t]},e[t]=Object.keys(e[t]).reduce((n,r)=>(n[r]={...e[t][r]},n),e[t]),e),{}),i),a.services.resourceStore=a.store),t.interpolation){let e={...ze().interpolation,...this.options.interpolation,...t.interpolation},n={...i,interpolation:e};a.services.interpolator=new Me(n)}return a.translator=new Te(a.services,i),a.translator.on(`*`,(e,...t)=>{a.emit(e,...t)}),a.init(i,n),a.translator.options=i,a.translator.backendConnector.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}.createInstance();Ue.createInstance,Ue.dir,Ue.init,Ue.loadResources,Ue.reloadResources,Ue.use,Ue.changeLanguage,Ue.getFixedT,Ue.t,Ue.exists,Ue.setDefaultNamespace,Ue.hasLoadedNamespace,Ue.loadNamespaces,Ue.loadLanguages;var We=(e,t,n,r)=>{let i=[n,{code:t,...r||{}}];if(e?.services?.logger?.forward)return e.services.logger.forward(i,`warn`,`react-i18next::`,!0);Ze(i[0])&&(i[0]=`react-i18next:: ${i[0]}`),e?.services?.logger?.warn?e.services.logger.warn(...i):console?.warn&&console.warn(...i)},Ge={},Ke=(e,t,n,r)=>{Ze(n)&&Ge[n]||(Ze(n)&&(Ge[n]=new Date),We(e,t,n,r))},qe=(e,t)=>()=>{if(e.isInitialized)t();else{let n=()=>{setTimeout(()=>{e.off(`initialized`,n)},0),t()};e.on(`initialized`,n)}},Je=(e,t,n)=>{e.loadNamespaces(t,qe(e,n))},Ye=(e,t,n,r)=>{if(Ze(n)&&(n=[n]),e.options.preload&&e.options.preload.indexOf(t)>-1)return Je(e,n,r);n.forEach(t=>{e.options.ns.indexOf(t)<0&&e.options.ns.push(t)}),e.loadLanguages(t,qe(e,r))},Xe=(e,t,n={})=>!t.languages||!t.languages.length?(Ke(t,`NO_LANGUAGES`,`i18n.languages were undefined or empty`,{languages:t.languages}),!0):t.hasLoadedNamespace(e,{lng:n.lng,precheck:(t,r)=>{if(n.bindI18n&&n.bindI18n.indexOf(`languageChanging`)>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!r(t.isLanguageChangingTo,e))return!1}}),Ze=e=>typeof e==`string`,Qe=e=>typeof e==`object`&&!!e,$e=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,et={"&amp;":`&`,"&#38;":`&`,"&lt;":`<`,"&#60;":`<`,"&gt;":`>`,"&#62;":`>`,"&apos;":`'`,"&#39;":`'`,"&quot;":`"`,"&#34;":`"`,"&nbsp;":` `,"&#160;":` `,"&copy;":`©`,"&#169;":`©`,"&reg;":`®`,"&#174;":`®`,"&hellip;":`…`,"&#8230;":`…`,"&#x2F;":`/`,"&#47;":`/`},tt=e=>et[e],nt={bindI18n:`languageChanged`,bindI18nStore:``,transEmptyNodeValue:``,transSupportBasicHtmlNodes:!0,transWrapTextNodes:``,transKeepBasicHtmlNodesFor:[`br`,`strong`,`i`,`p`],useSuspense:!0,unescape:e=>e.replace($e,tt),transDefaultProps:void 0},rt=(e={})=>{nt={...nt,...e}},it=()=>nt,at,ot=e=>{at=e},st=()=>at,ct={type:`3rdParty`,init(e){rt(e.options.react),ot(e)}},lt=(0,z.createContext)(),ut=class{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(e=>{this.usedNamespaces[e]||(this.usedNamespaces[e]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}},dt=l(),ft={t:(e,t)=>{if(Ze(t))return t;if(Qe(t)&&Ze(t.defaultValue))return t.defaultValue;if(typeof e==`function`)return``;if(Array.isArray(e)){let t=e[e.length-1];return typeof t==`function`?``:t}return e},ready:!1},pt=()=>()=>{},mt=(e,t={})=>{let{i18n:n}=t,{i18n:r,defaultNS:i}=(0,z.useContext)(lt)||{},a=n||r||st();a&&!a.reportNamespaces&&(a.reportNamespaces=new ut),a||Ke(a,`NO_I18NEXT_INSTANCE`,`useTranslation: You will need to pass in an i18next instance by using initReactI18next`);let o=(0,z.useMemo)(()=>({...it(),...a?.options?.react,...t}),[a,t]),{useSuspense:s,keyPrefix:c}=o,l=e||i||a?.options?.defaultNS,u=Ze(l)?[l]:l||[`translation`],d=(0,z.useMemo)(()=>u,u);a?.reportNamespaces?.addUsedNamespaces?.(d);let f=(0,z.useRef)(0),p=(0,z.useCallback)(e=>{if(!a)return pt;let{bindI18n:t,bindI18nStore:n}=o,r=()=>{f.current+=1,e()};return t&&a.on(t,r),n&&a.store.on(n,r),()=>{t&&t.split(` `).forEach(e=>a.off(e,r)),n&&n.split(` `).forEach(e=>a.store.off(e,r))}},[a,o]),m=(0,z.useRef)(),h=(0,z.useCallback)(()=>{if(!a)return ft;let e=!!(a.isInitialized||a.initializedStoreOnce)&&d.every(e=>Xe(e,a,o)),n=t.lng||a.language,r=f.current,i=m.current;if(i&&i.ready===e&&i.lng===n&&i.keyPrefix===c&&i.revision===r)return i;let s={t:a.getFixedT(n,o.nsMode===`fallback`?d:d[0],c),ready:e,lng:n,keyPrefix:c,revision:r};return m.current=s,s},[a,d,c,o,t.lng]),[g,_]=(0,z.useState)(0),{t:v,ready:y}=(0,dt.useSyncExternalStore)(p,h,h);(0,z.useEffect)(()=>{if(a&&!y&&!s){let e=()=>_(e=>e+1);t.lng?Ye(a,t.lng,d,e):Je(a,d,e)}},[a,t.lng,d,y,s,g]);let b=a||{},x=(0,z.useRef)(null),S=(0,z.useRef)(),C=e=>{let t=Object.getOwnPropertyDescriptors(e);t.__original&&delete t.__original;let n=Object.create(Object.getPrototypeOf(e),t);if(!Object.prototype.hasOwnProperty.call(n,`__original`))try{Object.defineProperty(n,`__original`,{value:e,writable:!1,enumerable:!1,configurable:!1})}catch{}return n},w=(0,z.useMemo)(()=>{let e=b,t=e?.language,n=e;e&&(x.current&&x.current.__original===e&&S.current===t?n=x.current:(n=C(e),x.current=n,S.current=t));let r=!y&&!s?(...e)=>(Ke(a,`USE_T_BEFORE_READY`,`useTranslation: t was called before ready. When using useSuspense: false, make sure to check the ready flag before using t.`),v(...e)):v,i=[r,n,y];return i.t=r,i.i18n=n,i.ready=y,i},[v,b,y,b.resolvedLanguage,b.language,b.languages]);if(a&&s&&!y)throw new Promise(e=>{let n=()=>e();t.lng?Ye(a,t.lng,d,n):Je(a,d,n)});return w};function ht({i18n:e,defaultNS:t,children:n}){let r=(0,z.useMemo)(()=>({i18n:e,defaultNS:t}),[e,t]);return(0,z.createElement)(lt.Provider,{value:r},n)}function gt(e){let t=(e??``).trim().toLowerCase().replace(/_/g,`-`);return!t||t===`en`||t.startsWith(`en-`)?`en`:`zh`}function _t(){if(typeof navigator>`u`)return`en`;let e=(navigator.language||navigator.languages?.[0]||``).trim();return e?gt(e):`en`}function vt(e){return e===`zh`?`zh-CN`:`en`}var yt=`xopc.token`,bt=`xopc.language`;function xt(){try{return localStorage.getItem(yt)||``}catch{return``}}function St(e){try{localStorage.setItem(yt,e)}catch(e){console.error(`Failed to save token:`,e)}}function Ct(){try{localStorage.removeItem(yt)}catch(e){console.error(`Failed to clear token:`,e)}}function wt(){try{let e=localStorage.getItem(bt);return e===`en`||e===`zh`?e:_t()}catch{return _t()}}function Tt(e){try{localStorage.setItem(bt,e)}catch(e){console.error(`Failed to save language:`,e)}}var Et={appBrand:`XOPC`,sidebarCollapse:`Collapse sidebar`,sidebarExpand:`Expand sidebar`,closeMenu:`Close menu`,openMenu:`Open menu`,appBarPreferences:`Language and theme`,nav:{chat:`Chat`,management:`Management`,settings:`Settings`,sessions:`Sessions`,cron:`Scheduled Tasks`,skills:`Skills`,channels:`Channels`,agents:`Agents`,apps:`Apps`,logs:`Logs`,settingsAppearance:`Preferences`,settingsProviders:`Providers`,settingsModels:`Models`,settingsChannels:`Channels`,settingsVoice:`Voice`,settingsGateway:`Gateway`,settingsHeartbeat:`Heartbeat`,settingsSearch:`Web search`,settingsAgentDefaults:`Agent defaults`,settingsAgents:`Agents`,settingsSystem:`System`},appsPage:{title:`Apps`,subtitle:`Discovered extensions in one place — open a card for details and built-in enable/disable.`,empty:`No extensions discovered.`,tabAll:`All`,tabWithUi:`With UI`,tabBackend:`Backend only`,searchPlaceholder:`Search apps`,noSearchResults:`No apps match your filters.`,statusEnabled:`Enabled`,cardNoDescription:`No description in manifest.`,badgeKindUi:`UI`,badgeKindBackend:`Backend`,badgeBundled:`Built-in`,detailTitle:`App details`,detailBack:`Back`,detailClose:`Close`,detailProviderPrefix:`Source:`,providerBundled:`Built-in (shipped with xopc)`,providerGlobal:`Global install (~/.xopc/extensions)`,providerWorkspace:`Workspace (.extensions)`,providerOther:`Other`,detailSectionFeatures:`Capabilities`,detailNoDescription:`No description was provided for this extension.`,actionEnable:`Enable`,actionDisable:`Disable`,restartNote:`Built-in on/off updates your config. Restart the gateway process so extension code fully loads or unloads.`,cliManageHint:`This copy is not bundled with xopc — install, remove, and upgrades are done via the CLI or filesystem.`,backendOnlyHint:`This extension has no Gateway UI; tools and hooks still run when enabled.`,badgePages:`{{count}} page(s)`,badgeSettings:`{{count}} settings`,badgeWidgets:`{{count}} widget(s)`,badgeSidebar:`{{count}} sidebar`,open:`Open`,openSettings:`Settings`,runStateLive:`Running`,runStatePendingOn:`Enabled in config`,runStatePendingOff:`Disabled in config`,runStateOff:`Off`,toggleSaving:`Saving…`,toggleError:`Could not update this extension.`},extensionUi:{permissionTitle:`Allow “{{name}}”?`,permissionSubtitle:`This extension may use the following capabilities while its UI is open.`,permissionsNone:`No additional permissions are declared in the manifest.`,allow:`Allow`,deny:`Not now`,deniedHint:`The extension UI stays hidden until you approve it for this browser.`,reviewPermissions:`Review permissions`,loadFailed:`The extension panel failed to load.`,loadFailedConnectionHint:`If the frame shows “connection refused”, start the xopc gateway (and if you use Vite for web/, match the proxy target in web/vite.config.ts).`,retryLoad:`Reload panel`},extensionDebug:{nav:`Extension debug`,title:`Extension debug`,subtitle:`Inspect discovered extensions, declared permissions, and browser UI approval state.`,grantsHeading:`UI approval storage`,grantsHint:"Key `xopc.extensionUiGrants.v1` in localStorage — fingerprints of permission lists you approved per extension.",refresh:`Refresh`,listHeading:`Extensions from gateway`,colId:`Id`,colName:`Name`,colPermissions:`Manifest permissions`,futureHeading:`Coming later`,futureBody:`PostMessage capture, per-extension storage preview, and live permission overrides are planned for a future iteration.`},settingsSections:{appearance:`Preferences`,agent:`Agent`,"agent-defaults":`Agent defaults`,providers:`Providers`,models:`Models`,channels:`Channels`,voice:`Voice`,gateway:`Gateway`,heartbeat:`Heartbeat`,search:`Web search`,agents:`Agents`,system:`System`},systemSettings:{title:`System`,behaviorGroup:`App behavior`,subtitle:`Desktop (Windows, macOS, Linux) start-up, power, and notification preferences; per-OS settings links for system access.`,desktopOnlyTitle:`Desktop app only`,desktopOnlyBody:`System integration is available in the xopc Electron app. In the browser, use your OS settings instead.`,toggles:{openAtLogin:`Open at login`,openAtLoginDesc:`Start xopc when you sign in to this user account.`,keepAwake:`Keep system awake`,keepAwakeDesc:`While enabled, the app requests that the system stay awake (agent work may not be interrupted by idle sleep).`,notifyDesktop:`Desktop notifications`,notifyDesktopDesc:`Allow the app to show system notifications when you wire them in a future update (preference is saved now).`,notifySound:`Sound notifications`,notifySoundDesc:`Play a sound when a notification is shown (when notification sound is implemented).`},permissionsTitle:`System permissions`,permissionsHint:`Status is best-effort. After changing system settings, refresh or revisit this page.`,permissionsHintDarwin:`macOS privacy (TCC) and media status are best-effort. Use Refresh after you change System Settings.`,permissionsHintWin:`On Windows, microphone and (where reported) screen access follow system-wide toggles. Each link opens a relevant page in the Settings app.`,permissionsHintLinux:`Linux does not report these states here. We try to open your desktop’s Settings; otherwise a documentation page opens. Grant access in your distro, Flatpak, or portal as needed.`,status:{granted:`Allowed`,denied:`Not allowed`,unknown:`Unknown`},openSettings:`Open settings`,refresh:`Refresh status`,perm:{fullDisk:{title:`Files & storage`,desc:`Read and write workspace and user data when the OS or sandbox allows (wording and paths vary by system).`},screen:{title:`Screen Recording`,desc:`Capture the screen for vision features outside the in-app browser.`},microphone:{title:`Microphone`,desc:`Record voice in chat and voice features.`},accessibility:{title:`Accessibility`,desc:`Use global shortcuts and accessibility-related integrations.`},automation:{title:`Automation & app integration`,desc:`Control or integrate with other apps and services (e.g. Apple Events on macOS, default apps on Windows, or desktop portals on Linux).`},notifications:{title:`Notifications`,desc:`Allow the app in your OS notification settings so alerts can appear.`},location:{title:`Location`,desc:`Location-based tasks when the product uses location.`}}},settingsNavGroups:{gateway:`Connection & service`,agentAndModels:`Providers & models`,data:`Sessions & logs`,interface:`General`,voice:`Voice`,extensions:`Extensions`},token:{title:`Authentication required`,description:`Enter your gateway token to continue.`,gatewayUrl:`Gateway URL`,tokenLabel:`Token`,placeholder:`Gateway token (e.g. ea4c67bf…)`,save:`Save`,show:`Show`,hide:`Hide`},gatewayLanding:{headline:`Connect to this gateway`,subline:`The Web console needs the same token your server uses. Get it from setup or your config file, then paste it below.`,sessionExpired:`Your session expired or the token was rejected. Enter a valid gateway token to continue.`,stepOnboard:`Run xopc onboard (or onboard --gateway) and enable the Web console — the token is printed there.`,stepPaste:`Paste the token here and save. You can also open a link that ends with ?token=… from onboarding.`,stepUrlHint:`Opening a bookmark with ?token= in the URL saves it automatically (the address bar is cleaned afterward).`,docsGatewayLink:`Gateway guide`},electron:{setupBannerTitle:`Finish setup to start chatting`,setupBannerBody:`Add at least one model provider API key and choose a default model. You can change this anytime in Settings.`,setupBannerLinkProviders:`Provider keys`,setupBannerLinkModels:`Default model`,setupBannerDismiss:`Don't show again`,gatewayExitTitle:`Local gateway stopped`,gatewayExitBody:`The assistant backend exited unexpectedly. Restart the app to continue.`},connection:{connecting:`Connecting…`,online:`Online`,reconnecting:`Reconnecting…`,offline:`Offline`,error:`Connection error`,reconnect:`Reconnect`},api:{errorBadGateway:`Bad gateway (502)`,errorServiceUnavailable:`Service unavailable (503)`,errorGatewayTimeout:`Gateway timeout (504)`,errorInternal:`Internal server error (500)`,errorServer:`Server error ({{status}})`,errorNotFound:`Not found (404)`,errorForbidden:`Forbidden (403)`,errorRequest:`Request failed ({{status}})`},sidebar:{newTask:`New task`,tasksHeading:`Tasks`,viewAllSessions:`All sessions`,taskListEmpty:`No chats yet`,taskListNeedToken:`Save a gateway token to load your chats.`,taskListAddToken:`Add token`,taskListStartChat:`Start a chat`,appMenuAria:`App menu and settings`,taskSessionMenuAria:`Session actions`,taskRename:`Rename`,taskCopyChatId:`Copy chat ID`,taskDeleteTask:`Delete task`,taskRenameTitle:`Rename task`,taskRenamePlaceholder:`Session name`,taskRenameSave:`Save`,taskRenameCancel:`Cancel`,backToApp:`Back to app`,backToAgents:`Back to agents`,back:`Back`,helpDocs:`Documentation`,sessionChannelFilterAria:`Filter tasks: web app or channels`,sessionTasksTab:`Tasks`,sessionChannelsTab:`Channels`,resizeHandleAria:`Resize sidebar`},chat:JSON.parse(`{"typeMessage":"Type a message…","sendMessage":"Send","abort":"Abort","needToken":"Save a gateway token to chat.","loading":"Loading conversation…","model":"Model","modelPlaceholder":"Select a model…","agent":"Agent","agentPlaceholder":"Select an agent…","agentSearchPlaceholder":"Search agents…","agentNoMatches":"No matching agents","thinkingLevel":"Thinking","newSession":"New chat","welcomeTitle":"Welcome to xopc","welcomeDescription":"Send a message to get started","welcomeSpotlight":{"headline":"The solo operator's AI execution console","tagline":"Runs on your machine: takes tasks, breaks them down, and executes — you keep the decisions.","categories":[{"id":"files","icon":"folder","title":"File organization","description":"Downloads, photos, attachments","scenarios":[{"prompt":"Scan my Downloads folder for duplicates by content hash; list paths and modified times per group and recommend keeping only the newest copy."},{"prompt":"Inspect files on my Desktop and propose a subfolder layout by type (docs, images, audio/video, archives, spreadsheets). Outline safe steps before moving anything."},{"prompt":"Read EXIF from photos under my album path in the workspace (date, GPS or place fields) and propose a rename pattern \\"YY-MM-DD Place-Index\\"; flag files missing EXIF."}]},{"id":"research","icon":"globe","title":"Research & search","description":"Web search, comparisons, fact-check","scenarios":[{"prompt":"Search the web for the latest news and developments on [topic]; summarize key findings with sources."},{"prompt":"Compare [A] vs [B] for [use case]: list pros, cons, and recommend which to choose in a table format."},{"prompt":"Fact-check the claims in this text: identify uncertain statements and suggest how to verify them."}]},{"id":"content","icon":"content","title":"Content creation","description":"Notes, briefs, copy","scenarios":[{"prompt":"Read my latest meeting notes (Markdown or TXT in the workspace), extract decisions, action items, and owners; format todos as a checklist and mark gaps."},{"prompt":"From rough notes in my workspace notes folder, draft a \\"today / this week\\" brief: schedule highlights, follow-ups, risks and blockers — tone for me or my team."},{"prompt":"Rewrite one long article or technical note from the workspace into five short social posts (hook, bullet takeaways, quote, poll question, resource drop) with length suited to threads."}]}]},"you":"You","assistant":"Assistant","tool":"Tool","thinkingLabel":"thinking…","thoughts":"Thoughts","thoughtsStreaming":"Thinking…","thoughtsExpandHint":"Expand to view model thoughts","thinkingLevels":{"off":"Off","minimal":"Minimal","low":"Low","medium":"Medium","high":"High","xhigh":"X-High","adaptive":"Adaptive"},"toolInput":"Input","toolOutput":"Output","noOutput":"(no output)","viewSteps_one":"View {{count}} step","viewSteps_other":"View {{count}} steps","stepSearchedWeb":"Searched web","stepReadFile":"Read file","stepDetails":"Details","stepRunCommand":"Run command","stepListDirectory":"Browse folder","stepWriteFile":"Save file","stepEditFile":"Edit file","stepOpenUrl":"Open link","stepFetchUrl":"Fetch webpage","stepUnknownTool":"Running {{name}}","composerRunStatusSending":"Sending…","composerRunStatusDefault":"Working…","composerRunningTool":"Running {{name}}","composerStageThinking":"Thinking…","composerStageSearching":"Searching…","composerStageReading":"Reading…","composerStageWriting":"Writing…","composerStageExecuting":"Executing…","composerStageAnalyzing":"Analyzing…","attachFile":"Attach file","workingDirectory":{"selectWorkingDirectory":"Select working directory","chooseFolder":"Choose folder…","selectPath":"Select folder…","recentDirectories":"Recent directories","noRecent":"No recent folders","notSet":"Default workspace","defaultWorkspace":"Session workspace","copyPath":"Copy path","selectionOnlyAtNewChat":"Workspace can only be chosen before the first message.","lockedTapTitle":"Workspace is locked for this chat","lockedTapBody":"To pick a folder for the agent, open New chat and click this control before you send the first message. You can also set a default workspace under Settings → Agents.","clickToCopyFullPath":"Click to copy full path","copied":"Copied","openWorkspaceMenu":"Workspace options","folderPickerRequiresDesktop":"Folder selection requires the desktop app (Electron). Open xopc from the desktop app, or configure the path another way.","applyErrorTitle":"Could not set working directory","applyErrorClose":"Close","pathModalTitle":"Working directory","pathModalDescription":"Enter an absolute path on the machine running the gateway (folder for the session workspace).","pathInputPlaceholder":"/absolute/path/to/folder","pathModalConfirm":"Apply","pathModalCancel":"Cancel","pickerHostHint":"Directories on gateway host: {{hostname}}","pickerLoading":"Loading…","pickerUp":"Up","pickerUseThisFolder":"Use this folder","pickerManualPath":"Or type an absolute path","pickerApplyManual":"Apply path","pickerListError":"Could not read this location.","pickerEmptyFolder":"Empty folder","pickerDrives":"Drives"},"maxAttachmentsReached":"Maximum {{max}} files per message. Remove some to add more.","maxAttachmentsTruncated":"{{dropped}} file(s) not added (limit {{max}} per message).","attachmentFileTooLarge":"File \\"{{name}}\\" is too large (max {{maxSize}} per file).","inputPlaceholder":"Ask anything — @ for files, / for skills & commands","currentModel":"Model used for this conversation","modelSearchPlaceholder":"Search by name, provider, or ID…","modelNoMatches":"No models match your search","modelProviderSettingsLink":"Configure providers…","dropFiles":"Drop files here to attach","voiceRecording":"Record voice","voiceRecordingStop":"Stop recording","voiceMicDenied":"Microphone access denied or unavailable.","inputPlaceholderSteering":"Follow-up: Enter queues a row; click a row to edit here","inputPlaceholderSteeringEdit":"Editing queued follow-up — Enter saves, Esc discards changes","steeringInterruptSend":"Stop and send now (⌘↵ or Ctrl+↵)","followUpSuggestionsAria":"Suggested follow-up questions","followUpChipErrorHandling":"Add error handling and edge cases.","followUpChipRefactorReadability":"Refactor for readability.","followUpChipCodeExplain":"Explain this code step by step.","followUpChipCodeOptimize":"Suggest performance optimizations.","followUpChipWebMoreDetails":"Find more details online.","followUpChipWebFindSources":"Find reliable sources.","followUpChipShorterSummary":"Give a shorter summary.","followUpChipMainRisks":"What are the main risks?","followUpChipEmailMakeFormal":"Make it more formal.","followUpChipEmailShorten":"Shorten this.","followUpChipSimplerTerms":"Explain that in simpler terms.","followUpChipConcreteExample":"Give a concrete example.","followUpChipBulletPoints":"Summarize as bullet points.","followUpChipCreateTable":"Present as a table.","followUpChipWhatNext":"What should I do next?","followUpQueueAria":"Follow-up queue (sent after this reply, in order)","followUpQueueHeading":"Follow-ups","followUpQueueClickToEdit":"Edit in composer","followUpQueueAttachmentOnly":"(attachment)","followUpQueueEmptyPreview":"(empty)","followUpQueueDrag":"Drag to reorder","followUpQueueMoveUp":"Move up","followUpQueueMoveDown":"Move down","followUpQueueSteerNow":"Inject as steering (tool boundary)","followUpQueueRemove":"Remove from queue","followUpQueueAttachmentsNote":"Rows with attachments cannot use ✨ steer; they send as full messages in order.","followUpQueueMaxReached":"Follow-up queue is full (max {{max}}). Remove one or wait for the run to finish.","voicePlay":"Play voice","voicePause":"Pause","voiceLoading":"Loading audio…","voiceMessage":"Voice","loadOlder":"Loading older messages…","scrollToBottom":"Scroll to bottom","attachmentPreviewClose":"Close","attachmentPreviewDownload":"Download","attachmentPreviewRemove":"Remove","attachmentPreviewLoading":"Loading file…","attachmentPreviewText":"Text","attachmentPreviewPdf":"PDF","attachmentPreviewDocument":"Document","attachmentPreviewPresentation":"Presentation","attachmentPreviewSpreadsheet":"Spreadsheet","attachmentPreviewNoText":"No text content available","attachmentPreviewMissingData":"Missing file data","attachmentPreviewLoadError":"Error loading file","attachmentPreviewMissingAuth":"Missing authentication","attachmentPreviewFailedPdf":"Failed to load PDF","attachmentPreviewFailedDocx":"Failed to load document","attachmentPreviewFailedExcel":"Failed to load spreadsheet","attachmentPreviewPdfRendering":"Rendering PDF…","attachmentPreviewPdfLoadMore":"Scroll to load more pages","attachmentPreviewExcelTruncated":"Preview limited to {rows} rows × {cols} columns. Download the file to see the full sheet.","attachmentPreviewPptxTruncated":"Text preview truncated for performance. Download the file to see the full deck.","attachmentPreviewPptxSlide":"Slide {n}","attachmentPreviewPptxEmptySlide":"(No text on this slide)","attachmentPreviewOpenElsewhereHint":"Download the file to open it in another application on your computer.","attachmentPreviewOpenElsewhereTruncated":"Only part of this file is shown here. Download the full file to open it elsewhere.","attachmentPreviewDownloadFull":"Download file","attachmentPreviewImage":"Preview image","messageArtifactsHeading":"Message output","stepTimelineThinkingStreaming":"Thinking…","stepTimelineThinkingDone":"Thinking complete","stepTimelineToolSearchRunning":"Searching the web…","stepTimelineToolSearchComplete":"Web search complete","stepTimelineToolSearchError":"Web search failed","stepTimelineToolGenericRunning":"{{name}}…","stepTimelineToolGenericComplete":"{{name}} complete","stepTimelineToolGenericError":"{{name}} failed","searchSourcesHeading":"Search sources · {{count}}","executionDrawerTitle":"Execution","executionDrawerClose":"Close","executionDrawerEmpty":"No steps for this reply yet.","executionProgressDone":"Thinking complete","executionProgressRunning":"Thinking & tools…","executionElapsedTitle":"Elapsed time for this run","messageCopyPlainText":"Copy plain text","messageCopyMarkdown":"Copy Markdown","messageCopied":"Copied","commandPalette":{"noResults":"No matching commands or skills","placeholder":"Search skills and commands…","skillsSection":"Skills","commandsSection":"Commands","showGroupedMore":"Show {{count}} more"},"atMention":{"noResults":"No matches","placeholder":"Search files…","searchError":"Failed to search workspace","files":"Files","folders":"Folders","recentFiles":"Recent","recentBadge":"Recent","shiftHint":"Shift+Enter or Shift+click: add another @ mention."}}`),sessions:{title:`Sessions`,needToken:`Save a gateway token to manage sessions.`,searchPlaceholder:`Search sessions…`,filterAll:`All`,filterActive:`Active`,filterPinned:`Pinned`,filterArchived:`Archived`,filterChannelAll:`All channels`,filterChannelLabel:`Channel`,totalSessions:`Total`,activeSessions:`Active`,pinnedSessions:`Pinned`,archivedSessions:`Archived`,sessionCount:`{{count}} shown`,loadMore:`Load more`,noSessions:`No sessions yet`,noSessionsDescription:`Start a conversation in Chat; sessions will appear here.`,startNewChat:`Start New Chat`,continueChat:`Continue in chat`,archive:`Archive`,unarchive:`Unarchive`,pin:`Pin`,unpin:`Unpin`,export:`Export JSON`,delete:`Delete`,deleteSessionTitle:`Delete session?`,deleteSessionMessage:`Delete “{{name}}”? This cannot be undone.`,cancel:`Cancel`,loading:`Loading…`,loadError:`Failed to load sessions`,gridView:`Grid`,listView:`List`,layoutToggleGroup:`Session layout`,detailLoading:`Loading session…`,detailMessages:`Messages`,detailExport:`Export`,close:`Close`},cron:JSON.parse('{"title":"Scheduled Tasks","subtitle":"Tasks run automatically on schedule and can be triggered manually anytime. Describe what you want to do regularly in any chat to create one quickly.","needToken":"Save a gateway token to manage scheduled tasks.","statsRegion":"Overview","tabMyTasks":"My Scheduled Tasks","tabRunHistory":"Run History","wakeBanner":"Scheduled tasks only run while this device is awake. When the system or display sleeps, runs may be skipped.","keepAwake":"Keep screen awake","wakeLockUnavailable":"Screen wake lock is not available in this browser or context.","sortCreatedDesc":"Created (newest first)","sortCreatedAsc":"Created (oldest first)","historyRangeDay":"Day","historyRangeWeek":"Week","historyRangeMonth":"Month","filterAllTasks":"All tasks","filterAllStatuses":"All statuses","emptyHistoryTitle":"No execution records","emptyHistoryHint":"Records will appear here once scheduled tasks start running.","jobCardMenuAria":"Task actions","scheduleBadge":{"everyMinute":"Every minute","everyNMinutes":"Every {{n}} minutes","everyNHours":"Every {{n}} hours","hourly":"Hourly","dailyAt":"Daily, {{time}}","weekdaysAt":"Weekdays, {{time}}","weeklyOn":"{{day}}, {{time}}","cronExpr":"{{expr}}"},"jobsHeading":"Scheduled jobs","addJob":"New task","editJob":"Edit task","name":"Name *","namePlaceholder":"My scheduled task","nameRequired":"Name is required","schedule":"Schedule (cron expression) *","message":"Message *","messagePlaceholder":"What should the assistant do?","messageEdit":"Edit","messagePreview":"Preview","messageMarkdownHint":"Supports Markdown (headings, lists, code blocks, links, …).","create":"Create Job","runNow":"Run Now","delete":"Delete","edit":"Edit","enabled":"Enabled","disabled":"Disabled","running":"Running","nextRun":"Next Run","status":"Status","runHistoryTitle":"Run History","runHistoryHint":"Completed runs are stored on disk (state/cron/runs). Use Refresh to update.","detailRunHistory":"Recent runs","colStarted":"Started","colJob":"Job","colDuration":"Duration","colDetail":"Result","colChat":"Chat","openChat":"Open","openChatTitle":"Open this run in chat (isolated agent sessions only)","execStatusRunning":"Running","execStatusSuccess":"Success","execStatusFailed":"Failed","execStatusCancelled":"Skipped","noRunsYet":"No executions in this range.","confirmDelete":"Are you sure you want to delete this cron job?","confirmRun":"Run this cron job now?","scheduleLabel":"Schedule","messageLabel":"Message","totalJobs":"Total jobs","emptyStateCta":"Create your first job","channel":"Channel","channelLocal":"Local (no outbound)","deliveryTargetLocalChannel":"Local channel — transcript or message stays on this machine","recipient":"Recipient *","recipientPlaceholder":"Telegram: numeric id, or pick from recent sessions","refreshList":"Refresh","refreshRecipientHint":"Reload list from recent sessions","selectRecipient":"— Select —","noRecentChatsOption":"No recent sessions","deliveryTarget":"Delivery","scheduleHintPreset":"Select a preset or enter custom cron expression","schedulePicker":{"scheduleTimeLabel":"Scheduled time","modeNoRepeat":"Does not repeat (yearly date)","modeInterval":"Interval","intervalKindMinutes":"Minutes","intervalKindHours":"Hours","modeHourly":"Every hour","modeDaily":"Daily","modeWeekly":"Weekly","modeMonthly":"Monthly","modeCustom":"Custom (cron)","minuteUnit":"min","minuteAtHour":"Minute","intervalMinutes":"Interval in minutes","intervalHours":"Interval in hours","hourUnit":"h","dayOfMonth":"Day of month","customCronHint":"Five-field cron: minute hour day-of-month month day-of-week","weekdays":["Mo","Tu","We","Th","Fr","Sa","Su"]},"mode":"Mode","modeDirect":"Send message directly to the channel without AI processing","modeAgent":"Use AI agent to process the message, then send the response","modeDirectOption":"Direct (send message directly)","modeAgentOption":"AI Agent (process with AI then send)","agentLocalOnly":"Local only (save transcript, no channel send)","agentLocalOnlyHint":"Runs the agent on this machine. The transcript is stored as a cron session under the default or selected agent (the job id is part of the session key); no Telegram or CLI delivery.","deliveryLocalOnly":"Local only — transcript saved as a cron session under that agent","agentProfile":"Agent","agentProfileHint":"Only applies when mode is AI Agent. Leave as default to use the gateway default agent profile.","agentProfileDefault":"Default agent","workingDirectoryLabel":"Workspace","workingDirectoryHint":"Optional. Absolute path on the gateway host; leave unset to use this agent\'s default workspace.","workingDirectoryReset":"Use agent default","model":"Model","save":"Save","failedToLoadJobs":"Failed to load jobs","scheduleRequired":"Schedule and message are required","chatIdRequired":"Chat ID is required","failedToCreateJob":"Failed to create job","failedToUpdateJob":"Failed to save job","failedToToggleJob":"Failed to toggle job","actionFailed":"Action failed","enterManuallyOrSelect":"Enter manually or select from recent chats","noRecentChats":"No recent chats found. Enter chat ID manually (e.g., 123456789 for Telegram)","refresh":"Refresh","close":"Close","cancel":"Cancel","loading":"Loading…","schedulePresets":{"custom":"-- Custom (enter below) --","everyMinute":"Every minute","every5Minutes":"Every 5 minutes (default)","every10Minutes":"Every 10 minutes","every15Minutes":"Every 15 minutes","every30Minutes":"Every 30 minutes","everyHour":"Every hour","every2Hours":"Every 2 hours","every4Hours":"Every 4 hours","every6Hours":"Every 6 hours","every12Hours":"Every 12 hours","everyDayMidnight":"Every day at midnight","everyDay9AM":"Every day at 9:00 AM","everyDay9PM":"Every day at 9:00 PM"},"timeLabels":{"overdue":"Overdue","lessThanMinute":"Less than a minute","minutes":"{{count}} min","hours":"{{count}} hours"},"lastActiveLabels":{"justNow":"just now","minutesAgo":"{{count}}m ago","hoursAgo":"{{count}}h ago","daysAgo":"{{count}}d ago"},"templateFilterAll":"All","fromTemplate":"From template","templatesEmptyHint":"No templates match this filter.","templateCategories":{"daily":"Daily","monitoring":"Monitoring","reports":"Reports","automation":"Automation"},"templates":{"morning_briefing":{"title":"Morning briefing","description":"Weather-style day snapshot, headlines in your topics, and top priorities—edit the topic list in the prompt.","prompt":"Build a **morning briefing** I can read in a few minutes.\\n- **Weather / day shape**: if you cannot access a real forecast API, say so and give **one** practical clothing or commute tip based only on season/region I name below, or skip this bullet.\\n- **Headlines**: topics I care about (edit): **(e.g. local news, macro, tech policy, sports)**—if web search works, 4–6 bullets from the last ~24h with source type; if not, give a **manual check order** instead of inventing stories.\\n- **Top 3 priorities today** from workspace notes/todos if visible; else ask me to paste them once.\\n- **No fake URLs or quotes**."},"standup_prep":{"title":"Standup prep","description":"Draft a standup-style update from recent git activity and notable file changes in the workspace.","prompt":"Prepare a **standup update** for me:\\n- If Git is available: **yesterday / since last standup** themes from `git log` (no wall of SHAs), risky paths if obvious from messages.\\n- If not: give **commands** I should run locally next time.\\n- **Files touched**: infer from workspace if you can (recent edits, open PR-style hints); mark uncertain.\\n- **Blockers**: max 3, honest \\"unknown\\" allowed.\\n- **Today intent**: one sentence.\\n- Keep it speakable aloud in under ~90 seconds."},"end_of_day_wrap_up":{"title":"End-of-day wrap-up","description":"Summarize progress, open items, and tomorrow\'s priorities from workspace context when possible.","prompt":"**End-of-day wrap** (weekday):\\n- **Done**: up to 5 bullets (mark inferred items).\\n- **Open / parked**: up to 4 bullets.\\n- **Tomorrow**: first concrete task after login—single bullet.\\n- Pull from task docs, changelogs, or notes in the workspace when present; otherwise say what is missing.\\n- Neutral tone, no guilt."},"inbox_triage":{"title":"Inbox triage","description":"Surface urgent follow-ups first—uses any mail/export notes in the workspace; no mailbox access implied.","prompt":"Help me **triage inbox-style work** (no live email unless I paste content):\\n- If I have exported snippets, `*.eml`, or notes about mail in the workspace, summarize **urgent follow-ups first** with suggested next action each.\\n- If nothing mail-related exists, output a **5-step triage routine** (folders/labels, oldest-first, VIP senders I list below) and ask me to paste 3 subject lines next run.\\n- **VIP / domains to watch** (edit): **(add yours)**.\\n- Do not claim you read my real inbox."},"competitor_watch":{"title":"Competitor watch","description":"Track competitor news, product updates, and pricing signals you name—web search when available.","prompt":"Competitors or alternatives to watch (edit names/topics): **(list here)**.\\n- If web search works: summarize **news, product/changelog moves, pricing or packaging signals** from roughly the past week; separate **fact** vs **rumor**.\\n- If search is unavailable: give **official domains + what to check** (pricing page, changelog, press) without fabricating updates.\\n- **Never invent press quotes, numbers, or URLs**."},"trending_topics_monitor":{"title":"Trending topics","description":"Track trending discussions and news in industries or communities you list.","prompt":"Industries, communities, or hashtags I track (edit): **(e.g. fintech, indie games, city subreddit, AI tools)**.\\n- If web search works: **5–7** bullets on what is **trending or unusually active** this week; note platform (news, Reddit-style, HN-style) at a high level.\\n- If not: suggest **where to look** and **search phrases**—no made-up threads.\\n- Flag **controversy or misinformation risk** briefly when relevant."},"tech_radar_stack":{"title":"Tech radar","description":"Monitor new releases and security advisories for stacks you name (frameworks, runtimes, cloud).","prompt":"Stacks I use (edit): **(e.g. Node LTS, Postgres, AWS service X, Android SDK)**.\\n- List **notable releases or deprecations** from the past ~14 days using **official blogs, registries, or changelogs** only.\\n- Security: point to **official advisory channels**; **do not invent CVE IDs**.\\n- If the workspace has lockfiles, you may mention ecosystem at a high level; if unsure, say what file you need."},"dependency_check_audit":{"title":"Dependency check","description":"Audit-style nudge for outdated packages and known issues—suggests commands, does not fabricate CVEs.","prompt":"From the repo in the workspace, infer package managers (`package.json`, `go.mod`, `pyproject.toml`, etc.).\\n- Suggest **one concrete audit command** per ecosystem if documented (npm/pnpm audit, pip-audit, etc.).\\n- Summarize **what I should look for** (majors, yanked packages, EOL runtimes) without claiming scan results you did not run.\\n- **Never fabricate CVE numbers** or vulnerable versions."},"weekly_review":{"title":"Weekly review","description":"Summarize the week\'s commits, open items, and next-week priorities.","prompt":"**Weekly review** (assume end of week):\\n- **Shipped themes** from git + workspace notes (or say git unavailable).\\n- **Open items** still worrying (max 6).\\n- **Next week**: 3 headline priorities.\\n- **One thing to stop or delegate** if overload is visible.\\n- Short, executive-summary tone."},"code_quality_report":{"title":"Code quality report","description":"Outline how to run lint/type-check and what to look for in output—does not pretend CI already ran.","prompt":"Inspect the workspace for **lint / typecheck / format** scripts (package.json, Makefile, CI YAML).\\n- Propose **commands** I should run locally and in what order.\\n- Describe **how to skim output**: error categories, flaky tests, type debt hotspots—without inventing numbers.\\n- If no scripts found, suggest a **minimal** starter for the detected language with caveats."},"git_activity_summary":{"title":"Git activity summary","description":"Summarize recent commits, active branches, and hotspot files when git is available.","prompt":"Summarize **recent Git activity** (last ~7 days if possible):\\n- Commit **themes**, **active branches** worth naming, **hotspot files** touched often.\\n- If git is not callable here, output **commands** to reproduce the summary locally.\\n- Avoid dumping hashes; keep it scannable."},"user_feedback_digest":{"title":"User feedback digest","description":"Summarize recurring feedback and pain points from notes, issues exports, or docs you keep in the workspace.","prompt":"I store feedback in (edit paths or patterns): **`feedback/`, issues export, Notion export, etc.`**\\n- From readable workspace text, cluster **recurring themes**, **sentiment (rough)**, and **top pain points** (max 5).\\n- If no material: give a **template** for how I should paste feedback next time.\\n- No PII beyond what is already in files; redact if needed in summary."},"stale_todo_or_issue_sweep":{"title":"Stale todo / issue sweep","description":"Find aging TODOs or issue-like markers in the repo and suggest keep / close / split.","prompt":"Scan the workspace for **TODO/FIXME/HACK** comments or lightweight issue lists in markdown.\\n- List up to **10 stale candidates** (old by file churn or vague wording) with **suggested next action**: close, split, or schedule.\\n- Do not delete anything—recommendations only.\\n- If scan is incomplete, say why."},"release_notes_or_changelog_draft":{"title":"Release notes draft","description":"Draft changelog bullets from recent commits and version files—human must verify before ship.","prompt":"Draft **release notes / changelog** candidate for the **next** version bump:\\n- Read `CHANGELOG`, version in `package.json`/`Cargo.toml`/similar if present.\\n- Summarize **user-visible** changes from recent commits since last tag if inferable; else since last week.\\n- Mark **uncertain** items; I will edit before publishing.\\n- No marketing exaggeration."},"workspace_cleanup_suggestions":{"title":"Workspace cleanup","description":"List large artifacts, caches, or generated files to review before the weekend—never auto-delete.","prompt":"Suggest **workspace cleanup** before the weekend:\\n- Large **build outputs, caches, logs** if discoverable.\\n- Table: path | why it might be safe to trim | risk | suggested action (review only).\\n- **Never delete**; if you cannot see disk usage, say so and give generic patterns."},"smoke_or_ci_health_reminder":{"title":"Smoke / CI health","description":"Remind which smoke tests or CI checks matter this week and how to run them locally.","prompt":"From CI config and package scripts, list **smoke or health checks** worth running this week.\\n- For each: **command**, **expected green signal**, **when to run** (before release, daily, etc.).\\n- If CI files are missing, propose a **minimal** manual smoke path for this repo type.\\n- Do not claim CI passed without evidence."}}}'),workspace:{title:`Project Files`,currentWorkspace:`Current Workspace`,openFiles:`Project Files`,preview:`Preview`,download:`Download`,copyPath:`Copy path`,pathCopied:`Path copied`,edit:`Edit`,viewing:`Viewing`,saved:`Saved`,saving:`Saving…`,emptyDir:`No files`,loadError:`Failed to load`,close:`Close`,resizeHandleAria:`Resize project files panel`,lastModified:`Modified`,openElsewhereHint:`Preview may be limited or unavailable. Download the file or open it with another app.`,cannotPreviewType:`This file type can't be previewed here.`,openSystemApp:`Open with default app`},skills:{title:`Skills`,needToken:`Save a gateway token to manage skills.`,tagline:`Install and manage skills to extend xopc in conversation. Managed skills live under ~/.xopc/skills.`,refresh:`Refresh list`,reloadRuntime:`Reload from disk`,reloadDiskAria:`Reload skills from disk`,skillsNavAria:`Skill sources`,tabBuiltin:`Built-in`,tabUser:`Installed`,tabMarketplace:`Marketplace`,marketplacePlaceholder:`The skill marketplace is coming soon.`,sectionMarketplace:`Skill store`,marketplaceSortLabel:`Sort`,marketplaceSortDownloads:`Most downloads`,marketplaceSortNewest:`Newest`,marketplaceLoadFailed:`Failed to load marketplace`,marketplaceEmpty:`No packages match your search.`,marketplaceInstall:`Install`,marketplaceReinstall:`Reinstall`,marketplaceInstalled:`Installed`,marketplaceReinstallConfirm:`This skill is already installed. Replace it with the version from the store?`,marketplacePagePrev:`Previous page`,marketplacePageNext:`Next page`,marketplacePageStatus:`Page {{page}} of {{totalPages}} · {{total}} packages`,marketplaceAuthor:`Author`,marketplaceDownloads:`Downloads`,marketplaceVersion:`Latest`,sectionBuiltinList:`Built-in skills`,filterAll:`All`,filterGlobal:`Global`,filterWorkspace:`Workspace`,filterExtra:`Extra`,sectionUser:`Your skills`,installCta:`Install skill`,installModalTitle:`Install skill`,installModalDropHint:`Drop a .zip or SKILL.md file, or click to choose.`,installModalReqTitle:`Requirements`,installModalReq1:`A .zip archive that contains SKILL.md`,installModalReq2:`Or drop a SKILL.md file directly`,installAction:`Install`,installClose:`Close`,searchPlaceholder:`Search skills`,noSearchResults:`No skills match your search.`,uploading:`Uploading…`,loading:`Loading…`,empty:`No skills loaded.`,loadFailed:`Failed to load skills`,reloadFailed:`Failed to reload skills`,skillToggleFailed:`Failed to update skill`,uploadFailed:`Upload failed`,installSuccess:`Skill installed.`,zipOnly:`Please choose a .zip file`,invalidFile:`Choose a .zip or SKILL.md file`,delete:`Delete`,deleteTitle:`Delete skill`,deleteMessage:`Remove folder "{{id}}" from managed skills? This cannot be undone.`,deleteConfirm:`Delete`,deleteFailed:`Failed to delete skill`,yes:`Yes`,no:`No`,cancel:`Cancel`,source:{builtin:`Bundled`,workspace:`Workspace`,global:`Global`,extra:`Extra`},col:{name:`Name`,description:`Description`,source:`Source`,managed:`Managed`,actions:`Actions`},detailModalBanner:`The following is the original SKILL.md for this skill.`,detailModalBannerStore:`Preview below is the markdown published with this package on the skill store (same content as the package readme).`,marketplaceNoReadme:`No readme text is available for this package.`,detailModalEnable:`Enable`,detailModalDisable:`Disable`,detailLoadFailed:`Failed to load SKILL.md`,detailCloseAria:`Close`,hubRemote:`Remote`,hubKindGit:`git`,hubKindArchive:`archive`},logs:{title:`Logs`,subtitle:`Runtime diagnostics and history from the gateway.`,needToken:`Save a gateway token to view logs.`,filters:`Filters`,level:`Level`,searchPlaceholder:`Search message or module…`,module:`Module`,allModules:`All modules`,timeRange:`Time range`,from:`From`,to:`To`,clear:`Clear`,refresh:`Refresh`,autoRefresh:`Auto refresh`,pause:`Pause`,liveHint:`Refreshing every 5s`,logFiles:`Log files`,filesEmpty:`No log files on disk`,loadMore:`Load more`,showingCount:`{{count}} entries loaded`,moreAvailable:`Earlier entries may be available`,noLogs:`No matching entries`,noLogsDescription:`Adjust filters or search, or try again later.`,loading:`Loading…`,loadError:`Failed to load logs`,details:`Log details`,close:`Close`,time:`Time`,message:`Message`,metadata:`Metadata`,statsRegion:`Sample (recent files)`,statsHint:`Counts are sampled from recent log files, not totals.`,statsDetailTitle:`Level breakdown`,logDir:`Directory`,requestId:`Request ID`,sessionId:`Session ID`,presetAll:`All`,presetErrors:`Errors`,presetWarnPlus:`Warn+`,presetInfoPlus:`Info+`,presetVerbose:`Debug`,presetOther:`More`,levelPresetAria:`Filter by log level`,refreshModeAria:`Log refresh mode`,refreshManual:`Manual`,refreshLive:`Live`,filtersMore:`More filters`,filtersDialogTitle:`More filters`,filtersDialogDesc:`Time range and custom log levels.`,filtersDone:`Done`,levelCustom:`Custom levels`,levelCustomHint:`Toggle to include or exclude. No selection means all levels.`,copyMessage:`Copy message`,copyJson:`Copy JSON`,copied:`Copied`,levelNames:{trace:`trace`,debug:`debug`,info:`info`,warn:`warn`,error:`error`,fatal:`fatal`}},agentSettings:JSON.parse(`{"subtitle":"Defaults for models, workspace, sampling, and how responses are shown.","sectionDesc":"Changes are written to your gateway config file. Some values apply on the next agent turn or session.","needToken":"Save a gateway token to load and change agent defaults.","loadError":"Failed to load settings","save":"Save changes","saving":"Saving…","saved":"Saved","saveError":"Failed to save","cardModelsTitle":"Models","cardModelsSubtitle":"Chat, vision, and image generation defaults","cardWorkspaceTitle":"Workspace & attachments","cardWorkspaceSubtitle":"Working directory and inbound media limits","cardBrowserTitle":"Browser automation","cardBrowserSubtitle":"Playwright tools (browser_navigate, snapshot, click, …)","browserEnabledOn":"Enable browser tools","browserHeadlessOn":"Run headless (no visible window)","cardGenerationTitle":"Sampling & tools","cardGenerationSubtitle":"Token budget, randomness, and tool loop depth","cardBehaviorTitle":"Reasoning & output","cardBehaviorSubtitle":"Thinking depth, traces, and verbosity","label":{"model":"Model","modelFallbacks":"Fallback models","imageModel":"Image model","imageModelFallbacks":"Image understanding fallbacks","imageGenerationModel":"Image generation model","imageGenerationModelFallbacks":"Image generation fallbacks","mediaMaxMb":"Image load limit (MB)","workspace":"Workspace","browserEnabled":"Browser tools","browserHeadless":"Headless mode","maxTokens":"Max tokens","temperature":"Temperature","maxToolIterations":"Max tool iterations","thinkingDefault":"Thinking level","reasoningDefault":"Reasoning visibility","verboseDefault":"Verbose mode"},"desc":{"model":"Default model for new sessions.","modelFallbacks":"Tried in order when the primary model returns an error after transient retries. Requires API keys for each provider.","imageModel":"Optional. Used for image understanding / vision.","imageModelFallbacks":"When the chat model has no vision, these vision models describe inbound images (and for the image tool). Tried in order.","imageGenerationModel":"Optional. For image_generate (e.g. openai/gpt-image-1).","imageGenerationModelFallbacks":"Tried in order when the primary image generation model fails (e.g. quota or provider error).","mediaMaxMb":"Max size when loading images in the image tool.","workspace":"Working directory for agent files.","browserEnabled":"Exposes Playwright browser_* tools to the model. Install Chromium once on the gateway host: npx playwright install chromium.","browserHeadless":"When off, Chromium shows a window on the gateway machine (useful for debugging). When on, runs in the background.","maxTokens":"Maximum tokens in the model response.","temperature":"Randomness (0–2).","maxToolIterations":"Maximum tool calls per user message.","thinkingDefault":"Default thinking level for new sessions.","reasoningDefault":"Whether to surface model reasoning in the chat UI. Per-session overrides (e.g. /reasoning) take precedence until cleared.","verboseDefault":"Agent verbosity for logs/tool detail elsewhere — not the reasoning/thinking panel. Use Reasoning visibility to hide reasoning."},"addModelFallback":"Add fallback model","removeModelFallback":"Remove fallback model","reasoning":{"off":"Off","on":"On","stream":"Stream"},"verbose":{"off":"Off","on":"On","full":"Full"},"advanced":{"cardLimitsTitle":"Turn limits & reliability","cardLimitsSubtitle":"Wall-clock cap per user turn, request retries, and tool failure budget.","maxTaskDurationMs":"Max task duration (minutes)","maxTaskDurationMsDesc":"Per-user-turn wall time for LLM and tools. Leave empty to use the server default. Range 1–240 min (1 min–4 h).","maxTaskDurationPlaceholder":"e.g. 30 (empty = default)","maxRequestsPerTurn":"Max requests per turn","maxRequestsPerTurnDesc":"LLM request attempts per user message (reliability; default 50).","maxToolFailuresPerTurn":"Max tool failures per turn","maxToolFailuresPerTurnDesc":"Consecutive tool errors before giving up (default 3).","cardCompactionTitle":"Context compaction","cardCompactionSubtitle":"When to compact older context to stay within the model window.","compactionEnabled":"Enable compaction","compactionEnabledDesc":"When off, the runtime skips compaction (may use more context).","compactionEnabledOn":"Compaction on","compactionMode":"Mode","compactionModeDesc":"default: standard strategy; safeguard: stricter heuristics when enabled.","compactionModeDefault":"default","compactionModeSafeguard":"safeguard","reserveTokens":"Reserve tokens","reserveTokensDesc":"Headroom to leave after compaction (default 8000).","triggerThreshold":"Trigger threshold","triggerThresholdDesc":"Fraction of context that triggers compaction (0.5–0.95).","minMessagesBeforeCompact":"Min messages before compact","minMessagesBeforeCompactDesc":"Message count before compaction can run (default 10).","keepRecentMessages":"Keep recent messages","keepRecentMessagesDesc":"Recent turns always kept near the tail (default 5).","evictionWindow":"Eviction window","evictionWindowDesc":"Portion of history eligible for summary-first eviction (0.1–0.5).","retentionWindow":"Retention window","retentionWindowDesc":"Recent turns in the retention band (3–20).","cardPruningTitle":"Tool result pruning","cardPruningSubtitle":"Trim oversized tool results before the model sees them.","pruningEnabled":"Enable pruning","pruningEnabledDesc":"When off, full tool output may be sent to the model (higher cost).","pruningEnabledOn":"Pruning on","maxToolResultChars":"Max tool result characters","maxToolResultCharsDesc":"Default cap for a single tool result string (default 10000).","headKeepRatio":"Head keep ratio","headKeepRatioDesc":"Fraction kept from the start when pruning (0–1, default 0.3).","tailKeepRatio":"Tail keep ratio","tailKeepRatioDesc":"Fraction kept from the end (0–1, default 0.3).","cardMemoryTitle":"Memory (curated & external)","cardMemorySubtitle":"System memory, USER.md, and optional provider hooks.","memoryEnabled":"Memory features","memoryEnabledDesc":"Master switch: curated memory snapshot, tool, and external prefetch (when set).","memoryEnabledOn":"Enabled","useEnhancedSystem":"Use enhanced system","useEnhancedSystemDesc":"When off, use workspace bootstrap only (no extra memory snapshot in system).","useEnhancedSystemOn":"Enhanced system on","userProfileEnabled":"Include USER.md","userProfileEnabledDesc":"Add USER.md to the memory snapshot when present.","userProfileEnabledOn":"Include user profile","memoryProvider":"External memory provider","memoryProviderDesc":"none/stub, or leave unset to omit.","memoryProviderUnset":"(unset)","injectionFrequency":"External prefetch injection","injectionFrequencyDesc":"How often to inject prefetched memory into the user message context.","injectionFrequencyUnset":"(unset)","injectionEveryTurn":"Every turn (with cadence)","injectionFirstTurn":"First turn only","memoryCharLimit":"Memory character limit","memoryCharLimitDesc":"Max chars for the curated memory snapshot (optional).","userCharLimit":"User profile char limit","userCharLimitDesc":"Max chars for USER.md section (optional).","contextCadence":"Context cadence","contextCadenceDesc":"When using every turn: inject on turns 1, 1+N, … (min 1).","dialecticCadence":"Dialectic cadence (reserved)","dialecticCadenceDesc":"Reserved; not yet wired. Min 1 when set.","cardSessionSearchTitle":"Session search (transcripts)","cardSessionSearchSubtitle":"Model used to summarize past sessions for the session_search tool.","sessionSearchSummaryModel":"Summary model","sessionSearchSummaryModelDesc":"e.g. openai/gpt-4o-mini. Leave empty to use runtime defaults.","cardReviewTitle":"Background review","cardReviewSubtitle":"Post-turn nudges for memory/skills. Opt-in: enable below.","reviewEnabled":"Enable background review","reviewEnabledDesc":"When on, a quiet follow-up may run after successful turns.","reviewEnabledOn":"Enable","memoryNudgeInterval":"Memory nudge (every N user turns)","memoryNudgeIntervalDesc":"0 disables the memory channel. Default 10.","skillNudgeInterval":"Skill nudge (rounds without skill_manage)","skillNudgeIntervalDesc":"0 disables the skill channel. Default 10.","reviewMaxToolRounds":"Review max tool rounds","reviewMaxToolRoundsDesc":"1–32 (default 8).","reviewMaxHistoryMessages":"Max history in review (messages, tail)","reviewMaxHistoryMessagesDesc":"10–200 (default 80).","reviewMaxDurationMs":"Review time limit (seconds)","reviewMaxDurationMsDesc":"Wall clock for the review run (30–600 s; default 120).","cardWebExtractTitle":"web_extract (LLM pass)","cardWebExtractSubtitle":"Optional model and length for markdown web extraction.","webExtractModel":"Model","webExtractModelDesc":"Leave empty to use the default provider/model for extraction.","webExtractMaxLength":"Max length","webExtractMaxLengthDesc":"Max extracted characters (optional).","cardDelegateTitle":"Sub-agents & code execution","cardDelegateSubtitle":"Opt-in: delegate_task and sandboxed execute_code.","delegateEnabled":"Sub-agent delegate_task","delegateEnabledDesc":"When on, the agent may delegate to sub-agent runs (if supported).","delegateEnabledOn":"Enabled","executeCodeEnabled":"execute_code (sandboxed)","executeCodeEnabledDesc":"When on, the sandboxed code tool is available (if the runtime allows).","executeCodeEnabledOn":"Enabled","cardPromptSkillsTitle":"System prompt & skill allowlist","cardPromptSkillsSubtitle":"Replaces the default system context when set. Skills restrict <available_skills> when non-empty.","systemPromptOverride":"System prompt override","systemPromptOverrideDesc":"Optional full replacement; merged with per-agent entry (entry wins). Leave empty to clear.","systemPromptPlaceholder":"","skillsAllowlist":"Skill name allowlist","skillsAllowlistDesc":"If non-empty, only these skills appear in the prompt. Add one name per row.","addSkillName":"Add skill name","removeListItem":"Remove row","cardToolsDisableTitle":"Tools — global disable","cardToolsDisableSubtitle":"Disable built-in tool names in agents.defaults (e.g. shell, web_search).","toolsDisableHint":"List tool ids the default agent must not use. Per-agent tool settings in Agents still apply.","addToolName":"Add tool name","cardParamsTitle":"Params (JSON)","cardParamsSubtitle":"Opaque key/value for extensions. Must be a JSON object.","paramsJson":"Params object","paramsJsonDesc":"e.g. {\\"myFlag\\": true}. Clear to remove params from the config file.","paramsInvalidJson":"Params must be valid JSON object (e.g. empty or {}). Check syntax."}}`),agentsSettings:{title:`Agents`,subtitle:`Manage agents.list entries: workspaces, default routing, persona bootstrap files.`,needToken:`Save a gateway token to manage agents.`,loadError:`Failed to load agents`,saveError:`Request failed`,loading:`Loading…`,tabOverview:`Agents`,tabDefaults:`Defaults`,tabFiles:`Bootstrap files`,tabTools:`Tools`,tabSkills:`Skills`,tabChannels:`Channels`,tabCron:`Cron`,selectAgent:`Agent`,selectAgentHint:`Choose an entry to edit or inspect bootstrap Markdown under ~/.xopc/agents/<id>/bootstrap/.`,agent:`Agent`,defaultBadge:`default`,setDefault:`Set as default`,editAgent:`Edit entry`,editAgentHint:`Updates agents.list on the gateway. Paths are expanded (~ → home).`,displayName:`Display name`,agentDescription:`Description`,agentDescriptionPlaceholder:`Short summary shown on agent cards and in pickers (optional).`,workspacePath:`Markdown workspace`,modelPrimary:`Model (primary)`,modelClear:`Clear`,save:`Save changes`,removeFromConfig:`Remove from config`,purgeDisk:`Remove + delete data`,addAgent:`Add agent`,addAgentHint:`Same as CLI agents add: creates directories and seeds bootstrap templates.`,newAgentLabel:`Display name`,newAgentIdOptional:`Agent ID (optional)`,newAgentIdPlaceholder:`Leave empty to derive from display name`,newAgentIdRules:`1–64 characters: letters, digits, underscores, hyphens; must start with a letter or digit. Avoid reserved ids (e.g. main, con).`,newWorkspace:`Workspace directory (required)`,newModelOptional:`Model (optional)`,create:`Create agent`,addAgentAria:`Add agent`,createModalCancel:`Cancel`,closeDialogAria:`Close`,filesHint:`Editable persona files (SOUL, IDENTITY, …). Changes save automatically after you stop typing; use Preview to render Markdown.`,filesLoading:`Loading file list…`,filesEmpty:`No files yet.`,pickFile:`Select a file to edit.`,saveFile:`Save file`,filesBootstrapEdit:`Edit`,filesBootstrapPreview:`Preview`,filesAutoSaveHint:`Auto-saves when you pause typing.`,filesSavingStatus:`Saving…`,missing:`missing`,confirmDelete:`Remove this agent from config? Bindings referencing it will be stripped.`,confirmDeletePurge:`Remove this agent and delete its workspace + ~/.xopc/agents/<id> data? This cannot be undone.`,purgeConfirmLabel:`Type the agent id to confirm`,purgeConfirmPlaceholder:`Type {{agentId}} to confirm`,purgeConfirmHint:`This action is irreversible. Enter {{agentId}} exactly to enable deletion.`,toolsTitle:`Built-in tools`,toolsHint:`Per-agent tool disables (merged with agents.defaults). Tools already disabled in defaults cannot be re-enabled here.`,toolsSave:`Save tool disables`,toolsClearEntry:`Clear per-agent disables`,toolsLockedByDefaults:`disabled in defaults`,toolDescriptions:{read_file:`Read text and small files inside the agent workspace (paths are restricted to the workspace sandbox).`,write_file:`Create new files or overwrite existing ones under the workspace.`,edit_file:`Change existing files using locate-and-replace or patch-style edits.`,list_dir:`List files and subfolders in a workspace directory.`,grep:`Search file contents with regular expressions (similar to ripgrep).`,find:`Find files by name or glob pattern under the workspace.`,shell:`Run shell commands with workspace context — high impact; turn off for read-only or safer agents.`,web_search:`Search the public web for facts and pages newer than the model may know.`,web_fetch:`Fetch a URL and read its text content for the model.`,send_message:`Send outbound chat messages on connected channels (e.g. Telegram, CLI, gateway) when the agent replies.`,send_media:`Send images or other media attachments through those channels.`,memory_search:`Search indexed memories and notes stored for this agent.`,memory_get:`Load a specific memory entry or chunk by id.`,curated_memory:`Read or update curated markdown memories under the agent home directory.`,session_search:`Search across saved conversation transcripts and per-session summaries.`,image:`Analyze or describe images (vision) from the workspace or the current turn.`,image_generate:`Generate images using the configured image / image-generation model.`,extensions:`Expose tools registered by enabled extensions — disable to block all extension tools.`},skillsTitle:`Skill allowlist`,skillsHint:`Optional allowlist for <available_skills>. Inherit uses agents.defaults only; customize sets this agent’s skills array.`,skillsInherit:`Inherit defaults`,skillsCustomize:`Customize allowlist`,skillsSave:`Save skills`,skillsCatalogLoading:`Loading skill catalog…`,skillsEmptyCatalog:`No skills in catalog.`,skillsNoDescription:`No description in SKILL.md metadata.`,skillsDefaultsLabel:`Defaults allowlist:`,skillsEffectiveLabel:`Effective allowlist:`,skillsAllFromCatalog:`(all catalog skills)`,channelsTitle:`Routing bindings`,channelsHint:`config.bindings rows for this agent. Removing a rule updates the full bindings array on the gateway.`,channelsLoading:`Loading bindings…`,channelsNone:`No bindings target this agent.`,channelLabel:`Channel`,peerIdLabel:`Peer id (optional)`,channelsLoadingChannels:`Loading channel list…`,channelsManualChannelHint:`Gateway returned no channel list. Enter a channel id (e.g. telegram, webchat, gateway).`,channelsDisabledSuffix:`(disabled)`,channelsSessionLabel:`Match`,channelsRefreshSessions:`Refresh`,channelsRefreshSessionsHint:`Reload recent sessions for this channel`,channelsLoadingSessions:`Loading sessions…`,channelsPeerFromSessions:`From sessions`,channelsPeerAny:`All traffic on this channel`,channelsNoSessionsHint:`No session history for this channel yet. Send a message or enter a custom peer id below.`,channelsCustomPeerHint:`If set, overrides the session picker. Supports * globs; see session routing docs.`,channelsCustomPeerPlaceholder:`e.g. 12345 or *`,addBinding:`Add binding`,removeBinding:`Remove`,cronTitle:`Scheduled jobs`,cronHint:`Isolated cron jobs can pin an agent id for the session key. Jobs without an agent id use the default agent and appear when that agent is selected.`,cronLoading:`Loading cron jobs…`,cronNone:`No matching jobs.`,cronColSchedule:`Schedule`,cronColMessage:`Message`,cronColSession:`Session`,cronColAgent:`Agent`,cronAgentDefault:`Default agent`,cronAgentClear:`Reset to default`,navIdentity:`Identity`,navProfile:`About You`,navPersona:`Persona`,navTools:`Tools`,navSkills:`Skills`,navCoreFiles:`Core files`,navAdvanced:`Advanced`,listSearchPlaceholder:`Search by name, id, or workspace`,listEmpty:`No agents match your search.`,listNoAgentsYet:`No agents yet. Create one to get started.`,listNewAgentCard:`New agent`,listChatWithAgent:`Chat`,editorNavAria:`Agent editor sections`,skillsLibraryLink:`Skill library`,personaHint:`Set up your agent's identity and personality with a friendly form. For advanced editing, use Core files.`,personaSectionIdentity:`Agent Identity`,personaSectionIdentityHint:`How your agent presents itself`,personaSectionUser:`About You`,personaSectionUserHint:`Help your agent know you better`,personaSectionSoul:`Personality & Style`,personaSectionSoulHint:`Define how your agent communicates`,personaName:`Name`,personaNamePlaceholder:`e.g. Aria, Nova, Kai…`,personaCreature:`Type`,personaCreaturePlaceholder:`Custom type…`,personaVibe:`Vibe`,personaVibePlaceholder:`Custom vibe…`,personaEmoji:`Emoji`,personaEmojiPlaceholder:`e.g. 🤖 ✨ 🧠`,personaAvatar:`Avatar`,personaAvatarPlaceholder:`URL or workspace path`,personaCallName:`What to call you`,personaCallNamePlaceholder:`e.g. Michael`,personaPronouns:`Pronouns`,personaPronounsPlaceholder:`e.g. he/him, she/her, they/them`,personaTimezone:`Timezone`,personaTimezoneDetect:`Detect`,personaTimezoneCustom:`Custom timezone…`,personaNotes:`Notes`,personaNotesPlaceholder:`Anything else your agent should know about you…`,personaSoulTemplate:`Personality template`,personaSoulCustomEdit:`Edit personality (Markdown)`,personaSoulPreview:`Preview`,personaSoulEdit:`Edit`,personaMemoryNote:`Your agent will automatically remember preferences you share in conversation (like favorite foods or habits). No need to add those here.`,personaSaving:`Saving…`,personaSaved:`Saved`,footerSaveNotApplicable:`Use actions in this section; the bar Save applies to Identity, Tools, Skills, and Core files.`},providersSettings:{subtitle:`Provider API keys and OAuth. Keys you save here go to the gateway credential store.`,intro:`Search or open a group, expand a provider, paste a new key, then Save changes. OAuth opens in your browser when you choose it.`,docsLink:`Model & provider docs`,modelsLink:`Custom providers (models.json)`,rotateHint:`Rotating a key: expand the provider, paste the new secret, Save changes — no restart needed.`,needToken:`Save a gateway token to manage provider credentials.`,loadError:`Failed to load providers`,save:`Save changes`,saving:`Saving…`,saved:`Saved`,noChangesSaved:`No new keys to save.`,saveError:`Failed to save`,empty:`No providers available.`,searchPlaceholder:`Search OpenAI, Claude, Gemini…`,getApiKey:`Get API Key`,getApiKeyIntl:`Get API Key (International)`,getApiKeyCn:`Get API Key (China)`,savedModelsAvailable:`models available`,savedNoModels:`Configured — no models listed yet`,envVarAlt:`Or set via environment variable`,unconfiguredOnly:`Unconfigured only`,noMatches:`No providers match your filters.`,clearFilters:`Clear filters`,discard:`Discard`,unsavedHint:`You have unsaved changes.`,runtimeLabelPrefix:`Runtime credential:`,sourceAgent:`agent private profile`,sourceGateway:`saved in gateway (this console)`,sourceOauth:`OAuth token`,sourceEnv:`environment variable`,sourceModelsJson:`models.json`,sourceExtension:`extension provider`,sourceNone:`none`,testKey:`Test value`,testingKey:`Testing…`,testOkLiteral:`Value accepted (direct key or text).`,testOkEnv:`Environment variable resolves.`,testOkCommand:`Command resolved successfully.`,testFailed:`Check failed.`,revokeFailed:`Revoke failed.`,expandRowDetails:`Show credential fields`,categories:{common:`Common providers`,specialty:`Specialty providers`,enterprise:`Enterprise / cloud`,oauth:`OAuth only`,extension:`Extensions`},configuredCount:`{{count}} configured`,metaMasked:`Credential on file — enter a new key to replace.`,metaWillSave:`API key will be saved when you click Save changes.`,metaNotConfigured:`Not configured.`,placeholderKey:`API key`,placeholderKeep:`Leave empty to keep current`,placeholderOverride:`Enter new key to override`,show:`Show`,hide:`Hide`,copy:`Copy`,copied:`Copied`,oauth:`OAuth`,revoke:`Revoke`,revokeConfirm:`Revoke OAuth credentials for "{{name}}"?`,oauthStarting:`Starting OAuth…`,oauthProcessingCode:`Processing authorization…`,openAuthPage:`Open auth page`,cancelOAuth:`Cancel`,pasteRedirectUrl:`Paste full redirect URL (e.g. http://127.0.0.1:…/oauth-callback?code=…&state=…)`,submitCode:`Submit`,envHint:`API key is set via environment variable. Enter a new key above to override.`,maskedStoredHint:`Stored credential is not shown. Enter a new key above to replace it.`,oauthHint:`Use OAuth for secure authentication, or enter an API key manually.`},modelsSettings:{needToken:`Save a gateway token to edit models.json.`,subtitle:`Custom providers and models (models.json). Changes apply after save; reload picks up disk edits.`,docsLink:`Model & provider docs`,loadError:`Failed to load models.json`,loadFileWarning:`File warning`,filePath:`Path`,addProvider:`Add provider`,validate:`Validate`,validating:`Validating…`,validateError:`Validation request failed`,save:`Save`,saving:`Saving…`,saved:`Saved`,saveError:`Failed to save`,reload:`Reload`,reloading:`Reloading…`,reloadError:`Reload failed`,showJson:`Show JSON`,hideJson:`Hide JSON`,statsProviders:`{{count}} providers`,statsModels:`{{count}} models`,unsavedHint:`You have unsaved changes.`,loading:`Loading…`,jsonParseError:`Invalid JSON`,jsonReset:`Reset from editor`,jsonApply:`Apply JSON`,emptyTitle:`No custom providers`,emptyDesc:`Add OpenAI-compatible endpoints (Ollama, LM Studio, OpenRouter, vLLM, etc.) and optional per-model overrides.`,emptyCta:`Add your first provider`,presetOllama:`Ollama`,presetLmStudio:`LM Studio`,presetOpenRouter:`OpenRouter`,presetZhipuCn:`Zhipu GLM (China · Coding API)`,presetZaiGeneral:`Zhipu GLM (International · general API)`,presetLabel:`Preset`,presetCustom:`Custom`,addProviderTitle:`Add provider`,addProviderSubtitle:`Provider id must be unique (e.g. ollama, my-openai).`,providerIdLabel:`Provider ID`,providerIdPlaceholder:`e.g. ollama`,providerIdRequired:`Provider ID is required`,addProviderConfirm:`Add provider`,cancel:`Cancel`,close:`Close`,baseUrl:`Base URL`,apiType:`API type`,apiKey:`API key`,apiKeyPlaceholder:`sk-…, ENV_VAR, or !command`,apiKeyHint:`Literal key, ENV name (uppercase), or shell command prefixed with !`,authHeader:`Send Authorization header automatically`,testKey:`Test`,show:`Show`,hide:`Hide`,badgeShell:`shell`,badgeEnv:`env`,badgeLiteral:`literal`,removeProvider:`Remove provider`,removeProviderConfirm:`Remove provider "{{id}}" and its models?`,modelsSection:`Models`,modelsEmpty:`No custom models; built-in defaults apply where available.`,addModel:`Add model`,editModel:`Edit model`,removeModel:`Remove model`,removeModelConfirm:`Remove model "{{id}}"?`,addModelTitle:`Add model`,editModelTitle:`Edit model`,modelProviderLabel:`Provider`,modelId:`Model ID`,displayName:`Display name`,inputTypes:`Input types`,inputTextOnly:`Text only`,inputTextVision:`Text + vision`,reasoning:`Supports reasoning`,contextWindow:`Context window`,maxOutputTokens:`Max output tokens`,costSection:`Cost (per 1M tokens)`,costInput:`Input`,costOutput:`Output`,modelIdRequired:`Model ID is required`,mustBePositive:`Must be greater than 0`,addModelConfirm:`Add model`,saveModelConfirm:`Save changes`,validationErrors:`Validation issues`,validationWarnings:`Warnings`,testError:`Error`,testOk:`Resolved`},channelsSettings:{needToken:`Save a gateway token to edit channel settings.`,subtitle:`Telegram, Weixin, and Feishu inbound channels. Changes are written to the gateway config file.`,docsLink:`Channel documentation`,refresh:`Refresh`,loadError:`Failed to load channel settings`,loading:`Loading…`,save:`Save changes`,saving:`Saving…`,saved:`Saved`,saveError:`Failed to save`,retry:`Retry`,unsavedHint:`You have unsaved changes.`,hubConfigureButton:`Configure`,hubConnectedBadge:`Connected`,enableChannelAria:`Enable or disable this channel`,menuMoreAria:`More actions`,menuEditConfig:`Edit configuration`,menuRemoveConfig:`Remove configuration`,removeChannelTitle:`Remove configuration?`,removeChannelConfirm:`Remove {{name}} settings and clear saved credentials on the gateway? You can configure again later.`,removeChannelAction:`Remove`,modalCancel:`Cancel`,telegramTitle:`Telegram`,telegramSubtitle:`Bot token, allowlists, and optional multi-account JSON.`,weixinTitle:`Weixin`,weixinSubtitle:`Sign in with WeChat via QR (browser or CLI), then enable below. Credentials stay on the gateway host.`,feishuTitle:`Feishu/Lark`,feishuSubtitle:`Feishu app credentials, policies, and optional multi-account JSON.`,enableTelegramAria:`Enable Telegram channel`,enableWeixinAria:`Enable Weixin channel`,enableFeishuAria:`Enable Feishu channel`,telegramToken:`Bot token`,telegramTokenDesc:`From BotFather. Stored in the gateway config.`,feishuAppId:`App ID`,feishuAppIdDesc:`From Feishu developer console (cli_xxx). Stored in the gateway config.`,feishuAppSecret:`App secret`,feishuAppSecretDesc:`From Feishu developer console. Stored in the gateway config.`,feishuDomain:`Domain`,connectionMode:`Connection mode`,connectionModeDesc:`websocket: Socket Mode. webhook: local HTTP server receives events.`,renderMode:`Render mode`,enableStreaming:`Enable streaming`,requireMention:`Require @mention in groups`,reactionNotifications:`Reaction notifications`,allowFromDm:`Allow from (DM)`,allowFromDmDesc:`Comma-separated user IDs allowed to DM the bot (when policy uses allowlist).`,advancedShow:`Advanced options`,advancedHide:`Hide advanced options`,apiRoot:`API root`,proxy:`Proxy`,dmPolicy:`DM policy`,groupPolicy:`Group policy`,replyToMode:`Reply-to mode`,streamMode:`Stream mode`,allowFromGroups:`Allow from (groups)`,allowFromGroupsDesc:`Comma-separated group chat IDs (when group policy is allowlist).`,historyLimit:`History limit`,textChunkLimit:`Text chunk limit`,telegramDebug:`Debug mode`,multiAccountJson:`Multi-account (JSON)`,multiAccountJsonDesc:`Optional. Per-account botToken or tokenFile, policies, and groups. Empty {} uses the single token above only.`,weixinQuickStartTitle:`Quick start`,weixinStepLogin:`Use “Sign in with WeChat (QR)” below in this console, or see Channel documentation for CLI login.`,weixinStepEnable:`Turn on Weixin below and save.`,weixinStepPairing:`After QR login, DMs work immediately. Use allowlist DM policy only if you want to restrict who can message the bot.`,weixinAdvancedHint:`Optional: allowlist, route tag, streaming, and per-account JSON—only if you need them.`,weixinAllowFrom:`Allow from`,weixinAllowFromDesc:`When DM policy is allowlist: comma-separated wxid / openid. Default pairing allows all contacts after QR login.`,weixinRouteTag:`Route tag`,weixinRouteTagDesc:`Optional tag for routing; numeric or string.`,routeTagPlaceholder:`e.g. tag name or number`,weixinDebug:`Debug mode`,weixinDebugDesc:`Extra logging for the Weixin channel.`,weixinAccountsJson:`Accounts (JSON)`,weixinAccountsJsonDesc:`Per-account name, CDN base URL, route tag, and policies.`,weixinQrLoginTitle:`Browser QR login`,weixinQrLoginDesc:`Starts a login on the gateway. Scan with WeChat; when it succeeds, settings refresh automatically.`,weixinQrLoginButton:`Sign in with WeChat (QR)`,weixinQrLoginBusy:`Starting…`,weixinQrLoginScanned:`Scanned — confirm in WeChat`,weixinQrLoginSuccess:`Weixin connected.`,weixinQrLoginCancel:`Dismiss QR`,weixinQrImageError:`Could not render the QR code here. You can open the link in a new tab, or tap Regenerate to try again.`,weixinQrOpenLink:`Open in new tab`,weixinQrEncoding:`Rendering QR…`,weixinQrModalTitle:`Scan to sign in`,weixinQrModalSubtitle:`Use WeChat to scan the QR code below to connect.`,weixinQrRegenerate:`Regenerate QR code`,weixinQrModalCloseAria:`Close`,agentRoutingTitle:`Agent routing`,agentRoutingHint:"Maps each channel account to an agent via config `bindings`. Inbound messages use a session key for that agent.",agentRoutingAccountLabel:`Account`,agentRoutingAgentLabel:`Agent`,jsonObjectAccounts:`Accounts must be a JSON object`,jsonInvalid:`Invalid JSON`,copy:`Copy`,copied:`Copied`,show:`Show`,hide:`Hide`,webhookTitle:`Webhook settings`,verificationToken:`Verification token`,verificationTokenDesc:`From Feishu event subscription settings (webhook mode).`,encryptKey:`Encrypt key`,encryptKeyDesc:`From Feishu event subscription settings (webhook mode).`,webhookHost:`Webhook host`,webhookPort:`Webhook port`,webhookPath:`Webhook path`,webhookPathDesc:`Request URL path configured in Feishu event subscription.`,feishuToolsTitle:`Feishu tools`,feishuToolsDesc:`Enable only what you need. Each tool may require additional app scopes.`,feishuToolDoc:`Doc (feishu_doc)`,feishuToolWiki:`Wiki (feishu_wiki)`,feishuToolDrive:`Drive (feishu_drive)`,feishuToolPerm:`Permissions (feishu_perm)`,feishuToolBitable:`Bitable (feishu_bitable_*)`,feishuToolScopes:`Scopes check (feishu_app_scopes)`,feishuActionsTitle:`Feishu actions`,feishuActionReactions:`Enable reaction actions`,policy:{dm:{pairing:`Pairing`,allowlist:`Allowlist`,open:`Open`,disabled:`Disabled`},group:{open:`Open`,disabled:`Disabled`,allowlist:`Allowlist`},reply:{off:`Off`,first:`First`,all:`All`},stream:{off:`Off`,partial:`Partial`,block:`Block`}}},voiceSettings:{needToken:`Save a gateway token to edit voice settings.`,subtitle:`Speech-to-text and text-to-speech for channels. Keys can also be set via environment variables.`,docsLink:`Voice documentation`,loadError:`Failed to load voice settings`,loading:`Loading…`,save:`Save changes`,saving:`Saving…`,saved:`Saved`,saveError:`Failed to save`,retry:`Retry`,unsavedHint:`You have unsaved changes.`,stt:{title:`Speech-to-text (STT)`,description:`Transcribe inbound voice using Alibaba DashScope or OpenAI Whisper.`,enable:`Enable STT`,enableDesc:`When on, voice messages can be transcribed for the agent.`,provider:`STT provider`,alibaba:`Alibaba DashScope`,openai:`OpenAI`,apiKey:`API key`,apiKeyDesc:`Optional if the key is already in the environment.`,model:`Model`,fallback:`Fallback between providers`,fallbackDesc:`Try the other provider if the primary request fails.`},tts:{title:`Text-to-speech (TTS)`,description:`Synthesize assistant replies as audio when enabled.`,enable:`Enable TTS`,enableDesc:`When on, TTS runs according to the trigger mode below.`,trigger:`Trigger`,triggerOff:`Off`,triggerAlways:`Always`,triggerInbound:`Inbound voice only`,triggerTagged:`Tagged ([[tts]])`,triggerDescOff:`TTS is completely disabled.`,triggerDescAlways:`Apply TTS to all assistant messages.`,triggerDescInbound:`Only reply with voice when the user sends voice.`,triggerDescTagged:`Only when the [[tts]] directive is used.`,provider:`TTS provider`,providerOpenai:`OpenAI TTS`,providerEdge:`Microsoft Edge (free)`,voice:`Voice`,edgeHint:`Microsoft Edge TTS — no API key required.`},notes:{title:`Note`,duration:`Long audio is split automatically; quality depends on provider and model.`,envVars:`Environment variables: DASHSCOPE_API_KEY, OPENAI_API_KEY (when not set in this form).`}},gatewaySettings:{needToken:`Save a gateway token to load and edit gateway options.`,subtitle:`HTTP API access token and listen address. Values are stored in the gateway config file.`,docsLink:`Gateway documentation`,loadError:`Failed to load gateway settings`,loading:`Loading…`,save:`Save changes`,saving:`Saving…`,saved:`Saved`,saveError:`Failed to save`,retry:`Retry`,unsavedHint:`You have unsaved changes.`,tokenExpired:`Your session token was rejected. Update the client token or fix the access token in config.`,updateToken:`Update client token`,changeToken:`Open token dialog`,accessToken:`Gateway access token`,tokenPlaceholder:`Token stored in config (optional if using env)`,tokenHelp:`Used to authenticate HTTP/WebSocket API requests. You can also set XOPC_GATEWAY_TOKEN.`,copy:`Copy`,copied:`Copied`,show:`Show`,hide:`Hide`,listenHost:`Listen address`,listenPort:`Port`,listenHint:`Effective after gateway restart if changed outside this UI.`,authModeNone:`Auth mode is set to none — token in config may be ignored.`},heartbeatSettings:{needToken:`Save a gateway token to load and edit heartbeat options.`,subtitle:`Periodic agent wake, optional delivery to a channel, and HEARTBEAT.md in your workspace. Stored in the gateway config file and workspace.`,docsLink:`Heartbeat documentation`,loadError:`Failed to load heartbeat settings`,loading:`Loading…`,saveConfig:`Save configuration`,savingConfig:`Saving…`,savedConfig:`Configuration saved`,saveConfigError:`Failed to save configuration`,triggerNow:`Run now`,triggering:`Queuing…`,triggered:`Heartbeat queued`,triggerError:`Failed to trigger heartbeat`,triggerHint:`Queues one heartbeat run (same as the timer). Skipped if HEARTBEAT.md is empty, outside active hours, or heartbeat is disabled.`,saveDoc:`Save HEARTBEAT.md`,savingDoc:`Saving…`,savedDoc:`Document saved`,saveDocError:`Failed to save HEARTBEAT.md`,retry:`Retry`,unsavedConfig:`You have unsaved configuration changes.`,unsavedDoc:`You have unsaved changes to HEARTBEAT.md.`,workspaceLabel:`Workspace`,configSection:`Heartbeat configuration`,docSection:`HEARTBEAT.md`,docHint:`Tasks and reminders read by the agent on each heartbeat. Leave empty or comment-only to skip LLM calls and save tokens.`,enable:`Enable heartbeat`,interval:`Interval`,intervalHint:`Minimum 1 second. Saved to the gateway as milliseconds.`,intervalHintPreset:`Quick preset or type seconds in the field.`,intervalSecondsLabel:`Seconds`,intervalPresets:{custom:`Custom`,every30s:`Every 30 seconds`,every1min:`Every 1 minute`,every5min:`Every 5 minutes`,every10min:`Every 10 minutes`,every15min:`Every 15 minutes`,every30min:`Every 30 minutes`,every1h:`Every 1 hour`,every2h:`Every 2 hours`},deliveryTitle:`Delivery (optional)`,channelNone:`— None —`,customChannelSuffix:`custom`,deliveryHint:`Both channel and chat id are required to send non-silent replies somewhere. Otherwise the reply is only logged.`,prompt:`Custom system prompt (optional)`,promptPlaceholder:`Override the default heartbeat instruction…`,promptHint:`Leave empty to use the built-in default prompt.`,ackMaxChars:`Max reply length before treating as silent (ackMaxChars)`,ackMaxCharsHint:`Leave empty for server default (300).`,ackDefaultPlaceholder:`Default`,isolatedSession:`Use a fresh session key each run`,isolatedSessionHint:`Avoids mixing heartbeat context with the main chat session.`,activeHoursTitle:`Active hours (optional)`,activeStart:`Start`,activeEnd:`End`,activeTimezone:`Timezone (IANA)`,activeHoursHint:`Restrict heartbeats to this window. Clear to run any time.`,addActiveHours:`Add active hours`,clearActiveHours:`Clear active hours`},webSearchSettings:{title:`Web search`,subtitle:`Configure region and search providers for the web_search tool. Without API keys, a built-in HTML fallback is used.`,docsLink:`Gateway documentation`,needToken:`Save a gateway token to edit web search settings.`,loading:`Loading…`,loadError:`Failed to load web search settings`,save:`Save`,saving:`Saving…`,saved:`Saved`,saveError:`Failed to save`,unsavedHint:`You have unsaved changes.`,sectionRegion:`Region`,sectionRegionHint:`Controls which zero-config HTML fallback is used when no API provider succeeds (China → Bing; otherwise DuckDuckGo).`,sectionSearch:`Search providers`,sectionSearchHint:`Providers are tried in order. Keys are stored in the gateway config file. Leave the list empty to use only the HTML fallback.`,regionLabel:`Fallback region`,regionDesc:`Auto uses your system timezone. Override if you are on a VPN or need a specific fallback.`,regionAuto:`Auto (timezone)`,regionCn:`China (Bing HTML fallback)`,regionGlobal:`Global (DuckDuckGo HTML fallback)`,maxResultsLabel:`Default max results`,maxResultsDesc:`Used when the model does not pass a count (1–50).`,providersTitle:`Providers (ordered)`,addProvider:`Add provider`,apiKeyLabel:`API key`,apiKeyDesc:`Optional for some setups. Leave masked to keep the saved value.`,urlLabel:`Instance URL`,urlDesc:`SearXNG base URL (e.g. http://localhost:8080). No trailing slash required.`,keyPlaceholder:`API key or env var name`,keyPlaceholderMasked:`•••••••• (unchanged)`,disabled:`Skip`,footerHint:`HTML fallbacks depend on third-party pages and may change. For production, use a supported search API (Brave, Tavily, Bing, or self-hosted SearXNG).`,providerTypes:{brave:`Brave Search API`,tavily:`Tavily`,bing:`Bing Web Search API`,searxng:`SearXNG`}},appearanceSettings:{pageTitle:`Preferences`,subtitle:`Language, appearance, and text size for daily use. Stored in this browser only.`,languageTitle:`Language`,languageDescription:`Choose the interface language.`,themeTitle:`Theme`,themeDescription:`Light, dark, or follow your system setting.`,colorSchemeTitle:`Color scheme`,colorSchemeDescription:`Visual style of the interface.`,colorSchemeDefault:`Default`,colorSchemeLightGreen:`Light green`,fontScaleTitle:`Conversation text size`,fontScaleDescription:`Adjust text size in chat and reading areas.`,fontScaleCompact:`Small`,fontScaleDefault:`Medium`,fontScaleLarge:`Large`,langOptionEn:`English`,langOptionZh:`中文`,themeOptionLight:`Light`,themeOptionDark:`Dark`,themeOptionSystem:`System`,openFullPreferences:`Open all settings`,quickMenuHint:`Language, theme, and text size`,aboutApp:`About`},updatePanel:{restartToUpdate:`Restart to update`,dismissAria:`Dismiss`,dismissHint:`Do not show this reminder again for this version`,reminderElectronReady:`Update v{{version}} is ready. Restart the app to install.`,reminderDownloading:`Downloading update… {{percent}}%`,reminderNpm:`A new version v{{version}} is available for the gateway.`,updateNow:`Update now`,updateRunning:`Updating…`,updateSuccess:`Update installed`,updateSuccessDetail:`Restart the gateway to use the new version (for example: xopc gateway restart).`,updateErrorGit:`One-click update unavailable`,updateErrorBusy:`An update is already in progress`,updateErrorFailed:`Update failed`},aboutDialog:{windowTitle:`About this application`,close:`Close`,versionLabel:`Version`,commitLabel:`Commit`,buildDateLabel:`Date`,gatewayVersionLabel:`Gateway`,consoleBuildHint:`Console UI build (this browser bundle). Gateway is the running xopc service.`,checkUpdates:`Check for updates`,gatewayUnavailable:`—`,openSourceLead:`This software is made possible by `,openSourceLink:`open source software`,copyright:`Copyright © {year} xopcai`}},Dt={appBrand:`XOPC`,sidebarCollapse:`收起侧边栏`,sidebarExpand:`展开侧边栏`,closeMenu:`关闭菜单`,openMenu:`打开菜单`,appBarPreferences:`语言与主题`,nav:{chat:`对话`,management:`管理`,settings:`设置`,sessions:`会话`,cron:`定时任务`,skills:`技能`,channels:`消息通道`,agents:`智能体`,apps:`应用`,logs:`日志`,settingsAppearance:`偏好设置`,settingsProviders:`服务商`,settingsModels:`模型`,settingsChannels:`消息通道`,settingsVoice:`语音`,settingsGateway:`网关`,settingsHeartbeat:`心跳`,settingsSearch:`网络搜索`,settingsAgentDefaults:`智能体默认配置`,settingsAgents:`智能体`,settingsSystem:`系统设置`},appsPage:{title:`应用`,subtitle:`网关已发现的扩展统一展示;点开卡片查看说明,并可对内置扩展启用或停用。`,empty:`未发现扩展。`,tabAll:`全部`,tabWithUi:`带界面`,tabBackend:`仅后端`,searchPlaceholder:`搜索应用`,noSearchResults:`没有符合筛选的应用。`,statusEnabled:`已启用`,cardNoDescription:`清单中无描述。`,badgeKindUi:`界面`,badgeKindBackend:`后端`,badgeBundled:`内置`,detailTitle:`应用详情`,detailBack:`返回`,detailClose:`关闭`,detailProviderPrefix:`来源:`,providerBundled:`内置(随 xopc 分发)`,providerGlobal:`全局安装(~/.xopc/extensions)`,providerWorkspace:`工作区(.extensions)`,providerOther:`其他`,detailSectionFeatures:`应用能力`,detailNoDescription:`该扩展未提供描述。`,actionEnable:`启用`,actionDisable:`停用`,restartNote:`内置开关会写入配置;重启网关进程后扩展代码才会完整加载或卸载。`,cliManageHint:`非内置副本需通过 CLI 或文件系统安装、升级与卸载。`,backendOnlyHint:`该扩展无网关控制台界面;启用后工具与钩子仍会运行。`,badgePages:`{{count}} 个页面`,badgeSettings:`{{count}} 个设置`,badgeWidgets:`{{count}} 个聊天挂件`,badgeSidebar:`{{count}} 个侧栏`,open:`打开`,openSettings:`设置`,runStateLive:`运行中`,runStatePendingOn:`配置已启用`,runStatePendingOff:`配置已停用`,runStateOff:`已关闭`,toggleSaving:`保存中…`,toggleError:`无法更新该扩展。`},extensionUi:{permissionTitle:`是否允许「{{name}}」?`,permissionSubtitle:`在扩展界面打开期间,它可能使用以下能力。`,permissionsNone:`清单中未声明额外权限。`,allow:`允许`,deny:`暂不`,deniedHint:`在你批准之前,此浏览器将不显示该扩展的界面。`,reviewPermissions:`查看权限`,loadFailed:`扩展面板加载失败。`,loadFailedConnectionHint:`若内嵌区域提示无法连接 localhost,请先启动 xopc 网关;若用 Vite 单独跑 web/,请确认 web/vite.config.ts 里代理的网关端口与正在运行的网关一致。`,retryLoad:`重新加载`},extensionDebug:{nav:`扩展调试`,title:`扩展调试`,subtitle:`查看网关发现的扩展、声明的权限,以及本机浏览器中对界面授权的存储。`,grantsHeading:`界面授权存储`,grantsHint:"localStorage 键 `xopc.extensionUiGrants.v1` — 已同意的权限列表指纹(按扩展)。",refresh:`刷新`,listHeading:`网关返回的扩展`,colId:`标识`,colName:`名称`,colPermissions:`清单权限`,futureHeading:`后续计划`,futureBody:`后续将支持 postMessage 捕获、按扩展查看存储,以及更细的权限调试。`},settingsSections:{appearance:`偏好设置`,agent:`智能体`,"agent-defaults":`智能体默认配置`,providers:`服务商`,models:`模型`,channels:`消息通道`,voice:`语音`,gateway:`网关`,heartbeat:`心跳`,search:`网络搜索`,agents:`智能体`,system:`系统设置`},systemSettings:{title:`系统设置`,behaviorGroup:`应用行为`,subtitle:`支持 Windows、macOS、Linux 桌面:自启动、防睡眠、通知偏好,以及各系统的相关设置入口。`,desktopOnlyTitle:`仅桌面端`,desktopOnlyBody:`系统集成功能仅在 xopc Electron 桌面版中可用。在浏览器中请通过操作系统设置管理。`,toggles:{openAtLogin:`开机自动启动`,openAtLoginDesc:`登录本机用户时自动启动 xopc。`,keepAwake:`保持系统唤醒`,keepAwakeDesc:`开启后请求系统保持唤醒,减少因空闲睡眠中断长时间任务。`,notifyDesktop:`桌面通知`,notifyDesktopDesc:`在后续版本接入系统通知时生效(当前仅保存偏好)。`,notifySound:`声音通知`,notifySoundDesc:`在实现通知时是否播放提示音(需同时启用桌面通知相关实现)。`},permissionsTitle:`系统权限`,permissionsHint:`状态为尽量检测,修改系统设置后请刷新或重新进入本页。`,permissionsHintDarwin:`macOS 的隐私/媒体状态为尽量检测。修改系统设置后请用「刷新状态」或再次进入本页。`,permissionsHintWin:`在 Windows 上,麦克风和(如系统可报告)录屏等能力受系统级开关影响;每个按钮会打开系统「设置」中的相关页面。`,permissionsHintLinux:`Linux 上此处不显示各权限的准确状态。会尝试打开桌面环境设置,失败时打开说明文档。请在发行版/Flatpak/ portal 中授予「文件、麦克风、通知」等。`,status:{granted:`已授权`,denied:`未授权`,unknown:`未知`},openSettings:`去设置`,refresh:`刷新状态`,perm:{fullDisk:{title:`文件与磁盘访问`,desc:`在需要时访问工作区、用户目录等(具体名称因系统而异)。`},screen:{title:`录屏`,desc:`在应用内浏览器外进行整屏/窗口采集、供视觉类能力使用。`},microphone:{title:`麦克风`,desc:`在对话和语音能力中录音。`},accessibility:{title:`辅助功能`,desc:`使用全局快捷键及辅助功能相关能力。`},automation:{title:`自动操作 / 与系统集成`,desc:`与其他应用或系统能力协作(在 macOS 上对应自动化与隐私;在 Windows 上为默认应用等;Linux 为桌面/portal 能力)。`},notifications:{title:`通知`,desc:`在系统「通知」或本应用项中允许通知,以便任务完成时提示。`},location:{title:`位置`,desc:`在提供地理位置相关任务时获取位置信息。`}}},settingsNavGroups:{gateway:`连接与服务`,agentAndModels:`服务商与模型`,data:`会话与日志`,interface:`通用`,voice:`语音`,extensions:`扩展`},token:{title:`需要身份验证`,description:`请输入网关访问令牌以继续。`,gatewayUrl:`网关地址`,tokenLabel:`访问令牌`,placeholder:`网关访问令牌(例如 ea4c67bf…)`,save:`保存`,show:`显示`,hide:`隐藏`},gatewayLanding:{headline:`连接网关`,subline:`网页控制台需使用与网关相同的访问令牌。请从初始化向导或配置文件中获取,并在下方粘贴。`,sessionExpired:`登录已失效或访问令牌被拒绝,请重新输入有效的网关访问令牌。`,stepOnboard:`在终端运行 xopc onboard(或 xopc onboard --gateway)并启用网页控制台,向导会打印访问令牌。`,stepPaste:`将访问令牌粘贴到下方并保存。也可直接打开向导给出的带 ?token= 的链接。`,stepUrlHint:`若使用带 ?token= 的链接打开,访问令牌会自动保存(随后地址栏会去掉参数)。`,docsGatewayLink:`网关说明`},electron:{setupBannerTitle:`完成设置后即可对话`,setupBannerBody:`请至少配置一家模型服务商的 API 密钥,并选择默认模型。之后可随时在设置中修改。`,setupBannerLinkProviders:`服务商与密钥`,setupBannerLinkModels:`默认模型`,setupBannerDismiss:`不再提示`,gatewayExitTitle:`本地网关已停止`,gatewayExitBody:`助手后端进程异常退出,请重启应用后再试。`},connection:{connecting:`连接中…`,online:`在线`,reconnecting:`重连中…`,offline:`离线`,error:`连接异常`,reconnect:`重连`},api:{errorBadGateway:`网关错误 (502)`,errorServiceUnavailable:`服务不可用 (503)`,errorGatewayTimeout:`网关超时 (504)`,errorInternal:`服务器内部错误 (500)`,errorServer:`服务器错误 ({{status}})`,errorNotFound:`未找到 (404)`,errorForbidden:`禁止访问 (403)`,errorRequest:`请求失败 ({{status}})`},sidebar:{newTask:`新建对话`,tasksHeading:`对话`,viewAllSessions:`全部会话`,taskListEmpty:`暂无会话`,taskListNeedToken:`保存网关访问令牌后即可在此查看最近会话。`,taskListAddToken:`填写访问令牌`,taskListStartChat:`开始对话`,appMenuAria:`应用菜单与设置`,taskSessionMenuAria:`会话操作`,taskRename:`重命名`,taskCopyChatId:`复制会话 ID`,taskDeleteTask:`删除对话`,taskRenameTitle:`重命名对话`,taskRenamePlaceholder:`会话名称`,taskRenameSave:`保存`,taskRenameCancel:`取消`,backToApp:`返回应用`,backToAgents:`返回智能体`,back:`返回`,helpDocs:`帮助文档`,sessionChannelFilterAria:`按来源筛选:网页对话或消息通道`,sessionTasksTab:`对话`,sessionChannelsTab:`消息通道`,resizeHandleAria:`调整左侧导航宽度`},chat:JSON.parse(`{"typeMessage":"输入消息…","sendMessage":"发送","abort":"停止","needToken":"请先保存网关访问令牌后再对话。","loading":"加载对话中…","model":"模型","modelPlaceholder":"选择模型…","agent":"智能体","agentPlaceholder":"选择智能体…","agentSearchPlaceholder":"搜索智能体…","agentNoMatches":"没有匹配的智能体","thinkingLevel":"思考级别","newSession":"新对话","welcomeTitle":"欢迎使用 xopc","welcomeDescription":"在下方输入消息开始对话","welcomeSpotlight":{"headline":"超级个体的 AI 执行台","tagline":"本地可跑的 AI:接任务、拆步骤、落地执行,把脑力留给决策。","categories":[{"id":"files","icon":"folder","title":"文件整理","description":"下载目录、相册与附件","scenarios":[{"prompt":"扫描我的 Downloads 文件夹,按内容哈希找出重复文件,列出每组重复项的路径与修改时间,并建议只保留最新一份。"},{"prompt":"查看我桌面上的文件,按类型(文档、图片、音视频、压缩包、表格)规划子文件夹结构,并给出可执行的整理步骤(先说明再动手)。"},{"prompt":"在工作区里的相册目录读取照片 EXIF(拍摄时间、GPS 或地点字段),生成统一重命名规则,格式为「YY-MM-DD 地点-序号」,并标出缺少 EXIF 的文件。"}]},{"id":"research","icon":"globe","title":"研究与搜索","description":"网络搜索、对比分析、事实核查","scenarios":[{"prompt":"搜索 [主题] 的最新资讯和发展动态,整理要点并注明信息来源。"},{"prompt":"对比 [A] 和 [B] 在 [使用场景] 上的优劣,用表格列出并给出选择建议。"},{"prompt":"核查以下文本中声明的准确性:指出不确定的表述,并建议如何验证。"}]},{"id":"content","icon":"content","title":"内容创作","description":"纪要、简报与文案","scenarios":[{"prompt":"阅读我工作区里最近一次会议的 Markdown/TXT 纪要,提取决议、待办与负责人;待办写成可勾选清单,并标出信息不全的项。"},{"prompt":"根据工作区 notes 目录下的零散记录,写一份「今日/本周简报」大纲:今日日程要点、跟进事项、风险与阻塞,语气适合发给自己或团队。"},{"prompt":"把我选定的一篇长文或技术笔记改写成 5 条社交媒体短帖(不同角度:问题引入、要点列表、金句、投票提问、资源推荐),每条控制在平台适合长度。"}]}]},"you":"你","assistant":"助手","tool":"工具","thinkingLabel":"思考中…","thoughts":"思考内容","thoughtsStreaming":"思考中…","thoughtsExpandHint":"展开查看模型思考过程","thinkingLevels":{"off":"关闭","minimal":"最低","low":"低","medium":"中","high":"高","xhigh":"极高","adaptive":"自适应"},"toolInput":"输入","toolOutput":"输出","noOutput":"(无输出)","viewSteps_one":"查看 {{count}} 步","viewSteps_other":"查看 {{count}} 步","stepSearchedWeb":"搜索网页","stepReadFile":"读取文件","stepDetails":"详情","stepRunCommand":"运行命令","stepListDirectory":"查看文件夹内容","stepWriteFile":"保存文件","stepEditFile":"修改文件","stepOpenUrl":"打开链接","stepFetchUrl":"获取网页内容","stepUnknownTool":"执行:{{name}}","composerRunStatusSending":"发送中…","composerRunStatusDefault":"处理中…","composerRunningTool":"执行:{{name}}","composerStageThinking":"思考中…","composerStageSearching":"搜索中…","composerStageReading":"阅读中…","composerStageWriting":"撰写中…","composerStageExecuting":"执行中…","composerStageAnalyzing":"分析中…","attachFile":"添加附件","workingDirectory":{"selectWorkingDirectory":"选择工作目录","chooseFolder":"选择目录…","selectPath":"选择文件夹…","recentDirectories":"最近使用的目录","noRecent":"暂无最近使用的目录","notSet":"默认工作区","defaultWorkspace":"会话工作区","copyPath":"复制路径","selectionOnlyAtNewChat":"仅可在发送首条消息前选择工作区。","lockedTapTitle":"本会话无法更改工作区","lockedTapBody":"要选择项目文件夹,请先新建对话,在发送第一条消息前点击此处选择路径。也可在「设置 → 智能体」中配置默认工作空间。","clickToCopyFullPath":"点击复制完整路径","copied":"已复制","openWorkspaceMenu":"工作区选项","folderPickerRequiresDesktop":"文件夹选择需要使用桌面版(Electron)。请使用桌面端 xopc,或通过其他方式配置路径。","applyErrorTitle":"无法设置工作目录","applyErrorClose":"关闭","pathModalTitle":"工作目录","pathModalDescription":"请输入网关所在机器上的绝对路径(作为本会话的工作区文件夹)。","pathInputPlaceholder":"/绝对路径/到/文件夹","pathModalConfirm":"确定","pathModalCancel":"取消","pickerHostHint":"网关所在主机上的目录:{{hostname}}","pickerLoading":"加载中…","pickerUp":"上级","pickerUseThisFolder":"使用此文件夹","pickerManualPath":"或手动输入绝对路径","pickerApplyManual":"应用路径","pickerListError":"无法读取该位置。","pickerEmptyFolder":"空文件夹","pickerDrives":"驱动器"},"maxAttachmentsReached":"每条消息最多 {{max}} 个文件,请先移除部分附件。","maxAttachmentsTruncated":"已忽略 {{dropped}} 个文件(每条最多 {{max}} 个)。","attachmentFileTooLarge":"文件「{{name}}」过大(单文件最大 {{maxSize}})。","inputPlaceholder":"提问或描述任务 — @ 引用文件,/ 使用技能和命令","currentModel":"当前对话使用的模型","modelSearchPlaceholder":"按名称、服务商或 ID 搜索…","modelNoMatches":"没有匹配的模型","modelProviderSettingsLink":"配置服务商…","dropFiles":"将文件拖放到此处添加","voiceRecording":"录制语音","voiceRecordingStop":"停止录音","voiceMicDenied":"无法使用麦克风(权限被拒绝或设备不可用)。","inputPlaceholderSteering":"后续问题:Enter 加入队列;点击队列一行在此编辑","inputPlaceholderSteeringEdit":"正在编辑队列中的后续问题 — Enter 保存,Esc 放弃修改","steeringInterruptSend":"停止当前回复并立即发送(⌘↵ 或 Ctrl+↵)","followUpSuggestionsAria":"建议的后续问题","followUpChipErrorHandling":"补充错误处理和边界情况。","followUpChipRefactorReadability":"重构以提高可读性。","followUpChipCodeExplain":"逐步解释这段代码。","followUpChipCodeOptimize":"建议性能优化方案。","followUpChipWebMoreDetails":"搜索更多详情。","followUpChipWebFindSources":"查找可靠来源。","followUpChipShorterSummary":"给一段更短的摘要。","followUpChipMainRisks":"主要风险有哪些?","followUpChipEmailMakeFormal":"语气更正式。","followUpChipEmailShorten":"精简这段内容。","followUpChipSimplerTerms":"用更通俗的话解释一下。","followUpChipConcreteExample":"举一个具体例子。","followUpChipBulletPoints":"整理为要点列表。","followUpChipCreateTable":"以表格形式呈现。","followUpChipWhatNext":"我接下来该做什么?","followUpQueueAria":"后续问题队列(本轮结束后按顺序发送)","followUpQueueHeading":"后续问题","followUpQueueClickToEdit":"在输入框中编辑","followUpQueueAttachmentOnly":"(附件)","followUpQueueEmptyPreview":"(空)","followUpQueueDrag":"拖动排序","followUpQueueMoveUp":"上移","followUpQueueMoveDown":"下移","followUpQueueSteerNow":"在工具间隙注入引导内容","followUpQueueRemove":"从队列移除","followUpQueueAttachmentsNote":"含附件的队列项无法使用 ✨ 引导注入,将按顺序作为整条消息发送。","followUpQueueMaxReached":"后续问题队列已满(最多 {{max}} 条)。请删除一条或等当前回复结束。","voicePlay":"播放语音","voicePause":"暂停","voiceLoading":"正在加载音频…","voiceMessage":"语音","loadOlder":"正在加载更早的消息…","scrollToBottom":"回到底部","attachmentPreviewClose":"关闭","attachmentPreviewDownload":"下载","attachmentPreviewRemove":"移除","attachmentPreviewLoading":"正在加载文件…","attachmentPreviewText":"文本","attachmentPreviewPdf":"PDF","attachmentPreviewDocument":"文档","attachmentPreviewPresentation":"演示文稿","attachmentPreviewSpreadsheet":"表格","attachmentPreviewNoText":"无可用文本","attachmentPreviewMissingData":"缺少文件数据","attachmentPreviewLoadError":"加载文件失败","attachmentPreviewMissingAuth":"缺少身份验证","attachmentPreviewFailedPdf":"无法加载 PDF","attachmentPreviewFailedDocx":"无法加载文档","attachmentPreviewFailedExcel":"无法加载表格","attachmentPreviewPdfRendering":"正在渲染 PDF…","attachmentPreviewPdfLoadMore":"向下滚动以加载更多页","attachmentPreviewExcelTruncated":"预览仅显示前 {rows} 行 × {cols} 列。请下载文件查看完整表格。","attachmentPreviewPptxTruncated":"为保护性能,文本预览已截断。请下载文件查看完整演示文稿。","attachmentPreviewPptxSlide":"第 {n} 页","attachmentPreviewPptxEmptySlide":"(本页无文本)","attachmentPreviewOpenElsewhereHint":"请下载文件后,使用本机上的其他应用打开。","attachmentPreviewOpenElsewhereTruncated":"此处仅显示部分内容。请下载完整文件后在本机其他应用中打开。","attachmentPreviewDownloadFull":"下载文件","attachmentPreviewImage":"预览图片","messageArtifactsHeading":"本消息输出","stepTimelineThinkingStreaming":"正在思考…","stepTimelineThinkingDone":"思考完成","stepTimelineToolSearchRunning":"搜索网络中…","stepTimelineToolSearchComplete":"搜索网络完成","stepTimelineToolSearchError":"搜索失败","stepTimelineToolGenericRunning":"{{name}}中…","stepTimelineToolGenericComplete":"{{name}}完成","stepTimelineToolGenericError":"{{name}}失败","searchSourcesHeading":"搜索来源 · {{count}}","executionDrawerTitle":"执行过程","executionDrawerClose":"关闭","executionDrawerEmpty":"暂无执行步骤。","executionProgressDone":"已完成思考","executionProgressRunning":"思考与工具执行中…","executionElapsedTitle":"本次执行已耗时","messageCopyPlainText":"复制纯文本","messageCopyMarkdown":"复制 Markdown 格式","messageCopied":"已复制","commandPalette":{"noResults":"没有匹配的命令或技能","placeholder":"搜索技能与命令…","skillsSection":"技能","commandsSection":"命令","showGroupedMore":"显示另外 {{count}} 条"},"atMention":{"noResults":"无匹配项","placeholder":"搜索文件…","searchError":"搜索工作区失败","files":"文件","folders":"文件夹","recentFiles":"最近","recentBadge":"最近","shiftHint":"Shift+Enter 或 Shift+点击:继续添加 @ 引用。"}}`),sessions:{title:`会话`,needToken:`请先保存网关访问令牌后再管理会话。`,searchPlaceholder:`搜索会话…`,filterAll:`全部`,filterActive:`活跃`,filterPinned:`置顶`,filterArchived:`归档`,filterChannelAll:`全部通道`,filterChannelLabel:`通道`,totalSessions:`总计`,activeSessions:`活跃`,pinnedSessions:`置顶`,archivedSessions:`归档`,sessionCount:`已显示 {{count}} 个`,loadMore:`加载更多`,noSessions:`暂无会话`,noSessionsDescription:`在「对话」中开始聊天后,会话将显示在这里。`,startNewChat:`开始新对话`,continueChat:`在对话中继续`,archive:`归档`,unarchive:`取消归档`,pin:`置顶`,unpin:`取消置顶`,export:`导出 JSON`,delete:`删除`,deleteSessionTitle:`删除会话?`,deleteSessionMessage:`确定删除「{{name}}」吗?此操作不可恢复。`,cancel:`取消`,loading:`加载中…`,loadError:`加载会话失败`,gridView:`网格`,listView:`列表`,layoutToggleGroup:`会话布局`,detailLoading:`加载会话…`,detailMessages:`消息`,detailExport:`导出`,close:`关闭`},cron:JSON.parse('{"title":"定时任务","subtitle":"任务会按计划自动执行,也可随时手动触发。在任意对话里描述你想定期做的事,即可快速创建任务。","needToken":"请先保存网关访问令牌后再管理定时任务。","statsRegion":"概览","tabMyTasks":"我的定时任务","tabRunHistory":"运行记录","wakeBanner":"定时任务仅在设备保持唤醒时运行;系统或屏幕休眠时,执行可能会被跳过。","keepAwake":"保持屏幕常亮","wakeLockUnavailable":"当前浏览器或环境不支持屏幕唤醒锁。","sortCreatedDesc":"创建时间(新→旧)","sortCreatedAsc":"创建时间(旧→新)","historyRangeDay":"日","historyRangeWeek":"周","historyRangeMonth":"月","filterAllTasks":"全部任务","filterAllStatuses":"全部状态","emptyHistoryTitle":"暂无执行记录","emptyHistoryHint":"定时任务开始运行后,记录将显示在这里。","jobCardMenuAria":"任务操作","scheduleBadge":{"everyMinute":"每分钟","everyNMinutes":"每 {{n}} 分钟","everyNHours":"每 {{n}} 小时","hourly":"每小时","dailyAt":"每天 {{time}}","weekdaysAt":"工作日 {{time}}","weeklyOn":"{{day}} {{time}}","cronExpr":"{{expr}}"},"jobsHeading":"计划任务","addJob":"新建任务","editJob":"编辑任务","name":"名称 *","namePlaceholder":"我的定时任务","nameRequired":"请填写名称","schedule":"计划(cron 表达式)*","message":"消息 *","messagePlaceholder":"助手应该做什么?","messageEdit":"编辑","messagePreview":"预览","messageMarkdownHint":"支持 Markdown(标题、列表、代码块、链接等)。","create":"创建任务","runNow":"立即执行","delete":"删除","edit":"编辑","enabled":"已启用","disabled":"已禁用","running":"运行中","nextRun":"下次执行","status":"状态","runHistoryTitle":"运行记录","runHistoryHint":"已完成的执行会保存在本地(state/cron/runs)。点击刷新更新列表。","detailRunHistory":"最近执行","colStarted":"开始时间","colJob":"任务","colDuration":"耗时","colDetail":"结果","colChat":"会话","openChat":"打开","openChatTitle":"在聊天中打开此次执行(仅 AI 智能体隔离会话)","execStatusRunning":"运行中","execStatusSuccess":"成功","execStatusFailed":"失败","execStatusCancelled":"已跳过","noRunsYet":"该时间范围内暂无执行记录。","confirmDelete":"确定要删除此定时任务吗?","confirmRun":"立即执行此定时任务?","scheduleLabel":"计划","messageLabel":"消息","totalJobs":"任务总数","emptyStateCta":"创建第一个任务","channel":"消息通道","channelLocal":"本地(不发出)","deliveryTargetLocalChannel":"本地消息通道 — 内容仅保存在本机","recipient":"接收方 *","recipientPlaceholder":"Telegram:填写数字形式的会话 ID,或从下方最近会话中选择","refreshList":"刷新","refreshRecipientHint":"从最近会话重新加载列表","selectRecipient":"— 请选择 —","noRecentChatsOption":"暂无最近会话","deliveryTarget":"投递目标","scheduleHintPreset":"选择预设或输入自定义 cron 表达式","schedulePicker":{"scheduleTimeLabel":"计划时间","modeNoRepeat":"不重复","modeInterval":"间隔","intervalKindMinutes":"分钟","intervalKindHours":"小时","modeHourly":"每小时","modeDaily":"每天","modeWeekly":"每周","modeMonthly":"每月","modeCustom":"自定义表达式","minuteUnit":"分","minuteAtHour":"分钟","intervalMinutes":"间隔分钟数","intervalHours":"间隔小时数","hourUnit":"小时","dayOfMonth":"日期","customCronHint":"标准五段 cron:分 时 日 月 周","weekdays":["一","二","三","四","五","六","日"]},"mode":"模式","modeDirect":"直接发送消息到消息通道,不经过 AI 处理","modeAgent":"由 AI 智能体处理消息并生成回复后发送","modeDirectOption":"直接发送(发到消息通道)","modeAgentOption":"AI 智能体(先由模型处理再发送)","agentLocalOnly":"仅本地运行(保存对话,不发送到消息通道)","agentLocalOnlyHint":"在本机运行智能体。对话以 cron 类型会话保存到默认或所选智能体下(任务 id 包含在会话键中);不向 Telegram/CLI 投递。","deliveryLocalOnly":"仅本地 — 对话以 cron 会话保存到该智能体目录","agentProfile":"智能体","agentProfileHint":"仅在「AI 智能体」模式下生效。选默认则使用网关配置的默认智能体。","agentProfileDefault":"默认智能体","workingDirectoryLabel":"工作目录","workingDirectoryHint":"可选。填写网关所在机器上的绝对路径;不填则使用该智能体的默认工作空间。","workingDirectoryReset":"使用智能体默认","model":"模型","save":"保存","failedToLoadJobs":"加载任务失败","scheduleRequired":"计划表达式和消息为必填项","chatIdRequired":"会话 ID 为必填项","failedToCreateJob":"创建任务失败","failedToUpdateJob":"保存任务失败","failedToToggleJob":"切换任务状态失败","actionFailed":"操作失败","enterManuallyOrSelect":"手动输入或从最近聊天中选择","noRecentChats":"未找到最近会话。请手动填写会话 ID(例如 Telegram 为 123456789)","refresh":"刷新","close":"关闭","cancel":"取消","loading":"加载中…","schedulePresets":{"custom":"-- 自定义(在下方输入) --","everyMinute":"每分钟","every5Minutes":"每 5 分钟(默认)","every10Minutes":"每 10 分钟","every15Minutes":"每 15 分钟","every30Minutes":"每 30 分钟","everyHour":"每小时","every2Hours":"每 2 小时","every4Hours":"每 4 小时","every6Hours":"每 6 小时","every12Hours":"每 12 小时","everyDayMidnight":"每天午夜","everyDay9AM":"每天早上 9 点","everyDay9PM":"每天晚上 9 点"},"timeLabels":{"overdue":"已过期","lessThanMinute":"不到 1 分钟","minutes":"{{count}} 分钟","hours":"{{count}} 小时"},"lastActiveLabels":{"justNow":"刚刚","minutesAgo":"{{count}} 分钟前","hoursAgo":"{{count}} 小时前","daysAgo":"{{count}} 天前"},"templateFilterAll":"全部","fromTemplate":"从模版创建","templatesEmptyHint":"该分类下暂无模版。","templateCategories":{"daily":"每日","monitoring":"监控","reports":"报告","automation":"自动化"},"templates":{"morning_briefing":{"title":"早间简报","description":"天气/出行提示(无 API 则如实说明)、你关心领域要闻、今日优先三件事——在提示词里改主题列表。","prompt":"生成一份**早间简报**,几分钟内读完。\\n- **天气/出行**:若无真实预报接口,请说明限制;仅根据我写的地区/季节给**一条**穿衣或通勤提示,或跳过。\\n- **要闻**:我关心的领域(**请编辑**):**(例:本地、宏观、科技政策、球队等)**;有检索则概括约 24 小时内要点并标注来源类型;无检索则给出我应**依次打开哪些首页**。\\n- **今日优先 3 件**:尽量从工作区笔记/待办推断;否则请我在文末一次性补充。\\n- **不要编造链接、引语或具体气温数字**。"},"standup_prep":{"title":"站会准备","description":"根据近期 Git 与文件变动起草站会式更新,便于口头汇报。","prompt":"帮我准备**站会发言稿**:\\n- 若可访问 Git:概括**自上次站会或昨天以来**的提交主题(不要堆 hash),若有明显风险路径可点出。\\n- 若不可用:给出我本地应执行的**简短命令**以便下次自动生成。\\n- **文件/改动线索**:从工作区可见信息推断,不确定请标注「推断」。\\n- **阻塞**:最多 3 条,可写「暂无」。\\n- **今天打算做什么**:一句话。\\n- 控制在约 **90 秒**可念完。"},"end_of_day_wrap_up":{"title":"日终小结","description":"总结今日进展、未闭环与明日第一件事。","prompt":"做**工作日日终小结**:\\n- **已完成**:最多 5 条(推断请标注)。\\n- **未闭环/搁置**:最多 4 条,语气中性。\\n- **明日登录后第一件事**:仅一条,动作具体。\\n- 尽量引用工作区内任务/日志;若无则说明缺口。\\n- 不做价值评判。"},"inbox_triage":{"title":"收件箱式梳理","description":"优先列出紧急待跟进项;若工作区无邮件内容则给可执行的梳理流程。","prompt":"协助**收件箱/待处理**梳理(**不假设**能登录真实邮箱):\\n- 若工作区有导出邮件、`.eml`、或关于邮件的笔记:按**紧急跟进优先**列出条目及建议下一步。\\n- 若无材料:给出**五步梳理流程**(文件夹/标签、先处理谁、如何处理老邮件等),并请我在下列 **VIP 发件人或域名**(**请编辑**)基础上下次粘贴若干主题行。\\n- **不要声称已读取真实收件箱**。"},"competitor_watch":{"title":"竞品动态","description":"按你列出的竞品做新闻、产品更新与价格信号摘要;有检索才写细节。","prompt":"竞品或对标名单(**请编辑**):**(填写公司/产品名)**。\\n- 有网络检索:概括约**一周**内公开动态:新闻、产品/changelog、价格或套餐变化;区分**已核实**与**传闻**。\\n- 无检索:列出**应查看的官方入口**(官网、定价页、changelog)及建议核对顺序,**不要编造更新**。\\n- **禁止捏造报道引语、数字或链接**。"},"trending_topics_monitor":{"title":"热点话题追踪","description":"跟踪你列出的行业或社区讨论热度与要闻线索。","prompt":"我关注的行业/社区/话题(**请编辑**):**(例:金融科技、独立游戏、本城论坛、AI 工具)**。\\n- 有检索:用 **5~7 条**要点概括本周**讨论变热或异常活跃**的方向,并注明大致平台类型(新闻/论坛类/HN 类等),勿捏造具体帖子链接。\\n- 无检索:给出**检索词组合**与**建议浏览顺序**。\\n- 若有争议或易误传话题,用一行提示**核实风险**。"},"tech_radar_stack":{"title":"技术雷达","description":"关注你列出的技术栈近期的发版与官方安全通告入口,不臆造 CVE。","prompt":"技术栈清单(**请编辑**):**(例:Node LTS、Postgres、某云产品、Android SDK)**。\\n- 汇总约 **14 天**内值得注意的发版、弃用说明,信息来源限于**官方博客、changelog、注册表**。\\n- 安全相关只指向**官方安全公告渠道**;**严禁编造 CVE 编号**或虚假漏洞版本。\\n- 若可见锁文件可概括生态;信息不足则说明缺哪份文件。"},"dependency_check_audit":{"title":"依赖检查","description":"根据仓库生态建议审计命令与关注项,不假装已跑过扫描。","prompt":"从工作区识别包管理文件(`package.json`、`go.mod`、`pyproject.toml` 等)。\\n- 为每种生态给出**一条**文档中常见的审计/检查命令(若不存在则说明)。\\n- 用文字说明**应关注什么**(大版本、被撤回包、EOL 运行时等),**不要编造扫描结果**。\\n- **不要捏造 CVE**。"},"weekly_review":{"title":"周报式回顾","description":"一周提交主题、未闭环与下周三块重点。","prompt":"写一份**周末/周五周报式回顾**:\\n- **本周交付主题**(结合 git 与笔记,若 git 不可用则说明)。\\n- **仍挂心的事**(≤6 条)。\\n- **下周 3 个标题级重点**。\\n- **一条**「该停做或该委派」的建议(仅在过载迹象明显时)。\\n- 语气像给上级的短简报。"},"code_quality_report":{"title":"代码质量报告","description":"从脚本与 CI 配置推断如何跑 lint/类型检查,并说明如何阅读输出——不虚构错误数量。","prompt":"在工作区查找 **lint / 类型检查 / 格式化** 相关脚本(`package.json`、Makefile、CI 配置等)。\\n- 给出建议的**本地执行顺序**。\\n- 说明**如何扫一眼输出**(错误类别、易 flaky 测试、类型债热点),**不要编造错误条数**。\\n- 若项目无脚本,按识别出的语言给**最小**起步建议并注明局限。"},"git_activity_summary":{"title":"Git 活动摘要","description":"归纳近期提交、活跃分支与热点文件;此处不能跑 git 则只给命令。","prompt":"总结约 **最近 7 天** 的 Git 活动:提交**主题**、值得注意的**分支**、**热点文件**。\\n- 若当前环境不能执行 git:**不要虚构**,改为列出我本地可复制的命令以生成同样摘要。\\n- 避免罗列大量 hash,保持可扫读。"},"user_feedback_digest":{"title":"用户反馈摘要","description":"从工作区内的反馈笔记、工单导出等聚类主题与痛点;无材料则给收集模板。","prompt":"我存放反馈的位置或命名习惯(**请编辑**):**(例:`feedback/`、导出的 issues、问卷摘要)**。\\n- 从可读文本中聚类**重复主题**、**大致情绪**、**主要痛点**(≤5)。\\n- 注意**脱敏**:不展开无关个人信息。\\n- 若无内容:给出我下次应粘贴/保存的**简短结构模板**。"},"stale_todo_or_issue_sweep":{"title":"陈旧待办清扫","description":"扫描 TODO/FIXME 或简易 issue 列表,建议保留/关闭/拆分,不自动改文件。","prompt":"扫描工作区中的 **TODO/FIXME/HACK** 或 Markdown 里的简易任务表。\\n- 列出最多 **10 条**「可能陈旧」的项(根据模糊措辞或文件很少再改动等启发式),每条给**建议动作**:关闭、拆分、排期。\\n- **仅建议,不修改文件**。\\n- 若扫描不完整,说明原因。"},"release_notes_or_changelog_draft":{"title":"发版说明草稿","description":"结合版本号文件与近期提交起草 changelog 草案,需人工核对后发布。","prompt":"为**下一次**版本发布起草 **changelog / 发版说明** 草案:\\n- 读取 `CHANGELOG`、以及 `package.json` / `Cargo.toml` 等版本字段(若存在)。\\n- 从可见提交归纳**面向用户**的变更;无法确定上次标签则退化为「最近一周」。\\n- 不确定条目请标注「待核实」。\\n- 语气克制,避免营销夸张。"},"workspace_cleanup_suggestions":{"title":"工作区清理建议","description":"列出大体积构建产物、缓存、日志等供周末前审视,不自动删除。","prompt":"为**周末前清理**给建议:\\n- 尽量发现**构建产物、缓存、日志**等;用表格:路径 | 可能原因 | 风险 | 建议(仅审视/归档)。\\n- **禁止删除或移动**。\\n- 若无法读磁盘占用,说明限制并给通用模式。"},"smoke_or_ci_health_reminder":{"title":"冒烟 / CI 健康","description":"从 CI 与脚本提炼本周值得跑的检查及如何确认通过,不谎称 CI 已绿。","prompt":"根据 CI 配置与脚本,列出本周值得做的 **smoke / 健康检查**:每条含**命令**、**期望通过信号**、**建议频率**。\\n- 若无 CI 文件:按仓库类型给**最小手工冒烟**路径。\\n- **不要在没有证据时声称 CI 已通过**。"}}}'),workspace:{title:`项目文件`,currentWorkspace:`当前工作区`,openFiles:`项目文件`,preview:`预览`,download:`下载`,copyPath:`复制路径`,pathCopied:`路径已复制`,edit:`编辑`,viewing:`查看中`,saved:`已保存`,saving:`保存中…`,emptyDir:`暂无文件`,loadError:`加载失败`,close:`关闭`,resizeHandleAria:`调整项目文件区域宽度`,lastModified:`修改时间`,openElsewhereHint:`预览可能受限或不可用。请下载文件或使用其他应用打开。`,cannotPreviewType:`无法在预览中打开此类型的文件。`,openSystemApp:`用默认应用打开`},skills:{title:`技能`,needToken:`请先保存网关访问令牌后再管理技能。`,tagline:`安装与管理技能,在对话中扩展 xopc 的能力。技能保存在 ~/.xopc/skills。`,refresh:`刷新列表`,reloadRuntime:`从磁盘重载`,reloadDiskAria:`从磁盘重载技能`,skillsNavAria:`技能分区`,tabBuiltin:`内置`,tabUser:`用户安装`,tabMarketplace:`技能广场`,marketplacePlaceholder:`技能广场即将上线,敬请期待。`,sectionMarketplace:`技能商店`,marketplaceSortLabel:`排序`,marketplaceSortDownloads:`下载最多`,marketplaceSortNewest:`最新`,marketplaceLoadFailed:`无法加载技能市场`,marketplaceEmpty:`没有匹配的包。`,marketplaceInstall:`安装`,marketplaceReinstall:`重新安装`,marketplaceInstalled:`已安装`,marketplaceReinstallConfirm:`该技能已安装。是否用商店中的版本覆盖本地?`,marketplacePagePrev:`上一页`,marketplacePageNext:`下一页`,marketplacePageStatus:`第 {{page}} / {{totalPages}} 页 · 共 {{total}} 个包`,marketplaceAuthor:`作者`,marketplaceDownloads:`下载`,marketplaceVersion:`最新版本`,sectionBuiltinList:`内置技能`,filterAll:`全部`,filterGlobal:`全局`,filterWorkspace:`工作区`,filterExtra:`扩展`,sectionUser:`已安装`,installCta:`安装技能`,installModalTitle:`安装技能`,installModalDropHint:`拖放 .zip 或 SKILL.md 文件,或点击选择`,installModalReqTitle:`文件要求`,installModalReq1:`包含 SKILL.md 文件的 .zip 压缩包`,installModalReq2:`或直接拖入 SKILL.md 文件`,installAction:`安装`,installClose:`关闭`,searchPlaceholder:`搜索技能`,noSearchResults:`没有匹配的技能。`,uploading:`上传中…`,loading:`加载中…`,empty:`暂无技能。`,loadFailed:`加载技能失败`,reloadFailed:`重载失败`,skillToggleFailed:`更新技能状态失败`,uploadFailed:`上传失败`,installSuccess:`技能已安装。`,zipOnly:`请选择 .zip 文件`,invalidFile:`请选择 .zip 或 SKILL.md 文件`,delete:`删除`,deleteTitle:`删除技能`,deleteMessage:`确定删除已管理技能目录「{{id}}」?此操作不可恢复。`,deleteConfirm:`删除`,deleteFailed:`删除失败`,yes:`是`,no:`否`,cancel:`取消`,source:{builtin:`内置`,workspace:`工作区`,global:`全局`,extra:`扩展`},col:{name:`名称`,description:`描述`,source:`来源`,managed:`可管理`,actions:`操作`},detailModalBanner:`以下内容来自该技能的 SKILL.md 原文`,detailModalBannerStore:`以下为技能商店中该包发布的 Markdown 正文(与商店中的包说明一致)。`,marketplaceNoReadme:`该包暂无说明正文。`,detailModalEnable:`启用`,detailModalDisable:`停用`,detailLoadFailed:`无法加载 SKILL.md`,detailCloseAria:`关闭`,hubRemote:`远程`,hubKindGit:`git`,hubKindArchive:`归档`},logs:{title:`日志`,subtitle:`网关运行时的诊断与历史记录。`,needToken:`请先保存网关访问令牌后再查看日志。`,filters:`筛选`,level:`级别`,searchPlaceholder:`搜索消息或模块…`,module:`模块`,allModules:`全部模块`,timeRange:`时间范围`,from:`开始`,to:`结束`,clear:`清除`,refresh:`刷新`,autoRefresh:`自动刷新`,pause:`暂停`,liveHint:`每 5 秒自动刷新`,logFiles:`日志文件`,filesEmpty:`磁盘上暂无日志文件`,loadMore:`加载更多`,showingCount:`已加载 {{count}} 条`,moreAvailable:`可能还有更早的条目`,noLogs:`没有匹配的条目`,noLogsDescription:`请调整筛选或搜索,或稍后再试。`,loading:`加载中…`,loadError:`加载日志失败`,details:`日志详情`,close:`关闭`,time:`时间`,message:`消息`,metadata:`元数据`,statsRegion:`抽样(近期文件)`,statsHint:`数量为近期日志文件抽样统计,非全量。`,statsDetailTitle:`各级别数量`,logDir:`目录`,requestId:`请求 ID`,sessionId:`会话 ID`,presetAll:`全部`,presetErrors:`错误`,presetWarnPlus:`警告+`,presetInfoPlus:`信息+`,presetVerbose:`调试`,presetOther:`更多`,levelPresetAria:`按日志级别筛选`,refreshModeAria:`日志刷新方式`,refreshManual:`手动`,refreshLive:`实时`,filtersMore:`更多筛选`,filtersDialogTitle:`更多筛选`,filtersDialogDesc:`时间范围与自定义日志级别。`,filtersDone:`完成`,levelCustom:`自定义级别`,levelCustomHint:`点选以包含或排除;全部不选表示所有级别。`,copyMessage:`复制消息`,copyJson:`复制 JSON`,copied:`已复制`,levelNames:{trace:`跟踪`,debug:`调试`,info:`信息`,warn:`警告`,error:`错误`,fatal:`致命`}},agentSettings:JSON.parse(`{"subtitle":"模型、工作区、采样与输出方式的默认配置。","sectionDesc":"修改将写入网关配置文件;部分项在下一轮对话或新会话中生效。","needToken":"请先保存网关访问令牌后再加载或修改智能体默认项。","loadError":"加载设置失败","save":"保存更改","saving":"保存中…","saved":"已保存","saveError":"保存失败","cardModelsTitle":"模型","cardModelsSubtitle":"对话、视觉与图像生成默认模型","cardWorkspaceTitle":"工作区与附件","cardWorkspaceSubtitle":"工作目录与入站媒体大小限制","cardBrowserTitle":"浏览器自动化","cardBrowserSubtitle":"Playwright 工具(browser_navigate、快照、点击等)","browserEnabledOn":"启用浏览器工具","browserHeadlessOn":"无头模式(不显示浏览器窗口)","cardGenerationTitle":"采样与工具","cardGenerationSubtitle":"输出上限(Token)、随机性与工具调用轮数","cardBehaviorTitle":"推理与输出","cardBehaviorSubtitle":"思考深度、推理可见性与详细程度","label":{"model":"模型","modelFallbacks":"备用模型","imageModel":"图像理解模型","imageModelFallbacks":"图像理解备用模型","imageGenerationModel":"图像生成模型","imageGenerationModelFallbacks":"图像生成备用模型","mediaMaxMb":"图像加载上限 (MB)","workspace":"工作区","browserEnabled":"浏览器工具","browserHeadless":"无头模式","maxTokens":"最大 Token 数","temperature":"温度","maxToolIterations":"最大工具调用轮数","thinkingDefault":"思考级别","reasoningDefault":"推理可见性","verboseDefault":"详细程度"},"desc":{"model":"新会话的默认模型。","modelFallbacks":"主模型在瞬时重试后仍失败时,按顺序尝试。各服务商均需配置 API Key。","imageModel":"可选,用于图像理解 / 视觉。","imageModelFallbacks":"当对话模型不支持视觉时,按顺序用这些视觉模型描述入站图片(也用于图像工具)。","imageGenerationModel":"可选,用于 image_generate(如 openai/gpt-image-1)。","imageGenerationModelFallbacks":"主图像生成模型失败时按顺序尝试(如配额或服务商错误)。","mediaMaxMb":"图像工具加载单张图片时的最大体积。","workspace":"智能体读写文件的工作目录。","browserEnabled":"向模型暴露 Playwright 的 browser_* 工具。请在网关所在机器执行一次:npx playwright install chromium。","browserHeadless":"关闭时会在网关机器上显示 Chromium 窗口(便于调试);开启时在后台运行。","maxTokens":"模型回复的最大 Token 数。","temperature":"随机性(0–2)。","maxToolIterations":"单条用户消息内最多进行多少轮工具调用。","thinkingDefault":"新会话的默认思考级别。","reasoningDefault":"是否在聊天界面展示模型推理。若会话曾设置 /reasoning 等,会覆盖此默认直至清除会话配置。","verboseDefault":"智能体在日志与工具细节上的详细程度,不控制聊天中的推理/思考区块;若要隐藏推理请使用「推理可见性」。"},"addModelFallback":"添加备用模型","removeModelFallback":"移除备用模型","reasoning":{"off":"关闭","on":"开启","stream":"流式"},"verbose":{"off":"关闭","on":"开启","full":"完整"},"advanced":{"cardLimitsTitle":"单轮限制与可靠性","cardLimitsSubtitle":"单轮最大耗时、重试与工具连续失败次数。","maxTaskDurationMs":"单轮最长时间(分钟)","maxTaskDurationMsDesc":"单条用户消息内(模型 + 工具)墙钟上限。留空用服务端默认。范围 1–240 分(1 分–4 小时)。","maxTaskDurationPlaceholder":"如 30(留空为默认)","maxRequestsPerTurn":"每轮最大请求数","maxRequestsPerTurnDesc":"单条用户消息内大模型重试/请求尝试上限(默认 50)。","maxToolFailuresPerTurn":"每轮最大工具失败次数","maxToolFailuresPerTurnDesc":"连续工具错误达到该值后放弃(默认 3)。","cardCompactionTitle":"上下文压缩","cardCompactionSubtitle":"在上下文中按策略压缩较早内容以适配窗口。","compactionEnabled":"启用压缩","compactionEnabledDesc":"关闭后不按策略压缩(可能更占上下文)。","compactionEnabledOn":"启用压缩","compactionMode":"模式","compactionModeDesc":"default:标准;safeguard:更谨慎的启发式。","compactionModeDefault":"default","compactionModeSafeguard":"safeguard","reserveTokens":"保留 token","reserveTokensDesc":"压缩后为目标模型预留的头部空间(默认 8000)。","triggerThreshold":"触发阈值","triggerThresholdDesc":"已用上下文比例达到该值时考虑压缩(0.5–0.95)。","minMessagesBeforeCompact":"最早压缩前消息数","minMessagesBeforeCompactDesc":"达到该条数后才允许开始压缩(默认 10)。","keepRecentMessages":"保留最近消息数","keepRecentMessagesDesc":"尾部始终完整保留的最近轮次(默认 5)。","evictionWindow":"逐出窗口","evictionWindowDesc":"可参与先摘要/逐出策略的历史比例(0.1–0.5)。","retentionWindow":"保留窗口","retentionWindowDesc":"参与保留策略的轮次宽度(3–20)。","cardPruningTitle":"工具结果裁剪","cardPruningSubtitle":"在送入模型前截断过长的工具输出。","pruningEnabled":"启用裁剪","pruningEnabledDesc":"关闭后整段工具结果可能入模型(成本更高)。","pruningEnabledOn":"启用裁剪","maxToolResultChars":"单条工具结果最大字符","maxToolResultCharsDesc":"单条工具结果默认上限(默认 10000)。","headKeepRatio":"保留开头比例","headKeepRatioDesc":"裁剪时从开头保留比例(0–1,默认 0.3)。","tailKeepRatio":"保留结尾比例","tailKeepRatioDesc":"从结尾保留比例(0–1,默认 0.3)。","cardMemoryTitle":"记忆(精选与外部)","cardMemorySubtitle":"系统记忆、USER.md 与可选外部 provider。","memoryEnabled":"记忆功能","memoryEnabledDesc":"总开关:精选记忆快照、工具与外部预取。","memoryEnabledOn":"启用","useEnhancedSystem":"增强 system","useEnhancedSystemDesc":"关闭时仅工作区引导(不附加额外记忆快照)。","useEnhancedSystemOn":"使用增强 system","userProfileEnabled":"包含 USER.md","userProfileEnabledDesc":"在快照中纳入 USER.md。","userProfileEnabledOn":"包含用户侧写","memoryProvider":"外部记忆 provider","memoryProviderDesc":"选 none / stub 或留空视为不设置。","memoryProviderUnset":"(不设置)","injectionFrequency":"外部预取注入","injectionFrequencyDesc":"将预取记忆注入到用户消息上下文的频率。","injectionFrequencyUnset":"(不设置)","injectionEveryTurn":"每轮(配合 cadence)","injectionFirstTurn":"仅首轮","memoryCharLimit":"记忆字符上限","memoryCharLimitDesc":"精选记忆快照最大字符数(可选)。","userCharLimit":"用户侧写字符上限","userCharLimitDesc":"USER.md 区块最大字符数(可选)。","contextCadence":"上下文节奏","contextCadenceDesc":"每轮注入时:在轮次 1、1+N、… 注入(最小 1)。","dialecticCadence":"对话节奏(预留)","dialecticCadenceDesc":"预留,尚未接入。设置时最小为 1。","cardSessionSearchTitle":"会话搜索(转写)","cardSessionSearchSubtitle":"session_search 工具中用于历史会话摘要的模型。","sessionSearchSummaryModel":"摘要模型","sessionSearchSummaryModelDesc":"如 openai/gpt-4o-mini。留空用运行时的默认/启发式。","cardReviewTitle":"后台审阅","cardReviewSubtitle":"成功回合后可选的静默跟进(记忆/技能)。默认关闭。","reviewEnabled":"启用后台审阅","reviewEnabledDesc":"开启后,成功轮次后可能跑静默跟进。","reviewEnabledOn":"启用","memoryNudgeInterval":"记忆审阅节奏(每 N 轮用户消息)","memoryNudgeIntervalDesc":"0 表示关闭该通道。默认 10。","skillNudgeInterval":"技能审阅(无 skill_manage 的轮数)","skillNudgeIntervalDesc":"0 表示关闭。默认 10。","reviewMaxToolRounds":"审阅中最大工具轮数","reviewMaxToolRoundsDesc":"1–32,默认 8。","reviewMaxHistoryMessages":"审阅上下文中最大消息数(尾部)","reviewMaxHistoryMessagesDesc":"10–200,默认 80。","reviewMaxDurationMs":"审阅时间上限(秒)","reviewMaxDurationMsDesc":"单轮审阅墙钟 30–600 秒,默认 120 秒。","cardWebExtractTitle":"web_extract(LLM 提取)","cardWebExtractSubtitle":"网页转 Markdown 提取的可选模型与长度。","webExtractModel":"模型","webExtractModelDesc":"留空用默认提取模型/启发式。","webExtractMaxLength":"最大长度","webExtractMaxLengthDesc":"提取文字最大长度(可选)。","cardDelegateTitle":"子智能体与代码执行","cardDelegateSubtitle":"可选:delegate_task 与沙箱 execute_code。","delegateEnabled":"子任务委托 delegate_task","delegateEnabledDesc":"开启后,若运行环境支持,可使用子智能体。","delegateEnabledOn":"开启","executeCodeEnabled":"execute_code(沙箱)","executeCodeEnabledDesc":"开启后,若运行环境允许,可见沙箱代码工具。","executeCodeEnabledOn":"开启","cardPromptSkillsTitle":"系统提示与技能白名单","cardPromptSkillsSubtitle":"可覆盖系统提示。技能名非空时仅展示列表中的 <available_skills>。","systemPromptOverride":"系统提示覆盖","systemPromptOverrideDesc":"可选全量覆盖;与智能体级合并(条目优先)。留空可清除。","systemPromptPlaceholder":"","skillsAllowlist":"技能名白名单","skillsAllowlistDesc":"非空时仅向提示中暴露这些技能。每行一个名称。","addSkillName":"添加技能名","removeListItem":"移除此行","cardToolsDisableTitle":"工具 — 全局禁用","cardToolsDisableSubtitle":"在 agents.defaults 中禁用内建工具名(如 shell、web_search)。","toolsDisableHint":"列出默认智能体不得调用的工具 id;与「智能体」中按条目禁用会合并。","addToolName":"添加工具名","cardParamsTitle":"Params(JSON)","cardParamsSubtitle":"给扩展的任意键值,必须为 JSON 对象。","paramsJson":"Params 对象","paramsJsonDesc":"如 {\\"myFlag\\": true}。清空可去掉配置文件中的 params。","paramsInvalidJson":"Params 必须是有效 JSON 对象。请检查花括号、引号等。"}}`),agentsSettings:{title:`智能体`,subtitle:`管理 agents.list:工作区、默认路由与 Bootstrap 人设文件。`,needToken:`请先保存网关访问令牌后再管理智能体。`,loadError:`加载智能体列表失败`,saveError:`请求失败`,loading:`加载中…`,tabOverview:`智能体列表`,tabDefaults:`智能体默认配置`,tabFiles:`Bootstrap 人设`,tabTools:`工具`,tabSkills:`技能`,tabChannels:`通道`,tabCron:`定时`,selectAgent:`智能体`,selectAgentHint:`选择一个智能体进行配置;身份文件位于 ~/.xopc/agents/<id>/bootstrap/。`,agent:`智能体`,defaultBadge:`默认`,setDefault:`设为默认`,editAgent:`运行配置`,editAgentHint:`修改模型、工作区等配置,保存后将更新网关的 agents.list。`,displayName:`名称`,agentDescription:`描述`,agentDescriptionPlaceholder:`简短说明,会显示在智能体卡片和选择器中(可选)。`,workspacePath:`Markdown 工作区`,modelPrimary:`模型(主)`,modelClear:`清除`,save:`保存更改`,removeFromConfig:`从配置移除`,purgeDisk:`移除并删除数据`,addAgent:`添加智能体`,addAgentHint:`创建新的智能体目录并初始化配置模板。`,newAgentLabel:`名称`,newAgentIdOptional:`Agent ID(可选)`,newAgentIdPlaceholder:`留空则根据显示名称生成`,newAgentIdRules:`1–64 个字符:字母、数字、下划线、连字符;须以字母或数字开头。勿使用保留 id(如 main、con)。`,newWorkspace:`工作区目录(必填)`,newModelOptional:`模型(可选)`,create:`创建智能体`,addAgentAria:`添加智能体`,createModalCancel:`取消`,closeDialogAria:`关闭`,filesHint:`智能体的身份配置文件(SOUL、IDENTITY 等)。编辑后自动保存,可用「预览」查看渲染效果。`,filesLoading:`正在加载文件列表…`,filesEmpty:`暂无文件。`,pickFile:`请选择要编辑的文件。`,saveFile:`保存文件`,filesBootstrapEdit:`编辑`,filesBootstrapPreview:`预览`,filesAutoSaveHint:`编辑后自动保存。`,filesSavingStatus:`保存中…`,missing:`缺失`,confirmDelete:`从配置中移除此智能体?相关路由绑定会被清除。`,confirmDeletePurge:`移除此智能体并删除其工作区与 ~/.xopc/agents/<id> 数据?此操作不可恢复。`,purgeConfirmLabel:`输入 agentId 以确认`,purgeConfirmPlaceholder:`请输入 {{agentId}} 以确认`,purgeConfirmHint:`此操作不可恢复。需完整输入 {{agentId}} 才能启用删除。`,toolsTitle:`内置工具`,toolsHint:`按智能体禁用工具(与 agents.defaults 合并)。已在默认配置中禁用的工具不能在此处单独启用。`,toolsSave:`保存工具禁用`,toolsClearEntry:`清除本智能体的额外禁用`,toolsLockedByDefaults:`已在默认中禁用`,toolDescriptions:{read_file:`读取工作区内的文本与小文件(路径限制在工作区沙箱内)。`,write_file:`在工作区创建新文件或覆盖已有文件。`,edit_file:`通过定位替换或补丁式编辑修改已有文件。`,list_dir:`列出工作区某目录下的文件与子目录。`,grep:`用正则搜索文件内容(类似 ripgrep)。`,find:`按文件名或 glob 在工作区内查找文件。`,shell:`在与工作区关联的环境中执行 shell 命令,权限高;只读或更保守的智能体可关闭。`,web_search:`检索公开网页,获取模型训练截止之后的事实与资料。`,web_fetch:`请求 URL 并读取页面文本供模型使用。`,send_message:`在已连接的通道上发送出站聊天内容(如 Telegram、CLI、网关等)。`,send_media:`通过通道发送图片或其他媒体附件。`,memory_search:`搜索为本智能体建立的记忆与笔记索引。`,memory_get:`按 ID 读取某条记忆或片段。`,curated_memory:`读取或更新智能体主目录下的精选 Markdown 记忆。`,session_search:`在已保存的会话记录与按会话摘要中搜索。`,image:`分析或描述图片(视觉),可来自工作区或当前对话。`,image_generate:`使用已配置的图像 / 文生图模型生成图片。`,extensions:`启用扩展注册的工具;关闭则屏蔽所有扩展工具。`},skillsTitle:`技能白名单`,skillsHint:`可选的 <available_skills> 白名单。「继承默认」仅使用 agents.defaults;「自定义」写入本智能体的 skills 数组。`,skillsInherit:`继承默认`,skillsCustomize:`自定义白名单`,skillsSave:`保存技能`,skillsCatalogLoading:`正在加载技能目录…`,skillsEmptyCatalog:`目录中暂无技能。`,skillsNoDescription:`SKILL.md 元数据中暂无描述。`,skillsDefaultsLabel:`默认白名单:`,skillsEffectiveLabel:`生效白名单:`,skillsAllFromCatalog:`(全部目录技能)`,channelsTitle:`路由绑定`,channelsHint:`指向本智能体的 config.bindings。删除规则会更新网关上的完整 bindings 数组。`,channelsLoading:`正在加载绑定…`,channelsNone:`没有指向该智能体的绑定。`,channelLabel:`通道`,peerIdLabel:`对端 ID(可选)`,channelsLoadingChannels:`正在加载通道列表…`,channelsManualChannelHint:`网关未返回通道列表。请直接填写通道 id(如 telegram、webchat、gateway)。`,channelsDisabledSuffix:`(已禁用)`,channelsSessionLabel:`匹配范围`,channelsRefreshSessions:`刷新`,channelsRefreshSessionsHint:`重新加载该通道的近期会话`,channelsLoadingSessions:`正在加载会话…`,channelsPeerFromSessions:`从会话选择`,channelsPeerAny:`该通道上全部入站`,channelsNoSessionsHint:`此通道下暂无会话记录。先发一条消息,或在下方填写自定义对端 id。`,channelsCustomPeerHint:`若填写,将覆盖上方会话选择;支持 * 通配,详见会话路由说明。`,channelsCustomPeerPlaceholder:`例如 12345 或 *`,addBinding:`添加绑定`,removeBinding:`移除`,cronTitle:`定时任务`,cronHint:`隔离会话的定时任务可指定 agentId 作为会话键。未指定 agentId 的任务使用默认智能体,并在选中该智能体时显示。`,cronLoading:`正在加载定时任务…`,cronNone:`没有匹配的任务。`,cronColSchedule:`计划`,cronColMessage:`消息`,cronColSession:`会话`,cronColAgent:`智能体`,cronAgentDefault:`默认智能体`,cronAgentClear:`恢复默认`,navIdentity:`智能体身份`,navProfile:`关于你`,navPersona:`人格`,navTools:`工具`,navSkills:`技能`,navCoreFiles:`核心文件`,navAdvanced:`高级`,listSearchPlaceholder:`按名称、ID 或工作区搜索`,listEmpty:`没有匹配的智能体。`,listNoAgentsYet:`暂无智能体,请先创建一个。`,listNewAgentCard:`新建智能体`,listChatWithAgent:`聊天`,editorNavAria:`智能体编辑器分区`,skillsLibraryLink:`技能库`,personaHint:`通过表单快速设置你的智能体身份和个性。高级编辑请前往「核心文件」。`,personaSectionIdentity:`智能体身份`,personaSectionIdentityHint:`你的智能体如何介绍自己`,personaSectionUser:`关于你`,personaSectionUserHint:`帮助你的智能体更好地了解你`,personaSectionSoul:`个性与风格`,personaSectionSoulHint:`定义你的智能体如何与你交流`,personaName:`名字`,personaNamePlaceholder:`例如:小助、星辰、晓彤…`,personaCreature:`类型`,personaCreaturePlaceholder:`自定义类型…`,personaVibe:`风格`,personaVibePlaceholder:`自定义风格…`,personaEmoji:`签名表情`,personaEmojiPlaceholder:`例如 🤖 ✨ 🧠`,personaAvatar:`头像`,personaAvatarPlaceholder:`URL 或工作区路径`,personaCallName:`怎么称呼你`,personaCallNamePlaceholder:`例如:小明`,personaPronouns:`称谓`,personaPronounsPlaceholder:`例如:先生、女士、同学`,personaTimezone:`时区`,personaTimezoneDetect:`自动检测`,personaTimezoneCustom:`自定义时区…`,personaNotes:`备注`,personaNotesPlaceholder:`其他你希望智能体了解的信息…`,personaSoulTemplate:`个性模板`,personaSoulCustomEdit:`编辑个性描述 (Markdown)`,personaSoulPreview:`预览`,personaSoulEdit:`编辑`,personaMemoryNote:`你在对话中分享的偏好(如喜欢的食物、习惯等)会被智能体自动记住,无需在这里添加。`,personaSaving:`保存中…`,personaSaved:`已保存`,footerSaveNotApplicable:`本页内容自动保存,无需手动操作。底部「保存」仅用于智能体身份、工具、技能与核心文件。`},providersSettings:{subtitle:`服务商 API Key 与 OAuth。在此保存的密钥写入网关凭据存储。`,intro:`可搜索或展开分组,再展开具体服务商,粘贴新密钥后点「保存更改」。支持 OAuth 时,在浏览器中完成授权。`,docsLink:`模型与服务商文档`,modelsLink:`自定义服务商(models.json)`,rotateHint:`日常轮换密钥:展开对应服务商 → 粘贴新密钥 → 保存更改,一般无需重启。`,needToken:`请先保存网关访问令牌后再管理服务商凭据。`,loadError:`加载服务商列表失败`,save:`保存更改`,saving:`保存中…`,saved:`已保存`,noChangesSaved:`没有需要保存的新密钥。`,saveError:`保存失败`,empty:`暂无可用服务商。`,searchPlaceholder:`搜索 OpenAI、Claude、Gemini…`,getApiKey:`获取 API Key`,getApiKeyIntl:`获取 API Key(国际站)`,getApiKeyCn:`获取 API Key(国内)`,savedModelsAvailable:`个可用模型`,savedNoModels:`已配置,暂无模型列表`,envVarAlt:`或通过环境变量配置`,unconfiguredOnly:`仅显示未配置`,noMatches:`没有符合筛选条件的服务商。`,clearFilters:`清除筛选`,discard:`放弃更改`,unsavedHint:`有未保存的更改。`,runtimeLabelPrefix:`当前生效凭据:`,sourceAgent:`智能体私有凭据`,sourceGateway:`网关已保存(本页写入)`,sourceOauth:`OAuth 令牌`,sourceEnv:`环境变量`,sourceModelsJson:`models.json`,sourceExtension:`扩展提供方`,sourceNone:`无`,testKey:`测试输入值`,testingKey:`测试中…`,testOkLiteral:`格式有效(明文或文本)。`,testOkEnv:`环境变量可解析。`,testOkCommand:`命令解析成功。`,testFailed:`检查未通过。`,revokeFailed:`撤销失败。`,expandRowDetails:`展开凭据与操作`,categories:{common:`常用服务商`,specialty:`专业 / 特色`,enterprise:`企业 / 云端`,oauth:`仅 OAuth`,extension:`扩展`},configuredCount:`已配置 {{count}} 个`,metaMasked:`已有凭据 — 输入新 Key 可覆盖。`,metaWillSave:`点击「保存更改」后写入 API Key。`,metaNotConfigured:`未配置。`,placeholderKey:`API Key`,placeholderKeep:`留空则保留当前`,placeholderOverride:`输入新 Key 覆盖`,show:`显示`,hide:`隐藏`,copy:`复制`,copied:`已复制`,oauth:`OAuth 登录`,revoke:`撤销`,revokeConfirm:`撤销「{{name}}」的 OAuth 凭据?`,oauthStarting:`正在启动 OAuth…`,oauthProcessingCode:`正在处理授权…`,openAuthPage:`打开授权页`,cancelOAuth:`取消`,pasteRedirectUrl:`粘贴完整重定向 URL(含 code= 与 state=)`,submitCode:`提交`,envHint:`API Key 来自环境变量。在上方输入新 Key 可覆盖。`,maskedStoredHint:`已保存的凭据不会显示。在上方输入新 Key 可覆盖。`,oauthHint:`可使用 OAuth 安全登录,或手动填写 API Key。`},modelsSettings:{needToken:`请先保存网关访问令牌后再编辑 models.json。`,subtitle:`自定义服务商与模型(models.json)。保存后生效;重新加载可读取磁盘上的修改。`,docsLink:`模型与服务商文档`,loadError:`加载 models.json 失败`,loadFileWarning:`文件提示`,filePath:`路径`,addProvider:`添加服务商`,validate:`校验`,validating:`校验中…`,validateError:`校验请求失败`,save:`保存`,saving:`保存中…`,saved:`已保存`,saveError:`保存失败`,reload:`重新加载`,reloading:`加载中…`,reloadError:`重新加载失败`,showJson:`显示 JSON`,hideJson:`隐藏 JSON`,statsProviders:`{{count}} 个服务商`,statsModels:`{{count}} 个模型`,unsavedHint:`有未保存的更改。`,loading:`加载中…`,jsonParseError:`JSON 无效`,jsonReset:`从编辑器还原`,jsonApply:`应用 JSON`,emptyTitle:`暂无自定义服务商`,emptyDesc:`可添加 OpenAI 兼容端点(Ollama、LM Studio、OpenRouter、vLLM 等)及可选的逐模型覆盖。`,emptyCta:`添加第一家服务商`,presetOllama:`Ollama`,presetLmStudio:`LM Studio`,presetOpenRouter:`OpenRouter`,presetZhipuCn:`智谱 GLM(国内 · Coding 端点)`,presetZaiGeneral:`智谱 GLM(国际 · 通用 API)`,presetLabel:`预设`,presetCustom:`自定义`,addProviderTitle:`添加服务商`,addProviderSubtitle:`服务商 ID 须唯一(如 ollama、my-openai)。`,providerIdLabel:`服务商 ID`,providerIdPlaceholder:`例如 ollama`,providerIdRequired:`请填写服务商 ID`,addProviderConfirm:`添加`,cancel:`取消`,close:`关闭`,baseUrl:`Base URL`,apiType:`API 类型`,apiKey:`API Key`,apiKeyPlaceholder:`sk-…、环境变量名 或 !命令`,apiKeyHint:`直接填写密钥、大写环境变量名,或以 ! 开头的 shell 命令`,authHeader:`自动发送 Authorization 头`,testKey:`测试`,show:`显示`,hide:`隐藏`,badgeShell:`shell`,badgeEnv:`env`,badgeLiteral:`字面量`,removeProvider:`删除服务商`,removeProviderConfirm:`删除服务商「{{id}}」及其模型?`,modelsSection:`模型`,modelsEmpty:`无自定义模型;在可用处将使用内置默认。`,addModel:`添加模型`,editModel:`编辑模型`,removeModel:`删除模型`,removeModelConfirm:`删除模型「{{id}}」?`,addModelTitle:`添加模型`,editModelTitle:`编辑模型`,modelProviderLabel:`服务商`,modelId:`模型 ID`,displayName:`显示名称`,inputTypes:`输入类型`,inputTextOnly:`仅文本`,inputTextVision:`文本 + 视觉`,reasoning:`支持推理`,contextWindow:`上下文窗口`,maxOutputTokens:`最大输出 Token 数`,costSection:`费用(每百万 token)`,costInput:`输入`,costOutput:`输出`,modelIdRequired:`请填写模型 ID`,mustBePositive:`必须大于 0`,addModelConfirm:`添加模型`,saveModelConfirm:`保存更改`,validationErrors:`校验问题`,validationWarnings:`警告`,testError:`错误`,testOk:`解析结果`},channelsSettings:{needToken:`请先保存网关访问令牌后再编辑消息通道设置。`,subtitle:`Telegram、微信、飞书消息入站。更改将写入网关配置文件。`,docsLink:`消息通道文档`,refresh:`刷新`,loadError:`加载消息通道设置失败`,loading:`加载中…`,save:`保存更改`,saving:`保存中…`,saved:`已保存`,saveError:`保存失败`,retry:`重试`,unsavedHint:`有未保存的更改。`,hubConfigureButton:`配置`,hubConnectedBadge:`已连接`,enableChannelAria:`启用或停用该通道`,menuMoreAria:`更多操作`,menuEditConfig:`编辑配置`,menuRemoveConfig:`移除配置`,removeChannelTitle:`移除配置?`,removeChannelConfirm:`将移除 {{name}} 的网关配置并清除已保存的凭据?之后可重新配置。`,removeChannelAction:`移除`,modalCancel:`取消`,telegramTitle:`Telegram`,telegramSubtitle:`Bot Token、白名单及可选的多账号 JSON。`,weixinTitle:`微信`,weixinSubtitle:`用微信扫码登录(网页或命令行)后在此启用。凭据保存在运行网关的本机。`,feishuTitle:`飞书 / Lark`,feishuSubtitle:`飞书应用凭据、策略与可选的多账号 JSON。`,enableTelegramAria:`启用 Telegram 消息通道`,enableWeixinAria:`启用微信消息通道`,enableFeishuAria:`启用飞书消息通道`,telegramToken:`Bot Token`,telegramTokenDesc:`来自 BotFather,保存在网关配置中。`,feishuAppId:`App ID`,feishuAppIdDesc:`在飞书开发者后台获取(cli_xxx),保存在网关配置中。`,feishuAppSecret:`App Secret`,feishuAppSecretDesc:`在飞书开发者后台获取,保存在网关配置中。`,feishuDomain:`域名`,connectionMode:`连接模式`,connectionModeDesc:`websocket:Socket Mode。webhook:本地 HTTP 接收事件。`,renderMode:`渲染模式`,enableStreaming:`启用流式输出`,requireMention:`群聊需要 @mention`,reactionNotifications:`表情反应通知`,allowFromDm:`允许私聊(用户 ID)`,allowFromDmDesc:`逗号分隔的用户 ID(策略为白名单时生效)。`,advancedShow:`高级选项`,advancedHide:`收起高级选项`,apiRoot:`API 根地址`,proxy:`代理`,dmPolicy:`私聊策略`,groupPolicy:`群组策略`,replyToMode:`回复引用模式`,streamMode:`流式模式`,allowFromGroups:`允许群组(ID)`,allowFromGroupsDesc:`逗号分隔的群 chat_id(群策略为白名单时生效)。`,historyLimit:`历史条数上限`,textChunkLimit:`文本分块上限`,telegramDebug:`调试模式`,multiAccountJson:`多账号(JSON)`,multiAccountJsonDesc:`可选。每账号可配置 botToken 或 tokenFile、策略与群组。留空 {} 则仅使用上方单一 Token。`,weixinQuickStartTitle:`最简步骤`,weixinStepLogin:`在本页使用下方「微信扫码登录」,命令行方式请见消息通道文档。`,weixinStepEnable:`下方打开「启用微信」并保存。`,weixinStepPairing:`扫码登录后即可正常收发;仅在需要限制谁可私聊时,将私聊策略改为白名单并配置允许来源。`,weixinAdvancedHint:`可选:白名单、路由标签、流式与分账号 JSON——仅在需要时展开。`,weixinAllowFrom:`允许来源`,weixinAllowFromDesc:`私聊策略为白名单时使用,逗号分隔的 wxid / openid。默认配对在扫码后即可与任意联系人私聊。`,weixinRouteTag:`路由标签`,weixinRouteTagDesc:`可选路由标签,可为数字或字符串。`,routeTagPlaceholder:`例如标签名或数字`,weixinDebug:`调试模式`,weixinDebugDesc:`为微信消息通道输出更详细的日志。`,weixinAccountsJson:`账号(JSON)`,weixinAccountsJsonDesc:`分账号名称、CDN 地址、路由标签与策略。`,weixinQrLoginTitle:`网页扫码登录`,weixinQrLoginDesc:`在网关上发起登录,使用微信扫码;成功后本页会自动刷新配置。`,weixinQrLoginButton:`微信扫码登录`,weixinQrLoginBusy:`正在启动…`,weixinQrLoginScanned:`已扫码,请在微信中确认`,weixinQrLoginSuccess:`微信已连接。`,weixinQrLoginCancel:`关闭二维码`,weixinQrImageError:`无法在页面内生成二维码,可在新标签页打开链接完成扫码,或点击「重新生成」重试。`,weixinQrOpenLink:`新标签页打开`,weixinQrEncoding:`正在生成二维码…`,weixinQrModalTitle:`扫码登录`,weixinQrModalSubtitle:`请使用微信扫描下方二维码完成连接`,weixinQrRegenerate:`重新生成`,weixinQrModalCloseAria:`关闭`,agentRoutingTitle:`智能体路由`,agentRoutingHint:"在配置 `bindings` 中为每个消息通道账号指定智能体;入站消息会使用对应智能体的会话键。",agentRoutingAccountLabel:`账号`,agentRoutingAgentLabel:`智能体`,jsonObjectAccounts:`账号必须为 JSON 对象`,jsonInvalid:`JSON 无效`,copy:`复制`,copied:`已复制`,show:`显示`,hide:`隐藏`,webhookTitle:`Webhook 配置`,verificationToken:`Verification Token`,verificationTokenDesc:`在飞书事件订阅中获取(webhook 模式)。`,encryptKey:`Encrypt Key`,encryptKeyDesc:`在飞书事件订阅中获取(webhook 模式)。`,webhookHost:`Webhook Host`,webhookPort:`Webhook Port`,webhookPath:`Webhook Path`,webhookPathDesc:`飞书事件订阅里配置的 Request URL 路径。`,feishuToolsTitle:`飞书工具`,feishuToolsDesc:`按需开启。每个工具可能需要额外的应用权限(scopes)。`,feishuToolDoc:`文档(feishu_doc)`,feishuToolWiki:`知识库(feishu_wiki)`,feishuToolDrive:`云盘(feishu_drive)`,feishuToolPerm:`权限管理(feishu_perm)`,feishuToolBitable:`多维表格(feishu_bitable_*)`,feishuToolScopes:`权限诊断(feishu_app_scopes)`,feishuActionsTitle:`飞书动作`,feishuActionReactions:`启用表情反应动作`,policy:{dm:{pairing:`配对`,allowlist:`白名单`,open:`开放`,disabled:`关闭`},group:{open:`开放`,disabled:`关闭`,allowlist:`白名单`},reply:{off:`关闭`,first:`首条`,all:`全部`},stream:{off:`关闭`,partial:`部分`,block:`阻塞`}}},voiceSettings:{needToken:`请先保存网关访问令牌后再编辑语音设置。`,subtitle:`消息通道场景的语音转写与语音合成。API Key 也可通过环境变量配置。`,docsLink:`语音文档`,loadError:`加载语音设置失败`,loading:`加载中…`,save:`保存更改`,saving:`保存中…`,saved:`已保存`,saveError:`保存失败`,retry:`重试`,unsavedHint:`有未保存的更改。`,stt:{title:`语音转文字(STT)`,description:`使用阿里云 DashScope 或 OpenAI Whisper 将入站语音转为文本。`,enable:`启用 STT`,enableDesc:`开启后,可将语音消息转写给智能体使用。`,provider:`STT 服务商`,alibaba:`阿里云 DashScope`,openai:`OpenAI`,apiKey:`API Key`,apiKeyDesc:`若环境变量已配置密钥,此处可留空。`,model:`模型`,fallback:`服务商回退`,fallbackDesc:`主服务商失败时尝试备用服务商。`},tts:{title:`文字转语音(TTS)`,description:`在启用时把助手回复合成为语音。`,enable:`启用 TTS`,enableDesc:`开启后,按下方触发模式执行 TTS。`,trigger:`触发`,triggerOff:`关闭`,triggerAlways:`始终`,triggerInbound:`仅入站语音`,triggerTagged:`标签([[tts]])`,triggerDescOff:`完全关闭 TTS。`,triggerDescAlways:`对助手消息尝试使用 TTS。`,triggerDescInbound:`仅当用户发送语音时以语音回复。`,triggerDescTagged:`仅在使用 [[tts]] 指令时。`,provider:`TTS 服务商`,providerOpenai:`OpenAI TTS`,providerEdge:`Microsoft Edge(免费)`,voice:`音色`,edgeHint:`Microsoft Edge TTS — 无需 API Key。`},notes:{title:`说明`,duration:`长音频会自动分段;效果取决于服务商与模型。`,envVars:`环境变量:DASHSCOPE_API_KEY、OPENAI_API_KEY(未在表单填写时)。`}},gatewaySettings:{needToken:`请先保存网关访问令牌后再加载或修改网关选项。`,subtitle:`HTTP API 访问令牌与监听地址。配置写入网关配置文件。`,docsLink:`网关文档`,loadError:`加载网关设置失败`,loading:`加载中…`,save:`保存更改`,saving:`保存中…`,saved:`已保存`,saveError:`保存失败`,retry:`重试`,unsavedHint:`有未保存的更改。`,tokenExpired:`会话访问令牌无效。请在客户端更新访问令牌,或修正配置文件中的访问令牌。`,updateToken:`更新客户端访问令牌`,changeToken:`打开访问令牌对话框`,accessToken:`网关访问令牌`,tokenPlaceholder:`保存在配置中的访问令牌(若使用环境变量可留空)`,tokenHelp:`用于 HTTP/WebSocket API 鉴权。也可通过环境变量 XOPC_GATEWAY_TOKEN 提供。`,copy:`复制`,copied:`已复制`,show:`显示`,hide:`隐藏`,listenHost:`监听地址`,listenPort:`端口`,listenHint:`若在 UI 外修改监听地址,需重启网关后生效。`,authModeNone:`当前认证模式为 none,配置文件中的令牌可能被忽略。`},heartbeatSettings:{needToken:`请先保存网关访问令牌后再加载或修改心跳选项。`,subtitle:`定时唤醒智能体、可选投递到消息通道,以及工作区中的 HEARTBEAT.md。配置写入网关配置文件与工作区文件。`,docsLink:`心跳机制文档`,loadError:`加载心跳设置失败`,loading:`加载中…`,saveConfig:`保存配置`,savingConfig:`保存中…`,savedConfig:`配置已保存`,saveConfigError:`保存配置失败`,triggerNow:`立即触发`,triggering:`排队中…`,triggered:`已加入心跳队列`,triggerError:`触发心跳失败`,triggerHint:`与定时器相同的一次心跳(会受 HEARTBEAT.md、活跃时段与是否启用心跳影响)。`,saveDoc:`保存 HEARTBEAT.md`,savingDoc:`保存中…`,savedDoc:`文档已保存`,saveDocError:`保存 HEARTBEAT.md 失败`,retry:`重试`,unsavedConfig:`有未保存的配置更改。`,unsavedDoc:`HEARTBEAT.md 有未保存的更改。`,workspaceLabel:`工作区`,configSection:`心跳配置`,docSection:`HEARTBEAT.md`,docHint:`每次心跳时智能体会读取的任务与提醒。若留空或仅有注释,将跳过 LLM 调用以节省用量。`,enable:`启用心跳`,interval:`间隔`,intervalHint:`最短 1 秒;保存到网关配置时为毫秒。`,intervalHintPreset:`快速选择,或在左侧输入秒数。`,intervalSecondsLabel:`秒`,intervalPresets:{custom:`自定义`,every30s:`每 30 秒`,every1min:`每 1 分钟`,every5min:`每 5 分钟`,every10min:`每 10 分钟`,every15min:`每 15 分钟`,every30min:`每 30 分钟`,every1h:`每 1 小时`,every2h:`每 2 小时`},deliveryTitle:`投递(可选)`,channelNone:`— 无 —`,customChannelSuffix:`自定义`,deliveryHint:`需同时填写消息通道与会话 ID 才会发送非静默回复;否则仅记录日志。`,prompt:`自定义系统提示(可选)`,promptPlaceholder:`覆盖默认心跳指令…`,promptHint:`留空则使用内置默认提示。`,ackMaxChars:`视为静默前的最大回复长度(ackMaxChars)`,ackMaxCharsHint:`留空则使用服务端默认值(300)。`,ackDefaultPlaceholder:`默认`,isolatedSession:`每次使用新的会话键`,isolatedSessionHint:`避免与主对话会话混淆上下文。`,activeHoursTitle:`活跃时段(可选)`,activeStart:`开始`,activeEnd:`结束`,activeTimezone:`时区(IANA)`,activeHoursHint:`仅在该时间窗口内运行心跳。清除则不限时段。`,addActiveHours:`添加活跃时段`,clearActiveHours:`清除活跃时段`},webSearchSettings:{title:`网络搜索`,subtitle:`为 web_search 工具配置地区与搜索提供方。未配置 API 时将使用内置 HTML 兜底。`,docsLink:`网关文档`,needToken:`请先保存网关访问令牌后再编辑网络搜索。`,loading:`加载中…`,loadError:`加载网络搜索设置失败`,save:`保存`,saving:`保存中…`,saved:`已保存`,saveError:`保存失败`,unsavedHint:`有未保存的更改。`,sectionRegion:`地区`,sectionRegionHint:`在无可用 API 时,用于选择内置 HTML 兜底(国内优先必应,否则 DuckDuckGo)。`,sectionSearch:`搜索提供方`,sectionSearchHint:`按列表顺序依次尝试。密钥写在网关配置文件中。列表为空则仅使用 HTML 兜底。`,regionLabel:`兜底地区`,regionDesc:`自动根据系统时区判断。若使用代理或需固定策略,可手动覆盖。`,regionAuto:`自动(时区)`,regionCn:`中国(必应 HTML 兜底)`,regionGlobal:`全球(DuckDuckGo HTML 兜底)`,maxResultsLabel:`默认结果条数`,maxResultsDesc:`模型未指定 count 时使用(1–50)。`,providersTitle:`提供方(按顺序)`,addProvider:`添加提供方`,apiKeyLabel:`API 密钥`,apiKeyDesc:`部分场景可选。留空且显示为已掩码时保留原值。`,urlLabel:`实例地址`,urlDesc:`SearXNG 根地址(如 http://localhost:8080),无需末尾斜杠。`,keyPlaceholder:`密钥或环境变量名`,keyPlaceholderMasked:`••••••••(未修改)`,disabled:`跳过`,footerHint:`HTML 兜底依赖第三方页面,可能随站点改版变化。生产环境建议使用正式搜索 API(Brave、Tavily、必应或自建 SearXNG)。`,providerTypes:{brave:`Brave Search API`,tavily:`Tavily`,bing:`Bing Web Search API`,searxng:`SearXNG`}},appearanceSettings:{pageTitle:`偏好设置`,subtitle:`语言、界面外观与对话字号等日常使用的显示行为,仅保存在本浏览器。`,languageTitle:`语言`,languageDescription:`选择界面语言。`,themeTitle:`主题亮暗`,themeDescription:`浅色、深色,或跟随系统。`,colorSchemeTitle:`配色方案`,colorSchemeDescription:`界面的视觉风格。`,colorSchemeDefault:`默认`,colorSchemeLightGreen:`浅绿`,fontScaleTitle:`对话字号`,fontScaleDescription:`调整对话与阅读区域的文字大小。`,fontScaleCompact:`小`,fontScaleDefault:`中`,fontScaleLarge:`大`,langOptionEn:`English`,langOptionZh:`中文`,themeOptionLight:`浅色`,themeOptionDark:`深色`,themeOptionSystem:`跟随系统`,openFullPreferences:`打开全部设置`,quickMenuHint:`语言、主题与字号`,aboutApp:`关于`},updatePanel:{restartToUpdate:`重启以更新`,dismissAria:`关闭`,dismissHint:`不再提醒此版本`,reminderElectronReady:`新版本 v{{version}} 已就绪,重启应用以安装。`,reminderDownloading:`正在下载更新… {{percent}}%`,reminderNpm:`网关有新版本 v{{version}} 可用。`,updateNow:`立即更新`,updateRunning:`正在更新…`,updateSuccess:`已安装更新`,updateSuccessDetail:`请重启网关以使用新版本(例如:xopc gateway restart)。`,updateErrorGit:`无法一键更新`,updateErrorBusy:`已有更新任务在进行中`,updateErrorFailed:`更新失败`},aboutDialog:{windowTitle:`关于本应用`,close:`关闭`,versionLabel:`版本`,commitLabel:`提交`,buildDateLabel:`时间`,gatewayVersionLabel:`网关`,consoleBuildHint:`以上为控制台界面构建信息;网关为当前运行的 xopc 服务版本。`,checkUpdates:`检查更新`,gatewayUnavailable:`—`,openSourceLead:`本软件离不开 `,openSourceLink:`开源软件`,copyright:`版权所有 © {year} xopcai`}};Ue.use(ct).init({resources:{en:{translation:Et},zh:{translation:Dt}},lng:wt(),fallbackLng:`en`,interpolation:{escapeValue:!1},react:{useSuspense:!1}});var Ot=e=>{throw TypeError(e)},kt=(e,t,n)=>t.has(e)||Ot(`Cannot `+n),At=(e,t,n)=>(kt(e,t,`read from private field`),n?n.call(e):t.get(e)),jt=(e,t,n)=>t.has(e)?Ot(`Cannot add the same private member more than once`):t instanceof WeakSet?t.add(e):t.set(e,n),Mt=`popstate`;function Nt(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function Pt(e={}){function t(e,t){let{pathname:n=`/`,search:r=``,hash:i=``}=Vt(e.location.hash.substring(1));return!n.startsWith(`/`)&&!n.startsWith(`.`)&&(n=`/`+n),zt(``,{pathname:n,search:r,hash:i},t.state&&t.state.usr||null,t.state&&t.state.key||`default`)}function n(e,t){let n=e.document.querySelector(`base`),r=``;if(n&&n.getAttribute(`href`)){let t=e.location.href,n=t.indexOf(`#`);r=n===-1?t:t.slice(0,n)}return r+`#`+(typeof t==`string`?t:Bt(t))}function r(e,t){It(e.pathname.charAt(0)===`/`,`relative pathnames are not supported in hash history.push(${JSON.stringify(t)})`)}return Ht(t,n,r,e)}function Ft(e,t){if(e===!1||e==null)throw Error(t)}function It(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function Lt(){return Math.random().toString(36).substring(2,10)}function Rt(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.unstable_mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function zt(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?Vt(t):t,state:n,key:t&&t.key||r||Lt(),unstable_mask:i}}function Bt({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function Vt(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function Ht(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,c=null,l=u();l??(l=0,o.replaceState({...o.state,idx:l},``));function u(){return(o.state||{idx:null}).idx}function d(){s=`POP`;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:h.location,delta:t})}function f(e,t){s=`PUSH`;let r=Nt(e)?e:zt(h.location,e,t);n&&n(r,e),l=u()+1;let d=Rt(r,l),f=h.createHref(r.unstable_mask||r);try{o.pushState(d,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&c&&c({action:s,location:h.location,delta:1})}function p(e,t){s=`REPLACE`;let r=Nt(e)?e:zt(h.location,e,t);n&&n(r,e),l=u();let i=Rt(r,l),d=h.createHref(r.unstable_mask||r);o.replaceState(i,``,d),a&&c&&c({action:s,location:h.location,delta:0})}function m(e){return Ut(e)}let h={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(Mt,d),c=e,()=>{i.removeEventListener(Mt,d),c=null}},createHref(e){return t(i,e)},createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:f,replace:p,go(e){return o.go(e)}};return h}function Ut(e,t=!1){let n=`http://localhost`;typeof window<`u`&&(n=window.location.origin===`null`?window.location.href:window.location.origin),Ft(n,`No window.location.(origin|href) available to create URL`);let r=typeof e==`string`?e:Bt(e);return r=r.replace(/ $/,`%20`),!t&&r.startsWith(`//`)&&(r=n+r),new URL(r,n)}var Wt,Gt=class{constructor(e){if(jt(this,Wt,new Map),e)for(let[t,n]of e)this.set(t,n)}get(e){if(At(this,Wt).has(e))return At(this,Wt).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw Error(`No value found for context`)}set(e,t){At(this,Wt).set(e,t)}};Wt=new WeakMap;var Kt=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`children`]);function qt(e){return Kt.has(e)}var Jt=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`middleware`,`children`]);function Yt(e){return Jt.has(e)}function Xt(e){return e.index===!0}function Zt(e,t,n=[],r={},i=!1){return e.map((e,a)=>{let o=[...n,String(a)],s=typeof e.id==`string`?e.id:o.join(`-`);if(Ft(e.index!==!0||!e.children,`Cannot specify children on an index route`),Ft(i||!r[s],`Found a route id collision on id "${s}". Route id's must be globally unique within Data Router usages`),Xt(e)){let n={...e,id:s};return r[s]=Qt(n,t(n)),n}else{let n={...e,id:s,children:void 0};return r[s]=Qt(n,t(n)),e.children&&(n.children=Zt(e.children,t,o,r,i)),n}})}function Qt(e,t){return Object.assign(e,{...t,...typeof t.lazy==`object`&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function $t(e,t,n=`/`){return en(e,t,n,!1)}function en(e,t,n,r){let i=yn((typeof t==`string`?Vt(t):t).pathname||`/`,n);if(i==null)return null;let a=nn(e);an(a);let o=null;for(let e=0;o==null&&e<a.length;++e){let t=vn(i);o=hn(a[e],t,r)}return o}function tn(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function nn(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;Ft(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=An([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(Ft(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),nn(e.children,t,u,l,o)),!(e.path==null&&!e.index)&&t.push({path:l,score:pn(l,e.index),routesMeta:u})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of rn(e.path))a(e,t,!0,n)}),t}function rn(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=rn(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function an(e){e.sort((e,t)=>e.score===t.score?mn(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var on=/^:[\w-]+$/,sn=3,cn=2,ln=1,un=10,dn=-2,fn=e=>e===`*`;function pn(e,t){let n=e.split(`/`),r=n.length;return n.some(fn)&&(r+=dn),t&&(r+=cn),n.filter(e=>!fn(e)).reduce((e,t)=>e+(on.test(t)?sn:t===``?ln:un),r)}function mn(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function hn(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u=gn({path:s.relativePath,caseSensitive:s.caseSensitive,end:c},l),d=s.route;if(!u&&c&&n&&!r[r.length-1].route.index&&(u=gn({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!u)return null;Object.assign(i,u.params),o.push({params:i,pathname:An([a,u.pathname]),pathnameBase:Mn(An([a,u.pathnameBase])),route:d}),u.pathnameBase!==`/`&&(a=An([a,u.pathnameBase]))}return o}function gn(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=_n(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,`$1`),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=a.slice(0,a.length-e.length).replace(/(.)\/+$/,`$1`)}let i=s[r];return n&&!i?e[t]=void 0:e[t]=(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function _n(e,t=!1,n=!0){It(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,`/*`)}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,`/*`)}".`);let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/([\w-]+)\?(\/|$)/g,`(/$1)?$2`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function vn(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return It(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function yn(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}function bn({basename:e,pathname:t}){return t===`/`?e:An([e,t])}var xn=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Sn=e=>xn.test(e);function Cn(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?Vt(e):e,a;return n?(n=kn(n),a=n.startsWith(`/`)?wn(n.substring(1),`/`):wn(n,t)):a=t,{pathname:a,search:Nn(r),hash:Pn(i)}}function wn(e,t){let n=jn(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function Tn(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function En(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function Dn(e){let t=En(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function On(e,t,n,r=!1){let i;typeof e==`string`?i=Vt(e):(i={...e},Ft(!i.pathname||!i.pathname.includes(`?`),Tn(`?`,`pathname`,`search`,i)),Ft(!i.pathname||!i.pathname.includes(`#`),Tn(`#`,`pathname`,`hash`,i)),Ft(!i.search||!i.search.includes(`#`),Tn(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=Cn(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var kn=e=>e.replace(/\/\/+/g,`/`),An=e=>kn(e.join(`/`)),jn=e=>e.replace(/\/+$/,``),Mn=e=>jn(e).replace(/^\/*/,`/`),Nn=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,Pn=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,Fn=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function In(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function Ln(e){return An(e.map(e=>e.route.path).filter(Boolean))||`/`}var Rn=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function zn(e,t){let n=e;if(typeof n!=`string`||!xn.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(Rn)try{let e=new URL(window.location.href),r=n.startsWith(`//`)?new URL(e.protocol+n):new URL(n),a=yn(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{It(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}var Bn=Symbol(`Uninstrumented`);function Vn(e,t){let n={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(e=>e({id:t.id,index:t.index,path:t.path,instrument(e){let t=Object.keys(n);for(let r of t)e[r]&&n[r].push(e[r])}}));let r={};if(typeof t.lazy==`function`&&n.lazy.length>0){let e=Un(n.lazy,t.lazy,()=>void 0);e&&(r.lazy=e)}if(typeof t.lazy==`object`){let e=t.lazy;[`middleware`,`loader`,`action`].forEach(t=>{let i=e[t],a=n[`lazy.${t}`];if(typeof i==`function`&&a.length>0){let e=Un(a,i,()=>void 0);e&&(r.lazy=Object.assign(r.lazy||{},{[t]:e}))}})}return[`loader`,`action`].forEach(e=>{let i=t[e];if(typeof i==`function`&&n[e].length>0){let t=i[Bn]??i,a=Un(n[e],t,(...e)=>Gn(e[0]));a&&(e===`loader`&&t.hydrate===!0&&(a.hydrate=!0),a[Bn]=t,r[e]=a)}}),t.middleware&&t.middleware.length>0&&n.middleware.length>0&&(r.middleware=t.middleware.map(e=>{let t=e[Bn]??e,r=Un(n.middleware,t,(...e)=>Gn(e[0]));return r?(r[Bn]=t,r):e})),r}function Hn(e,t){let n={navigate:[],fetch:[]};if(t.forEach(e=>e({instrument(e){let t=Object.keys(e);for(let r of t)e[r]&&n[r].push(e[r])}})),n.navigate.length>0){let t=e.navigate[Bn]??e.navigate,r=Un(n.navigate,t,(...t)=>{let[n,r]=t;return{to:typeof n==`number`||typeof n==`string`?n:n?Bt(n):`.`,...Kn(e,r??{})}});r&&(r[Bn]=t,e.navigate=r)}if(n.fetch.length>0){let t=e.fetch[Bn]??e.fetch,r=Un(n.fetch,t,(...t)=>{let[n,,r,i]=t;return{href:r??`.`,fetcherKey:n,...Kn(e,i??{})}});r&&(r[Bn]=t,e.fetch=r)}return e}function Un(e,t,n){return e.length===0?null:async(...r)=>{let i=await Wn(e,n(...r),()=>t(...r),e.length-1);if(i.type===`error`)throw i.value;return i.value}}async function Wn(e,t,n,r){let i=e[r],a;if(i){let o,s=async()=>(o?console.error(`You cannot call instrumented handlers more than once`):o=Wn(e,t,n,r-1),a=await o,Ft(a,`Expected a result`),a.type===`error`&&a.value instanceof Error?{status:`error`,error:a.value}:{status:`success`,error:void 0});try{await i(s,t)}catch(e){console.error(`An instrumentation function threw an error:`,e)}o||await s(),await o}else try{a={type:`success`,value:await n()}}catch(e){a={type:`error`,value:e}}return a||{type:`error`,value:Error(`No result assigned in instrumentation chain.`)}}function Gn(e){let{request:t,context:n,params:r,unstable_pattern:i}=e;return{request:qn(t),params:{...r},unstable_pattern:i,context:Jn(n)}}function Kn(e,t){return{currentUrl:Bt(e.state.location),...`formMethod`in t?{formMethod:t.formMethod}:{},...`formEncType`in t?{formEncType:t.formEncType}:{},...`formData`in t?{formData:t.formData}:{},...`body`in t?{body:t.body}:{}}}function qn(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function Jn(e){if(Xn(e)){let t={...e};return Object.freeze(t),t}else return{get:t=>e.get(t)}}var Yn=Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);function Xn(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null||Object.getOwnPropertyNames(t).sort().join(`\0`)===Yn}var Zn=[`POST`,`PUT`,`PATCH`,`DELETE`],Qn=new Set(Zn),$n=[`GET`,...Zn],er=new Set($n),tr=new Set([301,302,303,307,308]),nr=new Set([307,308]),rr={state:`idle`,location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},eee={state:`idle`,data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},ir={state:`unblocked`,proceed:void 0,reset:void 0,location:void 0},ar=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),or=`remix-router-transitions`,sr=Symbol(`ResetLoaderData`);function cr(e){let t=e.window?e.window:typeof window<`u`?window:void 0,n=t!==void 0&&t.document!==void 0&&t.document.createElement!==void 0;Ft(e.routes.length>0,`You must provide a non-empty routes array to createRouter`);let r=e.hydrationRouteProperties||[],i=e.mapRouteProperties||ar,a=i;if(e.unstable_instrumentations){let t=e.unstable_instrumentations;a=e=>({...i(e),...Vn(t.map(e=>e.route).filter(Boolean),e)})}let o={},s=Zt(e.routes,a,void 0,o),c,l=e.basename||`/`;l.startsWith(`/`)||(l=`/${l}`);let u=e.dataStrategy||Tr,d={unstable_passThroughRequests:!1,...e.future},f=null,p=new Set,m=null,h=null,g=null,_=e.hydrationData!=null,v=$t(s,e.history.location,l),y=!1,b=null,x,S;if(v==null&&!e.patchRoutesOnNavigation){let t=Yr(404,{pathname:e.history.location.pathname}),{matches:n,route:r}=Jr(s);x=!0,S=!x,v=n,b={[r.id]:t}}else if(v&&!e.hydrationData&&Le(v,s,e.history.location.pathname).active&&(v=null),!v){x=!1,S=!x,v=[];let t=Le(null,s,e.history.location.pathname);t.active&&t.matches&&(y=!0,v=t.matches)}else if(v.some(e=>e.route.lazy))x=!1,S=!x;else if(!v.some(e=>pr(e.route)))x=!0,S=!x;else{let t=e.hydrationData?e.hydrationData.loaderData:null,n=e.hydrationData?e.hydrationData.errors:null,r=v;if(n){let e=v.findIndex(e=>n[e.route.id]!==void 0);r=r.slice(0,e+1)}S=!1,x=!0,r.forEach(e=>{let r=mr(e.route,t,n);S||=r.renderFallback,x&&=!r.shouldLoad})}let C,w={historyAction:e.history.action,location:e.history.location,matches:v,initialized:x,renderFallback:S,navigation:rr,restoreScrollPosition:e.hydrationData==null?null:!1,preventScrollReset:!1,revalidation:`idle`,loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||b,fetchers:new Map,blockers:new Map},T=`POP`,E=null,D=!1,O,k=!1,A=new Map,j=null,M=!1,N=!1,P=new Set,F=new Map,I=0,L=-1,R=new Map,z=new Set,B=new Map,V=new Map,H=new Set,ee=new Map,te,U=null;function ne(){if(f=e.history.listen(({action:t,location:n,delta:r})=>{if(te){te(),te=void 0;return}It(ee.size===0||r!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let i=je({currentLocation:w.location,nextLocation:n,historyAction:t});if(i&&r!=null){let t=new Promise(e=>{te=e});e.history.go(r*-1),Ae(i,{state:`blocked`,location:n,proceed(){Ae(i,{state:`proceeding`,proceed:void 0,reset:void 0,location:n}),t.then(()=>e.history.go(r))},reset(){let e=new Map(w.blockers);e.set(i,ir),ie({blockers:e})}}),E?.resolve(),E=null;return}return ce(t,n)}),n){yi(t,A);let e=()=>bi(t,A);t.addEventListener(`pagehide`,e),j=()=>t.removeEventListener(`pagehide`,e)}return w.initialized||ce(`POP`,w.location,{initialHydration:!0}),C}function re(){f&&f(),j&&j(),p.clear(),O&&O.abort(),w.fetchers.forEach((e,t)=>Se(t)),w.blockers.forEach((e,t)=>ke(t))}function W(e){return p.add(e),()=>p.delete(e)}function ie(e,t={}){e.matches&&=e.matches.map(e=>{let t=o[e.route.id],n=e.route;return n.element!==t.element||n.errorElement!==t.errorElement||n.hydrateFallbackElement!==t.hydrateFallbackElement?{...e,route:t}:e}),w={...w,...e};let n=[],r=[];w.fetchers.forEach((e,t)=>{e.state===`idle`&&(H.has(t)?n.push(t):r.push(t))}),H.forEach(e=>{!w.fetchers.has(e)&&!F.has(e)&&n.push(e)}),[...p].forEach(r=>r(w,{deletedFetchers:n,newErrors:e.errors??null,viewTransitionOpts:t.viewTransitionOpts,flushSync:t.flushSync===!0})),n.forEach(e=>Se(e)),r.forEach(e=>w.fetchers.delete(e))}function ae(t,n,{flushSync:r}={}){let i=w.actionData!=null&&w.navigation.formMethod!=null&&ui(w.navigation.formMethod)&&w.navigation.state===`loading`&&t.state?._isRedirect!==!0,a;a=n.actionData?Object.keys(n.actionData).length>0?n.actionData:null:i?w.actionData:null;let o=n.loaderData?Gr(w.loaderData,n.loaderData,n.matches||[],n.errors):w.loaderData,l=w.blockers;l.size>0&&(l=new Map(l),l.forEach((e,t)=>l.set(t,ir)));let u=M?!1:Ie(t,n.matches||w.matches),d=D===!0||w.navigation.formMethod!=null&&ui(w.navigation.formMethod)&&t.state?._isRedirect!==!0;c&&=(s=c,void 0),M||T===`POP`||(T===`PUSH`?e.history.push(t,t.state):T===`REPLACE`&&e.history.replace(t,t.state));let f;if(T===`POP`){let e=A.get(w.location.pathname);e&&e.has(t.pathname)?f={currentLocation:w.location,nextLocation:t}:A.has(t.pathname)&&(f={currentLocation:t,nextLocation:w.location})}else if(k){let e=A.get(w.location.pathname);e?e.add(t.pathname):(e=new Set([t.pathname]),A.set(w.location.pathname,e)),f={currentLocation:w.location,nextLocation:t}}ie({...n,actionData:a,loaderData:o,historyAction:T,location:t,initialized:!0,renderFallback:!1,navigation:rr,revalidation:`idle`,restoreScrollPosition:u,preventScrollReset:d,blockers:l},{viewTransitionOpts:f,flushSync:r===!0}),T=`POP`,D=!1,k=!1,M=!1,N=!1,E?.resolve(),E=null,U?.resolve(),U=null}async function oe(t,n){if(E?.resolve(),E=null,typeof t==`number`){E||=xi();let n=E.promise;return e.history.go(t),n}let{path:r,submission:i,error:a}=dr(!1,ur(w.location,w.matches,l,t,n?.fromRouteId,n?.relative),n),o;n?.unstable_mask&&(o={pathname:``,search:``,hash:``,...typeof n.unstable_mask==`string`?Vt(n.unstable_mask):{...w.location.unstable_mask,...n.unstable_mask}});let s=w.location,c=zt(s,r,n&&n.state,void 0,o);c={...c,...e.history.encodeLocation(c)};let u=n&&n.replace!=null?n.replace:void 0,d=`PUSH`;u===!0?d=`REPLACE`:u===!1||i!=null&&ui(i.formMethod)&&i.formAction===w.location.pathname+w.location.search&&(d=`REPLACE`);let f=n&&`preventScrollReset`in n?n.preventScrollReset===!0:void 0,p=(n&&n.flushSync)===!0,m=je({currentLocation:s,nextLocation:c,historyAction:d});if(m){Ae(m,{state:`blocked`,location:c,proceed(){Ae(m,{state:`proceeding`,proceed:void 0,reset:void 0,location:c}),oe(t,n)},reset(){let e=new Map(w.blockers);e.set(m,ir),ie({blockers:e})}});return}await ce(d,c,{submission:i,pendingError:a,preventScrollReset:f,replace:n&&n.replace,enableViewTransition:n&&n.viewTransition,flushSync:p,callSiteDefaultShouldRevalidate:n&&n.unstable_defaultShouldRevalidate})}function se(){U||=xi(),ve(),ie({revalidation:`loading`});let e=U.promise;return w.navigation.state===`submitting`?e:w.navigation.state===`idle`?(ce(w.historyAction,w.location,{startUninterruptedRevalidation:!0}),e):(ce(T||w.historyAction,w.navigation.location,{overrideNavigation:w.navigation,enableViewTransition:k===!0}),e)}async function ce(t,n,r){O&&O.abort(),O=null,T=t,M=(r&&r.startUninterruptedRevalidation)===!0,Fe(w.location,w.matches),D=(r&&r.preventScrollReset)===!0,k=(r&&r.enableViewTransition)===!0;let i=c||s,a=r&&r.overrideNavigation,o=r?.initialHydration&&w.matches&&w.matches.length>0&&!y?w.matches:$t(i,n,l),u=(r&&r.flushSync)===!0;if(o&&w.initialized&&!N&&Qr(w.location,n)&&!(r&&r.submission&&ui(r.submission.formMethod))){ae(n,{matches:o},{flushSync:u});return}let d=Le(o,i,n.pathname);if(d.active&&d.matches&&(o=d.matches),!o){let{error:e,notFoundMatches:t,route:r}=Me(n.pathname);ae(n,{matches:t,loaderData:{},errors:{[r.id]:e}},{flushSync:u});return}O=new AbortController;let f=zr(e.history,n,O.signal,r&&r.submission),p=e.getContext?await e.getContext():new Gt,m;if(r&&r.pendingError)m=[qr(o).route.id,{type:`error`,error:r.pendingError}];else if(r&&r.submission&&ui(r.submission.formMethod)){let t=await le(f,n,r.submission,o,p,d.active,r&&r.initialHydration===!0,{replace:r.replace,flushSync:u});if(t.shortCircuited)return;if(t.pendingActionResult){let[e,r]=t.pendingActionResult;if(ri(r)&&In(r.error)&&r.error.status===404){O=null,ae(n,{matches:t.matches,loaderData:{},errors:{[e]:r.error}});return}}o=t.matches||o,m=t.pendingActionResult,a=mi(n,r.submission),u=!1,d.active=!1,f=zr(e.history,f.url,f.signal)}let{shortCircuited:h,matches:g,loaderData:_,errors:v}=await ue(f,n,o,p,d.active,a,r&&r.submission,r&&r.fetcherSubmission,r&&r.replace,r&&r.initialHydration===!0,u,m,r&&r.callSiteDefaultShouldRevalidate);h||(O=null,ae(n,{matches:g||o,...Kr(m),loaderData:_,errors:v}))}async function le(t,n,i,c,u,d,f,p={}){if(ve(),ie({navigation:hi(n,i)},{flushSync:p.flushSync===!0}),d){let e=await Re(c,n.pathname,t.signal);if(e.type===`aborted`)return{shortCircuited:!0};if(e.type===`error`){if(e.partialMatches.length===0){let{matches:t,route:n}=Jr(s);return{matches:t,pendingActionResult:[n.id,{type:`error`,error:e.error}]}}let t=qr(e.partialMatches).route.id;return{matches:e.partialMatches,pendingActionResult:[t,{type:`error`,error:e.error}]}}else if(e.matches)c=e.matches;else{let{notFoundMatches:e,error:t,route:r}=Me(n.pathname);return{matches:e,pendingActionResult:[r.id,{type:`error`,error:t}]}}}let m,h=fi(c,n);if(!h.route.action&&!h.route.lazy)m={type:`error`,error:Yr(405,{method:t.method,pathname:n.pathname,routeId:h.route.id})};else{let e=await ge(t,n,jr(a,o,t,n,c,h,f?[]:r,u),u,null);if(m=e[h.route.id],!m){for(let t of c)if(e[t.route.id]){m=e[t.route.id];break}}if(t.signal.aborted)return{shortCircuited:!0}}if(ii(m)){let n;return n=p&&p.replace!=null?p.replace:Rr(m.response.headers.get(`Location`),new URL(t.url),l,e.history)===w.location.pathname+w.location.search,await G(t,m,!0,{submission:i,replace:n}),{shortCircuited:!0}}if(ri(m)){let e=qr(c,h.route.id);return(p&&p.replace)!==!0&&(T=`PUSH`),{matches:c,pendingActionResult:[e.route.id,m,h.route.id]}}return{matches:c,pendingActionResult:[h.route.id,m]}}async function ue(t,n,i,u,d,f,p,m,h,g,_,v,y){let b=f||mi(n,p),x=p||m||pi(b),S=!M&&!g;if(d){if(S){let e=de(v);ie({navigation:b,...e===void 0?{}:{actionData:e}},{flushSync:_})}let e=await Re(i,n.pathname,t.signal);if(e.type===`aborted`)return{shortCircuited:!0};if(e.type===`error`){if(e.partialMatches.length===0){let{matches:t,route:n}=Jr(s);return{matches:t,loaderData:{},errors:{[n.id]:e.error}}}let t=qr(e.partialMatches).route.id;return{matches:e.partialMatches,loaderData:{},errors:{[t]:e.error}}}else if(e.matches)i=e.matches;else{let{error:e,notFoundMatches:t,route:r}=Me(n.pathname);return{matches:t,loaderData:{},errors:{[r.id]:e}}}}let C=c||s,{dsMatches:T,revalidatingFetchers:E}=fr(t,u,a,o,e.history,w,i,x,n,g?[]:r,g===!0,N,P,H,B,z,C,l,e.patchRoutesOnNavigation!=null,v,y);if(L=++I,!e.dataStrategy&&!T.some(e=>e.shouldLoad)&&!T.some(e=>e.route.middleware&&e.route.middleware.length>0)&&E.length===0){let e=Ee();return ae(n,{matches:i,loaderData:{},errors:v&&ri(v[1])?{[v[0]]:v[1].error}:null,...Kr(v),...e?{fetchers:new Map(w.fetchers)}:{}},{flushSync:_}),{shortCircuited:!0}}if(S){let e={};if(!d){e.navigation=b;let t=de(v);t!==void 0&&(e.actionData=t)}E.length>0&&(e.fetchers=fe(E)),ie(e,{flushSync:_})}E.forEach(e=>{we(e.key),e.controller&&F.set(e.key,e.controller)});let D=()=>E.forEach(e=>we(e.key));O&&O.signal.addEventListener(`abort`,D);let{loaderResults:k,fetcherResults:A}=await _e(T,E,t,n,u);if(t.signal.aborted)return{shortCircuited:!0};O&&O.signal.removeEventListener(`abort`,D),E.forEach(e=>F.delete(e.key));let j=Xr(k);if(j)return await G(t,j.result,!0,{replace:h}),{shortCircuited:!0};if(j=Xr(A),j)return z.add(j.key),await G(t,j.result,!0,{replace:h}),{shortCircuited:!0};let{loaderData:R,errors:V}=Wr(w,i,k,v,E,A);g&&w.errors&&(V={...w.errors,...V});let ee=Ee(),te=De(L),U=ee||te||E.length>0;return{matches:i,loaderData:R,errors:V,...U?{fetchers:new Map(w.fetchers)}:{}}}function de(e){if(e&&!ri(e[1]))return{[e[0]]:e[1].data};if(w.actionData)return Object.keys(w.actionData).length===0?null:w.actionData}function fe(e){return e.forEach(e=>{let t=w.fetchers.get(e.key),n=gi(void 0,t?t.data:void 0);w.fetchers.set(e.key,n)}),new Map(w.fetchers)}async function pe(t,n,r,i){we(t);let a=(i&&i.flushSync)===!0,o=c||s,u=ur(w.location,w.matches,l,r,n,i?.relative),d=$t(o,u,l),f=Le(d,o,u);if(f.active&&f.matches&&(d=f.matches),!d){be(t,n,Yr(404,{pathname:u}),{flushSync:a});return}let{path:p,submission:m,error:h}=dr(!0,u,i);if(h){be(t,n,h,{flushSync:a});return}let g=e.getContext?await e.getContext():new Gt,_=(i&&i.preventScrollReset)===!0;if(m&&ui(m.formMethod)){await me(t,n,p,d,g,f.active,a,_,m,i&&i.unstable_defaultShouldRevalidate);return}B.set(t,{routeId:n,path:p}),await he(t,n,p,d,g,f.active,a,_,m)}async function me(t,n,i,u,d,f,p,m,h,g){ve(),B.delete(t),ye(t,_i(h,w.fetchers.get(t)),{flushSync:p});let _=new AbortController,v=zr(e.history,i,_.signal,h);if(f){let e=await Re(u,new URL(v.url).pathname,v.signal,t);if(e.type===`aborted`)return;if(e.type===`error`){be(t,n,e.error,{flushSync:p});return}else if(e.matches)u=e.matches;else{be(t,n,Yr(404,{pathname:i}),{flushSync:p});return}}let y=fi(u,i);if(!y.route.action&&!y.route.lazy){be(t,n,Yr(405,{method:h.formMethod,pathname:i,routeId:n}),{flushSync:p});return}F.set(t,_);let b=I,x=jr(a,o,v,i,u,y,r,d),S=await ge(v,i,x,d,t),C=S[y.route.id];if(!C){for(let e of x)if(S[e.route.id]){C=S[e.route.id];break}}if(v.signal.aborted){F.get(t)===_&&F.delete(t);return}if(H.has(t)){if(ii(C)||ri(C)){ye(t,vi(void 0));return}}else{if(ii(C))if(F.delete(t),L>b){ye(t,vi(void 0));return}else return z.add(t),ye(t,gi(h)),G(v,C,!1,{fetcherSubmission:h,preventScrollReset:m});if(ri(C)){be(t,n,C.error);return}}let E=w.navigation.location||w.location,D=zr(e.history,E,_.signal),k=c||s,A=w.navigation.state===`idle`?w.matches:$t(k,w.navigation.location,l);Ft(A,`Didn't find any matches after fetcher action`);let j=++I;R.set(t,j);let M=gi(h,C.data);w.fetchers.set(t,M);let{dsMatches:V,revalidatingFetchers:ee}=fr(D,d,a,o,e.history,w,A,h,E,r,!1,N,P,H,B,z,k,l,e.patchRoutesOnNavigation!=null,[y.route.id,C],g);ee.filter(e=>e.key!==t).forEach(e=>{let t=e.key,n=w.fetchers.get(t),r=gi(void 0,n?n.data:void 0);w.fetchers.set(t,r),we(t),e.controller&&F.set(t,e.controller)}),ie({fetchers:new Map(w.fetchers)});let te=()=>ee.forEach(e=>we(e.key));_.signal.addEventListener(`abort`,te);let{loaderResults:U,fetcherResults:ne}=await _e(V,ee,D,E,d);if(_.signal.aborted)return;if(_.signal.removeEventListener(`abort`,te),R.delete(t),F.delete(t),ee.forEach(e=>F.delete(e.key)),w.fetchers.has(t)){let e=vi(C.data);w.fetchers.set(t,e)}let re=Xr(U);if(re)return G(D,re.result,!1,{preventScrollReset:m});if(re=Xr(ne),re)return z.add(re.key),G(D,re.result,!1,{preventScrollReset:m});let{loaderData:W,errors:oe}=Wr(w,A,U,void 0,ee,ne);De(j),w.navigation.state===`loading`&&j>L?(Ft(T,`Expected pending action`),O&&O.abort(),ae(w.navigation.location,{matches:A,loaderData:W,errors:oe,fetchers:new Map(w.fetchers)})):(ie({errors:oe,loaderData:Gr(w.loaderData,W,A,oe),fetchers:new Map(w.fetchers)}),N=!1)}async function he(t,n,i,s,c,l,u,d,f){let p=w.fetchers.get(t);ye(t,gi(f,p?p.data:void 0),{flushSync:u});let m=new AbortController,h=zr(e.history,i,m.signal);if(l){let e=await Re(s,new URL(h.url).pathname,h.signal,t);if(e.type===`aborted`)return;if(e.type===`error`){be(t,n,e.error,{flushSync:u});return}else if(e.matches)s=e.matches;else{be(t,n,Yr(404,{pathname:i}),{flushSync:u});return}}let g=fi(s,i);F.set(t,m);let _=I,v=await ge(h,i,jr(a,o,h,i,s,g,r,c),c,t),y=v[g.route.id];if(!y){for(let e of s)if(v[e.route.id]){y=v[e.route.id];break}}if(F.get(t)===m&&F.delete(t),!h.signal.aborted){if(H.has(t)){ye(t,vi(void 0));return}if(ii(y))if(L>_){ye(t,vi(void 0));return}else{z.add(t),await G(h,y,!1,{preventScrollReset:d});return}if(ri(y)){be(t,n,y.error);return}ye(t,vi(y.data))}}async function G(r,i,a,{submission:o,fetcherSubmission:s,preventScrollReset:c,replace:u}={}){a||(E?.resolve(),E=null),i.response.headers.has(`X-Remix-Revalidate`)&&(N=!0);let d=i.response.headers.get(`Location`);Ft(d,`Expected a Location header on the redirect Response`),d=Rr(d,new URL(r.url),l,e.history);let f=zt(w.location,d,{_isRedirect:!0});if(n){let e=!1;if(i.response.headers.has(`X-Remix-Reload-Document`))e=!0;else if(Sn(d)){let n=Ut(d,!0);e=n.origin!==t.location.origin||yn(n.pathname,l)==null}if(e){u?t.location.replace(d):t.location.assign(d);return}}O=null;let p=u===!0||i.response.headers.has(`X-Remix-Replace`)?`REPLACE`:`PUSH`,{formMethod:m,formAction:h,formEncType:g}=w.navigation;!o&&!s&&m&&h&&g&&(o=pi(w.navigation));let _=o||s;nr.has(i.response.status)&&_&&ui(_.formMethod)?await ce(p,f,{submission:{..._,formAction:d},preventScrollReset:c||D,enableViewTransition:a?k:void 0}):await ce(p,f,{overrideNavigation:mi(f,o),fetcherSubmission:s,preventScrollReset:c||D,enableViewTransition:a?k:void 0})}async function ge(e,t,n,r,i){let a,o={};try{a=await Mr(u,e,t,n,i,r,!1)}catch(e){return n.filter(e=>e.shouldLoad).forEach(t=>{o[t.route.id]={type:`error`,error:e}}),o}if(e.signal.aborted)return o;if(!ui(e.method))for(let e of n){if(a[e.route.id]?.type===`error`)break;!a.hasOwnProperty(e.route.id)&&!w.loaderData.hasOwnProperty(e.route.id)&&(!w.errors||!w.errors.hasOwnProperty(e.route.id))&&e.shouldCallHandler()&&(a[e.route.id]={type:`error`,result:Error(`No result returned from dataStrategy for route ${e.route.id}`)})}for(let[t,r]of Object.entries(a))if(ni(r)){let i=r.result;o[t]={type:`redirect`,response:Ir(i,e,t,n,l)}}else o[t]=await Fr(r);return o}async function _e(e,t,n,r,i){let a=ge(n,r,e,i,null),o=Promise.all(t.map(async e=>{if(e.matches&&e.match&&e.request&&e.controller){let t=(await ge(e.request,e.path,e.matches,i,e.key))[e.match.route.id];return{[e.key]:t}}else return Promise.resolve({[e.key]:{type:`error`,error:Yr(404,{pathname:e.path})}})}));return{loaderResults:await a,fetcherResults:(await o).reduce((e,t)=>Object.assign(e,t),{})}}function ve(){N=!0,B.forEach((e,t)=>{F.has(t)&&P.add(t),we(t)})}function ye(e,t,n={}){w.fetchers.set(e,t),ie({fetchers:new Map(w.fetchers)},{flushSync:(n&&n.flushSync)===!0})}function be(e,t,n,r={}){let i=qr(w.matches,t);Se(e),ie({errors:{[i.route.id]:n},fetchers:new Map(w.fetchers)},{flushSync:(r&&r.flushSync)===!0})}function K(e){return V.set(e,(V.get(e)||0)+1),H.has(e)&&H.delete(e),w.fetchers.get(e)||eee}function xe(e,t){we(e,t?.reason),ye(e,vi(null))}function Se(e){let t=w.fetchers.get(e);F.has(e)&&!(t&&t.state===`loading`&&R.has(e))&&we(e),B.delete(e),R.delete(e),z.delete(e),H.delete(e),P.delete(e),w.fetchers.delete(e)}function Ce(e){let t=(V.get(e)||0)-1;t<=0?(V.delete(e),H.add(e)):V.set(e,t),ie({fetchers:new Map(w.fetchers)})}function we(e,t){let n=F.get(e);n&&(n.abort(t),F.delete(e))}function Te(e){for(let t of e){let e=vi(K(t).data);w.fetchers.set(t,e)}}function Ee(){let e=[],t=!1;for(let n of z){let r=w.fetchers.get(n);Ft(r,`Expected fetcher: ${n}`),r.state===`loading`&&(z.delete(n),e.push(n),t=!0)}return Te(e),t}function De(e){let t=[];for(let[n,r]of R)if(r<e){let e=w.fetchers.get(n);Ft(e,`Expected fetcher: ${n}`),e.state===`loading`&&(we(n),R.delete(n),t.push(n))}return Te(t),t.length>0}function Oe(e,t){let n=w.blockers.get(e)||ir;return ee.get(e)!==t&&ee.set(e,t),n}function ke(e){w.blockers.delete(e),ee.delete(e)}function Ae(e,t){let n=w.blockers.get(e)||ir;Ft(n.state===`unblocked`&&t.state===`blocked`||n.state===`blocked`&&t.state===`blocked`||n.state===`blocked`&&t.state===`proceeding`||n.state===`blocked`&&t.state===`unblocked`||n.state===`proceeding`&&t.state===`unblocked`,`Invalid blocker state transition: ${n.state} -> ${t.state}`);let r=new Map(w.blockers);r.set(e,t),ie({blockers:r})}function je({currentLocation:e,nextLocation:t,historyAction:n}){if(ee.size===0)return;ee.size>1&&It(!1,`A router only supports one blocker at a time`);let r=Array.from(ee.entries()),[i,a]=r[r.length-1],o=w.blockers.get(i);if(!(o&&o.state===`proceeding`)&&a({currentLocation:e,nextLocation:t,historyAction:n}))return i}function Me(e){let t=Yr(404,{pathname:e}),{matches:n,route:r}=Jr(c||s);return{notFoundMatches:n,route:r,error:t}}function Ne(e,t,n){if(m=e,g=t,h=n||null,!_&&w.navigation===rr){_=!0;let e=Ie(w.location,w.matches);e!=null&&ie({restoreScrollPosition:e})}return()=>{m=null,g=null,h=null}}function Pe(e,t){return h&&h(e,t.map(e=>tn(e,w.loaderData)))||e.key}function Fe(e,t){if(m&&g){let n=Pe(e,t);m[n]=g()}}function Ie(e,t){if(m){let n=Pe(e,t),r=m[n];if(typeof r==`number`)return r}return null}function Le(t,n,r){if(e.patchRoutesOnNavigation){if(!t)return{active:!0,matches:en(n,r,l,!0)||[]};if(Object.keys(t[0].params).length>0)return{active:!0,matches:en(n,r,l,!0)}}return{active:!1,matches:null}}async function Re(t,n,r,i){if(!e.patchRoutesOnNavigation)return{type:`success`,matches:t};let u=t;for(;;){let t=c==null,d=c||s,f=o;try{await e.patchRoutesOnNavigation({signal:r,path:n,matches:u,fetcherKey:i,patch:(e,t)=>{r.aborted||vr(e,t,d,f,a,!1)}})}catch(e){return{type:`error`,error:e,partialMatches:u}}finally{t&&!r.aborted&&(s=[...s])}if(r.aborted)return{type:`aborted`};let p=$t(d,n,l),m=null;if(p&&(Object.keys(p[0].params).length===0||(m=en(d,n,l,!0),!(m&&u.length<m.length&&ze(u,m.slice(0,u.length))))))return{type:`success`,matches:p};if(m||=en(d,n,l,!0),!m||ze(u,m))return{type:`success`,matches:null};u=m}}function ze(e,t){return e.length===t.length&&e.every((e,n)=>e.route.id===t[n].route.id)}function Be(e){o={},c=Zt(e,a,void 0,o)}function Ve(e,t,n=!1){let r=c==null;vr(e,t,c||s,o,a,n),r&&(s=[...s],ie({}))}return C={get basename(){return l},get future(){return d},get state(){return w},get routes(){return s},get window(){return t},initialize:ne,subscribe:W,enableScrollRestoration:Ne,navigate:oe,fetch:pe,revalidate:se,createHref:t=>e.history.createHref(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:K,resetFetcher:xe,deleteFetcher:Ce,dispose:re,getBlocker:Oe,deleteBlocker:ke,patchRoutes:Ve,_internalFetchControllers:F,_internalSetRoutes:Be,_internalSetStateDoNotUseOrYouWillBreakYourApp(e){ie(e)}},e.unstable_instrumentations&&(C=Hn(C,e.unstable_instrumentations.map(e=>e.router).filter(Boolean))),C}function lr(e){return e!=null&&(`formData`in e&&e.formData!=null||`body`in e&&e.body!==void 0)}function ur(e,t,n,r,i,a){let o,s;if(i){o=[];for(let e of t)if(o.push(e),e.route.id===i){s=e;break}}else o=t,s=t[t.length-1];let c=On(r||`.`,Dn(o),yn(e.pathname,n)||e.pathname,a===`path`);if(r??(c.search=e.search,c.hash=e.hash),(r==null||r===``||r===`.`)&&s){let e=di(c.search);if(s.route.index&&!e)c.search=c.search?c.search.replace(/^\?/,`?index&`):`?index`;else if(!s.route.index&&e){let e=new URLSearchParams(c.search),t=e.getAll(`index`);e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();c.search=n?`?${n}`:``}}return n!==`/`&&(c.pathname=bn({basename:n,pathname:c.pathname})),Bt(c)}function dr(e,t,n){if(!n||!lr(n))return{path:t};if(n.formMethod&&!li(n.formMethod))return{path:t,error:Yr(405,{method:n.formMethod})};let r=()=>({path:t,error:Yr(400,{type:`invalid-body`})}),i=(n.formMethod||`get`).toUpperCase(),a=Zr(t);if(n.body!==void 0){if(n.formEncType===`text/plain`){if(!ui(i))return r();let e=typeof n.body==`string`?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((e,[t,n])=>`${e}${t}=${n}
3
3
  `,``):String(n.body);return{path:t,submission:{formMethod:i,formAction:a,formEncType:n.formEncType,formData:void 0,json:void 0,text:e}}}else if(n.formEncType===`application/json`){if(!ui(i))return r();try{let e=typeof n.body==`string`?JSON.parse(n.body):n.body;return{path:t,submission:{formMethod:i,formAction:a,formEncType:n.formEncType,formData:void 0,json:e,text:void 0}}}catch{return r()}}}Ft(typeof FormData==`function`,`FormData is not available in this environment`);let o,s;if(n.formData)o=Vr(n.formData),s=n.formData;else if(n.body instanceof FormData)o=Vr(n.body),s=n.body;else if(n.body instanceof URLSearchParams)o=n.body,s=Hr(o);else if(n.body==null)o=new URLSearchParams,s=new FormData;else try{o=new URLSearchParams(n.body),s=Hr(o)}catch{return r()}let c={formMethod:i,formAction:a,formEncType:n&&n.formEncType||`application/x-www-form-urlencoded`,formData:s,json:void 0,text:void 0};if(ui(c.formMethod))return{path:t,submission:c};let l=Vt(t);return e&&l.search&&di(l.search)&&o.append(`index`,``),l.search=`?${o}`,{path:Bt(l),submission:c}}function fr(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b){let x=y?ri(y[1])?y[1].error:y[1].data:void 0,S=i.createURL(a.location),C=i.createURL(c),w;if(u&&a.errors){let e=Object.keys(a.errors)[0];w=o.findIndex(t=>t.route.id===e)}else if(y&&ri(y[1])){let e=y[0];w=o.findIndex(t=>t.route.id===e)-1}let T=y?y[1].statusCode:void 0,E=T&&T>=400,D={currentUrl:S,currentParams:a.matches[0]?.params||{},nextUrl:C,nextParams:o[0].params,...s,actionResult:x,actionStatus:T},O=Ln(o),k=o.map((i,o)=>{let{route:s}=i,f=null;if(w!=null&&o>w)f=!1;else if(s.lazy)f=!0;else if(!pr(s))f=!1;else if(u){let{shouldLoad:e}=mr(s,a.loaderData,a.errors);f=e}else hr(a.loaderData,a.matches[o],i)&&(f=!0);if(f!==null)return Ar(n,r,e,c,O,i,l,t,f);let p=!1;typeof b==`boolean`?p=b:E?p=!1:d||S.pathname+S.search===C.pathname+C.search?p=!0:S.search===C.search?gr(a.matches[o],i)&&(p=!0):p=!0;let m={...D,defaultShouldRevalidate:p};return Ar(n,r,e,c,O,i,l,t,_r(i,m),m,b)}),A=[];return m.forEach((e,s)=>{if(u||!o.some(t=>t.route.id===e.routeId)||p.has(s))return;let c=a.fetchers.get(s),m=c&&c.state!==`idle`&&c.data===void 0,y=$t(g,e.path,_);if(!y){if(v&&m)return;A.push({key:s,routeId:e.routeId,path:e.path,matches:null,match:null,request:null,controller:null});return}if(h.has(s))return;let x=fi(y,e.path),S=new AbortController,C=zr(i,e.path,S.signal),w=null;if(f.has(s))f.delete(s),w=jr(n,r,C,e.path,y,x,l,t);else if(m)d&&(w=jr(n,r,C,e.path,y,x,l,t));else{let i;i=typeof b==`boolean`?b:E?!1:d;let a={...D,defaultShouldRevalidate:i};_r(x,a)&&(w=jr(n,r,C,e.path,y,x,l,t,a))}w&&A.push({key:s,routeId:e.routeId,path:e.path,matches:w,match:x,request:C,controller:S})}),{dsMatches:k,revalidatingFetchers:A}}function pr(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function mr(e,t,n){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!pr(e))return{shouldLoad:!1,renderFallback:!1};let r=t!=null&&e.id in t,i=n!=null&&n[e.id]!==void 0;if(!r&&i)return{shouldLoad:!1,renderFallback:!1};if(typeof e.loader==`function`&&e.loader.hydrate===!0)return{shouldLoad:!0,renderFallback:!r};let a=!r&&!i;return{shouldLoad:a,renderFallback:a}}function hr(e,t,n){let r=!t||n.route.id!==t.route.id,i=!e.hasOwnProperty(n.route.id);return r||i}function gr(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith(`*`)&&e.params[`*`]!==t.params[`*`]}function _r(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n==`boolean`)return n}return t.defaultShouldRevalidate}function vr(e,t,n,r,i,a){let o;if(e){let t=r[e];Ft(t,`No route found to patch children into: routeId = ${e}`),t.children||=[],o=t.children}else o=n;let s=[],c=[];if(t.forEach(e=>{let t=o.find(t=>yr(e,t));t?c.push({existingRoute:t,newRoute:e}):s.push(e)}),s.length>0){let t=Zt(s,i,[e||`_`,`patch`,String(o?.length||`0`)],r);o.push(...t)}if(a&&c.length>0)for(let e=0;e<c.length;e++){let{existingRoute:t,newRoute:n}=c[e],r=t,[a]=Zt([n],i,[],{},!0);Object.assign(r,{element:a.element?a.element:r.element,errorElement:a.errorElement?a.errorElement:r.errorElement,hydrateFallbackElement:a.hydrateFallbackElement?a.hydrateFallbackElement:r.hydrateFallbackElement})}}function yr(e,t){return`id`in e&&`id`in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children?.every((e,n)=>t.children?.some(t=>yr(e,t)))??!1:!1}var br=new WeakMap,xr=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let i=n[t.id];if(Ft(i,`No route found in manifest`),!i.lazy||typeof i.lazy!=`object`)return;let a=i.lazy[e];if(!a)return;let o=br.get(i);o||(o={},br.set(i,o));let s=o[e];if(s)return s;let c=(async()=>{let t=qt(e),n=i[e]!==void 0&&e!==`hasErrorBoundary`;if(t)It(!t,`Route property `+e+` is not a supported lazy route property. This property will be ignored.`),o[e]=Promise.resolve();else if(n)It(!1,`Route "${i.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let t=await a();t!=null&&(Object.assign(i,{[e]:t}),Object.assign(i,r(i)))}typeof i.lazy==`object`&&(i.lazy[e]=void 0,Object.values(i.lazy).every(e=>e===void 0)&&(i.lazy=void 0))})();return o[e]=c,c},Sr=new WeakMap;function Cr(e,t,n,r,i){let a=n[e.id];if(Ft(a,`No route found in manifest`),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy==`function`){let t=Sr.get(a);if(t)return{lazyRoutePromise:t,lazyHandlerPromise:t};let n=(async()=>{Ft(typeof e.lazy==`function`,`No lazy route function found`);let t=await e.lazy(),n={};for(let e in t){let r=t[e];if(r===void 0)continue;let i=Yt(e),o=a[e]!==void 0&&e!==`hasErrorBoundary`;i?It(!i,`Route property `+e+` is not a supported property to be returned from a lazy route function. This property will be ignored.`):o?It(!o,`Route "${a.id}" has a static property "${e}" defined but its lazy function is also returning a value for this property. The lazy route property "${e}" will be ignored.`):n[e]=r}Object.assign(a,n),Object.assign(a,{...r(a),lazy:void 0})})();return Sr.set(a,n),n.catch(()=>{}),{lazyRoutePromise:n,lazyHandlerPromise:n}}let o=Object.keys(e.lazy),s=[],c;for(let a of o){if(i&&i.includes(a))continue;let o=xr({key:a,route:e,manifest:n,mapRouteProperties:r});o&&(s.push(o),a===t&&(c=o))}let l=s.length>0?Promise.all(s).then(()=>{}):void 0;return l?.catch(()=>{}),c?.catch(()=>{}),{lazyRoutePromise:l,lazyHandlerPromise:c}}async function wr(e){let t=e.matches.filter(e=>e.shouldLoad),n={};return(await Promise.all(t.map(e=>e.resolve()))).forEach((e,r)=>{n[t[r].route.id]=e}),n}async function Tr(e){return e.matches.some(e=>e.route.middleware)?Er(e,()=>wr(e)):wr(e)}function Er(e,t){return Dr(e,t,e=>{if(ci(e))throw e;return e},ei,n);function n(t,n,r){if(r)return Promise.resolve(Object.assign(r.value,{[n]:{type:`error`,result:t}}));{let{matches:r}=e,i=qr(r,r[Math.min(Math.max(r.findIndex(e=>e.route.id===n),0),Math.max(r.findIndex(e=>e.shouldCallHandler()),0))].route.id).route.id;return Promise.resolve({[i]:{type:`error`,result:t}})}}}async function Dr(e,t,n,r,i){let{matches:a,...o}=e;return await Or(o,a.flatMap(e=>e.route.middleware?e.route.middleware.map(t=>[e.route.id,t]):[]),t,n,r,i)}async function Or(e,t,n,r,i,a,o=0){let{request:s}=e;if(s.signal.aborted)throw s.signal.reason??Error(`Request aborted: ${s.method} ${s.url}`);let c=t[o];if(!c)return await n();let[l,u]=c,d,f=async()=>{if(d)throw Error("You may only call `next()` once per middleware");try{return d={value:await Or(e,t,n,r,i,a,o+1)},d.value}catch(e){return d={value:await a(e,l,d)},d.value}};try{let t=await u(e,f),n=t==null?void 0:r(t);return i(n)?n:d?n??d.value:(d={value:await f()},d.value)}catch(e){return await a(e,l,d)}}function kr(e,t,n,r,i){let a=xr({key:`middleware`,route:r.route,manifest:t,mapRouteProperties:e}),o=Cr(r.route,ui(n.method)?`action`:`loader`,t,e,i);return{middleware:a,route:o.lazyRoutePromise,handler:o.lazyHandlerPromise}}function Ar(e,t,n,r,i,a,o,s,c,l=null,u){let d=!1,f=kr(e,t,n,a,o);return{...a,_lazyPromises:f,shouldLoad:c,shouldRevalidateArgs:l,shouldCallHandler(e){return d=!0,l?typeof u==`boolean`?_r(a,{...l,defaultShouldRevalidate:u}):typeof e==`boolean`?_r(a,{...l,defaultShouldRevalidate:e}):_r(a,l):c},resolve(e){let{lazy:t,loader:o,middleware:l}=a.route,u=d||c||e&&!ui(n.method)&&(t||o),p=l&&l.length>0&&!o&&!t;return u&&(ui(n.method)||!p)?Nr({request:n,path:r,unstable_pattern:i,match:a,lazyHandlerPromise:f?.handler,lazyRoutePromise:f?.route,handlerOverride:e,scopedContext:s}):Promise.resolve({type:`data`,result:void 0})}}}function jr(e,t,n,r,i,a,o,s,c=null){return i.map(l=>l.route.id===a.route.id?Ar(e,t,n,r,Ln(i),l,o,s,!0,c):{...l,shouldLoad:!1,shouldRevalidateArgs:c,shouldCallHandler:()=>!1,_lazyPromises:kr(e,t,n,l,o),resolve:()=>Promise.resolve({type:`data`,result:void 0})})}async function Mr(e,t,n,r,i,a,o){r.some(e=>e._lazyPromises?.middleware)&&await Promise.all(r.map(e=>e._lazyPromises?.middleware));let s={request:t,unstable_url:Br(t,n),unstable_pattern:Ln(r),params:r[0].params,context:a,matches:r},c=o?()=>{throw Error("You cannot call `runClientMiddleware()` from a static handler `dataStrategy`. Middleware is run outside of `dataStrategy` during SSR in order to bubble up the Response. You can enable middleware via the `respond` API in `query`/`queryRoute`")}:e=>{let t=s;return Er(t,()=>e({...t,fetcherKey:i,runClientMiddleware:()=>{throw Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))},l=await e({...s,fetcherKey:i,runClientMiddleware:c});try{await Promise.all(r.flatMap(e=>[e._lazyPromises?.handler,e._lazyPromises?.route]))}catch{}return l}async function Nr({request:e,path:t,unstable_pattern:n,match:r,lazyHandlerPromise:i,lazyRoutePromise:a,handlerOverride:o,scopedContext:s}){let c,l,u=ui(e.method),d=u?`action`:`loader`,f=i=>{let a,c=new Promise((e,t)=>a=t);l=()=>a(),e.signal.addEventListener(`abort`,l);let u=a=>typeof i==`function`?i({request:e,unstable_url:Br(e,t),unstable_pattern:n,params:r.params,context:s},...a===void 0?[]:[a]):Promise.reject(Error(`You cannot call the handler for a route which defines a boolean "${d}" [routeId: ${r.route.id}]`)),f=(async()=>{try{return{type:`data`,result:await(o?o(e=>u(e)):u())}}catch(e){return{type:`error`,result:e}}})();return Promise.race([f,c])};try{let t=u?r.route.action:r.route.loader;if(i||a)if(t){let e,[n]=await Promise.all([f(t).catch(t=>{e=t}),i,a]);if(e!==void 0)throw e;c=n}else{await i;let t=u?r.route.action:r.route.loader;if(t)[c]=await Promise.all([f(t),a]);else if(d===`action`){let t=new URL(e.url),n=t.pathname+t.search;throw Yr(405,{method:e.method,pathname:n,routeId:r.route.id})}else return{type:`data`,result:void 0}}else if(t)c=await f(t);else{let t=new URL(e.url);throw Yr(404,{pathname:t.pathname+t.search})}}catch(e){return{type:`error`,result:e}}finally{l&&e.signal.removeEventListener(`abort`,l)}return c}async function Pr(e){let t=e.headers.get(`Content-Type`);return t&&/\bapplication\/json\b/.test(t)?e.body==null?null:e.json():e.text()}async function Fr(e){let{result:t,type:n}=e;if(oi(t)){let e;try{e=await Pr(t)}catch(e){return{type:`error`,error:e}}return n===`error`?{type:`error`,error:new Fn(t.status,t.statusText,e),statusCode:t.status,headers:t.headers}:{type:`data`,data:e,statusCode:t.status,headers:t.headers}}return n===`error`?ai(t)?t.data instanceof Error?{type:`error`,error:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`error`,error:$r(t),statusCode:In(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`error`,error:t,statusCode:In(t)?t.status:void 0}:ai(t)?{type:`data`,data:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`data`,data:t}}function Ir(e,t,n,r,i){let a=e.headers.get(`Location`);if(Ft(a,`Redirects returned/thrown from loaders/actions must have a Location header`),!Sn(a)){let o=r.slice(0,r.findIndex(e=>e.route.id===n)+1);a=ur(new URL(t.url),o,i,a),e.headers.set(`Location`,a)}return e}var Lr=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function Rr(e,t,n,r){if(Sn(e)){let r=e,i=r.startsWith(`//`)?new URL(t.protocol+r):new URL(r);if(Lr.includes(i.protocol))throw Error(`Invalid redirect location`);let a=yn(i.pathname,n)!=null;if(i.origin===t.origin&&a)return kn(i.pathname)+i.search+i.hash}try{let t=r.createURL(e);if(Lr.includes(t.protocol))throw Error(`Invalid redirect location`)}catch{}return e}function zr(e,t,n,r){let i=e.createURL(Zr(t)).toString(),a={signal:n};if(r&&ui(r.formMethod)){let{formMethod:e,formEncType:t}=r;a.method=e.toUpperCase(),t===`application/json`?(a.headers=new Headers({"Content-Type":t}),a.body=JSON.stringify(r.json)):t===`text/plain`?a.body=r.text:t===`application/x-www-form-urlencoded`&&r.formData?a.body=Vr(r.formData):a.body=r.formData}return new Request(i,a)}function Br(e,t){let n=new URL(e.url),r=typeof t==`string`?Vt(t):t;if(n.pathname=r.pathname||`/`,r.search){let e=new URLSearchParams(r.search),t=e.getAll(`index`);e.delete(`index`);for(let n of t.filter(Boolean))e.append(`index`,n);n.search=e.size?`?${e.toString()}`:``}else n.search=``;return n.hash=r.hash||``,n}function Vr(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r==`string`?r:r.name);return t}function Hr(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function Ur(e,t,n,r=!1,i=!1){let a={},o=null,s,c=!1,l={},u=n&&ri(n[1])?n[1].error:void 0;return e.forEach(n=>{if(!(n.route.id in t))return;let d=n.route.id,f=t[d];if(Ft(!ii(f),`Cannot handle redirect results in processLoaderData`),ri(f)){let t=f.error;if(u!==void 0&&(t=u,u=void 0),o||={},i)o[d]=t;else{let n=qr(e,d);o[n.route.id]??(o[n.route.id]=t)}r||(a[d]=sr),c||(c=!0,s=In(f.error)?f.error.status:500),f.headers&&(l[d]=f.headers)}else a[d]=f.data,f.statusCode&&f.statusCode!==200&&!c&&(s=f.statusCode),f.headers&&(l[d]=f.headers)}),u!==void 0&&n&&(o={[n[0]]:u},n[2]&&(a[n[2]]=void 0)),{loaderData:a,errors:o,statusCode:s||200,loaderHeaders:l}}function Wr(e,t,n,r,i,a){let{loaderData:o,errors:s}=Ur(t,n,r);return i.filter(e=>!e.matches||e.matches.some(e=>e.shouldLoad)).forEach(t=>{let{key:n,match:r,controller:i}=t;if(i&&i.signal.aborted)return;let o=a[n];if(Ft(o,`Did not find corresponding fetcher result`),ri(o)){let t=qr(e.matches,r?.route.id);s&&s[t.route.id]||(s={...s,[t.route.id]:o.error}),e.fetchers.delete(n)}else if(ii(o))Ft(!1,`Unhandled fetcher revalidation redirect`);else{let t=vi(o.data);e.fetchers.set(n,t)}}),{loaderData:o,errors:s}}function Gr(e,t,n,r){let i=Object.entries(t).filter(([,e])=>e!==sr).reduce((e,[t,n])=>(e[t]=n,e),{});for(let a of n){let n=a.route.id;if(!t.hasOwnProperty(n)&&e.hasOwnProperty(n)&&a.route.loader&&(i[n]=e[n]),r&&r.hasOwnProperty(n))break}return i}function Kr(e){return e?ri(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function qr(e,t){return(t?e.slice(0,e.findIndex(e=>e.route.id===t)+1):[...e]).reverse().find(e=>e.route.hasErrorBoundary===!0)||e[0]}function Jr(e){let t=e.length===1?e[0]:e.find(e=>e.index||!e.path||e.path===`/`)||{id:`__shim-error-route__`};return{matches:[{params:{},pathname:``,pathnameBase:``,route:t}],route:t}}function Yr(e,{pathname:t,routeId:n,method:r,type:i,message:a}={}){let o=`Unknown Server Error`,s=`Unknown @remix-run/router error`;return e===400?(o=`Bad Request`,r&&t&&n?s=`You made a ${r} request to "${t}" but did not provide a \`loader\` for route "${n}", so there is no way to handle the request.`:i===`invalid-body`&&(s=`Unable to encode submission body`)):e===403?(o=`Forbidden`,s=`Route "${n}" does not match URL "${t}"`):e===404?(o=`Not Found`,s=`No route matches URL "${t}"`):e===405&&(o=`Method Not Allowed`,r&&t&&n?s=`You made a ${r.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${n}", so there is no way to handle the request.`:r&&(s=`Invalid request method "${r.toUpperCase()}"`)),new Fn(e||500,o,Error(s),!0)}function Xr(e){let t=Object.entries(e);for(let e=t.length-1;e>=0;e--){let[n,r]=t[e];if(ii(r))return{key:n,result:r}}}function Zr(e){return Bt({...typeof e==`string`?Vt(e):e,hash:``})}function Qr(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===``?t.hash!==``:e.hash===t.hash?!0:t.hash!==``}function $r(e){return new Fn(e.init?.status??500,e.init?.statusText??`Internal Server Error`,e.data)}function ei(e){return typeof e==`object`&&!!e&&Object.entries(e).every(([e,t])=>typeof e==`string`&&ti(t))}function ti(e){return typeof e==`object`&&!!e&&`type`in e&&`result`in e&&(e.type===`data`||e.type===`error`)}function ni(e){return oi(e.result)&&tr.has(e.result.status)}function ri(e){return e.type===`error`}function ii(e){return(e&&e.type)===`redirect`}function ai(e){return typeof e==`object`&&!!e&&`type`in e&&`data`in e&&`init`in e&&e.type===`DataWithResponseInit`}function oi(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.headers==`object`&&e.body!==void 0}function si(e){return tr.has(e)}function ci(e){return oi(e)&&si(e.status)&&e.headers.has(`Location`)}function li(e){return er.has(e.toUpperCase())}function ui(e){return Qn.has(e.toUpperCase())}function di(e){return new URLSearchParams(e).getAll(`index`).some(e=>e===``)}function fi(e,t){let n=typeof t==`string`?Vt(t).search:t.search;if(e[e.length-1].route.index&&di(n||``))return e[e.length-1];let r=En(e);return r[r.length-1]}function pi(e){let{formMethod:t,formAction:n,formEncType:r,text:i,formData:a,json:o}=e;if(!(!t||!n||!r)){if(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:i};if(a!=null)return{formMethod:t,formAction:n,formEncType:r,formData:a,json:void 0,text:void 0};if(o!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:o,text:void 0}}}function mi(e,t){return t?{state:`loading`,location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:`loading`,location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function hi(e,t){return{state:`submitting`,location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function gi(e,t){return e?{state:`loading`,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:`loading`,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function _i(e,t){return{state:`submitting`,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function vi(e){return{state:`idle`,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function yi(e,t){try{let n=e.sessionStorage.getItem(or);if(n){let e=JSON.parse(n);for(let[n,r]of Object.entries(e||{}))r&&Array.isArray(r)&&t.set(n,new Set(r||[]))}}catch{}}function bi(e,t){if(t.size>0){let n={};for(let[e,r]of t)n[e]=[...r];try{e.sessionStorage.setItem(or,JSON.stringify(n))}catch(e){It(!1,`Failed to save applied view transitions in sessionStorage (${e}).`)}}}function xi(){let e,t,n=new Promise((r,i)=>{e=async e=>{r(e);try{await n}catch{}},t=async e=>{i(e);try{await n}catch{}}});return{promise:n,resolve:e,reject:t}}var Si=z.createContext(null);Si.displayName=`DataRouter`;var Ci=z.createContext(null);Ci.displayName=`DataRouterState`;var wi=z.createContext(!1);function Ti(){return z.useContext(wi)}var Ei=z.createContext({isTransitioning:!1});Ei.displayName=`ViewTransition`;var Di=z.createContext(new Map);Di.displayName=`Fetchers`;var Oi=z.createContext(null);Oi.displayName=`Await`;var ki=z.createContext(null);ki.displayName=`Navigation`;var Ai=z.createContext(null);Ai.displayName=`Location`;var ji=z.createContext({outlet:null,matches:[],isDataRoute:!1});ji.displayName=`Route`;var Mi=z.createContext(null);Mi.displayName=`RouteError`;var Ni=`REACT_ROUTER_ERROR`,Pi=`REDIRECT`,Fi=`ROUTE_ERROR_RESPONSE`;function Ii(e){if(e.startsWith(`${Ni}:${Pi}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`&&typeof t.location==`string`&&typeof t.reloadDocument==`boolean`&&typeof t.replace==`boolean`)return t}catch{}}function Li(e){if(e.startsWith(`${Ni}:${Fi}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new Fn(t.status,t.statusText,t.data)}catch{}}function Ri(e,{relative:t}={}){Ft(zi(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=z.useContext(ki),{hash:i,pathname:a,search:o}=Ji(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:An([n,a])),r.createHref({pathname:s,search:o,hash:i})}function zi(){return z.useContext(Ai)!=null}function Bi(){return Ft(zi(),`useLocation() may be used only in the context of a <Router> component.`),z.useContext(Ai).location}var Vi=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function Hi(e){z.useContext(ki).static||z.useLayoutEffect(e)}function Ui(){let{isDataRoute:e}=z.useContext(ji);return e?fa():Wi()}function Wi(){Ft(zi(),`useNavigate() may be used only in the context of a <Router> component.`);let e=z.useContext(Si),{basename:t,navigator:n}=z.useContext(ki),{matches:r}=z.useContext(ji),{pathname:i}=Bi(),a=JSON.stringify(Dn(r)),o=z.useRef(!1);return Hi(()=>{o.current=!0}),z.useCallback((r,s={})=>{if(It(o.current,Vi),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=On(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:An([t,c.pathname])),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}var Gi=z.createContext(null);function Ki(e){let t=z.useContext(ji).outlet;return z.useMemo(()=>t&&z.createElement(Gi.Provider,{value:e},t),[t,e])}function qi(){let{matches:e}=z.useContext(ji);return e[e.length-1]?.params??{}}function Ji(e,{relative:t}={}){let{matches:n}=z.useContext(ji),{pathname:r}=Bi(),i=JSON.stringify(Dn(n));return z.useMemo(()=>On(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function Yi(e,t,n){Ft(zi(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=z.useContext(ki),{matches:i}=z.useContext(ji),a=i[i.length-1],o=a?a.params:{},s=a?a.pathname:`/`,c=a?a.pathnameBase:`/`,l=a&&a.route;{let e=l&&l.path||``;ma(s,!l||e.endsWith(`*`)||e.endsWith(`*?`),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${s}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
4
4
 
@@ -46,7 +46,7 @@ Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}
46
46
 
47
47
  If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
48
48
 
49
- For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return z.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},GU=`DialogDescriptionWarning`,KU=({contentRef:e,descriptionId:t})=>{let n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${UU(GU).contentName}}.`;return z.useEffect(()=>{let r=e.current?.getAttribute(`aria-describedby`);t&&r&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},qU=yU,JU=TU,YU=DU,XU=jU,ZU=IU,QU=RU,$U=BU;function eW(){return lB.getState().language}function tW(e,t,n){let r=e.trim().toLowerCase();return!!(!r||r===`http ${t}`||n&&r===n.trim().toLowerCase()||t===500&&r===`internal server error`)}function nW(e,t,n){let r=n?.trim()??``;if(r&&!tW(r,e,t))return r;let i=Jz(eW()).api;return e>=500?e===502?i.errorBadGateway:e===503?i.errorServiceUnavailable:e===504?i.errorGatewayTimeout:e===500?i.errorInternal:i.errorServer.replace(`{{status}}`,String(e)):e===404?i.errorNotFound:e===403?i.errorForbidden:i.errorRequest.replace(`{{status}}`,String(e))}async function rW(e,t){let n=BB.getState().token,r=new Headers(t?.headers);r.has(`Content-Type`)||r.set(`Content-Type`,`application/json`),n&&r.set(`Authorization`,`Bearer ${n}`);let i=await fetch(e,{...t,headers:r});return i.status===401&&BB.getState().onUnauthorized(),i}async function iW(e,t){let n=await rW(e,t);if(!n.ok){let e=await n.json().catch(()=>({})),t=nW(n.status,n.statusText,e.error?.message);throw Error(t)}return n.json()}function aW(){return window.location.origin}function Q(e){let t=e.startsWith(`/`)?e:`/${e}`;return`${aW()}${t}`}async function oW(){let e=await rW(Q(`/api/models`));if(!e.ok)throw Error(`Models: HTTP ${e.status}`);return(await e.json()).payload?.models??[]}var sW=null,cW=0,lW=null,uW=6e4;async function dW(e=!1){if(!e&&sW&&Date.now()<cW)return sW;if(e){let e=await oW();return sW=e,cW=Date.now()+uW,e}return lW||(lW=oW().then(e=>(sW=e,cW=Date.now()+uW,e)).finally(()=>{lW=null}),lW)}function fW(e){if(!e||typeof e!=`object`)return!0;let t=e,n=t.providers,r=Object.values(n&&typeof n==`object`&&!Array.isArray(n)?n:{}).some(e=>e===`***`),i=t.agents,a=``;if(i&&typeof i==`object`&&!Array.isArray(i)){let e=i.defaults;if(e&&typeof e==`object`&&!Array.isArray(e)){let t=e.model;typeof t==`string`&&(a=t)}}let o=a.trim().length>0;return!r||!o}function pW(){return Q(`/api/config`)}var mW=null;async function hW(){return mW||(mW=iW(pW()).finally(()=>{mW=null}),mW)}function gW(e){let t=u(e?pW():null,hW,{revalidateOnFocus:!1});return(0,z.useEffect)(()=>{if(!e)return;let t=pW(),n=()=>{s(t)};return window.addEventListener(`config-reload`,n),()=>window.removeEventListener(`config-reload`,n)},[e]),t}function _W(){return s(pW())}var vW=`xopc-onboarding-model-setup-dismissed`;function yW(){let e=BB(e=>e.token),t=Jz(lB(e=>e.language)).electron,{pathname:n}=Bi(),r=Ui(),[i,a]=(0,z.useState)(()=>typeof localStorage<`u`&&localStorage.getItem(vW)===`1`),[o,s]=(0,z.useState)(!1),[c,l]=(0,z.useState)(!1),u=n.startsWith(`/settings/agent-defaults`)||n.startsWith(`/agents`)||n.startsWith(`/settings/models`)||n.startsWith(`/settings/providers`),d=(0,z.useCallback)(async()=>{if(!e){s(!1),l(!0);return}try{let[e,t]=await Promise.all([hW(),dW().catch(()=>null)]),n=fW(e.payload?.config),r=Array.isArray(t)&&t.length===0;s(n||r)}catch{s(!0)}finally{l(!0)}},[e]);(0,z.useEffect)(()=>{d()},[d]),(0,z.useEffect)(()=>{let e=()=>void d();return window.addEventListener(`config-reload`,e),()=>window.removeEventListener(`config-reload`,e)},[d]);function f(){a(!0)}function p(){try{localStorage.setItem(vW,`1`)}catch{}a(!0)}let m=!!e&&c&&o&&!i&&!u;return(0,Z.jsx)(qU,{modal:!1,open:m,onOpenChange:e=>{!e&&!m||e||f()},children:(0,Z.jsxs)(JU,{children:[(0,Z.jsx)(YU,{className:`xopc-dialog-overlay fixed inset-0 z-[100] bg-scrim backdrop-blur-[2px]`}),(0,Z.jsxs)(XU,{className:X(`fixed left-1/2 top-1/2 z-[100] w-[min(100%-2rem,26rem)] -translate-x-1/2 -translate-y-1/2 rounded-xl border border-edge bg-surface-panel p-5 shadow-popover`,`dark:border-edge`),onOpenAutoFocus:e=>e.preventDefault(),onPointerDownOutside:()=>{u||p()},onEscapeKeyDown:()=>p(),children:[(0,Z.jsx)(ZU,{className:`text-base font-semibold text-fg`,children:t.setupBannerTitle}),(0,Z.jsx)(QU,{className:`mt-2 text-sm leading-relaxed text-fg-muted`,children:t.setupBannerBody}),(0,Z.jsxs)(`div`,{className:`mt-5 flex flex-col gap-2 sm:flex-row sm:flex-wrap sm:justify-end`,children:[(0,Z.jsx)(Kz,{type:`button`,variant:`secondary`,className:`sm:min-w-0`,onClick:()=>r(`/settings/providers`),children:t.setupBannerLinkProviders}),(0,Z.jsx)(Kz,{type:`button`,className:`bg-accent text-white hover:bg-accent/90 sm:min-w-0`,onClick:()=>r(`/agents`),children:t.setupBannerLinkModels}),(0,Z.jsx)(Kz,{type:`button`,variant:`ghost`,className:`sm:ml-0`,onClick:p,children:t.setupBannerDismiss})]})]})]})})}function bW(){return(0,Z.jsx)(Z.Fragment,{children:(0,Z.jsx)(yW,{})})}var xW=`[-webkit-app-region:drag]`,SW=`[-webkit-app-region:no-drag]`,CW=`h-14 shrink-0 items-center ${xW}`,wW=`h-14 shrink-0 items-center`,TW=`xopc-web-sidebar-collapsed`,EW=`xopc-web-sidebar-expanded-width-px`;function DW(){try{return globalThis.localStorage?.getItem(TW)===`1`}catch{return!1}}function OW(e){try{globalThis.localStorage?.setItem(TW,e?`1`:`0`)}catch{}}function kW(e){return Math.min(480,Math.max(200,Math.round(e)))}function AW(){try{let e=globalThis.localStorage?.getItem(EW);if(e==null)return 256;let t=Number.parseInt(e,10);return Number.isFinite(t)?kW(t):256}catch{return 256}}function jW(e){try{globalThis.localStorage?.setItem(EW,String(e))}catch{}}var MW=cB((e,t)=>({collapsed:DW(),setCollapsed:t=>{e({collapsed:t}),queueMicrotask(()=>OW(t))},toggleCollapsed:()=>{t().setCollapsed(!t().collapsed)},expandedWidthPx:AW(),setExpandedWidthPx:t=>{let n=kW(t);e({expandedWidthPx:n}),queueMicrotask(()=>jW(n))}})),NW=(0,z.memo)(function({variant:e=`sidebar`,className:t}){let n=Jz(lB(e=>e.language)),r=MW(e=>e.collapsed),i=MW(e=>e.toggleCollapsed);return(0,Z.jsx)(Kz,{type:`button`,variant:`ghost`,className:X(`size-8 shrink-0 rounded-xl p-0`,e===`sidebar`?`hidden md:inline-flex`:`inline-flex`,SW,t),"aria-expanded":!r,"aria-controls":`app-sidebar`,"aria-label":r?n.sidebarExpand:n.sidebarCollapse,onClick:()=>i(),children:r?(0,Z.jsx)(ZE,{className:`size-4`,strokeWidth:1.5,"aria-hidden":!0}):(0,Z.jsx)(qE,{className:`size-4`,strokeWidth:1.5,"aria-hidden":!0})})}),PW=(0,z.memo)(function({className:e}){let{pathname:t}=Bi(),n=MW(e=>e.collapsed);return t.startsWith(`/settings`)||!n?null:(0,Z.jsx)(`div`,{className:X(`hidden shrink-0 items-center md:flex`,e),children:(0,Z.jsx)(NW,{variant:`main`})})}),FW=cB(e=>({mobileNavOpen:!1,setMobileNavOpen:t=>e({mobileNavOpen:t}),toggleMobileNav:()=>e(e=>({mobileNavOpen:!e.mobileNavOpen}))})),IW=(0,z.memo)(function(){let e=Jz(lB(e=>e.language)),t=FW(e=>e.mobileNavOpen),n=FW(e=>e.setMobileNavOpen);return(0,Z.jsx)(Kz,{type:`button`,variant:`ghost`,className:X(`size-8 shrink-0 rounded-xl p-0 md:hidden`,SW,t&&`hidden`),"aria-expanded":t,"aria-controls":`app-sidebar`,"aria-label":e.openMenu,title:e.openMenu,onClick:()=>n(!0),children:(0,Z.jsx)(hw,{className:`size-4`,strokeWidth:1.5,"aria-hidden":!0})})}),LW={startExtra:null,main:null,end:null},RW=cB(e=>({...LW,setPageHeader:t=>e(t),clearPageHeader:()=>e(LW)})),zW=(0,z.memo)(function(){let{pathname:e}=Bi(),t=RW(e=>e.startExtra),n=RW(e=>e.main),r=RW(e=>e.end),i=!e.startsWith(`/settings`);return(0,Z.jsxs)(`header`,{className:X(`flex shrink-0 gap-3 bg-surface-panel`,wW,`px-3 sm:gap-4 sm:px-5 xl:px-6`),children:[(0,Z.jsxs)(`div`,{className:`flex min-w-0 shrink-0 items-center gap-2.5`,children:[(0,Z.jsx)(PW,{}),i?(0,Z.jsx)(IW,{}):null,t]}),(0,Z.jsx)(`div`,{className:`flex min-h-0 min-w-0 w-full flex-1 flex-col justify-center overflow-hidden`,children:n}),(0,Z.jsx)(`div`,{className:`flex min-w-0 shrink-0 items-center justify-end gap-2`,children:r})]})}),BW=function(e){return e[e.PermissionDenied=4001]=`PermissionDenied`,e[e.InvalidRequest=4002]=`InvalidRequest`,e[e.MethodNotFound=4003]=`MethodNotFound`,e[e.InternalError=4004]=`InternalError`,e[e.Timeout=4005]=`Timeout`,e[e.ExtensionNotFound=4006]=`ExtensionNotFound`,e[e.RateLimited=4007]=`RateLimited`,e}({}),VW=[`--color-surface-base`,`--color-surface-panel`,`--color-surface-hover`,`--color-fg`,`--color-fg-muted`,`--color-fg-subtle`,`--color-accent`,`--color-accent-hover`,`--color-accent-soft`,`--color-edge`,`--color-edge-subtle`,`--color-danger`,`--color-success`,`--color-warning`,`--radius-sm`,`--radius-lg`,`--radius-xl`];function HW(e){let t=getComputedStyle(document.documentElement),n={};for(let e of VW){let r=t.getPropertyValue(e).trim();r&&(n[e]=r)}return{mode:e,tokens:n,fontFamily:t.getPropertyValue(`font-family`).trim(),fontFamilyMono:t.getPropertyValue(`--font-mono`).trim()}}var UW={"agent.sendMessage":`agent.send`,"session.list":`session.read`,"session.navigate":`session.read`,"config.get":`config.read`,"config.set":`config.write`,"storage.get":`storage`,"storage.set":`storage`,"storage.remove":`storage`,"storage.keys":`storage`,"ui.notification":`notification`,"ui.navigate":`theme`,"theme.get":`theme`},WW=class{iframes=new Map;byContentWindow=new WeakMap;handlers=new Map;extensionPermissions=new Map;eventSubscribers=new Map;agentStreamSubscriptions=new Map;boundListener=e=>{this.onWindowMessage(e)};constructor(){window.addEventListener(`message`,this.boundListener)}dispose(){window.removeEventListener(`message`,this.boundListener),this.iframes.clear(),this.handlers.clear(),this.extensionPermissions.clear(),this.eventSubscribers.clear(),this.agentStreamSubscriptions.clear()}registerIframe(e,t,n){let r=this.iframes.get(e);r&&r!==t&&r.contentWindow&&this.byContentWindow.delete(r.contentWindow),this.iframes.set(e,t),this.extensionPermissions.set(e,new Set(n)),this.rememberIframeWindow(e,t)}unregisterIframe(e){let t=this.iframes.get(e);t?.contentWindow&&this.byContentWindow.delete(t.contentWindow),this.iframes.delete(e),this.extensionPermissions.delete(e),this.agentStreamSubscriptions.delete(e)}rememberIframeWindow(e,t){let n=t.contentWindow;n&&this.byContentWindow.set(n,{extensionId:e,iframe:t})}subscribeAgentStream(e,t){let n=this.agentStreamSubscriptions.get(e);n||(n=new Set,this.agentStreamSubscriptions.set(e,n)),n.add(t)}unsubscribeAgentStream(e,t){this.agentStreamSubscriptions.get(e)?.delete(t)}forwardAgentStreamEvent(e,t){for(let[n,r]of this.agentStreamSubscriptions)r.has(e)&&this.sendEvent(n,`agent.stream.${e}`,t)}broadcastExtensionEvent(e,t,n){let r=t.startsWith(`ext.`)?t:`ext.${t}`;for(let[t]of this.iframes)t!==e&&this.sendEvent(t,r,n)}handleExtensionEvent(e,t,n){if(t.startsWith(`ext.`)){let r=t.slice(4);this.broadcastExtensionEvent(e,r,n);return}if(t===`agent.subscribe`||t===`agent.unsubscribe`){if(!(this.extensionPermissions.get(e)??new Set).has(`agent.subscribe`))return;let{sessionKey:r}=n??{};if(typeof r!=`string`||!r.trim())return;let i=r.trim();t===`agent.subscribe`?this.subscribeAgentStream(e,i):this.unsubscribeAgentStream(e,i)}}registerMethod(e,t){this.handlers.set(e,t)}subscribeExtensionEvents(e,t){let n=this.eventSubscribers.get(e);return n||(n=new Set,this.eventSubscribers.set(e,n)),n.add(t),()=>{n.delete(t),n.size===0&&this.eventSubscribers.delete(e)}}sendInit(e,t,n){let r=this.iframes.get(e);if(!r?.contentWindow)return;this.rememberIframeWindow(e,r);let i=[...this.extensionPermissions.get(e)??[]];r.contentWindow.postMessage({source:`xopc-host`,type:`init`,extensionId:e,permissions:i,theme:t,locale:n},`*`)}sendEvent(e,t,n){let r=this.iframes.get(e);r?.contentWindow&&r.contentWindow.postMessage({source:`xopc-host`,type:`event`,event:t,data:n},`*`)}broadcastEvent(e,t){for(let[,n]of this.iframes)n.contentWindow?.postMessage({source:`xopc-host`,type:`event`,event:e,data:t},`*`)}postResponse(e,t,n,r,i){let a=e.contentWindow??(t?.source instanceof Window?t.source:null),o={source:`xopc-host`,type:`response`,requestId:n,result:r,error:i};a&&a.postMessage(o,`*`)}isTrustedExtensionSource(e,t){if(t.source===null)return!0;let n=e.contentWindow;if(t.source===n)return!0;if(n&&typeof Window<`u`&&t.source instanceof Window)try{return t.source.frameElement===e}catch{}return!1}async onWindowMessage(e){let t=e.data;if(!t||t.source!==`xopc-extension`)return;let n,r=t.extensionId;if(e.source instanceof Window){let t=this.byContentWindow.get(e.source);t&&(n=t.iframe,r=t.extensionId)}if(n||(n=this.iframes.get(t.extensionId),r=t.extensionId),!n||!(e.source instanceof Window&&this.byContentWindow.has(e.source))&&!this.isTrustedExtensionSource(n,e))return;if(t.type===`event`){this.handleExtensionEvent(r,t.event,t.data);let e=this.eventSubscribers.get(r);if(e){let n={event:t.event,data:t.data};for(let t of e)try{t(n)}catch{}}return}if(t.type!==`request`)return;let{requestId:i,method:a,params:o}=t,s=this.handlers.get(a);if(!s){this.postResponse(n,e,i,void 0,{code:BW.MethodNotFound,message:`Unknown method: ${a}`});return}let c=UW[a],l=this.extensionPermissions.get(r)??new Set;if(c&&!l.has(c)){this.postResponse(n,e,i,void 0,{code:BW.PermissionDenied,message:`Missing permission: ${c}`});return}try{let t=await s(r,o);this.postResponse(n,e,i,t)}catch(t){let r=t instanceof Error?t.message:String(t);this.postResponse(n,e,i,void 0,{code:BW.InternalError,message:r})}}};function GW(e){e.registerMethod(`theme.get`,async()=>HW(OB.getState().resolved)),e.registerMethod(`ui.navigate`,async(e,t)=>{let n=t&&typeof t==`object`&&t&&`path`in t?String(t.path??``):``;n&&window.dispatchEvent(new CustomEvent(`extension-navigate`,{detail:{path:n}}))}),e.registerMethod(`ui.notification`,async(e,t)=>{window.dispatchEvent(new CustomEvent(`extension-notification`,{detail:t}))}),e.registerMethod(`session.navigate`,async(e,t)=>{let n=t&&typeof t==`object`&&t&&`sessionKey`in t?String(t.sessionKey??``):``;n&&window.dispatchEvent(new CustomEvent(`navigate-to-chat`,{detail:{sessionKey:n},bubbles:!0}))}),e.registerMethod(`session.list`,async()=>{let e=await rW(Q(`/api/sessions`));if(!e.ok)throw Error(`Failed to list sessions: ${e.status}`);return((await e.json()).items??[]).map(e=>({sessionKey:e.key,title:e.name,lastMessageAt:e.updatedAt??e.lastAccessedAt,messageCount:e.messageCount}))}),e.registerMethod(`agent.sendMessage`,async(e,t)=>{let{message:n,sessionKey:r,newSession:i}=t,a=await rW(Q(`/api/agent`),{method:`POST`,headers:{Accept:`application/json`},body:JSON.stringify({message:n,channel:`webchat`,sessionKey:i?void 0:r,newSession:!!i})});if(!a.ok)throw Error(`Agent request failed: ${a.status}`);let o=await a.json();return{sessionKey:o.payload?.sessionKey??o.payload?.key??o.sessionKey??r??``}}),e.registerMethod(`config.get`,async e=>{let t=await rW(Q(`/api/extensions/${encodeURIComponent(e)}/config`));if(!t.ok)throw Error(`Failed to get config: ${t.status}`);return t.json()}),e.registerMethod(`config.set`,async(e,t)=>{let n=t&&typeof t==`object`&&t&&!Array.isArray(t)?t:{},r=await rW(Q(`/api/extensions/${encodeURIComponent(e)}/config`),{method:`PATCH`,body:JSON.stringify(n)});if(!r.ok)throw Error(`Failed to set config: ${r.status}`)}),e.registerMethod(`storage.get`,async(e,t)=>{let n=t&&typeof t==`object`&&t&&`key`in t?String(t.key??``):``,r=await rW(Q(`/api/extensions/${encodeURIComponent(e)}/storage/${encodeURIComponent(n)}`));if(r.status!==404){if(!r.ok)throw Error(`Failed to get storage key: ${r.status}`);return(await r.json()).value}}),e.registerMethod(`storage.set`,async(e,t)=>{let n=t,r=n&&typeof n.key==`string`?n.key:``,i=await rW(Q(`/api/extensions/${encodeURIComponent(e)}/storage/${encodeURIComponent(r)}`),{method:`PUT`,body:JSON.stringify({value:n?.value})});if(!i.ok)throw Error(`Failed to set storage key: ${i.status}`)}),e.registerMethod(`storage.remove`,async(e,t)=>{let n=t&&typeof t==`object`&&t&&`key`in t?String(t.key??``):``,r=await rW(Q(`/api/extensions/${encodeURIComponent(e)}/storage/${encodeURIComponent(n)}`),{method:`DELETE`});if(r.status!==404&&!r.ok)throw Error(`Failed to remove storage key: ${r.status}`)}),e.registerMethod(`storage.keys`,async e=>{let t=await rW(Q(`/api/extensions/${encodeURIComponent(e)}/storage`));if(!t.ok)throw Error(`Failed to list storage keys: ${t.status}`);return(await t.json()).keys??[]})}var KW=(0,z.createContext)(null);function qW({children:e}){let t=(0,z.useRef)(null);if(!t.current){let e=new WW;GW(e),t.current=e}let n=t.current,{data:r,isLoading:i}=u(BB(e=>!!e.token)?`gateway-extensions-list`:null,()=>iW(Q(`/api/extensions`)),{revalidateOnFocus:!1}),a=r?.extensions??[],o=OB(e=>e.resolved),s=(0,z.useCallback)(e=>{let t=e.detail;t?.sessionKey&&n.forwardAgentStreamEvent(t.sessionKey,t.event??t)},[n]);(0,z.useEffect)(()=>(window.addEventListener(`agent-stream-event`,s),()=>{window.removeEventListener(`agent-stream-event`,s)}),[s]),(0,z.useEffect)(()=>{let e=HW(o);n.broadcastEvent(`theme.changed`,e)},[o,n]);let c=(0,z.useRef)(n);c.current=n,(0,z.useEffect)(()=>()=>{c.current.dispose(),t.current=null},[]);let l=(0,z.useMemo)(()=>({router:n,extensions:a,loading:i}),[n,a,i]);return(0,Z.jsx)(KW.Provider,{value:l,children:e})}function JW(){let e=(0,z.useContext)(KW);if(!e)throw Error(`useExtensionRouter must be used within ExtensionProvider`);return e.router}function YW(){let e=(0,z.useContext)(KW);if(!e)throw Error(`useExtensions must be used within ExtensionProvider`);return e.extensions}function XW(e){return e.active||e.activationEligible===!0}function ZW(e){let t=e.ui?.contributions;return t?Array.isArray(t.pages)&&t.pages.length>0||Array.isArray(t.settingsPanels)&&t.settingsPanels.length>0||Array.isArray(t.chatWidgets)&&t.chatWidgets.length>0:!1}function QW(e){return!e.hasUi||!XW(e)?!1:ZW(e)}function $W(){let e=YW();return(0,z.useMemo)(()=>e.filter(QW),[e])}function eG(){let e=(0,z.useContext)(KW);if(!e)throw Error(`useExtensionsLoading must be used within ExtensionProvider`);return e.loading}function tG(e,t){return t.path.startsWith(`/apps/`)?t.path:`/apps/${e}/${t.id.startsWith(`${e}.`)?t.id.slice(e.length+1):t.id}`}function nG(e){return YL[e.split(`-`).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(``)]}function rG({collapsed:e=!1,onNavigate:t,navLinkClassName:n}){let r=iG($W());return r.length===0?null:(0,Z.jsx)(Z.Fragment,{children:r.map(({extension:r,page:i})=>{let a=i.navIcon?nG(i.navIcon):void 0;return(0,Z.jsxs)(wo,{to:tG(r.id,i),className:t=>n(t,e),title:i.title,onClick:()=>t?.(),children:[a?(0,Z.jsx)(a,{className:`size-4 shrink-0 opacity-90`,strokeWidth:1.75,"aria-hidden":!0}):(0,Z.jsx)(`span`,{className:`flex size-4 shrink-0 items-center justify-center text-[10px] font-bold opacity-70`,"aria-hidden":!0,children:i.title.charAt(0).toUpperCase()}),e?null:(0,Z.jsx)(`span`,{className:`truncate`,children:i.title})]},`${r.id}:${i.id}`)})})}function iG(e){let t=[];for(let n of e){let e=n.ui?.contributions?.pages;if(e)for(let r of e)r.showInNav&&t.push({extension:n,page:r})}return t}var aG=[`top`,`right`,`bottom`,`left`],oG=Math.min,sG=Math.max,cG=Math.round,lG=Math.floor,uG=e=>({x:e,y:e}),dG={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function fG(e,t,n){return sG(e,oG(t,n))}function pG(e,t){return typeof e==`function`?e(t):e}function mG(e){return e.split(`-`)[0]}function hG(e){return e.split(`-`)[1]}function gG(e){return e===`x`?`y`:`x`}function _G(e){return e===`y`?`height`:`width`}function vG(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function yG(e){return gG(vG(e))}function bG(e,t,n){n===void 0&&(n=!1);let r=hG(e),i=yG(e),a=_G(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=kG(o)),[o,kG(o)]}function xG(e){let t=kG(e);return[SG(e),t,SG(t)]}function SG(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var CG=[`left`,`right`],wG=[`right`,`left`],TG=[`top`,`bottom`],EG=[`bottom`,`top`];function DG(e,t,n){switch(e){case`top`:case`bottom`:return n?t?wG:CG:t?CG:wG;case`left`:case`right`:return t?TG:EG;default:return[]}}function OG(e,t,n,r){let i=hG(e),a=DG(mG(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(SG)))),a}function kG(e){let t=mG(e);return dG[t]+e.slice(t.length)}function AG(e){return{top:0,right:0,bottom:0,left:0,...e}}function jG(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:AG(e)}function MG(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function NG(e,t,n){let{reference:r,floating:i}=e,a=vG(t),o=yG(t),s=_G(o),c=mG(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(hG(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function PG(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=pG(t,e),p=jG(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=MG(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=MG(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var FG=50,IG=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:PG},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=NG(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<FG&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=NG(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},LG=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=pG(e,t)||{};if(l==null)return{};let d=jG(u),f={x:n,y:r},p=yG(i),m=_G(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=oG(d[_],T),D=oG(d[v],T),O=E,k=C-h[m]-D,A=C/2-h[m]/2+w,j=fG(O,A,k),M=!c.arrow&&hG(i)!=null&&A!==j&&a.reference[m]/2-(A<O?E:D)-h[m]/2<0,N=M?A<O?A-O:A-k:0;return{[p]:f[p]+N,data:{[p]:j,centerOffset:A-j-N,...M&&{alignmentOffset:N}},reset:M}}}),RG=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=pG(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=mG(r),_=vG(o),v=mG(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[kG(o)]:xG(o)),x=p!==`none`;!d&&x&&b.push(...OG(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=bG(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==vG(t))||T.every(e=>vG(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=vG(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}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 BG(e){return aG.some(t=>e[t]>=0)}var VG=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=pG(e,t);switch(i){case`referenceHidden`:{let e=zG(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:BG(e)}}}case`escaped`:{let e=zG(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:BG(e)}}}default:return{}}}}},HG=new Set([`left`,`top`]);async function UG(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=mG(n),s=hG(n),c=vG(n)===`y`,l=HG.has(o)?-1:1,u=a&&c?-1:1,d=pG(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var WG=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await UG(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},GG=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=pG(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=vG(mG(i)),p=gG(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=fG(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=fG(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},KG=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=pG(e,t),u={x:n,y:r},d=vG(i),f=gG(d),p=u[f],m=u[d],h=pG(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=HG.has(mG(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},qG=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=pG(e,t),u=await o.detectOverflow(t,l),d=mG(i),f=hG(i),p=vG(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=oG(h-u[g],v),x=oG(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=sG(u.left,0),t=sG(u.right,0),n=sG(u.top,0),r=sG(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:sG(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:sG(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function JG(){return typeof window<`u`}function YG(e){return QG(e)?(e.nodeName||``).toLowerCase():`#document`}function XG(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ZG(e){return((QG(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function QG(e){return JG()?e instanceof Node||e instanceof XG(e).Node:!1}function $G(e){return JG()?e instanceof Element||e instanceof XG(e).Element:!1}function eK(e){return JG()?e instanceof HTMLElement||e instanceof XG(e).HTMLElement:!1}function tK(e){return!JG()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof XG(e).ShadowRoot}function nK(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=pK(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function rK(e){return/^(table|td|th)$/.test(YG(e))}function iK(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var aK=/transform|translate|scale|rotate|perspective|filter/,oK=/paint|layout|strict|content/,sK=e=>!!e&&e!==`none`,cK;function lK(e){let t=$G(e)?pK(e):e;return sK(t.transform)||sK(t.translate)||sK(t.scale)||sK(t.rotate)||sK(t.perspective)||!dK()&&(sK(t.backdropFilter)||sK(t.filter))||aK.test(t.willChange||``)||oK.test(t.contain||``)}function uK(e){let t=hK(e);for(;eK(t)&&!fK(t);){if(lK(t))return t;if(iK(t))return null;t=hK(t)}return null}function dK(){return cK??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),cK}function fK(e){return/^(html|body|#document)$/.test(YG(e))}function pK(e){return XG(e).getComputedStyle(e)}function mK(e){return $G(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function hK(e){if(YG(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||tK(e)&&e.host||ZG(e);return tK(t)?t.host:t}function gK(e){let t=hK(e);return fK(t)?e.ownerDocument?e.ownerDocument.body:e.body:eK(t)&&nK(t)?t:gK(t)}function _K(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=gK(e),i=r===e.ownerDocument?.body,a=XG(r);if(i){let e=vK(a);return t.concat(a,a.visualViewport||[],nK(r)?r:[],e&&n?_K(e):[])}else return t.concat(r,_K(r,[],n))}function vK(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function yK(e){let t=pK(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=eK(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=cG(n)!==a||cG(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function bK(e){return $G(e)?e:e.contextElement}function xK(e){let t=bK(e);if(!eK(t))return uG(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=yK(t),o=(a?cG(n.width):n.width)/r,s=(a?cG(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var SK=uG(0);function CK(e){let t=XG(e);return!dK()||!t.visualViewport?SK:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function wK(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==XG(e)?!1:t}function TK(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=bK(e),o=uG(1);t&&(r?$G(r)&&(o=xK(r)):o=xK(e));let s=wK(a,n,r)?CK(a):uG(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=XG(a),t=r&&$G(r)?XG(r):r,n=e,i=vK(n);for(;i&&r&&t!==n;){let e=xK(i),t=i.getBoundingClientRect(),r=pK(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=XG(i),i=vK(n)}}return MG({width:u,height:d,x:c,y:l})}function EK(e,t){let n=mK(e).scrollLeft;return t?t.left+n:TK(ZG(e)).left+n}function DK(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-EK(e,n),y:n.top+t.scrollTop}}function OK(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=ZG(r),s=t?iK(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=uG(1),u=uG(0),d=eK(r);if((d||!d&&!a)&&((YG(r)!==`body`||nK(o))&&(c=mK(r)),d)){let e=TK(r);l=xK(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?DK(o,c):uG(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function kK(e){return Array.from(e.getClientRects())}function AK(e){let t=ZG(e),n=mK(e),r=e.ownerDocument.body,i=sG(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=sG(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+EK(e),s=-n.scrollTop;return pK(r).direction===`rtl`&&(o+=sG(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var jK=25;function MK(e,t){let n=XG(e),r=ZG(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=dK();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=EK(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=jK&&(a-=o)}else l<=jK&&(a+=l);return{width:a,height:o,x:s,y:c}}function NK(e,t){let n=TK(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=eK(e)?xK(e):uG(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function PK(e,t,n){let r;if(t===`viewport`)r=MK(e,n);else if(t===`document`)r=AK(ZG(e));else if($G(t))r=NK(t,n);else{let n=CK(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return MG(r)}function FK(e,t){let n=hK(e);return n===t||!$G(n)||fK(n)?!1:pK(n).position===`fixed`||FK(n,t)}function IK(e,t){let n=t.get(e);if(n)return n;let r=_K(e,[],!1).filter(e=>$G(e)&&YG(e)!==`body`),i=null,a=pK(e).position===`fixed`,o=a?hK(e):e;for(;$G(o)&&!fK(o);){let t=pK(o),n=lK(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||nK(o)&&!n&&FK(e,o))?r=r.filter(e=>e!==o):i=t,o=hK(o)}return t.set(e,r),r}function LK(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?iK(t)?[]:IK(t,this._c):[].concat(n),r],o=PK(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=PK(t,a[e],i);s=sG(n.top,s),c=oG(n.right,c),l=oG(n.bottom,l),u=sG(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function RK(e){let{width:t,height:n}=yK(e);return{width:t,height:n}}function zK(e,t,n){let r=eK(t),i=ZG(t),a=n===`fixed`,o=TK(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=uG(0);function l(){c.x=EK(i)}if(r||!r&&!a)if((YG(t)!==`body`||nK(i))&&(s=mK(t)),r){let e=TK(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?DK(i,s):uG(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function BK(e){return pK(e).position===`static`}function VK(e,t){if(!eK(e)||pK(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return ZG(e)===n&&(n=n.ownerDocument.body),n}function HK(e,t){let n=XG(e);if(iK(e))return n;if(!eK(e)){let t=hK(e);for(;t&&!fK(t);){if($G(t)&&!BK(t))return t;t=hK(t)}return n}let r=VK(e,t);for(;r&&rK(r)&&BK(r);)r=VK(r,t);return r&&fK(r)&&BK(r)&&!lK(r)?n:r||uK(e)||n}var UK=async function(e){let t=this.getOffsetParent||HK,n=this.getDimensions,r=await n(e.floating);return{reference:zK(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function WK(e){return pK(e).direction===`rtl`}var GK={convertOffsetParentRelativeRectToViewportRelativeRect:OK,getDocumentElement:ZG,getClippingRect:LK,getOffsetParent:HK,getElementRects:UK,getClientRects:kK,getDimensions:RK,getScale:xK,isElement:$G,isRTL:WK};function KK(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function qK(e,t){let n=null,r,i=ZG(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=lG(d),h=lG(i.clientWidth-(u+f)),g=lG(i.clientHeight-(d+p)),_=lG(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:sG(0,oG(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!KK(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function JK(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=bK(e),u=i||a?[...l?_K(l):[],...t?_K(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?qK(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?TK(e):null;c&&g();function g(){let t=TK(e);h&&!KK(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var YK=WG,XK=GG,ZK=RG,QK=qG,$K=VG,eq=LG,tq=KG,nq=(e,t,n)=>{let r=new Map,i={platform:GK,...n},a={...i.platform,_c:r};return IG(e,t,{...i,platform:a})},rq=typeof document<`u`?z.useLayoutEffect:function(){};function iq(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,i;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(!iq(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!iq(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function aq(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function oq(e,t){let n=aq(e);return Math.round(t*n)/n}function sq(e){let t=z.useRef(e);return rq(()=>{t.current=e}),t}function cq(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=z.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=z.useState(r);iq(f,r)||p(r);let[m,h]=z.useState(null),[g,_]=z.useState(null),v=z.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=z.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=z.useRef(null),C=z.useRef(null),w=z.useRef(u),T=c!=null,E=sq(c),D=sq(i),O=sq(l),k=z.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),nq(S.current,C.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};A.current&&!iq(w.current,t)&&(w.current=t,Ho.flushSync(()=>{d(t)}))})},[f,t,n,D,O]);rq(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let A=z.useRef(!1);rq(()=>(A.current=!0,()=>{A.current=!1}),[]),rq(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,k);k()}},[b,x,k,E,T]);let j=z.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),M=z.useMemo(()=>({reference:b,floating:x}),[b,x]),N=z.useMemo(()=>{let e={position:n,left:0,top:0};if(!M.floating)return e;let t=oq(M.floating,u.x),r=oq(M.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...aq(M.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,M.floating,u.x,u.y]);return z.useMemo(()=>({...u,update:k,refs:j,elements:M,floatingStyles:N}),[u,k,j,M,N])}var lq=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:eq({element:r.current,padding:i}).fn(n):r?eq({element:r,padding:i}).fn(n):{}}}},uq=(e,t)=>{let n=YK(e);return{name:n.name,fn:n.fn,options:[e,t]}},dq=(e,t)=>{let n=XK(e);return{name:n.name,fn:n.fn,options:[e,t]}},fq=(e,t)=>({fn:tq(e).fn,options:[e,t]}),pq=(e,t)=>{let n=ZK(e);return{name:n.name,fn:n.fn,options:[e,t]}},mq=(e,t)=>{let n=QK(e);return{name:n.name,fn:n.fn,options:[e,t]}},hq=(e,t)=>{let n=$K(e);return{name:n.name,fn:n.fn,options:[e,t]}},gq=(e,t)=>{let n=lq(e);return{name:n.name,fn:n.fn,options:[e,t]}},_q=`Arrow`,vq=z.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,Z.jsx)(cV.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,Z.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});vq.displayName=_q;var yq=vq;function bq(e){let[t,n]=z.useState(void 0);return qB(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}else n(void 0)},[e]),t}var xq=`Popper`,[Sq,Cq]=GB(xq),[wq,Tq]=Sq(xq),Eq=e=>{let{__scopePopper:t,children:n}=e,[r,i]=z.useState(null);return(0,Z.jsx)(wq,{scope:t,anchor:r,onAnchorChange:i,children:n})};Eq.displayName=xq;var Dq=`PopperAnchor`,Oq=z.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,a=Tq(Dq,n),o=z.useRef(null),s=Nz(t,o),c=z.useRef(null);return z.useEffect(()=>{let e=c.current;c.current=r?.current||o.current,e!==c.current&&a.onAnchorChange(c.current)}),r?null:(0,Z.jsx)(cV.div,{...i,ref:s})});Oq.displayName=Dq;var kq=`PopperContent`,[Aq,jq]=Sq(kq),Mq=z.forwardRef((e,t)=>{let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=`partial`,hideWhenDetached:f=!1,updatePositionStrategy:p=`optimized`,onPlaced:m,...h}=e,g=Tq(kq,n),[_,v]=z.useState(null),y=Nz(t,e=>v(e)),[b,x]=z.useState(null),S=bq(b),C=S?.width??0,w=S?.height??0,T=r+(a===`center`?``:`-`+a),E=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},D=Array.isArray(l)?l:[l],O=D.length>0,k={padding:E,boundary:D.filter(Iq),altBoundary:O},{refs:A,floatingStyles:j,placement:M,isPositioned:N,middlewareData:P}=cq({strategy:`fixed`,placement:T,whileElementsMounted:(...e)=>JK(...e,{animationFrame:p===`always`}),elements:{reference:g.anchor},middleware:[uq({mainAxis:i+w,alignmentAxis:o}),c&&dq({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?fq():void 0,...k}),c&&pq({...k}),mq({...k,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)}}),b&&gq({element:b,padding:s}),Lq({arrowWidth:C,arrowHeight:w}),f&&hq({strategy:`referenceHidden`,...k})]}),[F,I]=Rq(M),L=uV(m);qB(()=>{N&&L?.()},[N,L]);let R=P.arrow?.x,B=P.arrow?.y,V=P.arrow?.centerOffset!==0,[H,ee]=z.useState();return qB(()=>{_&&ee(window.getComputedStyle(_).zIndex)},[_]),(0,Z.jsx)(`div`,{ref:A.setFloating,"data-radix-popper-content-wrapper":``,style:{...j,transform:N?j.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:H,"--radix-popper-transform-origin":[P.transformOrigin?.x,P.transformOrigin?.y].join(` `),...P.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,Z.jsx)(Aq,{scope:n,placedSide:F,onArrowChange:x,arrowX:R,arrowY:B,shouldHideArrow:V,children:(0,Z.jsx)(cV.div,{"data-side":F,"data-align":I,...h,ref:y,style:{...h.style,animation:N?void 0:`none`}})})})});Mq.displayName=kq;var Nq=`PopperArrow`,Pq={top:`bottom`,right:`left`,bottom:`top`,left:`right`},Fq=z.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=jq(Nq,n),a=Pq[i.placedSide];return(0,Z.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,Z.jsx)(yq,{...r,ref:t,style:{...r.style,display:`block`}})})});Fq.displayName=Nq;function Iq(e){return e!==null}var Lq=e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=Rq(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}});function Rq(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var zq=Eq,Bq=Oq,Vq=Mq,Hq=Fq,Uq=`Popover`,[Wq,Nee]=GB(Uq,[Cq]),Gq=Cq(),[Kq,qq]=Wq(Uq),Jq=e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=Gq(t),c=z.useRef(null),[l,u]=z.useState(!1),[d,f]=QB({prop:r,defaultProp:i??!1,onChange:a,caller:Uq});return(0,Z.jsx)(zq,{...s,children:(0,Z.jsx)(Kq,{scope:t,contentId:XB(),triggerRef:c,open:d,onOpenChange:f,onOpenToggle:z.useCallback(()=>f(e=>!e),[f]),hasCustomAnchor:l,onCustomAnchorAdd:z.useCallback(()=>u(!0),[]),onCustomAnchorRemove:z.useCallback(()=>u(!1),[]),modal:o,children:n})})};Jq.displayName=Uq;var Yq=`PopoverAnchor`,Xq=z.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=qq(Yq,n),a=Gq(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:s}=i;return z.useEffect(()=>(o(),()=>s()),[o,s]),(0,Z.jsx)(Bq,{...a,...r,ref:t})});Xq.displayName=Yq;var Zq=`PopoverTrigger`,Qq=z.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=qq(Zq,n),a=Gq(n),o=Nz(t,i.triggerRef),s=(0,Z.jsx)(cV.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.contentId,"data-state":pJ(i.open),...r,ref:o,onClick:UB(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:(0,Z.jsx)(Bq,{asChild:!0,...a,children:s})});Qq.displayName=Zq;var $q=`PopoverPortal`,[eJ,tJ]=Wq($q,{forceMount:void 0}),nJ=e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=qq($q,t);return(0,Z.jsx)(eJ,{scope:t,forceMount:n,children:(0,Z.jsx)(WV,{present:n||a.open,children:(0,Z.jsx)(HV,{asChild:!0,container:i,children:r})})})};nJ.displayName=$q;var rJ=`PopoverContent`,iJ=z.forwardRef((e,t)=>{let n=tJ(rJ,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=qq(rJ,e.__scopePopover);return(0,Z.jsx)(WV,{present:r||a.open,children:a.modal?(0,Z.jsx)(oJ,{...i,ref:t}):(0,Z.jsx)(sJ,{...i,ref:t})})});iJ.displayName=rJ;var aJ=tV(`PopoverContent.RemoveScroll`),oJ=z.forwardRef((e,t)=>{let n=qq(rJ,e.__scopePopover),r=z.useRef(null),i=Nz(t,r),a=z.useRef(!1);return z.useEffect(()=>{let e=r.current;if(e)return mU(e)},[]),(0,Z.jsx)(aU,{as:aJ,allowPinchZoom:!0,children:(0,Z.jsx)(cJ,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:UB(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:UB(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;a.current=t.button===2||n},{checkForDefaultPrevented:!1}),onFocusOutside:UB(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),sJ=z.forwardRef((e,t)=>{let n=qq(rJ,e.__scopePopover),r=z.useRef(!1),i=z.useRef(!1);return(0,Z.jsx)(cJ,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),cJ=z.forwardRef((e,t)=>{let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,...d}=e,f=qq(rJ,n),p=Gq(n);return YV(),(0,Z.jsx)(kV,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,Z.jsx)(vV,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>f.onOpenChange(!1),children:(0,Z.jsx)(Vq,{"data-state":pJ(f.open),role:`dialog`,id:f.contentId,...p,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-popover-content-available-width":`var(--radix-popper-available-width)`,"--radix-popover-content-available-height":`var(--radix-popper-available-height)`,"--radix-popover-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-popover-trigger-height":`var(--radix-popper-anchor-height)`}})})})}),lJ=`PopoverClose`,uJ=z.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=qq(lJ,n);return(0,Z.jsx)(cV.button,{type:`button`,...r,ref:t,onClick:UB(e.onClick,()=>i.onOpenChange(!1))})});uJ.displayName=lJ;var dJ=`PopoverArrow`,fJ=z.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=Gq(n);return(0,Z.jsx)(Hq,{...i,...r,ref:t})});fJ.displayName=dJ;function pJ(e){return e?`open`:`closed`}var mJ=Jq,hJ=Qq,gJ=nJ,_J=iJ,vJ=uJ,yJ=fJ,bJ={version:`0.0.16`,commit:`df5dcb60db35ecaea159a4329cdddcb568f2559f`,buildTimeIso:`2026-04-26T14:32:15.831Z`},xJ=`https://github.com/xopcai/xopc`,SJ=`https://github.com/xopcai/xopc/releases`;function CJ(e,t){let n=new Date(e);if(Number.isNaN(n.getTime()))return e;try{return new Intl.DateTimeFormat(t===`zh`?`zh-CN`:`en-US`,{year:`numeric`,month:`numeric`,day:`numeric`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hour12:!1}).format(n)}catch{return n.toISOString()}}function wJ({open:e,onOpenChange:t}){let n=lB(e=>e.language),r=Jz(n),i=r.aboutDialog,[a,o]=(0,z.useState)(null);(0,z.useEffect)(()=>{if(!e)return;let t=!1;return o(null),(async()=>{try{let e=await rW(Q(`/health`));if(!e.ok)throw Error(`health`);let n=await e.json();t||o(typeof n.version==`string`?n.version:null)}catch{t||o(null)}})(),()=>{t=!0}},[e]);let s=bJ.commit,c=n===`zh`?`zh-CN`:`en-US`,l=CJ(bJ.buildTimeIso,c),u=new Date().getFullYear(),d=i.copyright.replace(`{year}`,String(u));return(0,Z.jsx)(qU,{open:e,onOpenChange:t,children:(0,Z.jsxs)(JU,{children:[(0,Z.jsx)(YU,{className:`xopc-dialog-overlay fixed inset-0 z-[200] bg-scrim`}),(0,Z.jsxs)(XU,{className:X(`xopc-dialog-content fixed left-1/2 top-1/2 z-[201] w-[min(100%-2rem,26rem)] -translate-x-1/2 -translate-y-1/2`,`rounded-2xl border border-edge bg-surface-panel shadow-popover dark:border-edge`),onOpenAutoFocus:e=>e.preventDefault(),children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-2 px-4 pt-3`,"aria-hidden":!0,children:[(0,Z.jsx)(`span`,{className:`size-3 rounded-full bg-[#ff5f57]`}),(0,Z.jsx)(`span`,{className:`size-3 rounded-full bg-[#febc2e]`}),(0,Z.jsx)(`span`,{className:`size-3 rounded-full bg-[#28c840]`})]}),(0,Z.jsxs)(`div`,{className:`px-6 pb-2 pt-1`,children:[(0,Z.jsx)(`div`,{className:`flex justify-end`,children:(0,Z.jsx)($U,{asChild:!0,children:(0,Z.jsx)(`button`,{type:`button`,className:`rounded-lg p-1.5 text-fg-muted hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/40`,"aria-label":i.close,children:(0,Z.jsx)(jL,{className:`size-4`,strokeWidth:2})})})}),(0,Z.jsxs)(`div`,{className:`-mt-2 flex flex-col items-center text-center`,children:[(0,Z.jsx)(Az,{className:`size-[4.5rem]`,alt:r.appBrand}),(0,Z.jsx)(ZU,{className:`mt-3 text-xl font-semibold tracking-tight text-fg`,children:r.appBrand}),(0,Z.jsx)(QU,{className:`sr-only`,children:i.windowTitle})]}),(0,Z.jsxs)(`div`,{className:`mt-6 space-y-3 text-sm`,children:[(0,Z.jsxs)(`div`,{className:`grid grid-cols-[5.5rem_1fr] items-center gap-x-3 gap-y-1`,children:[(0,Z.jsx)(`span`,{className:`text-fg-muted`,children:i.versionLabel}),(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center justify-end gap-2 sm:justify-start`,children:[(0,Z.jsx)(`span`,{className:`font-mono text-[13px] text-fg tabular-nums`,children:bJ.version}),(0,Z.jsx)(`button`,{type:`button`,className:X(`shrink-0 rounded-md border border-edge bg-surface-base px-2 py-0.5 text-[11px] font-medium text-fg-muted`,`transition-colors hover:bg-surface-hover hover:text-fg`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/40`),onClick:()=>window.open(SJ,`_blank`,`noopener,noreferrer`),children:i.checkUpdates})]})]}),(0,Z.jsxs)(`div`,{className:`grid grid-cols-[5.5rem_1fr] gap-x-3 gap-y-1`,children:[(0,Z.jsx)(`span`,{className:`pt-0.5 text-fg-muted`,children:i.commitLabel}),(0,Z.jsx)(`span`,{className:`break-all font-mono text-[11px] leading-snug text-fg`,children:s})]}),(0,Z.jsxs)(`div`,{className:`grid grid-cols-[5.5rem_1fr] items-baseline gap-x-3 gap-y-1`,children:[(0,Z.jsx)(`span`,{className:`text-fg-muted`,children:i.buildDateLabel}),(0,Z.jsx)(`span`,{className:`text-right text-[13px] text-fg sm:text-left`,children:l})]}),(0,Z.jsxs)(`div`,{className:`grid grid-cols-[5.5rem_1fr] items-baseline gap-x-3 gap-y-1`,children:[(0,Z.jsx)(`span`,{className:`text-fg-muted`,children:i.gatewayVersionLabel}),(0,Z.jsx)(`span`,{className:`text-right font-mono text-[13px] text-fg sm:text-left`,children:a??i.gatewayUnavailable})]}),(0,Z.jsx)(`p`,{className:`pt-0.5 text-[11px] text-fg-subtle`,children:i.consoleBuildHint})]}),(0,Z.jsxs)(`div`,{className:`mt-6 border-t border-edge-subtle pt-4 text-center text-[11px] leading-relaxed text-fg-muted`,children:[(0,Z.jsxs)(`p`,{children:[i.openSourceLead,(0,Z.jsx)(`a`,{className:`text-accent-fg underline decoration-accent-fg/40 underline-offset-2 hover:decoration-accent-fg`,href:xJ,target:`_blank`,rel:`noopener noreferrer`,children:i.openSourceLink})]}),(0,Z.jsx)(`p`,{className:`mt-2`,children:d})]})]})]})]})})}var TJ=X(`flex w-full items-center gap-2.5 rounded-lg px-3 py-2.5 text-left text-sm font-medium leading-5 text-fg`,`transition-colors duration-150 ease-out`,`hover:bg-surface-hover`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-surface-panel`),EJ=X(`rounded-xl border border-edge bg-surface-panel p-1 shadow-popover`,`dark:border-edge`);function DJ({selected:e,label:t,onSelect:n}){return(0,Z.jsxs)(`button`,{type:`button`,className:X(`flex w-full items-center justify-between gap-2 rounded-lg px-3 py-2 text-left text-sm font-medium leading-5 text-fg`,`transition-colors duration-150 ease-out hover:bg-surface-hover`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-surface-panel`),onClick:n,children:[(0,Z.jsx)(`span`,{className:`min-w-0 truncate`,children:t}),e?(0,Z.jsx)(`span`,{className:`size-1.5 shrink-0 rounded-full bg-success`,"aria-hidden":!0}):(0,Z.jsx)(`span`,{className:`size-1.5 shrink-0`,"aria-hidden":!0})]})}function OJ({onOpenFullSettings:e,onAboutClick:t}){let[n,r]=(0,z.useState)(null),i=lB(e=>e.language),a=lB(e=>e.setLanguage),o=OB(e=>e.preference),s=OB(e=>e.setPreference),c=_B(e=>e.preference),l=_B(e=>e.setPreference),u=Jz(i),d=u.appearanceSettings,f=e=>X(`absolute left-full top-0 z-[60] min-w-[11rem] max-w-[min(calc(100vw-2rem),16rem)]`,`ml-2 sm:ml-2.5`,n===e?`block`:`hidden`),p=e=>X(`absolute left-full top-0 z-[55] h-full w-8 sm:w-9`,n===e?`pointer-events-auto`:`pointer-events-none`);return(0,Z.jsxs)(`div`,{className:`w-[min(calc(100vw-2rem),15rem)] shrink-0 py-1`,onMouseLeave:()=>r(null),children:[(0,Z.jsxs)(`div`,{className:`relative`,onMouseEnter:()=>r(`lang`),children:[(0,Z.jsxs)(`button`,{type:`button`,className:X(TJ,n===`lang`&&`bg-surface-hover`),"aria-haspopup":`menu`,"aria-expanded":n===`lang`,children:[(0,Z.jsx)(db,{className:`size-4 shrink-0 text-fg-muted`,strokeWidth:1.75,"aria-hidden":!0}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 text-left`,children:d.languageTitle}),(0,Z.jsx)(fp,{className:`size-4 shrink-0 text-fg-subtle`,strokeWidth:2,"aria-hidden":!0})]}),(0,Z.jsx)(`div`,{className:p(`lang`),"aria-hidden":!0}),(0,Z.jsx)(`div`,{className:f(`lang`),role:`menu`,"aria-label":d.languageTitle,children:(0,Z.jsxs)(`div`,{className:EJ,children:[(0,Z.jsx)(DJ,{selected:i===`en`,label:d.langOptionEn,onSelect:()=>a(`en`)}),(0,Z.jsx)(DJ,{selected:i===`zh`,label:d.langOptionZh,onSelect:()=>a(`zh`)})]})})]}),(0,Z.jsxs)(`div`,{className:`relative`,onMouseEnter:()=>r(`theme`),children:[(0,Z.jsxs)(`button`,{type:`button`,className:X(TJ,n===`theme`&&`bg-surface-hover`),"aria-haspopup":`menu`,"aria-expanded":n===`theme`,children:[(0,Z.jsx)(LE,{className:`size-4 shrink-0 text-fg-muted`,strokeWidth:1.75,"aria-hidden":!0}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 text-left`,children:d.themeTitle}),(0,Z.jsx)(fp,{className:`size-4 shrink-0 text-fg-subtle`,strokeWidth:2,"aria-hidden":!0})]}),(0,Z.jsx)(`div`,{className:p(`theme`),"aria-hidden":!0}),(0,Z.jsx)(`div`,{className:f(`theme`),role:`menu`,"aria-label":d.themeTitle,children:(0,Z.jsxs)(`div`,{className:EJ,children:[(0,Z.jsx)(DJ,{selected:o===`light`,label:d.themeOptionLight,onSelect:()=>s(`light`)}),(0,Z.jsx)(DJ,{selected:o===`dark`,label:d.themeOptionDark,onSelect:()=>s(`dark`)}),(0,Z.jsx)(DJ,{selected:o===`system`,label:d.themeOptionSystem,onSelect:()=>s(`system`)})]})})]}),(0,Z.jsxs)(`div`,{className:`relative`,onMouseEnter:()=>r(`font`),children:[(0,Z.jsxs)(`button`,{type:`button`,className:X(TJ,n===`font`&&`bg-surface-hover`),"aria-haspopup":`menu`,"aria-expanded":n===`font`,children:[(0,Z.jsx)(LF,{className:`size-4 shrink-0 text-fg-muted`,strokeWidth:1.75,"aria-hidden":!0}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 text-left`,children:d.fontScaleTitle}),(0,Z.jsx)(fp,{className:`size-4 shrink-0 text-fg-subtle`,strokeWidth:2,"aria-hidden":!0})]}),(0,Z.jsx)(`div`,{className:p(`font`),"aria-hidden":!0}),(0,Z.jsx)(`div`,{className:f(`font`),role:`menu`,"aria-label":d.fontScaleTitle,children:(0,Z.jsxs)(`div`,{className:EJ,children:[(0,Z.jsx)(DJ,{selected:c===`compact`,label:d.fontScaleCompact,onSelect:()=>l(`compact`)}),(0,Z.jsx)(DJ,{selected:c===`default`,label:d.fontScaleDefault,onSelect:()=>l(`default`)}),(0,Z.jsx)(DJ,{selected:c===`large`,label:d.fontScaleLarge,onSelect:()=>l(`large`)})]})})]}),(0,Z.jsx)(`div`,{className:`my-2 h-px bg-edge-subtle`,role:`separator`}),(0,Z.jsxs)(`button`,{type:`button`,className:TJ,onClick:()=>t?.(),onMouseEnter:()=>r(null),onFocus:()=>r(null),children:[(0,Z.jsx)(Gx,{className:`size-4 shrink-0 text-fg-muted`,strokeWidth:1.75,"aria-hidden":!0}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 text-left`,children:d.aboutApp})]}),(0,Z.jsxs)(`a`,{href:LB(i),target:`_blank`,rel:`noopener noreferrer`,className:TJ,onMouseEnter:()=>r(null),onFocus:()=>r(null),children:[(0,Z.jsx)(Lu,{className:`size-4 shrink-0 text-fg-muted`,strokeWidth:1.75,"aria-hidden":!0}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 text-left`,children:u.sidebar.helpDocs}),(0,Z.jsx)(r_,{className:`size-3.5 shrink-0 text-fg-subtle`,strokeWidth:2,"aria-hidden":!0})]}),(0,Z.jsxs)(Co,{to:zB(`settingsGateway`),className:X(TJ,`text-accent-fg hover:bg-accent-soft hover:text-accent-fg`),onMouseEnter:()=>r(null),onFocus:()=>r(null),onClick:()=>e?.(),children:[(0,Z.jsx)(TA,{className:`size-4 shrink-0`,strokeWidth:1.75,"aria-hidden":!0}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1`,children:d.openFullPreferences})]})]})}function kJ({collapsed:e=!1,onNavigate:t}){let n=Jz(lB(e=>e.language)),r=n.appearanceSettings,[i,a]=(0,z.useState)(!1),[o,s]=(0,z.useState)(!1);return(0,z.useEffect)(()=>{f(()=>import(`./settings-page-CyHd5szQ.js`),__vite__mapDeps([0,1,2,3,4,5])),f(()=>import(`./sessions-page-cn2fi_V3.js`),__vite__mapDeps([6,1,4])),f(()=>import(`./logs-page-LSa0jmLO.js`),__vite__mapDeps([7,1,4])),f(()=>import(`./cron-page-B_XY0gPt.js`),__vite__mapDeps([8,1,9,4,2])),f(()=>import(`./skills-page-irjxwW9u.js`),__vite__mapDeps([10,1,11,9,4]))},[]),(0,Z.jsxs)(`div`,{className:X(`flex shrink-0 flex-col`,e&&`mt-auto`,e?`items-center px-1 py-2`:`px-3 py-3`),children:[(0,Z.jsxs)(mJ,{open:i,onOpenChange:a,children:[e?(0,Z.jsx)(hJ,{asChild:!0,children:(0,Z.jsx)(`button`,{type:`button`,className:X(`flex size-10 shrink-0 items-center justify-center overflow-hidden rounded-full outline-none ring-offset-surface-base transition-transform`,`hover:opacity-95 active:scale-95`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2`,i&&`ring-2 ring-accent`,`motion-reduce:opacity-100 motion-reduce:active:scale-100`),"aria-expanded":i,"aria-haspopup":`dialog`,title:n.sidebar.appMenuAria,"aria-label":n.sidebar.appMenuAria,children:(0,Z.jsx)(Az,{className:`size-full rounded-full`,alt:n.appBrand})})}):(0,Z.jsx)(hJ,{asChild:!0,children:(0,Z.jsxs)(`button`,{type:`button`,className:X(`flex w-full min-w-0 items-center gap-2 rounded-xl px-1 py-1 text-left outline-none transition-colors duration-150 ease-out`,`hover:bg-surface-active/70`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-surface-base`,i&&`bg-surface-active/70`),"aria-expanded":i,"aria-haspopup":`dialog`,title:n.sidebar.appMenuAria,"aria-label":n.sidebar.appMenuAria,children:[(0,Z.jsx)(`span`,{className:`size-8 shrink-0 overflow-hidden rounded-full`,"aria-hidden":!0,children:(0,Z.jsx)(Az,{className:`size-full rounded-full`,alt:``,"aria-hidden":!0})}),(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Z.jsx)(`div`,{className:`truncate text-sm font-semibold leading-tight text-fg`,children:n.appBrand}),(0,Z.jsx)(`div`,{className:`truncate text-xs text-fg-muted`,children:r.quickMenuHint})]}),(0,Z.jsx)(`span`,{className:X(`flex size-9 shrink-0 items-center justify-center rounded-xl text-fg-muted transition-colors`,i&&`bg-accent-soft text-accent-fg`),"aria-hidden":!0,children:(0,Z.jsx)(TA,{className:`size-[18px]`,strokeWidth:1.5})})]})}),(0,Z.jsx)(gJ,{children:(0,Z.jsx)(_J,{className:X(`z-50 w-max max-w-[min(calc(100vw-1rem),28rem)] overflow-visible`,`rounded-xl border border-edge bg-surface-panel p-2 shadow-popover dark:border-edge`),side:`top`,align:e?`center`:`start`,sideOffset:8,collisionPadding:12,onOpenAutoFocus:e=>e.preventDefault(),onCloseAutoFocus:e=>e.preventDefault(),children:(0,Z.jsx)(OJ,{onOpenFullSettings:()=>{a(!1),t?.()},onAboutClick:()=>{s(!0),a(!1)}})})})]}),(0,Z.jsx)(wJ,{open:o,onOpenChange:s})]})}var AJ={feishu:`/channel-icons/feishu.svg`,lark:`/channel-icons/lark.svg`,telegram:`/channel-icons/telegram.svg`,weixin:`/channel-icons/weixin.svg`,wechat:`/channel-icons/wechat.svg`};function jJ({sourceChannel:e,className:t}){let n=AJ[e.toLowerCase()];return n?(0,Z.jsx)(`img`,{src:n,alt:``,draggable:!1,className:X(`shrink-0`,t),"aria-hidden":!0}):(0,Z.jsx)(Wb,{className:X(`shrink-0`,t),strokeWidth:1.75,"aria-hidden":!0})}var MJ=`inline-flex items-center gap-px rounded-pill border border-edge bg-surface-hover p-1 dark:border-edge`,NJ=`inline-flex shrink-0 items-center justify-center rounded-pill text-xs font-medium leading-none transition-[color,background-color,box-shadow] duration-150 ease-out text-fg-subtle focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-surface-panel active:scale-100`,PJ=`bg-surface-panel shadow-sm dark:bg-surface-panel dark:shadow-sm dark:ring-1 dark:ring-edge-strong/40`,FJ=1;function IJ(e,t){let n=0,r=0,i=e;for(;i&&i!==t;)n+=i.offsetLeft,r+=i.offsetTop,i=i.offsetParent;return i===t?{x:n,y:r}:null}var LJ=`pointer-events-none absolute left-0 top-0 z-[1] rounded-pill bg-surface-panel shadow-sm will-change-transform [backface-visibility:hidden] dark:bg-surface-panel dark:shadow-sm dark:ring-1 dark:ring-edge-strong/40`,RJ=`relative z-[2] box-border flex h-6 min-h-0 min-w-0 flex-1 cursor-pointer items-center justify-center gap-1 rounded-pill border-0 bg-transparent px-2 py-0 text-center text-xs font-medium leading-none outline-none transition-[color,background-color,box-shadow] duration-150 ease-out focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-surface-panel active:scale-100 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50`;function zJ({value:e,onChange:t,options:n,"aria-label":r,className:i,buttonClassName:a}){let o=(0,z.useRef)(null),s=(0,z.useRef)([]),[c,l]=(0,z.useState)({x:0,y:0,w:0,h:0}),[u,d]=(0,z.useState)(!1),[f,p]=(0,z.useState)(!1),m=(0,z.useCallback)(()=>{let t=o.current;if(!t)return;let r=n.findIndex(t=>t.value===e);if(r<0)return;let i=s.current[r];if(!i)return;let a=FJ,c=t.getBoundingClientRect(),u=i.getBoundingClientRect(),f=IJ(i,t),p,m;if(f)p=f.x,m=f.y;else{let e=getComputedStyle(t),n=parseFloat(e.borderLeftWidth)||0,r=parseFloat(e.borderTopWidth)||0;p=u.left-c.left-n,m=u.top-c.top-r}l({x:p+a,y:m+a,w:Math.max(0,u.width-a*2),h:Math.max(0,u.height-a*2)}),d(!0)},[n,e]);return(0,z.useLayoutEffect)(()=>{let e=requestAnimationFrame(()=>m());return()=>cancelAnimationFrame(e)},[m]),(0,z.useEffect)(()=>{let e=requestAnimationFrame(()=>{requestAnimationFrame(()=>p(!0))});return()=>cancelAnimationFrame(e)},[]),(0,z.useEffect)(()=>{let e=o.current;if(!e)return;let t=new ResizeObserver(()=>{requestAnimationFrame(()=>m())});return t.observe(e),window.addEventListener(`resize`,m),()=>{t.disconnect(),window.removeEventListener(`resize`,m)}},[m]),(0,Z.jsxs)(`div`,{ref:o,className:X(MJ,`relative isolate flex w-full max-w-full flex-row items-center`,i),role:`group`,"aria-label":r,children:[(0,Z.jsx)(`div`,{"aria-hidden":!0,className:X(LJ,`motion-reduce:!transition-none motion-reduce:!duration-0`,f&&`transition-[transform,width,height] duration-300 [transition-timing-function:cubic-bezier(0.32,0.72,0,1)]`),style:{width:c.w,height:c.h,transform:`translate3d(${c.x}px, ${c.y}px, 0)`,opacity:u&&c.w>0?1:0}}),n.map((n,r)=>{let i=n.icon,o=e===n.value;return(0,Z.jsxs)(`button`,{ref:e=>{s.current[r]=e},type:`button`,"aria-pressed":o,title:n.title??n.label,onClick:()=>t(n.value),className:X(RJ,o?`text-fg`:`text-fg-subtle`,a),children:[i?(0,Z.jsx)(i,{className:`block size-3 shrink-0 opacity-80`,strokeWidth:1.75,"aria-hidden":!0}):null,(0,Z.jsx)(`span`,{className:`min-w-0 shrink truncate leading-none`,children:n.label})]},n.value)})]})}function BJ(e){return typeof e==`object`&&!!e&&`role`in e}function VJ(e){if(!e||typeof e!=`object`)return!1;let t=e.type;return t===`tool_use`||t===`tool_call`||t===`toolCall`}function HJ(e){return typeof e.id==`string`&&e.id.length>0?e.id:crypto.randomUUID()}function UJ(e){if(typeof e!=`string`)return e;try{return JSON.parse(e)}catch{return e}}function WJ(e){return UJ(e.args??e.arguments??e.input??e.function?.arguments)??{}}function GJ(e){return typeof e==`object`&&!!e}function KJ(e){if(e.type!==`thinking`)return``;let t=e;return typeof t.text==`string`?t.text:typeof t.thinking==`string`?t.thinking:``}function qJ(e,t){let n=e.map(e=>({...e})),r=new Map;for(let e=0;e<n.length;e++){let t=n[e];t.type===`tool_use`&&r.set(t.id,e)}for(let e of t){if(e.type===`tool_use`&&r.has(e.id)){let t=r.get(e.id);n[t]={...e};continue}if(e.type===`thinking`&&n.length>0){let t=n[n.length-1];if(t.type===`thinking`&&KJ(t)===KJ(e))continue}e.type===`tool_use`&&r.set(e.id,n.length),n.push({...e})}return n}function JJ(e){if(e.length<2)return e;let t=[];for(let n of e){if(n.role!==`assistant`){t.push(n);continue}let e=t[t.length-1];e?.role===`assistant`?(e.content=qJ(e.content,n.content),n.timestamp!=null&&(e.timestamp=n.timestamp),n.usage&&(e.usage=n.usage),n.attachments?.length&&(e.attachments=aY([...e.attachments??[],...n.attachments]))):t.push({...n,content:[...n.content]})}return t}function YJ(e){let t=[];for(let n of e){if(!BJ(n))continue;let e=n,r=String(e.role??``);if(r!==`system`){if(r===`toolResult`||r===`tool`){dY(t,e);continue}if(r===`user`||r===`user-with-attachments`){t.push(sY(e));continue}if(r===`assistant`){t.push(cY(e));continue}}}return JJ(t)}function XJ(e){if(Array.isArray(e))return e.map(e=>ZJ(e))}function ZJ(e){if(!e||typeof e!=`object`)return{name:`file`,mimeType:`application/octet-stream`};let t=e,n=typeof t.data==`string`?t.data:void 0,r=typeof t.content==`string`&&t.content.length>0?t.content:n,i=typeof t.name==`string`&&t.name.length>0?t.name:`file`,a=typeof t.mimeType==`string`&&t.mimeType.length>0?t.mimeType:``;!a&&typeof t.type==`string`&&t.type.includes(`/`)&&(a=t.type),a||=`application/octet-stream`;let o=a.split(`;`)[0]?.trim().toLowerCase()??``;if(o===`application/octet-stream`||o===``){let e=k(i);e&&(a=e)}let s=typeof t.preview==`string`&&t.preview.length>0?t.preview:a.startsWith(`image/`)&&r?r:void 0;return{id:typeof t.id==`string`?t.id:void 0,name:i,mimeType:a,type:typeof t.type==`string`?t.type:void 0,size:typeof t.size==`number`?t.size:void 0,content:r,data:n??r,preview:s,extractedText:typeof t.extractedText==`string`?t.extractedText:void 0,workspaceRelativePath:typeof t.workspaceRelativePath==`string`&&t.workspaceRelativePath.length>0?t.workspaceRelativePath:void 0}}function QJ(e){if(typeof e!=`string`||!e.includes(`## Skill:`))return e;let t=e.match(/## Skill:\s*([^\s\r\n]+)/);if(!t)return e;let n=t[1]??``;if(!n)return e;let r=[...e.matchAll(/\*\*Arguments\*\*:\s*([^\r\n]+)/g)],i=r.length>0?(r[r.length-1]?.[1]??``).trim():``;return i?`/skill:${n} ${i}`:`/skill:${n}`}function $J(e){return e.includes(`<file path=`)?e.replace(/<file\s+path="[^"]*">\r?\n[\s\S]*?<\/file>(?:\r?\n)*/g,``).replace(/\n{3,}/g,`
49
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return z.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},GU=`DialogDescriptionWarning`,KU=({contentRef:e,descriptionId:t})=>{let n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${UU(GU).contentName}}.`;return z.useEffect(()=>{let r=e.current?.getAttribute(`aria-describedby`);t&&r&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},qU=yU,JU=TU,YU=DU,XU=jU,ZU=IU,QU=RU,$U=BU;function eW(){return lB.getState().language}function tW(e,t,n){let r=e.trim().toLowerCase();return!!(!r||r===`http ${t}`||n&&r===n.trim().toLowerCase()||t===500&&r===`internal server error`)}function nW(e,t,n){let r=n?.trim()??``;if(r&&!tW(r,e,t))return r;let i=Jz(eW()).api;return e>=500?e===502?i.errorBadGateway:e===503?i.errorServiceUnavailable:e===504?i.errorGatewayTimeout:e===500?i.errorInternal:i.errorServer.replace(`{{status}}`,String(e)):e===404?i.errorNotFound:e===403?i.errorForbidden:i.errorRequest.replace(`{{status}}`,String(e))}async function rW(e,t){let n=BB.getState().token,r=new Headers(t?.headers);r.has(`Content-Type`)||r.set(`Content-Type`,`application/json`),n&&r.set(`Authorization`,`Bearer ${n}`);let i=await fetch(e,{...t,headers:r});return i.status===401&&BB.getState().onUnauthorized(),i}async function iW(e,t){let n=await rW(e,t);if(!n.ok){let e=await n.json().catch(()=>({})),t=nW(n.status,n.statusText,e.error?.message);throw Error(t)}return n.json()}function aW(){return window.location.origin}function Q(e){let t=e.startsWith(`/`)?e:`/${e}`;return`${aW()}${t}`}async function oW(){let e=await rW(Q(`/api/models`));if(!e.ok)throw Error(`Models: HTTP ${e.status}`);return(await e.json()).payload?.models??[]}var sW=null,cW=0,lW=null,uW=6e4;async function dW(e=!1){if(!e&&sW&&Date.now()<cW)return sW;if(e){let e=await oW();return sW=e,cW=Date.now()+uW,e}return lW||(lW=oW().then(e=>(sW=e,cW=Date.now()+uW,e)).finally(()=>{lW=null}),lW)}function fW(e){if(!e||typeof e!=`object`)return!0;let t=e,n=t.providers,r=Object.values(n&&typeof n==`object`&&!Array.isArray(n)?n:{}).some(e=>e===`***`),i=t.agents,a=``;if(i&&typeof i==`object`&&!Array.isArray(i)){let e=i.defaults;if(e&&typeof e==`object`&&!Array.isArray(e)){let t=e.model;typeof t==`string`&&(a=t)}}let o=a.trim().length>0;return!r||!o}function pW(){return Q(`/api/config`)}var mW=null;async function hW(){return mW||(mW=iW(pW()).finally(()=>{mW=null}),mW)}function gW(e){let t=u(e?pW():null,hW,{revalidateOnFocus:!1});return(0,z.useEffect)(()=>{if(!e)return;let t=pW(),n=()=>{s(t)};return window.addEventListener(`config-reload`,n),()=>window.removeEventListener(`config-reload`,n)},[e]),t}function _W(){return s(pW())}var vW=`xopc-onboarding-model-setup-dismissed`;function yW(){let e=BB(e=>e.token),t=Jz(lB(e=>e.language)).electron,{pathname:n}=Bi(),r=Ui(),[i,a]=(0,z.useState)(()=>typeof localStorage<`u`&&localStorage.getItem(vW)===`1`),[o,s]=(0,z.useState)(!1),[c,l]=(0,z.useState)(!1),u=n.startsWith(`/settings/agent-defaults`)||n.startsWith(`/agents`)||n.startsWith(`/settings/models`)||n.startsWith(`/settings/providers`),d=(0,z.useCallback)(async()=>{if(!e){s(!1),l(!0);return}try{let[e,t]=await Promise.all([hW(),dW().catch(()=>null)]),n=fW(e.payload?.config),r=Array.isArray(t)&&t.length===0;s(n||r)}catch{s(!0)}finally{l(!0)}},[e]);(0,z.useEffect)(()=>{d()},[d]),(0,z.useEffect)(()=>{let e=()=>void d();return window.addEventListener(`config-reload`,e),()=>window.removeEventListener(`config-reload`,e)},[d]);function f(){a(!0)}function p(){try{localStorage.setItem(vW,`1`)}catch{}a(!0)}let m=!!e&&c&&o&&!i&&!u;return(0,Z.jsx)(qU,{modal:!1,open:m,onOpenChange:e=>{!e&&!m||e||f()},children:(0,Z.jsxs)(JU,{children:[(0,Z.jsx)(YU,{className:`xopc-dialog-overlay fixed inset-0 z-[100] bg-scrim backdrop-blur-[2px]`}),(0,Z.jsxs)(XU,{className:X(`fixed left-1/2 top-1/2 z-[100] w-[min(100%-2rem,26rem)] -translate-x-1/2 -translate-y-1/2 rounded-xl border border-edge bg-surface-panel p-5 shadow-popover`,`dark:border-edge`),onOpenAutoFocus:e=>e.preventDefault(),onPointerDownOutside:()=>{u||p()},onEscapeKeyDown:()=>p(),children:[(0,Z.jsx)(ZU,{className:`text-base font-semibold text-fg`,children:t.setupBannerTitle}),(0,Z.jsx)(QU,{className:`mt-2 text-sm leading-relaxed text-fg-muted`,children:t.setupBannerBody}),(0,Z.jsxs)(`div`,{className:`mt-5 flex flex-col gap-2 sm:flex-row sm:flex-wrap sm:justify-end`,children:[(0,Z.jsx)(Kz,{type:`button`,variant:`secondary`,className:`sm:min-w-0`,onClick:()=>r(`/settings/providers`),children:t.setupBannerLinkProviders}),(0,Z.jsx)(Kz,{type:`button`,className:`bg-accent text-white hover:bg-accent/90 sm:min-w-0`,onClick:()=>r(`/agents`),children:t.setupBannerLinkModels}),(0,Z.jsx)(Kz,{type:`button`,variant:`ghost`,className:`sm:ml-0`,onClick:p,children:t.setupBannerDismiss})]})]})]})})}function bW(){return(0,Z.jsx)(Z.Fragment,{children:(0,Z.jsx)(yW,{})})}var xW=`[-webkit-app-region:drag]`,SW=`[-webkit-app-region:no-drag]`,CW=`h-14 shrink-0 items-center ${xW}`,wW=`h-14 shrink-0 items-center`,TW=`xopc-web-sidebar-collapsed`,EW=`xopc-web-sidebar-expanded-width-px`;function DW(){try{return globalThis.localStorage?.getItem(TW)===`1`}catch{return!1}}function OW(e){try{globalThis.localStorage?.setItem(TW,e?`1`:`0`)}catch{}}function kW(e){return Math.min(480,Math.max(200,Math.round(e)))}function AW(){try{let e=globalThis.localStorage?.getItem(EW);if(e==null)return 256;let t=Number.parseInt(e,10);return Number.isFinite(t)?kW(t):256}catch{return 256}}function jW(e){try{globalThis.localStorage?.setItem(EW,String(e))}catch{}}var MW=cB((e,t)=>({collapsed:DW(),setCollapsed:t=>{e({collapsed:t}),queueMicrotask(()=>OW(t))},toggleCollapsed:()=>{t().setCollapsed(!t().collapsed)},expandedWidthPx:AW(),setExpandedWidthPx:t=>{let n=kW(t);e({expandedWidthPx:n}),queueMicrotask(()=>jW(n))}})),NW=(0,z.memo)(function({variant:e=`sidebar`,className:t}){let n=Jz(lB(e=>e.language)),r=MW(e=>e.collapsed),i=MW(e=>e.toggleCollapsed);return(0,Z.jsx)(Kz,{type:`button`,variant:`ghost`,className:X(`size-8 shrink-0 rounded-xl p-0`,e===`sidebar`?`hidden md:inline-flex`:`inline-flex`,SW,t),"aria-expanded":!r,"aria-controls":`app-sidebar`,"aria-label":r?n.sidebarExpand:n.sidebarCollapse,onClick:()=>i(),children:r?(0,Z.jsx)(ZE,{className:`size-4`,strokeWidth:1.5,"aria-hidden":!0}):(0,Z.jsx)(qE,{className:`size-4`,strokeWidth:1.5,"aria-hidden":!0})})}),PW=(0,z.memo)(function({className:e}){let{pathname:t}=Bi(),n=MW(e=>e.collapsed);return t.startsWith(`/settings`)||!n?null:(0,Z.jsx)(`div`,{className:X(`hidden shrink-0 items-center md:flex`,e),children:(0,Z.jsx)(NW,{variant:`main`})})}),FW=cB(e=>({mobileNavOpen:!1,setMobileNavOpen:t=>e({mobileNavOpen:t}),toggleMobileNav:()=>e(e=>({mobileNavOpen:!e.mobileNavOpen}))})),IW=(0,z.memo)(function(){let e=Jz(lB(e=>e.language)),t=FW(e=>e.mobileNavOpen),n=FW(e=>e.setMobileNavOpen);return(0,Z.jsx)(Kz,{type:`button`,variant:`ghost`,className:X(`size-8 shrink-0 rounded-xl p-0 md:hidden`,SW,t&&`hidden`),"aria-expanded":t,"aria-controls":`app-sidebar`,"aria-label":e.openMenu,title:e.openMenu,onClick:()=>n(!0),children:(0,Z.jsx)(hw,{className:`size-4`,strokeWidth:1.5,"aria-hidden":!0})})}),LW={startExtra:null,main:null,end:null},RW=cB(e=>({...LW,setPageHeader:t=>e(t),clearPageHeader:()=>e(LW)})),zW=(0,z.memo)(function(){let{pathname:e}=Bi(),t=RW(e=>e.startExtra),n=RW(e=>e.main),r=RW(e=>e.end),i=!e.startsWith(`/settings`);return(0,Z.jsxs)(`header`,{className:X(`flex shrink-0 gap-3 bg-surface-panel`,wW,`px-3 sm:gap-4 sm:px-5 xl:px-6`),children:[(0,Z.jsxs)(`div`,{className:`flex min-w-0 shrink-0 items-center gap-2.5`,children:[(0,Z.jsx)(PW,{}),i?(0,Z.jsx)(IW,{}):null,t]}),(0,Z.jsx)(`div`,{className:`flex min-h-0 min-w-0 w-full flex-1 flex-col justify-center overflow-hidden`,children:n}),(0,Z.jsx)(`div`,{className:`flex min-w-0 shrink-0 items-center justify-end gap-2`,children:r})]})}),BW=function(e){return e[e.PermissionDenied=4001]=`PermissionDenied`,e[e.InvalidRequest=4002]=`InvalidRequest`,e[e.MethodNotFound=4003]=`MethodNotFound`,e[e.InternalError=4004]=`InternalError`,e[e.Timeout=4005]=`Timeout`,e[e.ExtensionNotFound=4006]=`ExtensionNotFound`,e[e.RateLimited=4007]=`RateLimited`,e}({}),VW=[`--color-surface-base`,`--color-surface-panel`,`--color-surface-hover`,`--color-fg`,`--color-fg-muted`,`--color-fg-subtle`,`--color-accent`,`--color-accent-hover`,`--color-accent-soft`,`--color-edge`,`--color-edge-subtle`,`--color-danger`,`--color-success`,`--color-warning`,`--radius-sm`,`--radius-lg`,`--radius-xl`];function HW(e){let t=getComputedStyle(document.documentElement),n={};for(let e of VW){let r=t.getPropertyValue(e).trim();r&&(n[e]=r)}return{mode:e,tokens:n,fontFamily:t.getPropertyValue(`font-family`).trim(),fontFamilyMono:t.getPropertyValue(`--font-mono`).trim()}}var UW={"agent.sendMessage":`agent.send`,"session.list":`session.read`,"session.navigate":`session.read`,"config.get":`config.read`,"config.set":`config.write`,"storage.get":`storage`,"storage.set":`storage`,"storage.remove":`storage`,"storage.keys":`storage`,"ui.notification":`notification`,"ui.navigate":`theme`,"theme.get":`theme`},WW=class{iframes=new Map;byContentWindow=new WeakMap;handlers=new Map;extensionPermissions=new Map;eventSubscribers=new Map;agentStreamSubscriptions=new Map;boundListener=e=>{this.onWindowMessage(e)};constructor(){window.addEventListener(`message`,this.boundListener)}dispose(){window.removeEventListener(`message`,this.boundListener),this.iframes.clear(),this.handlers.clear(),this.extensionPermissions.clear(),this.eventSubscribers.clear(),this.agentStreamSubscriptions.clear()}registerIframe(e,t,n){let r=this.iframes.get(e);r&&r!==t&&r.contentWindow&&this.byContentWindow.delete(r.contentWindow),this.iframes.set(e,t),this.extensionPermissions.set(e,new Set(n)),this.rememberIframeWindow(e,t)}unregisterIframe(e){let t=this.iframes.get(e);t?.contentWindow&&this.byContentWindow.delete(t.contentWindow),this.iframes.delete(e),this.extensionPermissions.delete(e),this.agentStreamSubscriptions.delete(e)}rememberIframeWindow(e,t){let n=t.contentWindow;n&&this.byContentWindow.set(n,{extensionId:e,iframe:t})}subscribeAgentStream(e,t){let n=this.agentStreamSubscriptions.get(e);n||(n=new Set,this.agentStreamSubscriptions.set(e,n)),n.add(t)}unsubscribeAgentStream(e,t){this.agentStreamSubscriptions.get(e)?.delete(t)}forwardAgentStreamEvent(e,t){for(let[n,r]of this.agentStreamSubscriptions)r.has(e)&&this.sendEvent(n,`agent.stream.${e}`,t)}broadcastExtensionEvent(e,t,n){let r=t.startsWith(`ext.`)?t:`ext.${t}`;for(let[t]of this.iframes)t!==e&&this.sendEvent(t,r,n)}handleExtensionEvent(e,t,n){if(t.startsWith(`ext.`)){let r=t.slice(4);this.broadcastExtensionEvent(e,r,n);return}if(t===`agent.subscribe`||t===`agent.unsubscribe`){if(!(this.extensionPermissions.get(e)??new Set).has(`agent.subscribe`))return;let{sessionKey:r}=n??{};if(typeof r!=`string`||!r.trim())return;let i=r.trim();t===`agent.subscribe`?this.subscribeAgentStream(e,i):this.unsubscribeAgentStream(e,i)}}registerMethod(e,t){this.handlers.set(e,t)}subscribeExtensionEvents(e,t){let n=this.eventSubscribers.get(e);return n||(n=new Set,this.eventSubscribers.set(e,n)),n.add(t),()=>{n.delete(t),n.size===0&&this.eventSubscribers.delete(e)}}sendInit(e,t,n){let r=this.iframes.get(e);if(!r?.contentWindow)return;this.rememberIframeWindow(e,r);let i=[...this.extensionPermissions.get(e)??[]];r.contentWindow.postMessage({source:`xopc-host`,type:`init`,extensionId:e,permissions:i,theme:t,locale:n},`*`)}sendEvent(e,t,n){let r=this.iframes.get(e);r?.contentWindow&&r.contentWindow.postMessage({source:`xopc-host`,type:`event`,event:t,data:n},`*`)}broadcastEvent(e,t){for(let[,n]of this.iframes)n.contentWindow?.postMessage({source:`xopc-host`,type:`event`,event:e,data:t},`*`)}postResponse(e,t,n,r,i){let a=e.contentWindow??(t?.source instanceof Window?t.source:null),o={source:`xopc-host`,type:`response`,requestId:n,result:r,error:i};a&&a.postMessage(o,`*`)}isTrustedExtensionSource(e,t){if(t.source===null)return!0;let n=e.contentWindow;if(t.source===n)return!0;if(n&&typeof Window<`u`&&t.source instanceof Window)try{return t.source.frameElement===e}catch{}return!1}async onWindowMessage(e){let t=e.data;if(!t||t.source!==`xopc-extension`)return;let n,r=t.extensionId;if(e.source instanceof Window){let t=this.byContentWindow.get(e.source);t&&(n=t.iframe,r=t.extensionId)}if(n||(n=this.iframes.get(t.extensionId),r=t.extensionId),!n||!(e.source instanceof Window&&this.byContentWindow.has(e.source))&&!this.isTrustedExtensionSource(n,e))return;if(t.type===`event`){this.handleExtensionEvent(r,t.event,t.data);let e=this.eventSubscribers.get(r);if(e){let n={event:t.event,data:t.data};for(let t of e)try{t(n)}catch{}}return}if(t.type!==`request`)return;let{requestId:i,method:a,params:o}=t,s=this.handlers.get(a);if(!s){this.postResponse(n,e,i,void 0,{code:BW.MethodNotFound,message:`Unknown method: ${a}`});return}let c=UW[a],l=this.extensionPermissions.get(r)??new Set;if(c&&!l.has(c)){this.postResponse(n,e,i,void 0,{code:BW.PermissionDenied,message:`Missing permission: ${c}`});return}try{let t=await s(r,o);this.postResponse(n,e,i,t)}catch(t){let r=t instanceof Error?t.message:String(t);this.postResponse(n,e,i,void 0,{code:BW.InternalError,message:r})}}};function GW(e){e.registerMethod(`theme.get`,async()=>HW(OB.getState().resolved)),e.registerMethod(`ui.navigate`,async(e,t)=>{let n=t&&typeof t==`object`&&t&&`path`in t?String(t.path??``):``;n&&window.dispatchEvent(new CustomEvent(`extension-navigate`,{detail:{path:n}}))}),e.registerMethod(`ui.notification`,async(e,t)=>{window.dispatchEvent(new CustomEvent(`extension-notification`,{detail:t}))}),e.registerMethod(`session.navigate`,async(e,t)=>{let n=t&&typeof t==`object`&&t&&`sessionKey`in t?String(t.sessionKey??``):``;n&&window.dispatchEvent(new CustomEvent(`navigate-to-chat`,{detail:{sessionKey:n},bubbles:!0}))}),e.registerMethod(`session.list`,async()=>{let e=await rW(Q(`/api/sessions`));if(!e.ok)throw Error(`Failed to list sessions: ${e.status}`);return((await e.json()).items??[]).map(e=>({sessionKey:e.key,title:e.name,lastMessageAt:e.updatedAt??e.lastAccessedAt,messageCount:e.messageCount}))}),e.registerMethod(`agent.sendMessage`,async(e,t)=>{let{message:n,sessionKey:r,newSession:i}=t,a=await rW(Q(`/api/agent`),{method:`POST`,headers:{Accept:`application/json`},body:JSON.stringify({message:n,channel:`webchat`,sessionKey:i?void 0:r,newSession:!!i})});if(!a.ok)throw Error(`Agent request failed: ${a.status}`);let o=await a.json();return{sessionKey:o.payload?.sessionKey??o.payload?.key??o.sessionKey??r??``}}),e.registerMethod(`config.get`,async e=>{let t=await rW(Q(`/api/extensions/${encodeURIComponent(e)}/config`));if(!t.ok)throw Error(`Failed to get config: ${t.status}`);return t.json()}),e.registerMethod(`config.set`,async(e,t)=>{let n=t&&typeof t==`object`&&t&&!Array.isArray(t)?t:{},r=await rW(Q(`/api/extensions/${encodeURIComponent(e)}/config`),{method:`PATCH`,body:JSON.stringify(n)});if(!r.ok)throw Error(`Failed to set config: ${r.status}`)}),e.registerMethod(`storage.get`,async(e,t)=>{let n=t&&typeof t==`object`&&t&&`key`in t?String(t.key??``):``,r=await rW(Q(`/api/extensions/${encodeURIComponent(e)}/storage/${encodeURIComponent(n)}`));if(r.status!==404){if(!r.ok)throw Error(`Failed to get storage key: ${r.status}`);return(await r.json()).value}}),e.registerMethod(`storage.set`,async(e,t)=>{let n=t,r=n&&typeof n.key==`string`?n.key:``,i=await rW(Q(`/api/extensions/${encodeURIComponent(e)}/storage/${encodeURIComponent(r)}`),{method:`PUT`,body:JSON.stringify({value:n?.value})});if(!i.ok)throw Error(`Failed to set storage key: ${i.status}`)}),e.registerMethod(`storage.remove`,async(e,t)=>{let n=t&&typeof t==`object`&&t&&`key`in t?String(t.key??``):``,r=await rW(Q(`/api/extensions/${encodeURIComponent(e)}/storage/${encodeURIComponent(n)}`),{method:`DELETE`});if(r.status!==404&&!r.ok)throw Error(`Failed to remove storage key: ${r.status}`)}),e.registerMethod(`storage.keys`,async e=>{let t=await rW(Q(`/api/extensions/${encodeURIComponent(e)}/storage`));if(!t.ok)throw Error(`Failed to list storage keys: ${t.status}`);return(await t.json()).keys??[]})}var KW=(0,z.createContext)(null);function qW({children:e}){let t=(0,z.useRef)(null);if(!t.current){let e=new WW;GW(e),t.current=e}let n=t.current,{data:r,isLoading:i}=u(BB(e=>!!e.token)?`gateway-extensions-list`:null,()=>iW(Q(`/api/extensions`)),{revalidateOnFocus:!1}),a=r?.extensions??[],o=OB(e=>e.resolved),s=(0,z.useCallback)(e=>{let t=e.detail;t?.sessionKey&&n.forwardAgentStreamEvent(t.sessionKey,t.event??t)},[n]);(0,z.useEffect)(()=>(window.addEventListener(`agent-stream-event`,s),()=>{window.removeEventListener(`agent-stream-event`,s)}),[s]),(0,z.useEffect)(()=>{let e=HW(o);n.broadcastEvent(`theme.changed`,e)},[o,n]);let c=(0,z.useRef)(n);c.current=n,(0,z.useEffect)(()=>()=>{c.current.dispose(),t.current=null},[]);let l=(0,z.useMemo)(()=>({router:n,extensions:a,loading:i}),[n,a,i]);return(0,Z.jsx)(KW.Provider,{value:l,children:e})}function JW(){let e=(0,z.useContext)(KW);if(!e)throw Error(`useExtensionRouter must be used within ExtensionProvider`);return e.router}function YW(){let e=(0,z.useContext)(KW);if(!e)throw Error(`useExtensions must be used within ExtensionProvider`);return e.extensions}function XW(e){return e.active||e.activationEligible===!0}function ZW(e){let t=e.ui?.contributions;return t?Array.isArray(t.pages)&&t.pages.length>0||Array.isArray(t.settingsPanels)&&t.settingsPanels.length>0||Array.isArray(t.chatWidgets)&&t.chatWidgets.length>0:!1}function QW(e){return!e.hasUi||!XW(e)?!1:ZW(e)}function $W(){let e=YW();return(0,z.useMemo)(()=>e.filter(QW),[e])}function eG(){let e=(0,z.useContext)(KW);if(!e)throw Error(`useExtensionsLoading must be used within ExtensionProvider`);return e.loading}function tG(e,t){return t.path.startsWith(`/apps/`)?t.path:`/apps/${e}/${t.id.startsWith(`${e}.`)?t.id.slice(e.length+1):t.id}`}function nG(e){return YL[e.split(`-`).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(``)]}function rG({collapsed:e=!1,onNavigate:t,navLinkClassName:n}){let r=iG($W());return r.length===0?null:(0,Z.jsx)(Z.Fragment,{children:r.map(({extension:r,page:i})=>{let a=i.navIcon?nG(i.navIcon):void 0;return(0,Z.jsxs)(wo,{to:tG(r.id,i),className:t=>n(t,e),title:i.title,onClick:()=>t?.(),children:[a?(0,Z.jsx)(a,{className:`size-4 shrink-0 opacity-90`,strokeWidth:1.75,"aria-hidden":!0}):(0,Z.jsx)(`span`,{className:`flex size-4 shrink-0 items-center justify-center text-[10px] font-bold opacity-70`,"aria-hidden":!0,children:i.title.charAt(0).toUpperCase()}),e?null:(0,Z.jsx)(`span`,{className:`truncate`,children:i.title})]},`${r.id}:${i.id}`)})})}function iG(e){let t=[];for(let n of e){let e=n.ui?.contributions?.pages;if(e)for(let r of e)r.showInNav&&t.push({extension:n,page:r})}return t}var aG=[`top`,`right`,`bottom`,`left`],oG=Math.min,sG=Math.max,cG=Math.round,lG=Math.floor,uG=e=>({x:e,y:e}),dG={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function fG(e,t,n){return sG(e,oG(t,n))}function pG(e,t){return typeof e==`function`?e(t):e}function mG(e){return e.split(`-`)[0]}function hG(e){return e.split(`-`)[1]}function gG(e){return e===`x`?`y`:`x`}function _G(e){return e===`y`?`height`:`width`}function vG(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function yG(e){return gG(vG(e))}function bG(e,t,n){n===void 0&&(n=!1);let r=hG(e),i=yG(e),a=_G(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=kG(o)),[o,kG(o)]}function xG(e){let t=kG(e);return[SG(e),t,SG(t)]}function SG(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var CG=[`left`,`right`],wG=[`right`,`left`],TG=[`top`,`bottom`],EG=[`bottom`,`top`];function DG(e,t,n){switch(e){case`top`:case`bottom`:return n?t?wG:CG:t?CG:wG;case`left`:case`right`:return t?TG:EG;default:return[]}}function OG(e,t,n,r){let i=hG(e),a=DG(mG(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(SG)))),a}function kG(e){let t=mG(e);return dG[t]+e.slice(t.length)}function AG(e){return{top:0,right:0,bottom:0,left:0,...e}}function jG(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:AG(e)}function MG(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function NG(e,t,n){let{reference:r,floating:i}=e,a=vG(t),o=yG(t),s=_G(o),c=mG(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(hG(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function PG(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=pG(t,e),p=jG(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=MG(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=MG(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var FG=50,IG=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:PG},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=NG(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<FG&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=NG(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},LG=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=pG(e,t)||{};if(l==null)return{};let d=jG(u),f={x:n,y:r},p=yG(i),m=_G(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=oG(d[_],T),D=oG(d[v],T),O=E,k=C-h[m]-D,A=C/2-h[m]/2+w,j=fG(O,A,k),M=!c.arrow&&hG(i)!=null&&A!==j&&a.reference[m]/2-(A<O?E:D)-h[m]/2<0,N=M?A<O?A-O:A-k:0;return{[p]:f[p]+N,data:{[p]:j,centerOffset:A-j-N,...M&&{alignmentOffset:N}},reset:M}}}),RG=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=pG(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=mG(r),_=vG(o),v=mG(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[kG(o)]:xG(o)),x=p!==`none`;!d&&x&&b.push(...OG(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=bG(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==vG(t))||T.every(e=>vG(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=vG(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}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 BG(e){return aG.some(t=>e[t]>=0)}var VG=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=pG(e,t);switch(i){case`referenceHidden`:{let e=zG(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:BG(e)}}}case`escaped`:{let e=zG(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:BG(e)}}}default:return{}}}}},HG=new Set([`left`,`top`]);async function UG(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=mG(n),s=hG(n),c=vG(n)===`y`,l=HG.has(o)?-1:1,u=a&&c?-1:1,d=pG(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var WG=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await UG(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},GG=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=pG(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=vG(mG(i)),p=gG(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=fG(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=fG(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},KG=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=pG(e,t),u={x:n,y:r},d=vG(i),f=gG(d),p=u[f],m=u[d],h=pG(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=HG.has(mG(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},qG=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=pG(e,t),u=await o.detectOverflow(t,l),d=mG(i),f=hG(i),p=vG(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=oG(h-u[g],v),x=oG(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=sG(u.left,0),t=sG(u.right,0),n=sG(u.top,0),r=sG(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:sG(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:sG(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function JG(){return typeof window<`u`}function YG(e){return QG(e)?(e.nodeName||``).toLowerCase():`#document`}function XG(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ZG(e){return((QG(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function QG(e){return JG()?e instanceof Node||e instanceof XG(e).Node:!1}function $G(e){return JG()?e instanceof Element||e instanceof XG(e).Element:!1}function eK(e){return JG()?e instanceof HTMLElement||e instanceof XG(e).HTMLElement:!1}function tK(e){return!JG()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof XG(e).ShadowRoot}function nK(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=pK(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function rK(e){return/^(table|td|th)$/.test(YG(e))}function iK(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var aK=/transform|translate|scale|rotate|perspective|filter/,oK=/paint|layout|strict|content/,sK=e=>!!e&&e!==`none`,cK;function lK(e){let t=$G(e)?pK(e):e;return sK(t.transform)||sK(t.translate)||sK(t.scale)||sK(t.rotate)||sK(t.perspective)||!dK()&&(sK(t.backdropFilter)||sK(t.filter))||aK.test(t.willChange||``)||oK.test(t.contain||``)}function uK(e){let t=hK(e);for(;eK(t)&&!fK(t);){if(lK(t))return t;if(iK(t))return null;t=hK(t)}return null}function dK(){return cK??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),cK}function fK(e){return/^(html|body|#document)$/.test(YG(e))}function pK(e){return XG(e).getComputedStyle(e)}function mK(e){return $G(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function hK(e){if(YG(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||tK(e)&&e.host||ZG(e);return tK(t)?t.host:t}function gK(e){let t=hK(e);return fK(t)?e.ownerDocument?e.ownerDocument.body:e.body:eK(t)&&nK(t)?t:gK(t)}function _K(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=gK(e),i=r===e.ownerDocument?.body,a=XG(r);if(i){let e=vK(a);return t.concat(a,a.visualViewport||[],nK(r)?r:[],e&&n?_K(e):[])}else return t.concat(r,_K(r,[],n))}function vK(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function yK(e){let t=pK(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=eK(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=cG(n)!==a||cG(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function bK(e){return $G(e)?e:e.contextElement}function xK(e){let t=bK(e);if(!eK(t))return uG(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=yK(t),o=(a?cG(n.width):n.width)/r,s=(a?cG(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var SK=uG(0);function CK(e){let t=XG(e);return!dK()||!t.visualViewport?SK:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function wK(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==XG(e)?!1:t}function TK(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=bK(e),o=uG(1);t&&(r?$G(r)&&(o=xK(r)):o=xK(e));let s=wK(a,n,r)?CK(a):uG(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=XG(a),t=r&&$G(r)?XG(r):r,n=e,i=vK(n);for(;i&&r&&t!==n;){let e=xK(i),t=i.getBoundingClientRect(),r=pK(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=XG(i),i=vK(n)}}return MG({width:u,height:d,x:c,y:l})}function EK(e,t){let n=mK(e).scrollLeft;return t?t.left+n:TK(ZG(e)).left+n}function DK(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-EK(e,n),y:n.top+t.scrollTop}}function OK(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=ZG(r),s=t?iK(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=uG(1),u=uG(0),d=eK(r);if((d||!d&&!a)&&((YG(r)!==`body`||nK(o))&&(c=mK(r)),d)){let e=TK(r);l=xK(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?DK(o,c):uG(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function kK(e){return Array.from(e.getClientRects())}function AK(e){let t=ZG(e),n=mK(e),r=e.ownerDocument.body,i=sG(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=sG(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+EK(e),s=-n.scrollTop;return pK(r).direction===`rtl`&&(o+=sG(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var jK=25;function MK(e,t){let n=XG(e),r=ZG(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=dK();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=EK(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=jK&&(a-=o)}else l<=jK&&(a+=l);return{width:a,height:o,x:s,y:c}}function NK(e,t){let n=TK(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=eK(e)?xK(e):uG(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function PK(e,t,n){let r;if(t===`viewport`)r=MK(e,n);else if(t===`document`)r=AK(ZG(e));else if($G(t))r=NK(t,n);else{let n=CK(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return MG(r)}function FK(e,t){let n=hK(e);return n===t||!$G(n)||fK(n)?!1:pK(n).position===`fixed`||FK(n,t)}function IK(e,t){let n=t.get(e);if(n)return n;let r=_K(e,[],!1).filter(e=>$G(e)&&YG(e)!==`body`),i=null,a=pK(e).position===`fixed`,o=a?hK(e):e;for(;$G(o)&&!fK(o);){let t=pK(o),n=lK(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||nK(o)&&!n&&FK(e,o))?r=r.filter(e=>e!==o):i=t,o=hK(o)}return t.set(e,r),r}function LK(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?iK(t)?[]:IK(t,this._c):[].concat(n),r],o=PK(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=PK(t,a[e],i);s=sG(n.top,s),c=oG(n.right,c),l=oG(n.bottom,l),u=sG(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function RK(e){let{width:t,height:n}=yK(e);return{width:t,height:n}}function zK(e,t,n){let r=eK(t),i=ZG(t),a=n===`fixed`,o=TK(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=uG(0);function l(){c.x=EK(i)}if(r||!r&&!a)if((YG(t)!==`body`||nK(i))&&(s=mK(t)),r){let e=TK(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?DK(i,s):uG(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function BK(e){return pK(e).position===`static`}function VK(e,t){if(!eK(e)||pK(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return ZG(e)===n&&(n=n.ownerDocument.body),n}function HK(e,t){let n=XG(e);if(iK(e))return n;if(!eK(e)){let t=hK(e);for(;t&&!fK(t);){if($G(t)&&!BK(t))return t;t=hK(t)}return n}let r=VK(e,t);for(;r&&rK(r)&&BK(r);)r=VK(r,t);return r&&fK(r)&&BK(r)&&!lK(r)?n:r||uK(e)||n}var UK=async function(e){let t=this.getOffsetParent||HK,n=this.getDimensions,r=await n(e.floating);return{reference:zK(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function WK(e){return pK(e).direction===`rtl`}var GK={convertOffsetParentRelativeRectToViewportRelativeRect:OK,getDocumentElement:ZG,getClippingRect:LK,getOffsetParent:HK,getElementRects:UK,getClientRects:kK,getDimensions:RK,getScale:xK,isElement:$G,isRTL:WK};function KK(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function qK(e,t){let n=null,r,i=ZG(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=lG(d),h=lG(i.clientWidth-(u+f)),g=lG(i.clientHeight-(d+p)),_=lG(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:sG(0,oG(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!KK(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function JK(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=bK(e),u=i||a?[...l?_K(l):[],...t?_K(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?qK(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?TK(e):null;c&&g();function g(){let t=TK(e);h&&!KK(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var YK=WG,XK=GG,ZK=RG,QK=qG,$K=VG,eq=LG,tq=KG,nq=(e,t,n)=>{let r=new Map,i={platform:GK,...n},a={...i.platform,_c:r};return IG(e,t,{...i,platform:a})},rq=typeof document<`u`?z.useLayoutEffect:function(){};function iq(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,i;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(!iq(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!iq(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function aq(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function oq(e,t){let n=aq(e);return Math.round(t*n)/n}function sq(e){let t=z.useRef(e);return rq(()=>{t.current=e}),t}function cq(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=z.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=z.useState(r);iq(f,r)||p(r);let[m,h]=z.useState(null),[g,_]=z.useState(null),v=z.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=z.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=z.useRef(null),C=z.useRef(null),w=z.useRef(u),T=c!=null,E=sq(c),D=sq(i),O=sq(l),k=z.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),nq(S.current,C.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};A.current&&!iq(w.current,t)&&(w.current=t,Ho.flushSync(()=>{d(t)}))})},[f,t,n,D,O]);rq(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let A=z.useRef(!1);rq(()=>(A.current=!0,()=>{A.current=!1}),[]),rq(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,k);k()}},[b,x,k,E,T]);let j=z.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),M=z.useMemo(()=>({reference:b,floating:x}),[b,x]),N=z.useMemo(()=>{let e={position:n,left:0,top:0};if(!M.floating)return e;let t=oq(M.floating,u.x),r=oq(M.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...aq(M.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,M.floating,u.x,u.y]);return z.useMemo(()=>({...u,update:k,refs:j,elements:M,floatingStyles:N}),[u,k,j,M,N])}var lq=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:eq({element:r.current,padding:i}).fn(n):r?eq({element:r,padding:i}).fn(n):{}}}},uq=(e,t)=>{let n=YK(e);return{name:n.name,fn:n.fn,options:[e,t]}},dq=(e,t)=>{let n=XK(e);return{name:n.name,fn:n.fn,options:[e,t]}},fq=(e,t)=>({fn:tq(e).fn,options:[e,t]}),pq=(e,t)=>{let n=ZK(e);return{name:n.name,fn:n.fn,options:[e,t]}},mq=(e,t)=>{let n=QK(e);return{name:n.name,fn:n.fn,options:[e,t]}},hq=(e,t)=>{let n=$K(e);return{name:n.name,fn:n.fn,options:[e,t]}},gq=(e,t)=>{let n=lq(e);return{name:n.name,fn:n.fn,options:[e,t]}},_q=`Arrow`,vq=z.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,Z.jsx)(cV.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,Z.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});vq.displayName=_q;var yq=vq;function bq(e){let[t,n]=z.useState(void 0);return qB(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}else n(void 0)},[e]),t}var xq=`Popper`,[Sq,Cq]=GB(xq),[wq,Tq]=Sq(xq),Eq=e=>{let{__scopePopper:t,children:n}=e,[r,i]=z.useState(null);return(0,Z.jsx)(wq,{scope:t,anchor:r,onAnchorChange:i,children:n})};Eq.displayName=xq;var Dq=`PopperAnchor`,Oq=z.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,a=Tq(Dq,n),o=z.useRef(null),s=Nz(t,o),c=z.useRef(null);return z.useEffect(()=>{let e=c.current;c.current=r?.current||o.current,e!==c.current&&a.onAnchorChange(c.current)}),r?null:(0,Z.jsx)(cV.div,{...i,ref:s})});Oq.displayName=Dq;var kq=`PopperContent`,[Aq,jq]=Sq(kq),Mq=z.forwardRef((e,t)=>{let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=`partial`,hideWhenDetached:f=!1,updatePositionStrategy:p=`optimized`,onPlaced:m,...h}=e,g=Tq(kq,n),[_,v]=z.useState(null),y=Nz(t,e=>v(e)),[b,x]=z.useState(null),S=bq(b),C=S?.width??0,w=S?.height??0,T=r+(a===`center`?``:`-`+a),E=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},D=Array.isArray(l)?l:[l],O=D.length>0,k={padding:E,boundary:D.filter(Iq),altBoundary:O},{refs:A,floatingStyles:j,placement:M,isPositioned:N,middlewareData:P}=cq({strategy:`fixed`,placement:T,whileElementsMounted:(...e)=>JK(...e,{animationFrame:p===`always`}),elements:{reference:g.anchor},middleware:[uq({mainAxis:i+w,alignmentAxis:o}),c&&dq({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?fq():void 0,...k}),c&&pq({...k}),mq({...k,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)}}),b&&gq({element:b,padding:s}),Lq({arrowWidth:C,arrowHeight:w}),f&&hq({strategy:`referenceHidden`,...k})]}),[F,I]=Rq(M),L=uV(m);qB(()=>{N&&L?.()},[N,L]);let R=P.arrow?.x,B=P.arrow?.y,V=P.arrow?.centerOffset!==0,[H,ee]=z.useState();return qB(()=>{_&&ee(window.getComputedStyle(_).zIndex)},[_]),(0,Z.jsx)(`div`,{ref:A.setFloating,"data-radix-popper-content-wrapper":``,style:{...j,transform:N?j.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:H,"--radix-popper-transform-origin":[P.transformOrigin?.x,P.transformOrigin?.y].join(` `),...P.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,Z.jsx)(Aq,{scope:n,placedSide:F,onArrowChange:x,arrowX:R,arrowY:B,shouldHideArrow:V,children:(0,Z.jsx)(cV.div,{"data-side":F,"data-align":I,...h,ref:y,style:{...h.style,animation:N?void 0:`none`}})})})});Mq.displayName=kq;var Nq=`PopperArrow`,Pq={top:`bottom`,right:`left`,bottom:`top`,left:`right`},Fq=z.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=jq(Nq,n),a=Pq[i.placedSide];return(0,Z.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,Z.jsx)(yq,{...r,ref:t,style:{...r.style,display:`block`}})})});Fq.displayName=Nq;function Iq(e){return e!==null}var Lq=e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=Rq(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}});function Rq(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var zq=Eq,Bq=Oq,Vq=Mq,Hq=Fq,Uq=`Popover`,[Wq,Nee]=GB(Uq,[Cq]),Gq=Cq(),[Kq,qq]=Wq(Uq),Jq=e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=Gq(t),c=z.useRef(null),[l,u]=z.useState(!1),[d,f]=QB({prop:r,defaultProp:i??!1,onChange:a,caller:Uq});return(0,Z.jsx)(zq,{...s,children:(0,Z.jsx)(Kq,{scope:t,contentId:XB(),triggerRef:c,open:d,onOpenChange:f,onOpenToggle:z.useCallback(()=>f(e=>!e),[f]),hasCustomAnchor:l,onCustomAnchorAdd:z.useCallback(()=>u(!0),[]),onCustomAnchorRemove:z.useCallback(()=>u(!1),[]),modal:o,children:n})})};Jq.displayName=Uq;var Yq=`PopoverAnchor`,Xq=z.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=qq(Yq,n),a=Gq(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:s}=i;return z.useEffect(()=>(o(),()=>s()),[o,s]),(0,Z.jsx)(Bq,{...a,...r,ref:t})});Xq.displayName=Yq;var Zq=`PopoverTrigger`,Qq=z.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=qq(Zq,n),a=Gq(n),o=Nz(t,i.triggerRef),s=(0,Z.jsx)(cV.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.contentId,"data-state":pJ(i.open),...r,ref:o,onClick:UB(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:(0,Z.jsx)(Bq,{asChild:!0,...a,children:s})});Qq.displayName=Zq;var $q=`PopoverPortal`,[eJ,tJ]=Wq($q,{forceMount:void 0}),nJ=e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=qq($q,t);return(0,Z.jsx)(eJ,{scope:t,forceMount:n,children:(0,Z.jsx)(WV,{present:n||a.open,children:(0,Z.jsx)(HV,{asChild:!0,container:i,children:r})})})};nJ.displayName=$q;var rJ=`PopoverContent`,iJ=z.forwardRef((e,t)=>{let n=tJ(rJ,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=qq(rJ,e.__scopePopover);return(0,Z.jsx)(WV,{present:r||a.open,children:a.modal?(0,Z.jsx)(oJ,{...i,ref:t}):(0,Z.jsx)(sJ,{...i,ref:t})})});iJ.displayName=rJ;var aJ=tV(`PopoverContent.RemoveScroll`),oJ=z.forwardRef((e,t)=>{let n=qq(rJ,e.__scopePopover),r=z.useRef(null),i=Nz(t,r),a=z.useRef(!1);return z.useEffect(()=>{let e=r.current;if(e)return mU(e)},[]),(0,Z.jsx)(aU,{as:aJ,allowPinchZoom:!0,children:(0,Z.jsx)(cJ,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:UB(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:UB(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;a.current=t.button===2||n},{checkForDefaultPrevented:!1}),onFocusOutside:UB(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),sJ=z.forwardRef((e,t)=>{let n=qq(rJ,e.__scopePopover),r=z.useRef(!1),i=z.useRef(!1);return(0,Z.jsx)(cJ,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),cJ=z.forwardRef((e,t)=>{let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,...d}=e,f=qq(rJ,n),p=Gq(n);return YV(),(0,Z.jsx)(kV,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,Z.jsx)(vV,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>f.onOpenChange(!1),children:(0,Z.jsx)(Vq,{"data-state":pJ(f.open),role:`dialog`,id:f.contentId,...p,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-popover-content-available-width":`var(--radix-popper-available-width)`,"--radix-popover-content-available-height":`var(--radix-popper-available-height)`,"--radix-popover-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-popover-trigger-height":`var(--radix-popper-anchor-height)`}})})})}),lJ=`PopoverClose`,uJ=z.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=qq(lJ,n);return(0,Z.jsx)(cV.button,{type:`button`,...r,ref:t,onClick:UB(e.onClick,()=>i.onOpenChange(!1))})});uJ.displayName=lJ;var dJ=`PopoverArrow`,fJ=z.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=Gq(n);return(0,Z.jsx)(Hq,{...i,...r,ref:t})});fJ.displayName=dJ;function pJ(e){return e?`open`:`closed`}var mJ=Jq,hJ=Qq,gJ=nJ,_J=iJ,vJ=uJ,yJ=fJ,bJ={version:`0.0.18`,commit:`22c3f34acdb555e6baf815dbf42d802022f6ef9f`,buildTimeIso:`2026-04-26T15:06:27.324Z`},xJ=`https://github.com/xopcai/xopc`,SJ=`https://github.com/xopcai/xopc/releases`;function CJ(e,t){let n=new Date(e);if(Number.isNaN(n.getTime()))return e;try{return new Intl.DateTimeFormat(t===`zh`?`zh-CN`:`en-US`,{year:`numeric`,month:`numeric`,day:`numeric`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hour12:!1}).format(n)}catch{return n.toISOString()}}function wJ({open:e,onOpenChange:t}){let n=lB(e=>e.language),r=Jz(n),i=r.aboutDialog,[a,o]=(0,z.useState)(null);(0,z.useEffect)(()=>{if(!e)return;let t=!1;return o(null),(async()=>{try{let e=await rW(Q(`/health`));if(!e.ok)throw Error(`health`);let n=await e.json();t||o(typeof n.version==`string`?n.version:null)}catch{t||o(null)}})(),()=>{t=!0}},[e]);let s=bJ.commit,c=n===`zh`?`zh-CN`:`en-US`,l=CJ(bJ.buildTimeIso,c),u=new Date().getFullYear(),d=i.copyright.replace(`{year}`,String(u));return(0,Z.jsx)(qU,{open:e,onOpenChange:t,children:(0,Z.jsxs)(JU,{children:[(0,Z.jsx)(YU,{className:`xopc-dialog-overlay fixed inset-0 z-[200] bg-scrim`}),(0,Z.jsxs)(XU,{className:X(`xopc-dialog-content fixed left-1/2 top-1/2 z-[201] w-[min(100%-2rem,26rem)] -translate-x-1/2 -translate-y-1/2`,`rounded-2xl border border-edge bg-surface-panel shadow-popover dark:border-edge`),onOpenAutoFocus:e=>e.preventDefault(),children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-2 px-4 pt-3`,"aria-hidden":!0,children:[(0,Z.jsx)(`span`,{className:`size-3 rounded-full bg-[#ff5f57]`}),(0,Z.jsx)(`span`,{className:`size-3 rounded-full bg-[#febc2e]`}),(0,Z.jsx)(`span`,{className:`size-3 rounded-full bg-[#28c840]`})]}),(0,Z.jsxs)(`div`,{className:`px-6 pb-2 pt-1`,children:[(0,Z.jsx)(`div`,{className:`flex justify-end`,children:(0,Z.jsx)($U,{asChild:!0,children:(0,Z.jsx)(`button`,{type:`button`,className:`rounded-lg p-1.5 text-fg-muted hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/40`,"aria-label":i.close,children:(0,Z.jsx)(jL,{className:`size-4`,strokeWidth:2})})})}),(0,Z.jsxs)(`div`,{className:`-mt-2 flex flex-col items-center text-center`,children:[(0,Z.jsx)(Az,{className:`size-[4.5rem]`,alt:r.appBrand}),(0,Z.jsx)(ZU,{className:`mt-3 text-xl font-semibold tracking-tight text-fg`,children:r.appBrand}),(0,Z.jsx)(QU,{className:`sr-only`,children:i.windowTitle})]}),(0,Z.jsxs)(`div`,{className:`mt-6 space-y-3 text-sm`,children:[(0,Z.jsxs)(`div`,{className:`grid grid-cols-[5.5rem_1fr] items-center gap-x-3 gap-y-1`,children:[(0,Z.jsx)(`span`,{className:`text-fg-muted`,children:i.versionLabel}),(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center justify-end gap-2 sm:justify-start`,children:[(0,Z.jsx)(`span`,{className:`font-mono text-[13px] text-fg tabular-nums`,children:bJ.version}),(0,Z.jsx)(`button`,{type:`button`,className:X(`shrink-0 rounded-md border border-edge bg-surface-base px-2 py-0.5 text-[11px] font-medium text-fg-muted`,`transition-colors hover:bg-surface-hover hover:text-fg`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/40`),onClick:()=>window.open(SJ,`_blank`,`noopener,noreferrer`),children:i.checkUpdates})]})]}),(0,Z.jsxs)(`div`,{className:`grid grid-cols-[5.5rem_1fr] gap-x-3 gap-y-1`,children:[(0,Z.jsx)(`span`,{className:`pt-0.5 text-fg-muted`,children:i.commitLabel}),(0,Z.jsx)(`span`,{className:`break-all font-mono text-[11px] leading-snug text-fg`,children:s})]}),(0,Z.jsxs)(`div`,{className:`grid grid-cols-[5.5rem_1fr] items-baseline gap-x-3 gap-y-1`,children:[(0,Z.jsx)(`span`,{className:`text-fg-muted`,children:i.buildDateLabel}),(0,Z.jsx)(`span`,{className:`text-right text-[13px] text-fg sm:text-left`,children:l})]}),(0,Z.jsxs)(`div`,{className:`grid grid-cols-[5.5rem_1fr] items-baseline gap-x-3 gap-y-1`,children:[(0,Z.jsx)(`span`,{className:`text-fg-muted`,children:i.gatewayVersionLabel}),(0,Z.jsx)(`span`,{className:`text-right font-mono text-[13px] text-fg sm:text-left`,children:a??i.gatewayUnavailable})]}),(0,Z.jsx)(`p`,{className:`pt-0.5 text-[11px] text-fg-subtle`,children:i.consoleBuildHint})]}),(0,Z.jsxs)(`div`,{className:`mt-6 border-t border-edge-subtle pt-4 text-center text-[11px] leading-relaxed text-fg-muted`,children:[(0,Z.jsxs)(`p`,{children:[i.openSourceLead,(0,Z.jsx)(`a`,{className:`text-accent-fg underline decoration-accent-fg/40 underline-offset-2 hover:decoration-accent-fg`,href:xJ,target:`_blank`,rel:`noopener noreferrer`,children:i.openSourceLink})]}),(0,Z.jsx)(`p`,{className:`mt-2`,children:d})]})]})]})]})})}var TJ=X(`flex w-full items-center gap-2.5 rounded-lg px-3 py-2.5 text-left text-sm font-medium leading-5 text-fg`,`transition-colors duration-150 ease-out`,`hover:bg-surface-hover`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-surface-panel`),EJ=X(`rounded-xl border border-edge bg-surface-panel p-1 shadow-popover`,`dark:border-edge`);function DJ({selected:e,label:t,onSelect:n}){return(0,Z.jsxs)(`button`,{type:`button`,className:X(`flex w-full items-center justify-between gap-2 rounded-lg px-3 py-2 text-left text-sm font-medium leading-5 text-fg`,`transition-colors duration-150 ease-out hover:bg-surface-hover`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-surface-panel`),onClick:n,children:[(0,Z.jsx)(`span`,{className:`min-w-0 truncate`,children:t}),e?(0,Z.jsx)(`span`,{className:`size-1.5 shrink-0 rounded-full bg-success`,"aria-hidden":!0}):(0,Z.jsx)(`span`,{className:`size-1.5 shrink-0`,"aria-hidden":!0})]})}function OJ({onOpenFullSettings:e,onAboutClick:t}){let[n,r]=(0,z.useState)(null),i=lB(e=>e.language),a=lB(e=>e.setLanguage),o=OB(e=>e.preference),s=OB(e=>e.setPreference),c=_B(e=>e.preference),l=_B(e=>e.setPreference),u=Jz(i),d=u.appearanceSettings,f=e=>X(`absolute left-full top-0 z-[60] min-w-[11rem] max-w-[min(calc(100vw-2rem),16rem)]`,`ml-2 sm:ml-2.5`,n===e?`block`:`hidden`),p=e=>X(`absolute left-full top-0 z-[55] h-full w-8 sm:w-9`,n===e?`pointer-events-auto`:`pointer-events-none`);return(0,Z.jsxs)(`div`,{className:`w-[min(calc(100vw-2rem),15rem)] shrink-0 py-1`,onMouseLeave:()=>r(null),children:[(0,Z.jsxs)(`div`,{className:`relative`,onMouseEnter:()=>r(`lang`),children:[(0,Z.jsxs)(`button`,{type:`button`,className:X(TJ,n===`lang`&&`bg-surface-hover`),"aria-haspopup":`menu`,"aria-expanded":n===`lang`,children:[(0,Z.jsx)(db,{className:`size-4 shrink-0 text-fg-muted`,strokeWidth:1.75,"aria-hidden":!0}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 text-left`,children:d.languageTitle}),(0,Z.jsx)(fp,{className:`size-4 shrink-0 text-fg-subtle`,strokeWidth:2,"aria-hidden":!0})]}),(0,Z.jsx)(`div`,{className:p(`lang`),"aria-hidden":!0}),(0,Z.jsx)(`div`,{className:f(`lang`),role:`menu`,"aria-label":d.languageTitle,children:(0,Z.jsxs)(`div`,{className:EJ,children:[(0,Z.jsx)(DJ,{selected:i===`en`,label:d.langOptionEn,onSelect:()=>a(`en`)}),(0,Z.jsx)(DJ,{selected:i===`zh`,label:d.langOptionZh,onSelect:()=>a(`zh`)})]})})]}),(0,Z.jsxs)(`div`,{className:`relative`,onMouseEnter:()=>r(`theme`),children:[(0,Z.jsxs)(`button`,{type:`button`,className:X(TJ,n===`theme`&&`bg-surface-hover`),"aria-haspopup":`menu`,"aria-expanded":n===`theme`,children:[(0,Z.jsx)(LE,{className:`size-4 shrink-0 text-fg-muted`,strokeWidth:1.75,"aria-hidden":!0}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 text-left`,children:d.themeTitle}),(0,Z.jsx)(fp,{className:`size-4 shrink-0 text-fg-subtle`,strokeWidth:2,"aria-hidden":!0})]}),(0,Z.jsx)(`div`,{className:p(`theme`),"aria-hidden":!0}),(0,Z.jsx)(`div`,{className:f(`theme`),role:`menu`,"aria-label":d.themeTitle,children:(0,Z.jsxs)(`div`,{className:EJ,children:[(0,Z.jsx)(DJ,{selected:o===`light`,label:d.themeOptionLight,onSelect:()=>s(`light`)}),(0,Z.jsx)(DJ,{selected:o===`dark`,label:d.themeOptionDark,onSelect:()=>s(`dark`)}),(0,Z.jsx)(DJ,{selected:o===`system`,label:d.themeOptionSystem,onSelect:()=>s(`system`)})]})})]}),(0,Z.jsxs)(`div`,{className:`relative`,onMouseEnter:()=>r(`font`),children:[(0,Z.jsxs)(`button`,{type:`button`,className:X(TJ,n===`font`&&`bg-surface-hover`),"aria-haspopup":`menu`,"aria-expanded":n===`font`,children:[(0,Z.jsx)(LF,{className:`size-4 shrink-0 text-fg-muted`,strokeWidth:1.75,"aria-hidden":!0}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 text-left`,children:d.fontScaleTitle}),(0,Z.jsx)(fp,{className:`size-4 shrink-0 text-fg-subtle`,strokeWidth:2,"aria-hidden":!0})]}),(0,Z.jsx)(`div`,{className:p(`font`),"aria-hidden":!0}),(0,Z.jsx)(`div`,{className:f(`font`),role:`menu`,"aria-label":d.fontScaleTitle,children:(0,Z.jsxs)(`div`,{className:EJ,children:[(0,Z.jsx)(DJ,{selected:c===`compact`,label:d.fontScaleCompact,onSelect:()=>l(`compact`)}),(0,Z.jsx)(DJ,{selected:c===`default`,label:d.fontScaleDefault,onSelect:()=>l(`default`)}),(0,Z.jsx)(DJ,{selected:c===`large`,label:d.fontScaleLarge,onSelect:()=>l(`large`)})]})})]}),(0,Z.jsx)(`div`,{className:`my-2 h-px bg-edge-subtle`,role:`separator`}),(0,Z.jsxs)(`button`,{type:`button`,className:TJ,onClick:()=>t?.(),onMouseEnter:()=>r(null),onFocus:()=>r(null),children:[(0,Z.jsx)(Gx,{className:`size-4 shrink-0 text-fg-muted`,strokeWidth:1.75,"aria-hidden":!0}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 text-left`,children:d.aboutApp})]}),(0,Z.jsxs)(`a`,{href:LB(i),target:`_blank`,rel:`noopener noreferrer`,className:TJ,onMouseEnter:()=>r(null),onFocus:()=>r(null),children:[(0,Z.jsx)(Lu,{className:`size-4 shrink-0 text-fg-muted`,strokeWidth:1.75,"aria-hidden":!0}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 text-left`,children:u.sidebar.helpDocs}),(0,Z.jsx)(r_,{className:`size-3.5 shrink-0 text-fg-subtle`,strokeWidth:2,"aria-hidden":!0})]}),(0,Z.jsxs)(Co,{to:zB(`settingsGateway`),className:X(TJ,`text-accent-fg hover:bg-accent-soft hover:text-accent-fg`),onMouseEnter:()=>r(null),onFocus:()=>r(null),onClick:()=>e?.(),children:[(0,Z.jsx)(TA,{className:`size-4 shrink-0`,strokeWidth:1.75,"aria-hidden":!0}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1`,children:d.openFullPreferences})]})]})}function kJ({collapsed:e=!1,onNavigate:t}){let n=Jz(lB(e=>e.language)),r=n.appearanceSettings,[i,a]=(0,z.useState)(!1),[o,s]=(0,z.useState)(!1);return(0,z.useEffect)(()=>{f(()=>import(`./settings-page-jqrVlTkQ.js`),__vite__mapDeps([0,1,2,3,4,5])),f(()=>import(`./sessions-page-CzTpNrb3.js`),__vite__mapDeps([6,1,4])),f(()=>import(`./logs-page-Du6UoHCK.js`),__vite__mapDeps([7,1,4])),f(()=>import(`./cron-page-CFuU6V8l.js`),__vite__mapDeps([8,1,9,4,2])),f(()=>import(`./skills-page-Dg_Uk_jM.js`),__vite__mapDeps([10,1,11,9,4]))},[]),(0,Z.jsxs)(`div`,{className:X(`flex shrink-0 flex-col`,e&&`mt-auto`,e?`items-center px-1 py-2`:`px-3 py-3`),children:[(0,Z.jsxs)(mJ,{open:i,onOpenChange:a,children:[e?(0,Z.jsx)(hJ,{asChild:!0,children:(0,Z.jsx)(`button`,{type:`button`,className:X(`flex size-10 shrink-0 items-center justify-center overflow-hidden rounded-full outline-none ring-offset-surface-base transition-transform`,`hover:opacity-95 active:scale-95`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2`,i&&`ring-2 ring-accent`,`motion-reduce:opacity-100 motion-reduce:active:scale-100`),"aria-expanded":i,"aria-haspopup":`dialog`,title:n.sidebar.appMenuAria,"aria-label":n.sidebar.appMenuAria,children:(0,Z.jsx)(Az,{className:`size-full rounded-full`,alt:n.appBrand})})}):(0,Z.jsx)(hJ,{asChild:!0,children:(0,Z.jsxs)(`button`,{type:`button`,className:X(`flex w-full min-w-0 items-center gap-2 rounded-xl px-1 py-1 text-left outline-none transition-colors duration-150 ease-out`,`hover:bg-surface-active/70`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-surface-base`,i&&`bg-surface-active/70`),"aria-expanded":i,"aria-haspopup":`dialog`,title:n.sidebar.appMenuAria,"aria-label":n.sidebar.appMenuAria,children:[(0,Z.jsx)(`span`,{className:`size-8 shrink-0 overflow-hidden rounded-full`,"aria-hidden":!0,children:(0,Z.jsx)(Az,{className:`size-full rounded-full`,alt:``,"aria-hidden":!0})}),(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Z.jsx)(`div`,{className:`truncate text-sm font-semibold leading-tight text-fg`,children:n.appBrand}),(0,Z.jsx)(`div`,{className:`truncate text-xs text-fg-muted`,children:r.quickMenuHint})]}),(0,Z.jsx)(`span`,{className:X(`flex size-9 shrink-0 items-center justify-center rounded-xl text-fg-muted transition-colors`,i&&`bg-accent-soft text-accent-fg`),"aria-hidden":!0,children:(0,Z.jsx)(TA,{className:`size-[18px]`,strokeWidth:1.5})})]})}),(0,Z.jsx)(gJ,{children:(0,Z.jsx)(_J,{className:X(`z-50 w-max max-w-[min(calc(100vw-1rem),28rem)] overflow-visible`,`rounded-xl border border-edge bg-surface-panel p-2 shadow-popover dark:border-edge`),side:`top`,align:e?`center`:`start`,sideOffset:8,collisionPadding:12,onOpenAutoFocus:e=>e.preventDefault(),onCloseAutoFocus:e=>e.preventDefault(),children:(0,Z.jsx)(OJ,{onOpenFullSettings:()=>{a(!1),t?.()},onAboutClick:()=>{s(!0),a(!1)}})})})]}),(0,Z.jsx)(wJ,{open:o,onOpenChange:s})]})}var AJ={feishu:`/channel-icons/feishu.svg`,lark:`/channel-icons/lark.svg`,telegram:`/channel-icons/telegram.svg`,weixin:`/channel-icons/weixin.svg`,wechat:`/channel-icons/wechat.svg`};function jJ({sourceChannel:e,className:t}){let n=AJ[e.toLowerCase()];return n?(0,Z.jsx)(`img`,{src:n,alt:``,draggable:!1,className:X(`shrink-0`,t),"aria-hidden":!0}):(0,Z.jsx)(Wb,{className:X(`shrink-0`,t),strokeWidth:1.75,"aria-hidden":!0})}var MJ=`inline-flex items-center gap-px rounded-pill border border-edge bg-surface-hover p-1 dark:border-edge`,NJ=`inline-flex shrink-0 items-center justify-center rounded-pill text-xs font-medium leading-none transition-[color,background-color,box-shadow] duration-150 ease-out text-fg-subtle focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-surface-panel active:scale-100`,PJ=`bg-surface-panel shadow-sm dark:bg-surface-panel dark:shadow-sm dark:ring-1 dark:ring-edge-strong/40`,FJ=1;function IJ(e,t){let n=0,r=0,i=e;for(;i&&i!==t;)n+=i.offsetLeft,r+=i.offsetTop,i=i.offsetParent;return i===t?{x:n,y:r}:null}var LJ=`pointer-events-none absolute left-0 top-0 z-[1] rounded-pill bg-surface-panel shadow-sm will-change-transform [backface-visibility:hidden] dark:bg-surface-panel dark:shadow-sm dark:ring-1 dark:ring-edge-strong/40`,RJ=`relative z-[2] box-border flex h-6 min-h-0 min-w-0 flex-1 cursor-pointer items-center justify-center gap-1 rounded-pill border-0 bg-transparent px-2 py-0 text-center text-xs font-medium leading-none outline-none transition-[color,background-color,box-shadow] duration-150 ease-out focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-surface-panel active:scale-100 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50`;function zJ({value:e,onChange:t,options:n,"aria-label":r,className:i,buttonClassName:a}){let o=(0,z.useRef)(null),s=(0,z.useRef)([]),[c,l]=(0,z.useState)({x:0,y:0,w:0,h:0}),[u,d]=(0,z.useState)(!1),[f,p]=(0,z.useState)(!1),m=(0,z.useCallback)(()=>{let t=o.current;if(!t)return;let r=n.findIndex(t=>t.value===e);if(r<0)return;let i=s.current[r];if(!i)return;let a=FJ,c=t.getBoundingClientRect(),u=i.getBoundingClientRect(),f=IJ(i,t),p,m;if(f)p=f.x,m=f.y;else{let e=getComputedStyle(t),n=parseFloat(e.borderLeftWidth)||0,r=parseFloat(e.borderTopWidth)||0;p=u.left-c.left-n,m=u.top-c.top-r}l({x:p+a,y:m+a,w:Math.max(0,u.width-a*2),h:Math.max(0,u.height-a*2)}),d(!0)},[n,e]);return(0,z.useLayoutEffect)(()=>{let e=requestAnimationFrame(()=>m());return()=>cancelAnimationFrame(e)},[m]),(0,z.useEffect)(()=>{let e=requestAnimationFrame(()=>{requestAnimationFrame(()=>p(!0))});return()=>cancelAnimationFrame(e)},[]),(0,z.useEffect)(()=>{let e=o.current;if(!e)return;let t=new ResizeObserver(()=>{requestAnimationFrame(()=>m())});return t.observe(e),window.addEventListener(`resize`,m),()=>{t.disconnect(),window.removeEventListener(`resize`,m)}},[m]),(0,Z.jsxs)(`div`,{ref:o,className:X(MJ,`relative isolate flex w-full max-w-full flex-row items-center`,i),role:`group`,"aria-label":r,children:[(0,Z.jsx)(`div`,{"aria-hidden":!0,className:X(LJ,`motion-reduce:!transition-none motion-reduce:!duration-0`,f&&`transition-[transform,width,height] duration-300 [transition-timing-function:cubic-bezier(0.32,0.72,0,1)]`),style:{width:c.w,height:c.h,transform:`translate3d(${c.x}px, ${c.y}px, 0)`,opacity:u&&c.w>0?1:0}}),n.map((n,r)=>{let i=n.icon,o=e===n.value;return(0,Z.jsxs)(`button`,{ref:e=>{s.current[r]=e},type:`button`,"aria-pressed":o,title:n.title??n.label,onClick:()=>t(n.value),className:X(RJ,o?`text-fg`:`text-fg-subtle`,a),children:[i?(0,Z.jsx)(i,{className:`block size-3 shrink-0 opacity-80`,strokeWidth:1.75,"aria-hidden":!0}):null,(0,Z.jsx)(`span`,{className:`min-w-0 shrink truncate leading-none`,children:n.label})]},n.value)})]})}function BJ(e){return typeof e==`object`&&!!e&&`role`in e}function VJ(e){if(!e||typeof e!=`object`)return!1;let t=e.type;return t===`tool_use`||t===`tool_call`||t===`toolCall`}function HJ(e){return typeof e.id==`string`&&e.id.length>0?e.id:crypto.randomUUID()}function UJ(e){if(typeof e!=`string`)return e;try{return JSON.parse(e)}catch{return e}}function WJ(e){return UJ(e.args??e.arguments??e.input??e.function?.arguments)??{}}function GJ(e){return typeof e==`object`&&!!e}function KJ(e){if(e.type!==`thinking`)return``;let t=e;return typeof t.text==`string`?t.text:typeof t.thinking==`string`?t.thinking:``}function qJ(e,t){let n=e.map(e=>({...e})),r=new Map;for(let e=0;e<n.length;e++){let t=n[e];t.type===`tool_use`&&r.set(t.id,e)}for(let e of t){if(e.type===`tool_use`&&r.has(e.id)){let t=r.get(e.id);n[t]={...e};continue}if(e.type===`thinking`&&n.length>0){let t=n[n.length-1];if(t.type===`thinking`&&KJ(t)===KJ(e))continue}e.type===`tool_use`&&r.set(e.id,n.length),n.push({...e})}return n}function JJ(e){if(e.length<2)return e;let t=[];for(let n of e){if(n.role!==`assistant`){t.push(n);continue}let e=t[t.length-1];e?.role===`assistant`?(e.content=qJ(e.content,n.content),n.timestamp!=null&&(e.timestamp=n.timestamp),n.usage&&(e.usage=n.usage),n.attachments?.length&&(e.attachments=aY([...e.attachments??[],...n.attachments]))):t.push({...n,content:[...n.content]})}return t}function YJ(e){let t=[];for(let n of e){if(!BJ(n))continue;let e=n,r=String(e.role??``);if(r!==`system`){if(r===`toolResult`||r===`tool`){dY(t,e);continue}if(r===`user`||r===`user-with-attachments`){t.push(sY(e));continue}if(r===`assistant`){t.push(cY(e));continue}}}return JJ(t)}function XJ(e){if(Array.isArray(e))return e.map(e=>ZJ(e))}function ZJ(e){if(!e||typeof e!=`object`)return{name:`file`,mimeType:`application/octet-stream`};let t=e,n=typeof t.data==`string`?t.data:void 0,r=typeof t.content==`string`&&t.content.length>0?t.content:n,i=typeof t.name==`string`&&t.name.length>0?t.name:`file`,a=typeof t.mimeType==`string`&&t.mimeType.length>0?t.mimeType:``;!a&&typeof t.type==`string`&&t.type.includes(`/`)&&(a=t.type),a||=`application/octet-stream`;let o=a.split(`;`)[0]?.trim().toLowerCase()??``;if(o===`application/octet-stream`||o===``){let e=k(i);e&&(a=e)}let s=typeof t.preview==`string`&&t.preview.length>0?t.preview:a.startsWith(`image/`)&&r?r:void 0;return{id:typeof t.id==`string`?t.id:void 0,name:i,mimeType:a,type:typeof t.type==`string`?t.type:void 0,size:typeof t.size==`number`?t.size:void 0,content:r,data:n??r,preview:s,extractedText:typeof t.extractedText==`string`?t.extractedText:void 0,workspaceRelativePath:typeof t.workspaceRelativePath==`string`&&t.workspaceRelativePath.length>0?t.workspaceRelativePath:void 0}}function QJ(e){if(typeof e!=`string`||!e.includes(`## Skill:`))return e;let t=e.match(/## Skill:\s*([^\s\r\n]+)/);if(!t)return e;let n=t[1]??``;if(!n)return e;let r=[...e.matchAll(/\*\*Arguments\*\*:\s*([^\r\n]+)/g)],i=r.length>0?(r[r.length-1]?.[1]??``).trim():``;return i?`/skill:${n} ${i}`:`/skill:${n}`}function $J(e){return e.includes(`<file path=`)?e.replace(/<file\s+path="[^"]*">\r?\n[\s\S]*?<\/file>(?:\r?\n)*/g,``).replace(/\n{3,}/g,`
50
50
 
51
51
  `).trim():e}function eY(e){if(!e.includes(`xopc-path:`))return e;let t=e;return t=t.replace(/\s*\[File:[^\]]+\]\s*\r?\nxopc-path:rel:[^\r\n]+\r?\n\s*xopc-path:abs:[^\r\n]+/g,``),t=t.replace(/\s*\[File:[^\]]+\]\s+xopc-path:rel:\S+\s+xopc-path:abs:\S+/g,``),t=t.replace(/\s*\[File:[^\]]+\]\s*xopc-path:rel:\S+\s*xopc-path:abs:\S+/g,``),t.replace(/\n{3,}/g,`
52
52
 
@@ -140,5 +140,5 @@ https://github.com/highlightjs/highlight.js/issues/2277`),i=e,r=t),n===void 0&&(
140
140
  `);){let e=r.indexOf(`
141
141
  `),n=r.slice(0,e);if(r=r.slice(e+1),n=n.replace(/\r$/,``),n.startsWith(`event:`))a=``,i=n.slice(6).trim();else if(n.startsWith(`data:`)){let e=n.startsWith(`data: `)?n.slice(6):n.slice(5);a+=(a?`
142
142
  `:``)+e}else n===``&&a&&(this._dispatchSSE(i||`message`,a,t),i=``,a=``)}}a&&this._dispatchSSE(i||`message`,a,t)}finally{n.releaseLock()}}_dispatchSSE(e,t,n){let r;try{r=JSON.parse(t)}catch{e===`result`&&n?.onResult();return}switch(e){case`status`:if(typeof r.runId==`string`&&this._sseChatId)try{sessionStorage.setItem(A9(this._sseChatId),JSON.stringify({runId:r.runId}))}catch{}n?.onStreamStart();break;case`token`:{let e=typeof r.content==`string`?r.content:typeof r.delta==`string`?r.delta:typeof r.text==`string`?r.text:``;e&&n?.onToken(e);break}case`thinking`:if(r.status===`started`){n?.onThinking(``,!1);break}n?.onThinking(String(r.content||``),!!r.delta);break;case`thinking_end`:n?.onThinkingEnd();break;case`message_end`:n?.onThinkingEnd();break;case`tool_start`:{let e=String(r.toolName||`unknown`);if(e===`clarify`)break;n?.onToolStart(e,r.args);break}case`tool_end`:n?.onToolEnd(typeof r.toolName==`string`&&r.toolName?r.toolName:`unknown`,!!r.isError,r.result);break;case`progress`:n?.onProgress({stage:String(r.stage||`thinking`),message:String(r.message||``),detail:r.detail,toolName:r.toolName,timestamp:Date.now()});break;case`tts_audio`:n?.onTtsAudio?.({workspaceRelativePath:String(r.workspaceRelativePath||``),mimeType:String(r.mimeType||`audio/mpeg`),name:String(r.name||`voice.mp3`)});break;case`clarify_request`:{let e=typeof r.requestId==`string`?r.requestId.trim():``,t=typeof r.question==`string`?r.question.trim():``;if(e&&t&&n?.onClarifyRequest){let i=Array.isArray(r.choices)?r.choices.filter(e=>typeof e==`string`&&e.trim().length>0):void 0,a=typeof r.default==`string`&&r.default.trim()?r.default.trim():void 0;n.onClarifyRequest({requestId:e,question:t,choices:i&&i.length>=2?i:void 0,default:a})}break}case`result`:n?.onResult();break;case`error`:n?.onError(String(r.content||r.error?.message||`Send failed`));break;default:{let e=typeof r.content==`string`?r.content:typeof r.delta==`string`?r.delta:typeof r.text==`string`?r.text:``;e&&n?.onToken(e);break}}}};async function j9(){let e=await rW(Q(`/api/agents`));if(e.ok){let t=await e.json();if(t.ok&&t.payload?.defaultId&&Array.isArray(t.payload.agents)){let e=t.payload.defaultId.trim().toLowerCase(),n=t.payload.agents.filter(e=>!!(e&&typeof e.id==`string`&&e.id.trim())).map(e=>({id:e.id.trim().toLowerCase(),name:typeof e.name==`string`&&e.name.trim()?e.name.trim():void 0,description:typeof e.description==`string`&&e.description.trim()?e.description.trim():void 0}));if(n.length>0)return{defaultId:e,items:n}}}let t=(await hW()).payload?.config?.agents,n=(t?.defaultId??`main`).trim().toLowerCase(),r=(Array.isArray(t?.list)?t.list:[]).filter(e=>!!(e&&typeof e.id==`string`&&e.id.trim())).map(e=>({id:e.id.trim().toLowerCase(),name:typeof e.name==`string`&&e.name.trim()?e.name.trim():void 0,description:typeof e.description==`string`&&e.description.trim()?e.description.trim():void 0}));return r.length===0?{defaultId:n,items:[{id:n}]}:{defaultId:n,items:r}}function M9(e){let t=e.split(`:`).filter(Boolean);if(t.length<5)return null;let n=t[1]?.toLowerCase();return n!==`webchat`&&n!==`gateway`?null:t[0]?.trim().toLowerCase()||null}function ute(e){if(e.type!==`thinking`)return``;let t=e;return(typeof t.text==`string`&&t.text.length>0?t.text:typeof t.thinking==`string`?t.thinking:``).trim()}function dte(e){if(e.role!==`assistant`)return!1;for(let t of e.content)if(t.type===`text`&&(t.text||``).trim().length>0||t.type===`thinking`&&ute(t).length>0||t.type===`tool_use`)return!0;return!1}function N9(e,t){return e&&e.role===`assistant`?{...e,content:[...e.content]}:{role:`assistant`,content:[],timestamp:t}}function P9(e){return{...e,content:e.content.map(e=>({...e})),attachments:e.attachments?e.attachments.map(e=>({...e})):void 0}}function F9(e,t){if(!t)return e;if(!e)return t;if(e.endsWith(t))return e;let n=Math.min(e.length,t.length,512);for(let r=n;r>0;r--)if(e.slice(-r)===t.slice(0,r))return e+t.slice(r);return e+t}function I9(e){let t=e[e.length-1];t?.type===`thinking`&&t.streaming&&(t.streaming=!1)}function L9(e){let t=e[e.length-1];t?.type===`thinking`&&t.streaming||e.push({type:`thinking`,text:``,streaming:!0})}function R9(e,t,n){let r=e[e.length-1];if(r?.type===`thinking`){n?r.text=F9(r.text||``,t):r.text=t,r.streaming=!0;return}e.push({type:`thinking`,text:t,streaming:!0})}function z9(e){I9(e);for(let t of e)t.type===`thinking`&&typeof t.text==`string`&&(t.text=t.text.trim())}function fte(e){for(let t of e)t.type===`tool_use`&&t.status===`running`&&(t.status=`done`)}function pte(e,t){return e.trim().toLowerCase()===t.trim().toLowerCase()}function B9(e,t){I9(e);let n=e[e.length-1];if(n?.type===`text`){n.text=F9(n.text||``,t);return}e.push({type:`text`,text:t})}function V9(e,t,n){I9(e);let r={type:`tool_use`,id:crypto.randomUUID(),name:t,input:n,status:`running`};e.push(r)}function H9(e,t,n,r){for(let i=e.length-1;i>=0;i--){let a=e[i];if(a.type===`tool_use`&&a.status===`running`&&pte(a.name,t)){a.status=n?`error`:`done`,a.result=r;return}}}var U9=1200;function mte(e){let t=[];for(let n of e)n.type===`text`&&n.text?.trim()&&t.push(n.text.trim());return t.join(`
143
- `).trim()}function hte(e){if(e.role!==`assistant`)return[];let t=mte(e.content);if(!t)return[];let n=t.length>U9?`${t.slice(0,U9)}…`:t,r=n.toLowerCase(),i=[];/\b(function|class|const |def |import |export |async |await |interface |type )\b/.test(r)||/```/.test(n)?(i.push(`code_error_handling`),i.push(`code_explain`),i.push(`code_refactor`),i.push(`code_optimize`)):/\d{4}-\d{2}-\d{2}|january|february|march|april|may|june|july|august|september|october|november|december|q[1-4]|quarter/i.test(n)?(i.push(`date_shorter_summary`),i.push(`date_main_risks`)):/^[-*•]|\n[-*•]/.test(n.trim())?(i.push(`generic_simpler_terms`),i.push(`generic_create_table`),i.push(`generic_bullet_points`)):/\|.*\|.*\|/.test(n)?(i.push(`generic_simpler_terms`),i.push(`generic_bullet_points`)):(i.push(`generic_simpler_terms`),i.push(`generic_concrete_example`),i.push(`generic_bullet_points`)),i.push(`what_next`);let a=new Set,o=[];for(let e of i)if(!a.has(e)&&(a.add(e),o.push(e),o.length>=4))break;return o.slice(0,4)}function gte(e){let{sessionKey:t,decodedKey:n,sessionKeyRef:r,sendingRef:i,streamingRef:a,setSending:o,setStreaming:s,setProgress:c,modelSupportsThinking:l,thinkingLevel:u,shouldApplyStreamUpdate:d,setError:f,sendMessageRef:p}=e,[m,h]=(0,z.useState)(null),[g,_]=(0,z.useState)(!1),v=(0,z.useRef)(null),[y,b]=(0,z.useState)([]),x=(0,z.useRef)([]),[S,C]=(0,z.useState)(null),[w,T]=(0,z.useState)(null),E=(0,z.useRef)(null),[D,O]=(0,z.useState)([]);(0,z.useEffect)(()=>{v.current=m},[m]),(0,z.useEffect)(()=>{x.current=[],b([]),O([]),T(null)},[t]),(0,z.useEffect)(()=>{x.current=y},[y]),(0,z.useEffect)(()=>{E.current=w},[w]),(0,z.useEffect)(()=>{n&&n!==r.current&&h(null)},[n,r]);let k=(0,z.useCallback)(()=>{h(null)},[]),A=(0,z.useCallback)(()=>{x.current=[],b([]),T(null)},[]),j=(0,z.useCallback)(()=>{x.current=[],b([]),h(null),T(null)},[]),M=(0,z.useCallback)(()=>{O([])},[]),N=(0,z.useCallback)(e=>{O(hte(e))},[]),P=(0,z.useCallback)(()=>{h(null)},[]),F=(0,z.useCallback)(e=>t=>{d(e)&&(i.current=!1,a.current=!1,o(!1),s(!1),c(null),h(t))},[d,i,a,o,s,c]),I=(0,z.useCallback)(()=>{let e=x.current;for(;e.length>0&&!e[0].text.trim()&&!e[0].attachments?.length;)e=e.slice(1);if(e.length===0){x.current=[],b([]);return}let[t,...n]=e;E.current===t.id&&T(null),x.current=n,b(n),p.current(t.text,t.attachments,t.thinkingLevel)},[p]),L=(0,z.useCallback)((e,t)=>{let n=e.trim();if(!n&&!t?.length||x.current.length>=10)return;let r=l?u:`off`,i={id:crypto.randomUUID(),text:n||e,attachments:t?.length?t:void 0,thinkingLevel:r};b(e=>{let t=[...e,i];return x.current=t,t})},[l,u]);return{clarifyPrompt:m,clarifySubmitting:g,clarifyPromptRef:v,pendingFollowUps:y,pendingFollowUpsRef:x,followUpSuggestions:D,steeringFollowUpId:S,editingFollowUpId:w,addPendingFollowUp:L,beginEditFollowUp:(0,z.useCallback)(e=>{T(e)},[]),cancelEditFollowUp:(0,z.useCallback)(()=>{T(null)},[]),commitEditFollowUp:(0,z.useCallback)((e,t,n,r)=>{let i=t.trim(),a=x.current,o=a.findIndex(t=>t.id===e);if(o<0){T(null);return}if(!i&&!n?.length){let t=a.filter(t=>t.id!==e);x.current=t,b(t),T(null);return}let s=[...a],c=l?r??u:`off`;s[o]={...s[o],text:i||t,attachments:n?.length?n:void 0,thinkingLevel:c},x.current=s,b(s),T(null)},[l,u]),removePendingFollowUp:(0,z.useCallback)(e=>{E.current===e&&T(null),b(t=>{let n=t.filter(t=>t.id!==e);return x.current=n,n})},[]),movePendingFollowUp:(0,z.useCallback)((e,t)=>{b(n=>{let r=n.findIndex(t=>t.id===e);if(r<0)return n;let i=t===`up`?r-1:r+1;if(i<0||i>=n.length)return n;let a=[...n];return[a[r],a[i]]=[a[i],a[r]],x.current=a,a})},[]),reorderPendingFollowUp:(0,z.useCallback)((e,t)=>{b(n=>{if(e<0||e>=n.length||t<0||t>=n.length)return n;let r=[...n],[i]=r.splice(e,1);return r.splice(t,0,i),x.current=r,r})},[]),steerPendingFollowUp:(0,z.useCallback)(async e=>{let t=r.current;if(!t)return;let n=x.current.find(t=>t.id===e);if(!(!n?.text.trim()||n.attachments?.length)){C(e);try{(await rW(Q(`/api/agent/steer`),{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({chatId:t,message:n.text.trim()})})).ok&&(b(t=>{let n=t.filter(t=>t.id!==e);return x.current=n,n}),E.current===e&&T(null))}catch{}finally{C(null)}}},[r]),pickFollowUpSuggestion:(0,z.useCallback)(e=>{let t=e.trim();if(t){if(O([]),i.current||a.current){if(x.current.length>=10){console.warn(`Follow-up queue is full (max 10). Remove one or wait for the run to finish.`);return}L(t,void 0);return}p.current(t,void 0,void 0)}},[L,p,i,a]),submitClarifyAnswer:(0,z.useCallback)(async e=>{let t=v.current;if(t){_(!0);try{let n=await rW(Q(`/api/clarify/${encodeURIComponent(t.requestId)}`),{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({answer:e})});n.ok||f((await n.json().catch(()=>({}))).error?.message??n.statusText??`Clarify failed`),h(null)}finally{_(!1)}}},[f]),dismissClarify:k,clearPendingFollowUps:A,dismissClarifyAndClearPending:j,refreshFollowUpSuggestions:N,clearFollowUpSuggestions:M,onClarifyToolEnd:P,makeOnClarifyRequest:F,flushSteeringQueue:I}}var W9=`medium`,_te=`off`,G9=`xopc.webchat.agentId`;function K9(){if(globalThis.localStorage===void 0)return null;try{return globalThis.localStorage.getItem(G9)?.trim().toLowerCase()||null}catch{return null}}function q9(e,t){if(t)return e.find(e=>kY(e.key)&&(e.messageCount??0)===0&&M9(e.key)===t)}function vte(){let e=Ui(),t=Bi(),{sessionKey:n}=qi(),r=BB(e=>e.token),{data:i,mutate:a}=u(r?[`gateway-chat-agents`,r]:null,j9,{revalidateOnFocus:!1});(0,z.useEffect)(()=>{let e=()=>void a();return window.addEventListener(`config-reload`,e),()=>window.removeEventListener(`config-reload`,e)},[a]);let[o,s]=(0,z.useState)(()=>K9()),c=(0,z.useRef)(i??null),l=(0,z.useRef)(K9());(0,z.useEffect)(()=>{c.current=i??null},[i]),(0,z.useEffect)(()=>{l.current=o},[o]),(0,z.useEffect)(()=>{if(!i)return;let e=new Set(i.items.map(e=>e.id));s(t=>t==null||t===``||!e.has(t)?i.defaultId:t)},[i]);let d=(0,z.useCallback)(()=>{let e=c.current,t=(l.current??``).trim().toLowerCase();if(!e)return t||void 0;let n=new Set(e.items.map(e=>e.id));return t&&n.has(t)?t:e.defaultId},[]),f=(0,z.useCallback)(t=>{let n=t.trim().toLowerCase();s(n);try{globalThis.localStorage?.setItem(G9,n)}catch{}let r=y.current;(r?M9(r):null)!==n&&e(`/chat/new`,{replace:!1})},[e]),p=(0,z.useRef)(new jY),m=(0,z.useRef)(new lte),h=(0,z.useRef)(!1),g=(0,z.useRef)(0),_=(0,z.useRef)(!1),v=(0,z.useRef)(!1),y=(0,z.useRef)(null),b=(0,z.useRef)(null),x=(0,z.useRef)(null),S=(0,z.useRef)(null),C=(0,z.useRef)(null),w=(0,z.useRef)(0),T=(0,z.useRef)(!1),E=(0,z.useRef)(async()=>{}),[D,O]=(0,z.useState)([]),[k,A]=(0,z.useState)(null),[j,M]=(0,z.useState)(!1),[N,P]=(0,z.useState)(!1),[F,I]=(0,z.useState)(null),[L,R]=(0,z.useState)(null),[B,V]=(0,z.useState)(null),[H,ee]=(0,z.useState)(null),[te,U]=(0,z.useState)(!0),[ne,re]=(0,z.useState)(``),[W,ie]=(0,z.useState)(W9),[ae,oe]=(0,z.useState)(_te),[se,ce]=(0,z.useState)(!1),[le,ue]=(0,z.useState)(!1),[de,fe]=(0,z.useState)(!1),pe=(0,z.useRef)(0);(0,z.useEffect)(()=>{v.current=j},[j]),(0,z.useEffect)(()=>{y.current=B},[B]),(0,z.useEffect)(()=>{C.current=H},[H]),(0,z.useEffect)(()=>{pe.current=D.length},[D.length]),(0,z.useEffect)(()=>{if(!B)return;let e=M9(B);if(e){s(t=>e===t?t:e);try{globalThis.localStorage?.setItem(G9,e)}catch{}}},[B]);let me=t.pathname.endsWith(`/new`),he=n?decodeURIComponent(n):void 0;(0,z.useLayoutEffect)(()=>{if(!me)return;let e=t.state,n=typeof e?.agentId==`string`?e.agentId.trim().toLowerCase():``;if(n){l.current=n,s(n);try{globalThis.localStorage?.setItem(G9,n)}catch{}}},[me,t.state]),b.current=he??null;let G=he!==void 0&&B!==he,ge=(0,z.useMemo)(()=>te&&(B==null||he===void 0),[te,B,he]),_e=(0,z.useCallback)((t,n=!0)=>{e(`/chat/${encodeURIComponent(t)}`,{replace:n})},[e]),ve=(0,z.useCallback)(async e=>{let t=++w.current;if(!e.trim()){t===w.current&&ce(!1);return}let n=await cte(e);t===w.current&&ce(n)},[]),ye=(0,z.useCallback)(async()=>{let e=y.current;if(e)for(let t=0;t<8;t++){if(await new Promise(e=>setTimeout(e,t===0?500:700)),y.current!==e||C.current?.trim())return;try{let t=await p.current.fetchSessionName(e);if(t){ee(t);return}}catch{}}},[]),be=(0,z.useCallback)(e=>{let t=b.current;return t?t===e:y.current===e},[]),K=gte({sessionKey:B,decodedKey:he,sessionKeyRef:y,sendingRef:_,streamingRef:v,setSending:P,setStreaming:M,setProgress:I,modelSupportsThinking:se,thinkingLevel:W,shouldApplyStreamUpdate:be,setError:R,sendMessageRef:E}),xe=(0,z.useCallback)(e=>{let t=null;(0,Ho.flushSync)(()=>{A(e=>{if(!e)return null;let n=N9(e,Date.now());return z9(n.content),fte(n.content),t=P9(n),null})});let n=t;n&&dte(n)&&(O(e=>JJ([...e,n])),K.refreshFollowUpSuggestions(n)),M(!1),I(null),P(!1),_.current=!1,v.current=!1,x.current=null,S.current=null,K.dismissClarify(),ye(),e?.skipSteeringQueueFlush||queueMicrotask(()=>{K.flushSteeringQueue()})},[ye,K.dismissClarify,K.refreshFollowUpSuggestions,K.flushSteeringQueue]),Se=(0,z.useCallback)((e,t)=>{y.current===e&&(O(t.messages),ue(t.hasMore),t.name&&ee(t.name))},[]),Ce=(0,z.useCallback)(async(e,t=0)=>{if(!(t===0&&e===y.current&&(_.current||v.current)&&x.current===e)&&(t===0&&K.dismissClarify(),!h.current)){h.current=!0;try{let{messages:n,hasMore:r,name:i}=await p.current.loadSession(e,t);if(t===0){V(e),ee(i??null),O(n),ue(r),R(null);try{let t=await p.current.loadSessionAgentConfig(e);re(t.model),ie(t.thinkingLevel||W9),oe(k9(t.reasoningLevel)),ve(t.model)}catch{}}else O(e=>{let t=new Set(e.map(e=>e.timestamp));return JJ([...n.filter(e=>!t.has(e.timestamp)),...e])}),ue(r)}catch{if(t===0){R(`Failed to load session`);let e=await p.current.loadSessions().catch(()=>[]),t=e.filter(e=>(e.messageCount??0)>0)[0]??e[0];if(t)_e(t.key),await Ce(t.key,0);else try{let e=d(),t=await p.current.createSession(e?{agentId:e}:void 0);_e(t.key),V(t.key),O([]),ue(!1);try{let e=await p.current.loadSessionAgentConfig(t.key);re(e.model),ie(e.thinkingLevel||W9),oe(k9(e.reasoningLevel)),ve(e.model)}catch{}}catch{R(`Could not open a session`)}}}finally{h.current=!1}}},[_e,ve,d,K.dismissClarify]),we=(0,z.useCallback)(async()=>{let e=y.current;if(!(!e||de||!le||h.current)){fe(!0);try{await Ce(e,pe.current)}finally{fe(!1)}}},[le,Ce,de]),Te=(0,z.useCallback)(async e=>{if(B)try{R(null),await p.current.patchSessionAgentConfig(B,{model:e}),re(e),ve(e)}catch(e){R(e instanceof Error?e.message:`Failed to switch model`)}},[B,ve]),Ee=(0,z.useCallback)(async()=>{K.dismissClarify();try{let e=await p.current.loadSessions(),t=d(),n=q9(e,t);if(n){V(n.key),ee(n.name??null),O([]),ue(!1),_e(n.key);try{let e=await p.current.loadSessionAgentConfig(n.key);re(e.model),ie(e.thinkingLevel||W9),oe(k9(e.reasoningLevel)),ve(e.model)}catch{}return}let r=await p.current.createSession(t?{agentId:t}:void 0);V(r.key),ee(r.name??null),O([]),ue(!1),_e(r.key);try{let e=await p.current.loadSessionAgentConfig(r.key);re(e.model),ie(e.thinkingLevel||W9),oe(k9(e.reasoningLevel)),ve(e.model)}catch{}}catch(e){console.error(`[chat] createNewSession failed:`,e)}},[_e,ve,d,K.dismissClarify]),De=(0,z.useCallback)(async e=>{let t=m.current;if(t.isSending)return;let n=null;try{let t=sessionStorage.getItem(A9(e));t&&(n=JSON.parse(t))}catch{}if(!n?.runId||S.current===n.runId)return;T.current=!1,S.current=n.runId,x.current=e,_.current=!0,v.current=!0,P(!0),M(!0),I(null);let r=!1,i=()=>{if(r)return;r=!0;let e=null;(0,Ho.flushSync)(()=>{O(t=>{if(t.length===0)return t;let n=t[t.length-1];return n?.role===`assistant`?(e=P9(n),t.slice(0,-1)):t}),e&&A(t=>t??e)})};try{await t.resume(n.runId,e,{onStreamStart:()=>{be(e)&&(i(),A(e=>P9(N9(e,Date.now()))))},onToken:t=>{be(e)&&(i(),A(e=>{let n=N9(e,Date.now());return B9(n.content,t),P9(n)}),M(!0))},onThinking:(t,n)=>{be(e)&&(i(),A(e=>{let r=N9(e,Date.now());return!n&&t===``?L9(r.content):R9(r.content,t,n),P9(r)}))},onThinkingEnd:()=>{be(e)&&(i(),A(e=>{if(!e)return e;let t=N9(e,Date.now());return z9(t.content),P9(t)}))},onToolStart:(t,n)=>{be(e)&&(i(),A(e=>{let r=N9(e,Date.now());return V9(r.content,t,n),P9(r)}),M(!0))},onToolEnd:(t,n,r)=>{be(e)&&(t===`clarify`&&K.onClarifyToolEnd(),i(),A(e=>{let i=N9(e,Date.now());return H9(i.content,t,n,r),P9(i)}))},onProgress:t=>{be(e)&&I(t)},onTtsAudio:t=>{be(e)&&A(e=>{let n=N9(e,Date.now()),r=t.workspaceRelativePath?.replace(/\\/g,`/`).trim(),i=n.attachments??[];if(r&&i.some(e=>e.workspaceRelativePath?.replace(/\\/g,`/`).trim()===r))return P9(n);let a={name:t.name,mimeType:t.mimeType,type:`voice`,workspaceRelativePath:t.workspaceRelativePath,size:0};return n.attachments=[...i,a],P9(n)})},onClarifyRequest:K.makeOnClarifyRequest(e),onResult:()=>{if(!be(e)){x.current=null,S.current=null,_.current=!1,v.current=!1,M(!1),P(!1),I(null),K.dismissClarify(),p.current.loadSession(e,0).then(t=>Se(e,t)).catch(()=>{});return}if(T.current){T.current=!1;return}xe()},onError:t=>{if(!be(e)){x.current=null,S.current=null,_.current=!1,v.current=!1,M(!1),P(!1),I(null),K.dismissClarify(),p.current.loadSession(e,0).then(t=>Se(e,t)).catch(()=>{});return}S.current=null,_.current=!1,v.current=!1,R(t),A(null),M(!1),P(!1),I(null),K.dismissClarify()}})}catch(t){t.name!==`AbortError`&&console.error(`[chat] resume failed:`,t),S.current=null,_.current=!1,v.current=!1,M(!1),P(!1),A(null),I(null),x.current===e&&(x.current=null)}},[Se,xe,be,K.dismissClarify,K.makeOnClarifyRequest,K.onClarifyToolEnd]),Oe=(0,z.useCallback)(async(e,t,n)=>{if(!e.trim()&&!t?.length||!_.current&&!v.current&&!m.current.isSending)return;if(e.trim()===`/new`&&!t?.length){await Ee();return}if(!y.current)return;K.dismissClarifyAndClearPending();let r=se?n??W:`off`;T.current=!0,S.current=null,x.current=null,m.current.abort(),_.current=!1,v.current=!1,xe({skipSteeringQueueFlush:!0}),I(null),queueMicrotask(()=>{E.current(e,t,r)})},[Ee,xe,se,W,K.dismissClarifyAndClearPending]),ke=(0,z.useCallback)(async(e,t,n)=>{if(!B||!e.trim()&&!t?.length||x.current===B&&(_.current||v.current))return;if(e.trim()===`/new`&&!t?.length){await Ee();return}let r=se?n??W:`off`,i=m.current,a=B;T.current=!1,K.clearFollowUpSuggestions(),x.current=a,_.current=!0,P(!0),R(null),K.dismissClarify(),O(n=>[...n,{role:`user`,content:e?[{type:`text`,text:e}]:[],attachments:t,timestamp:Date.now()}]);try{await i.send(e,a,t,r,{onStreamStart:()=>{be(a)&&(M(!0),A(e=>P9(N9(e,Date.now()))))},onToken:e=>{be(a)&&(A(t=>{let n=N9(t,Date.now());return B9(n.content,e),P9(n)}),M(!0))},onThinking:(e,t)=>{be(a)&&A(n=>{let r=N9(n,Date.now());return!t&&e===``?L9(r.content):R9(r.content,e,t),P9(r)})},onThinkingEnd:()=>{be(a)&&A(e=>{if(!e)return e;let t=N9(e,Date.now());return z9(t.content),P9(t)})},onToolStart:(e,t)=>{be(a)&&(A(n=>{let r=N9(n,Date.now());return V9(r.content,e,t),P9(r)}),M(!0))},onToolEnd:(e,t,n)=>{be(a)&&(e===`clarify`&&K.onClarifyToolEnd(),A(r=>{let i=N9(r,Date.now());return H9(i.content,e,t,n),P9(i)}))},onProgress:e=>{be(a)&&I(e)},onTtsAudio:e=>{be(a)&&A(t=>{let n=N9(t,Date.now()),r=e.workspaceRelativePath?.replace(/\\/g,`/`).trim(),i=n.attachments??[];if(r&&i.some(e=>e.workspaceRelativePath?.replace(/\\/g,`/`).trim()===r))return P9(n);let a={name:e.name,mimeType:e.mimeType,type:`voice`,workspaceRelativePath:e.workspaceRelativePath,size:0};return n.attachments=[...i,a],P9(n)})},onClarifyRequest:K.makeOnClarifyRequest(a),onResult:()=>{if(!be(a)){x.current=null,_.current=!1,v.current=!1,M(!1),P(!1),I(null),K.dismissClarify(),p.current.loadSession(a,0).then(e=>Se(a,e)).catch(()=>{});return}if(T.current){T.current=!1;return}xe()},onError:e=>{if(!be(a)){x.current=null,_.current=!1,v.current=!1,M(!1),P(!1),I(null),K.dismissClarify(),p.current.loadSession(a,0).then(e=>Se(a,e)).catch(()=>{});return}_.current=!1,v.current=!1,R(e),A(null),M(!1),P(!1),I(null),K.dismissClarify()}})}catch(e){e.name!==`AbortError`&&(R(e instanceof Error?e.message:`Send failed`),A(null),M(!1))}finally{_.current=!1,v.current=!1,P(!1),x.current===a&&(x.current=null)}},[B,W,se,Se,xe,be,Ee,K.clearFollowUpSuggestions,K.dismissClarify,K.makeOnClarifyRequest,K.onClarifyToolEnd]),Ae=(0,z.useCallback)(()=>{T.current=!0,S.current=null,x.current=null,K.dismissClarifyAndClearPending(),m.current.abort(),_.current=!1,v.current=!1,xe({skipSteeringQueueFlush:!0}),I(null);let e=y.current;e&&window.setTimeout(()=>{Ce(e,0)},300)},[xe,Ce,K.dismissClarifyAndClearPending]);(0,z.useEffect)(()=>{let e=x.current;he&&(!e||he===e||(A(null),I(null),M(!1),P(!1)))},[he]),(0,z.useEffect)(()=>{he&&De(he)},[he,De]);let je=(0,z.useMemo)(()=>k?[...D,k]:D,[D,k]);(0,z.useEffect)(()=>{let e=e=>{let t=e.detail;!t?.key||t.name===void 0||t.key===B&&ee(t.name||null)};return window.addEventListener(`session-updated`,e),()=>window.removeEventListener(`session-updated`,e)},[B]),(0,z.useEffect)(()=>{let e=()=>{let e=y.current;e&&p.current.loadSessionAgentConfig(e).then(e=>{re(e.model),ie(e.thinkingLevel||W9),oe(k9(e.reasoningLevel)),ve(e.model)}).catch(()=>{})};return window.addEventListener(`config-reload`,e),()=>window.removeEventListener(`config-reload`,e)},[ve]),(0,z.useEffect)(()=>{if(!r){U(!1);return}let e=++g.current,t=!1;return(async()=>{(me||he===void 0)&&U(!0),R(null);try{if(me){let n=await p.current.loadSessions();if(t||e!==g.current)return;let r=d(),i=q9(n,r);if(i){V(i.key),ee(i.name??null),O([]),ue(!1),_e(i.key);try{let e=await p.current.loadSessionAgentConfig(i.key);re(e.model),ie(e.thinkingLevel||W9),oe(k9(e.reasoningLevel)),ve(e.model)}catch{}}else{let n=await p.current.createSession(r?{agentId:r}:void 0);if(t||e!==g.current)return;V(n.key),ee(n.name??null),O([]),ue(!1),_e(n.key);try{let e=await p.current.loadSessionAgentConfig(n.key);re(e.model),ie(e.thinkingLevel||W9),oe(k9(e.reasoningLevel)),ve(e.model)}catch{}}}else if(he)await Ce(he,0),!t&&e===g.current&&await De(he);else{let n=await p.current.loadSessions();if(t||e!==g.current)return;let r=n.filter(e=>(e.messageCount??0)>0)[0]??n[0];if(r){if(await Ce(r.key,0),t||e!==g.current)return;p.current.parseSessionFromHash()||_e(r.key),await De(r.key)}else{let n=d(),r=await p.current.createSession(n?{agentId:n}:void 0);if(t||e!==g.current)return;V(r.key),ee(r.name??null),O([]),ue(!1),_e(r.key);try{let e=await p.current.loadSessionAgentConfig(r.key);re(e.model),ie(e.thinkingLevel||W9),oe(k9(e.reasoningLevel)),ve(e.model)}catch{}}}}catch(e){t||R(e instanceof Error?e.message:`Chat init failed`)}finally{!t&&e===g.current&&U(!1)}})(),()=>{t=!0}},[r,me,he,_e,Ce,De,ve,d]);let Me=B&&M9(B)||o||i?.defaultId||`main`,Ne=(i?.items.length??0)>1;return E.current=ke,{messages:je,sessionKey:B,sessionName:H,decodedKey:he,sessionRoutePending:G,showSessionLoading:ge,sessionModel:ne,thinkingLevel:W,setThinkingLevel:ie,reasoningLevel:ae,modelSupportsThinking:se,hasMore:le,loadingMore:de,loadMoreMessages:we,onSessionModelChange:Te,createNewSession:Ee,loading:te,error:L,streaming:j,sending:N,progress:F,sendMessage:ke,addPendingFollowUp:K.addPendingFollowUp,pendingFollowUps:K.pendingFollowUps,editingFollowUpId:K.editingFollowUpId,beginEditFollowUp:K.beginEditFollowUp,cancelEditFollowUp:K.cancelEditFollowUp,commitEditFollowUp:K.commitEditFollowUp,removePendingFollowUp:K.removePendingFollowUp,movePendingFollowUp:K.movePendingFollowUp,reorderPendingFollowUp:K.reorderPendingFollowUp,steerPendingFollowUp:K.steerPendingFollowUp,steeringFollowUpId:K.steeringFollowUpId,interruptAndSend:Oe,abort:Ae,followUpSuggestions:K.followUpSuggestions,pickFollowUpSuggestion:K.pickFollowUpSuggestion,clarifyPrompt:K.clarifyPrompt,clarifySubmitting:K.clarifySubmitting,submitClarifyAnswer:K.submitClarifyAnswer,hasToken:!!r,chatAgents:i,displayAgentId:Me,showChatAgentSelector:Ne,onChatAgentChange:f,sessionManager:p.current}}function yte({prompt:e,submitting:t,onSubmit:n}){let[r,i]=(0,z.useState)(``),a=(0,z.useCallback)(e=>{n(e)},[n]);if(!e)return null;let o=Array.isArray(e.choices)&&e.choices.length>=2;return(0,Z.jsxs)(`div`,{role:`region`,"aria-label":`Clarification`,className:`mb-4 rounded-lg border border-edge bg-surface-elevated px-4 py-3 text-sm text-fg shadow-sm`,children:[(0,Z.jsx)(t4,{content:e.question,compact:!0,className:`mb-3`}),o?(0,Z.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[e.choices.map(e=>(0,Z.jsx)(`button`,{type:`button`,disabled:t,className:`rounded-md border border-edge bg-surface-panel px-3 py-1.5 text-left text-fg transition hover:bg-surface-muted disabled:opacity-50`,onClick:()=>a(e),children:e},e)),e.default?(0,Z.jsxs)(`button`,{type:`button`,disabled:t,className:`rounded-md border border-dashed border-edge px-3 py-1.5 text-fg-muted hover:bg-surface-muted disabled:opacity-50`,onClick:()=>a(e.default),children:[`Default: `,e.default]}):null]}):(0,Z.jsxs)(`form`,{className:`flex flex-col gap-2 sm:flex-row sm:items-end`,onSubmit:e=>{e.preventDefault();let t=r.trim();t&&(n(t),i(``))},children:[(0,Z.jsx)(`input`,{type:`text`,value:r,onChange:e=>i(e.target.value),disabled:t,placeholder:`Your answer…`,className:`min-w-0 flex-1 rounded-md border border-edge bg-surface-panel px-3 py-2 text-fg placeholder:text-fg-muted focus:border-accent focus:outline-none focus:ring-1 focus:ring-accent disabled:opacity-50`}),(0,Z.jsx)(`button`,{type:`submit`,disabled:t||!r.trim(),className:`shrink-0 rounded-md bg-accent px-4 py-2 font-medium text-white hover:opacity-90 disabled:opacity-40`,children:`Send`}),e.default?(0,Z.jsx)(`button`,{type:`button`,disabled:t,className:`shrink-0 rounded-md border border-edge px-3 py-2 text-fg-muted hover:bg-surface-muted disabled:opacity-50`,onClick:()=>a(e.default),children:`Use default`}):null]})]})}function J9(){let e=Jz(lB(e=>e.language)),t=BB(e=>e.token),n=(0,z.useRef)(null),r=(0,z.useRef)(0),[i,a]=(0,z.useState)(null),[o,s]=(0,z.useState)(!0),c=(0,z.useRef)(!0),l=(0,z.useRef)(0),u=(0,z.useRef)(0),d=(0,z.useRef)(!0),f=(0,z.useRef)({first:void 0,len:0,scrollHeight:0});(0,z.useEffect)(()=>{c.current=o},[o]);let{messages:p,sessionKey:m,sessionName:h,decodedKey:g,sessionRoutePending:_,showSessionLoading:v,sessionModel:y,thinkingLevel:b,setThinkingLevel:x,reasoningLevel:S,modelSupportsThinking:C,hasMore:w,loadingMore:T,loadMoreMessages:E,onSessionModelChange:D,error:O,streaming:k,sending:A,progress:j,sendMessage:M,addPendingFollowUp:N,pendingFollowUps:P,editingFollowUpId:F,beginEditFollowUp:I,cancelEditFollowUp:L,commitEditFollowUp:R,removePendingFollowUp:B,movePendingFollowUp:V,reorderPendingFollowUp:H,steerPendingFollowUp:ee,steeringFollowUpId:te,interruptAndSend:U,abort:ne,followUpSuggestions:re,pickFollowUpSuggestion:W,clarifyPrompt:ie,clarifySubmitting:ae,submitClarifyAnswer:oe,hasToken:se,chatAgents:ce,displayAgentId:le,showChatAgentSelector:ue,onChatAgentChange:de,sessionManager:fe}=vte();(0,z.useEffect)(()=>{a(null)},[m]);let pe=(0,z.useCallback)(e=>{r.current+=1,a({id:r.current,text:e})},[]),me=(0,z.useMemo)(()=>!!m&&!v&&!_&&p.length===0,[m,v,_,p.length]),he=p4(e=>e.setAgentId);(0,z.useEffect)(()=>{if(se)return he(le),()=>he(``)},[se,le,he]);let G=!v&&p.length===0&&!k,ge=(0,z.useMemo)(()=>(_&&g?g:m)?h?.trim()||e.chat.newSession:e.nav.chat,[m,h,_,g,e.nav.chat,e.chat.newSession]),_e=(0,z.useCallback)((e=!0)=>{let t=n.current;t&&requestAnimationFrame(()=>{t.scrollTo({top:t.scrollHeight,behavior:e?`smooth`:`auto`});let r=t.scrollHeight;requestAnimationFrame(()=>{n.current&&n.current.scrollHeight>r&&n.current.scrollTo({top:n.current.scrollHeight,behavior:e?`smooth`:`auto`})})})},[]),ve=(0,z.useCallback)(()=>{let e=n.current;if(!e)return;let{scrollTop:t,scrollHeight:r,clientHeight:i}=e,a=r-t-i;if(i<u.current){u.current=i;return}t!==0&&t<l.current&&a>50?s(!1):a<10&&s(!0),l.current=t,u.current=i,t<100&&!c.current&&w&&!T&&E()},[w,T,E]);return(0,z.useLayoutEffect)(()=>{if(!se)return;if(v){d.current=!0;return}if(d.current!==!0)return;d.current=!1,s(!0);let e=n.current;e&&(e.scrollTop=e.scrollHeight),requestAnimationFrame(()=>{_e(!1),requestAnimationFrame(()=>_e(!1))})},[v,se,_e]),(0,z.useEffect)(()=>{A&&(v||(s(!0),_e(!0)))},[A,v,_e]),(0,z.useEffect)(()=>{v||o&&_e(!1)},[p,o,_e,v]),(0,z.useLayoutEffect)(()=>{let e=n.current;if(!e||v)return;let t=f.current,r=p[0],i=p.length,a=e.scrollHeight;i>t.len&&t.len>0&&r!==void 0&&r!==t.first&&t.scrollHeight>0&&(e.scrollTop+=a-t.scrollHeight),f.current={first:r,len:i,scrollHeight:a}},[p,v]),se?(0,Z.jsxs)(`div`,{className:`flex h-full min-h-0 flex-1 flex-col bg-surface-panel`,children:[(0,Z.jsx)(K5,{}),(0,Z.jsx)(G5,{chatHeadline:ge,sessionModel:y,showModelSelector:!!(m&&!_),onModelChange:D,modelDisabled:v||_||k,chatAgents:ce?.items??[],showChatAgentSelector:ue,chatAgentId:le,onChatAgentChange:de,chatAgentDisabled:v||_||k}),(0,Z.jsx)(`div`,{className:`mx-auto flex min-h-0 w-full max-w-[var(--max-width-chat)] flex-1 flex-col`,children:(0,Z.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col px-3 sm:px-5 xl:px-6`,children:(0,Z.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,Z.jsx)(`div`,{ref:n,className:X(`chat-messages min-h-0 flex-1 overflow-y-auto overflow-x-hidden [scrollbar-gutter:stable]`,G?`pt-5 pb-2`:`py-4`),onScroll:ve,children:v?(0,Z.jsx)(`div`,{className:`flex min-h-[min(40vh,20rem)] flex-col items-center justify-center gap-3 py-12 text-center text-sm text-fg-muted`,children:e.chat.loading}):(0,Z.jsxs)(Z.Fragment,{children:[T?(0,Z.jsx)(`div`,{className:`mb-3 text-center text-xs text-fg-muted`,children:e.chat.loadOlder}):null,O?(0,Z.jsx)(`div`,{className:`mb-4 rounded-md border border-edge bg-red-50 px-3 py-2 text-sm text-red-700 dark:border-edge dark:bg-red-950/40 dark:text-red-300`,children:O}):null,(0,Z.jsx)(ote,{messages:p,authToken:t??void 0,sessionKey:m,streaming:k,progress:j,reasoningLevel:S,scrollElementRef:n,pinToBottom:o,onPickWelcomePrompt:pe})]})}),(0,Z.jsxs)(`div`,{className:X(`sticky bottom-0 z-10 shrink-0 bg-surface-panel`,G?`py-2.5`:`py-4`),children:[(0,Z.jsx)(yte,{prompt:ie,submitting:ae,onSubmit:oe}),(0,Z.jsx)(`div`,{className:`mx-auto w-full max-w-[var(--max-width-chat)] px-3 sm:px-5 xl:px-6`,children:(0,Z.jsx)(L5,{suggestions:re,disabled:v||_||!!ie,onPick:W})}),(0,Z.jsx)(F5,{disabled:v||_||!!ie,sending:A,streaming:k,sessionKey:m,sessionManager:fe,welcomeDraftSeed:i,canSelectWorkingDirectory:me,thinkingLevel:b,showThinkingSelector:C,onThinkingChange:x,onSend:M,onAbort:ne,onAddPendingFollowUp:(e,t)=>void N(e,t),onSteeringInterrupt:(e,t)=>void U(e,t),pendingFollowUps:P,editingFollowUpId:F,onBeginEditFollowUp:I,onCancelEditFollowUp:L,onCommitEditFollowUp:(e,t,n,r)=>void R(e,t,n,r),onPendingFollowUpRemove:B,onPendingFollowUpMove:V,onPendingFollowUpReorder:H,onPendingFollowUpSteer:e=>void ee(e),steeringFollowUpId:te})]})]})})}),(0,Z.jsx)(ste,{visible:!v&&!o,onClick:()=>_e(!0)})]}):(0,Z.jsx)(`div`,{className:`mx-auto w-full max-w-[var(--max-width-chat)] px-3 py-16 text-center text-sm leading-relaxed text-fg-muted sm:px-5`,children:e.chat.needToken})}function bte(){return(0,Z.jsx)(`div`,{className:`flex h-full min-h-0 flex-1 flex-col`,children:(0,Z.jsx)(Oa,{})})}async function xte(e){let t=await rW(e);if(!t.ok){let e=await t.json().catch(()=>({})),n=nW(t.status,t.statusText,e.error?.message);throw Error(n)}return t.json()}function Ste({children:e}){return(0,Z.jsx)(c,{value:{fetcher:xte,revalidateOnFocus:!1,dedupingInterval:2e3,shouldRetryOnError:!0,errorRetryCount:2},children:e})}var Cte=(0,z.lazy)(()=>f(()=>import(`./sessions-page-cn2fi_V3.js`).then(e=>({default:e.SessionsPage})),__vite__mapDeps([6,1,4]))),wte=(0,z.lazy)(()=>f(()=>import(`./cron-page-B_XY0gPt.js`).then(e=>({default:e.CronPage})),__vite__mapDeps([8,1,9,4,2]))),Tte=(0,z.lazy)(()=>f(()=>import(`./skills-page-irjxwW9u.js`).then(e=>({default:e.SkillsPage})),__vite__mapDeps([10,1,11,9,4]))),Ete=(0,z.lazy)(()=>f(()=>import(`./logs-page-LSa0jmLO.js`).then(e=>({default:e.LogsPage})),__vite__mapDeps([7,1,4]))),Dte=(0,z.lazy)(()=>f(()=>import(`./settings-page-CyHd5szQ.js`).then(e=>({default:e.SettingsPage})),__vite__mapDeps([0,1,2,3,4,5]))),Y9=(0,z.lazy)(()=>f(()=>import(`./agents-Dy5cGVVQ.js`).then(e=>({default:e.AgentsSettingsPanel})),__vite__mapDeps([5,1,2,3,4]))),Ote=(0,z.lazy)(()=>f(()=>import(`./channels-settings-CrCesccB.js`).then(e=>({default:e.ChannelsSettingsPanel})),__vite__mapDeps([15,1,9,4,3]))),kte=(0,z.lazy)(()=>f(()=>import(`./apps-page-BOpDR0Lz.js`).then(e=>({default:e.AppsPage})),__vite__mapDeps([16,1,3,4]))),X9=(0,z.lazy)(()=>f(()=>import(`./extension-page-COdbk9I6.js`).then(e=>({default:e.ExtensionPage})),__vite__mapDeps([17,1,4]))),Z9=(0,z.lazy)(()=>f(()=>import(`./extension-settings-page-BlEz2Ily.js`).then(e=>({default:e.ExtensionSettingsPage})),__vite__mapDeps([18,4,1]))),Ate=(0,z.lazy)(()=>f(()=>import(`./extension-debug-page-CPSk7gFW.js`).then(e=>({default:e.ExtensionDebugPage})),__vite__mapDeps([19,1,4])));function Q9(){return(0,Z.jsx)(`div`,{className:`flex min-h-[min(40vh,16rem)] flex-1 items-center justify-center text-sm text-fg-muted`,"aria-busy":!0,children:`Loading…`})}function jte(){let{agentId:e}=qi(),t=typeof e==`string`?e.trim():``;return(0,Z.jsx)(Da,{to:t?`/agents/${encodeURIComponent(t)}`:`/agents`,replace:!0})}function $9(){return(0,Z.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col`,"aria-busy":!0,children:(0,Z.jsxs)(`div`,{className:`mx-auto w-full max-w-app-main flex-1 px-4 py-8`,children:[(0,Z.jsx)(`div`,{className:`h-8 w-48 max-w-full animate-pulse rounded-md bg-surface-hover`}),(0,Z.jsx)(`div`,{className:`mt-6 h-36 animate-pulse rounded-xl bg-surface-hover`}),(0,Z.jsx)(`div`,{className:`mt-4 h-24 animate-pulse rounded-xl bg-surface-hover`}),(0,Z.jsx)(`p`,{className:`mt-6 text-sm text-fg-muted`,children:`Loading…`})]})})}var Mte=vo([{path:`/`,element:(0,Z.jsx)(z3,{}),children:[{index:!0,element:(0,Z.jsx)(Da,{to:`/chat`,replace:!0})},{path:`chat`,element:(0,Z.jsx)(bte,{}),children:[{index:!0,element:(0,Z.jsx)(J9,{})},{path:`new`,element:(0,Z.jsx)(J9,{})},{path:`:sessionKey`,element:(0,Z.jsx)(J9,{})}]},{path:`sessions`,element:(0,Z.jsx)(Da,{to:`/settings/sessions`,replace:!0})},{path:`logs`,element:(0,Z.jsx)(Da,{to:`/settings/logs`,replace:!0})},{path:`cron`,element:(0,Z.jsx)(z.Suspense,{fallback:(0,Z.jsx)(Q9,{}),children:(0,Z.jsx)(wte,{})})},{path:`skills`,element:(0,Z.jsx)(z.Suspense,{fallback:(0,Z.jsx)(Q9,{}),children:(0,Z.jsx)(Tte,{})})},{path:`channels`,element:(0,Z.jsx)(z.Suspense,{fallback:(0,Z.jsx)(Q9,{}),children:(0,Z.jsx)(Ote,{})})},{path:`agents`,element:(0,Z.jsx)(z.Suspense,{fallback:(0,Z.jsx)(Q9,{}),children:(0,Z.jsx)(Y9,{})})},{path:`agents/:agentId`,element:(0,Z.jsx)(z.Suspense,{fallback:(0,Z.jsx)(Q9,{}),children:(0,Z.jsx)(Y9,{})})},{path:`apps`,element:(0,Z.jsx)(z.Suspense,{fallback:(0,Z.jsx)(Q9,{}),children:(0,Z.jsx)(kte,{})})},{path:`apps/:extensionId`,element:(0,Z.jsx)(z.Suspense,{fallback:(0,Z.jsx)(Q9,{}),children:(0,Z.jsx)(X9,{})})},{path:`apps/:extensionId/:pageId`,element:(0,Z.jsx)(z.Suspense,{fallback:(0,Z.jsx)(Q9,{}),children:(0,Z.jsx)(X9,{})})},{path:`settings`,element:(0,Z.jsx)(X3,{}),children:[{index:!0,element:(0,Z.jsx)(Da,{to:`appearance`,replace:!0})},{path:`sessions`,element:(0,Z.jsx)(z.Suspense,{fallback:(0,Z.jsx)(Q9,{}),children:(0,Z.jsx)(Cte,{})})},{path:`logs`,element:(0,Z.jsx)(z.Suspense,{fallback:(0,Z.jsx)(Q9,{}),children:(0,Z.jsx)(Ete,{})})},{path:`cron`,element:(0,Z.jsx)(Da,{to:`/cron`,replace:!0})},{path:`skills`,element:(0,Z.jsx)(Da,{to:`/skills`,replace:!0})},{path:`channels`,element:(0,Z.jsx)(Da,{to:`/channels`,replace:!0})},{path:`agents`,element:(0,Z.jsx)(Da,{to:`/agents`,replace:!0})},{path:`agents/:agentId`,element:(0,Z.jsx)(jte,{})},{path:`extensions/debug`,element:(0,Z.jsx)(z.Suspense,{fallback:(0,Z.jsx)($9,{}),children:(0,Z.jsx)(Ate,{})})},{path:`ext/:extensionId`,element:(0,Z.jsx)(z.Suspense,{fallback:(0,Z.jsx)($9,{}),children:(0,Z.jsx)(Z9,{})})},{path:`ext/:extensionId/:panelId`,element:(0,Z.jsx)(z.Suspense,{fallback:(0,Z.jsx)($9,{}),children:(0,Z.jsx)(Z9,{})})},{path:`:section`,element:(0,Z.jsx)(z.Suspense,{fallback:(0,Z.jsx)($9,{}),children:(0,Z.jsx)(Dte,{})})}]}]}]);function Nte(){return(0,z.useEffect)(()=>{let e=OB.persist.onFinishHydration(()=>{kB()}),t=_B.persist.onFinishHydration(()=>{vB()}),n=AB();return()=>{e?.(),t?.(),n()}},[]),null}function Pte(){return(0,Z.jsx)(ht,{i18n:Ue,children:(0,Z.jsx)(Ste,{children:(0,Z.jsx)(qW,{children:(0,Z.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,Z.jsx)(Nte,{}),(0,Z.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col [&>*]:min-h-0 [&>*]:flex-1`,children:(0,Z.jsx)(Uo,{router:Mte})})]})})})})}document.documentElement.setAttribute(`lang`,vt(wt())),DB(),gB(),VB(),(0,B.createRoot)(document.getElementById(`root`)).render((0,Z.jsx)(z.StrictMode,{children:(0,Z.jsx)(Pte,{})}));export{RW as $,Xh as $n,YP as $t,EY as A,AS as An,MB as At,gJ as B,_y as Bn,Jz as Bt,iX as C,Rw as Cn,Bi as Cr,tV as Ct,xY as D,tC as Dn,mt as Dr,UB as Dt,OY as E,hC as En,jo as Er,GB as Et,NJ as F,eS as Fn,$z as Ft,Vq as G,p_ as Gn,NL as Gt,hJ as H,Qv as Hn,Mz as Ht,MJ as I,Gx as In,Xz as It,tG as J,r_ as Jn,HI as Jt,zq as K,o_ as Kn,jL as Kt,yJ as L,fx as Ln,Qz as Lt,DY as M,ES as Mn,lB as Mt,zJ as N,wS as Nn,tB as Nt,bY as O,KS as On,BB as Ot,PJ as P,xS as Pn,nB as Pt,$W as Q,sg as Qn,hF as Qt,vJ as R,db as Rn,Zz as Rt,aX as S,Gw as Sn,Da as Sr,lV as St,SY as T,TC as Tn,qi as Tr,XB as Tt,Bq as U,ov as Un,Nz as Ut,mJ as V,iy as Vn,Kz as Vt,Hq as W,iv as Wn,X as Wt,YW as X,qg as Xn,oI as Xt,QW as Y,Jg as Yn,yI as Yt,eG as Z,Gg as Zn,wF as Zt,V4 as _,WD as _n,Sc as _r,HV as _t,o6 as a,KA as an,hm as ar,iW as at,t4 as b,ME as bn,us as br,uV as bt,G3 as c,_A as cn,xp as cr,QU as ct,W4 as d,ek as dn,cp as dr,qU as dt,_P as en,Th as er,_W as et,q4 as f,gO as fn,$f as fr,ZU as ft,B4 as g,XD as gn,Lu as gr,WV as gt,U4 as h,$D as hn,nd as hr,YV as ht,d6 as i,xj as in,_m as ir,rW as it,TY as j,DS as jn,OB as jt,yY as k,LS as kn,RB as kt,H4 as l,mA as ln,fp as lr,YU as lt,K4 as m,eO as mn,ad as mr,aU as mt,$7 as n,UM as nn,Zm as nr,dW as nt,K3 as o,TA as on,Ip as or,$U as ot,z4 as p,uO as pn,dd as pr,mU as pt,Cq as q,a_ as qn,AL as qt,U5 as r,Lj as rn,Cm as rr,Q as rt,W3 as s,wA as sn,Ep as sr,XU as st,j9 as t,JN as tn,Sh as tr,gW as tt,G4 as u,nA as un,dp as ur,JU as ut,r4 as v,UD as vn,Xs as vr,kV as vt,wY as w,EC as wn,Ui as wr,QB as wt,vX as x,Xw as xn,Co as xr,cV as xt,$ as y,yD as yn,Js as yr,vV as yt,_J as z,Oy as zn,eB as zt};
144
- //# sourceMappingURL=index-tm9ZY35l.js.map
143
+ `).trim()}function hte(e){if(e.role!==`assistant`)return[];let t=mte(e.content);if(!t)return[];let n=t.length>U9?`${t.slice(0,U9)}…`:t,r=n.toLowerCase(),i=[];/\b(function|class|const |def |import |export |async |await |interface |type )\b/.test(r)||/```/.test(n)?(i.push(`code_error_handling`),i.push(`code_explain`),i.push(`code_refactor`),i.push(`code_optimize`)):/\d{4}-\d{2}-\d{2}|january|february|march|april|may|june|july|august|september|october|november|december|q[1-4]|quarter/i.test(n)?(i.push(`date_shorter_summary`),i.push(`date_main_risks`)):/^[-*•]|\n[-*•]/.test(n.trim())?(i.push(`generic_simpler_terms`),i.push(`generic_create_table`),i.push(`generic_bullet_points`)):/\|.*\|.*\|/.test(n)?(i.push(`generic_simpler_terms`),i.push(`generic_bullet_points`)):(i.push(`generic_simpler_terms`),i.push(`generic_concrete_example`),i.push(`generic_bullet_points`)),i.push(`what_next`);let a=new Set,o=[];for(let e of i)if(!a.has(e)&&(a.add(e),o.push(e),o.length>=4))break;return o.slice(0,4)}function gte(e){let{sessionKey:t,decodedKey:n,sessionKeyRef:r,sendingRef:i,streamingRef:a,setSending:o,setStreaming:s,setProgress:c,modelSupportsThinking:l,thinkingLevel:u,shouldApplyStreamUpdate:d,setError:f,sendMessageRef:p}=e,[m,h]=(0,z.useState)(null),[g,_]=(0,z.useState)(!1),v=(0,z.useRef)(null),[y,b]=(0,z.useState)([]),x=(0,z.useRef)([]),[S,C]=(0,z.useState)(null),[w,T]=(0,z.useState)(null),E=(0,z.useRef)(null),[D,O]=(0,z.useState)([]);(0,z.useEffect)(()=>{v.current=m},[m]),(0,z.useEffect)(()=>{x.current=[],b([]),O([]),T(null)},[t]),(0,z.useEffect)(()=>{x.current=y},[y]),(0,z.useEffect)(()=>{E.current=w},[w]),(0,z.useEffect)(()=>{n&&n!==r.current&&h(null)},[n,r]);let k=(0,z.useCallback)(()=>{h(null)},[]),A=(0,z.useCallback)(()=>{x.current=[],b([]),T(null)},[]),j=(0,z.useCallback)(()=>{x.current=[],b([]),h(null),T(null)},[]),M=(0,z.useCallback)(()=>{O([])},[]),N=(0,z.useCallback)(e=>{O(hte(e))},[]),P=(0,z.useCallback)(()=>{h(null)},[]),F=(0,z.useCallback)(e=>t=>{d(e)&&(i.current=!1,a.current=!1,o(!1),s(!1),c(null),h(t))},[d,i,a,o,s,c]),I=(0,z.useCallback)(()=>{let e=x.current;for(;e.length>0&&!e[0].text.trim()&&!e[0].attachments?.length;)e=e.slice(1);if(e.length===0){x.current=[],b([]);return}let[t,...n]=e;E.current===t.id&&T(null),x.current=n,b(n),p.current(t.text,t.attachments,t.thinkingLevel)},[p]),L=(0,z.useCallback)((e,t)=>{let n=e.trim();if(!n&&!t?.length||x.current.length>=10)return;let r=l?u:`off`,i={id:crypto.randomUUID(),text:n||e,attachments:t?.length?t:void 0,thinkingLevel:r};b(e=>{let t=[...e,i];return x.current=t,t})},[l,u]);return{clarifyPrompt:m,clarifySubmitting:g,clarifyPromptRef:v,pendingFollowUps:y,pendingFollowUpsRef:x,followUpSuggestions:D,steeringFollowUpId:S,editingFollowUpId:w,addPendingFollowUp:L,beginEditFollowUp:(0,z.useCallback)(e=>{T(e)},[]),cancelEditFollowUp:(0,z.useCallback)(()=>{T(null)},[]),commitEditFollowUp:(0,z.useCallback)((e,t,n,r)=>{let i=t.trim(),a=x.current,o=a.findIndex(t=>t.id===e);if(o<0){T(null);return}if(!i&&!n?.length){let t=a.filter(t=>t.id!==e);x.current=t,b(t),T(null);return}let s=[...a],c=l?r??u:`off`;s[o]={...s[o],text:i||t,attachments:n?.length?n:void 0,thinkingLevel:c},x.current=s,b(s),T(null)},[l,u]),removePendingFollowUp:(0,z.useCallback)(e=>{E.current===e&&T(null),b(t=>{let n=t.filter(t=>t.id!==e);return x.current=n,n})},[]),movePendingFollowUp:(0,z.useCallback)((e,t)=>{b(n=>{let r=n.findIndex(t=>t.id===e);if(r<0)return n;let i=t===`up`?r-1:r+1;if(i<0||i>=n.length)return n;let a=[...n];return[a[r],a[i]]=[a[i],a[r]],x.current=a,a})},[]),reorderPendingFollowUp:(0,z.useCallback)((e,t)=>{b(n=>{if(e<0||e>=n.length||t<0||t>=n.length)return n;let r=[...n],[i]=r.splice(e,1);return r.splice(t,0,i),x.current=r,r})},[]),steerPendingFollowUp:(0,z.useCallback)(async e=>{let t=r.current;if(!t)return;let n=x.current.find(t=>t.id===e);if(!(!n?.text.trim()||n.attachments?.length)){C(e);try{(await rW(Q(`/api/agent/steer`),{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({chatId:t,message:n.text.trim()})})).ok&&(b(t=>{let n=t.filter(t=>t.id!==e);return x.current=n,n}),E.current===e&&T(null))}catch{}finally{C(null)}}},[r]),pickFollowUpSuggestion:(0,z.useCallback)(e=>{let t=e.trim();if(t){if(O([]),i.current||a.current){if(x.current.length>=10){console.warn(`Follow-up queue is full (max 10). Remove one or wait for the run to finish.`);return}L(t,void 0);return}p.current(t,void 0,void 0)}},[L,p,i,a]),submitClarifyAnswer:(0,z.useCallback)(async e=>{let t=v.current;if(t){_(!0);try{let n=await rW(Q(`/api/clarify/${encodeURIComponent(t.requestId)}`),{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({answer:e})});n.ok||f((await n.json().catch(()=>({}))).error?.message??n.statusText??`Clarify failed`),h(null)}finally{_(!1)}}},[f]),dismissClarify:k,clearPendingFollowUps:A,dismissClarifyAndClearPending:j,refreshFollowUpSuggestions:N,clearFollowUpSuggestions:M,onClarifyToolEnd:P,makeOnClarifyRequest:F,flushSteeringQueue:I}}var W9=`medium`,_te=`off`,G9=`xopc.webchat.agentId`;function K9(){if(globalThis.localStorage===void 0)return null;try{return globalThis.localStorage.getItem(G9)?.trim().toLowerCase()||null}catch{return null}}function q9(e,t){if(t)return e.find(e=>kY(e.key)&&(e.messageCount??0)===0&&M9(e.key)===t)}function vte(){let e=Ui(),t=Bi(),{sessionKey:n}=qi(),r=BB(e=>e.token),{data:i,mutate:a}=u(r?[`gateway-chat-agents`,r]:null,j9,{revalidateOnFocus:!1});(0,z.useEffect)(()=>{let e=()=>void a();return window.addEventListener(`config-reload`,e),()=>window.removeEventListener(`config-reload`,e)},[a]);let[o,s]=(0,z.useState)(()=>K9()),c=(0,z.useRef)(i??null),l=(0,z.useRef)(K9());(0,z.useEffect)(()=>{c.current=i??null},[i]),(0,z.useEffect)(()=>{l.current=o},[o]),(0,z.useEffect)(()=>{if(!i)return;let e=new Set(i.items.map(e=>e.id));s(t=>t==null||t===``||!e.has(t)?i.defaultId:t)},[i]);let d=(0,z.useCallback)(()=>{let e=c.current,t=(l.current??``).trim().toLowerCase();if(!e)return t||void 0;let n=new Set(e.items.map(e=>e.id));return t&&n.has(t)?t:e.defaultId},[]),f=(0,z.useCallback)(t=>{let n=t.trim().toLowerCase();s(n);try{globalThis.localStorage?.setItem(G9,n)}catch{}let r=y.current;(r?M9(r):null)!==n&&e(`/chat/new`,{replace:!1})},[e]),p=(0,z.useRef)(new jY),m=(0,z.useRef)(new lte),h=(0,z.useRef)(!1),g=(0,z.useRef)(0),_=(0,z.useRef)(!1),v=(0,z.useRef)(!1),y=(0,z.useRef)(null),b=(0,z.useRef)(null),x=(0,z.useRef)(null),S=(0,z.useRef)(null),C=(0,z.useRef)(null),w=(0,z.useRef)(0),T=(0,z.useRef)(!1),E=(0,z.useRef)(async()=>{}),[D,O]=(0,z.useState)([]),[k,A]=(0,z.useState)(null),[j,M]=(0,z.useState)(!1),[N,P]=(0,z.useState)(!1),[F,I]=(0,z.useState)(null),[L,R]=(0,z.useState)(null),[B,V]=(0,z.useState)(null),[H,ee]=(0,z.useState)(null),[te,U]=(0,z.useState)(!0),[ne,re]=(0,z.useState)(``),[W,ie]=(0,z.useState)(W9),[ae,oe]=(0,z.useState)(_te),[se,ce]=(0,z.useState)(!1),[le,ue]=(0,z.useState)(!1),[de,fe]=(0,z.useState)(!1),pe=(0,z.useRef)(0);(0,z.useEffect)(()=>{v.current=j},[j]),(0,z.useEffect)(()=>{y.current=B},[B]),(0,z.useEffect)(()=>{C.current=H},[H]),(0,z.useEffect)(()=>{pe.current=D.length},[D.length]),(0,z.useEffect)(()=>{if(!B)return;let e=M9(B);if(e){s(t=>e===t?t:e);try{globalThis.localStorage?.setItem(G9,e)}catch{}}},[B]);let me=t.pathname.endsWith(`/new`),he=n?decodeURIComponent(n):void 0;(0,z.useLayoutEffect)(()=>{if(!me)return;let e=t.state,n=typeof e?.agentId==`string`?e.agentId.trim().toLowerCase():``;if(n){l.current=n,s(n);try{globalThis.localStorage?.setItem(G9,n)}catch{}}},[me,t.state]),b.current=he??null;let G=he!==void 0&&B!==he,ge=(0,z.useMemo)(()=>te&&(B==null||he===void 0),[te,B,he]),_e=(0,z.useCallback)((t,n=!0)=>{e(`/chat/${encodeURIComponent(t)}`,{replace:n})},[e]),ve=(0,z.useCallback)(async e=>{let t=++w.current;if(!e.trim()){t===w.current&&ce(!1);return}let n=await cte(e);t===w.current&&ce(n)},[]),ye=(0,z.useCallback)(async()=>{let e=y.current;if(e)for(let t=0;t<8;t++){if(await new Promise(e=>setTimeout(e,t===0?500:700)),y.current!==e||C.current?.trim())return;try{let t=await p.current.fetchSessionName(e);if(t){ee(t);return}}catch{}}},[]),be=(0,z.useCallback)(e=>{let t=b.current;return t?t===e:y.current===e},[]),K=gte({sessionKey:B,decodedKey:he,sessionKeyRef:y,sendingRef:_,streamingRef:v,setSending:P,setStreaming:M,setProgress:I,modelSupportsThinking:se,thinkingLevel:W,shouldApplyStreamUpdate:be,setError:R,sendMessageRef:E}),xe=(0,z.useCallback)(e=>{let t=null;(0,Ho.flushSync)(()=>{A(e=>{if(!e)return null;let n=N9(e,Date.now());return z9(n.content),fte(n.content),t=P9(n),null})});let n=t;n&&dte(n)&&(O(e=>JJ([...e,n])),K.refreshFollowUpSuggestions(n)),M(!1),I(null),P(!1),_.current=!1,v.current=!1,x.current=null,S.current=null,K.dismissClarify(),ye(),e?.skipSteeringQueueFlush||queueMicrotask(()=>{K.flushSteeringQueue()})},[ye,K.dismissClarify,K.refreshFollowUpSuggestions,K.flushSteeringQueue]),Se=(0,z.useCallback)((e,t)=>{y.current===e&&(O(t.messages),ue(t.hasMore),t.name&&ee(t.name))},[]),Ce=(0,z.useCallback)(async(e,t=0)=>{if(!(t===0&&e===y.current&&(_.current||v.current)&&x.current===e)&&(t===0&&K.dismissClarify(),!h.current)){h.current=!0;try{let{messages:n,hasMore:r,name:i}=await p.current.loadSession(e,t);if(t===0){V(e),ee(i??null),O(n),ue(r),R(null);try{let t=await p.current.loadSessionAgentConfig(e);re(t.model),ie(t.thinkingLevel||W9),oe(k9(t.reasoningLevel)),ve(t.model)}catch{}}else O(e=>{let t=new Set(e.map(e=>e.timestamp));return JJ([...n.filter(e=>!t.has(e.timestamp)),...e])}),ue(r)}catch{if(t===0){R(`Failed to load session`);let e=await p.current.loadSessions().catch(()=>[]),t=e.filter(e=>(e.messageCount??0)>0)[0]??e[0];if(t)_e(t.key),await Ce(t.key,0);else try{let e=d(),t=await p.current.createSession(e?{agentId:e}:void 0);_e(t.key),V(t.key),O([]),ue(!1);try{let e=await p.current.loadSessionAgentConfig(t.key);re(e.model),ie(e.thinkingLevel||W9),oe(k9(e.reasoningLevel)),ve(e.model)}catch{}}catch{R(`Could not open a session`)}}}finally{h.current=!1}}},[_e,ve,d,K.dismissClarify]),we=(0,z.useCallback)(async()=>{let e=y.current;if(!(!e||de||!le||h.current)){fe(!0);try{await Ce(e,pe.current)}finally{fe(!1)}}},[le,Ce,de]),Te=(0,z.useCallback)(async e=>{if(B)try{R(null),await p.current.patchSessionAgentConfig(B,{model:e}),re(e),ve(e)}catch(e){R(e instanceof Error?e.message:`Failed to switch model`)}},[B,ve]),Ee=(0,z.useCallback)(async()=>{K.dismissClarify();try{let e=await p.current.loadSessions(),t=d(),n=q9(e,t);if(n){V(n.key),ee(n.name??null),O([]),ue(!1),_e(n.key);try{let e=await p.current.loadSessionAgentConfig(n.key);re(e.model),ie(e.thinkingLevel||W9),oe(k9(e.reasoningLevel)),ve(e.model)}catch{}return}let r=await p.current.createSession(t?{agentId:t}:void 0);V(r.key),ee(r.name??null),O([]),ue(!1),_e(r.key);try{let e=await p.current.loadSessionAgentConfig(r.key);re(e.model),ie(e.thinkingLevel||W9),oe(k9(e.reasoningLevel)),ve(e.model)}catch{}}catch(e){console.error(`[chat] createNewSession failed:`,e)}},[_e,ve,d,K.dismissClarify]),De=(0,z.useCallback)(async e=>{let t=m.current;if(t.isSending)return;let n=null;try{let t=sessionStorage.getItem(A9(e));t&&(n=JSON.parse(t))}catch{}if(!n?.runId||S.current===n.runId)return;T.current=!1,S.current=n.runId,x.current=e,_.current=!0,v.current=!0,P(!0),M(!0),I(null);let r=!1,i=()=>{if(r)return;r=!0;let e=null;(0,Ho.flushSync)(()=>{O(t=>{if(t.length===0)return t;let n=t[t.length-1];return n?.role===`assistant`?(e=P9(n),t.slice(0,-1)):t}),e&&A(t=>t??e)})};try{await t.resume(n.runId,e,{onStreamStart:()=>{be(e)&&(i(),A(e=>P9(N9(e,Date.now()))))},onToken:t=>{be(e)&&(i(),A(e=>{let n=N9(e,Date.now());return B9(n.content,t),P9(n)}),M(!0))},onThinking:(t,n)=>{be(e)&&(i(),A(e=>{let r=N9(e,Date.now());return!n&&t===``?L9(r.content):R9(r.content,t,n),P9(r)}))},onThinkingEnd:()=>{be(e)&&(i(),A(e=>{if(!e)return e;let t=N9(e,Date.now());return z9(t.content),P9(t)}))},onToolStart:(t,n)=>{be(e)&&(i(),A(e=>{let r=N9(e,Date.now());return V9(r.content,t,n),P9(r)}),M(!0))},onToolEnd:(t,n,r)=>{be(e)&&(t===`clarify`&&K.onClarifyToolEnd(),i(),A(e=>{let i=N9(e,Date.now());return H9(i.content,t,n,r),P9(i)}))},onProgress:t=>{be(e)&&I(t)},onTtsAudio:t=>{be(e)&&A(e=>{let n=N9(e,Date.now()),r=t.workspaceRelativePath?.replace(/\\/g,`/`).trim(),i=n.attachments??[];if(r&&i.some(e=>e.workspaceRelativePath?.replace(/\\/g,`/`).trim()===r))return P9(n);let a={name:t.name,mimeType:t.mimeType,type:`voice`,workspaceRelativePath:t.workspaceRelativePath,size:0};return n.attachments=[...i,a],P9(n)})},onClarifyRequest:K.makeOnClarifyRequest(e),onResult:()=>{if(!be(e)){x.current=null,S.current=null,_.current=!1,v.current=!1,M(!1),P(!1),I(null),K.dismissClarify(),p.current.loadSession(e,0).then(t=>Se(e,t)).catch(()=>{});return}if(T.current){T.current=!1;return}xe()},onError:t=>{if(!be(e)){x.current=null,S.current=null,_.current=!1,v.current=!1,M(!1),P(!1),I(null),K.dismissClarify(),p.current.loadSession(e,0).then(t=>Se(e,t)).catch(()=>{});return}S.current=null,_.current=!1,v.current=!1,R(t),A(null),M(!1),P(!1),I(null),K.dismissClarify()}})}catch(t){t.name!==`AbortError`&&console.error(`[chat] resume failed:`,t),S.current=null,_.current=!1,v.current=!1,M(!1),P(!1),A(null),I(null),x.current===e&&(x.current=null)}},[Se,xe,be,K.dismissClarify,K.makeOnClarifyRequest,K.onClarifyToolEnd]),Oe=(0,z.useCallback)(async(e,t,n)=>{if(!e.trim()&&!t?.length||!_.current&&!v.current&&!m.current.isSending)return;if(e.trim()===`/new`&&!t?.length){await Ee();return}if(!y.current)return;K.dismissClarifyAndClearPending();let r=se?n??W:`off`;T.current=!0,S.current=null,x.current=null,m.current.abort(),_.current=!1,v.current=!1,xe({skipSteeringQueueFlush:!0}),I(null),queueMicrotask(()=>{E.current(e,t,r)})},[Ee,xe,se,W,K.dismissClarifyAndClearPending]),ke=(0,z.useCallback)(async(e,t,n)=>{if(!B||!e.trim()&&!t?.length||x.current===B&&(_.current||v.current))return;if(e.trim()===`/new`&&!t?.length){await Ee();return}let r=se?n??W:`off`,i=m.current,a=B;T.current=!1,K.clearFollowUpSuggestions(),x.current=a,_.current=!0,P(!0),R(null),K.dismissClarify(),O(n=>[...n,{role:`user`,content:e?[{type:`text`,text:e}]:[],attachments:t,timestamp:Date.now()}]);try{await i.send(e,a,t,r,{onStreamStart:()=>{be(a)&&(M(!0),A(e=>P9(N9(e,Date.now()))))},onToken:e=>{be(a)&&(A(t=>{let n=N9(t,Date.now());return B9(n.content,e),P9(n)}),M(!0))},onThinking:(e,t)=>{be(a)&&A(n=>{let r=N9(n,Date.now());return!t&&e===``?L9(r.content):R9(r.content,e,t),P9(r)})},onThinkingEnd:()=>{be(a)&&A(e=>{if(!e)return e;let t=N9(e,Date.now());return z9(t.content),P9(t)})},onToolStart:(e,t)=>{be(a)&&(A(n=>{let r=N9(n,Date.now());return V9(r.content,e,t),P9(r)}),M(!0))},onToolEnd:(e,t,n)=>{be(a)&&(e===`clarify`&&K.onClarifyToolEnd(),A(r=>{let i=N9(r,Date.now());return H9(i.content,e,t,n),P9(i)}))},onProgress:e=>{be(a)&&I(e)},onTtsAudio:e=>{be(a)&&A(t=>{let n=N9(t,Date.now()),r=e.workspaceRelativePath?.replace(/\\/g,`/`).trim(),i=n.attachments??[];if(r&&i.some(e=>e.workspaceRelativePath?.replace(/\\/g,`/`).trim()===r))return P9(n);let a={name:e.name,mimeType:e.mimeType,type:`voice`,workspaceRelativePath:e.workspaceRelativePath,size:0};return n.attachments=[...i,a],P9(n)})},onClarifyRequest:K.makeOnClarifyRequest(a),onResult:()=>{if(!be(a)){x.current=null,_.current=!1,v.current=!1,M(!1),P(!1),I(null),K.dismissClarify(),p.current.loadSession(a,0).then(e=>Se(a,e)).catch(()=>{});return}if(T.current){T.current=!1;return}xe()},onError:e=>{if(!be(a)){x.current=null,_.current=!1,v.current=!1,M(!1),P(!1),I(null),K.dismissClarify(),p.current.loadSession(a,0).then(e=>Se(a,e)).catch(()=>{});return}_.current=!1,v.current=!1,R(e),A(null),M(!1),P(!1),I(null),K.dismissClarify()}})}catch(e){e.name!==`AbortError`&&(R(e instanceof Error?e.message:`Send failed`),A(null),M(!1))}finally{_.current=!1,v.current=!1,P(!1),x.current===a&&(x.current=null)}},[B,W,se,Se,xe,be,Ee,K.clearFollowUpSuggestions,K.dismissClarify,K.makeOnClarifyRequest,K.onClarifyToolEnd]),Ae=(0,z.useCallback)(()=>{T.current=!0,S.current=null,x.current=null,K.dismissClarifyAndClearPending(),m.current.abort(),_.current=!1,v.current=!1,xe({skipSteeringQueueFlush:!0}),I(null);let e=y.current;e&&window.setTimeout(()=>{Ce(e,0)},300)},[xe,Ce,K.dismissClarifyAndClearPending]);(0,z.useEffect)(()=>{let e=x.current;he&&(!e||he===e||(A(null),I(null),M(!1),P(!1)))},[he]),(0,z.useEffect)(()=>{he&&De(he)},[he,De]);let je=(0,z.useMemo)(()=>k?[...D,k]:D,[D,k]);(0,z.useEffect)(()=>{let e=e=>{let t=e.detail;!t?.key||t.name===void 0||t.key===B&&ee(t.name||null)};return window.addEventListener(`session-updated`,e),()=>window.removeEventListener(`session-updated`,e)},[B]),(0,z.useEffect)(()=>{let e=()=>{let e=y.current;e&&p.current.loadSessionAgentConfig(e).then(e=>{re(e.model),ie(e.thinkingLevel||W9),oe(k9(e.reasoningLevel)),ve(e.model)}).catch(()=>{})};return window.addEventListener(`config-reload`,e),()=>window.removeEventListener(`config-reload`,e)},[ve]),(0,z.useEffect)(()=>{if(!r){U(!1);return}let e=++g.current,t=!1;return(async()=>{(me||he===void 0)&&U(!0),R(null);try{if(me){let n=await p.current.loadSessions();if(t||e!==g.current)return;let r=d(),i=q9(n,r);if(i){V(i.key),ee(i.name??null),O([]),ue(!1),_e(i.key);try{let e=await p.current.loadSessionAgentConfig(i.key);re(e.model),ie(e.thinkingLevel||W9),oe(k9(e.reasoningLevel)),ve(e.model)}catch{}}else{let n=await p.current.createSession(r?{agentId:r}:void 0);if(t||e!==g.current)return;V(n.key),ee(n.name??null),O([]),ue(!1),_e(n.key);try{let e=await p.current.loadSessionAgentConfig(n.key);re(e.model),ie(e.thinkingLevel||W9),oe(k9(e.reasoningLevel)),ve(e.model)}catch{}}}else if(he)await Ce(he,0),!t&&e===g.current&&await De(he);else{let n=await p.current.loadSessions();if(t||e!==g.current)return;let r=n.filter(e=>(e.messageCount??0)>0)[0]??n[0];if(r){if(await Ce(r.key,0),t||e!==g.current)return;p.current.parseSessionFromHash()||_e(r.key),await De(r.key)}else{let n=d(),r=await p.current.createSession(n?{agentId:n}:void 0);if(t||e!==g.current)return;V(r.key),ee(r.name??null),O([]),ue(!1),_e(r.key);try{let e=await p.current.loadSessionAgentConfig(r.key);re(e.model),ie(e.thinkingLevel||W9),oe(k9(e.reasoningLevel)),ve(e.model)}catch{}}}}catch(e){t||R(e instanceof Error?e.message:`Chat init failed`)}finally{!t&&e===g.current&&U(!1)}})(),()=>{t=!0}},[r,me,he,_e,Ce,De,ve,d]);let Me=B&&M9(B)||o||i?.defaultId||`main`,Ne=(i?.items.length??0)>1;return E.current=ke,{messages:je,sessionKey:B,sessionName:H,decodedKey:he,sessionRoutePending:G,showSessionLoading:ge,sessionModel:ne,thinkingLevel:W,setThinkingLevel:ie,reasoningLevel:ae,modelSupportsThinking:se,hasMore:le,loadingMore:de,loadMoreMessages:we,onSessionModelChange:Te,createNewSession:Ee,loading:te,error:L,streaming:j,sending:N,progress:F,sendMessage:ke,addPendingFollowUp:K.addPendingFollowUp,pendingFollowUps:K.pendingFollowUps,editingFollowUpId:K.editingFollowUpId,beginEditFollowUp:K.beginEditFollowUp,cancelEditFollowUp:K.cancelEditFollowUp,commitEditFollowUp:K.commitEditFollowUp,removePendingFollowUp:K.removePendingFollowUp,movePendingFollowUp:K.movePendingFollowUp,reorderPendingFollowUp:K.reorderPendingFollowUp,steerPendingFollowUp:K.steerPendingFollowUp,steeringFollowUpId:K.steeringFollowUpId,interruptAndSend:Oe,abort:Ae,followUpSuggestions:K.followUpSuggestions,pickFollowUpSuggestion:K.pickFollowUpSuggestion,clarifyPrompt:K.clarifyPrompt,clarifySubmitting:K.clarifySubmitting,submitClarifyAnswer:K.submitClarifyAnswer,hasToken:!!r,chatAgents:i,displayAgentId:Me,showChatAgentSelector:Ne,onChatAgentChange:f,sessionManager:p.current}}function yte({prompt:e,submitting:t,onSubmit:n}){let[r,i]=(0,z.useState)(``),a=(0,z.useCallback)(e=>{n(e)},[n]);if(!e)return null;let o=Array.isArray(e.choices)&&e.choices.length>=2;return(0,Z.jsxs)(`div`,{role:`region`,"aria-label":`Clarification`,className:`mb-4 rounded-lg border border-edge bg-surface-elevated px-4 py-3 text-sm text-fg shadow-sm`,children:[(0,Z.jsx)(t4,{content:e.question,compact:!0,className:`mb-3`}),o?(0,Z.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[e.choices.map(e=>(0,Z.jsx)(`button`,{type:`button`,disabled:t,className:`rounded-md border border-edge bg-surface-panel px-3 py-1.5 text-left text-fg transition hover:bg-surface-muted disabled:opacity-50`,onClick:()=>a(e),children:e},e)),e.default?(0,Z.jsxs)(`button`,{type:`button`,disabled:t,className:`rounded-md border border-dashed border-edge px-3 py-1.5 text-fg-muted hover:bg-surface-muted disabled:opacity-50`,onClick:()=>a(e.default),children:[`Default: `,e.default]}):null]}):(0,Z.jsxs)(`form`,{className:`flex flex-col gap-2 sm:flex-row sm:items-end`,onSubmit:e=>{e.preventDefault();let t=r.trim();t&&(n(t),i(``))},children:[(0,Z.jsx)(`input`,{type:`text`,value:r,onChange:e=>i(e.target.value),disabled:t,placeholder:`Your answer…`,className:`min-w-0 flex-1 rounded-md border border-edge bg-surface-panel px-3 py-2 text-fg placeholder:text-fg-muted focus:border-accent focus:outline-none focus:ring-1 focus:ring-accent disabled:opacity-50`}),(0,Z.jsx)(`button`,{type:`submit`,disabled:t||!r.trim(),className:`shrink-0 rounded-md bg-accent px-4 py-2 font-medium text-white hover:opacity-90 disabled:opacity-40`,children:`Send`}),e.default?(0,Z.jsx)(`button`,{type:`button`,disabled:t,className:`shrink-0 rounded-md border border-edge px-3 py-2 text-fg-muted hover:bg-surface-muted disabled:opacity-50`,onClick:()=>a(e.default),children:`Use default`}):null]})]})}function J9(){let e=Jz(lB(e=>e.language)),t=BB(e=>e.token),n=(0,z.useRef)(null),r=(0,z.useRef)(0),[i,a]=(0,z.useState)(null),[o,s]=(0,z.useState)(!0),c=(0,z.useRef)(!0),l=(0,z.useRef)(0),u=(0,z.useRef)(0),d=(0,z.useRef)(!0),f=(0,z.useRef)({first:void 0,len:0,scrollHeight:0});(0,z.useEffect)(()=>{c.current=o},[o]);let{messages:p,sessionKey:m,sessionName:h,decodedKey:g,sessionRoutePending:_,showSessionLoading:v,sessionModel:y,thinkingLevel:b,setThinkingLevel:x,reasoningLevel:S,modelSupportsThinking:C,hasMore:w,loadingMore:T,loadMoreMessages:E,onSessionModelChange:D,error:O,streaming:k,sending:A,progress:j,sendMessage:M,addPendingFollowUp:N,pendingFollowUps:P,editingFollowUpId:F,beginEditFollowUp:I,cancelEditFollowUp:L,commitEditFollowUp:R,removePendingFollowUp:B,movePendingFollowUp:V,reorderPendingFollowUp:H,steerPendingFollowUp:ee,steeringFollowUpId:te,interruptAndSend:U,abort:ne,followUpSuggestions:re,pickFollowUpSuggestion:W,clarifyPrompt:ie,clarifySubmitting:ae,submitClarifyAnswer:oe,hasToken:se,chatAgents:ce,displayAgentId:le,showChatAgentSelector:ue,onChatAgentChange:de,sessionManager:fe}=vte();(0,z.useEffect)(()=>{a(null)},[m]);let pe=(0,z.useCallback)(e=>{r.current+=1,a({id:r.current,text:e})},[]),me=(0,z.useMemo)(()=>!!m&&!v&&!_&&p.length===0,[m,v,_,p.length]),he=p4(e=>e.setAgentId);(0,z.useEffect)(()=>{if(se)return he(le),()=>he(``)},[se,le,he]);let G=!v&&p.length===0&&!k,ge=(0,z.useMemo)(()=>(_&&g?g:m)?h?.trim()||e.chat.newSession:e.nav.chat,[m,h,_,g,e.nav.chat,e.chat.newSession]),_e=(0,z.useCallback)((e=!0)=>{let t=n.current;t&&requestAnimationFrame(()=>{t.scrollTo({top:t.scrollHeight,behavior:e?`smooth`:`auto`});let r=t.scrollHeight;requestAnimationFrame(()=>{n.current&&n.current.scrollHeight>r&&n.current.scrollTo({top:n.current.scrollHeight,behavior:e?`smooth`:`auto`})})})},[]),ve=(0,z.useCallback)(()=>{let e=n.current;if(!e)return;let{scrollTop:t,scrollHeight:r,clientHeight:i}=e,a=r-t-i;if(i<u.current){u.current=i;return}t!==0&&t<l.current&&a>50?s(!1):a<10&&s(!0),l.current=t,u.current=i,t<100&&!c.current&&w&&!T&&E()},[w,T,E]);return(0,z.useLayoutEffect)(()=>{if(!se)return;if(v){d.current=!0;return}if(d.current!==!0)return;d.current=!1,s(!0);let e=n.current;e&&(e.scrollTop=e.scrollHeight),requestAnimationFrame(()=>{_e(!1),requestAnimationFrame(()=>_e(!1))})},[v,se,_e]),(0,z.useEffect)(()=>{A&&(v||(s(!0),_e(!0)))},[A,v,_e]),(0,z.useEffect)(()=>{v||o&&_e(!1)},[p,o,_e,v]),(0,z.useLayoutEffect)(()=>{let e=n.current;if(!e||v)return;let t=f.current,r=p[0],i=p.length,a=e.scrollHeight;i>t.len&&t.len>0&&r!==void 0&&r!==t.first&&t.scrollHeight>0&&(e.scrollTop+=a-t.scrollHeight),f.current={first:r,len:i,scrollHeight:a}},[p,v]),se?(0,Z.jsxs)(`div`,{className:`flex h-full min-h-0 flex-1 flex-col bg-surface-panel`,children:[(0,Z.jsx)(K5,{}),(0,Z.jsx)(G5,{chatHeadline:ge,sessionModel:y,showModelSelector:!!(m&&!_),onModelChange:D,modelDisabled:v||_||k,chatAgents:ce?.items??[],showChatAgentSelector:ue,chatAgentId:le,onChatAgentChange:de,chatAgentDisabled:v||_||k}),(0,Z.jsx)(`div`,{className:`mx-auto flex min-h-0 w-full max-w-[var(--max-width-chat)] flex-1 flex-col`,children:(0,Z.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col px-3 sm:px-5 xl:px-6`,children:(0,Z.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,Z.jsx)(`div`,{ref:n,className:X(`chat-messages min-h-0 flex-1 overflow-y-auto overflow-x-hidden [scrollbar-gutter:stable]`,G?`pt-5 pb-2`:`py-4`),onScroll:ve,children:v?(0,Z.jsx)(`div`,{className:`flex min-h-[min(40vh,20rem)] flex-col items-center justify-center gap-3 py-12 text-center text-sm text-fg-muted`,children:e.chat.loading}):(0,Z.jsxs)(Z.Fragment,{children:[T?(0,Z.jsx)(`div`,{className:`mb-3 text-center text-xs text-fg-muted`,children:e.chat.loadOlder}):null,O?(0,Z.jsx)(`div`,{className:`mb-4 rounded-md border border-edge bg-red-50 px-3 py-2 text-sm text-red-700 dark:border-edge dark:bg-red-950/40 dark:text-red-300`,children:O}):null,(0,Z.jsx)(ote,{messages:p,authToken:t??void 0,sessionKey:m,streaming:k,progress:j,reasoningLevel:S,scrollElementRef:n,pinToBottom:o,onPickWelcomePrompt:pe})]})}),(0,Z.jsxs)(`div`,{className:X(`sticky bottom-0 z-10 shrink-0 bg-surface-panel`,G?`py-2.5`:`py-4`),children:[(0,Z.jsx)(yte,{prompt:ie,submitting:ae,onSubmit:oe}),(0,Z.jsx)(`div`,{className:`mx-auto w-full max-w-[var(--max-width-chat)] px-3 sm:px-5 xl:px-6`,children:(0,Z.jsx)(L5,{suggestions:re,disabled:v||_||!!ie,onPick:W})}),(0,Z.jsx)(F5,{disabled:v||_||!!ie,sending:A,streaming:k,sessionKey:m,sessionManager:fe,welcomeDraftSeed:i,canSelectWorkingDirectory:me,thinkingLevel:b,showThinkingSelector:C,onThinkingChange:x,onSend:M,onAbort:ne,onAddPendingFollowUp:(e,t)=>void N(e,t),onSteeringInterrupt:(e,t)=>void U(e,t),pendingFollowUps:P,editingFollowUpId:F,onBeginEditFollowUp:I,onCancelEditFollowUp:L,onCommitEditFollowUp:(e,t,n,r)=>void R(e,t,n,r),onPendingFollowUpRemove:B,onPendingFollowUpMove:V,onPendingFollowUpReorder:H,onPendingFollowUpSteer:e=>void ee(e),steeringFollowUpId:te})]})]})})}),(0,Z.jsx)(ste,{visible:!v&&!o,onClick:()=>_e(!0)})]}):(0,Z.jsx)(`div`,{className:`mx-auto w-full max-w-[var(--max-width-chat)] px-3 py-16 text-center text-sm leading-relaxed text-fg-muted sm:px-5`,children:e.chat.needToken})}function bte(){return(0,Z.jsx)(`div`,{className:`flex h-full min-h-0 flex-1 flex-col`,children:(0,Z.jsx)(Oa,{})})}async function xte(e){let t=await rW(e);if(!t.ok){let e=await t.json().catch(()=>({})),n=nW(t.status,t.statusText,e.error?.message);throw Error(n)}return t.json()}function Ste({children:e}){return(0,Z.jsx)(c,{value:{fetcher:xte,revalidateOnFocus:!1,dedupingInterval:2e3,shouldRetryOnError:!0,errorRetryCount:2},children:e})}var Cte=(0,z.lazy)(()=>f(()=>import(`./sessions-page-CzTpNrb3.js`).then(e=>({default:e.SessionsPage})),__vite__mapDeps([6,1,4]))),wte=(0,z.lazy)(()=>f(()=>import(`./cron-page-CFuU6V8l.js`).then(e=>({default:e.CronPage})),__vite__mapDeps([8,1,9,4,2]))),Tte=(0,z.lazy)(()=>f(()=>import(`./skills-page-Dg_Uk_jM.js`).then(e=>({default:e.SkillsPage})),__vite__mapDeps([10,1,11,9,4]))),Ete=(0,z.lazy)(()=>f(()=>import(`./logs-page-Du6UoHCK.js`).then(e=>({default:e.LogsPage})),__vite__mapDeps([7,1,4]))),Dte=(0,z.lazy)(()=>f(()=>import(`./settings-page-jqrVlTkQ.js`).then(e=>({default:e.SettingsPage})),__vite__mapDeps([0,1,2,3,4,5]))),Y9=(0,z.lazy)(()=>f(()=>import(`./agents-D1c5jt8x.js`).then(e=>({default:e.AgentsSettingsPanel})),__vite__mapDeps([5,1,2,3,4]))),Ote=(0,z.lazy)(()=>f(()=>import(`./channels-settings-CPWWa4rf.js`).then(e=>({default:e.ChannelsSettingsPanel})),__vite__mapDeps([15,1,9,4,3]))),kte=(0,z.lazy)(()=>f(()=>import(`./apps-page-bi53w_qy.js`).then(e=>({default:e.AppsPage})),__vite__mapDeps([16,1,3,4]))),X9=(0,z.lazy)(()=>f(()=>import(`./extension-page-5WNq5ZxE.js`).then(e=>({default:e.ExtensionPage})),__vite__mapDeps([17,1,4]))),Z9=(0,z.lazy)(()=>f(()=>import(`./extension-settings-page-BM4emw9B.js`).then(e=>({default:e.ExtensionSettingsPage})),__vite__mapDeps([18,4,1]))),Ate=(0,z.lazy)(()=>f(()=>import(`./extension-debug-page-DkaqKijm.js`).then(e=>({default:e.ExtensionDebugPage})),__vite__mapDeps([19,1,4])));function Q9(){return(0,Z.jsx)(`div`,{className:`flex min-h-[min(40vh,16rem)] flex-1 items-center justify-center text-sm text-fg-muted`,"aria-busy":!0,children:`Loading…`})}function jte(){let{agentId:e}=qi(),t=typeof e==`string`?e.trim():``;return(0,Z.jsx)(Da,{to:t?`/agents/${encodeURIComponent(t)}`:`/agents`,replace:!0})}function $9(){return(0,Z.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col`,"aria-busy":!0,children:(0,Z.jsxs)(`div`,{className:`mx-auto w-full max-w-app-main flex-1 px-4 py-8`,children:[(0,Z.jsx)(`div`,{className:`h-8 w-48 max-w-full animate-pulse rounded-md bg-surface-hover`}),(0,Z.jsx)(`div`,{className:`mt-6 h-36 animate-pulse rounded-xl bg-surface-hover`}),(0,Z.jsx)(`div`,{className:`mt-4 h-24 animate-pulse rounded-xl bg-surface-hover`}),(0,Z.jsx)(`p`,{className:`mt-6 text-sm text-fg-muted`,children:`Loading…`})]})})}var Mte=vo([{path:`/`,element:(0,Z.jsx)(z3,{}),children:[{index:!0,element:(0,Z.jsx)(Da,{to:`/chat`,replace:!0})},{path:`chat`,element:(0,Z.jsx)(bte,{}),children:[{index:!0,element:(0,Z.jsx)(J9,{})},{path:`new`,element:(0,Z.jsx)(J9,{})},{path:`:sessionKey`,element:(0,Z.jsx)(J9,{})}]},{path:`sessions`,element:(0,Z.jsx)(Da,{to:`/settings/sessions`,replace:!0})},{path:`logs`,element:(0,Z.jsx)(Da,{to:`/settings/logs`,replace:!0})},{path:`cron`,element:(0,Z.jsx)(z.Suspense,{fallback:(0,Z.jsx)(Q9,{}),children:(0,Z.jsx)(wte,{})})},{path:`skills`,element:(0,Z.jsx)(z.Suspense,{fallback:(0,Z.jsx)(Q9,{}),children:(0,Z.jsx)(Tte,{})})},{path:`channels`,element:(0,Z.jsx)(z.Suspense,{fallback:(0,Z.jsx)(Q9,{}),children:(0,Z.jsx)(Ote,{})})},{path:`agents`,element:(0,Z.jsx)(z.Suspense,{fallback:(0,Z.jsx)(Q9,{}),children:(0,Z.jsx)(Y9,{})})},{path:`agents/:agentId`,element:(0,Z.jsx)(z.Suspense,{fallback:(0,Z.jsx)(Q9,{}),children:(0,Z.jsx)(Y9,{})})},{path:`apps`,element:(0,Z.jsx)(z.Suspense,{fallback:(0,Z.jsx)(Q9,{}),children:(0,Z.jsx)(kte,{})})},{path:`apps/:extensionId`,element:(0,Z.jsx)(z.Suspense,{fallback:(0,Z.jsx)(Q9,{}),children:(0,Z.jsx)(X9,{})})},{path:`apps/:extensionId/:pageId`,element:(0,Z.jsx)(z.Suspense,{fallback:(0,Z.jsx)(Q9,{}),children:(0,Z.jsx)(X9,{})})},{path:`settings`,element:(0,Z.jsx)(X3,{}),children:[{index:!0,element:(0,Z.jsx)(Da,{to:`appearance`,replace:!0})},{path:`sessions`,element:(0,Z.jsx)(z.Suspense,{fallback:(0,Z.jsx)(Q9,{}),children:(0,Z.jsx)(Cte,{})})},{path:`logs`,element:(0,Z.jsx)(z.Suspense,{fallback:(0,Z.jsx)(Q9,{}),children:(0,Z.jsx)(Ete,{})})},{path:`cron`,element:(0,Z.jsx)(Da,{to:`/cron`,replace:!0})},{path:`skills`,element:(0,Z.jsx)(Da,{to:`/skills`,replace:!0})},{path:`channels`,element:(0,Z.jsx)(Da,{to:`/channels`,replace:!0})},{path:`agents`,element:(0,Z.jsx)(Da,{to:`/agents`,replace:!0})},{path:`agents/:agentId`,element:(0,Z.jsx)(jte,{})},{path:`extensions/debug`,element:(0,Z.jsx)(z.Suspense,{fallback:(0,Z.jsx)($9,{}),children:(0,Z.jsx)(Ate,{})})},{path:`ext/:extensionId`,element:(0,Z.jsx)(z.Suspense,{fallback:(0,Z.jsx)($9,{}),children:(0,Z.jsx)(Z9,{})})},{path:`ext/:extensionId/:panelId`,element:(0,Z.jsx)(z.Suspense,{fallback:(0,Z.jsx)($9,{}),children:(0,Z.jsx)(Z9,{})})},{path:`:section`,element:(0,Z.jsx)(z.Suspense,{fallback:(0,Z.jsx)($9,{}),children:(0,Z.jsx)(Dte,{})})}]}]}]);function Nte(){return(0,z.useEffect)(()=>{let e=OB.persist.onFinishHydration(()=>{kB()}),t=_B.persist.onFinishHydration(()=>{vB()}),n=AB();return()=>{e?.(),t?.(),n()}},[]),null}function Pte(){return(0,Z.jsx)(ht,{i18n:Ue,children:(0,Z.jsx)(Ste,{children:(0,Z.jsx)(qW,{children:(0,Z.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,Z.jsx)(Nte,{}),(0,Z.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col [&>*]:min-h-0 [&>*]:flex-1`,children:(0,Z.jsx)(Uo,{router:Mte})})]})})})})}document.documentElement.setAttribute(`lang`,vt(wt())),DB(),gB(),VB(),(0,B.createRoot)(document.getElementById(`root`)).render((0,Z.jsx)(z.StrictMode,{children:(0,Z.jsx)(Pte,{})}));export{RW as $,Xh as $n,YP as $t,EY as A,AS as An,MB as At,gJ as B,_y as Bn,Jz as Bt,iX as C,Rw as Cn,Bi as Cr,tV as Ct,xY as D,tC as Dn,mt as Dr,UB as Dt,OY as E,hC as En,jo as Er,GB as Et,NJ as F,eS as Fn,$z as Ft,Vq as G,p_ as Gn,NL as Gt,hJ as H,Qv as Hn,Mz as Ht,MJ as I,Gx as In,Xz as It,tG as J,r_ as Jn,HI as Jt,zq as K,o_ as Kn,jL as Kt,yJ as L,fx as Ln,Qz as Lt,DY as M,ES as Mn,lB as Mt,zJ as N,wS as Nn,tB as Nt,bY as O,KS as On,BB as Ot,PJ as P,xS as Pn,nB as Pt,$W as Q,sg as Qn,hF as Qt,vJ as R,db as Rn,Zz as Rt,aX as S,Gw as Sn,Da as Sr,lV as St,SY as T,TC as Tn,qi as Tr,XB as Tt,Bq as U,ov as Un,Nz as Ut,mJ as V,iy as Vn,Kz as Vt,Hq as W,iv as Wn,X as Wt,YW as X,qg as Xn,oI as Xt,QW as Y,Jg as Yn,yI as Yt,eG as Z,Gg as Zn,wF as Zt,V4 as _,WD as _n,Sc as _r,HV as _t,o6 as a,KA as an,hm as ar,iW as at,t4 as b,ME as bn,us as br,uV as bt,G3 as c,_A as cn,xp as cr,QU as ct,W4 as d,ek as dn,cp as dr,qU as dt,_P as en,Th as er,_W as et,q4 as f,gO as fn,$f as fr,ZU as ft,B4 as g,XD as gn,Lu as gr,WV as gt,U4 as h,$D as hn,nd as hr,YV as ht,d6 as i,xj as in,_m as ir,rW as it,TY as j,DS as jn,OB as jt,yY as k,LS as kn,RB as kt,H4 as l,mA as ln,fp as lr,YU as lt,K4 as m,eO as mn,ad as mr,aU as mt,$7 as n,UM as nn,Zm as nr,dW as nt,K3 as o,TA as on,Ip as or,$U as ot,z4 as p,uO as pn,dd as pr,mU as pt,Cq as q,a_ as qn,AL as qt,U5 as r,Lj as rn,Cm as rr,Q as rt,W3 as s,wA as sn,Ep as sr,XU as st,j9 as t,JN as tn,Sh as tr,gW as tt,G4 as u,nA as un,dp as ur,JU as ut,r4 as v,UD as vn,Xs as vr,kV as vt,wY as w,EC as wn,Ui as wr,QB as wt,vX as x,Xw as xn,Co as xr,cV as xt,$ as y,yD as yn,Js as yr,vV as yt,_J as z,Oy as zn,eB as zt};
144
+ //# sourceMappingURL=index-DJnBAhem.js.map