@shawnstack/quickforge 1.6.8 → 1.6.9
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/README.md +10 -10
- package/dist/assets/AgentProfilesPage-5eqU0Cjk.js +1 -0
- package/dist/assets/ChatPanelHost-BNFeNRy-.js +244 -0
- package/dist/assets/{PluginsPage-3pZG7D7e.js → PluginsPage-C5OClNdT.js} +1 -1
- package/dist/assets/ScheduledTasksPage-yT10oaaM.js +2 -0
- package/dist/assets/{SettingsWorkspacePage-DWkPyGP_.js → SettingsWorkspacePage-DuXwIeLd.js} +346 -335
- package/dist/assets/SharedConversationPage-ClpUSa0F.js +1 -0
- package/dist/assets/TerminalDock-BmL-FeKv.js +2 -0
- package/dist/assets/WorkspaceInspector-yH23pXpj.js +13 -0
- package/dist/assets/abnfDiagram-VRR7QNED-Dl_Fvlqg.js +1 -0
- package/dist/assets/arc-Bhg4c0ht.js +1 -0
- package/dist/assets/architecture-TIHT7OUA-BgP-IMeo.js +1 -0
- package/dist/assets/architectureDiagram-ZJ3FMSHR-BuojN27B.js +36 -0
- package/dist/assets/array-CYkMkqnU.js +1 -0
- package/dist/assets/blockDiagram-677ZJIJ3-alDLbrR1.js +132 -0
- package/dist/assets/c4Diagram-LMCZKHZV-D1lKa4VT.js +10 -0
- package/dist/assets/channel-Rz20dKTK.js +1 -0
- package/dist/assets/chunk-2Q5K7J3B-Cb14ZF_k.js +1 -0
- package/dist/assets/chunk-32BRIVSS-CwWLNjMZ.js +1 -0
- package/dist/assets/chunk-52WLFC77-Be569m7d.js +10 -0
- package/dist/assets/chunk-5FCAYU7R-BSvoiWV1.js +1 -0
- package/dist/assets/chunk-5HE753X5-CRgsy8WS.js +1 -0
- package/dist/assets/chunk-5JV3BV7I-CdW477UR.js +1 -0
- package/dist/assets/chunk-5TONJI2A-CdtKzSmp.js +2 -0
- package/dist/assets/chunk-5VM5RSS4-BKjjssLZ.js +15 -0
- package/dist/assets/chunk-7BUUIJ7U-ByAXiXdn.js +1 -0
- package/dist/assets/chunk-BIQX33UG-DeG8SCT1.js +1 -0
- package/dist/assets/chunk-C7G6YPKG-D_zHT68Q.js +1 -0
- package/dist/assets/chunk-CQNSW5MT-CHpHoUSu.js +1 -0
- package/dist/assets/chunk-CYSBUYHQ-CRP50Vov.js +1 -0
- package/dist/assets/chunk-EMLP6XTP-DX6uQQ2v.js +1 -0
- package/dist/assets/chunk-EX3LRPZG-DAJRNkHR.js +231 -0
- package/dist/assets/chunk-FWX5IMBZ-XbM5yomC.js +2 -0
- package/dist/assets/chunk-HOUHSVGY-Ci0ljnb1.js +1 -0
- package/dist/assets/chunk-ICXQ74PX-Dy2WJ71z.js +2 -0
- package/dist/assets/chunk-JG7HCLWE-2PrkzHkt.js +2 -0
- package/dist/assets/chunk-JWPE2WC7-D32uacSM.js +1 -0
- package/dist/assets/chunk-KEIR6QF5-77hsebd7.js +161 -0
- package/dist/assets/chunk-MOJQB5TN-DIAFLtiS.js +88 -0
- package/dist/assets/chunk-MOZMSUNE-BbscOaEz.js +1 -0
- package/dist/assets/chunk-OGEWGWER-ivBVxzKe.js +1 -0
- package/dist/assets/chunk-OSBZ3O6U-frD0hkdx.js +1 -0
- package/dist/assets/chunk-PUDLZKDR-B-37Rxae.js +156 -0
- package/dist/assets/chunk-Q4XR5HBZ-Y90m2RTe.js +11 -0
- package/dist/assets/chunk-QBLGF6JB-DixBqslB.js +1 -0
- package/dist/assets/chunk-R7FJI6CG-DXS1UXn_.js +1 -0
- package/dist/assets/chunk-RYQCIY6F-n4JxhNd0.js +1 -0
- package/dist/assets/chunk-U6XO7XAA-yHlgxMmn.js +2 -0
- package/dist/assets/chunk-V7JOEXUC-Z6kuZfbl.js +206 -0
- package/dist/assets/chunk-VAUOI2AC-BOZvd2Sn.js +1 -0
- package/dist/assets/chunk-VR4S4FIN-Cs_SIQma.js +1 -0
- package/dist/assets/chunk-WYO6CB5R-CGExYbV-.js +128 -0
- package/dist/assets/chunk-XXDRQBXY-CD_EGCtT.js +1 -0
- package/dist/assets/chunk-Y2CYZVJY-CQltPwYk.js +1 -0
- package/dist/assets/chunk-YOTPTUD7-DopPXWSl.js +1 -0
- package/dist/assets/chunk-ZGVPDNZ5-CJHOeqMb.js +62 -0
- package/dist/assets/chunk-ZIRB5QZD-BBVc5mf6.js +32 -0
- package/dist/assets/classDiagram-OUVF2IWQ-C_ozTKCt.js +1 -0
- package/dist/assets/classDiagram-v2-EOCWNBFH-FOfFbbZF.js +1 -0
- package/dist/assets/cose-bilkent-JH36ORCC-DLjV-dTm.js +1 -0
- package/dist/assets/cynefin-VYW2F7L2-BzPhLtd5.js +1 -0
- package/dist/assets/cynefinDiagram-TSTJHNR4-BfH3zVS-.js +62 -0
- package/dist/assets/cytoscape.esm-DwdZnGOm.js +321 -0
- package/dist/assets/dagre-CY3D84Cl.js +1 -0
- package/dist/assets/dagre-VKFMJZFB-BIhwZCIZ.js +4 -0
- package/dist/assets/defaultLocale-Beh6XjaL.js +1 -0
- package/dist/assets/diagram-FQU43EPY-BHnzNM2w.js +3 -0
- package/dist/assets/diagram-G47NLZAW-C7-ZlmFT.js +24 -0
- package/dist/assets/diagram-NH7WQ7WH-C-P9Y7IR.js +24 -0
- package/dist/assets/diagram-OA4YK3LP-Ci5lZ_T5.js +30 -0
- package/dist/assets/diagram-WEI45ONY-C1xuK2bs.js +41 -0
- package/dist/assets/dist-DelZBZpK.js +1 -0
- package/dist/assets/ebnfDiagram-CCIWWBDH-DKQ5NWMD.js +1 -0
- package/dist/assets/erDiagram-Q63AITRT-HAWySadP.js +85 -0
- package/dist/assets/eventmodeling-45OFAUF4-BcgGbVJ-.js +1 -0
- package/dist/assets/flowDiagram-23GEKE2U-dtkzcC8E.js +1 -0
- package/dist/assets/ganttDiagram-NO4QXBWP-C1hwIcOA.js +292 -0
- package/dist/assets/gitGraph-TEB2WS4Q-VByWboBU.js +1 -0
- package/dist/assets/gitGraphDiagram-IHSO6WYX-DYUYxs1R.js +106 -0
- package/dist/assets/graphlib-CAISHZh4.js +1 -0
- package/dist/assets/icons-C7j5jdKo.js +1 -0
- package/dist/assets/index-Qof73j0o.css +3 -0
- package/dist/assets/index-_ut7awrd.js +63 -0
- package/dist/assets/info-DKCQHKI2-CZeDLZxx.js +1 -0
- package/dist/assets/infoDiagram-FWYZ7A6U-CnIL6tv4.js +2 -0
- package/dist/assets/init-Rr1s_RiX.js +1 -0
- package/dist/assets/ishikawaDiagram-FXEZZL3T-B7WXNycQ.js +70 -0
- package/dist/assets/journeyDiagram-5HDEW3XC-D4HvioyY.js +139 -0
- package/dist/assets/kanban-definition-HUTT4EX6-CDs763eS.js +89 -0
- package/dist/assets/line-ikKkQiFp.js +1 -0
- package/dist/assets/linear-GqPyxQkN.js +1 -0
- package/dist/assets/map-CJwjCvwr.js +1 -0
- package/dist/assets/{mcp-servers-dialog-VbGvNekJ.js → mcp-servers-dialog-DC2Zfojn.js} +2 -2
- package/dist/assets/mermaid-parser.core-CoE8cccr.js +4 -0
- package/dist/assets/mermaid-renderer-BmbSAmpG.js +2 -0
- package/dist/assets/mermaid.core-DlFSL90j.js +11 -0
- package/dist/assets/mindmap-definition-LN4V7U3C-DLdq0K9C.js +96 -0
- package/dist/assets/{monaco-CzxeAjEw.js → monaco-CdOyGlWD.js} +1 -1
- package/dist/assets/ordinal-CibZU3PM.js +1 -0
- package/dist/assets/{otel-DQf3c6v2.js → otel-BNGM50C-.js} +1 -1
- package/dist/assets/packet-7NZHBO7P-decrrxyX.js +1 -0
- package/dist/assets/path-BAQ3hXlG.js +1 -0
- package/dist/assets/pegDiagram-2B236MQR-Cm1kPRC2.js +1 -0
- package/dist/assets/{pi-ai-DjJwSQBQ.js → pi-ai-Cr3rpCXT.js} +2 -2
- package/dist/assets/{pi-web-ui-DqxtBlZL.js → pi-web-ui-DoRGtREc.js} +371 -371
- package/dist/assets/pie-RZYD4A2V-J1CasQZl.js +1 -0
- package/dist/assets/pieDiagram-ENE6RG2P-Df05wjjo.js +39 -0
- package/dist/assets/quadrantDiagram-ABIIQ3AL-BjCwGxJC.js +7 -0
- package/dist/assets/radar-I7S5WNFK-B-sZytUA.js +1 -0
- package/dist/assets/railroad-3IZDKUUU-BSaqNPm8.js +1 -0
- package/dist/assets/railroad-abnf-AHOZXSZD-lzZR7PxT.js +1 -0
- package/dist/assets/railroad-ebnf-EBAXGLYW-DQtz1Fh9.js +1 -0
- package/dist/assets/railroad-peg-LSFZ7HO6-CpMsuGY3.js +1 -0
- package/dist/assets/railroadDiagram-RFXS5EU6-CTUvpKkv.js +1 -0
- package/dist/assets/{react-vendor-BR9MG2D-.js → react-vendor-VqdnQHHS.js} +1 -1
- package/dist/assets/requirementDiagram-TGXJPOKE-BU1kvEku.js +84 -0
- package/dist/assets/rough.esm-Djo4Abte.js +1 -0
- package/dist/assets/sankeyDiagram-HTMAVEWB-BHmvxVqH.js +40 -0
- package/dist/assets/sequenceDiagram-DBY2YBRQ-CTpwICgg.js +162 -0
- package/dist/assets/sizeCapture-X5ZJPWSS-BbLhGaa4.js +1 -0
- package/dist/assets/{skills-dialog-B0jNVGZW.js → skills-dialog-Mnj8fZwq.js} +1 -1
- package/dist/assets/src-B4Tvg3gT.js +1 -0
- package/dist/assets/stateDiagram-2N3HPSRC-BxuDwIgT.js +1 -0
- package/dist/assets/stateDiagram-v2-6OUMAXLB-BGLshxcY.js +1 -0
- package/dist/assets/swimlanes-5IMT3BWC-EkZsiylV.js +2 -0
- package/dist/assets/swimlanesDiagram-G3AALYLV-CqdqxA-b.js +8 -0
- package/dist/assets/timeline-definition-FHXFAJF6-C9ewOCTa.js +120 -0
- package/dist/assets/treeView-QDETBFTQ-Byb71heW.js +1 -0
- package/dist/assets/treemap-6X3UGDF4-CMV1SJsq.js +1 -0
- package/dist/assets/vennDiagram-L72KCM5P-CR49Y4Lp.js +34 -0
- package/dist/assets/wardley-OPB4EBWU-DtCHtr2V.js +1 -0
- package/dist/assets/wardleyDiagram-EHGQE667-Cn0GgwWi.js +78 -0
- package/dist/assets/xychartDiagram-FW5EYKEG-DlmPNAvd.js +7 -0
- package/dist/index.html +8 -8
- package/package.json +2 -1
- package/server/agent-manager.mjs +174 -9
- package/server/agent-profile-files.mjs +86 -6
- package/server/agent-profile-schema.mjs +197 -0
- package/server/agent-profiles.mjs +172 -41
- package/server/auto-compaction.mjs +2 -2
- package/server/project-route-context.mjs +25 -0
- package/server/routes/agent-profiles.mjs +9 -3
- package/server/routes/project.mjs +6 -10
- package/server/routes/workspace.mjs +184 -11
- package/server/storage.mjs +34 -0
- package/server/subagents.mjs +64 -0
- package/server/tools/definitions.mjs +17 -1
- package/dist/assets/AgentProfilesPage-R7N7eDq5.js +0 -1
- package/dist/assets/ChatPanelHost-C4orgd5l.js +0 -242
- package/dist/assets/ScheduledTasksPage-BAqoK4xk.js +0 -2
- package/dist/assets/SharedConversationPage-C-1n_MmB.js +0 -1
- package/dist/assets/TerminalDock-B6KAXkIU.js +0 -2
- package/dist/assets/WorkspaceInspector-CkXyD_k4.js +0 -3
- package/dist/assets/WorkspaceReaderDialog-Dp2QAwBo.js +0 -1
- package/dist/assets/diff-line-counts-Dm5kKQOo.js +0 -10
- package/dist/assets/icons-DHoaB5uq.js +0 -1
- package/dist/assets/index-C77QCHE9.css +0 -3
- package/dist/assets/index-CZb_mGGF.js +0 -63
- package/dist/assets/useAppTheme-DsabFF9D.js +0 -1
- /package/dist/assets/{plugin-api-Ds5xGIL7.js → plugin-api-BbUkYm3Y.js} +0 -0
- /package/dist/assets/{xterm-aPHkK8RR.js → xterm-CGiQzDiR.js} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-DWdDZTNf.js";import{Rt as t,i as n,pt as r}from"./icons-DHoaB5uq.js";import{n as i}from"./react-vendor-BR9MG2D-.js";import{b as a,d as o,f as s,p as c,u as l,v as u}from"./pi-web-ui-DqxtBlZL.js";import{U as d}from"./pi-ai-DjJwSQBQ.js";import{t as f}from"./logger-B65Akg8A.js";import{G as p,H as m,L as h,P as g,R as _,U as v,V as y,c as b,et as x,h as S,l as C,nt as w,rt as T,s as E,st as D,z as O}from"./index-CZb_mGGF.js";import{ChatPanelHost as k}from"./ChatPanelHost-C4orgd5l.js";var A=e(t(),1),j=`quickforgeClientMessageId`;function M(e){let t=e?.metadata;return t&&typeof t==`object`&&!Array.isArray(t)?t:void 0}function N(e){let t=M(e)?.[j];return typeof t==`string`&&t?t:void 0}function P(){return`qfcm_${typeof crypto<`u`&&typeof crypto.randomUUID==`function`?crypto.randomUUID():`${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`}`}function F(e){let t=N(e);if(t)return{message:e,clientMessageId:t};let n=P();return{message:{...e,metadata:{...M(e),[j]:n}},clientMessageId:n}}function I(e){return typeof e==`string`?e:Array.isArray(e)?e.filter(e=>e&&typeof e==`object`&&e.type===`text`).map(e=>e.text).filter(e=>typeof e==`string`).join(``):``}function L(e,t){if(!e||!t||e.role!==t.role)return!1;let n=N(e),r=N(t);return n&&r?n===r:I(e.content)===I(t.content)}async function R(e,t){let n=await fetch(e,{...t,cache:`no-store`,headers:{...t?.body?{"content-type":`application/json`}:void 0,...t?.headers}}),r=await n.json().catch(()=>null);if(!n.ok)throw Error(r?.error||`Request failed: ${n.status}`);return r}var z=class e{state;streamFn=d;getApiKey;sessionId;shareId;permission;listeners=new Set;eventSource=null;disposed=!1;reconnectTimer=null;reconnectDelay=1e3;baseUrl=``;syncingThinkingLevel=!1;planMode=!1;onPlanModeConsumed;constructor(e,t){this.shareId=e,this.sessionId=t.sessionId||t.id||e,this.permission=t.permission??`read`;let n={systemPrompt:t.systemPrompt??``,model:t.model??{provider:`shared`,id:`shared`},thinkingLevel:t.thinkingLevel??`off`,messages:t.messages?.slice()??[],tools:t.tools??[],isStreaming:!!t.isStreaming,streamingMessage:void 0,pendingToolCalls:new Set,errorMessage:t.errorMessage,contextCompaction:t.contextCompaction??null,contextUsage:t.contextUsage??null};this.state=new Proxy(n,{set:(e,t,n)=>{let r=e[t];return e[t]=n,t===`thinkingLevel`&&!this.syncingThinkingLevel&&n!==r&&this.updateThinkingLevel(n).catch(e=>{f.error(`Failed to update shared thinking level:`,e)}),!0}}),this.connectEvents()}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}setNextPromptCapabilities(){}setPlanMode(e,t){this.planMode=e,this.onPlanModeConsumed=e?t:void 0}async prompt(e){if(this.disposed||this.permission!==`operate`)return;let{message:t,clientMessageId:n}=F(this.normalizeInput(e)),r=this.planMode?{type:`plan`}:void 0;if(this.planMode){this.planMode=!1;let e=this.onPlanModeConsumed;this.onPlanModeConsumed=void 0,e?.()}this.state.messages=[...this.state.messages,t],this.emit({type:`message_start`,message:t}),this.state.isStreaming||(this.state.isStreaming=!0,this.state.errorMessage=void 0,this.emit({type:`agent_start`}));try{await R(`/api/shared/${encodeURIComponent(this.shareId)}/message`,{method:`POST`,body:JSON.stringify({message:t,clientMessageId:n,command:r})})}catch(e){let t=e instanceof Error?e.message:String(e);throw this.state.errorMessage=t,this.state.isStreaming=!1,this.emit({type:`error`,error:t}),this.emit({type:`agent_end`,messages:this.state.messages}),e}}async updateModel(e){if(!(this.disposed||this.permission!==`operate`)){this.state.model=e;try{let t=await R(`/api/shared/${encodeURIComponent(this.shareId)}/model`,{method:`POST`,body:JSON.stringify({model:e})});t.model&&(this.state.model=t.model)}catch(e){let t=e instanceof Error?e.message:String(e);throw this.state.errorMessage=t,this.emit({type:`error`,error:t}),e}}}async updateThinkingLevel(e){if(!(this.disposed||this.permission!==`operate`)){!this.syncingThinkingLevel&&this.state.thinkingLevel!==e&&(this.state.thinkingLevel=e);try{let t=await R(`/api/shared/${encodeURIComponent(this.shareId)}/thinking-level`,{method:`POST`,body:JSON.stringify({thinkingLevel:e})});t.thinkingLevel&&(this.state.thinkingLevel=t.thinkingLevel)}catch(e){let t=e instanceof Error?e.message:String(e);throw this.state.errorMessage=t,this.emit({type:`error`,error:t}),e}}}abort(){this.permission===`operate`&&fetch(`/api/shared/${encodeURIComponent(this.shareId)}/abort`,{method:`POST`}).catch(e=>{f.error(`Failed to abort shared conversation:`,e)})}steer(){}followUp(){}reset(){this.state.messages=[],this.state.errorMessage=void 0,this.state.isStreaming=!1,this.state.streamingMessage=void 0,this.state.pendingToolCalls=new Set}async rollback(e){if(this.permission!==`operate`)return;let t=await R(`/api/shared/${encodeURIComponent(this.shareId)}/rollback`,{method:`POST`,body:JSON.stringify({messageIndex:e})});return this.applyState(t.session),this.emit({type:`messages_replaced`,messages:this.state.messages}),t}dispose(){this.disposed=!0,this.reconnectTimer&&clearTimeout(this.reconnectTimer),this.reconnectTimer=null,this.eventSource?.close(),this.eventSource=null,this.listeners.clear()}static async loadState(e){return R(`/api/shared/${encodeURIComponent(e)}/session`)}static async create(t){return new e(t,await e.loadState(t))}normalizeInput(e){return typeof e==`string`?{role:`user`,content:e,timestamp:Date.now()}:Array.isArray(e)?[...e].reverse().find(e=>e.role===`user`||e.role===`user-with-attachments`)??e[e.length-1]:e}connectEvents(){this.disposed||(this.eventSource?.close(),this.baseUrl=``,this.openEventSource())}openEventSource(){if(this.disposed)return;let e=`${this.baseUrl}/api/shared/${encodeURIComponent(this.shareId)}/events`;this.eventSource=new EventSource(e,{withCredentials:!0}),this.eventSource.onopen=()=>{this.reconnectDelay=1e3};let t=[`state`,`agent_start`,`agent_end`,`message_start`,`message_end`,`turn_start`,`turn_end`,`message_update`,`tool_execution_start`,`tool_execution_update`,`tool_execution_end`,`error`,`title_updated`,`messages_replaced`,`auto_compact_completed`],n=e=>t=>{try{let n=JSON.parse(t.data);this.handleEvent(e?{type:e,...n}:n)}catch{}};this.eventSource.onmessage=n();for(let e of t)this.eventSource.addEventListener(e,n(e));this.eventSource.onerror=()=>{this.eventSource?.close(),this.eventSource=null,this.scheduleReconnect()}}scheduleReconnect(){this.disposed||this.reconnectTimer||(this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.reconnectDelay=Math.min(this.reconnectDelay*2,3e4),this.openEventSource()},this.reconnectDelay))}handleEvent(e){if(e.type){switch(e.type){case`state`:this.applyState(e);break;case`agent_start`:this.state.isStreaming=!0,this.state.errorMessage=void 0;break;case`agent_end`:this.state.isStreaming=!1,this.state.streamingMessage=void 0;break;case`message_start`:if(e.message){let t=this.state.messages.findIndex(t=>L(t,e.message));if(t>=0){let n=this.state.messages.slice();n[t]=e.message,this.state.messages=n}else this.state.messages=[...this.state.messages,e.message];this.state.contextUsage=null}break;case`message_update`:e.message&&(this.state.streamingMessage=e.message);break;case`message_end`:e.message&&(this.state.messages=m(this.state.messages,e.message)),this.state.contextUsage=`contextUsage`in e?e.contextUsage:null,this.state.streamingMessage=void 0;break;case`messages_replaced`:e.messages&&(this.state.messages=e.messages,this.state.streamingMessage=void 0),`contextCompaction`in e&&(this.state.contextCompaction=e.contextCompaction),`contextUsage`in e&&(this.state.contextUsage=e.contextUsage);break;case`auto_compact_completed`:`contextCompaction`in e&&(this.state.contextCompaction=e.contextCompaction),`contextUsage`in e&&(this.state.contextUsage=e.contextUsage);break;case`tool_execution_start`:{let t=e;t.toolCallId&&(this.state.messages=v(this.state.messages,y(t),!0),this.state.pendingToolCalls=new Set([...this.state.pendingToolCalls,t.toolCallId]));break}case`tool_execution_update`:{let t=e;this.state.messages=v(this.state.messages,t,!0),t.toolCallId&&(this.state.pendingToolCalls=new Set([...this.state.pendingToolCalls,t.toolCallId]));break}case`tool_execution_end`:{let t=e;if(this.state.messages=v(this.state.messages,t,!1),t.toolCallId){let e=new Set(this.state.pendingToolCalls);e.delete(t.toolCallId),this.state.pendingToolCalls=e}break}case`error`:this.state.errorMessage=typeof e.error==`string`?e.error:`Unknown error`,this.state.isStreaming=!1;break}this.emit(e)}}applyState(e){this.sessionId=e.sessionId||e.id||this.sessionId,e.messages&&(this.state.messages=e.messages,this.state.contextUsage=e.contextUsage===void 0?null:e.contextUsage),e.systemPrompt!==void 0&&(this.state.systemPrompt=e.systemPrompt),e.model&&(this.state.model=e.model),e.thinkingLevel&&(this.syncingThinkingLevel=!0,this.state.thinkingLevel=e.thinkingLevel,this.syncingThinkingLevel=!1),e.tools&&(this.state.tools=e.tools),e.isStreaming!==void 0&&(this.state.isStreaming=!!e.isStreaming),e.errorMessage!==void 0&&(this.state.errorMessage=e.errorMessage),e.contextCompaction!==void 0&&(this.state.contextCompaction=e.contextCompaction),e.contextUsage!==void 0&&(this.state.contextUsage=e.contextUsage)}emit(e){for(let t of this.listeners)try{t(e)}catch{}}},B=i();function V(e){return{id:`shared-${e.provider}`,name:e.provider,type:e.api,baseUrl:e.baseUrl??``,models:[e]}}async function H(e,t){try{let t=await b(e);if(t.providers?.length)return t.providers}catch{}return t?[V(t)]:[]}function U(e,t){let n=t.model??{provider:`shared`,id:`shared`};return new z(e,{...t,model:n,thinkingLevel:t.thinkingLevel??p(n)})}function W(e,t){let n={settings:new l,providerKeys:new s,sessions:new o,customProviders:new c},r=new x(``,{blockedStores:[`sessions`,`provider-keys`],fakeProviderKeys:t?[t.provider]:void 0,storeOverrides:t?{"custom-providers":{keys:async()=>(await H(e,t)).map(e=>e.name),get:async n=>(await H(e,t)).find(e=>e.name===n)??null,has:async n=>(await H(e,t)).some(e=>e.name===n)}}:void 0});n.settings.setBackend(r),n.providerKeys.setBackend(r),n.sessions.setBackend(r),n.customProviders.setBackend(r),a(new u(n.settings,n.providerKeys,n.sessions,n.customProviders,r))}function G({shareId:e}){let[t,i]=(0,A.useState)(``),[a,o]=(0,A.useState)(null),[s,c]=(0,A.useState)(`read`),[l,u]=(0,A.useState)(`QuickForge 分享对话`),[d,p]=(0,A.useState)(),[m,v]=(0,A.useState)(!1),[y,b]=(0,A.useState)(),x=(0,A.useRef)(!1),j=s===`operate`,M=!!a,N=!!a?.state.tools?.length;(0,A.useEffect)(()=>{W(e,a?.state.model)},[a?.state.model,e]),(0,A.useEffect)(()=>()=>a?.dispose(),[a]);let P=(0,A.useCallback)(async(n=t.trim())=>{p(void 0),v(!0);try{let t=await C(e,n);c(t.permission),u(t.title||t.share.titleSnapshot||`QuickForge 分享对话`);let r=await z.loadState(e);W(e,r.model),o(U(e,r))}catch(e){p(e instanceof Error?e.message:`Failed to unlock shared conversation`)}finally{v(!1)}},[t,e]);(0,A.useEffect)(()=>{if(M||m||x.current)return;x.current=!0;let t=window.setTimeout(()=>{(async()=>{try{(await E(e)).share.hasPassword||await P(``)}catch(e){p(e instanceof Error?e.message:`Failed to load shared conversation`)}})()},0);return()=>window.clearTimeout(t)},[m,e,P,M]);let F=(0,A.useCallback)(async e=>{await h(e)},[]),I=(0,A.useCallback)(async()=>{if(!(!a||a.permission!==`operate`))try{let t=(await H(e,a.state.model)).flatMap(e=>e.models??[]);if(!t.length)return;S(a.state.model,t,t=>{!t.reasoning&&a.state.thinkingLevel!==`off`&&a.updateThinkingLevel(`off`).catch(e=>{f.error(`Failed to update shared thinking level:`,e)}),W(e,t),a.updateModel(t).catch(e=>{p(e instanceof Error?e.message:`Failed to update model`)})},void 0,{thinkingLevel:a.state.thinkingLevel,onThinkingLevelSelect:e=>{a.updateThinkingLevel(e).catch(e=>{f.error(`Failed to update shared thinking level:`,e),p(e instanceof Error?e.message:`Failed to update thinking level`)})}})}catch(e){p(e instanceof Error?e.message:`Failed to load models`)}},[a,e]),L=(0,A.useCallback)(async e=>{if(!a||a.permission!==`operate`)return;if(p(void 0),a.state.isStreaming){g(D(`generationStillRunning`));return}let t=O(a.state.messages,e),n=t>=0?a.state.messages[t]:void 0;if(!n){g(D(`noConversationTurnToRollback`));return}try{await a.rollback(e),b({id:Date.now(),sessionId:a.sessionId,text:_(n),attachments:n.role===`user-with-attachments`?n.attachments:void 0})}catch(e){p(e instanceof Error?e.message:`Failed to roll back`)}},[a]);return M?(0,B.jsxs)(`div`,{className:`flex h-screen min-h-0 flex-col bg-background text-foreground`,children:[(0,B.jsx)(`header`,{className:T(`shrink-0 border-b px-4 py-3`,j?`border-red-300 bg-red-50 text-red-950`:`border-border bg-background`),children:(0,B.jsxs)(`div`,{className:`mx-auto flex max-w-4xl items-start gap-3`,children:[(0,B.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,B.jsx)(`div`,{className:`truncate text-sm font-semibold`,children:l}),(0,B.jsxs)(`div`,{className:`mt-1 flex flex-wrap items-center gap-x-2 gap-y-1 text-xs`,children:[(0,B.jsxs)(`span`,{className:T(`inline-flex items-center gap-1 rounded-full px-2 py-0.5 font-medium`,j?`bg-red-100 text-red-700`:`bg-muted text-muted-foreground`),children:[j?(0,B.jsx)(n,{className:`size-3.5`}):null,j?`高危可操作`:`只读分享`]}),(0,B.jsx)(`span`,{className:T(j?`text-red-800`:`text-muted-foreground`),children:j?`正在操作分享者的原始对话`:`只能查看,不能发送或修改`})]}),j?null:(0,B.jsx)(`div`,{className:`mt-1 text-xs leading-5 text-muted-foreground`,children:`界面与正常对话保持一致`})]}),(0,B.jsxs)(w,{variant:`ghost`,size:`sm`,className:T(`shrink-0`,j?`text-red-700 hover:bg-red-100 hover:text-red-800`:void 0),onClick:()=>void h(window.location.href),"aria-label":j?`复制高危分享链接`:`复制分享链接`,title:j?`复制高危分享链接`:`复制分享链接`,children:[(0,B.jsx)(r,{className:`size-4`}),(0,B.jsx)(`span`,{className:`hidden sm:inline`,children:j?`复制高危链接`:`复制链接`})]})]})}),d?(0,B.jsx)(`div`,{className:`mx-auto w-full max-w-4xl px-4 py-2 text-sm text-destructive`,children:d}):null,(0,B.jsx)(k,{agent:a,revision:0,agentAccessMode:N?`full-access`:`default`,workspaceToolsEnabled:N,onModelSelect:I,onAccessModeChange:()=>void 0,onRollbackFromMessage:L,onRetryFromMessage:()=>void 0,onCopyAnswer:F,onForkFromMessage:()=>void 0,onApproveToolCall:()=>void 0,onRejectToolCall:()=>void 0,disableFork:!0,rollbackConfirmTitle:D(`sharedRollbackConfirmTitle`),rollbackConfirmDescription:D(`sharedRollbackConfirm`),readOnly:!j,restoredDraft:y,bypassClientApiKeyCheck:!0})]}):(0,B.jsx)(`div`,{className:`flex min-h-screen items-center justify-center bg-background p-6 text-foreground`,children:(0,B.jsxs)(`div`,{className:`w-full max-w-md rounded-2xl border border-border bg-background p-6 shadow-quickforge`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2 text-base font-semibold`,children:[(0,B.jsx)(n,{className:`size-5 text-amber-500`}),`QuickForge 局域网对话分享`]}),(0,B.jsx)(`p`,{className:`mt-2 text-sm text-muted-foreground`,children:`如果分享者设置了密码,请输入密码。未设置密码的链接会自动打开。`}),(0,B.jsx)(`input`,{type:`password`,value:t,onChange:e=>i(e.target.value),onKeyDown:e=>{e.key===`Enter`&&P()},className:`mt-5 h-10 w-full rounded-md border border-input bg-background px-3 text-sm outline-none focus:border-primary`,placeholder:`密码`,autoFocus:!0}),d?(0,B.jsx)(`div`,{className:`mt-3 rounded-md border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive`,children:d}):null,(0,B.jsx)(w,{className:`mt-5 w-full`,onClick:()=>void P(),disabled:m||!t.trim(),children:m?D(`loading`):`用密码打开分享对话`})]})})}export{G as SharedConversationPage};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-DWdDZTNf.js";import{L as t,M as n,Ot as r,Rt as i,S as a,c as o,n as s,z as c}from"./icons-DHoaB5uq.js";import{n as l}from"./react-vendor-BR9MG2D-.js";import{D as u,nt as d,rt as f,st as p,w as m}from"./index-CZb_mGGF.js";import{n as ee,t as te}from"./xterm-aPHkK8RR.js";import{t as h}from"./useAppTheme-DsabFF9D.js";var g=e(i(),1);async function _(e,t){let n=await fetch(e,{cache:`no-store`,...t}),r=await n.json().catch(()=>null);if(!n.ok)throw Error(r?.error||`Request failed: ${n.status}`);return r}function v(){return _(`/api/terminal/capabilities`)}function y(e){return _(`/api/terminal/sessions${e?`?projectId=${encodeURIComponent(e)}`:``}`)}function b(e){return _(`/api/terminal/sessions`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(e)})}function x(e){return _(`/api/terminal/sessions/${encodeURIComponent(e)}`,{method:`DELETE`})}function S(e,t){return _(`/api/terminal/sessions/${encodeURIComponent(e)}/input`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({data:t})})}function C(){return``}function ne(){let e=C();if(e){let t=new URL(e);return t.protocol=t.protocol===`https:`?`wss:`:`ws:`,t.toString().replace(/\/$/,``)}return`${location.protocol===`https:`?`wss:`:`ws:`}//${location.host}`}var w=l(),T={light:{background:`#ffffff`,foreground:`#1f2937`,cursor:`#1f2937`,selectionBackground:`#dbeafe`},dark:{background:`#171717`,foreground:`#e5e7eb`,cursor:`#e5e7eb`,selectionBackground:`#3f3f46`}};function E({session:e,active:t,height:n,onReady:r,onExited:i,onConnectionError:a}){let o=h(),s=T[o],c=(0,g.useRef)(null),l=(0,g.useRef)(null),d=(0,g.useRef)(null),f=(0,g.useRef)(null),_=(0,g.useRef)(null),v=(0,g.useRef)(null);return(0,g.useEffect)(()=>{let t=c.current;if(!t)return;let n=!1,o=!1,h=!1,g=!1,y=t=>{n||h||g||(g=!0,a(e.id,t))},b=u(),x=new ee({cursorBlink:!0,convertEol:!1,fontFamily:getComputedStyle(document.documentElement).getPropertyValue(`--font-mono`).trim()||`ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace`,fontSize:b.fontSize,lineHeight:b.lineHeight,scrollback:5e3,theme:s}),S=new te;x.loadAddon(S),x.open(t),x.writeln(`\x1b[2mConnected to ${e.cwd}\x1b[0m`),l.current=x,d.current=S;let C=()=>{if(t.isConnected)try{S.fit();let{cols:e,rows:t}=x,n=f.current;n?.readyState===WebSocket.OPEN&&n.send(JSON.stringify({type:`resize`,cols:e,rows:t}))}catch{}},w=new WebSocket(`${ne()}/api/terminal/sessions/${encodeURIComponent(e.id)}/ws`);f.current=w,w.addEventListener(`open`,()=>{o=!0,g=!1,a(e.id,void 0),_.current=x.onData(e=>{w.readyState===WebSocket.OPEN&&w.send(JSON.stringify({type:`input`,data:e}))}),window.setTimeout(C,0)}),w.addEventListener(`message`,t=>{try{let n=JSON.parse(String(t.data));n.type===`ready`?r(e.id):n.type===`output`?x.write(n.data):n.type===`exit`?(h=!0,x.writeln(``),x.writeln(`\x1b[33m[process exited with code ${n.exitCode??`unknown`}]\x1b[0m`),i(e.id)):n.type===`error`&&x.writeln(`\x1b[31m${n.message}\x1b[0m`)}catch{}}),w.addEventListener(`error`,()=>{y(p(o?`terminalConnectionClosedUnexpectedly`:`terminalConnectionFailed`))}),w.addEventListener(`close`,e=>{_.current?.dispose(),_.current=null,!(n||h)&&(!e.wasClean||e.code!==1e3)&&y(p(o?`terminalConnectionClosedUnexpectedly`:`terminalConnectionFailed`))});let T=new ResizeObserver(()=>C());T.observe(t),v.current=T;let E=()=>{let e=u();x.options.fontSize=e.fontSize,x.options.lineHeight=e.lineHeight,window.setTimeout(C,0)};return window.addEventListener(m,E),window.setTimeout(C,50),()=>{n=!0,window.removeEventListener(m,E),T.disconnect(),v.current=null,_.current?.dispose(),_.current=null,w.close(),f.current=null,x.dispose(),l.current=null,d.current=null}},[o,a,i,r,e.cwd,e.id,s]),(0,g.useEffect)(()=>{if(!t)return;let e=d.current,n=l.current;window.setTimeout(()=>{try{e?.fit(),n?.focus()}catch{}},0)},[t,n]),(0,w.jsx)(`div`,{className:t?`h-full min-h-0 w-full pl-2 md:pl-3`:`hidden`,"aria-hidden":!t,children:(0,w.jsx)(`div`,{ref:c,className:`h-full min-h-0 w-full`})})}var re=180,ie=.7,ae=320;function D(e,t){let n=t?t.name:`Terminal`,r=new Set(e.map(e=>e.name));if(n!==`Terminal`&&!r.has(n))return n;let i=1;for(;r.has(`${n} ${i}`);)i+=1;return`${n} ${i}`}function O(e,t){let n=e?.terminalShellProfiles||[],r=t||e?.defaultTerminalShellProfileId||``;return n.find(e=>e.id===r)||n[0]}function k({project:e,onCollapse:i,pendingCommand:l,onPendingCommandHandled:u,variant:m=`dock`,singleSession:ee=!1,panelInstanceId:te,panelSessionId:h,onPanelSessionReady:_}){let[C,ne]=(0,g.useState)(null),[T,k]=(0,g.useState)([]),[A,j]=(0,g.useState)(),[M,oe]=(0,g.useState)(ae),[N,se]=(0,g.useState)(!0),[P,ce]=(0,g.useState)(!1),[le,F]=(0,g.useState)(),[ue,I]=(0,g.useState)({}),[L,R]=(0,g.useState)(!1),[z,de]=(0,g.useState)(!1),B=(0,g.useRef)(!1),V=(0,g.useRef)(!1),H=(0,g.useRef)(new Set),fe=(0,g.useRef)(l),U=(0,g.useRef)(new Set),W=(0,g.useRef)(new Set),G=(0,g.useRef)(new Map),K=(0,g.useRef)(!0),pe=(0,g.useRef)(_),[me,he]=(0,g.useState)(()=>new Set),q=(0,g.useRef)(null),ge=(0,g.useRef)(null),J=e?.id,Y=m===`panel`&&!!te,X=(0,g.useMemo)(()=>T.find(e=>e.id===A)??T[0],[A,T]);(0,g.useEffect)(()=>{fe.current=l},[l]),(0,g.useEffect)(()=>{pe.current=_},[_]),(0,g.useEffect)(()=>()=>{K.current=!1},[]);let _e=(0,g.useCallback)(async()=>{let e=await y(J);return k(e.sessions),j(t=>t&&e.sessions.some(e=>e.id===t)?t:e.sessions[0]?.id),e.sessions},[J]),ve=(0,g.useCallback)(async(e,t)=>{if(B.current)return;let n=O(C,t);B.current=!0,ce(!0),F(void 0),I({});try{let t=await b({projectId:J,name:D(e,n),cols:120,rows:30,shellProfileId:n?.id,shellProfileName:n?.name});k(e=>[...e,t]),j(t.id)}catch(e){F(e instanceof Error?e.message:p(`terminalCreateFailed`))}finally{B.current=!1,ce(!1)}},[C,J]);(0,g.useEffect)(()=>{let e=!1;return(async()=>{se(!0),F(void 0);try{let[t,n]=await Promise.all([v(),y(J)]);if(e)return;if(ne(t),t.enabled&&Y&&h&&n.sessions.some(e=>e.id===h)){V.current=!0,k(n.sessions),j(h);return}if(t.enabled&&Y&&!V.current){V.current=!0;let r=O(t);try{let t=await b({projectId:J,name:D(n.sessions,r),cols:120,rows:30,shellProfileId:r?.id,shellProfileName:r?.name});if(e){x(t.id).catch(()=>{});return}k([...n.sessions,t]),j(t.id),pe.current?.(t.id);return}catch(t){e||F(t instanceof Error?t.message:p(`terminalCreateFailed`))}}if(k(n.sessions),j(n.sessions[0]?.id),t.enabled&&n.sessions.length===0&&!fe.current){let n=O(t);b({projectId:J,name:D([],n),cols:120,rows:30,shellProfileId:n?.id,shellProfileName:n?.name}).then(t=>{if(e){x(t.id).catch(()=>{});return}k([t]),j(t.id)}).catch(t=>{e||F(t instanceof Error?t.message:p(`terminalCreateFailed`))})}}catch(t){e||F(t instanceof Error?t.message:p(`terminalUnavailable`))}finally{e||se(!1)}})(),()=>{e=!0}},[Y,h,J]),(0,g.useEffect)(()=>{if(!L)return;let e=e=>{ge.current?.contains(e.target)||R(!1)},t=e=>{e.key===`Escape`&&R(!1)};return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,t)}},[L]),(0,g.useEffect)(()=>{if(!z)return;let e=e=>{e.key===`Escape`&&de(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[z]),(0,g.useEffect)(()=>{if(!l||H.current.has(l.id)||G.current.has(l.id)||U.current.has(l.id)||N||P||!C)return;if(!C.enabled){H.current.add(l.id),window.setTimeout(()=>{F(C.reason||p(`terminalUnavailable`)),u?.(l.id)},0);return}let e=X&&!X.exited?X:T.find(e=>!e.exited);if(e){G.current.set(l.id,e.id),window.setTimeout(()=>{K.current&&j(e.id)},0);return}U.current.add(l.id),window.setTimeout(()=>{K.current&&F(void 0)},0);let t=O(C);b({projectId:J,name:D(T,t),cols:120,rows:30,shellProfileId:t?.id,shellProfileName:t?.name}).then(e=>{if(!K.current){x(e.id).catch(()=>{});return}G.current.set(l.id,e.id),k(t=>t.some(t=>t.id===e.id)?t:[...t,e]),j(e.id)}).catch(e=>{K.current&&(F(e instanceof Error?e.message:p(`terminalCommandExecuteFailed`)),H.current.add(l.id),u?.(l.id))}).finally(()=>{U.current.delete(l.id)})},[X,C,P,N,u,l,J,T]),(0,g.useEffect)(()=>{if(!l||H.current.has(l.id)||W.current.has(l.id))return;let e=G.current.get(l.id),t=e?T.find(t=>t.id===e):X&&!X.exited?X:T.find(e=>!e.exited);!t||t.exited||!me.has(t.id)||(W.current.add(l.id),window.setTimeout(()=>{K.current&&(j(t.id),F(void 0))},0),(async()=>{try{if(l.execute){let e=l.command.split(`
|
|
2
|
-
`),n=e.flatMap((t,n)=>n<e.length-1?[t,`\r`]:[t]);n.push(`\r`),await S(t.id,n.join(``))}else await S(t.id,l.command)}catch(e){K.current&&F(e instanceof Error?e.message:p(`terminalCommandExecuteFailed`))}finally{H.current.add(l.id),W.current.delete(l.id),G.current.delete(l.id),K.current&&u?.(l.id)}})())},[X,u,l,me,T]);let ye=async e=>{F(void 0),I(t=>{if(!t[e])return t;let n={...t};return delete n[e],n});let t=T.filter(t=>t.id!==e);k(t),A===e&&j(t[0]?.id);try{await x(e)}catch(e){F(e instanceof Error?e.message:p(`terminalCloseFailed`)),_e().catch(()=>{})}},be=(0,g.useCallback)(e=>{k(t=>t.map(t=>t.id===e?{...t,exited:!0}:t)),he(t=>{if(!t.has(e))return t;let n=new Set(t);return n.delete(e),n})},[]),xe=(0,g.useCallback)(e=>{he(t=>{if(t.has(e))return t;let n=new Set(t);return n.add(e),n})},[]),Se=(0,g.useCallback)((e,t)=>{I(n=>{if(!t){if(!n[e])return n;let t={...n};return delete t[e],t}return n[e]===t?n:{...n,[e]:t}})},[]),Ce=e=>{q.current={startY:e.clientY,startHeight:M},e.currentTarget.setPointerCapture(e.pointerId)},we=e=>{let t=q.current;if(!t)return;let n=Math.max(re,Math.floor(window.innerHeight*ie));oe(Math.min(n,Math.max(re,t.startHeight+t.startY-e.clientY)))},Te=e=>{q.current=null;try{e.currentTarget.releasePointerCapture(e.pointerId)}catch{}},Z=C?.terminalShellProfiles||[],Ee=C?.defaultTerminalShellProfileId||``,De=Z.find(e=>e.id===Ee)||Z[0],Oe=!!(C&&T.length>=C.maxSessions),ke=P||Oe,Ae=X?ue[X.id]:void 0,je=Y&&X?[X]:T,Q=le??Ae,$=m===`panel`,Me=$&&ee,Ne=$?void 0:z?Q?`calc(100% - 4.25rem)`:`calc(100% - 2.25rem)`:Q?M-72:M-45;return(0,w.jsxs)(`div`,{className:f($?`flex min-h-0 flex-1 flex-col bg-background`:`shrink-0 border-t border-border bg-background`,z&&`quickforge-terminal-fullscreen z-40 flex flex-col border-t-0`),style:z||$?void 0:{height:M},children:[!z&&!$?(0,w.jsx)(`div`,{className:`h-1 cursor-row-resize bg-transparent hover:bg-border`,onPointerDown:Ce,onPointerMove:we,onPointerUp:Te,onPointerCancel:Te}):null,(0,w.jsxs)(`div`,{className:`flex h-9 items-center gap-1 border-b border-border px-2`,children:[(0,w.jsx)(o,{className:`size-4 shrink-0 text-muted-foreground/60`}),(0,w.jsx)(`div`,{className:`flex min-w-0 flex-1 items-center gap-1 overflow-x-auto`,children:je.map(e=>{let t=f(`flex max-w-44 shrink-0 items-center gap-1 rounded-md px-2 py-1 text-xs text-muted-foreground/72`,X?.id===e.id&&`bg-muted/28 text-foreground/90`);return Me?(0,w.jsxs)(`div`,{className:t,title:`${e.name} — ${e.cwd}`,children:[(0,w.jsx)(`span`,{className:f(`size-1.5 rounded-full`,e.exited?`bg-muted-foreground/40`:`bg-emerald-500/80`)}),(0,w.jsx)(`span`,{className:`truncate`,children:e.name})]},e.id):(0,w.jsxs)(`button`,{type:`button`,className:f(t,`hover:bg-muted/20 hover:text-foreground/85`),onClick:()=>j(e.id),title:`${e.name} — ${e.cwd}`,children:[(0,w.jsx)(`span`,{className:f(`size-1.5 rounded-full`,e.exited?`bg-muted-foreground/40`:`bg-emerald-500/80`)}),(0,w.jsx)(`span`,{className:`truncate`,children:e.name}),(0,w.jsx)(`span`,{role:`button`,tabIndex:0,className:`ml-1 rounded-sm p-0.5 opacity-60 hover:bg-background hover:opacity-100`,onClick:t=>{t.stopPropagation(),ye(e.id)},onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),t.stopPropagation(),ye(e.id))},"aria-label":p(`terminalCloseSession`,{name:e.name}),children:(0,w.jsx)(s,{className:`size-3`})})]},e.id)})}),Me?null:(0,w.jsxs)(`div`,{className:`relative shrink-0`,ref:ge,children:[(0,w.jsxs)(`div`,{className:`flex items-center overflow-hidden rounded-md border border-border bg-background`,children:[(0,w.jsx)(`button`,{type:`button`,className:`inline-flex h-7 w-7 items-center justify-center text-foreground/85 transition-colors hover:bg-muted/20 disabled:pointer-events-none disabled:opacity-50`,onClick:()=>void ve(T),disabled:ke,title:De?p(`terminalNewWithProfile`,{name:De.name}):p(`terminalNew`),"aria-label":p(`terminalNew`),children:P?(0,w.jsx)(c,{className:`size-3.5 animate-spin`}):(0,w.jsx)(a,{className:`size-3.5`})}),Z.length>0?(0,w.jsx)(`button`,{type:`button`,className:`inline-flex h-7 w-7 items-center justify-center border-l border-border text-muted-foreground/72 transition-colors hover:bg-muted/20 hover:text-foreground/85 disabled:pointer-events-none disabled:opacity-50`,onClick:()=>R(e=>!e),disabled:ke,title:p(`terminalSelectShell`),"aria-label":p(`terminalSelectShell`),"aria-expanded":L,children:(0,w.jsx)(r,{className:`size-3.5`})}):null]}),L?(0,w.jsxs)(`div`,{className:f(`absolute right-0 z-30 w-64 overflow-hidden rounded-lg border border-border bg-background p-1.5 shadow-[0_16px_38px_-22px_rgb(15_23_42_/_0.65)]`,$?`top-9`:`bottom-9`),children:[(0,w.jsx)(`div`,{className:`px-2 pb-1.5 pt-1 text-[11px] font-medium uppercase tracking-wide text-muted-foreground/60`,children:p(`terminalNewWith`)}),Z.map(e=>(0,w.jsxs)(`button`,{type:`button`,className:`flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-xs text-muted-foreground/80 hover:bg-muted/20 hover:text-foreground/90`,onClick:()=>{R(!1),ve(T,e.id)},children:[(0,w.jsx)(`span`,{className:`inline-flex size-5 shrink-0 items-center justify-center rounded bg-muted/20 text-[10px] text-muted-foreground/70`,children:e.name.slice(0,1).toUpperCase()}),(0,w.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,w.jsx)(`span`,{className:`block truncate font-medium`,children:e.name}),(0,w.jsx)(`span`,{className:`block truncate font-mono text-[11px] text-muted-foreground/55`,children:e.command})]})]},e.id))]}):null]}),Me?null:(0,w.jsx)(d,{variant:`ghost`,size:`icon`,className:`size-7`,onClick:()=>de(e=>!e),title:p(z?`terminalExitFullscreen`:`terminalFullscreen`),"aria-label":p(z?`terminalExitFullscreen`:`terminalFullscreen`),children:z?(0,w.jsx)(n,{className:`size-3.5`}):(0,w.jsx)(t,{className:`size-3.5`})}),(0,w.jsx)(d,{variant:`ghost`,size:`icon`,className:f(`size-7`,$&&`hidden`),onClick:i,title:p(`terminalCollapse`),"aria-label":p(`terminalCollapse`),children:(0,w.jsx)(r,{className:`size-3.5`})})]}),Q?(0,w.jsx)(`div`,{className:`border-b border-border px-3 py-1.5 text-xs text-destructive`,children:Q}):null,(0,w.jsx)(`div`,{className:f(`min-h-0 bg-background`,$&&`flex-1`),style:Ne===void 0?void 0:{height:Ne},children:N?(0,w.jsxs)(`div`,{className:`flex h-full items-center justify-center gap-2 text-xs text-muted-foreground/60`,children:[(0,w.jsx)(c,{className:`size-4 animate-spin`}),` `,p(`terminalStarting`)]}):C&&!C.enabled?(0,w.jsx)(`div`,{className:`flex h-full items-center justify-center px-4 text-center text-xs text-muted-foreground/60`,children:C.reason||p(`terminalUnavailable`)}):T.length===0?(0,w.jsx)(`div`,{className:`flex h-full items-center justify-center text-xs text-muted-foreground/60`,children:p(`terminalNoSessions`)}):T.map(e=>(0,w.jsx)(E,{session:e,active:e.id===X?.id,height:z?window.innerHeight-36:$?0:M,onReady:xe,onExited:be,onConnectionError:Se},e.id))})]})}export{k as TerminalDock};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-DWdDZTNf.js";import{$ as t,Et as n,Ft as r,G as i,H as a,L as o,M as s,N as c,Ot as l,Pt as u,Q as d,Rt as f,S as p,U as m,X as h,Y as g,Z as _,_ as ee,at as v,b as y,c as te,ct as ne,dt as re,et as b,ft as ie,ht as ae,it as x,j as oe,kt as S,mt as se,n as ce,o as le,ot as ue,pt as de,q as fe,rt as C,st as w,tt as T,ut as E,v as D,wt as pe}from"./icons-DHoaB5uq.js";import{n as O}from"./react-vendor-BR9MG2D-.js";import{a as me,d as he,f as ge,i as k,n as _e,nt as A,o as j,p as ve,r as ye,rt as M,st as N,t as be,u as xe}from"./index-CZb_mGGF.js";import{TerminalDock as Se}from"./TerminalDock-B6KAXkIU.js";import{i as Ce,n as we,r as Te,t as P}from"./diff-line-counts-Dm5kKQOo.js";var F=e(f(),1),I=O();function Ee(e){let t=e.trim();if(!t.startsWith(`/api/workspace/preview/`))return!1;try{let e=new URL(t,window.location.origin);return e.origin===window.location.origin&&e.pathname.startsWith(`/api/workspace/preview/`)}catch{return!1}}function L(e){let t=e.trim().replace(/\\/g,`/`);return t.startsWith(`/`)||/^[a-zA-Z]:\//.test(t)}function De(e,t){let n=e.trim();if(!t||!Ee(n))return n;try{let e=new URL(n,window.location.origin),r=`/api/workspace/preview/${encodeURIComponent(t)}/`;return e.pathname.startsWith(r)?e.pathname.slice(r.length).split(`/`).map(e=>decodeURIComponent(e)).join(`/`):n}catch{return n}}function Oe(e,t){let n=e.trim();if(!n)return{url:``,displayUrl:``,error:``};if(Ee(n)){let e=new URL(n,window.location.origin);return{url:`${e.pathname}${e.search}${e.hash}`,displayUrl:De(n,t),error:``}}if(t&&L(n))return{url:j(t,n),displayUrl:n,error:``};let r=/^https?:\/\//i.test(n)?n:`http://${n}`;try{let e=new URL(r);return e.protocol!==`http:`&&e.protocol!==`https:`?{url:``,displayUrl:n,error:N(`invalidPreviewUrl`)}:{url:e.toString(),displayUrl:e.toString(),error:``}}catch{return{url:``,displayUrl:n,error:N(`invalidPreviewUrl`)}}}function ke({url:e,onUrlChange:t,projectId:n}){let i=(0,F.useMemo)(()=>Oe(e,n),[n,e]),[a,o]=(0,F.useState)({sourceUrl:e,value:i.displayUrl}),[s,c]=(0,F.useState)(``),[l,u]=(0,F.useState)(0),[d,f]=(0,F.useState)(!1),[h,g]=(0,F.useState)(100),_=(0,F.useRef)(null),ee=(0,F.useRef)(null),v=i.url,te=v.startsWith(`/api/workspace/preview/`)?`allow-scripts allow-same-origin allow-forms`:`allow-scripts allow-same-origin allow-forms allow-popups allow-downloads allow-modals allow-pointer-lock`,re=a.sourceUrl===e?a.value:i.displayUrl;(0,F.useEffect)(()=>{if(!d)return;function e(e){_.current?.contains(e.target)||f(!1)}return document.addEventListener(`pointerdown`,e),()=>document.removeEventListener(`pointerdown`,e)},[d]);function b(){try{ee.current?.contentWindow?.history.back()}catch{}}function ie(e=re){let r=Oe(e,n);if(r.error){c(r.error);return}c(``),o({sourceUrl:r.displayUrl,value:r.displayUrl}),t(r.displayUrl),r.url&&u(e=>e+1)}function ae(){v&&u(e=>e+1)}function x(){v&&window.open(v,`_blank`,`noopener,noreferrer`)}return(0,I.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,I.jsxs)(`div`,{className:`flex shrink-0 flex-col gap-2 border-b border-border p-3`,children:[(0,I.jsxs)(`form`,{className:`flex items-center gap-2`,onSubmit:e=>{e.preventDefault(),ie()},children:[(0,I.jsx)(A,{type:`button`,variant:`ghost`,size:`icon`,onClick:b,disabled:!v,"aria-label":N(`back`),title:N(`back`),children:(0,I.jsx)(r,{className:`size-4`})}),(0,I.jsx)(A,{type:`button`,variant:`ghost`,size:`icon`,onClick:ae,disabled:!v,"aria-label":N(`refreshPreview`),title:N(`refreshPreview`),children:(0,I.jsx)(y,{className:`size-4`})}),(0,I.jsxs)(`label`,{className:`mx-auto flex h-9 min-w-0 max-w-xl flex-1 items-center rounded-full border border-[color-mix(in_oklab,var(--border)_42%,transparent)] bg-muted/30 px-3 text-sm text-muted-foreground/65 focus-within:bg-background focus-within:text-foreground/85`,children:[(0,I.jsx)(`span`,{className:`sr-only`,children:N(`previewUrl`)}),(0,I.jsx)(`input`,{value:re,onChange:t=>{o({sourceUrl:e,value:t.target.value}),s&&c(``)},placeholder:N(`previewUrlPlaceholder`),className:`min-w-0 flex-1 bg-transparent text-center text-sm text-foreground/85 outline-none placeholder:text-muted-foreground/55`})]}),(0,I.jsx)(A,{type:`button`,variant:`ghost`,size:`icon`,onClick:x,disabled:!v,"aria-label":N(`openInBrowser`),title:N(`openInBrowser`),children:(0,I.jsx)(ne,{className:`size-4`})}),(0,I.jsxs)(`div`,{ref:_,className:`relative shrink-0`,children:[(0,I.jsx)(A,{type:`button`,variant:`ghost`,size:`icon`,onClick:()=>f(e=>!e),"aria-label":N(`more`),title:N(`more`),"aria-haspopup":`menu`,"aria-expanded":d,children:(0,I.jsx)(E,{className:`size-4`})}),d?(0,I.jsxs)(`div`,{className:`absolute right-0 top-10 z-30 w-48 rounded-2xl border border-[color-mix(in_oklab,var(--border)_34%,transparent)] bg-popover p-2 shadow-quickforge`,role:`menu`,children:[(0,I.jsx)(`div`,{className:`px-2 py-1.5 text-xs font-medium text-muted-foreground`,children:N(`zoom`)}),(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2 rounded-xl px-1 py-1.5`,children:[(0,I.jsx)(A,{type:`button`,variant:`ghost`,size:`icon`,className:`size-8`,onClick:()=>g(e=>Math.max(50,e-10)),"aria-label":N(`zoomOut`),title:N(`zoomOut`),children:(0,I.jsx)(oe,{className:`size-4`})}),(0,I.jsxs)(`button`,{type:`button`,className:`min-w-14 rounded-lg px-2 py-1 text-sm font-medium text-foreground/85 hover:bg-muted/50`,onClick:()=>g(100),title:N(`resetZoom`),children:[h,`%`]}),(0,I.jsx)(A,{type:`button`,variant:`ghost`,size:`icon`,className:`size-8`,onClick:()=>g(e=>Math.min(200,e+10)),"aria-label":N(`zoomIn`),title:N(`zoomIn`),children:(0,I.jsx)(p,{className:`size-4`})})]})]}):null]})]}),s?(0,I.jsx)(`div`,{className:`text-xs text-destructive`,children:s}):null]}),(0,I.jsx)(`div`,{className:`min-h-0 flex-1 bg-muted/10`,children:v?(0,I.jsx)(`div`,{className:`h-full w-full overflow-auto bg-background`,children:(0,I.jsx)(`iframe`,{ref:ee,title:N(`webPreview`),src:v,sandbox:te,className:`origin-top-left border-0 bg-background`,style:{width:`${1e4/h}%`,height:`${1e4/h}%`,transform:`scale(${h/100})`}},`${v}:${l}`)}):(0,I.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center px-8 text-center`,children:[(0,I.jsx)(m,{className:`size-20 stroke-[1.55] text-muted-foreground/75`}),(0,I.jsx)(`div`,{className:`mt-8 text-xl font-semibold tracking-tight text-foreground/88`,children:N(`noPreviewUrlTitle`)}),(0,I.jsx)(`div`,{className:`mt-4 max-w-xs text-base leading-6 text-muted-foreground/82`,children:N(`noPreviewUrlDescription`)})]})})]})}var Ae={ts:`typescript`,tsx:`typescript`,js:`javascript`,jsx:`javascript`,mjs:`javascript`,cjs:`javascript`,json:`json`,jsonc:`json`,css:`css`,scss:`scss`,less:`less`,html:`html`,htm:`html`,md:`markdown`,markdown:`markdown`,py:`python`,rb:`ruby`,go:`go`,rs:`rust`,java:`java`,c:`c`,h:`c`,cpp:`cpp`,cc:`cpp`,cxx:`cpp`,hpp:`cpp`,cs:`csharp`,php:`php`,swift:`swift`,kt:`kotlin`,kts:`kotlin`,sh:`shell`,bash:`shell`,zsh:`shell`,ps1:`powershell`,yml:`yaml`,yaml:`yaml`,xml:`xml`,sql:`sql`,dockerfile:`dockerfile`,toml:`toml`,ini:`ini`,env:`ini`};function R(e){let t=e.split(`/`).pop()?.toLowerCase()??``;return t===`dockerfile`||t.endsWith(`.dockerfile`)?`dockerfile`:Ae[t.includes(`.`)?t.split(`.`).pop()??``:t]??`plaintext`}function je(e){return e.slice(e.lastIndexOf(`/`)+1)}function Me(e){let t=e.lastIndexOf(`.`);return t>0?e.slice(t+1):``}var z={typescript:{Icon:x,className:`text-sky-500 dark:text-sky-400`},javascript:{Icon:x,className:`text-amber-500 dark:text-amber-400`},python:{Icon:x,className:`text-blue-600 dark:text-blue-400`},go:{Icon:x,className:`text-cyan-600 dark:text-cyan-400`},rust:{Icon:x,className:`text-orange-600 dark:text-orange-400`},java:{Icon:x,className:`text-red-500 dark:text-red-400`},c:{Icon:x,className:`text-blue-500 dark:text-blue-400`},cpp:{Icon:x,className:`text-indigo-500 dark:text-indigo-400`},csharp:{Icon:x,className:`text-violet-500 dark:text-violet-400`},php:{Icon:x,className:`text-indigo-500 dark:text-indigo-400`},ruby:{Icon:x,className:`text-rose-500 dark:text-rose-400`},swift:{Icon:x,className:`text-orange-500 dark:text-orange-400`},kotlin:{Icon:x,className:`text-violet-500 dark:text-violet-400`},shell:{Icon:x,className:`text-green-600 dark:text-green-400`},powershell:{Icon:x,className:`text-blue-600 dark:text-blue-400`},json:{Icon:v,className:`text-amber-600 dark:text-amber-400`},css:{Icon:a,className:`text-sky-500 dark:text-sky-400`},scss:{Icon:a,className:`text-pink-500 dark:text-pink-400`},less:{Icon:a,className:`text-sky-500 dark:text-sky-400`},html:{Icon:re,className:`text-orange-500 dark:text-orange-400`},markdown:{Icon:d,className:`text-slate-500 dark:text-slate-400`},yaml:{Icon:C,className:`text-slate-500 dark:text-slate-400`},toml:{Icon:C,className:`text-slate-500 dark:text-slate-400`},ini:{Icon:C,className:`text-slate-500 dark:text-slate-400`},xml:{Icon:x,className:`text-slate-500 dark:text-slate-400`},sql:{Icon:ie,className:`text-indigo-500 dark:text-indigo-400`},dockerfile:{Icon:se,className:`text-sky-600 dark:text-sky-400`},plaintext:{Icon:d,className:`text-slate-500 dark:text-slate-400`}},B=new Set([`png`,`jpg`,`jpeg`,`gif`,`svg`,`ico`,`webp`,`bmp`,`avif`]),Ne=new Set([`zip`,`tar`,`gz`,`tgz`,`rar`,`7z`,`bz2`,`xz`]),Pe=new Set([`csv`,`tsv`,`xls`,`xlsx`]);function V(e){if(e===`readme`||e.startsWith(`readme.`))return{Icon:u,className:`text-sky-500 dark:text-sky-400`};if(e===`license`||e.startsWith(`license.`)||e===`licence`||e.startsWith(`licence.`)||e===`copying`||e.startsWith(`copying.`))return{Icon:D,className:`text-slate-500 dark:text-slate-400`};if(e===`makefile`||e.startsWith(`makefile.`))return{Icon:le,className:`text-slate-500 dark:text-slate-400`};if(e.startsWith(`docker-compose`))return{Icon:se,className:`text-sky-600 dark:text-sky-400`};if(e===`.gitignore`||e===`.gitattributes`||e===`.gitmodules`)return{Icon:D,className:`text-orange-500 dark:text-orange-400`};if(e===`.env`||e.startsWith(`.env.`))return{Icon:C,className:`text-slate-500 dark:text-slate-400`};if(e.endsWith(`.lock`)||e.endsWith(`-lock.json`)||e.endsWith(`-lock.yaml`))return{Icon:b,className:`text-slate-500 dark:text-slate-400`}}function H(e){let n=je(e).toLowerCase(),r=V(n);if(r)return r;let i=Me(n);return B.has(i)?{Icon:T,className:`text-purple-500 dark:text-purple-400`}:Ne.has(i)?{Icon:ue,className:`text-slate-500 dark:text-slate-400`}:Pe.has(i)?{Icon:t,className:`text-green-600 dark:text-green-400`}:z[R(e)]||{Icon:_,className:`text-slate-500 dark:text-slate-400`}}function U(e,t){let n=e.toLowerCase();return n===`.git`||n===`.svn`||n===`.hg`?{Icon:h,className:`text-orange-500 dark:text-orange-400`}:{Icon:t?g:fe,className:`text-slate-500 dark:text-slate-400`}}function W({path:e,className:t=`size-3.5`}){let{Icon:n,className:r}=H(e);return(0,I.jsx)(n,{className:`${r} ${t}`})}function G({name:e,open:t,className:n=`size-3.5`}){let{Icon:r,className:i}=U(e,t);return(0,I.jsx)(r,{className:`${i} ${n}`})}function Fe(e){return e===`added`?{label:`A`,text:N(`workspaceStatusAdded`),className:`text-emerald-600 dark:text-emerald-500`}:e===`deleted`?{label:`D`,text:N(`workspaceStatusDeleted`),className:`text-red-600 dark:text-red-500`}:e===`renamed`?{label:`R`,text:N(`workspaceStatusRenamed`),className:`text-blue-600 dark:text-blue-500`}:e===`untracked`?{label:`U`,text:N(`workspaceStatusUntracked`),className:`text-amber-600 dark:text-amber-500`}:e===`conflicted`?{label:`!`,text:N(`workspaceStatusConflict`),className:`text-red-600 dark:text-red-500`}:{label:`M`,text:N(`workspaceStatusModified`),className:`text-emerald-600 dark:text-emerald-500`}}function Ie({files:e,selectedPath:t,onSelectFile:n,emptyMessage:r=N(`workspaceNoWorkingTreeChanges`)}){return e.length===0?(0,I.jsx)(`div`,{className:`px-2 py-3 text-xs text-muted-foreground/70`,children:r}):(0,I.jsx)(`div`,{className:`space-y-0.5`,children:e.map(e=>{let r=Fe(e.status);return(0,I.jsxs)(`button`,{type:`button`,className:`flex h-7 w-full items-center gap-2 rounded-md px-2 text-left text-xs transition-colors ${t===e.path?`bg-muted/28 text-foreground/90`:`text-muted-foreground/72 hover:bg-muted/20 hover:text-foreground/85`}`,onClick:()=>n(e.path),title:e.oldPath?`${e.oldPath} → ${e.path}`:e.path,children:[(0,I.jsx)(`span`,{className:`w-4 shrink-0 font-mono text-[0.68rem] font-semibold ${r.className}`,children:r.label}),(0,I.jsx)(W,{path:e.path,className:`size-3.5 shrink-0`}),(0,I.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.path}),typeof e.additions==`number`&&typeof e.deletions==`number`?(0,I.jsxs)(`span`,{className:`shrink-0 font-mono text-[10px] font-medium`,children:[(0,I.jsxs)(`span`,{className:`text-emerald-600 dark:text-emerald-500`,children:[`+`,e.additions]}),(0,I.jsxs)(`span`,{className:`ml-1 text-red-600 dark:text-red-500`,children:[`-`,e.deletions]})]}):null,(0,I.jsx)(`span`,{className:`shrink-0 text-[0.68rem] text-muted-foreground/55`,children:r.text})]},`${e.status}:${e.oldPath??``}:${e.path}`)})})}function Le(e){return e?e.status===`added`?`A`:e.status===`deleted`?`D`:e.status===`renamed`?`R`:e.status===`untracked`?`U`:`M`:``}function Re({projectId:e,path:t}){let[n,r]=(0,F.useState)(!1);return n?(0,I.jsx)(W,{path:t,className:`size-3.5 shrink-0`}):(0,I.jsx)(`img`,{src:j(e,t),alt:``,"aria-hidden":!0,loading:`lazy`,decoding:`async`,onError:()=>r(!0),className:`size-3.5 shrink-0 rounded-[3px] object-cover ring-1 ring-black/5 dark:ring-white/10`})}function ze({node:e,depth:t,selectedPath:r,gitStatuses:i,onSelectFile:a,onPreviewFile:o,projectId:s}){let[c,l]=(0,F.useState)(t<1),u=e.type===`directory`,d=r===e.path,f=Le(i[e.path]),p=(u?void 0:_e(e.path))===`image`,m=!!s&&p,h=!!o&&(p||k(e.path));function g(){o?.(e.path)}return(0,I.jsxs)(`div`,{children:[(0,I.jsxs)(`button`,{type:`button`,className:`group flex h-7 w-full items-center gap-1.5 rounded-md px-2 text-left text-xs transition-colors ${d?`bg-muted/28 text-foreground/90`:`text-muted-foreground/72 hover:bg-muted/20 hover:text-foreground/85`}`,style:{paddingLeft:`${.5+t*.75}rem`},onClick:()=>{u?l(e=>!e):p&&o?g():a(e.path)},title:e.path,children:[u?(0,I.jsx)(n,{className:`size-3 shrink-0 transition-transform ${c?`rotate-90`:``}`}):(0,I.jsx)(`span`,{className:`w-3 shrink-0`}),u?(0,I.jsx)(G,{name:e.name,open:c,className:`size-3.5 shrink-0`}):m?(0,I.jsx)(Re,{projectId:s,path:e.path}):(0,I.jsx)(W,{path:e.path,className:`size-3.5 shrink-0`}),(0,I.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.name}),f?(0,I.jsx)(`span`,{className:`shrink-0 font-mono text-[0.68rem] text-emerald-600 dark:text-emerald-500`,children:f}):null,h?(0,I.jsx)(`span`,{role:`button`,tabIndex:0,"aria-label":N(`openPreview`),title:N(`openPreview`),className:`-mr-1 shrink-0 rounded p-0.5 text-muted-foreground/60 opacity-0 transition-opacity hover:bg-muted/40 hover:text-foreground/85 focus-visible:opacity-100 focus-visible:text-foreground/85 focus-visible:outline-none group-hover:opacity-100`,onClick:e=>{e.stopPropagation(),g()},onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),e.stopPropagation(),g())},children:(0,I.jsx)(w,{className:`size-3.5`})}):null]}),u&&c?(0,I.jsx)(`div`,{children:(e.children??[]).map(e=>(0,I.jsx)(ze,{node:e,depth:t+1,selectedPath:r,gitStatuses:i,onSelectFile:a,onPreviewFile:o,projectId:s},e.path))}):null]})}function Be({tree:e,selectedPath:t,gitStatuses:n={},onSelectFile:r,onPreviewFile:i,projectId:a}){return e.length===0?(0,I.jsx)(`div`,{className:`px-2 py-3 text-xs text-muted-foreground/70`,children:N(`workspaceNoFilesToDisplay`)}):(0,I.jsx)(`div`,{className:`space-y-0.5`,children:e.map(e=>(0,I.jsx)(ze,{node:e,depth:0,selectedPath:t,gitStatuses:n,onSelectFile:r,onPreviewFile:i,projectId:a},e.path))})}function Ve(){if(typeof window>`u`)return 0;let e=window.getComputedStyle(document.body).getPropertyValue(`--quickforge-desktop-titlebar-height`).trim();if(!e)return 0;let t=Number.parseFloat(e);return Number.isFinite(t)?t:0}function He(e,t){return e===`browser`?`browser`:`${e}:${t}`}var Ue=[{kind:`files`,label:N(`rightPanelFiles`),description:N(`rightPanelFilesDesc`),icon:fe},{kind:`review`,label:N(`rightPanelReview`),description:N(`rightPanelReviewDesc`),icon:i},{kind:`terminal`,label:N(`rightPanelTerminal`),description:N(`rightPanelTerminalDesc`),icon:te},{kind:`browser`,label:N(`rightPanelBrowser`),description:N(`rightPanelBrowserDesc`),icon:m}],We=Object.fromEntries(Ue.map(e=>[e.kind,e]));function Ge(e){return e===`review`||e===`changes`?`review`:e}function K(e){return e===`review`?`changes`:e}function Ke(e){let t=e.trim();if(!t)return`about:blank`;try{let e=new URL(t);return e.protocol===`about:`?t:e.host||t}catch{return t.split(/[\\/]/).pop()||t}}function qe(e,t){if(e.kind===`terminal`)return t||N(`rightPanelTerminal`);if(e.kind===`browser`)return Ke(e.url||``);if(e.kind===`reader`){let t=e.readerTabs?.find(t=>t.id===e.activeReaderTabId)??e.readerTabs?.[0];return t?be(t.path):N(`rightPanelFiles`)}return We[e.kind].label}var Je=340,q=380,J=640,Ye=`quickforge_workspaceInspectorWidth_v2`,Y=`quickforge:workspace-inspector-tabs:v1:`,Xe=140,Ze=200,Qe=400;function $e(e){return`${Y}${e}`}function X(e){return e===`files`||e===`review`||e===`terminal`||e===`browser`||e===`reader`}function et(e){if(!Array.isArray(e))return[];let t=new Set,n=[];for(let r of e){if(!r||typeof r!=`object`)continue;let e=r;if(!(typeof e.id!=`string`||!e.id||!X(e.kind))){if(e.kind===`review`){if(t.has(e.kind))continue;t.add(e.kind)}if(e.kind===`reader`){let t=e.reader;if(!t||t.mode!==`file`||typeof t.path!=`string`||!t.path)continue;let r=He(t.mode,t.path);n.push({id:e.id,kind:e.kind,readerTabs:[{id:r,mode:t.mode,path:t.path,loading:!0}],activeReaderTabId:r});continue}n.push({id:e.id,kind:e.kind,...e.kind===`browser`&&typeof e.url==`string`?{url:e.url}:{},...e.kind===`terminal`&&typeof e.terminalSessionId==`string`?{terminalSessionId:e.terminalSessionId}:{},...e.kind===`files`||e.kind===`review`?{readerTabs:[],activeReaderTabId:void 0}:{}})}}return n}function tt(e){if(typeof window>`u`)return{tabs:[]};try{let t=window.localStorage.getItem($e(e));if(!t)return{tabs:[]};let n=JSON.parse(t),r=et(n.tabs),i=typeof n.activePanelTabId==`string`&&r.some(e=>e.id===n.activePanelTabId)?n.activePanelTabId:r[0]?.id;return i?{tabs:r,activePanelTabId:i}:{tabs:r}}catch{return{tabs:[]}}}function nt(e,t){let n=e.flatMap(e=>{if(e.kind===`reader`){let t=e.readerTabs?.find(t=>t.id===e.activeReaderTabId)??e.readerTabs?.[0];return!t||t.mode!==`file`?[]:[{id:e.id,kind:e.kind,reader:{mode:t.mode,path:t.path}}]}return[{id:e.id,kind:e.kind,...e.kind===`browser`?{url:e.url||``}:{},...e.kind===`terminal`&&e.terminalSessionId?{terminalSessionId:e.terminalSessionId}:{}}]});return{tabs:n,activePanelTabId:t&&n.some(e=>e.id===t)?t:n[0]?.id}}function rt(e){return e.reduce((e,t)=>{let n=t.id.match(/-(\d+)$/);if(!n)return e;let r=Number(n[1]);return Number.isFinite(r)?Math.max(e,r):e},0)+1}function it(){if(typeof window>`u`)return q;try{let e=window.localStorage.getItem(Ye);if(!e)return q;let t=Number(e);return Number.isFinite(t)?Math.min(J,Math.max(Je,t)):q}catch{return q}}function at(e,t){let n=t.trim().toLowerCase();return n?e.flatMap(e=>{let t=e.children?at(e.children,n):void 0;return!(e.name.toLowerCase().includes(n)||e.path.toLowerCase().includes(n))&&(!t||t.length===0)?[]:[{...e,...t?{children:t}:{}}]}):e}function ot(e){return N(`workspaceReviewPrompt`,{list:e.map(e=>`- ${e.status}: ${e.oldPath?`${e.oldPath} -> `:``}${e.path}`).join(`
|
|
2
|
-
`)})}function st(e){return N(`workspaceCommitMessagePrompt`,{list:e.map(e=>`- ${e.status}: ${e.oldPath?`${e.oldPath} -> `:``}${e.path}`).join(`
|
|
3
|
-
`)})}function ct(e,t){let n=[`${N(`workspaceCurrentBranch`)}: ${e||N(`unknown`)}`];return t?.total&&n.push(`${t.total} ${N(`workspaceChangeCount`)}`),n.join(` · `)}function lt({title:e,files:t,selectedPath:n,onSelectFile:r}){return t.length===0?null:(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsxs)(`div`,{className:`px-2 text-[11px] font-medium uppercase tracking-wide text-muted-foreground/60`,children:[e,` `,t.length]}),(0,I.jsx)(Ie,{files:t,selectedPath:n,onSelectFile:r})]})}function ut(e){return e?e.language===`markdown`||/\.(md|markdown)$/i.test(e.path):!1}function Z(e,t=!1){return N(t?`readerFileMarkdownPrompt`:`readerFilePrompt`,{path:e})}function dt(e){return N(`readerDiffPrompt`,{path:e})}function ft(e){return`Diff for ${e.oldPath?`${e.oldPath} -> ${e.path}`:e.path}\n\n--- OLD\n${e.oldContent}\n\n--- NEW\n${e.newContent}`}function pt({mode:e,file:t,diff:n,loading:r,error:i,onClose:a,onDraftRequest:o}){let[s,l]=(0,F.useState)(),[u,d]=(0,F.useState)(`preview`);async function f(e,t){t&&(await navigator.clipboard.writeText(t),l(e),window.setTimeout(()=>l(void 0),1200))}let p=e===`file`?t?.path:n?.path,m=e===`file`&&ut(t),h=e===`file`?t?.content:n?ft(n):void 0,g=e===`file`&&t?Z(t.path,m):e===`diff`&&n?dt(n.path):void 0,_=(0,F.useMemo)(()=>e===`diff`&&n?P(n.oldContent,n.newContent):void 0,[e,n]);return(0,I.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,I.jsxs)(`div`,{className:`flex h-11 shrink-0 items-center gap-2 border-b border-border px-3`,children:[m?(0,I.jsx)(`div`,{className:`inline-flex rounded-full bg-muted/25 p-1 text-xs`,children:[`preview`,`source`].map(e=>(0,I.jsx)(`button`,{type:`button`,className:e===u?`rounded-full bg-background px-3 py-1 font-medium text-foreground/90 shadow-[0_8px_20px_-16px_rgb(15_23_42_/_0.42)]`:`rounded-full px-3 py-1 text-muted-foreground/70 hover:text-foreground/85`,onClick:()=>d(e),children:N(e===`preview`?`markdownPreview`:`markdownSource`)},e))}):null,_?(0,I.jsxs)(`span`,{className:`shrink-0 font-mono text-[11px] font-medium`,children:[(0,I.jsxs)(`span`,{className:`text-emerald-600 dark:text-emerald-400`,children:[`+`,_.added]}),(0,I.jsxs)(`span`,{className:`ml-1.5 text-red-600 dark:text-red-400`,children:[`-`,_.removed]})]}):null,(0,I.jsx)(`div`,{className:`flex-1`}),(0,I.jsx)(A,{variant:`ghost`,size:`icon`,className:`size-7`,onClick:()=>void f(`path`,p),disabled:!p,"aria-label":N(`copyPath`),title:N(`copyPath`),children:s===`path`?(0,I.jsx)(S,{className:`size-3.5`}):(0,I.jsx)(de,{className:`size-3.5`})}),(0,I.jsx)(A,{variant:`ghost`,size:`icon`,className:`size-7`,onClick:()=>void f(`content`,h),disabled:!h,"aria-label":N(`copyContent`),title:N(e===`file`?`copyContent`:`copyDiffContent`),children:s===`content`?(0,I.jsx)(S,{className:`size-3.5`}):(0,I.jsx)(de,{className:`size-3.5`})}),(0,I.jsx)(A,{variant:`ghost`,size:`icon`,className:`size-7`,onClick:()=>g&&o?.(g),disabled:!g||!o,"aria-label":N(`askAiAboutThis`),title:N(`askAiAboutThis`),children:(0,I.jsx)(c,{className:`size-3.5`})}),(0,I.jsx)(A,{variant:`ghost`,size:`icon`,className:`size-7`,onClick:a,"aria-label":N(`close`),title:N(`close`),children:(0,I.jsx)(ce,{className:`size-3.5`})})]}),(0,I.jsxs)(`div`,{className:`min-h-0 flex-1 bg-background`,children:[r?(0,I.jsx)(`div`,{className:`p-4 text-sm text-muted-foreground/70`,children:N(`openingReader`)}):null,!r&&i?(0,I.jsx)(`div`,{className:`p-4 text-sm text-destructive`,children:i}):null,!r&&!i&&e===`file`&&t?m?(0,I.jsx)(Te,{path:t.path,content:t.content,language:t.language,mode:u},t.path):(0,I.jsx)(Ce,{path:t.path,content:t.content,language:t.language}):null,!r&&!i&&e===`diff`&&n?(0,I.jsx)(we,{path:n.path,oldContent:n.oldContent,newContent:n.newContent,language:n.language,status:n.status}):null]})]})}function mt({project:e,artifacts:t,changesCount:n,changedPaths:r,isGitRepository:i,gitBranch:a,onSelectFile:o,onSelectDiff:s,onPreviewFile:c}){let[u,d]=(0,F.useState)(!1),[f,p]=(0,F.useState)(()=>new Set),m=me(t),h=t.filter(e=>e.command);function g(e){p(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}return(0,I.jsxs)(`div`,{className:`space-y-3 p-2`,children:[(0,I.jsxs)(`div`,{className:`rounded-lg border border-border bg-background px-3 py-3`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-2 text-xs font-semibold text-foreground/90`,children:[(0,I.jsx)(ae,{className:`size-3.5 text-emerald-600 dark:text-emerald-500`}),N(`workspaceCurrentArtifacts`)]}),t.length===0?(0,I.jsx)(`div`,{className:`mt-2 text-xs leading-5 text-muted-foreground/70`,children:N(`workspaceNoArtifacts`)}):(0,I.jsxs)(`div`,{className:`mt-3 space-y-3`,children:[m.length?(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsxs)(`div`,{className:`text-[11px] font-medium uppercase tracking-wide text-muted-foreground/60`,children:[N(`workspaceFiles`),` `,m.length]}),m.slice(0,8).map(e=>{let t=e.path,n=ye(t),i=r.has(t),a=typeof e.addedLines==`number`||typeof e.removedLines==`number`;return(0,I.jsxs)(`div`,{className:`group flex min-w-0 items-center gap-2 rounded-md px-2 py-1.5 text-xs text-foreground/85 transition-colors hover:bg-muted/20`,children:[(0,I.jsx)(`button`,{type:`button`,className:`min-w-0 flex-1 truncate text-left font-medium`,onClick:()=>n?c(t):i?s(t):o(t),title:t,children:e.title||be(t)}),a?(0,I.jsxs)(`span`,{className:`shrink-0 font-mono text-[10px] font-medium`,children:[(0,I.jsxs)(`span`,{className:`text-emerald-600 dark:text-emerald-400`,children:[`+`,e.addedLines??0]}),(0,I.jsxs)(`span`,{className:`ml-1 text-red-600 dark:text-red-400`,children:[`-`,e.removedLines??0]})]}):null,(0,I.jsx)(`span`,{className:`shrink-0 rounded-full bg-muted/30 px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground/70`,children:e.kind}),n?(0,I.jsx)(`button`,{type:`button`,className:`shrink-0 inline-flex size-5 items-center justify-center text-blue-600 opacity-0 transition-opacity hover:bg-blue-500/10 hover:text-blue-700 group-hover:opacity-100 dark:text-blue-400`,onClick:()=>c(t),"aria-label":N(`previewArtifact`),title:N(`previewArtifact`),children:(0,I.jsx)(w,{className:`size-3.5`})}):null,(0,I.jsx)(`button`,{type:`button`,className:`shrink-0 rounded-md px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground/70 opacity-0 transition-opacity hover:bg-muted/25 group-hover:opacity-100`,onClick:()=>i?s(t):o(t),children:N(i?`workspaceViewDiff`:`artifactPreviewViewSource`)})]},e.id)}),m.length>8?(0,I.jsxs)(`div`,{className:`px-2 text-[11px] text-muted-foreground/60`,children:[`+`,m.length-8]}):null]}):null,h.length?(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsxs)(`button`,{type:`button`,className:`flex w-full items-center gap-2 rounded-md px-1 py-1 text-left text-[11px] font-medium uppercase tracking-wide text-muted-foreground/60 transition-colors hover:bg-muted/15 hover:text-foreground/75`,onClick:()=>d(e=>!e),"aria-expanded":u,children:[(0,I.jsx)(l,{className:M(`size-3.5 transition-transform`,u?``:`-rotate-90`)}),(0,I.jsxs)(`span`,{className:`min-w-0 flex-1 truncate`,children:[N(`workspaceCommands`),` `,h.length]})]}),u?(0,I.jsx)(`div`,{className:`space-y-1`,children:h.map((e,t)=>{let n=f.has(e.id);return(0,I.jsxs)(`div`,{className:`rounded-md bg-muted/15 text-[11px] text-muted-foreground/80`,children:[(0,I.jsxs)(`button`,{type:`button`,className:`flex w-full items-center gap-2 px-2 py-1.5 text-left transition-colors hover:bg-muted/20`,onClick:()=>g(e.id),"aria-expanded":n,children:[(0,I.jsx)(l,{className:M(`size-3 shrink-0 transition-transform`,n?``:`-rotate-90`)}),(0,I.jsxs)(`span`,{className:`shrink-0 font-medium text-muted-foreground/65`,children:[`#`,t+1]}),(0,I.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono`,children:e.command})]}),n?(0,I.jsxs)(`div`,{className:`space-y-1 px-2 pb-2 pt-1.5`,children:[(0,I.jsx)(`pre`,{className:`whitespace-pre-wrap break-words font-mono text-[11px] leading-5 text-foreground/80`,children:e.command}),e.outputFile?(0,I.jsxs)(`div`,{className:`text-[10px] text-muted-foreground/65`,children:[N(`workspaceCommandOutput`),`: `,(0,I.jsx)(`span`,{className:`font-mono`,children:e.outputFile})]}):null]}):null]},e.id)})}):null]}):null]})]}),(0,I.jsxs)(`div`,{className:`rounded-lg border border-border bg-muted/10 px-3 py-3`,children:[(0,I.jsx)(`div`,{className:`text-xs font-medium text-foreground/85`,children:e?.name??N(`noProjectSelected`)}),(0,I.jsx)(`div`,{className:`mt-1 text-[11px] text-muted-foreground/65`,children:i?`${N(`workspaceCurrentBranch`)}: ${a||N(`unknown`)} · ${n} ${N(`workspaceChangeCount`)}`:N(`workspaceNotGitRepository`)})]})]})}function ht({project:e,open:t,onOpenChange:n,view:r,onViewChange:i,onPreviewArtifact:a,onDraftRequest:u,focusTarget:d,previewUrl:f,artifacts:m=[],pendingTerminalCommand:h,onPendingTerminalCommandHandled:g}){let[_,v]=(0,F.useState)([]),[y,te]=(0,F.useState)([]),[ne,re]=(0,F.useState)(),[b,ie]=(0,F.useState)(),[x,oe]=(0,F.useState)(!1),[S,se]=(0,F.useState)(!1),[le,ue]=(0,F.useState)(),[de,fe]=(0,F.useState)(``),C=(0,F.useRef)(void 0);C.current||=e?.id?tt(e.id):{tabs:[]};let[w,T]=(0,F.useState)(()=>C.current?.tabs??[]),[E,D]=(0,F.useState)(()=>C.current?.activePanelTabId),[O,me]=(0,F.useState)(!1),[k,_e]=(0,F.useState)(!1),[j,ye]=(0,F.useState)(Ze),[be,Ce]=(0,F.useState)(!1),[we,Te]=(0,F.useState)(t),[P,Ee]=(0,F.useState)(!1),[L,De]=(0,F.useState)(it),[Oe,Ae]=(0,F.useState)(!1),[R,je]=(0,F.useState)(!1),[Me,z]=(0,F.useState)(!1),B=(0,F.useRef)(null),Ne=(0,F.useRef)(null),Pe=(0,F.useRef)(null),V=(0,F.useRef)(null),H=(0,F.useRef)(null),U=(0,F.useRef)(null),W=(0,F.useRef)(null),G=(0,F.useRef)(null),Fe=(0,F.useRef)(null),Ie=(0,F.useRef)(rt(C.current?.tabs??[])),Le=(0,F.useRef)(f),Re=(0,F.useRef)(void 0),ze=(0,F.useRef)(e?.id),Ke=(0,F.useRef)(!1),q=(0,F.useRef)(new Set),Y=e?.id,X=(0,F.useMemo)(()=>w.find(e=>e.id===E),[E,w]),et=X?.activeReaderTabId,ut=(0,F.useMemo)(()=>X?.readerTabs||[],[X?.readerTabs]),Z=(0,F.useMemo)(()=>ut.find(e=>e.id===et),[et,ut]),dt=!!(Z&&Z.mode!==`browser`&&(X?.kind===`reader`||X?.kind===`files`||X?.kind===`review`&&Z.mode===`diff`)),ft=X?.kind===`review`?r===`changes`?`changes`:`overview`:`files`,ht=(0,F.useMemo)(()=>{let e={};for(let t of y)e[t.path]=t;return e},[y]),gt=(0,F.useMemo)(()=>{let e=new Set;for(let t of y)e.add(t.path),t.oldPath&&e.add(t.oldPath);return e},[y]),_t=(0,F.useMemo)(()=>at(_,de),[de,_]),vt=(0,F.useMemo)(()=>({conflicts:y.filter(e=>e.conflict||e.status===`conflicted`),staged:y.filter(e=>!e.conflict&&e.status!==`untracked`&&e.staged),unstaged:y.filter(e=>!e.conflict&&e.status!==`untracked`&&e.unstaged),untracked:y.filter(e=>!e.conflict&&e.status===`untracked`)}),[y]);(0,F.useEffect)(()=>{if(t){let e=!1;return queueMicrotask(()=>{e||(Te(!0),window.requestAnimationFrame(()=>{e||Ee(!0)}))}),()=>{e=!0}}let e=!1;queueMicrotask(()=>{e||Ee(!1)});let n=window.setTimeout(()=>Te(!1),180);return()=>{e=!0,window.clearTimeout(n)}},[t]),(0,F.useEffect)(()=>{if(!O&&!k)return;let e=e=>{let t=e.target;O&&!Ne.current?.contains(t)&&me(!1),k&&!Pe.current?.contains(t)&&_e(!1)},t=e=>{e.key===`Escape`&&(me(!1),_e(!1))};return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,t)}},[O,k]),(0,F.useEffect)(()=>{let e=!1;return!t||!d||queueMicrotask(()=>{e||(d.tab===`git`?$(`review`,`changes`):i(`files`),d.filePath&&Re.current?.(d.filePath))}),()=>{e=!0}},[d,i,t]),(0,F.useEffect)(()=>{if(!t)return;let e=Ge(r);if(e===`review`){r===`changes`&&$(`review`,`changes`);return}if(e===`browser`){if(f===Le.current&&X?.kind===`browser`)return;Le.current=f,$(`browser`,`browser`,{url:f});return}e!==X?.kind&&$(e,K(e))},[r,t,f]),(0,F.useEffect)(()=>{try{window.localStorage.setItem(Ye,String(L))}catch{}},[L]);let yt=(0,F.useCallback)(()=>{De(e=>e<J?J:e)},[]);(0,F.useEffect)(()=>{!P||R||(X?.kind===`browser`||X?.kind===`terminal`||et)&&yt()},[X?.kind,et,P,R,yt]),(0,F.useEffect)(()=>{let e=!1;if(!(!Y||!t))return queueMicrotask(()=>{e||(se(!0),ue(void 0),Promise.all([ve(Y),he(Y)]).then(([t,n])=>{e||(v(t.tree),te(n.files),re(n.branch),ie(n.counts),oe(n.isGitRepository))}).catch(t=>{e||ue(t instanceof Error?t.message:N(`workspaceLoadFailed`))}).finally(()=>{e||se(!1)}))}),()=>{e=!0}},[t,Y]),(0,F.useEffect)(()=>{if(!Y){Ke.current=!0,ze.current=void 0,T([]),D(void 0);return}if(ze.current===Y)return;let e=tt(Y);Ke.current=!0,ze.current=Y,Ie.current=rt(e.tabs),T(e.tabs),D(e.activePanelTabId);let t=e.tabs.find(t=>t.id===e.activePanelTabId)??e.tabs[0];t&&t.kind!==`reader`&&i(K(t.kind))},[i,Y]),(0,F.useEffect)(()=>{if(Y){if(Ke.current){Ke.current=!1;return}try{window.localStorage.setItem($e(Y),JSON.stringify(nt(w,E)))}catch{}}},[E,w,Y]),(0,F.useEffect)(()=>{!E||w.some(e=>e.id===E)||D(w[0]?.id)},[E,w]),(0,F.useEffect)(()=>{if(!Y)return;let e=w.flatMap(e=>e.kind===`reader`?(e.readerTabs||[]).filter(e=>e.loading&&e.mode===`file`).map(t=>({panelTabId:e.id,reader:t})):[]);for(let{panelTabId:t,reader:n}of e){let e=`${Y}:${n.id}`;q.current.has(e)||(q.current.add(e),ge(Y,n.path).then(e=>({file:e})).then(e=>{Q(t,t=>({...t,readerTabs:(t.readerTabs||[]).map(t=>t.id===n.id?{...t,...e,loading:!1,error:void 0}:t)}))}).catch(e=>{Q(t,t=>({...t,readerTabs:(t.readerTabs||[]).map(t=>t.id===n.id?{...t,loading:!1,error:e instanceof Error?e.message:N(`workspaceOpenFileFailed`)}:t)}))}).finally(()=>{q.current.delete(e)}))}},[w,Y]);function bt(e,t){let n=`${e}-${Ie.current++}`;return e===`browser`?{id:n,kind:e,url:t?.url||f||``}:e===`reader`||e===`files`||e===`review`?{id:n,kind:e,readerTabs:t?.readerTab?[t.readerTab]:[],activeReaderTabId:t?.readerTab?.id}:{id:n,kind:e}}function xt(e){return bt(`reader`,{readerTab:e})}function Q(e,t){T(n=>n.map(n=>n.id===e?t(n):n))}function $(e,t=K(e),n){let r=e===`review`?w.find(e=>e.kind===`review`):void 0,a=r||bt(e,n);return r||T(e=>[...e,a]),D(a.id),i(t),me(!1),a}function St(e){D(e.id),e.kind!==`reader`&&i(K(e.kind))}function Ct(e){T(t=>{let r=t.findIndex(t=>t.id===e),a=t.filter(t=>t.id!==e);if(a.length===0)return D(void 0),i(`review`),n(!1),a;if(E===e){let e=a[r]??a[r-1];D(e?.id),e?e.kind!==`reader`&&i(K(e.kind)):i(`review`)}return a})}function wt(e){if(a){a(e);return}Tt(e)}async function Tt(e){if(!Y)return;let t=He(`file`,e),n=w.find(e=>e.kind===`reader`&&e.readerTabs?.some(e=>e.id===t));if(n){D(n.id),Q(n.id,e=>({...e,activeReaderTabId:t}));return}let r=xt({id:t,mode:`file`,path:e,loading:!0});T(e=>[...e,r]),D(r.id);try{let n=await ge(Y,e);Q(r.id,e=>({...e,readerTabs:(e.readerTabs||[]).map(e=>e.id===t?{...e,file:n,loading:!1,error:void 0}:e)}))}catch(e){Q(r.id,n=>({...n,readerTabs:(n.readerTabs||[]).map(n=>n.id===t?{...n,loading:!1,error:e instanceof Error?e.message:N(`workspaceOpenFileFailed`)}:n)}))}}Re.current=Tt;async function Et(e,t){if(!Y)return;let n=w.find(e=>e.kind===`review`)||$(`review`,t?`changes`:`review`);D(n.id),t&&i(`changes`);let r=He(`diff`,e);if(n.readerTabs?.some(e=>e.id===r)){Q(n.id,e=>({...e,activeReaderTabId:r}));return}let a={id:r,mode:`diff`,path:e,loading:!0};Q(n.id,e=>({...e,readerTabs:[...e.readerTabs||[],a],activeReaderTabId:r}));try{let t=await xe(Y,e);Q(n.id,e=>({...e,readerTabs:(e.readerTabs||[]).map(e=>e.id===r?{...e,diff:t,loading:!1,error:void 0}:e)}))}catch(e){Q(n.id,t=>({...t,readerTabs:(t.readerTabs||[]).map(t=>t.id===r?{...t,loading:!1,error:e instanceof Error?e.message:N(`workspaceOpenDiffFailed`)}:t)}))}}function Dt(e){X&&Q(X.id,t=>{let n=t.readerTabs||[],r=n.findIndex(t=>t.id===e),i=n.filter(t=>t.id!==e),a=t.activeReaderTabId===e?(i[r]??i[r-1])?.id:t.activeReaderTabId;return{...t,readerTabs:i,activeReaderTabId:a}})}async function Ot(e){await Et(e,!0)}async function kt(e){await Et(e,!1)}function At(e){U.current={startX:e.clientX,startWidth:L,currentWidth:L},Fe.current={cursor:document.body.style.cursor,userSelect:document.body.style.userSelect},document.body.style.cursor=`col-resize`,document.body.style.userSelect=`none`,Ae(!0),e.preventDefault();try{e.currentTarget.setPointerCapture(e.pointerId)}catch{}}function jt(e){let t=U.current,n=B.current;!t||!n||(t.currentWidth=Math.min(J,Math.max(Je,t.startWidth+t.startX-e.clientX)),W.current===null&&(W.current=window.requestAnimationFrame(()=>{W.current=null;let e=U.current;!e||!B.current||(B.current.style.width=`${e.currentWidth}px`)})))}function Mt(e){let t=U.current?.currentWidth;U.current=null,W.current!==null&&(window.cancelAnimationFrame(W.current),W.current=null),typeof t==`number`&&(B.current&&(B.current.style.width=`${t}px`),De(t));let n=Fe.current;n&&(document.body.style.cursor=n.cursor,document.body.style.userSelect=n.userSelect,Fe.current=null),Ae(!1);try{e.currentTarget.releasePointerCapture(e.pointerId)}catch{}}function Nt(e){V.current={startX:e.clientX,startWidth:j,currentWidth:j},document.body.style.cursor=`col-resize`,document.body.style.userSelect=`none`,Ce(!0),e.preventDefault();try{e.currentTarget.setPointerCapture(e.pointerId)}catch{}}function Pt(e){let t=V.current;t&&(t.currentWidth=Math.min(Qe,Math.max(Xe,t.startWidth+e.clientX-t.startX)),H.current===null&&(H.current=window.requestAnimationFrame(()=>{H.current=null;let e=V.current;e&&ye(e.currentWidth)})))}function Ft(e){let t=V.current?.currentWidth;V.current=null,H.current!==null&&(window.cancelAnimationFrame(H.current),H.current=null),typeof t==`number`&&ye(t),document.body.style.cursor=``,document.body.style.userSelect=``,Ce(!1);try{e.currentTarget.releasePointerCapture(e.pointerId)}catch{}}let It=(0,F.useCallback)(()=>{let e=B.current;if(!e){je(e=>!e);return}G.current?.cancel();let t=e.getBoundingClientRect(),n=window.innerWidth,r=Ve(),i=window.innerHeight-r,a=`${r}px`,o=`${i}px`,s=`cubic-bezier(0.22, 1, 0.36, 1)`;if(z(!0),!R){window.requestAnimationFrame(()=>{let e=B.current;if(!e)return;Object.assign(e.style,{position:`fixed`,left:`${t.left}px`,top:`${t.top}px`,right:`auto`,bottom:`auto`,width:`${t.width}px`,height:`${t.height}px`,minWidth:`0px`,maxWidth:`none`,zIndex:`40`});let r=e.animate([{left:`${t.left}px`,top:`${t.top}px`,width:`${t.width}px`,height:`${t.height}px`},{left:`0px`,top:a,width:`${n}px`,height:o}],{duration:240,easing:s,fill:`forwards`});G.current=r,r.onfinish=()=>{G.current=null,je(!0),window.requestAnimationFrame(()=>{r.cancel(),e.removeAttribute(`style`),window.requestAnimationFrame(()=>z(!1))})},r.oncancel=()=>{G.current=null,z(!1)}});return}window.requestAnimationFrame(()=>{let e=B.current;if(!e)return;Object.assign(e.style,{position:`fixed`,left:`0px`,top:a,right:`auto`,bottom:`auto`,width:`${t.width}px`,height:o,zIndex:`40`});let r=n-L,i=e.animate([{left:`0px`,top:a,width:`${t.width}px`,height:o},{left:`${r}px`,top:a,width:`${L}px`,height:o}],{duration:240,easing:s,fill:`forwards`});G.current=i,i.onfinish=()=>{G.current=null,je(!1),window.requestAnimationFrame(()=>{i.cancel(),e.style.position=``,e.style.left=``,e.style.top=``,e.style.right=``,e.style.bottom=``,e.style.height=``,e.style.zIndex=``,e.style.width=`${L}px`,e.style.minWidth=`${Je}px`,e.style.maxWidth=`${J}px`,window.requestAnimationFrame(()=>z(!1))})},i.oncancel=()=>{G.current=null,z(!1)}})},[R,L]);return(0,F.useEffect)(()=>{if(!R)return;let e=e=>{e.key===`Escape`&&je(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[R]),(0,F.useEffect)(()=>()=>{W.current!==null&&window.cancelAnimationFrame(W.current),H.current!==null&&window.cancelAnimationFrame(H.current),G.current?.cancel(),B.current&&B.current.removeAttribute(`style`);let e=Fe.current;e&&(document.body.style.cursor=e.cursor,document.body.style.userSelect=e.userSelect)},[]),we?(0,I.jsx)(I.Fragment,{children:(0,I.jsxs)(`aside`,{ref:B,className:M(`relative hidden shrink-0 overflow-hidden flex-col bg-background transition-[width,min-width,max-width,opacity,transform] duration-200 ease-out will-change-[width,opacity,transform] lg:flex`,P?`translate-x-0 opacity-100`:`w-0 min-w-0 max-w-0 translate-x-4 opacity-0`,Oe?`transition-none`:``,R?`quickforge-workspace-inspector-fullscreen z-40 rounded-none border-l-0`:`lg:rounded-l-2xl`),style:P?R?void 0:{width:L,minWidth:Je,maxWidth:J}:void 0,children:[P&&!R?(0,I.jsx)(`div`,{role:`separator`,"aria-orientation":`vertical`,"aria-valuemin":Je,"aria-valuemax":J,"aria-valuenow":L,className:M(`group absolute inset-y-0 -left-2 z-20 flex w-4 cursor-col-resize items-center justify-center bg-transparent transition-colors hover:bg-border/40`,Oe?`bg-border/45`:``),onPointerDown:At,onPointerMove:jt,onPointerUp:Mt,onPointerCancel:Mt,children:(0,I.jsx)(`div`,{className:M(`flex h-10 w-3 items-center justify-center rounded-full border border-border bg-background text-muted-foreground/60 opacity-0 shadow-sm transition-opacity`,Oe?`opacity-100`:`group-hover:opacity-100`),children:(0,I.jsx)(pe,{className:`size-3`})})}):null,(0,I.jsxs)(`div`,{className:M(`flex h-14 shrink-0 items-center gap-2 border-b-[0.5px] border-[color-mix(in_oklab,var(--border)_34%,transparent)] bg-background px-3 pr-20 transition-opacity duration-150`,Me?`opacity-0`:`opacity-100`),children:[w.length>0?(0,I.jsxs)(`div`,{ref:Pe,className:`relative shrink-0`,children:[(0,I.jsx)(`button`,{type:`button`,className:`flex size-9 items-center justify-center rounded-2xl bg-transparent text-muted-foreground/85 transition-colors hover:bg-muted/45 hover:text-foreground/90`,onClick:()=>_e(e=>!e),"aria-label":N(`rightPanelOpenTabsTitle`),title:N(`rightPanelOpenTabsTitle`),"aria-haspopup":`menu`,"aria-expanded":k,children:(0,I.jsx)(l,{className:M(`size-4 transition-transform`,k&&`rotate-180`)})}),k?(0,I.jsx)(`div`,{className:`absolute left-0 top-12 z-40 w-72 max-w-[calc(100vw-2rem)] rounded-2xl border border-[color-mix(in_oklab,var(--border)_34%,transparent)] bg-popover p-2 shadow-quickforge`,role:`menu`,children:w.map(t=>{let n=(t.kind===`reader`?void 0:We[t.kind])?.icon??ae,r=t.id===E,i=qe(t,e?.name);return(0,I.jsxs)(`div`,{className:M(`group flex h-10 w-full items-center gap-2 rounded-xl px-2 transition-colors`,r?`bg-muted/55 text-foreground`:`text-foreground/86 hover:bg-muted/34 hover:text-foreground`),role:`none`,children:[(0,I.jsxs)(`button`,{type:`button`,className:`flex min-w-0 flex-1 items-center gap-2 text-left text-sm font-medium`,onClick:()=>{St(t),_e(!1)},role:`menuitem`,title:i,children:[(0,I.jsx)(n,{className:`size-4 shrink-0 text-muted-foreground/80`}),(0,I.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:i})]}),(0,I.jsx)(`button`,{type:`button`,className:`inline-flex size-7 shrink-0 items-center justify-center rounded-full text-muted-foreground/70 opacity-70 transition-colors hover:bg-destructive/10 hover:text-destructive group-hover:opacity-100`,onClick:e=>{e.stopPropagation(),Ct(t.id)},"aria-label":N(`close`),children:(0,I.jsx)(ce,{className:`size-3.5`})})]},t.id)})}):null]}):null,(0,I.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-1 overflow-hidden`,children:[w.map((t,n)=>{let r=(t.kind===`reader`?void 0:We[t.kind])?.icon??ae,i=t.id===E,a=qe(t,e?.name);return(0,I.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[n>0?(0,I.jsx)(`span`,{"aria-hidden":`true`,className:`mx-0.5 h-3.5 w-px bg-[color-mix(in_oklab,var(--muted-foreground)_18%,transparent)]`}):null,(0,I.jsxs)(`button`,{type:`button`,className:M(`group flex h-10 max-w-40 items-center gap-2 rounded-2xl px-3 text-[13px] font-medium transition-colors`,i?`bg-[color-mix(in_oklab,var(--muted)_86%,transparent)] text-foreground/82 hover:bg-[color-mix(in_oklab,var(--muted)_86%,transparent)]`:`text-muted-foreground/45 hover:bg-[color-mix(in_oklab,var(--muted)_72%,transparent)] hover:text-muted-foreground/72`),onClick:()=>St(t),title:a,children:[(0,I.jsx)(r,{className:M(`size-4 shrink-0`,i?`text-foreground/74`:`text-muted-foreground/45 group-hover:text-muted-foreground/72`)}),(0,I.jsx)(`span`,{className:`min-w-0 truncate`,children:a}),(0,I.jsx)(`span`,{role:`button`,tabIndex:0,className:M(`ml-0.5 inline-flex size-5 shrink-0 items-center justify-center rounded-full opacity-0 transition-all hover:bg-black hover:text-white group-hover:opacity-100`,i&&`opacity-100`),onClick:e=>{e.stopPropagation(),Ct(t.id)},onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),e.stopPropagation(),Ct(t.id))},"aria-label":N(`close`),children:(0,I.jsx)(ce,{className:`size-3.5`})})]})]},t.id)}),w.length===0?(0,I.jsx)(`div`,{className:`min-w-0 flex-1`}):null]}),w.length>0?(0,I.jsxs)(`div`,{ref:Ne,className:`relative shrink-0`,children:[(0,I.jsx)(`button`,{type:`button`,className:`flex size-9 items-center justify-center rounded-2xl bg-transparent text-muted-foreground/85 transition-colors hover:bg-muted/45 hover:text-foreground/90`,onClick:()=>me(e=>!e),"aria-label":N(`rightPanelAddTab`),title:N(`rightPanelAddTab`),"aria-haspopup":`menu`,"aria-expanded":O,children:(0,I.jsx)(p,{className:`size-4 stroke-[1.9]`})}),O?(0,I.jsx)(`div`,{className:`absolute right-0 top-12 z-40 w-64 rounded-2xl border border-[color-mix(in_oklab,var(--border)_34%,transparent)] bg-popover p-2 shadow-quickforge`,role:`menu`,children:Ue.map(e=>{let t=e.icon;return(0,I.jsxs)(`button`,{type:`button`,className:M(`flex w-full items-center gap-3 rounded-xl px-3 py-2.5 text-left text-[15px] font-medium transition-colors`,e.kind===X?.kind?`bg-muted/55 text-foreground`:`text-foreground/86 hover:bg-muted/34 hover:text-foreground`),onClick:()=>$(e.kind,K(e.kind)),role:`menuitem`,children:[(0,I.jsx)(t,{className:`size-4 shrink-0 text-muted-foreground/80`}),(0,I.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.label})]},e.kind)})}):null]}):null,(0,I.jsx)(A,{variant:`ghost`,size:`icon`,className:`shrink-0`,onClick:It,"aria-label":N(R?`workspaceExitFullscreen`:`workspaceFullscreen`),title:N(R?`workspaceExitFullscreen`:`workspaceFullscreen`),children:R?(0,I.jsx)(s,{className:`size-4`}):(0,I.jsx)(o,{className:`size-4`})})]}),(0,I.jsx)(`div`,{className:M(`flex min-h-0 flex-1 transition-opacity duration-150`,Me?`opacity-0`:`opacity-100`),children:e?.id?X?X.kind===`browser`?(0,I.jsx)(ke,{url:X.url||``,onUrlChange:e=>{Q(X.id,t=>({...t,url:e}))},projectId:e.id}):X.kind===`terminal`?(0,I.jsx)(Se,{project:e,pendingCommand:h,onPendingCommandHandled:g,onCollapse:()=>Ct(X.id),variant:`panel`,singleSession:!0,panelInstanceId:X.id,panelSessionId:X.terminalSessionId,onPanelSessionReady:e=>Q(X.id,t=>({...t,terminalSessionId:e}))},X.id):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`div`,{className:M(`flex min-h-0 flex-col bg-muted/20`,dt?`shrink-0 border-r-[0.5px] border-[color-mix(in_oklab,var(--border)_34%,transparent)]`:`flex-1`),style:dt?{width:j,minWidth:Xe,maxWidth:Qe}:void 0,children:le?(0,I.jsx)(`div`,{className:`p-4 text-sm text-destructive`,children:le}):(0,I.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-auto p-2`,children:[S?(0,I.jsx)(`div`,{className:`px-2 py-3 text-xs text-muted-foreground/70`,children:N(`workspaceLoading`)}):null,!S&&ft===`overview`?(0,I.jsx)(mt,{project:e,artifacts:m,changesCount:y.length,changedPaths:gt,isGitRepository:x,gitBranch:ne,onSelectFile:Tt,onSelectDiff:kt,onPreviewFile:wt}):null,!S&&ft===`files`?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`label`,{className:`mb-2 flex items-center gap-2 rounded-md border-[0.5px] border-[color-mix(in_oklab,var(--border)_34%,transparent)] bg-background px-2 py-1.5 text-xs text-muted-foreground/65 focus-within:text-foreground/85`,children:[(0,I.jsx)(ee,{className:`size-3.5 shrink-0`}),(0,I.jsx)(`input`,{value:de,onChange:e=>fe(e.target.value),placeholder:N(`workspaceFilterFiles`),className:`min-w-0 flex-1 bg-transparent text-xs text-foreground/85 outline-none placeholder:text-muted-foreground/50`})]}),(0,I.jsx)(Be,{tree:_t,selectedPath:Z?.mode===`file`?Z.path:void 0,gitStatuses:ht,onSelectFile:Tt,onPreviewFile:wt,projectId:Y})]}):null,!S&&ft===`changes`?x?(0,I.jsxs)(`div`,{className:`space-y-3`,children:[y.length===0?(0,I.jsx)(`div`,{className:`px-2 py-3 text-xs text-muted-foreground/70`,children:N(`workspaceNoWorkingTreeChanges`)}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(lt,{title:N(`workspaceConflicts`),files:vt.conflicts,selectedPath:void 0,onSelectFile:Ot}),(0,I.jsx)(lt,{title:N(`workspaceStagedChanges`),files:vt.staged,selectedPath:void 0,onSelectFile:Ot}),(0,I.jsx)(lt,{title:N(`workspaceChanges`),files:vt.unstaged,selectedPath:void 0,onSelectFile:Ot}),(0,I.jsx)(lt,{title:N(`workspaceUntracked`),files:vt.untracked,selectedPath:void 0,onSelectFile:Ot})]}),(0,I.jsxs)(`div`,{className:`rounded-lg border border-border bg-muted/10 px-3 py-2`,children:[(0,I.jsx)(`div`,{className:`truncate text-xs font-medium text-foreground/85`,children:ct(ne,b)}),(0,I.jsxs)(`div`,{className:`mt-1 flex flex-wrap gap-x-3 gap-y-1 text-[11px] text-muted-foreground/60`,children:[(0,I.jsxs)(`span`,{children:[N(`workspaceStaged`),` `,b?.staged??0]}),(0,I.jsxs)(`span`,{children:[N(`workspaceChanges`),` `,b?.unstaged??0]}),(0,I.jsxs)(`span`,{children:[N(`workspaceUntracked`),` `,b?.untracked??0]}),b?.conflicts?(0,I.jsxs)(`span`,{className:`text-red-600 dark:text-red-500`,children:[N(`workspaceConflicts`),` `,b.conflicts]}):null]}),y.length>0&&u?(0,I.jsxs)(`div`,{className:`mt-2 flex gap-1.5`,children:[(0,I.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-1 rounded-md px-1.5 py-1 text-[11px] font-medium text-muted-foreground/72 transition-colors hover:bg-muted/20 hover:text-foreground/85`,onClick:()=>u(ot(y)),children:[(0,I.jsx)(c,{className:`size-3`}),N(`workspaceReview`)]}),(0,I.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-1 rounded-md px-1.5 py-1 text-[11px] font-medium text-muted-foreground/72 transition-colors hover:bg-muted/20 hover:text-foreground/85`,onClick:()=>u(st(y)),children:[(0,I.jsx)(c,{className:`size-3`}),N(`workspaceCommitMessage`)]})]}):null]})]}):(0,I.jsx)(`div`,{className:`px-2 py-3 text-xs text-muted-foreground/70`,children:N(`workspaceNotGitRepository`)}):null]})}),dt?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`div`,{role:`separator`,"aria-orientation":`vertical`,"aria-valuemin":Xe,"aria-valuemax":Qe,"aria-valuenow":j,className:M(`group relative z-10 w-1.5 shrink-0 cursor-col-resize bg-transparent transition-colors`,be?`bg-primary/30`:`hover:bg-[color-mix(in_oklab,var(--border)_52%,transparent)]`),onPointerDown:Nt,onPointerMove:Pt,onPointerUp:Ft,onPointerCancel:Ft}),(0,I.jsx)(`div`,{className:`flex min-w-0 flex-1 flex-col bg-background`,children:Z?(0,I.jsx)(pt,{mode:Z.mode,file:Z.file,diff:Z.diff,loading:Z.loading,error:Z.error,onClose:()=>X.kind===`reader`?Ct(X.id):Dt(Z.id),onDraftRequest:u}):null})]}):null]}):(0,I.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center px-5`,children:(0,I.jsxs)(`div`,{className:`w-full max-w-[26rem] space-y-4`,children:[(0,I.jsxs)(`div`,{className:`text-center font-sans`,children:[(0,I.jsx)(`div`,{className:`text-lg font-semibold leading-tight tracking-[-0.01em] text-foreground/90`,children:N(`rightPanelOpenTabsTitle`)}),(0,I.jsx)(`div`,{className:`mt-2 text-sm leading-5 text-muted-foreground/70`,children:N(`rightPanelOpenTabsDescription`)})]}),(0,I.jsx)(`div`,{className:`space-y-2`,children:Ue.map(e=>{let t=e.icon;return(0,I.jsxs)(`button`,{type:`button`,className:`flex w-full cursor-pointer items-center gap-3 rounded-xl border border-[color-mix(in_oklab,var(--border)_34%,transparent)] bg-muted/60 px-4 py-3 text-left transition-colors hover:bg-muted/72 active:bg-muted/82`,onClick:()=>$(e.kind,K(e.kind)),children:[(0,I.jsx)(t,{className:`size-4 shrink-0 text-muted-foreground/78`}),(0,I.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,I.jsx)(`div`,{className:`text-sm font-medium text-foreground/90`,children:e.label}),(0,I.jsx)(`div`,{className:`mt-0.5 text-xs leading-4 text-muted-foreground/60`,children:e.description})]})]},e.kind)})})]})}):(0,I.jsx)(`div`,{className:`p-4 text-sm text-muted-foreground/70`,children:N(`workspaceSelectProject`)})})]})}):null}export{ht as WorkspaceInspector};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-DWdDZTNf.js";import{N as t,Rt as n,kt as r,n as i,pt as a}from"./icons-DHoaB5uq.js";import{i as o,n as s}from"./react-vendor-BR9MG2D-.js";import{nt as c,st as l}from"./index-CZb_mGGF.js";import{i as u,n as d,r as f,t as p}from"./diff-line-counts-Dm5kKQOo.js";var m=e(n(),1),h=o(),g=s();function _(e){return Number.isFinite(e)?e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(1)} MB`:``}function v(e){return e?e.status===`added`?l(`workspaceStatusAdded`):e.status===`deleted`?l(`workspaceStatusDeleted`):e.status===`renamed`?l(`workspaceStatusRenamed`):e.status===`untracked`?l(`workspaceStatusUntracked`):l(`workspaceStatusModified`):``}function y(e){return e?e.language===`markdown`||/\.(md|markdown)$/i.test(e.path):!1}function b(e,t=!1){return l(t?`readerFileMarkdownPrompt`:`readerFilePrompt`,{path:e})}function x(e){return l(`readerDiffPrompt`,{path:e})}function S(e){return`Diff for ${e.oldPath?`${e.oldPath} -> ${e.path}`:e.path}\n\n--- OLD\n${e.oldContent}\n\n--- NEW\n${e.newContent}`}function C({open:e,mode:n,file:o,diff:s,loading:C,error:w,onOpenChange:T,onDraftRequest:E}){let[D,O]=(0,m.useState)(),[k,A]=(0,m.useState)(`preview`);async function j(e,t){t&&(await navigator.clipboard.writeText(t),O(e),window.setTimeout(()=>O(void 0),1200))}(0,m.useEffect)(()=>{if(!e)return;let t=e=>{e.key===`Escape`&&T(!1)};return document.addEventListener(`keydown`,t),()=>document.removeEventListener(`keydown`,t)},[T,e]);let M=(0,m.useMemo)(()=>n===`diff`&&s?p(s.oldContent,s.newContent):void 0,[n,s]);if(!e)return null;let N=n===`file`?o?.path:s?.path,P=n===`file`&&y(o),F=n===`file`?o?.content:s?S(s):void 0,I=n===`file`&&o?b(o.path,P):n===`diff`&&s?x(s.path):void 0,L=n===`file`&&o?`${o.language} · ${_(o.size)}`:n===`diff`&&s?`${v(s)} · ${s.language}`:``;return(0,h.createPortal)((0,g.jsxs)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-background/65 px-4 py-6 backdrop-blur-sm`,role:`dialog`,"aria-modal":`true`,children:[(0,g.jsx)(`button`,{type:`button`,className:`absolute inset-0 cursor-default`,"aria-label":l(`close`),onClick:()=>T(!1)}),(0,g.jsxs)(`div`,{className:`relative flex h-[min(88vh,900px)] w-[min(92vw,1280px)] min-w-0 flex-col overflow-hidden rounded-2xl border border-border bg-background shadow-quickforge`,children:[(0,g.jsxs)(`header`,{className:`flex h-14 shrink-0 items-center gap-3 border-b border-border px-4`,children:[(0,g.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,g.jsx)(`div`,{className:`truncate text-sm font-semibold text-foreground/90`,children:N??(n===`file`?`Code reader`:`Diff reader`)}),L?(0,g.jsx)(`div`,{className:`truncate text-xs text-muted-foreground/65`,children:L}):null]}),P?(0,g.jsx)(`div`,{className:`inline-flex shrink-0 rounded-full bg-muted/25 p-1 text-xs`,children:[`preview`,`source`].map(e=>(0,g.jsx)(`button`,{type:`button`,className:e===k?`rounded-full bg-background px-3 py-1 font-medium text-foreground/90 shadow-[0_8px_20px_-16px_rgb(15_23_42_/_0.42)]`:`rounded-full px-3 py-1 text-muted-foreground/70 hover:text-foreground/85`,onClick:()=>A(e),children:l(e===`preview`?`markdownPreview`:`markdownSource`)},e))}):null,M?(0,g.jsxs)(`span`,{className:`shrink-0 font-mono text-xs font-medium`,children:[(0,g.jsxs)(`span`,{className:`text-emerald-600 dark:text-emerald-400`,children:[`+`,M.added]}),(0,g.jsxs)(`span`,{className:`ml-1.5 text-red-600 dark:text-red-400`,children:[`-`,M.removed]})]}):null,(0,g.jsx)(c,{variant:`ghost`,size:`icon`,onClick:()=>void j(`path`,N),disabled:!N,"aria-label":l(`copyPath`),title:l(`copyPath`),children:D===`path`?(0,g.jsx)(r,{className:`size-4`}):(0,g.jsx)(a,{className:`size-4`})}),(0,g.jsx)(c,{variant:`ghost`,size:`icon`,onClick:()=>void j(`content`,F),disabled:!F,"aria-label":l(`copyContent`),title:l(n===`file`?`copyContent`:`copyDiffContent`),children:D===`content`?(0,g.jsx)(r,{className:`size-4`}):(0,g.jsx)(a,{className:`size-4`})}),(0,g.jsx)(c,{variant:`ghost`,size:`icon`,onClick:()=>I&&E?.(I),disabled:!I||!E,"aria-label":l(`askAiAboutThis`),title:l(`askAiAboutThis`),children:(0,g.jsx)(t,{className:`size-4`})}),(0,g.jsx)(c,{variant:`ghost`,size:`icon`,onClick:()=>T(!1),"aria-label":l(`close`),title:l(`close`),children:(0,g.jsx)(i,{className:`size-4`})})]}),(0,g.jsxs)(`div`,{className:`min-h-0 flex-1 bg-background`,children:[C?(0,g.jsx)(`div`,{className:`p-4 text-sm text-muted-foreground/70`,children:l(`openingReader`)}):null,!C&&w?(0,g.jsx)(`div`,{className:`p-4 text-sm text-destructive`,children:w}):null,!C&&!w&&n===`file`&&o?P?(0,g.jsx)(f,{path:o.path,content:o.content,language:o.language,mode:k},o.path):(0,g.jsx)(u,{path:o.path,content:o.content,language:o.language}):null,!C&&!w&&n===`diff`&&s?(0,g.jsx)(d,{path:s.path,oldContent:s.oldContent,newContent:s.newContent,language:s.language,status:s.status}):null]})]})]}),document.body)}export{C as WorkspaceReaderDialog};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-DWdDZTNf.js";import{Rt as t}from"./icons-DHoaB5uq.js";import{n}from"./react-vendor-BR9MG2D-.js";import{E as r,w as i}from"./index-CZb_mGGF.js";import{t as a}from"./useAppTheme-DsabFF9D.js";import{n as o,t as s}from"./monaco-CzxeAjEw.js";var c=e(t(),1);function l(){let[e,t]=(0,c.useState)(()=>r());return(0,c.useEffect)(()=>{if(typeof window>`u`)return;let e=()=>t(r());return window.addEventListener(i,e),()=>window.removeEventListener(i,e)},[]),e}var u=n();function d({path:e,content:t,language:n}){let r=a(),i=l();return(0,u.jsx)(s,{value:t,language:n,theme:r===`dark`?`vs-dark`:`vs`,options:{readOnly:!0,contextmenu:!1,automaticLayout:!0,minimap:{enabled:!1},fontFamily:getComputedStyle(document.documentElement).getPropertyValue(`--font-mono`).trim()||`ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace`,fontSize:i.fontSize,lineHeight:i.lineHeight,lineNumbers:`on`,scrollBeyondLastLine:!1,wordWrap:`off`,renderLineHighlight:`line`,folding:!1,glyphMargin:!1,scrollbar:{verticalScrollbarSize:8,horizontalScrollbarSize:8}}},e)}function f(e){let t=e.trim();if(t&&!/^(javascript|data|vbscript):/i.test(t)&&/^(https?:|mailto:|#|\/|\.\.?\/)/i.test(t))return t}function p(e,t){let n=[],r=/`([^`]+)`|\[([^\]]+)\]\(([^)\s]+)(?:\s+"[^"]*")?\)|\*\*([^*]+)\*\*|__([^_]+)__|\*([^*\n]+)\*|_([^_\n]+)_/g,i=0,a=0,o;for(;o=r.exec(e);){o.index>i&&n.push(e.slice(i,o.index));let s=`${t}-inline-${a++}`;if(o[1])n.push((0,u.jsx)(`code`,{className:`rounded bg-muted/35 px-1 py-0.5 font-mono text-[0.85em] text-foreground/90`,children:o[1]},s));else if(o[2]&&o[3]){let e=f(o[3]);n.push(e?(0,u.jsx)(`a`,{className:`text-primary underline-offset-4 hover:underline`,href:e,target:e.startsWith(`http`)?`_blank`:void 0,rel:`noreferrer`,children:o[2]},s):`[${o[2]}](${o[3]})`)}else o[4]||o[5]?n.push((0,u.jsx)(`strong`,{className:`font-semibold text-foreground/95`,children:o[4]||o[5]},s)):(o[6]||o[7])&&n.push((0,u.jsx)(`em`,{className:`italic`,children:o[6]||o[7]},s));i=r.lastIndex}return i<e.length&&n.push(e.slice(i)),n.length?n:[e]}function m(e,t){return e.split(`
|
|
2
|
-
`).flatMap((e,n)=>{let r=p(e,`${t}-line-${n}`);return n===0?r:[(0,u.jsx)(`br`,{},`${t}-br-${n}`),...r]})}function h(e){return/^\s*(```|~~~)/.test(e)}function g(e){return/^\s*\|?\s*:?-{3,}:?\s*(\|\s*:?-{3,}:?\s*)+\|?\s*$/.test(e)}function _(e,t){return!!(e[t]?.includes(`|`)&&e[t+1]&&g(e[t+1]))}function v(e,t){let n=e[t]??``;return h(n)||_(e,t)||/^\s{0,3}#{1,6}\s+/.test(n)||/^\s{0,3}([-*_])(?:\s*\1){2,}\s*$/.test(n)||/^\s{0,3}>\s?/.test(n)||/^\s{0,3}[-*+]\s+/.test(n)||/^\s{0,3}\d+[.)]\s+/.test(n)}function y(e){return e.trim().replace(/^\|/,``).replace(/\|$/,``).split(`|`).map(e=>e.trim())}function b(e){let t=e.replace(/\r\n?/g,`
|
|
3
|
-
`).split(`
|
|
4
|
-
`),n=[],r=0,i=0;for(;r<t.length;){let e=t[r],a=`markdown-block-${i++}`;if(!e.trim()){r+=1;continue}if(h(e)){let i=e.match(/^\s*(```|~~~)\s*([^`]*)$/),o=i?.[1]??"```",s=i?.[2]?.trim(),c=[];for(r+=1;r<t.length&&!t[r].trimStart().startsWith(o);)c.push(t[r]),r+=1;r<t.length&&(r+=1),n.push((0,u.jsxs)(`figure`,{className:`my-5 overflow-hidden rounded-xl border border-border bg-muted/20`,children:[s?(0,u.jsx)(`figcaption`,{className:`border-b border-border px-3 py-1.5 font-mono text-[11px] text-muted-foreground/65`,children:s}):null,(0,u.jsx)(`pre`,{className:`overflow-auto p-4 text-[12px] leading-5`,children:(0,u.jsx)(`code`,{children:c.join(`
|
|
5
|
-
`)})})]},a));continue}let o=e.match(/^\s{0,3}(#{1,6})\s+(.+?)\s*#*\s*$/);if(o){let e=o[1].length,t=o[2],i=[`mt-8 mb-3 border-border text-foreground/95`,e===1?`border-b pb-3 text-3xl font-semibold tracking-tight`:``,e===2?`border-b pb-2 text-2xl font-semibold tracking-tight`:``,e===3?`text-xl font-semibold`:``,e===4?`text-lg font-semibold`:``,e>=5?`text-base font-semibold`:``].filter(Boolean).join(` `),s=p(t,`${a}-heading`);e===1?n.push((0,u.jsx)(`h1`,{className:i,children:s},a)):e===2?n.push((0,u.jsx)(`h2`,{className:i,children:s},a)):e===3?n.push((0,u.jsx)(`h3`,{className:i,children:s},a)):e===4?n.push((0,u.jsx)(`h4`,{className:i,children:s},a)):e===5?n.push((0,u.jsx)(`h5`,{className:i,children:s},a)):n.push((0,u.jsx)(`h6`,{className:i,children:s},a)),r+=1;continue}if(/^\s{0,3}([-*_])(?:\s*\1){2,}\s*$/.test(e)){n.push((0,u.jsx)(`hr`,{className:`my-6 border-border`},a)),r+=1;continue}if(_(t,r)){let e=y(t[r]);r+=2;let i=[];for(;r<t.length&&t[r].includes(`|`)&&t[r].trim();)i.push(y(t[r])),r+=1;n.push((0,u.jsx)(`div`,{className:`my-5 overflow-auto rounded-xl border border-border`,children:(0,u.jsxs)(`table`,{className:`w-full border-collapse text-left text-sm`,children:[(0,u.jsx)(`thead`,{className:`bg-muted/25 text-foreground/90`,children:(0,u.jsx)(`tr`,{children:e.map((e,t)=>(0,u.jsx)(`th`,{className:`border-b border-border px-3 py-2 font-semibold`,children:p(e,`${a}-th-${t}`)},`${a}-th-${t}`))})}),(0,u.jsx)(`tbody`,{children:i.map((t,n)=>(0,u.jsx)(`tr`,{className:`border-t border-border/70`,children:e.map((e,r)=>(0,u.jsx)(`td`,{className:`px-3 py-2 align-top text-foreground/85`,children:p(t[r]??``,`${a}-td-${n}-${r}`)},`${a}-td-${n}-${r}`))},`${a}-row-${n}`))})]})},a));continue}if(/^\s{0,3}>\s?/.test(e)){let e=[];for(;r<t.length&&/^\s{0,3}>\s?/.test(t[r]);)e.push(t[r].replace(/^\s{0,3}>\s?/,``)),r+=1;n.push((0,u.jsx)(`blockquote`,{className:`my-4 border-l-2 border-border pl-4 text-muted-foreground/85`,children:m(e.join(`
|
|
6
|
-
`),`${a}-quote`)},a));continue}if(/^\s{0,3}[-*+]\s+/.test(e)){let e=[];for(;r<t.length&&/^\s{0,3}[-*+]\s+/.test(t[r]);)e.push(t[r].replace(/^\s{0,3}[-*+]\s+/,``)),r+=1;n.push((0,u.jsx)(`ul`,{className:`my-4 list-disc space-y-1 pl-6`,children:e.map((e,t)=>(0,u.jsx)(`li`,{children:p(e,`${a}-li-${t}`)},`${a}-li-${t}`))},a));continue}if(/^\s{0,3}\d+[.)]\s+/.test(e)){let e=[];for(;r<t.length&&/^\s{0,3}\d+[.)]\s+/.test(t[r]);)e.push(t[r].replace(/^\s{0,3}\d+[.)]\s+/,``)),r+=1;n.push((0,u.jsx)(`ol`,{className:`my-4 list-decimal space-y-1 pl-6`,children:e.map((e,t)=>(0,u.jsx)(`li`,{children:p(e,`${a}-li-${t}`)},`${a}-li-${t}`))},a));continue}let s=[];for(;r<t.length&&t[r].trim()&&!v(t,r);)s.push(t[r].trim()),r+=1;n.push((0,u.jsx)(`p`,{className:`my-4 text-foreground/86`,children:p(s.join(` `),`${a}-p`)},a))}return n}function x({path:e,content:t,language:n,mode:r}){let i=(0,c.useMemo)(()=>b(t),[t]);return(0,u.jsx)(`div`,{className:`flex h-full min-h-0 flex-col bg-background`,children:(0,u.jsx)(`div`,{className:`min-h-0 flex-1`,children:r===`source`?(0,u.jsx)(d,{path:e,content:t,language:n}):(0,u.jsx)(`div`,{className:`h-full overflow-auto bg-background`,children:(0,u.jsx)(`article`,{className:`quickforge-markdown-reader mx-auto max-w-3xl px-8 py-7 text-sm leading-7 text-foreground/88`,children:i.length?i:(0,u.jsx)(`p`,{className:`text-muted-foreground/70`,children:`This Markdown file is empty.`})})})})})}function S({path:e,oldContent:t,newContent:n,language:r,status:i}){let s=a(),c=l();return(0,u.jsx)(o,{original:t,modified:n,language:r,theme:s===`dark`?`vs-dark`:`vs`,options:{readOnly:!0,contextmenu:!1,automaticLayout:!0,renderSideBySide:!0,minimap:{enabled:!1},fontFamily:getComputedStyle(document.documentElement).getPropertyValue(`--font-mono`).trim()||`ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace`,fontSize:c.fontSize,lineHeight:c.lineHeight,scrollBeyondLastLine:!1,ignoreTrimWhitespace:!1,folding:!1,glyphMargin:!1,scrollbar:{verticalScrollbarSize:8,horizontalScrollbarSize:8}}},`${i}:${e}`)}function C(e,t){let n=e.replace(/\r\n?/g,`
|
|
7
|
-
`).split(`
|
|
8
|
-
`),r=t.replace(/\r\n?/g,`
|
|
9
|
-
`).split(`
|
|
10
|
-
`),i=n.length,a=r.length;if(i*a>4e6)return;let o=Array(a+1).fill(0),s=Array(a+1).fill(0);for(let e=1;e<=i;e++){let t=n[e-1];for(let e=1;e<=a;e++)s[e]=t===r[e-1]?o[e-1]+1:Math.max(o[e],s[e-1]);let i=o;o=s,s=i}let c=o[a];return{added:a-c,removed:i-c}}export{d as i,S as n,x as r,C as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e,t}from"./rolldown-runtime-DWdDZTNf.js";var n=t((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function k(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var A=/\/+/g;function j(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function M(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function N(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,N(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+j(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(A,`$&/`)+`/`),N(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(A,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+j(a,u),c+=N(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+j(a,u++),c+=N(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return N(M(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function P(e,t,n){if(e==null)return e;var r=[],i=0;return N(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function F(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var I=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},L={map:P,forEach:function(e,t,n){P(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return P(e,function(){t++}),t},toArray:function(e){return P(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=L,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return E(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=O,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:F}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,I)}catch(e){I(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.5`})),r=t(((e,t)=>{t.exports=n()})),i=e(r(),1),a=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),o=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),s=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),c=e=>{let t=s(e);return t.charAt(0).toUpperCase()+t.slice(1)},l={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`},u=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},d=(0,i.createContext)({});function f({children:e,size:t,color:n,strokeWidth:r,absoluteStrokeWidth:a,className:o}){let s=(0,i.useMemo)(()=>({size:t,color:n,strokeWidth:r,absoluteStrokeWidth:a,className:o}),[t,n,r,a,o]);return(0,i.createElement)(d.Provider,{value:s},e)}var p=()=>(0,i.useContext)(d),m=(0,i.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:o=``,children:s,iconNode:c,...d},f)=>{let{size:m=24,strokeWidth:h=2,absoluteStrokeWidth:g=!1,color:_=`currentColor`,className:v=``}=p()??{},y=r??g?Number(n??h)*24/Number(t??m):n??h;return(0,i.createElement)(`svg`,{ref:f,...l,width:t??m??l.width,height:t??m??l.height,stroke:e??_,strokeWidth:y,className:a(`lucide`,v,o),...!s&&!u(d)&&{"aria-hidden":`true`},...d},[...c.map(([e,t])=>(0,i.createElement)(e,t)),...Array.isArray(s)?s:[s]])}),h=(e,t)=>{let n=(0,i.forwardRef)(({className:n,...r},s)=>(0,i.createElement)(m,{ref:s,iconNode:t,className:a(`lucide-${o(c(e))}`,`lucide-${e}`,n),...r}));return n.displayName=c(e),n},g=h(`archive`,[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`,key:`1s80jp`}],[`path`,{d:`M10 12h4`,key:`a56b0p`}]]),_=h(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),v=h(`book-open`,[[`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`}]]),y=h(`bot`,[[`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`}]]),b=h(`brain`,[[`path`,{d:`M12 18V5`,key:`adv99a`}],[`path`,{d:`M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4`,key:`1e3is1`}],[`path`,{d:`M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5`,key:`1gqd8o`}],[`path`,{d:`M17.997 5.125a4 4 0 0 1 2.526 5.77`,key:`iwvgf7`}],[`path`,{d:`M18 18a4 4 0 0 0 2-7.464`,key:`efp6ie`}],[`path`,{d:`M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517`,key:`1gq6am`}],[`path`,{d:`M6 18a4 4 0 0 1-2-7.464`,key:`k1g0md`}],[`path`,{d:`M6.003 5.125a4 4 0 0 0-2.526 5.77`,key:`q97ue3`}]]),x=h(`calendar-clock`,[[`path`,{d:`M16 14v2.2l1.6 1`,key:`fo4ql5`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`path`,{d:`M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5`,key:`1osxxc`}],[`path`,{d:`M3 10h5`,key:`r794hk`}],[`path`,{d:`M8 2v4`,key:`1cmpym`}],[`circle`,{cx:`16`,cy:`16`,r:`6`,key:`qoo3c4`}]]),S=h(`calendar-plus`,[[`path`,{d:`M16 19h6`,key:`xwg31i`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`path`,{d:`M19 16v6`,key:`tddt3s`}],[`path`,{d:`M21 12.598V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h8.5`,key:`1glfrc`}],[`path`,{d:`M3 10h18`,key:`8toen8`}],[`path`,{d:`M8 2v4`,key:`1cmpym`}]]),C=h(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),w=h(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),T=h(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),E=h(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),D=h(`chevrons-down-up`,[[`path`,{d:`m7 20 5-5 5 5`,key:`13a0gw`}],[`path`,{d:`m7 4 5 5 5-5`,key:`1kwcof`}]]),O=h(`chevrons-left-right`,[[`path`,{d:`m9 7-5 5 5 5`,key:`j5w590`}],[`path`,{d:`m15 7 5 5-5 5`,key:`1bl6da`}]]),k=h(`chevrons-up-down`,[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]),A=h(`circle-check-big`,[[`path`,{d:`M21.801 10A10 10 0 1 1 17 3.335`,key:`yps3ct`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]]),j=h(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),M=h(`circle-x`,[[`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`}]]),N=h(`clock-3`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6h4`,key:`135r8i`}]]),P=h(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),F=h(`cloud-download`,[[`path`,{d:`M12 13v8l-4-4`,key:`1f5nwf`}],[`path`,{d:`m12 21 4-4`,key:`1lfcce`}],[`path`,{d:`M4.393 15.269A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.436 8.284`,key:`ui1hmy`}]]),I=h(`cloud-upload`,[[`path`,{d:`M12 13v8`,key:`1l5pq0`}],[`path`,{d:`M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242`,key:`1pljnt`}],[`path`,{d:`m8 17 4-4 4 4`,key:`1quai1`}]]),L=h(`code-xml`,[[`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`}]]),ee=h(`container`,[[`path`,{d:`M22 7.7c0-.6-.4-1.2-.8-1.5l-6.3-3.9a1.72 1.72 0 0 0-1.7 0l-10.3 6c-.5.2-.9.8-.9 1.4v6.6c0 .5.4 1.2.8 1.5l6.3 3.9a1.72 1.72 0 0 0 1.7 0l10.3-6c.5-.3.9-1 .9-1.5Z`,key:`1t2lqe`}],[`path`,{d:`M10 21.9V14L2.1 9.1`,key:`o7czzq`}],[`path`,{d:`m10 14 11.9-6.9`,key:`zm5e20`}],[`path`,{d:`M14 19.8v-8.1`,key:`159ecu`}],[`path`,{d:`M18 17.5V9.4`,key:`11uown`}]]),te=h(`copy`,[[`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`}]]),R=h(`database`,[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`,key:`msslwz`}],[`path`,{d:`M3 5V19A9 3 0 0 0 21 19V5`,key:`1wlel7`}],[`path`,{d:`M3 12A9 3 0 0 0 21 12`,key:`mv7ke4`}]]),z=h(`earth`,[[`path`,{d:`M21.54 15H17a2 2 0 0 0-2 2v4.54`,key:`1djwo0`}],[`path`,{d:`M7 3.34V5a3 3 0 0 0 3 3a2 2 0 0 1 2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.1.9-2 2-2h3.17`,key:`1tzkfa`}],[`path`,{d:`M11 21.95V18a2 2 0 0 0-2-2a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05`,key:`14pb5j`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),B=h(`ellipsis-vertical`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`5`,r:`1`,key:`gxeob9`}],[`circle`,{cx:`12`,cy:`19`,r:`1`,key:`lyex9k`}]]),V=h(`ellipsis`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]]),H=h(`external-link`,[[`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`}]]),U=h(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),W=h(`file-archive`,[[`path`,{d:`M13.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 2v11.5`,key:`4pqfef`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M8 12v-1`,key:`1ej8lb`}],[`path`,{d:`M8 18v-2`,key:`qcmpov`}],[`path`,{d:`M8 7V6`,key:`1nbb54`}],[`circle`,{cx:`8`,cy:`20`,r:`2`,key:`ckkr5m`}]]),G=h(`file-braces`,[[`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 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1`,key:`1oajmo`}],[`path`,{d:`M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1`,key:`mpwhp6`}]]),K=h(`file-code-corner`,[[`path`,{d:`M4 12.15V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-3.35`,key:`1wthlu`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`m5 16-3 3 3 3`,key:`331omg`}],[`path`,{d:`m9 22 3-3-3-3`,key:`lsp7cz`}]]),q=h(`file-cog`,[[`path`,{d:`M15 8a1 1 0 0 1-1-1V2a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8z`,key:`1ckgky`}],[`path`,{d:`M20 8v12a2 2 0 0 1-2 2h-4.182`,key:`1726p0`}],[`path`,{d:`m3.305 19.53.923-.382`,key:`ao1pio`}],[`path`,{d:`M4 10.592V4a2 2 0 0 1 2-2h8`,key:`1foop0`}],[`path`,{d:`m4.228 16.852-.924-.383`,key:`1fv9zy`}],[`path`,{d:`m5.852 15.228-.383-.923`,key:`1a9hc2`}],[`path`,{d:`m5.852 20.772-.383.924`,key:`1sh9ke`}],[`path`,{d:`m8.148 15.228.383-.923`,key:`4yu6lf`}],[`path`,{d:`m8.53 21.696-.382-.924`,key:`18b0s9`}],[`path`,{d:`m9.773 16.852.922-.383`,key:`ti6xop`}],[`path`,{d:`m9.773 19.148.922.383`,key:`rws47d`}],[`circle`,{cx:`7`,cy:`18`,r:`3`,key:`lvkj7j`}]]),J=h(`file-diff`,[[`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:`M9 10h6`,key:`9gxzsh`}],[`path`,{d:`M12 13V7`,key:`h0r20n`}],[`path`,{d:`M9 17h6`,key:`r8uit2`}]]),Y=h(`file-image`,[[`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`}],[`circle`,{cx:`10`,cy:`12`,r:`2`,key:`737tya`}],[`path`,{d:`m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22`,key:`wt3hpn`}]]),X=h(`file-lock`,[[`path`,{d:`M4 9.8V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-3`,key:`1432pc`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M9 17v-2a2 2 0 0 0-4 0v2`,key:`168m41`}],[`rect`,{width:`8`,height:`5`,x:`3`,y:`17`,rx:`1`,key:`o8vfew`}]]),Z=h(`file-spreadsheet`,[[`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:`M8 13h2`,key:`yr2amv`}],[`path`,{d:`M14 13h2`,key:`un5t4a`}],[`path`,{d:`M8 17h2`,key:`2yhykz`}],[`path`,{d:`M14 17h2`,key:`10kma7`}]]),Q=h(`file-text`,[[`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`}]]),ne=h(`file`,[[`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`}]]),re=h(`folder-git-2`,[[`path`,{d:`M18 19a5 5 0 0 1-5-5v8`,key:`sz5oeg`}],[`path`,{d:`M9 20H4a2 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.9H20a2 2 0 0 1 2 2v5`,key:`1w6njk`}],[`circle`,{cx:`13`,cy:`12`,r:`2`,key:`1j92g6`}],[`circle`,{cx:`20`,cy:`19`,r:`2`,key:`1obnsp`}]]),ie=h(`folder-open`,[[`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`}]]),ae=h(`folder-plus`,[[`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`}]]),oe=h(`folder`,[[`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`}]]),se=h(`gauge`,[[`path`,{d:`m12 14 4-4`,key:`9kzdfg`}],[`path`,{d:`M3.34 19a10 10 0 1 1 17.32 0`,key:`19p75a`}]]),ce=h(`git-branch`,[[`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`}]]),le=h(`git-graph`,[[`circle`,{cx:`5`,cy:`6`,r:`3`,key:`1qnov2`}],[`path`,{d:`M5 9v6`,key:`158jrl`}],[`circle`,{cx:`5`,cy:`18`,r:`3`,key:`104gr9`}],[`path`,{d:`M12 3v18`,key:`108xh3`}],[`circle`,{cx:`19`,cy:`6`,r:`3`,key:`108a5v`}],[`path`,{d:`M16 15.7A9 9 0 0 0 19 9`,key:`1e3vqb`}]]),ue=h(`globe`,[[`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`}]]),de=h(`hash`,[[`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`}]]),fe=h(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),pe=h(`list`,[[`path`,{d:`M3 5h.01`,key:`18ugdj`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M3 19h.01`,key:`noohij`}],[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M8 12h13`,key:`1za7za`}],[`path`,{d:`M8 19h13`,key:`m83p4d`}]]),me=h(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),he=h(`log-out`,[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]),ge=h(`maximize-2`,[[`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`}]]),_e=h(`menu`,[[`path`,{d:`M4 5h16`,key:`1tepv9`}],[`path`,{d:`M4 12h16`,key:`1lakjw`}],[`path`,{d:`M4 19h16`,key:`1djgab`}]]),ve=h(`message-square-plus`,[[`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`}],[`path`,{d:`M12 8v6`,key:`1ib9pf`}],[`path`,{d:`M9 11h6`,key:`1fldmi`}]]),ye=h(`message-square-text`,[[`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`}],[`path`,{d:`M7 11h10`,key:`1twpyw`}],[`path`,{d:`M7 15h6`,key:`d9of3u`}],[`path`,{d:`M7 7h8`,key:`af5zfr`}]]),be=h(`message-square`,[[`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`}]]),xe=h(`minimize-2`,[[`path`,{d:`m14 10 7-7`,key:`oa77jy`}],[`path`,{d:`M20 10h-6V4`,key:`mjg0md`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M4 14h6v6`,key:`rmj7iw`}]]),Se=h(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),Ce=h(`palette`,[[`path`,{d:`M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z`,key:`e79jfc`}],[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`1okk4w`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`,key:`f64h9f`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`,key:`qy21gx`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`fotxhn`}]]),we=h(`panel-left-open`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`m14 9 3 3-3 3`,key:`8010ee`}]]),Te=h(`panel-left`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}]]),Ee=h(`panel-right`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}]]),De=h(`pen-line`,[[`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`}]]),Oe=h(`pencil`,[[`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`}]]),ke=h(`pin-off`,[[`path`,{d:`M12 17v5`,key:`bb1du9`}],[`path`,{d:`M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89`,key:`znwnzq`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11`,key:`c9qhm2`}]]),Ae=h(`pin`,[[`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`}]]),je=h(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),Me=h(`puzzle`,[[`path`,{d:`M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z`,key:`w46dr5`}]]),Ne=h(`refresh-cw`,[[`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`}]]),Pe=h(`rotate-cw`,[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`,key:`1p45f6`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}]]),Fe=h(`scroll`,[[`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`}]]),Ie=h(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),Le=h(`server`,[[`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`}]]),Re=h(`settings`,[[`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`}]]),ze=h(`settings-2`,[[`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`}]]),Be=h(`share-2`,[[`circle`,{cx:`18`,cy:`5`,r:`3`,key:`gq8acd`}],[`circle`,{cx:`6`,cy:`12`,r:`3`,key:`w7nqdw`}],[`circle`,{cx:`18`,cy:`19`,r:`3`,key:`1xt0gg`}],[`line`,{x1:`8.59`,x2:`15.42`,y1:`13.51`,y2:`17.49`,key:`47mynk`}],[`line`,{x1:`15.41`,x2:`8.59`,y1:`6.51`,y2:`10.49`,key:`1n3mei`}]]),Ve=h(`shield-check`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),$=h(`shield`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}]]),He=h(`sliders-horizontal`,[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]),Ue=h(`sparkles`,[[`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`}]]),We=h(`square-terminal`,[[`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`}]]),Ge=h(`tag`,[[`path`,{d:`M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z`,key:`vktsd0`}],[`circle`,{cx:`7.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`kqv944`}]]),Ke=h(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),qe=h(`trash-2`,[[`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`}]]),Je=h(`triangle-alert`,[[`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`}]]),Ye=h(`wrench`,[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z`,key:`1ngwbx`}]]),Xe=h(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),Ze=h(`zap`,[[`path`,{d:`M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z`,key:`1xq2db`}]]);export{Z as $,Ce as A,S as At,pe as B,Ae as C,k as Ct,Ee as D,T as Dt,De as E,E as Et,ve as F,_ as Ft,ce as G,de as H,_e as I,g as It,ae as J,se as K,ge as L,f as Lt,xe as M,b as Mt,be as N,y as Nt,Te as O,w as Ot,ye as P,v as Pt,Q,he as R,r as Rt,je as S,A as St,Oe as T,D as Tt,ue as U,fe as V,le as W,re as X,ie as Y,ne as Z,Ie as _,F as _t,qe as a,G as at,Ne as b,M as bt,We as c,H as ct,$ as d,z as dt,X as et,Ve as f,R as ft,Le as g,I as gt,Re as h,L as ht,Je as i,K as it,Se as j,x as jt,we as k,C as kt,Ue as l,V as lt,ze as m,ee as mt,Xe as n,J as nt,Ke as o,W as ot,Be as p,te as pt,oe as q,Ye as r,q as rt,Ge as s,U as st,Ze as t,Y as tt,He as u,B as ut,Fe as v,P as vt,ke as w,O as wt,Me as x,j as xt,Pe as y,N as yt,me as z};
|