* fix(desktop): expose explicit backup capabilities * fix(desktop): align titlebar controls with native metrics * release(desktop): prepare portable v0.2.1 * build(desktop): rebuild compiled dist from source 4a67226 Rebuild the compiled-only React Desktop 2.0 renderer from abraxas914/GenericAgent main @4a67226, carrying the v0.2.1 iterations that PR #784 was closed to await: live turn-timer persistence across session switch, Mixin image-to-path fallback, folder drag-drop, per-turn duration, and image-thumbnail repair. - dist/**: regenerated 98 manifest assets + entry HTML - build-provenance.json: sourceCommit -> 4a67226, manifest sha256 recomputed - verify-compiled-dist.mjs: expectedSourceCommit -> 4a67226 - dist/README.md: provenance source commit updated - desktop_bridge.py, test_bridge_origin_security.py: synced to 4a67226 - core (agentmain.py, llmcore*, src/**, public/**) remains zero-diff vs upstream --------- Co-authored-by: abraxas914 <abraxas345589144233@outlook.com>
37 lines
426 KiB
JavaScript
37 lines
426 KiB
JavaScript
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/MarkdownPart-ZJKeOipX.js","assets/tauri-compat-D_GD_wMe.js","assets/tauri-compat-BTcpEvqB.css","assets/markdown-preprocess-Cc2i34eF.js","assets/markdown-preprocess-Cp579UoJ.css","assets/index-9FI8Jlf5.js","assets/index-D0pGtk0y.css","assets/WindowsTitlebar-Byi-SYR_.js","assets/WindowsTitlebar-U0YG9JNA.css","assets/MarkdownPart-Cp90Gu77.css","assets/SummaryPart-zs-In9mf.js","assets/ServicesPage-9DKyWUIu.js","assets/index-BkPDmlaQ.js","assets/index-D9Nakaf3.js","assets/index-DkG9Cu-r.css","assets/index-gTPS8Hpa.css","assets/IconFile-C8B3WX2U.js","assets/ServicesPage-Cbm5nbW7.css","assets/TokenPage-8X0HZ3hU.js","assets/Animation-DbFrgT1j.js","assets/index-C-iCGtYr.js","assets/index-ClU1uQYs.css","assets/TokenPage-DwLDOw_j.css","assets/CollabPage-DD4zkzQv.js","assets/CollabPage-CG38jm3S.css"])))=>i.map(i=>d[i]);
|
||
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 bt=(n,e,t)=>Li(n,typeof e!="symbol"?e+"":e,t);import{g as We,r as Ii,a as Ti,c as be,b as a,d as Ds,e as As,B as Re,_ as Be,f as ve,h as A,i as De,j as Ri,E as Ni,R as g,k as me,l as I,m as Ge,n as zs,P as h,w as Fs,o as So,p as Je,q as nn,s as an,t as To,u as $i,v as Di,x as Ai,y as zi,z as Fi,A as Bi,C as Ui,D as Vi,F as Ki,G as Wi,H as Bs,I as Hi,T as Ro,J as on,K as Zi,L as qi,M as Gi,N as Et,O as Us,Q as Vs,S as Ks,U as Ws,V as Qi,W as Hs,X as Zs,Y as ko,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 Zo,ab as Ae,ac as ca,ad as da,ae as Yt,af as ua,ag as pa,ah as jo,ai as ye,aj as i,ak as qs,al as ha,am as ma,an as fa,ao as qo,ap as ct,aq as ga,ar as ya,as as ba,at as va}from"./tauri-compat-D_GD_wMe.js";import{I as ln,a as Gs,b as Qs,c as Ys,B as de}from"./index-9FI8Jlf5.js";import{W as xa}from"./WindowsTitlebar-Byi-SYR_.js";const wa="modulepreload",Ca=function(n){return"/"+n},Go={},Zt=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 Go)return;Go[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((y,b)=>{f.addEventListener("load",y),f.addEventListener("error",()=>b(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 Qo(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 Yo(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=Qo(n.VITE_BRIDGE_BASE,"http://127.0.0.1:14168"),t=Qo(n.VITE_CONDUCTOR_BASE,"http://127.0.0.1:8900");return{bridgeBase:e,conductorBase:t,wsUrl:Yo(e),conductorWsUrl:Yo(t)}}const cn=Sa({VITE_BRIDGE_BASE:void 0,VITE_CONDUCTOR_BASE:void 0}),ne=cn.bridgeBase,ka=cn.conductorBase,ja=cn.wsUrl,Ea=cn.conductorWsUrl,Oa=1e3,Pa=3e4;let je=null,Eo=0,Sn=null;const St=new Map;let Oo="offline";const Po=new Set;let Xo=!1;const _a=new Set;function kn(n){n!==Oo&&(Oo=n,n==="ready"&&(Xo||(Xo=!0,_a.forEach(e=>e()))),Po.forEach(e=>e(n)))}function Jo(){return Oo}function Xs(n){return Po.add(n),()=>{Po.delete(n)}}function Js(){if(!(je&&(je.readyState===WebSocket.OPEN||je.readyState===WebSocket.CONNECTING))){kn("connecting");try{je=new WebSocket(ja)}catch{er();return}je.onopen=()=>{Eo=0,kn("ready")},je.onmessage=n=>{try{const e=JSON.parse(n.data),t=e.type;if(!t)return;const o=St.get(t);o&&o.forEach(r=>r(e))}catch{}},je.onclose=()=>{je=null,kn("connecting"),er()},je.onerror=()=>{je==null||je.close()}}}function er(){if(Sn)return;const n=Math.min(Oa*2**Eo,Pa);Eo++,Sn=setTimeout(()=>{Sn=null,Js()},n)}function Ve(n,e){return St.has(n)||St.set(n,new Set),St.get(n).add(e),Js(),()=>{var t;(t=St.get(n))==null||t.delete(e)}}let tr=[];const Ma=new Set;let nr=!1;function La(){for(const n of Ma)n()}function jn(n){tr=[...tr.slice(-39),n],La()}function Ia(){nr||(nr=!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}`;jn(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";jn(`${t}: ${o}`)}),Ve("token.changed",n=>{const e=n;!e.session_id||!e.total_output||jn(`Token update: +${e.total_output} output`)}))}Ia();const ei=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\//,$a=/%(?:2e|2f|5c)/i,ti=/[\u0000-\u001f\u007f]/;function No(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 Da(n){if(!Na.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}}function Aa(n){const e=n.trim();if(!e||ti.test(e))return null;if(Ra.test(e))return e;if(/^blob:/i.test(e))try{return new URL(e).protocol==="blob:"?e:null}catch{return null}if(/^asset:/i.test(e))try{const t=new URL(e);return t.protocol==="asset:"&&(t.hostname===""||t.hostname==="localhost")&&!t.username&&!t.password?e:null}catch{return null}if(/^https?:\/\/asset\.localhost(?:\/|$)/i.test(e))try{const t=new URL(e);return t.hostname==="asset.localhost"&&ei.has(t.protocol)?t.href:null}catch{return null}return Da(e)}const Om=(n,e,t)=>{if(e==="href")return No(n)??void 0;if(e==="src"&&t.tagName==="img")return Aa(n)??void 0};function za(n){return!Ta.has(n.command)||!("url"in n)?!1:No(n.url)!==null}const Pm={strict:"ignore",trust:za};function Fa(n,e){const t=n.target;if(!(t instanceof Element))return;const o=t.closest("[href]");if(!o)return;const r=No(o.getAttribute("href")??"");if(!r){n.preventDefault();return}const s=new URL(r);if(!(!e||s.origin===location.origin)){n.preventDefault();try{Promise.resolve(e(r)).catch(l=>{console.error("[external-link] opener failed:",l)})}catch(l){console.error("[external-link] opener failed:",l)}}}var Ba=Ii();const _o=We(Ba);var Ua=Ti();const _m=We(Ua);function Va(n){return a.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},n),a.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.7 2.8a1 1 0 0 1 0 1.4l-3 3a1 1 0 0 1-1.4 0L1.8 5.7a1 1 0 0 1 1.4-1.4l.8.79 2.3-2.3a1 1 0 0 1 1.4 0Z",fill:"currentColor"}),a.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.7 9.8a1 1 0 0 1 0 1.4l-3 3a1 1 0 0 1-1.4 0l-1.5-1.5a1 1 0 1 1 1.4-1.4l.8.79 2.3-2.3a1 1 0 0 1 1.4 0Z",fill:"currentColor"}),a.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.7 16.8a1 1 0 0 1 0 1.4l-3 3a1 1 0 0 1-1.4 0l-1.5-1.5a1 1 0 1 1 1.4-1.4l.8.79 2.3-2.3a1 1 0 0 1 1.4 0Z",fill:"currentColor"}),a.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.5 12a1 1 0 0 1 1-1h11a1 1 0 1 1 0 2h-11a1 1 0 0 1-1-1Z",fill:"currentColor"}),a.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.5 19a1 1 0 0 1 1-1h11a1 1 0 1 1 0 2h-11a1 1 0 0 1-1-1Z",fill:"currentColor"}),a.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.5 5a1 1 0 0 1 1-1h11a1 1 0 1 1 0 2h-11a1 1 0 0 1-1-1Z",fill:"currentColor"}))}const Ka=be(Va,"checklist_stroked");function Wa(n){return a.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},n),a.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 23a11 11 0 1 0 0-22 11 11 0 0 0 0 22Zm5.04-6.14a1.5 1.5 0 0 1-2.13.04l-2.87-2.78L9.26 17A1.5 1.5 0 0 1 7.1 14.9l2.78-2.87L7 9.26A1.5 1.5 0 1 1 9.1 7.1l2.87 2.78L14.74 7A1.5 1.5 0 0 1 16.9 9.1l-2.78 2.87L17 14.74c.6.58.61 1.53.04 2.12Z",fill:"currentColor"}))}const Ha=be(Wa,"clear");function Za(n){return a.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},n),a.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M21 2a1 1 0 0 1 1 1v6a1 1 0 1 1-2 0V5.41l-9.3 9.3a1 1 0 0 1-1.4-1.42L18.58 4H15a1 1 0 1 1 0-2h6ZM2 5a1 1 0 0 1 1-1h8a1 1 0 1 1 0 2H4v14h14v-7a1 1 0 1 1 2 0v8a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V5Z",fill:"currentColor"}))}const qa=be(Za,"external_open_stroked");function Ga(n){return a.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},n),a.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M21.7 3.7a1 1 0 0 0-1.4-1.4L17.3 5.26A11.59 11.59 0 0 0 12 4C5 4 1 10 1 12c0 1.18 1.38 3.73 3.94 5.64L2.3 20.3a1 1 0 1 0 1.42 1.42l18-18ZM7.84 14.77l1.46-1.47a3 3 0 0 1 4-4l1.47-1.46a5 5 0 0 0-6.93 6.93Z",fill:"currentColor"}),a.createElement("path",{d:"M12 20c-1.22 0-2.35-.18-3.38-.5l2.57-2.57a5 5 0 0 0 5.75-5.75l3.56-3.56C22.13 9.27 23 11.07 23 12c0 2-4 8-11 8Z",fill:"currentColor"}))}const Qa=be(Ga,"eye_closed_solid");function Ya(n){return a.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},n),a.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 4C5 4 1 10 1 12s4 8 11 8 11-6 11-8-4-8-11-8Zm5 8a5 5 0 1 1-10 0 5 5 0 0 1 10 0Zm-5 3a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z",fill:"currentColor"}))}const Xa=be(Ya,"eye_opened");function Ja(n){return a.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},n),a.createElement("path",{d:"M8 1c2.5 0 3.19.3 4.15.68L13 2c1.5.5 3 1 5 1 .89 0 1.78-.2 2.5-.42.7-.22 1.5.3 1.5 1.04v10.76c0 .38-.21.73-.56.87l-.3.12c-.78.28-1.96.63-3.14.63-2 0-3.5-.5-5-1-.31-.1-.58-.2-.84-.3-.98-.39-1.79-.7-4.16-.7-1.27 0-3.27.3-4 .5V21a1 1 0 0 1-.84.99h-.04a1 1 0 0 1-.24 0h-.04A1 1 0 0 1 2 21V3.58c0-.36.2-.69.51-.85C3.57 2.18 6.08 1 8 1Zm0 2c-.61 0-1.46.2-2.38.54-.6.22-1.17.47-1.62.68v8.37l.46-.13C5.36 12.21 6.54 12 8 12c1.27 0 2.2.08 3 .24.8.17 1.39.4 1.88.59l.75.27c1.5.5 2.73.9 4.37.9.68 0 1.4-.17 2-.36V4.78c-.61.13-1.3.22-2 .22-2.36 0-4.13-.6-5.63-1.1l-.95-.35c-.5-.2-.76-.3-1.17-.39a8.82 8.82 0 0 0-1.46-.15L8 3Z",fill:"currentColor"}))}const el=be(Ja,"flag_stroked");function tl(n){return a.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},n),a.createElement("path",{d:"M9 7a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z",fill:"currentColor"}),a.createElement("path",{d:"M9 14a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z",fill:"currentColor"}),a.createElement("path",{d:"M11 19a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z",fill:"currentColor"}),a.createElement("path",{d:"M15 7a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z",fill:"currentColor"}),a.createElement("path",{d:"M17 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z",fill:"currentColor"}),a.createElement("path",{d:"M15 21a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z",fill:"currentColor"}))}const nl=be(tl,"handle");function ol(n){return a.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},n),a.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 23a11 11 0 1 0 0-22 11 11 0 0 0 0 22Zm-.17-8.4c-.86 0-1.3-.53-1.3-1.23 0-1.05.53-1.72 1.74-2.64l.06-.05c.83-.62 1.4-1.06 1.4-1.85 0-.9-.83-1.4-1.76-1.4-.76 0-1.34.28-1.8.87-.33.34-.6.53-1.05.53C8.38 8.83 8 8.3 8 7.7c0-.6.34-1.22.88-1.68A5.15 5.15 0 0 1 12.28 5c2.71 0 4.62 1.34 4.62 3.64 0 1.68-1 2.5-2.2 3.31-.8.59-1.17.93-1.48 1.62-.33.6-.58 1.04-1.4 1.04Zm-.02 4.17c-.94 0-1.71-.6-1.71-1.54 0-.94.77-1.55 1.7-1.55.95 0 1.7.6 1.7 1.55 0 .93-.75 1.54-1.7 1.54Z",fill:"currentColor"}))}const rl=be(ol,"help_circle");function sl(n){return a.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},n),a.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.22 4.22a10.97 10.97 0 0 1 15.56 0l-.7.7.7-.7a10.97 10.97 0 0 1 0 15.56 10.97 10.97 0 0 1-15.56 0l.7-.7-.7.7a10.97 10.97 0 0 1 0-15.56ZM12 3a8.97 8.97 0 0 0-9 9 8.97 8.97 0 0 0 9 9 8.97 8.97 0 0 0 9-9 8.97 8.97 0 0 0-9-9Z",fill:"currentColor"}),a.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 9.31a4 4 0 1 1 5 3.88v1.12a1 1 0 1 1-2 0v-2a1 1 0 0 1 1-1 2 2 0 1 0-2-2 1 1 0 0 1-2 0Z",fill:"currentColor"}),a.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 18.81a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5Z",fill:"currentColor"}))}const il=be(sl,"help_circle_stroked");function al(n){return a.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},n),a.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.1 10.58c.06 0 .1.05.1.12l-1.1 6.36 7.02-7.11h-3.07a.1.1 0 0 1-.1-.15l3.5-6.8H9.71l-3.5 7.58h3.88ZM8.3 1.29A.5.5 0 0 1 8.76 1H18.9c.37 0 .61.4.44.73l-3.18 6.22h3.55a.5.5 0 0 1 .36.85L7.18 21.87a.5.5 0 0 1-.85-.44l1.51-8.85H3.88a.5.5 0 0 1-.46-.71L8.3 1.29Z",fill:"currentColor"}))}const ll=be(al,"lightning_stroked");function cl(n){return a.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},n),a.createElement("circle",{cx:12,cy:12,r:5,fill:"currentColor"}))}const dl=be(cl,"radio");function ul(n){return a.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},n),a.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.5 12a7.5 7.5 0 0 1 13.8-4.07l-2-.4a1.5 1.5 0 0 0-.6 2.94l5 1c.76.15 1.51-.3 1.74-1.04l1.5-5a1.5 1.5 0 1 0-2.88-.86l-.43 1.45A10.49 10.49 0 0 0 1.5 12a10.5 10.5 0 0 0 20.4 3.5 1.5 1.5 0 1 0-2.83-1A7.5 7.5 0 0 1 4.5 12Z",fill:"currentColor"}))}const pl=be(ul,"refresh");function hl(n){return a.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},n),a.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16 10a6 6 0 1 1-12 0 6 6 0 0 1 12 0Zm-1.1 6.32a8 8 0 1 1 1.41-1.41l5.4 5.38a1 1 0 0 1-1.42 1.42l-5.38-5.39Z",fill:"currentColor"}))}const ni=be(hl,"search_stroked");function ml(n){return a.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},n),a.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14 5.5a3.5 3.5 0 1 1 1 2.45l-5.13 3.11a3.5 3.5 0 0 1 .03 1.79l5.22 3.08A3.49 3.49 0 0 1 21 18.5a3.5 3.5 0 1 1-6.9-.85l-5.22-3.08A3.49 3.49 0 0 1 3 12a3.5 3.5 0 0 1 5.8-2.63l5.27-3.19A3.51 3.51 0 0 1 14 5.5ZM17.5 4a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3Zm-11 6.5a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3Zm9.5 8a1.5 1.5 0 1 1 3 0 1.5 1.5 0 0 1-3 0Z",fill:"currentColor"}))}const fl=be(ml,"share_stroked");function gl(n){return a.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},n),a.createElement("path",{d:"m3 4.13 9-1.63 9 1.63v5.39c0 5.66-3.62 10.69-9 12.48-5.37-1.8-9-6.82-9-12.49V4.13Z",stroke:"currentColor",strokeWidth:2,strokeLinejoin:"round"}),a.createElement("path",{d:"M11.97 7.47v8",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),a.createElement("path",{d:"M7.97 11.47h8",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}))}const yl=be(gl,"shield_stroked");var En,or;function oi(){if(or)return En;or=1;var n=Ds(),e=As(),t="[object Number]";function o(r){return typeof r=="number"||e(r)&&n(r)==t}return En=o,En}var bl=oi();const Mo=We(bl),ri={PREFIX:`${Re}-input`},qt={SIZE:["small","large","default"],DEFAULT_SIZE:"default",STATUS:["default","error","warning","success"],CLEARBTN_CLICKED_EVENT_FLAG:"__fromClearBtn",MODE:["password"]},vl={};function xl(n){const{value:e,maxLength:t,getValueLength:o}=n;if(Be(o)){let r=0,s=e.length;for(;r<s;){const l=r+Math.floor((s-r)/2),c=e.slice(0,l+1);o(c)>t?s=l:r=l+1}return e.slice(0,r)}else return e.slice(0,t)}class $o extends ve{static get inputDefaultAdapter(){return{notifyChange:A,setValue:A}}constructor(e){super(Object.assign(Object.assign({},$o.inputDefaultAdapter),e)),this.compositionEnter=!1,this.getNextValue=t=>{const{maxLength:o,minLength:r,getValueLength:s}=this._adapter.getProps();return Be(s)?o?this.handleVisibleMaxLength(t):(r&&this.handleVisibleMinLength(t),t):t},this.changeInput=(t,o)=>{this._isControlledComponent()?this._adapter.notifyChange(t,o):(this._adapter.setValue(t),this._adapter.notifyChange(t,o))},this.handleCompositionStart=t=>{this.compositionEnter=!0,this._adapter.notifyCompositionStart(t)},this.handleCompositionEnd=t=>{const{composition:o}=this._adapter.getProps(),r=t.target.value;if(this.compositionEnter=!1,this._adapter.notifyCompositionEnd(t),o){const u=this.getNextValue(r);this.changeInput(u,t);return}const{getValueLength:s,maxLength:l,minLength:c}=this.getProps();if(Be(s)){if(l){const u=this.handleVisibleMaxLength(r);u!==r&&this.changeInput(u,t)}c&&this.handleVisibleMinLength(r)}},this.handleCompositionUpdate=t=>{this._adapter.notifyCompositionUpdate(t)}}destroy(){this._timer&&(clearTimeout(this._timer),this._timer=null)}setDisable(){}setValue(e){this._adapter.setValue(e)}handleChange(e,t){const{composition:o}=this._adapter.getProps();let r=e;if(o&&this.compositionEnter){this._adapter.setValue(r);return}this.compositionEnter||(r=this.getNextValue(r)),this.changeInput(r,t)}handleVisibleMinLength(e){const{minLength:t,getValueLength:o}=this._adapter.getProps(),{minLength:r}=this._adapter.getStates();if(Mo(t)&&t>=0&&Be(o)&&De(e)){const s=o(e);if(s<t){const l=e.length+(t-s);l!==r&&this._adapter.setMinLength(l)}else r!==t&&this._adapter.setMinLength(t)}}handleVisibleMaxLength(e){const{maxLength:t,getValueLength:o}=this._adapter.getProps();return Mo(t)&&t>=0&&Be(o)&&De(e)&&o(e)>t?(console.warn("[Semi Input] The input character is truncated because the input length exceeds the maximum length limit"),this.handleTruncateValue(e,t)):e}handleTruncateValue(e,t){const{getValueLength:o}=this._adapter.getProps();return xl({value:e,maxLength:t,getValueLength:o})}handleClear(e){let t=e;const o="";this._isControlledComponent("value")?this._adapter.setState({isFocus:!1}):this._adapter.setState({value:"",isFocus:!1}),(!t||typeof t!="object")&&(t={}),Ri(t,qt.CLEARBTN_CLICKED_EVENT_FLAG,!0),this._adapter.notifyChange(o,t),this._adapter.notifyClear(t),t&&this.stopPropagation(t)}handleClick(e){const{disabled:t}=this._adapter.getProps(),{isFocus:o}=this._adapter.getStates();t||o||this._adapter.isEventTarget(e)&&(this._adapter.focusInput(),this._adapter.toggleFocusing(!0))}handleModeChange(e){e==="password"?this._adapter.setEyeClosed(!0):this._adapter.setEyeClosed(!1)}handleClickEye(e){const t=this._adapter.getState("eyeClosed");this._adapter.focusInput(),this._adapter.toggleFocusing(!0),this._adapter.setEyeClosed(!t)}handleInputType(e){const t=this._adapter.getProp("mode"),o=this._adapter.getState("eyeClosed");return t==="password"?o?"password":"text":e}handleMouseDown(e){e.preventDefault()}handleMouseUp(e){e.preventDefault()}handleBlur(e){const{value:t}=this.getStates();this._adapter.toggleFocusing(!1),this._adapter.notifyBlur(t,e)}handleFocus(e){const{value:t}=this.getStates();this._adapter.toggleFocusing(!0),this._adapter.notifyFocus(t,e)}handleInput(e){this._adapter.notifyInput(e)}handleKeyDown(e){this._adapter.notifyKeyDown(e)}handleKeyUp(e){this._adapter.notifyKeyUp(e)}handleKeyPress(e){this._adapter.notifyKeyPress(e),e.key===Ni&&this._adapter.notifyEnterPress(e)}isAllowClear(){const{value:e,isFocus:t,isHovering:o}=this._adapter.getStates(),{showClear:r,disabled:s,showClearIgnoreDisabled:l}=this._adapter.getProps();return e&&r&&(!s||l)&&(t||o)}handleClickPrefixOrSuffix(e){const{disabled:t}=this._adapter.getProps(),{isFocus:o}=this._adapter.getStates();!t&&!o&&(this._adapter.focusInput(),this._adapter.toggleFocusing(!0))}handlePreventMouseDown(e){e&&Be(e.preventDefault)&&e.preventDefault()}handleModeEnterPress(e){["Enter"," "].includes(e==null?void 0:e.key)&&(this.handlePreventMouseDown(e),this.handleClickEye(e))}}var wl=function(n,e){var t={};for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&e.indexOf(o)<0&&(t[o]=n[o]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(n);r<o.length;r++)e.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(n,o[r])&&(t[o[r]]=n[o[r]]);return t};const K=ri.PREFIX,Cl=qt.SIZE,Sl=qt.STATUS,kl=qt.MODE;class Do extends me{constructor(e){super(e),this.handleClear=o=>{this.foundation.handleClear(o)},this.handleClick=o=>{this.foundation.handleClick(o)},this.handleMouseOver=o=>{this.setState({isHovering:!0})},this.handleMouseLeave=o=>{this.setState({isHovering:!1})},this.handleModeChange=o=>{this.foundation.handleModeChange(o)},this.handleClickEye=o=>{this.foundation.handleClickEye(o)},this.handleMouseDown=o=>{this.foundation.handleMouseDown(o)},this.handleMouseUp=o=>{this.foundation.handleMouseUp(o)},this.handleModeEnterPress=o=>{this.foundation.handleModeEnterPress(o)},this.handleClickPrefixOrSuffix=o=>{this.foundation.handleClickPrefixOrSuffix(o)},this.handlePreventMouseDown=o=>{this.foundation.handlePreventMouseDown(o)};const t="value"in e?e.value:e.defaultValue;this.state={value:t,cachedValue:e.value,disabled:!1,props:{},isFocus:!1,isHovering:!1,eyeClosed:e.mode==="password",minLength:e.minLength},this.inputRef=g.createRef(),this.prefixRef=g.createRef(),this.suffixRef=g.createRef(),this.foundation=new $o(this.adapter)}get adapter(){return Object.assign(Object.assign({},super.adapter),{setValue:e=>this.setState({value:e}),setEyeClosed:e=>this.setState({eyeClosed:e}),toggleFocusing:e=>{this.setState({isFocus:e})},focusInput:()=>{const{preventScroll:e}=this.props,t=this.inputRef&&this.inputRef.current;t&&t.focus({preventScroll:e})},toggleHovering:e=>this.setState({isHovering:e}),getIfFocusing:()=>this.state.isFocus,notifyChange:(e,t)=>this.props.onChange(e,t),notifyBlur:(e,t)=>this.props.onBlur(t),notifyFocus:(e,t)=>this.props.onFocus(t),notifyInput:e=>this.props.onInput(e),notifyKeyPress:e=>this.props.onKeyPress(e),notifyKeyDown:e=>this.props.onKeyDown(e),notifyKeyUp:e=>this.props.onKeyUp(e),notifyEnterPress:e=>this.props.onEnterPress(e),notifyClear:e=>this.props.onClear(e),notifyCompositionStart:e=>this.props.onCompositionStart(e),notifyCompositionEnd:e=>this.props.onCompositionEnd(e),notifyCompositionUpdate:e=>this.props.onCompositionUpdate(e),setMinLength:e=>this.setState({minLength:e}),isEventTarget:e=>e&&e.target===e.currentTarget})}static getDerivedStateFromProps(e,t){const o={};return e.value!==t.cachedValue&&(o.value=e.value,o.cachedValue=e.value),o}componentDidUpdate(e){const{mode:t}=this.props;e.mode!==t&&this.handleModeChange(t)}componentDidMount(){const{disabled:e,autoFocus:t,preventScroll:o}=this.props;!e&&(t||this.props.autofocus)&&this.inputRef.current.focus({preventScroll:o})}renderPrepend(){const{addonBefore:e}=this.props;if(e){const t=I({[`${K}-prepend`]:!0,[`${K}-prepend-text`]:e&&De(e),[`${K}-prepend-icon`]:Ge(e)});return g.createElement("div",{className:t,"x-semi-prop":"addonBefore"},e)}return null}renderAppend(){const{addonAfter:e}=this.props;if(e){const t=I({[`${K}-append`]:!0,[`${K}-append-text`]:e&&De(e),[`${K}-append-icon`]:Ge(e)});return g.createElement("div",{className:t,"x-semi-prop":"addonAfter"},e)}return null}renderClearBtn(){const e=I(`${K}-clearbtn`),{clearIcon:t}=this.props;return this.foundation.isAllowClear()?g.createElement("div",{className:e,onMouseDown:this.handleClear},t||g.createElement(Ha,null)):null}renderModeBtn(){const{eyeClosed:e}=this.state,{mode:t,disabled:o}=this.props,r=I(`${K}-modebtn`),s=e?g.createElement(Qa,null):g.createElement(Xa,null),l=t==="password"&&!o,c=e?"Show password":"Hidden password";return l?g.createElement("div",{role:"button",tabIndex:0,"aria-label":c,className:r,onClick:this.handleClickEye,onMouseDown:this.handleMouseDown,onMouseUp:this.handleMouseUp,onKeyPress:this.handleModeEnterPress},s):null}renderPrefix(){const{prefix:e,insetLabel:t,insetLabelId:o}=this.props,r=e||t;if(!r)return null;const s=I({[`${K}-prefix`]:!0,[`${K}-inset-label`]:t,[`${K}-prefix-text`]:r&&De(r),[`${K}-prefix-icon`]:Ge(r)});return g.createElement("div",{className:s,onMouseDown:this.handlePreventMouseDown,onClick:this.handleClickPrefixOrSuffix,id:o,"x-semi-prop":"prefix,insetLabel"},r)}renderSuffix(e){const{suffix:t,hideSuffix:o}=this.props;if(!t)return null;const r=I({[`${K}-suffix`]:!0,[`${K}-suffix-text`]:t&&De(t),[`${K}-suffix-icon`]:Ge(t),[`${K}-suffix-hidden`]:e&&!!o});return g.createElement("div",{className:r,onMouseDown:this.handlePreventMouseDown,onClick:this.handleClickPrefixOrSuffix,"x-semi-prop":"suffix"},t)}getInputRef(){const{forwardRef:e}=this.props;if(!zs(e)){if(typeof e=="function")return t=>{e(t),this.inputRef={current:t}};if(Object.prototype.toString.call(e)==="[object Object]")return this.inputRef=e,e}return this.inputRef}render(){const e=this.props,{addonAfter:t,addonBefore:o,autoFocus:r,clearIcon:s,className:l,disabled:c,defaultValue:u,placeholder:p,prefix:d,mode:m,insetLabel:f,insetLabelId:y,validateStatus:b,type:x,readonly:C,size:S,suffix:k,style:_,showClear:v,onEnterPress:j,onClear:w,hideSuffix:E,inputStyle:O,forwardRef:D,maxLength:P,getValueLength:N,preventScroll:L,borderless:B,showClearIgnoreDisabled:Q,onlyBorder:z,composition:M}=e,Y=wl(e,["addonAfter","addonBefore","autoFocus","clearIcon","className","disabled","defaultValue","placeholder","prefix","mode","insetLabel","insetLabelId","validateStatus","type","readonly","size","suffix","style","showClear","onEnterPress","onClear","hideSuffix","inputStyle","forwardRef","maxLength","getValueLength","preventScroll","borderless","showClearIgnoreDisabled","onlyBorder","composition"]),{value:fe,isFocus:Se,minLength:T}=this.state,F=this.foundation.isAllowClear(),J=Ge(k),ce=this.getInputRef(),ie=`${K}-wrapper`,ke=I(ie,l,{[`${K}-wrapper__with-prefix`]:d||f,[`${K}-wrapper__with-suffix`]:k,[`${K}-wrapper__with-suffix-hidden`]:F&&!!E,[`${K}-wrapper__with-suffix-icon`]:J,[`${K}-wrapper__with-append`]:o,[`${K}-wrapper__with-prepend`]:t,[`${K}-wrapper__with-append-only`]:o&&!t,[`${K}-wrapper__with-prepend-only`]:!o&&t,[`${ie}-readonly`]:C,[`${ie}-disabled`]:c,[`${ie}-warning`]:b==="warning",[`${ie}-error`]:b==="error",[`${ie}-focus`]:Se,[`${ie}-clearable`]:v,[`${ie}-modebtn`]:m==="password",[`${ie}-hidden`]:x==="hidden",[`${ie}-${S}`]:S,[`${K}-borderless`]:B,[`${K}-only_border`]:z!=null}),ge=I(K,{[`${K}-${S}`]:S,[`${K}-disabled`]:c,[`${K}-sibling-clearbtn`]:this.foundation.isAllowClear(),[`${K}-sibling-modebtn`]:m==="password"}),$=fe??"",V=Object.assign(Object.assign({},Y),{style:O,className:ge,disabled:c,readOnly:C,type:this.foundation.handleInputType(x),placeholder:p,onInput:R=>this.foundation.handleInput(R),onChange:R=>this.foundation.handleChange(R.target.value,R),onFocus:R=>this.foundation.handleFocus(R),onBlur:R=>this.foundation.handleBlur(R),onKeyUp:R=>this.foundation.handleKeyUp(R),onKeyDown:R=>this.foundation.handleKeyDown(R),onKeyPress:R=>this.foundation.handleKeyPress(R),onCompositionStart:this.foundation.handleCompositionStart,onCompositionEnd:this.foundation.handleCompositionEnd,onCompositionUpdate:this.foundation.handleCompositionUpdate,value:$});Be(N)||(V.maxLength=P),T&&(V.minLength=T),b==="error"&&(V["aria-invalid"]="true");let q=Object.assign({},_);return z!==void 0&&(q=Object.assign({borderWidth:z},_)),g.createElement("div",{className:ke,style:q,onMouseEnter:R=>this.handleMouseOver(R),onMouseLeave:R=>this.handleMouseLeave(R),onClick:R=>this.handleClick(R)},this.renderPrepend(),this.renderPrefix(),g.createElement("input",Object.assign({},V,{ref:ce})),this.renderClearBtn(),this.renderSuffix(F),this.renderModeBtn(),this.renderAppend())}}Do.propTypes={"aria-label":h.string,"aria-labelledby":h.string,"aria-invalid":h.bool,"aria-errormessage":h.string,"aria-describedby":h.string,"aria-required":h.bool,addonBefore:h.node,addonAfter:h.node,clearIcon:h.node,prefix:h.node,suffix:h.node,mode:h.oneOf(kl),value:h.any,defaultValue:h.any,disabled:h.bool,readonly:h.bool,autoFocus:h.bool,type:h.string,showClear:h.bool,hideSuffix:h.bool,placeholder:h.any,size:h.oneOf(Cl),className:h.string,style:h.object,validateStatus:h.oneOf(Sl),onClear:h.func,onChange:h.func,onBlur:h.func,onFocus:h.func,onInput:h.func,onKeyDown:h.func,onKeyUp:h.func,onKeyPress:h.func,onEnterPress:h.func,onCompositionStart:h.func,onCompositionEnd:h.func,onCompositionUpdate:h.func,insetLabel:h.node,insetLabelId:h.string,inputStyle:h.object,getValueLength:h.func,preventScroll:h.bool,borderless:h.bool,composition:h.bool};Do.defaultProps={addonBefore:"",addonAfter:"",prefix:"",suffix:"",readonly:!1,type:"text",showClear:!1,hideSuffix:!1,placeholder:"",size:"default",className:"",onClear:A,onChange:A,onBlur:A,onFocus:A,onInput:A,onKeyDown:A,onKeyUp:A,onKeyPress:A,onEnterPress:A,onCompositionStart:A,onCompositionEnd:A,onCompositionUpdate:A,validateStatus:"default",borderless:!1,composition:!1};const dt=g.forwardRef((n,e)=>g.createElement(Do,Object.assign({},n,{forwardRef:e}))),jl={PREFIX:`${Re}-avatar`},dn={SHAPE:["circle","square"],SIZE:["extra-extra-small","extra-small","small","default","medium","large","extra-large"],COLOR:["grey","red","pink","purple","violet","indigo","blue","light-blue","cyan","teal","green","light-green","lime","yellow","amber","orange","white"]};class El extends ve{constructor(e){super(Object.assign({},e)),this.handleFocusVisible=t=>{const{target:o}=t;try{o.matches(":focus-visible")&&this._adapter.setFocusVisible(!0)}catch{Fs(!0,"Warning: [Semi Avatar] The current browser does not support the focus-visible")}},this.handleBlur=()=>{this._adapter.setFocusVisible(!1)},this.changeScale=()=>{const{gap:t}=this.getProps(),o=this._adapter.getAvatarNode(),r=o==null?void 0:o.firstChild,[s,l]=[(o==null?void 0:o.offsetWidth)||0,(r==null?void 0:r.offsetWidth)||0];if(s!==0&&l!==0&&t*2<s){const c=s-t*2>l?1:(s-t*2)/l;this._adapter.setScale(c)}}}init(){const{children:e}=this.getProps();typeof e=="string"&&this.changeScale()}destroy(){}handleImgLoadError(){const{onError:e}=this.getProps();(e?e():void 0)!==!1&&this._adapter.notifyImgState(!1)}handleEnter(e){this._adapter.notifyEnter(e)}handleLeave(e){this._adapter.notifyLeave(e)}}const Ol=n=>{let{gradientStart:e,gradientEnd:t}=n;const o=So();return g.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"51",height:"52",viewBox:"0 0 51 52",fill:"none"},g.createElement("g",{filter:"url(#filter0_d_6_2)"},g.createElement("path",{d:"M40.4918 46.5592C44.6795 43.176 46.261 34.1333 47.5301 25.6141C49.5854 11.8168 39.6662 1 25.8097 1C11.2857 1 3 11.4279 3 25.3518C3 33.7866 6.29361 43.8947 10.4602 46.5592C12.5868 47.9192 12.5868 47.9051 25.8097 47.9192C38.3651 47.9282 38.5352 48.14 40.4918 46.5592Z",fill:`url(#${o})`})),g.createElement("defs",null,g.createElement("filter",{id:"filter0_d_6_2",x:"0.789215",y:"0.447304",width:"49.2216",height:"51.3549",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},g.createElement("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),g.createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),g.createElement("feOffset",{dy:"1.65809"}),g.createElement("feGaussianBlur",{stdDeviation:"1.10539"}),g.createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.3 0"}),g.createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow_6_2"}),g.createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow_6_2",result:"shape"})),g.createElement("linearGradient",{id:o,x1:"17.671",y1:"31.7392",x2:"17.671",y2:"47.9333",gradientUnits:"userSpaceOnUse"},g.createElement("stop",{stopColor:e}),g.createElement("stop",{offset:"1",stopColor:t}))))};var Pl=function(n,e){var t={};for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&e.indexOf(o)<0&&(t[o]=n[o]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(n);r<o.length;r++)e.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(n,o[r])&&(t[o[r]]=n[o[r]]);return t};const _l=dn.SIZE,Ml=dn.SHAPE,Ll=dn.COLOR,W=jl.PREFIX;class pt extends me{constructor(e){super(e),this.handleFocusVisible=t=>{this.foundation.handleFocusVisible(t)},this.handleBlur=t=>{this.foundation.handleBlur()},this.getContent=()=>{const{children:t,onClick:o,imgAttr:r,src:s,srcSet:l,alt:c}=this.props,{isImgExist:u}=this.state;let p=t;const d=o!==nn,m=s&&u,f={tabIndex:0,onKeyDown:this.handleKeyDown,onFocus:this.handleFocusVisible,onBlur:this.handleBlur};if(m){const y=d?`clickable Avatar: ${c}`:c,b=Object.assign(Object.assign({src:s,srcSet:l,onError:this.handleError},r),{className:I({[`${W}-no-focus-visible`]:d})}),x=d?Object.assign(Object.assign({},b),f):b;p=g.createElement("img",Object.assign({alt:y},x))}else if(typeof t=="string"){const y=c??t,x={role:"img","aria-label":d?`clickable Avatar: ${y}`:y,className:I(`${W}-label`,{[`${W}-no-focus-visible`]:d})},C=d?Object.assign(Object.assign({},x),f):x,S={transform:`scale(${this.state.scale})`};p=g.createElement("span",{className:`${W}-content`,style:S},g.createElement("span",Object.assign({},C,{"x-semi-prop":"children"}),t))}return p},this.renderBottomSlot=()=>{var t,o;if(!this.props.bottomSlot)return null;if(this.props.bottomSlot.render)return this.props.bottomSlot.render();const r=(t=this.props.bottomSlot.render)!==null&&t!==void 0?t:()=>{var s;const l={};return this.props.bottomSlot.bgColor&&(l.backgroundColor=this.props.bottomSlot.bgColor),this.props.bottomSlot.textColor&&(l.color=this.props.bottomSlot.textColor),g.createElement("span",{style:l,className:I(`${W}-bottom_slot-shape_${this.props.bottomSlot.shape}`,`${W}-bottom_slot-shape_${this.props.bottomSlot.shape}-${this.props.size}`,(s=this.props.bottomSlot.className)!==null&&s!==void 0?s:"")},this.props.bottomSlot.text)};return g.createElement("div",{className:I([`${W}-bottom_slot`]),style:(o=this.props.bottomSlot.style)!==null&&o!==void 0?o:{}},r())},this.renderTopSlot=()=>{var t,o,r,s;if(!this.props.topSlot)return null;if(this.props.topSlot.render)return this.props.topSlot.render();const l={};return this.props.topSlot.textColor&&(l.color=this.props.topSlot.textColor),g.createElement("div",{style:(t=this.props.topSlot.style)!==null&&t!==void 0?t:{},className:I([`${W}-top_slot-wrapper`,(o=this.props.topSlot.className)!==null&&o!==void 0?o:"",{[`${W}-animated`]:this.props.contentMotion}])},g.createElement("div",{className:I([`${W}-top_slot-bg`,`${W}-top_slot-bg-${this.props.size}`])},g.createElement("div",{className:I([`${W}-top_slot-bg-svg`,`${W}-top_slot-bg-svg-${this.props.size}`])},g.createElement(Ol,{gradientStart:(r=this.props.topSlot.gradientStart)!==null&&r!==void 0?r:"var(--semi-color-primary)",gradientEnd:(s=this.props.topSlot.gradientEnd)!==null&&s!==void 0?s:"var(--semi-color-primary)"}))),g.createElement("div",{className:I([`${W}-top_slot`])},g.createElement("div",{style:l,className:I([`${W}-top_slot-content`,`${W}-top_slot-content-${this.props.size}`])},this.props.topSlot.text)))},this.state={isImgExist:!0,hoverContent:"",focusVisible:!1,scale:1},this.onEnter=this.onEnter.bind(this),this.onLeave=this.onLeave.bind(this),this.handleError=this.handleError.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.getContent=this.getContent.bind(this),this.avatarRef=g.createRef()}get adapter(){return Object.assign(Object.assign({},super.adapter),{notifyImgState:e=>{this.setState({isImgExist:e})},notifyEnter:e=>{const{hoverMask:t}=this.props,o=t;this.setState({hoverContent:o},()=>{const{onMouseEnter:r}=this.props;r&&r(e)})},notifyLeave:e=>{this.setState({hoverContent:""},()=>{const{onMouseLeave:t}=this.props;t&&t(e)})},setFocusVisible:e=>{this.setState({focusVisible:e})},setScale:e=>{this.setState({scale:e})},getAvatarNode:()=>{var e;return(e=this.avatarRef)===null||e===void 0?void 0:e.current}})}componentDidMount(){this.foundation=new El(this.adapter),this.foundation.init()}componentDidUpdate(e){if(this.props.src&&this.props.src!==e.src){const t=new Image(0,0);t.src=this.props.src,t.onload=()=>{this.setState({isImgExist:!0})},t.onerror=()=>{this.setState({isImgExist:!1})},t.onabort=()=>{this.setState({isImgExist:!1})}}typeof this.props.children=="string"&&this.props.children!==e.children&&this.foundation.changeScale()}componentWillUnmount(){this.foundation.destroy()}onEnter(e){this.foundation.handleEnter(e)}onLeave(e){this.foundation.handleLeave(e)}handleError(){this.foundation.handleImgLoadError()}handleKeyDown(e){const{onClick:t}=this.props;switch(e.key){case"Enter":t(e),Je(e);break;case"Escape":e.target.blur();break}}render(){var e;const t=this.props,{shape:o,children:r,size:s,color:l,className:c,hoverMask:u,onClick:p,imgAttr:d,src:m,srcSet:f,style:y,alt:b,gap:x,bottomSlot:C,topSlot:S,border:k,contentMotion:_}=t,v=Pl(t,["shape","children","size","color","className","hoverMask","onClick","imgAttr","src","srcSet","style","alt","gap","bottomSlot","topSlot","border","contentMotion"]),{isImgExist:j,hoverContent:w,focusVisible:E}=this.state;let O={};dn.SIZE.includes(s)||(O={width:s,height:s}),O=Object.assign(Object.assign({},O),y);const D=C||S||k,P={onClick:p,onMouseEnter:this.onEnter,onMouseLeave:this.onLeave},N=m&&j,L=I(W,{[`${W}-${o}`]:o,[`${W}-${s}`]:s,[`${W}-${l}`]:l&&!N,[`${W}-img`]:N,[`${W}-focus`]:E,[`${W}-animated`]:_},c),B=w?g.createElement("div",{className:`${W}-hover`,"x-semi-prop":"hoverContent"},w):null;let Q=g.createElement("span",Object.assign({},v,{style:D?{}:O,className:L},D?{}:P,{role:"listitem",ref:this.avatarRef}),this.getContent(),B);if(k){const z={};typeof k=="object"&&(k!=null&&k.color)&&(z.borderColor=k==null?void 0:k.color),Q=g.createElement("div",{style:Object.assign({position:"relative"},O)},Q,g.createElement("span",{style:z,className:I([`${W}-additionalBorder`,`${W}-additionalBorder-${s}`,{[`${W}-${o}`]:o}])}),typeof this.props.border=="object"&&this.props.border.motion&&g.createElement("span",{style:z,className:I([`${W}-additionalBorder`,`${W}-additionalBorder-${s}`,{[`${W}-${o}`]:o,[`${W}-additionalBorder-animated`]:typeof this.props.border=="object"&&((e=this.props.border)===null||e===void 0?void 0:e.motion)}])}))}return D?g.createElement("span",Object.assign({className:I([`${W}-wrapper`]),style:O},P),Q,S&&["extra-small","small","default","medium","large","extra-large"].includes(s)&&o==="circle"&&this.renderTopSlot(),C&&["extra-small","small","default","medium","large","extra-large"].includes(s)&&this.renderBottomSlot()):Q}}pt.__SemiComponentName__="Avatar";pt.defaultProps=an(pt.__SemiComponentName__,{size:"medium",color:"grey",shape:"circle",gap:3,onClick:nn,onMouseEnter:nn,onMouseLeave:nn});pt.propTypes={children:h.node,color:h.oneOf(Ll),shape:h.oneOf(Ml),size:h.oneOf(_l),hoverMask:h.node,className:h.string,style:h.object,gap:h.number,imgAttr:h.object,src:h.string,srcSet:h.string,alt:h.string,onError:h.func,onClick:h.func,onMouseEnter:h.func,onMouseLeave:h.func,bottomSlot:h.shape({render:h.func,shape:h.oneOf(["circle","square"]),text:h.node,bgColor:h.string,textColor:h.string,className:h.string,style:h.object}),topSlot:h.shape({render:h.func,gradientStart:h.string,gradientEnd:h.string,text:h.node,textColor:h.string,className:h.string,style:h.object}),border:h.oneOfType([h.shape({color:h.string,motion:h.bool}),h.bool]),contentMotion:h.bool};pt.elementType="Avatar";var On,rr;function Il(){if(rr)return On;rr=1;function n(e,t,o,r){for(var s=e.length,l=o+(r?1:-1);r?l--:++l<s;)if(t(e[l],l,e))return l;return-1}return On=n,On}var Pn,sr;function Tl(){if(sr)return Pn;sr=1;function n(e){return e!==e}return Pn=n,Pn}var _n,ir;function Rl(){if(ir)return _n;ir=1;function n(e,t,o){for(var r=o-1,s=e.length;++r<s;)if(e[r]===t)return r;return-1}return _n=n,_n}var Mn,ar;function Nl(){if(ar)return Mn;ar=1;var n=Il(),e=Tl(),t=Rl();function o(r,s,l){return s===s?t(r,s,l):n(r,e,l)}return Mn=o,Mn}var Ln,lr;function $l(){if(lr)return Ln;lr=1;var n=To();function e(t,o){return n(o,function(r){return t[r]})}return Ln=e,Ln}var In,cr;function Dl(){if(cr)return In;cr=1;var n=$l(),e=$i();function t(o){return o==null?[]:n(o,e(o))}return In=t,In}var Tn,dr;function Al(){if(dr)return Tn;dr=1;var n=Nl();function e(t,o){var r=t==null?0:t.length;return!!r&&n(t,o,0)>-1}return Tn=e,Tn}var Rn,ur;function zl(){if(ur)return Rn;ur=1;function n(e,t,o){for(var r=-1,s=e==null?0:e.length;++r<s;)if(o(t,e[r]))return!0;return!1}return Rn=n,Rn}var Nn,pr;function Fl(){if(pr)return Nn;pr=1;var n=Di(),e=Al(),t=zl(),o=To(),r=Ai(),s=zi(),l=200;function c(u,p,d,m){var f=-1,y=e,b=!0,x=u.length,C=[],S=p.length;if(!x)return C;d&&(p=o(p,r(d))),m?(y=t,b=!1):p.length>=l&&(y=s,b=!1,p=new n(p));e:for(;++f<x;){var k=u[f],_=d==null?k:d(k);if(k=m||k!==0?k:0,b&&_===_){for(var v=S;v--;)if(p[v]===_)continue e;C.push(k)}else y(p,_,m)||C.push(k)}return C}return Nn=c,Nn}var $n,hr;function Bl(){if(hr)return $n;hr=1;var n=Ds(),e=As(),t="[object Boolean]";function o(r){return r===!0||r===!1||e(r)&&n(r)==t}return $n=o,$n}var Ul=Bl();const Vl=We(Ul),Kl={PREFIX:`${Re}-tag`},un={TAG_SIZE:["default","small","large"],TAG_COLOR:["grey","red","pink","purple","violet","indigo","blue","light-blue","cyan","teal","green","light-green","lime","yellow","amber","orange","white"],TAG_TYPE:["light","solid","ghost"],AVATAR_SHAPE:["square","circle"]};var Wl=function(n,e){var t={};for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&e.indexOf(o)<0&&(t[o]=n[o]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(n);r<o.length;r++)e.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(n,o[r])&&(t[o[r]]=n[o[r]]);return t};const pe=Kl.PREFIX,si=un.TAG_COLOR,ii=un.TAG_SIZE,ai=un.TAG_TYPE,Hl=un.AVATAR_SHAPE;class ze extends a.Component{constructor(e){super(e),this.state={visible:!0},this.close=this.close.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this)}static getDerivedStateFromProps(e){return"visible"in e?{visible:e.visible}:null}setVisible(e){"visible"in this.props||this.setState({visible:e})}close(e,t,o){const{onClose:r}=this.props;e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),r&&r(t,e,o),!e.defaultPrevented&&this.setVisible(!1)}handleKeyDown(e){const{closable:t,onClick:o,onKeyDown:r}=this.props;switch(e.key){case"Backspace":case"Delete":t&&this.close(e,this.props.children,this.props.tagKey),Je(e);break;case"Enter":o(e),Je(e);break;case"Escape":e.target.blur();break}r&&r(e)}renderAvatar(){const{avatarShape:e,avatarSrc:t}=this.props;return g.createElement(pt,{src:t,shape:e})}render(){const e=this.props,{tagKey:t,children:o,size:r,color:s,closable:l,visible:c,onClose:u,onClick:p,className:d,type:m,shape:f,avatarSrc:y,avatarShape:b,tabIndex:x,prefixIcon:C,suffixIcon:S,colorful:k,gradient:_}=e,v=Wl(e,["tagKey","children","size","color","closable","visible","onClose","onClick","className","type","shape","avatarSrc","avatarShape","tabIndex","prefixIcon","suffixIcon","colorful","gradient"]),{visible:j}=this.state,w=p!==ze.defaultProps.onClick||l,E={role:"button",tabIndex:x||0,onKeyDown:this.handleKeyDown},O=Object.assign(Object.assign({},v),{onClick:p,tabIndex:x,className:I(pe,{[`${pe}-default`]:r==="default",[`${pe}-small`]:r==="small",[`${pe}-large`]:r==="large",[`${pe}-square`]:f==="square",[`${pe}-circle`]:f==="circle",[`${pe}-${m}`]:m,[`${pe}-${s}-${m}`]:s&&m,[`${pe}-closable`]:l,[`${pe}-invisible`]:!j,[`${pe}-avatar-${b}`]:y,[`${pe}-colorful`]:k,[`${pe}-gradient`]:_},d)}),D=w?Object.assign(Object.assign({},O),E):O,P=l?g.createElement("div",{className:`${pe}-close`,onClick:B=>this.close(B,o,t)},g.createElement(ln,{size:"small"})):null,N=De(o),L=I(`${pe}-content`,`${pe}-content-${N?"ellipsis":"center"}`);return g.createElement("div",Object.assign({"aria-label":this.props["aria-label"]||N?`${l?"Closable ":""}Tag: ${o}`:""},D),C?g.createElement("div",{className:`${pe}-prefix-icon`},C):null,y?this.renderAvatar():null,g.createElement("div",{className:L},o),S?g.createElement("div",{className:`${pe}-suffix-icon`},S):null,P)}}ze.defaultProps={size:ii[0],color:si[0],closable:!1,type:ai[0],onClose:()=>{},onClick:()=>{},onMouseEnter:()=>{},style:{},className:"",shape:"square",avatarShape:"square",prefixIcon:null,suffixIcon:null,colorful:!1,gradient:!1};ze.propTypes={children:h.node,tagKey:h.oneOfType([h.string,h.number]),size:h.oneOf(ii),color:h.oneOf(si),type:h.oneOf(ai),closable:h.bool,visible:h.bool,onClose:h.func,onClick:h.func,prefixIcon:h.node,suffixIcon:h.node,style:h.object,className:h.string,avatarSrc:h.string,colorful:h.bool,gradient:h.bool,avatarShape:h.oneOf(Hl),"aria-label":h.string};Dl();var Dn,mr;function Zl(){if(mr)return Dn;mr=1;var n=Fi();function e(t,o){return t==null?!0:n(t,o)}return Dn=e,Dn}Zl();var An,fr;function ql(){if(fr)return An;fr=1;var n=To(),e=Bi(),t=Ui(),o=Vi(),r=Ki(),s=Wi(),l=Bs();function c(u){return t(u)?n(u,s):o(u)?[u]:e(r(l(u)))}return An=c,An}ql();var zn,gr;function Gl(){if(gr)return zn;gr=1;var n=Object.prototype,e=n.hasOwnProperty;function t(o,r){return o!=null&&e.call(o,r)}return zn=t,zn}var Fn,yr;function Ql(){if(yr)return Fn;yr=1;var n=Gl(),e=Hi();function t(o,r){return o!=null&&e(o,r,n)}return Fn=t,Fn}Ql();function Yl(n,e){return n&&(typeof n=="function"||typeof n=="object")&&e&&(typeof e=="function"||typeof e=="object")&&Object.entries(e).forEach(t=>{let[o,r]=t;n[o]=r}),n}const Xl={PREFIX:`${Re}-empty`};var Jl=function(n,e){var t={};for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&e.indexOf(o)<0&&(t[o]=n[o]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(n);r<o.length;r++)e.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(n,o[r])&&(t[o[r]]=n[o[r]]);return t};const Ze=Xl.PREFIX;class li extends me{constructor(e){super(e),this.observe=t=>{for(const o of t)o.type==="attributes"&&o.attributeName==="theme-mode"&&this.updateMode()},this.updateMode=()=>{const t=this.body.getAttribute("theme-mode");t!==this.state.mode&&this.setState({mode:t})},this.state={mode:null}}componentDidMount(){if(this.props.darkModeImage){this.body=window.document.body,this.updateMode();const e={attributes:!0,childList:!1,subtree:!1};this.observer=new MutationObserver(this.observe),this.observer.observe(this.body,e)}}componentWillUnmount(){this.observer&&this.observer.disconnect()}render(){const e=this.props,{className:t,image:o,description:r,style:s,title:l,imageStyle:c,children:u,layout:p,darkModeImage:d}=e,m=Jl(e,["className","image","description","style","title","imageStyle","children","layout","darkModeImage"]),f=typeof r=="string"?r:"empty",y=this.state.mode==="dark"&&d?d:o;let b=null;typeof y=="string"?b=g.createElement("img",{alt:f,src:y}):y&&"id"in y?b=g.createElement("svg",{"aria-hidden":"true"},g.createElement("use",{xlinkHref:`#${y.id}`})):b=y;const x=I(t,Ze,{[`${Ze}-${p}`]:p}),C=b?{heading:4}:{heading:6,style:{fontWeight:400}};return g.createElement("div",Object.assign({className:x,style:s},this.getDataAttr(m)),g.createElement("div",{className:`${Ze}-image`,style:c,"x-semi-prop":"image,darkModeImage"},b),g.createElement("div",{className:`${Ze}-content`},l?g.createElement(Ro.Title,Object.assign({},C,{className:`${Ze}-title`,"x-semi-prop":"title"}),l):null,r?g.createElement("div",{className:`${Ze}-description`,"x-semi-prop":"description"},r):null,u?g.createElement("div",{className:`${Ze}-footer`,"x-semi-prop":"children"},u):null))}}li.defaultProps={layout:"vertical"};const H={DIALOG:`${Re}-modal`},br={SIZE:["small","medium","large","full-width"],directions:["ltr","rtl"]};function ec(n){return n!==null&&typeof n=="object"}function vr(n){return ec(n)&&typeof n.then=="function"}class tc extends ve{constructor(e){super(Object.assign({},e)),this._debouncedOk=_o(t=>{this._invokeOk(t)},100,{leading:!0,trailing:!1}),this._debouncedCancel=_o(t=>{this._invokeCancel(t)},100,{leading:!0,trailing:!1}),this._lastCancelTarget=null,this._lastOkTarget=null,this.toggleDisplayNone=(t,o)=>{this._adapter.toggleDisplayNone(t,o)}}destroy(){this._debouncedOk.cancel(),this._debouncedCancel.cancel(),this.afterHide()}handleCancel(e){var t,o;const r=(o=(t=e==null?void 0:e.currentTarget)!==null&&t!==void 0?t:e==null?void 0:e.target)!==null&&o!==void 0?o:null;r!==this._lastCancelTarget&&this._debouncedCancel.cancel(),this._lastCancelTarget=r,this._debouncedCancel(e)}handleOk(e){var t,o;const r=(o=(t=e==null?void 0:e.currentTarget)!==null&&t!==void 0?t:e==null?void 0:e.target)!==null&&o!==void 0?o:null;r!==this._lastOkTarget&&this._debouncedOk.cancel(),this._lastOkTarget=r,this._debouncedOk(e)}_invokeCancel(e){var t;const o=this._adapter.notifyCancel(e);vr(o)&&(this._adapter.setState({onCancelReturnPromiseStatus:"pending"}),(t=o==null?void 0:o.then(()=>{this._adapter.setState({onCancelReturnPromiseStatus:"fulfilled"})}))===null||t===void 0||t.catch(r=>{throw this._adapter.setState({onCancelReturnPromiseStatus:"rejected"}),r}))}_invokeOk(e){var t;const o=this._adapter.notifyOk(e);vr(o)&&(this._adapter.setState({onOKReturnPromiseStatus:"pending"}),(t=o==null?void 0:o.then(()=>{this._adapter.setState({onOKReturnPromiseStatus:"fulfilled"})}))===null||t===void 0||t.catch(r=>{throw this._adapter.setState({onOKReturnPromiseStatus:"rejected"}),r}))}beforeShow(){this._adapter.disabledBodyScroll()}afterHide(){this._adapter.enabledBodyScroll(),this._adapter.notifyClose()}enabledBodyScroll(){this._adapter.enabledBodyScroll()}}class Ao extends ve{constructor(e){super(Object.assign(Object.assign({},Ao.defaultAdapter),e)),this.handleKeyDown=t=>{const{closeOnEsc:o}=this.getProps();if(o&&t.keyCode===on.ESC){t.stopPropagation(),this.close(t);return}}}destroy(){this.handleKeyDownEventListenerUnmount(),this.modalDialogBlur(),this.prevFocusElementReFocus()}handleDialogMouseDown(){this._adapter.notifyDialogMouseDown()}handleMaskMouseUp(){this._adapter.notifyDialogMouseUp()}handleKeyDownEventListenerMount(){this._adapter.addKeyDownEventListener()}handleKeyDownEventListenerUnmount(){this._adapter.removeKeyDownEventListener()}getMouseState(){this._adapter.getMouseState()}handleMaskClick(e){const{dialogMouseDown:t}=this.getStates();e.target===e.currentTarget&&!t&&this.close(e)}close(e){this._adapter.notifyClose(e)}modalDialogFocus(){this._adapter.modalDialogFocus()}modalDialogBlur(){this._adapter.modalDialogBlur()}prevFocusElementReFocus(){this._adapter.prevFocusElementReFocus()}}var Bn,xr;function nc(){if(xr)return Bn;xr=1;var n=Fl(),e=Zi(),t=qi(),o=e(function(r,s){return t(r)?n(r,s):[]});return Bn=o,Bn}var oc=nc();const rc=We(oc);class Ue{constructor(e,t){var o;this.addFocusRedirectListener=r=>(this.focusRedirectListenerList.push(r),()=>this.removeFocusRedirectListener(r)),this.removeFocusRedirectListener=r=>{this.focusRedirectListenerList=rc(this.focusRedirectListenerList,r)},this.destroy=()=>{var r;(r=this.container)===null||r===void 0||r.removeEventListener("keydown",this.onKeyPress)},this.shouldFocusRedirect=r=>{if(!this.enable)return!1;for(const s of this.focusRedirectListenerList)if(!s(r))return!1;return!0},this.focusElement=(r,s)=>{const{preventScroll:l}=this.options;r==null||r.focus({preventScroll:l}),s.preventDefault()},this.onKeyPress=r=>{if(r&&r.key==="Tab"){const s=Ue.getFocusableElements(this.container);s.length&&(r.shiftKey?this.handleContainerShiftTabKeyDown(s,r):this.handleContainerTabKeyDown(s,r))}},this.handleContainerTabKeyDown=(r,s)=>{const l=Ue.getActiveElement(),c=r[r.length-1]===l,u=r[0];c&&this.shouldFocusRedirect(u)&&this.focusElement(u,s)},this.handleContainerShiftTabKeyDown=(r,s)=>{const l=Ue.getActiveElement(),c=r[0]===l,u=r[r.length-1];c&&this.shouldFocusRedirect(u)&&this.focusElement(u,s)},Object.freeze(t),this.container=e,this.options=t,this.enable=(o=t==null?void 0:t.enable)!==null&&o!==void 0?o:!0,this.focusRedirectListenerList=t!=null&&t.onFocusRedirectListener?Array.isArray(t.onFocusRedirectListener)?[...t.onFocusRedirectListener]:[t.onFocusRedirectListener]:[],this.container.addEventListener("keydown",this.onKeyPress)}get enable(){return this._enable}set enable(e){this._enable=e}static getFocusableElements(e){if(!Gi(e))return[];const o=["input:not([disabled]):not([tabindex='-1'])","textarea:not([disabled]):not([tabindex='-1'])","button:not([disabled]):not([tabindex='-1'])","a[href]:not([tabindex='-1'])","select:not([disabled]):not([tabindex='-1'])","area[href]:not([tabindex='-1'])","iframe:not([tabindex='-1'])","object:not([tabindex='-1'])","*[tabindex]:not([tabindex='-1'])","*[contenteditable]:not([tabindex='-1'])"].join(",");return Array.from(e.querySelectorAll(o))}static getActiveElement(){return document?document.activeElement:null}}var Un=function(n,e){var t={};for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&e.indexOf(o)<0&&(t[o]=n[o]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(n);r<o.length;r++)e.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(n,o[r])&&(t[o[r]]=n[o[r]]);return t};let sc=0;class pn extends me{constructor(e){super(e),this.onKeyDown=t=>{this.foundation.handleKeyDown(t)},this.onDialogMouseDown=()=>{this.foundation.handleDialogMouseDown()},this.onMaskMouseUp=()=>{this.foundation.handleMaskMouseUp()},this.onMaskClick=t=>{this.foundation.handleMaskClick(t)},this.close=t=>{this.foundation.close(t)},this.getMaskElement=()=>{const t=Un(this.props,[]),{mask:o,maskClassName:r}=t;if(o){const s=I(`${H.DIALOG}-mask`,{});return g.createElement("div",Object.assign({key:"mask"},this.props.maskExtraProps,{className:I(s,r),style:t.maskStyle}))}return null},this.renderCloseBtn=()=>{const{closable:t,closeIcon:o}=this.props;let r;if(t){const s=o||g.createElement(ln,{"x-semi-prop":"closeIcon"});r=g.createElement(Gs,{"aria-label":"close",className:`${H.DIALOG}-close`,key:"close-btn",onClick:this.close,type:"tertiary",icon:s,theme:"borderless",size:"small"})}return r},this.renderIcon=()=>{const{icon:t}=this.props;return t?g.createElement("span",{className:`${H.DIALOG}-icon-wrapper`,"x-semi-prop":"icon"},t):null},this.renderHeader=()=>{if("header"in this.props)return this.props.header;const{title:t}=this.props,o=this.renderCloseBtn(),r=this.renderIcon();return t==null?null:g.createElement("div",{className:`${H.DIALOG}-header`},r,g.createElement(Ro.Title,{heading:5,className:`${H.DIALOG}-title`,id:`${H.DIALOG}-title`,"x-semi-prop":"title"},t),o)},this.renderBody=()=>{const{bodyStyle:t,children:o,title:r}=this.props,s=I(`${H.DIALOG}-body`,{[`${H.DIALOG}-withIcon`]:this.props.icon}),l=this.renderCloseBtn(),c=this.renderIcon();return r!=null||"header"in this.props?g.createElement("div",{className:s,id:`${H.DIALOG}-body`,style:t,"x-semi-prop":"children"},o):g.createElement("div",{className:`${H.DIALOG}-body-wrapper`},c,g.createElement("div",{className:s,style:t,"x-semi-prop":"children"},o),l)},this.getDialogElement=()=>{const t=Un(this.props,[]),o={},r=I(`${H.DIALOG}`,{[`${H.DIALOG}-centered`]:t.centered,[`${H.DIALOG}-${t.size}`]:t.size});t.width&&(o.width=t.width),t.height&&(o.height=t.height),t.isFullScreen&&(o.width="100%",o.height="100%",o.margin="unset");const s=this.renderBody(),l=this.renderHeader(),c=t.footer?g.createElement("div",{className:`${H.DIALOG}-footer`,"x-semi-prop":"footer"},t.footer):null,u=g.createElement("div",{role:"dialog",ref:this.modalDialogRef,"aria-modal":"true","aria-labelledby":`${H.DIALOG}-title`,"aria-describedby":`${H.DIALOG}-body`,onAnimationEnd:t.onAnimationEnd,className:I([`${H.DIALOG}-content`,t.contentClassName,{[`${H.DIALOG}-content-fullScreen`]:t.isFullScreen,[`${H.DIALOG}-content-height-set`]:t.height||Et(t.style,"height")}])},l,s,c);return g.createElement("div",{key:"dialog-element",className:r,onMouseDown:this.onDialogMouseDown,style:Object.assign(Object.assign({},t.style),o),id:this.dialogId},t!=null&&t.modalRender?t==null?void 0:t.modalRender(u):u)},this.state={dialogMouseDown:!1,prevFocusElement:Ue.getActiveElement()},this.foundation=new Ao(this.adapter),this.dialogId=`dialog-${sc++}`,this.modalDialogRef=g.createRef()}get adapter(){return Object.assign(Object.assign({},super.adapter),{notifyClose:e=>{this.props.onClose(e)},notifyDialogMouseDown:()=>{this.setState({dialogMouseDown:!0})},notifyDialogMouseUp:()=>{this.state.dialogMouseDown&&(this.timeoutId=setTimeout(()=>{this.setState({dialogMouseDown:!1})},0))},addKeyDownEventListener:()=>{this.props.closeOnEsc&&document.addEventListener("keydown",this.foundation.handleKeyDown)},removeKeyDownEventListener:()=>{this.props.closeOnEsc&&document.removeEventListener("keydown",this.foundation.handleKeyDown)},getMouseState:()=>this.state.dialogMouseDown,modalDialogFocus:()=>{var e,t,o;const{preventScroll:r}=this.props;let s;if(this.modalDialogRef){const l=Ue.getActiveElement();s=this.modalDialogRef.current.contains(l),(e=this.focusTrapHandle)===null||e===void 0||e.destroy(),this.focusTrapHandle=new Ue(this.modalDialogRef.current,{preventScroll:r})}s||(o=(t=this.modalDialogRef)===null||t===void 0?void 0:t.current)===null||o===void 0||o.focus({preventScroll:r})},modalDialogBlur:()=>{var e,t;(e=this.modalDialogRef)===null||e===void 0||e.current.blur(),(t=this.focusTrapHandle)===null||t===void 0||t.destroy()},prevFocusElementReFocus:()=>{const{prevFocusElement:e}=this.state,{preventScroll:t}=this.props,o=Et(e,"focus");Be(o)&&e.focus({preventScroll:t})}})}componentDidMount(){var e;this.foundation.handleKeyDownEventListenerMount(),this.foundation.modalDialogFocus();const t=Ue.getFocusableElements(this.modalDialogRef.current);this.modalDialogRef.current.contains(document.activeElement)||(e=t[0])===null||e===void 0||e.focus()}componentWillUnmount(){clearTimeout(this.timeoutId),this.foundation.destroy()}render(){var e;const t=this.props,{maskClosable:o,className:r,getPopupContainer:s,maskFixed:l,getContainerContext:c}=t,u=Un(t,["maskClosable","className","getPopupContainer","maskFixed","getContainerContext"]),{direction:p}=this.context,d=I(r,{[`${H.DIALOG}-popup`]:s&&s()!==((e=globalThis==null?void 0:globalThis.document)===null||e===void 0?void 0:e.body)&&!l,[`${H.DIALOG}-fixed`]:l,[`${H.DIALOG}-rtl`]:p==="rtl"}),m=c(),f=this.getDataAttr(u),y=g.createElement("div",Object.assign({className:d},f),this.getMaskElement(),g.createElement("div",Object.assign({role:"none",className:I({[`${H.DIALOG}-wrap`]:!0,[`${H.DIALOG}-wrap-center`]:this.props.centered}),onClick:o?this.onMaskClick:null,onMouseUp:o?this.onMaskMouseUp:null},this.props.contentExtraProps),this.getDialogElement()));return m&&m.Provider?g.createElement(m.Provider,{value:m.value},y):y}}pn.contextType=Us;pn.propTypes={close:h.func,getContainerContext:h.func,contentClassName:h.string,maskClassName:h.string,onAnimationEnd:h.func,preventScroll:h.bool};pn.defaultProps={close:A,getContainerContext:A,contentClassName:"",maskClassName:""};var ic=function(n,e){var t={};for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&e.indexOf(o)<0&&(t[o]=n[o]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(n);r<o.length;r++)e.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(n,o[r])&&(t[o[r]]=n[o[r]]);return t};const ci=n=>{const[e,t]=a.useState(!0),[o,r]=a.useState(),[s,l]=a.useState(),{direction:c}=n,{title:u,content:p,icon:d,type:m,onCancel:f,onOk:y,className:b}=n,x=ic(n,["title","content","icon","type","onCancel","onOk","className"]),C=a.useCallback(O=>{const D=y&&y(O);D&&D.then?(r(!0),D.then(function(){t(!1),r(!1)},P=>{r(!1)})):t(!1)},[y]),S=a.useCallback(O=>{const D=f&&f(O);D&&D.then?(l(!0),D.then(function(){t(!1),l(!1)},P=>{l(!1)})):t(!1)},[f]),k=`${H.DIALOG}-confirm`,_=I(b,k,{[`${k}-rtl`]:c==="rtl"}),v=I(`${H.DIALOG}-${m}`),j=Ge(d)?g.cloneElement(d,{className:`${k}-icon ${v}-icon`,size:"extra-large"}):d,w=u==null?null:g.createElement("span",{className:`${k}-title-text`},u),E=I(`${k}-content`,{[`${k}-content-withIcon`]:n.icon});return g.createElement(le,Object.assign({className:_,title:w,confirmLoading:o,cancelLoading:s,onOk:C,onCancel:S,icon:j,visible:e},x),g.createElement("div",{className:E,"x-semi-prop":"content"},p))};function Gt(n){const e=document.createElement("div");document.body.appendChild(e);let t=Object.assign({},n);const o=()=>{Hs(e),e.parentNode&&e.parentNode.removeChild(e);for(let c=0;c<Qe.length;c++)if(Qe[c]===s){Qe.splice(c,1);break}};function r(c){const{afterClose:u}=c;Vs(g.createElement(ci,Object.assign({},c,{afterClose:()=>{u==null||u(),o()},motion:n.motion})),e)}function s(){t=Object.assign(Object.assign({},t),{visible:!1}),r(t)}function l(c){t=Object.assign(Object.assign({},t),c),r(t)}return r(t),Qe.push(s),{destroy:s,update:l}}function di(n){return Object.assign({type:"info",icon:g.createElement(Qs,null)},n)}function ui(n){return Object.assign({type:"success",icon:g.createElement(Ks,null)},n)}function pi(n){return Object.assign({type:"warning",icon:g.createElement(Ys,null)},n)}function hi(n){return Object.assign({type:"error",icon:g.createElement(Ws,null),okButtonProps:Object.assign({type:"danger"},n.okButtonProps)},Qi(n,["okButtonProps"]))}function mi(n){return Object.assign({type:"confirm",icon:g.createElement(rl,null)},n)}var ac=function(n,e){var t={};for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&e.indexOf(o)<0&&(t[o]=n[o]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(n);r<o.length;r++)e.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(n,o[r])&&(t[o[r]]=n[o[r]]);return t};const lc=(n,e)=>{var{afterClose:t,config:o}=n;ac(n,["afterClose","config"]);const[r,s]=g.useState(o);g.useImperativeHandle(e,()=>({destroy:()=>{s(c=>Object.assign(Object.assign({},c),{visible:!1}))},update:c=>{s(u=>Object.assign(Object.assign({},u),c))}}));const l=()=>{var c;(c=o==null?void 0:o.afterClose)===null||c===void 0||c.call(o),t()};return g.createElement(ci,Object.assign({},r,{afterClose:l}))},cc=g.forwardRef(lc);let wr=0;function dc(){const[n,e]=g.useState([]);function t(o){return e(r=>[...r,o]),()=>{e(r=>r.filter(s=>s!==o))}}return[n,t]}function uc(){const[n,e]=dc();function t(o){return function(s){wr+=1;const l=g.createRef();let c;const u=g.createElement(cc,{key:`semi-modal-${wr}`,config:o(s),ref:l,afterClose:()=>{c()}});return c=e(u),{destroy:()=>{l.current&&l.current.destroy()},update:p=>{l.current&&l.current.update(p)}}}}return[{info:t(di),success:t(ui),error:t(hi),warning:t(pi),confirm:t(mi)},g.createElement(g.Fragment,null,n)]}var pc=function(n,e){var t={};for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&e.indexOf(o)<0&&(t[o]=n[o]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(n);r<o.length;r++)e.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(n,o[r])&&(t[o[r]]=n[o[r]]);return t};let Qe=[];class le extends me{constructor(e){super(e),this.bodyOverflow=null,this.handleCancel=t=>{this.foundation.handleCancel(t)},this.handleOk=t=>{this.foundation.handleOk(t)},this.updateState=()=>{const{visible:t}=this.props;this.foundation.toggleDisplayNone(!t)},this.renderFooter=()=>{const{okText:t,okType:o,cancelText:r,confirmLoading:s,cancelLoading:l,hasCancel:c,footerFill:u}=this.props,p=d=>{var m;return c?g.createElement(de,Object.assign({"aria-label":"cancel",onClick:this.handleCancel,loading:l===void 0?this.state.onCancelReturnPromiseStatus==="pending":l,type:"tertiary",block:u,autoFocus:!0},this.props.cancelButtonProps,{style:Object.assign(Object.assign({},u?{marginLeft:"unset"}:{}),(m=this.props.cancelButtonProps)===null||m===void 0?void 0:m.style),"x-semi-children-alias":"cancelText"}),r||d.cancel):null};return g.createElement(Zs,{componentName:"Modal"},(d,m)=>g.createElement("div",{className:I({[`${H.DIALOG}-footerfill`]:u})},p(d),g.createElement(de,Object.assign({"aria-label":"confirm",type:o,theme:"solid",block:u,loading:s===void 0?this.state.onOKReturnPromiseStatus==="pending":s,onClick:this.handleOk},this.props.okButtonProps,{"x-semi-children-alias":"okText"}),t||d.confirm)))},this.renderDialog=()=>{var t;let o=this.props,{footer:r,className:s,motion:l,maskStyle:c,keepDOM:u,style:p,zIndex:d,getPopupContainer:m,visible:f,modalContentClass:y}=o,b=pc(o,["footer","className","motion","maskStyle","keepDOM","style","zIndex","getPopupContainer","visible","modalContentClass"]),x=p;const C=c,S="footer"in this.props?r:this.renderFooter();let k={zIndex:d};m&&m()!==((t=globalThis==null?void 0:globalThis.document)===null||t===void 0?void 0:t.body)&&(k={zIndex:d,position:"static"});const _=I(s,{[`${H.DIALOG}-displayNone`]:u&&this.state.displayNone}),v=this.props.visible||this.props.keepDOM&&(!this.props.lazyRender||this._haveRendered)||this.props.motion&&!this.state.displayNone;return v&&(this._haveRendered=!0),g.createElement(ko,{motion:this.props.motion,animationState:f?"enter":"leave",startClassName:f?`${H.DIALOG}-content-animate-show`:`${H.DIALOG}-content-animate-hide`,onAnimationEnd:()=>{this.updateState()}},j=>{let{animationClassName:w,animationEventsNeedBind:E}=j;return g.createElement(ko,{motion:this.props.motion,animationState:f?"enter":"leave",startClassName:f?`${H.DIALOG}-mask-animate-show`:`${H.DIALOG}-mask-animate-hide`,onAnimationEnd:()=>{this.updateState()}},O=>{let{animationClassName:D,animationEventsNeedBind:P}=O;return v?g.createElement(Yi,{style:k,getPopupContainer:m}," ",g.createElement(pn,Object.assign({},b,{contentExtraProps:E,maskExtraProps:P,isFullScreen:this.state.isFullScreen,contentClassName:`${w} ${y}`,maskClassName:D,className:_,getPopupContainer:m,maskStyle:C,style:x,ref:this.modalRef,footer:S,onClose:this.handleCancel}))):g.createElement(g.Fragment,null)})})},this.state={displayNone:!e.visible,isFullScreen:e.fullScreen},this.foundation=new tc(this.adapter),this.modalRef=g.createRef(),this.scrollBarWidth=0,this.originBodyWidth="100%"}get adapter(){return Object.assign(Object.assign({},super.adapter),{getProps:()=>this.props,disabledBodyScroll:()=>{var e;const{getPopupContainer:t}=this.props;this.bodyOverflow=document.body.style.overflow||"",(!t||t()===((e=globalThis==null?void 0:globalThis.document)===null||e===void 0?void 0:e.body))&&this.bodyOverflow!=="hidden"&&(document.body.style.overflow="hidden",document.body.style.width=`calc(${this.originBodyWidth||"100%"} - ${this.scrollBarWidth}px)`)},enabledBodyScroll:()=>{var e;const{getPopupContainer:t}=this.props;(!t||t()===((e=globalThis==null?void 0:globalThis.document)===null||e===void 0?void 0:e.body))&&this.bodyOverflow!==null&&this.bodyOverflow!=="hidden"&&(document.body.style.overflow=this.bodyOverflow,document.body.style.width=this.originBodyWidth)},notifyCancel:e=>this.props.onCancel(e),notifyOk:e=>this.props.onOk(e),notifyClose:()=>{this.props.afterClose()},toggleDisplayNone:(e,t)=>{e!==this.state.displayNone&&this.setState({displayNone:e},t||A)},notifyFullScreen:e=>{e!==this.state.isFullScreen&&this.setState({isFullScreen:e})}})}static getDerivedStateFromProps(e,t){const o={};return e.fullScreen!==t.isFullScreen&&(o.isFullScreen=e.fullScreen),e.visible&&t.displayNone&&(o.displayNone=!1),o}componentDidMount(){this.scrollBarWidth=Xi(),this.originBodyWidth=document.body.style.width,this.props.visible&&this.foundation.beforeShow()}componentDidUpdate(e,t,o){!e.visible&&this.props.visible&&this.foundation.beforeShow(),!t.displayNone&&this.state.displayNone&&this.foundation.afterHide()}componentWillUnmount(){this.props.visible?this.foundation.destroy():this.foundation.enabledBodyScroll()}render(){const{visible:e,keepDOM:t,lazyRender:o}=this.props;return this.renderDialog()}}le.propTypes={mask:h.bool,closable:h.bool,centered:h.bool,visible:h.bool,width:h.oneOfType([h.string,h.number]),height:h.oneOfType([h.string,h.number]),confirmLoading:h.bool,cancelLoading:h.bool,okText:h.string,okType:h.string,cancelText:h.string,maskClosable:h.bool,onCancel:h.func,onOk:h.func,modalRender:h.func,afterClose:h.func,okButtonProps:h.object,cancelButtonProps:h.object,style:h.object,className:h.string,maskStyle:h.object,bodyStyle:h.object,zIndex:h.number,title:h.node,icon:h.node,header:h.node,footer:h.node,hasCancel:h.bool,motion:h.bool,children:h.node,getPopupContainer:h.func,getContainerContext:h.func,maskFixed:h.bool,closeIcon:h.node,closeOnEsc:h.bool,size:h.oneOf(br.SIZE),keepDOM:h.bool,lazyRender:h.bool,direction:h.oneOf(br.directions),fullScreen:h.bool,footerFill:h.bool};le.__SemiComponentName__="Modal";le.defaultProps=an(le.__SemiComponentName__,{zIndex:1e3,motion:!0,mask:!0,centered:!1,closable:!0,visible:!1,okType:"primary",maskClosable:!0,hasCancel:!0,onCancel:A,onOk:A,afterClose:A,maskFixed:!1,closeOnEsc:!0,size:"small",keepDOM:!1,lazyRender:!0,fullScreen:!1});le.useModal=uc;le.info=function(n){return Gt(di(n))};le.success=function(n){return Gt(ui(n))};le.error=function(n){return Gt(hi(n))};le.warning=function(n){return Gt(pi(n))};le.confirm=function(n){return Gt(mi(n))};le.destroyAll=function(){for(let e=0,t=Qe.length;e<t;e++){const o=Qe[e];o&&o()}Qe=[]};const Qt={PREFIX:`${Re}-dropdown`},hn={POSITION_SET:Ji.POSITION_SET,TRIGGER_SET:["hover","focus","click","custom","contextMenu"],DEFAULT_LEAVE_DELAY:100,ITEM_TYPE:["primary","secondary","tertiary","warning","danger"]},Cr={SPACING:4,NESTED_SPACING:2};class hc extends ve{handleVisibleChange(e){this._adapter.setPopVisible(e),this._adapter.notifyVisibleChange(e);const{trigger:t}=this.getProps();if(e&&t==="click"){const o=this._adapter.getPopupId();this.setFocusToFirstMenuItem(o)}}getMenuItemNodes(e){const t=document.getElementById(e);return t?Array.from(t.getElementsByTagName("li")).filter(o=>o.ariaDisabled==="false"):null}setFocusToFirstMenuItem(e){const t=this.getMenuItemNodes(e);t&&ea(t)}setFocusToLastMenuItem(e){const t=this.getMenuItemNodes(e);t&&ta(t)}handleKeyDown(e){var t,o;const r=(o=(t=e.target)===null||t===void 0?void 0:t.attributes["data-popupid"])===null||o===void 0?void 0:o.value,{visible:s}=this._adapter.getStates();switch(e.key){case" ":case"Enter":e.target.click();break;case"ArrowDown":this.setFocusToFirstMenuItem(r),s&&Je(e);break;case"ArrowUp":this.setFocusToLastMenuItem(r),s&&Je(e);break}}}class mc extends ve{constructor(){super(...arguments),this.menuItemNodes=null,this.firstChars=[]}handleEscape(e){this._adapter.getContext("trigger")==="custom"&&(e&&na(document.querySelectorAll("[data-popupid]"),e.id)).focus()}setFocusByFirstCharacter(e,t){const o=oa(this.menuItemNodes,e,this.firstChars,t);o>=0&&ra(this.menuItemNodes,this.menuItemNodes[o])}onMenuKeydown(e){const t=sa(e.target,"tooltip");this.menuItemNodes||(this.menuItemNodes=[...e.target.parentNode.getElementsByTagName("li")].filter(r=>r.ariaDisabled!=="true")),this.firstChars.length===0&&this.menuItemNodes.forEach(r=>{var s;this.firstChars.push((s=r.textContent.trim()[0])===null||s===void 0?void 0:s.toLowerCase())});const o=this.menuItemNodes.find(r=>r.tabIndex===0);switch(e.key){case" ":case"Enter":e.target.click();break;case"Escape":this.handleEscape(t);break;case"ArrowUp":la(this.menuItemNodes,o),Je(e);break;case"ArrowDown":aa(this.menuItemNodes,o),Je(e);break;default:ia(e.key)&&this.setFocusByFirstCharacter(o,e.key);break}}}const ht=g.createContext({level:0});var fc=function(n,e){var t={};for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&e.indexOf(o)<0&&(t[o]=n[o]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(n);r<o.length;r++)e.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(n,o[r])&&(t[o[r]]=n[o[r]]);return t};const gc=Qt.PREFIX;class zo extends me{constructor(e){super(e),this.foundation=new mc(this.adapter)}get adapter(){return Object.assign({},super.adapter)}render(){const e=this.props,{children:t,className:o,style:r}=e,s=fc(e,["children","className","style"]);return g.createElement("ul",Object.assign({role:"menu","aria-orientation":"vertical"},s,{className:I(`${gc}-menu`,o),style:r,onKeyDown:l=>this.foundation.onMenuKeydown(l)}),t)}}zo.propTypes={children:h.node,className:h.string,style:h.object};zo.contextType=ht;const qe=Qt.PREFIX;class mn extends me{render(){const{children:e,disabled:t,className:o,forwardRef:r,style:s,type:l,active:c,icon:u,onKeyDown:p,showTick:d,hover:m,innerRef:f}=this.props,{showTick:y}=this.context,b=y??d,x=I(o,{[`${qe}-item`]:!0,[`${qe}-item-disabled`]:t,[`${qe}-item-hover`]:m,[`${qe}-item-withTick`]:b,[`${qe}-item-${l}`]:l,[`${qe}-item-active`]:c}),C={};t||["onClick","onMouseEnter","onMouseLeave","onContextMenu"].forEach(_=>{this.context.level!==1&&_==="onClick"?C.onMouseDown=j=>{var w,E;j.button===0&&((E=(w=this.props)[_])===null||E===void 0||E.call(w,j))}:C[_]=this.props[_]});let S=null;switch(!0){case(b&&c):S=g.createElement(Zo,null);break;case(b&&!c):S=g.createElement(Zo,{style:{color:"transparent"}});break;default:S=null;break}let k=null;return u&&(k=g.createElement("div",{className:`${qe}-item-icon`},u)),g.createElement("li",Object.assign({role:"menuitem",tabIndex:-1,"aria-disabled":t},C,{onKeyDown:p,ref:_=>{r(_),typeof f=="function"?f(_):f&&typeof f=="object"&&(f.current=_)},className:x,style:s},this.getDataAttr(this.props)),S,k,e)}}mn.propTypes={children:h.oneOfType([h.string,h.node]),name:h.string,disabled:h.bool,selected:h.bool,onClick:h.func,onMouseEnter:h.func,onMouseLeave:h.func,onContextMenu:h.func,className:h.string,style:h.object,forwardRef:h.func,type:h.oneOf(hn.ITEM_TYPE),active:h.bool,icon:h.node};mn.contextType=ht;mn.defaultProps={disabled:!1,divided:!1,selected:!1,onMouseEnter:A,onMouseLeave:A,forwardRef:A};const fi=g.forwardRef((n,e)=>g.createElement(mn,Object.assign({},n,{innerRef:e})));fi.elementType="Dropdown.Item";const yc=Qt.PREFIX,bc=function(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const{style:e,className:t}=n;return g.createElement("div",{className:I(`${yc}-divider`,t),style:e})},Sr=Qt.PREFIX;class Fo extends a.PureComponent{render(){const{className:e,style:t,children:o}=this.props,{showTick:r}=this.context,s=I({[`${Sr}-title`]:!0,[`${Sr}-title-withTick`]:r},e);return g.createElement("div",{className:s,style:t},o)}}Fo.propTypes={children:h.node,className:h.string,style:h.object};Fo.contextType=ht;var Vn=function(n,e){var t={};for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&e.indexOf(o)<0&&(t[o]=n[o]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(n);r<o.length;r++)e.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(n,o[r])&&(t[o[r]]=n[o[r]]);return t};const vc=hn.POSITION_SET,xc=hn.TRIGGER_SET;class ue extends me{constructor(e){super(e),this.handleVisibleChange=t=>this.foundation.handleVisibleChange(t),this.state={popVisible:e.visible},this.foundation=new hc(this.adapter),this.tooltipRef=g.createRef()}get adapter(){return Object.assign(Object.assign({},super.adapter),{setPopVisible:e=>this.setState({popVisible:e}),notifyVisibleChange:e=>{var t,o;return(o=(t=this.props).onVisibleChange)===null||o===void 0?void 0:o.call(t,e)},getPopupId:()=>this.tooltipRef.current.getPopupId()})}renderContent(){const{render:e,menu:t,contentClassName:o,style:r,showTick:s,prefixCls:l,trigger:c}=this.props,u=I(l,o),{level:p=0}=this.context,d={showTick:s,level:p+1,trigger:c};let m=null;return g.isValidElement(e)?m=e:Array.isArray(t)&&(m=this.renderMenu()),g.createElement(ht.Provider,{value:d},g.createElement("div",{className:u,style:r},g.createElement("div",{className:`${l}-content`,"x-semi-prop":"render"},m)))}renderMenu(){const{menu:e}=this.props,t=e.map((o,r)=>{switch(o.node){case"title":{const{name:s,node:l}=o,c=Vn(o,["name","node"]);return g.createElement(ue.Title,Object.assign({},c,{key:l+s+r}),s)}case"item":{const{node:s,name:l}=o,c=Vn(o,["node","name"]);return g.createElement(ue.Item,Object.assign({},c,{key:s+l+r}),l)}case"divider":return g.createElement(ue.Divider,{key:o.node+r});default:return null}});return g.createElement(ue.Menu,null,t)}renderPopCard(){const{render:e,contentClassName:t,style:o,showTick:r,prefixCls:s}=this.props,l=I(s,t),{level:c=0}=this.context,u={showTick:r,level:c+1};return g.createElement(ht.Provider,{value:u},g.createElement("div",{className:l,style:o},g.createElement("div",{className:`${s}-content`},e)))}render(){const e=this.props,{children:t,position:o,trigger:r,onVisibleChange:s,zIndex:l,className:c,motion:u,margin:p,style:d,prefixCls:m}=e,f=Vn(e,["children","position","trigger","onVisibleChange","zIndex","className","motion","margin","style","prefixCls"]);let{spacing:y}=this.props;const{level:b}=this.context,{popVisible:x}=this.state,C=this.renderContent();return b>0?y=typeof y=="number"?y:Cr.NESTED_SPACING:(y===null||typeof y>"u")&&(y=Cr.SPACING),g.createElement(Ae,Object.assign({zIndex:l,motion:u,margin:p,content:C,className:c,prefixCls:m,spacing:y,position:o,trigger:r,onVisibleChange:this.handleVisibleChange,showArrow:!1,returnFocusOnClose:!0,ref:this.tooltipRef},f),g.isValidElement(t)?g.cloneElement(t,{className:I(Et(t,"props.className"),{[`${m}-showing`]:x}),"aria-haspopup":!0,"aria-expanded":x,onKeyDown:S=>{this.foundation.handleKeyDown(S);const k=Et(t,"props.onKeyDown");k&&k(S)}}):t)}}ue.Menu=zo;ue.Item=fi;ue.Divider=bc;ue.Title=Fo;ue.contextType=ht;ue.propTypes={children:h.node,contentClassName:h.oneOfType([h.string,h.array]),className:h.string,getPopupContainer:h.func,margin:h.oneOfType([h.number,h.object]),mouseEnterDelay:h.number,mouseLeaveDelay:h.number,menu:h.array,motion:h.oneOfType([h.bool,h.func,h.object]),onVisibleChange:h.func,prefixCls:h.string,position:h.oneOf(vc),rePosKey:h.oneOfType([h.string,h.number]),render:h.node,spacing:h.oneOfType([h.number,h.object]),showTick:h.bool,style:h.object,trigger:h.oneOf(xc),visible:h.bool,zIndex:h.number};ue.__SemiComponentName__="Dropdown";ue.defaultProps=an(ue.__SemiComponentName__,{onVisibleChange:A,prefixCls:Qt.PREFIX,zIndex:ca.DEFAULT_Z_INDEX,motion:!0,trigger:"hover",position:"bottom",mouseLeaveDelay:hn.DEFAULT_LEAVE_DELAY,showTick:!1,closeOnEsc:!0,onEscKeyDown:A});var Kn,kr;function wc(){if(kr)return Kn;kr=1;var n=oi();function e(t){return n(t)&&t!=+t}return Kn=e,Kn}var Cc=wc();const Sc=We(Cc),kc=(n,e)=>{const{isNaN:t}=Number;return t(n)&&t(e)};var jc=Bs();const Ne=We(jc);var Ec=da();const ot=We(Ec),Oc=Object.assign({},ri),Ye=Object.assign(Object.assign({},vl),{DEFAULT_STEP:1,DEFAULT_SHIFT_STEP:10,DEFAULT_PRESS_TIMEOUT:250,DEFAULT_PRESS_INTERVAL:0,MOUSE_BUTTON_LEFT:0}),Pc=Object.assign({},qt);function _c(n,e){const t=(n.toString().split(".")[1]||"").length,o=(e.toString().split(".")[1]||"").length,r=Math.pow(10,Math.max(t,o));return Math.round(n*r+e*r)/r}function jr(n,e){return _c(n,-e)}class Mc extends ve{constructor(){super(...arguments),this._decimalPointSymbol=void 0,this._currencySymbol=""}init(){this._isCurrency()&&this._setCurrencySymbol(),this._setInitValue()}destroy(){this._unregisterInterval(),this._unregisterTimer(),this._adapter.unregisterGlobalEvent("mouseup")}isControlled(){return this._isControlledComponent("value")}_isCurrency(){const{currency:e}=this.getProps();return e===!0||typeof e=="string"&&e.trim()!==""}_getFinalCurrency(){const{currency:e}=this.getProps();return e===!0?this.getProp("defaultCurrency"):e}_doInput(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,r=e,s=e,l=!0;const c=this.isControlled();typeof e!="number"&&(s=this.doParse(e,!1),l=!isNaN(s)),l&&(r=s,c||this._adapter.setNumber(s)),c||this._adapter.setValue(e,o),this.getProp("keepFocus")&&this._adapter.setFocusing(!0,()=>{this._adapter.setClickUpOrDown(!0)}),this.notifyChange(r,t)}_registerInterval(e){const t=this.getProp("pressInterval")||Ye.DEFAULT_PRESS_INTERVAL;this._intervalHasRegistered=!0,this._interval=setInterval(()=>{typeof e=="function"&&this._intervalHasRegistered&&e()},t)}_unregisterInterval(){this._interval&&(this._intervalHasRegistered=!1,clearInterval(this._interval),this._interval=null)}_registerTimer(e){const t=this.getProp("pressTimeout")||Ye.DEFAULT_PRESS_TIMEOUT;this._timerHasRegistered=!0,this._timer=setTimeout(()=>{this._timerHasRegistered&&typeof e=="function"&&e()},t)}_unregisterTimer(){this._timer&&(this._timerHasRegistered=!1,clearTimeout(this._timer),this._timer=null)}_setCurrencySymbol(){const{localeCode:e,currencyDisplay:t}=this.getProps(),o=new Intl.NumberFormat(e,{style:"currency",currency:this._getFinalCurrency()||this.getCurrencyByLocaleCode(),currencyDisplay:t}).formatToParts(1234.5);for(const r of o)r.type==="decimal"&&(this._decimalPointSymbol=r.value),r.type==="currency"&&(this._currencySymbol=r.value)}handleInputFocus(e){const t=this.getState("value");if(t!==""&&this._isScientificNotation()&&!this._isCurrency()){const o=Ne(t);if(/e/i.test(o)&&/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)[eE][+-]?\d+$/.test(o.trim())){const s=this.doParse(o,!1,!1,!1);if(this.isValidNumber(s)){const l=this.doFormat(s,!0,!1);this._adapter.setValue(l)}}}this._adapter.recordCursorPosition(),this._adapter.setFocusing(!0,null),this._adapter.setClickUpOrDown(!1),this._adapter.notifyFocus(e)}handleInputChange(e,t){const o=this.doParse(e,!0,!0,!0),r=this.doParse(e,!1,!1,!1),s=this.afterParser(e);this._adapter.recordCursorPosition();let l,c=r,u=e;if(e==="")this.isControlled()||(c=null);else if(this.isValidNumber(r)&&this.isValidNumber(o))l=r,u=this.doFormat(r,!1);else{if(typeof r=="number"&&!isNaN(r)){u=this.doFormat(r,!1);const p=s.lastIndexOf("."),d=s.length-1-p,m=this._getPrecLen(r);if(m){if(m<d)for(let f=0;f<d-m;f++)u+="0"}else{const f=p>-1?s.slice(p):"";u+=f}c=r}else u=this.doFormat(s,!1);l=this.isControlled()?u:s}!this.isControlled()&&(c===null||typeof c=="number"&&!isNaN(c))&&this._adapter.setNumber(c),this._adapter.setValue(this.isControlled()&&!this._isCurrency()?u:this.doFormat(s,!1),()=>{this._adapter.restoreCursor()}),this.notifyChange(l,t)}handleInputKeyDown(e){const t=e.keyCode;if(t===on.UP||t===on.DOWN){this._adapter.setClickUpOrDown(!0),this._adapter.recordCursorPosition();const o=t===on.UP?this.add(null,e):this.minus(null,e);this._doInput(o,e,()=>{this._adapter.restoreCursor()}),e.preventDefault()}this._adapter.notifyKeyDown(e)}handleInputBlur(e){const t=Ne(this.getState("value"));let o=this.getState("number");if(o!=null||t!=null&&t!==""){const r=this.doParse(t,!1,!0,!0);let s=!1,l=!1,c,u;if(this.isValidNumber(r)&&o!==r&&(c=r,this.isControlled()||(o=c),s=!0),!this.isValidNumber(r)){const d=parseFloat(t);if(isNaN(d)){if(typeof o=="number"&&!isNaN(o)){const m=this.fetchMinOrMax(o);m!==o&&(c=m,this.isControlled()||(o=c),s=!0)}}else{const m=this.fetchMinOrMax(d);m!==o&&(c=m,this.isControlled()||(o=c),s=!0)}}const p=this.doFormat(o,!0,!0);if(p!==t&&(u=p,l=!0),l||s){const d=u??c;u!=null&&this._adapter.setValue(u),c!=null&&(this._isControlledComponent("value")||this._adapter.setNumber(c)),this.notifyChange(d,e)}}this._adapter.setFocusing(!1),this._adapter.notifyBlur(e)}handleInputMouseEnter(e){this._adapter.setHovering(!0)}handleInputMouseLeave(e){this._adapter.setHovering(!1)}handleInputMouseMove(e){this._adapter.setHovering(!0)}handleMouseUp(e){this._unregisterInterval(),this._unregisterTimer(),this._adapter.unregisterGlobalEvent("mouseup")}handleUpClick(e){const{readonly:t}=this.getProps();!this._isMouseButtonLeft(e)||t||(this._adapter.setClickUpOrDown(!0),e&&(this._persistEvent(e),e.stopPropagation(),this._preventDefault(e)),this.upClick(e),this._registerTimer(()=>{this._registerInterval(()=>{this.upClick(e)})}))}handleDownClick(e){const{readonly:t}=this.getProps();!this._isMouseButtonLeft(e)||t||(this._adapter.setClickUpOrDown(!0),e&&(this._persistEvent(e),e.stopPropagation(),this._preventDefault(e)),this.downClick(e),this._registerTimer(()=>{this._registerInterval(()=>{this.downClick(e)})}))}_isMouseButtonLeft(e){return Et(e,"button")===Ye.MOUSE_BUTTON_LEFT}_preventDefault(e){const t=this._adapter.getProp("keepFocus"),o=this._adapter.getProp("innerButtons");(t||o)&&e.preventDefault()}handleMouseLeave(e){this._adapter.registerGlobalEvent("mouseup",()=>{this.handleMouseUp(e)})}upClick(e){const t=this.add(null,e);this._doInput(t,e),this._adapter.notifyUpClick(t,e)}downClick(e){const t=this.minus(null,e);this._doInput(t,e),this._adapter.notifyDownClick(t,e)}_setInitValue(){const{defaultValue:e,value:t}=this.getProps(),o=this._isControlledComponent("value")?t:e;let r=o;typeof o=="number"&&!this._isCurrency()?r=this.doFormat(o):this._isCurrency()||(r=Ne(o));const s=this.doParse(r,!1,!0,!0);let l=null;typeof s=="number"&&!isNaN(s)&&(l=s);const c=typeof l=="number"?this.doFormat(l,!0,!0):"";this._adapter.setNumber(l),this._adapter.setValue(c),De(c)&&c!==String(o??"")&&this.notifyChange(c,null)}add(e,t){const r=t&&t.shiftKey?this.getProp("shiftStep"):this.getProp("step");e=e==null?r:Number(e);const s=Math.abs(ot(e)),l=this.getState("number");let c=this.toNumber(l)||0;const u=this.getProp("min"),p=this.getProp("max"),d=this._getPrecLen(u),m=this._getPrecLen(p),f=this._getPrecLen(c),y=this._getPrecLen(e),b=Math.pow(10,Math.max(d,m,f,y));return e<0?Math.abs(jr(u,c))>=s&&(c=Math.round(c*b+e*b)/b):e>0&&Math.abs(jr(p,c))>=s&&(c=Math.round(c*b+e*b)/b),typeof u=="number"&&u>c&&(c=u),typeof p=="number"&&p<c&&(c=p),this.doFormat(c,!0,this._isCurrency())}minus(e,t){const r=t&&t.shiftKey?this.getProp("shiftStep"):this.getProp("step");return e=e==null?r:Number(e),this.add(-e,t)}_getPrecLen(e){if(typeof e!="string"){const o=Number(e||"");if(!isFinite(o)||o===0)return 0;const r=Math.abs(o).toString();if(/e/i.test(r)){const[s,l]=r.split(/e/i),c=(s.split(".")[1]||"").length;return Math.max(0,c-parseInt(l,10))}e=r}const t=e.indexOf(".")+1;return t?e.length-t:0}_adjustPrec(e){const t=this.getProp("precision");return typeof t=="number"&&e!==""&&e!==null&&!Number.isNaN(Number(e))&&(e=Number(e).toFixed(t)),Ne(e)}formatCurrency(e){const{localeCode:t,minimumFractionDigits:o,precision:r,maximumFractionDigits:s,currencyDisplay:l,showCurrencySymbol:c}=this.getProps();let u=e;typeof e=="string"&&Number.isNaN(Number(e))&&(u=this.parseInternationalCurrency(e));const d=new Intl.NumberFormat(t,{style:"currency",currency:this._getFinalCurrency()||this.getCurrencyByLocaleCode(),currencyDisplay:l,minimumFractionDigits:o||r||void 0,maximumFractionDigits:s||r||void 0}).format(Number(u));return c?d:d.replace(this._currencySymbol,"").trim()}_isScientificNotation(){const{scientificNotation:e}=this.getProps();return e===!0||typeof e=="object"&&e!==null}_getScientificNotationThreshold(){const{scientificNotation:e}=this.getProps();if(typeof e=="object"&&e!==null){const t=e.threshold;return typeof t=="number"&&Number.isFinite(t)&&t>=1?t:15}return 15}_toScientificNotation(e){const t=this._getScientificNotationThreshold(),o=Math.abs(e),r=String(o),s=/e/i.test(r),l=r.replace(/[.\-+eE]/g,"").replace(/^0+/,"");if((s||l.length>=t)&&o!==0){const c=Math.max(0,Math.min(100,Math.floor(t)-1));return e.toExponential(c).replace(/(\.\d*?)0+e/,"$1e").replace(/\.e/,"e")}return String(e)}doFormat(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const{formatter:r}=this.getProps();let s;if(this._isCurrency()&&o?s=this.formatCurrency(e):t?s=this._adjustPrec(e):s=Ne(e),this._isScientificNotation()&&o&&!this._isCurrency()){const l=typeof e=="number"?e:parseFloat(s);!isNaN(l)&&isFinite(l)&&(s=this._toScientificNotation(l))}return typeof r=="function"&&(s=r(s)),s}fetchMinOrMax(e){const{min:t,max:o}=this.getProps();return e<t?t:e>o?o:e}parseInternationalCurrency(e){let t=e.replace(this._currencySymbol,"").replace(new RegExp(`[^\\d${this._decimalPointSymbol}\\-]`,"g"),"");return this._decimalPointSymbol&&this._decimalPointSymbol!=="."&&(t=t.replace(this._decimalPointSymbol,".")),parseFloat(t)}doParse(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(this._isCurrency()&&typeof e=="string"&&(e=this.parseInternationalCurrency(e)),typeof e=="number")return r&&(e=this.fetchMinOrMax(e)),o&&(e=this._adjustPrec(e)),ot(e);const s=this.getProp("parser");if(typeof s=="function"){const l=s(e);e=typeof l=="number"?Ne(l):l}if(typeof e=="string"&&/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)[eE][+-]?\d+$/.test(e.trim())){const l=parseFloat(e.trim());if(!isNaN(l))return r?this.fetchMinOrMax(l):o?ot(this._adjustPrec(l)):l}if(t&&typeof e=="string"){const l=e.indexOf(".")===-1||e.indexOf(".")>-1&&(e==="0"||e.lastIndexOf("0")<e.length-1),c=e.lastIndexOf(".")<e.length-1&&e.split("").filter(u=>u===".").length<2;if(!l||!c)return NaN}return o&&(e=this._adjustPrec(e)),typeof e=="string"&&e.length?r?this.fetchMinOrMax(ot(e)):ot(e):NaN}afterParser(e){const t=this.getProp("parser");return Ne(typeof e=="string"&&typeof t=="function"?t(e):e)}toNumber(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(typeof e=="number")return e;if(typeof e=="string"){const{parser:o}=this.getProps();if(this._isCurrency()&&(e=this.parseInternationalCurrency(e)),typeof o=="function"){const r=o(e);e=typeof r=="number"?Ne(r):r}t&&(e=this._adjustPrec(e))}return ot(e)}isValidNumber(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(typeof e=="number"&&!isNaN(e)){const{min:o,max:r,precision:s}=this.getProps(),l=this._getPrecLen(e),c=t?typeof s=="number"&&l<=s||typeof s!="number":!0;if(e>=o&&e<=r&&c)return!0}return!1}isValidString(e){if(typeof e=="string"&&e.length){const t=this.doParse(e);return this.isValidNumber(t)}return!1}notifyChange(e,t){if(e==null||e==="")this._adapter.notifyChange("",t);else{const o=this.toNumber(e,!0);typeof o=="number"&&!isNaN(o)?(this._adapter.notifyChange(o,t),this.notifyNumberChange(o,t)):this._adapter.notifyChange(this.afterParser(e),t)}}notifyNumberChange(e,t){const{number:o}=this.getStates();this.isValidNumber(e)&&e!==o&&this._adapter.notifyNumberChange(e,t)}updateStates(e,t){this._adapter.updateStates(e,t)}getCurrencyByLocaleCode(){const{localeCode:e}=this.getProps(),t={"zh-CN":"CNY","zh-HK":"HKD","zh-TW":"TWD","ja-JP":"JPY","ko-KR":"KRW","th-TH":"THB","vi-VN":"VND","ms-MY":"MYR","id-ID":"IDR","hi-IN":"INR","ar-SA":"SAR","en-GB":"GBP","de-DE":"EUR","fr-FR":"EUR","it-IT":"EUR","es-ES":"EUR","pt-PT":"EUR","ru-RU":"RUB","en-US":"USD","en-CA":"CAD","es-MX":"MXN","pt-BR":"BRL","es-AR":"ARS","en-AU":"AUD","en-NZ":"NZD","en-ZA":"ZAR","ar-EG":"EGP"};if(t[e])return t[e];const o=e.split("-")[0],r={en:"USD",zh:"CNY",es:"EUR",fr:"EUR",de:"EUR",it:"EUR",ja:"JPY",ko:"KRW",ru:"RUB",ar:"SAR"};return r[o]?r[o]:"USD"}}var Lc=function(n,e){var t={};for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&e.indexOf(o)<0&&(t[o]=n[o]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(n);r<o.length;r++)e.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(n,o[r])&&(t[o[r]]=n[o[r]]);return t};class sn extends me{get adapter(){var e=this;return Object.assign(Object.assign({},super.adapter),{setValue:(t,o)=>this.setState({value:t},o),setNumber:(t,o)=>this.setState({number:t},o),setFocusing:(t,o)=>this.setState({focusing:t},o),setHovering:t=>this.setState({hovering:t}),notifyChange:function(){return e.props.onChange(...arguments)},notifyNumberChange:function(){return e.props.onNumberChange(...arguments)},notifyBlur:t=>this.props.onBlur(t),notifyFocus:t=>this.props.onFocus(t),notifyUpClick:(t,o)=>this.props.onUpClick(t,o),notifyDownClick:(t,o)=>this.props.onDownClick(t,o),notifyKeyDown:t=>this.props.onKeyDown(t),registerGlobalEvent:(t,o)=>{t&&typeof o=="function"&&(this.adapter.unregisterGlobalEvent(t),this.adapter.setCache(t,o),document.addEventListener(t,o))},unregisterGlobalEvent:t=>{if(t){const o=this.adapter.getCache(t);document.removeEventListener(t,o),this.adapter.setCache(t,null)}},getInputCharacter:t=>this.inputNode.value[t],recordCursorPosition:()=>{try{this.inputNode&&(this.cursorStart=this.inputNode.selectionStart,this.cursorEnd=this.inputNode.selectionEnd,this.currentValue=this.inputNode.value,this.cursorBefore=this.inputNode.value.substring(0,this.cursorStart),this.cursorAfter=this.inputNode.value.substring(this.cursorEnd))}catch(t){console.warn(t)}},restoreByAfter:t=>{if(Yt(t))return!1;const o=this.inputNode.value,r=o.lastIndexOf(t);return r===-1?!1:r+t.length===o.length?(this.adapter.fixCaret(r,r),!0):!1},restoreCursor:function(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:e.cursorAfter;return Yt(t)?!1:Array.prototype.some.call(t,(o,r)=>{const s=t.substring(r);return e.adapter.restoreByAfter(s)})},fixCaret:(t,o)=>{if(!(t===void 0||o===void 0||!this.inputNode||!this.inputNode.value))try{const r=this.inputNode.selectionStart,s=this.inputNode.selectionEnd;(t!==r||o!==s)&&this.inputNode.setSelectionRange(t,o)}catch{}},setClickUpOrDown:t=>{this.clickUpOrDown=t},updateStates:(t,o)=>{this.setState(t,o)}})}constructor(e){super(e),this.setInputRef=o=>{const{forwardedRef:r}=this.props;this.inputNode=o,r&&typeof r=="object"?r.current=o:typeof r=="function"&&r(o)},this.handleInputFocus=o=>this.foundation.handleInputFocus(o),this.handleInputChange=(o,r)=>this.foundation.handleInputChange(o,r),this.handleInputBlur=o=>this.foundation.handleInputBlur(o),this.handleInputKeyDown=o=>this.foundation.handleInputKeyDown(o),this.handleInputMouseEnter=o=>this.foundation.handleInputMouseEnter(o),this.handleInputMouseLeave=o=>this.foundation.handleInputMouseLeave(o),this.handleInputMouseMove=o=>this.foundation.handleInputMouseMove(o),this.handleUpClick=o=>this.foundation.handleUpClick(o),this.handleDownClick=o=>this.foundation.handleDownClick(o),this.handleMouseUp=o=>this.foundation.handleMouseUp(o),this.handleMouseLeave=o=>this.foundation.handleMouseLeave(o),this.renderButtons=()=>{const{prefixCls:o,disabled:r,innerButtons:s,max:l,min:c}=this.props,{hovering:u,focusing:p,number:d}=this.state,m=r||d===l,f=r||d===c,y=I(`${o}-number-suffix-btns`,{[`${o}-number-suffix-btns-inner`]:s,[`${o}-number-suffix-btns-inner-hover`]:s&&u&&!p}),b=I(`${o}-number-button`,`${o}-number-button-up`,{[`${o}-number-button-up-disabled`]:r,[`${o}-number-button-up-not-allowed`]:m}),x=I(`${o}-number-button`,`${o}-number-button-down`,{[`${o}-number-button-down-disabled`]:r,[`${o}-number-button-down-not-allowed`]:f});return g.createElement("div",{className:y},g.createElement("span",{className:b,onMouseDown:m?A:this.handleUpClick,onMouseUp:this.handleMouseUp,onMouseLeave:this.handleMouseLeave},g.createElement(ua,{size:"extra-small"})),g.createElement("span",{className:x,onMouseDown:f?A:this.handleDownClick,onMouseUp:this.handleMouseUp,onMouseLeave:this.handleMouseLeave},g.createElement(pa,{size:"extra-small"})))},this.renderSuffix=()=>{const{innerButtons:o,suffix:r}=this.props,{hovering:s,focusing:l}=this.state;return o&&(s||l)?this.renderButtons():r},this.foundation=new Mc(this.adapter),this.inputNode=null,this.clickUpOrDown=!1;const t=this._getInitState(e);this.state={value:t.value,number:t.number,focusing:!!e.autofocus||!1,hovering:!1}}_getInitState(e){const t=this.isControlled("value")?e.value:e.defaultValue;if(Yt(t)||t==="")return{value:"",number:null};if(e.currency===!0||typeof e.currency=="string"&&e.currency.trim()!==""){if(typeof t=="number"){const l=this.foundation.doParse(t,!1,!0,!0);return this.foundation.isValidNumber(l)?{value:this.foundation.doFormat(l,!0,!1),number:l}:{value:"",number:null}}return{value:String(t),number:null}}let r=t;typeof t=="number"&&(r=this.foundation.doFormat(t));const s=this.foundation.doParse(r,!1,!0,!0);return this.foundation.isValidNumber(s)?{value:this.foundation.doFormat(s,!0,!0),number:s}:{value:"",number:null}}componentDidUpdate(e){const{value:t,preventScroll:o}=this.props,{focusing:r}=this.state;let s;if(t!==e.value&&!kc(t,e.value)){if(Yt(t)||t==="")s="",this.foundation.updateStates({value:s,number:null});else{let l=t;typeof t=="number"&&(l=this.foundation.doFormat(t));const c=this.foundation.doParse(l,!1,!0,!0),u=typeof t=="number"?t:this.foundation.doParse(l,!1,!1,!1);if(r)if(this.foundation.isValidNumber(c)&&c!==this.state.number){const p={number:c};this.clickUpOrDown&&(p.value=this.foundation.doFormat(p.number,!0),s=p.value),this.foundation.updateStates(p,()=>this.adapter.restoreCursor())}else Sc(u)?this.foundation.updateStates({value:l}):(s=this.foundation.doFormat(u,!1),this.foundation.updateStates({value:s}));else this.foundation.isValidNumber(c)?(s=this.foundation.doFormat(c,!0,!0),this.foundation.updateStates({number:c,value:s})):(s="",this.foundation.updateStates({number:null,value:s}))}if(s&&De(s)&&s!==String(this.props.value))if(this.foundation._isCurrency()){const l=this.foundation.doParse(s),c=typeof this.props.value=="string"?this.foundation.doParse(this.props.value):this.props.value;l!==c&&this.foundation.notifyChange(s,null)}else this.foundation.notifyChange(s,null)}this.clickUpOrDown&&this.props.keepFocus&&this.state.focusing&&document.activeElement!==this.inputNode&&this.inputNode.focus({preventScroll:o})}render(){const e=this.props,{disabled:t,className:o,prefixCls:r,min:s,max:l,step:c,shiftStep:u,precision:p,formatter:d,parser:m,forwardedRef:f,onUpClick:y,onDownClick:b,pressInterval:x,pressTimeout:C,suffix:S,size:k,hideButtons:_,innerButtons:v,style:j,onNumberChange:w,keepFocus:E,defaultValue:O,defaultCurrency:D,currency:P,currencyDisplay:N,minimumFractionDigits:L,maximumFractionDigits:B,showCurrencySymbol:Q,localeCode:z}=e,M=Lc(e,["disabled","className","prefixCls","min","max","step","shiftStep","precision","formatter","parser","forwardedRef","onUpClick","onDownClick","pressInterval","pressTimeout","suffix","size","hideButtons","innerButtons","style","onNumberChange","keepFocus","defaultValue","defaultCurrency","currency","currencyDisplay","minimumFractionDigits","maximumFractionDigits","showCurrencySymbol","localeCode"]),{value:Y,number:fe}=this.state,Se=I(o,`${r}-number`,{[`${r}-number-size-${k}`]:k}),T=this.renderButtons(),F={"aria-disabled":t,step:c};return fe&&(F["aria-valuenow"]=fe),l!==1/0&&(F["aria-valuemax"]=l),s!==-1/0&&(F["aria-valuemin"]=s),g.createElement("div",{className:Se,style:j,onMouseMove:ce=>this.handleInputMouseMove(ce),onMouseEnter:ce=>this.handleInputMouseEnter(ce),onMouseLeave:ce=>this.handleInputMouseLeave(ce)},g.createElement(dt,Object.assign({role:"spinbutton"},F,M,{size:k,disabled:t,ref:this.setInputRef,value:Y,onFocus:this.handleInputFocus,onChange:this.handleInputChange,onBlur:this.handleInputBlur,onKeyDown:this.handleInputKeyDown,suffix:this.renderSuffix()})),_||v?null:T)}}sn.propTypes={"aria-label":h.string,"aria-labelledby":h.string,"aria-invalid":h.bool,"aria-errormessage":h.string,"aria-describedby":h.string,"aria-required":h.bool,autofocus:h.bool,clearIcon:h.node,className:h.string,defaultValue:h.oneOfType([h.number,h.string]),disabled:h.bool,formatter:h.func,forwardedRef:h.any,hideButtons:h.bool,innerButtons:h.bool,insetLabel:h.node,insetLabelId:h.string,keepFocus:h.bool,max:h.number,min:h.number,parser:h.func,precision:h.number,prefixCls:h.string,pressInterval:h.number,pressTimeout:h.number,preventScroll:h.bool,shiftStep:h.number,showCurrencySymbol:h.bool,step:h.number,style:h.object,suffix:h.any,value:h.oneOfType([h.number,h.string]),scientificNotation:h.oneOfType([h.bool,h.object]),onBlur:h.func,onChange:h.func,onDownClick:h.func,onKeyDown:h.func,onNumberChange:h.func,onUpClick:h.func};sn.defaultProps={forwardedRef:A,innerButtons:!1,keepFocus:!1,max:1/0,min:-1/0,prefixCls:Oc.PREFIX,pressInterval:Ye.DEFAULT_PRESS_TIMEOUT,pressTimeout:Ye.DEFAULT_PRESS_TIMEOUT,shiftStep:Ye.DEFAULT_SHIFT_STEP,showCurrencySymbol:!0,size:Pc.DEFAULT_SIZE,step:Ye.DEFAULT_STEP,onBlur:A,onChange:A,onDownClick:A,onFocus:A,onKeyDown:A,onNumberChange:A,onUpClick:A};const Wn=Yl(g.forwardRef(function(e,t){return g.createElement(Zs,{componentName:"InputNumber"},(o,r,s,l)=>g.createElement(sn,Object.assign({localeCode:r,defaultCurrency:l},e,{forwardedRef:t})))}),sn),gi={PREFIX:`${Re}-radio`},Ic={PREFIX:`${Re}-radioGroup`},ae={DIRECTION_SET:["horizontal","vertical"],DEFAULT_DIRECTION:"horizontal",MODE:["advanced",""],TYPE_DEFAULT:"default",TYPE_BUTTON:"button",TYPE_CARD:"card",TYPE_PURECARD:"pureCard",BUTTON_SIZE:["middle","small","large"]};class Tc extends ve{constructor(e){super(Object.assign({},e))}init(){const e=this._getDisplayValue();this._setValue(e)}_getDisplayValue(){const{value:e,defaultValue:t}=this.getProps();let o;return"value"in this.getProps()?o=e:"defaultValue"in this.getProps()&&(o=t),o}handleChange(e){const t=this.getProp("mode"),o=this.getState("value"),{checked:r,value:s}=e.target,l=this._adapter.isInProps("value"),c=Object.assign(Object.assign({},e),{target:Object.assign(Object.assign({},e.target),{value:s})});t==="advanced"&&!r&&(c.target.value=void 0),l||(t==="advanced"&&!r?this._setValue(void 0):this._setValue(s)),(t==="advanced"||o!==s)&&this._adapter.notifyChange(c)}handlePropValueChange(e){this._setValue(e)}_setValue(e){this._adapter.setValue(e)}destroy(){}}const Bo=g.createContext(null);class Rc extends ve{constructor(){super(...arguments),this.handleFocusVisible=e=>{const{target:t}=e;try{t.matches(":focus-visible")&&this._adapter.setFocusVisible(!0)}catch{Fs(!0,"Warning: [Semi Radio] The current browser does not support the focus-visible")}},this.handleBlur=()=>{this._adapter.setFocusVisible(!1)}}init(){const{children:e,extra:t,extraId:o,addonId:r}=this._adapter.getProps();e&&!r&&this._adapter.setAddonId(),t&&!o&&this._adapter.setExtraId()}setHover(e){this._adapter.setHover(e)}setChecked(e){this._adapter.setChecked(e)}}class Nc extends ve{constructor(e){super(Object.assign({},e))}init(){const e=this._adapter.getProp("checked"),t=this._adapter.getProp("defaultChecked");this.setChecked(e||t)}setChecked(e){this._adapter.setNativeControlChecked(e)}getChecked(){return this._adapter.getProp("checked")}handleChange(e){const t="checked"in this.getProps(),{checked:o}=e.target,r=()=>{e.stopPropagation()},s=()=>{e.preventDefault()},l={target:Object.assign(Object.assign({},this.getProps()),{checked:o}),stopPropagation:r,preventDefault:s};t?this._adapter.notifyChange(l):(this.setChecked(o),this._adapter.notifyChange(l))}destroy(){}}class fn extends me{constructor(e){super(e),this.state={checked:!1},this.foundation=new Nc(this.adapter),this.onChange=this.onChange.bind(this)}get adapter(){return Object.assign(Object.assign({},super.adapter),{setNativeControlChecked:e=>{this.setState({checked:e})},notifyChange:e=>{this.props.onChange(e)}})}componentDidMount(){this.foundation.init()}componentDidUpdate(e){e.checked!==this.props.checked&&this.foundation.setChecked(this.props.checked)}componentWillUnmount(){this.foundation.destroy()}blur(){this.inputEntity.blur()}focus(){const{preventScroll:e}=this.props;this.inputEntity.focus({preventScroll:e})}onChange(e){this.foundation.handleChange(e)}render(){const{disabled:e,mode:t,autoFocus:o,name:r,isButtonRadio:s,isPureCardRadioGroup:l,addonId:c,extraId:u,"aria-label":p,focusInner:d,onInputFocus:m,onInputBlur:f}=this.props,{checked:y}=this.state,b=this.props.prefixCls||gi.PREFIX,x=I({[`${b}-inner`]:!0,[`${b}-inner-checked`]:!!y,[`${b}-inner-buttonRadio`]:s,[`${b}-inner-pureCardRadio`]:l}),C=I({[`${b}-focus`]:d,[`${b}-focus-border`]:d&&!y,[`${b}-inner-display`]:!s});return g.createElement("span",{className:x},g.createElement("input",{ref:S=>{this.inputEntity=S},autoFocus:o,type:t==="advanced"?"checkbox":"radio",checked:!!y,disabled:e,onChange:this.onChange,name:r,"aria-label":p,"aria-labelledby":c,"aria-describedby":u,onFocus:m,onBlur:f}),g.createElement("span",{className:C},y?g.createElement(dl,null):null))}}fn.contextType=Bo;fn.propTypes={checked:h.bool,disabled:h.bool,isButtonRadio:h.bool,onChange:h.func,mode:h.oneOf(["advanced",""]),"aria-label":h.string,focusInner:h.bool,onInputFocus:h.func,onInputBlur:h.func,preventScroll:h.bool};fn.defaultProps={onChange:A,isButtonRadio:!1};var $c=function(n,e){var t={};for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&e.indexOf(o)<0&&(t[o]=n[o]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(n);r<o.length;r++)e.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(n,o[r])&&(t[o[r]]=n[o[r]]);return t};class et extends me{constructor(e){super(e),this.onChange=t=>{const{onChange:o}=this.props;if(this.isInGroup()){const{radioGroup:r}=this.context;r.onChange&&r.onChange(t)}!("checked"in this.props)&&this.foundation.setChecked(t.target.checked),o&&o(t)},this.handleMouseEnter=t=>{this.props.onMouseEnter(t),this.foundation.setHover(!0)},this.handleMouseLeave=t=>{this.props.onMouseLeave(t),this.foundation.setHover(!1)},this.handleFocusVisible=t=>{this.foundation.handleFocusVisible(t)},this.handleBlur=t=>{this.foundation.handleBlur()},this.state={hover:!1,addonId:e.addonId,extraId:e.extraId,checked:e.checked||e.defaultChecked||!1},this.foundation=new Rc(this.adapter),this.radioEntity=null}componentDidUpdate(e){this.props.checked!==e.checked&&(zs(this.props.checked)?this.foundation.setChecked(!1):Vl(this.props.checked)&&this.foundation.setChecked(this.props.checked))}get adapter(){return Object.assign(Object.assign({},super.adapter),{setHover:e=>{this.setState({hover:e})},setAddonId:()=>{this.setState({addonId:So({prefix:"addon"})})},setChecked:e=>{this.setState({checked:e})},setExtraId:()=>{this.setState({extraId:So({prefix:"extra"})})},setFocusVisible:e=>{this.setState({focusVisible:e})}})}isInGroup(){return this.context&&this.context.radioGroup}focus(){this.radioEntity.focus()}blur(){this.radioEntity.blur()}render(){const e=this.props,{addonClassName:t,addonStyle:o,disabled:r,style:s,className:l,prefixCls:c,displayMode:u,children:p,extra:d,mode:m,type:f,value:y,name:b}=e,x=$c(e,["addonClassName","addonStyle","disabled","style","className","prefixCls","displayMode","children","extra","mode","type","value","name"]);let C,S,k,_,v,j,w,E,O;const{hover:D,addonId:P,extraId:N,focusVisible:L,checked:B}=this.state,Q={checked:B,disabled:r};this.isInGroup()?(C=this.context.radioGroup.value===y,S=r||this.context.radioGroup.disabled,k=this.context.mode,_=this.context.radioGroup.isButtonRadio,v=this.context.radioGroup.isCardRadio,j=this.context.radioGroup.isPureCardRadio,E=this.context.radioGroup.buttonSize,O=c||this.context.radioGroup.prefixCls,Q.checked=C,Q.disabled=S):(C=B,S=r,k=m,w=f==="button",O=c,_=f===ae.TYPE_BUTTON,j=f===ae.TYPE_PURECARD,v=f===ae.TYPE_CARD||j);const z=typeof _>"u"?w:_,M=O||gi.PREFIX,Y=v||j||z,fe=I(M,{[`${M}-disabled`]:S,[`${M}-checked`]:C,[`${M}-${u}`]:!!u,[`${M}-buttonRadioComponent`]:w,[`${M}-buttonRadioGroup`]:_,[`${M}-buttonRadioGroup-${E}`]:_&&E,[`${M}-cardRadioGroup`]:v,[`${M}-cardRadioGroup_disabled`]:S&&v,[`${M}-cardRadioGroup_checked`]:v&&C&&!S,[`${M}-cardRadioGroup_checked_disabled`]:v&&C&&S,[`${M}-cardRadioGroup_hover`]:v&&!C&&D&&!S,[l]:!!l,[`${M}-focus`]:L&&(v||j)}),Se=this.isInGroup()&&this.context.radioGroup.name,T=I({[`${M}-addon`]:!z,[`${M}-addon-buttonRadio`]:z,[`${M}-addon-buttonRadio-checked`]:z&&C,[`${M}-addon-buttonRadio-disabled`]:z&&S,[`${M}-addon-buttonRadio-hover`]:z&&!C&&!S&&D,[`${M}-addon-buttonRadio-${E}`]:z&&E,[`${M}-focus`]:L&&z},t),F=()=>!p&&!d?null:g.createElement("div",{className:I([`${M}-content`,{[`${M}-isCardRadioGroup_content`]:v}])},p?g.createElement("span",{className:T,style:o,id:P,"x-semi-prop":"children"},p):null,d&&!z?g.createElement("div",{className:`${M}-extra`,id:N,"x-semi-prop":"extra"},d):null);return g.createElement("label",Object.assign({style:s,className:fe,onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave},this.getDataAttr(x)),g.createElement(fn,Object.assign({},this.props,Q,{mode:k,name:b??Se,isButtonRadio:z,isPureCardRadioGroup:j,onChange:this.onChange,ref:J=>{this.radioEntity=J},addonId:p&&P,extraId:d&&N,focusInner:L&&!Y,onInputFocus:this.handleFocusVisible,onInputBlur:this.handleBlur})),F())}}et.contextType=Bo;et.propTypes={autoFocus:h.bool,checked:h.bool,defaultChecked:h.bool,value:h.any,style:h.object,className:h.string,disabled:h.bool,prefixCls:h.string,displayMode:h.oneOf(["vertical",""]),onChange:h.func,onMouseEnter:h.func,onMouseLeave:h.func,mode:h.oneOf(ae.MODE),extra:h.node,addonStyle:h.object,addonClassName:h.string,type:h.oneOf([ae.TYPE_DEFAULT,ae.TYPE_BUTTON,ae.TYPE_CARD,ae.TYPE_PURECARD]),"aria-label":h.string,preventScroll:h.bool};et.defaultProps={autoFocus:!1,defaultChecked:!1,value:void 0,style:void 0,onMouseEnter:A,onMouseLeave:A,mode:"",type:"default"};et.elementType="Radio";var Dc=function(n,e){var t={};for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&e.indexOf(o)<0&&(t[o]=n[o]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(n);r<o.length;r++)e.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(n,o[r])&&(t[o[r]]=n[o[r]]);return t};class Ke extends me{constructor(e){super(e),this.onChange=t=>{this.foundation.handleChange(t)},this.getFormatName=()=>this.props.name||"default",this.state={value:e.value||e.defaultValue},this.foundation=new Tc(this.adapter)}componentDidMount(){this.foundation.init()}componentDidUpdate(e){typeof e.value=="number"&&isNaN(e.value)&&typeof this.props.value=="number"&&isNaN(this.props.value)||e.value!==this.props.value&&this.foundation.handlePropValueChange(this.props.value)}componentWillUnmount(){this.foundation.destroy()}get adapter(){return Object.assign(Object.assign({},super.adapter),{setValue:e=>{this.setState({value:e})},getProps:()=>this.props,isInProps:e=>e in this.props,notifyChange:e=>{this.props.onChange&&this.props.onChange(e)}})}render(){const e=this.props,{children:t,options:o,mode:r,prefixCls:s,className:l,style:c,direction:u,type:p,buttonSize:d,id:m}=e,f=Dc(e,["children","options","mode","prefixCls","className","style","direction","type","buttonSize","id"]),y=p===ae.TYPE_BUTTON,b=p===ae.TYPE_PURECARD,x=p===ae.TYPE_CARD||b,C=p===ae.TYPE_DEFAULT,S=s||Ic.PREFIX,k=I(l,{[S]:!0,[`${S}-wrapper`]:!0,[`${S}-${u}`]:u&&!y,[`${S}-${u}-default`]:u&&C,[`${S}-${u}-card`]:u&&x,[`${S}-buttonRadio`]:y}),_=this.state.value;let v;return o?v=(o||[]).map((j,w)=>typeof j=="string"?g.createElement(et,{key:w,disabled:this.props.disabled,value:j},j):g.createElement(et,{key:w,disabled:j.disabled||this.props.disabled,value:j.value,extra:j.extra,className:j.className,style:j.style,addonId:j.addonId,addonStyle:j.addonStyle,addonClassName:j.addonClassName,extraId:j.extraId},j.label)):t&&(v=g.Children.map(t,(j,w)=>g.isValidElement(j)?g.cloneElement(j,{key:w}):null)),g.createElement("div",Object.assign({className:k,style:c,id:m,"aria-label":this.props["aria-label"],"aria-invalid":this.props["aria-invalid"],"aria-errormessage":this.props["aria-errormessage"],"aria-labelledby":this.props["aria-labelledby"],"aria-describedby":this.props["aria-describedby"],"aria-required":this.props["aria-required"]},this.getDataAttr(f)),g.createElement(Bo.Provider,{value:{radioGroup:{onChange:this.onChange,value:_,disabled:this.props.disabled,name:this.getFormatName(),isButtonRadio:y,isCardRadio:x,isPureCardRadio:b,buttonSize:d,prefixCls:s},mode:r}},v))}}Ke.propTypes={defaultValue:h.any,disabled:h.bool,name:h.string,options:h.array,buttonSize:h.oneOf(ae.BUTTON_SIZE),type:h.oneOf([ae.TYPE_DEFAULT,ae.TYPE_BUTTON,ae.TYPE_CARD,ae.TYPE_PURECARD]),value:h.any,onChange:h.func,children:h.node,prefixCls:h.string,className:h.string,style:h.object,direction:h.oneOf(ae.DIRECTION_SET),mode:h.oneOf(ae.MODE),"aria-label":h.string,"aria-describedby":h.string,"aria-errormessage":h.string,"aria-invalid":h.bool,"aria-labelledby":h.string,"aria-required":h.bool,id:h.string};Ke.defaultProps={disabled:!1,onChange:A,direction:ae.DEFAULT_DIRECTION,mode:"",type:ae.TYPE_DEFAULT,buttonSize:"middle"};class Le extends et{}Le.Group=Ke;class Uo extends ve{constructor(e){super(Object.assign(Object.assign({},Uo.defaultAdapter),e)),this.handleMouseInSideChange=t=>{this._adapter.handleMouseInSideChange(t)},this.getInputWrapperRect=()=>this._adapter.getInputWrapperRect()}hasToast(e){return this._adapter.getState("list").map(o=>{let{id:r}=o;return r}).includes(e)}addToast(e){const t=this._adapter.getState("list");t.push(e),this._adapter.updateToast(t,[],[])}updateToast(e,t){let o=this._adapter.getState("list");o=o.map(s=>s.id===e?Object.assign(Object.assign({},s),t):s);const r=o.filter(s=>s.id===e);this._adapter.updateToast(o,[],r)}removeToast(e){let t=this._adapter.getState("list");const o=[];t=t.filter(r=>r.id===e?(o.push(r),!1):!0),this._adapter.updateToast(t,o,[])}destroyAll(){const e=this._adapter.getState("list");e.length>0&&this._adapter.updateToast([],e,[])}}const Er=`${Re}-toast`,lt={PREFIX:Er,WRAPPER:`${Er}-wrapper`},jt={types:["warning","success","info","error","default"],themes:["normal","light"],directions:["ltr","rtl"]},Ac={duration:3};class Vo extends ve{constructor(e){super(Object.assign(Object.assign({},Vo.defaultAdapter),e)),this._timer=null,this._id=null}init(){this.startCloseTimer_(),this._id=this._adapter.getProp("id")}destroy(){this.clearCloseTimer_()}startCloseTimer_(){const e=this._adapter.getProp("duration");e&&Mo(e)&&(this._timer=setTimeout(()=>{this.close()},e*1e3))}close(e){e&&e.stopPropagation(),this._adapter.notifyWrapperToRemove(this._id),this._adapter.notifyClose()}clearCloseTimer_(){this._timer&&(clearTimeout(this._timer),this._timer=null)}restartCloseTimer(){this.clearCloseTimer_(),this.startCloseTimer_()}}const Me=lt.PREFIX;let tt=class extends me{constructor(e){super(e),this.toastEle=g.createRef(),this.clearCloseTimer=()=>{this.foundation.clearCloseTimer_()},this.startCloseTimer=()=>{this.foundation.startCloseTimer_()},this.restartCloseTimer=()=>{this.foundation.restartCloseTimer()},this.state={},this.foundation=new Vo(this.adapter)}get adapter(){return Object.assign(Object.assign({},super.adapter),{notifyWrapperToRemove:e=>{this.props.close(e)},notifyClose:()=>{this.props.onClose()}})}componentDidMount(){this.foundation.init()}componentWillUnmount(){this.foundation.destroy()}close(e){this.foundation.close(e)}renderIcon(){const{type:e,icon:t}=this.props,r={warning:g.createElement(Ys,null),success:g.createElement(Ks,null),info:g.createElement(Qs,null),error:g.createElement(Ws,null)}[e],s="large",l=I(`${Me}-icon`,`${Me}-icon-${e}`);return t?Ge(t)?g.cloneElement(t,{size:s,className:`${Me}-icon`}):t:e&&r?g.cloneElement(r,{size:s,className:l}):null}render(){const{content:e,type:t,theme:o,showClose:r,textMaxWidth:s,className:l,style:c}=this.props,u=this.props.direction||this.context.direction,p=I(Me,l,{[`${Me}-${t}`]:!0,[`${Me}-${o}`]:o==="light",[`${Me}-rtl`]:u==="rtl"}),d={};d.maxWidth=s;const m="borderless",f="small",y=this.props.positionInList?this.props.positionInList.length-this.props.positionInList.index-1:0,b=g.createElement("div",{ref:this.toastEle,role:"alert","aria-label":`${t||"default"} type`,className:p,style:Object.assign(Object.assign({},c),{transform:`translate3d(0,0,${y*-10}px)`}),onMouseEnter:this.clearCloseTimer,onMouseLeave:this.startCloseTimer,onAnimationStart:this.props.onAnimationStart,onAnimationEnd:this.props.onAnimationEnd},g.createElement("div",{className:`${Me}-content`},this.renderIcon(),g.createElement("span",{className:`${Me}-content-text`,style:d,"x-semi-prop":"content"},e),r&&g.createElement("div",{className:`${Me}-close-button`},g.createElement(Gs,{onClick:x=>this.close(x),type:"tertiary",icon:g.createElement(ln,{"x-semi-prop":"icon"}),theme:m,size:f}))));if(this.props.stack){const x=this.props.stackExpanded&&this.toastEle.current&&getComputedStyle(this.toastEle.current).height||0;return g.createElement("div",{className:`${Me}-zero-height-wrapper`,style:{height:x}},b)}else return b}};tt.contextType=Us;tt.propTypes={onClose:h.func,content:h.node,close:h.func,duration:h.number,theme:h.oneOf(jt.themes),type:h.oneOf(jt.types),textMaxWidth:h.oneOfType([h.string,h.number]),style:h.object,className:h.string,showClose:h.bool,stack:h.bool,stackExpanded:h.bool,icon:h.node,direction:h.oneOf(jt.directions)};tt.__SemiComponentName__="Toast";tt.defaultProps=an(tt.__SemiComponentName__,{onClose:A,content:"",close:A,duration:Ac.duration,textMaxWidth:450,showClose:!0,stack:!1,stackExpanded:!1,theme:"normal"});var zc=function(n,e){var t={};for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&e.indexOf(o)<0&&(t[o]=n[o]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(n);r<o.length;r++)e.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(n,o[r])&&(t[o[r]]=n[o[r]]);return t};const Fc=(n,e)=>{var{afterClose:t}=n,o=zc(n,["afterClose"]);const[r,s]=a.useState(!0),l=()=>{s(!1)};return g.useImperativeHandle(e,()=>({close:()=>{s(!1)}})),a.useEffect(()=>{r||t(o.id)},[r]),r?g.createElement(tt,Object.assign({},o,{close:l})):null},Bc=g.forwardRef(Fc),vt={motion:!0,zIndex:1010,duration:3};function Uc(){const[n,e]=g.useState([]);function t(o,r){return e(s=>[{element:o,config:r},...s]),s=>{e(l=>l.filter(c=>{let{config:u}=c;return u.id!==s}))}}return[n,t]}function Vc(){const[n,e]=Uc(),t=a.useRef(new Map),o=s=>{const l=jo("semi_toast_"),c=Object.assign(Object.assign({},s),{id:l});let u;const p=g.createElement(Bc,Object.assign({},c,{key:l,afterClose:d=>u(d),ref:d=>{var m;t.current.set(l,{close:(m=d==null?void 0:d.close)!==null&&m!==void 0?m:A})}}));return u=e(p,Object.assign({},c)),l},r=s=>{var l;const{close:c}=(l=t.current.get(s))!==null&&l!==void 0?l:{};c==null||c()};return[{success:s=>o(Object.assign(Object.assign(Object.assign({},vt),s),{type:"success"})),info:s=>o(Object.assign(Object.assign(Object.assign({},vt),s),{type:"info"})),error:s=>o(Object.assign(Object.assign(Object.assign({},vt),s),{type:"error"})),warning:s=>o(Object.assign(Object.assign(Object.assign({},vt),s),{type:"warning"})),open:s=>o(Object.assign(Object.assign(Object.assign({},vt),s),{type:"default"})),close:s=>r(s)},g.createElement(g.Fragment,null,Array.isArray(n)&&n.length?g.createElement(g.Fragment,null,n.map(s=>s.element)):null)]}const Kc=()=>{var n;return n=class re extends me{constructor(t){super(t),this.stack=!1,this.innerWrapperRef=g.createRef(),this.handleMouseEnter=o=>{this.stack&&this.foundation.handleMouseInSideChange(!0)},this.handleMouseLeave=o=>{var r;this.stack&&(!((r=this.foundation.getInputWrapperRect())===null||r===void 0)&&r.height)&&this.foundation.handleMouseInSideChange(!1)},this.state={list:[],removedItems:[],updatedItems:[],mouseInSide:!1},this.foundation=new Uo(this.adapter)}get adapter(){return Object.assign(Object.assign({},super.adapter),{updateToast:(t,o,r)=>{this.setState({list:t,removedItems:o,updatedItems:r})},handleMouseInSideChange:t=>{this.setState({mouseInSide:t})},getInputWrapperRect:()=>{var t;return(t=this.innerWrapperRef.current)===null||t===void 0?void 0:t.getBoundingClientRect()}})}static create(t){var o,r,s;const l=(o=t.id)!==null&&o!==void 0?o:jo("toast"),c=((s=(r=ye===null||ye===void 0?void 0:ye.config)===null||r===void 0?void 0:r.overrideDefaultProps)===null||s===void 0?void 0:s.Toast)||{},u=Object.assign(Object.assign(Object.assign({},re.defaultOpts),c),t);if(re.ref){const p=document.querySelector(`#${this.wrapperId}`);["top","left","bottom","right"].map(d=>{d in u&&(p.style[d]=typeof u[d]=="number"?`${u[d]}px`:u[d])}),!!u.stack!==re.ref.stack&&(re.ref.stack=!!u.stack),re.ref.has(l)?re.ref.update(l,Object.assign(Object.assign({},u),{id:l})):re.ref.add(Object.assign(Object.assign({},u),{id:l}))}else{const p=document.createElement("div");this.wrapperId||(this.wrapperId=jo("toast-wrapper").slice(0,26)),p.className=lt.WRAPPER,p.id=this.wrapperId,p.style.zIndex=String(typeof t.zIndex=="number"?t.zIndex:u.zIndex),["top","left","bottom","right"].map(d=>{if(d in u){const m=u[d];p.style[d]=typeof m=="number"?`${m}px`:m}}),u.getPopupContainer?u.getPopupContainer().appendChild(p):document.body.appendChild(p),Vs(g.createElement(re,{ref:d=>{d&&(re.ref=d,d.add(Object.assign(Object.assign({},u),{id:l})),d.stack=!!u.stack)}}),p)}return l}static close(t){re.ref&&re.ref.remove(t)}static destroyAll(){var t;if(re.ref){re.ref.destroyAll();const o=document.querySelector(`#${this.wrapperId}`);o&&(Hs(o),(t=o.parentNode)===null||t===void 0||t.removeChild(o)),re.ref=null,this.wrapperId=null}}static getWrapperId(){return this.wrapperId}static info(t){var o,r;typeof t=="string"&&(t={content:t});const s=((r=(o=ye===null||ye===void 0?void 0:ye.config)===null||o===void 0?void 0:o.overrideDefaultProps)===null||r===void 0?void 0:r.Toast)||{};return this.create(Object.assign(Object.assign(Object.assign(Object.assign({},re.defaultOpts),s),t),{type:"info"}))}static warning(t){var o,r;typeof t=="string"&&(t={content:t});const s=((r=(o=ye===null||ye===void 0?void 0:ye.config)===null||o===void 0?void 0:o.overrideDefaultProps)===null||r===void 0?void 0:r.Toast)||{};return this.create(Object.assign(Object.assign(Object.assign(Object.assign({},re.defaultOpts),s),t),{type:"warning"}))}static error(t){var o,r;typeof t=="string"&&(t={content:t});const s=((r=(o=ye===null||ye===void 0?void 0:ye.config)===null||o===void 0?void 0:o.overrideDefaultProps)===null||r===void 0?void 0:r.Toast)||{};return this.create(Object.assign(Object.assign(Object.assign(Object.assign({},re.defaultOpts),s),t),{type:"error"}))}static success(t){var o,r;typeof t=="string"&&(t={content:t});const s=((r=(o=ye===null||ye===void 0?void 0:ye.config)===null||o===void 0?void 0:o.overrideDefaultProps)===null||r===void 0?void 0:r.Toast)||{};return this.create(Object.assign(Object.assign(Object.assign(Object.assign({},re.defaultOpts),s),t),{type:"success"}))}static config(t){["top","left","bottom","right"].forEach(o=>{o in t&&(re.defaultOpts[o]=t[o])}),typeof t.theme=="string"&&jt.themes.includes(t.theme)&&(re.defaultOpts.theme=t.theme),typeof t.zIndex=="number"&&(re.defaultOpts.zIndex=t.zIndex),typeof t.duration=="number"&&(re.defaultOpts.duration=t.duration),typeof t.getPopupContainer=="function"&&(re.defaultOpts.getPopupContainer=t.getPopupContainer)}has(t){return this.foundation.hasToast(t)}add(t){return this.foundation.addToast(t)}update(t,o){return this.foundation.updateToast(t,o)}remove(t){return this.foundation.removeToast(t)}destroyAll(){return this.foundation.destroyAll()}render(){let{list:t}=this.state;const{removedItems:o,updatedItems:r}=this.state;t=Array.from(new Set([...t,...o]));const s=r.map(c=>{let{id:u}=c;return u}),l=c=>{var u;!((u=c==null?void 0:c.foundation)===null||u===void 0)&&u._id&&s.includes(c.foundation._id)&&c.foundation.restartCloseTimer()};return g.createElement(g.Fragment,null,g.createElement("div",{className:I({[`${lt.PREFIX}-innerWrapper`]:!0,[`${lt.PREFIX}-innerWrapper-hover`]:this.state.mouseInSide}),ref:this.innerWrapperRef,onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave},t.map((c,u)=>{const p=o.find(m=>m.id===c.id)!==void 0,d=p?"leave":"enter";return g.createElement(ko,{key:c.id,motion:c.motion,animationState:d,startClassName:p?`${lt.PREFIX}-animation-hide`:`${lt.PREFIX}-animation-show`,onAnimationEnd:m=>{d==="leave"&&this.setState(f=>{var y;return!((y=f.removedItems)===null||y===void 0)&&y.some(b=>b.id===c.id)?Object.assign(Object.assign({},f),{removedItems:f.removedItems.filter(b=>b.id!==c.id)}):null})}},m=>{let{animationClassName:f,animationEventsNeedBind:y,isAnimating:b}=m;return g.createElement(tt,Object.assign({},c,{stack:this.stack,stackExpanded:this.state.mouseInSide,positionInList:{length:t.length,index:u},className:I({[c.className]:!!c.className,[f]:!0})},y,{style:Object.assign({},c.style),close:x=>this.remove(x),ref:l}))})})))}},n.defaultOpts={motion:!0,zIndex:1010,content:""},n.propTypes={content:h.node,duration:h.number,onClose:h.func,icon:h.node,direction:h.oneOf(jt.directions),stack:h.bool},n.defaultProps={},n};class Wc{static create(e){const t=Kc();return t.useToast=Vc,e&&t.config(e),t}}const X=Wc.create(),Hn=n=>n==="vertical"?["bottom","top"]:["right","left"],mt=(n,e)=>n.endsWith("px")?Number(n.replace("px","")):n.endsWith("%")?Number(n.replace("%",""))/100*e:typeof n>"u"?n:Number(n),Xt=function(n,e,t,o){let r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;e=e??"0%",t=t??"100%";const s=mt(e,o),l=mt(t,o);return n<s+r||n>l},Zn=(n,e,t,o,r)=>{e=e??"0%",t=t??"100%";const s=mt(e,o),l=mt(t,o);return n<s+r?s+r:n>l?l:n},Or=(n,e)=>{if(e==="horizontal"){const t=parseFloat(n.paddingLeft),o=parseFloat(n.paddingRight),r=parseFloat(n.borderLeftWidth),s=parseFloat(n.borderRightWidth);return t+o+r+s}else{const t=parseFloat(n.paddingTop),o=parseFloat(n.paddingBottom),r=parseFloat(n.borderTopWidth),s=parseFloat(n.borderBottomWidth);return t+o+r+s}};class Hc extends ve{constructor(e){super(Object.assign({},e))}init(){this._adapter.registerEvents()}destroy(){this._adapter.unregisterEvents()}}class Zc extends ve{constructor(e){super(Object.assign({},e))}init(){}destroy(){}}class qc extends ve{constructor(e){super(Object.assign({},e)),this.registerEvents=()=>{this._adapter.registerEvents(this.type)},this.unregisterEvents=()=>{this._adapter.unregisterEvents(this.type)},this.onResizeStart=(t,o,r)=>{this.type=r;let{clientX:s,clientY:l}=o,c=this._adapter.getItem(t),u=this._adapter.getItem(t+1),p,d;const m=this.window.getComputedStyle(c),f=this.window.getComputedStyle(u);p=Or(m,this.direction)+this.itemMinusMap.get(t),d=Or(f,this.direction)+this.itemMinusMap.get(t+1);let y=(this.direction==="horizontal"?c.offsetWidth:c.offsetHeight)+this.itemMinusMap.get(t),b=(this.direction==="horizontal"?u.offsetWidth:u.offsetHeight)+this.itemMinusMap.get(t+1);const x=this.getStates();this.setState({isResizing:!0,originalPosition:{x:s,y:l,lastItemSize:y,nextItemSize:b,lastOffset:p,nextOffset:d},backgroundStyle:Object.assign(Object.assign({},x.backgroundStyle),{cursor:this.window.getComputedStyle(o.target).cursor||"auto"}),curHandler:t}),this.registerEvents();let C=this._adapter.getItemStart(t),S=this._adapter.getItemStart(t+1),[k,_]=Hn(this.direction);C&&C(o,k),S&&S(o,_)},this.onMouseMove=t=>{this.onResizing(t)},this.onTouchMove=t=>{t.preventDefault(),this.onResizing(t)},this.onResizing=t=>{const o=this.getStates();if(!o.isResizing)return;const{curHandler:r,originalPosition:s}=o;let{x:l,y:c,lastItemSize:u,nextItemSize:p,lastOffset:d,nextOffset:m}=s,{clientX:f,clientY:y}=this.type==="mouse"?t:t.targetTouches[0];const b=this.getProps(),{direction:x}=b;let C=this._adapter.getItem(r),S=this._adapter.getItem(r+1),k=this.groupSize,_=x==="horizontal"?f-l:y-c,v=u+_,j=p-_,w=Xt(v,this._adapter.getItemMin(r),this._adapter.getItemMax(r),k,d),E=Xt(j,this._adapter.getItemMin(r+1),this._adapter.getItemMax(r+1),k,m);w&&(v=Zn(v,this._adapter.getItemMin(r),this._adapter.getItemMax(r),k,d),j=u+p-v),E&&(j=Zn(j,this._adapter.getItemMin(r+1),this._adapter.getItemMax(r+1),k,m),v=u+p-j);let O=this.itemPercentMap.get(r),D=this.itemPercentMap.get(r+1),P=v/k*100,N=O+D-P;this.itemPercentMap.set(r,P),this.itemPercentMap.set(r+1,N),x==="horizontal"?(C.style.width=`calc(${P}% - ${this.itemMinusMap.get(r)}px)`,S.style.width=`calc(${N}% - ${this.itemMinusMap.get(r+1)}px)`):x==="vertical"&&(C.style.height=`calc(${P}% - ${this.itemMinusMap.get(r)}px)`,S.style.height=`calc(${N}% - ${this.itemMinusMap.get(r+1)}px)`);let L=this._adapter.getItemChange(r),B=this._adapter.getItemChange(r+1),[Q,z]=Hn(this.direction);L&&L({width:C.offsetWidth,height:C.offsetHeight},t,Q),B&&B({width:S.offsetWidth,height:S.offsetHeight},t,z)},this.onResizeEnd=t=>{const{curHandler:o}=this.getStates();let r=this._adapter.getItem(o),s=this._adapter.getItem(o+1),l=this._adapter.getItemEnd(o),c=this._adapter.getItemEnd(o+1),[u,p]=Hn(this.direction);l&&l({width:r.offsetWidth,height:r.offsetHeight},t,u),c&&c({width:s.offsetWidth,height:s.offsetHeight},t,p),this.setState({isResizing:!1,curHandler:null}),this.unregisterEvents()},this.initSpace=()=>{const t=this.getProps(),{direction:o}=t;let r=new Array(this._adapter.getHandlerCount()).fill(0),s=this.groupSize;this.totalMinus=0;for(let d=0;d<this._adapter.getHandlerCount();d++){let m=o==="horizontal"?this._adapter.getHandler(d).offsetWidth:this._adapter.getHandler(d).offsetHeight;r[d]=m,this.totalMinus+=m}let l=0,c=new Map,u=0;for(let d=0;d<this._adapter.getItemCount();d++){d===0?this.itemMinusMap.set(d,r[d]/2):d===this._adapter.getItemCount()-1?this.itemMinusMap.set(d,r[d-1]/2):this.itemMinusMap.set(d,r[d-1]/2+r[d]/2);const m=this._adapter.getItem(d);let f=this._adapter.getItemMin(d),y=this._adapter.getItemMax(d),b=f?mt(f,s)/s*100:0,x=y?mt(y,s)/s*100:100;b>x&&console.warn("[Semi ResizableItem]: min size bigger than max size");let C=this._adapter.getItemDefaultSize(d);if(C){let S;if(typeof C=="string"){if(C.endsWith("%"))S=parseFloat(C.slice(0,-1)),this.itemPercentMap.set(d,S);else if(C.endsWith("px"))S=parseFloat(C.slice(0,-2))/s*100,this.itemPercentMap.set(d,S);else if(/^-?\d+(\.\d+)?$/.test(C)){c.set(d,parseFloat(C)),u+=parseFloat(C);continue}}else if(typeof C=="number"){c.set(d,C),u+=C;continue}l+=S,o==="horizontal"?m.style.width=`calc(${S}% - ${this.itemMinusMap.get(d)}px)`:m.style.height=`calc(${S}% - ${this.itemMinusMap.get(d)}px)`,S<b&&console.warn("[Semi ResizableGroup]: item size smaller than min size"),S>x&&console.warn("[Semi ResizableGroup]: item size bigger than max size")}else c.set(d,1),u+=1}let p=100-l;l>100&&(console.warn("[Semi ResizableGroup]: total Size bigger than 100%"),p=10),c.forEach((d,m)=>{const f=this._adapter.getItem(m),y=d/u*p;this.itemPercentMap.set(m,y),o==="horizontal"?f.style.width=`calc(${y}% - ${this.itemMinusMap.get(m)}px)`:f.style.height=`calc(${y}% - ${this.itemMinusMap.get(m)}px)`})},this.ensureConstraint=_o(()=>{const{direction:t}=this.getProps(),o=this._adapter.getItemCount();let r=!0;for(let s=0;s<o;s++){const l=this._adapter.getItem(s),c=t==="horizontal"?l.offsetWidth:l.offsetHeight;if(Xt(c,this._adapter.getItemMin(s),this._adapter.getItemMax(s),this.groupSize,this.itemMinusMap.get(s))){const p=Zn(c,this._adapter.getItemMin(s),this._adapter.getItemMax(s),this.groupSize,this.itemMinusMap.get(s));for(let d=s+1;d<o;d++){const m=this._adapter.getItem(d),f=t==="horizontal"?m.offsetWidth:m.offsetHeight;if(Xt(f,this._adapter.getItemMin(d),this._adapter.getItemMax(d),this.groupSize,this.itemMinusMap.get(d)))d===o-1&&(r=!1,console.warn("[Semi ResizableGroup]: no enough space to adjust min/max size"));else{let b=this.itemPercentMap.get(s),x=this.itemPercentMap.get(d),C=p/this.groupSize*100,S=b+x-C;this.itemPercentMap.set(s,C),this.itemPercentMap.set(d,S),t==="horizontal"?(l.style.width=`calc(${C}% - ${this.itemMinusMap.get(s)}px)`,m.style.width=`calc(${S}% - ${this.itemMinusMap.get(d)}px)`):(l.style.height=`calc(${C}% - ${this.itemMinusMap.get(s)}px)`,m.style.height=`calc(${S}% - ${this.itemMinusMap.get(d)}px)`);break}}}if(!r)break}},200)}get groupRef(){return this._adapter.getGroupRef()}get groupSize(){const{direction:e}=this.getProps();return e==="horizontal"?this.groupRef.offsetWidth:this.groupRef.offsetHeight}init(){this.direction=this.getProp("direction"),this.itemMinusMap=new Map,this.itemPercentMap=new Map,this.initSpace()}get window(){var e;return(e=this.groupRef.ownerDocument.defaultView)!==null&&e!==void 0?e:null}destroy(){}}const Ko={PREFIX:`${Re}-resizable`},gn=a.createContext(void 0),Gc=Ko.PREFIX;class Ot extends me{constructor(e){super(e),this.itemRef=a.createRef(),this.foundation=new Zc(this.adapter),this.state={isResizing:!1},this.itemIndex=-1}componentDidMount(){this.foundation.init();const{min:e,max:t,onResizeStart:o,onChange:r,onResizeEnd:s,defaultSize:l}=this.props;this.itemIndex===-1&&(this.itemIndex=this.context.registerItem(this.itemRef,e,t,l,o,r,s)),this.direction=this.context.direction}componentDidUpdate(e){var t,o;if(this.context.direction!==this.direction)if(this.direction=this.context.direction,this.direction==="horizontal"){const r=(t=this.itemRef.current)===null||t===void 0?void 0:t.style.height;this.itemRef.current.style.width=r,this.itemRef.current.style.removeProperty("height")}else{const r=(o=this.itemRef.current)===null||o===void 0?void 0:o.style.width;this.itemRef.current.style.height=r,this.itemRef.current.style.removeProperty("width")}}componentWillUnmount(){this.foundation.destroy()}get adapter(){return Object.assign({},super.adapter)}render(){const e=Object.assign({},this.props.style);return g.createElement("div",{style:e,className:I(this.props.className,Gc+"-item"),ref:this.itemRef},this.props.children)}}Ot.propTypes={style:h.object,className:h.string,min:h.string,max:h.string,children:h.object,onResizeStart:h.func,onChange:h.func,onResizeEnd:h.func,defaultSize:h.oneOfType([h.string,h.number])};Ot.defaultProps={onResizeStart:A,onChange:A,onResizeEnd:A};Ot.contextType=gn;const Pr=Ko.PREFIX;class yn extends me{constructor(e){super(e),this.onMouseDown=t=>{const{notifyResizeStart:o}=this.context;o(this.handlerIndex,t,"mouse")},this.onTouchStart=t=>{const{notifyResizeStart:o}=this.context;o(this.handlerIndex,t.targetTouches[0],"touch")},this.getHandler=()=>this.handlerRef.current,this.state={},this.handlerRef=a.createRef(),this.foundation=new Hc(this.adapter),this.handlerIndex=-1}componentDidMount(){this.foundation.init(),this.handlerIndex===-1&&(this.handlerIndex=this.context.registerHandler(this.handlerRef))}componentDidUpdate(e){}componentWillUnmount(){this.foundation.destroy()}get adapter(){return Object.assign(Object.assign({},super.adapter),{registerEvents:()=>{this.handlerRef.current.addEventListener("mousedown",this.onMouseDown),this.handlerRef.current.addEventListener("touchstart",this.onTouchStart)},unregisterEvents:()=>{this.handlerRef.current.removeEventListener("mousedown",this.onMouseDown),this.handlerRef.current.removeEventListener("touchstart",this.onTouchStart)}})}render(){const{style:e,className:t,children:o}=this.props,{direction:r}=this.context;return g.createElement("div",{className:I(t,Pr+"-handler",Pr+"-handler-"+r),style:e,ref:this.handlerRef},o??g.createElement(nl,{size:"inherit",style:{rotate:this.context.direction==="horizontal"?"0deg":"90deg"}}))}}yn.propTypes={children:h.node,direction:h.string,onResizeStart:h.func,className:h.string,disabled:h.bool,style:h.object};yn.defaultProps={};yn.contextType=gn;var Qc=function(n,e){var t={};for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&e.indexOf(o)<0&&(t[o]=n[o]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(n);r<o.length;r++)e.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(n,o[r])&&(t[o[r]]=n[o[r]]);return t};const _r=Ko.PREFIX;class bn extends me{constructor(e){var t;super(e),t=this,this.itemRefs=new Map,this.itemMinMap=new Map,this.itemMaxMap=new Map,this.itemMinusMap=new Map,this.itemDefaultSizeList=new Map,this.itemResizeStart=new Map,this.itemResizing=new Map,this.itemResizeEnd=new Map,this.handlerRefs=new Map,this.registerEvent=function(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"mouse";t.window&&(o==="mouse"?(t.window.addEventListener("mousemove",t.foundation.onMouseMove),t.window.addEventListener("mouseup",t.foundation.onResizeEnd),t.window.addEventListener("mouseleave",t.foundation.onResizeEnd)):(t.window.addEventListener("touchmove",t.foundation.onTouchMove,{passive:!1}),t.window.addEventListener("touchend",t.foundation.onResizeEnd),t.window.addEventListener("touchcancel",t.foundation.onResizeEnd)))},this.unregisterEvent=function(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"mouse";t.window&&(o==="mouse"?(t.window.removeEventListener("mousemove",t.foundation.onMouseMove),t.window.removeEventListener("mouseup",t.foundation.onResizeEnd),t.window.removeEventListener("mouseleave",t.foundation.onResizeEnd)):(t.window.removeEventListener("touchmove",t.foundation.onTouchMove,{passive:!1}),t.window.removeEventListener("touchend",t.foundation.onResizeEnd),t.window.removeEventListener("touchcancel",t.foundation.onResizeEnd)))},this.registerItem=(o,r,s,l,c,u,p)=>{if(Array.from(this.itemRefs.values()).some(m=>m===o))return-1;let d=this.itemRefs.size;return this.itemRefs.set(d,o),this.itemMinMap.set(d,r),this.itemMaxMap.set(d,s),this.itemDefaultSizeList.set(d,l),this.itemResizeStart.set(d,c),this.itemResizing.set(d,u),this.itemResizeEnd.set(d,p),d},this.registerHandler=o=>{if(Array.from(this.handlerRefs.values()).some(s=>s===o))return-1;let r=this.handlerRefs.size;return this.handlerRefs.set(r,o),r},this.getGroupSize=()=>this.groupSize,this.groupRef=a.createRef(),this.foundation=new qc(this.adapter),this.state={isResizing:!1,originalPosition:{x:0,y:0,lastItemSize:0,nextItemSize:0,lastOffset:0,nextOffset:0},backgroundStyle:{cursor:"auto"},curHandler:null,contextValue:{direction:e.direction,registerItem:this.registerItem,registerHandler:this.registerHandler,notifyResizeStart:this.foundation.onResizeStart,getGroupSize:this.getGroupSize}}}componentDidMount(){this.foundation.init(),window.addEventListener("resize",this.foundation.ensureConstraint)}componentDidUpdate(e){this.props.direction!==e.direction&&(this.setState(t=>Object.assign(Object.assign({},t),{contextValue:Object.assign(Object.assign({},t.contextValue),{direction:this.props.direction})})),this.foundation.direction=this.props.direction)}componentWillUnmount(){this.foundation.destroy(),window.removeEventListener("resize",this.foundation.ensureConstraint)}get adapter(){return Object.assign(Object.assign({},super.adapter),{getGroupRef:()=>this.groupRef.current,getItem:e=>this.itemRefs.get(e).current,getItemCount:()=>this.itemRefs.size,getHandler:e=>this.handlerRefs.get(e).current,getHandlerCount:()=>this.handlerRefs.size,getItemMin:e=>this.itemMinMap.get(e),getItemMax:e=>this.itemMaxMap.get(e),getItemChange:e=>this.itemResizing.get(e),getItemEnd:e=>this.itemResizeEnd.get(e),getItemStart:e=>this.itemResizeStart.get(e),getItemDefaultSize:e=>this.itemDefaultSizeList.get(e),registerEvents:this.registerEvent,unregisterEvents:this.unregisterEvent})}get window(){var e;return(e=this.groupRef.current.ownerDocument.defaultView)!==null&&e!==void 0?e:null}render(){const e=this.props,{children:t,direction:o,className:r}=e,s=Qc(e,["children","direction","className"]);return g.createElement(gn.Provider,{value:this.state.contextValue},g.createElement("div",Object.assign({style:{flexDirection:o==="vertical"?"column":"row"},ref:this.groupRef,className:I(r,_r+"-group")},s),this.state.isResizing&&g.createElement("div",{style:this.state.backgroundStyle,className:I(r,_r+"-background")}),t))}}bn.propTypes={};bn.defaultProps={direction:"horizontal"};bn.contextType=gn;var Yc=Object.defineProperty,Mr=Object.getOwnPropertySymbols,Xc=Object.prototype.hasOwnProperty,Jc=Object.prototype.propertyIsEnumerable,Lr=(n,e,t)=>e in n?Yc(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,ed=(n,e)=>{for(var t in e||(e={}))Xc.call(e,t)&&Lr(n,t,e[t]);if(Mr)for(var t of Mr(e))Jc.call(e,t)&&Lr(n,t,e[t]);return n};function td(n){return a.createElement("svg",ed({width:200,height:200,viewBox:"0 0 200 200",fill:"none",xmlns:"http://www.w3.org/2000/svg",focusable:!1,"aria-hidden":!0},n),a.createElement("path",{d:"M74.7 78.6c20.78-6.32 57.55-12.26 71.81-9.86 4.21.7 8.12 1.98 11.36 3.42-.51-1.69-.95-3.5-1.38-5.3l-.04-.18c-1.03-4.27-2.05-8.44-3.95-10.55-4.8-5.32.67-10.12.67-10.12l.93-10.53c13.02 4.82 21.65 14.92 27 25.08 4.57 8.67 6.75 17.37 7.25 22.89 1.06 12-8.18 18.86-19.2 18.86-9.74 0-18.36-1.64-24.81-3.1.64 2.18 5.44 19.18 7.53 32.66l-46.15.58-7.58-14.68-4.66-12.26c-19.46 7.46-50.77 19.02-64.9 18.44-10.35-.42-15.68-15.68-17.44-28.7a71.55 71.55 0 0 1-.67-9.4c0-5.64.3-12.18 2.22-17.89.74-2.21 1.73-4.3 3.04-6.17a18.1 18.1 0 0 1 4.6-4.59c0 4-1.02 13.54 2.8 14.12 5.06.78 10.4-9.08 13.85-7.06 3.87 2.27-1.65 16.34-1.33 17.2.27.7.53 1.4.76 2.07a48.99 48.99 0 0 1 2.25 8.55C46.59 87.56 60 83.06 74.69 78.6Z",fill:"#C6CACD"}),a.createElement("path",{d:"M181.1 60.56c4.57 8.67 6.75 17.37 7.25 22.89 1.06 12-8.18 18.86-19.2 18.86-9.74 0-18.36-1.64-24.81-3.1m36.77-38.65c-5.36-10.16-13.99-20.26-27-25.08l-.94 10.53s-5.46 4.8-.67 10.12c1.9 2.11 2.92 6.28 3.95 10.55m24.66-6.12c-6-.37-18.32.8-24.66 6.12m0 0c1.57 6.53 3.15 13.3 7.91 13.3 7.2 0-3.6-8.84-17.85-11.24-14.25-2.4-51.03 3.54-71.82 9.86-20.78 6.32-39.04 12.71-42.77 19.1-3.63 6.23 13.24 10.92 4.49-14.17m0 0c-.23-.67-.49-1.36-.76-2.08-.32-.85 5.2-14.92 1.33-17.19-3.45-2.02-8.8 7.84-13.85 7.06-3.82-.58-2.8-10.12-2.8-14.12a18.1 18.1 0 0 0-4.6 4.6M36.4 83.52c-7.27 1.58-21.92 8.1-25.27 11.73m0 0a71.55 71.55 0 0 1-.67-9.41c0-5.64.3-12.18 2.22-17.89m-1.55 27.3c1.76 13 7.09 28.27 17.45 28.7 14.12.57 45.43-10.99 64.89-18.45l4.66 12.26 7.58 14.68 46.15-.58c-2.09-13.48-6.89-30.48-7.53-32.67M15.73 61.8c-.98 3-1.08 5.5.19 7.8m-.2-7.8a24.08 24.08 0 0 0-3.03 6.16m0 0a5.43 5.43 0 0 0 1.25 4.22m130.4 27.02c-.9-3.08-3.12-9.95-4.76-12.76",stroke:"#1C1F23"}),a.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m156.89 15.66-2.04 27.96 2.57 28.1c-7.51-3.07-13.32-4.34-27.25-3.36-11.94.83-31.75 3.95-46.23 7.62-16.66 4.27-37.81 11.64-45.21 15.9-.77-4.64-2.92-10.15-2.92-10.15-.07-.7 2.63-8.32 2.73-13.06.08-3.08-.91-4.45-2.33-4.75a3.47 3.47 0 0 0-2.05.35c-.63.32-.86.48-1.38.84-1.34.98-2.38 2.02-3.95 3.34a17.14 17.14 0 0 1-3.04 2.17 4.6 4.6 0 0 1-2.89.63c-.63-.1-1.21-.47-1.71-1.58l-.07-.89c-.5-5.79-2.7-20.12-2.7-34.91 0-7.74 1.61-10.04 2.7-11.59l.13-.18c3.85-5.53 13.67-6.75 23.12-6.96 2.5-.14 5.2-.2 8.1-.17l.11.15H53.15l-.52.07 18.32 25.49-3.62 14.08 10.2 15.98-2.84-16.49 10-11.99-3.5-27.7s8.78-.5 19.47-1.77c10.69-1.28 18.47-1.9 29.42-1.83 1.64.01 3.4.1 5.23.22 9.64.65 18.55 2.56 21.46 4.4l.13.09h-.01Z",fill:"var(--semi-color-primary)",fillOpacity:.2}),a.createElement("path",{d:"M143 27.91a1.38 1.38 0 0 1 1.77-.85c.5.17.98.41 1.44.71a1.38 1.38 0 0 1-1.53 2.31c-.26-.17-.53-.3-.82-.4a1.38 1.38 0 0 1-.85-1.77Z",fill:"var(--semi-color-primary)"}),a.createElement("path",{d:"M140.65 28.12c.21.74-.21 1.5-.95 1.71-.36.1-.73.23-1.11.37a1.38 1.38 0 1 1-.95-2.6c.43-.16.87-.3 1.3-.43.74-.2 1.5.22 1.71.95Z",fill:"var(--semi-color-primary)"}),a.createElement("path",{d:"M134.74 30.4c.37.67.14 1.51-.53 1.89l-1.07.62a1.38 1.38 0 1 1-1.41-2.38l1.12-.65a1.38 1.38 0 0 1 1.89.52Z",fill:"var(--semi-color-primary)"}),a.createElement("path",{d:"M97.86 31.43h.76a1.38 1.38 0 1 1-.06 2.77h-.52a6.7 6.7 0 0 0-.57.1 1.38 1.38 0 1 1-.64-2.68c.33-.08.64-.14.94-.18l.09-.01Z",fill:"var(--semi-color-primary)"}),a.createElement("path",{d:"M147.78 31.75c.73-.23 1.5.19 1.72.92.13.42.25.88.35 1.35a1.38 1.38 0 0 1-2.7.58c-.1-.4-.19-.78-.3-1.13-.22-.73.2-1.5.93-1.72Z",fill:"var(--semi-color-primary)"}),a.createElement("path",{d:"M102.27 33.13c.19-.75.94-1.2 1.68-1.01.45.11.89.23 1.3.37a1.38 1.38 0 0 1-.84 2.63c-.36-.11-.73-.22-1.13-.32a1.38 1.38 0 0 1-1-1.67Z",fill:"var(--semi-color-primary)"}),a.createElement("path",{d:"M129.3 33.68c.42.64.25 1.5-.4 1.92l-.52.34-.53.36a1.38 1.38 0 0 1-1.53-2.31l.32-.21.21-.14.3-.2.23-.15c.64-.42 1.5-.25 1.92.39Z",fill:"var(--semi-color-primary)"}),a.createElement("path",{d:"M108.25 35.22c.36-.67 1.2-.92 1.88-.55a246.5 246.5 0 0 1 1.11.61 1.38 1.38 0 0 1-1.33 2.43l-.5-.28h-.01l-.6-.34a1.38 1.38 0 0 1-.55-1.87Z",fill:"var(--semi-color-primary)"}),a.createElement("path",{d:"M92.83 35.77c.76-.01 1.4.6 1.4 1.36.01.16.03.34.07.54a1.38 1.38 0 1 1-2.7.58 5.62 5.62 0 0 1-.13-1.07c-.01-.76.6-1.4 1.36-1.4Z",fill:"var(--semi-color-primary)"}),a.createElement("path",{d:"M124 37.2c.31.7 0 1.51-.7 1.82a6.07 6.07 0 0 1-1.44.45 1.38 1.38 0 1 1-.67-2.68l.58-.16c.1-.03.24-.07.42-.15.7-.3 1.51.02 1.82.72Z",fill:"var(--semi-color-primary)"}),a.createElement("path",{d:"M113.9 38.14c.15-.75.89-1.22 1.63-1.07.35.08.72.14 1.1.17a1.38 1.38 0 0 1-.26 2.76c-.49-.05-.96-.12-1.41-.22a1.38 1.38 0 0 1-1.07-1.64Z",fill:"var(--semi-color-primary)"}),a.createElement("path",{d:"M148.98 37.95c.76-.01 1.4.6 1.4 1.36a38.45 38.45 0 0 1 0 1.42 1.38 1.38 0 0 1-2.77-.08 24.28 24.28 0 0 0 0-1.3c0-.76.6-1.39 1.37-1.4Z",fill:"var(--semi-color-primary)"}),a.createElement("path",{d:"M148.6 44.88c.75.16 1.22.9 1.06 1.65-.1.47-.22.94-.34 1.41a1.38 1.38 0 1 1-2.68-.7c.12-.43.22-.87.31-1.3.17-.75.9-1.22 1.65-1.06Z",fill:"var(--semi-color-primary)"}),a.createElement("path",{d:"M146.69 51.6c.7.31 1 1.13.7 1.83-.2.44-.41.88-.63 1.31a1.38 1.38 0 0 1-2.48-1.24c.2-.4.4-.8.58-1.2.31-.7 1.13-1.01 1.83-.7Z",fill:"var(--semi-color-primary)"}),a.createElement("path",{d:"M41.67 55.45c.07.76-.5 1.44-1.25 1.5-.43.04-.86.1-1.26.19a1.38 1.38 0 0 1-.54-2.72c.5-.1 1.02-.17 1.55-.22.76-.07 1.43.5 1.5 1.25Z",fill:"var(--semi-color-primary)"}),a.createElement("path",{d:"M44.58 55.78c.22-.73 1-1.15 1.72-.93l.74.23a1.38 1.38 0 1 1-.9 2.62l-.62-.2a1.38 1.38 0 0 1-.94-1.72Z",fill:"var(--semi-color-primary)"}),a.createElement("path",{d:"M91.9 56.9c.05.76-.52 1.41-1.29 1.46-.44.03-.89.07-1.32.12a1.38 1.38 0 0 1-.31-2.75c.48-.05.96-.1 1.45-.13.77-.05 1.42.53 1.47 1.3Z",fill:"var(--semi-color-primary)"}),a.createElement("path",{d:"M94.72 56.95c.07-.76.74-1.33 1.5-1.26l1.43.14a1.38 1.38 0 1 1-.32 2.75c-.45-.05-.9-.1-1.35-.13a1.38 1.38 0 0 1-1.26-1.5Z",fill:"var(--semi-color-primary)"}),a.createElement("path",{d:"M101.64 57.83c.16-.75.9-1.22 1.64-1.07l1.39.3a1.38 1.38 0 1 1-.62 2.7l-1.34-.29a1.38 1.38 0 0 1-1.07-1.64Z",fill:"var(--semi-color-primary)"}),a.createElement("path",{d:"M34.85 57.26c.48.6.39 1.46-.2 1.94-.33.27-.63.55-.9.84a1.38 1.38 0 0 1-2.03-1.89c.36-.39.76-.76 1.18-1.1.6-.48 1.46-.39 1.95.2Z",fill:"var(--semi-color-primary)"}),a.createElement("path",{d:"M85 57.9c.29.71-.06 1.51-.78 1.8a15.8 15.8 0 0 0-1.26.54 1.38 1.38 0 1 1-1.15-2.52 74.1 74.1 0 0 1 1.4-.6c.71-.28 1.52.07 1.8.78Z",fill:"var(--semi-color-primary)"}),a.createElement("path",{d:"M143.4 57.76c.61.47.72 1.34.26 1.94-.3.4-.62.78-.94 1.15a1.38 1.38 0 0 1-2.09-1.81 24 24 0 0 0 .84-1.03c.47-.6 1.33-.71 1.94-.25Z",fill:"var(--semi-color-primary)"}),a.createElement("path",{d:"M108.43 59.46c.22-.74.99-1.15 1.72-.93l1.35.4a1.38 1.38 0 1 1-.82 2.65l-1.32-.4a1.38 1.38 0 0 1-.93-1.72Z",fill:"var(--semi-color-primary)"}),a.createElement("path",{d:"M115.08 61.58a1.38 1.38 0 0 1 1.77-.83l1.32.5a1.38 1.38 0 0 1-.97 2.58l-1.3-.48a1.38 1.38 0 0 1-.82-1.77Z",fill:"var(--semi-color-primary)"}),a.createElement("path",{d:"M138.67 62.89c.42.64.25 1.5-.4 1.92-.41.27-.85.54-1.29.78a1.38 1.38 0 0 1-1.32-2.43c.37-.2.73-.43 1.1-.66.63-.42 1.49-.25 1.91.39Z",fill:"var(--semi-color-primary)"}),a.createElement("path",{d:"M30.5 62.78c.77.07 1.33.74 1.26 1.5l-.03.59.01.75-1.6 1.4a1.38 1.38 0 0 1-1.16-1.32l-.02-.83c0-.28.02-.56.04-.84.07-.76.75-1.32 1.5-1.25Z",fill:"var(--semi-color-primary)"}),a.createElement("path",{d:"M121.6 64.07c.3-.7 1.1-1.04 1.8-.75a135.68 135.68 0 0 1 1.26.52 1.38 1.38 0 1 1-.97 2.59 19.62 19.62 0 0 1-1.35-.55c-.7-.3-1.04-1.1-.74-1.81Z",fill:"var(--semi-color-primary)"}),a.createElement("path",{d:"M72.11 64.94c.48.6.4 1.47-.2 1.95-.38.3-.74.61-1.09.92A1.38 1.38 0 1 1 69 65.73c.37-.33.76-.66 1.17-.99.59-.48 1.46-.4 1.94.2Z",fill:"var(--semi-color-primary)"}),a.createElement("path",{d:"M132.4 65.92c.09.76-.46 1.44-1.22 1.53-.5.05-1.02.08-1.53.09a1.38 1.38 0 1 1-.02-2.77c.42 0 .84-.03 1.25-.07.76-.09 1.44.46 1.53 1.22Z",fill:"var(--semi-color-primary)"}),a.createElement("path",{d:"M66.66 69.9c.57.52.6 1.4.09 1.96l-.73.8-.02.02-.16.18-.08.09a1.38 1.38 0 0 1-2.05-1.86l.25-.28.75-.82c.51-.56 1.39-.6 1.95-.09Z",fill:"var(--semi-color-primary)"}),a.createElement("path",{d:"M61.6 75.28c.45.61.31 1.48-.3 1.93-.44.31-.88.61-1.36.89a1.38 1.38 0 1 1-1.4-2.4c.4-.22.77-.46 1.12-.73a1.38 1.38 0 0 1 1.94.3Z",fill:"var(--semi-color-primary)"}),a.createElement("path",{d:"M37.67 75.97c.42.19.86.36 1.35.53a1.38 1.38 0 0 1-.89 2.62c-.56-.19-1.1-.4-1.6-.63l.72-2.63c.14.01.28.05.42.11Z",fill:"var(--semi-color-primary)"}),a.createElement("path",{d:"M55.05 78.57c.12.75-.4 1.46-1.15 1.58-.5.08-1 .15-1.54.2a1.38 1.38 0 0 1-.28-2.75c.49-.05.95-.11 1.39-.18.75-.12 1.46.4 1.58 1.15Z",fill:"var(--semi-color-primary)"}),a.createElement("path",{d:"M43.4 78.87c.06-.76.73-1.33 1.49-1.27a38.43 38.43 0 0 0 1.5.1 1.38 1.38 0 1 1-.12 2.76 62.94 62.94 0 0 1-1.6-.1 1.38 1.38 0 0 1-1.27-1.5Z",fill:"var(--semi-color-primary)"}),a.createElement("g",{clipPath:"url(#clip_failure_dark_46_27)"},a.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M30.9 46.87a13.45 13.45 0 0 1 9.37-16.53 13.45 13.45 0 0 1 16.52 9.39c2.64 9.56-4.77 29.27-5.14 29.9a.75.75 0 0 1-.99.27c-.64-.34-17.11-13.47-19.76-23.03Zm14.36 1.54a6.1 6.1 0 0 1-3.25-11.75 6.1 6.1 0 0 1 3.25 11.75Z",fill:"var(--semi-color-primary)"})),a.createElement("path",{d:"M102.31 100.69c-2.8 1.55-5.63 2.85-9.36 4.58l1.48 3.92c2.14-.96 6.16-6.03 7.88-8.5Z",fill:"#1C1F23"}),a.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M121 63.04c8.85 2.1 12.43-6.5 13.12-8.77.68-2.27-5.6-11.86-8-11.2-.13.05-.3.09-.47.13l-.18.05-1.37.37c-3.64 1.03-9.93 3.2-10.98 7.63-1.3 5.46 2.4 10.49 7.88 11.79Z",fill:"#1C1F23"}),a.createElement("path",{d:"M134.5 64.73c-.43.47-1.2.74-2.33.73a12.7 12.7 0 0 1-4.06-.86 31.25 31.25 0 0 1-9.94-6.22c-3.25-2.97-5.97-5.8-7.59-8.42-1.61-2.61-2.05-4.89-.98-6.84a3.7 3.7 0 0 1 2.11-1.86 4.53 4.53 0 0 1 2.9.15c2.16.76 4.57 2.83 6.48 6.01 3.4 5.64 6.89 8.24 9.7 10.33.49.36.95.7 1.38 1.04a7.3 7.3 0 0 1 2.61 3.48c.34 1.1.16 1.97-.28 2.46Z",fill:"#C6CACD",stroke:"#1C1F23"}),a.createElement("mask",{id:"mask_failure_dark_130_527","mask-type":"alpha",maskUnits:"userSpaceOnUse",x:101,y:47,width:30,height:22},a.createElement("path",{d:"M130.53 62.1c-.5-3.3-9.52-14.75-16.08-15.03l-12.68 4.52 6.47 14.16 17.25 3.07c1.84-1.14 5.43-4.07 5.04-6.72Z",fill:"#C4C4C4"})),a.createElement("g",{mask:"url(#mask_failure_dark_130_527)"},a.createElement("path",{d:"M127.2 63.62a9.74 9.74 0 0 1-13.76.5 9.74 9.74 0 0 1-.32-13.78 9.74 9.74 0 0 1 13.77-.49 9.74 9.74 0 0 1 .32 13.77Z",fill:"#C6CACD",stroke:"#1C1F23"}),a.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m116.79 47.35-.02.37c2.86.5 8.57 2.59 8.58 6.87 0 5.36-7.44 9.34-14.47 3.46-.34-.28-.66-.53-.95-.74a10.09 10.09 0 0 0 3.17 7.17 10.24 10.24 0 0 0 14.47-.52 10.24 10.24 0 0 0-.34-14.47 10.16 10.16 0 0 0-10.44-2.14Z",fill:"#1C1F23"}),a.createElement("path",{d:"M119.34 55a.79.79 0 1 0-1.1-1.12.79.79 0 0 0 1.1 1.12Z",fill:"#1C1F23"}),a.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M119.98 50.72c.21-.09.45.01.54.22a7.86 7.86 0 0 0 1.84 2.65.41.41 0 0 1-.55.62 8.67 8.67 0 0 1-2.05-2.95.41.41 0 0 1 .22-.54Z",fill:"#1C1F23"}),a.createElement("path",{d:"M114.85 52.4a.79.79 0 1 0-1.1-1.11.79.79 0 0 0 1.1 1.12Z",fill:"#1C1F23"}),a.createElement("mask",{id:"path-15-inside-1",fill:"white"},a.createElement("ellipse",{rx:2.97818,ry:2.97818,transform:"matrix(0.727696 0.6859 -0.685903 0.727693 128.435 60.0508)"})),a.createElement("ellipse",{rx:2.97818,ry:2.97818,transform:"matrix(0.727696 0.6859 -0.685903 0.727693 128.435 60.0508)",fill:"#C6CACD"}),a.createElement("path",{d:"m128.42 60.04.01-.01a.03.03 0 0 1 .02 0l-4.12 4.37a5.98 5.98 0 0 0 8.45-.25l-4.36-4.11Zm.03 0v.02l-4.37-4.11a5.98 5.98 0 0 0 .25 8.45l4.12-4.37Zm0 .03h-.03l4.12-4.37a5.98 5.98 0 0 0-8.46.25l4.37 4.12Zm-.03 0v-.03l4.37 4.11a5.98 5.98 0 0 0-.25-8.45l-4.12 4.37Z",fill:"#1C1F23",mask:"url(#path-15-inside-1)"})),a.createElement("path",{d:"M145.63 40.19c1.37-2.75 12.75 2.35 16.14 6.78 3.38 4.43 1.48 10.74-1.9 9.68-6.69-2.12-7.56-6.7-7.94-9.48-1.2-1.85-7.67-4.24-6.3-6.98Z",fill:"#C6CACD",stroke:"#1C1F23"}),a.createElement("path",{d:"m158.95 41.56 6.64 2.52 1.66 12.47-8.3 1.98-3.47-12.03 3.47-4.94Z",fill:"#C6CACD"}),a.createElement("path",{d:"M167.3 151.94c5.19 1.66 23.35 35.57 19.05 35.57-13.86 0-34.5.53-71.42.53-15.63 0-17.9-5.16-11.79-22.08a353.23 353.23 0 0 1 6.14-15.76l32.5 1.26c-.43 1.53-.91 3.07-1.38 4.4a26.82 26.82 0 0 1 8.73-1.47c5.27 0 7.04 1.4 11.77 0 2.13-.62 4.8-2.97 6.4-2.45Z",fill:"#C6CACD"}),a.createElement("path",{d:"M140.4 155.87c.47-1.34.95-2.88 1.38-4.4l-32.5-1.27a353.23 353.23 0 0 0-6.14 15.76c-6.1 16.92-3.84 22.08 11.79 22.08 36.93 0 57.56-.53 71.42-.53 4.3 0-13.86-33.91-19.06-35.57-1.6-.52-4.26 1.83-6.4 2.45-4.72 1.4-6.5 0-11.76 0-3.08 0-6.06.55-8.72 1.48Zm0 0a26.67 26.67 0 0 1-4.44 8.38c-1.7 2.22-3.99 4.43-5.43 4.33-1.44-.1-1.42-3.18 0-5.66 1.97-3.44 6.45-5.87 9.88-7.05Z",stroke:"#1C1F23"}),a.createElement("path",{d:"M149.25 131.7s3.36 19.46-12.34 21.04c-11.53 1.15-40.77-4.55-53.76-7.79 4.72 12.82 9.61 39.86 7 42.16-3.33 2.93-47.55 1.76-55.96 0-8.42-1.75 13.82-11.46 15.45-14.66 2.99-5.84-5.48-21.18-5.75-45.45-.27-24.27 18.18-24.86 34.47-21.64 13.02 2.57 41.63 18.33 52.56 26.86l18.33-.52Z",fill:"#C6CACD",stroke:"#1C1F23"}),a.createElement("path",{d:"M141.5 153.87c-3.11 2.55-27.72 5-35.58 3.53l2.75-6.8c20.23 2.85 28.08 3.34 33.46 1.16l-.63 2.11Z",fill:"#1C1F23"}),a.createElement("path",{d:"M126.02 142.7c-3.1-2.99-5-7.5-4.16-12.35",stroke:"#1C1F23"}),a.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M130.6 95.65c-9.03-10.98-18.97-19.74-25.5-24.56l1.63-2.22c6.7 4.95 16.81 13.86 26 25.02 9.18 11.16 17.54 24.67 20.59 38.83l-2.7.59c-2.91-13.56-10.97-26.67-20.02-37.66Z",fill:"#1C1F23"}),a.createElement("path",{d:"m149.12 107.09-16.36 13.2 22.27 17.8 8.87-19.19c-.14-3.93-2.34-5.34-5.83-4.66l-3.12-2.5c.08-3.5-2.18-5.64-5.83-4.65Z",fill:"#6B7075"}),a.createElement("path",{d:"m148.24 128.62 9.45-14.34-2.91-2.33-10.94 13.07 4.4 3.6Z",stroke:"#1C1F23"}),a.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M143.67 127.98a6.93 6.93 0 1 1-10.82-8.66 6.93 6.93 0 0 1 10.82 8.66Zm12.28 9.82a6.93 6.93 0 1 1-10.82-8.65 6.93 6.93 0 0 1 10.82 8.65Z",fill:"#1C1F23"}),a.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m133.43 123.46 9.21-1.8.32 1.61-9.2 1.81-.33-1.62Z",fill:"#C6CACD"}),a.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m145.5 133.11 9.21-1.8.32 1.62-9.2 1.8-.33-1.62Z",fill:"#C6CACD"}),a.createElement("defs",null,a.createElement("clipPath",{id:"clip_failure_dark_46_27"},a.createElement("rect",{width:44.4004,height:44.4627,fill:"white",transform:"matrix(0.963965 -0.266028 0.266198 0.963918 18.4214 34.6221)"}))))}var nd=td,od=Object.defineProperty,Ir=Object.getOwnPropertySymbols,rd=Object.prototype.hasOwnProperty,sd=Object.prototype.propertyIsEnumerable,Tr=(n,e,t)=>e in n?od(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,id=(n,e)=>{for(var t in e||(e={}))rd.call(e,t)&&Tr(n,t,e[t]);if(Ir)for(var t of Ir(e))sd.call(e,t)&&Tr(n,t,e[t]);return n};function ad(n){return a.createElement("svg",id({width:200,height:200,viewBox:"0 0 200 200",fill:"none",xmlns:"http://www.w3.org/2000/svg",focusable:!1,"aria-hidden":!0},n),a.createElement("rect",{width:200,height:200,fill:"transparent"}),a.createElement("path",{d:"M74.7 78.6c20.78-6.32 57.55-12.26 71.81-9.86 4.21.7 8.12 1.98 11.36 3.42-.51-1.69-.95-3.5-1.38-5.3l-.04-.18c-1.03-4.27-2.05-8.44-3.95-10.55-4.8-5.32.67-10.12.67-10.12l.93-10.53c13.02 4.82 21.65 14.92 27 25.08 4.57 8.67 6.75 17.37 7.25 22.89 1.06 12-8.18 18.86-19.2 18.86-9.74 0-18.36-1.64-24.81-3.1.64 2.18 5.44 19.18 7.53 32.66l-46.15.58-7.58-14.68-4.66-12.26c-19.46 7.46-50.77 19.02-64.9 18.44-10.35-.42-15.68-15.68-17.44-28.7a71.55 71.55 0 0 1-.67-9.4c0-5.64.3-12.18 2.22-17.89.74-2.21 1.73-4.3 3.04-6.17a18.1 18.1 0 0 1 4.6-4.59c0 4-1.02 13.54 2.8 14.12 5.06.78 10.4-9.08 13.85-7.06 3.87 2.27-1.65 16.34-1.33 17.2.27.7.53 1.4.76 2.07a48.99 48.99 0 0 1 2.25 8.55C46.59 87.56 60 83.06 74.69 78.6Z",fill:"white"}),a.createElement("path",{d:"M181.1 60.56c4.57 8.67 6.75 17.37 7.25 22.89 1.06 12-8.18 18.86-19.2 18.86-9.74 0-18.36-1.64-24.81-3.1m36.77-38.65c-5.36-10.16-13.99-20.26-27-25.08l-.94 10.53s-5.46 4.8-.67 10.12c1.9 2.11 2.92 6.28 3.95 10.55m24.66-6.12c-6-.37-18.32.8-24.66 6.12m0 0c1.57 6.53 3.15 13.3 7.91 13.3 7.2 0-3.6-8.84-17.85-11.24-14.25-2.4-51.03 3.54-71.82 9.86-20.78 6.32-39.04 12.71-42.77 19.1-3.63 6.23 13.24 10.92 4.49-14.17m0 0c-.23-.67-.49-1.36-.76-2.08-.32-.85 5.2-14.92 1.33-17.19-3.45-2.02-8.8 7.84-13.85 7.06-3.82-.58-2.8-10.12-2.8-14.12a18.1 18.1 0 0 0-4.6 4.6M36.4 83.52c-7.27 1.58-21.92 8.1-25.27 11.73m0 0a71.55 71.55 0 0 1-.67-9.41c0-5.64.3-12.18 2.22-17.89m-1.55 27.3c1.76 13 7.09 28.27 17.45 28.7 14.12.57 45.43-10.99 64.89-18.45l4.66 12.26 7.58 14.68 46.15-.58c-2.09-13.48-6.89-30.48-7.53-32.67M15.73 61.8c-.98 3-1.08 5.5.19 7.8m-.2-7.8a24.08 24.08 0 0 0-3.03 6.16m0 0a5.43 5.43 0 0 0 1.25 4.22m130.4 27.02c-.9-3.08-3.12-9.95-4.76-12.76",stroke:"#515151"}),a.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m156.89 15.66-2.04 27.96 2.57 28.1c-7.51-3.07-13.32-4.34-27.25-3.36-11.94.83-31.75 3.95-46.23 7.62-16.66 4.27-37.81 11.64-45.21 15.9-.77-4.64-2.92-10.15-2.92-10.15-.07-.7 2.63-8.32 2.73-13.06.08-3.08-.91-4.45-2.33-4.75a3.47 3.47 0 0 0-2.05.35c-.63.32-.86.48-1.38.84-1.34.98-2.38 2.02-3.95 3.34a17.14 17.14 0 0 1-3.04 2.17 4.6 4.6 0 0 1-2.89.63c-.63-.1-1.21-.47-1.71-1.58l-.07-.89c-.5-5.79-2.7-20.12-2.7-34.91 0-7.74 1.61-10.04 2.7-11.59l.13-.18c3.85-5.53 13.67-6.75 23.12-6.96 2.5-.14 5.2-.2 8.1-.17l.11.15H53.15l-.52.07 18.32 25.49-3.62 14.08 10.2 15.98-2.84-16.49 10-11.99-3.5-27.7s8.78-.5 19.47-1.77c10.69-1.28 18.47-1.9 29.42-1.83 1.64.01 3.4.1 5.23.22 9.64.65 18.55 2.56 21.46 4.4l.13.09h-.01Z",fill:"var(--semi-color-primary-light-default)"}),a.createElement("path",{d:"M143 27.91a1.38 1.38 0 0 1 1.77-.85c.5.18.98.41 1.44.71a1.38 1.38 0 0 1-1.53 2.31c-.26-.17-.53-.3-.82-.4a1.38 1.38 0 0 1-.85-1.77Z",fill:"var(--semi-color-primary)"}),a.createElement("path",{d:"M140.65 28.12c.21.74-.21 1.5-.95 1.72-.36.1-.73.22-1.11.36a1.38 1.38 0 1 1-.95-2.6c.43-.16.87-.3 1.3-.43.74-.2 1.5.22 1.71.95Z",fill:"var(--semi-color-primary)"}),a.createElement("path",{d:"M134.74 30.4c.37.67.14 1.51-.53 1.89l-1.07.62a1.38 1.38 0 1 1-1.41-2.38l1.12-.65a1.38 1.38 0 0 1 1.89.52Z",fill:"var(--semi-color-primary)"}),a.createElement("path",{d:"M97.86 31.43h.76a1.38 1.38 0 1 1-.06 2.77h-.52a6.7 6.7 0 0 0-.57.1 1.38 1.38 0 0 1-.64-2.68c.33-.08.64-.14.94-.18l.09-.01Z",fill:"var(--semi-color-primary)"}),a.createElement("path",{d:"M147.78 31.75c.73-.23 1.5.19 1.72.92.13.43.25.88.35 1.35a1.38 1.38 0 0 1-2.7.58c-.1-.4-.19-.78-.3-1.13-.22-.73.2-1.5.93-1.72Z",fill:"var(--semi-color-primary)"}),a.createElement("path",{d:"M102.27 33.13c.19-.75.94-1.2 1.68-1.01.45.11.89.23 1.3.37a1.38 1.38 0 0 1-.84 2.63c-.36-.11-.73-.22-1.13-.32a1.38 1.38 0 0 1-1-1.67Z",fill:"var(--semi-color-primary)"}),a.createElement("path",{d:"M129.3 33.68c.42.64.25 1.5-.4 1.92l-.52.34-.53.36a1.38 1.38 0 0 1-1.53-2.31l.32-.21.21-.14.3-.2.23-.15c.64-.42 1.5-.25 1.92.39Z",fill:"var(--semi-color-primary)"}),a.createElement("path",{d:"M108.25 35.22c.36-.67 1.2-.92 1.88-.55a246.5 246.5 0 0 1 1.11.61 1.38 1.38 0 0 1-1.33 2.43l-.5-.28h-.01l-.6-.34a1.38 1.38 0 0 1-.55-1.87Z",fill:"var(--semi-color-primary)"}),a.createElement("path",{d:"M92.83 35.77c.76-.01 1.4.6 1.4 1.36.01.16.03.34.07.55a1.38 1.38 0 1 1-2.7.58 5.62 5.62 0 0 1-.13-1.08c-.01-.76.6-1.4 1.36-1.4Z",fill:"var(--semi-color-primary)"}),a.createElement("path",{d:"M124 37.2c.31.7 0 1.51-.7 1.82a6.07 6.07 0 0 1-1.44.45 1.38 1.38 0 1 1-.67-2.68l.58-.16c.1-.03.24-.07.42-.15.7-.3 1.51.02 1.82.72Z",fill:"var(--semi-color-primary)"}),a.createElement("path",{d:"M113.9 38.14c.15-.75.89-1.22 1.63-1.06.35.07.72.13 1.1.16a1.38 1.38 0 0 1-.26 2.76c-.49-.05-.96-.12-1.41-.22a1.38 1.38 0 0 1-1.07-1.64Z",fill:"var(--semi-color-primary)"}),a.createElement("path",{d:"M148.98 37.95c.76-.01 1.4.6 1.4 1.36a38.45 38.45 0 0 1 0 1.42 1.38 1.38 0 0 1-2.77-.08 24.28 24.28 0 0 0 0-1.3c0-.76.6-1.39 1.37-1.4Z",fill:"var(--semi-color-primary)"}),a.createElement("path",{d:"M148.6 44.88c.75.16 1.22.9 1.06 1.65-.1.47-.22.94-.34 1.41a1.38 1.38 0 1 1-2.68-.7c.12-.43.22-.87.31-1.3.17-.75.9-1.22 1.65-1.06Z",fill:"var(--semi-color-primary)"}),a.createElement("path",{d:"M146.69 51.6c.7.31 1 1.13.7 1.83-.2.44-.41.88-.63 1.31a1.38 1.38 0 0 1-2.48-1.24c.2-.4.4-.8.58-1.2.31-.7 1.13-1.01 1.83-.7Z",fill:"var(--semi-color-primary)"}),a.createElement("path",{d:"M41.67 55.45c.07.77-.5 1.44-1.25 1.5-.43.04-.86.1-1.26.19a1.38 1.38 0 1 1-.54-2.72c.5-.1 1.02-.17 1.55-.22.76-.07 1.43.5 1.5 1.25Z",fill:"var(--semi-color-primary)"}),a.createElement("path",{d:"M44.58 55.78c.22-.73 1-1.15 1.72-.93l.74.23a1.38 1.38 0 1 1-.9 2.62l-.62-.2a1.38 1.38 0 0 1-.94-1.72Z",fill:"var(--semi-color-primary)"}),a.createElement("path",{d:"M91.9 56.9c.05.76-.52 1.42-1.29 1.47-.44.02-.89.06-1.32.11a1.38 1.38 0 0 1-.31-2.75c.48-.05.96-.1 1.45-.13.77-.05 1.42.53 1.47 1.3Z",fill:"var(--semi-color-primary)"}),a.createElement("path",{d:"M94.72 56.95c.07-.76.74-1.33 1.5-1.26l1.43.14a1.38 1.38 0 0 1-.32 2.75c-.45-.05-.9-.1-1.35-.13a1.38 1.38 0 0 1-1.26-1.5Z",fill:"var(--semi-color-primary)"}),a.createElement("path",{d:"M101.64 57.83c.16-.75.9-1.22 1.64-1.07l1.39.31a1.38 1.38 0 1 1-.62 2.7l-1.34-.3a1.38 1.38 0 0 1-1.07-1.64Z",fill:"var(--semi-color-primary)"}),a.createElement("path",{d:"M34.85 57.26c.48.6.39 1.46-.2 1.94-.33.27-.63.55-.9.84a1.38 1.38 0 0 1-2.03-1.89c.36-.39.76-.75 1.18-1.1.6-.48 1.46-.39 1.95.2Z",fill:"var(--semi-color-primary)"}),a.createElement("path",{d:"M85 57.9c.29.71-.06 1.51-.78 1.8a15.8 15.8 0 0 0-1.26.54 1.38 1.38 0 1 1-1.15-2.52 71.64 71.64 0 0 1 1.4-.6c.71-.28 1.52.07 1.8.78Z",fill:"var(--semi-color-primary)"}),a.createElement("path",{d:"M143.4 57.76c.61.47.72 1.34.26 1.95-.3.39-.62.77-.94 1.14a1.38 1.38 0 0 1-2.09-1.81 24 24 0 0 0 .84-1.03c.47-.6 1.33-.71 1.94-.25Z",fill:"var(--semi-color-primary)"}),a.createElement("path",{d:"M108.43 59.46c.22-.74.99-1.15 1.72-.93l1.35.41a1.38 1.38 0 1 1-.82 2.64l-1.32-.4a1.38 1.38 0 0 1-.93-1.72Z",fill:"var(--semi-color-primary)"}),a.createElement("path",{d:"M115.08 61.58a1.38 1.38 0 0 1 1.77-.82l1.32.48a1.38 1.38 0 0 1-.97 2.6c-.43-.17-.87-.33-1.3-.48a1.38 1.38 0 0 1-.82-1.78Z",fill:"var(--semi-color-primary)"}),a.createElement("path",{d:"M138.67 62.89c.42.64.25 1.5-.4 1.92-.41.27-.85.54-1.29.78a1.38 1.38 0 0 1-1.32-2.43c.37-.2.73-.43 1.1-.66.63-.42 1.49-.25 1.91.39Z",fill:"var(--semi-color-primary)"}),a.createElement("path",{d:"M30.5 62.78c.77.07 1.33.74 1.26 1.5l-.03.59.01.75-1.6 1.4a1.38 1.38 0 0 1-1.16-1.32l-.02-.83c0-.28.02-.56.04-.84.07-.76.75-1.32 1.5-1.25Z",fill:"var(--semi-color-primary)"}),a.createElement("path",{d:"M121.6 64.07c.3-.7 1.1-1.04 1.8-.75a146.8 146.8 0 0 1 1.26.52 1.38 1.38 0 1 1-.97 2.59 19.62 19.62 0 0 1-1.35-.55c-.7-.3-1.04-1.1-.74-1.81Z",fill:"var(--semi-color-primary)"}),a.createElement("path",{d:"M72.11 64.94c.48.6.4 1.47-.2 1.95-.38.3-.74.62-1.09.92A1.38 1.38 0 1 1 69 65.73c.37-.33.76-.66 1.17-.99.59-.48 1.46-.39 1.94.2Z",fill:"var(--semi-color-primary)"}),a.createElement("path",{d:"M132.4 65.92c.09.76-.46 1.44-1.22 1.53-.5.05-1.02.08-1.53.09a1.38 1.38 0 1 1-.02-2.77c.42 0 .84-.03 1.25-.07.76-.09 1.44.46 1.53 1.22Z",fill:"var(--semi-color-primary)"}),a.createElement("path",{d:"M66.66 69.9c.57.52.6 1.4.09 1.96l-.73.8-.02.02-.16.18-.08.09a1.38 1.38 0 0 1-2.05-1.86l.25-.28.75-.82c.51-.56 1.39-.6 1.95-.09Z",fill:"var(--semi-color-primary)"}),a.createElement("path",{d:"M61.6 75.28c.45.61.31 1.48-.3 1.93-.44.31-.88.61-1.36.89a1.38 1.38 0 1 1-1.4-2.4c.4-.22.77-.46 1.12-.72a1.38 1.38 0 0 1 1.94.3Z",fill:"var(--semi-color-primary)"}),a.createElement("path",{d:"M37.67 75.97c.42.19.86.37 1.35.53a1.38 1.38 0 0 1-.89 2.62c-.56-.19-1.1-.4-1.6-.63l.72-2.63c.14.01.28.05.42.11Z",fill:"var(--semi-color-primary)"}),a.createElement("path",{d:"M55.05 78.57c.12.75-.4 1.46-1.15 1.58-.5.08-1 .15-1.54.2a1.38 1.38 0 1 1-.28-2.75c.49-.05.95-.11 1.39-.18.75-.12 1.46.4 1.58 1.15Z",fill:"var(--semi-color-primary)"}),a.createElement("path",{d:"M43.4 78.87c.06-.76.73-1.33 1.49-1.27a38.43 38.43 0 0 0 1.5.1 1.38 1.38 0 1 1-.12 2.76 62.94 62.94 0 0 1-1.6-.1 1.38 1.38 0 0 1-1.27-1.49Z",fill:"var(--semi-color-primary)"}),a.createElement("g",{clipPath:"url(#clip_failure_96_39_65)"},a.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M30.9 46.87a13.45 13.45 0 0 1 9.37-16.53 13.46 13.46 0 0 1 16.52 9.39c2.64 9.56-4.76 29.27-5.14 29.9a.75.75 0 0 1-.99.27c-.64-.34-17.11-13.47-19.76-23.03Zm14.36 1.54a6.1 6.1 0 0 1-3.25-11.75 6.1 6.1 0 0 1 3.25 11.75Z",fill:"var(--semi-color-primary)"})),a.createElement("path",{d:"M102.31 100.69c-2.8 1.55-5.63 2.85-9.36 4.58l1.48 3.92c2.14-.96 6.16-6.03 7.88-8.5Z",fill:"#515151"}),a.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M121 63.04c8.85 2.1 12.43-6.5 13.12-8.77.68-2.27-5.6-11.86-8-11.2l-.42.12-.23.06c-3.1.82-11.15 2.94-12.35 8-1.3 5.46 2.4 10.49 7.88 11.79Z",fill:"#515151"}),a.createElement("path",{d:"M134.5 64.73c-.43.47-1.2.74-2.33.73a12.7 12.7 0 0 1-4.06-.86 31.25 31.25 0 0 1-9.94-6.22c-3.25-2.97-5.97-5.8-7.59-8.42-1.61-2.61-2.05-4.88-.98-6.84a3.7 3.7 0 0 1 2.11-1.86 4.53 4.53 0 0 1 2.9.15c2.16.76 4.57 2.83 6.48 6.02 3.4 5.63 6.89 8.23 9.7 10.33.49.35.95.7 1.38 1.03a7.29 7.29 0 0 1 2.61 3.48c.34 1.1.16 1.97-.28 2.46Z",fill:"white",stroke:"#515151"}),a.createElement("mask",{id:"mask_failure_130_526","mask-type":"alpha",maskUnits:"userSpaceOnUse",x:98,y:44,width:36,height:27},a.createElement("path",{d:"M130.53 62.1c-.5-3.3-9.52-14.75-16.08-15.03l-12.68 4.52 6.47 14.16 17.25 3.07c1.84-1.14 5.43-4.07 5.04-6.72Z",fill:"#C4C4C4"})),a.createElement("g",{mask:"url(#mask_failure_130_526)"},a.createElement("path",{d:"M127.2 63.62a9.74 9.74 0 0 1-13.76.5 9.74 9.74 0 0 1-.32-13.77 9.74 9.74 0 0 1 13.77-.5 9.74 9.74 0 0 1 .32 13.77Z",fill:"white",stroke:"#515151"}),a.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m116.79 47.35-.02.37c2.86.5 8.57 2.59 8.58 6.87 0 5.36-7.44 9.34-14.47 3.46-.34-.28-.66-.53-.95-.74a10.09 10.09 0 0 0 3.17 7.17 10.24 10.24 0 0 0 14.47-.52 10.24 10.24 0 0 0-.34-14.47 10.16 10.16 0 0 0-10.44-2.14Z",fill:"#515151"}),a.createElement("path",{d:"M119.34 55a.79.79 0 1 0-1.1-1.12.79.79 0 0 0 1.1 1.12Z",fill:"#515151"}),a.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M119.98 50.72c.21-.09.45.01.54.22a7.87 7.87 0 0 0 1.84 2.65.41.41 0 1 1-.55.62 8.67 8.67 0 0 1-2.05-2.95.41.41 0 0 1 .22-.54Z",fill:"#515151"}),a.createElement("path",{d:"M114.85 52.4a.79.79 0 1 0-1.1-1.1.79.79 0 0 0 1.1 1.1Z",fill:"#515151"}),a.createElement("mask",{id:"path-18-inside-1",fill:"white"},a.createElement("ellipse",{rx:2.97818,ry:2.97818,transform:"matrix(0.727696 0.6859 -0.685903 0.727693 128.435 60.0508)"})),a.createElement("ellipse",{rx:2.97818,ry:2.97818,transform:"matrix(0.727696 0.6859 -0.685903 0.727693 128.435 60.0508)",fill:"white"}),a.createElement("path",{d:"m128.42 60.04.01-.01a.03.03 0 0 1 .02 0l-4.12 4.37a5.98 5.98 0 0 0 8.45-.25l-4.36-4.11Zm.03 0v.02l-4.37-4.11a5.98 5.98 0 0 0 .25 8.45l4.12-4.37Zm0 .03h-.01a.03.03 0 0 1-.02 0l4.12-4.37a5.98 5.98 0 0 0-8.46.25l4.37 4.12Zm-.03 0v-.03l4.37 4.11a5.98 5.98 0 0 0-.25-8.45l-4.12 4.37Z",fill:"#515151",mask:"url(#path-18-inside-1)"})),a.createElement("path",{d:"M145.63 40.19c1.37-2.75 12.75 2.35 16.14 6.78 3.38 4.43 1.48 10.74-1.9 9.68-6.69-2.12-7.56-6.7-7.94-9.48-1.2-1.85-7.67-4.24-6.3-6.98Z",fill:"white",stroke:"#515151"}),a.createElement("path",{d:"m158.95 41.56 6.64 2.52 1.66 12.47-8.3 1.98-3.47-12.03 3.47-4.94Z",fill:"white"}),a.createElement("path",{d:"M167.3 151.94c5.19 1.66 23.35 35.57 19.05 35.57-13.86 0-34.5.53-71.42.53-15.63 0-17.9-5.16-11.79-22.08a353.23 353.23 0 0 1 6.14-15.76l32.5 1.26c-.43 1.53-.91 3.07-1.38 4.4a26.82 26.82 0 0 1 8.73-1.47c5.27 0 7.04 1.4 11.77 0 2.13-.62 4.8-2.97 6.4-2.45Z",fill:"white",className:""}),a.createElement("path",{d:"M140.4 155.87c.47-1.34.95-2.88 1.38-4.4l-32.5-1.27a353.23 353.23 0 0 0-6.14 15.76c-6.1 16.92-3.84 22.08 11.79 22.08 36.93 0 57.56-.53 71.42-.53 4.3 0-13.86-33.91-19.06-35.57-1.6-.52-4.26 1.83-6.4 2.45-4.72 1.4-6.5 0-11.76 0-3.08 0-6.06.55-8.72 1.48Zm0 0a26.67 26.67 0 0 1-4.44 8.38c-1.7 2.22-3.99 4.43-5.43 4.33-1.44-.1-1.42-3.18 0-5.66 1.97-3.44 6.45-5.87 9.88-7.05Z",stroke:"#1C1F23",className:""}),a.createElement("path",{d:"M149.25 131.7s3.36 19.46-12.34 21.04c-11.53 1.15-40.77-4.55-53.76-7.79 4.72 12.82 9.61 39.86 7 42.16-3.33 2.93-47.55 1.76-55.96 0-8.42-1.75 13.82-11.46 15.45-14.66 2.99-5.84-5.48-21.18-5.75-45.45-.27-24.27 18.18-24.86 34.47-21.64 13.02 2.57 41.63 18.33 52.56 26.86l18.33-.52Z",fill:"white",stroke:"#515151"}),a.createElement("path",{d:"M141.5 153.87c-3.11 2.55-27.72 5-35.58 3.53l2.75-6.8c20.23 2.85 28.08 3.34 33.46 1.16l-.63 2.11Z",fill:"#515151",className:"__web-inspector-hide-shortcut__"}),a.createElement("path",{d:"M141.5 153.87c-3.11 2.55-27.72 5-35.58 3.53l2.75-6.8c20.23 2.85 28.08 3.34 33.46 1.16l-.63 2.11Z",fill:"#515151"}),a.createElement("path",{d:"M126.02 142.7c-3.1-2.99-4.99-7.5-4.16-12.35",stroke:"#515151"}),a.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M130.6 95.65c-9.03-10.98-18.97-19.74-25.5-24.56l1.63-2.22c6.7 4.95 16.81 13.86 26 25.02 9.18 11.16 17.54 24.67 20.59 38.83l-2.7.59c-2.91-13.56-10.97-26.67-20.02-37.66Z",fill:"#515151"}),a.createElement("path",{d:"m149.12 107.09-16.36 13.2 22.27 17.8 8.87-19.19c-.14-3.93-2.34-5.34-5.83-4.66l-3.12-2.5c.08-3.5-2.18-5.64-5.83-4.65Z",fill:"#E6E8EA"}),a.createElement("path",{d:"m148.24 128.62 9.45-14.34-2.91-2.33-10.94 13.07 4.4 3.6Z",stroke:"#515151"}),a.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M143.67 127.98a6.93 6.93 0 1 1-10.82-8.65 6.93 6.93 0 0 1 10.82 8.65Zm12.28 9.82a6.93 6.93 0 1 1-10.82-8.66 6.93 6.93 0 0 1 10.82 8.66Z",fill:"#515151"}),a.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m133.43 123.46 9.21-1.8.32 1.61-9.2 1.81-.33-1.62Z",fill:"white"}),a.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m145.5 133.11 9.21-1.8.32 1.62-9.2 1.8-.33-1.62Z",fill:"white"}),a.createElement("defs",null,a.createElement("clipPath",{id:"clip_failure_96_39_65"},a.createElement("rect",{width:44.4004,height:44.4627,transform:"matrix(0.963965 -0.266028 0.266198 0.963918 18.4214 34.6221)",fill:"white"}))))}var ld=ad;const Rr=n=>{let e;const t=new Set,o=(p,d)=>{const m=typeof p=="function"?p(e):p;if(!Object.is(m,e)){const f=e;e=d??(typeof m!="object"||m===null)?m:Object.assign({},e,m),t.forEach(y=>y(e,f))}},r=()=>e,c={setState:o,getState:r,getInitialState:()=>u,subscribe:p=>(t.add(p),()=>t.delete(p))},u=e=n(o,r,c);return c},cd=(n=>n?Rr(n):Rr),dd=n=>n;function ud(n,e=dd){const t=g.useSyncExternalStore(n.subscribe,g.useCallback(()=>e(n.getState()),[n,e]),g.useCallback(()=>e(n.getInitialState()),[n,e]));return g.useDebugValue(t),t}const Nr=n=>{const e=cd(n),t=o=>ud(e,o);return Object.assign(t,e),t},ft=(n=>n?Nr(n):Nr);function pd(){var n,e;return((e=(n=window.__TAURI__)==null?void 0:n.core)==null?void 0:e.invoke)||null}const hd=ne;async function _e(n,e){const t=await fetch(`${hd}${n}`,{headers:{"Content-Type":"application/json"},...e});if(!t.ok){const o=await t.text().catch(()=>"");let r=`${t.status} ${t.statusText}`;try{const s=JSON.parse(o);r=s.error||s.message||r}catch{}throw new Error(r)}return t.json()}function xe(){return window.ga||null}function Ce(){return!!xe()}async function md(){if(Ce())try{return(await xe().getConfig()).config}catch{}try{return(await _e("/config")).config}catch{return{lang:localStorage.getItem("ga_lang")||"zh",theme:"light",appearance:localStorage.getItem("ga_appearance")||"light",plain:!1,fontSize:parseInt(localStorage.getItem("ga_font_size")||"14",10),llmNo:0}}}async function fd(n){if(Ce())try{await xe().saveConfig({config:n});return}catch{}try{await _e("/config",{method:"POST",body:JSON.stringify({config:n})})}catch{}}async function gd(){if(Ce())try{return(await xe().getModelProfiles()).profiles||[]}catch{}try{return(await _e("/model-profiles")).profiles||[]}catch{return[]}}async function yd(n){if(Ce())try{return(await xe().rpc("model-profiles/get",{id:n})).profile||null}catch{}try{return(await _e(`/model-profiles/${n}`)).profile||null}catch{return null}}async function bd(n){return Ce()?(await xe().rpc("model-profiles/add",n)).profiles:(await _e("/model-profiles",{method:"POST",body:JSON.stringify(n)})).profiles}async function vd(n,e){return Ce()?(await xe().rpc("model-profiles/edit",{id:n,...e})).profiles:(await _e(`/model-profiles/${n}`,{method:"PUT",body:JSON.stringify(e)})).profiles}async function xd(n){return Ce()?(await xe().rpc("model-profiles/delete",{id:n})).profiles:(await _e(`/model-profiles/${n}`,{method:"DELETE"})).profiles}async function wd(n){return Ce()?(await xe().rpc("model-profiles/mixin-add",{id:n})).profiles:(await _e(`/model-profiles/${n}/mixin`,{method:"POST",body:"{}"})).profiles}async function Cd(n){return Ce()?(await xe().rpc("model-profiles/mixin-remove",{id:n})).profiles:(await _e(`/model-profiles/${n}/mixin`,{method:"DELETE"})).profiles}async function $r(n){return Ce()?(await xe().rpc("model-profiles/mixin-reorder",{members:n})).profiles:(await _e("/model-profiles/mixin/order",{method:"PUT",body:JSON.stringify({members:n})})).profiles}async function Sd(){if(Ce())try{return(await xe().getMykeyContent()).content}catch{}try{return(await _e("/services/mykey")).content||""}catch{return""}}async function kd(n){if(Ce()){await xe().saveMykeyContent(n);return}await _e("/services/mykey",{method:"POST",body:JSON.stringify({content:n})})}async function Oe(n,e){if(Ce())return xe().tauriInvoke(n,e);const t=pd();if(t)return t(n,e);throw new Error("Tauri IPC not available")}const kt={lang:"ga_lang",theme:"ga_theme",appearance:"ga_appearance",fontSize:"ga_font_size",llmNo:"ga_llm_no"};function jd(n){try{localStorage.setItem(kt.lang,n.lang),localStorage.setItem(kt.appearance,n.appearance),localStorage.setItem(kt.fontSize,String(n.chatFontSize)),localStorage.setItem(kt.llmNo,String(n.defaultModelNo))}catch{}}function qn(n,e){const t=document.documentElement;t.dataset.appearance=n,delete t.dataset.plain,t.dataset.chatFont=String(e),t.style.setProperty("--chat-font",e+"px"),n==="dark"?document.body.setAttribute("theme-mode","dark"):document.body.removeAttribute("theme-mode")}function Ed(){const n=document.documentElement;return{appearance:n.dataset.appearance==="dark"?"dark":"light",chatFontSize:parseInt(n.dataset.chatFont||"14",10)||14,lang:n.lang==="en"?"en":"zh",defaultModelNo:parseInt(localStorage.getItem(kt.llmNo)||"0",10)}}const Z=ft((n,e)=>({visible:!1,modelProfiles:[],liveModel:null,...Ed(),open:()=>n({visible:!0}),close:()=>n({visible:!1}),setAppearance:t=>{n({appearance:t}),qn(t,e().chatFontSize),e().persist()},setChatFontSize:t=>{const o=Math.max(10,Math.min(20,t));n({chatFontSize:o}),qn(e().appearance,o),e().persist()},setLang:t=>{n({lang:t}),document.documentElement.lang=t==="en"?"en":"zh-CN",e().persist()},setModelProfiles:t=>n({modelProfiles:t}),setDefaultModel:t=>{e().modelProfiles[t]&&(n({defaultModelNo:t}),e().persist())},setLiveModel:t=>n({liveModel:t}),loadFromBridge:async()=>{try{const[t,o]=await Promise.all([md(),gd()]);n({appearance:t.appearance==="dark"?"dark":"light",chatFontSize:t.fontSize||14,lang:t.lang==="en"?"en":"zh",defaultModelNo:t.llmNo||0,modelProfiles:o});const r=e();qn(r.appearance,r.chatFontSize)}catch{}},persist:async()=>{const t=e();jd(t);try{await fd({lang:t.lang,theme:"1",appearance:t.appearance,plain:!1,fontSize:t.chatFontSize,llmNo:t.defaultModelNo})}catch{}}})),Od={robot:"","symbol-misc":"",comment:"",files:"",graph:"",search:"",add:"","kebab-vertical":"",grabber:"","arrow-left":"","chevron-right":"","settings-gear":"","server-process":"",link:"","layout-sidebar-left":"","layout-sidebar-left-off":"","circle-filled":"","layout-sidebar-right":"","layout-sidebar-right-off":"",pin:"",pinned:"",edit:"",trash:""};function Pe({name:n,size:e,className:t}){const o=Od[n];return i.jsx("span",{className:`codicon${t?" "+t:""}`,style:{fontSize:e,display:"inline-block",lineHeight:1},"aria-hidden":"true",children:o??"?"})}const Te=ft(n=>({activePage:"chat",sidebarCollapsed:!1,servicesTab:"channels",setPage:e=>n({activePage:e}),setServicesTab:e=>n({servicesTab:e}),toggleSidebar:()=>n(e=>({sidebarCollapsed:!e.sidebarCollapsed}))}));typeof window<"u"&&window.addEventListener("ga:go-page",(n=>{Te.getState().setPage(n.detail.page)}));function Dr(n,e="completed"){const t=n.createdAt??n.ts,o={id:String(n.id),role:n.role,content:n.content||"",status:n.status??e,createdAt:typeof t=="number"?Math.round(t*1e3):void 0};return Array.isArray(n.turn_segs)&&(o.turn_segs=n.turn_segs),Array.isArray(n.images)&&n.images.length>0&&(o.images=n.images),Array.isArray(n.files)&&n.files.length>0&&(o.files=n.files),typeof n.executionMs=="number"&&(o.executionMs=n.executionMs),o}async function Pd(){return(await(await fetch(`${ne}/session/new`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cwd:"",mcp_servers:[]})})).json()).sessionId}async function _d(n,e,t){const r=await(await fetch(`${ne}/upload`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e,dataUrl:t,sid:n})})).json();if(!r.ok)throw new Error(r.error||"upload failed");return r.path}async function Md(n,e){const o=await(await fetch(`${ne}/upload`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:n,dataUrl:e,sid:"_files"})})).json();if(!o.ok)throw new Error(o.error||"upload failed");return o.path}async function Ld(n,e){try{const o=await(await fetch(`${ne}/drop/stat`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:n,preview:e})})).json();return o.ok?{isDir:!!o.is_dir,size:o.size??0,name:o.name??n,preview:o.preview}:null}catch{return null}}async function Id(n,e,t,o){var u;const r=(t||[]).map(p=>({name:p.name,path:p.path,size:p.size})),s=[];for(const p of o||[]){const d=p.base64||((u=p.path)!=null&&u.startsWith("data:")?p.path:void 0);if(d){const m=await _d(n,p.name,d);s.push({name:p.name,path:m})}else p.path&&!p.path.startsWith("data:")&&p.path!==p.name&&s.push({name:p.name,path:p.path})}return(await(await fetch(`${ne}/session/${n}/prompt`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:n,prompt:e,display:e,files:r,imageMetas:s})})).json()).userMessageId}async function Gn(n,e,t=50){const o=new URLSearchParams({limit:String(t)}),s=await(await fetch(`${ne}/session/${n}/messages?${o}`)).json();return{messages:(s.messages||[]).map(l=>Dr(l)),partial:s.partial?Dr(s.partial,"in_progress"):void 0,status:s.status,plan:s.plan,model:s.model}}async function Td(n){await fetch(`${ne}/session/${n}/cancel`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:n})})}async function Ar(n,e){return(await fetch(`${ne}/session/${n}/model`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({llmNo:e})})).json()}async function Qn(){return((await(await fetch(`${ne}/sessions`)).json()).sessions||[]).filter(o=>!o.id.startsWith("tui_"))}async function Rd(n){await fetch(`${ne}/session/${n}`,{method:"DELETE"})}async function Nd(n,e){await fetch(`${ne}/session/${n}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:e})})}async function $d(n,e){await fetch(`${ne}/session/${n}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({pinned:e})})}const xt="__partial__",Dd=1e3;let wt=null,rt=null,Jt=null;const Ee=new Map,G=ft((n,e)=>{function t(p,d,m){const f=p.filter(x=>x.id!==xt),y=f.filter(x=>String(x.id).startsWith("local-"));let b=f.filter(x=>!String(x.id).startsWith("local-"));for(const x of d){if(b.some(S=>S.id===x.id))continue;const C=y.findIndex(S=>S.role===x.role&&S.content===x.content);C>=0&&y.splice(C,1),b.push(x)}return b=[...b,...y],b.sort((x,C)=>(x.createdAt??0)-(C.createdAt??0)),m&&b.push({...m,id:xt,status:"in_progress"}),b}function o(p){for(let d=p.length-1;d>=0;d--)if(p[d].role==="user"&&p[d].createdAt)return p[d].createdAt;return Date.now()}function r(p,d){Ee.set(p,d),n(m=>{const f={turnStarts:{...m.turnStarts,[p]:d}};return p===m.activeSessionId&&(f.turnStartedAt=d),f})}function s(p){Ee.delete(p),n(d=>{const{[p]:m,...f}=d.turnStarts,y={turnStarts:f};return p===d.activeSessionId&&(y.turnStartedAt=null),y})}function l(){if(rt=null,!wt)return;const p=wt;wt=null;const{messages:d}=e(),m=d.filter(f=>f.id!==xt);n({messages:[...m,p]})}function c(){u(),Jt=setInterval(()=>{const{activeSessionId:p,status:d}=e();if(!p||d!=="running"){u();return}Gn(p).then(m=>{if(n(f=>({messages:t(f.messages,m.messages,m.partial),status:m.status,turnStartedAt:m.status==="running"?f.turnStartedAt:null})),m.model&&(Z.getState().setLiveModel(m.model),m.model.llmNo!=null&&m.status!=="running"&&n({sessionModelNo:m.model.llmNo})),m.status!=="running"){s(p),u();const{pendingQueue:f,status:y}=e();if(y==="idle"&&f.length>0){const[b,...x]=f;n({pendingQueue:x}),e().sendMessage(b.text,b.opts)}}}).catch(()=>{})},Dd)}function u(){Jt!==null&&(clearInterval(Jt),Jt=null)}return Ve("partial-update",p=>{const d=p,{activeSessionId:m}=e();!d.sessionId||d.sessionId!==m||(wt={id:xt,role:"assistant",content:d.content||"",status:"in_progress",turn_segs:d.turn_segs},rt===null&&(rt=requestAnimationFrame(l)))}),Ve("session-state",p=>{const d=p;d.sessionId&&d.status&&n(f=>{const y=new Set(f.runningSessions);return d.status==="running"?y.add(d.sessionId):y.delete(d.sessionId),{runningSessions:y}});const{activeSessionId:m}=e();d.sessionId&&d.sessionId===m&&(d.status==="running"?(Ee.has(d.sessionId)?n({turnStartedAt:Ee.get(d.sessionId)}):r(d.sessionId,Date.now()),n({status:"running"}),c()):(d.status==="idle"||d.status==="error"||d.status==="cancelled")&&(u(),rt!==null&&(cancelAnimationFrame(rt),rt=null),wt=null,s(d.sessionId),n({status:"idle"}),Gn(m).then(f=>{n(x=>({messages:t(x.messages.filter(C=>C.id!==xt),f.messages,void 0)})),f.model&&(Z.getState().setLiveModel(f.model),f.model.llmNo!=null&&n({sessionModelNo:f.model.llmNo}));const{pendingQueue:y,status:b}=e();if(b==="idle"&&y.length>0){const[x,...C]=y;n({pendingQueue:C}),e().sendMessage(x.text,x.opts)}}).catch(()=>{}))),d.sessionId&&d.sessionId!==m&&(d.status==="idle"||d.status==="error"||d.status==="cancelled"?Ee.delete(d.sessionId):d.status==="running"&&!Ee.has(d.sessionId)&&Ee.set(d.sessionId,Date.now())),(d.status==="idle"||d.status==="error")&&Qn().then(f=>n({sessions:f})).catch(()=>{})}),Qn().then(p=>n({sessions:p})).catch(()=>{}),{activeSessionId:null,messages:[],status:"idle",sessions:[],runningSessions:new Set,turnStartedAt:null,turnStarts:{},pendingQueue:[],sessionModelNo:null,async newSession(){n({activeSessionId:null,messages:[],status:"idle",turnStartedAt:null,turnStarts:{},pendingQueue:[],sessionModelNo:null})},async sendMessage(p,d){var S;let{activeSessionId:m,status:f}=e();if(!m){m=await Pd(),n({activeSessionId:m}),e().loadSessions();const k=e().sessionModelNo;k!=null&&Ar(m,k).catch(()=>{})}if(f==="running"){n(k=>({pendingQueue:[...k.pendingQueue,{text:p,opts:d}]}));return}const y=Date.now(),b=(S=d==null?void 0:d.images)==null?void 0:S.map(k=>({name:k.name,path:k.base64||k.path||k.name})),x=d==null?void 0:d.files,C={id:`local-${y}`,role:"user",content:p,status:"completed",createdAt:y,images:b,files:x};n(k=>({messages:[...k.messages,C],status:"running"})),r(m,y),c(),await Id(m,p,d==null?void 0:d.files,d==null?void 0:d.images)},cancelQueued(p){n(d=>({pendingQueue:d.pendingQueue.filter((m,f)=>f!==p)}))},async cancel(){const{activeSessionId:p}=e();p&&await Td(p)},setActiveSession(p){u();const d=p?Ee.get(p)??null:null;n({activeSessionId:p,messages:[],status:"idle",turnStartedAt:d,pendingQueue:[],sessionModelNo:null}),p&&Gn(p).then(m=>{const f=t([],m.messages,m.partial);if(n({messages:f,status:m.status}),m.model&&(Z.getState().setLiveModel(m.model),m.model.llmNo!=null&&n({sessionModelNo:m.model.llmNo})),m.status==="running"){if(Ee.has(p))n({turnStartedAt:Ee.get(p)});else{const y=o(m.messages);r(p,y)}c()}else Ee.delete(p),n({turnStartedAt:null})}).catch(()=>{})},async loadSessions(){try{const p=await Qn();n({sessions:p})}catch{}},async deleteSession(p){const{activeSessionId:d}=e();d===p&&n({activeSessionId:null,messages:[],status:"idle",turnStartedAt:null}),Ee.delete(p),n(m=>{const{[p]:f,...y}=m.turnStarts;return{sessions:m.sessions.filter(b=>b.id!==p),turnStarts:y}});try{await Rd(p)}catch{}},async renameSession(p,d){n(m=>({sessions:m.sessions.map(f=>f.id===p?{...f,title:d,untitled:!1}:f)}));try{await Nd(p,d)}catch{}},async pinSession(p,d){n(m=>({sessions:m.sessions.map(f=>f.id===p?{...f,pinned:d}:f)}));try{await $d(p,d)}catch{}},async selectSessionModel(p){const{activeSessionId:d}=e(),m=e().sessionModelNo;if(n({sessionModelNo:p}),!!d)try{const f=await Ar(d,p);f.model&&(Z.getState().setLiveModel(f.model),f.model.llmNo!=null&&n({sessionModelNo:f.model.llmNo}))}catch{n({sessionModelNo:m})}}}});Xs(n=>{n==="ready"&&G.getState().loadSessions()});const Ad={"app.title":"GenericAgent","brand.sub":"","nav.chat":"新建会话","nav.services":"运行状态","nav.channels":"消息通道","nav.status":"运行状态","nav.collab":"指挥家","nav.token":"用量","foot.settings":"配置","foot.runtimeManagement":"运行时管理","foot.ver":"GenericAgent","chat.startTitle":"开始对话","chat.startSub":"直接输入,或点预设功能一键启动","chat.inputPlaceholder":"输入消息…","preset.butler.t":"指挥家","preset.butler.d":"复杂任务自动拆解,只需查看进度和简报","preset.plan.t":"计划模式","preset.plan.d":"加载 Plan SOP,按探索→规划→执行→验证流程","preset.goal.t":"目标模式","preset.goal.d":"设定目标,自主完成","preset.autonomous.t":"自主行动","preset.autonomous.d":"按 SOP 规划/执行任务,产出报告(reflect/autonomous.py 同源)","preset.hive.t":"集群协作","preset.hive.d":"多 worker 协同攻坚","preset.review.t":"深度复核","preset.review.d":"挑刺式质量把关","preset.findwork.t":"找点事做","preset.findwork.d":"分析当前情况,推荐一批让你感兴趣的 TODO","preset.mine.t":"我的·周报","preset.mine.d":"自定义:抓本周提交并写周报","preset.add.t":"自定义","preset.add.d":"任意一句话存为功能","composer.placeholder":"今天帮你做些什么?","composer.placeholder.new.0":"今天帮你做些什么?@ 引用文件;/ 调用预设技能","composer.placeholder.new.1":"交给我一个任务","composer.placeholder.new.2":"有什么想法?","composer.placeholder.new.3":"描述你的需求","composer.placeholder.new.4":"今天解决什么?","composer.placeholder.new.5":"随便问","composer.placeholder.new.6":"从目标开始","composer.placeholder.followUp.0":"继续补充…","composer.placeholder.followUp.1":"添加更多上下文","composer.placeholder.followUp.2":"细化你的请求","composer.placeholder.followUp.3":"接下来做什么?","composer.placeholder.followUp.4":"继续推进","composer.placeholder.reconnecting":"重新连接中…","search.placeholder":"搜索会话…","search.noResults":"无匹配会话","conv.new":"新对话","section.sessions":"会话","ctx.pin":"置顶","ctx.unpin":"取消置顶","ctx.rename":"重命名","ctx.del":"删除","common.close":"关闭","common.more":"更多","common.optional":"选填","common.save":"保存","common.cancel":"取消","common.confirm":"确认","common.edit":"编辑","common.delete":"删除","common.done":"完成","modal.preset":"预设功能","modal.addModel":"添加模型","modal.editModel":"编辑模型","modal.settings":"配置","modal.features":"功能","modal.customPreset":"自定义预设","modal.editCustomPreset":"编辑任务","customPreset.titlePh":"标题,例如「写周报」","customPreset.promptPh":"Prompt 内容,发送时会作为消息提交","customPreset.empty":"标题和 Prompt 不能为空","customPreset.removeTitle":"删除","customPreset.editTitle":"编辑","builtinPreset.restoreBtn":"恢复默认预设","set.appearance":"外观","set.plainUi":"素色","set.fontSize":"聊天字号","set.lang":"语言","set.model":"模型配置","set.addModel":"添加模型","set.features":"功能","set.importMykey":"导入已有密钥配置","set.exportMykey":"导出当前模型配置","set.serviceManager":"运行状态","shortcut.askConfirm":"是否在桌面创建 GenericAgent 快捷方式?","appearance.light":"浅色","appearance.dark":"深色","set.noModels":"暂无模型,点击下方添加","set.current":"新会话默认","lang.zh":"简体中文","lang.en":"English","model.name":"备注名","model.namePh":"选填,方便自己辨认","model.apikey":"API Key","model.apikeyPh":"请输入 API Key","model.apikeyKeep":"留空则保持原 Key 不变","model.apibase":"API URL","model.apibasePh":"请输入 API URL","model.protocol":"模型协议","model.protocolPick":"请选择…","model.protocolOai":"OpenAI 兼容 (chat/completions)","model.protocolClaude":"Anthropic (Claude /v1/messages)","model.stream":"响应方式","model.streamOn":"流式","model.streamOff":"非流式","model.model":"模型 ID","model.modelPh":"请输入模型唯一标识","model.modelHint":"须与服务商文档中的 model 字段完全一致","model.retries":"重试次数","model.connTimeout":"连接超时 (s)","model.readTimeout":"读取超时 (s)","model.save":"保存","model.auto":"自动选择","model.menuLabel":"选择模型","model.aggregation":"默认组","model.aggregationShort":"默认组","model.aggregationDesc":"按顺序尝试,失败自动切换到下一个","model.configurationHelp":"模型配置说明","model.configurationTip":"设置新会话默认使用的模型;也可以在会话输入框中临时切换","model.aggregationTip":"默认组会按列表顺序尝试模型;当前模型不可用时自动切换到下一项","model.emptyMixin":"尚未加入模型","model.addToMixin":"加入默认组","model.inMixin":"已在默认组","model.removeFromMixin":"移出默认组","model.alreadyInMixin":"已在默认组中","model.dragReorder":"拖拽调整顺序","model.routeProvider":"服务商接入","model.routeCustom":"自定义接入","model.selectProvider":"选择服务商","model.providerLocked":"由服务商预设,不可更改","model.advanced":"高级配置","model.getKey":"获取 API Key →","pq.title":"快速接入官方模型","pq.sub":"填好 API Key 即可使用","pq.toggle":"展开 / 收起","pq.deepseekDesc":"深度求索 · DeepSeek 开放平台","pq.qwenDesc":"阿里云百炼 · 通义大模型","pq.doubaoDesc":"火山引擎 · 火山方舟平台","pq.minimaxDesc":"MiniMax · 开放平台","pq.zhipuDesc":"智谱 AI · GLM 开放平台","pq.kimiDesc":"月之暗面 · Moonshot 平台","pq.stepfunDesc":"阶跃星辰 · Step 开放平台","guide.step1":"点击下方链接,登录后创建并复制 API Key","guide.step2":"把 Key 粘贴到下方「API Key」输入框","guide.step3":"点击保存,即可在模型列表中选用","guide.prefillTip":"已为你预填 API 地址、协议与模型,可按需修改","guide.getKey":"获取 {name} 的 API Key","guide.copy":"复制链接","guide.copied":"链接已复制","err.modelSave":"保存失败","err.modelRequired":"请填写模型、API Key 和 API 地址","err.modelDelete":"删除失败","err.modelDeleteLast":"至少保留一个模型","err.mixinFailed":"操作失败","confirm.modelDelete":"确定删除该模型配置?","page.services.title":"运行状态","page.services.sub":"查看消息通道及本地运行环境中各组件的状态、日志与控制项","svc.colName":"运行组件","svc.colStatus":"状态","svc.colPid":"PID","svc.colMemory":"内存 (MB)","svc.colCpu":"CPU (%)","svc.colActions":"操作","svc.empty":"暂无运行组件","page.channels.title":"消息通道","page.channels.sub":"管理消息通道,查看启停状态与日志","page.status.title":"运行状态","page.status.sub":"查看本地运行环境中各组件的状态、日志与控制项","page.collab.title":"指挥家","page.collab.sub":"交代目标,自动拆活与跟进","collab.progressTitle":"分工进度","collab.progressEmpty":"还没有任务在执行。告诉指挥家你的目标后,这里会显示拆分后的处理进度。","collab.placeholder":"请对指挥家描述你想完成的目标","collab.guideTitle":"把要完成的事告诉指挥家","collab.guideWhen":"适合需要多步处理、要花一些时间才能完成的目标。日常聊天和快问快答,请用左侧「聊天」。","collab.guideStep1t":"描述目标","collab.guideStep1d":"在聊天框里写下你想做的事,发给指挥家","collab.guideStep2t":"自动拆解","collab.guideStep2d":"指挥家自动拆解、分配任务,实时监督和调度","collab.guideStep3t":"交付摘要","collab.guideStep3d":"指挥家根据执行状态,呈上任务简报","collab.guideStep4t":"随时调整","collab.guideStep4d":"随时补充要求或细节,指挥家都会处理","collab.chipProgress":"现在进展如何?","collab.chipPause":"先暂停当前任务","collab.chipSummary":"总结一下目前的结果","collab.showProgressTitle":"查看分工进度","collab.statRunning":"进行中","collab.statDone":"已完成","collab.plusMenu":"更多操作","collab.switchMode":"切换模式","collab.typing":"指挥家正在处理","collab.offline":"暂时无法连接指挥家服务,请稍后重试。","collab.offlineTitle":"指挥家离线","collab.offlineSub":"指挥家服务暂时不可用,请检查连接后重试。","collab.retry":"重试","collab.terminateWorker":"终止任务","collab.terminateWorkerConfirm":"要终止“{name}”吗?该执行者当前尚未回报的进度可能会丢失。","collab.terminateWorkerFailed":"终止任务失败","collab.reconnect":"连接断开,正在重连… 已保留上次任务进度。","collab.reconnectIn":"{n} 秒后重试","collab.stRunning":"执行中","collab.stReported":"已回报","collab.stPaused":"已暂停","collab.stFailed":"遇到问题","collab.stTerminated":"已终止","collab.summaryRunning":"正在处理中…","collab.summaryWait":"等待回报","collab.taskFallback":"任务 {n}","collab.timeJust":"刚刚","collab.timeSec":"{n} 秒前","collab.timeMin":"{n} 分钟前","collab.timeHr":"{n} 小时前","collab.timeDay":"{n} 天前","page.token.title":"用量","page.token.sub":"每会话与累计用量及缓存率","status.connecting":"正在连接…","status.ready":"服务在线","status.running":"处理中","status.disconnected":"服务离线","status.stopped":"已停止","status.idle":"待命","conv.emptyList":"暂无会话,点「+ 新对话」开始","conv.defaultTitle":"新对话","err.bridge":"服务未响应","err.newSession":"新建会话失败","err.poll":"轮询失败","err.stop":"停止失败","err.interruptTimeout":"等待上一轮停止超时,请稍后再试","sys.interruptPrev.hint":"已停止上一轮,正在处理新消息","chat.interrupting":"正在停止上一轮…","chat.sessionLoading":"正在加载会话…","sys.stopRequested":"已请求停止","slash.help":`可用命令:
|
||
/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":"进入 Goal 模式:读 L3 goal mode SOP,自主达成我接下来描述的目标。","presetPrompt.plan":"进入 Plan 模式:先读 memory/plan_sop.md,按其中「探索→规划→执行→验证」流程,等我接下来描述要做的任务。","presetPrompt.autonomous":"🤖 进入自主行动模式:阅读 memory/autonomous_operation_sop.md,按 SOP 选取或规划任务,独立执行并产出报告。","presetPrompt.hive":"启动 Goal Hive 模式:按 hive SOP 拉起多个 worker 协同完成我接下来的目标。","presetPrompt.review":"进入监察者模式:对刚才的产出严格挑刺、逐项复核并报告问题。","presetPrompt.findwork":"按照自主行动的规划部分,充分分析我的情况,给我生成一批 TODO,务必让我感兴趣。","presetPrompt.mine":"抓取本周的 git 提交并写一份周报。","ask.banner":"应用正在等待你的回答","ask.replyHint":"在下方输入框回复","ask.placeholderOpen":"在此输入你的回答… (Enter 发送)","session.rename":"重命名","session.pin":"置顶","session.unpin":"取消置顶","session.delete":"删除","session.deleteConfirm":"确定删除这个会话吗?","bridge.connected":"已连接","bridge.connecting":"连接中","bridge.offline":"离线","bridge.offlineHint":"本地连接暂时不可用,请检查连接模式或稍后刷新界面","bridge.staleData":"本地连接已断开,正在显示上次状态","bridge.notRunning":"本地连接尚未建立","bridge.notRunningHint":"请从桌面版打开此页面以管理本地连接","bridge.inferenceReady":"推理就绪","bridge.inferenceConnecting":"推理连接中","bridge.inferenceError":"推理异常","bridge.inferenceOffline":"推理离线","bridge.restart":"重新连接","bridge.refresh":"刷新界面","bridge.openServices":"查看运行状态","bridge.recentActivity":"最近活动","bridge.viewAllLogs":"查看全部日志","bridge.logLineCount":"共 {count} 行","bridge.noActivity":"暂无活动记录","conductor.openPage":"打开指挥家 →","data.title":"数据维护","data.sectionHelp":"数据维护说明","data.sectionTip":"在这里导入或导出密钥配置、记忆与会话;记忆与会话备份默认不包含密钥配置","data.importKey":"导入密钥配置","data.importKeyTip":"从本地配置文件读取模型密钥与接口地址,并替换当前密钥配置","data.importKeyBtn":"导入","data.importKeySuccess":"密钥配置已导入","data.importKeyError":"导入失败","data.exportKey":"导出密钥配置","data.exportKeyTip":"将当前模型密钥与接口地址单独保存为配置文件;文件包含敏感信息,请妥善保管","data.exportKeyBtn":"导出","data.exportKeySuccess":"已导出","data.exportKeyError":"导出失败","data.importData":"导入记忆与会话","data.importDataTip":"导入前会完整备份当前记忆;来源中的同名记忆会覆盖当前版本,回复记录与会话只添加新项,密钥配置不受影响","data.importDataBtn":"选择来源","data.importing":"正在读取…","data.importDataSuccess":"导入完成 — 写入 {memory} 个记忆文件,新增 {responses} 个回复记录和 {sessions} 个会话","data.importDataError":"导入失败","data.importDataInvalid":"无法读取此备份或数据文件夹","data.importSourceTitle":"选择导入来源","data.importSourceDescription":"可以直接导入本应用生成的备份文件(.zip),也可以从旧数据文件夹迁移。旧数据文件夹应选择GenericAgent根目录(包含 temp/desktop_sessions 等子文件夹)。","data.importBackupBtn":"选择备份文件","data.importFolderBtn":"选择旧数据文件夹","data.importBackupPickerTitle":"选择数据备份","data.importFolderPickerTitle":"选择旧数据文件夹","data.importConfirmTitle":"导入这些数据?","data.importConfirmBtn":"导入","data.importExportedAt":"备份时间","data.importSource":"数据来源","data.importContents":"包含内容","data.importContentsValue":"{memory} 个记忆文件、{sessions} 个会话、{responses} 个回复记录","data.importMergeNotice":"导入开始前会完整备份当前记忆。来源中的同名记忆会覆盖当前版本;回复记录和会话只添加新项,重复项保留当前数据。","data.importLegacySource":"旧数据文件夹","data.maintenanceBlocked":"请先停止所有运行中的会话和受管理服务,再导入或导出数据。当前会话状态:{sessions};运行服务:{services}。","data.maintenanceBlockedServer":"数据操作未开始:仍有 {sessions} 个会话或 {services} 个受管理服务在运行。请停止后重试。","data.externalProcessWarning":"导入前还应停止使用同一数据文件夹的其他 GenericAgent 命令行、终端进程和自动化;桌面应用无法暂停这些外部进程。","data.importResultTitle":"导入完成","data.importResultMemory":"记忆文件","data.importResultMemoryValue":"已写入 {count} 个(同名文件以来源为准)","data.importResultResponses":"回复记录","data.importResultSessions":"会话","data.importResultAddSkipValue":"新增 {added} 个,跳过 {skipped} 个重复项","data.importResultBackup":"导入前备份","data.importResultNoBackup":"本次无需创建导入前记忆备份","data.importRestoreHint":"如需恢复,请先停止会话、受管理服务及使用同一数据文件夹的外部进程,再从以上目录恢复 memory 文件夹。","data.importNoRestoreNeeded":"本次没有需要预先备份的记忆变更。回复记录和会话仍按只新增规则处理。","data.exportData":"导出记忆与会话","data.exportDataTip":"将当前记忆和历史会话创建为一份备份快照;不会移动或删除原数据,也不包含密钥配置","data.exportDataBtn":"导出","data.exporting":"正在导出…","data.exportDataConfirmTitle":"导出记忆与会话?","data.exportDataConfirmMessage":"导出文件将包含记忆和历史会话,请妥善保管。密钥配置不会包含在内。","data.exportDataConfirmBtn":"选择保存位置","data.exportDataPickerTitle":"保存数据备份","data.exportDataSuccessTitle":"导出完成","data.exportDataSuccessMessage":"备份已保存到:","data.exportDataReveal":"在 Finder 中显示","data.exportDataError":"导出失败","data.exportDataRevealError":"无法在 Finder 中显示此文件","connection.title":"连接模式","connection.sectionHelp":"连接模式说明","connection.sectionTip":"连接模式决定本桌面应用从哪里运行;切换不会复制、移动或合并两边的数据","connection.description":"选择本桌面应用从哪里运行:使用本桌面应用内置的运行环境,或连接你已有的本地仓库。切换后,记忆与会话也会随所选位置切换。","connection.included":"内置运行环境","connection.includedDescription":"使用本桌面应用内置的运行环境,无需另选仓库,开箱即用并支持离线使用","connection.includedTip":"这套运行环境随桌面应用安装,不需要你准备其他仓库;切换到这里后,将使用内置环境中的记忆与会话","connection.local":"本地仓库","connection.localDescription":"连接你在使用桌面版之前已经拥有的本地仓库,继续使用其中的记忆与会话","connection.localTip":"桌面应用会直接连接你选择的本地仓库,不会把仓库复制、移动或合并到内置运行环境","connection.current":"当前使用","connection.currentRepository":"当前仓库","connection.pendingRepository":"将连接到","connection.chooseRepository":"选择本地仓库","connection.changeRepository":"重新选择","connection.repositoryPickerTitle":"选择本地仓库","connection.repositoryValidated":"仓库可用,应用后生效","connection.pendingNotice":"所选模式尚未应用","connection.runningTaskBlock":"请等待当前任务完成后再切换连接模式","connection.apply":"应用并连接","connection.applying":"正在连接…","connection.includedSuccess":"正在使用内置运行环境","connection.localSuccess":"正在使用所选本地仓库","connection.status":"运行状态","connection.statusTip":"显示当前所选运行环境是否可用;详细页面可查看运行组件、日志和控制项","connection.statusReady":"运行正常","connection.statusConnecting":"正在连接","connection.statusUnavailable":"暂时不可用","connection.viewStatus":"查看运行状态","connection.errorInvalid":"无效仓库 — 缺少必要文件","connection.errorIncompatible":"此仓库与当前桌面版不兼容","connection.errorTimeout":"连接超时 — 请检查仓库是否完整","connection.errorGeneric":"无法完成连接,请稍后重试","helpFeedback.title":"帮助与反馈","helpFeedback.communityTitle":"加入官方社群","helpFeedback.communityDescription":"前往项目主页查看最新的官方社群二维码。","helpFeedback.communityAction":"查看社群二维码","helpFeedback.tutorialTitle":"阅读官方教程","helpFeedback.tutorialDescription":"从安装、配置到日常使用,跟随教程逐步了解。","helpFeedback.tutorialAction":"打开官方教程","helpFeedback.maintainersTitle":"联系桌面版维护者","helpFeedback.maintainersDescription":"桌面版使用中遇到问题或有建议,可添加微信联系:","helpFeedback.copy":"复制","helpFeedback.copySuccess":"微信号已复制","helpFeedback.copyError":"复制失败,请手动复制微信号"},zd={"app.title":"GenericAgent","brand.sub":"","nav.chat":"New Session","nav.services":"Runtime status","nav.channels":"Message channels","nav.status":"Runtime status","nav.collab":"Conductor","nav.token":"Usage","foot.settings":"Settings","foot.runtimeManagement":"Runtime management","foot.ver":"GenericAgent","chat.startTitle":"Start a conversation","chat.startSub":"Type a message, or pick a preset","chat.inputPlaceholder":"Type a message…","preset.butler.t":"Conductor","preset.butler.d":"Auto-decompose complex tasks; just check progress and briefings","preset.plan.t":"Plan mode","preset.plan.d":"Load Plan SOP — explore→plan→execute→verify","preset.goal.t":"Goal mode","preset.goal.d":"Set a goal, run autonomously","preset.autonomous.t":"Autonomous mode","preset.autonomous.d":"Plan/execute tasks per SOP and produce reports (same as reflect/autonomous.py)","preset.hive.t":"Hive","preset.hive.d":"Multi-worker collaboration","preset.review.t":"Deep review","preset.review.d":"Strict quality check","preset.findwork.t":"Find me work","preset.findwork.d":"Analyze my context and suggest a batch of interesting TODOs","preset.mine.t":"My · Weekly","preset.mine.d":"Custom: weekly report from commits","preset.add.t":"Custom","preset.add.d":"Save any prompt as a function","composer.placeholder":"What are we building?","composer.placeholder.new.0":"What are we building? @ mention files · / invoke skills","composer.placeholder.new.1":"Give me a task","composer.placeholder.new.2":"What's on your mind?","composer.placeholder.new.3":"Describe what you need","composer.placeholder.new.4":"What should we tackle?","composer.placeholder.new.5":"Ask anything","composer.placeholder.new.6":"Start with a goal","composer.placeholder.followUp.0":"Send a follow-up","composer.placeholder.followUp.1":"Add more context","composer.placeholder.followUp.2":"Refine the request","composer.placeholder.followUp.3":"What's next?","composer.placeholder.followUp.4":"Keep it going","composer.placeholder.reconnecting":"Reconnecting…","search.placeholder":"Search chats…","search.noResults":"No matching chats","conv.new":"New chat","section.sessions":"Sessions","ctx.pin":"Pin","ctx.unpin":"Unpin","ctx.rename":"Rename","ctx.del":"Delete","common.close":"Close","common.more":"More","common.optional":"Optional","common.save":"Save","common.cancel":"Cancel","common.confirm":"Confirm","common.edit":"Edit","common.delete":"Delete","common.done":"Done","modal.preset":"Presets","modal.addModel":"Add model","modal.editModel":"Edit model","modal.settings":"Settings","modal.features":"Features","modal.customPreset":"Custom preset","modal.editCustomPreset":"Edit task","customPreset.titlePh":'Title, e.g. "Weekly report"',"customPreset.promptPh":"Prompt body — sent as the message when clicked","customPreset.empty":"Title and Prompt cannot be empty","customPreset.removeTitle":"Delete","customPreset.editTitle":"Edit","builtinPreset.restoreBtn":"Restore defaults","set.appearance":"Appearance","set.plainUi":"Plain","set.fontSize":"Chat font size","set.lang":"Language","set.model":"Model configuration","set.addModel":"Add model","set.features":"Features","set.importMykey":"Import key configuration","set.exportMykey":"Export current model config","set.serviceManager":"Runtime status","shortcut.askConfirm":"Create a desktop shortcut for GenericAgent?","appearance.light":"Light","appearance.dark":"Dark","set.noModels":"No models yet — add one below","set.current":"New chat default","lang.zh":"简体中文","lang.en":"English","model.name":"Alias","model.namePh":"Optional, for your own reference","model.apikey":"API Key","model.apikeyPh":"Enter API Key","model.apikeyKeep":"Leave blank to keep the current key","model.apibase":"API URL","model.apibasePh":"Enter API URL","model.protocol":"Protocol","model.protocolPick":"Select…","model.protocolOai":"OpenAI-compatible (chat/completions)","model.protocolClaude":"Anthropic (Claude /v1/messages)","model.stream":"Response","model.streamOn":"Stream","model.streamOff":"Non-stream","model.model":"Model ID","model.modelPh":"Enter model identifier","model.modelHint":"Must match the model field in your provider docs exactly","model.retries":"Retries","model.connTimeout":"Connect (s)","model.readTimeout":"Read (s)","model.save":"Save","model.auto":"Auto","model.menuLabel":"Select model","model.aggregation":"Default group","model.aggregationShort":"Default","model.aggregationDesc":"Tries in order, switches to the next on failure","model.configurationHelp":"About model configuration","model.configurationTip":"Set the default model for new sessions; you can still switch models from the composer for an individual session","model.aggregationTip":"The default group tries models in list order and automatically moves to the next when one is unavailable","model.emptyMixin":"No models added yet","model.addToMixin":"Add to default group","model.inMixin":"In default group","model.removeFromMixin":"Remove from group","model.alreadyInMixin":"Already in the group","model.dragReorder":"Drag to reorder","model.routeProvider":"Provider","model.routeCustom":"Custom","model.selectProvider":"Select provider","model.providerLocked":"Set by provider preset (read-only)","model.advanced":"Advanced","model.getKey":"Get API Key →","pq.title":"Quick connect a model","pq.sub":"Add your API key to get started","pq.toggle":"Expand / collapse","pq.deepseekDesc":"DeepSeek · Open Platform","pq.qwenDesc":"Alibaba Cloud Bailian · Qwen","pq.doubaoDesc":"Volcengine · Ark Platform","pq.minimaxDesc":"MiniMax · Open Platform","pq.zhipuDesc":"Zhipu AI · GLM Platform","pq.kimiDesc":"Moonshot AI · Developer Platform","pq.stepfunDesc":"StepFun · Open Platform","guide.step1":"Open the link, sign in, then create & copy your API key","guide.step2":'Paste the key into the "API Key" field below',"guide.step3":"Click Save — then pick it from the model list","guide.prefillTip":"API base, protocol and model are pre-filled — edit if needed","guide.getKey":"Get your {name} API key","guide.copy":"Copy link","guide.copied":"Link copied","err.modelSave":"Save failed","err.modelRequired":"Model, API Key and base URL are required","err.modelDelete":"Delete failed","err.modelDeleteLast":"At least one model is required","err.mixinFailed":"Operation failed","confirm.modelDelete":"Delete this model profile?","page.services.title":"Runtime status","page.services.sub":"View message channels and the status, logs, and controls for components in the local environment","svc.colName":"Runtime component","svc.colStatus":"Status","svc.colPid":"PID","svc.colMemory":"Memory (MB)","svc.colCpu":"CPU (%)","svc.colActions":"Actions","svc.empty":"No runtime components","page.channels.title":"Message channels","page.channels.sub":"Manage message channels and view their status and logs","page.status.title":"Runtime status","page.status.sub":"View status, logs, and controls for components in the local environment","page.collab.title":"Conductor","page.collab.sub":"Describe a goal — split, delegate, and follow up","collab.progressTitle":"Progress","collab.progressEmpty":"No tasks running yet. After you describe a goal to Conductor, split tasks will appear here.","collab.placeholder":"Describe the goal you want to accomplish","collab.guideTitle":"Tell Conductor what you want done","collab.guideWhen":"Best for multi-step goals that take a while. For everyday chat and quick questions, use Chat in the sidebar.","collab.guideStep1t":"Describe your goal","collab.guideStep1d":"Write what you want done in the chat box and send it to Conductor","collab.guideStep2t":"Auto breakdown","collab.guideStep2d":"Conductor breaks down, assigns, monitors, and coordinates","collab.guideStep3t":"Summary","collab.guideStep3d":"Conductor delivers a briefing based on execution status","collab.guideStep4t":"Adjust anytime","collab.guideStep4d":"Add requirements or details anytime — Conductor handles them","collab.chipProgress":"How is it going?","collab.chipPause":"Pause current tasks","collab.chipSummary":"Summarize progress so far","collab.showProgressTitle":"View task progress","collab.statRunning":"Running","collab.statDone":"Done","collab.plusMenu":"More actions","collab.switchMode":"Switch mode","collab.typing":"Conductor is working","collab.offline":"The Conductor service is temporarily unavailable. Try again shortly.","collab.offlineTitle":"Conductor Offline","collab.offlineSub":"Conductor is temporarily unavailable. Check your connection and try again.","collab.retry":"Retry","collab.terminateWorker":"Terminate task","collab.terminateWorkerConfirm":"Terminate “{name}”? Current progress from this worker may be lost.","collab.terminateWorkerFailed":"Failed to terminate the task","collab.reconnect":"Disconnected — reconnecting… Your last progress is kept.","collab.reconnectIn":"Retry in {n}s","collab.stRunning":"Running","collab.stReported":"Reported","collab.stPaused":"Paused","collab.stFailed":"Issue","collab.stTerminated":"Ended","collab.summaryRunning":"Working…","collab.summaryWait":"Awaiting report","collab.taskFallback":"Task {n}","collab.timeJust":"just now","collab.timeSec":"{n}s ago","collab.timeMin":"{n}m ago","collab.timeHr":"{n}h ago","collab.timeDay":"{n}d ago","page.token.title":"Usage","page.token.sub":"Per-session and total usage & cache rate","status.connecting":"Connecting…","status.ready":"Service online","status.running":"Working…","status.disconnected":"Service offline","status.stopped":"Stopped","status.idle":"Standby","conv.emptyList":'No chats yet — click "+ New chat"',"conv.defaultTitle":"New chat","err.bridge":"Service not responding","err.newSession":"Failed to create session","err.poll":"Polling failed","err.stop":"Stop failed","err.interruptTimeout":"Timed out waiting for the previous reply to stop — try again","sys.interruptPrev.hint":"Previous reply stopped — processing new message","chat.interrupting":"Stopping previous reply…","chat.sessionLoading":"Loading conversation…","sys.stopRequested":"Stop requested","slash.help":`Commands:
|
||
/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: $","presetPrompt.goal":"Enter Goal mode: read the L3 goal-mode SOP and autonomously achieve the goal I describe next.","presetPrompt.plan":"Enter Plan mode: first read memory/plan_sop.md, follow its explore→plan→execute→verify flow, and wait for the task I describe next.","presetPrompt.autonomous":"🤖 Enter autonomous mode: read memory/autonomous_operation_sop.md, follow the SOP to pick or plan a task, execute independently, and produce a report.","presetPrompt.hive":"Start Goal Hive mode: per the hive SOP, spawn multiple workers to collaboratively achieve the goal I describe next.","presetPrompt.review":"Enter reviewer mode: strictly scrutinize the previous output, review item by item and report issues.","presetPrompt.findwork":"Following the autonomous planning section, analyze my situation thoroughly and generate a batch of TODOs that genuinely interest me.","presetPrompt.mine":"Collect this week's git commits and write a weekly report.","ask.banner":"The app is waiting for your answer","ask.replyHint":"Reply in the input below","ask.placeholderOpen":"Type your answer here… (Enter to send)","session.rename":"Rename","session.pin":"Pin","session.unpin":"Unpin","session.delete":"Delete","session.deleteConfirm":"Delete this session?","bridge.connected":"Connected","bridge.connecting":"Connecting","bridge.offline":"Offline","bridge.offlineHint":"The local connection is temporarily unavailable. Check Connection mode or refresh the interface shortly.","bridge.staleData":"Local connection lost — showing the last known state","bridge.notRunning":"Local connection has not been established","bridge.notRunningHint":"Open this page in the desktop app to manage the local connection","bridge.inferenceReady":"Inference ready","bridge.inferenceConnecting":"Connecting","bridge.inferenceError":"Inference error","bridge.inferenceOffline":"Inference offline","bridge.restart":"Reconnect","bridge.refresh":"Refresh interface","bridge.openServices":"View runtime status","bridge.recentActivity":"RECENT ACTIVITY","bridge.viewAllLogs":"View all logs","bridge.logLineCount":"{count} lines","bridge.noActivity":"No recent activity","conductor.openPage":"Open Conductor →","data.title":"Data management","data.sectionHelp":"About data management","data.sectionTip":"Import or export key configuration, memory, and sessions here; memory and session backups do not include key configuration by default","data.importKey":"Import key config","data.importKeyTip":"Read model keys and endpoints from a local config file and replace the current key configuration","data.importKeyBtn":"Import","data.importKeySuccess":"Key config imported","data.importKeyError":"Import failed","data.exportKey":"Export key config","data.exportKeyTip":"Save current model keys and endpoints as a separate config file; the file contains sensitive information, so store it securely","data.exportKeyBtn":"Export","data.exportKeySuccess":"Exported","data.exportKeyError":"Export failed","data.importData":"Import memory and sessions","data.importDataTip":"The current memory is fully backed up first; source memory overwrites same-name files, while response records and sessions are add-only. Key configuration is unchanged","data.importDataBtn":"Choose source","data.importing":"Reading…","data.importDataSuccess":"Import complete — {memory} memory files written, {responses} response records and {sessions} sessions added","data.importDataError":"Import failed","data.importDataInvalid":"This backup or data folder could not be read","data.importSourceTitle":"Choose an import source","data.importSourceDescription":"Import a backup created by this app (.zip), or migrate from an older data folder. For a folder, pick the GenericAgent root directory (the one containing temp/desktop_sessions).","data.importBackupBtn":"Choose backup file","data.importFolderBtn":"Choose older data folder","data.importBackupPickerTitle":"Choose a data backup","data.importFolderPickerTitle":"Choose an older data folder","data.importConfirmTitle":"Import this data?","data.importConfirmBtn":"Import","data.importExportedAt":"Backup time","data.importSource":"Data source","data.importContents":"Contents","data.importContentsValue":"{memory} memory files, {sessions} sessions, {responses} response records","data.importMergeNotice":"Current memory is fully backed up before import. Source memory overwrites same-name files; response records and sessions are add-only, so current duplicates are kept.","data.importLegacySource":"Older data folder","data.maintenanceBlocked":"Stop every running session and managed service before importing or exporting data. Session state: {sessions}; running services: {services}.","data.maintenanceBlockedServer":"The data operation did not start: {sessions} sessions or {services} managed services are still running. Stop them and try again.","data.externalProcessWarning":"Before importing, also stop other GenericAgent command-line or terminal processes and automations that use the same data folder. The desktop app cannot pause those external processes.","data.importResultTitle":"Import complete","data.importResultMemory":"Memory files","data.importResultMemoryValue":"{count} written (source wins for same-name files)","data.importResultResponses":"Response records","data.importResultSessions":"Sessions","data.importResultAddSkipValue":"{added} added, {skipped} duplicates skipped","data.importResultBackup":"Pre-import backup","data.importResultNoBackup":"No pre-import memory backup was required","data.importRestoreHint":"To restore, first stop sessions, managed services, and external processes using this data folder, then restore the memory folder from the directory above.","data.importNoRestoreNeeded":"This import had no memory change that required a prior backup. Response records and sessions still followed the add-only rule.","data.exportData":"Export memory and sessions","data.exportDataTip":"Create a backup snapshot of current memory and session history; original data stays in place and key configuration is not included","data.exportDataBtn":"Export","data.exporting":"Exporting…","data.exportDataConfirmTitle":"Export memory and sessions?","data.exportDataConfirmMessage":"The export contains memory and session history. Store it securely. Key configuration is not included.","data.exportDataConfirmBtn":"Choose save location","data.exportDataPickerTitle":"Save data backup","data.exportDataSuccessTitle":"Export complete","data.exportDataSuccessMessage":"Your backup was saved to:","data.exportDataReveal":"Show in Finder","data.exportDataError":"Export failed","data.exportDataRevealError":"This file could not be shown in Finder","connection.title":"Connection mode","connection.sectionHelp":"About connection mode","connection.sectionTip":"Connection mode decides where this desktop app runs from; switching does not copy, move, or merge data between the two locations","connection.description":"Choose where this desktop app runs from: the environment installed with the desktop app or a local repository you already own. Memory and sessions follow the selected location.","connection.included":"Included environment","connection.includedDescription":"Use the environment included with this desktop app, with no repository selection required and offline use supported","connection.includedTip":"This environment is installed with the desktop app, so you do not need to prepare another repository; selecting it uses the memory and sessions stored in the included environment","connection.local":"Local repository","connection.localDescription":"Connect a local repository you already owned before using the desktop app and continue with its memory and sessions","connection.localTip":"The desktop app connects directly to the selected local repository and does not copy, move, or merge it into the included environment","connection.current":"Current","connection.currentRepository":"Current repository","connection.pendingRepository":"Will connect to","connection.chooseRepository":"Choose local repository","connection.changeRepository":"Choose again","connection.repositoryPickerTitle":"Choose a local repository","connection.repositoryValidated":"Repository is available — apply to use it","connection.pendingNotice":"The selected mode has not been applied","connection.runningTaskBlock":"Wait for the current task to finish before switching connection mode","connection.apply":"Apply and connect","connection.applying":"Connecting…","connection.includedSuccess":"Using the included environment","connection.localSuccess":"Using the selected local repository","connection.status":"Runtime status","connection.statusTip":"Shows whether the selected environment is available; open the detailed page to view its components, logs, and controls","connection.statusReady":"Running normally","connection.statusConnecting":"Connecting","connection.statusUnavailable":"Temporarily unavailable","connection.viewStatus":"View runtime status","connection.errorInvalid":"Invalid repository — required files are missing","connection.errorIncompatible":"This repository is incompatible with the current desktop app","connection.errorTimeout":"Connection timed out — check that the repository is complete","connection.errorGeneric":"Could not connect. Try again shortly.","helpFeedback.title":"Help & Feedback","helpFeedback.communityTitle":"Join the official community","helpFeedback.communityDescription":"Visit the project page for the latest official community QR code.","helpFeedback.communityAction":"View community QR code","helpFeedback.tutorialTitle":"Read the official tutorial","helpFeedback.tutorialDescription":"Follow the tutorial from installation and setup through everyday use.","helpFeedback.tutorialAction":"Open official tutorial","helpFeedback.maintainersTitle":"Contact the desktop maintainers","helpFeedback.maintainersDescription":"If you run into an issue or have a suggestion while using the desktop app, contact us on WeChat:","helpFeedback.copy":"Copy","helpFeedback.copySuccess":"WeChat ID copied","helpFeedback.copyError":"Copy failed. Please copy the WeChat ID manually."},zr={zh:Ad,en:zd};function Fd(n,e,t){let r=(zr[n]||zr.zh)[e]??e;if(t)for(const[s,l]of Object.entries(t))r=r.replaceAll(`{${s}}`,String(l));return r}function he(){const n=Z(e=>e.lang);return a.useMemo(()=>({lang:n,t:(e,t)=>Fd(n,e,t)}),[n])}function Bd({label:n,count:e,open:t,onToggle:o,onAction:r,defaultOpen:s=!0}){const[l,c]=a.useState(s),u=t??l;function p(){const m=!u;c(m),o==null||o(m)}function d(m){m.stopPropagation(),r==null||r()}return i.jsxs("div",{className:"ga-section-header",onClick:p,children:[i.jsx("span",{className:"ga-section-dot"}),i.jsx("span",{className:"ga-section-label",children:n}),i.jsx("span",{className:"ga-section-count",children:e}),i.jsx("span",{className:`ga-section-chevron${u?" open":""}`,children:i.jsx(Pe,{name:"chevron-right",size:"0.625rem"})}),r&&i.jsx("button",{type:"button",className:"ga-section-action",onClick:d,children:i.jsx(Pe,{name:"add",size:"0.75rem"})})]})}function Ud(n){const e=Math.floor(n/1e3);if(e<60)return`${e}s`;const t=Math.floor(e/60),o=e%60;return`${t}m ${o}s`}function Vd({since:n}){const[e,t]=a.useState(Date.now());return a.useEffect(()=>{const o=setInterval(()=>t(Date.now()),1e3);return()=>clearInterval(o)},[]),i.jsx(i.Fragment,{children:Ud(e-n)})}function Kd(n){if(!n)return"";const e=typeof n=="number"?n*1e3:new Date(n).getTime(),t=Date.now()-e,o=Math.floor(t/6e4);if(o<1)return"now";if(o<60)return`${o}m`;const r=Math.floor(o/60);return r<24?`${r}h`:`${Math.floor(r/24)}d`}function Wd({session:n,isActive:e,isWorking:t,onClick:o}){const{t:r}=he(),s=G(E=>E.renameSession),l=G(E=>E.deleteSession),c=G(E=>E.pinSession),u=G(E=>E.turnStarts[n.id]),[p,d]=a.useState(!1),[m,f]=a.useState(!1),[y,b]=a.useState(""),x=a.useRef(null);a.useEffect(()=>{var E,O;m&&((E=x.current)==null||E.focus(),(O=x.current)==null||O.select())},[m]);const C=a.useCallback(()=>{b(n.title||""),f(!0),d(!1)},[n.title]),S=a.useCallback(()=>{const E=y.trim();E&&E!==n.title&&s(n.id,E),f(!1)},[y,n.id,n.title,s]),k=a.useCallback(()=>{f(!1)},[]),_=a.useCallback(E=>{E.nativeEvent.isComposing||E.keyCode===229||(E.key==="Enter"?(E.preventDefault(),S()):E.key==="Escape"&&(E.preventDefault(),k()))},[S,k]),v=a.useCallback(()=>{d(!1),setTimeout(()=>c(n.id,!n.pinned),0)},[n.id,n.pinned,c]),j=a.useCallback(()=>{d(!1),setTimeout(()=>{le.confirm({title:r("session.delete"),content:r("session.deleteConfirm"),okType:"danger",onOk:()=>l(n.id)})},0)},[n.id,l,r]),w=i.jsxs(ue.Menu,{className:"ga-session-menu",children:[i.jsxs(ue.Item,{onClick:C,children:[i.jsx(Pe,{name:"edit",size:"0.875rem"}),i.jsx("span",{children:r("session.rename")})]}),i.jsxs(ue.Item,{onClick:v,children:[i.jsx(Pe,{name:"pin",size:"0.875rem"}),i.jsx("span",{children:n.pinned?r("session.unpin"):r("session.pin")})]}),i.jsxs(ue.Item,{type:"danger",onClick:j,children:[i.jsx(Pe,{name:"trash",size:"0.875rem"}),i.jsx("span",{children:r("session.delete")})]})]});return i.jsxs("div",{className:`ga-session-item${e?" active":""}`,onClick:m||p?void 0:o,children:[i.jsxs("span",{className:"ga-session-content",children:[i.jsx("span",{className:`ga-status-dot${t?" working":""}`}),m?i.jsx("input",{ref:x,className:"ga-session-rename-input",value:y,onChange:E=>b(E.target.value),onKeyDown:_,onBlur:S,onClick:E=>E.stopPropagation()}):i.jsx("span",{className:"ga-session-title",children:n.title||"Untitled"})]}),!m&&i.jsxs(i.Fragment,{children:[n.pinned&&i.jsx("span",{className:"ga-session-pin-icon",children:i.jsx(Pe,{name:"pinned",size:"0.875rem"})}),t&&u?i.jsx("span",{className:"ga-session-age ga-session-duration",children:i.jsx(Vd,{since:u})}):i.jsx("span",{className:"ga-session-age",children:Kd(n.updatedAt)}),i.jsx("span",{className:`ga-session-actions${p?" menu-open":""}`,onClick:E=>E.stopPropagation(),onMouseDown:E=>E.stopPropagation(),children:i.jsx(ue,{trigger:"click",position:"bottomRight",visible:p,onVisibleChange:d,render:w,children:i.jsx("button",{type:"button",className:"ga-session-actions-btn",onClick:E=>E.stopPropagation(),"aria-label":"Session actions",children:i.jsx(Pe,{name:"kebab-vertical",size:"0.875rem"})})})})]})]})}function Hd(n){const e=Xs(n),t=Ve("bridge-ready",()=>n());return()=>{t(),e()}}function Wo(){return a.useSyncExternalStore(Hd,Jo,Jo)}async function Zd(){const n=await fetch(`${ne}/services/conductor/model`);if(!n.ok)throw new Error(`HTTP ${n.status}`);return(await n.json()).model}async function qd(n){const e=await fetch(`${ne}/services/conductor/model`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({llmNo:n})});if(!e.ok)throw new Error(`HTTP ${e.status}`);return(await e.json()).model}async function Gd(){const n=await fetch(`${ne}/services/panel`);if(!n.ok)throw new Error(`HTTP ${n.status}`);return(await n.json()).services??[]}async function Qd(n){const e=await fetch(`${ne}/services/start`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:n})});if(!e.ok)throw new Error(`HTTP ${e.status}`);const t=await e.json();return{ok:t.ok??!0,service:t.service}}async function Yd(n){const e=await fetch(`${ne}/services/stop`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:n})});if(!e.ok)throw new Error(`HTTP ${e.status}`);const t=await e.json();return{ok:t.ok??!0,service:t.service}}async function yi(n,e=200){const t=await fetch(`${ne}/services/logs?id=${encodeURIComponent(n)}&tail=${e}`);if(!t.ok)throw new Error(`HTTP ${t.status}`);return(await t.json()).lines??[]}async function Xd(){const n=await fetch(`${ne}/services/mykey`);if(!n.ok)throw new Error(`HTTP ${n.status}`);return(await n.json()).content??""}async function Jd(n){const e=await fetch(`${ne}/services/mykey`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:n})});if(!e.ok)throw new Error(`HTTP ${e.status}`);return(await e.json()).ok??!1}async function eu(){const n=await fetch(`${ne}/services/bridge/exit`,{method:"POST"});if(!n.ok)throw new Error(`HTTP ${n.status}`);return(await n.json()).ok??!1}const tu=1200,nu=3e4,ou=5;function ru(n,e){return n==="running"?"running":n==="failed"?"failed":n==="aborted"?"terminated":n==="stopped"&&e.trim()?"reported":"paused"}let su=0;const Yn=new Map;function Fr(n){const e=String(n.id??"");Yn.has(e)||Yn.set(e,++su);const t=ru(String(n.status??""),String(n.reply??""));let o=String(n.prompt??"").replace(/^[\s请帮我麻烦]+/u,"").trim();o?(o=(o.split(/[\n。!?.!?]/)[0]||"").trim(),o.length>18&&(o=o.slice(0,18)+"…")):o=`Task #${Yn.get(e)}`;const r=String(n.reply??"").replace(/\s+/g," ").trim(),s=r?r.length>80?r.slice(0,80)+"…":r:t==="running"?"Working…":"Waiting…";return{id:e,title:o,status:t,summary:s,fullReply:String(n.reply??""),updatedAt:n.updated_at}}let Ie=null,st=0,$e=null,it=0,at=!1;const bi=ft((n,e)=>{function t(){if($e&&clearTimeout($e),!at&&it>=ou){n({connectionStatus:"offline"});return}const r=Math.min(nu,tu*Math.pow(2,Math.max(0,it-1)));n({connectionStatus:"connecting"}),$e=setTimeout(()=>e().connect(),r)}function o(r,s){if(s===st)if(r.type==="hello"){const l=(r.chat||[]).map(u=>({id:String(u.id??""),role:u.role||"system",msg:String(u.msg??""),ts:u.ts,read:u.read,files:u.files||[],images:u.images||[]})),c=(r.subagents||[]).map(Fr);n({messages:l,workers:c,conductorTyping:!!r.running,runtimeModel:r.model??null})}else if(r.type==="subagents"){const l=(r.items||[]).map(Fr);n({workers:l})}else if(r.type==="chat"){const l=r.item,c={id:String(l.id??""),role:l.role||"system",msg:String(l.msg??""),ts:l.ts,read:l.read,files:l.files||[],images:l.images||[]};n(u=>{if(c.id&&u.messages.some(d=>d.id===c.id))return u;if(c.role==="user"){const d=c.msg.replace(/\[(Image|File)\s+#\d+\]\s*/g,"").trim();for(let m=u.messages.length-1;m>=0;m--){const f=u.messages[m];if(f._local&&f.role==="user"&&(f.msg.replace(/\[(Image|File)\s+#\d+\]\s*/g,"").trim()===d||f.msg===c.msg)){const b=[...u.messages];return b[m]={...b[m],id:c.id||b[m].id,ts:c.ts??b[m].ts,_local:!1},{messages:b}}}}const p=c.role==="conductor"?!1:u.conductorTyping;return{messages:[...u.messages,c],conductorTyping:p}})}else r.type==="model"&&n({runtimeModel:r.model})}return{connectionStatus:"offline",messages:[],workers:[],conductorTyping:!1,modelConfig:null,runtimeModel:null,connect(){if(Ie&&(Ie.readyState===WebSocket.OPEN||Ie.readyState===WebSocket.CONNECTING))return;$e&&(clearTimeout($e),$e=null);const r=++st;n({connectionStatus:"connecting"});let s;try{s=new WebSocket(Ea)}catch{it++,t();return}Ie=s,s.onopen=()=>{r===st&&(at=!0,it=0,n({connectionStatus:"ready"}),e().loadModel())},s.onclose=()=>{r===st&&(n({connectionStatus:at?"connecting":"offline"}),at||it++,t())},s.onerror=()=>{},s.onmessage=l=>{if(r===st)try{o(JSON.parse(l.data),r)}catch{}}},disconnect(){if(st++,$e&&(clearTimeout($e),$e=null),Ie){const r=Ie;Ie=null,r.onopen=r.onclose=r.onerror=r.onmessage=null;try{r.close()}catch{}}it=0,at=!1,n({connectionStatus:"offline",messages:[],workers:[],conductorTyping:!1,runtimeModel:null})},sendMessage(r,s,l){if(!Ie||Ie.readyState!==WebSocket.OPEN)return;const c={msg:r};s&&s.length>0&&(c.files=s),l&&l.length>0&&(c.images=l),Ie.send(JSON.stringify(c));const u={id:`local-${Date.now()}`,role:"user",msg:r,ts:Date.now()/1e3,files:s,images:l,_local:!0};n(p=>({messages:[...p.messages,u],conductorTyping:!0}))},async killWorker(r){const s=await fetch(`${ka}/subagent/${r}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"kill"})});if(!s.ok)throw new Error(`Failed to terminate worker (${s.status})`)},async loadModel(){try{n({modelConfig:await Zd()})}catch{}},async selectModel(r){const s=e().modelConfig;n({modelConfig:{configured:r,effective:r,fallbackReason:null}});try{n({modelConfig:await qd(r)})}catch{n({modelConfig:s})}}}});bi.getState().connect();function iu({className:n,...e}){return i.jsx("div",{className:`ga-log-view ${n??""}`,"data-selectable-text":"true",...e})}function Br({tone:n}){const e={good:"var(--ui-accent, #0053fd)",warn:"#f59e0b",bad:"#cf2d56",muted:"color-mix(in srgb, var(--ui-text-tertiary) 40%, transparent)"};return i.jsx("span",{"aria-hidden":"true",className:n==="warn"?"ga-statusbar-dot--pulse":void 0,style:{display:"inline-block",width:"6px",height:"6px",borderRadius:"50%",background:e[n],flexShrink:0}})}function au(){return i.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none",children:[i.jsx("path",{d:"M13.5 2.5v4h-4",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"}),i.jsx("path",{d:"M2.5 8a5.5 5.5 0 0 1 9.3-3.95L13.5 6.5",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"}),i.jsx("path",{d:"M2.5 13.5v-4h4",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"}),i.jsx("path",{d:"M13.5 8a5.5 5.5 0 0 1-9.3 3.95L2.5 9.5",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})]})}function lu(){return i.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none",children:[i.jsx("rect",{x:"2",y:"2",width:"5",height:"5",rx:"0.5",stroke:"currentColor",strokeWidth:"1.3"}),i.jsx("rect",{x:"9",y:"2",width:"5",height:"5",rx:"0.5",stroke:"currentColor",strokeWidth:"1.3"}),i.jsx("rect",{x:"2",y:"9",width:"5",height:"5",rx:"0.5",stroke:"currentColor",strokeWidth:"1.3"}),i.jsx("rect",{x:"9",y:"9",width:"5",height:"5",rx:"0.5",stroke:"currentColor",strokeWidth:"1.3"})]})}const Ur=[{id:"__bridge__",labelKey:"proc.bridge"},{id:"frontends/conductor.py",labelKey:"proc.conductor"},{id:"reflect/scheduler.py",labelKey:"proc.scheduler"}],Vr=12,cu=3e3;function du({onClose:n}){const{t:e}=he(),t=Wo(),o=bi(v=>v.connectionStatus),r=Te(v=>v.setPage),s=a.useRef(null),l=a.useRef(null),[c,u]=a.useState(Ur[0].id),[p,d]=a.useState(null),[m,f]=a.useState(0),y=a.useCallback(async v=>{try{const j=await yi(v,200);f(j.length),d(j.slice(-Vr))}catch{d([]),f(0)}},[]);a.useEffect(()=>(d(null),y(c),l.current=setInterval(()=>y(c),cu),()=>{l.current&&(clearInterval(l.current),l.current=null)}),[c,y]),a.useEffect(()=>{function v(w){var O;const E=(O=s.current)==null?void 0:O.parentElement;E&&!E.contains(w.target)&&n()}function j(w){w.key==="Escape"&&n()}return document.addEventListener("mousedown",v),document.addEventListener("keydown",j),()=>{document.removeEventListener("mousedown",v),document.removeEventListener("keydown",j)}},[n]);const b=t==="ready"?"good":t==="connecting"?"warn":"bad",x=o==="ready"?"good":o==="connecting"?"warn":o==="error"?"bad":"muted",C=e(t==="ready"?"bridge.connected":t==="connecting"?"bridge.connecting":"bridge.offline"),S=e(o==="ready"?"bridge.inferenceReady":o==="connecting"?"bridge.inferenceConnecting":o==="error"?"bridge.inferenceError":"bridge.inferenceOffline"),k=()=>{n(),Te.getState().setServicesTab("status"),r("services")},_=m>Vr;return i.jsxs("div",{ref:s,id:"ga-runtime-management-panel",className:"ga-bridge-panel","data-slot":"bridge-panel",role:"dialog","aria-label":e("foot.runtimeManagement"),children:[i.jsxs("div",{className:"ga-bridge-panel-header",children:[i.jsxs("div",{className:"ga-bridge-panel-status-rows",children:[i.jsxs("span",{className:"ga-bridge-panel-row ga-bridge-panel-row--primary",children:[i.jsx(Br,{tone:b}),C]}),i.jsxs("span",{className:"ga-bridge-panel-row ga-bridge-panel-row--secondary",children:[i.jsx(Br,{tone:x}),S]})]}),i.jsxs("div",{className:"ga-bridge-panel-actions",children:[i.jsx("button",{className:"ga-bridge-panel-action-btn",onClick:()=>{n(),window.location.reload()},title:e("bridge.refresh"),children:i.jsx(au,{})}),i.jsx("button",{className:"ga-bridge-panel-action-btn",onClick:k,title:e("bridge.openServices"),children:i.jsx(lu,{})})]})]}),i.jsxs("div",{className:"ga-bridge-panel-section",children:[i.jsx("div",{className:"ga-bridge-panel-tabs",children:Ur.map(v=>i.jsx("button",{className:`ga-bridge-panel-tab ${c===v.id?"active":""}`,onClick:()=>u(v.id),children:e(v.labelKey)},v.id))}),p===null?i.jsx("div",{className:"ga-bridge-panel-log-empty",children:"…"}):p.length===0?i.jsx("div",{className:"ga-bridge-panel-log-empty",children:e("bridge.noActivity")}):i.jsx(iu,{className:"ga-bridge-panel-log",children:p.join(`
|
||
`)}),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 uu=[{key:"services",icon:"symbol-misc",textKey:"nav.services"},{key:"collab",icon:"robot",textKey:"nav.collab"},{key:"token",icon:"graph",textKey:"nav.token"}];function pu(){const{activePage:n,setPage:e}=Te(),t=Z(O=>O.open),o=G(O=>O.newSession),r=G(O=>O.sessions),s=G(O=>O.activeSessionId),l=G(O=>O.setActiveSession),c=G(O=>O.runningSessions),{t:u}=he(),[p,d]=a.useState(!0),[m,f]=a.useState(""),[y,b]=a.useState(!1),[x,C]=a.useState(!1),S=a.useCallback(()=>b(!1),[]),k=a.useCallback(()=>{S(),t()},[S,t]),_=a.useCallback(()=>{C(!1),b(O=>!O)},[]),v=[...r].sort((O,D)=>{if(O.pinned&&!D.pinned)return-1;if(!O.pinned&&D.pinned)return 1;const P=Number(O.updatedAt||O.createdAt||0);return Number(D.updatedAt||D.createdAt||0)-P}),j=m.trim()?v.filter(O=>O.title.toLowerCase().includes(m.trim().toLowerCase())):v;function w(){o(),e("chat")}function E(O){l(O),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:w,"aria-label":u("nav.chat"),children:[i.jsx("span",{className:"ga-nav-icon",children:i.jsx(Pe,{name:"comment",size:"1rem"})}),i.jsx("span",{className:"ga-nav-label",children:u("nav.chat")})]}),uu.map(O=>i.jsxs("button",{type:"button",className:`ga-nav-btn${n===O.key?" active":""}`,onClick:()=>e(O.key),"aria-label":u(O.textKey),"aria-current":n===O.key?"page":void 0,children:[i.jsx("span",{className:"ga-nav-icon",children:i.jsx(Pe,{name:O.icon,size:"1rem"})}),i.jsx("span",{className:"ga-nav-label",children:u(O.textKey)})]},O.key))]}),i.jsx("div",{className:"ga-sidebar-search",children:i.jsx(dt,{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:w}),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(O=>i.jsx(Wd,{session:O,isActive:O.id===s,isWorking:c.has(O.id),onClick:()=>E(O.id)},O.id))}))}),i.jsxs("div",{className:"ga-sidebar-footer",children:[i.jsx(Ae,{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(Pe,{name:"settings-gear",size:"1rem"})})}),i.jsxs("div",{className:"ga-sidebar-footer-anchor",children:[i.jsx(Ae,{content:u("foot.runtimeManagement"),position:"top",visible:x&&!y,onVisibleChange:C,children:i.jsx("button",{type:"button",className:"ga-sidebar-footer-btn",onClick:_,"aria-label":u("foot.runtimeManagement"),"aria-expanded":y,"aria-haspopup":"dialog","aria-controls":"ga-runtime-management-panel",children:i.jsx(Pe,{name:"server-process",size:"1rem"})})}),y&&i.jsx(du,{onClose:S})]})]})]})}const hu=24;function mu(){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<hu;t(p),o.current=p},[]),l=a.useCallback((u="instant")=>{const p=n.current;p&&(u==="instant"?p.scrollTop=p.scrollHeight:fu(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 fu(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 gu(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 yu({children:n}){return i.jsx("div",{"data-slot":"aui_thread-content",children:n})}function gt(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=gt(n);if(t&&t.ticks>=5&&t.tag==="")return!0}return!!(/^\*\*LLM Running \(Turn \d+\)/.test(n)||/^<thinking>/i.test(n))}function vn(n,e,t){for(let o=e;o<n.length;o++)if(vi(n[o],t))return o;return n.length}function xn(n,e,t,o){let r=-1;for(let s=e;s<t;s++){const l=gt(n[s]);l&&l.ticks===o&&l.tag===""&&(r=s)}return r}function xi(n,e){const t=/^🛠️ Tool: `([^`]+)`/.exec(n[e]||"");if(!t)return null;const o=gt(n[e+1]);if(!o||o.tag!=="text")return null;const r=e+2,s=vn(n,r),l=xn(n,r,s,o.ticks);return l<0?null:{name:t[1],body:n.slice(r,l).join(`
|
||
`),nextLine:l+1}}function wi(n,e){const t=gt(n[e]);if(!t||t.ticks<5||t.tag!=="")return null;const o=e+1,r=vn(n,o,{forToolResult:!0}),s=xn(n,o,r,t.ticks);return s<0?null:{body:n.slice(o,s).join(`
|
||
`),nextLine:s+1}}function bu(n,e){if(xi(n,e))return null;const t=/^🛠️ Tool: `([^`]+)`/.exec(n[e]||"");if(!t)return null;const o=gt(n[e+1]);let r,s;if(o&&o.tag==="text"){if(r=e+2,s=vn(n,r),xn(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 vu(n,e){if(wi(n,e))return null;const t=gt(n[e]);if(!t||t.ticks<5||t.tag!=="")return null;const o=e+1,r=vn(n,o,{forToolResult:!0});return xn(n,o,r,t.ticks)>=0?null:{body:n.slice(o,r).join(`
|
||
`),nextLine:r,inFlight:!0}}function xu(n){return n.replace(/^\s*\**LLM Running \(Turn \d+\) \.\.\.\**\s*/i,"")}function wu(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(`
|
||
`)),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=bu(t,s);if(p){l(s),o.push(e.onTool(p.name,p.body,{inFlight:!0})),s=p.nextLine,r=s;continue}const d=vu(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 Cu(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 Su(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(`
|
||
`);try{const o=JSON.parse(n);if(o!=null&&o.question)return String(o.question)}catch{}return n.trim()}function Lo(n){const e=[];let t=xu(n);const o=[];t=t.replace(/<thinking>([\s\S]*?)<\/thinking>/gi,(u,p)=>(o.push(p),`
|
||
§§THINK:${o.length-1}§§
|
||
`));const r=[];t=t.replace(/<summary>([\s\S]*?)<\/summary>/gi,(u,p)=>(r.push(p),`
|
||
§§SUMMARY:${r.length-1}§§
|
||
`));const s=[],l=[];t=wu(t,{onTool(u,p,d){return s.push({name:u,body:p,inFlight:d==null?void 0:d.inFlight}),`
|
||
§§TOOL:${s.length-1}§§
|
||
`},onResult(u,p){return l.push({body:u,inFlight:p==null?void 0:p.inFlight}),`
|
||
§§RESULT:${l.length-1}§§
|
||
`}}),t=t.replace(/<function_calls>[\s\S]*?<\/function_calls>/gi,u=>(s.push({name:"function_call",body:u}),`
|
||
§§TOOL:${s.length-1}§§
|
||
`)),t=t.replace(/<function_results>[\s\S]*?<\/function_results>/gi,u=>(l.push({body:u}),`
|
||
§§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 b=s[Number(d[1])];if(b.name==="ask_user"){const x=Cu(b.body),C=Su(b.body);e.push({type:"approval",content:C,candidates:x})}else e.push({type:"tool",content:b.body,label:b.name,inFlight:b.inFlight});continue}const m=/^§§RESULT:(\d+)§§$/.exec(u);if(m){const b=l[Number(m[1])];e.push({type:"result",content:b.body,inFlight:b.inFlight});continue}const f=/^§§SUMMARY:(\d+)§§$/.exec(u);if(f){e.push({type:"summary",content:r[Number(f[1])]});continue}const y=u.trim();y&&e.push({type:"prose",content:y})}return e}function Kr(n){return n.map((e,t)=>{const o=Lo(e),r=o.reduce((s,l)=>s+l.content.length,0);return{index:t,segments:o,weight:r}})}function ku(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=Kr(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=Kr(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 ju(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 Eu(n){return n?n<1024?`${n} B`:n<1024*1024?`${(n/1024).toFixed(1)} KB`:`${(n/(1024*1024)).toFixed(1)} MB`:""}function Ou(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 Pu({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 y=new ResizeObserver(()=>{d.current||c(f.scrollHeight>f.clientHeight+2)});return y.observe(f),()=>y.disconnect()},[]),!e&&(!o||o.length===0)&&(!r||r.length===0))return null;const m=ju(e);return i.jsxs(i.Fragment,{children:[o&&o.length>0&&i.jsx("div",{"data-slot":"user-images",children:o.map((f,y)=>i.jsx("img",{"data-slot":"user-image-thumb",src:f.path.startsWith("data:")?f.path:`${ne}/upload/raw?path=${encodeURIComponent(f.path)}`,alt:f.name},y))}),r&&r.length>0&&i.jsx("div",{"data-slot":"user-files",children:r.map((f,y)=>i.jsxs("div",{"data-slot":"user-file-chip",children:[i.jsx("span",{"data-slot":"user-file-icon",children:Ou(f.name)}),i.jsx("span",{"data-slot":"user-file-name",children:f.name}),f.size!=null&&f.size>0&&i.jsx("span",{"data-slot":"user-file-size",children:Eu(f.size)})]},y))}),i.jsx("div",{"data-slot":"aui_user-message-root",id:t?`msg-${t}`:void 0,"data-msg-id":t||void 0,"data-role":"user",children:i.jsxs("div",{"data-slot":"user-bubble","data-clamped":l||void 0,"data-expanded":u||void 0,children:[i.jsx(Pu,{text:e}),i.jsx("div",{ref:s,"data-slot":"user-bubble-text",children:m?i.jsxs(i.Fragment,{children:[i.jsxs("span",{className:"skill-chip",children:["/",m.id]}),m.rest&&i.jsxs(i.Fragment,{children:[" ",m.rest]})]}):e}),l&&i.jsx("button",{"data-slot":"user-bubble-expand","aria-expanded":u,"aria-label":u?"Collapse":"Expand",onClick:()=>p(f=>!f),children:i.jsx("svg",{viewBox:"0 0 16 16",fill:"none",children:i.jsx("path",{d:"M4 6l4 4 4-4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]})})]})}),_u=a.memo(function({content:e,isStreaming:t}){const[o,r]=a.useState(null),s=a.useRef(null),l=o!==null?o:t,c=a.useCallback(()=>{r(u=>u===null?!t:!u)},[t]);return a.useEffect(()=>{t&&l&&s.current&&(s.current.scrollTop=s.current.scrollHeight)},[e,t,l]),e.trim()?i.jsxs("details",{"data-slot":"aui_thinking-disclosure",open:l,onToggle:c,children:[i.jsx("summary",{"data-slot":"thinking-summary",children:i.jsx("span",{className:t?"thinking-shimmer":"",children:"Thinking"})}),i.jsx("div",{ref:s,"data-slot":"thinking-body","data-streaming":t||void 0,children:e})]}):null}),Ct=new Set,Wr=2048;function Si(n,e,t){a.useEffect(()=>{if(!(!t||!n.current||Ct.has(e))){if(Ct.size>=Wr){const o=Array.from(Ct).slice(0,Wr/2);for(const r of o)Ct.delete(r)}Ct.add(e),n.current.animate([{opacity:0,transform:"translateY(0.375rem)"},{opacity:1,transform:"translateY(0)"}],{duration:180,easing:"cubic-bezier(0.16, 1, 0.3, 1)",fill:"both"})}},[])}const Xn=new Map;function Hr(n){const e=Math.floor(n/1e3);return e<60?`${e}s`:`${Math.floor(e/60)}m ${e%60}s`}function Mu(n,e){const[,t]=a.useState(0),o=a.useRef(null);a.useEffect(()=>{let s=Xn.get(n);return e&&!s&&(s={start:Date.now()},Xn.set(n,s)),!e&&s&&!s.end&&(s.end=Date.now()),e&&!o.current&&(o.current=setInterval(()=>t(l=>l+1),1e3)),()=>{!e&&o.current&&(clearInterval(o.current),o.current=null)}},[n,e]),a.useEffect(()=>()=>{o.current&&clearInterval(o.current)},[]);const r=Xn.get(n);if(!r)return{elapsed:null,duration:null};if(e){const s=Date.now()-r.start;return{elapsed:Hr(s),duration:null}}if(r.end){const s=r.end-r.start;return s<1e3?{elapsed:null,duration:null}:{elapsed:null,duration:Hr(s)}}return{elapsed:null,duration:null}}const Lu=a.memo(function({name:e,content:t,inFlight:o,segmentKey:r="",isStreaming:s=!1}){const[l,c]=a.useState(!1),u=a.useRef(null);Si(u,r,s);const{elapsed:p,duration:d}=Mu(r,o);return i.jsxs("div",{ref:u,"data-slot":"tool-block","data-tool-row":!0,"data-status":o?"running":"success",children:[i.jsxs("div",{"data-slot":"tool-header",onClick:()=>c(!l),children:[o&&i.jsx("span",{"data-slot":"tool-glyph",children:i.jsx("span",{"data-slot":"tool-spinner"})}),i.jsx("span",{"data-slot":"tool-title",children:e}),o&&i.jsx("span",{"data-slot":"tool-dots",children:"…"}),p&&i.jsx("span",{"data-slot":"tool-duration",children:p}),d&&i.jsx("span",{"data-slot":"tool-duration",children:d})]}),l&&t&&i.jsx("pre",{"data-slot":"tool-body",children:t})]})}),Iu=a.memo(function({content:e,inFlight:t,segmentKey:o="",isStreaming:r=!1}){const[s,l]=a.useState(!1),c=e.length>200,u=a.useRef(null);return Si(u,o,r),i.jsxs("div",{ref:u,"data-slot":"tool-block","data-tool-row":!0,"data-status":t?"running":"success",children:[i.jsxs("div",{"data-slot":"tool-header",onClick:()=>c&&l(!s),children:[i.jsx("span",{"data-slot":"tool-title",children:t?"Output…":"Output"}),c&&!s&&i.jsxs("span",{"data-slot":"tool-duration",children:[e.length," chars"]})]}),(s||!c)&&i.jsx("pre",{"data-slot":"tool-body",children:e})]})});function Zr(n){return n<26?String.fromCharCode(65+n):null}function Tu({question:n,answer:e}){return i.jsxs("div",{"data-slot":"approval-card","data-settled":!0,children:[i.jsx("div",{"data-slot":"approval-question",children:n}),i.jsx("div",{"data-slot":"approval-settled",children:e||i.jsx("em",{children:"Skipped"})})]})}const Ru=a.memo(function({question:e,candidates:t}){const o=G(L=>L.sendMessage),[r,s]=a.useState(null),[l,c]=a.useState(""),[u,p]=a.useState(!1),[d,m]=a.useState(!1),[f,y]=a.useState(null),b=a.useRef(null),x=a.useRef(null),C=r??(l.trim()||null),S=t.length>0,k=a.useCallback(L=>{s(L),c("")},[]),_=a.useCallback(async L=>{u||d||(p(!0),await o(L),y(L),m(!0),p(!1))},[u,d,o]),v=a.useCallback(async()=>{u||d||(p(!0),await o(""),y(null),m(!0),p(!1))},[u,d,o]),j=a.useCallback(()=>{C!==null&&_(C)},[C,_]),w=a.useCallback(()=>{s(null)},[]),E=a.useCallback(L=>{c(L.target.value),s(null)},[]),O=a.useCallback(L=>{if(!(L.nativeEvent.isComposing||L.keyCode===229)&&L.key==="Enter"&&!L.shiftKey){L.preventDefault();const B=l.trim();B&&_(B)}},[l,_]);if(a.useEffect(()=>{if(d||u)return;function L(B){var M;if(B.metaKey||B.ctrlKey||B.altKey||B.defaultPrevented)return;const Q=document.activeElement;if(Q){const Y=Q.tagName.toLowerCase();if(Y==="input"||Y==="textarea"||Q.isContentEditable)return}const z=B.key.toLowerCase();if(z.length===1&&z>="a"&&z<="z"){const Y=z.charCodeAt(0)-97;Y<t.length?(B.preventDefault(),k(t[Y])):Y===t.length&&(B.preventDefault(),(M=b.current)==null||M.focus());return}if(z==="enter"&&!B.shiftKey){const Y=r??(l.trim()||null);Y!==null&&(B.preventDefault(),_(Y))}}return window.addEventListener("keydown",L),()=>window.removeEventListener("keydown",L)},[d,u,t,r,l,k,_]),d)return i.jsx(Tu,{question:e,answer:f});const D=t.length,P=Zr(D),N=l.trim().length>0&&r===null;return i.jsxs("div",{"data-slot":"approval-card",ref:x,"data-submitting":u||void 0,children:[i.jsx("div",{"data-slot":"approval-question",children:e}),S?i.jsxs("div",{"data-slot":"approval-options",children:[t.map((L,B)=>{const Q=Zr(B),z=r===L;return i.jsxs("button",{"data-slot":"approval-option-row","data-selected":z||void 0,disabled:u,onClick:()=>k(L),type:"button",children:[Q&&i.jsx("kbd",{"data-slot":"approval-badge","data-active":z||void 0,children:Q}),i.jsx("span",{children:L})]},B)}),i.jsxs("div",{"data-slot":"approval-other",children:[P&&i.jsx("kbd",{"data-slot":"approval-badge","data-active":N||void 0,children:P}),i.jsx("textarea",{ref:b,"data-slot":"approval-other-input",placeholder:"Other…",value:l,onChange:E,onFocus:w,onKeyDown:O,disabled:u,rows:1})]})]}):i.jsx("div",{"data-slot":"approval-options",children:i.jsx("textarea",{ref:b,"data-slot":"approval-other-input","data-fullwidth":!0,placeholder:"Type your response…",value:l,onChange:E,onKeyDown:O,disabled:u,rows:1})}),i.jsxs("div",{"data-slot":"approval-actions",children:[i.jsx("button",{type:"button","data-slot":"approval-skip-btn",disabled:u,onClick:v,children:"Skip"}),i.jsxs("button",{type:"button","data-slot":"approval-confirm-btn",disabled:u||C===null,onClick:j,children:[u?i.jsx("span",{"data-slot":"approval-spinner"}):null,"Continue"]})]})]})});function ki(n){const e=Math.floor(n/1e3);return e<60?`${e}s`:`${Math.floor(e/60)}m ${e%60}s`}const Nu=a.memo(function(){const[e,t]=a.useState(0),o=G(l=>l.turnStartedAt),r=a.useRef(Date.now()),s=o??r.current;return a.useEffect(()=>{t(Date.now()-s);const l=setInterval(()=>t(Date.now()-s),1e3);return()=>clearInterval(l)},[s]),i.jsxs("div",{"data-slot":"stream-indicator",children:[i.jsx("span",{"data-slot":"dither-square"}),i.jsx("span",{"data-slot":"indicator-timer",children:ki(e)})]})}),$u=a.memo(function({contentLength:e}){const[t,o]=a.useState(!1),[r,s]=a.useState(0),l=a.useRef(e),c=a.useRef(Date.now()),u=a.useRef(null);return a.useEffect(()=>{e!==l.current&&(l.current=e,c.current=Date.now(),u.current=null,o(!1),s(0))},[e]),a.useEffect(()=>{const p=setInterval(()=>{Date.now()-c.current>=2e3&&(u.current||(u.current=c.current+2e3),o(!0),s(Date.now()-u.current))},500);return()=>clearInterval(p)},[]),t?i.jsxs("div",{"data-slot":"stream-indicator","data-stall":!0,children:[i.jsx("span",{"data-slot":"dither-square"}),i.jsxs("span",{"data-slot":"indicator-timer",children:["+",ki(r)]})]}):null}),Du=a.lazy(async()=>({default:(await Zt(()=>import("./MarkdownPart-ZJKeOipX.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]))).MarkdownPart})),Au=a.lazy(async()=>({default:(await Zt(()=>import("./SummaryPart-zs-In9mf.js"),__vite__mapDeps([10,1,2,3,4,5,6,7,8]))).SummaryPart})),zu=a.memo(function({segments:e,isStreaming:t,messageId:o=""}){if(e.length===0&&t)return i.jsx("div",{"data-slot":"aui_assistant-message-content",children:i.jsx(Nu,{})});if(e.length===0)return null;const r=t?e:e.map(c=>c.inFlight?{...c,inFlight:!1}:c),s=r.reduce((c,u)=>c+u.content.length,0),l=r.some(c=>c.type==="approval");return i.jsxs("div",{"data-slot":"aui_assistant-message-content",children:[r.map((c,u)=>{const p=`${o}-${u}`;switch(c.type){case"prose":return i.jsx(a.Suspense,{fallback:i.jsx("span",{"data-slot":"aui_markdown-loading","aria-busy":"true"}),children:i.jsx(Du,{content:c.content,isStreaming:t&&u===r.length-1})},u);case"thinking":return i.jsx(_u,{content:c.content,isStreaming:!!c.inFlight||t},u);case"tool":return i.jsx(Lu,{name:c.label||"tool",content:c.content,inFlight:!!c.inFlight,segmentKey:p,isStreaming:t},u);case"result":return i.jsx(Iu,{content:c.content,inFlight:!!c.inFlight,segmentKey:p,isStreaming:t},u);case"summary":return i.jsx(a.Suspense,{fallback:i.jsx("span",{"data-slot":"aui_summary-loading","aria-busy":"true"}),children:i.jsx(Au,{content:c.content})},u);case"approval":return i.jsx(Ru,{question:c.content,candidates:c.candidates||[]},u);default:return null}}),t&&!l&&i.jsx($u,{contentLength:s})]})});function Fu(n){const e=Math.round(n/1e3);if(e<60)return`${e}s`;const t=Math.floor(e/60),o=e%60;return`${t}m ${o}s`}const Bu=a.memo(function({getMessageText:e,executionMs:t}){const[o,r]=a.useState(!1),s=a.useRef(),l=a.useCallback(()=>{const c=e();c&&navigator.clipboard.writeText(c).then(()=>{r(!0),s.current&&clearTimeout(s.current),s.current=setTimeout(()=>r(!1),2e3)})},[e]);return typeof navigator>"u"||!navigator.clipboard?null:i.jsxs("div",{"data-slot":"assistant-action-bar",children:[i.jsx("button",{"data-slot":"action-bar-btn",onClick:l,title:o?"Copied":"Copy",children:o?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"})]})}),typeof t=="number"&&t>0&&i.jsx("span",{"data-slot":"action-bar-duration",title:"本轮用时",children:Fu(t)})]})}),Uu=a.memo(function({message:e,isStreaming:t}){const o=a.useMemo(()=>{const l=e.turn_segs;return l&&l.length>0?l.flatMap(c=>Lo(c)):Lo(e.content)},[e.content,e.turn_segs]),r=a.useRef(o);r.current=o;const s=a.useCallback(()=>{const l=r.current,c=[];for(const u of l)(u.type==="prose"||u.type==="summary")&&c.push(u.content);return c.join(`
|
||
|
||
`)},[]);return i.jsxs("div",{"data-slot":"aui_assistant-message-root","data-role":"assistant","data-streaming":t||void 0,children:[i.jsx(zu,{segments:o,isStreaming:t,messageId:String(e.id)}),i.jsx(Bu,{getMessageText:s,executionMs:e.executionMs})]})}),Vu=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(Uu,{message:t,isStreaming:o})]})}),Ku=[{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 Wu(n,e){if(!n)return"";for(const t of Ku)if(t.pattern.test(n))return e(t.key);return n.length<=80?n:n.slice(0,77)+"…"}const Hu=a.memo(function({error:e,msgId:t}){const{t:o}=he(),r=Wu(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})})}),Zu=300;function qu(n){return n.kind==="turn"?n.turns.reduce((e,t)=>e+t.segments.length,0):1}const Gu=a.memo(function({messages:e,isRunning:t,budgetMultiplier:o,onShowEarlier:r,scrollRef:s}){const l=a.useMemo(()=>ku(e),[e]),c=a.useRef(null),u=a.useMemo(()=>{if(!isFinite(o))return 0;const f=Zu*o;let y=0;for(let b=l.length-1;b>=0;b--)if(y+=qu(l[b]),y>f)return b+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,y)=>{const b=u+y;return f.kind==="turn"?i.jsx(Vu,{userMsg:f.userMsg,assistantMsg:f.assistantMsg,isStreaming:t&&b===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(Hu,{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,Gr=40,Qu=170,Qr=12;function Yr(n){const e=n.replace(/\s+/g," ").trim();return e.length<=Gr?e:e.slice(0,Gr)+"…"}function Yu(n){return 1-Math.pow(1-n,3)}let Jn=0;function Xu(n,e,t){cancelAnimationFrame(Jn);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*Yu(p),p<1&&(Jn=requestAnimationFrame(l))}Jn=requestAnimationFrame(l)}const Ju=a.memo(function({messages:e,stopScroll:t,onJumpToCollapsed:o}){const r=a.useMemo(()=>e.filter(b=>b.role==="user").map(b=>({id:b.id,content:b.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 b=document.querySelector('[data-slot="aui_thread-viewport"]');if(!b)return;function x(){if(d.current=0,!b)return;const S=b.getBoundingClientRect().top;let k=null;for(const _ of r){const v=document.getElementById(`msg-${_.id}`);if(!v)continue;if(v.getBoundingClientRect().top-S<=Qr)k=_.id;else break}!k&&r.length>0&&(k=r[0].id),k&&l(k)}function C(){d.current||(d.current=requestAnimationFrame(x))}return b.addEventListener("scroll",C,{passive:!0}),x(),()=>{b.removeEventListener("scroll",C),cancelAnimationFrame(d.current)}},[r]);const y=a.useCallback(b=>{const x=document.querySelector('[data-slot="aui_thread-viewport"]'),C=document.getElementById(`msg-${b}`);if(!C){o(b);return}if(!x)return;t();const _=(C.closest('[data-slot="aui_turn-pair"]')||C).offsetTop-Qr;Xu(x,_,Qu)},[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(b=>i.jsx("button",{"data-slot":"rail-panel-item","data-active":b.id===s||void 0,onClick:()=>y(b.id),children:Yr(b.content)},b.id))}),i.jsx("div",{"data-slot":"rail-marks",children:r.map(b=>i.jsx("button",{"data-slot":"rail-mark","data-active":b.id===s||void 0,"aria-label":Yr(b.content),onClick:()=>y(b.id),children:i.jsx("span",{"data-slot":"rail-mark-line"})},b.id))})]})})});function e0(){const{messages:n,status:e,activeSessionId:t}=G(),{scrollRef:o,isAtBottom:r,scrollToBottom:s,stopScroll:l}=mu(),[c,u]=a.useState(1),p=a.useRef(null);gu(o,s,l,t),a.useEffect(()=>{u(1),p.current=null},[t]),a.useEffect(()=>{if(!p.current)return;const y=p.current,b=requestAnimationFrame(()=>{const x=document.getElementById(`msg-${y}`);if(x){p.current=null;const C=o.current;if(C){const k=x.closest('[data-slot="aui_turn-pair"]')||x;C.scrollTop=k.offsetTop-12}}});return()=>cancelAnimationFrame(b)},[c,o]);const d=a.useCallback(()=>{u(1/0)},[]),m=a.useCallback(y=>{p.current=y,d()},[d]),f=a.useCallback(()=>{o.current,u(y=>y+1)},[o]);return i.jsxs("div",{"data-slot":"thread-root",children:[i.jsx("div",{ref:o,"data-slot":"aui_thread-viewport","data-following":r,children:i.jsxs(yu,{children:[i.jsx(Gu,{messages:n,isRunning:e==="running",budgetMultiplier:c,onShowEarlier:f,scrollRef:o}),i.jsx("div",{"data-slot":"aui_composer-clearance"})]})}),i.jsx(Ju,{messages:n,stopScroll:l,onJumpToCollapsed:m}),!r&&i.jsx("button",{"data-slot":"scroll-to-bottom",onClick:()=>s("smooth"),children:i.jsx("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",children:i.jsx("path",{d:"M8 3v10m0 0l-3.5-3.5M8 13l3.5-3.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]})}function Io(n){let e="";for(const t of n.childNodes)if(t.nodeType===Node.TEXT_NODE)e+=t.textContent||"";else if(t instanceof HTMLElement)if(t.dataset.refText)e+=t.dataset.refText;else if(t.tagName==="BR")e+=`
|
||
`;else{const o=Io(t);o&&(e+=`
|
||
`+o)}return e}function t0(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 Xr(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 n0(n,e){n.textContent=e,ji(n)}function o0(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">${l0(n)}</span><span class="ref-chip-label">${a0(t||e)}</span>`,o}function r0(n,e,t,o){const r=o0(e,t,o);Xr(n,r);const s=document.createTextNode(" ");Xr(n,s)}function s0(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 i0(n,e,t){n.textContent="";const o=s0(e,t);n.appendChild(o);const r=document.createTextNode(" ");n.appendChild(r),ji(n)}function a0(n){return n.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function l0(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 c0=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),y=a.useRef("");a.useImperativeHandle(d,()=>({focus(){var v;(v=m.current)==null||v.focus()},clear(){m.current&&(m.current.textContent="",y.current="")},getText(){return m.current?Io(m.current):""},setText(v){m.current&&(n0(m.current,v),y.current=v,o(v))},insertChip(v,j,w){m.current&&(m.current.focus(),r0(m.current,v,j,w),b())},setSkillChip(v,j){m.current&&(i0(m.current,v,j),b())},getElement(){return m.current}}));const b=a.useCallback(()=>{if(!m.current)return;const v=Io(m.current);y.current=v,o(v);const j=v.trimStart();j.startsWith("/")&&!j.includes(`
|
||
`)?s==null||s(j.slice(1)):l==null||l();const w=v.match(/@([^\s@]*)$/);w?c==null||c(w[1]):u==null||u()},[o,s,l,c,u]),x=a.useCallback(()=>{f.current||(m.current&&t0(m.current),b())},[b]),C=a.useCallback(()=>{f.current=!0},[]),S=a.useCallback(()=>{f.current=!1,x()},[x]),k=a.useCallback(v=>{f.current||v.nativeEvent.isComposing||v.keyCode===229||r(v)},[r]),_=a.useCallback(v=>{var O;const j=(O=v.clipboardData)==null?void 0:O.items;if(!j)return;const w=[];for(const D of Array.from(j))if(D.type.startsWith("image/")&&D.type!=="image/svg+xml"){const P=D.getAsFile();P&&w.push(P)}if(w.length>0){v.preventDefault(),p==null||p(w);return}const E=v.clipboardData.getData("text/plain");E&&(v.preventDefault(),document.execCommand("insertText",!1,E))},[p]);return a.useEffect(()=>{const v=m.current;if(!v)return;const j=new ResizeObserver(w=>{var O,D,P;const E=((P=(D=(O=w[0])==null?void 0:O.borderBoxSize)==null?void 0:D[0])==null?void 0:P.blockSize)??v.offsetHeight;v.style.setProperty("--editor-scroll-height",`${E}px`)});return j.observe(v),()=>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:x,onKeyDown:k,onCompositionStart:C,onCompositionEnd:S,onPaste:_})});function d0(){try{const n=localStorage.getItem("ga_custom_presets");return n?JSON.parse(n):[]}catch{return[]}}function u0({visible:n,query:e,onSelect:t,onClose:o}){const r=Z(m=>m.lang),[s,l]=a.useState(0),c=a.useRef(null),u=d0(),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(y=>Math.min(y+1,d.length-1))):f.key==="ArrowUp"?(f.preventDefault(),l(y=>Math.max(y-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 p0=[{id:"file",label:"file"},{id:"url",label:"url"},{id:"image",label:"image"}];function h0({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:p0.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(m0,{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 m0({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 Jr={title:{zh:"附加",en:"Attach"},file:{zh:"文件…",en:"File…"},image:{zh:"图片…",en:"Image…"},paste:{zh:"粘贴图片",en:"Paste image"},hint:{zh:"提示:输入 @ 以内联引用文件",en:"Tip: type @ to reference files inline"}};function f0({onUploadFile:n,onUploadImage:e,onPasteImage:t}){const[o,r]=a.useState(!1),s=a.useRef(null),l=a.useRef(null),c=Z(m=>m.lang),u=m=>Jr[m][c]||Jr[m].en,p=a.useCallback(()=>r(m=>!m),[]);a.useEffect(()=>{if(!o)return;function m(y){s.current&&!s.current.contains(y.target)&&l.current&&!l.current.contains(y.target)&&r(!1)}function f(y){y.key==="Escape"&&r(!1)}return document.addEventListener("mousedown",m),document.addEventListener("keydown",f),()=>{document.removeEventListener("mousedown",m),document.removeEventListener("keydown",f)}},[o]);const d=a.useCallback(m=>()=>{m(),r(!1)},[]);return i.jsxs("div",{"data-slot":"context-menu-wrap",children:[i.jsx("button",{ref:l,"data-slot":"composer-attach-btn",onClick:p,"aria-label":u("title"),title:u("title"),children:i.jsx(g0,{})}),o&&i.jsxs("div",{ref:s,"data-slot":"context-menu",children:[i.jsx("div",{"data-slot":"context-menu-title",children:u("title")}),i.jsxs("button",{"data-slot":"context-menu-item",onClick:d(n),children:[i.jsx("span",{"data-slot":"context-menu-icon",children:i.jsx(y0,{})}),i.jsx("span",{"data-slot":"context-menu-label",children:u("file")})]}),i.jsxs("button",{"data-slot":"context-menu-item",onClick:d(e),children:[i.jsx("span",{"data-slot":"context-menu-icon",children:i.jsx(b0,{})}),i.jsx("span",{"data-slot":"context-menu-label",children:u("image")})]}),i.jsxs("button",{"data-slot":"context-menu-item",onClick:d(t),children:[i.jsx("span",{"data-slot":"context-menu-icon",children:i.jsx(v0,{})}),i.jsx("span",{"data-slot":"context-menu-label",children:u("paste")})]}),i.jsx("div",{"data-slot":"context-menu-hint",children:u("hint")})]})]})}function g0(){return i.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:i.jsx("path",{d:"M8 3v10M3 8h10",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}function y0(){return i.jsxs("svg",{width:"14",height:"14",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"})]})}function b0(){return i.jsxs("svg",{width:"14",height:"14",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"})]})}function v0(){return i.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",children:[i.jsx("rect",{x:"3",y:"2",width:"10",height:"12",rx:"1",stroke:"currentColor",strokeWidth:"1.2"}),i.jsx("path",{d:"M6 2V1.5A.5.5 0 0 1 6.5 1h3a.5.5 0 0 1 .5.5V2",stroke:"currentColor",strokeWidth:"1.2"})]})}var x0="OpenAI";function Pt(n){"@babel/helpers - typeof";return Pt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Pt(n)}var w0=["size","style"];function es(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,o)}return t}function eo(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?es(Object(t),!0).forEach(function(o){C0(n,o,t[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):es(Object(t)).forEach(function(o){Object.defineProperty(n,o,Object.getOwnPropertyDescriptor(t,o))})}return n}function C0(n,e,t){return e=S0(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function S0(n){var e=k0(n,"string");return Pt(e)=="symbol"?e:String(e)}function k0(n,e){if(Pt(n)!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var o=t.call(n,e);if(Pt(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function j0(n,e){if(n==null)return{};var t=E0(n,e),o,r;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);for(r=0;r<s.length;r++)o=s[r],!(e.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(n,o)&&(t[o]=n[o])}return t}function E0(n,e){if(n==null)return{};var t={},o=Object.keys(n),r,s;for(s=0;s<o.length;s++)r=o[s],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var O0=a.memo(function(n){var e=n.size,t=e===void 0?"1em":e,o=n.style,r=j0(n,w0);return i.jsxs("svg",eo(eo({fill:"currentColor",fillRule:"evenodd",height:t,style:eo({flex:"none",lineHeight:1},o),viewBox:"0 0 24 24",width:t,xmlns:"http://www.w3.org/2000/svg"},r),{},{children:[i.jsx("title",{children:x0}),i.jsx("path",{d:"M9.205 8.658v-2.26c0-.19.072-.333.238-.428l4.543-2.616c.619-.357 1.356-.523 2.117-.523 2.854 0 4.662 2.212 4.662 4.566 0 .167 0 .357-.024.547l-4.71-2.759a.797.797 0 00-.856 0l-5.97 3.473zm10.609 8.8V12.06c0-.333-.143-.57-.429-.737l-5.97-3.473 1.95-1.118a.433.433 0 01.476 0l4.543 2.617c1.309.76 2.189 2.378 2.189 3.948 0 1.808-1.07 3.473-2.76 4.163zM7.802 12.703l-1.95-1.142c-.167-.095-.239-.238-.239-.428V5.899c0-2.545 1.95-4.472 4.591-4.472 1 0 1.927.333 2.712.928L8.23 5.067c-.285.166-.428.404-.428.737v6.898zM12 15.128l-2.795-1.57v-3.33L12 8.658l2.795 1.57v3.33L12 15.128zm1.796 7.23c-1 0-1.927-.332-2.712-.927l4.686-2.712c.285-.166.428-.404.428-.737v-6.898l1.974 1.142c.167.095.238.238.238.428v5.233c0 2.545-1.974 4.472-4.614 4.472zm-5.637-5.303l-4.544-2.617c-1.308-.761-2.188-2.378-2.188-3.948A4.482 4.482 0 014.21 6.327v5.423c0 .333.143.571.428.738l5.947 3.449-1.95 1.118a.432.432 0 01-.476 0zm-.262 3.9c-2.688 0-4.662-2.021-4.662-4.519 0-.19.024-.38.047-.57l4.686 2.71c.286.167.571.167.856 0l5.97-3.448v2.26c0 .19-.07.333-.237.428l-4.543 2.616c-.619.357-1.356.523-2.117.523zm5.899 2.83a5.947 5.947 0 005.827-4.756C22.287 18.339 24 15.84 24 13.296c0-1.665-.713-3.282-1.998-4.448.119-.5.19-.999.19-1.498 0-3.401-2.759-5.947-5.946-5.947-.642 0-1.26.095-1.88.31A5.962 5.962 0 0010.205 0a5.947 5.947 0 00-5.827 4.757C1.713 5.447 0 7.945 0 10.49c0 1.666.713 3.283 1.998 4.448-.119.5-.19 1-.19 1.499 0 3.401 2.759 5.946 5.946 5.946.642 0 1.26-.095 1.88-.309a5.96 5.96 0 004.162 1.713z"})]}))}),P0="Anthropic";function _t(n){"@babel/helpers - typeof";return _t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_t(n)}var _0=["size","style"];function ts(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,o)}return t}function to(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ts(Object(t),!0).forEach(function(o){M0(n,o,t[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ts(Object(t)).forEach(function(o){Object.defineProperty(n,o,Object.getOwnPropertyDescriptor(t,o))})}return n}function M0(n,e,t){return e=L0(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function L0(n){var e=I0(n,"string");return _t(e)=="symbol"?e:String(e)}function I0(n,e){if(_t(n)!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var o=t.call(n,e);if(_t(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function T0(n,e){if(n==null)return{};var t=R0(n,e),o,r;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);for(r=0;r<s.length;r++)o=s[r],!(e.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(n,o)&&(t[o]=n[o])}return t}function R0(n,e){if(n==null)return{};var t={},o=Object.keys(n),r,s;for(s=0;s<o.length;s++)r=o[s],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var N0=a.memo(function(n){var e=n.size,t=e===void 0?"1em":e,o=n.style,r=T0(n,_0);return i.jsxs("svg",to(to({fill:"currentColor",fillRule:"evenodd",height:t,style:to({flex:"none",lineHeight:1},o),viewBox:"0 0 24 24",width:t,xmlns:"http://www.w3.org/2000/svg"},r),{},{children:[i.jsx("title",{children:P0}),i.jsx("path",{d:"M13.827 3.52h3.603L24 20h-3.603l-6.57-16.48zm-7.258 0h3.767L16.906 20h-3.674l-1.343-3.461H5.017l-1.344 3.46H0L6.57 3.522zm4.132 9.959L8.453 7.687 6.205 13.48H10.7z"})]}))}),$0="DeepSeek";function Mt(n){"@babel/helpers - typeof";return Mt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Mt(n)}var D0=["size","style"];function ns(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,o)}return t}function no(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ns(Object(t),!0).forEach(function(o){A0(n,o,t[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ns(Object(t)).forEach(function(o){Object.defineProperty(n,o,Object.getOwnPropertyDescriptor(t,o))})}return n}function A0(n,e,t){return e=z0(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function z0(n){var e=F0(n,"string");return Mt(e)=="symbol"?e:String(e)}function F0(n,e){if(Mt(n)!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var o=t.call(n,e);if(Mt(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function B0(n,e){if(n==null)return{};var t=U0(n,e),o,r;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);for(r=0;r<s.length;r++)o=s[r],!(e.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(n,o)&&(t[o]=n[o])}return t}function U0(n,e){if(n==null)return{};var t={},o=Object.keys(n),r,s;for(s=0;s<o.length;s++)r=o[s],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var V0=a.memo(function(n){var e=n.size,t=e===void 0?"1em":e,o=n.style,r=B0(n,D0);return i.jsxs("svg",no(no({fill:"currentColor",fillRule:"evenodd",height:t,style:no({flex:"none",lineHeight:1},o),viewBox:"0 0 24 24",width:t,xmlns:"http://www.w3.org/2000/svg"},r),{},{children:[i.jsx("title",{children:$0}),i.jsx("path",{d:"M23.748 4.482c-.254-.124-.364.113-.512.234-.051.039-.094.09-.137.136-.372.397-.806.657-1.373.626-.829-.046-1.537.214-2.163.848-.133-.782-.575-1.248-1.247-1.548-.352-.156-.708-.311-.955-.65-.172-.241-.219-.51-.305-.774-.055-.16-.11-.323-.293-.35-.2-.031-.278.136-.356.276-.313.572-.434 1.202-.422 1.84.027 1.436.633 2.58 1.838 3.393.137.093.172.187.129.323-.082.28-.18.552-.266.833-.055.179-.137.217-.329.14a5.526 5.526 0 01-1.736-1.18c-.857-.828-1.631-1.742-2.597-2.458a11.365 11.365 0 00-.689-.471c-.985-.957.13-1.743.388-1.836.27-.098.093-.432-.779-.428-.872.004-1.67.295-2.687.684a3.055 3.055 0 01-.465.137 9.597 9.597 0 00-2.883-.102c-1.885.21-3.39 1.102-4.497 2.623C.082 8.606-.231 10.684.152 12.85c.403 2.284 1.569 4.175 3.36 5.653 1.858 1.533 3.997 2.284 6.438 2.14 1.482-.085 3.133-.284 4.994-1.86.47.234.962.327 1.78.397.63.059 1.236-.03 1.705-.128.735-.156.684-.837.419-.961-2.155-1.004-1.682-.595-2.113-.926 1.096-1.296 2.746-2.642 3.392-7.003.05-.347.007-.565 0-.845-.004-.17.035-.237.23-.256a4.173 4.173 0 001.545-.475c1.396-.763 1.96-2.015 2.093-3.517.02-.23-.004-.467-.247-.588zM11.581 18c-2.089-1.642-3.102-2.183-3.52-2.16-.392.024-.321.471-.235.763.09.288.207.486.371.739.114.167.192.416-.113.603-.673.416-1.842-.14-1.897-.167-1.361-.802-2.5-1.86-3.301-3.307-.774-1.393-1.224-2.887-1.298-4.482-.02-.386.093-.522.477-.592a4.696 4.696 0 011.529-.039c2.132.312 3.946 1.265 5.468 2.774.868.86 1.525 1.887 2.202 2.891.72 1.066 1.494 2.082 2.48 2.914.348.292.625.514.891.677-.802.09-2.14.11-3.054-.614zm1-6.44a.306.306 0 01.415-.287.302.302 0 01.2.288.306.306 0 01-.31.307.303.303 0 01-.304-.308zm3.11 1.596c-.2.081-.399.151-.59.16a1.245 1.245 0 01-.798-.254c-.274-.23-.47-.358-.552-.758a1.73 1.73 0 01.016-.588c.07-.327-.008-.537-.239-.727-.187-.156-.426-.199-.688-.199a.559.559 0 01-.254-.078c-.11-.054-.2-.19-.114-.358.028-.054.16-.186.192-.21.356-.202.767-.136 1.146.016.352.144.618.408 1.001.782.391.451.462.576.685.914.176.265.336.537.445.848.067.195-.019.354-.25.452z"})]}))}),K0="Qwen";function Lt(n){"@babel/helpers - typeof";return Lt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Lt(n)}var W0=["size","style"];function os(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,o)}return t}function oo(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?os(Object(t),!0).forEach(function(o){H0(n,o,t[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):os(Object(t)).forEach(function(o){Object.defineProperty(n,o,Object.getOwnPropertyDescriptor(t,o))})}return n}function H0(n,e,t){return e=Z0(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Z0(n){var e=q0(n,"string");return Lt(e)=="symbol"?e:String(e)}function q0(n,e){if(Lt(n)!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var o=t.call(n,e);if(Lt(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function G0(n,e){if(n==null)return{};var t=Q0(n,e),o,r;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);for(r=0;r<s.length;r++)o=s[r],!(e.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(n,o)&&(t[o]=n[o])}return t}function Q0(n,e){if(n==null)return{};var t={},o=Object.keys(n),r,s;for(s=0;s<o.length;s++)r=o[s],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var Y0=a.memo(function(n){var e=n.size,t=e===void 0?"1em":e,o=n.style,r=G0(n,W0);return i.jsxs("svg",oo(oo({fill:"currentColor",fillRule:"evenodd",height:t,style:oo({flex:"none",lineHeight:1},o),viewBox:"0 0 24 24",width:t,xmlns:"http://www.w3.org/2000/svg"},r),{},{children:[i.jsx("title",{children:K0}),i.jsx("path",{d:"M12.604 1.34c.393.69.784 1.382 1.174 2.075a.18.18 0 00.157.091h5.552c.174 0 .322.11.446.327l1.454 2.57c.19.337.24.478.024.837-.26.43-.513.864-.76 1.3l-.367.658c-.106.196-.223.28-.04.512l2.652 4.637c.172.301.111.494-.043.77-.437.785-.882 1.564-1.335 2.34-.159.272-.352.375-.68.37-.777-.016-1.552-.01-2.327.016a.099.099 0 00-.081.05 575.097 575.097 0 01-2.705 4.74c-.169.293-.38.363-.725.364-.997.003-2.002.004-3.017.002a.537.537 0 01-.465-.271l-1.335-2.323a.09.09 0 00-.083-.049H4.982c-.285.03-.553-.001-.805-.092l-1.603-2.77a.543.543 0 01-.002-.54l1.207-2.12a.198.198 0 000-.197 550.951 550.951 0 01-1.875-3.272l-.79-1.395c-.16-.31-.173-.496.095-.965.465-.813.927-1.625 1.387-2.436.132-.234.304-.334.584-.335a338.3 338.3 0 012.589-.001.124.124 0 00.107-.063l2.806-4.895a.488.488 0 01.422-.246c.524-.001 1.053 0 1.583-.006L11.704 1c.341-.003.724.032.9.34zm-3.432.403a.06.06 0 00-.052.03L6.254 6.788a.157.157 0 01-.135.078H3.253c-.056 0-.07.025-.041.074l5.81 10.156c.025.042.013.062-.034.063l-2.795.015a.218.218 0 00-.2.116l-1.32 2.31c-.044.078-.021.118.068.118l5.716.008c.046 0 .08.02.104.061l1.403 2.454c.046.081.092.082.139 0l5.006-8.76.783-1.382a.055.055 0 01.096 0l1.424 2.53a.122.122 0 00.107.062l2.763-.02a.04.04 0 00.035-.02.041.041 0 000-.04l-2.9-5.086a.108.108 0 010-.113l.293-.507 1.12-1.977c.024-.041.012-.062-.035-.062H9.2c-.059 0-.073-.026-.043-.077l1.434-2.505a.107.107 0 000-.114L9.225 1.774a.06.06 0 00-.053-.031zm6.29 8.02c.046 0 .058.02.034.06l-.832 1.465-2.613 4.585a.056.056 0 01-.05.029.058.058 0 01-.05-.029L8.498 9.841c-.02-.034-.01-.052.028-.054l.216-.012 6.722-.012z"})]}))}),X0="Google";function It(n){"@babel/helpers - typeof";return It=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},It(n)}var J0=["size","style"];function rs(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,o)}return t}function ro(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?rs(Object(t),!0).forEach(function(o){e1(n,o,t[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):rs(Object(t)).forEach(function(o){Object.defineProperty(n,o,Object.getOwnPropertyDescriptor(t,o))})}return n}function e1(n,e,t){return e=t1(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function t1(n){var e=n1(n,"string");return It(e)=="symbol"?e:String(e)}function n1(n,e){if(It(n)!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var o=t.call(n,e);if(It(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function o1(n,e){if(n==null)return{};var t=r1(n,e),o,r;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);for(r=0;r<s.length;r++)o=s[r],!(e.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(n,o)&&(t[o]=n[o])}return t}function r1(n,e){if(n==null)return{};var t={},o=Object.keys(n),r,s;for(s=0;s<o.length;s++)r=o[s],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var s1=a.memo(function(n){var e=n.size,t=e===void 0?"1em":e,o=n.style,r=o1(n,J0);return i.jsxs("svg",ro(ro({fill:"currentColor",fillRule:"evenodd",height:t,style:ro({flex:"none",lineHeight:1},o),viewBox:"0 0 24 24",width:t,xmlns:"http://www.w3.org/2000/svg"},r),{},{children:[i.jsx("title",{children:X0}),i.jsx("path",{d:"M23 12.245c0-.905-.075-1.565-.236-2.25h-10.54v4.083h6.186c-.124 1.014-.797 2.542-2.294 3.569l-.021.136 3.332 2.53.23.022C21.779 18.417 23 15.593 23 12.245z"}),i.jsx("path",{d:"M12.225 23c3.03 0 5.574-.978 7.433-2.665l-3.542-2.688c-.948.648-2.22 1.1-3.891 1.1a6.745 6.745 0 01-6.386-4.572l-.132.011-3.465 2.628-.045.124C4.043 20.531 7.835 23 12.225 23z"}),i.jsx("path",{d:"M5.84 14.175A6.65 6.65 0 015.463 12c0-.758.138-1.491.361-2.175l-.006-.147-3.508-2.67-.115.054A10.831 10.831 0 001 12c0 1.772.436 3.447 1.197 4.938l3.642-2.763z"}),i.jsx("path",{d:"M12.225 5.253c2.108 0 3.529.892 4.34 1.638l3.167-3.031C17.787 2.088 15.255 1 12.225 1 7.834 1 4.043 3.469 2.197 7.062l3.63 2.763a6.77 6.77 0 016.398-4.572z"})]}))}),i1="Meta";function Tt(n){"@babel/helpers - typeof";return Tt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Tt(n)}var a1=["size","style"];function ss(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,o)}return t}function so(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ss(Object(t),!0).forEach(function(o){l1(n,o,t[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ss(Object(t)).forEach(function(o){Object.defineProperty(n,o,Object.getOwnPropertyDescriptor(t,o))})}return n}function l1(n,e,t){return e=c1(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function c1(n){var e=d1(n,"string");return Tt(e)=="symbol"?e:String(e)}function d1(n,e){if(Tt(n)!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var o=t.call(n,e);if(Tt(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function u1(n,e){if(n==null)return{};var t=p1(n,e),o,r;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);for(r=0;r<s.length;r++)o=s[r],!(e.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(n,o)&&(t[o]=n[o])}return t}function p1(n,e){if(n==null)return{};var t={},o=Object.keys(n),r,s;for(s=0;s<o.length;s++)r=o[s],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var h1=a.memo(function(n){var e=n.size,t=e===void 0?"1em":e,o=n.style,r=u1(n,a1);return i.jsxs("svg",so(so({fill:"currentColor",fillRule:"evenodd",height:t,style:so({flex:"none",lineHeight:1},o),viewBox:"0 0 24 24",width:t,xmlns:"http://www.w3.org/2000/svg"},r),{},{children:[i.jsx("title",{children:i1}),i.jsx("path",{d:"M6.897 4c1.915 0 3.516.932 5.43 3.376l.282-.373c.19-.246.383-.484.58-.71l.313-.35C14.588 4.788 15.792 4 17.225 4c1.273 0 2.469.557 3.491 1.516l.218.213c1.73 1.765 2.917 4.71 3.053 8.026l.011.392.002.25c0 1.501-.28 2.759-.818 3.7l-.14.23-.108.153c-.301.42-.664.758-1.086 1.009l-.265.142-.087.04a3.493 3.493 0 01-.302.118 4.117 4.117 0 01-1.33.208c-.524 0-.996-.067-1.438-.215-.614-.204-1.163-.56-1.726-1.116l-.227-.235c-.753-.812-1.534-1.976-2.493-3.586l-1.43-2.41-.544-.895-1.766 3.13-.343.592C7.597 19.156 6.227 20 4.356 20c-1.21 0-2.205-.42-2.936-1.182l-.168-.184c-.484-.573-.837-1.311-1.043-2.189l-.067-.32a8.69 8.69 0 01-.136-1.288L0 14.468c.002-.745.06-1.49.174-2.23l.1-.573c.298-1.53.828-2.958 1.536-4.157l.209-.34c1.177-1.83 2.789-3.053 4.615-3.16L6.897 4zm-.033 2.615l-.201.01c-.83.083-1.606.673-2.252 1.577l-.138.199-.01.018c-.67 1.017-1.185 2.378-1.456 3.845l-.004.022a12.591 12.591 0 00-.207 2.254l.002.188c.004.18.017.36.04.54l.043.291c.092.503.257.908.486 1.208l.117.137c.303.323.698.492 1.17.492 1.1 0 1.796-.676 3.696-3.641l2.175-3.4.454-.701-.139-.198C9.11 7.3 8.084 6.616 6.864 6.616zm10.196-.552l-.176.007c-.635.048-1.223.359-1.82.933l-.196.198c-.439.462-.887 1.064-1.367 1.807l.266.398c.18.274.362.56.55.858l.293.475 1.396 2.335.695 1.114c.583.926 1.03 1.6 1.408 2.082l.213.262c.282.326.529.54.777.673l.102.05c.227.1.457.138.718.138.176.002.35-.023.518-.073.338-.104.61-.32.813-.637l.095-.163.077-.162c.194-.459.29-1.06.29-1.785l-.006-.449c-.08-2.871-.938-5.372-2.2-6.798l-.176-.189c-.67-.683-1.444-1.074-2.27-1.074z"})]}))}),m1="Mistral";function Rt(n){"@babel/helpers - typeof";return Rt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Rt(n)}var f1=["size","style"];function is(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,o)}return t}function io(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?is(Object(t),!0).forEach(function(o){g1(n,o,t[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):is(Object(t)).forEach(function(o){Object.defineProperty(n,o,Object.getOwnPropertyDescriptor(t,o))})}return n}function g1(n,e,t){return e=y1(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function y1(n){var e=b1(n,"string");return Rt(e)=="symbol"?e:String(e)}function b1(n,e){if(Rt(n)!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var o=t.call(n,e);if(Rt(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function v1(n,e){if(n==null)return{};var t=x1(n,e),o,r;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);for(r=0;r<s.length;r++)o=s[r],!(e.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(n,o)&&(t[o]=n[o])}return t}function x1(n,e){if(n==null)return{};var t={},o=Object.keys(n),r,s;for(s=0;s<o.length;s++)r=o[s],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var w1=a.memo(function(n){var e=n.size,t=e===void 0?"1em":e,o=n.style,r=v1(n,f1);return i.jsxs("svg",io(io({fill:"currentColor",fillRule:"evenodd",height:t,style:io({flex:"none",lineHeight:1},o),viewBox:"0 0 24 24",width:t,xmlns:"http://www.w3.org/2000/svg"},r),{},{children:[i.jsx("title",{children:m1}),i.jsx("path",{clipRule:"evenodd",d:"M3.428 3.4h3.429v3.428h3.429v3.429h-.002 3.431V6.828h3.427V3.4h3.43v13.714H24v3.429H13.714v-3.428h-3.428v-3.429h-3.43v3.428h3.43v3.429H0v-3.429h3.428V3.4zm10.286 13.715h3.428v-3.429h-3.427v3.429z"})]}))}),C1="MoonshotAI";function Nt(n){"@babel/helpers - typeof";return Nt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Nt(n)}var S1=["size","style"];function as(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,o)}return t}function ao(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?as(Object(t),!0).forEach(function(o){k1(n,o,t[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):as(Object(t)).forEach(function(o){Object.defineProperty(n,o,Object.getOwnPropertyDescriptor(t,o))})}return n}function k1(n,e,t){return e=j1(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function j1(n){var e=E1(n,"string");return Nt(e)=="symbol"?e:String(e)}function E1(n,e){if(Nt(n)!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var o=t.call(n,e);if(Nt(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function O1(n,e){if(n==null)return{};var t=P1(n,e),o,r;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);for(r=0;r<s.length;r++)o=s[r],!(e.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(n,o)&&(t[o]=n[o])}return t}function P1(n,e){if(n==null)return{};var t={},o=Object.keys(n),r,s;for(s=0;s<o.length;s++)r=o[s],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var _1=a.memo(function(n){var e=n.size,t=e===void 0?"1em":e,o=n.style,r=O1(n,S1);return i.jsxs("svg",ao(ao({fill:"currentColor",fillRule:"evenodd",height:t,style:ao({flex:"none",lineHeight:1},o),viewBox:"0 0 24 24",width:t,xmlns:"http://www.w3.org/2000/svg"},r),{},{children:[i.jsx("title",{children:C1}),i.jsx("path",{d:"M1.052 16.916l9.539 2.552a21.007 21.007 0 00.06 2.033l5.956 1.593a11.997 11.997 0 01-5.586.865l-.18-.016-.044-.004-.084-.009-.094-.01a11.605 11.605 0 01-.157-.02l-.107-.014-.11-.016a11.962 11.962 0 01-.32-.051l-.042-.008-.075-.013-.107-.02-.07-.015-.093-.019-.075-.016-.095-.02-.097-.023-.094-.022-.068-.017-.088-.022-.09-.024-.095-.025-.082-.023-.109-.03-.062-.02-.084-.025-.093-.028-.105-.034-.058-.019-.08-.026-.09-.031-.066-.024a6.293 6.293 0 01-.044-.015l-.068-.025-.101-.037-.057-.022-.08-.03-.087-.035-.088-.035-.079-.032-.095-.04-.063-.028-.063-.027a5.655 5.655 0 01-.041-.018l-.066-.03-.103-.047-.052-.024-.096-.046-.062-.03-.084-.04-.086-.044-.093-.047-.052-.027-.103-.055-.057-.03-.058-.032a6.49 6.49 0 01-.046-.026l-.094-.053-.06-.034-.051-.03-.072-.041-.082-.05-.093-.056-.052-.032-.084-.053-.061-.039-.079-.05-.07-.047-.053-.035a7.785 7.785 0 01-.054-.036l-.044-.03-.044-.03a6.066 6.066 0 01-.04-.028l-.057-.04-.076-.054-.069-.05-.074-.054-.056-.042-.076-.057-.076-.059-.086-.067-.045-.035-.064-.052-.074-.06-.089-.073-.046-.039-.046-.039a7.516 7.516 0 01-.043-.037l-.045-.04-.061-.053-.07-.062-.068-.06-.062-.058-.067-.062-.053-.05-.088-.084a13.28 13.28 0 01-.099-.097l-.029-.028-.041-.042-.069-.07-.05-.051-.05-.053a6.457 6.457 0 01-.168-.179l-.08-.088-.062-.07-.071-.08-.042-.049-.053-.062-.058-.068-.046-.056a7.175 7.175 0 01-.027-.033l-.045-.055-.066-.082-.041-.052-.05-.064-.02-.025a11.99 11.99 0 01-1.44-2.402zm-1.02-5.794l11.353 3.037a20.468 20.468 0 00-.469 2.011l10.817 2.894a12.076 12.076 0 01-1.845 2.005L.657 15.923l-.016-.046-.035-.104a11.965 11.965 0 01-.05-.153l-.007-.023a11.896 11.896 0 01-.207-.741l-.03-.126-.018-.08-.021-.097-.018-.081-.018-.09-.017-.084-.018-.094c-.026-.141-.05-.283-.071-.426l-.017-.118-.011-.083-.013-.102a12.01 12.01 0 01-.019-.161l-.005-.047a12.12 12.12 0 01-.034-2.145zm1.593-5.15l11.948 3.196c-.368.605-.705 1.231-1.01 1.875l11.295 3.022c-.142.82-.368 1.612-.668 2.365l-11.55-3.09L.124 10.26l.015-.1.008-.049.01-.067.015-.087.018-.098c.026-.148.056-.295.088-.442l.028-.124.02-.085.024-.097c.022-.09.045-.18.07-.268l.028-.102.023-.083.03-.1.025-.082.03-.096.026-.082.031-.095a11.896 11.896 0 011.01-2.232zm4.442-4.4L17.352 4.59a20.77 20.77 0 00-1.688 1.721l7.823 2.093c.267.852.442 1.744.513 2.665L2.106 5.213l.045-.065.027-.04.04-.055.046-.065.055-.076.054-.072.064-.086.05-.065.057-.073.055-.07.06-.074.055-.069.065-.077.054-.066.066-.077.053-.06.072-.082.053-.06.067-.074.054-.058.073-.078.058-.06.063-.067.168-.17.1-.098.059-.056.076-.071a12.084 12.084 0 012.272-1.677zM12.017 0h.097l.082.001.069.001.054.002.068.002.046.001.076.003.047.002.06.003.054.002.087.005.105.007.144.011.088.007.044.004.077.008.082.008.047.005.102.012.05.006.108.014.081.01.042.006.065.01.207.032.07.012.065.011.14.026.092.018.11.022.046.01.075.016.041.01L14.7.3l.042.01.065.015.049.012.071.017.096.024.112.03.113.03.113.032.05.015.07.02.078.024.073.023.05.016.05.016.076.025.099.033.102.036.048.017.064.023.093.034.11.041.116.045.1.04.047.02.06.024.041.018.063.026.04.018.057.025.11.048.1.046.074.035.075.036.06.028.092.046.091.045.102.052.053.028.049.026.046.024.06.033.041.022.052.029.088.05.106.06.087.051.057.034.053.032.096.059.088.055.098.062.036.024.064.041.084.056.04.027.062.042.062.043.023.017c.054.037.108.075.161.114l.083.06.065.048.056.043.086.065.082.064.04.03.05.041.086.069.079.065.085.071c.712.6 1.353 1.283 1.909 2.031L7.222.994l.062-.027.065-.028.081-.034.086-.035c.113-.045.227-.09.341-.131l.096-.035.093-.033.084-.03.096-.031c.087-.03.176-.058.264-.085l.091-.027.086-.025.102-.03.085-.023.1-.026L9.04.37l.09-.023.091-.022.095-.022.09-.02.098-.021.091-.02.095-.018.092-.018.1-.018.091-.016.098-.017.092-.014.097-.015.092-.013.102-.013.091-.012.105-.012.09-.01.105-.01c.093-.01.186-.018.28-.024l.106-.008.09-.005.11-.006.093-.004.1-.004.097-.002.099-.002.197-.002z"})]}))}),M1="Volcengine";function $t(n){"@babel/helpers - typeof";return $t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},$t(n)}var L1=["size","style"];function ls(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,o)}return t}function lo(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ls(Object(t),!0).forEach(function(o){I1(n,o,t[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ls(Object(t)).forEach(function(o){Object.defineProperty(n,o,Object.getOwnPropertyDescriptor(t,o))})}return n}function I1(n,e,t){return e=T1(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function T1(n){var e=R1(n,"string");return $t(e)=="symbol"?e:String(e)}function R1(n,e){if($t(n)!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var o=t.call(n,e);if($t(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function N1(n,e){if(n==null)return{};var t=$1(n,e),o,r;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);for(r=0;r<s.length;r++)o=s[r],!(e.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(n,o)&&(t[o]=n[o])}return t}function $1(n,e){if(n==null)return{};var t={},o=Object.keys(n),r,s;for(s=0;s<o.length;s++)r=o[s],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var D1=a.memo(function(n){var e=n.size,t=e===void 0?"1em":e,o=n.style,r=N1(n,L1);return i.jsxs("svg",lo(lo({fill:"currentColor",fillRule:"evenodd",height:t,style:lo({flex:"none",lineHeight:1},o),viewBox:"0 0 24 24",width:t,xmlns:"http://www.w3.org/2000/svg"},r),{},{children:[i.jsx("title",{children:M1}),i.jsx("path",{d:"M7.29 5.36L3.148 21.737a.215.215 0 00.203.261h8.29a.214.214 0 00.215-.261L7.7 5.359a.214.214 0 00-.41 0z",fillOpacity:".5"}),i.jsx("path",{clipRule:"evenodd",d:"M4.553 16.18l-1.406 5.558a.214.214 0 00.203.261h2.42-4.551a.214.214 0 01-.214-.26l2.275-8.961a.214.214 0 01.409 0l.864 3.402z"}),i.jsx("path",{d:"M14.44.15a.214.214 0 00-.41 0L8.366 21.739a.214.214 0 00.214.261H19.9a.214.214 0 00.215-.261L14.44.151z",fillOpacity:".5"}),i.jsx("path",{clipRule:"evenodd",d:"M16.694 22h3.207a.215.215 0 00.214-.262l-1.839-6.993 1.164-4.592a.214.214 0 01.411 0l2.951 11.586a.214.214 0 01-.214.261h-5.894z"}),i.jsx("path",{d:"M10.278 7.741L6.685 21.736a.214.214 0 00.214.264h7.17a.216.216 0 00.214-.166.216.216 0 000-.098L10.687 7.742a.214.214 0 00-.409 0z"})]}))}),A1="Minimax";function Dt(n){"@babel/helpers - typeof";return Dt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Dt(n)}var z1=["size","style"];function cs(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,o)}return t}function co(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?cs(Object(t),!0).forEach(function(o){F1(n,o,t[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):cs(Object(t)).forEach(function(o){Object.defineProperty(n,o,Object.getOwnPropertyDescriptor(t,o))})}return n}function F1(n,e,t){return e=B1(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function B1(n){var e=U1(n,"string");return Dt(e)=="symbol"?e:String(e)}function U1(n,e){if(Dt(n)!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var o=t.call(n,e);if(Dt(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function V1(n,e){if(n==null)return{};var t=K1(n,e),o,r;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);for(r=0;r<s.length;r++)o=s[r],!(e.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(n,o)&&(t[o]=n[o])}return t}function K1(n,e){if(n==null)return{};var t={},o=Object.keys(n),r,s;for(s=0;s<o.length;s++)r=o[s],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var W1=a.memo(function(n){var e=n.size,t=e===void 0?"1em":e,o=n.style,r=V1(n,z1);return i.jsxs("svg",co(co({fill:"currentColor",fillRule:"evenodd",height:t,style:co({flex:"none",lineHeight:1},o),viewBox:"0 0 24 24",width:t,xmlns:"http://www.w3.org/2000/svg"},r),{},{children:[i.jsx("title",{children:A1}),i.jsx("path",{d:"M16.278 2c1.156 0 2.093.927 2.093 2.07v12.501a.74.74 0 00.744.709.74.74 0 00.743-.709V9.099a2.06 2.06 0 012.071-2.049A2.06 2.06 0 0124 9.1v6.561a.649.649 0 01-.652.645.649.649 0 01-.653-.645V9.1a.762.762 0 00-.766-.758.762.762 0 00-.766.758v7.472a2.037 2.037 0 01-2.048 2.026 2.037 2.037 0 01-2.048-2.026v-12.5a.785.785 0 00-.788-.753.785.785 0 00-.789.752l-.001 15.904A2.037 2.037 0 0113.441 22a2.037 2.037 0 01-2.048-2.026V18.04c0-.356.292-.645.652-.645.36 0 .652.289.652.645v1.934c0 .263.142.506.372.638.23.131.514.131.744 0a.734.734 0 00.372-.638V4.07c0-1.143.937-2.07 2.093-2.07zm-5.674 0c1.156 0 2.093.927 2.093 2.07v11.523a.648.648 0 01-.652.645.648.648 0 01-.652-.645V4.07a.785.785 0 00-.789-.78.785.785 0 00-.789.78v14.013a2.06 2.06 0 01-2.07 2.048 2.06 2.06 0 01-2.071-2.048V9.1a.762.762 0 00-.766-.758.762.762 0 00-.766.758v3.8a2.06 2.06 0 01-2.071 2.049A2.06 2.06 0 010 12.9v-1.378c0-.357.292-.646.652-.646.36 0 .653.29.653.646V12.9c0 .418.343.757.766.757s.766-.339.766-.757V9.099a2.06 2.06 0 012.07-2.048 2.06 2.06 0 012.071 2.048v8.984c0 .419.343.758.767.758.423 0 .766-.339.766-.758V4.07c0-1.143.937-2.07 2.093-2.07z"})]}))}),H1="Zhipu";function At(n){"@babel/helpers - typeof";return At=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},At(n)}var Z1=["size","style"];function ds(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,o)}return t}function uo(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ds(Object(t),!0).forEach(function(o){q1(n,o,t[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ds(Object(t)).forEach(function(o){Object.defineProperty(n,o,Object.getOwnPropertyDescriptor(t,o))})}return n}function q1(n,e,t){return e=G1(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function G1(n){var e=Q1(n,"string");return At(e)=="symbol"?e:String(e)}function Q1(n,e){if(At(n)!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var o=t.call(n,e);if(At(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Y1(n,e){if(n==null)return{};var t=X1(n,e),o,r;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);for(r=0;r<s.length;r++)o=s[r],!(e.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(n,o)&&(t[o]=n[o])}return t}function X1(n,e){if(n==null)return{};var t={},o=Object.keys(n),r,s;for(s=0;s<o.length;s++)r=o[s],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var J1=a.memo(function(n){var e=n.size,t=e===void 0?"1em":e,o=n.style,r=Y1(n,Z1);return i.jsxs("svg",uo(uo({fill:"currentColor",fillRule:"evenodd",height:t,style:uo({flex:"none",lineHeight:1},o),viewBox:"0 0 24 24",width:t,xmlns:"http://www.w3.org/2000/svg"},r),{},{children:[i.jsx("title",{children:H1}),i.jsx("path",{d:"M11.991 23.503a.24.24 0 00-.244.248.24.24 0 00.244.249.24.24 0 00.245-.249.24.24 0 00-.22-.247l-.025-.001zM9.671 5.365a1.697 1.697 0 011.099 2.132l-.071.172-.016.04-.018.054c-.07.16-.104.32-.104.498-.035.71.47 1.279 1.186 1.314h.366c1.309.053 2.338 1.173 2.286 2.523-.052 1.332-1.152 2.38-2.478 2.327h-.174c-.715.018-1.274.64-1.239 1.368 0 .124.018.23.053.337.209.373.54.658.96.8.75.23 1.517-.125 1.9-.782l.018-.035c.402-.64 1.17-.96 1.92-.711.854.284 1.378 1.226 1.099 2.167a1.661 1.661 0 01-2.077 1.102 1.711 1.711 0 01-.907-.711l-.017-.035c-.2-.323-.463-.58-.851-.711l-.056-.018a1.646 1.646 0 00-1.954.746 1.66 1.66 0 01-1.065.764 1.677 1.677 0 01-1.989-1.279c-.209-.906.332-1.83 1.257-2.043a1.51 1.51 0 01.296-.035h.018c.68-.071 1.151-.622 1.116-1.333a1.307 1.307 0 00-.227-.693 2.515 2.515 0 01-.366-1.403 2.39 2.39 0 01.366-1.208c.14-.195.21-.444.227-.693.018-.71-.506-1.261-1.186-1.332l-.07-.018a1.43 1.43 0 01-.299-.07l-.05-.019a1.7 1.7 0 01-1.047-2.114 1.68 1.68 0 012.094-1.101zm-5.575 10.11c.26-.264.639-.367.994-.27.355.096.633.379.728.74.095.362-.007.748-.267 1.013-.402.41-1.053.41-1.455 0a1.062 1.062 0 010-1.482zm14.845-.294c.359-.09.738.024.992.297.254.274.344.665.237 1.025-.107.36-.396.634-.756.718-.551.128-1.1-.22-1.23-.781a1.05 1.05 0 01.757-1.26zm-.064-4.39c.314.32.49.753.49 1.206 0 .452-.176.886-.49 1.206-.315.32-.74.5-1.185.5-.444 0-.87-.18-1.184-.5a1.727 1.727 0 010-2.412 1.654 1.654 0 012.369 0zm-11.243.163c.364.484.447 1.128.218 1.691a1.665 1.665 0 01-2.188.923c-.855-.36-1.26-1.358-.907-2.228a1.68 1.68 0 011.33-1.038c.593-.08 1.183.169 1.547.652zm11.545-4.221c.368 0 .708.2.892.524.184.324.184.724 0 1.048a1.026 1.026 0 01-.892.524c-.568 0-1.03-.47-1.03-1.048 0-.579.462-1.048 1.03-1.048zm-14.358 0c.368 0 .707.2.891.524.184.324.184.724 0 1.048a1.026 1.026 0 01-.891.524c-.569 0-1.03-.47-1.03-1.048 0-.579.461-1.048 1.03-1.048zm10.031-1.475c.925 0 1.675.764 1.675 1.706s-.75 1.705-1.675 1.705-1.674-.763-1.674-1.705c0-.942.75-1.706 1.674-1.706zm-2.626-.684c.362-.082.653-.356.761-.718a1.062 1.062 0 00-.238-1.028 1.017 1.017 0 00-.996-.294c-.547.14-.881.7-.752 1.257.13.558.675.907 1.225.783zm0 16.876c.359-.087.644-.36.75-.72a1.062 1.062 0 00-.237-1.019 1.018 1.018 0 00-.985-.301 1.037 1.037 0 00-.762.717c-.108.361-.017.754.239 1.028.245.263.606.377.953.305l.043-.01zM17.19 3.5a.631.631 0 00.628-.64c0-.355-.279-.64-.628-.64a.631.631 0 00-.628.64c0 .355.28.64.628.64zm-10.38 0a.631.631 0 00.628-.64c0-.355-.28-.64-.628-.64a.631.631 0 00-.628.64c0 .355.279.64.628.64zm-5.182 7.852a.631.631 0 00-.628.64c0 .354.28.639.628.639a.63.63 0 00.627-.606l.001-.034a.62.62 0 00-.628-.64zm5.182 9.13a.631.631 0 00-.628.64c0 .355.279.64.628.64a.631.631 0 00.628-.64c0-.355-.28-.64-.628-.64zm10.38.018a.631.631 0 00-.628.64c0 .355.28.64.628.64a.631.631 0 00.628-.64c0-.355-.279-.64-.628-.64zm5.182-9.148a.631.631 0 00-.628.64c0 .354.279.639.628.639a.631.631 0 00.628-.64c0-.355-.28-.64-.628-.64zm-.384-4.992a.24.24 0 00.244-.249.24.24 0 00-.244-.249.24.24 0 00-.244.249c0 .142.122.249.244.249zM11.991.497a.24.24 0 00.245-.248A.24.24 0 0011.99 0a.24.24 0 00-.244.249c0 .133.108.236.223.247l.021.001zM2.011 6.36a.24.24 0 00.245-.249.24.24 0 00-.244-.249.24.24 0 00-.244.249.24.24 0 00.244.249zm0 11.263a.24.24 0 00-.243.248.24.24 0 00.244.249.24.24 0 00.244-.249.252.252 0 00-.244-.248zm19.995-.018a.24.24 0 00-.245.248.24.24 0 00.245.25.24.24 0 00.244-.25.252.252 0 00-.244-.248z"})]}))}),ep="StepFun";function zt(n){"@babel/helpers - typeof";return zt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},zt(n)}var tp=["size","style"];function us(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,o)}return t}function po(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?us(Object(t),!0).forEach(function(o){np(n,o,t[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):us(Object(t)).forEach(function(o){Object.defineProperty(n,o,Object.getOwnPropertyDescriptor(t,o))})}return n}function np(n,e,t){return e=op(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function op(n){var e=rp(n,"string");return zt(e)=="symbol"?e:String(e)}function rp(n,e){if(zt(n)!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var o=t.call(n,e);if(zt(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function sp(n,e){if(n==null)return{};var t=ip(n,e),o,r;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);for(r=0;r<s.length;r++)o=s[r],!(e.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(n,o)&&(t[o]=n[o])}return t}function ip(n,e){if(n==null)return{};var t={},o=Object.keys(n),r,s;for(s=0;s<o.length;s++)r=o[s],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var ap=a.memo(function(n){var e=n.size,t=e===void 0?"1em":e,o=n.style,r=sp(n,tp);return i.jsxs("svg",po(po({fill:"currentColor",fillRule:"evenodd",height:t,style:po({flex:"none",lineHeight:1},o),viewBox:"0 0 24 24",width:t,xmlns:"http://www.w3.org/2000/svg"},r),{},{children:[i.jsx("title",{children:ep}),i.jsx("path",{d:"M12 0C5.372 0 0 5.372 0 12s5.372 12 12 12 12-5.372 12-12S18.628 0 12 0zM8.762 19.614H4.376v-4.386h4.386v4.386zm5.423 0H9.798v-4.386h4.387v4.386zm0-5.42H9.798V9.81h4.387v4.386zm0-5.418H9.798V4.39h4.387v4.386zm5.422-.004h-4.386V4.386h4.386v4.386z"})]}))}),lp="Kimi";function Ft(n){"@babel/helpers - typeof";return Ft=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ft(n)}var cp=["size","style"];function ps(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,o)}return t}function ho(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ps(Object(t),!0).forEach(function(o){dp(n,o,t[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ps(Object(t)).forEach(function(o){Object.defineProperty(n,o,Object.getOwnPropertyDescriptor(t,o))})}return n}function dp(n,e,t){return e=up(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function up(n){var e=pp(n,"string");return Ft(e)=="symbol"?e:String(e)}function pp(n,e){if(Ft(n)!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var o=t.call(n,e);if(Ft(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function hp(n,e){if(n==null)return{};var t=mp(n,e),o,r;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);for(r=0;r<s.length;r++)o=s[r],!(e.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(n,o)&&(t[o]=n[o])}return t}function mp(n,e){if(n==null)return{};var t={},o=Object.keys(n),r,s;for(s=0;s<o.length;s++)r=o[s],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var fp=a.memo(function(n){var e=n.size,t=e===void 0?"1em":e,o=n.style,r=hp(n,cp);return i.jsxs("svg",ho(ho({fill:"currentColor",fillRule:"evenodd",height:t,style:ho({flex:"none",lineHeight:1},o),viewBox:"0 0 24 24",width:t,xmlns:"http://www.w3.org/2000/svg"},r),{},{children:[i.jsx("title",{children:lp}),i.jsx("path",{d:"M21.846 0a1.923 1.923 0 110 3.846H20.15a.226.226 0 01-.227-.226V1.923C19.923.861 20.784 0 21.846 0z"}),i.jsx("path",{d:"M11.065 11.199l7.257-7.2c.137-.136.06-.41-.116-.41H14.3a.164.164 0 00-.117.051l-7.82 7.756c-.122.12-.302.013-.302-.179V3.82c0-.127-.083-.23-.185-.23H3.186c-.103 0-.186.103-.186.23V19.77c0 .128.083.23.186.23h2.69c.103 0 .186-.102.186-.23v-3.25c0-.069.025-.135.069-.178l2.424-2.406a.158.158 0 01.205-.023l6.484 4.772a7.677 7.677 0 003.453 1.283c.108.012.2-.095.2-.23v-3.06c0-.117-.07-.212-.164-.227a5.028 5.028 0 01-2.027-.807l-5.613-4.064c-.117-.078-.132-.279-.028-.381z"})]}))}),gp="OpenRouter";function Bt(n){"@babel/helpers - typeof";return Bt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Bt(n)}var yp=["size","style"];function hs(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,o)}return t}function mo(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?hs(Object(t),!0).forEach(function(o){bp(n,o,t[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):hs(Object(t)).forEach(function(o){Object.defineProperty(n,o,Object.getOwnPropertyDescriptor(t,o))})}return n}function bp(n,e,t){return e=vp(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function vp(n){var e=xp(n,"string");return Bt(e)=="symbol"?e:String(e)}function xp(n,e){if(Bt(n)!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var o=t.call(n,e);if(Bt(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function wp(n,e){if(n==null)return{};var t=Cp(n,e),o,r;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);for(r=0;r<s.length;r++)o=s[r],!(e.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(n,o)&&(t[o]=n[o])}return t}function Cp(n,e){if(n==null)return{};var t={},o=Object.keys(n),r,s;for(s=0;s<o.length;s++)r=o[s],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var Sp=a.memo(function(n){var e=n.size,t=e===void 0?"1em":e,o=n.style,r=wp(n,yp);return i.jsxs("svg",mo(mo({fill:"currentColor",fillRule:"evenodd",height:t,style:mo({flex:"none",lineHeight:1},o),viewBox:"0 0 24 24",width:t,xmlns:"http://www.w3.org/2000/svg"},r),{},{children:[i.jsx("title",{children:gp}),i.jsx("path",{d:"M18.654 3.87a5.087 5.087 0 110 10.174L23.7 19.09c.64.641.187 1.737-.72 1.737H8.48a8.479 8.479 0 010-16.958h10.175zM8.479 7.26a5.087 5.087 0 100 10.176 5.087 5.087 0 000-10.175z"})]}))}),kp="Groq";function Ut(n){"@babel/helpers - typeof";return Ut=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ut(n)}var jp=["size","style"];function ms(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,o)}return t}function fo(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ms(Object(t),!0).forEach(function(o){Ep(n,o,t[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ms(Object(t)).forEach(function(o){Object.defineProperty(n,o,Object.getOwnPropertyDescriptor(t,o))})}return n}function Ep(n,e,t){return e=Op(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Op(n){var e=Pp(n,"string");return Ut(e)=="symbol"?e:String(e)}function Pp(n,e){if(Ut(n)!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var o=t.call(n,e);if(Ut(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function _p(n,e){if(n==null)return{};var t=Mp(n,e),o,r;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);for(r=0;r<s.length;r++)o=s[r],!(e.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(n,o)&&(t[o]=n[o])}return t}function Mp(n,e){if(n==null)return{};var t={},o=Object.keys(n),r,s;for(s=0;s<o.length;s++)r=o[s],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var Lp=a.memo(function(n){var e=n.size,t=e===void 0?"1em":e,o=n.style,r=_p(n,jp);return i.jsxs("svg",fo(fo({fill:"currentColor",fillRule:"evenodd",height:t,style:fo({flex:"none",lineHeight:1},o),viewBox:"0 0 24 24",width:t,xmlns:"http://www.w3.org/2000/svg"},r),{},{children:[i.jsx("title",{children:kp}),i.jsx("path",{d:"M12.036 2c-3.853-.035-7 3-7.036 6.781-.035 3.782 3.055 6.872 6.908 6.907h2.42v-2.566h-2.292c-2.407.028-4.38-1.866-4.408-4.23-.029-2.362 1.901-4.298 4.308-4.326h.1c2.407 0 4.358 1.915 4.365 4.278v6.305c0 2.342-1.944 4.25-4.323 4.279a4.375 4.375 0 01-3.033-1.252l-1.851 1.818A7 7 0 0012.029 22h.092c3.803-.056 6.858-3.083 6.879-6.816v-6.5C18.907 4.963 15.817 2 12.036 2z"})]}))}),Ip="Cohere";function Vt(n){"@babel/helpers - typeof";return Vt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Vt(n)}var Tp=["size","style"];function fs(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,o)}return t}function go(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?fs(Object(t),!0).forEach(function(o){Rp(n,o,t[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):fs(Object(t)).forEach(function(o){Object.defineProperty(n,o,Object.getOwnPropertyDescriptor(t,o))})}return n}function Rp(n,e,t){return e=Np(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Np(n){var e=$p(n,"string");return Vt(e)=="symbol"?e:String(e)}function $p(n,e){if(Vt(n)!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var o=t.call(n,e);if(Vt(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Dp(n,e){if(n==null)return{};var t=Ap(n,e),o,r;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);for(r=0;r<s.length;r++)o=s[r],!(e.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(n,o)&&(t[o]=n[o])}return t}function Ap(n,e){if(n==null)return{};var t={},o=Object.keys(n),r,s;for(s=0;s<o.length;s++)r=o[s],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var zp=a.memo(function(n){var e=n.size,t=e===void 0?"1em":e,o=n.style,r=Dp(n,Tp);return i.jsxs("svg",go(go({fill:"currentColor",fillRule:"evenodd",height:t,style:go({flex:"none",lineHeight:1},o),viewBox:"0 0 24 24",width:t,xmlns:"http://www.w3.org/2000/svg"},r),{},{children:[i.jsx("title",{children:Ip}),i.jsx("path",{clipRule:"evenodd",d:"M8.128 14.099c.592 0 1.77-.033 3.398-.703 1.897-.781 5.672-2.2 8.395-3.656 1.905-1.018 2.74-2.366 2.74-4.18A4.56 4.56 0 0018.1 1H7.549A6.55 6.55 0 001 7.55c0 3.617 2.745 6.549 7.128 6.549z"}),i.jsx("path",{clipRule:"evenodd",d:"M9.912 18.61a4.387 4.387 0 012.705-4.052l3.323-1.38c3.361-1.394 7.06 1.076 7.06 4.715a5.104 5.104 0 01-5.105 5.104l-3.597-.001a4.386 4.386 0 01-4.386-4.387z"}),i.jsx("path",{d:"M4.776 14.962A3.775 3.775 0 001 18.738v.489a3.776 3.776 0 007.551 0v-.49a3.775 3.775 0 00-3.775-3.775z"})]}))}),Fp="Grok";function Kt(n){"@babel/helpers - typeof";return Kt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Kt(n)}var Bp=["size","style"];function gs(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,o)}return t}function yo(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?gs(Object(t),!0).forEach(function(o){Up(n,o,t[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):gs(Object(t)).forEach(function(o){Object.defineProperty(n,o,Object.getOwnPropertyDescriptor(t,o))})}return n}function Up(n,e,t){return e=Vp(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Vp(n){var e=Kp(n,"string");return Kt(e)=="symbol"?e:String(e)}function Kp(n,e){if(Kt(n)!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var o=t.call(n,e);if(Kt(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Wp(n,e){if(n==null)return{};var t=Hp(n,e),o,r;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);for(r=0;r<s.length;r++)o=s[r],!(e.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(n,o)&&(t[o]=n[o])}return t}function Hp(n,e){if(n==null)return{};var t={},o=Object.keys(n),r,s;for(s=0;s<o.length;s++)r=o[s],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var Zp=a.memo(function(n){var e=n.size,t=e===void 0?"1em":e,o=n.style,r=Wp(n,Bp);return i.jsxs("svg",yo(yo({fill:"currentColor",fillRule:"evenodd",height:t,style:yo({flex:"none",lineHeight:1},o),viewBox:"0 0 24 24",width:t,xmlns:"http://www.w3.org/2000/svg"},r),{},{children:[i.jsx("title",{children:Fp}),i.jsx("path",{d:"M6.469 8.776L16.512 23h-4.464L2.005 8.776H6.47zm-.004 7.9l2.233 3.164L6.467 23H2l4.465-6.324zM22 2.582V23h-3.659V7.764L22 2.582zM22 1l-9.952 14.095-2.233-3.163L17.533 1H22z"})]}))}),qp="Baichuan";function Wt(n){"@babel/helpers - typeof";return Wt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Wt(n)}var Gp=["size","style"];function ys(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,o)}return t}function bo(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ys(Object(t),!0).forEach(function(o){Qp(n,o,t[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ys(Object(t)).forEach(function(o){Object.defineProperty(n,o,Object.getOwnPropertyDescriptor(t,o))})}return n}function Qp(n,e,t){return e=Yp(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Yp(n){var e=Xp(n,"string");return Wt(e)=="symbol"?e:String(e)}function Xp(n,e){if(Wt(n)!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var o=t.call(n,e);if(Wt(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Jp(n,e){if(n==null)return{};var t=eh(n,e),o,r;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);for(r=0;r<s.length;r++)o=s[r],!(e.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(n,o)&&(t[o]=n[o])}return t}function eh(n,e){if(n==null)return{};var t={},o=Object.keys(n),r,s;for(s=0;s<o.length;s++)r=o[s],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var th=a.memo(function(n){var e=n.size,t=e===void 0?"1em":e,o=n.style,r=Jp(n,Gp);return i.jsxs("svg",bo(bo({fill:"currentColor",fillRule:"evenodd",height:t,style:bo({flex:"none",lineHeight:1},o),viewBox:"0 0 24 24",width:t,xmlns:"http://www.w3.org/2000/svg"},r),{},{children:[i.jsx("title",{children:qp}),i.jsx("path",{d:"M7.333 2h-3.2l-2 4.333V17.8L0 22h5.2l2.028-4.2L7.333 2zm7.334 0h-5.2v20h5.2V2zM16.8 7.733H22V22h-5.2V7.733zM22 2h-5.2v4.133H22V2z"})]}))}),nh="ByteDance";function Ht(n){"@babel/helpers - typeof";return Ht=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ht(n)}var oh=["size","style"];function bs(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,o)}return t}function vo(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?bs(Object(t),!0).forEach(function(o){rh(n,o,t[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):bs(Object(t)).forEach(function(o){Object.defineProperty(n,o,Object.getOwnPropertyDescriptor(t,o))})}return n}function rh(n,e,t){return e=sh(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function sh(n){var e=ih(n,"string");return Ht(e)=="symbol"?e:String(e)}function ih(n,e){if(Ht(n)!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var o=t.call(n,e);if(Ht(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function ah(n,e){if(n==null)return{};var t=lh(n,e),o,r;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);for(r=0;r<s.length;r++)o=s[r],!(e.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(n,o)&&(t[o]=n[o])}return t}function lh(n,e){if(n==null)return{};var t={},o=Object.keys(n),r,s;for(s=0;s<o.length;s++)r=o[s],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var ch=a.memo(function(n){var e=n.size,t=e===void 0?"1em":e,o=n.style,r=ah(n,oh);return i.jsxs("svg",vo(vo({fill:"currentColor",fillRule:"evenodd",height:t,style:vo({flex:"none",lineHeight:1},o),viewBox:"0 0 24 24",width:t,xmlns:"http://www.w3.org/2000/svg"},r),{},{children:[i.jsx("title",{children:nh}),i.jsx("path",{d:"M14.944 18.587l-1.704-.445V10.01l1.824-.462c1-.254 1.84-.461 1.88-.453.032 0 .056 2.235.056 4.972v4.973l-.176-.008c-.104 0-.952-.207-1.88-.446z"}),i.jsx("path",{d:"M7 16.542c0-2.736.024-4.98.064-4.98.032-.008.872.2 1.88.454l1.816.461-.016 4.05-.024 4.049-1.632.422c-.896.23-1.736.445-1.856.469L7 21.523v-4.98z"}),i.jsx("path",{d:"M19.24 12.477c0-9.03.008-9.515.144-9.475.072.024.784.207 1.576.406.792.207 1.576.405 1.744.445l.296.08-.016 8.56-.024 8.568-1.624.414c-.888.23-1.728.437-1.856.47l-.24.055v-9.523z"}),i.jsx("path",{d:"M1 12.509c0-4.678.024-8.505.064-8.505.032 0 .872.207 1.872.454l1.824.461v7.582c0 4.16-.016 7.574-.032 7.574-.024 0-.872.215-1.88.47L1 21.013v-8.505z"})]}))});const dh={openai:{key:"openai",displayName:"OpenAI",color:"#10A37F",Component:O0},anthropic:{key:"anthropic",displayName:"Claude",color:"#D97706",Component:N0},deepseek:{key:"deepseek",displayName:"DeepSeek",color:"#4D6BFE",Component:V0},qwen:{key:"qwen",displayName:"Qwen",color:"#615CED",Component:Y0},google:{key:"google",displayName:"Google",color:"#4285F4",Component:s1},meta:{key:"meta",displayName:"Meta",color:"#0081FB",Component:h1},mistral:{key:"mistral",displayName:"Mistral",color:"#FF7000",Component:w1},moonshot:{key:"moonshot",displayName:"Moonshot",color:"#7C3AED",Component:_1},doubao:{key:"doubao",displayName:"火山引擎",color:"#006EFF",Component:D1},minimax:{key:"minimax",displayName:"MiniMax",color:"#F23F5D",Component:W1},zhipu:{key:"zhipu",displayName:"Zhipu",color:"#3859FF",Component:J1},stepfun:{key:"stepfun",displayName:"StepFun",color:"#005AFF",Component:ap},kimi:{key:"kimi",displayName:"Kimi",color:"#000000",Component:fp},openrouter:{key:"openrouter",displayName:"OpenRouter",color:"#6366F1",Component:Sp},groq:{key:"groq",displayName:"Groq",color:"#F55036",Component:Lp},cohere:{key:"cohere",displayName:"Cohere",color:"#39594D",Component:zp},xai:{key:"xai",displayName:"xAI",color:"#000000",Component:Zp},baichuan:{key:"baichuan",displayName:"Baichuan",color:"#4A90E2",Component:th},bytedance:{key:"bytedance",displayName:"ByteDance",color:"#006EFF",Component:ch}};function Ei(n){return dh[n]}function wn(n){const e=(n||"").toLowerCase(),t=e.lastIndexOf("/"),o=t>=0?e.slice(t+1):e;return o.startsWith("claude")||e.includes("anthropic")?"anthropic":o.startsWith("gpt")||o.startsWith("o1")||o.startsWith("o3")||o.startsWith("o4")?"openai":e.includes("deepseek")?"deepseek":o.startsWith("qwen")?"qwen":o.startsWith("moonshot")?"moonshot":o.startsWith("glm")?"zhipu":o.startsWith("step-")?"stepfun":o.startsWith("doubao")?"doubao":o.startsWith("minimax")||o.startsWith("abab")?"minimax":e.includes("gemini")?"google":o.startsWith("llama")||e.includes("meta-llama")?"meta":o.startsWith("mistral")||o.startsWith("mixtral")||o.startsWith("codestral")?"mistral":o.startsWith("command")?"cohere":o.startsWith("grok")?"xai":o.startsWith("baichuan")?"baichuan":o.startsWith("kimi")?"kimi":null}const xo={deepseek:"#4D6BFE",dashscope:"#615CED",qwen:"#615CED",openai:"#10A37F",anthropic:"#D97706",openrouter:"#6366F1",google:"#4285F4",moonshot:"#7C3AED",kimi:"#7C3AED",doubao:"#006EFF",minimax:"#F23F5D",zhipu:"#3859FF",stepfun:"#005AFF"};function Oi(n,e){const t=(n||"").toLowerCase();for(const[r,s]of Object.entries(xo))if(t.includes(r))return s;const o=wn(e||"");return o&&xo[o]?xo[o]:"var(--semi-color-text-3, #8f959e)"}function uh(n,e){const t=(n||"").toLowerCase();if(t.includes("deepseek"))return"DEEPSEEK";if(t.includes("dashscope")||t.includes("qwen"))return"QWEN";if(t.includes("anthropic"))return"ANTHROPIC";if(t.includes("openai"))return"OPENAI";if(t.includes("openrouter"))return"OPENROUTER";if(t.includes("google"))return"GOOGLE";if(t.includes("moonshot"))return"KIMI";if(t.includes("volces")||t.includes("volcengine"))return"DOUBAO";if(t.includes("minimax"))return"MINIMAX";if(t.includes("bigmodel")||t.includes("zhipu"))return"ZHIPU";if(t.includes("stepfun"))return"STEPFUN";const o=wn(e||"");return o?o.toUpperCase():"OTHER"}function ut(n){return n.name||n.model||""}function ph(n,e,t,o){const r=n[e],s=r?ut(r):"";if(t==null||t===e)return s;const l=n[t];return l?`${ut(l)} → ${s}`:s}function vs({apibase:n,model:e,size:t=14}){const o=wn(e||"")||hh(n),r=o?Ei(o):void 0;if(r!=null&&r.Component){const s=r.Component;return i.jsx(s,{size:t})}return i.jsx("span",{"data-slot":"provider-dot",style:{background:Oi(n,e)}})}function hh(n){const e=(n||"").toLowerCase();return e.includes("deepseek")?"deepseek":e.includes("dashscope")||e.includes("qwen")?"qwen":e.includes("anthropic")?"anthropic":e.includes("openai")?"openai":e.includes("openrouter")?"openrouter":e.includes("google")?"google":e.includes("moonshot")?"moonshot":e.includes("volces")||e.includes("volcengine")?"doubao":e.includes("minimax")?"minimax":e.includes("bigmodel")||e.includes("zhipu")?"zhipu":e.includes("stepfun")?"stepfun":null}function mh(n){const e=[],t=new Map;return n.forEach((o,r)=>{if(o.kind==="mixin"){e.push({profile:o,idx:r});return}const s=uh(o.apibase,o.model);t.has(s)||t.set(s,{provider:s,color:Oi(o.apibase,o.model),items:[]}),t.get(s).items.push({profile:o,idx:r})}),{groups:Array.from(t.values()),mixins:e}}function fh({selectedNo:n,runningNo:e,isRunning:t,onSelect:o}={}){const[r,s]=a.useState(!1),[l,c]=a.useState(""),[u,p]=a.useState(null),[d,m]=a.useState(!1),f=a.useRef(null),y=a.useRef(null),b=a.useRef(null),x=a.useRef(null),{lang:C,t:S}=he(),k=Z(T=>T.modelProfiles),_=Z(T=>T.defaultModelNo),v=Z(T=>T.liveModel),j=G(T=>T.sessionModelNo),w=G(T=>T.status),E=G(T=>T.selectSessionModel),O=n??j??_,D=e!==void 0?e:v==null?void 0:v.runningLlmNo,P=t??w==="running",N=k.length===0,L=k[O],B=a.useMemo(()=>L?P&&D!=null&&D!==O?ph(k,O,D):L.kind==="mixin"?S("model.aggregationShort"):ut(L):S("model.menuLabel"),[L,P,k,D,O,S]),{groups:Q,mixins:z}=a.useMemo(()=>mh(k),[k]),M=a.useMemo(()=>{if(!l.trim())return Q;const T=l.toLowerCase();return Q.map(F=>({...F,items:F.items.filter(({profile:J})=>ut(J).toLowerCase().includes(T)||(J.model||"").toLowerCase().includes(T)||F.provider.toLowerCase().includes(T))})).filter(F=>F.items.length>0)},[Q,l]),Y=a.useCallback(()=>{s(T=>(T||c(""),!T))},[]),fe=a.useCallback(T=>{o?o(T):E(T),s(!1)},[o,E]);a.useEffect(()=>{r&&x.current&&x.current.focus()},[r]),a.useEffect(()=>{var J;const T=(J=b.current)==null?void 0:J.closest('[data-slot="composer-toolbar"]');if(!T)return;const F=new ResizeObserver(ce=>{var ke,ge;const ie=((ge=(ke=ce[0])==null?void 0:ke.contentRect)==null?void 0:ge.width)??T.offsetWidth;m(ie<320)});return F.observe(T),()=>F.disconnect()},[]),a.useEffect(()=>{if(!r)return;function T(J){f.current&&!f.current.contains(J.target)&&y.current&&!y.current.contains(J.target)&&s(!1)}function F(J){J.key==="Escape"&&s(!1)}return document.addEventListener("mousedown",T),document.addEventListener("keydown",F),()=>{document.removeEventListener("mousedown",T),document.removeEventListener("keydown",F)}},[r]),a.useEffect(()=>{function T(F){if((F.metaKey||F.ctrlKey)&&F.key>="1"&&F.key<="9"){const J=parseInt(F.key)-1;J<k.length&&(F.preventDefault(),E(J))}}return document.addEventListener("keydown",T),()=>document.removeEventListener("keydown",T)},[k,E]);const Se=a.useCallback(()=>{s(!1),Z.getState().open()},[]);return i.jsxs("div",{ref:b,"data-slot":"model-selector",children:[i.jsx("button",{ref:y,"data-slot":"model-chip","data-loading":N?"":void 0,"data-open":r?"":void 0,onClick:Y,title:L?L.kind==="mixin"?S("model.aggregation"):`${L.model}${L.apibase?" @ "+L.apibase:""}`:S("model.menuLabel"),children:N?i.jsx("span",{"data-slot":"model-chip-spinner",children:i.jsx("span",{})}):i.jsxs(i.Fragment,{children:[!d&&i.jsx("span",{"data-slot":"model-chip-label",children:B}),i.jsx("span",{"data-slot":"model-chip-caret","data-open":r?"":void 0,children:i.jsx(xs,{})})]})}),r&&!N&&i.jsxs("div",{ref:f,"data-slot":"model-menu",children:[i.jsxs("div",{"data-slot":"model-menu-search",children:[i.jsx(gh,{}),i.jsx("input",{ref:x,type:"text",placeholder:S("model.menuLabel"),value:l,onChange:T=>c(T.target.value),"data-slot":"model-menu-search-input"})]}),i.jsxs("div",{"data-slot":"model-menu-body",children:[M.map(T=>{var F,J;return i.jsxs("div",{"data-slot":"model-menu-section",children:[i.jsxs("div",{"data-slot":"model-menu-section-header",children:[i.jsx(vs,{apibase:((F=T.items[0])==null?void 0:F.profile.apibase)||"",model:(J=T.items[0])==null?void 0:J.profile.model}),T.provider]}),T.items.map(({profile:ce,idx:ie})=>i.jsxs("button",{"data-slot":"model-menu-item","data-active":ie===O?"":void 0,onClick:()=>fe(ie),title:`${ce.model}${ce.apibase?" @ "+ce.apibase:""}`,children:[ie===O&&i.jsx("span",{"data-slot":"model-check",children:"✓"}),i.jsx("span",{"data-slot":"model-menu-name",children:ut(ce)})]},ce.id))]},T.provider)}),z.length>0&&i.jsxs("div",{"data-slot":"model-menu-section",children:[i.jsx("div",{"data-slot":"model-menu-section-header",children:S("model.aggregationShort").toUpperCase()}),z.map(({profile:T,idx:F})=>{var ie;const J=u===F,ce=((ie=T.name)==null?void 0:ie.trim())||S("model.aggregationShort");return i.jsxs("div",{"data-slot":"model-menu-group",children:[i.jsxs("button",{"data-slot":"model-menu-item","data-active":F===O?"":void 0,onClick:()=>fe(F),title:S("model.aggregationDesc"),children:[F===O&&i.jsx("span",{"data-slot":"model-check",children:"✓"}),i.jsx("span",{"data-slot":"model-menu-name",children:ce}),T.members&&T.members.length>0&&i.jsx("span",{"data-slot":"mixin-caret","data-expanded":J?"":void 0,onClick:ke=>{ke.stopPropagation(),p(J?null:F)},children:i.jsx(xs,{})})]}),J&&T.members&&i.jsxs("div",{"data-slot":"mixin-members",children:[T.members.map(ke=>{const ge=k.find($=>$.name===ke);return i.jsxs("div",{"data-slot":"mixin-member",children:[i.jsx(vs,{apibase:(ge==null?void 0:ge.apibase)||"",model:ge==null?void 0:ge.model,size:12}),i.jsx("span",{"data-slot":"model-menu-name",children:ge?ut(ge):String(ke)})]},ke)}),T.members.length===0&&i.jsx("div",{"data-slot":"mixin-member",style:{opacity:.5},children:S("model.emptyMixin")})]})]},T.id)})]}),M.length===0&&z.length===0&&i.jsx("div",{"data-slot":"model-menu-empty",children:S("set.noModels")})]}),i.jsx("div",{"data-slot":"model-menu-footer",children:i.jsx("button",{"data-slot":"model-menu-action",onClick:Se,children:C==="zh"?"编辑模型…":"Edit models…"})})]})]})}function xs(){return i.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"currentColor","aria-hidden":"true",children:i.jsx("path",{d:"M2.5 3.5L5 6.5L7.5 3.5",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round",fill:"none"})})}function gh(){return i.jsx("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true","data-slot":"model-menu-search-icon",children:i.jsx("path",{d:"M7 12A5 5 0 107 2a5 5 0 000 10zM14 14l-3.5-3.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}const yh={pdf:{char:"📄",color:"#E53E3E"},doc:{char:"📝",color:"#2B6CB0"},docx:{char:"📝",color:"#2B6CB0"},xls:{char:"📊",color:"#276749"},xlsx:{char:"📊",color:"#276749"},csv:{char:"📊",color:"#276749"},zip:{char:"📦",color:"#744210"},rar:{char:"📦",color:"#744210"},py:{char:"🐍",color:"#3182CE"},js:{char:"⚡",color:"#D69E2E"},ts:{char:"⚡",color:"#3182CE"},md:{char:"📋",color:"#4A5568"},txt:{char:"📋",color:"#4A5568"},json:{char:"{ }",color:"#6366F1"}};function bh(n){var t;const e=((t=n.split(".").pop())==null?void 0:t.toLowerCase())||"";return yh[e]||{char:"📎",color:"var(--semi-color-text-3, #8f959e)"}}function vh(n){return!n||n<0?"":n<1024?n+" B":n<1048576?(n/1024).toFixed(1)+" KB":(n/1048576).toFixed(1)+" MB"}function xh(n){try{return new URL(n).hostname}catch{return n.slice(0,30)}}function wh({files:n,onRemove:e,onRetry:t}){const o=a.useCallback(s=>l=>{l.stopPropagation(),e(s)},[e]),r=a.useCallback(s=>l=>{l.stopPropagation(),t==null||t(s)},[t]);return n.length===0?null:i.jsx("div",{"data-slot":"attachment-strip","data-has-items":"",children:n.map(s=>{if(s.type==="image"&&s.preview)return i.jsxs("div",{"data-slot":"attachment-thumb","data-status":s.status,children:[i.jsx("img",{src:s.preview,alt:s.name}),s.status==="uploading"&&i.jsx("span",{"data-slot":"attachment-spinner"}),s.status==="error"&&i.jsx("button",{"data-slot":"attachment-error-badge",onClick:r(s.id),title:s.errorMsg||"Error",children:"!"}),s.status!=="uploading"&&i.jsx("button",{"data-slot":"attachment-remove",onClick:o(s.id),"aria-label":"Remove",children:"×"})]},s.id);if(s.type==="url")return i.jsxs("div",{"data-slot":"attachment-file-chip","data-status":s.status,children:[i.jsx("span",{"data-slot":"attachment-file-icon",children:"🔗"}),i.jsx("span",{"data-slot":"attachment-file-meta",children:i.jsx("span",{"data-slot":"attachment-file-name",children:s.url?xh(s.url):s.name})}),i.jsx("button",{"data-slot":"attachment-remove",onClick:o(s.id),"aria-label":"Remove",children:"×"})]},s.id);const l=bh(s.name);return i.jsxs("div",{"data-slot":"attachment-file-chip","data-status":s.status,children:[s.status==="uploading"?i.jsx("span",{"data-slot":"attachment-spinner"}):s.status==="error"?i.jsx("button",{"data-slot":"attachment-error-badge",onClick:r(s.id),title:s.errorMsg||"Error",children:"!"}):i.jsx("span",{"data-slot":"attachment-file-icon",style:{color:l.color},children:l.char}),i.jsxs("span",{"data-slot":"attachment-file-meta",children:[i.jsx("span",{"data-slot":"attachment-file-name",children:s.name}),s.status==="error"&&s.errorMsg&&i.jsx("span",{"data-slot":"attachment-file-error",children:s.errorMsg}),s.status!=="error"&&s.size>0&&i.jsx("span",{"data-slot":"attachment-file-size",children:vh(s.size)})]}),s.status!=="uploading"&&i.jsx("button",{"data-slot":"attachment-remove",onClick:o(s.id),"aria-label":"Remove",children:"×"})]},s.id)})})}const Ch="ga_custom_presets";function Sh(){try{const n=localStorage.getItem(Ch);return n?JSON.parse(n):[]}catch{return[]}}const ws={hint:{zh:"提示:输入 / 以内联调用技能",en:"Tip: type / to invoke a skill inline"}};function kh({onSelect:n}){const[e,t]=a.useState(!1),[o,r]=a.useState(-1),s=a.useRef(null),l=a.useRef(null),c=Z(f=>f.lang),u=Sh(),p=[...Xe,...u],d=a.useCallback(()=>{t(f=>!f),r(-1)},[]),m=a.useCallback((f,y)=>{n(f,y),t(!1)},[n]);return a.useEffect(()=>{if(!e)return;function f(b){s.current&&!s.current.contains(b.target)&&l.current&&!l.current.contains(b.target)&&t(!1)}function y(b){if(b.key==="Escape"){t(!1);return}b.key==="ArrowDown"&&(b.preventDefault(),r(x=>Math.min(x+1,p.length-1))),b.key==="ArrowUp"&&(b.preventDefault(),r(x=>Math.max(x-1,0))),b.key==="Enter"&&o>=0&&o<p.length&&(b.preventDefault(),m(p[o].id,p[o].prompt))}return document.addEventListener("mousedown",f),document.addEventListener("keydown",y),()=>{document.removeEventListener("mousedown",f),document.removeEventListener("keydown",y)}},[e,o,p,m]),i.jsxs("div",{"data-slot":"skill-wrap",children:[i.jsx("button",{ref:l,"data-slot":"skill-trigger",onClick:d,"aria-label":"Presets",title:"Prompt presets",children:i.jsx(jh,{})}),e&&i.jsxs("div",{ref:s,"data-slot":"skill-panel",children:[i.jsxs("div",{"data-slot":"skill-section",children:[i.jsx("div",{"data-slot":"skill-section-title",children:"Presets"}),Xe.map((f,y)=>i.jsx("button",{"data-slot":"skill-item","data-focused":o===y?"":void 0,onClick:()=>m(f.id,f.prompt),onMouseEnter:()=>r(y),children:i.jsxs("span",{"data-slot":"skill-info",children:[i.jsx("span",{"data-slot":"skill-name",children:f.title}),i.jsx("span",{"data-slot":"skill-desc",children:f.desc[c]||f.desc.en})]})},f.id))]}),u.length>0&&i.jsxs("div",{"data-slot":"skill-section",children:[i.jsx("div",{"data-slot":"skill-section-title",children:"Custom"}),u.map((f,y)=>i.jsx("button",{"data-slot":"skill-item","data-focused":o===Xe.length+y?"":void 0,onClick:()=>m(f.id,f.prompt),onMouseEnter:()=>r(Xe.length+y),children:i.jsxs("span",{"data-slot":"skill-info",children:[i.jsx("span",{"data-slot":"skill-name",children:f.title}),i.jsx("span",{"data-slot":"skill-desc",children:f.desc[c]||f.desc.en})]})},f.id))]}),i.jsx("div",{"data-slot":"skill-panel-hint",children:ws.hint[c]||ws.hint.en})]})]})}function jh(){return i.jsx("svg",{width:"16",height:"16",viewBox:"0 0 256 256",fill:"currentColor","aria-hidden":"true",children:i.jsx("path",{d:"M215.79 118.17a8 8 0 0 0-5-5.66L153.18 90.9l14.66-73.33a8 8 0 0 0-13.69-7l-112 120a8 8 0 0 0 3 13.05l57.63 21.61-14.62 73.12a8 8 0 0 0 13.69 7l112-120a8 8 0 0 0 1.94-7.18Z"})})}function Eh(n,e,t=!1){return t?"disabled":n&&e?"queue":n?"stop":e?"send":"disabled"}function Oh({state:n,onSend:e,onStop:t,onQueue:o}){const r=a.useCallback(()=>{switch(n){case"send":e();break;case"stop":t();break;case"queue":o==null||o();break}},[n,e,t,o]);a.useEffect(()=>{if(n!=="stop")return;function l(c){c.key==="Escape"&&(c.preventDefault(),t())}return document.addEventListener("keydown",l),()=>document.removeEventListener("keydown",l)},[n,t]);const s=n==="stop"?"Stop generating":n==="queue"?"Queue message":"Send message";return i.jsxs("button",{"data-slot":"composer-cta","data-state":n,onClick:r,disabled:n==="disabled","aria-label":s,title:s,children:[n==="stop"&&i.jsx(_h,{}),n==="queue"&&i.jsx(Mh,{}),(n==="send"||n==="disabled")&&i.jsx(Ph,{})]})}function Ph(){return i.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:i.jsx("path",{d:"M8 14V2m0 0L3 7m5-5l5 5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function _h(){return i.jsx("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",children:i.jsx("rect",{x:"3",y:"3",width:"10",height:"10",rx:"2",fill:"currentColor"})})}function Mh(){return i.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:i.jsx("path",{d:"M3 4h10M3 8h10M3 12h10",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}const Cs={thinking:{zh:"思考中…",en:"Thinking…"},queued:{zh:"排队中",en:"Queued"}};function Lh(){const n=G(s=>s.status==="running"),e=G(s=>s.pendingQueue),t=G(s=>s.cancelQueued),o=Z(s=>s.lang);if(!n&&e.length===0)return null;const r=s=>Cs[s][o]||Cs[s].en;return i.jsxs("div",{"data-slot":"composer-status-stack",children:[n&&i.jsxs("div",{"data-slot":"status-running",children:[i.jsx("span",{"data-slot":"status-dot"}),i.jsx("span",{"data-slot":"status-label",children:r("thinking")})]}),e.map((s,l)=>i.jsxs("div",{"data-slot":"status-queued",children:[i.jsxs("span",{"data-slot":"status-queue-num",children:["#",l+1]}),i.jsxs("span",{"data-slot":"status-queue-text",children:[s.text.slice(0,40),s.text.length>40?"…":""]}),i.jsx("button",{"data-slot":"status-queue-cancel",onClick:()=>t(l),"aria-label":"Cancel",children:i.jsx("svg",{width:"10",height:"10",viewBox:"0 0 16 16",fill:"none",children:i.jsx("path",{d:"M4 4l8 8M12 4l-8 8",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})]},l))]})}const Ss=7,Ih=5;function ks(n){return Math.floor(Math.random()*n)}function Th(){const{t:n}=he(),e=G(s=>s.activeSessionId),t=G(s=>s.messages.length>0),o=a.useRef({sessionId:null,index:ks(Ss),wasNew:!0});return{text:a.useMemo(()=>{const s=o.current;if(s.sessionId!==e){const c=!t,p=ks(c?Ss:Ih);return o.current={sessionId:e,index:p,wasNew:c},n(`composer.placeholder.${c?"new":"followUp"}.${p}`)}const l=s.wasNew?"new":"followUp";return n(`composer.placeholder.${l}.${s.index}`)},[e,t,n])}}function Rh(){var r;const{modelProfiles:n,defaultModelNo:e}=Z.getState(),o=G.getState().sessionModelNo??e;return((r=n[o])==null?void 0:r.kind)==="mixin"}let js=0;function Nh({onSend:n,onStop:e,isGenerating:t,editorRef:o,hideStatusStack:r,modelControl:s}){const l=a.useRef(null),c=o??l,u=a.useRef(null),p=a.useRef(null),d=a.useRef(null),{text:m}=Th(),[f,y]=a.useState(""),[b,x]=a.useState([]),[C,S]=a.useState(!1),[k,_]=a.useState(null),[v,j]=a.useState(null);a.useEffect(()=>{const $=u.current;if(!$)return;const V=new ResizeObserver(q=>{var oe,ee,se;const R=((se=(ee=(oe=q[0])==null?void 0:oe.borderBoxSize)==null?void 0:ee[0])==null?void 0:se.blockSize)??$.offsetHeight;document.documentElement.style.setProperty("--composer-measured-height",`${R}px`)});return V.observe($),()=>V.disconnect()},[]);const w=a.useCallback($=>{const q=[];for(const R of Array.from($)){const oe=`att-${++js}`,ee=R.type.startsWith("image/")&&R.type!=="image/svg+xml",se=R.size>52428800;if(ee&&!se){const te=new FileReader;te.onload=Fe=>{x(U=>U.map(we=>{var nt;return we.id===oe?{...we,preview:(nt=Fe.target)==null?void 0:nt.result,status:"ready"}:we}))},te.readAsDataURL(R)}else if(!ee&&!se){const te=new FileReader;te.onload=async Fe=>{var U;try{const we=(U=Fe.target)==null?void 0:U.result,nt=await Md(R.name,we);x(Cn=>Cn.map(He=>He.id===oe?{...He,path:nt,status:"ready",errorMsg:void 0}:He))}catch(we){const nt=we instanceof Error?we.message:"upload failed";x(Cn=>Cn.map(He=>He.id===oe?{...He,status:"error",errorMsg:nt}:He))}},te.onerror=()=>{x(Fe=>Fe.map(U=>U.id===oe?{...U,status:"error",errorMsg:"read failed"}:U))},te.readAsDataURL(R)}q.push({id:oe,name:R.name,size:R.size,type:ee?"image":"file",status:se?"error":"uploading",errorMsg:se?"File too large (max 50 MB)":void 0,path:R.path||R.name})}x(R=>[...R,...q])},[]),E=a.useCallback($=>{for(const V of $){const q=`att-${++js}`,R=V.split(/[\\/]/).pop()||V,oe=/\.(png|jpe?g|gif|webp|bmp|avif)$/i.test(R);x(ee=>[...ee,{id:q,name:R,size:0,type:oe?"image":"file",status:"uploading",path:V}]),Ld(V,oe).then(ee=>{x(se=>se.map(te=>te.id!==q?te:ee?oe&&ee.preview?{...te,type:"image",preview:ee.preview,size:ee.size,status:"ready"}:{...te,type:"file",size:ee.size,status:"ready"}:{...te,status:"error",errorMsg:"read failed"}))})}},[]),O=a.useCallback(()=>{var Fe;const $=f.trim();if(!$&&b.length===0)return;const V=b.filter(U=>U.type==="image"&&U.status==="ready"),q=b.filter(U=>U.type==="image"&&U.status==="uploading"),R=b.filter(U=>U.type==="file"&&U.status==="uploading"),oe=b.filter(U=>U.status==="error");if(q.length>0||R.length>0||oe.length>0)return;const ee={},se=b.filter(U=>U.type==="file");se.length>0&&(ee.files=se.map(U=>({name:U.name,path:U.path||U.name,size:U.size})));let te=$;if(V.length>0)if(Rh()){const U=V.map(we=>we.path&&we.path!==we.name?`[图片: ${we.path}]`:null).filter(Boolean).join(`
|
||
`);U&&(te=te?`${te}
|
||
|
||
${U}`:U)}else ee.images=V.map(U=>({name:U.name,path:U.path||U.name,base64:U.preview}));n(te||"",Object.keys(ee).length>0?ee:void 0),(Fe=c.current)==null||Fe.clear(),y(""),x([])},[f,b,n]),D=a.useCallback($=>{$.key==="Enter"&&!$.shiftKey&&($.preventDefault(),O())},[O]),P=a.useCallback($=>{y($)},[]),N=a.useCallback($=>{_($)},[]),L=a.useCallback(()=>{_(null)},[]),B=a.useCallback(($,V)=>{var q,R;(q=c.current)==null||q.setSkillChip($,V),(R=c.current)==null||R.focus(),_(null)},[]),Q=a.useCallback($=>{j($)},[]),z=a.useCallback(()=>{j(null)},[]),M=a.useCallback(($,V)=>{var oe,ee,se,te;const q=((oe=c.current)==null?void 0:oe.getText())||"",R=q.lastIndexOf("@");R>=0&&((ee=c.current)==null||ee.setText(q.slice(0,R))),(se=c.current)==null||se.insertChip($,V),(te=c.current)==null||te.focus(),j(null)},[]),Y=a.useCallback($=>{w($)},[w]),fe=a.useCallback($=>{x(V=>V.filter(q=>q.id!==$))},[]),Se=a.useCallback(($,V)=>{var q,R;(q=c.current)==null||q.setSkillChip($,V),(R=c.current)==null||R.focus()},[]),T=a.useCallback(()=>{var $;($=p.current)==null||$.click()},[]),F=a.useCallback(()=>{var $;($=d.current)==null||$.click()},[]),J=a.useCallback(async()=>{try{const $=await navigator.clipboard.read();for(const V of $){const q=V.types.find(R=>R.startsWith("image/"));if(q){const R=await V.getType(q),oe=new File([R],"clipboard-image.png",{type:q});w([oe]);return}}}catch{}},[w]),ce=a.useCallback($=>{$.target.files&&$.target.files.length>0&&w($.target.files),$.target.value=""},[w]);a.useEffect(()=>{var R,oe,ee;const $=(ee=(oe=(R=window.__TAURI__)==null?void 0:R.webview)==null?void 0:oe.getCurrentWebview)==null?void 0:ee.call(oe);if(!$)return;let V,q=!1;return $.onDragDropEvent(se=>{const te=se.payload.type;te==="enter"||te==="over"?S(!0):te==="leave"?S(!1):te==="drop"&&(S(!1),se.payload.paths&&se.payload.paths.length>0&&E(se.payload.paths))}).then(se=>{q?se():V=se}),()=>{q=!0,V==null||V()}},[E]);const ie=f.trim().length>0||b.length>0,ke=b.some($=>$.status==="uploading"),ge=Eh(t,ie,ke);return i.jsxs("div",{ref:u,"data-slot":"composer-root",children:[C&&i.jsx("div",{"data-slot":"composer-drop-overlay",children:"Drop files here"}),i.jsxs("div",{"data-slot":"composer-surface",children:[!r&&i.jsx(Lh,{}),i.jsx(wh,{files:b,onRemove:fe}),i.jsx(u0,{visible:k!==null,query:k||"",onSelect:B,onClose:L}),i.jsx(h0,{visible:v!==null,query:v||"",onConfirm:M,onClose:z}),i.jsx("div",{"data-slot":"composer-input-row",children:i.jsx(c0,{ref:c,placeholder:m,disabled:!1,onInput:P,onKeyDown:D,onSlashTrigger:N,onSlashDismiss:L,onAtTrigger:Q,onAtDismiss:z,onPasteFiles:Y})}),i.jsxs("div",{"data-slot":"composer-toolbar",children:[i.jsxs("div",{"data-slot":"composer-toolbar-left",children:[i.jsx(f0,{onUploadFile:T,onUploadImage:F,onPasteImage:J}),i.jsx(kh,{onSelect:Se})]}),i.jsxs("div",{"data-slot":"composer-toolbar-right",children:[s===void 0?i.jsx(fh,{}):s,i.jsx(Oh,{state:ge,onSend:O,onStop:e,onQueue:O})]})]})]}),i.jsx("input",{ref:p,type:"file",multiple:!0,style:{display:"none"},onChange:ce}),i.jsx("input",{ref:d,type:"file",multiple:!0,accept:"image/*",style:{display:"none"},onChange:ce})]})}const $h="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%201099.5%20105'%20width='1099.5'%20height='105'%20fill='%23000000'%3e%3cg%20transform='translate(-5.6%2088.5)'%3e%3cpath%20d='M62.70%200L20.40%200Q16.40%200%2013-2Q9.60-4%207.60-7.40Q5.60-10.80%205.60-14.80L5.60-14.80L5.60-57.20Q5.60-61.30%207.60-64.65Q9.60-68%2013-70Q16.40-72%2020.40-72L20.40-72L62.70-72Q66.80-72%2070.15-70Q73.50-68%2075.55-64.65Q77.60-61.30%2077.60-57.20L77.60-57.20L77.60-50.40L61.90-50.40L61.90-56.40L21.10-56.40L21.10-15.60L61.90-15.60L61.90-26.40L46.30-26.40L46.30-42L77.60-42L77.60-14.80Q77.60-10.80%2075.55-7.40Q73.50-4%2070.15-2Q66.80%200%2062.70%200L62.70%200ZM161.30%200L94.80%200L94.80-72L161.30-72L161.30-56.40L110.50-56.40L110.50-43.80L151.40-43.80L151.40-28.20L110.50-28.20L110.50-15.60L161.30-15.60L161.30%200ZM192.70%200L177.20%200L177.20-72L193.20-72L233.50-24L233.50-72L249.20-72L249.20%200L233.20%200L192.70-48.20L192.70%200ZM333.10%200L266.60%200L266.60-72L333.10-72L333.10-56.40L282.30-56.40L282.30-43.80L323.20-43.80L323.20-28.20L282.30-28.20L282.30-15.60L333.10-15.60L333.10%200ZM420.90%200L404.90%200L385.00-23.60L364.50-23.60L364.50%200L349.00%200L349.00-71.90L406.10-71.90Q410.20-71.90%20413.55-69.90Q416.90-67.90%20418.95-64.50Q421.00-61.10%20421.00-57.10L421.00-57.10L421.00-38.50Q421.00-34.50%20418.95-31.10Q416.90-27.70%20413.55-25.70Q410.20-23.70%20406.10-23.70L406.10-23.70L405.30-23.70L420.90-5.30L420.90%200ZM364.50-56.40L364.50-39.30L405.30-39.30L405.30-56.40L364.50-56.40ZM450.30%200L435.00%200L435.00-72L450.30-72L450.30%200ZM536.70%200L479.70%200Q475.60%200%20472.25-2Q468.90-4%20466.90-7.35Q464.90-10.70%20464.90-14.80L464.90-14.80L464.90-57.20Q464.90-61.30%20466.90-64.65Q468.90-68%20472.25-70Q475.60-72%20479.70-72L479.70-72L536.70-72L536.70-56.40L483.70-56.40Q482.10-56.40%20481.25-55.60Q480.40-54.80%20480.40-53.10L480.40-53.10L480.40-18.90Q480.40-17.30%20481.25-16.45Q482.10-15.60%20483.70-15.60L483.70-15.60L536.70-15.60L536.70%200ZM607%200L591.50%200L591.50-57.20Q591.50-61.30%20593.50-64.65Q595.50-68%20598.90-70Q602.30-72%20606.30-72L606.30-72L648.60-72Q652.70-72%20656.05-70Q659.40-68%20661.45-64.65Q663.50-61.30%20663.50-57.20L663.50-57.20L663.50%200L647.80%200L647.80-23.20L607-23.20L607%200ZM607-56.40L607-38.80L647.80-38.80L647.80-56.40L607-56.40ZM738.00%200L695.70%200Q691.70%200%20688.30-2Q684.90-4%20682.90-7.40Q680.90-10.80%20680.90-14.80L680.90-14.80L680.90-57.20Q680.90-61.30%20682.90-64.65Q684.90-68%20688.30-70Q691.70-72%20695.70-72L695.70-72L738.00-72Q742.10-72%20745.45-70Q748.80-68%20750.85-64.65Q752.90-61.30%20752.90-57.20L752.90-57.20L752.90-50.40L737.20-50.40L737.20-56.40L696.40-56.40L696.40-15.60L737.20-15.60L737.20-26.40L721.60-26.40L721.60-42L752.90-42L752.90-14.80Q752.90-10.80%20750.85-7.40Q748.80-4%20745.45-2Q742.10%200%20738.00%200L738.00%200ZM836.60%200L770.10%200L770.10-72L836.60-72L836.60-56.40L785.80-56.40L785.80-43.80L826.70-43.80L826.70-28.20L785.80-28.20L785.80-15.60L836.60-15.60L836.60%200ZM868.00%200L852.50%200L852.50-72L868.50-72L908.80-24L908.80-72L924.50-72L924.50%200L908.50%200L868.00-48.20L868.00%200ZM981.90%200L966.30%200L966.30-56.40L938.10-56.40L938.10-72L1010.10-72L1010.10-56.40L981.90-56.40L981.90%200Z'%3e%3c/path%3e%3crect%20x='1050.1'%20y='-88.5'%20width='55'%20height='105'%3e%3c/rect%3e%3c/g%3e%3c/svg%3e",Dh="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%201099.5%20105'%20width='1099.5'%20height='105'%20fill='%23FFFFFF'%3e%3cg%20transform='translate(-5.6%2088.5)'%3e%3cpath%20d='M62.70%200L20.40%200Q16.40%200%2013-2Q9.60-4%207.60-7.40Q5.60-10.80%205.60-14.80L5.60-14.80L5.60-57.20Q5.60-61.30%207.60-64.65Q9.60-68%2013-70Q16.40-72%2020.40-72L20.40-72L62.70-72Q66.80-72%2070.15-70Q73.50-68%2075.55-64.65Q77.60-61.30%2077.60-57.20L77.60-57.20L77.60-50.40L61.90-50.40L61.90-56.40L21.10-56.40L21.10-15.60L61.90-15.60L61.90-26.40L46.30-26.40L46.30-42L77.60-42L77.60-14.80Q77.60-10.80%2075.55-7.40Q73.50-4%2070.15-2Q66.80%200%2062.70%200L62.70%200ZM161.30%200L94.80%200L94.80-72L161.30-72L161.30-56.40L110.50-56.40L110.50-43.80L151.40-43.80L151.40-28.20L110.50-28.20L110.50-15.60L161.30-15.60L161.30%200ZM192.70%200L177.20%200L177.20-72L193.20-72L233.50-24L233.50-72L249.20-72L249.20%200L233.20%200L192.70-48.20L192.70%200ZM333.10%200L266.60%200L266.60-72L333.10-72L333.10-56.40L282.30-56.40L282.30-43.80L323.20-43.80L323.20-28.20L282.30-28.20L282.30-15.60L333.10-15.60L333.10%200ZM420.90%200L404.90%200L385.00-23.60L364.50-23.60L364.50%200L349.00%200L349.00-71.90L406.10-71.90Q410.20-71.90%20413.55-69.90Q416.90-67.90%20418.95-64.50Q421.00-61.10%20421.00-57.10L421.00-57.10L421.00-38.50Q421.00-34.50%20418.95-31.10Q416.90-27.70%20413.55-25.70Q410.20-23.70%20406.10-23.70L406.10-23.70L405.30-23.70L420.90-5.30L420.90%200ZM364.50-56.40L364.50-39.30L405.30-39.30L405.30-56.40L364.50-56.40ZM450.30%200L435.00%200L435.00-72L450.30-72L450.30%200ZM536.70%200L479.70%200Q475.60%200%20472.25-2Q468.90-4%20466.90-7.35Q464.90-10.70%20464.90-14.80L464.90-14.80L464.90-57.20Q464.90-61.30%20466.90-64.65Q468.90-68%20472.25-70Q475.60-72%20479.70-72L479.70-72L536.70-72L536.70-56.40L483.70-56.40Q482.10-56.40%20481.25-55.60Q480.40-54.80%20480.40-53.10L480.40-53.10L480.40-18.90Q480.40-17.30%20481.25-16.45Q482.10-15.60%20483.70-15.60L483.70-15.60L536.70-15.60L536.70%200ZM607%200L591.50%200L591.50-57.20Q591.50-61.30%20593.50-64.65Q595.50-68%20598.90-70Q602.30-72%20606.30-72L606.30-72L648.60-72Q652.70-72%20656.05-70Q659.40-68%20661.45-64.65Q663.50-61.30%20663.50-57.20L663.50-57.20L663.50%200L647.80%200L647.80-23.20L607-23.20L607%200ZM607-56.40L607-38.80L647.80-38.80L647.80-56.40L607-56.40ZM738.00%200L695.70%200Q691.70%200%20688.30-2Q684.90-4%20682.90-7.40Q680.90-10.80%20680.90-14.80L680.90-14.80L680.90-57.20Q680.90-61.30%20682.90-64.65Q684.90-68%20688.30-70Q691.70-72%20695.70-72L695.70-72L738.00-72Q742.10-72%20745.45-70Q748.80-68%20750.85-64.65Q752.90-61.30%20752.90-57.20L752.90-57.20L752.90-50.40L737.20-50.40L737.20-56.40L696.40-56.40L696.40-15.60L737.20-15.60L737.20-26.40L721.60-26.40L721.60-42L752.90-42L752.90-14.80Q752.90-10.80%20750.85-7.40Q748.80-4%20745.45-2Q742.10%200%20738.00%200L738.00%200ZM836.60%200L770.10%200L770.10-72L836.60-72L836.60-56.40L785.80-56.40L785.80-43.80L826.70-43.80L826.70-28.20L785.80-28.20L785.80-15.60L836.60-15.60L836.60%200ZM868.00%200L852.50%200L852.50-72L868.50-72L908.80-24L908.80-72L924.50-72L924.50%200L908.50%200L868.00-48.20L868.00%200ZM981.90%200L966.30%200L966.30-56.40L938.10-56.40L938.10-72L1010.10-72L1010.10-56.40L981.90-56.40L981.90%200Z'%3e%3c/path%3e%3crect%20x='1050.1'%20y='-88.5'%20width='55'%20height='105'%3e%3c/rect%3e%3c/g%3e%3c/svg%3e",Ah={plan:i.jsx(Ka,{size:"small"}),goal:i.jsx(el,{size:"small"}),autonomous:i.jsx(ll,{size:"small"}),hive:i.jsx(fl,{size:"small"}),review:i.jsx(yl,{size:"small"}),findwork:i.jsx(ni,{size:"small"})};function zh({onPresetClick:n}){const{t:e}=he();return i.jsxs("div",{"data-slot":"empty-state-root",children:[i.jsxs("div",{"data-slot":"empty-state-wordmark",children:[i.jsx("img",{src:$h,alt:"GenericAgent",className:"empty-state-wordmark-light"}),i.jsx("img",{src:Dh,alt:"",className:"empty-state-wordmark-dark","aria-hidden":"true"})]}),i.jsx("div",{"data-slot":"empty-state-presets",children:Xe.map(t=>i.jsxs("button",{type:"button",className:"empty-state-preset-btn",onClick:()=>n(t),children:[i.jsx("span",{className:"empty-state-preset-icon",children:Ah[t.id]}),i.jsx("span",{children:e(`preset.${t.id}.t`)||t.title})]},t.id))})]})}function Fh(){const{t:n}=he(),e=Wo(),t=G(m=>m.status),o=G(m=>m.messages),r=G(m=>m.sendMessage),s=G(m=>m.cancel),l=a.useRef(null),c=a.useCallback((m,f)=>{(m||f)&&r(m,f)},[r]),u=a.useCallback(m=>{var f,y;(f=l.current)==null||f.setSkillChip(m.id,m.prompt),(y=l.current)==null||y.focus()},[]),p=o.length===0&&t==="idle",d=p&&e!=="ready";return i.jsxs("div",{className:"chat-view-root","data-empty":p||void 0,children:[d?i.jsx("div",{className:"ga-chat-offline",children:i.jsx("span",{children:n(e==="connecting"?"bridge.connecting":"bridge.offline")})}):p?i.jsx(zh,{onPresetClick:u}):i.jsx(e0,{}),i.jsx(Nh,{onSend:c,onStop:s,isGenerating:t==="running",editorRef:l})]})}const Bh=a.lazy(async()=>({default:(await Zt(()=>import("./ServicesPage-9DKyWUIu.js"),__vite__mapDeps([11,1,2,12,13,14,5,6,15,16,7,8,17]))).ServicesPage})),Uh=a.lazy(async()=>({default:(await Zt(()=>import("./TokenPage-8X0HZ3hU.js"),__vite__mapDeps([18,1,2,12,13,14,5,6,15,19,20,21,7,8,22]))).TokenPage})),Vh=a.lazy(async()=>({default:(await Zt(()=>import("./CollabPage-DD4zkzQv.js"),__vite__mapDeps([23,1,2,0,3,4,5,6,7,8,9,24]))).CollabPage}));function wo({children:n}){return i.jsx(a.Suspense,{fallback:i.jsx("span",{"data-slot":"deferred-page-loading","aria-busy":"true"}),children:n})}function Es(){const n=Te(e=>e.activePage);return n==="chat"?i.jsx("div",{className:"ga-main-area ga-main-chat",children:i.jsx(Fh,{})}):n==="services"?i.jsx("div",{className:"ga-main-area ga-main-full",children:i.jsx(wo,{children:i.jsx(Bh,{})})}):n==="token"?i.jsx("div",{className:"ga-main-area ga-main-full",children:i.jsx(wo,{children:i.jsx(Uh,{})})}):n==="collab"?i.jsx("div",{className:"ga-main-area ga-main-chat",children:i.jsx(wo,{children:i.jsx(Vh,{})})}):i.jsx("div",{className:"ga-main-area"})}function Kh(n){if(typeof n!="object"||n===null)return!1;const e=n;return typeof e.trafficLightCenterY=="number"&&Number.isFinite(e.trafficLightCenterY)&&e.trafficLightCenterY>=0&&typeof e.trafficLightRightX=="number"&&Number.isFinite(e.trafficLightRightX)&&e.trafficLightRightX>=0}function Wh(){const n=Te(l=>l.sidebarCollapsed),e=Te(l=>l.toggleSidebar),[t,o]=a.useState(null),r=a.useRef(!1);a.useEffect(()=>{function l(c){(c.metaKey||c.ctrlKey)&&c.key==="b"&&(c.preventDefault(),e())}return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[e]),a.useEffect(()=>{var f,y,b;if(!qs)return;let l=!1,c;const u=[],p=async()=>{try{const x=await Oe("get_macos_titlebar_metrics",{});if(l)return;if(!Kh(x))throw new Error("invalid macOS titlebar metrics");o(x)}catch(x){if(l)return;o(null),r.current||(r.current=!0,console.warn("Using fallback macOS titlebar geometry",x))}},d=()=>{window.clearTimeout(c),c=window.setTimeout(()=>void p(),50)};p(),window.addEventListener("resize",d);const m=(b=(y=(f=window.__TAURI__)==null?void 0:f.window)==null?void 0:y.getCurrentWindow)==null?void 0:b.call(y);for(const x of[m==null?void 0:m.onResized,m==null?void 0:m.onScaleChanged])typeof x=="function"&&Promise.resolve(x.call(m,d)).then(C=>{typeof C=="function"&&(l?C():u.push(C))}).catch(()=>{});return()=>{l=!0,window.clearTimeout(c),window.removeEventListener("resize",d),u.forEach(x=>x())}},[]);const s=t?{"--ga-titlebar-controls-top":`${t.trafficLightCenterY-14}px`,"--ga-titlebar-controls-left":`${t.trafficLightRightX+10}px`}:void 0;return i.jsx("div",{className:"ga-titlebar-controls","data-testid":"titlebar-controls","data-traffic-light-center-y":t==null?void 0:t.trafficLightCenterY,"data-traffic-light-right-x":t==null?void 0:t.trafficLightRightX,style:s,children:i.jsx("button",{type:"button",className:"ga-titlebar-btn",onClick:e,title:n?"显示侧边栏":"隐藏侧边栏","aria-label":n?"显示侧边栏":"隐藏侧边栏",children:i.jsx(Pe,{name:n?"layout-sidebar-left-off":"layout-sidebar-left",size:"16px"})})})}function Hh(){const n=a.useRef(!1),{t:e}=he();return a.useEffect(()=>{var o,r;if(n.current||(n.current=!0,document.documentElement.dataset.platform==="macos"))return;const t=(r=(o=window.__TAURI__)==null?void 0:o.core)==null?void 0:r.invoke;t&&(async()=>{try{if(!await t("shortcut_should_ask"))return;le.confirm({title:e("common.confirm"),content:e("shortcut.askConfirm"),onOk:()=>t("shortcut_decide",{create:!0}),onCancel:()=>t("shortcut_decide",{create:!1})})}catch{}})()},[e]),null}function Zh(){return a.useCallback(n=>{var s,l,c,u;if(!qs||n.button!==0||n.target.closest("button, a, input, [data-no-drag]"))return;const t=n.currentTarget.getBoundingClientRect();if(n.clientY-t.top>38)return;n.preventDefault();const r=window.__TAURI__;(u=(c=(l=(s=r==null?void 0:r.window)==null?void 0:s.getCurrentWindow)==null?void 0:l.call(s))==null?void 0:c.startDragging)==null||u.call(c)},[])}function qh(){const n=Te(t=>t.sidebarCollapsed),e=Zh();return i.jsxs("div",{className:"ga-app-layout",onMouseDown:e,children:[ha&&i.jsx(xa,{}),i.jsx(Wh,{}),i.jsx("div",{className:"ga-app-body",children:n?i.jsx("div",{className:"ga-body-collapsed",children:i.jsx(Es,{})}):i.jsxs(bn,{direction:"horizontal",children:[i.jsx(Ot,{defaultSize:"260px",min:"200px",max:"340px",className:"ga-sidebar-item",children:i.jsx(pu,{})}),i.jsx(yn,{}),i.jsx(Ot,{className:"ga-main-item",children:i.jsx(Es,{})})]})}),i.jsx(Hh,{})]})}const Os=4;let Gh=0;const Ps=ft((n,e)=>({items:[],notify(t){const o=`notif-${++Gh}-${Date.now()}`,r={...t,id:o,createdAt:Date.now()};n(s=>{const l=s.items.find(u=>u.message===r.message&&u.kind===r.kind);if(l)return{items:s.items.map(u=>u.id===l.id?{...r,id:l.id}:u)};const c=[...s.items,r];return{items:c.length>Os?c.slice(-Os):c}}),t.kind==="info"||t.kind==="success"?setTimeout(()=>e().dismiss(o),5e3):(t.kind==="error"||t.kind==="warning")&&setTimeout(()=>e().dismiss(o),8e3)},dismiss(t){n(o=>({items:o.items.filter(r=>r.id!==t)}))},clear(){n({items:[]})}}));function _s({item:n,onDismiss:e}){const t=n.kind==="error"||n.kind==="warning";return i.jsxs("div",{className:`ga-notification ga-notification--${n.kind}`,role:"alert",children:[i.jsxs("div",{className:"ga-notification-body",children:[n.title&&i.jsx("div",{className:"ga-notification-title",children:n.title}),i.jsx("div",{className:"ga-notification-message",children:n.message}),n.action&&i.jsx("button",{className:"ga-notification-action",onClick:n.action.onClick,children:n.action.label})]}),t&&i.jsx("button",{className:"ga-notification-dismiss",onClick:e,"aria-label":"close",children:i.jsx(ln,{size:"small"})})]})}function Qh(){const n=Ps(s=>s.items),e=Ps(s=>s.dismiss),t=a.useRef(null);if(a.useEffect(()=>{if(!t.current){const s=document.createElement("div");s.id="ga-notification-portal",document.body.appendChild(s),t.current=s}return()=>{t.current&&(document.body.removeChild(t.current),t.current=null)}},[]),!t.current||n.length===0)return null;const o=n.filter(s=>s.kind==="error"||s.kind==="warning"),r=n.filter(s=>s.kind==="info"||s.kind==="success");return ma.createPortal(i.jsxs(i.Fragment,{children:[o.length>0&&i.jsx("div",{className:"ga-notification-stack ga-notification-stack--top",children:o.map(s=>i.jsx(_s,{item:s,onDismiss:()=>e(s.id)},s.id))}),r.length>0&&i.jsx("div",{className:"ga-notification-stack ga-notification-stack--bottom",children:r.map(s=>i.jsx(_s,{item:s,onDismiss:()=>e(s.id)},s.id))})]}),t.current)}function yt({children:n,tip:e,tipLabel:t}){return i.jsxs("div",{className:"ga-set-sec-heading",children:[i.jsx("h2",{className:"ga-set-sec-t",children:n}),e&&i.jsx(Ae,{content:e,position:"topLeft",children:i.jsx("span",{className:"ga-settings-section-help",tabIndex:0,"aria-label":[t,e].filter(Boolean).join(":"),children:i.jsx(il,{size:"small","aria-hidden":"true"})})})]})}function Yh(){const{t:n}=he(),e=Z(o=>o.appearance),t=Z(o=>o.setAppearance);return i.jsxs("div",{className:"ga-set-block",children:[i.jsx(yt,{children:n("set.appearance")}),i.jsxs(Ke,{type:"button",value:e,onChange:o=>t(o.target.value),children:[i.jsx(Le,{value:"light",children:n("appearance.light")}),i.jsx(Le,{value:"dark",children:n("appearance.dark")})]})]})}function Xh(){const{t:n}=he(),e=Z(o=>o.lang),t=Z(o=>o.setLang);return i.jsxs("div",{className:"ga-set-block",children:[i.jsx(yt,{children:n("set.lang")}),i.jsxs(Ke,{type:"button",value:e,onChange:o=>t(o.target.value),children:[i.jsx(Le,{value:"zh",children:n("lang.zh")}),i.jsx(Le,{value:"en",children:n("lang.en")})]})]})}function Ms({model:n,size:e=16}){const t=wn(n),o=t?Ei(t):void 0;if(!(o!=null&&o.Component))return null;const r=o.Component;return i.jsx(r,{size:e})}function rn(n){return(n.name||"").trim()||n.model||"(unnamed)"}function Ls(n){const e=(n.model||"").trim();if(e)return rn(n)===e?void 0:e}function Jh({onAdd:n,onEdit:e}){const{t}=he(),o=Z(v=>v.modelProfiles),r=Z(v=>v.defaultModelNo),s=Z(v=>v.setDefaultModel),l=Z(v=>v.setModelProfiles),[c,u]=a.useState(!0),p=o.find(v=>v.kind==="mixin"),d=o.filter(v=>v.kind!=="mixin"),m=p?o.indexOf(p):-1,f=a.useCallback(v=>{s(v)},[s]),y=a.useCallback((v,j)=>{le.confirm({title:t("common.delete"),content:`${t("common.delete")} "${j}"?`,okText:t("common.delete"),cancelText:t("common.cancel"),okType:"danger",onOk:async()=>{try{const w=await xd(v);l(w),X.success({content:t("common.delete")})}catch{X.error({content:t("err.modelDelete")})}}})},[l,t]),b=a.useCallback(v=>{e(v)},[e]),x=a.useCallback(()=>{n()},[n]),C=a.useCallback(async v=>{try{const j=await wd(v);l(j)}catch{X.error({content:t("err.mixinFailed")})}},[l,t]),S=a.useCallback(async v=>{try{const j=await Cd(v);l(j)}catch{X.error({content:t("err.mixinFailed")})}},[l,t]),k=a.useCallback(async v=>{if(!(p!=null&&p.members))return;const j=[...p.members],w=j.indexOf(v);if(!(w<=0)){[j[w-1],j[w]]=[j[w],j[w-1]];try{const E=await $r(j);l(E)}catch{X.error({content:t("err.mixinFailed")})}}},[p,l,t]),_=a.useCallback(async v=>{if(!(p!=null&&p.members))return;const j=[...p.members],w=j.indexOf(v);if(!(w<0||w>=j.length-1)){[j[w],j[w+1]]=[j[w+1],j[w]];try{const E=await $r(j);l(E)}catch{X.error({content:t("err.mixinFailed")})}}},[p,l,t]);return i.jsxs("div",{className:"ga-set-block",children:[i.jsx(yt,{tip:t("model.configurationTip"),tipLabel:t("model.configurationHelp"),children:t("set.model")}),p&&i.jsxs("div",{className:"ga-mixin-group",children:[i.jsxs("div",{className:`ga-mixin-head${m===r?" ga-mixin-head--active":""}`,onClick:()=>f(m),children:[i.jsx("button",{type:"button",className:"ga-mixin-toggle",onClick:v=>{v.stopPropagation(),u(j=>!j)},"aria-label":"toggle",children:i.jsx(em,{expanded:c})}),i.jsx(Ae,{content:t("model.aggregationTip"),position:"topLeft",children:i.jsx("span",{className:"ga-mixin-label",tabIndex:0,"aria-label":`${t("model.aggregation")}:${t("model.aggregationTip")}`,children:t("model.aggregation")})}),m===r&&i.jsx(ze,{color:"green",size:"small",children:t("set.current")})]}),c&&i.jsxs("div",{className:"ga-mixin-body",children:[!p.members||p.members.length===0?i.jsx("div",{className:"ga-mixin-empty",children:t("model.emptyMixin")}):i.jsx("div",{className:"ga-mixin-members",children:p.members.map((v,j)=>{const w=d.find(D=>D.name===v),E=w?rn(w):v,O=w?Ls(w):void 0;return i.jsxs("div",{className:"ga-mixin-member",children:[i.jsx("span",{className:"ga-mixin-member-rank",children:j+1}),i.jsx(Ms,{model:(w==null?void 0:w.model)||"",size:14}),i.jsx("span",{className:"ga-mixin-member-name",title:O,children:E}),i.jsxs("span",{className:"ga-mixin-member-actions",children:[i.jsx("button",{type:"button",className:"ga-icon-btn",disabled:j===0,onClick:()=>k(v),title:"↑",children:"↑"}),i.jsx("button",{type:"button",className:"ga-icon-btn",disabled:j===p.members.length-1,onClick:()=>_(v),title:"↓",children:"↓"}),i.jsx("button",{type:"button",className:"ga-icon-btn ga-icon-btn--danger",onClick:()=>w&&S(w.id),title:t("model.removeFromMixin"),children:"×"})]})]},v)})}),i.jsx("div",{className:"ga-mixin-hint",children:t("model.aggregationDesc")})]})]}),i.jsxs("div",{className:"ga-model-list",children:[d.length===0&&i.jsx("div",{className:"ga-model-empty",children:t("set.noModels")}),d.map(v=>{const j=o.indexOf(v),w=j===r;return i.jsxs("div",{className:`ga-model-item${w?" ga-model-item--selected":""}`,onClick:()=>f(j),children:[i.jsxs("div",{className:"ga-model-row-content",children:[i.jsx(Ms,{model:v.model||""}),i.jsx("span",{className:"ga-model-name",title:Ls(v),children:rn(v)}),w&&i.jsx(ze,{color:"green",size:"small",children:t("set.current")}),v.inMixin&&i.jsx(ze,{size:"small",children:t("model.inMixin")})]}),i.jsxs("span",{className:"ga-model-actions",children:[p&&!v.inMixin&&i.jsx(de,{size:"small",type:"tertiary",theme:"borderless",onClick:E=>{E.stopPropagation(),C(v.id)},children:"+"}),i.jsx(de,{size:"small",type:"tertiary",theme:"borderless",onClick:E=>{E.stopPropagation(),b(v.id)},children:t("common.edit")}),i.jsx(de,{size:"small",type:"danger",theme:"borderless",onClick:E=>{E.stopPropagation(),y(v.id,rn(v))},children:t("common.delete")})]})]},v.id)})]}),i.jsxs(de,{type:"tertiary",onClick:x,className:"ga-add-model-btn",children:["+ ",t("set.addModel")]})]})}function em({expanded:n}){return i.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"currentColor",style:{transform:n?"rotate(90deg)":"rotate(0deg)",transition:"transform 0.15s"},children:i.jsx("path",{d:"M4.5 2.5L8 6L4.5 9.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none"})})}class Pi extends Error{constructor(t,o){super(t);bt(this,"code");bt(this,"runningSessions");bt(this,"runningExtras");this.name="DataBackupError",this.code=typeof o.code=="string"?o.code:null,this.runningSessions=Array.isArray(o.runningSessions)?o.runningSessions.filter(r=>typeof r=="string"):[],this.runningExtras=Array.isArray(o.runningExtras)?o.runningExtras.filter(r=>typeof r=="string"):[]}}async function Ho(n,e){const t=await fetch(`${ne}${n}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),o=await t.json().catch(()=>({}));if(!t.ok){const r=typeof(o==null?void 0:o.error)=="string"?o.error:`HTTP ${t.status}`;throw new Pi(r,o)}return o}async function tm(){const n=new AbortController,e=globalThis.setTimeout(()=>n.abort(),3e3);try{const t=await fetch(`${ne}/services/capabilities`,{method:"GET",signal:n.signal});if(t.status===404)return!1;if(!t.ok)return null;const o=await t.json();return typeof o!="object"||o===null||typeof o.dataBackup!="boolean"?null:o.dataBackup}catch{return null}finally{globalThis.clearTimeout(e)}}function nm(n,e=new Date){const t={year:e.getFullYear(),month:String(e.getMonth()+1).padStart(2,"0"),day:String(e.getDate()).padStart(2,"0"),hour:String(e.getHours()).padStart(2,"0"),minute:String(e.getMinutes()).padStart(2,"0"),second:String(e.getSeconds()).padStart(2,"0")},o=`${t.year}-${t.month}-${t.day}-${t.hour}${t.minute}${t.second}`;return`GenericAgent-${n==="zh"?"数据备份":"data-backup"}-${o}.zip`}function om(n){return Ho("/memory/import/inspect",{sourcePath:n})}function rm(n){return Ho("/memory/import",{sourcePath:n})}function sm(n,e){return Ho("/memory/export",{destinationPath:n,sourceMode:e})}const Is=ft((n,e)=>(Ve("services.snapshot",t=>{const o=t;o.services&&n({services:o.services,loading:!1,error:null})}),Ve("service.changed",t=>{const o=t;o.service&&n(r=>({services:r.services.map(s=>s.id===o.service.id?o.service:s)}))}),{services:[],loading:!0,error:null,mykeyContent:"",mykeyLoading:!1,async fetchServices(){e().services.length===0&&n({loading:!0}),n({error:null});try{const t=await Gd();n({services:t,loading:!1})}catch(t){n({loading:!1,error:t.message})}},async startService(t){try{const{ok:o,service:r}=await Qd(t);return r&&n(s=>({services:s.services.map(l=>l.id===r.id?r:l)})),o}catch{return!1}},async stopService(t){try{const{ok:o,service:r}=await Yd(t);return r&&n(s=>({services:s.services.map(l=>l.id===r.id?r:l)})),o}catch{return!1}},async exitBridge(){try{return await eu()}catch{return!1}},async restartService(t){return await e().stopService(t)?(await new Promise(r=>setTimeout(r,500)),e().startService(t)):!1},async fetchLogs(t,o=200){try{return await yi(t,o)}catch{return[]}},async fetchMykey(){n({mykeyLoading:!0});try{const t=await Xd();n({mykeyContent:t,mykeyLoading:!1})}catch{n({mykeyLoading:!1})}},async saveMykey(t){try{const o=await Jd(t);return o&&n({mykeyContent:t}),o}catch{return!1}}}));function _i(){return typeof window.__TAURI__<"u"}async function Lm(){var e,t;const n=(t=(e=window.__TAURI__)==null?void 0:e.core)==null?void 0:t.invoke;if(!n)throw new Error("Not in Tauri environment");await n("start_bridge")}const Co=_i();function en({label:n,tip:e,btnText:t,onClick:o,disabled:r,testId:s}){return i.jsxs("div",{className:"ga-data-row","data-testid":s,children:[i.jsx("div",{className:"ga-data-row-info",children:i.jsx(Ae,{content:e,children:i.jsx("span",{className:"ga-data-row-label",tabIndex:0,children:n})})}),i.jsx(de,{className:"ga-data-action",size:"small",type:"tertiary",onClick:o,disabled:r,children:t})]})}function im(n,e){if(!n)return"—";const t=new Date(n);return Number.isNaN(t.getTime())?"—":new Intl.DateTimeFormat(e==="zh"?"zh-CN":"en-US",{dateStyle:"medium",timeStyle:"short"}).format(t)}function am(){const{lang:n,t:e}=he(),[t,o]=a.useState(!1),[r,s]=a.useState(!1),[l,c]=a.useState(!1),[u,p]=a.useState(null),[d,m]=a.useState(null),[f,y]=a.useState(null),b=G(P=>{const N=new Set(P.runningSessions);return P.sessions.forEach(L=>{L.status==="running"&&N.add(L.id)}),P.status==="running"&&N.add(P.activeSessionId||"__active_session__"),N.size}),C=Is(P=>P.services).filter(P=>P.managed&&P.running),S=b>0||C.length>0;a.useEffect(()=>{if(!Co)return;let P=!0;return tm().then(N=>{P&&y(N)}),Is.getState().fetchServices(),()=>{P=!1}},[]);const k=a.useCallback(()=>e("data.maintenanceBlocked",{sessions:b,services:C.length}),[C.length,b,e]),_=a.useCallback((P,N)=>{if(P instanceof Pi&&P.code==="maintenance_conflict"){X.error({content:e("data.maintenanceBlockedServer",{sessions:P.runningSessions.length,services:P.runningExtras.length})});return}X.error({content:e(N)})},[e]),v=a.useCallback(()=>{const P=document.createElement("input");P.type="file",P.accept=".py,text/plain",P.onchange=async()=>{var N;try{const L=(N=P.files)==null?void 0:N[0];if(!L)return;const B=await L.text();await kd(B),await Z.getState().loadFromBridge(),X.success({content:e("data.importKeySuccess")})}catch(L){console.error("[DataSection] import key config failed:",L),X.error({content:e("data.importKeyError")})}},P.click()},[e]),j=a.useCallback(async()=>{try{const P=await Sd();if(Co)try{await Oe("export_mykey",{content:P})&&X.success({content:e("data.exportKeySuccess")})}catch{Ts(P,"mykey.py"),X.success({content:e("data.exportKeySuccess")})}else Ts(P,"mykey.py"),X.success({content:e("data.exportKeySuccess")})}catch(P){console.error("[DataSection] export key config failed:",P),X.error({content:e("data.exportKeyError")})}},[e]),w=a.useCallback((P,N)=>{const L=N.sourceType==="legacyFolder"?e("data.importLegacySource"):N.sourceMode==="localRepository"?e("connection.local"):e("connection.included"),{memory:B,responses:Q,sessions:z}=N.content;le.confirm({title:e("data.importConfirmTitle"),content:i.jsxs("div",{className:"ga-data-confirm-summary",children:[N.sourceType==="backupZip"&&i.jsxs("div",{children:[i.jsx("span",{children:e("data.importExportedAt")}),i.jsx("strong",{children:im(N.exportedAt,n)})]}),i.jsxs("div",{children:[i.jsx("span",{children:e("data.importSource")}),i.jsx("strong",{children:L})]}),i.jsxs("div",{children:[i.jsx("span",{children:e("data.importContents")}),i.jsx("strong",{children:e("data.importContentsValue",{memory:B,sessions:z,responses:Q})})]}),i.jsx("p",{children:e("data.importMergeNotice")})]}),okText:e("data.importConfirmBtn"),cancelText:e("common.cancel"),onOk:async()=>{o(!0);try{const M=await rm(P);X.success({content:e("data.importDataSuccess",{memory:M.memoryCopied||0,responses:M.responsesCopied||0,sessions:M.sessionsAdded||0})}),await G.getState().loadSessions(),m(M)}catch(M){console.error("[DataSection] import data failed:",M),_(M,"data.importDataError")}finally{o(!1)}}})},[n,_,e]),E=a.useCallback(async P=>{if(c(!1),S){X.warning({content:k()});return}try{const N=P==="backup"?await Oe("pick_data_backup_file",{title:e("data.importBackupPickerTitle")}):await Oe("pick_directory",{title:e("data.importFolderPickerTitle")});if(!N)return;o(!0);const L=await om(N);o(!1),w(N,L)}catch(N){o(!1),console.error("[DataSection] inspect import source failed:",N),X.error({content:e("data.importDataInvalid")})}},[w,S,k,e]),O=a.useCallback(()=>{if(S){X.warning({content:k()});return}le.confirm({title:e("data.exportDataConfirmTitle"),content:e("data.exportDataConfirmMessage"),okText:e("data.exportDataConfirmBtn"),cancelText:e("common.cancel"),onOk:async()=>{try{const P=await Oe("pick_data_export_path",{defaultName:nm(n),title:e("data.exportDataPickerTitle")});if(!P)return;s(!0);const N=await Oe("get_ga_source",{}),L=await sm(P,N?"localRepository":"included");window.setTimeout(()=>p(L.path),0)}catch(P){console.error("[DataSection] export data failed:",P),_(P,"data.exportDataError")}finally{s(!1)}}})},[n,S,k,_,e]),D=a.useCallback(async()=>{if(u)try{await Oe("reveal_in_file_manager",{path:u}),p(null)}catch(P){console.error("[DataSection] reveal export failed:",P),X.error({content:e("data.exportDataRevealError")})}},[u,e]);return i.jsxs("div",{className:"ga-set-block","data-testid":"data-maintenance-section",children:[i.jsx(yt,{tip:e("data.sectionTip"),tipLabel:e("data.sectionHelp"),children:e("data.title")}),i.jsx(en,{label:e("data.importKey"),tip:e("data.importKeyTip"),btnText:e("data.importKeyBtn"),onClick:v}),i.jsx(en,{label:e("data.exportKey"),tip:e("data.exportKeyTip"),btnText:e("data.exportKeyBtn"),onClick:j}),Co&&f!==!1&&i.jsxs(i.Fragment,{children:[i.jsx(en,{testId:"data-import-row",label:e("data.importData"),tip:e("data.importDataTip"),btnText:e(t?"data.importing":"data.importDataBtn"),onClick:()=>c(!0),disabled:t||r||S}),i.jsx(en,{testId:"data-export-row",label:e("data.exportData"),tip:e("data.exportDataTip"),btnText:e(r?"data.exporting":"data.exportDataBtn"),onClick:O,disabled:t||r||S}),S&&i.jsx("p",{className:"ga-data-maintenance-note",role:"status",children:k()}),i.jsx("p",{className:"ga-data-maintenance-note",children:e("data.externalProcessWarning")})]}),i.jsx(le,{visible:l,title:e("data.importSourceTitle"),width:520,onCancel:()=>c(!1),footer:i.jsxs("div",{className:"ga-data-source-actions",children:[i.jsx(de,{onClick:()=>c(!1),children:e("common.cancel")}),i.jsx(de,{disabled:S,onClick:()=>E("folder"),children:e("data.importFolderBtn")}),i.jsx(de,{disabled:S,type:"primary",onClick:()=>E("backup"),children:e("data.importBackupBtn")})]}),children:i.jsx("p",{className:"ga-data-source-description",children:e("data.importSourceDescription")})}),i.jsx(le,{visible:!!d,title:e("data.importResultTitle"),width:620,onCancel:()=>m(null),footer:i.jsx(de,{type:"primary",onClick:()=>m(null),children:e("common.done")}),children:d&&i.jsxs("div",{className:"ga-data-confirm-summary",children:[i.jsxs("div",{children:[i.jsx("span",{children:e("data.importResultMemory")}),i.jsx("strong",{children:e("data.importResultMemoryValue",{count:d.memoryCopied||0})})]}),i.jsxs("div",{children:[i.jsx("span",{children:e("data.importResultResponses")}),i.jsx("strong",{children:e("data.importResultAddSkipValue",{added:d.responsesCopied||0,skipped:d.responsesSkipped||0})})]}),i.jsxs("div",{children:[i.jsx("span",{children:e("data.importResultSessions")}),i.jsx("strong",{children:e("data.importResultAddSkipValue",{added:d.sessionsAdded||0,skipped:d.sessionsSkipped||0})})]}),i.jsxs("div",{children:[i.jsx("span",{children:e("data.importResultBackup")}),d.backupDir?i.jsx("code",{className:"ga-data-export-path ga-data-export-path--inline",children:d.backupDir}):i.jsx("strong",{children:e("data.importResultNoBackup")})]}),i.jsx("p",{children:d.backupDir?e("data.importRestoreHint"):e("data.importNoRestoreNeeded")})]})}),i.jsxs(le,{visible:!!u,title:e("data.exportDataSuccessTitle"),width:560,onCancel:()=>p(null),footer:i.jsxs("div",{className:"ga-data-source-actions",children:[i.jsx(de,{onClick:()=>p(null),children:e("common.done")}),i.jsx(de,{type:"primary",onClick:D,children:e("data.exportDataReveal")})]}),children:[i.jsx("p",{children:e("data.exportDataSuccessMessage")}),u&&i.jsx("code",{className:"ga-data-export-path",children:u})]})]})}function Ts(n,e){const t=new Blob([n],{type:"text/plain"}),o=URL.createObjectURL(t),r=document.createElement("a");r.href=o,r.download=e,r.click(),URL.revokeObjectURL(o)}const Rs=_i();function Ns(n,e){return n.includes("agentmain.py")?e("connection.errorInvalid"):n.includes("not compatible")||n.includes("compatibility probe")?e("connection.errorIncompatible"):n.includes("20s")||n.includes("ready")?e("connection.errorTimeout"):e("connection.errorGeneric")}function lm(){const{t:n}=he(),e=Z(M=>M.visible),t=G(M=>M.runningSessions),o=Wo(),r=Te(M=>M.setPage),s=Te(M=>M.setServicesTab),[l,c]=a.useState("included"),[u,p]=a.useState(""),[d,m]=a.useState("included"),[f,y]=a.useState(""),[b,x]=a.useState(!0),[C,S]=a.useState(!1),[k,_]=a.useState(!1),v=a.useCallback(async()=>{if(Rs){x(!0);try{const M=await Oe("get_ga_source",{}),Y=M?"localRepository":"included";c(Y),p(M||""),m(Y),y(M||"")}catch(M){console.error("[ConnectionMode] load current mode failed:",M)}finally{x(!1)}}},[]);a.useEffect(()=>{e&&v()},[v,e]);const j=a.useCallback(async()=>{S(!0);try{const M=await Oe("pick_directory",{title:n("connection.repositoryPickerTitle")});if(!M)return;let Y,fe=!1;try{Y=await Oe("validate_ga_source",{dir:M})}catch(Se){if(!fa(Se,"validate_ga_source"))throw Se;Y=M,fe=!0}y(Y),m("localRepository"),fe||X.success({content:n("connection.repositoryValidated")})}catch(M){console.error("[ConnectionMode] validate repository failed:",M);const Y=qo(M);Y.includes("Tauri IPC")||X.error({content:Ns(Y,n)})}finally{S(!1)}},[n]),w=a.useCallback(M=>{if(M==="included"){m("included");return}if(f){m("localRepository");return}j()},[j,f]),E=l!==d||d==="localRepository"&&f!==u,O=d==="localRepository"&&(l!=="localRepository"||f!==u),D=d==="localRepository"?f:u,P=t.size>0,N=b||C||k||!E||P,L=a.useCallback(async()=>{if(!N){_(!0);try{d==="localRepository"?await Oe("set_ga_source",{dir:f}):await Oe("clear_ga_source",{}),await Promise.allSettled([G.getState().loadSessions(),Z.getState().loadFromBridge()]);const M=d==="localRepository"?f:"";c(d),p(M),X.success({content:n(d==="localRepository"?"connection.localSuccess":"connection.includedSuccess")})}catch(M){console.error("[ConnectionMode] apply failed:",M),X.error({content:Ns(qo(M),n)})}finally{_(!1)}}},[N,d,f,n]),B=a.useCallback(()=>{s("status"),r("services"),Z.getState().close()},[r,s]),Q=a.useMemo(()=>o==="ready"?"connection.statusReady":o==="connecting"?"connection.statusConnecting":"connection.statusUnavailable",[o]),z=o==="ready"?"on":o==="connecting"?"switching":"unavailable";return Rs?i.jsxs("div",{className:"ga-set-block ga-connection-section","data-testid":"connection-mode-section",children:[i.jsx(yt,{tip:n("connection.sectionTip"),tipLabel:n("connection.sectionHelp"),children:n("connection.title")}),i.jsx("p",{className:"ga-connection-description",children:n("connection.description")}),i.jsxs(Ke,{"aria-label":n("connection.title"),name:"desktop-connection-mode",type:"pureCard",value:d,disabled:b||k,onChange:M=>w(M.target.value),className:"ga-connection-mode-grid",children:[i.jsx(Le,{value:"included",className:"ga-connection-mode-card",extra:n("connection.includedDescription"),children:i.jsx(Ae,{content:n("connection.includedTip"),position:"topLeft",children:i.jsxs("span",{className:"ga-connection-card-title",tabIndex:0,"aria-label":`${n("connection.included")}:${n("connection.includedTip")}`,children:[n("connection.included"),l==="included"&&i.jsx(ze,{size:"small",color:"green",children:n("connection.current")})]})})}),i.jsx(Le,{value:"localRepository",className:"ga-connection-mode-card",extra:n("connection.localDescription"),children:i.jsx(Ae,{content:n("connection.localTip"),position:"topLeft",children:i.jsxs("span",{className:"ga-connection-card-title",tabIndex:0,"aria-label":`${n("connection.local")}:${n("connection.localTip")}`,children:[n("connection.local"),l==="localRepository"&&i.jsx(ze,{size:"small",color:"green",children:n("connection.current")})]})})})]}),(d==="localRepository"||l==="localRepository")&&i.jsxs("div",{className:"ga-connection-repository-detail",children:[i.jsxs("div",{className:"ga-connection-repository-header",children:[i.jsx("span",{children:n(O?"connection.pendingRepository":"connection.currentRepository")}),i.jsx(de,{size:"small",type:"tertiary",loading:C,disabled:k,onClick:j,children:n(f?"connection.changeRepository":"connection.chooseRepository")})]}),D&&i.jsx("code",{className:"ga-connection-path",children:D})]}),i.jsxs("div",{className:"ga-connection-apply-row",children:[i.jsx("div",{className:"ga-connection-apply-note",role:"status",children:P?n("connection.runningTaskBlock"):E?n("connection.pendingNotice"):""}),i.jsx(de,{type:"primary",loading:k,disabled:N,onClick:L,children:n(k?"connection.applying":"connection.apply")})]}),i.jsxs("div",{className:"ga-connection-status-row",children:[i.jsxs("div",{className:"ga-connection-status-copy",children:[i.jsx("span",{className:`ga-source-dot ga-source-dot--${z}`}),i.jsx(Ae,{content:n("connection.statusTip"),position:"topLeft",children:i.jsx("span",{className:"ga-connection-status-label",tabIndex:0,"aria-label":`${n("connection.status")}:${n("connection.statusTip")}`,children:n("connection.status")})}),i.jsx("strong",{children:n(Q)})]}),i.jsx(de,{size:"small",type:"tertiary",onClick:B,children:n("connection.viewStatus")})]})]}):null}const cm="https://github.com/lsdefine/GenericAgent#-社区与支持",dm="https://datawhalechina.github.io/hello-generic-agent/",um=["RoundSquisheen","persist0612","pax1123581321"];async function pm(n,e=t=>navigator.clipboard.writeText(t)){await e(n)}function hm(){return i.jsx("svg",{"aria-hidden":"true",className:"ga-help-feedback-wechat-icon",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:i.jsx("path",{d:"M8.691 2.188C3.891 2.188 0 5.476 0 9.53c0 2.212 1.17 4.203 3.002 5.55a.59.59 0 0 1 .213.665l-.39 1.48c-.019.07-.048.141-.048.213 0 .163.13.295.29.295a.326.326 0 0 0 .167-.054l1.903-1.114a.864.864 0 0 1 .717-.098 10.16 10.16 0 0 0 2.837.403c.276 0 .543-.027.811-.05-.857-2.578.157-4.972 1.932-6.446 1.703-1.415 3.882-1.98 5.853-1.838-.576-3.583-4.196-6.348-8.596-6.348zM5.785 5.991c.642 0 1.162.529 1.162 1.18a1.17 1.17 0 0 1-1.162 1.178A1.17 1.17 0 0 1 4.623 7.17c0-.651.52-1.18 1.162-1.18zm5.813 0c.642 0 1.162.529 1.162 1.18a1.17 1.17 0 0 1-1.162 1.178 1.17 1.17 0 0 1-1.162-1.178c0-.651.52-1.18 1.162-1.18zm5.34 2.867c-1.797-.052-3.746.512-5.28 1.786-1.72 1.428-2.687 3.72-1.78 6.22.942 2.453 3.666 4.229 6.884 4.229.826 0 1.622-.12 2.361-.336a.722.722 0 0 1 .598.082l1.584.926a.272.272 0 0 0 .14.047c.134 0 .24-.111.24-.247 0-.06-.023-.12-.038-.177l-.327-1.233a.582.582 0 0 1-.023-.156.49.49 0 0 1 .201-.398C23.024 18.48 24 16.82 24 14.98c0-3.21-2.931-5.837-6.656-6.088V8.89c-.135-.01-.27-.027-.407-.03zm-2.53 3.274c.535 0 .969.44.969.982a.976.976 0 0 1-.969.983.976.976 0 0 1-.969-.983c0-.542.434-.982.97-.982zm4.844 0c.535 0 .969.44.969.982a.976.976 0 0 1-.969.983.976.976 0 0 1-.969-.983c0-.542.434-.982.969-.982z"})})}function $s({description:n,href:e,label:t}){return i.jsxs("div",{className:"ga-help-feedback-resource",children:[i.jsx("p",{children:n}),i.jsxs("a",{className:"ga-help-feedback-link",href:e,target:"_blank",rel:"noopener noreferrer",children:[i.jsx("span",{children:t}),i.jsx(qa,{size:"small","aria-hidden":"true"})]})]})}function mm(){const{t:n}=he(),e=a.useCallback(async t=>{try{await pm(t),X.success({content:n("helpFeedback.copySuccess")})}catch{X.error({content:n("helpFeedback.copyError")})}},[n]);return i.jsxs("section",{className:"ga-set-block ga-help-feedback-section","data-testid":"help-feedback-section",children:[i.jsx(yt,{children:n("helpFeedback.title")}),i.jsxs(ct,{className:"ga-help-feedback-collapse",defaultActiveKey:[],children:[i.jsx(ct.Panel,{itemKey:"community",header:n("helpFeedback.communityTitle"),children:i.jsx($s,{description:n("helpFeedback.communityDescription"),href:cm,label:n("helpFeedback.communityAction")})}),i.jsx(ct.Panel,{itemKey:"tutorial",header:n("helpFeedback.tutorialTitle"),children:i.jsx($s,{description:n("helpFeedback.tutorialDescription"),href:dm,label:n("helpFeedback.tutorialAction")})}),i.jsxs(ct.Panel,{itemKey:"maintainers",header:n("helpFeedback.maintainersTitle"),children:[i.jsx("p",{className:"ga-help-feedback-description",children:n("helpFeedback.maintainersDescription")}),i.jsx("div",{className:"ga-help-feedback-list",children:um.map(t=>i.jsxs("div",{className:"ga-help-feedback-row",children:[i.jsxs("div",{className:"ga-help-feedback-contact",children:[i.jsx(hm,{}),i.jsx("code",{className:"ga-help-feedback-id",children:t})]}),i.jsx(de,{size:"small",type:"tertiary",onClick:()=>e(t),children:n("helpFeedback.copy")})]},t))})]})]})]})}const fm=[{key:"deepseek",label:"DeepSeek",descKey:"pq.deepseekDesc",protocol:"oai",apibase:"https://api.deepseek.com/v1",defaultModel:"deepseek-v4-pro",defaultName:"DeepSeek",keyUrl:"https://platform.deepseek.com/api_keys",color:"#4D6BFE",iconPath:"M23.748 4.482c-.254-.124-.364.113-.512.234-.051.039-.094.09-.137.136-.372.397-.806.657-1.373.626-.829-.046-1.537.214-2.163.848-.133-.782-.575-1.248-1.247-1.548-.352-.156-.708-.311-.955-.65-.172-.241-.219-.51-.305-.774-.055-.16-.11-.323-.293-.35-.2-.031-.278.136-.356.276-.313.572-.434 1.202-.422 1.84.027 1.436.633 2.58 1.838 3.393.137.093.172.187.129.323-.082.28-.18.552-.266.833-.055.179-.137.217-.329.14a5.526 5.526 0 01-1.736-1.18c-.857-.828-1.631-1.742-2.597-2.458a11.365 11.365 0 00-.689-.471c-.985-.957.13-1.743.388-1.836.27-.098.093-.432-.779-.428-.872.004-1.67.295-2.687.684a3.055 3.055 0 01-.465.137 9.597 9.597 0 00-2.883-.102c-1.885.21-3.39 1.102-4.497 2.623C.082 8.606-.231 10.684.152 12.85c.403 2.284 1.569 4.175 3.36 5.653 1.858 1.533 3.997 2.284 6.438 2.14 1.482-.085 3.133-.284 4.994-1.86.47.234.962.327 1.78.397.63.059 1.236-.03 1.705-.128.735-.156.684-.837.419-.961-2.155-1.004-1.682-.595-2.113-.926 1.096-1.296 2.746-2.642 3.392-7.003.05-.347.007-.565 0-.845-.004-.17.035-.237.23-.256a4.173 4.173 0 001.545-.475c1.396-.763 1.96-2.015 2.093-3.517.02-.23-.004-.467-.247-.588zM11.581 18c-2.089-1.642-3.102-2.183-3.52-2.16-.392.024-.321.471-.235.763.09.288.207.486.371.739.114.167.192.416-.113.603-.673.416-1.842-.14-1.897-.167-1.361-.802-2.5-1.86-3.301-3.307-.774-1.393-1.224-2.887-1.298-4.482-.02-.386.093-.522.477-.592a4.696 4.696 0 011.529-.039c2.132.312 3.946 1.265 5.468 2.774.868.86 1.525 1.887 2.202 2.891.72 1.066 1.494 2.082 2.48 2.914.348.292.625.514.891.677-.802.09-2.14.11-3.054-.614zm1-6.44a.306.306 0 01.415-.287.302.302 0 01.2.288.306.306 0 01-.31.307.303.303 0 01-.304-.308zm3.11 1.596c-.2.081-.399.151-.59.16a1.245 1.245 0 01-.798-.254c-.274-.23-.47-.358-.552-.758a1.73 1.73 0 01.016-.588c.07-.327-.008-.537-.239-.727-.187-.156-.426-.199-.688-.199a.559.559 0 01-.254-.078c-.11-.054-.2-.19-.114-.358.028-.054.16-.186.192-.21.356-.202.767-.136 1.146.016.352.144.618.408 1.001.782.391.451.462.576.685.914.176.265.336.537.445.848.067.195-.019.354-.25.452z"},{key:"qwen",label:"通义千问",descKey:"pq.qwenDesc",protocol:"oai",apibase:"https://dashscope.aliyuncs.com/compatible-mode/v1",defaultModel:"qwen3.7-max",defaultName:"通义千问",keyUrl:"https://bailian.console.aliyun.com/?apiKey=1",color:"#615CED",iconPath:"M12.604 1.34c.393.69.784 1.382 1.174 2.075a.18.18 0 00.157.091h5.552c.174 0 .322.11.446.327l1.454 2.57c.19.337.24.478.024.837-.26.43-.513.864-.76 1.3l-.367.658c-.106.196-.223.28-.04.512l2.652 4.637c.172.301.111.494-.043.77-.437.785-.882 1.564-1.335 2.34-.159.272-.352.375-.68.37-.777-.016-1.552-.01-2.327.016a.099.099 0 00-.081.05 575.097 575.097 0 01-2.705 4.74c-.169.293-.38.363-.725.364-.997.003-2.002.004-3.017.002a.537.537 0 01-.465-.271l-1.335-2.323a.09.09 0 00-.083-.049H4.982c-.285.03-.553-.001-.805-.092l-1.603-2.77a.543.543 0 01-.002-.54l1.207-2.12a.198.198 0 000-.197 550.951 550.951 0 01-1.875-3.272l-.79-1.395c-.16-.31-.173-.496.095-.965.465-.813.927-1.625 1.387-2.436.132-.234.304-.334.584-.335a338.3 338.3 0 012.589-.001.124.124 0 00.107-.063l2.806-4.895a.488.488 0 01.422-.246c.524-.001 1.053 0 1.583-.006L11.704 1c.341-.003.724.032.9.34zm-3.432.403a.06.06 0 00-.052.03L6.254 6.788a.157.157 0 01-.135.078H3.253c-.056 0-.07.025-.041.074l5.81 10.156c.025.042.013.062-.034.063l-2.795.015a.218.218 0 00-.2.116l-1.32 2.31c-.044.078-.021.118.068.118l5.716.008c.046 0 .08.02.104.061l1.403 2.454c.046.081.092.082.139 0l5.006-8.76.783-1.382a.055.055 0 01.096 0l1.424 2.53a.122.122 0 00.107.062l2.763-.02a.04.04 0 00.035-.02.041.041 0 000-.04l-2.9-5.086a.108.108 0 010-.113l.293-.507 1.12-1.977c.024-.041.012-.062-.035-.062H9.2c-.059 0-.073-.026-.043-.077l1.434-2.505a.107.107 0 000-.114L9.225 1.774a.06.06 0 00-.053-.031zm6.29 8.02c.046 0 .058.02.034.06l-.832 1.465-2.613 4.585a.056.056 0 01-.05.029.058.058 0 01-.05-.029L8.498 9.841c-.02-.034-.01-.052.028-.054l.216-.012 6.722-.012z"},{key:"doubao",label:"火山方舟",descKey:"pq.doubaoDesc",protocol:"oai",apibase:"https://ark.cn-beijing.volces.com/api/v3",defaultModel:"doubao-seed-2.1-pro",defaultName:"火山方舟",keyUrl:"https://console.volcengine.com/ark/region:ark+cn-beijing/apiKey",color:"#006EFF",iconPath:["M10.278 7.741L6.685 21.736a.214.214 0 00.214.264h7.17a.216.216 0 00.214-.166.216.216 0 000-.098L10.687 7.742a.214.214 0 00-.409 0z","M4.553 16.18l-1.406 5.558a.214.214 0 00.203.261h2.42-4.551a.214.214 0 01-.214-.26l2.275-8.961a.214.214 0 01.409 0l.864 3.402z","M16.694 22h3.207a.215.215 0 00.214-.262l-1.839-6.993 1.164-4.592a.214.214 0 01.411 0l2.951 11.586a.214.214 0 01-.214.261h-5.894z"]},{key:"minimax",label:"MiniMax",descKey:"pq.minimaxDesc",protocol:"oai",apibase:"https://api.minimax.chat/v1",defaultModel:"MiniMax-M3",defaultName:"MiniMax",keyUrl:"https://platform.minimaxi.com/user-center/basic-information/interface-key",color:"#F23F5D",iconPath:"M16.278 2c1.156 0 2.093.927 2.093 2.07v12.501a.74.74 0 00.744.709.74.74 0 00.743-.709V9.099a2.06 2.06 0 012.071-2.049A2.06 2.06 0 0124 9.1v6.561a.649.649 0 01-.652.645.649.649 0 01-.653-.645V9.1a.762.762 0 00-.766-.758.762.762 0 00-.766.758v7.472a2.037 2.037 0 01-2.048 2.026 2.037 2.037 0 01-2.048-2.026v-12.5a.785.785 0 00-.788-.753.785.785 0 00-.789.752l-.001 15.904A2.037 2.037 0 0113.441 22a2.037 2.037 0 01-2.048-2.026V18.04c0-.356.292-.645.652-.645.36 0 .652.289.652.645v1.934c0 .263.142.506.372.638.23.131.514.131.744 0a.734.734 0 00.372-.638V4.07c0-1.143.937-2.07 2.093-2.07zm-5.674 0c1.156 0 2.093.927 2.093 2.07v11.523a.648.648 0 01-.652.645.648.648 0 01-.652-.645V4.07a.785.785 0 00-.789-.78.785.785 0 00-.789.78v14.013a2.06 2.06 0 01-2.07 2.048 2.06 2.06 0 01-2.071-2.048V9.1a.762.762 0 00-.766-.758.762.762 0 00-.766.758v3.8a2.06 2.06 0 01-2.071 2.049A2.06 2.06 0 010 12.9v-1.378c0-.357.292-.646.652-.646.36 0 .653.29.653.646V12.9c0 .418.343.757.766.757s.766-.339.766-.757V9.099a2.06 2.06 0 012.07-2.048 2.06 2.06 0 012.071 2.048v8.984c0 .419.343.758.767.758.423 0 .766-.339.766-.758V4.07c0-1.143.937-2.07 2.093-2.07z"},{key:"zhipu",label:"智谱 GLM",descKey:"pq.zhipuDesc",protocol:"oai",apibase:"https://open.bigmodel.cn/api/paas/v4",defaultModel:"glm-5.2",defaultName:"智谱 GLM",keyUrl:"https://open.bigmodel.cn/usercenter/apikeys",color:"#3859FF",iconPath:"M11.991 23.503a.24.24 0 00-.244.248.24.24 0 00.244.249.24.24 0 00.245-.249.24.24 0 00-.22-.247l-.025-.001zM9.671 5.365a1.697 1.697 0 011.099 2.132l-.071.172-.016.04-.018.054c-.07.16-.104.32-.104.498-.035.71.47 1.279 1.186 1.314h.366c1.309.053 2.338 1.173 2.286 2.523-.052 1.332-1.152 2.38-2.478 2.327h-.174c-.715.018-1.274.64-1.239 1.368 0 .124.018.23.053.337.209.373.54.658.96.8.75.23 1.517-.125 1.9-.782l.018-.035c.402-.64 1.17-.96 1.92-.711.854.284 1.378 1.226 1.099 2.167a1.661 1.661 0 01-2.077 1.102 1.711 1.711 0 01-.907-.711l-.017-.035c-.2-.323-.463-.58-.851-.711l-.056-.018a1.646 1.646 0 00-1.954.746 1.66 1.66 0 01-1.065.764 1.677 1.677 0 01-1.989-1.279c-.209-.906.332-1.83 1.257-2.043a1.51 1.51 0 01.296-.035h.018c.68-.071 1.151-.622 1.116-1.333a1.307 1.307 0 00-.227-.693 2.515 2.515 0 01-.366-1.403 2.39 2.39 0 01.366-1.208c.14-.195.21-.444.227-.693.018-.71-.506-1.261-1.186-1.332l-.07-.018a1.43 1.43 0 01-.299-.07l-.05-.019a1.7 1.7 0 01-1.047-2.114 1.68 1.68 0 012.094-1.101zm-5.575 10.11c.26-.264.639-.367.994-.27.355.096.633.379.728.74.095.362-.007.748-.267 1.013-.402.41-1.053.41-1.455 0a1.062 1.062 0 010-1.482zm14.845-.294c.359-.09.738.024.992.297.254.274.344.665.237 1.025-.107.36-.396.634-.756.718-.551.128-1.1-.22-1.23-.781a1.05 1.05 0 01.757-1.26zm-.064-4.39c.314.32.49.753.49 1.206 0 .452-.176.886-.49 1.206-.315.32-.74.5-1.185.5-.444 0-.87-.18-1.184-.5a1.727 1.727 0 010-2.412 1.654 1.654 0 012.369 0zm-11.243.163c.364.484.447 1.128.218 1.691a1.665 1.665 0 01-2.188.923c-.855-.36-1.26-1.358-.907-2.228a1.68 1.68 0 011.33-1.038c.593-.08 1.183.169 1.547.652zm11.545-4.221c.368 0 .708.2.892.524.184.324.184.724 0 1.048a1.026 1.026 0 01-.892.524c-.568 0-1.03-.47-1.03-1.048 0-.579.462-1.048 1.03-1.048zm-14.358 0c.368 0 .707.2.891.524.184.324.184.724 0 1.048a1.026 1.026 0 01-.891.524c-.569 0-1.03-.47-1.03-1.048 0-.579.461-1.048 1.03-1.048zm10.031-1.475c.925 0 1.675.764 1.675 1.706s-.75 1.705-1.675 1.705-1.674-.763-1.674-1.705c0-.942.75-1.706 1.674-1.706zm-2.626-.684c.362-.082.653-.356.761-.718a1.062 1.062 0 00-.238-1.028 1.017 1.017 0 00-.996-.294c-.547.14-.881.7-.752 1.257.13.558.675.907 1.225.783zm0 16.876c.359-.087.644-.36.75-.72a1.062 1.062 0 00-.237-1.019 1.018 1.018 0 00-.985-.301 1.037 1.037 0 00-.762.717c-.108.361-.017.754.239 1.028.245.263.606.377.953.305l.043-.01zM17.19 3.5a.631.631 0 00.628-.64c0-.355-.279-.64-.628-.64a.631.631 0 00-.628.64c0 .355.28.64.628.64zm-10.38 0a.631.631 0 00.628-.64c0-.355-.28-.64-.628-.64a.631.631 0 00-.628.64c0 .355.279.64.628.64zm-5.182 7.852a.631.631 0 00-.628.64c0 .354.28.639.628.639a.63.63 0 00.627-.606l.001-.034a.62.62 0 00-.628-.64zm5.182 9.13a.631.631 0 00-.628.64c0 .355.279.64.628.64a.631.631 0 00.628-.64c0-.355-.28-.64-.628-.64zm10.38.018a.631.631 0 00-.628.64c0 .355.28.64.628.64a.631.631 0 00.628-.64c0-.355-.279-.64-.628-.64zm5.182-9.148a.631.631 0 00-.628.64c0 .354.279.639.628.639a.631.631 0 00.628-.64c0-.355-.28-.64-.628-.64zm-.384-4.992a.24.24 0 00.244-.249.24.24 0 00-.244-.249.24.24 0 00-.244.249c0 .142.122.249.244.249zM11.991.497a.24.24 0 00.245-.248A.24.24 0 0011.99 0a.24.24 0 00-.244.249c0 .133.108.236.223.247l.021.001zM2.011 6.36a.24.24 0 00.245-.249.24.24 0 00-.244-.249.24.24 0 00-.244.249.24.24 0 00.244.249zm0 11.263a.24.24 0 00-.243.248.24.24 0 00.244.249.24.24 0 00.244-.249.252.252 0 00-.244-.248zm19.995-.018a.24.24 0 00-.245.248.24.24 0 00.245.25.24.24 0 00.244-.25.252.252 0 00-.244-.248z"},{key:"kimi",label:"Kimi",descKey:"pq.kimiDesc",protocol:"oai",apibase:"https://api.moonshot.cn/v1",defaultModel:"kimi-k2.7-code",defaultName:"Kimi",keyUrl:"https://platform.moonshot.cn/console/api-keys",color:"#000000",iconPath:["M21.846 0a1.923 1.923 0 110 3.846H20.15a.226.226 0 01-.227-.226V1.923C19.923.861 20.784 0 21.846 0z","M11.065 11.199l7.257-7.2c.137-.136.06-.41-.116-.41H14.3a.164.164 0 00-.117.051l-7.82 7.756c-.122.12-.302.013-.302-.179V3.82c0-.127-.083-.23-.185-.23H3.186c-.103 0-.186.103-.186.23V19.77c0 .128.083.23.186.23h2.69c.103 0 .186-.102.186-.23v-3.25c0-.069.025-.135.069-.178l2.424-2.406a.158.158 0 01.205-.023l6.484 4.772a7.677 7.677 0 003.453 1.283c.108.012.2-.095.2-.23v-3.06c0-.117-.07-.212-.164-.227a5.028 5.028 0 01-2.027-.807l-5.613-4.064c-.117-.078-.132-.279-.028-.381z"]},{key:"stepfun",label:"阶跃星辰",descKey:"pq.stepfunDesc",protocol:"oai",apibase:"https://api.stepfun.com/v1",defaultModel:"step-3.7-flash",defaultName:"阶跃星辰",keyUrl:"https://platform.stepfun.com/interface-key",color:"#005AFF",iconPath:"M22.012 0h1.032v.927H24v.968h-.956V3.78h-1.032V1.896h-1.878v-.97h1.878V0zM2.6 12.371V1.87h.969v10.502h-.97zm10.423.66h10.95v.918h-6.208v9.579h-4.742V13.03zM5.629 3.333v12.356H0v4.51h10.386V8L20.859 8l-.003-4.668-15.227.001z"}];function gm({preset:n,onClick:e}){const{t}=he();return i.jsxs("button",{type:"button",className:"ga-provider-card",onClick:e,style:{"--provider-color":n.color},children:[i.jsx("svg",{className:"ga-provider-card-icon",width:"20",height:"20",viewBox:"0 0 24 24",fill:n.color,fillRule:"evenodd",xmlns:"http://www.w3.org/2000/svg",children:Array.isArray(n.iconPath)?n.iconPath.map((o,r)=>i.jsx("path",{d:o},r)):i.jsx("path",{d:n.iconPath})}),i.jsxs("span",{className:"ga-provider-card-body",children:[i.jsx("span",{className:"ga-provider-card-label",children:n.label}),i.jsx("span",{className:"ga-provider-card-desc",children:t(n.descKey)})]}),i.jsx("span",{className:"ga-provider-card-caret",children:"›"})]})}const tn={model:"",apikey:"",apibase:"",name:"",protocol:"oai",stream:!0,max_retries:5,connect_timeout:15,read_timeout:300};function ym({editingId:n,onDone:e}){const t=Z(w=>w.setModelProfiles),{t:o}=he(),[r,s]=a.useState("choose"),[l,c]=a.useState(null),[u,p]=a.useState(null),[d,m]=a.useState(tn),[f,y]=a.useState(!1),[b,x]=a.useState(!1),C=n!=null;a.useEffect(()=>{C?(s("form"),c("custom"),p(null),x(!0),yd(n).then(w=>{w&&m({model:w.model||"",apikey:w.apikey||"",apibase:w.apibase||"",name:w.name||"",protocol:w.protocol||"oai",stream:w.stream!==!1,max_retries:w.max_retries??5,connect_timeout:w.connect_timeout??15,read_timeout:w.read_timeout??300}),x(!1)})):(m(tn),s("choose"),c(null),p(null),y(!1),x(!1))},[n,C]);const S=a.useCallback(w=>{p(w),c("provider"),m({...tn,model:w.defaultModel,apibase:w.apibase,name:w.defaultName,protocol:w.protocol}),s("form")},[]),k=a.useCallback(()=>{c("custom"),p(null),m(tn),s("form")},[]),_=a.useCallback(()=>{s("choose"),c(null),p(null)},[]),v=async()=>{if(!d.model.trim()||!d.apibase.trim()){X.warning({content:o("model.model")+" / "+o("model.apibase")+" required"});return}if(!d.apikey.trim()){X.warning({content:o("model.apikey")+" required"});return}try{const w={model:d.model.trim(),apibase:d.apibase.trim(),name:d.name.trim()||void 0,protocol:d.protocol,stream:d.stream,max_retries:d.max_retries,connect_timeout:d.connect_timeout,read_timeout:d.read_timeout};d.apikey.trim()&&(w.apikey=d.apikey.trim());let E;C?E=await vd(n,w):E=await bd(w),t(E),X.success({content:o(C?"model.save":"set.addModel")}),e()}catch{X.error({content:"Error"})}},j=l==="provider"&&u!=null;return b?i.jsx("div",{style:{padding:24,textAlign:"center",color:"var(--semi-color-text-2)"},children:"Loading…"}):r==="choose"?i.jsxs("div",{children:[i.jsxs("button",{type:"button",className:"ga-form-back",onClick:e,children:["← ",o("common.cancel")]}),i.jsxs("div",{className:"ga-route-picker",children:[i.jsx("button",{type:"button",className:"ga-route-btn ga-route-btn--active",onClick:()=>{},children:o("model.routeProvider")}),i.jsx("button",{type:"button",className:"ga-route-btn",onClick:k,children:o("model.routeCustom")})]}),i.jsx("div",{className:"ga-provider-list",children:fm.map(w=>i.jsx(gm,{preset:w,onClick:()=>S(w)},w.key))})]}):i.jsxs("div",{className:"ga-form",children:[!C&&i.jsxs("button",{type:"button",className:"ga-form-back",onClick:_,children:["← ",o("model.selectProvider")]}),C&&i.jsxs("button",{type:"button",className:"ga-form-back",onClick:e,children:["← ",o("common.cancel")]}),i.jsxs("div",{className:"ga-form-field",children:[i.jsx("label",{className:"ga-form-label",children:o("model.name")}),i.jsx(dt,{value:d.name,onChange:w=>m(E=>({...E,name:w})),placeholder:o("model.namePh"),maxLength:50})]}),i.jsxs("div",{className:"ga-form-field",children:[i.jsxs("label",{className:"ga-form-label",children:[o("model.model")," ",i.jsx("span",{className:"ga-form-req",children:"*"})]}),i.jsx(dt,{value:d.model,onChange:w=>m(E=>({...E,model:w})),placeholder:o("model.modelPh"),maxLength:50})]}),i.jsxs("div",{className:"ga-form-field",children:[i.jsxs("label",{className:"ga-form-label",children:[o("model.protocol")," ",i.jsx("span",{className:"ga-form-req",children:"*"})]}),i.jsxs(Ke,{value:d.protocol,onChange:w=>m(E=>({...E,protocol:w.target.value})),disabled:j,children:[i.jsx(Le,{value:"oai",children:o("model.protocolOai")}),i.jsx(Le,{value:"claude",children:o("model.protocolClaude")})]}),j&&i.jsx("span",{className:"ga-form-locked-hint",children:o("model.providerLocked")})]}),i.jsxs("div",{className:"ga-form-field",children:[i.jsxs("label",{className:"ga-form-label",children:[o("model.apibase")," ",i.jsx("span",{className:"ga-form-req",children:"*"})]}),i.jsx(dt,{value:d.apibase,onChange:w=>m(E=>({...E,apibase:w})),placeholder:o("model.apibasePh"),maxLength:200,disabled:j}),j&&i.jsx("span",{className:"ga-form-locked-hint",children:o("model.providerLocked")})]}),i.jsxs("div",{className:"ga-form-field",children:[i.jsxs("label",{className:"ga-form-label",children:[o("model.apikey")," ",!C&&i.jsx("span",{className:"ga-form-req",children:"*"}),j&&u&&i.jsx("a",{className:"ga-form-key-link",href:u.keyUrl,target:"_blank",rel:"noopener noreferrer",children:o("model.getKey")})]}),i.jsx(dt,{mode:"password",value:d.apikey,onChange:w=>m(E=>({...E,apikey:w})),placeholder:o("model.apikeyPh"),maxLength:200})]}),i.jsxs("div",{className:"ga-form-field",children:[i.jsx("label",{className:"ga-form-label",children:o("model.stream")}),i.jsxs(Ke,{value:d.stream,onChange:w=>m(E=>({...E,stream:w.target.value})),children:[i.jsx(Le,{value:!0,children:o("model.streamOn")}),i.jsx(Le,{value:!1,children:o("model.streamOff")})]})]}),i.jsxs("button",{type:"button",className:"ga-form-advanced-toggle","data-expanded":f||void 0,onClick:()=>y(w=>!w),children:[i.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"currentColor",children:i.jsx("path",{d:"M3 1.5L7 5L3 8.5",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round",fill:"none"})}),o("model.advanced")]}),f&&i.jsx("div",{className:"ga-form-advanced-body",children:i.jsxs("div",{className:"ga-form-row",children:[i.jsxs("div",{className:"ga-form-field",children:[i.jsx("label",{className:"ga-form-label",children:o("model.retries")}),i.jsx(Wn,{value:d.max_retries,onChange:w=>m(E=>({...E,max_retries:w})),min:1,max:20,style:{width:"100%"}})]}),i.jsxs("div",{className:"ga-form-field",children:[i.jsx("label",{className:"ga-form-label",children:o("model.connTimeout")}),i.jsx(Wn,{value:d.connect_timeout,onChange:w=>m(E=>({...E,connect_timeout:w})),min:1,max:300,suffix:"s",style:{width:"100%"}})]}),i.jsxs("div",{className:"ga-form-field",children:[i.jsx("label",{className:"ga-form-label",children:o("model.readTimeout")}),i.jsx(Wn,{value:d.read_timeout,onChange:w=>m(E=>({...E,read_timeout:w})),min:5,max:3600,suffix:"s",style:{width:"100%"}})]})]})}),i.jsx("div",{style:{marginTop:8,display:"flex",justifyContent:"flex-end"},children:i.jsx(de,{type:"primary",onClick:v,children:o("model.save")})})]})}function bm(){const{visible:n,open:e,close:t,loadFromBridge:o}=Z(),{t:r}=he(),[s,l]=a.useState("main"),[c,u]=a.useState(null);a.useEffect(()=>{const y=()=>{o(),e()},b=()=>t();return window.addEventListener("ga:open-settings",y),window.addEventListener("ga:close-settings",b),()=>{window.removeEventListener("ga:open-settings",y),window.removeEventListener("ga:close-settings",b)}},[e,t,o]),a.useEffect(()=>{n||(l("main"),u(null))},[n]);const p=a.useCallback(()=>{u(null),l("addModel")},[]),d=a.useCallback(y=>{u(y),l("addModel")},[]),m=a.useCallback(()=>{l("main"),u(null)},[]),f=s==="main"?r("modal.settings"):c!=null?r("modal.editModel"):r("modal.addModel");return i.jsx(le,{visible:n,onCancel:t,title:f,footer:null,width:870,centered:!0,closeOnEsc:!0,className:"ga-settings-dialog",children:s==="main"?i.jsxs(i.Fragment,{children:[i.jsx(Yh,{}),i.jsx(Xh,{}),i.jsx(Jh,{onAdd:p,onEdit:d}),i.jsx(am,{}),i.jsx(lm,{}),i.jsx(mm,{})]}):i.jsx(ym,{editingId:c,onDone:m})})}const vm={zh:ba,en:ya};function xm(){const n=Z(t=>t.lang),e=Z(t=>t.loadFromBridge);return a.useEffect(()=>{e()},[e]),i.jsxs(ga,{locale:vm[n],children:[i.jsx(qh,{}),i.jsx(bm,{}),i.jsx(Qh,{})]})}document.documentElement.dataset.appearance==="dark"&&document.body.setAttribute("theme-mode","dark");document.addEventListener("click",n=>{var t;const e=(t=window.__TAURI__)==null?void 0:t.opener;Fa(n,typeof(e==null?void 0:e.openUrl)=="function"?o=>e.openUrl(o):void 0)});setTimeout(()=>{document.body.classList.remove("no-transition")},0);class wm extends g.Component{constructor(){super(...arguments);bt(this,"state",{error:null})}static getDerivedStateFromError(t){return{error:t}}componentDidCatch(t,o){console.error("[RootErrorBoundary] React crashed:",t,o.componentStack)}render(){if(this.state.error){const t=(navigator.language||"").toLowerCase().startsWith("zh"),o=this.state.error;return i.jsxs("main",{className:"ga-root-error",role:"alert",children:[i.jsx(li,{className:"ga-root-error-result",image:i.jsx(ld,{}),darkModeImage:i.jsx(nd,{}),title:t?"界面遇到问题":"Something went wrong",description:t?"GenericAgent 的界面未能继续运行。你的会话和记忆不会受到影响。":"The GenericAgent interface could not continue. Your sessions and memory are safe.",children:i.jsx(de,{type:"primary",theme:"solid",icon:i.jsx(pl,{}),onClick:()=>window.location.reload(),children:t?"重新加载":"Reload"})}),i.jsx(ct,{className:"ga-root-error-details",accordion:!0,children:i.jsxs(ct.Panel,{itemKey:"technical-details",header:t?"技术详情":"Technical details",children:[i.jsx(Ro.Paragraph,{type:"tertiary",children:t?"复制以下信息可帮助排查问题。":"Copy the information below to help troubleshoot the issue."}),i.jsx("pre",{tabIndex:0,children:[o.message,o.stack].filter(Boolean).join(`
|
||
|
||
`)})]})})]})}return this.props.children}}async function Cm(){const n=document.getElementById("app");va.createRoot(n).render(i.jsx(wm,{children:i.jsx(xm,{})}))}Cm();export{Wn as A,ne as B,ka as C,Ne as D,li as E,dt as F,ue as G,bi as H,Ha as I,mu as J,Z as K,Vd as L,le as M,Nh as N,fh as O,Pe as P,X as Q,et as R,za as S,ze as T,Om as U,Pm as V,Aa as W,No as X,Mo as _,_m as a,he as b,ri as c,Is as d,Wo as e,_i as f,pl as g,Te as h,Lm as i,_o as j,Yl as k,ft as l,Ve as m,G as n,Nl as o,Fl as p,Al as q,Dl as r,qt as s,xl as t,Ps as u,zl as v,Vl as w,Il as x,Kl as y,un as z};
|