@tencent-ai/codebuddy-code 2.84.0-next.e4f59e9.20260412 → 2.85.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/dist/codebuddy-headless.js +6 -6
- package/dist/codebuddy.js +152 -152
- package/dist/web-ui/assets/{index-NP-zJy5f.js → index-Bv5fqRIO.js} +118 -118
- package/dist/web-ui/index.html +1 -1
- package/package.json +2 -3
- package/product.cloudhosted.json +2 -2
- package/product.internal.json +2 -2
- package/product.ioa.json +2 -2
- package/product.json +2 -2
- package/product.selfhosted.json +2 -2
|
@@ -6,577 +6,577 @@ var Hh=Object.defineProperty;var Gh=(e,t,r)=>t in e?Hh(e,t,{enumerable:!0,config
|
|
|
6
6
|
|
|
7
7
|
`);s=o.pop()||"";for(const c of o){const p=c.split(`
|
|
8
8
|
`);let g="";for(const b of p)b.startsWith("data: ")&&(g+=b.substring(6));if(g)try{const b=JSON.parse(g);this.handleMessage(b)}catch{}}}}finally{r.releaseLock()}}handleMessage(t){if("method"in t&&"id"in t&&t.id!==void 0&&t.id!==null){if(t.method==="session/request_permission"){this.handlePermissionRequest(t.id,t.params);return}if(t.method==="_codebuddy.ai/question"){this.handleExtMethodQuestion(t.id,t.params);return}if(t.method==="_codebuddy.ai/delegateTool"){this.handleExtMethodDelegateTool(t.id,t.params);return}return}if("id"in t&&t.id!==void 0&&t.id!==null&&!("method"in t)){const r=this.pendingRequests.get(t.id);r&&(this.pendingRequests.delete(t.id),"error"in t&&t.error?r.reject(new Error(t.error.message)):r.resolve(t.result))}if("method"in t&&t.method==="session/update"){const r=t.params;if(r!=null&&r.update){const i=r.update,l=((i==null?void 0:i._meta)||{})["codebuddy.ai/interruptionRequest"];l&&this.emit("interruption_request",{sessionUpdate:"interruption_request",sessionId:r.sessionId,interruptionId:l.interruptionId||`ir-${l.toolCallId}`,reason:"Tool requires approval",options:l.options||[],toolName:l.toolName,toolTitle:l.toolTitle,toolInput:l.toolInput,toolCallId:l.toolCallId});const d=r.update.sessionUpdate;this.emit(d,r.update)}}else if("method"in t&&t.method!=="session/update"&&!("id"in t&&t.id!==void 0&&t.id!==null)&&t.method==="_codebuddy.ai/checkpoint"){const i=t.params;(i==null?void 0:i.event)==="created"?this.emit("checkpointCreated",i.checkpoint):(i==null?void 0:i.event)==="updated"?this.emit("checkpointUpdated",i.checkpoint):(i==null?void 0:i.event)==="reverted"&&this.emit("checkpointReverted",i.checkpoint)}}mapPermissionDecisionToOptionId(t){return t==="allowAll"?"allow_always":t==="allow"?"allow":t==="rejectAndExitPlan"?"reject_and_exit_plan":"reject"}async sendJsonRpcResult(t,r){var l;const i={jsonrpc:"2.0",id:t,result:r},s=await fetch(`${this.baseUrl}/api/v1/acp`,{method:"POST",headers:this.buildAcpHeaders(),body:JSON.stringify(i)});if(!s.ok){let d="";try{const a=await s.json();(l=a==null?void 0:a.error)!=null&&l.message&&(d=a.error.message)}catch{}throw new Error(d||`ACP response failed: ${s.status} ${s.statusText}`)}}buildAcpHeaders(){const t={"Content-Type":"application/json",Accept:"application/json, text/event-stream"};return this.connectionId&&(t["acp-connection-id"]=this.connectionId),this.sessionToken&&(t["acp-session-token"]=this.sessionToken),this.token&&(t.Authorization=`Bearer ${this.token}`),t}handlePermissionRequest(t,r){var c;const i=r==null?void 0:r.toolCall,s=`perm-${t}`,l=((c=i==null?void 0:i._meta)==null?void 0:c["codebuddy.ai/toolName"])||(i==null?void 0:i.toolName)||"tool",d=(i==null?void 0:i.title)||l,a=i==null?void 0:i.rawInput,o=i==null?void 0:i.toolCallId;this.permissionRequestIds.set(s,t),o&&this.permissionRequestToolCallIds.set(o,s),this.emit("interruption_request",{sessionUpdate:"interruption_request",interruptionId:s,reason:"Tool requires approval",options:((r==null?void 0:r.options)||[]).map(p=>p.optionId||p.name),toolName:l,toolTitle:d,toolInput:a,toolCallId:o})}handleExtMethodQuestion(t,r){const{sessionId:i,toolCallId:s,schema:l}=r||{},d=((l==null?void 0:l.questions)||[]).map(a=>({id:a.id,question:a.question,header:a.header||"",options:(a.options||[]).map(o=>({label:o.label||"",description:o.description||""})),multiSelect:!!a.multiSelect}));this.extMethodRequestIds.set(s,t),this.emit("question_request",{toolCallId:s,sessionId:i,questions:d})}async handleExtMethodDelegateTool(t,r){const{toolId:i,input:s}=r||{};try{if(i==="ui-control"){const{uiController:l}=await tn(async()=>{const{uiController:a}=await import("./index-DixJ0kqk.js");return{uiController:a}},[]),d=await l.execute({sessionId:r.sessionId,action:s.action,target:s.target,value:s.value});await this.sendJsonRpcResult(t,{status:"success",output:d})}else if(i==="ui-query"){const{uiController:l}=await tn(async()=>{const{uiController:a}=await import("./index-DixJ0kqk.js");return{uiController:a}},[]),d=await l.queryElements({selector:s==null?void 0:s.selector,role:s==null?void 0:s.role,includeHidden:s==null?void 0:s.includeHidden,limit:s==null?void 0:s.limit});await this.sendJsonRpcResult(t,{status:"success",output:d})}else await this.sendJsonRpcResult(t,{status:"error",error:{message:`Unknown delegate tool: ${i}`}})}catch(l){await this.sendJsonRpcResult(t,{status:"error",error:{message:l instanceof Error?l.message:String(l)}})}}emit(t,r){const i=this.listeners.get(t);if(i)for(const s of i)try{s(r)}catch(l){console.error(`Event handler error for ${t}:`,l)}}setStatus(t){this._status=t,this.emit("status_change",t)}}const nm=Object.freeze(Object.defineProperty({__proto__:null,AcpClient:Li,fetchWithRetry:ge},Symbol.toStringTag,{value:"Module"})),$u="codebuddy.auth.token";function rr(){try{return sessionStorage.getItem($u)}catch{return null}}function ju(e){try{sessionStorage.setItem($u,e)}catch{}}function ce(e){const t={...e},r=rr();return r&&(t.Authorization=`Bearer ${r}`),t}const Mu=Ce(e=>({viewState:"loading",error:null,isSubmitting:!1,checkAuth:async()=>{try{e({viewState:"loading",error:null});const t=await ge("/api/v1/auth/status",{headers:ce()});if(!t.ok){e({viewState:"authenticated"});return}const r=await t.json();!r.authEnabled||r.authenticated?e({viewState:"authenticated"}):e({viewState:"login"})}catch(t){console.warn("[auth] Failed to check auth status, falling back to authenticated:",t),e({viewState:"authenticated"})}},login:async t=>{try{e({isSubmitting:!0,error:null});const i=await(await fetch("/api/v1/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({password:t})})).json();if(i.success){const s=i.token||t;return ju(s),e({viewState:"authenticated",isSubmitting:!1,error:null}),!0}return e({error:i.error||"login.error.incorrect",isSubmitting:!1}),!1}catch(r){return console.warn("[auth] Login request failed:",r),e({error:"app.connectFailed",isSubmitting:!1}),!1}},clearError:()=>e({error:null})})),xr=Ce((e,t)=>({fileChanges:[],selectedFile:null,selectedDiff:null,diffLoading:!1,isCollapsed:!0,checkpoints:[],showCheckpoints:!1,reverting:!1,onCheckpoint:r=>{const{fileChanges:i}=t(),s=new Map;for(const l of i)s.set(l.uri,l);for(const l of r.fileChanges.files)s.set(l.uri,l);e({fileChanges:Array.from(s.values())})},selectFile:async r=>{const{selectedFile:i}=t();if(i===r){e({selectedFile:null,selectedDiff:null});return}e({selectedFile:r,selectedDiff:null,diffLoading:!0});try{const s=await ge(`/api/v1/file-changes/diff?path=${encodeURIComponent(r)}`,{headers:ce()});s.ok?e({selectedDiff:await s.json(),diffLoading:!1}):e({diffLoading:!1})}catch{e({diffLoading:!1})}},setCollapsed:r=>e({isCollapsed:r}),setShowCheckpoints:r=>e({showCheckpoints:r}),loadCheckpoints:async()=>{try{const r=await ge("/api/v1/file-changes/checkpoints",{headers:ce()});if(r.ok){const s=((await r.json()).checkpoints||[]).sort((l,d)=>d.createdAt-l.createdAt);e({checkpoints:s})}}catch{}},revertFiles:async r=>{e({reverting:!0});try{const i=await ge("/api/v1/file-changes/revert",{method:"POST",headers:{...ce(),"Content-Type":"application/json"},body:JSON.stringify({paths:r})});if(i.ok){const s=await i.json(),l=new Set(s.revertedFiles||[]);e(d=>({fileChanges:d.fileChanges.filter(a=>!l.has(a.uri)),selectedFile:l.has(d.selectedFile||"")?null:d.selectedFile,selectedDiff:l.has(d.selectedFile||"")?null:d.selectedDiff}))}}finally{e({reverting:!1})}},revertAll:async()=>{e({reverting:!0});try{(await ge("/api/v1/file-changes/revert",{method:"POST",headers:{...ce(),"Content-Type":"application/json"},body:JSON.stringify({})})).ok&&e({fileChanges:[],selectedFile:null,selectedDiff:null})}finally{e({reverting:!1})}},revertToCheckpoint:async(r,i="CodeAndConversation")=>{e({reverting:!0});try{if((await ge("/api/v1/file-changes/revert",{method:"POST",headers:{...ce(),"Content-Type":"application/json"},body:JSON.stringify({checkpointId:r,scope:i})})).ok){if((i==="Code"||i==="CodeAndConversation")&&e({fileChanges:[],selectedFile:null,selectedDiff:null}),i==="Conversation"||i==="CodeAndConversation")try{const{useChatStore:l}=await tn(async()=>{const{useChatStore:o}=await Promise.resolve().then(()=>em);return{useChatStore:o}},void 0);l.getState().clearChat();const d=Ae(),a=sessionStorage.getItem("acp-session-id");d&&a&&await d.loadSession(a)}catch(l){console.error("Failed to reload session after revert:",l)}t().loadCheckpoints()}}finally{e({reverting:!1})}},reset:()=>e({fileChanges:[],selectedFile:null,selectedDiff:null,diffLoading:!1,isCollapsed:!0,checkpoints:[],showCheckpoints:!1,reverting:!1})})),He=Ce(e=>({isInTeam:!1,teamName:null,isAutoTeam:!1,members:[],focusedMemberName:null,memberHistories:{},setTeamStatus:t=>e({isInTeam:t.isInTeam,teamName:t.teamName||null,isAutoTeam:t.isAutoTeam||!1,members:t.members}),updateMembers:t=>e({members:t}),setFocusedMember:t=>e({focusedMemberName:t}),setMemberHistory:(t,r)=>e(i=>({memberHistories:{...i.memberHistories,[t]:r}})),clearTeam:()=>e({isInTeam:!1,teamName:null,isAutoTeam:!1,members:[],focusedMemberName:null,memberHistories:{}})})),Pu=Ce(e=>({userInfo:null,loading:!1,error:null,fetchUserInfo:async t=>{e({loading:!0,error:null});try{const r=await t.getUserInfo();r.userInfo?e({userInfo:r.userInfo,loading:!1}):e({loading:!1})}catch(r){console.warn("[user] Failed to fetch user info:",r),e({error:r.message,loading:!1})}},clearUserInfo:()=>{e({userInfo:null,error:null})}}));function pd(e,t){const r=e.options||e.answers;let i=[];return Array.isArray(r)&&(i=r.map(s=>typeof s=="object"&&s!==null&&"label"in s?{label:String(s.label||""),description:String(s.description||"")}:{label:String(s||""),description:""}).filter(s=>s.label.trim().length>0)),{id:e.id||`q_${t}`,question:e.question||"",header:e.header||"",options:i,multiSelect:!!e.multiSelect}}const im={preparing:"phase.preparing",model_requesting:"phase.modelRequesting",model_streaming:"phase.modelStreaming",model_done:"phase.modelDone",tool_executing:"phase.toolExecuting",waiting_for_permission:"chat.waitingPermission",waiting_for_user:"chat.waitingUser",retrying:"phase.retrying",idle:null};function sm(e){return e.phase==="tool_executing"&&e.toolName?`phase.toolExecutingName:${e.toolName}`:e.phase==="model_streaming"&&e.streamingToolName?`phase.modelStreamingName:${e.streamingToolName}`:im[e.phase]??null}let Dt=null;function Ae(){return Dt||(Dt=new Li),Dt}function am(){const e=C.useRef(Ae()),[t,r]=C.useState(0),{sessionId:i,setStatus:s,setSessionId:l,setModels:d,setCurrentModel:a,setModes:o,setCurrentMode:c,setCommands:p,setTopic:g,setThinkingEnabled:b,setPromptSuggestion:x}=Qe(),{addChunk:k,addThinkingChunk:v,addToolCall:h,updateToolCall:m,addInterruption:u,addQuestion:f,setSessionEnd:y,resolveInterruptionByToolCallId:E,resolveQuestionByToolCallId:_,setHistoryLoading:S,addHistoryUserMessage:w,finalizeAssistantMessage:N,clearChat:L,setAgentPhaseLabel:I}=rt();C.useEffect(()=>{const B=e.current,M=[],H=(U,F)=>{if(!F)return!1;try{const D=(F._meta||{})["codebuddy.ai/memberEvent"];if(!D)return!1;const O=He.getState(),R=O.memberHistories[D]||[];return O.setMemberHistory(D,[...R,{sessionUpdate:U,...F}]),!0}catch{return!1}};return M.push(B.on("user_message_chunk",U=>{if(H("user_message_chunk",U))return;const F=U.content,T=U._meta||{},D=!!T["codebuddy.ai/isCompactInternal"];let O;const R=T["codebuddy.ai/images"];Array.isArray(R)&&R.length>0&&(O=R.filter(K=>K.blobPath&&K.mimeType).map(K=>({url:`/api/v1/files/download?path=${encodeURIComponent(K.blobPath)}`,mimeType:K.mimeType})),O.length===0&&(O=void 0));let q;const G=T["codebuddy.ai/channelSource"];G&&(q={source:G,sender:T["codebuddy.ai/channelSender"]||"",senderName:T["codebuddy.ai/channelSenderName"],chatId:T["codebuddy.ai/channelChatId"],chatType:T["codebuddy.ai/channelChatType"]}),F&&typeof F.text=="string"&&w(F.text,O,D,q)})),M.push(B.on("agent_message_chunk",U=>{if(H("agent_message_chunk",U))return;const F=U.content,T=U._meta||{},D=T["codebuddy.ai/parentToolCallId"],O=!!T["codebuddy.ai/isCompactInternal"];typeof F=="string"?k(F,D,O):F&&F.type==="thinking"&&typeof F.text=="string"?v(F.text,D):F&&typeof F.text=="string"&&k(F.text,D,O)})),M.push(B.on("tool_call",U=>{if(H("tool_call",U))return;const F=U._meta||{},T=F["codebuddy.ai/parentToolCallId"],D=!!F["codebuddy.ai/isSubagent"],O=U.toolName||F["codebuddy.ai/toolName"]||"",R=F["codebuddy.ai/planContent"];h({id:U.toolCallId,name:U.title||O||U.kind||"tool",kind:U.kind||"other",toolName:O,input:U.rawInput||U.input,status:"running",locations:U.locations,content:U.content,parentToolCallId:T,subagent:D?{type:F["codebuddy.ai/subagentType"]||"general-purpose",description:F["codebuddy.ai/description"]||"",isBackground:!!F["codebuddy.ai/isBackground"],memberName:F["codebuddy.ai/memberName"]||void 0}:void 0,planContent:R})})),M.push(B.on("tool_call_update",U=>{if(H("tool_call_update",U))return;const T={status:U.status==="completed"?"completed":U.status==="failed"?"failed":U.toolStatus==="completed"?"completed":U.toolStatus==="failed"?"failed":"running",result:U.rawOutput||U.toolResult};U.content!==void 0&&(T.content=U.content),m(U.toolCallId,T)})),M.push(B.on("interruption_request",U=>{var F;if(U.toolName==="AskUserQuestion"){const T=Array.isArray((F=U.toolInput)==null?void 0:F.questions)?U.toolInput.questions:[];f({id:U.toolCallId,toolCallId:U.toolCallId,sessionId:U.sessionId||i||"",source:"interruption",questions:T.map(pd)});return}u({id:U.interruptionId,sessionId:U.sessionId,reason:U.reason,options:U.options,toolName:U.toolName,toolTitle:U.toolTitle,toolInput:U.toolInput,toolCallId:U.toolCallId})})),M.push(B.on("question_request",U=>{const F=Array.isArray(U.questions)?U.questions:[];f({id:U.toolCallId,toolCallId:U.toolCallId,sessionId:U.sessionId,source:"extMethod",questions:F.map(pd)})})),M.push(B.on("session_end",U=>{y(U.stopReason,U.errorMessage)})),M.push(B.on("session_info_update",U=>{U.title&&g(U.title);const F=U._meta||{};if(F["codebuddy.ai/historyReplay"]==="start"?S(!0):F["codebuddy.ai/historyReplay"]==="end"&&(S(!1),N()),F["codebuddy.ai/agentPhase"]){const D=F["codebuddy.ai/agentPhase"];I(sm(D))}if(F["codebuddy.ai/sessionReset"]){const D=F["codebuddy.ai/newSessionId"];if(D){if(L(),g(null),x(null),l(D),typeof sessionStorage<"u"&&sessionStorage.setItem("acp-session-id",D),typeof window<"u"&&window.history&&window.location){const O=new URL(window.location.href);O.searchParams.get("sessionId")!==D&&(O.searchParams.set("sessionId",D),window.history.replaceState({},"",O.toString()))}B.loadSession(D).then($).catch(O=>console.error("Failed to load new session after reset:",O))}}if(F["codebuddy.ai/permissionResolved"]){const D=F["codebuddy.ai/toolCallId"],O=F["codebuddy.ai/decision"];D&&O&&(Ae().clearPermissionRequestByToolCallId(D),E(D,O),_(D))}if("codebuddy.ai/promptSuggestion"in F){const D=F["codebuddy.ai/promptSuggestion"];x(D||null)}const T=F["codebuddy.ai/teamUpdate"];if(T)switch(T.type){case"member_status_change":T.members&&(T.teamName?He.getState().setTeamStatus({isInTeam:!0,teamName:T.teamName,isAutoTeam:T.isAutoTeam,members:T.members}):He.getState().updateMembers(T.members));break;case"team_created":He.getState().setTeamStatus({isInTeam:!0,teamName:T.teamName,members:[]});break;case"team_deleted":He.getState().clearTeam();break}})),M.push(B.on("model_update",U=>{d(U.availableModels||[]),a(U.currentModelId||"")})),M.push(B.on("mode_update",U=>{U.availableModes&&o(U.availableModes),U.currentModeId&&c(U.currentModeId)})),M.push(B.on("current_mode_update",U=>{U.currentModeId&&c(U.currentModeId)})),M.push(B.on("config_option_update",U=>{const F=U.configOptions||[];for(const T of F)T.id==="thought_level"?b(T.currentValue==="enabled"):T.id==="mode"&&T.currentValue?c(T.currentValue):T.id==="model"&&T.currentValue&&(a(T.currentValue),T.options&&d(T.options.map(D=>({id:D.value,name:D.name||D.value}))))})),M.push(B.on("status_change",U=>{s(U)})),M.push(B.on("available_commands_update",U=>{U.availableCommands&&p(U.availableCommands.map(F=>{var T;return{name:F.name,description:F.description||"",...((T=F._meta)==null?void 0:T.type)==="skill"?{type:"skill"}:{}}}))})),M.push(B.on("checkpointCreated",U=>{xr.getState().onCheckpoint(U)})),M.push(B.on("checkpointUpdated",U=>{xr.getState().onCheckpoint(U)})),M.push(B.on("checkpointReverted",()=>{xr.getState().reset()})),()=>{M.forEach(U=>U())}},[t,i,k,v,h,m,u,f,y,E,_,d,a,o,c,p,g,b,s,S,w,N,L,l,x]);const $=C.useCallback(B=>{if(B.models&&(d(B.models.availableModels.map(M=>({id:M.modelId,name:M.name}))),a(B.models.currentModelId)),B.modes&&(o(B.modes.availableModes),c(B.modes.currentModeId)),B.configOptions)for(const M of B.configOptions)M.id==="thought_level"&&b(M.currentValue==="enabled")},[d,a,o,c,b]),A=C.useCallback(async B=>{const M=typeof B=="string"?B:B==null?void 0:B.token,H=typeof B=="object"?B==null?void 0:B.continue:!1;if(M){if(Dt)try{await Dt.disconnect()}catch{}Dt=new Li(void 0,M),e.current=Dt,r(U=>U+1)}try{s("connecting"),x(null);const U=await e.current.initializeSession({continue:H});l(U.sessionId),$(U),s("connected"),Pu.getState().fetchUserInfo(e.current)}catch(U){console.error("Connection failed:",U),s("error")}},[s,l,$,x]);return{client:e.current,connect:A}}const Fu="/assets/dark-claw-cat-D_ew_BKV.png",Bu="/assets/light-claw-cat-BgBWmnmi.png",Uu="/assets/red-claw-cat--t2EuBIB.png",zu={small:{container:"w-20 h-20",text:"text-[12px]"},medium:{container:"w-32 h-32",text:"text-[14px]"},large:{container:"w-40 h-40",text:"text-[16px]"}};function Hu({size:e="medium",className:t=""}){const i=qe(l=>l.resolved)==="dark"?Fu:Bu,s=zu[e];return n.jsxs("div",{className:`relative ${s.container} ${t}`,children:[n.jsx("img",{src:i,alt:"",className:"cat-loading-layer cat-loading-layer-base absolute inset-0 w-full h-full object-contain",decoding:"async",loading:"eager"}),n.jsx("img",{src:Uu,alt:"",className:"cat-loading-layer cat-loading-layer-color absolute inset-0 w-full h-full object-contain",decoding:"async",loading:"eager"})]})}function st({size:e="medium",text:t="Loading...",className:r=""}){const i=zu[e];return n.jsxs("div",{className:`flex flex-col items-center justify-center gap-4 ${r}`,children:[n.jsx(Hu,{size:e}),t&&n.jsx("div",{className:`text-text-secondary ${i.text} font-medium animate-pulse`,children:t})]})}function om({size:e="medium",className:t=""}){return n.jsx(Hu,{size:e,className:t})}/**
|
|
9
|
-
* @license lucide-react v1.
|
|
9
|
+
* @license lucide-react v1.7.0 - ISC
|
|
10
10
|
*
|
|
11
11
|
* This source code is licensed under the ISC license.
|
|
12
12
|
* See the LICENSE file in the root directory of this source tree.
|
|
13
13
|
*/const Gu=(...e)=>e.filter((t,r,i)=>!!t&&t.trim()!==""&&i.indexOf(t)===r).join(" ").trim();/**
|
|
14
|
-
* @license lucide-react v1.
|
|
14
|
+
* @license lucide-react v1.7.0 - ISC
|
|
15
15
|
*
|
|
16
16
|
* This source code is licensed under the ISC license.
|
|
17
17
|
* See the LICENSE file in the root directory of this source tree.
|
|
18
18
|
*/const lm=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
|
|
19
|
-
* @license lucide-react v1.
|
|
19
|
+
* @license lucide-react v1.7.0 - ISC
|
|
20
20
|
*
|
|
21
21
|
* This source code is licensed under the ISC license.
|
|
22
22
|
* See the LICENSE file in the root directory of this source tree.
|
|
23
23
|
*/const cm=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,r,i)=>i?i.toUpperCase():r.toLowerCase());/**
|
|
24
|
-
* @license lucide-react v1.
|
|
24
|
+
* @license lucide-react v1.7.0 - ISC
|
|
25
25
|
*
|
|
26
26
|
* This source code is licensed under the ISC license.
|
|
27
27
|
* See the LICENSE file in the root directory of this source tree.
|
|
28
28
|
*/const hd=e=>{const t=cm(e);return t.charAt(0).toUpperCase()+t.slice(1)};/**
|
|
29
|
-
* @license lucide-react v1.
|
|
29
|
+
* @license lucide-react v1.7.0 - ISC
|
|
30
30
|
*
|
|
31
31
|
* This source code is licensed under the ISC license.
|
|
32
32
|
* See the LICENSE file in the root directory of this source tree.
|
|
33
33
|
*/var Pn={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
34
|
-
* @license lucide-react v1.
|
|
34
|
+
* @license lucide-react v1.7.0 - ISC
|
|
35
35
|
*
|
|
36
36
|
* This source code is licensed under the ISC license.
|
|
37
37
|
* See the LICENSE file in the root directory of this source tree.
|
|
38
38
|
*/const dm=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1},um=C.createContext({}),pm=()=>C.useContext(um),hm=C.forwardRef(({color:e,size:t,strokeWidth:r,absoluteStrokeWidth:i,className:s="",children:l,iconNode:d,...a},o)=>{const{size:c=24,strokeWidth:p=2,absoluteStrokeWidth:g=!1,color:b="currentColor",className:x=""}=pm()??{},k=i??g?Number(r??p)*24/Number(t??c):r??p;return C.createElement("svg",{ref:o,...Pn,width:t??c??Pn.width,height:t??c??Pn.height,stroke:e??b,strokeWidth:k,className:Gu("lucide",x,s),...!l&&!dm(a)&&{"aria-hidden":"true"},...a},[...d.map(([v,h])=>C.createElement(v,h)),...Array.isArray(l)?l:[l]])});/**
|
|
39
|
-
* @license lucide-react v1.
|
|
39
|
+
* @license lucide-react v1.7.0 - ISC
|
|
40
40
|
*
|
|
41
41
|
* This source code is licensed under the ISC license.
|
|
42
42
|
* See the LICENSE file in the root directory of this source tree.
|
|
43
43
|
*/const Z=(e,t)=>{const r=C.forwardRef(({className:i,...s},l)=>C.createElement(hm,{ref:l,iconNode:t,className:Gu(`lucide-${lm(hd(e))}`,`lucide-${e}`,i),...s}));return r.displayName=hd(e),r};/**
|
|
44
|
-
* @license lucide-react v1.
|
|
44
|
+
* @license lucide-react v1.7.0 - ISC
|
|
45
45
|
*
|
|
46
46
|
* This source code is licensed under the ISC license.
|
|
47
47
|
* See the LICENSE file in the root directory of this source tree.
|
|
48
48
|
*/const mm=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],Di=Z("activity",mm);/**
|
|
49
|
-
* @license lucide-react v1.
|
|
49
|
+
* @license lucide-react v1.7.0 - ISC
|
|
50
50
|
*
|
|
51
51
|
* This source code is licensed under the ISC license.
|
|
52
52
|
* See the LICENSE file in the root directory of this source tree.
|
|
53
53
|
*/const gm=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],nr=Z("arrow-left",gm);/**
|
|
54
|
-
* @license lucide-react v1.
|
|
54
|
+
* @license lucide-react v1.7.0 - ISC
|
|
55
55
|
*
|
|
56
56
|
* This source code is licensed under the ISC license.
|
|
57
57
|
* See the LICENSE file in the root directory of this source tree.
|
|
58
58
|
*/const fm=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],bm=Z("arrow-right",fm);/**
|
|
59
|
-
* @license lucide-react v1.
|
|
59
|
+
* @license lucide-react v1.7.0 - ISC
|
|
60
60
|
*
|
|
61
61
|
* This source code is licensed under the ISC license.
|
|
62
62
|
* See the LICENSE file in the root directory of this source tree.
|
|
63
63
|
*/const ym=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],oi=Z("arrow-up",ym);/**
|
|
64
|
-
* @license lucide-react v1.
|
|
64
|
+
* @license lucide-react v1.7.0 - ISC
|
|
65
65
|
*
|
|
66
66
|
* This source code is licensed under the ISC license.
|
|
67
67
|
* See the LICENSE file in the root directory of this source tree.
|
|
68
68
|
*/const xm=[["path",{d:"M10 22V7a1 1 0 0 0-1-1H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-5a1 1 0 0 0-1-1H2",key:"1ah6g2"}],["rect",{x:"14",y:"2",width:"8",height:"8",rx:"1",key:"88lufb"}]],Ot=Z("blocks",xm);/**
|
|
69
|
-
* @license lucide-react v1.
|
|
69
|
+
* @license lucide-react v1.7.0 - ISC
|
|
70
70
|
*
|
|
71
71
|
* This source code is licensed under the ISC license.
|
|
72
72
|
* See the LICENSE file in the root directory of this source tree.
|
|
73
73
|
*/const vm=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],Oi=Z("book-open",vm);/**
|
|
74
|
-
* @license lucide-react v1.
|
|
74
|
+
* @license lucide-react v1.7.0 - ISC
|
|
75
75
|
*
|
|
76
76
|
* This source code is licensed under the ISC license.
|
|
77
77
|
* See the LICENSE file in the root directory of this source tree.
|
|
78
78
|
*/const _m=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],rn=Z("bot",_m);/**
|
|
79
|
-
* @license lucide-react v1.
|
|
79
|
+
* @license lucide-react v1.7.0 - ISC
|
|
80
80
|
*
|
|
81
81
|
* This source code is licensed under the ISC license.
|
|
82
82
|
* See the LICENSE file in the root directory of this source tree.
|
|
83
83
|
*/const Sm=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],$i=Z("chart-column",Sm);/**
|
|
84
|
-
* @license lucide-react v1.
|
|
84
|
+
* @license lucide-react v1.7.0 - ISC
|
|
85
85
|
*
|
|
86
86
|
* This source code is licensed under the ISC license.
|
|
87
87
|
* See the LICENSE file in the root directory of this source tree.
|
|
88
88
|
*/const km=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],$t=Z("check",km);/**
|
|
89
|
-
* @license lucide-react v1.
|
|
89
|
+
* @license lucide-react v1.7.0 - ISC
|
|
90
90
|
*
|
|
91
91
|
* This source code is licensed under the ISC license.
|
|
92
92
|
* See the LICENSE file in the root directory of this source tree.
|
|
93
93
|
*/const wm=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],et=Z("chevron-down",wm);/**
|
|
94
|
-
* @license lucide-react v1.
|
|
94
|
+
* @license lucide-react v1.7.0 - ISC
|
|
95
95
|
*
|
|
96
96
|
* This source code is licensed under the ISC license.
|
|
97
97
|
* See the LICENSE file in the root directory of this source tree.
|
|
98
98
|
*/const Em=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],Cm=Z("chevron-left",Em);/**
|
|
99
|
-
* @license lucide-react v1.
|
|
99
|
+
* @license lucide-react v1.7.0 - ISC
|
|
100
100
|
*
|
|
101
101
|
* This source code is licensed under the ISC license.
|
|
102
102
|
* See the LICENSE file in the root directory of this source tree.
|
|
103
103
|
*/const Tm=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Ee=Z("chevron-right",Tm);/**
|
|
104
|
-
* @license lucide-react v1.
|
|
104
|
+
* @license lucide-react v1.7.0 - ISC
|
|
105
105
|
*
|
|
106
106
|
* This source code is licensed under the ISC license.
|
|
107
107
|
* See the LICENSE file in the root directory of this source tree.
|
|
108
108
|
*/const Nm=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],Am=Z("circle-alert",Nm);/**
|
|
109
|
-
* @license lucide-react v1.
|
|
109
|
+
* @license lucide-react v1.7.0 - ISC
|
|
110
110
|
*
|
|
111
111
|
* This source code is licensed under the ISC license.
|
|
112
112
|
* See the LICENSE file in the root directory of this source tree.
|
|
113
113
|
*/const Im=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],Rm=Z("circle-check-big",Im);/**
|
|
114
|
-
* @license lucide-react v1.
|
|
114
|
+
* @license lucide-react v1.7.0 - ISC
|
|
115
115
|
*
|
|
116
116
|
* This source code is licensed under the ISC license.
|
|
117
117
|
* See the LICENSE file in the root directory of this source tree.
|
|
118
118
|
*/const Lm=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Wu=Z("circle-check",Lm);/**
|
|
119
|
-
* @license lucide-react v1.
|
|
119
|
+
* @license lucide-react v1.7.0 - ISC
|
|
120
120
|
*
|
|
121
121
|
* This source code is licensed under the ISC license.
|
|
122
122
|
* See the LICENSE file in the root directory of this source tree.
|
|
123
123
|
*/const Dm=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Om=Z("circle-question-mark",Dm);/**
|
|
124
|
-
* @license lucide-react v1.
|
|
124
|
+
* @license lucide-react v1.7.0 - ISC
|
|
125
125
|
*
|
|
126
126
|
* This source code is licensed under the ISC license.
|
|
127
127
|
* See the LICENSE file in the root directory of this source tree.
|
|
128
128
|
*/const $m=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],nn=Z("circle-x",$m);/**
|
|
129
|
-
* @license lucide-react v1.
|
|
129
|
+
* @license lucide-react v1.7.0 - ISC
|
|
130
130
|
*
|
|
131
131
|
* This source code is licensed under the ISC license.
|
|
132
132
|
* See the LICENSE file in the root directory of this source tree.
|
|
133
133
|
*/const jm=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Mm=Z("circle",jm);/**
|
|
134
|
-
* @license lucide-react v1.
|
|
134
|
+
* @license lucide-react v1.7.0 - ISC
|
|
135
135
|
*
|
|
136
136
|
* This source code is licensed under the ISC license.
|
|
137
137
|
* See the LICENSE file in the root directory of this source tree.
|
|
138
138
|
*/const Pm=[["path",{d:"M16 14v2.2l1.6 1",key:"fo4ql5"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v.832",key:"1ujtp2"}],["path",{d:"M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h2",key:"qvpao1"}],["circle",{cx:"16",cy:"16",r:"6",key:"qoo3c4"}],["rect",{x:"8",y:"2",width:"8",height:"4",rx:"1",key:"ublpy"}]],ji=Z("clipboard-clock",Pm);/**
|
|
139
|
-
* @license lucide-react v1.
|
|
139
|
+
* @license lucide-react v1.7.0 - ISC
|
|
140
140
|
*
|
|
141
141
|
* This source code is licensed under the ISC license.
|
|
142
142
|
* See the LICENSE file in the root directory of this source tree.
|
|
143
143
|
*/const Fm=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]],Bm=Z("clipboard-list",Fm);/**
|
|
144
|
-
* @license lucide-react v1.
|
|
144
|
+
* @license lucide-react v1.7.0 - ISC
|
|
145
145
|
*
|
|
146
146
|
* This source code is licensed under the ISC license.
|
|
147
147
|
* See the LICENSE file in the root directory of this source tree.
|
|
148
148
|
*/const Um=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],kt=Z("clock",Um);/**
|
|
149
|
-
* @license lucide-react v1.
|
|
149
|
+
* @license lucide-react v1.7.0 - ISC
|
|
150
150
|
*
|
|
151
151
|
* This source code is licensed under the ISC license.
|
|
152
152
|
* See the LICENSE file in the root directory of this source tree.
|
|
153
153
|
*/const zm=[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],Hm=Z("code-xml",zm);/**
|
|
154
|
-
* @license lucide-react v1.
|
|
154
|
+
* @license lucide-react v1.7.0 - ISC
|
|
155
155
|
*
|
|
156
156
|
* This source code is licensed under the ISC license.
|
|
157
157
|
* See the LICENSE file in the root directory of this source tree.
|
|
158
158
|
*/const Gm=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],qu=Z("code",Gm);/**
|
|
159
|
-
* @license lucide-react v1.
|
|
159
|
+
* @license lucide-react v1.7.0 - ISC
|
|
160
160
|
*
|
|
161
161
|
* This source code is licensed under the ISC license.
|
|
162
162
|
* See the LICENSE file in the root directory of this source tree.
|
|
163
163
|
*/const Wm=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]],md=Z("columns-2",Wm);/**
|
|
164
|
-
* @license lucide-react v1.
|
|
164
|
+
* @license lucide-react v1.7.0 - ISC
|
|
165
165
|
*
|
|
166
166
|
* This source code is licensed under the ISC license.
|
|
167
167
|
* See the LICENSE file in the root directory of this source tree.
|
|
168
168
|
*/const qm=[["line",{x1:"12",x2:"18",y1:"15",y2:"15",key:"1nscbv"}],["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Vm=Z("copy-minus",qm);/**
|
|
169
|
-
* @license lucide-react v1.
|
|
169
|
+
* @license lucide-react v1.7.0 - ISC
|
|
170
170
|
*
|
|
171
171
|
* This source code is licensed under the ISC license.
|
|
172
172
|
* See the LICENSE file in the root directory of this source tree.
|
|
173
173
|
*/const Km=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],li=Z("copy",Km);/**
|
|
174
|
-
* @license lucide-react v1.
|
|
174
|
+
* @license lucide-react v1.7.0 - ISC
|
|
175
175
|
*
|
|
176
176
|
* This source code is licensed under the ISC license.
|
|
177
177
|
* See the LICENSE file in the root directory of this source tree.
|
|
178
178
|
*/const Ym=[["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}],["path",{d:"m9 10-5 5 5 5",key:"1kshq7"}]],gd=Z("corner-down-left",Ym);/**
|
|
179
|
-
* @license lucide-react v1.
|
|
179
|
+
* @license lucide-react v1.7.0 - ISC
|
|
180
180
|
*
|
|
181
181
|
* This source code is licensed under the ISC license.
|
|
182
182
|
* See the LICENSE file in the root directory of this source tree.
|
|
183
183
|
*/const Xm=[["path",{d:"m15 10 5 5-5 5",key:"qqa56n"}],["path",{d:"M4 4v7a4 4 0 0 0 4 4h12",key:"z08zvw"}]],Zm=Z("corner-down-right",Xm);/**
|
|
184
|
-
* @license lucide-react v1.
|
|
184
|
+
* @license lucide-react v1.7.0 - ISC
|
|
185
185
|
*
|
|
186
186
|
* This source code is licensed under the ISC license.
|
|
187
187
|
* See the LICENSE file in the root directory of this source tree.
|
|
188
188
|
*/const Jm=[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]],Ft=Z("cpu",Jm);/**
|
|
189
|
-
* @license lucide-react v1.
|
|
189
|
+
* @license lucide-react v1.7.0 - ISC
|
|
190
190
|
*
|
|
191
191
|
* This source code is licensed under the ISC license.
|
|
192
192
|
* See the LICENSE file in the root directory of this source tree.
|
|
193
193
|
*/const Qm=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],Vu=Z("download",Qm);/**
|
|
194
|
-
* @license lucide-react v1.
|
|
194
|
+
* @license lucide-react v1.7.0 - ISC
|
|
195
195
|
*
|
|
196
196
|
* This source code is licensed under the ISC license.
|
|
197
197
|
* See the LICENSE file in the root directory of this source tree.
|
|
198
198
|
*/const eg=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],gt=Z("external-link",eg);/**
|
|
199
|
-
* @license lucide-react v1.
|
|
199
|
+
* @license lucide-react v1.7.0 - ISC
|
|
200
200
|
*
|
|
201
201
|
* This source code is licensed under the ISC license.
|
|
202
202
|
* See the LICENSE file in the root directory of this source tree.
|
|
203
203
|
*/const tg=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]],rg=Z("file-code",tg);/**
|
|
204
|
-
* @license lucide-react v1.
|
|
204
|
+
* @license lucide-react v1.7.0 - ISC
|
|
205
205
|
*
|
|
206
206
|
* This source code is licensed under the ISC license.
|
|
207
207
|
* See the LICENSE file in the root directory of this source tree.
|
|
208
208
|
*/const ng=[["path",{d:"M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34",key:"o6klzx"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z",key:"zhnas1"}]],Ku=Z("file-pen",ng);/**
|
|
209
|
-
* @license lucide-react v1.
|
|
209
|
+
* @license lucide-react v1.7.0 - ISC
|
|
210
210
|
*
|
|
211
211
|
* This source code is licensed under the ISC license.
|
|
212
212
|
* See the LICENSE file in the root directory of this source tree.
|
|
213
213
|
*/const ig=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M9 15h6",key:"cctwl0"}],["path",{d:"M12 18v-6",key:"17g6i2"}]],sg=Z("file-plus",ig);/**
|
|
214
|
-
* @license lucide-react v1.
|
|
214
|
+
* @license lucide-react v1.7.0 - ISC
|
|
215
215
|
*
|
|
216
216
|
* This source code is licensed under the ISC license.
|
|
217
217
|
* See the LICENSE file in the root directory of this source tree.
|
|
218
218
|
*/const ag=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],dt=Z("file-text",ag);/**
|
|
219
|
-
* @license lucide-react v1.
|
|
219
|
+
* @license lucide-react v1.7.0 - ISC
|
|
220
220
|
*
|
|
221
221
|
* This source code is licensed under the ISC license.
|
|
222
222
|
* See the LICENSE file in the root directory of this source tree.
|
|
223
223
|
*/const og=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]],Yu=Z("file",og);/**
|
|
224
|
-
* @license lucide-react v1.
|
|
224
|
+
* @license lucide-react v1.7.0 - ISC
|
|
225
225
|
*
|
|
226
226
|
* This source code is licensed under the ISC license.
|
|
227
227
|
* See the LICENSE file in the root directory of this source tree.
|
|
228
228
|
*/const lg=[["path",{d:"M15 2h-4a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V8",key:"14sh0y"}],["path",{d:"M16.706 2.706A2.4 2.4 0 0 0 15 2v5a1 1 0 0 0 1 1h5a2.4 2.4 0 0 0-.706-1.706z",key:"1970lx"}],["path",{d:"M5 7a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 1.732-1",key:"l4dndm"}]],Xu=Z("files",lg);/**
|
|
229
|
-
* @license lucide-react v1.
|
|
229
|
+
* @license lucide-react v1.7.0 - ISC
|
|
230
230
|
*
|
|
231
231
|
* This source code is licensed under the ISC license.
|
|
232
232
|
* See the LICENSE file in the root directory of this source tree.
|
|
233
233
|
*/const cg=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}],["path",{d:"M2 10h20",key:"1ir3d8"}]],dg=Z("folder-closed",cg);/**
|
|
234
|
-
* @license lucide-react v1.
|
|
234
|
+
* @license lucide-react v1.7.0 - ISC
|
|
235
235
|
*
|
|
236
236
|
* This source code is licensed under the ISC license.
|
|
237
237
|
* See the LICENSE file in the root directory of this source tree.
|
|
238
238
|
*/const ug=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],Mi=Z("folder-open",ug);/**
|
|
239
|
-
* @license lucide-react v1.
|
|
239
|
+
* @license lucide-react v1.7.0 - ISC
|
|
240
240
|
*
|
|
241
241
|
* This source code is licensed under the ISC license.
|
|
242
242
|
* See the LICENSE file in the root directory of this source tree.
|
|
243
243
|
*/const pg=[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],hg=Z("folder-plus",pg);/**
|
|
244
|
-
* @license lucide-react v1.
|
|
244
|
+
* @license lucide-react v1.7.0 - ISC
|
|
245
245
|
*
|
|
246
246
|
* This source code is licensed under the ISC license.
|
|
247
247
|
* See the LICENSE file in the root directory of this source tree.
|
|
248
248
|
*/const mg=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],gg=Z("folder",mg);/**
|
|
249
|
-
* @license lucide-react v1.
|
|
249
|
+
* @license lucide-react v1.7.0 - ISC
|
|
250
250
|
*
|
|
251
251
|
* This source code is licensed under the ISC license.
|
|
252
252
|
* See the LICENSE file in the root directory of this source tree.
|
|
253
253
|
*/const fg=[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]],Zu=Z("git-branch",fg);/**
|
|
254
|
-
* @license lucide-react v1.
|
|
254
|
+
* @license lucide-react v1.7.0 - ISC
|
|
255
255
|
*
|
|
256
256
|
* This source code is licensed under the ISC license.
|
|
257
257
|
* See the LICENSE file in the root directory of this source tree.
|
|
258
258
|
*/const bg=[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M13 6h3a2 2 0 0 1 2 2v7",key:"1yeb86"}],["path",{d:"M11 18H8a2 2 0 0 1-2-2V9",key:"19pyzm"}]],bn=Z("git-compare",bg);/**
|
|
259
|
-
* @license lucide-react v1.
|
|
259
|
+
* @license lucide-react v1.7.0 - ISC
|
|
260
260
|
*
|
|
261
261
|
* This source code is licensed under the ISC license.
|
|
262
262
|
* See the LICENSE file in the root directory of this source tree.
|
|
263
263
|
*/const yg=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],Ju=Z("globe",yg);/**
|
|
264
|
-
* @license lucide-react v1.
|
|
264
|
+
* @license lucide-react v1.7.0 - ISC
|
|
265
265
|
*
|
|
266
266
|
* This source code is licensed under the ISC license.
|
|
267
267
|
* See the LICENSE file in the root directory of this source tree.
|
|
268
268
|
*/const xg=[["path",{d:"M10 16h.01",key:"1bzywj"}],["path",{d:"M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"18tbho"}],["path",{d:"M21.946 12.013H2.054",key:"zqlbp7"}],["path",{d:"M6 16h.01",key:"1pmjb7"}]],vg=Z("hard-drive",xg);/**
|
|
269
|
-
* @license lucide-react v1.
|
|
269
|
+
* @license lucide-react v1.7.0 - ISC
|
|
270
270
|
*
|
|
271
271
|
* This source code is licensed under the ISC license.
|
|
272
272
|
* See the LICENSE file in the root directory of this source tree.
|
|
273
273
|
*/const _g=[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]],Qu=Z("hash",_g);/**
|
|
274
|
-
* @license lucide-react v1.
|
|
274
|
+
* @license lucide-react v1.7.0 - ISC
|
|
275
275
|
*
|
|
276
276
|
* This source code is licensed under the ISC license.
|
|
277
277
|
* See the LICENSE file in the root directory of this source tree.
|
|
278
278
|
*/const Sg=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],ep=Z("history",Sg);/**
|
|
279
|
-
* @license lucide-react v1.
|
|
279
|
+
* @license lucide-react v1.7.0 - ISC
|
|
280
280
|
*
|
|
281
281
|
* This source code is licensed under the ISC license.
|
|
282
282
|
* See the LICENSE file in the root directory of this source tree.
|
|
283
283
|
*/const kg=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],tp=Z("image",kg);/**
|
|
284
|
-
* @license lucide-react v1.
|
|
284
|
+
* @license lucide-react v1.7.0 - ISC
|
|
285
285
|
*
|
|
286
286
|
* This source code is licensed under the ISC license.
|
|
287
287
|
* See the LICENSE file in the root directory of this source tree.
|
|
288
288
|
*/const wg=[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]],Eg=Z("inbox",wg);/**
|
|
289
|
-
* @license lucide-react v1.
|
|
289
|
+
* @license lucide-react v1.7.0 - ISC
|
|
290
290
|
*
|
|
291
291
|
* This source code is licensed under the ISC license.
|
|
292
292
|
* See the LICENSE file in the root directory of this source tree.
|
|
293
293
|
*/const Cg=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Tg=Z("info",Cg);/**
|
|
294
|
-
* @license lucide-react v1.
|
|
294
|
+
* @license lucide-react v1.7.0 - ISC
|
|
295
295
|
*
|
|
296
296
|
* This source code is licensed under the ISC license.
|
|
297
297
|
* See the LICENSE file in the root directory of this source tree.
|
|
298
298
|
*/const Ng=[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]],rp=Z("keyboard",Ng);/**
|
|
299
|
-
* @license lucide-react v1.
|
|
299
|
+
* @license lucide-react v1.7.0 - ISC
|
|
300
300
|
*
|
|
301
301
|
* This source code is licensed under the ISC license.
|
|
302
302
|
* See the LICENSE file in the root directory of this source tree.
|
|
303
303
|
*/const Ag=[["path",{d:"m5 8 6 6",key:"1wu5hv"}],["path",{d:"m4 14 6-6 2-3",key:"1k1g8d"}],["path",{d:"M2 5h12",key:"or177f"}],["path",{d:"M7 2h1",key:"1t2jsx"}],["path",{d:"m22 22-5-10-5 10",key:"don7ne"}],["path",{d:"M14 18h6",key:"1m8k6r"}]],Ig=Z("languages",Ag);/**
|
|
304
|
-
* @license lucide-react v1.
|
|
304
|
+
* @license lucide-react v1.7.0 - ISC
|
|
305
305
|
*
|
|
306
306
|
* This source code is licensed under the ISC license.
|
|
307
307
|
* See the LICENSE file in the root directory of this source tree.
|
|
308
308
|
*/const Rg=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],Lg=Z("layers",Rg);/**
|
|
309
|
-
* @license lucide-react v1.
|
|
309
|
+
* @license lucide-react v1.7.0 - ISC
|
|
310
310
|
*
|
|
311
311
|
* This source code is licensed under the ISC license.
|
|
312
312
|
* See the LICENSE file in the root directory of this source tree.
|
|
313
|
-
*/const Dg=[["path",{d:"M9 17H7A5 5 0 0 1 7
|
|
314
|
-
* @license lucide-react v1.
|
|
313
|
+
*/const Dg=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],Og=Z("link-2",Dg);/**
|
|
314
|
+
* @license lucide-react v1.7.0 - ISC
|
|
315
315
|
*
|
|
316
316
|
* This source code is licensed under the ISC license.
|
|
317
317
|
* See the LICENSE file in the root directory of this source tree.
|
|
318
|
-
*/const
|
|
319
|
-
* @license lucide-react v1.
|
|
318
|
+
*/const $g=[["path",{d:"M9 17H7A5 5 0 0 1 7 7",key:"10o201"}],["path",{d:"M15 7h2a5 5 0 0 1 4 8",key:"1d3206"}],["line",{x1:"8",x2:"12",y1:"12",y2:"12",key:"rvw6j4"}],["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}]],fd=Z("link-2-off",$g);/**
|
|
319
|
+
* @license lucide-react v1.7.0 - ISC
|
|
320
320
|
*
|
|
321
321
|
* This source code is licensed under the ISC license.
|
|
322
322
|
* See the LICENSE file in the root directory of this source tree.
|
|
323
323
|
*/const jg=[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}]],Pi=Z("list-checks",jg);/**
|
|
324
|
-
* @license lucide-react v1.
|
|
324
|
+
* @license lucide-react v1.7.0 - ISC
|
|
325
325
|
*
|
|
326
326
|
* This source code is licensed under the ISC license.
|
|
327
327
|
* See the LICENSE file in the root directory of this source tree.
|
|
328
328
|
*/const Mg=[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["rect",{x:"3",y:"4",width:"6",height:"6",rx:"1",key:"cif1o7"}]],np=Z("list-todo",Mg);/**
|
|
329
|
-
* @license lucide-react v1.
|
|
329
|
+
* @license lucide-react v1.7.0 - ISC
|
|
330
330
|
*
|
|
331
331
|
* This source code is licensed under the ISC license.
|
|
332
332
|
* See the LICENSE file in the root directory of this source tree.
|
|
333
333
|
*/const Pg=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],xe=Z("loader-circle",Pg);/**
|
|
334
|
-
* @license lucide-react v1.
|
|
334
|
+
* @license lucide-react v1.7.0 - ISC
|
|
335
335
|
*
|
|
336
336
|
* This source code is licensed under the ISC license.
|
|
337
337
|
* See the LICENSE file in the root directory of this source tree.
|
|
338
338
|
*/const Fg=[["path",{d:"M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z",key:"169xi5"}],["path",{d:"M15 5.764v15",key:"1pn4in"}],["path",{d:"M9 3.236v15",key:"1uimfh"}]],Bg=Z("map",Fg);/**
|
|
339
|
-
* @license lucide-react v1.
|
|
339
|
+
* @license lucide-react v1.7.0 - ISC
|
|
340
340
|
*
|
|
341
341
|
* This source code is licensed under the ISC license.
|
|
342
342
|
* See the LICENSE file in the root directory of this source tree.
|
|
343
343
|
*/const Ug=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]],ip=Z("maximize-2",Ug);/**
|
|
344
|
-
* @license lucide-react v1.
|
|
344
|
+
* @license lucide-react v1.7.0 - ISC
|
|
345
345
|
*
|
|
346
346
|
* This source code is licensed under the ISC license.
|
|
347
347
|
* See the LICENSE file in the root directory of this source tree.
|
|
348
348
|
*/const zg=[["path",{d:"M12 12v-2",key:"fwoke6"}],["path",{d:"M12 18v-2",key:"qj6yno"}],["path",{d:"M16 12v-2",key:"heuere"}],["path",{d:"M16 18v-2",key:"s1ct0w"}],["path",{d:"M2 11h1.5",key:"15p63e"}],["path",{d:"M20 18v-2",key:"12ehxp"}],["path",{d:"M20.5 11H22",key:"khsy7a"}],["path",{d:"M4 18v-2",key:"1c3oqr"}],["path",{d:"M8 12v-2",key:"1mwtfd"}],["path",{d:"M8 18v-2",key:"qcmpov"}],["rect",{x:"2",y:"6",width:"20",height:"10",rx:"2",key:"1qcswk"}]],ci=Z("memory-stick",zg);/**
|
|
349
|
-
* @license lucide-react v1.
|
|
349
|
+
* @license lucide-react v1.7.0 - ISC
|
|
350
350
|
*
|
|
351
351
|
* This source code is licensed under the ISC license.
|
|
352
352
|
* See the LICENSE file in the root directory of this source tree.
|
|
353
353
|
*/const Hg=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],Gg=Z("menu",Hg);/**
|
|
354
|
-
* @license lucide-react v1.
|
|
354
|
+
* @license lucide-react v1.7.0 - ISC
|
|
355
355
|
*
|
|
356
356
|
* This source code is licensed under the ISC license.
|
|
357
357
|
* See the LICENSE file in the root directory of this source tree.
|
|
358
358
|
*/const Wg=[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Fn=Z("message-circle-question-mark",Wg);/**
|
|
359
|
-
* @license lucide-react v1.
|
|
359
|
+
* @license lucide-react v1.7.0 - ISC
|
|
360
360
|
*
|
|
361
361
|
* This source code is licensed under the ISC license.
|
|
362
362
|
* See the LICENSE file in the root directory of this source tree.
|
|
363
363
|
*/const qg=[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]],sp=Z("message-circle",qg);/**
|
|
364
|
-
* @license lucide-react v1.
|
|
364
|
+
* @license lucide-react v1.7.0 - ISC
|
|
365
365
|
*
|
|
366
366
|
* This source code is licensed under the ISC license.
|
|
367
367
|
* See the LICENSE file in the root directory of this source tree.
|
|
368
368
|
*/const Vg=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],ir=Z("message-square",Vg);/**
|
|
369
|
-
* @license lucide-react v1.
|
|
369
|
+
* @license lucide-react v1.7.0 - ISC
|
|
370
370
|
*
|
|
371
371
|
* This source code is licensed under the ISC license.
|
|
372
372
|
* See the LICENSE file in the root directory of this source tree.
|
|
373
373
|
*/const Kg=[["path",{d:"M5 12h14",key:"1ays0h"}]],Yg=Z("minus",Kg);/**
|
|
374
|
-
* @license lucide-react v1.
|
|
374
|
+
* @license lucide-react v1.7.0 - ISC
|
|
375
375
|
*
|
|
376
376
|
* This source code is licensed under the ISC license.
|
|
377
377
|
* See the LICENSE file in the root directory of this source tree.
|
|
378
378
|
*/const Xg=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],ap=Z("moon",Xg);/**
|
|
379
|
-
* @license lucide-react v1.
|
|
379
|
+
* @license lucide-react v1.7.0 - ISC
|
|
380
380
|
*
|
|
381
381
|
* This source code is licensed under the ISC license.
|
|
382
382
|
* See the LICENSE file in the root directory of this source tree.
|
|
383
383
|
*/const Zg=[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]],op=Z("network",Zg);/**
|
|
384
|
-
* @license lucide-react v1.
|
|
384
|
+
* @license lucide-react v1.7.0 - ISC
|
|
385
385
|
*
|
|
386
386
|
* This source code is licensed under the ISC license.
|
|
387
387
|
* See the LICENSE file in the root directory of this source tree.
|
|
388
388
|
*/const Jg=[["path",{d:"M15 18h-5",key:"95g1m2"}],["path",{d:"M18 14h-8",key:"sponae"}],["path",{d:"M4 22h16a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2H8a2 2 0 0 0-2 2v16a2 2 0 0 1-4 0v-9a2 2 0 0 1 2-2h2",key:"39pd36"}],["rect",{width:"8",height:"4",x:"10",y:"6",rx:"1",key:"aywv1n"}]],bd=Z("newspaper",Jg);/**
|
|
389
|
-
* @license lucide-react v1.
|
|
389
|
+
* @license lucide-react v1.7.0 - ISC
|
|
390
390
|
*
|
|
391
391
|
* This source code is licensed under the ISC license.
|
|
392
392
|
* See the LICENSE file in the root directory of this source tree.
|
|
393
393
|
*/const Qg=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],ef=Z("package",Qg);/**
|
|
394
|
-
* @license lucide-react v1.
|
|
394
|
+
* @license lucide-react v1.7.0 - ISC
|
|
395
395
|
*
|
|
396
396
|
* This source code is licensed under the ISC license.
|
|
397
397
|
* See the LICENSE file in the root directory of this source tree.
|
|
398
398
|
*/const tf=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],Fi=Z("panel-left",tf);/**
|
|
399
|
-
* @license lucide-react v1.
|
|
399
|
+
* @license lucide-react v1.7.0 - ISC
|
|
400
400
|
*
|
|
401
401
|
* This source code is licensed under the ISC license.
|
|
402
402
|
* See the LICENSE file in the root directory of this source tree.
|
|
403
403
|
*/const rf=[["path",{d:"M13 21h8",key:"1jsn5i"}],["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],nf=Z("pen-line",rf);/**
|
|
404
|
-
* @license lucide-react v1.
|
|
404
|
+
* @license lucide-react v1.7.0 - ISC
|
|
405
405
|
*
|
|
406
406
|
* This source code is licensed under the ISC license.
|
|
407
407
|
* See the LICENSE file in the root directory of this source tree.
|
|
408
408
|
*/const sf=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],lp=Z("pencil",sf);/**
|
|
409
|
-
* @license lucide-react v1.
|
|
409
|
+
* @license lucide-react v1.7.0 - ISC
|
|
410
410
|
*
|
|
411
411
|
* This source code is licensed under the ISC license.
|
|
412
412
|
* See the LICENSE file in the root directory of this source tree.
|
|
413
413
|
*/const af=[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z",key:"1nkz8b"}]],of=Z("pin",af);/**
|
|
414
|
-
* @license lucide-react v1.
|
|
414
|
+
* @license lucide-react v1.7.0 - ISC
|
|
415
415
|
*
|
|
416
416
|
* This source code is licensed under the ISC license.
|
|
417
417
|
* See the LICENSE file in the root directory of this source tree.
|
|
418
418
|
*/const lf=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],cf=Z("play",lf);/**
|
|
419
|
-
* @license lucide-react v1.
|
|
419
|
+
* @license lucide-react v1.7.0 - ISC
|
|
420
420
|
*
|
|
421
421
|
* This source code is licensed under the ISC license.
|
|
422
422
|
* See the LICENSE file in the root directory of this source tree.
|
|
423
423
|
*/const df=[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z",key:"1xoxul"}],["path",{d:"M9 8V2",key:"14iosj"}]],uf=Z("plug",df);/**
|
|
424
|
-
* @license lucide-react v1.
|
|
424
|
+
* @license lucide-react v1.7.0 - ISC
|
|
425
425
|
*
|
|
426
426
|
* This source code is licensed under the ISC license.
|
|
427
427
|
* See the LICENSE file in the root directory of this source tree.
|
|
428
428
|
*/const pf=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],ct=Z("plus",pf);/**
|
|
429
|
-
* @license lucide-react v1.
|
|
429
|
+
* @license lucide-react v1.7.0 - ISC
|
|
430
430
|
*
|
|
431
431
|
* This source code is licensed under the ISC license.
|
|
432
432
|
* See the LICENSE file in the root directory of this source tree.
|
|
433
433
|
*/const hf=[["path",{d:"M18.36 6.64A9 9 0 0 1 20.77 15",key:"dxknvb"}],["path",{d:"M6.16 6.16a9 9 0 1 0 12.68 12.68",key:"1x7qb5"}],["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],mf=Z("power-off",hf);/**
|
|
434
|
-
* @license lucide-react v1.
|
|
434
|
+
* @license lucide-react v1.7.0 - ISC
|
|
435
435
|
*
|
|
436
436
|
* This source code is licensed under the ISC license.
|
|
437
437
|
* See the LICENSE file in the root directory of this source tree.
|
|
438
438
|
*/const gf=[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]],cp=Z("power",gf);/**
|
|
439
|
-
* @license lucide-react v1.
|
|
439
|
+
* @license lucide-react v1.7.0 - ISC
|
|
440
440
|
*
|
|
441
441
|
* This source code is licensed under the ISC license.
|
|
442
442
|
* See the LICENSE file in the root directory of this source tree.
|
|
443
443
|
*/const ff=[["path",{d:"M16.247 7.761a6 6 0 0 1 0 8.478",key:"1fwjs5"}],["path",{d:"M19.075 4.933a10 10 0 0 1 0 14.134",key:"ehdyv1"}],["path",{d:"M4.925 19.067a10 10 0 0 1 0-14.134",key:"1q22gi"}],["path",{d:"M7.753 16.239a6 6 0 0 1 0-8.478",key:"r2q7qm"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]],sn=Z("radio",ff);/**
|
|
444
|
-
* @license lucide-react v1.
|
|
444
|
+
* @license lucide-react v1.7.0 - ISC
|
|
445
445
|
*
|
|
446
446
|
* This source code is licensed under the ISC license.
|
|
447
447
|
* See the LICENSE file in the root directory of this source tree.
|
|
448
448
|
*/const bf=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],We=Z("refresh-cw",bf);/**
|
|
449
|
-
* @license lucide-react v1.
|
|
449
|
+
* @license lucide-react v1.7.0 - ISC
|
|
450
450
|
*
|
|
451
451
|
* This source code is licensed under the ISC license.
|
|
452
452
|
* See the LICENSE file in the root directory of this source tree.
|
|
453
453
|
*/const yf=[["path",{d:"m17 2 4 4-4 4",key:"nntrym"}],["path",{d:"M3 11v-1a4 4 0 0 1 4-4h14",key:"84bu3i"}],["path",{d:"m7 22-4-4 4-4",key:"1wqhfi"}],["path",{d:"M21 13v1a4 4 0 0 1-4 4H3",key:"1rx37r"}]],xf=Z("repeat",yf);/**
|
|
454
|
-
* @license lucide-react v1.
|
|
454
|
+
* @license lucide-react v1.7.0 - ISC
|
|
455
455
|
*
|
|
456
456
|
* This source code is licensed under the ISC license.
|
|
457
457
|
* See the LICENSE file in the root directory of this source tree.
|
|
458
458
|
*/const vf=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],di=Z("rotate-ccw",vf);/**
|
|
459
|
-
* @license lucide-react v1.
|
|
459
|
+
* @license lucide-react v1.7.0 - ISC
|
|
460
460
|
*
|
|
461
461
|
* This source code is licensed under the ISC license.
|
|
462
462
|
* See the LICENSE file in the root directory of this source tree.
|
|
463
463
|
*/const _f=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 12h18",key:"1i2n21"}]],Sf=Z("rows-2",_f);/**
|
|
464
|
-
* @license lucide-react v1.
|
|
464
|
+
* @license lucide-react v1.7.0 - ISC
|
|
465
465
|
*
|
|
466
466
|
* This source code is licensed under the ISC license.
|
|
467
467
|
* See the LICENSE file in the root directory of this source tree.
|
|
468
468
|
*/const kf=[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}]],wf=Z("scan",kf);/**
|
|
469
|
-
* @license lucide-react v1.
|
|
469
|
+
* @license lucide-react v1.7.0 - ISC
|
|
470
470
|
*
|
|
471
471
|
* This source code is licensed under the ISC license.
|
|
472
472
|
* See the LICENSE file in the root directory of this source tree.
|
|
473
473
|
*/const Ef=[["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M8.12 8.12 12 12",key:"1alkpv"}],["path",{d:"M20 4 8.12 15.88",key:"xgtan2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M14.8 14.8 20 20",key:"ptml3r"}]],Cf=Z("scissors",Ef);/**
|
|
474
|
-
* @license lucide-react v1.
|
|
474
|
+
* @license lucide-react v1.7.0 - ISC
|
|
475
475
|
*
|
|
476
476
|
* This source code is licensed under the ISC license.
|
|
477
477
|
* See the LICENSE file in the root directory of this source tree.
|
|
478
478
|
*/const Tf=[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]],Nf=Z("scroll-text",Tf);/**
|
|
479
|
-
* @license lucide-react v1.
|
|
479
|
+
* @license lucide-react v1.7.0 - ISC
|
|
480
480
|
*
|
|
481
481
|
* This source code is licensed under the ISC license.
|
|
482
482
|
* See the LICENSE file in the root directory of this source tree.
|
|
483
483
|
*/const Af=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],tt=Z("search",Af);/**
|
|
484
|
-
* @license lucide-react v1.
|
|
484
|
+
* @license lucide-react v1.7.0 - ISC
|
|
485
485
|
*
|
|
486
486
|
* This source code is licensed under the ISC license.
|
|
487
487
|
* See the LICENSE file in the root directory of this source tree.
|
|
488
488
|
*/const If=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],Rf=Z("send",If);/**
|
|
489
|
-
* @license lucide-react v1.
|
|
489
|
+
* @license lucide-react v1.7.0 - ISC
|
|
490
490
|
*
|
|
491
491
|
* This source code is licensed under the ISC license.
|
|
492
492
|
* See the LICENSE file in the root directory of this source tree.
|
|
493
493
|
*/const Lf=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],an=Z("server",Lf);/**
|
|
494
|
-
* @license lucide-react v1.
|
|
494
|
+
* @license lucide-react v1.7.0 - ISC
|
|
495
495
|
*
|
|
496
496
|
* This source code is licensed under the ISC license.
|
|
497
497
|
* See the LICENSE file in the root directory of this source tree.
|
|
498
498
|
*/const Df=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],Bi=Z("settings-2",Df);/**
|
|
499
|
-
* @license lucide-react v1.
|
|
499
|
+
* @license lucide-react v1.7.0 - ISC
|
|
500
500
|
*
|
|
501
501
|
* This source code is licensed under the ISC license.
|
|
502
502
|
* See the LICENSE file in the root directory of this source tree.
|
|
503
503
|
*/const Of=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],$f=Z("settings",Of);/**
|
|
504
|
-
* @license lucide-react v1.
|
|
504
|
+
* @license lucide-react v1.7.0 - ISC
|
|
505
505
|
*
|
|
506
506
|
* This source code is licensed under the ISC license.
|
|
507
507
|
* See the LICENSE file in the root directory of this source tree.
|
|
508
508
|
*/const jf=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],dp=Z("sparkles",jf);/**
|
|
509
|
-
* @license lucide-react v1.
|
|
509
|
+
* @license lucide-react v1.7.0 - ISC
|
|
510
510
|
*
|
|
511
511
|
* This source code is licensed under the ISC license.
|
|
512
512
|
* See the LICENSE file in the root directory of this source tree.
|
|
513
513
|
*/const Mf=[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]],yn=Z("square-terminal",Mf);/**
|
|
514
|
-
* @license lucide-react v1.
|
|
514
|
+
* @license lucide-react v1.7.0 - ISC
|
|
515
515
|
*
|
|
516
516
|
* This source code is licensed under the ISC license.
|
|
517
517
|
* See the LICENSE file in the root directory of this source tree.
|
|
518
518
|
*/const Pf=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],up=Z("square",Pf);/**
|
|
519
|
-
* @license lucide-react v1.
|
|
519
|
+
* @license lucide-react v1.7.0 - ISC
|
|
520
520
|
*
|
|
521
521
|
* This source code is licensed under the ISC license.
|
|
522
522
|
* See the LICENSE file in the root directory of this source tree.
|
|
523
523
|
*/const Ff=[["path",{d:"M15 21v-5a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v5",key:"slp6dd"}],["path",{d:"M17.774 10.31a1.12 1.12 0 0 0-1.549 0 2.5 2.5 0 0 1-3.451 0 1.12 1.12 0 0 0-1.548 0 2.5 2.5 0 0 1-3.452 0 1.12 1.12 0 0 0-1.549 0 2.5 2.5 0 0 1-3.77-3.248l2.889-4.184A2 2 0 0 1 7 2h10a2 2 0 0 1 1.653.873l2.895 4.192a2.5 2.5 0 0 1-3.774 3.244",key:"o0xfot"}],["path",{d:"M4 10.95V19a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8.05",key:"wn3emo"}]],vr=Z("store",Ff);/**
|
|
524
|
-
* @license lucide-react v1.
|
|
524
|
+
* @license lucide-react v1.7.0 - ISC
|
|
525
525
|
*
|
|
526
526
|
* This source code is licensed under the ISC license.
|
|
527
527
|
* See the LICENSE file in the root directory of this source tree.
|
|
528
528
|
*/const Bf=[["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M14.837 16.385a6 6 0 1 1-7.223-7.222c.624-.147.97.66.715 1.248a4 4 0 0 0 5.26 5.259c.589-.255 1.396.09 1.248.715",key:"xlf6rm"}],["path",{d:"M16 12a4 4 0 0 0-4-4",key:"6vsxu"}],["path",{d:"m19 5-1.256 1.256",key:"1yg6a6"}],["path",{d:"M20 12h2",key:"1q8mjw"}]],Uf=Z("sun-moon",Bf);/**
|
|
529
|
-
* @license lucide-react v1.
|
|
529
|
+
* @license lucide-react v1.7.0 - ISC
|
|
530
530
|
*
|
|
531
531
|
* This source code is licensed under the ISC license.
|
|
532
532
|
* See the LICENSE file in the root directory of this source tree.
|
|
533
533
|
*/const zf=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],pp=Z("sun",zf);/**
|
|
534
|
-
* @license lucide-react v1.
|
|
534
|
+
* @license lucide-react v1.7.0 - ISC
|
|
535
535
|
*
|
|
536
536
|
* This source code is licensed under the ISC license.
|
|
537
537
|
* See the LICENSE file in the root directory of this source tree.
|
|
538
538
|
*/const Hf=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],Tr=Z("terminal",Hf);/**
|
|
539
|
-
* @license lucide-react v1.
|
|
539
|
+
* @license lucide-react v1.7.0 - ISC
|
|
540
540
|
*
|
|
541
541
|
* This source code is licensed under the ISC license.
|
|
542
542
|
* See the LICENSE file in the root directory of this source tree.
|
|
543
543
|
*/const Gf=[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]],hp=Z("timer",Gf);/**
|
|
544
|
-
* @license lucide-react v1.
|
|
544
|
+
* @license lucide-react v1.7.0 - ISC
|
|
545
545
|
*
|
|
546
546
|
* This source code is licensed under the ISC license.
|
|
547
547
|
* See the LICENSE file in the root directory of this source tree.
|
|
548
548
|
*/const Wf=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],sr=Z("trash-2",Wf);/**
|
|
549
|
-
* @license lucide-react v1.
|
|
549
|
+
* @license lucide-react v1.7.0 - ISC
|
|
550
550
|
*
|
|
551
551
|
* This source code is licensed under the ISC license.
|
|
552
552
|
* See the LICENSE file in the root directory of this source tree.
|
|
553
553
|
*/const qf=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],Vf=Z("trending-up",qf);/**
|
|
554
|
-
* @license lucide-react v1.
|
|
554
|
+
* @license lucide-react v1.7.0 - ISC
|
|
555
555
|
*
|
|
556
556
|
* This source code is licensed under the ISC license.
|
|
557
557
|
* See the LICENSE file in the root directory of this source tree.
|
|
558
558
|
*/const Kf=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],_r=Z("triangle-alert",Kf);/**
|
|
559
|
-
* @license lucide-react v1.
|
|
559
|
+
* @license lucide-react v1.7.0 - ISC
|
|
560
560
|
*
|
|
561
561
|
* This source code is licensed under the ISC license.
|
|
562
562
|
* See the LICENSE file in the root directory of this source tree.
|
|
563
563
|
*/const Yf=[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]],on=Z("undo-2",Yf);/**
|
|
564
|
-
* @license lucide-react v1.
|
|
564
|
+
* @license lucide-react v1.7.0 - ISC
|
|
565
565
|
*
|
|
566
566
|
* This source code is licensed under the ISC license.
|
|
567
567
|
* See the LICENSE file in the root directory of this source tree.
|
|
568
568
|
*/const Xf=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],mp=Z("users",Xf);/**
|
|
569
|
-
* @license lucide-react v1.
|
|
569
|
+
* @license lucide-react v1.7.0 - ISC
|
|
570
570
|
*
|
|
571
571
|
* This source code is licensed under the ISC license.
|
|
572
572
|
* See the LICENSE file in the root directory of this source tree.
|
|
573
573
|
*/const Zf=[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]],gp=Z("workflow",Zf);/**
|
|
574
|
-
* @license lucide-react v1.
|
|
574
|
+
* @license lucide-react v1.7.0 - ISC
|
|
575
575
|
*
|
|
576
576
|
* This source code is licensed under the ISC license.
|
|
577
577
|
* See the LICENSE file in the root directory of this source tree.
|
|
578
578
|
*/const Jf=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],we=Z("x",Jf);/**
|
|
579
|
-
* @license lucide-react v1.
|
|
579
|
+
* @license lucide-react v1.7.0 - ISC
|
|
580
580
|
*
|
|
581
581
|
* This source code is licensed under the ISC license.
|
|
582
582
|
* See the LICENSE file in the root directory of this source tree.
|
|
@@ -653,7 +653,7 @@ ${t("terminal.processExited")}\r
|
|
|
653
653
|
text-text-primary focus:outline-none focus:border-accent-brand min-w-[180px]`,children:[n.jsx("option",{value:"",children:e("logs.selectWorker")}),i.map(_=>n.jsxs("option",{value:_.pid,children:["PID ",_.pid," — ",_.name||_.kind,_.isCurrent?` (${e("logs.current")})`:""]},_.pid))]}),a.length>0&&n.jsx("div",{className:"flex items-center gap-0.5 bg-bg-tertiary rounded-lg p-0.5",children:a.map(_=>{var S;return n.jsx("button",{onClick:()=>u(_),className:`px-2.5 py-1 text-[11px] font-medium rounded-md transition-colors ${_===d?"bg-bg-primary text-text-primary shadow-sm":"text-text-tertiary hover:text-text-secondary"}`,children:((S=IS[_])==null?void 0:S[t])||_},_)})}),n.jsx("div",{className:"flex-1"}),n.jsxs("div",{className:"relative",children:[n.jsx(tt,{size:13,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-text-tertiary"}),n.jsx("input",{type:"text",value:b,onChange:_=>x(_.target.value),placeholder:e("logs.search"),className:`pl-7 pr-7 py-1.5 text-xs rounded-lg border border-border-primary bg-bg-secondary
|
|
654
654
|
text-text-primary placeholder:text-text-tertiary focus:outline-none focus:border-accent-brand w-[180px]`}),b&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"absolute right-8 top-1/2 -translate-y-1/2 text-[10px] text-text-tertiary",children:y}),n.jsx("button",{onClick:()=>x(""),className:"absolute right-2 top-1/2 -translate-y-1/2 text-text-tertiary hover:text-text-primary",children:n.jsx(we,{size:12})})]})]}),n.jsxs("button",{onClick:()=>v(!k),className:`flex items-center gap-1 px-2.5 py-1.5 text-xs rounded-lg border transition-colors ${k?"border-accent-brand/40 bg-accent-brand/10 text-accent-brand":"border-border-primary text-text-secondary hover:text-text-primary"}`,title:e("logs.autoRefresh"),children:[n.jsx(We,{size:12,className:k?"animate-spin":""}),e("logs.autoRefresh")]}),n.jsx("button",{onClick:m,className:"p-1.5 rounded-lg text-text-tertiary hover:text-text-primary hover:bg-bg-hover transition-colors",title:e("logs.refresh"),children:n.jsx(We,{size:14})})]}),E&&n.jsxs("div",{className:"flex items-center gap-3 mt-2 text-[11px] text-text-tertiary",children:[o&&n.jsx(Et,{path:o,className:"font-mono truncate max-w-[400px]"}),E.url&&n.jsx("a",{href:E.url,target:"_blank",rel:"noopener noreferrer",className:"text-accent-brand hover:underline",children:E.url})]})]}),n.jsx("div",{className:"flex-1 overflow-auto bg-bg-primary",children:p?!l&&a.length===0?n.jsx("div",{className:"flex items-center justify-center h-full text-text-tertiary text-sm",children:e("logs.empty")}):b?n.jsx("div",{ref:h,className:"p-4 font-mono text-xs leading-5 min-h-full",children:f?f.split(`
|
|
655
655
|
`).map((_,S)=>n.jsx($S,{line:_,searchText:b},S)):n.jsx("span",{className:"text-text-tertiary",children:e("logs.empty")})}):n.jsx("div",{ref:h,className:"min-h-full",children:n.jsx(NS,{language:"log",style:r==="dark"?An:In,showLineNumbers:!0,wrapLongLines:!0,customStyle:{margin:0,padding:"16px",border:"none",background:"transparent",fontSize:"12px",lineHeight:"1.5"},codeTagProps:{style:{background:"transparent",textShadow:"none"}},lineNumberStyle:{minWidth:"3em",paddingRight:"1em",color:"var(--color-text-tertiary)",userSelect:"none"},children:l||e("logs.empty")})}):n.jsx("div",{className:"flex items-center justify-center h-full text-text-tertiary text-sm",children:e("logs.selectWorker")})})]})}const LS={ERROR:"text-red-500 dark:text-red-400",WARN:"text-amber-600 dark:text-amber-400",INFO:"text-blue-500 dark:text-blue-400",DEBUG:"text-text-tertiary"},DS={ERROR:"bg-red-50/50 dark:bg-red-900/10",WARN:"bg-amber-50/50 dark:bg-amber-900/10"},OS=/^\[(\w+)\]\s/;function $S({line:e,searchText:t}){var o;if(!e.trim())return n.jsx("div",{className:"h-5"});const r=e.match(OS),i=((o=r==null?void 0:r[1])==null?void 0:o.toUpperCase())||"",s=LS[i]||"text-text-secondary",l=DS[i]||"",a=t&&e.toLowerCase().includes(t.toLowerCase())?"bg-yellow-100/60 dark:bg-yellow-900/20":"";return n.jsx("div",{className:`whitespace-pre-wrap break-all px-2 py-px rounded-sm ${l} ${a}`,children:r?n.jsxs(n.Fragment,{children:[n.jsxs("span",{className:`font-semibold ${s}`,children:["[",r[1],"]"]}),n.jsx("span",{className:"text-text-secondary",children:Eu(e.slice(r[0].length),t)})]}):n.jsx("span",{className:"text-text-secondary",children:Eu(e,t)})})}function Eu(e,t){if(!t)return e;const r=e.toLowerCase(),i=t.toLowerCase(),s=[];let l=0,d=r.indexOf(i);for(;d!==-1;)d>l&&s.push(e.slice(l,d)),s.push(n.jsx("mark",{className:"bg-yellow-300 dark:bg-yellow-700 text-text-primary rounded-sm px-px",children:e.slice(d,d+t.length)},d)),l=d+t.length,d=r.indexOf(i,l);return l<e.length&&s.push(e.slice(l)),s.length>0?n.jsx(n.Fragment,{children:s}):e}const jS=8e3,MS=Ce((e,t)=>({metrics:null,loading:!1,error:null,_pollTimer:null,fetchMetrics:async()=>{e({loading:!t().metrics,error:null});try{const r=await ge("/api/v1/metrics",{headers:ce()});if(!r.ok)throw new Error(`Failed to fetch metrics: ${r.status}`);const i=await r.json();e({metrics:i.data,loading:!1})}catch(r){e({error:r.message,loading:!1})}},startPolling:(r=jS)=>{const{stopPolling:i,fetchMetrics:s}=t();i(),s();const l=setInterval(s,r);e({_pollTimer:l})},stopPolling:()=>{const{_pollTimer:r}=t();r&&(clearInterval(r),e({_pollTimer:null}))}})),PS={interactive:"bg-blue-50 text-blue-700 border border-blue-200 dark:bg-blue-500/10 dark:text-blue-400 dark:border-blue-500/20",bg:"bg-purple-50 text-purple-700 border border-purple-200 dark:bg-purple-500/10 dark:text-purple-400 dark:border-purple-500/20",daemon:"bg-green-50 text-green-700 border border-green-200 dark:bg-green-500/10 dark:text-green-400 dark:border-green-500/20","daemon-worker":"bg-orange-50 text-orange-700 border border-orange-200 dark:bg-orange-500/10 dark:text-orange-400 dark:border-orange-500/20"};function FS(){const{t:e}=re(),{metrics:t,loading:r,error:i,fetchMetrics:s,startPolling:l,stopPolling:d}=MS(),{workers:a,fetchWorkers:o}=Rn();if(C.useEffect(()=>(l(8e3),o(),()=>d()),[l,d,o]),r&&!t)return n.jsx("div",{className:"flex-1 flex items-center justify-center",children:n.jsx(st,{size:"large",text:e("metrics.loading")})});if(i&&!t)return n.jsx("div",{className:"flex-1 flex items-center justify-center",children:n.jsxs("div",{className:"text-center",children:[n.jsx("div",{className:"text-text-secondary mb-4",children:i}),n.jsx("button",{onClick:s,className:"px-4 py-2 bg-accent-brand text-white rounded-lg text-sm",children:e("metrics.refresh")})]})});const c=BS((t==null?void 0:t.instances)||[],a);return n.jsxs("div",{className:"flex-1 overflow-auto p-4 md:p-6",children:[n.jsxs("div",{className:"flex items-center justify-between mb-6",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(Di,{size:20,className:"text-accent-brand"}),n.jsx("h1",{className:"text-lg font-semibold text-text-primary",children:e("metrics.title")})]}),n.jsxs("button",{onClick:()=>{s(),o()},className:`flex items-center gap-1.5 px-3 py-1.5 text-sm text-text-secondary
|
|
656
|
-
hover:text-text-primary hover:bg-bg-hover rounded-lg transition-colors`,title:e("metrics.refresh"),children:[n.jsx(We,{size:14}),n.jsx("span",{children:e("metrics.refresh")})]})]}),t&&n.jsxs(n.Fragment,{children:[n.jsx(US,{metrics:t}),n.jsx(zS,{workers:c})]})]})}function BS(e,t){return e.map(r=>{const i=t.find(s=>s.pid===r.pid);return{...r,kind:i==null?void 0:i.kind,name:i==null?void 0:i.name,url:(i==null?void 0:i.url)||(i==null?void 0:i.endpoint),status:i==null?void 0:i.status}})}function US({metrics:e}){const{t}=re(),r=e.memTotalMib>0?e.memUsedMib/e.memTotalMib*100:0,i=e.diskTotal>0?e.diskUsed/e.diskTotal*100:0;return n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 mb-6",children:[n.jsx(ri,{icon:n.jsx(Ft,{size:18}),label:t("metrics.cpu"),value:`${e.cpuUsedPct.toFixed(1)}%`,subtext:`${e.cpuCount} ${t("metrics.cores")}`,percent:e.cpuUsedPct,colorClasses:en(e.cpuUsedPct)}),n.jsx(ri,{icon:n.jsx(ci,{size:18}),label:t("metrics.memory"),value:`${Cu(e.memUsedMib)} / ${Cu(e.memTotalMib)}`,subtext:`${r.toFixed(1)}%`,percent:r,colorClasses:en(r)}),n.jsx(ri,{icon:n.jsx(vg,{size:18}),label:t("metrics.disk"),value:`${Tu(e.diskUsed)} / ${Tu(e.diskTotal)}`,subtext:`${i.toFixed(1)}%`,percent:i,colorClasses:en(i)})]})}function ri({icon:e,label:t,value:r,subtext:i,percent:s,colorClasses:l}){const[d,a]=l;return n.jsxs("div",{className:"bg-bg-secondary rounded-xl p-4 border border-border-primary",children:[n.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[n.jsx("span",{className:d,children:e}),n.jsx("span",{className:"text-sm font-medium text-text-secondary",children:t})]}),n.jsx("div",{className:"text-xl font-semibold text-text-primary mb-1",children:r}),n.jsx("div",{className:"text-xs text-text-tertiary mb-3",children:i}),n.jsx("div",{className:"h-2 bg-bg-tertiary rounded-full overflow-hidden",children:n.jsx("div",{className:`h-full rounded-full transition-all duration-500 ${a}`,style:{width:`${Math.min(s,100)}%`}})})]})}function zS({workers:e}){const{t}=re();return e.length===0?n.jsx("div",{className:"text-center py-12 text-text-tertiary",children:t("metrics.noWorkers")}):n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[n.jsx(Ft,{size:18,className:"text-text-secondary"}),n.jsxs("h2",{className:"text-base font-medium text-text-primary",children:["Workers (",e.length,")"]})]}),n.jsx("div",{className:"space-y-3",children:e.map(r=>n.jsx(HS,{worker:r},r.id))})]})}function HS({worker:e}){const{t}=re();return n.jsx("div",{className:`bg-bg-secondary rounded-xl p-4 md:p-5 border transition-colors hover:border-gray-300 dark:hover:border-gray-600 border-border-primary ${e.error?"opacity-60":""}`,children:n.jsxs("div",{className:"flex flex-col gap-4",children:[n.jsxs("div",{className:"flex items-start justify-between",children:[n.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[n.jsx("span",{className:`inline-block w-2 h-2 rounded-full ${e.error?"bg-red-400":"bg-green-400"}`}),e.kind&&n.jsx("span",{className:`inline-block px-2.5 py-0.5 text-xs font-medium rounded-md ${PS[e.kind]||"bg-gray-100 text-gray-600"}`,children:e.kind}),n.jsx("span",{className:"text-sm font-medium text-text-primary",children:e.name||e.hostname}),e.isCurrent&&n.jsx("span",{className:"text-[10px] uppercase font-bold tracking-wider px-1.5 py-0.5 bg-accent-brand/10 text-accent-brand rounded",children:t("metrics.current")}),e.error&&n.jsx("span",{className:"text-xs text-red-400",children:e.error})]}),n.jsxs("span",{className:"text-xs text-text-tertiary font-mono bg-bg-tertiary px-2 py-0.5 rounded-md border border-border-primary/50",children:["PID ",e.pid]})]}),n.jsxs("div",{className:"flex flex-col md:flex-row md:items-start justify-between gap-4 md:gap-6",children:[n.jsxs("div",{className:"flex flex-col gap-2.5 flex-1 min-w-0",children:[n.jsx(Et,{path:e.cwd,displayMode:"basename",className:"text-[13px] text-text-secondary font-mono truncate max-w-full"}),e.url&&n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx(gt,{size:14,className:"text-text-tertiary flex-none"}),n.jsx("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"text-sm text-accent-brand hover:underline truncate",children:e.url})]})]}),e.rssMib>0||e.heapUsedMib>0?n.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 flex-none",style:{minWidth:"460px"},children:[n.jsxs("div",{className:"min-w-[100px]",children:[n.jsx(Gt,{icon:n.jsx(ci,{size:14}),label:"RSS",value:`${e.rssMib.toFixed(0)} MiB`}),n.jsx("div",{className:"mt-1.5 h-1.5 bg-bg-tertiary rounded-full overflow-hidden",children:n.jsx("div",{className:"h-full rounded-full bg-blue-500 transition-all duration-500",style:{width:`${Math.min(e.rssMib/2048*100,100)}%`}})})]}),n.jsxs("div",{className:"min-w-[140px]",children:[n.jsx(Gt,{icon:n.jsx(ci,{size:14}),label:"Heap",value:`${e.heapUsedMib.toFixed(0)} / ${e.heapTotalMib.toFixed(0)} MiB`}),e.heapTotalMib>0&&n.jsx("div",{className:"mt-1.5 h-1.5 bg-bg-tertiary rounded-full overflow-hidden",children:n.jsx("div",{className:`h-full rounded-full transition-all duration-500 ${en(e.heapUsedMib/e.heapTotalMib*100)[1]}`,style:{width:`${Math.min(e.heapUsedMib/e.heapTotalMib*100,100)}%`}})})]}),n.jsx("div",{className:"min-w-[80px]",children:n.jsx(Gt,{icon:n.jsx(kt,{size:14}),label:t("metrics.uptime"),value:Nu(e.uptimeSeconds)})}),n.jsx("div",{className:"min-w-[60px]",children:n.jsx(Gt,{icon:n.jsx(an,{size:14}),label:t("metrics.version"),value:e.version||"-"})})]}):n.jsxs("div",{className:"grid grid-cols-2 gap-4 flex-none",style:{minWidth:"200px"},children:[n.jsx("div",{className:"min-w-[80px]",children:n.jsx(Gt,{icon:n.jsx(kt,{size:14}),label:t("metrics.uptime"),value:Nu(e.uptimeSeconds)})}),n.jsx("div",{className:"min-w-[60px]",children:n.jsx(Gt,{icon:n.jsx(an,{size:14}),label:t("metrics.version"),value:e.version||"-"})})]})]})]})})}function Gt({icon:e,label:t,value:r}){return n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsxs("div",{className:"flex items-center gap-1.5 text-text-tertiary",children:[e,n.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wider",children:t})]}),n.jsx("div",{className:"text-sm font-semibold text-text-primary",style:{fontVariantNumeric:"tabular-nums"},children:r})]})}function en(e){return e>=90?["text-red-500","bg-red-500"]:e>=70?["text-amber-500","bg-amber-500"]:["text-green-500","bg-green-500"]}function Cu(e){return e>=1024?`${(e/1024).toFixed(1)} GiB`:`${e} MiB`}function Tu(e){if(e===0)return"0 B";const t=e/(1024*1024*1024);return t>=1?`${t.toFixed(1)} GB`:`${(e/(1024*1024)).toFixed(0)} MB`}function Nu(e){if(e<60)return`${e}s`;if(e<3600)return`${Math.floor(e/60)}m ${e%60}s`;const t=Math.floor(e/3600),r=Math.floor(e%3600/60);return t>=24?`${Math.floor(t/24)}d ${t%24}h`:`${t}h ${r}m`}function GS({onNavigate:e}){const{t}=re(),[r,i]=C.useState(dn);if(C.useEffect(()=>{const s=()=>i(dn());return window.addEventListener("hashchange",s),()=>window.removeEventListener("hashchange",s)},[]),r==="add-wechat"||r!=null&&r.startsWith("rebind-wechat/")){const s=r!=null&&r.startsWith("rebind-wechat/")?r.split("/")[1]:void 0;return n.jsx(qS,{onBack:()=>Pd("remote-control"),t,existingInstanceId:s})}return r==="add-wecom"?n.jsx(VS,{onBack:()=>Pd("remote-control"),t}):n.jsx(WS,{onNavigate:e,t})}function WS({onNavigate:e,t}){const[r,i]=C.useState([]),[s,l]=C.useState(!0),[d,a]=C.useState(null),[o,c]=C.useState(null),p=C.useCallback(async()=>{try{const _=await ge("/api/v1/channels");if(_.ok){const S=await _.json();i((S.clients||[]).filter(w=>!w.hidden&&!w.instanceId.startsWith("_pending")))}}catch{}finally{l(!1)}},[]);C.useEffect(()=>{p();const _=setInterval(p,5e3);return()=>clearInterval(_)},[p]);const g=C.useCallback(async(_,S,w)=>{const N=`${S}:${w}:${_}`;c(N),a(null);try{const L=_==="delete"?"DELETE":"POST",I=_==="delete"?`/api/v1/channels/${S}/${w}`:`/api/v1/channels/${S}/${w}/${_}`,$=await ge(I,{method:L});if(!$.ok){const B=await $.json().catch(()=>({}));throw new Error(B.error||`Failed: ${$.status}`)}const A=await $.json().catch(()=>({}));if(_==="unbind"&&S==="wechat"&&A.needsQrScan){gr("remote-control",`rebind-wechat/${w}`);return}await p()}catch(L){a((L==null?void 0:L.message)||"Action failed")}finally{c(null)}},[p]),b=_=>_==="connected"?"text-green-500":_==="connecting"?"text-yellow-500":_==="error"?"text-red-500":"text-text-tertiary",x=_=>t(_==="connected"?"remoteControl.connected":_==="connecting"?"remoteControl.connecting":"remoteControl.disconnected"),k=_=>_==="wechat"?n.jsx(sp,{size:18,className:"text-green-500"}):_==="wecom"?n.jsx(sn,{size:18,className:"text-accent-brand"}):n.jsx(fd,{size:18,className:"text-text-tertiary"}),v=_=>_==="wechat"?t("channel.wechat")+t("remoteControl.bot"):_==="wecom"?t("channel.wecom")+t("remoteControl.bot"):_,h=_=>`${v(_.clientType)} #${_.instanceId.slice(0,4)}`,m=r.filter(_=>_.clientType==="wechat"),u=r.filter(_=>_.clientType==="wecom"),f=r.filter(_=>_.clientType!=="wechat"&&_.clientType!=="wecom"),y=_=>{const S=`${_.clientType}:${_.instanceId}`,w=_.status==="connected",N=o==null?void 0:o.startsWith(S);return n.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-bg-secondary hover:bg-bg-hover transition-colors cursor-pointer",onClick:()=>{N||g(w?"stop":"start",_.clientType,_.instanceId)},children:[k(_.clientType),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsx("div",{className:"text-sm font-medium text-text-primary truncate",children:h(_)}),n.jsx("span",{className:`text-xs ${b(_.status)}`,children:x(_.status)})]}),n.jsxs("div",{className:"flex items-center gap-1",onClick:L=>L.stopPropagation(),children:[n.jsx("button",{className:`p-1.5 rounded-md text-text-tertiary transition-colors ${w?"hover:text-orange-500":"hover:text-green-500"} hover:bg-bg-hover`,title:t(w?"remoteControl.disconnect":"remoteControl.connect"),disabled:!!N,onClick:()=>g(w?"stop":"start",_.clientType,_.instanceId),children:w?n.jsx(fd,{size:14}):n.jsx($g,{size:14})}),w&&n.jsx("button",{className:"p-1.5 rounded-md text-text-tertiary hover:text-orange-500 hover:bg-bg-hover transition-colors",title:t("remoteControl.unbind"),disabled:!!N,onClick:()=>g("unbind",_.clientType,_.instanceId),children:n.jsx(We,{size:14})}),n.jsx("button",{className:"p-1.5 rounded-md text-text-tertiary hover:text-red-500 hover:bg-bg-hover transition-colors",title:t("remoteControl.delete"),disabled:!!N,onClick:()=>g("delete",_.clientType,_.instanceId),children:n.jsx(sr,{size:14})})]})]},S)},E=(_,S,w,N)=>n.jsxs("div",{children:[n.jsx("h2",{className:"text-sm font-medium text-text-secondary mb-2",children:_}),S.length===0?n.jsx("div",{className:"py-4 text-center text-xs text-text-tertiary",children:t("remoteControl.noChannels")}):n.jsx("div",{className:"space-y-2",children:S.map(y)}),w&&n.jsxs("button",{className:"flex items-center gap-1.5 mt-2 px-3 py-1.5 text-xs text-text-tertiary hover:text-text-primary hover:bg-bg-hover rounded-md transition-colors",onClick:w,children:[n.jsx(ct,{size:12}),N||t("remoteControl.add")]})]});return n.jsxs("div",{className:"flex flex-col h-full overflow-y-auto",children:[n.jsxs("div",{className:"px-6 py-5 border-b border-border-primary",children:[n.jsx("h1",{className:"text-lg font-semibold text-text-primary",children:t("remoteControl.title")}),n.jsx("p",{className:"text-sm text-text-tertiary mt-1",children:t("remoteControl.subtitle")})]}),n.jsxs("div",{className:"px-6 py-4 flex-1 space-y-6",children:[d&&n.jsx("div",{className:"p-3 rounded-lg bg-red-500/10 text-red-500 text-sm",children:d}),s?n.jsx("div",{className:"text-sm text-text-tertiary py-4",children:t("remoteControl.connecting")}):r.length===0?n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"py-8 text-center",children:[n.jsx(sn,{size:32,className:"mx-auto mb-3 text-text-tertiary opacity-50"}),n.jsx("p",{className:"text-sm text-text-tertiary",children:t("remoteControl.noChannels")}),n.jsx("p",{className:"text-xs text-text-tertiary mt-1",children:t("remoteControl.noChannelsHint")})]}),n.jsxs("div",{className:"flex gap-3",children:[n.jsxs("button",{className:"flex items-center gap-2 px-4 py-2 rounded-lg bg-bg-secondary hover:bg-bg-hover text-sm text-text-primary transition-colors border border-border-primary",onClick:()=>gr("remote-control","add-wechat"),children:[n.jsx(ct,{size:14}),t("remoteControl.addWeChat")]}),n.jsxs("button",{className:"flex items-center gap-2 px-4 py-2 rounded-lg bg-bg-secondary hover:bg-bg-hover text-sm text-text-primary transition-colors border border-border-primary",onClick:()=>gr("remote-control","add-wecom"),children:[n.jsx(ct,{size:14}),t("remoteControl.addWeCom")]})]})]}):n.jsxs(n.Fragment,{children:[E(t("channel.wechat")+t("remoteControl.bot"),m,()=>gr("remote-control","add-wechat"),t("remoteControl.addWeChat")),E(t("channel.wecom")+t("remoteControl.bot"),u,()=>gr("remote-control","add-wecom"),t("remoteControl.addWeCom")),f.length>0&&E(t("remoteControl.plugin"),f)]}),n.jsx("hr",{className:"border-border-primary"}),n.jsxs("div",{className:"flex items-center gap-4 p-4 rounded-lg bg-bg-secondary hover:bg-bg-hover cursor-pointer transition-colors border border-border-primary",onClick:()=>{e?e("plugins"):window.location.hash="#/plugins"},children:[n.jsxs("div",{className:"flex-1",children:[n.jsx("h3",{className:"text-sm font-medium text-text-primary",children:t("remoteControl.installMore")}),n.jsx("p",{className:"text-xs text-text-tertiary mt-1",children:t("remoteControl.installMoreHint")})]}),n.jsx(bm,{size:16,className:"text-text-tertiary"})]})]})]})}function qS({onBack:e,t,existingInstanceId:r}){const[i,s]=C.useState(null),[l,d]=C.useState(t("remoteControl.fetchingQr")),[a,o]=C.useState(r??null),[c,p]=C.useState(null),[g,b]=C.useState(!1);return C.useEffect(()=>{let x=!1;return(async()=>{try{let k=r;if(!k){const v=await ge("/api/v1/channels/wechat",{method:"POST"});if(!v.ok)throw new Error((await v.json().catch(()=>({}))).error||"Failed");const h=await v.json();if(x)return;k=h.instanceId,o(k)}for(let v=0;v<180&&!x;v++){await new Promise(h=>setTimeout(h,1e3));try{const h=await fetch(`/api/v1/channels/wechat/${k}/qr`);if(!h.ok)continue;const m=await h.json();if(x)return;if(m.qrUrl&&s(m.qrUrl),m.message&&d(m.message),m.type==="confirmed"){b(!0),d(t("remoteControl.connected")),setTimeout(()=>{x||e()},1500);return}if(m.type==="error"){p(m.message);return}}catch{}}!x&&!g&&p("Timeout")}catch(k){x||p((k==null?void 0:k.message)||"Failed")}})(),()=>{x=!0}},[r]),n.jsxs("div",{className:"flex flex-col h-full overflow-y-auto",children:[n.jsxs("div",{className:"px-6 py-5 border-b border-border-primary flex items-center gap-3",children:[n.jsx("button",{onClick:e,className:"p-1 rounded-md hover:bg-bg-hover transition-colors",children:n.jsx(nr,{size:18})}),n.jsxs("div",{children:[n.jsx("h1",{className:"text-lg font-semibold text-text-primary",children:t("remoteControl.addWeChat")}),n.jsx("p",{className:"text-sm text-text-tertiary",children:t("remoteControl.scanQr")})]})]}),n.jsx("div",{className:"flex-1 flex flex-col items-center justify-center px-6 py-8",children:c?n.jsxs("div",{className:"text-center space-y-4",children:[n.jsx("p",{className:"text-red-500",children:c}),n.jsx("button",{onClick:e,className:"px-4 py-2 rounded-lg bg-bg-secondary hover:bg-bg-hover text-sm border border-border-primary",children:t("remoteControl.cancel")})]}):i?n.jsxs("div",{className:"text-center space-y-4",children:[n.jsx("div",{className:"inline-block p-4 bg-white rounded-xl",children:n.jsx("img",{src:`https://api.qrserver.com/v1/create-qr-code/?size=240x240&data=${encodeURIComponent(i)}`,alt:"QR Code",className:"w-60 h-60"})}),n.jsx("p",{className:"text-sm text-text-secondary",children:l})]}):n.jsxs("div",{className:"text-center space-y-3",children:[n.jsx("div",{className:"w-8 h-8 mx-auto border-2 border-accent-brand border-t-transparent rounded-full animate-spin"}),n.jsx("p",{className:"text-sm text-text-tertiary",children:l})]})})]})}function VS({onBack:e,t}){const[r,i]=C.useState(""),[s,l]=C.useState(""),[d,a]=C.useState("botId"),[o,c]=C.useState(!1),[p,g]=C.useState(null),b=C.useCallback(async()=>{if(!(!r.trim()||!s.trim())){c(!0),g(null);try{const x=await ge("/api/v1/channels/wecom",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({botId:r.trim(),secret:s.trim()})});if(!x.ok){const k=await x.json().catch(()=>({}));throw new Error(k.error||"Failed")}e()}catch(x){g((x==null?void 0:x.message)||"Failed")}finally{c(!1)}}},[r,s,e]);return n.jsxs("div",{className:"flex flex-col h-full overflow-y-auto",children:[n.jsxs("div",{className:"px-6 py-5 border-b border-border-primary flex items-center gap-3",children:[n.jsx("button",{onClick:e,className:"p-1 rounded-md hover:bg-bg-hover transition-colors",children:n.jsx(nr,{size:18})}),n.jsxs("div",{children:[n.jsx("h1",{className:"text-lg font-semibold text-text-primary",children:t("remoteControl.addWeCom")}),n.jsx("p",{className:"text-sm text-text-tertiary",children:t("remoteControl.wecomBotIdHint")})]})]}),n.jsxs("div",{className:"px-6 py-8 max-w-md mx-auto w-full space-y-6",children:[p&&n.jsx("div",{className:"p-3 rounded-lg bg-red-500/10 text-red-500 text-sm",children:p}),n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{className:"text-sm font-medium text-text-primary",children:"Bot ID"}),n.jsx("input",{type:"text",className:"w-full px-3 py-2 rounded-lg bg-bg-secondary border border-border-primary text-sm text-text-primary placeholder-text-tertiary focus:outline-none focus:border-accent-brand transition-colors",placeholder:t("channel.botIdPlaceholder"),value:r,onChange:x=>i(x.target.value),autoFocus:!0,disabled:d==="secret",onKeyDown:x=>{x.key==="Enter"&&r.trim()&&a("secret")}})]}),d==="secret"&&n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{className:"text-sm font-medium text-text-primary",children:"Secret"}),n.jsx("input",{type:"password",className:"w-full px-3 py-2 rounded-lg bg-bg-secondary border border-border-primary text-sm text-text-primary placeholder-text-tertiary focus:outline-none focus:border-accent-brand transition-colors",placeholder:t("channel.secretPlaceholder"),value:s,onChange:x=>l(x.target.value),autoFocus:!0,onKeyDown:x=>{x.key==="Enter"&&s.trim()&&b()}}),n.jsx("p",{className:"text-xs text-text-tertiary",children:t("remoteControl.wecomSecretHint")})]}),n.jsxs("div",{className:"flex gap-3 pt-2",children:[d==="botId"?n.jsx("button",{className:"px-4 py-2 rounded-lg bg-accent-brand text-white text-sm hover:bg-accent-brand/90 transition-colors disabled:opacity-50",disabled:!r.trim(),onClick:()=>a("secret"),children:t("remoteControl.next")}):n.jsx("button",{className:"px-4 py-2 rounded-lg bg-accent-brand text-white text-sm hover:bg-accent-brand/90 transition-colors disabled:opacity-50",disabled:!s.trim()||o,onClick:b,children:t(o?"remoteControl.connecting":"remoteControl.connect")}),n.jsx("button",{className:"px-4 py-2 rounded-lg bg-bg-secondary border border-border-primary text-sm text-text-secondary hover:bg-bg-hover transition-colors",onClick:e,children:t("remoteControl.cancel")})]})]})]})}const KS="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23copilot-clip-34e811bed903495093b85bf96a98fb1b_0)'%3e%3crect%20width='24'%20height='24'%20rx='12'%20fill='%234C4F6B'%3e%3c/rect%3e%3cpath%20d='M3.4689%2011.0144C3.32344%2011.2025%203.31607%2011.4567%203.4345%2012.0298C3.65883%2013.0748%204.24029%2014.4426%205.15579%2016.0716L5.747%2017.1172L5.72862%2017.511C5.70544%2017.9326%205.72848%2018.5857%205.77921%2019.0271C5.80994%2019.2967%205.8055%2019.3035%205.66483%2019.4638C5.12042%2020.0864%205.03916%2021.1287%205.44787%2022.2839C5.62456%2022.7775%206.16958%2023.6999%206.50726%2024.0756C7.35392%2025.0154%208.35051%2025.4646%209.11147%2025.246C9.25446%2025.2051%209.28403%2025.213%209.47117%2025.3424C10.182%2025.8233%2011.3834%2026.2377%2012.4447%2026.3663C14.2242%2026.5843%2016.2727%2026.143%2018.8281%2024.9925C19.8948%2024.5099%2022.2541%2023.1352%2023.2513%2022.4096C25.1083%2021.0667%2026.4805%2019.6414%2027.251%2018.2635C27.9337%2017.0364%2028.2735%2015.7781%2028.2495%2014.5174C28.2466%2014.2525%2028.2536%2014.2359%2028.3599%2014.1746C28.8797%2013.8703%2029.1497%2013.198%2029.0927%2012.3562C29.075%2012.1165%2029.0266%2011.7946%2028.9902%2011.6448C28.7404%2010.7144%2028.0885%209.59971%2027.4078%208.94729C26.6515%208.22182%2025.7943%207.9129%2025.1958%208.14598C25.0631%208.19758%2025.0452%208.19542%2024.9177%208.08995C24.6357%207.86124%2023.9604%207.43473%2023.5488%207.22673L23.1224%207.01477L22.8206%206.45595C22.0392%205.01609%2020.7826%203.33003%2019.8801%202.50992C19.4937%202.15818%2019.2668%202.03929%2019.019%202.05739C18.866%202.06657%2018.8535%202.07379%2018.645%202.26084C18.0389%202.79819%2017.1889%204.41355%2016.3588%206.60463L16.1271%207.21325L15.7053%207.34845C14.3909%207.76995%2013.2238%208.30219%2012.1896%208.94928C11.1973%209.56799%2010.6591%209.97037%209.84886%2010.688L9.36087%2011.1197L9.13878%2011.0813C7.00072%2010.7039%205.07892%2010.5639%204.19776%2010.7186C3.84772%2010.7832%203.55743%2010.9008%203.4689%2011.0144Z'%20fill='%23D2D3E0'%3e%3c/path%3e%3crect%20x='6.68555'%20y='16.3788'%20width='17.7918'%20height='11.5605'%20rx='4.61469'%20transform='rotate(-30%206.68555%2016.3788)'%20fill='%23212234'%3e%3c/rect%3e%3cg%3e%3crect%20x='12.2119'%20y='17.2593'%20width='2.13173'%20height='4.42744'%20rx='1.06587'%20transform='rotate(-30%2012.2119%2017.2593)'%20fill='%23D2D3E0'%3e%3canimate%20attributeName='height'%20values='4.42744;2.2;4.42744;4.42744;2.2;4.42744'%20dur='0.6s'%20begin='0s;blink134e811bed903495093b85bf96a98fb1b_0.end+3s'%20id='blink134e811bed903495093b85bf96a98fb1b_0'%3e%3c/animate%3e%3canimate%20attributeName='y'%20values='17.2593;18.2593;17.2593;17.2593;18.2593;17.2593'%20dur='0.6s'%20begin='0s;blink134e811bed903495093b85bf96a98fb1b_0.end+3s'%3e%3c/animate%3e%3canimate%20attributeName='opacity'%20values='1;0.2;1;1;0.2;1'%20dur='0.6s'%20begin='0s;blink134e811bed903495093b85bf96a98fb1b_0.end+3s'%3e%3c/animate%3e%3c/rect%3e%3c/g%3e%3cg%3e%3crect%20x='17.9634'%20y='13.9387'%20width='2.13173'%20height='4.42744'%20rx='1.06587'%20transform='rotate(-30%2017.9634%2013.9387)'%20fill='%23D2D3E0'%3e%3canimate%20attributeName='height'%20values='4.42744;2.2;4.42744;4.42744;2.2;4.42744'%20dur='0.6s'%20begin='0s;blink234e811bed903495093b85bf96a98fb1b_0.end+3s'%20id='blink234e811bed903495093b85bf96a98fb1b_0'%3e%3c/animate%3e%3canimate%20attributeName='y'%20values='13.9387;14.9387;13.9387;13.9387;14.9387;13.9387'%20dur='0.6s'%20begin='0s;blink234e811bed903495093b85bf96a98fb1b_0.end+3s'%3e%3c/animate%3e%3canimate%20attributeName='opacity'%20values='1;0.2;1;1;0.2;1'%20dur='0.6s'%20begin='0s;blink234e811bed903495093b85bf96a98fb1b_0.end+3s'%3e%3c/animate%3e%3c/rect%3e%3c/g%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='copilot-clip-34e811bed903495093b85bf96a98fb1b_0'%3e%3crect%20width='24'%20height='24'%20rx='12'%20fill='white'%3e%3c/rect%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",YS="/assets/logo-iZVLr450.svg";function XS({isOpen:e,onClose:t,mainView:r,onNavigate:i}){const{t:s}=re(),{userInfo:l}=Pu(),d=Mt(p=>p.info),a=Mt(p=>p.fetch),o=xr(p=>p.fileChanges.length);C.useEffect(()=>{d||a()},[a,d]);const c=(l==null?void 0:l.userName)||(d==null?void 0:d.userName)||s("sidebar.user");return n.jsxs(n.Fragment,{children:[n.jsx("div",{className:`sidebar-overlay ${e?"":"sidebar-overlay-hidden"}`,onClick:t}),n.jsxs("aside",{className:`sidebar ${e?"":"sidebar-closed"}`,role:"navigation","aria-label":"Main navigation",children:[n.jsxs("div",{className:"sidebar-header",children:[n.jsx("img",{src:YS,alt:"CodeBuddy",className:"sidebar-logo"}),n.jsx("span",{className:"sidebar-brand",children:"CodeBuddy"}),n.jsx("div",{className:"flex-1"}),n.jsx("button",{onClick:t,className:"md:hidden w-7 h-7 flex items-center justify-center rounded-md text-text-tertiary hover:text-text-primary hover:bg-bg-hover transition-colors","aria-label":"Close sidebar",children:n.jsx(we,{size:16})})]}),n.jsxs("nav",{className:"sidebar-nav","aria-label":"Primary",children:[n.jsxs("button",{className:`sidebar-nav-item ${r==="chat"?"active":""}`,onClick:()=>i("chat"),"aria-current":r==="chat"?"page":void 0,children:[n.jsx(ir,{size:16}),n.jsx("span",{children:s("sidebar.chatMode")})]}),n.jsxs("button",{className:`sidebar-nav-item ${r==="workers"?"active":""}`,onClick:()=>i("workers"),children:[n.jsx(Ft,{size:16}),n.jsx("span",{children:s("sidebar.workers")})]}),n.jsxs("button",{className:`sidebar-nav-item ${r==="remote-control"?"active":""}`,onClick:()=>i("remote-control"),children:[n.jsx(sn,{size:16}),n.jsx("span",{children:s("sidebar.remoteControl")})]})]}),n.jsx("div",{className:"sidebar-content",children:n.jsxs("div",{className:"px-3 py-1",children:[n.jsx("div",{className:"sidebar-section-title",children:s("sidebar.group.workspace")}),n.jsxs("button",{className:`sidebar-nav-item ${r==="tasks"?"active":""}`,onClick:()=>i("tasks"),children:[n.jsx(Pi,{size:16}),n.jsx("span",{children:s("sidebar.nav.tasks")})]}),n.jsxs("button",{className:`sidebar-nav-item ${r==="terminal"?"active":""}`,onClick:()=>i("terminal"),children:[n.jsx(yn,{size:16}),n.jsx("span",{children:s("sidebar.terminalMode")})]}),n.jsxs("button",{className:`sidebar-nav-item ${r==="editor"?"active":""}`,onClick:()=>i("editor"),children:[n.jsx(Xu,{size:16}),n.jsx("span",{children:s("sidebar.editor")})]}),n.jsxs("button",{className:`sidebar-nav-item ${r==="changes"?"active":""}`,onClick:()=>i("changes"),children:[n.jsx(bn,{size:16}),n.jsx("span",{children:s("sidebar.changes")}),o>0&&n.jsx("span",{className:"sidebar-badge",children:o})]}),n.jsxs("button",{className:`sidebar-nav-item ${r==="plugins"?"active":""}`,onClick:()=>i("plugins"),children:[n.jsx(Ot,{size:16}),n.jsx("span",{children:s("sidebar.nav.plugins")})]}),n.jsx("div",{className:"sidebar-section-title",children:s("sidebar.group.observability")}),n.jsxs("button",{className:`sidebar-nav-item ${r==="stats"?"active":""}`,onClick:()=>i("stats"),children:[n.jsx($i,{size:16}),n.jsx("span",{children:s("sidebar.stats")})]}),n.jsxs("button",{className:`sidebar-nav-item ${r==="traces"?"active":""}`,onClick:()=>i("traces"),children:[n.jsx(gp,{size:16}),n.jsx("span",{children:s("sidebar.traces")})]}),n.jsxs("button",{className:`sidebar-nav-item ${r==="metrics"?"active":""}`,onClick:()=>i("metrics"),children:[n.jsx(Di,{size:16}),n.jsx("span",{children:s("sidebar.metrics")})]}),n.jsxs("button",{className:`sidebar-nav-item ${r==="logs"?"active":""}`,onClick:()=>i("logs"),children:[n.jsx(ji,{size:16}),n.jsx("span",{children:s("sidebar.logs")})]}),n.jsx("div",{className:"sidebar-section-title",children:s("sidebar.group.preferences")}),n.jsxs("button",{className:`sidebar-nav-item ${r==="settings"?"active":""}`,onClick:()=>i("settings"),children:[n.jsx(Bi,{size:16}),n.jsx("span",{children:s("sidebar.preferences")})]}),n.jsxs("button",{className:`sidebar-nav-item ${r==="keybindings"?"active":""}`,onClick:()=>i("keybindings"),children:[n.jsx(rp,{size:16}),n.jsx("span",{children:s("sidebar.keybindings")})]}),n.jsxs("button",{className:`sidebar-nav-item ${r==="docs"?"active":""}`,onClick:()=>i("docs"),children:[n.jsx(Oi,{size:16}),n.jsx("span",{children:s("sidebar.docs")})]})]})}),n.jsx("div",{className:"sidebar-footer",children:n.jsxs("div",{className:"sidebar-user",children:[n.jsx("img",{src:KS,alt:"User",className:"sidebar-user-avatar"}),n.jsxs("div",{className:"sidebar-user-info",children:[n.jsx("div",{className:"sidebar-user-name",children:c}),(d==null?void 0:d.version)&&n.jsxs("div",{className:"sidebar-user-status",children:["v",d.version]})]})]})})]})]})}const ZS=Ce((e,t)=>({stats:null,statsLoading:!1,statsError:null,sessionStats:null,sessionLoading:!1,sessionError:null,fetchStats:async()=>{e({statsLoading:!t().stats,statsError:null});try{const r=await ge("/api/v1/stats",{headers:ce()});if(!r.ok)throw new Error(`HTTP ${r.status}`);const i=await r.json();e({stats:i.data,statsLoading:!1})}catch(r){e({statsError:r.message,statsLoading:!1})}},fetchSessionStats:async()=>{e({sessionLoading:!t().sessionStats,sessionError:null});try{const r=await ge("/api/v1/stats/session",{headers:ce()});if(!r.ok)throw new Error(`HTTP ${r.status}`);const i=await r.json();e({sessionStats:i.data,sessionLoading:!1})}catch(r){e({sessionError:r.message,sessionLoading:!1})}},fetchAll:async()=>{await Promise.all([t().fetchStats(),t().fetchSessionStats()])}}));function wt(e){return e>=1e6?(e/1e6).toFixed(1)+"M":e>=1e3?(e/1e3).toFixed(1)+"k":e.toString()}function Ri(e){if(e<=0)return"-";const t=Math.floor(e/1e3),r=Math.floor(t/60),i=Math.floor(r/60);return i>0?`${i}h ${r%60}m ${t%60}s`:r>0?`${r}m ${t%60}s`:`${t}s`}function Zc(e){return e.replace(/^anthropic\./,"").replace(/^openai\./,"").replace(/-\d{8}$/,"").replace(/@.*$/,"")}function JS(e){return new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric"})}const QS=["#ebedf0","#9be9a8","#40c463","#30a14e","#216e39"],ek=["#161b22","#0e4429","#006d32","#26a641","#39d353"],Au=["#3b82f6","#10b981","#8b5cf6"],tk=[{name:"The Little Prince",tokens:22e3},{name:"The Old Man and the Sea",tokens:35e3},{name:"A Christmas Carol",tokens:37e3},{name:"Animal Farm",tokens:39e3},{name:"Fahrenheit 451",tokens:6e4},{name:"The Great Gatsby",tokens:62e3},{name:"Brave New World",tokens:83e3},{name:"Harry Potter and the Philosopher's Stone",tokens:103e3},{name:"1984",tokens:123e3},{name:"Pride and Prejudice",tokens:156e3},{name:"Dune",tokens:244e3},{name:"A Game of Thrones",tokens:381e3},{name:"The Lord of the Rings",tokens:576e3},{name:"War and Peace",tokens:73e4}],rk=[{name:"朝花夕拾",tokens:18e3},{name:"骆驼祥子",tokens:6e4},{name:"活着",tokens:72e3},{name:"围城",tokens:84e3},{name:"三体",tokens:126e3},{name:"射雕英雄传",tokens:234e3},{name:"红楼梦",tokens:438e3},{name:"三国演义",tokens:48e4},{name:"西游记",tokens:492e3},{name:"水浒传",tokens:576e3},{name:"平凡的世界",tokens:6e5},{name:"金庸全集",tokens:636e4}],nk=[{en:"a TED talk",zh:"一场 TED 演讲",minutes:18},{en:"an episode of The Office",zh:"一集《办公室》",minutes:22},{en:"listening to Abbey Road",zh:"听一遍《Abbey Road》专辑",minutes:47},{en:"a yoga class",zh:"一节瑜伽课",minutes:60},{en:"a World Cup soccer match",zh:"一场世界杯比赛",minutes:90},{en:"a half marathon (average time)",zh:"一场半程马拉松",minutes:120},{en:"the movie Inception",zh:"电影《盗梦空间》",minutes:148},{en:"watching Titanic",zh:"电影《泰坦尼克号》",minutes:195},{en:"a transatlantic flight",zh:"一趟跨大西洋航班",minutes:420},{en:"a full night of sleep",zh:"一整晚的睡眠",minutes:480}];function ik(e,t,r,i){const s=[],l=i==="zh"?rk:tk;if(t>0){for(const d of l)if(t>=d.tokens){const a=t/d.tokens;s.push(a>=2?r("stats.funFact.moreTokens").replace("{times}",String(Math.floor(a))).replace("{book}",d.name):r("stats.funFact.sameTokens").replace("{book}",d.name))}}if(e.longestSession){const d=e.longestSession.duration/6e4;for(const a of nk){const o=d/a.minutes;if(o>=2){const c=i==="zh"?a.zh:a.en;s.push(r("stats.funFact.longerSession").replace("{times}",String(Math.floor(o))).replace("{activity}",c))}}}return s.length===0?"":s[Math.floor(Math.random()*s.length)]}function sk(){const{t:e}=re(),{stats:t,statsLoading:r,statsError:i,sessionStats:s,fetchAll:l}=ZS(),[d,a]=C.useState("overview");if(C.useEffect(()=>{l()},[l]),r&&!t)return n.jsx("div",{className:"flex-1 flex items-center justify-center",children:n.jsx(st,{size:"large",text:e("stats.loading")})});if(i&&!t)return n.jsx("div",{className:"flex-1 flex items-center justify-center",children:n.jsxs("div",{className:"text-center",children:[n.jsx("div",{className:"text-text-secondary mb-4",children:i}),n.jsx("button",{onClick:l,className:"px-4 py-2 bg-accent-brand text-white rounded-lg text-sm",children:e("stats.refresh")})]})});const o=[{key:"overview",label:e("stats.tab.overview")},{key:"models",label:e("stats.tab.models")},{key:"tools",label:e("stats.tab.tools")}];return n.jsxs("div",{className:"flex-1 overflow-auto p-4 md:p-6",children:[n.jsxs("div",{className:"flex items-center justify-between mb-6",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx($i,{size:20,className:"text-accent-brand"}),n.jsx("h1",{className:"text-lg font-semibold text-text-primary",children:e("stats.title")})]}),n.jsxs("button",{onClick:l,className:`flex items-center gap-1.5 px-3 py-1.5 text-sm text-text-secondary
|
|
656
|
+
hover:text-text-primary hover:bg-bg-hover rounded-lg transition-colors`,title:e("metrics.refresh"),children:[n.jsx(We,{size:14}),n.jsx("span",{children:e("metrics.refresh")})]})]}),t&&n.jsxs(n.Fragment,{children:[n.jsx(US,{metrics:t}),n.jsx(zS,{workers:c})]})]})}function BS(e,t){return e.map(r=>{const i=t.find(s=>s.pid===r.pid);return{...r,kind:i==null?void 0:i.kind,name:i==null?void 0:i.name,url:(i==null?void 0:i.url)||(i==null?void 0:i.endpoint),status:i==null?void 0:i.status}})}function US({metrics:e}){const{t}=re(),r=e.memTotalMib>0?e.memUsedMib/e.memTotalMib*100:0,i=e.diskTotal>0?e.diskUsed/e.diskTotal*100:0;return n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 mb-6",children:[n.jsx(ri,{icon:n.jsx(Ft,{size:18}),label:t("metrics.cpu"),value:`${e.cpuUsedPct.toFixed(1)}%`,subtext:`${e.cpuCount} ${t("metrics.cores")}`,percent:e.cpuUsedPct,colorClasses:en(e.cpuUsedPct)}),n.jsx(ri,{icon:n.jsx(ci,{size:18}),label:t("metrics.memory"),value:`${Cu(e.memUsedMib)} / ${Cu(e.memTotalMib)}`,subtext:`${r.toFixed(1)}%`,percent:r,colorClasses:en(r)}),n.jsx(ri,{icon:n.jsx(vg,{size:18}),label:t("metrics.disk"),value:`${Tu(e.diskUsed)} / ${Tu(e.diskTotal)}`,subtext:`${i.toFixed(1)}%`,percent:i,colorClasses:en(i)})]})}function ri({icon:e,label:t,value:r,subtext:i,percent:s,colorClasses:l}){const[d,a]=l;return n.jsxs("div",{className:"bg-bg-secondary rounded-xl p-4 border border-border-primary",children:[n.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[n.jsx("span",{className:d,children:e}),n.jsx("span",{className:"text-sm font-medium text-text-secondary",children:t})]}),n.jsx("div",{className:"text-xl font-semibold text-text-primary mb-1",children:r}),n.jsx("div",{className:"text-xs text-text-tertiary mb-3",children:i}),n.jsx("div",{className:"h-2 bg-bg-tertiary rounded-full overflow-hidden",children:n.jsx("div",{className:`h-full rounded-full transition-all duration-500 ${a}`,style:{width:`${Math.min(s,100)}%`}})})]})}function zS({workers:e}){const{t}=re();return e.length===0?n.jsx("div",{className:"text-center py-12 text-text-tertiary",children:t("metrics.noWorkers")}):n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[n.jsx(Ft,{size:18,className:"text-text-secondary"}),n.jsxs("h2",{className:"text-base font-medium text-text-primary",children:["Workers (",e.length,")"]})]}),n.jsx("div",{className:"space-y-3",children:e.map(r=>n.jsx(HS,{worker:r},r.id))})]})}function HS({worker:e}){const{t}=re();return n.jsx("div",{className:`bg-bg-secondary rounded-xl p-4 md:p-5 border transition-colors hover:border-gray-300 dark:hover:border-gray-600 border-border-primary ${e.error?"opacity-60":""}`,children:n.jsxs("div",{className:"flex flex-col gap-4",children:[n.jsxs("div",{className:"flex items-start justify-between",children:[n.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[n.jsx("span",{className:`inline-block w-2 h-2 rounded-full ${e.error?"bg-red-400":"bg-green-400"}`}),e.kind&&n.jsx("span",{className:`inline-block px-2.5 py-0.5 text-xs font-medium rounded-md ${PS[e.kind]||"bg-gray-100 text-gray-600"}`,children:e.kind}),n.jsx("span",{className:"text-sm font-medium text-text-primary",children:e.name||e.hostname}),e.isCurrent&&n.jsx("span",{className:"text-[10px] uppercase font-bold tracking-wider px-1.5 py-0.5 bg-accent-brand/10 text-accent-brand rounded",children:t("metrics.current")}),e.error&&n.jsx("span",{className:"text-xs text-red-400",children:e.error})]}),n.jsxs("span",{className:"text-xs text-text-tertiary font-mono bg-bg-tertiary px-2 py-0.5 rounded-md border border-border-primary/50",children:["PID ",e.pid]})]}),n.jsxs("div",{className:"flex flex-col md:flex-row md:items-start justify-between gap-4 md:gap-6",children:[n.jsxs("div",{className:"flex flex-col gap-2.5 flex-1 min-w-0",children:[n.jsx(Et,{path:e.cwd,displayMode:"basename",className:"text-[13px] text-text-secondary font-mono truncate max-w-full"}),e.url&&n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx(gt,{size:14,className:"text-text-tertiary flex-none"}),n.jsx("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"text-sm text-accent-brand hover:underline truncate",children:e.url})]})]}),e.rssMib>0||e.heapUsedMib>0?n.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 flex-none",style:{minWidth:"460px"},children:[n.jsxs("div",{className:"min-w-[100px]",children:[n.jsx(Gt,{icon:n.jsx(ci,{size:14}),label:"RSS",value:`${e.rssMib.toFixed(0)} MiB`}),n.jsx("div",{className:"mt-1.5 h-1.5 bg-bg-tertiary rounded-full overflow-hidden",children:n.jsx("div",{className:"h-full rounded-full bg-blue-500 transition-all duration-500",style:{width:`${Math.min(e.rssMib/2048*100,100)}%`}})})]}),n.jsxs("div",{className:"min-w-[140px]",children:[n.jsx(Gt,{icon:n.jsx(ci,{size:14}),label:"Heap",value:`${e.heapUsedMib.toFixed(0)} / ${e.heapTotalMib.toFixed(0)} MiB`}),e.heapTotalMib>0&&n.jsx("div",{className:"mt-1.5 h-1.5 bg-bg-tertiary rounded-full overflow-hidden",children:n.jsx("div",{className:`h-full rounded-full transition-all duration-500 ${en(e.heapUsedMib/e.heapTotalMib*100)[1]}`,style:{width:`${Math.min(e.heapUsedMib/e.heapTotalMib*100,100)}%`}})})]}),n.jsx("div",{className:"min-w-[80px]",children:n.jsx(Gt,{icon:n.jsx(kt,{size:14}),label:t("metrics.uptime"),value:Nu(e.uptimeSeconds)})}),n.jsx("div",{className:"min-w-[60px]",children:n.jsx(Gt,{icon:n.jsx(an,{size:14}),label:t("metrics.version"),value:e.version||"-"})})]}):n.jsxs("div",{className:"grid grid-cols-2 gap-4 flex-none",style:{minWidth:"200px"},children:[n.jsx("div",{className:"min-w-[80px]",children:n.jsx(Gt,{icon:n.jsx(kt,{size:14}),label:t("metrics.uptime"),value:Nu(e.uptimeSeconds)})}),n.jsx("div",{className:"min-w-[60px]",children:n.jsx(Gt,{icon:n.jsx(an,{size:14}),label:t("metrics.version"),value:e.version||"-"})})]})]})]})})}function Gt({icon:e,label:t,value:r}){return n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsxs("div",{className:"flex items-center gap-1.5 text-text-tertiary",children:[e,n.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wider",children:t})]}),n.jsx("div",{className:"text-sm font-semibold text-text-primary",style:{fontVariantNumeric:"tabular-nums"},children:r})]})}function en(e){return e>=90?["text-red-500","bg-red-500"]:e>=70?["text-amber-500","bg-amber-500"]:["text-green-500","bg-green-500"]}function Cu(e){return e>=1024?`${(e/1024).toFixed(1)} GiB`:`${e} MiB`}function Tu(e){if(e===0)return"0 B";const t=e/(1024*1024*1024);return t>=1?`${t.toFixed(1)} GB`:`${(e/(1024*1024)).toFixed(0)} MB`}function Nu(e){if(e<60)return`${e}s`;if(e<3600)return`${Math.floor(e/60)}m ${e%60}s`;const t=Math.floor(e/3600),r=Math.floor(e%3600/60);return t>=24?`${Math.floor(t/24)}d ${t%24}h`:`${t}h ${r}m`}function GS({onNavigate:e}){const{t}=re(),[r,i]=C.useState(dn);if(C.useEffect(()=>{const s=()=>i(dn());return window.addEventListener("hashchange",s),()=>window.removeEventListener("hashchange",s)},[]),r==="add-wechat"||r!=null&&r.startsWith("rebind-wechat/")){const s=r!=null&&r.startsWith("rebind-wechat/")?r.split("/")[1]:void 0;return n.jsx(qS,{onBack:()=>Pd("remote-control"),t,existingInstanceId:s})}return r==="add-wecom"?n.jsx(VS,{onBack:()=>Pd("remote-control"),t}):n.jsx(WS,{onNavigate:e,t})}function WS({onNavigate:e,t}){const[r,i]=C.useState([]),[s,l]=C.useState(!0),[d,a]=C.useState(null),[o,c]=C.useState(null),p=C.useCallback(async()=>{try{const _=await ge("/api/v1/channels");if(_.ok){const S=await _.json();i((S.clients||[]).filter(w=>!w.hidden&&!w.instanceId.startsWith("_pending")))}}catch{}finally{l(!1)}},[]);C.useEffect(()=>{p();const _=setInterval(p,5e3);return()=>clearInterval(_)},[p]);const g=C.useCallback(async(_,S,w)=>{const N=`${S}:${w}:${_}`;c(N),a(null);try{const L=_==="delete"?"DELETE":"POST",I=_==="delete"?`/api/v1/channels/${S}/${w}`:`/api/v1/channels/${S}/${w}/${_}`,$=await ge(I,{method:L});if(!$.ok){const B=await $.json().catch(()=>({}));throw new Error(B.error||`Failed: ${$.status}`)}const A=await $.json().catch(()=>({}));if(_==="unbind"&&S==="wechat"&&A.needsQrScan){gr("remote-control",`rebind-wechat/${w}`);return}await p()}catch(L){a((L==null?void 0:L.message)||"Action failed")}finally{c(null)}},[p]),b=_=>_==="connected"?"text-green-500":_==="connecting"?"text-yellow-500":_==="error"?"text-red-500":"text-text-tertiary",x=_=>t(_==="connected"?"remoteControl.connected":_==="connecting"?"remoteControl.connecting":"remoteControl.disconnected"),k=_=>_==="wechat"?n.jsx(sp,{size:18,className:"text-green-500"}):_==="wecom"?n.jsx(sn,{size:18,className:"text-accent-brand"}):n.jsx(fd,{size:18,className:"text-text-tertiary"}),v=_=>_==="wechat"?t("channel.wechat")+t("remoteControl.bot"):_==="wecom"?t("channel.wecom")+t("remoteControl.bot"):_,h=_=>`${v(_.clientType)} #${_.instanceId.slice(0,4)}`,m=r.filter(_=>_.clientType==="wechat"),u=r.filter(_=>_.clientType==="wecom"),f=r.filter(_=>_.clientType!=="wechat"&&_.clientType!=="wecom"),y=_=>{const S=`${_.clientType}:${_.instanceId}`,w=_.status==="connected",N=o==null?void 0:o.startsWith(S);return n.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-bg-secondary hover:bg-bg-hover transition-colors cursor-pointer",onClick:()=>{N||g(w?"stop":"start",_.clientType,_.instanceId)},children:[k(_.clientType),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsx("div",{className:"text-sm font-medium text-text-primary truncate",children:h(_)}),n.jsx("span",{className:`text-xs ${b(_.status)}`,children:x(_.status)})]}),n.jsxs("div",{className:"flex items-center gap-1",onClick:L=>L.stopPropagation(),children:[n.jsx("button",{className:`p-1.5 rounded-md text-text-tertiary transition-colors ${w?"hover:text-orange-500":"hover:text-green-500"} hover:bg-bg-hover`,title:t(w?"remoteControl.disconnect":"remoteControl.connect"),disabled:!!N,onClick:()=>g(w?"stop":"start",_.clientType,_.instanceId),children:w?n.jsx(fd,{size:14}):n.jsx(Og,{size:14})}),w&&n.jsx("button",{className:"p-1.5 rounded-md text-text-tertiary hover:text-orange-500 hover:bg-bg-hover transition-colors",title:t("remoteControl.unbind"),disabled:!!N,onClick:()=>g("unbind",_.clientType,_.instanceId),children:n.jsx(We,{size:14})}),n.jsx("button",{className:"p-1.5 rounded-md text-text-tertiary hover:text-red-500 hover:bg-bg-hover transition-colors",title:t("remoteControl.delete"),disabled:!!N,onClick:()=>g("delete",_.clientType,_.instanceId),children:n.jsx(sr,{size:14})})]})]},S)},E=(_,S,w,N)=>n.jsxs("div",{children:[n.jsx("h2",{className:"text-sm font-medium text-text-secondary mb-2",children:_}),S.length===0?n.jsx("div",{className:"py-4 text-center text-xs text-text-tertiary",children:t("remoteControl.noChannels")}):n.jsx("div",{className:"space-y-2",children:S.map(y)}),w&&n.jsxs("button",{className:"flex items-center gap-1.5 mt-2 px-3 py-1.5 text-xs text-text-tertiary hover:text-text-primary hover:bg-bg-hover rounded-md transition-colors",onClick:w,children:[n.jsx(ct,{size:12}),N||t("remoteControl.add")]})]});return n.jsxs("div",{className:"flex flex-col h-full overflow-y-auto",children:[n.jsxs("div",{className:"px-6 py-5 border-b border-border-primary",children:[n.jsx("h1",{className:"text-lg font-semibold text-text-primary",children:t("remoteControl.title")}),n.jsx("p",{className:"text-sm text-text-tertiary mt-1",children:t("remoteControl.subtitle")})]}),n.jsxs("div",{className:"px-6 py-4 flex-1 space-y-6",children:[d&&n.jsx("div",{className:"p-3 rounded-lg bg-red-500/10 text-red-500 text-sm",children:d}),s?n.jsx("div",{className:"text-sm text-text-tertiary py-4",children:t("remoteControl.connecting")}):r.length===0?n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"py-8 text-center",children:[n.jsx(sn,{size:32,className:"mx-auto mb-3 text-text-tertiary opacity-50"}),n.jsx("p",{className:"text-sm text-text-tertiary",children:t("remoteControl.noChannels")}),n.jsx("p",{className:"text-xs text-text-tertiary mt-1",children:t("remoteControl.noChannelsHint")})]}),n.jsxs("div",{className:"flex gap-3",children:[n.jsxs("button",{className:"flex items-center gap-2 px-4 py-2 rounded-lg bg-bg-secondary hover:bg-bg-hover text-sm text-text-primary transition-colors border border-border-primary",onClick:()=>gr("remote-control","add-wechat"),children:[n.jsx(ct,{size:14}),t("remoteControl.addWeChat")]}),n.jsxs("button",{className:"flex items-center gap-2 px-4 py-2 rounded-lg bg-bg-secondary hover:bg-bg-hover text-sm text-text-primary transition-colors border border-border-primary",onClick:()=>gr("remote-control","add-wecom"),children:[n.jsx(ct,{size:14}),t("remoteControl.addWeCom")]})]})]}):n.jsxs(n.Fragment,{children:[E(t("channel.wechat")+t("remoteControl.bot"),m,()=>gr("remote-control","add-wechat"),t("remoteControl.addWeChat")),E(t("channel.wecom")+t("remoteControl.bot"),u,()=>gr("remote-control","add-wecom"),t("remoteControl.addWeCom")),f.length>0&&E(t("remoteControl.plugin"),f)]}),n.jsx("hr",{className:"border-border-primary"}),n.jsxs("div",{className:"flex items-center gap-4 p-4 rounded-lg bg-bg-secondary hover:bg-bg-hover cursor-pointer transition-colors border border-border-primary",onClick:()=>{e?e("plugins"):window.location.hash="#/plugins"},children:[n.jsxs("div",{className:"flex-1",children:[n.jsx("h3",{className:"text-sm font-medium text-text-primary",children:t("remoteControl.installMore")}),n.jsx("p",{className:"text-xs text-text-tertiary mt-1",children:t("remoteControl.installMoreHint")})]}),n.jsx(bm,{size:16,className:"text-text-tertiary"})]})]})]})}function qS({onBack:e,t,existingInstanceId:r}){const[i,s]=C.useState(null),[l,d]=C.useState(t("remoteControl.fetchingQr")),[a,o]=C.useState(r??null),[c,p]=C.useState(null),[g,b]=C.useState(!1);return C.useEffect(()=>{let x=!1;return(async()=>{try{let k=r;if(!k){const v=await ge("/api/v1/channels/wechat",{method:"POST"});if(!v.ok)throw new Error((await v.json().catch(()=>({}))).error||"Failed");const h=await v.json();if(x)return;k=h.instanceId,o(k)}for(let v=0;v<180&&!x;v++){await new Promise(h=>setTimeout(h,1e3));try{const h=await fetch(`/api/v1/channels/wechat/${k}/qr`);if(!h.ok)continue;const m=await h.json();if(x)return;if(m.qrUrl&&s(m.qrUrl),m.message&&d(m.message),m.type==="confirmed"){b(!0),d(t("remoteControl.connected")),setTimeout(()=>{x||e()},1500);return}if(m.type==="error"){p(m.message);return}}catch{}}!x&&!g&&p("Timeout")}catch(k){x||p((k==null?void 0:k.message)||"Failed")}})(),()=>{x=!0}},[r]),n.jsxs("div",{className:"flex flex-col h-full overflow-y-auto",children:[n.jsxs("div",{className:"px-6 py-5 border-b border-border-primary flex items-center gap-3",children:[n.jsx("button",{onClick:e,className:"p-1 rounded-md hover:bg-bg-hover transition-colors",children:n.jsx(nr,{size:18})}),n.jsxs("div",{children:[n.jsx("h1",{className:"text-lg font-semibold text-text-primary",children:t("remoteControl.addWeChat")}),n.jsx("p",{className:"text-sm text-text-tertiary",children:t("remoteControl.scanQr")})]})]}),n.jsx("div",{className:"flex-1 flex flex-col items-center justify-center px-6 py-8",children:c?n.jsxs("div",{className:"text-center space-y-4",children:[n.jsx("p",{className:"text-red-500",children:c}),n.jsx("button",{onClick:e,className:"px-4 py-2 rounded-lg bg-bg-secondary hover:bg-bg-hover text-sm border border-border-primary",children:t("remoteControl.cancel")})]}):i?n.jsxs("div",{className:"text-center space-y-4",children:[n.jsx("div",{className:"inline-block p-4 bg-white rounded-xl",children:n.jsx("img",{src:`https://api.qrserver.com/v1/create-qr-code/?size=240x240&data=${encodeURIComponent(i)}`,alt:"QR Code",className:"w-60 h-60"})}),n.jsx("p",{className:"text-sm text-text-secondary",children:l})]}):n.jsxs("div",{className:"text-center space-y-3",children:[n.jsx("div",{className:"w-8 h-8 mx-auto border-2 border-accent-brand border-t-transparent rounded-full animate-spin"}),n.jsx("p",{className:"text-sm text-text-tertiary",children:l})]})})]})}function VS({onBack:e,t}){const[r,i]=C.useState(""),[s,l]=C.useState(""),[d,a]=C.useState("botId"),[o,c]=C.useState(!1),[p,g]=C.useState(null),b=C.useCallback(async()=>{if(!(!r.trim()||!s.trim())){c(!0),g(null);try{const x=await ge("/api/v1/channels/wecom",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({botId:r.trim(),secret:s.trim()})});if(!x.ok){const k=await x.json().catch(()=>({}));throw new Error(k.error||"Failed")}e()}catch(x){g((x==null?void 0:x.message)||"Failed")}finally{c(!1)}}},[r,s,e]);return n.jsxs("div",{className:"flex flex-col h-full overflow-y-auto",children:[n.jsxs("div",{className:"px-6 py-5 border-b border-border-primary flex items-center gap-3",children:[n.jsx("button",{onClick:e,className:"p-1 rounded-md hover:bg-bg-hover transition-colors",children:n.jsx(nr,{size:18})}),n.jsxs("div",{children:[n.jsx("h1",{className:"text-lg font-semibold text-text-primary",children:t("remoteControl.addWeCom")}),n.jsx("p",{className:"text-sm text-text-tertiary",children:t("remoteControl.wecomBotIdHint")})]})]}),n.jsxs("div",{className:"px-6 py-8 max-w-md mx-auto w-full space-y-6",children:[p&&n.jsx("div",{className:"p-3 rounded-lg bg-red-500/10 text-red-500 text-sm",children:p}),n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{className:"text-sm font-medium text-text-primary",children:"Bot ID"}),n.jsx("input",{type:"text",className:"w-full px-3 py-2 rounded-lg bg-bg-secondary border border-border-primary text-sm text-text-primary placeholder-text-tertiary focus:outline-none focus:border-accent-brand transition-colors",placeholder:t("channel.botIdPlaceholder"),value:r,onChange:x=>i(x.target.value),autoFocus:!0,disabled:d==="secret",onKeyDown:x=>{x.key==="Enter"&&r.trim()&&a("secret")}})]}),d==="secret"&&n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{className:"text-sm font-medium text-text-primary",children:"Secret"}),n.jsx("input",{type:"password",className:"w-full px-3 py-2 rounded-lg bg-bg-secondary border border-border-primary text-sm text-text-primary placeholder-text-tertiary focus:outline-none focus:border-accent-brand transition-colors",placeholder:t("channel.secretPlaceholder"),value:s,onChange:x=>l(x.target.value),autoFocus:!0,onKeyDown:x=>{x.key==="Enter"&&s.trim()&&b()}}),n.jsx("p",{className:"text-xs text-text-tertiary",children:t("remoteControl.wecomSecretHint")})]}),n.jsxs("div",{className:"flex gap-3 pt-2",children:[d==="botId"?n.jsx("button",{className:"px-4 py-2 rounded-lg bg-accent-brand text-white text-sm hover:bg-accent-brand/90 transition-colors disabled:opacity-50",disabled:!r.trim(),onClick:()=>a("secret"),children:t("remoteControl.next")}):n.jsx("button",{className:"px-4 py-2 rounded-lg bg-accent-brand text-white text-sm hover:bg-accent-brand/90 transition-colors disabled:opacity-50",disabled:!s.trim()||o,onClick:b,children:t(o?"remoteControl.connecting":"remoteControl.connect")}),n.jsx("button",{className:"px-4 py-2 rounded-lg bg-bg-secondary border border-border-primary text-sm text-text-secondary hover:bg-bg-hover transition-colors",onClick:e,children:t("remoteControl.cancel")})]})]})]})}const KS="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23copilot-clip-34e811bed903495093b85bf96a98fb1b_0)'%3e%3crect%20width='24'%20height='24'%20rx='12'%20fill='%234C4F6B'%3e%3c/rect%3e%3cpath%20d='M3.4689%2011.0144C3.32344%2011.2025%203.31607%2011.4567%203.4345%2012.0298C3.65883%2013.0748%204.24029%2014.4426%205.15579%2016.0716L5.747%2017.1172L5.72862%2017.511C5.70544%2017.9326%205.72848%2018.5857%205.77921%2019.0271C5.80994%2019.2967%205.8055%2019.3035%205.66483%2019.4638C5.12042%2020.0864%205.03916%2021.1287%205.44787%2022.2839C5.62456%2022.7775%206.16958%2023.6999%206.50726%2024.0756C7.35392%2025.0154%208.35051%2025.4646%209.11147%2025.246C9.25446%2025.2051%209.28403%2025.213%209.47117%2025.3424C10.182%2025.8233%2011.3834%2026.2377%2012.4447%2026.3663C14.2242%2026.5843%2016.2727%2026.143%2018.8281%2024.9925C19.8948%2024.5099%2022.2541%2023.1352%2023.2513%2022.4096C25.1083%2021.0667%2026.4805%2019.6414%2027.251%2018.2635C27.9337%2017.0364%2028.2735%2015.7781%2028.2495%2014.5174C28.2466%2014.2525%2028.2536%2014.2359%2028.3599%2014.1746C28.8797%2013.8703%2029.1497%2013.198%2029.0927%2012.3562C29.075%2012.1165%2029.0266%2011.7946%2028.9902%2011.6448C28.7404%2010.7144%2028.0885%209.59971%2027.4078%208.94729C26.6515%208.22182%2025.7943%207.9129%2025.1958%208.14598C25.0631%208.19758%2025.0452%208.19542%2024.9177%208.08995C24.6357%207.86124%2023.9604%207.43473%2023.5488%207.22673L23.1224%207.01477L22.8206%206.45595C22.0392%205.01609%2020.7826%203.33003%2019.8801%202.50992C19.4937%202.15818%2019.2668%202.03929%2019.019%202.05739C18.866%202.06657%2018.8535%202.07379%2018.645%202.26084C18.0389%202.79819%2017.1889%204.41355%2016.3588%206.60463L16.1271%207.21325L15.7053%207.34845C14.3909%207.76995%2013.2238%208.30219%2012.1896%208.94928C11.1973%209.56799%2010.6591%209.97037%209.84886%2010.688L9.36087%2011.1197L9.13878%2011.0813C7.00072%2010.7039%205.07892%2010.5639%204.19776%2010.7186C3.84772%2010.7832%203.55743%2010.9008%203.4689%2011.0144Z'%20fill='%23D2D3E0'%3e%3c/path%3e%3crect%20x='6.68555'%20y='16.3788'%20width='17.7918'%20height='11.5605'%20rx='4.61469'%20transform='rotate(-30%206.68555%2016.3788)'%20fill='%23212234'%3e%3c/rect%3e%3cg%3e%3crect%20x='12.2119'%20y='17.2593'%20width='2.13173'%20height='4.42744'%20rx='1.06587'%20transform='rotate(-30%2012.2119%2017.2593)'%20fill='%23D2D3E0'%3e%3canimate%20attributeName='height'%20values='4.42744;2.2;4.42744;4.42744;2.2;4.42744'%20dur='0.6s'%20begin='0s;blink134e811bed903495093b85bf96a98fb1b_0.end+3s'%20id='blink134e811bed903495093b85bf96a98fb1b_0'%3e%3c/animate%3e%3canimate%20attributeName='y'%20values='17.2593;18.2593;17.2593;17.2593;18.2593;17.2593'%20dur='0.6s'%20begin='0s;blink134e811bed903495093b85bf96a98fb1b_0.end+3s'%3e%3c/animate%3e%3canimate%20attributeName='opacity'%20values='1;0.2;1;1;0.2;1'%20dur='0.6s'%20begin='0s;blink134e811bed903495093b85bf96a98fb1b_0.end+3s'%3e%3c/animate%3e%3c/rect%3e%3c/g%3e%3cg%3e%3crect%20x='17.9634'%20y='13.9387'%20width='2.13173'%20height='4.42744'%20rx='1.06587'%20transform='rotate(-30%2017.9634%2013.9387)'%20fill='%23D2D3E0'%3e%3canimate%20attributeName='height'%20values='4.42744;2.2;4.42744;4.42744;2.2;4.42744'%20dur='0.6s'%20begin='0s;blink234e811bed903495093b85bf96a98fb1b_0.end+3s'%20id='blink234e811bed903495093b85bf96a98fb1b_0'%3e%3c/animate%3e%3canimate%20attributeName='y'%20values='13.9387;14.9387;13.9387;13.9387;14.9387;13.9387'%20dur='0.6s'%20begin='0s;blink234e811bed903495093b85bf96a98fb1b_0.end+3s'%3e%3c/animate%3e%3canimate%20attributeName='opacity'%20values='1;0.2;1;1;0.2;1'%20dur='0.6s'%20begin='0s;blink234e811bed903495093b85bf96a98fb1b_0.end+3s'%3e%3c/animate%3e%3c/rect%3e%3c/g%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='copilot-clip-34e811bed903495093b85bf96a98fb1b_0'%3e%3crect%20width='24'%20height='24'%20rx='12'%20fill='white'%3e%3c/rect%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",YS="/assets/logo-iZVLr450.svg";function XS({isOpen:e,onClose:t,mainView:r,onNavigate:i}){const{t:s}=re(),{userInfo:l}=Pu(),d=Mt(p=>p.info),a=Mt(p=>p.fetch),o=xr(p=>p.fileChanges.length);C.useEffect(()=>{d||a()},[a,d]);const c=(l==null?void 0:l.userName)||(d==null?void 0:d.userName)||s("sidebar.user");return n.jsxs(n.Fragment,{children:[n.jsx("div",{className:`sidebar-overlay ${e?"":"sidebar-overlay-hidden"}`,onClick:t}),n.jsxs("aside",{className:`sidebar ${e?"":"sidebar-closed"}`,role:"navigation","aria-label":"Main navigation",children:[n.jsxs("div",{className:"sidebar-header",children:[n.jsx("img",{src:YS,alt:"CodeBuddy",className:"sidebar-logo"}),n.jsx("span",{className:"sidebar-brand",children:"CodeBuddy"}),n.jsx("div",{className:"flex-1"}),n.jsx("button",{onClick:t,className:"md:hidden w-7 h-7 flex items-center justify-center rounded-md text-text-tertiary hover:text-text-primary hover:bg-bg-hover transition-colors","aria-label":"Close sidebar",children:n.jsx(we,{size:16})})]}),n.jsxs("nav",{className:"sidebar-nav","aria-label":"Primary",children:[n.jsxs("button",{className:`sidebar-nav-item ${r==="chat"?"active":""}`,onClick:()=>i("chat"),"aria-current":r==="chat"?"page":void 0,children:[n.jsx(ir,{size:16}),n.jsx("span",{children:s("sidebar.chatMode")})]}),n.jsxs("button",{className:`sidebar-nav-item ${r==="workers"?"active":""}`,onClick:()=>i("workers"),children:[n.jsx(Ft,{size:16}),n.jsx("span",{children:s("sidebar.workers")})]}),n.jsxs("button",{className:`sidebar-nav-item ${r==="remote-control"?"active":""}`,onClick:()=>i("remote-control"),children:[n.jsx(sn,{size:16}),n.jsx("span",{children:s("sidebar.remoteControl")})]})]}),n.jsx("div",{className:"sidebar-content",children:n.jsxs("div",{className:"px-3 py-1",children:[n.jsx("div",{className:"sidebar-section-title",children:s("sidebar.group.workspace")}),n.jsxs("button",{className:`sidebar-nav-item ${r==="tasks"?"active":""}`,onClick:()=>i("tasks"),children:[n.jsx(Pi,{size:16}),n.jsx("span",{children:s("sidebar.nav.tasks")})]}),n.jsxs("button",{className:`sidebar-nav-item ${r==="terminal"?"active":""}`,onClick:()=>i("terminal"),children:[n.jsx(yn,{size:16}),n.jsx("span",{children:s("sidebar.terminalMode")})]}),n.jsxs("button",{className:`sidebar-nav-item ${r==="editor"?"active":""}`,onClick:()=>i("editor"),children:[n.jsx(Xu,{size:16}),n.jsx("span",{children:s("sidebar.editor")})]}),n.jsxs("button",{className:`sidebar-nav-item ${r==="changes"?"active":""}`,onClick:()=>i("changes"),children:[n.jsx(bn,{size:16}),n.jsx("span",{children:s("sidebar.changes")}),o>0&&n.jsx("span",{className:"sidebar-badge",children:o})]}),n.jsxs("button",{className:`sidebar-nav-item ${r==="plugins"?"active":""}`,onClick:()=>i("plugins"),children:[n.jsx(Ot,{size:16}),n.jsx("span",{children:s("sidebar.nav.plugins")})]}),n.jsx("div",{className:"sidebar-section-title",children:s("sidebar.group.observability")}),n.jsxs("button",{className:`sidebar-nav-item ${r==="stats"?"active":""}`,onClick:()=>i("stats"),children:[n.jsx($i,{size:16}),n.jsx("span",{children:s("sidebar.stats")})]}),n.jsxs("button",{className:`sidebar-nav-item ${r==="traces"?"active":""}`,onClick:()=>i("traces"),children:[n.jsx(gp,{size:16}),n.jsx("span",{children:s("sidebar.traces")})]}),n.jsxs("button",{className:`sidebar-nav-item ${r==="metrics"?"active":""}`,onClick:()=>i("metrics"),children:[n.jsx(Di,{size:16}),n.jsx("span",{children:s("sidebar.metrics")})]}),n.jsxs("button",{className:`sidebar-nav-item ${r==="logs"?"active":""}`,onClick:()=>i("logs"),children:[n.jsx(ji,{size:16}),n.jsx("span",{children:s("sidebar.logs")})]}),n.jsx("div",{className:"sidebar-section-title",children:s("sidebar.group.preferences")}),n.jsxs("button",{className:`sidebar-nav-item ${r==="settings"?"active":""}`,onClick:()=>i("settings"),children:[n.jsx(Bi,{size:16}),n.jsx("span",{children:s("sidebar.preferences")})]}),n.jsxs("button",{className:`sidebar-nav-item ${r==="keybindings"?"active":""}`,onClick:()=>i("keybindings"),children:[n.jsx(rp,{size:16}),n.jsx("span",{children:s("sidebar.keybindings")})]}),n.jsxs("button",{className:`sidebar-nav-item ${r==="docs"?"active":""}`,onClick:()=>i("docs"),children:[n.jsx(Oi,{size:16}),n.jsx("span",{children:s("sidebar.docs")})]})]})}),n.jsx("div",{className:"sidebar-footer",children:n.jsxs("div",{className:"sidebar-user",children:[n.jsx("img",{src:KS,alt:"User",className:"sidebar-user-avatar"}),n.jsxs("div",{className:"sidebar-user-info",children:[n.jsx("div",{className:"sidebar-user-name",children:c}),(d==null?void 0:d.version)&&n.jsxs("div",{className:"sidebar-user-status",children:["v",d.version]})]})]})})]})]})}const ZS=Ce((e,t)=>({stats:null,statsLoading:!1,statsError:null,sessionStats:null,sessionLoading:!1,sessionError:null,fetchStats:async()=>{e({statsLoading:!t().stats,statsError:null});try{const r=await ge("/api/v1/stats",{headers:ce()});if(!r.ok)throw new Error(`HTTP ${r.status}`);const i=await r.json();e({stats:i.data,statsLoading:!1})}catch(r){e({statsError:r.message,statsLoading:!1})}},fetchSessionStats:async()=>{e({sessionLoading:!t().sessionStats,sessionError:null});try{const r=await ge("/api/v1/stats/session",{headers:ce()});if(!r.ok)throw new Error(`HTTP ${r.status}`);const i=await r.json();e({sessionStats:i.data,sessionLoading:!1})}catch(r){e({sessionError:r.message,sessionLoading:!1})}},fetchAll:async()=>{await Promise.all([t().fetchStats(),t().fetchSessionStats()])}}));function wt(e){return e>=1e6?(e/1e6).toFixed(1)+"M":e>=1e3?(e/1e3).toFixed(1)+"k":e.toString()}function Ri(e){if(e<=0)return"-";const t=Math.floor(e/1e3),r=Math.floor(t/60),i=Math.floor(r/60);return i>0?`${i}h ${r%60}m ${t%60}s`:r>0?`${r}m ${t%60}s`:`${t}s`}function Zc(e){return e.replace(/^anthropic\./,"").replace(/^openai\./,"").replace(/-\d{8}$/,"").replace(/@.*$/,"")}function JS(e){return new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric"})}const QS=["#ebedf0","#9be9a8","#40c463","#30a14e","#216e39"],ek=["#161b22","#0e4429","#006d32","#26a641","#39d353"],Au=["#3b82f6","#10b981","#8b5cf6"],tk=[{name:"The Little Prince",tokens:22e3},{name:"The Old Man and the Sea",tokens:35e3},{name:"A Christmas Carol",tokens:37e3},{name:"Animal Farm",tokens:39e3},{name:"Fahrenheit 451",tokens:6e4},{name:"The Great Gatsby",tokens:62e3},{name:"Brave New World",tokens:83e3},{name:"Harry Potter and the Philosopher's Stone",tokens:103e3},{name:"1984",tokens:123e3},{name:"Pride and Prejudice",tokens:156e3},{name:"Dune",tokens:244e3},{name:"A Game of Thrones",tokens:381e3},{name:"The Lord of the Rings",tokens:576e3},{name:"War and Peace",tokens:73e4}],rk=[{name:"朝花夕拾",tokens:18e3},{name:"骆驼祥子",tokens:6e4},{name:"活着",tokens:72e3},{name:"围城",tokens:84e3},{name:"三体",tokens:126e3},{name:"射雕英雄传",tokens:234e3},{name:"红楼梦",tokens:438e3},{name:"三国演义",tokens:48e4},{name:"西游记",tokens:492e3},{name:"水浒传",tokens:576e3},{name:"平凡的世界",tokens:6e5},{name:"金庸全集",tokens:636e4}],nk=[{en:"a TED talk",zh:"一场 TED 演讲",minutes:18},{en:"an episode of The Office",zh:"一集《办公室》",minutes:22},{en:"listening to Abbey Road",zh:"听一遍《Abbey Road》专辑",minutes:47},{en:"a yoga class",zh:"一节瑜伽课",minutes:60},{en:"a World Cup soccer match",zh:"一场世界杯比赛",minutes:90},{en:"a half marathon (average time)",zh:"一场半程马拉松",minutes:120},{en:"the movie Inception",zh:"电影《盗梦空间》",minutes:148},{en:"watching Titanic",zh:"电影《泰坦尼克号》",minutes:195},{en:"a transatlantic flight",zh:"一趟跨大西洋航班",minutes:420},{en:"a full night of sleep",zh:"一整晚的睡眠",minutes:480}];function ik(e,t,r,i){const s=[],l=i==="zh"?rk:tk;if(t>0){for(const d of l)if(t>=d.tokens){const a=t/d.tokens;s.push(a>=2?r("stats.funFact.moreTokens").replace("{times}",String(Math.floor(a))).replace("{book}",d.name):r("stats.funFact.sameTokens").replace("{book}",d.name))}}if(e.longestSession){const d=e.longestSession.duration/6e4;for(const a of nk){const o=d/a.minutes;if(o>=2){const c=i==="zh"?a.zh:a.en;s.push(r("stats.funFact.longerSession").replace("{times}",String(Math.floor(o))).replace("{activity}",c))}}}return s.length===0?"":s[Math.floor(Math.random()*s.length)]}function sk(){const{t:e}=re(),{stats:t,statsLoading:r,statsError:i,sessionStats:s,fetchAll:l}=ZS(),[d,a]=C.useState("overview");if(C.useEffect(()=>{l()},[l]),r&&!t)return n.jsx("div",{className:"flex-1 flex items-center justify-center",children:n.jsx(st,{size:"large",text:e("stats.loading")})});if(i&&!t)return n.jsx("div",{className:"flex-1 flex items-center justify-center",children:n.jsxs("div",{className:"text-center",children:[n.jsx("div",{className:"text-text-secondary mb-4",children:i}),n.jsx("button",{onClick:l,className:"px-4 py-2 bg-accent-brand text-white rounded-lg text-sm",children:e("stats.refresh")})]})});const o=[{key:"overview",label:e("stats.tab.overview")},{key:"models",label:e("stats.tab.models")},{key:"tools",label:e("stats.tab.tools")}];return n.jsxs("div",{className:"flex-1 overflow-auto p-4 md:p-6",children:[n.jsxs("div",{className:"flex items-center justify-between mb-6",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx($i,{size:20,className:"text-accent-brand"}),n.jsx("h1",{className:"text-lg font-semibold text-text-primary",children:e("stats.title")})]}),n.jsxs("button",{onClick:l,className:`flex items-center gap-1.5 px-3 py-1.5 text-sm text-text-secondary
|
|
657
657
|
hover:text-text-primary hover:bg-bg-hover rounded-lg transition-colors`,title:e("stats.refresh"),children:[n.jsx(We,{size:14}),n.jsx("span",{children:e("stats.refresh")})]})]}),n.jsx("div",{className:"flex gap-1 mb-6 bg-bg-secondary rounded-lg p-1 w-fit",children:o.map(c=>n.jsx("button",{onClick:()=>a(c.key),className:`px-4 py-1.5 text-sm rounded-md transition-colors ${d===c.key?"bg-bg-primary text-text-primary font-medium shadow-sm":"text-text-secondary hover:text-text-primary"}`,children:c.label},c.key))}),t?n.jsxs(n.Fragment,{children:[d==="overview"&&n.jsx(ak,{stats:t,sessionStats:s}),d==="models"&&n.jsx(ok,{stats:t}),d==="tools"&&n.jsx(lk,{toolUsage:t.toolUsage}),n.jsx("div",{className:"mt-8 text-xs text-text-tertiary text-center",children:e("stats.timeRange").replace("{days}",String(t.totalDays))})]}):n.jsx("div",{className:"text-center py-12 text-text-tertiary",children:e("stats.noData")})]})}function ak({stats:e,sessionStats:t}){const{t:r,resolved:i}=re(),s=C.useMemo(()=>Object.entries(e.modelUsage).sort(([,c],[,p])=>p.inputTokens+p.outputTokens-(c.inputTokens+c.outputTokens)),[e.modelUsage]),l=C.useMemo(()=>s.reduce((c,[,p])=>c+p.inputTokens+p.outputTokens,0),[s]),d=C.useMemo(()=>{const c=s.reduce((g,[,b])=>g+b.inputTokens,0),p=s.reduce((g,[,b])=>g+b.cacheReadInputTokens,0);return c>0?p/c*100:0},[s]),a=s[0],o=C.useMemo(()=>ik(e,l,r,i),[e,l,r,i]);return n.jsxs(n.Fragment,{children:[t&&n.jsx(ck,{sessionStats:t}),e.dailyActivity.length>0&&n.jsx("div",{className:"mb-6",children:n.jsx(dk,{dailyActivity:e.dailyActivity})}),a&&n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 mb-4",children:[n.jsx(ht,{icon:n.jsx(dp,{size:16}),label:r("stats.favoriteModel"),value:Zc(a[0])}),n.jsx(ht,{icon:n.jsx(Qu,{size:16}),label:r("stats.totalTokens"),value:wt(l)}),n.jsx(ht,{icon:n.jsx(Xt,{size:16}),label:r("stats.cacheHitRate"),value:`${d.toFixed(1)}%`})]}),n.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-4 mb-6",children:[n.jsx(ht,{icon:n.jsx(ir,{size:16}),label:r("stats.sessions"),value:wt(e.totalSessions)}),n.jsx(ht,{icon:n.jsx(hp,{size:16}),label:r("stats.longestSession"),value:e.longestSession?Ri(e.longestSession.duration):r("stats.na")}),n.jsx(ht,{icon:n.jsx(Vf,{size:16}),label:r("stats.activeDays"),value:`${e.activeDays}/${e.totalDays}`}),n.jsx(ht,{icon:n.jsx(Xt,{size:16}),label:r("stats.currentStreak"),value:`${e.streaks.currentStreak} ${r("stats.days")}`}),n.jsx(ht,{icon:n.jsx(Xt,{size:16}),label:r("stats.longestStreak"),value:`${e.streaks.longestStreak} ${r("stats.days")}`}),n.jsx(ht,{icon:n.jsx(kt,{size:16}),label:r("stats.peakHour"),value:e.peakActivityHour!==null?`${e.peakActivityHour}:00-${e.peakActivityHour+1}:00`:r("stats.na")})]}),o&&n.jsx("div",{className:"p-3 bg-bg-secondary/50 rounded-lg border border-border-primary/50 text-sm text-accent-brand",children:o})]})}function ok({stats:e}){const{t}=re(),r=C.useMemo(()=>Object.entries(e.modelUsage).map(([s,l])=>{const d=l.inputTokens>0?l.cacheReadInputTokens/l.inputTokens*100:0;return{name:s,shortName:Zc(s),inputTokens:l.inputTokens,outputTokens:l.outputTokens,cacheReadInputTokens:l.cacheReadInputTokens,cacheHitRate:d,total:l.inputTokens+l.outputTokens,costUSD:l.costUSD}}).sort((s,l)=>l.total-s.total),[e.modelUsage]),i=C.useMemo(()=>r.reduce((s,l)=>s+l.total,0),[r]);return r.length===0?n.jsx("div",{className:"text-center py-12 text-text-tertiary",children:t("stats.noData")}):n.jsxs(n.Fragment,{children:[e.dailyModelTokens.length>=2&&n.jsxs("div",{className:"mb-6",children:[n.jsx("h2",{className:"text-sm font-medium text-text-primary mb-3",children:t("stats.tokensPerDay")}),n.jsx(uk,{dailyModelTokens:e.dailyModelTokens,topModels:r.slice(0,3).map(s=>s.name)})]}),n.jsx("h2",{className:"text-sm font-medium text-text-primary mb-3",children:t("stats.allModels")}),n.jsx("div",{className:"space-y-3",children:r.map(s=>{const l=i>0?s.total/i*100:0;return n.jsxs("div",{className:"bg-bg-secondary rounded-lg p-3 border border-border-primary",children:[n.jsxs("div",{className:"flex items-center justify-between mb-2",children:[n.jsx("span",{className:"text-sm font-medium text-text-primary",children:s.shortName}),n.jsxs("span",{className:"text-xs text-text-tertiary",children:[l.toFixed(1),"%"]})]}),n.jsx("div",{className:"h-1.5 bg-bg-tertiary rounded-full mb-2",children:n.jsx("div",{className:"h-full rounded-full bg-accent-brand transition-all duration-500",style:{width:`${Math.min(l,100)}%`}})}),n.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-2 text-xs text-text-secondary",children:[n.jsxs("span",{children:[t("stats.input"),": ",wt(s.inputTokens)]}),n.jsxs("span",{children:[t("stats.output"),": ",wt(s.outputTokens)]}),s.cacheReadInputTokens>0&&n.jsxs("span",{children:[t("stats.cacheHitRate"),": ",s.cacheHitRate.toFixed(1),"%"]}),s.costUSD>0&&n.jsxs("span",{children:[t("stats.cost"),": $",s.costUSD.toFixed(2)]})]})]},s.name)})})]})}function lk({toolUsage:e}){var s;const{t}=re(),r=e.slice(0,20),i=((s=r[0])==null?void 0:s.count)||0;return r.length===0?n.jsx("div",{className:"text-center py-12 text-text-tertiary",children:t("stats.noData")}):n.jsxs(n.Fragment,{children:[n.jsx("h2",{className:"text-sm font-medium text-text-primary mb-4",children:t("stats.topTools")}),n.jsx("div",{className:"space-y-2",children:r.map(l=>n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("span",{className:"text-xs text-text-secondary w-28 text-right truncate font-mono",children:l.toolName}),n.jsx("div",{className:"flex-1 h-6 bg-bg-tertiary rounded overflow-hidden",children:n.jsx("div",{className:"h-full bg-accent-brand/60 rounded transition-all duration-500 flex items-center pl-2",style:{width:`${Math.max(l.count/i*100,2)}%`},children:l.count/i>.15&&n.jsx("span",{className:"text-[10px] text-text-primary font-mono",children:wt(l.count)})})}),l.count/i<=.15&&n.jsx("span",{className:"text-xs text-text-tertiary w-12 font-mono",children:wt(l.count)})]},l.toolName))})]})}function ck({sessionStats:e}){const{t}=re(),r=C.useMemo(()=>Object.values(e.tokenUsageByModel).reduce((i,s)=>i+s.inputTokens+s.outputTokens,0),[e.tokenUsageByModel]);return n.jsxs("div",{className:"flex flex-wrap gap-3 mb-6 p-3 bg-bg-secondary/50 rounded-xl border border-border-primary/50",children:[n.jsx(Wt,{label:t("stats.session.title"),icon:n.jsx(Hm,{size:12})}),n.jsx(Wt,{label:t("stats.session.apiDuration"),value:Ri(e.apiDuration)}),n.jsx(Wt,{label:t("stats.session.wallTime"),value:Ri(e.runningTime)}),n.jsx(Wt,{label:t("stats.session.linesAdded"),value:`+${e.fileChangeStats.totalAddedLines}`,valueClass:"text-green-500"}),n.jsx(Wt,{label:t("stats.session.linesDeleted"),value:`-${e.fileChangeStats.totalDeletedLines}`,valueClass:"text-red-500"}),n.jsx(Wt,{label:t("stats.session.tokens"),value:wt(r)})]})}function Wt({label:e,value:t,icon:r,valueClass:i}){return n.jsxs("div",{className:"flex items-center gap-1.5 text-xs",children:[r,n.jsx("span",{className:"text-text-tertiary",children:e}),t&&n.jsx("span",{className:`font-medium text-text-primary ${i||""}`,children:t})]})}function ht({icon:e,label:t,value:r}){return n.jsxs("div",{className:"bg-bg-secondary rounded-xl p-4 border border-border-primary",children:[n.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[n.jsx("span",{className:"text-text-tertiary",children:e}),n.jsx("span",{className:"text-xs font-medium text-text-secondary",children:t})]}),n.jsx("div",{className:"text-lg font-semibold text-text-primary",style:{fontVariantNumeric:"tabular-nums"},children:r})]})}function dk({dailyActivity:e}){const{t}=re(),i=qe(d=>d.resolved)==="dark"?ek:QS,s=C.useMemo(()=>{const g=new Map;for(const L of e)g.set(L.date,L.messageCount);const b=e.map(L=>L.messageCount).filter(L=>L>0).sort((L,I)=>L-I),x=b.length>0?b[Math.floor(b.length*.25)]:0,k=b.length>0?b[Math.floor(b.length*.5)]:0,v=b.length>0?b[Math.floor(b.length*.75)]:0,h=L=>L===0||b.length===0?0:L>=v?4:L>=k?3:L>=x?2:1,m=new Date;m.setHours(0,0,0,0);const u=new Date(m);u.setDate(m.getDate()-m.getDay());const f=new Date(u);f.setDate(f.getDate()-357);const y=[],E=[];let _=-1;const S=new Date(f);for(let L=0;L<52;L++)for(let I=0;I<7;I++){if(S>m){S.setDate(S.getDate()+1);continue}const $=S.getFullYear(),A=String(S.getMonth()+1).padStart(2,"0"),B=String(S.getDate()).padStart(2,"0"),M=`${$}-${A}-${B}`,H=g.get(M)||0;if(I===0&&S.getMonth()!==_){const U=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];E.push({text:U[S.getMonth()],x:32+L*14}),_=S.getMonth()}y.push({key:M,x:32+L*14,y:20+I*14,level:h(H),date:M,count:H}),S.setDate(S.getDate()+1)}return{cells:y,monthLabels:E,width:770,height:128,CELL_SIZE:12,TOP_PADDING:20,LEFT_PADDING:32,CELL_GAP:2}},[e]),l=["","Mon","","Wed","","Fri",""];return n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("svg",{width:s.width,height:s.height+30,viewBox:`0 0 ${s.width} ${s.height+30}`,className:"min-w-[500px]",children:[s.monthLabels.map((d,a)=>n.jsx("text",{x:d.x,y:s.TOP_PADDING-6,className:"fill-text-tertiary",fontSize:10,children:d.text},a)),l.map((d,a)=>d?n.jsx("text",{x:s.LEFT_PADDING-6,y:s.TOP_PADDING+a*(s.CELL_SIZE+s.CELL_GAP)+s.CELL_SIZE-2,className:"fill-text-tertiary",fontSize:10,textAnchor:"end",children:d},a):null),s.cells.map(d=>n.jsx("rect",{x:d.x,y:d.y,width:s.CELL_SIZE,height:s.CELL_SIZE,rx:2,fill:i[d.level],children:n.jsxs("title",{children:[d.date,": ",d.count," ",t("stats.heatmap.messages")]})},d.key)),(()=>{const d=s.height+4,a=s.LEFT_PADDING;return n.jsxs("g",{children:[n.jsx("text",{x:a,y:d+10,className:"fill-text-tertiary",fontSize:10,children:t("stats.heatmap.less")}),i.map((o,c)=>n.jsx("rect",{x:a+30+c*(s.CELL_SIZE+2),y:d,width:s.CELL_SIZE,height:s.CELL_SIZE,rx:2,fill:o},c)),n.jsx("text",{x:a+30+5*(s.CELL_SIZE+2)+4,y:d+10,className:"fill-text-tertiary",fontSize:10,children:t("stats.heatmap.more")})]})})()]})})}function uk({dailyModelTokens:e,topModels:t}){const r=C.useMemo(()=>{const l={top:20,right:20,bottom:40,left:60},d=700-l.left-l.right,a=220-l.top-l.bottom;let o=0;for(const k of e)for(const v of t){const h=k.tokensByModel[v]||0;h>o&&(o=h)}o===0&&(o=1);const c=t.map((k,v)=>{const h=e.map((u,f)=>{const y=l.left+f/Math.max(e.length-1,1)*d,E=u.tokensByModel[k]||0,_=l.top+a-E/o*a;return`${y},${_}`});return e.some(u=>(u.tokensByModel[k]||0)>0)?{path:`M${h.join("L")}`,color:Au[v%Au.length],model:k}:null}).filter(Boolean),p=Array.from({length:5},(k,v)=>{const h=o*(1-v/4);return{y:l.top+v/4*a,label:wt(Math.round(h))}}),g=Math.min(5,e.length),b=Math.max(1,Math.floor((e.length-1)/(g-1))),x=Array.from({length:g},(k,v)=>{const h=Math.min(v*b,e.length-1);return{x:l.left+h/Math.max(e.length-1,1)*d,label:JS(e[h].date)}});return{W:700,H:220,PAD:l,CW:d,CH:a,lines:c,yGridLines:p,xLabels:x}},[e,t]);return n.jsxs("div",{children:[n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("svg",{viewBox:`0 0 ${r.W} ${r.H}`,className:"w-full min-w-[500px]",style:{maxHeight:"240px"},children:[r.yGridLines.map((i,s)=>n.jsxs("g",{children:[n.jsx("line",{x1:r.PAD.left,y1:i.y,x2:r.W-r.PAD.right,y2:i.y,className:"stroke-border-primary",strokeWidth:.5,strokeDasharray:"4 4"}),n.jsx("text",{x:r.PAD.left-8,y:i.y+4,textAnchor:"end",className:"fill-text-tertiary",fontSize:10,children:i.label})]},s)),r.lines.map((i,s)=>n.jsx("path",{d:i.path,fill:"none",stroke:i.color,strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},s)),r.xLabels.map((i,s)=>n.jsx("text",{x:i.x,y:r.H-10,textAnchor:"middle",className:"fill-text-tertiary",fontSize:10,children:i.label},s))]})}),n.jsx("div",{className:"flex gap-4 mt-2 justify-center",children:r.lines.map(i=>n.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-text-secondary",children:[n.jsx("span",{className:"w-2.5 h-2.5 rounded-full",style:{backgroundColor:i.color}}),n.jsx("span",{children:Zc(i.model)})]},i.model))})]})}function pk({onMenuClick:e,onNewChat:t,onSplitTerminal:r,onHistory:i,hasHistory:s,rightActions:l}){const{t:d}=re(),{topic:a,status:o,currentModel:c}=Qe(),{mainView:p,layout:g,terminalTitle:b}=Ne(),[x,k]=C.useState(!1),v=C.useRef(null),h=p==="terminal",u=Qt(g)<_h;C.useEffect(()=>{if(!x)return;const S=w=>{v.current&&!v.current.contains(w.target)&&k(!1)};return document.addEventListener("mousedown",S),()=>document.removeEventListener("mousedown",S)},[x]);const f=C.useCallback(S=>{k(!1),r==null||r(S)},[r]),y=()=>{switch(p){case"chat":return a||d("chat.newChat");case"terminal":return b||d("terminal.title");case"settings":return d("settings.title");case"tasks":return d("scheduled.title");case"plugins":return d("sidebar.nav.plugins");case"workers":return d("workers.title");case"metrics":return d("sidebar.metrics");case"logs":return d("sidebar.logs");case"docs":return d("sidebar.docs");case"remote-control":return d("sidebar.remoteControl");case"keybindings":return d("keybindings.title");default:return""}},E=c?c.replace(/^(claude-|gpt-|deepseek-)/,"").split("-").slice(0,2).join("-"):"",_=()=>l||(h?n.jsxs("div",{ref:v,className:"relative",children:[n.jsx("button",{onClick:()=>u&&k(!x),className:`text-text-secondary transition-colors flex items-center justify-center w-8 h-8 rounded-full ${u?"hover:text-text-primary hover:bg-bg-secondary":"opacity-40 cursor-not-allowed"}`,title:u?void 0:d("terminal.maxPanes"),"aria-label":"Split terminal",children:n.jsx(md,{size:20})}),x&&n.jsxs("div",{className:"absolute right-0 top-full mt-1 bg-bg-secondary border border-border-muted rounded-lg shadow-lg py-1 z-50 min-w-[140px]",children:[n.jsxs("button",{onClick:()=>f("horizontal"),className:"w-full flex items-center gap-3 px-4 py-2.5 text-[13px] text-text-primary hover:bg-bg-hover transition-colors",children:[n.jsx(md,{size:16,className:"text-text-secondary"}),n.jsx("span",{children:d("terminal.splitHorizontal")})]}),n.jsxs("button",{onClick:()=>f("vertical"),className:"w-full flex items-center gap-3 px-4 py-2.5 text-[13px] text-text-primary hover:bg-bg-hover transition-colors",children:[n.jsx(Sf,{size:16,className:"text-text-secondary"}),n.jsx("span",{children:d("terminal.splitVertical")})]})]})]}):p==="chat"?n.jsxs("div",{className:"flex items-center gap-1",children:[n.jsx("button",{onClick:t,className:"text-text-secondary hover:text-text-primary transition-colors flex items-center justify-center w-8 h-8 rounded-full hover:bg-bg-secondary","aria-label":"New chat",children:n.jsx(ct,{size:20})}),s&&n.jsx("button",{onClick:i,className:"text-text-secondary hover:text-text-primary transition-colors flex items-center justify-center w-8 h-8 rounded-full hover:bg-bg-secondary",title:d("sidebar.chatHistory"),"aria-label":"Chat history",children:n.jsx(ep,{size:18})})]}):null);return n.jsxs("div",{className:"flex items-center justify-between px-4 sm:px-6 h-14 bg-bg-primary text-xs flex-shrink-0 transition-colors duration-200 sticky top-0 z-10",role:"banner","aria-label":"Status bar",children:[n.jsx("div",{className:"flex items-center gap-4",children:n.jsx("button",{onClick:e,className:"text-text-secondary hover:text-text-primary transition-colors flex items-center justify-center w-8 h-8 rounded-full hover:bg-bg-secondary","aria-label":"Toggle sidebar",children:n.jsx(Fi,{size:20})})}),n.jsxs("div",{className:"flex-1 flex flex-col justify-center items-center min-w-0 px-2",children:[n.jsx("span",{className:"font-medium text-text-primary text-[15px] tracking-wide truncate max-w-full",children:y()}),p==="chat"&&(E||o==="connected")&&n.jsx("span",{className:"hidden sm:block text-[10px] text-text-tertiary mt-0.5 truncate max-w-[200px]",children:[o==="connected"?"":"disconnected",E].filter(Boolean).join(" · ")})]}),n.jsx("div",{className:"flex items-center",children:_()})]})}let ni=1e5;function hk(e){if(!Array.isArray(e))return[];const t=[];let r=null;for(const i of e)if(i.sessionUpdate==="user_message_chunk"){r&&(t.push(r),r=null);const s=i.content,l=(s==null?void 0:s.text)||"";if(!l.trim())continue;t.push({type:"message",id:`member-msg-${++ni}`,role:"user",content:l,timestamp:Date.now()})}else if(i.sessionUpdate==="agent_message_chunk"){const s=i.content;if((s==null?void 0:s.type)==="thinking")continue;const l=(s==null?void 0:s.text)||"";if(!l)continue;r?r={...r,content:r.content+l}:r={type:"message",id:`member-msg-${++ni}`,role:"assistant",content:l,timestamp:Date.now()}}else if(i.sessionUpdate==="tool_call"){r&&(t.push(r),r=null);const l=(i._meta||{})["codebuddy.ai/toolName"]||"";t.push({type:"tool_call",id:i.toolCallId||`member-tc-${++ni}`,name:i.title||l||i.kind||"tool",kind:i.kind||"other",toolName:l,input:i.rawInput||i.input,status:i.status==="completed"?"completed":i.status==="failed"?"failed":"running",locations:i.locations,content:i.content})}else if(i.sessionUpdate==="tool_call_update"){const s=t.findIndex(l=>l.type==="tool_call"&&l.id===i.toolCallId);if(s!==-1){const l=t[s];t[s]={...l,status:i.status==="completed"?"completed":i.status==="failed"?"failed":l.status,result:i.rawOutput||i.toolResult||l.result,...i.content!==void 0?{content:i.content}:{}}}}return r&&t.push(r),t}function mk(){var b;const e=He(x=>x.focusedMemberName),t=He(x=>x.memberHistories),r=He(x=>x.members),i=He(x=>x.setFocusedMember),s=C.useRef(null),l=r.find(x=>x.name===e),d=e&&t[e]||[],a=C.useMemo(()=>hk(d),[d]),o=C.useMemo(()=>eh(a),[a]);C.useEffect(()=>{s.current&&(s.current.scrollTop=s.current.scrollHeight)},[o]);const c=C.useCallback(()=>{i(null)},[i]),p=(l==null?void 0:l.status)==="running"||(l==null?void 0:l.status)==="pending",{t:g}=re();return n.jsxs("div",{ref:s,className:"absolute inset-0 overflow-y-auto overflow-x-hidden",children:[n.jsx("div",{className:"sticky top-0 z-10 bg-bg-primary/95 backdrop-blur-sm border-b border-border-muted/30",children:n.jsxs("div",{className:"max-w-3xl mx-auto px-4 sm:px-6 py-3 flex items-center gap-3",children:[n.jsx("button",{type:"button",onClick:c,className:"p-1.5 rounded-md hover:bg-bg-secondary text-text-tertiary hover:text-text-secondary transition-colors",title:g("team.backToMain"),children:n.jsx(nr,{size:16})}),n.jsx(rn,{size:16,className:"text-accent-purple flex-shrink-0"}),n.jsxs("span",{className:"text-[14px] font-semibold text-accent-purple",children:["@",e]}),(l==null?void 0:l.description)&&n.jsx("span",{className:"text-[12px] text-text-tertiary truncate flex-1",children:l.description}),p&&n.jsx(xe,{size:14,className:"animate-spin text-accent-purple flex-shrink-0"}),n.jsx("div",{className:"flex-1"}),l&&n.jsxs("span",{className:"text-[11px] text-text-tertiary flex-shrink-0",children:[l.toolCallCount?g("team.tools").replace("{count}",String(l.toolCallCount)):"",(b=l.tokenUsage)!=null&&b.lastContextWindow?`${l.toolCallCount?" · ":""}${g("team.tokens").replace("{count}",String(Math.round(l.tokenUsage.lastContextWindow/1e3))+"k")}`:""]})]})}),n.jsx("div",{className:"px-4 sm:px-6 pt-4 pb-8",children:n.jsxs("div",{className:"max-w-3xl mx-auto flex flex-col",children:[p&&o.length===0?n.jsxs("div",{className:"flex items-center justify-center gap-2 py-20 text-text-tertiary text-[13px]",children:[n.jsx(xe,{size:16,className:"animate-spin"}),n.jsx("span",{children:g("team.loadingHistory")})]}):o.length===0?n.jsx("div",{className:"flex items-center justify-center py-20 text-text-tertiary text-[13px]",children:g("team.noHistory")}):o.map((x,k)=>{if(x.kind==="user"){const v=x.entry.content?Jp(x.entry.content):void 0;if(v)return v.from==="system"?null:n.jsx("div",{children:n.jsx(Qp,{msg:v})},x.entry.id);let h=x.entry.content||"";return h=h.replace(/<system-reminder>[\s\S]*?<\/system-reminder>\s*/g,"").trim(),h?n.jsx("div",{className:"flex justify-end mb-6",children:n.jsx("div",{className:"max-w-[85%] sm:max-w-[75%] px-5 py-3 rounded-2xl rounded-tr-sm bg-bg-user border border-transparent",children:n.jsx("p",{className:"whitespace-pre-wrap break-words text-text-primary text-chat",children:h})})},x.entry.id):null}return x.kind==="assistant_message"?n.jsx("div",{className:"mb-6",children:n.jsx(Wc,{message:x.entry})},x.entry.id):x.kind==="assistant_tools"?n.jsx("div",{className:"mb-6",children:n.jsx(Zp,{entries:x.entries})},`tools-${k}`):null}),p&&o.length>0&&n.jsxs("div",{className:"flex items-center gap-2 py-4 text-text-tertiary text-[12px]",children:[n.jsx(xe,{size:12,className:"animate-spin"}),n.jsx("span",{children:g("team.agentRunning")})]})]})})]})}let gk=0;const fk={info:5e3,success:5e3,warn:8e3,error:0},Yt=Ce((e,t)=>({toasts:[],addToast:(r,i)=>{const s=`toast-${++gk}`,l={id:s,type:r,message:i,createdAt:Date.now()};e(a=>({toasts:[...a.toasts.slice(-2),l]}));const d=fk[r];d>0&&setTimeout(()=>{t().removeToast(s)},d)},removeToast:r=>{e(i=>({toasts:i.toasts.filter(s=>s.id!==r)}))},clearAll:()=>e({toasts:[]})})),Iu={info:e=>Yt.getState().addToast("info",e),warn:e=>Yt.getState().addToast("warn",e),error:e=>Yt.getState().addToast("error",e),success:e=>Yt.getState().addToast("success",e)},bk={info:Tg,success:Rm,warn:_r,error:nn},yk={info:"text-accent-blue",success:"text-accent-green",warn:"text-accent-yellow",error:"text-accent-red"};function xk({item:e}){const t=Yt(d=>d.removeToast),[r,i]=C.useState(!1),s=bk[e.type],l=()=>{i(!0),setTimeout(()=>t(e.id),200)};return n.jsxs("div",{role:"alert",className:["flex items-start gap-3 px-4 py-3 rounded-xl border border-border-default shadow-lg","bg-bg-card backdrop-blur-sm","max-w-[360px] min-w-[280px]","transition-all duration-200",r?"opacity-0 translate-x-4":"opacity-100 translate-x-0","animate-fadeIn"].join(" "),children:[n.jsx(s,{size:18,className:`${yk[e.type]} shrink-0 mt-0.5`}),n.jsx("p",{className:"flex-1 text-[13px] text-text-primary leading-[1.5] break-words",children:e.message}),n.jsx("button",{onClick:l,"aria-label":"Dismiss",className:"shrink-0 w-5 h-5 flex items-center justify-center rounded text-text-tertiary hover:text-text-primary transition-colors",children:n.jsx(we,{size:14})})]})}function vk(){const e=Yt(t=>t.toasts);return e.length===0?null:n.jsx("div",{className:"fixed bottom-6 right-6 z-[999] flex flex-col-reverse gap-2 pointer-events-auto max-md:bottom-20 max-md:right-4 max-md:left-4 max-md:items-stretch",children:e.map(t=>n.jsx(xk,{item:t},t.id))})}function _k(e,t){const r=[];for(const i of e)i.type==="tool_call"&&r.push(i);for(const i of t.values())r.push(i);return r}function Sk(e,t){const r={};for(const i of e){const s=i.input||{},l=i.toolName;if(l==="TaskCreate"){const d=i.result,a=typeof d=="string"?d:d&&typeof d=="object"?String(d.text??d.output??""):"",o=!a&&Array.isArray(i.content)?i.content.reduce((b,x)=>{var k;return b||String(((k=x==null?void 0:x.content)==null?void 0:k.text)??(x==null?void 0:x.text)??"")},""):"",c=(a||o).match(/Task #(\d+)/),p=c?c[1]:`t-${Object.keys(r).length+1}`;let g=s.owner?String(s.owner):void 0;if(!g&&(t!=null&&t.length)){const b=s.subject?String(s.subject).toLowerCase():"",x=s.description?String(s.description).toLowerCase():"",k=b+" "+x;for(const v of t)if(k.includes(v.toLowerCase())){g=v;break}}r[p]={id:p,subject:s.subject?String(s.subject):"",status:"pending",owner:g,activeForm:s.activeForm?String(s.activeForm):void 0}}else if(l==="TaskUpdate"){const d=s.taskId?String(s.taskId):void 0;if(d&&r[d]){const a=r[d];s.status&&s.status!=="deleted"&&(a.status=String(s.status)),s.subject&&(a.subject=String(s.subject)),s.owner!==void 0&&(a.owner=s.owner?String(s.owner):void 0),s.activeForm&&(a.activeForm=String(s.activeForm)),s.status==="deleted"&&delete r[d]}}}return Object.values(r)}function kk(e){return e.filter(t=>t.toolName==="TaskCreate"||t.toolName==="TaskUpdate").length}function wk({status:e}){switch(e){case"completed":return n.jsx(Wu,{size:14,className:"text-accent-green flex-shrink-0"});case"in_progress":return n.jsx(xe,{size:14,className:"text-accent-brand flex-shrink-0 animate-spin"});default:return n.jsx(Mm,{size:14,className:"text-text-tertiary flex-shrink-0"})}}function Ek({member:e,isFocused:t,onClick:r}){var o;const i=e.status==="running"||e.status==="pending",s=e.status==="failed"||e.status==="killed",l=Sy(e.color),d=zi(e.color),a=[];return e.toolCallCount&&a.push(`${e.toolCallCount} tools`),(o=e.tokenUsage)!=null&&o.lastContextWindow&&a.push(`${(e.tokenUsage.lastContextWindow/1e3).toFixed(1)}k`),n.jsxs("button",{type:"button",onClick:r,className:`inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[11px] transition-colors cursor-pointer ${t?`${l.bg}`:i?`${l.bg} hover:opacity-80`:s?"bg-accent-red/10 text-accent-red":"bg-bg-secondary/50 text-text-tertiary hover:bg-bg-secondary/70"}`,style:{color:t||i?d:void 0,...t?{boxShadow:`0 0 0 1px ${d}40`}:{}},children:[n.jsxs("span",{className:"font-medium",children:["@",e.name]}),a.length>0&&n.jsx("span",{className:"opacity-70",children:a.join(" · ")}),i&&n.jsx(xe,{size:9,className:"animate-spin flex-shrink-0"}),s&&n.jsx(nn,{size:9,className:"flex-shrink-0"}),!i&&!s&&n.jsx($t,{size:9,className:"flex-shrink-0"})]})}function Ck(){const e=rt(R=>R.timeline),t=rt(R=>R.childToolCalls),r=rt(R=>R.isAgentRunning),{t:i}=re(),[s,l]=C.useState(!0),d=He(R=>R.isInTeam),a=He(R=>R.members),o=He(R=>R.focusedMemberName),c=He(R=>R.setFocusedMember),p=C.useMemo(()=>{const R=new Map;for(const q of a)q.color&&R.set(q.name,q.color);return R},[a]),g=C.useRef(0),[b,x]=C.useState(!1),k=C.useRef(r),v=C.useMemo(()=>_k(e,t),[e,t]),h=C.useMemo(()=>a.map(R=>R.name),[a]),m=C.useMemo(()=>Sk(v,h),[v,h]),u=C.useMemo(()=>kk(v),[v]);C.useEffect(()=>{!k.current&&r&&(g.current=u,x(!0)),k.current=r},[r,u]),C.useEffect(()=>{b&&u>g.current&&x(!1)},[b,u]);const f=C.useCallback(()=>l(R=>!R),[]),y=C.useCallback(R=>{R.stopPropagation(),g.current=u,x(!0)},[u]),E=C.useCallback(R=>{c(o===R?null:R)},[o,c]),_=C.useCallback(R=>{R.owner&&p.has(R.owner)&&c(o===R.owner?null:R.owner)},[o,p,c]),S=a.filter(R=>R.status==="running"||R.status==="pending"),w=S.length>0,N=!r&&w,L=d&&a.length>0,I=m.length>0,$=I&&m.every(R=>R.status==="completed"),A=L&&!w&&!r,B=I&&m.every(R=>R.status==="pending")&&!r&&!w,H=I&&!($||A||B)&&!b,U=L&&(w||o);if(!H&&!U)return null;const F=m.filter(R=>R.status==="completed").length,T=m.length,D=m.find(R=>R.status==="in_progress"),O=D?D.activeForm||D.subject:`${F}/${T}`;return n.jsx("div",{className:"flex-none px-4 sm:px-6 pb-1",children:n.jsx("div",{className:"max-w-3xl mx-auto",children:n.jsxs("div",{className:"rounded-lg border border-border-muted/15 bg-bg-secondary/30 overflow-hidden",children:[n.jsxs("button",{onClick:f,className:"flex items-center gap-2 w-full px-3 py-1.5 hover:bg-bg-hover/30 transition-colors cursor-pointer",children:[N?n.jsx(xe,{size:13,className:"animate-spin text-accent-purple flex-shrink-0"}):U?n.jsx(mp,{size:13,className:"text-accent-purple flex-shrink-0"}):n.jsx(np,{size:13,className:"text-text-tertiary flex-shrink-0"}),N?n.jsx("span",{className:"text-xs font-medium text-accent-purple",children:i("team.waitingForTeammates").replace("{count}",String(S.length)).replace("{s}",S.length>1?"s":"")}):n.jsxs(n.Fragment,{children:[H&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"text-xs font-medium text-text-primary",children:i("todo.title")}),n.jsxs("span",{className:"text-[11px] text-text-tertiary tabular-nums",children:[F,"/",T]})]}),U&&H&&n.jsx("span",{className:"text-border-muted/40",children:"·"}),U&&n.jsxs("span",{className:"text-[11px] text-text-tertiary",children:[i("team.title")," ",S.length>0?i("team.activeCount").replace("{count}",String(S.length)):""]})]}),!s&&H&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"text-border-muted/60 select-none",children:"|"}),D&&r&&n.jsx(xe,{size:10,className:"text-accent-brand animate-spin flex-shrink-0"}),n.jsx("span",{className:"text-xs text-text-secondary truncate flex-1 text-left",children:O})]}),n.jsx("span",{className:"flex-1"}),!r&&!N&&n.jsx("span",{role:"button",tabIndex:0,onClick:y,onKeyDown:R=>{R.key==="Enter"&&y(R)},className:"text-text-tertiary hover:text-text-primary p-0.5 rounded transition-colors flex-shrink-0",children:n.jsx(we,{size:12})}),s?n.jsx(et,{size:12,className:"text-text-tertiary flex-shrink-0"}):n.jsx(Ee,{size:12,className:"text-text-tertiary flex-shrink-0"})]}),s&&n.jsxs("div",{className:"border-t border-border-muted/40",children:[U&&n.jsx("div",{className:"flex flex-wrap gap-1.5 px-3 py-1.5",children:a.map(R=>n.jsx(Ek,{member:R,isFocused:o===R.name,onClick:()=>E(R.name)},R.name))}),H&&n.jsx("div",{className:`px-3 py-1.5 space-y-0.5 max-h-52 overflow-y-auto ${U?"border-t border-border-muted/30":""}`,children:m.map((R,q)=>{const G=R.owner?p.get(R.owner):void 0,K=!!G,W=G?zi(G):void 0;return n.jsxs("div",{onClick:K?()=>_(R):void 0,className:`flex items-center gap-2 py-0.5 text-xs ${K?"cursor-pointer hover:bg-bg-hover/30 rounded px-1 -mx-1":""} ${R.status==="in_progress"?"text-text-primary":R.status==="completed"?"text-text-tertiary":"text-text-secondary"}`,children:[n.jsx(wk,{status:R.status}),n.jsxs("span",{className:`truncate ${R.status==="completed"?"line-through":""}`,children:[q+1,". ",R.status==="in_progress"?R.activeForm||R.subject||i("todo.untitled"):R.subject||i("todo.untitled")]}),G&&n.jsxs("span",{className:"text-[10px] font-medium flex-shrink-0 ml-auto",style:{color:W},children:["@",R.owner]})]},R.id)})})]})]})})})}const Tk=Ce((e,t)=>({traces:[],total:0,loading:!1,error:null,selectedTraceId:null,traceDetail:null,detailLoading:!1,selectedSpanId:null,workerPid:null,filterSessionId:null,fetchTraces:async()=>{e({loading:!0,error:null});try{const{workerPid:r,filterSessionId:i}=t(),s=new URLSearchParams;s.set("limit","100"),r&&s.set("worker_pid",r),i&&s.set("session_id",i);const l=await fetch(`/api/v1/traces?${s}`,{headers:ce()});if(!l.ok)throw new Error(`HTTP ${l.status}`);const a=(await l.json()).data||{};e({traces:a.traces||[],total:a.total||0,loading:!1})}catch(r){e({error:r.message,loading:!1})}},fetchTraceDetail:async r=>{e({detailLoading:!0,selectedTraceId:r,selectedSpanId:null});try{const{workerPid:i}=t(),s=new URLSearchParams;i&&s.set("worker_pid",i);const l=s.toString()?`?${s}`:"",d=await fetch(`/api/v1/traces/${r}${l}`,{headers:ce()});if(!d.ok)throw new Error(`HTTP ${d.status}`);const a=await d.json();e({traceDetail:a.data||null,detailLoading:!1})}catch{e({traceDetail:null,detailLoading:!1})}},selectTrace:r=>{r===t().selectedTraceId?e({selectedTraceId:null,traceDetail:null,selectedSpanId:null}):r?t().fetchTraceDetail(r):e({selectedTraceId:null,traceDetail:null,selectedSpanId:null})},selectSpan:r=>e({selectedSpanId:r}),setWorkerPid:r=>{e({workerPid:r,selectedTraceId:null,traceDetail:null,selectedSpanId:null}),t().fetchTraces()},setFilterSessionId:r=>{e({filterSessionId:r,selectedTraceId:null,traceDetail:null,selectedSpanId:null}),t().fetchTraces()},clearTraces:async()=>{try{const{workerPid:r}=t(),i=new URLSearchParams;r&&i.set("worker_pid",r);const s=i.toString()?`?${i}`:"";await fetch(`/api/v1/traces${s}`,{method:"DELETE",headers:ce()}),e({traces:[],total:0,selectedTraceId:null,traceDetail:null,selectedSpanId:null})}catch{}}})),Je={agent:{light:"#3b82f6",dark:"#60a5fa"},generation:{light:"#8b5cf6",dark:"#a78bfa"},function:{light:"#10b981",dark:"#34d399"},tool:{light:"#10b981",dark:"#34d399"},handoff:{light:"#f59e0b",dark:"#fbbf24"},guardrail:{light:"#f97316",dark:"#fb923c"},response:{light:"#6366f1",dark:"#818cf8"},custom:{light:"#6b7280",dark:"#9ca3af"}},Rh={agent:rn,generation:dp,function:Xt,tool:Xt,handoff:Zu,guardrail:Lg,response:op,custom:Tr};function Ln(e){const t=new Map,r=[];for(const l of e)t.set(l.spanId,{span:l,children:[],depth:0});for(const l of t.values())if(l.span.parentId&&l.span.parentId!==l.span.spanId&&t.has(l.span.parentId)){const d=t.get(l.span.parentId);d.children.push(l),l.depth=d.depth+1}else r.push(l);const i=new Set,s=[...r];for(;s.length;){const l=s.shift();if(!i.has(l.span.spanId)){i.add(l.span.spanId);for(const d of l.children)d.depth=l.depth+1,s.push(d)}}return r.length===0&&e.length>0?e.map(l=>({span:l,children:[],depth:0})):r}function Jc(e,t){const r=[],i=new Set;function s(l){for(const d of l)i.has(d.span.spanId)||(i.add(d.span.spanId),r.push({span:d.span,depth:d.depth}),t!=null&&t.has(d.span.spanId)||s(d.children))}return s(e),r}function Ru(e,t){return t.some(r=>r.parentId===e)}function Nk(){var K;const{t:e}=re(),t=qe(W=>W.resolved),{traces:r,loading:i,error:s,selectedTraceId:l,traceDetail:d,detailLoading:a,selectedSpanId:o,workerPid:c,filterSessionId:p,fetchTraces:g,selectSpan:b,setWorkerPid:x,setFilterSessionId:k,clearTraces:v,fetchTraceDetail:h}=Tk(),{workers:m,fetchWorkers:u}=Rn(),{sessionId:f}=Qe(),[y,E]=C.useState("list"),[_,S]=C.useState("timeline"),[w,N]=C.useState(!1);C.useEffect(()=>{g(),u()},[g,u]);const L=C.useCallback(W=>{h(W),E("detail")},[h]),I=C.useCallback(()=>{E("list"),b(null)},[b]),$=C.useCallback(()=>{y==="detail"&&l?h(l):g()},[y,l,g,h]),A=C.useMemo(()=>r.filter(W=>W.category!=="auxiliary"),[r]),B=C.useMemo(()=>r.filter(W=>W.category==="auxiliary"),[r]);if(y==="list")return n.jsxs("div",{className:"flex-1 overflow-auto p-4 md:p-6",children:[n.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[n.jsx(op,{size:20,className:"text-text-secondary"}),n.jsx("h1",{className:"text-lg font-semibold text-text-primary",children:e("traces.title")}),n.jsx("div",{className:"flex-1"}),f&&n.jsxs("select",{value:p||"",onChange:W=>k(W.target.value||null),className:"px-2 py-1 rounded-md border border-border-default bg-bg-primary text-text-primary text-xs",children:[n.jsx("option",{value:"",children:e("traces.allSessions")}),n.jsxs("option",{value:f,children:[f.substring(0,8),"... (",e("traces.current"),")"]})]}),m.length>1&&n.jsx($k,{workers:m,selectedPid:c,onSelect:x}),n.jsx(ii,{icon:We,title:e("traces.refresh"),onClick:$,spin:i}),r.length>0&&n.jsx(ii,{icon:sr,title:e("traces.clear"),onClick:()=>{confirm(e("traces.clearConfirm"))&&v()},danger:!0})]}),s&&n.jsx("div",{className:"mb-4 px-3 py-2 rounded-lg bg-accent-red/10 text-accent-red text-sm",children:s}),!i&&!r.length&&!s&&n.jsx("div",{className:"text-center py-16 text-text-tertiary text-sm",children:e("traces.noData")}),n.jsx("div",{className:"space-y-1",children:A.map(W=>n.jsx(Lu,{trace:W,onClick:()=>L(W.traceId)},W.traceId))}),B.length>0&&n.jsxs("div",{className:"mt-4",children:[n.jsxs("button",{onClick:()=>N(!w),className:"flex items-center gap-1.5 text-xs text-text-tertiary hover:text-text-secondary mb-1",children:[w?n.jsx(et,{size:12}):n.jsx(Ee,{size:12}),n.jsx("span",{children:e("traces.auxiliaryCount").replace("{count}",String(B.length))})]}),w&&n.jsx("div",{className:"space-y-1 opacity-70",children:B.map(W=>n.jsx(Lu,{trace:W,onClick:()=>L(W.traceId)},W.traceId))})]})]});const M=d;if(!M)return n.jsx("div",{className:"flex-1 flex flex-col items-center justify-center gap-4",children:a?n.jsx("div",{className:"text-text-tertiary text-sm",children:e("traces.loading")}):n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"text-text-tertiary text-sm",children:e("traces.noData")}),n.jsx("button",{onClick:I,className:"px-4 py-2 rounded-lg border border-border-default text-text-secondary text-sm hover:bg-bg-hover",children:e("traces.back")})]})});const H=M.trace,U=M.spans,F=H.modelInfo,T=Mk(U),D=(F==null?void 0:F.totalInputTokens)||T.totalInputTokens,O=(F==null?void 0:F.totalOutputTokens)||T.totalOutputTokens,R=(K=F==null?void 0:F.models)!=null&&K.length?F.models:T.models,q=F!=null&&F.totalInputTokens&&F.totalCachedTokens?F.totalCachedTokens/F.totalInputTokens*100:T.cacheHitRate,G=(F==null?void 0:F.callCount)||T.generationCount;return n.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[n.jsxs("div",{className:"flex-none border-b border-border-default bg-bg-primary px-4 py-2",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("button",{onClick:I,className:"p-1 rounded hover:bg-bg-hover text-text-tertiary",children:n.jsx(nr,{size:16})}),n.jsx("span",{className:"font-medium text-text-primary truncate",children:H.prompt||H.name}),n.jsx("div",{className:"flex-1"}),n.jsx(Qc,{color:Lh(H.status),children:e(Dh(H.status))}),n.jsx(ii,{icon:We,title:e("traces.refresh"),onClick:$,spin:a})]}),n.jsxs("div",{className:"flex flex-wrap items-center gap-x-5 gap-y-1 mt-2 text-xs",children:[n.jsx(Lt,{label:e("traces.duration"),value:H.duration!=null?it(H.duration):"--"}),n.jsx(Lt,{label:"Spans",value:String(H.spanCount||0)}),D+O>0&&n.jsx(Lt,{label:"Tokens",value:`${fn(D)} in / ${fn(O)} out`}),D>0&&n.jsx(Lt,{label:"Cache",value:`${q.toFixed(0)}%`,accent:q>0}),R.length>0&&n.jsx(Lt,{label:e("traces.spanDetail.model"),value:R.join(", ")}),T.toolCount>0&&n.jsx(Lt,{label:"Tools",value:`${T.toolCount}${T.errorCount>0?` (${T.errorCount} err)`:""}`}),G>0&&n.jsx(Lt,{label:"LLM",value:e("traces.llmCalls").replace("{count}",String(G))})]}),n.jsxs("div",{className:"flex items-center gap-1 mt-2 overflow-x-auto",children:[["timeline","tree","flame","graph"].map(W=>n.jsx("button",{onClick:()=>S(W),className:`px-3 py-1 rounded-md text-xs font-medium transition-colors whitespace-nowrap ${_===W?"bg-accent-brand/10 text-accent-brand":"text-text-tertiary hover:text-text-primary hover:bg-bg-hover"}`,children:e(`traces.tab.${W}`)},W)),n.jsx("div",{className:"flex-1"}),n.jsx("div",{className:"hidden md:flex",children:n.jsx(Pk,{theme:t})})]})]}),n.jsx("div",{className:"flex-1 overflow-auto",children:n.jsxs("div",{className:"h-full flex flex-col",children:[n.jsxs("div",{className:"flex-1 overflow-auto p-2 md:p-4",children:[_==="timeline"&&n.jsx(Ik,{detail:M,selectedSpanId:o,onSelectSpan:b,theme:t}),_==="tree"&&n.jsx(Rk,{detail:M,selectedSpanId:o,onSelectSpan:b,theme:t}),_==="flame"&&n.jsx(Lk,{detail:M,selectedSpanId:o,onSelectSpan:b,theme:t}),_==="graph"&&n.jsx(Dk,{detail:M,selectedSpanId:o,onSelectSpan:b,theme:t})]}),o&&n.jsx(Ok,{span:M.spans.find(W=>W.spanId===o)||null,onClose:()=>b(null)})]})})]})}function Lu({trace:e,onClick:t}){var a,o,c;const{t:r}=re(),i=jk(e.status),s=e.prompt||e.name,l=Fk(e.startedAt),d=e.category==="auxiliary";return n.jsxs("button",{onClick:t,className:"w-full flex items-start gap-3 px-3 py-2.5 rounded-lg border border-border-default text-left hover:bg-bg-hover transition-colors group",children:[n.jsx("span",{className:`w-2 h-2 rounded-full shrink-0 mt-1.5 bg-${i}`}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[d&&n.jsx("span",{className:"shrink-0 text-[10px] px-1 py-0 rounded bg-bg-hover text-text-tertiary",children:r("traces.auto")}),n.jsx("span",{className:`font-medium text-sm truncate ${d?"text-text-secondary":"text-text-primary"}`,children:s}),n.jsx(Qc,{color:Lh(e.status),children:r(Dh(e.status))})]}),n.jsxs("div",{className:"flex items-center gap-3 mt-0.5 text-xs text-text-tertiary",children:[n.jsx("span",{children:l}),n.jsx("span",{children:e.duration!=null?it(e.duration):"--"}),n.jsxs("span",{children:[e.spanCount," spans"]}),e.totalTokens>0&&n.jsx("span",{children:fn(e.totalTokens)}),(o=(a=e.modelInfo)==null?void 0:a.models)!=null&&o.length?n.jsx("span",{children:e.modelInfo.models.join(", ")}):null,(c=e.modelInfo)!=null&&c.callCount?n.jsx("span",{children:r("traces.llmCalls").replace("{count}",String(e.modelInfo.callCount))}):null,e.modelInfo&&e.modelInfo.totalCachedTokens>0&&e.modelInfo.totalInputTokens>0&&n.jsxs("span",{className:"text-accent-green",children:["Cache ",Math.round(e.modelInfo.totalCachedTokens/e.modelInfo.totalInputTokens*100),"%"]})]})]}),n.jsx(Ee,{size:14,className:"text-text-tertiary shrink-0 mt-1.5 opacity-0 group-hover:opacity-100 transition-opacity"})]})}const ot=28,Xr=16,Ak=2;function Ik({detail:e,selectedSpanId:t,onSelectSpan:r,theme:i}){const{t:s}=re(),l=i==="dark",[d,a]=C.useState(new Set),[o,c]=C.useState(""),p=C.useMemo(()=>Ln(e.spans),[e.spans]),g=C.useMemo(()=>Jc(p,d),[p,d]),b=o?g.filter(u=>{var f;return u.span.name.toLowerCase().includes(o.toLowerCase())||((f=u.span.toolName)==null?void 0:f.toLowerCase().includes(o.toLowerCase()))}):g,x=u=>a(f=>{const y=new Set(f);return y.has(u)?y.delete(u):y.add(u),y}),{minTime:k,totalRange:v}=C.useMemo(()=>{const u=e.spans.map(_=>new Date(_.startedAt).getTime()),f=e.spans.filter(_=>_.endedAt).map(_=>new Date(_.endedAt).getTime()),y=Math.min(...u),E=f.length?Math.max(...f):y+1e3;return{minTime:y,totalRange:E-y||1}},[e.spans]);if(!b.length)return n.jsx("div",{className:"text-sm text-text-tertiary py-8 text-center",children:s("traces.noSpans")});const h=220,m=5;return n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[n.jsxs("div",{className:"relative flex-1 max-w-xs",children:[n.jsx(tt,{size:14,className:"absolute left-2 top-1/2 -translate-y-1/2 text-text-tertiary"}),n.jsx("input",{value:o,onChange:u=>c(u.target.value),placeholder:s("traces.search"),className:"w-full pl-7 pr-2 py-1 text-xs rounded-md border border-border-default bg-bg-primary text-text-primary"})]}),n.jsx("button",{onClick:()=>a(new Set),className:"text-xs text-text-tertiary hover:text-text-primary",children:s("traces.expandAll")}),n.jsx("button",{onClick:()=>a(new Set(e.spans.filter(u=>Ru(u.spanId,e.spans)).map(u=>u.spanId))),className:"text-xs text-text-tertiary hover:text-text-primary",children:s("traces.collapseAll")})]}),n.jsxs("div",{className:"flex overflow-x-auto",children:[n.jsx("div",{className:"shrink-0",style:{width:h},children:b.map(u=>{const f=Ru(u.span.spanId,e.spans),y=d.has(u.span.spanId),E=t===u.span.spanId,_=Je[u.span.type]||Je.custom;return n.jsxs("div",{className:`flex items-center gap-1 cursor-pointer text-xs h-[${ot}px] ${E?"bg-accent-brand/5":"hover:bg-bg-hover"}`,style:{paddingLeft:4+u.depth*16,height:ot},onClick:()=>r(E?null:u.span.spanId),children:[f?n.jsx("button",{onClick:S=>{S.stopPropagation(),x(u.span.spanId)},className:"p-0.5",children:y?n.jsx(Ee,{size:12}):n.jsx(et,{size:12})}):n.jsx("span",{className:"w-4"}),n.jsx("span",{className:"w-2 h-2 rounded-sm shrink-0",style:{backgroundColor:l?_.dark:_.light}}),n.jsx("span",{className:"truncate text-text-primary",children:u.span.name})]},u.span.spanId)})}),n.jsx("div",{className:"flex-1 min-w-[300px]",children:n.jsxs("svg",{width:"100%",viewBox:`0 0 900 ${b.length*ot+20}`,className:"block",children:[Array.from({length:m+1},(u,f)=>{const y=f/m*900;return n.jsx("line",{x1:y,y1:0,x2:y,y2:b.length*ot,stroke:l?"#374151":"#e5e7eb",strokeWidth:.5,strokeDasharray:f?"2,2":void 0},f)}),b.map((u,f)=>{var A;const y=f*ot,E=new Date(u.span.startedAt).getTime(),_=u.span.endedAt?new Date(u.span.endedAt).getTime():E+v,S=(E-k)/v*900,w=Math.max((_-E)/v*900,Ak),N=Je[u.span.type]||Je.custom,L=l?N.dark:N.light,I=((A=e.bottleneck)==null?void 0:A.spanId)===u.span.spanId,$=t===u.span.spanId;return n.jsxs("g",{onClick:()=>r($?null:u.span.spanId),style:{cursor:"pointer"},children:[$&&n.jsx("rect",{x:0,y,width:900,height:ot,fill:l?"#1e3a5f":"#dbeafe"}),n.jsx("rect",{x:S,y:y+(ot-Xr)/2,width:w,height:Xr,fill:L,rx:3,opacity:u.span.status==="running"?.5:.85}),I&&n.jsx("rect",{x:S-1,y:y+(ot-Xr)/2-1,width:w+2,height:Xr+2,fill:"none",stroke:"#f59e0b",strokeWidth:1.5,strokeDasharray:"4,2",rx:3}),w>36&&u.span.duration!=null&&n.jsx("text",{x:S+w/2,y:y+ot/2,dominantBaseline:"central",textAnchor:"middle",fontSize:9,fill:"#fff",fontFamily:"monospace",children:it(u.span.duration)}),n.jsxs("title",{children:[u.span.name," — ",u.span.duration!=null?it(u.span.duration):"running"]})]},u.span.spanId)}),Array.from({length:m+1},(u,f)=>n.jsx("text",{x:f/m*900,y:b.length*ot+14,textAnchor:"middle",fontSize:9,fill:l?"#9ca3af":"#6b7280",fontFamily:"monospace",children:it(f/m*v)},`t${f}`))]})})]})]})}function Rk({detail:e,selectedSpanId:t,onSelectSpan:r,theme:i}){const{t:s}=re(),l=i==="dark",d=C.useMemo(()=>Ln(e.spans),[e.spans]);function a(o,c,p){var f;const g=o.span,b=Rh[g.type]||Tr,x=Je[g.type]||Je.custom,k=t===g.spanId,v=((f=e.bottleneck)==null?void 0:f.spanId)===g.spanId,h=c?"└── ":"├── ",m=g.status==="error",u=g.error;return n.jsxs("div",{children:[n.jsxs("div",{className:`flex items-center gap-2 py-1 px-2 rounded cursor-pointer text-sm ${k?"bg-accent-brand/10":"hover:bg-bg-hover"} ${v?"ring-1 ring-accent-yellow":""} ${m?"bg-accent-red/5":""}`,onClick:()=>r(k?null:g.spanId),children:[o.depth>0&&n.jsxs("span",{className:"text-text-tertiary font-mono text-xs whitespace-pre",children:[p,h]}),n.jsx(b,{size:14,style:{color:m?void 0:l?x.dark:x.light},className:`shrink-0 ${m?"text-accent-red":""}`}),n.jsx("span",{className:`font-medium truncate ${m?"text-accent-red":"text-text-primary"}`,children:g.name}),g.duration!=null&&n.jsx("span",{className:"text-xs text-text-tertiary shrink-0",children:it(g.duration)}),(g.type==="generation"||g.type==="response")&&(g.inputTokens||g.outputTokens)&&n.jsxs("span",{className:"text-xs text-accent-purple shrink-0",children:[g.inputTokens||0,"→",g.outputTokens||0," tok"]}),g.model&&n.jsxs("span",{className:"text-xs text-text-tertiary shrink-0",children:["(",g.model,")"]}),m&&n.jsx("span",{className:"text-xs font-medium text-accent-red shrink-0",children:"error"}),v&&n.jsx("span",{className:"text-xs text-accent-yellow shrink-0",children:s("traces.bottleneck")})]}),m&&u&&n.jsx("div",{className:"ml-8 px-2 py-1 text-xs text-accent-red bg-accent-red/5 rounded cursor-pointer",style:{paddingLeft:(o.depth>0?p.length*6+28:8)+24},onClick:()=>r(g.spanId),children:u.length>200?u.substring(0,200)+"...":u}),o.children.length>0&&n.jsx("div",{className:"ml-2",children:o.children.map((y,E)=>a(y,E===o.children.length-1,p+(c?" ":"│ ")))})]},g.spanId)}return d.length?n.jsx("div",{className:"space-y-0.5",children:d.map((o,c)=>a(o,c===d.length-1,""))}):n.jsx("div",{className:"text-sm text-text-tertiary py-8 text-center",children:s("traces.noSpans")})}function Lk({detail:e,selectedSpanId:t,onSelectSpan:r,theme:i}){const{t:s}=re(),l=i==="dark",d=C.useMemo(()=>Jc(Ln(e.spans)),[e.spans]),{minTime:a,totalRange:o}=C.useMemo(()=>{const k=e.spans.map(u=>new Date(u.startedAt).getTime()),v=e.spans.filter(u=>u.endedAt).map(u=>new Date(u.endedAt).getTime()),h=Math.min(...k),m=v.length?Math.max(...v):h+1e3;return{minTime:h,totalRange:m-h||1}},[e.spans]);if(!d.length)return n.jsx("div",{className:"text-sm text-text-tertiary py-8 text-center",children:s("traces.noSpans")});const c=Math.max(...d.map(k=>k.depth))+1,p=24,g=1,b=800,x=c*(p+g);return n.jsx("svg",{width:"100%",viewBox:`0 0 ${b} ${x}`,className:"block",style:{maxWidth:b},children:d.map(k=>{const v=k.span,h=new Date(v.startedAt).getTime(),m=v.endedAt?new Date(v.endedAt).getTime():h+o,u=(h-a)/o*b,f=Math.max((m-h)/o*b,1),y=k.depth*(p+g),E=Je[v.type]||Je.custom,_=l?E.dark:E.light,S=t===v.spanId;return n.jsxs("g",{onClick:()=>r(S?null:v.spanId),style:{cursor:"pointer"},children:[n.jsx("rect",{x:u,y,width:f,height:p,fill:_,rx:2,opacity:S?1:.8,stroke:S?l?"#60a5fa":"#3b82f6":"none",strokeWidth:S?1.5:0}),f>40&&n.jsx("text",{x:u+4,y:y+p/2,dominantBaseline:"central",fontSize:10,fill:"#fff",fontFamily:"monospace",children:v.name.length>f/6?v.name.slice(0,Math.floor(f/6)-1)+"…":v.name}),n.jsxs("title",{children:[v.name," — ",v.duration!=null?it(v.duration):"running",v.model?` (${v.model})`:""]})]},v.spanId)})})}function Dk({detail:e,selectedSpanId:t,onSelectSpan:r,theme:i}){const{t:s}=re(),l=i==="dark",d=C.useRef(null),{groupNodes:a,groupEdges:o}=C.useMemo(()=>{const T=new Map,D=Jc(Ln(e.spans));for(const G of D){const K=G.span,W=`${K.parentId||"root"}::${K.type}::${K.name.split("(")[0].trim()}`,z=T.get(W);z?(z.count++,z.totalDuration+=K.duration||0,z.totalTokens+=(K.inputTokens||0)+(K.outputTokens||0),K.status==="error"&&(z.hasError=!0)):T.set(W,{id:W,type:K.type,name:K.name.split("(")[0].trim(),count:1,totalDuration:K.duration||0,totalTokens:(K.inputTokens||0)+(K.outputTokens||0),hasError:K.status==="error",parentId:K.parentId,depth:G.depth,representativeSpanId:K.spanId})}const O=Array.from(T.values()),R=[];for(const G of O)if(G.parentId){const K=e.spans.find(W=>W.spanId===G.parentId);if(K){const W=`${K.parentId||"root"}::${K.type}::${K.name.split("(")[0].trim()}`;T.has(W)&&W!==G.id&&R.push({from:W,to:G.id})}}const q=new Set(R.map(G=>`${G.from}\0${G.to}`));return{groupNodes:O,groupEdges:Array.from(q).map(G=>{const[K,W]=G.split("\0");return{from:K,to:W}})}},[e.spans]),c=180,p=60,g=70,b=28,{positions:x,svgW:k,svgH:v}=C.useMemo(()=>{const T=new Map;for(const K of a)T.has(K.depth)||T.set(K.depth,[]),T.get(K.depth).push(K);const D=Array.from(T.entries()).sort((K,W)=>K[0]-W[0]),O=Math.max(1,...D.map(([,K])=>K.length)),R=Math.max(O*(c+b)+b,400),q=D.length*(p+g)+20,G=new Map;for(const[K,W]of D){const z=W.length*c+(W.length-1)*b,j=(R-z)/2;W.forEach((X,Y)=>G.set(X.id,{x:j+Y*(c+b),y:K*(p+g)+10}))}return{positions:G,svgW:R,svgH:q}},[a,c,p,g,b]),[h,m]=C.useState({zoom:1,panX:0,panY:0}),[u,f]=C.useState(!1),y=C.useRef({x:0,y:0,panX:0,panY:0}),E=C.useCallback(()=>{const T=d.current;if(!T||k<=0||v<=0)return;const D=T.clientWidth,O=T.clientHeight;if(D<=0||O<=0)return;const R=Math.min(D/k,O/v,1.5)*.9;m({zoom:R,panX:(D-k*R)/2,panY:(O-v*R)/2})},[k,v]);C.useEffect(()=>{E()},[E,a.length]),C.useEffect(()=>{const T=d.current;if(!T)return;const D=O=>{O.preventDefault();const R=T.getBoundingClientRect(),q=O.clientX-R.left,G=O.clientY-R.top,K=O.deltaY<0?1.06:.94;m(W=>{const z=Math.max(.1,Math.min(5,W.zoom*K));return{zoom:z,panX:q-(q-W.panX)*(z/W.zoom),panY:G-(G-W.panY)*(z/W.zoom)}})};return T.addEventListener("wheel",D,{passive:!1}),()=>T.removeEventListener("wheel",D)},[]);const _=C.useRef(null),S=C.useCallback(T=>{if(T.touches.length===2){const D=T.touches[0].clientX-T.touches[1].clientX,O=T.touches[0].clientY-T.touches[1].clientY;_.current={dist:Math.hypot(D,O),cx:(T.touches[0].clientX+T.touches[1].clientX)/2,cy:(T.touches[0].clientY+T.touches[1].clientY)/2}}else T.touches.length===1&&(f(!0),y.current={x:T.touches[0].clientX,y:T.touches[0].clientY,panX:h.panX,panY:h.panY})},[h.panX,h.panY]),w=C.useCallback(T=>{if(T.touches.length===2&&_.current){T.preventDefault();const D=T.touches[0].clientX-T.touches[1].clientX,O=T.touches[0].clientY-T.touches[1].clientY,R=Math.hypot(D,O),q=R/_.current.dist,G=d.current;if(G){const K=G.getBoundingClientRect(),W=_.current.cx-K.left,z=_.current.cy-K.top;m(j=>{const X=Math.max(.1,Math.min(5,j.zoom*q));return{zoom:X,panX:W-(W-j.panX)*(X/j.zoom),panY:z-(z-j.panY)*(X/j.zoom)}})}_.current.dist=R}else T.touches.length===1&&u&&m(D=>({...D,panX:y.current.panX+T.touches[0].clientX-y.current.x,panY:y.current.panY+T.touches[0].clientY-y.current.y}))},[u]),N=C.useCallback(()=>{f(!1),_.current=null},[]),L=C.useCallback(T=>{T.button===0&&(f(!0),y.current={x:T.clientX,y:T.clientY,panX:h.panX,panY:h.panY})},[h.panX,h.panY]),I=C.useCallback(T=>{u&&m(D=>({...D,panX:y.current.panX+T.clientX-y.current.x,panY:y.current.panY+T.clientY-y.current.y}))},[u]),$=C.useCallback(()=>f(!1),[]),A=C.useMemo(()=>{if(!t)return new Set;const T=a.find(W=>W.representativeSpanId===t);if(!T)return new Set;const D=new Set([T.id]),O=new Map;for(const W of o)O.set(W.to,W.from);let R=T.id;for(;O.has(R)&&(R=O.get(R),!D.has(R));)D.add(R);const q=new Map;for(const W of o)q.has(W.from)||q.set(W.from,[]),q.get(W.from).push(W.to);const G=[T.id],K=new Set([T.id]);for(;G.length;){const W=G.shift();for(const z of q.get(W)||[])K.has(z)||(K.add(z),D.add(z),G.push(z))}return D},[t,a,o]),B=C.useCallback((T,D)=>A.has(T)&&A.has(D),[A]);if(!a.length)return n.jsx("div",{className:"text-sm text-text-tertiary py-8 text-center",children:s("traces.noSpans")});const M=l?"#d1d5db":"#374151",H=l?"#9ca3af":"#6b7280",U=l?"#4b5563":"#d1d5db",F=l?"#60a5fa":"#3b82f6";return n.jsxs("div",{ref:d,className:"w-full h-full overflow-hidden relative touch-none",style:{cursor:u?"grabbing":"grab",minHeight:300},onMouseDown:L,onMouseMove:I,onMouseUp:$,onMouseLeave:$,onTouchStart:S,onTouchMove:w,onTouchEnd:N,children:[n.jsx("button",{onClick:E,className:"absolute top-2 right-2 z-10 px-2 py-1 rounded-md bg-bg-secondary border border-border-default text-text-tertiary hover:text-text-primary text-xs",style:{cursor:"pointer"},children:s("traces.fit")}),n.jsx("svg",{width:"100%",height:"100%",style:{position:"absolute",left:0,top:0},children:n.jsxs("g",{transform:`translate(${h.panX},${h.panY}) scale(${h.zoom})`,children:[o.map((T,D)=>{const O=x.get(T.from),R=x.get(T.to);if(!O||!R)return null;const q=O.x+c/2,G=O.y+p,K=R.x+c/2,W=R.y,z=B(T.from,T.to);return n.jsx("path",{d:`M${q},${G} C${q},${G+g/2} ${K},${W-g/2} ${K},${W}`,fill:"none",stroke:z?F:U,strokeWidth:z?2.5:1.5,opacity:A.size>0&&!z?.2:1},D)}),a.map(T=>{const D=x.get(T.id);if(!D)return null;const O=Je[T.type]||Je.custom,R=l?O.dark:O.light,q=t===T.representativeSpanId,G=A.has(T.id),K=A.size>0&&!G,W=T.count>1?`${T.name} x${T.count}`:T.name,z=it(T.totalDuration),j=T.totalTokens>0?` · ${fn(T.totalTokens)}`:"";return n.jsxs("g",{onClick:X=>{X.stopPropagation(),r(q?null:T.representativeSpanId)},style:{cursor:"pointer"},opacity:K?.25:1,children:[n.jsx("rect",{x:D.x,y:D.y,width:c,height:p,rx:8,fill:l?"#1f2937":"#fff",stroke:q?R:T.hasError?"#ef4444":G?F:U,strokeWidth:q?2.5:G?2:1}),n.jsx("rect",{x:D.x,y:D.y,width:6,height:p,rx:3,fill:R}),n.jsx("text",{x:D.x+16,y:D.y+24,fontSize:13,fill:M,fontWeight:T.count>1?600:500,fontFamily:"sans-serif",children:W.length>20?W.slice(0,19)+"…":W}),n.jsxs("text",{x:D.x+16,y:D.y+44,fontSize:11,fill:H,fontFamily:"monospace",children:[z,j]}),n.jsxs("title",{children:[W," — ",z,j]})]},T.id)})]})})]})}function Ok({span:e,onClose:t}){const{t:r}=re(),[i,s]=C.useState("overview");if(!e)return null;const l=Rh[e.type]||Tr,d=e.duration;return n.jsxs("div",{className:"flex-none border-t border-border-default bg-bg-primary max-h-[60%] md:max-h-[40%] overflow-auto",children:[n.jsxs("div",{className:"flex items-center gap-2 px-3 md:px-4 py-2 border-b border-border-default",children:[n.jsx(l,{size:14,className:"text-text-secondary shrink-0"}),n.jsx("span",{className:"font-medium text-text-primary text-sm truncate",children:e.name}),e.duration!=null&&n.jsx("span",{className:"text-xs text-text-tertiary",children:it(e.duration)}),e.status==="error"&&n.jsx(Qc,{color:"red",children:r("traces.status.error")}),n.jsx("div",{className:"flex-1"}),n.jsx("button",{onClick:t,className:"p-1 rounded hover:bg-bg-hover text-text-tertiary",children:n.jsx(we,{size:14})})]}),n.jsx("div",{className:"flex gap-1 px-4 pt-2",children:["overview","io","attrs"].map(a=>n.jsx("button",{onClick:()=>s(a),className:`px-2 py-0.5 rounded text-xs ${i===a?"bg-bg-hover text-text-primary font-medium":"text-text-tertiary hover:text-text-primary"}`,children:r(a==="overview"?"traces.spanDetail.overview":a==="io"?"traces.spanDetail.io":"traces.spanDetail.attributes")},a))}),n.jsxs("div",{className:"px-3 md:px-4 py-3 text-xs",children:[i==="overview"&&n.jsxs("div",{children:[e.error&&n.jsxs("div",{className:"mb-3 px-3 py-2 rounded-md bg-accent-red/10 border border-accent-red/20",children:[n.jsx("div",{className:"font-medium text-accent-red mb-1",children:r("traces.spanDetail.error")}),n.jsx("pre",{className:"text-accent-red font-mono whitespace-pre-wrap break-all max-h-32 overflow-auto",children:e.error})]}),n.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3",children:[n.jsx(mt,{label:r("traces.spanDetail.type"),value:e.type}),n.jsx(mt,{label:r("traces.spanDetail.duration"),value:e.duration!=null?it(e.duration):"--"}),n.jsx(mt,{label:r("traces.selfTime"),value:d!=null?it(d):"--"}),n.jsx(mt,{label:"Status",value:e.status}),e.model&&n.jsx(mt,{label:r("traces.spanDetail.model"),value:e.model}),(e.inputTokens!=null||e.outputTokens!=null)&&n.jsx(mt,{label:r("traces.spanDetail.tokens"),value:`${e.inputTokens||0} in / ${e.outputTokens||0} out`}),e.toolName&&n.jsx(mt,{label:"Tool",value:e.toolName}),e.fromAgent&&n.jsx(mt,{label:"From",value:e.fromAgent}),e.toAgent&&n.jsx(mt,{label:"To",value:e.toAgent})]})]}),i==="io"&&n.jsxs("div",{className:"space-y-3",children:[e.toolInput&&n.jsxs("div",{children:[n.jsx("div",{className:"text-text-tertiary mb-1",children:r("traces.spanDetail.input")}),n.jsx("pre",{className:"p-2 rounded bg-bg-secondary text-text-primary font-mono text-xs whitespace-pre-wrap break-all max-h-40 overflow-auto",children:e.toolInput})]}),e.toolOutput&&n.jsxs("div",{children:[n.jsx("div",{className:"text-text-tertiary mb-1",children:r("traces.spanDetail.output")}),n.jsx("pre",{className:"p-2 rounded bg-bg-secondary text-text-primary font-mono text-xs whitespace-pre-wrap break-all max-h-40 overflow-auto",children:e.toolOutput})]}),!e.toolInput&&!e.toolOutput&&n.jsx("div",{className:"text-text-tertiary",children:r("traces.noIO")})]}),i==="attrs"&&n.jsx("div",{className:"space-y-1",children:e.attributes&&Object.keys(e.attributes).length>0?Object.entries(e.attributes).map(([a,o])=>n.jsxs("div",{className:"flex gap-2",children:[n.jsx("span",{className:"shrink-0 text-text-tertiary w-32",children:a}),n.jsx("span",{className:"text-text-primary font-mono break-all",children:typeof o=="string"?o:JSON.stringify(o)})]},a)):n.jsx("div",{className:"text-text-tertiary",children:r("traces.noAttrs")})})]})]})}function $k({workers:e,selectedPid:t,onSelect:r}){var o;const{t:i}=re(),s=(o=e.find(c=>c.isCurrent))==null?void 0:o.pid,l=e.find(c=>c.isCurrent),d=e.filter(c=>!c.isCurrent),a=t??(s!=null?String(s):"");return n.jsxs("select",{value:a,onChange:c=>{const p=c.target.value;r(p===String(s)?null:p||null)},className:"px-2 py-1 rounded-md border border-border-default bg-bg-primary text-text-primary text-xs",children:[n.jsx("option",{value:"all",children:i("traces.allInstances")}),l&&n.jsxs("option",{value:l.pid,children:["PID ",l.pid," — ",l.name||l.kind||"worker"," (",i("traces.current"),")"]}),d.map(c=>n.jsxs("option",{value:c.pid,children:["PID ",c.pid," — ",c.name||c.kind||"worker"]},c.pid))]})}function ii({icon:e,title:t,onClick:r,spin:i,danger:s}){return n.jsx("button",{onClick:r,className:`p-1.5 rounded-md text-text-tertiary hover:bg-bg-hover transition-colors ${s?"hover:text-accent-red":"hover:text-text-primary"}`,title:t,children:n.jsx(e,{size:16,className:i?"animate-spin":""})})}function Qc({children:e,color:t}){const r=t==="red"?"text-accent-red bg-accent-red/10":t==="yellow"?"text-accent-yellow bg-accent-yellow/10":t==="grey"?"text-text-tertiary bg-bg-hover":"text-accent-green bg-accent-green/10";return n.jsx("span",{className:`shrink-0 text-xs px-1.5 py-0.5 rounded ${r}`,children:e})}function Lh(e){return e==="error"?"red":e==="running"?"yellow":e==="cancelled"?"grey":"green"}function jk(e){return e==="error"?"accent-red":e==="running"?"accent-yellow":e==="cancelled"?"text-tertiary":"accent-green"}function Dh(e){return e==="error"?"traces.status.error":e==="running"?"traces.status.running":e==="cancelled"?"traces.status.cancelled":"traces.status.ok"}function Lt({label:e,value:t,accent:r}){return n.jsxs("span",{className:"inline-flex items-center gap-1",children:[n.jsxs("span",{className:"text-text-tertiary",children:[e,":"]}),n.jsx("span",{className:`font-mono ${r?"text-accent-green font-medium":"text-text-primary"}`,children:t})]})}function Mk(e){var c;let t=0,r=0,i=0;const s=new Set;let l=0,d=0,a=0;for(const p of e)p.status==="error"&&a++,(p.type==="generation"||p.type==="response")&&(d++,t+=p.inputTokens||0,r+=p.outputTokens||0,p.model&&s.add(p.model),(c=p.attributes)!=null&&c.cached_tokens&&(i+=Number(p.attributes.cached_tokens)||0)),(p.type==="function"||p.type==="tool")&&l++;const o=t>0?i/t*100:0;return{totalInputTokens:t,totalOutputTokens:r,cacheHitRate:o,models:Array.from(s),toolCount:l,generationCount:d,errorCount:a}}function mt({label:e,value:t,className:r}){return n.jsxs("div",{className:r,children:[n.jsx("div",{className:"text-text-tertiary mb-0.5",children:e}),n.jsx("div",{className:"text-text-primary font-mono",children:t})]})}function Pk({theme:e}){const{t}=re(),r=e==="dark",i=[["agent",t("traces.legend.agent")],["generation",t("traces.legend.generation")],["function",t("traces.legend.function")],["handoff",t("traces.legend.handoff")],["guardrail",t("traces.legend.guardrail")]];return n.jsx("div",{className:"flex items-center gap-3 text-xs text-text-tertiary",children:i.map(([s,l])=>{const d=Je[s]||Je.custom;return n.jsxs("div",{className:"flex items-center gap-1",children:[n.jsx("span",{className:"w-2.5 h-2 rounded-sm",style:{backgroundColor:r?d.dark:d.light}}),n.jsx("span",{children:l})]},s)})})}function it(e){return e<1?"<1ms":e<1e3?`${Math.round(e)}ms`:e<6e4?`${(e/1e3).toFixed(1)}s`:`${Math.floor(e/6e4)}m${(e%6e4/1e3).toFixed(0)}s`}function fn(e){return e>=1e6?`${(e/1e6).toFixed(1)}M tok`:e>=1e3?`${(e/1e3).toFixed(1)}k tok`:`${e} tok`}function Fk(e){try{return new Date(e).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit"})}catch{return""}}function Bk(e){try{const t=new URL(e),r=window.location.hostname;return t.hostname===r?e:(t.hostname=r,t.toString())}catch(t){return console.warn("Failed to resolve worker URL, using original:",e,t),e}}function Uk({title:e,message:t,confirmLabel:r,cancelLabel:i,danger:s,onConfirm:l,onCancel:d}){const{t:a}=re(),o=C.useRef(null);C.useEffect(()=>{var p;(p=o.current)==null||p.focus()},[]);const c=C.useCallback(p=>{p.key==="Escape"&&(p.preventDefault(),d())},[d]);return n.jsxs("div",{className:"fixed inset-0 z-[200] flex items-center justify-center",onKeyDown:c,children:[n.jsx("div",{className:"absolute inset-0 bg-black/30",onClick:d}),n.jsxs("div",{role:"alertdialog","aria-modal":"true","aria-labelledby":"confirm-title",className:"relative bg-bg-card border border-border-default rounded-xl shadow-2xl w-full max-w-[400px] mx-4 overflow-hidden",children:[n.jsxs("div",{className:"px-5 pt-5 pb-4",children:[s&&n.jsx("div",{className:"w-10 h-10 rounded-full bg-error-bg flex items-center justify-center mb-3",children:n.jsx(_r,{size:20,className:"text-accent-red"})}),n.jsx("h3",{id:"confirm-title",className:"text-text-primary text-[15px] font-semibold mb-1",children:e}),t&&n.jsx("p",{className:"text-text-secondary text-[13px] leading-relaxed",children:t})]}),n.jsxs("div",{className:"flex items-center justify-end gap-2 px-5 pb-4",children:[n.jsx("button",{onClick:d,className:"px-4 py-1.5 text-[13px] text-text-secondary hover:text-text-primary rounded-lg hover:bg-bg-hover transition-colors",children:i||a("app.cancel")}),n.jsx("button",{ref:o,onClick:l,className:["px-4 py-1.5 text-[13px] font-medium rounded-lg transition-colors",s?"bg-accent-red text-white hover:opacity-90":"bg-accent-brand text-bg-primary hover:opacity-90"].join(" "),children:r||a("app.confirm")})]})]})]})}const zk=1e4;function Hk(){const{t:e}=re(),{workers:t,daemon:r,loading:i,error:s,fetchWorkers:l,fetchDaemonStatus:d,killWorker:a,startDaemon:o,stopDaemon:c,restartDaemon:p}=Rn();C.useEffect(()=>{l(),d();const m=setInterval(()=>{l(),d()},zk);return()=>clearInterval(m)},[l,d]);const g=C.useCallback(()=>{l(),d()},[l,d]),b=C.useCallback(m=>{window.location.hash=`#/logs?worker=${m.pid}`},[]),[x,k]=C.useState(null),v=C.useCallback(async m=>{k(m)},[]),h=C.useCallback(async()=>{x&&(await a(String(x.pid)),k(null))},[x,a]);return n.jsxs("div",{className:"flex-1 overflow-auto p-4 md:p-6",children:[x&&n.jsx(Uk,{title:e("workers.action.kill.confirm"),danger:!0,onConfirm:h,onCancel:()=>k(null)}),n.jsxs("div",{className:"flex items-center justify-between mb-6",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(Ft,{size:20,className:"text-accent-brand"}),n.jsx("h1",{className:"text-lg font-semibold text-text-primary",children:e("workers.title")})]}),n.jsxs("button",{onClick:g,className:`flex items-center gap-1.5 px-3 py-1.5 text-sm text-text-secondary
|
|
658
658
|
hover:text-text-primary hover:bg-bg-hover rounded-lg transition-colors`,title:e("workers.refresh"),children:[n.jsx(We,{size:14,className:i?"animate-spin":""}),n.jsx("span",{children:e("workers.refresh")})]})]}),s&&n.jsx("div",{className:"mb-4 p-3 rounded-xl error-banner text-sm",children:s}),n.jsx(Gk,{daemon:r,onStart:()=>o(),onStop:c,onRestart:p}),n.jsx(Wk,{workers:t,onViewLogs:b,onKill:v})]})}function Gk({daemon:e,onStart:t,onStop:r,onRestart:i}){const{t:s}=re(),l=(e==null?void 0:e.status)==="running",[d,a]=C.useState(null),o=C.useCallback(async(c,p)=>{a(c);try{await p()}finally{a(null)}},[]);return n.jsx("div",{className:`bg-bg-secondary rounded-xl p-4 md:p-5 border mb-6 transition-colors worker-card-hover ${l?"border-green-400/40 ring-1 ring-green-400/10":"border-border-default"}`,children:n.jsxs("div",{className:"flex flex-col md:flex-row md:items-center justify-between gap-4",children:[n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(an,{size:18,className:l?"text-green-500":"text-text-tertiary"}),n.jsx("span",{className:"text-base font-semibold text-text-primary",children:s("workers.daemon")}),(e==null?void 0:e.pid)&&n.jsxs("span",{className:"text-xs text-text-tertiary font-mono bg-bg-tertiary px-2 py-0.5 rounded-md ml-2 border border-border-default/50",children:["PID ",e.pid]})]}),n.jsxs("div",{className:"flex items-center gap-4 flex-wrap",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsxs("span",{className:"relative flex h-2.5 w-2.5",children:[l&&n.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-green-400 opacity-75"}),n.jsx("span",{className:`relative inline-flex rounded-full h-2.5 w-2.5 ${l?"bg-green-500":"bg-gray-400"}`})]}),n.jsx("span",{className:"text-sm font-medium text-text-secondary",children:s(l?"workers.daemon.running":"workers.daemon.stopped")})]}),(e==null?void 0:e.endpoint)&&n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx("span",{className:"text-border-primary",children:"|"}),n.jsx(gt,{size:14,className:"text-text-tertiary ml-1"}),n.jsx("a",{href:e.endpoint,target:"_blank",rel:"noopener noreferrer",className:"text-sm text-accent-brand hover:underline",children:e.endpoint})]})]})]}),n.jsx("div",{className:"flex items-center gap-2 mt-2 md:mt-0",children:l?n.jsxs(n.Fragment,{children:[n.jsxs("button",{onClick:()=>o("stop",r),disabled:d!==null,className:`flex items-center gap-1.5 px-4 py-2 text-sm font-medium rounded-lg border border-border-default
|
|
659
659
|
bg-bg-primary text-text-secondary daemon-stop-btn transition-all disabled:opacity-50`,children:[d==="stop"?n.jsx(xe,{size:14,className:"animate-spin"}):n.jsx(up,{size:14}),s("workers.daemon.stop")]}),n.jsxs("button",{onClick:()=>o("restart",i),disabled:d!==null,className:`flex items-center gap-1.5 px-4 py-2 text-sm font-medium rounded-lg border border-border-default
|