@tencent-ai/codebuddy-code 2.88.0-next.2b26d80.20260415 → 2.88.0-next.75f227b.20260415
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/dist/codebuddy-headless.js +72 -72
- package/dist/codebuddy.js +93 -93
- package/dist/web-ui/assets/{index-LWSwudLL.js → index-B8SP6JWw.js} +118 -118
- package/dist/web-ui/index.html +1 -1
- package/package.json +1 -1
- 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 Wh=Object.defineProperty;var qh=(e,t,r)=>t in e?Wh(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",[ct]:ft};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 rn(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 rn(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 sm=Object.freeze(Object.defineProperty({__proto__:null,AcpClient:Oi,CUSTOM_REQUEST_HEADER_NAME:ct,CUSTOM_REQUEST_HEADER_VALUE:ft,fetchWithRetry:ge},Symbol.toStringTag,{value:"Module"})),Mu="codebuddy.auth.token";function yn(){try{return sessionStorage.getItem(Mu)}catch{return null}}function Pu(e){try{sessionStorage.setItem(Mu,e)}catch{}}function oe(e){const t={[ct]:ft,...e},r=yn();return r&&(t.Authorization=`Bearer ${r}`),t}const Fu=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:oe()});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:oe({"Content-Type":"application/json"}),body:JSON.stringify({password:t})})).json();if(i.success){const s=i.token||t;return Pu(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})})),vr=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:oe()});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:oe()});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:{...oe(),"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:{...oe(),"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:{...oe(),"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 rn(async()=>{const{useChatStore:o}=await Promise.resolve().then(()=>rm);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:{}})})),Bu=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 md(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 am={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 om(e){return e.phase==="tool_executing"&&e.toolName?`phase.toolExecutingName:${e.toolName}`:e.phase==="model_streaming"&&e.streamingToolName?`phase.modelStreamingName:${e.streamingToolName}`:am[e.phase]??null}let jt=null;function Ae(){return jt||(jt=new Oi),jt}function lm(){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,addHistoryUserMessageChunk:w,finalizeAssistantMessage:N,clearChat:R,setAgentPhaseLabel:I,setProgressLabel:$,setAgentRunning:D}=rt();C.useEffect(()=>{const F=e.current,q=[],H=(T,L)=>{if(!L)return!1;try{const A=(L._meta||{})["codebuddy.ai/memberEvent"];if(!A)return!1;const G=He.getState(),z=G.memberHistories[A]||[];return G.setMemberHistory(A,[...z,{sessionUpdate:T,...L}]),!0}catch{return!1}};return q.push(F.on("user_message_chunk",T=>{if(H("user_message_chunk",T))return;const L=T.content,O=T._meta||{},A=!!O["codebuddy.ai/isCompactInternal"],G=typeof T.messageId=="string"?T.messageId:typeof O["codebuddy.ai/messageId"]=="string"?O["codebuddy.ai/messageId"]:void 0;let z;const K=O["codebuddy.ai/images"];Array.isArray(K)&&K.length>0&&(z=K.filter(M=>M.blobPath&&M.mimeType).map(M=>({url:`/api/v1/files/download?path=${encodeURIComponent(M.blobPath)}`,mimeType:M.mimeType})),z.length===0&&(z=void 0));let W;const U=O["codebuddy.ai/channelSource"];U&&(W={source:U,sender:O["codebuddy.ai/channelSender"]||"",senderName:O["codebuddy.ai/channelSenderName"],chatId:O["codebuddy.ai/channelChatId"],chatType:O["codebuddy.ai/channelChatType"]}),L&&typeof L.text=="string"&&w(G,L.text,z,A,W)})),q.push(F.on("agent_message_chunk",T=>{if(H("agent_message_chunk",T))return;const L=T.content,O=T._meta||{},A=O["codebuddy.ai/parentToolCallId"],G=!!O["codebuddy.ai/isCompactInternal"];typeof L=="string"?k(L,A,G):L&&typeof L.text=="string"&&k(L.text,A,G)})),q.push(F.on("agent_thought_chunk",T=>{if(H("agent_thought_chunk",T))return;const L=T.content,A=(T._meta||{})["codebuddy.ai/parentToolCallId"];L&&typeof L.text=="string"&&v(L.text,A)})),q.push(F.on("tool_call",T=>{if(H("tool_call",T))return;const L=T._meta||{},O=L["codebuddy.ai/parentToolCallId"],A=!!L["codebuddy.ai/isSubagent"],G=T.toolName||L["codebuddy.ai/toolName"]||"",z=L["codebuddy.ai/planContent"];h({id:T.toolCallId,name:T.title||G||T.kind||"tool",kind:T.kind||"other",toolName:G,input:T.rawInput||T.input,status:"running",locations:T.locations,content:T.content,parentToolCallId:O,subagent:A?{type:L["codebuddy.ai/subagentType"]||"general-purpose",description:L["codebuddy.ai/description"]||"",isBackground:!!L["codebuddy.ai/isBackground"],memberName:L["codebuddy.ai/memberName"]||void 0}:void 0,planContent:z})})),q.push(F.on("tool_call_update",T=>{if(H("tool_call_update",T))return;const O={status:T.status==="completed"?"completed":T.status==="failed"?"failed":T.toolStatus==="completed"?"completed":T.toolStatus==="failed"?"failed":"running",result:T.rawOutput||T.toolResult};T.content!==void 0&&(O.content=T.content),m(T.toolCallId,O)})),q.push(F.on("interruption_request",T=>{var L;if(T.toolName==="AskUserQuestion"){const O=Array.isArray((L=T.toolInput)==null?void 0:L.questions)?T.toolInput.questions:[];f({id:T.toolCallId,toolCallId:T.toolCallId,sessionId:T.sessionId||i||"",source:"interruption",questions:O.map(md)});return}u({id:T.interruptionId,sessionId:T.sessionId,reason:T.reason,options:T.options,toolName:T.toolName,toolTitle:T.toolTitle,toolInput:T.toolInput,toolCallId:T.toolCallId})})),q.push(F.on("question_request",T=>{const L=Array.isArray(T.questions)?T.questions:[];f({id:T.toolCallId,toolCallId:T.toolCallId,sessionId:T.sessionId,source:"extMethod",questions:L.map(md)})})),q.push(F.on("session_end",T=>{y(T.stopReason,T.errorMessage)})),q.push(F.on("session_info_update",T=>{T.title&&g(T.title);const L=T._meta||{};if(L["codebuddy.ai/historyReplay"]==="start"?S(!0):L["codebuddy.ai/historyReplay"]==="end"&&(S(!1),N()),L["codebuddy.ai/agentPhase"]){const A=L["codebuddy.ai/agentPhase"];I(om(A))}if("codebuddy.ai/progress"in L){const A=L["codebuddy.ai/progress"];A?($(`progress.${A.type}`),D(!0)):$(null)}if(L["codebuddy.ai/sessionReset"]){const A=L["codebuddy.ai/newSessionId"];if(A){if(R(),g(null),x(null),l(A),typeof sessionStorage<"u"&&sessionStorage.setItem("acp-session-id",A),typeof window<"u"&&window.history&&window.location){const G=new URL(window.location.href);G.searchParams.get("sessionId")!==A&&(G.searchParams.set("sessionId",A),window.history.replaceState({},"",G.toString()))}F.loadSession(A).then(B).catch(G=>console.error("Failed to load new session after reset:",G))}}if(L["codebuddy.ai/permissionResolved"]){const A=L["codebuddy.ai/toolCallId"],G=L["codebuddy.ai/decision"];A&&G&&(Ae().clearPermissionRequestByToolCallId(A),E(A,G),_(A))}if("codebuddy.ai/promptSuggestion"in L){const A=L["codebuddy.ai/promptSuggestion"];x(A||null)}const O=L["codebuddy.ai/teamUpdate"];if(O)switch(O.type){case"member_status_change":O.members&&(O.teamName?He.getState().setTeamStatus({isInTeam:!0,teamName:O.teamName,isAutoTeam:O.isAutoTeam,members:O.members}):He.getState().updateMembers(O.members));break;case"team_created":He.getState().setTeamStatus({isInTeam:!0,teamName:O.teamName,members:[]});break;case"team_deleted":He.getState().clearTeam();break}})),q.push(F.on("model_update",T=>{d(T.availableModels||[]),a(T.currentModelId||"")})),q.push(F.on("mode_update",T=>{T.availableModes&&o(T.availableModes),T.currentModeId&&c(T.currentModeId)})),q.push(F.on("current_mode_update",T=>{T.currentModeId&&c(T.currentModeId)})),q.push(F.on("config_option_update",T=>{const L=T.configOptions||[];for(const O of L)O.id==="thought_level"?b(O.currentValue==="enabled"):O.id==="mode"&&O.currentValue?c(O.currentValue):O.id==="model"&&O.currentValue&&(a(O.currentValue),O.options&&d(O.options.map(A=>({id:A.value,name:A.name||A.value}))))})),q.push(F.on("status_change",T=>{s(T)})),q.push(F.on("available_commands_update",T=>{T.availableCommands&&p(T.availableCommands.map(L=>{var O;return{name:L.name,description:L.description||"",...((O=L._meta)==null?void 0:O.type)==="skill"?{type:"skill"}:{}}}))})),q.push(F.on("checkpointCreated",T=>{vr.getState().onCheckpoint(T)})),q.push(F.on("checkpointUpdated",T=>{vr.getState().onCheckpoint(T)})),q.push(F.on("checkpointReverted",()=>{vr.getState().reset()})),()=>{q.forEach(T=>T())}},[t,i,k,v,h,m,u,f,y,E,_,d,a,o,c,p,g,b,s,S,w,N,R,l,x]);const B=C.useCallback(F=>{if(F.models&&(d(F.models.availableModels.map(q=>({id:q.modelId,name:q.name}))),a(F.models.currentModelId)),F.modes&&(o(F.modes.availableModes),c(F.modes.currentModeId)),F.configOptions)for(const q of F.configOptions)q.id==="thought_level"&&b(q.currentValue==="enabled")},[d,a,o,c,b]),j=C.useCallback(async F=>{const q=typeof F=="string"?F:F==null?void 0:F.token,H=typeof F=="object"?F==null?void 0:F.continue:!1;if(q){if(jt)try{await jt.disconnect()}catch{}jt=new Oi(void 0,q),e.current=jt,r(T=>T+1)}try{s("connecting"),x(null);const T=await e.current.initializeSession({continue:H});l(T.sessionId),B(T),s("connected"),Bu.getState().fetchUserInfo(e.current)}catch(T){console.error("Connection failed:",T),s("error")}},[s,l,B,x]);return{client:e.current,connect:j}}const Uu="/assets/dark-claw-cat-D_ew_BKV.png",zu="/assets/light-claw-cat-BgBWmnmi.png",Hu="/assets/red-claw-cat--t2EuBIB.png",Gu={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 Wu({size:e="medium",className:t=""}){const i=qe(l=>l.resolved)==="dark"?Uu:zu,s=Gu[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:Hu,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=Gu[e];return n.jsxs("div",{className:`flex flex-col items-center justify-center gap-4 ${r}`,children:[n.jsx(Wu,{size:e}),t&&n.jsx("div",{className:`text-text-secondary ${i.text} font-medium animate-pulse`,children:t})]})}function cm({size:e="medium",className:t=""}){return n.jsx(Wu,{size:e,className:t})}/**
|
|
9
|
-
* @license lucide-react v1.
|
|
9
|
+
* @license lucide-react v1.8.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 qu=(...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.8.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 dm=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
|
|
19
|
-
* @license lucide-react v1.
|
|
19
|
+
* @license lucide-react v1.8.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 um=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.8.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 gd=e=>{const t=um(e);return t.charAt(0).toUpperCase()+t.slice(1)};/**
|
|
29
|
-
* @license lucide-react v1.
|
|
29
|
+
* @license lucide-react v1.8.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 Bn={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.8.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 pm=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1},hm=C.createContext({}),mm=()=>C.useContext(hm),gm=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=""}=mm()??{},k=i??g?Number(r??p)*24/Number(t??c):r??p;return C.createElement("svg",{ref:o,...Bn,width:t??c??Bn.width,height:t??c??Bn.height,stroke:e??b,strokeWidth:k,className:qu("lucide",x,s),...!l&&!pm(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.8.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(gm,{ref:l,iconNode:t,className:qu(`lucide-${dm(gd(e))}`,`lucide-${e}`,i),...s}));return r.displayName=gd(e),r};/**
|
|
44
|
-
* @license lucide-react v1.
|
|
44
|
+
* @license lucide-react v1.8.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 fm=[["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"}]],$i=Z("activity",fm);/**
|
|
49
|
-
* @license lucide-react v1.
|
|
49
|
+
* @license lucide-react v1.8.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 bm=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],ir=Z("arrow-left",bm);/**
|
|
54
|
-
* @license lucide-react v1.
|
|
54
|
+
* @license lucide-react v1.8.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 ym=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],xm=Z("arrow-right",ym);/**
|
|
59
|
-
* @license lucide-react v1.
|
|
59
|
+
* @license lucide-react v1.8.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 vm=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],ci=Z("arrow-up",vm);/**
|
|
64
|
-
* @license lucide-react v1.
|
|
64
|
+
* @license lucide-react v1.8.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 _m=[["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"}]],Mt=Z("blocks",_m);/**
|
|
69
|
-
* @license lucide-react v1.
|
|
69
|
+
* @license lucide-react v1.8.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 Sm=[["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"}]],ji=Z("book-open",Sm);/**
|
|
74
|
-
* @license lucide-react v1.
|
|
74
|
+
* @license lucide-react v1.8.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 km=[["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"}]],nn=Z("bot",km);/**
|
|
79
|
-
* @license lucide-react v1.
|
|
79
|
+
* @license lucide-react v1.8.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 wm=[["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"}]],Mi=Z("chart-column",wm);/**
|
|
84
|
-
* @license lucide-react v1.
|
|
84
|
+
* @license lucide-react v1.8.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 Em=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Pt=Z("check",Em);/**
|
|
89
|
-
* @license lucide-react v1.
|
|
89
|
+
* @license lucide-react v1.8.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 Cm=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],et=Z("chevron-down",Cm);/**
|
|
94
|
-
* @license lucide-react v1.
|
|
94
|
+
* @license lucide-react v1.8.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 Tm=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],Nm=Z("chevron-left",Tm);/**
|
|
99
|
-
* @license lucide-react v1.
|
|
99
|
+
* @license lucide-react v1.8.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 Am=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Ee=Z("chevron-right",Am);/**
|
|
104
|
-
* @license lucide-react v1.
|
|
104
|
+
* @license lucide-react v1.8.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 Im=[["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"}]],Rm=Z("circle-alert",Im);/**
|
|
109
|
-
* @license lucide-react v1.
|
|
109
|
+
* @license lucide-react v1.8.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 Lm=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],Dm=Z("circle-check-big",Lm);/**
|
|
114
|
-
* @license lucide-react v1.
|
|
114
|
+
* @license lucide-react v1.8.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 Om=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Vu=Z("circle-check",Om);/**
|
|
119
|
-
* @license lucide-react v1.
|
|
119
|
+
* @license lucide-react v1.8.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 $m=[["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"}]],jm=Z("circle-question-mark",$m);/**
|
|
124
|
-
* @license lucide-react v1.
|
|
124
|
+
* @license lucide-react v1.8.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 Mm=[["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"}]],sn=Z("circle-x",Mm);/**
|
|
129
|
-
* @license lucide-react v1.
|
|
129
|
+
* @license lucide-react v1.8.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 Pm=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Fm=Z("circle",Pm);/**
|
|
134
|
-
* @license lucide-react v1.
|
|
134
|
+
* @license lucide-react v1.8.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 Bm=[["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"}]],Pi=Z("clipboard-clock",Bm);/**
|
|
139
|
-
* @license lucide-react v1.
|
|
139
|
+
* @license lucide-react v1.8.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 Um=[["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"}]],zm=Z("clipboard-list",Um);/**
|
|
144
|
-
* @license lucide-react v1.
|
|
144
|
+
* @license lucide-react v1.8.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 Hm=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],Ct=Z("clock",Hm);/**
|
|
149
|
-
* @license lucide-react v1.
|
|
149
|
+
* @license lucide-react v1.8.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 Gm=[["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"}]],Wm=Z("code-xml",Gm);/**
|
|
154
|
-
* @license lucide-react v1.
|
|
154
|
+
* @license lucide-react v1.8.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 qm=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],Ku=Z("code",qm);/**
|
|
159
|
-
* @license lucide-react v1.
|
|
159
|
+
* @license lucide-react v1.8.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 Vm=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]],fd=Z("columns-2",Vm);/**
|
|
164
|
-
* @license lucide-react v1.
|
|
164
|
+
* @license lucide-react v1.8.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 Km=[["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"}]],Ym=Z("copy-minus",Km);/**
|
|
169
|
-
* @license lucide-react v1.
|
|
169
|
+
* @license lucide-react v1.8.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 Xm=[["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"}]],di=Z("copy",Xm);/**
|
|
174
|
-
* @license lucide-react v1.
|
|
174
|
+
* @license lucide-react v1.8.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 Zm=[["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}],["path",{d:"m9 10-5 5 5 5",key:"1kshq7"}]],bd=Z("corner-down-left",Zm);/**
|
|
179
|
-
* @license lucide-react v1.
|
|
179
|
+
* @license lucide-react v1.8.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 Jm=[["path",{d:"m15 10 5 5-5 5",key:"qqa56n"}],["path",{d:"M4 4v7a4 4 0 0 0 4 4h12",key:"z08zvw"}]],Qm=Z("corner-down-right",Jm);/**
|
|
184
|
-
* @license lucide-react v1.
|
|
184
|
+
* @license lucide-react v1.8.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 eg=[["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"}]],zt=Z("cpu",eg);/**
|
|
189
|
-
* @license lucide-react v1.
|
|
189
|
+
* @license lucide-react v1.8.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 tg=[["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"}]],Yu=Z("download",tg);/**
|
|
194
|
-
* @license lucide-react v1.
|
|
194
|
+
* @license lucide-react v1.8.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 rg=[["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"}]],bt=Z("external-link",rg);/**
|
|
199
|
-
* @license lucide-react v1.
|
|
199
|
+
* @license lucide-react v1.8.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 ng=[["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"}]],ig=Z("file-code",ng);/**
|
|
204
|
-
* @license lucide-react v1.
|
|
204
|
+
* @license lucide-react v1.8.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 sg=[["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"}]],Xu=Z("file-pen",sg);/**
|
|
209
|
-
* @license lucide-react v1.
|
|
209
|
+
* @license lucide-react v1.8.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 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:"M9 15h6",key:"cctwl0"}],["path",{d:"M12 18v-6",key:"17g6i2"}]],og=Z("file-plus",ag);/**
|
|
214
|
-
* @license lucide-react v1.
|
|
214
|
+
* @license lucide-react v1.8.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 lg=[["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"}]],ut=Z("file-text",lg);/**
|
|
219
|
-
* @license lucide-react v1.
|
|
219
|
+
* @license lucide-react v1.8.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 cg=[["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"}]],Zu=Z("file",cg);/**
|
|
224
|
-
* @license lucide-react v1.
|
|
224
|
+
* @license lucide-react v1.8.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 dg=[["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"}]],Ju=Z("files",dg);/**
|
|
229
|
-
* @license lucide-react v1.
|
|
229
|
+
* @license lucide-react v1.8.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 ug=[["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"}]],pg=Z("folder-closed",ug);/**
|
|
234
|
-
* @license lucide-react v1.
|
|
234
|
+
* @license lucide-react v1.8.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 hg=[["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"}]],Fi=Z("folder-open",hg);/**
|
|
239
|
-
* @license lucide-react v1.
|
|
239
|
+
* @license lucide-react v1.8.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 mg=[["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"}]],gg=Z("folder-plus",mg);/**
|
|
244
|
-
* @license lucide-react v1.
|
|
244
|
+
* @license lucide-react v1.8.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 fg=[["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"}]],bg=Z("folder",fg);/**
|
|
249
|
-
* @license lucide-react v1.
|
|
249
|
+
* @license lucide-react v1.8.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 yg=[["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"}]],Qu=Z("git-branch",yg);/**
|
|
254
|
-
* @license lucide-react v1.
|
|
254
|
+
* @license lucide-react v1.8.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 xg=[["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"}]],xn=Z("git-compare",xg);/**
|
|
259
|
-
* @license lucide-react v1.
|
|
259
|
+
* @license lucide-react v1.8.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 vg=[["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"}]],ep=Z("globe",vg);/**
|
|
264
|
-
* @license lucide-react v1.
|
|
264
|
+
* @license lucide-react v1.8.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 _g=[["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"}]],Sg=Z("hard-drive",_g);/**
|
|
269
|
-
* @license lucide-react v1.
|
|
269
|
+
* @license lucide-react v1.8.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 kg=[["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"}]],tp=Z("hash",kg);/**
|
|
274
|
-
* @license lucide-react v1.
|
|
274
|
+
* @license lucide-react v1.8.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 wg=[["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"}]],rp=Z("history",wg);/**
|
|
279
|
-
* @license lucide-react v1.
|
|
279
|
+
* @license lucide-react v1.8.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 Eg=[["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"}]],np=Z("image",Eg);/**
|
|
284
|
-
* @license lucide-react v1.
|
|
284
|
+
* @license lucide-react v1.8.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 Cg=[["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"}]],Tg=Z("inbox",Cg);/**
|
|
289
|
-
* @license lucide-react v1.
|
|
289
|
+
* @license lucide-react v1.8.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 Ng=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Ag=Z("info",Ng);/**
|
|
294
|
-
* @license lucide-react v1.
|
|
294
|
+
* @license lucide-react v1.8.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 Ig=[["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"}]],ip=Z("keyboard",Ig);/**
|
|
299
|
-
* @license lucide-react v1.
|
|
299
|
+
* @license lucide-react v1.8.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 Rg=[["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"}]],Lg=Z("languages",Rg);/**
|
|
304
|
-
* @license lucide-react v1.
|
|
304
|
+
* @license lucide-react v1.8.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 Dg=[["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"}]],Og=Z("layers",Dg);/**
|
|
309
|
-
* @license lucide-react v1.
|
|
309
|
+
* @license lucide-react v1.8.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 $g=[["path",{d:"M9 17H7A5 5 0 0 1 7
|
|
314
|
-
* @license lucide-react v1.
|
|
313
|
+
*/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"}]],yd=Z("link-2-off",$g);/**
|
|
314
|
+
* @license lucide-react v1.8.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 jg=[["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"}]],Mg=Z("link-2",jg);/**
|
|
319
|
+
* @license lucide-react v1.8.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 Pg=[["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"}]],Bi=Z("list-checks",Pg);/**
|
|
324
|
-
* @license lucide-react v1.
|
|
324
|
+
* @license lucide-react v1.8.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 Fg=[["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"}]],sp=Z("list-todo",Fg);/**
|
|
329
|
-
* @license lucide-react v1.
|
|
329
|
+
* @license lucide-react v1.8.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 Bg=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],xe=Z("loader-circle",Bg);/**
|
|
334
|
-
* @license lucide-react v1.
|
|
334
|
+
* @license lucide-react v1.8.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 Ug=[["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"}]],zg=Z("map",Ug);/**
|
|
339
|
-
* @license lucide-react v1.
|
|
339
|
+
* @license lucide-react v1.8.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 Hg=[["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"}]],ap=Z("maximize-2",Hg);/**
|
|
344
|
-
* @license lucide-react v1.
|
|
344
|
+
* @license lucide-react v1.8.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 Gg=[["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"}]],ui=Z("memory-stick",Gg);/**
|
|
349
|
-
* @license lucide-react v1.
|
|
349
|
+
* @license lucide-react v1.8.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 Wg=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],qg=Z("menu",Wg);/**
|
|
354
|
-
* @license lucide-react v1.
|
|
354
|
+
* @license lucide-react v1.8.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 Vg=[["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"}]],Un=Z("message-circle-question-mark",Vg);/**
|
|
359
|
-
* @license lucide-react v1.
|
|
359
|
+
* @license lucide-react v1.8.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 Kg=[["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"}]],op=Z("message-circle",Kg);/**
|
|
364
|
-
* @license lucide-react v1.
|
|
364
|
+
* @license lucide-react v1.8.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 Yg=[["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"}]],sr=Z("message-square",Yg);/**
|
|
369
|
-
* @license lucide-react v1.
|
|
369
|
+
* @license lucide-react v1.8.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 Xg=[["path",{d:"M5 12h14",key:"1ays0h"}]],Zg=Z("minus",Xg);/**
|
|
374
|
-
* @license lucide-react v1.
|
|
374
|
+
* @license lucide-react v1.8.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 Jg=[["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"}]],lp=Z("moon",Jg);/**
|
|
379
|
-
* @license lucide-react v1.
|
|
379
|
+
* @license lucide-react v1.8.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 Qg=[["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"}]],cp=Z("network",Qg);/**
|
|
384
|
-
* @license lucide-react v1.
|
|
384
|
+
* @license lucide-react v1.8.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 ef=[["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"}]],xd=Z("newspaper",ef);/**
|
|
389
|
-
* @license lucide-react v1.
|
|
389
|
+
* @license lucide-react v1.8.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 tf=[["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"}]],rf=Z("package",tf);/**
|
|
394
|
-
* @license lucide-react v1.
|
|
394
|
+
* @license lucide-react v1.8.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 nf=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],Ui=Z("panel-left",nf);/**
|
|
399
|
-
* @license lucide-react v1.
|
|
399
|
+
* @license lucide-react v1.8.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 sf=[["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"}]],af=Z("pen-line",sf);/**
|
|
404
|
-
* @license lucide-react v1.
|
|
404
|
+
* @license lucide-react v1.8.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 of=[["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"}]],dp=Z("pencil",of);/**
|
|
409
|
-
* @license lucide-react v1.
|
|
409
|
+
* @license lucide-react v1.8.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 lf=[["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"}]],cf=Z("pin",lf);/**
|
|
414
|
-
* @license lucide-react v1.
|
|
414
|
+
* @license lucide-react v1.8.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 df=[["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"}]],uf=Z("play",df);/**
|
|
419
|
-
* @license lucide-react v1.
|
|
419
|
+
* @license lucide-react v1.8.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 pf=[["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"}]],hf=Z("plug",pf);/**
|
|
424
|
-
* @license lucide-react v1.
|
|
424
|
+
* @license lucide-react v1.8.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 mf=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],dt=Z("plus",mf);/**
|
|
429
|
-
* @license lucide-react v1.
|
|
429
|
+
* @license lucide-react v1.8.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 gf=[["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"}]],ff=Z("power-off",gf);/**
|
|
434
|
-
* @license lucide-react v1.
|
|
434
|
+
* @license lucide-react v1.8.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 bf=[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]],up=Z("power",bf);/**
|
|
439
|
-
* @license lucide-react v1.
|
|
439
|
+
* @license lucide-react v1.8.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 yf=[["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"}]],an=Z("radio",yf);/**
|
|
444
|
-
* @license lucide-react v1.
|
|
444
|
+
* @license lucide-react v1.8.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 xf=[["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",xf);/**
|
|
449
|
-
* @license lucide-react v1.
|
|
449
|
+
* @license lucide-react v1.8.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 vf=[["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"}]],_f=Z("repeat",vf);/**
|
|
454
|
-
* @license lucide-react v1.
|
|
454
|
+
* @license lucide-react v1.8.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 Sf=[["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"}]],pi=Z("rotate-ccw",Sf);/**
|
|
459
|
-
* @license lucide-react v1.
|
|
459
|
+
* @license lucide-react v1.8.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 kf=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 12h18",key:"1i2n21"}]],wf=Z("rows-2",kf);/**
|
|
464
|
-
* @license lucide-react v1.
|
|
464
|
+
* @license lucide-react v1.8.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 Ef=[["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"}]],Cf=Z("scan",Ef);/**
|
|
469
|
-
* @license lucide-react v1.
|
|
469
|
+
* @license lucide-react v1.8.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 Tf=[["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"}]],Nf=Z("scissors",Tf);/**
|
|
474
|
-
* @license lucide-react v1.
|
|
474
|
+
* @license lucide-react v1.8.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 Af=[["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"}]],If=Z("scroll-text",Af);/**
|
|
479
|
-
* @license lucide-react v1.
|
|
479
|
+
* @license lucide-react v1.8.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 Rf=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],tt=Z("search",Rf);/**
|
|
484
|
-
* @license lucide-react v1.
|
|
484
|
+
* @license lucide-react v1.8.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 Lf=[["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"}]],Df=Z("send",Lf);/**
|
|
489
|
-
* @license lucide-react v1.
|
|
489
|
+
* @license lucide-react v1.8.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 Of=[["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"}]],on=Z("server",Of);/**
|
|
494
|
-
* @license lucide-react v1.
|
|
494
|
+
* @license lucide-react v1.8.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 $f=[["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"}]],zi=Z("settings-2",$f);/**
|
|
499
|
-
* @license lucide-react v1.
|
|
499
|
+
* @license lucide-react v1.8.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 jf=[["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"}]],Mf=Z("settings",jf);/**
|
|
504
|
-
* @license lucide-react v1.
|
|
504
|
+
* @license lucide-react v1.8.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 Pf=[["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"}]],pp=Z("sparkles",Pf);/**
|
|
509
|
-
* @license lucide-react v1.
|
|
509
|
+
* @license lucide-react v1.8.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 Ff=[["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"}]],vn=Z("square-terminal",Ff);/**
|
|
514
|
-
* @license lucide-react v1.
|
|
514
|
+
* @license lucide-react v1.8.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 Bf=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],hp=Z("square",Bf);/**
|
|
519
|
-
* @license lucide-react v1.
|
|
519
|
+
* @license lucide-react v1.8.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 Uf=[["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"}]],_r=Z("store",Uf);/**
|
|
524
|
-
* @license lucide-react v1.
|
|
524
|
+
* @license lucide-react v1.8.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 zf=[["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"}]],Hf=Z("sun-moon",zf);/**
|
|
529
|
-
* @license lucide-react v1.
|
|
529
|
+
* @license lucide-react v1.8.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 Gf=[["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"}]],mp=Z("sun",Gf);/**
|
|
534
|
-
* @license lucide-react v1.
|
|
534
|
+
* @license lucide-react v1.8.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 Wf=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],Nr=Z("terminal",Wf);/**
|
|
539
|
-
* @license lucide-react v1.
|
|
539
|
+
* @license lucide-react v1.8.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 qf=[["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"}]],gp=Z("timer",qf);/**
|
|
544
|
-
* @license lucide-react v1.
|
|
544
|
+
* @license lucide-react v1.8.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 Vf=[["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"}]],ar=Z("trash-2",Vf);/**
|
|
549
|
-
* @license lucide-react v1.
|
|
549
|
+
* @license lucide-react v1.8.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 Kf=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],Yf=Z("trending-up",Kf);/**
|
|
554
|
-
* @license lucide-react v1.
|
|
554
|
+
* @license lucide-react v1.8.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 Xf=[["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"}]],Sr=Z("triangle-alert",Xf);/**
|
|
559
|
-
* @license lucide-react v1.
|
|
559
|
+
* @license lucide-react v1.8.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 Zf=[["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"}]],ln=Z("undo-2",Zf);/**
|
|
564
|
-
* @license lucide-react v1.
|
|
564
|
+
* @license lucide-react v1.8.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 Jf=[["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"}]],fp=Z("users",Jf);/**
|
|
569
|
-
* @license lucide-react v1.
|
|
569
|
+
* @license lucide-react v1.8.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 Qf=[["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"}]],bp=Z("workflow",Qf);/**
|
|
574
|
-
* @license lucide-react v1.
|
|
574
|
+
* @license lucide-react v1.8.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 eb=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],we=Z("x",eb);/**
|
|
579
|
-
* @license lucide-react v1.
|
|
579
|
+
* @license lucide-react v1.8.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=MS[_])==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(Nt,{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(zS,{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($S,{language:"log",style:r==="dark"?Rn:Ln,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 FS={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"},BS={ERROR:"bg-red-50/50 dark:bg-red-900/10",WARN:"bg-amber-50/50 dark:bg-amber-900/10"},US=/^\[(\w+)\]\s/;function zS({line:e,searchText:t}){var o;if(!e.trim())return n.jsx("div",{className:"h-5"});const r=e.match(US),i=((o=r==null?void 0:r[1])==null?void 0:o.toUpperCase())||"",s=FS[i]||"text-text-secondary",l=BS[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:Tu(e.slice(r[0].length),t)})]}):n.jsx("span",{className:"text-text-secondary",children:Tu(e,t)})})}function Tu(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 HS=8e3,GS=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:oe()});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=HS)=>{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}))}})),WS={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 qS(){const{t:e}=re(),{metrics:t,loading:r,error:i,fetchMetrics:s,startPolling:l,stopPolling:d}=GS(),{workers:a,fetchWorkers:o}=Dn();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=VS((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($i,{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(KS,{metrics:t}),n.jsx(YS,{workers:c})]})]})}function VS(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 KS({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(ii,{icon:n.jsx(zt,{size:18}),label:t("metrics.cpu"),value:`${e.cpuUsedPct.toFixed(1)}%`,subtext:`${e.cpuCount} ${t("metrics.cores")}`,percent:e.cpuUsedPct,colorClasses:tn(e.cpuUsedPct)}),n.jsx(ii,{icon:n.jsx(ui,{size:18}),label:t("metrics.memory"),value:`${Nu(e.memUsedMib)} / ${Nu(e.memTotalMib)}`,subtext:`${r.toFixed(1)}%`,percent:r,colorClasses:tn(r)}),n.jsx(ii,{icon:n.jsx(Sg,{size:18}),label:t("metrics.disk"),value:`${Au(e.diskUsed)} / ${Au(e.diskTotal)}`,subtext:`${i.toFixed(1)}%`,percent:i,colorClasses:tn(i)})]})}function ii({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 YS({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(zt,{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(XS,{worker:r},r.id))})]})}function XS({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 ${WS[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(Nt,{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(bt,{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(qt,{icon:n.jsx(ui,{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(qt,{icon:n.jsx(ui,{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 ${tn(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(qt,{icon:n.jsx(Ct,{size:14}),label:t("metrics.uptime"),value:Iu(e.uptimeSeconds)})}),n.jsx("div",{className:"min-w-[60px]",children:n.jsx(qt,{icon:n.jsx(on,{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(qt,{icon:n.jsx(Ct,{size:14}),label:t("metrics.uptime"),value:Iu(e.uptimeSeconds)})}),n.jsx("div",{className:"min-w-[60px]",children:n.jsx(qt,{icon:n.jsx(on,{size:14}),label:t("metrics.version"),value:e.version||"-"})})]})]})]})})}function qt({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 tn(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 Nu(e){return e>=1024?`${(e/1024).toFixed(1)} GiB`:`${e} MiB`}function Au(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 Iu(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 ZS({onNavigate:e}){const{t}=re(),[r,i]=C.useState(un);if(C.useEffect(()=>{const s=()=>i(un());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:()=>Bd("remote-control"),t,existingInstanceId:s})}return r==="add-wecom"?n.jsx(ek,{onBack:()=>Bd("remote-control"),t}):n.jsx(JS,{onNavigate:e,t})}function JS({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 R=_==="delete"?"DELETE":"POST",I=_==="delete"?`/api/v1/channels/${S}/${w}`:`/api/v1/channels/${S}/${w}/${_}`,$=await ge(I,{method:R});if(!$.ok){const B=await $.json().catch(()=>({}));throw new Error(B.error||`Failed: ${$.status}`)}const D=await $.json().catch(()=>({}));if(_==="unbind"&&S==="wechat"&&D.needsQrScan){fr("remote-control",`rebind-wechat/${w}`);return}await p()}catch(R){a((R==null?void 0:R.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(op,{size:18,className:"text-green-500"}):_==="wecom"?n.jsx(an,{size:18,className:"text-accent-brand"}):n.jsx(yd,{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:R=>R.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(yd,{size:14}):n.jsx(jg,{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(ar,{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(dt,{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(an,{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:()=>fr("remote-control","add-wechat"),children:[n.jsx(dt,{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:()=>fr("remote-control","add-wecom"),children:[n.jsx(dt,{size:14}),t("remoteControl.addWeCom")]})]})]}):n.jsxs(n.Fragment,{children:[E(t("channel.wechat")+t("remoteControl.bot"),m,()=>fr("remote-control","add-wechat"),t("remoteControl.addWeChat")),E(t("channel.wecom")+t("remoteControl.bot"),u,()=>fr("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(xm,{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`,{headers:oe()});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(ir,{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 ek({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(ir,{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 tk="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",rk="/assets/logo-iZVLr450.svg";function nk({isOpen:e,onClose:t,mainView:r,onNavigate:i}){const{t:s}=re(),{userInfo:l}=Bu(),d=Bt(p=>p.info),a=Bt(p=>p.fetch),o=vr(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:rk,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(sr,{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(zt,{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(an,{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(Bi,{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(vn,{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(Ju,{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(xn,{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(Mt,{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(Mi,{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(bp,{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($i,{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(Pi,{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(zi,{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(ip,{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(ji,{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:tk,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 ik=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:oe()});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:oe()});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 Tt(e){return e>=1e6?(e/1e6).toFixed(1)+"M":e>=1e3?(e/1e3).toFixed(1)+"k":e.toString()}function Di(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 Qc(e){return e.replace(/^anthropic\./,"").replace(/^openai\./,"").replace(/-\d{8}$/,"").replace(/@.*$/,"")}function sk(e){return new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric"})}const ak=["#ebedf0","#9be9a8","#40c463","#30a14e","#216e39"],ok=["#161b22","#0e4429","#006d32","#26a641","#39d353"],Ru=["#3b82f6","#10b981","#8b5cf6"],lk=[{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}],ck=[{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}],dk=[{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 uk(e,t,r,i){const s=[],l=i==="zh"?ck:lk;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 dk){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 pk(){const{t:e}=re(),{stats:t,statsLoading:r,statsError:i,sessionStats:s,fetchAll:l}=ik(),[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(Mi,{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(KS,{metrics:t}),n.jsx(YS,{workers:c})]})]})}function VS(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 KS({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(ii,{icon:n.jsx(zt,{size:18}),label:t("metrics.cpu"),value:`${e.cpuUsedPct.toFixed(1)}%`,subtext:`${e.cpuCount} ${t("metrics.cores")}`,percent:e.cpuUsedPct,colorClasses:tn(e.cpuUsedPct)}),n.jsx(ii,{icon:n.jsx(ui,{size:18}),label:t("metrics.memory"),value:`${Nu(e.memUsedMib)} / ${Nu(e.memTotalMib)}`,subtext:`${r.toFixed(1)}%`,percent:r,colorClasses:tn(r)}),n.jsx(ii,{icon:n.jsx(Sg,{size:18}),label:t("metrics.disk"),value:`${Au(e.diskUsed)} / ${Au(e.diskTotal)}`,subtext:`${i.toFixed(1)}%`,percent:i,colorClasses:tn(i)})]})}function ii({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 YS({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(zt,{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(XS,{worker:r},r.id))})]})}function XS({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 ${WS[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(Nt,{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(bt,{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(qt,{icon:n.jsx(ui,{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(qt,{icon:n.jsx(ui,{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 ${tn(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(qt,{icon:n.jsx(Ct,{size:14}),label:t("metrics.uptime"),value:Iu(e.uptimeSeconds)})}),n.jsx("div",{className:"min-w-[60px]",children:n.jsx(qt,{icon:n.jsx(on,{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(qt,{icon:n.jsx(Ct,{size:14}),label:t("metrics.uptime"),value:Iu(e.uptimeSeconds)})}),n.jsx("div",{className:"min-w-[60px]",children:n.jsx(qt,{icon:n.jsx(on,{size:14}),label:t("metrics.version"),value:e.version||"-"})})]})]})]})})}function qt({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 tn(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 Nu(e){return e>=1024?`${(e/1024).toFixed(1)} GiB`:`${e} MiB`}function Au(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 Iu(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 ZS({onNavigate:e}){const{t}=re(),[r,i]=C.useState(un);if(C.useEffect(()=>{const s=()=>i(un());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:()=>Bd("remote-control"),t,existingInstanceId:s})}return r==="add-wecom"?n.jsx(ek,{onBack:()=>Bd("remote-control"),t}):n.jsx(JS,{onNavigate:e,t})}function JS({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 R=_==="delete"?"DELETE":"POST",I=_==="delete"?`/api/v1/channels/${S}/${w}`:`/api/v1/channels/${S}/${w}/${_}`,$=await ge(I,{method:R});if(!$.ok){const B=await $.json().catch(()=>({}));throw new Error(B.error||`Failed: ${$.status}`)}const D=await $.json().catch(()=>({}));if(_==="unbind"&&S==="wechat"&&D.needsQrScan){fr("remote-control",`rebind-wechat/${w}`);return}await p()}catch(R){a((R==null?void 0:R.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(op,{size:18,className:"text-green-500"}):_==="wecom"?n.jsx(an,{size:18,className:"text-accent-brand"}):n.jsx(yd,{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:R=>R.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(yd,{size:14}):n.jsx(Mg,{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(ar,{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(dt,{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(an,{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:()=>fr("remote-control","add-wechat"),children:[n.jsx(dt,{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:()=>fr("remote-control","add-wecom"),children:[n.jsx(dt,{size:14}),t("remoteControl.addWeCom")]})]})]}):n.jsxs(n.Fragment,{children:[E(t("channel.wechat")+t("remoteControl.bot"),m,()=>fr("remote-control","add-wechat"),t("remoteControl.addWeChat")),E(t("channel.wecom")+t("remoteControl.bot"),u,()=>fr("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(xm,{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`,{headers:oe()});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(ir,{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 ek({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(ir,{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 tk="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",rk="/assets/logo-iZVLr450.svg";function nk({isOpen:e,onClose:t,mainView:r,onNavigate:i}){const{t:s}=re(),{userInfo:l}=Bu(),d=Bt(p=>p.info),a=Bt(p=>p.fetch),o=vr(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:rk,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(sr,{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(zt,{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(an,{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(Bi,{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(vn,{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(Ju,{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(xn,{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(Mt,{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(Mi,{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(bp,{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($i,{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(Pi,{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(zi,{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(ip,{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(ji,{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:tk,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 ik=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:oe()});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:oe()});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 Tt(e){return e>=1e6?(e/1e6).toFixed(1)+"M":e>=1e3?(e/1e3).toFixed(1)+"k":e.toString()}function Di(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 Qc(e){return e.replace(/^anthropic\./,"").replace(/^openai\./,"").replace(/-\d{8}$/,"").replace(/@.*$/,"")}function sk(e){return new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric"})}const ak=["#ebedf0","#9be9a8","#40c463","#30a14e","#216e39"],ok=["#161b22","#0e4429","#006d32","#26a641","#39d353"],Ru=["#3b82f6","#10b981","#8b5cf6"],lk=[{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}],ck=[{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}],dk=[{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 uk(e,t,r,i){const s=[],l=i==="zh"?ck:lk;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 dk){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 pk(){const{t:e}=re(),{stats:t,statsLoading:r,statsError:i,sessionStats:s,fetchAll:l}=ik(),[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(Mi,{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(hk,{stats:t,sessionStats:s}),d==="models"&&n.jsx(mk,{stats:t}),d==="tools"&&n.jsx(gk,{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 hk({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(()=>uk(e,l,r,i),[e,l,r,i]);return n.jsxs(n.Fragment,{children:[t&&n.jsx(fk,{sessionStats:t}),e.dailyActivity.length>0&&n.jsx("div",{className:"mb-6",children:n.jsx(bk,{dailyActivity:e.dailyActivity})}),a&&n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 mb-4",children:[n.jsx(mt,{icon:n.jsx(pp,{size:16}),label:r("stats.favoriteModel"),value:Qc(a[0])}),n.jsx(mt,{icon:n.jsx(tp,{size:16}),label:r("stats.totalTokens"),value:Tt(l)}),n.jsx(mt,{icon:n.jsx(Jt,{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(mt,{icon:n.jsx(sr,{size:16}),label:r("stats.sessions"),value:Tt(e.totalSessions)}),n.jsx(mt,{icon:n.jsx(gp,{size:16}),label:r("stats.longestSession"),value:e.longestSession?Di(e.longestSession.duration):r("stats.na")}),n.jsx(mt,{icon:n.jsx(Yf,{size:16}),label:r("stats.activeDays"),value:`${e.activeDays}/${e.totalDays}`}),n.jsx(mt,{icon:n.jsx(Jt,{size:16}),label:r("stats.currentStreak"),value:`${e.streaks.currentStreak} ${r("stats.days")}`}),n.jsx(mt,{icon:n.jsx(Jt,{size:16}),label:r("stats.longestStreak"),value:`${e.streaks.longestStreak} ${r("stats.days")}`}),n.jsx(mt,{icon:n.jsx(Ct,{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 mk({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:Qc(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(yk,{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"),": ",Tt(s.inputTokens)]}),n.jsxs("span",{children:[t("stats.output"),": ",Tt(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 gk({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:Tt(l.count)})})}),l.count/i<=.15&&n.jsx("span",{className:"text-xs text-text-tertiary w-12 font-mono",children:Tt(l.count)})]},l.toolName))})]})}function fk({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(Vt,{label:t("stats.session.title"),icon:n.jsx(Wm,{size:12})}),n.jsx(Vt,{label:t("stats.session.apiDuration"),value:Di(e.apiDuration)}),n.jsx(Vt,{label:t("stats.session.wallTime"),value:Di(e.runningTime)}),n.jsx(Vt,{label:t("stats.session.linesAdded"),value:`+${e.fileChangeStats.totalAddedLines}`,valueClass:"text-green-500"}),n.jsx(Vt,{label:t("stats.session.linesDeleted"),value:`-${e.fileChangeStats.totalDeletedLines}`,valueClass:"text-red-500"}),n.jsx(Vt,{label:t("stats.session.tokens"),value:Tt(r)})]})}function Vt({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 mt({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 bk({dailyActivity:e}){const{t}=re(),i=qe(d=>d.resolved)==="dark"?ok:ak,s=C.useMemo(()=>{const g=new Map;for(const R of e)g.set(R.date,R.messageCount);const b=e.map(R=>R.messageCount).filter(R=>R>0).sort((R,I)=>R-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=R=>R===0||b.length===0?0:R>=v?4:R>=k?3:R>=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 R=0;R<52;R++)for(let I=0;I<7;I++){if(S>m){S.setDate(S.getDate()+1);continue}const $=S.getFullYear(),D=String(S.getMonth()+1).padStart(2,"0"),B=String(S.getDate()).padStart(2,"0"),j=`${$}-${D}-${B}`,F=g.get(j)||0;if(I===0&&S.getMonth()!==_){const q=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];E.push({text:q[S.getMonth()],x:32+R*14}),_=S.getMonth()}y.push({key:j,x:32+R*14,y:20+I*14,level:h(F),date:j,count:F}),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 yk({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:Ru[v%Ru.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:Tt(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:sk(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:Qc(i.model)})]},i.model))})]})}function xk({onMenuClick:e,onNewChat:t,onSplitTerminal:r,onHistory:i,rightActions:s}){const{t:l}=re(),{topic:d,status:a,currentModel:o}=Qe(),{mainView:c,layout:p,terminalTitle:g}=Ne(),[b,x]=C.useState(!1),k=C.useRef(null),v=c==="terminal",m=tr(p)<kh;C.useEffect(()=>{if(!b)return;const _=S=>{k.current&&!k.current.contains(S.target)&&x(!1)};return document.addEventListener("mousedown",_),()=>document.removeEventListener("mousedown",_)},[b]);const u=C.useCallback(_=>{x(!1),r==null||r(_)},[r]),f=()=>{switch(c){case"chat":return d||l("chat.newChat");case"terminal":return g||l("terminal.title");case"settings":return l("settings.title");case"tasks":return l("scheduled.title");case"plugins":return l("sidebar.nav.plugins");case"workers":return l("workers.title");case"metrics":return l("sidebar.metrics");case"logs":return l("sidebar.logs");case"docs":return l("sidebar.docs");case"remote-control":return l("sidebar.remoteControl");case"keybindings":return l("keybindings.title");default:return""}},y=o?o.replace(/^(claude-|gpt-|deepseek-)/,"").split("-").slice(0,2).join("-"):"",E=()=>s||(v?n.jsxs("div",{ref:k,className:"relative",children:[n.jsx("button",{onClick:()=>m&&x(!b),className:`text-text-secondary transition-colors flex items-center justify-center w-8 h-8 rounded-full ${m?"hover:text-text-primary hover:bg-bg-secondary":"opacity-40 cursor-not-allowed"}`,title:m?void 0:l("terminal.maxPanes"),"aria-label":"Split terminal",children:n.jsx(fd,{size:20})}),b&&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:()=>u("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(fd,{size:16,className:"text-text-secondary"}),n.jsx("span",{children:l("terminal.splitHorizontal")})]}),n.jsxs("button",{onClick:()=>u("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(wf,{size:16,className:"text-text-secondary"}),n.jsx("span",{children:l("terminal.splitVertical")})]})]})]}):c==="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(dt,{size:20})}),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:l("sidebar.chatHistory"),"aria-label":"Chat history",children:n.jsx(rp,{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(Ui,{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:f()}),c==="chat"&&(y||a==="connected")&&n.jsx("span",{className:"hidden sm:block text-[10px] text-text-tertiary mt-0.5 truncate max-w-[200px]",children:[a==="connected"?"":"disconnected",y].filter(Boolean).join(" · ")})]}),n.jsx("div",{className:"flex items-center",children:E()})]})}let si=1e5;function vk(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-${++si}`,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-${++si}`,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-${++si}`,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 _k(){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(()=>vk(d),[d]),o=C.useMemo(()=>rh(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(ir,{size:16})}),n.jsx(nn,{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?eh(x.entry.content):void 0;if(v)return v.from==="system"?null:n.jsx("div",{children:n.jsx(th,{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(Vc,{message:x.entry})},x.entry.id):x.kind==="assistant_tools"?n.jsx("div",{className:"mb-6",children:n.jsx(Qp,{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 Sk=0;const kk={info:5e3,success:5e3,warn:8e3,error:0},Zt=Ce((e,t)=>({toasts:[],addToast:(r,i)=>{const s=`toast-${++Sk}`,l={id:s,type:r,message:i,createdAt:Date.now()};e(a=>({toasts:[...a.toasts.slice(-2),l]}));const d=kk[r];d>0&&setTimeout(()=>{t().removeToast(s)},d)},removeToast:r=>{e(i=>({toasts:i.toasts.filter(s=>s.id!==r)}))},clearAll:()=>e({toasts:[]})})),Lu={info:e=>Zt.getState().addToast("info",e),warn:e=>Zt.getState().addToast("warn",e),error:e=>Zt.getState().addToast("error",e),success:e=>Zt.getState().addToast("success",e)},wk={info:Ag,success:Dm,warn:Sr,error:sn},Ek={info:"text-accent-blue",success:"text-accent-green",warn:"text-accent-yellow",error:"text-accent-red"};function Ck({item:e}){const t=Zt(d=>d.removeToast),[r,i]=C.useState(!1),s=wk[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:`${Ek[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 Tk(){const e=Zt(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(Ck,{item:t},t.id))})}function Nk(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 Ak(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 Ik(e){return e.filter(t=>t.toolName==="TaskCreate"||t.toolName==="TaskUpdate").length}function Rk({status:e}){switch(e){case"completed":return n.jsx(Vu,{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(Fm,{size:14,className:"text-text-tertiary flex-shrink-0"})}}function Lk({member:e,isFocused:t,onClick:r}){var o;const i=e.status==="running"||e.status==="pending",s=e.status==="failed"||e.status==="killed",l=Ay(e.color),d=Gi(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(sn,{size:9,className:"flex-shrink-0"}),!i&&!s&&n.jsx(Pt,{size:9,className:"flex-shrink-0"})]})}function Dk(){const e=rt(A=>A.timeline),t=rt(A=>A.childToolCalls),r=rt(A=>A.isAgentRunning),{t:i}=re(),[s,l]=C.useState(!0),d=He(A=>A.isInTeam),a=He(A=>A.members),o=He(A=>A.focusedMemberName),c=He(A=>A.setFocusedMember),p=C.useMemo(()=>{const A=new Map;for(const G of a)G.color&&A.set(G.name,G.color);return A},[a]),g=C.useRef(0),[b,x]=C.useState(!1),k=C.useRef(r),v=C.useMemo(()=>Nk(e,t),[e,t]),h=C.useMemo(()=>a.map(A=>A.name),[a]),m=C.useMemo(()=>Ak(v,h),[v,h]),u=C.useMemo(()=>Ik(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(A=>!A),[]),y=C.useCallback(A=>{A.stopPropagation(),g.current=u,x(!0)},[u]),E=C.useCallback(A=>{c(o===A?null:A)},[o,c]),_=C.useCallback(A=>{A.owner&&p.has(A.owner)&&c(o===A.owner?null:A.owner)},[o,p,c]),S=a.filter(A=>A.status==="running"||A.status==="pending"),w=S.length>0,N=!r&&w,R=d&&a.length>0,I=m.length>0,$=I&&m.every(A=>A.status==="completed"),D=R&&!w&&!r,B=I&&m.every(A=>A.status==="pending")&&!r&&!w,F=I&&!($||D||B)&&!b,q=R&&(w||o);if(!F&&!q)return null;const H=m.filter(A=>A.status==="completed").length,T=m.length,L=m.find(A=>A.status==="in_progress"),O=L?L.activeForm||L.subject:`${H}/${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"}):q?n.jsx(fp,{size:13,className:"text-accent-purple flex-shrink-0"}):n.jsx(sp,{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:[F&&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:[H,"/",T]})]}),q&&F&&n.jsx("span",{className:"text-border-muted/40",children:"·"}),q&&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&&F&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"text-border-muted/60 select-none",children:"|"}),L&&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:A=>{A.key==="Enter"&&y(A)},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:[q&&n.jsx("div",{className:"flex flex-wrap gap-1.5 px-3 py-1.5",children:a.map(A=>n.jsx(Lk,{member:A,isFocused:o===A.name,onClick:()=>E(A.name)},A.name))}),F&&n.jsx("div",{className:`px-3 py-1.5 space-y-0.5 max-h-52 overflow-y-auto ${q?"border-t border-border-muted/30":""}`,children:m.map((A,G)=>{const z=A.owner?p.get(A.owner):void 0,K=!!z,W=z?Gi(z):void 0;return n.jsxs("div",{onClick:K?()=>_(A):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":""} ${A.status==="in_progress"?"text-text-primary":A.status==="completed"?"text-text-tertiary":"text-text-secondary"}`,children:[n.jsx(Rk,{status:A.status}),n.jsxs("span",{className:`truncate ${A.status==="completed"?"line-through":""}`,children:[G+1,". ",A.status==="in_progress"?A.activeForm||A.subject||i("todo.untitled"):A.subject||i("todo.untitled")]}),z&&n.jsxs("span",{className:"text-[10px] font-medium flex-shrink-0 ml-auto",style:{color:W},children:["@",A.owner]})]},A.id)})})]})]})})})}const Ok=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:oe()});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:oe()});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:oe()}),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"}},Dh={agent:nn,generation:pp,function:Jt,tool:Jt,handoff:Qu,guardrail:Og,response:cp,custom:Nr};function On(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 ed(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 Du(e,t){return t.some(r=>r.parentId===e)}function $k(){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}=Ok(),{workers:m,fetchWorkers:u}=Dn(),{sessionId:f}=Qe(),[y,E]=C.useState("list"),[_,S]=C.useState("timeline"),[w,N]=C.useState(!1);C.useEffect(()=>{g(),u()},[g,u]);const R=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]),D=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(cp,{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(zk,{workers:m,selectedPid:c,onSelect:x}),n.jsx(ai,{icon:We,title:e("traces.refresh"),onClick:$,spin:i}),r.length>0&&n.jsx(ai,{icon:ar,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:D.map(W=>n.jsx(Ou,{trace:W,onClick:()=>R(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(Ou,{trace:W,onClick:()=>R(W.traceId)},W.traceId))})]})]});const j=d;if(!j)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 F=j.trace,q=j.spans,H=F.modelInfo,T=Gk(q),L=(H==null?void 0:H.totalInputTokens)||T.totalInputTokens,O=(H==null?void 0:H.totalOutputTokens)||T.totalOutputTokens,A=(K=H==null?void 0:H.models)!=null&&K.length?H.models:T.models,G=H!=null&&H.totalInputTokens&&H.totalCachedTokens?H.totalCachedTokens/H.totalInputTokens*100:T.cacheHitRate,z=(H==null?void 0:H.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(ir,{size:16})}),n.jsx("span",{className:"font-medium text-text-primary truncate",children:F.prompt||F.name}),n.jsx("div",{className:"flex-1"}),n.jsx(td,{color:Oh(F.status),children:e($h(F.status))}),n.jsx(ai,{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($t,{label:e("traces.duration"),value:F.duration!=null?it(F.duration):"--"}),n.jsx($t,{label:"Spans",value:String(F.spanCount||0)}),L+O>0&&n.jsx($t,{label:"Tokens",value:`${bn(L)} in / ${bn(O)} out`}),L>0&&n.jsx($t,{label:"Cache",value:`${G.toFixed(0)}%`,accent:G>0}),A.length>0&&n.jsx($t,{label:e("traces.spanDetail.model"),value:A.join(", ")}),T.toolCount>0&&n.jsx($t,{label:"Tools",value:`${T.toolCount}${T.errorCount>0?` (${T.errorCount} err)`:""}`}),z>0&&n.jsx($t,{label:"LLM",value:e("traces.llmCalls").replace("{count}",String(z))})]}),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(Wk,{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(Mk,{detail:j,selectedSpanId:o,onSelectSpan:b,theme:t}),_==="tree"&&n.jsx(Pk,{detail:j,selectedSpanId:o,onSelectSpan:b,theme:t}),_==="flame"&&n.jsx(Fk,{detail:j,selectedSpanId:o,onSelectSpan:b,theme:t}),_==="graph"&&n.jsx(Bk,{detail:j,selectedSpanId:o,onSelectSpan:b,theme:t})]}),o&&n.jsx(Uk,{span:j.spans.find(W=>W.spanId===o)||null,onClose:()=>b(null)})]})})]})}function Ou({trace:e,onClick:t}){var a,o,c;const{t:r}=re(),i=Hk(e.status),s=e.prompt||e.name,l=qk(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(td,{color:Oh(e.status),children:r($h(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:bn(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,Zr=16,jk=2;function Mk({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(()=>On(e.spans),[e.spans]),g=C.useMemo(()=>ed(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=>Du(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=Du(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 D;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,jk),N=Je[u.span.type]||Je.custom,R=l?N.dark:N.light,I=((D=e.bottleneck)==null?void 0:D.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-Zr)/2,width:w,height:Zr,fill:R,rx:3,opacity:u.span.status==="running"?.5:.85}),I&&n.jsx("rect",{x:S-1,y:y+(ot-Zr)/2-1,width:w+2,height:Zr+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 Pk({detail:e,selectedSpanId:t,onSelectSpan:r,theme:i}){const{t:s}=re(),l=i==="dark",d=C.useMemo(()=>On(e.spans),[e.spans]);function a(o,c,p){var f;const g=o.span,b=Dh[g.type]||Nr,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 Fk({detail:e,selectedSpanId:t,onSelectSpan:r,theme:i}){const{t:s}=re(),l=i==="dark",d=C.useMemo(()=>ed(On(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 Bk({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,L=ed(On(e.spans));for(const z of L){const K=z.span,W=`${K.parentId||"root"}::${K.type}::${K.name.split("(")[0].trim()}`,U=T.get(W);U?(U.count++,U.totalDuration+=K.duration||0,U.totalTokens+=(K.inputTokens||0)+(K.outputTokens||0),K.status==="error"&&(U.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:z.depth,representativeSpanId:K.spanId})}const O=Array.from(T.values()),A=[];for(const z of O)if(z.parentId){const K=e.spans.find(W=>W.spanId===z.parentId);if(K){const W=`${K.parentId||"root"}::${K.type}::${K.name.split("(")[0].trim()}`;T.has(W)&&W!==z.id&&A.push({from:W,to:z.id})}}const G=new Set(A.map(z=>`${z.from}\0${z.to}`));return{groupNodes:O,groupEdges:Array.from(G).map(z=>{const[K,W]=z.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 L=Array.from(T.entries()).sort((K,W)=>K[0]-W[0]),O=Math.max(1,...L.map(([,K])=>K.length)),A=Math.max(O*(c+b)+b,400),G=L.length*(p+g)+20,z=new Map;for(const[K,W]of L){const U=W.length*c+(W.length-1)*b,M=(A-U)/2;W.forEach((X,Y)=>z.set(X.id,{x:M+Y*(c+b),y:K*(p+g)+10}))}return{positions:z,svgW:A,svgH:G}},[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 L=T.clientWidth,O=T.clientHeight;if(L<=0||O<=0)return;const A=Math.min(L/k,O/v,1.5)*.9;m({zoom:A,panX:(L-k*A)/2,panY:(O-v*A)/2})},[k,v]);C.useEffect(()=>{E()},[E,a.length]),C.useEffect(()=>{const T=d.current;if(!T)return;const L=O=>{O.preventDefault();const A=T.getBoundingClientRect(),G=O.clientX-A.left,z=O.clientY-A.top,K=O.deltaY<0?1.06:.94;m(W=>{const U=Math.max(.1,Math.min(5,W.zoom*K));return{zoom:U,panX:G-(G-W.panX)*(U/W.zoom),panY:z-(z-W.panY)*(U/W.zoom)}})};return T.addEventListener("wheel",L,{passive:!1}),()=>T.removeEventListener("wheel",L)},[]);const _=C.useRef(null),S=C.useCallback(T=>{if(T.touches.length===2){const L=T.touches[0].clientX-T.touches[1].clientX,O=T.touches[0].clientY-T.touches[1].clientY;_.current={dist:Math.hypot(L,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 L=T.touches[0].clientX-T.touches[1].clientX,O=T.touches[0].clientY-T.touches[1].clientY,A=Math.hypot(L,O),G=A/_.current.dist,z=d.current;if(z){const K=z.getBoundingClientRect(),W=_.current.cx-K.left,U=_.current.cy-K.top;m(M=>{const X=Math.max(.1,Math.min(5,M.zoom*G));return{zoom:X,panX:W-(W-M.panX)*(X/M.zoom),panY:U-(U-M.panY)*(X/M.zoom)}})}_.current.dist=A}else T.touches.length===1&&u&&m(L=>({...L,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},[]),R=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(L=>({...L,panX:y.current.panX+T.clientX-y.current.x,panY:y.current.panY+T.clientY-y.current.y}))},[u]),$=C.useCallback(()=>f(!1),[]),D=C.useMemo(()=>{if(!t)return new Set;const T=a.find(W=>W.representativeSpanId===t);if(!T)return new Set;const L=new Set([T.id]),O=new Map;for(const W of o)O.set(W.to,W.from);let A=T.id;for(;O.has(A)&&(A=O.get(A),!L.has(A));)L.add(A);const G=new Map;for(const W of o)G.has(W.from)||G.set(W.from,[]),G.get(W.from).push(W.to);const z=[T.id],K=new Set([T.id]);for(;z.length;){const W=z.shift();for(const U of G.get(W)||[])K.has(U)||(K.add(U),L.add(U),z.push(U))}return L},[t,a,o]),B=C.useCallback((T,L)=>D.has(T)&&D.has(L),[D]);if(!a.length)return n.jsx("div",{className:"text-sm text-text-tertiary py-8 text-center",children:s("traces.noSpans")});const j=l?"#d1d5db":"#374151",F=l?"#9ca3af":"#6b7280",q=l?"#4b5563":"#d1d5db",H=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:R,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,L)=>{const O=x.get(T.from),A=x.get(T.to);if(!O||!A)return null;const G=O.x+c/2,z=O.y+p,K=A.x+c/2,W=A.y,U=B(T.from,T.to);return n.jsx("path",{d:`M${G},${z} C${G},${z+g/2} ${K},${W-g/2} ${K},${W}`,fill:"none",stroke:U?H:q,strokeWidth:U?2.5:1.5,opacity:D.size>0&&!U?.2:1},L)}),a.map(T=>{const L=x.get(T.id);if(!L)return null;const O=Je[T.type]||Je.custom,A=l?O.dark:O.light,G=t===T.representativeSpanId,z=D.has(T.id),K=D.size>0&&!z,W=T.count>1?`${T.name} x${T.count}`:T.name,U=it(T.totalDuration),M=T.totalTokens>0?` · ${bn(T.totalTokens)}`:"";return n.jsxs("g",{onClick:X=>{X.stopPropagation(),r(G?null:T.representativeSpanId)},style:{cursor:"pointer"},opacity:K?.25:1,children:[n.jsx("rect",{x:L.x,y:L.y,width:c,height:p,rx:8,fill:l?"#1f2937":"#fff",stroke:G?A:T.hasError?"#ef4444":z?H:q,strokeWidth:G?2.5:z?2:1}),n.jsx("rect",{x:L.x,y:L.y,width:6,height:p,rx:3,fill:A}),n.jsx("text",{x:L.x+16,y:L.y+24,fontSize:13,fill:j,fontWeight:T.count>1?600:500,fontFamily:"sans-serif",children:W.length>20?W.slice(0,19)+"…":W}),n.jsxs("text",{x:L.x+16,y:L.y+44,fontSize:11,fill:F,fontFamily:"monospace",children:[U,M]}),n.jsxs("title",{children:[W," — ",U,M]})]},T.id)})]})})]})}function Uk({span:e,onClose:t}){const{t:r}=re(),[i,s]=C.useState("overview");if(!e)return null;const l=Dh[e.type]||Nr,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(td,{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(gt,{label:r("traces.spanDetail.type"),value:e.type}),n.jsx(gt,{label:r("traces.spanDetail.duration"),value:e.duration!=null?it(e.duration):"--"}),n.jsx(gt,{label:r("traces.selfTime"),value:d!=null?it(d):"--"}),n.jsx(gt,{label:"Status",value:e.status}),e.model&&n.jsx(gt,{label:r("traces.spanDetail.model"),value:e.model}),(e.inputTokens!=null||e.outputTokens!=null)&&n.jsx(gt,{label:r("traces.spanDetail.tokens"),value:`${e.inputTokens||0} in / ${e.outputTokens||0} out`}),e.toolName&&n.jsx(gt,{label:"Tool",value:e.toolName}),e.fromAgent&&n.jsx(gt,{label:"From",value:e.fromAgent}),e.toAgent&&n.jsx(gt,{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 zk({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 ai({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 td({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 Oh(e){return e==="error"?"red":e==="running"?"yellow":e==="cancelled"?"grey":"green"}function Hk(e){return e==="error"?"accent-red":e==="running"?"accent-yellow":e==="cancelled"?"text-tertiary":"accent-green"}function $h(e){return e==="error"?"traces.status.error":e==="running"?"traces.status.running":e==="cancelled"?"traces.status.cancelled":"traces.status.ok"}function $t({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 Gk(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 gt({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 Wk({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 bn(e){return e>=1e6?`${(e/1e6).toFixed(1)}M tok`:e>=1e3?`${(e/1e3).toFixed(1)}k tok`:`${e} tok`}function qk(e){try{return new Date(e).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit"})}catch{return""}}function Vk(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 Kk({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(Sr,{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 Yk=1e4;function Xk(){const{t:e}=re(),{workers:t,daemon:r,loading:i,error:s,fetchWorkers:l,fetchDaemonStatus:d,killWorker:a,startDaemon:o,stopDaemon:c,restartDaemon:p}=Dn();C.useEffect(()=>{l(),d();const m=setInterval(()=>{l(),d()},Yk);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(Kk,{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(zt,{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(Zk,{daemon:r,onStart:()=>o(),onStop:c,onRestart:p}),n.jsx(Jk,{workers:t,onViewLogs:b,onKill:v})]})}function Zk({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(on,{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(bt,{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(hp,{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
|