@shumai-one/shumai 0.4.3 → 0.4.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (168) hide show
  1. package/bin/chunk-071x515q.js +4 -0
  2. package/bin/chunk-0cmx7k4c.js +1 -0
  3. package/bin/{chunk-cqb415s6.js → chunk-0qaq0sp8.js} +2 -2
  4. package/bin/chunk-0qjfahk9.js +2 -0
  5. package/bin/{chunk-9t1ne8xr.js → chunk-0zv3bks2.js} +2 -2
  6. package/bin/chunk-16xax8kk.js +1 -0
  7. package/bin/chunk-1gvscz88.js +5 -0
  8. package/bin/{chunk-6gg1ymer.js → chunk-1j27fzy1.js} +2 -2
  9. package/bin/chunk-1t167cvj.js +11 -0
  10. package/bin/{chunk-pb1zf0vb.js → chunk-1xh34aew.js} +2 -2
  11. package/bin/{chunk-zmv8cg4s.js → chunk-1zwajpwf.js} +3 -3
  12. package/bin/chunk-2w5xqhjm.js +1 -0
  13. package/bin/{chunk-f3ehv01n.js → chunk-3tedzb2j.js} +26 -26
  14. package/bin/{chunk-zehyn6vd.js → chunk-3ttrhqy3.js} +2 -2
  15. package/bin/chunk-3zkasqb8.js +1 -0
  16. package/bin/chunk-453ykvaw.js +2 -0
  17. package/bin/{chunk-3cyrcgm5.js → chunk-4991gz3y.js} +9 -9
  18. package/bin/chunk-4hkkdm2q.js +2 -0
  19. package/bin/chunk-4mjywsj8.js +3 -0
  20. package/bin/{chunk-cnxwmycy.js → chunk-4v41a1r9.js} +3 -3
  21. package/bin/{chunk-87zxtf66.js → chunk-4wy87hwd.js} +2 -2
  22. package/bin/{chunk-sfx2588q.js → chunk-579e4wv4.js} +2 -2
  23. package/bin/{chunk-1yacmegc.js → chunk-5adsx8x4.js} +2 -2
  24. package/bin/{chunk-b235azv4.js → chunk-5hg6kcfz.js} +13 -13
  25. package/bin/{chunk-rbj4fad9.js → chunk-5nm2jvg5.js} +13 -13
  26. package/bin/chunk-5tcdwep5.js +11 -0
  27. package/bin/chunk-5vzrpz50.js +2 -0
  28. package/bin/chunk-6ghcj4a9.js +3 -0
  29. package/bin/{chunk-b9yrw9et.js → chunk-77fmkpdz.js} +4 -4
  30. package/bin/chunk-7bcxj1jd.js +2 -0
  31. package/bin/{chunk-qf24e71w.js → chunk-7gmdnsdg.js} +1 -1
  32. package/bin/{chunk-fxswt9hc.js → chunk-7jtmwt5a.js} +2 -2
  33. package/bin/chunk-7kjgvxqa.js +2 -0
  34. package/bin/{chunk-bay038pj.js → chunk-7pw1550a.js} +2 -2
  35. package/bin/chunk-7rhz2gze.js +211 -0
  36. package/bin/chunk-837fky18.js +3 -0
  37. package/bin/chunk-84as6x83.js +1 -0
  38. package/bin/chunk-8e28hcny.js +2 -0
  39. package/bin/{chunk-k7hss0bd.js → chunk-914bp49r.js} +3 -3
  40. package/bin/chunk-97f2af6d.js +12 -0
  41. package/bin/{chunk-4r81ghg8.js → chunk-98715kc3.js} +2 -2
  42. package/bin/chunk-9ccw540k.js +2 -0
  43. package/bin/{chunk-ag6p3mbf.js → chunk-9t8n2des.js} +2 -2
  44. package/bin/chunk-9ybt6vbm.js +1 -0
  45. package/bin/{chunk-f15qyp41.js → chunk-a6gx7f5q.js} +1 -1
  46. package/bin/chunk-avwgktxb.js +2 -0
  47. package/bin/chunk-bkr5zm4h.js +2 -0
  48. package/bin/{chunk-2yxj593j.js → chunk-cbgq517y.js} +2 -2
  49. package/bin/chunk-d27mm390.js +1 -0
  50. package/bin/{chunk-185qefn1.js → chunk-dj92fss9.js} +2 -2
  51. package/bin/{chunk-v9w25rp2.js → chunk-dqxeztfa.js} +2 -2
  52. package/bin/chunk-drepsbb4.js +2 -0
  53. package/bin/chunk-f6svp4dp.js +2 -0
  54. package/bin/{chunk-q2bvyv39.js → chunk-fahk9h62.js} +2 -2
  55. package/bin/{chunk-v9b3w8q5.js → chunk-fb40xxz3.js} +2 -2
  56. package/bin/chunk-fnmwksnb.js +3 -0
  57. package/bin/chunk-fpc4p0j8.js +3 -0
  58. package/bin/{chunk-aqbrzx9z.js → chunk-fsyzs0tf.js} +1 -1
  59. package/bin/{chunk-e2mvmq2m.js → chunk-fxecgp5k.js} +1 -1
  60. package/bin/{chunk-wfzqnpc1.js → chunk-g3fpmyyn.js} +2 -2
  61. package/bin/{chunk-ehc9adfz.js → chunk-gc5sbfa5.js} +2 -2
  62. package/bin/chunk-gdm6yfqq.js +2 -0
  63. package/bin/{chunk-ea79xnn3.js → chunk-gk2q9a3f.js} +2 -2
  64. package/bin/{chunk-jje8nj8h.js → chunk-gt4csat6.js} +2 -2
  65. package/bin/chunk-gye8gabk.js +2 -0
  66. package/bin/{chunk-wry2hvrq.js → chunk-hk5rc6cd.js} +2 -2
  67. package/bin/{chunk-zqv0zhfb.js → chunk-hm0dkzed.js} +2 -2
  68. package/bin/chunk-hmpwg5za.js +16 -0
  69. package/bin/{chunk-rpywcvg1.js → chunk-j1tkmcae.js} +2 -2
  70. package/bin/chunk-j2bvj2yn.js +2 -0
  71. package/bin/chunk-jffktpqg.js +1 -0
  72. package/bin/chunk-jgs8an3h.js +18 -0
  73. package/bin/{chunk-8fmy5jtp.js → chunk-jmpb5633.js} +1 -1
  74. package/bin/{chunk-xp59apdb.js → chunk-jrjnqx78.js} +1 -1
  75. package/bin/chunk-k2k9vjq6.js +1 -0
  76. package/bin/{chunk-32pcmaqm.js → chunk-kpgfqkp0.js} +2 -2
  77. package/bin/{chunk-twdxayky.js → chunk-ks8xzc95.js} +2 -2
  78. package/bin/{chunk-qwqvt9v6.js → chunk-kswvyqq1.js} +2 -2
  79. package/bin/{chunk-gk3eqd50.js → chunk-m9pr03kn.js} +2 -2
  80. package/bin/chunk-mfn9qjm4.js +2 -0
  81. package/bin/{chunk-e99dv20z.js → chunk-msfw3jmc.js} +2 -2
  82. package/bin/chunk-mz0yjra0.js +5 -0
  83. package/bin/chunk-nbdw8fen.js +1 -0
  84. package/bin/{chunk-cak32x57.js → chunk-nkdk229f.js} +1 -1
  85. package/bin/chunk-nr20tvnw.js +3 -0
  86. package/bin/{chunk-ck8azecb.js → chunk-pazjhrnf.js} +5 -5
  87. package/bin/chunk-q806pqeh.js +1 -0
  88. package/bin/{chunk-abt0azmv.js → chunk-qka4mkmj.js} +2 -2
  89. package/bin/{chunk-0e4wawpq.js → chunk-qsr1a0rp.js} +1 -1
  90. package/bin/chunk-rchsme43.js +3 -0
  91. package/bin/{chunk-tf28796q.js → chunk-reyxk4bw.js} +1 -1
  92. package/bin/{chunk-av1a8fqp.js → chunk-rhvv1vvk.js} +2 -2
  93. package/bin/{chunk-a32vreya.js → chunk-rq0n0vcc.js} +2 -2
  94. package/bin/chunk-rqf7999q.js +42 -0
  95. package/bin/chunk-rssgmj7x.js +2 -0
  96. package/bin/chunk-ryzz5fht.js +2 -0
  97. package/bin/chunk-s2fnfyn9.js +2 -0
  98. package/bin/{chunk-83e12sjg.js → chunk-s2k4qntr.js} +2 -2
  99. package/bin/{chunk-c007p0t8.js → chunk-snhsjs4x.js} +56 -56
  100. package/bin/{chunk-j8fxp8ej.js → chunk-t2hy6tj9.js} +1 -1
  101. package/bin/chunk-t7nsgg5k.js +4 -0
  102. package/bin/chunk-tm7f32c7.js +14 -0
  103. package/bin/{chunk-2291ehh5.js → chunk-trveq4wg.js} +2 -2
  104. package/bin/chunk-vap4k11j.js +20 -0
  105. package/bin/chunk-vm5fx7td.js +3 -0
  106. package/bin/chunk-vy8gntez.js +1 -0
  107. package/bin/{chunk-awfwk64v.js → chunk-vyzptrea.js} +2 -2
  108. package/bin/{chunk-hfh0c082.js → chunk-w4ghe71n.js} +1 -1
  109. package/bin/chunk-wdsf44hs.js +2 -0
  110. package/bin/chunk-wjyaezs7.js +2 -0
  111. package/bin/{chunk-3a13dcs1.js → chunk-wndm3px3.js} +1 -1
  112. package/bin/chunk-x5jwwvs0.js +1 -0
  113. package/bin/chunk-x92cq59c.js +1 -0
  114. package/bin/{chunk-vgn5zcpv.js → chunk-xa18z1py.js} +2 -2
  115. package/bin/{chunk-4v5n0ayb.js → chunk-xarsrs08.js} +1 -1
  116. package/bin/{chunk-66hsjnw6.js → chunk-xx337zcw.js} +2 -2
  117. package/bin/chunk-xz6713tj.js +2 -0
  118. package/bin/chunk-yfnem6se.js +2 -0
  119. package/bin/{chunk-m7m9d4fb.js → chunk-ytdwk2fq.js} +2 -2
  120. package/bin/{chunk-jy006gcv.js → chunk-ze20rm02.js} +4 -4
  121. package/bin/chunk-zw86wnwe.js +7 -0
  122. package/bin/{chunk-h3tbf521.js → chunk-zxk7q0zk.js} +1 -1
  123. package/bin/shumai-app.html +1 -1
  124. package/bin/shumai-app.js +773 -776
  125. package/package.json +7 -7
  126. package/prisma/migrations/20260907021754_add_asset_upload_id/migration.sql +2 -0
  127. package/prisma/schema.prisma +1 -0
  128. package/bin/chunk-1kw2mbqb.js +0 -1
  129. package/bin/chunk-1wm6ptdx.js +0 -1
  130. package/bin/chunk-2520aq8j.js +0 -2
  131. package/bin/chunk-29zdp63z.js +0 -3
  132. package/bin/chunk-3swpwb9v.js +0 -1
  133. package/bin/chunk-3wmcx2bv.js +0 -2
  134. package/bin/chunk-5a8nt4me.js +0 -1
  135. package/bin/chunk-6bhn1p8v.js +0 -211
  136. package/bin/chunk-70c3xrgd.js +0 -2
  137. package/bin/chunk-7esm0hqb.js +0 -2
  138. package/bin/chunk-7fst8kdw.js +0 -12
  139. package/bin/chunk-8zqgaxvv.js +0 -1
  140. package/bin/chunk-a3dmtt2j.js +0 -1
  141. package/bin/chunk-ce8m4zeg.js +0 -3
  142. package/bin/chunk-e7mqtkzn.js +0 -2
  143. package/bin/chunk-ejbvfj4r.js +0 -1
  144. package/bin/chunk-ekfem7kf.js +0 -1
  145. package/bin/chunk-etwkk0xh.js +0 -1
  146. package/bin/chunk-evrdd32b.js +0 -2
  147. package/bin/chunk-fm6p03ad.js +0 -2
  148. package/bin/chunk-fyha3r13.js +0 -2
  149. package/bin/chunk-g0vs7k2x.js +0 -1
  150. package/bin/chunk-g84z2w7v.js +0 -16
  151. package/bin/chunk-h837fyed.js +0 -2
  152. package/bin/chunk-j20e0qsw.js +0 -7
  153. package/bin/chunk-n1jwdb0a.js +0 -1
  154. package/bin/chunk-p5gf1zdm.js +0 -4
  155. package/bin/chunk-pfgxggaj.js +0 -11
  156. package/bin/chunk-q16490pv.js +0 -2
  157. package/bin/chunk-qh81zhg1.js +0 -1
  158. package/bin/chunk-qwp3kwbz.js +0 -2
  159. package/bin/chunk-qydeqgyj.js +0 -5
  160. package/bin/chunk-r7dty1tg.js +0 -2
  161. package/bin/chunk-rhdxwebf.js +0 -2
  162. package/bin/chunk-rhh716z0.js +0 -42
  163. package/bin/chunk-rza4ae5z.js +0 -3
  164. package/bin/chunk-sk4e6rb1.js +0 -1
  165. package/bin/chunk-t2n1dbgx.js +0 -4
  166. package/bin/chunk-x8f4defx.js +0 -3
  167. package/bin/chunk-z3gkt8w1.js +0 -3
  168. package/bin/chunk-zh6fqq44.js +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shumai-one/shumai",
3
- "version": "0.4.3",
3
+ "version": "0.4.4",
4
4
  "description": "A fullstack AI-powered media workspace and workflow engine",
5
5
  "type": "module",
6
6
  "bin": {
@@ -27,12 +27,12 @@
27
27
  "zod": "4.5.4"
28
28
  },
29
29
  "optionalDependencies": {
30
- "@shumai-one/shumai-darwin-arm64": "0.4.3",
31
- "@shumai-one/shumai-darwin-x64": "0.4.3",
32
- "@shumai-one/shumai-linux-arm64": "0.4.3",
33
- "@shumai-one/shumai-linux-x64": "0.4.3",
34
- "@shumai-one/shumai-win32-arm64": "0.4.3",
35
- "@shumai-one/shumai-win32-x64": "0.4.3"
30
+ "@shumai-one/shumai-darwin-arm64": "0.4.4",
31
+ "@shumai-one/shumai-darwin-x64": "0.4.4",
32
+ "@shumai-one/shumai-linux-arm64": "0.4.4",
33
+ "@shumai-one/shumai-linux-x64": "0.4.4",
34
+ "@shumai-one/shumai-win32-arm64": "0.4.4",
35
+ "@shumai-one/shumai-win32-x64": "0.4.4"
36
36
  },
