@geminilight/mindos 0.6.47 → 0.6.49

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.
Files changed (152) hide show
  1. package/_standalone/.mindos-build-version +1 -1
  2. package/_standalone/.next/BUILD_ID +1 -1
  3. package/_standalone/.next/app-path-routes-manifest.json +23 -23
  4. package/_standalone/.next/build-manifest.json +2 -2
  5. package/_standalone/.next/cache/.previewinfo +1 -1
  6. package/_standalone/.next/cache/.rscinfo +1 -1
  7. package/_standalone/.next/cache/config.json +3 -3
  8. package/_standalone/.next/prerender-manifest.json +3 -3
  9. package/_standalone/.next/server/app/.well-known/agent-card.json/route_client-reference-manifest.js +1 -1
  10. package/_standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  11. package/_standalone/.next/server/app/_global-error.html +2 -2
  12. package/_standalone/.next/server/app/_global-error.rsc +1 -1
  13. package/_standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  14. package/_standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  15. package/_standalone/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  16. package/_standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  17. package/_standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  18. package/_standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  19. package/_standalone/.next/server/app/_not-found/page.js +1 -1
  20. package/_standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
  21. package/_standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  22. package/_standalone/.next/server/app/agents/[agentKey]/page.js +1 -1
  23. package/_standalone/.next/server/app/agents/[agentKey]/page.js.nft.json +1 -1
  24. package/_standalone/.next/server/app/agents/[agentKey]/page_client-reference-manifest.js +1 -1
  25. package/_standalone/.next/server/app/agents/page.js +1 -1
  26. package/_standalone/.next/server/app/agents/page.js.nft.json +1 -1
  27. package/_standalone/.next/server/app/agents/page_client-reference-manifest.js +1 -1
  28. package/_standalone/.next/server/app/api/a2a/agents/route_client-reference-manifest.js +1 -1
  29. package/_standalone/.next/server/app/api/a2a/delegations/route_client-reference-manifest.js +1 -1
  30. package/_standalone/.next/server/app/api/a2a/discover/route_client-reference-manifest.js +1 -1
  31. package/_standalone/.next/server/app/api/a2a/route_client-reference-manifest.js +1 -1
  32. package/_standalone/.next/server/app/api/acp/config/route_client-reference-manifest.js +1 -1
  33. package/_standalone/.next/server/app/api/acp/detect/route_client-reference-manifest.js +1 -1
  34. package/_standalone/.next/server/app/api/acp/install/route_client-reference-manifest.js +1 -1
  35. package/_standalone/.next/server/app/api/acp/registry/route_client-reference-manifest.js +1 -1
  36. package/_standalone/.next/server/app/api/acp/session/route_client-reference-manifest.js +1 -1
  37. package/_standalone/.next/server/app/api/agent-activity/route_client-reference-manifest.js +1 -1
  38. package/_standalone/.next/server/app/api/ask/route.js +23 -23
  39. package/_standalone/.next/server/app/api/ask/route_client-reference-manifest.js +1 -1
  40. package/_standalone/.next/server/app/api/ask-sessions/route_client-reference-manifest.js +1 -1
  41. package/_standalone/.next/server/app/api/auth/route.js +1 -1
  42. package/_standalone/.next/server/app/api/auth/route_client-reference-manifest.js +1 -1
  43. package/_standalone/.next/server/app/api/backlinks/route_client-reference-manifest.js +1 -1
  44. package/_standalone/.next/server/app/api/bootstrap/route_client-reference-manifest.js +1 -1
  45. package/_standalone/.next/server/app/api/changes/route_client-reference-manifest.js +1 -1
  46. package/_standalone/.next/server/app/api/export/route_client-reference-manifest.js +1 -1
  47. package/_standalone/.next/server/app/api/extract-pdf/route_client-reference-manifest.js +1 -1
  48. package/_standalone/.next/server/app/api/file/import/route_client-reference-manifest.js +1 -1
  49. package/_standalone/.next/server/app/api/file/route_client-reference-manifest.js +1 -1
  50. package/_standalone/.next/server/app/api/files/route_client-reference-manifest.js +1 -1
  51. package/_standalone/.next/server/app/api/git/route_client-reference-manifest.js +1 -1
  52. package/_standalone/.next/server/app/api/graph/route_client-reference-manifest.js +1 -1
  53. package/_standalone/.next/server/app/api/health/route_client-reference-manifest.js +1 -1
  54. package/_standalone/.next/server/app/api/inbox/route_client-reference-manifest.js +1 -1
  55. package/_standalone/.next/server/app/api/init/route_client-reference-manifest.js +1 -1
  56. package/_standalone/.next/server/app/api/mcp/agents/route_client-reference-manifest.js +1 -1
  57. package/_standalone/.next/server/app/api/mcp/install/route_client-reference-manifest.js +1 -1
  58. package/_standalone/.next/server/app/api/mcp/install-skill/route_client-reference-manifest.js +1 -1
  59. package/_standalone/.next/server/app/api/mcp/restart/route_client-reference-manifest.js +1 -1
  60. package/_standalone/.next/server/app/api/mcp/status/route_client-reference-manifest.js +1 -1
  61. package/_standalone/.next/server/app/api/mcp/uninstall/route_client-reference-manifest.js +1 -1
  62. package/_standalone/.next/server/app/api/monitoring/route_client-reference-manifest.js +1 -1
  63. package/_standalone/.next/server/app/api/recent-files/route_client-reference-manifest.js +1 -1
  64. package/_standalone/.next/server/app/api/restart/route_client-reference-manifest.js +1 -1
  65. package/_standalone/.next/server/app/api/search/route_client-reference-manifest.js +1 -1
  66. package/_standalone/.next/server/app/api/settings/list-models/route_client-reference-manifest.js +1 -1
  67. package/_standalone/.next/server/app/api/settings/reset-token/route_client-reference-manifest.js +1 -1
  68. package/_standalone/.next/server/app/api/settings/route_client-reference-manifest.js +1 -1
  69. package/_standalone/.next/server/app/api/settings/test-key/route_client-reference-manifest.js +1 -1
  70. package/_standalone/.next/server/app/api/setup/check-path/route_client-reference-manifest.js +1 -1
  71. package/_standalone/.next/server/app/api/setup/check-port/route_client-reference-manifest.js +1 -1
  72. package/_standalone/.next/server/app/api/setup/generate-token/route_client-reference-manifest.js +1 -1
  73. package/_standalone/.next/server/app/api/setup/ls/route_client-reference-manifest.js +1 -1
  74. package/_standalone/.next/server/app/api/setup/route_client-reference-manifest.js +1 -1
  75. package/_standalone/.next/server/app/api/skills/route_client-reference-manifest.js +1 -1
  76. package/_standalone/.next/server/app/api/sync/route_client-reference-manifest.js +1 -1
  77. package/_standalone/.next/server/app/api/tree-version/route_client-reference-manifest.js +1 -1
  78. package/_standalone/.next/server/app/api/uninstall/route_client-reference-manifest.js +1 -1
  79. package/_standalone/.next/server/app/api/update/route_client-reference-manifest.js +1 -1
  80. package/_standalone/.next/server/app/api/update-check/route_client-reference-manifest.js +1 -1
  81. package/_standalone/.next/server/app/api/update-status/route_client-reference-manifest.js +1 -1
  82. package/_standalone/.next/server/app/api/workflows/route_client-reference-manifest.js +1 -1
  83. package/_standalone/.next/server/app/changes/page.js +1 -1
  84. package/_standalone/.next/server/app/changes/page.js.nft.json +1 -1
  85. package/_standalone/.next/server/app/changes/page_client-reference-manifest.js +1 -1
  86. package/_standalone/.next/server/app/echo/[segment]/page.js +1 -1
  87. package/_standalone/.next/server/app/echo/[segment]/page.js.nft.json +1 -1
  88. package/_standalone/.next/server/app/echo/[segment]/page_client-reference-manifest.js +1 -1
  89. package/_standalone/.next/server/app/echo/page.js +1 -1
  90. package/_standalone/.next/server/app/echo/page.js.nft.json +1 -1
  91. package/_standalone/.next/server/app/echo/page_client-reference-manifest.js +1 -1
  92. package/_standalone/.next/server/app/explore/page.js +1 -1
  93. package/_standalone/.next/server/app/explore/page.js.nft.json +1 -1
  94. package/_standalone/.next/server/app/explore/page_client-reference-manifest.js +1 -1
  95. package/_standalone/.next/server/app/help/page.js +1 -1
  96. package/_standalone/.next/server/app/help/page.js.nft.json +1 -1
  97. package/_standalone/.next/server/app/help/page_client-reference-manifest.js +1 -1
  98. package/_standalone/.next/server/app/login/page.js +1 -1
  99. package/_standalone/.next/server/app/login/page.js.nft.json +1 -1
  100. package/_standalone/.next/server/app/login/page_client-reference-manifest.js +1 -1
  101. package/_standalone/.next/server/app/page.js +1 -1
  102. package/_standalone/.next/server/app/page.js.nft.json +1 -1
  103. package/_standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  104. package/_standalone/.next/server/app/setup/page.js +2 -2
  105. package/_standalone/.next/server/app/setup/page.js.nft.json +1 -1
  106. package/_standalone/.next/server/app/setup/page_client-reference-manifest.js +1 -1
  107. package/_standalone/.next/server/app/trash/page.js +2 -2
  108. package/_standalone/.next/server/app/trash/page_client-reference-manifest.js +1 -1
  109. package/_standalone/.next/server/app/view/[...path]/page.js +2 -2
  110. package/_standalone/.next/server/app/view/[...path]/page.js.nft.json +1 -1
  111. package/_standalone/.next/server/app/view/[...path]/page_client-reference-manifest.js +1 -1
  112. package/_standalone/.next/server/app-paths-manifest.json +23 -23
  113. package/_standalone/.next/server/chunks/4241.js +25 -25
  114. package/_standalone/.next/server/chunks/{6946.js → 9986.js} +2 -2
  115. package/_standalone/.next/server/pages/500.html +2 -2
  116. package/_standalone/.next/server/server-reference-manifest.js +1 -1
  117. package/_standalone/.next/server/server-reference-manifest.json +1 -1
  118. package/_standalone/.next/static/chunks/{1053-98e7148893702bd2.js → 1053-8cb7fd1bfbbbedd3.js} +2 -2
  119. package/_standalone/.next/static/chunks/app/agents/{page-eac6c5f6650dbf62.js → page-0d9920b591ce999f.js} +1 -1
  120. package/_standalone/.next/static/chunks/app/echo/[segment]/{page-addf014fcf23fad5.js → page-88df174dd64b2c76.js} +1 -1
  121. package/_standalone/.next/static/chunks/app/{layout-5cbdae4ee15fb842.js → layout-e49b880ef457bb2c.js} +27 -27
  122. package/_standalone/.next/static/chunks/app/page-b3a7338f30362edb.js +7 -0
  123. package/_standalone/.next/static/chunks/app/setup/page-81c37de31c9a5beb.js +1 -0
  124. package/_standalone/.next/static/chunks/app/trash/{page-4e18cc618035d072.js → page-c8bf8845e81cf112.js} +1 -1
  125. package/_standalone/.next/static/chunks/app/view/[...path]/page-409e1b9baa22c66a.js +12 -0
  126. package/_standalone/.next/trace +63 -63
  127. package/_standalone/components/ask/ProviderModelCapsule.tsx +3 -1
  128. package/_standalone/components/settings/SettingsContent.tsx +1 -0
  129. package/_standalone/components/setup/StepAgents.tsx +24 -3
  130. package/_standalone/components/setup/StepReview.tsx +55 -15
  131. package/_standalone/hooks/useAcpDetection.ts +6 -0
  132. package/_standalone/hooks/useSettingsAiAvailable.ts +17 -11
  133. package/_standalone/lib/i18n/modules/onboarding.ts +14 -0
  134. package/_standalone/tsconfig.tsbuildinfo +1 -1
  135. package/app/app/api/ask/route.ts +53 -7
  136. package/app/app/api/auth/route.ts +3 -0
  137. package/app/components/ask/ProviderModelCapsule.tsx +3 -1
  138. package/app/components/settings/SettingsContent.tsx +1 -0
  139. package/app/components/setup/StepAgents.tsx +24 -3
  140. package/app/components/setup/StepReview.tsx +55 -15
  141. package/app/components/setup/index.tsx +44 -2
  142. package/app/hooks/useAcpDetection.ts +6 -0
  143. package/app/hooks/useSettingsAiAvailable.ts +17 -11
  144. package/app/lib/i18n/modules/onboarding.ts +14 -0
  145. package/bin/commands/file.js +16 -1
  146. package/package.json +1 -1
  147. package/scripts/build-runtime-archive.sh +3 -0
  148. package/_standalone/.next/static/chunks/app/page-30cf129e870aa3b2.js +0 -7
  149. package/_standalone/.next/static/chunks/app/setup/page-abad6be1750aba3e.js +0 -1
  150. package/_standalone/.next/static/chunks/app/view/[...path]/page-26775356655fa712.js +0 -12
  151. /package/_standalone/.next/static/{5-9HMGiRDVPCrib2GFNC6 → v1Q015tiqW8z0rkxr-Kpt}/_buildManifest.js +0 -0
  152. /package/_standalone/.next/static/{5-9HMGiRDVPCrib2GFNC6 → v1Q015tiqW8z0rkxr-Kpt}/_ssgManifest.js +0 -0
@@ -0,0 +1,7 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8974],{3237:(e,t,s)=>{"use strict";s.d(t,{D:()=>n});var r=s(9339);let n=(0,r.createServerReference)("004277b0ddf905eaed45f61af2e364ff335151f197",r.callServer,void 0,r.findSourceMapURL,"scanExampleFilesAction")},4235:(e,t,s)=>{"use strict";s.d(t,{B1:()=>o,X8:()=>d,dV:()=>l,oR:()=>m});let r=[],n=[],a=0;function i(){for(let e of n)e()}function o(e){return n=[...n,e],()=>{n=n.filter(t=>t!==e)}}function l(){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})},6496:(e,t,s)=>{"use strict";s.d(t,{A:()=>h});var r=s(95155),n=s(12115),a=s(98500),i=s.n(a),o=s(93219),l=s(21628),d=s(12651),c=s(13545),m=s(66088),u=s(91337),x=s(91053),p=s(42833);function h(){let{t:e,locale:t}=(0,x.Y)(),[s,a]=(0,n.useState)([]),[h,f]=(0,n.useState)(!0),[g,b]=(0,n.useState)(!1);(0,n.useEffect)(()=>{let e=!1,t=()=>{fetch("/api/agent-activity?limit=20").then(e=>e.json()).then(t=>{e||a(t.events??[])}).catch(()=>{}).finally(()=>{e||f(!1)})};t();let s=()=>{"visible"===document.visibilityState&&t()};return document.addEventListener("visibilitychange",s),()=>{e=!0,document.removeEventListener("visibilitychange",s)}},[]);let v=(0,n.useMemo)(()=>{let e=s.filter(e=>{let t=(0,p.wT)(e.tool);return"write"===t||"create"===t||"delete"===t});return e.length>=3?e:s},[s]),j=g?v:v.slice(0,5),N=v.length-5;if(h)return(0,r.jsxs)("section",{className:"animate-pulse","aria-label":"Recent Activity",children:[(0,r.jsx)("div",{className:"h-4 w-36 bg-muted rounded mb-3"}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)("div",{className:"h-10 bg-muted/50 rounded-lg"}),(0,r.jsx)("div",{className:"h-10 bg-muted/50 rounded-lg"})]})]});if(0===s.length)return null;let y=e.agentsContent?.overview;return(0,r.jsxs)("section",{"aria-label":"Recent Activity",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)(o.A,{size:13})}),(0,r.jsx)("h2",{className:"text-sm font-semibold font-display text-foreground",children:y?.recentActivity??"Recent Activity"}),(0,r.jsx)("div",{className:"ml-auto",children:(0,r.jsxs)(i(),{href:"/agents?tab=activity",className:"flex items-center gap-1.5 text-xs font-medium text-[var(--amber)] hover:opacity-80 transition-colors font-display",children:[(0,r.jsx)(l.A,{size:12}),(0,r.jsx)("span",{children:y?.viewAll??"View all"})]})})]}),(0,r.jsx)("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:j.map((e,s)=>{let n=(0,p.wT)(e.tool),a=(0,p.oK)(e.params);return(0,r.jsxs)("div",{className:`flex items-center gap-3 px-3.5 py-2.5 ${s>0?"border-t border-border/30":""} hover:bg-muted/30 transition-colors`,children:[(0,r.jsx)(p.g,{kind:n,locale:t,size:"sm"}),a?(0,r.jsx)(i(),{href:`/view/${(0,u.O0)(a)}`,className:"text-xs text-[var(--amber)]/80 hover:text-[var(--amber)] truncate min-w-0 flex-1 font-display transition-colors",title:a,children:a}):(0,r.jsx)("span",{className:"flex-1"}),e.agentName&&(0,r.jsx)("span",{className:"text-[0.6rem] font-medium text-muted-foreground/70 bg-muted/60 px-1.5 py-0.5 rounded-full shrink-0 font-display",title:e.agentName,children:e.agentName.length>20?e.agentName.slice(0,20)+"...":e.agentName}),"ok"===e.result?(0,r.jsx)(d.A,{size:11,className:"shrink-0 text-[var(--success)]/60"}):(0,r.jsx)(c.A,{size:11,className:"shrink-0 text-[var(--error)]/60"}),(0,r.jsx)("span",{className:"text-2xs text-muted-foreground/40 tabular-nums shrink-0 font-display",title:e.ts,children:(0,p.MZ)(e.ts)})]},e.id??s)})}),N>0&&(0,r.jsxs)("button",{onClick:()=>b(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)(m.A,{size:12,className:`transition-transform duration-200 ${g?"rotate-180":""}`}),(0,r.jsx)("span",{children:g?y?.showLess??"Show less":`${N} more`})]})]})}},7701:(e,t,s)=>{"use strict";s.d(t,{E:()=>n});var r=s(9339);let n=(0,r.createServerReference)("0081d0e6107ae00e6ac205a4fabb54b6f48fbfa8e7",r.callServer,void 0,r.findSourceMapURL,"cleanupExamplesAction")},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})},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 o(){return c}let l=[];function d(){return l}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,o,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,46515))},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:o=3e4,signal:l,...d}=t;if((o>0||l)&&(s=new AbortController),o>0&&s&&(a=setTimeout(()=>{s.abort(Error(`Request timed out after ${Math.round(o/1e3)}s`))},o)),l&&s)if(l.aborted)s.abort();else{let e=()=>s?.abort();l.addEventListener("abort",e,{once:!0}),i=()=>{l.removeEventListener("abort",e)}}let c=s?.signal??l;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 o(e){return a.add(e),()=>{a.delete(e)}}function l(){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)(o,l,l);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()),[])}}},29494:(e,t,s)=>{"use strict";s.d(t,{Q:()=>n});var r=s(4235);async function n(e,t){let s=[],n=0;for(let t of e){if(t.size>0xa00000){n++;continue}try{if(t.name.toLowerCase().endsWith(".pdf")){let e=await t.arrayBuffer();s.push({name:t.name,content:function(e){let t=new Uint8Array(e),s=[];for(let e=0;e<t.length;e+=8192)s.push(String.fromCharCode(...t.subarray(e,e+8192)));return btoa(s.join(""))}(e),encoding:"base64"})}else{let e=await t.text();s.push({name:t.name,content:e})}}catch{}}if(0===s.length)return void(n>0?r.oR.error(t.inbox.tooLarge(n),4e3):e.length>0&&r.oR.error(t.inbox.saveFailed,4e3));try{var a;let e=await fetch("/api/inbox",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({files:s})});if(!e.ok){let s=await e.json().catch(()=>({}));console.error("[QuickDrop] Save failed:",s.error),r.oR.error(t.inbox.saveFailed,4e3);return}let i=await e.json(),o=i.saved?.length??0,l=i.skipped?.length??0;a=n,o>0&&a>0&&0===l?r.oR.success(t.inbox.savedWithOversized(o,a),4e3):o>0&&l+a>0?r.oR.success(t.inbox.savedWithSkipped(o,l+a),4e3):o>0?r.oR.success(t.inbox.savedToast(o),3e3):(a>0&&r.oR.error(t.inbox.tooLarge(a),4e3),l>0&&r.oR.error(t.inbox.savedWithSkipped(0,l),4e3),0===a&&0===l&&r.oR.error(t.inbox.saveFailed,4e3)),window.dispatchEvent(new Event("mindos:files-changed")),window.dispatchEvent(new Event("mindos:inbox-updated"))}catch(e){console.error("[QuickDrop] Network error:",e),r.oR.error(t.inbox.saveFailed,4e3)}}},42833:(e,t,s)=>{"use strict";s.d(t,{$2:()=>p,CF:()=>m,MZ:()=>h,g:()=>g,hf:()=>x,oK:()=>f,wT:()=>c,zR:()=>u});var r=s(95155),n=s(84980),a=s(3926),i=s(93631),o=s(68459),l=s(61878),d=s(10762);function c(e){return/search/.test(e)?"search":/read|list|get/.test(e)?"read":/create/.test(e)?"create":/delete/.test(e)?"delete":/write|update|insert|append/.test(e)?"write":"other"}let m={en:{read:"Read",write:"Write",create:"Create",delete:"Delete",search:"Search",other:"Other"},zh:{read:"读取",write:"写入",create:"创建",delete:"删除",search:"搜索",other:"其他"}},u={read:{bg:"rgba(138,180,216,0.10)",text:"#8ab4d8",border:"rgba(138,180,216,0.25)"},write:{bg:"rgba(200,135,58,0.10)",text:"var(--amber)",border:"rgba(200,135,58,0.25)"},create:{bg:"rgba(122,173,128,0.10)",text:"var(--success)",border:"rgba(122,173,128,0.25)"},delete:{bg:"rgba(200,80,80,0.10)",text:"var(--error)",border:"rgba(200,80,80,0.25)"},search:{bg:"rgba(200,160,216,0.10)",text:"#c8a0d8",border:"rgba(200,160,216,0.25)"},other:{bg:"var(--muted)",text:"var(--muted-foreground)",border:"var(--border)"}};function x({kind:e,size:t=13}){return"read"===e?(0,r.jsx)(n.A,{size:t}):"write"===e?(0,r.jsx)(a.A,{size:t}):"create"===e?(0,r.jsx)(i.A,{size:t}):"delete"===e?(0,r.jsx)(o.A,{size:t}):"search"===e?(0,r.jsx)(l.A,{size:t}):(0,r.jsx)(d.A,{size:t})}function p(e){try{return new Date(e).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"})}catch{return e}}function h(e){let t=Date.now()-new Date(e).getTime(),s=Math.floor(t/6e4),r=Math.floor(t/36e5),n=Math.floor(t/864e5);return s<1?"<1m":s<60?`${s}m`:r<24?`${r}h`:`${n}d`}function f(e){return"string"==typeof e.path?e.path:null}function g({kind:e,locale:t,size:s="md"}){let n=u[e],a=m[t?.startsWith("zh")?"zh":"en"][e];return(0,r.jsxs)("span",{className:"font-display",style:{display:"inline-flex",alignItems:"center",gap:3,padding:"sm"===s?"1px 6px":"2px 8px",borderRadius:999,fontSize:"sm"===s?"0.6rem":"0.68rem",fontWeight:600,background:n.bg,color:n.text,border:`1px solid ${n.border}`,flexShrink:0,whiteSpace:"nowrap"},children:[(0,r.jsx)(x,{kind:e,size:"sm"===s?9:10}),a]})}},46515:(e,t,s)=>{"use strict";s.d(t,{default:()=>eo});var r=s(95155),n=s(98500),a=s.n(n),i=s(66088),o=s(33078),l=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(91053),A=s(91337),z=s(10377),C=s(73321),E=s(92451),S=s(97810),T=s(13545),L=s(31025);let M=[{id:"en",icon:(0,r.jsx)(E.A,{size:20}),dirs:["Profile/","Connections/","Notes/","Workflows/","Resources/","Projects/"]},{id:"zh",icon:(0,r.jsx)(S.A,{size:20}),dirs:["画像/","关系/","笔记/","流程/","资源/","项目/"]},{id:"empty",icon:(0,r.jsx)(l.A,{size:20}),dirs:["README.md","CONFIG.json","INSTRUCTION.md"]}];function $(){let{t:e}=(0,k.Y)(),t=(0,C.useRouter)(),[s,n]=(0,w.useState)(null),[a,i]=(0,w.useState)(null),o=e.onboarding;async function l(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:o.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:o.initError??"Initialization failed. Please try again."}),(0,r.jsx)("button",{onClick:()=>i(null),className:"text-xs underline shrink-0 hover:opacity-80",children:o.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:()=>l(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:o.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:o.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:o.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:[o.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"})," ",o.syncHintSuffix??"in the terminal after setup."]})})]})]})}var R=s(21362),D=s(21975),O=s(92564),W=s(22164),P=s(67635),I=s(7834),H=s(4235),F=s(27318),K=s(76449);function U(){let{t:e}=(0,k.Y)(),t=e.guide,[s,n]=(0,w.useState)(null),[i,o]=(0,w.useState)(null),[l,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}),o(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,I.l)(t.agent.copyPrompt)&&H.oR.copy()},[t]),N=(0,w.useCallback)(()=>{u(!0),o(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)(()=>{l&&s&&!s.step1Done&&o("import")},[l,s]);let A=(0,w.useRef)({s1:!1,s2:!1});(0,w.useEffect)(()=>{if(!s)return;let e=A.current;s.step1Done&&!e.s1&&(o("ai"),e.s1=!0),s.askedAI&&!e.s2&&(o("agent"),e.s2=!0)},[s?.step1Done,s?.askedAI,s]);let z=s?.step1Done??!1,C=s?.askedAI??!1,E=s?.nextStepIndex??0,S=z&&C&&m,T=S&&E>=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=z&&C&&!m;if(S&&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(S){let e=t.done.steps[E];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)(R.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)(_,{icon:(0,r.jsx)(D.A,{size:16}),title:t.import.title,cta:t.import.cta,done:z,active:"import"===i,onClick:()=>z?null:o("import"===i?null:"import")}),(0,r.jsx)(_,{icon:(0,r.jsx)(O.A,{size:16}),title:t.ai.title,cta:t.ai.cta,done:C,active:"ai"===i,dimmed:!z,onClick:()=>{!C&&z&&o("ai"===i?null:"ai")}}),(0,r.jsx)(_,{icon:(0,r.jsx)(W.A,{size:16}),title:t.agent.title,cta:t.agent.cta,done:m,active:"agent"===i,dimmed:!z||!C,onClick:()=>{z&&C&&o("agent"===i?null:"agent")}})]}),"import"===i&&!z&&(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&&z&&!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.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)(P.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 _({icon:e,title:t,cta:s,done:n,active:a,dimmed:i,onClick:o}){return(0,r.jsxs)("button",{onClick:o,disabled:n||i,className:`
2
+ flex flex-col items-center gap-1.5 px-3 py-3 rounded-lg border text-center
3
+ transition-all duration-150
4
+ ${n?"opacity-60":i?"opacity-40 cursor-default":"hover:border-[var(--amber)]/30 hover:bg-muted/50 cursor-pointer"}
5
+ ${a?"border-[var(--amber)]/40 bg-muted/50":""}
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(70617);let B="mindos:pulse-collapsed";function Q(){let e=(0,J.cd)(),{t}=(0,k.Y)(),s=t.pulse,[n,o]=(0,w.useState)(!1),[l,d]=(0,w.useState)(!1);(0,w.useEffect)(()=>{let e=localStorage.getItem(B);null!==e&&o("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;o(e),localStorage.setItem(B,e?"1":"0")};if(!e||e.loading)return(0,r.jsxs)("section",{className:"mb-8 animate-pulse",children:[(0,r.jsx)("div",{className:"h-4 w-32 bg-muted rounded mb-3"}),(0,r.jsx)("div",{className:"h-16 bg-muted/50 rounded-xl"})]});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=l?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,i=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)(a(),{href:`/agents/${encodeURIComponent(e.key)}`,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 hover:bg-muted/30 cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",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,i?` \xb7 ${i}`:""]})]})]},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 ${l?"rotate-180":""}`}),(0,r.jsx)("span",{children:l?s.showLess:s.showMore(b)})]})]})}var Z=s(15282),G=s(29494);function X({isOrganizing:e=!1}){let{t}=(0,k.Y)(),[s,n]=(0,w.useState)([]),[a,i]=(0,w.useState)(!0),[o,l]=(0,w.useState)(!1),[c,m]=(0,w.useState)(!1),u=(0,w.useRef)(null),x=e||c,p=(0,w.useCallback)(()=>{0===s.length||x||(m(!0),window.dispatchEvent(new CustomEvent("mindos:inbox-organize",{detail:{files:s}})))},[s,x]),h=(0,w.useCallback)(e=>{e&&0!==e.length&&((0,G.Q)(Array.from(e),t),u.current&&(u.current.value=""))},[t]),f=(0,w.useCallback)(async()=>{try{let e=await fetch("/api/inbox");if(!e.ok)return;let t=await e.json();Array.isArray(t.files)&&n(t.files)}catch(e){console.warn("[InboxSection] Failed to fetch inbox:",e)}finally{i(!1)}},[]),g=(0,w.useRef)(void 0),b=(0,w.useCallback)(()=>{clearTimeout(g.current),g.current=setTimeout(f,80)},[f]);(0,w.useEffect)(()=>{f();let e=()=>{m(!1),b()};return window.addEventListener("mindos:files-changed",b),window.addEventListener("mindos:inbox-updated",b),window.addEventListener("mindos:organize-done",e),()=>{clearTimeout(g.current),window.removeEventListener("mindos:files-changed",b),window.removeEventListener("mindos:inbox-updated",b),window.removeEventListener("mindos:organize-done",e)}},[f,b]);let v=(0,w.useMemo)(()=>o?s:s.slice(0,5),[s,o]),j=s.length-5;return a?(0,r.jsxs)("section",{className:"mb-10 animate-pulse",children:[(0,r.jsx)("div",{className:"h-4 w-24 bg-muted rounded mb-3"}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)("div",{className:"h-10 bg-muted/50 rounded-lg"}),(0,r.jsx)("div",{className:"h-10 bg-muted/50 rounded-lg"})]})]}):(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)(Z.A,{size:13})}),(0,r.jsx)("h2",{className:"text-sm font-semibold font-display text-foreground",children:t.inbox.title}),s.length>0&&(0,r.jsx)("span",{className:"inline-flex items-center justify-center min-w-[18px] h-[18px] px-1 text-2xs font-semibold rounded-full bg-[var(--amber)]/15 text-[var(--amber)] tabular-nums font-display",children:t.inbox.count(s.length)}),s.length>0&&(0,r.jsxs)("div",{className:"ml-auto flex items-center gap-3",children:[(0,r.jsx)("button",{type:"button",onClick:()=>u.current?.click(),className:"flex items-center gap-1.5 text-xs font-medium text-muted-foreground transition-colors hover:text-foreground cursor-pointer font-display",title:t.inbox.uploadButton,children:(0,r.jsx)(D.A,{size:12})}),(0,r.jsxs)("button",{onClick:p,disabled:x,className:"flex items-center gap-1.5 text-xs font-medium text-[var(--amber)] transition-colors hover:opacity-80 cursor-pointer font-display disabled:opacity-50 disabled:cursor-not-allowed",title:x?t.inbox.organizing:void 0,children:[x?(0,r.jsx)(N.A,{size:12,className:"animate-spin"}):(0,r.jsx)(d.A,{size:12}),(0,r.jsx)("span",{children:x?t.inbox.organizing:t.inbox.organizeButton})]})]})]}),(0,r.jsx)("input",{ref:u,type:"file",multiple:!0,accept:".md,.txt,.csv,.json,.pdf",className:"hidden",onChange:e=>h(e.target.files)}),0===s.length?(0,r.jsxs)("div",{className:"rounded-xl border-2 border-dashed border-border px-4 py-8 text-center",children:[(0,r.jsx)(Z.A,{size:24,className:"mx-auto mb-2 text-muted-foreground/30"}),(0,r.jsx)("p",{className:"text-sm text-muted-foreground/70 font-display",children:t.inbox.emptyTitle}),(0,r.jsx)("p",{className:"text-xs text-muted-foreground/40 mt-1",children:t.inbox.emptyDesc}),(0,r.jsxs)("button",{type:"button",onClick:()=>u.current?.click(),className:"mt-3 inline-flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium rounded-lg transition-colors bg-muted text-muted-foreground hover:text-foreground hover:bg-muted/80",children:[(0,r.jsx)(D.A,{size:12}),t.inbox.uploadButton]})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"flex flex-col gap-0.5",children:v.map(e=>(0,r.jsx)(q,{file:e},e.path))}),j>0&&(0,r.jsxs)("button",{onClick:()=>l(e=>!e),className:"flex items-center gap-1 mt-2 text-xs text-muted-foreground hover:text-foreground transition-colors cursor-pointer font-display",children:[(0,r.jsx)(R.A,{size:12,className:`transition-transform duration-150 ${o?"rotate-90":""}`}),o?t.home.showLess:t.inbox.more(j)]})]})]})}function q({file:e}){let{t}=(0,k.Y)(),s=e.name.endsWith(".csv"),n=function(e,t){let s=Math.floor((Date.now()-new Date(e).getTime())/6e4);if(s<1)return t.justNow;if(s<60)return t.minutesAgo(s);let r=Math.floor(s/60);if(r<24)return t.hoursAgo(r);let n=Math.floor(r/24);return t.daysAgo(n)}(e.modifiedAt,t.home.relativeTime);return(0,r.jsxs)(a(),{href:`/view/${(0,A.O0)(e.path)}`,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:[(0,r.jsx)("span",{className:`w-1.5 h-1.5 rounded-full shrink-0 ${e.isAging?"bg-[var(--amber)]/60":"bg-[var(--amber)]"}`}),s?(0,r.jsx)(o.A,{size:12,className:"shrink-0 text-success"}):(0,r.jsx)(l.A,{size:12,className:"shrink-0 text-muted-foreground"}),(0,r.jsx)("span",{className:"text-sm truncate flex-1 text-foreground",title:e.name,suppressHydrationWarning:!0,children:e.name}),(0,r.jsx)("span",{className:"text-2xs text-muted-foreground/50 tabular-nums shrink-0 font-display",children:n}),e.isAging&&(0,r.jsx)("span",{title:"7+ days",children:(0,r.jsx)(T.A,{size:11,className:"shrink-0 text-[var(--amber)]/60"})})]})}var V=s(3237),ee=s(7701),et=s(6496);function es(){window.dispatchEvent(new KeyboardEvent("keydown",{key:"k",metaKey:!0,bubbles:!0}))}function er(){window.dispatchEvent(new KeyboardEvent("keydown",{key:"/",metaKey:!0,bubbles:!0}))}function en({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 ea({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 ei({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)(o.A,{size:12,className:"shrink-0 text-success"}):(0,r.jsx)(l.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)},4e3);return()=>clearInterval(e)},[y.length]);let z=s??[],{groups:C,rootFiles:E}=(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 o=s.get(a);o.files.push(n),o.latestMtime=Math.max(o.latestMtime,n.mtime)}return{groups:[...s.values()].sort((e,t)=>t.latestMtime-e.latestMtime),rootFiles:r}})(e,z),[e,z]);if(0===e.length)return(0,r.jsx)($,{});let S=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)(U,{}),(0,r.jsx)(ec,{}),(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:er,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)("div",{className:"flex-1 min-h-[1.5rem] flex items-center",children:(0,r.jsx)("span",{className:"text-sm text-left text-muted-foreground animate-in fade-in duration-300",children:y[j]},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:es,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)(Q,{}),(0,r.jsx)("div",{className:"mb-10",children:(0,r.jsx)(et.A,{})}),(0,r.jsx)(X,{}),(z.length,(0,r.jsxs)("section",{className:"mb-10",children:[(0,r.jsx)(en,{icon:(0,r.jsx)(x.A,{size:13}),count:z.length>0?z.length:void 0,action:(0,r.jsx)(ed,{t:n}),children:n.home.spaces}),z.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?z:z.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)})}),z.length>6&&(0,r.jsx)(ea,{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."})]})),(0,r.jsx)(el,{formatTime:S}),e.length>0&&(0,r.jsxs)("section",{className:"mb-10",children:[(0,r.jsx)(en,{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}),C.length>0?(0,r.jsxs)("div",{className:"flex flex-col gap-3",children:[C.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 ",S(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)(ei,{filePath:e,mtime:t,formatTime:S,subPath:e.split("/").slice(1,-1).join("/")},e))})]},e.space)}),E.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)(l.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:E.map(({path:e,mtime:t})=>(0,r.jsx)(ei,{filePath:e,mtime:t,formatTime:S},e))})]}),C.some(e=>e.files.length>3)&&(0,r.jsx)(ea,{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)(o.A,{size:12,className:"shrink-0 text-success"}):(0,r.jsx)(l.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:S(t)})]})]},e)})}),e.length>5&&(0,r.jsx)(ea,{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 el({formatTime:e}){let{t}=(0,k.Y)(),{pinnedFiles:s,removePin:n}=(0,z.Z)();return 0===s.length?null:(0,r.jsxs)("section",{className:"mb-12",children:[(0,r.jsx)(en,{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)(o.A,{size:12,className:"shrink-0 text-success"}):(0,r.jsx)(l.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 ed({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 ec(){let{t:e}=(0,k.Y)(),[t,s]=(0,w.useState)(null),[n,a]=(0,w.useState)(!1),[i,o]=(0,w.useState)(!1),[l,d]=(0,w.useState)(!1);(0,w.useEffect)(()=>{(0,V.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,ee.E)()).success&&(o(!0),setTimeout(()=>d(!0),2500))}catch{}a(!1)}},[t]);return l||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})})]})}},70617:(e,t,s)=>{"use strict";s.d(t,{cd:()=>d,kr:()=>l,zd:()=>o});var r=s(1934),n=s(22356);let a=null;async function i(e){a?.abort();let t=new AbortController;a=t;try{let[s,r,a]=await Promise.all([(0,n.n)("/api/mcp/status",{signal:t.signal}),(0,n.n)("/api/mcp/agents",{signal:t.signal}),(0,n.n)("/api/skills",{signal:t.signal})]);t.signal.aborted||e({status:s,agents:r.agents,skills:a.skills})}catch(e){if(e instanceof DOMException&&"AbortError"===e.name)return}finally{t.signal.aborted||e({loading:!1})}}let o=(0,r.v)((e,t)=>({status:null,agents:[],skills:[],loading:!0,refresh:()=>i(e),toggleSkill:async(s,r)=>{e({skills:t().skills.map(e=>e.name===s?{...e,enabled:r}:e)});try{return await (0,n.n)("/api/skills",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"toggle",name:s,enabled:r})}),!0}catch{return e({skills:t().skills.map(e=>e.name===s?{...e,enabled:!r}:e)}),!1}},installAgent:async(s,r)=>{let a=t().agents.find(e=>e.key===s);if(!a)return!1;try{let t=await (0,n.n)("/api/mcp/install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({agents:[{key:s,scope:r?.scope??(a.hasProjectScope?"project":"global"),transport:r?.transport??a.preferredTransport}],transport:"auto"})}),o=t.results?.[0],l=o?.ok===!0||o?.status==="ok";return l&&await i(e),l}catch{return!1}},_init:()=>{let t;i(e);let s=()=>{clearTimeout(t),t=setTimeout(()=>i(e),500)};window.addEventListener("mindos:skills-changed",s);let r=setInterval(()=>{"visible"===document.visibilityState&&i(e)},3e4);return()=>{a?.abort(),clearTimeout(t),clearInterval(r),window.removeEventListener("mindos:skills-changed",s)}}}));function l(){return o()}function d(){return o()}},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"}]},91337:(e,t,s)=>{"use strict";s.d(t,{IX:()=>l,KW:()=>o,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 o(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 l(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,[6926,9602,3160,1053,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],{439:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(90425).A)("shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]])},1934:(e,t,r)=>{"use strict";r.d(t,{v:()=>n});var s=r(12115);let a=e=>{let t,r=new Set,s=(e,s)=>{let a="function"==typeof e?e(t):e;if(!Object.is(a,t)){let e=t;t=(null!=s?s:"object"!=typeof a||null===a)?a:Object.assign({},t,a),r.forEach(r=>r(t,e))}},a=()=>t,o={setState:s,getState:a,getInitialState:()=>n,subscribe:e=>(r.add(e),()=>r.delete(e))},n=t=e(s,a,o);return o},o=e=>{let t=e?a(e):a,r=e=>(function(e,t=e=>e){let r=s.useSyncExternalStore(e.subscribe,s.useCallback(()=>t(e.getState()),[e,t]),s.useCallback(()=>t(e.getInitialState()),[e,t]));return s.useDebugValue(r),r})(t,e);return Object.assign(r,t),r},n=e=>e?o(e):o},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})},10762:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(90425).A)("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]])},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:()=>p,Bt:()=>c,D0:()=>l,L7:()=>x,jn:()=>m,l6:()=>d,lM:()=>u,pM:()=>h,pd:()=>i});var s=r(95155),a=r(12115),o=r(66088),n=r(94514);function l({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 i({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 d({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]),f=g.findIndex(t=>t.value===e),b=g[f]?.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(f>=0?f: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,f,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(f>=0?f: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 ${b?"":"text-muted-foreground"}`,children:b||"—"}),(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 c({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 u({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 p({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 m({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 x({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 h({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"}]])},22164:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(90425).A)("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]])},22952:(e,t,r)=>{"use strict";r.d(t,{default:()=>q});var s=r(95155),a=r(12115),o=r(86901),n=r(41641),l=r(21362),i=r(6296),d=r(91053),c=r(7834),u=r(4235),p=r(47376),m=r(92451),x=r(97810),h=r(48368);let g=[{id:"en",icon:(0,s.jsx)(m.A,{size:18}),dirs:["Profile/","Connections/","Notes/","Workflows/","Resources/","Projects/"]},{id:"zh",icon:(0,s.jsx)(x.A,{size:18}),dirs:["画像/","关系/","笔记/","流程/","资源/","项目/"]},{id:"empty",icon:(0,s.jsx)(h.A,{size:18}),dirs:["README.md","CONFIG.json","INSTRUCTION.md"]}];var f=r(13545),b=r(20171);function v({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)([]),[h,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=>{h&&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)"}}),h&&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:g.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)(f.A,{size:11})," ",n.webPasswordRequired]})]})})]})}var y=r(22164),k=r(66088),j=r(67635),N=r(51842),w=r(41585),A=r(12651),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)(w.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)(A.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)(w.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:c,setMcpPortStatus:u,checkPort:m,portConflict:x}){let{locale:h}=(0,d.Y)(),[g,f]=(0,a.useState)(!1);(0,a.useEffect)(()=>{!g&&x&&f(!0)},[x,g]);let v="skip"!==e.provider&&(0,p.rl)(e.provider)?e.provider:null,w=v?p.T_[v]:null,A=v?e.providerConfigs[v]??{apiKey:"",model:w?.defaultModel??""}:null,S=r=>{if(!v)return;let s=e.providerConfigs[v]??{apiKey:"",model:w?.defaultModel??""};t("providerConfigs",{...e.providerConfigs,[v]:{...s,...r}})},C=new Set(Object.entries(e.providerConfigs).filter(([e,t])=>t&&(t.apiKey||t.apiKeyMask)||p.T_[e]?.apiKeyFallback).map(([e])=>e));return(0,s.jsxs)("div",{className:"space-y-5",children:[(0,s.jsx)(N.A,{value:e.provider,onChange:e=>t("provider",e),showSkip:!0,compact:!0,configuredProviders:C}),v&&w&&A&&(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:A.apiKey,onChange:e=>S({apiKey:e}),placeholder:A.apiKeyMask||`${(0,p.Ux)(v)??"API Key"}...`}),A.apiKeyMask&&!A.apiKey&&(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."}),w.signupUrl&&!A.apiKey&&!A.apiKeyMask&&(0,s.jsxs)("a",{href:w.signupUrl,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-xs mt-1.5 hover:underline",style:{color:"var(--amber)"},children:[(0,s.jsx)(y.A,{size:10}),w.apiKeyFallback?"zh"===h?`下载 ${w.nameZh}`:`Download ${w.name}`:"zh"===h?`获取 ${w.nameZh} API Key`:`Get ${w.name} API Key`]})]}),w.supportsBaseUrl&&(0,s.jsx)(b.D0,{label:r.baseUrl,hint:r.baseUrlHint,children:(0,s.jsx)(b.pd,{value:A.baseUrl??"",onChange:e=>S({baseUrl:e.target.value}),placeholder:w.fixedBaseUrl||(0,p.Ot)(v)||"https://api.openai.com/v1"})}),(0,s.jsx)(b.D0,{label:r.model,children:(0,s.jsx)(b.pd,{value:A.model,onChange:e=>S({model:e.target.value}),placeholder:w.defaultModel})})]}),(0,s.jsxs)("div",{className:"pt-3 mt-1",style:{borderTop:"1px solid var(--border)"},children:[(0,s.jsxs)("button",{type:"button",onClick:()=>f(!g),className:"flex items-center gap-1.5 text-xs font-medium",style:{color:"var(--muted-foreground)"},children:[g?(0,s.jsx)(k.A,{size:12}):(0,s.jsx)(l.A,{size:12}),r.advancedPorts]}),g&&(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)(j.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:c,setMcpPortStatus:u,checkPort:m,portConflict:x,s:r})]})]})]})}var M=r(62791),z=r(10762),E=r(68806),O=r(90718);let I={"claude-code":"https://docs.anthropic.com/en/docs/claude-code/overview",cursor:"https://www.cursor.com/",windsurf:"https://codeium.com/windsurf",cline:"https://github.com/cline/cline",trae:"https://www.trae.ai/","gemini-cli":"https://github.com/google-gemini/gemini-cli",augment:"https://www.augmentcode.com/"};function U({agents:e,agentsLoading:t,selectedAgents:r,setSelectedAgents:o,connectionMode:n,setConnectionMode:l,agentTransport:d,setAgentTransport:c,agentScope:u,setAgentScope:p,agentStatuses:m,s:x,settingsMcp:h}){let[g,f]=(0,a.useState)(!1),[v,y]=(0,a.useState)(!1),{detected:j,other:N}=(0,a.useMemo)(()=>({detected:e.filter(e=>e.installed||e.present),other:e.filter(e=>!e.installed&&!e.present)}),[e]),w=(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:m[e.key]?.state==="installing"}),(0,s.jsx)("span",{className:"text-sm flex-1",style:{color:"var(--foreground)"},children:e.name}),n.mcp&&(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"===d?e.preferredTransport:d}),((e,t)=>{let r=m[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"})," ",x.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)(A.A,{size:10})," ",x.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)(M.A,{size:10})," ",x.agentStatusError,r.message&&(0,s.jsxs)("span",{className:"ml-1 text-2xs",children:["(",r.message,")"]})]})}if(t.installed)return(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:h.installed});if(t.present)return(0,s.jsx)("span",{className:"text-xs px-1.5 py-0.5 rounded",style:{background:"var(--amber-dim)",color:"var(--amber)"},children:x.agentDetected});let a=I[e];return(0,s.jsxs)("span",{className:"flex items-center gap-1.5",children:[(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:x.agentNotFound}),a&&(0,s.jsx)("a",{href:a,target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),className:"text-2xs hover:underline",style:{color:"var(--amber)"},children:x.agentGetIt})]})})(e.key,e)]},e.key);return(0,s.jsxs)("div",{className:"space-y-5",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("p",{className:"text-xs font-medium",style:{color:"var(--muted-foreground)"},children:x.connectionModeTitle}),(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,s.jsxs)("label",{className:"flex items-start gap-3 px-4 py-3 rounded-xl border cursor-pointer transition-all",style:{borderColor:n.cli?"var(--amber)":"var(--border)",background:n.cli?"color-mix(in srgb, var(--amber) 6%, transparent)":"transparent"},children:[(0,s.jsx)("input",{type:"checkbox",checked:n.cli,onChange:()=>l(e=>({...e,cli:!e.cli})),className:"form-check mt-0.5"}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsxs)("div",{className:"flex items-center gap-1.5 text-sm font-medium",style:{color:"var(--foreground)"},children:[(0,s.jsx)(z.A,{size:13,className:"shrink-0"})," CLI"]}),(0,s.jsx)("p",{className:"text-2xs mt-0.5",style:{color:"var(--muted-foreground)"},children:x.connectionModeCliHint})]})]}),(0,s.jsxs)("label",{className:"flex items-start gap-3 px-4 py-3 rounded-xl border cursor-pointer transition-all",style:{borderColor:n.mcp?"var(--amber)":"var(--border)",background:n.mcp?"color-mix(in srgb, var(--amber) 6%, transparent)":"transparent"},children:[(0,s.jsx)("input",{type:"checkbox",checked:n.mcp,onChange:()=>l(e=>({...e,mcp:!e.mcp})),className:"form-check mt-0.5"}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsxs)("div",{className:"flex items-center gap-1.5 text-sm font-medium",style:{color:"var(--foreground)"},children:[(0,s.jsx)(E.A,{size:13,className:"shrink-0"})," MCP"]}),(0,s.jsx)("p",{className:"text-2xs mt-0.5",style:{color:"var(--muted-foreground)"},children:x.connectionModeMcpHint})]})]})]})]}),n.cli||n.mcp?(0,s.jsx)("p",{className:"text-sm",style:{color:"var(--muted-foreground)"},children:!n.mcp&&n.cli?x.agentToolsHintCliOnly:x.agentToolsHint}):(0,s.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2.5 rounded-lg text-xs",style:{background:"color-mix(in srgb, var(--amber) 8%, transparent)",color:"var(--amber)"},children:[(0,s.jsx)(O.A,{size:13,className:"shrink-0"}),(0,s.jsx)("span",{children:x.agentToolsHintNone})]}),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:x.agentToolsLoading})]}):0===e.length?(0,s.jsx)("p",{className:"text-sm py-4 text-center",style:{color:"var(--muted-foreground)"},children:x.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)"}}),x.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)"}}),x.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)"}}),x.badgeNotFound]})]}),j.length>0?(0,s.jsx)("div",{className:"rounded-xl border overflow-hidden",style:{borderColor:"var(--border)"},children:j.map((e,t)=>w(e,t))}):(0,s.jsx)("p",{className:"text-xs py-2",style:{color:"var(--muted-foreground)"},children:x.agentNoneDetected}),N.length>0&&(0,s.jsxs)("div",{children:[(0,s.jsxs)("button",{type:"button",onClick:()=>f(!g),"aria-expanded":g,className:"flex items-center gap-1.5 text-xs py-1.5 transition-colors",style:{color:"var(--muted-foreground)"},children:[(0,s.jsx)(k.A,{size:12,className:`transition-transform ${g?"rotate-180":""}`}),x.agentShowMore(N.length)]}),g&&(0,s.jsx)("div",{className:"rounded-xl border overflow-hidden mt-1",style:{borderColor:"var(--border)"},children:N.map((e,t)=>w(e,t))})]}),n.mcp&&0===r.size&&(0,s.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2.5 rounded-lg text-xs",style:{background:"color-mix(in srgb, var(--amber) 8%, transparent)",color:"var(--amber)"},children:[(0,s.jsx)(O.A,{size:13,className:"shrink-0"}),(0,s.jsx)("span",{children:x.agentNoneSelected})]}),n.mcp&&(0,s.jsxs)("div",{children:[(0,s.jsxs)("button",{type:"button",onClick:()=>y(!v),"aria-expanded":v,className:"flex items-center gap-1.5 text-xs py-1.5 transition-colors",style:{color:"var(--muted-foreground)"},children:[(0,s.jsx)(k.A,{size:12,className:`transition-transform ${v?"rotate-180":""}`}),x.agentAdvanced]}),v&&(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-4 mt-2",children:[(0,s.jsx)(b.D0,{label:x.agentTransport,children:(0,s.jsxs)(b.l6,{value:d,onChange:e=>c(e.target.value),children:[(0,s.jsx)("option",{value:"auto",children:x.agentTransportAuto}),(0,s.jsx)("option",{value:"stdio",children:h.transportStdio}),(0,s.jsx)("option",{value:"http",children:h.transportHttp})]})}),(0,s.jsx)(b.D0,{label:x.agentScope,children:(0,s.jsxs)(b.l6,{value:u,onChange:e=>p(e.target.value),children:[(0,s.jsx)("option",{value:"global",children:x.agentScopeGlobal}),(0,s.jsx)("option",{value:"project",children:x.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:x.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:x.agentSkipLater})]})]})]})}var R=r(42129),$=r(439),K=r(94514);function _({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)(w.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 D({s:e,newPort:t,webPassword:r}){let[o,n]=(0,a.useState)(!1),[l,d]=(0,a.useState)(!1),c=(0,a.useRef)(void 0),u=(0,a.useRef)(void 0);(0,a.useEffect)(()=>()=>{clearTimeout(u.current),clearInterval(c.current)},[]);let p=async()=>{n(!0);try{let e=await fetch("/api/restart",{method:"POST"});if(!e.ok)throw Error(`restart failed (${e.status})`);d(!0);let s=window.location.hostname||"localhost",a=s.includes(":")?`[${s}]`:s,o=`http://${a}:${t}`,n=()=>{window.location.href=`${o}/?welcome=1`},l=0;clearInterval(c.current),u.current=setTimeout(()=>{c.current=setInterval(async()=>{l++;try{if((await fetch(`${o}/api/health`)).status<500){if(clearInterval(c.current),r)try{await fetch(`${o}/api/auth`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({password:r}),credentials:"include"})}catch{}n();return}}catch{}l>=30&&(clearInterval(c.current),n())},800)},2e3)}catch(e){console.warn("[SetupWizard] restart request failed:",e),n(!1)}};return l?(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)(A.A,{size:14})," ",e.restartDone]}):(0,s.jsxs)("button",{type:"button",onClick:p,disabled:o,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:[o?(0,s.jsx)(i.A,{size:13,className:"animate-spin"}):null,o?e.restarting:e.restartNow]})}function L({state:e,selectedAgents:t,agentStatuses:r,onRetryAgent:a,error:o,needsRestart:n,s:l,setupPhase:d,cliEnabled:c,mcpEnabled:u,skillInstallStatus:p="pending"}){let m=Object.entries(r).filter(([,e])=>"error"===e.state),x=c&&u?"CLI + MCP":c?"CLI":u?"MCP":"—",h=[[l.kbPath,e.mindRoot],[l.webPort,`${e.webPort} / ${e.mcpPort}`],[l.agentToolsTitle,u&&t.size>0?`${x} \xb7 ${l.agentCountSummary(t.size)}`:x]],g=u&&t.size>0,f=t.size>0,b=[{key:"saving",label:l.phaseSaving},...g?[{key:"agents",label:l.phaseAgents}]:[],...f?[{key:"skills",label:l.phaseSkill??"Installing skills"}]:[],{key:"done",label:l.phaseDone}],v=b.map(e=>e.key),y=v.indexOf(d);return(0,s.jsxs)("div",{className:"space-y-5",children:["done"!==d&&(0,s.jsx)("div",{className:"rounded-xl border overflow-hidden",style:{borderColor:"var(--border)"},children:h.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"===d&&(0,s.jsx)("p",{className:"text-sm",style:{color:"var(--muted-foreground)"},children:l.reviewHint}),"review"!==d&&"done"!==d&&(0,s.jsx)("div",{className:"space-y-2 py-2",children:b.map(({key:e,label:t},r)=>{let a=v.indexOf(e),o=y>a,n=d===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)(A.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:y<a?.5:1},children:t})]},e)})}),m.length>0&&"done"===d&&(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(m.length)}),m.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)(M.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})]}),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]}),"done"===d&&(0,s.jsx)(B,{state:e,selectedAgents:t,agentStatuses:r,needsRestart:n,skillInstallStatus:p,s:l})]})}function B({state:e,selectedAgents:t,agentStatuses:r,needsRestart:n,s:l,skillInstallStatus:i="pending"}){let[m,x]=(0,a.useState)(!1);(0,a.useEffect)(()=>{if(!m)return;let e=setTimeout(()=>x(!1),2e3);return()=>clearTimeout(e)},[m]);let h=(0,a.useCallback)(async()=>{!e.authToken||await (0,c.l)(e.authToken)&&(x(!0),u.oR.copy())},[e.authToken]),{locale:g}=(0,d.Y)(),f=!!e.mindRoot,b="skip"!==e.provider,v=Object.values(r).filter(e=>"ok"===e.state).length,y=v>0,k=!!e.authToken,N="",S="";if(b&&(0,p.rl)(e.provider)){let t=p.T_[e.provider];N="zh"===g?t.nameZh:t.name;let r=e.providerConfigs[e.provider];S=r?.model||t.defaultModel}let C=[{ok:f,icon:(0,s.jsx)(R.A,{size:14}),title:l.healthKb??"Knowledge Base",detail:f?e.mindRoot:l.healthKbNone??"Not configured"},{ok:b,icon:(0,s.jsx)(O.A,{size:14}),title:l.healthAi??"AI Provider",detail:b?`${N} (${S||"default"})`:l.healthAiNone??"Not configured — AI features disabled",action:b?void 0:l.healthAiAction??"Add an API key in Settings → AI."},{ok:y,icon:(0,s.jsx)(E.A,{size:14}),title:l.healthAgents??"Agent Connection",detail:y?l.healthAgentsOk?.(v)??`${v} agent(s) configured`:t.size>0?l.healthAgentsPartial??"Configuration in progress...":l.healthAgentsNone??"No agents configured",action:y?void 0:l.healthAgentsAction??"You can add agents later in Settings → Connections."},...t.size>0?[{ok:"ok"===i,icon:(0,s.jsx)(o.A,{size:14}),title:l.healthSkills??"Skills",detail:"ok"===i?l.healthSkillsOk??"Skills installed successfully":"error"===i?l.healthSkillsError??"Skill installation failed":"skipped"===i?l.healthSkillsSkipped??"Skipped":l.healthSkillsInstalling??"Installing skills...",action:"error"===i?l.healthSkillsAction??"You can install skills manually later.":void 0}]:[]];return(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsx)("div",{className:"rounded-xl border overflow-hidden",style:{borderColor:"var(--border)"},children:C.map(({ok:e,icon:t,title:r,detail:a,action:o},n)=>(0,s.jsxs)("div",{className:"flex items-start gap-3 px-4 py-3",style:{background:n%2==0?"var(--card)":"transparent",borderTop:n>0?"1px solid var(--border)":void 0},children:[(0,s.jsx)("div",{className:"w-5 h-5 rounded-full flex items-center justify-center shrink-0 mt-0.5",style:{background:e?"color-mix(in srgb, var(--success) 15%, transparent)":"color-mix(in srgb, var(--amber) 15%, transparent)",color:e?"var(--success)":"var(--amber)"},children:e?(0,s.jsx)(A.A,{size:12}):(0,s.jsx)(w.A,{size:10})}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsxs)("div",{className:"flex items-center gap-1.5 text-sm font-medium",style:{color:"var(--foreground)"},children:[t," ",r]}),(0,s.jsx)("p",{className:"text-xs mt-0.5 break-words",style:{color:e?"var(--muted-foreground)":"var(--amber-text)"},children:a}),o&&(0,s.jsx)("p",{className:"text-xs mt-0.5",style:{color:"var(--muted-foreground)"},children:o})]})]},n))}),k&&(0,s.jsxs)("div",{className:"rounded-xl border p-4 space-y-2",style:{borderColor:"var(--border)",background:"var(--card)"},children:[(0,s.jsxs)("div",{className:"flex items-center gap-1.5 text-xs font-medium uppercase tracking-wider",style:{color:"var(--muted-foreground)"},children:[(0,s.jsx)($.A,{size:11}),l.healthTokenTitle??"Auth Token"]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("div",{className:"flex-1 flex items-center px-3 py-2 rounded-lg min-h-[38px]",style:{background:"var(--muted)",border:"1px solid var(--border)"},children:(0,s.jsx)("code",{className:"flex-1 text-xs font-mono break-all select-all leading-relaxed",style:{color:"var(--foreground)"},children:e.authToken})}),(0,s.jsx)("button",{type:"button",onClick:h,className:"shrink-0 p-2 rounded-lg border transition-colors focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1",style:{borderColor:m?"color-mix(in srgb, var(--success) 50%, transparent)":"var(--border)",background:m?"color-mix(in srgb, var(--success) 10%, transparent)":"transparent",color:m?"var(--success)":"var(--muted-foreground)"},title:l.healthTokenCopy??"Copy token",children:m?(0,s.jsx)(K.A,{size:14}):(0,s.jsx)(j.A,{size:14})})]}),(0,s.jsx)("p",{className:"text-xs",style:{color:"var(--muted-foreground)"},children:l.healthTokenHint??"Use this token when connecting AI agents. Also available in Settings → Connections."})]}),n&&(0,s.jsx)(_,{s:l})]})}function H({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)(A.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 W(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 F(e){return{state:"ok"===e.status?"ok":"error",message:e.message,transport:e.transport,verified:e.verified,verifyError:e.verifyError}}async function Z(e){let t={};if("skip"!==e.provider)for(let[r,s]of Object.entries(e.providerConfigs))s&&(t[r]={apiKey:s.apiKey,model:s.model,...s.baseUrl?{baseUrl:s.baseUrl}:{}});let r={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:t}},s=await fetch("/api/setup",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)}),a=await s.json();if(!s.ok)throw Error(a.error||`HTTP ${s.status}`);return!!a.needsRestart}async function Y(e,t,r,s,a,o){let n=e.map(e=>W(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]=F(e);return d}async function G(e,t){if(0===t.length)return!0;try{let r=await fetch("/api/mcp/install-skill",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({skill:e,agents:t})}),s=await r.json();return!0===s.ok}catch(e){return console.warn("[SetupWizard] Skill installation failed:",e),!1}}function q(){let{t:e}=(0,d.Y)(),t=e.setup,[r,m]=(0,a.useState)(0),[x,h]=(0,a.useState)({mindRoot:"~/MindOS/mind",template:"en",provider:"anthropic",providerConfigs:{anthropic:{apiKey:"",model:"claude-sonnet-4-6"},openai:{apiKey:"",model:"gpt-5.4",baseUrl:""}},webPort:3456,mcpPort:8781,authToken:"",webPassword:""}),[g,f]=(0,a.useState)("~"),[b,y]=(0,a.useState)(!1),[k,j]=(0,a.useState)(!1),[N,w]=(0,a.useState)(""),[A,S]=(0,a.useState)(!1),[C,T]=(0,a.useState)("pending"),[M,z]=(0,a.useState)({checking:!1,available:null,isSelf:!1,suggestion:null}),[E,O]=(0,a.useState)({checking:!1,available:null,isSelf:!1,suggestion:null}),[I,R]=(0,a.useState)([]),[$,K]=(0,a.useState)(!1),[_,B]=(0,a.useState)(!1),[q,V]=(0,a.useState)(new Set),[J,Q]=(0,a.useState)("auto"),[X,ee]=(0,a.useState)("global"),[et,er]=(0,a.useState)({}),[es,ea]=(0,a.useState)({cli:!0,mcp:!1}),[eo,en]=(0,a.useState)("review");(0,a.useEffect)(()=>{fetch("/api/setup").then(e=>e.json()).then(e=>{e.homeDir&&f(e.homeDir),h(t=>{let r={...t.providerConfigs};if(e.providerConfigs&&"object"==typeof e.providerConfigs)for(let[t,s]of Object.entries(e.providerConfigs))(0,p.rl)(t)&&s&&(r[t]={apiKey:r[t]?.apiKey??"",model:s.model||p.T_[t].defaultModel,baseUrl:s.baseUrl??"",apiKeyMask:s.apiKeyMask||""});let s=e.provider&&(0,p.rl)(e.provider)?e.provider:t.provider;return{...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:s,providerConfigs:r}}),e.authToken||fetch("/api/setup/generate-token",{method:"POST",headers:{"Content-Type":"application/json"},body:"{}"}).then(e=>e.json()).then(e=>{e.token&&h(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&&h(t=>({...t,authToken:e.token}))}).catch(e=>console.warn("[SetupWizard] Fallback token generation also failed:",e))})},[]),(0,a.useEffect)(()=>{1===r&&(ed(x.webPort,"web",!0),ed(x.mcpPort,"mcp",!0))},[r]),(0,a.useEffect)(()=>{2!==r||_||$||(K(!0),fetch("/api/mcp/agents").then(e=>e.json()).then(e=>{if(e.agents){let t=e.agents.filter(e=>"builtin"!==e.scope);R(t),V(new Set(t.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(()=>K(!1)))},[r,_,$]);let el=(0,a.useCallback)((e,t)=>{h(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&&h(e=>({...e,authToken:r.token}))}catch(e){console.warn("[SetupWizard] generateToken failed:",e)}},[]);let ei=(0,a.useCallback)(()=>{(0,c.l)(x.authToken).then(e=>{e&&u.oR.copy()})},[x.authToken]),ed=(0,a.useCallback)(async(e,t,r=!1)=>{if(e<1024||e>65535)return;let s="web"===t?z:O;s({checking:!0,available:null,isSelf:!1,suggestion:null});try{let a=await fetch("/api/setup/check-port",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({port:e})}),o=await a.json(),n=o.available??null,l=o.suggestion??null;if(s({checking:!1,available:n,isSelf:!!o.isSelf,suggestion:l}),r&&!1===n&&l){let e="web"===t?"webPort":"mcpPort";h(t=>({...t,[e]:l})),setTimeout(()=>ed(l,t,!1),0)}}catch(e){console.warn("[SetupWizard] checkPort failed:",e),s({checking:!1,available:null,isSelf:!1,suggestion:null})}},[]),ec=x.webPort===x.mcpPort,eu=async()=>{y(!0),w("");let e=Array.from(q),t=x;if(!x.authToken)try{let e=await fetch("/api/setup/generate-token",{method:"POST",headers:{"Content-Type":"application/json"},body:"{}"}),r=await e.json();r.token&&(t={...x,authToken:r.token},h(t))}catch{}en("saving");try{await Z(t)&&S(!0)}catch(e){w(e instanceof Error?e.message:String(e)),en("review"),y(!1);return}if(es.mcp&&e.length>0){en("agents");let r={};for(let t of e)r[t]={state:"installing"};er(r);try{let r=await Y(e,I,J,X,t.mcpPort,t.authToken);er(r)}catch(r){console.warn("[SetupWizard] agent batch install failed:",r);let t={};for(let r of e)t[r]={state:"error"};er(t)}}if(e.length>0){en("skills"),T("installing");let r="zh"===t.template?"mindos-zh":"mindos";try{let t=await G(r,e);T(t?"ok":"error")}catch(e){console.warn("[SetupWizard] skill install failed:",e),T("error")}}else T("skipped");y(!1),j(!0),en("done")},ep=(0,a.useCallback)(async e=>{er(t=>({...t,[e]:{state:"installing"}}));try{let t=W(e,I,J,X),r=await fetch("/api/mcp/install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({agents:[t],transport:J,url:`http://localhost:${x.mcpPort}/mcp`,token:x.authToken||void 0})}),s=await r.json();if(s.results?.[0]){let t=s.results[0];er(r=>({...r,[e]:F(t)}))}}catch(t){console.warn("[SetupWizard] retryAgent failed:",t),er(t=>({...t,[e]:{state:"error"}}))}},[I,X,J,x.mcpPort,x.authToken]);return(0,s.jsxs)("div",{className:"fixed inset-0 z-50 flex flex-col overflow-y-auto",role:"dialog","aria-modal":"true","aria-labelledby":"setup-title",style:{background:"var(--background)"},children:[(0,s.jsx)("div",{className:"sticky top-0 z-10 pt-6 pb-3 px-6",style:{background:"var(--background)"},children:(0,s.jsxs)("div",{className:"max-w-xl mx-auto",children:[(0,s.jsx)("div",{className:"text-center mb-3",children:(0,s.jsxs)("div",{className:"inline-flex items-center gap-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)(H,{step:r,setStep:m,stepTitles:t.stepTitles,disabled:b||k,numberedSteps:3})})]})}),(0,s.jsxs)("div",{className:"flex-1 w-full max-w-xl mx-auto px-6 pb-8",children:[(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)(v,{state:x,update:el,t:e,homeDir:g}),1===r&&(0,s.jsx)(P,{state:x,update:el,s:t,onCopyToken:ei,webPortStatus:M,mcpPortStatus:E,setWebPortStatus:z,setMcpPortStatus:O,checkPort:ed,portConflict:ec}),2===r&&(0,s.jsx)(U,{agents:I,agentsLoading:$,selectedAgents:q,setSelectedAgents:V,connectionMode:es,setConnectionMode:ea,agentTransport:J,setAgentTransport:Q,agentScope:X,setAgentScope:ee,agentStatuses:et,s:t,settingsMcp:e.settings.mcp}),3===r&&(0,s.jsx)(L,{state:x,selectedAgents:q,agentStatuses:et,onRetryAgent:ep,error:N,needsRestart:A,s:t,setupPhase:eo,cliEnabled:es.cli,mcpEnabled:es.mcp,skillInstallStatus:C}),(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:()=>m(r-1),disabled:0===r||b||k,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:()=>m(r+1),disabled:!(0===r?x.mindRoot.trim().length>0&&x.webPassword.trim().length>0:1===r?!ec&&!M.checking&&!E.checking&&!1!==M.available&&!1!==E.available:2!==r||es.cli||es.mcp),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})]}):k?A?(0,s.jsx)(D,{s:t,newPort:x.webPort,webPassword:x.webPassword}):(0,s.jsxs)("a",{href:"/?welcome=1",className:"flex items-center gap-1.5 px-5 py-2 text-sm font-medium rounded-lg transition-colors hover:opacity-90 focus-visible:ring-2 focus-visible:ring-ring",style:{background:"var(--amber)",color:"var(--amber-foreground)"},children:[t.healthGoHome??"Go to MindOS"," →"]}):(0,s.jsxs)("button",{onClick:eu,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"}]])},42129:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(90425).A)("folder-open",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]])},47376:(e,t,r)=>{"use strict";r.d(t,{Ot:()=>u,T_:()=>a,Ux:()=>c,bf:()=>l,jt:()=>o,rl:()=>n});var s=r(20699);r(87358);let a={anthropic:{id:"anthropic",name:"Anthropic",nameZh:"Anthropic",defaultModel:"claude-sonnet-4-6",supportsBaseUrl:!0,supportsThinking:!0,supportsListModels:!0,signupUrl:"https://console.anthropic.com/settings/keys",category:"primary"},openai:{id:"openai",name:"OpenAI",nameZh:"OpenAI",defaultModel:"gpt-5.4",supportsBaseUrl:!0,supportsThinking:!0,supportsListModels:!0,signupUrl:"https://platform.openai.com/api-keys",category:"primary"},google:{id:"google",name:"Google Gemini",nameZh:"Google Gemini",defaultModel:"gemini-2.5-flash",supportsBaseUrl:!1,supportsThinking:!0,supportsListModels:!1,signupUrl:"https://aistudio.google.com/apikey",category:"primary"},groq:{id:"groq",name:"Groq",nameZh:"Groq",defaultModel:"llama-3.3-70b-versatile",supportsBaseUrl:!1,supportsThinking:!1,supportsListModels:!0,signupUrl:"https://console.groq.com/keys",category:"more"},xai:{id:"xai",name:"xAI (Grok)",nameZh:"xAI (Grok)",defaultModel:"grok-3",supportsBaseUrl:!1,supportsThinking:!1,supportsListModels:!0,category:"more"},openrouter:{id:"openrouter",name:"OpenRouter",nameZh:"OpenRouter",defaultModel:"anthropic/claude-sonnet-4",supportsBaseUrl:!1,supportsThinking:!1,supportsListModels:!0,category:"more"},mistral:{id:"mistral",name:"Mistral",nameZh:"Mistral",defaultModel:"mistral-large-latest",supportsBaseUrl:!1,supportsThinking:!1,supportsListModels:!0,category:"more"},deepseek:{id:"deepseek",name:"DeepSeek",nameZh:"DeepSeek",defaultModel:"deepseek-chat",piProviderOverride:"openai",fixedBaseUrl:"https://api.deepseek.com/v1",supportsBaseUrl:!0,supportsThinking:!0,supportsListModels:!0,signupUrl:"https://platform.deepseek.com/api_keys",category:"more"},zai:{id:"zai",name:"ZhipuAI (GLM)",nameZh:"智谱 AI (GLM)",defaultModel:"glm-4-plus",supportsBaseUrl:!1,supportsThinking:!0,supportsListModels:!1,category:"more"},"kimi-coding":{id:"kimi-coding",name:"Kimi Coding",nameZh:"Kimi Coding (月之暗面)",defaultModel:"kimi-k2-thinking",supportsBaseUrl:!1,supportsThinking:!0,supportsListModels:!1,category:"more"},cerebras:{id:"cerebras",name:"Cerebras",nameZh:"Cerebras",defaultModel:"llama-4-scout-17b-16e",supportsBaseUrl:!1,supportsThinking:!1,supportsListModels:!0,category:"more"},minimax:{id:"minimax",name:"MiniMax",nameZh:"MiniMax",defaultModel:"MiniMax-M1",supportsBaseUrl:!1,supportsThinking:!1,supportsListModels:!1,category:"more"},huggingface:{id:"huggingface",name:"Hugging Face",nameZh:"Hugging Face",defaultModel:"Qwen/Qwen3-235B-A22B-Thinking-2507",supportsBaseUrl:!1,supportsThinking:!0,supportsListModels:!1,category:"more"},ollama:{id:"ollama",name:"Ollama",nameZh:"Ollama (本地)",defaultModel:"llama3.2",piProviderOverride:"openai",fixedBaseUrl:"http://localhost:11434/v1",apiKeyFallback:"ollama",supportsBaseUrl:!0,supportsThinking:!1,supportsListModels:!0,signupUrl:"https://ollama.com/download",category:"more"}},o=Object.keys(a);function n(e){return e in a}function l(){let e=[],t=[];for(let r of o)"primary"===a[r].category?e.push(r):t.push(r);return t.sort((e,t)=>a[e].name.localeCompare(a[t].name)),{primary:e,more:t}}function i(e){return a[e].piProviderOverride??e}let d={deepseek:"DEEPSEEK_API_KEY"};function c(e){return d[e]?d[e]:p[i(e)]}function u(e){let t=a[e];if(t.fixedBaseUrl)return t.fixedBaseUrl;try{let t=(0,s.zr)(i(e));return t[0]?.baseUrl??""}catch{return""}}let p={anthropic:"ANTHROPIC_API_KEY",openai:"OPENAI_API_KEY","azure-openai-responses":"AZURE_OPENAI_API_KEY",google:"GEMINI_API_KEY",groq:"GROQ_API_KEY",cerebras:"CEREBRAS_API_KEY",xai:"XAI_API_KEY",openrouter:"OPENROUTER_API_KEY",zai:"ZAI_API_KEY",mistral:"MISTRAL_API_KEY",minimax:"MINIMAX_API_KEY",huggingface:"HF_TOKEN","kimi-coding":"KIMI_API_KEY"}},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"}]])},51842:(e,t,r)=>{"use strict";r.d(t,{A:()=>c});var s=r(95155),a=r(12115),o=r(12651),n=r(66088),l=r(30125),i=r(47376),d=r(91053);function c({value:e,onChange:t,showSkip:r=!1,compact:c=!1,configuredProviders:u}){let{locale:p}=(0,d.Y)(),[m,x]=(0,a.useState)(!1),h=(0,i.bf)(),g=r=>{let a=i.T_[r],n="zh"===p?a.nameZh:a.name,l=e===r,d=u?.has(r);return c?(0,s.jsxs)("button",{type:"button",onClick:()=>t(r),className:`flex items-center gap-2 px-3 py-2 rounded-lg border text-left transition-all text-sm ${l?"border-[var(--amber)] bg-[var(--amber-subtle)] shadow-sm":"border-border/50 hover:border-border hover:bg-muted/30"}`,children:[(0,s.jsx)("span",{className:`font-medium ${l?"text-foreground":"text-muted-foreground"}`,children:n}),d&&!l&&(0,s.jsx)(o.A,{size:12,className:"text-success ml-auto shrink-0"}),l&&(0,s.jsx)(o.A,{size:14,className:"ml-auto shrink-0",style:{color:"var(--amber)"}})]},r):(0,s.jsxs)("button",{type:"button",onClick:()=>t(r),className:"flex items-start gap-3 p-4 rounded-xl border text-left transition-all duration-150",style:{background:l?"var(--amber-dim)":"var(--card)",borderColor:l?"var(--amber)":"var(--border)"},children:[(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsx)("p",{className:"text-sm font-medium",style:{color:"var(--foreground)"},children:n}),(0,s.jsx)("p",{className:"text-xs mt-0.5",style:{color:"var(--muted-foreground)"},children:a.defaultModel})]}),d&&!l&&(0,s.jsx)(o.A,{size:14,className:"text-success shrink-0 mt-0.5"}),l&&(0,s.jsx)(o.A,{size:16,className:"shrink-0 mt-0.5",style:{color:"var(--amber)"}})]},r)},{primary:f,more:b}=h;return(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("div",{className:c?"flex flex-wrap gap-2":"grid grid-cols-1 gap-2",children:f.map(g)}),b.length>0&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("button",{type:"button",onClick:()=>x(!m),className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors py-1",children:[(0,s.jsx)(n.A,{size:12,className:`transition-transform ${m?"rotate-180":""}`}),m?"zh"===p?"收起":"Show less":"zh"===p?`更多 (${b.length})`:`More providers (${b.length})`]}),m&&(0,s.jsx)("div",{className:c?"flex flex-wrap gap-2":"grid grid-cols-1 gap-2",children:b.map(g)})]}),r&&(0,s.jsxs)("button",{type:"button",onClick:()=>t("skip"),className:"flex items-center gap-2 px-3 py-2 rounded-lg border text-left transition-all text-sm w-full mt-1",style:{background:"skip"===e?"var(--amber-dim)":"var(--card)",borderColor:"skip"===e?"var(--amber)":"var(--border)"},children:[(0,s.jsx)(l.A,{size:14,className:"shrink-0",style:{color:"skip"===e?"var(--amber)":"var(--muted-foreground)"}}),(0,s.jsx)("span",{className:`font-medium ${"skip"===e?"text-foreground":"text-muted-foreground"}`,children:"zh"===p?"暂时跳过":"Skip for now"}),"skip"===e&&(0,s.jsx)(o.A,{size:14,className:"ml-auto shrink-0",style:{color:"var(--amber)"}})]})]})}},60392:e=>{function t(e){return Promise.resolve().then(()=>{var t=Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t})}t.keys=()=>[],t.resolve=t,t.id=60392,e.exports=t},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"}]])},68806:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(90425).A)("plug",[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z",key:"1xoxul"}],["path",{d:"M9 8V2",key:"14iosj"}]])},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"}]])},84825:e=>{function t(e){return Promise.resolve().then(()=>{var t=Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t})}t.keys=()=>[],t.resolve=t,t.id=84825,e.exports=t},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}},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,[4913,7266,1053,8441,3794,7358],()=>e(e.s=15721)),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1227],{1934:(e,t,r)=>{"use strict";r.d(t,{v:()=>o});var s=r(12115);let a=e=>{let t,r=new Set,s=(e,s)=>{let a="function"==typeof e?e(t):e;if(!Object.is(a,t)){let e=t;t=(null!=s?s:"object"!=typeof a||null===a)?a:Object.assign({},t,a),r.forEach(r=>r(t,e))}},a=()=>t,n={setState:s,getState:a,getInitialState:()=>o,subscribe:e=>(r.add(e),()=>r.delete(e))},o=t=e(s,a,n);return n},n=e=>{let t=e?a(e):a,r=e=>(function(e,t=e=>e){let r=s.useSyncExternalStore(e.subscribe,s.useCallback(()=>t(e.getState()),[e,t]),s.useCallback(()=>t(e.getInitialState()),[e,t]));return s.useDebugValue(r),r})(t,e);return Object.assign(r,t),r},o=e=>e?n(e):n},4235:(e,t,r)=>{"use strict";r.d(t,{B1:()=>i,X8:()=>l,dV:()=>d,oR:()=>u});let s=[],a=[],n=0;function o(){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),o()}function c(e){let t=`toast-${++n}`,r={id:t,message:e.message,type:e.type??"info",duration:e.duration??2e3,action:e.action};s=[...s,r].slice(-3),o(),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 n.callServer},createServerReference:function(){return i.createServerReference},findSourceMapURL:function(){return o.findSourceMapURL}};for(var a in s)Object.defineProperty(t,a,{enumerable:!0,get:s[a]});let n=r(77304),o=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),n=r(6296),o=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:n,icon:o}){return(0,s.jsxs)("label",{className:"relative block group/search",children:[(0,s.jsx)(o,{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":n,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:o,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)(n.A,{size:12,className:"animate-spin","aria-hidden":"true"}),r?o??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:n,href:o}){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"}),n&&(0,s.jsx)("button",{type:"button",onClick:e=>{e.preventDefault(),e.stopPropagation(),n()},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)(o.A,{size:14})})}function v({open:e,title:t,message:r,confirmLabel:a,cancelLabel:n,onConfirm:o,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:n}),(0,s.jsx)("button",{type:"button",onClick:o,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:n}){let o=(0,i.useRef)(null);return((0,i.useEffect)(()=>{if(e)return document.addEventListener("mousedown",t),()=>document.removeEventListener("mousedown",t);function t(e){o.current&&!o.current.contains(e.target)&&n()}},[e,n]),(0,i.useEffect)(()=>{if(e)return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t);function t(e){"Escape"===e.key&&n()}},[e,n]),e)?(0,s.jsx)("div",{ref:o,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,56872))},56872:(e,t,r)=>{"use strict";r.d(t,{default:()=>k});var s=r(95155),a=r(12115),n=r(68459),o=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(91053),f=r(9339);let h=(0,f.createServerReference)("60b9d85dd86a3710c1dadcbaddd8cd6fcf2f0a4cc2",f.callServer,void 0,f.findSourceMapURL,"restoreFromTrashAction"),p=(0,f.createServerReference)("408dc85a07fde5c799ad647c227663615d7f0abda2",f.callServer,void 0,f.findSourceMapURL,"permanentlyDeleteAction"),g=(0,f.createServerReference)("00bb250875b1ab79b97e44f8ab6a9e64eeba38d66e",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),[S,R]=(0,a.useState)(null),[z,$]=(0,a.useState)(null),L=(0,a.useCallback)(async e=>{$(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?R(e):y.oR.error(s.error??"Failed to restore")}finally{$(null)}},[t,r]),E=(0,a.useCallback)(async e=>{if(!S)return;let s=await h(S.id,e);s.success?(k(e=>e.filter(e=>e.id!==S.id)),y.oR.success(t.trash.restored),R(null),r.refresh()):y.oR.error(s.error??"Failed to restore")},[S,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)(n.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)(n.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)(o.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:z===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:[z===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"}),S&&(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:['"',S.fileName,'" — ',S.originalPath]}),(0,s.jsxs)("div",{className:"flex items-center gap-2 justify-end",children:[(0,s.jsx)("button",{type:"button",onClick:()=>R(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})]})]})})]})}},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}})},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(),n=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 o={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:n,className:i="",children:d,iconNode:l,...c},u)=>(0,s.createElement)("svg",{ref:u,...o,width:t,height:t,stroke:e,strokeWidth:n?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,...o},d)=>(0,s.createElement)(i,{ref:d,iconNode:t,className:a(`lucide-${n(e).replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${e}`,r),...o}));return r.displayName=n(e),r}}},e=>{e.O(0,[1053,8441,3794,7358],()=>e(e.s=54839)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1227],{1934:(e,t,r)=>{"use strict";r.d(t,{v:()=>o});var s=r(12115);let a=e=>{let t,r=new Set,s=(e,s)=>{let a="function"==typeof e?e(t):e;if(!Object.is(a,t)){let e=t;t=(null!=s?s:"object"!=typeof a||null===a)?a:Object.assign({},t,a),r.forEach(r=>r(t,e))}},a=()=>t,n={setState:s,getState:a,getInitialState:()=>o,subscribe:e=>(r.add(e),()=>r.delete(e))},o=t=e(s,a,n);return n},n=e=>{let t=e?a(e):a,r=e=>(function(e,t=e=>e){let r=s.useSyncExternalStore(e.subscribe,s.useCallback(()=>t(e.getState()),[e,t]),s.useCallback(()=>t(e.getInitialState()),[e,t]));return s.useDebugValue(r),r})(t,e);return Object.assign(r,t),r},o=e=>e?n(e):n},4235:(e,t,r)=>{"use strict";r.d(t,{B1:()=>i,X8:()=>l,dV:()=>d,oR:()=>u});let s=[],a=[],n=0;function o(){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),o()}function c(e){let t=`toast-${++n}`,r={id:t,message:e.message,type:e.type??"info",duration:e.duration??2e3,action:e.action};s=[...s,r].slice(-3),o(),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 n.callServer},createServerReference:function(){return i.createServerReference},findSourceMapURL:function(){return o.findSourceMapURL}};for(var a in s)Object.defineProperty(t,a,{enumerable:!0,get:s[a]});let n=r(77304),o=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),n=r(6296),o=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:n,icon:o}){return(0,s.jsxs)("label",{className:"relative block group/search",children:[(0,s.jsx)(o,{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":n,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:o,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)(n.A,{size:12,className:"animate-spin","aria-hidden":"true"}),r?o??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:n,href:o}){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"}),n&&(0,s.jsx)("button",{type:"button",onClick:e=>{e.preventDefault(),e.stopPropagation(),n()},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)(o.A,{size:14})})}function v({open:e,title:t,message:r,confirmLabel:a,cancelLabel:n,onConfirm:o,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:n}),(0,s.jsx)("button",{type:"button",onClick:o,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:n}){let o=(0,i.useRef)(null);return((0,i.useEffect)(()=>{if(e)return document.addEventListener("mousedown",t),()=>document.removeEventListener("mousedown",t);function t(e){o.current&&!o.current.contains(e.target)&&n()}},[e,n]),(0,i.useEffect)(()=>{if(e)return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t);function t(e){"Escape"===e.key&&n()}},[e,n]),e)?(0,s.jsx)("div",{ref:o,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"}]])},51680:(e,t,r)=>{"use strict";r.d(t,{default:()=>k});var s=r(95155),a=r(12115),n=r(68459),o=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(91053),f=r(9339);let h=(0,f.createServerReference)("603a64fdddfef4e658bbfe23c10538d829c8674caf",f.callServer,void 0,f.findSourceMapURL,"restoreFromTrashAction"),p=(0,f.createServerReference)("40abff7bf8f41fb44ec5d138147d0d85764a47b5cb",f.callServer,void 0,f.findSourceMapURL,"permanentlyDeleteAction"),g=(0,f.createServerReference)("004a0f75f9c85bdb0fb526bd4c31a93a5579c69f2c",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),[S,R]=(0,a.useState)(null),[z,$]=(0,a.useState)(null),L=(0,a.useCallback)(async e=>{$(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?R(e):y.oR.error(s.error??"Failed to restore")}finally{$(null)}},[t,r]),E=(0,a.useCallback)(async e=>{if(!S)return;let s=await h(S.id,e);s.success?(k(e=>e.filter(e=>e.id!==S.id)),y.oR.success(t.trash.restored),R(null),r.refresh()):y.oR.error(s.error??"Failed to restore")},[S,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)(n.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)(n.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)(o.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:z===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:[z===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"}),S&&(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:['"',S.fileName,'" — ',S.originalPath]}),(0,s.jsxs)("div",{className:"flex items-center gap-2 justify-end",children:[(0,s.jsx)("button",{type:"button",onClick:()=>R(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})]})]})})]})}},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,51680))},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}})},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(),n=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 o={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:n,className:i="",children:d,iconNode:l,...c},u)=>(0,s.createElement)("svg",{ref:u,...o,width:t,height:t,stroke:e,strokeWidth:n?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,...o},d)=>(0,s.createElement)(i,{ref:d,iconNode:t,className:a(`lucide-${n(e).replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${e}`,r),...o}));return r.displayName=n(e),r}}},e=>{e.O(0,[1053,8441,3794,7358],()=>e(e.s=54839)),_N_E=e.O()}]);