@geminilight/mindos 0.6.34 → 0.6.36
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/.env.local.example +2 -2
- package/_standalone/.mindos-build-version +1 -1
- package/_standalone/.next/BUILD_ID +1 -1
- package/_standalone/.next/app-path-routes-manifest.json +15 -15
- package/_standalone/.next/build-manifest.json +2 -2
- package/_standalone/.next/cache/.previewinfo +1 -1
- package/_standalone/.next/cache/.rscinfo +1 -1
- package/_standalone/.next/cache/config.json +3 -3
- package/_standalone/.next/prerender-manifest.json +3 -3
- package/_standalone/.next/server/app/.well-known/agent-card.json/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/_global-error.html +2 -2
- package/_standalone/.next/server/app/_global-error.rsc +1 -1
- package/_standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/_standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/_standalone/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/_standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/_standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/_standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/_standalone/.next/server/app/_not-found/page.js +1 -1
- package/_standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/_standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/agents/[agentKey]/page.js +1 -1
- package/_standalone/.next/server/app/agents/[agentKey]/page.js.nft.json +1 -1
- package/_standalone/.next/server/app/agents/[agentKey]/page_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/agents/page.js +1 -1
- package/_standalone/.next/server/app/agents/page.js.nft.json +1 -1
- package/_standalone/.next/server/app/agents/page_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/a2a/agents/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/a2a/delegations/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/a2a/discover/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/a2a/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/acp/config/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/acp/detect/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/acp/install/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/acp/registry/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/acp/session/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/agent-activity/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/ask/route.js +5 -5
- package/_standalone/.next/server/app/api/ask/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/ask-sessions/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/auth/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/backlinks/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/bootstrap/route.js +1 -1
- package/_standalone/.next/server/app/api/bootstrap/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/changes/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/export/route.js +1 -1
- package/_standalone/.next/server/app/api/export/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/extract-pdf/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/file/import/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/file/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/files/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/git/route.js +1 -1
- package/_standalone/.next/server/app/api/git/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/graph/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/health/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/init/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/mcp/agents/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/mcp/install/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/mcp/install-skill/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/mcp/restart/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/mcp/status/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/monitoring/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/recent-files/route.js +1 -1
- package/_standalone/.next/server/app/api/recent-files/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/restart/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/search/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/settings/list-models/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/settings/reset-token/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/settings/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/settings/test-key/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/setup/check-path/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/setup/check-port/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/setup/generate-token/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/setup/ls/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/setup/route.js +1 -1
- package/_standalone/.next/server/app/api/setup/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/skills/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/sync/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/tree-version/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/uninstall/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/update/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/update-check/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/update-status/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/workflows/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/changes/page.js +1 -1
- package/_standalone/.next/server/app/changes/page.js.nft.json +1 -1
- package/_standalone/.next/server/app/changes/page_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/echo/[segment]/page.js +1 -1
- package/_standalone/.next/server/app/echo/[segment]/page.js.nft.json +1 -1
- package/_standalone/.next/server/app/echo/[segment]/page_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/echo/page.js +1 -1
- package/_standalone/.next/server/app/echo/page.js.nft.json +1 -1
- package/_standalone/.next/server/app/echo/page_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/explore/page.js +1 -1
- package/_standalone/.next/server/app/explore/page.js.nft.json +1 -1
- package/_standalone/.next/server/app/explore/page_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/help/page.js +1 -1
- package/_standalone/.next/server/app/help/page.js.nft.json +1 -1
- package/_standalone/.next/server/app/help/page_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/login/page.js +1 -1
- package/_standalone/.next/server/app/login/page.js.nft.json +1 -1
- package/_standalone/.next/server/app/login/page_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/page.js +1 -1
- package/_standalone/.next/server/app/page.js.nft.json +1 -1
- package/_standalone/.next/server/app/page_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/setup/page.js +2 -2
- package/_standalone/.next/server/app/setup/page.js.nft.json +1 -1
- package/_standalone/.next/server/app/setup/page_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/trash/page.js +3 -3
- package/_standalone/.next/server/app/trash/page_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/view/[...path]/page.js +2 -2
- package/_standalone/.next/server/app/view/[...path]/page.js.nft.json +1 -1
- package/_standalone/.next/server/app/view/[...path]/page_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app-paths-manifest.json +15 -15
- package/_standalone/.next/server/chunks/4931.js +27 -27
- package/_standalone/.next/server/chunks/6539.js +1 -1
- package/_standalone/.next/server/chunks/7670.js +1 -1
- package/_standalone/.next/server/chunks/{1225.js → 9360.js} +2 -2
- package/_standalone/.next/server/pages/500.html +2 -2
- package/_standalone/.next/server/server-reference-manifest.js +1 -1
- package/_standalone/.next/server/server-reference-manifest.json +1 -1
- package/_standalone/.next/static/chunks/{1263-31c1efe3fd8f3f99.js → 1263-79beb8734dee7bbd.js} +2 -2
- package/_standalone/.next/static/chunks/app/{layout-1ad561312a9a5b5b.js → layout-d0f6dc4d3e6f0be4.js} +11 -11
- package/_standalone/.next/static/chunks/app/{page-e2a6e96831efa703.js → page-404b0bfb5721b7f8.js} +2 -2
- package/_standalone/.next/static/chunks/app/setup/page-01ab1f549d636057.js +1 -0
- package/_standalone/.next/static/chunks/app/trash/{page-c6e9de9ca4ab4bf7.js → page-a79804c1df44d3cc.js} +1 -1
- package/_standalone/.next/static/chunks/app/view/[...path]/{page-ff57a587c3f5490e.js → page-d3aceca36a1a9eb2.js} +2 -2
- package/_standalone/.next/trace +53 -53
- package/_standalone/components/SyncStatusBar.tsx +1 -1
- package/_standalone/components/TableOfContents.tsx +7 -0
- package/_standalone/components/setup/StepAI.tsx +66 -3
- package/_standalone/components/setup/StepDots.tsx +18 -10
- package/_standalone/components/setup/StepKB.tsx +26 -0
- package/_standalone/components/setup/constants.tsx +4 -3
- package/_standalone/data/skills/mindos/SKILL.md +4 -22
- package/_standalone/data/skills/mindos-zh/SKILL.md +2 -20
- package/_standalone/lib/agent/context.ts +29 -20
- package/_standalone/lib/i18n/modules/onboarding.ts +14 -6
- package/_standalone/tsconfig.tsbuildinfo +1 -1
- package/app/app/api/ask/route.ts +77 -24
- package/app/app/api/bootstrap/route.ts +4 -0
- package/app/app/api/export/route.ts +5 -0
- package/app/app/api/git/route.ts +2 -1
- package/app/app/api/recent-files/route.ts +3 -2
- package/app/app/api/setup/route.ts +1 -0
- package/app/components/SyncStatusBar.tsx +1 -1
- package/app/components/TableOfContents.tsx +7 -0
- package/app/components/setup/StepAI.tsx +66 -3
- package/app/components/setup/StepDots.tsx +18 -10
- package/app/components/setup/StepKB.tsx +26 -0
- package/app/components/setup/constants.tsx +4 -3
- package/app/components/setup/index.tsx +22 -32
- package/app/data/skills/mindos/SKILL.md +4 -22
- package/app/data/skills/mindos-zh/SKILL.md +2 -20
- package/app/lib/acp/subprocess.ts +3 -2
- package/app/lib/agent/context.ts +29 -20
- package/app/lib/fs.ts +77 -0
- package/app/lib/i18n/modules/onboarding.ts +14 -6
- package/app/lib/settings.ts +6 -0
- package/bin/cli.js +14 -4
- package/bin/lib/stop.js +5 -2
- package/package.json +6 -2
- package/scripts/setup.js +16 -0
- package/skills/mindos/SKILL.md +4 -22
- package/skills/mindos/references/write-supplement.md +35 -0
- package/skills/mindos-zh/SKILL.md +2 -20
- package/skills/mindos-zh/references/README.md +2 -1
- package/skills/mindos-zh/references/write-supplement.md +35 -0
- package/_standalone/.next/static/chunks/app/setup/page-f8a85accc3be554f.js +0 -1
- /package/_standalone/.next/static/{K1Y12u2jxCR7efUgJVpyl → VWZDVb8DL1Pbykh9EOj_Y}/_buildManifest.js +0 -0
- /package/_standalone/.next/static/{K1Y12u2jxCR7efUgJVpyl → VWZDVb8DL1Pbykh9EOj_Y}/_ssgManifest.js +0 -0
package/_standalone/.next/static/chunks/app/{page-e2a6e96831efa703.js → page-404b0bfb5721b7f8.js}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8974],{4235:(e,t,s)=>{"use strict";s.d(t,{B1:()=>l,X8:()=>d,dV:()=>o,oR:()=>m});let r=[],n=[],a=0;function i(){for(let e of n)e()}function l(e){return n=[...n,e],()=>{n=n.filter(t=>t!==e)}}function o(){return r}function d(e){r=r.filter(t=>t.id!==e),i()}function c(e){let t=`toast-${++a}`,s={id:t,message:e.message,type:e.type??"info",duration:e.duration??2e3,action:e.action};r=[...r,s].slice(-3),i(),s.duration>0&&setTimeout(()=>d(t),s.duration)}function m(e,t){c({message:e,...t})}m.success=(e,t)=>c({message:e,type:"success",duration:t}),m.undo=(e,t,s)=>c({message:e,type:"info",duration:s?.duration??5e3,action:{label:s?.label??"Undo",onClick:t}}),m.error=(e,t)=>c({message:e,type:"error",duration:t}),m.copy=(e="Copied")=>c({message:e,type:"success",duration:1500})},7834:(e,t,s)=>{"use strict";async function r(e){if(navigator.clipboard?.writeText)try{return await navigator.clipboard.writeText(e),!0}catch{}try{let t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t),t.select();let s=document.execCommand("copy");return document.body.removeChild(t),s}catch{return!1}}s.d(t,{l:()=>r})},9930:(e,t,s)=>{"use strict";s.d(t,{Ay:()=>d,cd:()=>o,kr:()=>l});var r=s(95155),n=s(12115),a=s(22356);let i=(0,n.createContext)(null);function l(){let e=(0,n.useContext)(i);if(!e)throw Error("useMcpData must be used within McpProvider");return e}function o(){return(0,n.useContext)(i)}function d({children:e}){let[t,s]=(0,n.useState)(null),[l,o]=(0,n.useState)([]),[d,c]=(0,n.useState)([]),[m,u]=(0,n.useState)(!0),x=(0,n.useRef)(null),p=(0,n.useRef)(l);p.current=l;let h=(0,n.useCallback)(async()=>{x.current?.abort();let e=new AbortController;x.current=e;try{let[t,r,n]=await Promise.all([(0,a.n)("/api/mcp/status",{signal:e.signal}),(0,a.n)("/api/mcp/agents",{signal:e.signal}),(0,a.n)("/api/skills",{signal:e.signal})]);e.signal.aborted||(s(t),o(r.agents),c(n.skills))}catch(e){if(e instanceof DOMException&&"AbortError"===e.name)return}finally{e.signal.aborted||u(!1)}},[]);(0,n.useEffect)(()=>(h(),()=>x.current?.abort()),[h]),(0,n.useEffect)(()=>{let e,t=()=>{clearTimeout(e),e=setTimeout(()=>h(),500)};return window.addEventListener("mindos:skills-changed",t),()=>{clearTimeout(e),window.removeEventListener("mindos:skills-changed",t)}},[h]),(0,n.useEffect)(()=>{let e;return e=setInterval(()=>{"visible"===document.visibilityState&&h()},3e4),()=>clearInterval(e)},[h]);let f=(0,n.useCallback)(async()=>{await h()},[h]),g=(0,n.useCallback)(async(e,t)=>{c(s=>s.map(s=>s.name===e?{...s,enabled:t}:s));try{return await (0,a.n)("/api/skills",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"toggle",name:e,enabled:t})}),!0}catch{return c(s=>s.map(s=>s.name===e?{...s,enabled:!t}:s)),!1}},[]),b=(0,n.useCallback)(async(e,t)=>{let s=p.current.find(t=>t.key===e);if(!s)return!1;try{let r=await (0,a.n)("/api/mcp/install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({agents:[{key:e,scope:t?.scope??(s.hasProjectScope?"project":"global"),transport:t?.transport??s.preferredTransport}],transport:"auto"})}),n=r.results?.[0],i=n?.ok===!0||n?.status==="ok";return i&&await h(),i}catch{return!1}},[h]),v=(0,n.useMemo)(()=>({status:t,agents:l,skills:d,loading:m,refresh:f,toggleSkill:g,installAgent:b}),[t,l,d,m,f,g,b]);return(0,r.jsx)(i.Provider,{value:v,children:e})}},10377:(e,t,s)=>{"use strict";s.d(t,{Z:()=>h});var r=s(12115);let n="mindos-pinned-files",a="mindos:pins-changed";function i(){try{let e=localStorage.getItem(n);return e?JSON.parse(e):[]}catch{return[]}}function l(){return c}let o=[];function d(){return o}let c=[],m=!1;function u(){m||(c=i(),m=!0)}function x(e){u();let t=t=>{t.key===n&&(c=i(),e())},s=()=>{c=i(),e()};return window.addEventListener("storage",t),window.addEventListener(a,s),()=>{window.removeEventListener("storage",t),window.removeEventListener(a,s)}}function p(e){c=e;try{localStorage.setItem(n,JSON.stringify(e))}catch{}window.dispatchEvent(new Event(a))}function h(){u();let e=(0,r.useSyncExternalStore)(x,l,d),t=(0,r.useCallback)(t=>e.includes(t),[e]),s=(0,r.useCallback)(e=>{let t=i(),s=t.indexOf(e);s>=0?t.splice(s,1):t.unshift(e),p(t)},[]);return{pinnedFiles:e,isPinned:t,togglePin:s,reorderPins:(0,r.useCallback)(e=>{p(e)},[]),removePin:(0,r.useCallback)(e=>{p(i().filter(t=>t!==e))},[])}}},14153:(e,t,s)=>{Promise.resolve().then(s.bind(s,72471))},22356:(e,t,s)=>{"use strict";s.d(t,{h:()=>r,n:()=>n});class r extends Error{constructor(e,t,s){super(e),this.name="ApiError",this.status=t,this.code=s}}async function n(e,t={}){let s,a,i,{timeout:l=3e4,signal:o,...d}=t;if((l>0||o)&&(s=new AbortController),l>0&&s&&(a=setTimeout(()=>s.abort(),l)),o&&s)if(o.aborted)s.abort();else{let e=()=>s?.abort();o.addEventListener("abort",e,{once:!0}),i=()=>{o.removeEventListener("abort",e)}}let c=s?.signal??o;try{let t=await fetch(e,{...d,signal:c});if(!t.ok){let e,s=`Request failed (${t.status})`;try{let r=await t.json();r?.error?.code&&r?.error?.message?(s=r.error.message,e=r.error.code):r?.error&&(s="string"==typeof r.error?r.error:r.error.message??s)}catch{}throw new r(s,t.status,e)}return await t.json()}finally{a&&clearTimeout(a),i&&i()}}},27318:(e,t,s)=>{"use strict";s.d(t,{KT:()=>c,NH:()=>d});var r=s(12115);let n={open:!1,initialMessage:"",source:"user",acpAgent:null},a=new Set;function i(){a.forEach(e=>e())}function l(e){return a.add(e),()=>{a.delete(e)}}function o(){return n}function d(e="",t="user",s=null){n={open:!0,initialMessage:e,source:t,acpAgent:s},i()}function c(){let e=(0,r.useSyncExternalStore)(l,o,o);return{open:e.open,initialMessage:e.initialMessage,source:e.source,acpAgent:e.acpAgent,openWith:(0,r.useCallback)((e,t="user",s=null)=>d(e,t,s),[]),close:(0,r.useCallback)(()=>void(n={open:!1,initialMessage:"",source:"user",acpAgent:null},i()),[])}}},35803:(e,t,s)=>{"use strict";s.d(t,{E:()=>n});var r=s(9339);let n=(0,r.createServerReference)("0011d27580daac8e97a9a30de0a0dbd41d2888c561",r.callServer,void 0,r.findSourceMapURL,"cleanupExamplesAction")},44155:(e,t,s)=>{"use strict";s.d(t,{D:()=>n});var r=s(9339);let n=(0,r.createServerReference)("00cbda9fea7f35d1946f5ed8bd099276785a6946a1",r.callServer,void 0,r.findSourceMapURL,"scanExampleFilesAction")},72471:(e,t,s)=>{"use strict";s.d(t,{default:()=>eo});var r=s(95155),n=s(98500),a=s.n(n),i=s(66088),l=s(33078),o=s(48368),d=s(86901),c=s(61878),m=s(93631),u=s(21628),x=s(90718),p=s(38798),h=s(84980),f=s(50538),g=s(94290),b=s(33210),v=s(51914),j=s(94514),N=s(6296),y=s(68459),w=s(12115),k=s(61263),A=s(91337),C=s(10377),E=s(73321),S=s(92451),z=s(97810),T=s(13545),L=s(31025);let M=[{id:"en",icon:(0,r.jsx)(S.A,{size:20}),dirs:["Profile/","Connections/","Notes/","Workflows/","Resources/","Projects/"]},{id:"zh",icon:(0,r.jsx)(z.A,{size:20}),dirs:["画像/","关系/","笔记/","流程/","资源/","项目/"]},{id:"empty",icon:(0,r.jsx)(o.A,{size:20}),dirs:["README.md","CONFIG.json","INSTRUCTION.md"]}];function D(){let{t:e}=(0,k.Y)(),t=(0,E.useRouter)(),[s,n]=(0,w.useState)(null),[a,i]=(0,w.useState)(null),l=e.onboarding;async function o(e){n(e),i(null);try{let s=await fetch("/api/init",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({template:e})});if(!s.ok){let e=await s.json().catch(()=>({}));throw Error(e.error||`HTTP ${s.status}`)}t.refresh()}catch(e){console.error("[Onboarding] init failed:",e),i(e instanceof Error?e.message:"Unknown error"),n(null)}}return(0,r.jsxs)("div",{className:"content-width px-4 md:px-6 py-12 md:py-20",children:[(0,r.jsxs)("div",{className:"text-center mb-10",children:[(0,r.jsxs)("div",{className:"inline-flex items-center gap-2 mb-4",children:[(0,r.jsx)(d.A,{size:18,className:"text-[var(--amber)]"}),(0,r.jsx)("h1",{className:"text-2xl font-semibold tracking-tight font-display text-foreground",children:"MindOS"})]}),(0,r.jsx)("p",{className:"text-sm leading-relaxed max-w-md mx-auto text-muted-foreground",children:l.subtitle})]}),a&&(0,r.jsxs)("div",{role:"alert",className:"max-w-2xl mx-auto mb-6 flex items-center gap-2.5 px-4 py-3 rounded-lg border border-destructive/30 bg-destructive/5 text-sm text-destructive",children:[(0,r.jsx)(T.A,{size:16,className:"shrink-0"}),(0,r.jsx)("span",{className:"flex-1",children:l.initError??"Initialization failed. Please try again."}),(0,r.jsx)("button",{onClick:()=>i(null),className:"text-xs underline shrink-0 hover:opacity-80",children:l.dismiss??"Dismiss"})]}),(0,r.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4 max-w-2xl mx-auto mb-10",children:M.map(t=>{let n=s===t.id,a=null!==s;return(0,r.jsxs)("button",{disabled:a,title:a?e.hints.templateInitializing:void 0,onClick:()=>o(t.id),className:"group relative flex flex-col items-start gap-3 p-5 rounded-xl border border-border bg-card text-left transition-all duration-150 hover:border-[var(--amber)]/50 hover:bg-[var(--amber)]/5 disabled:opacity-60 disabled:cursor-not-allowed",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2.5 w-full",children:[(0,r.jsx)("span",{className:"text-[var(--amber)]",children:t.icon}),(0,r.jsx)("span",{className:"text-sm font-semibold text-foreground",children:l.templates[t.id].title}),n&&(0,r.jsx)(N.A,{size:14,className:"animate-spin ml-auto text-[var(--amber)]"})]}),(0,r.jsx)("p",{className:"text-xs leading-relaxed text-muted-foreground",children:l.templates[t.id].desc}),(0,r.jsx)("div",{className:"w-full rounded-lg px-3 py-2 text-xs leading-relaxed font-display bg-muted text-muted-foreground opacity-80",children:t.dirs.map(e=>(0,r.jsx)("div",{children:e},e))})]},t.id)})}),(0,r.jsx)("p",{className:"text-center text-xs leading-relaxed max-w-sm mx-auto font-display text-muted-foreground opacity-60",children:l.importHint}),(0,r.jsx)("p",{className:"text-center mt-2",children:(0,r.jsx)("button",{type:"button",onClick:()=>window.dispatchEvent(new CustomEvent("mindos:open-import")),className:"text-xs text-[var(--amber-text)] hover:underline transition-colors",children:e.fileImport.onboardingHint})}),(0,r.jsxs)("div",{className:"max-w-md mx-auto mt-6 flex items-center gap-3 px-4 py-3 rounded-lg border border-border bg-card text-left",children:[(0,r.jsx)(L.A,{size:16,className:"text-muted-foreground shrink-0"}),(0,r.jsx)("div",{className:"min-w-0",children:(0,r.jsxs)("p",{className:"text-xs text-muted-foreground",children:[l.syncHint??"Want cross-device sync? Run"," ",(0,r.jsx)("code",{className:"font-mono px-1 py-0.5 rounded select-all bg-muted text-[11px]",children:"mindos sync init"})," ",l.syncHintSuffix??"in the terminal after setup."]})})]})]})}var P=s(21362),I=s(21975),O=s(92564),H=s(22164),$=s(67635),W=s(7834),R=s(4235),F=s(27318),K=s(76449);function _(){let{t:e}=(0,k.Y)(),t=e.guide,[s,n]=(0,w.useState)(null),[i,l]=(0,w.useState)(null),[o,c]=(0,w.useState)(!1),[m,u]=(0,w.useState)(!1),x=(0,w.useCallback)(()=>{fetch("/api/setup").then(e=>e.json()).then(e=>{let t=e.guideState;t?.active&&!t.dismissed?n(t):n(null)}).catch(e=>{console.warn("[GuideCard] Fetch guide state failed:",e)})},[]);(0,w.useEffect)(()=>{x();let e=()=>{c(!0)};window.addEventListener("mindos:first-visit",e);let t=()=>x();return window.addEventListener("focus",t),window.addEventListener("guide-state-updated",t),()=>{window.removeEventListener("mindos:first-visit",e),window.removeEventListener("focus",t),window.removeEventListener("guide-state-updated",t)}},[x]);let p=(0,w.useCallback)(e=>{n(t=>t?{...t,...e}:t),fetch("/api/setup",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({guideState:e})}).catch(e=>{console.warn("[GuideCard] PATCH guide state failed:",e)})},[]),h=(0,w.useCallback)(()=>{p({dismissed:!0}),n(null)},[p]),f=(0,w.useCallback)(()=>{window.dispatchEvent(new CustomEvent("mindos:open-import"))},[]),g=(0,w.useCallback)(()=>{p({step1Done:!0}),l(null)},[p]);(0,w.useEffect)(()=>{if(!s||s.step1Done)return;let e=()=>p({step1Done:!0});return window.addEventListener("mindos:files-changed",e),()=>window.removeEventListener("mindos:files-changed",e)},[s,s?.step1Done,p]);let v=(0,w.useCallback)(()=>{let e=s?.template==="empty"?t.ai.promptEmpty:t.ai.prompt;(0,F.NH)(e,"guide")},[s,t]),j=(0,w.useCallback)(async()=>{await (0,W.l)(t.agent.copyPrompt)&&R.oR.copy()},[t]),N=(0,w.useCallback)(()=>{u(!0),l(null),p({nextStepIndex:0})},[p]),y=(0,w.useCallback)(()=>{if(!s)return;let e=s.nextStepIndex,r=t.done.steps;e<r.length&&((0,F.NH)(r[e].prompt,"guide-next"),p({nextStepIndex:e+1}))},[s,t,p]);(0,w.useEffect)(()=>{o&&s&&!s.step1Done&&l("import")},[o,s]);let A=(0,w.useRef)({s1:!1,s2:!1});(0,w.useEffect)(()=>{if(!s)return;let e=A.current;s.step1Done&&!e.s1&&(l("ai"),e.s1=!0),s.askedAI&&!e.s2&&(l("agent"),e.s2=!0)},[s?.step1Done,s?.askedAI,s]);let C=s?.step1Done??!1,E=s?.askedAI??!1,S=s?.nextStepIndex??0,z=C&&E&&m,T=z&&S>=t.done.steps.length,L=(0,w.useRef)(null);if((0,w.useEffect)(()=>(T&&(L.current=setTimeout(()=>h(),8e3)),()=>{L.current&&clearTimeout(L.current)}),[T,h]),!s||void 0!==s.walkthroughStep&&s.walkthroughStep>=0&&s.walkthroughStep<K.g.length&&!s.walkthroughDismissed)return null;let M=C&&E&&!m;if(z&&T)return(0,r.jsxs)("div",{className:"mb-6 rounded-xl border border-[var(--amber)] px-5 py-4 flex items-center gap-3 animate-in fade-in duration-300 bg-[var(--amber-subtle)]",children:[(0,r.jsx)(d.A,{size:16,className:"animate-spin-slow text-[var(--amber)]"}),(0,r.jsx)("span",{className:"text-sm font-semibold flex-1 text-foreground",children:t.done.titleFinal}),(0,r.jsx)(a(),{href:"/explore",className:"text-xs font-medium text-[var(--amber)] transition-colors hover:opacity-80",children:e.walkthrough.exploreCta}),(0,r.jsx)("button",{onClick:h,className:"p-1 rounded hover:bg-muted transition-colors text-muted-foreground",children:(0,r.jsx)(b.A,{size:14})})]});if(z){let e=t.done.steps[S];return(0,r.jsxs)("div",{className:"mb-6 rounded-xl border border-[var(--amber)] px-5 py-4 animate-in fade-in duration-300 bg-[var(--amber-subtle)]",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)(d.A,{size:16,className:"text-[var(--amber)]"}),(0,r.jsx)("span",{className:"text-sm font-semibold flex-1 text-foreground",children:t.done.title}),(0,r.jsx)("button",{onClick:h,className:"p-1 rounded hover:bg-muted transition-colors text-muted-foreground",children:(0,r.jsx)(b.A,{size:14})})]}),e&&(0,r.jsxs)("button",{onClick:y,className:"mt-3 flex items-center gap-2 text-sm text-[var(--amber)] transition-colors hover:opacity-80 cursor-pointer animate-in fade-in slide-in-from-left-2 duration-300",children:[(0,r.jsx)(P.A,{size:14}),(0,r.jsx)("span",{children:e.hint})]})]})}return(0,r.jsxs)("div",{className:"mb-6 rounded-xl border border-[var(--amber)] overflow-hidden bg-[var(--amber-subtle)]",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3 px-5 pt-4 pb-2",children:[(0,r.jsx)(d.A,{size:16,className:"text-[var(--amber)]"}),(0,r.jsx)("span",{className:"text-sm font-semibold flex-1 font-display text-foreground",children:t.title}),(0,r.jsx)("button",{onClick:h,className:"p-1 rounded hover:bg-muted transition-colors text-muted-foreground",children:(0,r.jsx)(b.A,{size:14})})]}),(0,r.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-2 px-5 py-3",children:[(0,r.jsx)(U,{icon:(0,r.jsx)(I.A,{size:16}),title:t.import.title,cta:t.import.cta,done:C,active:"import"===i,onClick:()=>C?null:l("import"===i?null:"import")}),(0,r.jsx)(U,{icon:(0,r.jsx)(O.A,{size:16}),title:t.ai.title,cta:t.ai.cta,done:E,active:"ai"===i,dimmed:!C,onClick:()=>{!E&&C&&l("ai"===i?null:"ai")}}),(0,r.jsx)(U,{icon:(0,r.jsx)(H.A,{size:16}),title:t.agent.title,cta:t.agent.cta,done:m,active:"agent"===i,dimmed:!C||!E,onClick:()=>{C&&E&&l("agent"===i?null:"agent")}})]}),"import"===i&&!C&&(0,r.jsx)("div",{className:"px-5 pb-4 animate-in slide-in-from-top-2 duration-200",children:(0,r.jsxs)("div",{className:"rounded-lg border border-border bg-card p-4",children:[(0,r.jsx)("p",{className:"text-xs text-muted-foreground mb-3",children:t.import.desc}),(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)("button",{onClick:f,className:"text-xs font-medium px-4 py-2 rounded-lg transition-all hover:opacity-90",style:{background:"var(--amber)",color:"var(--amber-foreground)"},children:t.import.button}),(0,r.jsx)("button",{onClick:g,className:"text-xs px-3 py-1 rounded-lg text-muted-foreground transition-colors hover:bg-muted",children:t.skip})]})]})}),"ai"===i&&C&&!E&&(0,r.jsx)("div",{className:"px-5 pb-4 animate-in slide-in-from-top-2 duration-200",children:(0,r.jsxs)("div",{className:"rounded-lg border border-border bg-card p-4",children:[(0,r.jsx)("p",{className:"text-xs text-muted-foreground mb-3",children:t.ai.desc}),(0,r.jsxs)("button",{onClick:v,className:"text-xs font-medium px-4 py-2 rounded-lg transition-all hover:opacity-90",style:{background:"var(--amber)",color:"var(--amber-foreground)"},children:[t.ai.cta," →"]})]})}),"agent"===i&&M&&(0,r.jsx)("div",{className:"px-5 pb-4 animate-in slide-in-from-top-2 duration-200",children:(0,r.jsxs)("div",{className:"rounded-lg border border-border bg-card p-4",children:[(0,r.jsx)("p",{className:"text-xs text-muted-foreground mb-3",children:t.agent.desc}),(0,r.jsxs)("div",{className:"relative rounded-lg border border-border bg-muted/50 p-3 pr-16",children:[(0,r.jsx)("p",{className:"text-xs font-mono text-foreground leading-relaxed whitespace-pre-wrap",children:t.agent.copyPrompt}),(0,r.jsxs)("button",{onClick:j,className:"absolute top-2 right-2 flex items-center gap-1 text-2xs font-medium px-2.5 py-1.5 rounded-md border transition-all border-border bg-card text-muted-foreground hover:text-foreground hover:border-[var(--amber)]/30",children:[(0,r.jsx)($.A,{size:11}),t.agent.copy]})]}),(0,r.jsx)("div",{className:"flex items-center justify-end mt-3 pt-3 border-t border-border",children:(0,r.jsx)("button",{onClick:N,className:"text-xs px-3 py-1 rounded-lg text-muted-foreground transition-colors hover:bg-muted",children:t.skip})})]})})]})}function U({icon:e,title:t,cta:s,done:n,active:a,dimmed:i,onClick:l}){return(0,r.jsxs)("button",{onClick:l,disabled:n||i,className:`
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8974],{4235:(e,t,s)=>{"use strict";s.d(t,{B1:()=>l,X8:()=>d,dV:()=>o,oR:()=>m});let r=[],n=[],a=0;function i(){for(let e of n)e()}function l(e){return n=[...n,e],()=>{n=n.filter(t=>t!==e)}}function o(){return r}function d(e){r=r.filter(t=>t.id!==e),i()}function c(e){let t=`toast-${++a}`,s={id:t,message:e.message,type:e.type??"info",duration:e.duration??2e3,action:e.action};r=[...r,s].slice(-3),i(),s.duration>0&&setTimeout(()=>d(t),s.duration)}function m(e,t){c({message:e,...t})}m.success=(e,t)=>c({message:e,type:"success",duration:t}),m.undo=(e,t,s)=>c({message:e,type:"info",duration:s?.duration??5e3,action:{label:s?.label??"Undo",onClick:t}}),m.error=(e,t)=>c({message:e,type:"error",duration:t}),m.copy=(e="Copied")=>c({message:e,type:"success",duration:1500})},7834:(e,t,s)=>{"use strict";async function r(e){if(navigator.clipboard?.writeText)try{return await navigator.clipboard.writeText(e),!0}catch{}try{let t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t),t.select();let s=document.execCommand("copy");return document.body.removeChild(t),s}catch{return!1}}s.d(t,{l:()=>r})},9930:(e,t,s)=>{"use strict";s.d(t,{Ay:()=>d,cd:()=>o,kr:()=>l});var r=s(95155),n=s(12115),a=s(22356);let i=(0,n.createContext)(null);function l(){let e=(0,n.useContext)(i);if(!e)throw Error("useMcpData must be used within McpProvider");return e}function o(){return(0,n.useContext)(i)}function d({children:e}){let[t,s]=(0,n.useState)(null),[l,o]=(0,n.useState)([]),[d,c]=(0,n.useState)([]),[m,u]=(0,n.useState)(!0),x=(0,n.useRef)(null),p=(0,n.useRef)(l);p.current=l;let h=(0,n.useCallback)(async()=>{x.current?.abort();let e=new AbortController;x.current=e;try{let[t,r,n]=await Promise.all([(0,a.n)("/api/mcp/status",{signal:e.signal}),(0,a.n)("/api/mcp/agents",{signal:e.signal}),(0,a.n)("/api/skills",{signal:e.signal})]);e.signal.aborted||(s(t),o(r.agents),c(n.skills))}catch(e){if(e instanceof DOMException&&"AbortError"===e.name)return}finally{e.signal.aborted||u(!1)}},[]);(0,n.useEffect)(()=>(h(),()=>x.current?.abort()),[h]),(0,n.useEffect)(()=>{let e,t=()=>{clearTimeout(e),e=setTimeout(()=>h(),500)};return window.addEventListener("mindos:skills-changed",t),()=>{clearTimeout(e),window.removeEventListener("mindos:skills-changed",t)}},[h]),(0,n.useEffect)(()=>{let e;return e=setInterval(()=>{"visible"===document.visibilityState&&h()},3e4),()=>clearInterval(e)},[h]);let f=(0,n.useCallback)(async()=>{await h()},[h]),g=(0,n.useCallback)(async(e,t)=>{c(s=>s.map(s=>s.name===e?{...s,enabled:t}:s));try{return await (0,a.n)("/api/skills",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"toggle",name:e,enabled:t})}),!0}catch{return c(s=>s.map(s=>s.name===e?{...s,enabled:!t}:s)),!1}},[]),b=(0,n.useCallback)(async(e,t)=>{let s=p.current.find(t=>t.key===e);if(!s)return!1;try{let r=await (0,a.n)("/api/mcp/install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({agents:[{key:e,scope:t?.scope??(s.hasProjectScope?"project":"global"),transport:t?.transport??s.preferredTransport}],transport:"auto"})}),n=r.results?.[0],i=n?.ok===!0||n?.status==="ok";return i&&await h(),i}catch{return!1}},[h]),v=(0,n.useMemo)(()=>({status:t,agents:l,skills:d,loading:m,refresh:f,toggleSkill:g,installAgent:b}),[t,l,d,m,f,g,b]);return(0,r.jsx)(i.Provider,{value:v,children:e})}},10377:(e,t,s)=>{"use strict";s.d(t,{Z:()=>h});var r=s(12115);let n="mindos-pinned-files",a="mindos:pins-changed";function i(){try{let e=localStorage.getItem(n);return e?JSON.parse(e):[]}catch{return[]}}function l(){return c}let o=[];function d(){return o}let c=[],m=!1;function u(){m||(c=i(),m=!0)}function x(e){u();let t=t=>{t.key===n&&(c=i(),e())},s=()=>{c=i(),e()};return window.addEventListener("storage",t),window.addEventListener(a,s),()=>{window.removeEventListener("storage",t),window.removeEventListener(a,s)}}function p(e){c=e;try{localStorage.setItem(n,JSON.stringify(e))}catch{}window.dispatchEvent(new Event(a))}function h(){u();let e=(0,r.useSyncExternalStore)(x,l,d),t=(0,r.useCallback)(t=>e.includes(t),[e]),s=(0,r.useCallback)(e=>{let t=i(),s=t.indexOf(e);s>=0?t.splice(s,1):t.unshift(e),p(t)},[]);return{pinnedFiles:e,isPinned:t,togglePin:s,reorderPins:(0,r.useCallback)(e=>{p(e)},[]),removePin:(0,r.useCallback)(e=>{p(i().filter(t=>t!==e))},[])}}},14153:(e,t,s)=>{Promise.resolve().then(s.bind(s,72471))},22356:(e,t,s)=>{"use strict";s.d(t,{h:()=>r,n:()=>n});class r extends Error{constructor(e,t,s){super(e),this.name="ApiError",this.status=t,this.code=s}}async function n(e,t={}){let s,a,i,{timeout:l=3e4,signal:o,...d}=t;if((l>0||o)&&(s=new AbortController),l>0&&s&&(a=setTimeout(()=>s.abort(),l)),o&&s)if(o.aborted)s.abort();else{let e=()=>s?.abort();o.addEventListener("abort",e,{once:!0}),i=()=>{o.removeEventListener("abort",e)}}let c=s?.signal??o;try{let t=await fetch(e,{...d,signal:c});if(!t.ok){let e,s=`Request failed (${t.status})`;try{let r=await t.json();r?.error?.code&&r?.error?.message?(s=r.error.message,e=r.error.code):r?.error&&(s="string"==typeof r.error?r.error:r.error.message??s)}catch{}throw new r(s,t.status,e)}return await t.json()}finally{a&&clearTimeout(a),i&&i()}}},27318:(e,t,s)=>{"use strict";s.d(t,{KT:()=>c,NH:()=>d});var r=s(12115);let n={open:!1,initialMessage:"",source:"user",acpAgent:null},a=new Set;function i(){a.forEach(e=>e())}function l(e){return a.add(e),()=>{a.delete(e)}}function o(){return n}function d(e="",t="user",s=null){n={open:!0,initialMessage:e,source:t,acpAgent:s},i()}function c(){let e=(0,r.useSyncExternalStore)(l,o,o);return{open:e.open,initialMessage:e.initialMessage,source:e.source,acpAgent:e.acpAgent,openWith:(0,r.useCallback)((e,t="user",s=null)=>d(e,t,s),[]),close:(0,r.useCallback)(()=>void(n={open:!1,initialMessage:"",source:"user",acpAgent:null},i()),[])}}},64576:(e,t,s)=>{"use strict";s.d(t,{E:()=>n});var r=s(9339);let n=(0,r.createServerReference)("0043ce6d8342976c485697a6a0f3dbb86877b6cd32",r.callServer,void 0,r.findSourceMapURL,"cleanupExamplesAction")},69335:(e,t,s)=>{"use strict";s.d(t,{D:()=>n});var r=s(9339);let n=(0,r.createServerReference)("00b827eab44f7ab7cb36667578f653c98c3eeeba57",r.callServer,void 0,r.findSourceMapURL,"scanExampleFilesAction")},72471:(e,t,s)=>{"use strict";s.d(t,{default:()=>eo});var r=s(95155),n=s(98500),a=s.n(n),i=s(66088),l=s(33078),o=s(48368),d=s(86901),c=s(61878),m=s(93631),u=s(21628),x=s(90718),p=s(38798),h=s(84980),f=s(50538),g=s(94290),b=s(33210),v=s(51914),j=s(94514),N=s(6296),y=s(68459),w=s(12115),k=s(61263),A=s(91337),C=s(10377),E=s(73321),S=s(92451),z=s(97810),T=s(13545),L=s(31025);let M=[{id:"en",icon:(0,r.jsx)(S.A,{size:20}),dirs:["Profile/","Connections/","Notes/","Workflows/","Resources/","Projects/"]},{id:"zh",icon:(0,r.jsx)(z.A,{size:20}),dirs:["画像/","关系/","笔记/","流程/","资源/","项目/"]},{id:"empty",icon:(0,r.jsx)(o.A,{size:20}),dirs:["README.md","CONFIG.json","INSTRUCTION.md"]}];function D(){let{t:e}=(0,k.Y)(),t=(0,E.useRouter)(),[s,n]=(0,w.useState)(null),[a,i]=(0,w.useState)(null),l=e.onboarding;async function o(e){n(e),i(null);try{let s=await fetch("/api/init",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({template:e})});if(!s.ok){let e=await s.json().catch(()=>({}));throw Error(e.error||`HTTP ${s.status}`)}t.refresh()}catch(e){console.error("[Onboarding] init failed:",e),i(e instanceof Error?e.message:"Unknown error"),n(null)}}return(0,r.jsxs)("div",{className:"content-width px-4 md:px-6 py-12 md:py-20",children:[(0,r.jsxs)("div",{className:"text-center mb-10",children:[(0,r.jsxs)("div",{className:"inline-flex items-center gap-2 mb-4",children:[(0,r.jsx)(d.A,{size:18,className:"text-[var(--amber)]"}),(0,r.jsx)("h1",{className:"text-2xl font-semibold tracking-tight font-display text-foreground",children:"MindOS"})]}),(0,r.jsx)("p",{className:"text-sm leading-relaxed max-w-md mx-auto text-muted-foreground",children:l.subtitle})]}),a&&(0,r.jsxs)("div",{role:"alert",className:"max-w-2xl mx-auto mb-6 flex items-center gap-2.5 px-4 py-3 rounded-lg border border-destructive/30 bg-destructive/5 text-sm text-destructive",children:[(0,r.jsx)(T.A,{size:16,className:"shrink-0"}),(0,r.jsx)("span",{className:"flex-1",children:l.initError??"Initialization failed. Please try again."}),(0,r.jsx)("button",{onClick:()=>i(null),className:"text-xs underline shrink-0 hover:opacity-80",children:l.dismiss??"Dismiss"})]}),(0,r.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4 max-w-2xl mx-auto mb-10",children:M.map(t=>{let n=s===t.id,a=null!==s;return(0,r.jsxs)("button",{disabled:a,title:a?e.hints.templateInitializing:void 0,onClick:()=>o(t.id),className:"group relative flex flex-col items-start gap-3 p-5 rounded-xl border border-border bg-card text-left transition-all duration-150 hover:border-[var(--amber)]/50 hover:bg-[var(--amber)]/5 disabled:opacity-60 disabled:cursor-not-allowed",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2.5 w-full",children:[(0,r.jsx)("span",{className:"text-[var(--amber)]",children:t.icon}),(0,r.jsx)("span",{className:"text-sm font-semibold text-foreground",children:l.templates[t.id].title}),n&&(0,r.jsx)(N.A,{size:14,className:"animate-spin ml-auto text-[var(--amber)]"})]}),(0,r.jsx)("p",{className:"text-xs leading-relaxed text-muted-foreground",children:l.templates[t.id].desc}),(0,r.jsx)("div",{className:"w-full rounded-lg px-3 py-2 text-xs leading-relaxed font-display bg-muted text-muted-foreground opacity-80",children:t.dirs.map(e=>(0,r.jsx)("div",{children:e},e))})]},t.id)})}),(0,r.jsx)("p",{className:"text-center text-xs leading-relaxed max-w-sm mx-auto font-display text-muted-foreground opacity-60",children:l.importHint}),(0,r.jsx)("p",{className:"text-center mt-2",children:(0,r.jsx)("button",{type:"button",onClick:()=>window.dispatchEvent(new CustomEvent("mindos:open-import")),className:"text-xs text-[var(--amber-text)] hover:underline transition-colors",children:e.fileImport.onboardingHint})}),(0,r.jsxs)("div",{className:"max-w-md mx-auto mt-6 flex items-center gap-3 px-4 py-3 rounded-lg border border-border bg-card text-left",children:[(0,r.jsx)(L.A,{size:16,className:"text-muted-foreground shrink-0"}),(0,r.jsx)("div",{className:"min-w-0",children:(0,r.jsxs)("p",{className:"text-xs text-muted-foreground",children:[l.syncHint??"Want cross-device sync? Run"," ",(0,r.jsx)("code",{className:"font-mono px-1 py-0.5 rounded select-all bg-muted text-[11px]",children:"mindos sync init"})," ",l.syncHintSuffix??"in the terminal after setup."]})})]})]})}var P=s(21362),I=s(21975),O=s(92564),H=s(22164),$=s(67635),W=s(7834),R=s(4235),F=s(27318),K=s(76449);function _(){let{t:e}=(0,k.Y)(),t=e.guide,[s,n]=(0,w.useState)(null),[i,l]=(0,w.useState)(null),[o,c]=(0,w.useState)(!1),[m,u]=(0,w.useState)(!1),x=(0,w.useCallback)(()=>{fetch("/api/setup").then(e=>e.json()).then(e=>{let t=e.guideState;t?.active&&!t.dismissed?n(t):n(null)}).catch(e=>{console.warn("[GuideCard] Fetch guide state failed:",e)})},[]);(0,w.useEffect)(()=>{x();let e=()=>{c(!0)};window.addEventListener("mindos:first-visit",e);let t=()=>x();return window.addEventListener("focus",t),window.addEventListener("guide-state-updated",t),()=>{window.removeEventListener("mindos:first-visit",e),window.removeEventListener("focus",t),window.removeEventListener("guide-state-updated",t)}},[x]);let p=(0,w.useCallback)(e=>{n(t=>t?{...t,...e}:t),fetch("/api/setup",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({guideState:e})}).catch(e=>{console.warn("[GuideCard] PATCH guide state failed:",e)})},[]),h=(0,w.useCallback)(()=>{p({dismissed:!0}),n(null)},[p]),f=(0,w.useCallback)(()=>{window.dispatchEvent(new CustomEvent("mindos:open-import"))},[]),g=(0,w.useCallback)(()=>{p({step1Done:!0}),l(null)},[p]);(0,w.useEffect)(()=>{if(!s||s.step1Done)return;let e=()=>p({step1Done:!0});return window.addEventListener("mindos:files-changed",e),()=>window.removeEventListener("mindos:files-changed",e)},[s,s?.step1Done,p]);let v=(0,w.useCallback)(()=>{let e=s?.template==="empty"?t.ai.promptEmpty:t.ai.prompt;(0,F.NH)(e,"guide")},[s,t]),j=(0,w.useCallback)(async()=>{await (0,W.l)(t.agent.copyPrompt)&&R.oR.copy()},[t]),N=(0,w.useCallback)(()=>{u(!0),l(null),p({nextStepIndex:0})},[p]),y=(0,w.useCallback)(()=>{if(!s)return;let e=s.nextStepIndex,r=t.done.steps;e<r.length&&((0,F.NH)(r[e].prompt,"guide-next"),p({nextStepIndex:e+1}))},[s,t,p]);(0,w.useEffect)(()=>{o&&s&&!s.step1Done&&l("import")},[o,s]);let A=(0,w.useRef)({s1:!1,s2:!1});(0,w.useEffect)(()=>{if(!s)return;let e=A.current;s.step1Done&&!e.s1&&(l("ai"),e.s1=!0),s.askedAI&&!e.s2&&(l("agent"),e.s2=!0)},[s?.step1Done,s?.askedAI,s]);let C=s?.step1Done??!1,E=s?.askedAI??!1,S=s?.nextStepIndex??0,z=C&&E&&m,T=z&&S>=t.done.steps.length,L=(0,w.useRef)(null);if((0,w.useEffect)(()=>(T&&(L.current=setTimeout(()=>h(),8e3)),()=>{L.current&&clearTimeout(L.current)}),[T,h]),!s||void 0!==s.walkthroughStep&&s.walkthroughStep>=0&&s.walkthroughStep<K.g.length&&!s.walkthroughDismissed)return null;let M=C&&E&&!m;if(z&&T)return(0,r.jsxs)("div",{className:"mb-6 rounded-xl border border-[var(--amber)] px-5 py-4 flex items-center gap-3 animate-in fade-in duration-300 bg-[var(--amber-subtle)]",children:[(0,r.jsx)(d.A,{size:16,className:"animate-spin-slow text-[var(--amber)]"}),(0,r.jsx)("span",{className:"text-sm font-semibold flex-1 text-foreground",children:t.done.titleFinal}),(0,r.jsx)(a(),{href:"/explore",className:"text-xs font-medium text-[var(--amber)] transition-colors hover:opacity-80",children:e.walkthrough.exploreCta}),(0,r.jsx)("button",{onClick:h,className:"p-1 rounded hover:bg-muted transition-colors text-muted-foreground",children:(0,r.jsx)(b.A,{size:14})})]});if(z){let e=t.done.steps[S];return(0,r.jsxs)("div",{className:"mb-6 rounded-xl border border-[var(--amber)] px-5 py-4 animate-in fade-in duration-300 bg-[var(--amber-subtle)]",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)(d.A,{size:16,className:"text-[var(--amber)]"}),(0,r.jsx)("span",{className:"text-sm font-semibold flex-1 text-foreground",children:t.done.title}),(0,r.jsx)("button",{onClick:h,className:"p-1 rounded hover:bg-muted transition-colors text-muted-foreground",children:(0,r.jsx)(b.A,{size:14})})]}),e&&(0,r.jsxs)("button",{onClick:y,className:"mt-3 flex items-center gap-2 text-sm text-[var(--amber)] transition-colors hover:opacity-80 cursor-pointer animate-in fade-in slide-in-from-left-2 duration-300",children:[(0,r.jsx)(P.A,{size:14}),(0,r.jsx)("span",{children:e.hint})]})]})}return(0,r.jsxs)("div",{className:"mb-6 rounded-xl border border-[var(--amber)] overflow-hidden bg-[var(--amber-subtle)]",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3 px-5 pt-4 pb-2",children:[(0,r.jsx)(d.A,{size:16,className:"text-[var(--amber)]"}),(0,r.jsx)("span",{className:"text-sm font-semibold flex-1 font-display text-foreground",children:t.title}),(0,r.jsx)("button",{onClick:h,className:"p-1 rounded hover:bg-muted transition-colors text-muted-foreground",children:(0,r.jsx)(b.A,{size:14})})]}),(0,r.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-2 px-5 py-3",children:[(0,r.jsx)(U,{icon:(0,r.jsx)(I.A,{size:16}),title:t.import.title,cta:t.import.cta,done:C,active:"import"===i,onClick:()=>C?null:l("import"===i?null:"import")}),(0,r.jsx)(U,{icon:(0,r.jsx)(O.A,{size:16}),title:t.ai.title,cta:t.ai.cta,done:E,active:"ai"===i,dimmed:!C,onClick:()=>{!E&&C&&l("ai"===i?null:"ai")}}),(0,r.jsx)(U,{icon:(0,r.jsx)(H.A,{size:16}),title:t.agent.title,cta:t.agent.cta,done:m,active:"agent"===i,dimmed:!C||!E,onClick:()=>{C&&E&&l("agent"===i?null:"agent")}})]}),"import"===i&&!C&&(0,r.jsx)("div",{className:"px-5 pb-4 animate-in slide-in-from-top-2 duration-200",children:(0,r.jsxs)("div",{className:"rounded-lg border border-border bg-card p-4",children:[(0,r.jsx)("p",{className:"text-xs text-muted-foreground mb-3",children:t.import.desc}),(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)("button",{onClick:f,className:"text-xs font-medium px-4 py-2 rounded-lg transition-all hover:opacity-90",style:{background:"var(--amber)",color:"var(--amber-foreground)"},children:t.import.button}),(0,r.jsx)("button",{onClick:g,className:"text-xs px-3 py-1 rounded-lg text-muted-foreground transition-colors hover:bg-muted",children:t.skip})]})]})}),"ai"===i&&C&&!E&&(0,r.jsx)("div",{className:"px-5 pb-4 animate-in slide-in-from-top-2 duration-200",children:(0,r.jsxs)("div",{className:"rounded-lg border border-border bg-card p-4",children:[(0,r.jsx)("p",{className:"text-xs text-muted-foreground mb-3",children:t.ai.desc}),(0,r.jsxs)("button",{onClick:v,className:"text-xs font-medium px-4 py-2 rounded-lg transition-all hover:opacity-90",style:{background:"var(--amber)",color:"var(--amber-foreground)"},children:[t.ai.cta," →"]})]})}),"agent"===i&&M&&(0,r.jsx)("div",{className:"px-5 pb-4 animate-in slide-in-from-top-2 duration-200",children:(0,r.jsxs)("div",{className:"rounded-lg border border-border bg-card p-4",children:[(0,r.jsx)("p",{className:"text-xs text-muted-foreground mb-3",children:t.agent.desc}),(0,r.jsxs)("div",{className:"relative rounded-lg border border-border bg-muted/50 p-3 pr-16",children:[(0,r.jsx)("p",{className:"text-xs font-mono text-foreground leading-relaxed whitespace-pre-wrap",children:t.agent.copyPrompt}),(0,r.jsxs)("button",{onClick:j,className:"absolute top-2 right-2 flex items-center gap-1 text-2xs font-medium px-2.5 py-1.5 rounded-md border transition-all border-border bg-card text-muted-foreground hover:text-foreground hover:border-[var(--amber)]/30",children:[(0,r.jsx)($.A,{size:11}),t.agent.copy]})]}),(0,r.jsx)("div",{className:"flex items-center justify-end mt-3 pt-3 border-t border-border",children:(0,r.jsx)("button",{onClick:N,className:"text-xs px-3 py-1 rounded-lg text-muted-foreground transition-colors hover:bg-muted",children:t.skip})})]})})]})}function U({icon:e,title:t,cta:s,done:n,active:a,dimmed:i,onClick:l}){return(0,r.jsxs)("button",{onClick:l,disabled:n||i,className:`
|
|
2
2
|
flex flex-col items-center gap-1.5 px-3 py-3 rounded-lg border text-center
|
|
3
3
|
transition-all duration-150
|
|
4
4
|
${n?"opacity-60":i?"opacity-40 cursor-default":"hover:border-[var(--amber)]/30 hover:bg-muted/50 cursor-pointer"}
|
|
5
5
|
${a?"border-[var(--amber)]/40 bg-muted/50":""}
|
|
6
6
|
${n||a?"border-[var(--amber)]":"border-border"}
|
|
7
|
-
`,children:[(0,r.jsx)("span",{className:`${n?"animate-in zoom-in-50 duration-300 text-success":"text-[var(--amber)]"}`,children:n?(0,r.jsx)(j.A,{size:16}):e}),(0,r.jsx)("span",{className:"text-xs font-medium text-foreground",children:t}),!n&&!i&&(0,r.jsxs)("span",{className:"text-2xs text-[var(--amber-text)]",children:[s," →"]})]})}var Y=s(49619),J=s(9930);let B="mindos:pulse-collapsed";function G(){let e=(0,J.cd)(),{t}=(0,k.Y)(),s=t.pulse,[n,l]=(0,w.useState)(!1),[o,d]=(0,w.useState)(!1);(0,w.useEffect)(()=>{let e=localStorage.getItem(B);null!==e&&l("1"===e)},[]);let c=e?.agents??[],m=e?.status??null,x=(0,w.useMemo)(()=>[...c].sort((e,t)=>{let s=e=>e.installed?3:2*!!e.present,r=s(t)-s(e);if(0!==r)return r;let n=e.runtimeLastActivityAt?new Date(e.runtimeLastActivityAt).getTime():0;return(t.runtimeLastActivityAt?new Date(t.runtimeLastActivityAt).getTime():0)-n}),[c]).filter(e=>e.installed),p=m?.running??!1,h=()=>{let e=!n;l(e),localStorage.setItem(B,e?"1":"0")};if(!e||e.loading)return null;if(c.every(e=>!e.present))return(0,r.jsxs)("section",{className:"mb-10",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 mb-4",children:[(0,r.jsx)("span",{className:"text-[var(--amber)]",children:(0,r.jsx)(Y.A,{size:13})}),(0,r.jsx)("h2",{className:"text-sm font-semibold font-display text-foreground",children:s.title})]}),(0,r.jsx)("div",{className:"rounded-xl border border-dashed border-border/60 p-4",children:(0,r.jsxs)("div",{className:"flex items-center gap-4",children:[(0,r.jsx)("div",{className:"w-9 h-9 rounded-lg bg-[var(--amber)]/8 flex items-center justify-center shrink-0",children:(0,r.jsx)(Y.A,{size:16,className:"text-[var(--amber)]"})}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsx)("p",{className:"text-sm font-medium text-foreground",children:s.connectTitle}),(0,r.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5",children:s.connectDesc})]}),(0,r.jsxs)(a(),{href:"/agents",className:"shrink-0 inline-flex items-center gap-1.5 px-3.5 py-2 rounded-lg text-xs font-medium bg-[var(--amber)] text-[var(--amber-foreground)] transition-opacity hover:opacity-90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[s.connectAction,(0,r.jsx)(u.A,{size:11})]})]})})]});let f=x.length;if(n)return(0,r.jsx)("section",{className:"mb-10",children:(0,r.jsxs)("button",{onClick:h,className:"w-full flex items-center gap-2 group cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring rounded",children:[(0,r.jsx)("span",{className:"text-[var(--amber)]",children:(0,r.jsx)(Y.A,{size:13})}),(0,r.jsx)("h2",{className:"text-sm font-semibold font-display text-foreground",children:s.title}),f>0&&(0,r.jsx)("span",{className:"text-xs tabular-nums text-muted-foreground font-display",children:f}),(0,r.jsxs)("div",{className:"flex items-center gap-2 ml-1",children:[x.slice(0,3).map(e=>(0,r.jsxs)("span",{className:"inline-flex items-center gap-1 text-xs text-muted-foreground/60",children:[(0,r.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-emerald-500 shrink-0"}),(0,r.jsx)("span",{className:"hidden sm:inline",children:e.name})]},e.key)),f>3&&(0,r.jsxs)("span",{className:"text-xs text-muted-foreground/40",children:["+",f-3]})]}),(0,r.jsx)(i.A,{size:12,className:"ml-auto text-muted-foreground/30 group-hover:text-[var(--amber)] transition-colors"})]})});let g=o?x:x.slice(0,3),b=x.length-3;return(0,r.jsxs)("section",{className:"mb-10",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 mb-4",children:[(0,r.jsx)("span",{className:"text-[var(--amber)]",children:(0,r.jsx)(Y.A,{size:13})}),(0,r.jsx)("h2",{className:"text-sm font-semibold font-display text-foreground",children:s.title}),f>0&&(0,r.jsx)("span",{className:"text-xs tabular-nums text-muted-foreground font-display",children:f}),p&&(0,r.jsxs)("span",{className:"inline-flex items-center gap-1 text-xs text-muted-foreground/50 ml-1",children:[(0,r.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-emerald-500"}),(0,r.jsx)("span",{className:"hidden sm:inline",children:s.running})]}),(0,r.jsxs)("div",{className:"flex items-center gap-2 ml-auto",children:[(0,r.jsx)(a(),{href:"/agents",className:"text-xs font-medium text-[var(--amber)] hover:opacity-80 transition-opacity font-display",children:s.manage}),(0,r.jsx)("button",{onClick:h,className:"p-1 rounded hover:bg-muted transition-colors text-muted-foreground/40 hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","aria-label":"Collapse",children:(0,r.jsx)(i.A,{size:12,className:"rotate-180"})})]})]}),(0,r.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-2",children:g.map(e=>{var t;let n,a=function(e){if(!e)return null;let t=Date.now()-new Date(e).getTime();return t<6e4?"<1m":t<36e5?`${Math.floor(t/6e4)}m`:t<864e5?`${Math.floor(t/36e5)}h`:`${Math.floor(t/864e5)}d`}(e.runtimeLastActivityAt);return(0,r.jsxs)("div",{className:"flex items-center gap-3 px-3.5 py-3 rounded-xl border border-border hover:border-[var(--amber)]/30 hover:shadow-sm transition-all duration-150",children:[(0,r.jsxs)("div",{className:"relative w-8 h-8 rounded-lg bg-[var(--amber)]/8 text-[var(--amber-text)] ring-1 ring-[var(--amber)]/15 flex items-center justify-center text-xs font-semibold font-display shrink-0",children:[(n=(t=e.name).split(/[\s-]+/)).length>=2?(n[0][0]+n[1][0]).toUpperCase():t.slice(0,2).toUpperCase(),(0,r.jsx)("span",{className:"absolute -top-0.5 -right-0.5 w-2 h-2 rounded-full bg-emerald-500 ring-[1.5px] ring-card"})]}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsx)("span",{className:"text-sm font-medium text-foreground block truncate",children:e.name}),(0,r.jsxs)("span",{className:"text-xs text-muted-foreground/60 block",children:[s.active,a?` \xb7 ${a}`:""]})]})]},e.key)})}),b>0&&(0,r.jsxs)("button",{onClick:()=>d(e=>!e),className:"flex items-center gap-1.5 mt-2 text-xs font-medium text-[var(--amber)] hover:opacity-80 transition-opacity cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring rounded",children:[(0,r.jsx)(i.A,{size:12,className:`transition-transform duration-200 ${o?"rotate-180":""}`}),(0,r.jsx)("span",{children:o?s.showLess:s.showMore(b)})]})]})}var X=s(95977);let Z="mindos-echo-daily-line";function q(){let{t:e}=(0,k.Y)(),t=e.echoSpotlight,[s,n]=(0,w.useState)(""),[i,l]=(0,w.useState)(!1),[o,d]=(0,w.useState)(!1),c=(0,w.useRef)(null);(0,w.useEffect)(()=>{n(localStorage.getItem(Z)??""),d(!0)},[]),(0,w.useEffect)(()=>{i&&c.current&&c.current.focus()},[i]);let m=e=>{n(e),localStorage.setItem(Z,e)};return o?s.trim()?(0,r.jsxs)("section",{className:"mb-10",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 mb-4",children:[(0,r.jsx)("span",{className:"text-[var(--amber)]",children:(0,r.jsx)(X.A,{size:13})}),(0,r.jsx)("h2",{className:"text-sm font-semibold font-display text-foreground",children:t.title}),(0,r.jsx)("span",{className:"text-xs text-muted-foreground/50 font-display",children:t.dailyLine}),(0,r.jsx)(a(),{href:"/echo/daily",className:"ml-auto text-xs font-medium text-[var(--amber)] hover:opacity-80 transition-opacity font-display",children:t.goToEcho})]}),(0,r.jsx)("div",{className:"group",children:i?(0,r.jsx)("input",{ref:c,type:"text",value:s,onChange:e=>m(e.target.value),onBlur:()=>l(!1),onKeyDown:e=>{"Enter"===e.key&&l(!1)},className:"w-full px-3.5 py-3 rounded-xl border border-[var(--amber)]/40 bg-card text-sm text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring font-display italic",placeholder:t.placeholder}):(0,r.jsxs)("button",{onClick:()=>l(!0),className:"w-full text-left px-3.5 py-3 rounded-xl border border-border/40 hover:border-[var(--amber)]/30 transition-all duration-150 cursor-text group-hover:shadow-sm",children:[(0,r.jsxs)("p",{className:"text-sm text-foreground/80 font-display italic leading-relaxed",children:["“",s,"”"]}),(0,r.jsx)("p",{className:"text-xs text-muted-foreground/40 mt-1",children:t.savedLocally})]})})]}):(0,r.jsxs)("section",{className:"mb-10",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 mb-4",children:[(0,r.jsx)("span",{className:"text-[var(--amber)]",children:(0,r.jsx)(X.A,{size:13})}),(0,r.jsx)("h2",{className:"text-sm font-semibold font-display text-foreground",children:t.title})]}),(0,r.jsxs)("div",{className:"flex items-center gap-4 px-3.5 py-3.5 rounded-xl border border-dashed border-border/60 hover:border-[var(--amber)]/30 transition-all duration-150 group",children:[(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsx)("input",{type:"text",value:s,onChange:e=>m(e.target.value),className:"w-full bg-transparent text-sm text-foreground placeholder:text-muted-foreground/40 focus-visible:outline-none font-display italic",placeholder:t.placeholder}),(0,r.jsx)("p",{className:"text-xs text-muted-foreground/40 mt-1",children:t.inviteDesc})]}),(0,r.jsxs)(a(),{href:"/echo/daily",className:"shrink-0 inline-flex items-center gap-1 text-xs font-medium text-[var(--amber)] hover:opacity-80 transition-opacity",children:[t.goToEcho,(0,r.jsx)(u.A,{size:11})]})]})]}):null}var Q=s(31885);let V="mindos:suggestion-dismissed";function ee({recent:e}){let{t}=(0,k.Y)(),s=t.suggestion,[n,i]=(0,w.useState)(!0),[l,o]=(0,w.useState)(!1);if((0,w.useEffect)(()=>{i(localStorage.getItem(V)===new Date().toDateString()),o(!0)},[]),!l||n)return null;let d=Date.now()-2592e6,c=e.filter(e=>e.mtime<d).length;return 0===c?null:(0,r.jsx)("section",{className:"mb-10",children:(0,r.jsxs)("div",{className:"flex items-center gap-3 px-3.5 py-3 rounded-xl border border-border/40 bg-card/50",children:[(0,r.jsx)(Q.A,{size:14,className:"shrink-0 text-[var(--amber)]"}),(0,r.jsxs)("div",{className:"flex-1 min-w-0 flex items-center gap-2 flex-wrap",children:[(0,r.jsx)("span",{className:"text-xs text-muted-foreground",children:s.staleFiles(c)}),(0,r.jsx)(a(),{href:"/changes",className:"text-xs font-medium text-[var(--amber)] hover:opacity-80 transition-opacity",children:s.reviewStale})]}),(0,r.jsx)("button",{onClick:()=>{i(!0),localStorage.setItem(V,new Date().toDateString())},className:"p-1 rounded hover:bg-muted transition-colors text-muted-foreground/40 hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","aria-label":s.dismiss,children:(0,r.jsx)(b.A,{size:12})})]})})}var et=s(44155),es=s(35803);function er(){window.dispatchEvent(new KeyboardEvent("keydown",{key:"k",metaKey:!0,bubbles:!0}))}function en(){window.dispatchEvent(new KeyboardEvent("keydown",{key:"/",metaKey:!0,bubbles:!0}))}function ea({icon:e,children:t,count:s,action:n}){return(0,r.jsxs)("div",{className:"flex items-center gap-2 mb-4",children:[(0,r.jsx)("span",{className:"text-[var(--amber)]",children:e}),(0,r.jsx)("h2",{className:"text-sm font-semibold font-display text-foreground",children:t}),null!=s&&s>0&&(0,r.jsx)("span",{className:"text-xs tabular-nums text-muted-foreground font-display",children:s}),n?(0,r.jsx)("div",{className:"ml-auto",children:n}):null]})}function ei({expanded:e,onToggle:t,showLabel:s,hideLabel:n,className:a=""}){return(0,r.jsxs)("button",{onClick:t,"aria-expanded":e,className:`flex items-center gap-1.5 text-xs font-medium text-[var(--amber)] transition-colors hover:opacity-80 cursor-pointer font-display ${a}`,children:[(0,r.jsx)(i.A,{size:12,className:`transition-transform duration-200 ${e?"rotate-180":""}`}),(0,r.jsx)("span",{children:e?n:s})]})}function el({filePath:e,mtime:t,formatTime:s,subPath:n}){let i=e.endsWith(".csv"),d=e.split("/").pop()||e;return(0,r.jsxs)(a(),{href:`/view/${(0,A.O0)(e)}`,className:"flex items-center gap-3 px-3 py-2 rounded-lg transition-all duration-100 hover:translate-x-0.5 hover:bg-muted group",children:[i?(0,r.jsx)(l.A,{size:12,className:"shrink-0 text-success"}):(0,r.jsx)(o.A,{size:12,className:"shrink-0 text-muted-foreground"}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsx)("span",{className:"text-sm truncate block text-foreground",suppressHydrationWarning:!0,children:d}),n&&(0,r.jsx)("span",{className:"text-xs truncate block text-muted-foreground opacity-50",suppressHydrationWarning:!0,children:n})]}),(0,r.jsx)("span",{className:"text-xs shrink-0 tabular-nums font-display text-muted-foreground opacity-40",suppressHydrationWarning:!0,children:s(t)})]})}function eo({recent:e,existingFiles:t,spaces:s}){let{t:n}=(0,k.Y)(),[i,g]=(0,w.useState)(!1),[b,v]=(0,w.useState)(!1),[j,N]=(0,w.useState)(0),y=n.ask?.suggestions??["Summarize this document","List all action items and TODOs","What are the key points?","Find related notes on this topic"];(0,w.useEffect)(()=>{let e=setInterval(()=>{N(e=>(e+1)%y.length)},3500);return()=>clearInterval(e)},[y.length]);let C=s??[],{groups:E,rootFiles:S}=(0,w.useMemo)(()=>(function(e,t){let s=new Map,r=[];for(let n of e){let e=n.path.split("/");if(e.length<2){r.push(n);continue}let a=e[0],i=t.find(e=>e.name===a);s.has(a)||s.set(a,{space:a,spacePath:a+"/",files:[],latestMtime:0,totalFiles:i?.fileCount??0});let l=s.get(a);l.files.push(n),l.latestMtime=Math.max(l.latestMtime,n.mtime)}return{groups:[...s.values()].sort((e,t)=>t.latestMtime-e.latestMtime),rootFiles:r}})(e,C),[e,C]);if(0===e.length)return(0,r.jsx)(D,{});let z=e=>(0,A.KW)(e,n.home.relativeTime),T=e[0];return(0,r.jsxs)("div",{className:"content-width px-4 md:px-6 py-10 md:py-14",children:[(0,r.jsx)(_,{}),(0,r.jsx)(em,{}),(0,r.jsxs)("div",{className:"mb-10",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3 mb-2",children:[(0,r.jsx)("div",{className:"w-1 h-7 rounded-full bg-gradient-to-b from-[var(--amber)] to-[var(--amber)]/20"}),(0,r.jsx)("h1",{className:"text-2xl font-semibold tracking-tight font-display text-foreground",children:"MindOS"})]}),(0,r.jsx)("p",{className:"text-sm leading-relaxed text-muted-foreground pl-4 max-w-lg mb-6",children:n.app.tagline}),(0,r.jsxs)("div",{className:"w-full max-w-xl flex flex-col sm:flex-row items-stretch sm:items-center gap-2 pl-4",children:[(0,r.jsxs)("button",{onClick:en,title:"⌘/","data-walkthrough":"ask-button",className:"flex-1 flex items-center gap-3 px-4 py-3 rounded-xl border border-border/60 shadow-sm bg-card transition-all duration-150 hover:border-[var(--amber)]/50 hover:shadow-md group",children:[(0,r.jsx)(d.A,{size:15,className:"shrink-0 text-[var(--amber)] group-hover:scale-110 transition-transform duration-150"}),(0,r.jsx)("span",{className:"text-sm flex-1 text-left text-muted-foreground",children:y[j]}),(0,r.jsx)("kbd",{className:"hidden sm:inline-flex items-center gap-0.5 px-2 py-0.5 rounded text-xs font-mono font-medium bg-[var(--amber-dim)] text-[var(--amber-text)]",children:"⌘/"})]}),(0,r.jsxs)("button",{onClick:er,title:"⌘K",className:"flex items-center gap-2 px-3.5 py-3 rounded-xl border border-border/60 text-sm text-muted-foreground transition-all duration-150 shrink-0 hover:bg-muted hover:shadow-sm",children:[(0,r.jsx)(c.A,{size:14}),(0,r.jsx)("kbd",{className:"hidden sm:inline-flex items-center px-1.5 py-0.5 rounded text-2xs font-mono bg-muted",children:"⌘K"})]})]}),(0,r.jsxs)("div",{className:"flex items-center gap-3 mt-4 pl-4",children:[(0,r.jsxs)(a(),{href:"/view/Untitled.md",className:"inline-flex items-center gap-2 px-3.5 py-2 rounded-lg text-sm font-medium transition-all duration-150 hover:shadow-sm bg-[var(--amber)] text-[var(--amber-foreground)]",children:[(0,r.jsx)(m.A,{size:14}),(0,r.jsx)("span",{children:n.home.newNote})]}),T&&(0,r.jsxs)(a(),{href:`/view/${(0,A.O0)(T.path)}`,className:"inline-flex items-center gap-2 px-3.5 py-2 rounded-lg text-sm font-medium transition-colors text-muted-foreground hover:text-foreground hover:bg-muted",children:[(0,r.jsx)(u.A,{size:14,className:"text-[var(--amber)]/60"}),(0,r.jsx)("span",{children:n.home.continueEditing}),(0,r.jsx)("span",{className:"text-xs opacity-40 truncate max-w-32",suppressHydrationWarning:!0,children:T.path.split("/").pop()})]})]})]}),(0,r.jsx)(G,{}),(0,r.jsx)(q,{}),(0,r.jsx)(ee,{recent:e}),(0,r.jsx)(ed,{formatTime:z}),(C.length,(0,r.jsxs)("section",{className:"mb-10",children:[(0,r.jsx)(ea,{icon:(0,r.jsx)(x.A,{size:13}),count:C.length>0?C.length:void 0,action:(0,r.jsx)(ec,{t:n}),children:n.home.spaces}),C.length>0?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-2",children:(b?C:C.slice(0,6)).map(e=>{let t=(0,A.IX)(e.name),s=(0,A.vr)(e.name),i=0===e.fileCount;return(0,r.jsxs)(a(),{href:`/view/${(0,A.O0)(e.path)}`,className:`flex items-start gap-3 px-3.5 py-3 rounded-xl border transition-all duration-150 ${i?"border-dashed border-border/50 opacity-50 hover:opacity-70":"border-border hover:border-[var(--amber)]/30 hover:shadow-sm"}`,children:[t?(0,r.jsx)("span",{className:"text-lg leading-none shrink-0 mt-0.5",suppressHydrationWarning:!0,children:t}):(0,r.jsx)(p.A,{size:16,className:"shrink-0 text-[var(--amber)] mt-0.5"}),(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsx)("span",{className:"text-sm font-medium truncate block text-foreground",children:s}),e.description&&(0,r.jsx)("span",{className:"text-xs text-muted-foreground line-clamp-1 mt-0.5",suppressHydrationWarning:!0,children:e.description}),(0,r.jsx)("span",{className:"text-xs text-muted-foreground/50 mt-0.5 block tabular-nums",children:n.home.nFiles(e.fileCount)})]})]},e.name)})}),C.length>6&&(0,r.jsx)(ei,{expanded:b,onToggle:()=>v(e=>!e),showLabel:n.home.showMore,hideLabel:n.home.showLess,className:"mt-2"})]}):(0,r.jsx)("p",{className:"text-xs text-muted-foreground py-2",children:n.home.noSpacesYet??"No spaces yet. Create one to organize your knowledge."})]})),e.length>0&&(0,r.jsxs)("section",{className:"mb-10",children:[(0,r.jsx)(ea,{icon:(0,r.jsx)(h.A,{size:13}),count:e.length,action:(0,r.jsxs)(a(),{href:"/changes",className:"flex items-center gap-1.5 text-xs font-medium text-[var(--amber)] transition-colors hover:opacity-80 font-display",children:[(0,r.jsx)(f.A,{size:12}),(0,r.jsx)("span",{children:n.home.changeHistory})]}),children:n.home.recentlyEdited}),E.length>0?(0,r.jsxs)("div",{className:"flex flex-col gap-3",children:[E.map(e=>{let t=i?e.files:e.files.slice(0,3),s=e.files.length>3;return(0,r.jsxs)("div",{children:[(0,r.jsxs)(a(),{href:`/view/${(0,A.O0)(e.spacePath)}`,className:"flex items-center gap-2 px-1 py-1.5 rounded-lg group transition-colors hover:bg-muted/50",children:[(0,r.jsx)(p.A,{size:13,className:"shrink-0 text-[var(--amber)]"}),(0,r.jsx)("span",{className:"text-xs font-semibold font-display text-foreground group-hover:text-[var(--amber)] transition-colors",suppressHydrationWarning:!0,children:e.space}),(0,r.jsxs)("span",{className:"text-xs text-muted-foreground/50 tabular-nums",suppressHydrationWarning:!0,children:[n.home.nFiles(e.totalFiles)," \xb7 ",z(e.latestMtime)]}),s&&!i&&(0,r.jsxs)("span",{className:"text-xs text-muted-foreground/30 tabular-nums",children:["+",e.files.length-3]})]}),(0,r.jsx)("div",{className:"flex flex-col gap-0.5 ml-2 border-l border-border/40 pl-3",children:t.map(({path:e,mtime:t})=>(0,r.jsx)(el,{filePath:e,mtime:t,formatTime:z,subPath:e.split("/").slice(1,-1).join("/")},e))})]},e.space)}),S.length>0&&(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 px-1 py-1.5",children:[(0,r.jsx)(o.A,{size:13,className:"shrink-0 text-muted-foreground/50"}),(0,r.jsx)("span",{className:"text-xs font-semibold font-display text-muted-foreground/60",children:n.home.other})]}),(0,r.jsx)("div",{className:"flex flex-col gap-0.5 ml-2 border-l border-border/40 pl-3",children:S.map(({path:e,mtime:t})=>(0,r.jsx)(el,{filePath:e,mtime:t,formatTime:z},e))})]}),E.some(e=>e.files.length>3)&&(0,r.jsx)(ei,{expanded:i,onToggle:()=>g(e=>!e),showLabel:n.home.showMore,hideLabel:n.home.showLess,className:"mt-1 ml-1"})]}):(0,r.jsxs)("div",{className:"relative pl-4",children:[(0,r.jsx)("div",{className:"absolute left-0 top-1 bottom-1 w-px bg-border/40"}),(0,r.jsx)("div",{className:"flex flex-col gap-0.5",children:(i?e:e.slice(0,5)).map(({path:e,mtime:t},s)=>{let n=e.endsWith(".csv"),i=e.split("/").pop()||e,d=e.split("/").slice(0,-1).join("/");return(0,r.jsxs)("div",{className:"relative group",children:[(0,r.jsx)("div",{"aria-hidden":"true",className:`absolute -left-4 top-1/2 -translate-y-1/2 rounded-full transition-all duration-150 group-hover:scale-150 ${0===s?"w-2 h-2 bg-[var(--amber)] ring-2 ring-[var(--amber)]/20":"w-1.5 h-1.5 bg-muted-foreground/20"}`}),(0,r.jsxs)(a(),{href:`/view/${(0,A.O0)(e)}`,className:"flex items-center gap-3 px-3 py-2 rounded-lg transition-all duration-100 group-hover:translate-x-0.5 hover:bg-muted",children:[n?(0,r.jsx)(l.A,{size:12,className:"shrink-0 text-success"}):(0,r.jsx)(o.A,{size:12,className:"shrink-0 text-muted-foreground/50"}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsx)("span",{className:"text-sm truncate block text-foreground",suppressHydrationWarning:!0,children:i}),d&&(0,r.jsx)("span",{className:"text-xs truncate block text-muted-foreground/40",suppressHydrationWarning:!0,children:d})]}),(0,r.jsx)("span",{className:"text-xs shrink-0 tabular-nums font-display text-muted-foreground/40",suppressHydrationWarning:!0,children:z(t)})]})]},e)})}),e.length>5&&(0,r.jsx)(ei,{expanded:i,onToggle:()=>g(e=>!e),showLabel:n.home.showMore,hideLabel:n.home.showLess,className:"mt-2 ml-3"})]})]}),(0,r.jsxs)("div",{className:"py-6 border-t border-border/20 flex items-center gap-1.5 text-xs font-display text-muted-foreground/30",children:[(0,r.jsx)(d.A,{size:10,className:"text-[var(--amber)]/40"}),(0,r.jsx)("span",{children:n.app.footer})]})]})}function ed({formatTime:e}){let{t}=(0,k.Y)(),{pinnedFiles:s,removePin:n}=(0,C.Z)();return 0===s.length?null:(0,r.jsxs)("section",{className:"mb-12",children:[(0,r.jsx)(ea,{icon:(0,r.jsx)(g.A,{size:13}),count:s.length,children:t.pinnedFiles.title}),(0,r.jsx)("div",{className:"flex flex-col gap-0.5",children:s.map(e=>{let s=e.split("/").pop()||e,i=e.split("/").slice(0,-1).join("/"),d=e.endsWith(".csv");return(0,r.jsxs)("div",{className:"group/pin relative",children:[(0,r.jsxs)(a(),{href:`/view/${(0,A.O0)(e)}`,className:"flex items-center gap-3 px-3 py-2 rounded-lg transition-all duration-100 hover:translate-x-0.5 hover:bg-muted",children:[(0,r.jsx)(g.A,{size:12,className:"shrink-0 fill-[var(--amber)] text-[var(--amber)]"}),d?(0,r.jsx)(l.A,{size:12,className:"shrink-0 text-success"}):(0,r.jsx)(o.A,{size:12,className:"shrink-0 text-muted-foreground"}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsx)("span",{className:"text-sm truncate block text-foreground",suppressHydrationWarning:!0,children:s}),i&&(0,r.jsx)("span",{className:"text-xs truncate block text-muted-foreground opacity-50",suppressHydrationWarning:!0,children:i})]})]}),(0,r.jsx)("button",{onClick:t=>{t.preventDefault(),t.stopPropagation(),n(e)},className:"absolute right-2 top-1/2 -translate-y-1/2 hidden group-hover/pin:flex p-1 rounded text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",title:t.pinnedFiles.removedToast,children:(0,r.jsx)(b.A,{size:12})})]},e)})})]})}function ec({t:e}){return(0,r.jsxs)("button",{onClick:()=>window.dispatchEvent(new Event("mindos:create-space")),className:"flex items-center gap-1.5 text-xs font-medium text-[var(--amber)] transition-colors hover:opacity-80 cursor-pointer font-display",children:[(0,r.jsx)(v.A,{size:12}),(0,r.jsx)("span",{children:e.home.newSpace})]})}function em(){let{t:e}=(0,k.Y)(),[t,s]=(0,w.useState)(null),[n,a]=(0,w.useState)(!1),[i,l]=(0,w.useState)(!1),[o,d]=(0,w.useState)(!1);(0,w.useEffect)(()=>{(0,et.D)().then(e=>{e.files.length>0&&s(e.files.length)}).catch(e=>{console.warn("[HomeContent] scanExampleFilesAction failed:",e)})},[]);let c=(0,w.useCallback)(async()=>{if(null!==t){a(!0);try{(await (0,es.E)()).success&&(l(!0),setTimeout(()=>d(!0),2500))}catch{}a(!1)}},[t]);return o||null===t||0===t?null:i?(0,r.jsxs)("div",{className:"mb-6 flex items-center gap-2.5 px-4 py-3 rounded-xl border border-success/30 bg-success/5 animate-in fade-in duration-300",children:[(0,r.jsx)(j.A,{size:14,className:"text-success shrink-0"}),(0,r.jsx)("span",{className:"text-xs text-success",children:e.home.cleanupExamplesDone})]}):(0,r.jsxs)("div",{className:"mb-6 flex items-center gap-3 px-4 py-3 rounded-xl border border-border bg-muted/30 animate-in fade-in duration-300",children:[(0,r.jsx)("span",{className:"text-sm leading-none shrink-0",children:"\uD83E\uDDEA"}),(0,r.jsx)("span",{className:"text-xs text-muted-foreground flex-1",children:e.home.cleanupExamples(t)}),(0,r.jsxs)("button",{onClick:c,disabled:n,className:"flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium rounded-lg transition-colors shrink-0 disabled:opacity-50 bg-[var(--amber-dim)] text-[var(--amber-text)] hover:opacity-80",children:[n?(0,r.jsx)(N.A,{size:11,className:"animate-spin"}):(0,r.jsx)(y.A,{size:11}),e.home.cleanupExamplesButton]}),(0,r.jsx)("button",{onClick:()=>d(!0),className:"p-1 rounded hover:bg-muted transition-colors text-muted-foreground shrink-0",children:(0,r.jsx)(b.A,{size:12})})]})}},76449:(e,t,s)=>{"use strict";s.d(t,{g:()=>r});let r=[{anchor:"files-panel",position:"right"},{anchor:"ask-button",position:"right"},{anchor:"agents-panel",position:"right"},{anchor:"echo-panel",position:"right"}]},91337:(e,t,s)=>{"use strict";s.d(t,{IX:()=>o,KW:()=>l,O0:()=>i,cn:()=>a,vr:()=>d});var r=s(29722),n=s(622);function a(...e){return(0,n.QP)((0,r.$)(e))}function i(e){return e.split("/").map(encodeURIComponent).join("/")}function l(e,t){let s=Date.now()-e,r=Math.floor(s/6e4),n=Math.floor(s/36e5),a=Math.floor(s/864e5);return r<1?t.justNow:r<60?t.minutesAgo(r):n<24?t.hoursAgo(n):a<7?t.daysAgo(a):new Date(e).toLocaleDateString()}function o(e){let t=e.match(/^[\p{Emoji_Presentation}\p{Extended_Pictographic}]+/u);return t?.[0]??""}function d(e){return e.replace(/^[\p{Emoji_Presentation}\p{Extended_Pictographic}\s]+/u,"")||e}}},e=>{e.O(0,[9602,8409,5637,1263,8441,3794,7358],()=>e(e.s=14153)),_N_E=e.O()}]);
|
|
7
|
+
`,children:[(0,r.jsx)("span",{className:`${n?"animate-in zoom-in-50 duration-300 text-success":"text-[var(--amber)]"}`,children:n?(0,r.jsx)(j.A,{size:16}):e}),(0,r.jsx)("span",{className:"text-xs font-medium text-foreground",children:t}),!n&&!i&&(0,r.jsxs)("span",{className:"text-2xs text-[var(--amber-text)]",children:[s," →"]})]})}var Y=s(49619),J=s(9930);let B="mindos:pulse-collapsed";function G(){let e=(0,J.cd)(),{t}=(0,k.Y)(),s=t.pulse,[n,l]=(0,w.useState)(!1),[o,d]=(0,w.useState)(!1);(0,w.useEffect)(()=>{let e=localStorage.getItem(B);null!==e&&l("1"===e)},[]);let c=e?.agents??[],m=e?.status??null,x=(0,w.useMemo)(()=>[...c].sort((e,t)=>{let s=e=>e.installed?3:2*!!e.present,r=s(t)-s(e);if(0!==r)return r;let n=e.runtimeLastActivityAt?new Date(e.runtimeLastActivityAt).getTime():0;return(t.runtimeLastActivityAt?new Date(t.runtimeLastActivityAt).getTime():0)-n}),[c]).filter(e=>e.installed),p=m?.running??!1,h=()=>{let e=!n;l(e),localStorage.setItem(B,e?"1":"0")};if(!e||e.loading)return null;if(c.every(e=>!e.present))return(0,r.jsxs)("section",{className:"mb-10",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 mb-4",children:[(0,r.jsx)("span",{className:"text-[var(--amber)]",children:(0,r.jsx)(Y.A,{size:13})}),(0,r.jsx)("h2",{className:"text-sm font-semibold font-display text-foreground",children:s.title})]}),(0,r.jsx)("div",{className:"rounded-xl border border-dashed border-border/60 p-4",children:(0,r.jsxs)("div",{className:"flex items-center gap-4",children:[(0,r.jsx)("div",{className:"w-9 h-9 rounded-lg bg-[var(--amber)]/8 flex items-center justify-center shrink-0",children:(0,r.jsx)(Y.A,{size:16,className:"text-[var(--amber)]"})}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsx)("p",{className:"text-sm font-medium text-foreground",children:s.connectTitle}),(0,r.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5",children:s.connectDesc})]}),(0,r.jsxs)(a(),{href:"/agents",className:"shrink-0 inline-flex items-center gap-1.5 px-3.5 py-2 rounded-lg text-xs font-medium bg-[var(--amber)] text-[var(--amber-foreground)] transition-opacity hover:opacity-90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[s.connectAction,(0,r.jsx)(u.A,{size:11})]})]})})]});let f=x.length;if(n)return(0,r.jsx)("section",{className:"mb-10",children:(0,r.jsxs)("button",{onClick:h,className:"w-full flex items-center gap-2 group cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring rounded",children:[(0,r.jsx)("span",{className:"text-[var(--amber)]",children:(0,r.jsx)(Y.A,{size:13})}),(0,r.jsx)("h2",{className:"text-sm font-semibold font-display text-foreground",children:s.title}),f>0&&(0,r.jsx)("span",{className:"text-xs tabular-nums text-muted-foreground font-display",children:f}),(0,r.jsxs)("div",{className:"flex items-center gap-2 ml-1",children:[x.slice(0,3).map(e=>(0,r.jsxs)("span",{className:"inline-flex items-center gap-1 text-xs text-muted-foreground/60",children:[(0,r.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-emerald-500 shrink-0"}),(0,r.jsx)("span",{className:"hidden sm:inline",children:e.name})]},e.key)),f>3&&(0,r.jsxs)("span",{className:"text-xs text-muted-foreground/40",children:["+",f-3]})]}),(0,r.jsx)(i.A,{size:12,className:"ml-auto text-muted-foreground/30 group-hover:text-[var(--amber)] transition-colors"})]})});let g=o?x:x.slice(0,3),b=x.length-3;return(0,r.jsxs)("section",{className:"mb-10",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 mb-4",children:[(0,r.jsx)("span",{className:"text-[var(--amber)]",children:(0,r.jsx)(Y.A,{size:13})}),(0,r.jsx)("h2",{className:"text-sm font-semibold font-display text-foreground",children:s.title}),f>0&&(0,r.jsx)("span",{className:"text-xs tabular-nums text-muted-foreground font-display",children:f}),p&&(0,r.jsxs)("span",{className:"inline-flex items-center gap-1 text-xs text-muted-foreground/50 ml-1",children:[(0,r.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-emerald-500"}),(0,r.jsx)("span",{className:"hidden sm:inline",children:s.running})]}),(0,r.jsxs)("div",{className:"flex items-center gap-2 ml-auto",children:[(0,r.jsx)(a(),{href:"/agents",className:"text-xs font-medium text-[var(--amber)] hover:opacity-80 transition-opacity font-display",children:s.manage}),(0,r.jsx)("button",{onClick:h,className:"p-1 rounded hover:bg-muted transition-colors text-muted-foreground/40 hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","aria-label":"Collapse",children:(0,r.jsx)(i.A,{size:12,className:"rotate-180"})})]})]}),(0,r.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-2",children:g.map(e=>{var t;let n,a=function(e){if(!e)return null;let t=Date.now()-new Date(e).getTime();return t<6e4?"<1m":t<36e5?`${Math.floor(t/6e4)}m`:t<864e5?`${Math.floor(t/36e5)}h`:`${Math.floor(t/864e5)}d`}(e.runtimeLastActivityAt);return(0,r.jsxs)("div",{className:"flex items-center gap-3 px-3.5 py-3 rounded-xl border border-border hover:border-[var(--amber)]/30 hover:shadow-sm transition-all duration-150",children:[(0,r.jsxs)("div",{className:"relative w-8 h-8 rounded-lg bg-[var(--amber)]/8 text-[var(--amber-text)] ring-1 ring-[var(--amber)]/15 flex items-center justify-center text-xs font-semibold font-display shrink-0",children:[(n=(t=e.name).split(/[\s-]+/)).length>=2?(n[0][0]+n[1][0]).toUpperCase():t.slice(0,2).toUpperCase(),(0,r.jsx)("span",{className:"absolute -top-0.5 -right-0.5 w-2 h-2 rounded-full bg-emerald-500 ring-[1.5px] ring-card"})]}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsx)("span",{className:"text-sm font-medium text-foreground block truncate",children:e.name}),(0,r.jsxs)("span",{className:"text-xs text-muted-foreground/60 block",children:[s.active,a?` \xb7 ${a}`:""]})]})]},e.key)})}),b>0&&(0,r.jsxs)("button",{onClick:()=>d(e=>!e),className:"flex items-center gap-1.5 mt-2 text-xs font-medium text-[var(--amber)] hover:opacity-80 transition-opacity cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring rounded",children:[(0,r.jsx)(i.A,{size:12,className:`transition-transform duration-200 ${o?"rotate-180":""}`}),(0,r.jsx)("span",{children:o?s.showLess:s.showMore(b)})]})]})}var X=s(95977);let Z="mindos-echo-daily-line";function q(){let{t:e}=(0,k.Y)(),t=e.echoSpotlight,[s,n]=(0,w.useState)(""),[i,l]=(0,w.useState)(!1),[o,d]=(0,w.useState)(!1),c=(0,w.useRef)(null);(0,w.useEffect)(()=>{n(localStorage.getItem(Z)??""),d(!0)},[]),(0,w.useEffect)(()=>{i&&c.current&&c.current.focus()},[i]);let m=e=>{n(e),localStorage.setItem(Z,e)};return o?s.trim()?(0,r.jsxs)("section",{className:"mb-10",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 mb-4",children:[(0,r.jsx)("span",{className:"text-[var(--amber)]",children:(0,r.jsx)(X.A,{size:13})}),(0,r.jsx)("h2",{className:"text-sm font-semibold font-display text-foreground",children:t.title}),(0,r.jsx)("span",{className:"text-xs text-muted-foreground/50 font-display",children:t.dailyLine}),(0,r.jsx)(a(),{href:"/echo/daily",className:"ml-auto text-xs font-medium text-[var(--amber)] hover:opacity-80 transition-opacity font-display",children:t.goToEcho})]}),(0,r.jsx)("div",{className:"group",children:i?(0,r.jsx)("input",{ref:c,type:"text",value:s,onChange:e=>m(e.target.value),onBlur:()=>l(!1),onKeyDown:e=>{"Enter"===e.key&&l(!1)},className:"w-full px-3.5 py-3 rounded-xl border border-[var(--amber)]/40 bg-card text-sm text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring font-display italic",placeholder:t.placeholder}):(0,r.jsxs)("button",{onClick:()=>l(!0),className:"w-full text-left px-3.5 py-3 rounded-xl border border-border/40 hover:border-[var(--amber)]/30 transition-all duration-150 cursor-text group-hover:shadow-sm",children:[(0,r.jsxs)("p",{className:"text-sm text-foreground/80 font-display italic leading-relaxed",children:["“",s,"”"]}),(0,r.jsx)("p",{className:"text-xs text-muted-foreground/40 mt-1",children:t.savedLocally})]})})]}):(0,r.jsxs)("section",{className:"mb-10",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 mb-4",children:[(0,r.jsx)("span",{className:"text-[var(--amber)]",children:(0,r.jsx)(X.A,{size:13})}),(0,r.jsx)("h2",{className:"text-sm font-semibold font-display text-foreground",children:t.title})]}),(0,r.jsxs)("div",{className:"flex items-center gap-4 px-3.5 py-3.5 rounded-xl border border-dashed border-border/60 hover:border-[var(--amber)]/30 transition-all duration-150 group",children:[(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsx)("input",{type:"text",value:s,onChange:e=>m(e.target.value),className:"w-full bg-transparent text-sm text-foreground placeholder:text-muted-foreground/40 focus-visible:outline-none font-display italic",placeholder:t.placeholder}),(0,r.jsx)("p",{className:"text-xs text-muted-foreground/40 mt-1",children:t.inviteDesc})]}),(0,r.jsxs)(a(),{href:"/echo/daily",className:"shrink-0 inline-flex items-center gap-1 text-xs font-medium text-[var(--amber)] hover:opacity-80 transition-opacity",children:[t.goToEcho,(0,r.jsx)(u.A,{size:11})]})]})]}):null}var Q=s(31885);let V="mindos:suggestion-dismissed";function ee({recent:e}){let{t}=(0,k.Y)(),s=t.suggestion,[n,i]=(0,w.useState)(!0),[l,o]=(0,w.useState)(!1);if((0,w.useEffect)(()=>{i(localStorage.getItem(V)===new Date().toDateString()),o(!0)},[]),!l||n)return null;let d=Date.now()-2592e6,c=e.filter(e=>e.mtime<d).length;return 0===c?null:(0,r.jsx)("section",{className:"mb-10",children:(0,r.jsxs)("div",{className:"flex items-center gap-3 px-3.5 py-3 rounded-xl border border-border/40 bg-card/50",children:[(0,r.jsx)(Q.A,{size:14,className:"shrink-0 text-[var(--amber)]"}),(0,r.jsxs)("div",{className:"flex-1 min-w-0 flex items-center gap-2 flex-wrap",children:[(0,r.jsx)("span",{className:"text-xs text-muted-foreground",children:s.staleFiles(c)}),(0,r.jsx)(a(),{href:"/changes",className:"text-xs font-medium text-[var(--amber)] hover:opacity-80 transition-opacity",children:s.reviewStale})]}),(0,r.jsx)("button",{onClick:()=>{i(!0),localStorage.setItem(V,new Date().toDateString())},className:"p-1 rounded hover:bg-muted transition-colors text-muted-foreground/40 hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","aria-label":s.dismiss,children:(0,r.jsx)(b.A,{size:12})})]})})}var et=s(69335),es=s(64576);function er(){window.dispatchEvent(new KeyboardEvent("keydown",{key:"k",metaKey:!0,bubbles:!0}))}function en(){window.dispatchEvent(new KeyboardEvent("keydown",{key:"/",metaKey:!0,bubbles:!0}))}function ea({icon:e,children:t,count:s,action:n}){return(0,r.jsxs)("div",{className:"flex items-center gap-2 mb-4",children:[(0,r.jsx)("span",{className:"text-[var(--amber)]",children:e}),(0,r.jsx)("h2",{className:"text-sm font-semibold font-display text-foreground",children:t}),null!=s&&s>0&&(0,r.jsx)("span",{className:"text-xs tabular-nums text-muted-foreground font-display",children:s}),n?(0,r.jsx)("div",{className:"ml-auto",children:n}):null]})}function ei({expanded:e,onToggle:t,showLabel:s,hideLabel:n,className:a=""}){return(0,r.jsxs)("button",{onClick:t,"aria-expanded":e,className:`flex items-center gap-1.5 text-xs font-medium text-[var(--amber)] transition-colors hover:opacity-80 cursor-pointer font-display ${a}`,children:[(0,r.jsx)(i.A,{size:12,className:`transition-transform duration-200 ${e?"rotate-180":""}`}),(0,r.jsx)("span",{children:e?n:s})]})}function el({filePath:e,mtime:t,formatTime:s,subPath:n}){let i=e.endsWith(".csv"),d=e.split("/").pop()||e;return(0,r.jsxs)(a(),{href:`/view/${(0,A.O0)(e)}`,className:"flex items-center gap-3 px-3 py-2 rounded-lg transition-all duration-100 hover:translate-x-0.5 hover:bg-muted group",children:[i?(0,r.jsx)(l.A,{size:12,className:"shrink-0 text-success"}):(0,r.jsx)(o.A,{size:12,className:"shrink-0 text-muted-foreground"}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsx)("span",{className:"text-sm truncate block text-foreground",suppressHydrationWarning:!0,children:d}),n&&(0,r.jsx)("span",{className:"text-xs truncate block text-muted-foreground opacity-50",suppressHydrationWarning:!0,children:n})]}),(0,r.jsx)("span",{className:"text-xs shrink-0 tabular-nums font-display text-muted-foreground opacity-40",suppressHydrationWarning:!0,children:s(t)})]})}function eo({recent:e,existingFiles:t,spaces:s}){let{t:n}=(0,k.Y)(),[i,g]=(0,w.useState)(!1),[b,v]=(0,w.useState)(!1),[j,N]=(0,w.useState)(0),y=n.ask?.suggestions??["Summarize this document","List all action items and TODOs","What are the key points?","Find related notes on this topic"];(0,w.useEffect)(()=>{let e=setInterval(()=>{N(e=>(e+1)%y.length)},3500);return()=>clearInterval(e)},[y.length]);let C=s??[],{groups:E,rootFiles:S}=(0,w.useMemo)(()=>(function(e,t){let s=new Map,r=[];for(let n of e){let e=n.path.split("/");if(e.length<2){r.push(n);continue}let a=e[0],i=t.find(e=>e.name===a);s.has(a)||s.set(a,{space:a,spacePath:a+"/",files:[],latestMtime:0,totalFiles:i?.fileCount??0});let l=s.get(a);l.files.push(n),l.latestMtime=Math.max(l.latestMtime,n.mtime)}return{groups:[...s.values()].sort((e,t)=>t.latestMtime-e.latestMtime),rootFiles:r}})(e,C),[e,C]);if(0===e.length)return(0,r.jsx)(D,{});let z=e=>(0,A.KW)(e,n.home.relativeTime),T=e[0];return(0,r.jsxs)("div",{className:"content-width px-4 md:px-6 py-10 md:py-14",children:[(0,r.jsx)(_,{}),(0,r.jsx)(em,{}),(0,r.jsxs)("div",{className:"mb-10",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3 mb-2",children:[(0,r.jsx)("div",{className:"w-1 h-7 rounded-full bg-gradient-to-b from-[var(--amber)] to-[var(--amber)]/20"}),(0,r.jsx)("h1",{className:"text-2xl font-semibold tracking-tight font-display text-foreground",children:"MindOS"})]}),(0,r.jsx)("p",{className:"text-sm leading-relaxed text-muted-foreground pl-4 max-w-lg mb-6",children:n.app.tagline}),(0,r.jsxs)("div",{className:"w-full max-w-xl flex flex-col sm:flex-row items-stretch sm:items-center gap-2 pl-4",children:[(0,r.jsxs)("button",{onClick:en,title:"⌘/","data-walkthrough":"ask-button",className:"flex-1 flex items-center gap-3 px-4 py-3 rounded-xl border border-border/60 shadow-sm bg-card transition-all duration-150 hover:border-[var(--amber)]/50 hover:shadow-md group",children:[(0,r.jsx)(d.A,{size:15,className:"shrink-0 text-[var(--amber)] group-hover:scale-110 transition-transform duration-150"}),(0,r.jsx)("span",{className:"text-sm flex-1 text-left text-muted-foreground",children:y[j]}),(0,r.jsx)("kbd",{className:"hidden sm:inline-flex items-center gap-0.5 px-2 py-0.5 rounded text-xs font-mono font-medium bg-[var(--amber-dim)] text-[var(--amber-text)]",children:"⌘/"})]}),(0,r.jsxs)("button",{onClick:er,title:"⌘K",className:"flex items-center gap-2 px-3.5 py-3 rounded-xl border border-border/60 text-sm text-muted-foreground transition-all duration-150 shrink-0 hover:bg-muted hover:shadow-sm",children:[(0,r.jsx)(c.A,{size:14}),(0,r.jsx)("kbd",{className:"hidden sm:inline-flex items-center px-1.5 py-0.5 rounded text-2xs font-mono bg-muted",children:"⌘K"})]})]}),(0,r.jsxs)("div",{className:"flex items-center gap-3 mt-4 pl-4",children:[(0,r.jsxs)(a(),{href:"/view/Untitled.md",className:"inline-flex items-center gap-2 px-3.5 py-2 rounded-lg text-sm font-medium transition-all duration-150 hover:shadow-sm bg-[var(--amber)] text-[var(--amber-foreground)]",children:[(0,r.jsx)(m.A,{size:14}),(0,r.jsx)("span",{children:n.home.newNote})]}),T&&(0,r.jsxs)(a(),{href:`/view/${(0,A.O0)(T.path)}`,className:"inline-flex items-center gap-2 px-3.5 py-2 rounded-lg text-sm font-medium transition-colors text-muted-foreground hover:text-foreground hover:bg-muted",children:[(0,r.jsx)(u.A,{size:14,className:"text-[var(--amber)]/60"}),(0,r.jsx)("span",{children:n.home.continueEditing}),(0,r.jsx)("span",{className:"text-xs opacity-40 truncate max-w-32",suppressHydrationWarning:!0,children:T.path.split("/").pop()})]})]})]}),(0,r.jsx)(G,{}),(0,r.jsx)(q,{}),(0,r.jsx)(ee,{recent:e}),(0,r.jsx)(ed,{formatTime:z}),(C.length,(0,r.jsxs)("section",{className:"mb-10",children:[(0,r.jsx)(ea,{icon:(0,r.jsx)(x.A,{size:13}),count:C.length>0?C.length:void 0,action:(0,r.jsx)(ec,{t:n}),children:n.home.spaces}),C.length>0?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-2",children:(b?C:C.slice(0,6)).map(e=>{let t=(0,A.IX)(e.name),s=(0,A.vr)(e.name),i=0===e.fileCount;return(0,r.jsxs)(a(),{href:`/view/${(0,A.O0)(e.path)}`,className:`flex items-start gap-3 px-3.5 py-3 rounded-xl border transition-all duration-150 ${i?"border-dashed border-border/50 opacity-50 hover:opacity-70":"border-border hover:border-[var(--amber)]/30 hover:shadow-sm"}`,children:[t?(0,r.jsx)("span",{className:"text-lg leading-none shrink-0 mt-0.5",suppressHydrationWarning:!0,children:t}):(0,r.jsx)(p.A,{size:16,className:"shrink-0 text-[var(--amber)] mt-0.5"}),(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsx)("span",{className:"text-sm font-medium truncate block text-foreground",children:s}),e.description&&(0,r.jsx)("span",{className:"text-xs text-muted-foreground line-clamp-1 mt-0.5",suppressHydrationWarning:!0,children:e.description}),(0,r.jsx)("span",{className:"text-xs text-muted-foreground/50 mt-0.5 block tabular-nums",children:n.home.nFiles(e.fileCount)})]})]},e.name)})}),C.length>6&&(0,r.jsx)(ei,{expanded:b,onToggle:()=>v(e=>!e),showLabel:n.home.showMore,hideLabel:n.home.showLess,className:"mt-2"})]}):(0,r.jsx)("p",{className:"text-xs text-muted-foreground py-2",children:n.home.noSpacesYet??"No spaces yet. Create one to organize your knowledge."})]})),e.length>0&&(0,r.jsxs)("section",{className:"mb-10",children:[(0,r.jsx)(ea,{icon:(0,r.jsx)(h.A,{size:13}),count:e.length,action:(0,r.jsxs)(a(),{href:"/changes",className:"flex items-center gap-1.5 text-xs font-medium text-[var(--amber)] transition-colors hover:opacity-80 font-display",children:[(0,r.jsx)(f.A,{size:12}),(0,r.jsx)("span",{children:n.home.changeHistory})]}),children:n.home.recentlyEdited}),E.length>0?(0,r.jsxs)("div",{className:"flex flex-col gap-3",children:[E.map(e=>{let t=i?e.files:e.files.slice(0,3),s=e.files.length>3;return(0,r.jsxs)("div",{children:[(0,r.jsxs)(a(),{href:`/view/${(0,A.O0)(e.spacePath)}`,className:"flex items-center gap-2 px-1 py-1.5 rounded-lg group transition-colors hover:bg-muted/50",children:[(0,r.jsx)(p.A,{size:13,className:"shrink-0 text-[var(--amber)]"}),(0,r.jsx)("span",{className:"text-xs font-semibold font-display text-foreground group-hover:text-[var(--amber)] transition-colors",suppressHydrationWarning:!0,children:e.space}),(0,r.jsxs)("span",{className:"text-xs text-muted-foreground/50 tabular-nums",suppressHydrationWarning:!0,children:[n.home.nFiles(e.totalFiles)," \xb7 ",z(e.latestMtime)]}),s&&!i&&(0,r.jsxs)("span",{className:"text-xs text-muted-foreground/30 tabular-nums",children:["+",e.files.length-3]})]}),(0,r.jsx)("div",{className:"flex flex-col gap-0.5 ml-2 border-l border-border/40 pl-3",children:t.map(({path:e,mtime:t})=>(0,r.jsx)(el,{filePath:e,mtime:t,formatTime:z,subPath:e.split("/").slice(1,-1).join("/")},e))})]},e.space)}),S.length>0&&(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 px-1 py-1.5",children:[(0,r.jsx)(o.A,{size:13,className:"shrink-0 text-muted-foreground/50"}),(0,r.jsx)("span",{className:"text-xs font-semibold font-display text-muted-foreground/60",children:n.home.other})]}),(0,r.jsx)("div",{className:"flex flex-col gap-0.5 ml-2 border-l border-border/40 pl-3",children:S.map(({path:e,mtime:t})=>(0,r.jsx)(el,{filePath:e,mtime:t,formatTime:z},e))})]}),E.some(e=>e.files.length>3)&&(0,r.jsx)(ei,{expanded:i,onToggle:()=>g(e=>!e),showLabel:n.home.showMore,hideLabel:n.home.showLess,className:"mt-1 ml-1"})]}):(0,r.jsxs)("div",{className:"relative pl-4",children:[(0,r.jsx)("div",{className:"absolute left-0 top-1 bottom-1 w-px bg-border/40"}),(0,r.jsx)("div",{className:"flex flex-col gap-0.5",children:(i?e:e.slice(0,5)).map(({path:e,mtime:t},s)=>{let n=e.endsWith(".csv"),i=e.split("/").pop()||e,d=e.split("/").slice(0,-1).join("/");return(0,r.jsxs)("div",{className:"relative group",children:[(0,r.jsx)("div",{"aria-hidden":"true",className:`absolute -left-4 top-1/2 -translate-y-1/2 rounded-full transition-all duration-150 group-hover:scale-150 ${0===s?"w-2 h-2 bg-[var(--amber)] ring-2 ring-[var(--amber)]/20":"w-1.5 h-1.5 bg-muted-foreground/20"}`}),(0,r.jsxs)(a(),{href:`/view/${(0,A.O0)(e)}`,className:"flex items-center gap-3 px-3 py-2 rounded-lg transition-all duration-100 group-hover:translate-x-0.5 hover:bg-muted",children:[n?(0,r.jsx)(l.A,{size:12,className:"shrink-0 text-success"}):(0,r.jsx)(o.A,{size:12,className:"shrink-0 text-muted-foreground/50"}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsx)("span",{className:"text-sm truncate block text-foreground",suppressHydrationWarning:!0,children:i}),d&&(0,r.jsx)("span",{className:"text-xs truncate block text-muted-foreground/40",suppressHydrationWarning:!0,children:d})]}),(0,r.jsx)("span",{className:"text-xs shrink-0 tabular-nums font-display text-muted-foreground/40",suppressHydrationWarning:!0,children:z(t)})]})]},e)})}),e.length>5&&(0,r.jsx)(ei,{expanded:i,onToggle:()=>g(e=>!e),showLabel:n.home.showMore,hideLabel:n.home.showLess,className:"mt-2 ml-3"})]})]}),(0,r.jsxs)("div",{className:"py-6 border-t border-border/20 flex items-center gap-1.5 text-xs font-display text-muted-foreground/30",children:[(0,r.jsx)(d.A,{size:10,className:"text-[var(--amber)]/40"}),(0,r.jsx)("span",{children:n.app.footer})]})]})}function ed({formatTime:e}){let{t}=(0,k.Y)(),{pinnedFiles:s,removePin:n}=(0,C.Z)();return 0===s.length?null:(0,r.jsxs)("section",{className:"mb-12",children:[(0,r.jsx)(ea,{icon:(0,r.jsx)(g.A,{size:13}),count:s.length,children:t.pinnedFiles.title}),(0,r.jsx)("div",{className:"flex flex-col gap-0.5",children:s.map(e=>{let s=e.split("/").pop()||e,i=e.split("/").slice(0,-1).join("/"),d=e.endsWith(".csv");return(0,r.jsxs)("div",{className:"group/pin relative",children:[(0,r.jsxs)(a(),{href:`/view/${(0,A.O0)(e)}`,className:"flex items-center gap-3 px-3 py-2 rounded-lg transition-all duration-100 hover:translate-x-0.5 hover:bg-muted",children:[(0,r.jsx)(g.A,{size:12,className:"shrink-0 fill-[var(--amber)] text-[var(--amber)]"}),d?(0,r.jsx)(l.A,{size:12,className:"shrink-0 text-success"}):(0,r.jsx)(o.A,{size:12,className:"shrink-0 text-muted-foreground"}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsx)("span",{className:"text-sm truncate block text-foreground",suppressHydrationWarning:!0,children:s}),i&&(0,r.jsx)("span",{className:"text-xs truncate block text-muted-foreground opacity-50",suppressHydrationWarning:!0,children:i})]})]}),(0,r.jsx)("button",{onClick:t=>{t.preventDefault(),t.stopPropagation(),n(e)},className:"absolute right-2 top-1/2 -translate-y-1/2 hidden group-hover/pin:flex p-1 rounded text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",title:t.pinnedFiles.removedToast,children:(0,r.jsx)(b.A,{size:12})})]},e)})})]})}function ec({t:e}){return(0,r.jsxs)("button",{onClick:()=>window.dispatchEvent(new Event("mindos:create-space")),className:"flex items-center gap-1.5 text-xs font-medium text-[var(--amber)] transition-colors hover:opacity-80 cursor-pointer font-display",children:[(0,r.jsx)(v.A,{size:12}),(0,r.jsx)("span",{children:e.home.newSpace})]})}function em(){let{t:e}=(0,k.Y)(),[t,s]=(0,w.useState)(null),[n,a]=(0,w.useState)(!1),[i,l]=(0,w.useState)(!1),[o,d]=(0,w.useState)(!1);(0,w.useEffect)(()=>{(0,et.D)().then(e=>{e.files.length>0&&s(e.files.length)}).catch(e=>{console.warn("[HomeContent] scanExampleFilesAction failed:",e)})},[]);let c=(0,w.useCallback)(async()=>{if(null!==t){a(!0);try{(await (0,es.E)()).success&&(l(!0),setTimeout(()=>d(!0),2500))}catch{}a(!1)}},[t]);return o||null===t||0===t?null:i?(0,r.jsxs)("div",{className:"mb-6 flex items-center gap-2.5 px-4 py-3 rounded-xl border border-success/30 bg-success/5 animate-in fade-in duration-300",children:[(0,r.jsx)(j.A,{size:14,className:"text-success shrink-0"}),(0,r.jsx)("span",{className:"text-xs text-success",children:e.home.cleanupExamplesDone})]}):(0,r.jsxs)("div",{className:"mb-6 flex items-center gap-3 px-4 py-3 rounded-xl border border-border bg-muted/30 animate-in fade-in duration-300",children:[(0,r.jsx)("span",{className:"text-sm leading-none shrink-0",children:"\uD83E\uDDEA"}),(0,r.jsx)("span",{className:"text-xs text-muted-foreground flex-1",children:e.home.cleanupExamples(t)}),(0,r.jsxs)("button",{onClick:c,disabled:n,className:"flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium rounded-lg transition-colors shrink-0 disabled:opacity-50 bg-[var(--amber-dim)] text-[var(--amber-text)] hover:opacity-80",children:[n?(0,r.jsx)(N.A,{size:11,className:"animate-spin"}):(0,r.jsx)(y.A,{size:11}),e.home.cleanupExamplesButton]}),(0,r.jsx)("button",{onClick:()=>d(!0),className:"p-1 rounded hover:bg-muted transition-colors text-muted-foreground shrink-0",children:(0,r.jsx)(b.A,{size:12})})]})}},76449:(e,t,s)=>{"use strict";s.d(t,{g:()=>r});let r=[{anchor:"files-panel",position:"right"},{anchor:"ask-button",position:"right"},{anchor:"agents-panel",position:"right"},{anchor:"echo-panel",position:"right"}]},91337:(e,t,s)=>{"use strict";s.d(t,{IX:()=>o,KW:()=>l,O0:()=>i,cn:()=>a,vr:()=>d});var r=s(29722),n=s(622);function a(...e){return(0,n.QP)((0,r.$)(e))}function i(e){return e.split("/").map(encodeURIComponent).join("/")}function l(e,t){let s=Date.now()-e,r=Math.floor(s/6e4),n=Math.floor(s/36e5),a=Math.floor(s/864e5);return r<1?t.justNow:r<60?t.minutesAgo(r):n<24?t.hoursAgo(n):a<7?t.daysAgo(a):new Date(e).toLocaleDateString()}function o(e){let t=e.match(/^[\p{Emoji_Presentation}\p{Extended_Pictographic}]+/u);return t?.[0]??""}function d(e){return e.replace(/^[\p{Emoji_Presentation}\p{Extended_Pictographic}\s]+/u,"")||e}}},e=>{e.O(0,[9602,8409,5637,1263,8441,3794,7358],()=>e(e.s=14153)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[620],{4235:(e,t,r)=>{"use strict";r.d(t,{B1:()=>l,X8:()=>d,dV:()=>i,oR:()=>u});let s=[],a=[],o=0;function n(){for(let e of a)e()}function l(e){return a=[...a,e],()=>{a=a.filter(t=>t!==e)}}function i(){return s}function d(e){s=s.filter(t=>t.id!==e),n()}function c(e){let t=`toast-${++o}`,r={id:t,message:e.message,type:e.type??"info",duration:e.duration??2e3,action:e.action};s=[...s,r].slice(-3),n(),r.duration>0&&setTimeout(()=>d(t),r.duration)}function u(e,t){c({message:e,...t})}u.success=(e,t)=>c({message:e,type:"success",duration:t}),u.undo=(e,t,r)=>c({message:e,type:"info",duration:r?.duration??5e3,action:{label:r?.label??"Undo",onClick:t}}),u.error=(e,t)=>c({message:e,type:"error",duration:t}),u.copy=(e="Copied")=>c({message:e,type:"success",duration:1500})},6296:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(90425).A)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},7834:(e,t,r)=>{"use strict";async function s(e){if(navigator.clipboard?.writeText)try{return await navigator.clipboard.writeText(e),!0}catch{}try{let t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t),t.select();let r=document.execCommand("copy");return document.body.removeChild(t),r}catch{return!1}}r.d(t,{l:()=>s})},12651:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(90425).A)("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},13545:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(90425).A)("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]])},15721:(e,t,r)=>{Promise.resolve().then(r.bind(r,22952))},20171:(e,t,r)=>{"use strict";r.d(t,{Ak:()=>m,Bt:()=>u,D0:()=>i,L7:()=>h,eN:()=>l,jn:()=>x,l6:()=>c,lM:()=>p,pM:()=>g,pd:()=>d});var s=r(95155),a=r(12115),o=r(66088),n=r(94514);function l({children:e}){return(0,s.jsx)("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider mb-3",children:e})}function i({label:e,hint:t,children:r}){return(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsx)("label",{className:"text-sm text-foreground font-medium",children:e}),r,t&&(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:t})]})}function d({className:e="",...t}){return(0,s.jsx)("input",{...t,className:`w-full px-3 py-2 text-sm bg-background border border-border rounded-lg text-foreground placeholder:text-muted-foreground outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:opacity-50 ${e}`})}function c({value:e,onChange:t,children:r,className:l="",disabled:i}){let d=(0,a.useId)(),[c,u]=(0,a.useState)(!1),[p,m]=(0,a.useState)(-1),x=(0,a.useRef)(null),h=(0,a.useRef)(null),g=(0,a.useMemo)(()=>a.Children.toArray(r).filter(e=>a.isValidElement(e)&&"option"===e.type).map(e=>({value:String(e.props.value??""),label:String(e.props.children??e.props.value??"")})),[r]),b=g.findIndex(t=>t.value===e),f=g[b]?.label??"";(0,a.useEffect)(()=>{if(!c)return;let e=e=>{x.current&&!x.current.contains(e.target)&&u(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[c]),(0,a.useEffect)(()=>{if(c&&h.current&&p>=0){let e=h.current.children[p];e?.scrollIntoView({block:"nearest"})}},[c,p]);let v=(0,a.useCallback)(e=>{e>=0&&e<g.length&&(t?.({target:{value:g[e].value}}),u(!1))},[g,t]),y=(0,a.useCallback)(e=>{if(!c){["Enter"," ","ArrowDown","ArrowUp"].includes(e.key)&&(e.preventDefault(),u(!0),m(b>=0?b:0));return}switch(e.key){case"ArrowDown":e.preventDefault(),m(e=>Math.min(e+1,g.length-1));break;case"ArrowUp":e.preventDefault(),m(e=>Math.max(e-1,0));break;case"Enter":case" ":e.preventDefault(),v(p);break;case"Escape":e.preventDefault(),u(!1);break;case"Tab":u(!1)}},[c,g.length,b,p,v]);return(0,s.jsxs)("div",{ref:x,className:`relative ${l}`,children:[(0,s.jsxs)("button",{type:"button",disabled:i,onClick:()=>{u(e=>!e),m(b>=0?b:0)},onKeyDown:y,"aria-haspopup":"listbox","aria-expanded":c,className:"w-full px-3 py-2 text-sm bg-background border border-border rounded-lg text-foreground text-left flex items-center justify-between gap-2 outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,s.jsx)("span",{className:`truncate ${f?"":"text-muted-foreground"}`,children:f||"—"}),(0,s.jsx)(o.A,{size:14,className:`shrink-0 text-muted-foreground transition-transform duration-150 ${c?"rotate-180":""}`})]}),c&&(0,s.jsx)("div",{ref:h,role:"listbox","aria-activedescendant":p>=0?`${d}-opt-${p}`:void 0,className:"absolute z-20 w-full mt-1 py-1 border border-border rounded-lg bg-card shadow-lg max-h-60 overflow-auto animate-in fade-in-0 zoom-in-95 duration-100",children:g.map((t,r)=>{let a=t.value===e,o=r===p;return(0,s.jsxs)("button",{id:`${d}-opt-${r}`,role:"option","aria-selected":a,type:"button",onMouseDown:e=>{e.preventDefault(),v(r)},onMouseEnter:()=>m(r),className:`w-full px-3 py-1.5 text-sm text-left flex items-center gap-2 transition-colors ${o?"bg-accent text-accent-foreground":"text-foreground"}`,children:[(0,s.jsx)(n.A,{size:14,className:`shrink-0 ${a?"text-[var(--amber)]":"invisible"}`}),(0,s.jsx)("span",{className:"truncate",children:t.label})]},t.value)})})]})}function u({overridden:e}){return e?(0,s.jsx)("span",{className:"text-2xs px-1.5 py-0.5 rounded bg-[var(--amber-subtle)] text-[var(--amber-text)] font-mono ml-1.5",children:"env"}):null}function p({checked:e,onChange:t,size:r="md",disabled:a,title:o,onClick:n}){let l="sm"===r;return(0,s.jsx)("button",{type:"button",role:"switch","aria-checked":e,disabled:a,title:o,onClick:n??(()=>t?.(!e)),className:`relative inline-flex shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-60 ${l?"h-4 w-7":"h-5 w-9"} ${e?"bg-[var(--amber)]":"bg-muted"}`,children:(0,s.jsx)("span",{className:`pointer-events-none inline-block rounded-full bg-white shadow-sm transition-transform ${l?"h-3 w-3":"h-4 w-4"} ${e?l?"translate-x-3":"translate-x-4":"translate-x-0"}`})})}function m({value:e,onChange:t,placeholder:r,disabled:a}){let o="***set***"===e;return(0,s.jsx)("input",{type:"password",value:o?"••••••••••••••••":e,onChange:e=>t(e.target.value),placeholder:r??"sk-...",disabled:a,className:"w-full px-3 py-2 text-sm bg-background border border-border rounded-lg text-foreground placeholder:text-muted-foreground outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:opacity-50",onFocus:()=>{o&&t("")}})}function x({children:e,disabled:t,onClick:r,type:a="button",className:o="",...n}){return(0,s.jsx)("button",{type:a,onClick:r,disabled:t,className:`px-4 py-2 text-sm font-medium rounded-lg bg-[var(--amber)] text-[var(--amber-foreground)] transition-colors disabled:opacity-40 disabled:cursor-not-allowed ${o}`,...n,children:e})}function h({icon:e,title:t,description:r,badge:a,children:o,className:n=""}){return(0,s.jsxs)("div",{className:`rounded-xl border border-border/50 bg-card/50 p-5 ${n}`,children:[(0,s.jsxs)("div",{className:"flex items-start gap-3 mb-4",children:[(0,s.jsx)("div",{className:"w-8 h-8 rounded-lg bg-muted/50 flex items-center justify-center shrink-0 mt-0.5",children:(0,s.jsx)("span",{className:"text-muted-foreground",children:e})}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:t}),a]}),r&&(0,s.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed",children:r})]})]}),(0,s.jsx)("div",{className:"space-y-4 pl-11",children:o})]})}function g({label:e,hint:t,children:r}){return(0,s.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsx)("div",{className:"text-sm text-foreground",children:e}),t&&(0,s.jsx)("div",{className:"text-xs text-muted-foreground mt-0.5",children:t})]}),(0,s.jsx)("div",{className:"shrink-0",children:r})]})}},21362:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(90425).A)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]])},22952:(e,t,r)=>{"use strict";r.d(t,{default:()=>F});var s=r(95155),a=r(12115),o=r(86901),n=r(41641),l=r(21362),i=r(6296),d=r(61263),c=r(7834),u=r(4235),p=r(92451),m=r(97810),x=r(48368);let h=[{id:"en",icon:(0,s.jsx)(p.A,{size:18}),dirs:["Profile/","Connections/","Notes/","Workflows/","Resources/","Projects/"]},{id:"zh",icon:(0,s.jsx)(m.A,{size:18}),dirs:["画像/","关系/","笔记/","流程/","资源/","项目/"]},{id:"empty",icon:(0,s.jsx)(x.A,{size:18}),dirs:["README.md","CONFIG.json","INSTRUCTION.md"]}];var g=r(13545),b=r(20171);function f({state:e,update:t,t:r,homeDir:o}){let n=r.setup,[l,i]=(0,a.useState)(!1),d=o.includes("\\")?"\\":"/",c="~"!==o?[o,"MindOS","mind"].join(d):n.kbPathDefault,[u,p]=(0,a.useState)(null),[m,x]=(0,a.useState)([]),[f,v]=(0,a.useState)(!1),[y,k]=(0,a.useState)(-1),[j,N]=(0,a.useState)(!1),w=(0,a.useRef)(null),A=(0,a.useRef)(!1);(0,a.useEffect)(()=>{if(A.current){A.current=!1;return}if(!e.mindRoot.trim())return void x([]);let t=setTimeout(()=>{let t=function(e){if(!e.trim())return"";let t=e.trim();if(t.endsWith("/")||t.endsWith("\\"))return t;let r=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\"));return r>=0?t.slice(0,r+1):""}(e.mindRoot)||o;fetch("/api/setup/ls",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:t})}).then(e=>e.json()).then(r=>{if(!r.dirs?.length)return void x([]);let s=t.endsWith("/")||t.endsWith("\\"),a=t.includes("\\")?"\\":"/",o=s?t:t+a,n=e.mindRoot.trim(),l=r.dirs.map(e=>o+e),i=n.endsWith("/")||n.endsWith("\\")?l:l.filter(e=>e.startsWith(n));x(i.slice(0,20)),v(i.length>0),k(-1)}).catch(e=>{console.warn("[SetupWizard] autocomplete fetch failed:",e),x([])})},300);return()=>clearTimeout(t)},[e.mindRoot,o]),(0,a.useEffect)(()=>{if(!e.mindRoot.trim())return void p(null);let r=setTimeout(()=>{fetch("/api/setup/check-path",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e.mindRoot})}).then(e=>e.json()).then(e=>{p(e),N(!1),e?.exists&&!e.empty&&t("template","")}).catch(e=>{console.warn("[SetupWizard] check-path failed:",e),p(null)})},600);return()=>clearTimeout(r)},[e.mindRoot,t]);let S=()=>{x([]),v(!1),k(-1)},C=e=>{A.current=!0,t("mindRoot",e),S(),w.current?.focus()};return(0,s.jsxs)("div",{className:"space-y-6",children:[(0,s.jsxs)(b.D0,{label:n.kbPath,hint:n.kbPathHint,children:[(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)("input",{ref:w,value:e.mindRoot,onChange:e=>{t("mindRoot",e.target.value),v(!0)},onKeyDown:e=>{f&&0!==m.length&&("ArrowDown"===e.key?(e.preventDefault(),k(e=>Math.min(e+1,m.length-1))):"ArrowUp"===e.key?(e.preventDefault(),k(e=>Math.max(e-1,-1))):"Enter"===e.key&&y>=0?(e.preventDefault(),C(m[y])):"Escape"===e.key&&v(!1))},onBlur:()=>setTimeout(()=>S(),150),onFocus:()=>m.length>0&&v(!0),placeholder:c,className:"w-full px-3 py-2 text-sm rounded-lg border outline-none transition-colors focus-visible:ring-1 focus-visible:ring-ring",style:{background:"var(--input, var(--card))",borderColor:"var(--border)",color:"var(--foreground)"}}),f&&m.length>0&&(0,s.jsx)("div",{role:"listbox",className:"absolute z-50 left-0 right-0 top-full mt-1 rounded-lg border overflow-auto",style:{background:"var(--card)",borderColor:"var(--border)",boxShadow:"0 4px 16px rgba(0,0,0,0.12)",maxHeight:"220px"},children:m.map((e,t)=>(0,s.jsx)("button",{type:"button",role:"option","aria-selected":t===y,onMouseDown:()=>C(e),className:"w-full text-left px-3 py-2 text-sm font-mono transition-colors",style:{background:t===y?"var(--muted)":"transparent",color:"var(--foreground)",borderTop:t>0?"1px solid var(--border)":void 0},children:e},e))})]}),e.mindRoot!==c&&c!==n.kbPathDefault&&(0,s.jsx)("button",{type:"button",onClick:()=>t("mindRoot",c),className:"mt-1.5 px-2.5 py-1 text-xs rounded-md border transition-colors hover:bg-muted/50",style:{borderColor:"var(--amber)",color:"var(--amber)"},children:n.kbPathUseDefault(c)})]}),u&&u.exists&&!u.empty&&!j?(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"text-sm text-foreground font-medium mb-3 block",children:n.template}),(0,s.jsxs)("div",{className:"rounded-lg border p-3 text-sm",style:{borderColor:"var(--amber)",background:"color-mix(in srgb, var(--amber) 6%, transparent)"},children:[(0,s.jsx)("p",{style:{color:"var(--amber)"},children:n.kbPathHasFiles(u.count)}),(0,s.jsxs)("div",{className:"flex gap-2 mt-2",children:[(0,s.jsx)("button",{type:"button",onClick:()=>t("template",""),className:"px-2.5 py-1 text-xs rounded-md border transition-colors",style:{borderColor:"var(--amber)",color:""===e.template?"var(--background)":"var(--amber)",background:""===e.template?"var(--amber)":"transparent"},children:""===e.template?(0,s.jsxs)(s.Fragment,{children:[n.kbTemplateSkip," ✓"]}):n.kbTemplateSkip}),(0,s.jsx)("button",{type:"button",onClick:()=>N(!0),className:"px-2.5 py-1 text-xs rounded-md border transition-colors hover:bg-muted/50",style:{borderColor:"var(--border)",color:"var(--muted-foreground)"},children:n.kbTemplateMerge})]})]})]}):(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"text-sm text-foreground font-medium mb-3 block",children:n.template}),(0,s.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3",children:h.map(a=>(0,s.jsxs)("button",{onClick:()=>t("template",a.id),className:"flex flex-col items-start gap-2 p-4 rounded-xl border text-left transition-all duration-150",style:{background:e.template===a.id?"var(--amber-dim)":"var(--card)",borderColor:e.template===a.id?"var(--amber)":"var(--border)"},children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{style:{color:"var(--amber)"},children:a.icon}),(0,s.jsx)("span",{className:"text-sm font-medium",style:{color:"var(--foreground)"},children:r.onboarding.templates[a.id].title})]}),(0,s.jsx)("div",{className:"w-full rounded-lg px-2.5 py-1.5 text-xs leading-relaxed font-display",style:{background:"var(--muted)",color:"var(--muted-foreground)"},children:a.dirs.map(e=>(0,s.jsx)("div",{children:e},e))})]},a.id))})]}),(0,s.jsx)("div",{className:"pt-2 mt-2",style:{borderTop:"1px solid var(--border)"},children:(0,s.jsxs)(b.D0,{label:(0,s.jsxs)(s.Fragment,{children:[n.webPassword," ",(0,s.jsx)("span",{style:{color:"var(--error)"},children:"*"})]}),hint:n.webPasswordHint,children:[(0,s.jsx)("input",{type:"password",value:e.webPassword,onChange:e=>{t("webPassword",e.target.value),i(!0)},onBlur:()=>i(!0),placeholder:"••••••••",className:"w-full px-3 py-2 text-sm rounded-lg border outline-none transition-colors focus-visible:ring-1 focus-visible:ring-ring",style:{background:"var(--input, var(--card))",borderColor:l&&!e.webPassword.trim()?"var(--error)":"var(--border)",color:"var(--foreground)"}}),l&&!e.webPassword.trim()&&(0,s.jsxs)("p",{className:"text-xs flex items-center gap-1 mt-1",style:{color:"var(--error)"},children:[(0,s.jsx)(g.A,{size:11})," ",n.webPasswordRequired]})]})})]})}var v=r(90718),y=r(53961),k=r(30125),j=r(12651),N=r(66088),w=r(67635),A=r(41585),S=r(68822);function C({label:e,hint:t,value:r,onChange:o,status:n,onCheckPort:l,s:d}){let c=(0,a.useRef)(void 0);return(0,a.useEffect)(()=>()=>clearTimeout(c.current),[]),(0,s.jsx)(b.D0,{label:e,hint:t,children:(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsx)(b.pd,{type:"number",min:1024,max:65535,value:r,onChange:e=>{let t=parseInt(e.target.value,10)||r;o(t),clearTimeout(c.current),t>=1024&&t<=65535&&(c.current=setTimeout(()=>l(t),500))},onBlur:()=>{clearTimeout(c.current),l(r)}}),n.checking&&(0,s.jsxs)("p",{className:"text-xs flex items-center gap-1",role:"status",style:{color:"var(--muted-foreground)"},children:[(0,s.jsx)(i.A,{size:11,className:"animate-spin"})," ",d.portChecking]}),!n.checking&&!1===n.available&&(0,s.jsxs)("div",{className:"flex items-center gap-2",role:"alert",children:[(0,s.jsxs)("p",{className:"text-xs flex items-center gap-1",style:{color:"var(--amber)"},children:[(0,s.jsx)(A.A,{size:11})," ",d.portInUse(r)]}),null!==n.suggestion&&(0,s.jsx)("button",{type:"button",onClick:()=>{o(n.suggestion),setTimeout(()=>l(n.suggestion),0)},className:"text-xs px-2 py-0.5 rounded border transition-colors",style:{borderColor:"var(--amber)",color:"var(--amber)"},children:d.portSuggest(n.suggestion)})]}),!n.checking&&!0===n.available&&(0,s.jsxs)("p",{className:"text-xs flex items-center gap-1",style:{color:"var(--success)"},children:[(0,s.jsx)(j.A,{size:11})," ",n.isSelf?d.portSelf:d.portAvailable]})]})})}function T({state:e,update:t,webPortStatus:r,mcpPortStatus:a,setWebPortStatus:o,setMcpPortStatus:n,checkPort:l,portConflict:i,s:d}){return(0,s.jsxs)("div",{className:"space-y-5",children:[(0,s.jsx)(C,{label:d.webPort,hint:d.portHint,value:e.webPort,onChange:e=>{t("webPort",e),o({checking:!1,available:null,isSelf:!1,suggestion:null})},status:r,onCheckPort:e=>l(e,"web"),s:d}),(0,s.jsx)(C,{label:d.mcpPort,hint:d.portHint,value:e.mcpPort,onChange:e=>{t("mcpPort",e),n({checking:!1,available:null,isSelf:!1,suggestion:null})},status:a,onCheckPort:e=>l(e,"mcp"),s:d}),i&&(0,s.jsxs)("p",{className:"text-xs flex items-center gap-1.5",role:"alert",style:{color:"var(--amber)"},children:[(0,s.jsx)(A.A,{size:12})," ",d.portConflict]}),!i&&(null===r.available||null===a.available)&&!r.checking&&!a.checking&&(0,s.jsx)("p",{className:"text-xs",style:{color:"var(--muted-foreground)"},children:d.portVerifyHint}),(0,s.jsxs)("p",{className:"text-xs flex items-center gap-1.5",style:{color:"var(--muted-foreground)"},children:[(0,s.jsx)(S.A,{size:12})," ",d.portRestartWarning]})]})}function P({state:e,update:t,s:r,onCopyToken:o,webPortStatus:n,mcpPortStatus:i,setWebPortStatus:d,setMcpPortStatus:c,checkPort:u,portConflict:p}){let[m,x]=(0,a.useState)(!1);(0,a.useEffect)(()=>{!m&&(!1===n.available||!1===i.available||p)&&x(!0)},[n.available,i.available,p,m]);let h=[{id:"anthropic",icon:(0,s.jsx)(v.A,{size:18}),label:"Anthropic",desc:"Claude — claude-sonnet-4-6"},{id:"openai",icon:(0,s.jsx)(y.A,{size:18}),label:"OpenAI",desc:"GPT or any OpenAI-compatible API"},{id:"skip",icon:(0,s.jsx)(k.A,{size:18}),label:r.aiSkipTitle,desc:r.aiSkipDesc}];return(0,s.jsxs)("div",{className:"space-y-5",children:[(0,s.jsx)("div",{className:"grid grid-cols-1 gap-3",children:h.map(r=>(0,s.jsxs)("button",{onClick:()=>t("provider",r.id),className:"flex items-start gap-3 p-4 rounded-xl border text-left transition-all duration-150",style:{background:e.provider===r.id?"var(--amber-dim)":"var(--card)",borderColor:e.provider===r.id?"var(--amber)":"var(--border)"},children:[(0,s.jsx)("span",{className:"mt-0.5",style:{color:e.provider===r.id?"var(--amber)":"var(--muted-foreground)"},children:r.icon}),(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-sm font-medium",style:{color:"var(--foreground)"},children:r.label}),(0,s.jsx)("p",{className:"text-xs mt-0.5",style:{color:"var(--muted-foreground)"},children:r.desc})]}),e.provider===r.id&&(0,s.jsx)(j.A,{size:16,className:"ml-auto mt-0.5 shrink-0",style:{color:"var(--amber)"}})]},r.id))}),"skip"!==e.provider&&(0,s.jsxs)("div",{className:"space-y-4 pt-2",children:[(0,s.jsxs)(b.D0,{label:r.apiKey,children:[(0,s.jsx)(b.Ak,{value:"anthropic"===e.provider?e.anthropicKey:e.openaiKey,onChange:r=>t("anthropic"===e.provider?"anthropicKey":"openaiKey",r),placeholder:("anthropic"===e.provider?e.anthropicKeyMask:e.openaiKeyMask)||("anthropic"===e.provider?"sk-ant-...":"sk-...")}),("anthropic"===e.provider?e.anthropicKeyMask:e.openaiKeyMask)&&!("anthropic"===e.provider?e.anthropicKey:e.openaiKey)&&(0,s.jsx)("p",{className:"text-xs mt-1",style:{color:"var(--muted-foreground)"},children:r.apiKeyExisting??"Existing key configured. Leave blank to keep it."})]}),(0,s.jsx)(b.D0,{label:r.model,children:(0,s.jsx)(b.pd,{value:"anthropic"===e.provider?e.anthropicModel:e.openaiModel,onChange:r=>t("anthropic"===e.provider?"anthropicModel":"openaiModel",r.target.value)})}),"openai"===e.provider&&(0,s.jsx)(b.D0,{label:r.baseUrl,hint:r.baseUrlHint,children:(0,s.jsx)(b.pd,{value:e.openaiBaseUrl,onChange:e=>t("openaiBaseUrl",e.target.value),placeholder:"https://api.openai.com/v1"})})]}),(0,s.jsxs)("div",{className:"pt-3 mt-1",style:{borderTop:"1px solid var(--border)"},children:[(0,s.jsxs)("button",{type:"button",onClick:()=>x(!m),className:"flex items-center gap-1.5 text-xs font-medium",style:{color:"var(--muted-foreground)"},children:[m?(0,s.jsx)(N.A,{size:12}):(0,s.jsx)(l.A,{size:12}),r.advancedPorts]}),m&&(0,s.jsxs)("div",{className:"mt-3 space-y-5",children:[(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsxs)("p",{className:"text-xs font-medium",style:{color:"var(--foreground)"},children:["\uD83D\uDD11 ",r.tokenSectionTitle]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("code",{className:"flex-1 truncate text-xs font-mono px-3 py-2 rounded-lg",style:{background:"var(--muted)",color:"var(--foreground)"},children:e.authToken}),(0,s.jsxs)("button",{type:"button",onClick:o,className:"flex items-center gap-1 px-2.5 py-2 text-xs rounded-lg border transition-colors hover:bg-muted shrink-0",style:{borderColor:"var(--border)",color:"var(--foreground)"},children:[(0,s.jsx)(w.A,{size:12})," ",r.copyToken]})]}),(0,s.jsx)("p",{className:"text-xs",style:{color:"var(--muted-foreground)"},children:r.tokenSectionHint})]}),(0,s.jsx)(T,{state:e,update:t,webPortStatus:n,mcpPortStatus:i,setWebPortStatus:d,setMcpPortStatus:c,checkPort:u,portConflict:p,s:r})]})]})]})}var z=r(62791);function M({agents:e,agentsLoading:t,selectedAgents:r,setSelectedAgents:o,agentTransport:n,setAgentTransport:l,agentScope:d,setAgentScope:c,agentStatuses:u,s:p,settingsMcp:m,template:x}){let[h,g]=(0,a.useState)(!1),[f,y]=(0,a.useState)(!1),{detected:k,other:w}=(0,a.useMemo)(()=>({detected:e.filter(e=>e.installed||e.present),other:e.filter(e=>!e.installed&&!e.present)}),[e]),A=(e,t)=>(0,s.jsxs)("label",{className:"flex items-center gap-3 px-4 py-3 cursor-pointer hover:bg-muted/50 transition-colors",style:{background:t%2==0?"var(--card)":"transparent",borderTop:t>0?"1px solid var(--border)":void 0},children:[(0,s.jsx)("input",{type:"checkbox",checked:r.has(e.key),onChange:()=>{var t;return t=e.key,void o(e=>{let r=new Set(e);return r.has(t)?r.delete(t):r.add(t),r})},className:"form-check",disabled:u[e.key]?.state==="installing"}),(0,s.jsx)("span",{className:"text-sm flex-1",style:{color:"var(--foreground)"},children:e.name}),(0,s.jsx)("span",{className:"text-2xs px-1.5 py-0.5 rounded font-mono",style:{background:"color-mix(in srgb, var(--muted-foreground) 8%, transparent)",color:"var(--muted-foreground)"},children:"auto"===n?e.preferredTransport:n}),((e,t)=>{let r=u[e];if(r){if("installing"===r.state)return(0,s.jsxs)("span",{className:"flex items-center gap-1 text-xs",style:{color:"var(--muted-foreground)"},children:[(0,s.jsx)(i.A,{size:10,className:"animate-spin"})," ",p.agentInstalling]});if("ok"===r.state)return(0,s.jsxs)("span",{className:"flex items-center gap-1 text-xs px-1.5 py-0.5 rounded",style:{background:"color-mix(in srgb, var(--success) 12%, transparent)",color:"var(--success)"},children:[(0,s.jsx)(j.A,{size:10})," ",p.agentStatusOk]});if("error"===r.state)return(0,s.jsxs)("span",{className:"flex items-center gap-1 text-xs px-1.5 py-0.5 rounded",style:{background:"color-mix(in srgb, var(--error) 10%, transparent)",color:"var(--error)"},children:[(0,s.jsx)(z.A,{size:10})," ",p.agentStatusError,r.message&&(0,s.jsxs)("span",{className:"ml-1 text-2xs",children:["(",r.message,")"]})]})}return t.installed?(0,s.jsx)("span",{className:"text-xs px-1.5 py-0.5 rounded",style:{background:"color-mix(in srgb, var(--success) 12%, transparent)",color:"var(--success)"},children:m.installed}):t.present?(0,s.jsx)("span",{className:"text-xs px-1.5 py-0.5 rounded",style:{background:"var(--amber-dim)",color:"var(--amber)"},children:p.agentDetected}):(0,s.jsx)("span",{className:"text-xs px-1.5 py-0.5 rounded",style:{background:"color-mix(in srgb, var(--muted-foreground) 10%, transparent)",color:"var(--muted-foreground)"},children:p.agentNotFound})})(e.key,e)]},e.key);return(0,s.jsxs)("div",{className:"space-y-5",children:[(0,s.jsx)("p",{className:"text-sm",style:{color:"var(--muted-foreground)"},children:p.agentToolsHint}),t?(0,s.jsxs)("div",{className:"flex items-center gap-2 py-4",style:{color:"var(--muted-foreground)"},children:[(0,s.jsx)(i.A,{size:14,className:"animate-spin"}),(0,s.jsx)("span",{className:"text-sm",children:p.agentToolsLoading})]}):0===e.length?(0,s.jsx)("p",{className:"text-sm py-4 text-center",style:{color:"var(--muted-foreground)"},children:p.agentToolsEmpty}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"flex items-center gap-4 text-2xs",style:{color:"var(--muted-foreground)"},children:[(0,s.jsxs)("span",{className:"flex items-center gap-1",children:[(0,s.jsx)("span",{className:"inline-block w-1.5 h-1.5 rounded-full",style:{background:"var(--success)"}}),p.badgeInstalled]}),(0,s.jsxs)("span",{className:"flex items-center gap-1",children:[(0,s.jsx)("span",{className:"inline-block w-1.5 h-1.5 rounded-full",style:{background:"var(--amber)"}}),p.badgeDetected]}),(0,s.jsxs)("span",{className:"flex items-center gap-1",children:[(0,s.jsx)("span",{className:"inline-block w-1.5 h-1.5 rounded-full",style:{background:"var(--muted-foreground)"}}),p.badgeNotFound]})]}),k.length>0?(0,s.jsx)("div",{className:"rounded-xl border overflow-hidden",style:{borderColor:"var(--border)"},children:k.map((e,t)=>A(e,t))}):(0,s.jsx)("p",{className:"text-xs py-2",style:{color:"var(--muted-foreground)"},children:p.agentNoneDetected}),w.length>0&&(0,s.jsxs)("div",{children:[(0,s.jsxs)("button",{type:"button",onClick:()=>g(!h),"aria-expanded":h,className:"flex items-center gap-1.5 text-xs py-1.5 transition-colors",style:{color:"var(--muted-foreground)"},children:[(0,s.jsx)(N.A,{size:12,className:`transition-transform ${h?"rotate-180":""}`}),p.agentShowMore(w.length)]}),h&&(0,s.jsx)("div",{className:"rounded-xl border overflow-hidden mt-1",style:{borderColor:"var(--border)"},children:w.map((e,t)=>A(e,t))})]}),(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsx)("p",{className:"text-xs",style:{color:"var(--muted-foreground)"},children:p.skillWhat}),(0,s.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg text-xs",style:{background:"color-mix(in srgb, var(--muted-foreground) 6%, transparent)",color:"var(--muted-foreground)"},children:[(0,s.jsx)(v.A,{size:13,className:"shrink-0"}),(0,s.jsx)("span",{children:p.skillAutoHint("zh"===x?"mindos-zh":"mindos")})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("button",{type:"button",onClick:()=>y(!f),"aria-expanded":f,className:"flex items-center gap-1.5 text-xs py-1.5 transition-colors",style:{color:"var(--muted-foreground)"},children:[(0,s.jsx)(N.A,{size:12,className:`transition-transform ${f?"rotate-180":""}`}),p.agentAdvanced]}),f&&(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-4 mt-2",children:[(0,s.jsx)(b.D0,{label:p.agentTransport,children:(0,s.jsxs)(b.l6,{value:n,onChange:e=>l(e.target.value),children:[(0,s.jsx)("option",{value:"auto",children:p.agentTransportAuto}),(0,s.jsx)("option",{value:"stdio",children:m.transportStdio}),(0,s.jsx)("option",{value:"http",children:m.transportHttp})]})}),(0,s.jsx)(b.D0,{label:p.agentScope,children:(0,s.jsxs)(b.l6,{value:d,onChange:e=>c(e.target.value),children:[(0,s.jsx)("option",{value:"global",children:p.agentScopeGlobal}),(0,s.jsx)("option",{value:"project",children:p.agentScopeProject})]})})]})]}),(0,s.jsxs)("div",{className:"flex gap-2 mt-1",children:[(0,s.jsx)("button",{type:"button",onClick:()=>o(new Set(e.filter(e=>e.installed||e.present).map(e=>e.key))),className:"text-xs px-2.5 py-1 rounded-md border transition-colors hover:bg-muted/50",style:{borderColor:"var(--amber)",color:"var(--amber)"},children:p.agentSelectDetected}),(0,s.jsx)("button",{type:"button",onClick:()=>o(new Set),className:"text-xs px-2.5 py-1 rounded-md border transition-colors hover:bg-muted/50",style:{borderColor:"var(--border)",color:"var(--muted-foreground)"},children:p.agentSkipLater})]})]})]})}function D({s:e}){return(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsxs)("div",{className:"p-3 rounded-lg text-sm flex items-center gap-2",style:{background:"color-mix(in srgb, var(--amber) 10%, transparent)",color:"var(--amber)"},children:[(0,s.jsx)(A.A,{size:14})," ",e.restartRequired]}),(0,s.jsxs)("p",{className:"text-xs",style:{color:"var(--muted-foreground)"},children:[e.restartManual," ",(0,s.jsx)("code",{className:"font-mono",children:"mindos start"})]})]})}function R({s:e,newPort:t}){let[r,o]=(0,a.useState)(!1),[n,l]=(0,a.useState)(!1),d=(0,a.useRef)(void 0);(0,a.useEffect)(()=>()=>{clearInterval(d.current)},[]);let c=async()=>{o(!0);try{await fetch("/api/restart",{method:"POST"}),l(!0);let e=()=>{window.location.href=`http://localhost:${t}/?welcome=1`},r=0;clearInterval(d.current),d.current=setInterval(async()=>{r++;try{if((await fetch(`http://localhost:${t}/api/health`)).status<500){clearInterval(d.current),e();return}}catch{}r>=10&&(clearInterval(d.current),e())},800)}catch(e){console.warn("[SetupWizard] restart request failed:",e),o(!1)}};return n?(0,s.jsxs)("span",{className:"flex items-center gap-1.5 px-5 py-2 text-sm font-medium rounded-lg",style:{background:"color-mix(in srgb, var(--success) 15%, transparent)",color:"var(--success)"},children:[(0,s.jsx)(j.A,{size:14})," ",e.restartDone]}):(0,s.jsxs)("button",{type:"button",onClick:c,disabled:r,className:"flex items-center gap-1.5 px-5 py-2 text-sm font-medium rounded-lg transition-colors disabled:opacity-50",style:{background:"var(--amber)",color:"var(--amber-foreground)"},children:[r?(0,s.jsx)(i.A,{size:13,className:"animate-spin"}):null,r?e.restarting:e.restartNow]})}function E({state:e,selectedAgents:t,agentStatuses:r,onRetryAgent:a,error:o,needsRestart:n,s:l,skillInstallResult:d,setupPhase:c}){let u=Object.entries(r).filter(([,e])=>"error"===e.state),p=[[l.kbPath,e.mindRoot],[l.webPort,`${e.webPort} / ${e.mcpPort}`],[l.agentToolsTitle,t.size>0?l.agentCountSummary(t.size):"—"]],m=[{key:"saving",label:l.phaseSaving},{key:"agents",label:l.phaseAgents},{key:"skill",label:l.phaseSkill},{key:"done",label:l.phaseDone}],x=["saving","agents","skill","done"],h=x.indexOf(c);return(0,s.jsxs)("div",{className:"space-y-5",children:[(0,s.jsx)("div",{className:"rounded-xl border overflow-hidden",style:{borderColor:"var(--border)"},children:p.map(([e,t],r)=>(0,s.jsxs)("div",{className:"flex items-center justify-between px-4 py-2.5 text-sm",style:{background:r%2==0?"var(--card)":"transparent",borderTop:r>0?"1px solid var(--border)":void 0},children:[(0,s.jsx)("span",{style:{color:"var(--muted-foreground)"},children:e}),(0,s.jsx)("span",{className:"font-mono text-xs truncate ml-4",style:{color:"var(--foreground)"},children:t})]},r))}),"review"===c&&(0,s.jsx)("p",{className:"text-sm",style:{color:"var(--muted-foreground)"},children:l.reviewHint}),"review"!==c&&(0,s.jsx)("div",{className:"space-y-2 py-2",children:m.map(({key:e,label:t},r)=>{let a=x.indexOf(e),o=h>a||"done"===e&&"done"===c,n=c===e&&"done"!==e;return(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("div",{className:"w-5 h-5 rounded-full flex items-center justify-center shrink-0 text-2xs",style:{background:o?"color-mix(in srgb, var(--success) 15%, transparent)":n?"color-mix(in srgb, var(--amber) 15%, transparent)":"var(--muted)",color:o?"var(--success)":n?"var(--amber)":"var(--muted-foreground)"},children:o?(0,s.jsx)(j.A,{size:12}):n?(0,s.jsx)(i.A,{size:12,className:"animate-spin"}):r+1}),(0,s.jsx)("span",{className:"text-sm",style:{color:o?"var(--success)":n?"var(--foreground)":"var(--muted-foreground)",fontWeight:n?500:400,opacity:h<a?.5:1},children:t})]},e)})}),u.length>0&&"done"===c&&(0,s.jsxs)("div",{className:"p-3 rounded-lg space-y-2",style:{background:"color-mix(in srgb, var(--error) 8%, transparent)"},children:[(0,s.jsx)("p",{className:"text-xs font-medium",style:{color:"var(--error)"},children:l.agentFailedCount(u.length)}),u.map(([e,t])=>(0,s.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,s.jsxs)("span",{className:"text-xs flex items-center gap-1",style:{color:"var(--error)"},children:[(0,s.jsx)(z.A,{size:11})," ",e,t.message?` — ${t.message}`:""]}),(0,s.jsx)("button",{type:"button",onClick:()=>a(e),className:"text-xs px-2 py-0.5 rounded border transition-colors",style:{borderColor:"var(--error)",color:"var(--error)"},children:l.retryAgent})]},e)),(0,s.jsx)("p",{className:"text-xs",style:{color:"var(--muted-foreground)"},children:l.agentFailureNote})]}),d&&"done"===c&&(0,s.jsx)("div",{className:"flex items-center gap-2 text-xs px-3 py-2 rounded-lg",style:{background:d.ok?"color-mix(in srgb, var(--success) 6%, transparent)":"color-mix(in srgb, var(--error) 6%, transparent)"},children:d.ok?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(j.A,{size:11,className:"text-success shrink-0"}),(0,s.jsxs)("span",{style:{color:"var(--foreground)"},children:[l.skillInstalled," — ",d.skill]})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(z.A,{size:11,className:"text-error shrink-0"}),(0,s.jsxs)("span",{style:{color:"var(--error)"},children:[l.skillFailed,d.error?`: ${d.error}`:""]})]})}),o&&(0,s.jsxs)("div",{className:"p-3 rounded-lg text-sm text-error",style:{background:"color-mix(in srgb, var(--error) 10%, transparent)"},children:[l.completeFailed,": ",o]}),n&&"done"===c&&(0,s.jsx)(D,{s:l})]})}function O({step:e,setStep:t,stepTitles:r,disabled:a,numberedSteps:o}){let{t:n}=(0,d.Y)(),l=o??r.length,i=r.slice(0,l),c=e>=l;return(0,s.jsx)("div",{className:"flex items-center gap-2 mb-8",role:"navigation","aria-label":"Setup steps",children:i.map((r,o)=>(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[o>0&&(0,s.jsx)("div",{className:"w-8 h-px",style:{background:o<=e||c?"var(--amber)":"var(--border)"}}),(0,s.jsxs)("button",{onClick:()=>t(o),"aria-current":o===e?"step":void 0,"aria-label":r,className:"flex flex-col items-center gap-1 p-1 -m-1 disabled:cursor-not-allowed disabled:opacity-60",disabled:a||o>e,title:a||o>e?n.hints.cannotJumpForward:void 0,children:[(0,s.jsx)("div",{className:"w-6 h-6 rounded-full text-xs font-medium flex items-center justify-center transition-colors",style:{background:o<e||c||o===e?"var(--amber)":"var(--muted)",color:o<=e||c?"var(--amber-foreground)":"var(--muted-foreground)",opacity:o<=e||c?1:.5},children:o<e||c?(0,s.jsx)(j.A,{size:14}):o+1}),(0,s.jsx)("span",{className:"text-[10px] leading-tight hidden sm:inline max-w-[4rem] text-center truncate",style:{color:o!==e||c?"var(--muted-foreground)":"var(--foreground)",opacity:o<=e||c?1:.5},children:r})]})]},o))})}function $(e,t,r,s){let a=t.find(t=>t.key===e);return{key:e,scope:s,transport:"auto"===r?a?.preferredTransport||"stdio":r}}function W(e){return{state:"ok"===e.status?"ok":"error",message:e.message,transport:e.transport,verified:e.verified,verifyError:e.verifyError}}async function K(e){let t={mindRoot:e.mindRoot,template:e.template||void 0,port:e.webPort,mcpPort:e.mcpPort,authToken:e.authToken,webPassword:e.webPassword,ai:"skip"===e.provider?void 0:{provider:e.provider,providers:{anthropic:{apiKey:e.anthropicKey,model:e.anthropicModel},openai:{apiKey:e.openaiKey,model:e.openaiModel,baseUrl:e.openaiBaseUrl}}}},r=await fetch("/api/setup",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),s=await r.json();if(!r.ok)throw Error(s.error||`HTTP ${r.status}`);return!!s.needsRestart}async function I(e,t,r,s,a,o){let n=e.map(e=>$(e,t,r,s)),l=await fetch("/api/mcp/install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({agents:n,transport:r,url:`http://localhost:${a}/mcp`,token:o||void 0})}),i=await l.json(),d={};if(i.results)for(let e of i.results)d[e.agent]=W(e);return d}function F(){let{t:e}=(0,d.Y)(),t=e.setup,[r,p]=(0,a.useState)(0),[m,x]=(0,a.useState)({mindRoot:"~/MindOS/mind",template:"en",provider:"anthropic",anthropicKey:"",anthropicModel:"claude-sonnet-4-6",anthropicKeyMask:"",openaiKey:"",openaiModel:"gpt-5.4",openaiBaseUrl:"",openaiKeyMask:"",webPort:3456,mcpPort:8781,authToken:"",webPassword:""}),[h,g]=(0,a.useState)("~"),[b,v]=(0,a.useState)(!1),[y,k]=(0,a.useState)(!1),[j,N]=(0,a.useState)(""),[w,A]=(0,a.useState)(!1),[S,C]=(0,a.useState)({checking:!1,available:null,isSelf:!1,suggestion:null}),[T,z]=(0,a.useState)({checking:!1,available:null,isSelf:!1,suggestion:null}),[D,F]=(0,a.useState)([]),[U,H]=(0,a.useState)(!1),[q,B]=(0,a.useState)(!1),[L,J]=(0,a.useState)(new Set),[V,_]=(0,a.useState)("auto"),[G,Y]=(0,a.useState)("global"),[Z,X]=(0,a.useState)({}),[Q,ee]=(0,a.useState)(null),[et,er]=(0,a.useState)("review");(0,a.useEffect)(()=>{fetch("/api/setup").then(e=>e.json()).then(e=>{e.homeDir&&g(e.homeDir),x(t=>({...t,mindRoot:e.mindRoot||t.mindRoot,webPort:"number"==typeof e.port?e.port:t.webPort,mcpPort:"number"==typeof e.mcpPort?e.mcpPort:t.mcpPort,authToken:e.authToken||t.authToken,webPassword:e.webPassword||t.webPassword,provider:"anthropic"===e.provider||"openai"===e.provider?e.provider:t.provider,anthropicModel:e.anthropicModel||t.anthropicModel,anthropicKeyMask:e.anthropicApiKey||"",openaiModel:e.openaiModel||t.openaiModel,openaiBaseUrl:e.openaiBaseUrl??t.openaiBaseUrl,openaiKeyMask:e.openaiApiKey||""})),e.authToken||fetch("/api/setup/generate-token",{method:"POST",headers:{"Content-Type":"application/json"},body:"{}"}).then(e=>e.json()).then(e=>{e.token&&x(t=>({...t,authToken:e.token}))}).catch(e=>console.warn("[SetupWizard] Token generation failed:",e))}).catch(e=>{console.warn("[SetupWizard] Failed to load config, generating token as fallback:",e),fetch("/api/setup/generate-token",{method:"POST",headers:{"Content-Type":"application/json"},body:"{}"}).then(e=>e.json()).then(e=>{e.token&&x(t=>({...t,authToken:e.token}))}).catch(e=>console.warn("[SetupWizard] Fallback token generation also failed:",e))})},[]),(0,a.useEffect)(()=>{1===r&&(eo(m.webPort,"web"),eo(m.mcpPort,"mcp"))},[r]),(0,a.useEffect)(()=>{2!==r||q||U||(H(!0),fetch("/api/mcp/agents").then(e=>e.json()).then(e=>{e.agents&&(F(e.agents),J(new Set(e.agents.filter(e=>e.installed||e.present).map(e=>e.key)))),B(!0)}).catch(e=>{console.warn("[SetupWizard] Failed to load agents:",e),B(!0)}).finally(()=>H(!1)))},[r,q,U]);let es=(0,a.useCallback)((e,t)=>{x(r=>({...r,[e]:t}))},[]);(0,a.useCallback)(async e=>{try{let t=await fetch("/api/setup/generate-token",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({seed:e||void 0})}),r=await t.json();r.token&&x(e=>({...e,authToken:r.token}))}catch(e){console.warn("[SetupWizard] generateToken failed:",e)}},[]);let ea=(0,a.useCallback)(()=>{(0,c.l)(m.authToken).then(e=>{e&&u.oR.copy()})},[m.authToken]),eo=(0,a.useCallback)(async(e,t)=>{if(e<1024||e>65535)return;let r="web"===t?C:z;r({checking:!0,available:null,isSelf:!1,suggestion:null});try{let t=await fetch("/api/setup/check-port",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({port:e})}),s=await t.json();r({checking:!1,available:s.available??null,isSelf:!!s.isSelf,suggestion:s.suggestion??null})}catch(e){console.warn("[SetupWizard] checkPort failed:",e),r({checking:!1,available:null,isSelf:!1,suggestion:null})}},[]),en=m.webPort===m.mcpPort,el=async()=>{v(!0),N("");let e=Array.from(L);er("saving");let t=!1;try{(t=await K(m))&&A(!0)}catch(e){N(e instanceof Error?e.message:String(e)),er("review"),v(!1);return}if(er("agents"),e.length>0){let t={};for(let r of e)t[r]={state:"installing"};X(t);try{let t=await I(e,D,V,G,m.mcpPort,m.authToken);X(t)}catch(r){console.warn("[SetupWizard] agent batch install failed:",r);let t={};for(let r of e)t[r]={state:"error"};X(t)}}v(!1),k(!0),er("done"),t||(window.location.href="/?welcome=1")},ei=(0,a.useCallback)(async e=>{X(t=>({...t,[e]:{state:"installing"}}));try{let t=$(e,D,V,G),r=await fetch("/api/mcp/install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({agents:[t],transport:V,url:`http://localhost:${m.mcpPort}/mcp`,token:m.authToken||void 0})}),s=await r.json();if(s.results?.[0]){let t=s.results[0];X(r=>({...r,[e]:W(t)}))}}catch(t){console.warn("[SetupWizard] retryAgent failed:",t),X(t=>({...t,[e]:{state:"error"}}))}},[D,G,V,m.mcpPort,m.authToken]);return(0,s.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center overflow-y-auto",role:"dialog","aria-modal":"true","aria-labelledby":"setup-title",style:{background:"var(--background)"},children:(0,s.jsxs)("div",{className:"w-full max-w-xl mx-auto px-6 py-12",children:[(0,s.jsx)("div",{className:"text-center mb-8",children:(0,s.jsxs)("div",{className:"inline-flex items-center gap-2 mb-2",children:[(0,s.jsx)(o.A,{size:18,style:{color:"var(--amber)"}}),(0,s.jsx)("h1",{id:"setup-title",className:"text-2xl font-semibold tracking-tight font-display",style:{color:"var(--foreground)"},children:"MindOS"})]})}),(0,s.jsx)("div",{className:"flex justify-center",children:(0,s.jsx)(O,{step:r,setStep:p,stepTitles:t.stepTitles,disabled:b||y,numberedSteps:3})}),(0,s.jsx)("h2",{className:"text-lg font-semibold mb-5",style:{color:"var(--foreground)"},children:3===r?`✓ ${t.stepTitles[r]}`:t.stepTitles[r]}),0===r&&(0,s.jsx)(f,{state:m,update:es,t:e,homeDir:h}),1===r&&(0,s.jsx)(P,{state:m,update:es,s:t,onCopyToken:ea,webPortStatus:S,mcpPortStatus:T,setWebPortStatus:C,setMcpPortStatus:z,checkPort:eo,portConflict:en}),2===r&&(0,s.jsx)(M,{agents:D,agentsLoading:U,selectedAgents:L,setSelectedAgents:J,agentTransport:V,setAgentTransport:_,agentScope:G,setAgentScope:Y,agentStatuses:Z,s:t,settingsMcp:e.settings.mcp,template:m.template}),3===r&&(0,s.jsx)(E,{state:m,selectedAgents:L,agentStatuses:Z,onRetryAgent:ei,error:j,needsRestart:w,s:t,skillInstallResult:Q,setupPhase:et}),(0,s.jsxs)("div",{className:"flex items-center justify-between mt-8 pt-6",style:{borderTop:"1px solid var(--border)"},children:[(0,s.jsxs)("button",{onClick:()=>p(r-1),disabled:0===r||b||y,className:"flex items-center gap-1 px-4 py-2 text-sm rounded-lg border border-border hover:bg-muted transition-colors disabled:opacity-30 disabled:cursor-not-allowed",style:{color:"var(--foreground)"},children:[(0,s.jsx)(n.A,{size:14})," ",t.back]}),r<3?(0,s.jsxs)("button",{onClick:()=>p(r+1),disabled:!(0===r?m.mindRoot.trim().length>0&&m.webPassword.trim().length>0:(1!==r||!en&&!S.checking&&!T.checking&&!1!==S.available&&!1!==T.available)&&!0),className:"flex items-center gap-1 px-4 py-2 text-sm rounded-lg transition-colors disabled:opacity-30 disabled:cursor-not-allowed",style:{background:"var(--amber)",color:"var(--amber-foreground)"},children:[t.next," ",(0,s.jsx)(l.A,{size:14})]}):y?w?(0,s.jsx)(R,{s:t,newPort:m.webPort}):(0,s.jsxs)("a",{href:"/?welcome=1",className:"flex items-center gap-1 px-5 py-2 text-sm font-medium rounded-lg transition-colors",style:{background:"var(--amber)",color:"var(--amber-foreground)"},children:[t.completeDone," →"]}):(0,s.jsxs)("button",{onClick:el,disabled:b,className:"flex items-center gap-1 px-5 py-2 text-sm font-medium rounded-lg transition-colors disabled:opacity-50",style:{background:"var(--amber)",color:"var(--amber-foreground)"},children:[b&&(0,s.jsx)(i.A,{size:14,className:"animate-spin"}),b?t.completing:t.complete]})]})]})})}},30125:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(90425).A)("skip-forward",[["path",{d:"M21 4v16",key:"7j8fe9"}],["path",{d:"M6.029 4.285A2 2 0 0 0 3 6v12a2 2 0 0 0 3.029 1.715l9.997-5.998a2 2 0 0 0 .003-3.432z",key:"zs4d6"}]])},41585:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(90425).A)("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},41641:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(90425).A)("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]])},48368:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(90425).A)("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]])},53961:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(90425).A)("zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]])},62791:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(90425).A)("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]])},66088:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(90425).A)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]])},67635:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(90425).A)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]])},68822:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(90425).A)("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]])},86901:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(90425).A)("sparkles",[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]])},90425:(e,t,r)=>{"use strict";r.d(t,{A:()=>i});var s=r(12115);let a=(...e)=>e.filter((e,t,r)=>!!e&&""!==e.trim()&&r.indexOf(e)===t).join(" ").trim(),o=e=>{let t=e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,r)=>r?r.toUpperCase():t.toLowerCase());return t.charAt(0).toUpperCase()+t.slice(1)};var n={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let l=(0,s.forwardRef)(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:o,className:l="",children:i,iconNode:d,...c},u)=>(0,s.createElement)("svg",{ref:u,...n,width:t,height:t,stroke:e,strokeWidth:o?24*Number(r)/Number(t):r,className:a("lucide",l),...!i&&!(e=>{for(let t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0;return!1})(c)&&{"aria-hidden":"true"},...c},[...d.map(([e,t])=>(0,s.createElement)(e,t)),...Array.isArray(i)?i:[i]])),i=(e,t)=>{let r=(0,s.forwardRef)(({className:r,...n},i)=>(0,s.createElement)(l,{ref:i,iconNode:t,className:a(`lucide-${o(e).replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${e}`,r),...n}));return r.displayName=o(e),r}},90718:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(90425).A)("brain",[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]])},92451:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(90425).A)("globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]])},94514:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(90425).A)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]])},97810:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(90425).A)("book-open",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]])}},e=>{e.O(0,[1263,8441,3794,7358],()=>e(e.s=15721)),_N_E=e.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1227],{4235:(e,t,r)=>{"use strict";r.d(t,{B1:()=>i,X8:()=>l,dV:()=>d,oR:()=>u});let s=[],a=[],o=0;function n(){for(let e of a)e()}function i(e){return a=[...a,e],()=>{a=a.filter(t=>t!==e)}}function d(){return s}function l(e){s=s.filter(t=>t.id!==e),n()}function c(e){let t=`toast-${++o}`,r={id:t,message:e.message,type:e.type??"info",duration:e.duration??2e3,action:e.action};s=[...s,r].slice(-3),n(),r.duration>0&&setTimeout(()=>l(t),r.duration)}function u(e,t){c({message:e,...t})}u.success=(e,t)=>c({message:e,type:"success",duration:t}),u.undo=(e,t,r)=>c({message:e,type:"info",duration:r?.duration??5e3,action:{label:r?.label??"Undo",onClick:t}}),u.error=(e,t)=>c({message:e,type:"error",duration:t}),u.copy=(e="Copied")=>c({message:e,type:"success",duration:1500})},6296:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(90425).A)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},9199:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(90425).A)("rotate-ccw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]])},9339:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s={callServer:function(){return o.callServer},createServerReference:function(){return i.createServerReference},findSourceMapURL:function(){return n.findSourceMapURL}};for(var a in s)Object.defineProperty(t,a,{enumerable:!0,get:s[a]});let o=r(77304),n=r(4060),i=r(77197)},33078:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(90425).A)("table",[["path",{d:"M12 3v18",key:"108xh3"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}]])},33210:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(90425).A)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])},38798:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(90425).A)("folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]])},39498:(e,t,r)=>{"use strict";r.d(t,{BK:()=>y,DO:()=>c,KF:()=>d,Mv:()=>m,TM:()=>v,ZC:()=>g,lx:()=>p,md:()=>l,pp:()=>x,rA:()=>u});var s=r(95155),a=r(33210),o=r(6296),n=r(51914),i=r(12115);function d({active:e,label:t,onClick:r}){return(0,s.jsx)("button",{type:"button",onClick:r,"aria-pressed":e,className:`relative px-2.5 min-h-[28px] rounded text-xs cursor-pointer transition-all duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring ${e?"bg-[var(--amber-dim)] text-[var(--amber-text)] font-medium shadow-[0_1px_2px_rgba(200,135,58,0.08)]":"text-muted-foreground hover:text-foreground hover:bg-muted/60"}`,children:t})}function l({tone:e,label:t,count:r}){return(0,s.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-muted-foreground",children:[(0,s.jsx)("span",{className:`w-2 h-2 rounded-full ${"ok"===e?"bg-[var(--success)]":"warn"===e?"bg-[var(--amber)]":"bg-muted-foreground/60"}`,"aria-hidden":"true"}),(0,s.jsx)("span",{className:"text-xs",children:t}),(0,s.jsx)("span",{className:`tabular-nums font-medium ${"ok"===e?"text-foreground":"warn"===e?"text-[var(--amber)]":"text-muted-foreground"}`,children:r})]})}function c({value:e,onChange:t,placeholder:r,ariaLabel:o,icon:n}){return(0,s.jsxs)("label",{className:"relative block group/search",children:[(0,s.jsx)(n,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground/60 group-focus-within/search:text-[var(--amber)] pointer-events-none transition-colors duration-150"}),(0,s.jsx)("input",{value:e,onChange:e=>t(e.target.value),placeholder:r,"aria-label":o,className:"w-full h-9 rounded-lg border border-border bg-background pl-9 pr-8 text-sm text-foreground placeholder:text-muted-foreground/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--amber)]/30 focus-visible:border-[var(--amber)]/40 transition-all duration-150"}),e.length>0&&(0,s.jsx)("button",{type:"button",onClick:()=>t(""),"aria-label":"Clear search",className:"absolute right-2.5 top-1/2 -translate-y-1/2 p-0.5 rounded-full text-muted-foreground hover:text-foreground hover:bg-muted cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring transition-colors duration-150",children:(0,s.jsx)(a.A,{size:13})})]})}function u({onClick:e,disabled:t,busy:r,label:a,busyLabel:n,variant:i="default"}){return(0,s.jsxs)("button",{type:"button",onClick:e,disabled:t,"aria-busy":r,className:`inline-flex items-center justify-center gap-1.5 text-2xs min-h-[28px] px-2.5 rounded-md cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-50 disabled:cursor-not-allowed transition-colors duration-150 ${{default:"border border-border hover:bg-muted",primary:"bg-[var(--amber)] text-background hover:bg-[var(--amber)]/90"}[i]}`,children:[r&&(0,s.jsx)(o.A,{size:12,className:"animate-spin","aria-hidden":"true"}),r?n??a:a]})}function m({message:e}){return e?(0,s.jsx)("span",{role:"status","aria-live":"polite",className:"text-2xs text-muted-foreground animate-in fade-in duration-200",children:e}):null}function x({message:e,icon:t,className:r}){return(0,s.jsxs)("div",{className:`rounded-xl border border-dashed border-border/60 bg-gradient-to-b from-card/80 to-card/40 p-10 text-center ${r??""}`,children:[t&&(0,s.jsx)("div",{className:"w-10 h-10 rounded-full bg-muted/50 flex items-center justify-center mx-auto mb-3 text-muted-foreground/40",children:t}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground/70 leading-relaxed max-w-xs mx-auto",children:e})]})}let b=[["bg-rose-100/70 dark:bg-rose-900/30","border-rose-300/50 dark:border-rose-700/40","text-rose-600/80 dark:text-rose-400/80"],["bg-violet-100/70 dark:bg-violet-900/30","border-violet-300/50 dark:border-violet-700/40","text-violet-600/80 dark:text-violet-400/80"],["bg-emerald-100/70 dark:bg-emerald-900/30","border-emerald-300/50 dark:border-emerald-700/40","text-emerald-600/80 dark:text-emerald-400/80"],["bg-sky-100/70 dark:bg-sky-900/30","border-sky-300/50 dark:border-sky-700/40","text-sky-600/80 dark:text-sky-400/80"],["bg-amber-100/70 dark:bg-amber-900/30","border-amber-300/50 dark:border-amber-700/40","text-amber-700/80 dark:text-amber-400/80"],["bg-teal-100/70 dark:bg-teal-900/30","border-teal-300/50 dark:border-teal-700/40","text-teal-600/80 dark:text-teal-400/80"],["bg-pink-100/70 dark:bg-pink-900/30","border-pink-300/50 dark:border-pink-700/40","text-pink-600/80 dark:text-pink-400/80"],["bg-indigo-100/70 dark:bg-indigo-900/30","border-indigo-300/50 dark:border-indigo-700/40","text-indigo-600/80 dark:text-indigo-400/80"],["bg-lime-100/70 dark:bg-lime-900/30","border-lime-300/50 dark:border-lime-700/40","text-lime-700/80 dark:text-lime-400/80"],["bg-fuchsia-100/70 dark:bg-fuchsia-900/30","border-fuchsia-300/50 dark:border-fuchsia-700/40","text-fuchsia-600/80 dark:text-fuchsia-400/80"],["bg-cyan-100/70 dark:bg-cyan-900/30","border-cyan-300/50 dark:border-cyan-700/40","text-cyan-600/80 dark:text-cyan-400/80"],["bg-orange-100/70 dark:bg-orange-900/30","border-orange-300/50 dark:border-orange-700/40","text-orange-600/80 dark:text-orange-400/80"]];function f(e){let t=0;for(let r=0;r<e.length;r++)t=31*t+e.charCodeAt(r)|0;return Math.abs(t)}function h(e){let t=e.split(/[\s\-_]+/).filter(Boolean);return t.length>=2?(t[0][0]+t[1][0]).toUpperCase():e.slice(0,2).toUpperCase()}function p({name:e,status:t,size:r="md",onRemove:o,href:n}){let[i,d,l]=b[f(e)%b.length],c="connected"===t?"bg-[var(--success)]":"detected"===t?"bg-[var(--amber)]":"bg-muted-foreground";return(0,s.jsxs)("div",{className:"relative group/avatar",title:e,children:[(0,s.jsx)("div",{className:`${"sm"===r?"w-7 h-7 text-[10px]":"w-9 h-9 text-xs"} ${i} ${d} ${l} border rounded-full flex items-center justify-center font-semibold select-none`,children:h(e)}),t&&(0,s.jsx)("span",{className:`absolute -bottom-0.5 -right-0.5 w-2.5 h-2.5 rounded-full border-2 border-card ${c}`,"aria-hidden":"true"}),o&&(0,s.jsx)("button",{type:"button",onClick:e=>{e.preventDefault(),e.stopPropagation(),o()},className:"absolute -top-1 -right-1 w-4 h-4 rounded-full bg-destructive text-white flex items-center justify-center opacity-0 scale-75 group-hover/avatar:opacity-100 group-hover/avatar:scale-100 transition-all duration-150 cursor-pointer focus-visible:opacity-100 focus-visible:scale-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","aria-label":`Remove ${e}`,children:(0,s.jsx)(a.A,{size:9})})]})}function g({onClick:e,label:t,size:r="md"}){return(0,s.jsx)("button",{type:"button",onClick:e,title:t,"aria-label":t,className:`${"sm"===r?"w-7 h-7":"w-9 h-9"} rounded-full border-2 border-dashed border-border flex items-center justify-center text-muted-foreground hover:text-foreground hover:border-foreground/30 hover:bg-muted cursor-pointer transition-all duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,children:(0,s.jsx)(n.A,{size:14})})}function v({open:e,title:t,message:r,confirmLabel:a,cancelLabel:o,onConfirm:n,onCancel:d,variant:l="destructive"}){let c=(0,i.useRef)(null);return((0,i.useEffect)(()=>{e&&c.current?.focus()},[e]),(0,i.useEffect)(()=>{if(e)return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t);function t(e){"Escape"===e.key&&d()}},[e,d]),e)?(0,s.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center",role:"alertdialog","aria-modal":"true","aria-label":t,children:[(0,s.jsx)("div",{className:"absolute inset-0 overlay-backdrop",onClick:d,"aria-hidden":"true"}),(0,s.jsxs)("div",{className:"relative bg-card border border-border rounded-lg shadow-xl p-5 max-w-sm w-full mx-4 animate-in fade-in zoom-in-95 duration-200",children:[(0,s.jsx)("h3",{className:"text-sm font-medium text-foreground mb-1.5",children:t}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground mb-4 leading-relaxed",children:r}),(0,s.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,s.jsx)("button",{ref:c,type:"button",onClick:d,className:"px-3 min-h-[32px] text-sm rounded-md border border-border hover:bg-muted cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring transition-colors duration-150",children:o}),(0,s.jsx)("button",{type:"button",onClick:n,className:`px-3 min-h-[32px] text-sm rounded-md cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring transition-colors duration-150 ${"destructive"===l?"bg-destructive text-destructive-foreground hover:bg-destructive/90":"bg-[var(--amber)] text-background hover:bg-[var(--amber)]/90"}`,children:a})]})]})]}):null}function y({open:e,agents:t,emptyLabel:r,onSelect:a,onClose:o}){let n=(0,i.useRef)(null);return((0,i.useEffect)(()=>{if(e)return document.addEventListener("mousedown",t),()=>document.removeEventListener("mousedown",t);function t(e){n.current&&!n.current.contains(e.target)&&o()}},[e,o]),(0,i.useEffect)(()=>{if(e)return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t);function t(e){"Escape"===e.key&&o()}},[e,o]),e)?(0,s.jsx)("div",{ref:n,className:"absolute right-0 top-full mt-1 z-30 w-56 rounded-lg border border-border bg-card shadow-lg animate-in fade-in slide-in-from-top-1 duration-150",children:0===t.length?(0,s.jsx)("p",{className:"px-3 py-2.5 text-xs text-muted-foreground",children:r}):(0,s.jsx)("div",{className:"py-1 max-h-48 overflow-y-auto",children:t.map(e=>(0,s.jsxs)("button",{type:"button",onClick:()=>a(e.key),className:"w-full text-left px-3 py-2 text-xs text-foreground hover:bg-muted cursor-pointer flex items-center gap-2 transition-colors duration-100",children:[(()=>{let[t,r,a]=b[f(e.name)%b.length];return(0,s.jsx)("div",{className:`w-6 h-6 rounded-full border ${t} ${r} ${a} flex items-center justify-center text-[9px] font-semibold shrink-0`,children:h(e.name)})})(),e.name]},e.key))})}):null}},41585:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(90425).A)("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},48368:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(90425).A)("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]])},51914:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(90425).A)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},54839:(e,t,r)=>{Promise.resolve().then(r.bind(r,80158))},68459:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(90425).A)("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]])},73321:(e,t,r)=>{"use strict";var s=r(74645);r.o(s,"usePathname")&&r.d(t,{usePathname:function(){return s.usePathname}}),r.o(s,"useRouter")&&r.d(t,{useRouter:function(){return s.useRouter}}),r.o(s,"useSearchParams")&&r.d(t,{useSearchParams:function(){return s.useSearchParams}})},80158:(e,t,r)=>{"use strict";r.d(t,{default:()=>k});var s=r(95155),a=r(12115),o=r(68459),n=r(38798),i=r(33078),d=r(48368),l=r(41585),c=r(6296),u=r(9199),m=r(33210),x=r(73321),b=r(61263),f=r(9339);let h=(0,f.createServerReference)("60e61349d170df7daaa563ab9506f767d48946f57f",f.callServer,void 0,f.findSourceMapURL,"restoreFromTrashAction"),p=(0,f.createServerReference)("408086bfc563729799acb3aec610fbd064fd1baa32",f.callServer,void 0,f.findSourceMapURL,"permanentlyDeleteAction"),g=(0,f.createServerReference)("00fdb601f230c370deaab8ec5586851db9459a58eb",f.callServer,void 0,f.findSourceMapURL,"emptyTrashAction");var v=r(39498),y=r(4235);function k({initialItems:e}){let{t}=(0,b.Y)(),r=(0,x.useRouter)(),[f,k]=(0,a.useState)(e),[j,N]=(0,a.useTransition)(),[w,A]=(0,a.useState)(!1),[C,M]=(0,a.useState)(null),[R,z]=(0,a.useState)(null),[$,S]=(0,a.useState)(null),L=(0,a.useCallback)(async e=>{S(e.id);try{let s=await h(e.id,"restore");s.success?(k(t=>t.filter(t=>t.id!==e.id)),y.oR.success(t.trash.restored),r.refresh()):s.conflict?z(e):y.oR.error(s.error??"Failed to restore")}finally{S(null)}},[t,r]),E=(0,a.useCallback)(async e=>{if(!R)return;let s=await h(R.id,e);s.success?(k(e=>e.filter(e=>e.id!==R.id)),y.oR.success(t.trash.restored),z(null),r.refresh()):y.oR.error(s.error??"Failed to restore")},[R,t,r]),P=(0,a.useCallback)(async()=>{if(!C)return;let e=await p(C.id);e.success?(k(e=>e.filter(e=>e.id!==C.id)),y.oR.success(t.trash.deleted)):y.oR.error(e.error??"Failed to delete"),M(null)},[C,t]),T=(0,a.useCallback)(async()=>{N(async()=>{let e=await g();e.success?(k([]),y.oR.success(t.trash.emptied(e.count??0))):y.oR.error(e.error??"Failed to empty trash"),A(!1)})},[t]);return(0,s.jsxs)("div",{className:"min-h-screen",children:[(0,s.jsx)("div",{className:"px-4 md:px-6 pt-6 md:pt-8",children:(0,s.jsx)("div",{className:"content-width xl:mr-[220px] rounded-xl border border-border bg-card px-4 py-3 md:px-5 md:py-4",children:(0,s.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 text-sm font-medium text-foreground font-display",children:[(0,s.jsx)(o.A,{size:15}),t.trash.title]}),(0,s.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:t.trash.subtitle}),f.length>0&&(0,s.jsx)("div",{className:"mt-2 text-xs text-muted-foreground",children:t.trash.itemCount(f.length)})]}),f.length>0&&(0,s.jsx)("button",{type:"button",onClick:()=>A(!0),disabled:j,className:"px-2.5 py-1.5 rounded-md text-xs font-medium bg-error/10 text-error hover:bg-error/20 transition-colors disabled:opacity-50",children:t.trash.emptyTrash})]})})}),(0,s.jsx)("div",{className:"px-4 md:px-6 py-4 md:py-6",children:(0,s.jsx)("div",{className:"content-width xl:mr-[220px]",children:0===f.length?(0,s.jsxs)("div",{className:"rounded-xl border border-dashed border-border bg-card p-12 text-center",children:[(0,s.jsx)(o.A,{size:32,className:"mx-auto text-muted-foreground/30 mb-3"}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground font-display",children:t.trash.empty}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground/60 mt-1",children:t.trash.emptySubtext})]}):(0,s.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",children:f.map(e=>{let r=Math.max(0,Math.ceil((new Date(e.expiresAt).getTime()-Date.now())/864e5)),a=r<=3;return(0,s.jsxs)("div",{className:"rounded-xl border border-border bg-card p-4 flex flex-col gap-3 hover:border-border/80 transition-colors",children:[(0,s.jsxs)("div",{className:"flex items-start gap-3 min-w-0",children:[(0,s.jsx)("div",{className:"w-9 h-9 rounded-lg bg-muted/50 flex items-center justify-center shrink-0",children:e.isDirectory?(0,s.jsx)(n.A,{size:16,className:"text-muted-foreground"}):e.fileName.endsWith(".csv")?(0,s.jsx)(i.A,{size:16,className:"text-success"}):(0,s.jsx)(d.A,{size:16,className:"text-muted-foreground"})}),(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsx)("p",{className:"text-sm font-medium text-foreground truncate",title:e.fileName,children:e.fileName}),(0,s.jsxs)("p",{className:"text-xs text-muted-foreground truncate mt-0.5",title:e.originalPath,children:[t.trash.from,": ",e.originalPath.split("/").slice(0,-1).join("/")||"/"]})]})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,s.jsx)("span",{className:"text-2xs text-muted-foreground",children:t.trash.deletedAgo(function(e,t){let r=Math.floor((Date.now()-new Date(e).getTime())/6e4);if(r<1)return t.justNow??"just now";if(r<60)return t.minutesAgo?.(r)??`${r}m ago`;let s=Math.floor(r/60);if(s<24)return t.hoursAgo?.(s)??`${s}h ago`;let a=Math.floor(s/24);return t.daysAgo?.(a)??`${a}d ago`}(e.deletedAt,t.trash))}),(0,s.jsxs)("span",{className:`text-2xs ${a?"text-error":"text-muted-foreground/60"}`,children:[a&&(0,s.jsx)(l.A,{size:9,className:"inline mr-0.5"}),t.trash.expiresIn(r)]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,s.jsxs)("button",{type:"button",onClick:()=>L(e),disabled:$===e.id,className:"inline-flex items-center gap-1 px-2 py-1 rounded-md text-xs font-medium bg-success/10 text-success hover:bg-success/20 transition-colors disabled:opacity-50",children:[$===e.id?(0,s.jsx)(c.A,{size:11,className:"animate-spin"}):(0,s.jsx)(u.A,{size:11}),t.trash.restore]}),(0,s.jsx)("button",{type:"button",onClick:()=>M(e),className:"p-1 rounded-md text-muted-foreground hover:text-error hover:bg-error/10 transition-colors",title:t.trash.deletePermanently,children:(0,s.jsx)(m.A,{size:13})})]})]})]},e.id)})})})}),(0,s.jsx)(v.TM,{open:w,title:t.trash.emptyTrash,message:t.trash.emptyTrashConfirm,confirmLabel:t.trash.emptyTrash,cancelLabel:t.trash.cancel??"Cancel",onConfirm:()=>void T(),onCancel:()=>A(!1),variant:"destructive"}),(0,s.jsx)(v.TM,{open:!!C,title:t.trash.deletePermanently,message:C?t.trash.deletePermanentlyConfirm(C.fileName):"",confirmLabel:t.trash.deletePermanently,cancelLabel:t.trash.cancel??"Cancel",onConfirm:()=>void P(),onCancel:()=>M(null),variant:"destructive"}),R&&(0,s.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40 backdrop-blur-sm",children:(0,s.jsxs)("div",{className:"bg-card border border-border rounded-xl shadow-xl max-w-sm w-full mx-4 p-5",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,s.jsx)(l.A,{size:16,className:"text-[var(--amber)]"}),(0,s.jsx)("h3",{className:"text-sm font-semibold font-display",children:t.trash.restoreConflict})]}),(0,s.jsxs)("p",{className:"text-xs text-muted-foreground mb-4",children:['"',R.fileName,'" — ',R.originalPath]}),(0,s.jsxs)("div",{className:"flex items-center gap-2 justify-end",children:[(0,s.jsx)("button",{type:"button",onClick:()=>z(null),className:"px-3 py-1.5 rounded-md text-xs font-medium text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",children:t.trash.cancel??"Cancel"}),(0,s.jsx)("button",{type:"button",onClick:()=>void E("copy"),className:"px-3 py-1.5 rounded-md text-xs font-medium bg-muted text-foreground hover:bg-muted/80 transition-colors",children:t.trash.saveAsCopy}),(0,s.jsx)("button",{type:"button",onClick:()=>void E("overwrite"),className:"px-3 py-1.5 rounded-md text-xs font-medium bg-[var(--amber-dim)] text-[var(--amber-text)] hover:opacity-80 transition-colors",children:t.trash.overwrite})]})]})})]})}},90425:(e,t,r)=>{"use strict";r.d(t,{A:()=>d});var s=r(12115);let a=(...e)=>e.filter((e,t,r)=>!!e&&""!==e.trim()&&r.indexOf(e)===t).join(" ").trim(),o=e=>{let t=e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,r)=>r?r.toUpperCase():t.toLowerCase());return t.charAt(0).toUpperCase()+t.slice(1)};var n={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let i=(0,s.forwardRef)(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:o,className:i="",children:d,iconNode:l,...c},u)=>(0,s.createElement)("svg",{ref:u,...n,width:t,height:t,stroke:e,strokeWidth:o?24*Number(r)/Number(t):r,className:a("lucide",i),...!d&&!(e=>{for(let t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0;return!1})(c)&&{"aria-hidden":"true"},...c},[...l.map(([e,t])=>(0,s.createElement)(e,t)),...Array.isArray(d)?d:[d]])),d=(e,t)=>{let r=(0,s.forwardRef)(({className:r,...n},d)=>(0,s.createElement)(i,{ref:d,iconNode:t,className:a(`lucide-${o(e).replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${e}`,r),...n}));return r.displayName=o(e),r}}},e=>{e.O(0,[1263,8441,3794,7358],()=>e(e.s=54839)),_N_E=e.O()}]);
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1227],{4235:(e,t,r)=>{"use strict";r.d(t,{B1:()=>i,X8:()=>l,dV:()=>d,oR:()=>u});let s=[],a=[],o=0;function n(){for(let e of a)e()}function i(e){return a=[...a,e],()=>{a=a.filter(t=>t!==e)}}function d(){return s}function l(e){s=s.filter(t=>t.id!==e),n()}function c(e){let t=`toast-${++o}`,r={id:t,message:e.message,type:e.type??"info",duration:e.duration??2e3,action:e.action};s=[...s,r].slice(-3),n(),r.duration>0&&setTimeout(()=>l(t),r.duration)}function u(e,t){c({message:e,...t})}u.success=(e,t)=>c({message:e,type:"success",duration:t}),u.undo=(e,t,r)=>c({message:e,type:"info",duration:r?.duration??5e3,action:{label:r?.label??"Undo",onClick:t}}),u.error=(e,t)=>c({message:e,type:"error",duration:t}),u.copy=(e="Copied")=>c({message:e,type:"success",duration:1500})},6296:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(90425).A)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},9199:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(90425).A)("rotate-ccw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]])},9339:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s={callServer:function(){return o.callServer},createServerReference:function(){return i.createServerReference},findSourceMapURL:function(){return n.findSourceMapURL}};for(var a in s)Object.defineProperty(t,a,{enumerable:!0,get:s[a]});let o=r(77304),n=r(4060),i=r(77197)},33078:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(90425).A)("table",[["path",{d:"M12 3v18",key:"108xh3"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}]])},33210:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(90425).A)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])},38798:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(90425).A)("folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]])},39498:(e,t,r)=>{"use strict";r.d(t,{BK:()=>y,DO:()=>c,KF:()=>d,Mv:()=>m,TM:()=>v,ZC:()=>g,lx:()=>p,md:()=>l,pp:()=>x,rA:()=>u});var s=r(95155),a=r(33210),o=r(6296),n=r(51914),i=r(12115);function d({active:e,label:t,onClick:r}){return(0,s.jsx)("button",{type:"button",onClick:r,"aria-pressed":e,className:`relative px-2.5 min-h-[28px] rounded text-xs cursor-pointer transition-all duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring ${e?"bg-[var(--amber-dim)] text-[var(--amber-text)] font-medium shadow-[0_1px_2px_rgba(200,135,58,0.08)]":"text-muted-foreground hover:text-foreground hover:bg-muted/60"}`,children:t})}function l({tone:e,label:t,count:r}){return(0,s.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-muted-foreground",children:[(0,s.jsx)("span",{className:`w-2 h-2 rounded-full ${"ok"===e?"bg-[var(--success)]":"warn"===e?"bg-[var(--amber)]":"bg-muted-foreground/60"}`,"aria-hidden":"true"}),(0,s.jsx)("span",{className:"text-xs",children:t}),(0,s.jsx)("span",{className:`tabular-nums font-medium ${"ok"===e?"text-foreground":"warn"===e?"text-[var(--amber)]":"text-muted-foreground"}`,children:r})]})}function c({value:e,onChange:t,placeholder:r,ariaLabel:o,icon:n}){return(0,s.jsxs)("label",{className:"relative block group/search",children:[(0,s.jsx)(n,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground/60 group-focus-within/search:text-[var(--amber)] pointer-events-none transition-colors duration-150"}),(0,s.jsx)("input",{value:e,onChange:e=>t(e.target.value),placeholder:r,"aria-label":o,className:"w-full h-9 rounded-lg border border-border bg-background pl-9 pr-8 text-sm text-foreground placeholder:text-muted-foreground/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--amber)]/30 focus-visible:border-[var(--amber)]/40 transition-all duration-150"}),e.length>0&&(0,s.jsx)("button",{type:"button",onClick:()=>t(""),"aria-label":"Clear search",className:"absolute right-2.5 top-1/2 -translate-y-1/2 p-0.5 rounded-full text-muted-foreground hover:text-foreground hover:bg-muted cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring transition-colors duration-150",children:(0,s.jsx)(a.A,{size:13})})]})}function u({onClick:e,disabled:t,busy:r,label:a,busyLabel:n,variant:i="default"}){return(0,s.jsxs)("button",{type:"button",onClick:e,disabled:t,"aria-busy":r,className:`inline-flex items-center justify-center gap-1.5 text-2xs min-h-[28px] px-2.5 rounded-md cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-50 disabled:cursor-not-allowed transition-colors duration-150 ${{default:"border border-border hover:bg-muted",primary:"bg-[var(--amber)] text-background hover:bg-[var(--amber)]/90"}[i]}`,children:[r&&(0,s.jsx)(o.A,{size:12,className:"animate-spin","aria-hidden":"true"}),r?n??a:a]})}function m({message:e}){return e?(0,s.jsx)("span",{role:"status","aria-live":"polite",className:"text-2xs text-muted-foreground animate-in fade-in duration-200",children:e}):null}function x({message:e,icon:t,className:r}){return(0,s.jsxs)("div",{className:`rounded-xl border border-dashed border-border/60 bg-gradient-to-b from-card/80 to-card/40 p-10 text-center ${r??""}`,children:[t&&(0,s.jsx)("div",{className:"w-10 h-10 rounded-full bg-muted/50 flex items-center justify-center mx-auto mb-3 text-muted-foreground/40",children:t}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground/70 leading-relaxed max-w-xs mx-auto",children:e})]})}let b=[["bg-rose-100/70 dark:bg-rose-900/30","border-rose-300/50 dark:border-rose-700/40","text-rose-600/80 dark:text-rose-400/80"],["bg-violet-100/70 dark:bg-violet-900/30","border-violet-300/50 dark:border-violet-700/40","text-violet-600/80 dark:text-violet-400/80"],["bg-emerald-100/70 dark:bg-emerald-900/30","border-emerald-300/50 dark:border-emerald-700/40","text-emerald-600/80 dark:text-emerald-400/80"],["bg-sky-100/70 dark:bg-sky-900/30","border-sky-300/50 dark:border-sky-700/40","text-sky-600/80 dark:text-sky-400/80"],["bg-amber-100/70 dark:bg-amber-900/30","border-amber-300/50 dark:border-amber-700/40","text-amber-700/80 dark:text-amber-400/80"],["bg-teal-100/70 dark:bg-teal-900/30","border-teal-300/50 dark:border-teal-700/40","text-teal-600/80 dark:text-teal-400/80"],["bg-pink-100/70 dark:bg-pink-900/30","border-pink-300/50 dark:border-pink-700/40","text-pink-600/80 dark:text-pink-400/80"],["bg-indigo-100/70 dark:bg-indigo-900/30","border-indigo-300/50 dark:border-indigo-700/40","text-indigo-600/80 dark:text-indigo-400/80"],["bg-lime-100/70 dark:bg-lime-900/30","border-lime-300/50 dark:border-lime-700/40","text-lime-700/80 dark:text-lime-400/80"],["bg-fuchsia-100/70 dark:bg-fuchsia-900/30","border-fuchsia-300/50 dark:border-fuchsia-700/40","text-fuchsia-600/80 dark:text-fuchsia-400/80"],["bg-cyan-100/70 dark:bg-cyan-900/30","border-cyan-300/50 dark:border-cyan-700/40","text-cyan-600/80 dark:text-cyan-400/80"],["bg-orange-100/70 dark:bg-orange-900/30","border-orange-300/50 dark:border-orange-700/40","text-orange-600/80 dark:text-orange-400/80"]];function f(e){let t=0;for(let r=0;r<e.length;r++)t=31*t+e.charCodeAt(r)|0;return Math.abs(t)}function h(e){let t=e.split(/[\s\-_]+/).filter(Boolean);return t.length>=2?(t[0][0]+t[1][0]).toUpperCase():e.slice(0,2).toUpperCase()}function p({name:e,status:t,size:r="md",onRemove:o,href:n}){let[i,d,l]=b[f(e)%b.length],c="connected"===t?"bg-[var(--success)]":"detected"===t?"bg-[var(--amber)]":"bg-muted-foreground";return(0,s.jsxs)("div",{className:"relative group/avatar",title:e,children:[(0,s.jsx)("div",{className:`${"sm"===r?"w-7 h-7 text-[10px]":"w-9 h-9 text-xs"} ${i} ${d} ${l} border rounded-full flex items-center justify-center font-semibold select-none`,children:h(e)}),t&&(0,s.jsx)("span",{className:`absolute -bottom-0.5 -right-0.5 w-2.5 h-2.5 rounded-full border-2 border-card ${c}`,"aria-hidden":"true"}),o&&(0,s.jsx)("button",{type:"button",onClick:e=>{e.preventDefault(),e.stopPropagation(),o()},className:"absolute -top-1 -right-1 w-4 h-4 rounded-full bg-destructive text-white flex items-center justify-center opacity-0 scale-75 group-hover/avatar:opacity-100 group-hover/avatar:scale-100 transition-all duration-150 cursor-pointer focus-visible:opacity-100 focus-visible:scale-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","aria-label":`Remove ${e}`,children:(0,s.jsx)(a.A,{size:9})})]})}function g({onClick:e,label:t,size:r="md"}){return(0,s.jsx)("button",{type:"button",onClick:e,title:t,"aria-label":t,className:`${"sm"===r?"w-7 h-7":"w-9 h-9"} rounded-full border-2 border-dashed border-border flex items-center justify-center text-muted-foreground hover:text-foreground hover:border-foreground/30 hover:bg-muted cursor-pointer transition-all duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,children:(0,s.jsx)(n.A,{size:14})})}function v({open:e,title:t,message:r,confirmLabel:a,cancelLabel:o,onConfirm:n,onCancel:d,variant:l="destructive"}){let c=(0,i.useRef)(null);return((0,i.useEffect)(()=>{e&&c.current?.focus()},[e]),(0,i.useEffect)(()=>{if(e)return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t);function t(e){"Escape"===e.key&&d()}},[e,d]),e)?(0,s.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center",role:"alertdialog","aria-modal":"true","aria-label":t,children:[(0,s.jsx)("div",{className:"absolute inset-0 overlay-backdrop",onClick:d,"aria-hidden":"true"}),(0,s.jsxs)("div",{className:"relative bg-card border border-border rounded-lg shadow-xl p-5 max-w-sm w-full mx-4 animate-in fade-in zoom-in-95 duration-200",children:[(0,s.jsx)("h3",{className:"text-sm font-medium text-foreground mb-1.5",children:t}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground mb-4 leading-relaxed",children:r}),(0,s.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,s.jsx)("button",{ref:c,type:"button",onClick:d,className:"px-3 min-h-[32px] text-sm rounded-md border border-border hover:bg-muted cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring transition-colors duration-150",children:o}),(0,s.jsx)("button",{type:"button",onClick:n,className:`px-3 min-h-[32px] text-sm rounded-md cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring transition-colors duration-150 ${"destructive"===l?"bg-destructive text-destructive-foreground hover:bg-destructive/90":"bg-[var(--amber)] text-background hover:bg-[var(--amber)]/90"}`,children:a})]})]})]}):null}function y({open:e,agents:t,emptyLabel:r,onSelect:a,onClose:o}){let n=(0,i.useRef)(null);return((0,i.useEffect)(()=>{if(e)return document.addEventListener("mousedown",t),()=>document.removeEventListener("mousedown",t);function t(e){n.current&&!n.current.contains(e.target)&&o()}},[e,o]),(0,i.useEffect)(()=>{if(e)return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t);function t(e){"Escape"===e.key&&o()}},[e,o]),e)?(0,s.jsx)("div",{ref:n,className:"absolute right-0 top-full mt-1 z-30 w-56 rounded-lg border border-border bg-card shadow-lg animate-in fade-in slide-in-from-top-1 duration-150",children:0===t.length?(0,s.jsx)("p",{className:"px-3 py-2.5 text-xs text-muted-foreground",children:r}):(0,s.jsx)("div",{className:"py-1 max-h-48 overflow-y-auto",children:t.map(e=>(0,s.jsxs)("button",{type:"button",onClick:()=>a(e.key),className:"w-full text-left px-3 py-2 text-xs text-foreground hover:bg-muted cursor-pointer flex items-center gap-2 transition-colors duration-100",children:[(()=>{let[t,r,a]=b[f(e.name)%b.length];return(0,s.jsx)("div",{className:`w-6 h-6 rounded-full border ${t} ${r} ${a} flex items-center justify-center text-[9px] font-semibold shrink-0`,children:h(e.name)})})(),e.name]},e.key))})}):null}},41585:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(90425).A)("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},48368:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(90425).A)("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]])},51914:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(90425).A)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},54839:(e,t,r)=>{Promise.resolve().then(r.bind(r,88822))},68459:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(90425).A)("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]])},73321:(e,t,r)=>{"use strict";var s=r(74645);r.o(s,"usePathname")&&r.d(t,{usePathname:function(){return s.usePathname}}),r.o(s,"useRouter")&&r.d(t,{useRouter:function(){return s.useRouter}}),r.o(s,"useSearchParams")&&r.d(t,{useSearchParams:function(){return s.useSearchParams}})},88822:(e,t,r)=>{"use strict";r.d(t,{default:()=>k});var s=r(95155),a=r(12115),o=r(68459),n=r(38798),i=r(33078),d=r(48368),l=r(41585),c=r(6296),u=r(9199),m=r(33210),x=r(73321),b=r(61263),f=r(9339);let h=(0,f.createServerReference)("604ba8f281c8eb0d633c466b6ec0fa0163d8c2be94",f.callServer,void 0,f.findSourceMapURL,"restoreFromTrashAction"),p=(0,f.createServerReference)("407714e460df6f643722762cfebe2233c7a3d7c386",f.callServer,void 0,f.findSourceMapURL,"permanentlyDeleteAction"),g=(0,f.createServerReference)("0042ee0de58698adeadcf4f537c98d485508a83549",f.callServer,void 0,f.findSourceMapURL,"emptyTrashAction");var v=r(39498),y=r(4235);function k({initialItems:e}){let{t}=(0,b.Y)(),r=(0,x.useRouter)(),[f,k]=(0,a.useState)(e),[j,N]=(0,a.useTransition)(),[w,A]=(0,a.useState)(!1),[C,M]=(0,a.useState)(null),[R,z]=(0,a.useState)(null),[$,S]=(0,a.useState)(null),L=(0,a.useCallback)(async e=>{S(e.id);try{let s=await h(e.id,"restore");s.success?(k(t=>t.filter(t=>t.id!==e.id)),y.oR.success(t.trash.restored),r.refresh()):s.conflict?z(e):y.oR.error(s.error??"Failed to restore")}finally{S(null)}},[t,r]),E=(0,a.useCallback)(async e=>{if(!R)return;let s=await h(R.id,e);s.success?(k(e=>e.filter(e=>e.id!==R.id)),y.oR.success(t.trash.restored),z(null),r.refresh()):y.oR.error(s.error??"Failed to restore")},[R,t,r]),P=(0,a.useCallback)(async()=>{if(!C)return;let e=await p(C.id);e.success?(k(e=>e.filter(e=>e.id!==C.id)),y.oR.success(t.trash.deleted)):y.oR.error(e.error??"Failed to delete"),M(null)},[C,t]),T=(0,a.useCallback)(async()=>{N(async()=>{let e=await g();e.success?(k([]),y.oR.success(t.trash.emptied(e.count??0))):y.oR.error(e.error??"Failed to empty trash"),A(!1)})},[t]);return(0,s.jsxs)("div",{className:"min-h-screen",children:[(0,s.jsx)("div",{className:"px-4 md:px-6 pt-6 md:pt-8",children:(0,s.jsx)("div",{className:"content-width xl:mr-[220px] rounded-xl border border-border bg-card px-4 py-3 md:px-5 md:py-4",children:(0,s.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 text-sm font-medium text-foreground font-display",children:[(0,s.jsx)(o.A,{size:15}),t.trash.title]}),(0,s.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:t.trash.subtitle}),f.length>0&&(0,s.jsx)("div",{className:"mt-2 text-xs text-muted-foreground",children:t.trash.itemCount(f.length)})]}),f.length>0&&(0,s.jsx)("button",{type:"button",onClick:()=>A(!0),disabled:j,className:"px-2.5 py-1.5 rounded-md text-xs font-medium bg-error/10 text-error hover:bg-error/20 transition-colors disabled:opacity-50",children:t.trash.emptyTrash})]})})}),(0,s.jsx)("div",{className:"px-4 md:px-6 py-4 md:py-6",children:(0,s.jsx)("div",{className:"content-width xl:mr-[220px]",children:0===f.length?(0,s.jsxs)("div",{className:"rounded-xl border border-dashed border-border bg-card p-12 text-center",children:[(0,s.jsx)(o.A,{size:32,className:"mx-auto text-muted-foreground/30 mb-3"}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground font-display",children:t.trash.empty}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground/60 mt-1",children:t.trash.emptySubtext})]}):(0,s.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",children:f.map(e=>{let r=Math.max(0,Math.ceil((new Date(e.expiresAt).getTime()-Date.now())/864e5)),a=r<=3;return(0,s.jsxs)("div",{className:"rounded-xl border border-border bg-card p-4 flex flex-col gap-3 hover:border-border/80 transition-colors",children:[(0,s.jsxs)("div",{className:"flex items-start gap-3 min-w-0",children:[(0,s.jsx)("div",{className:"w-9 h-9 rounded-lg bg-muted/50 flex items-center justify-center shrink-0",children:e.isDirectory?(0,s.jsx)(n.A,{size:16,className:"text-muted-foreground"}):e.fileName.endsWith(".csv")?(0,s.jsx)(i.A,{size:16,className:"text-success"}):(0,s.jsx)(d.A,{size:16,className:"text-muted-foreground"})}),(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsx)("p",{className:"text-sm font-medium text-foreground truncate",title:e.fileName,children:e.fileName}),(0,s.jsxs)("p",{className:"text-xs text-muted-foreground truncate mt-0.5",title:e.originalPath,children:[t.trash.from,": ",e.originalPath.split("/").slice(0,-1).join("/")||"/"]})]})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,s.jsx)("span",{className:"text-2xs text-muted-foreground",children:t.trash.deletedAgo(function(e,t){let r=Math.floor((Date.now()-new Date(e).getTime())/6e4);if(r<1)return t.justNow??"just now";if(r<60)return t.minutesAgo?.(r)??`${r}m ago`;let s=Math.floor(r/60);if(s<24)return t.hoursAgo?.(s)??`${s}h ago`;let a=Math.floor(s/24);return t.daysAgo?.(a)??`${a}d ago`}(e.deletedAt,t.trash))}),(0,s.jsxs)("span",{className:`text-2xs ${a?"text-error":"text-muted-foreground/60"}`,children:[a&&(0,s.jsx)(l.A,{size:9,className:"inline mr-0.5"}),t.trash.expiresIn(r)]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,s.jsxs)("button",{type:"button",onClick:()=>L(e),disabled:$===e.id,className:"inline-flex items-center gap-1 px-2 py-1 rounded-md text-xs font-medium bg-success/10 text-success hover:bg-success/20 transition-colors disabled:opacity-50",children:[$===e.id?(0,s.jsx)(c.A,{size:11,className:"animate-spin"}):(0,s.jsx)(u.A,{size:11}),t.trash.restore]}),(0,s.jsx)("button",{type:"button",onClick:()=>M(e),className:"p-1 rounded-md text-muted-foreground hover:text-error hover:bg-error/10 transition-colors",title:t.trash.deletePermanently,children:(0,s.jsx)(m.A,{size:13})})]})]})]},e.id)})})})}),(0,s.jsx)(v.TM,{open:w,title:t.trash.emptyTrash,message:t.trash.emptyTrashConfirm,confirmLabel:t.trash.emptyTrash,cancelLabel:t.trash.cancel??"Cancel",onConfirm:()=>void T(),onCancel:()=>A(!1),variant:"destructive"}),(0,s.jsx)(v.TM,{open:!!C,title:t.trash.deletePermanently,message:C?t.trash.deletePermanentlyConfirm(C.fileName):"",confirmLabel:t.trash.deletePermanently,cancelLabel:t.trash.cancel??"Cancel",onConfirm:()=>void P(),onCancel:()=>M(null),variant:"destructive"}),R&&(0,s.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40 backdrop-blur-sm",children:(0,s.jsxs)("div",{className:"bg-card border border-border rounded-xl shadow-xl max-w-sm w-full mx-4 p-5",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,s.jsx)(l.A,{size:16,className:"text-[var(--amber)]"}),(0,s.jsx)("h3",{className:"text-sm font-semibold font-display",children:t.trash.restoreConflict})]}),(0,s.jsxs)("p",{className:"text-xs text-muted-foreground mb-4",children:['"',R.fileName,'" — ',R.originalPath]}),(0,s.jsxs)("div",{className:"flex items-center gap-2 justify-end",children:[(0,s.jsx)("button",{type:"button",onClick:()=>z(null),className:"px-3 py-1.5 rounded-md text-xs font-medium text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",children:t.trash.cancel??"Cancel"}),(0,s.jsx)("button",{type:"button",onClick:()=>void E("copy"),className:"px-3 py-1.5 rounded-md text-xs font-medium bg-muted text-foreground hover:bg-muted/80 transition-colors",children:t.trash.saveAsCopy}),(0,s.jsx)("button",{type:"button",onClick:()=>void E("overwrite"),className:"px-3 py-1.5 rounded-md text-xs font-medium bg-[var(--amber-dim)] text-[var(--amber-text)] hover:opacity-80 transition-colors",children:t.trash.overwrite})]})]})})]})}},90425:(e,t,r)=>{"use strict";r.d(t,{A:()=>d});var s=r(12115);let a=(...e)=>e.filter((e,t,r)=>!!e&&""!==e.trim()&&r.indexOf(e)===t).join(" ").trim(),o=e=>{let t=e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,r)=>r?r.toUpperCase():t.toLowerCase());return t.charAt(0).toUpperCase()+t.slice(1)};var n={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let i=(0,s.forwardRef)(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:o,className:i="",children:d,iconNode:l,...c},u)=>(0,s.createElement)("svg",{ref:u,...n,width:t,height:t,stroke:e,strokeWidth:o?24*Number(r)/Number(t):r,className:a("lucide",i),...!d&&!(e=>{for(let t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0;return!1})(c)&&{"aria-hidden":"true"},...c},[...l.map(([e,t])=>(0,s.createElement)(e,t)),...Array.isArray(d)?d:[d]])),d=(e,t)=>{let r=(0,s.forwardRef)(({className:r,...n},d)=>(0,s.createElement)(i,{ref:d,iconNode:t,className:a(`lucide-${o(e).replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${e}`,r),...n}));return r.displayName=o(e),r}}},e=>{e.O(0,[1263,8441,3794,7358],()=>e(e.s=54839)),_N_E=e.O()}]);
|