37
37
  "repository": {
38
38
  "type": "git",
@@ -0,0 +1,2 @@
1
+ -- AlterTable
2
+ ALTER TABLE "assets" ADD COLUMN "upload_id" TEXT;
@@ -522,6 +522,7 @@ model Asset {
522
522
  sizeByte BigInt @default(0) @map("size_byte")
523
523
  status AssetStatus
524
524
  transcodeTaskId String? @map("transcode_task_id")
525
+ uploadId String? @map("upload_id")
525
526
  /// [MediaInfo]
526
527
  media Json?
527
528
  isDeleted Boolean @default(false) @map("is_deleted")
@@ -1 +0,0 @@
1
- import{t,Ue}from"./chunk-6bhn1p8v.js";import"./chunk-j20e0qsw.js";import"./chunk-3wmcx2bv.js";import"./chunk-ehc9adfz.js";import"./chunk-7esm0hqb.js";import"./chunk-q16490pv.js";import"./chunk-c007p0t8.js";import"./chunk-b9yrw9et.js";import"./chunk-k7hss0bd.js";import"./chunk-e7mqtkzn.js";import"./chunk-cqb415s6.js";import{ts}from"./chunk-awfwk64v.js";import"./chunk-4r81ghg8.js";import"./chunk-gk3eqd50.js";import"./chunk-ag6p3mbf.js";import"./chunk-9t1ne8xr.js";import"./chunk-m7m9d4fb.js";import"./chunk-r7dty1tg.js";import"./chunk-2yxj593j.js";import"./chunk-ea79xnn3.js";function p(){let{shareId:a,fileId:s}=e.useParams(),{start:n,version:o,compare:r,cmpLeft:i,cmpRight:l,cmpActive:c}=e.useSearch();return t(ts,{shareId:a,initialFileId:s,startTime:n,versionId:o,compare:r,compareLeftId:i,compareRightId:l,compareActiveSide:c})}var e=Ue("/share/$shareId/files/$fileId")({component:p});export{e as Route};
@@ -1 +0,0 @@
1
- import{h,C,t,L,Ue,A,st,yt,Ep}from"./chunk-6bhn1p8v.js";import"./chunk-b9yrw9et.js";import"./chunk-6gg1ymer.js";import"./chunk-cqb415s6.js";import{_i}from"./chunk-rhh716z0.js";import"./chunk-zehyn6vd.js";import"./chunk-70c3xrgd.js";import"./chunk-pb1zf0vb.js";import{Wt}from"./chunk-rhdxwebf.js";import"./chunk-4r81ghg8.js";import"./chunk-gk3eqd50.js";import"./chunk-1yacmegc.js";import"./chunk-ea79xnn3.js";C();function p(){let{projectId:e,folderId:d}=s.useParams(),{teamId:r,ensureTeamIdForProject:i}=st();h(()=>{i(e)},[e,i]);let{data:a}=Wt(Ep(e)),o=a?.rootFolder,{data:l}=L({queryKey:["folders",o],queryFn:async()=>{let n=await A.api.folders[":folderId"].$get({param:{folderId:o}});if(!n.ok)throw Error("failed to fetch folder");return await n.json()},enabled:!!o});if(!r||!o||!l)return t(yt,{});return t(_i,{teamId:r,projectId:e,projectName:a.name??"",assetId:d,rootFolderId:o,isRoot:!1})}var s=Ue("/projects/$projectId/folders/$folderId_/agentsmd")({component:p});export{s as Route};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Bi}from"./chunk-32pcmaqm.js";export default Bi();
@@ -1,3 +0,0 @@
1
- // @bun
2
- function Xr(n){let e={};for(let[t,r]of n.entries())e[t]=r;return e}function Ss(n){if(!n)return;let e={};for(let[t,r]of Object.entries(n))if(r!==null)e[t]=r;return Object.keys(e).length>0?e:void 0}
3
- export{Xr,Ss};
@@ -1 +0,0 @@
1
- import{h,C,t,L,Ue,A,st,yt,Sp}from"./chunk-6bhn1p8v.js";import"./chunk-3wmcx2bv.js";import"./chunk-j20e0qsw.js";import"./chunk-ehc9adfz.js";import"./chunk-b9yrw9et.js";import"./chunk-6gg1ymer.js";import"./chunk-bay038pj.js";import"./chunk-7esm0hqb.js";import"./chunk-q16490pv.js";import"./chunk-k7hss0bd.js";import"./chunk-c007p0t8.js";import"./chunk-cqb415s6.js";import{Zn}from"./chunk-185qefn1.js";import{Wt}from"./chunk-rhdxwebf.js";import"./chunk-4r81ghg8.js";import"./chunk-gk3eqd50.js";import"./chunk-ag6p3mbf.js";import"./chunk-9t1ne8xr.js";import"./chunk-m7m9d4fb.js";import"./chunk-1yacmegc.js";import"./chunk-r7dty1tg.js";import"./chunk-2yxj593j.js";import"./chunk-ea79xnn3.js";C();function l(){let{projectId:o,folderId:n}=c.useParams(),{teamId:r,ensureTeamIdForProject:a}=st();h(()=>{a(o)},[o,a]);let{data:s}=Wt(Sp(o)),e=s?.rootFolder,{data:i}=L({queryKey:["folders",e],queryFn:()=>(async()=>await(await A.api.folders[":folderId"].$get({param:{folderId:e}})).json())(),enabled:!!e});if(!r||!e||!i)return t(yt,{});return t(Zn,{teamId:r,projectId:o,projectName:s.name??"",assetId:n,rootFolderId:e})}var c=Ue("/projects/$projectId/folders/$folderId")({component:l});export{c as Route};
@@ -1,2 +0,0 @@
1
- import{D,h,He,O,v,u,C,B,t,o,Q,U,Sr,A,T,bt,Pn,Te,_e,jr,ft,ur,ga,wo,de,Lt,Oe,E,ut,me,K,Ot,oe,Ha,Ga,On,Qa,sc,S,Ce,Ee,Ie,he,ge,Ae,V,Vo,Pu,$p,Zu,lc,Ay,yy,cc,_y,by,vy,Qd,uc,wy,xy,Re,Wi,Bu,of,Ji,af,lf,cf,fi,hf,Cw,Ew,Ku,yh,Mf,Ju,So,AC,eg,EC,wI,fe,Cg,ce,pe,ue,It,q,Lo,Ir,nn,Dn,R,it,we,gi,Bs,hd,ul,ir,Cc,Ec,$n,Ai,ht,gt,At,Cr,_r,G,je,Dr}from"./chunk-6bhn1p8v.js";import{go,lr}from"./chunk-ehc9adfz.js";import{Yr}from"./chunk-m7m9d4fb.js";import{Ln,Xn}from"./chunk-2yxj593j.js";function Dt(e){let n=e.lastIndexOf(".");if(n>0)return[0,n];return[0,e.length]}function ea(e){e.focus();let[n,r]=Dt(e.value);if(typeof e.setSelectionRange==="function")e.setSelectionRange(n,r);else e.select()}var Pt=[["path",{d:"M2 10v3",key:"1fnikh"}],["path",{d:"M6 6v11",key:"11sgs0"}],["path",{d:"M10 3v18",key:"yhl04a"}],["path",{d:"M14 8v7",key:"3a1oy3"}],["path",{d:"M18 5v13",key:"123xd1"}],["path",{d:"M22 10v3",key:"154ddg"}]],To=T("audio-lines",Pt);var Rr=Sr((e)=>({fields:[],loadedProjectId:null,setFields:(n,r)=>e({fields:n,loadedProjectId:r}),updateFields:(n)=>e({fields:n})}));function We(e,n){let{start:r,end:a}=ul(n?.in,e),i=+r>+a,s=i?+r:+a,c=i?a:r;c.setHours(0,0,0,0);let l=n?.step??1;if(!l)return[];if(l<0)l=-l,i=!i;let m=[];while(+c<=s)m.push(it(r,c)),c.setDate(c.getDate()+l),c.setHours(0,0,0,0);return i?m.reverse():m}function ye(e,n){return we(e,n?.in).getDate()}function Ze(e,n){return we(e,n?.in).getDay()}function Me(e,n){return we(e,n?.in).getHours()}function ke(e,n){return we(e,n?.in).getMinutes()}var Vt=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],De=T("circle-question-mark",Vt);var Bt=[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M17 19H3",key:"z6ezky"}]],Xe=T("text-align-start",Bt);var Ht=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}]],Qe=T("ban",Ht);var $t=[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]],Ye=T("hash",$t);var Ut=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Ca=T("settings",Ut);var zt=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],Ne=T("star",zt);var Gt=[["path",{d:"M13.172 2a2 2 0 0 1 1.414.586l6.71 6.71a2.4 2.4 0 0 1 0 3.408l-4.592 4.592a2.4 2.4 0 0 1-3.408 0l-6.71-6.71A2 2 0 0 1 6 9.172V3a1 1 0 0 1 1-1z",key:"16rjxf"}],["path",{d:"M2 7v6.172a2 2 0 0 0 .586 1.414l6.71 6.71a2.4 2.4 0 0 0 3.191.193",key:"178nd4"}],["circle",{cx:"10.5",cy:"6.5",r:".5",fill:"currentColor",key:"12ikhr"}]],qe=T("tags",Gt);var jt=[["circle",{cx:"9",cy:"12",r:"3",key:"u3jwor"}],["rect",{width:"20",height:"14",x:"2",y:"5",rx:"7",key:"g7kal2"}]],Je=T("toggle-left",jt);var Kt=[["path",{d:"M12 4v16",key:"1654pz"}],["path",{d:"M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2",key:"e0r10z"}],["path",{d:"M9 20h6",key:"s66wpe"}]],Si=T("type",Kt);C();var Wt=({value:e,config:n,onSave:r,readOnly:a})=>{let i=n?.date,[s,c]=u(!1),l=v(null),m=e?new Date(e):new Date,f=Bs(m)?m:new Date,[x,b]=u(f);h(()=>{if(s&&e){let N=new Date(e);if(Bs(N))b(N)}},[s,e]),h(()=>{let N=(g)=>{if(l.current&&!l.current.contains(g.target)){if(s)c(!1)}};return document.addEventListener("mousedown",N),()=>document.removeEventListener("mousedown",N)},[s]);let p=()=>{if(!a)c(!0)},F=(N)=>{if(!N)return"";let g=new Date(N);if(!Bs(g))return"Invalid Date";let k="PPP";if(i?.displayFormat==="usa")k="MM/dd/yyyy";else if(i?.displayFormat==="euro")k="dd/MM/yyyy";else if(i?.displayFormat==="iso")k="yyyy-MM-dd";if(i?.includeTime)if(i?.timeFormat==="twenty_four_hour")k+=" HH:mm";else k+=" p";let j=ir(g,k);if(i?.displayTimezone)j+=` (${Intl.DateTimeFormat().resolvedOptions().timeZone})`;return j},d=new Date(x.getFullYear(),x.getMonth(),1),M=hd(x),H=We({start:d,end:M}),P=Ze(d),y=(N)=>{let g=new Date(N);if(i?.includeTime)g.setHours(Me(f)),g.setMinutes(ke(f));let k=g.toISOString();if(r(k),!i?.includeTime)c(!1)},z=(N,g)=>{let k=e?new Date(e):new Date;if(!Bs(k))k.setTime(new Date().getTime());if(N==="hour")k.setHours(g);if(N==="minute")k.setMinutes(g);let j=k.toISOString();r(j)},w=Array.from({length:24},(N,g)=>g),Z=Array.from({length:12},(N,g)=>g*5);if(s)return o("div",{className:"relative w-full",ref:l,children:[t("div",{className:"w-full px-2 py-1 border border-ring rounded bg-background text-sm shadow-sm min-h-[28px] flex items-center",children:e?F(e):t("span",{className:"text-muted-foreground",children:"Select date..."})}),o("div",{className:"absolute z-50 top-full left-0 mt-1 bg-popover border border-border rounded-lg shadow-xl flex flex-col md:flex-row overflow-hidden min-w-[280px]",children:[o("div",{className:"p-4 w-64",children:[o("div",{className:"flex justify-between items-center mb-4",children:[t("button",{onClick:()=>b(gi(x,-1)),className:"p-1 hover:bg-accent rounded",children:t(jr,{className:"w-4 h-4"})}),t("span",{className:"font-semibold text-sm",children:ir(x,"MMMM yyyy")}),t("button",{onClick:()=>b(gi(x,1)),className:"p-1 hover:bg-accent rounded",children:t(ft,{className:"w-4 h-4"})})]}),t("div",{className:"grid grid-cols-7 gap-1 text-center text-xs mb-2 text-muted-foreground",children:["Su","Mo","Tu","We","Th","Fr","Sa"].map((N)=>t("div",{children:N},N))}),o("div",{className:"grid grid-cols-7 gap-1 text-center text-sm",children:[Array.from({length:P}).map((N,g)=>t("div",{},`empty-${g}`)),H.map((N)=>{let g=e?new Date(e):null,k=g&&Bs(g)&&ye(g)===ye(N)&&Cc(g)===Cc(N)&&Ec(g)===Ec(N);return t("button",{onClick:()=>y(N),className:`w-8 h-8 rounded-full flex items-center justify-center hover:bg-accent transition-colors ${k?"bg-primary text-primary-foreground hover:bg-primary/90":"text-foreground"}`,children:ye(N)},N.toString())})]})]}),i?.includeTime&&o("div",{className:"border-l border-border bg-muted w-32 flex flex-col",children:[o("div",{className:"p-2 border-b border-border text-xs font-semibold text-muted-foreground flex items-center justify-center gap-1",children:[t(ur,{className:"w-3 h-3"})," Time"]}),o("div",{className:"flex flex-1 h-64",children:[t("div",{className:"flex-1 overflow-y-auto scrollbar-hide border-r border-border",children:w.map((N)=>t("div",{onClick:()=>z("hour",N),className:`px-2 py-1 text-center text-sm cursor-pointer hover:bg-accent ${Me(f)===N?"bg-primary/10 font-medium text-primary":""}`,children:N.toString().padStart(2,"0")},N))}),t("div",{className:"flex-1 overflow-y-auto scrollbar-hide",children:Z.map((N)=>t("div",{onClick:()=>z("minute",N),className:`px-2 py-1 text-center text-sm cursor-pointer hover:bg-accent ${ke(f)===N?"bg-primary/10 font-medium text-primary":""}`,children:N.toString().padStart(2,"0")},N))})]})]})]})]});return t("div",{onClick:p,className:`w-full min-h-[28px] px-2 py-1 text-sm text-foreground rounded border border-transparent transition-colors ${!a?"cursor-pointer hover:bg-accent hover:border-border":""}`,children:e?F(e):t("span",{className:"text-muted-foreground italic",children:"Empty"})})},et=Wt;C();var Zt=({value:e,onSave:n,readOnly:r})=>{let[a,i]=u(!1),[s,c]=u(e||""),l=v(null),m=v(null),[f,x]=u(!1);h(()=>{c(e||"")},[e]),h(()=>{if(a&&l.current)l.current.focus(),x(!1)},[a]),h(()=>{let d=(M)=>{if(f&&m.current&&!m.current.contains(M.target))x(!1)};if(f)document.addEventListener("mousedown",d);return()=>{document.removeEventListener("mousedown",d)}},[f]);let b=()=>{i(!1),n(s)},p=(d)=>{d.stopPropagation(),x(!0)},F=(d)=>{if(d.stopPropagation(),!r)i(!0)};if(a)return t("textarea",{ref:l,value:s,onChange:(d)=>c(d.target.value),onBlur:b,className:"w-full min-h-[80px] p-2 border border-ring rounded bg-background text-sm outline-none shadow-sm resize-none"});return o("div",{ref:m,className:"relative w-full text-sm",children:[t("div",{onClick:p,className:`w-full text-foreground rounded border border-transparent transition-all px-2 py-1 h-[48px] line-clamp-2 whitespace-pre-wrap overflow-hidden ${!r?"cursor-pointer hover:bg-accent hover:border-border":"cursor-pointer"}`,title:"Click to expand",children:e?e:t("span",{className:"text-muted-foreground italic",children:"Empty"})}),f&&t("div",{onClick:F,className:`absolute top-0 left-0 w-full min-h-full h-auto z-50 bg-background border border-ring rounded shadow-lg px-2 py-1 whitespace-pre-wrap ${!r?"cursor-text":""}`,children:e?e:t("span",{className:"text-muted-foreground italic",children:"Empty"})})]})},tt=Zt;C();var Xt=({value:e,config:n,onSave:r,readOnly:a})=>{let i=n?.number,[s,c]=u(!1),[l,m]=u(""),f=v(null);h(()=>{m(e!==void 0&&e!==null?e.toString():"")},[e]),h(()=>{if(s&&f.current)f.current.focus()},[s]);let x=()=>{if(!a)c(!0)},b=()=>{if(c(!1),l==="")r(void 0);else{let d=parseFloat(l);r(isNaN(d)?void 0:d)}},p=(d)=>{if(d.key==="Enter")d.stopPropagation(),f.current?.blur()},F=(d)=>{if(d===void 0||d===null||isNaN(d))return"";return d.toFixed(i?.scale)};if(s)return t("input",{ref:f,type:"number",step:1/Math.pow(10,i?.scale||0),value:l,onChange:(d)=>m(d.target.value),onBlur:b,onKeyDown:p,onDoubleClick:(d)=>d.stopPropagation(),className:"w-full px-2 py-1 border border-ring rounded bg-background text-sm outline-none shadow-sm text-left font-mono"});return t("div",{onClick:x,onDoubleClick:(d)=>d.stopPropagation(),className:`w-full min-h-[28px] px-2 py-1 text-sm text-foreground rounded border border-transparent transition-colors text-left font-mono ${!a?"cursor-pointer hover:bg-accent hover:border-border":""}`,children:e!==void 0&&e!==null?F(e):t("span",{className:"text-muted-foreground italic font-sans text-left block",children:"Empty"})})},ot=Xt;C();var Qt=({value:e,config:n,onSave:r,readOnly:a})=>{let i=n?.rating,s=Math.max(2,Math.min(6,i?.maxValue||5)),[c,l]=u(null),m=(x,b)=>{if(x.stopPropagation(),a)return;let p;if(e===b)p=0;else p=b;r(p)},f=Array.from({length:s},(x,b)=>b+1);return t("div",{className:"flex items-center gap-1 h-[28px]",onMouseLeave:()=>!a&&l(null),onDoubleClick:(x)=>x.stopPropagation(),children:f.map((x)=>{let b=c!==null?x<=c:x<=(e||0);return t("button",{onClick:(p)=>m(p,x),onMouseEnter:()=>!a&&l(x),className:`focus:outline-none transition-transform ${!a?"cursor-pointer hover:scale-110":"cursor-default"}`,type:"button",disabled:a,children:t(Ne,{className:`w-5 h-5 transition-colors ${b?"fill-yellow-400 text-yellow-400":"fill-muted text-muted-foreground/30"}`})},x)})})},Fc=Qt;C();C();var qt=Object.defineProperty,I=(e,n)=>qt(e,"name",{value:n,configurable:!0}),rt=["PageUp","PageDown"],at=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],st={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},xe="Slider",[Le,Jt,eo]=Ga(xe),[Ve,nr]=ut(xe,[eo]),[to,be]=Ve(xe),oo=D(I(function(n,r){let{name:a,min:i=0,max:s=100,step:c=1,orientation:l="horizontal",disabled:m=!1,minStepsBetweenThumbs:f=0,defaultValue:x=[i],value:b,onValueChange:p=I(()=>{},"onValueChange"),onValueCommit:F=I(()=>{},"onValueCommit"),inverted:d=!1,form:M,...H}=n,P=v(new Set),y=v(0),z=v(!1),Z=l==="horizontal"?no:ro,[N,g]=u(null),k=me(r,g),[j=[],ee]=Ot({prop:b,defaultProp:x,onChange:I((W)=>{[...P.current][y.current]?.focus({preventScroll:!0,focusVisible:z.current}),z.current=!1,p(W)},"onChange")}),Y=v(j),ne=v(j);h(()=>{let W=M?N?.ownerDocument.getElementById(M):N?.closest("form");if(W instanceof HTMLFormElement){let te=I(()=>ee(ne.current),"reset");return W.addEventListener("reset",te),()=>W.removeEventListener("reset",te)}},[N,M,ee]);function _(W){let te=yt(j,W);L(W,te)}I(_,"handleSlideStart");function X(W){L(W,y.current)}I(X,"handleSlideMove");function J(){if(String(j)!==String(Y.current))F(j)}I(J,"handleSlideEnd");function L(W,te,{commit:ze}={commit:!1}){let Ge=$e(c),Fe=ve(Math.round((W-i)/c)*c+i,Ge),le=Qa(Fe,[i,s]);ee((ie=[])=>{let re=vt(ie,le,te);if(St(re,f*c)){y.current=re.indexOf(le);let Ke=String(re)!==String(ie);if(Ke&&ze)F(re);return Ke?re:ie}else return ie})}return I(L,"updateValues"),t(to,{scope:n.__scopeSlider,name:a,disabled:m,min:i,max:s,valueIndexToChangeRef:y,thumbs:P.current,values:j,orientation:l,form:M,children:t(Le.Provider,{scope:n.__scopeSlider,children:t(Le.Slot,{scope:n.__scopeSlider,children:t(Z,{"aria-disabled":m,"data-disabled":m?"":void 0,...H,ref:k,onPointerDown:K(H.onPointerDown,()=>{if(!m)Y.current=j,z.current=!1}),min:i,max:s,inverted:d,onSlideStart:m?void 0:_,onSlideMove:m?void 0:X,onSlideEnd:m?void 0:J,onHomeKeyDown:()=>{if(!m)z.current=!0,L(i,0,{commit:!0})},onEndKeyDown:()=>{if(!m)z.current=!0,L(s,j.length-1,{commit:!0})},onStepKeyDown:({event:W,direction:te})=>{if(!m){z.current=!0;let Fe=rt.includes(W.key)||W.shiftKey&&at.includes(W.key)?10:1,le=y.current,ie=j[le],re=Ct(ie,{min:i,step:c,direction:te,multiplier:Fe});L(re,le,{commit:!0})}}})})})})},"Slider")),[lt,ct]=Ve(xe,{startEdge:"left",endEdge:"right",size:"width",direction:1}),no=D(I(function(n,r){let{min:a,max:i,dir:s,inverted:c,onSlideStart:l,onSlideMove:m,onSlideEnd:f,onStepKeyDown:x,...b}=n,[p,F]=u(null),d=me(r,F),M=v(void 0),H=On(s),P=H==="ltr",y=P&&!c||!P&&c;function z(w){let Z=M.current||p.getBoundingClientRect(),N=[0,Z.width],k=Se(N,y?[a,i]:[i,a]);return M.current=Z,k(w-Z.left)}return I(z,"getValueFromPointer"),t(lt,{scope:n.__scopeSlider,startEdge:y?"left":"right",endEdge:y?"right":"left",direction:y?1:-1,size:"width",children:t(dt,{dir:H,"data-orientation":"horizontal",...b,ref:d,style:{...b.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:(w)=>{let Z=z(w.clientX);l?.(Z)},onSlideMove:(w)=>{let Z=z(w.clientX);m?.(Z)},onSlideEnd:()=>{M.current=void 0,f?.()},onStepKeyDown:(w)=>{let N=st[y?"from-left":"from-right"].includes(w.key);x?.({event:w,direction:N?-1:1})}})})},"SliderHorizontal")),ro=D(I(function(n,r){let{min:a,max:i,inverted:s,onSlideStart:c,onSlideMove:l,onSlideEnd:m,onStepKeyDown:f,...x}=n,b=v(null),p=me(r,b),F=v(void 0),d=!s;function M(H){let P=F.current||b.current.getBoundingClientRect(),y=[0,P.height],w=Se(y,d?[i,a]:[a,i]);return F.current=P,w(H-P.top)}return I(M,"getValueFromPointer"),t(lt,{scope:n.__scopeSlider,startEdge:d?"bottom":"top",endEdge:d?"top":"bottom",size:"height",direction:d?1:-1,children:t(dt,{"data-orientation":"vertical",...x,ref:p,style:{...x.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:(H)=>{let P=M(H.clientY);c?.(P)},onSlideMove:(H)=>{let P=M(H.clientY);l?.(P)},onSlideEnd:()=>{F.current=void 0,m?.()},onStepKeyDown:(H)=>{let y=st[d?"from-bottom":"from-top"].includes(H.key);f?.({event:H,direction:y?-1:1})}})})},"SliderVertical")),dt=D(I(function(n,r){let{__scopeSlider:a,onSlideStart:i,onSlideMove:s,onSlideEnd:c,onHomeKeyDown:l,onEndKeyDown:m,onStepKeyDown:f,...x}=n,b=be(xe,a);return t(oe.span,{...x,ref:r,onKeyDown:K(n.onKeyDown,(p)=>{if(p.key==="Home")l(p),p.preventDefault();else if(p.key==="End")m(p),p.preventDefault();else if(rt.concat(at).includes(p.key))f(p),p.preventDefault()}),onPointerDown:K(n.onPointerDown,(p)=>{let F=p.target;if(F.setPointerCapture(p.pointerId),p.preventDefault(),b.thumbs.has(F))F.focus({preventScroll:!0,focusVisible:!1});else i(p)}),onPointerMove:K(n.onPointerMove,(p)=>{if(p.target.hasPointerCapture(p.pointerId))s(p)}),onPointerUp:K(n.onPointerUp,(p)=>{let F=p.target;if(F.hasPointerCapture(p.pointerId))F.releasePointerCapture(p.pointerId),c(p)})})},"SliderImpl")),ao="SliderTrack",io=D(I(function(n,r){let{__scopeSlider:a,...i}=n,s=be(ao,a);return t(oe.span,{"data-disabled":s.disabled?"":void 0,"data-orientation":s.orientation,...i,ref:r})},"SliderTrack")),nt="SliderRange",so=D(I(function(n,r){let{__scopeSlider:a,...i}=n,s=be(nt,a),c=ct(nt,a),l=v(null),m=me(r,l),f=s.values.length,x=s.values.map((F)=>Be(F,s.min,s.max)),b=f>1?Math.min(...x):0,p=100-Math.max(...x);return t(oe.span,{"data-orientation":s.orientation,"data-disabled":s.disabled?"":void 0,...i,ref:m,style:{...n.style,[c.startEdge]:b+"%",[c.endEdge]:p+"%"}})},"SliderRange")),lo="SliderThumb",[co,mt]=Ve(lo),uo="SliderThumbProvider";function pt(e){let{__scopeSlider:n,name:r,children:a,internal_do_not_use_render:i}=e,s=be(uo,n),c=Jt(n),[l,m]=u(null),f=O(()=>l?c().findIndex((H)=>H.ref.current===l):-1,[c,l]),x=Ha(l),b=l?!!s.form||!!l.closest("form"):!0,p=s.values[f],F=r??(s.name?s.name+(s.values.length>1?"[]":""):void 0),d=p===void 0?0:Be(p,s.min,s.max);h(()=>{if(l)return s.thumbs.add(l),()=>{s.thumbs.delete(l)}},[l,s.thumbs]);let M={value:p,name:F,form:s.form,isFormControl:b,index:f,thumb:l,onThumbChange:m,percent:d,size:x};return t(co,{scope:n,...M,children:Et(i)?i(M):a})}I(pt,"SliderThumbProvider");var Pe="SliderThumbTrigger",mo=D(I(function(n,r){let{__scopeSlider:a,...i}=n,s=be(Pe,a),c=ct(Pe,a),{index:l,value:m,percent:f,size:x,onThumbChange:b}=mt(Pe,a),p=me(r,b),F=xt(l,s.values.length),d=x?.[c.size],M=d?wt(d,f,c.direction):0;return t("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[c.startEdge]:`calc(${f}% + ${M}px)`},children:t(Le.ItemSlot,{scope:a,children:t(oe.span,{role:"slider","aria-label":n["aria-label"]||F,"aria-valuemin":s.min,"aria-valuenow":m,"aria-valuemax":s.max,"aria-orientation":s.orientation,"data-orientation":s.orientation,"data-disabled":s.disabled?"":void 0,tabIndex:s.disabled?void 0:0,...i,ref:p,style:m===void 0?{display:"none"}:n.style,onFocus:K(n.onFocus,()=>{s.valueIndexToChangeRef.current=l})})})})},"SliderThumbTrigger")),fo=D(I(function(n,r){let{__scopeSlider:a,name:i,...s}=n;return t(pt,{__scopeSlider:a,name:i,internal_do_not_use_render:({index:c,isFormControl:l})=>o(B,{children:[t(mo,{...s,ref:r,__scopeSlider:a}),l?t(ho,{__scopeSlider:a},c):null]})})},"SliderThumb")),po="SliderBubbleInput",ho=D(I(function({__scopeSlider:n,...r},a){let{value:i,name:s,form:c}=mt(po,n),l=v(null),m=me(l,a),f=sc(i);return h(()=>{let x=l.current;if(!x)return;let b=window.HTMLInputElement.prototype,F=Object.getOwnPropertyDescriptor(b,"value").set;if(f!==i&&F){let d=new Event("input",{bubbles:!0});F.call(x,i),x.dispatchEvent(d)}},[f,i]),t(oe.input,{style:{display:"none"},name:s,form:c,...r,ref:m,defaultValue:i})},"SliderBubbleInput"));function vt(e=[],n,r){let a=[...e];return a[r]=n,a.sort((i,s)=>i-s)}I(vt,"getNextSortedValues");function Be(e,n,r){let s=100/(r-n)*(e-n);return Qa(s,[0,100])}I(Be,"convertValueToPercentage");function xt(e,n){if(n>2)return`Value ${e+1} of ${n}`;else if(n===2)return["Minimum","Maximum"][e];else return}I(xt,"getLabel");function yt(e,n){if(e.length===1)return 0;let r=e.map((i)=>Math.abs(i-n)),a=Math.min(...r);return r.indexOf(a)}I(yt,"getClosestValueIndex");function wt(e,n,r){let a=e/2,i=50,s=Se([0,50],[0,a]);return(a-s(n)*r)*r}I(wt,"getThumbInBoundsOffset");function Nt(e){return e.slice(0,-1).map((n,r)=>e[r+1]-n)}I(Nt,"getStepsBetweenValues");function St(e,n){if(n>0){let r=Nt(e);return Math.min(...r)>=n}return!0}I(St,"hasMinStepsBetweenValues");function Se(e,n){return(r)=>{if(e[0]===e[1]||n[0]===n[1])return n[0];let a=(n[1]-n[0])/(e[1]-e[0]);return n[0]+a*(r-e[0])}}I(Se,"linearScale");function $e(e){if(!Number.isFinite(e))return 0;let n=e.toString();if(n.includes("e")){let[a,i]=n.split("e"),s=a.split(".")[1]||"",c=Number(i);return Math.max(0,s.length-c)}let r=n.split(".")[1];return r?r.length:0}I($e,"getDecimalCount");function ve(e,n){let r=Math.pow(10,n);return Math.round(e*r)/r}I(ve,"roundValue");function Ct(e,{min:n,step:r,direction:a,multiplier:i}){let s=$e(r),c=(e-n)/r,l=Math.round(c),m=ve(l*r+n,s)===ve(e,s),f;if(m)f=l+i*a;else if(a>0)f=Math.ceil(c);else f=Math.floor(c);return ve(f*r+n,s)}I(Ct,"getNextStepValue");function Et(e){return typeof e==="function"}I(Et,"isFunction");var ae;(function(e){e.Base32IncorrectEncoding="B32_ENC_INVALID",e.DecodeTimeInvalidCharacter="DEC_TIME_CHAR",e.DecodeTimeValueMalformed="DEC_TIME_MALFORMED",e.EncodeTimeNegative="ENC_TIME_NEG",e.EncodeTimeSizeExceeded="ENC_TIME_SIZE_EXCEED",e.EncodeTimeValueMalformed="ENC_TIME_MALFORMED",e.PRNGDetectFailure="PRNG_DETECT",e.ULIDInvalid="ULID_INVALID",e.Unexpected="UNEXPECTED",e.UUIDInvalid="UUID_INVALID"})(ae||(ae={}));class se extends Error{constructor(e,n){super(`${n} (${e})`);this.name="ULIDError",this.code=e}}function xo(e){let n=Math.floor(e()*32)%32;return"0123456789ABCDEFGHJKMNPQRSTVWXYZ".charAt(n)}function bo(e){let n=yo(),r=n&&(n.crypto||n.msCrypto)||null;if(typeof r?.getRandomValues==="function")return()=>{let a=new Uint8Array(1);return r.getRandomValues(a),a[0]/256};else if(typeof r?.randomBytes==="function")return()=>r.randomBytes(1).readUInt8()/256;throw new se(ae.PRNGDetectFailure,"Failed to find a reliable PRNG")}function yo(){if(Eo())return self;if(typeof window<"u")return window;if(typeof global<"u")return global;if(typeof globalThis<"u")return globalThis;return null}function No(e,n){let r="";for(;e>0;e--)r=xo(n)+r;return r}function Co(e,n=10){if(isNaN(e))throw new se(ae.EncodeTimeValueMalformed,`Time must be a number: ${e}`);else if(e>281474976710655)throw new se(ae.EncodeTimeSizeExceeded,`Cannot encode a time larger than 281474976710655: ${e}`);else if(e<0)throw new se(ae.EncodeTimeNegative,`Time must be positive: ${e}`);else if(Number.isInteger(e)===!1)throw new se(ae.EncodeTimeValueMalformed,`Time must be an integer: ${e}`);let r,a="";for(let i=n;i>0;i--)r=e%32,a="0123456789ABCDEFGHJKMNPQRSTVWXYZ".charAt(r)+a,e=(e-r)/32;return a}function Eo(){return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}function Mo(e,n){let r=n||bo(),a=!e||isNaN(e)?Date.now():e;return Co(a,10)+No(16,r)}function _o(e,n,r){let a=e.slice();return a.splice(r,0,a.splice(n,1)[0]),a}function zc(e,n,r,a){if(r===a)return e;let i=_o(n,r,a),s=new Set(n.map((l)=>l.id)),c=0;return e.map((l)=>s.has(l.id)?i[c++]:l)}async function Ci(e){let n=[],r=[],a=e.items;if(a)for(let c=0;c<a.length;c++){let l=a[c];if(l.kind==="file"){let m=l.webkitGetAsEntry?.();if(m)r.push({entry:m,path:""})}}else return Array.from(e.files);let i=(c)=>new Promise((l)=>{c.readEntries((m)=>l(m),()=>l([]))}),s=(c)=>new Promise((l,m)=>{c.file((f)=>l(f),(f)=>m(f))});while(r.length>0){let c=r.shift();if(!c)continue;let{entry:l,path:m}=c;if(l.isFile)try{let f=await s(l),x=m?`${m}/${f.name}`:f.name;Object.defineProperty(f,"webkitRelativePath",{value:x,writable:!1,configurable:!0}),n.push(f)}catch(f){console.error("Error reading file entry:",f)}else if(l.isDirectory){let f=l.createReader(),x=[],b=await i(f);while(b.length>0)x=x.concat(b),b=await i(f);let p=m?`${m}/${l.name}`:l.name;for(let F of x)r.push({entry:F,path:p})}}return n}C();C();function El(){let[e,n]=u(!1);return o(fe,{open:e,onOpenChange:n,children:[t(Cg,{asChild:!0,children:o(S,{type:"button",variant:"ghost",size:"icon",className:"h-4 w-4 p-0 hover:bg-transparent text-muted-foreground hover:text-foreground inline-flex items-center justify-center shrink-0 ml-1",title:Qd(),children:[t(De,{className:"h-3.5 w-3.5"}),t("span",{className:"sr-only",children:Qd()})]})}),o(ce,{className:"sm:max-w-[500px]",children:[o(pe,{children:[o(ue,{className:"flex items-center gap-2",children:[t(De,{className:"h-5 w-5 text-muted-foreground"}),Qd()]}),t(It,{children:vy()})]}),o("div",{className:"space-y-4 py-2",children:[o("div",{className:"rounded-lg border p-3.5 space-y-1.5 bg-muted/30",children:[o("div",{className:"flex items-center gap-2 font-medium text-sm",children:[t(Qe,{className:"h-4 w-4 text-muted-foreground shrink-0"}),t("span",{children:uc()})]}),t("p",{className:"text-xs text-muted-foreground leading-relaxed",children:wy()}),t("p",{className:"text-xs italic text-muted-foreground/80",children:xy()})]}),o("div",{className:"rounded-lg border p-3.5 space-y-1.5 bg-muted/30",children:[o("div",{className:"flex items-center gap-2 font-medium text-sm",children:[t(Yr,{className:"h-4 w-4 text-amber-500 shrink-0"}),t("span",{children:lc()})]}),t("p",{className:"text-xs text-muted-foreground leading-relaxed",children:Ay()}),t("p",{className:"text-xs italic text-muted-foreground/80",children:yy()})]}),o("div",{className:"rounded-lg border p-3.5 space-y-1.5 bg-muted/30",children:[o("div",{className:"flex items-center gap-2 font-medium text-sm",children:[t(bt,{className:"h-4 w-4 text-blue-500 shrink-0"}),t("span",{children:cc()})]}),t("p",{className:"text-xs text-muted-foreground leading-relaxed",children:_y()}),t("p",{className:"text-xs italic text-muted-foreground/80",children:by()})]})]})]})]})}var Vs=["red","orange","yellow","green","blue","purple","gray"],cs={red:{bg:"rgba(239, 68, 68, 0.15)",text:"#ef4444",hex:"#ef4444"},orange:{bg:"rgba(249, 115, 22, 0.15)",text:"#f97316",hex:"#f97316"},yellow:{bg:"rgba(234, 179, 8, 0.15)",text:"#ca8a04",hex:"#eab308"},green:{bg:"rgba(34, 197, 94, 0.15)",text:"#16a34a",hex:"#22c55e"},blue:{bg:"rgba(59, 130, 246, 0.15)",text:"#2563eb",hex:"#3b82f6"},purple:{bg:"rgba(168, 85, 247, 0.15)",text:"#9333ea",hex:"#a855f7"},gray:{bg:"rgba(128, 128, 128, 0.15)",text:"#4b5563",hex:"#808080"},system:{bg:"rgba(128, 128, 128, 0.1)",text:"#6b7280",hex:"#808080"}};function ta(e){if(!e)return{backgroundColor:"rgba(128, 128, 128, 0.1)",color:"#6b7280"};let n=e.toLowerCase(),r=cs[n];if(r)return{backgroundColor:r.bg,color:r.text};if(e.startsWith("#"))return{backgroundColor:`${e}33`,color:e};return{backgroundColor:"rgba(128, 128, 128, 0.1)",color:e}}function us(e=[]){let n=new Set(e.map((a)=>a.color?.toLowerCase()).filter(Boolean)),r=Vs.filter((a)=>!n.has(a.toLowerCase()));if(r.length>0)return r[Math.floor(Math.random()*r.length)];return Vs[Math.floor(Math.random()*Vs.length)]}var Ks={[Cr.text]:Si,[Cr.longText]:Xe,[Cr.select]:wo,[Cr.selectMulti]:qe,[Cr.rating]:Ne,[Cr.number]:Ye,[Cr.toggle]:Je,[Cr.date]:Pn,[Cr.user]:Ln,[Cr.userMulti]:Xn};function Fo({field:e,index:n,onVisibilityChange:r}){let{ref:a,handleRef:i}=Ai({id:e.id,index:n}),s=e.config?.type?Ks[e.config.type]:null;return o("div",{ref:a,className:"flex items-center justify-between p-2 rounded-md hover:bg-muted",children:[o("div",{className:"flex items-center gap-2",children:[t("div",{ref:i,className:"cursor-grab",children:t(ga,{className:"h-4 w-4 text-muted-foreground"})}),s&&t(s,{className:"h-4 w-4 text-muted-foreground shrink-0"}),e.config?.autofillSource===_r.CONTENT&&t(Yr,{className:"h-4 w-4 text-muted-foreground shrink-0"}),e.config?.autofillSource===_r.CREATION_CONTEXT&&t(bt,{className:"h-4 w-4 text-muted-foreground shrink-0"}),t("span",{className:"text-sm truncate",children:e.config?.name})]}),t(je,{checked:e.visible,onCheckedChange:(c)=>r(e.id,c)})]})}function Ip({projectId:e,onManageFields:n,onSave:r}){let{fields:a,updateFields:i}=Rr(),[s,c]=u(""),[l,m]=u("list"),[f,x]=u(""),[b,p]=u(""),[F,d]=u(_r.NONE),[M,H]=u(""),[P,y]=u([]),z=Q();h(()=>{z.invalidateQueries({queryKey:["fields",e]})},[e,z]);let w=A.api.projects[":projectId"].fields.order.$patch,{mutate:Z}=U({mutationFn:async(_)=>{if(!(await w(_)).ok)throw Error(af());return null}}),N=A.api.projects[":projectId"].fields.$post,{mutate:g}=U({mutationFn:async(_)=>{let X=await N(_);if(!X.ok)throw Error(of());return await X.json()},onSuccess:(_)=>{let X={..._,visible:!0},J=[...a,X];i(J),x(""),y([]),Z({param:{projectId:e},json:J.map((L)=>({fieldId:L.id,visible:L.visible||!1}))}),r?.()}}),k=O(()=>a.filter((_)=>_.config?.name?.toLowerCase().includes(s.toLowerCase())),[a,s]),j=(_)=>{if(_.canceled)return;let{source:X}=_.operation;if(!$n(X))return;let{initialIndex:J,index:L}=X;if(J===L)return;let W=zc(a,k,J,L);i(W),Z({param:{projectId:e},json:W.map((te)=>({fieldId:te.id,visible:te.visible||!1}))})},ee=(_,X)=>{let J=a.map((L)=>L.id===_?{...L,visible:X}:L);i(J),Z({param:{projectId:e},json:J.map((L)=>({fieldId:L.id,visible:L.visible||!1}))})},Y=()=>{if(!f||!b)return;let _=b===Cr.select?{select:{options:P}}:b===Cr.selectMulti?{selectMulti:{options:P}}:{};g({param:{projectId:e},json:{config:{name:f,type:b,autofillSource:F,..._},label:f,description:M}})},ne=a.filter((_)=>_.visible).length;if(l==="create")return t("div",{className:"w-80 p-4",children:o("div",{className:"space-y-4",children:[o("div",{className:"space-y-2",children:[t(G,{htmlFor:"field-name",children:lf()}),t(q,{id:"field-name",placeholder:Ew(),value:f,onChange:(_)=>x(_.target.value),autoFocus:!0})]}),o("div",{className:"space-y-2",children:[t(G,{children:cf()}),o(he,{children:[t(ge,{asChild:!0,children:o(S,{variant:"outline",className:"w-full justify-between font-normal",children:[b?t("span",{className:"capitalize",children:b.replace(/_/g," ")}):t("span",{className:"text-muted-foreground border-dashed",children:EC()}),t(_e,{className:"ml-2 h-4 w-4 opacity-50"})]})}),t(Ae,{className:"w-[--radix-dropdown-menu-trigger-width]",children:Object.values(Cr).map((_)=>t(V,{onClick:()=>{p(_),y([])},className:"capitalize",children:_.replace(/_/g," ")},_))})]})]}),o("div",{className:"space-y-2",children:[t(G,{htmlFor:"field-desc",children:Wi()}),t(q,{id:"field-desc",placeholder:Bu(),value:M,onChange:(_)=>H(_.target.value)})]}),o("div",{className:"space-y-2",children:[o("div",{className:"flex items-center gap-1",children:[t(G,{children:Zu()}),t(El,{})]}),o(go,{type:"single",value:F,onValueChange:(_)=>{if(_)d(_)},className:"w-full grid grid-cols-3 border rounded-md p-1 gap-1",children:[t(lr,{value:_r.NONE,className:"text-[11px] leading-tight py-1 px-1 h-auto min-h-[32px] w-full text-center justify-center whitespace-normal font-medium",children:uc()}),t(lr,{value:_r.CONTENT,className:"text-[11px] leading-tight py-1 px-1 h-auto min-h-[32px] w-full text-center justify-center whitespace-normal font-medium",children:lc()}),t(lr,{value:_r.CREATION_CONTEXT,className:"text-[11px] leading-tight py-1 px-1 h-auto min-h-[32px] w-full text-center justify-center whitespace-normal font-medium",children:cc()})]})]}),(b===Cr.select||b===Cr.selectMulti)&&o("div",{className:"space-y-2",children:[o("div",{className:"flex items-center justify-between",children:[t(G,{className:"text-sm font-medium",children:Ju()}),o(S,{variant:"ghost",size:"sm",className:"h-8 px-2",onClick:()=>{let _={id:Mo(),displayName:Ku(),color:us(P)};y([...P,_])},children:[t(de,{className:"h-4 w-4 mr-1"})," ",Pu()]})]}),t("div",{className:"space-y-2 max-h-40 overflow-y-auto pr-1",children:P.map((_,X)=>o("div",{className:"flex items-center gap-2",children:[t(q,{value:_.displayName,onChange:(J)=>{let L=[...P];L[X]={..._,displayName:J.target.value},y(L)},placeholder:Mf(),className:"h-8 flex-1"}),o(ht,{children:[t(gt,{asChild:!0,children:t("button",{type:"button",className:"w-6 h-6 rounded-full border shrink-0 cursor-pointer focus:outline-none hover:scale-105 transition-transform",style:{backgroundColor:cs[_.color||""]?.hex||_.color||"#808080"}})}),t(At,{className:"p-2 w-auto",align:"end",children:t("div",{className:"flex gap-1",children:Vs.map((J)=>t("button",{type:"button",className:"w-5 h-5 rounded-full border cursor-pointer hover:scale-110 transition-transform",style:{backgroundColor:cs[J]?.hex||J},onClick:()=>{let L=[...P];L[X]={..._,color:J},y(L)}},J))})})]}),t(S,{variant:"ghost",size:"icon",className:"h-8 w-8 shrink-0 text-destructive hover:text-destructive hover:bg-destructive/10",onClick:()=>{y(P.filter((J,L)=>L!==X))},children:t(Oe,{className:"h-4 w-4"})})]},_.id))})]}),o("div",{className:"flex gap-2 pt-2",children:[t(S,{variant:"secondary",className:"flex-1",onClick:()=>{m("list"),x(""),p(""),d(_r.NONE),H(""),y([])},children:Re()}),t(S,{className:"flex-1",onClick:Y,disabled:!f||!b,children:So()})]})]})});return o("div",{className:"w-80 p-4",children:[t("div",{className:"flex items-center justify-between mb-4",children:o("h3",{className:"font-semibold",children:[fi()," ",t("span",{className:"text-muted-foreground text-sm font-normal",children:wI({count:ne})})]})}),o("div",{className:"relative mb-4",children:[t(Lt,{className:"absolute left-2 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),t(q,{placeholder:AC(),value:s,onChange:(_)=>c(_.target.value),className:"pl-8"})]}),t("div",{className:"max-h-60 overflow-y-auto pr-2",children:t(Dn,{sensors:[nn.configure({activationConstraints:[new Ir.Distance({value:8})]}),Lo],onDragEnd:j,children:k.map((_,X)=>t(Fo,{field:_,index:X,onVisibilityChange:ee},_.id))})}),n&&o("div",{className:"mt-4 space-y-2",children:[o(S,{variant:"secondary",className:"w-full",onClick:n,children:[t(Ca,{className:"h-4 w-4 mr-2"}),hf()]}),o(S,{className:"w-full",onClick:()=>m("create"),children:[t(de,{className:"h-4 w-4 mr-2"}),Cw()]})]})]})}var Ro=({value:e,config:n,onSave:r,readOnly:a,fieldId:i})=>{let s=n?.select,c=s?.options||[],[l,m]=u(!1),[f,x]=u(""),b=c.find((w)=>w.id===e),p=f.trim(),F=c.filter((w)=>w.displayName.toLowerCase().includes(p.toLowerCase())),d=c.some((w)=>w.displayName.trim().toLowerCase()===p.toLowerCase()||w.id.toLowerCase()===p.toLowerCase()),M=()=>{if(!a)m(!0)},H=(w)=>{r(w),m(!1),x("")},P=(w)=>{if(a)return;if(m(w),!w)x("")},y=async()=>{if(!p)return;let w={id:p.toLowerCase().replace(/\s+/g,"-"),displayName:p,color:us(c)},Z=[...c,w],N={...n,select:{...s,options:Z}};if(i)try{let g=await A.api.fields[":fieldId"].$put({param:{fieldId:i},json:{config:N}});if(!g.ok){R.error(Ji());return}let k=await g.json(),ee=Rr.getState().fields.map((Y)=>Y.id===k.id?{...Y,...k,visible:Y.visible}:Y);Rr.getState().updateFields(ee)}catch{R.error(Ji());return}r(w.id),x(""),m(!1)};return t("div",{className:"relative w-full",onClick:(w)=>w.stopPropagation(),children:o(ht,{open:!a&&l,onOpenChange:P,children:[t(gt,{asChild:!0,children:o("div",{onClick:M,className:`flex items-center justify-between w-full h-[28px] px-2 rounded border border-transparent transition-colors ${!a?"cursor-pointer hover:bg-accent hover:border-border group":""}`,children:[((w)=>{if(!w)return t("span",{className:"text-muted-foreground italic text-sm",children:"Select an option"});return t("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium h-[22px]",style:ta(w.color),children:w.displayName})})(b),!a&&t(_e,{className:"w-4 h-4 text-muted-foreground opacity-0 group-hover:opacity-100"})]})}),o(At,{side:"bottom",align:"start",sideOffset:4,className:"p-1.5 w-64 max-h-72 flex flex-col bg-popover border border-border rounded-lg shadow-lg",children:[o("div",{className:"relative pb-1.5 border-b border-border mb-1",onClick:(w)=>w.stopPropagation(),children:[t(Lt,{className:"w-3.5 h-3.5 absolute left-2 top-2 text-muted-foreground"}),t("input",{type:"text",className:"w-full pl-7 pr-2 py-1 text-xs bg-muted/50 border border-input rounded-md focus:outline-none focus:ring-1 focus:ring-ring text-foreground",placeholder:eg(),value:f,onChange:(w)=>x(w.target.value),autoFocus:!0})]}),o("div",{className:"overflow-y-auto max-h-48 min-h-[120px] space-y-0.5",children:[f===""&&o("div",{onClick:()=>H(""),className:"px-2.5 py-1.5 text-xs text-muted-foreground hover:bg-accent hover:text-accent-foreground rounded cursor-pointer flex items-center gap-2",children:[t(Oe,{className:"w-3.5 h-3.5"})," Clear"]}),F.map((w)=>t("div",{onClick:()=>H(w.id),className:`px-2.5 py-1.5 text-xs hover:bg-accent rounded cursor-pointer flex items-center justify-between ${e===w.id?"bg-accent/50 font-medium":""}`,children:t("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium",style:ta(w.color),children:w.displayName})},w.id)),F.length===0&&!p&&t("div",{className:"px-2.5 py-2 text-xs text-muted-foreground italic text-center",children:yh()}),p!==""&&!d&&o("div",{onClick:y,className:"px-2.5 py-1.5 text-xs text-primary hover:bg-accent rounded cursor-pointer flex items-center gap-1.5 font-medium border-t border-border mt-1 pt-1.5",children:[t(de,{className:"w-3.5 h-3.5 shrink-0"}),t("span",{className:"truncate",children:$p({name:p})})]})]})]})]})})},_t=Ro;C();var ko=({value:e=[],config:n,onSave:r,readOnly:a,fieldId:i})=>{let s=n?.selectMulti,c=s?.options||[],l=v(null),[m,f]=u(!1),[x,b]=u(e.length),[p,F]=u(""),d=c.filter((g)=>(e||[]).includes(g.id))||[],M=p.trim(),H=c.filter((g)=>g.displayName.toLowerCase().includes(M.toLowerCase())),P=c.some((g)=>g.displayName.trim().toLowerCase()===M.toLowerCase()||g.id.toLowerCase()===M.toLowerCase());He(()=>{if(m){b(d.length);return}if(l.current){let g=l.current.clientWidth-8,j=document.createElement("canvas").getContext("2d");if(j&&g>0){j.font="500 12px ui-sans-serif, system-ui, sans-serif";let ee=4,Y=d.map((W)=>Math.ceil(j.measureText(W.displayName).width)+18);if(Y.reduce((W,te)=>W+te,0)+Math.max(0,Y.length-1)*ee<=g){b(d.length);return}let X=g-32-ee,J=0,L=0;for(let W=0;W<Y.length;W++){let te=L>0?J+ee+Y[W]:Y[W];if(te>X)break;J=te,L++}b(L)}}},[d,m,e]);let y=(g)=>{let k=e||[],j;if(k.includes(g))j=k.filter((ee)=>ee!==g);else j=[...k,g];r(j)},z=async()=>{if(!M)return;let g={id:M.toLowerCase().replace(/\s+/g,"-"),displayName:M,color:us(c)},k=[...c,g],j={...n,selectMulti:{...s,options:k}};if(i)try{let ee=await A.api.fields[":fieldId"].$put({param:{fieldId:i},json:{config:j}});if(!ee.ok){R.error(Ji());return}let Y=await ee.json(),_=Rr.getState().fields.map((X)=>X.id===Y.id?{...X,...Y,visible:X.visible}:X);Rr.getState().updateFields(_)}catch{R.error(Ji());return}r([...e||[],g.id]),F("")},w=(g)=>{if(g.stopPropagation(),!a)f(!0)},Z=d.length-x;return t("div",{className:"relative w-full",onClick:(g)=>g.stopPropagation(),children:o(ht,{open:!a&&m,onOpenChange:(g)=>{if(a)return;if(f(g),!g)F("")},children:[t(gt,{asChild:!0,children:o("div",{ref:l,onClick:w,className:`w-full px-1 py-1 flex flex-wrap gap-1 rounded border border-transparent transition-all box-border h-[32px] overflow-hidden ${!a||Z>0?"cursor-pointer hover:bg-accent hover:border-border":""}`,children:[d.length===0&&t("span",{className:"text-muted-foreground text-sm italic px-1 pt-0.5",children:"Empty"}),d.slice(0,x).map((g)=>t("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium border border-transparent whitespace-nowrap h-[22px]",style:ta(g.color),children:g.displayName},g.id)),Z>0&&o("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded-full text-xs font-medium bg-muted text-muted-foreground h-[22px]",children:["+",Z]})]})}),o(At,{side:"bottom",align:"start",sideOffset:4,className:"p-1.5 w-64 max-h-72 flex flex-col bg-popover border border-border rounded-lg shadow-lg",children:[o("div",{className:"relative pb-1.5 border-b border-border mb-1",onClick:(g)=>g.stopPropagation(),children:[t(Lt,{className:"w-3.5 h-3.5 absolute left-2 top-2 text-muted-foreground"}),t("input",{type:"text",className:"w-full pl-7 pr-2 py-1 text-xs bg-muted/50 border border-input rounded-md focus:outline-none focus:ring-1 focus:ring-ring text-foreground",placeholder:eg(),value:p,onChange:(g)=>F(g.target.value),autoFocus:!0})]}),o("div",{className:"overflow-y-auto max-h-48 min-h-[120px] space-y-0.5",children:[H.map((g)=>{let k=(e||[]).includes(g.id);return o("div",{onClick:()=>y(g.id),className:`px-2.5 py-1.5 hover:bg-accent rounded cursor-pointer flex items-center justify-between text-xs ${k?"bg-accent/30 font-medium":""}`,children:[t("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium",style:ta(g.color),children:g.displayName}),k&&t(Te,{className:"w-3.5 h-3.5 text-primary"})]},g.id)}),H.length===0&&!M&&t("div",{className:"px-2.5 py-2 text-xs text-muted-foreground italic text-center",children:yh()}),M!==""&&!P&&o("div",{onClick:z,className:"px-2.5 py-1.5 text-xs text-primary hover:bg-accent rounded cursor-pointer flex items-center gap-1.5 font-medium border-t border-border mt-1 pt-1.5",children:[t(de,{className:"w-3.5 h-3.5 shrink-0"}),t("span",{className:"truncate",children:$p({name:M})})]})]})]})]})})},Ft=ko;C();var Io=({value:e,onSave:n,readOnly:r})=>{let[a,i]=u(!1),[s,c]=u(e||""),l=v(null);h(()=>{c(e||"")},[e]),h(()=>{if(a&&l.current)l.current.focus()},[a]);let m=()=>{if(!r)i(!0)},f=()=>{i(!1),n(s)},x=(b)=>{if(b.key==="Enter")l.current?.blur()};if(a)return t("input",{ref:l,type:"text",value:s,onChange:(b)=>c(b.target.value),onBlur:f,onKeyDown:x,className:"w-full px-2 py-1 border border-ring rounded bg-background text-sm outline-none shadow-sm"});return t("div",{onClick:m,className:`w-full min-h-[28px] px-2 py-1 text-sm text-foreground rounded truncate border border-transparent transition-colors ${!r?"cursor-pointer hover:bg-accent hover:border-border":""}`,children:e||t("span",{className:"text-muted-foreground italic",children:"Empty"})})},Mt=Io;var Do=({value:e,onSave:n,readOnly:r})=>t("div",{className:"flex items-center h-[28px] w-full",onClick:(i)=>i.stopPropagation(),children:t(je,{checked:e,onCheckedChange:(i)=>{if(!r)n(i)},disabled:r,className:"cursor-pointer"})}),Rt=Do;C();var Po=({value:e,onSave:n,readOnly:r})=>{let a=Vo(),{members:i,fetchMembers:s}=Dr(),[c,l]=u(!1);h(()=>{if(a)s(a)},[a,s]);let m=i.find((d)=>d.id===e),f=()=>{if(!r)l(!0)},x=(d)=>{n(d),l(!1)},b=(d)=>{if(r)return;l(d)},p=(d)=>d.split(" ").map((M)=>M[0]).slice(0,2).join("").toUpperCase();return t("div",{className:"relative w-full",onClick:(d)=>d.stopPropagation(),children:o(ht,{open:!r&&c,onOpenChange:b,children:[t(gt,{asChild:!0,children:o("div",{onClick:f,className:`flex items-center justify-between w-full h-[28px] px-2 rounded border border-transparent transition-colors ${!r?"cursor-pointer hover:bg-accent hover:border-border group":""}`,children:[((d)=>{if(!d)return t("span",{className:"text-muted-foreground italic text-sm",children:"Select user"});return o("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 rounded-full text-xs font-medium bg-muted text-foreground border h-[22px]",children:[o(Ce,{className:"w-4 h-4",children:[t(Ee,{src:d.image,alt:d.name,className:"object-cover"}),t(Ie,{className:"text-[8px] bg-rose-400 text-black font-semibold",children:p(d.name)})]}),t("span",{className:"truncate max-w-[120px]",children:d.name})]})})(m),!r&&t(_e,{className:"w-4 h-4 text-muted-foreground opacity-0 group-hover:opacity-100"})]})}),o(At,{className:"p-1 w-[--radix-popover-trigger-width] min-w-[200px] max-h-60 overflow-auto bg-popover border border-border rounded-lg shadow-lg",align:"start",children:[o("div",{onClick:()=>x(""),className:"px-3 py-2 text-sm text-muted-foreground hover:bg-accent cursor-pointer flex items-center gap-2 rounded-sm",children:[t(Oe,{className:"w-3 h-3"})," Clear"]}),i.map((d)=>o("div",{onClick:()=>x(d.id),className:"px-3 py-2 hover:bg-accent cursor-pointer flex items-center gap-2 rounded-sm",children:[o(Ce,{className:"w-5 h-5",children:[t(Ee,{src:d.image,alt:d.name,className:"object-cover"}),t(Ie,{className:"text-[10px] bg-rose-400 text-black font-semibold",children:p(d.name)})]}),t("span",{className:"text-sm font-medium text-foreground",children:d.name})]},d.id))]})]})})},kt=Po;C();var Ao=({value:e=[],onSave:n,readOnly:r})=>{let a=Vo(),{members:i,fetchMembers:s}=Dr(),c=v(null),[l,m]=u(!1),[f,x]=u(e.length);h(()=>{if(a)s(a)},[a,s]);let b=i.filter((y)=>(e||[]).includes(y.id)),p=(y)=>y.split(" ").map((z)=>z[0]).slice(0,2).join("").toUpperCase();He(()=>{if(l){x(b.length);return}if(c.current){let y=c.current.clientWidth-8,w=document.createElement("canvas").getContext("2d");if(w&&y>0){w.font="500 12px ui-sans-serif, system-ui, sans-serif";let Z=4,N=b.map((ne)=>Math.min(100,Math.ceil(w.measureText(ne.name).width))+40);if(N.reduce((ne,_)=>ne+_,0)+Math.max(0,N.length-1)*Z<=y){x(b.length);return}let j=y-32-Z,ee=0,Y=0;for(let ne=0;ne<N.length;ne++){let _=Y>0?ee+Z+N[ne]:N[ne];if(_>j)break;ee=_,Y++}x(Y)}}},[b,l,e]);let F=(y)=>{let z=e||[],w;if(z.includes(y))w=z.filter((Z)=>Z!==y);else w=[...z,y];n(w)},d=(y)=>{if(y.stopPropagation(),!r)m(!0)},M=b.length-f,H=(y)=>{if(r)return;m(y)},P=(y)=>o("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 rounded-full text-xs font-medium bg-muted text-foreground border whitespace-nowrap h-[22px]",children:[o(Ce,{className:"w-4 h-4",children:[t(Ee,{src:y.image,alt:y.name,className:"object-cover"}),t(Ie,{className:"text-[8px] bg-rose-400 text-black font-semibold",children:p(y.name)})]}),t("span",{className:"truncate max-w-[100px]",children:y.name})]},y.id);return t("div",{className:"relative w-full",onClick:(y)=>y.stopPropagation(),children:o(ht,{open:!r&&l,onOpenChange:H,children:[t(gt,{asChild:!0,children:o("div",{ref:c,onClick:d,className:`w-full px-1 py-1 flex flex-wrap gap-1 rounded border border-transparent transition-all box-border h-[32px] overflow-hidden ${!r||M>0?"cursor-pointer hover:bg-accent hover:border-border":""}`,children:[b.length===0&&t("span",{className:"text-muted-foreground text-sm italic px-1 pt-0.5",children:"Empty"}),b.slice(0,f).map(P),M>0&&o("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded-full text-xs font-medium bg-muted text-muted-foreground h-[22px]",children:["+",M]})]})}),t(At,{className:"p-1 w-[--radix-popover-trigger-width] min-w-[200px] max-h-60 overflow-auto bg-popover border border-border rounded-lg shadow-lg",align:"start",children:i.map((y)=>{let z=(e||[]).includes(y.id);return o("div",{onClick:()=>F(y.id),className:"px-3 py-2 hover:bg-accent cursor-pointer flex items-center justify-between rounded-sm",children:[o("div",{className:"flex items-center gap-2",children:[o(Ce,{className:"w-5 h-5",children:[t(Ee,{src:y.image,alt:y.name,className:"object-cover"}),t(Ie,{className:"text-[10px] bg-rose-400 text-black font-semibold",children:p(y.name)})]}),t("span",{className:"text-sm font-medium text-foreground",children:y.name})]}),z&&t(Te,{className:"w-4 h-4 text-primary"})]},y.id)})})]})})},Tt=Ao;var Oo=(e)=>{if(!e.config)return t("div",{children:"Unknown Field Type"});switch(e.config.type){case"text":return t(Mt,{...e,value:e.value,onSave:e.onSave});case"longText":return t(tt,{...e,value:e.value,onSave:e.onSave});case"select":return t(_t,{...e,value:e.value,onSave:e.onSave});case"selectMulti":return t(Ft,{...e,value:e.value,onSave:e.onSave});case"rating":return t(Fc,{...e,value:e.value,onSave:e.onSave});case"number":return t(ot,{...e,value:e.value,onSave:e.onSave});case"toggle":return t(Rt,{...e,value:e.value,onSave:e.onSave});case"date":return t(et,{...e,value:e.value,onSave:e.onSave});case"user":return t(kt,{...e,value:e.value,onSave:e.onSave});case"userMulti":return t(Tt,{...e,value:e.value,onSave:e.onSave});default:return t("div",{children:"Unknown Field Type"})}},ra=Oo;C();function Ea({className:e,defaultValue:n,value:r,min:a=0,max:i=100,...s}){let c=O(()=>Array.isArray(r)?r:Array.isArray(n)?n:[a,i],[r,n,a,i]);return o(oo,{"data-slot":"slider",defaultValue:n,value:r,min:a,max:i,className:E("relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",e),...s,children:[t(io,{"data-slot":"slider-track",className:E("relative grow overflow-hidden rounded-full bg-muted data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"),children:t(so,{"data-slot":"slider-range",className:E("absolute bg-primary data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full")})}),Array.from({length:c.length},(l,m)=>t(fo,{"data-slot":"slider-thumb",className:"block size-4 shrink-0 rounded-full border border-primary bg-white shadow-sm ring-ring/50 transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"},m))]})}
2
- export{To,Ca,Si,zc,Ci,Rr,Mo,ea,Fc,El,Vs,cs,ta,us,Ks,Ip,ra,Ea};
@@ -1 +0,0 @@
1
- import{h,O,u,C,B,t,o,Q,L,U,ct,Ue,A,T,or,Z,Fr,bt,Pn,jr,ft,ii,Xt,Aa,lo,de,co,ve,Oe,E,S,Ce,Ee,Ie,he,ge,Ae,V,fm,gm,Re,Dy,Fy,fc,g0,A0,Yd,at,H0,G0,t_,r_,Uu,f_,Pm,An,kb,Pb,Nb,Ob,Db,Zb,Lb,Gu,cv,mw,dh,Uw,Yw,Sh,Gh,va,ld,Kf,cd,fg,np,TE,ME,pg,mg,hg,gg,Ag,dd,yg,OE,Wo,We,Ye,Je,Xe,et,tt,rt,nt,fe,ce,pe,qe,ue,It,q,se,Lo,Ir,nn,Dn,Jo,Tr,md,Tt,R,we,ir,Ge,Or,Ja,Rg,Vn,gp,zs,Fs,Xa,G,je,De,Ze,Le,Be,re,es,yd,_d,bd,wd}from"./chunk-6bhn1p8v.js";import{bi}from"./chunk-pb1zf0vb.js";import{Yr}from"./chunk-m7m9d4fb.js";import{Ln,Xn}from"./chunk-2yxj593j.js";C();var it=[["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"}]],Ne=T("pen",it);function Te({scope:e,onScopeChange:r,selectedGoal:x,onClearGoal:p,onCreateTask:w,canCreateTask:v=!0}){return o("header",{className:"h-14 border-b border-border bg-card/60 backdrop-blur-sm px-4 flex items-center justify-between gap-3 shrink-0 select-none",children:[o("div",{className:"flex items-center gap-3 min-w-0",children:[o("div",{className:"flex items-center bg-muted/60 p-0.5 rounded-lg border border-border/50",children:[o(S,{variant:e==="team"?"secondary":"ghost",size:"sm",onClick:()=>r("team"),className:`h-7 px-2.5 text-xs font-medium gap-1.5 transition-all ${e==="team"?"bg-background text-foreground shadow-xs":"text-muted-foreground hover:text-foreground"}`,children:[t(Xn,{className:"w-3.5 h-3.5"}),t("span",{children:OE()})]}),o(S,{variant:e==="my"?"secondary":"ghost",size:"sm",onClick:()=>r("my"),className:`h-7 px-2.5 text-xs font-medium gap-1.5 transition-all ${e==="my"?"bg-background text-foreground shadow-xs":"text-muted-foreground hover:text-foreground"}`,children:[t(Ln,{className:"w-3.5 h-3.5"}),t("span",{children:mw()})]})]}),x&&o("div",{className:"hidden sm:flex items-center gap-1.5 px-2 py-1 rounded-md bg-sidebar-accent border border-sidebar-border text-xs text-sidebar-accent-foreground min-w-0 max-w-[200px] md:max-w-[280px]",children:[t(co,{className:"w-3.5 h-3.5 text-sidebar-primary shrink-0"}),t("span",{className:"truncate font-medium",children:x.id===Ja?Wo():x.title}),t(S,{variant:"ghost",size:"icon-xs",onClick:p,className:"h-4 w-4 p-0 ml-0.5 text-muted-foreground hover:text-foreground",title:Fy(),children:t(Oe,{className:"w-3 h-3"})})]})]}),v&&t("div",{className:"flex items-center gap-2 shrink-0",children:o(S,{size:"sm",onClick:w,className:"h-8 px-3 text-xs gap-1.5 shadow-xs",children:[t(de,{className:"w-3.5 h-3.5"}),t("span",{children:Yd()})]})})]})}C();C();function me({teamId:e,isOpen:r,onClose:x,goalToEdit:p}){let w=Q(),[v,I]=u(""),[g,K]=u("");h(()=>{if(p)I(p.title),K(p.description||"");else I(""),K("")},[p,r]);let{mutate:P,isPending:M}=U({mutationFn:async()=>{let n=await A.api.teams[":teamId"].kanban.goals.$post({param:{teamId:e},json:{title:v.trim(),description:g.trim()||void 0}});if(!n.ok){let b=await n.json().catch(()=>({message:An()}));throw Error(b.message||An())}return await n.json()},onSuccess:()=>{w.invalidateQueries({queryKey:["teams",e,"kanban","goals"]}),R.success(kb()),x()},onError:(n)=>{R.error(n.message)}}),{mutate:j,isPending:_}=U({mutationFn:async()=>{if(!p)return;let n=await A.api.teams[":teamId"].kanban.goals[":goalId"].$patch({param:{teamId:e,goalId:p.id},json:{title:v.trim(),description:g.trim()||null}});if(!n.ok){let b=await n.json().catch(()=>({message:An()}));throw Error(b.message||An())}return await n.json()},onSuccess:()=>{w.invalidateQueries({queryKey:["teams",e,"kanban","goals"]}),R.success(Lb()),x()},onError:(n)=>{R.error(n.message)}}),H=(n)=>{if(n.preventDefault(),!v.trim())return;if(p)j();else P()},d=M||_;return t(fe,{open:r,onOpenChange:(n)=>!n&&x(),children:t(ce,{className:"sm:max-w-xl",children:o("form",{onSubmit:H,className:"space-y-4",children:[o(pe,{children:[t(ue,{children:p?Pm():A0()}),t(It,{children:p?Pm():g0()})]}),o("div",{className:"space-y-3 py-2",children:[o("div",{className:"space-y-1.5",children:[t(G,{htmlFor:"goal-title",children:Db()}),t(q,{id:"goal-title",value:v,onChange:(n)=>I(n.target.value),placeholder:Zb(),required:!0,autoFocus:!0})]}),o("div",{className:"space-y-1.5",children:[t(G,{htmlFor:"goal-description",children:Nb()}),t(Xa,{id:"goal-description",value:g,onChange:(n)=>K(n.target.value),placeholder:Ob(),rows:3})]})]}),o(qe,{children:[t(S,{type:"button",variant:"outline",onClick:x,disabled:d,children:Re()}),o(S,{type:"submit",disabled:!v.trim()||d,children:[d&&t(Z,{className:"w-4 h-4 mr-1.5 animate-spin"}),p?va():fc()]})]})]})})})}function Se({teamId:e,selectedGoalId:r,onSelectGoal:x,isOwnerOrEditor:p=!0}){let w=Q(),[v,I]=u(!1),[g,K]=u(null),[P,M]=u(null),[j,_]=u(!1),{data:H,isLoading:d}=L({queryKey:["teams",e,"kanban","goals"],queryFn:async()=>{let i=await A.api.teams[":teamId"].kanban.goals.$get({param:{teamId:e},query:{}});if(!i.ok)throw Error("Failed to fetch goals");return await i.json()},enabled:!!e}),n=H?.data||[],b=n.reduce((i,s)=>i+(s.taskCount||0),0),{mutate:N,isPending:l}=U({mutationFn:async(i)=>{let s=await A.api.teams[":teamId"].kanban.goals[":goalId"].$delete({param:{teamId:e,goalId:i}});if(!s.ok){let m=await s.json().catch(()=>({message:An()}));throw Error(m.message||An())}return await s.json()},onSuccess:(i,s)=>{if(w.invalidateQueries({queryKey:["teams",e,"kanban","goals"]}),w.invalidateQueries({queryKey:["teams",e,"kanban","tasks"]}),R.success(Pb()),r===s)x(null);M(null)},onError:(i)=>{R.error(i.message)}});if(j)return o("div",{className:"border-r border-sidebar-border bg-sidebar flex flex-col items-center w-12 shrink-0 transition-all duration-300",children:[t("div",{className:"h-14 flex items-center justify-center border-b border-sidebar-border w-full shrink-0",children:t(S,{variant:"ghost",size:"icon-sm",onClick:()=>_(!1),title:Gu(),className:"text-sidebar-foreground/70 hover:text-sidebar-foreground",children:t(ft,{className:"w-4 h-4"})})}),o("div",{className:"mt-3 flex flex-col items-center gap-2",children:[t(S,{variant:r===null?"secondary":"ghost",size:"icon-sm",onClick:()=>x(null),title:fm(),className:E("w-8 h-8 rounded-md",r===null&&"bg-sidebar-accent text-sidebar-accent-foreground"),children:t(bi,{className:"w-4 h-4"})}),t(S,{variant:"ghost",size:"icon-sm",onClick:()=>I(!0),title:dh(),className:"w-8 h-8 rounded-md text-sidebar-foreground/70 hover:text-sidebar-foreground",children:t(de,{className:"w-4 h-4"})})]}),v&&t(me,{teamId:e,isOpen:v,onClose:()=>I(!1)})]});return o("aside",{className:"w-64 border-r border-sidebar-border bg-sidebar flex flex-col shrink-0 transition-all duration-300 select-none",children:[o("div",{className:"h-14 px-3 flex items-center justify-between border-b border-sidebar-border shrink-0",children:[o("div",{className:"flex items-center gap-2 font-semibold text-xs tracking-wider uppercase text-sidebar-foreground/70",children:[t(co,{className:"w-4 h-4 text-sidebar-primary"}),t("span",{children:Gu()})]}),o("div",{className:"flex items-center gap-1",children:[p&&t(S,{variant:"ghost",size:"icon-sm",onClick:()=>I(!0),className:"h-7 w-7 text-sidebar-foreground/70 hover:text-sidebar-foreground",title:dh(),children:t(de,{className:"w-4 h-4"})}),t(S,{variant:"ghost",size:"icon-sm",onClick:()=>_(!0),className:"h-7 w-7 text-sidebar-foreground/70 hover:text-sidebar-foreground",title:"Collapse",children:t(jr,{className:"w-4 h-4"})})]})]}),t(se,{className:"flex-1 p-2",children:o("div",{className:"space-y-1",children:[o("div",{onClick:()=>x(null),className:E("flex items-center justify-between px-2.5 py-1 rounded-md text-xs font-medium cursor-pointer transition-colors group h-8 min-h-[32px]",r===null?"bg-sidebar-accent text-sidebar-accent-foreground font-semibold shadow-xs":"text-sidebar-foreground/70 hover:bg-sidebar-accent/50 hover:text-sidebar-foreground"),children:[o("div",{className:"flex items-center gap-2 truncate min-w-0",children:[t(bi,{className:"w-3.5 h-3.5 shrink-0 text-sidebar-primary"}),t("span",{className:"truncate",children:fm()})]}),b>0&&t("span",{className:"text-[10px] font-mono px-1.5 py-0.5 rounded-full bg-sidebar-border text-sidebar-foreground/60 shrink-0",children:b})]}),d?t("div",{className:"flex items-center justify-center p-4",children:t(Z,{className:"w-4 h-4 animate-spin text-muted-foreground"})}):n.length===0?t("div",{className:"px-2.5 py-4 text-center text-xs text-muted-foreground",children:Uw()}):n.map((i)=>{let s=r===i.id,m=i.id===Ja,k=m?Wo():i.title,f=p&&!m;return o("div",{onClick:()=>x(i.id),className:E("flex items-center justify-between px-2.5 py-1 rounded-md text-xs font-medium cursor-pointer transition-colors group relative min-h-[32px]",s?"bg-sidebar-accent text-sidebar-accent-foreground font-semibold shadow-xs":"text-sidebar-foreground/70 hover:bg-sidebar-accent/50 hover:text-sidebar-foreground"),children:[o("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[t(co,{className:E("w-3.5 h-3.5 shrink-0",s?"text-sidebar-primary":"text-muted-foreground")}),t("span",{className:"line-clamp-2 break-words leading-tight",title:k,children:k})]}),t("div",{className:"flex items-center shrink-0 ml-1",children:f?o(B,{children:[(i.taskCount??0)>0&&t("span",{className:"text-[10px] font-mono px-1.5 py-0.5 rounded-full bg-sidebar-border text-sidebar-foreground/60 group-hover:hidden group-focus-within:hidden [&:has(~_div_[data-state=open])]:hidden",children:i.taskCount}),t("div",{className:"hidden group-hover:flex group-focus-within:flex [&:has([data-state=open])]:flex items-center",onClick:(c)=>c.stopPropagation(),children:o(he,{modal:!1,children:[t(ge,{asChild:!0,children:t(S,{variant:"ghost",size:"icon-xs",className:"h-6 w-6 p-0 text-muted-foreground hover:text-foreground",children:t(or,{className:"w-3.5 h-3.5"})})}),o(Ae,{align:"end",className:"w-36",children:[o(V,{onClick:()=>{K(i)},children:[t(Ne,{className:"w-3.5 h-3.5 mr-2"}),f_()]}),o(V,{className:"text-destructive focus:text-destructive focus:bg-destructive/10",onClick:()=>{M(i)},children:[t(ve,{className:"w-3.5 h-3.5 mr-2"}),at()]})]})]})})]}):(i.taskCount??0)>0&&t("span",{className:"text-[10px] font-mono px-1.5 py-0.5 rounded-full bg-sidebar-border text-sidebar-foreground/60",children:i.taskCount})})]},i.id)})]})}),(v||g)&&t(me,{teamId:e,isOpen:v||!!g,goalToEdit:g,onClose:()=>{I(!1),K(null)}}),P&&t(We,{open:!!P,onOpenChange:(i)=>!i&&M(null),children:o(Ye,{children:[o(Je,{children:[t(et,{children:H0()}),t(tt,{children:G0({title:P.title})})]}),o(Xe,{children:[t(nt,{disabled:l,children:Re()}),o(rt,{onClick:()=>N(P.id),disabled:l,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:[l&&t(Z,{className:"w-4 h-4 mr-1.5 animate-spin"}),at()]})]})]})})]})}C();C();function Ke(e){return+we(e)<Date.now()}function _e({task:e,onClick:r,onDelete:x,disabled:p,isFirst:w,isLast:v,showBottomIndicator:I,currentUserId:g,currentUserRole:K}){let{source:P}=md(),M=!!P,j=K?.toLowerCase()==="owner",_=K?.toLowerCase()==="editor",H=!!g&&e.creator?.id===g,d=e.reporter?.id===g||H,n=e.assignee?.id===g,b=j||_||d||n,N=H||j||d,l=p||!b,{ref:i,isDragging:s}=Jo({id:e.id,data:{type:"kanban_task",task:e},disabled:l}),{ref:m,isDropTarget:k}=Tr({id:`reorder-before-${e.id}`,data:{type:"reorder",task:e,position:"before"},disabled:s||p}),{ref:f,isDropTarget:c}=Tr({id:`reorder-after-${e.id}`,data:{type:"reorder",task:e,position:"after"},disabled:s||p}),D=e.isAgentTask,F=e.status===Ge.BLOCKED,y=e.dueDate?Ke(new Date(e.dueDate))&&e.status!==Ge.DONE:!1;return o("div",{className:"relative",children:[t("div",{ref:m,className:E("absolute left-0 right-0 z-20",w?"-top-6 h-[calc(50%+24px)]":"-top-1 h-[calc(50%+4px)]",M&&!s?"pointer-events-auto":"pointer-events-none")}),t("div",{ref:f,className:E("absolute bottom-0 left-0 right-0 z-20",v?"-bottom-6 h-[calc(50%+24px)]":"h-1/2",M&&!s?"pointer-events-auto":"pointer-events-none")}),k&&!s&&t("div",{className:"absolute -top-1.5 left-0 right-0 h-[3px] rounded-full bg-primary shadow-[0_0_8px_rgba(var(--primary),0.6)] z-30 pointer-events-none"}),(c||I)&&!s&&t("div",{className:"absolute -bottom-1.5 left-0 right-0 h-[3px] rounded-full bg-primary shadow-[0_0_8px_rgba(var(--primary),0.6)] z-30 pointer-events-none"}),o("div",{ref:i,onClick:()=>r(e),className:E("group relative flex flex-col gap-2 p-3 rounded-lg border text-card-foreground transition-all duration-200 cursor-pointer select-none",s&&"opacity-40 scale-95 shadow-lg ring-2 ring-primary",!s&&"hover:shadow-md","border-border/80 bg-card hover:border-primary/50 shadow-2xs",F&&"border-red-500/60 bg-red-500/[0.03] ring-1 ring-red-500/20"),children:[o("div",{className:"flex items-center justify-between gap-1.5 min-w-0",children:[o("div",{className:"flex items-center gap-1.5 min-w-0 flex-1",children:[t("span",{className:E("px-1.5 py-0.5 rounded text-[10px] font-medium border uppercase tracking-wider shrink-0",Fs(e.priority)),children:zs(e.priority)}),D&&o("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] font-semibold bg-orange-500/15 text-orange-600 dark:text-orange-400 border border-orange-500/30 shrink-0",children:[t(bt,{className:"w-3 h-3"}),t("span",{children:dd()})]}),e.goal&&o("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] font-medium bg-muted text-muted-foreground border border-border/70 truncate max-w-[130px]",children:[t(co,{className:"w-2.5 h-2.5 shrink-0"}),t("span",{className:"truncate",children:e.goal.title})]})]}),t("div",{className:"flex items-center gap-1 shrink-0",children:N&&t("div",{className:"opacity-0 group-hover:opacity-100 [&:has([data-state=open])]:opacity-100 focus-within:opacity-100 transition-opacity flex items-center",onClick:(X)=>X.stopPropagation(),children:o(he,{modal:!1,children:[t(ge,{asChild:!0,children:t(S,{variant:"ghost",size:"icon-xs",className:"h-5 w-5 p-0 text-muted-foreground hover:text-foreground",children:t(or,{className:"w-3.5 h-3.5"})})}),t(Ae,{align:"end",className:"w-32",children:o(V,{className:"text-destructive focus:text-destructive focus:bg-destructive/10",onClick:()=>x?.(e),children:[t(ve,{className:"w-3.5 h-3.5 mr-2"}),at()]})})]})})})]}),t("h4",{className:"text-xs font-semibold leading-snug line-clamp-2 text-foreground break-words",children:e.title}),F&&o("div",{className:"flex items-start gap-1.5 p-1.5 rounded bg-red-500/10 border border-red-500/20 text-[11px] text-red-600 dark:text-red-400",children:[t(Fr,{className:"w-3.5 h-3.5 shrink-0 mt-0.5"}),t("span",{className:"line-clamp-2 break-words",children:e.latestStatusEvent?.blockReason||e.latestStatusEvent?.reason||e.latestStatusEvent?.summary||fg()})]}),e.status===Ge.IN_REVIEW&&e.latestStatusEvent?.summary&&o("div",{className:"flex items-start gap-1.5 p-1.5 rounded bg-purple-500/10 border border-purple-500/20 text-[11px] text-purple-600 dark:text-purple-400",children:[t(Yr,{className:"w-3.5 h-3.5 shrink-0 mt-0.5"}),t("span",{className:"line-clamp-2 break-words",children:e.latestStatusEvent.summary})]}),o("div",{className:"flex items-center justify-between gap-2 pt-1 mt-auto border-t border-border/40 text-[11px] text-muted-foreground",children:[t("div",{className:"flex items-center gap-1.5 min-w-0",children:e.assignee?o(B,{children:[D?t("div",{className:"w-5 h-5 rounded-full bg-orange-500/15 border border-orange-500/30 flex items-center justify-center shrink-0",children:t(bt,{className:"w-3 h-3 text-orange-600 dark:text-orange-400"})}):o(Ce,{size:"sm",className:"w-5 h-5 border border-border",children:[t(Ee,{src:e.assignee.image}),t(Ie,{className:"text-[9px]",children:e.assignee.name.slice(0,2).toUpperCase()})]}),t("span",{className:"truncate text-xs font-medium text-foreground/80 max-w-[90px]",children:e.assignee.name})]}):t("span",{className:"text-[11px] italic text-muted-foreground/60",children:Wo()})}),o("div",{className:"flex items-center gap-2 shrink-0",children:[e.dueDate&&o("div",{className:E("flex items-center gap-1 text-[10px] font-mono",y?"text-red-500 font-semibold":"text-muted-foreground"),title:ir(new Date(e.dueDate),"yyyy/MM/dd HH:mm"),children:[t(Pn,{className:"w-3 h-3"}),t("span",{children:ir(new Date(e.dueDate),"MM/dd")})]}),e.assetCount>0&&o("div",{className:"flex items-center gap-0.5 text-[10px] text-muted-foreground hover:text-foreground",title:cv({count:e.assetCount}),children:[t(ii,{className:"w-3 h-3"}),t("span",{children:e.assetCount})]}),e.dependencyCount>0&&o("div",{className:"flex items-center gap-0.5 text-[10px] text-muted-foreground hover:text-foreground",title:`${e.dependencyCount} dependencies`,children:[t(Aa,{className:"w-3 h-3"}),t("span",{children:e.dependencyCount})]}),e.commentCount>0&&o("div",{className:"flex items-center gap-0.5 text-[10px] text-muted-foreground hover:text-foreground",title:`${e.commentCount} comments`,children:[t(lo,{className:"w-3 h-3"}),t("span",{children:e.commentCount})]})]})]})]})]})}function Pe({teamId:e,status:r,selectedGoalId:x,scope:p,currentUserId:w,currentUserRole:v,onTaskClick:I,onDeleteTask:g,onCreateTaskInColumn:K}){let P=v?.toLowerCase()==="owner"||v?.toLowerCase()==="editor",M=p==="my"?w:void 0,{data:j,fetchNextPage:_,hasNextPage:H,isFetchingNextPage:d,isLoading:n}=ct({queryKey:["teams",e,"kanban","tasks",{status:r,goalId:x,assigneeId:M}],queryFn:async({pageParam:z=""})=>{let W=await A.api.teams[":teamId"].kanban.tasks.$get({param:{teamId:e},query:{status:r,goalId:x||void 0,assigneeId:M||void 0,first:"20",after:z||void 0}});if(!W.ok)throw Error("Failed to fetch column tasks");return await W.json()},initialPageParam:"",getNextPageParam:(z)=>z.pageInfo?.cursor||void 0,refetchInterval:5000,enabled:!!e}),{ref:b,inView:N}=Tt({threshold:0.1});h(()=>{if(N&&H&&!d)_()},[N,H,d,_]);let l=O(()=>j?.pages?.flatMap((z)=>Array.isArray(z?.data)?z.data:[])||[],[j]),{source:i,target:s}=md(),m=l.filter((z)=>z.id!==i?.id).at(-1),{ref:k,isDropTarget:f}=Tr({id:r,data:{type:"kanban_column",status:r,lastTask:m}}),c=i?.data?.type==="kanban_task",D=c&&(f||s?.data?.type==="kanban_column"&&s.data.status===r||s?.data?.type==="reorder"&&s.data.task?.status===r),F=c&&s?.data?.type==="kanban_column"&&s.data.status===r,y=j?.pages?.[0]?.pageInfo?.total??l.length,X=gp(r);return o("div",{ref:k,className:E("flex flex-col h-full max-h-full w-80 md:w-84 shrink-0 rounded-xl bg-card/60 border border-border/70 shadow-xs transition-colors duration-200 overflow-hidden select-none",D&&"ring-2 ring-primary/60 bg-primary/[0.03] border-primary/40"),children:[o("div",{className:"h-11 px-3.5 flex items-center justify-between border-b border-border/60 bg-card/80 shrink-0",children:[o("div",{className:"flex items-center gap-2 min-w-0",children:[t("div",{className:E("w-2.5 h-2.5 rounded-full shrink-0",X.dot)}),t("h3",{className:"text-xs font-bold tracking-wide uppercase text-foreground/90 truncate",children:Vn(r)})]}),t("div",{className:"flex items-center gap-1 shrink-0",children:t("span",{className:"text-[11px] font-mono px-2 py-0.5 rounded-full bg-muted font-medium text-muted-foreground",children:y})})]}),t(se,{className:"flex-1 min-h-0 [&>div>div]:block!",children:o("div",{className:"p-2.5 space-y-2.5 min-h-full flex flex-col",children:[n?t("div",{className:"flex items-center justify-center py-10",children:t(Z,{className:"w-5 h-5 animate-spin text-muted-foreground"})}):l.length===0?t("div",{className:"flex flex-col items-center justify-center py-10 px-4 text-center",children:t("p",{className:"text-xs text-muted-foreground/70",children:Yw()})}):l.map((z,W)=>t(_e,{task:z,onClick:I,onDelete:g,isFirst:W===0,isLast:W===l.length-1,showBottomIndicator:F&&z.id===m?.id,currentUserId:w,currentUserRole:v},z.id)),t("div",{ref:b,className:"h-2"}),d&&t("div",{className:"flex justify-center py-2",children:t(Z,{className:"w-4 h-4 animate-spin text-muted-foreground"})})]})}),P&&t("div",{className:"p-2 border-t border-border/50 bg-card/90 shrink-0",children:o(S,{variant:"ghost",size:"sm",onClick:()=>K(r),className:"w-full justify-center h-8 text-xs font-medium text-muted-foreground hover:text-foreground hover:bg-muted/80 border border-dashed border-border/80",children:[t(de,{className:"w-3.5 h-3.5 mr-1.5"}),t("span",{children:Yd()})]})})]})}function Fe({teamId:e,selectedGoalId:r,scope:x,currentUserId:p,currentUserRole:w,onTaskClick:v,onCreateTaskInColumn:I}){let g=Q(),[K,P]=u(null),{mutate:M,isPending:j}=U({mutationFn:async(d)=>{let n=await A.api.teams[":teamId"].kanban.tasks[":taskId"].$delete({param:{teamId:e,taskId:d}});if(!n.ok){let b=await n.json().catch(()=>({message:An()}));throw Error(b.message||An())}return await n.json()},onSuccess:()=>{g.invalidateQueries({queryKey:["teams",e,"kanban","tasks"]}),g.invalidateQueries({queryKey:["teams",e,"kanban","goals"]}),R.success(ME()),P(null)},onError:(d)=>{R.error(d.message)}}),{mutate:_}=U({mutationFn:async({taskId:d,fromStatus:n,status:b,reason:N,beforeIndex:l,afterIndex:i})=>{let s=await A.api.teams[":teamId"].kanban.tasks[":taskId"].$patch({param:{teamId:e,taskId:d},json:{fromStatus:n,status:b,reason:N,beforeIndex:l,afterIndex:i}});if(!s.ok){let m=await s.json().catch(()=>({message:An()}));throw Error(m.message||An())}return await s.json()},onMutate:async({taskId:d,status:n,targetTaskId:b,position:N})=>{await g.cancelQueries({queryKey:["teams",e,"kanban","tasks"]});let l=g.getQueriesData({queryKey:["teams",e,"kanban","tasks"]}),i=null,s=(m)=>m[0]==="teams"&&m[1]===e&&m[2]==="kanban"&&m[3]==="tasks"&&typeof m[4]==="object"&&m[4]!==null&&("status"in m[4]);if(g.setQueriesData({predicate:(m)=>s(m.queryKey)},(m)=>{if(!m||!Array.isArray(m.pages))return m;let k=!1,f=m.pages.map((c)=>{if(!c||!Array.isArray(c.data))return c;let D=c.data.find((F)=>F.id===d);if(D)return i={...D,status:n},k=!0,{...c,data:c.data.filter((F)=>F.id!==d),pageInfo:{...c.pageInfo,total:Math.max(0,(c.pageInfo?.total??c.data.length)-1)}};return c});return k?{...m,pages:f}:m}),i){let m=i;g.setQueriesData({predicate:(k)=>{if(!s(k.queryKey))return!1;return k.queryKey[4]?.status===n}},(k)=>{if(!k||!Array.isArray(k.pages))return k;let f=k.pages.flatMap((y)=>y?.data??[]).filter((y)=>y.id!==d),c=f.length;if(b){let y=f.findIndex((X)=>X.id===b);if(y!==-1)c=N==="before"?y:y+1}f.splice(c,0,m);let D=0,F=k.pages.map((y,X)=>{let z=y?.data?y.data.length:0,W=X===0&&z===0?1:X===k.pages.length-1?f.length-D:z,te=f.slice(D,D+W);return D+=W,{...y,data:te,pageInfo:{...y?.pageInfo,total:(y?.pageInfo?.total??0)+1}}});if(D<f.length&&F.length>0){let y=F.length-1;F[y]={...F[y],data:[...F[y]?.data??[],...f.slice(D)]}}return{...k,pages:F}})}return{previousQueries:l}},onError:(d,n,b)=>{if(b?.previousQueries)for(let[N,l]of b.previousQueries)g.setQueryData(N,l);R.error(d.message)},onSettled:()=>{g.invalidateQueries({queryKey:["teams",e,"kanban","tasks"]})}}),H=(d)=>{if(d.canceled)return;let{source:n,target:b}=d.operation;if(!n||!b)return;let N=n.data;if(N?.type!=="kanban_task"||!N.task)return;let l=N.task,i=w?.toLowerCase()==="owner",s=w?.toLowerCase()==="editor",m=l.reporter?.id===p||l.creator?.id===p,k=l.assignee?.id===p;if(!i&&!s&&!m&&!k){R.error(Dy());return}let f=b.data;if(!f)return;if(f.type==="reorder"&&f.task&&f.position){let c=f.task,D=c.status;if(l.id===c.id)return;let F=f.position==="before"?c.sortIndex??void 0:void 0,y=f.position==="after"?c.sortIndex??void 0:void 0;_({taskId:l.id,fromStatus:l.status,status:D,beforeIndex:F,afterIndex:y,targetTaskId:c.id,position:f.position});return}if(f.type==="kanban_column"&&f.status){let{status:c,lastTask:D}=f;if(D){if(l.id===D.id){if(l.status===c)return;_({taskId:l.id,fromStatus:l.status,status:c});return}_({taskId:l.id,fromStatus:l.status,status:c,afterIndex:D.sortIndex??void 0,targetTaskId:D.id,position:"after"});return}if(l.status===c)return;_({taskId:l.id,fromStatus:l.status,status:c})}};return o(Dn,{sensors:[nn.configure({activationConstraints:[new Ir.Distance({value:8})]}),Lo],onDragEnd:H,children:[t("div",{className:"flex-1 min-h-0 overflow-x-auto overflow-y-hidden p-4 bg-background/50",children:t("div",{className:"flex gap-4 h-full min-w-max pb-2",children:Rg.map((d)=>t(Pe,{teamId:e,status:d,selectedGoalId:r,scope:x,currentUserId:p,currentUserRole:w,onTaskClick:v,onDeleteTask:(n)=>P(n),onCreateTaskInColumn:I},d))})}),K&&t(We,{open:!!K,onOpenChange:(d)=>!d&&P(null),children:o(Ye,{children:[o(Je,{children:[t(et,{children:t_()}),t(tt,{children:r_({title:K.title})})]}),o(Xe,{children:[t(nt,{disabled:j,children:Re()}),o(rt,{onClick:()=>M(K.id),disabled:j,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:[j&&t(Z,{className:"w-4 h-4 mr-1.5 animate-spin"}),at()]})]})]})})]})}C();function Me({teamId:e,isOpen:r,onClose:x,initialGoalId:p}){let w=Q(),v=p===Ja||!p?"none":p,[I,g]=u(""),[K,P]=u(""),[M,j]=u(!1),[_,H]=u(Or.MEDIUM),[d,n]=u(v),[b,N]=u("none"),[l,i]=u("none"),[s,m]=u(void 0),[k,f]=u(void 0),[c,D]=u(null),[F,y]=u(null),[X,z]=u(null),[W,te]=u([]),[ne,oe]=u([]),[be,xe]=u(!1),{data:ke}=L({queryKey:["teams",e,"me"],queryFn:async()=>{let a=await A.api.teams[":teamId"].me.$get({param:{teamId:e}});if(!a.ok)return null;return await a.json()},enabled:!!e&&r});h(()=>{if(r)g(""),P(""),j(!1),H(Or.MEDIUM),n(v),N("none"),i(ke?.id||"none"),m(void 0),f(void 0),D(null),y(null),z(null),te([]),oe([])},[r,v,ke?.id]);let{data:ye=[]}=L({queryKey:["teams",e,"members","human"],queryFn:async()=>{let a=await A.api.teams[":teamId"].members.$get({param:{teamId:e},query:{includeAgents:"false"}});if(!a.ok)return[];let J=await a.json();return Array.isArray(J)?J:[]},enabled:!!e&&r}),{data:$e=[]}=L({queryKey:["teams",e,"agents"],queryFn:async()=>{let a=await A.api.teams[":teamId"].agents.$get({param:{teamId:e}});if(!a.ok)return[];return await a.json()||[]},enabled:!!e&&r}),{data:He}=L({queryKey:["teams",e,"kanban","goals"],queryFn:async()=>{let a=await A.api.teams[":teamId"].kanban.goals.$get({param:{teamId:e},query:{}});if(!a.ok)return{data:[]};return await a.json()},enabled:!!e&&r}),Ve=He?.data||[],{mutate:st,isPending:ae}=U({mutationFn:async()=>{let a=await A.api.teams[":teamId"].kanban.tasks.$post({param:{teamId:e},json:{title:I.trim(),description:K.trim()||void 0,isAgentTask:M,priority:_,goalId:d!=="none"?d:void 0,assigneeId:b!=="none"?b:void 0,reporterId:l!=="none"?l:void 0,startDate:s?s.toISOString():void 0,dueDate:k?k.toISOString():void 0,projectId:c||void 0,targetFolderId:F||void 0,parentIds:W.length>0?W:void 0,assetIds:ne.length>0?ne.map((J)=>J.id):void 0}});if(!a.ok){let J=await a.text().catch(()=>""),Y=An();if(J)try{let le=JSON.parse(J);if(le&&typeof le.message==="string")Y=le.message}catch{Y=J}throw Error(Y)}return await a.json()},onSuccess:()=>{w.invalidateQueries({queryKey:["teams",e,"kanban","tasks"]}),w.invalidateQueries({queryKey:["teams",e,"kanban","goals"]}),R.success(TE()),x()},onError:(a)=>{R.error(a.message)}}),ot=(a)=>{if(a.preventDefault(),!I.trim()||ae)return;st()},ie=M;return t(fe,{open:r,onOpenChange:(a)=>!a&&x(),children:o(ce,{className:"sm:max-w-3xl max-h-[90vh] overflow-y-auto",children:[o("form",{onSubmit:ot,className:"space-y-4",children:[t(pe,{children:t(ue,{children:Yd()})}),o("div",{className:"space-y-3.5 py-1",children:[o("div",{className:"space-y-1.5",children:[t(G,{htmlFor:"create-task-title",children:gg()}),t(q,{id:"create-task-title",value:I,onChange:(a)=>g(a.target.value),placeholder:Ag(),required:!0,autoFocus:!0})]}),o("div",{className:"space-y-1.5",children:[t(G,{htmlFor:"create-task-desc",children:pg()}),t(Xa,{id:"create-task-desc",value:K,onChange:(a)=>P(a.target.value),placeholder:mg(),rows:3})]}),o("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[o("div",{className:"sm:col-span-2 flex items-center justify-between space-x-2 rounded-lg border border-border/80 bg-muted/30 p-2.5 h-14",children:[o("div",{className:"space-y-0.5 min-w-0 pr-2",children:[o(G,{htmlFor:"create-is-agent-task",className:"text-xs font-medium cursor-pointer flex items-center gap-1.5",children:[t(bt,{className:"w-3.5 h-3.5 text-orange-500"}),t("span",{children:dd()})]}),t("p",{className:"text-[11px] text-muted-foreground line-clamp-1",children:yg()})]}),t(je,{id:"create-is-agent-task",checked:M,onCheckedChange:(a)=>{j(a),N("none")}})]}),o("div",{className:"space-y-1.5",children:[t(G,{className:"text-xs font-medium text-muted-foreground",children:hg()}),o(De,{value:_,onValueChange:(a)=>H(a),children:[t(Le,{className:"w-full h-9 text-xs",children:t(Ze,{})}),t(Be,{children:Object.values(Or).map((a)=>t(re,{value:a,children:t("span",{className:E("px-1.5 py-0.5 rounded text-[10px] uppercase font-medium",Fs(a)),children:zs(a)})},a))})]})]}),o("div",{className:"space-y-1.5",children:[t(G,{className:"text-xs font-medium text-muted-foreground",children:Gu()}),o(De,{value:d,onValueChange:n,children:[t(Le,{className:"w-full h-9 text-xs",children:t(Ze,{placeholder:"None"})}),o(Be,{children:[t(re,{value:"none",children:t("span",{className:"text-muted-foreground italic",children:"None"})}),Ve.filter((a)=>a.id!==Ja).map((a)=>t(re,{value:a.id,children:o("div",{className:"flex items-center gap-2",children:[t(co,{className:"w-3.5 h-3.5 text-primary"}),t("span",{children:a.title})]})},a.id))]})]})]}),o("div",{className:"space-y-1.5",children:[t(G,{className:"text-xs font-medium text-muted-foreground",children:ie?ld():gm()}),o(De,{value:b,onValueChange:N,children:[t(Le,{className:"w-full h-9 text-xs",children:t(Ze,{placeholder:Wo()})}),o(Be,{children:[t(re,{value:"none",children:t("span",{className:"text-muted-foreground italic",children:Wo()})}),ie?$e.map((a)=>t(re,{value:a.id,children:o("div",{className:"flex items-center gap-2",children:[t(bt,{className:"w-3.5 h-3.5 text-purple-500"}),t("span",{children:a.name})]})},a.id)):ye.map((a)=>t(re,{value:a.id,children:o("div",{className:"flex items-center gap-2",children:[o(Ce,{size:"sm",className:"w-4 h-4",children:[t(Ee,{src:a.image}),t(Ie,{className:"text-[8px]",children:a.name.slice(0,2).toUpperCase()})]}),t("span",{children:a.name})]})},a.id))]})]})]}),o("div",{className:"space-y-1.5",children:[t(G,{className:"text-xs font-medium text-muted-foreground",children:Gh()}),o(De,{value:l,onValueChange:i,children:[t(Le,{className:"w-full h-9 text-xs",children:t(Ze,{placeholder:Wo()})}),o(Be,{children:[t(re,{value:"none",children:t("span",{className:"text-muted-foreground italic",children:Wo()})}),ye.map((a)=>t(re,{value:a.id,children:o("div",{className:"flex items-center gap-2",children:[o(Ce,{size:"sm",className:"w-4 h-4",children:[t(Ee,{src:a.image}),t(Ie,{className:"text-[8px]",children:a.name.slice(0,2).toUpperCase()})]}),t("span",{children:a.name})]})},a.id))]})]})]}),ie&&o("div",{className:"sm:col-span-2 space-y-1.5",children:[t(G,{className:"text-xs font-medium text-muted-foreground",children:np()}),o(S,{type:"button",variant:"outline",size:"sm",onClick:()=>xe(!0),className:"w-full justify-start h-9 text-xs truncate font-normal",children:[t(Xt,{className:"w-3.5 h-3.5 mr-2 text-primary shrink-0"}),t("span",{className:"truncate",children:X||Kf()})]})]}),o("div",{className:"space-y-1.5",children:[t(G,{className:"text-xs font-medium text-muted-foreground",children:cd()}),t(es,{value:s,onChange:m,placeholder:cd(),className:"h-9 text-xs"})]}),o("div",{className:"space-y-1.5",children:[t(G,{className:"text-xs font-medium text-muted-foreground",children:Uu()}),t(es,{value:k,onChange:f,placeholder:Uu(),className:"h-9 text-xs"})]}),o("div",{className:"sm:col-span-2 space-y-1.5",children:[t(G,{className:"text-xs font-medium text-muted-foreground",children:Sh()}),t(yd,{teamId:e,value:W,onChange:te})]}),t("div",{className:"sm:col-span-2 pt-1",children:t(_d,{teamId:e,projectId:c,assets:ne,onAddAssets:(a)=>oe((J)=>[...J,...a]),onRemoveAsset:(a)=>oe((J)=>J.filter((Y)=>Y.id!==a))})})]})]}),o(qe,{children:[t(S,{type:"button",variant:"outline",onClick:x,disabled:ae,children:Re()}),o(S,{type:"submit",disabled:!I.trim()||ae,children:[ae&&t(Z,{className:"w-4 h-4 mr-1.5 animate-spin"}),fc()]})]})]}),be&&t(bd,{teamId:e,currentProjectId:c,currentTargetFolderId:F,isOpen:be,onClose:()=>xe(!1),onSelect:(a,J,Y)=>{D(a),y(J),z(Y||"Selected Folder")}})]})})}function ze({teamId:e,initialTaskId:r}){let[x,p]=u("team"),[w,v]=u(null),[I,g]=u(r??null),[K,P]=u(!1);h(()=>{if(r)g(r)},[r]);let[M,j]=u(Ge.TODO),{data:_,isLoading:H}=L({queryKey:["teams",e,"me"],queryFn:async()=>{let s=await A.api.teams[":teamId"].me.$get({param:{teamId:e}});if(!s.ok)throw Error("Failed to fetch me");return await s.json()},enabled:!!e}),{data:d}=L({queryKey:["teams",e,"kanban","goals"],queryFn:async()=>{let s=await A.api.teams[":teamId"].kanban.goals.$get({param:{teamId:e},query:{}});if(!s.ok)return{data:[]};return await s.json()},enabled:!!e}),n=d?.data||[],b=w?n.find((s)=>s.id===w)||null:null,N=_?.role?.toLowerCase()==="owner"||_?.role?.toLowerCase()==="editor",l=(s=Ge.TODO)=>{j(s),P(!0)},i=(s)=>{g(s.id)};if(H)return t("div",{className:"flex h-full items-center justify-center",children:t(Z,{className:"w-8 h-8 animate-spin text-muted-foreground"})});return o("div",{className:"flex flex-row h-full bg-background overflow-hidden font-sans",children:[t(Se,{teamId:e,selectedGoalId:w,onSelectGoal:v,isOwnerOrEditor:N}),o("div",{className:"flex-1 flex flex-col min-w-0 h-full overflow-hidden",children:[t(Te,{scope:x,onScopeChange:p,selectedGoal:b,onClearGoal:()=>v(null),onCreateTask:()=>l(Ge.TODO),canCreateTask:N}),t(Fe,{teamId:e,selectedGoalId:w,scope:x,currentUserId:_?.id,currentUserRole:_?.role,onTaskClick:i,onCreateTaskInColumn:(s)=>l(s)})]}),I&&t(wd,{teamId:e,taskId:I,isOpen:!!I,onClose:()=>g(null),canEdit:N}),K&&t(Me,{teamId:e,isOpen:K,initialStatus:M,initialGoalId:w,onClose:()=>P(!1)})]})}function lt(){let{teamId:e}=Qe.useParams(),{taskId:r}=Qe.useSearch();return t(ze,{teamId:e,initialTaskId:r})}var Qe=Ue("/teams/$teamId/kanban")({component:lt});export{Qe as Route};