feat(desktop): refresh compiled React Desktop 2.0 distribution

Rebuild the compiled renderer from abraxas914/GenericAgent source
commit 9fe5d69b85cfad8778ace84b6f69bc75f9e0d392, refreshing:

- New-chat default model tag: the selected-model badge in Settings
  and the composer now read '新会话默认' / 'New chat default'.
- Model selectors display the configured profile name (备注名) so the
  same model served by different providers is distinguishable.
- desktop_bridge: syncing mixin llm_nos references when a profile is
  renamed, preventing orphan references in the mixin config.
- Release publisher sets GH_REPO so 'gh release create' resolves the
  target repository without checking out source, satisfying the
  publisher security contract while fixing the prerelease step.

Provenance and verifier updated to the new source commit and the
LF-normalized content manifest (98 generated assets).
This commit is contained in:
yiqi-017 committed 2026-08-25 18:00:43 +08:00
1 parent 3d62523d40
commit bb4b2ca974
19 files changed
+146 -130

No files matched your search

@@ -778,6 +778,7 @@ jobs:
- name: Validate six assets and publish prerelease - name: Validate six assets and publish prerelease
env: env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
TAG_NAME: ${{ github.ref_name }} TAG_NAME: ${{ github.ref_name }}
TARGET_SHA: ${{ github.sha }} TARGET_SHA: ${{ github.sha }}
shell: bash shell: bash
+1 -1
View File
@@ -9,7 +9,7 @@ The public React source of truth and the place for renderer issues, pull request
- <https://github.com/abraxas914/GenericAgent> - <https://github.com/abraxas914/GenericAgent>
- Exact source used for this distribution: - Exact source used for this distribution:
[`21f12f6dfe57ada8572bb21fe6604caac230b1cf`](https://github.com/abraxas914/GenericAgent/commit/21f12f6dfe57ada8572bb21fe6604caac230b1cf) [`9fe5d69b85cfad8778ace84b6f69bc75f9e0d392`](https://github.com/abraxas914/GenericAgent/commit/9fe5d69b85cfad8778ace84b6f69bc75f9e0d392)
Over the two-month React Desktop 2.0 development cycle, [abraxas914](https://github.com/abraxas914) led the new Over the two-month React Desktop 2.0 development cycle, [abraxas914](https://github.com/abraxas914) led the new
renderer architecture and UI, Desktop bridge and Tauri integration, startup and recovery surfaces, package renderer architecture and UI, Desktop bridge and Tauri integration, startup and recovery surfaces, package
@@ -1 +1 @@
import{b as r,aj as l}from"./tauri-compat-tfiFK9EG.js";import{H as i,b as N,J as C,K as S,L as M,N as T,O as v,M as E,P as W}from"./main-Knf6L_en.js";import{MarkdownPart as w}from"./MarkdownPart-Bhe_jloX.js";import"./index-Bpi3BHKj.js";import"./WindowsTitlebar-CrkUa1UM.js";import"./markdown-preprocess-Bvg4n8KE.js";function R(e){const c=Math.floor(e/1e3);if(c<60)return`${c}s`;const a=Math.floor(c/60),n=c%60;return`${a}m ${n}s`}function $({since:e}){const[c,a]=r.useState(Date.now());return r.useEffect(()=>{const n=setInterval(()=>a(Date.now()),1e3);return()=>clearInterval(n)},[]),l.jsx(l.Fragment,{children:R(c-e)})}const D=200;function P({message:e}){const c=e.role==="user",a=e.role==="conductor";return l.jsx("div",{className:`collab-msg collab-msg--${e.role}`,"data-slot":"collab-msg",children:l.jsxs("div",{className:`collab-bubble ${c?"collab-bubble--user":a?"collab-bubble--conductor":"collab-bubble--system"}`,children:[e.images&&e.images.length>0&&l.jsx("div",{className:"collab-msg-images",children:e.images.map((n,s)=>l.jsx("img",{src:n.base64||n.path,alt:n.name,className:"collab-msg-img"},s))}),e.files&&e.files.length>0&&l.jsx("div",{className:"collab-msg-files",children:e.files.map((n,s)=>l.jsx("span",{className:"collab-msg-file-chip",children:n.name},s))}),a||e.role==="system"?l.jsx(w,{content:e.msg}):l.jsx("span",{className:"collab-msg-text",children:e.msg})]})})}function B({since:e}){const{t:c}=N();return l.jsx("div",{className:"collab-msg collab-msg--conductor","data-slot":"collab-typing",children:l.jsxs("div",{className:"collab-thinking-bar",children:[l.jsx("span",{className:"collab-thinking-dot"}),l.jsx("span",{className:"collab-thinking-label",children:c("collab.typing")}),l.jsx("span",{className:"collab-thinking-time",children:l.jsx($,{since:e})})]})})}function I(){const e=i(o=>o.messages),c=i(o=>o.conductorTyping),a=i(o=>o.connectionStatus),{t:n}=N(),{scrollRef:s}=C(),[u,x]=r.useState(1),d=r.useRef(null),p=r.useRef(0);r.useEffect(()=>{(a==="connecting"||e.length===0)&&x(1)},[a,e.length]);const b=D*u,m=Math.max(0,e.length-b),k=e.slice(m),t=m,g=r.useCallback(()=>{const o=s.current;o&&(d.current=o.scrollHeight-o.scrollTop),x(h=>h+1)},[s]);r.useLayoutEffect(()=>{if(d.current==null)return;if(m>=p.current){d.current=null,p.current=m;return}const o=s.current;o&&(o.scrollTop=o.scrollHeight-d.current),d.current=null,p.current=m},[m,s]),r.useEffect(()=>{p.current=m},[m]);const j=[...e].reverse().find(o=>o.role==="user"),y=o=>o>1e12?o:o*1e3,f=r.useRef(Date.now());return j!=null&&j.ts&&(f.current=y(j.ts)),a==="connecting"?l.jsx("div",{className:"collab-messages-area","data-slot":"collab-messages",children:l.jsxs("div",{className:"collab-connecting",children:[l.jsx("span",{className:"collab-connecting-dot"}),l.jsx("span",{children:n("status.connecting")})]})}):e.length===0?l.jsx("div",{className:"collab-messages-area","data-slot":"collab-messages",children:l.jsx("div",{className:"collab-empty",children:l.jsx("p",{children:n("collab.placeholder")})})}):l.jsx("div",{className:"collab-messages-area","data-slot":"collab-messages",ref:s,children:l.jsxs("div",{className:"collab-messages-scroll",children:[t>0&&l.jsxs("button",{type:"button","data-slot":"show-earlier-btn",onClick:g,children:["Show ",t," earlier"]}),k.map((o,h)=>l.jsx(P,{message:o},o.id||m+h)),c&&l.jsx(B,{since:f.current})]})})}function F(){const e=i(t=>t.sendMessage),c=i(t=>t.conductorTyping),a=i(t=>t.connectionStatus),n=i(t=>t.modelConfig),s=i(t=>t.runtimeModel),u=i(t=>t.loadModel),x=i(t=>t.selectModel),d=S(t=>t.defaultModelNo);r.useEffect(()=>{u()},[u]);const p=r.useCallback((t,g)=>{var f,o;const j=(f=g==null?void 0:g.files)==null?void 0:f.map(h=>({name:h.name,path:h.path})),y=(o=g==null?void 0:g.images)==null?void 0:o.map(h=>({name:h.name,path:h.path,base64:h.base64}));e(t,j,y)},[e]),b=r.useCallback(()=>{},[]),m=a!=="ready",k=(n==null?void 0:n.effective)??(n==null?void 0:n.configured)??d;return l.jsx("div",{className:"collab-composer-wrap","data-slot":"collab-composer","data-disabled":m||void 0,children:l.jsx(M,{onSend:p,onStop:b,isGenerating:c,hideStatusStack:!0,modelControl:l.jsx(T,{selectedNo:k,runningNo:s!=null&&s.running?s.effective:null,isRunning:!!(s!=null&&s.running),onSelect:x})})})}const H=[{key:"1",icon:"comment"},{key:"2",icon:"symbol-misc"},{key:"3",icon:"graph"},{key:"4",icon:"edit"}],L=["collab.chipProgress","collab.chipPause","collab.chipSummary"];function O({onChipClick:e}){const{t:c}=N();return l.jsxs("div",{className:"collab-welcome","data-slot":"collab-welcome",children:[l.jsx("h2",{className:"collab-welcome-title",children:c("collab.guideTitle")}),l.jsx("p",{className:"collab-welcome-sub",children:c("collab.guideWhen")}),l.jsx("div",{className:"collab-welcome-steps",children:H.map(a=>l.jsxs("div",{className:"collab-welcome-step",children:[l.jsx("span",{className:"collab-welcome-step-icon",children:l.jsx(v,{name:a.icon,size:"1rem"})}),l.jsxs("span",{className:"collab-welcome-step-text",children:[l.jsx("span",{className:"collabLine truncated import{b as r,aj as l}from"./tauri-compat-tfiFK9EG.js";import{H as i,b as N,J as C,K as S,L as M,N as T,O as v,M as E,P as W}from"./main-BlLQtfpq.js";import{MarkdownPart as w}from"./MarkdownPart-B6YIH_Oj.js";import"./index-Bpi3BHKj.js";import"./WindowsTitlebar-CrkUa1UM.js";import"./markdown-preprocess-6737_jWr.js";function R(e){const c=Math.floor(e/1e3);if(c<60)return`${c}s`;const a=Math.floor(c/60),n=c%60;return`${a}m ${n}s`}function $({since:e}){const[c,a]=r.useState(Date.now());return r.useEffect(()=>{const n=setInterval(()=>a(Date.now()),1e3);return()=>clearInterval(n)},[]),l.jsx(l.Fragment,{children:R(c-e)})}const D=200;function P({message:e}){const c=e.role==="user",a=e.role==="conductor";return l.jsx("div",{className:`collab-msg collab-msg--${e.role}`,"data-slot":"collab-msg",children:l.jsxs("div",{className:`collab-bubble ${c?"collab-bubble--user":a?"collab-bubble--conductor":"collab-bubble--system"}`,children:[e.images&&e.images.length>0&&l.jsx("div",{className:"collab-msg-images",children:e.images.map((n,s)=>l.jsx("img",{src:n.base64||n.path,alt:n.name,className:"collab-msg-img"},s))}),e.files&&e.files.length>0&&l.jsx("div",{className:"collab-msg-files",children:e.files.map((n,s)=>l.jsx("span",{className:"collab-msg-file-chip",children:n.name},s))}),a||e.role==="system"?l.jsx(w,{content:e.msg}):l.jsx("span",{className:"collab-msg-text",children:e.msg})]})})}function B({since:e}){const{t:c}=N();return l.jsx("div",{className:"collab-msg collab-msg--conductor","data-slot":"collab-typing",children:l.jsxs("div",{className:"collab-thinking-bar",children:[l.jsx("span",{className:"collab-thinking-dot"}),l.jsx("span",{className:"collab-thinking-label",children:c("collab.typing")}),l.jsx("span",{className:"collab-thinking-time",children:l.jsx($,{since:e})})]})})}function I(){const e=i(o=>o.messages),c=i(o=>o.conductorTyping),a=i(o=>o.connectionStatus),{t:n}=N(),{scrollRef:s}=C(),[u,x]=r.useState(1),d=r.useRef(null),p=r.useRef(0);r.useEffect(()=>{(a==="connecting"||e.length===0)&&x(1)},[a,e.length]);const b=D*u,m=Math.max(0,e.length-b),k=e.slice(m),t=m,g=r.useCallback(()=>{const o=s.current;o&&(d.current=o.scrollHeight-o.scrollTop),x(h=>h+1)},[s]);r.useLayoutEffect(()=>{if(d.current==null)return;if(m>=p.current){d.current=null,p.current=m;return}const o=s.current;o&&(o.scrollTop=o.scrollHeight-d.current),d.current=null,p.current=m},[m,s]),r.useEffect(()=>{p.current=m},[m]);const j=[...e].reverse().find(o=>o.role==="user"),y=o=>o>1e12?o:o*1e3,f=r.useRef(Date.now());return j!=null&&j.ts&&(f.current=y(j.ts)),a==="connecting"?l.jsx("div",{className:"collab-messages-area","data-slot":"collab-messages",children:l.jsxs("div",{className:"collab-connecting",children:[l.jsx("span",{className:"collab-connecting-dot"}),l.jsx("span",{children:n("status.connecting")})]})}):e.length===0?l.jsx("div",{className:"collab-messages-area","data-slot":"collab-messages",children:l.jsx("div",{className:"collab-empty",children:l.jsx("p",{children:n("collab.placeholder")})})}):l.jsx("div",{className:"collab-messages-area","data-slot":"collab-messages",ref:s,children:l.jsxs("div",{className:"collab-messages-scroll",children:[t>0&&l.jsxs("button",{type:"button","data-slot":"show-earlier-btn",onClick:g,children:["Show ",t," earlier"]}),k.map((o,h)=>l.jsx(P,{message:o},o.id||m+h)),c&&l.jsx(B,{since:f.current})]})})}function F(){const e=i(t=>t.sendMessage),c=i(t=>t.conductorTyping),a=i(t=>t.connectionStatus),n=i(t=>t.modelConfig),s=i(t=>t.runtimeModel),u=i(t=>t.loadModel),x=i(t=>t.selectModel),d=S(t=>t.defaultModelNo);r.useEffect(()=>{u()},[u]);const p=r.useCallback((t,g)=>{var f,o;const j=(f=g==null?void 0:g.files)==null?void 0:f.map(h=>({name:h.name,path:h.path})),y=(o=g==null?void 0:g.images)==null?void 0:o.map(h=>({name:h.name,path:h.path,base64:h.base64}));e(t,j,y)},[e]),b=r.useCallback(()=>{},[]),m=a!=="ready",k=(n==null?void 0:n.effective)??(n==null?void 0:n.configured)??d;return l.jsx("div",{className:"collab-composer-wrap","data-slot":"collab-composer","data-disabled":m||void 0,children:l.jsx(M,{onSend:p,onStop:b,isGenerating:c,hideStatusStack:!0,modelControl:l.jsx(T,{selectedNo:k,runningNo:s!=null&&s.running?s.effective:null,isRunning:!!(s!=null&&s.running),onSelect:x})})})}const H=[{key:"1",icon:"comment"},{key:"2",icon:"symbol-misc"},{key:"3",icon:"graph"},{key:"4",icon:"edit"}],L=["collab.chipProgress","collab.chipPause","collab.chipSummary"];function O({onChipClick:e}){const{t:c}=N();return l.jsxs("div",{className:"collab-welcome","data-slot":"collab-welcome",children:[l.jsx("h2",{className:"collab-welcome-title",children:c("collab.guideTitle")}),l.jsx("p",{className:"collab-welcome-sub",children:c("collab.guideWhen")}),l.jsx("div",{className:"collab-welcome-steps",children:H.map(a=>l.jsxs("div",{className:"collab-welcome-step",children:[l.jsx("span",{className:"collab-welcome-step-icon",children:l.jsx(v,{name:a.icon,size:"1rem"})}),l.jsxs("span",{className:"collab-welcome-step-text",children:[l.jsx("span",{className:"collabLine truncated
@@ -1,4 +1,4 @@
var an=Object.defineProperty;var nn=(r,e,t)=>e in r?an(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var nr=(r,e,t)=>nn(r,typeof e!="symbol"?e+"":e,t);import{bs as ir,g as sn,b as a0,aj as U}from"./tauri-compat-tfiFK9EG.js";import{M as ln,r as on,a as un,b as cn,p as hn,S as dn}from"./markdown-preprocess-Bvg4n8KE.js";import{Q as sr,S as mn,U as pn}from"./main-Knf6L_en.js";import"./index-Bpi3BHKj.js";import"./WindowsTitlebar-CrkUa1UM.js";var at={exports:{}},lr;function fn(){return lr||(lr=1,(function(r){var e=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};/** var an=Object.defineProperty;var nn=(r,e,t)=>e in r?an(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var nr=(r,e,t)=>nn(r,typeof e!="symbol"?e+"":e,t);import{bs as ir,g as sn,b as a0,aj as U}from"./tauri-compat-tfiFK9EG.js";import{M as ln,r as on,a as un,b as cn,p as hn,S as dn}from"./markdown-preprocess-6737_jWr.js";import{Q as sr,S as mn,U as pn}from"./main-BlLQtfpq.js";import"./index-Bpi3BHKj.js";import"./WindowsTitlebar-CrkUa1UM.js";var at={exports:{}},lr;function fn(){return lr||(lr=1,(function(r){var e=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};/**
* Prism: Lightweight, robust, elegant syntax highlighting * Prism: Lightweight, robust, elegant syntax highlighting
* *
* @license MIT <https://opensource.org/licenses/MIT> * @license MIT <https://opensource.org/licenses/MIT>
@@ -1,4 +1,4 @@
import{c as se,b as u,ax as Le,f as Ee,h as S,_ as K,i as oe,R as v,k as Te,ay as re,l as D,n as le,V as Oe,az as X,P as f,aj as i,ab as Me}from"./tauri-compat-tfiFK9EG.js";import{T as He,a as Ve,b as ce}from"./index-DwVcZP0M.js";import{_ as he,t as Fe,c as Pe,I as Ie,a as $e,u as Be,b as q,d as z,M as fe,e as xe,i as be,f as Y,E as ye,T as ee,g as Ae,h as de}from"./main-Knf6L_en.js";import{B as _,c as Q,I as Ke}from"./index-Bpi3BHKj.js";import{S as G}from"./index-D_sWIqse.js";import{I as ve}from"./IconFile-CgfQSwGI.js";import"./WindowsTitlebar-CrkUa1UM.js";function We(s){return u.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},s),u.createElement("path",{d:"M5 2.9a1 1 0 0 1 1.57-.82l13.23 9.1a1 1 0 0 1 0 1.64l-13.23 9.1A1 1 0 0 1 5 21.1V2.9Z",fill:"currentColor"}))}const we=se(We,"play");function Ue(s){return u.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},s),u.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 5.07c-.8.47-1.8.46-2.6 0l-.24-.15a1.4 1.4 0 0 0-1.82.29c-.64.82-1.16 1.73-1.55 2.7a1.4 1.4 0 0 0 .66 1.71l.24.14a2.57 2.57 0 0 1 0 4.48l-.24.14a1.4 1.4 0 0 0-.66 1.72 11.1 11.1 0 0 0 1.55 2.69 1.4 1.4 0 0 0 1.82.3l.25-.15a2.57 2.57 0 0 1 3.88 2.24v.28c-.01.7.46 1.33 1.16 1.43a11 11 0 0 0 3.1 0 1.4 1.4 0 0 0 1.17-1.43v-.28a2.57 2.57 0 0 1 3.87-2.24l.25.14c.6.36 1.38.26 1.82-.29.64-.82 1.16-1.73 1.55-2.7a1.4 1.4 0 0 0-.66-1.71l-.24-.14a2.57 2.57 0 0 1 0-4.48l.24-.14a1.4 1.4 0 0 0 .66-1.72 11.08 11.08 0 0 0-1.55-2.69 1.4 1.4 0 0 0-1.82-.3l-.25.15a2.57 2.57 0 0 1-3.88-2.24v-.28c.01-.7-.46-1.33-1.16-1.43a10.99 10.99 0 0 0-3.1 0c-.7.1-1.17.72-1.17 1.43v.28C9.3 3.75 8.8 4.61 8 5.07Zm6 10.4a4 4 0 1 0-4-6.93 4 4 0 0 0 4 6.92Z",fill:"currentColor"}))}const De=se(Ue,"setting");function qe(s){return u.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},s),u.createElement("path",{d:"M3 6a3 3 0 0 1 3-3h12a3 3 0 0 1 3 3v12a3 3 0 0 1-3 3H6a3 3 0 0 1-3-3V6Z",fill:"currentColor"}))}const Se=se(qe,"stop");let R=null;const ue={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0"},ge=s=>{Object.keys(ue).forEach(e=>{s.style.setProperty(e,ue[e],"important")})},pe=(s,e)=>{const t=s.scrollHeight;return e.sizingStyle.boxSizing==="border-box"?t+e.borderSize:t-e.paddingSize};function Ze(s,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1/0;R||(R=document.createElement("textarea"),R.setAttribute("tab-index","-1"),R.setAttribute("aria-hidden","true"),ge(R)),R.parentNode===null&&document.body.appendChild(R);const{paddingSize:a,borderSize:o,sizingStyle:r}=s,{boxSizing:l}=r;Object.keys(r).forEach(x=>{R.style[x]=r[x]}),ge(R),R.value=e;let c=pe(R,s);R.value="x";const g=pe(R,s)-a-o;let m=g*t;l==="border-box"&&(m=m+a+o),c=Math.max(m,c);let w=g*n;return l==="border-box"&&(w=w+a+o),c=Math.min(w,c),c}const Xe=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width"],Ye=s=>{const e=window.getComputedStyle(s);if(e===null)return null;const t=Le(e,Xe),{boxSizing:n}=t;if(n==="")return null;const a=parseFloat(t.paddingBottom)+parseFloat(t.paddingTop),o=parseFloat(t.borderBottomWidth)+parseFloat(t.borderTopWidth);return{sizingStyle:t,paddingSize:a,borderSize:o}};class ne extends Ee{static get textAreaDefaultAdapter(){return{notifyChange:S,setValue:S,toggleFocusing:S,toggleHovering:S,notifyFocus:S,notifyBlur:S,notifyKeyDown:S,notifyEnterPress:S}}constructor(e){super(Object.assign(Object.assign({},ne.textAreaDefaultAdapter),e)),this.compositionEnter=!1,this._changeValue=(t,n)=>{this._isControlledComponent()?this._adapter.notifyChange(t,n):(this._adapter.setValue(t),this._adapter.notifyChange(t,n))},this.getNextValue=t=>{const{maxLength:n,minLength:a,getValueLength:o}=this._adapter.getProps();return K(o)?n?this.handleVisibleMaxLength(t):(a&&this.handleVisibleMinLength(t),t):t},this.handleCompositionStart=t=>{this.compositionEnter=!0,this._adapter.notifyCompositionStart(t)},this.handleCompositionEnd=t=>{const{composition:n}=this._adapter.getProps(),a=t.target.value;if(this.compositionEnter=!1,this._adapter.notifyCompositionEnd(t),n){const c=this.getNextValue(a);this._changeValue(c,t);return}const{getValueLength:o,maxLength:r,minLength:l}=this.getProps();if(K(o)){if(r){const c=this.handleVisibleMaxLength(a);c!==a&&this._changeValue(c,t)}l&&this.handleVisibleMinLength(a)}},this.handleCompositionUpdate=t=>{this._adapter.notifyCompLine truncated import{c as se,b as u,ax as Le,f as Ee,h as S,_ as K,i as oe,R as v,k as Te,ay as re,l as D,n as le,V as Oe,az as X,P as f,aj as i,ab as Me}from"./tauri-compat-tfiFK9EG.js";import{T as He,a as Ve,b as ce}from"./index-CPxjSju3.js";import{_ as de,t as Fe,c as Pe,I as Ie,a as Be,u as $e,b as q,d as z,M as fe,e as be,i as xe,f as Y,E as ye,T as ee,g as Ae,h as he}from"./main-BlLQtfpq.js";import{B as _,c as Q,I as Ke}from"./index-Bpi3BHKj.js";import{S as G}from"./index-D_sWIqse.js";import{I as ve}from"./IconFile-CgfQSwGI.js";import"./WindowsTitlebar-CrkUa1UM.js";function We(s){return u.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},s),u.createElement("path",{d:"M5 2.9a1 1 0 0 1 1.57-.82l13.23 9.1a1 1 0 0 1 0 1.64l-13.23 9.1A1 1 0 0 1 5 21.1V2.9Z",fill:"currentColor"}))}const we=se(We,"play");function Ue(s){return u.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},s),u.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 5.07c-.8.47-1.8.46-2.6 0l-.24-.15a1.4 1.4 0 0 0-1.82.29c-.64.82-1.16 1.73-1.55 2.7a1.4 1.4 0 0 0 .66 1.71l.24.14a2.57 2.57 0 0 1 0 4.48l-.24.14a1.4 1.4 0 0 0-.66 1.72 11.1 11.1 0 0 0 1.55 2.69 1.4 1.4 0 0 0 1.82.3l.25-.15a2.57 2.57 0 0 1 3.88 2.24v.28c-.01.7.46 1.33 1.16 1.43a11 11 0 0 0 3.1 0 1.4 1.4 0 0 0 1.17-1.43v-.28a2.57 2.57 0 0 1 3.87-2.24l.25.14c.6.36 1.38.26 1.82-.29.64-.82 1.16-1.73 1.55-2.7a1.4 1.4 0 0 0-.66-1.71l-.24-.14a2.57 2.57 0 0 1 0-4.48l.24-.14a1.4 1.4 0 0 0 .66-1.72 11.08 11.08 0 0 0-1.55-2.69 1.4 1.4 0 0 0-1.82-.3l-.25.15a2.57 2.57 0 0 1-3.88-2.24v-.28c.01-.7-.46-1.33-1.16-1.43a10.99 10.99 0 0 0-3.1 0c-.7.1-1.17.72-1.17 1.43v.28C9.3 3.75 8.8 4.61 8 5.07Zm6 10.4a4 4 0 1 0-4-6.93 4 4 0 0 0 4 6.92Z",fill:"currentColor"}))}const De=se(Ue,"setting");function qe(s){return u.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},s),u.createElement("path",{d:"M3 6a3 3 0 0 1 3-3h12a3 3 0 0 1 3 3v12a3 3 0 0 1-3 3H6a3 3 0 0 1-3-3V6Z",fill:"currentColor"}))}const Se=se(qe,"stop");let R=null;const ue={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0"},ge=s=>{Object.keys(ue).forEach(e=>{s.style.setProperty(e,ue[e],"important")})},pe=(s,e)=>{const t=s.scrollHeight;return e.sizingStyle.boxSizing==="border-box"?t+e.borderSize:t-e.paddingSize};function Ze(s,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1/0;R||(R=document.createElement("textarea"),R.setAttribute("tab-index","-1"),R.setAttribute("aria-hidden","true"),ge(R)),R.parentNode===null&&document.body.appendChild(R);const{paddingSize:a,borderSize:o,sizingStyle:r}=s,{boxSizing:l}=r;Object.keys(r).forEach(b=>{R.style[b]=r[b]}),ge(R),R.value=e;let c=pe(R,s);R.value="x";const g=pe(R,s)-a-o;let m=g*t;l==="border-box"&&(m=m+a+o),c=Math.max(m,c);let w=g*n;return l==="border-box"&&(w=w+a+o),c=Math.min(w,c),c}const Xe=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width"],Ye=s=>{const e=window.getComputedStyle(s);if(e===null)return null;const t=Le(e,Xe),{boxSizing:n}=t;if(n==="")return null;const a=parseFloat(t.paddingBottom)+parseFloat(t.paddingTop),o=parseFloat(t.borderBottomWidth)+parseFloat(t.borderTopWidth);return{sizingStyle:t,paddingSize:a,borderSize:o}};class ne extends Ee{static get textAreaDefaultAdapter(){return{notifyChange:S,setValue:S,toggleFocusing:S,toggleHovering:S,notifyFocus:S,notifyBlur:S,notifyKeyDown:S,notifyEnterPress:S}}constructor(e){super(Object.assign(Object.assign({},ne.textAreaDefaultAdapter),e)),this.compositionEnter=!1,this._changeValue=(t,n)=>{this._isControlledComponent()?this._adapter.notifyChange(t,n):(this._adapter.setValue(t),this._adapter.notifyChange(t,n))},this.getNextValue=t=>{const{maxLength:n,minLength:a,getValueLength:o}=this._adapter.getProps();return K(o)?n?this.handleVisibleMaxLength(t):(a&&this.handleVisibleMinLength(t),t):t},this.handleCompositionStart=t=>{this.compositionEnter=!0,this._adapter.notifyCompositionStart(t)},this.handleCompositionEnd=t=>{const{composition:n}=this._adapter.getProps(),a=t.target.value;if(this.compositionEnter=!1,this._adapter.notifyCompositionEnd(t),n){const c=this.getNextValue(a);this._changeValue(c,t);return}const{getValueLength:o,maxLength:r,minLength:l}=this.getProps();if(K(o)){if(r){const c=this.handleVisibleMaxLength(a);c!==a&&this._changeValue(c,t)}l&&this.handleVisibleMinLength(a)}},this.handleCompositionUpdate=t=>{this._adapter.notifyCompLine truncated
`):[""],m=D(`${y}-textarea-lineNumber`,n),w=c?this.getTextareaLineHeightPx(c):21,x=Object.assign(Object.assign({},a||{}),{height:l?`${l}px`:void 0,maxHeight:l?`${l}px`:void 0});return v.createElement("div",{ref:this.lineNumberRef,className:m,style:x},g.map((E,C)=>{const k=c?this.calculateWrappedLines(E,c):1;return v.createElement("div",{key:C,className:`${y}-textarea-lineNumber-item`,style:{minHeight:`${k*w}px`,lineHeight:`${w}px`}},t+C)}))}render(){const e=this.props,{autosize:t,placeholder:n,onEnterPress:a,onResize:o,resize:r,disabled:l,readonly:c,className:g,showCounter:m,validateStatus:w,maxCount:x,defaultValue:E,style:C,textareaStyle:k,forwardRef:T,getValueLength:H,maxLength:p,minLength:N,showClear:O,borderless:L,autoFocus:I,showLineNumber:h,lineNumberStart:d,lineNumberClassName:b,lineNumberStyle:M,composition:U}=e,$=Qe(e,["autosize","placeholder","onEnterPress","onResize","resize","disabled","readonly","className","showCounter","validateStatus","maxCount","defaultValue","style","textareaStyle","forwardRef","getValueLength","maxLength","minLength","showClear","borderless","autoFocus","showLineNumber","lineNumberStart","lineNumberClassName","lineNumberStyle","composition"]),{isFocus:Z,value:B,minLength:F}=this.state,A=!le(r),je=!t&&A&&["horizontal","both","inline"].includes(r),Re=!t&&A&&["vertical","both","block"].includes(r),_e=D(g,`${y}-textarea-wrapper`,{[`${y}-textarea-borderless`]:L,[`${y}-textarea-wrapper-disabled`]:l,[`${y}-textarea-wrapper-readonly`]:c,[`${y}-textarea-wrapper-${w}`]:!!w,[`${y}-textarea-wrapper-focus`]:Z,[`${y}-textarea-wrapper-withLineNumber`]:h,[`${y}-textarea-wrapper-resizeX`]:je,[`${y}-textarea-wrapper-resizeY`]:Re}),ke=D(`${y}-textarea`,{[`${y}-textarea-disabled`]:l,[`${y}-textarea-readonly`]:c,[`${y}-textarea-autosize`]:$e(t)?le(t==null?void 0:t.maxRows):t,[`${y}-textarea-showClear`]:O}),J=Object.assign({},k||{});t?J.resize="none":A&&(J.resize=r);const ie=!t&&A&&r&&r!=="none",V=Object.assign(Object.assign({},Oe($,"insetLabel","insetLabelId","getValueLength","onClear","showClear","disabledEnterStartNewLine","composition")),{style:J,autoFocus:I||this.props.autofocus,className:ke,disabled:l,readOnly:c,placeholder:n||null,onChange:j=>this.foundation.handleChange(j.target.value,j),onFocus:j=>this.foundation.handleFocus(j),onBlur:j=>this.foundation.handleBlur(j.nativeEvent),onKeyDown:j=>this.foundation.handleKeyDown(j),onScroll:this.handleTextAreaScroll,value:B??"",onCompositionStart:this.foundation.handleCompositionStart,onCompositionEnd:this.foundation.handleCompositionEnd,onCompositionUpdate:this.foundation.handleCompositionUpdate});return K(H)||(V.maxLength=p),F&&(V.minLength=F),v.createElement("div",{className:_e,style:C,onMouseEnter:j=>this.foundation.handleMouseEnter(j),onMouseLeave:j=>this.foundation.handleMouseLeave(j),onClick:j=>this.handleClick(j)},this.renderLineNumbers(),h?v.createElement("div",{className:`${y}-textarea-content`},t?v.createElement(X,{onResize:this.throttledResizeTextarea},v.createElement("textarea",Object.assign({},V,{ref:this.setRef}))):ie?v.createElement(X,{onResize:this.throttledNotifyNativeResize},v.createElement("textarea",Object.assign({},V,{ref:this.setRef}))):v.createElement("textarea",Object.assign({},V,{ref:this.setRef}))):t?v.createElement(X,{onResize:this.throttledResizeTextarea},v.createElement("textarea",Object.assign({},V,{ref:this.setRef}))):ie?v.createElement(X,{onResize:this.throttledNotifyNativeResize},v.createElement("textarea",Object.assign({},V,{ref:this.setRef}))):v.createElement("textarea",Object.assign({},V,{ref:this.setRef})),this.renderClearBtn(),this.renderCounter())}}ae.propTypes={autosize:f.oneOfType([f.bool,f.object]),borderless:f.bool,placeholder:f.string,value:f.string,rows:f.number,cols:f.number,maxCount:f.number,onEnterPress:f.func,validateStatus:f.string,className:f.string,style:f.object,textareaStyle:f.object,showClear:f.bool,onClear:f.func,onResize:f.func,onCompositionStart:f.func,onCompositionEnd:f.func,onCompositionUpdate:f.func,getValueLength:f.func,disabledEnterStartNewLine:f.bool,composition:f.bool,showLineNumber:f.bool,lineNumberStart:f.number,lineNumberClassName:f.string,lineNumberStyle:f.object,resize:f.oneOf(["none","both","horizontal","vertical","block","inline"])};ae.defaultProps={autosize:!1,borderless:!1,rows:4,cols:20,showCounter:!1,showClear:!1,onEnterPress:S,onChange:S,onBlur:S,onFocus:S,onKeyDown:S,onResize:S,onClear:S,onCompositionStart:S,onCompositionEnd:S,onCompositionUpdate:S,composition:!1,showLineNumber:!1,lineNumberStart:1};const Ge=v.forwardRef((s,e)=>v.createElement(ae,Object.assign({},s,{forwardRef:e})));function Je({lines:s,emptyLabel:e="No logs",className:t}){const n=u.useRef(null),a=u.useRef(!0),[o,r]=u.useState(!1);u.useEffect(()=>{const g=n.current;g&&a.current&&(g.scrollTop=g.scrollHeight)},[s]);const l=u.useCallback(g=>{const m=g.currentTarget;a.current=m.scrollHeight-m.scrollTop-m.clientHeight<24},[]),c=u.useCallback(()=>{s!=null&&s.length&&navigator.clipboard.writeText(s.join( Line truncated `):[""],m=D(`${y}-textarea-lineNumber`,n),w=c?this.getTextareaLineHeightPx(c):21,b=Object.assign(Object.assign({},a||{}),{height:l?`${l}px`:void 0,maxHeight:l?`${l}px`:void 0});return v.createElement("div",{ref:this.lineNumberRef,className:m,style:b},g.map((E,C)=>{const k=c?this.calculateWrappedLines(E,c):1;return v.createElement("div",{key:C,className:`${y}-textarea-lineNumber-item`,style:{minHeight:`${k*w}px`,lineHeight:`${w}px`}},t+C)}))}render(){const e=this.props,{autosize:t,placeholder:n,onEnterPress:a,onResize:o,resize:r,disabled:l,readonly:c,className:g,showCounter:m,validateStatus:w,maxCount:b,defaultValue:E,style:C,textareaStyle:k,forwardRef:T,getValueLength:H,maxLength:p,minLength:N,showClear:O,borderless:L,autoFocus:I,showLineNumber:d,lineNumberStart:h,lineNumberClassName:x,lineNumberStyle:M,composition:U}=e,B=Qe(e,["autosize","placeholder","onEnterPress","onResize","resize","disabled","readonly","className","showCounter","validateStatus","maxCount","defaultValue","style","textareaStyle","forwardRef","getValueLength","maxLength","minLength","showClear","borderless","autoFocus","showLineNumber","lineNumberStart","lineNumberClassName","lineNumberStyle","composition"]),{isFocus:Z,value:$,minLength:F}=this.state,A=!le(r),je=!t&&A&&["horizontal","both","inline"].includes(r),Re=!t&&A&&["vertical","both","block"].includes(r),_e=D(g,`${y}-textarea-wrapper`,{[`${y}-textarea-borderless`]:L,[`${y}-textarea-wrapper-disabled`]:l,[`${y}-textarea-wrapper-readonly`]:c,[`${y}-textarea-wrapper-${w}`]:!!w,[`${y}-textarea-wrapper-focus`]:Z,[`${y}-textarea-wrapper-withLineNumber`]:d,[`${y}-textarea-wrapper-resizeX`]:je,[`${y}-textarea-wrapper-resizeY`]:Re}),ke=D(`${y}-textarea`,{[`${y}-textarea-disabled`]:l,[`${y}-textarea-readonly`]:c,[`${y}-textarea-autosize`]:Be(t)?le(t==null?void 0:t.maxRows):t,[`${y}-textarea-showClear`]:O}),J=Object.assign({},k||{});t?J.resize="none":A&&(J.resize=r);const ie=!t&&A&&r&&r!=="none",V=Object.assign(Object.assign({},Oe(B,"insetLabel","insetLabelId","getValueLength","onClear","showClear","disabledEnterStartNewLine","composition")),{style:J,autoFocus:I||this.props.autofocus,className:ke,disabled:l,readOnly:c,placeholder:n||null,onChange:j=>this.foundation.handleChange(j.target.value,j),onFocus:j=>this.foundation.handleFocus(j),onBlur:j=>this.foundation.handleBlur(j.nativeEvent),onKeyDown:j=>this.foundation.handleKeyDown(j),onScroll:this.handleTextAreaScroll,value:$??"",onCompositionStart:this.foundation.handleCompositionStart,onCompositionEnd:this.foundation.handleCompositionEnd,onCompositionUpdate:this.foundation.handleCompositionUpdate});return K(H)||(V.maxLength=p),F&&(V.minLength=F),v.createElement("div",{className:_e,style:C,onMouseEnter:j=>this.foundation.handleMouseEnter(j),onMouseLeave:j=>this.foundation.handleMouseLeave(j),onClick:j=>this.handleClick(j)},this.renderLineNumbers(),d?v.createElement("div",{className:`${y}-textarea-content`},t?v.createElement(X,{onResize:this.throttledResizeTextarea},v.createElement("textarea",Object.assign({},V,{ref:this.setRef}))):ie?v.createElement(X,{onResize:this.throttledNotifyNativeResize},v.createElement("textarea",Object.assign({},V,{ref:this.setRef}))):v.createElement("textarea",Object.assign({},V,{ref:this.setRef}))):t?v.createElement(X,{onResize:this.throttledResizeTextarea},v.createElement("textarea",Object.assign({},V,{ref:this.setRef}))):ie?v.createElement(X,{onResize:this.throttledNotifyNativeResize},v.createElement("textarea",Object.assign({},V,{ref:this.setRef}))):v.createElement("textarea",Object.assign({},V,{ref:this.setRef})),this.renderClearBtn(),this.renderCounter())}}ae.propTypes={autosize:f.oneOfType([f.bool,f.object]),borderless:f.bool,placeholder:f.string,value:f.string,rows:f.number,cols:f.number,maxCount:f.number,onEnterPress:f.func,validateStatus:f.string,className:f.string,style:f.object,textareaStyle:f.object,showClear:f.bool,onClear:f.func,onResize:f.func,onCompositionStart:f.func,onCompositionEnd:f.func,onCompositionUpdate:f.func,getValueLength:f.func,disabledEnterStartNewLine:f.bool,composition:f.bool,showLineNumber:f.bool,lineNumberStart:f.number,lineNumberClassName:f.string,lineNumberStyle:f.object,resize:f.oneOf(["none","both","horizontal","vertical","block","inline"])};ae.defaultProps={autosize:!1,borderless:!1,rows:4,cols:20,showCounter:!1,showClear:!1,onEnterPress:S,onChange:S,onBlur:S,onFocus:S,onKeyDown:S,onResize:S,onClear:S,onCompositionStart:S,onCompositionEnd:S,onCompositionUpdate:S,composition:!1,showLineNumber:!1,lineNumberStart:1};const Ge=v.forwardRef((s,e)=>v.createElement(ae,Object.assign({},s,{forwardRef:e})));function Je({lines:s,emptyLabel:e="No logs",className:t}){const n=u.useRef(null),a=u.useRef(!0),[o,r]=u.useState(!1);u.useEffect(()=>{const g=n.current;g&&a.current&&(g.scrollTop=g.scrollHeight)},[s]);const l=u.useCallback(g=>{const m=g.currentTarget;a.current=m.scrollHeight-m.scrollTop-m.clientHeight<24},[]),c=u.useCallback(()=>{s!=null&&s.length&&navigator.clipboard.writeText(s.join( Line truncated
`)).then(()=>{r(!0),setTimeout(()=>r(!1),1500)})},[s]);return i.jsxs("div",{className:`ga-log-tail ${t??""}`,children:[i.jsx("button",{type:"button",className:`ga-log-tail-copy ${o?"copied":""}`,onClick:c,title:"Copy",children:o?"✓":"⎘"}),i.jsx("div",{ref:n,className:"ga-log-tail-scroll",onScroll:l,children:s===null?i.jsx("p",{className:"ga-log-tail-empty",children:"…"}):s.length===0?i.jsx("p",{className:"ga-log-tail-empty",children:e}):i.jsx("pre",{className:"ga-log-tail-pre",children:s.map((g,m)=>i.jsxs("span",{className:g.startsWith("=====")?"ga-log-separator":void 0,children:[g,` `)).then(()=>{r(!0),setTimeout(()=>r(!1),1500)})},[s]);return i.jsxs("div",{className:`ga-log-tail ${t??""}`,children:[i.jsx("button",{type:"button",className:`ga-log-tail-copy ${o?"copied":""}`,onClick:c,title:"Copy",children:o?"✓":"⎘"}),i.jsx("div",{ref:n,className:"ga-log-tail-scroll",onScroll:l,children:s===null?i.jsx("p",{className:"ga-log-tail-empty",children:"…"}):s.length===0?i.jsx("p",{className:"ga-log-tail-empty",children:e}):i.jsx("pre",{className:"ga-log-tail-pre",children:s.map((g,m)=>i.jsxs("span",{className:g.startsWith("=====")?"ga-log-separator":void 0,children:[g,`
`]},m))})})]})}function Ce(s,e){Be.getState().notify({kind:e,message:s})}function W(s){Ce(s,"error")}function P(s){Ce(s,"success")}const et=3e3;function ze({serviceId:s,onClose:e}){const{t}=q(),n=z(c=>c.fetchLogs),[a,o]=u.useState(null),r=u.useRef(null),l=u.useCallback(async()=>{if(!s)return;const c=await n(s);o(c)},[s,n]);return u.useEffect(()=>(s&&(o(null),l(),r.current=setInterval(l,et)),()=>{r.current&&(clearInterval(r.current),r.current=null)}),[s,l]),i.jsx(fe,{title:t("modal.channelLogs"),visible:s!==null,onCancel:e,footer:null,width:870,centered:!0,closeOnEsc:!0,className:"ga-log-dialog",children:a===null?i.jsx("div",{className:"ga-services-loading",style:{padding:24},children:i.jsx(G,{})}):i.jsx(Je,{lines:a,emptyLabel:t("ch.logEmpty"),className:"ga-log-modal-body"})})}function tt({visible:s,onClose:e}){const{t}=q(),n=z(x=>x.fetchMykey),a=z(x=>x.saveMykey),o=z(x=>x.mykeyContent),r=z(x=>x.mykeyLoading),[l,c]=u.useState(""),[g,m]=u.useState(!1);u.useEffect(()=>{s&&n()},[s,n]),u.useEffect(()=>{c(o)},[o]);const w=async()=>{m(!0);const x=await a(l);m(!1),x?(P(t("sys.configSaved")),e()):W(t("err.mykeyExport"))};return i.jsx(fe,{title:t("modal.mykeyConfig"),visible:s,onCancel:e,width:870,centered:!0,closeOnEsc:!0,className:"ga-settings-dialog",footer:i.jsxs("div",{style:{display:"flex",gap:8,justifyContent:"flex-end",padding:"8px 0"},children:[i.jsx(_,{onClick:e,children:t("common.cancel")}),i.jsx(_,{type:"primary",loading:g,onClick:w,children:t("common.save")})]}),children:r?i.jsx("div",{className:"ga-services-loading",children:i.jsx(G,{})}):i.jsx(Ge,{value:l,onChange:x=>c(x),autosize:{minRows:16,maxRows:30},style:{fontFamily:"var(--font-mono)",fontSize:13}})})}const st="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eTencent%20QQ%3c/title%3e%3cpath%20d='M21.395%2015.035a40%2040%200%200%200-.803-2.264l-1.079-2.695c.001-.032.014-.562.014-.836C19.526%204.632%2017.351%200%2012%200S4.474%204.632%204.474%209.241c0%20.274.013.804.014.836l-1.08%202.695a39%2039%200%200%200-.802%202.264c-1.021%203.283-.69%204.643-.438%204.673.54.065%202.103-2.472%202.103-2.472%200%201.469.756%203.387%202.394%204.771-.612.188-1.363.479-1.845.835-.434.32-.379.646-.301.778.343.578%205.883.369%207.482.189%201.6.18%207.14.389%207.483-.189.078-.132.132-.458-.301-.778-.483-.356-1.233-.646-1.846-.836%201.637-1.384%202.393-3.302%202.393-4.771%200%200%201.563%202.537%202.103%202.472.251-.03.581-1.39-.438-4.673'/%3e%3c/svg%3e",nt="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eWeChat%3c/title%3e%3cpath%20d='M8.691%202.188C3.891%202.188%200%205.476%200%209.53c0%202.212%201.17%204.203%203.002%205.55a.59.59%200%200%201%20.213.665l-.39%201.48c-.019.07-.048.141-.048.213%200%20.163.13.295.29.295a.326.326%200%200%200%20.167-.054l1.903-1.114a.864.864%200%200%201%20.717-.098%2010.16%2010.16%200%200%200%202.837.403c.276%200%20.543-.027.811-.05-.857-2.578.157-4.972%201.932-6.446%201.703-1.415%203.882-1.98%205.853-1.838-.576-3.583-4.196-6.348-8.596-6.348zM5.785%205.991c.642%200%201.162.529%201.162%201.18a1.17%201.17%200%200%201-1.162%201.178A1.17%201.17%200%200%201%204.623%207.17c0-.651.52-1.18%201.162-1.18zm5.813%200c.642%200%201.162.529%201.162%201.18a1.17%201.17%200%200%201-1.162%201.178%201.17%201.17%200%200%201-1.162-1.178c0-.651.52-1.18%201.162-1.18zm5.34%202.867c-1.797-.052-3.746.512-5.28%201.786-1.72%201.428-2.687%203.72-1.78%206.22.942%202.453%203.666%204.229%206.884%204.229.826%200%201.622-.12%202.361-.336a.722.722%200%200%201%20.598.082l1.584.926a.272.272%200%200%200%20.14.047c.134%200%20.24-.111.24-.247%200-.06-.023-.12-.038-.177l-.327-1.233a.582.582%200%200%201-.023-.156.49.49%200%200%201%20.201-.398C23.024%2018.48%2024%2016.82%2024%2014.98c0-3.21-2.931-5.837-6.656-6.088V8.89c-.135-.01-.27-.027-.407-.03zm-2.53%203.274c.535%200%20.969.44.969.982a.976.976%200%200%201-.969.983.976.976%200%200%201-.969-.983c0-.542.434-.982.97-.982zm4.844%200c.535%200%20.969.44.969.982a.976.976%200%200%201-.969.983.976.976%200%200%201-.969-.983c0-.542.434-.982.969-.982z'/%3e%3c/svg%3e",at="data:image/svg+xml,%3csvg%20width='46'%20height='46'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_338_13245)'%3e%3cpath%20d='M39.743%200H6.257A6.257%206.257%200%200%200%200%206.257v33.487A6.257%206.257%200%200%200%206.257%2046h33.487A6.257%206.257%200%200%200%2046%2039.743V6.257A6.257%206.257%200%200%200%2039.743%200'%20fill='%23fff'/%3e%3cmask%20id='mask0_338_13245'%20style='mask-type:luminance'%20maskUnits='userSpaceOnUse'%20x='5'%20y='8'%20width='36'%20height='30'%3e%3cpath%20d='M40.514%208.373H5.484v29.262h35.03z'%20fill='%23fff'/%3e%3c/mask%3e%3cg%20mask='url(%23mask0_338_13245)'%3e%3cpath%20d='M28.856%2031.647a.483.483%200%200%200%20.06.738%206.2%206.2%200%200%201%201.911%203.725%202.02%202.02%200%201%200%202.16-2.54%206.2%206.2%200%200%201-3.448-1.922.483.483%200%200%200-.683-.001'%20fill='%23fb Line truncated `]},m))})})]})}function Ce(s,e){$e.getState().notify({kind:e,message:s})}function W(s){Ce(s,"error")}function P(s){Ce(s,"success")}const et=3e3;function ze({serviceId:s,onClose:e}){const{t}=q(),n=z(c=>c.fetchLogs),[a,o]=u.useState(null),r=u.useRef(null),l=u.useCallback(async()=>{if(!s)return;const c=await n(s);o(c)},[s,n]);return u.useEffect(()=>(s&&(o(null),l(),r.current=setInterval(l,et)),()=>{r.current&&(clearInterval(r.current),r.current=null)}),[s,l]),i.jsx(fe,{title:t("modal.channelLogs"),visible:s!==null,onCancel:e,footer:null,width:870,centered:!0,closeOnEsc:!0,className:"ga-log-dialog",children:a===null?i.jsx("div",{className:"ga-services-loading",style:{padding:24},children:i.jsx(G,{})}):i.jsx(Je,{lines:a,emptyLabel:t("ch.logEmpty"),className:"ga-log-modal-body"})})}function tt({visible:s,onClose:e}){const{t}=q(),n=z(b=>b.fetchMykey),a=z(b=>b.saveMykey),o=z(b=>b.mykeyContent),r=z(b=>b.mykeyLoading),[l,c]=u.useState(""),[g,m]=u.useState(!1);u.useEffect(()=>{s&&n()},[s,n]),u.useEffect(()=>{c(o)},[o]);const w=async()=>{m(!0);const b=await a(l);m(!1),b?(P(t("sys.configSaved")),e()):W(t("err.mykeyExport"))};return i.jsx(fe,{title:t("modal.mykeyConfig"),visible:s,onCancel:e,width:870,centered:!0,closeOnEsc:!0,className:"ga-settings-dialog",footer:i.jsxs("div",{style:{display:"flex",gap:8,justifyContent:"flex-end",padding:"8px 0"},children:[i.jsx(_,{onClick:e,children:t("common.cancel")}),i.jsx(_,{type:"primary",loading:g,onClick:w,children:t("common.save")})]}),children:r?i.jsx("div",{className:"ga-services-loading",children:i.jsx(G,{})}):i.jsx(Ge,{value:l,onChange:b=>c(b),autosize:{minRows:16,maxRows:30},style:{fontFamily:"var(--font-mono)",fontSize:13}})})}const st="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eTencent%20QQ%3c/title%3e%3cpath%20d='M21.395%2015.035a40%2040%200%200%200-.803-2.264l-1.079-2.695c.001-.032.014-.562.014-.836C19.526%204.632%2017.351%200%2012%200S4.474%204.632%204.474%209.241c0%20.274.013.804.014.836l-1.08%202.695a39%2039%200%200%200-.802%202.264c-1.021%203.283-.69%204.643-.438%204.673.54.065%202.103-2.472%202.103-2.472%200%201.469.756%203.387%202.394%204.771-.612.188-1.363.479-1.845.835-.434.32-.379.646-.301.778.343.578%205.883.369%207.482.189%201.6.18%207.14.389%207.483-.189.078-.132.132-.458-.301-.778-.483-.356-1.233-.646-1.846-.836%201.637-1.384%202.393-3.302%202.393-4.771%200%200%201.563%202.537%202.103%202.472.251-.03.581-1.39-.438-4.673'/%3e%3c/svg%3e",nt="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eWeChat%3c/title%3e%3cpath%20d='M8.691%202.188C3.891%202.188%200%205.476%200%209.53c0%202.212%201.17%204.203%203.002%205.55a.59.59%200%200%201%20.213.665l-.39%201.48c-.019.07-.048.141-.048.213%200%20.163.13.295.29.295a.326.326%200%200%200%20.167-.054l1.903-1.114a.864.864%200%200%201%20.717-.098%2010.16%2010.16%200%200%200%202.837.403c.276%200%20.543-.027.811-.05-.857-2.578.157-4.972%201.932-6.446%201.703-1.415%203.882-1.98%205.853-1.838-.576-3.583-4.196-6.348-8.596-6.348zM5.785%205.991c.642%200%201.162.529%201.162%201.18a1.17%201.17%200%200%201-1.162%201.178A1.17%201.17%200%200%201%204.623%207.17c0-.651.52-1.18%201.162-1.18zm5.813%200c.642%200%201.162.529%201.162%201.18a1.17%201.17%200%200%201-1.162%201.178%201.17%201.17%200%200%201-1.162-1.178c0-.651.52-1.18%201.162-1.18zm5.34%202.867c-1.797-.052-3.746.512-5.28%201.786-1.72%201.428-2.687%203.72-1.78%206.22.942%202.453%203.666%204.229%206.884%204.229.826%200%201.622-.12%202.361-.336a.722.722%200%200%201%20.598.082l1.584.926a.272.272%200%200%200%20.14.047c.134%200%20.24-.111.24-.247%200-.06-.023-.12-.038-.177l-.327-1.233a.582.582%200%200%201-.023-.156.49.49%200%200%201%20.201-.398C23.024%2018.48%2024%2016.82%2024%2014.98c0-3.21-2.931-5.837-6.656-6.088V8.89c-.135-.01-.27-.027-.407-.03zm-2.53%203.274c.535%200%20.969.44.969.982a.976.976%200%200%201-.969.983.976.976%200%200%201-.969-.983c0-.542.434-.982.97-.982zm4.844%200c.535%200%20.969.44.969.982a.976.976%200%200%201-.969.983.976.976%200%200%201-.969-.983c0-.542.434-.982.969-.982z'/%3e%3c/svg%3e",at="data:image/svg+xml,%3csvg%20width='46'%20height='46'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_338_13245)'%3e%3cpath%20d='M39.743%200H6.257A6.257%206.257%200%200%200%200%206.257v33.487A6.257%206.257%200%200%200%206.257%2046h33.487A6.257%206.257%200%200%200%2046%2039.743V6.257A6.257%206.257%200%200%200%2039.743%200'%20fill='%23fff'/%3e%3cmask%20id='mask0_338_13245'%20style='mask-type:luminance'%20maskUnits='userSpaceOnUse'%20x='5'%20y='8'%20width='36'%20height='30'%3e%3cpath%20d='M40.514%208.373H5.484v29.262h35.03z'%20fill='%23fff'/%3e%3c/mask%3e%3cg%20mask='url(%23mask0_338_13245)'%3e%3cpath%20d='M28.856%2031.647a.483.483%200%200%200%20.06.738%206.2%206.2%200%200%201%201.911%203.725%202.02%202.02%200%201%200%202.16-2.54%206.2%206.2%200%200%201-3.448-1.922.483.483%200%200%200-.683-.001'%20fill='%23fb Line truncated
@@ -1 +1 @@
import{b as s,aj as r}from"./tauri-compat-tfiFK9EG.js";import{M as o,S as m,r as t,a as e,b as n,p}from"./markdown-preprocess-Bvg4n8KE.js";import{S as i,U as c}from"./main-Knf6L_en.js";import"./index-Bpi3BHKj.js";import"./WindowsTitlebar-CrkUa1UM.js";const u={...c},O=s.memo(function({content:a}){return r.jsx("div",{"data-slot":"summary-block",children:r.jsx(o,{remarkPlugins:[e,n],rehypePlugins:[[t,u]],components:m,urlTransform:i,children:p(a)})})});export{O as SummaryPart}; import{b as s,aj as r}from"./tauri-compat-tfiFK9EG.js";import{M as o,S as m,r as t,a as e,b as n,p}from"./markdown-preprocess-6737_jWr.js";import{S as i,U as c}from"./main-BlLQtfpq.js";import"./index-Bpi3BHKj.js";import"./WindowsTitlebar-CrkUa1UM.js";const u={...c},O=s.memo(function({content:a}){return r.jsx("div",{"data-slot":"summary-block",children:r.jsx(o,{remarkPlugins:[e,n],rehypePlugins:[[t,u]],components:m,urlTransform:i,children:p(a)})})});export{O as SummaryPart};
@@ -1,2 +1,2 @@
import{aA as F,aB as L,aC as ee,aD as ze,aE as Xe,aF as wt,aG as Vr,c as Dt,b as J,aH as Br,aI as Gr,B,d as Yi,e as Li,x as $i,aJ as Hi,g as ia,aK as Ui,_ as st,f as He,ae as Be,w as qi,i as Wi,aL as De,N as oe,j as ji,R as b,k as Ue,l as Y,P as p,q as We,h as Q,aM as Vi,aN as Bi,M as K,aO as Gi,aP as zi,ay as Xi,X as zr,T as Zi,O as Xr,s as Qi,aQ as Ki,ax as Ji,aj as A}from"./tauri-compat-tfiFK9EG.js";import{_ as es,c as M,V as ts,i as Sn,d as ns,e as Et,I as Zr,f as as,r as rs,g as rt,h as Un,j as Qn,k as is,l as ss,T as os,a as us,b as Ta}from"./index-DwVcZP0M.js";import{s as Qr,a as Kr,F as gt,I as ls,j as cs,k as ds,B as Jr,C as fs,l as hs,m as wa,b as lt,n as ps,T as ms,E as ei,g as gs}from"./main-Knf6L_en.js";import{a as pt,B as yt}from"./index-Bpi3BHKj.js";import{A as vs}from"./Animation-TKQfYYOo.js";import{B as Da}from"./index-DpGuh58E.js";import{S as ys}from"./index-D_sWIqse.js";import"./WindowsTitlebar-CrkUa1UM.js";function Le(s,e){F(2,arguments);var t=L(s),n=ee(e);if(isNaN(n))return new Date(NaN);if(!n)return t;var a=t.getDate(),i=new Date(t.getTime());i.setMonth(t.getMonth()+n+1,0);var r=i.getDate();return a>=r?i:(t.setFullYear(i.getFullYear(),i.getMonth(),a),t)}function Ts(s,e){F(2,arguments);var t=L(s).getTime(),n=ee(e);return new Date(t+n)}function ti(s){var e=new Date(Date.UTC(s.getFullYear(),s.getMonth(),s.getDate(),s.getHours(),s.getMinutes(),s.getSeconds(),s.getMilliseconds()));return e.setUTCFullYear(s.getFullYear()),s.getTime()-e.getTime()}function Kn(s){F(1,arguments);var e=L(s);return e.setHours(0,0,0,0),e}function xn(s,e){F(2,arguments);var t=ee(e);return Le(s,t*12)}var sa=6e4,oa=36e5,ws=1e3;function ua(s,e){F(2,arguments);var t=Kn(s),n=Kn(e);return t.getTime()===n.getTime()}function Jn(s){return F(1,arguments),s instanceof Date||ze(s)==="object"&&Object.prototype.toString.call(s)==="[object Date]"}function Ce(s){if(F(1,arguments),!Jn(s)&&typeof s!="number")return!1;var e=L(s);return!isNaN(Number(e))}function je(s,e){F(2,arguments);var t=L(s),n=L(e),a=t.getFullYear()-n.getFullYear(),i=t.getMonth()-n.getMonth();return a*12+i}function Ds(s,e){F(2,arguments);var t=L(s),n=L(e);return t.getFullYear()-n.getFullYear()}function bs(s){F(1,arguments);var e=L(s);return e.setDate(1),e.setHours(0,0,0,0),e}function ni(s,e){F(2,arguments);var t=ee(e);return Ts(s,-t)}var _s=864e5;function Cs(s){F(1,arguments);var e=L(s),t=e.getTime();e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0);var n=e.getTime(),a=t-n;return Math.floor(a/_s)+1}function ot(s){F(1,arguments);var e=1,t=L(s),n=t.getUTCDay(),a=(n<e?7:0)+n-e;return t.setUTCDate(t.getUTCDate()-a),t.setUTCHours(0,0,0,0),t}function ai(s){F(1,arguments);var e=L(s),t=e.getUTCFullYear(),n=new Date(0);n.setUTCFullYear(t+1,0,4),n.setUTCHours(0,0,0,0);var a=ot(n),i=new Date(0);i.setUTCFullYear(t,0,4),i.setUTCHours(0,0,0,0);var r=ot(i);return e.getTime()>=a.getTime()?t+1:e.getTime()>=r.getTime()?t:t-1}function Is(s){F(1,arguments);var e=ai(s),t=new Date(0);t.setUTCFullYear(e,0,4),t.setUTCHours(0,0,0,0);var n=ot(t);return n}var Rs=6048e5;function ri(s){F(1,arguments);var e=L(s),t=ot(e).getTime()-Is(e).getTime();return Math.round(t/Rs)+1}function la(s,e){var t,n,a,i,r,u,o,l;F(1,arguments);var c=L(s),d=c.getUTCFullYear(),f=wt(),h=ee((t=(n=(a=(i=e==null?void 0:e.firstWeekContainsDate)!==null&&i!==void 0?i:e==null||(r=e.locale)===null||r===void 0||(u=r.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&a!==void 0?a:f.firstWeekContainsDate)!==null&&n!==void 0?n:(o=f.locale)===null||o===void 0||(l=o.options)===null||l===void 0?void 0:l.firstWeekContainsDate)!==null&&t!==void 0?t:1);if(!(h>=1&&h<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var v=new Date(0);v.setUTCFullYear(d+1,0,h),v.setUTCHours(0,0,0,0);var w=Xe(v,e),m=new Date(0);m.setUTCFullYear(d,0,h),m.setUTCHours(0,0,0,0);var g=Xe(m,e);return c.getTime()>=w.getTime()?d+1:c.getTime()>=g.getTime()?d:d-1}function Ps(s,e){var t,n,a,i,r,u,o,l;F(1,arguments);var c=wt(),d=ee((t=(n=(a=(i=e==null?void 0:e.firstWeekContainsDate)!==null&&i!==void 0?i:e==null||(r=e.locale)===null||r===void 0||(u=r.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&a!==void 0?a:c.firstWeekContainsDate)!==null&&n!==void 0?n:(o=c.locale)===null||o===void 0||(l=o.options)===null||l===void 0?void 0:l.firstWeekContainsDate)!==null&&t!==void 0?t:1),f=la(s,e),h=new Date(0);h.setUTCFullYear(f,0,d),h.setUTCHours(0,0,0,0);var v=Xe(h,e);return v}var Es=6048e5;function ii(s,e){F(1,arguments);var t=L(s),n=Xe(t,e).getTime()-Ps(t,e).getTime();return Math.round(n/Es)+1}function z(s,e){for(var t=s<0?"-":"",n=Math.abs(s).toString();n.length<e;)n="0"+n;return t+n}var Fe={y:function(e,t){var n=e.getUTCFullYear(),a=n>0?n:1-n;return z(t==="yy"?a%100:a,t.length)},M:function(e,t){var n=e.getUTCMonth();return t==="M"?String(n+1):z(n+1,2)},d:function(e,t){return z(e.getUTCDate(),t.length)},a:function(e,t){var n=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aLine truncated import{aA as F,aB as L,aC as ee,aD as ze,aE as Xe,aF as wt,aG as Vr,c as Dt,b as J,aH as Br,aI as Gr,B,d as Yi,e as Li,x as $i,aJ as Hi,g as ia,aK as Ui,_ as st,f as He,ae as Be,w as qi,i as Wi,aL as De,N as oe,j as ji,R as b,k as Ue,l as Y,P as p,q as We,h as Q,aM as Vi,aN as Bi,M as K,aO as Gi,aP as zi,ay as Xi,X as zr,T as Zi,O as Xr,s as Qi,aQ as Ki,ax as Ji,aj as A}from"./tauri-compat-tfiFK9EG.js";import{_ as es,c as M,V as ts,i as Sn,d as ns,e as Et,I as Zr,f as as,r as rs,g as rt,h as Un,j as Qn,k as is,l as ss,T as os,a as us,b as Ta}from"./index-CPxjSju3.js";import{s as Qr,a as Kr,F as gt,I as ls,j as cs,k as ds,B as Jr,C as fs,l as hs,m as wa,b as lt,n as ps,T as ms,E as ei,g as gs}from"./main-BlLQtfpq.js";import{a as pt,B as yt}from"./index-Bpi3BHKj.js";import{A as vs}from"./Animation-TKQfYYOo.js";import{B as Da}from"./index-DpGuh58E.js";import{S as ys}from"./index-D_sWIqse.js";import"./WindowsTitlebar-CrkUa1UM.js";function Le(s,e){F(2,arguments);var t=L(s),n=ee(e);if(isNaN(n))return new Date(NaN);if(!n)return t;var a=t.getDate(),i=new Date(t.getTime());i.setMonth(t.getMonth()+n+1,0);var r=i.getDate();return a>=r?i:(t.setFullYear(i.getFullYear(),i.getMonth(),a),t)}function Ts(s,e){F(2,arguments);var t=L(s).getTime(),n=ee(e);return new Date(t+n)}function ti(s){var e=new Date(Date.UTC(s.getFullYear(),s.getMonth(),s.getDate(),s.getHours(),s.getMinutes(),s.getSeconds(),s.getMilliseconds()));return e.setUTCFullYear(s.getFullYear()),s.getTime()-e.getTime()}function Kn(s){F(1,arguments);var e=L(s);return e.setHours(0,0,0,0),e}function xn(s,e){F(2,arguments);var t=ee(e);return Le(s,t*12)}var sa=6e4,oa=36e5,ws=1e3;function ua(s,e){F(2,arguments);var t=Kn(s),n=Kn(e);return t.getTime()===n.getTime()}function Jn(s){return F(1,arguments),s instanceof Date||ze(s)==="object"&&Object.prototype.toString.call(s)==="[object Date]"}function Ce(s){if(F(1,arguments),!Jn(s)&&typeof s!="number")return!1;var e=L(s);return!isNaN(Number(e))}function je(s,e){F(2,arguments);var t=L(s),n=L(e),a=t.getFullYear()-n.getFullYear(),i=t.getMonth()-n.getMonth();return a*12+i}function Ds(s,e){F(2,arguments);var t=L(s),n=L(e);return t.getFullYear()-n.getFullYear()}function bs(s){F(1,arguments);var e=L(s);return e.setDate(1),e.setHours(0,0,0,0),e}function ni(s,e){F(2,arguments);var t=ee(e);return Ts(s,-t)}var _s=864e5;function Cs(s){F(1,arguments);var e=L(s),t=e.getTime();e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0);var n=e.getTime(),a=t-n;return Math.floor(a/_s)+1}function ot(s){F(1,arguments);var e=1,t=L(s),n=t.getUTCDay(),a=(n<e?7:0)+n-e;return t.setUTCDate(t.getUTCDate()-a),t.setUTCHours(0,0,0,0),t}function ai(s){F(1,arguments);var e=L(s),t=e.getUTCFullYear(),n=new Date(0);n.setUTCFullYear(t+1,0,4),n.setUTCHours(0,0,0,0);var a=ot(n),i=new Date(0);i.setUTCFullYear(t,0,4),i.setUTCHours(0,0,0,0);var r=ot(i);return e.getTime()>=a.getTime()?t+1:e.getTime()>=r.getTime()?t:t-1}function Is(s){F(1,arguments);var e=ai(s),t=new Date(0);t.setUTCFullYear(e,0,4),t.setUTCHours(0,0,0,0);var n=ot(t);return n}var Rs=6048e5;function ri(s){F(1,arguments);var e=L(s),t=ot(e).getTime()-Is(e).getTime();return Math.round(t/Rs)+1}function la(s,e){var t,n,a,i,r,u,o,l;F(1,arguments);var c=L(s),d=c.getUTCFullYear(),f=wt(),h=ee((t=(n=(a=(i=e==null?void 0:e.firstWeekContainsDate)!==null&&i!==void 0?i:e==null||(r=e.locale)===null||r===void 0||(u=r.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&a!==void 0?a:f.firstWeekContainsDate)!==null&&n!==void 0?n:(o=f.locale)===null||o===void 0||(l=o.options)===null||l===void 0?void 0:l.firstWeekContainsDate)!==null&&t!==void 0?t:1);if(!(h>=1&&h<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var v=new Date(0);v.setUTCFullYear(d+1,0,h),v.setUTCHours(0,0,0,0);var w=Xe(v,e),m=new Date(0);m.setUTCFullYear(d,0,h),m.setUTCHours(0,0,0,0);var g=Xe(m,e);return c.getTime()>=w.getTime()?d+1:c.getTime()>=g.getTime()?d:d-1}function Ps(s,e){var t,n,a,i,r,u,o,l;F(1,arguments);var c=wt(),d=ee((t=(n=(a=(i=e==null?void 0:e.firstWeekContainsDate)!==null&&i!==void 0?i:e==null||(r=e.locale)===null||r===void 0||(u=r.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&a!==void 0?a:c.firstWeekContainsDate)!==null&&n!==void 0?n:(o=c.locale)===null||o===void 0||(l=o.options)===null||l===void 0?void 0:l.firstWeekContainsDate)!==null&&t!==void 0?t:1),f=la(s,e),h=new Date(0);h.setUTCFullYear(f,0,d),h.setUTCHours(0,0,0,0);var v=Xe(h,e);return v}var Es=6048e5;function ii(s,e){F(1,arguments);var t=L(s),n=Xe(t,e).getTime()-Ps(t,e).getTime();return Math.round(n/Es)+1}function z(s,e){for(var t=s<0?"-":"",n=Math.abs(s).toString();n.length<e;)n="0"+n;return t+n}var Fe={y:function(e,t){var n=e.getUTCFullYear(),a=n>0?n:1-n;return z(t==="yy"?a%100:a,t.length)},M:function(e,t){var n=e.getUTCMonth();return t==="M"?String(n+1):z(n+1,2)},d:function(e,t){return z(e.getUTCDate(),t.length)},a:function(e,t){var n=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aLine truncated
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i,r=!0,u=!1;return{s:function(){t=t.call(s)},n:function(){var l=t.next();return r=l.done,l},e:function(l){u=!0,i=l},f:function(){try{r||t.return==null||t.return()}finally{if(u)throw i}}}}function q(s,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");s.prototype=Object.create(e&&e.prototype,{constructor:{value:s,writable:!0,configurable:!0}}),Object.defineProperty(s,"prototype",{writable:!1}),e&&es(s,e)}function Nn(s){return Nn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Nn(s)}function di(){try{var s=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(di=function(){return!!s})()}function Ws(s,e){if(e&&(ze(e)=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return M(s)}function W(s){var e=di();return function(){var t,n=Nn(s);if(e){var a=Nn(this).constructor;t=Reflect.construct(n,arguments,a)}else t=n.apply(this,arguments);return Ws(this,t)}}function $(s,e){if(!(s instanceof e))throw new TypeError("Cannot call a class as a function")}function js(s,e){if(ze(s)!="object"||!s)return s;var t=s[Symbol.toPrimitive];if(t!==void 0){var n=t.call(s,e);if(ze(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(s)}function fi(s){var e=js(s,"string");return ze(e)=="symbol"?e:e+""}function Vs(s,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(s,fi(n.key),n)}}function H(s,e,t){return e&&Vs(s.prototype,e),Object.defineProperty(s,"prototype",{writable:!1}),s}function S(s,e,t){return(e=fi(e))in s?Object.defineProperty(s,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):s[e]=t,s}var Bs=10,hi=(function(){function s(){$(this,s),S(this,"priority",void 0),S(this,"subPriority",0)}return H(s,[{key:"validate",value:function(t,n){return!0}}]),s})(),Gs=(function(s){q(t,s);var e=W(t);function t(n,a,i,r,u){var o;return $(this,t),o=e.call(this),o.value=n,o.validateValue=a,o.setValue=i,o.priority=r,u&&(o.subPriority=u),o}return H(t,[{key:"validate",value:function(a,i){return this.validateValue(a,this.value,i)}},{key:"set",value:function(a,i,r){return this.setValue(a,i,this.value,r)}}]),t})(hi),zs=(function(s){q(t,s);var e=W(t);function t(){var n;$(this,t);for(var a=arguments.length,i=new Array(a),r=0;r<a;r++)i[r]=arguments[r];return n=e.call.apply(e,[this].concat(i)),S(M(n),"priority",Bs),S(M(n),"subPriority",-1),n}return H(t,[{key:"set",value:function(a,i){if(i.timestampIsSet)return a;var r=new Date(0);return r.setFullYear(a.getUTCFullYear(),a.getUTCMonth(),a.getUTCDate()),r.setHours(a.getUTCHours(),a.getUTCMinutes(),a.getUTCSeconds(),a.getUTCMilliseconds()),r}}]),t})(hi),j=(function(){function s(){$(this,s),S(this,"incompatibleTokens",void 0),S(this,"priority",void 0),S(this,"subPriority",void 0)}return H(s,[{key:"run",value:function(t,n,a,i){var r=this.parse(t,n,a,i);return r?{setter:new Gs(r.value,this.validate,this.set,this.priority,this.subPriority),rest:r.rest}:null}},{key:"validate",value:function(t,n,a){return!0}}]),s})(),Xs=(function(s){q(t,s);var e=W(t);function t(){var n;$(this,t);for(var a=arguments.length,i=new Array(a),r=0;r<a;r++)i[r]=arguments[r];return n=e.call.apply(e,[this].concat(i)),S(M(n),"priority",140),S(M(n),"incompatibleTokens",["R","u","t","T"]),n}return H(t,[{key:"parse",value:function(a,i,r){switch(i){case"G":case"GG":case"GGG":return r.era(a,{width:"abbreviated"})||r.era(a,{width:"narrow"});case"GGGGG":return r.era(a,{width:"narrow"});case"GGGG":default:return r.era(a,{width:"wide"})||r.era(a,{width:"abbreviated"})||r.era(a,{width:"narrow"})}}},{key:"set",value:function(a,i,r){return i.era=r,a.setUTCFullYear(r,0,1),a.setUTCHours(0,0,0,0),a}}]),t})(j),ue={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},Ee={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function le(s,e){return s&&{value:e(s.value),rest:s.rest}}function ae(s,e){var t=e.match(s);return t?{value:parseInt(t[0],10),rest:e.slice(t[0].length)}:null}function Oe(s,e){var t=e.match(s);if(!t)return null;if(t[0]==="Z")return{value:0,rest: Line truncated In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i,r=!0,u=!1;return{s:function(){t=t.call(s)},n:function(){var l=t.next();return r=l.done,l},e:function(l){u=!0,i=l},f:function(){try{r||t.return==null||t.return()}finally{if(u)throw i}}}}function q(s,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");s.prototype=Object.create(e&&e.prototype,{constructor:{value:s,writable:!0,configurable:!0}}),Object.defineProperty(s,"prototype",{writable:!1}),e&&es(s,e)}function Nn(s){return Nn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Nn(s)}function di(){try{var s=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(di=function(){return!!s})()}function Ws(s,e){if(e&&(ze(e)=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return M(s)}function W(s){var e=di();return function(){var t,n=Nn(s);if(e){var a=Nn(this).constructor;t=Reflect.construct(n,arguments,a)}else t=n.apply(this,arguments);return Ws(this,t)}}function $(s,e){if(!(s instanceof e))throw new TypeError("Cannot call a class as a function")}function js(s,e){if(ze(s)!="object"||!s)return s;var t=s[Symbol.toPrimitive];if(t!==void 0){var n=t.call(s,e);if(ze(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(s)}function fi(s){var e=js(s,"string");return ze(e)=="symbol"?e:e+""}function Vs(s,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(s,fi(n.key),n)}}function H(s,e,t){return e&&Vs(s.prototype,e),Object.defineProperty(s,"prototype",{writable:!1}),s}function S(s,e,t){return(e=fi(e))in s?Object.defineProperty(s,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):s[e]=t,s}var Bs=10,hi=(function(){function s(){$(this,s),S(this,"priority",void 0),S(this,"subPriority",0)}return H(s,[{key:"validate",value:function(t,n){return!0}}]),s})(),Gs=(function(s){q(t,s);var e=W(t);function t(n,a,i,r,u){var o;return $(this,t),o=e.call(this),o.value=n,o.validateValue=a,o.setValue=i,o.priority=r,u&&(o.subPriority=u),o}return H(t,[{key:"validate",value:function(a,i){return this.validateValue(a,this.value,i)}},{key:"set",value:function(a,i,r){return this.setValue(a,i,this.value,r)}}]),t})(hi),zs=(function(s){q(t,s);var e=W(t);function t(){var n;$(this,t);for(var a=arguments.length,i=new Array(a),r=0;r<a;r++)i[r]=arguments[r];return n=e.call.apply(e,[this].concat(i)),S(M(n),"priority",Bs),S(M(n),"subPriority",-1),n}return H(t,[{key:"set",value:function(a,i){if(i.timestampIsSet)return a;var r=new Date(0);return r.setFullYear(a.getUTCFullYear(),a.getUTCMonth(),a.getUTCDate()),r.setHours(a.getUTCHours(),a.getUTCMinutes(),a.getUTCSeconds(),a.getUTCMilliseconds()),r}}]),t})(hi),j=(function(){function s(){$(this,s),S(this,"incompatibleTokens",void 0),S(this,"priority",void 0),S(this,"subPriority",void 0)}return H(s,[{key:"run",value:function(t,n,a,i){var r=this.parse(t,n,a,i);return r?{setter:new Gs(r.value,this.validate,this.set,this.priority,this.subPriority),rest:r.rest}:null}},{key:"validate",value:function(t,n,a){return!0}}]),s})(),Xs=(function(s){q(t,s);var e=W(t);function t(){var n;$(this,t);for(var a=arguments.length,i=new Array(a),r=0;r<a;r++)i[r]=arguments[r];return n=e.call.apply(e,[this].concat(i)),S(M(n),"priority",140),S(M(n),"incompatibleTokens",["R","u","t","T"]),n}return H(t,[{key:"parse",value:function(a,i,r){switch(i){case"G":case"GG":case"GGG":return r.era(a,{width:"abbreviated"})||r.era(a,{width:"narrow"});case"GGGGG":return r.era(a,{width:"narrow"});case"GGGG":default:return r.era(a,{width:"wide"})||r.era(a,{width:"abbreviated"})||r.era(a,{width:"narrow"})}}},{key:"set",value:function(a,i,r){return i.era=r,a.setUTCFullYear(r,0,1),a.setUTCHours(0,0,0,0),a}}]),t})(j),ue={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},Ee={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function le(s,e){return s&&{value:e(s.value),rest:s.rest}}function ae(s,e){var t=e.match(s);return t?{value:parseInt(t[0],10),rest:e.slice(t[0].length)}:null}function Oe(s,e){var t=e.match(s);if(!t)return null;if(t[0]==="Z")return{value:0,rest: Line truncated
File renamed without changes.

Before

Width:  |  Height:  |  Size: 6.1 KiB

After

Width:  |  Height:  |  Size: 6.1 KiB

@@ -1,4 +1,4 @@
import{g as te,C as _t,c as Oe,b as L,R as b,P as a,B as X,f as ge,i as Ce,l as M,au as qt,aR as va,ad as Ca,aS as Gt,aT as Qo,aU as Jo,K as ei,L as _a,D as Oa,aV as ti,aW as Ra,aX as Ea,aY as ni,v as xa,y as Ta,N as x,aZ as Ps,n as ft,w as $e,a_ as Yt,h as H,k as he,o as jt,aL as re,a$ as Ia,b0 as As,a as Pa,u as si,b1 as Aa,b2 as Da,b3 as ri,G as oi,b4 as Na,b5 as Ds,t as ii,b6 as Ns,b7 as ai,b8 as ka,b9 as li,M as La,_ as ue,az as Pt,s as ks,a0 as Ma,V as ye,J as je,p as Et,E as ja,ae as Xt,aQ as yt,X as Ee,aa as za,ba as Fa,bb as Ka,bc as $a,bd as Ba,m as hr,O as Ls,aH as ci,ag as Ms,be as Ha,bf as Wa,bg as le,bh as Ua,x as di,A as Va,bi as Zt,ax as Ne,bj as qa,bk as we,ab as ui,Y as hi,j as Ae,bl as Ga,bm as Ya,d as Xa,e as Za,aJ as Qa,bn as Ja,H as el,bo as St,bp as pr,bq as zt,br as tl}from"./tauri-compat-tfiFK9EG.js";import{_ as gt,r as nl,o as pi,p as sl,q as rl,v as ol,w as il,x as fi,y as al,T as mt,z as gi,F as fr,I as ll,A as cl,D as gr,G as Fe,R as dl,a as Re,j as ul}from"./main-Knf6L_en.js";import{S as mi}from"./index-D_sWIqse.js";import{B as Ft,I as hl}from"./index-Bpi3BHKj.js";const pl=["default","error","warning","success"];var fl=_t();const gl=te(fl);function mr(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}function _s(i,e){return _s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t},_s(i,e)}function ml(i){return L.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},i),L.createElement("path",{d:"m17.55 15.66-4.8 5.48a1 1 0 0 1-1.5 0l-4.8-5.48A1 1 0 0 1 7.2 14h9.6a1 1 0 0 1 .75 1.66Z",fill:"currentColor"}))}const bl=Oe(ml,"caretdown");function yl(i){return L.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},i),L.createElement("path",{d:"m6.45 8.34 4.8-5.48a1 1 0 0 1 1.5 0l4.8 5.48A1 1 0 0 1 16.8 10H7.2a1 1 0 0 1-.75-1.66Z",fill:"currentColor"}))}const Sl=Oe(yl,"caretup");function wl(i){return L.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},i),L.createElement("path",{d:"M5 12.5c0-.83.67-1.5 1.5-1.5h11a1.5 1.5 0 0 1 0 3h-11A1.5 1.5 0 0 1 5 12.5Z",fill:"currentColor"}))}const vl=Oe(wl,"checkbox_indeterminate");function Cl(i){return L.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},i),L.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M17.41 7.3c.66.51.78 1.45.28 2.11l-6.5 8.5a1.5 1.5 0 0 1-2.37.01l-3.5-4.5a1.5 1.5 0 1 1 2.36-1.84L10 14.54l5.32-6.95a1.5 1.5 0 0 1 2.1-.28Z",fill:"currentColor"}))}const _l=Oe(Cl,"checkbox_tick");function Ol(i){return L.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},i),L.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16.28 4.24a1.5 1.5 0 0 1 0 2.12l-5.66 5.66 5.66 5.65a1.5 1.5 0 1 1-2.12 2.13l-6.72-6.72a1.5 1.5 0 0 1 0-2.12l6.72-6.72a1.5 1.5 0 0 1 2.12 0Z",fill:"currentColor"}))}const bi=Oe(Ol,"chevron_left");function Rl(i){return L.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},i),L.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.44 19.8a1.5 1.5 0 0 1 0-2.13l5.66-5.65-5.66-5.66a1.5 1.5 0 1 1 2.12-2.12l6.72 6.72a1.5 1.5 0 0 1 0 2.12L9.56 19.8a1.5 1.5 0 0 1-2.12 0Z",fill:"currentColor"}))}const js=Oe(Rl,"chevron_right");function El(i){return L.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},i),L.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.1 2.58A1 1 0 0 1 2 2h20a1 1 0 0 1 .76 1.65l-8.2 9.18V21a1 1 0 0 1-1.44.9l-3.07-2a1 1 0 0 1-.55-.9v-6.17L1.24 3.65a1 1 0 0 1-.15-1.07Z",fill:"currentColor"}))}const xl=Oe(El,"filter");function Tl(i){return L.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},i),L.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.5 2a8.5 8.5 0 1 0 4.86 15.48l4.08 4.08a1.5 1.5 0 1 0 2.12-2.12l-4.08-4.08A8.5 8.5 0 0 0 10.5 2ZM5 10.5a5.5 5.5 0 1 1 11 0 5.5 5.5 0 0 1-11 0Z",fill:"currentColor"}))}const Il=Oe(Tl,"search");function Pl(i){return L.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},i),L.createElement("path",{d:"m20.56 9.66-7.8 8.97a1 1 0 0 1-1.51 0L3.44 9.66A1 1 0 0 1 4.19 8h15.62a1 1 0 Line truncated import{g as te,C as _t,c as Oe,b as L,R as b,P as a,B as X,f as ge,i as Ce,l as M,au as qt,aR as va,ad as Ca,aS as Gt,aT as Qo,aU as Jo,K as ei,L as _a,D as Oa,aV as ti,aW as Ra,aX as Ea,aY as ni,v as xa,y as Ta,N as x,aZ as Ps,n as ft,w as $e,a_ as Yt,h as H,k as he,o as jt,aL as re,a$ as Ia,b0 as As,a as Pa,u as si,b1 as Aa,b2 as Da,b3 as ri,G as oi,b4 as Na,b5 as Ds,t as ii,b6 as Ns,b7 as ai,b8 as ka,b9 as li,M as La,_ as ue,az as Pt,s as ks,a0 as Ma,V as ye,J as je,p as Et,E as ja,ae as Xt,aQ as yt,X as Ee,aa as za,ba as Fa,bb as Ka,bc as $a,bd as Ba,m as hr,O as Ls,aH as ci,ag as Ms,be as Ha,bf as Wa,bg as le,bh as Ua,x as di,A as Va,bi as Zt,ax as Ne,bj as qa,bk as we,ab as ui,Y as hi,j as Ae,bl as Ga,bm as Ya,d as Xa,e as Za,aJ as Qa,bn as Ja,H as el,bo as St,bp as pr,bq as zt,br as tl}from"./tauri-compat-tfiFK9EG.js";import{_ as gt,r as nl,o as pi,p as sl,q as rl,v as ol,w as il,x as fi,y as al,T as mt,z as gi,F as fr,I as ll,A as cl,D as gr,G as Fe,R as dl,a as Re,j as ul}from"./main-BlLQtfpq.js";import{S as mi}from"./index-D_sWIqse.js";import{B as Ft,I as hl}from"./index-Bpi3BHKj.js";const pl=["default","error","warning","success"];var fl=_t();const gl=te(fl);function mr(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}function _s(i,e){return _s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t},_s(i,e)}function ml(i){return L.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},i),L.createElement("path",{d:"m17.55 15.66-4.8 5.48a1 1 0 0 1-1.5 0l-4.8-5.48A1 1 0 0 1 7.2 14h9.6a1 1 0 0 1 .75 1.66Z",fill:"currentColor"}))}const bl=Oe(ml,"caretdown");function yl(i){return L.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},i),L.createElement("path",{d:"m6.45 8.34 4.8-5.48a1 1 0 0 1 1.5 0l4.8 5.48A1 1 0 0 1 16.8 10H7.2a1 1 0 0 1-.75-1.66Z",fill:"currentColor"}))}const Sl=Oe(yl,"caretup");function wl(i){return L.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},i),L.createElement("path",{d:"M5 12.5c0-.83.67-1.5 1.5-1.5h11a1.5 1.5 0 0 1 0 3h-11A1.5 1.5 0 0 1 5 12.5Z",fill:"currentColor"}))}const vl=Oe(wl,"checkbox_indeterminate");function Cl(i){return L.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},i),L.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M17.41 7.3c.66.51.78 1.45.28 2.11l-6.5 8.5a1.5 1.5 0 0 1-2.37.01l-3.5-4.5a1.5 1.5 0 1 1 2.36-1.84L10 14.54l5.32-6.95a1.5 1.5 0 0 1 2.1-.28Z",fill:"currentColor"}))}const _l=Oe(Cl,"checkbox_tick");function Ol(i){return L.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},i),L.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16.28 4.24a1.5 1.5 0 0 1 0 2.12l-5.66 5.66 5.66 5.65a1.5 1.5 0 1 1-2.12 2.13l-6.72-6.72a1.5 1.5 0 0 1 0-2.12l6.72-6.72a1.5 1.5 0 0 1 2.12 0Z",fill:"currentColor"}))}const bi=Oe(Ol,"chevron_left");function Rl(i){return L.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},i),L.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.44 19.8a1.5 1.5 0 0 1 0-2.13l5.66-5.65-5.66-5.66a1.5 1.5 0 1 1 2.12-2.12l6.72 6.72a1.5 1.5 0 0 1 0 2.12L9.56 19.8a1.5 1.5 0 0 1-2.12 0Z",fill:"currentColor"}))}const js=Oe(Rl,"chevron_right");function El(i){return L.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},i),L.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.1 2.58A1 1 0 0 1 2 2h20a1 1 0 0 1 .76 1.65l-8.2 9.18V21a1 1 0 0 1-1.44.9l-3.07-2a1 1 0 0 1-.55-.9v-6.17L1.24 3.65a1 1 0 0 1-.15-1.07Z",fill:"currentColor"}))}const xl=Oe(El,"filter");function Tl(i){return L.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},i),L.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.5 2a8.5 8.5 0 1 0 4.86 15.48l4.08 4.08a1.5 1.5 0 1 0 2.12-2.12l-4.08-4.08A8.5 8.5 0 0 0 10.5 2ZM5 10.5a5.5 5.5 0 1 1 11 0 5.5 5.5 0 0 1-11 0Z",fill:"currentColor"}))}const Il=Oe(Tl,"search");function Pl(i){return L.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},i),L.createElement("path",{d:"m20.56 9.66-7.8 8.97a1 1 0 0 1-1.51 0L3.44 9.66A1 1 0 0 1 4.19 8h15.62a1 1 0 Line truncated
Please note that this is not a legal way to use it`);return}t?n=e:n=e.map(r=>r.value),this.handleValueChange(n),this._adapter.notifyChange(n)}checkMultipleProps(e){if(this._isMultiple()){const t=e||this.getProps(),{defaultValue:n,value:s}=t,r=s||n;!Xt(r)&&!Array.isArray(r)&&$e(!0,"[Semi Select] defaultValue/value should be array type in multiple mode")}}updateScrollTop(){this._adapter.updateScrollTop()}updateOverflowItemCount(e,t){const{maxTagCount:n,ellipsisTrigger:s}=this.getProps();s&&(t?this._adapter.updateOverflowItemCount(t):typeof n=="number"&&(e-n>0?this._adapter.updateOverflowItemCount(e-n):this._adapter.updateOverflowItemCount(0)))}updateIsFullTags(){const{isFullTags:e}=this.getStates();e||this._adapter.setState({isFullTags:!0})}handlePopoverClose(){this._adapter.emit("popoverClose")}handleSlotMouseEnter(){this._adapter.updateFocusIndex(-1)}}const lt=al.PREFIX,Ki=gi.TAG_SIZE,Rd=gi.AVATAR_SHAPE;class Ht extends L.PureComponent{renderNTag(e,t){const{size:n,showPopover:s,popoverProps:r,onPlusNMouseEnter:o}=this.props;let l=b.createElement(mt,{closable:!1,size:n,color:"grey",style:{backgroundColor:"transparent"},key:"_+n",onMouseEnter:o},"+",e);return s&&(l=b.createElement(yt,Object.assign({showArrow:!0,content:t,trigger:"hover",position:"top",autoAdjustOverflow:!0,className:`${lt}-rest-group-popover`},r,{key:"_+n_Popover"}),l)),l}renderMergeTags(e){const{maxTagCount:t,tagList:n,restCount:s}=this.props,r=s||n.length-t;let o=e;const l=e.slice(0,t),c=e.slice(t);let d=null;return r>0&&(d=this.renderNTag(r,c),l.push(d),o=l),o}renderAllTags(){const{tagList:e,size:t,mode:n,avatarShape:s,onTagClose:r}=this.props;return e.map(l=>{if(n==="custom")return l;const c=Object.assign({},l);return c.size||(c.size=t),c.avatarShape||(c.avatarShape=s),c.tagKey||(typeof c.children=="string"||typeof c.children=="number"?c.tagKey=c.children:c.tagKey=Math.random()),b.createElement(mt,Object.assign({},c,{key:c.tagKey,onClose:(d,u,h)=>{c.onClose&&c.onClose(d,u,h),r&&r(d,u,h)}}))})}render(){const{style:e,className:t,maxTagCount:n,size:s}=this.props,r=M({[`${lt}-group`]:!0,[`${lt}-group-max`]:n,[`${lt}-group-small`]:s==="small",[`${lt}-group-large`]:s==="large"},t),o=this.renderAllTags(),l=typeof n>"u"?o:this.renderMergeTags(o);return b.createElement("div",{style:e,className:r},l)}}Ht.defaultProps={style:{},className:"",size:Ki[0],avatarShape:"square",onTagClose:()=>{},onPlusNMouseEnter:()=>{}};Ht.propTypes={children:a.node,style:a.object,className:a.string,maxTagCount:a.number,restCount:a.number,tagList:a.array,size:a.oneOf(Ki),mode:a.string,onTagClose:a.func,showPopover:a.bool,popoverProps:a.object,avatarShape:a.oneOf(Rd)};var Ed=function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(i);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(i,n[s])&&(t[n[s]]=i[n[s]]);return t};const so=(i,e,t,n)=>{const s=i.props;if(!i||!s)return null;const r=Object.assign(Object.assign({value:s.value,label:s.label||s.children||s.value,_show:!0,_selected:!1,_scrollIndex:t},s),{_parentGroup:e});return r._keyInJsx=n||i.key,r},xd=i=>{let e=[],t=[];const n={label:"",children:[],_show:!1};let s=b.Children.toArray(i);s=s.filter(l=>l&&l.props);let r="",o=-1;return s.forEach(l=>{if(l.type.isSelectOption){r="option",o++;const c=so(l,void 0,o);n.children.push(c),t.push(c)}else if(l.type.isSelectOptionGroup){r="group";let c=l.props,{children:d}=c,u=Ed(c,["children"]);u.key=l.key;let h=[];Array.isArray(d)?h=d.map(y=>y.key):h.push(d.key),d=b.Children.toArray(d);const g=d.map((y,p)=>{let f=y.key;return h[p]===null&&(f=l.key+""+y.key),o++,so(y,u,o,f)}),m=Object.assign(Object.assign({},l.props),{children:g,key:l.key});e.push(m),t=t.concat(g)}else $e(!0,"[Semi Select] The children of `Select` should be `Select.Option` or `Select.OptionGroup`")}),r==="option"&&(e=[n]),{optionGroups:e,options:t}},Td=i=>{let{index:e,data:t,style:n}=i;const{visibleOptions:s,renderOption:r}=t,o=s[e];return r(o,e,n)};var ro=function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(i);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(i,n[s])&&(t[n[s]]=i[n[s]]);return t};let He=class extends L.PureComponent{onClick(e,t){var{value:n,label:s,children:r}=e,o=ro(e,["value","label","children"]);const{props:l}=this;l.disabled||l.onSelect(Object.assign(Object.assign({},o),{value:n,label:s||r}),t)}renderOptionContent(e){let{config:t,children:n,inputValue:s,prefixCls:r}=e;return Ce(n)&&s?b.createElement(zs,{searchWords:t.searchWords,sourceString:t.sourceString,highlightClassName:t.highlightClassName}):n}render(){const e=this.props,{children:t,disabled:n,value:s,selected:r,label:o,empty:l,emptyContent:c,onSelect:d,focused:u, Line truncated Please note that this is not a legal way to use it`);return}t?n=e:n=e.map(r=>r.value),this.handleValueChange(n),this._adapter.notifyChange(n)}checkMultipleProps(e){if(this._isMultiple()){const t=e||this.getProps(),{defaultValue:n,value:s}=t,r=s||n;!Xt(r)&&!Array.isArray(r)&&$e(!0,"[Semi Select] defaultValue/value should be array type in multiple mode")}}updateScrollTop(){this._adapter.updateScrollTop()}updateOverflowItemCount(e,t){const{maxTagCount:n,ellipsisTrigger:s}=this.getProps();s&&(t?this._adapter.updateOverflowItemCount(t):typeof n=="number"&&(e-n>0?this._adapter.updateOverflowItemCount(e-n):this._adapter.updateOverflowItemCount(0)))}updateIsFullTags(){const{isFullTags:e}=this.getStates();e||this._adapter.setState({isFullTags:!0})}handlePopoverClose(){this._adapter.emit("popoverClose")}handleSlotMouseEnter(){this._adapter.updateFocusIndex(-1)}}const lt=al.PREFIX,Ki=gi.TAG_SIZE,Rd=gi.AVATAR_SHAPE;class Ht extends L.PureComponent{renderNTag(e,t){const{size:n,showPopover:s,popoverProps:r,onPlusNMouseEnter:o}=this.props;let l=b.createElement(mt,{closable:!1,size:n,color:"grey",style:{backgroundColor:"transparent"},key:"_+n",onMouseEnter:o},"+",e);return s&&(l=b.createElement(yt,Object.assign({showArrow:!0,content:t,trigger:"hover",position:"top",autoAdjustOverflow:!0,className:`${lt}-rest-group-popover`},r,{key:"_+n_Popover"}),l)),l}renderMergeTags(e){const{maxTagCount:t,tagList:n,restCount:s}=this.props,r=s||n.length-t;let o=e;const l=e.slice(0,t),c=e.slice(t);let d=null;return r>0&&(d=this.renderNTag(r,c),l.push(d),o=l),o}renderAllTags(){const{tagList:e,size:t,mode:n,avatarShape:s,onTagClose:r}=this.props;return e.map(l=>{if(n==="custom")return l;const c=Object.assign({},l);return c.size||(c.size=t),c.avatarShape||(c.avatarShape=s),c.tagKey||(typeof c.children=="string"||typeof c.children=="number"?c.tagKey=c.children:c.tagKey=Math.random()),b.createElement(mt,Object.assign({},c,{key:c.tagKey,onClose:(d,u,h)=>{c.onClose&&c.onClose(d,u,h),r&&r(d,u,h)}}))})}render(){const{style:e,className:t,maxTagCount:n,size:s}=this.props,r=M({[`${lt}-group`]:!0,[`${lt}-group-max`]:n,[`${lt}-group-small`]:s==="small",[`${lt}-group-large`]:s==="large"},t),o=this.renderAllTags(),l=typeof n>"u"?o:this.renderMergeTags(o);return b.createElement("div",{style:e,className:r},l)}}Ht.defaultProps={style:{},className:"",size:Ki[0],avatarShape:"square",onTagClose:()=>{},onPlusNMouseEnter:()=>{}};Ht.propTypes={children:a.node,style:a.object,className:a.string,maxTagCount:a.number,restCount:a.number,tagList:a.array,size:a.oneOf(Ki),mode:a.string,onTagClose:a.func,showPopover:a.bool,popoverProps:a.object,avatarShape:a.oneOf(Rd)};var Ed=function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(i);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(i,n[s])&&(t[n[s]]=i[n[s]]);return t};const so=(i,e,t,n)=>{const s=i.props;if(!i||!s)return null;const r=Object.assign(Object.assign({value:s.value,label:s.label||s.children||s.value,_show:!0,_selected:!1,_scrollIndex:t},s),{_parentGroup:e});return r._keyInJsx=n||i.key,r},xd=i=>{let e=[],t=[];const n={label:"",children:[],_show:!1};let s=b.Children.toArray(i);s=s.filter(l=>l&&l.props);let r="",o=-1;return s.forEach(l=>{if(l.type.isSelectOption){r="option",o++;const c=so(l,void 0,o);n.children.push(c),t.push(c)}else if(l.type.isSelectOptionGroup){r="group";let c=l.props,{children:d}=c,u=Ed(c,["children"]);u.key=l.key;let h=[];Array.isArray(d)?h=d.map(y=>y.key):h.push(d.key),d=b.Children.toArray(d);const g=d.map((y,p)=>{let f=y.key;return h[p]===null&&(f=l.key+""+y.key),o++,so(y,u,o,f)}),m=Object.assign(Object.assign({},l.props),{children:g,key:l.key});e.push(m),t=t.concat(g)}else $e(!0,"[Semi Select] The children of `Select` should be `Select.Option` or `Select.OptionGroup`")}),r==="option"&&(e=[n]),{optionGroups:e,options:t}},Td=i=>{let{index:e,data:t,style:n}=i;const{visibleOptions:s,renderOption:r}=t,o=s[e];return r(o,e,n)};var ro=function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(i);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(i,n[s])&&(t[n[s]]=i[n[s]]);return t};let He=class extends L.PureComponent{onClick(e,t){var{value:n,label:s,children:r}=e,o=ro(e,["value","label","children"]);const{props:l}=this;l.disabled||l.onSelect(Object.assign(Object.assign({},o),{value:n,label:s||r}),t)}renderOptionContent(e){let{config:t,children:n,inputValue:s,prefixCls:r}=e;return Ce(n)&&s?b.createElement(zs,{searchWords:t.searchWords,sourceString:t.sourceString,highlightClassName:t.highlightClassName}):n}render(){const e=this.props,{children:t,disabled:n,value:s,selected:r,label:o,empty:l,emptyContent:c,onSelect:d,focused:u, Line truncated
`,T.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;} `,T.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
`,C.getElementsByTagName("head")[0].appendChild(T)}C.body&&pa(C.body,"react-draggable-transparent-selection")}function or(C){window.requestAnimationFrame?window.requestAnimationFrame(()=>{ir(C)}):ir(C)}function ir(C){if(C)try{C.body&&fa(C.body,"react-draggable-transparent-selection");const R=C.selection;if(R)R.empty();else{const T=(C.defaultView||window).getSelection();T&&T.type!=="Caret"&&T.removeAllRanges()}}catch{}}function pa(C,R){C.classList?C.classList.add(R):C.className.match(new RegExp(`(?:^|\\s)${R}(?!\\S)`))||(C.className+=` ${R}`)}function fa(C,R){C.classList?C.classList.remove(R):C.className=C.className.replace(new RegExp(`(?:^|\\s)${R}(?!\\S)`,"g"),"")}function ga(C,R,T){if(!C.props.bounds)return[R,T];let{bounds:D}=C.props;D=typeof D=="string"?D:ya(D);const j=fn(C);if(typeof D=="string"){const{ownerDocument:J}=j,Y=J.defaultView;if(!Y)throw new Error("Cannot resolve the owner window of the draggable node.");let ee;if(D==="parent"?ee=j.parentNode:ee=j.getRootNode().querySelector(D),!(ee instanceof Y.HTMLElement))throw new Error('Bounds selector "'+D+'" could not find an element.');const fe=ee,Me=Y.getComputedStyle(j),Ue=Y.getComputedStyle(fe);D={left:-j.offsetLeft+w(Ue.paddingLeft)+w(Me.marginLeft),top:-j.offsetTop+w(Ue.paddingTop)+w(Me.marginTop),right:G(fe)-V(j)-j.offsetLeft+w(Ue.paddingRight)-w(Me.marginRight),bottom:W(fe)-q(j)-j.offsetTop+w(Ue.paddingBottom)-w(Me.marginBottom)}}return v(D.right)&&(R=Math.min(R,D.right)),v(D.bottom)&&(T=Math.min(T,D.bottom)),v(D.left)&&(R=Math.max(R,D.left)),v(D.top)&&(T=Math.max(T,D.top)),[R,T]}function ar(C,R,T){const D=Math.round(R/C[0])*C[0],j=Math.round(T/C[1])*C[1];return[D,j]}function ma(C){return C.props.axis==="both"||C.props.axis==="x"}function ba(C){return C.props.axis==="both"||C.props.axis==="y"}function un(C,R,T){const D=typeof R=="number"?de(C,R):null;if(typeof R=="number"&&!D)return null;const j=fn(T),J=T.props.offsetParent||j.offsetParent||j.ownerDocument.body;return se(D||C,J,T.props.scale)}function hn(C,R,T){const D=!v(C.lastX),j=fn(C);return D?{node:j,deltaX:0,deltaY:0,lastX:R,lastY:T,x:R,y:T}:{node:j,deltaX:R-C.lastX,deltaY:T-C.lastY,lastX:C.lastX,lastY:C.lastY,x:R,y:T}}function pn(C,R){const T=C.props.scale;return{node:R.node,x:C.state.x+R.deltaX/T,y:C.state.y+R.deltaY/T,deltaX:R.deltaX/T,deltaY:R.deltaY/T,lastX:C.state.x,lastY:C.state.y}}function ya(C){return{left:C.left,top:C.top,right:C.right,bottom:C.bottom}}function fn(C){const R=C.findDOMNode();if(!R)throw new Error("<DraggableCore>: Unmounted during event!");return R}var gn=d(St()),ae=d(zt()),Sa=d(pr());function Se(...C){i.DRAGGABLE_DEBUG&&console.log(...C)}var me={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}},Ie=me.mouse,Le=class extends gn.Component{constructor(){super(...arguments),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,this.touchIdentifier=null,this.mounted=!1,this.handleDragStart=C=>{if(this.props.onMouseDown(C),!this.props.allowAnyClick&&(typeof C.button=="number"&&C.button!==0||C.ctrlKey))return!1;const R=this.findDOMNode();if(!R||!R.ownerDocument||!R.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:T}=R;if(this.props.disabled||!(C.target instanceof T.defaultView.Node)||this.props.handle&&!F(C.target,this.props.handle,R)||this.props.cancel&&F(C.target,this.props.cancel,R))return;C.type==="touchstart"&&!this.props.allowMobileScroll&&C.preventDefault();const D=ie(C);this.touchIdentifier=D;const j=un(C,D,this);if(j==null)return;const{x:J,y:Y}=j,ee=hn(this,J,Y);Se("DraggableCore: handleDragStart: %j",ee),Se("calling",this.props.onStart),!(this.props.onStart(C,ee)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&ha(T,this.props.nonce),this.dragging=!0,this.lastX=J,this.lastY=Y,K(T,Ie.move,this.handleDrag),K(T,Ie.stop,this.handleDragStop))},this.handleDrag=C=>{const R=un(C,this.touchIdentifier,this);if(R==null)return;let{x:T,y:D}=R;if(Array.isArray(this.props.grid)){let Y=T-this.lastX,ee=D-this.lastY;if([Y,ee]=ar(this.props.grid,Y,ee),!Y&&!ee)return;T=this.lastX+Y,D=this.lastY+ee}const j=hn(this,T,D);if(Se("DraggableCore: handleDrag: %j",j),this.props.onDrag(C,j)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const Y=document.createEvent("MouseEvents");Y.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(Y)}return}this.lastX=T,this.lastY=D},this.handleDragStop=C=>{if(!this.dragging)return;const R=un(C,this.touchIdentifier,this);if(R==null)return;let{x:T,y:D}=R;if(Array.isArray(this.props.grid)){let ee=T-this.lastX||0,fe=D-this.lastY||0;[ee,fe]=ar(this.props.grid,ee,fe),T=this.lastX+ee,D=this.lastY+fe}const j=hn(this,T,D);if(this.props.onStop(C,j)===!1||this.mounted===!1)return!1;const Y=this.findDOMNode();Y&&this.props.enableUserSelectHack&&or(Y.ownerDocument),Se("DraggableCore: handleDragStop: %j",j),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,Y&&(Se("DraggableCore Line truncated `,C.getElementsByTagName("head")[0].appendChild(T)}C.body&&pa(C.body,"react-draggable-transparent-selection")}function or(C){window.requestAnimationFrame?window.requestAnimationFrame(()=>{ir(C)}):ir(C)}function ir(C){if(C)try{C.body&&fa(C.body,"react-draggable-transparent-selection");const R=C.selection;if(R)R.empty();else{const T=(C.defaultView||window).getSelection();T&&T.type!=="Caret"&&T.removeAllRanges()}}catch{}}function pa(C,R){C.classList?C.classList.add(R):C.className.match(new RegExp(`(?:^|\\s)${R}(?!\\S)`))||(C.className+=` ${R}`)}function fa(C,R){C.classList?C.classList.remove(R):C.className=C.className.replace(new RegExp(`(?:^|\\s)${R}(?!\\S)`,"g"),"")}function ga(C,R,T){if(!C.props.bounds)return[R,T];let{bounds:D}=C.props;D=typeof D=="string"?D:ya(D);const j=fn(C);if(typeof D=="string"){const{ownerDocument:J}=j,Y=J.defaultView;if(!Y)throw new Error("Cannot resolve the owner window of the draggable node.");let ee;if(D==="parent"?ee=j.parentNode:ee=j.getRootNode().querySelector(D),!(ee instanceof Y.HTMLElement))throw new Error('Bounds selector "'+D+'" could not find an element.');const fe=ee,Me=Y.getComputedStyle(j),Ue=Y.getComputedStyle(fe);D={left:-j.offsetLeft+w(Ue.paddingLeft)+w(Me.marginLeft),top:-j.offsetTop+w(Ue.paddingTop)+w(Me.marginTop),right:G(fe)-V(j)-j.offsetLeft+w(Ue.paddingRight)-w(Me.marginRight),bottom:W(fe)-q(j)-j.offsetTop+w(Ue.paddingBottom)-w(Me.marginBottom)}}return v(D.right)&&(R=Math.min(R,D.right)),v(D.bottom)&&(T=Math.min(T,D.bottom)),v(D.left)&&(R=Math.max(R,D.left)),v(D.top)&&(T=Math.max(T,D.top)),[R,T]}function ar(C,R,T){const D=Math.round(R/C[0])*C[0],j=Math.round(T/C[1])*C[1];return[D,j]}function ma(C){return C.props.axis==="both"||C.props.axis==="x"}function ba(C){return C.props.axis==="both"||C.props.axis==="y"}function un(C,R,T){const D=typeof R=="number"?de(C,R):null;if(typeof R=="number"&&!D)return null;const j=fn(T),J=T.props.offsetParent||j.offsetParent||j.ownerDocument.body;return se(D||C,J,T.props.scale)}function hn(C,R,T){const D=!v(C.lastX),j=fn(C);return D?{node:j,deltaX:0,deltaY:0,lastX:R,lastY:T,x:R,y:T}:{node:j,deltaX:R-C.lastX,deltaY:T-C.lastY,lastX:C.lastX,lastY:C.lastY,x:R,y:T}}function pn(C,R){const T=C.props.scale;return{node:R.node,x:C.state.x+R.deltaX/T,y:C.state.y+R.deltaY/T,deltaX:R.deltaX/T,deltaY:R.deltaY/T,lastX:C.state.x,lastY:C.state.y}}function ya(C){return{left:C.left,top:C.top,right:C.right,bottom:C.bottom}}function fn(C){const R=C.findDOMNode();if(!R)throw new Error("<DraggableCore>: Unmounted during event!");return R}var gn=d(St()),ae=d(zt()),Sa=d(pr());function Se(...C){i.DRAGGABLE_DEBUG&&console.log(...C)}var me={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}},Ie=me.mouse,Le=class extends gn.Component{constructor(){super(...arguments),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,this.touchIdentifier=null,this.mounted=!1,this.handleDragStart=C=>{if(this.props.onMouseDown(C),!this.props.allowAnyClick&&(typeof C.button=="number"&&C.button!==0||C.ctrlKey))return!1;const R=this.findDOMNode();if(!R||!R.ownerDocument||!R.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:T}=R;if(this.props.disabled||!(C.target instanceof T.defaultView.Node)||this.props.handle&&!F(C.target,this.props.handle,R)||this.props.cancel&&F(C.target,this.props.cancel,R))return;C.type==="touchstart"&&!this.props.allowMobileScroll&&C.preventDefault();const D=ie(C);this.touchIdentifier=D;const j=un(C,D,this);if(j==null)return;const{x:J,y:Y}=j,ee=hn(this,J,Y);Se("DraggableCore: handleDragStart: %j",ee),Se("calling",this.props.onStart),!(this.props.onStart(C,ee)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&ha(T,this.props.nonce),this.dragging=!0,this.lastX=J,this.lastY=Y,K(T,Ie.move,this.handleDrag),K(T,Ie.stop,this.handleDragStop))},this.handleDrag=C=>{const R=un(C,this.touchIdentifier,this);if(R==null)return;let{x:T,y:D}=R;if(Array.isArray(this.props.grid)){let Y=T-this.lastX,ee=D-this.lastY;if([Y,ee]=ar(this.props.grid,Y,ee),!Y&&!ee)return;T=this.lastX+Y,D=this.lastY+ee}const j=hn(this,T,D);if(Se("DraggableCore: handleDrag: %j",j),this.props.onDrag(C,j)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const Y=document.createEvent("MouseEvents");Y.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(Y)}return}this.lastX=T,this.lastY=D},this.handleDragStop=C=>{if(!this.dragging)return;const R=un(C,this.touchIdentifier,this);if(R==null)return;let{x:T,y:D}=R;if(Array.isArray(this.props.grid)){let ee=T-this.lastX||0,fe=D-this.lastY||0;[ee,fe]=ar(this.props.grid,ee,fe),T=this.lastX+ee,D=this.lastY+fe}const j=hn(this,T,D);if(this.props.onStop(C,j)===!1||this.mounted===!1)return!1;const Y=this.findDOMNode();Y&&this.props.enableUserSelectHack&&or(Y.ownerDocument),Se("DraggableCore: handleDragStop: %j",j),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,Y&&(Se("DraggableCore Line truncated
@@ -1,21 +1,21 @@
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/MarkdownPart-Bhe_jloX.js","assets/tauri-compat-tfiFK9EG.js","assets/tauri-compat-BTcpEvqB.css","assets/markdown-preprocess-Bvg4n8KE.js","assets/markdown-preprocess-Cp579UoJ.css","assets/index-Bpi3BHKj.js","assets/index-D0pGtk0y.css","assets/WindowsTitlebar-CrkUa1UM.js","assets/WindowsTitlebar-U0YG9JNA.css","assets/MarkdownPart-Cp90Gu77.css","assets/SummaryPart-D48OOFSQ.js","assets/ServicesPage-DrjRw530.js","assets/index-DwVcZP0M.js","assets/index-D_sWIqse.js","assets/index-DkG9Cu-r.css","assets/index-gTPS8Hpa.css","assets/IconFile-CgfQSwGI.js","assets/ServicesPage-Cbm5nbW7.css","assets/TokenPage-C6-RA6yj.js","assets/Animation-TKQfYYOo.js","assets/index-DpGuh58E.js","assets/index-ClU1uQYs.css","assets/TokenPage-DwLDOw_j.css","assets/CollabPage-bnm43hIR.js","assets/CollabPage-CG38jm3S.css"])))=>i.map(i=>d[i]); const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/MarkdownPart-B6YIH_Oj.js","assets/tauri-compat-tfiFK9EG.js","assets/tauri-compat-BTcpEvqB.css","assets/markdown-preprocess-6737_jWr.js","assets/markdown-preprocess-Cp579UoJ.css","assets/index-Bpi3BHKj.js","assets/index-D0pGtk0y.css","assets/WindowsTitlebar-CrkUa1UM.js","assets/WindowsTitlebar-U0YG9JNA.css","assets/MarkdownPart-Cp90Gu77.css","assets/SummaryPart-Bg2rGJqh.js","assets/ServicesPage-oItXjdfv.js","assets/index-CPxjSju3.js","assets/index-D_sWIqse.js","assets/index-DkG9Cu-r.css","assets/index-gTPS8Hpa.css","assets/IconFile-CgfQSwGI.js","assets/ServicesPage-Cbm5nbW7.css","assets/TokenPage-C9YMDOM-.js","assets/Animation-TKQfYYOo.js","assets/index-DpGuh58E.js","assets/index-ClU1uQYs.css","assets/TokenPage-DwLDOw_j.css","assets/CollabPage-BSH3y36_.js","assets/CollabPage-CG38jm3S.css"])))=>i.map(i=>d[i]);
var _i=Object.defineProperty;var Mi=(n,e,t)=>e in n?_i(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var xt=(n,e,t)=>Mi(n,typeof e!="symbol"?e+"":e,t);import{g as We,r as Li,a as Ii,c as fe,b as a,d as $s,e as As,B as Te,_ as Be,f as ge,h as $,i as De,j as Ti,E as Ri,R as g,k as de,l as I,m as Ge,n as Fs,P as h,w as zs,o as jo,p as Je,q as rn,s as ln,t as No,u as Ni,v as Di,x as $i,y as Ai,z as Fi,A as zi,C as Bi,D as Ui,F as Vi,G as Ki,H as Bs,I as Wi,T as Do,J as sn,K as Hi,L as Zi,M as qi,N as Pt,O as Us,Q as Vs,S as Ks,U as Ws,V as Gi,W as Hs,X as Zs,Y as Eo,Z as Qi,$ as Yi,a0 as Xi,a1 as Ji,a2 as ea,a3 as ta,a4 as na,a5 as oa,a6 as ra,a7 as sa,a8 as ia,a9 as aa,aa as Go,ab as $e,ac as la,ad as ca,ae as Jt,af as da,ag as ua,ah as Oo,ai as me,aj as i,ak as pa,al as ha,am as ma,an as fa,ao as Qo,ap as dt,aq as ga,ar as ya,as as ba,at as va}from"./tauri-compat-tfiFK9EG.js";import{I as cn,a as qs,b as Gs,c as Qs,B as ie}from"./index-Bpi3BHKj.js";import{W as xa}from"./WindowsTitlebar-CrkUa1UM.js";const wa="modulepreload",Ca=function(n){return"/"+n},Yo={},Gt=function(e,t,o){let r=Promise.resolve();if(t&&t.length>0){let l=function(p){return Promise.all(p.map(d=>Promise.resolve(d).then(m=>({status:"fulfilled",value:m}),m=>({status:"rejected",reason:m}))))};document.getElementsByTagName("link");const c=document.querySelector("meta[property=csp-nonce]"),u=(c==null?void 0:c.nonce)||(c==null?void 0:c.getAttribute("nonce"));r=l(t.map(p=>{if(p=Ca(p),p in Yo)return;Yo[p]=!0;const d=p.endsWith(".css"),m=d?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${p}"]${m}`))return;const f=document.createElement("link");if(f.rel=d?"stylesheet":wa,d||(f.as="script"),f.crossOrigin="",f.href=p,u&&f.setAttribute("nonce",u),document.head.appendChild(f),d)return new Promise((b,y)=>{f.addEventListener("load",b),f.addEventListener("error",()=>y(new Error(`Unable to preload CSS for ${p}`)))})}))}function s(l){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=l,window.dispatchEvent(c),!c.defaultPrevented)throw l}return r.then(l=>{for(const c of l||[])c.status==="rejected"&&s(c.reason);return e().catch(s)})};function Xo(n,e){const t=e,o=new URL(t);if(o.protocol!=="http:"&&o.protocol!=="https:")throw new Error(`Service endpoint must use HTTP(S): ${t}`);return o.toString().replace(/\/+$/,"")}function Jo(n){const e=new URL(n);return e.protocol=e.protocol==="https:"?"wss:":"ws:",e.pathname=`${e.pathname.replace(/\/+$/,"")}/ws`,e.toString().replace(/\/$/,"")}function Sa(n){const e=Xo(n.VITE_BRIDGE_BASE,"http://127.0.0.1:14168"),t=Xo(n.VITE_CONDUCTOR_BASE,"http://127.0.0.1:8900");return{bridgeBase:e,conductorBase:t,wsUrl:Jo(e),conductorWsUrl:Jo(t)}}const dn=Sa({VITE_BRIDGE_BASE:void 0,VITE_CONDUCTOR_BASE:void 0}),ee=dn.bridgeBase,ka=dn.conductorBase,ja=dn.wsUrl,Ea=dn.conductorWsUrl,Oa=1e3,Pa=3e4;let ke=null,Po=0,kn=null;const jt=new Map;let _o="offline";const Mo=new Set;let er=!1;const _a=new Set;function jn(n){n!==_o&&(_o=n,n==="ready"&&(er||(er=!0,_a.forEach(e=>e()))),Mo.forEach(e=>e(n)))}function tr(){return _o}function Ys(n){return Mo.add(n),()=>{Mo.delete(n)}}function Xs(){if(!(ke&&(ke.readyState===WebSocket.OPEN||ke.readyState===WebSocket.CONNECTING))){jn("connecting");try{ke=new WebSocket(ja)}catch{nr();return}ke.onopen=()=>{Po=0,jn("ready")},ke.onmessage=n=>{try{const e=JSON.parse(n.data),t=e.type;if(!t)return;const o=jt.get(t);o&&o.forEach(r=>r(e))}catch{}},ke.onclose=()=>{ke=null,jn("connecting"),nr()},ke.onerror=()=>{ke==null||ke.close()}}}function nr(){if(kn)return;const n=Math.min(Oa*2**Po,Pa);Po++,kn=setTimeout(()=>{kn=null,Xs()},n)}function Ve(n,e){return jt.has(n)||jt.set(n,new Set),jt.get(n).add(e),Xs(),()=>{var t;(t=jt.get(n))==null||t.delete(e)}}let or=[];const Ma=new Set;let rr=!1;function La(){for(const n of Ma)n()}function En(n){or=[...or.slice(-39),n],La()}function Ia(){rr||(rr=!0,Ve("session-state",n=>{const e=n;if(!e.sessionId||!e.status)return;const t=e.status==="running"?"Turn started":e.status==="idle"?"Turn complete":e.status==="error"?"Turn error":`Session ${e.status}`;En(t)}),Ve("service.changed",n=>{const e=n;if(!e.service)return;const t=e.service.name??e.service.id??"service",o=e.service.status??"unknown";En(`${t}: ${o}`)}),Ve("token.changed",n=>{const e=n;!e.session_id||!e.total_output||En(`Token update: +${e.total_output} output`)}))}Ia();const Js=new Set(["http:","https:"]),Ta=new Set(["\\href","\\url"]),Ra=/^data:image\/(?:avif|gif|jpeg|png|webp);base64,[a-z0-9+/]+={0,2}$/i,Na=/^(?:\/|\.\/)?assets\//,Da=/%(?:2e|2f|5c)/i,ei=/[\u0000-\u001f\u007f]/;function $o(n){const e=n.trim();if(!/^https?:\/\//i.test(e)||ei.test(e))return null;try{const t=new URL(e);return Js.has(t.protocol)?t.href:null}catch{return null}}function $a(n){if(!Na.test(n)||n.startsWith("//")||n.includes("\\")||Da.test(n))return null;try{const e=new URL(n,"https://genericagent.invalid/");return e.origin==="https://genericagent.invalid"&&e.pathname.startsWith("/assets/")?n:null}catch{return null}Line truncated var Mi=Object.defineProperty;var Li=(n,e,t)=>e in n?Mi(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var xt=(n,e,t)=>Li(n,typeof e!="symbol"?e+"":e,t);import{g as We,r as Ii,a as Ti,c as fe,b as a,d as As,e as Fs,B as Te,_ as Be,f as ge,h as $,i as De,j as Ri,E as Ni,R as g,k as de,l as I,m as Ge,n as zs,P as h,w as Bs,o as jo,p as Je,q as rn,s as cn,t as No,u as Di,v as $i,x as Ai,y as Fi,z as zi,A as Bi,C as Ui,D as Vi,F as Ki,G as Wi,H as Us,I as Hi,T as Do,J as sn,K as Zi,L as qi,M as Gi,N as Pt,O as Vs,Q as Ks,S as Ws,U as Hs,V as Qi,W as Zs,X as qs,Y as Eo,Z as Yi,$ as Xi,a0 as Ji,a1 as ea,a2 as ta,a3 as na,a4 as oa,a5 as ra,a6 as sa,a7 as ia,a8 as aa,a9 as la,aa as Go,ab as $e,ac as ca,ad as da,ae as Jt,af as ua,ag as pa,ah as Oo,ai as me,aj as i,ak as ha,al as ma,am as fa,an as ga,ao as Qo,ap as dt,aq as ya,ar as ba,as as va,at as xa}from"./tauri-compat-tfiFK9EG.js";import{I as dn,a as Gs,b as Qs,c as Ys,B as ie}from"./index-Bpi3BHKj.js";import{W as wa}from"./WindowsTitlebar-CrkUa1UM.js";const Ca="modulepreload",Sa=function(n){return"/"+n},Yo={},Gt=function(e,t,o){let r=Promise.resolve();if(t&&t.length>0){let l=function(p){return Promise.all(p.map(d=>Promise.resolve(d).then(m=>({status:"fulfilled",value:m}),m=>({status:"rejected",reason:m}))))};document.getElementsByTagName("link");const c=document.querySelector("meta[property=csp-nonce]"),u=(c==null?void 0:c.nonce)||(c==null?void 0:c.getAttribute("nonce"));r=l(t.map(p=>{if(p=Sa(p),p in Yo)return;Yo[p]=!0;const d=p.endsWith(".css"),m=d?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${p}"]${m}`))return;const f=document.createElement("link");if(f.rel=d?"stylesheet":Ca,d||(f.as="script"),f.crossOrigin="",f.href=p,u&&f.setAttribute("nonce",u),document.head.appendChild(f),d)return new Promise((b,y)=>{f.addEventListener("load",b),f.addEventListener("error",()=>y(new Error(`Unable to preload CSS for ${p}`)))})}))}function s(l){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=l,window.dispatchEvent(c),!c.defaultPrevented)throw l}return r.then(l=>{for(const c of l||[])c.status==="rejected"&&s(c.reason);return e().catch(s)})};function Xo(n,e){const t=e,o=new URL(t);if(o.protocol!=="http:"&&o.protocol!=="https:")throw new Error(`Service endpoint must use HTTP(S): ${t}`);return o.toString().replace(/\/+$/,"")}function Jo(n){const e=new URL(n);return e.protocol=e.protocol==="https:"?"wss:":"ws:",e.pathname=`${e.pathname.replace(/\/+$/,"")}/ws`,e.toString().replace(/\/$/,"")}function ka(n){const e=Xo(n.VITE_BRIDGE_BASE,"http://127.0.0.1:14168"),t=Xo(n.VITE_CONDUCTOR_BASE,"http://127.0.0.1:8900");return{bridgeBase:e,conductorBase:t,wsUrl:Jo(e),conductorWsUrl:Jo(t)}}const un=ka({VITE_BRIDGE_BASE:void 0,VITE_CONDUCTOR_BASE:void 0}),ee=un.bridgeBase,ja=un.conductorBase,Ea=un.wsUrl,Oa=un.conductorWsUrl,Pa=1e3,_a=3e4;let ke=null,Po=0,jn=null;const jt=new Map;let _o="offline";const Mo=new Set;let er=!1;const Ma=new Set;function En(n){n!==_o&&(_o=n,n==="ready"&&(er||(er=!0,Ma.forEach(e=>e()))),Mo.forEach(e=>e(n)))}function tr(){return _o}function Xs(n){return Mo.add(n),()=>{Mo.delete(n)}}function Js(){if(!(ke&&(ke.readyState===WebSocket.OPEN||ke.readyState===WebSocket.CONNECTING))){En("connecting");try{ke=new WebSocket(Ea)}catch{nr();return}ke.onopen=()=>{Po=0,En("ready")},ke.onmessage=n=>{try{const e=JSON.parse(n.data),t=e.type;if(!t)return;const o=jt.get(t);o&&o.forEach(r=>r(e))}catch{}},ke.onclose=()=>{ke=null,En("connecting"),nr()},ke.onerror=()=>{ke==null||ke.close()}}}function nr(){if(jn)return;const n=Math.min(Pa*2**Po,_a);Po++,jn=setTimeout(()=>{jn=null,Js()},n)}function Ve(n,e){return jt.has(n)||jt.set(n,new Set),jt.get(n).add(e),Js(),()=>{var t;(t=jt.get(n))==null||t.delete(e)}}let or=[];const La=new Set;let rr=!1;function Ia(){for(const n of La)n()}function On(n){or=[...or.slice(-39),n],Ia()}function Ta(){rr||(rr=!0,Ve("session-state",n=>{const e=n;if(!e.sessionId||!e.status)return;const t=e.status==="running"?"Turn started":e.status==="idle"?"Turn complete":e.status==="error"?"Turn error":`Session ${e.status}`;On(t)}),Ve("service.changed",n=>{const e=n;if(!e.service)return;const t=e.service.name??e.service.id??"service",o=e.service.status??"unknown";On(`${t}: ${o}`)}),Ve("token.changed",n=>{const e=n;!e.session_id||!e.total_output||On(`Token update: +${e.total_output} output`)}))}Ta();const ei=new Set(["http:","https:"]),Ra=new Set(["\\href","\\url"]),Na=/^data:image\/(?:avif|gif|jpeg|png|webp);base64,[a-z0-9+/]+={0,2}$/i,Da=/^(?:\/|\.\/)?assets\//,$a=/%(?:2e|2f|5c)/i,ti=/[\u0000-\u001f\u007f]/;function $o(n){const e=n.trim();if(!/^https?:\/\//i.test(e)||ti.test(e))return null;try{const t=new URL(e);return ei.has(t.protocol)?t.href:null}catch{return null}}function Aa(n){if(!Da.test(n)||n.startsWith("//")||n.includes("\\")||$a.test(n))return null;try{const e=new URL(n,"https://genericagent.invalid/");return e.origin==="https://genericagent.invalid"&&e.pathname.startsWith("/assets/")?n:null}catch{return null}Line truncated
/new 新会话 /clear 清屏 /stop 停止 /settings 设置`,"slash.unknown":"未知命令","upload.hint":"上传文件:选择 / 拖拽 / 粘贴","upload.button":"上传文件","upload.tooLarge":"文件过大或数量超限","upload.empty":"跳过空文件","upload.failed":"上传失败","err.charLimit":"已达字数上限({n}),发送时将自动截断","err.charLimitReached":"已达字数上限({n})","err.numMax":"不能超过 {n}","file.openFailed":"无法打开文件","file.kindGeneric":"文件","file.kindDoc":"文档","file.kindSheet":"表格","file.kindSlide":"幻灯片","file.kindCode":"代码","file.kindArchive":"压缩包","file.kindAudio":"音频","file.kindVideo":"视频","upload.removeTitle":"移除","upload.dropHint":"松开以上传文件","lightbox.closeTitle":"关闭","fold.thinking":"思考","fold.tool":"工具调用","fold.toolResult":"工具结果","fold.llm":"LLM Running","fold.turn":"第 {n} 轮","plan.header":"计划 ({done}/{total})","plan.complete":"✓ 计划完成 ({n}/{n})","plan.running":"计划执行中","plan.completeTitle":"计划完成","plan.placeholder":"计划模式已激活","plan.waiting":"等待写入 {path} …","plan.overflow":"还有 {n} 项","plan.current":"当前","plan.collapse":"收起","plan.expand":"展开","plan.details":"详情","plan.capsuleRunning":"运行中","plan.capsuleComplete":"已完成","timing.elapsed":"已运行 {t}","chip.plan":"Plan","chip.auto":"Auto","ch.wechat":"微信","ch.wecom":"企业微信","ch.lark":"飞书","ch.dingtalk":"钉钉","ch.qq":"QQ","ch.telegram":"Telegram","ch.discord":"Discord","ch.loading":"加载中…","ch.empty":"未发现 IM 进程脚本","ch.logEmpty":"暂无日志","err.channelLoad":"加载失败","err.channelStart":"启动失败","err.channelStop":"停止失败","err.mykeyImport":"导入模型配置失败","err.mykeyExport":"导出模型配置失败","err.channelNotConfigured":"请先在密钥配置中完成该平台设置","sys.channelStarted":"已启动","sys.channelStopped":"已停止","sys.bridgeDisconnecting":"正在断开本地连接","modal.channelLogs":"进程日志","modal.mykeyConfig":"密钥配置","sys.configSaved":"配置已保存","sys.mykeyImported":"模型配置已导入","sys.mykeyExported":"模型配置已导出","st.starting":"启动中…","st.stopping":"停止中…","st.online":"在线","st.offline":"离线","st.error":"错误","st.running":"运行中","st.stopped":"已停止","st.abnormal":"异常","st.warning":"警告","err.portBusy":"端口被占用,已自动重连","err.conductorCrash":"内部线程异常退出","err.missingModule":"缺少依赖模块","err.connRefused":"连接被拒绝,将自动重试","err.timeout":"连接超时","err.apiKeyInvalid":"API Key 无效或已过期","err.modelNotFound":"模型不存在或不可用","err.rateLimit":"请求频率超限,请稍后重试","err.quotaExceeded":"额度不足","err.processCrash":"后台进程异常退出","act.configure":"配置","act.logs":"日志","act.restart":"重启","act.stop":"停止","act.start":"启动","act.disconnect":"断开","act.copy":"复制","act.copied":"已复制","act.copyTex":"TeX","act.send":"发送","proc.imbotWechat":"imbot · 微信","proc.imbotDing":"imbot · 钉钉","proc.bridge":"本地连接","proc.bridgeSummary":"连接桌面应用与本地运行环境","proc.bridgeTip":"保持桌面应用与本地运行环境通信","proc.scheduler":"定时任务","proc.schedulerSummary":"按计划自动执行任务","proc.schedulerTip":"在设定时间自动触发并执行任务","proc.conductor":"指挥家","proc.conductorSummary":"异步处理多步骤任务","proc.conductorTip":"通过异步对话拆解任务、分派执行,并持续跟进进度","proc.runtimeComponent":"运行组件","proc.runtimeComponentSummary":"本地运行环境中持续工作的组件","proc.runtimeComponentTip":"查看该组件的状态、日志与控制项","cm.scheduling":"调度中","cm.running":"执行中","cm.idleSt":"空闲","cm.master":"已派 3 子任务","cm.w1":"子任务:抓取数据","cm.w2":"子任务:复核结果","cm.sub":"等待派单","tok.total":"累计","tok.cost":"缓存率","tok.today":"今日","tok.tabAll":"会话","tok.tabConductor":"指挥家","tok.condTotal":"指挥家累计","tok.condCurrent":"指挥家本次","tok.condTip":"指挥家消耗不计入会话累计","tok.condOffline":"指挥家服务离线","tok.disclaimer":"不同 API 网站的计费价格可能会有差异,请以实际网站为准。","tok.colSession":"会话","tok.colIn":"输入","tok.colOut":"输出","tok.colCacheW":"缓存写入","tok.colCache":"缓存读取","tok.colCost":"成本","tok.from":"从","tok.to":"到","tok.reset":"重置","tok.noData":"暂无记录","tok.deleted":"此会话已删除","tok.pricingUnknown":"⚠ 此模型计费规则尚未明确,按默认估算","tok.priceInput":"输入: $","tok.priceOutput":"输出: $","tok.priceCacheW":"缓存写入: $","tok.priceCacheR":"缓存读取: $","presetPrompt.goal":"Line truncated /new 新会话 /clear 清屏 /stop 停止 /settings 设置`,"slash.unknown":"未知命令","upload.hint":"上传文件:选择 / 拖拽 / 粘贴","upload.button":"上传文件","upload.tooLarge":"文件过大或数量超限","upload.empty":"跳过空文件","upload.failed":"上传失败","err.charLimit":"已达字数上限({n}),发送时将自动截断","err.charLimitReached":"已达字数上限({n})","err.numMax":"不能超过 {n}","file.openFailed":"无法打开文件","file.kindGeneric":"文件","file.kindDoc":"文档","file.kindSheet":"表格","file.kindSlide":"幻灯片","file.kindCode":"代码","file.kindArchive":"压缩包","file.kindAudio":"音频","file.kindVideo":"视频","upload.removeTitle":"移除","upload.dropHint":"松开以上传文件","lightbox.closeTitle":"关闭","fold.thinking":"思考","fold.tool":"工具调用","fold.toolResult":"工具结果","fold.llm":"LLM Running","fold.turn":"第 {n} 轮","plan.header":"计划 ({done}/{total})","plan.complete":"✓ 计划完成 ({n}/{n})","plan.running":"计划执行中","plan.completeTitle":"计划完成","plan.placeholder":"计划模式已激活","plan.waiting":"等待写入 {path} …","plan.overflow":"还有 {n} 项","plan.current":"当前","plan.collapse":"收起","plan.expand":"展开","plan.details":"详情","plan.capsuleRunning":"运行中","plan.capsuleComplete":"已完成","timing.elapsed":"已运行 {t}","chip.plan":"Plan","chip.auto":"Auto","ch.wechat":"微信","ch.wecom":"企业微信","ch.lark":"飞书","ch.dingtalk":"钉钉","ch.qq":"QQ","ch.telegram":"Telegram","ch.discord":"Discord","ch.loading":"加载中…","ch.empty":"未发现 IM 进程脚本","ch.logEmpty":"暂无日志","err.channelLoad":"加载失败","err.channelStart":"启动失败","err.channelStop":"停止失败","err.mykeyImport":"导入模型配置失败","err.mykeyExport":"导出模型配置失败","err.channelNotConfigured":"请先在密钥配置中完成该平台设置","sys.channelStarted":"已启动","sys.channelStopped":"已停止","sys.bridgeDisconnecting":"正在断开本地连接","modal.channelLogs":"进程日志","modal.mykeyConfig":"密钥配置","sys.configSaved":"配置已保存","sys.mykeyImported":"模型配置已导入","sys.mykeyExported":"模型配置已导出","st.starting":"启动中…","st.stopping":"停止中…","st.online":"在线","st.offline":"离线","st.error":"错误","st.running":"运行中","st.stopped":"已停止","st.abnormal":"异常","st.warning":"警告","err.portBusy":"端口被占用,已自动重连","err.conductorCrash":"内部线程异常退出","err.missingModule":"缺少依赖模块","err.connRefused":"连接被拒绝,将自动重试","err.timeout":"连接超时","err.apiKeyInvalid":"API Key 无效或已过期","err.modelNotFound":"模型不存在或不可用","err.rateLimit":"请求频率超限,请稍后重试","err.quotaExceeded":"额度不足","err.processCrash":"后台进程异常退出","act.configure":"配置","act.logs":"日志","act.restart":"重启","act.stop":"停止","act.start":"启动","act.disconnect":"断开","act.copy":"复制","act.copied":"已复制","act.copyTex":"TeX","act.send":"发送","proc.imbotWechat":"imbot · 微信","proc.imbotDing":"imbot · 钉钉","proc.bridge":"本地连接","proc.bridgeSummary":"连接桌面应用与本地运行环境","proc.bridgeTip":"保持桌面应用与本地运行环境通信","proc.scheduler":"定时任务","proc.schedulerSummary":"按计划自动执行任务","proc.schedulerTip":"在设定时间自动触发并执行任务","proc.conductor":"指挥家","proc.conductorSummary":"异步处理多步骤任务","proc.conductorTip":"通过异步对话拆解任务、分派执行,并持续跟进进度","proc.runtimeComponent":"运行组件","proc.runtimeComponentSummary":"本地运行环境中持续工作的组件","proc.runtimeComponentTip":"查看该组件的状态、日志与控制项","cm.scheduling":"调度中","cm.running":"执行中","cm.idleSt":"空闲","cm.master":"已派 3 子任务","cm.w1":"子任务:抓取数据","cm.w2":"子任务:复核结果","cm.sub":"等待派单","tok.total":"累计","tok.cost":"缓存率","tok.today":"今日","tok.tabAll":"会话","tok.tabConductor":"指挥家","tok.condTotal":"指挥家累计","tok.condCurrent":"指挥家本次","tok.condTip":"指挥家消耗不计入会话累计","tok.condOffline":"指挥家服务离线","tok.disclaimer":"不同 API 网站的计费价格可能会有差异,请以实际网站为准。","tok.colSession":"会话","tok.colIn":"输入","tok.colOut":"输出","tok.colCacheW":"缓存写入","tok.colCache":"缓存读取","tok.colCost":"成本","tok.from":"从","tok.to":"到","tok.reset":"重置","tok.noData":"暂无记录","tok.deleted":"此会话已删除","tok.pricingUnknown":"⚠ 此模型计费规则尚未明确,按默认估算","tok.priceInput":"输入: $","tok.priceOutput":"输出: $","tok.priceCacheW":"缓存写入: $","tok.priceCacheR":"缓存读取: $","presetPrompt.goal":"Line truncated
/new new chat /clear clear /stop stop /settings settings`,"slash.unknown":"Unknown command","upload.hint":"Upload file: pick / drag / paste","upload.button":"Upload file","upload.tooLarge":"File too large or limit reached","upload.empty":"Skipped empty file","upload.failed":"Upload failed","err.charLimit":"Character limit reached ({n}), text will be truncated on send","err.charLimitReached":"Character limit reached ({n})","err.numMax":"Cannot exceed {n}","file.openFailed":"Cannot open file","file.kindGeneric":"File","file.kindDoc":"Document","file.kindSheet":"Spreadsheet","file.kindSlide":"Slides","file.kindCode":"Code","file.kindArchive":"Archive","file.kindAudio":"Audio","file.kindVideo":"Video","upload.removeTitle":"Remove","upload.dropHint":"Drop to upload files","lightbox.closeTitle":"Close","fold.thinking":"Thinking","fold.tool":"Tool call","fold.toolResult":"Tool result","fold.llm":"LLM Running","fold.turn":"Turn {n}","plan.header":"Plan ({done}/{total})","plan.complete":"✓ Plan complete ({n}/{n})","plan.running":"Running plan","plan.completeTitle":"Plan complete","plan.placeholder":"Plan mode activated","plan.waiting":"waiting for {path} …","plan.overflow":"+{n} more","plan.current":"Now","plan.collapse":"Collapse","plan.expand":"Expand","plan.details":"Details","plan.capsuleRunning":"Running","plan.capsuleComplete":"Done","timing.elapsed":"Elapsed {t}","chip.plan":"Plan","chip.auto":"Auto","ch.wechat":"WeChat","ch.wecom":"WeCom","ch.lark":"Lark","ch.dingtalk":"DingTalk","ch.qq":"QQ","ch.telegram":"Telegram","ch.discord":"Discord","ch.loading":"Loading…","ch.empty":"No IM process scripts found","ch.logEmpty":"No log output yet","err.channelLoad":"Failed to load","err.channelStart":"Start failed","err.channelStop":"Stop failed","err.mykeyImport":"Failed to import model config","err.mykeyExport":"Failed to export model config","err.channelNotConfigured":"Complete this platform setup in Key configuration first","sys.channelStarted":"Started","sys.channelStopped":"Stopped","sys.bridgeDisconnecting":"Disconnecting from the local runtime","modal.channelLogs":"Process logs","modal.mykeyConfig":"Key configuration","sys.configSaved":"Configuration saved","sys.mykeyImported":"Model config imported","sys.mykeyExported":"Model config exported","st.starting":"Starting…","st.stopping":"Stopping…","st.online":"Online","st.offline":"Offline","st.error":"Error","st.running":"Running","st.stopped":"Stopped","st.abnormal":"Error","st.warning":"Warning","err.portBusy":"Port was busy, reconnected","err.conductorCrash":"Internal thread crashed","err.missingModule":"Missing module","err.connRefused":"Connection refused, retrying","err.timeout":"Connection timed out","err.apiKeyInvalid":"API key invalid or expired","err.modelNotFound":"Model not found or unavailable","err.rateLimit":"Rate limited, try again later","err.quotaExceeded":"Quota exceeded","err.processCrash":"Background process crashed","act.configure":"Configure","act.logs":"Logs","act.restart":"Restart","act.stop":"Stop","act.start":"Start","act.disconnect":"Disconnect","act.copy":"Copy","act.copied":"Copied","act.copyTex":"TeX","act.send":"Send","proc.imbotWechat":"imbot · WeChat","proc.imbotDing":"imbot · DingTalk","proc.bridge":"Local connection","proc.bridgeSummary":"Connects the desktop app to the local runtime","proc.bridgeTip":"Keeps the desktop app and local runtime communicating","proc.scheduler":"Scheduled tasks","proc.schedulerSummary":"Runs tasks on schedule","proc.schedulerTip":"Triggers and runs tasks at configured times","proc.conductor":"Conductor","proc.conductorSummary":"Handles multi-step work asynchronously","proc.conductorTip":"Uses async conversations to break down, delegate, and follow through on tasks","proc.runtimeComponent":"Runtime component","proc.runtimeComponentSummary":"A component that runs in the local environment","proc.runtimeComponentTip":"View this component’s status, logs, and controls","cm.scheduling":"Scheduling","cm.running":"Running","cm.idleSt":"Idle","cm.master":"Dispatched 3 subtasks","cm.w1":"Subtask: fetch data","cm.w2":"Subtask: review results","cm.sub":"Waiting for tasks","tok.total":"Total","tok.cost":"Cache rate","tok.today":"Today","tok.tabAll":"Chat","tok.tabConductor":"Conductor","tok.condTotal":"Conductor Total","tok.condCurrent":"Conductor Current","tok.condTip":"Conductor usage is not included in chat totals","tok.condOffline":"Service offline","tok.disclaimer":"Pricing may vary by API provider. Please refer to the actual website.","tok.colSession":"Session","tok.colIn":"Input","tok.colOut":"Output","tok.colCacheW":"Cache write","tok.colCache":"Cache read","tok.colCost":"Cost","tok.from":"From","tok.to":"To","tok.reset":"Reset","tok.noData":"No records","tok.deleted":"Session deleted","tok.pricingUnknown":"⚠ Pricing not confirmed, using defaults","tok.priceInput":"Input: $","tok.priceOutput":"Output: $","tok.priceCacheW":"Cache write: $","tok.priceCacheR":"Cache read: $","presetPromptLine truncated /new new chat /clear clear /stop stop /settings settings`,"slash.unknown":"Unknown command","upload.hint":"Upload file: pick / drag / paste","upload.button":"Upload file","upload.tooLarge":"File too large or limit reached","upload.empty":"Skipped empty file","upload.failed":"Upload failed","err.charLimit":"Character limit reached ({n}), text will be truncated on send","err.charLimitReached":"Character limit reached ({n})","err.numMax":"Cannot exceed {n}","file.openFailed":"Cannot open file","file.kindGeneric":"File","file.kindDoc":"Document","file.kindSheet":"Spreadsheet","file.kindSlide":"Slides","file.kindCode":"Code","file.kindArchive":"Archive","file.kindAudio":"Audio","file.kindVideo":"Video","upload.removeTitle":"Remove","upload.dropHint":"Drop to upload files","lightbox.closeTitle":"Close","fold.thinking":"Thinking","fold.tool":"Tool call","fold.toolResult":"Tool result","fold.llm":"LLM Running","fold.turn":"Turn {n}","plan.header":"Plan ({done}/{total})","plan.complete":"✓ Plan complete ({n}/{n})","plan.running":"Running plan","plan.completeTitle":"Plan complete","plan.placeholder":"Plan mode activated","plan.waiting":"waiting for {path} …","plan.overflow":"+{n} more","plan.current":"Now","plan.collapse":"Collapse","plan.expand":"Expand","plan.details":"Details","plan.capsuleRunning":"Running","plan.capsuleComplete":"Done","timing.elapsed":"Elapsed {t}","chip.plan":"Plan","chip.auto":"Auto","ch.wechat":"WeChat","ch.wecom":"WeCom","ch.lark":"Lark","ch.dingtalk":"DingTalk","ch.qq":"QQ","ch.telegram":"Telegram","ch.discord":"Discord","ch.loading":"Loading…","ch.empty":"No IM process scripts found","ch.logEmpty":"No log output yet","err.channelLoad":"Failed to load","err.channelStart":"Start failed","err.channelStop":"Stop failed","err.mykeyImport":"Failed to import model config","err.mykeyExport":"Failed to export model config","err.channelNotConfigured":"Complete this platform setup in Key configuration first","sys.channelStarted":"Started","sys.channelStopped":"Stopped","sys.bridgeDisconnecting":"Disconnecting from the local runtime","modal.channelLogs":"Process logs","modal.mykeyConfig":"Key configuration","sys.configSaved":"Configuration saved","sys.mykeyImported":"Model config imported","sys.mykeyExported":"Model config exported","st.starting":"Starting…","st.stopping":"Stopping…","st.online":"Online","st.offline":"Offline","st.error":"Error","st.running":"Running","st.stopped":"Stopped","st.abnormal":"Error","st.warning":"Warning","err.portBusy":"Port was busy, reconnected","err.conductorCrash":"Internal thread crashed","err.missingModule":"Missing module","err.connRefused":"Connection refused, retrying","err.timeout":"Connection timed out","err.apiKeyInvalid":"API key invalid or expired","err.modelNotFound":"Model not found or unavailable","err.rateLimit":"Rate limited, try again later","err.quotaExceeded":"Quota exceeded","err.processCrash":"Background process crashed","act.configure":"Configure","act.logs":"Logs","act.restart":"Restart","act.stop":"Stop","act.start":"Start","act.disconnect":"Disconnect","act.copy":"Copy","act.copied":"Copied","act.copyTex":"TeX","act.send":"Send","proc.imbotWechat":"imbot · WeChat","proc.imbotDing":"imbot · DingTalk","proc.bridge":"Local connection","proc.bridgeSummary":"Connects the desktop app to the local runtime","proc.bridgeTip":"Keeps the desktop app and local runtime communicating","proc.scheduler":"Scheduled tasks","proc.schedulerSummary":"Runs tasks on schedule","proc.schedulerTip":"Triggers and runs tasks at configured times","proc.conductor":"Conductor","proc.conductorSummary":"Handles multi-step work asynchronously","proc.conductorTip":"Uses async conversations to break down, delegate, and follow through on tasks","proc.runtimeComponent":"Runtime component","proc.runtimeComponentSummary":"A component that runs in the local environment","proc.runtimeComponentTip":"View this component’s status, logs, and controls","cm.scheduling":"Scheduling","cm.running":"Running","cm.idleSt":"Idle","cm.master":"Dispatched 3 subtasks","cm.w1":"Subtask: fetch data","cm.w2":"Subtask: review results","cm.sub":"Waiting for tasks","tok.total":"Total","tok.cost":"Cache rate","tok.today":"Today","tok.tabAll":"Chat","tok.tabConductor":"Conductor","tok.condTotal":"Conductor Total","tok.condCurrent":"Conductor Current","tok.condTip":"Conductor usage is not included in chat totals","tok.condOffline":"Service offline","tok.disclaimer":"Pricing may vary by API provider. Please refer to the actual website.","tok.colSession":"Session","tok.colIn":"Input","tok.colOut":"Output","tok.colCacheW":"Cache write","tok.colCache":"Cache read","tok.colCost":"Cost","tok.from":"From","tok.to":"To","tok.reset":"Reset","tok.noData":"No records","tok.deleted":"Session deleted","tok.pricingUnknown":"⚠ Pricing not confirmed, using defaults","tok.priceInput":"Input: $","tok.priceOutput":"Output: $","tok.priceCacheW":"Cache write: $","tok.priceCacheR":"Cache read: $","presetPromptLine truncated
`)}),i.jsxs("div",{className:"ga-bridge-panel-section-foot",children:[_&&i.jsx("span",{className:"ga-bridge-panel-truncated",children:e("bridge.logLineCount",{count:m})}),i.jsxs("button",{className:"ga-bridge-panel-link-btn",onClick:k,children:[e("bridge.viewAllLogs")," →"]})]})]})]})}const lu=[{key:"services",icon:"symbol-misc",textKey:"nav.services"},{key:"collab",icon:"robot",textKey:"nav.collab"},{key:"token",icon:"graph",textKey:"nav.token"}];function cu(){const{activePage:n,setPage:e}=Ie(),t=H(E=>E.open),o=X(E=>E.newSession),r=X(E=>E.sessions),s=X(E=>E.activeSessionId),l=X(E=>E.setActiveSession),c=X(E=>E.runningSessions),{t:u}=ce(),[p,d]=a.useState(!0),[m,f]=a.useState(""),[b,y]=a.useState(!1),[S,w]=a.useState(!1),C=a.useCallback(()=>y(!1),[]),k=a.useCallback(()=>{C(),t()},[C,t]),_=a.useCallback(()=>{w(!1),y(E=>!E)},[]),x=[...r].sort((E,D)=>{if(E.pinned&&!D.pinned)return-1;if(!E.pinned&&D.pinned)return 1;const P=Number(E.updatedAt||E.createdAt||0);return Number(D.updatedAt||D.createdAt||0)-P}),j=m.trim()?x.filter(E=>E.title.toLowerCase().includes(m.trim().toLowerCase())):x;function v(){o(),e("chat")}function O(E){l(E),e("chat")}return i.jsxs("div",{className:"ga-left-sidebar",children:[i.jsxs("nav",{className:"ga-nav-rail","aria-label":"Main navigation",children:[i.jsxs("button",{type:"button",className:"ga-nav-btn",onClick:v,"aria-label":u("nav.chat"),children:[i.jsx("span",{className:"ga-nav-icon",children:i.jsx(Ee,{name:"comment",size:"1rem"})}),i.jsx("span",{className:"ga-nav-label",children:u("nav.chat")})]}),lu.map(E=>i.jsxs("button",{type:"button",className:`ga-nav-btn${n===E.key?" active":""}`,onClick:()=>e(E.key),"aria-label":u(E.textKey),"aria-current":n===E.key?"page":void 0,children:[i.jsx("span",{className:"ga-nav-icon",children:i.jsx(Ee,{name:E.icon,size:"1rem"})}),i.jsx("span",{className:"ga-nav-label",children:u(E.textKey)})]},E.key))]}),i.jsx("div",{className:"ga-sidebar-search",children:i.jsx(ut,{prefix:i.jsx(ti,{style:{fontSize:14}}),placeholder:u("search.placeholder"),size:"small",value:m,onChange:f})}),!m&&i.jsx(zd,{label:u("section.sessions"),count:r.length,open:p,onToggle:d,onAction:v}),i.jsx("div",{className:"ga-session-section",children:(m||p)&&(j.length===0?i.jsx("div",{className:"ga-session-empty",children:i.jsx("p",{children:u(m?"search.noResults":"conv.emptyList")})}):i.jsx("div",{className:"ga-session-list",children:j.map(E=>i.jsx(Ud,{session:E,isActive:E.id===s,isWorking:c.has(E.id),onClick:()=>O(E.id)},E.id))}))}),i.jsxs("div",{className:"ga-sidebar-footer",children:[i.jsx($e,{content:u("foot.settings"),position:"top",clickToHide:!0,children:i.jsx("button",{type:"button",className:"ga-sidebar-footer-btn",onClick:k,"aria-label":u("foot.settings"),children:i.jsx(Ee,{name:"settings-gear",size:"1rem"})})}),i.jsxs("div",{className:"ga-sidebar-footer-anchor",children:[i.jsx($e,{content:u("foot.runtimeManagement"),position:"top",visible:S&&!b,onVisibleChange:w,children:i.jsx("button",{type:"button",className:"ga-sidebar-footer-btn",onClick:_,"aria-label":u("foot.runtimeManagement"),"aria-expanded":b,"aria-haspopup":"dialog","aria-controls":"ga-runtime-management-panel",children:i.jsx(Ee,{name:"server-process",size:"1rem"})})}),b&&i.jsx(au,{onClose:C})]})]})]})}const du=24;function uu(){const n=a.useRef(null),[e,t]=a.useState(!0),o=a.useRef(!0),r=a.useRef(0),s=a.useCallback(()=>{const u=n.current;if(!u)return;const p=u.scrollHeight-u.scrollTop-u.clientHeight<du;t(p),o.current=p},[]),l=a.useCallback((u="instant")=>{const p=n.current;p&&(u==="instant"?p.scrollTop=p.scrollHeight:pu(p,p.scrollHeight-p.clientHeight,170),o.current=!0,t(!0))},[]),c=a.useCallback(()=>{o.current=!1},[]);return a.useEffect(()=>{const u=n.current;if(!u)return;const p=()=>s(),d=new MutationObserver(()=>{o.current&&(cancelAnimationFrame(r.current),r.current=requestAnimationFrame(()=>{u.scrollTop=u.scrollHeight}))});return u.addEventListener("scroll",p,{passive:!0}),d.observe(u,{childList:!0,subtree:!0,characterData:!0}),()=>{u.removeEventListener("scroll",p),d.disconnect(),cancelAnimationFrame(r.current)}},[s]),{scrollRef:n,isAtBottom:e,scrollToBottom:l,stopScroll:c}}function pu(n,e,t){const o=n.scrollTop,r=e-o,s=performance.now();function l(c){const u=c-s,p=Math.min(u/t,1),d=1-Math.pow(1-p,3);n.scrollTop=o+r*d,p<1&&requestAnimationFrame(l)}requestAnimationFrame(l)}function hu(n,e,t,o){a.useEffect(()=>{const r=n.current;if(!r||!o)return;t(),r.scrollTop=r.scrollHeight;let s=0,l=r.scrollHeight,c=0;function u(){if(r){if(c++,r.scrollHeight===l?s++:(s=0,l=r.scrollHeight,r.scrollTop=r.scrollHeight),s>=5||c>=90){e("instant");return}requestAnimationFrame(u)}}requestAnimationFrame(u)},[o,n,e,t])}function mu({children:n}){return i.jsx("div",{"data-slot":"aui_thread-content",children:n})}function yt(n){const e=/^[ \t]*(`{3,})([^\n`]*)[ \t]*$/.exec(n??"");return e?{ticks:e[1].length,tag:e[2]}:null}function bi(n,e){if(/^🛠️ Tool:/.test(n))return!0;if(!(e!=null&&e.forToolResult)){const t=yt(n);if(t&&t.ticks>=5&&t. Line truncated `)}),i.jsxs("div",{className:"ga-bridge-panel-section-foot",children:[_&&i.jsx("span",{className:"ga-bridge-panel-truncated",children:e("bridge.logLineCount",{count:m})}),i.jsxs("button",{className:"ga-bridge-panel-link-btn",onClick:k,children:[e("bridge.viewAllLogs")," →"]})]})]})]})}const cu=[{key:"services",icon:"symbol-misc",textKey:"nav.services"},{key:"collab",icon:"robot",textKey:"nav.collab"},{key:"token",icon:"graph",textKey:"nav.token"}];function du(){const{activePage:n,setPage:e}=Ie(),t=H(E=>E.open),o=X(E=>E.newSession),r=X(E=>E.sessions),s=X(E=>E.activeSessionId),l=X(E=>E.setActiveSession),c=X(E=>E.runningSessions),{t:u}=ce(),[p,d]=a.useState(!0),[m,f]=a.useState(""),[b,y]=a.useState(!1),[S,w]=a.useState(!1),C=a.useCallback(()=>y(!1),[]),k=a.useCallback(()=>{C(),t()},[C,t]),_=a.useCallback(()=>{w(!1),y(E=>!E)},[]),x=[...r].sort((E,D)=>{if(E.pinned&&!D.pinned)return-1;if(!E.pinned&&D.pinned)return 1;const P=Number(E.updatedAt||E.createdAt||0);return Number(D.updatedAt||D.createdAt||0)-P}),j=m.trim()?x.filter(E=>E.title.toLowerCase().includes(m.trim().toLowerCase())):x;function v(){o(),e("chat")}function O(E){l(E),e("chat")}return i.jsxs("div",{className:"ga-left-sidebar",children:[i.jsxs("nav",{className:"ga-nav-rail","aria-label":"Main navigation",children:[i.jsxs("button",{type:"button",className:"ga-nav-btn",onClick:v,"aria-label":u("nav.chat"),children:[i.jsx("span",{className:"ga-nav-icon",children:i.jsx(Ee,{name:"comment",size:"1rem"})}),i.jsx("span",{className:"ga-nav-label",children:u("nav.chat")})]}),cu.map(E=>i.jsxs("button",{type:"button",className:`ga-nav-btn${n===E.key?" active":""}`,onClick:()=>e(E.key),"aria-label":u(E.textKey),"aria-current":n===E.key?"page":void 0,children:[i.jsx("span",{className:"ga-nav-icon",children:i.jsx(Ee,{name:E.icon,size:"1rem"})}),i.jsx("span",{className:"ga-nav-label",children:u(E.textKey)})]},E.key))]}),i.jsx("div",{className:"ga-sidebar-search",children:i.jsx(ut,{prefix:i.jsx(ni,{style:{fontSize:14}}),placeholder:u("search.placeholder"),size:"small",value:m,onChange:f})}),!m&&i.jsx(Bd,{label:u("section.sessions"),count:r.length,open:p,onToggle:d,onAction:v}),i.jsx("div",{className:"ga-session-section",children:(m||p)&&(j.length===0?i.jsx("div",{className:"ga-session-empty",children:i.jsx("p",{children:u(m?"search.noResults":"conv.emptyList")})}):i.jsx("div",{className:"ga-session-list",children:j.map(E=>i.jsx(Vd,{session:E,isActive:E.id===s,isWorking:c.has(E.id),onClick:()=>O(E.id)},E.id))}))}),i.jsxs("div",{className:"ga-sidebar-footer",children:[i.jsx($e,{content:u("foot.settings"),position:"top",clickToHide:!0,children:i.jsx("button",{type:"button",className:"ga-sidebar-footer-btn",onClick:k,"aria-label":u("foot.settings"),children:i.jsx(Ee,{name:"settings-gear",size:"1rem"})})}),i.jsxs("div",{className:"ga-sidebar-footer-anchor",children:[i.jsx($e,{content:u("foot.runtimeManagement"),position:"top",visible:S&&!b,onVisibleChange:w,children:i.jsx("button",{type:"button",className:"ga-sidebar-footer-btn",onClick:_,"aria-label":u("foot.runtimeManagement"),"aria-expanded":b,"aria-haspopup":"dialog","aria-controls":"ga-runtime-management-panel",children:i.jsx(Ee,{name:"server-process",size:"1rem"})})}),b&&i.jsx(lu,{onClose:C})]})]})]})}const uu=24;function pu(){const n=a.useRef(null),[e,t]=a.useState(!0),o=a.useRef(!0),r=a.useRef(0),s=a.useCallback(()=>{const u=n.current;if(!u)return;const p=u.scrollHeight-u.scrollTop-u.clientHeight<uu;t(p),o.current=p},[]),l=a.useCallback((u="instant")=>{const p=n.current;p&&(u==="instant"?p.scrollTop=p.scrollHeight:hu(p,p.scrollHeight-p.clientHeight,170),o.current=!0,t(!0))},[]),c=a.useCallback(()=>{o.current=!1},[]);return a.useEffect(()=>{const u=n.current;if(!u)return;const p=()=>s(),d=new MutationObserver(()=>{o.current&&(cancelAnimationFrame(r.current),r.current=requestAnimationFrame(()=>{u.scrollTop=u.scrollHeight}))});return u.addEventListener("scroll",p,{passive:!0}),d.observe(u,{childList:!0,subtree:!0,characterData:!0}),()=>{u.removeEventListener("scroll",p),d.disconnect(),cancelAnimationFrame(r.current)}},[s]),{scrollRef:n,isAtBottom:e,scrollToBottom:l,stopScroll:c}}function hu(n,e,t){const o=n.scrollTop,r=e-o,s=performance.now();function l(c){const u=c-s,p=Math.min(u/t,1),d=1-Math.pow(1-p,3);n.scrollTop=o+r*d,p<1&&requestAnimationFrame(l)}requestAnimationFrame(l)}function mu(n,e,t,o){a.useEffect(()=>{const r=n.current;if(!r||!o)return;t(),r.scrollTop=r.scrollHeight;let s=0,l=r.scrollHeight,c=0;function u(){if(r){if(c++,r.scrollHeight===l?s++:(s=0,l=r.scrollHeight,r.scrollTop=r.scrollHeight),s>=5||c>=90){e("instant");return}requestAnimationFrame(u)}}requestAnimationFrame(u)},[o,n,e,t])}function fu({children:n}){return i.jsx("div",{"data-slot":"aui_thread-content",children:n})}function yt(n){const e=/^[ \t]*(`{3,})([^\n`]*)[ \t]*$/.exec(n??"");return e?{ticks:e[1].length,tag:e[2]}:null}function vi(n,e){if(/^🛠️ Tool:/.test(n))return!0;if(!(e!=null&&e.forToolResult)){const t=yt(n);if(t&&t.ticks>=5&&t. Line truncated
`),nextLine:l+1}}function xi(n,e){const t=yt(n[e]);if(!t||t.ticks<5||t.tag!=="")return null;const o=e+1,r=xn(n,o,{forToolResult:!0}),s=wn(n,o,r,t.ticks);return s<0?null:{body:n.slice(o,s).join(` `),nextLine:l+1}}function wi(n,e){const t=yt(n[e]);if(!t||t.ticks<5||t.tag!=="")return null;const o=e+1,r=wn(n,o,{forToolResult:!0}),s=Cn(n,o,r,t.ticks);return s<0?null:{body:n.slice(o,s).join(`
`),nextLine:s+1}}function fu(n,e){if(vi(n,e))return null;const t=/^🛠️ Tool: `([^`]+)`/.exec(n[e]||"");if(!t)return null;const o=yt(n[e+1]);let r,s;if(o&&o.tag==="text"){if(r=e+2,s=xn(n,r),wn(n,r,s,o.ticks)>=0)return null}else{r=e+1,s=n.length;for(let l=e+1;l<n.length;l++)if(bi(n[l])){s=l;break}}return{name:t[1],body:n.slice(r,s).join(` `),nextLine:s+1}}function gu(n,e){if(xi(n,e))return null;const t=/^🛠️ Tool: `([^`]+)`/.exec(n[e]||"");if(!t)return null;const o=yt(n[e+1]);let r,s;if(o&&o.tag==="text"){if(r=e+2,s=wn(n,r),Cn(n,r,s,o.ticks)>=0)return null}else{r=e+1,s=n.length;for(let l=e+1;l<n.length;l++)if(vi(n[l])){s=l;break}}return{name:t[1],body:n.slice(r,s).join(`
`),nextLine:s,inFlight:!0}}function gu(n,e){if(xi(n,e))return null;const t=yt(n[e]);if(!t||t.ticks<5||t.tag!=="")return null;const o=e+1,r=xn(n,o,{forToolResult:!0});return wn(n,o,r,t.ticks)>=0?null:{body:n.slice(o,r).join(` `),nextLine:s,inFlight:!0}}function yu(n,e){if(wi(n,e))return null;const t=yt(n[e]);if(!t||t.ticks<5||t.tag!=="")return null;const o=e+1,r=wn(n,o,{forToolResult:!0});return Cn(n,o,r,t.ticks)>=0?null:{body:n.slice(o,r).join(`
`),nextLine:r,inFlight:!0}}function yu(n){return n.replace(/^\s*\**LLM Running \(Turn \d+\) \.\.\.\**\s*/i,"")}function bu(n,e){const t=String(n||"").split(` `),nextLine:r,inFlight:!0}}function bu(n){return n.replace(/^\s*\**LLM Running \(Turn \d+\) \.\.\.\**\s*/i,"")}function vu(n,e){const t=String(n||"").split(`
`),o=[];let r=0,s=0;const l=c=>{c<=r||(o.push(t.slice(r,c).join(` `),o=[];let r=0,s=0;const l=c=>{c<=r||(o.push(t.slice(r,c).join(`
`)),r=c)};for(;s<t.length;){const c=vi(t,s);if(c){l(s),o.push(e.onTool(c.name,c.body)),s=c.nextLine,r=s;continue}const u=xi(t,s);if(u){l(s),o.push(e.onResult(u.body)),s=u.nextLine,r=s;continue}const p=fu(t,s);if(p){l(s),o.push(e.onTool(p.name,p.body,{inFlight:!0})),s=p.nextLine,r=s;continue}const d=gu(t,s);if(d){l(s),o.push(e.onResult(d.body,{inFlight:!0})),s=d.nextLine,r=s;continue}s++}return l(t.length),o.join("")}function vu(n){const e=n.split(` `)),r=c)};for(;s<t.length;){const c=xi(t,s);if(c){l(s),o.push(e.onTool(c.name,c.body)),s=c.nextLine,r=s;continue}const u=wi(t,s);if(u){l(s),o.push(e.onResult(u.body)),s=u.nextLine,r=s;continue}const p=gu(t,s);if(p){l(s),o.push(e.onTool(p.name,p.body,{inFlight:!0})),s=p.nextLine,r=s;continue}const d=yu(t,s);if(d){l(s),o.push(e.onResult(d.body,{inFlight:!0})),s=d.nextLine,r=s;continue}s++}return l(t.length),o.join("")}function xu(n){const e=n.split(`
`),t=[];let o=!1;for(const r of e){if(/candidates:/i.test(r)){o=!0;continue}if(o){const s=/^\s*-\s*(.+)/.exec(r);s&&t.push(s[1].trim())}}if(t.length===0)try{const r=JSON.parse(n);if(Array.isArray(r==null?void 0:r.candidates))return r.candidates.map(String)}catch{}return t}function xu(n){const e=n.split(` `),t=[];let o=!1;for(const r of e){if(/candidates:/i.test(r)){o=!0;continue}if(o){const s=/^\s*-\s*(.+)/.exec(r);s&&t.push(s[1].trim())}}if(t.length===0)try{const r=JSON.parse(n);if(Array.isArray(r==null?void 0:r.candidates))return r.candidates.map(String)}catch{}return t}function wu(n){const e=n.split(`
`),t=[];for(const o of e){if(/candidates:/i.test(o))break;const r=o.replace(/^["{\s]*question[":\s]*/i,"").replace(/[",}\s]*$/,"");r&&t.push(r)}if(t.length>0)return t.join(` `),t=[];for(const o of e){if(/candidates:/i.test(o))break;const r=o.replace(/^["{\s]*question[":\s]*/i,"").replace(/[",}\s]*$/,"");r&&t.push(r)}if(t.length>0)return t.join(`
`);try{const o=JSON.parse(n);if(o!=null&&o.question)return String(o.question)}catch{}return n.trim()}function To(n){const e=[];let t=yu(n);const o=[];t=t.replace(/<thinking>([\s\S]*?)<\/thinking>/gi,(u,p)=>(o.push(p),` `);try{const o=JSON.parse(n);if(o!=null&&o.question)return String(o.question)}catch{}return n.trim()}function To(n){const e=[];let t=bu(n);const o=[];t=t.replace(/<thinking>([\s\S]*?)<\/thinking>/gi,(u,p)=>(o.push(p),`
§§THINK:${o.length-1}§§ §§THINK:${o.length-1}§§
`));const r=[];t=t.replace(/<summary>([\s\S]*?)<\/summary>/gi,(u,p)=>(r.push(p),` `));const r=[];t=t.replace(/<summary>([\s\S]*?)<\/summary>/gi,(u,p)=>(r.push(p),`
§§SUMMARY:${r.length-1}§§ §§SUMMARY:${r.length-1}§§
`));const s=[],l=[];t=bu(t,{onTool(u,p,d){return s.push({name:u,body:p,inFlight:d==null?void 0:d.inFlight}),` `));const s=[],l=[];t=vu(t,{onTool(u,p,d){return s.push({name:u,body:p,inFlight:d==null?void 0:d.inFlight}),`
§§TOOL:${s.length-1}§§ §§TOOL:${s.length-1}§§
`},onResult(u,p){return l.push({body:u,inFlight:p==null?void 0:p.inFlight}),` `},onResult(u,p){return l.push({body:u,inFlight:p==null?void 0:p.inFlight}),`
§§RESULT:${l.length-1}§§ §§RESULT:${l.length-1}§§
@@ -23,11 +23,11 @@ var _i=Object.defineProperty;var Mi=(n,e,t)=>e in n?_i(n,e,{enumerable:!0,config
§§TOOL:${s.length-1}§§ §§TOOL:${s.length-1}§§
`)),t=t.replace(/<function_results>[\s\S]*?<\/function_results>/gi,u=>(l.push({body:u}),` `)),t=t.replace(/<function_results>[\s\S]*?<\/function_results>/gi,u=>(l.push({body:u}),`
§§RESULT:${l.length-1}§§ §§RESULT:${l.length-1}§§
`));const c=t.split(/\n?(§§(?:THINK|TOOL|RESULT|SUMMARY):\d+§§)\n?/);for(const u of c){const p=/^§§THINK:(\d+)§§$/.exec(u);if(p){e.push({type:"thinking",content:o[Number(p[1])]});continue}const d=/^§§TOOL:(\d+)§§$/.exec(u);if(d){const y=s[Number(d[1])];if(y.name==="ask_user"){const S=vu(y.body),w=xu(y.body);e.push({type:"approval",content:w,candidates:S})}else e.push({type:"tool",content:y.body,label:y.name,inFlight:y.inFlight});continue}const m=/^§§RESULT:(\d+)§§$/.exec(u);if(m){const y=l[Number(m[1])];e.push({type:"result",content:y.body,inFlight:y.inFlight});continue}const f=/^§§SUMMARY:(\d+)§§$/.exec(u);if(f){e.push({type:"summary",content:r[Number(f[1])]});continue}const b=u.trim();b&&e.push({type:"prose",content:b})}return e}function Hr(n){return n.map((e,t)=>{const o=To(e),r=o.reduce((s,l)=>s+l.content.length,0);return{index:t,segments:o,weight:r}})}function wu(n){const e=[];let t=0;for(;t<n.length;){const o=n[t];if(o.role==="user"){const r=n[t+1];if(r&&r.role==="assistant"){const s=r.turn_segs??(r.content?[r.content]:[]),l=Hr(s);e.push({kind:"turn",userMsg:o,assistantMsg:r,turns:l}),t+=2}else e.push({kind:"standalone",msg:o}),t++}else{if(o.role==="assistant"){const r=o.turn_segs??(o.content?[o.content]:[]),s=Hr(r);e.push({kind:"turn",userMsg:{id:"__synthetic__",role:"user",content:"",status:"completed"},assistantMsg:o,turns:s})}else e.push({kind:"standalone",msg:o});t++}}return e}const Xe=[{id:"plan",title:"Plan",desc:{en:"Explore, plan, execute, verify",zh:"探索、规划、执行、验证"},prompt:"Enter Plan mode: read memory/plan_sop.md, follow Explore → Plan → Execute → Verify flow for the task I describe next."},{id:"goal",title:"Goal",desc:{en:"Achieve a specific objective autonomously",zh:"自主达成指定目标"},prompt:"Enter Goal mode: read L3 goal mode SOP, autonomously achieve the goal I describe next."},{id:"autonomous",title:"Autonomous",desc:{en:"Select tasks and execute independently",zh:"自主选取任务并独立执行"},prompt:"Enter autonomous mode: read memory/autonomous_operation_sop.md, select or plan tasks, execute independently and produce a report."},{id:"hive",title:"Hive",desc:{en:"Multi-agent parallel collaboration",zh:"多 agent 并行协作"},prompt:"Start Goal Hive mode: follow hive SOP, spawn multiple workers to collaboratively achieve my next goal."},{id:"review",title:"Review",desc:{en:"Critical review of latest output",zh:"对最近产出做严格复核"},prompt:"Enter reviewer mode: rigorously critique the latest output, check each item and report issues."},{id:"findwork",title:"Find Work",desc:{en:"Analyze context, suggest next tasks",zh:"分析当前情况,推荐下一步"},prompt:"Analyze my situation using the autonomous planning approach, generate a batch of TODOs that would interest me."}];function Cu(n){for(const e of Xe)if(n.startsWith(e.prompt)){const t=n.slice(e.prompt.length).trimStart();return{id:e.id,rest:t}}return null}function Su(n){return n?n<1024?`${n} B`:n<1024*1024?`${(n/1024).toFixed(1)} KB`:`${(n/(1024*1024)).toFixed(1)} MB`:""}function ku(n){var t;const e=((t=n.split(".").pop())==null?void 0:t.toLowerCase())||"";return["js","ts","tsx","jsx","py","rs","go","c","cpp","java"].includes(e)?"◇":["json","yaml","yml","toml","xml"].includes(e)?"{}":["md","txt","log","csv"].includes(e)?"¶":["pdf"].includes(e)?"⊞":"◎"}function ju({text:n}){const[e,t]=a.useState(!1),o=a.useRef(),r=a.useCallback(s=>{s.stopPropagation(),navigator.clipboard.writeText(n).then(()=>{t(!0),o.current&&clearTimeout(o.current),o.current=setTimeout(()=>t(!1),2e3)})},[n]);return typeof navigator>"u"||!navigator.clipboard?null:i.jsx("button",{"data-slot":"user-bubble-copy",onClick:r,title:e?"Copied":"Copy",children:e?i.jsx("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",children:i.jsx("path",{d:"M3 8.5l3 3 7-7",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}):i.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",children:[i.jsx("rect",{x:"5.5",y:"5.5",width:"7",height:"7",rx:"1",stroke:"currentColor",strokeWidth:"1.2"}),i.jsx("path",{d:"M3.5 10.5v-7a1 1 0 011-1h7",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]})})}const wi=a.memo(function({content:e,msgId:t,images:o,files:r}){const s=a.useRef(null),[l,c]=a.useState(!1),[u,p]=a.useState(!1),d=a.useRef(!1);if(d.current=u,a.useLayoutEffect(()=>{const f=s.current;if(!f)return;const b=new ResizeObserver(()=>{d.current||c(f.scrollHeight>f.clientHeight+2)});return b.observe(f),()=>b.disconnect()},[]),!e&&(!o||o.length===0)&&(!r||r.length===0))return null;const m=Cu(e);return i.jsxs(i.Fragment,{children:[o&&o.length>0&&i.jsx("div",{"data-slot":"user-images",children:o.map((f,b)=>i.jsx("img",{"data-slot":"user-image-thumb",src:f.path.startsWith("data:")?f.path:`${ee}/upload/raw?path=${encodeURIComponent(f.path)}`,alt:f.name},b))}),r&&r.length>0&&i.jsx("div",{"data-slot":"user-files",children:r.map((f,b)=>i.jsxs("div Line truncated `));const c=t.split(/\n?(§§(?:THINK|TOOL|RESULT|SUMMARY):\d+§§)\n?/);for(const u of c){const p=/^§§THINK:(\d+)§§$/.exec(u);if(p){e.push({type:"thinking",content:o[Number(p[1])]});continue}const d=/^§§TOOL:(\d+)§§$/.exec(u);if(d){const y=s[Number(d[1])];if(y.name==="ask_user"){const S=xu(y.body),w=wu(y.body);e.push({type:"approval",content:w,candidates:S})}else e.push({type:"tool",content:y.body,label:y.name,inFlight:y.inFlight});continue}const m=/^§§RESULT:(\d+)§§$/.exec(u);if(m){const y=l[Number(m[1])];e.push({type:"result",content:y.body,inFlight:y.inFlight});continue}const f=/^§§SUMMARY:(\d+)§§$/.exec(u);if(f){e.push({type:"summary",content:r[Number(f[1])]});continue}const b=u.trim();b&&e.push({type:"prose",content:b})}return e}function Hr(n){return n.map((e,t)=>{const o=To(e),r=o.reduce((s,l)=>s+l.content.length,0);return{index:t,segments:o,weight:r}})}function Cu(n){const e=[];let t=0;for(;t<n.length;){const o=n[t];if(o.role==="user"){const r=n[t+1];if(r&&r.role==="assistant"){const s=r.turn_segs??(r.content?[r.content]:[]),l=Hr(s);e.push({kind:"turn",userMsg:o,assistantMsg:r,turns:l}),t+=2}else e.push({kind:"standalone",msg:o}),t++}else{if(o.role==="assistant"){const r=o.turn_segs??(o.content?[o.content]:[]),s=Hr(r);e.push({kind:"turn",userMsg:{id:"__synthetic__",role:"user",content:"",status:"completed"},assistantMsg:o,turns:s})}else e.push({kind:"standalone",msg:o});t++}}return e}const Xe=[{id:"plan",title:"Plan",desc:{en:"Explore, plan, execute, verify",zh:"探索、规划、执行、验证"},prompt:"Enter Plan mode: read memory/plan_sop.md, follow Explore → Plan → Execute → Verify flow for the task I describe next."},{id:"goal",title:"Goal",desc:{en:"Achieve a specific objective autonomously",zh:"自主达成指定目标"},prompt:"Enter Goal mode: read L3 goal mode SOP, autonomously achieve the goal I describe next."},{id:"autonomous",title:"Autonomous",desc:{en:"Select tasks and execute independently",zh:"自主选取任务并独立执行"},prompt:"Enter autonomous mode: read memory/autonomous_operation_sop.md, select or plan tasks, execute independently and produce a report."},{id:"hive",title:"Hive",desc:{en:"Multi-agent parallel collaboration",zh:"多 agent 并行协作"},prompt:"Start Goal Hive mode: follow hive SOP, spawn multiple workers to collaboratively achieve my next goal."},{id:"review",title:"Review",desc:{en:"Critical review of latest output",zh:"对最近产出做严格复核"},prompt:"Enter reviewer mode: rigorously critique the latest output, check each item and report issues."},{id:"findwork",title:"Find Work",desc:{en:"Analyze context, suggest next tasks",zh:"分析当前情况,推荐下一步"},prompt:"Analyze my situation using the autonomous planning approach, generate a batch of TODOs that would interest me."}];function Su(n){for(const e of Xe)if(n.startsWith(e.prompt)){const t=n.slice(e.prompt.length).trimStart();return{id:e.id,rest:t}}return null}function ku(n){return n?n<1024?`${n} B`:n<1024*1024?`${(n/1024).toFixed(1)} KB`:`${(n/(1024*1024)).toFixed(1)} MB`:""}function ju(n){var t;const e=((t=n.split(".").pop())==null?void 0:t.toLowerCase())||"";return["js","ts","tsx","jsx","py","rs","go","c","cpp","java"].includes(e)?"◇":["json","yaml","yml","toml","xml"].includes(e)?"{}":["md","txt","log","csv"].includes(e)?"¶":["pdf"].includes(e)?"⊞":"◎"}function Eu({text:n}){const[e,t]=a.useState(!1),o=a.useRef(),r=a.useCallback(s=>{s.stopPropagation(),navigator.clipboard.writeText(n).then(()=>{t(!0),o.current&&clearTimeout(o.current),o.current=setTimeout(()=>t(!1),2e3)})},[n]);return typeof navigator>"u"||!navigator.clipboard?null:i.jsx("button",{"data-slot":"user-bubble-copy",onClick:r,title:e?"Copied":"Copy",children:e?i.jsx("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",children:i.jsx("path",{d:"M3 8.5l3 3 7-7",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}):i.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",children:[i.jsx("rect",{x:"5.5",y:"5.5",width:"7",height:"7",rx:"1",stroke:"currentColor",strokeWidth:"1.2"}),i.jsx("path",{d:"M3.5 10.5v-7a1 1 0 011-1h7",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]})})}const Ci=a.memo(function({content:e,msgId:t,images:o,files:r}){const s=a.useRef(null),[l,c]=a.useState(!1),[u,p]=a.useState(!1),d=a.useRef(!1);if(d.current=u,a.useLayoutEffect(()=>{const f=s.current;if(!f)return;const b=new ResizeObserver(()=>{d.current||c(f.scrollHeight>f.clientHeight+2)});return b.observe(f),()=>b.disconnect()},[]),!e&&(!o||o.length===0)&&(!r||r.length===0))return null;const m=Su(e);return i.jsxs(i.Fragment,{children:[o&&o.length>0&&i.jsx("div",{"data-slot":"user-images",children:o.map((f,b)=>i.jsx("img",{"data-slot":"user-image-thumb",src:f.path.startsWith("data:")?f.path:`${ee}/upload/raw?path=${encodeURIComponent(f.path)}`,alt:f.name},b))}),r&&r.length>0&&i.jsx("div",{"data-slot":"user-files",children:r.map((f,b)=>i.jsxs("div Line truncated
`)},[]);return i.jsxs("div",{"data-slot":"aui_assistant-message-root","data-role":"assistant","data-streaming":t||void 0,children:[i.jsx(Du,{segments:o,isStreaming:t,messageId:String(e.id)}),i.jsx($u,{getMessageText:s})]})}),Fu=a.memo(function({userMsg:e,assistantMsg:t,isStreaming:o}){return i.jsxs("div",{"data-slot":"aui_turn-pair",children:[i.jsx(wi,{content:e.content,msgId:e.id,images:e.images,files:e.files}),i.jsx(Au,{message:t,isStreaming:o})]})}),zu=[{pattern:/invalid.?api.?key|api.?key.?invalid|Incorrect API key/i,key:"err.apiKeyInvalid"},{pattern:/model.*not found|does not exist|model_not_found/i,key:"err.modelNotFound"},{pattern:/rate.?limit|429|Too Many Requests/i,key:"err.rateLimit"},{pattern:/quota|insufficient.?funds|balance|billing/i,key:"err.quotaExceeded"},{pattern:/timed?\s*out|TimeoutError/i,key:"err.timeout"},{pattern:/Connection\s*refused|ConnectionRefusedError/i,key:"err.connRefused"},{pattern:/errno 48|address already in use/i,key:"err.portBusy"},{pattern:/Traceback|Exception.*thread|exit code \d+/i,key:"err.processCrash"}];function Bu(n,e){if(!n)return"";for(const t of zu)if(t.pattern.test(n))return e(t.key);return n.length<=80?n:n.slice(0,77)+"…"}const Uu=a.memo(function({error:e,msgId:t}){const{t:o}=ce(),r=Bu(e,o);return i.jsx("div",{className:"ga-inline-error",role:"alert",id:`msg-${t}`,children:i.jsx("span",{className:"ga-inline-error-text",children:r})})}),Vu=300;function Ku(n){return n.kind==="turn"?n.turns.reduce((e,t)=>e+t.segments.length,0):1}const Wu=a.memo(function({messages:e,isRunning:t,budgetMultiplier:o,onShowEarlier:r,scrollRef:s}){const l=a.useMemo(()=>wu(e),[e]),c=a.useRef(null),u=a.useMemo(()=>{if(!isFinite(o))return 0;const f=Vu*o;let b=0;for(let y=l.length-1;y>=0;y--)if(b+=Ku(l[y]),b>f)return y+1;return 0},[l,o]),p=a.useMemo(()=>l.slice(u),[l,u]),d=u;a.useLayoutEffect(()=>{c.current!==null&&(s!=null&&s.current)&&(s.current.scrollTop=s.current.scrollHeight-c.current,c.current=null)});const m=()=>{const f=s==null?void 0:s.current;f&&(c.current=f.scrollHeight-f.scrollTop),r()};return e.length===0?i.jsx("div",{"data-slot":"thread-empty",children:i.jsx("p",{children:"Send a message to begin."})}):i.jsxs(i.Fragment,{children:[d>0&&i.jsxs("button",{"data-slot":"show-earlier-btn",onClick:m,children:["Show ",d," earlier messages"]}),p.map((f,b)=>{const y=u+b;return f.kind==="turn"?i.jsx(Fu,{userMsg:f.userMsg,assistantMsg:f.assistantMsg,isStreaming:t&&y===l.length-1},f.assistantMsg.id):f.msg.role==="user"?i.jsx("div",{"data-slot":"aui_turn-pair",children:i.jsx(wi,{content:f.msg.content,msgId:f.msg.id,images:f.msg.images,files:f.msg.files})},f.msg.id):f.msg.role==="error"?i.jsx(Uu,{error:f.msg.content,msgId:f.msg.id},f.msg.id):i.jsx("div",{"data-slot":"standalone-message","data-status":f.msg.status,children:f.msg.content},f.msg.id)})]})}),Qr=3,Yr=40,Hu=170,Xr=12;function Jr(n){const e=n.replace(/\s+/g," ").trim();return e.length<=Yr?e:e.slice(0,Yr)+"…"}function Zu(n){return 1-Math.pow(1-n,3)}let eo=0;function qu(n,e,t){cancelAnimationFrame(eo);const o=n.scrollTop,r=e-o;if(Math.abs(r)<1)return;const s=performance.now();function l(c){const u=c-s,p=Math.min(u/t,1);n.scrollTop=o+r*Zu(p),p<1&&(eo=requestAnimationFrame(l))}eo=requestAnimationFrame(l)}const Gu=a.memo(function({messages:e,stopScroll:t,onJumpToCollapsed:o}){const r=a.useMemo(()=>e.filter(y=>y.role==="user").map(y=>({id:y.id,content:y.content})),[e]),[s,l]=a.useState(null),[c,u]=a.useState(!1),p=a.useRef(null),d=a.useRef(0),m=a.useCallback(()=>{p.current&&(clearTimeout(p.current),p.current=null),u(!0)},[]),f=a.useCallback(()=>{p.current=setTimeout(()=>{u(!1),p.current=null},150)},[]);a.useEffect(()=>{if(r.length<Qr)return;const y=document.querySelector('[data-slot="aui_thread-viewport"]');if(!y)return;function S(){if(d.current=0,!y)return;const C=y.getBoundingClientRect().top;let k=null;for(const _ of r){const x=document.getElementById(`msg-${_.id}`);if(!x)continue;if(x.getBoundingClientRect().top-C<=Xr)k=_.id;else break}!k&&r.length>0&&(k=r[0].id),k&&l(k)}function w(){d.current||(d.current=requestAnimationFrame(S))}return y.addEventListener("scroll",w,{passive:!0}),S(),()=>{y.removeEventListener("scroll",w),cancelAnimationFrame(d.current)}},[r]);const b=a.useCallback(y=>{const S=document.querySelector('[data-slot="aui_thread-viewport"]'),w=document.getElementById(`msg-${y}`);if(!w){o(y);return}if(!S)return;t();const _=(w.closest('[data-slot="aui_turn-pair"]')||w).offsetTop-Xr;qu(S,_,Hu)},[t,o]);return r.length<Qr?null:i.jsx("nav",{"data-slot":"user-turn-rail","data-expanded":c||void 0,"aria-label":"User message navigation",children:i.jsxs("div",{"data-slot":"rail-hitarea",onMouseEnter:m,onMouseLeave:f,children:[i.jsx("div",{"data-slot":"rail-panel","aria-hidden":!c,children:r.map(y=>i.jsx("button",{"data-slot":"rail-panel-item","data-active":y.id===s||void 0,onClick:()=>b(y.id),children:Jr(y.content)},y.id))}),i.jsx("div",{"data-slot":"rail-marks",children:r.map(y=>i.jsx("button",{"data-slot":"rail-mark","data-a Line truncated `)},[]);return i.jsxs("div",{"data-slot":"aui_assistant-message-root","data-role":"assistant","data-streaming":t||void 0,children:[i.jsx($u,{segments:o,isStreaming:t,messageId:String(e.id)}),i.jsx(Au,{getMessageText:s})]})}),zu=a.memo(function({userMsg:e,assistantMsg:t,isStreaming:o}){return i.jsxs("div",{"data-slot":"aui_turn-pair",children:[i.jsx(Ci,{content:e.content,msgId:e.id,images:e.images,files:e.files}),i.jsx(Fu,{message:t,isStreaming:o})]})}),Bu=[{pattern:/invalid.?api.?key|api.?key.?invalid|Incorrect API key/i,key:"err.apiKeyInvalid"},{pattern:/model.*not found|does not exist|model_not_found/i,key:"err.modelNotFound"},{pattern:/rate.?limit|429|Too Many Requests/i,key:"err.rateLimit"},{pattern:/quota|insufficient.?funds|balance|billing/i,key:"err.quotaExceeded"},{pattern:/timed?\s*out|TimeoutError/i,key:"err.timeout"},{pattern:/Connection\s*refused|ConnectionRefusedError/i,key:"err.connRefused"},{pattern:/errno 48|address already in use/i,key:"err.portBusy"},{pattern:/Traceback|Exception.*thread|exit code \d+/i,key:"err.processCrash"}];function Uu(n,e){if(!n)return"";for(const t of Bu)if(t.pattern.test(n))return e(t.key);return n.length<=80?n:n.slice(0,77)+"…"}const Vu=a.memo(function({error:e,msgId:t}){const{t:o}=ce(),r=Uu(e,o);return i.jsx("div",{className:"ga-inline-error",role:"alert",id:`msg-${t}`,children:i.jsx("span",{className:"ga-inline-error-text",children:r})})}),Ku=300;function Wu(n){return n.kind==="turn"?n.turns.reduce((e,t)=>e+t.segments.length,0):1}const Hu=a.memo(function({messages:e,isRunning:t,budgetMultiplier:o,onShowEarlier:r,scrollRef:s}){const l=a.useMemo(()=>Cu(e),[e]),c=a.useRef(null),u=a.useMemo(()=>{if(!isFinite(o))return 0;const f=Ku*o;let b=0;for(let y=l.length-1;y>=0;y--)if(b+=Wu(l[y]),b>f)return y+1;return 0},[l,o]),p=a.useMemo(()=>l.slice(u),[l,u]),d=u;a.useLayoutEffect(()=>{c.current!==null&&(s!=null&&s.current)&&(s.current.scrollTop=s.current.scrollHeight-c.current,c.current=null)});const m=()=>{const f=s==null?void 0:s.current;f&&(c.current=f.scrollHeight-f.scrollTop),r()};return e.length===0?i.jsx("div",{"data-slot":"thread-empty",children:i.jsx("p",{children:"Send a message to begin."})}):i.jsxs(i.Fragment,{children:[d>0&&i.jsxs("button",{"data-slot":"show-earlier-btn",onClick:m,children:["Show ",d," earlier messages"]}),p.map((f,b)=>{const y=u+b;return f.kind==="turn"?i.jsx(zu,{userMsg:f.userMsg,assistantMsg:f.assistantMsg,isStreaming:t&&y===l.length-1},f.assistantMsg.id):f.msg.role==="user"?i.jsx("div",{"data-slot":"aui_turn-pair",children:i.jsx(Ci,{content:f.msg.content,msgId:f.msg.id,images:f.msg.images,files:f.msg.files})},f.msg.id):f.msg.role==="error"?i.jsx(Vu,{error:f.msg.content,msgId:f.msg.id},f.msg.id):i.jsx("div",{"data-slot":"standalone-message","data-status":f.msg.status,children:f.msg.content},f.msg.id)})]})}),Qr=3,Yr=40,Zu=170,Xr=12;function Jr(n){const e=n.replace(/\s+/g," ").trim();return e.length<=Yr?e:e.slice(0,Yr)+"…"}function qu(n){return 1-Math.pow(1-n,3)}let to=0;function Gu(n,e,t){cancelAnimationFrame(to);const o=n.scrollTop,r=e-o;if(Math.abs(r)<1)return;const s=performance.now();function l(c){const u=c-s,p=Math.min(u/t,1);n.scrollTop=o+r*qu(p),p<1&&(to=requestAnimationFrame(l))}to=requestAnimationFrame(l)}const Qu=a.memo(function({messages:e,stopScroll:t,onJumpToCollapsed:o}){const r=a.useMemo(()=>e.filter(y=>y.role==="user").map(y=>({id:y.id,content:y.content})),[e]),[s,l]=a.useState(null),[c,u]=a.useState(!1),p=a.useRef(null),d=a.useRef(0),m=a.useCallback(()=>{p.current&&(clearTimeout(p.current),p.current=null),u(!0)},[]),f=a.useCallback(()=>{p.current=setTimeout(()=>{u(!1),p.current=null},150)},[]);a.useEffect(()=>{if(r.length<Qr)return;const y=document.querySelector('[data-slot="aui_thread-viewport"]');if(!y)return;function S(){if(d.current=0,!y)return;const C=y.getBoundingClientRect().top;let k=null;for(const _ of r){const x=document.getElementById(`msg-${_.id}`);if(!x)continue;if(x.getBoundingClientRect().top-C<=Xr)k=_.id;else break}!k&&r.length>0&&(k=r[0].id),k&&l(k)}function w(){d.current||(d.current=requestAnimationFrame(S))}return y.addEventListener("scroll",w,{passive:!0}),S(),()=>{y.removeEventListener("scroll",w),cancelAnimationFrame(d.current)}},[r]);const b=a.useCallback(y=>{const S=document.querySelector('[data-slot="aui_thread-viewport"]'),w=document.getElementById(`msg-${y}`);if(!w){o(y);return}if(!S)return;t();const _=(w.closest('[data-slot="aui_turn-pair"]')||w).offsetTop-Xr;Gu(S,_,Zu)},[t,o]);return r.length<Qr?null:i.jsx("nav",{"data-slot":"user-turn-rail","data-expanded":c||void 0,"aria-label":"User message navigation",children:i.jsxs("div",{"data-slot":"rail-hitarea",onMouseEnter:m,onMouseLeave:f,children:[i.jsx("div",{"data-slot":"rail-panel","aria-hidden":!c,children:r.map(y=>i.jsx("button",{"data-slot":"rail-panel-item","data-active":y.id===s||void 0,onClick:()=>b(y.id),children:Jr(y.content)},y.id))}),i.jsx("div",{"data-slot":"rail-marks",children:r.map(y=>i.jsx("button",{"data-slot":"rail-mark","data-a Line truncated
`;else{const o=Ro(t);o&&(e+=` `;else{const o=Ro(t);o&&(e+=`
`+o)}return e}function Yu(n){const e=Array.from(n.childNodes);for(const t of e)if(t instanceof HTMLElement){if(t.dataset.refText||t.tagName==="BR")continue;if(t.tagName==="DIV"||t.tagName==="P"){const o=document.createElement("br");for(n.insertBefore(o,t);t.firstChild;)n.insertBefore(t.firstChild,t);n.removeChild(t)}}n.normalize()}function ki(n){const e=document.createRange();e.selectNodeContents(n),e.collapse(!1);const t=window.getSelection();t&&(t.removeAllRanges(),t.addRange(e))}function es(n,e){n.focus();const t=window.getSelection();if(!t||t.rangeCount===0){n.appendChild(e);return}const o=t.getRangeAt(0);o.deleteContents(),o.insertNode(e),o.setStartAfter(e),o.collapse(!0),t.removeAllRanges(),t.addRange(o)}function Xu(n,e){n.textContent=e,ki(n)}function Ju(n,e,t){const o=document.createElement("span");return o.contentEditable="false",o.dataset.refText=`@${n}:\`${e}\``,o.dataset.refKind=n,o.className="ref-chip",o.innerHTML=`<span class="ref-chip-icon">${r0(n)}</span><span class="ref-chip-label">${o0(t||e)}</span>`,o}function e0(n,e,t,o){const r=Ju(e,t,o);es(n,r);const s=document.createTextNode(" ");es(n,s)}function t0(n,e){const t=document.createElement("span");return t.contentEditable="false",t.dataset.refText=e,t.dataset.skillId=n,t.className="skill-chip",t.textContent=`/${n}`,t}function n0(n,e,t){n.textContent="";const o=t0(e,t);n.appendChild(o);const r=document.createTextNode(" ");n.appendChild(r),ki(n)}function o0(n){return n.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function r0(n){switch(n){case"file":return'<svg width="12" height="12" viewBox="0 0 16 16" fill="none"><path d="M4 2h5l4 4v8a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1z" stroke="currentColor" stroke-width="1.2"/><path d="M9 2v4h4" stroke="currentColor" stroke-width="1.2"/></svg>';case"url":return'<svg width="12" height="12" viewBox="0 0 16 16" fill="none"><path d="M6.5 9.5l3-3M7 11l-1.5 1.5a2.12 2.12 0 1 1-3-3L4 8m5-3l1.5-1.5a2.12 2.12 0 1 1 3 3L12 8" stroke="currentColor" stroke-width="1.2" stroke-linecap="round"/></svg>';case"image":return'<svg width="12" height="12" viewBox="0 0 16 16" fill="none"><rect x="2" y="2" width="12" height="12" rx="1" stroke="currentColor" stroke-width="1.2"/><circle cx="5.5" cy="5.5" r="1" fill="currentColor"/><path d="M2 11l3-3 2 2 3-3 4 4" stroke="currentColor" stroke-width="1.2" stroke-linecap="round"/></svg>';default:return'<svg width="12" height="12" viewBox="0 0 16 16" fill="none"><circle cx="8" cy="8" r="5" stroke="currentColor" stroke-width="1.2"/></svg>'}}const s0=a.forwardRef(function({placeholder:e,disabled:t,onInput:o,onKeyDown:r,onSlashTrigger:s,onSlashDismiss:l,onAtTrigger:c,onAtDismiss:u,onPasteFiles:p},d){const m=a.useRef(null),f=a.useRef(!1),b=a.useRef("");a.useImperativeHandle(d,()=>({focus(){var x;(x=m.current)==null||x.focus()},clear(){m.current&&(m.current.textContent="",b.current="")},getText(){return m.current?Ro(m.current):""},setText(x){m.current&&(Xu(m.current,x),b.current=x,o(x))},insertChip(x,j,v){m.current&&(m.current.focus(),e0(m.current,x,j,v),y())},setSkillChip(x,j){m.current&&(n0(m.current,x,j),y())},getElement(){return m.current}}));const y=a.useCallback(()=>{if(!m.current)return;const x=Ro(m.current);b.current=x,o(x);const j=x.trimStart();j.startsWith("/")&&!j.includes(` `+o)}return e}function Xu(n){const e=Array.from(n.childNodes);for(const t of e)if(t instanceof HTMLElement){if(t.dataset.refText||t.tagName==="BR")continue;if(t.tagName==="DIV"||t.tagName==="P"){const o=document.createElement("br");for(n.insertBefore(o,t);t.firstChild;)n.insertBefore(t.firstChild,t);n.removeChild(t)}}n.normalize()}function ji(n){const e=document.createRange();e.selectNodeContents(n),e.collapse(!1);const t=window.getSelection();t&&(t.removeAllRanges(),t.addRange(e))}function es(n,e){n.focus();const t=window.getSelection();if(!t||t.rangeCount===0){n.appendChild(e);return}const o=t.getRangeAt(0);o.deleteContents(),o.insertNode(e),o.setStartAfter(e),o.collapse(!0),t.removeAllRanges(),t.addRange(o)}function Ju(n,e){n.textContent=e,ji(n)}function e0(n,e,t){const o=document.createElement("span");return o.contentEditable="false",o.dataset.refText=`@${n}:\`${e}\``,o.dataset.refKind=n,o.className="ref-chip",o.innerHTML=`<span class="ref-chip-icon">${s0(n)}</span><span class="ref-chip-label">${r0(t||e)}</span>`,o}function t0(n,e,t,o){const r=e0(e,t,o);es(n,r);const s=document.createTextNode(" ");es(n,s)}function n0(n,e){const t=document.createElement("span");return t.contentEditable="false",t.dataset.refText=e,t.dataset.skillId=n,t.className="skill-chip",t.textContent=`/${n}`,t}function o0(n,e,t){n.textContent="";const o=n0(e,t);n.appendChild(o);const r=document.createTextNode(" ");n.appendChild(r),ji(n)}function r0(n){return n.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function s0(n){switch(n){case"file":return'<svg width="12" height="12" viewBox="0 0 16 16" fill="none"><path d="M4 2h5l4 4v8a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1z" stroke="currentColor" stroke-width="1.2"/><path d="M9 2v4h4" stroke="currentColor" stroke-width="1.2"/></svg>';case"url":return'<svg width="12" height="12" viewBox="0 0 16 16" fill="none"><path d="M6.5 9.5l3-3M7 11l-1.5 1.5a2.12 2.12 0 1 1-3-3L4 8m5-3l1.5-1.5a2.12 2.12 0 1 1 3 3L12 8" stroke="currentColor" stroke-width="1.2" stroke-linecap="round"/></svg>';case"image":return'<svg width="12" height="12" viewBox="0 0 16 16" fill="none"><rect x="2" y="2" width="12" height="12" rx="1" stroke="currentColor" stroke-width="1.2"/><circle cx="5.5" cy="5.5" r="1" fill="currentColor"/><path d="M2 11l3-3 2 2 3-3 4 4" stroke="currentColor" stroke-width="1.2" stroke-linecap="round"/></svg>';default:return'<svg width="12" height="12" viewBox="0 0 16 16" fill="none"><circle cx="8" cy="8" r="5" stroke="currentColor" stroke-width="1.2"/></svg>'}}const i0=a.forwardRef(function({placeholder:e,disabled:t,onInput:o,onKeyDown:r,onSlashTrigger:s,onSlashDismiss:l,onAtTrigger:c,onAtDismiss:u,onPasteFiles:p},d){const m=a.useRef(null),f=a.useRef(!1),b=a.useRef("");a.useImperativeHandle(d,()=>({focus(){var x;(x=m.current)==null||x.focus()},clear(){m.current&&(m.current.textContent="",b.current="")},getText(){return m.current?Ro(m.current):""},setText(x){m.current&&(Ju(m.current,x),b.current=x,o(x))},insertChip(x,j,v){m.current&&(m.current.focus(),t0(m.current,x,j,v),y())},setSkillChip(x,j){m.current&&(o0(m.current,x,j),y())},getElement(){return m.current}}));const y=a.useCallback(()=>{if(!m.current)return;const x=Ro(m.current);b.current=x,o(x);const j=x.trimStart();j.startsWith("/")&&!j.includes(`
`)?s==null||s(j.slice(1)):l==null||l();const v=x.match(/@([^\s@]*)$/);v?c==null||c(v[1]):u==null||u()},[o,s,l,c,u]),S=a.useCallback(()=>{f.current||(m.current&&Yu(m.current),y())},[y]),w=a.useCallback(()=>{f.current=!0},[]),C=a.useCallback(()=>{f.current=!1,S()},[S]),k=a.useCallback(x=>{f.current||x.nativeEvent.isComposing||x.keyCode===229||r(x)},[r]),_=a.useCallback(x=>{var E;const j=(E=x.clipboardData)==null?void 0:E.items;if(!j)return;const v=[];for(const D of Array.from(j))if(D.type.startsWith("image/")&&D.type!=="image/svg+xml"){const P=D.getAsFile();P&&v.push(P)}if(v.length>0){x.preventDefault(),p==null||p(v);return}const O=x.clipboardData.getData("text/plain");O&&(x.preventDefault(),document.execCommand("insertText",!1,O))},[p]);return a.useEffect(()=>{const x=m.current;if(!x)return;const j=new ResizeObserver(v=>{var E,D,P;const O=((P=(D=(E=v[0])==null?void 0:E.borderBoxSize)==null?void 0:D[0])==null?void 0:P.blockSize)??x.offsetHeight;x.style.setProperty("--editor-scroll-height",`${O}px`)});return j.observe(x),()=>j.disconnect()},[]),i.jsx("div",{ref:m,"data-slot":"composer-rich-input",contentEditable:!t,role:"textbox","aria-multiline":"true","aria-placeholder":e,"data-placeholder":e,suppressContentEditableWarning:!0,onInput:S,onKeyDown:k,onCompositionStart:w,onCompositionEnd:C,onPaste:_})});function i0(){try{const n=localStorage.getItem("ga_custom_presets");return n?JSON.parse(n):[]}catch{return[]}}function a0({visible:n,query:e,onSelect:t,onClose:o}){const r=H(m=>m.lang),[s,l]=a.useState(0),c=a.useRef(null),u=i0(),p=[...Xe,...u],d=e?p.filter(m=>m.id.startsWith(e.toLowerCase())||m.title.toLowerCase().includes(e.toLowerCase())):p;return a.useEffect(()=>{l(0)},[e]),a.useEffect(()=>{if(!n)return;function m(f){f.key==="ArrowDown"?(f.preventDefault(),l(b=>Math.min(b+1,d.length-1))):f.key==="ArrowUp"?(f.preventDefault(),l(b=>Math.max(b-1,0))):f.key==="Enter"?(f.preventDefault(),d[s]&&t(d[s].id,d[s].prompt)):f.key==="Escape"&&(f.preventDefault(),o())}return document.addEventListener("keydown",m,!0),()=>document.removeEventListener("keydown",m,!0)},[n,s,d,t,o]),a.useEffect(()=>{if(!c.current)return;const m=c.current.querySelector("[data-focused]");m==null||m.scrollIntoView({block:"nearest"})},[s]),!n||d.length===0?null:i.jsx("div",{ref:c,"data-slot":"completion-drawer",children:d.map((m,f)=>i.jsx("button",{"data-slot":"completion-item","data-focused":f===s?"":void 0,onClick:()=>t(m.id,m.prompt),onMouseEnter:()=>l(f),children:i.jsxs("span",{"data-slot":"completion-info",children:[i.jsxs("span",{"data-slot":"completion-title",children:["/",m.id]}),i.jsx("span",{"data-slot":"completion-desc",children:m.desc[r]||m.desc.en})]})},m.id))})}const l0=[{id:"file",label:"file"},{id:"url",label:"url"},{id:"image",label:"image"}];function c0({visible:n,query:e,onConfirm:t,onClose:o}){const r=a.useRef(null),[s,l]=a.useState("file"),[c,u]=a.useState("");a.useEffect(()=>{n&&(u(e),l("file"),setTimeout(()=>{var d;return(d=r.current)==null?void 0:d.focus()},0))},[n,e]),a.useEffect(()=>{if(!n)return;function d(m){m.key==="Escape"&&(m.preventDefault(),m.stopPropagation(),o())}return document.addEventListener("keydown",d,!0),()=>document.removeEventListener("keydown",d,!0)},[n,o]);const p=a.useCallback(d=>{d.preventDefault();const m=c.trim();m&&t(s,m)},[s,c,t]);return n?i.jsx("div",{"data-slot":"at-ref-popover",children:i.jsxs("form",{onSubmit:p,"data-slot":"at-ref-form",children:[i.jsx("div",{"data-slot":"at-ref-kinds",children:l0.map(d=>i.jsx("button",{type:"button","data-slot":"at-ref-kind-btn","data-active":d.id===s?"":void 0,onClick:()=>l(d.id),title:d.label,children:i.jsx(d0,{kind:d.id})},d.id))}),i.jsx("input",{ref:r,"data-slot":"at-ref-input",type:"text",value:c,onChange:d=>u(d.target.value),placeholder:s==="url"?"https://...":"path/to/file"}),i.jsx("button",{type:"submit","data-slot":"at-ref-confirm",disabled:!c.trim(),children:"↵"})]})}):null}function d0({kind:n}){switch(n){case"file":return i.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none",children:[i.jsx("path",{d:"M4 2h5l4 4v8a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1z",stroke:"currentColor",strokeWidth:"1.2"}),i.jsx("path",{d:"M9 2v4h4",stroke:"currentColor",strokeWidth:"1.2"})]});case"url":return i.jsx("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none",children:i.jsx("path",{d:"M6.5 9.5l3-3M7 11l-1.5 1.5a2.12 2.12 0 1 1-3-3L4 8m5-3l1.5-1.5a2.12 2.12 0 1 1 3 3L12 8",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})});case"image":return i.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none",children:[i.jsx("rect",{x:"2",y:"2",width:"12",height:"12",rx:"1",stroke:"currentColor",strokeWidth:"1.2"}),i.jsx("circle",{cx:"5.5",cy:"5.5",r:"1",fill:"currentColor"}),i.jsx("path",{d:"M2 11l3-3 2 2 3-3 4 4",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]});default:return null}}const ts={title:{zh:"附加",en:"Attach"},file:{zh:"文件…",en:"File…"},image:{zh:"图片…",en:"Image…"},paste: Line truncated `)?s==null||s(j.slice(1)):l==null||l();const v=x.match(/@([^\s@]*)$/);v?c==null||c(v[1]):u==null||u()},[o,s,l,c,u]),S=a.useCallback(()=>{f.current||(m.current&&Xu(m.current),y())},[y]),w=a.useCallback(()=>{f.current=!0},[]),C=a.useCallback(()=>{f.current=!1,S()},[S]),k=a.useCallback(x=>{f.current||x.nativeEvent.isComposing||x.keyCode===229||r(x)},[r]),_=a.useCallback(x=>{var E;const j=(E=x.clipboardData)==null?void 0:E.items;if(!j)return;const v=[];for(const D of Array.from(j))if(D.type.startsWith("image/")&&D.type!=="image/svg+xml"){const P=D.getAsFile();P&&v.push(P)}if(v.length>0){x.preventDefault(),p==null||p(v);return}const O=x.clipboardData.getData("text/plain");O&&(x.preventDefault(),document.execCommand("insertText",!1,O))},[p]);return a.useEffect(()=>{const x=m.current;if(!x)return;const j=new ResizeObserver(v=>{var E,D,P;const O=((P=(D=(E=v[0])==null?void 0:E.borderBoxSize)==null?void 0:D[0])==null?void 0:P.blockSize)??x.offsetHeight;x.style.setProperty("--editor-scroll-height",`${O}px`)});return j.observe(x),()=>j.disconnect()},[]),i.jsx("div",{ref:m,"data-slot":"composer-rich-input",contentEditable:!t,role:"textbox","aria-multiline":"true","aria-placeholder":e,"data-placeholder":e,suppressContentEditableWarning:!0,onInput:S,onKeyDown:k,onCompositionStart:w,onCompositionEnd:C,onPaste:_})});function a0(){try{const n=localStorage.getItem("ga_custom_presets");return n?JSON.parse(n):[]}catch{return[]}}function l0({visible:n,query:e,onSelect:t,onClose:o}){const r=H(m=>m.lang),[s,l]=a.useState(0),c=a.useRef(null),u=a0(),p=[...Xe,...u],d=e?p.filter(m=>m.id.startsWith(e.toLowerCase())||m.title.toLowerCase().includes(e.toLowerCase())):p;return a.useEffect(()=>{l(0)},[e]),a.useEffect(()=>{if(!n)return;function m(f){f.key==="ArrowDown"?(f.preventDefault(),l(b=>Math.min(b+1,d.length-1))):f.key==="ArrowUp"?(f.preventDefault(),l(b=>Math.max(b-1,0))):f.key==="Enter"?(f.preventDefault(),d[s]&&t(d[s].id,d[s].prompt)):f.key==="Escape"&&(f.preventDefault(),o())}return document.addEventListener("keydown",m,!0),()=>document.removeEventListener("keydown",m,!0)},[n,s,d,t,o]),a.useEffect(()=>{if(!c.current)return;const m=c.current.querySelector("[data-focused]");m==null||m.scrollIntoView({block:"nearest"})},[s]),!n||d.length===0?null:i.jsx("div",{ref:c,"data-slot":"completion-drawer",children:d.map((m,f)=>i.jsx("button",{"data-slot":"completion-item","data-focused":f===s?"":void 0,onClick:()=>t(m.id,m.prompt),onMouseEnter:()=>l(f),children:i.jsxs("span",{"data-slot":"completion-info",children:[i.jsxs("span",{"data-slot":"completion-title",children:["/",m.id]}),i.jsx("span",{"data-slot":"completion-desc",children:m.desc[r]||m.desc.en})]})},m.id))})}const c0=[{id:"file",label:"file"},{id:"url",label:"url"},{id:"image",label:"image"}];function d0({visible:n,query:e,onConfirm:t,onClose:o}){const r=a.useRef(null),[s,l]=a.useState("file"),[c,u]=a.useState("");a.useEffect(()=>{n&&(u(e),l("file"),setTimeout(()=>{var d;return(d=r.current)==null?void 0:d.focus()},0))},[n,e]),a.useEffect(()=>{if(!n)return;function d(m){m.key==="Escape"&&(m.preventDefault(),m.stopPropagation(),o())}return document.addEventListener("keydown",d,!0),()=>document.removeEventListener("keydown",d,!0)},[n,o]);const p=a.useCallback(d=>{d.preventDefault();const m=c.trim();m&&t(s,m)},[s,c,t]);return n?i.jsx("div",{"data-slot":"at-ref-popover",children:i.jsxs("form",{onSubmit:p,"data-slot":"at-ref-form",children:[i.jsx("div",{"data-slot":"at-ref-kinds",children:c0.map(d=>i.jsx("button",{type:"button","data-slot":"at-ref-kind-btn","data-active":d.id===s?"":void 0,onClick:()=>l(d.id),title:d.label,children:i.jsx(u0,{kind:d.id})},d.id))}),i.jsx("input",{ref:r,"data-slot":"at-ref-input",type:"text",value:c,onChange:d=>u(d.target.value),placeholder:s==="url"?"https://...":"path/to/file"}),i.jsx("button",{type:"submit","data-slot":"at-ref-confirm",disabled:!c.trim(),children:"↵"})]})}):null}function u0({kind:n}){switch(n){case"file":return i.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none",children:[i.jsx("path",{d:"M4 2h5l4 4v8a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1z",stroke:"currentColor",strokeWidth:"1.2"}),i.jsx("path",{d:"M9 2v4h4",stroke:"currentColor",strokeWidth:"1.2"})]});case"url":return i.jsx("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none",children:i.jsx("path",{d:"M6.5 9.5l3-3M7 11l-1.5 1.5a2.12 2.12 0 1 1-3-3L4 8m5-3l1.5-1.5a2.12 2.12 0 1 1 3 3L12 8",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})});case"image":return i.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none",children:[i.jsx("rect",{x:"2",y:"2",width:"12",height:"12",rx:"1",stroke:"currentColor",strokeWidth:"1.2"}),i.jsx("circle",{cx:"5.5",cy:"5.5",r:"1",fill:"currentColor"}),i.jsx("path",{d:"M2 11l3-3 2 2 3-3 4 4",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]});default:return null}}const ts={title:{zh:"附加",en:"Attach"},file:{zh:"文件…",en:"File…"},image:{zh:"图片…",en:"Image…"},paste: Line truncated
`)})]})})]})}return this.props.children}}async function bm(){const n=document.getElementById("app");va.createRoot(n).render(i.jsx(ym,{children:i.jsx(gm,{})}))}bm();export{Hn as A,ee as B,ka as C,Re as D,ai as E,ut as F,ae as G,yi as H,Ha as I,uu as J,H as K,Ih as L,re as M,ph as N,Ee as O,G as P,Fa as Q,et as R,Sm as S,Ae as T,km as U,Aa as V,$o as W,Io as _,jm as a,ce as b,oi as c,Is as d,Zo as e,Pi as f,pl as g,Ie as h,Om as i,Lo as j,Yl as k,gt as l,Ve as m,X as n,Nl as o,zl as p,Al as q,$l as r,Qt as s,xl as t,_s as u,Fl as v,Vl as w,Il as x,Kl as y,pn as z}; `)})]})})]})}return this.props.children}}async function bm(){const n=document.getElementById("app");xa.createRoot(n).render(i.jsx(ym,{children:i.jsx(gm,{})}))}bm();export{Zn as A,ee as B,ja as C,Re as D,li as E,ut as F,ae as G,bi as H,Za as I,pu as J,H as K,Ih as L,re as M,ph as N,Ee as O,G as P,za as Q,et as R,Sm as S,Ae as T,km as U,Fa as V,$o as W,Io as _,jm as a,ce as b,ri as c,Ts as d,Zo as e,_i as f,hl as g,Ie as h,Om as i,Lo as j,Xl as k,gt as l,Ve as m,X as n,Dl as o,Bl as p,Fl as q,Al as r,Qt as s,wl as t,_s as u,zl as v,Kl as w,Tl as x,Wl as y,hn as z};
@@ -1,4 +1,4 @@
import{g as ml,aj as jt}from"./tauri-compat-tfiFK9EG.js";import{V as To,W as Co}from"./main-Knf6L_en.js";function br(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Ci(e.position):"start"in e||"end"in e?Ci(e):"line"in e||"column"in e?p0(e):""}function p0(e){return zi(e&&e.line)+":"+zi(e&&e.column)}function Ci(e){return p0(e&&e.start)+"-"+p0(e&&e.end)}function zi(e){return e&&typeof e=="number"?e:1}class Be extends Error{constructor(t,r,n){super(),typeof r=="string"&&(n=r,r=void 0);let i="",a={},l=!1;if(r&&("line"in r&&"column"in r?a={place:r}:"start"in r&&"end"in r?a={place:r}:"type"in r?a={ancestors:[r],place:r.position}:a={...r}),typeof t=="string"?i=t:!a.cause&&t&&(l=!0,i=t.message,a.cause=t),!a.ruleId&&!a.source&&typeof n=="string"){const o=n.indexOf(":");o===-1?a.ruleId=n:(a.source=n.slice(0,o),a.ruleId=n.slice(o+1))}if(!a.place&&a.ancestors&&a.ancestors){const o=a.ancestors[a.ancestors.length-1];o&&(a.place=o.position)}const s=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=s?s.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=s?s.line:void 0,this.name=br(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=l&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Be.prototype.file="";Be.prototype.name="";Be.prototype.reason="";Be.prototype.message="";Be.prototype.stack="";Be.prototype.column=void 0;Be.prototype.line=void 0;Be.prototype.ancestors=void 0;Be.prototype.cause=void 0;Be.prototype.fatal=void 0;Be.prototype.place=void 0;Be.prototype.ruleId=void 0;Be.prototype.source=void 0;const at={basename:zo,dirname:Mo,extname:Eo,join:Io,sep:"/"};function zo(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Mr(e);let r=0,n=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){r=i+1;break}}else n<0&&(a=!0,n=i+1);return n<0?"":e.slice(r,n)}if(t===e)return"";let l=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){r=i+1;break}}else l<0&&(a=!0,l=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(n=i):(s=-1,n=l));return r===n?n=l:n<0&&(n=e.length),e.slice(r,n)}function Mo(e){if(Mr(e),e.length===0)return".";let t=-1,r=e.length,n;for(;--r;)if(e.codePointAt(r)===47){if(n){t=r;break}}else n||(n=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function Eo(e){Mr(e);let t=e.length,r=-1,n=0,i=-1,a=0,l;for(;t--;){const s=e.codePointAt(t);if(s===47){if(l){n=t+1;break}continue}r<0&&(l=!0,r=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||r<0||a===0||a===1&&i===r-1&&i===n+1?"":e.slice(i,r)}function Io(...e){let t=-1,r;for(;++t<e.length;)Mr(e[t]),e[t]&&(r=r===void 0?e[t]:r+"/"+e[t]);return r===void 0?".":Do(r)}function Do(e){Mr(e);const t=e.codePointAt(0)===47;let r=Bo(e,!t);return r.length===0&&!t&&(r="."),r.length>0&&e.codePointAt(e.length-1)===47&&(r+="/"),t?"/"+r:r}function Bo(e,t){let r="",n=0,i=-1,a=0,l=-1,s,o;for(;++l<=e.length;){if(l<e.length)s=e.codePointAt(l);else{if(s===47)break;s=47}if(s===47){if(!(i===l-1||a===1))if(i!==l-1&&a===2){if(r.length<2||n!==2||r.codePointAt(r.length-1)!==46||r.codePointAt(r.length-2)!==46){if(r.length>2){if(o=r.lastIndexOf("/"),o!==r.length-1){o<0?(r="",n=0):(r=r.slice(0,o),n=r.length-1-r.lastIndexOf("/")),i=l,a=0;continue}}else if(r.length>0){r="",n=0,i=l,a=0;continue}}t&&(r=r.length>0?r+"/..":"..",n=2)}else r.length>0?r+="/"+e.slice(i+1,l):r=e.slice(i+1,l),n=l-i-1;i=l,a=0}else s===46&&a>-1?a++:a=-1}return r}function Mr(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Fo={cwd:Ro};function Ro(){return"/"}function d0(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Lo(e){if(typeof e=="string")e=new URL(e);else if(!d0(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return No(e)}function No(e){if(e.hostname!==""){const n=new TypeError('File URL host must be "localhost" or empty on darwin');throw n.code="ERR_INVALID_FILE_URL_HOST",n}const t=e.pathname;let r=-1;for(;++r<t.length;)if(t.codePointAt(r)===37&&t.codePointAt(r+1)===50){const n=t.codePointAt(r+2);if(n===70||n===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const Rn=["history","path","basename","stem","extname","dirname"];class fl{constructor(t){let r;t?d0(t)?r={path:t}:typeof t=="string"||Po(t)?r={value:t}:r=t:r={},this.cwd="cwd"in r?"":Fo.cwd(),this.data={},thLine truncated import{g as ml,aj as jt}from"./tauri-compat-tfiFK9EG.js";import{V as To,W as Co}from"./main-BlLQtfpq.js";function br(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Ci(e.position):"start"in e||"end"in e?Ci(e):"line"in e||"column"in e?p0(e):""}function p0(e){return zi(e&&e.line)+":"+zi(e&&e.column)}function Ci(e){return p0(e&&e.start)+"-"+p0(e&&e.end)}function zi(e){return e&&typeof e=="number"?e:1}class Be extends Error{constructor(t,r,n){super(),typeof r=="string"&&(n=r,r=void 0);let i="",a={},l=!1;if(r&&("line"in r&&"column"in r?a={place:r}:"start"in r&&"end"in r?a={place:r}:"type"in r?a={ancestors:[r],place:r.position}:a={...r}),typeof t=="string"?i=t:!a.cause&&t&&(l=!0,i=t.message,a.cause=t),!a.ruleId&&!a.source&&typeof n=="string"){const o=n.indexOf(":");o===-1?a.ruleId=n:(a.source=n.slice(0,o),a.ruleId=n.slice(o+1))}if(!a.place&&a.ancestors&&a.ancestors){const o=a.ancestors[a.ancestors.length-1];o&&(a.place=o.position)}const s=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=s?s.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=s?s.line:void 0,this.name=br(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=l&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Be.prototype.file="";Be.prototype.name="";Be.prototype.reason="";Be.prototype.message="";Be.prototype.stack="";Be.prototype.column=void 0;Be.prototype.line=void 0;Be.prototype.ancestors=void 0;Be.prototype.cause=void 0;Be.prototype.fatal=void 0;Be.prototype.place=void 0;Be.prototype.ruleId=void 0;Be.prototype.source=void 0;const at={basename:zo,dirname:Mo,extname:Eo,join:Io,sep:"/"};function zo(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Mr(e);let r=0,n=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){r=i+1;break}}else n<0&&(a=!0,n=i+1);return n<0?"":e.slice(r,n)}if(t===e)return"";let l=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){r=i+1;break}}else l<0&&(a=!0,l=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(n=i):(s=-1,n=l));return r===n?n=l:n<0&&(n=e.length),e.slice(r,n)}function Mo(e){if(Mr(e),e.length===0)return".";let t=-1,r=e.length,n;for(;--r;)if(e.codePointAt(r)===47){if(n){t=r;break}}else n||(n=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function Eo(e){Mr(e);let t=e.length,r=-1,n=0,i=-1,a=0,l;for(;t--;){const s=e.codePointAt(t);if(s===47){if(l){n=t+1;break}continue}r<0&&(l=!0,r=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||r<0||a===0||a===1&&i===r-1&&i===n+1?"":e.slice(i,r)}function Io(...e){let t=-1,r;for(;++t<e.length;)Mr(e[t]),e[t]&&(r=r===void 0?e[t]:r+"/"+e[t]);return r===void 0?".":Do(r)}function Do(e){Mr(e);const t=e.codePointAt(0)===47;let r=Bo(e,!t);return r.length===0&&!t&&(r="."),r.length>0&&e.codePointAt(e.length-1)===47&&(r+="/"),t?"/"+r:r}function Bo(e,t){let r="",n=0,i=-1,a=0,l=-1,s,o;for(;++l<=e.length;){if(l<e.length)s=e.codePointAt(l);else{if(s===47)break;s=47}if(s===47){if(!(i===l-1||a===1))if(i!==l-1&&a===2){if(r.length<2||n!==2||r.codePointAt(r.length-1)!==46||r.codePointAt(r.length-2)!==46){if(r.length>2){if(o=r.lastIndexOf("/"),o!==r.length-1){o<0?(r="",n=0):(r=r.slice(0,o),n=r.length-1-r.lastIndexOf("/")),i=l,a=0;continue}}else if(r.length>0){r="",n=0,i=l,a=0;continue}}t&&(r=r.length>0?r+"/..":"..",n=2)}else r.length>0?r+="/"+e.slice(i+1,l):r=e.slice(i+1,l),n=l-i-1;i=l,a=0}else s===46&&a>-1?a++:a=-1}return r}function Mr(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Fo={cwd:Ro};function Ro(){return"/"}function d0(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Lo(e){if(typeof e=="string")e=new URL(e);else if(!d0(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return No(e)}function No(e){if(e.hostname!==""){const n=new TypeError('File URL host must be "localhost" or empty on darwin');throw n.code="ERR_INVALID_FILE_URL_HOST",n}const t=e.pathname;let r=-1;for(;++r<t.length;)if(t.codePointAt(r)===37&&t.codePointAt(r+1)===50){const n=t.codePointAt(r+2);if(n===70||n===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const Rn=["history","path","basename","stem","extname","dirname"];class fl{constructor(t){let r;t?d0(t)?r={path:t}:typeof t=="string"||Po(t)?r={value:t}:r=t:r={},this.cwd="cwd"in r?"":Fo.cwd(),this.data={},thLine truncated
`,u="/",h="*",m="",d="comment",p="declaration";function y(C,A){if(typeof C!="string")throw new TypeError("First argument must be a string");if(!C)return[];A=A||{};var z=1,I=1;function q(Y){var H=Y.match(t);H&&(z+=H.length);var ae=Y.lastIndexOf(o);I=~ae?Y.length-ae:I+Y.length}function O(){var Y={line:z,column:I};return function(H){return H.position=new M(Y),U(),H}}function M(Y){this.start=Y,this.end={line:z,column:I},this.source=A.source}M.prototype.content=C;function G(Y){var H=new Error(A.source+":"+z+":"+I+": "+Y);if(H.reason=Y,H.filename=A.source,H.line=z,H.column=I,H.source=C,!A.silent)throw H}function X(Y){var H=Y.exec(C);if(H){var ae=H[0];return q(ae),C=C.slice(ae.length),H}}function U(){X(r)}function E(Y){var H;for(Y=Y||[];H=V();)H!==!1&&Y.push(H);return Y}function V(){var Y=O();if(!(u!=C.charAt(0)||h!=C.charAt(1))){for(var H=2;m!=C.charAt(H)&&(h!=C.charAt(H)||u!=C.charAt(H+1));)++H;if(H+=2,m===C.charAt(H-1))return G("End of comment missing");var ae=C.slice(2,H-2);return I+=2,q(ae),C=C.slice(H),I+=2,Y({type:d,comment:ae})}}function $(){var Y=O(),H=X(n);if(H){if(V(),!X(i))return G("property missing ':'");var ae=X(a),pe=Y({type:p,property:w(H[0].replace(e,m)),value:ae?w(ae[0].replace(e,m)):m});return X(l),pe}}function se(){var Y=[];E(Y);for(var H;H=$();)H!==!1&&(Y.push(H),E(Y));return Y}return U(),se()}function w(C){return C?C.replace(s,m):m}return On=y,On}var Li;function Qo(){if(Li)return Kt;Li=1;var e=Kt&&Kt.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Kt,"__esModule",{value:!0}),Kt.default=r;const t=e(Zo());function r(n,i){let a=null;if(!n||typeof n!="string")return a;const l=(0,t.default)(n),s=typeof i=="function";return l.forEach(o=>{if(o.type!=="declaration")return;const{property:u,value:h}=o;s?i(u,h,o):h&&(a=a||{},a[u]=h)}),a}return Kt}var pr={},Ni;function Jo(){if(Ni)return pr;Ni=1,Object.defineProperty(pr,"__esModule",{value:!0}),pr.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,r=/^[^-]+$/,n=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,a=function(u){return!u||r.test(u)||e.test(u)},l=function(u,h){return h.toUpperCase()},s=function(u,h){return"".concat(h,"-")},o=function(u,h){return h===void 0&&(h={}),a(u)?u:(u=u.toLowerCase(),h.reactCompat?u=u.replace(i,s):u=u.replace(n,s),u.replace(t,l))};return pr.camelCase=o,pr}var dr,Pi;function eu(){if(Pi)return dr;Pi=1;var e=dr&&dr.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(Qo()),r=Jo();function n(i,a){var l={};return!i||typeof i!="string"||(0,t.default)(i,function(s,o){s&&o&&(l[(0,r.camelCase)(s,a)]=o)}),l}return n.default=n,dr=n,dr}var tu=eu();const ru=ml(tu),nu=/[ \t\n\f\r]/g;function iu(e){return typeof e=="object"?e.type==="text"?Oi(e.value):!1:Oi(e)}function Oi(e){return e.replace(nu,"")===""}const Sl=Al("end"),G0=Al("start");function Al(e){return t;function t(r){const n=r&&r.position&&r.position[e]||{};if(typeof n.line=="number"&&n.line>0&&typeof n.column=="number"&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset=="number"&&n.offset>-1?n.offset:void 0}}}function au(e){const t=G0(e),r=Sl(e);if(t&&r)return{start:t,end:r}}function qi(e,t){const r=String(e);if(typeof t!="string")throw new TypeError("Expected character");let n=0,i=r.indexOf(t);for(;i!==-1;)n++,i=r.indexOf(t,i+t.length);return n}const Hi=document.createElement("i");function W0(e){const t="&"+e+";";Hi.innerHTML=t;const r=Hi.textContent;return r.charCodeAt(r.length-1)===59&&e!=="semi"||r===t?!1:r}const Ne=Dt(/[A-Za-z]/),Ie=Dt(/[\dA-Za-z]/),lu=Dt(/[#-'*+\--9=?A-Z^-~]/);function rn(e){return e!==null&&(e<32||e===127)}const y0=Dt(/\d/),su=Dt(/[\dA-Fa-f]/),ou=Dt(/[!-/:-@[-`{-~]/);function K(e){return e!==null&&e<-2}function me(e){return e!==null&&(e<0||e===32)}function le(e){return e===-2||e===-1||e===32}const dn=Dt(new RegExp("\\p{P}|\\p{S}","u")),Ut=Dt(/\s/);function Dt(e){return t;function t(r){return r!==null&&r>-1&&e.test(String.fromCharCode(r))}}function ie(e,t,r,n){const i=n?n-1:Number.POSITIVE_INFINITY;let a=0;return l;function l(o){return le(o)?(e.enter(r),s(o)):t(o)}function s(o){return le(o)&&a++<i?(e.consume(o),s):(e.exit(r),t(o))}}function Ge(e,t,r,n){const i=e.length;let a=0,l;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,r=r>0?r:0,n.length<1e4)l=Array.from(n),l.unshift(t,r),e.splice(...l);else for(r&&e.splice(t,r);a<n.length;)l=n.slice(a,a+1e4),l.unshift(t,0),e.splice(...l),a+=1e4,t+=1e4}function Qe(e,t){return e.length>0?(Ge(e,e.length,0,t),e):t}function er(e){if(e===null||me(e)||Ut(e))return 1;if(dn(e))return 2}function gn(e,t,r){const n=[];let i=-1;for(;++i<e.length;){const a=e[i].resolveAll;a&&!n.includes(a)&&(t=a(t,r),n.push(a))}return t}const b0={name:"attention",resolveAll:uu,tokenize:cu};function uu(e,t){let r=-1,n,i,a,l,s,o,u,h;for(;++r<e.length;)if(e[r][0]==="enter"&&e[r][1].type==="attentionSequence"&&e[r][1]._close){for(n=r;n--;)if(e[n][0]==="exit"&&e[n][1].type==="attentionSequence"&&e[n][1]._open&&t.sliceSerialize(e[n][1]).charCodeAt(0)===t.sliceSerialize(e[r][1]).charCodeAt(0)){Line truncated `,u="/",h="*",m="",d="comment",p="declaration";function y(C,A){if(typeof C!="string")throw new TypeError("First argument must be a string");if(!C)return[];A=A||{};var z=1,I=1;function q(Y){var H=Y.match(t);H&&(z+=H.length);var ae=Y.lastIndexOf(o);I=~ae?Y.length-ae:I+Y.length}function O(){var Y={line:z,column:I};return function(H){return H.position=new M(Y),U(),H}}function M(Y){this.start=Y,this.end={line:z,column:I},this.source=A.source}M.prototype.content=C;function G(Y){var H=new Error(A.source+":"+z+":"+I+": "+Y);if(H.reason=Y,H.filename=A.source,H.line=z,H.column=I,H.source=C,!A.silent)throw H}function X(Y){var H=Y.exec(C);if(H){var ae=H[0];return q(ae),C=C.slice(ae.length),H}}function U(){X(r)}function E(Y){var H;for(Y=Y||[];H=V();)H!==!1&&Y.push(H);return Y}function V(){var Y=O();if(!(u!=C.charAt(0)||h!=C.charAt(1))){for(var H=2;m!=C.charAt(H)&&(h!=C.charAt(H)||u!=C.charAt(H+1));)++H;if(H+=2,m===C.charAt(H-1))return G("End of comment missing");var ae=C.slice(2,H-2);return I+=2,q(ae),C=C.slice(H),I+=2,Y({type:d,comment:ae})}}function $(){var Y=O(),H=X(n);if(H){if(V(),!X(i))return G("property missing ':'");var ae=X(a),pe=Y({type:p,property:w(H[0].replace(e,m)),value:ae?w(ae[0].replace(e,m)):m});return X(l),pe}}function se(){var Y=[];E(Y);for(var H;H=$();)H!==!1&&(Y.push(H),E(Y));return Y}return U(),se()}function w(C){return C?C.replace(s,m):m}return On=y,On}var Li;function Qo(){if(Li)return Kt;Li=1;var e=Kt&&Kt.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Kt,"__esModule",{value:!0}),Kt.default=r;const t=e(Zo());function r(n,i){let a=null;if(!n||typeof n!="string")return a;const l=(0,t.default)(n),s=typeof i=="function";return l.forEach(o=>{if(o.type!=="declaration")return;const{property:u,value:h}=o;s?i(u,h,o):h&&(a=a||{},a[u]=h)}),a}return Kt}var pr={},Ni;function Jo(){if(Ni)return pr;Ni=1,Object.defineProperty(pr,"__esModule",{value:!0}),pr.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,r=/^[^-]+$/,n=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,a=function(u){return!u||r.test(u)||e.test(u)},l=function(u,h){return h.toUpperCase()},s=function(u,h){return"".concat(h,"-")},o=function(u,h){return h===void 0&&(h={}),a(u)?u:(u=u.toLowerCase(),h.reactCompat?u=u.replace(i,s):u=u.replace(n,s),u.replace(t,l))};return pr.camelCase=o,pr}var dr,Pi;function eu(){if(Pi)return dr;Pi=1;var e=dr&&dr.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(Qo()),r=Jo();function n(i,a){var l={};return!i||typeof i!="string"||(0,t.default)(i,function(s,o){s&&o&&(l[(0,r.camelCase)(s,a)]=o)}),l}return n.default=n,dr=n,dr}var tu=eu();const ru=ml(tu),nu=/[ \t\n\f\r]/g;function iu(e){return typeof e=="object"?e.type==="text"?Oi(e.value):!1:Oi(e)}function Oi(e){return e.replace(nu,"")===""}const Sl=Al("end"),G0=Al("start");function Al(e){return t;function t(r){const n=r&&r.position&&r.position[e]||{};if(typeof n.line=="number"&&n.line>0&&typeof n.column=="number"&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset=="number"&&n.offset>-1?n.offset:void 0}}}function au(e){const t=G0(e),r=Sl(e);if(t&&r)return{start:t,end:r}}function qi(e,t){const r=String(e);if(typeof t!="string")throw new TypeError("Expected character");let n=0,i=r.indexOf(t);for(;i!==-1;)n++,i=r.indexOf(t,i+t.length);return n}const Hi=document.createElement("i");function W0(e){const t="&"+e+";";Hi.innerHTML=t;const r=Hi.textContent;return r.charCodeAt(r.length-1)===59&&e!=="semi"||r===t?!1:r}const Ne=Dt(/[A-Za-z]/),Ie=Dt(/[\dA-Za-z]/),lu=Dt(/[#-'*+\--9=?A-Z^-~]/);function rn(e){return e!==null&&(e<32||e===127)}const y0=Dt(/\d/),su=Dt(/[\dA-Fa-f]/),ou=Dt(/[!-/:-@[-`{-~]/);function K(e){return e!==null&&e<-2}function me(e){return e!==null&&(e<0||e===32)}function le(e){return e===-2||e===-1||e===32}const dn=Dt(new RegExp("\\p{P}|\\p{S}","u")),Ut=Dt(/\s/);function Dt(e){return t;function t(r){return r!==null&&r>-1&&e.test(String.fromCharCode(r))}}function ie(e,t,r,n){const i=n?n-1:Number.POSITIVE_INFINITY;let a=0;return l;function l(o){return le(o)?(e.enter(r),s(o)):t(o)}function s(o){return le(o)&&a++<i?(e.consume(o),s):(e.exit(r),t(o))}}function Ge(e,t,r,n){const i=e.length;let a=0,l;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,r=r>0?r:0,n.length<1e4)l=Array.from(n),l.unshift(t,r),e.splice(...l);else for(r&&e.splice(t,r);a<n.length;)l=n.slice(a,a+1e4),l.unshift(t,0),e.splice(...l),a+=1e4,t+=1e4}function Qe(e,t){return e.length>0?(Ge(e,e.length,0,t),e):t}function er(e){if(e===null||me(e)||Ut(e))return 1;if(dn(e))return 2}function gn(e,t,r){const n=[];let i=-1;for(;++i<e.length;){const a=e[i].resolveAll;a&&!n.includes(a)&&(t=a(t,r),n.push(a))}return t}const b0={name:"attention",resolveAll:uu,tokenize:cu};function uu(e,t){let r=-1,n,i,a,l,s,o,u,h;for(;++r<e.length;)if(e[r][0]==="enter"&&e[r][1].type==="attentionSequence"&&e[r][1]._close){for(n=r;n--;)if(e[n][0]==="exit"&&e[n][1].type==="attentionSequence"&&e[n][1]._open&&t.sliceSerialize(e[n][1]).charCodeAt(0)===t.sliceSerialize(e[r][1]).charCodeAt(0)){Line truncated
`;break}case-3:{l=`\r `;break}case-3:{l=`\r
`;break}case-2:{l=t?" ":" ";break}case-1:{if(!t&&i)continue;l=" ";break}default:l=String.fromCharCode(a)}i=a===-2,n.push(l)}return n.join("")}function Q1(e){const n={constructs:Bl([X1,...(e||{}).extensions||[]]),content:i(M1),defined:[],document:i(I1),flow:i(F1),lazy:{},string:i(N1),text:i(P1)};return n;function i(a){return l;function l(s){return Y1(n,a,s)}}}function J1(e){for(;!Ml(e););return e}const Yi=/[\0\t\n\r]/g;function ec(){let e=1,t="",r=!0,n;return i;function i(a,l,s){const o=[];let u,h,m,d,p;for(a=t+(typeof a=="string"?a.toString():new TextDecoder(l||void 0).decode(a)),m=0,t="",r&&(a.charCodeAt(0)===65279&&m++,r=void 0);m<a.length;){if(Yi.lastIndex=m,u=Yi.exec(a),d=u&&u.index!==void 0?u.index:a.length,p=a.charCodeAt(d),!u){t=a.slice(m);break}if(p===10&&m===d&&n)o.push(-3),n=void 0;else switch(n&&(o.push(-5),n=void 0),m<d&&(o.push(a.slice(m,d)),e+=d-m),p){case 0:{o.push(65533),e++;break}case 9:{for(h=Math.ceil(e/4)*4,o.push(-2);e++<h;)o.push(-1);break}case 10:{o.push(-4),e=1;break}default:n=!0,e=1}m=d+1}return s&&(n&&o.push(-5),t&&o.push(t),o.push(null)),o}}const tc=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function rc(e){return e.replace(tc,nc)}function nc(e,t,r){if(t)return t;if(r.charCodeAt(0)===35){const i=r.charCodeAt(1),a=i===120||i===88;return Rl(r.slice(a?2:1),a?16:10)}return W0(r)||e}const Pl={}.hasOwnProperty;function ic(e,t,r){return t&&typeof t=="object"&&(r=t,t=void 0),ac(r)(J1(Q1(r).document().write(ec()(e,t,!0))))}function ac(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(cr),autolinkProtocol:U,autolinkEmail:U,atxHeading:a(Lr),blockQuote:a(mt),characterEscape:U,characterReference:U,codeFenced:a(Ft),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:a(Ft,l),codeText:a(Rr,l),codeTextData:U,data:U,codeFlowValue:U,definition:a(Wt),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:a(Xt),hardBreakEscape:a(Nr),hardBreakTrailing:a(Nr),htmlFlow:a(Pr,l),htmlFlowData:U,htmlText:a(Pr,l),htmlTextData:U,image:a(Or),label:l,link:a(cr),listItem:a(Bn),listItemValue:d,listOrdered:a(Rt,m),listUnordered:a(Rt),paragraph:a(Fn),reference:S,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:a(Lr),strong:a(hr),thematicBreak:a(Hr)},exit:{atxHeading:o(),atxHeadingSequence:O,autolink:o(),autolinkEmail:Ue,autolinkProtocol:tt,blockQuote:o(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:it,characterReferenceMarkerNumeric:it,characterReferenceValue:Te,characterReference:Ze,codeFenced:o(C),codeFencedFence:w,codeFencedFenceInfo:p,codeFencedFenceMeta:y,codeFlowValue:E,codeIndented:o(A),codeText:o(H),codeTextData:E,data:E,definition:o(),definitionDestinationString:q,definitionLabelString:z,definitionTitleString:I,emphasis:o(),hardBreakEscape:o($),hardBreakTrailing:o($),htmlFlow:o(se),htmlFlowData:E,htmlText:o(Y),htmlTextData:E,image:o(pe),label:$e,labelText:Me,lineEnding:V,link:o(ae),listItem:o(),listOrdered:o(),listUnordered:o(),paragraph:o(),referenceString:Ee,resourceDestinationString:k,resourceTitleString:xe,resource:Fe,setextHeading:o(X),setextHeadingLineSequence:G,setextHeadingText:M,strong:o(),thematicBreak:o()}};Ol(t,(e||{}).mdastExtensions||[]);const r={};return n;function n(D){let j={type:"root",children:[]};const Q={stack:[j],tokenStack:[],config:t,enter:s,exit:u,buffer:l,resume:h,data:r},ne=[];let ce=-1;for(;++ce<D.length;)if(D[ce][1].type==="listOrdered"||D[ce][1].type==="listUnordered")if(D[ce][0]==="enter")ne.push(ce);else{const rt=ne.pop();ce=i(D,rt,ce)}for(ce=-1;++ce<D.length;){const rt=t[D[ce][0]];Pl.call(rt,D[ce][1].type)&&rt[D[ce][1].type].call(Object.assign({sliceSerialize:D[ce][2].sliceSerialize},Q),D[ce][1])}if(Q.tokenStack.length>0){const rt=Q.tokenStack[Q.tokenStack.length-1];(rt[1]||Ki).call(Q,void 0,rt[0])}for(j.position={start:St(D.length>0?D[0][1].start:{line:1,column:1,offset:0}),end:St(D.length>0?D[D.length-2][1].end:{line:1,column:1,offset:0})},ce=-1;++ce<t.transforms.length;)j=t.transforms[ce](j)||j;return j}function i(D,j,Q){let ne=j-1,ce=-1,rt=!1,Lt,ft,mr,fr;for(;++ne<=Q;){const Ve=D[ne];switch(Ve[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Ve[0]==="enter"?ce++:ce--,fr=void 0;break}case"lineEndingBlank":{Ve[0]==="enter"&&(Lt&&!fr&&!ce&&!mr&&(mr=ne),fr=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:fr=void 0}if(!ce&&Ve[0]==="enter"&&Ve[1].type==="listItemPrefix"||ce===-1&&Ve[0]==="exit"&&(Ve[1].type==="listUnordered"||Ve[1].type==="listOrdered")){if(Lt){let Yt=ne;for(ft=void 0;Yt--;){const pt=D[Yt];if(pt[1].type==="lineEnding"||pt[1].type==="lineEndingBlank"){if(pt[0]==="exit")continue;ft&&(D[ft][1].type="lineEndingBlank",rt=!0),pt[1].type="lineEnding",ft=Yt}else if(!(pt[1].type==="linePrefix"||pt[1].type==="blockQuotePrefix"||pt[1].type==="blockQuotePrefixWhitespace"||pt[1].type==="blockQuoteMarkLine truncated `;break}case-2:{l=t?" ":" ";break}case-1:{if(!t&&i)continue;l=" ";break}default:l=String.fromCharCode(a)}i=a===-2,n.push(l)}return n.join("")}function Q1(e){const n={constructs:Bl([X1,...(e||{}).extensions||[]]),content:i(M1),defined:[],document:i(I1),flow:i(F1),lazy:{},string:i(N1),text:i(P1)};return n;function i(a){return l;function l(s){return Y1(n,a,s)}}}function J1(e){for(;!Ml(e););return e}const Yi=/[\0\t\n\r]/g;function ec(){let e=1,t="",r=!0,n;return i;function i(a,l,s){const o=[];let u,h,m,d,p;for(a=t+(typeof a=="string"?a.toString():new TextDecoder(l||void 0).decode(a)),m=0,t="",r&&(a.charCodeAt(0)===65279&&m++,r=void 0);m<a.length;){if(Yi.lastIndex=m,u=Yi.exec(a),d=u&&u.index!==void 0?u.index:a.length,p=a.charCodeAt(d),!u){t=a.slice(m);break}if(p===10&&m===d&&n)o.push(-3),n=void 0;else switch(n&&(o.push(-5),n=void 0),m<d&&(o.push(a.slice(m,d)),e+=d-m),p){case 0:{o.push(65533),e++;break}case 9:{for(h=Math.ceil(e/4)*4,o.push(-2);e++<h;)o.push(-1);break}case 10:{o.push(-4),e=1;break}default:n=!0,e=1}m=d+1}return s&&(n&&o.push(-5),t&&o.push(t),o.push(null)),o}}const tc=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function rc(e){return e.replace(tc,nc)}function nc(e,t,r){if(t)return t;if(r.charCodeAt(0)===35){const i=r.charCodeAt(1),a=i===120||i===88;return Rl(r.slice(a?2:1),a?16:10)}return W0(r)||e}const Pl={}.hasOwnProperty;function ic(e,t,r){return t&&typeof t=="object"&&(r=t,t=void 0),ac(r)(J1(Q1(r).document().write(ec()(e,t,!0))))}function ac(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(cr),autolinkProtocol:U,autolinkEmail:U,atxHeading:a(Lr),blockQuote:a(mt),characterEscape:U,characterReference:U,codeFenced:a(Ft),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:a(Ft,l),codeText:a(Rr,l),codeTextData:U,data:U,codeFlowValue:U,definition:a(Wt),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:a(Xt),hardBreakEscape:a(Nr),hardBreakTrailing:a(Nr),htmlFlow:a(Pr,l),htmlFlowData:U,htmlText:a(Pr,l),htmlTextData:U,image:a(Or),label:l,link:a(cr),listItem:a(Bn),listItemValue:d,listOrdered:a(Rt,m),listUnordered:a(Rt),paragraph:a(Fn),reference:S,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:a(Lr),strong:a(hr),thematicBreak:a(Hr)},exit:{atxHeading:o(),atxHeadingSequence:O,autolink:o(),autolinkEmail:Ue,autolinkProtocol:tt,blockQuote:o(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:it,characterReferenceMarkerNumeric:it,characterReferenceValue:Te,characterReference:Ze,codeFenced:o(C),codeFencedFence:w,codeFencedFenceInfo:p,codeFencedFenceMeta:y,codeFlowValue:E,codeIndented:o(A),codeText:o(H),codeTextData:E,data:E,definition:o(),definitionDestinationString:q,definitionLabelString:z,definitionTitleString:I,emphasis:o(),hardBreakEscape:o($),hardBreakTrailing:o($),htmlFlow:o(se),htmlFlowData:E,htmlText:o(Y),htmlTextData:E,image:o(pe),label:$e,labelText:Me,lineEnding:V,link:o(ae),listItem:o(),listOrdered:o(),listUnordered:o(),paragraph:o(),referenceString:Ee,resourceDestinationString:k,resourceTitleString:xe,resource:Fe,setextHeading:o(X),setextHeadingLineSequence:G,setextHeadingText:M,strong:o(),thematicBreak:o()}};Ol(t,(e||{}).mdastExtensions||[]);const r={};return n;function n(D){let j={type:"root",children:[]};const Q={stack:[j],tokenStack:[],config:t,enter:s,exit:u,buffer:l,resume:h,data:r},ne=[];let ce=-1;for(;++ce<D.length;)if(D[ce][1].type==="listOrdered"||D[ce][1].type==="listUnordered")if(D[ce][0]==="enter")ne.push(ce);else{const rt=ne.pop();ce=i(D,rt,ce)}for(ce=-1;++ce<D.length;){const rt=t[D[ce][0]];Pl.call(rt,D[ce][1].type)&&rt[D[ce][1].type].call(Object.assign({sliceSerialize:D[ce][2].sliceSerialize},Q),D[ce][1])}if(Q.tokenStack.length>0){const rt=Q.tokenStack[Q.tokenStack.length-1];(rt[1]||Ki).call(Q,void 0,rt[0])}for(j.position={start:St(D.length>0?D[0][1].start:{line:1,column:1,offset:0}),end:St(D.length>0?D[D.length-2][1].end:{line:1,column:1,offset:0})},ce=-1;++ce<t.transforms.length;)j=t.transforms[ce](j)||j;return j}function i(D,j,Q){let ne=j-1,ce=-1,rt=!1,Lt,ft,mr,fr;for(;++ne<=Q;){const Ve=D[ne];switch(Ve[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Ve[0]==="enter"?ce++:ce--,fr=void 0;break}case"lineEndingBlank":{Ve[0]==="enter"&&(Lt&&!fr&&!ce&&!mr&&(mr=ne),fr=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:fr=void 0}if(!ce&&Ve[0]==="enter"&&Ve[1].type==="listItemPrefix"||ce===-1&&Ve[0]==="exit"&&(Ve[1].type==="listUnordered"||Ve[1].type==="listOrdered")){if(Lt){let Yt=ne;for(ft=void 0;Yt--;){const pt=D[Yt];if(pt[1].type==="lineEnding"||pt[1].type==="lineEndingBlank"){if(pt[0]==="exit")continue;ft&&(D[ft][1].type="lineEndingBlank",rt=!0),pt[1].type="lineEnding",ft=Yt}else if(!(pt[1].type==="linePrefix"||pt[1].type==="blockQuotePrefix"||pt[1].type==="blockQuotePrefixWhitespace"||pt[1].type==="blockQuoteMarkLine truncated
@@ -1,2 +1,2 @@
import{c as te,b as c,an as G,ao as oe,aj as r,T as f,ap as I,av as re,at as ne,aq as ae,as as ie,ar as ce}from"./tauri-compat-tfiFK9EG.js";import{B as F}from"./index-DpGuh58E.js";import{B as L}from"./index-Bpi3BHKj.js";import{I as se}from"./IconFile-CgfQSwGI.js";function le(t){return c.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},t),c.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 5a3 3 0 0 1 3-3h3.3a2 2 0 0 1 1.25.44l1.13.9a3 3 0 0 0 1.87.66H18c2 0 3 2 3 4H7.53A2 2 0 0 0 5.6 9.48L2.57 20.76C2.21 20.26 2 19.66 2 19V5Zm20.17 5H9.5a2 2 0 0 0-1.92 1.44l-2.7 9.28A1 1 0 0 0 5.82 22H18.5a2 2 0 0 0 1.92-1.44l2.7-9.28a1 1 0 0 0-.95-1.28Z",fill:"currentColor"}))}const pe=te(le,"folder_open");function C(){return window.__TAURI__}function de(t,e){return Number.isFinite(e.seq)?e.seq>t:!0}function O(t,e,n,i="prepare_failed"){const u=e==null?"":oe(e);return{seq:n,mode:"cold_start",phase:"failed",stage:null,progress:0,failure:{code:u?i:"unknown",detail:u},diagnostics:{buildId:"",platform:navigator.platform||"",projectDir:t[1]||"",pythonPath:t[0]||"",portState:"unknown",bridgeIdentity:null,recentLogs:[]}}}async function ue(t,e=0){const n=await t("get_config").catch(()=>["",""]);try{return{config:n,mode:"snapshot",snapshot:await t("get_bootstrap_snapshot")}}catch(i){if(!G(i,"get_bootstrap_snapshot"))throw i;const u=await t("get_prepare_error").catch(()=>null);return{config:n,mode:"legacy",snapshot:O(n,u,e)}}}async function he(t,e,n){if(n==="snapshot")try{return await t("retry_bootstrap",e),{mode:"snapshot"}}catch(i){if(!G(i,"retry_bootstrap"))return{mode:"snapshot",error:i}}try{return await t("start_bridge_with_config",e),{mode:"legacy"}}catch(i){return{mode:"legacy",error:i}}}async function ye(t,e,n){const i=await t("pick_directory",{title:n});if(!i)return null;const u=await t("discover_python_for_project",{projectDir:i,currentPython:e||null}).catch(()=>e);return{projectDir:i,pythonPath:u||""}}async function ge(t,e){return t("pick_python_interpreter",{title:e})}const H={config_unresolved:{zh:{title:"未找到应用文件",description:"请选择应用文件夹后继续。"},en:{title:"Application files not found",description:"Choose the application folder to continue."}},prepare_failed:{zh:{title:"运行环境尚未准备完成",description:"请检查所选应用文件夹和 Python 环境,然后继续启动。"},en:{title:"Environment setup is incomplete",description:"Check the application folder and Python environment, then continue startup."}},spawn_failed:{zh:{title:"本地连接未能启动",description:"请选择可用的应用文件夹和 Python 环境后继续。"},en:{title:"Local connection could not start",description:"Choose a usable application folder and Python environment to continue."}},bridge_shutdown_refused:{zh:{title:"本地连接暂时无法安全重启",description:"请等待当前操作完成后重试。"},en:{title:"Local connection cannot restart safely",description:"Wait for the current operation to finish, then retry."}},port_conflict:{zh:{title:"本地连接被占用",description:"另一个应用正在使用本地连接。关闭相关应用后继续启动。"},en:{title:"Local connection is in use",description:"Another app is using the local connection. Close it, then continue startup."}},service_timeout:{zh:{title:"本地连接启动时间过长",description:"请检查所选位置;诊断信息中包含最近的启动记录。"},en:{title:"Local connection is taking too long",description:"Check the selected locations. Diagnostics contain the latest startup records."}},service_exited:{zh:{title:"本地连接意外停止",description:"诊断信息中包含停止状态和最近的启动记录。"},en:{title:"Local connection stopped unexpectedly",description:"Diagnostics contain the stop status and latest startup records."}},ui_navigation_failed:{zh:{title:"主界面未能打开",description:"本地连接已经就绪,但界面加载失败。诊断信息中包含详细原因。"},en:{title:"Main window could not open",description:"The local connection is ready, but the interface failed to load. Diagnostics contain details."}},unknown:{zh:{title:"启动尚未完成",description:"请检查所选位置;需要协助时可复制诊断信息。"},en:{title:"Startup is not complete",description:"Check the selected locations. Copy diagnostics if you need support."}}},fe={zh:{pageTitle:"完成启动设置",intro:"选择应用运行所需的位置。你的记忆、会话和设置不会受到影响。",projectLabel:"应用文件夹",projectHint:"选择此前用于运行桌面版的应用文件夹。",projectPickerTitle:"选择应用文件夹",chooseProject:"选择文件夹",changeProject:"重新选择",projectEmpty:"尚未选择应用文件夹",pythonLabel:"Python 环境",pythonHint:"应用会自动选择可用环境;如有需要,可以重新选择。",pythonPickerTitlLine truncated import{c as te,b as c,an as G,ao as oe,aj as r,T as f,ap as L,av as re,at as ne,aq as ae,as as ie,ar as ce}from"./tauri-compat-tfiFK9EG.js";import{B as F}from"./index-DpGuh58E.js";import{B as A}from"./index-Bpi3BHKj.js";import{I as se}from"./IconFile-CgfQSwGI.js";function le(t){return c.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},t),c.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 5a3 3 0 0 1 3-3h3.3a2 2 0 0 1 1.25.44l1.13.9a3 3 0 0 0 1.87.66H18c2 0 3 2 3 4H7.53A2 2 0 0 0 5.6 9.48L2.57 20.76C2.21 20.26 2 19.66 2 19V5Zm20.17 5H9.5a2 2 0 0 0-1.92 1.44l-2.7 9.28A1 1 0 0 0 5.82 22H18.5a2 2 0 0 0 1.92-1.44l2.7-9.28a1 1 0 0 0-.95-1.28Z",fill:"currentColor"}))}const pe=te(le,"folder_open");function C(){return window.__TAURI__}function de(t,e){return Number.isFinite(e.seq)?e.seq>t:!0}function O(t,e,n,i="prepare_failed"){const u=e==null?"":oe(e);return{seq:n,mode:"cold_start",phase:"failed",stage:null,progress:0,failure:{code:u?i:"unknown",detail:u},diagnostics:{buildId:"",platform:navigator.platform||"",projectDir:t[1]||"",pythonPath:t[0]||"",portState:"unknown",bridgeIdentity:null,recentLogs:[]}}}async function ue(t,e=0){const n=await t("get_config").catch(()=>["",""]);try{return{config:n,mode:"snapshot",snapshot:await t("get_bootstrap_snapshot")}}catch(i){if(!G(i,"get_bootstrap_snapshot"))throw i;const u=await t("get_prepare_error").catch(()=>null);return{config:n,mode:"legacy",snapshot:O(n,u,e)}}}async function he(t,e,n){if(n==="snapshot")try{return await t("retry_bootstrap",e),{mode:"snapshot"}}catch(i){if(!G(i,"retry_bootstrap"))return{mode:"snapshot",error:i}}try{return await t("start_bridge_with_config",e),{mode:"legacy"}}catch(i){return{mode:"legacy",error:i}}}async function ye(t,e,n){const i=await t("pick_directory",{title:n});if(!i)return null;const u=await t("discover_python_for_project",{projectDir:i,currentPython:e||null}).catch(()=>e);return{projectDir:i,pythonPath:u||""}}async function ge(t,e){return t("pick_python_interpreter",{title:e})}const H={config_unresolved:{zh:{title:"未找到应用文件",description:"请选择应用文件夹后继续。"},en:{title:"Application files not found",description:"Choose the application folder to continue."}},prepare_failed:{zh:{title:"运行环境尚未准备完成",description:"请检查所选应用文件夹和 Python 环境,然后继续启动。"},en:{title:"Environment setup is incomplete",description:"Check the application folder and Python environment, then continue startup."}},spawn_failed:{zh:{title:"本地连接未能启动",description:"请选择可用的应用文件夹和 Python 环境后继续。"},en:{title:"Local connection could not start",description:"Choose a usable application folder and Python environment to continue."}},bridge_shutdown_refused:{zh:{title:"本地连接暂时无法安全重启",description:"请等待当前操作完成后重试。"},en:{title:"Local connection cannot restart safely",description:"Wait for the current operation to finish, then retry."}},port_conflict:{zh:{title:"本地连接被占用",description:"另一个应用正在使用本地连接。关闭相关应用后继续启动。"},en:{title:"Local connection is in use",description:"Another app is using the local connection. Close it, then continue startup."}},service_timeout:{zh:{title:"本地连接启动时间过长",description:"请检查所选位置;诊断信息中包含最近的启动记录。"},en:{title:"Local connection is taking too long",description:"Check the selected locations. Diagnostics contain the latest startup records."}},service_exited:{zh:{title:"本地连接意外停止",description:"诊断信息中包含停止状态和最近的启动记录。"},en:{title:"Local connection stopped unexpectedly",description:"Diagnostics contain the stop status and latest startup records."}},ui_navigation_failed:{zh:{title:"主界面未能打开",description:"本地连接已经就绪,但界面加载失败。诊断信息中包含详细原因。"},en:{title:"Main window could not open",description:"The local connection is ready, but the interface failed to load. Diagnostics contain details."}},unknown:{zh:{title:"启动尚未完成",description:"请检查所选位置;需要协助时可复制诊断信息。"},en:{title:"Startup is not complete",description:"Check the selected locations. Copy diagnostics if you need support."}}},fe={zh:{pageTitle:"完成启动设置",intro:"选择应用运行所需的位置。你的记忆、会话和设置不会受到影响。",projectLabel:"应用文件夹",projectHint:"选择此前用于运行桌面版的应用文件夹。",projectPickerTitle:"选择应用文件夹",chooseProject:"选择文件夹",changeProject:"重新选择",projectEmpty:"尚未选择应用文件夹",pythonLabel:"Python 环境",pythonHint:"应用会自动选择可用环境;如有需要,可以重新选择。",pythonPickerTitlLine truncated
`)}const B={projectDir:"",pythonPath:""};function q({label:t,hint:e,value:n,emptyText:i,buttonText:u,buttonLabel:l,loading:k,disabled:m,icon:j,onChoose:P}){return r.jsxs("section",{className:"ga-setup-location","aria-label":t,children:[r.jsxs("div",{className:"ga-setup-location-header",children:[r.jsx(f.Text,{strong:!0,children:t}),r.jsx(L,{size:"small",type:"tertiary",theme:"light",icon:j,loading:k,disabled:m,"aria-label":l,onClick:P,children:u})]}),r.jsx("div",{className:`ga-setup-path${n?"":" ga-setup-path--empty"}`,role:"textbox","aria-readonly":"true","aria-label":t,tabIndex:0,children:n?r.jsx("code",{children:n}):r.jsx("span",{children:i})}),r.jsx(f.Paragraph,{type:"tertiary",size:"small",className:"ga-setup-location-hint",children:e})]})}function S(t,e){return{seq:e,mode:"cold_start",phase:"failed",stage:null,progress:0,failure:{code:"unknown",detail:String(t)},diagnostics:{buildId:"",platform:navigator.platform||"",projectDir:"",pythonPath:"",portState:"unknown",bridgeIdentity:null,recentLogs:[]}}}function Pe(){var M;const t=V(),e=me(t),n=c.useRef(B),[i,u]=c.useState(B),[l,k]=c.useState(null),[m,j]=c.useState(!1),[P,N]=c.useState(!1),[T,z]=c.useState(!1),[R,b]=c.useState(""),[W,E]=c.useState(""),g=c.useRef(-1),w=c.useRef(null),D=c.useRef("snapshot"),h=c.useCallback(o=>{n.current=o,u(o)},[]),y=c.useCallback(o=>{var d,s,_,v;const a=w.current;if(!de(g.current,o))return;g.current=Number.isFinite(o.seq)?o.seq:g.current+1,w.current=o,k(o),o.phase==="failed"&&j(!1);const p={};(d=o.diagnostics)!=null&&d.projectDir&&(!n.current.projectDir||((s=a==null?void 0:a.diagnostics)==null?void 0:s.projectDir)===n.current.projectDir)&&(p.projectDir=o.diagnostics.projectDir),(_=o.diagnostics)!=null&&_.pythonPath&&(!n.current.pythonPath||((v=a==null?void 0:a.diagnostics)==null?void 0:v.pythonPath)===n.current.pythonPath)&&(p.pythonPath=o.diagnostics.pythonPath),Object.keys(p).length&&h({...n.current,...p})},[h]);c.useEffect(()=>{var o;(o=window.__GA_SETUP_MARK_READY__)==null||o.call(window)},[]),c.useEffect(()=>{const o=C();if(!(o!=null&&o.core.invoke)){y(S("Tauri bootstrap API is unavailable",0));return}let a=!0,p;return(async()=>{var v;if((v=o.event)!=null&&v.listen)try{const x=await o.event.listen("bootstrap",ee=>{a&&y(ee.payload)});if(!a){x();return}p=x}catch(x){console.warn("[setup] bootstrap events unavailable; using command compatibility mode",x)}const d=await ue(o.core.invoke,g.current+1);if(!a)return;D.current=d.mode;const s=d.config,_={pythonPath:(s==null?void 0:s[0])||"",projectDir:(s==null?void 0:s[1])||""};h({pythonPath:n.current.pythonPath||_.pythonPath,projectDir:n.current.projectDir||_.projectDir}),y(d.snapshot)})().catch(d=>{a&&y(S(d,g.current+1))}),()=>{a=!1,p==null||p()}},[h,y]);const $=c.useMemo(()=>{var o;return je((o=l==null?void 0:l.failure)==null?void 0:o.code,t)},[t,(M=l==null?void 0:l.failure)==null?void 0:M.code]),A=c.useMemo(()=>be(l),[l]),Z=c.useCallback(async()=>{const o=C();if(!(o!=null&&o.core.invoke)){b(e.pickerError);return}N(!0),b("");try{const a=await ye(o.core.invoke,n.current.pythonPath,e.projectPickerTitle);a&&h(a)}catch(a){console.error("[setup] application folder selection failed",a),b(e.pickerError)}finally{N(!1)}},[h,e]),J=c.useCallback(async()=>{const o=C();if(!(o!=null&&o.core.invoke)){b(e.pickerError);return}z(!0),b("");try{const a=await ge(o.core.invoke,e.pythonPickerTitle);a&&h({...n.current,pythonPath:a})}catch(a){console.error("[setup] Python environment selection failed",a),b(e.pickerError)}finally{z(!1)}},[h,e]),Q=c.useCallback(async()=>{const o=n.current.projectDir.trim(),a=n.current.pythonPath.trim();if(h({projectDir:o,pythonPath:a}),E(""),!o){const s=w.current??S("",g.current+1);y({...s,seq:g.current+1,phase:"failed",failure:{code:"config_unresolved",detail:""}});return}j(!0);const p=C();if(!(p!=null&&p.core.invoke)){y(S("Tauri bootstrap API is unavailable",g.current+1)),j(!1);return}const d=await he(p.core.invoke,{pythonPath:a,projectDir:o},D.current);if(D.current=d.mode,d.error){if(d.mode==="legacy")y(O([a,o],d.error,g.current+1,"spawn_failed"));else{const s=await p.core.invoke("get_bootstrap_snapshot").catch(()=>w.current);s&&y(s)}j(!1)}},[h,y]),X=c.useCallback(async()=>{var o;try{if(!((o=navigator.clipboard)!=null&&o.writeText))throw new Error("clipboard unavailable");await navigator.clipboard.writeText(A),E(e.copied)}catch{const p=document.getElementById("diagnostics");if(p){const d=document.createRange();d.selectNodeContents(p);const s=window.getSelection();s==null||s.removeAllRanges(),s==null||s.addRange(d),p.focus()}E(e.selectCopy)}},[e,A]);return r.jsx("main",{className:"ga-setup-page",children:r.jsxs("section",{className:"ga-setup-panel","aria-labelledby":"ga-setup-title",children:[r.jsxs("header",{className:"ga-setup-header",children:[r.jsx(f.Title,{id:"ga-setup-title",heading:3,children:e.pageTitle}),r.jsx(f.Paragraph,{type:"tertiary",children:e.intro})]}),(l==null?void 0:l.failure)&&r.jsx(F,{className:"ga-setup-banner",type:"danger",fullMode:!1,bordered Line truncated `)}const B={projectDir:"",pythonPath:""};function q({label:t,hint:e,value:n,emptyText:i,buttonText:u,buttonLabel:l,loading:k,disabled:m,icon:j,onChoose:P}){return r.jsxs("section",{className:"ga-setup-location","aria-label":t,children:[r.jsxs("div",{className:"ga-setup-location-header",children:[r.jsx(f.Text,{strong:!0,children:t}),r.jsx(A,{size:"small",type:"tertiary",theme:"light",icon:j,loading:k,disabled:m,"aria-label":l,onClick:P,children:u})]}),r.jsx("div",{className:`ga-setup-path${n?"":" ga-setup-path--empty"}`,role:"textbox","aria-readonly":"true","aria-label":t,tabIndex:0,children:n?r.jsx("code",{children:n}):r.jsx("span",{children:i})}),r.jsx(f.Paragraph,{type:"tertiary",size:"small",className:"ga-setup-location-hint",children:e})]})}function S(t,e){return{seq:e,mode:"cold_start",phase:"failed",stage:null,progress:0,failure:{code:"unknown",detail:String(t)},diagnostics:{buildId:"",platform:navigator.platform||"",projectDir:"",pythonPath:"",portState:"unknown",bridgeIdentity:null,recentLogs:[]}}}function Pe(){var M;const t=V(),e=me(t),n=c.useRef(B),[i,u]=c.useState(B),[l,k]=c.useState(null),[m,j]=c.useState(!1),[P,N]=c.useState(!1),[T,z]=c.useState(!1),[R,b]=c.useState(""),[W,E]=c.useState(""),g=c.useRef(-1),w=c.useRef(null),D=c.useRef("snapshot"),h=c.useCallback(o=>{n.current=o,u(o)},[]),y=c.useCallback(o=>{var d,s,_,v;const a=w.current;if(!de(g.current,o))return;g.current=Number.isFinite(o.seq)?o.seq:g.current+1,w.current=o,k(o),o.phase==="failed"&&j(!1);const p={};(d=o.diagnostics)!=null&&d.projectDir&&(!n.current.projectDir||((s=a==null?void 0:a.diagnostics)==null?void 0:s.projectDir)===n.current.projectDir)&&(p.projectDir=o.diagnostics.projectDir),(_=o.diagnostics)!=null&&_.pythonPath&&(!n.current.pythonPath||((v=a==null?void 0:a.diagnostics)==null?void 0:v.pythonPath)===n.current.pythonPath)&&(p.pythonPath=o.diagnostics.pythonPath),Object.keys(p).length&&h({...n.current,...p})},[h]);c.useEffect(()=>{var o;(o=window.__GA_SETUP_MARK_READY__)==null||o.call(window)},[]),c.useEffect(()=>{const o=C();if(!(o!=null&&o.core.invoke)){y(S("Tauri bootstrap API is unavailable",0));return}let a=!0,p;return(async()=>{var v;if((v=o.event)!=null&&v.listen)try{const x=await o.event.listen("bootstrap",ee=>{a&&y(ee.payload)});if(!a){x();return}p=x}catch(x){console.warn("[setup] bootstrap events unavailable; using command compatibility mode",x)}const d=await ue(o.core.invoke,g.current+1);if(!a)return;D.current=d.mode;const s=d.config,_={pythonPath:(s==null?void 0:s[0])||"",projectDir:(s==null?void 0:s[1])||""};h({pythonPath:n.current.pythonPath||_.pythonPath,projectDir:n.current.projectDir||_.projectDir}),y(d.snapshot)})().catch(d=>{a&&y(S(d,g.current+1))}),()=>{a=!1,p==null||p()}},[h,y]);const $=c.useMemo(()=>{var o;return je((o=l==null?void 0:l.failure)==null?void 0:o.code,t)},[t,(M=l==null?void 0:l.failure)==null?void 0:M.code]),I=c.useMemo(()=>be(l),[l]),Z=c.useCallback(async()=>{const o=C();if(!(o!=null&&o.core.invoke)){b(e.pickerError);return}N(!0),b("");try{const a=await ye(o.core.invoke,n.current.pythonPath,e.projectPickerTitle);a&&h(a)}catch(a){console.error("[setup] application folder selection failed",a),b(e.pickerError)}finally{N(!1)}},[h,e]),J=c.useCallback(async()=>{const o=C();if(!(o!=null&&o.core.invoke)){b(e.pickerError);return}z(!0),b("");try{const a=await ge(o.core.invoke,e.pythonPickerTitle);a&&h({...n.current,pythonPath:a})}catch(a){console.error("[setup] Python environment selection failed",a),b(e.pickerError)}finally{z(!1)}},[h,e]),Q=c.useCallback(async()=>{const o=n.current.projectDir.trim(),a=n.current.pythonPath.trim();if(h({projectDir:o,pythonPath:a}),E(""),!o){const s=w.current??S("",g.current+1);y({...s,seq:g.current+1,phase:"failed",failure:{code:"config_unresolved",detail:""}});return}j(!0);const p=C();if(!(p!=null&&p.core.invoke)){y(S("Tauri bootstrap API is unavailable",g.current+1)),j(!1);return}const d=await he(p.core.invoke,{pythonPath:a,projectDir:o},D.current);if(D.current=d.mode,d.error){if(d.mode==="legacy")y(O([a,o],d.error,g.current+1,"spawn_failed"));else{const s=await p.core.invoke("get_bootstrap_snapshot").catch(()=>w.current);s&&y(s)}j(!1)}},[h,y]),X=c.useCallback(async()=>{var o;try{if(!((o=navigator.clipboard)!=null&&o.writeText))throw new Error("clipboard unavailable");await navigator.clipboard.writeText(I),E(e.copied)}catch{const p=document.getElementById("diagnostics");if(p){const d=document.createRange();d.selectNodeContents(p);const s=window.getSelection();s==null||s.removeAllRanges(),s==null||s.addRange(d),p.focus()}E(e.selectCopy)}},[e,I]);return r.jsx("main",{className:"ga-setup-page",children:r.jsxs("section",{className:"ga-setup-panel","aria-labelledby":"ga-setup-title",children:[r.jsxs("header",{className:"ga-setup-header",children:[r.jsx(f.Title,{id:"ga-setup-title",heading:3,children:e.pageTitle}),r.jsx(f.Paragraph,{type:"tertiary",children:e.intro})]}),(l==null?void 0:l.failure)&&r.jsx(F,{className:"ga-setup-banner",type:"danger",fullMode:!1,bordered Line truncated
+2 -2
View File
@@ -3,7 +3,7 @@
"product": "GenericAgent React Desktop 2.0", "product": "GenericAgent React Desktop 2.0",
"version": "0.2.0", "version": "0.2.0",
"sourceRepository": "https://github.com/abraxas914/GenericAgent", "sourceRepository": "https://github.com/abraxas914/GenericAgent",
"sourceCommit": "21f12f6dfe57ada8572bb21fe6604caac230b1cf", "sourceCommit": "9fe5d69b85cfad8778ace84b6f69bc75f9e0d392",
"generatedAssetCount": 98, "generatedAssetCount": 98,
"generatedManifestSha256": "7ed4bd56d50919d1ea6f92f60658403f19a93f117612704252f6e154ba39f92e" "generatedManifestSha256": "bd1ee4cd8f0d3b8c00e8cf05a68af12d2ec0d6ff456212d2d5930e4ad6889ee2"
} }
+1 -1
View File
@@ -21,7 +21,7 @@
<p class="ga-picker-status" id="picker-status" role="status" aria-live="polite"></p> <p class="ga-picker-status" id="picker-status" role="status" aria-live="polite"></p>
<button class="ga-primary" id="retry" type="button">继续启动</button> <button class="ga-primary" id="retry" type="button">继续启动</button>
<details><summary id="diagnostics-label">诊断信息</summary><div class="ga-diagnostics-actions"><button class="ga-copy" id="copy" type="button">复制诊断信息</button><span class="ga-copy-status" id="copy-status" aria-live="polite"></span></div><pre id="diagnostics" tabindex="0">GenericAgent Desktop startup diagnostics</pre><p class="ga-privacy" id="privacy">诊断信息由启动服务脱敏后提供,包含本机路径和错误日志,不包含 API Key、会话或记忆内容。</p></details> <details><summary id="diagnostics-label">诊断信息</summary><div class="ga-diagnostics-actions"><button class="ga-copy" id="copy" type="button">复制诊断信息</button><span class="ga-copy-status" id="copy-status" aria-live="polite"></span></div><pre id="diagnostics" tabindex="0">GenericAgent Desktop startup diagnostics</pre><p class="ga-privacy" id="privacy">诊断信息由启动服务脱敏后提供,包含本机路径和错误日志,不包含 API Key、会话或记忆内容。</p></details>
<details><summary id="help-feedback-label">帮助与反馈</summary><p class="ga-contact-copy" id="contact-copy">如果仍无法完成启动,可添加微信联系:</p><div class="ga-contact-ids"><code>RoundSquisheen</code><code>_Ashes_in_the_Snow_</code></div></details> <details><summary id="help-feedback-label">帮助与反馈</summary><p class="ga-contact-copy" id="contact-copy">如果仍无法完成启动,可添加微信联系:</p><div class="ga-contact-ids"><code>RoundSquisheen</code><code>persist0612</code></div></details>
</main> </main>
<script> <script>
(function () { (function () {
+31 -31
View File
@@ -1,29 +1,29 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="zh-CN"> <html lang="zh-CN">
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" type="image/svg+xml" href="/assets/ga-logo.svg"> <link rel="icon" type="image/svg+xml" href="/assets/ga-logo.svg">
<title>GenericAgent</title> <title>GenericAgent</title>
<script> <script>
// FOUC prevention: apply cached appearance before first paint // FOUC prevention: apply cached appearance before first paint
(function(){ (function(){
var l=localStorage.getItem('ga_lang'); if(l==='en') document.documentElement.lang='en'; var l=localStorage.getItem('ga_lang'); if(l==='en') document.documentElement.lang='en';
var app=localStorage.getItem('ga_appearance')||'light'; var app=localStorage.getItem('ga_appearance')||'light';
document.documentElement.dataset.appearance=app; document.documentElement.dataset.appearance=app;
var LEGACY_FONT={sm:12,md:14,lg:16}; var LEGACY_FONT={sm:12,md:14,lg:16};
function chatFontPx(v){ function chatFontPx(v){
if(v&&LEGACY_FONT[v]) return LEGACY_FONT[v]; if(v&&LEGACY_FONT[v]) return LEGACY_FONT[v];
var n=parseInt(v,10); if(!isNaN(n)&&n>=10&&n<=20) return n; var n=parseInt(v,10); if(!isNaN(n)&&n>=10&&n<=20) return n;
return 14; return 14;
} }
var fs=localStorage.getItem('ga_font_size'); var fs=localStorage.getItem('ga_font_size');
var cfp=chatFontPx(fs); var cfp=chatFontPx(fs);
document.documentElement.dataset.chatFont=String(cfp); document.documentElement.dataset.chatFont=String(cfp);
document.documentElement.style.setProperty('--chat-font',cfp+'px'); document.documentElement.style.setProperty('--chat-font',cfp+'px');
})(); })();
</script> </script>
<script type="module" crossorigin src="/assets/main-Knf6L_en.js"></script> <script type="module" crossorigin src="/assets/main-BlLQtfpq.js"></script>
<link rel="modulepreload" crossorigin href="/assets/tauri-compat-tfiFK9EG.js"> <link rel="modulepreload" crossorigin href="/assets/tauri-compat-tfiFK9EG.js">
<link rel="modulepreload" crossorigin href="/assets/index-Bpi3BHKj.js"> <link rel="modulepreload" crossorigin href="/assets/index-Bpi3BHKj.js">
<link rel="modulepreload" crossorigin href="/assets/WindowsTitlebar-CrkUa1UM.js"> <link rel="modulepreload" crossorigin href="/assets/WindowsTitlebar-CrkUa1UM.js">
@@ -31,8 +31,8 @@
<link rel="stylesheet" crossorigin href="/assets/index-D0pGtk0y.css"> <link rel="stylesheet" crossorigin href="/assets/index-D0pGtk0y.css">
<link rel="stylesheet" crossorigin href="/assets/WindowsTitlebar-U0YG9JNA.css"> <link rel="stylesheet" crossorigin href="/assets/WindowsTitlebar-U0YG9JNA.css">
<link rel="stylesheet" crossorigin href="/assets/main-uLcKKTNv.css"> <link rel="stylesheet" crossorigin href="/assets/main-uLcKKTNv.css">
</head> </head>
<body class="no-transition"> <body class="no-transition">
<div id="app"></div> <div id="app"></div>
</body> </body>
</html> </html>
+22 -22
View File
@@ -1,21 +1,21 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="zh-CN"> <html lang="zh-CN">
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<title>GenericAgent</title> <title>GenericAgent</title>
<style> <style>
:root{color-scheme:light dark;font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text","Segoe UI","Microsoft YaHei UI",sans-serif;--ga-first-bg:#fff;--ga-first-text:#1c1f23;--ga-first-track:#e8e8e8;--ga-first-accent:#0064fa;background:var(--ga-first-bg);color:var(--ga-first-text)} :root{color-scheme:light dark;font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text","Segoe UI","Microsoft YaHei UI",sans-serif;--ga-first-bg:#fff;--ga-first-text:#1c1f23;--ga-first-track:#e8e8e8;--ga-first-accent:#0064fa;background:var(--ga-first-bg);color:var(--ga-first-text)}
@media(prefers-color-scheme:dark){:root{--ga-first-bg:#16161a;--ga-first-text:#f2f3f5;--ga-first-track:#34363c;--ga-first-accent:#54a9ff}} @media(prefers-color-scheme:dark){:root{--ga-first-bg:#16161a;--ga-first-text:#f2f3f5;--ga-first-track:#34363c;--ga-first-accent:#54a9ff}}
*{box-sizing:border-box}html,body,#loading-root{height:100%;margin:0}.ga-first-frame{height:100%;display:grid;place-items:center;background:var(--ga-first-bg)}.ga-first-spinner{width:28px;height:28px;border:3px solid var(--ga-first-track);border-top-color:var(--ga-first-accent);border-radius:50%;animation:ga-first-spin 1s linear infinite}@keyframes ga-first-spin{to{transform:rotate(360deg)}} *{box-sizing:border-box}html,body,#loading-root{height:100%;margin:0}.ga-first-frame{height:100%;display:grid;place-items:center;background:var(--ga-first-bg)}.ga-first-spinner{width:28px;height:28px;border:3px solid var(--ga-first-track);border-top-color:var(--ga-first-accent);border-radius:50%;animation:ga-first-spin 1s linear infinite}@keyframes ga-first-spin{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){.ga-first-spinner{animation-duration:1.8s}} @media(prefers-reduced-motion:reduce){.ga-first-spinner{animation-duration:1.8s}}
</style> </style>
<script> <script>
window.__GA_LEGACY_PROGRESS__ = window.__GA_LEGACY_PROGRESS__ || []; window.__GA_LEGACY_PROGRESS__ = window.__GA_LEGACY_PROGRESS__ || [];
window.gaProgress = function (pct, key) { window.gaProgress = function (pct, key) {
window.__GA_LEGACY_PROGRESS__.push({ pct: pct, key: key }); window.__GA_LEGACY_PROGRESS__.push({ pct: pct, key: key });
}; };
</script> </script>
<script type="module" crossorigin src="/assets/loading-VXGdS4iv.js"></script> <script type="module" crossorigin src="/assets/loading-VXGdS4iv.js"></script>
<link rel="modulepreload" crossorigin href="/assets/tauri-compat-tfiFK9EG.js"> <link rel="modulepreload" crossorigin href="/assets/tauri-compat-tfiFK9EG.js">
<link rel="modulepreload" crossorigin href="/assets/index-D_sWIqse.js"> <link rel="modulepreload" crossorigin href="/assets/index-D_sWIqse.js">
@@ -25,12 +25,12 @@ window.gaProgress = function (pct, key) {
<link rel="stylesheet" crossorigin href="/assets/index-DkG9Cu-r.css"> <link rel="stylesheet" crossorigin href="/assets/index-DkG9Cu-r.css">
<link rel="stylesheet" crossorigin href="/assets/WindowsTitlebar-U0YG9JNA.css"> <link rel="stylesheet" crossorigin href="/assets/WindowsTitlebar-U0YG9JNA.css">
<link rel="stylesheet" crossorigin href="/assets/loading-6Qy4iUUr.css"> <link rel="stylesheet" crossorigin href="/assets/loading-6Qy4iUUr.css">
</head> </head>
<body> <body>
<div id="loading-root"> <div id="loading-root">
<div class="ga-first-frame" aria-label="GenericAgent is starting"> <div class="ga-first-frame" aria-label="GenericAgent is starting">
<div class="ga-first-spinner" aria-hidden="true"></div> <div class="ga-first-spinner" aria-hidden="true"></div>
</div> </div>
</div> </div>
</body> </body>
</html> </html>
+42 -42
View File
@@ -1,40 +1,40 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="zh-CN"> <html lang="zh-CN">
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<title>GenericAgent — Fix startup</title> <title>GenericAgent — Fix startup</title>
<style> <style>
:root{color-scheme:light dark;font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text","Segoe UI","Microsoft YaHei UI",sans-serif;--ga-setup-first-bg:#fff;--ga-setup-first-track:#e8e8e8;--ga-setup-first-accent:#0064fa;background:var(--ga-setup-first-bg)} :root{color-scheme:light dark;font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text","Segoe UI","Microsoft YaHei UI",sans-serif;--ga-setup-first-bg:#fff;--ga-setup-first-track:#e8e8e8;--ga-setup-first-accent:#0064fa;background:var(--ga-setup-first-bg)}
@media(prefers-color-scheme:dark){:root{--ga-setup-first-bg:#16161a;--ga-setup-first-track:#34363c;--ga-setup-first-accent:#54a9ff}} @media(prefers-color-scheme:dark){:root{--ga-setup-first-bg:#16161a;--ga-setup-first-track:#34363c;--ga-setup-first-accent:#54a9ff}}
*{box-sizing:border-box}html,body,#setup-root{height:100%;margin:0}.ga-setup-first-frame{height:100%;display:grid;place-items:center;background:var(--ga-setup-first-bg)}.ga-setup-first-spinner{width:28px;height:28px;border:3px solid var(--ga-setup-first-track);border-top-color:var(--ga-setup-first-accent);border-radius:50%;animation:ga-setup-first-spin 1s linear infinite}@keyframes ga-setup-first-spin{to{transform:rotate(360deg)}} *{box-sizing:border-box}html,body,#setup-root{height:100%;margin:0}.ga-setup-first-frame{height:100%;display:grid;place-items:center;background:var(--ga-setup-first-bg)}.ga-setup-first-spinner{width:28px;height:28px;border:3px solid var(--ga-setup-first-track);border-top-color:var(--ga-setup-first-accent);border-radius:50%;animation:ga-setup-first-spin 1s linear infinite}@keyframes ga-setup-first-spin{to{transform:rotate(360deg)}}
</style> </style>
<script> <script>
(function () { (function () {
var ready = false; var ready = false;
var timer = 0; var timer = 0;
function fallback(reason) { function fallback(reason) {
if (ready || window.__GA_SETUP_FALLBACK_STARTED__) return; if (ready || window.__GA_SETUP_FALLBACK_STARTED__) return;
window.__GA_SETUP_FALLBACK_STARTED__ = true; window.__GA_SETUP_FALLBACK_STARTED__ = true;
try { sessionStorage.setItem('ga-setup-fallback-reason', String(reason || 'setup_not_ready').slice(0, 120)); } catch (_) {} try { sessionStorage.setItem('ga-setup-fallback-reason', String(reason || 'setup_not_ready').slice(0, 120)); } catch (_) {}
location.replace('fallback.html'); location.replace('fallback.html');
} }
window.__GA_SETUP_MARK_READY__ = function () { window.__GA_SETUP_MARK_READY__ = function () {
ready = true; ready = true;
window.__GA_SETUP_READY__ = true; window.__GA_SETUP_READY__ = true;
clearTimeout(timer); clearTimeout(timer);
window.removeEventListener('error', onError); window.removeEventListener('error', onError);
window.removeEventListener('unhandledrejection', onRejection); window.removeEventListener('unhandledrejection', onRejection);
}; };
function onError(event) { fallback(event && event.message ? event.message : 'setup_script_error'); } function onError(event) { fallback(event && event.message ? event.message : 'setup_script_error'); }
function onRejection() { fallback('setup_unhandled_rejection'); } function onRejection() { fallback('setup_unhandled_rejection'); }
window.addEventListener('error', onError); window.addEventListener('error', onError);
window.addEventListener('unhandledrejection', onRejection); window.addEventListener('unhandledrejection', onRejection);
timer = window.setTimeout(function () { fallback('setup_watchdog_timeout'); }, 8000); timer = window.setTimeout(function () { fallback('setup_watchdog_timeout'); }, 8000);
window.__GA_SETUP_FALLBACK__ = fallback; window.__GA_SETUP_FALLBACK__ = fallback;
}()); }());
</script> </script>
<script type="module" crossorigin src="/assets/setup-BtYdaXRD.js"></script> <script type="module" crossorigin src="/assets/setup-B0HJZv-E.js"></script>
<link rel="modulepreload" crossorigin href="/assets/tauri-compat-tfiFK9EG.js"> <link rel="modulepreload" crossorigin href="/assets/tauri-compat-tfiFK9EG.js">
<link rel="modulepreload" crossorigin href="/assets/index-Bpi3BHKj.js"> <link rel="modulepreload" crossorigin href="/assets/index-Bpi3BHKj.js">
<link rel="modulepreload" crossorigin href="/assets/index-DpGuh58E.js"> <link rel="modulepreload" crossorigin href="/assets/index-DpGuh58E.js">
@@ -43,12 +43,12 @@
<link rel="stylesheet" crossorigin href="/assets/index-D0pGtk0y.css"> <link rel="stylesheet" crossorigin href="/assets/index-D0pGtk0y.css">
<link rel="stylesheet" crossorigin href="/assets/index-ClU1uQYs.css"> <link rel="stylesheet" crossorigin href="/assets/index-ClU1uQYs.css">
<link rel="stylesheet" crossorigin href="/assets/setup-D74O8rBf.css"> <link rel="stylesheet" crossorigin href="/assets/setup-D74O8rBf.css">
</head> </head>
<body> <body>
<div id="setup-root"> <div id="setup-root">
<div class="ga-setup-first-frame" aria-label="Loading startup recovery"> <div class="ga-setup-first-frame" aria-label="Loading startup recovery">
<div class="ga-setup-first-spinner" aria-hidden="true"></div> <div class="ga-setup-first-spinner" aria-hidden="true"></div>
</div> </div>
</div> </div>
</body> </body>
</html> </html>
@@ -8,7 +8,7 @@ const desktopDir = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '.
const repoRoot = path.resolve(desktopDir, '..', '..'); const repoRoot = path.resolve(desktopDir, '..', '..');
const distDir = path.join(desktopDir, 'dist'); const distDir = path.join(desktopDir, 'dist');
const expectedVersion = '0.2.0'; const expectedVersion = '0.2.0';
const expectedSourceCommit = '21f12f6dfe57ada8572bb21fe6604caac230b1cf'; const expectedSourceCommit = '9fe5d69b85cfad8778ace84b6f69bc75f9e0d392';
const expectedNoticeSha256 = '2acf865e87e59090121369aac0575467067fdd7999923a70d785a46ceae3330f'; const expectedNoticeSha256 = '2acf865e87e59090121369aac0575467067fdd7999923a70d785a46ceae3330f';
const noticeAttributeRules = [ const noticeAttributeRules = [
'frontends/desktop/public/THIRD_PARTY_NOTICES.txt text eol=lf', 'frontends/desktop/public/THIRD_PARTY_NOTICES.txt text eol=lf',
+16 -1
View File
@@ -724,7 +724,22 @@ class AgentManager:
def update_model_profile(self, profile_id: int, data: dict) -> dict: def update_model_profile(self, profile_id: int, data: dict) -> dict:
var, existing = self._profile_at(profile_id) var, existing = self._profile_at(profile_id)
text = self._mykey_file().read_text(encoding="utf-8") text = self._mykey_file().read_text(encoding="utf-8")
profiles = self._save_mykey_text(self._patch_var_block(text, var, self._build_cfg(data, existing, require_key=False)))
# Sync mixin llm_nos when name changes to avoid orphan references
old_name = str(existing.get("name") or existing.get("model") or "").strip()
new_cfg = self._build_cfg(data, existing, require_key=False)
new_name = str(new_cfg.get("name") or new_cfg.get("model") or "").strip()
if old_name != new_name:
keys, mk = self._mykey_vars()
mvar, mcfg = self._mixin_entry(keys, mk)
if mcfg and mvar is not None and old_name in [str(m) for m in (mcfg.get("llm_nos") or [])]:
# Replace old name with new name in mixin's llm_nos
updated_nos = [new_name if str(m) == old_name else str(m) for m in (mcfg.get("llm_nos") or [])]
mcfg = {**mcfg, "llm_nos": updated_nos}
text = self._patch_var_block(text, mvar, mcfg)
profiles = self._save_mykey_text(self._patch_var_block(text, var, new_cfg))
return {"varName": var, "profileId": profile_id, "profiles": profiles} return {"varName": var, "profileId": profile_id, "profiles": profiles}
def delete_model_profile(self, profile_id: int) -> dict: def delete_model_profile(self, profile_id: int) -> dict: