@savecontext/dashboard 0.1.22 → 0.1.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next/standalone/dashboard/.next/BUILD_ID +1 -1
- package/.next/standalone/dashboard/.next/app-path-routes-manifest.json +22 -22
- package/.next/standalone/dashboard/.next/build-manifest.json +2 -2
- package/.next/standalone/dashboard/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/_global-error.html +2 -2
- package/.next/standalone/dashboard/.next/server/app/_global-error.rsc +1 -1
- package/.next/standalone/dashboard/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/standalone/dashboard/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/dashboard/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/.next/standalone/dashboard/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next/standalone/dashboard/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next/standalone/dashboard/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/dashboard/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/_not-found.html +17 -1
- package/.next/standalone/dashboard/.next/server/app/_not-found.rsc +1 -1
- package/.next/standalone/dashboard/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
- package/.next/standalone/dashboard/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/.next/standalone/dashboard/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
- package/.next/standalone/dashboard/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/dashboard/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/.next/standalone/dashboard/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/checkpoints/[id]/items/route.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/checkpoints/[id]/items/route.js.nft.json +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/checkpoints/[id]/items/route_client-reference-manifest.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/context/delete/route.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/context/delete/route.js.nft.json +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/context/delete/route_client-reference-manifest.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/context/update/route.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/context/update/route.js.nft.json +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/context/update/route_client-reference-manifest.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/issues/create/route.js +2 -2
- package/.next/standalone/dashboard/.next/server/app/api/issues/create/route.js.nft.json +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/issues/create/route_client-reference-manifest.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/issues/delete/route.js +2 -2
- package/.next/standalone/dashboard/.next/server/app/api/issues/delete/route.js.nft.json +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/issues/delete/route_client-reference-manifest.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/issues/list/route.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/issues/list/route.js.nft.json +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/issues/list/route_client-reference-manifest.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/issues/subtasks/route.js +4 -4
- package/.next/standalone/dashboard/.next/server/app/api/issues/subtasks/route.js.nft.json +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/issues/subtasks/route_client-reference-manifest.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/issues/update/route.js +2 -2
- package/.next/standalone/dashboard/.next/server/app/api/issues/update/route.js.nft.json +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/issues/update/route_client-reference-manifest.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/memory/delete/route.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/memory/delete/route.js.nft.json +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/memory/delete/route_client-reference-manifest.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/memory/list/route.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/memory/list/route.js.nft.json +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/memory/list/route_client-reference-manifest.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/memory/save/route.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/memory/save/route.js.nft.json +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/memory/save/route_client-reference-manifest.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/plans/[id]/route.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/plans/[id]/route.js.nft.json +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/plans/[id]/route_client-reference-manifest.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/plans/create/route.js +2 -2
- package/.next/standalone/dashboard/.next/server/app/api/plans/create/route.js.nft.json +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/plans/create/route_client-reference-manifest.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/plans/delete/route.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/plans/delete/route.js.nft.json +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/plans/delete/route_client-reference-manifest.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/plans/list/route.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/plans/list/route.js.nft.json +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/plans/list/route_client-reference-manifest.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/plans/update/route.js +2 -2
- package/.next/standalone/dashboard/.next/server/app/api/plans/update/route.js.nft.json +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/plans/update/route_client-reference-manifest.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/projects/[id]/route.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/projects/[id]/route.js.nft.json +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/projects/[id]/route_client-reference-manifest.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/projects/route.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/projects/route.js.nft.json +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/projects/route_client-reference-manifest.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/sessions/[id]/projects/route.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/sessions/[id]/projects/route.js.nft.json +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/sessions/[id]/projects/route_client-reference-manifest.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/sessions/[id]/route.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/sessions/[id]/route.js.nft.json +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/sessions/[id]/route_client-reference-manifest.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/sessions/[id]/stats/route.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/sessions/[id]/stats/route.js.nft.json +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/sessions/[id]/stats/route_client-reference-manifest.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/sessions/[id]/status/route.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/sessions/[id]/status/route.js.nft.json +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/sessions/[id]/status/route_client-reference-manifest.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/dashboard/checkpoints/[id]/page.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/dashboard/checkpoints/[id]/page.js.nft.json +1 -1
- package/.next/standalone/dashboard/.next/server/app/dashboard/checkpoints/[id]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/dashboard/checkpoints/page.js +2 -2
- package/.next/standalone/dashboard/.next/server/app/dashboard/checkpoints/page.js.nft.json +1 -1
- package/.next/standalone/dashboard/.next/server/app/dashboard/checkpoints/page_client-reference-manifest.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/dashboard/issues/page.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/dashboard/issues/page.js.nft.json +1 -1
- package/.next/standalone/dashboard/.next/server/app/dashboard/issues/page_client-reference-manifest.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/dashboard/memory/page.js +2 -2
- package/.next/standalone/dashboard/.next/server/app/dashboard/memory/page.js.nft.json +1 -1
- package/.next/standalone/dashboard/.next/server/app/dashboard/memory/page_client-reference-manifest.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/dashboard/page.js +3 -3
- package/.next/standalone/dashboard/.next/server/app/dashboard/page.js.nft.json +1 -1
- package/.next/standalone/dashboard/.next/server/app/dashboard/page_client-reference-manifest.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/dashboard/plans/page.js +2 -2
- package/.next/standalone/dashboard/.next/server/app/dashboard/plans/page.js.nft.json +1 -1
- package/.next/standalone/dashboard/.next/server/app/dashboard/plans/page_client-reference-manifest.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/dashboard/sessions/[id]/page.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/dashboard/sessions/[id]/page.js.nft.json +1 -1
- package/.next/standalone/dashboard/.next/server/app/dashboard/sessions/[id]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/dashboard/sessions/page.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/dashboard/sessions/page.js.nft.json +1 -1
- package/.next/standalone/dashboard/.next/server/app/dashboard/sessions/page_client-reference-manifest.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/index.html +1 -1
- package/.next/standalone/dashboard/.next/server/app/index.rsc +1 -1
- package/.next/standalone/dashboard/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/dashboard/.next/server/app/index.segments/_full.segment.rsc +1 -1
- package/.next/standalone/dashboard/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/.next/standalone/dashboard/.next/server/app/index.segments/_index.segment.rsc +1 -1
- package/.next/standalone/dashboard/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/dashboard/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/standalone/dashboard/.next/server/app-paths-manifest.json +22 -22
- package/.next/standalone/dashboard/.next/server/chunks/848.js +1 -1
- package/.next/standalone/dashboard/.next/server/pages/404.html +17 -1
- package/.next/standalone/dashboard/.next/server/pages/500.html +2 -2
- package/.next/standalone/dashboard/.next/static/chunks/{3358-27a1941db2941343.js → 3358-be1dcb412e5a5840.js} +1 -1
- package/.next/standalone/dashboard/.next/static/chunks/{5602-66df072f21a844c9.js → 5602-de6be5d495e39d30.js} +1 -1
- package/.next/standalone/dashboard/.next/static/chunks/{6736-41f13829c40765d8.js → 6736-2e5d92a3f8a9a938.js} +1 -1
- package/.next/standalone/dashboard/.next/static/chunks/app/dashboard/checkpoints/{page-4b30b30c441a24c8.js → page-69c93b249f9f09f9.js} +1 -1
- package/.next/standalone/dashboard/.next/static/chunks/app/dashboard/issues/page-b176cdca78e8145d.js +1 -0
- package/.next/standalone/dashboard/.next/static/chunks/app/dashboard/memory/{page-5b92aff45809fc6f.js → page-ffbe55f2b5b3a1a4.js} +1 -1
- package/.next/standalone/dashboard/.next/static/chunks/app/dashboard/{page-8403ee5d448ed5a7.js → page-e7dfa69451ac3cf4.js} +2 -2
- package/.next/standalone/dashboard/.next/static/chunks/app/dashboard/plans/{page-5203a84d31f5998c.js → page-aa014387d68c52ed.js} +1 -1
- package/.next/standalone/dashboard/.next/static/chunks/app/dashboard/sessions/[id]/{page-094d2405b39c79d3.js → page-1acf5db28461761f.js} +1 -1
- package/.next/standalone/dashboard/.next/static/chunks/app/dashboard/sessions/page-bce106da597ef37a.js +1 -0
- package/.next/standalone/dashboard/package.json +8 -9
- package/.next/standalone/package.json +1 -1
- package/README.md +3 -5
- package/bin/savecontext-dashboard.js +6 -5
- package/package.json +8 -9
- package/.next/standalone/dashboard/.next/static/chunks/app/dashboard/issues/page-8595961148b9e336.js +0 -1
- package/.next/standalone/dashboard/.next/static/chunks/app/dashboard/sessions/page-a6e839598a743003.js +0 -1
- package/.next/standalone/node_modules/.pnpm/better-sqlite3@12.5.0/node_modules/better-sqlite3/build/Release/better_sqlite3.node +0 -0
- package/.next/standalone/node_modules/.pnpm/better-sqlite3@12.5.0/node_modules/better-sqlite3/lib/database.js +0 -90
- package/.next/standalone/node_modules/.pnpm/better-sqlite3@12.5.0/node_modules/better-sqlite3/lib/index.js +0 -3
- package/.next/standalone/node_modules/.pnpm/better-sqlite3@12.5.0/node_modules/better-sqlite3/lib/methods/aggregate.js +0 -43
- package/.next/standalone/node_modules/.pnpm/better-sqlite3@12.5.0/node_modules/better-sqlite3/lib/methods/backup.js +0 -67
- package/.next/standalone/node_modules/.pnpm/better-sqlite3@12.5.0/node_modules/better-sqlite3/lib/methods/function.js +0 -31
- package/.next/standalone/node_modules/.pnpm/better-sqlite3@12.5.0/node_modules/better-sqlite3/lib/methods/inspect.js +0 -7
- package/.next/standalone/node_modules/.pnpm/better-sqlite3@12.5.0/node_modules/better-sqlite3/lib/methods/pragma.js +0 -12
- package/.next/standalone/node_modules/.pnpm/better-sqlite3@12.5.0/node_modules/better-sqlite3/lib/methods/serialize.js +0 -16
- package/.next/standalone/node_modules/.pnpm/better-sqlite3@12.5.0/node_modules/better-sqlite3/lib/methods/table.js +0 -189
- package/.next/standalone/node_modules/.pnpm/better-sqlite3@12.5.0/node_modules/better-sqlite3/lib/methods/transaction.js +0 -78
- package/.next/standalone/node_modules/.pnpm/better-sqlite3@12.5.0/node_modules/better-sqlite3/lib/methods/wrappers.js +0 -54
- package/.next/standalone/node_modules/.pnpm/better-sqlite3@12.5.0/node_modules/better-sqlite3/lib/sqlite-error.js +0 -20
- package/.next/standalone/node_modules/.pnpm/better-sqlite3@12.5.0/node_modules/better-sqlite3/lib/util.js +0 -12
- package/.next/standalone/node_modules/.pnpm/better-sqlite3@12.5.0/node_modules/better-sqlite3/package.json +0 -59
- package/.next/standalone/node_modules/.pnpm/bindings@1.5.0/node_modules/bindings/bindings.js +0 -221
- package/.next/standalone/node_modules/.pnpm/bindings@1.5.0/node_modules/bindings/package.json +0 -28
- package/.next/standalone/node_modules/.pnpm/file-uri-to-path@1.0.0/node_modules/file-uri-to-path/index.js +0 -66
- package/.next/standalone/node_modules/.pnpm/file-uri-to-path@1.0.0/node_modules/file-uri-to-path/package.json +0 -32
- package/.next/standalone/node_modules/better-sqlite3/build/Release/better_sqlite3.node +0 -0
- package/.next/standalone/node_modules/better-sqlite3/lib/database.js +0 -90
- package/.next/standalone/node_modules/better-sqlite3/lib/index.js +0 -3
- package/.next/standalone/node_modules/better-sqlite3/lib/methods/aggregate.js +0 -43
- package/.next/standalone/node_modules/better-sqlite3/lib/methods/backup.js +0 -67
- package/.next/standalone/node_modules/better-sqlite3/lib/methods/function.js +0 -31
- package/.next/standalone/node_modules/better-sqlite3/lib/methods/inspect.js +0 -7
- package/.next/standalone/node_modules/better-sqlite3/lib/methods/pragma.js +0 -12
- package/.next/standalone/node_modules/better-sqlite3/lib/methods/serialize.js +0 -16
- package/.next/standalone/node_modules/better-sqlite3/lib/methods/table.js +0 -189
- package/.next/standalone/node_modules/better-sqlite3/lib/methods/transaction.js +0 -78
- package/.next/standalone/node_modules/better-sqlite3/lib/methods/wrappers.js +0 -54
- package/.next/standalone/node_modules/better-sqlite3/lib/sqlite-error.js +0 -20
- package/.next/standalone/node_modules/better-sqlite3/lib/util.js +0 -12
- package/.next/standalone/node_modules/better-sqlite3/package.json +0 -59
- package/.next/standalone/node_modules/bindings/bindings.js +0 -221
- package/.next/standalone/node_modules/bindings/package.json +0 -28
- package/.next/standalone/node_modules/file-uri-to-path/index.js +0 -66
- package/.next/standalone/node_modules/file-uri-to-path/package.json +0 -32
- /package/.next/standalone/dashboard/.next/static/{iXCD4qusgLaFdlD22YBUR → 00P-K7nRwpuQW1hq0VwZ5}/_buildManifest.js +0 -0
- /package/.next/standalone/dashboard/.next/static/{iXCD4qusgLaFdlD22YBUR → 00P-K7nRwpuQW1hq0VwZ5}/_ssgManifest.js +0 -0
package/.next/standalone/dashboard/.next/static/chunks/app/dashboard/issues/page-b176cdca78e8145d.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9954],{1015:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(6748).A)("clock",[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]])},1422:(e,t,s)=>{"use strict";var a=s(2082);s.o(a,"usePathname")&&s.d(t,{usePathname:function(){return a.usePathname}}),s.o(a,"useRouter")&&s.d(t,{useRouter:function(){return a.useRouter}}),s.o(a,"useSearchParams")&&s.d(t,{useSearchParams:function(){return a.useSearchParams}})},1794:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(6748).A)("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},2283:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(6748).A)("circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]])},2362:(e,t,s)=>{Promise.resolve().then(s.bind(s,7545))},2771:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(6748).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"}]])},3183:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(6748).A)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},3203:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(6748).A)("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]])},3503:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(6748).A)("bug",[["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z",key:"uouzyp"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M21 21a4 4 0 0 0-3.81-4",key:"1b0z45"}],["path",{d:"M21 5a4 4 0 0 1-3.55 3.97",key:"5cxbf6"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M3 21a4 4 0 0 1 3.81-4",key:"1fjd4g"}],["path",{d:"M3 5a4 4 0 0 0 3.55 3.97",key:"1d7oge"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M9 7.13V6a3 3 0 1 1 6 0v1.13",key:"1vgav8"}]])},4545:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(6748).A)("brain",[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]])},4811:(e,t,s)=>{"use strict";s.d(t,{p:()=>i});var a=s(2638),r=s(6702);function i({icon:e,heading:t,description:s,action:i}){return(0,a.jsx)("div",{className:"rounded-2xl border-2 border-dashed border-zinc-300 bg-zinc-50 p-8 text-center dark:border-zinc-700 dark:bg-zinc-900/50",children:(0,a.jsxs)("div",{className:"mx-auto max-w-lg space-y-4",children:[(0,a.jsx)("div",{className:"mx-auto flex h-12 w-12 items-center justify-center rounded-full bg-zinc-900 text-white dark:bg-zinc-100 dark:text-zinc-900",children:r.isValidElement(e)?r.cloneElement(e,{className:"h-6 w-6"}):e}),(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)("h3",{className:"text-lg font-bold text-zinc-900 dark:text-zinc-50",children:t}),(0,a.jsx)("p",{className:"text-sm text-zinc-600 dark:text-zinc-400",children:s})]}),i&&(0,a.jsx)("button",{onClick:i.onClick,className:"mt-4 inline-flex items-center gap-2 rounded-lg bg-zinc-900 px-4 py-2 text-sm font-medium text-white hover:bg-zinc-800 dark:bg-zinc-100 dark:text-zinc-900 dark:hover:bg-zinc-200",children:i.label})]})})}},5050:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(6748).A)("square-check-big",[["path",{d:"M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344",key:"2acyp4"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]])},5789:(e,t,s)=>{"use strict";s.d(t,{T:()=>i});var a=s(2638),r=s(8360);function i({isOpen:e,onClose:t,onConfirm:s,title:i,message:n,confirmText:c="Delete",cancelText:l="Cancel",variant:d="danger"}){return e?(0,a.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",children:(0,a.jsxs)("div",{className:"w-full max-w-md rounded-xl border border-zinc-200 bg-white p-6 shadow-xl dark:border-zinc-800 dark:bg-zinc-900",children:[(0,a.jsxs)("div",{className:"flex items-start gap-4",children:[(0,a.jsx)("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-full bg-red-100 dark:bg-red-900/30",children:(0,a.jsx)(r.A,{className:"h-5 w-5 text-red-600 dark:text-red-400"})}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold text-zinc-900 dark:text-zinc-50",children:i}),(0,a.jsx)("p",{className:"mt-2 text-sm text-zinc-600 dark:text-zinc-400 whitespace-pre-wrap",children:n})]})]}),(0,a.jsxs)("div",{className:"mt-6 flex justify-end gap-3",children:[(0,a.jsx)("button",{onClick:t,className:"rounded-lg border border-zinc-300 px-4 py-2 text-sm font-medium text-zinc-700 transition-colors hover:bg-zinc-50 dark:border-zinc-700 dark:text-zinc-300 dark:hover:bg-zinc-800",children:l}),(0,a.jsx)("button",{onClick:()=>{s(),t()},className:`rounded-lg px-4 py-2 text-sm font-medium text-white transition-colors ${(()=>{switch(d){case"danger":default:return"bg-red-600 hover:bg-red-700 dark:bg-red-600 dark:hover:bg-red-700";case"warning":return"bg-amber-600 hover:bg-amber-700 dark:bg-amber-600 dark:hover:bg-amber-700";case"info":return"bg-blue-600 hover:bg-blue-700 dark:bg-blue-600 dark:hover:bg-blue-700"}})()}`,children:c})]})]})}):null}},5804:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(6748).A)("sparkles",[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]])},6539:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(6748).A)("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]])},7058:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(6748).A)("wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]])},7069:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(6748).A)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])},7545:(e,t,s)=>{"use strict";s.d(t,{IssuesClient:()=>Q});var a=s(2638),r=s(6702),i=s(7787),n=s(2283),c=s(8360),l=s(1794),d=s(6748);let o=(0,d.A)("pause",[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]]);var x=s(5050),p=s(3503),h=s(5804),u=s(9349),m=s(7058),b=s(8317),z=s(737),k=s(7609),j=s(3183),g=s(7069),v=s(7653);let f=(0,d.A)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);var y=s(2771),N=s(592),w=s(4545),_=s(3203),A=s(8702);let C=(0,d.A)("lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);var S=s(1015),P=s(6539),M=s(6253),E=s.n(M),$=s(6738),T=s(3831),D=s(1422),O=s(5789),F=s(4811);function L({completed:e,total:t,size:s=16,strokeWidth:r=2,className:i=""}){if(0===t)return null;let n=t>0?e/t*100:0,c=e===t,l=(s-r)/2,d=2*Math.PI*l,o=c?"stroke-emerald-500":e>0?"stroke-blue-500":"stroke-zinc-300 dark:stroke-zinc-600";return(0,a.jsxs)("div",{className:`flex items-center gap-1.5 ${i}`,children:[(0,a.jsxs)("svg",{width:s,height:s,className:"transform -rotate-90",children:[(0,a.jsx)("circle",{cx:s/2,cy:s/2,r:l,fill:"none",strokeWidth:r,className:"stroke-zinc-200 dark:stroke-zinc-700"}),(0,a.jsx)("circle",{cx:s/2,cy:s/2,r:l,fill:"none",strokeWidth:r,strokeLinecap:"round",strokeDasharray:d,strokeDashoffset:d-n/100*d,className:`${o} transition-all duration-300`})]}),(0,a.jsxs)("span",{className:`text-xs tabular-nums ${c?"text-emerald-600 dark:text-emerald-400":"text-zinc-500"}`,children:[e,"/",t]})]})}function I({priority:e,className:t=""}){let s=4===e?"fill-orange-500":"fill-zinc-500 dark:fill-zinc-400",r="fill-zinc-200 dark:fill-zinc-700";return(0,a.jsxs)("svg",{className:`h-4 w-4 ${t}`,viewBox:"0 0 16 16",fill:"none",children:[(0,a.jsx)("rect",{x:"3",y:"2",width:"10",height:"2",rx:"0.5",className:e>=4?s:r}),(0,a.jsx)("rect",{x:"3",y:"5.5",width:"10",height:"2",rx:"0.5",className:e>=3?s:r}),(0,a.jsx)("rect",{x:"3",y:"9",width:"10",height:"2",rx:"0.5",className:e>=2?s:r}),(0,a.jsx)("rect",{x:"3",y:"12.5",width:"10",height:"2",rx:"0.5",className:e>=1?s:r})]})}let R=[{value:"open",label:"Open",icon:(0,a.jsx)(n.A,{className:"h-4 w-4",strokeWidth:2}),color:"text-zinc-400"},{value:"in_progress",label:"In Progress",icon:(0,a.jsx)("div",{className:"h-4 w-4 rounded-full border-2 border-yellow-500 border-r-transparent"}),color:"text-yellow-500"},{value:"blocked",label:"Blocked",icon:(0,a.jsx)(c.A,{className:"h-4 w-4"}),color:"text-red-500"},{value:"closed",label:"Closed",icon:(0,a.jsx)(l.A,{className:"h-4 w-4"}),color:"text-blue-500"},{value:"deferred",label:"Deferred",icon:(0,a.jsx)(o,{className:"h-4 w-4"}),color:"text-zinc-400"}],B=Object.fromEntries(R.map(e=>[e.value,e])),q=R[0],H=[{value:0,label:"No priority"},{value:4,label:"Urgent"},{value:3,label:"High"},{value:2,label:"Medium"},{value:1,label:"Low"}],U=[{value:"task",label:"Task",icon:(0,a.jsx)(x.A,{className:"h-4 w-4"}),color:"text-zinc-400"},{value:"bug",label:"Bug",icon:(0,a.jsx)(p.A,{className:"h-4 w-4"}),color:"text-red-500"},{value:"feature",label:"Feature",icon:(0,a.jsx)(h.A,{className:"h-4 w-4"}),color:"text-violet-500"},{value:"epic",label:"Epic",icon:(0,a.jsx)(u.A,{className:"h-4 w-4"}),color:"text-indigo-500"},{value:"chore",label:"Chore",icon:(0,a.jsx)(m.A,{className:"h-4 w-4"}),color:"text-zinc-400"}],V=Object.fromEntries(U.map(e=>[e.value,e]));function K({trigger:e,options:t,value:s,onChange:n,renderOption:c,className:l=""}){let[d,o]=(0,r.useState)(!1),[x,p]=(0,r.useState)(!1),[h,u]=(0,r.useState)({top:0,left:0}),m=(0,r.useRef)(null),z=(0,r.useRef)(null);(0,r.useEffect)(()=>{p(!0)},[]),(0,r.useEffect)(()=>{if(d&&m.current){let e=m.current.getBoundingClientRect(),t=window.innerHeight-e.bottom,s=e.top;u({top:t<200&&s>t?e.top+window.scrollY-200-4:e.bottom+window.scrollY+4,left:e.left+window.scrollX})}},[d]),(0,r.useEffect)(()=>{function e(e){let t=e.target;m.current&&!m.current.contains(t)&&z.current&&!z.current.contains(t)&&o(!1)}return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);let k=d&&x&&(0,a.jsx)("div",{ref:z,className:"fixed z-99999 min-w-[200px] rounded-lg border border-zinc-200 bg-white py-1 shadow-lg dark:border-zinc-700 dark:bg-zinc-800",style:{top:h.top,left:h.left},children:t.map(e=>(0,a.jsxs)("button",{onClick:t=>{t.stopPropagation(),n(e.value),o(!1)},className:"w-full px-3 py-1.5 text-left text-sm hover:bg-zinc-100 dark:hover:bg-zinc-700 flex items-center justify-between",children:[c(e,e.value===s),e.value===s&&(0,a.jsx)(b.A,{className:"h-4 w-4 text-zinc-500"})]},String(e.value)))});return(0,a.jsxs)("div",{className:`relative ${l}`,children:[(0,a.jsx)("button",{ref:m,onClick:e=>{e.stopPropagation(),o(!d)},className:"flex items-center",children:e}),x&&(0,i.createPortal)(k,document.body)]})}function J({value:e,onChange:t,size:s="sm"}){let r=B[e]||q;return(0,a.jsx)(K,{trigger:(0,a.jsx)("span",{className:`${r.color} hover:opacity-70 transition-opacity`,children:"sm"===s?(0,a.jsx)("span",{className:"sm"===s?"h-[14px] w-[14px]":"h-4 w-4",children:r.icon}):(0,a.jsxs)("span",{className:`flex items-center gap-1.5 px-2 py-1 rounded-md border border-zinc-200 dark:border-zinc-700 hover:bg-zinc-50 dark:hover:bg-zinc-800 ${r.color}`,children:[r.icon,(0,a.jsx)("span",{className:"text-sm",children:r.label}),(0,a.jsx)(z.A,{className:"h-3 w-3 ml-1 text-zinc-400"})]})}),options:R,value:e,onChange:t,renderOption:e=>{let t=B[e.value]||q;return(0,a.jsxs)("span",{className:`flex items-center gap-2 ${t.color}`,children:[t.icon,(0,a.jsx)("span",{children:e.label})]})}})}function Y({value:e,onChange:t,size:s="sm"}){let r=H.find(t=>t.value===e)?.label||"No priority";return(0,a.jsx)(K,{trigger:"sm"===s?(0,a.jsx)("span",{className:"hover:opacity-70 transition-opacity",children:(0,a.jsx)(I,{priority:e})}):(0,a.jsxs)("span",{className:"flex items-center gap-1.5 px-2 py-1 rounded-md border border-zinc-200 dark:border-zinc-700 hover:bg-zinc-50 dark:hover:bg-zinc-800 text-zinc-700 dark:text-zinc-300",children:[(0,a.jsx)(I,{priority:e}),(0,a.jsx)("span",{className:"text-sm",children:r}),(0,a.jsx)(z.A,{className:"h-3 w-3 ml-1 text-zinc-400"})]}),options:H,value:e,onChange:t,renderOption:e=>(0,a.jsxs)("span",{className:"flex items-center gap-2",children:[(0,a.jsx)(I,{priority:e.value}),(0,a.jsx)("span",{className:4===e.value?"text-orange-500":"",children:e.label})]})})}function W({value:e,onChange:t}){let s=V[e]||U[0];return(0,a.jsx)(K,{trigger:(0,a.jsxs)("span",{className:`flex items-center gap-1.5 px-2 py-1 rounded-md border border-zinc-200 dark:border-zinc-700 hover:bg-zinc-50 dark:hover:bg-zinc-800 ${s.color}`,children:[s.icon,(0,a.jsx)("span",{className:"text-sm",children:s.label}),(0,a.jsx)(z.A,{className:"h-3 w-3 ml-1 text-zinc-400"})]}),options:U,value:e,onChange:t,renderOption:e=>{let t=V[e.value];return(0,a.jsxs)("span",{className:`flex items-center gap-2 ${t?.color}`,children:[t?.icon,(0,a.jsx)("span",{children:e.label})]})}})}function X({value:e,onChange:t,projects:s}){let r=s.map(e=>({value:e.project_path,label:e.name||e.project_path.split("/").pop()||e.project_path})),i=r.find(t=>t.value===e)?.label||"Project";return(0,a.jsx)(K,{trigger:(0,a.jsxs)("span",{className:"flex items-center gap-1.5 px-2 py-1 rounded-md border border-zinc-200 dark:border-zinc-700 hover:bg-zinc-50 dark:hover:bg-zinc-800 text-zinc-700 dark:text-zinc-300 whitespace-nowrap",children:[(0,a.jsx)(k.A,{className:"h-4 w-4 shrink-0"}),(0,a.jsx)("span",{className:"text-sm truncate max-w-[150px]",children:i}),(0,a.jsx)(z.A,{className:"h-3 w-3 ml-1 text-zinc-400 shrink-0"})]}),options:r,value:e,onChange:t,renderOption:e=>(0,a.jsxs)("span",{className:"flex items-center gap-2 whitespace-nowrap",children:[(0,a.jsx)(k.A,{className:"h-4 w-4 text-zinc-400 shrink-0"}),(0,a.jsx)("span",{className:"truncate",children:e.label})]})})}function Z({projects:e,currentProjectPath:t,additionalPaths:s,onAdd:r}){let i=new Set([t,...s]),n=e.filter(e=>!i.has(e.project_path));if(0===n.length)return null;let c=n.map(e=>({value:e.project_path,label:e.name||e.project_path.split("/").pop()||e.project_path}));return(0,a.jsx)(K,{trigger:(0,a.jsxs)("span",{className:"flex items-center gap-1 px-2 py-1 rounded-md border border-dashed border-zinc-300 dark:border-zinc-600 hover:bg-zinc-50 dark:hover:bg-zinc-800 text-zinc-500 dark:text-zinc-400 text-sm",children:[(0,a.jsx)(j.A,{className:"h-3.5 w-3.5"}),(0,a.jsx)("span",{children:"Add"})]}),options:c,value:"",onChange:r,renderOption:e=>(0,a.jsxs)("span",{className:"flex items-center gap-2 whitespace-nowrap",children:[(0,a.jsx)(k.A,{className:"h-4 w-4 text-zinc-400 shrink-0"}),(0,a.jsx)("span",{className:"truncate",children:e.label})]})})}function G({issue:e,typeConfig:t,onClose:s,onUpdate:i,onSubtaskCreated:c,projects:d}){let[o,x]=(0,r.useState)(!1),[p,h]=(0,r.useState)(!1),[u,m]=(0,r.useState)(!1),[b,P]=(0,r.useState)(e.title),[M,D]=(0,r.useState)(e.description||""),[F,I]=(0,r.useState)(e.details||""),[R,B]=(0,r.useState)(!1),[q,H]=(0,r.useState)(""),[U,V]=(0,r.useState)([]),[K,W]=(0,r.useState)(!1),[G,Q]=(0,r.useState)(!1),[ee,et]=(0,r.useState)([]),[es,ea]=(0,r.useState)(null),[er,ei]=(0,r.useState)(null),[en,ec]=(0,r.useState)(""),[el,ed]=(0,r.useState)(null),[eo,ex]=(0,r.useState)(!1),[ep,eh]=(0,r.useState)({}),[eu,em]=(0,r.useState)({}),[eb,ez]=(0,r.useState)(null),[ek,ej]=(0,r.useState)(""),[eg,ev]=(0,r.useState)(!1),[ef,ey]=(0,r.useState)(null),[eN,ew]=(0,r.useState)(!1),[e_,eA]=(0,r.useState)([]),[eC,eS]=(0,r.useState)(null),[eP,eM]=(0,r.useState)(!1),[eE,e$]=(0,r.useState)([]),[eT,eD]=(0,r.useState)(!1),[eO,eF]=(0,r.useState)(!1),[eL,eI]=(0,r.useState)(!1);(0,r.useEffect)(()=>{P(e.title),D(e.description||""),I(e.details||"")},[e.title,e.description,e.details]);let eR=async(t,s)=>{V(e=>e.map(e=>e.id===t?{...e,...s}:e));try{if(!(await fetch("/api/issues/update",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:t,...s})})).ok){let t=await fetch(`/api/issues/subtasks?parentId=${e.id}`),s=await t.json();s.success&&V(s.issues||[])}}catch(e){console.error("Failed to update subtask:",e)}},eB=(e,t,s)=>{ei({id:e,field:t}),ec(s||"")},eq=()=>{if(!er)return;let{id:e,field:t}=er;eR(e,{[t]:en}),ei(null),ec("")},eH=async()=>{if(el)try{let e=new URLSearchParams({id:el});(await fetch(`/api/issues/delete?${e}`,{method:"DELETE"})).ok&&(V(e=>e.filter(e=>e.id!==el)),ex(!1),ed(null),c())}catch(e){console.error("Failed to delete subtask:",e)}},eU=async()=>{if(ef)try{let e=new URLSearchParams({id:ef.id});(await fetch(`/api/issues/delete?${e}`,{method:"DELETE"})).ok&&(eh(e=>({...e,[ef.parentId]:e[ef.parentId].filter(e=>e.id!==ef.id)})),ew(!1),ey(null),c())}catch(e){console.error("Failed to delete child:",e)}};(0,r.useEffect)(()=>{!async function(){W(!0);try{let t=await fetch(`/api/issues/subtasks?parentId=${e.id}`),s=await t.json();s.success&&V(s.issues||[])}catch(e){console.error("Failed to load subtasks:",e)}finally{W(!1)}}()},[e.id]),(0,r.useEffect)(()=>{!async function(){if(!es)return;let e=U.find(e=>e.id===es);if(e&&0!==(e.child_count||0)&&!ep[es]){em(e=>({...e,[es]:!0}));try{let e=await fetch(`/api/issues/subtasks?parentId=${es}`),t=await e.json();t.success&&eh(e=>({...e,[es]:t.issues||[]}))}catch(e){console.error("Failed to load sub-subtasks:",e)}finally{em(e=>({...e,[es]:!1}))}}}()},[es,U]),(0,r.useEffect)(()=>{!async function(){if(!e.plan_id)return eS(null);eM(!0);try{let t=await fetch(`/api/plans/${e.plan_id}`),s=await t.json();s.success&&eS(s.plan)}catch(e){console.error("Failed to load plan:",e)}finally{eM(!1)}}()},[e.plan_id]),(0,r.useEffect)(()=>{!async function(){if(eO&&e.project_path){eD(!0);try{let t=await fetch(`/api/memory/list?projectPath=${encodeURIComponent(e.project_path)}`),s=await t.json();s.success&&e$(s.memories||[])}catch(e){console.error("Failed to load memories:",e)}finally{eD(!1)}}}()},[eO,e.project_path]);let eV=async()=>{if(q.trim()){Q(!0);try{if((await fetch("/api/issues/create",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectPath:e.project_path,title:q.trim(),parentId:e.id,status:"open",priority:0,issueType:"task",dependsOn:ee.length>0?ee:void 0})})).ok){H(""),B(!1),et([]);let t=await fetch(`/api/issues/subtasks?parentId=${e.id}`),s=await t.json();s.success&&V(s.issues||[]),c()}}catch(e){console.error("Failed to create subtask:",e)}finally{Q(!1)}}},eK=async t=>{if(ek.trim()){ev(!0);try{if((await fetch("/api/issues/create",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectPath:e.project_path,title:ek.trim(),parentId:t,status:"open",priority:0,issueType:"task",dependsOn:e_.length>0?e_:void 0})})).ok){ej(""),ez(null),eA([]);let e=await fetch(`/api/issues/subtasks?parentId=${t}`),s=await e.json();s.success&&eh(e=>({...e,[t]:s.issues||[]})),c()}}catch(e){console.error("Failed to create subtask:",e)}finally{ev(!1)}}},eJ=()=>{b.trim()&&b!==e.title&&i({title:b.trim()}),x(!1)};return(0,a.jsxs)("div",{className:"rounded-lg border border-zinc-200 dark:border-zinc-800 bg-white dark:bg-zinc-900 p-6 space-y-6",children:[(0,a.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,a.jsxs)("div",{className:"space-y-1 min-w-0 flex-1",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 text-xs text-zinc-400",children:[(0,a.jsx)("span",{className:"font-mono",children:e.short_id||e.id.slice(0,6)}),(0,a.jsx)("span",{children:"\xb7"}),(0,a.jsx)("span",{className:t.color,children:t.label})]}),o?(0,a.jsx)("input",{type:"text",value:b,onChange:e=>P(e.target.value),onBlur:eJ,onKeyDown:t=>{"Enter"===t.key&&eJ(),"Escape"===t.key&&(P(e.title),x(!1))},autoFocus:!0,className:"w-full text-lg font-semibold text-zinc-900 dark:text-zinc-100 bg-transparent border-b border-zinc-300 dark:border-zinc-600 outline-none focus:border-zinc-500"}):(0,a.jsx)("h2",{onClick:()=>x(!0),className:"text-lg font-semibold text-zinc-900 dark:text-zinc-100 cursor-text hover:bg-zinc-50 dark:hover:bg-zinc-800 rounded px-1 -mx-1",children:e.title})]}),(0,a.jsx)("button",{onClick:s,className:"p-1 rounded text-zinc-400 hover:text-zinc-600 hover:bg-zinc-100 dark:hover:text-zinc-300 dark:hover:bg-zinc-700",children:(0,a.jsx)(g.A,{className:"h-4 w-4"})})]}),(eC||e.parent)&&(0,a.jsxs)("div",{className:"flex items-center gap-1 text-xs text-zinc-500 dark:text-zinc-400 bg-zinc-50 dark:bg-zinc-800/50 rounded-lg px-3 py-2",children:[(0,a.jsx)(v.A,{className:"h-3.5 w-3.5 text-zinc-400"}),(0,a.jsx)("span",{className:"text-zinc-400",children:e.project_path?.split("/").pop()}),eC&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(f,{className:"h-3 w-3 text-zinc-300"}),(0,a.jsxs)(E(),{href:`/dashboard/plans?id=${eC.id}`,className:"flex items-center gap-1 hover:text-zinc-700 dark:hover:text-zinc-200",children:[(0,a.jsx)(y.A,{className:"h-3.5 w-3.5"}),eC.title]})]}),e.parent&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(f,{className:"h-3 w-3 text-zinc-300"}),(0,a.jsxs)("span",{className:"text-zinc-500 dark:text-zinc-400",children:["Subtask of ",e.parent.title]})]})]}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,a.jsx)(J,{value:e.status,onChange:e=>i({status:e}),size:"md"}),(0,a.jsx)(Y,{value:e.priority,onChange:e=>i({priority:e}),size:"md"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-xs text-zinc-400 mb-2 block",children:"Projects"}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-2 items-center",children:[(0,a.jsx)(X,{value:e.project_path,onChange:e=>i({project_path:e}),projects:d}),e.additional_project_paths&&e.additional_project_paths.length>0&&e.additional_project_paths.map(e=>(0,a.jsxs)("span",{className:"flex items-center gap-1.5 px-2 py-1 rounded-md border border-zinc-200 dark:border-zinc-700 hover:bg-zinc-50 dark:hover:bg-zinc-800 text-zinc-700 dark:text-zinc-300 text-sm",children:[(0,a.jsx)(k.A,{className:"h-4 w-4 text-zinc-400 shrink-0"}),(0,a.jsx)("span",{className:"truncate max-w-[150px]",children:e.split("/").pop()}),(0,a.jsx)("button",{onClick:()=>i({remove_project_path:e}),className:"text-zinc-400 hover:text-red-500",title:"Remove from issue",children:(0,a.jsx)(g.A,{className:"h-3.5 w-3.5"})})]},e)),(0,a.jsx)(Z,{projects:d,currentProjectPath:e.project_path,additionalPaths:e.additional_project_paths||[],onAdd:e=>i({add_project_path:e})})]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-xs text-zinc-400",children:"Description"}),p?(0,a.jsx)("textarea",{value:M,onChange:e=>D(e.target.value),onBlur:()=>{M!==(e.description||"")&&i({description:M}),h(!1)},onKeyDown:t=>{"Escape"===t.key&&(D(e.description||""),h(!1))},autoFocus:!0,rows:4,className:"w-full mt-1 text-sm text-zinc-600 dark:text-zinc-400 bg-transparent border border-zinc-200 dark:border-zinc-700 rounded-md p-2 outline-none focus:border-zinc-400 resize-none",placeholder:"Add a description..."}):(0,a.jsx)("div",{onClick:()=>h(!0),className:"mt-1 text-sm cursor-text hover:bg-zinc-50 dark:hover:bg-zinc-800 rounded px-2 py-1 -mx-2 min-h-8",children:e.description?(0,a.jsx)("div",{className:"prose prose-sm prose-zinc dark:prose-invert max-w-none text-zinc-600 dark:text-zinc-400 [&_pre]:overflow-x-auto [&_pre]:bg-zinc-100 [&_pre]:dark:bg-zinc-800 [&_pre]:text-zinc-800 [&_pre]:dark:text-zinc-200 [&_pre]:p-3 [&_pre]:rounded-lg [&_code]:bg-zinc-100 [&_code]:dark:bg-zinc-800 [&_code]:text-zinc-800 [&_code]:dark:text-zinc-200 [&_code]:px-1 [&_code]:py-0.5 [&_code]:rounded [&_code]:text-xs",children:(0,a.jsx)($.oz,{remarkPlugins:[T.A],children:e.description})}):(0,a.jsx)("p",{className:"text-zinc-400 italic",children:"Add a description..."})})]}),(0,a.jsxs)("div",{className:"border-t border-zinc-100 dark:border-zinc-800 pt-4",children:[(0,a.jsxs)("button",{onClick:()=>eI(!eL),className:"flex items-center gap-2 text-xs text-zinc-500 hover:text-zinc-700 dark:hover:text-zinc-300 w-full",children:[(0,a.jsx)(y.A,{className:"h-3.5 w-3.5"}),(0,a.jsx)("span",{children:"Implementation Details"}),e.details&&(0,a.jsxs)("span",{className:"text-zinc-400",children:["(",e.details.length," chars)"]}),(0,a.jsx)(z.A,{className:`h-3 w-3 ml-auto transition-transform ${eL?"rotate-180":""}`})]}),eL&&(0,a.jsx)("div",{className:"mt-3",children:u?(0,a.jsx)("textarea",{value:F,onChange:e=>I(e.target.value),onBlur:()=>{F!==(e.details||"")&&i({details:F}),m(!1)},onKeyDown:t=>{"Escape"===t.key&&(I(e.details||""),m(!1))},autoFocus:!0,rows:6,className:"w-full text-sm text-zinc-600 dark:text-zinc-400 bg-transparent border border-zinc-200 dark:border-zinc-700 rounded-md p-2 outline-none focus:border-zinc-400 resize-none font-mono",placeholder:"Add implementation details..."}):(0,a.jsx)("div",{onClick:()=>m(!0),className:"text-sm cursor-text hover:bg-zinc-50 dark:hover:bg-zinc-800 rounded px-2 py-1 -mx-2 min-h-8",children:e.details?(0,a.jsx)("div",{className:"prose prose-sm prose-zinc dark:prose-invert max-w-none text-zinc-600 dark:text-zinc-400 [&_pre]:overflow-x-auto [&_pre]:bg-zinc-100 [&_pre]:dark:bg-zinc-800 [&_pre]:text-zinc-800 [&_pre]:dark:text-zinc-200 [&_pre]:p-3 [&_pre]:rounded-lg [&_code]:bg-zinc-100 [&_code]:dark:bg-zinc-800 [&_code]:text-zinc-800 [&_code]:dark:text-zinc-200 [&_code]:px-1 [&_code]:py-0.5 [&_code]:rounded [&_code]:text-xs",children:(0,a.jsx)($.oz,{remarkPlugins:[T.A],children:e.details})}):(0,a.jsx)("p",{className:"text-zinc-400 italic",children:"Add implementation details..."})})})]}),(0,a.jsxs)("div",{className:"border-t border-zinc-100 dark:border-zinc-800 pt-4",children:[U.length>0&&(0,a.jsx)("div",{className:"mb-3 space-y-1",children:U.map(e=>{let t=es===e.id;return(0,a.jsxs)("div",{className:"group/subtask border border-zinc-100 dark:border-zinc-800 rounded-lg overflow-hidden",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 py-2 px-3 hover:bg-zinc-50 dark:hover:bg-zinc-800/50 cursor-pointer",onClick:()=>ea(t?null:e.id),children:[(0,a.jsx)("div",{onClick:e=>e.stopPropagation(),children:(0,a.jsx)(J,{value:e.status,onChange:t=>eR(e.id,{status:t}),size:"sm"})}),(0,a.jsx)("span",{className:"font-mono text-xs text-zinc-400",children:e.short_id}),(0,a.jsx)("span",{className:`text-sm flex-1 ${"closed"===e.status?"text-zinc-400 line-through":"text-zinc-700 dark:text-zinc-300"}`,children:e.title}),(0,a.jsx)(L,{completed:e.completed_count||0,total:e.child_count||0}),(0,a.jsx)("button",{onClick:t=>{t.stopPropagation(),ed(e.id),ex(!0)},className:"p-1 rounded text-zinc-400 hover:text-red-500 hover:bg-red-50 dark:hover:bg-red-900/20 opacity-0 group-hover/subtask:opacity-100 transition-opacity",children:(0,a.jsx)(N.A,{className:"h-3.5 w-3.5"})}),(0,a.jsx)(z.A,{className:`h-4 w-4 text-zinc-400 transition-transform ${t?"rotate-180":""}`})]}),t&&(0,a.jsxs)("div",{className:"px-3 pb-3 pt-1 space-y-3 border-t border-zinc-100 dark:border-zinc-800 bg-zinc-50/50 dark:bg-zinc-800/30",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-xs text-zinc-400",children:"Title"}),er?.id===e.id&&"title"===er.field?(0,a.jsx)("input",{type:"text",value:en,onChange:e=>ec(e.target.value),onBlur:eq,onKeyDown:e=>{"Enter"===e.key&&eq(),"Escape"===e.key&&(ei(null),ec(""))},autoFocus:!0,className:"w-full mt-1 text-sm font-medium text-zinc-900 dark:text-zinc-100 bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-700 rounded px-2 py-1 outline-none focus:border-zinc-400"}):(0,a.jsx)("p",{onClick:()=>eB(e.id,"title",e.title),className:"mt-1 text-sm font-medium text-zinc-900 dark:text-zinc-100 cursor-text hover:bg-white dark:hover:bg-zinc-800 rounded px-2 py-1 -mx-2",children:e.title})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"text-xs text-zinc-400",children:"Priority"}),(0,a.jsx)(Y,{value:e.priority,onChange:t=>eR(e.id,{priority:t}),size:"sm"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-xs text-zinc-400",children:"Description"}),er?.id===e.id&&"description"===er.field?(0,a.jsx)("textarea",{value:en,onChange:e=>ec(e.target.value),onBlur:eq,onKeyDown:e=>{"Escape"===e.key&&(ei(null),ec(""))},autoFocus:!0,rows:2,className:"w-full mt-1 text-sm text-zinc-600 dark:text-zinc-400 bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-700 rounded px-2 py-1 outline-none focus:border-zinc-400 resize-none",placeholder:"Add description..."}):(0,a.jsx)("div",{onClick:()=>eB(e.id,"description",e.description||""),className:"mt-1 text-sm cursor-text hover:bg-white dark:hover:bg-zinc-800 rounded px-2 py-1 -mx-2 min-h-6",children:e.description?(0,a.jsx)("div",{className:"prose prose-sm prose-zinc dark:prose-invert max-w-none text-zinc-600 dark:text-zinc-400 [&_pre]:overflow-x-auto [&_pre]:bg-zinc-100 [&_pre]:dark:bg-zinc-800 [&_pre]:text-zinc-800 [&_pre]:dark:text-zinc-200 [&_pre]:p-3 [&_pre]:rounded-lg [&_code]:bg-zinc-100 [&_code]:dark:bg-zinc-800 [&_code]:text-zinc-800 [&_code]:dark:text-zinc-200 [&_code]:px-1 [&_code]:py-0.5 [&_code]:rounded [&_code]:text-xs",children:(0,a.jsx)($.oz,{remarkPlugins:[T.A],children:e.description})}):(0,a.jsx)("span",{className:"italic text-zinc-400",children:"Add description..."})})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-xs text-zinc-400",children:"Details"}),er?.id===e.id&&"details"===er.field?(0,a.jsx)("textarea",{value:en,onChange:e=>ec(e.target.value),onBlur:eq,onKeyDown:e=>{"Escape"===e.key&&(ei(null),ec(""))},autoFocus:!0,rows:3,className:"w-full mt-1 text-sm text-zinc-600 dark:text-zinc-400 bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-700 rounded px-2 py-1 outline-none focus:border-zinc-400 resize-none font-mono",placeholder:"Add implementation details..."}):(0,a.jsx)("div",{onClick:()=>eB(e.id,"details",e.details||""),className:"mt-1 text-sm cursor-text hover:bg-white dark:hover:bg-zinc-800 rounded px-2 py-1 -mx-2 min-h-6",children:e.details?(0,a.jsx)("div",{className:"prose prose-sm prose-zinc dark:prose-invert max-w-none text-zinc-600 dark:text-zinc-400 [&_pre]:overflow-x-auto [&_pre]:bg-zinc-100 [&_pre]:dark:bg-zinc-800 [&_pre]:text-zinc-800 [&_pre]:dark:text-zinc-200 [&_pre]:p-3 [&_pre]:rounded-lg [&_code]:bg-zinc-100 [&_code]:dark:bg-zinc-800 [&_code]:text-zinc-800 [&_code]:dark:text-zinc-200 [&_code]:px-1 [&_code]:py-0.5 [&_code]:rounded [&_code]:text-xs",children:(0,a.jsx)($.oz,{remarkPlugins:[T.A],children:e.details})}):(0,a.jsx)("span",{className:"italic text-zinc-400",children:"Add implementation details..."})})]}),(0,a.jsxs)("div",{className:"border-t border-zinc-200 dark:border-zinc-700 pt-3 mt-3",children:[(e.child_count||0)>0&&(0,a.jsxs)("span",{className:"text-xs text-zinc-400 font-medium",children:["Subtasks (",e.child_count,")"]}),eu[e.id]?(0,a.jsx)("p",{className:"text-xs text-zinc-400 mt-2",children:"Loading..."}):ep[e.id]?.length>0?(0,a.jsx)("div",{className:"mt-2 space-y-1",children:ep[e.id].map(t=>(0,a.jsxs)("div",{className:"group/child flex items-center gap-2 py-1.5 px-2 rounded hover:bg-white dark:hover:bg-zinc-800",children:[(0,a.jsx)(J,{value:t.status,onChange:s=>{eh(a=>({...a,[e.id]:a[e.id].map(e=>e.id===t.id?{...e,status:s}:e)})),eR(t.id,{status:s})},size:"sm"}),(0,a.jsx)("span",{className:"font-mono text-xs text-zinc-400",children:t.short_id}),(0,a.jsx)("span",{className:`text-xs flex-1 ${"closed"===t.status?"text-zinc-400 line-through":"text-zinc-600 dark:text-zinc-300"}`,children:t.title}),(0,a.jsx)("button",{onClick:s=>{s.stopPropagation(),ey({id:t.id,parentId:e.id}),ew(!0)},className:"p-1 rounded text-zinc-400 hover:text-red-500 hover:bg-red-50 dark:hover:bg-red-900/20 opacity-0 group-hover/child:opacity-100 transition-opacity",children:(0,a.jsx)(N.A,{className:"h-3 w-3"})})]},t.id))}):null,eb===e.id?(0,a.jsxs)("div",{className:"mt-2 space-y-2",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(n.A,{className:"h-3.5 w-3.5 text-zinc-300 shrink-0"}),(0,a.jsx)("input",{type:"text",value:ek,onChange:e=>ej(e.target.value),onKeyDown:t=>{"Enter"===t.key&&ek.trim()&&eK(e.id),"Escape"===t.key&&(ej(""),ez(null),eA([]))},placeholder:"Subtask title",autoFocus:!0,className:"flex-1 text-xs bg-transparent border-b border-zinc-300 dark:border-zinc-600 outline-none text-zinc-900 dark:text-zinc-100 placeholder:text-zinc-400 py-1"})]}),ep[e.id]?.length>0&&(0,a.jsxs)("div",{className:"pl-5 space-y-1",children:[(0,a.jsx)("span",{className:"text-xs text-zinc-500",children:"Blocked by:"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-1",children:ep[e.id].filter(e=>"closed"!==e.status).map(e=>(0,a.jsx)("button",{type:"button",onClick:()=>{eA(t=>t.includes(e.id)?t.filter(t=>t!==e.id):[...t,e.id])},className:`px-1.5 py-0.5 text-xs rounded border transition-colors ${e_.includes(e.id)?"bg-amber-100 dark:bg-amber-900/30 border-amber-300 dark:border-amber-700 text-amber-700 dark:text-amber-400":"bg-zinc-50 dark:bg-zinc-800 border-zinc-200 dark:border-zinc-700 text-zinc-500 hover:border-zinc-300"}`,children:e.short_id},e.id))})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2 pl-5",children:[(0,a.jsx)("button",{onClick:()=>eK(e.id),disabled:!ek.trim()||eg,className:"px-2 py-0.5 text-xs rounded bg-zinc-900 dark:bg-zinc-100 text-white dark:text-zinc-900 disabled:opacity-50",children:eg?"...":"Add"}),(0,a.jsx)("button",{onClick:()=>{ej(""),ez(null),eA([])},className:"text-xs text-zinc-400 hover:text-zinc-600",children:"Cancel"})]})]}):(0,a.jsxs)("button",{onClick:()=>ez(e.id),className:"mt-2 flex items-center gap-1 text-xs text-zinc-500 hover:text-zinc-700 dark:hover:text-zinc-300",children:[(0,a.jsx)(j.A,{className:"h-3.5 w-3.5"}),"Add subtask"]})]})]})]},e.id)})}),R?(0,a.jsxs)("div",{className:"border border-zinc-200 dark:border-zinc-700 rounded-lg p-3 space-y-3",children:[(0,a.jsxs)("div",{className:"flex items-start gap-2",children:[(0,a.jsx)(n.A,{className:"h-4 w-4 text-zinc-300 mt-0.5 shrink-0"}),(0,a.jsx)("input",{type:"text",value:q,onChange:e=>H(e.target.value),onKeyDown:e=>{"Enter"===e.key&&q.trim()&&eV(),"Escape"===e.key&&(H(""),B(!1),et([]))},placeholder:"epic"===e.issue_type||"feature"===e.issue_type?"Task title":"Subtask title",autoFocus:!0,className:"flex-1 text-sm bg-transparent border-none outline-none text-zinc-900 dark:text-zinc-100 placeholder:text-zinc-400"})]}),U.length>0&&(0,a.jsxs)("div",{className:"space-y-1.5",children:[(0,a.jsx)("span",{className:"text-xs text-zinc-500",children:"Blocked by (optional):"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-1.5",children:U.filter(e=>"closed"!==e.status).map(e=>(0,a.jsx)("button",{type:"button",onClick:()=>{et(t=>t.includes(e.id)?t.filter(t=>t!==e.id):[...t,e.id])},className:`px-2 py-0.5 text-xs rounded border transition-colors ${ee.includes(e.id)?"bg-amber-100 dark:bg-amber-900/30 border-amber-300 dark:border-amber-700 text-amber-700 dark:text-amber-400":"bg-zinc-50 dark:bg-zinc-800 border-zinc-200 dark:border-zinc-700 text-zinc-600 dark:text-zinc-400 hover:border-zinc-300 dark:hover:border-zinc-600"}`,children:e.short_id},e.id))})]}),(0,a.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[(0,a.jsx)("button",{onClick:()=>{H(""),B(!1),et([])},className:"px-2 py-1 text-xs text-zinc-500 hover:text-zinc-700 dark:hover:text-zinc-300",children:"Cancel"}),(0,a.jsx)("button",{onClick:eV,disabled:!q.trim()||G,className:"px-3 py-1 text-xs rounded-md bg-zinc-900 dark:bg-zinc-100 text-white dark:text-zinc-900 hover:bg-zinc-800 dark:hover:bg-zinc-200 disabled:opacity-50",children:G?"Adding...":"epic"===e.issue_type||"feature"===e.issue_type?"Add task":"Add subtask"})]})]}):(0,a.jsxs)("button",{onClick:()=>B(!0),className:"flex items-center gap-1.5 text-sm text-zinc-500 hover:text-zinc-700 dark:hover:text-zinc-300",children:[(0,a.jsx)(j.A,{className:"h-4 w-4"}),"epic"===e.issue_type||"feature"===e.issue_type?"Add task":"Add subtask"]})]}),e.labels&&e.labels.length>0&&(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-xs text-zinc-400",children:"Labels"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-1.5 mt-2",children:e.labels.map(e=>(0,a.jsx)("span",{className:"inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-violet-100 text-violet-700 dark:bg-violet-900/30 dark:text-violet-400",children:e.label},e.id))})]}),e.dependencies&&e.dependencies.length>0&&(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-xs text-zinc-400",children:"Blocked by"}),(0,a.jsx)("div",{className:"mt-2 space-y-1",children:e.dependencies.map(e=>(0,a.jsxs)("div",{className:"flex items-center gap-2 text-sm text-zinc-600 dark:text-zinc-400",children:[(0,a.jsx)("span",{className:"font-mono text-xs text-zinc-400",children:e.dependsOnShortId||e.dependsOnId.slice(0,6)}),(0,a.jsx)("span",{children:e.dependsOnTitle})]},e.id))})]}),(0,a.jsxs)("div",{className:"border-t border-zinc-100 dark:border-zinc-800 pt-4",children:[(0,a.jsxs)("button",{onClick:()=>eF(!eO),className:"flex items-center gap-2 text-xs text-zinc-500 hover:text-zinc-700 dark:hover:text-zinc-300 w-full",children:[(0,a.jsx)(w.A,{className:"h-3.5 w-3.5"}),(0,a.jsx)("span",{children:"Project Memory"}),eE.length>0&&(0,a.jsxs)("span",{className:"text-zinc-400",children:["(",eE.length,")"]}),(0,a.jsx)(z.A,{className:`h-3 w-3 ml-auto transition-transform ${eO?"rotate-180":""}`})]}),eO&&(0,a.jsx)("div",{className:"mt-3 space-y-2",children:eT?(0,a.jsx)("p",{className:"text-xs text-zinc-400",children:"Loading..."}):0===eE.length?(0,a.jsx)("p",{className:"text-xs text-zinc-400 italic",children:"No memory items for this project"}):eE.map(e=>(0,a.jsxs)("div",{className:"flex items-start gap-2 text-xs",children:["command"===e.category&&(0,a.jsx)(_.A,{className:"h-3.5 w-3.5 text-emerald-500 mt-0.5 shrink-0"}),"config"===e.category&&(0,a.jsx)(A.A,{className:"h-3.5 w-3.5 text-blue-500 mt-0.5 shrink-0"}),"note"===e.category&&(0,a.jsx)(C,{className:"h-3.5 w-3.5 text-amber-500 mt-0.5 shrink-0"}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsx)("span",{className:"font-mono text-zinc-500 dark:text-zinc-400",children:e.key}),(0,a.jsx)("p",{className:"text-zinc-600 dark:text-zinc-400 wrap-break-word",children:e.value})]})]},e.id))})]}),(e.created_in_session||e.completed_in_session)&&(0,a.jsxs)("div",{className:"flex items-center gap-4 pt-4 border-t border-zinc-100 dark:border-zinc-800 text-xs text-zinc-400",children:[e.created_in_session&&(0,a.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,a.jsx)(S.A,{className:"h-3.5 w-3.5"}),"Created in session"]}),e.completed_in_session&&(0,a.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,a.jsx)(l.A,{className:"h-3.5 w-3.5 text-green-500"}),"Completed in session"]})]}),(0,a.jsx)(O.T,{isOpen:eo,onClose:()=>{ex(!1),ed(null)},onConfirm:eH,title:"Delete Subtask",message:"Are you sure you want to delete this subtask? This action cannot be undone.",confirmText:"Delete",cancelText:"Cancel",variant:"danger"}),(0,a.jsx)(O.T,{isOpen:eN,onClose:()=>{ew(!1),ey(null)},onConfirm:eU,title:"Delete Subtask",message:"Are you sure you want to delete this subtask? This action cannot be undone.",confirmText:"Delete",cancelText:"Cancel",variant:"danger"})]})}function Q({projects:e,initialProjectFilter:t,initialStatusFilter:s}){let i=(0,D.useRouter)(),n=(0,D.usePathname)(),c=(0,D.useSearchParams)(),[l,d]=(0,r.useState)([]),[o,p]=(0,r.useState)({open:0,in_progress:0,blocked:0,closed:0,deferred:0,total:0,by_priority:{},by_type:{}}),[h,u]=(0,r.useState)(!0),[m,b]=(0,r.useState)(""),[k,v]=(0,r.useState)(!1),[f,y]=(0,r.useState)(!1),[w,_]=(0,r.useState)(!1),[A,C]=(0,r.useState)(null),[S,M]=(0,r.useState)(null),E=(0,r.useRef)(null),[$,T]=(0,r.useState)({title:"",description:"",projectPath:"",status:"open",priority:0,issueType:"task"}),[L,I]=(0,r.useState)(null),R=t||null;(0,r.useEffect)(()=>{function e(e){E.current&&!E.current.contains(e.target)&&y(!1)}return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);let q=(e,t)=>{let s=new URLSearchParams(c.toString());null===t||"all"===t?s.delete(e):s.set(e,t);let a=s.toString();i.push(`${n}${a?`?${a}`:""}`)};(0,r.useEffect)(()=>{H()},[R,s]),(0,r.useEffect)(()=>{let e=c.get("issue");e&&M(e)},[c]);let H=async()=>{try{u(!0);let e=new URLSearchParams({...R&&{projectPath:R},..."all"!==s&&{status:s}}),t=await fetch(`/api/issues/list?${e}`),a=await t.json();a.success&&(d(a.issues),p(a.stats))}catch(e){console.error("Failed to load issues:",e)}finally{u(!1)}},K=async()=>{if($.projectPath&&$.title)try{(await fetch("/api/issues/create",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectPath:$.projectPath,title:$.title,description:$.description,status:$.status,priority:$.priority,issueType:$.issueType})})).ok&&(ee(),v(!1),H())}catch(e){console.error("Failed to create issue:",e)}},Z=async(e,t)=>{let s=t.add_project_path||t.remove_project_path;s||d(s=>s.map(s=>s.id===e?{...s,...t,updated_at:Date.now()}:s));try{(await fetch("/api/issues/update",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e,...t})})).ok?s&&H():H()}catch(e){console.error("Failed to update issue:",e),H()}},Q=async()=>{if(A)try{let e=new URLSearchParams({id:A});(await fetch(`/api/issues/delete?${e}`,{method:"DELETE"})).ok&&(_(!1),C(null),S===A&&M(null),H())}catch(e){console.error("Failed to delete issue:",e)}},ee=()=>{T({title:"",description:"",projectPath:R||e[0]?.project_path||"",status:"open",priority:0,issueType:"task"}),I(null)},et=l.filter(e=>!e.parent&&(e.title.toLowerCase().includes(m.toLowerCase())||e.description&&e.description.toLowerCase().includes(m.toLowerCase())||e.short_id&&e.short_id.toLowerCase().includes(m.toLowerCase()))),es=e.find(e=>e.project_path===R),ea=es?.project_path.split("/").pop()||null;return(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("h1",{className:"text-xl font-semibold text-zinc-900 dark:text-zinc-50",children:"Issues"}),(0,a.jsxs)("button",{onClick:()=>{ee(),v(!0)},className:"inline-flex items-center gap-1.5 rounded-md bg-zinc-900 dark:bg-zinc-100 px-3 py-1.5 text-sm font-medium text-white dark:text-zinc-900 hover:bg-zinc-800 dark:hover:bg-zinc-200",children:[(0,a.jsx)(j.A,{className:"h-4 w-4"}),"New"]})]}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsxs)("div",{className:"relative flex-1 min-w-[200px] max-w-md",children:[(0,a.jsx)(P.A,{className:"absolute left-2.5 top-1/2 h-4 w-4 -translate-y-1/2 text-zinc-400"}),(0,a.jsx)("input",{type:"text",placeholder:"Search...",value:m,onChange:e=>b(e.target.value),className:"w-full h-8 rounded-md border border-zinc-200 bg-white pl-8 pr-3 text-sm focus:border-zinc-300 focus:outline-none dark:border-zinc-700 dark:bg-zinc-900"})]}),(0,a.jsxs)("div",{className:"relative",ref:E,children:[(0,a.jsxs)("button",{onClick:()=>y(!f),className:"flex items-center gap-1 h-8 rounded-md border border-zinc-200 bg-white px-2.5 text-sm text-zinc-600 hover:bg-zinc-50 dark:border-zinc-700 dark:bg-zinc-900 dark:text-zinc-400",children:[(0,a.jsx)("span",{children:ea||"All"}),(0,a.jsx)(z.A,{className:"h-3.5 w-3.5"})]}),f&&(0,a.jsx)("div",{className:"absolute left-0 top-full z-50 mt-1 w-56 rounded-md border border-zinc-200 bg-white shadow-lg dark:border-zinc-700 dark:bg-zinc-800",children:(0,a.jsxs)("div",{className:"max-h-64 overflow-y-auto py-1",children:[(0,a.jsx)("button",{onClick:()=>{q("project",null),y(!1)},className:`w-full px-3 py-1.5 text-left text-sm ${!t?"bg-zinc-100 dark:bg-zinc-700":"hover:bg-zinc-50 dark:hover:bg-zinc-700/50"}`,children:"All Projects"}),e.map(e=>(0,a.jsx)("button",{onClick:()=>{q("project",e.project_path),y(!1)},className:`w-full px-3 py-1.5 text-left text-sm truncate ${t===e.project_path?"bg-zinc-100 dark:bg-zinc-700":"hover:bg-zinc-50 dark:hover:bg-zinc-700/50"}`,children:e.project_path.split("/").pop()},e.project_path))]})})]}),(0,a.jsx)("div",{className:"flex items-center gap-1",children:[{value:"all",label:"All"},{value:"open",label:"Open"},{value:"in_progress",label:"In Progress"},{value:"blocked",label:"Blocked"},{value:"closed",label:"Closed"},{value:"deferred",label:"Deferred"}].map(e=>(0,a.jsx)("button",{onClick:()=>q("status",e.value),className:`h-8 px-2.5 rounded-md text-sm transition-colors ${s===e.value?"bg-zinc-100 text-zinc-900 dark:bg-zinc-800 dark:text-zinc-100":"text-zinc-500 hover:text-zinc-700 dark:text-zinc-400 dark:hover:text-zinc-200"}`,children:e.label},e.value))}),(t||"all"!==s||m)&&(0,a.jsx)("button",{onClick:()=>{b(""),q("project",null),q("status","all")},className:"h-8 px-2 text-sm text-zinc-400 hover:text-zinc-600 dark:hover:text-zinc-300",children:(0,a.jsx)(g.A,{className:"h-4 w-4"})})]}),(0,a.jsx)("div",{className:"rounded-lg border border-zinc-200 dark:border-zinc-800 bg-white dark:bg-zinc-900 overflow-hidden",children:h?(0,a.jsx)("div",{className:"flex items-center justify-center py-16",children:(0,a.jsx)("div",{className:"h-5 w-5 animate-spin rounded-full border-2 border-zinc-200 border-t-zinc-600 dark:border-zinc-700 dark:border-t-zinc-300"})}):0===et.length?(0,a.jsx)(F.p,{icon:(0,a.jsx)(x.A,{}),heading:m||"all"!==s?"No Issues Match Your Filters":"No Issues Yet",description:m||"all"!==s?"Try adjusting your search or filters":"Create your first issue to get started tracking your work"}):(0,a.jsx)("div",{className:"divide-y divide-zinc-100 dark:divide-zinc-800",children:et.map(e=>{B[e.status];let t=S===e.id;return(0,a.jsxs)("div",{className:`group flex items-center h-10 px-3 hover:bg-zinc-50 dark:hover:bg-zinc-800/50 cursor-pointer transition-colors ${t?"bg-zinc-50 dark:bg-zinc-800/50":""} ${"closed"===e.status?"opacity-50":""}`,onClick:()=>M(t?null:e.id),children:[(0,a.jsx)("div",{className:"w-6 shrink-0",onClick:e=>e.stopPropagation(),children:(0,a.jsx)(Y,{value:e.priority,onChange:t=>Z(e.id,{priority:t})})}),(0,a.jsx)("div",{className:"w-6 shrink-0",onClick:e=>e.stopPropagation(),children:(0,a.jsx)(J,{value:e.status,onChange:t=>Z(e.id,{status:t})})}),(0,a.jsx)("span",{className:"w-20 shrink-0 text-xs text-zinc-400 dark:text-zinc-500 font-mono mr-2",children:e.short_id||e.id.slice(0,8)}),(0,a.jsx)("span",{className:`flex-1 text-sm truncate ${"closed"===e.status?"text-zinc-400 line-through":"text-zinc-900 dark:text-zinc-100"}`,children:e.title}),(0,a.jsx)("span",{className:"hidden sm:block w-20 text-xs text-zinc-400 text-right shrink-0",children:new Date(e.created_at).toLocaleDateString("en-US",{month:"short",day:"numeric"})}),(0,a.jsx)("div",{className:"w-8 flex items-center justify-end opacity-0 group-hover:opacity-100 transition-opacity shrink-0",children:(0,a.jsx)("button",{onClick:t=>{t.stopPropagation(),C(e.id),_(!0)},className:"p-1 rounded text-zinc-400 hover:text-red-500 hover:bg-red-50 dark:hover:bg-red-900/20",children:(0,a.jsx)(N.A,{className:"h-3.5 w-3.5"})})})]},e.id)})})}),S&&(()=>{let t=et.find(e=>e.id===S);if(!t)return null;let s=V[t.issue_type]||U[0];return(0,a.jsx)(G,{issue:t,typeConfig:s,onClose:()=>M(null),onUpdate:e=>Z(t.id,e),onSubtaskCreated:H,projects:e})})(),k&&(0,a.jsx)("div",{className:"fixed inset-0 z-100 flex items-center justify-center bg-black/50 p-4",children:(0,a.jsxs)("div",{className:"w-full max-w-2xl rounded-xl border border-zinc-200 bg-white shadow-2xl dark:border-zinc-700 dark:bg-zinc-900",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-zinc-200 dark:border-zinc-700",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 text-sm",children:[(0,a.jsx)("span",{className:"px-2 py-0.5 rounded border border-zinc-200 dark:border-zinc-700 text-zinc-600 dark:text-zinc-400 text-xs font-medium",children:$.projectPath?$.projectPath.split("/").pop():"SAV"}),(0,a.jsx)("span",{className:"text-zinc-400",children:"›"}),(0,a.jsx)("span",{className:"text-zinc-700 dark:text-zinc-300",children:"New issue"})]}),(0,a.jsx)("button",{onClick:()=>{v(!1),ee()},className:"p-1 rounded text-zinc-400 hover:text-zinc-600 hover:bg-zinc-100 dark:hover:text-zinc-300 dark:hover:bg-zinc-700",children:(0,a.jsx)(g.A,{className:"h-4 w-4"})})]}),(0,a.jsxs)("div",{className:"p-4 space-y-4",children:[(0,a.jsx)("input",{type:"text",value:$.title,onChange:e=>T({...$,title:e.target.value}),placeholder:"Issue title",autoFocus:!0,className:"w-full text-lg font-medium text-zinc-900 dark:text-zinc-100 placeholder:text-zinc-400 bg-transparent border-none outline-none"}),(0,a.jsx)("textarea",{value:$.description,onChange:e=>T({...$,description:e.target.value}),placeholder:"Add description...",rows:4,className:"w-full text-sm text-zinc-600 dark:text-zinc-400 placeholder:text-zinc-400 bg-transparent border-none outline-none resize-none"})]}),(0,a.jsx)("div",{className:"px-4 py-3 border-t border-zinc-200 dark:border-zinc-700",children:(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)(J,{value:$.status,onChange:e=>T({...$,status:e}),size:"md"}),(0,a.jsx)(Y,{value:$.priority,onChange:e=>T({...$,priority:e}),size:"md"}),(0,a.jsx)(W,{value:$.issueType,onChange:e=>T({...$,issueType:e})}),(0,a.jsx)(X,{value:$.projectPath,onChange:e=>T({...$,projectPath:e}),projects:e})]})}),(0,a.jsxs)("div",{className:"flex items-center justify-end gap-3 px-4 py-3 border-t border-zinc-200 dark:border-zinc-700",children:[(0,a.jsx)("button",{onClick:()=>{v(!1),ee()},className:"px-3 py-1.5 text-sm text-zinc-600 hover:text-zinc-900 dark:text-zinc-400 dark:hover:text-zinc-100",children:"Cancel"}),(0,a.jsx)("button",{onClick:K,disabled:!$.title||!$.projectPath,className:"px-4 py-1.5 rounded-md bg-zinc-900 dark:bg-zinc-100 text-sm font-medium text-white dark:text-zinc-900 hover:bg-zinc-800 dark:hover:bg-zinc-200 disabled:opacity-50 disabled:cursor-not-allowed",children:"Create issue"})]})]})}),(0,a.jsx)(O.T,{isOpen:w,onClose:()=>_(!1),onConfirm:Q,title:"Delete Issue",message:"Are you sure you want to delete this issue? This action cannot be undone.",confirmText:"Delete",cancelText:"Cancel",variant:"danger"})]})}},7609:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(6748).A)("hexagon",[["path",{d:"M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z",key:"yt0hxn"}]])},7653:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(6748).A)("folder-kanban",[["path",{d:"M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.93a2 2 0 0 1-1.66-.9l-.82-1.2A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2Z",key:"1fr9dc"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M12 10v2",key:"hh53o1"}],["path",{d:"M16 10v6",key:"1d6xys"}]])},8317:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(6748).A)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]])},8360:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(6748).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"}]])},8702:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(6748).A)("settings",[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]])},9349:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(6748).A)("layers",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]])}},e=>{e.O(0,[3358,9353,2655,8704,7358],()=>e(e.s=2362)),_N_E=e.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1997],{592:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});let a=(0,r(6748).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"}]])},737:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});let a=(0,r(6748).A)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]])},1422:(e,t,r)=>{"use strict";var a=r(2082);r.o(a,"usePathname")&&r.d(t,{usePathname:function(){return a.usePathname}}),r.o(a,"useRouter")&&r.d(t,{useRouter:function(){return a.useRouter}}),r.o(a,"useSearchParams")&&r.d(t,{useSearchParams:function(){return a.useSearchParams}})},2771:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});let a=(0,r(6748).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"}]])},3183:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});let a=(0,r(6748).A)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},3203:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});let a=(0,r(6748).A)("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]])},3624:(e,t,r)=>{Promise.resolve().then(r.bind(r,9997))},4545:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});let a=(0,r(6748).A)("brain",[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]])},5789:(e,t,r)=>{"use strict";r.d(t,{T:()=>n});var a=r(2638),s=r(5979);function n({isOpen:e,onClose:t,onConfirm:r,title:n,message:l,confirmText:c="Delete",cancelText:i="Cancel",variant:d="danger"}){return e?(0,a.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",children:(0,a.jsxs)("div",{className:"w-full max-w-md rounded-xl border border-zinc-200 bg-white p-6 shadow-xl dark:border-zinc-800 dark:bg-zinc-900",children:[(0,a.jsxs)("div",{className:"flex items-start gap-4",children:[(0,a.jsx)("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-full bg-red-100 dark:bg-red-900/30",children:(0,a.jsx)(s.A,{className:"h-5 w-5 text-red-600 dark:text-red-400"})}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold text-zinc-900 dark:text-zinc-50",children:n}),(0,a.jsx)("p",{className:"mt-2 text-sm text-zinc-600 dark:text-zinc-400 whitespace-pre-wrap",children:l})]})]}),(0,a.jsxs)("div",{className:"mt-6 flex justify-end gap-3",children:[(0,a.jsx)("button",{onClick:t,className:"rounded-lg border border-zinc-300 px-4 py-2 text-sm font-medium text-zinc-700 transition-colors hover:bg-zinc-50 dark:border-zinc-700 dark:text-zinc-300 dark:hover:bg-zinc-800",children:i}),(0,a.jsx)("button",{onClick:()=>{r(),t()},className:`rounded-lg px-4 py-2 text-sm font-medium text-white transition-colors ${(()=>{switch(d){case"danger":default:return"bg-red-600 hover:bg-red-700 dark:bg-red-600 dark:hover:bg-red-700";case"warning":return"bg-amber-600 hover:bg-amber-700 dark:bg-amber-600 dark:hover:bg-amber-700";case"info":return"bg-blue-600 hover:bg-blue-700 dark:bg-blue-600 dark:hover:bg-blue-700"}})()}`,children:c})]})]})}):null}},5979:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});let a=(0,r(6748).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"}]])},6539:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});let a=(0,r(6748).A)("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]])},6748:(e,t,r)=>{"use strict";r.d(t,{A:()=>i});var a=r(6702);let s=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)},n=(...e)=>e.filter((e,t,r)=>!!e&&""!==e.trim()&&r.indexOf(e)===t).join(" ").trim();var l={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let c=(0,a.forwardRef)(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:s,className:c="",children:i,iconNode:d,...o},m)=>(0,a.createElement)("svg",{ref:m,...l,width:t,height:t,stroke:e,strokeWidth:s?24*Number(r)/Number(t):r,className:n("lucide",c),...!i&&!(e=>{for(let t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0})(o)&&{"aria-hidden":"true"},...o},[...d.map(([e,t])=>(0,a.createElement)(e,t)),...Array.isArray(i)?i:[i]])),i=(e,t)=>{let r=(0,a.forwardRef)(({className:r,...l},i)=>(0,a.createElement)(c,{ref:i,iconNode:t,className:n(`lucide-${s(e).replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${e}`,r),...l}));return r.displayName=s(e),r}},7069:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});let a=(0,r(6748).A)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])},8702:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});let a=(0,r(6748).A)("settings",[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]])},9997:(e,t,r)=>{"use strict";r.d(t,{MemoryClient:()=>f});var a=r(2638),s=r(6702),n=r(4545),l=r(3203),c=r(8702),i=r(2771),d=r(3183),o=r(6748);let m=(0,o.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"}]]);var x=r(737),u=r(7069),h=r(6539);let p=(0,o.A)("square-pen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);var g=r(592),b=r(1422),y=r(5789);let k=[{value:"all",label:"All",icon:n.A},{value:"command",label:"Commands",icon:l.A},{value:"config",label:"Configs",icon:c.A},{value:"note",label:"Notes",icon:i.A}];function f({projects:e,initialProjectFilter:t,initialCategoryFilter:r}){let o=(0,b.useRouter)(),f=(0,b.usePathname)(),v=(0,b.useSearchParams)(),[j,z]=(0,s.useState)([]),[w,N]=(0,s.useState)(!0),[A,C]=(0,s.useState)(""),[M,S]=(0,s.useState)(!1),[P,_]=(0,s.useState)(!1),[E,L]=(0,s.useState)(!1),[$,R]=(0,s.useState)(null),T=(0,s.useRef)(null),[O,U]=(0,s.useState)({key:"",value:"",category:"note"}),[q,D]=(0,s.useState)(null),H=t||null;(0,s.useEffect)(()=>{function e(e){T.current&&!T.current.contains(e.target)&&_(!1)}return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);let F=(e,t)=>{let r=new URLSearchParams(v.toString());null===t||"all"===t?r.delete(e):r.set(e,t);let a=r.toString();o.push(`${f}${a?`?${a}`:""}`)};(0,s.useEffect)(()=>{V()},[H,r]);let V=async()=>{try{N(!0);let e=new URLSearchParams({...H&&{projectPath:H},..."all"!==r&&{category:r}}),t=await fetch(`/api/memory/list?${e}`),a=await t.json();a.success&&z(a.memories)}catch(e){console.error("Failed to load memories:",e)}finally{N(!1)}},[W,I]=(0,s.useState)(null),J=async()=>{let e=W||H;if(e&&O.key&&O.value)try{(await fetch("/api/memory/save",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectPath:e,...O})})).ok&&(U({key:"",value:"",category:"note"}),S(!1),D(null),I(null),V())}catch(e){console.error("Failed to save memory:",e)}},Z=async()=>{if($)try{let e=new URLSearchParams({projectPath:$.projectPath,key:$.key});(await fetch(`/api/memory/delete?${e}`,{method:"DELETE"})).ok&&V()}catch(e){console.error("Failed to delete memory:",e)}finally{R(null)}},B=j.filter(e=>e.key.toLowerCase().includes(A.toLowerCase())||e.value.toLowerCase().includes(A.toLowerCase())),Y=e.find(e=>e.project_path===H),G=Y?Y.project_path.split("/").pop():null,K={command:j.filter(e=>"command"===e.category).length,config:j.filter(e=>"config"===e.category).length,note:j.filter(e=>"note"===e.category).length};return(0,a.jsxs)("div",{className:"space-y-8",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"text-2xl sm:text-3xl font-bold tracking-tight text-zinc-900 dark:text-zinc-50",children:"Memory"}),(0,a.jsx)("p",{className:"mt-1 sm:mt-2 text-sm text-zinc-600 dark:text-zinc-400",children:"Store commands, configs, and notes that persist across sessions"})]}),(0,a.jsxs)("div",{className:"relative group w-full sm:w-auto",children:[(0,a.jsxs)("button",{onClick:()=>{U({key:"",value:"",category:"note"}),D(null),I(null),S(!0)},disabled:!H,className:"inline-flex items-center justify-center gap-2 rounded-lg bg-[rgb(var(--sidebar-primary))] px-4 py-2.5 text-sm font-medium text-[rgb(var(--sidebar-primary-foreground))] shadow-sm transition-all hover:opacity-90 disabled:opacity-50 disabled:cursor-not-allowed w-full sm:w-auto",children:[(0,a.jsx)(d.A,{className:"h-4 w-4"}),"Add Memory"]}),!H&&(0,a.jsxs)("div",{className:"absolute bottom-full left-1/2 -translate-x-1/2 mb-2 px-3 py-2 bg-zinc-900 text-white text-xs font-semibold rounded-lg whitespace-nowrap opacity-0 group-hover:opacity-100 transition-opacity pointer-events-none dark:bg-zinc-100 dark:text-zinc-900 flex items-center gap-1.5",children:[(0,a.jsx)(m,{className:"h-3 w-3 stroke-[2.5]"}),"Select a project first",(0,a.jsx)("div",{className:"absolute top-full left-1/2 -translate-x-1/2 border-4 border-transparent border-t-zinc-900 dark:border-t-zinc-100"})]})]})]}),j.length>0&&(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-3 sm:gap-4 text-sm text-zinc-600 dark:text-zinc-400",children:[(0,a.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,a.jsx)(l.A,{className:"h-4 w-4 text-blue-500"}),K.command," commands"]}),(0,a.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,a.jsx)(c.A,{className:"h-4 w-4 text-purple-500"}),K.config," configs"]}),(0,a.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,a.jsx)(i.A,{className:"h-4 w-4 text-green-500"}),K.note," notes"]}),(0,a.jsx)("span",{className:"hidden sm:inline text-zinc-400",children:"•"}),(0,a.jsxs)("span",{children:[j.length," total"]})]}),(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,a.jsxs)("div",{className:"relative",ref:T,children:[(0,a.jsxs)("button",{onClick:()=>_(!P),className:"flex items-center gap-1.5 sm:gap-2 rounded-lg border border-zinc-200 bg-white px-2 sm:px-3 py-1.5 sm:py-2 text-xs sm:text-sm font-medium text-zinc-700 shadow-sm transition-all hover:bg-zinc-50 dark:border-zinc-700 dark:bg-zinc-800 dark:text-zinc-300 dark:hover:bg-zinc-700/50",children:[(0,a.jsx)("span",{children:G||"All Projects"}),(0,a.jsx)(x.A,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4 text-zinc-500"})]}),P&&(0,a.jsx)("div",{className:"absolute left-0 top-full z-50 mt-2 w-64 rounded-lg border border-zinc-200 bg-white shadow-lg dark:border-zinc-700 dark:bg-zinc-800",children:(0,a.jsxs)("div",{className:"max-h-80 overflow-y-auto p-1",children:[(0,a.jsx)("button",{onClick:()=>{F("project",null),_(!1)},className:`w-full rounded-md px-3 py-2 text-left text-sm transition-colors ${!t?"bg-primary font-medium text-primary-foreground":"text-zinc-700 hover:bg-zinc-100 dark:text-zinc-300 dark:hover:bg-zinc-700/50"}`,children:"All Projects"}),e.map(e=>{let r=e.project_path.split("/").pop();return(0,a.jsxs)("button",{onClick:()=>{F("project",e.project_path),_(!1)},className:`w-full rounded-md px-3 py-2 text-left text-sm transition-colors ${t===e.project_path?"bg-primary font-medium text-primary-foreground":"text-zinc-700 hover:bg-zinc-100 dark:text-zinc-300 dark:hover:bg-zinc-700/50"}`,children:[(0,a.jsx)("div",{className:"truncate",children:r}),(0,a.jsx)("div",{className:"truncate text-xs text-zinc-500 dark:text-zinc-500",children:e.project_path})]},e.project_path)})]})})]}),(0,a.jsx)("div",{className:"flex items-center gap-1.5 sm:gap-2",children:k.map(e=>(0,a.jsx)("button",{onClick:()=>F("category",e.value),className:`rounded-full px-2 sm:px-3 py-1 sm:py-1.5 text-[10px] sm:text-xs font-medium transition-all ${r===e.value?"bg-primary text-primary-foreground shadow-sm":"bg-secondary text-secondary-foreground hover:bg-secondary/80"}`,children:e.label},e.value))}),(t||"all"!==r)&&(0,a.jsxs)("button",{onClick:()=>{F("project",null),F("category","all")},className:"flex items-center gap-1.5 rounded-lg px-2 py-1.5 text-xs font-medium text-zinc-600 hover:bg-zinc-100 dark:text-zinc-400 dark:hover:bg-zinc-800",children:[(0,a.jsx)(u.A,{className:"h-3.5 w-3.5"}),"Clear"]})]}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)(h.A,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-zinc-400"}),(0,a.jsx)("input",{type:"text",placeholder:"Search memories...",value:A,onChange:e=>C(e.target.value),className:"w-full rounded-lg border border-zinc-200 bg-white pl-10 pr-4 py-2.5 text-sm shadow-sm focus:border-zinc-400 focus:outline-none focus:ring-1 focus:ring-zinc-400 dark:border-zinc-700 dark:bg-zinc-900 dark:focus:border-zinc-600 dark:focus:ring-zinc-600"})]})]}),(0,a.jsx)("div",{className:"space-y-3",children:w?(0,a.jsx)("div",{className:"flex items-center justify-center py-12",children:(0,a.jsx)("div",{className:"h-8 w-8 animate-spin rounded-full border-4 border-zinc-200 border-t-zinc-900 dark:border-zinc-700 dark:border-t-zinc-50"})}):0===B.length?(0,a.jsx)("div",{className:"rounded-2xl border-2 border-dashed border-zinc-300 bg-zinc-50 p-8 text-center dark:border-zinc-700 dark:bg-zinc-900/50",children:(0,a.jsxs)("div",{className:"mx-auto max-w-lg space-y-4",children:[(0,a.jsx)("div",{className:"mx-auto flex h-12 w-12 items-center justify-center rounded-full bg-zinc-900 text-white dark:bg-zinc-100 dark:text-zinc-900",children:(0,a.jsx)(n.A,{className:"h-6 w-6"})}),(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)("h3",{className:"text-lg font-bold text-zinc-900 dark:text-zinc-50",children:A||"all"!==r?"No memory items found":"No Memory Items Yet"}),(0,a.jsx)("p",{className:"text-sm text-zinc-600 dark:text-zinc-400",children:A||"all"!==r?"Try adjusting your filters or search term":"Have your AI agent call the context_memory_save tool in your project to save commands, configs, and notes."})]})]})}):B.map(e=>{var t;let r,s=(t=e.category,r=k.find(e=>e.value===t),r?.icon||n.A);return(0,a.jsx)("div",{className:"group rounded-xl border border-zinc-200 bg-white p-6 shadow-sm transition-all hover:border-zinc-400 hover:shadow-md dark:border-zinc-800 dark:bg-zinc-900 dark:hover:border-zinc-600",children:(0,a.jsxs)("div",{className:"flex items-start justify-between",children:[(0,a.jsxs)("div",{className:"flex gap-4",children:[(0,a.jsx)("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-accent",children:(0,a.jsx)(s,{className:"h-5 w-5 text-accent-foreground"})}),(0,a.jsxs)("div",{className:"flex-1 space-y-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("span",{className:`rounded-md px-2 py-1 text-xs font-medium ${(e=>{switch(e){case"command":return"bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400";case"config":return"bg-purple-100 text-purple-700 dark:bg-purple-900/30 dark:text-purple-400";case"note":return"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400";default:return"bg-zinc-100 text-zinc-700 dark:bg-zinc-800 dark:text-zinc-300"}})(e.category)}`,children:e.category}),(0,a.jsx)("h3",{className:"font-semibold text-zinc-900 dark:text-zinc-50",children:e.key})]}),(0,a.jsx)("pre",{className:"whitespace-pre-wrap break-all rounded-lg bg-zinc-50 p-3 font-mono text-sm text-zinc-700 dark:bg-zinc-800 dark:text-zinc-300",children:e.value}),(0,a.jsxs)("div",{className:"flex items-center gap-3 text-xs text-zinc-500 dark:text-zinc-500",children:[!H&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"font-medium",children:e.project_path.split("/").pop()}),(0,a.jsx)("span",{children:"•"})]}),(0,a.jsxs)("span",{children:["Updated ",new Date(e.updated_at).toLocaleDateString()]})]})]})]}),(0,a.jsxs)("div",{className:"flex gap-2 opacity-0 transition-opacity group-hover:opacity-100",children:[(0,a.jsx)("button",{onClick:()=>{U({key:e.key,value:e.value,category:e.category}),D(e.id),I(e.project_path),S(!0)},className:"rounded-lg p-2 text-zinc-600 transition-colors hover:bg-zinc-100 dark:text-zinc-400 dark:hover:bg-zinc-800",children:(0,a.jsx)(p,{className:"h-4 w-4"})}),(0,a.jsx)("button",{onClick:()=>{R({key:e.key,projectPath:e.project_path}),L(!0)},className:"rounded-lg p-2 text-red-600 transition-colors hover:bg-red-50 dark:text-red-400 dark:hover:bg-red-900/20",children:(0,a.jsx)(g.A,{className:"h-4 w-4"})})]})]})},e.id)})}),M&&(0,a.jsx)("div",{className:"fixed inset-0 z-[100] flex items-center justify-center bg-black/50 p-4",children:(0,a.jsxs)("div",{className:"w-full max-w-2xl rounded-xl border border-zinc-200 bg-white shadow-2xl dark:border-zinc-700 dark:bg-zinc-900",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-zinc-200 dark:border-zinc-700",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 text-sm",children:[(0,a.jsx)("span",{className:"px-2 py-0.5 rounded border border-zinc-200 dark:border-zinc-700 text-zinc-600 dark:text-zinc-400 text-xs font-medium",children:H?H.split("/").pop():"PROJECT"}),(0,a.jsx)("span",{className:"text-zinc-400",children:"›"}),(0,a.jsx)("span",{className:"text-zinc-700 dark:text-zinc-300",children:q?"Edit memory":"New memory"})]}),(0,a.jsx)("button",{onClick:()=>{S(!1),D(null),I(null),U({key:"",value:"",category:"note"})},className:"p-1 rounded text-zinc-400 hover:text-zinc-600 hover:bg-zinc-100 dark:hover:text-zinc-300 dark:hover:bg-zinc-700",children:(0,a.jsx)(u.A,{className:"h-4 w-4"})})]}),(0,a.jsxs)("div",{className:"p-4 space-y-4",children:[(0,a.jsx)("input",{type:"text",value:O.key,onChange:e=>U({...O,key:e.target.value}),placeholder:"Memory key (e.g., run_tests)",autoFocus:!0,className:"w-full text-lg font-medium text-zinc-900 dark:text-zinc-100 placeholder:text-zinc-400 bg-transparent border-none outline-none"}),(0,a.jsx)("textarea",{value:O.value,onChange:e=>U({...O,value:e.target.value}),placeholder:"Value (e.g., npm test)",rows:4,className:"w-full text-sm text-zinc-600 dark:text-zinc-400 placeholder:text-zinc-400 bg-transparent border-none outline-none resize-none"})]}),(0,a.jsx)("div",{className:"px-4 py-3 border-t border-zinc-200 dark:border-zinc-700",children:(0,a.jsx)("div",{className:"flex flex-wrap items-center gap-2",children:(0,a.jsxs)("select",{value:O.category,onChange:e=>U({...O,category:e.target.value}),className:"h-7 rounded-md border border-zinc-200 dark:border-zinc-700 bg-transparent px-2 text-xs font-medium text-zinc-600 dark:text-zinc-400 focus:outline-none focus:ring-1 focus:ring-zinc-400",children:[(0,a.jsx)("option",{value:"command",children:"Command"}),(0,a.jsx)("option",{value:"config",children:"Config"}),(0,a.jsx)("option",{value:"note",children:"Note"})]})})}),(0,a.jsxs)("div",{className:"flex items-center justify-end gap-3 px-4 py-3 border-t border-zinc-200 dark:border-zinc-700",children:[(0,a.jsx)("button",{onClick:()=>{S(!1),D(null),I(null),U({key:"",value:"",category:"note"})},className:"px-3 py-1.5 text-sm text-zinc-600 hover:text-zinc-900 dark:text-zinc-400 dark:hover:text-zinc-100",children:"Cancel"}),(0,a.jsx)("button",{onClick:J,disabled:!O.key||!O.value,className:"px-3 py-1.5 text-sm font-medium rounded-md bg-zinc-900 text-white hover:bg-zinc-800 dark:bg-zinc-100 dark:text-zinc-900 dark:hover:bg-zinc-200 disabled:opacity-50 disabled:cursor-not-allowed",children:q?"Update Memory":"Create Memory"})]})]})}),(0,a.jsx)(y.T,{isOpen:E,onClose:()=>L(!1),onConfirm:Z,title:"Delete Memory",message:"Are you sure you want to delete this memory item? This action cannot be undone.",confirmText:"Delete",cancelText:"Cancel",variant:"danger"})]})}}},e=>{e.O(0,[2655,8704,7358],()=>e(e.s=3624)),_N_E=e.O()}]);
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1997],{592:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});let a=(0,r(6748).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"}]])},737:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});let a=(0,r(6748).A)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]])},1422:(e,t,r)=>{"use strict";var a=r(2082);r.o(a,"usePathname")&&r.d(t,{usePathname:function(){return a.usePathname}}),r.o(a,"useRouter")&&r.d(t,{useRouter:function(){return a.useRouter}}),r.o(a,"useSearchParams")&&r.d(t,{useSearchParams:function(){return a.useSearchParams}})},2771:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});let a=(0,r(6748).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"}]])},3183:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});let a=(0,r(6748).A)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},3203:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});let a=(0,r(6748).A)("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]])},3624:(e,t,r)=>{Promise.resolve().then(r.bind(r,9997))},4545:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});let a=(0,r(6748).A)("brain",[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]])},5789:(e,t,r)=>{"use strict";r.d(t,{T:()=>n});var a=r(2638),s=r(8360);function n({isOpen:e,onClose:t,onConfirm:r,title:n,message:l,confirmText:c="Delete",cancelText:i="Cancel",variant:d="danger"}){return e?(0,a.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",children:(0,a.jsxs)("div",{className:"w-full max-w-md rounded-xl border border-zinc-200 bg-white p-6 shadow-xl dark:border-zinc-800 dark:bg-zinc-900",children:[(0,a.jsxs)("div",{className:"flex items-start gap-4",children:[(0,a.jsx)("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-full bg-red-100 dark:bg-red-900/30",children:(0,a.jsx)(s.A,{className:"h-5 w-5 text-red-600 dark:text-red-400"})}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold text-zinc-900 dark:text-zinc-50",children:n}),(0,a.jsx)("p",{className:"mt-2 text-sm text-zinc-600 dark:text-zinc-400 whitespace-pre-wrap",children:l})]})]}),(0,a.jsxs)("div",{className:"mt-6 flex justify-end gap-3",children:[(0,a.jsx)("button",{onClick:t,className:"rounded-lg border border-zinc-300 px-4 py-2 text-sm font-medium text-zinc-700 transition-colors hover:bg-zinc-50 dark:border-zinc-700 dark:text-zinc-300 dark:hover:bg-zinc-800",children:i}),(0,a.jsx)("button",{onClick:()=>{r(),t()},className:`rounded-lg px-4 py-2 text-sm font-medium text-white transition-colors ${(()=>{switch(d){case"danger":default:return"bg-red-600 hover:bg-red-700 dark:bg-red-600 dark:hover:bg-red-700";case"warning":return"bg-amber-600 hover:bg-amber-700 dark:bg-amber-600 dark:hover:bg-amber-700";case"info":return"bg-blue-600 hover:bg-blue-700 dark:bg-blue-600 dark:hover:bg-blue-700"}})()}`,children:c})]})]})}):null}},6539:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});let a=(0,r(6748).A)("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]])},6748:(e,t,r)=>{"use strict";r.d(t,{A:()=>i});var a=r(6702);let s=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)},n=(...e)=>e.filter((e,t,r)=>!!e&&""!==e.trim()&&r.indexOf(e)===t).join(" ").trim();var l={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let c=(0,a.forwardRef)(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:s,className:c="",children:i,iconNode:d,...o},m)=>(0,a.createElement)("svg",{ref:m,...l,width:t,height:t,stroke:e,strokeWidth:s?24*Number(r)/Number(t):r,className:n("lucide",c),...!i&&!(e=>{for(let t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0})(o)&&{"aria-hidden":"true"},...o},[...d.map(([e,t])=>(0,a.createElement)(e,t)),...Array.isArray(i)?i:[i]])),i=(e,t)=>{let r=(0,a.forwardRef)(({className:r,...l},i)=>(0,a.createElement)(c,{ref:i,iconNode:t,className:n(`lucide-${s(e).replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${e}`,r),...l}));return r.displayName=s(e),r}},7069:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});let a=(0,r(6748).A)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])},8360:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});let a=(0,r(6748).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"}]])},8702:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});let a=(0,r(6748).A)("settings",[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]])},9997:(e,t,r)=>{"use strict";r.d(t,{MemoryClient:()=>f});var a=r(2638),s=r(6702),n=r(4545),l=r(3203),c=r(8702),i=r(2771),d=r(3183),o=r(6748);let m=(0,o.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"}]]);var x=r(737),u=r(7069),h=r(6539);let p=(0,o.A)("square-pen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);var g=r(592),b=r(1422),y=r(5789);let k=[{value:"all",label:"All",icon:n.A},{value:"command",label:"Commands",icon:l.A},{value:"config",label:"Configs",icon:c.A},{value:"note",label:"Notes",icon:i.A}];function f({projects:e,initialProjectFilter:t,initialCategoryFilter:r}){let o=(0,b.useRouter)(),f=(0,b.usePathname)(),v=(0,b.useSearchParams)(),[j,z]=(0,s.useState)([]),[w,N]=(0,s.useState)(!0),[A,C]=(0,s.useState)(""),[M,S]=(0,s.useState)(!1),[P,_]=(0,s.useState)(!1),[E,L]=(0,s.useState)(!1),[$,R]=(0,s.useState)(null),T=(0,s.useRef)(null),[O,U]=(0,s.useState)({key:"",value:"",category:"note"}),[q,D]=(0,s.useState)(null),H=t||null;(0,s.useEffect)(()=>{function e(e){T.current&&!T.current.contains(e.target)&&_(!1)}return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);let F=(e,t)=>{let r=new URLSearchParams(v.toString());null===t||"all"===t?r.delete(e):r.set(e,t);let a=r.toString();o.push(`${f}${a?`?${a}`:""}`)};(0,s.useEffect)(()=>{V()},[H,r]);let V=async()=>{try{N(!0);let e=new URLSearchParams({...H&&{projectPath:H},..."all"!==r&&{category:r}}),t=await fetch(`/api/memory/list?${e}`),a=await t.json();a.success&&z(a.memories)}catch(e){console.error("Failed to load memories:",e)}finally{N(!1)}},[W,I]=(0,s.useState)(null),J=async()=>{let e=W||H;if(e&&O.key&&O.value)try{(await fetch("/api/memory/save",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectPath:e,...O})})).ok&&(U({key:"",value:"",category:"note"}),S(!1),D(null),I(null),V())}catch(e){console.error("Failed to save memory:",e)}},Z=async()=>{if($)try{let e=new URLSearchParams({projectPath:$.projectPath,key:$.key});(await fetch(`/api/memory/delete?${e}`,{method:"DELETE"})).ok&&V()}catch(e){console.error("Failed to delete memory:",e)}finally{R(null)}},B=j.filter(e=>e.key.toLowerCase().includes(A.toLowerCase())||e.value.toLowerCase().includes(A.toLowerCase())),Y=e.find(e=>e.project_path===H),G=Y?Y.project_path.split("/").pop():null,K={command:j.filter(e=>"command"===e.category).length,config:j.filter(e=>"config"===e.category).length,note:j.filter(e=>"note"===e.category).length};return(0,a.jsxs)("div",{className:"space-y-8",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"text-2xl sm:text-3xl font-bold tracking-tight text-zinc-900 dark:text-zinc-50",children:"Memory"}),(0,a.jsx)("p",{className:"mt-1 sm:mt-2 text-sm text-zinc-600 dark:text-zinc-400",children:"Store commands, configs, and notes that persist across sessions"})]}),(0,a.jsxs)("div",{className:"relative group w-full sm:w-auto",children:[(0,a.jsxs)("button",{onClick:()=>{U({key:"",value:"",category:"note"}),D(null),I(null),S(!0)},disabled:!H,className:"inline-flex items-center justify-center gap-2 rounded-lg bg-[rgb(var(--sidebar-primary))] px-4 py-2.5 text-sm font-medium text-[rgb(var(--sidebar-primary-foreground))] shadow-sm transition-all hover:opacity-90 disabled:opacity-50 disabled:cursor-not-allowed w-full sm:w-auto",children:[(0,a.jsx)(d.A,{className:"h-4 w-4"}),"Add Memory"]}),!H&&(0,a.jsxs)("div",{className:"absolute bottom-full left-1/2 -translate-x-1/2 mb-2 px-3 py-2 bg-zinc-900 text-white text-xs font-semibold rounded-lg whitespace-nowrap opacity-0 group-hover:opacity-100 transition-opacity pointer-events-none dark:bg-zinc-100 dark:text-zinc-900 flex items-center gap-1.5",children:[(0,a.jsx)(m,{className:"h-3 w-3 stroke-[2.5]"}),"Select a project first",(0,a.jsx)("div",{className:"absolute top-full left-1/2 -translate-x-1/2 border-4 border-transparent border-t-zinc-900 dark:border-t-zinc-100"})]})]})]}),j.length>0&&(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-3 sm:gap-4 text-sm text-zinc-600 dark:text-zinc-400",children:[(0,a.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,a.jsx)(l.A,{className:"h-4 w-4 text-blue-500"}),K.command," commands"]}),(0,a.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,a.jsx)(c.A,{className:"h-4 w-4 text-purple-500"}),K.config," configs"]}),(0,a.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,a.jsx)(i.A,{className:"h-4 w-4 text-green-500"}),K.note," notes"]}),(0,a.jsx)("span",{className:"hidden sm:inline text-zinc-400",children:"•"}),(0,a.jsxs)("span",{children:[j.length," total"]})]}),(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,a.jsxs)("div",{className:"relative",ref:T,children:[(0,a.jsxs)("button",{onClick:()=>_(!P),className:"flex items-center gap-1.5 sm:gap-2 rounded-lg border border-zinc-200 bg-white px-2 sm:px-3 py-1.5 sm:py-2 text-xs sm:text-sm font-medium text-zinc-700 shadow-sm transition-all hover:bg-zinc-50 dark:border-zinc-700 dark:bg-zinc-800 dark:text-zinc-300 dark:hover:bg-zinc-700/50",children:[(0,a.jsx)("span",{children:G||"All Projects"}),(0,a.jsx)(x.A,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4 text-zinc-500"})]}),P&&(0,a.jsx)("div",{className:"absolute left-0 top-full z-50 mt-2 w-64 rounded-lg border border-zinc-200 bg-white shadow-lg dark:border-zinc-700 dark:bg-zinc-800",children:(0,a.jsxs)("div",{className:"max-h-80 overflow-y-auto p-1",children:[(0,a.jsx)("button",{onClick:()=>{F("project",null),_(!1)},className:`w-full rounded-md px-3 py-2 text-left text-sm transition-colors ${!t?"bg-primary font-medium text-primary-foreground":"text-zinc-700 hover:bg-zinc-100 dark:text-zinc-300 dark:hover:bg-zinc-700/50"}`,children:"All Projects"}),e.map(e=>{let r=e.project_path.split("/").pop();return(0,a.jsxs)("button",{onClick:()=>{F("project",e.project_path),_(!1)},className:`w-full rounded-md px-3 py-2 text-left text-sm transition-colors ${t===e.project_path?"bg-primary font-medium text-primary-foreground":"text-zinc-700 hover:bg-zinc-100 dark:text-zinc-300 dark:hover:bg-zinc-700/50"}`,children:[(0,a.jsx)("div",{className:"truncate",children:r}),(0,a.jsx)("div",{className:"truncate text-xs text-zinc-500 dark:text-zinc-500",children:e.project_path})]},e.project_path)})]})})]}),(0,a.jsx)("div",{className:"flex items-center gap-1.5 sm:gap-2",children:k.map(e=>(0,a.jsx)("button",{onClick:()=>F("category",e.value),className:`rounded-full px-2 sm:px-3 py-1 sm:py-1.5 text-[10px] sm:text-xs font-medium transition-all ${r===e.value?"bg-primary text-primary-foreground shadow-sm":"bg-secondary text-secondary-foreground hover:bg-secondary/80"}`,children:e.label},e.value))}),(t||"all"!==r)&&(0,a.jsxs)("button",{onClick:()=>{F("project",null),F("category","all")},className:"flex items-center gap-1.5 rounded-lg px-2 py-1.5 text-xs font-medium text-zinc-600 hover:bg-zinc-100 dark:text-zinc-400 dark:hover:bg-zinc-800",children:[(0,a.jsx)(u.A,{className:"h-3.5 w-3.5"}),"Clear"]})]}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)(h.A,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-zinc-400"}),(0,a.jsx)("input",{type:"text",placeholder:"Search memories...",value:A,onChange:e=>C(e.target.value),className:"w-full rounded-lg border border-zinc-200 bg-white pl-10 pr-4 py-2.5 text-sm shadow-sm focus:border-zinc-400 focus:outline-none focus:ring-1 focus:ring-zinc-400 dark:border-zinc-700 dark:bg-zinc-900 dark:focus:border-zinc-600 dark:focus:ring-zinc-600"})]})]}),(0,a.jsx)("div",{className:"space-y-3",children:w?(0,a.jsx)("div",{className:"flex items-center justify-center py-12",children:(0,a.jsx)("div",{className:"h-8 w-8 animate-spin rounded-full border-4 border-zinc-200 border-t-zinc-900 dark:border-zinc-700 dark:border-t-zinc-50"})}):0===B.length?(0,a.jsx)("div",{className:"rounded-2xl border-2 border-dashed border-zinc-300 bg-zinc-50 p-8 text-center dark:border-zinc-700 dark:bg-zinc-900/50",children:(0,a.jsxs)("div",{className:"mx-auto max-w-lg space-y-4",children:[(0,a.jsx)("div",{className:"mx-auto flex h-12 w-12 items-center justify-center rounded-full bg-zinc-900 text-white dark:bg-zinc-100 dark:text-zinc-900",children:(0,a.jsx)(n.A,{className:"h-6 w-6"})}),(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)("h3",{className:"text-lg font-bold text-zinc-900 dark:text-zinc-50",children:A||"all"!==r?"No memory items found":"No Memory Items Yet"}),(0,a.jsx)("p",{className:"text-sm text-zinc-600 dark:text-zinc-400",children:A||"all"!==r?"Try adjusting your filters or search term":"Have your AI agent call the context_memory_save tool in your project to save commands, configs, and notes."})]})]})}):B.map(e=>{var t;let r,s=(t=e.category,r=k.find(e=>e.value===t),r?.icon||n.A);return(0,a.jsx)("div",{className:"group rounded-xl border border-zinc-200 bg-white p-6 shadow-sm transition-all hover:border-zinc-400 hover:shadow-md dark:border-zinc-800 dark:bg-zinc-900 dark:hover:border-zinc-600",children:(0,a.jsxs)("div",{className:"flex items-start justify-between",children:[(0,a.jsxs)("div",{className:"flex gap-4",children:[(0,a.jsx)("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-accent",children:(0,a.jsx)(s,{className:"h-5 w-5 text-accent-foreground"})}),(0,a.jsxs)("div",{className:"flex-1 space-y-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("span",{className:`rounded-md px-2 py-1 text-xs font-medium ${(e=>{switch(e){case"command":return"bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400";case"config":return"bg-purple-100 text-purple-700 dark:bg-purple-900/30 dark:text-purple-400";case"note":return"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400";default:return"bg-zinc-100 text-zinc-700 dark:bg-zinc-800 dark:text-zinc-300"}})(e.category)}`,children:e.category}),(0,a.jsx)("h3",{className:"font-semibold text-zinc-900 dark:text-zinc-50",children:e.key})]}),(0,a.jsx)("pre",{className:"whitespace-pre-wrap break-all rounded-lg bg-zinc-50 p-3 font-mono text-sm text-zinc-700 dark:bg-zinc-800 dark:text-zinc-300",children:e.value}),(0,a.jsxs)("div",{className:"flex items-center gap-3 text-xs text-zinc-500 dark:text-zinc-500",children:[!H&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"font-medium",children:e.project_path.split("/").pop()}),(0,a.jsx)("span",{children:"•"})]}),(0,a.jsxs)("span",{children:["Updated ",new Date(e.updated_at).toLocaleDateString()]})]})]})]}),(0,a.jsxs)("div",{className:"flex gap-2 opacity-0 transition-opacity group-hover:opacity-100",children:[(0,a.jsx)("button",{onClick:()=>{U({key:e.key,value:e.value,category:e.category}),D(e.id),I(e.project_path),S(!0)},className:"rounded-lg p-2 text-zinc-600 transition-colors hover:bg-zinc-100 dark:text-zinc-400 dark:hover:bg-zinc-800",children:(0,a.jsx)(p,{className:"h-4 w-4"})}),(0,a.jsx)("button",{onClick:()=>{R({key:e.key,projectPath:e.project_path}),L(!0)},className:"rounded-lg p-2 text-red-600 transition-colors hover:bg-red-50 dark:text-red-400 dark:hover:bg-red-900/20",children:(0,a.jsx)(g.A,{className:"h-4 w-4"})})]})]})},e.id)})}),M&&(0,a.jsx)("div",{className:"fixed inset-0 z-[100] flex items-center justify-center bg-black/50 p-4",children:(0,a.jsxs)("div",{className:"w-full max-w-2xl rounded-xl border border-zinc-200 bg-white shadow-2xl dark:border-zinc-700 dark:bg-zinc-900",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-zinc-200 dark:border-zinc-700",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 text-sm",children:[(0,a.jsx)("span",{className:"px-2 py-0.5 rounded border border-zinc-200 dark:border-zinc-700 text-zinc-600 dark:text-zinc-400 text-xs font-medium",children:H?H.split("/").pop():"PROJECT"}),(0,a.jsx)("span",{className:"text-zinc-400",children:"›"}),(0,a.jsx)("span",{className:"text-zinc-700 dark:text-zinc-300",children:q?"Edit memory":"New memory"})]}),(0,a.jsx)("button",{onClick:()=>{S(!1),D(null),I(null),U({key:"",value:"",category:"note"})},className:"p-1 rounded text-zinc-400 hover:text-zinc-600 hover:bg-zinc-100 dark:hover:text-zinc-300 dark:hover:bg-zinc-700",children:(0,a.jsx)(u.A,{className:"h-4 w-4"})})]}),(0,a.jsxs)("div",{className:"p-4 space-y-4",children:[(0,a.jsx)("input",{type:"text",value:O.key,onChange:e=>U({...O,key:e.target.value}),placeholder:"Memory key (e.g., run_tests)",autoFocus:!0,className:"w-full text-lg font-medium text-zinc-900 dark:text-zinc-100 placeholder:text-zinc-400 bg-transparent border-none outline-none"}),(0,a.jsx)("textarea",{value:O.value,onChange:e=>U({...O,value:e.target.value}),placeholder:"Value (e.g., npm test)",rows:4,className:"w-full text-sm text-zinc-600 dark:text-zinc-400 placeholder:text-zinc-400 bg-transparent border-none outline-none resize-none"})]}),(0,a.jsx)("div",{className:"px-4 py-3 border-t border-zinc-200 dark:border-zinc-700",children:(0,a.jsx)("div",{className:"flex flex-wrap items-center gap-2",children:(0,a.jsxs)("select",{value:O.category,onChange:e=>U({...O,category:e.target.value}),className:"h-7 rounded-md border border-zinc-200 dark:border-zinc-700 bg-transparent px-2 text-xs font-medium text-zinc-600 dark:text-zinc-400 focus:outline-none focus:ring-1 focus:ring-zinc-400",children:[(0,a.jsx)("option",{value:"command",children:"Command"}),(0,a.jsx)("option",{value:"config",children:"Config"}),(0,a.jsx)("option",{value:"note",children:"Note"})]})})}),(0,a.jsxs)("div",{className:"flex items-center justify-end gap-3 px-4 py-3 border-t border-zinc-200 dark:border-zinc-700",children:[(0,a.jsx)("button",{onClick:()=>{S(!1),D(null),I(null),U({key:"",value:"",category:"note"})},className:"px-3 py-1.5 text-sm text-zinc-600 hover:text-zinc-900 dark:text-zinc-400 dark:hover:text-zinc-100",children:"Cancel"}),(0,a.jsx)("button",{onClick:J,disabled:!O.key||!O.value,className:"px-3 py-1.5 text-sm font-medium rounded-md bg-zinc-900 text-white hover:bg-zinc-800 dark:bg-zinc-100 dark:text-zinc-900 dark:hover:bg-zinc-200 disabled:opacity-50 disabled:cursor-not-allowed",children:q?"Update Memory":"Create Memory"})]})]})}),(0,a.jsx)(y.T,{isOpen:E,onClose:()=>L(!1),onConfirm:Z,title:"Delete Memory",message:"Are you sure you want to delete this memory item? This action cannot be undone.",confirmText:"Delete",cancelText:"Cancel",variant:"danger"})]})}}},e=>{e.O(0,[2655,8704,7358],()=>e(e.s=3624)),_N_E=e.O()}]);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5105],{592:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(6748).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"}]])},808:(e,t,r)=>{"use strict";r.d(t,{ProjectsHeader:()=>u});var s=r(2638),n=r(6702),a=r(1422),i=r(3183),o=r(7787),d=r(7069),c=r(9443);function l({open:e,onOpenChange:t,onSuccess:r}){let[a,i]=(0,n.useState)(!1),[l,u]=(0,n.useState)(""),[x,m]=(0,n.useState)(""),[p,h]=(0,n.useState)(!1),[f,b]=(0,n.useState)(null);(0,n.useEffect)(()=>{i(!0)},[]),(0,n.useEffect)(()=>{e&&(u(""),m(""),b(null))},[e]),(0,n.useEffect)(()=>{if(!e)return;let r=e=>{"Escape"===e.key&&t(!1)};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[e,t]),(0,n.useEffect)(()=>{if(e)return document.body.style.overflow="hidden",()=>{document.body.style.overflow="unset"}},[e]);let g=async e=>{if(e.preventDefault(),!l.trim())return void b("Project name is required");h(!0),b(null);try{let e=await fetch("/api/projects",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:l.trim(),description:x.trim()||null})}),s=await e.json();if(!e.ok)throw Error(s.error||"Failed to create project");r(),t(!1)}catch(e){b(e instanceof Error?e.message:"Failed to create project")}finally{h(!1)}};return e&&a?(0,o.createPortal)((0,s.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[(0,s.jsx)("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm",onClick:()=>t(!1)}),(0,s.jsxs)("div",{className:"relative z-10 mx-4 w-full max-w-lg overflow-hidden rounded-xl border border-zinc-200 bg-white shadow-2xl dark:border-zinc-700 dark:bg-zinc-900",onClick:e=>e.stopPropagation(),onMouseDown:e=>e.stopPropagation(),children:[(0,s.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-zinc-200 dark:border-zinc-700",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 text-sm",children:[(0,s.jsx)("span",{className:"px-2 py-0.5 rounded border border-zinc-200 dark:border-zinc-700 text-zinc-600 dark:text-zinc-400 text-xs font-medium",children:"PROJECTS"}),(0,s.jsx)("span",{className:"text-zinc-400",children:"›"}),(0,s.jsx)("span",{className:"text-zinc-700 dark:text-zinc-300",children:"New project"})]}),(0,s.jsx)("button",{type:"button",onClick:()=>t(!1),className:"rounded p-1 text-zinc-400 hover:text-zinc-600 hover:bg-zinc-100 dark:hover:text-zinc-300 dark:hover:bg-zinc-800",children:(0,s.jsx)(d.A,{className:"h-4 w-4"})})]}),(0,s.jsxs)("form",{onSubmit:g,children:[(0,s.jsxs)("div",{className:"p-4 space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsxs)("label",{htmlFor:"project-name",className:"block text-sm font-medium text-zinc-700 dark:text-zinc-300 mb-2",children:["Project Name ",(0,s.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,s.jsx)("input",{id:"project-name",type:"text",value:l,onChange:e=>u(e.target.value),placeholder:"My Project",autoFocus:!0,className:"w-full rounded-lg border border-zinc-300 bg-white px-4 py-3 text-base text-zinc-900 placeholder:text-zinc-400 focus:border-zinc-500 focus:outline-none focus:ring-1 focus:ring-zinc-500 dark:border-zinc-700 dark:bg-zinc-800 dark:text-zinc-100 dark:placeholder:text-zinc-500 dark:focus:border-zinc-500"})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("label",{htmlFor:"project-description",className:"block text-sm font-medium text-zinc-700 dark:text-zinc-300 mb-2",children:["Description ",(0,s.jsx)("span",{className:"text-zinc-400",children:"(optional)"})]}),(0,s.jsx)("textarea",{id:"project-description",value:x,onChange:e=>m(e.target.value),placeholder:"A brief description of your project...",rows:3,className:"w-full rounded-lg border border-zinc-300 bg-white px-4 py-3 text-base text-zinc-900 placeholder:text-zinc-400 focus:border-zinc-500 focus:outline-none focus:ring-1 focus:ring-zinc-500 dark:border-zinc-700 dark:bg-zinc-800 dark:text-zinc-100 dark:placeholder:text-zinc-500 dark:focus:border-zinc-500 resize-none"})]}),f&&(0,s.jsx)("p",{className:"text-sm text-red-600 dark:text-red-400",children:f})]}),(0,s.jsxs)("div",{className:"flex justify-end gap-3 border-t border-zinc-200 p-4 dark:border-zinc-800",children:[(0,s.jsx)("button",{type:"button",onClick:()=>t(!1),className:"rounded-lg px-4 py-2 text-sm font-medium text-zinc-700 hover:bg-zinc-100 dark:text-zinc-300 dark:hover:bg-zinc-800",children:"Cancel"}),(0,s.jsx)("button",{type:"submit",disabled:p||!l.trim(),className:`rounded-lg px-4 py-2 text-sm font-medium ${l.trim()&&!p?"bg-zinc-900 text-white hover:bg-zinc-800 dark:bg-zinc-100 dark:text-zinc-900 dark:hover:bg-zinc-200":"bg-zinc-300 text-zinc-500 dark:bg-zinc-700 dark:text-zinc-400 cursor-not-allowed"}`,children:p?(0,s.jsxs)("span",{className:"flex items-center gap-2",children:[(0,s.jsx)(c.A,{className:"h-4 w-4 animate-spin"}),"Creating..."]}):"Create Project"})]})]})]})]}),document.body):null}function u(){let e=(0,a.useRouter)(),[t,r]=(0,n.useState)(!1);return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h1",{className:"text-2xl sm:text-3xl font-bold tracking-tight text-zinc-900 dark:text-zinc-50",children:"Projects"}),(0,s.jsx)("p",{className:"mt-1 sm:mt-2 text-sm text-zinc-600 dark:text-zinc-400",children:"Overview of all your projects and their session activity"})]}),(0,s.jsxs)("button",{onClick:()=>r(!0),className:"flex items-center gap-2 rounded-lg bg-zinc-900 px-4 py-2 text-sm font-medium text-white shadow-sm transition-colors hover:bg-zinc-800 dark:bg-zinc-100 dark:text-zinc-900 dark:hover:bg-zinc-200",children:[(0,s.jsx)(i.A,{className:"h-4 w-4"}),(0,s.jsx)("span",{className:"hidden sm:inline",children:"Create Project"}),(0,s.jsx)("span",{className:"sm:hidden",children:"New"})]})]}),(0,s.jsx)(l,{open:t,onOpenChange:r,onSuccess:()=>{e.refresh()}})]})}},1769:(e,t,r)=>{"use strict";r.d(t,{SQ:()=>d,_2:()=>c,mB:()=>l,rI:()=>i,ty:()=>o});var s=r(2638);r(6702);var n=r(9393),a=r(9059);function i({...e}){return(0,s.jsx)(n.bL,{"data-slot":"dropdown-menu",...e})}function o({...e}){return(0,s.jsx)(n.l9,{"data-slot":"dropdown-menu-trigger",...e})}function d({className:e,sideOffset:t=4,...r}){return(0,s.jsx)(n.ZL,{children:(0,s.jsx)(n.UC,{"data-slot":"dropdown-menu-content",sideOffset:t,className:(0,a.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",e),...r})})}function c({className:e,inset:t,variant:r="default",...i}){return(0,s.jsx)(n.q7,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":r,className:(0,a.cn)("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...i})}function l({className:e,...t}){return(0,s.jsx)(n.wv,{"data-slot":"dropdown-menu-separator",className:(0,a.cn)("bg-border -mx-1 my-1 h-px",e),...t})}},4758:(e,t,r)=>{"use strict";r.d(t,{q:()=>d});var s=r(2638),n=r(1192),a=r(1794),i=r(9059);let o={active:{bg:"bg-emerald-100 dark:bg-emerald-900/40",text:"text-emerald-700 dark:text-emerald-400",dot:"bg-emerald-500"},paused:{bg:"bg-amber-100 dark:bg-amber-900/40",text:"text-amber-700 dark:text-amber-400",dot:""},completed:{bg:"bg-zinc-100 dark:bg-zinc-800",text:"text-zinc-600 dark:text-zinc-400",dot:""}};function d({status:e,className:t,size:r="md",count:d}){let c=o[e],l={sm:"h-3 w-3",md:"h-3.5 w-3.5"};return(0,s.jsxs)("span",{className:(0,i.cn)("inline-flex items-center rounded-full font-semibold",c.bg,c.text,{sm:"px-2 py-0.5 text-[10px] gap-1",md:"px-2.5 py-1 text-xs gap-1.5"}[r],t),children:["active"===e&&(0,s.jsx)("span",{className:(0,i.cn)("rounded-full bg-emerald-500 animate-pulse",{sm:"h-1.5 w-1.5",md:"h-2 w-2"}[r])}),"paused"===e&&(0,s.jsx)(n.A,{className:l[r]}),"completed"===e&&(0,s.jsx)(a.A,{className:l[r]}),(0,s.jsx)("span",{className:"capitalize",children:void 0!==d?`${d} ${e}`:e})]})}},5100:(e,t,r)=>{Promise.resolve().then(r.bind(r,8361)),Promise.resolve().then(r.bind(r,808))},7653:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(6748).A)("folder-kanban",[["path",{d:"M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.93a2 2 0 0 1-1.66-.9l-.82-1.2A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2Z",key:"1fr9dc"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M12 10v2",key:"hh53o1"}],["path",{d:"M16 10v6",key:"1d6xys"}]])},8317:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(6748).A)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]])},8361:(e,t,r)=>{"use strict";r.d(t,{ProjectCard:()=>eE});var s=r(2638),n=r(6702),a=r(7653),i=r(6748);let o=(0,i.A)("activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]),d=(0,i.A)("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]),c=(0,i.A)("eye-off",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);var l=r(6253),u=r.n(l),x=r(1422),m=r(9260),p=r(5794);let h=(0,i.A)("git-merge",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M6 21V9a9 9 0 0 0 9 9",key:"7kw0sc"}]]);var f=r(592),b=r(1769),g=r(9443),j=r(8699),z=r(8360),v=r(5462),k=r(547),y=r(839),N=r(9638),w=r(3645),C=r(3830),E=r(825),D=r(9082),S=r(3033),A=r(5137),P=r(7631),_=r(8772),M="Dialog",[O,F]=(0,v.A)(M),[I,R]=O(M),T=e=>{let{__scopeDialog:t,children:r,open:a,defaultOpen:i,onOpenChange:o,modal:d=!0}=e,c=n.useRef(null),l=n.useRef(null),[u,x]=(0,y.i)({prop:a,defaultProp:i??!1,onChange:o,caller:M});return(0,s.jsx)(I,{scope:t,triggerRef:c,contentRef:l,contentId:(0,k.B)(),titleId:(0,k.B)(),descriptionId:(0,k.B)(),open:u,onOpenChange:x,onOpenToggle:n.useCallback(()=>x(e=>!e),[x]),modal:d,children:r})};T.displayName=M;var $="DialogTrigger";n.forwardRef((e,t)=>{let{__scopeDialog:r,...n}=e,a=R($,r),i=(0,z.s)(t,a.triggerRef);return(0,s.jsx)(D.sG.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":en(a.open),...n,ref:i,onClick:(0,j.mK)(e.onClick,a.onOpenToggle)})}).displayName=$;var L="DialogPortal",[q,J]=O(L,{forceMount:void 0}),B=e=>{let{__scopeDialog:t,forceMount:r,children:a,container:i}=e,o=R(L,t);return(0,s.jsx)(q,{scope:t,forceMount:r,children:n.Children.map(a,e=>(0,s.jsx)(E.C,{present:r||o.open,children:(0,s.jsx)(C.Z,{asChild:!0,container:i,children:e})}))})};B.displayName=L;var H="DialogOverlay",K=n.forwardRef((e,t)=>{let r=J(H,e.__scopeDialog),{forceMount:n=r.forceMount,...a}=e,i=R(H,e.__scopeDialog);return i.modal?(0,s.jsx)(E.C,{present:n||i.open,children:(0,s.jsx)(V,{...a,ref:t})}):null});K.displayName=H;var G=(0,_.TL)("DialogOverlay.RemoveScroll"),V=n.forwardRef((e,t)=>{let{__scopeDialog:r,...n}=e,a=R(H,r);return(0,s.jsx)(A.A,{as:G,allowPinchZoom:!0,shards:[a.contentRef],children:(0,s.jsx)(D.sG.div,{"data-state":en(a.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),W="DialogContent",Z=n.forwardRef((e,t)=>{let r=J(W,e.__scopeDialog),{forceMount:n=r.forceMount,...a}=e,i=R(W,e.__scopeDialog);return(0,s.jsx)(E.C,{present:n||i.open,children:i.modal?(0,s.jsx)(Q,{...a,ref:t}):(0,s.jsx)(U,{...a,ref:t})})});Z.displayName=W;var Q=n.forwardRef((e,t)=>{let r=R(W,e.__scopeDialog),a=n.useRef(null),i=(0,z.s)(t,r.contentRef,a);return n.useEffect(()=>{let e=a.current;if(e)return(0,P.Eq)(e)},[]),(0,s.jsx)(Y,{...e,ref:i,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:(0,j.mK)(e.onCloseAutoFocus,e=>{e.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:(0,j.mK)(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey;(2===t.button||r)&&e.preventDefault()}),onFocusOutside:(0,j.mK)(e.onFocusOutside,e=>e.preventDefault())})}),U=n.forwardRef((e,t)=>{let r=R(W,e.__scopeDialog),a=n.useRef(!1),i=n.useRef(!1);return(0,s.jsx)(Y,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(a.current||r.triggerRef.current?.focus(),t.preventDefault()),a.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(a.current=!0,"pointerdown"===t.detail.originalEvent.type&&(i.current=!0));let s=t.target;r.triggerRef.current?.contains(s)&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&i.current&&t.preventDefault()}})}),Y=n.forwardRef((e,t)=>{let{__scopeDialog:r,trapFocus:a,onOpenAutoFocus:i,onCloseAutoFocus:o,...d}=e,c=R(W,r),l=n.useRef(null),u=(0,z.s)(t,l);return(0,S.Oh)(),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(w.n,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:i,onUnmountAutoFocus:o,children:(0,s.jsx)(N.qW,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":en(c.open),...d,ref:u,onDismiss:()=>c.onOpenChange(!1)})}),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(ed,{titleId:c.titleId}),(0,s.jsx)(ec,{contentRef:l,descriptionId:c.descriptionId})]})]})}),X="DialogTitle",ee=n.forwardRef((e,t)=>{let{__scopeDialog:r,...n}=e,a=R(X,r);return(0,s.jsx)(D.sG.h2,{id:a.titleId,...n,ref:t})});ee.displayName=X;var et="DialogDescription";n.forwardRef((e,t)=>{let{__scopeDialog:r,...n}=e,a=R(et,r);return(0,s.jsx)(D.sG.p,{id:a.descriptionId,...n,ref:t})}).displayName=et;var er="DialogClose",es=n.forwardRef((e,t)=>{let{__scopeDialog:r,...n}=e,a=R(er,r);return(0,s.jsx)(D.sG.button,{type:"button",...n,ref:t,onClick:(0,j.mK)(e.onClick,()=>a.onOpenChange(!1))})});function en(e){return e?"open":"closed"}es.displayName=er;var ea="DialogTitleWarning",[ei,eo]=(0,v.q)(ea,{contentName:W,titleName:X,docsSlug:"dialog"}),ed=({titleId:e})=>{let t=eo(ea),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5105],{592:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(6748).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"}]])},808:(e,t,r)=>{"use strict";r.d(t,{ProjectsHeader:()=>u});var s=r(2638),n=r(6702),a=r(1422),i=r(3183),o=r(7787),d=r(7069),c=r(9443);function l({open:e,onOpenChange:t,onSuccess:r}){let[a,i]=(0,n.useState)(!1),[l,u]=(0,n.useState)(""),[x,m]=(0,n.useState)(""),[p,h]=(0,n.useState)(!1),[f,b]=(0,n.useState)(null);(0,n.useEffect)(()=>{i(!0)},[]),(0,n.useEffect)(()=>{e&&(u(""),m(""),b(null))},[e]),(0,n.useEffect)(()=>{if(!e)return;let r=e=>{"Escape"===e.key&&t(!1)};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[e,t]),(0,n.useEffect)(()=>{if(e)return document.body.style.overflow="hidden",()=>{document.body.style.overflow="unset"}},[e]);let g=async e=>{if(e.preventDefault(),!l.trim())return void b("Project name is required");h(!0),b(null);try{let e=await fetch("/api/projects",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:l.trim(),description:x.trim()||null})}),s=await e.json();if(!e.ok)throw Error(s.error||"Failed to create project");r(),t(!1)}catch(e){b(e instanceof Error?e.message:"Failed to create project")}finally{h(!1)}};return e&&a?(0,o.createPortal)((0,s.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[(0,s.jsx)("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm",onClick:()=>t(!1)}),(0,s.jsxs)("div",{className:"relative z-10 mx-4 w-full max-w-lg overflow-hidden rounded-xl border border-zinc-200 bg-white shadow-2xl dark:border-zinc-700 dark:bg-zinc-900",onClick:e=>e.stopPropagation(),onMouseDown:e=>e.stopPropagation(),children:[(0,s.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-zinc-200 dark:border-zinc-700",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 text-sm",children:[(0,s.jsx)("span",{className:"px-2 py-0.5 rounded border border-zinc-200 dark:border-zinc-700 text-zinc-600 dark:text-zinc-400 text-xs font-medium",children:"PROJECTS"}),(0,s.jsx)("span",{className:"text-zinc-400",children:"›"}),(0,s.jsx)("span",{className:"text-zinc-700 dark:text-zinc-300",children:"New project"})]}),(0,s.jsx)("button",{type:"button",onClick:()=>t(!1),className:"rounded p-1 text-zinc-400 hover:text-zinc-600 hover:bg-zinc-100 dark:hover:text-zinc-300 dark:hover:bg-zinc-800",children:(0,s.jsx)(d.A,{className:"h-4 w-4"})})]}),(0,s.jsxs)("form",{onSubmit:g,children:[(0,s.jsxs)("div",{className:"p-4 space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsxs)("label",{htmlFor:"project-name",className:"block text-sm font-medium text-zinc-700 dark:text-zinc-300 mb-2",children:["Project Name ",(0,s.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,s.jsx)("input",{id:"project-name",type:"text",value:l,onChange:e=>u(e.target.value),placeholder:"My Project",autoFocus:!0,className:"w-full rounded-lg border border-zinc-300 bg-white px-4 py-3 text-base text-zinc-900 placeholder:text-zinc-400 focus:border-zinc-500 focus:outline-none focus:ring-1 focus:ring-zinc-500 dark:border-zinc-700 dark:bg-zinc-800 dark:text-zinc-100 dark:placeholder:text-zinc-500 dark:focus:border-zinc-500"})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("label",{htmlFor:"project-description",className:"block text-sm font-medium text-zinc-700 dark:text-zinc-300 mb-2",children:["Description ",(0,s.jsx)("span",{className:"text-zinc-400",children:"(optional)"})]}),(0,s.jsx)("textarea",{id:"project-description",value:x,onChange:e=>m(e.target.value),placeholder:"A brief description of your project...",rows:3,className:"w-full rounded-lg border border-zinc-300 bg-white px-4 py-3 text-base text-zinc-900 placeholder:text-zinc-400 focus:border-zinc-500 focus:outline-none focus:ring-1 focus:ring-zinc-500 dark:border-zinc-700 dark:bg-zinc-800 dark:text-zinc-100 dark:placeholder:text-zinc-500 dark:focus:border-zinc-500 resize-none"})]}),f&&(0,s.jsx)("p",{className:"text-sm text-red-600 dark:text-red-400",children:f})]}),(0,s.jsxs)("div",{className:"flex justify-end gap-3 border-t border-zinc-200 p-4 dark:border-zinc-800",children:[(0,s.jsx)("button",{type:"button",onClick:()=>t(!1),className:"rounded-lg px-4 py-2 text-sm font-medium text-zinc-700 hover:bg-zinc-100 dark:text-zinc-300 dark:hover:bg-zinc-800",children:"Cancel"}),(0,s.jsx)("button",{type:"submit",disabled:p||!l.trim(),className:`rounded-lg px-4 py-2 text-sm font-medium ${l.trim()&&!p?"bg-zinc-900 text-white hover:bg-zinc-800 dark:bg-zinc-100 dark:text-zinc-900 dark:hover:bg-zinc-200":"bg-zinc-300 text-zinc-500 dark:bg-zinc-700 dark:text-zinc-400 cursor-not-allowed"}`,children:p?(0,s.jsxs)("span",{className:"flex items-center gap-2",children:[(0,s.jsx)(c.A,{className:"h-4 w-4 animate-spin"}),"Creating..."]}):"Create Project"})]})]})]})]}),document.body):null}function u(){let e=(0,a.useRouter)(),[t,r]=(0,n.useState)(!1);return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h1",{className:"text-2xl sm:text-3xl font-bold tracking-tight text-zinc-900 dark:text-zinc-50",children:"Projects"}),(0,s.jsx)("p",{className:"mt-1 sm:mt-2 text-sm text-zinc-600 dark:text-zinc-400",children:"Overview of all your projects and their session activity"})]}),(0,s.jsxs)("button",{onClick:()=>r(!0),className:"flex items-center gap-2 rounded-lg bg-zinc-900 px-4 py-2 text-sm font-medium text-white shadow-sm transition-colors hover:bg-zinc-800 dark:bg-zinc-100 dark:text-zinc-900 dark:hover:bg-zinc-200",children:[(0,s.jsx)(i.A,{className:"h-4 w-4"}),(0,s.jsx)("span",{className:"hidden sm:inline",children:"Create Project"}),(0,s.jsx)("span",{className:"sm:hidden",children:"New"})]})]}),(0,s.jsx)(l,{open:t,onOpenChange:r,onSuccess:()=>{e.refresh()}})]})}},1769:(e,t,r)=>{"use strict";r.d(t,{SQ:()=>d,_2:()=>c,mB:()=>l,rI:()=>i,ty:()=>o});var s=r(2638);r(6702);var n=r(9393),a=r(9059);function i({...e}){return(0,s.jsx)(n.bL,{"data-slot":"dropdown-menu",...e})}function o({...e}){return(0,s.jsx)(n.l9,{"data-slot":"dropdown-menu-trigger",...e})}function d({className:e,sideOffset:t=4,...r}){return(0,s.jsx)(n.ZL,{children:(0,s.jsx)(n.UC,{"data-slot":"dropdown-menu-content",sideOffset:t,className:(0,a.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",e),...r})})}function c({className:e,inset:t,variant:r="default",...i}){return(0,s.jsx)(n.q7,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":r,className:(0,a.cn)("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...i})}function l({className:e,...t}){return(0,s.jsx)(n.wv,{"data-slot":"dropdown-menu-separator",className:(0,a.cn)("bg-border -mx-1 my-1 h-px",e),...t})}},4758:(e,t,r)=>{"use strict";r.d(t,{q:()=>d});var s=r(2638),n=r(1192),a=r(1794),i=r(9059);let o={active:{bg:"bg-emerald-100 dark:bg-emerald-900/40",text:"text-emerald-700 dark:text-emerald-400",dot:"bg-emerald-500"},paused:{bg:"bg-amber-100 dark:bg-amber-900/40",text:"text-amber-700 dark:text-amber-400",dot:""},completed:{bg:"bg-zinc-100 dark:bg-zinc-800",text:"text-zinc-600 dark:text-zinc-400",dot:""}};function d({status:e,className:t,size:r="md",count:d}){let c=o[e],l={sm:"h-3 w-3",md:"h-3.5 w-3.5"};return(0,s.jsxs)("span",{className:(0,i.cn)("inline-flex items-center rounded-full font-semibold",c.bg,c.text,{sm:"px-2 py-0.5 text-[10px] gap-1",md:"px-2.5 py-1 text-xs gap-1.5"}[r],t),children:["active"===e&&(0,s.jsx)("span",{className:(0,i.cn)("rounded-full bg-emerald-500 animate-pulse",{sm:"h-1.5 w-1.5",md:"h-2 w-2"}[r])}),"paused"===e&&(0,s.jsx)(n.A,{className:l[r]}),"completed"===e&&(0,s.jsx)(a.A,{className:l[r]}),(0,s.jsx)("span",{className:"capitalize",children:void 0!==d?`${d} ${e}`:e})]})}},5100:(e,t,r)=>{Promise.resolve().then(r.bind(r,8361)),Promise.resolve().then(r.bind(r,808))},7653:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(6748).A)("folder-kanban",[["path",{d:"M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.93a2 2 0 0 1-1.66-.9l-.82-1.2A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2Z",key:"1fr9dc"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M12 10v2",key:"hh53o1"}],["path",{d:"M16 10v6",key:"1d6xys"}]])},8317:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(6748).A)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]])},8361:(e,t,r)=>{"use strict";r.d(t,{ProjectCard:()=>eE});var s=r(2638),n=r(6702),a=r(7653),i=r(6748);let o=(0,i.A)("activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]),d=(0,i.A)("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]),c=(0,i.A)("eye-off",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);var l=r(6253),u=r.n(l),x=r(1422),m=r(9260),p=r(5794);let h=(0,i.A)("git-merge",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M6 21V9a9 9 0 0 0 9 9",key:"7kw0sc"}]]);var f=r(592),b=r(1769),g=r(9443),j=r(8699),z=r(5979),v=r(5462),k=r(547),y=r(839),N=r(9638),w=r(3645),C=r(3830),E=r(825),D=r(9082),S=r(3033),A=r(5137),P=r(7631),_=r(8772),M="Dialog",[O,F]=(0,v.A)(M),[I,R]=O(M),T=e=>{let{__scopeDialog:t,children:r,open:a,defaultOpen:i,onOpenChange:o,modal:d=!0}=e,c=n.useRef(null),l=n.useRef(null),[u,x]=(0,y.i)({prop:a,defaultProp:i??!1,onChange:o,caller:M});return(0,s.jsx)(I,{scope:t,triggerRef:c,contentRef:l,contentId:(0,k.B)(),titleId:(0,k.B)(),descriptionId:(0,k.B)(),open:u,onOpenChange:x,onOpenToggle:n.useCallback(()=>x(e=>!e),[x]),modal:d,children:r})};T.displayName=M;var $="DialogTrigger";n.forwardRef((e,t)=>{let{__scopeDialog:r,...n}=e,a=R($,r),i=(0,z.s)(t,a.triggerRef);return(0,s.jsx)(D.sG.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":en(a.open),...n,ref:i,onClick:(0,j.mK)(e.onClick,a.onOpenToggle)})}).displayName=$;var L="DialogPortal",[q,J]=O(L,{forceMount:void 0}),B=e=>{let{__scopeDialog:t,forceMount:r,children:a,container:i}=e,o=R(L,t);return(0,s.jsx)(q,{scope:t,forceMount:r,children:n.Children.map(a,e=>(0,s.jsx)(E.C,{present:r||o.open,children:(0,s.jsx)(C.Z,{asChild:!0,container:i,children:e})}))})};B.displayName=L;var H="DialogOverlay",K=n.forwardRef((e,t)=>{let r=J(H,e.__scopeDialog),{forceMount:n=r.forceMount,...a}=e,i=R(H,e.__scopeDialog);return i.modal?(0,s.jsx)(E.C,{present:n||i.open,children:(0,s.jsx)(V,{...a,ref:t})}):null});K.displayName=H;var G=(0,_.TL)("DialogOverlay.RemoveScroll"),V=n.forwardRef((e,t)=>{let{__scopeDialog:r,...n}=e,a=R(H,r);return(0,s.jsx)(A.A,{as:G,allowPinchZoom:!0,shards:[a.contentRef],children:(0,s.jsx)(D.sG.div,{"data-state":en(a.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),W="DialogContent",Z=n.forwardRef((e,t)=>{let r=J(W,e.__scopeDialog),{forceMount:n=r.forceMount,...a}=e,i=R(W,e.__scopeDialog);return(0,s.jsx)(E.C,{present:n||i.open,children:i.modal?(0,s.jsx)(Q,{...a,ref:t}):(0,s.jsx)(U,{...a,ref:t})})});Z.displayName=W;var Q=n.forwardRef((e,t)=>{let r=R(W,e.__scopeDialog),a=n.useRef(null),i=(0,z.s)(t,r.contentRef,a);return n.useEffect(()=>{let e=a.current;if(e)return(0,P.Eq)(e)},[]),(0,s.jsx)(Y,{...e,ref:i,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:(0,j.mK)(e.onCloseAutoFocus,e=>{e.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:(0,j.mK)(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey;(2===t.button||r)&&e.preventDefault()}),onFocusOutside:(0,j.mK)(e.onFocusOutside,e=>e.preventDefault())})}),U=n.forwardRef((e,t)=>{let r=R(W,e.__scopeDialog),a=n.useRef(!1),i=n.useRef(!1);return(0,s.jsx)(Y,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(a.current||r.triggerRef.current?.focus(),t.preventDefault()),a.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(a.current=!0,"pointerdown"===t.detail.originalEvent.type&&(i.current=!0));let s=t.target;r.triggerRef.current?.contains(s)&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&i.current&&t.preventDefault()}})}),Y=n.forwardRef((e,t)=>{let{__scopeDialog:r,trapFocus:a,onOpenAutoFocus:i,onCloseAutoFocus:o,...d}=e,c=R(W,r),l=n.useRef(null),u=(0,z.s)(t,l);return(0,S.Oh)(),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(w.n,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:i,onUnmountAutoFocus:o,children:(0,s.jsx)(N.qW,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":en(c.open),...d,ref:u,onDismiss:()=>c.onOpenChange(!1)})}),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(ed,{titleId:c.titleId}),(0,s.jsx)(ec,{contentRef:l,descriptionId:c.descriptionId})]})]})}),X="DialogTitle",ee=n.forwardRef((e,t)=>{let{__scopeDialog:r,...n}=e,a=R(X,r);return(0,s.jsx)(D.sG.h2,{id:a.titleId,...n,ref:t})});ee.displayName=X;var et="DialogDescription";n.forwardRef((e,t)=>{let{__scopeDialog:r,...n}=e,a=R(et,r);return(0,s.jsx)(D.sG.p,{id:a.descriptionId,...n,ref:t})}).displayName=et;var er="DialogClose",es=n.forwardRef((e,t)=>{let{__scopeDialog:r,...n}=e,a=R(er,r);return(0,s.jsx)(D.sG.button,{type:"button",...n,ref:t,onClick:(0,j.mK)(e.onClick,()=>a.onOpenChange(!1))})});function en(e){return e?"open":"closed"}es.displayName=er;var ea="DialogTitleWarning",[ei,eo]=(0,v.q)(ea,{contentName:W,titleName:X,docsSlug:"dialog"}),ed=({titleId:e})=>{let t=eo(ea),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
2
2
|
|
|
3
3
|
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
4
4
|
|
|
5
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return n.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},ec=({contentRef:e,descriptionId:t})=>{let r=eo("DialogDescriptionWarning"),s=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${r.contentName}}.`;return n.useEffect(()=>{let r=e.current?.getAttribute("aria-describedby");t&&r&&(document.getElementById(t)||console.warn(s))},[s,e,t]),null},el=r(7069),eu=r(9059);function ex({...e}){return(0,s.jsx)(T,{"data-slot":"dialog",...e})}function em({...e}){return(0,s.jsx)(B,{"data-slot":"dialog-portal",...e})}function ep({className:e,...t}){return(0,s.jsx)(K,{"data-slot":"dialog-overlay",className:(0,eu.cn)("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...t})}function eh({className:e,children:t,showCloseButton:r=!0,...n}){return(0,s.jsxs)(em,{"data-slot":"dialog-portal",children:[(0,s.jsx)(ep,{}),(0,s.jsxs)(Z,{"data-slot":"dialog-content",className:(0,eu.cn)("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",e),...n,children:[t,r&&(0,s.jsxs)(es,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[(0,s.jsx)(el.A,{}),(0,s.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})}function ef({className:e,...t}){return(0,s.jsx)("div",{"data-slot":"dialog-header",className:(0,eu.cn)("flex flex-col gap-2 text-center sm:text-left",e),...t})}function eb({className:e,...t}){return(0,s.jsx)("div",{"data-slot":"dialog-footer",className:(0,eu.cn)("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function eg({className:e,...t}){return(0,s.jsx)(ee,{"data-slot":"dialog-title",className:(0,eu.cn)("text-lg leading-none font-semibold",e),...t})}function ej({open:e,onOpenChange:t,projectId:r,projectName:a,onSuccess:i}){let[o,d]=(0,n.useState)(a),[c,l]=(0,n.useState)(!1),[u,x]=(0,n.useState)(null);(0,n.useEffect)(()=>{e&&(d(a),x(null))},[e,a]);let m=o.trim()&&o.trim()!==a,h=async()=>{if(m){l(!0),x(null);try{let e=await fetch(`/api/projects/${r}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:o.trim()})});if(!e.ok){let t=await e.json();throw Error(t.error||"Failed to rename project")}i(),t(!1)}catch(e){x(e instanceof Error?e.message:"Failed to rename project")}finally{l(!1)}}},f=()=>{c||t(!1)};return(0,s.jsx)(ex,{open:e,onOpenChange:f,children:(0,s.jsxs)(eh,{className:"bg-white dark:bg-zinc-900",children:[(0,s.jsx)(ef,{children:(0,s.jsxs)(eg,{className:"flex items-center gap-2",children:[(0,s.jsx)(p.A,{className:"h-5 w-5"}),"Rename Project"]})}),(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("label",{htmlFor:"project-name",className:"text-sm font-medium text-zinc-900 dark:text-zinc-100",children:"Project Name"}),(0,s.jsx)("input",{id:"project-name",type:"text",value:o,onChange:e=>d(e.target.value),onKeyDown:e=>{"Enter"===e.key&&m&&h()},disabled:c,autoFocus:!0,className:"w-full rounded-lg border border-zinc-300 bg-white px-3 py-2 text-sm text-zinc-900 placeholder:text-zinc-400 focus:border-zinc-900 focus:outline-none focus:ring-1 focus:ring-zinc-900 disabled:opacity-50 dark:border-zinc-700 dark:bg-zinc-800 dark:text-zinc-100 dark:placeholder:text-zinc-600 dark:focus:border-zinc-100 dark:focus:ring-zinc-100"})]}),u&&(0,s.jsx)("div",{className:"rounded-lg border border-red-200 bg-red-50 p-3 dark:border-red-900 dark:bg-red-950/30",children:(0,s.jsx)("p",{className:"text-sm text-red-900 dark:text-red-200",children:u})})]}),(0,s.jsxs)(eb,{children:[(0,s.jsx)("button",{onClick:f,disabled:c,className:"rounded-lg border-2 border-zinc-200 px-4 py-2 font-medium text-zinc-900 hover:bg-zinc-50 disabled:opacity-50 dark:border-zinc-800 dark:text-zinc-100 dark:hover:bg-zinc-800",children:"Cancel"}),(0,s.jsx)("button",{onClick:h,disabled:!m||c,className:"rounded-lg bg-zinc-900 px-4 py-2 font-medium text-white hover:bg-zinc-800 disabled:opacity-50 dark:bg-zinc-100 dark:text-zinc-900 dark:hover:bg-zinc-200",children:c?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(g.A,{className:"mr-2 inline h-4 w-4 animate-spin"}),"Saving..."]}):"Save"})]})]})})}var ez=r(7787),ev=r(8317),ek=r(5979);function ey({open:e,onOpenChange:t,projectId:r,projectName:a,sessionCount:i,onSuccess:o}){let[d,c]=(0,n.useState)(!1),[l,u]=(0,n.useState)([]),[x,m]=(0,n.useState)(!1),[p,f]=(0,n.useState)(!1),[b,j]=(0,n.useState)(null),[z,v]=(0,n.useState)("");(0,n.useEffect)(()=>{c(!0)},[]),(0,n.useEffect)(()=>{e&&(j(null),v(""),k())},[e]),(0,n.useEffect)(()=>{if(!e)return;let r=e=>{"Escape"===e.key&&t(!1)};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[e,t]),(0,n.useEffect)(()=>{if(e)return document.body.style.overflow="hidden",()=>{document.body.style.overflow="unset"}},[e]);let k=async()=>{f(!0);try{let e=await fetch("/api/projects");if(e.ok){let t=((await e.json()).projects||[]).filter(e=>e.id!==r);u(t)}}catch{j("Failed to load projects")}finally{f(!1)}},y=l.find(e=>e.id===z),N=async()=>{if(z){m(!0),j(null);try{let e=await fetch(`/api/projects/${r}/merge`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({targetProjectId:z})}),s=await e.json();if(!e.ok)throw Error(s.error||"Failed to merge projects");o(),t(!1)}catch(e){j(e instanceof Error?e.message:"Failed to merge projects")}finally{m(!1)}}};return e&&d?(0,ez.createPortal)((0,s.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[(0,s.jsx)("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm",onClick:()=>t(!1)}),(0,s.jsxs)("div",{className:"relative z-10 mx-4 w-full max-w-lg max-h-[90vh] overflow-hidden rounded-2xl border border-zinc-200 bg-white shadow-2xl dark:border-zinc-800 dark:bg-zinc-900",onClick:e=>e.stopPropagation(),onMouseDown:e=>e.stopPropagation(),children:[(0,s.jsxs)("div",{className:"flex items-start justify-between border-b border-zinc-200 p-6 dark:border-zinc-800",children:[(0,s.jsxs)("div",{className:"flex gap-4",children:[(0,s.jsx)("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-zinc-100 dark:bg-zinc-800",children:(0,s.jsx)(h,{className:"h-5 w-5 text-zinc-600 dark:text-zinc-400"})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h2",{className:"text-lg font-semibold text-zinc-900 dark:text-zinc-50",children:"Merge Project"}),(0,s.jsx)("p",{className:"text-sm text-zinc-500 dark:text-zinc-400",children:"Move sessions to another project"})]})]}),(0,s.jsx)("button",{onClick:()=>t(!1),className:"rounded-lg p-2 text-zinc-500 hover:bg-zinc-100 dark:text-zinc-400 dark:hover:bg-zinc-800",children:(0,s.jsx)(el.A,{className:"h-5 w-5"})})]}),(0,s.jsxs)("div",{className:"max-h-[calc(90vh-14rem)] overflow-y-auto p-6",children:[(0,s.jsxs)("p",{className:"mb-4 text-sm text-zinc-600 dark:text-zinc-400",children:["Merge ",(0,s.jsx)("span",{className:"font-medium text-zinc-900 dark:text-zinc-100",children:a})," into:"]}),p?(0,s.jsx)("div",{className:"flex items-center justify-center py-8",children:(0,s.jsx)(g.A,{className:"h-6 w-6 animate-spin text-zinc-400"})}):0===l.length?(0,s.jsx)("div",{className:"rounded-lg bg-amber-50 p-4 dark:bg-amber-950/30",children:(0,s.jsx)("p",{className:"text-sm text-amber-800 dark:text-amber-200",children:"No other projects available to merge into."})}):(0,s.jsx)("div",{className:"space-y-2",children:l.map(e=>(0,s.jsxs)("button",{onClick:()=>v(e.id),className:`flex w-full items-center justify-between rounded-lg border p-4 text-left transition-colors ${z===e.id?"border-zinc-900 bg-zinc-50 dark:border-zinc-100 dark:bg-zinc-800":"border-zinc-200 hover:border-zinc-400 hover:bg-zinc-50 dark:border-zinc-700 dark:hover:border-zinc-600 dark:hover:bg-zinc-800/50"}`,children:[(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsx)("div",{className:"font-medium text-zinc-900 dark:text-zinc-100",children:e.name}),(0,s.jsxs)("div",{className:"text-sm text-zinc-500 dark:text-zinc-400 truncate",children:[e.session_count," sessions",e.source_path&&` \xb7 ${e.source_path}`]})]}),z===e.id&&(0,s.jsx)("div",{className:"ml-3 flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-zinc-900 dark:bg-zinc-100",children:(0,s.jsx)(ev.A,{className:"h-4 w-4 text-white dark:text-zinc-900"})})]},e.id))}),y&&(0,s.jsx)("div",{className:"mt-4 rounded-lg bg-amber-50 p-4 dark:bg-amber-950/30",children:(0,s.jsxs)("div",{className:"flex gap-3",children:[(0,s.jsx)(ek.A,{className:"h-5 w-5 shrink-0 text-amber-600 dark:text-amber-400"}),(0,s.jsxs)("div",{className:"text-sm",children:[(0,s.jsxs)("p",{className:"font-medium text-amber-800 dark:text-amber-200",children:[i," ",1===i?"session":"sessions"," will be moved"]}),(0,s.jsxs)("p",{className:"mt-1 text-amber-700 dark:text-amber-300",children:['"',a,'" will be deleted after merge']})]})]})}),b&&(0,s.jsx)("p",{className:"mt-4 text-sm text-red-600 dark:text-red-400",children:b})]}),(0,s.jsxs)("div",{className:"flex justify-end gap-3 border-t border-zinc-200 p-4 dark:border-zinc-800",children:[(0,s.jsx)("button",{type:"button",onClick:()=>t(!1),className:"rounded-lg px-4 py-2 text-sm font-medium text-zinc-700 hover:bg-zinc-100 dark:text-zinc-300 dark:hover:bg-zinc-800",children:"Cancel"}),(0,s.jsx)("button",{type:"button",onClick:N,disabled:x||!z,className:`rounded-lg px-4 py-2 text-sm font-medium ${z&&!x?"bg-zinc-900 text-white hover:bg-zinc-800 dark:bg-zinc-100 dark:text-zinc-900 dark:hover:bg-zinc-200":"bg-zinc-300 text-zinc-500 dark:bg-zinc-700 dark:text-zinc-400 cursor-not-allowed"}`,children:x?"Merging...":"Merge Projects"})]})]})]}),document.body):null}function eN({open:e,onOpenChange:t,projectId:r,projectName:a,sessionCount:i,onDelete:o}){let[d,c]=(0,n.useState)(!1),[l,u]=(0,n.useState)(""),[x,m]=(0,n.useState)(!1),[p,h]=(0,n.useState)(null),f="DELETE"===l;(0,n.useEffect)(()=>{c(!0)},[]),(0,n.useEffect)(()=>{e&&(u(""),h(null))},[e]),(0,n.useEffect)(()=>{if(!e)return;let r=e=>{"Escape"!==e.key||x||t(!1)};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[e,x,t]),(0,n.useEffect)(()=>{if(e)return document.body.style.overflow="hidden",()=>{document.body.style.overflow="unset"}},[e]);let b=async()=>{if(f){m(!0),h(null);try{let e=await fetch(`/api/projects/${r}`,{method:"DELETE"}),s=await e.json();if(!e.ok)throw Error(s.error||"Failed to delete project");o(),t(!1)}catch(e){h(e instanceof Error?e.message:"Failed to delete project")}finally{m(!1)}}};return e&&d?(0,ez.createPortal)((0,s.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[(0,s.jsx)("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm",onClick:()=>!x&&t(!1)}),(0,s.jsxs)("div",{className:"relative z-10 mx-4 w-full max-w-md overflow-hidden rounded-2xl border border-zinc-200 bg-white shadow-2xl dark:border-zinc-800 dark:bg-zinc-900",onClick:e=>e.stopPropagation(),onMouseDown:e=>e.stopPropagation(),children:[(0,s.jsxs)("div",{className:"flex items-start justify-between border-b border-zinc-200 p-6 dark:border-zinc-800",children:[(0,s.jsxs)("div",{className:"flex gap-4",children:[(0,s.jsx)("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-red-100 dark:bg-red-950/50",children:(0,s.jsx)(ek.A,{className:"h-5 w-5 text-red-600 dark:text-red-400"})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h2",{className:"text-lg font-semibold text-zinc-900 dark:text-zinc-50",children:"Delete Project"}),(0,s.jsx)("p",{className:"text-sm text-zinc-500 dark:text-zinc-400",children:"This action cannot be undone"})]})]}),(0,s.jsx)("button",{onClick:()=>!x&&t(!1),disabled:x,className:"rounded-lg p-2 text-zinc-500 hover:bg-zinc-100 disabled:opacity-50 dark:text-zinc-400 dark:hover:bg-zinc-800",children:(0,s.jsx)(el.A,{className:"h-5 w-5"})})]}),(0,s.jsxs)("div",{className:"p-6 space-y-4",children:[(0,s.jsxs)("p",{className:"text-sm text-zinc-600 dark:text-zinc-400",children:["You are about to permanently delete"," ",(0,s.jsx)("span",{className:"font-semibold text-zinc-900 dark:text-zinc-100",children:a})]}),(0,s.jsxs)("div",{className:"rounded-lg bg-red-50 p-4 dark:bg-red-950/30",children:[(0,s.jsx)("p",{className:"text-sm font-medium text-red-800 dark:text-red-200 mb-2",children:"This will permanently delete:"}),(0,s.jsxs)("ul",{className:"list-inside list-disc space-y-1 text-sm text-red-700 dark:text-red-300",children:[(0,s.jsxs)("li",{children:[i," ",1===i?"session":"sessions"]}),(0,s.jsx)("li",{children:"All context items in those sessions"}),(0,s.jsx)("li",{children:"All checkpoints for those sessions"}),(0,s.jsx)("li",{children:"All tasks for this project"}),(0,s.jsx)("li",{children:"All memory items for this project"})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("label",{htmlFor:"confirm-delete",className:"block text-sm font-medium text-zinc-700 dark:text-zinc-300 mb-2",children:["Type ",(0,s.jsx)("span",{className:"font-mono font-bold",children:"DELETE"})," to confirm:"]}),(0,s.jsx)("input",{id:"confirm-delete",type:"text",value:l,onChange:e=>u(e.target.value),disabled:x,placeholder:"DELETE",autoComplete:"off",className:"w-full rounded-lg border border-zinc-300 bg-white px-4 py-3 text-base text-zinc-900 placeholder:text-zinc-400 focus:border-zinc-500 focus:outline-none focus:ring-1 focus:ring-zinc-500 disabled:opacity-50 dark:border-zinc-700 dark:bg-zinc-800 dark:text-zinc-100 dark:placeholder:text-zinc-500 dark:focus:border-zinc-500"})]}),p&&(0,s.jsx)("p",{className:"text-sm text-red-600 dark:text-red-400",children:p})]}),(0,s.jsxs)("div",{className:"flex justify-end gap-3 border-t border-zinc-200 p-4 dark:border-zinc-800",children:[(0,s.jsx)("button",{type:"button",onClick:()=>t(!1),disabled:x,className:"rounded-lg px-4 py-2 text-sm font-medium text-zinc-700 hover:bg-zinc-100 disabled:opacity-50 dark:text-zinc-300 dark:hover:bg-zinc-800",children:"Cancel"}),(0,s.jsx)("button",{type:"button",onClick:b,disabled:!f||x,className:`rounded-lg px-4 py-2 text-sm font-medium ${f&&!x?"bg-red-600 text-white hover:bg-red-700":"bg-zinc-300 text-zinc-500 dark:bg-zinc-700 dark:text-zinc-400 cursor-not-allowed"}`,children:x?(0,s.jsxs)("span",{className:"flex items-center gap-2",children:[(0,s.jsx)(g.A,{className:"h-4 w-4 animate-spin"}),"Deleting..."]}):"Delete Project"})]})]})]}),document.body):null}function ew({projectId:e,projectName:t,projectPath:r,sessionCount:a}){let i=(0,x.useRouter)(),[o,d]=(0,n.useState)(!1),[c,l]=(0,n.useState)(!1),[u,g]=(0,n.useState)(!1),[j,z]=(0,n.useState)(!1),v=()=>{i.refresh()},k=e=>{e.preventDefault(),e.stopPropagation()};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(b.rI,{open:o,onOpenChange:d,children:[(0,s.jsx)(b.ty,{asChild:!0,children:(0,s.jsx)("button",{className:"rounded-lg border border-zinc-200 bg-white p-2 shadow-sm transition-all hover:border-zinc-400 hover:bg-zinc-50 dark:border-zinc-800 dark:bg-zinc-900 dark:hover:border-zinc-600 dark:hover:bg-zinc-800",onClick:k,onMouseDown:k,children:(0,s.jsx)(m.A,{className:"h-4 w-4 text-zinc-600 dark:text-zinc-400"})})}),(0,s.jsxs)(b.SQ,{align:"end",className:"w-48 bg-white dark:bg-zinc-900",onClick:k,onMouseDown:k,children:[(0,s.jsxs)(b._2,{onClick:e=>{k(e),d(!1),l(!0)},onMouseDown:k,children:[(0,s.jsx)(p.A,{className:"h-4 w-4"}),"Rename"]}),(0,s.jsxs)(b._2,{onClick:e=>{k(e),d(!1),g(!0)},onMouseDown:k,children:[(0,s.jsx)(h,{className:"h-4 w-4"}),"Merge into..."]}),(0,s.jsx)(b.mB,{}),(0,s.jsxs)(b._2,{variant:"destructive",onClick:e=>{k(e),d(!1),z(!0)},onMouseDown:k,children:[(0,s.jsx)(f.A,{className:"h-4 w-4"}),"Delete"]})]})]}),(0,s.jsx)(ej,{open:c,onOpenChange:l,projectId:e,projectName:t,onSuccess:v}),(0,s.jsx)(ey,{open:u,onOpenChange:g,projectId:e,projectName:t,sessionCount:a,onSuccess:v}),(0,s.jsx)(eN,{open:j,onOpenChange:z,projectId:e,projectName:t,sessionCount:a,onDelete:v})]})}var eC=r(4758);function eE({project:e}){let[t,r]=(0,n.useState)(!1),i=e.name;return(0,n.useEffect)(()=>{let t=localStorage.getItem("hiddenProjects");t&&r(JSON.parse(t).includes(e.id))},[e.id]),(0,s.jsx)(s.Fragment,{children:(0,s.jsxs)("div",{className:"group relative overflow-hidden rounded-xl border border-zinc-200 bg-white shadow-sm transition-all hover:border-zinc-400 hover:shadow-md dark:border-zinc-800 dark:bg-zinc-900 dark:hover:border-zinc-600",children:[(0,s.jsx)(u(),{href:`/dashboard/sessions?projectId=${encodeURIComponent(e.id)}`,className:"block p-6",children:(0,s.jsxs)("div",{className:`space-y-3 transition-all ${t?"blur-md select-none":""}`,children:[(0,s.jsx)("div",{className:"flex items-start justify-between",children:(0,s.jsx)(a.A,{className:"h-6 w-6 text-zinc-900 dark:text-zinc-50"})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"font-semibold text-zinc-900 transition-colors dark:text-zinc-50",children:i}),e.source_path&&(0,s.jsx)("p",{className:"mt-1 line-clamp-1 text-xs text-zinc-500 dark:text-zinc-500",children:e.source_path})]}),(0,s.jsxs)("div",{className:"flex gap-4 text-sm text-zinc-600 dark:text-zinc-400",children:[(0,s.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,s.jsx)(a.A,{className:"h-4 w-4"}),(0,s.jsxs)("span",{children:[e.session_count," sessions"]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,s.jsx)(o,{className:"h-4 w-4"}),(0,s.jsxs)("span",{children:[e.total_items," items"]})]})]})]})}),(0,s.jsxs)("div",{className:"absolute top-3 right-3 flex gap-2 opacity-0 transition-all group-hover:opacity-100",children:[(0,s.jsx)("button",{onClick:s=>{s.preventDefault(),s.stopPropagation();let n=localStorage.getItem("hiddenProjects"),a=n?JSON.parse(n):[];if(t){let t=a.filter(t=>t!==e.id);localStorage.setItem("hiddenProjects",JSON.stringify(t)),r(!1)}else a.push(e.id),localStorage.setItem("hiddenProjects",JSON.stringify(a)),r(!0)},className:"rounded-lg border border-zinc-200 bg-white p-2 shadow-sm transition-all hover:border-zinc-400 hover:bg-zinc-50 dark:border-zinc-800 dark:bg-zinc-900 dark:hover:border-zinc-600 dark:hover:bg-zinc-800",title:t?"Show project":"Hide project",children:t?(0,s.jsx)(d,{className:"h-4 w-4 text-zinc-600 dark:text-zinc-400"}):(0,s.jsx)(c,{className:"h-4 w-4 text-zinc-600 dark:text-zinc-400"})}),(0,s.jsx)(ew,{projectId:e.id,projectName:i,projectPath:e.project_path,sessionCount:e.session_count})]}),e.active_sessions>0&&(0,s.jsx)("div",{className:"absolute bottom-3 right-3",children:(0,s.jsx)(eC.q,{status:"active",count:e.active_sessions,size:"sm"})})]})})}},9059:(e,t,r)=>{"use strict";r.d(t,{cn:()=>a});var s=r(8462),n=r(3020);function a(...e){return(0,n.QP)((0,s.$)(e))}}},e=>{e.O(0,[3358,7306,6736,2655,8704,7358],()=>e(e.s=5100)),_N_E=e.O()}]);
|
|
5
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return n.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},ec=({contentRef:e,descriptionId:t})=>{let r=eo("DialogDescriptionWarning"),s=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${r.contentName}}.`;return n.useEffect(()=>{let r=e.current?.getAttribute("aria-describedby");t&&r&&(document.getElementById(t)||console.warn(s))},[s,e,t]),null},el=r(7069),eu=r(9059);function ex({...e}){return(0,s.jsx)(T,{"data-slot":"dialog",...e})}function em({...e}){return(0,s.jsx)(B,{"data-slot":"dialog-portal",...e})}function ep({className:e,...t}){return(0,s.jsx)(K,{"data-slot":"dialog-overlay",className:(0,eu.cn)("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...t})}function eh({className:e,children:t,showCloseButton:r=!0,...n}){return(0,s.jsxs)(em,{"data-slot":"dialog-portal",children:[(0,s.jsx)(ep,{}),(0,s.jsxs)(Z,{"data-slot":"dialog-content",className:(0,eu.cn)("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",e),...n,children:[t,r&&(0,s.jsxs)(es,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[(0,s.jsx)(el.A,{}),(0,s.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})}function ef({className:e,...t}){return(0,s.jsx)("div",{"data-slot":"dialog-header",className:(0,eu.cn)("flex flex-col gap-2 text-center sm:text-left",e),...t})}function eb({className:e,...t}){return(0,s.jsx)("div",{"data-slot":"dialog-footer",className:(0,eu.cn)("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function eg({className:e,...t}){return(0,s.jsx)(ee,{"data-slot":"dialog-title",className:(0,eu.cn)("text-lg leading-none font-semibold",e),...t})}function ej({open:e,onOpenChange:t,projectId:r,projectName:a,onSuccess:i}){let[o,d]=(0,n.useState)(a),[c,l]=(0,n.useState)(!1),[u,x]=(0,n.useState)(null);(0,n.useEffect)(()=>{e&&(d(a),x(null))},[e,a]);let m=o.trim()&&o.trim()!==a,h=async()=>{if(m){l(!0),x(null);try{let e=await fetch(`/api/projects/${r}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:o.trim()})});if(!e.ok){let t=await e.json();throw Error(t.error||"Failed to rename project")}i(),t(!1)}catch(e){x(e instanceof Error?e.message:"Failed to rename project")}finally{l(!1)}}},f=()=>{c||t(!1)};return(0,s.jsx)(ex,{open:e,onOpenChange:f,children:(0,s.jsxs)(eh,{className:"bg-white dark:bg-zinc-900",children:[(0,s.jsx)(ef,{children:(0,s.jsxs)(eg,{className:"flex items-center gap-2",children:[(0,s.jsx)(p.A,{className:"h-5 w-5"}),"Rename Project"]})}),(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("label",{htmlFor:"project-name",className:"text-sm font-medium text-zinc-900 dark:text-zinc-100",children:"Project Name"}),(0,s.jsx)("input",{id:"project-name",type:"text",value:o,onChange:e=>d(e.target.value),onKeyDown:e=>{"Enter"===e.key&&m&&h()},disabled:c,autoFocus:!0,className:"w-full rounded-lg border border-zinc-300 bg-white px-3 py-2 text-sm text-zinc-900 placeholder:text-zinc-400 focus:border-zinc-900 focus:outline-none focus:ring-1 focus:ring-zinc-900 disabled:opacity-50 dark:border-zinc-700 dark:bg-zinc-800 dark:text-zinc-100 dark:placeholder:text-zinc-600 dark:focus:border-zinc-100 dark:focus:ring-zinc-100"})]}),u&&(0,s.jsx)("div",{className:"rounded-lg border border-red-200 bg-red-50 p-3 dark:border-red-900 dark:bg-red-950/30",children:(0,s.jsx)("p",{className:"text-sm text-red-900 dark:text-red-200",children:u})})]}),(0,s.jsxs)(eb,{children:[(0,s.jsx)("button",{onClick:f,disabled:c,className:"rounded-lg border-2 border-zinc-200 px-4 py-2 font-medium text-zinc-900 hover:bg-zinc-50 disabled:opacity-50 dark:border-zinc-800 dark:text-zinc-100 dark:hover:bg-zinc-800",children:"Cancel"}),(0,s.jsx)("button",{onClick:h,disabled:!m||c,className:"rounded-lg bg-zinc-900 px-4 py-2 font-medium text-white hover:bg-zinc-800 disabled:opacity-50 dark:bg-zinc-100 dark:text-zinc-900 dark:hover:bg-zinc-200",children:c?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(g.A,{className:"mr-2 inline h-4 w-4 animate-spin"}),"Saving..."]}):"Save"})]})]})})}var ez=r(7787),ev=r(8317),ek=r(8360);function ey({open:e,onOpenChange:t,projectId:r,projectName:a,sessionCount:i,onSuccess:o}){let[d,c]=(0,n.useState)(!1),[l,u]=(0,n.useState)([]),[x,m]=(0,n.useState)(!1),[p,f]=(0,n.useState)(!1),[b,j]=(0,n.useState)(null),[z,v]=(0,n.useState)("");(0,n.useEffect)(()=>{c(!0)},[]),(0,n.useEffect)(()=>{e&&(j(null),v(""),k())},[e]),(0,n.useEffect)(()=>{if(!e)return;let r=e=>{"Escape"===e.key&&t(!1)};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[e,t]),(0,n.useEffect)(()=>{if(e)return document.body.style.overflow="hidden",()=>{document.body.style.overflow="unset"}},[e]);let k=async()=>{f(!0);try{let e=await fetch("/api/projects");if(e.ok){let t=((await e.json()).projects||[]).filter(e=>e.id!==r);u(t)}}catch{j("Failed to load projects")}finally{f(!1)}},y=l.find(e=>e.id===z),N=async()=>{if(z){m(!0),j(null);try{let e=await fetch(`/api/projects/${r}/merge`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({targetProjectId:z})}),s=await e.json();if(!e.ok)throw Error(s.error||"Failed to merge projects");o(),t(!1)}catch(e){j(e instanceof Error?e.message:"Failed to merge projects")}finally{m(!1)}}};return e&&d?(0,ez.createPortal)((0,s.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[(0,s.jsx)("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm",onClick:()=>t(!1)}),(0,s.jsxs)("div",{className:"relative z-10 mx-4 w-full max-w-lg max-h-[90vh] overflow-hidden rounded-2xl border border-zinc-200 bg-white shadow-2xl dark:border-zinc-800 dark:bg-zinc-900",onClick:e=>e.stopPropagation(),onMouseDown:e=>e.stopPropagation(),children:[(0,s.jsxs)("div",{className:"flex items-start justify-between border-b border-zinc-200 p-6 dark:border-zinc-800",children:[(0,s.jsxs)("div",{className:"flex gap-4",children:[(0,s.jsx)("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-zinc-100 dark:bg-zinc-800",children:(0,s.jsx)(h,{className:"h-5 w-5 text-zinc-600 dark:text-zinc-400"})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h2",{className:"text-lg font-semibold text-zinc-900 dark:text-zinc-50",children:"Merge Project"}),(0,s.jsx)("p",{className:"text-sm text-zinc-500 dark:text-zinc-400",children:"Move sessions to another project"})]})]}),(0,s.jsx)("button",{onClick:()=>t(!1),className:"rounded-lg p-2 text-zinc-500 hover:bg-zinc-100 dark:text-zinc-400 dark:hover:bg-zinc-800",children:(0,s.jsx)(el.A,{className:"h-5 w-5"})})]}),(0,s.jsxs)("div",{className:"max-h-[calc(90vh-14rem)] overflow-y-auto p-6",children:[(0,s.jsxs)("p",{className:"mb-4 text-sm text-zinc-600 dark:text-zinc-400",children:["Merge ",(0,s.jsx)("span",{className:"font-medium text-zinc-900 dark:text-zinc-100",children:a})," into:"]}),p?(0,s.jsx)("div",{className:"flex items-center justify-center py-8",children:(0,s.jsx)(g.A,{className:"h-6 w-6 animate-spin text-zinc-400"})}):0===l.length?(0,s.jsx)("div",{className:"rounded-lg bg-amber-50 p-4 dark:bg-amber-950/30",children:(0,s.jsx)("p",{className:"text-sm text-amber-800 dark:text-amber-200",children:"No other projects available to merge into."})}):(0,s.jsx)("div",{className:"space-y-2",children:l.map(e=>(0,s.jsxs)("button",{onClick:()=>v(e.id),className:`flex w-full items-center justify-between rounded-lg border p-4 text-left transition-colors ${z===e.id?"border-zinc-900 bg-zinc-50 dark:border-zinc-100 dark:bg-zinc-800":"border-zinc-200 hover:border-zinc-400 hover:bg-zinc-50 dark:border-zinc-700 dark:hover:border-zinc-600 dark:hover:bg-zinc-800/50"}`,children:[(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsx)("div",{className:"font-medium text-zinc-900 dark:text-zinc-100",children:e.name}),(0,s.jsxs)("div",{className:"text-sm text-zinc-500 dark:text-zinc-400 truncate",children:[e.session_count," sessions",e.source_path&&` \xb7 ${e.source_path}`]})]}),z===e.id&&(0,s.jsx)("div",{className:"ml-3 flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-zinc-900 dark:bg-zinc-100",children:(0,s.jsx)(ev.A,{className:"h-4 w-4 text-white dark:text-zinc-900"})})]},e.id))}),y&&(0,s.jsx)("div",{className:"mt-4 rounded-lg bg-amber-50 p-4 dark:bg-amber-950/30",children:(0,s.jsxs)("div",{className:"flex gap-3",children:[(0,s.jsx)(ek.A,{className:"h-5 w-5 shrink-0 text-amber-600 dark:text-amber-400"}),(0,s.jsxs)("div",{className:"text-sm",children:[(0,s.jsxs)("p",{className:"font-medium text-amber-800 dark:text-amber-200",children:[i," ",1===i?"session":"sessions"," will be moved"]}),(0,s.jsxs)("p",{className:"mt-1 text-amber-700 dark:text-amber-300",children:['"',a,'" will be deleted after merge']})]})]})}),b&&(0,s.jsx)("p",{className:"mt-4 text-sm text-red-600 dark:text-red-400",children:b})]}),(0,s.jsxs)("div",{className:"flex justify-end gap-3 border-t border-zinc-200 p-4 dark:border-zinc-800",children:[(0,s.jsx)("button",{type:"button",onClick:()=>t(!1),className:"rounded-lg px-4 py-2 text-sm font-medium text-zinc-700 hover:bg-zinc-100 dark:text-zinc-300 dark:hover:bg-zinc-800",children:"Cancel"}),(0,s.jsx)("button",{type:"button",onClick:N,disabled:x||!z,className:`rounded-lg px-4 py-2 text-sm font-medium ${z&&!x?"bg-zinc-900 text-white hover:bg-zinc-800 dark:bg-zinc-100 dark:text-zinc-900 dark:hover:bg-zinc-200":"bg-zinc-300 text-zinc-500 dark:bg-zinc-700 dark:text-zinc-400 cursor-not-allowed"}`,children:x?"Merging...":"Merge Projects"})]})]})]}),document.body):null}function eN({open:e,onOpenChange:t,projectId:r,projectName:a,sessionCount:i,onDelete:o}){let[d,c]=(0,n.useState)(!1),[l,u]=(0,n.useState)(""),[x,m]=(0,n.useState)(!1),[p,h]=(0,n.useState)(null),f="DELETE"===l;(0,n.useEffect)(()=>{c(!0)},[]),(0,n.useEffect)(()=>{e&&(u(""),h(null))},[e]),(0,n.useEffect)(()=>{if(!e)return;let r=e=>{"Escape"!==e.key||x||t(!1)};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[e,x,t]),(0,n.useEffect)(()=>{if(e)return document.body.style.overflow="hidden",()=>{document.body.style.overflow="unset"}},[e]);let b=async()=>{if(f){m(!0),h(null);try{let e=await fetch(`/api/projects/${r}`,{method:"DELETE"}),s=await e.json();if(!e.ok)throw Error(s.error||"Failed to delete project");o(),t(!1)}catch(e){h(e instanceof Error?e.message:"Failed to delete project")}finally{m(!1)}}};return e&&d?(0,ez.createPortal)((0,s.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[(0,s.jsx)("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm",onClick:()=>!x&&t(!1)}),(0,s.jsxs)("div",{className:"relative z-10 mx-4 w-full max-w-md overflow-hidden rounded-2xl border border-zinc-200 bg-white shadow-2xl dark:border-zinc-800 dark:bg-zinc-900",onClick:e=>e.stopPropagation(),onMouseDown:e=>e.stopPropagation(),children:[(0,s.jsxs)("div",{className:"flex items-start justify-between border-b border-zinc-200 p-6 dark:border-zinc-800",children:[(0,s.jsxs)("div",{className:"flex gap-4",children:[(0,s.jsx)("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-red-100 dark:bg-red-950/50",children:(0,s.jsx)(ek.A,{className:"h-5 w-5 text-red-600 dark:text-red-400"})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h2",{className:"text-lg font-semibold text-zinc-900 dark:text-zinc-50",children:"Delete Project"}),(0,s.jsx)("p",{className:"text-sm text-zinc-500 dark:text-zinc-400",children:"This action cannot be undone"})]})]}),(0,s.jsx)("button",{onClick:()=>!x&&t(!1),disabled:x,className:"rounded-lg p-2 text-zinc-500 hover:bg-zinc-100 disabled:opacity-50 dark:text-zinc-400 dark:hover:bg-zinc-800",children:(0,s.jsx)(el.A,{className:"h-5 w-5"})})]}),(0,s.jsxs)("div",{className:"p-6 space-y-4",children:[(0,s.jsxs)("p",{className:"text-sm text-zinc-600 dark:text-zinc-400",children:["You are about to permanently delete"," ",(0,s.jsx)("span",{className:"font-semibold text-zinc-900 dark:text-zinc-100",children:a})]}),(0,s.jsxs)("div",{className:"rounded-lg bg-red-50 p-4 dark:bg-red-950/30",children:[(0,s.jsx)("p",{className:"text-sm font-medium text-red-800 dark:text-red-200 mb-2",children:"This will permanently delete:"}),(0,s.jsxs)("ul",{className:"list-inside list-disc space-y-1 text-sm text-red-700 dark:text-red-300",children:[(0,s.jsxs)("li",{children:[i," ",1===i?"session":"sessions"]}),(0,s.jsx)("li",{children:"All context items in those sessions"}),(0,s.jsx)("li",{children:"All checkpoints for those sessions"}),(0,s.jsx)("li",{children:"All tasks for this project"}),(0,s.jsx)("li",{children:"All memory items for this project"})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("label",{htmlFor:"confirm-delete",className:"block text-sm font-medium text-zinc-700 dark:text-zinc-300 mb-2",children:["Type ",(0,s.jsx)("span",{className:"font-mono font-bold",children:"DELETE"})," to confirm:"]}),(0,s.jsx)("input",{id:"confirm-delete",type:"text",value:l,onChange:e=>u(e.target.value),disabled:x,placeholder:"DELETE",autoComplete:"off",className:"w-full rounded-lg border border-zinc-300 bg-white px-4 py-3 text-base text-zinc-900 placeholder:text-zinc-400 focus:border-zinc-500 focus:outline-none focus:ring-1 focus:ring-zinc-500 disabled:opacity-50 dark:border-zinc-700 dark:bg-zinc-800 dark:text-zinc-100 dark:placeholder:text-zinc-500 dark:focus:border-zinc-500"})]}),p&&(0,s.jsx)("p",{className:"text-sm text-red-600 dark:text-red-400",children:p})]}),(0,s.jsxs)("div",{className:"flex justify-end gap-3 border-t border-zinc-200 p-4 dark:border-zinc-800",children:[(0,s.jsx)("button",{type:"button",onClick:()=>t(!1),disabled:x,className:"rounded-lg px-4 py-2 text-sm font-medium text-zinc-700 hover:bg-zinc-100 disabled:opacity-50 dark:text-zinc-300 dark:hover:bg-zinc-800",children:"Cancel"}),(0,s.jsx)("button",{type:"button",onClick:b,disabled:!f||x,className:`rounded-lg px-4 py-2 text-sm font-medium ${f&&!x?"bg-red-600 text-white hover:bg-red-700":"bg-zinc-300 text-zinc-500 dark:bg-zinc-700 dark:text-zinc-400 cursor-not-allowed"}`,children:x?(0,s.jsxs)("span",{className:"flex items-center gap-2",children:[(0,s.jsx)(g.A,{className:"h-4 w-4 animate-spin"}),"Deleting..."]}):"Delete Project"})]})]})]}),document.body):null}function ew({projectId:e,projectName:t,projectPath:r,sessionCount:a}){let i=(0,x.useRouter)(),[o,d]=(0,n.useState)(!1),[c,l]=(0,n.useState)(!1),[u,g]=(0,n.useState)(!1),[j,z]=(0,n.useState)(!1),v=()=>{i.refresh()},k=e=>{e.preventDefault(),e.stopPropagation()};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(b.rI,{open:o,onOpenChange:d,children:[(0,s.jsx)(b.ty,{asChild:!0,children:(0,s.jsx)("button",{className:"rounded-lg border border-zinc-200 bg-white p-2 shadow-sm transition-all hover:border-zinc-400 hover:bg-zinc-50 dark:border-zinc-800 dark:bg-zinc-900 dark:hover:border-zinc-600 dark:hover:bg-zinc-800",onClick:k,onMouseDown:k,children:(0,s.jsx)(m.A,{className:"h-4 w-4 text-zinc-600 dark:text-zinc-400"})})}),(0,s.jsxs)(b.SQ,{align:"end",className:"w-48 bg-white dark:bg-zinc-900",onClick:k,onMouseDown:k,children:[(0,s.jsxs)(b._2,{onClick:e=>{k(e),d(!1),l(!0)},onMouseDown:k,children:[(0,s.jsx)(p.A,{className:"h-4 w-4"}),"Rename"]}),(0,s.jsxs)(b._2,{onClick:e=>{k(e),d(!1),g(!0)},onMouseDown:k,children:[(0,s.jsx)(h,{className:"h-4 w-4"}),"Merge into..."]}),(0,s.jsx)(b.mB,{}),(0,s.jsxs)(b._2,{variant:"destructive",onClick:e=>{k(e),d(!1),z(!0)},onMouseDown:k,children:[(0,s.jsx)(f.A,{className:"h-4 w-4"}),"Delete"]})]})]}),(0,s.jsx)(ej,{open:c,onOpenChange:l,projectId:e,projectName:t,onSuccess:v}),(0,s.jsx)(ey,{open:u,onOpenChange:g,projectId:e,projectName:t,sessionCount:a,onSuccess:v}),(0,s.jsx)(eN,{open:j,onOpenChange:z,projectId:e,projectName:t,sessionCount:a,onDelete:v})]})}var eC=r(4758);function eE({project:e}){let[t,r]=(0,n.useState)(!1),i=e.name;return(0,n.useEffect)(()=>{let t=localStorage.getItem("hiddenProjects");t&&r(JSON.parse(t).includes(e.id))},[e.id]),(0,s.jsx)(s.Fragment,{children:(0,s.jsxs)("div",{className:"group relative overflow-hidden rounded-xl border border-zinc-200 bg-white shadow-sm transition-all hover:border-zinc-400 hover:shadow-md dark:border-zinc-800 dark:bg-zinc-900 dark:hover:border-zinc-600",children:[(0,s.jsx)(u(),{href:`/dashboard/sessions?projectId=${encodeURIComponent(e.id)}`,className:"block p-6",children:(0,s.jsxs)("div",{className:`space-y-3 transition-all ${t?"blur-md select-none":""}`,children:[(0,s.jsx)("div",{className:"flex items-start justify-between",children:(0,s.jsx)(a.A,{className:"h-6 w-6 text-zinc-900 dark:text-zinc-50"})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"font-semibold text-zinc-900 transition-colors dark:text-zinc-50",children:i}),e.source_path&&(0,s.jsx)("p",{className:"mt-1 line-clamp-1 text-xs text-zinc-500 dark:text-zinc-500",children:e.source_path})]}),(0,s.jsxs)("div",{className:"flex gap-4 text-sm text-zinc-600 dark:text-zinc-400",children:[(0,s.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,s.jsx)(a.A,{className:"h-4 w-4"}),(0,s.jsxs)("span",{children:[e.session_count," sessions"]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,s.jsx)(o,{className:"h-4 w-4"}),(0,s.jsxs)("span",{children:[e.total_items," items"]})]})]})]})}),(0,s.jsxs)("div",{className:"absolute top-3 right-3 flex gap-2 opacity-0 transition-all group-hover:opacity-100",children:[(0,s.jsx)("button",{onClick:s=>{s.preventDefault(),s.stopPropagation();let n=localStorage.getItem("hiddenProjects"),a=n?JSON.parse(n):[];if(t){let t=a.filter(t=>t!==e.id);localStorage.setItem("hiddenProjects",JSON.stringify(t)),r(!1)}else a.push(e.id),localStorage.setItem("hiddenProjects",JSON.stringify(a)),r(!0)},className:"rounded-lg border border-zinc-200 bg-white p-2 shadow-sm transition-all hover:border-zinc-400 hover:bg-zinc-50 dark:border-zinc-800 dark:bg-zinc-900 dark:hover:border-zinc-600 dark:hover:bg-zinc-800",title:t?"Show project":"Hide project",children:t?(0,s.jsx)(d,{className:"h-4 w-4 text-zinc-600 dark:text-zinc-400"}):(0,s.jsx)(c,{className:"h-4 w-4 text-zinc-600 dark:text-zinc-400"})}),(0,s.jsx)(ew,{projectId:e.id,projectName:i,projectPath:e.project_path,sessionCount:e.session_count})]}),e.active_sessions>0&&(0,s.jsx)("div",{className:"absolute bottom-3 right-3",children:(0,s.jsx)(eC.q,{status:"active",count:e.active_sessions,size:"sm"})})]})})}},9059:(e,t,r)=>{"use strict";r.d(t,{cn:()=>a});var s=r(8462),n=r(3020);function a(...e){return(0,n.QP)((0,s.$)(e))}}},e=>{e.O(0,[3358,7306,6736,2655,8704,7358],()=>e(e.s=5100)),_N_E=e.O()}]);
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
|
|
3
3
|
${W.map(e=>`• ${e.short_id||e.id.slice(0,8)}: ${e.title}`).join("\n")}
|
|
4
4
|
|
|
5
|
-
This action cannot be undone.`,confirmText:"Delete",cancelText:"Cancel",variant:"danger"})]})}},1015:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(6748).A)("clock",[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]])},1422:(e,t,r)=>{"use strict";var s=r(2082);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}})},1794:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(6748).A)("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},2250:(e,t,r)=>{Promise.resolve().then(r.bind(r,632))},2283:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(6748).A)("circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]])},2771:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(6748).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"}]])},3183:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(6748).A)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},3503:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(6748).A)("bug",[["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z",key:"uouzyp"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M21 21a4 4 0 0 0-3.81-4",key:"1b0z45"}],["path",{d:"M21 5a4 4 0 0 1-3.55 3.97",key:"5cxbf6"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M3 21a4 4 0 0 1 3.81-4",key:"1fjd4g"}],["path",{d:"M3 5a4 4 0 0 0 3.55 3.97",key:"1d7oge"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M9 7.13V6a3 3 0 1 1 6 0v1.13",key:"1vgav8"}]])},4811:(e,t,r)=>{"use strict";r.d(t,{p:()=>n});var s=r(2638),a=r(6702);function n({icon:e,heading:t,description:r,action:n}){return(0,s.jsx)("div",{className:"rounded-2xl border-2 border-dashed border-zinc-300 bg-zinc-50 p-8 text-center dark:border-zinc-700 dark:bg-zinc-900/50",children:(0,s.jsxs)("div",{className:"mx-auto max-w-lg space-y-4",children:[(0,s.jsx)("div",{className:"mx-auto flex h-12 w-12 items-center justify-center rounded-full bg-zinc-900 text-white dark:bg-zinc-100 dark:text-zinc-900",children:a.isValidElement(e)?a.cloneElement(e,{className:"h-6 w-6"}):e}),(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsx)("h3",{className:"text-lg font-bold text-zinc-900 dark:text-zinc-50",children:t}),(0,s.jsx)("p",{className:"text-sm text-zinc-600 dark:text-zinc-400",children:r})]}),n&&(0,s.jsx)("button",{onClick:n.onClick,className:"mt-4 inline-flex items-center gap-2 rounded-lg bg-zinc-900 px-4 py-2 text-sm font-medium text-white hover:bg-zinc-800 dark:bg-zinc-100 dark:text-zinc-900 dark:hover:bg-zinc-200",children:n.label})]})})}},5050:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(6748).A)("square-check-big",[["path",{d:"M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344",key:"2acyp4"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]])},5789:(e,t,r)=>{"use strict";r.d(t,{T:()=>n});var s=r(2638),a=r(
|
|
5
|
+
This action cannot be undone.`,confirmText:"Delete",cancelText:"Cancel",variant:"danger"})]})}},1015:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(6748).A)("clock",[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]])},1422:(e,t,r)=>{"use strict";var s=r(2082);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}})},1794:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(6748).A)("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},2250:(e,t,r)=>{Promise.resolve().then(r.bind(r,632))},2283:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(6748).A)("circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]])},2771:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(6748).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"}]])},3183:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(6748).A)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},3503:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(6748).A)("bug",[["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z",key:"uouzyp"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M21 21a4 4 0 0 0-3.81-4",key:"1b0z45"}],["path",{d:"M21 5a4 4 0 0 1-3.55 3.97",key:"5cxbf6"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M3 21a4 4 0 0 1 3.81-4",key:"1fjd4g"}],["path",{d:"M3 5a4 4 0 0 0 3.55 3.97",key:"1d7oge"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M9 7.13V6a3 3 0 1 1 6 0v1.13",key:"1vgav8"}]])},4811:(e,t,r)=>{"use strict";r.d(t,{p:()=>n});var s=r(2638),a=r(6702);function n({icon:e,heading:t,description:r,action:n}){return(0,s.jsx)("div",{className:"rounded-2xl border-2 border-dashed border-zinc-300 bg-zinc-50 p-8 text-center dark:border-zinc-700 dark:bg-zinc-900/50",children:(0,s.jsxs)("div",{className:"mx-auto max-w-lg space-y-4",children:[(0,s.jsx)("div",{className:"mx-auto flex h-12 w-12 items-center justify-center rounded-full bg-zinc-900 text-white dark:bg-zinc-100 dark:text-zinc-900",children:a.isValidElement(e)?a.cloneElement(e,{className:"h-6 w-6"}):e}),(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsx)("h3",{className:"text-lg font-bold text-zinc-900 dark:text-zinc-50",children:t}),(0,s.jsx)("p",{className:"text-sm text-zinc-600 dark:text-zinc-400",children:r})]}),n&&(0,s.jsx)("button",{onClick:n.onClick,className:"mt-4 inline-flex items-center gap-2 rounded-lg bg-zinc-900 px-4 py-2 text-sm font-medium text-white hover:bg-zinc-800 dark:bg-zinc-100 dark:text-zinc-900 dark:hover:bg-zinc-200",children:n.label})]})})}},5050:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(6748).A)("square-check-big",[["path",{d:"M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344",key:"2acyp4"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]])},5789:(e,t,r)=>{"use strict";r.d(t,{T:()=>n});var s=r(2638),a=r(8360);function n({isOpen:e,onClose:t,onConfirm:r,title:n,message:c,confirmText:i="Delete",cancelText:l="Cancel",variant:o="danger"}){return e?(0,s.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",children:(0,s.jsxs)("div",{className:"w-full max-w-md rounded-xl border border-zinc-200 bg-white p-6 shadow-xl dark:border-zinc-800 dark:bg-zinc-900",children:[(0,s.jsxs)("div",{className:"flex items-start gap-4",children:[(0,s.jsx)("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-full bg-red-100 dark:bg-red-900/30",children:(0,s.jsx)(a.A,{className:"h-5 w-5 text-red-600 dark:text-red-400"})}),(0,s.jsxs)("div",{className:"flex-1",children:[(0,s.jsx)("h3",{className:"text-lg font-semibold text-zinc-900 dark:text-zinc-50",children:n}),(0,s.jsx)("p",{className:"mt-2 text-sm text-zinc-600 dark:text-zinc-400 whitespace-pre-wrap",children:c})]})]}),(0,s.jsxs)("div",{className:"mt-6 flex justify-end gap-3",children:[(0,s.jsx)("button",{onClick:t,className:"rounded-lg border border-zinc-300 px-4 py-2 text-sm font-medium text-zinc-700 transition-colors hover:bg-zinc-50 dark:border-zinc-700 dark:text-zinc-300 dark:hover:bg-zinc-800",children:l}),(0,s.jsx)("button",{onClick:()=>{r(),t()},className:`rounded-lg px-4 py-2 text-sm font-medium text-white transition-colors ${(()=>{switch(o){case"danger":default:return"bg-red-600 hover:bg-red-700 dark:bg-red-600 dark:hover:bg-red-700";case"warning":return"bg-amber-600 hover:bg-amber-700 dark:bg-amber-600 dark:hover:bg-amber-700";case"info":return"bg-blue-600 hover:bg-blue-700 dark:bg-blue-600 dark:hover:bg-blue-700"}})()}`,children:i})]})]})}):null}},5804:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(6748).A)("sparkles",[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]])},6539:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(6748).A)("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]])},6748:(e,t,r)=>{"use strict";r.d(t,{A:()=>l});var s=r(6702);let a=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)},n=(...e)=>e.filter((e,t,r)=>!!e&&""!==e.trim()&&r.indexOf(e)===t).join(" ").trim();var c={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:a,className:i="",children:l,iconNode:o,...d},p)=>(0,s.createElement)("svg",{ref:p,...c,width:t,height:t,stroke:e,strokeWidth:a?24*Number(r)/Number(t):r,className:n("lucide",i),...!l&&!(e=>{for(let t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0})(d)&&{"aria-hidden":"true"},...d},[...o.map(([e,t])=>(0,s.createElement)(e,t)),...Array.isArray(l)?l:[l]])),l=(e,t)=>{let r=(0,s.forwardRef)(({className:r,...c},l)=>(0,s.createElement)(i,{ref:l,iconNode:t,className:n(`lucide-${a(e).replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${e}`,r),...c}));return r.displayName=a(e),r}},7058:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(6748).A)("wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]])},7069:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(6748).A)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])},7609:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(6748).A)("hexagon",[["path",{d:"M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z",key:"yt0hxn"}]])},8317:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(6748).A)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]])},8360:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(6748).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"}]])}},e=>{e.O(0,[9353,2655,8704,7358],()=>e(e.s=2250)),_N_E=e.O()}]);
|