tower-studio 0.1.18 → 0.1.19
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/BUILD_ID +1 -1
- package/.next/build-manifest.json +3 -3
- package/.next/cache/.previewinfo +1 -1
- package/.next/cache/.rscinfo +1 -1
- package/.next/cache/.tsbuildinfo +1 -1
- package/.next/diagnostics/route-bundle-stats.json +38 -38
- package/.next/fallback-build-manifest.json +3 -3
- package/.next/prerender-manifest.json +3 -3
- package/.next/server/app/_global-error.html +1 -1
- package/.next/server/app/_global-error.rsc +1 -1
- package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/_not-found/page/react-loadable-manifest.json +1 -1
- package/.next/server/app/_not-found/page/server-reference-manifest.json +25 -25
- package/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_not-found.html +1 -1
- package/.next/server/app/_not-found.rsc +13 -13
- package/.next/server/app/_not-found.segments/_full.segment.rsc +13 -13
- package/.next/server/app/_not-found.segments/_head.segment.rsc +4 -4
- package/.next/server/app/_not-found.segments/_index.segment.rsc +8 -8
- package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/_not-found.segments/_not-found.segment.rsc +3 -3
- package/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/index.html +1 -1
- package/.next/server/app/index.rsc +13 -13
- package/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/index.segments/_full.segment.rsc +13 -13
- package/.next/server/app/index.segments/_head.segment.rsc +4 -4
- package/.next/server/app/index.segments/_index.segment.rsc +8 -8
- package/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/missions/page/react-loadable-manifest.json +1 -1
- package/.next/server/app/missions/page/server-reference-manifest.json +57 -57
- package/.next/server/app/missions/page.js +2 -2
- package/.next/server/app/missions/page.js.nft.json +1 -1
- package/.next/server/app/missions/page_client-reference-manifest.js +1 -1
- package/.next/server/app/onboarding/page/react-loadable-manifest.json +1 -1
- package/.next/server/app/onboarding/page/server-reference-manifest.json +25 -25
- package/.next/server/app/onboarding/page.js.nft.json +1 -1
- package/.next/server/app/onboarding/page_client-reference-manifest.js +1 -1
- package/.next/server/app/onboarding.html +1 -1
- package/.next/server/app/onboarding.rsc +15 -15
- package/.next/server/app/onboarding.segments/_full.segment.rsc +15 -15
- package/.next/server/app/onboarding.segments/_head.segment.rsc +4 -4
- package/.next/server/app/onboarding.segments/_index.segment.rsc +8 -8
- package/.next/server/app/onboarding.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/onboarding.segments/onboarding/__PAGE__.segment.rsc +4 -4
- package/.next/server/app/onboarding.segments/onboarding.segment.rsc +3 -3
- package/.next/server/app/page/react-loadable-manifest.json +1 -1
- package/.next/server/app/page/server-reference-manifest.json +25 -25
- package/.next/server/app/page.js.nft.json +1 -1
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app/settings/page/react-loadable-manifest.json +1 -1
- package/.next/server/app/settings/page/server-reference-manifest.json +32 -32
- package/.next/server/app/settings/page.js.nft.json +1 -1
- package/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/.next/server/app/settings.html +1 -1
- package/.next/server/app/settings.rsc +15 -15
- package/.next/server/app/settings.segments/_full.segment.rsc +15 -15
- package/.next/server/app/settings.segments/_head.segment.rsc +4 -4
- package/.next/server/app/settings.segments/_index.segment.rsc +8 -8
- package/.next/server/app/settings.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/settings.segments/settings/__PAGE__.segment.rsc +4 -4
- package/.next/server/app/settings.segments/settings.segment.rsc +3 -3
- package/.next/server/app/workspaces/[workspaceId]/archive/page/react-loadable-manifest.json +1 -1
- package/.next/server/app/workspaces/[workspaceId]/archive/page/server-reference-manifest.json +81 -81
- package/.next/server/app/workspaces/[workspaceId]/archive/page.js +1 -1
- package/.next/server/app/workspaces/[workspaceId]/archive/page.js.nft.json +1 -1
- package/.next/server/app/workspaces/[workspaceId]/archive/page_client-reference-manifest.js +1 -1
- package/.next/server/app/workspaces/[workspaceId]/assets/page/react-loadable-manifest.json +1 -1
- package/.next/server/app/workspaces/[workspaceId]/assets/page/server-reference-manifest.json +62 -62
- package/.next/server/app/workspaces/[workspaceId]/assets/page.js.nft.json +1 -1
- package/.next/server/app/workspaces/[workspaceId]/assets/page_client-reference-manifest.js +1 -1
- package/.next/server/app/workspaces/[workspaceId]/notes/page/react-loadable-manifest.json +1 -1
- package/.next/server/app/workspaces/[workspaceId]/notes/page/server-reference-manifest.json +57 -57
- package/.next/server/app/workspaces/[workspaceId]/notes/page.js.nft.json +1 -1
- package/.next/server/app/workspaces/[workspaceId]/notes/page_client-reference-manifest.js +1 -1
- package/.next/server/app/workspaces/[workspaceId]/page/react-loadable-manifest.json +1 -1
- package/.next/server/app/workspaces/[workspaceId]/page/server-reference-manifest.json +53 -53
- package/.next/server/app/workspaces/[workspaceId]/page.js +2 -2
- package/.next/server/app/workspaces/[workspaceId]/page.js.nft.json +1 -1
- package/.next/server/app/workspaces/[workspaceId]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page/react-loadable-manifest.json +1 -1
- package/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page/server-reference-manifest.json +25 -25
- package/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page.js.nft.json +1 -1
- package/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page/react-loadable-manifest.json +1 -1
- package/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page/server-reference-manifest.json +58 -58
- package/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page.js +1 -1
- package/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page.js.nft.json +1 -1
- package/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/workspaces/page/react-loadable-manifest.json +1 -1
- package/.next/server/app/workspaces/page/server-reference-manifest.json +43 -43
- package/.next/server/app/workspaces/page.js.nft.json +1 -1
- package/.next/server/app/workspaces/page_client-reference-manifest.js +1 -1
- package/.next/server/chunks/0uz~_next_dist_esm_build_templates_app-route_05yec2y.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__00~8_qz._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__05mc_xk._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__0bvqbq0._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__0p5iuez._.js +2 -2
- package/.next/server/chunks/[root-of-the-server]__0rb-ear._.js +2 -2
- package/.next/server/chunks/[root-of-the-server]__0u4~z7h._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__0ze75mm._.js +1 -1
- package/.next/server/chunks/project_f_tower_0n1s3ym._.js +1 -1
- package/.next/server/chunks/project_f_tower_src_11e.cv5._.js +1 -1
- package/.next/server/chunks/project_f_tower_src_lib_10p8sue._.js +1 -1
- package/.next/server/chunks/ssr/04uy_src_app_workspaces_[workspaceId]_tasks_[taskId]_task-page-client_tsx_01.s1p0._.js +1 -1
- package/.next/server/chunks/ssr/0y0r_f_tower_src_app_workspaces_[workspaceId]_assets_assets-page-client_tsx_0n4g3bn._.js +1 -1
- package/.next/server/chunks/ssr/{[root-of-the-server]__00_.ri0._.js → [root-of-the-server]__032ms~2._.js} +2 -2
- package/.next/server/chunks/ssr/[root-of-the-server]__06qzctf._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__0_47k-j._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__0aidehy._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__0ffdrwp._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__0hiekzn._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__0i4rk9v._.js +3 -3
- package/.next/server/chunks/ssr/{[root-of-the-server]__0jpbiq_._.js → [root-of-the-server]__0p21gac._.js} +2 -2
- package/.next/server/chunks/ssr/[root-of-the-server]__0w7gbe7._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__0zaw-fl._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__10j18zh._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__13eo85g._.js +1 -1
- package/.next/server/chunks/ssr/project_f_tower_0.txwd8._.js +1 -1
- package/.next/server/chunks/ssr/{project_f_tower_09re1~6._.js → project_f_tower_08rgm20._.js} +2 -2
- package/.next/server/chunks/ssr/project_f_tower_0f0-wva._.js +1 -1
- package/.next/server/chunks/ssr/{project_f_tower_0vfw8sn._.js → project_f_tower_0ge0mtj._.js} +2 -2
- package/.next/server/chunks/ssr/project_f_tower_0hgtev9._.js +1 -1
- package/.next/server/chunks/ssr/{project_f_tower_006ysi2._.js → project_f_tower_0hzcbgq._.js} +2 -2
- package/.next/server/chunks/ssr/project_f_tower_0h~8iz.._.js +3 -0
- package/.next/server/chunks/ssr/project_f_tower_0ivvjwd._.js +1 -1
- package/.next/server/chunks/ssr/project_f_tower_0jy~1uf._.js +1 -1
- package/.next/server/chunks/ssr/project_f_tower_0l6ssf8._.js +1 -1
- package/.next/server/chunks/ssr/project_f_tower_0o5.y1e._.js +1 -1
- package/.next/server/chunks/ssr/{project_f_tower_13hdtgf._.js → project_f_tower_0s1jqt5._.js} +2 -2
- package/.next/server/chunks/ssr/{project_f_tower_0m76uwh._.js → project_f_tower_0s~f55k._.js} +2 -2
- package/.next/server/chunks/ssr/project_f_tower_0w01kgd._.js +1 -1
- package/.next/server/chunks/ssr/project_f_tower_0ym-aea._.js +1 -1
- package/.next/server/chunks/ssr/{project_f_tower_src_13jw2_q._.js → project_f_tower_src_128.lqf._.js} +2 -2
- package/.next/server/chunks/ssr/project_f_tower_src_actions_agent-actions_ts_0.s4~m-._.js +1 -1
- package/.next/server/chunks/ssr/project_f_tower_src_actions_file-actions_ts_02i742t._.js +1 -1
- package/.next/server/chunks/ssr/project_f_tower_src_app_missions_missions-client_tsx_0ums4qx._.js +1 -1
- package/.next/server/chunks/ssr/project_f_tower_src_app_onboarding_page_tsx_0_9_yoq._.js +1 -1
- package/.next/server/chunks/ssr/project_f_tower_src_app_settings_page_tsx_0oo06~d._.js +1 -1
- package/.next/server/chunks/ssr/project_f_tower_src_app_workspaces_[workspaceId]_board-page-client_tsx_0jmj1xz._.js +1 -1
- package/.next/server/middleware-build-manifest.js +3 -3
- package/.next/server/pages/404.html +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/server/server-reference-manifest.js +1 -1
- package/.next/server/server-reference-manifest.json +211 -211
- package/.next/static/chunks/{0a93fdjk-37r7.js → 0-d4licj-hata.js} +1 -1
- package/.next/static/chunks/{0jm.d2tvttdcy.js → 0.094wo3-wbr_.js} +1 -1
- package/.next/static/chunks/02myf8ud-x1x0.js +1 -0
- package/.next/static/chunks/{0ejd72g7tekop.js → 05.r3gya2y0_d.js} +1 -1
- package/.next/static/chunks/059sctu5sue65.js +1 -0
- package/.next/static/chunks/{0~wu849la7jq2.js → 07jb~oukvvhv~.js} +1 -1
- package/.next/static/chunks/{163-h-672vjtc.js → 08y-dar2a2nv~.js} +1 -1
- package/.next/static/chunks/{0x9x7bxnrbi1..js → 08~h~n9ldz4.q.js} +1 -1
- package/.next/static/chunks/0hsqm_60.b18j.js +1 -0
- package/.next/static/chunks/{0j3ixh~tlr2~~.js → 0ifhv76k2rmn9.js} +2 -2
- package/.next/static/chunks/{0x2z0sza~9erw.js → 0w-f5xcz~0~a9.js} +1 -1
- package/.next/static/chunks/{1068kwso1r._u.js → 0yzmd3i5vfggs.js} +1 -1
- package/.next/static/chunks/{14ul.txcdkz4n.js → 12m3c8he3v-d-.js} +1 -1
- package/.next/static/chunks/{0kjm.xm_~nzz0.js → 13yyy7cl_d5za.js} +1 -1
- package/.next/static/chunks/15orsd353tllt.js +1 -0
- package/.next/trace +2 -2
- package/.next/trace-build +1 -1
- package/package.json +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__0.yn90z._.js +0 -3
- package/.next/server/chunks/ssr/project_f_tower_0d9_kxc._.js +0 -3
- package/.next/static/chunks/09mbyvk8z.wx2.js +0 -1
- package/.next/static/chunks/0mf6fqi52ca~q.js +0 -1
- package/.next/static/chunks/0vhwphmq69i0d.js +0 -1
- package/.next/static/chunks/17b4edxd7wg5~.js +0 -1
- /package/.next/static/{EMk0oZpCVYuq8amkRB5za → Jspb2q16y1AMCvOLB3nv_}/_buildManifest.js +0 -0
- /package/.next/static/{EMk0oZpCVYuq8amkRB5za → Jspb2q16y1AMCvOLB3nv_}/_clientMiddlewareManifest.js +0 -0
- /package/.next/static/{EMk0oZpCVYuq8amkRB5za → Jspb2q16y1AMCvOLB3nv_}/_ssgManifest.js +0 -0
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
module.exports=[182118,a=>{"use strict";var b=a.i(680889),c=a.i(96063),d=a.i(832116),e=a.i(972795);async function f(a,b){await a.$executeRawUnsafe("DELETE FROM notes_fts WHERE note_id = ?",b.id),await a.$executeRawUnsafe("INSERT INTO notes_fts(note_id, title, content) VALUES (?, ?, ?)",b.id,b.title,b.content)}async function g(a,b){await a.$executeRawUnsafe("DELETE FROM notes_fts WHERE note_id = ?",b)}var h=a.i(632919);let i=c.z.object({title:c.z.string().min(1).max(200),content:c.z.string(),category:c.z.string().max(50).optional(),projectId:c.z.string().min(1),taskId:c.z.string().optional()}),j=c.z.object({title:c.z.string().min(1).max(200).optional(),content:c.z.string().optional(),category:c.z.string().max(50).optional()});async function k(a){let b=i.parse(a),c=await d.db.projectNote.create({data:{title:b.title,content:b.content,category:b.category??"备忘",projectId:b.projectId,taskId:b.taskId??null}});return await f(d.db,{id:c.id,title:c.title,content:c.content}),(0,e.revalidatePath)("/workspace"),c}async function l(a,b){let c=j.parse(b),g=await d.db.projectNote.update({where:{id:a},data:c});return await f(d.db,{id:g.id,title:g.title,content:g.content}),(0,e.revalidatePath)("/workspace"),g}async function m(a){await g(d.db,a),await d.db.projectNote.delete({where:{id:a}}),(0,e.revalidatePath)("/workspace")}async function n(a){return d.db.projectNote.findUnique({where:{id:a}})}async function o(a,b){return d.db.projectNote.findMany({where:{projectId:a,taskId:null,...b?.category?{category:b.category}:{}},orderBy:{updatedAt:"desc"}})}async function p(a){return d.db.projectNote.findMany({where:{taskId:a},orderBy:{updatedAt:"desc"}})}(0,h.ensureServerEntryExports)([k,l,m,n,o,p]),(0,b.registerServerReference)(k,"
|
|
1
|
+
module.exports=[182118,a=>{"use strict";var b=a.i(680889),c=a.i(96063),d=a.i(832116),e=a.i(972795);async function f(a,b){await a.$executeRawUnsafe("DELETE FROM notes_fts WHERE note_id = ?",b.id),await a.$executeRawUnsafe("INSERT INTO notes_fts(note_id, title, content) VALUES (?, ?, ?)",b.id,b.title,b.content)}async function g(a,b){await a.$executeRawUnsafe("DELETE FROM notes_fts WHERE note_id = ?",b)}var h=a.i(632919);let i=c.z.object({title:c.z.string().min(1).max(200),content:c.z.string(),category:c.z.string().max(50).optional(),projectId:c.z.string().min(1),taskId:c.z.string().optional()}),j=c.z.object({title:c.z.string().min(1).max(200).optional(),content:c.z.string().optional(),category:c.z.string().max(50).optional()});async function k(a){let b=i.parse(a),c=await d.db.projectNote.create({data:{title:b.title,content:b.content,category:b.category??"备忘",projectId:b.projectId,taskId:b.taskId??null}});return await f(d.db,{id:c.id,title:c.title,content:c.content}),(0,e.revalidatePath)("/workspace"),c}async function l(a,b){let c=j.parse(b),g=await d.db.projectNote.update({where:{id:a},data:c});return await f(d.db,{id:g.id,title:g.title,content:g.content}),(0,e.revalidatePath)("/workspace"),g}async function m(a){await g(d.db,a),await d.db.projectNote.delete({where:{id:a}}),(0,e.revalidatePath)("/workspace")}async function n(a){return d.db.projectNote.findUnique({where:{id:a}})}async function o(a,b){return d.db.projectNote.findMany({where:{projectId:a,taskId:null,...b?.category?{category:b.category}:{}},orderBy:{updatedAt:"desc"}})}async function p(a){return d.db.projectNote.findMany({where:{taskId:a},orderBy:{updatedAt:"desc"}})}(0,h.ensureServerEntryExports)([k,l,m,n,o,p]),(0,b.registerServerReference)(k,"40b2426edc12399507a84e406091c55a2f25812ee3",null),(0,b.registerServerReference)(l,"60251bb294fd11f8438cc1835ca0d9249e00395a26",null),(0,b.registerServerReference)(m,"40ae92e93419cc4e9fb7cc4baaca8c3b7d4e08d16f",null),(0,b.registerServerReference)(n,"40fb0ccbf55602dc7b9f50c5e83c493a0d6e2d4f2c",null),(0,b.registerServerReference)(o,"60f8a5e7874adf95650811b1007b5c39ff3cd68a9b",null),(0,b.registerServerReference)(p,"40a78a03a2040809836f2f5103cdc54aa1db3d69a6",null),a.s(["createNote",0,k,"deleteNote",0,m,"getNoteById",0,n,"getProjectNotes",0,o,"getTaskNotes",0,p,"updateNote",0,l],182118)},675263,a=>a.a(async(b,c)=>{try{a.i(279254),a.i(30292);var d=a.i(322220),e=a.i(727977);a.i(198433),a.i(541587),a.i(182118);var f=b([d,e]);[d,e]=f.then?(await f)():f,a.s([]),c()}catch(a){c(a)}},!1),365056,a=>a.a(async(b,c)=>{try{var d=a.i(675263),e=a.i(279254),f=a.i(30292),g=a.i(322220),h=a.i(727977),i=a.i(198433),j=a.i(541587),k=a.i(182118),l=b([d,g,h]);[d,g,h]=l.then?(await l)():l,a.s(["004ad72c659dc873a20af0503d771ac4faff1414bc",()=>j.getOnboardingStatus,"00c1834c047382d4205012a4adc315a26f4745e1c8",()=>h.getActualWsPort,"00dea9438815310100d35d1410d37043f24e0f6d09",()=>e.getWorkspacesWithProjects,"400c223032559f38f5c42935c96d5a66c1c87c4947",()=>f.deleteLabel,"401126298d4c00f18366cf428b331b2424b6858c87",()=>e.getWorkspacesWithRecentTasks,"402408ec9f92a8ccc27825f3b1ca78ce2ce9e3a7bf",()=>j.completeOnboarding,"404701024bec77424822bb284512d5468b4958bad6",()=>e.getWorkspaceById,"40491a8487f6598421fb229c5922564f6b120109e5",()=>e.getRecentLocalProjects,"404a39fb270ea30e5a1f55cbb73a0c420896ed0ac3",()=>j.setOnboardingProgress,"405c0e332450b000b21836ead1c4321461502cfa64",()=>h.resolveGitLocalPath,"40737643e39968bd4e34f23ae8e3fdc13aa033d672",()=>e.deleteWorkspace,"408638851fdcf9a7331e33f4f62bff24557f12c7ac",()=>f.createLabel,"408a3a0388c692937f983dd86d8efcd8889cc6c1fd",()=>e.getProjectByLocalPath,"409345b2fb023fbcc61f2122ff613d20a9b733861a",()=>f.getLabelsForWorkspace,"409353d46651fcf4e4d495d9d9d645964183bd0adc",()=>e.createProject,"409a7c815688a636cfe2a90eb2881b60817aeb0d81",()=>j.dispatchTaskCompletionEvent,"40a78a03a2040809836f2f5103cdc54aa1db3d69a6",()=>k.getTaskNotes,"40aa56439baf8e3500d146add49cd2321c18654ba4",()=>e.getOrCreateTowerTaskId,"40ac9ef30770287c638151745510ba18e95130d128",()=>e.deleteProject,"40aca8ebefd40b487f7261b47a2ba70f37cc99ca7b",()=>i.checkMigrationSafety,"40ae92e93419cc4e9fb7cc4baaca8c3b7d4e08d16f",()=>k.deleteNote,"40b2426edc12399507a84e406091c55a2f25812ee3",()=>k.createNote,"40db634945d84ee345d44243a7ae05109df2146a3a",()=>e.createWorkspace,"40fb0ccbf55602dc7b9f50c5e83c493a0d6e2d4f2c",()=>k.getNoteById,"60251bb294fd11f8438cc1835ca0d9249e00395a26",()=>k.updateNote,"6054619e1ff3c0f8b32f6b6097e0f8b597030861c9",()=>e.updateProject,"606fc384c9d7dd2f98f3aa57ea997501243438636c",()=>e.updateWorkspace,"607ec05a8094476de568816e33789967dfdc47b877",()=>g.globalSearch,"60b496f5c3dd122fa06376265b98042dc0bc30eb14",()=>h.getConfigValue,"60ccf59bb9af91735afc5f5f702a3cec4af478797f",()=>i.analyzeProjectDirectory,"60e54db140d535f1a59183063189992f1eaf8859dc",()=>i.migrateProjectPath,"60e964550de6a0d8d67e72c642eb548dfe0c39de74",()=>h.setConfigValue,"60f8a5e7874adf95650811b1007b5c39ff3cd68a9b",()=>k.getProjectNotes]),c()}catch(a){c(a)}},!1),939768,a=>{a.v(b=>Promise.all(["server/chunks/ssr/[root-of-the-server]__0zugnux._.js"].map(b=>a.l(b))).then(()=>b(326575)))},585988,a=>{a.v(a=>Promise.resolve().then(()=>a(264572)))},908462,a=>{a.v(b=>Promise.all(["server/chunks/ssr/[root-of-the-server]__0xe9b6_._.js"].map(b=>a.l(b))).then(()=>b(961374)))},302452,a=>{a.v(b=>Promise.all(["server/chunks/ssr/[root-of-the-server]__13x5mmo._.js"].map(b=>a.l(b))).then(()=>b(396477)))}];
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=project_f_tower_0.txwd8._.js.map
|
package/.next/server/chunks/ssr/{project_f_tower_09re1~6._.js → project_f_tower_08rgm20._.js}
RENAMED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
module.exports=[
|
|
1
|
+
module.exports=[754086,a=>{"use strict";var b=a.i(879876);let c=(0,b.createServerReference)("4013418b6eb924796e5ba9c335f6c2bdd43cdffca8",b.callServer,void 0,b.findSourceMapURL,"getConfigValues");a.s(["getConfigValues",0,c])},48300,a=>{"use strict";var b=a.i(293785),c=a.i(256116),d=a.i(488137),e=a.i(44585);let f=(0,d.cva)("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});a.s(["Badge",0,function({className:a,variant:d="default",render:g,...h}){var i;return i={defaultTagName:"span",props:(0,b.mergeProps)({className:(0,e.cn)(f({variant:d}),a)},h),render:g,state:{slot:"badge",variant:d}},(0,c.useRenderElement)(i.defaultTagName??"div",i,i)}],48300)},57726,891903,a=>{"use strict";var b=a.i(65735);a.s(["CheckCircle2",()=>b.default],57726);let c=(0,a.i(302856).default)("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);a.s(["XCircle",0,c],891903)},789135,a=>{"use strict";var b=a.i(879876);let c=(0,b.createServerReference)("408499d11ce7352aab012336b3b36bdf877d0f031c",b.callServer,void 0,b.findSourceMapURL,"getPrompts");a.s(["getPrompts",0,c])},889822,a=>{"use strict";var b=a.i(858360),c=a.i(44585);a.s(["Label",0,function({className:a,...d}){return(0,b.jsx)("label",{"data-slot":"label",className:(0,c.cn)("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",a),...d})}])}];
|
|
2
2
|
|
|
3
|
-
//# sourceMappingURL=
|
|
3
|
+
//# sourceMappingURL=project_f_tower_08rgm20._.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
module.exports=[487045,a=>a.a(async(b,c)=>{try{a.i(279254),a.i(30292);var d=a.i(322220),e=a.i(727977);a.i(198433),a.i(541587);var f=b([d,e]);[d,e]=f.then?(await f)():f,a.s([]),c()}catch(a){c(a)}},!1),751254,a=>a.a(async(b,c)=>{try{var d=a.i(487045),e=a.i(279254),f=a.i(30292),g=a.i(322220),h=a.i(727977),i=a.i(198433),j=a.i(541587),k=b([d,g,h]);[d,g,h]=k.then?(await k)():k,a.s(["
|
|
1
|
+
module.exports=[487045,a=>a.a(async(b,c)=>{try{a.i(279254),a.i(30292);var d=a.i(322220),e=a.i(727977);a.i(198433),a.i(541587);var f=b([d,e]);[d,e]=f.then?(await f)():f,a.s([]),c()}catch(a){c(a)}},!1),751254,a=>a.a(async(b,c)=>{try{var d=a.i(487045),e=a.i(279254),f=a.i(30292),g=a.i(322220),h=a.i(727977),i=a.i(198433),j=a.i(541587),k=b([d,g,h]);[d,g,h]=k.then?(await k)():k,a.s(["004ad72c659dc873a20af0503d771ac4faff1414bc",()=>j.getOnboardingStatus,"00c1834c047382d4205012a4adc315a26f4745e1c8",()=>h.getActualWsPort,"400c223032559f38f5c42935c96d5a66c1c87c4947",()=>f.deleteLabel,"402408ec9f92a8ccc27825f3b1ca78ce2ce9e3a7bf",()=>j.completeOnboarding,"404a39fb270ea30e5a1f55cbb73a0c420896ed0ac3",()=>j.setOnboardingProgress,"405c0e332450b000b21836ead1c4321461502cfa64",()=>h.resolveGitLocalPath,"40737643e39968bd4e34f23ae8e3fdc13aa033d672",()=>e.deleteWorkspace,"408638851fdcf9a7331e33f4f62bff24557f12c7ac",()=>f.createLabel,"409345b2fb023fbcc61f2122ff613d20a9b733861a",()=>f.getLabelsForWorkspace,"409353d46651fcf4e4d495d9d9d645964183bd0adc",()=>e.createProject,"409a7c815688a636cfe2a90eb2881b60817aeb0d81",()=>j.dispatchTaskCompletionEvent,"40aca8ebefd40b487f7261b47a2ba70f37cc99ca7b",()=>i.checkMigrationSafety,"40db634945d84ee345d44243a7ae05109df2146a3a",()=>e.createWorkspace,"606fc384c9d7dd2f98f3aa57ea997501243438636c",()=>e.updateWorkspace,"607ec05a8094476de568816e33789967dfdc47b877",()=>g.globalSearch,"60b496f5c3dd122fa06376265b98042dc0bc30eb14",()=>h.getConfigValue,"60ccf59bb9af91735afc5f5f702a3cec4af478797f",()=>i.analyzeProjectDirectory,"60e54db140d535f1a59183063189992f1eaf8859dc",()=>i.migrateProjectPath,"60e964550de6a0d8d67e72c642eb548dfe0c39de74",()=>h.setConfigValue]),c()}catch(a){c(a)}},!1),939768,a=>{a.v(b=>Promise.all(["server/chunks/ssr/[root-of-the-server]__0c1i04u._.js"].map(b=>a.l(b))).then(()=>b(326575)))},585988,a=>{a.v(a=>Promise.resolve().then(()=>a(264572)))},908462,a=>{a.v(b=>Promise.all(["server/chunks/ssr/[root-of-the-server]__0xe9b6_._.js"].map(b=>a.l(b))).then(()=>b(961374)))},302452,a=>{a.v(b=>Promise.all(["server/chunks/ssr/[root-of-the-server]__05a17ca._.js"].map(b=>a.l(b))).then(()=>b(396477)))}];
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=project_f_tower_0f0-wva._.js.map
|
package/.next/server/chunks/ssr/{project_f_tower_0vfw8sn._.js → project_f_tower_0ge0mtj._.js}
RENAMED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
module.exports=[792533,(a,b,c)=>{"use strict";b.exports=a.r(918622)},175391,(a,b,c)=>{"use strict";b.exports=a.r(792533).vendored["react-ssr"].React},858360,(a,b,c)=>{"use strict";b.exports=a.r(792533).vendored["react-ssr"].ReactJsxRuntime},2765,(a,b,c)=>{"use strict";b.exports=a.r(792533).vendored["react-ssr"].ReactServerDOMTurbopackClient},425422,(a,b,c)=>{"use strict";b.exports=a.r(792533).vendored["react-ssr"].ReactDOM},362556,(a,b,c)=>{"use strict";b.exports=a.r(792533).vendored.contexts.AppRouterContext},923638,(a,b,c)=>{"use strict";b.exports=a.r(792533).vendored.contexts.HooksClientContext},635039,(a,b,c)=>{"use strict";b.exports=a.r(792533).vendored.contexts.ServerInsertedHtml},115727,(a,b,c)=>{"use strict";function d(a){if("function"!=typeof WeakMap)return null;var b=new WeakMap,c=new WeakMap;return(d=function(a){return a?c:b})(a)}c._=function(a,b){if(!b&&a&&a.__esModule)return a;if(null===a||"object"!=typeof a&&"function"!=typeof a)return{default:a};var c=d(b);if(c&&c.has(a))return c.get(a);var e={__proto__:null},f=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var g in a)if("default"!==g&&Object.prototype.hasOwnProperty.call(a,g)){var h=f?Object.getOwnPropertyDescriptor(a,g):null;h&&(h.get||h.set)?Object.defineProperty(e,g,h):e[g]=a[g]}return e.default=a,c&&c.set(a,e),e}},13241,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d,e,f={ACTION_HMR_REFRESH:function(){return l},ACTION_NAVIGATE:function(){return i},ACTION_REFRESH:function(){return h},ACTION_RESTORE:function(){return j},ACTION_SERVER_ACTION:function(){return m},ACTION_SERVER_PATCH:function(){return k},PrefetchKind:function(){return n},ScrollBehavior:function(){return o}};for(var g in f)Object.defineProperty(c,g,{enumerable:!0,get:f[g]});let h="refresh",i="navigate",j="restore",k="server-patch",l="hmr-refresh",m="server-action";var n=((d={}).AUTO="auto",d.FULL="full",d),o=((e={})[e.Default=0]="Default",e[e.NoScroll=1]="NoScroll",e);("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)},385443,(a,b,c)=>{"use strict";function d(a){return null!==a&&"object"==typeof a&&"then"in a&&"function"==typeof a.then}Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"isThenable",{enumerable:!0,get:function(){return d}})},785904,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={dispatchAppRouterAction:function(){return i},dispatchGestureState:function(){return j},refreshOnInstantNavigationUnlock:function(){return h},useActionQueue:function(){return k}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f=a.r(115727)._(a.r(175391)),g=a.r(385443);a.r(13241);function h(){}function i(a){!0;throw Object.defineProperty(Error("Internal Next.js error: Router action dispatched before initialization."),"__NEXT_ERROR_CODE",{value:"E668",enumerable:!1,configurable:!0})}function j(a){!0;throw Object.defineProperty(Error("Internal Next.js error: Router action dispatched before initialization."),"__NEXT_ERROR_CODE",{value:"E668",enumerable:!1,configurable:!0})}function k(a){let[b,c]=f.default.useState(a.state),[d,e]=(0,f.useOptimistic)(b),h=(0,f.useMemo)(()=>d,[d]);return(0,g.isThenable)(h)?(0,f.use)(h):h}("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)},561262,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"callServer",{enumerable:!0,get:function(){return g}});let d=a.r(175391),e=a.r(13241),f=a.r(785904);async function g(a,b){return new Promise((c,g)=>{(0,d.startTransition)(()=>{(0,f.dispatchAppRouterAction)({type:e.ACTION_SERVER_ACTION,actionId:a,actionArgs:b,resolve:c,reject:g})})})}("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)},689166,(a,b,c)=>{"use strict";let d;Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"findSourceMapURL",{enumerable:!0,get:function(){return d}});("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)},879876,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={callServer:function(){return f.callServer},createServerReference:function(){return h.createServerReference},findSourceMapURL:function(){return g.findSourceMapURL}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f=a.r(561262),g=a.r(689166),h=a.r(2765)},669794,a=>{"use strict";let b=(0,a.i(302856).default)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);a.s(["default",0,b])},14180,a=>{"use strict";let b=(0,a.i(302856).default)("archive",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]]);a.s(["Archive",0,b],14180)},986379,a=>{"use strict";let b=(0,a.i(302856).default)("folder-open",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);a.s(["FolderOpen",0,b],986379)},569210,a=>{"use strict";let b=(0,a.i(302856).default)("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"}]]);a.s(["Trash2",0,b],569210)},154492,a=>{"use strict";let b=(0,a.i(302856).default)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);a.s(["default",0,b])},109434,a=>{"use strict";var b=a.i(154492);a.s(["Loader2",()=>b.default])},161604,a=>{"use strict";let b=(0,a.i(302856).default)("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"}]]);a.s(["FileText",0,b],161604)},246962,a=>{"use strict";var b=a.i(858360),c=a.i(44585);a.s(["Textarea",0,function({className:a,...d}){return(0,b.jsx)("textarea",{"data-slot":"textarea",className:(0,c.cn)("flex field-sizing-content min-h-16 w-full rounded-lg border border-input bg-transparent px-2.5 py-2 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",a),...d})}])},94202,a=>{"use strict";let b=(0,a.i(302856).default)("pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);a.s(["Pencil",0,b],94202)},938899,a=>{"use strict";let b=(0,a.i(302856).default)("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"}]]);a.s(["Sparkles",0,b],938899)},264530,563504,a=>{"use strict";var b=a.i(879876);let c=(0,b.createServerReference)("601723fd09c3075bb43df49941e81b4f588c6f8132",b.callServer,void 0,b.findSourceMapURL,"analyzeProjectDirectory");a.s(["analyzeProjectDirectory",0,c],264530);var d=a.i(858360),e=a.i(175391),f=a.i(240028),g=a.i(302856);let h=(0,g.default)("folder-git-2",[["path",{d:"M18 19a5 5 0 0 1-5-5v8",key:"sz5oeg"}],["path",{d:"M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5",key:"1w6njk"}],["circle",{cx:"13",cy:"12",r:"2",key:"1j92g6"}],["circle",{cx:"20",cy:"19",r:"2",key:"1obnsp"}]]),i=(0,g.default)("house",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]]);var j=a.i(413857),k=a.i(410215);let l=(0,g.default)("hard-drive",[["path",{d:"M10 16h.01",key:"1bzywj"}],["path",{d:"M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"18tbho"}],["path",{d:"M21.946 12.013H2.054",key:"zqlbp7"}],["path",{d:"M6 16h.01",key:"1pmjb7"}]]);var m=a.i(857122),n=a.i(410756),o=a.i(620235),p=a.i(584335),q=a.i(358440);a.s(["FolderBrowserDialog",0,function({open:a,onOpenChange:b,onSelect:c,gitOnly:g=!1}){let{t:r}=(0,p.useI18n)(),[s,t]=(0,e.useState)(null),[u,v]=(0,e.useState)(!1),[w,x]=(0,e.useState)(null),[y,z]=(0,e.useState)(""),[A,B]=(0,e.useState)(""),[C,D]=(0,e.useState)(!1),E=(0,e.useRef)(null),F=(0,e.useCallback)(async a=>{v(!0),x(null),B(""),D(!1);try{let b=a?`/api/browse-fs?path=${encodeURIComponent(a)}`:"/api/browse-fs",c=await fetch(b);if(!c.ok){let a=await c.json();x(a.error||"Failed");return}let d=await c.json();t(d),z(d.currentPath)}catch{x("Failed to browse filesystem")}finally{v(!1)}},[]);(0,e.useEffect)(()=>{a&&(F(),setTimeout(()=>E.current?.focus(),200))},[a,F]);let G=()=>{y.trim()&&F(y.trim())},H=s?.folders.filter(a=>a.name.toLowerCase().includes(A.toLowerCase()))??[];return(0,d.jsx)(m.Dialog,{open:a,onOpenChange:b,children:(0,d.jsx)(m.DialogContent,{className:"p-0 gap-0",style:{maxWidth:"36rem",overflow:"hidden"},children:(0,d.jsxs)("div",{className:"flex flex-col max-h-[60vh] overflow-hidden",children:[(0,d.jsxs)("div",{className:"px-5 pt-5 pb-3 shrink-0",children:[(0,d.jsx)(m.DialogTitle,{children:r(g?"folder.selectGitRepo":"folder.selectFolder")}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:r("folder.hint")})]}),(0,d.jsxs)("div",{className:"border-t border-border px-4 pt-3 pb-2 shrink-0",children:[(0,d.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:r("folder.manualInput")}),(0,d.jsxs)("div",{className:"mt-1.5 flex gap-2",children:[(0,d.jsx)(o.Input,{ref:E,value:y,onChange:a=>z(a.target.value),onKeyDown:a=>"Enter"===a.key&&G(),placeholder:"/path/to/your/project",title:y,className:"flex-1 min-w-0"}),(0,d.jsx)(n.Button,{variant:"outline",onClick:G,className:"h-8 px-3 shrink-0",children:r("folder.goTo")})]})]}),(0,d.jsxs)("div",{className:"px-4 py-2 shrink-0",children:[(0,d.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:r("folder.searchDir")}),(0,d.jsxs)("div",{className:"relative mt-1.5",children:[(0,d.jsx)(k.Search,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted-foreground"}),(0,d.jsx)("input",{value:A,onChange:a=>B(a.target.value),placeholder:"Filter folders and files...",className:"h-8 w-full rounded-md border border-border bg-background pl-8 pr-3 text-sm text-foreground placeholder-muted-foreground outline-none focus:border-ring focus:ring-1 focus:ring-ring"})]})]}),(0,d.jsxs)("div",{className:"flex items-center gap-1.5 border-y border-border px-4 py-2 shrink-0 min-w-0",children:[(0,d.jsx)(n.Button,{variant:"outline",size:"icon-sm",onClick:()=>s?.homePath&&F(s.homePath),className:"shrink-0 text-muted-foreground",title:"Home",children:(0,d.jsx)(i,{className:"h-3.5 w-3.5"})}),(0,d.jsx)(n.Button,{variant:"outline",size:"icon-sm",onClick:()=>{s&&("__DRIVES__"===s.parentPath?D(!0):(D(!1),F(s.parentPath)))},className:"shrink-0 text-muted-foreground",title:"Parent",children:(0,d.jsx)(j.ChevronUp,{className:"h-3.5 w-3.5"})}),s?.drives&&s.drives.length>0&&(0,d.jsx)(n.Button,{variant:C?"default":"outline",size:"icon-sm",onClick:()=>D(a=>!a),className:"shrink-0 text-muted-foreground",title:"Drives",children:(0,d.jsx)(l,{className:"h-3.5 w-3.5"})}),(0,d.jsx)("div",{className:"min-w-0 flex-1 truncate text-sm text-foreground font-mono",title:s?.currentPath??"",children:s?.currentPath??"..."})]}),(0,d.jsxs)(q.ScrollArea,{className:"min-h-0 flex-1",children:[u&&(0,d.jsx)("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:"Loading..."}),w&&(0,d.jsx)("div",{className:"flex items-center justify-center py-8 text-sm text-rose-400",children:w}),C&&s?.drives&&s.drives.map(a=>(0,d.jsxs)("button",{onClick:()=>{var b;return b=a.path,void(D(!1),F(b))},className:"flex w-full items-center gap-3 border-b border-border/30 px-4 py-2.5 text-left transition-colors hover:bg-accent last:border-b-0",children:[(0,d.jsx)(l,{className:"h-4 w-4 text-blue-400 shrink-0"}),(0,d.jsx)("span",{className:"flex-1 text-sm text-foreground truncate",children:a.name}),(0,d.jsx)("span",{className:"shrink-0 text-xs text-muted-foreground",children:a.path})]},a.path)),!C&&!u&&!w&&0===H.length&&(0,d.jsx)("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:r("folder.empty")}),!C&&!u&&!w&&H.map(a=>(0,d.jsxs)("button",{onClick:()=>{a.isGit||g?(c(a.path),b(!1)):F(a.path)},onDoubleClick:()=>F(a.path),className:"flex w-full items-center gap-3 border-b border-border/30 px-4 py-2.5 text-left transition-colors hover:bg-accent last:border-b-0",children:[a.isGit?(0,d.jsx)(h,{className:"h-4 w-4 text-emerald-400 shrink-0"}):(0,d.jsx)(f.Folder,{className:"h-4 w-4 text-primary/70 shrink-0"}),(0,d.jsx)("span",{className:"flex-1 text-sm text-foreground truncate",children:a.name}),a.isGit&&(0,d.jsx)("span",{className:"shrink-0 rounded-md bg-emerald-500/10 px-2 py-0.5 text-[10px] font-medium text-emerald-400 ring-1 ring-emerald-500/20",children:"git"})]},a.path))]}),(0,d.jsxs)("div",{className:"flex justify-end gap-2 px-5 py-3 shrink-0 border-t border-border",children:[(0,d.jsx)(n.Button,{variant:"outline",onClick:()=>b(!1),children:r("common.cancel")}),(0,d.jsx)(n.Button,{onClick:()=>{s?.currentPath&&(c(s.currentPath),b(!1))},className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:r("folder.selectPath")})]})]})})})}],563504)},367848,a=>{"use strict";var b=a.i(879876);let c=(0,b.createServerReference)("40797d27b8ca6795d755ae7230dd593555864c7745",b.callServer,void 0,b.findSourceMapURL,"createProject");a.s(["createProject",0,c])}];
|
|
1
|
+
module.exports=[792533,(a,b,c)=>{"use strict";b.exports=a.r(918622)},175391,(a,b,c)=>{"use strict";b.exports=a.r(792533).vendored["react-ssr"].React},858360,(a,b,c)=>{"use strict";b.exports=a.r(792533).vendored["react-ssr"].ReactJsxRuntime},2765,(a,b,c)=>{"use strict";b.exports=a.r(792533).vendored["react-ssr"].ReactServerDOMTurbopackClient},425422,(a,b,c)=>{"use strict";b.exports=a.r(792533).vendored["react-ssr"].ReactDOM},362556,(a,b,c)=>{"use strict";b.exports=a.r(792533).vendored.contexts.AppRouterContext},923638,(a,b,c)=>{"use strict";b.exports=a.r(792533).vendored.contexts.HooksClientContext},635039,(a,b,c)=>{"use strict";b.exports=a.r(792533).vendored.contexts.ServerInsertedHtml},115727,(a,b,c)=>{"use strict";function d(a){if("function"!=typeof WeakMap)return null;var b=new WeakMap,c=new WeakMap;return(d=function(a){return a?c:b})(a)}c._=function(a,b){if(!b&&a&&a.__esModule)return a;if(null===a||"object"!=typeof a&&"function"!=typeof a)return{default:a};var c=d(b);if(c&&c.has(a))return c.get(a);var e={__proto__:null},f=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var g in a)if("default"!==g&&Object.prototype.hasOwnProperty.call(a,g)){var h=f?Object.getOwnPropertyDescriptor(a,g):null;h&&(h.get||h.set)?Object.defineProperty(e,g,h):e[g]=a[g]}return e.default=a,c&&c.set(a,e),e}},13241,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d,e,f={ACTION_HMR_REFRESH:function(){return l},ACTION_NAVIGATE:function(){return i},ACTION_REFRESH:function(){return h},ACTION_RESTORE:function(){return j},ACTION_SERVER_ACTION:function(){return m},ACTION_SERVER_PATCH:function(){return k},PrefetchKind:function(){return n},ScrollBehavior:function(){return o}};for(var g in f)Object.defineProperty(c,g,{enumerable:!0,get:f[g]});let h="refresh",i="navigate",j="restore",k="server-patch",l="hmr-refresh",m="server-action";var n=((d={}).AUTO="auto",d.FULL="full",d),o=((e={})[e.Default=0]="Default",e[e.NoScroll=1]="NoScroll",e);("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)},385443,(a,b,c)=>{"use strict";function d(a){return null!==a&&"object"==typeof a&&"then"in a&&"function"==typeof a.then}Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"isThenable",{enumerable:!0,get:function(){return d}})},785904,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={dispatchAppRouterAction:function(){return i},dispatchGestureState:function(){return j},refreshOnInstantNavigationUnlock:function(){return h},useActionQueue:function(){return k}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f=a.r(115727)._(a.r(175391)),g=a.r(385443);a.r(13241);function h(){}function i(a){!0;throw Object.defineProperty(Error("Internal Next.js error: Router action dispatched before initialization."),"__NEXT_ERROR_CODE",{value:"E668",enumerable:!1,configurable:!0})}function j(a){!0;throw Object.defineProperty(Error("Internal Next.js error: Router action dispatched before initialization."),"__NEXT_ERROR_CODE",{value:"E668",enumerable:!1,configurable:!0})}function k(a){let[b,c]=f.default.useState(a.state),[d,e]=(0,f.useOptimistic)(b),h=(0,f.useMemo)(()=>d,[d]);return(0,g.isThenable)(h)?(0,f.use)(h):h}("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)},561262,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"callServer",{enumerable:!0,get:function(){return g}});let d=a.r(175391),e=a.r(13241),f=a.r(785904);async function g(a,b){return new Promise((c,g)=>{(0,d.startTransition)(()=>{(0,f.dispatchAppRouterAction)({type:e.ACTION_SERVER_ACTION,actionId:a,actionArgs:b,resolve:c,reject:g})})})}("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)},689166,(a,b,c)=>{"use strict";let d;Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"findSourceMapURL",{enumerable:!0,get:function(){return d}});("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)},879876,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={callServer:function(){return f.callServer},createServerReference:function(){return h.createServerReference},findSourceMapURL:function(){return g.findSourceMapURL}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f=a.r(561262),g=a.r(689166),h=a.r(2765)},669794,a=>{"use strict";let b=(0,a.i(302856).default)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);a.s(["default",0,b])},14180,a=>{"use strict";let b=(0,a.i(302856).default)("archive",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]]);a.s(["Archive",0,b],14180)},986379,a=>{"use strict";let b=(0,a.i(302856).default)("folder-open",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);a.s(["FolderOpen",0,b],986379)},569210,a=>{"use strict";let b=(0,a.i(302856).default)("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"}]]);a.s(["Trash2",0,b],569210)},154492,a=>{"use strict";let b=(0,a.i(302856).default)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);a.s(["default",0,b])},109434,a=>{"use strict";var b=a.i(154492);a.s(["Loader2",()=>b.default])},161604,a=>{"use strict";let b=(0,a.i(302856).default)("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"}]]);a.s(["FileText",0,b],161604)},246962,a=>{"use strict";var b=a.i(858360),c=a.i(44585);a.s(["Textarea",0,function({className:a,...d}){return(0,b.jsx)("textarea",{"data-slot":"textarea",className:(0,c.cn)("flex field-sizing-content min-h-16 w-full rounded-lg border border-input bg-transparent px-2.5 py-2 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",a),...d})}])},94202,a=>{"use strict";let b=(0,a.i(302856).default)("pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);a.s(["Pencil",0,b],94202)},938899,a=>{"use strict";let b=(0,a.i(302856).default)("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"}]]);a.s(["Sparkles",0,b],938899)},766679,563504,a=>{"use strict";var b=a.i(879876);let c=(0,b.createServerReference)("60ccf59bb9af91735afc5f5f702a3cec4af478797f",b.callServer,void 0,b.findSourceMapURL,"analyzeProjectDirectory");a.s(["analyzeProjectDirectory",0,c],766679);var d=a.i(858360),e=a.i(175391),f=a.i(240028),g=a.i(302856);let h=(0,g.default)("folder-git-2",[["path",{d:"M18 19a5 5 0 0 1-5-5v8",key:"sz5oeg"}],["path",{d:"M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5",key:"1w6njk"}],["circle",{cx:"13",cy:"12",r:"2",key:"1j92g6"}],["circle",{cx:"20",cy:"19",r:"2",key:"1obnsp"}]]),i=(0,g.default)("house",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]]);var j=a.i(413857),k=a.i(410215);let l=(0,g.default)("hard-drive",[["path",{d:"M10 16h.01",key:"1bzywj"}],["path",{d:"M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"18tbho"}],["path",{d:"M21.946 12.013H2.054",key:"zqlbp7"}],["path",{d:"M6 16h.01",key:"1pmjb7"}]]);var m=a.i(857122),n=a.i(410756),o=a.i(620235),p=a.i(584335),q=a.i(358440);a.s(["FolderBrowserDialog",0,function({open:a,onOpenChange:b,onSelect:c,gitOnly:g=!1}){let{t:r}=(0,p.useI18n)(),[s,t]=(0,e.useState)(null),[u,v]=(0,e.useState)(!1),[w,x]=(0,e.useState)(null),[y,z]=(0,e.useState)(""),[A,B]=(0,e.useState)(""),[C,D]=(0,e.useState)(!1),E=(0,e.useRef)(null),F=(0,e.useCallback)(async a=>{v(!0),x(null),B(""),D(!1);try{let b=a?`/api/browse-fs?path=${encodeURIComponent(a)}`:"/api/browse-fs",c=await fetch(b);if(!c.ok){let a=await c.json();x(a.error||"Failed");return}let d=await c.json();t(d),z(d.currentPath)}catch{x("Failed to browse filesystem")}finally{v(!1)}},[]);(0,e.useEffect)(()=>{a&&(F(),setTimeout(()=>E.current?.focus(),200))},[a,F]);let G=()=>{y.trim()&&F(y.trim())},H=s?.folders.filter(a=>a.name.toLowerCase().includes(A.toLowerCase()))??[];return(0,d.jsx)(m.Dialog,{open:a,onOpenChange:b,children:(0,d.jsx)(m.DialogContent,{className:"p-0 gap-0",style:{maxWidth:"36rem",overflow:"hidden"},children:(0,d.jsxs)("div",{className:"flex flex-col max-h-[60vh] overflow-hidden",children:[(0,d.jsxs)("div",{className:"px-5 pt-5 pb-3 shrink-0",children:[(0,d.jsx)(m.DialogTitle,{children:r(g?"folder.selectGitRepo":"folder.selectFolder")}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:r("folder.hint")})]}),(0,d.jsxs)("div",{className:"border-t border-border px-4 pt-3 pb-2 shrink-0",children:[(0,d.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:r("folder.manualInput")}),(0,d.jsxs)("div",{className:"mt-1.5 flex gap-2",children:[(0,d.jsx)(o.Input,{ref:E,value:y,onChange:a=>z(a.target.value),onKeyDown:a=>"Enter"===a.key&&G(),placeholder:"/path/to/your/project",title:y,className:"flex-1 min-w-0"}),(0,d.jsx)(n.Button,{variant:"outline",onClick:G,className:"h-8 px-3 shrink-0",children:r("folder.goTo")})]})]}),(0,d.jsxs)("div",{className:"px-4 py-2 shrink-0",children:[(0,d.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:r("folder.searchDir")}),(0,d.jsxs)("div",{className:"relative mt-1.5",children:[(0,d.jsx)(k.Search,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted-foreground"}),(0,d.jsx)("input",{value:A,onChange:a=>B(a.target.value),placeholder:"Filter folders and files...",className:"h-8 w-full rounded-md border border-border bg-background pl-8 pr-3 text-sm text-foreground placeholder-muted-foreground outline-none focus:border-ring focus:ring-1 focus:ring-ring"})]})]}),(0,d.jsxs)("div",{className:"flex items-center gap-1.5 border-y border-border px-4 py-2 shrink-0 min-w-0",children:[(0,d.jsx)(n.Button,{variant:"outline",size:"icon-sm",onClick:()=>s?.homePath&&F(s.homePath),className:"shrink-0 text-muted-foreground",title:"Home",children:(0,d.jsx)(i,{className:"h-3.5 w-3.5"})}),(0,d.jsx)(n.Button,{variant:"outline",size:"icon-sm",onClick:()=>{s&&("__DRIVES__"===s.parentPath?D(!0):(D(!1),F(s.parentPath)))},className:"shrink-0 text-muted-foreground",title:"Parent",children:(0,d.jsx)(j.ChevronUp,{className:"h-3.5 w-3.5"})}),s?.drives&&s.drives.length>0&&(0,d.jsx)(n.Button,{variant:C?"default":"outline",size:"icon-sm",onClick:()=>D(a=>!a),className:"shrink-0 text-muted-foreground",title:"Drives",children:(0,d.jsx)(l,{className:"h-3.5 w-3.5"})}),(0,d.jsx)("div",{className:"min-w-0 flex-1 truncate text-sm text-foreground font-mono",title:s?.currentPath??"",children:s?.currentPath??"..."})]}),(0,d.jsxs)(q.ScrollArea,{className:"min-h-0 flex-1",children:[u&&(0,d.jsx)("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:"Loading..."}),w&&(0,d.jsx)("div",{className:"flex items-center justify-center py-8 text-sm text-rose-400",children:w}),C&&s?.drives&&s.drives.map(a=>(0,d.jsxs)("button",{onClick:()=>{var b;return b=a.path,void(D(!1),F(b))},className:"flex w-full items-center gap-3 border-b border-border/30 px-4 py-2.5 text-left transition-colors hover:bg-accent last:border-b-0",children:[(0,d.jsx)(l,{className:"h-4 w-4 text-blue-400 shrink-0"}),(0,d.jsx)("span",{className:"flex-1 text-sm text-foreground truncate",children:a.name}),(0,d.jsx)("span",{className:"shrink-0 text-xs text-muted-foreground",children:a.path})]},a.path)),!C&&!u&&!w&&0===H.length&&(0,d.jsx)("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:r("folder.empty")}),!C&&!u&&!w&&H.map(a=>(0,d.jsxs)("button",{onClick:()=>{a.isGit||g?(c(a.path),b(!1)):F(a.path)},onDoubleClick:()=>F(a.path),className:"flex w-full items-center gap-3 border-b border-border/30 px-4 py-2.5 text-left transition-colors hover:bg-accent last:border-b-0",children:[a.isGit?(0,d.jsx)(h,{className:"h-4 w-4 text-emerald-400 shrink-0"}):(0,d.jsx)(f.Folder,{className:"h-4 w-4 text-primary/70 shrink-0"}),(0,d.jsx)("span",{className:"flex-1 text-sm text-foreground truncate",children:a.name}),a.isGit&&(0,d.jsx)("span",{className:"shrink-0 rounded-md bg-emerald-500/10 px-2 py-0.5 text-[10px] font-medium text-emerald-400 ring-1 ring-emerald-500/20",children:"git"})]},a.path))]}),(0,d.jsxs)("div",{className:"flex justify-end gap-2 px-5 py-3 shrink-0 border-t border-border",children:[(0,d.jsx)(n.Button,{variant:"outline",onClick:()=>b(!1),children:r("common.cancel")}),(0,d.jsx)(n.Button,{onClick:()=>{s?.currentPath&&(c(s.currentPath),b(!1))},className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:r("folder.selectPath")})]})]})})})}],563504)},712435,a=>{"use strict";var b=a.i(879876);let c=(0,b.createServerReference)("409353d46651fcf4e4d495d9d9d645964183bd0adc",b.callServer,void 0,b.findSourceMapURL,"createProject");a.s(["createProject",0,c])}];
|
|
2
2
|
|
|
3
|
-
//# sourceMappingURL=
|
|
3
|
+
//# sourceMappingURL=project_f_tower_0ge0mtj._.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
module.exports=[690834,a=>{"use strict";let b=(0,a.i(302856).default)("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);a.s(["default",0,b])},582043,a=>{"use strict";var b=a.i(858360),c=a.i(175391),d=a.i(448287),e=a.i(759985),f=a.i(14180),g=a.i(263973),h=a.i(94202),i=a.i(569210),j=a.i(317076),k=a.i(302856);let l=(0,k.default)("chevrons-left",[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]]),m=(0,k.default)("tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);var n=a.i(161604),o=a.i(986379);let p=(0,k.default)("gauge",[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]]);var q=a.i(445705),r=a.i(358440),s=a.i(857122),t=a.i(95446),u=a.i(410756),v=a.i(620235),w=a.i(879876);let x=(0,w.createServerReference)("40331099e112cf0a12c70815aea55488d6338ffaa5",w.callServer,void 0,w.findSourceMapURL,"createWorkspace"),y=(0,w.createServerReference)("60cdcaf10b283d21d6be72f5416a056779b2d9f1c3",w.callServer,void 0,w.findSourceMapURL,"updateWorkspace"),z=(0,w.createServerReference)("40e92d14e52706c339034c1d51a996ef2a93e177f3",w.callServer,void 0,w.findSourceMapURL,"deleteWorkspace"),A=(0,w.createServerReference)("4050e118a4c6b1e6a776991f0a0ee8dffc19531892",w.callServer,void 0,w.findSourceMapURL,"getLabelsForWorkspace"),B=(0,w.createServerReference)("4055c35b9777afb0676c2235fec3a77dddbb35484d",w.callServer,void 0,w.findSourceMapURL,"createLabel"),C=(0,w.createServerReference)("4035132a339561d1675b7bb24bdca38154a4d95293",w.callServer,void 0,w.findSourceMapURL,"deleteLabel");var D=a.i(584335),E=a.i(942308);let F=["📋","🚀","🎯","💡","🔧","📦","🎨","📊","🔬","🌟","📝","🏗️"];function G({workspaces:a}){let k,s=(0,d.useRouter)(),v=(0,d.usePathname)(),{t:w}=(0,D.useI18n)(),[A,B]=(0,c.useState)(!1);(0,c.useEffect)(()=>{"true"===localStorage.getItem("sidebar-collapsed")&&B(!0)},[]);let[C,I]=(0,c.useState)(!1),[K,L]=(0,c.useState)(!1),[M,N]=(0,c.useState)(!1),[O,P]=(0,c.useState)(null),[Q,R]=(0,c.useState)(""),[S,T]=(0,c.useState)(F[0]),[U,V]=(0,c.useState)(null),W=v.split("/workspaces/")[1]?.split("/")[0],X=(0,c.useCallback)(()=>{B(a=>{let b=!a;return localStorage.setItem("sidebar-collapsed",String(b)),b})},[]),Y=(0,c.useCallback)(async()=>{if(!Q.trim())return;let a=await x({name:Q.trim(),description:S});R(""),T(F[0]),I(!1),s.refresh(),s.push(`/workspaces/${a.id}`)},[Q,S,s]),Z=(0,c.useCallback)(async()=>{Q.trim()&&U&&(await y(U,{name:Q.trim(),description:S}),R(""),L(!1),V(null),s.refresh())},[Q,S,U,s]),$=(0,c.useCallback)(a=>{V(a.id),R(a.name),T(a.description&&F.includes(a.description)?a.description:F[0]),L(!0)},[]),_=(0,c.useCallback)(async(b,c)=>{if(a.length<=1)return void E.toast.error(w("sidebar.lastWorkspaceError"));if(confirm(w("sidebar.deleteConfirm",{name:c})))try{await z(b),s.refresh(),W===b&&s.push("/workspaces")}catch{E.toast.error(w("sidebar.lastWorkspaceError"))}},[W,s,w,a.length]),aa=(0,c.useCallback)(a=>{P(a),N(!0)},[]),ab=a=>a.description&&F.includes(a.description)?a.description:a.name.charAt(0).toUpperCase();if(A){let c;return(0,b.jsxs)("aside",{className:"flex h-screen w-14 flex-col items-center border-r border-border bg-sidebar py-3",children:[(0,b.jsxs)(t.Tooltip,{children:[(0,b.jsx)(t.TooltipTrigger,{render:(0,b.jsx)("button",{onClick:X,className:"mb-4 flex h-9 w-9 items-center justify-center rounded-lg bg-primary/10 ring-1 ring-primary/20 transition-transform hover:scale-105"}),children:(0,b.jsx)("img",{src:"/logo.png",alt:"Tower",className:"h-6 w-6 rounded"})}),(0,b.jsx)(t.TooltipContent,{side:"right",sideOffset:8,children:w("sidebar.expand")})]}),(0,b.jsx)(r.ScrollArea,{className:"flex-1 min-h-0",children:(0,b.jsxs)("div",{className:"flex flex-col items-center gap-1 px-0.5 pt-1",children:[a.map(a=>{let c=W===a.id,d=ab(a);return(0,b.jsxs)(t.Tooltip,{children:[(0,b.jsx)(t.TooltipTrigger,{render:(0,b.jsx)("button",{onClick:()=>{c||s.push(`/workspaces/${a.id}`)},className:`flex h-9 w-9 items-center justify-center rounded-lg transition-all ${c?"ring-1 ring-primary/20 text-foreground cursor-default":"text-muted-foreground hover:text-foreground cursor-pointer"}`}),children:(0,b.jsx)("span",{className:"flex h-7 w-7 items-center justify-center rounded-md bg-muted text-sm",children:F.includes(d)?d:(0,b.jsx)("span",{className:"text-xs font-semibold",children:d})})}),(0,b.jsx)(t.TooltipContent,{side:"right",sideOffset:8,children:a.name})]},a.id)}),(0,b.jsxs)(t.Tooltip,{children:[(0,b.jsx)(t.TooltipTrigger,{render:(0,b.jsx)("button",{"data-tour":"create-workspace",onClick:()=>I(!0),className:"flex h-9 w-9 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:bg-accent hover:text-foreground"}),children:(0,b.jsx)(g.Plus,{className:"h-4 w-4"})}),(0,b.jsx)(t.TooltipContent,{side:"right",sideOffset:8,children:w("sidebar.newWorkspace")})]})]})}),(0,b.jsxs)("div",{className:"mt-2 flex flex-col items-center gap-1",children:[(c=W||a[0]?.id)?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(t.Tooltip,{children:[(0,b.jsx)(t.TooltipTrigger,{render:(0,b.jsx)("button",{onClick:()=>s.push(`/workspaces/${c}/notes`),className:`rounded-lg p-2 transition-colors ${v.includes("/notes")?"text-foreground bg-accent":"text-muted-foreground hover:bg-accent hover:text-foreground"}`}),children:(0,b.jsx)(n.FileText,{className:"h-4 w-4"})}),(0,b.jsx)(t.TooltipContent,{side:"right",sideOffset:8,children:w("sidebar.notes")})]}),(0,b.jsxs)(t.Tooltip,{children:[(0,b.jsx)(t.TooltipTrigger,{render:(0,b.jsx)("button",{onClick:()=>s.push(`/workspaces/${c}/assets`),className:`rounded-lg p-2 transition-colors ${v.includes("/assets")?"text-foreground bg-accent":"text-muted-foreground hover:bg-accent hover:text-foreground"}`}),children:(0,b.jsx)(o.FolderOpen,{className:"h-4 w-4"})}),(0,b.jsx)(t.TooltipContent,{side:"right",sideOffset:8,children:w("sidebar.assets")})]}),(0,b.jsxs)(t.Tooltip,{children:[(0,b.jsx)(t.TooltipTrigger,{render:(0,b.jsx)("button",{onClick:()=>s.push(`/workspaces/${c}/archive`),className:`rounded-lg p-2 transition-colors ${v.includes("/archive")?"text-foreground bg-accent":"text-muted-foreground hover:bg-accent hover:text-foreground"}`}),children:(0,b.jsx)(f.Archive,{className:"h-4 w-4"})}),(0,b.jsx)(t.TooltipContent,{side:"right",sideOffset:8,children:w("sidebar.archive")})]})]}):null,(0,b.jsxs)(t.Tooltip,{children:[(0,b.jsx)(t.TooltipTrigger,{render:(0,b.jsx)("button",{onClick:()=>s.push("/missions"),className:`rounded-lg p-2 transition-colors ${"/missions"===v?"text-foreground bg-accent":"text-muted-foreground hover:bg-accent hover:text-foreground"}`}),children:(0,b.jsx)(p,{className:"h-4 w-4"})}),(0,b.jsx)(t.TooltipContent,{side:"right",sideOffset:8,children:w("missions.navLabel")})]})]}),(0,b.jsx)(H,{open:C,onOpenChange:I,title:w("workspace.create"),name:Q,onNameChange:R,icon:S,onIconChange:T,onSubmit:Y,submitLabel:w("common.create"),nameLabel:w("workspace.name"),iconLabel:w("workspace.icon"),namePlaceholder:w("workspace.namePlaceholder"),cancelLabel:w("common.cancel")})]})}return(0,b.jsxs)("aside",{className:"noise relative flex h-screen w-56 flex-col border-r border-border bg-sidebar",children:[(0,b.jsxs)("div",{className:"relative z-10 flex items-center gap-3 px-4 py-4",children:[(0,b.jsx)("img",{src:"/logo.png",alt:"Tower",className:"h-9 w-9 rounded-lg"}),(0,b.jsxs)("div",{className:"flex-1",children:[(0,b.jsx)("div",{className:"text-sm font-semibold tracking-tight text-foreground",children:"Tower"}),(0,b.jsx)("div",{className:"text-[10px] font-medium uppercase tracking-widest text-muted-foreground",children:"Studio"})]}),(0,b.jsx)(u.Button,{variant:"ghost",size:"icon-xs",onClick:X,className:"text-muted-foreground",title:w("sidebar.collapse"),children:(0,b.jsx)(l,{className:"h-4 w-4"})})]}),(0,b.jsxs)("div",{className:"relative z-10 flex items-center justify-between px-4 py-2",children:[(0,b.jsx)("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:w("sidebar.workspace")}),(0,b.jsx)(u.Button,{variant:"ghost",size:"icon-sm",className:"text-muted-foreground","data-tour":"create-workspace",onClick:()=>{R(""),T(F[0]),I(!0)},title:w("sidebar.newWorkspace"),children:(0,b.jsx)(g.Plus,{className:"h-3.5 w-3.5"})})]}),(0,b.jsx)(r.ScrollArea,{className:"relative z-10 mt-2 flex-1 min-h-0",children:(0,b.jsx)("div",{className:"px-2 py-1",children:a.map(c=>{var d;let e,f,g,k=W===c.id,l=ab(c);return(0,b.jsxs)("div",{className:`group relative flex items-center rounded-lg transition-all ${k?"bg-accent ring-1 ring-primary/15":"hover:bg-accent/60"}`,children:[(0,b.jsxs)("button",{onClick:()=>{k||s.push(`/workspaces/${c.id}`)},className:`flex flex-1 items-center gap-2.5 px-3 py-2.5 text-left ${k?"cursor-default":"cursor-pointer"}`,children:[(0,b.jsx)("span",{className:"flex h-7 w-7 items-center justify-center rounded-md bg-muted text-sm",children:F.includes(l)?l:(0,b.jsx)("span",{className:"text-xs font-semibold text-muted-foreground",children:l})}),(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsx)("div",{className:`truncate text-sm font-medium ${k?"text-foreground":"text-secondary-foreground"}`,children:c.name}),(0,b.jsx)("div",{className:"text-[11px] text-muted-foreground",children:(d=c.updatedAt,f=Math.floor((e=Date.now()-new Date(d).getTime())/6e4),g=Math.floor(e/36e5),f<60?`${f}m ago`:g<24?`${g}h ago`:`${Math.floor(g/24)}d ago`)})]})]}),(0,b.jsxs)(q.DropdownMenu,{children:[(0,b.jsx)(q.DropdownMenuTrigger,{render:(0,b.jsx)("button",{className:"mr-2 rounded-md p-1 text-muted-foreground opacity-0 transition-all hover:bg-background hover:text-foreground group-hover:opacity-100",onClick:a=>a.stopPropagation()}),children:(0,b.jsx)(j.MoreHorizontal,{className:"h-3.5 w-3.5"})}),(0,b.jsxs)(q.DropdownMenuContent,{align:"start",side:"right",children:[(0,b.jsxs)(q.DropdownMenuItem,{onClick:()=>$(c),children:[(0,b.jsx)(h.Pencil,{className:"mr-2 h-3.5 w-3.5"}),w("sidebar.rename")]}),(0,b.jsxs)(q.DropdownMenuItem,{onClick:()=>aa(c.id),children:[(0,b.jsx)(m,{className:"mr-2 h-3.5 w-3.5"}),w("sidebar.manageLabels")]}),(0,b.jsxs)(q.DropdownMenuItem,{className:a.length<=1?"text-muted-foreground opacity-50":"text-rose-400",disabled:a.length<=1,onClick:()=>_(c.id,c.name),children:[(0,b.jsx)(i.Trash2,{className:"mr-2 h-3.5 w-3.5"}),w("sidebar.delete")]})]})]})]},c.id)})})}),(0,b.jsxs)(e.default,{href:"/missions",className:`relative z-10 flex items-center gap-2 border-t border-border px-4 py-3 text-[11px] cursor-pointer transition-colors ${"/missions"===v?"text-foreground":"text-muted-foreground hover:text-foreground"}`,children:[(0,b.jsx)(p,{className:"h-3.5 w-3.5"}),(0,b.jsx)("span",{children:w("missions.navLabel")})]}),(k=W||a[0]?.id)?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(e.default,{href:`/workspaces/${k}/notes`,className:"relative z-10 flex items-center gap-2 border-t border-border px-4 py-3 text-[11px] text-muted-foreground cursor-pointer hover:text-foreground transition-colors",children:[(0,b.jsx)(n.FileText,{className:"h-3.5 w-3.5"}),(0,b.jsx)("span",{children:w("sidebar.notes")})]}),(0,b.jsxs)(e.default,{href:`/workspaces/${k}/assets`,className:"relative z-10 flex items-center gap-2 px-4 py-3 text-[11px] text-muted-foreground cursor-pointer hover:text-foreground transition-colors",children:[(0,b.jsx)(o.FolderOpen,{className:"h-3.5 w-3.5"}),(0,b.jsx)("span",{children:w("sidebar.assets")})]}),(0,b.jsxs)(e.default,{href:`/workspaces/${k}/archive`,className:"relative z-10 flex items-center gap-2 px-4 py-3 text-[11px] text-muted-foreground cursor-pointer hover:text-foreground transition-colors",children:[(0,b.jsx)(f.Archive,{className:"h-3.5 w-3.5"}),(0,b.jsx)("span",{children:w("sidebar.archive")})]})]}):null,(0,b.jsx)(H,{open:C,onOpenChange:I,title:w("workspace.create"),name:Q,onNameChange:R,icon:S,onIconChange:T,onSubmit:Y,submitLabel:w("common.create"),nameLabel:w("workspace.name"),iconLabel:w("workspace.icon"),namePlaceholder:w("workspace.namePlaceholder"),cancelLabel:w("common.cancel")}),(0,b.jsx)(H,{open:K,onOpenChange:a=>{L(a),a||V(null)},title:w("workspace.edit"),name:Q,onNameChange:R,icon:S,onIconChange:T,onSubmit:Z,submitLabel:w("common.save"),nameLabel:w("workspace.name"),iconLabel:w("workspace.icon"),namePlaceholder:w("workspace.namePlaceholder"),cancelLabel:w("common.cancel")}),O&&(0,b.jsx)(J,{open:M,onOpenChange:a=>{N(a),a||P(null)},workspaceId:O})]})}function H({open:a,onOpenChange:c,title:d,name:e,onNameChange:f,icon:g,onIconChange:h,onSubmit:i,submitLabel:j,nameLabel:k,iconLabel:l,namePlaceholder:m,cancelLabel:n}){return(0,b.jsx)(s.Dialog,{open:a,onOpenChange:c,disablePointerDismissal:!0,children:(0,b.jsxs)(s.DialogContent,{className:"sm:max-w-sm",children:[(0,b.jsx)(s.DialogHeader,{children:(0,b.jsx)(s.DialogTitle,{children:d})}),(0,b.jsxs)("div",{className:"space-y-4 py-2",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:k}),(0,b.jsx)(v.Input,{placeholder:m,value:e,onChange:a=>f(a.target.value),onKeyDown:a=>"Enter"===a.key&&a.preventDefault(),className:"mt-1.5"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:l}),(0,b.jsx)("div",{className:"mt-1.5 grid grid-cols-6 gap-1.5",children:F.map(a=>(0,b.jsx)("button",{onClick:()=>h(a),className:`flex h-10 w-10 items-center justify-center rounded-lg text-lg transition-all ${g===a?"bg-primary/15 ring-2 ring-primary/30 scale-110":"bg-muted hover:bg-accent"}`,children:a},a))})]})]}),(0,b.jsxs)(s.DialogFooter,{children:[(0,b.jsx)(u.Button,{variant:"outline",onClick:()=>c(!1),children:n}),(0,b.jsx)(u.Button,{onClick:i,disabled:!e.trim(),className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:j})]})]})})}let I=["#3b82f6","#ef4444","#f59e0b","#10b981","#8b5cf6","#ec4899","#06b6d4","#f97316"];function J({open:a,onOpenChange:d,workspaceId:e}){let{t:f}=(0,D.useI18n)(),[g,h]=(0,c.useState)([]),[i,j]=(0,c.useState)(""),[k,l]=(0,c.useState)(I[0]);(0,c.useEffect)(()=>{a&&A(e).then(h)},[a,e]);let m=async()=>{i.trim()&&(await B({name:i.trim(),color:k,workspaceId:e}),h(await A(e)),j(""))},n=async a=>{await C(a),h(b=>b.filter(b=>b.id!==a))};return(0,b.jsx)(s.Dialog,{open:a,onOpenChange:d,disablePointerDismissal:!0,children:(0,b.jsxs)(s.DialogContent,{className:"sm:max-w-sm",children:[(0,b.jsx)(s.DialogHeader,{children:(0,b.jsx)(s.DialogTitle,{children:f("label.manage")})}),(0,b.jsxs)("div",{className:"space-y-3 py-2",children:[g.map(a=>(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("span",{className:"h-3 w-3 rounded-full",style:{backgroundColor:a.color}}),(0,b.jsx)("span",{className:"flex-1 text-sm text-foreground",children:a.name}),a.isBuiltin?(0,b.jsx)("span",{className:"text-[10px] text-muted-foreground",children:f("label.builtin")}):(0,b.jsx)("button",{onClick:()=>n(a.id),className:"text-xs text-rose-400 hover:text-rose-300",children:f("common.delete")})]},a.id)),(0,b.jsxs)("div",{className:"border-t border-border pt-3",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(v.Input,{placeholder:f("label.name"),value:i,onChange:a=>j(a.target.value),onKeyDown:a=>"Enter"===a.key&&a.preventDefault(),className:"flex-1 h-8"}),(0,b.jsx)(u.Button,{size:"sm",onClick:m,disabled:!i.trim(),className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:f("label.add")})]}),(0,b.jsx)("div",{className:"mt-2 flex gap-1.5",children:I.map(a=>(0,b.jsx)("button",{onClick:()=>l(a),className:`h-5 w-5 rounded-full transition-all ${k===a?"ring-2 ring-offset-2 ring-offset-background ring-foreground/30 scale-110":""}`,style:{backgroundColor:a}},a))})]})]})]})})}var K=a.i(432120),L=a.i(410215),M=a.i(666775);let N=(0,k.default)("command",[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]]);var O=a.i(212765);let P=(0,k.default)("bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);var Q=a.i(248763),R=a.i(470612);a.s([],243701),a.i(243701);var S=a.i(256116),T=a.i(545264);let U=c.createContext(void 0);function V(){let a=c.useContext(U);if(void 0===a)throw Error((0,T.default)(13));return a}let W={imageLoadingStatus:()=>null},X=c.forwardRef(function(a,d){let{className:e,render:f,...g}=a,[h,i]=c.useState("idle"),j=c.useMemo(()=>({imageLoadingStatus:h,setImageLoadingStatus:i}),[h,i]),k=(0,S.useRenderElement)("span",a,{state:{imageLoadingStatus:h},ref:d,props:g,stateAttributesMapping:W});return(0,b.jsx)(U.Provider,{value:j,children:k})});var Y=a.i(825863),Z=a.i(527993),$=a.i(759002),_=a.i(163323),aa=a.i(6644),ab=a.i(302398);let ac={...W,..._.transitionStatusMapping},ad=c.forwardRef(function(a,b){let{className:d,render:e,onLoadingStatusChange:f,referrerPolicy:g,crossOrigin:h,...i}=a,j=V(),k=function(a,{referrerPolicy:b,crossOrigin:d}){let[e,f]=c.useState("idle");return(0,Z.useIsoLayoutEffect)(()=>{if(!a)return f("error"),ab.NOOP;let c=!0,e=new window.Image,g=a=>()=>{c&&f(a)};return f("loading"),e.onload=g("loaded"),e.onerror=g("error"),b&&(e.referrerPolicy=b),e.crossOrigin=d??null,e.src=a,()=>{c=!1}},[a,d,b]),e}(a.src,{referrerPolicy:g,crossOrigin:h}),l="loaded"===k,{mounted:m,transitionStatus:n,setMounted:o}=(0,aa.useTransitionStatus)(l),p=c.useRef(null),q=(0,Y.useStableCallback)(a=>{f?.(a),j.setImageLoadingStatus(a)});(0,Z.useIsoLayoutEffect)(()=>{"idle"!==k&&q(k)},[k,q]),(0,$.useOpenChangeComplete)({open:l,ref:p,onComplete(){l||o(!1)}});let r=(0,S.useRenderElement)("img",a,{state:{imageLoadingStatus:k,transitionStatus:n},ref:[b,p],props:i,stateAttributesMapping:ac,enabled:m});return m?r:null});var ae=a.i(313668);let af=c.forwardRef(function(a,b){let{className:d,render:e,delay:f,...g}=a,{imageLoadingStatus:h}=V(),[i,j]=c.useState(void 0===f),k=(0,ae.useTimeout)();return c.useEffect(()=>(void 0!==f&&k.start(f,()=>j(!0)),k.clear),[k,f]),(0,S.useRenderElement)("span",a,{state:{imageLoadingStatus:h},ref:b,props:g,stateAttributesMapping:W,enabled:"loaded"!==h&&i})});a.s(["Fallback",0,af,"Image",0,ad,"Root",0,X],60418);var ag=a.i(60418),ag=ag,ah=a.i(44585);function ai({className:a,size:c="default",...d}){return(0,b.jsx)(ag.Root,{"data-slot":"avatar","data-size":c,className:(0,ah.cn)("group/avatar relative flex size-8 shrink-0 rounded-full select-none after:absolute after:inset-0 after:rounded-full after:border after:border-border after:mix-blend-darken data-[size=lg]:size-10 data-[size=sm]:size-6 dark:after:mix-blend-lighten",a),...d})}function aj({className:a,...c}){return(0,b.jsx)(ag.Fallback,{"data-slot":"avatar-fallback",className:(0,ah.cn)("flex size-full items-center justify-center rounded-full bg-muted text-sm text-muted-foreground group-data-[size=sm]/avatar:text-xs",a),...c})}let ak=(0,k.default)("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"}]]);var al=a.i(61966);let am=(0,k.default)("sticky-note",[["path",{d:"M21 9a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 15 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2z",key:"1dfntj"}],["path",{d:"M15 3v5a1 1 0 0 0 1 1h5",key:"6s6qgf"}]]),an=(0,k.default)("package-2",[["path",{d:"M12 3v6",key:"1holv5"}],["path",{d:"M16.76 3a2 2 0 0 1 1.8 1.1l2.23 4.479a2 2 0 0 1 .21.891V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V9.472a2 2 0 0 1 .211-.894L5.45 4.1A2 2 0 0 1 7.24 3z",key:"187q7i"}],["path",{d:"M3.054 9.013h17.893",key:"grwhos"}]]);var ao=a.i(54709);let ap=(0,w.createServerReference)("607d00ead39c57d614468a73b1700ed559c7478ddb",w.callServer,void 0,w.findSourceMapURL,"globalSearch");var aq=a.i(876674);let ar=[{id:"all",key:"search.all",icon:L.Search},{id:"task",key:"search.task",icon:n.FileText},{id:"project",key:"search.project",icon:ak},{id:"repository",key:"search.repository",icon:al.GitBranch},{id:"note",key:"search.note",icon:am},{id:"asset",key:"search.asset",icon:an}],as=["task","project","repository","note","asset"],at={task:"search.task",project:"search.project",repository:"search.repository",note:"search.note",asset:"search.asset"};function au({result:a,onSelect:c}){let d=ar.find(b=>b.id===a.type)?.icon??n.FileText;return(0,b.jsxs)("button",{onClick:()=>c(a),className:"flex w-full items-center gap-3 border-b border-border/30 px-4 py-3 text-left transition-colors hover:bg-accent last:border-b-0",children:[(0,b.jsx)("div",{className:"rounded-md bg-muted p-1.5",children:(0,b.jsx)(d,{className:"h-3.5 w-3.5 text-muted-foreground"})}),(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsx)("div",{className:"text-sm font-medium text-foreground truncate",children:a.title}),(0,b.jsx)("div",{className:"text-xs text-muted-foreground truncate",children:a.subtitle}),a.snippet&&(0,b.jsx)("div",{className:"text-xs text-muted-foreground/70 truncate mt-0.5",children:a.snippet})]})]})}function av({open:a,onOpenChange:e}){let f,{t:g}=(0,D.useI18n)(),h=(0,d.useRouter)(),[i,j]=(0,c.useState)(""),[k,l]=(0,c.useState)("all"),[m,n]=(0,c.useState)([]),[o,p]=(0,c.useState)(!1),[q,t]=(0,c.useState)(250),v=(0,c.useRef)(null),w=(0,c.useRef)(null);(0,c.useEffect)(()=>{a&&((0,aq.getConfigValue)("search.debounceMs",250).then(t),setTimeout(()=>v.current?.focus(),100),j(""),n([]))},[a]),(0,c.useEffect)(()=>{if(w.current&&clearTimeout(w.current),!i.trim()){n([]),p(!1);return}p(!0);let a=!1;return w.current=setTimeout(async()=>{let b=await ap(i,k);a||(n(b),p(!1))},q),()=>{w.current&&clearTimeout(w.current),a=!0}},[i,k,q]);let x=(0,c.useCallback)(a=>{h.push(a.navigateTo),e(!1)},[h,e]);return(0,b.jsx)(s.Dialog,{open:a,onOpenChange:e,children:(0,b.jsxs)(s.DialogContent,{className:"sm:max-w-lg p-0 gap-0 overflow-hidden !top-[10vh] !-translate-y-0",showCloseButton:!1,children:[(0,b.jsxs)("div",{className:"flex items-center border-b border-border px-4",children:[(0,b.jsx)(L.Search,{className:"h-4 w-4 text-muted-foreground"}),(0,b.jsx)("input",{ref:v,value:i,onChange:a=>j(a.target.value),placeholder:g("search.placeholder"),className:"flex-1 bg-transparent px-3 py-3.5 text-sm text-foreground placeholder-muted-foreground outline-none"}),i&&(0,b.jsx)(u.Button,{variant:"ghost",size:"icon",onClick:()=>{j(""),n([])},className:"text-muted-foreground",children:(0,b.jsx)(ao.X,{className:"h-3.5 w-3.5"})})]}),(0,b.jsx)("div",{className:"flex items-center gap-1 border-b border-border px-4 py-2",children:ar.map(a=>{let c=a.icon;return(0,b.jsxs)("button",{onClick:()=>l(a.id),className:`flex items-center gap-1.5 rounded-md px-2.5 py-1 text-xs font-medium transition-all ${k===a.id?"bg-primary/10 text-primary ring-1 ring-primary/20":"text-muted-foreground hover:bg-accent hover:text-foreground"}`,children:[(0,b.jsx)(c,{className:"h-3 w-3"}),g(a.key)]},a.id)})}),(0,b.jsxs)(r.ScrollArea,{className:"max-h-80",children:[!i.trim()&&(0,b.jsx)("div",{className:"flex items-center justify-center py-12 text-sm text-muted-foreground",children:g("search.typeToSearch")}),i.trim()&&0===m.length&&!o&&(0,b.jsx)("div",{className:"flex items-center justify-center py-12 text-sm text-muted-foreground",children:g("search.noResults")}),"all"===k&&m.length>0&&(f=m.reduce((a,b)=>((a[b.type]??=[]).push(b),a),{}),as.filter(a=>f[a]?.length).map(a=>(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{className:"px-4 py-1.5 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground bg-muted/50",children:g(at[a])}),f[a].map(a=>(0,b.jsx)(au,{result:a,onSelect:x},`${a.type}-${a.id}`))]},a))),"all"!==k&&m.map(a=>(0,b.jsx)(au,{result:a,onSelect:x},`${a.type}-${a.id}`))]})]})})}function aw(a){}let ax=(0,c.createContext)(null);function ay(){return"u">typeof crypto&&crypto.randomUUID?crypto.randomUUID():`msg-${Date.now()}-${Math.random().toString(36).slice(2,9)}`}let az="assistant-image-cache";function aA(a,b,c){try{let d=sessionStorage.getItem(az),e=d?JSON.parse(d):{};e[a]||(e[a]={}),e[a][b]=c,sessionStorage.setItem(az,JSON.stringify(e))}catch{}}function aB({children:a}){let[d,e]=(0,c.useState)(!1),[f,g]=(0,c.useState)(!1),[h,i]=(0,c.useState)("sidebar"),[j,k]=(0,c.useState)(null),[l,m]=(0,c.useState)([]),[n,o]=(0,c.useState)("idle"),[p,q]=(0,c.useState)(!1),r=(0,c.useRef)([]),s=(0,c.useRef)(null),t=(0,c.useRef)(null),[u,v]=(0,c.useState)([]),[w,x]=(0,c.useState)(null),y=(0,c.useRef)(!1),z=(0,c.useCallback)(()=>{m([...r.current])},[]),A=(0,c.useCallback)(async()=>{i("dialog"===await (0,aq.getConfigValue)("assistant.displayMode","sidebar")?"dialog":"sidebar")},[]);(0,c.useEffect)(()=>{A()},[A]);let B=(0,c.useCallback)(async()=>{v([])},[]),C=(0,c.useCallback)(async a=>{q(!0);try{let b=await fetch(`/api/internal/assistant/sessions?sessionId=${encodeURIComponent(a)}`);if(!b.ok)return;let c=await b.json();if(Array.isArray(c.messages)){r.current=c.messages;let b=function(a){try{let b=sessionStorage.getItem(az);if(!b)return{};return JSON.parse(b)[a]??{}}catch{return{}}}(a);if(Object.keys(b).length>0){let a=0;r.current=r.current.map(c=>{if("user"===c.role){let d=b[a];if(a++,d?.length)return{...c,imageFilenames:d}}return c})}m([...r.current])}}catch{}finally{q(!1)}},[]);(0,c.useEffect)(()=>{B()},[B,C]);let D=(0,c.useCallback)(()=>{t.current?.abort(),s.current=null,y.current=!1,x(null),aw(null),r.current=[],m([]),o("idle")},[]),E=(0,c.useCallback)(a=>{t.current?.abort(),s.current=a,y.current=!0,x(a),aw(a),r.current=[],m([]),o("idle"),C(a)},[C]),F=(0,c.useCallback)(a=>{v([]),w===a&&D()},[w,D]),G=(0,c.useCallback)(async()=>{g(!0);try{await A(),e(!0)}finally{g(!1)}},[A]),H=(0,c.useCallback)(()=>{e(!1),t.current?.abort()},[]),I=(0,c.useCallback)(()=>{d||f?H():G()},[d,f,H,G]);(0,c.useEffect)(()=>{let a=a=>{(a.metaKey||a.ctrlKey)&&"l"===a.key&&(a.preventDefault(),I())};return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[I]);let J=(0,c.useCallback)(async(a,b)=>{if(!a.trim()&&!b?.imageFilenames?.length)return;t.current?.abort();let c=new AbortController;t.current=c;let d=0!==r.current.length||y.current?null:a,e=ay();if(r.current=[...r.current,{id:ay(),role:"user",content:a,imageFilenames:b?.imageFilenames?.length?b.imageFilenames:void 0},{id:e,role:"thinking",content:"",isStreaming:!0}],z(),b?.imageFilenames?.length&&s.current){let a=r.current.filter(a=>"user"===a.role).length-1;aA(s.current,a,b.imageFilenames)}o("connecting");let f=null;try{let g=await fetch("/api/internal/assistant/chat",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:a,sessionId:s.current,imageFilenames:b?.imageFilenames??[]}),signal:c.signal});if(!g.ok||!g.body)throw Error(`HTTP ${g.status}`);o("streaming");let h=g.body.getReader(),i=new TextDecoder,j="";for(;;){let{done:a,value:c}=await h.read();if(a)break;let g=(j+=i.decode(c,{stream:!0})).split("\n");for(let a of(j=g.pop()??"",g)){let c;if(a.startsWith("data: ")){try{c=JSON.parse(a.slice(6).trim())}catch{continue}if(c.sessionId){let a=s.current;if(s.current=c.sessionId,d&&!y.current&&c.sessionId!==a){y.current=!0;new Date().toISOString();c.sessionId,function(a){let b=a.trim();b&&b.length>30&&b.slice(0,30)}(d),v([]),x(c.sessionId),aw(c.sessionId),b?.imageFilenames?.length&&aA(c.sessionId,0,b.imageFilenames)}}switch(c.type){case"text_delta":{let a=r.current.filter(a=>a.id!==e);f?r.current=a.map(a=>a.id===f?{...a,content:a.content+(c.content??""),isStreaming:!0}:a):(f=ay(),r.current=[...a,{id:f,role:"assistant",content:c.content??"",isStreaming:!0}]),z();break}case"text":{let a=r.current.filter(a=>a.id!==e);f?r.current=a.map(a=>a.id===f?{...a,content:c.content??a.content,isStreaming:!0}:a):(f=ay(),r.current=[...a,{id:f,role:"assistant",content:c.content??"",isStreaming:!0}]),z();break}case"tool_start":{let a=r.current.filter(a=>a.id!==e);f?(r.current=a.map(a=>a.id===f?{...a,isStreaming:!1}:a),f=null):r.current=a,r.current=[...r.current,{id:ay(),role:"tool",content:`Calling ${c.content??"tool"}...`,toolName:c.content,isStreaming:!0}],z();break}case"tool_use":{let a=r.current.filter(a=>a.id!==e),b=f?a.map(a=>a.id===f?{...a,isStreaming:!1}:a):a;f=null,r.current=[...b,{id:ay(),role:"tool",content:JSON.stringify(c.toolInput??{},null,2),toolName:c.content}],z();break}case"tool_result":r.current=[...r.current,{id:ay(),role:"tool",content:String(c.toolOutput??""),toolName:`${c.content??"tool"} (result)`}],z();break;case"error":r.current=[...r.current.filter(a=>a.id!==e),{id:ay(),role:"assistant",content:`Error: ${c.content??"Unknown error"}`}],z(),o("error");break;case"done":f&&(r.current=r.current.map(a=>a.id===f?{...a,isStreaming:!1}:a)),r.current=r.current.filter(a=>a.id!==e),z(),o("idle")}}}}r.current=r.current.filter(a=>a.id!==e),z(),o(a=>"streaming"===a?"idle":a),B()}catch(a){if("AbortError"===a.name)return;r.current=[...r.current.filter(a=>a.id!==e),{id:ay(),role:"assistant",content:`Connection error: ${a.message??"Unknown error"}`}],z(),o("error")}},[z,B]),K=(0,c.useCallback)(()=>{t.current?.abort(),t.current=null;let a=[...r.current].reverse().find(a=>"user"===a.role),b=a?.content??null;if(a){let b=r.current.lastIndexOf(a);r.current=r.current.slice(0,b),m([...r.current])}return o("idle"),b},[]),L=l[l.length-1],M="connecting"===n||"streaming"===n||L?.role==="thinking"&&!0===L.isStreaming;return(0,b.jsx)(ax.Provider,{value:{isOpen:d,isStarting:f,displayMode:h,worktreePath:j,toggleAssistant:I,closeAssistant:H,chatMessages:l,chatStatus:n,isChatThinking:M,isLoadingHistory:p,sendChatMessage:J,cancelChat:K,sessions:u,activeSessionId:w,createNewSession:D,switchSession:E,removeSession:F,refreshSessions:B},children:a})}function aC(){let a=(0,c.useContext)(ax);if(!a)throw Error("useAssistant must be used within an AssistantProvider");return a}var aD=a.i(109434),aE=a.i(858967),aF=a.i(467034),aG=a.i(938899),aH=a.i(845924),aI=a.i(246962);function aJ(a){return a.replace(/\.git\/?$/,"")}a.i(446786),a.i(814747);let aK=(0,w.createServerReference)("40789c5e8c7ca0f0a2af6d7b34a423ee37334a05b4",w.callServer,void 0,w.findSourceMapURL,"resolveGitLocalPath");var aL=a.i(264530);function aM({open:a,onOpenChange:d,onCreateProject:e}){let{t:f,locale:g}=(0,D.useI18n)(),[h,i]=(0,c.useState)(""),[j,k]=(0,c.useState)(""),[l,m]=(0,c.useState)(""),[n,o]=(0,c.useState)(""),[p,q]=(0,c.useState)(""),[r,w]=(0,c.useState)(!1),[x,y]=(0,c.useState)("FRONTEND"),[z,A]=(0,c.useState)("idle"),[B,C]=(0,c.useState)(""),[F,G]=(0,c.useState)(!1),H=()=>{i(""),k(""),m(""),o(""),q(""),w(!1),y("FRONTEND"),A("idle"),C(""),G(!1)},I=async()=>{if(p.trim()&&!F&&"success"===z){G(!0);try{let a=await (0,aL.analyzeProjectDirectory)(p.trim(),g);m(a)}catch{E.toast.error(f("project.analyzeError"))}finally{G(!1)}}},J=async a=>{o(a),A("idle"),C("");let b=function(a){let b,c=a.match(/^git@([^:]+):(.+)$/);if(c)return{host:c[1],pathSegments:aJ(c[2]).split("/").filter(Boolean)};try{b=new URL(a)}catch{return null}return{host:b.hostname,pathSegments:aJ(decodeURIComponent(b.pathname)).split("/").filter(Boolean)}}(a);b&&b.pathSegments.length>0&&i(b.pathSegments[b.pathSegments.length-1]),r||q(await aK(a))},K=async()=>{if(n.trim()&&p.trim()){A("cloning"),C("");try{let a=function(a){let b=a.trim();if(!b)return"";if(b.startsWith("git@")||b.startsWith("ssh://")||b.endsWith(".git"))return b;try{let a=new URL(b),c=a.hostname,d=decodeURIComponent(a.pathname).split("/").filter(Boolean);if("code.iflytek.com"===c){let a=[...d];"osc"===a[0]&&"_source"===a[1]&&(a=a.slice(2));let e=a.indexOf("-");if(e>0&&(a=a.slice(0,e)),0===a.length)return b;return`https://${c}/${a.join("/")}.git`}return`${a.origin}${a.pathname.replace(/\/$/,"")}.git`}catch{return b}}(n.trim()),b=await fetch("/api/git",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"clone",url:a,path:p.trim()})}),c=await b.json();if(!b.ok){A("error"),C(c.error||"Clone failed");return}A("success")}catch{A("error"),C("Network error")}}},L=async()=>{h.trim()&&(await e?.({name:h.trim(),alias:j.trim()||void 0,description:l.trim()||void 0,gitUrl:n.trim()||void 0,localPath:p.trim()||void 0,projectType:x}),H(),d(!1))};return(0,b.jsx)(b.Fragment,{children:(0,b.jsx)(s.Dialog,{open:a,onOpenChange:a=>{d(a),a||H()},disablePointerDismissal:!0,children:(0,b.jsxs)(s.DialogContent,{style:{maxWidth:"32rem"},children:[(0,b.jsx)(s.DialogHeader,{children:(0,b.jsx)(s.DialogTitle,{children:f("topbar.newProject")})}),(0,b.jsxs)("div",{className:"space-y-4 py-2",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:f("project.gitUrl")}),(0,b.jsx)("p",{className:"text-[10px] text-muted-foreground mt-0.5",children:f("project.gitUrlHint")}),(0,b.jsx)(v.Input,{placeholder:f("project.gitPlaceholder"),value:n,onChange:a=>J(a.target.value),className:"mt-1.5 font-mono text-xs"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:f("project.localPath")}),(0,b.jsx)("p",{className:"text-[10px] text-muted-foreground mt-0.5",children:f("project.localPathHint")}),(0,b.jsx)(v.Input,{placeholder:f("project.localPathPlaceholder"),value:p,onChange:a=>{q(a.target.value),w(!0)},className:"mt-1.5 font-mono text-xs w-full"}),p.trim().startsWith("~")&&(0,b.jsxs)("p",{className:"mt-1 flex items-center gap-1 text-[11px] text-amber-400",children:[(0,b.jsx)(aF.AlertCircle,{className:"h-3 w-3"}),f("project.tildeWarning")]}),n.trim()&&p.trim()&&(0,b.jsxs)("div",{className:"mt-2 flex items-center gap-2",children:[(0,b.jsxs)(u.Button,{type:"button",disabled:"cloning"===z||"success"===z,onClick:K,className:"gap-1.5 text-xs bg-emerald-500/15 text-emerald-300 ring-1 ring-emerald-500/25 hover:bg-emerald-500/25 disabled:opacity-50",children:["cloning"===z?(0,b.jsx)(aD.Loader2,{className:"h-3 w-3 animate-spin"}):"success"===z?(0,b.jsx)(aE.Check,{className:"h-3 w-3"}):(0,b.jsx)(al.GitBranch,{className:"h-3 w-3"}),"cloning"===z?f("git.cloning"):"success"===z?f("git.cloned"):f("git.clone")]}),"error"===z&&(0,b.jsxs)("span",{className:"flex items-center gap-1 text-[11px] text-rose-400",children:[(0,b.jsx)(aF.AlertCircle,{className:"h-3 w-3"}),B]}),"success"===z&&(0,b.jsx)("span",{className:"text-[11px] text-emerald-400",children:f("git.cloneSuccess")})]})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:f("project.name")}),(0,b.jsx)(v.Input,{placeholder:f("project.namePlaceholder"),value:h,onChange:a=>i(a.target.value),className:"mt-1.5"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:f("project.type.label")}),(0,b.jsx)("div",{className:"mt-1.5",children:(0,b.jsx)(aH.SegmentedControl,{options:[{value:"FRONTEND",label:f("project.type.frontend")},{value:"BACKEND",label:f("project.type.backend")}],value:x,onChange:y})})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:f("project.alias")}),(0,b.jsx)(v.Input,{placeholder:f("project.aliasPlaceholder"),value:j,onChange:a=>k(a.target.value),className:"mt-1.5"})]}),(0,b.jsxs)("div",{children:[(0,b.jsxs)("div",{className:"flex items-center justify-between mt-0.5",children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:f("project.description")}),(0,b.jsxs)(t.Tooltip,{children:[(0,b.jsxs)(t.TooltipTrigger,{render:(0,b.jsx)(u.Button,{type:"button",variant:"ghost",onClick:I,className:`h-6 gap-1 px-2 text-[11px] text-muted-foreground hover:text-foreground ${!p.trim()||F?"opacity-50":""}`}),children:[F?(0,b.jsx)(aD.Loader2,{className:"h-3 w-3 animate-spin"}):(0,b.jsx)(aG.Sparkles,{className:"h-3 w-3"}),F?f("project.analyzing"):f("project.genDesc")]}),(0,b.jsx)(t.TooltipContent,{children:p.trim()?"success"!==z?f("project.genDescNotCloned"):f("project.genDescReady"):f("project.genDescNoPath")})]})]}),(0,b.jsx)(aI.Textarea,{placeholder:f("project.descPlaceholder"),value:l,onChange:a=>m(a.target.value),rows:3,className:"mt-1.5 w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder-muted-foreground outline-none transition-colors focus:border-ring focus:ring-1 focus:ring-ring resize-none max-h-[200px] overflow-y-auto"})]})]}),(0,b.jsxs)(s.DialogFooter,{children:[(0,b.jsx)(u.Button,{variant:"outline",onClick:()=>{d(!1),H()},children:f("common.cancel")}),(0,b.jsx)(u.Button,{onClick:L,disabled:!h.trim()||F,className:"bg-primary/10 text-primary ring-1 ring-primary/25 hover:bg-primary/20",children:f("common.create")})]})]})})})}var aN=a.i(690834),aN=aN,aO=a.i(563504),aP=a.i(775788);let aQ=(0,w.createServerReference)("603147b7c50c397f9344014a578b01144b2f53989d",w.callServer,void 0,w.findSourceMapURL,"migrateProjectPath"),aR=(0,w.createServerReference)("40877c024ad087151d0a998dfd9933573de30c3c5e",w.callServer,void 0,w.findSourceMapURL,"checkMigrationSafety");function aS({open:a,onOpenChange:d,onCreateProject:e}){let{t:f,locale:g}=(0,D.useI18n)(),[h,i]=(0,c.useState)(""),[j,k]=(0,c.useState)(""),[l,m]=(0,c.useState)(""),[n,p]=(0,c.useState)(""),[q,r]=(0,c.useState)(""),[w,x]=(0,c.useState)(!1),[y,z]=(0,c.useState)("FRONTEND"),[A,B]=(0,c.useState)(!1),[C,F]=(0,c.useState)(!1),[G,H]=(0,c.useState)(""),[I,J]=(0,c.useState)(!1),[K,L]=(0,c.useState)(""),[M,N]=(0,c.useState)(""),[O,P]=(0,c.useState)(!1),[Q,R]=(0,c.useState)(!1),S=()=>{i(""),k(""),m(""),p(""),r(""),z("FRONTEND"),B(!1),F(!1),H(""),J(!1),L(""),N(""),P(!1),R(!1)},T=async a=>{r(a),B(!1),F(!1),H(""),L(""),N(""),P(!1),i(a.split("/").filter(Boolean).pop()??"");try{let b=await fetch(`/api/git?path=${encodeURIComponent(a)}`);if(b.ok){let a=await b.json();if(a.isGit&&a.remoteUrl){p(a.remoteUrl),B(!0);let b=a.remoteUrl.match(/\/([^/]+?)(?:\.git)?$/);b&&i(b[1])}}}catch{}},U=(0,c.useCallback)(async a=>{if(F(a),L(""),N(""),P(!1),!a)return void H("");if(n)try{let a=await aK(n);a&&(H(a),a===q&&P(!0))}catch{}if(q)try{let a=await fetch(`/api/git?path=${encodeURIComponent(q)}&checkWorktrees=true`);a.ok&&(await a.json()).hasWorktrees&&N(f("project.worktreeWarning"))}catch{}},[n,q]),V=async()=>{if(q&&!Q){R(!0);try{let a=await (0,aL.analyzeProjectDirectory)(q.trim(),g);m(a)}catch{E.toast.error(f("project.analyzeError"))}finally{R(!1)}}},W=async()=>{if(!h.trim())return;let a={name:h.trim(),alias:j.trim()||void 0,description:l.trim()||void 0,gitUrl:n.trim()||void 0,localPath:q.trim()||void 0,projectType:y},b=await e?.(a);if(C&&G&&G!==q&&b&&"id"in b){J(!0),L("");let a=await aR(b.id);if(!a.safe){L(a.reason),J(!1);return}let c=await aQ(b.id,G);if(J(!1),!c.success)return void L(c.error??f("project.migrateError"));E.toast.success(f("project.migrateSuccess"))}S(),d(!1)},X=!h.trim()||!q.trim()||I||Q||C&&!!M;return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(s.Dialog,{open:a,onOpenChange:a=>{d(a),a||S()},disablePointerDismissal:!0,children:(0,b.jsxs)(s.DialogContent,{style:{maxWidth:"32rem"},children:[(0,b.jsx)(s.DialogHeader,{children:(0,b.jsx)(s.DialogTitle,{children:f("topbar.importProject")})}),(0,b.jsxs)("div",{className:"space-y-4 py-2",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:f("project.localPath")}),(0,b.jsx)("p",{className:"text-[10px] text-muted-foreground mt-0.5",children:f("project.importHint")}),(0,b.jsxs)("div",{className:"mt-1.5 flex gap-2",children:[(0,b.jsx)(v.Input,{value:q,readOnly:!0,placeholder:f("project.localPathPlaceholder"),className:"flex-1 font-mono text-xs bg-muted/30"}),(0,b.jsxs)(u.Button,{type:"button",variant:"outline",onClick:()=>x(!0),className:"shrink-0 gap-1.5",children:[(0,b.jsx)(o.FolderOpen,{className:"h-3.5 w-3.5"}),f("folder.browse")]})]}),A&&(0,b.jsx)("p",{className:"mt-1.5 text-[11px] text-emerald-400",children:f("project.autoDetected")})]}),n&&(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:f("project.gitUrl")}),(0,b.jsx)(v.Input,{value:n,onChange:a=>p(a.target.value),className:"mt-1.5 font-mono text-xs"})]}),A&&q&&(0,b.jsxs)("div",{className:"rounded-md border border-border p-3 space-y-2",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("span",{className:"text-xs font-medium",children:f("project.migrate")}),(0,b.jsx)("p",{className:"text-[10px] text-muted-foreground mt-0.5",children:f("project.migrateHint")})]}),(0,b.jsx)(aP.Switch,{checked:C,onCheckedChange:a=>U(a)})]}),C&&(0,b.jsxs)("div",{className:"space-y-2 pt-1",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-[10px] font-medium text-muted-foreground",children:f("project.targetPath")}),(0,b.jsx)(v.Input,{value:G,onChange:a=>{H(a.target.value),P(a.target.value===q)},placeholder:"/path/to/canonical/location",className:"mt-1 font-mono text-xs"})]}),O&&(0,b.jsxs)("p",{className:"flex items-center gap-1 text-[11px] text-sky-400",children:[(0,b.jsx)(aN.default,{className:"h-3 w-3"}),f("project.samePathInfo")]}),M&&(0,b.jsxs)("p",{className:"flex items-center gap-1 text-[11px] text-amber-400",children:[(0,b.jsx)(aF.AlertCircle,{className:"h-3 w-3"}),M]}),K&&(0,b.jsxs)("p",{className:"flex items-center gap-1 text-[11px] text-rose-400",children:[(0,b.jsx)(aF.AlertCircle,{className:"h-3 w-3"}),K]})]})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:f("project.name")}),(0,b.jsx)(v.Input,{placeholder:f("project.namePlaceholder"),value:h,onChange:a=>i(a.target.value),className:"mt-1.5"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:f("project.type.label")}),(0,b.jsx)("div",{className:"mt-1.5",children:(0,b.jsx)(aH.SegmentedControl,{options:[{value:"FRONTEND",label:f("project.type.frontend")},{value:"BACKEND",label:f("project.type.backend")}],value:y,onChange:z})})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:f("project.alias")}),(0,b.jsx)(v.Input,{placeholder:f("project.aliasPlaceholder"),value:j,onChange:a=>k(a.target.value),className:"mt-1.5"})]}),(0,b.jsxs)("div",{children:[(0,b.jsxs)("div",{className:"flex items-center justify-between mt-0.5",children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:f("project.description")}),(0,b.jsxs)(t.Tooltip,{children:[(0,b.jsxs)(t.TooltipTrigger,{render:(0,b.jsx)(u.Button,{type:"button",variant:"ghost",onClick:V,className:`h-6 gap-1 px-2 text-[11px] text-muted-foreground hover:text-foreground ${!q||Q?"opacity-50":""}`}),children:[Q?(0,b.jsx)(aD.Loader2,{className:"h-3 w-3 animate-spin"}):(0,b.jsx)(aG.Sparkles,{className:"h-3 w-3"}),Q?f("project.analyzing"):f("project.genDesc")]}),(0,b.jsx)(t.TooltipContent,{children:q?f("project.genDescReady"):f("project.genDescNoPath")})]})]}),(0,b.jsx)(aI.Textarea,{placeholder:f("project.descPlaceholder"),value:l,onChange:a=>m(a.target.value),rows:3,className:"mt-1.5 w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder-muted-foreground outline-none transition-colors focus:border-ring focus:ring-1 focus:ring-ring resize-none max-h-[200px] overflow-y-auto"})]})]}),(0,b.jsxs)(s.DialogFooter,{children:[(0,b.jsx)(u.Button,{variant:"outline",onClick:()=>{d(!1),S()},children:f("common.cancel")}),(0,b.jsx)(u.Button,{onClick:W,disabled:X,className:"bg-primary/10 text-primary ring-1 ring-primary/25 hover:bg-primary/20",children:I?f("project.migrating"):f("common.create")})]})]})}),(0,b.jsx)(aO.FolderBrowserDialog,{open:w,onOpenChange:x,onSelect:a=>T(a)})]})}function aT({onCreateProject:a,username:e}){let{t:f,locale:h,setLocale:i}=(0,D.useI18n)(),{isOpen:j,toggleAssistant:k}=aC(),{resolvedTheme:l,toggleTheme:m,triggerRef:n}=function(){let{resolvedTheme:a,setTheme:b}=(0,K.useTheme)(),d=(0,c.useRef)(null),e=(0,c.useCallback)(c=>{let d="dark"===a?"light":"dark";if("u">typeof document&&"startViewTransition"in document&&!window.matchMedia("(prefers-reduced-motion: reduce)").matches){let a=c?.clientX??window.innerWidth/2,e=c?.clientY??0,f=Math.hypot(Math.max(a,window.innerWidth-a),Math.max(e,window.innerHeight-e));document.startViewTransition(()=>{b(d)}).ready.then(()=>{document.documentElement.animate({clipPath:[`circle(0px at ${a}px ${e}px)`,`circle(${f}px at ${a}px ${e}px)`]},{duration:400,easing:"ease-in-out",pseudoElement:"::view-transition-new(root)"})})}else b(d)},[a,b]);return{resolvedTheme:a,toggleTheme:e,triggerRef:d}}(),p=(0,d.useRouter)(),[r,s]=(0,c.useState)(!1),[v,w]=(0,c.useState)(!1),[x,y]=(0,c.useState)(!1);return(0,c.useEffect)(()=>{let a=a=>{(a.metaKey||a.ctrlKey)&&"k"===a.key&&(a.preventDefault(),s(!0))};return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[]),(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("header",{className:"flex h-12 items-center justify-between border-b border-border bg-background/80 px-5 backdrop-blur-sm",children:[(0,b.jsx)("div",{className:"w-40"}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsxs)(u.Button,{variant:"outline",onClick:()=>s(!0),className:"h-8 w-[400px] justify-start gap-2 bg-muted/50 text-muted-foreground hover:bg-muted",children:[(0,b.jsx)(L.Search,{className:"h-3.5 w-3.5"}),(0,b.jsx)("span",{className:"flex-1 text-left",suppressHydrationWarning:!0,children:f("topbar.searchPlaceholder")}),(0,b.jsxs)("kbd",{className:"mr-1 flex items-center gap-0.5 rounded border border-border bg-background px-1.5 py-0.5 text-[10px] font-mono",children:[(0,b.jsx)(N,{className:"h-2.5 w-2.5"}),"K"]})]}),(0,b.jsxs)(t.Tooltip,{children:[(0,b.jsx)(t.TooltipTrigger,{delay:500,render:(0,b.jsx)("button",{"data-tour":"open-assistant",onClick:k,"aria-label":f("assistant.iconLabel"),className:["cursor-pointer rounded-lg p-2 text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",j?"bg-accent text-foreground":""].join(" ")}),children:(0,b.jsx)(P,{className:"h-4 w-4"})}),(0,b.jsx)(t.TooltipContent,{children:f("assistant.iconLabel")})]})]}),(0,b.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,b.jsxs)(t.Tooltip,{children:[(0,b.jsxs)(t.TooltipTrigger,{render:(0,b.jsx)(u.Button,{variant:"ghost",onClick:()=>i("zh"===h?"en":"zh"),className:"text-muted-foreground"}),children:[(0,b.jsx)(O.Globe,{className:"h-3.5 w-3.5"}),(0,b.jsx)("span",{className:"text-[11px] font-semibold",children:"zh"===h?"EN":"中"})]}),(0,b.jsx)(t.TooltipContent,{children:f("settings.language")})]}),(0,b.jsxs)(t.Tooltip,{children:[(0,b.jsx)(t.TooltipTrigger,{render:(0,b.jsx)(u.Button,{ref:n,variant:"ghost",size:"icon",onClick:m,className:"text-muted-foreground"}),children:"dark"===l?(0,b.jsx)(Q.Sun,{className:"h-4 w-4"}):(0,b.jsx)(R.Moon,{className:"h-4 w-4"})}),(0,b.jsx)(t.TooltipContent,{children:f("settings.theme")})]}),(0,b.jsx)("div",{className:"h-4 w-px bg-border"}),(0,b.jsxs)(u.Button,{variant:"outline",className:"gap-1.5 ring-1 ring-border hover:bg-accent",onClick:()=>y(!0),children:[(0,b.jsx)(o.FolderOpen,{className:"h-3.5 w-3.5"}),f("topbar.importProject")]}),(0,b.jsxs)(u.Button,{"data-tour":"create-project",className:"gap-1.5 bg-primary/10 text-primary ring-1 ring-primary/25 hover:bg-primary/20",onClick:()=>w(!0),children:[(0,b.jsx)(g.Plus,{className:"h-3.5 w-3.5"}),f("topbar.newProject")]}),(0,b.jsxs)(q.DropdownMenu,{children:[(0,b.jsx)(q.DropdownMenuTrigger,{render:(0,b.jsxs)("button",{className:"ml-0.5 flex cursor-pointer items-center gap-1.5 rounded-lg px-2.5 py-1 transition-colors hover:bg-accent",children:[e&&(0,b.jsx)("span",{className:"max-w-[80px] truncate text-xs text-muted-foreground",children:e}),(0,b.jsx)(ai,{className:"h-7 w-7 ring-1 ring-border",children:(0,b.jsx)(aj,{className:"bg-emerald-500/20 text-emerald-400 text-[10px] font-semibold",children:e?e.trim().split(/\s+/).filter(a=>a.length>0).slice(0,2).map(a=>a[0].toUpperCase()).join(""):"U"})})]})}),(0,b.jsx)(q.DropdownMenuContent,{align:"end",sideOffset:8,className:"w-40",children:(0,b.jsxs)(q.DropdownMenuItem,{onClick:()=>p.push("/settings"),children:[(0,b.jsx)(M.Settings,{className:"mr-2 h-3.5 w-3.5"}),f("settings.title")]})})]})]})]}),(0,b.jsx)(av,{open:r,onOpenChange:s}),(0,b.jsx)(aM,{open:v,onOpenChange:w,onCreateProject:a}),(0,b.jsx)(aS,{open:x,onOpenChange:y,onCreateProject:a})]})}var aU=a.i(184083),aV=c,aW=a.i(145685);class aX extends aV.Component{constructor(a){super(a),this.state={hasError:!1,error:null}}static getDerivedStateFromError(a){return{hasError:!0,error:a}}componentDidCatch(a,b){console.error("[ErrorBoundary]",a,b)}render(){return this.state.hasError?this.props.fallback?this.props.fallback:(0,b.jsxs)("div",{className:"flex flex-col items-center justify-center gap-3 p-8 text-center",children:[(0,b.jsx)(aF.AlertCircle,{className:"h-8 w-8 text-destructive"}),(0,b.jsxs)("div",{children:[(0,b.jsx)("p",{className:"text-sm font-medium text-foreground",children:"Something went wrong"}),(0,b.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:this.state.error?.message??"An unexpected error occurred"})]}),(0,b.jsxs)(u.Button,{variant:"outline",onClick:()=>this.setState({hasError:!1,error:null}),children:[(0,b.jsx)(aW.RefreshCw,{className:"mr-2 h-3.5 w-3.5"}),"Retry"]})]}):this.props.children}}var aY=a.i(367848),aZ=a.i(357089),a$=a.i(354994);let a_=(0,aZ.default)(async()=>{},{loadableGenerated:{modules:[834880]},ssr:!1});function a0({mode:a}){let{isOpen:c,closeAssistant:d,sessions:e,activeSessionId:f,createNewSession:h,switchSession:j,removeSession:k}=aC(),{t:l}=(0,D.useI18n)(),m=e.find(a=>a.id===f),n=m?.title??l("assistant.newSession");return(0,b.jsxs)("div",{className:"sidebar"===a?"min-w-[320px] max-w-[480px] w-[30vw] shrink-0 border-r border-border flex flex-col bg-sidebar overflow-hidden":"flex flex-col h-full overflow-hidden",children:[(0,b.jsxs)("div",{className:"header-sm flex items-center px-4 gap-2 bg-sidebar",children:[(0,b.jsx)(P,{className:"h-4 w-4 text-muted-foreground shrink-0"}),(0,b.jsx)("span",{className:"text-sm font-semibold text-foreground shrink-0",children:l("assistant.title")}),(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("div",{className:"flex-1"}),(0,b.jsxs)(q.DropdownMenu,{children:[(0,b.jsxs)(q.DropdownMenuTrigger,{className:"flex items-center gap-1 h-8 px-2 rounded-md text-xs text-muted-foreground transition-colors hover:bg-accent hover:text-foreground max-w-[120px] truncate","aria-label":l("assistant.sessionList"),children:[(0,b.jsx)("span",{className:"truncate",children:n}),(0,b.jsx)(a$.ChevronDown,{className:"h-3 w-3 shrink-0"})]}),(0,b.jsxs)(q.DropdownMenuContent,{side:"bottom",align:"end",sideOffset:4,children:[0===e.length?(0,b.jsx)("div",{className:"px-2 py-4 text-xs text-muted-foreground text-center",children:l("assistant.noSessions")}):e.map(a=>(0,b.jsxs)(q.DropdownMenuItem,{className:"flex items-center justify-between gap-2 pr-1",onClick:()=>j(a.id),children:[(0,b.jsxs)("div",{className:"flex flex-col gap-0.5 min-w-0",children:[(0,b.jsx)("span",{className:"text-xs truncate max-w-[140px]",children:a.title}),(0,b.jsx)("span",{className:"text-[10px] text-muted-foreground",children:function(a){let b=Math.floor((Date.now()-new Date(a).getTime())/1e3);if(b<60)return`${b}s ago`;let c=Math.floor(b/60);if(c<60)return`${c}m ago`;let d=Math.floor(c/60);if(d<24)return`${d}h ago`;let e=Math.floor(d/24);return`${e}d ago`}(a.updatedAt)})]}),(0,b.jsx)(u.Button,{variant:"ghost",className:"h-6 w-6 p-0 shrink-0 opacity-50 hover:opacity-100 hover:text-destructive",onClick:b=>{b.stopPropagation(),k(a.id)},"aria-label":l("assistant.deleteSession"),children:(0,b.jsx)(i.Trash2,{className:"h-3 w-3"})})]},a.id)),e.length>0&&(0,b.jsx)(q.DropdownMenuSeparator,{}),(0,b.jsxs)(q.DropdownMenuItem,{onClick:h,children:[(0,b.jsx)(g.Plus,{className:"h-3 w-3 mr-1"}),(0,b.jsx)("span",{className:"text-xs",children:l("assistant.newSession")})]})]})]}),(0,b.jsx)(u.Button,{variant:"ghost",size:"icon",className:"text-muted-foreground",onClick:h,"aria-label":l("assistant.newSession"),children:(0,b.jsx)(g.Plus,{className:"h-4 w-4"})})]}),(0,b.jsx)(u.Button,{variant:"ghost",size:"icon",className:"text-muted-foreground",onClick:d,"aria-label":l("assistant.closeLabel"),children:(0,b.jsx)(ao.X,{className:"h-4 w-4"})})]}),(0,b.jsx)("div",{className:"flex-1 overflow-hidden",children:c?(0,b.jsx)(a_,{}):null})]})}var a1=a.i(684262);function a2({onDismiss:a}){let{t:d}=(0,D.useI18n)(),[e,f]=(0,c.useState)(!1);(0,c.useEffect)(()=>{},[]);let g=async()=>{"default"!==await window.Notification.requestPermission()&&(f(!1),a?.())};return e?(0,b.jsxs)("div",{className:"fixed top-3 left-1/2 -translate-x-1/2 z-[9999] w-auto max-w-lg bg-card border rounded-lg shadow-lg px-4 py-2.5 flex items-center gap-3 animate-in fade-in slide-in-from-top-4 duration-500",children:[(0,b.jsx)(a1.Bell,{className:"h-4 w-4 shrink-0 text-primary"}),(0,b.jsx)("span",{className:"flex-1 text-sm",children:d("notification.permissionPrompt")}),(0,b.jsx)(u.Button,{size:"default",onClick:g,children:d("notification.allow")}),(0,b.jsx)(u.Button,{variant:"ghost",size:"default",onClick:()=>{f(!1),a?.()},children:d("notification.dismiss")})]}):null}w.callServer,w.findSourceMapURL;var a3=a.i(89402);let a4=[{target:"create-workspace",titleKey:"tour.step1.title",descKey:"tour.step1.desc",placement:"right"},{target:"create-project",titleKey:"tour.step2.title",descKey:"tour.step2.desc",placement:"bottom",waitForTarget:!0},{target:"open-assistant",titleKey:"tour.step3.title",descKey:"tour.step3.desc",placement:"bottom"}];function a5({onComplete:a}){let{t:d}=(0,D.useI18n)(),[e,f]=(0,c.useState)(0),[g,h]=(0,c.useState)(null),[i,j]=(0,c.useState)(!1),k=(0,c.useRef)(null),l=a4[e],m=(0,c.useCallback)(async()=>{await (0,a3.setConfigValue)("onboarding.tourCompleted",!0),a()},[a]),n=(0,c.useCallback)(()=>l?document.querySelector(`[data-tour="${l.target}"]`):null,[l]),o=(0,c.useCallback)(()=>{let a=n();a?(h(a.getBoundingClientRect()),j(!0)):j(!1)},[n]);(0,c.useEffect)(()=>{o();let a=null;!i&&l?.waitForTarget&&(k.current=new MutationObserver(()=>{let b=n();b&&(h(b.getBoundingClientRect()),j(!0),k.current?.disconnect(),a&&clearTimeout(a))}),k.current.observe(document.body,{childList:!0,subtree:!0}),a=setTimeout(()=>{!n()&&(f(a=>{let b=a+1;return b<a4.length?b:a}),e>=a4.length-1&&m())},5e3));let b=()=>o();return window.addEventListener("resize",b),window.addEventListener("scroll",b,!0),()=>{k.current?.disconnect(),a&&clearTimeout(a),window.removeEventListener("resize",b),window.removeEventListener("scroll",b,!0)}},[e,l,n,o,i,m]),(0,c.useEffect)(()=>{let a=setInterval(o,1e3);return()=>clearInterval(a)},[o]);let p=(0,c.useCallback)(()=>{e<a4.length-1?(f(a=>a+1),j(!1)):m()},[e]);return l?(0,b.jsx)(b.Fragment,{children:i&&g&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("div",{className:"fixed inset-0 z-[10000]",style:{background:`radial-gradient(
|
|
1
|
+
module.exports=[690834,a=>{"use strict";let b=(0,a.i(302856).default)("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);a.s(["default",0,b])},582043,a=>{"use strict";var b=a.i(858360),c=a.i(175391),d=a.i(448287),e=a.i(759985),f=a.i(14180),g=a.i(263973),h=a.i(94202),i=a.i(569210),j=a.i(317076),k=a.i(302856);let l=(0,k.default)("chevrons-left",[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]]),m=(0,k.default)("tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);var n=a.i(161604),o=a.i(986379);let p=(0,k.default)("gauge",[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]]);var q=a.i(445705),r=a.i(358440),s=a.i(857122),t=a.i(95446),u=a.i(410756),v=a.i(620235),w=a.i(879876);let x=(0,w.createServerReference)("40db634945d84ee345d44243a7ae05109df2146a3a",w.callServer,void 0,w.findSourceMapURL,"createWorkspace"),y=(0,w.createServerReference)("606fc384c9d7dd2f98f3aa57ea997501243438636c",w.callServer,void 0,w.findSourceMapURL,"updateWorkspace"),z=(0,w.createServerReference)("40737643e39968bd4e34f23ae8e3fdc13aa033d672",w.callServer,void 0,w.findSourceMapURL,"deleteWorkspace"),A=(0,w.createServerReference)("409345b2fb023fbcc61f2122ff613d20a9b733861a",w.callServer,void 0,w.findSourceMapURL,"getLabelsForWorkspace"),B=(0,w.createServerReference)("408638851fdcf9a7331e33f4f62bff24557f12c7ac",w.callServer,void 0,w.findSourceMapURL,"createLabel"),C=(0,w.createServerReference)("400c223032559f38f5c42935c96d5a66c1c87c4947",w.callServer,void 0,w.findSourceMapURL,"deleteLabel");var D=a.i(584335),E=a.i(942308);let F=["📋","🚀","🎯","💡","🔧","📦","🎨","📊","🔬","🌟","📝","🏗️"];function G({workspaces:a}){let k,s=(0,d.useRouter)(),v=(0,d.usePathname)(),{t:w}=(0,D.useI18n)(),[A,B]=(0,c.useState)(!1);(0,c.useEffect)(()=>{"true"===localStorage.getItem("sidebar-collapsed")&&B(!0)},[]);let[C,I]=(0,c.useState)(!1),[K,L]=(0,c.useState)(!1),[M,N]=(0,c.useState)(!1),[O,P]=(0,c.useState)(null),[Q,R]=(0,c.useState)(""),[S,T]=(0,c.useState)(F[0]),[U,V]=(0,c.useState)(null),W=v.split("/workspaces/")[1]?.split("/")[0],X=(0,c.useCallback)(()=>{B(a=>{let b=!a;return localStorage.setItem("sidebar-collapsed",String(b)),b})},[]),Y=(0,c.useCallback)(async()=>{if(!Q.trim())return;let a=await x({name:Q.trim(),description:S});R(""),T(F[0]),I(!1),s.refresh(),s.push(`/workspaces/${a.id}`)},[Q,S,s]),Z=(0,c.useCallback)(async()=>{Q.trim()&&U&&(await y(U,{name:Q.trim(),description:S}),R(""),L(!1),V(null),s.refresh())},[Q,S,U,s]),$=(0,c.useCallback)(a=>{V(a.id),R(a.name),T(a.description&&F.includes(a.description)?a.description:F[0]),L(!0)},[]),_=(0,c.useCallback)(async(b,c)=>{if(a.length<=1)return void E.toast.error(w("sidebar.lastWorkspaceError"));if(confirm(w("sidebar.deleteConfirm",{name:c})))try{await z(b),s.refresh(),W===b&&s.push("/workspaces")}catch{E.toast.error(w("sidebar.lastWorkspaceError"))}},[W,s,w,a.length]),aa=(0,c.useCallback)(a=>{P(a),N(!0)},[]),ab=a=>a.description&&F.includes(a.description)?a.description:a.name.charAt(0).toUpperCase();if(A){let c;return(0,b.jsxs)("aside",{className:"flex h-screen w-14 flex-col items-center border-r border-border bg-sidebar py-3",children:[(0,b.jsxs)(t.Tooltip,{children:[(0,b.jsx)(t.TooltipTrigger,{render:(0,b.jsx)("button",{onClick:X,className:"mb-4 flex h-9 w-9 items-center justify-center rounded-lg bg-primary/10 ring-1 ring-primary/20 transition-transform hover:scale-105"}),children:(0,b.jsx)("img",{src:"/logo.png",alt:"Tower",className:"h-6 w-6 rounded"})}),(0,b.jsx)(t.TooltipContent,{side:"right",sideOffset:8,children:w("sidebar.expand")})]}),(0,b.jsx)(r.ScrollArea,{className:"flex-1 min-h-0",children:(0,b.jsxs)("div",{className:"flex flex-col items-center gap-1 px-0.5 pt-1",children:[a.map(a=>{let c=W===a.id,d=ab(a);return(0,b.jsxs)(t.Tooltip,{children:[(0,b.jsx)(t.TooltipTrigger,{render:(0,b.jsx)("button",{onClick:()=>{c||s.push(`/workspaces/${a.id}`)},className:`flex h-9 w-9 items-center justify-center rounded-lg transition-all ${c?"ring-1 ring-primary/20 text-foreground cursor-default":"text-muted-foreground hover:text-foreground cursor-pointer"}`}),children:(0,b.jsx)("span",{className:"flex h-7 w-7 items-center justify-center rounded-md bg-muted text-sm",children:F.includes(d)?d:(0,b.jsx)("span",{className:"text-xs font-semibold",children:d})})}),(0,b.jsx)(t.TooltipContent,{side:"right",sideOffset:8,children:a.name})]},a.id)}),(0,b.jsxs)(t.Tooltip,{children:[(0,b.jsx)(t.TooltipTrigger,{render:(0,b.jsx)("button",{"data-tour":"create-workspace",onClick:()=>I(!0),className:"flex h-9 w-9 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:bg-accent hover:text-foreground"}),children:(0,b.jsx)(g.Plus,{className:"h-4 w-4"})}),(0,b.jsx)(t.TooltipContent,{side:"right",sideOffset:8,children:w("sidebar.newWorkspace")})]})]})}),(0,b.jsxs)("div",{className:"mt-2 flex flex-col items-center gap-1",children:[(c=W||a[0]?.id)?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(t.Tooltip,{children:[(0,b.jsx)(t.TooltipTrigger,{render:(0,b.jsx)("button",{onClick:()=>s.push(`/workspaces/${c}/notes`),className:`rounded-lg p-2 transition-colors ${v.includes("/notes")?"text-foreground bg-accent":"text-muted-foreground hover:bg-accent hover:text-foreground"}`}),children:(0,b.jsx)(n.FileText,{className:"h-4 w-4"})}),(0,b.jsx)(t.TooltipContent,{side:"right",sideOffset:8,children:w("sidebar.notes")})]}),(0,b.jsxs)(t.Tooltip,{children:[(0,b.jsx)(t.TooltipTrigger,{render:(0,b.jsx)("button",{onClick:()=>s.push(`/workspaces/${c}/assets`),className:`rounded-lg p-2 transition-colors ${v.includes("/assets")?"text-foreground bg-accent":"text-muted-foreground hover:bg-accent hover:text-foreground"}`}),children:(0,b.jsx)(o.FolderOpen,{className:"h-4 w-4"})}),(0,b.jsx)(t.TooltipContent,{side:"right",sideOffset:8,children:w("sidebar.assets")})]}),(0,b.jsxs)(t.Tooltip,{children:[(0,b.jsx)(t.TooltipTrigger,{render:(0,b.jsx)("button",{onClick:()=>s.push(`/workspaces/${c}/archive`),className:`rounded-lg p-2 transition-colors ${v.includes("/archive")?"text-foreground bg-accent":"text-muted-foreground hover:bg-accent hover:text-foreground"}`}),children:(0,b.jsx)(f.Archive,{className:"h-4 w-4"})}),(0,b.jsx)(t.TooltipContent,{side:"right",sideOffset:8,children:w("sidebar.archive")})]})]}):null,(0,b.jsxs)(t.Tooltip,{children:[(0,b.jsx)(t.TooltipTrigger,{render:(0,b.jsx)("button",{onClick:()=>s.push("/missions"),className:`rounded-lg p-2 transition-colors ${"/missions"===v?"text-foreground bg-accent":"text-muted-foreground hover:bg-accent hover:text-foreground"}`}),children:(0,b.jsx)(p,{className:"h-4 w-4"})}),(0,b.jsx)(t.TooltipContent,{side:"right",sideOffset:8,children:w("missions.navLabel")})]})]}),(0,b.jsx)(H,{open:C,onOpenChange:I,title:w("workspace.create"),name:Q,onNameChange:R,icon:S,onIconChange:T,onSubmit:Y,submitLabel:w("common.create"),nameLabel:w("workspace.name"),iconLabel:w("workspace.icon"),namePlaceholder:w("workspace.namePlaceholder"),cancelLabel:w("common.cancel")})]})}return(0,b.jsxs)("aside",{className:"noise relative flex h-screen w-56 flex-col border-r border-border bg-sidebar",children:[(0,b.jsxs)("div",{className:"relative z-10 flex items-center gap-3 px-4 py-4",children:[(0,b.jsx)("img",{src:"/logo.png",alt:"Tower",className:"h-9 w-9 rounded-lg"}),(0,b.jsxs)("div",{className:"flex-1",children:[(0,b.jsx)("div",{className:"text-sm font-semibold tracking-tight text-foreground",children:"Tower"}),(0,b.jsx)("div",{className:"text-[10px] font-medium uppercase tracking-widest text-muted-foreground",children:"Studio"})]}),(0,b.jsx)(u.Button,{variant:"ghost",size:"icon-xs",onClick:X,className:"text-muted-foreground",title:w("sidebar.collapse"),children:(0,b.jsx)(l,{className:"h-4 w-4"})})]}),(0,b.jsxs)("div",{className:"relative z-10 flex items-center justify-between px-4 py-2",children:[(0,b.jsx)("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:w("sidebar.workspace")}),(0,b.jsx)(u.Button,{variant:"ghost",size:"icon-sm",className:"text-muted-foreground","data-tour":"create-workspace",onClick:()=>{R(""),T(F[0]),I(!0)},title:w("sidebar.newWorkspace"),children:(0,b.jsx)(g.Plus,{className:"h-3.5 w-3.5"})})]}),(0,b.jsx)(r.ScrollArea,{className:"relative z-10 mt-2 flex-1 min-h-0",children:(0,b.jsx)("div",{className:"px-2 py-1",children:a.map(c=>{var d;let e,f,g,k=W===c.id,l=ab(c);return(0,b.jsxs)("div",{className:`group relative flex items-center rounded-lg transition-all ${k?"bg-accent ring-1 ring-primary/15":"hover:bg-accent/60"}`,children:[(0,b.jsxs)("button",{onClick:()=>{k||s.push(`/workspaces/${c.id}`)},className:`flex flex-1 items-center gap-2.5 px-3 py-2.5 text-left ${k?"cursor-default":"cursor-pointer"}`,children:[(0,b.jsx)("span",{className:"flex h-7 w-7 items-center justify-center rounded-md bg-muted text-sm",children:F.includes(l)?l:(0,b.jsx)("span",{className:"text-xs font-semibold text-muted-foreground",children:l})}),(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsx)("div",{className:`truncate text-sm font-medium ${k?"text-foreground":"text-secondary-foreground"}`,children:c.name}),(0,b.jsx)("div",{className:"text-[11px] text-muted-foreground",children:(d=c.updatedAt,f=Math.floor((e=Date.now()-new Date(d).getTime())/6e4),g=Math.floor(e/36e5),f<60?`${f}m ago`:g<24?`${g}h ago`:`${Math.floor(g/24)}d ago`)})]})]}),(0,b.jsxs)(q.DropdownMenu,{children:[(0,b.jsx)(q.DropdownMenuTrigger,{render:(0,b.jsx)("button",{className:"mr-2 rounded-md p-1 text-muted-foreground opacity-0 transition-all hover:bg-background hover:text-foreground group-hover:opacity-100",onClick:a=>a.stopPropagation()}),children:(0,b.jsx)(j.MoreHorizontal,{className:"h-3.5 w-3.5"})}),(0,b.jsxs)(q.DropdownMenuContent,{align:"start",side:"right",children:[(0,b.jsxs)(q.DropdownMenuItem,{onClick:()=>$(c),children:[(0,b.jsx)(h.Pencil,{className:"mr-2 h-3.5 w-3.5"}),w("sidebar.rename")]}),(0,b.jsxs)(q.DropdownMenuItem,{onClick:()=>aa(c.id),children:[(0,b.jsx)(m,{className:"mr-2 h-3.5 w-3.5"}),w("sidebar.manageLabels")]}),(0,b.jsxs)(q.DropdownMenuItem,{className:a.length<=1?"text-muted-foreground opacity-50":"text-rose-400",disabled:a.length<=1,onClick:()=>_(c.id,c.name),children:[(0,b.jsx)(i.Trash2,{className:"mr-2 h-3.5 w-3.5"}),w("sidebar.delete")]})]})]})]},c.id)})})}),(0,b.jsxs)(e.default,{href:"/missions",className:`relative z-10 flex items-center gap-2 border-t border-border px-4 py-3 text-[11px] cursor-pointer transition-colors ${"/missions"===v?"text-foreground":"text-muted-foreground hover:text-foreground"}`,children:[(0,b.jsx)(p,{className:"h-3.5 w-3.5"}),(0,b.jsx)("span",{children:w("missions.navLabel")})]}),(k=W||a[0]?.id)?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(e.default,{href:`/workspaces/${k}/notes`,className:"relative z-10 flex items-center gap-2 border-t border-border px-4 py-3 text-[11px] text-muted-foreground cursor-pointer hover:text-foreground transition-colors",children:[(0,b.jsx)(n.FileText,{className:"h-3.5 w-3.5"}),(0,b.jsx)("span",{children:w("sidebar.notes")})]}),(0,b.jsxs)(e.default,{href:`/workspaces/${k}/assets`,className:"relative z-10 flex items-center gap-2 px-4 py-3 text-[11px] text-muted-foreground cursor-pointer hover:text-foreground transition-colors",children:[(0,b.jsx)(o.FolderOpen,{className:"h-3.5 w-3.5"}),(0,b.jsx)("span",{children:w("sidebar.assets")})]}),(0,b.jsxs)(e.default,{href:`/workspaces/${k}/archive`,className:"relative z-10 flex items-center gap-2 px-4 py-3 text-[11px] text-muted-foreground cursor-pointer hover:text-foreground transition-colors",children:[(0,b.jsx)(f.Archive,{className:"h-3.5 w-3.5"}),(0,b.jsx)("span",{children:w("sidebar.archive")})]})]}):null,(0,b.jsx)(H,{open:C,onOpenChange:I,title:w("workspace.create"),name:Q,onNameChange:R,icon:S,onIconChange:T,onSubmit:Y,submitLabel:w("common.create"),nameLabel:w("workspace.name"),iconLabel:w("workspace.icon"),namePlaceholder:w("workspace.namePlaceholder"),cancelLabel:w("common.cancel")}),(0,b.jsx)(H,{open:K,onOpenChange:a=>{L(a),a||V(null)},title:w("workspace.edit"),name:Q,onNameChange:R,icon:S,onIconChange:T,onSubmit:Z,submitLabel:w("common.save"),nameLabel:w("workspace.name"),iconLabel:w("workspace.icon"),namePlaceholder:w("workspace.namePlaceholder"),cancelLabel:w("common.cancel")}),O&&(0,b.jsx)(J,{open:M,onOpenChange:a=>{N(a),a||P(null)},workspaceId:O})]})}function H({open:a,onOpenChange:c,title:d,name:e,onNameChange:f,icon:g,onIconChange:h,onSubmit:i,submitLabel:j,nameLabel:k,iconLabel:l,namePlaceholder:m,cancelLabel:n}){return(0,b.jsx)(s.Dialog,{open:a,onOpenChange:c,disablePointerDismissal:!0,children:(0,b.jsxs)(s.DialogContent,{className:"sm:max-w-sm",children:[(0,b.jsx)(s.DialogHeader,{children:(0,b.jsx)(s.DialogTitle,{children:d})}),(0,b.jsxs)("div",{className:"space-y-4 py-2",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:k}),(0,b.jsx)(v.Input,{placeholder:m,value:e,onChange:a=>f(a.target.value),onKeyDown:a=>"Enter"===a.key&&a.preventDefault(),className:"mt-1.5"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:l}),(0,b.jsx)("div",{className:"mt-1.5 grid grid-cols-6 gap-1.5",children:F.map(a=>(0,b.jsx)("button",{onClick:()=>h(a),className:`flex h-10 w-10 items-center justify-center rounded-lg text-lg transition-all ${g===a?"bg-primary/15 ring-2 ring-primary/30 scale-110":"bg-muted hover:bg-accent"}`,children:a},a))})]})]}),(0,b.jsxs)(s.DialogFooter,{children:[(0,b.jsx)(u.Button,{variant:"outline",onClick:()=>c(!1),children:n}),(0,b.jsx)(u.Button,{onClick:i,disabled:!e.trim(),className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:j})]})]})})}let I=["#3b82f6","#ef4444","#f59e0b","#10b981","#8b5cf6","#ec4899","#06b6d4","#f97316"];function J({open:a,onOpenChange:d,workspaceId:e}){let{t:f}=(0,D.useI18n)(),[g,h]=(0,c.useState)([]),[i,j]=(0,c.useState)(""),[k,l]=(0,c.useState)(I[0]);(0,c.useEffect)(()=>{a&&A(e).then(h)},[a,e]);let m=async()=>{i.trim()&&(await B({name:i.trim(),color:k,workspaceId:e}),h(await A(e)),j(""))},n=async a=>{await C(a),h(b=>b.filter(b=>b.id!==a))};return(0,b.jsx)(s.Dialog,{open:a,onOpenChange:d,disablePointerDismissal:!0,children:(0,b.jsxs)(s.DialogContent,{className:"sm:max-w-sm",children:[(0,b.jsx)(s.DialogHeader,{children:(0,b.jsx)(s.DialogTitle,{children:f("label.manage")})}),(0,b.jsxs)("div",{className:"space-y-3 py-2",children:[g.map(a=>(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("span",{className:"h-3 w-3 rounded-full",style:{backgroundColor:a.color}}),(0,b.jsx)("span",{className:"flex-1 text-sm text-foreground",children:a.name}),a.isBuiltin?(0,b.jsx)("span",{className:"text-[10px] text-muted-foreground",children:f("label.builtin")}):(0,b.jsx)("button",{onClick:()=>n(a.id),className:"text-xs text-rose-400 hover:text-rose-300",children:f("common.delete")})]},a.id)),(0,b.jsxs)("div",{className:"border-t border-border pt-3",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(v.Input,{placeholder:f("label.name"),value:i,onChange:a=>j(a.target.value),onKeyDown:a=>"Enter"===a.key&&a.preventDefault(),className:"flex-1 h-8"}),(0,b.jsx)(u.Button,{size:"sm",onClick:m,disabled:!i.trim(),className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:f("label.add")})]}),(0,b.jsx)("div",{className:"mt-2 flex gap-1.5",children:I.map(a=>(0,b.jsx)("button",{onClick:()=>l(a),className:`h-5 w-5 rounded-full transition-all ${k===a?"ring-2 ring-offset-2 ring-offset-background ring-foreground/30 scale-110":""}`,style:{backgroundColor:a}},a))})]})]})]})})}var K=a.i(432120),L=a.i(410215),M=a.i(666775);let N=(0,k.default)("command",[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]]);var O=a.i(212765);let P=(0,k.default)("bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);var Q=a.i(248763),R=a.i(470612);a.s([],243701),a.i(243701);var S=a.i(256116),T=a.i(545264);let U=c.createContext(void 0);function V(){let a=c.useContext(U);if(void 0===a)throw Error((0,T.default)(13));return a}let W={imageLoadingStatus:()=>null},X=c.forwardRef(function(a,d){let{className:e,render:f,...g}=a,[h,i]=c.useState("idle"),j=c.useMemo(()=>({imageLoadingStatus:h,setImageLoadingStatus:i}),[h,i]),k=(0,S.useRenderElement)("span",a,{state:{imageLoadingStatus:h},ref:d,props:g,stateAttributesMapping:W});return(0,b.jsx)(U.Provider,{value:j,children:k})});var Y=a.i(825863),Z=a.i(527993),$=a.i(759002),_=a.i(163323),aa=a.i(6644),ab=a.i(302398);let ac={...W,..._.transitionStatusMapping},ad=c.forwardRef(function(a,b){let{className:d,render:e,onLoadingStatusChange:f,referrerPolicy:g,crossOrigin:h,...i}=a,j=V(),k=function(a,{referrerPolicy:b,crossOrigin:d}){let[e,f]=c.useState("idle");return(0,Z.useIsoLayoutEffect)(()=>{if(!a)return f("error"),ab.NOOP;let c=!0,e=new window.Image,g=a=>()=>{c&&f(a)};return f("loading"),e.onload=g("loaded"),e.onerror=g("error"),b&&(e.referrerPolicy=b),e.crossOrigin=d??null,e.src=a,()=>{c=!1}},[a,d,b]),e}(a.src,{referrerPolicy:g,crossOrigin:h}),l="loaded"===k,{mounted:m,transitionStatus:n,setMounted:o}=(0,aa.useTransitionStatus)(l),p=c.useRef(null),q=(0,Y.useStableCallback)(a=>{f?.(a),j.setImageLoadingStatus(a)});(0,Z.useIsoLayoutEffect)(()=>{"idle"!==k&&q(k)},[k,q]),(0,$.useOpenChangeComplete)({open:l,ref:p,onComplete(){l||o(!1)}});let r=(0,S.useRenderElement)("img",a,{state:{imageLoadingStatus:k,transitionStatus:n},ref:[b,p],props:i,stateAttributesMapping:ac,enabled:m});return m?r:null});var ae=a.i(313668);let af=c.forwardRef(function(a,b){let{className:d,render:e,delay:f,...g}=a,{imageLoadingStatus:h}=V(),[i,j]=c.useState(void 0===f),k=(0,ae.useTimeout)();return c.useEffect(()=>(void 0!==f&&k.start(f,()=>j(!0)),k.clear),[k,f]),(0,S.useRenderElement)("span",a,{state:{imageLoadingStatus:h},ref:b,props:g,stateAttributesMapping:W,enabled:"loaded"!==h&&i})});a.s(["Fallback",0,af,"Image",0,ad,"Root",0,X],60418);var ag=a.i(60418),ag=ag,ah=a.i(44585);function ai({className:a,size:c="default",...d}){return(0,b.jsx)(ag.Root,{"data-slot":"avatar","data-size":c,className:(0,ah.cn)("group/avatar relative flex size-8 shrink-0 rounded-full select-none after:absolute after:inset-0 after:rounded-full after:border after:border-border after:mix-blend-darken data-[size=lg]:size-10 data-[size=sm]:size-6 dark:after:mix-blend-lighten",a),...d})}function aj({className:a,...c}){return(0,b.jsx)(ag.Fallback,{"data-slot":"avatar-fallback",className:(0,ah.cn)("flex size-full items-center justify-center rounded-full bg-muted text-sm text-muted-foreground group-data-[size=sm]/avatar:text-xs",a),...c})}let ak=(0,k.default)("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"}]]);var al=a.i(61966);let am=(0,k.default)("sticky-note",[["path",{d:"M21 9a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 15 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2z",key:"1dfntj"}],["path",{d:"M15 3v5a1 1 0 0 0 1 1h5",key:"6s6qgf"}]]),an=(0,k.default)("package-2",[["path",{d:"M12 3v6",key:"1holv5"}],["path",{d:"M16.76 3a2 2 0 0 1 1.8 1.1l2.23 4.479a2 2 0 0 1 .21.891V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V9.472a2 2 0 0 1 .211-.894L5.45 4.1A2 2 0 0 1 7.24 3z",key:"187q7i"}],["path",{d:"M3.054 9.013h17.893",key:"grwhos"}]]);var ao=a.i(54709);let ap=(0,w.createServerReference)("607ec05a8094476de568816e33789967dfdc47b877",w.callServer,void 0,w.findSourceMapURL,"globalSearch");var aq=a.i(785047);let ar=[{id:"all",key:"search.all",icon:L.Search},{id:"task",key:"search.task",icon:n.FileText},{id:"project",key:"search.project",icon:ak},{id:"repository",key:"search.repository",icon:al.GitBranch},{id:"note",key:"search.note",icon:am},{id:"asset",key:"search.asset",icon:an}],as=["task","project","repository","note","asset"],at={task:"search.task",project:"search.project",repository:"search.repository",note:"search.note",asset:"search.asset"};function au({result:a,onSelect:c}){let d=ar.find(b=>b.id===a.type)?.icon??n.FileText;return(0,b.jsxs)("button",{onClick:()=>c(a),className:"flex w-full items-center gap-3 border-b border-border/30 px-4 py-3 text-left transition-colors hover:bg-accent last:border-b-0",children:[(0,b.jsx)("div",{className:"rounded-md bg-muted p-1.5",children:(0,b.jsx)(d,{className:"h-3.5 w-3.5 text-muted-foreground"})}),(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsx)("div",{className:"text-sm font-medium text-foreground truncate",children:a.title}),(0,b.jsx)("div",{className:"text-xs text-muted-foreground truncate",children:a.subtitle}),a.snippet&&(0,b.jsx)("div",{className:"text-xs text-muted-foreground/70 truncate mt-0.5",children:a.snippet})]})]})}function av({open:a,onOpenChange:e}){let f,{t:g}=(0,D.useI18n)(),h=(0,d.useRouter)(),[i,j]=(0,c.useState)(""),[k,l]=(0,c.useState)("all"),[m,n]=(0,c.useState)([]),[o,p]=(0,c.useState)(!1),[q,t]=(0,c.useState)(250),v=(0,c.useRef)(null),w=(0,c.useRef)(null);(0,c.useEffect)(()=>{a&&((0,aq.getConfigValue)("search.debounceMs",250).then(t),setTimeout(()=>v.current?.focus(),100),j(""),n([]))},[a]),(0,c.useEffect)(()=>{if(w.current&&clearTimeout(w.current),!i.trim()){n([]),p(!1);return}p(!0);let a=!1;return w.current=setTimeout(async()=>{let b=await ap(i,k);a||(n(b),p(!1))},q),()=>{w.current&&clearTimeout(w.current),a=!0}},[i,k,q]);let x=(0,c.useCallback)(a=>{h.push(a.navigateTo),e(!1)},[h,e]);return(0,b.jsx)(s.Dialog,{open:a,onOpenChange:e,children:(0,b.jsxs)(s.DialogContent,{className:"sm:max-w-lg p-0 gap-0 overflow-hidden !top-[10vh] !-translate-y-0",showCloseButton:!1,children:[(0,b.jsxs)("div",{className:"flex items-center border-b border-border px-4",children:[(0,b.jsx)(L.Search,{className:"h-4 w-4 text-muted-foreground"}),(0,b.jsx)("input",{ref:v,value:i,onChange:a=>j(a.target.value),placeholder:g("search.placeholder"),className:"flex-1 bg-transparent px-3 py-3.5 text-sm text-foreground placeholder-muted-foreground outline-none"}),i&&(0,b.jsx)(u.Button,{variant:"ghost",size:"icon",onClick:()=>{j(""),n([])},className:"text-muted-foreground",children:(0,b.jsx)(ao.X,{className:"h-3.5 w-3.5"})})]}),(0,b.jsx)("div",{className:"flex items-center gap-1 border-b border-border px-4 py-2",children:ar.map(a=>{let c=a.icon;return(0,b.jsxs)("button",{onClick:()=>l(a.id),className:`flex items-center gap-1.5 rounded-md px-2.5 py-1 text-xs font-medium transition-all ${k===a.id?"bg-primary/10 text-primary ring-1 ring-primary/20":"text-muted-foreground hover:bg-accent hover:text-foreground"}`,children:[(0,b.jsx)(c,{className:"h-3 w-3"}),g(a.key)]},a.id)})}),(0,b.jsxs)(r.ScrollArea,{className:"max-h-80",children:[!i.trim()&&(0,b.jsx)("div",{className:"flex items-center justify-center py-12 text-sm text-muted-foreground",children:g("search.typeToSearch")}),i.trim()&&0===m.length&&!o&&(0,b.jsx)("div",{className:"flex items-center justify-center py-12 text-sm text-muted-foreground",children:g("search.noResults")}),"all"===k&&m.length>0&&(f=m.reduce((a,b)=>((a[b.type]??=[]).push(b),a),{}),as.filter(a=>f[a]?.length).map(a=>(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{className:"px-4 py-1.5 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground bg-muted/50",children:g(at[a])}),f[a].map(a=>(0,b.jsx)(au,{result:a,onSelect:x},`${a.type}-${a.id}`))]},a))),"all"!==k&&m.map(a=>(0,b.jsx)(au,{result:a,onSelect:x},`${a.type}-${a.id}`))]})]})})}function aw(a){}let ax=(0,c.createContext)(null);function ay(){return"u">typeof crypto&&crypto.randomUUID?crypto.randomUUID():`msg-${Date.now()}-${Math.random().toString(36).slice(2,9)}`}let az="assistant-image-cache";function aA(a,b,c){try{let d=sessionStorage.getItem(az),e=d?JSON.parse(d):{};e[a]||(e[a]={}),e[a][b]=c,sessionStorage.setItem(az,JSON.stringify(e))}catch{}}function aB({children:a}){let[d,e]=(0,c.useState)(!1),[f,g]=(0,c.useState)(!1),[h,i]=(0,c.useState)("sidebar"),[j,k]=(0,c.useState)(null),[l,m]=(0,c.useState)([]),[n,o]=(0,c.useState)("idle"),[p,q]=(0,c.useState)(!1),r=(0,c.useRef)([]),s=(0,c.useRef)(null),t=(0,c.useRef)(null),[u,v]=(0,c.useState)([]),[w,x]=(0,c.useState)(null),y=(0,c.useRef)(!1),z=(0,c.useCallback)(()=>{m([...r.current])},[]),A=(0,c.useCallback)(async()=>{i("dialog"===await (0,aq.getConfigValue)("assistant.displayMode","sidebar")?"dialog":"sidebar")},[]);(0,c.useEffect)(()=>{A()},[A]);let B=(0,c.useCallback)(async()=>{v([])},[]),C=(0,c.useCallback)(async a=>{q(!0);try{let b=await fetch(`/api/internal/assistant/sessions?sessionId=${encodeURIComponent(a)}`);if(!b.ok)return;let c=await b.json();if(Array.isArray(c.messages)){r.current=c.messages;let b=function(a){try{let b=sessionStorage.getItem(az);if(!b)return{};return JSON.parse(b)[a]??{}}catch{return{}}}(a);if(Object.keys(b).length>0){let a=0;r.current=r.current.map(c=>{if("user"===c.role){let d=b[a];if(a++,d?.length)return{...c,imageFilenames:d}}return c})}m([...r.current])}}catch{}finally{q(!1)}},[]);(0,c.useEffect)(()=>{B()},[B,C]);let D=(0,c.useCallback)(()=>{t.current?.abort(),s.current=null,y.current=!1,x(null),aw(null),r.current=[],m([]),o("idle")},[]),E=(0,c.useCallback)(a=>{t.current?.abort(),s.current=a,y.current=!0,x(a),aw(a),r.current=[],m([]),o("idle"),C(a)},[C]),F=(0,c.useCallback)(a=>{v([]),w===a&&D()},[w,D]),G=(0,c.useCallback)(async()=>{g(!0);try{await A(),e(!0)}finally{g(!1)}},[A]),H=(0,c.useCallback)(()=>{e(!1),t.current?.abort()},[]),I=(0,c.useCallback)(()=>{d||f?H():G()},[d,f,H,G]);(0,c.useEffect)(()=>{let a=a=>{(a.metaKey||a.ctrlKey)&&"l"===a.key&&(a.preventDefault(),I())};return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[I]);let J=(0,c.useCallback)(async(a,b)=>{if(!a.trim()&&!b?.imageFilenames?.length)return;t.current?.abort();let c=new AbortController;t.current=c;let d=0!==r.current.length||y.current?null:a,e=ay();if(r.current=[...r.current,{id:ay(),role:"user",content:a,imageFilenames:b?.imageFilenames?.length?b.imageFilenames:void 0},{id:e,role:"thinking",content:"",isStreaming:!0}],z(),b?.imageFilenames?.length&&s.current){let a=r.current.filter(a=>"user"===a.role).length-1;aA(s.current,a,b.imageFilenames)}o("connecting");let f=null;try{let g=await fetch("/api/internal/assistant/chat",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:a,sessionId:s.current,imageFilenames:b?.imageFilenames??[]}),signal:c.signal});if(!g.ok||!g.body)throw Error(`HTTP ${g.status}`);o("streaming");let h=g.body.getReader(),i=new TextDecoder,j="";for(;;){let{done:a,value:c}=await h.read();if(a)break;let g=(j+=i.decode(c,{stream:!0})).split("\n");for(let a of(j=g.pop()??"",g)){let c;if(a.startsWith("data: ")){try{c=JSON.parse(a.slice(6).trim())}catch{continue}if(c.sessionId){let a=s.current;if(s.current=c.sessionId,d&&!y.current&&c.sessionId!==a){y.current=!0;new Date().toISOString();c.sessionId,function(a){let b=a.trim();b&&b.length>30&&b.slice(0,30)}(d),v([]),x(c.sessionId),aw(c.sessionId),b?.imageFilenames?.length&&aA(c.sessionId,0,b.imageFilenames)}}switch(c.type){case"text_delta":{let a=r.current.filter(a=>a.id!==e);f?r.current=a.map(a=>a.id===f?{...a,content:a.content+(c.content??""),isStreaming:!0}:a):(f=ay(),r.current=[...a,{id:f,role:"assistant",content:c.content??"",isStreaming:!0}]),z();break}case"text":{let a=r.current.filter(a=>a.id!==e);f?r.current=a.map(a=>a.id===f?{...a,content:c.content??a.content,isStreaming:!0}:a):(f=ay(),r.current=[...a,{id:f,role:"assistant",content:c.content??"",isStreaming:!0}]),z();break}case"tool_start":{let a=r.current.filter(a=>a.id!==e);f?(r.current=a.map(a=>a.id===f?{...a,isStreaming:!1}:a),f=null):r.current=a,r.current=[...r.current,{id:ay(),role:"tool",content:`Calling ${c.content??"tool"}...`,toolName:c.content,isStreaming:!0}],z();break}case"tool_use":{let a=r.current.filter(a=>a.id!==e),b=f?a.map(a=>a.id===f?{...a,isStreaming:!1}:a):a;f=null,r.current=[...b,{id:ay(),role:"tool",content:JSON.stringify(c.toolInput??{},null,2),toolName:c.content}],z();break}case"tool_result":r.current=[...r.current,{id:ay(),role:"tool",content:String(c.toolOutput??""),toolName:`${c.content??"tool"} (result)`}],z();break;case"error":r.current=[...r.current.filter(a=>a.id!==e),{id:ay(),role:"assistant",content:`Error: ${c.content??"Unknown error"}`}],z(),o("error");break;case"done":f&&(r.current=r.current.map(a=>a.id===f?{...a,isStreaming:!1}:a)),r.current=r.current.filter(a=>a.id!==e),z(),o("idle")}}}}r.current=r.current.filter(a=>a.id!==e),z(),o(a=>"streaming"===a?"idle":a),B()}catch(a){if("AbortError"===a.name)return;r.current=[...r.current.filter(a=>a.id!==e),{id:ay(),role:"assistant",content:`Connection error: ${a.message??"Unknown error"}`}],z(),o("error")}},[z,B]),K=(0,c.useCallback)(()=>{t.current?.abort(),t.current=null;let a=[...r.current].reverse().find(a=>"user"===a.role),b=a?.content??null;if(a){let b=r.current.lastIndexOf(a);r.current=r.current.slice(0,b),m([...r.current])}return o("idle"),b},[]),L=l[l.length-1],M="connecting"===n||"streaming"===n||L?.role==="thinking"&&!0===L.isStreaming;return(0,b.jsx)(ax.Provider,{value:{isOpen:d,isStarting:f,displayMode:h,worktreePath:j,toggleAssistant:I,closeAssistant:H,chatMessages:l,chatStatus:n,isChatThinking:M,isLoadingHistory:p,sendChatMessage:J,cancelChat:K,sessions:u,activeSessionId:w,createNewSession:D,switchSession:E,removeSession:F,refreshSessions:B},children:a})}function aC(){let a=(0,c.useContext)(ax);if(!a)throw Error("useAssistant must be used within an AssistantProvider");return a}var aD=a.i(109434),aE=a.i(858967),aF=a.i(467034),aG=a.i(938899),aH=a.i(845924),aI=a.i(246962);function aJ(a){return a.replace(/\.git\/?$/,"")}a.i(446786),a.i(814747);let aK=(0,w.createServerReference)("405c0e332450b000b21836ead1c4321461502cfa64",w.callServer,void 0,w.findSourceMapURL,"resolveGitLocalPath");var aL=a.i(766679);function aM({open:a,onOpenChange:d,onCreateProject:e}){let{t:f,locale:g}=(0,D.useI18n)(),[h,i]=(0,c.useState)(""),[j,k]=(0,c.useState)(""),[l,m]=(0,c.useState)(""),[n,o]=(0,c.useState)(""),[p,q]=(0,c.useState)(""),[r,w]=(0,c.useState)(!1),[x,y]=(0,c.useState)("FRONTEND"),[z,A]=(0,c.useState)("idle"),[B,C]=(0,c.useState)(""),[F,G]=(0,c.useState)(!1),H=()=>{i(""),k(""),m(""),o(""),q(""),w(!1),y("FRONTEND"),A("idle"),C(""),G(!1)},I=async()=>{if(p.trim()&&!F&&"success"===z){G(!0);try{let a=await (0,aL.analyzeProjectDirectory)(p.trim(),g);m(a)}catch{E.toast.error(f("project.analyzeError"))}finally{G(!1)}}},J=async a=>{o(a),A("idle"),C("");let b=function(a){let b,c=a.match(/^git@([^:]+):(.+)$/);if(c)return{host:c[1],pathSegments:aJ(c[2]).split("/").filter(Boolean)};try{b=new URL(a)}catch{return null}return{host:b.hostname,pathSegments:aJ(decodeURIComponent(b.pathname)).split("/").filter(Boolean)}}(a);b&&b.pathSegments.length>0&&i(b.pathSegments[b.pathSegments.length-1]),r||q(await aK(a))},K=async()=>{if(n.trim()&&p.trim()){A("cloning"),C("");try{let a=function(a){let b=a.trim();if(!b)return"";if(b.startsWith("git@")||b.startsWith("ssh://")||b.endsWith(".git"))return b;try{let a=new URL(b),c=a.hostname,d=decodeURIComponent(a.pathname).split("/").filter(Boolean);if("code.iflytek.com"===c){let a=[...d];"osc"===a[0]&&"_source"===a[1]&&(a=a.slice(2));let e=a.indexOf("-");if(e>0&&(a=a.slice(0,e)),0===a.length)return b;return`https://${c}/${a.join("/")}.git`}return`${a.origin}${a.pathname.replace(/\/$/,"")}.git`}catch{return b}}(n.trim()),b=await fetch("/api/git",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"clone",url:a,path:p.trim()})}),c=await b.json();if(!b.ok){A("error"),C(c.error||"Clone failed");return}A("success")}catch{A("error"),C("Network error")}}},L=async()=>{h.trim()&&(await e?.({name:h.trim(),alias:j.trim()||void 0,description:l.trim()||void 0,gitUrl:n.trim()||void 0,localPath:p.trim()||void 0,projectType:x}),H(),d(!1))};return(0,b.jsx)(b.Fragment,{children:(0,b.jsx)(s.Dialog,{open:a,onOpenChange:a=>{d(a),a||H()},disablePointerDismissal:!0,children:(0,b.jsxs)(s.DialogContent,{style:{maxWidth:"32rem"},children:[(0,b.jsx)(s.DialogHeader,{children:(0,b.jsx)(s.DialogTitle,{children:f("topbar.newProject")})}),(0,b.jsxs)("div",{className:"space-y-4 py-2",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:f("project.gitUrl")}),(0,b.jsx)("p",{className:"text-[10px] text-muted-foreground mt-0.5",children:f("project.gitUrlHint")}),(0,b.jsx)(v.Input,{placeholder:f("project.gitPlaceholder"),value:n,onChange:a=>J(a.target.value),className:"mt-1.5 font-mono text-xs"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:f("project.localPath")}),(0,b.jsx)("p",{className:"text-[10px] text-muted-foreground mt-0.5",children:f("project.localPathHint")}),(0,b.jsx)(v.Input,{placeholder:f("project.localPathPlaceholder"),value:p,onChange:a=>{q(a.target.value),w(!0)},className:"mt-1.5 font-mono text-xs w-full"}),p.trim().startsWith("~")&&(0,b.jsxs)("p",{className:"mt-1 flex items-center gap-1 text-[11px] text-amber-400",children:[(0,b.jsx)(aF.AlertCircle,{className:"h-3 w-3"}),f("project.tildeWarning")]}),n.trim()&&p.trim()&&(0,b.jsxs)("div",{className:"mt-2 flex items-center gap-2",children:[(0,b.jsxs)(u.Button,{type:"button",disabled:"cloning"===z||"success"===z,onClick:K,className:"gap-1.5 text-xs bg-emerald-500/15 text-emerald-300 ring-1 ring-emerald-500/25 hover:bg-emerald-500/25 disabled:opacity-50",children:["cloning"===z?(0,b.jsx)(aD.Loader2,{className:"h-3 w-3 animate-spin"}):"success"===z?(0,b.jsx)(aE.Check,{className:"h-3 w-3"}):(0,b.jsx)(al.GitBranch,{className:"h-3 w-3"}),"cloning"===z?f("git.cloning"):"success"===z?f("git.cloned"):f("git.clone")]}),"error"===z&&(0,b.jsxs)("span",{className:"flex items-center gap-1 text-[11px] text-rose-400",children:[(0,b.jsx)(aF.AlertCircle,{className:"h-3 w-3"}),B]}),"success"===z&&(0,b.jsx)("span",{className:"text-[11px] text-emerald-400",children:f("git.cloneSuccess")})]})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:f("project.name")}),(0,b.jsx)(v.Input,{placeholder:f("project.namePlaceholder"),value:h,onChange:a=>i(a.target.value),className:"mt-1.5"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:f("project.type.label")}),(0,b.jsx)("div",{className:"mt-1.5",children:(0,b.jsx)(aH.SegmentedControl,{options:[{value:"FRONTEND",label:f("project.type.frontend")},{value:"BACKEND",label:f("project.type.backend")}],value:x,onChange:y})})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:f("project.alias")}),(0,b.jsx)(v.Input,{placeholder:f("project.aliasPlaceholder"),value:j,onChange:a=>k(a.target.value),className:"mt-1.5"})]}),(0,b.jsxs)("div",{children:[(0,b.jsxs)("div",{className:"flex items-center justify-between mt-0.5",children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:f("project.description")}),(0,b.jsxs)(t.Tooltip,{children:[(0,b.jsxs)(t.TooltipTrigger,{render:(0,b.jsx)(u.Button,{type:"button",variant:"ghost",onClick:I,className:`h-6 gap-1 px-2 text-[11px] text-muted-foreground hover:text-foreground ${!p.trim()||F?"opacity-50":""}`}),children:[F?(0,b.jsx)(aD.Loader2,{className:"h-3 w-3 animate-spin"}):(0,b.jsx)(aG.Sparkles,{className:"h-3 w-3"}),F?f("project.analyzing"):f("project.genDesc")]}),(0,b.jsx)(t.TooltipContent,{children:p.trim()?"success"!==z?f("project.genDescNotCloned"):f("project.genDescReady"):f("project.genDescNoPath")})]})]}),(0,b.jsx)(aI.Textarea,{placeholder:f("project.descPlaceholder"),value:l,onChange:a=>m(a.target.value),rows:3,className:"mt-1.5 w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder-muted-foreground outline-none transition-colors focus:border-ring focus:ring-1 focus:ring-ring resize-none max-h-[200px] overflow-y-auto"})]})]}),(0,b.jsxs)(s.DialogFooter,{children:[(0,b.jsx)(u.Button,{variant:"outline",onClick:()=>{d(!1),H()},children:f("common.cancel")}),(0,b.jsx)(u.Button,{onClick:L,disabled:!h.trim()||F,className:"bg-primary/10 text-primary ring-1 ring-primary/25 hover:bg-primary/20",children:f("common.create")})]})]})})})}var aN=a.i(690834),aN=aN,aO=a.i(563504),aP=a.i(775788);let aQ=(0,w.createServerReference)("60e54db140d535f1a59183063189992f1eaf8859dc",w.callServer,void 0,w.findSourceMapURL,"migrateProjectPath"),aR=(0,w.createServerReference)("40aca8ebefd40b487f7261b47a2ba70f37cc99ca7b",w.callServer,void 0,w.findSourceMapURL,"checkMigrationSafety");function aS({open:a,onOpenChange:d,onCreateProject:e}){let{t:f,locale:g}=(0,D.useI18n)(),[h,i]=(0,c.useState)(""),[j,k]=(0,c.useState)(""),[l,m]=(0,c.useState)(""),[n,p]=(0,c.useState)(""),[q,r]=(0,c.useState)(""),[w,x]=(0,c.useState)(!1),[y,z]=(0,c.useState)("FRONTEND"),[A,B]=(0,c.useState)(!1),[C,F]=(0,c.useState)(!1),[G,H]=(0,c.useState)(""),[I,J]=(0,c.useState)(!1),[K,L]=(0,c.useState)(""),[M,N]=(0,c.useState)(""),[O,P]=(0,c.useState)(!1),[Q,R]=(0,c.useState)(!1),S=()=>{i(""),k(""),m(""),p(""),r(""),z("FRONTEND"),B(!1),F(!1),H(""),J(!1),L(""),N(""),P(!1),R(!1)},T=async a=>{r(a),B(!1),F(!1),H(""),L(""),N(""),P(!1),i(a.split("/").filter(Boolean).pop()??"");try{let b=await fetch(`/api/git?path=${encodeURIComponent(a)}`);if(b.ok){let a=await b.json();if(a.isGit&&a.remoteUrl){p(a.remoteUrl),B(!0);let b=a.remoteUrl.match(/\/([^/]+?)(?:\.git)?$/);b&&i(b[1])}}}catch{}},U=(0,c.useCallback)(async a=>{if(F(a),L(""),N(""),P(!1),!a)return void H("");if(n)try{let a=await aK(n);a&&(H(a),a===q&&P(!0))}catch{}if(q)try{let a=await fetch(`/api/git?path=${encodeURIComponent(q)}&checkWorktrees=true`);a.ok&&(await a.json()).hasWorktrees&&N(f("project.worktreeWarning"))}catch{}},[n,q]),V=async()=>{if(q&&!Q){R(!0);try{let a=await (0,aL.analyzeProjectDirectory)(q.trim(),g);m(a)}catch{E.toast.error(f("project.analyzeError"))}finally{R(!1)}}},W=async()=>{if(!h.trim())return;let a={name:h.trim(),alias:j.trim()||void 0,description:l.trim()||void 0,gitUrl:n.trim()||void 0,localPath:q.trim()||void 0,projectType:y},b=await e?.(a);if(C&&G&&G!==q&&b&&"id"in b){J(!0),L("");let a=await aR(b.id);if(!a.safe){L(a.reason),J(!1);return}let c=await aQ(b.id,G);if(J(!1),!c.success)return void L(c.error??f("project.migrateError"));E.toast.success(f("project.migrateSuccess"))}S(),d(!1)},X=!h.trim()||!q.trim()||I||Q||C&&!!M;return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(s.Dialog,{open:a,onOpenChange:a=>{d(a),a||S()},disablePointerDismissal:!0,children:(0,b.jsxs)(s.DialogContent,{style:{maxWidth:"32rem"},children:[(0,b.jsx)(s.DialogHeader,{children:(0,b.jsx)(s.DialogTitle,{children:f("topbar.importProject")})}),(0,b.jsxs)("div",{className:"space-y-4 py-2",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:f("project.localPath")}),(0,b.jsx)("p",{className:"text-[10px] text-muted-foreground mt-0.5",children:f("project.importHint")}),(0,b.jsxs)("div",{className:"mt-1.5 flex gap-2",children:[(0,b.jsx)(v.Input,{value:q,readOnly:!0,placeholder:f("project.localPathPlaceholder"),className:"flex-1 font-mono text-xs bg-muted/30"}),(0,b.jsxs)(u.Button,{type:"button",variant:"outline",onClick:()=>x(!0),className:"shrink-0 gap-1.5",children:[(0,b.jsx)(o.FolderOpen,{className:"h-3.5 w-3.5"}),f("folder.browse")]})]}),A&&(0,b.jsx)("p",{className:"mt-1.5 text-[11px] text-emerald-400",children:f("project.autoDetected")})]}),n&&(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:f("project.gitUrl")}),(0,b.jsx)(v.Input,{value:n,onChange:a=>p(a.target.value),className:"mt-1.5 font-mono text-xs"})]}),A&&q&&(0,b.jsxs)("div",{className:"rounded-md border border-border p-3 space-y-2",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("span",{className:"text-xs font-medium",children:f("project.migrate")}),(0,b.jsx)("p",{className:"text-[10px] text-muted-foreground mt-0.5",children:f("project.migrateHint")})]}),(0,b.jsx)(aP.Switch,{checked:C,onCheckedChange:a=>U(a)})]}),C&&(0,b.jsxs)("div",{className:"space-y-2 pt-1",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-[10px] font-medium text-muted-foreground",children:f("project.targetPath")}),(0,b.jsx)(v.Input,{value:G,onChange:a=>{H(a.target.value),P(a.target.value===q)},placeholder:"/path/to/canonical/location",className:"mt-1 font-mono text-xs"})]}),O&&(0,b.jsxs)("p",{className:"flex items-center gap-1 text-[11px] text-sky-400",children:[(0,b.jsx)(aN.default,{className:"h-3 w-3"}),f("project.samePathInfo")]}),M&&(0,b.jsxs)("p",{className:"flex items-center gap-1 text-[11px] text-amber-400",children:[(0,b.jsx)(aF.AlertCircle,{className:"h-3 w-3"}),M]}),K&&(0,b.jsxs)("p",{className:"flex items-center gap-1 text-[11px] text-rose-400",children:[(0,b.jsx)(aF.AlertCircle,{className:"h-3 w-3"}),K]})]})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:f("project.name")}),(0,b.jsx)(v.Input,{placeholder:f("project.namePlaceholder"),value:h,onChange:a=>i(a.target.value),className:"mt-1.5"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:f("project.type.label")}),(0,b.jsx)("div",{className:"mt-1.5",children:(0,b.jsx)(aH.SegmentedControl,{options:[{value:"FRONTEND",label:f("project.type.frontend")},{value:"BACKEND",label:f("project.type.backend")}],value:y,onChange:z})})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:f("project.alias")}),(0,b.jsx)(v.Input,{placeholder:f("project.aliasPlaceholder"),value:j,onChange:a=>k(a.target.value),className:"mt-1.5"})]}),(0,b.jsxs)("div",{children:[(0,b.jsxs)("div",{className:"flex items-center justify-between mt-0.5",children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:f("project.description")}),(0,b.jsxs)(t.Tooltip,{children:[(0,b.jsxs)(t.TooltipTrigger,{render:(0,b.jsx)(u.Button,{type:"button",variant:"ghost",onClick:V,className:`h-6 gap-1 px-2 text-[11px] text-muted-foreground hover:text-foreground ${!q||Q?"opacity-50":""}`}),children:[Q?(0,b.jsx)(aD.Loader2,{className:"h-3 w-3 animate-spin"}):(0,b.jsx)(aG.Sparkles,{className:"h-3 w-3"}),Q?f("project.analyzing"):f("project.genDesc")]}),(0,b.jsx)(t.TooltipContent,{children:q?f("project.genDescReady"):f("project.genDescNoPath")})]})]}),(0,b.jsx)(aI.Textarea,{placeholder:f("project.descPlaceholder"),value:l,onChange:a=>m(a.target.value),rows:3,className:"mt-1.5 w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder-muted-foreground outline-none transition-colors focus:border-ring focus:ring-1 focus:ring-ring resize-none max-h-[200px] overflow-y-auto"})]})]}),(0,b.jsxs)(s.DialogFooter,{children:[(0,b.jsx)(u.Button,{variant:"outline",onClick:()=>{d(!1),S()},children:f("common.cancel")}),(0,b.jsx)(u.Button,{onClick:W,disabled:X,className:"bg-primary/10 text-primary ring-1 ring-primary/25 hover:bg-primary/20",children:I?f("project.migrating"):f("common.create")})]})]})}),(0,b.jsx)(aO.FolderBrowserDialog,{open:w,onOpenChange:x,onSelect:a=>T(a)})]})}function aT({onCreateProject:a,username:e}){let{t:f,locale:h,setLocale:i}=(0,D.useI18n)(),{isOpen:j,toggleAssistant:k}=aC(),{resolvedTheme:l,toggleTheme:m,triggerRef:n}=function(){let{resolvedTheme:a,setTheme:b}=(0,K.useTheme)(),d=(0,c.useRef)(null),e=(0,c.useCallback)(c=>{let d="dark"===a?"light":"dark";if("u">typeof document&&"startViewTransition"in document&&!window.matchMedia("(prefers-reduced-motion: reduce)").matches){let a=c?.clientX??window.innerWidth/2,e=c?.clientY??0,f=Math.hypot(Math.max(a,window.innerWidth-a),Math.max(e,window.innerHeight-e));document.startViewTransition(()=>{b(d)}).ready.then(()=>{document.documentElement.animate({clipPath:[`circle(0px at ${a}px ${e}px)`,`circle(${f}px at ${a}px ${e}px)`]},{duration:400,easing:"ease-in-out",pseudoElement:"::view-transition-new(root)"})})}else b(d)},[a,b]);return{resolvedTheme:a,toggleTheme:e,triggerRef:d}}(),p=(0,d.useRouter)(),[r,s]=(0,c.useState)(!1),[v,w]=(0,c.useState)(!1),[x,y]=(0,c.useState)(!1);return(0,c.useEffect)(()=>{let a=a=>{(a.metaKey||a.ctrlKey)&&"k"===a.key&&(a.preventDefault(),s(!0))};return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[]),(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("header",{className:"flex h-12 items-center justify-between border-b border-border bg-background/80 px-5 backdrop-blur-sm",children:[(0,b.jsx)("div",{className:"w-40"}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsxs)(u.Button,{variant:"outline",onClick:()=>s(!0),className:"h-8 w-[400px] justify-start gap-2 bg-muted/50 text-muted-foreground hover:bg-muted",children:[(0,b.jsx)(L.Search,{className:"h-3.5 w-3.5"}),(0,b.jsx)("span",{className:"flex-1 text-left",suppressHydrationWarning:!0,children:f("topbar.searchPlaceholder")}),(0,b.jsxs)("kbd",{className:"mr-1 flex items-center gap-0.5 rounded border border-border bg-background px-1.5 py-0.5 text-[10px] font-mono",children:[(0,b.jsx)(N,{className:"h-2.5 w-2.5"}),"K"]})]}),(0,b.jsxs)(t.Tooltip,{children:[(0,b.jsx)(t.TooltipTrigger,{delay:500,render:(0,b.jsx)("button",{"data-tour":"open-assistant",onClick:k,"aria-label":f("assistant.iconLabel"),className:["cursor-pointer rounded-lg p-2 text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",j?"bg-accent text-foreground":""].join(" ")}),children:(0,b.jsx)(P,{className:"h-4 w-4"})}),(0,b.jsx)(t.TooltipContent,{children:f("assistant.iconLabel")})]})]}),(0,b.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,b.jsxs)(t.Tooltip,{children:[(0,b.jsxs)(t.TooltipTrigger,{render:(0,b.jsx)(u.Button,{variant:"ghost",onClick:()=>i("zh"===h?"en":"zh"),className:"text-muted-foreground"}),children:[(0,b.jsx)(O.Globe,{className:"h-3.5 w-3.5"}),(0,b.jsx)("span",{className:"text-[11px] font-semibold",children:"zh"===h?"EN":"中"})]}),(0,b.jsx)(t.TooltipContent,{children:f("settings.language")})]}),(0,b.jsxs)(t.Tooltip,{children:[(0,b.jsx)(t.TooltipTrigger,{render:(0,b.jsx)(u.Button,{ref:n,variant:"ghost",size:"icon",onClick:m,className:"text-muted-foreground"}),children:"dark"===l?(0,b.jsx)(Q.Sun,{className:"h-4 w-4"}):(0,b.jsx)(R.Moon,{className:"h-4 w-4"})}),(0,b.jsx)(t.TooltipContent,{children:f("settings.theme")})]}),(0,b.jsx)("div",{className:"h-4 w-px bg-border"}),(0,b.jsxs)(u.Button,{variant:"outline",className:"gap-1.5 ring-1 ring-border hover:bg-accent",onClick:()=>y(!0),children:[(0,b.jsx)(o.FolderOpen,{className:"h-3.5 w-3.5"}),f("topbar.importProject")]}),(0,b.jsxs)(u.Button,{"data-tour":"create-project",className:"gap-1.5 bg-primary/10 text-primary ring-1 ring-primary/25 hover:bg-primary/20",onClick:()=>w(!0),children:[(0,b.jsx)(g.Plus,{className:"h-3.5 w-3.5"}),f("topbar.newProject")]}),(0,b.jsxs)(q.DropdownMenu,{children:[(0,b.jsx)(q.DropdownMenuTrigger,{render:(0,b.jsxs)("button",{className:"ml-0.5 flex cursor-pointer items-center gap-1.5 rounded-lg px-2.5 py-1 transition-colors hover:bg-accent",children:[e&&(0,b.jsx)("span",{className:"max-w-[80px] truncate text-xs text-muted-foreground",children:e}),(0,b.jsx)(ai,{className:"h-7 w-7 ring-1 ring-border",children:(0,b.jsx)(aj,{className:"bg-emerald-500/20 text-emerald-400 text-[10px] font-semibold",children:e?e.trim().split(/\s+/).filter(a=>a.length>0).slice(0,2).map(a=>a[0].toUpperCase()).join(""):"U"})})]})}),(0,b.jsx)(q.DropdownMenuContent,{align:"end",sideOffset:8,className:"w-40",children:(0,b.jsxs)(q.DropdownMenuItem,{onClick:()=>p.push("/settings"),children:[(0,b.jsx)(M.Settings,{className:"mr-2 h-3.5 w-3.5"}),f("settings.title")]})})]})]})]}),(0,b.jsx)(av,{open:r,onOpenChange:s}),(0,b.jsx)(aM,{open:v,onOpenChange:w,onCreateProject:a}),(0,b.jsx)(aS,{open:x,onOpenChange:y,onCreateProject:a})]})}var aU=a.i(184083),aV=c,aW=a.i(145685);class aX extends aV.Component{constructor(a){super(a),this.state={hasError:!1,error:null}}static getDerivedStateFromError(a){return{hasError:!0,error:a}}componentDidCatch(a,b){console.error("[ErrorBoundary]",a,b)}render(){return this.state.hasError?this.props.fallback?this.props.fallback:(0,b.jsxs)("div",{className:"flex flex-col items-center justify-center gap-3 p-8 text-center",children:[(0,b.jsx)(aF.AlertCircle,{className:"h-8 w-8 text-destructive"}),(0,b.jsxs)("div",{children:[(0,b.jsx)("p",{className:"text-sm font-medium text-foreground",children:"Something went wrong"}),(0,b.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:this.state.error?.message??"An unexpected error occurred"})]}),(0,b.jsxs)(u.Button,{variant:"outline",onClick:()=>this.setState({hasError:!1,error:null}),children:[(0,b.jsx)(aW.RefreshCw,{className:"mr-2 h-3.5 w-3.5"}),"Retry"]})]}):this.props.children}}var aY=a.i(712435),aZ=a.i(357089),a$=a.i(354994);let a_=(0,aZ.default)(async()=>{},{loadableGenerated:{modules:[834880]},ssr:!1});function a0({mode:a}){let{isOpen:c,closeAssistant:d,sessions:e,activeSessionId:f,createNewSession:h,switchSession:j,removeSession:k}=aC(),{t:l}=(0,D.useI18n)(),m=e.find(a=>a.id===f),n=m?.title??l("assistant.newSession");return(0,b.jsxs)("div",{className:"sidebar"===a?"min-w-[320px] max-w-[480px] w-[30vw] shrink-0 border-r border-border flex flex-col bg-sidebar overflow-hidden":"flex flex-col h-full overflow-hidden",children:[(0,b.jsxs)("div",{className:"header-sm flex items-center px-4 gap-2 bg-sidebar",children:[(0,b.jsx)(P,{className:"h-4 w-4 text-muted-foreground shrink-0"}),(0,b.jsx)("span",{className:"text-sm font-semibold text-foreground shrink-0",children:l("assistant.title")}),(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("div",{className:"flex-1"}),(0,b.jsxs)(q.DropdownMenu,{children:[(0,b.jsxs)(q.DropdownMenuTrigger,{className:"flex items-center gap-1 h-8 px-2 rounded-md text-xs text-muted-foreground transition-colors hover:bg-accent hover:text-foreground max-w-[120px] truncate","aria-label":l("assistant.sessionList"),children:[(0,b.jsx)("span",{className:"truncate",children:n}),(0,b.jsx)(a$.ChevronDown,{className:"h-3 w-3 shrink-0"})]}),(0,b.jsxs)(q.DropdownMenuContent,{side:"bottom",align:"end",sideOffset:4,children:[0===e.length?(0,b.jsx)("div",{className:"px-2 py-4 text-xs text-muted-foreground text-center",children:l("assistant.noSessions")}):e.map(a=>(0,b.jsxs)(q.DropdownMenuItem,{className:"flex items-center justify-between gap-2 pr-1",onClick:()=>j(a.id),children:[(0,b.jsxs)("div",{className:"flex flex-col gap-0.5 min-w-0",children:[(0,b.jsx)("span",{className:"text-xs truncate max-w-[140px]",children:a.title}),(0,b.jsx)("span",{className:"text-[10px] text-muted-foreground",children:function(a){let b=Math.floor((Date.now()-new Date(a).getTime())/1e3);if(b<60)return`${b}s ago`;let c=Math.floor(b/60);if(c<60)return`${c}m ago`;let d=Math.floor(c/60);if(d<24)return`${d}h ago`;let e=Math.floor(d/24);return`${e}d ago`}(a.updatedAt)})]}),(0,b.jsx)(u.Button,{variant:"ghost",className:"h-6 w-6 p-0 shrink-0 opacity-50 hover:opacity-100 hover:text-destructive",onClick:b=>{b.stopPropagation(),k(a.id)},"aria-label":l("assistant.deleteSession"),children:(0,b.jsx)(i.Trash2,{className:"h-3 w-3"})})]},a.id)),e.length>0&&(0,b.jsx)(q.DropdownMenuSeparator,{}),(0,b.jsxs)(q.DropdownMenuItem,{onClick:h,children:[(0,b.jsx)(g.Plus,{className:"h-3 w-3 mr-1"}),(0,b.jsx)("span",{className:"text-xs",children:l("assistant.newSession")})]})]})]}),(0,b.jsx)(u.Button,{variant:"ghost",size:"icon",className:"text-muted-foreground",onClick:h,"aria-label":l("assistant.newSession"),children:(0,b.jsx)(g.Plus,{className:"h-4 w-4"})})]}),(0,b.jsx)(u.Button,{variant:"ghost",size:"icon",className:"text-muted-foreground",onClick:d,"aria-label":l("assistant.closeLabel"),children:(0,b.jsx)(ao.X,{className:"h-4 w-4"})})]}),(0,b.jsx)("div",{className:"flex-1 overflow-hidden",children:c?(0,b.jsx)(a_,{}):null})]})}var a1=a.i(684262);function a2({onDismiss:a}){let{t:d}=(0,D.useI18n)(),[e,f]=(0,c.useState)(!1);(0,c.useEffect)(()=>{},[]);let g=async()=>{"default"!==await window.Notification.requestPermission()&&(f(!1),a?.())};return e?(0,b.jsxs)("div",{className:"fixed top-3 left-1/2 -translate-x-1/2 z-[9999] w-auto max-w-lg bg-card border rounded-lg shadow-lg px-4 py-2.5 flex items-center gap-3 animate-in fade-in slide-in-from-top-4 duration-500",children:[(0,b.jsx)(a1.Bell,{className:"h-4 w-4 shrink-0 text-primary"}),(0,b.jsx)("span",{className:"flex-1 text-sm",children:d("notification.permissionPrompt")}),(0,b.jsx)(u.Button,{size:"default",onClick:g,children:d("notification.allow")}),(0,b.jsx)(u.Button,{variant:"ghost",size:"default",onClick:()=>{f(!1),a?.()},children:d("notification.dismiss")})]}):null}w.callServer,w.findSourceMapURL;var a3=a.i(457640);let a4=[{target:"create-workspace",titleKey:"tour.step1.title",descKey:"tour.step1.desc",placement:"right"},{target:"create-project",titleKey:"tour.step2.title",descKey:"tour.step2.desc",placement:"bottom",waitForTarget:!0},{target:"open-assistant",titleKey:"tour.step3.title",descKey:"tour.step3.desc",placement:"bottom"}];function a5({onComplete:a}){let{t:d}=(0,D.useI18n)(),[e,f]=(0,c.useState)(0),[g,h]=(0,c.useState)(null),[i,j]=(0,c.useState)(!1),k=(0,c.useRef)(null),l=a4[e],m=(0,c.useCallback)(async()=>{await (0,a3.setConfigValue)("onboarding.tourCompleted",!0),a()},[a]),n=(0,c.useCallback)(()=>l?document.querySelector(`[data-tour="${l.target}"]`):null,[l]),o=(0,c.useCallback)(()=>{let a=n();a?(h(a.getBoundingClientRect()),j(!0)):j(!1)},[n]);(0,c.useEffect)(()=>{o();let a=null;!i&&l?.waitForTarget&&(k.current=new MutationObserver(()=>{let b=n();b&&(h(b.getBoundingClientRect()),j(!0),k.current?.disconnect(),a&&clearTimeout(a))}),k.current.observe(document.body,{childList:!0,subtree:!0}),a=setTimeout(()=>{!n()&&(f(a=>{let b=a+1;return b<a4.length?b:a}),e>=a4.length-1&&m())},5e3));let b=()=>o();return window.addEventListener("resize",b),window.addEventListener("scroll",b,!0),()=>{k.current?.disconnect(),a&&clearTimeout(a),window.removeEventListener("resize",b),window.removeEventListener("scroll",b,!0)}},[e,l,n,o,i,m]),(0,c.useEffect)(()=>{let a=setInterval(o,1e3);return()=>clearInterval(a)},[o]);let p=(0,c.useCallback)(()=>{e<a4.length-1?(f(a=>a+1),j(!1)):m()},[e]);return l?(0,b.jsx)(b.Fragment,{children:i&&g&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("div",{className:"fixed inset-0 z-[10000]",style:{background:`radial-gradient(
|
|
2
2
|
ellipse at ${g.left+g.width/2}px ${g.top+g.height/2}px,
|
|
3
3
|
transparent ${Math.max(g.width,g.height)}px,
|
|
4
4
|
rgba(0,0,0,0.6) ${Math.max(g.width,g.height)+30}px
|