@tom2012/cc-web 1.5.42 → 1.5.43
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 +1 -1
- package/backend/dist/index.d.ts.map +1 -1
- package/backend/dist/index.js +4 -2
- package/backend/dist/index.js.map +1 -1
- package/frontend/dist/assets/{ChatView-CIJkFI_2.js → ChatView-BdMCvRde.js} +1 -1
- package/frontend/dist/assets/{GraphPreview-DGkO3W8H.js → GraphPreview-D-s0oDaH.js} +1 -1
- package/frontend/dist/assets/{OfficePreview-iyqJ00Hb.js → OfficePreview-Bc3VbeK3.js} +3 -3
- package/frontend/dist/assets/{ProjectPage-DQgPEyb0.js → ProjectPage-BN_FRfFU.js} +4 -4
- package/frontend/dist/assets/{SettingsPage-CLjiV1zw.js → SettingsPage-BXHs7CzQ.js} +1 -1
- package/frontend/dist/assets/{SkillHubPage-BJbt7Ls4.js → SkillHubPage-BbdcHgdn.js} +1 -1
- package/frontend/dist/assets/{chevron-down-BzrArAoQ.js → chevron-down-cL1veBn_.js} +1 -1
- package/frontend/dist/assets/{index-CKu7RWW3.js → index-B8LinJ0F.js} +1 -1
- package/frontend/dist/assets/{index-DjgiG4hc.css → index-CKhjWK5m.css} +1 -1
- package/frontend/dist/assets/{index-BSSodGEm.js → index-JDBiQrHY.js} +2 -2
- package/frontend/dist/assets/{jszip.min-CY-3LamF.js → jszip.min-CRTaTaI5.js} +1 -1
- package/frontend/dist/assets/{select-C63MH-TY.js → select-Bg4UM8ER.js} +1 -1
- package/frontend/dist/assets/{user-BW8RRkQU.js → user-bSFixhhj.js} +1 -1
- package/frontend/dist/index.html +2 -2
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ProjectPage-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ProjectPage-BN_FRfFU.js","assets/select-Bg4UM8ER.js","assets/chevron-down-cL1veBn_.js","assets/user-bSFixhhj.js","assets/ProjectPage-9CEnUXvW.css","assets/SettingsPage-BXHs7CzQ.js","assets/SkillHubPage-BbdcHgdn.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
var fw=Object.defineProperty;var hw=(e,t,n)=>t in e?fw(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Wa=(e,t,n)=>hw(e,typeof t!="symbol"?t+"":t,n);function pw(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in e)){const o=Object.getOwnPropertyDescriptor(r,s);o&&Object.defineProperty(e,s,o.get?o:{enumerable:!0,get:()=>r[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const i of o.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(s){if(s.ep)return;s.ep=!0;const o=n(s);fetch(s.href,o)}})();var RM=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function wm(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function MM(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var s=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,s.get?s:{enumerable:!0,get:function(){return e[r]}})}),n}var Sm={exports:{}},aa={},Em={exports:{}},Y={};/**
|
|
3
3
|
* @license React
|
|
4
4
|
* react.production.min.js
|
|
@@ -272,4 +272,4 @@ Error generating stack: `+o.message+`
|
|
|
272
272
|
|
|
273
273
|
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
274
274
|
|
|
275
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return p.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},TR="DialogDescriptionWarning",PR=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Ux(TR).contentName}}.`;return p.useEffect(()=>{var o;const s=(o=e.current)==null?void 0:o.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},NR=Rx,jR=Dx,Wx=Lx,Hx=_x,Gx=Ix,Kx=Fx,RR=Bx;const nf=NR,MR=jR,Yx=p.forwardRef(({className:e,...t},n)=>h.jsx(Wx,{ref:n,className:ee("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));Yx.displayName=Wx.displayName;const Oa=p.forwardRef(({className:e,children:t,...n},r)=>h.jsxs(MR,{children:[h.jsx(Yx,{}),h.jsxs(Hx,{ref:r,className:ee("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...n,children:[t,h.jsxs(RR,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[h.jsx(qd,{className:"h-4 w-4"}),h.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Oa.displayName=Hx.displayName;const Ia=({className:e,...t})=>h.jsx("div",{className:ee("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Ia.displayName="DialogHeader";const Va=({className:e,...t})=>h.jsx("div",{className:ee("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Va.displayName="DialogFooter";const Fa=p.forwardRef(({className:e,...t},n)=>h.jsx(Gx,{ref:n,className:ee("text-lg font-semibold leading-none tracking-tight",e),...t}));Fa.displayName=Gx.displayName;const za=p.forwardRef(({className:e,...t},n)=>h.jsx(Kx,{ref:n,className:ee("text-sm text-muted-foreground",e),...t}));za.displayName=Kx.displayName;function AR({project:e,open:t,onOpenChange:n,onUpdated:r}){const[s,o]=p.useState([]),[i,a]=p.useState([]),[l,c]=p.useState(!1),[d,u]=p.useState(null);p.useEffect(()=>{if(!t)return;o(e.shares?[...e.shares]:[]),u(null);let m=!1;return Q0().then(x=>{m||a(x)}).catch(()=>{}),()=>{m=!0}},[t,e.id]);const f=new Set(s.map(m=>m.username)),y=i.filter(m=>m!==e.owner&&!f.has(m)),w=m=>{o(x=>[...x,{username:m,permission:"view"}])},v=m=>{o(x=>x.filter(E=>E.username!==m))},S=m=>{o(x=>x.map(E=>E.username===m?{...E,permission:E.permission==="view"?"edit":"view"}:E))},g=async()=>{c(!0),u(null);try{const m=await Z0(e.id,s);r(m),n(!1)}catch(m){u(m instanceof Error?m.message:"Failed to update shares")}finally{c(!1)}};return h.jsx(nf,{open:t,onOpenChange:n,children:h.jsxs(Oa,{className:"sm:max-w-md",children:[h.jsxs(Ia,{children:[h.jsxs(Fa,{className:"flex items-center gap-2",children:[h.jsx(hc,{className:"h-4 w-4"}),"共享设置"]}),h.jsx(za,{children:"选择用户并设置权限:可见(只读)或可编辑(读写+终端)"})]}),h.jsxs("div",{className:"space-y-3 max-h-64 overflow-y-auto",children:[s.length===0&&h.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:"尚未共享给任何用户"}),s.map(m=>h.jsxs("div",{className:"flex items-center justify-between gap-2 px-1",children:[h.jsx("span",{className:"text-sm font-medium",children:m.username}),h.jsxs("div",{className:"flex items-center gap-1.5",children:[h.jsx("button",{onClick:()=>S(m.username),className:"focus:outline-none",children:h.jsx(Bn,{variant:m.permission==="edit"?"default":"secondary",className:"cursor-pointer text-xs",children:m.permission==="edit"?"可编辑":"可见"})}),h.jsx(se,{variant:"ghost",size:"icon",className:"h-7 w-7 text-destructive hover:text-destructive",onClick:()=>v(m.username),children:h.jsx(hx,{className:"h-3.5 w-3.5"})})]})]},m.username))]}),y.length>0&&h.jsxs("div",{className:"border-t pt-3",children:[h.jsx("p",{className:"text-xs text-muted-foreground mb-2",children:"添加用户"}),h.jsx("div",{className:"flex flex-wrap gap-1.5",children:y.map(m=>h.jsxs(se,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1",onClick:()=>w(m),children:[h.jsx(oa,{className:"h-3 w-3"}),m]},m))})]}),d&&h.jsx("p",{className:"text-sm text-destructive",children:d}),h.jsxs(Va,{children:[h.jsx(se,{variant:"outline",onClick:()=>n(!1),disabled:l,children:"取消"}),h.jsx(se,{onClick:()=>void g(),disabled:l,children:l?"保存中...":"保存"})]})]})})}function DR(e,t){switch(e){case"thinking":return"Thinking…";case"tool_use":return t?`${t}`:"Tool…";case"tool_result":return"Reading…";case"text":return"Writing…"}}function LR({status:e}){return h.jsx("span",{className:ee("inline-block w-2 h-2 rounded-full",{"bg-green-500":e==="running","bg-zinc-400":e==="stopped","bg-yellow-400 animate-pulse":e==="restarting"})})}const mm=R.memo(function({project:t,active:n=!1,statusStack:r=[],onDelete:s,onArchive:o,onUnarchive:i,onUpdated:a}){const l=Ta(),[c,d]=p.useState(!1),u=!!t._sharedPermission,f=t._sharedPermission==="view",y=m=>{m.stopPropagation(),confirm(`Delete project "${t.name}"? This cannot be undone.`)&&s(t.id)},w=m=>{m.stopPropagation(),o(t.id)},v=m=>{m.stopPropagation(),i(t.id)},S=h.jsx(Cn.div,{whileHover:!t.archived&&!n?{y:-2}:{},transition:{duration:.2},children:h.jsxs(Gd,{className:ee("group cursor-pointer transition-colors relative",t.archived?"opacity-60 hover:opacity-80 hover:border-zinc-400":n?"border-transparent hover:border-transparent bg-transparent shadow-none":"hover:border-zinc-400 hover:shadow-md"),onClick:()=>!t.archived&&l(`/projects/${t.id}`),children:[h.jsxs(Kd,{className:"pb-2",children:[h.jsxs("div",{className:"flex items-start justify-between gap-2",children:[h.jsx(Yd,{className:ee("text-base leading-tight",t.archived&&"text-muted-foreground"),children:t.name}),h.jsx("div",{className:"flex items-center gap-0.5 opacity-0 group-hover:opacity-100 transition-opacity flex-shrink-0",children:!u&&h.jsxs(h.Fragment,{children:[t.archived?h.jsx(se,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-foreground",onClick:v,title:"Restore project",children:h.jsx(CN,{className:"h-3.5 w-3.5"})}):h.jsxs(h.Fragment,{children:[h.jsx(se,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-foreground",onClick:m=>{m.stopPropagation(),d(!0)},title:"共享设置",children:h.jsx(hc,{className:"h-3.5 w-3.5"})}),h.jsx(se,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-foreground",onClick:w,title:"Archive project",children:h.jsx(bN,{className:"h-3.5 w-3.5"})})]}),h.jsx(se,{variant:"ghost",size:"icon",className:"h-7 w-7 text-destructive hover:text-destructive hover:bg-destructive/10",onClick:y,title:"Delete project",children:h.jsx(hx,{className:"h-3.5 w-3.5"})})]})})]}),h.jsx("div",{className:"flex items-center gap-1.5",children:t.archived?h.jsx(Bn,{variant:"secondary",className:"text-xs",children:"Archived"}):h.jsxs(h.Fragment,{children:[h.jsx(LR,{status:t.status}),h.jsx("span",{className:"text-xs text-muted-foreground capitalize",children:t.status}),n&&r.length>0&&h.jsx("div",{className:"ml-auto relative h-5 flex items-end overflow-hidden",children:h.jsx($d,{initial:!1,children:r.map((m,x)=>{const E=r.length-1-x;return h.jsx(Cn.div,{initial:{opacity:0,y:14,scale:.9},animate:{opacity:E===0?1:E===1?.45:.2,y:-(E*18),scale:1},exit:{opacity:0,y:-20},transition:{duration:.35,ease:"easeOut"},className:"absolute right-0",children:h.jsx(Bn,{variant:"outline",className:"text-xs font-normal whitespace-nowrap",children:DR(m.phase,m.detail)})},m.id)})})})]})})]}),h.jsxs(Xd,{className:"space-y-2",children:[h.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[h.jsx(dc,{className:"h-3.5 w-3.5 flex-shrink-0"}),h.jsx("span",{className:"truncate font-mono",children:t.folderPath})]}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(Bn,{variant:"outline",className:"text-xs font-mono",children:t.cliTool??"claude"}),h.jsx(Bn,{variant:t.permissionMode==="unlimited"?"destructive":"secondary",className:"text-xs",children:t.permissionMode==="unlimited"?"Unlimited":"Limited"}),u&&h.jsxs(Bn,{variant:"outline",className:"text-xs gap-0.5",children:[f?h.jsx(NN,{className:"h-3 w-3"}):h.jsx(fx,{className:"h-3 w-3"}),f?"可见":"可编辑"]}),!u&&t.shares&&t.shares.length>0&&h.jsxs(Bn,{variant:"outline",className:"text-xs gap-0.5",children:[h.jsx(hc,{className:"h-3 w-3"}),t.shares.length]}),h.jsx("span",{className:"text-xs text-muted-foreground",children:new Date(t.createdAt).toLocaleDateString()})]})]})]})}),g=n&&!t.archived?h.jsx("div",{className:"card-active-glow rounded-lg",children:S}):S;return h.jsxs(h.Fragment,{children:[g,!u&&a&&h.jsx(AR,{project:t,open:c,onOpenChange:d,onUpdated:a})]})});function Xx({onSelect:e}){const[t,n]=p.useState(""),[r,s]=p.useState(null),[o,i]=p.useState([]),[a,l]=p.useState(!0),[c,d]=p.useState(null),[u,f]=p.useState(!1),[y,w]=p.useState(""),[v,S]=p.useState(null),[g,m]=p.useState(!1),x=p.useRef(null),E=async D=>{l(!0),d(null);try{const L=await ux(D);n(L.path),s(L.parent),i(L.entries)}catch(L){d(L instanceof Error?L.message:"Failed to load directory")}finally{l(!1)}};p.useEffect(()=>{E()},[]),p.useEffect(()=>{u&&setTimeout(()=>{var D;return(D=x.current)==null?void 0:D.focus()},0)},[u]);const C=()=>{w(""),S(null),f(!0)},P=()=>{f(!1),w(""),S(null)},k=async()=>{const D=y.trim();if(D){m(!0),S(null);try{const{path:L}=await cx(t,D);f(!1),w(""),await E(t),E(L)}catch(L){S(L instanceof Error?L.message:"Failed to create folder")}finally{m(!1)}}},b=D=>{D.key==="Enter"?(D.preventDefault(),k()):D.key==="Escape"&&P()},A=t.split("/").filter(Boolean),T=D=>{const L="/"+A.slice(0,D+1).join("/");E(L)};return h.jsxs("div",{className:"flex flex-col h-64 border rounded-md overflow-hidden",children:[h.jsxs("div",{className:"flex items-center gap-1 px-2 py-2 bg-muted border-b flex-shrink-0",children:[h.jsx(se,{variant:"ghost",size:"sm",className:"h-6 px-1 flex-shrink-0",onClick:()=>void E(),title:"Home",children:h.jsx(MN,{className:"h-3 w-3"})}),h.jsx("div",{className:"flex items-center gap-1 flex-1 overflow-x-auto min-w-0",children:A.map((D,L)=>h.jsxs(R.Fragment,{children:[h.jsx(dx,{className:"h-3 w-3 text-muted-foreground flex-shrink-0"}),h.jsx("button",{className:"text-xs hover:text-foreground text-muted-foreground whitespace-nowrap",onClick:()=>T(L),children:D})]},L))}),h.jsxs(se,{variant:"ghost",size:"sm",className:"h-6 px-1.5 flex-shrink-0 gap-1 text-xs",onClick:C,disabled:u||a||!!c,title:"New folder",children:[h.jsx(RN,{className:"h-3.5 w-3.5"}),h.jsx("span",{className:"hidden sm:inline",children:"New folder"})]})]}),h.jsxs("div",{className:"flex-1 overflow-y-auto",children:[a&&h.jsx("div",{className:"flex items-center justify-center h-full text-sm text-muted-foreground",children:"Loading..."}),c&&h.jsx("div",{className:"flex items-center justify-center h-full text-sm text-destructive px-4 text-center",children:c}),!a&&!c&&h.jsxs("div",{className:"p-1",children:[r&&h.jsxs("button",{className:"flex items-center gap-2 w-full px-2 py-1.5 text-sm rounded hover:bg-accent hover:text-accent-foreground",onClick:()=>void E(r),children:[h.jsx(TN,{className:"h-4 w-4 text-muted-foreground"}),h.jsx("span",{children:".."})]}),u&&h.jsxs("div",{className:"flex items-center gap-1 px-2 py-1.5",children:[h.jsx(tm,{className:"h-4 w-4 text-blue-500 flex-shrink-0"}),h.jsx("input",{ref:x,className:ee("flex-1 text-sm bg-background border rounded px-1.5 py-0.5 outline-none","focus:ring-1 focus:ring-ring",v&&"border-destructive"),placeholder:"Folder name",value:y,onChange:D=>{w(D.target.value),S(null)},onKeyDown:b,disabled:g}),h.jsx("button",{className:"p-1 rounded hover:bg-accent disabled:opacity-50",onClick:()=>void k(),disabled:!y.trim()||g,title:"Create",children:h.jsx(PN,{className:"h-3.5 w-3.5 text-green-600"})}),h.jsx("button",{className:"p-1 rounded hover:bg-accent",onClick:P,disabled:g,title:"Cancel",children:h.jsx(qd,{className:"h-3.5 w-3.5 text-muted-foreground"})})]}),v&&h.jsx("p",{className:"px-3 pb-1 text-xs text-destructive",children:v}),o.length===0&&!u&&h.jsx("div",{className:"text-sm text-muted-foreground px-2 py-4 text-center",children:"Empty directory"}),o.map(D=>h.jsxs("button",{className:ee("flex items-center gap-2 w-full px-2 py-1.5 text-sm rounded text-left",D.type==="dir"?"hover:bg-accent hover:text-accent-foreground cursor-pointer":"opacity-40 cursor-not-allowed"),onClick:()=>{D.type==="dir"&&E(D.path)},disabled:D.type==="file",children:[D.type==="dir"?h.jsx(tm,{className:"h-4 w-4 text-blue-500 flex-shrink-0"}):h.jsx(jN,{className:"h-4 w-4 text-muted-foreground flex-shrink-0"}),h.jsx("span",{className:"truncate",children:D.name})]},D.path))]})]}),h.jsxs("div",{className:"border-t px-3 py-2 flex items-center justify-between gap-2 flex-shrink-0 bg-background",children:[h.jsx("span",{className:"text-xs text-muted-foreground truncate flex-1",children:t}),h.jsx(se,{size:"sm",onClick:()=>e(t),disabled:!t,children:"Select this folder"})]})]})}const _R=[{value:"claude",label:"Claude",desc:"Anthropic Claude Code CLI"},{value:"opencode",label:"OpenCode",desc:"OpenCode CLI (sst/opencode)"},{value:"codex",label:"Codex",desc:"OpenAI Codex CLI"},{value:"qwen",label:"Qwen",desc:"Qwen Code CLI (QwenLM)"}],gm={claude:{limited:"claude",unlimited:"claude --dangerously-skip-permissions"},opencode:{limited:"opencode",unlimited:"opencode --dangerously-skip-permissions"},codex:{limited:"codex",unlimited:"codex --ask-for-approval never --sandbox danger-full-access"},qwen:{limited:"qwen-code",unlimited:"qwen-code --yolo"}};function OR({open:e,onOpenChange:t,onCreated:n}){const[r,s]=p.useState("name"),[o,i]=p.useState(""),[a,l]=p.useState(""),[c,d]=p.useState("claude"),[u,f]=p.useState("limited"),[y,w]=p.useState("terminal"),[v,S]=p.useState(!1),[g,m]=p.useState(null),x=()=>{s("name"),i(""),l(""),d("claude"),f("limited"),w("terminal"),m(null),S(!1)},E=T=>{T||x(),t(T)},C=()=>{if(!o.trim()){m("Please enter a project name");return}m(null),s("folder")},P=T=>{l(T),s("settings")},k=async()=>{S(!0),m(null);try{const T=await q0({name:o.trim(),folderPath:a,permissionMode:u,cliTool:c,mode:y});n(T),E(!1)}catch(T){m(T instanceof Error?T.message:"Failed to create project")}finally{S(!1)}},b={name:"New Project — Name",folder:"New Project — Select Folder",settings:"New Project — Settings"},A=["name","folder","settings"];return h.jsx(nf,{open:e,onOpenChange:E,children:h.jsxs(Oa,{className:"sm:max-w-lg",children:[h.jsxs(Ia,{children:[h.jsx(Fa,{children:b[r]}),h.jsxs(za,{children:[r==="name"&&"Give your project a name.",r==="folder"&&"Choose the working directory for this project.",r==="settings"&&"Choose the AI coding tool and run mode."]})]}),h.jsx("div",{className:"flex gap-2 mb-2",children:A.map((T,D)=>h.jsx("div",{className:`h-1.5 flex-1 rounded-full ${r===T?"bg-primary":A.indexOf(r)>D?"bg-primary/40":"bg-muted"}`},T))}),r==="name"&&h.jsxs("div",{className:"space-y-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(mn,{htmlFor:"project-name",children:"Project Name"}),h.jsx(ra,{id:"project-name",placeholder:"My Project",value:o,onChange:T=>i(T.target.value),onKeyDown:T=>{T.key==="Enter"&&C()},autoFocus:!0})]}),g&&h.jsx("p",{className:"text-sm text-destructive",children:g})]}),r==="folder"&&h.jsxs("div",{className:"space-y-2",children:[h.jsx(mn,{children:"Working Directory"}),h.jsx(Xx,{onSelect:P})]}),r==="settings"&&h.jsxs("div",{className:"space-y-5",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(mn,{children:"AI Coding Tool"}),h.jsx("div",{className:"grid grid-cols-2 gap-2",children:_R.map(T=>h.jsxs("label",{className:`flex items-center gap-2.5 cursor-pointer p-3 rounded-md border transition-colors ${c===T.value?"border-primary bg-primary/5":"hover:bg-accent"}`,children:[h.jsx("input",{type:"radio",name:"cliTool",value:T.value,checked:c===T.value,onChange:()=>d(T.value),className:"accent-primary"}),h.jsxs("div",{children:[h.jsx("div",{className:"font-medium text-sm",children:T.label}),h.jsx("div",{className:"text-xs text-muted-foreground",children:T.desc})]})]},T.value))})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(mn,{children:"Permission Mode"}),h.jsxs("div",{className:"space-y-2",children:[h.jsxs("label",{className:"flex items-start gap-3 cursor-pointer p-3 rounded-md border hover:bg-accent transition-colors",children:[h.jsx("input",{type:"radio",name:"permissionMode",value:"limited",checked:u==="limited",onChange:()=>f("limited"),className:"mt-0.5"}),h.jsxs("div",{children:[h.jsx("div",{className:"font-medium text-sm",children:"Limited"}),h.jsxs("div",{className:"text-xs text-muted-foreground",children:["Runs ",h.jsx("code",{className:"bg-muted px-1 rounded",children:gm[c].limited})," — asks for permission before file changes."]})]})]}),h.jsxs("label",{className:"flex items-start gap-3 cursor-pointer p-3 rounded-md border hover:bg-accent transition-colors",children:[h.jsx("input",{type:"radio",name:"permissionMode",value:"unlimited",checked:u==="unlimited",onChange:()=>f("unlimited"),className:"mt-0.5"}),h.jsxs("div",{children:[h.jsx("div",{className:"font-medium text-sm",children:"Unlimited"}),h.jsxs("div",{className:"text-xs text-muted-foreground",children:["Runs ",h.jsx("code",{className:"bg-muted px-1 rounded",children:gm[c].unlimited})," — acts autonomously."]})]})]})]})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx("label",{className:"text-sm font-medium",children:"项目模式"}),h.jsx("div",{className:"grid grid-cols-2 gap-2",children:["terminal","chat"].map(T=>h.jsxs("button",{type:"button",onClick:()=>w(T),className:`p-3 border rounded-lg text-left text-sm transition-colors ${y===T?"border-primary bg-primary/5 text-foreground":"border-border text-muted-foreground hover:border-muted-foreground"}`,children:[T==="terminal"?h.jsx(fc,{className:"h-4 w-4 mb-1"}):h.jsx(LN,{className:"h-4 w-4 mb-1"}),h.jsx("div",{className:"font-medium capitalize",children:T==="terminal"?"Terminal":"Chat"}),h.jsx("div",{className:"text-xs",children:T==="terminal"?"完整终端体验":"流式对话,无终端"})]},T))})]}),h.jsxs("div",{className:"text-xs text-muted-foreground",children:[h.jsx("span",{className:"font-medium",children:"Folder:"})," ",h.jsx("span",{className:"font-mono",children:a})]}),g&&h.jsx("p",{className:"text-sm text-destructive",children:g})]}),h.jsxs(Va,{children:[r!=="name"&&h.jsx(se,{variant:"outline",onClick:()=>s(r==="settings"?"folder":"name"),disabled:v,children:"Back"}),r==="name"&&h.jsx(se,{onClick:C,children:"Next"}),r==="folder"&&h.jsx(se,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),r==="settings"&&h.jsx(se,{onClick:()=>void k(),disabled:v,children:v?"Creating...":"Create Project"})]})]})})}function IR({open:e,onOpenChange:t,onOpened:n}){const[r,s]=p.useState(""),[o,i]=p.useState(!1),[a,l]=p.useState(null),c=()=>{s(""),l(null),i(!1)},d=f=>{f||c(),t(f)},u=async f=>{s(f),i(!0),l(null);try{const y=await J0(f);n(y),d(!1)}catch(y){l(y instanceof Error?y.message:"Failed to open project"),i(!1)}};return h.jsx(nf,{open:e,onOpenChange:d,children:h.jsxs(Oa,{className:"sm:max-w-lg",children:[h.jsxs(Ia,{children:[h.jsx(Fa,{children:"Open Existing Project"}),h.jsxs(za,{children:["Select a folder that contains a ",h.jsx("code",{className:"bg-muted px-1 rounded text-xs",children:".ccweb/"})," configuration. The project's history and settings will be restored."]})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(mn,{children:"Project Folder"}),h.jsx(Xx,{onSelect:f=>void u(f)})]}),a&&h.jsx("p",{className:"text-sm text-destructive",children:a}),r&&!a&&o&&h.jsxs("p",{className:"text-sm text-muted-foreground",children:["Opening project from ",r,"..."]}),h.jsx(Va,{children:h.jsx(se,{variant:"outline",onClick:()=>d(!1),disabled:o,children:"Cancel"})})]})})}function VR(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const FR=e=>{switch(e){case"success":return $R;case"info":return WR;case"warning":return UR;case"error":return HR;default:return null}},zR=Array(12).fill(0),BR=({visible:e,className:t})=>R.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},R.createElement("div",{className:"sonner-spinner"},zR.map((n,r)=>R.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),$R=R.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},R.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),UR=R.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},R.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),WR=R.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},R.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),HR=R.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},R.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),GR=R.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},R.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),R.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),KR=()=>{const[e,t]=R.useState(document.hidden);return R.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let gc=1;class YR{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;const{message:r,...s}=t,o=typeof(t==null?void 0:t.id)=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:gc++,i=this.toasts.find(l=>l.id===o),a=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(o)&&this.dismissedToasts.delete(o),i?this.toasts=this.toasts.map(l=>l.id===o?(this.publish({...l,...t,id:o,title:r}),{...l,...t,id:o,dismissible:a,title:r}):l):this.addToast({title:r,...s,dismissible:a,id:o}),o},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:t,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const s=Promise.resolve(t instanceof Function?t():t);let o=r!==void 0,i;const a=s.then(async c=>{if(i=["resolve",c],R.isValidElement(c))o=!1,this.create({id:r,type:"default",message:c});else if(QR(c)&&!c.ok){o=!1;const u=typeof n.error=="function"?await n.error(`HTTP error! status: ${c.status}`):n.error,f=typeof n.description=="function"?await n.description(`HTTP error! status: ${c.status}`):n.description,w=typeof u=="object"&&!R.isValidElement(u)?u:{message:u};this.create({id:r,type:"error",description:f,...w})}else if(c instanceof Error){o=!1;const u=typeof n.error=="function"?await n.error(c):n.error,f=typeof n.description=="function"?await n.description(c):n.description,w=typeof u=="object"&&!R.isValidElement(u)?u:{message:u};this.create({id:r,type:"error",description:f,...w})}else if(n.success!==void 0){o=!1;const u=typeof n.success=="function"?await n.success(c):n.success,f=typeof n.description=="function"?await n.description(c):n.description,w=typeof u=="object"&&!R.isValidElement(u)?u:{message:u};this.create({id:r,type:"success",description:f,...w})}}).catch(async c=>{if(i=["reject",c],n.error!==void 0){o=!1;const d=typeof n.error=="function"?await n.error(c):n.error,u=typeof n.description=="function"?await n.description(c):n.description,y=typeof d=="object"&&!R.isValidElement(d)?d:{message:d};this.create({id:r,type:"error",description:u,...y})}}).finally(()=>{o&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),l=()=>new Promise((c,d)=>a.then(()=>i[0]==="reject"?d(i[1]):c(i[1])).catch(d));return typeof r!="string"&&typeof r!="number"?{unwrap:l}:Object.assign(r,{unwrap:l})},this.custom=(t,n)=>{const r=(n==null?void 0:n.id)||gc++;return this.create({jsx:t(r),id:r,...n}),r},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const He=new YR,XR=(e,t)=>{const n=(t==null?void 0:t.id)||gc++;return He.addToast({title:e,...t,id:n}),n},QR=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",ZR=XR,qR=()=>He.toasts,JR=()=>He.getActiveToasts(),Ei=Object.assign(ZR,{success:He.success,info:He.info,warning:He.warning,error:He.error,custom:He.custom,message:He.message,promise:He.promise,dismiss:He.dismiss,loading:He.loading},{getHistory:qR,getToasts:JR});VR("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function Zo(e){return e.label!==void 0}const eM=3,tM="24px",nM="16px",ym=4e3,rM=356,sM=14,oM=45,iM=200;function Rt(...e){return e.filter(Boolean).join(" ")}function aM(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const lM=e=>{var t,n,r,s,o,i,a,l,c;const{invert:d,toast:u,unstyled:f,interacting:y,setHeights:w,visibleToasts:v,heights:S,index:g,toasts:m,expanded:x,removeToast:E,defaultRichColors:C,closeButton:P,style:k,cancelButtonStyle:b,actionButtonStyle:A,className:T="",descriptionClassName:D="",duration:L,position:X,gap:ne,expandByDefault:ie,classNames:F,icons:Z,closeButtonAriaLabel:j="Close toast"}=e,[_,O]=R.useState(null),[N,$]=R.useState(null),[z,U]=R.useState(!1),[K,q]=R.useState(!1),[ve,W]=R.useState(!1),[mt,cr]=R.useState(!1),[wo,dr]=R.useState(!1),[ew,Ba]=R.useState(0),[tw,rf]=R.useState(0),is=R.useRef(u.duration||L||ym),sf=R.useRef(null),zt=R.useRef(null),nw=g===0,rw=g+1<=v,Ze=u.type,fr=u.dismissible!==!1,sw=u.className||"",ow=u.descriptionClassName||"",So=R.useMemo(()=>S.findIndex(H=>H.toastId===u.id)||0,[S,u.id]),iw=R.useMemo(()=>{var H;return(H=u.closeButton)!=null?H:P},[u.closeButton,P]),of=R.useMemo(()=>u.duration||L||ym,[u.duration,L]),$a=R.useRef(0),hr=R.useRef(0),af=R.useRef(0),pr=R.useRef(null),[aw,lw]=X.split("-"),lf=R.useMemo(()=>S.reduce((H,be,Le)=>Le>=So?H:H+be.height,0),[S,So]),uf=KR(),uw=u.invert||d,Ua=Ze==="loading";hr.current=R.useMemo(()=>So*ne+lf,[So,lf]),R.useEffect(()=>{is.current=of},[of]),R.useEffect(()=>{U(!0)},[]),R.useEffect(()=>{const H=zt.current;if(H){const be=H.getBoundingClientRect().height;return rf(be),w(Le=>[{toastId:u.id,height:be,position:u.position},...Le]),()=>w(Le=>Le.filter(qe=>qe.toastId!==u.id))}},[w,u.id]),R.useLayoutEffect(()=>{if(!z)return;const H=zt.current,be=H.style.height;H.style.height="auto";const Le=H.getBoundingClientRect().height;H.style.height=be,rf(Le),w(qe=>qe.find(Ne=>Ne.toastId===u.id)?qe.map(Ne=>Ne.toastId===u.id?{...Ne,height:Le}:Ne):[{toastId:u.id,height:Le,position:u.position},...qe])},[z,u.title,u.description,w,u.id,u.jsx,u.action,u.cancel]);const Jt=R.useCallback(()=>{q(!0),Ba(hr.current),w(H=>H.filter(be=>be.toastId!==u.id)),setTimeout(()=>{E(u)},iM)},[u,E,w,hr]);R.useEffect(()=>{if(u.promise&&Ze==="loading"||u.duration===1/0||u.type==="loading")return;let H;return x||y||uf?(()=>{if(af.current<$a.current){const qe=new Date().getTime()-$a.current;is.current=is.current-qe}af.current=new Date().getTime()})():(()=>{is.current!==1/0&&($a.current=new Date().getTime(),H=setTimeout(()=>{u.onAutoClose==null||u.onAutoClose.call(u,u),Jt()},is.current))})(),()=>clearTimeout(H)},[x,y,u,Ze,uf,Jt]),R.useEffect(()=>{u.delete&&(Jt(),u.onDismiss==null||u.onDismiss.call(u,u))},[Jt,u.delete]);function cw(){var H;if(Z!=null&&Z.loading){var be;return R.createElement("div",{className:Rt(F==null?void 0:F.loader,u==null||(be=u.classNames)==null?void 0:be.loader,"sonner-loader"),"data-visible":Ze==="loading"},Z.loading)}return R.createElement(BR,{className:Rt(F==null?void 0:F.loader,u==null||(H=u.classNames)==null?void 0:H.loader),visible:Ze==="loading"})}const dw=u.icon||(Z==null?void 0:Z[Ze])||FR(Ze);var cf,df;return R.createElement("li",{tabIndex:0,ref:zt,className:Rt(T,sw,F==null?void 0:F.toast,u==null||(t=u.classNames)==null?void 0:t.toast,F==null?void 0:F.default,F==null?void 0:F[Ze],u==null||(n=u.classNames)==null?void 0:n[Ze]),"data-sonner-toast":"","data-rich-colors":(cf=u.richColors)!=null?cf:C,"data-styled":!(u.jsx||u.unstyled||f),"data-mounted":z,"data-promise":!!u.promise,"data-swiped":wo,"data-removed":K,"data-visible":rw,"data-y-position":aw,"data-x-position":lw,"data-index":g,"data-front":nw,"data-swiping":ve,"data-dismissible":fr,"data-type":Ze,"data-invert":uw,"data-swipe-out":mt,"data-swipe-direction":N,"data-expanded":!!(x||ie&&z),"data-testid":u.testId,style:{"--index":g,"--toasts-before":g,"--z-index":m.length-g,"--offset":`${K?ew:hr.current}px`,"--initial-height":ie?"auto":`${tw}px`,...k,...u.style},onDragEnd:()=>{W(!1),O(null),pr.current=null},onPointerDown:H=>{H.button!==2&&(Ua||!fr||(sf.current=new Date,Ba(hr.current),H.target.setPointerCapture(H.pointerId),H.target.tagName!=="BUTTON"&&(W(!0),pr.current={x:H.clientX,y:H.clientY})))},onPointerUp:()=>{var H,be,Le;if(mt||!fr)return;pr.current=null;const qe=Number(((H=zt.current)==null?void 0:H.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Eo=Number(((be=zt.current)==null?void 0:be.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Ne=new Date().getTime()-((Le=sf.current)==null?void 0:Le.getTime()),it=_==="x"?qe:Eo,ko=Math.abs(it)/Ne;if(Math.abs(it)>=oM||ko>.11){Ba(hr.current),u.onDismiss==null||u.onDismiss.call(u,u),$(_==="x"?qe>0?"right":"left":Eo>0?"down":"up"),Jt(),cr(!0);return}else{var gt,yt;(gt=zt.current)==null||gt.style.setProperty("--swipe-amount-x","0px"),(yt=zt.current)==null||yt.style.setProperty("--swipe-amount-y","0px")}dr(!1),W(!1),O(null)},onPointerMove:H=>{var be,Le,qe;if(!pr.current||!fr||((be=window.getSelection())==null?void 0:be.toString().length)>0)return;const Ne=H.clientY-pr.current.y,it=H.clientX-pr.current.x;var ko;const gt=(ko=e.swipeDirections)!=null?ko:aM(X);!_&&(Math.abs(it)>1||Math.abs(Ne)>1)&&O(Math.abs(it)>Math.abs(Ne)?"x":"y");let yt={x:0,y:0};const ff=_n=>1/(1.5+Math.abs(_n)/20);if(_==="y"){if(gt.includes("top")||gt.includes("bottom"))if(gt.includes("top")&&Ne<0||gt.includes("bottom")&&Ne>0)yt.y=Ne;else{const _n=Ne*ff(Ne);yt.y=Math.abs(_n)<Math.abs(Ne)?_n:Ne}}else if(_==="x"&&(gt.includes("left")||gt.includes("right")))if(gt.includes("left")&&it<0||gt.includes("right")&&it>0)yt.x=it;else{const _n=it*ff(it);yt.x=Math.abs(_n)<Math.abs(it)?_n:it}(Math.abs(yt.x)>0||Math.abs(yt.y)>0)&&dr(!0),(Le=zt.current)==null||Le.style.setProperty("--swipe-amount-x",`${yt.x}px`),(qe=zt.current)==null||qe.style.setProperty("--swipe-amount-y",`${yt.y}px`)}},iw&&!u.jsx&&Ze!=="loading"?R.createElement("button",{"aria-label":j,"data-disabled":Ua,"data-close-button":!0,onClick:Ua||!fr?()=>{}:()=>{Jt(),u.onDismiss==null||u.onDismiss.call(u,u)},className:Rt(F==null?void 0:F.closeButton,u==null||(r=u.classNames)==null?void 0:r.closeButton)},(df=Z==null?void 0:Z.close)!=null?df:GR):null,(Ze||u.icon||u.promise)&&u.icon!==null&&((Z==null?void 0:Z[Ze])!==null||u.icon)?R.createElement("div",{"data-icon":"",className:Rt(F==null?void 0:F.icon,u==null||(s=u.classNames)==null?void 0:s.icon)},u.promise||u.type==="loading"&&!u.icon?u.icon||cw():null,u.type!=="loading"?dw:null):null,R.createElement("div",{"data-content":"",className:Rt(F==null?void 0:F.content,u==null||(o=u.classNames)==null?void 0:o.content)},R.createElement("div",{"data-title":"",className:Rt(F==null?void 0:F.title,u==null||(i=u.classNames)==null?void 0:i.title)},u.jsx?u.jsx:typeof u.title=="function"?u.title():u.title),u.description?R.createElement("div",{"data-description":"",className:Rt(D,ow,F==null?void 0:F.description,u==null||(a=u.classNames)==null?void 0:a.description)},typeof u.description=="function"?u.description():u.description):null),R.isValidElement(u.cancel)?u.cancel:u.cancel&&Zo(u.cancel)?R.createElement("button",{"data-button":!0,"data-cancel":!0,style:u.cancelButtonStyle||b,onClick:H=>{Zo(u.cancel)&&fr&&(u.cancel.onClick==null||u.cancel.onClick.call(u.cancel,H),Jt())},className:Rt(F==null?void 0:F.cancelButton,u==null||(l=u.classNames)==null?void 0:l.cancelButton)},u.cancel.label):null,R.isValidElement(u.action)?u.action:u.action&&Zo(u.action)?R.createElement("button",{"data-button":!0,"data-action":!0,style:u.actionButtonStyle||A,onClick:H=>{Zo(u.action)&&(u.action.onClick==null||u.action.onClick.call(u.action,H),!H.defaultPrevented&&Jt())},className:Rt(F==null?void 0:F.actionButton,u==null||(c=u.classNames)==null?void 0:c.actionButton)},u.action.label):null)};function vm(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function uM(e,t){const n={};return[e,t].forEach((r,s)=>{const o=s===1,i=o?"--mobile-offset":"--offset",a=o?nM:tM;function l(c){["top","right","bottom","left"].forEach(d=>{n[`${i}-${d}`]=typeof c=="number"?`${c}px`:c})}typeof r=="number"||typeof r=="string"?l(r):typeof r=="object"?["top","right","bottom","left"].forEach(c=>{r[c]===void 0?n[`${i}-${c}`]=a:n[`${i}-${c}`]=typeof r[c]=="number"?`${r[c]}px`:r[c]}):l(a)}),n}const cM=R.forwardRef(function(t,n){const{id:r,invert:s,position:o="bottom-right",hotkey:i=["altKey","KeyT"],expand:a,closeButton:l,className:c,offset:d,mobileOffset:u,theme:f="light",richColors:y,duration:w,style:v,visibleToasts:S=eM,toastOptions:g,dir:m=vm(),gap:x=sM,icons:E,containerAriaLabel:C="Notifications"}=t,[P,k]=R.useState([]),b=R.useMemo(()=>r?P.filter(z=>z.toasterId===r):P.filter(z=>!z.toasterId),[P,r]),A=R.useMemo(()=>Array.from(new Set([o].concat(b.filter(z=>z.position).map(z=>z.position)))),[b,o]),[T,D]=R.useState([]),[L,X]=R.useState(!1),[ne,ie]=R.useState(!1),[F,Z]=R.useState(f!=="system"?f:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),j=R.useRef(null),_=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),O=R.useRef(null),N=R.useRef(!1),$=R.useCallback(z=>{k(U=>{var K;return(K=U.find(q=>q.id===z.id))!=null&&K.delete||He.dismiss(z.id),U.filter(({id:q})=>q!==z.id)})},[]);return R.useEffect(()=>He.subscribe(z=>{if(z.dismiss){requestAnimationFrame(()=>{k(U=>U.map(K=>K.id===z.id?{...K,delete:!0}:K))});return}setTimeout(()=>{Dy.flushSync(()=>{k(U=>{const K=U.findIndex(q=>q.id===z.id);return K!==-1?[...U.slice(0,K),{...U[K],...z},...U.slice(K+1)]:[z,...U]})})})}),[P]),R.useEffect(()=>{if(f!=="system"){Z(f);return}if(f==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?Z("dark"):Z("light")),typeof window>"u")return;const z=window.matchMedia("(prefers-color-scheme: dark)");try{z.addEventListener("change",({matches:U})=>{Z(U?"dark":"light")})}catch{z.addListener(({matches:K})=>{try{Z(K?"dark":"light")}catch(q){console.error(q)}})}},[f]),R.useEffect(()=>{P.length<=1&&X(!1)},[P]),R.useEffect(()=>{const z=U=>{var K;if(i.every(W=>U[W]||U.code===W)){var ve;X(!0),(ve=j.current)==null||ve.focus()}U.code==="Escape"&&(document.activeElement===j.current||(K=j.current)!=null&&K.contains(document.activeElement))&&X(!1)};return document.addEventListener("keydown",z),()=>document.removeEventListener("keydown",z)},[i]),R.useEffect(()=>{if(j.current)return()=>{O.current&&(O.current.focus({preventScroll:!0}),O.current=null,N.current=!1)}},[j.current]),R.createElement("section",{ref:n,"aria-label":`${C} ${_}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},A.map((z,U)=>{var K;const[q,ve]=z.split("-");return b.length?R.createElement("ol",{key:z,dir:m==="auto"?vm():m,tabIndex:-1,ref:j,className:c,"data-sonner-toaster":!0,"data-sonner-theme":F,"data-y-position":q,"data-x-position":ve,style:{"--front-toast-height":`${((K=T[0])==null?void 0:K.height)||0}px`,"--width":`${rM}px`,"--gap":`${x}px`,...v,...uM(d,u)},onBlur:W=>{N.current&&!W.currentTarget.contains(W.relatedTarget)&&(N.current=!1,O.current&&(O.current.focus({preventScroll:!0}),O.current=null))},onFocus:W=>{W.target instanceof HTMLElement&&W.target.dataset.dismissible==="false"||N.current||(N.current=!0,O.current=W.relatedTarget)},onMouseEnter:()=>X(!0),onMouseMove:()=>X(!0),onMouseLeave:()=>{ne||X(!1)},onDragEnd:()=>X(!1),onPointerDown:W=>{W.target instanceof HTMLElement&&W.target.dataset.dismissible==="false"||ie(!0)},onPointerUp:()=>ie(!1)},b.filter(W=>!W.position&&U===0||W.position===z).map((W,mt)=>{var cr,wo;return R.createElement(lM,{key:W.id,icons:E,index:mt,toast:W,defaultRichColors:y,duration:(cr=g==null?void 0:g.duration)!=null?cr:w,className:g==null?void 0:g.className,descriptionClassName:g==null?void 0:g.descriptionClassName,invert:s,visibleToasts:S,closeButton:(wo=g==null?void 0:g.closeButton)!=null?wo:l,interacting:ne,position:z,style:g==null?void 0:g.style,unstyled:g==null?void 0:g.unstyled,classNames:g==null?void 0:g.classNames,cancelButtonStyle:g==null?void 0:g.cancelButtonStyle,actionButtonStyle:g==null?void 0:g.actionButtonStyle,closeButtonAriaLabel:g==null?void 0:g.closeButtonAriaLabel,removeToast:$,toasts:b.filter(dr=>dr.position==W.position),heights:T.filter(dr=>dr.position==W.position),setHeights:D,expandByDefault:a,gap:x,expanded:L,swipeDirections:t.swipeDirections})})):null}))}),Qx=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}`,Zx=5,qx=3e3;function OM(e,t){const n=p.useRef(null),r=p.useRef(0),s=p.useRef(!0),o=p.useRef(t);o.current=t;const i=p.useRef(!1),a=p.useCallback(v=>{var S;((S=n.current)==null?void 0:S.readyState)===WebSocket.OPEN&&n.current.send(JSON.stringify(v))},[]),l=p.useCallback((v,S)=>{var g;((g=n.current)==null?void 0:g.readyState)===WebSocket.OPEN?(n.current.send(JSON.stringify({type:"terminal_subscribe",cols:v,rows:S})),i.current=!1):i.current=!0},[]),c=p.useCallback(v=>{a({type:"terminal_input",data:v})},[a]),d=p.useCallback((v,S)=>{a({type:"terminal_resize",cols:v,rows:S})},[a]),u=p.useCallback(()=>{a({type:"chat_subscribe"})},[a]),f=p.useCallback(v=>{a({type:"chat_input",text:v})},[a]),y=p.useCallback(()=>{a({type:"chat_interrupt"})},[a]),w=p.useCallback(()=>{if(!s.current)return;const v=ur();if(!v){window.location.href="/login";return}const S=new WebSocket(`${Qx}/ws/projects/${e}`);n.current=S,S.onopen=()=>{r.current=0,S.send(JSON.stringify({type:"auth",token:v}))},S.onmessage=g=>{var x,E,C,P,k,b,A,T,D,L,X,ne,ie,F,Z,j,_,O;let m;try{m=JSON.parse(g.data)}catch{return}switch(m.type){case"connected":i.current=!1,(E=(x=o.current).onConnected)==null||E.call(x);break;case"terminal_data":(P=(C=o.current).onTerminalData)==null||P.call(C,m.data);break;case"status":(b=(k=o.current).onStatus)==null||b.call(k,m.status);break;case"chat_message":{const N=m;(T=(A=o.current).onChatMessage)==null||T.call(A,N);break}case"error":console.error("[WS] Server error:",m.message);break;case"chat_stream":{const N=m;(L=(D=o.current).onChatStream)==null||L.call(D,N.delta,N.contentType);break}case"chat_tool_start":{const N=m;(ne=(X=o.current).onChatToolStart)==null||ne.call(X,N.name,N.input);break}case"chat_tool_end":{const N=m;(F=(ie=o.current).onChatToolEnd)==null||F.call(ie,N.name,N.output);break}case"chat_turn_end":{const N=m;(j=(Z=o.current).onChatTurnEnd)==null||j.call(Z,N.cost_usd);break}case"chat_rate_limit":{const N=m;(O=(_=o.current).onChatRateLimit)==null||O.call(_,N.resetsAt);break}}},S.onclose=()=>{n.current=null,s.current&&r.current<Zx&&(r.current++,setTimeout(w,qx))},S.onerror=g=>{console.error("[WS] WebSocket error:",g)}},[e]);return p.useEffect(()=>(s.current=!0,w(),()=>{var v;s.current=!1,(v=n.current)==null||v.close(),n.current=null}),[w]),{subscribeTerminal:l,sendTerminalInput:c,sendTerminalResize:d,subscribeChatMessages:u,sendChatInput:f,sendChatInterrupt:y}}function dM(e){const t=p.useRef(null),n=p.useRef(0),r=p.useRef(!0),s=p.useRef(e);s.current=e;const o=p.useCallback(()=>{if(!r.current)return;const i=ur();if(!i)return;const a=new WebSocket(`${Qx}/ws/dashboard`);t.current=a,a.onopen=()=>{n.current=0,a.send(JSON.stringify({type:"auth",token:i}))},a.onmessage=l=>{try{const c=JSON.parse(l.data);c.type==="activity_update"&&s.current.onActivityUpdate(c)}catch{}},a.onclose=()=>{t.current=null,r.current&&n.current<Zx&&(n.current++,setTimeout(o,qx))},a.onerror=l=>{console.error("[DashboardWS] Error:",l)}},[]);p.useEffect(()=>(r.current=!0,o(),()=>{var i;r.current=!1,(i=t.current)==null||i.close(),t.current=null}),[o])}function fM(e){if(!e)return"";const t=new Date(e).getTime()-Date.now();if(t<=0)return"即将重置";const n=Math.floor(t/36e5),r=Math.floor(t%36e5/6e4);return n>0?`${n}h${r}m`:`${r}m`}const xm=5*36e5;function hM(e){if(!e||e.utilization===void 0||e.utilization<=0||!e.resetAt)return null;const t=new Date(e.resetAt).getTime()-Date.now();if(t<=0)return null;const n=xm-t;return n<=0?null:Math.round(e.utilization/(n/xm))}function qo({label:e,bucket:t}){if(!t||t.utilization===void 0)return null;const n=t.utilization,r=n<50?"text-green-400":n<80?"text-yellow-400":"text-red-400",s=fM(t.resetAt);return h.jsxs("span",{className:"text-muted-foreground whitespace-nowrap",children:[e," ",h.jsxs("span",{className:ee("font-medium",r),children:[n,"%"]}),s&&h.jsxs("span",{className:"text-muted-foreground/70 ml-0.5",children:["(",s,")"]})]})}function pM({className:e}){const[t,n]=p.useState("loading"),[r,s]=p.useState(!1);p.useEffect(()=>{const f=async()=>{try{n(await ax())}catch{n(null)}};f();const y=setInterval(()=>void f(),5*60*1e3);return()=>clearInterval(y)},[]);const o=async()=>{s(!0);try{n(await lx())}catch{n(null)}finally{s(!1)}};if(t==="loading"||!t)return null;const i=!!t.fiveHour,a=!!t.sevenDay,l=!!t.sevenDaySonnet,c=!!t.sevenDayOpus,d=i||a||l||c,u=hM(t.fiveHour);return h.jsxs("div",{className:ee("flex items-center gap-1.5 text-xs",e),children:[u!==null&&h.jsxs("span",{className:ee("font-medium",u<=100?"text-green-400":"text-orange-400"),title:`5h 使用进度:按当前速率,窗口结束时预计使用 ${u}%`,children:[u,"%"]}),t.planName&&h.jsx("span",{className:"font-medium text-foreground bg-muted border border-border px-2 py-0.5 rounded-full",children:t.planName}),d&&h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"text-muted-foreground/50",children:"|"}),h.jsx(qo,{label:"5h",bucket:t.fiveHour}),a&&h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"text-muted-foreground/50",children:"·"}),h.jsx(qo,{label:"7d",bucket:t.sevenDay})]}),l&&h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"text-muted-foreground/50",children:"·"}),h.jsx(qo,{label:"7d Sonnet",bucket:t.sevenDaySonnet})]}),c&&h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"text-muted-foreground/50",children:"·"}),h.jsx(qo,{label:"7d Opus",bucket:t.sevenDayOpus})]})]}),h.jsx("button",{onClick:()=>void o(),className:"text-muted-foreground hover:text-foreground transition-colors",title:"刷新用量信息",children:h.jsx(VN,{className:ee("h-3 w-3",r&&"animate-spin")})})]})}function mM(){const[e,t]=p.useState([]),[n,r]=p.useState(!1),[s,o]=p.useState(""),[i,a]=p.useState(""),[l,c]=p.useState(""),[d,u]=p.useState(null),[f,y]=p.useState(""),[w,v]=p.useState(""),[S,g]=p.useState(""),m=p.useRef(null),x=p.useRef(null);p.useEffect(()=>{rx().then(t).catch(()=>t([]))},[]),p.useEffect(()=>{n&&setTimeout(()=>{var k;return(k=m.current)==null?void 0:k.focus()},0)},[n]),p.useEffect(()=>{d&&setTimeout(()=>{var k;return(k=x.current)==null?void 0:k.focus()},0)},[d]);const E=async()=>{const k=i.trim();if(k)try{const b=await sx({label:s.trim()||k,command:k,...l?{parentId:l}:{}});t(A=>[...A,b]),o(""),a(""),c(""),r(!1)}catch(b){console.error("[GlobalShortcuts] Failed to add:",b)}},C=async k=>{try{await ix(k),t(b=>b.filter(A=>A.id!==k)),d===k&&u(null)}catch(b){console.error("[GlobalShortcuts] Failed to delete:",b)}},P=async()=>{const k=w.trim();if(!(!k||!d))try{const b=await ox(d,{label:f.trim()||k,command:k,parentId:S||null});t(A=>A.map(T=>T.id===d?b:T)),u(null)}catch(b){console.error("[GlobalShortcuts] Failed to save:",b)}};return h.jsxs("section",{className:"mt-10",children:[h.jsxs("div",{className:"flex items-center justify-between mb-4",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(nm,{className:"h-4 w-4 text-muted-foreground"}),h.jsx("h2",{className:"text-lg font-semibold",children:"全局快捷命令"}),h.jsx("span",{className:"text-xs text-muted-foreground",children:"在所有项目的终端中可用"})]}),h.jsxs("button",{onClick:()=>{r(k=>!k),u(null)},className:ee("flex items-center gap-1.5 text-sm px-3 py-1.5 rounded-md border transition-colors",n?"border-border text-foreground bg-muted":"border-border text-muted-foreground hover:text-foreground hover:bg-muted"),children:[h.jsx(oa,{className:"h-3.5 w-3.5"}),"新建"]})]}),n&&h.jsxs("div",{className:"mb-4 p-4 rounded-lg border border-border bg-background space-y-3",children:[h.jsx("input",{ref:m,placeholder:"名称(可选)",value:s,onChange:k=>o(k.target.value),className:"w-full text-sm bg-muted border border-border rounded px-3 py-1.5 text-foreground placeholder:text-muted-foreground outline-none focus:border-border transition-colors"}),h.jsx("textarea",{placeholder:"命令内容…",value:i,onChange:k=>a(k.target.value),rows:3,className:"w-full text-sm bg-muted border border-border rounded px-3 py-1.5 text-foreground placeholder:text-muted-foreground font-mono outline-none focus:border-border transition-colors resize-none",onKeyDown:k=>{k.key==="Enter"&&(k.metaKey||k.ctrlKey)&&(k.preventDefault(),E()),k.key==="Escape"&&(r(!1),o(""),a(""),c(""))}}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(Ol,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),h.jsxs("select",{value:l,onChange:k=>c(k.target.value),className:"flex-1 text-sm bg-muted border border-border rounded px-3 py-1.5 text-foreground outline-none focus:border-border transition-colors",children:[h.jsx("option",{value:"",children:"无继承"}),e.map(k=>h.jsx("option",{value:k.id,children:k.label},k.id))]})]}),h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("span",{className:"text-xs text-muted-foreground",children:"⌘↩ 保存 · Esc 取消"}),h.jsxs("div",{className:"flex gap-2",children:[h.jsx("button",{onClick:()=>{r(!1),o(""),a("")},className:"text-sm px-3 py-1 rounded bg-secondary hover:bg-accent text-foreground transition-colors",children:"取消"}),h.jsx("button",{onClick:()=>void E(),disabled:!i.trim(),className:ee("text-sm px-3 py-1 rounded transition-colors text-white",i.trim()?"bg-blue-600 hover:bg-blue-500":"bg-secondary opacity-40 cursor-not-allowed"),children:"保存"})]})]})]}),e.length===0&&!n?h.jsxs("div",{className:"flex flex-col items-center gap-2 py-10 text-muted-foreground/50 border border-dashed border-border rounded-lg",children:[h.jsx(nm,{className:"h-6 w-6"}),h.jsx("p",{className:"text-sm",children:"还没有全局快捷命令"})]}):h.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",children:e.map(k=>d===k.id?h.jsxs("div",{className:"rounded-lg border border-border bg-background p-3 space-y-2",children:[h.jsx("input",{ref:x,value:f,onChange:b=>y(b.target.value),placeholder:"名称(可选)",className:"w-full text-sm bg-muted border border-border rounded px-2.5 py-1 text-foreground placeholder:text-muted-foreground outline-none focus:border-border transition-colors"}),h.jsx("textarea",{value:w,onChange:b=>v(b.target.value),rows:3,className:"w-full text-sm bg-muted border border-border rounded px-2.5 py-1 text-foreground font-mono outline-none focus:border-border transition-colors resize-none",onKeyDown:b=>{b.key==="Enter"&&(b.metaKey||b.ctrlKey)&&(b.preventDefault(),P()),b.key==="Escape"&&u(null)}}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(Ol,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),h.jsxs("select",{value:S,onChange:b=>g(b.target.value),className:"flex-1 text-sm bg-muted border border-border rounded px-2.5 py-1 text-foreground outline-none focus:border-border transition-colors",children:[h.jsx("option",{value:"",children:"无继承"}),e.filter(b=>b.id!==k.id).map(b=>h.jsx("option",{value:b.id,children:b.label},b.id))]})]}),h.jsxs("div",{className:"flex gap-2 justify-end",children:[h.jsx("button",{onClick:()=>u(null),className:"text-xs px-2.5 py-1 rounded bg-secondary hover:bg-accent text-foreground transition-colors",children:"取消"}),h.jsx("button",{onClick:()=>void P(),disabled:!w.trim(),className:ee("text-xs px-2.5 py-1 rounded transition-colors text-white",w.trim()?"bg-blue-600 hover:bg-blue-500":"bg-secondary opacity-40 cursor-not-allowed"),children:"保存"})]})]},k.id):h.jsxs("div",{className:"group relative rounded-lg border border-border bg-background hover:border-muted-foreground/30 transition-colors p-3",children:[h.jsx("div",{className:"text-sm font-medium text-foreground truncate pr-14",children:k.label}),k.parentId&&(()=>{const b=e.find(A=>A.id===k.parentId);return b?h.jsxs("div",{className:"flex items-center gap-1 mt-1",children:[h.jsx(Ol,{className:"h-3 w-3 text-muted-foreground"}),h.jsxs("span",{className:"text-xs text-muted-foreground truncate",children:["继承: ",b.label]})]}):null})(),!k.parentId&&k.label!==k.command&&h.jsx("div",{className:"text-xs text-muted-foreground font-mono truncate mt-1 pr-14",children:k.command}),h.jsxs("div",{className:"absolute top-2.5 right-2.5 flex gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[h.jsx("button",{onClick:()=>{u(k.id),y(k.label),v(k.command),g(k.parentId||""),r(!1)},className:"p-1 rounded text-muted-foreground hover:text-blue-400 transition-colors",title:"编辑",children:h.jsx(fx,{className:"h-3.5 w-3.5"})}),h.jsx("button",{onClick:()=>void C(k.id),className:"p-1 rounded text-muted-foreground hover:text-red-400 transition-colors",title:"删除",children:h.jsx(qd,{className:"h-3.5 w-3.5"})})]})]},k.id))})]})}const Jx=p.createContext({theme:"system",resolved:"dark",setTheme:()=>{}});function gM(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function yM(){return p.useSyncExternalStore(e=>{const t=window.matchMedia("(prefers-color-scheme: dark)");return t.addEventListener("change",e),()=>t.removeEventListener("change",e)},()=>gM())}function vM({children:e}){const[t,n]=p.useState(()=>NP(Os.theme,"system")),r=yM(),s=t==="system"?r:t;p.useEffect(()=>{const i=document.documentElement;i.classList.remove("light","dark"),i.classList.add(s)},[s]);const o=i=>{n(i),K0(Os.theme,i)};return h.jsx(Jx.Provider,{value:{theme:t,resolved:s,setTheme:o},children:e})}function xM(){return p.useContext(Jx)}function wM(){const{theme:e,setTheme:t}=xM(),n=[{value:"light",icon:BN,label:"浅色"},{value:"dark",icon:IN,label:"深色"},{value:"system",icon:ON,label:"系统"}];return h.jsx("div",{className:"flex items-center rounded-md border border-border bg-muted/50 p-0.5",children:n.map(({value:r,icon:s,label:o})=>h.jsx("button",{onClick:()=>t(r),className:ee("p-1 rounded-sm transition-colors",e===r?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),title:o,children:h.jsx(s,{className:"h-3.5 w-3.5"})},r))})}function SM(){const e=Ta(),{projects:t,loading:n,error:r,fetchProjects:s,addProject:o,updateProject:i,removeProject:a}=LP(),l=sr(N=>N.clearToken),[c,d]=p.useState(!1),[u,f]=p.useState(!1),[y,w]=p.useState(new Set),v=p.useRef(new Map),[S,g]=p.useState(new Map),m=p.useRef(0),[x,E]=p.useState(!!document.fullscreenElement),[C,P]=p.useState(!1),k=()=>{document.fullscreenElement?document.exitFullscreen():document.documentElement.requestFullscreen()};p.useEffect(()=>{const N=()=>E(!!document.fullscreenElement);return document.addEventListener("fullscreenchange",N),()=>document.removeEventListener("fullscreenchange",N)},[]),p.useEffect(()=>{s()},[s]);const b=2e3,A=3,T=8e3,D=p.useCallback(N=>{const $=Date.now(),z=v.current;if($-N.lastActivityAt<b){w(W=>W.has(N.projectId)?W:new Set(W).add(N.projectId));const U=z.get(N.projectId)??[];let K=!1;if(N.semantic){const W=U[U.length-1],mt=`${N.semantic.phase}:${N.semantic.detail??""}`,cr=W?`${W.phase}:${W.detail??""}`:"";mt!==cr?(U.push({id:m.current++,phase:N.semantic.phase,detail:N.semantic.detail,ts:$}),K=!0):W&&(W.ts=$)}const q=U.filter(W=>$-W.ts<T),ve=q.length>A?q.slice(-A):q;ve.length!==U.length&&(K=!0),z.set(N.projectId,ve),K&&g(new Map(z))}else w(U=>{if(!U.has(N.projectId))return U;const K=new Set(U);return K.delete(N.projectId),K}),z.has(N.projectId)&&z.get(N.projectId).length>0&&(z.set(N.projectId,[]),g(new Map(z)))},[]);dM({onActivityUpdate:D}),p.useEffect(()=>{const N=setInterval(()=>{const $=Date.now(),z=v.current;let U=!1;for(const[K,q]of z){const ve=q.filter(W=>$-W.ts<T);ve.length!==q.length&&(z.set(K,ve),U=!0)}U&&g(new Map(z)),w(K=>{let q=!1;const ve=new Set(K);for(const W of K){const mt=z.get(W);(!mt||mt.length===0)&&(ve.delete(W),q=!0)}return q?ve:K})},3e3);return()=>clearInterval(N)},[]);const L=()=>{l(),e("/login")},X=N=>{o(N)},ne=N=>{o(N)},ie=async N=>{try{await ex(N),a(N)}catch($){Ei.error($ instanceof Error?$.message:"Failed to delete project")}},F=async N=>{try{const $=await tx(N);i($)}catch($){Ei.error($ instanceof Error?$.message:"Failed to archive project")}},Z=async N=>{try{const $=await nx(N);i($)}catch($){Ei.error($ instanceof Error?$.message:"Failed to restore project")}},j=p.useMemo(()=>t.filter(N=>!N.archived),[t]),_=p.useMemo(()=>t.filter(N=>N.archived),[t]),O={onDelete:N=>void ie(N),onArchive:N=>void F(N),onUnarchive:N=>void Z(N),onUpdated:i};return h.jsxs("div",{className:"min-h-screen bg-background",children:[h.jsx("header",{className:"border-b sticky top-0 bg-background z-10",children:h.jsxs("div",{className:"max-w-6xl mx-auto px-4 h-14 flex items-center justify-between",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(fc,{className:"h-5 w-5"}),h.jsx("span",{className:"font-semibold text-lg",children:"CC Web"})]}),h.jsx(pM,{}),h.jsx(se,{variant:"ghost",size:"sm",onClick:()=>e("/skillhub"),title:"SkillHub",children:h.jsx(zN,{className:"h-4 w-4"})}),h.jsx(se,{variant:"ghost",size:"sm",onClick:()=>e("/settings"),title:"设置",children:h.jsx(FN,{className:"h-4 w-4"})}),h.jsx(se,{variant:"ghost",size:"sm",onClick:k,title:x?"Exit fullscreen":"Fullscreen",children:x?h.jsx(_N,{className:"h-4 w-4"}):h.jsx(DN,{className:"h-4 w-4"})}),h.jsx(wM,{}),h.jsxs(se,{variant:"ghost",size:"sm",onClick:L,children:[h.jsx(AN,{className:"h-4 w-4 mr-2"}),"Logout"]})]})}),h.jsxs("main",{className:"max-w-6xl mx-auto px-4 py-8",children:[h.jsxs("div",{className:"flex items-center justify-between mb-6",children:[h.jsxs("div",{children:[h.jsx("h1",{className:"text-2xl font-bold",children:"Projects"}),h.jsx("p",{className:"text-muted-foreground text-sm mt-1",children:"Each project runs Claude CLI in a dedicated terminal session."})]}),h.jsxs("div",{className:"flex gap-2",children:[h.jsxs(se,{variant:"outline",onClick:()=>f(!0),children:[h.jsx(dc,{className:"h-4 w-4 mr-2"}),"Open Project"]}),h.jsxs(se,{onClick:()=>d(!0),children:[h.jsx(oa,{className:"h-4 w-4 mr-2"}),"New Project"]})]})]}),n&&h.jsx("div",{className:"text-center text-muted-foreground py-12",children:"Loading projects..."}),r&&h.jsx("div",{className:"text-center text-destructive py-12",children:r}),!n&&!r&&t.length===0&&h.jsxs("div",{className:"text-center py-20",children:[h.jsx(fc,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),h.jsx("h2",{className:"text-lg font-semibold mb-2",children:"No projects yet"}),h.jsx("p",{className:"text-muted-foreground text-sm mb-6",children:"Create a new project or open an existing one."}),h.jsxs("div",{className:"flex gap-2 justify-center",children:[h.jsxs(se,{variant:"outline",onClick:()=>f(!0),children:[h.jsx(dc,{className:"h-4 w-4 mr-2"}),"Open Project"]}),h.jsxs(se,{onClick:()=>d(!0),children:[h.jsx(oa,{className:"h-4 w-4 mr-2"}),"New Project"]})]})]}),!n&&!r&&j.length>0&&h.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:j.map((N,$)=>h.jsx(Cn.div,{initial:{opacity:0,y:16},animate:{opacity:1,y:0},transition:{duration:.3,delay:$*.05,ease:"easeOut"},children:h.jsx(mm,{project:N,active:y.has(N.id),statusStack:S.get(N.id)??[],...O})},N.id))}),!n&&!r&&_.length>0&&h.jsxs("div",{className:"mt-10",children:[h.jsxs("button",{className:"flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground transition-colors mb-4 group",onClick:()=>P(N=>!N),children:[h.jsx(Cn.span,{animate:{rotate:C?90:0},transition:{duration:.2},children:h.jsx(dx,{className:"h-4 w-4"})}),h.jsx("span",{className:"font-medium",children:"Archived"}),h.jsx("span",{className:"text-xs bg-muted rounded-full px-2 py-0.5",children:_.length})]}),h.jsx($d,{children:C&&h.jsx(Cn.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.25,ease:"easeInOut"},className:"overflow-hidden",children:h.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:_.map(N=>h.jsx(mm,{project:N,active:!1,...O},N.id))})})})]}),h.jsx(mM,{})]}),h.jsx(OR,{open:c,onOpenChange:d,onCreated:X}),h.jsx(IR,{open:u,onOpenChange:f,onOpened:ne})]})}class EM extends R.Component{constructor(){super(...arguments);Wa(this,"state",{hasError:!1,error:null});Wa(this,"handleReset",()=>{var n,r;this.setState({hasError:!1,error:null}),(r=(n=this.props).onReset)==null||r.call(n)})}static getDerivedStateFromError(n){return{hasError:!0,error:n}}componentDidCatch(n,r){console.error("[ErrorBoundary]",n,r.componentStack),Ei.error(n.message||"Something went wrong")}render(){return this.state.hasError?this.props.fallback?this.props.fallback:h.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-3 p-4 text-sm text-muted-foreground",children:[h.jsx("p",{children:"出错了"}),h.jsx("button",{onClick:this.handleReset,className:"px-3 py-1.5 text-xs rounded-md border border-border hover:bg-muted transition-colors",children:"重新加载"})]}):this.props.children}}const kM=R.lazy(()=>Ca(()=>import("./ProjectPage-DQgPEyb0.js").then(e=>e.P),__vite__mapDeps([0,1,2,3,4])).then(e=>({default:e.ProjectPage}))),CM=R.lazy(()=>Ca(()=>import("./SettingsPage-CLjiV1zw.js"),__vite__mapDeps([5,1,2])).then(e=>({default:e.SettingsPage}))),bM=R.lazy(()=>Ca(()=>import("./SkillHubPage-BJbt7Ls4.js"),__vite__mapDeps([6,3,2])).then(e=>({default:e.SkillHubPage})));function TM(){return h.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background",children:h.jsx("span",{className:"text-muted-foreground text-sm",children:"Loading…"})})}function Jo({children:e}){const[t,n]=p.useState(!1),r=sr(o=>o.token),s=sr(o=>o.setToken);return p.useEffect(()=>{if(r){n(!0);return}sa()?Zd().then(o=>s(o)).catch(()=>{}).finally(()=>n(!0)):n(!0)},[]),!t&&!r?null:r?h.jsx(h.Fragment,{children:e}):h.jsx(Gy,{to:"/login",replace:!0})}function PM(){return h.jsxs(vM,{children:[h.jsx(cM,{richColors:!0,position:"bottom-right"}),h.jsx(EM,{children:h.jsx(_E,{children:h.jsx(p.Suspense,{fallback:h.jsx(TM,{}),children:h.jsxs(AE,{children:[h.jsx(Fn,{path:"/login",element:h.jsx(SN,{})}),h.jsx(Fn,{path:"/",element:h.jsx(Jo,{children:h.jsx(SM,{})})}),h.jsx(Fn,{path:"/projects/:id",element:h.jsx(Jo,{children:h.jsx(kM,{})})}),h.jsx(Fn,{path:"/settings",element:h.jsx(Jo,{children:h.jsx(CM,{})})}),h.jsx(Fn,{path:"/skillhub",element:h.jsx(Jo,{children:h.jsx(bM,{})})}),h.jsx(Fn,{path:"*",element:h.jsx(Gy,{to:"/",replace:!0})})]})})})})]})}Hl.createRoot(document.getElementById("root")).render(h.jsx(R.StrictMode,{children:h.jsx(PM,{})}));export{lr as $,$d as A,Fa as B,dx as C,nf as D,NN as E,dc as F,Ol as G,za as H,ra as I,Va as J,se as K,mn as L,_N as M,HP as N,WP as O,fx as P,YP as Q,R,Os as S,zP as T,BP as U,Aa as V,XN as W,qd as X,Il as Y,nm as Z,Ca as _,RM as a,qt as a0,bn as a1,Da as a2,xx as a3,WN as a4,dR as a5,Px as a6,bj as a7,yx as a8,mx as a9,Kd as aA,Yd as aB,Xd as aC,hx as aD,rN as aE,lN as aF,cN as aG,fN as aH,oN as aI,dN as aJ,uN as aK,io as aL,dd as aM,PN as aN,KP as aO,XP as aP,MM as aQ,hN as aa,mN as ab,pN as ac,yN as ad,Ta as ae,TN as af,Bn as ag,pM as ah,wM as ai,vN as aj,fc as ak,LN as al,aN as am,xN as an,VP as ao,FP as ap,gN as aq,LM as ar,OM as as,AM as at,LP as au,ao as av,nN as aw,sN as ax,iN as ay,Gd as az,ur as b,te as c,qP as d,ee as e,DN as f,wm as g,QP as h,NP as i,h as j,ux as k,VN as l,ZP as m,tm as n,Cn as o,UP as p,rx as q,p as r,K0 as s,Ei as t,xM as u,oa as v,JP as w,GP as x,Oa as y,Ia as z};
|
|
275
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return p.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},TR="DialogDescriptionWarning",PR=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Ux(TR).contentName}}.`;return p.useEffect(()=>{var o;const s=(o=e.current)==null?void 0:o.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},NR=Rx,jR=Dx,Wx=Lx,Hx=_x,Gx=Ix,Kx=Fx,RR=Bx;const nf=NR,MR=jR,Yx=p.forwardRef(({className:e,...t},n)=>h.jsx(Wx,{ref:n,className:ee("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));Yx.displayName=Wx.displayName;const Oa=p.forwardRef(({className:e,children:t,...n},r)=>h.jsxs(MR,{children:[h.jsx(Yx,{}),h.jsxs(Hx,{ref:r,className:ee("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...n,children:[t,h.jsxs(RR,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[h.jsx(qd,{className:"h-4 w-4"}),h.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Oa.displayName=Hx.displayName;const Ia=({className:e,...t})=>h.jsx("div",{className:ee("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Ia.displayName="DialogHeader";const Va=({className:e,...t})=>h.jsx("div",{className:ee("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Va.displayName="DialogFooter";const Fa=p.forwardRef(({className:e,...t},n)=>h.jsx(Gx,{ref:n,className:ee("text-lg font-semibold leading-none tracking-tight",e),...t}));Fa.displayName=Gx.displayName;const za=p.forwardRef(({className:e,...t},n)=>h.jsx(Kx,{ref:n,className:ee("text-sm text-muted-foreground",e),...t}));za.displayName=Kx.displayName;function AR({project:e,open:t,onOpenChange:n,onUpdated:r}){const[s,o]=p.useState([]),[i,a]=p.useState([]),[l,c]=p.useState(!1),[d,u]=p.useState(null);p.useEffect(()=>{if(!t)return;o(e.shares?[...e.shares]:[]),u(null);let m=!1;return Q0().then(x=>{m||a(x)}).catch(()=>{}),()=>{m=!0}},[t,e.id]);const f=new Set(s.map(m=>m.username)),y=i.filter(m=>m!==e.owner&&!f.has(m)),w=m=>{o(x=>[...x,{username:m,permission:"view"}])},v=m=>{o(x=>x.filter(E=>E.username!==m))},S=m=>{o(x=>x.map(E=>E.username===m?{...E,permission:E.permission==="view"?"edit":"view"}:E))},g=async()=>{c(!0),u(null);try{const m=await Z0(e.id,s);r(m),n(!1)}catch(m){u(m instanceof Error?m.message:"Failed to update shares")}finally{c(!1)}};return h.jsx(nf,{open:t,onOpenChange:n,children:h.jsxs(Oa,{className:"sm:max-w-md",children:[h.jsxs(Ia,{children:[h.jsxs(Fa,{className:"flex items-center gap-2",children:[h.jsx(hc,{className:"h-4 w-4"}),"共享设置"]}),h.jsx(za,{children:"选择用户并设置权限:可见(只读)或可编辑(读写+终端)"})]}),h.jsxs("div",{className:"space-y-3 max-h-64 overflow-y-auto",children:[s.length===0&&h.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:"尚未共享给任何用户"}),s.map(m=>h.jsxs("div",{className:"flex items-center justify-between gap-2 px-1",children:[h.jsx("span",{className:"text-sm font-medium",children:m.username}),h.jsxs("div",{className:"flex items-center gap-1.5",children:[h.jsx("button",{onClick:()=>S(m.username),className:"focus:outline-none",children:h.jsx(Bn,{variant:m.permission==="edit"?"default":"secondary",className:"cursor-pointer text-xs",children:m.permission==="edit"?"可编辑":"可见"})}),h.jsx(se,{variant:"ghost",size:"icon",className:"h-7 w-7 text-destructive hover:text-destructive",onClick:()=>v(m.username),children:h.jsx(hx,{className:"h-3.5 w-3.5"})})]})]},m.username))]}),y.length>0&&h.jsxs("div",{className:"border-t pt-3",children:[h.jsx("p",{className:"text-xs text-muted-foreground mb-2",children:"添加用户"}),h.jsx("div",{className:"flex flex-wrap gap-1.5",children:y.map(m=>h.jsxs(se,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1",onClick:()=>w(m),children:[h.jsx(oa,{className:"h-3 w-3"}),m]},m))})]}),d&&h.jsx("p",{className:"text-sm text-destructive",children:d}),h.jsxs(Va,{children:[h.jsx(se,{variant:"outline",onClick:()=>n(!1),disabled:l,children:"取消"}),h.jsx(se,{onClick:()=>void g(),disabled:l,children:l?"保存中...":"保存"})]})]})})}function DR(e,t){switch(e){case"thinking":return"Thinking…";case"tool_use":return t?`${t}`:"Tool…";case"tool_result":return"Reading…";case"text":return"Writing…"}}function LR({status:e}){return h.jsx("span",{className:ee("inline-block w-2 h-2 rounded-full",{"bg-green-500":e==="running","bg-zinc-400":e==="stopped","bg-yellow-400 animate-pulse":e==="restarting"})})}const mm=R.memo(function({project:t,active:n=!1,statusStack:r=[],onDelete:s,onArchive:o,onUnarchive:i,onUpdated:a}){const l=Ta(),[c,d]=p.useState(!1),u=!!t._sharedPermission,f=t._sharedPermission==="view",y=m=>{m.stopPropagation(),confirm(`Delete project "${t.name}"? This cannot be undone.`)&&s(t.id)},w=m=>{m.stopPropagation(),o(t.id)},v=m=>{m.stopPropagation(),i(t.id)},S=h.jsx(Cn.div,{whileHover:!t.archived&&!n?{y:-2}:{},transition:{duration:.2},children:h.jsxs(Gd,{className:ee("group cursor-pointer transition-colors relative",t.archived?"opacity-60 hover:opacity-80 hover:border-zinc-400":n?"border-transparent hover:border-transparent bg-transparent shadow-none":"hover:border-zinc-400 hover:shadow-md"),onClick:()=>!t.archived&&l(`/projects/${t.id}`),children:[h.jsxs(Kd,{className:"pb-2",children:[h.jsxs("div",{className:"flex items-start justify-between gap-2",children:[h.jsx(Yd,{className:ee("text-base leading-tight",t.archived&&"text-muted-foreground"),children:t.name}),h.jsx("div",{className:"flex items-center gap-0.5 opacity-0 group-hover:opacity-100 transition-opacity flex-shrink-0",children:!u&&h.jsxs(h.Fragment,{children:[t.archived?h.jsx(se,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-foreground",onClick:v,title:"Restore project",children:h.jsx(CN,{className:"h-3.5 w-3.5"})}):h.jsxs(h.Fragment,{children:[h.jsx(se,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-foreground",onClick:m=>{m.stopPropagation(),d(!0)},title:"共享设置",children:h.jsx(hc,{className:"h-3.5 w-3.5"})}),h.jsx(se,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-foreground",onClick:w,title:"Archive project",children:h.jsx(bN,{className:"h-3.5 w-3.5"})})]}),h.jsx(se,{variant:"ghost",size:"icon",className:"h-7 w-7 text-destructive hover:text-destructive hover:bg-destructive/10",onClick:y,title:"Delete project",children:h.jsx(hx,{className:"h-3.5 w-3.5"})})]})})]}),h.jsx("div",{className:"flex items-center gap-1.5",children:t.archived?h.jsx(Bn,{variant:"secondary",className:"text-xs",children:"Archived"}):h.jsxs(h.Fragment,{children:[h.jsx(LR,{status:t.status}),h.jsx("span",{className:"text-xs text-muted-foreground capitalize",children:t.status}),n&&r.length>0&&h.jsx("div",{className:"ml-auto relative h-5 flex items-end overflow-hidden",children:h.jsx($d,{initial:!1,children:r.map((m,x)=>{const E=r.length-1-x;return h.jsx(Cn.div,{initial:{opacity:0,y:14,scale:.9},animate:{opacity:E===0?1:E===1?.45:.2,y:-(E*18),scale:1},exit:{opacity:0,y:-20},transition:{duration:.35,ease:"easeOut"},className:"absolute right-0",children:h.jsx(Bn,{variant:"outline",className:"text-xs font-normal whitespace-nowrap",children:DR(m.phase,m.detail)})},m.id)})})})]})})]}),h.jsxs(Xd,{className:"space-y-2",children:[h.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[h.jsx(dc,{className:"h-3.5 w-3.5 flex-shrink-0"}),h.jsx("span",{className:"truncate font-mono",children:t.folderPath})]}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(Bn,{variant:"outline",className:"text-xs font-mono",children:t.cliTool??"claude"}),h.jsx(Bn,{variant:t.permissionMode==="unlimited"?"destructive":"secondary",className:"text-xs",children:t.permissionMode==="unlimited"?"Unlimited":"Limited"}),u&&h.jsxs(Bn,{variant:"outline",className:"text-xs gap-0.5",children:[f?h.jsx(NN,{className:"h-3 w-3"}):h.jsx(fx,{className:"h-3 w-3"}),f?"可见":"可编辑"]}),!u&&t.shares&&t.shares.length>0&&h.jsxs(Bn,{variant:"outline",className:"text-xs gap-0.5",children:[h.jsx(hc,{className:"h-3 w-3"}),t.shares.length]}),h.jsx("span",{className:"text-xs text-muted-foreground",children:new Date(t.createdAt).toLocaleDateString()})]})]})]})}),g=n&&!t.archived?h.jsx("div",{className:"card-active-glow rounded-lg",children:S}):S;return h.jsxs(h.Fragment,{children:[g,!u&&a&&h.jsx(AR,{project:t,open:c,onOpenChange:d,onUpdated:a})]})});function Xx({onSelect:e}){const[t,n]=p.useState(""),[r,s]=p.useState(null),[o,i]=p.useState([]),[a,l]=p.useState(!0),[c,d]=p.useState(null),[u,f]=p.useState(!1),[y,w]=p.useState(""),[v,S]=p.useState(null),[g,m]=p.useState(!1),x=p.useRef(null),E=async D=>{l(!0),d(null);try{const L=await ux(D);n(L.path),s(L.parent),i(L.entries)}catch(L){d(L instanceof Error?L.message:"Failed to load directory")}finally{l(!1)}};p.useEffect(()=>{E()},[]),p.useEffect(()=>{u&&setTimeout(()=>{var D;return(D=x.current)==null?void 0:D.focus()},0)},[u]);const C=()=>{w(""),S(null),f(!0)},P=()=>{f(!1),w(""),S(null)},k=async()=>{const D=y.trim();if(D){m(!0),S(null);try{const{path:L}=await cx(t,D);f(!1),w(""),await E(t),E(L)}catch(L){S(L instanceof Error?L.message:"Failed to create folder")}finally{m(!1)}}},b=D=>{D.key==="Enter"?(D.preventDefault(),k()):D.key==="Escape"&&P()},A=t.split("/").filter(Boolean),T=D=>{const L="/"+A.slice(0,D+1).join("/");E(L)};return h.jsxs("div",{className:"flex flex-col h-64 border rounded-md overflow-hidden",children:[h.jsxs("div",{className:"flex items-center gap-1 px-2 py-2 bg-muted border-b flex-shrink-0",children:[h.jsx(se,{variant:"ghost",size:"sm",className:"h-6 px-1 flex-shrink-0",onClick:()=>void E(),title:"Home",children:h.jsx(MN,{className:"h-3 w-3"})}),h.jsx("div",{className:"flex items-center gap-1 flex-1 overflow-x-auto min-w-0",children:A.map((D,L)=>h.jsxs(R.Fragment,{children:[h.jsx(dx,{className:"h-3 w-3 text-muted-foreground flex-shrink-0"}),h.jsx("button",{className:"text-xs hover:text-foreground text-muted-foreground whitespace-nowrap",onClick:()=>T(L),children:D})]},L))}),h.jsxs(se,{variant:"ghost",size:"sm",className:"h-6 px-1.5 flex-shrink-0 gap-1 text-xs",onClick:C,disabled:u||a||!!c,title:"New folder",children:[h.jsx(RN,{className:"h-3.5 w-3.5"}),h.jsx("span",{className:"hidden sm:inline",children:"New folder"})]})]}),h.jsxs("div",{className:"flex-1 overflow-y-auto",children:[a&&h.jsx("div",{className:"flex items-center justify-center h-full text-sm text-muted-foreground",children:"Loading..."}),c&&h.jsx("div",{className:"flex items-center justify-center h-full text-sm text-destructive px-4 text-center",children:c}),!a&&!c&&h.jsxs("div",{className:"p-1",children:[r&&h.jsxs("button",{className:"flex items-center gap-2 w-full px-2 py-1.5 text-sm rounded hover:bg-accent hover:text-accent-foreground",onClick:()=>void E(r),children:[h.jsx(TN,{className:"h-4 w-4 text-muted-foreground"}),h.jsx("span",{children:".."})]}),u&&h.jsxs("div",{className:"flex items-center gap-1 px-2 py-1.5",children:[h.jsx(tm,{className:"h-4 w-4 text-blue-500 flex-shrink-0"}),h.jsx("input",{ref:x,className:ee("flex-1 text-sm bg-background border rounded px-1.5 py-0.5 outline-none","focus:ring-1 focus:ring-ring",v&&"border-destructive"),placeholder:"Folder name",value:y,onChange:D=>{w(D.target.value),S(null)},onKeyDown:b,disabled:g}),h.jsx("button",{className:"p-1 rounded hover:bg-accent disabled:opacity-50",onClick:()=>void k(),disabled:!y.trim()||g,title:"Create",children:h.jsx(PN,{className:"h-3.5 w-3.5 text-green-600"})}),h.jsx("button",{className:"p-1 rounded hover:bg-accent",onClick:P,disabled:g,title:"Cancel",children:h.jsx(qd,{className:"h-3.5 w-3.5 text-muted-foreground"})})]}),v&&h.jsx("p",{className:"px-3 pb-1 text-xs text-destructive",children:v}),o.length===0&&!u&&h.jsx("div",{className:"text-sm text-muted-foreground px-2 py-4 text-center",children:"Empty directory"}),o.map(D=>h.jsxs("button",{className:ee("flex items-center gap-2 w-full px-2 py-1.5 text-sm rounded text-left",D.type==="dir"?"hover:bg-accent hover:text-accent-foreground cursor-pointer":"opacity-40 cursor-not-allowed"),onClick:()=>{D.type==="dir"&&E(D.path)},disabled:D.type==="file",children:[D.type==="dir"?h.jsx(tm,{className:"h-4 w-4 text-blue-500 flex-shrink-0"}):h.jsx(jN,{className:"h-4 w-4 text-muted-foreground flex-shrink-0"}),h.jsx("span",{className:"truncate",children:D.name})]},D.path))]})]}),h.jsxs("div",{className:"border-t px-3 py-2 flex items-center justify-between gap-2 flex-shrink-0 bg-background",children:[h.jsx("span",{className:"text-xs text-muted-foreground truncate flex-1",children:t}),h.jsx(se,{size:"sm",onClick:()=>e(t),disabled:!t,children:"Select this folder"})]})]})}const _R=[{value:"claude",label:"Claude",desc:"Anthropic Claude Code CLI"},{value:"opencode",label:"OpenCode",desc:"OpenCode CLI (sst/opencode)"},{value:"codex",label:"Codex",desc:"OpenAI Codex CLI"},{value:"qwen",label:"Qwen",desc:"Qwen Code CLI (QwenLM)"}],gm={claude:{limited:"claude",unlimited:"claude --dangerously-skip-permissions"},opencode:{limited:"opencode",unlimited:"opencode --dangerously-skip-permissions"},codex:{limited:"codex",unlimited:"codex --ask-for-approval never --sandbox danger-full-access"},qwen:{limited:"qwen-code",unlimited:"qwen-code --yolo"}};function OR({open:e,onOpenChange:t,onCreated:n}){const[r,s]=p.useState("name"),[o,i]=p.useState(""),[a,l]=p.useState(""),[c,d]=p.useState("claude"),[u,f]=p.useState("limited"),[y,w]=p.useState("terminal"),[v,S]=p.useState(!1),[g,m]=p.useState(null),x=()=>{s("name"),i(""),l(""),d("claude"),f("limited"),w("terminal"),m(null),S(!1)},E=T=>{T||x(),t(T)},C=()=>{if(!o.trim()){m("Please enter a project name");return}m(null),s("folder")},P=T=>{l(T),s("settings")},k=async()=>{S(!0),m(null);try{const T=await q0({name:o.trim(),folderPath:a,permissionMode:u,cliTool:c,mode:y});n(T),E(!1)}catch(T){m(T instanceof Error?T.message:"Failed to create project")}finally{S(!1)}},b={name:"New Project — Name",folder:"New Project — Select Folder",settings:"New Project — Settings"},A=["name","folder","settings"];return h.jsx(nf,{open:e,onOpenChange:E,children:h.jsxs(Oa,{className:"sm:max-w-lg",children:[h.jsxs(Ia,{children:[h.jsx(Fa,{children:b[r]}),h.jsxs(za,{children:[r==="name"&&"Give your project a name.",r==="folder"&&"Choose the working directory for this project.",r==="settings"&&"Choose the AI coding tool and run mode."]})]}),h.jsx("div",{className:"flex gap-2 mb-2",children:A.map((T,D)=>h.jsx("div",{className:`h-1.5 flex-1 rounded-full ${r===T?"bg-primary":A.indexOf(r)>D?"bg-primary/40":"bg-muted"}`},T))}),r==="name"&&h.jsxs("div",{className:"space-y-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(mn,{htmlFor:"project-name",children:"Project Name"}),h.jsx(ra,{id:"project-name",placeholder:"My Project",value:o,onChange:T=>i(T.target.value),onKeyDown:T=>{T.key==="Enter"&&C()},autoFocus:!0})]}),g&&h.jsx("p",{className:"text-sm text-destructive",children:g})]}),r==="folder"&&h.jsxs("div",{className:"space-y-2",children:[h.jsx(mn,{children:"Working Directory"}),h.jsx(Xx,{onSelect:P})]}),r==="settings"&&h.jsxs("div",{className:"space-y-5",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(mn,{children:"AI Coding Tool"}),h.jsx("div",{className:"grid grid-cols-2 gap-2",children:_R.map(T=>h.jsxs("label",{className:`flex items-center gap-2.5 cursor-pointer p-3 rounded-md border transition-colors ${c===T.value?"border-primary bg-primary/5":"hover:bg-accent"}`,children:[h.jsx("input",{type:"radio",name:"cliTool",value:T.value,checked:c===T.value,onChange:()=>d(T.value),className:"accent-primary"}),h.jsxs("div",{children:[h.jsx("div",{className:"font-medium text-sm",children:T.label}),h.jsx("div",{className:"text-xs text-muted-foreground",children:T.desc})]})]},T.value))})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(mn,{children:"Permission Mode"}),h.jsxs("div",{className:"space-y-2",children:[h.jsxs("label",{className:"flex items-start gap-3 cursor-pointer p-3 rounded-md border hover:bg-accent transition-colors",children:[h.jsx("input",{type:"radio",name:"permissionMode",value:"limited",checked:u==="limited",onChange:()=>f("limited"),className:"mt-0.5"}),h.jsxs("div",{children:[h.jsx("div",{className:"font-medium text-sm",children:"Limited"}),h.jsxs("div",{className:"text-xs text-muted-foreground",children:["Runs ",h.jsx("code",{className:"bg-muted px-1 rounded",children:gm[c].limited})," — asks for permission before file changes."]})]})]}),h.jsxs("label",{className:"flex items-start gap-3 cursor-pointer p-3 rounded-md border hover:bg-accent transition-colors",children:[h.jsx("input",{type:"radio",name:"permissionMode",value:"unlimited",checked:u==="unlimited",onChange:()=>f("unlimited"),className:"mt-0.5"}),h.jsxs("div",{children:[h.jsx("div",{className:"font-medium text-sm",children:"Unlimited"}),h.jsxs("div",{className:"text-xs text-muted-foreground",children:["Runs ",h.jsx("code",{className:"bg-muted px-1 rounded",children:gm[c].unlimited})," — acts autonomously."]})]})]})]})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx("label",{className:"text-sm font-medium",children:"项目模式"}),h.jsx("div",{className:"grid grid-cols-2 gap-2",children:["terminal","chat"].map(T=>h.jsxs("button",{type:"button",onClick:()=>w(T),className:`p-3 border rounded-lg text-left text-sm transition-colors ${y===T?"border-primary bg-primary/5 text-foreground":"border-border text-muted-foreground hover:border-muted-foreground"}`,children:[T==="terminal"?h.jsx(fc,{className:"h-4 w-4 mb-1"}):h.jsx(LN,{className:"h-4 w-4 mb-1"}),h.jsx("div",{className:"font-medium capitalize",children:T==="terminal"?"Terminal":"Chat"}),h.jsx("div",{className:"text-xs",children:T==="terminal"?"完整终端体验":"流式对话,无终端"})]},T))})]}),h.jsxs("div",{className:"text-xs text-muted-foreground",children:[h.jsx("span",{className:"font-medium",children:"Folder:"})," ",h.jsx("span",{className:"font-mono",children:a})]}),g&&h.jsx("p",{className:"text-sm text-destructive",children:g})]}),h.jsxs(Va,{children:[r!=="name"&&h.jsx(se,{variant:"outline",onClick:()=>s(r==="settings"?"folder":"name"),disabled:v,children:"Back"}),r==="name"&&h.jsx(se,{onClick:C,children:"Next"}),r==="folder"&&h.jsx(se,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),r==="settings"&&h.jsx(se,{onClick:()=>void k(),disabled:v,children:v?"Creating...":"Create Project"})]})]})})}function IR({open:e,onOpenChange:t,onOpened:n}){const[r,s]=p.useState(""),[o,i]=p.useState(!1),[a,l]=p.useState(null),c=()=>{s(""),l(null),i(!1)},d=f=>{f||c(),t(f)},u=async f=>{s(f),i(!0),l(null);try{const y=await J0(f);n(y),d(!1)}catch(y){l(y instanceof Error?y.message:"Failed to open project"),i(!1)}};return h.jsx(nf,{open:e,onOpenChange:d,children:h.jsxs(Oa,{className:"sm:max-w-lg",children:[h.jsxs(Ia,{children:[h.jsx(Fa,{children:"Open Existing Project"}),h.jsxs(za,{children:["Select a folder that contains a ",h.jsx("code",{className:"bg-muted px-1 rounded text-xs",children:".ccweb/"})," configuration. The project's history and settings will be restored."]})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(mn,{children:"Project Folder"}),h.jsx(Xx,{onSelect:f=>void u(f)})]}),a&&h.jsx("p",{className:"text-sm text-destructive",children:a}),r&&!a&&o&&h.jsxs("p",{className:"text-sm text-muted-foreground",children:["Opening project from ",r,"..."]}),h.jsx(Va,{children:h.jsx(se,{variant:"outline",onClick:()=>d(!1),disabled:o,children:"Cancel"})})]})})}function VR(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const FR=e=>{switch(e){case"success":return $R;case"info":return WR;case"warning":return UR;case"error":return HR;default:return null}},zR=Array(12).fill(0),BR=({visible:e,className:t})=>R.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},R.createElement("div",{className:"sonner-spinner"},zR.map((n,r)=>R.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),$R=R.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},R.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),UR=R.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},R.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),WR=R.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},R.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),HR=R.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},R.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),GR=R.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},R.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),R.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),KR=()=>{const[e,t]=R.useState(document.hidden);return R.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let gc=1;class YR{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;const{message:r,...s}=t,o=typeof(t==null?void 0:t.id)=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:gc++,i=this.toasts.find(l=>l.id===o),a=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(o)&&this.dismissedToasts.delete(o),i?this.toasts=this.toasts.map(l=>l.id===o?(this.publish({...l,...t,id:o,title:r}),{...l,...t,id:o,dismissible:a,title:r}):l):this.addToast({title:r,...s,dismissible:a,id:o}),o},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:t,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const s=Promise.resolve(t instanceof Function?t():t);let o=r!==void 0,i;const a=s.then(async c=>{if(i=["resolve",c],R.isValidElement(c))o=!1,this.create({id:r,type:"default",message:c});else if(QR(c)&&!c.ok){o=!1;const u=typeof n.error=="function"?await n.error(`HTTP error! status: ${c.status}`):n.error,f=typeof n.description=="function"?await n.description(`HTTP error! status: ${c.status}`):n.description,w=typeof u=="object"&&!R.isValidElement(u)?u:{message:u};this.create({id:r,type:"error",description:f,...w})}else if(c instanceof Error){o=!1;const u=typeof n.error=="function"?await n.error(c):n.error,f=typeof n.description=="function"?await n.description(c):n.description,w=typeof u=="object"&&!R.isValidElement(u)?u:{message:u};this.create({id:r,type:"error",description:f,...w})}else if(n.success!==void 0){o=!1;const u=typeof n.success=="function"?await n.success(c):n.success,f=typeof n.description=="function"?await n.description(c):n.description,w=typeof u=="object"&&!R.isValidElement(u)?u:{message:u};this.create({id:r,type:"success",description:f,...w})}}).catch(async c=>{if(i=["reject",c],n.error!==void 0){o=!1;const d=typeof n.error=="function"?await n.error(c):n.error,u=typeof n.description=="function"?await n.description(c):n.description,y=typeof d=="object"&&!R.isValidElement(d)?d:{message:d};this.create({id:r,type:"error",description:u,...y})}}).finally(()=>{o&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),l=()=>new Promise((c,d)=>a.then(()=>i[0]==="reject"?d(i[1]):c(i[1])).catch(d));return typeof r!="string"&&typeof r!="number"?{unwrap:l}:Object.assign(r,{unwrap:l})},this.custom=(t,n)=>{const r=(n==null?void 0:n.id)||gc++;return this.create({jsx:t(r),id:r,...n}),r},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const He=new YR,XR=(e,t)=>{const n=(t==null?void 0:t.id)||gc++;return He.addToast({title:e,...t,id:n}),n},QR=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",ZR=XR,qR=()=>He.toasts,JR=()=>He.getActiveToasts(),Ei=Object.assign(ZR,{success:He.success,info:He.info,warning:He.warning,error:He.error,custom:He.custom,message:He.message,promise:He.promise,dismiss:He.dismiss,loading:He.loading},{getHistory:qR,getToasts:JR});VR("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function Zo(e){return e.label!==void 0}const eM=3,tM="24px",nM="16px",ym=4e3,rM=356,sM=14,oM=45,iM=200;function Rt(...e){return e.filter(Boolean).join(" ")}function aM(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const lM=e=>{var t,n,r,s,o,i,a,l,c;const{invert:d,toast:u,unstyled:f,interacting:y,setHeights:w,visibleToasts:v,heights:S,index:g,toasts:m,expanded:x,removeToast:E,defaultRichColors:C,closeButton:P,style:k,cancelButtonStyle:b,actionButtonStyle:A,className:T="",descriptionClassName:D="",duration:L,position:X,gap:ne,expandByDefault:ie,classNames:F,icons:Z,closeButtonAriaLabel:j="Close toast"}=e,[_,O]=R.useState(null),[N,$]=R.useState(null),[z,U]=R.useState(!1),[K,q]=R.useState(!1),[ve,W]=R.useState(!1),[mt,cr]=R.useState(!1),[wo,dr]=R.useState(!1),[ew,Ba]=R.useState(0),[tw,rf]=R.useState(0),is=R.useRef(u.duration||L||ym),sf=R.useRef(null),zt=R.useRef(null),nw=g===0,rw=g+1<=v,Ze=u.type,fr=u.dismissible!==!1,sw=u.className||"",ow=u.descriptionClassName||"",So=R.useMemo(()=>S.findIndex(H=>H.toastId===u.id)||0,[S,u.id]),iw=R.useMemo(()=>{var H;return(H=u.closeButton)!=null?H:P},[u.closeButton,P]),of=R.useMemo(()=>u.duration||L||ym,[u.duration,L]),$a=R.useRef(0),hr=R.useRef(0),af=R.useRef(0),pr=R.useRef(null),[aw,lw]=X.split("-"),lf=R.useMemo(()=>S.reduce((H,be,Le)=>Le>=So?H:H+be.height,0),[S,So]),uf=KR(),uw=u.invert||d,Ua=Ze==="loading";hr.current=R.useMemo(()=>So*ne+lf,[So,lf]),R.useEffect(()=>{is.current=of},[of]),R.useEffect(()=>{U(!0)},[]),R.useEffect(()=>{const H=zt.current;if(H){const be=H.getBoundingClientRect().height;return rf(be),w(Le=>[{toastId:u.id,height:be,position:u.position},...Le]),()=>w(Le=>Le.filter(qe=>qe.toastId!==u.id))}},[w,u.id]),R.useLayoutEffect(()=>{if(!z)return;const H=zt.current,be=H.style.height;H.style.height="auto";const Le=H.getBoundingClientRect().height;H.style.height=be,rf(Le),w(qe=>qe.find(Ne=>Ne.toastId===u.id)?qe.map(Ne=>Ne.toastId===u.id?{...Ne,height:Le}:Ne):[{toastId:u.id,height:Le,position:u.position},...qe])},[z,u.title,u.description,w,u.id,u.jsx,u.action,u.cancel]);const Jt=R.useCallback(()=>{q(!0),Ba(hr.current),w(H=>H.filter(be=>be.toastId!==u.id)),setTimeout(()=>{E(u)},iM)},[u,E,w,hr]);R.useEffect(()=>{if(u.promise&&Ze==="loading"||u.duration===1/0||u.type==="loading")return;let H;return x||y||uf?(()=>{if(af.current<$a.current){const qe=new Date().getTime()-$a.current;is.current=is.current-qe}af.current=new Date().getTime()})():(()=>{is.current!==1/0&&($a.current=new Date().getTime(),H=setTimeout(()=>{u.onAutoClose==null||u.onAutoClose.call(u,u),Jt()},is.current))})(),()=>clearTimeout(H)},[x,y,u,Ze,uf,Jt]),R.useEffect(()=>{u.delete&&(Jt(),u.onDismiss==null||u.onDismiss.call(u,u))},[Jt,u.delete]);function cw(){var H;if(Z!=null&&Z.loading){var be;return R.createElement("div",{className:Rt(F==null?void 0:F.loader,u==null||(be=u.classNames)==null?void 0:be.loader,"sonner-loader"),"data-visible":Ze==="loading"},Z.loading)}return R.createElement(BR,{className:Rt(F==null?void 0:F.loader,u==null||(H=u.classNames)==null?void 0:H.loader),visible:Ze==="loading"})}const dw=u.icon||(Z==null?void 0:Z[Ze])||FR(Ze);var cf,df;return R.createElement("li",{tabIndex:0,ref:zt,className:Rt(T,sw,F==null?void 0:F.toast,u==null||(t=u.classNames)==null?void 0:t.toast,F==null?void 0:F.default,F==null?void 0:F[Ze],u==null||(n=u.classNames)==null?void 0:n[Ze]),"data-sonner-toast":"","data-rich-colors":(cf=u.richColors)!=null?cf:C,"data-styled":!(u.jsx||u.unstyled||f),"data-mounted":z,"data-promise":!!u.promise,"data-swiped":wo,"data-removed":K,"data-visible":rw,"data-y-position":aw,"data-x-position":lw,"data-index":g,"data-front":nw,"data-swiping":ve,"data-dismissible":fr,"data-type":Ze,"data-invert":uw,"data-swipe-out":mt,"data-swipe-direction":N,"data-expanded":!!(x||ie&&z),"data-testid":u.testId,style:{"--index":g,"--toasts-before":g,"--z-index":m.length-g,"--offset":`${K?ew:hr.current}px`,"--initial-height":ie?"auto":`${tw}px`,...k,...u.style},onDragEnd:()=>{W(!1),O(null),pr.current=null},onPointerDown:H=>{H.button!==2&&(Ua||!fr||(sf.current=new Date,Ba(hr.current),H.target.setPointerCapture(H.pointerId),H.target.tagName!=="BUTTON"&&(W(!0),pr.current={x:H.clientX,y:H.clientY})))},onPointerUp:()=>{var H,be,Le;if(mt||!fr)return;pr.current=null;const qe=Number(((H=zt.current)==null?void 0:H.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Eo=Number(((be=zt.current)==null?void 0:be.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Ne=new Date().getTime()-((Le=sf.current)==null?void 0:Le.getTime()),it=_==="x"?qe:Eo,ko=Math.abs(it)/Ne;if(Math.abs(it)>=oM||ko>.11){Ba(hr.current),u.onDismiss==null||u.onDismiss.call(u,u),$(_==="x"?qe>0?"right":"left":Eo>0?"down":"up"),Jt(),cr(!0);return}else{var gt,yt;(gt=zt.current)==null||gt.style.setProperty("--swipe-amount-x","0px"),(yt=zt.current)==null||yt.style.setProperty("--swipe-amount-y","0px")}dr(!1),W(!1),O(null)},onPointerMove:H=>{var be,Le,qe;if(!pr.current||!fr||((be=window.getSelection())==null?void 0:be.toString().length)>0)return;const Ne=H.clientY-pr.current.y,it=H.clientX-pr.current.x;var ko;const gt=(ko=e.swipeDirections)!=null?ko:aM(X);!_&&(Math.abs(it)>1||Math.abs(Ne)>1)&&O(Math.abs(it)>Math.abs(Ne)?"x":"y");let yt={x:0,y:0};const ff=_n=>1/(1.5+Math.abs(_n)/20);if(_==="y"){if(gt.includes("top")||gt.includes("bottom"))if(gt.includes("top")&&Ne<0||gt.includes("bottom")&&Ne>0)yt.y=Ne;else{const _n=Ne*ff(Ne);yt.y=Math.abs(_n)<Math.abs(Ne)?_n:Ne}}else if(_==="x"&&(gt.includes("left")||gt.includes("right")))if(gt.includes("left")&&it<0||gt.includes("right")&&it>0)yt.x=it;else{const _n=it*ff(it);yt.x=Math.abs(_n)<Math.abs(it)?_n:it}(Math.abs(yt.x)>0||Math.abs(yt.y)>0)&&dr(!0),(Le=zt.current)==null||Le.style.setProperty("--swipe-amount-x",`${yt.x}px`),(qe=zt.current)==null||qe.style.setProperty("--swipe-amount-y",`${yt.y}px`)}},iw&&!u.jsx&&Ze!=="loading"?R.createElement("button",{"aria-label":j,"data-disabled":Ua,"data-close-button":!0,onClick:Ua||!fr?()=>{}:()=>{Jt(),u.onDismiss==null||u.onDismiss.call(u,u)},className:Rt(F==null?void 0:F.closeButton,u==null||(r=u.classNames)==null?void 0:r.closeButton)},(df=Z==null?void 0:Z.close)!=null?df:GR):null,(Ze||u.icon||u.promise)&&u.icon!==null&&((Z==null?void 0:Z[Ze])!==null||u.icon)?R.createElement("div",{"data-icon":"",className:Rt(F==null?void 0:F.icon,u==null||(s=u.classNames)==null?void 0:s.icon)},u.promise||u.type==="loading"&&!u.icon?u.icon||cw():null,u.type!=="loading"?dw:null):null,R.createElement("div",{"data-content":"",className:Rt(F==null?void 0:F.content,u==null||(o=u.classNames)==null?void 0:o.content)},R.createElement("div",{"data-title":"",className:Rt(F==null?void 0:F.title,u==null||(i=u.classNames)==null?void 0:i.title)},u.jsx?u.jsx:typeof u.title=="function"?u.title():u.title),u.description?R.createElement("div",{"data-description":"",className:Rt(D,ow,F==null?void 0:F.description,u==null||(a=u.classNames)==null?void 0:a.description)},typeof u.description=="function"?u.description():u.description):null),R.isValidElement(u.cancel)?u.cancel:u.cancel&&Zo(u.cancel)?R.createElement("button",{"data-button":!0,"data-cancel":!0,style:u.cancelButtonStyle||b,onClick:H=>{Zo(u.cancel)&&fr&&(u.cancel.onClick==null||u.cancel.onClick.call(u.cancel,H),Jt())},className:Rt(F==null?void 0:F.cancelButton,u==null||(l=u.classNames)==null?void 0:l.cancelButton)},u.cancel.label):null,R.isValidElement(u.action)?u.action:u.action&&Zo(u.action)?R.createElement("button",{"data-button":!0,"data-action":!0,style:u.actionButtonStyle||A,onClick:H=>{Zo(u.action)&&(u.action.onClick==null||u.action.onClick.call(u.action,H),!H.defaultPrevented&&Jt())},className:Rt(F==null?void 0:F.actionButton,u==null||(c=u.classNames)==null?void 0:c.actionButton)},u.action.label):null)};function vm(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function uM(e,t){const n={};return[e,t].forEach((r,s)=>{const o=s===1,i=o?"--mobile-offset":"--offset",a=o?nM:tM;function l(c){["top","right","bottom","left"].forEach(d=>{n[`${i}-${d}`]=typeof c=="number"?`${c}px`:c})}typeof r=="number"||typeof r=="string"?l(r):typeof r=="object"?["top","right","bottom","left"].forEach(c=>{r[c]===void 0?n[`${i}-${c}`]=a:n[`${i}-${c}`]=typeof r[c]=="number"?`${r[c]}px`:r[c]}):l(a)}),n}const cM=R.forwardRef(function(t,n){const{id:r,invert:s,position:o="bottom-right",hotkey:i=["altKey","KeyT"],expand:a,closeButton:l,className:c,offset:d,mobileOffset:u,theme:f="light",richColors:y,duration:w,style:v,visibleToasts:S=eM,toastOptions:g,dir:m=vm(),gap:x=sM,icons:E,containerAriaLabel:C="Notifications"}=t,[P,k]=R.useState([]),b=R.useMemo(()=>r?P.filter(z=>z.toasterId===r):P.filter(z=>!z.toasterId),[P,r]),A=R.useMemo(()=>Array.from(new Set([o].concat(b.filter(z=>z.position).map(z=>z.position)))),[b,o]),[T,D]=R.useState([]),[L,X]=R.useState(!1),[ne,ie]=R.useState(!1),[F,Z]=R.useState(f!=="system"?f:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),j=R.useRef(null),_=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),O=R.useRef(null),N=R.useRef(!1),$=R.useCallback(z=>{k(U=>{var K;return(K=U.find(q=>q.id===z.id))!=null&&K.delete||He.dismiss(z.id),U.filter(({id:q})=>q!==z.id)})},[]);return R.useEffect(()=>He.subscribe(z=>{if(z.dismiss){requestAnimationFrame(()=>{k(U=>U.map(K=>K.id===z.id?{...K,delete:!0}:K))});return}setTimeout(()=>{Dy.flushSync(()=>{k(U=>{const K=U.findIndex(q=>q.id===z.id);return K!==-1?[...U.slice(0,K),{...U[K],...z},...U.slice(K+1)]:[z,...U]})})})}),[P]),R.useEffect(()=>{if(f!=="system"){Z(f);return}if(f==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?Z("dark"):Z("light")),typeof window>"u")return;const z=window.matchMedia("(prefers-color-scheme: dark)");try{z.addEventListener("change",({matches:U})=>{Z(U?"dark":"light")})}catch{z.addListener(({matches:K})=>{try{Z(K?"dark":"light")}catch(q){console.error(q)}})}},[f]),R.useEffect(()=>{P.length<=1&&X(!1)},[P]),R.useEffect(()=>{const z=U=>{var K;if(i.every(W=>U[W]||U.code===W)){var ve;X(!0),(ve=j.current)==null||ve.focus()}U.code==="Escape"&&(document.activeElement===j.current||(K=j.current)!=null&&K.contains(document.activeElement))&&X(!1)};return document.addEventListener("keydown",z),()=>document.removeEventListener("keydown",z)},[i]),R.useEffect(()=>{if(j.current)return()=>{O.current&&(O.current.focus({preventScroll:!0}),O.current=null,N.current=!1)}},[j.current]),R.createElement("section",{ref:n,"aria-label":`${C} ${_}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},A.map((z,U)=>{var K;const[q,ve]=z.split("-");return b.length?R.createElement("ol",{key:z,dir:m==="auto"?vm():m,tabIndex:-1,ref:j,className:c,"data-sonner-toaster":!0,"data-sonner-theme":F,"data-y-position":q,"data-x-position":ve,style:{"--front-toast-height":`${((K=T[0])==null?void 0:K.height)||0}px`,"--width":`${rM}px`,"--gap":`${x}px`,...v,...uM(d,u)},onBlur:W=>{N.current&&!W.currentTarget.contains(W.relatedTarget)&&(N.current=!1,O.current&&(O.current.focus({preventScroll:!0}),O.current=null))},onFocus:W=>{W.target instanceof HTMLElement&&W.target.dataset.dismissible==="false"||N.current||(N.current=!0,O.current=W.relatedTarget)},onMouseEnter:()=>X(!0),onMouseMove:()=>X(!0),onMouseLeave:()=>{ne||X(!1)},onDragEnd:()=>X(!1),onPointerDown:W=>{W.target instanceof HTMLElement&&W.target.dataset.dismissible==="false"||ie(!0)},onPointerUp:()=>ie(!1)},b.filter(W=>!W.position&&U===0||W.position===z).map((W,mt)=>{var cr,wo;return R.createElement(lM,{key:W.id,icons:E,index:mt,toast:W,defaultRichColors:y,duration:(cr=g==null?void 0:g.duration)!=null?cr:w,className:g==null?void 0:g.className,descriptionClassName:g==null?void 0:g.descriptionClassName,invert:s,visibleToasts:S,closeButton:(wo=g==null?void 0:g.closeButton)!=null?wo:l,interacting:ne,position:z,style:g==null?void 0:g.style,unstyled:g==null?void 0:g.unstyled,classNames:g==null?void 0:g.classNames,cancelButtonStyle:g==null?void 0:g.cancelButtonStyle,actionButtonStyle:g==null?void 0:g.actionButtonStyle,closeButtonAriaLabel:g==null?void 0:g.closeButtonAriaLabel,removeToast:$,toasts:b.filter(dr=>dr.position==W.position),heights:T.filter(dr=>dr.position==W.position),setHeights:D,expandByDefault:a,gap:x,expanded:L,swipeDirections:t.swipeDirections})})):null}))}),Qx=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}`,Zx=5,qx=3e3;function OM(e,t){const n=p.useRef(null),r=p.useRef(0),s=p.useRef(!0),o=p.useRef(t);o.current=t;const i=p.useRef(!1),a=p.useCallback(v=>{var S;((S=n.current)==null?void 0:S.readyState)===WebSocket.OPEN&&n.current.send(JSON.stringify(v))},[]),l=p.useCallback((v,S)=>{var g;((g=n.current)==null?void 0:g.readyState)===WebSocket.OPEN?(n.current.send(JSON.stringify({type:"terminal_subscribe",cols:v,rows:S})),i.current=!1):i.current=!0},[]),c=p.useCallback(v=>{a({type:"terminal_input",data:v})},[a]),d=p.useCallback((v,S)=>{a({type:"terminal_resize",cols:v,rows:S})},[a]),u=p.useCallback(()=>{a({type:"chat_subscribe"})},[a]),f=p.useCallback(v=>{a({type:"chat_input",text:v})},[a]),y=p.useCallback(()=>{a({type:"chat_interrupt"})},[a]),w=p.useCallback(()=>{if(!s.current)return;const v=ur();if(!v){window.location.href="/login";return}const S=new WebSocket(`${Qx}/ws/projects/${e}`);n.current=S,S.onopen=()=>{r.current=0,S.send(JSON.stringify({type:"auth",token:v}))},S.onmessage=g=>{var x,E,C,P,k,b,A,T,D,L,X,ne,ie,F,Z,j,_,O;let m;try{m=JSON.parse(g.data)}catch{return}switch(m.type){case"connected":i.current=!1,(E=(x=o.current).onConnected)==null||E.call(x);break;case"terminal_data":(P=(C=o.current).onTerminalData)==null||P.call(C,m.data);break;case"status":(b=(k=o.current).onStatus)==null||b.call(k,m.status);break;case"chat_message":{const N=m;(T=(A=o.current).onChatMessage)==null||T.call(A,N);break}case"error":console.error("[WS] Server error:",m.message);break;case"chat_stream":{const N=m;(L=(D=o.current).onChatStream)==null||L.call(D,N.delta,N.contentType);break}case"chat_tool_start":{const N=m;(ne=(X=o.current).onChatToolStart)==null||ne.call(X,N.name,N.input);break}case"chat_tool_end":{const N=m;(F=(ie=o.current).onChatToolEnd)==null||F.call(ie,N.name,N.output);break}case"chat_turn_end":{const N=m;(j=(Z=o.current).onChatTurnEnd)==null||j.call(Z,N.cost_usd);break}case"chat_rate_limit":{const N=m;(O=(_=o.current).onChatRateLimit)==null||O.call(_,N.resetsAt);break}}},S.onclose=()=>{n.current=null,s.current&&r.current<Zx&&(r.current++,setTimeout(w,qx))},S.onerror=g=>{console.error("[WS] WebSocket error:",g)}},[e]);return p.useEffect(()=>(s.current=!0,w(),()=>{var v;s.current=!1,(v=n.current)==null||v.close(),n.current=null}),[w]),{subscribeTerminal:l,sendTerminalInput:c,sendTerminalResize:d,subscribeChatMessages:u,sendChatInput:f,sendChatInterrupt:y}}function dM(e){const t=p.useRef(null),n=p.useRef(0),r=p.useRef(!0),s=p.useRef(e);s.current=e;const o=p.useCallback(()=>{if(!r.current)return;const i=ur();if(!i)return;const a=new WebSocket(`${Qx}/ws/dashboard`);t.current=a,a.onopen=()=>{n.current=0,a.send(JSON.stringify({type:"auth",token:i}))},a.onmessage=l=>{try{const c=JSON.parse(l.data);c.type==="activity_update"&&s.current.onActivityUpdate(c)}catch{}},a.onclose=()=>{t.current=null,r.current&&n.current<Zx&&(n.current++,setTimeout(o,qx))},a.onerror=l=>{console.error("[DashboardWS] Error:",l)}},[]);p.useEffect(()=>(r.current=!0,o(),()=>{var i;r.current=!1,(i=t.current)==null||i.close(),t.current=null}),[o])}function fM(e){if(!e)return"";const t=new Date(e).getTime()-Date.now();if(t<=0)return"即将重置";const n=Math.floor(t/36e5),r=Math.floor(t%36e5/6e4);return n>0?`${n}h${r}m`:`${r}m`}const xm=5*36e5;function hM(e){if(!e||e.utilization===void 0||e.utilization<=0||!e.resetAt)return null;const t=new Date(e.resetAt).getTime()-Date.now();if(t<=0)return null;const n=xm-t;return n<=0?null:Math.round(e.utilization/(n/xm))}function qo({label:e,bucket:t}){if(!t||t.utilization===void 0)return null;const n=t.utilization,r=n<50?"text-green-400":n<80?"text-yellow-400":"text-red-400",s=fM(t.resetAt);return h.jsxs("span",{className:"text-muted-foreground whitespace-nowrap",children:[e," ",h.jsxs("span",{className:ee("font-medium",r),children:[n,"%"]}),s&&h.jsxs("span",{className:"text-muted-foreground/70 ml-0.5",children:["(",s,")"]})]})}function pM({className:e}){const[t,n]=p.useState("loading"),[r,s]=p.useState(!1);p.useEffect(()=>{const f=async()=>{try{n(await ax())}catch{n(null)}};f();const y=setInterval(()=>void f(),5*60*1e3);return()=>clearInterval(y)},[]);const o=async()=>{s(!0);try{n(await lx())}catch{n(null)}finally{s(!1)}};if(t==="loading"||!t)return null;const i=!!t.fiveHour,a=!!t.sevenDay,l=!!t.sevenDaySonnet,c=!!t.sevenDayOpus,d=i||a||l||c,u=hM(t.fiveHour);return h.jsxs("div",{className:ee("flex items-center gap-1.5 text-xs",e),children:[u!==null&&h.jsxs("span",{className:ee("font-medium",u<=100?"text-green-400":"text-orange-400"),title:`5h 使用进度:按当前速率,窗口结束时预计使用 ${u}%`,children:[u,"%"]}),t.planName&&h.jsx("span",{className:"font-medium text-foreground bg-muted border border-border px-2 py-0.5 rounded-full",children:t.planName}),d&&h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"text-muted-foreground/50",children:"|"}),h.jsx(qo,{label:"5h",bucket:t.fiveHour}),a&&h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"text-muted-foreground/50",children:"·"}),h.jsx(qo,{label:"7d",bucket:t.sevenDay})]}),l&&h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"text-muted-foreground/50",children:"·"}),h.jsx(qo,{label:"7d Sonnet",bucket:t.sevenDaySonnet})]}),c&&h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"text-muted-foreground/50",children:"·"}),h.jsx(qo,{label:"7d Opus",bucket:t.sevenDayOpus})]})]}),h.jsx("button",{onClick:()=>void o(),className:"text-muted-foreground hover:text-foreground transition-colors",title:"刷新用量信息",children:h.jsx(VN,{className:ee("h-3 w-3",r&&"animate-spin")})})]})}function mM(){const[e,t]=p.useState([]),[n,r]=p.useState(!1),[s,o]=p.useState(""),[i,a]=p.useState(""),[l,c]=p.useState(""),[d,u]=p.useState(null),[f,y]=p.useState(""),[w,v]=p.useState(""),[S,g]=p.useState(""),m=p.useRef(null),x=p.useRef(null);p.useEffect(()=>{rx().then(t).catch(()=>t([]))},[]),p.useEffect(()=>{n&&setTimeout(()=>{var k;return(k=m.current)==null?void 0:k.focus()},0)},[n]),p.useEffect(()=>{d&&setTimeout(()=>{var k;return(k=x.current)==null?void 0:k.focus()},0)},[d]);const E=async()=>{const k=i.trim();if(k)try{const b=await sx({label:s.trim()||k,command:k,...l?{parentId:l}:{}});t(A=>[...A,b]),o(""),a(""),c(""),r(!1)}catch(b){console.error("[GlobalShortcuts] Failed to add:",b)}},C=async k=>{try{await ix(k),t(b=>b.filter(A=>A.id!==k)),d===k&&u(null)}catch(b){console.error("[GlobalShortcuts] Failed to delete:",b)}},P=async()=>{const k=w.trim();if(!(!k||!d))try{const b=await ox(d,{label:f.trim()||k,command:k,parentId:S||null});t(A=>A.map(T=>T.id===d?b:T)),u(null)}catch(b){console.error("[GlobalShortcuts] Failed to save:",b)}};return h.jsxs("section",{className:"mt-10",children:[h.jsxs("div",{className:"flex items-center justify-between mb-4",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(nm,{className:"h-4 w-4 text-muted-foreground"}),h.jsx("h2",{className:"text-lg font-semibold",children:"全局快捷命令"}),h.jsx("span",{className:"text-xs text-muted-foreground",children:"在所有项目的终端中可用"})]}),h.jsxs("button",{onClick:()=>{r(k=>!k),u(null)},className:ee("flex items-center gap-1.5 text-sm px-3 py-1.5 rounded-md border transition-colors",n?"border-border text-foreground bg-muted":"border-border text-muted-foreground hover:text-foreground hover:bg-muted"),children:[h.jsx(oa,{className:"h-3.5 w-3.5"}),"新建"]})]}),n&&h.jsxs("div",{className:"mb-4 p-4 rounded-lg border border-border bg-background space-y-3",children:[h.jsx("input",{ref:m,placeholder:"名称(可选)",value:s,onChange:k=>o(k.target.value),className:"w-full text-sm bg-muted border border-border rounded px-3 py-1.5 text-foreground placeholder:text-muted-foreground outline-none focus:border-border transition-colors"}),h.jsx("textarea",{placeholder:"命令内容…",value:i,onChange:k=>a(k.target.value),rows:3,className:"w-full text-sm bg-muted border border-border rounded px-3 py-1.5 text-foreground placeholder:text-muted-foreground font-mono outline-none focus:border-border transition-colors resize-none",onKeyDown:k=>{k.key==="Enter"&&(k.metaKey||k.ctrlKey)&&(k.preventDefault(),E()),k.key==="Escape"&&(r(!1),o(""),a(""),c(""))}}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(Ol,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),h.jsxs("select",{value:l,onChange:k=>c(k.target.value),className:"flex-1 text-sm bg-muted border border-border rounded px-3 py-1.5 text-foreground outline-none focus:border-border transition-colors",children:[h.jsx("option",{value:"",children:"无继承"}),e.map(k=>h.jsx("option",{value:k.id,children:k.label},k.id))]})]}),h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("span",{className:"text-xs text-muted-foreground",children:"⌘↩ 保存 · Esc 取消"}),h.jsxs("div",{className:"flex gap-2",children:[h.jsx("button",{onClick:()=>{r(!1),o(""),a("")},className:"text-sm px-3 py-1 rounded bg-secondary hover:bg-accent text-foreground transition-colors",children:"取消"}),h.jsx("button",{onClick:()=>void E(),disabled:!i.trim(),className:ee("text-sm px-3 py-1 rounded transition-colors text-white",i.trim()?"bg-blue-600 hover:bg-blue-500":"bg-secondary opacity-40 cursor-not-allowed"),children:"保存"})]})]})]}),e.length===0&&!n?h.jsxs("div",{className:"flex flex-col items-center gap-2 py-10 text-muted-foreground/50 border border-dashed border-border rounded-lg",children:[h.jsx(nm,{className:"h-6 w-6"}),h.jsx("p",{className:"text-sm",children:"还没有全局快捷命令"})]}):h.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",children:e.map(k=>d===k.id?h.jsxs("div",{className:"rounded-lg border border-border bg-background p-3 space-y-2",children:[h.jsx("input",{ref:x,value:f,onChange:b=>y(b.target.value),placeholder:"名称(可选)",className:"w-full text-sm bg-muted border border-border rounded px-2.5 py-1 text-foreground placeholder:text-muted-foreground outline-none focus:border-border transition-colors"}),h.jsx("textarea",{value:w,onChange:b=>v(b.target.value),rows:3,className:"w-full text-sm bg-muted border border-border rounded px-2.5 py-1 text-foreground font-mono outline-none focus:border-border transition-colors resize-none",onKeyDown:b=>{b.key==="Enter"&&(b.metaKey||b.ctrlKey)&&(b.preventDefault(),P()),b.key==="Escape"&&u(null)}}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(Ol,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),h.jsxs("select",{value:S,onChange:b=>g(b.target.value),className:"flex-1 text-sm bg-muted border border-border rounded px-2.5 py-1 text-foreground outline-none focus:border-border transition-colors",children:[h.jsx("option",{value:"",children:"无继承"}),e.filter(b=>b.id!==k.id).map(b=>h.jsx("option",{value:b.id,children:b.label},b.id))]})]}),h.jsxs("div",{className:"flex gap-2 justify-end",children:[h.jsx("button",{onClick:()=>u(null),className:"text-xs px-2.5 py-1 rounded bg-secondary hover:bg-accent text-foreground transition-colors",children:"取消"}),h.jsx("button",{onClick:()=>void P(),disabled:!w.trim(),className:ee("text-xs px-2.5 py-1 rounded transition-colors text-white",w.trim()?"bg-blue-600 hover:bg-blue-500":"bg-secondary opacity-40 cursor-not-allowed"),children:"保存"})]})]},k.id):h.jsxs("div",{className:"group relative rounded-lg border border-border bg-background hover:border-muted-foreground/30 transition-colors p-3",children:[h.jsx("div",{className:"text-sm font-medium text-foreground truncate pr-14",children:k.label}),k.parentId&&(()=>{const b=e.find(A=>A.id===k.parentId);return b?h.jsxs("div",{className:"flex items-center gap-1 mt-1",children:[h.jsx(Ol,{className:"h-3 w-3 text-muted-foreground"}),h.jsxs("span",{className:"text-xs text-muted-foreground truncate",children:["继承: ",b.label]})]}):null})(),!k.parentId&&k.label!==k.command&&h.jsx("div",{className:"text-xs text-muted-foreground font-mono truncate mt-1 pr-14",children:k.command}),h.jsxs("div",{className:"absolute top-2.5 right-2.5 flex gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[h.jsx("button",{onClick:()=>{u(k.id),y(k.label),v(k.command),g(k.parentId||""),r(!1)},className:"p-1 rounded text-muted-foreground hover:text-blue-400 transition-colors",title:"编辑",children:h.jsx(fx,{className:"h-3.5 w-3.5"})}),h.jsx("button",{onClick:()=>void C(k.id),className:"p-1 rounded text-muted-foreground hover:text-red-400 transition-colors",title:"删除",children:h.jsx(qd,{className:"h-3.5 w-3.5"})})]})]},k.id))})]})}const Jx=p.createContext({theme:"system",resolved:"dark",setTheme:()=>{}});function gM(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function yM(){return p.useSyncExternalStore(e=>{const t=window.matchMedia("(prefers-color-scheme: dark)");return t.addEventListener("change",e),()=>t.removeEventListener("change",e)},()=>gM())}function vM({children:e}){const[t,n]=p.useState(()=>NP(Os.theme,"system")),r=yM(),s=t==="system"?r:t;p.useEffect(()=>{const i=document.documentElement;i.classList.remove("light","dark"),i.classList.add(s)},[s]);const o=i=>{n(i),K0(Os.theme,i)};return h.jsx(Jx.Provider,{value:{theme:t,resolved:s,setTheme:o},children:e})}function xM(){return p.useContext(Jx)}function wM(){const{theme:e,setTheme:t}=xM(),n=[{value:"light",icon:BN,label:"浅色"},{value:"dark",icon:IN,label:"深色"},{value:"system",icon:ON,label:"系统"}];return h.jsx("div",{className:"flex items-center rounded-md border border-border bg-muted/50 p-0.5",children:n.map(({value:r,icon:s,label:o})=>h.jsx("button",{onClick:()=>t(r),className:ee("p-1 rounded-sm transition-colors",e===r?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),title:o,children:h.jsx(s,{className:"h-3.5 w-3.5"})},r))})}function SM(){const e=Ta(),{projects:t,loading:n,error:r,fetchProjects:s,addProject:o,updateProject:i,removeProject:a}=LP(),l=sr(N=>N.clearToken),[c,d]=p.useState(!1),[u,f]=p.useState(!1),[y,w]=p.useState(new Set),v=p.useRef(new Map),[S,g]=p.useState(new Map),m=p.useRef(0),[x,E]=p.useState(!!document.fullscreenElement),[C,P]=p.useState(!1),k=()=>{document.fullscreenElement?document.exitFullscreen():document.documentElement.requestFullscreen()};p.useEffect(()=>{const N=()=>E(!!document.fullscreenElement);return document.addEventListener("fullscreenchange",N),()=>document.removeEventListener("fullscreenchange",N)},[]),p.useEffect(()=>{s()},[s]);const b=2e3,A=3,T=8e3,D=p.useCallback(N=>{const $=Date.now(),z=v.current;if($-N.lastActivityAt<b){w(W=>W.has(N.projectId)?W:new Set(W).add(N.projectId));const U=z.get(N.projectId)??[];let K=!1;if(N.semantic){const W=U[U.length-1],mt=`${N.semantic.phase}:${N.semantic.detail??""}`,cr=W?`${W.phase}:${W.detail??""}`:"";mt!==cr?(U.push({id:m.current++,phase:N.semantic.phase,detail:N.semantic.detail,ts:$}),K=!0):W&&(W.ts=$)}const q=U.filter(W=>$-W.ts<T),ve=q.length>A?q.slice(-A):q;ve.length!==U.length&&(K=!0),z.set(N.projectId,ve),K&&g(new Map(z))}else w(U=>{if(!U.has(N.projectId))return U;const K=new Set(U);return K.delete(N.projectId),K}),z.has(N.projectId)&&z.get(N.projectId).length>0&&(z.set(N.projectId,[]),g(new Map(z)))},[]);dM({onActivityUpdate:D}),p.useEffect(()=>{const N=setInterval(()=>{const $=Date.now(),z=v.current;let U=!1;for(const[K,q]of z){const ve=q.filter(W=>$-W.ts<T);ve.length!==q.length&&(z.set(K,ve),U=!0)}U&&g(new Map(z)),w(K=>{let q=!1;const ve=new Set(K);for(const W of K){const mt=z.get(W);(!mt||mt.length===0)&&(ve.delete(W),q=!0)}return q?ve:K})},3e3);return()=>clearInterval(N)},[]);const L=()=>{l(),e("/login")},X=N=>{o(N)},ne=N=>{o(N)},ie=async N=>{try{await ex(N),a(N)}catch($){Ei.error($ instanceof Error?$.message:"Failed to delete project")}},F=async N=>{try{const $=await tx(N);i($)}catch($){Ei.error($ instanceof Error?$.message:"Failed to archive project")}},Z=async N=>{try{const $=await nx(N);i($)}catch($){Ei.error($ instanceof Error?$.message:"Failed to restore project")}},j=p.useMemo(()=>t.filter(N=>!N.archived),[t]),_=p.useMemo(()=>t.filter(N=>N.archived),[t]),O={onDelete:N=>void ie(N),onArchive:N=>void F(N),onUnarchive:N=>void Z(N),onUpdated:i};return h.jsxs("div",{className:"min-h-screen bg-background",children:[h.jsx("header",{className:"border-b sticky top-0 bg-background z-10",children:h.jsxs("div",{className:"max-w-6xl mx-auto px-4 h-14 flex items-center justify-between",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(fc,{className:"h-5 w-5"}),h.jsx("span",{className:"font-semibold text-lg",children:"CC Web"})]}),h.jsx(pM,{}),h.jsx(se,{variant:"ghost",size:"sm",onClick:()=>e("/skillhub"),title:"SkillHub",children:h.jsx(zN,{className:"h-4 w-4"})}),h.jsx(se,{variant:"ghost",size:"sm",onClick:()=>e("/settings"),title:"设置",children:h.jsx(FN,{className:"h-4 w-4"})}),h.jsx(se,{variant:"ghost",size:"sm",onClick:k,title:x?"Exit fullscreen":"Fullscreen",children:x?h.jsx(_N,{className:"h-4 w-4"}):h.jsx(DN,{className:"h-4 w-4"})}),h.jsx(wM,{}),h.jsxs(se,{variant:"ghost",size:"sm",onClick:L,children:[h.jsx(AN,{className:"h-4 w-4 mr-2"}),"Logout"]})]})}),h.jsxs("main",{className:"max-w-6xl mx-auto px-4 py-8",children:[h.jsxs("div",{className:"flex items-center justify-between mb-6",children:[h.jsxs("div",{children:[h.jsx("h1",{className:"text-2xl font-bold",children:"Projects"}),h.jsx("p",{className:"text-muted-foreground text-sm mt-1",children:"Each project runs Claude CLI in a dedicated terminal session."})]}),h.jsxs("div",{className:"flex gap-2",children:[h.jsxs(se,{variant:"outline",onClick:()=>f(!0),children:[h.jsx(dc,{className:"h-4 w-4 mr-2"}),"Open Project"]}),h.jsxs(se,{onClick:()=>d(!0),children:[h.jsx(oa,{className:"h-4 w-4 mr-2"}),"New Project"]})]})]}),n&&h.jsx("div",{className:"text-center text-muted-foreground py-12",children:"Loading projects..."}),r&&h.jsx("div",{className:"text-center text-destructive py-12",children:r}),!n&&!r&&t.length===0&&h.jsxs("div",{className:"text-center py-20",children:[h.jsx(fc,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),h.jsx("h2",{className:"text-lg font-semibold mb-2",children:"No projects yet"}),h.jsx("p",{className:"text-muted-foreground text-sm mb-6",children:"Create a new project or open an existing one."}),h.jsxs("div",{className:"flex gap-2 justify-center",children:[h.jsxs(se,{variant:"outline",onClick:()=>f(!0),children:[h.jsx(dc,{className:"h-4 w-4 mr-2"}),"Open Project"]}),h.jsxs(se,{onClick:()=>d(!0),children:[h.jsx(oa,{className:"h-4 w-4 mr-2"}),"New Project"]})]})]}),!n&&!r&&j.length>0&&h.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:j.map((N,$)=>h.jsx(Cn.div,{initial:{opacity:0,y:16},animate:{opacity:1,y:0},transition:{duration:.3,delay:$*.05,ease:"easeOut"},children:h.jsx(mm,{project:N,active:y.has(N.id),statusStack:S.get(N.id)??[],...O})},N.id))}),!n&&!r&&_.length>0&&h.jsxs("div",{className:"mt-10",children:[h.jsxs("button",{className:"flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground transition-colors mb-4 group",onClick:()=>P(N=>!N),children:[h.jsx(Cn.span,{animate:{rotate:C?90:0},transition:{duration:.2},children:h.jsx(dx,{className:"h-4 w-4"})}),h.jsx("span",{className:"font-medium",children:"Archived"}),h.jsx("span",{className:"text-xs bg-muted rounded-full px-2 py-0.5",children:_.length})]}),h.jsx($d,{children:C&&h.jsx(Cn.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.25,ease:"easeInOut"},className:"overflow-hidden",children:h.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:_.map(N=>h.jsx(mm,{project:N,active:!1,...O},N.id))})})})]}),h.jsx(mM,{})]}),h.jsx(OR,{open:c,onOpenChange:d,onCreated:X}),h.jsx(IR,{open:u,onOpenChange:f,onOpened:ne})]})}class EM extends R.Component{constructor(){super(...arguments);Wa(this,"state",{hasError:!1,error:null});Wa(this,"handleReset",()=>{var n,r;this.setState({hasError:!1,error:null}),(r=(n=this.props).onReset)==null||r.call(n)})}static getDerivedStateFromError(n){return{hasError:!0,error:n}}componentDidCatch(n,r){console.error("[ErrorBoundary]",n,r.componentStack),Ei.error(n.message||"Something went wrong")}render(){return this.state.hasError?this.props.fallback?this.props.fallback:h.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-3 p-4 text-sm text-muted-foreground",children:[h.jsx("p",{children:"出错了"}),h.jsx("button",{onClick:this.handleReset,className:"px-3 py-1.5 text-xs rounded-md border border-border hover:bg-muted transition-colors",children:"重新加载"})]}):this.props.children}}const kM=R.lazy(()=>Ca(()=>import("./ProjectPage-BN_FRfFU.js").then(e=>e.P),__vite__mapDeps([0,1,2,3,4])).then(e=>({default:e.ProjectPage}))),CM=R.lazy(()=>Ca(()=>import("./SettingsPage-BXHs7CzQ.js"),__vite__mapDeps([5,1,2])).then(e=>({default:e.SettingsPage}))),bM=R.lazy(()=>Ca(()=>import("./SkillHubPage-BbdcHgdn.js"),__vite__mapDeps([6,3,2])).then(e=>({default:e.SkillHubPage})));function TM(){return h.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background",children:h.jsx("span",{className:"text-muted-foreground text-sm",children:"Loading…"})})}function Jo({children:e}){const[t,n]=p.useState(!1),r=sr(o=>o.token),s=sr(o=>o.setToken);return p.useEffect(()=>{if(r){n(!0);return}sa()?Zd().then(o=>s(o)).catch(()=>{}).finally(()=>n(!0)):n(!0)},[]),!t&&!r?null:r?h.jsx(h.Fragment,{children:e}):h.jsx(Gy,{to:"/login",replace:!0})}function PM(){return h.jsxs(vM,{children:[h.jsx(cM,{richColors:!0,position:"bottom-right"}),h.jsx(EM,{children:h.jsx(_E,{children:h.jsx(p.Suspense,{fallback:h.jsx(TM,{}),children:h.jsxs(AE,{children:[h.jsx(Fn,{path:"/login",element:h.jsx(SN,{})}),h.jsx(Fn,{path:"/",element:h.jsx(Jo,{children:h.jsx(SM,{})})}),h.jsx(Fn,{path:"/projects/:id",element:h.jsx(Jo,{children:h.jsx(kM,{})})}),h.jsx(Fn,{path:"/settings",element:h.jsx(Jo,{children:h.jsx(CM,{})})}),h.jsx(Fn,{path:"/skillhub",element:h.jsx(Jo,{children:h.jsx(bM,{})})}),h.jsx(Fn,{path:"*",element:h.jsx(Gy,{to:"/",replace:!0})})]})})})})]})}Hl.createRoot(document.getElementById("root")).render(h.jsx(R.StrictMode,{children:h.jsx(PM,{})}));export{lr as $,$d as A,Fa as B,dx as C,nf as D,NN as E,dc as F,Ol as G,za as H,ra as I,Va as J,se as K,mn as L,_N as M,HP as N,WP as O,fx as P,YP as Q,R,Os as S,zP as T,BP as U,Aa as V,XN as W,qd as X,Il as Y,nm as Z,Ca as _,RM as a,qt as a0,bn as a1,Da as a2,xx as a3,WN as a4,dR as a5,Px as a6,bj as a7,yx as a8,mx as a9,Kd as aA,Yd as aB,Xd as aC,hx as aD,rN as aE,lN as aF,cN as aG,fN as aH,oN as aI,dN as aJ,uN as aK,io as aL,dd as aM,PN as aN,KP as aO,XP as aP,MM as aQ,hN as aa,mN as ab,pN as ac,yN as ad,Ta as ae,TN as af,Bn as ag,pM as ah,wM as ai,vN as aj,fc as ak,LN as al,aN as am,xN as an,VP as ao,FP as ap,gN as aq,LM as ar,OM as as,AM as at,LP as au,ao as av,nN as aw,sN as ax,iN as ay,Gd as az,ur as b,te as c,qP as d,ee as e,DN as f,wm as g,QP as h,NP as i,h as j,ux as k,VN as l,ZP as m,tm as n,Cn as o,UP as p,rx as q,p as r,K0 as s,Ei as t,xM as u,oa as v,JP as w,GP as x,Oa as y,Ia as z};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{g as Ot,a as vt}from"./index-
|
|
1
|
+
import{g as Ot,a as vt}from"./index-JDBiQrHY.js";function Bt(ct,wt){for(var _=0;_<wt.length;_++){const N=wt[_];if(typeof N!="string"&&!Array.isArray(N)){for(const w in N)if(w!=="default"&&!(w in ct)){const u=Object.getOwnPropertyDescriptor(N,w);u&&Object.defineProperty(ct,w,u.get?u:{enumerable:!0,get:()=>N[w]})}}}return Object.freeze(Object.defineProperty(ct,Symbol.toStringTag,{value:"Module"}))}function yt(ct){throw new Error('Could not dynamically require "'+ct+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var zt={exports:{}};/*!
|
|
2
2
|
|
|
3
3
|
JSZip v3.10.1 - A JavaScript class for generating and reading zip files
|
|
4
4
|
<http://stuartk.com/jszip>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as Dt,r as a,aL as J,$ as K,W as tt,j as y,a0 as F,a1 as z,a4 as Fe,e as re,V as jt,R as ge,aM as ft,av as Lt,Y as dt,a3 as to,a5 as no,a7 as oo,a6 as ro,a8 as so,a9 as io,aN as co}from"./index-
|
|
1
|
+
import{c as Dt,r as a,aL as J,$ as K,W as tt,j as y,a0 as F,a1 as z,a4 as Fe,e as re,V as jt,R as ge,aM as ft,av as Lt,Y as dt,a3 as to,a5 as no,a7 as oo,a6 as ro,a8 as so,a9 as io,aN as co}from"./index-JDBiQrHY.js";import{C as kt}from"./chevron-down-cL1veBn_.js";/**
|
|
2
2
|
* @license lucide-react v0.309.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
package/frontend/dist/index.html
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
<link rel="icon" type="image/svg+xml" href="/terminal.svg" />
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
7
|
<title>CC Web</title>
|
|
8
|
-
<script type="module" crossorigin src="/assets/index-
|
|
9
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
8
|
+
<script type="module" crossorigin src="/assets/index-JDBiQrHY.js"></script>
|
|
9
|
+
<link rel="stylesheet" crossorigin href="/assets/index-CKhjWK5m.css">
|
|
10
10
|
</head>
|
|
11
11
|
<body>
|
|
12
12
|
<div id="root"></div>
|