tower-studio 0.1.15 → 0.1.17

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 (206) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/build-manifest.json +3 -3
  3. package/.next/cache/.previewinfo +1 -1
  4. package/.next/cache/.rscinfo +1 -1
  5. package/.next/cache/.tsbuildinfo +1 -1
  6. package/.next/diagnostics/route-bundle-stats.json +95 -95
  7. package/.next/fallback-build-manifest.json +3 -3
  8. package/.next/prerender-manifest.json +3 -3
  9. package/.next/server/app/_global-error.html +1 -1
  10. package/.next/server/app/_global-error.rsc +1 -1
  11. package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  12. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  13. package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  14. package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  15. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  16. package/.next/server/app/_not-found/page/react-loadable-manifest.json +1 -1
  17. package/.next/server/app/_not-found/page/server-reference-manifest.json +23 -23
  18. package/.next/server/app/_not-found/page.js.nft.json +1 -1
  19. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  20. package/.next/server/app/_not-found.html +1 -1
  21. package/.next/server/app/_not-found.rsc +14 -14
  22. package/.next/server/app/_not-found.segments/_full.segment.rsc +14 -14
  23. package/.next/server/app/_not-found.segments/_head.segment.rsc +4 -4
  24. package/.next/server/app/_not-found.segments/_index.segment.rsc +9 -9
  25. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
  26. package/.next/server/app/_not-found.segments/_not-found.segment.rsc +3 -3
  27. package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  28. package/.next/server/app/api/internal/assistant/route.js +1 -1
  29. package/.next/server/app/api/internal/assistant/route.js.nft.json +1 -1
  30. package/.next/server/app/api/internal/terminal/[taskId]/start/route.js +2 -2
  31. package/.next/server/app/api/internal/terminal/[taskId]/start/route.js.nft.json +1 -1
  32. package/.next/server/app/index.html +1 -1
  33. package/.next/server/app/index.rsc +14 -14
  34. package/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  35. package/.next/server/app/index.segments/_full.segment.rsc +14 -14
  36. package/.next/server/app/index.segments/_head.segment.rsc +4 -4
  37. package/.next/server/app/index.segments/_index.segment.rsc +9 -9
  38. package/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  39. package/.next/server/app/missions/page/react-loadable-manifest.json +1 -1
  40. package/.next/server/app/missions/page/server-reference-manifest.json +49 -49
  41. package/.next/server/app/missions/page.js +1 -1
  42. package/.next/server/app/missions/page.js.nft.json +1 -1
  43. package/.next/server/app/missions/page_client-reference-manifest.js +1 -1
  44. package/.next/server/app/onboarding/page/react-loadable-manifest.json +1 -1
  45. package/.next/server/app/onboarding/page/server-reference-manifest.json +23 -23
  46. package/.next/server/app/onboarding/page.js.nft.json +1 -1
  47. package/.next/server/app/onboarding/page_client-reference-manifest.js +1 -1
  48. package/.next/server/app/onboarding.html +1 -1
  49. package/.next/server/app/onboarding.rsc +16 -16
  50. package/.next/server/app/onboarding.segments/_full.segment.rsc +16 -16
  51. package/.next/server/app/onboarding.segments/_head.segment.rsc +4 -4
  52. package/.next/server/app/onboarding.segments/_index.segment.rsc +9 -9
  53. package/.next/server/app/onboarding.segments/_tree.segment.rsc +2 -2
  54. package/.next/server/app/onboarding.segments/onboarding/__PAGE__.segment.rsc +4 -4
  55. package/.next/server/app/onboarding.segments/onboarding.segment.rsc +3 -3
  56. package/.next/server/app/page/react-loadable-manifest.json +1 -1
  57. package/.next/server/app/page/server-reference-manifest.json +23 -23
  58. package/.next/server/app/page.js.nft.json +1 -1
  59. package/.next/server/app/page_client-reference-manifest.js +1 -1
  60. package/.next/server/app/settings/page/react-loadable-manifest.json +1 -1
  61. package/.next/server/app/settings/page/server-reference-manifest.json +56 -80
  62. package/.next/server/app/settings/page.js +1 -1
  63. package/.next/server/app/settings/page.js.nft.json +1 -1
  64. package/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  65. package/.next/server/app/settings.html +1 -1
  66. package/.next/server/app/settings.rsc +16 -16
  67. package/.next/server/app/settings.segments/_full.segment.rsc +16 -16
  68. package/.next/server/app/settings.segments/_head.segment.rsc +4 -4
  69. package/.next/server/app/settings.segments/_index.segment.rsc +9 -9
  70. package/.next/server/app/settings.segments/_tree.segment.rsc +2 -2
  71. package/.next/server/app/settings.segments/settings/__PAGE__.segment.rsc +4 -4
  72. package/.next/server/app/settings.segments/settings.segment.rsc +3 -3
  73. package/.next/server/app/workspaces/[workspaceId]/archive/page/react-loadable-manifest.json +1 -1
  74. package/.next/server/app/workspaces/[workspaceId]/archive/page/server-reference-manifest.json +77 -77
  75. package/.next/server/app/workspaces/[workspaceId]/archive/page.js.nft.json +1 -1
  76. package/.next/server/app/workspaces/[workspaceId]/archive/page_client-reference-manifest.js +1 -1
  77. package/.next/server/app/workspaces/[workspaceId]/assets/page/react-loadable-manifest.json +1 -1
  78. package/.next/server/app/workspaces/[workspaceId]/assets/page/server-reference-manifest.json +64 -64
  79. package/.next/server/app/workspaces/[workspaceId]/assets/page.js.nft.json +1 -1
  80. package/.next/server/app/workspaces/[workspaceId]/assets/page_client-reference-manifest.js +1 -1
  81. package/.next/server/app/workspaces/[workspaceId]/notes/page/react-loadable-manifest.json +1 -1
  82. package/.next/server/app/workspaces/[workspaceId]/notes/page/server-reference-manifest.json +61 -61
  83. package/.next/server/app/workspaces/[workspaceId]/notes/page.js.nft.json +1 -1
  84. package/.next/server/app/workspaces/[workspaceId]/notes/page_client-reference-manifest.js +1 -1
  85. package/.next/server/app/workspaces/[workspaceId]/page/react-loadable-manifest.json +1 -1
  86. package/.next/server/app/workspaces/[workspaceId]/page/server-reference-manifest.json +51 -51
  87. package/.next/server/app/workspaces/[workspaceId]/page.js +1 -1
  88. package/.next/server/app/workspaces/[workspaceId]/page.js.nft.json +1 -1
  89. package/.next/server/app/workspaces/[workspaceId]/page_client-reference-manifest.js +1 -1
  90. package/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page/react-loadable-manifest.json +1 -1
  91. package/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page/server-reference-manifest.json +23 -23
  92. package/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page.js.nft.json +1 -1
  93. package/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page_client-reference-manifest.js +1 -1
  94. package/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page/react-loadable-manifest.json +1 -1
  95. package/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page/server-reference-manifest.json +56 -56
  96. package/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page.js +2 -2
  97. package/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page.js.nft.json +1 -1
  98. package/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page_client-reference-manifest.js +1 -1
  99. package/.next/server/app/workspaces/page/react-loadable-manifest.json +1 -1
  100. package/.next/server/app/workspaces/page/server-reference-manifest.json +43 -43
  101. package/.next/server/app/workspaces/page.js.nft.json +1 -1
  102. package/.next/server/app/workspaces/page_client-reference-manifest.js +1 -1
  103. package/.next/server/chunks/0uz~_next_dist_esm_build_templates_app-route_05yec2y.js +2 -2
  104. package/.next/server/chunks/[root-of-the-server]__00~8_qz._.js +4 -0
  105. package/.next/server/chunks/[root-of-the-server]__05mc_xk._.js +1 -1
  106. package/.next/server/chunks/[root-of-the-server]__0p5iuez._.js +2 -2
  107. package/.next/server/chunks/[root-of-the-server]__0rb-ear._.js +4 -0
  108. package/.next/server/chunks/project_f_tower_0n1s3ym._.js +1 -1
  109. package/.next/server/chunks/project_f_tower_src_11e.cv5._.js +1 -1
  110. package/.next/server/chunks/ssr/04uy_src_app_workspaces_[workspaceId]_tasks_[taskId]_task-page-client_tsx_01.s1p0._.js +1 -1
  111. package/.next/server/chunks/ssr/0y0r_f_tower_src_app_workspaces_[workspaceId]_assets_assets-page-client_tsx_0n4g3bn._.js +1 -1
  112. package/.next/server/chunks/ssr/[root-of-the-server]__0-x7b4t._.js +3 -0
  113. package/.next/server/chunks/ssr/[root-of-the-server]__00.lowc._.js +1 -1
  114. package/.next/server/chunks/ssr/[root-of-the-server]__007tg36._.js +1 -1
  115. package/.next/server/chunks/ssr/[root-of-the-server]__025.0xa._.js +1 -1
  116. package/.next/server/chunks/ssr/[root-of-the-server]__04u4kb4._.js +1 -1
  117. package/.next/server/chunks/ssr/[root-of-the-server]__05a17ca._.js +1 -1
  118. package/.next/server/chunks/ssr/[root-of-the-server]__06qzctf._.js +1 -1
  119. package/.next/server/chunks/ssr/{[root-of-the-server]__0wkjslq._.js → [root-of-the-server]__08-2pn1._.js} +1 -1
  120. package/.next/server/chunks/ssr/[root-of-the-server]__0_47k-j._.js +3 -0
  121. package/.next/server/chunks/ssr/[root-of-the-server]__0aidehy._.js +3 -0
  122. package/.next/server/chunks/ssr/[root-of-the-server]__0ex911v._.js +30 -0
  123. package/.next/server/chunks/ssr/[root-of-the-server]__0ffdrwp._.js +1 -1
  124. package/.next/server/chunks/ssr/[root-of-the-server]__0i4rk9v._.js +3 -3
  125. package/.next/server/chunks/ssr/[root-of-the-server]__0r6gkos._.js +1 -1
  126. package/.next/server/chunks/ssr/[root-of-the-server]__0u26l~e._.js +1 -1
  127. package/.next/server/chunks/ssr/[root-of-the-server]__0uca1bc._.js +1 -1
  128. package/.next/server/chunks/ssr/[root-of-the-server]__0w7gbe7._.js +1 -1
  129. package/.next/server/chunks/ssr/[root-of-the-server]__0xe-o3g._.js +1 -1
  130. package/.next/server/chunks/ssr/{[root-of-the-server]__0fb0m0v._.js → [root-of-the-server]__0z9azne._.js} +2 -2
  131. package/.next/server/chunks/ssr/[root-of-the-server]__0zaw-fl._.js +3 -0
  132. package/.next/server/chunks/ssr/[root-of-the-server]__13b2wve._.js +3 -0
  133. package/.next/server/chunks/ssr/[root-of-the-server]__13eo85g._.js +1 -1
  134. package/.next/server/chunks/ssr/[root-of-the-server]__13x5mmo._.js +1 -1
  135. package/.next/server/chunks/ssr/project_f_tower_0-wsdce._.js +3 -0
  136. package/.next/server/chunks/ssr/project_f_tower_0.nfmle._.js +3 -0
  137. package/.next/server/chunks/ssr/project_f_tower_0.txwd8._.js +1 -1
  138. package/.next/server/chunks/ssr/{project_f_tower_0u8bo7w._.js → project_f_tower_0ai4twk._.js} +2 -2
  139. package/.next/server/chunks/ssr/{project_f_tower_06z7x~2._.js → project_f_tower_0e3m009._.js} +2 -2
  140. package/.next/server/chunks/ssr/project_f_tower_0f0-wva._.js +1 -1
  141. package/.next/server/chunks/ssr/project_f_tower_0hgtev9._.js +1 -1
  142. package/.next/server/chunks/ssr/project_f_tower_0ivvjwd._.js +1 -1
  143. package/.next/server/chunks/ssr/{project_f_tower_0ntkd-l._.js → project_f_tower_0jhlcus._.js} +2 -2
  144. package/.next/server/chunks/ssr/project_f_tower_0jy~1uf._.js +1 -1
  145. package/.next/server/chunks/ssr/project_f_tower_0l6ssf8._.js +1 -1
  146. package/.next/server/chunks/ssr/project_f_tower_0o5.y1e._.js +1 -1
  147. package/.next/server/chunks/ssr/project_f_tower_0uu8dha._.js +3 -0
  148. package/.next/server/chunks/ssr/project_f_tower_0w01kgd._.js +3 -0
  149. package/.next/server/chunks/ssr/project_f_tower_0ym-aea._.js +1 -1
  150. package/.next/server/chunks/ssr/{project_f_tower_0qepwa~._.js → project_f_tower_0zqkh.-._.js} +2 -2
  151. package/.next/server/chunks/ssr/{project_f_tower_src_0w26c.x._.js → project_f_tower_src_03-54or._.js} +2 -2
  152. package/.next/server/chunks/ssr/project_f_tower_src_actions_agent-actions_ts_0.s4~m-._.js +2 -2
  153. package/.next/server/chunks/ssr/project_f_tower_src_actions_file-actions_ts_02i742t._.js +1 -1
  154. package/.next/server/chunks/ssr/project_f_tower_src_app_missions_missions-client_tsx_0ums4qx._.js +1 -1
  155. package/.next/server/chunks/ssr/project_f_tower_src_app_onboarding_page_tsx_0_9_yoq._.js +1 -1
  156. package/.next/server/chunks/ssr/project_f_tower_src_app_settings_page_tsx_0oo06~d._.js +1 -1
  157. package/.next/server/chunks/ssr/project_f_tower_src_app_workspaces_[workspaceId]_board-page-client_tsx_0jmj1xz._.js +1 -1
  158. package/.next/server/chunks/ssr/{project_f_tower_0u6dr5n._.js → project_f_tower_src_components_ui_input_tsx_02yu4ri._.js} +2 -2
  159. package/.next/server/middleware-build-manifest.js +3 -3
  160. package/.next/server/pages/404.html +1 -1
  161. package/.next/server/pages/500.html +1 -1
  162. package/.next/server/server-reference-manifest.js +1 -1
  163. package/.next/server/server-reference-manifest.json +231 -255
  164. package/.next/static/chunks/{09wk17shlbfp6.js → 037e47w8xw0vw.js} +1 -1
  165. package/.next/static/chunks/{0qz_w~ilkw07_.js → 083e56klgnjgy.js} +1 -1
  166. package/.next/static/chunks/0a8x8yl_kme06.js +1 -0
  167. package/.next/static/chunks/{0jz83jbb6_ldj.js → 0cqsk~mfhg.i5.js} +1 -1
  168. package/.next/static/chunks/{0gpckquc5j5cx.js → 0i_v_7f3gdmz4.js} +1 -1
  169. package/.next/static/chunks/0j.~gle~mn8uy.js +1 -0
  170. package/.next/static/chunks/{0_-rw81.wbmu..js → 0nyip_341~xyg.js} +2 -2
  171. package/.next/static/chunks/0rt2m4hy13qby.js +1 -0
  172. package/.next/static/chunks/0s4zpgzk~au6x.css +1 -0
  173. package/.next/static/chunks/{0qnz9q6uieuv8.js → 0sszltblb5pss.js} +1 -1
  174. package/.next/static/chunks/0x5iegao~6ge3.js +1 -0
  175. package/.next/static/chunks/{05_0-v~c00b__.js → 0x6gp.e04de4e.js} +1 -1
  176. package/.next/static/chunks/{12x6kubkc37zq.js → 0zz4ryeh6j~.x.js} +1 -1
  177. package/.next/static/chunks/{0n3o6vvrc4ks4.js → 110k271zgqb6h.js} +1 -1
  178. package/.next/static/chunks/{0nvuuwr.v3r4k.js → 125_gss3san00.js} +1 -1
  179. package/.next/static/chunks/12wq.0xcxup1q.js +1 -0
  180. package/.next/static/chunks/187llw593phxu.js +1 -0
  181. package/.next/trace +2 -2
  182. package/.next/trace-build +1 -1
  183. package/package.json +4 -2
  184. package/scripts/init-db.ts +0 -17
  185. package/.next/server/chunks/[root-of-the-server]__02~bq0q._.js +0 -4
  186. package/.next/server/chunks/[root-of-the-server]__0~33o~m._.js +0 -4
  187. package/.next/server/chunks/ssr/[root-of-the-server]__0fp7reb._.js +0 -3
  188. package/.next/server/chunks/ssr/[root-of-the-server]__0fwuc5u._.js +0 -3
  189. package/.next/server/chunks/ssr/[root-of-the-server]__0nmyvwk._.js +0 -3
  190. package/.next/server/chunks/ssr/[root-of-the-server]__0y3o4rp._.js +0 -3
  191. package/.next/server/chunks/ssr/[root-of-the-server]__11j4k9o._.js +0 -3
  192. package/.next/server/chunks/ssr/[root-of-the-server]__13cjs8r._.js +0 -3
  193. package/.next/server/chunks/ssr/project_f_tower_04g3~44._.js +0 -30
  194. package/.next/server/chunks/ssr/project_f_tower_08d6__q._.js +0 -3
  195. package/.next/server/chunks/ssr/project_f_tower_0arf7nr._.js +0 -3
  196. package/.next/server/chunks/ssr/project_f_tower_135-_23._.js +0 -3
  197. package/.next/static/chunks/0-ggl6l3h5syr.js +0 -1
  198. package/.next/static/chunks/04pjsuj.mivbh.css +0 -1
  199. package/.next/static/chunks/05tpf5j-jft-k.js +0 -1
  200. package/.next/static/chunks/0_vexk9jnxj9q.js +0 -1
  201. package/.next/static/chunks/0h0m-v8uoeq~u.js +0 -1
  202. package/.next/static/chunks/0ynxf.i-o3-xn.js +0 -1
  203. package/.next/static/chunks/0zio-v5989p.b.js +0 -1
  204. /package/.next/static/{QCWJhjbC4McTn-0CAT1Gx → Gxj1QMzOqxH1St959O3yh}/_buildManifest.js +0 -0
  205. /package/.next/static/{QCWJhjbC4McTn-0CAT1Gx → Gxj1QMzOqxH1St959O3yh}/_clientMiddlewareManifest.js +0 -0
  206. /package/.next/static/{QCWJhjbC4McTn-0CAT1Gx → Gxj1QMzOqxH1St959O3yh}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,839178,e=>{"use strict";let t;var r,n,a,s=e.i(432377),i=e.i(85212),l=e.i(309542),o=e.i(265826),u=e.i(357334),c=e.i(946960),d=e.i(863961);let h=(0,d.default)("folder-tree",[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]]);var f=e.i(442409),m=e.i(154333),p=e.i(950211),x=e.i(289208),g=e.i(750986),b=e.i(677436);let v=(0,d.default)("git-pull-request-arrow",[["circle",{cx:"5",cy:"6",r:"3",key:"1qnov2"}],["path",{d:"M5 9v12",key:"ih889a"}],["circle",{cx:"19",cy:"18",r:"3",key:"1qljk2"}],["path",{d:"m15 9-3-3 3-3",key:"1lwv8l"}],["path",{d:"M12 6h5a2 2 0 0 1 2 2v7",key:"1yj91y"}]]);var y=e.i(11915),w=e.i(631325);let j=(0,i.createContext)(null);j.displayName="PanelGroupContext";let k="data-panel-group-direction",C="data-panel-group-id",N="data-resize-handle",S="data-panel-resize-handle-id",E=i.useLayoutEffect,A=i["useId".toString()],D="function"==typeof A?A:()=>null,M=0;function I(e=null){let t=D(),r=(0,i.useRef)(e||t||null);return null===r.current&&(r.current=""+M++),null!=e?e:r.current}function P({children:e,className:t="",collapsedSize:r,collapsible:n,defaultSize:a,forwardedRef:s,id:l,maxSize:o,minSize:u,onCollapse:c,onExpand:d,onResize:h,order:f,style:m,tagName:p="div",...x}){let g=(0,i.useContext)(j);if(null===g)throw Error("Panel components must be rendered within a PanelGroup container");let{collapsePanel:b,expandPanel:v,getPanelSize:y,getPanelStyle:w,groupId:k,isPanelCollapsed:N,reevaluatePanelConstraints:S,registerPanel:A,resizePanel:D,unregisterPanel:M}=g,R=I(l),B=(0,i.useRef)({callbacks:{onCollapse:c,onExpand:d,onResize:h},constraints:{collapsedSize:r,collapsible:n,defaultSize:a,maxSize:o,minSize:u},id:R,idIsFromProps:void 0!==l,order:f});(0,i.useRef)({didLogMissingDefaultSizeWarning:!1}),E(()=>{let{callbacks:e,constraints:t}=B.current,s={...t};B.current.id=R,B.current.idIsFromProps=void 0!==l,B.current.order=f,e.onCollapse=c,e.onExpand=d,e.onResize=h,t.collapsedSize=r,t.collapsible=n,t.defaultSize=a,t.maxSize=o,t.minSize=u,(s.collapsedSize!==t.collapsedSize||s.collapsible!==t.collapsible||s.maxSize!==t.maxSize||s.minSize!==t.minSize)&&S(B.current,s)}),E(()=>{let e=B.current;return A(e),()=>{M(e)}},[f,R,A,M]),(0,i.useImperativeHandle)(s,()=>({collapse:()=>{b(B.current)},expand:e=>{v(B.current,e)},getId:()=>R,getSize:()=>y(B.current),isCollapsed:()=>N(B.current),isExpanded:()=>!N(B.current),resize:e=>{D(B.current,e)}}),[b,v,y,N,R,D]);let F=w(B.current,a);return(0,i.createElement)(p,{...x,children:e,className:t,id:R,style:{...F,...m},[C]:k,"data-panel":"","data-panel-collapsible":n||void 0,"data-panel-id":R,"data-panel-size":parseFloat(""+F.flexGrow).toFixed(1)})}let R=(0,i.forwardRef)((e,t)=>(0,i.createElement)(P,{...e,forwardedRef:t}));P.displayName="Panel",R.displayName="forwardRef(Panel)";let B=null,F=-1,L=null;function z(e,r){var n,a,s;let i=function(e,t){if(t){let e=(t&U)!=0,r=(t&Y)!=0,n=(t&q)!=0,a=(t&J)!=0;if(e)if(n)return"se-resize";else if(a)return"ne-resize";else return"e-resize";if(r)if(n)return"sw-resize";else if(a)return"nw-resize";else return"w-resize";if(n)return"s-resize";else if(a)return"n-resize"}switch(e){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}(e,r);B!==i&&(B=i,null===L&&(L=document.createElement("style"),t&&L.setAttribute("nonce",t),document.head.appendChild(L)),F>=0&&(null==(s=L.sheet)||s.removeRule(F)),F=null!=(n=null==(a=L.sheet)?void 0:a.insertRule(`*{cursor: ${i} !important;}`))?n:-1)}function $(e){return"keydown"===e.type}function T(e){return e.type.startsWith("pointer")}function _(e){return e.type.startsWith("mouse")}function O(e){if(T(e)){if(e.isPrimary)return{x:e.clientX,y:e.clientY}}else if(_(e))return{x:e.clientX,y:e.clientY};return{x:1/0,y:1/0}}let W=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function H(e){let t=e.length;for(;t--;){let r=e[t];if(eh(r,"Missing node"),function(e){var t;let r,n=getComputedStyle(e);return"fixed"===n.position||!!("auto"!==n.zIndex&&("static"!==n.position||"flex"===(r=getComputedStyle(null!=(t=V(e))?t:e).display)||"inline-flex"===r)||1>+n.opacity||"transform"in n&&"none"!==n.transform||"webkitTransform"in n&&"none"!==n.webkitTransform||"mixBlendMode"in n&&"normal"!==n.mixBlendMode||"filter"in n&&"none"!==n.filter||"webkitFilter"in n&&"none"!==n.webkitFilter||"isolation"in n&&"isolate"===n.isolation||W.test(n.willChange))||"touch"===n.webkitOverflowScrolling}(r))return r}return null}function G(e){return e&&Number(getComputedStyle(e).zIndex)||0}function K(e){let t=[];for(;e;)t.push(e),e=V(e);return t}function V(e){let{parentNode:t}=e;return t&&t instanceof ShadowRoot?t.host:t}let U=1,Y=2,q=4,J=8,X="coarse"===function(){if("function"==typeof matchMedia)return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}(),Q=[],Z=!1,ee=new Map,et=new Map,er=new Set;function en(e){let{target:t}=e,{x:r,y:n}=O(e);Z=!0,el({target:t,x:r,y:n}),ec(),Q.length>0&&(ed("down",e),e.preventDefault(),ei(t)||e.stopImmediatePropagation())}function ea(e){let{x:t,y:r}=O(e);if(Z&&0===e.buttons&&(Z=!1,ed("up",e)),!Z){let{target:n}=e;el({target:n,x:t,y:r})}ed("move",e),eo(),Q.length>0&&e.preventDefault()}function es(e){let{target:t}=e,{x:r,y:n}=O(e);et.clear(),Z=!1,Q.length>0&&(e.preventDefault(),ei(t)||e.stopImmediatePropagation()),ed("up",e),el({target:t,x:r,y:n}),eo(),ec()}function ei(e){let t=e;for(;t;){if(t.hasAttribute(N))return!0;t=t.parentElement}return!1}function el({target:e,x:t,y:r}){Q.splice(0);let n=null;(e instanceof HTMLElement||e instanceof SVGElement)&&(n=e),er.forEach(e=>{let{element:a,hitAreaMargins:s}=e,i=a.getBoundingClientRect(),{bottom:l,left:o,right:u,top:c}=i,d=X?s.coarse:s.fine;if(t>=o-d&&t<=u+d&&r>=c-d&&r<=l+d){if(null!==n&&document.contains(n)&&a!==n&&!a.contains(n)&&!n.contains(a)&&function(e,t){let r;if(e===t)throw Error("Cannot compare node with itself");let n={a:K(e),b:K(t)};for(;n.a.at(-1)===n.b.at(-1);)e=n.a.pop(),t=n.b.pop(),r=e;eh(r,"Stacking order can only be calculated for elements with a common ancestor");let a={a:G(H(n.a)),b:G(H(n.b))};if(a.a===a.b){let e=r.childNodes,t={a:n.a.at(-1),b:n.b.at(-1)},a=e.length;for(;a--;){let r=e[a];if(r===t.a)return 1;if(r===t.b)return -1}}return Math.sign(a.a-a.b)}(n,a)>0){let e=n,t=!1;for(;e;){var h;if(e.contains(a))break;if(h=e.getBoundingClientRect(),h.x<i.x+i.width&&h.x+h.width>i.x&&h.y<i.y+i.height&&h.y+h.height>i.y){t=!0;break}e=e.parentElement}if(t)return}Q.push(e)}})}function eo(){let e=!1,t=!1;Q.forEach(r=>{let{direction:n}=r;"horizontal"===n?e=!0:t=!0});let r=0;et.forEach(e=>{r|=e}),e&&t?z("intersection",r):e?z("horizontal",r):t?z("vertical",r):null!==L&&(document.head.removeChild(L),B=null,L=null,F=-1)}let eu=new AbortController;function ec(){eu.abort();let e={capture:!0,signal:(eu=new AbortController).signal};er.size&&(Z?(Q.length>0&&ee.forEach((t,r)=>{let{body:n}=r;t>0&&(n.addEventListener("contextmenu",es,e),n.addEventListener("pointerleave",ea,e),n.addEventListener("pointermove",ea,e))}),window.addEventListener("pointerup",es,e),window.addEventListener("pointercancel",es,e)):ee.forEach((t,r)=>{let{body:n}=r;t>0&&(n.addEventListener("pointerdown",en,e),n.addEventListener("pointermove",ea,e))}))}function ed(e,t){er.forEach(r=>{let{setResizeHandlerState:n}=r;n(e,Q.includes(r),t)})}function eh(e,t){if(!e)throw console.error(t),Error(t)}function ef(e,t,r=10){return e.toFixed(r)===t.toFixed(r)?0:e>t?1:-1}function em(e,t,r=10){return 0===ef(e,t,r)}function ep(e,t,r){return 0===ef(e,t,r)}function ex({panelConstraints:e,panelIndex:t,size:r}){let n=e[t];eh(null!=n,`Panel constraints not found for index ${t}`);let{collapsedSize:a=0,collapsible:s,maxSize:i=100,minSize:l=0}=n;return 0>ef(r,l)&&(r=s&&0>ef(r,(a+l)/2)?a:l),r=parseFloat((r=Math.min(i,r)).toFixed(10))}function eg({delta:e,initialLayout:t,panelConstraints:r,pivotIndices:n,prevLayout:a,trigger:s}){if(ep(e,0))return t;let i=[...t],[l,o]=n;eh(null!=l,"Invalid first pivot index"),eh(null!=o,"Invalid second pivot index");let u=0;if("keyboard"===s){{let n=e<0?o:l,a=r[n];eh(a,`Panel constraints not found for index ${n}`);let{collapsedSize:s=0,collapsible:i,minSize:u=0}=a;if(i){let r=t[n];if(eh(null!=r,`Previous layout not found for panel index ${n}`),ep(r,s)){let t=u-r;ef(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}{let n=e<0?l:o,a=r[n];eh(a,`No panel constraints found for index ${n}`);let{collapsedSize:s=0,collapsible:i,minSize:u=0}=a;if(i){let r=t[n];if(eh(null!=r,`Previous layout not found for panel index ${n}`),ep(r,u)){let t=r-s;ef(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}}{let n=e<0?1:-1,a=e<0?o:l,s=0;for(;;){let e=t[a];if(eh(null!=e,`Previous layout not found for panel index ${a}`),s+=ex({panelConstraints:r,panelIndex:a,size:100})-e,(a+=n)<0||a>=r.length)break}let i=Math.min(Math.abs(e),Math.abs(s));e=e<0?0-i:i}{let n=e<0?l:o;for(;n>=0&&n<r.length;){let a=Math.abs(e)-Math.abs(u),s=t[n];eh(null!=s,`Previous layout not found for panel index ${n}`);let l=ex({panelConstraints:r,panelIndex:n,size:s-a});if(!ep(s,l)&&(u+=s-l,i[n]=l,u.toPrecision(3).localeCompare(Math.abs(e).toPrecision(3),void 0,{numeric:!0})>=0))break;e<0?n--:n++}}if(function(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(!ep(e[r],t[r],void 0))return!1;return!0}(a,i))return a;{let n=e<0?o:l,a=t[n];eh(null!=a,`Previous layout not found for panel index ${n}`);let s=a+u,c=ex({panelConstraints:r,panelIndex:n,size:s});if(i[n]=c,!ep(c,s)){let t=s-c,n=e<0?o:l;for(;n>=0&&n<r.length;){let a=i[n];eh(null!=a,`Previous layout not found for panel index ${n}`);let s=ex({panelConstraints:r,panelIndex:n,size:a+t});if(ep(a,s)||(t-=s-a,i[n]=s),ep(t,0))break;e>0?n--:n++}}}return ep(i.reduce((e,t)=>t+e,0),100)?i:a}function eb(e,t=document){return Array.from(t.querySelectorAll(`[${S}][data-panel-group-id="${e}"]`))}function ev(e,t,r=document){let n=eb(e,r).findIndex(e=>e.getAttribute(S)===t);return null!=n?n:null}function ey(e,t,r){let n=ev(e,t,r);return null!=n?[n,n+1]:[-1,-1]}function ew(e,t=document){var r;if(t instanceof HTMLElement&&(null==t||null==(r=t.dataset)?void 0:r.panelGroupId)==e)return t;let n=t.querySelector(`[data-panel-group][data-panel-group-id="${e}"]`);return n||null}function ej(e,t=document){let r=t.querySelector(`[${S}="${e}"]`);return r||null}function ek(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}function eC(e,t){let{x:r,y:n}=O(t);return"horizontal"===e?r:n}function eN(e,t,r){t.forEach((t,n)=>{let a=e[n];eh(a,`Panel data not found for index ${n}`);let{callbacks:s,constraints:i,id:l}=a,{collapsedSize:o=0,collapsible:u}=i,c=r[l];if(null==c||t!==c){r[l]=t;let{onCollapse:e,onExpand:n,onResize:a}=s;a&&a(t,c),u&&(e||n)&&(n&&(null==c||em(c,o))&&!em(t,o)&&n(),e&&(null==c||!em(c,o))&&em(t,o)&&e())}})}function eS(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!=t[r])return!1;return!0}function eE(e){try{if("u">typeof localStorage)e.getItem=e=>localStorage.getItem(e),e.setItem=(e,t)=>{localStorage.setItem(e,t)};else throw Error("localStorage not supported in this environment")}catch(t){console.error(t),e.getItem=()=>null,e.setItem=()=>{}}}function eA(e){return`react-resizable-panels:${e}`}function eD(e){return e.map(e=>{let{constraints:t,id:r,idIsFromProps:n,order:a}=e;return n?r:a?`${a}:${JSON.stringify(t)}`:JSON.stringify(t)}).sort((e,t)=>e.localeCompare(t)).join(",")}function eM(e,t){try{let r=eA(e),n=t.getItem(r);if(n){let e=JSON.parse(n);if("object"==typeof e&&null!=e)return e}}catch(e){}return null}function eI(e,t,r,n,a){var s;let i=eA(e),l=eD(t),o=null!=(s=eM(e,a))?s:{};o[l]={expandToSizes:Object.fromEntries(r.entries()),layout:n};try{a.setItem(i,JSON.stringify(o))}catch(e){console.error(e)}}function eP({layout:e,panelConstraints:t}){let r=[...e],n=r.reduce((e,t)=>e+t,0);if(r.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${r.map(e=>`${e}%`).join(", ")}`);if(!ep(n,100)&&r.length>0)for(let e=0;e<t.length;e++){let t=r[e];eh(null!=t,`No layout data found for index ${e}`);let a=100/n*t;r[e]=a}let a=0;for(let e=0;e<t.length;e++){let n=r[e];eh(null!=n,`No layout data found for index ${e}`);let s=ex({panelConstraints:t,panelIndex:e,size:n});n!=s&&(a+=n-s,r[e]=s)}if(!ep(a,0))for(let e=0;e<t.length;e++){let n=r[e];eh(null!=n,`No layout data found for index ${e}`);let s=ex({panelConstraints:t,panelIndex:e,size:n+a});if(n!==s&&(a-=s-n,r[e]=s,ep(a,0)))break}return r}let eR={getItem:e=>(eE(eR),eR.getItem(e)),setItem:(e,t)=>{eE(eR),eR.setItem(e,t)}},eB={};function eF({autoSaveId:e=null,children:t,className:r="",direction:n,forwardedRef:a,id:s=null,onLayout:l=null,keyboardResizeBy:o=null,storage:u=eR,style:c,tagName:d="div",...h}){let f=I(s),m=(0,i.useRef)(null),[p,x]=(0,i.useState)(null),[g,b]=(0,i.useState)([]),v=function(){let[e,t]=(0,i.useState)(0);return(0,i.useCallback)(()=>t(e=>e+1),[])}(),y=(0,i.useRef)({}),w=(0,i.useRef)(new Map),N=(0,i.useRef)(0),A=(0,i.useRef)({autoSaveId:e,direction:n,dragState:p,id:f,keyboardResizeBy:o,onLayout:l,storage:u}),D=(0,i.useRef)({layout:g,panelDataArray:[],panelDataArrayChanged:!1});(0,i.useRef)({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),(0,i.useImperativeHandle)(a,()=>({getId:()=>A.current.id,getLayout:()=>{let{layout:e}=D.current;return e},setLayout:e=>{let{onLayout:t}=A.current,{layout:r,panelDataArray:n}=D.current,a=eP({layout:e,panelConstraints:n.map(e=>e.constraints)});ek(r,a)||(b(a),D.current.layout=a,t&&t(a),eN(n,a,y.current))}}),[]),E(()=>{A.current.autoSaveId=e,A.current.direction=n,A.current.dragState=p,A.current.id=f,A.current.onLayout=l,A.current.storage=u}),function({committedValuesRef:e,eagerValuesRef:t,groupId:r,layout:n,panelDataArray:a,panelGroupElement:s,setLayout:l}){(0,i.useRef)({didWarnAboutMissingResizeHandle:!1}),E(()=>{if(!s)return;let e=eb(r,s);for(let t=0;t<a.length-1;t++){let{valueMax:r,valueMin:s,valueNow:i}=function({layout:e,panelsArray:t,pivotIndices:r}){let n=0,a=100,s=0,i=0,l=r[0];return eh(null!=l,"No pivot index found"),t.forEach((e,t)=>{let{constraints:r}=e,{maxSize:o=100,minSize:u=0}=r;t===l?(n=u,a=o):(s+=u,i+=o)}),{valueMax:Math.min(a,100-s),valueMin:Math.max(n,100-i),valueNow:e[l]}}({layout:n,panelsArray:a,pivotIndices:[t,t+1]}),l=e[t];if(null==l);else{let e=a[t];eh(e,`No panel data found for index "${t}"`),l.setAttribute("aria-controls",e.id),l.setAttribute("aria-valuemax",""+Math.round(r)),l.setAttribute("aria-valuemin",""+Math.round(s)),l.setAttribute("aria-valuenow",null!=i?""+Math.round(i):"")}}return()=>{e.forEach((e,t)=>{e.removeAttribute("aria-controls"),e.removeAttribute("aria-valuemax"),e.removeAttribute("aria-valuemin"),e.removeAttribute("aria-valuenow")})}},[r,n,a,s]),(0,i.useEffect)(()=>{if(!s)return;let e=t.current;eh(e,"Eager values not found");let{panelDataArray:a}=e;eh(null!=ew(r,s),`No group found for id "${r}"`);let i=eb(r,s);eh(i,`No resize handles found for group id "${r}"`);let o=i.map(e=>{let t=e.getAttribute(S);eh(t,"Resize handle element has no handle id attribute");let[i,o]=function(e,t,r,n=document){var a,s,i,l;let o=ej(t,n),u=eb(e,n),c=o?u.indexOf(o):-1;return[null!=(a=null==(s=r[c])?void 0:s.id)?a:null,null!=(i=null==(l=r[c+1])?void 0:l.id)?i:null]}(r,t,a,s);if(null==i||null==o)return()=>{};let u=e=>{if(!e.defaultPrevented&&"Enter"===e.key){e.preventDefault();let o=a.findIndex(e=>e.id===i);if(o>=0){let e=a[o];eh(e,`No panel data found for index ${o}`);let i=n[o],{collapsedSize:u=0,collapsible:c,minSize:d=0}=e.constraints;if(null!=i&&c){let e=eg({delta:ep(i,u)?d-u:u-i,initialLayout:n,panelConstraints:a.map(e=>e.constraints),pivotIndices:ey(r,t,s),prevLayout:n,trigger:"keyboard"});n!==e&&l(e)}}}};return e.addEventListener("keydown",u),()=>{e.removeEventListener("keydown",u)}});return()=>{o.forEach(e=>e())}},[s,e,t,r,n,a,l])}({committedValuesRef:A,eagerValuesRef:D,groupId:f,layout:g,panelDataArray:D.current.panelDataArray,setLayout:b,panelGroupElement:m.current}),(0,i.useEffect)(()=>{let{panelDataArray:t}=D.current;if(e){if(0===g.length||g.length!==t.length)return;let r=eB[e];null==r&&(r=function(e,t=10){let r=null;return(...n)=>{null!==r&&clearTimeout(r),r=setTimeout(()=>{e(...n)},t)}}(eI,100),eB[e]=r),r(e,[...t],new Map(w.current),g,u)}},[e,g,u]),(0,i.useEffect)(()=>{});let M=(0,i.useCallback)(e=>{let{onLayout:t}=A.current,{layout:r,panelDataArray:n}=D.current;if(e.constraints.collapsible){let a=n.map(e=>e.constraints),{collapsedSize:s=0,panelSize:i,pivotIndices:l}=e$(n,e,r);if(eh(null!=i,`Panel size not found for panel "${e.id}"`),!em(i,s)){w.current.set(e.id,i);let o=eg({delta:ez(n,e)===n.length-1?i-s:s-i,initialLayout:r,panelConstraints:a,pivotIndices:l,prevLayout:r,trigger:"imperative-api"});eS(r,o)||(b(o),D.current.layout=o,t&&t(o),eN(n,o,y.current))}}},[]),P=(0,i.useCallback)((e,t)=>{let{onLayout:r}=A.current,{layout:n,panelDataArray:a}=D.current;if(e.constraints.collapsible){let s=a.map(e=>e.constraints),{collapsedSize:i=0,panelSize:l=0,minSize:o=0,pivotIndices:u}=e$(a,e,n),c=null!=t?t:o;if(em(l,i)){let t=w.current.get(e.id),i=null!=t&&t>=c?t:c,o=eg({delta:ez(a,e)===a.length-1?l-i:i-l,initialLayout:n,panelConstraints:s,pivotIndices:u,prevLayout:n,trigger:"imperative-api"});eS(n,o)||(b(o),D.current.layout=o,r&&r(o),eN(a,o,y.current))}}},[]),R=(0,i.useCallback)(e=>{let{layout:t,panelDataArray:r}=D.current,{panelSize:n}=e$(r,e,t);return eh(null!=n,`Panel size not found for panel "${e.id}"`),n},[]),B=(0,i.useCallback)((e,t)=>{let{panelDataArray:r}=D.current,n=ez(r,e);return function({defaultSize:e,dragState:t,layout:r,panelData:n,panelIndex:a,precision:s=3}){let i=r[a];return{flexBasis:0,flexGrow:null==i?void 0!=e?e.toPrecision(s):"1":1===n.length?"1":i.toPrecision(s),flexShrink:1,overflow:"hidden",pointerEvents:null!==t?"none":void 0}}({defaultSize:t,dragState:p,layout:g,panelData:r,panelIndex:n})},[p,g]),F=(0,i.useCallback)(e=>{let{layout:t,panelDataArray:r}=D.current,{collapsedSize:n=0,collapsible:a,panelSize:s}=e$(r,e,t);return eh(null!=s,`Panel size not found for panel "${e.id}"`),!0===a&&em(s,n)},[]),L=(0,i.useCallback)(e=>{let{layout:t,panelDataArray:r}=D.current,{collapsedSize:n=0,collapsible:a,panelSize:s}=e$(r,e,t);return eh(null!=s,`Panel size not found for panel "${e.id}"`),!a||ef(s,n)>0},[]),z=(0,i.useCallback)(e=>{let{panelDataArray:t}=D.current;t.push(e),t.sort((e,t)=>{let r=e.order,n=t.order;return null==r&&null==n?0:null==r?-1:null==n?1:r-n}),D.current.panelDataArrayChanged=!0,v()},[v]);E(()=>{if(D.current.panelDataArrayChanged){D.current.panelDataArrayChanged=!1;let{autoSaveId:r,onLayout:n,storage:a}=A.current,{layout:s,panelDataArray:i}=D.current,l=null;if(r){var e,t;let n=null!=(t=(null!=(e=eM(r,a))?e:{})[eD(i)])?t:null;n&&(w.current=new Map(Object.entries(n.expandToSizes)),l=n.layout)}null==l&&(l=function({panelDataArray:e}){let t=Array(e.length),r=e.map(e=>e.constraints),n=0,a=100;for(let s=0;s<e.length;s++){let e=r[s];eh(e,`Panel constraints not found for index ${s}`);let{defaultSize:i}=e;null!=i&&(n++,t[s]=i,a-=i)}for(let s=0;s<e.length;s++){let i=r[s];eh(i,`Panel constraints not found for index ${s}`);let{defaultSize:l}=i;if(null!=l)continue;let o=a/(e.length-n);n++,t[s]=o,a-=o}return t}({panelDataArray:i}));let o=eP({layout:l,panelConstraints:i.map(e=>e.constraints)});ek(s,o)||(b(o),D.current.layout=o,n&&n(o),eN(i,o,y.current))}}),E(()=>{let e=D.current;return()=>{e.layout=[]}},[]);let O=(0,i.useCallback)(e=>{let t=!1,r=m.current;return r&&"rtl"===window.getComputedStyle(r,null).getPropertyValue("direction")&&(t=!0),function(r){var n,a;r.preventDefault();let s=m.current;if(!s)return()=>null;let{direction:i,dragState:l,id:o,keyboardResizeBy:u,onLayout:c}=A.current,{layout:d,panelDataArray:h}=D.current,{initialLayout:f}=null!=l?l:{},p=ey(o,e,s),x=function(e,t,r,n,a,s){if($(e)){let t="horizontal"===r,n=0;n=e.shiftKey?100:null!=a?a:10;let s=0;switch(e.key){case"ArrowDown":s=t?0:n;break;case"ArrowLeft":s=t?-n:0;break;case"ArrowRight":s=t?n:0;break;case"ArrowUp":s=t?0:-n;break;case"End":s=100;break;case"Home":s=-100}return s}return null==n?0:function(e,t,r,n,a){let s="horizontal"===r,i=ej(t,a);eh(i,`No resize handle element found for id "${t}"`);let l=i.getAttribute(C);eh(l,"Resize handle element has no group id attribute");let{initialCursorPosition:o}=n,u=eC(r,e),c=ew(l,a);eh(c,`No group element found for id "${l}"`);let d=c.getBoundingClientRect();return(u-o)/(s?d.width:d.height)*100}(e,t,r,n,s)}(r,e,i,l,u,s),g="horizontal"===i;g&&t&&(x=-x);let v=eg({delta:x,initialLayout:null!=f?f:d,panelConstraints:h.map(e=>e.constraints),pivotIndices:p,prevLayout:d,trigger:$(r)?"keyboard":"mouse-or-touch"}),w=!eS(d,v);(T(r)||_(r))&&N.current!=x&&((N.current=x,w||0===x)?et.set(e,0):g?(n=x<0?U:Y,et.set(e,n)):(a=x<0?q:J,et.set(e,a))),w&&(b(v),D.current.layout=v,c&&c(v),eN(h,v,y.current))}},[]),W=(0,i.useCallback)((e,t)=>{let{onLayout:r}=A.current,{layout:n,panelDataArray:a}=D.current,s=a.map(e=>e.constraints),{panelSize:i,pivotIndices:l}=e$(a,e,n);eh(null!=i,`Panel size not found for panel "${e.id}"`);let o=eg({delta:ez(a,e)===a.length-1?i-t:t-i,initialLayout:n,panelConstraints:s,pivotIndices:l,prevLayout:n,trigger:"imperative-api"});eS(n,o)||(b(o),D.current.layout=o,r&&r(o),eN(a,o,y.current))},[]),H=(0,i.useCallback)((e,t)=>{let{layout:r,panelDataArray:n}=D.current,{collapsedSize:a=0,collapsible:s}=t,{collapsedSize:i=0,collapsible:l,maxSize:o=100,minSize:u=0}=e.constraints,{panelSize:c}=e$(n,e,r);null!=c&&(s&&l&&em(c,a)?em(a,i)||W(e,i):c<u?W(e,u):c>o&&W(e,o))},[W]),G=(0,i.useCallback)((e,t)=>{let{direction:r}=A.current,{layout:n}=D.current;if(!m.current)return;let a=ej(e,m.current);eh(a,`Drag handle element not found for id "${e}"`);let s=eC(r,t);x({dragHandleId:e,dragHandleRect:a.getBoundingClientRect(),initialCursorPosition:s,initialLayout:n})},[]),K=(0,i.useCallback)(()=>{x(null)},[]),V=(0,i.useCallback)(e=>{let{panelDataArray:t}=D.current,r=ez(t,e);r>=0&&(t.splice(r,1),delete y.current[e.id],D.current.panelDataArrayChanged=!0,v())},[v]),X=(0,i.useMemo)(()=>({collapsePanel:M,direction:n,dragState:p,expandPanel:P,getPanelSize:R,getPanelStyle:B,groupId:f,isPanelCollapsed:F,isPanelExpanded:L,reevaluatePanelConstraints:H,registerPanel:z,registerResizeHandle:O,resizePanel:W,startDragging:G,stopDragging:K,unregisterPanel:V,panelGroupElement:m.current}),[M,p,n,P,R,B,f,F,L,H,z,O,W,G,K,V]);return(0,i.createElement)(j.Provider,{value:X},(0,i.createElement)(d,{...h,children:t,className:r,id:s,ref:m,style:{display:"flex",flexDirection:"horizontal"===n?"row":"column",height:"100%",overflow:"hidden",width:"100%",...c},"data-panel-group":"",[k]:n,[C]:f}))}let eL=(0,i.forwardRef)((e,t)=>(0,i.createElement)(eF,{...e,forwardedRef:t}));function ez(e,t){return e.findIndex(e=>e===t||e.id===t.id)}function e$(e,t,r){let n=ez(e,t),a=n===e.length-1,s=r[n];return{...t.constraints,panelSize:s,pivotIndices:a?[n-1,n]:[n,n+1]}}function eT({children:e=null,className:t="",disabled:r=!1,hitAreaMargins:n,id:a,onBlur:s,onClick:l,onDragging:o,onFocus:u,onPointerDown:c,onPointerUp:d,style:h={},tabIndex:f=0,tagName:m="div",...p}){var x,g;let b=(0,i.useRef)(null),v=(0,i.useRef)({onClick:l,onDragging:o,onPointerDown:c,onPointerUp:d});(0,i.useEffect)(()=>{v.current.onClick=l,v.current.onDragging=o,v.current.onPointerDown=c,v.current.onPointerUp=d});let y=(0,i.useContext)(j);if(null===y)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");let{direction:w,groupId:A,registerResizeHandle:D,startDragging:M,stopDragging:P,panelGroupElement:R}=y,B=I(a),[F,L]=(0,i.useState)("inactive"),[z,$]=(0,i.useState)(!1),[T,_]=(0,i.useState)(null),O=(0,i.useRef)({state:F});E(()=>{O.current.state=F}),(0,i.useEffect)(()=>{if(r)_(null);else{let e=D(B);_(()=>e)}},[r,B,D]);let W=null!=(x=null==n?void 0:n.coarse)?x:15,H=null!=(g=null==n?void 0:n.fine)?g:5;return(0,i.useEffect)(()=>{if(r||null==T)return;let e=b.current;eh(e,"Element ref not attached");let t=!1;return function(e,t,r,n,a){var s;let{ownerDocument:i}=t,l={direction:r,element:t,hitAreaMargins:n,setResizeHandlerState:a},o=null!=(s=ee.get(i))?s:0;return ee.set(i,o+1),er.add(l),ec(),function(){var t;et.delete(e),er.delete(l);let r=null!=(t=ee.get(i))?t:1;if(ee.set(i,r-1),ec(),1===r&&ee.delete(i),Q.includes(l)){let e=Q.indexOf(l);e>=0&&Q.splice(e,1),eo(),a("up",!0,null)}}}(B,e,w,{coarse:W,fine:H},(e,r,n)=>{if(!r)return void L("inactive");switch(e){case"down":{L("drag"),t=!1,eh(n,'Expected event to be defined for "down" action'),M(B,n);let{onDragging:e,onPointerDown:r}=v.current;null==e||e(!0),null==r||r();break}case"move":{let{state:e}=O.current;t=!0,"drag"!==e&&L("hover"),eh(n,'Expected event to be defined for "move" action'),T(n);break}case"up":{L("hover"),P();let{onClick:e,onDragging:r,onPointerUp:n}=v.current;null==r||r(!1),null==n||n(),t||null==e||e()}}})},[W,w,r,H,D,B,T,M,P]),!function({disabled:e,handleId:t,resizeHandler:r,panelGroupElement:n}){(0,i.useEffect)(()=>{if(e||null==r||null==n)return;let a=ej(t,n);if(null==a)return;let s=e=>{if(!e.defaultPrevented)switch(e.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":e.preventDefault(),r(e);break;case"F6":{e.preventDefault();let r=a.getAttribute(C);eh(r,`No group element found for id "${r}"`);let s=eb(r,n),i=ev(r,t,n);eh(null!==i,`No resize element found for id "${t}"`);let l=e.shiftKey?i>0?i-1:s.length-1:i+1<s.length?i+1:0;s[l].focus()}}};return a.addEventListener("keydown",s),()=>{a.removeEventListener("keydown",s)}},[n,e,t,r])}({disabled:r,handleId:B,resizeHandler:T,panelGroupElement:R}),(0,i.createElement)(m,{...p,children:e,className:t,id:a,onBlur:()=>{$(!1),null==s||s()},onFocus:()=>{$(!0),null==u||u()},ref:b,role:"separator",style:{touchAction:"none",userSelect:"none",...h},tabIndex:f,[k]:w,[C]:A,[N]:"","data-resize-handle-active":"drag"===F?"pointer":z?"keyboard":void 0,"data-panel-resize-handle-enabled":!r,[S]:B,"data-resize-handle-state":F})}eF.displayName="PanelGroup",eL.displayName="forwardRef(PanelGroup)",eT.displayName="PanelResizeHandle",e.s([],607143),e.i(607143),e.i(129893);var e_=e.i(121538),eO=e.i(284060),eW=e.i(357030),eH=e.i(793988),eG=e.i(607243),eK=e.i(378719),eV=e.i(499875);let eU=i.createContext(void 0);function eY(){let e=i.useContext(eU);if(void 0===e)throw Error((0,eV.default)(64));return e}let eq=((r={}).activationDirection="data-activation-direction",r.orientation="data-orientation",r),eJ={tabActivationDirection:e=>({[eq.activationDirection]:e})},eX=i.forwardRef(function(e,t){let{className:r,defaultValue:n=0,onValueChange:a,orientation:l="horizontal",render:o,value:u,...c}=e,d=(0,eK.useDirection)(),h=Object.hasOwn(e,"defaultValue"),f=i.useRef([]),[m,p]=i.useState(()=>new Map),[x,g]=(0,e_.useControlled)({controlled:u,default:n,name:"Tabs",state:"value"}),b=void 0!==u,[v,y]=i.useState(()=>new Map),[w,j]=i.useState("none"),k=(0,eW.useStableCallback)((e,t)=>{a?.(e,t),t.isCanceled||(g(e),j(t.activationDirection))}),C=(0,eW.useStableCallback)((e,t)=>{p(r=>{if(r.get(e)===t)return r;let n=new Map(r);return n.set(e,t),n})}),N=(0,eW.useStableCallback)((e,t)=>{p(r=>{if(!r.has(e)||r.get(e)!==t)return r;let n=new Map(r);return n.delete(e),n})}),S=i.useCallback(e=>m.get(e),[m]),E=i.useCallback(e=>{for(let t of v.values())if(e===t?.value)return t?.id},[v]),A=i.useCallback(e=>{if(void 0===e)return null;for(let[t,r]of v.entries())if(null!=r&&e===(r.value??r.index))return t;return null},[v]),D=i.useMemo(()=>({direction:d,getTabElementBySelectedValue:A,getTabIdByPanelValue:E,getTabPanelIdByValue:S,onValueChange:k,orientation:l,registerMountedTabPanel:C,setTabMap:y,unregisterMountedTabPanel:N,tabActivationDirection:w,value:x}),[d,A,E,S,k,l,C,y,N,w,x]),M=i.useMemo(()=>{for(let e of v.values())if(null!=e&&e.value===x)return e},[v,x]),I=i.useMemo(()=>{for(let e of v.values())if(null!=e&&!e.disabled)return e.value},[v]);(0,eO.useIsoLayoutEffect)(()=>{if(b||0===v.size)return;let e=M?.disabled,t=null==M&&null!==x;if(h&&e&&x===n||!e&&!t)return;let r=I??null;x!==r&&(g(r),j("none"))},[n,I,h,b,M,j,g,v,x]);let P=(0,eH.useRenderElement)("div",e,{state:{orientation:l,tabActivationDirection:w},ref:t,props:c,stateAttributesMapping:eJ});return(0,s.jsx)(eU.Provider,{value:D,children:(0,s.jsx)(eG.CompositeList,{elementsRef:f,children:P})})});var eQ=e.i(924723),eZ=e.i(443667),e0=e.i(136391);let e1="data-composite-item-active";var e2=e.i(246863);let e3=i.createContext(void 0);function e5(){let e=i.useContext(e3);if(void 0===e)throw Error((0,eV.default)(65));return e}var e4=e.i(197167),e8=e.i(394772),e7=e.i(75408);let e6=i.forwardRef(function(e,t){let{className:r,disabled:n=!1,render:a,value:s,id:l,nativeButton:o=!0,...u}=e,{value:c,getTabPanelIdByValue:d,orientation:h}=eY(),{activateOnFocus:f,highlightedTabIndex:m,onTabActivation:p,registerTabResizeObserverElement:x,setHighlightedTabIndex:g,tabsListElement:b}=e5(),v=(0,eZ.useBaseUiId)(l),y=i.useMemo(()=>({disabled:n,id:v,value:s}),[n,v,s]),{compositeProps:w,compositeRef:j,index:k}=(0,e2.useCompositeItem)({metadata:y}),C=s===c,N=i.useRef(!1),S=i.useRef(null);i.useEffect(()=>{let e=S.current;if(e)return x(e)},[x]),(0,eO.useIsoLayoutEffect)(()=>{if(N.current){N.current=!1;return}if(C&&k>-1&&m!==k){if(null!=b){let e=(0,e7.activeElement)((0,eQ.ownerDocument)(b));if(e&&(0,e7.contains)(b,e))return}n||g(k)}},[C,k,m,g,n,b]);let{getButtonProps:E,buttonRef:A}=(0,e0.useButton)({disabled:n,native:o,focusableWhenDisabled:!0}),D=d(s),M=i.useRef(!1),I=i.useRef(!1);return(0,eH.useRenderElement)("button",e,{state:{disabled:n,active:C,orientation:h},ref:[t,A,j,S],props:[w,{role:"tab","aria-controls":D,"aria-selected":C,id:v,onClick:function(e){C||n||p(s,(0,e4.createChangeEventDetails)(e8.REASONS.none,e.nativeEvent,void 0,{activationDirection:"none"}))},onFocus:function(e){C||(k>-1&&!n&&g(k),!n&&f&&(!M.current||M.current&&I.current)&&p(s,(0,e4.createChangeEventDetails)(e8.REASONS.none,e.nativeEvent,void 0,{activationDirection:"none"})))},onPointerDown:function(e){C||n||(M.current=!0,e.button&&0!==e.button||(I.current=!0,(0,eQ.ownerDocument)(e.currentTarget).addEventListener("pointerup",function(){M.current=!1,I.current=!1},{once:!0})))},[e1]:C?"":void 0,onKeyDownCapture(){N.current=!0}},u,E]})});var e9=e.i(292547),te=e.i(137399);let tt=((n={}).activeTabLeft="--active-tab-left",n.activeTabRight="--active-tab-right",n.activeTabTop="--active-tab-top",n.activeTabBottom="--active-tab-bottom",n.activeTabWidth="--active-tab-width",n.activeTabHeight="--active-tab-height",n);var tr=e.i(594683);let tn={...eJ,activeTabPosition:()=>null,activeTabSize:()=>null},ta=i.forwardRef(function(e,t){let{className:r,render:n,renderBeforeHydration:a=!1,...l}=e,{nonce:o}=(0,tr.useCSPContext)(),{getTabElementBySelectedValue:u,orientation:c,tabActivationDirection:d,value:h}=eY(),{tabsListElement:f,registerIndicatorUpdateListener:m}=e5(),[p,x]=i.useState(!1);(0,e9.useOnMount)(()=>x(!0));let g=function(){let[,e]=i.useState({});return i.useCallback(()=>{e({})},[])}();i.useEffect(()=>m(g),[m,g]);let b=0,v=0,y=0,w=0,j=0,k=0,C=!1;if(null!=h&&null!=f){let e=u(h);if(C=!0,null!=e){let{width:t,height:r}=(0,te.getCssDimensions)(e),{width:n,height:a}=(0,te.getCssDimensions)(f),s=e.getBoundingClientRect(),i=f.getBoundingClientRect(),l=n>0?i.width/n:1,o=a>0?i.height/a:1;if(Math.abs(l)>Number.EPSILON&&Math.abs(o)>Number.EPSILON){let e=s.left-i.left,t=s.top-i.top;b=e/l+f.scrollLeft-f.clientLeft,y=t/o+f.scrollTop-f.clientTop}else b=e.offsetLeft,y=e.offsetTop;j=t,k=r,v=f.scrollWidth-b-j,w=f.scrollHeight-y-k}}let N=i.useMemo(()=>C?{left:b,right:v,top:y,bottom:w}:null,[b,v,y,w,C]),S=i.useMemo(()=>C?{width:j,height:k}:null,[j,k,C]),E=i.useMemo(()=>{if(C)return{[tt.activeTabLeft]:`${b}px`,[tt.activeTabRight]:`${v}px`,[tt.activeTabTop]:`${y}px`,[tt.activeTabBottom]:`${w}px`,[tt.activeTabWidth]:`${j}px`,[tt.activeTabHeight]:`${k}px`}},[b,v,y,w,j,k,C]),A=C&&j>0&&k>0,D=(0,eH.useRenderElement)("span",e,{state:{orientation:c,activeTabPosition:N,activeTabSize:S,tabActivationDirection:d},ref:t,props:[{role:"presentation",style:E,hidden:!A},l,{suppressHydrationWarning:!0}],stateAttributesMapping:tn});return null==h?null:(0,s.jsxs)(i.Fragment,{children:[D,!p&&a&&(0,s.jsx)("script",{nonce:o,dangerouslySetInnerHTML:{__html:'!function(){const t=document.currentScript.previousElementSibling;if(!t)return;const e=t.closest(\'[role="tablist"]\');if(!e)return;const i=e.querySelector("[data-active]");if(!i)return;if(0===i.offsetWidth||0===e.offsetWidth)return;let o=0,n=0,h=0,l=0,r=0,f=0;function s(t){const e=getComputedStyle(t);let i=parseFloat(e.width)||0,o=parseFloat(e.height)||0;return(Math.round(i)!==t.offsetWidth||Math.round(o)!==t.offsetHeight)&&(i=t.offsetWidth,o=t.offsetHeight),{width:i,height:o}}if(null!=i&&null!=e){const{width:t,height:c}=s(i),{width:u,height:d}=s(e),a=i.getBoundingClientRect(),g=e.getBoundingClientRect(),p=u>0?g.width/u:1,b=d>0?g.height/d:1;if(Math.abs(p)>Number.EPSILON&&Math.abs(b)>Number.EPSILON){const t=a.left-g.left,i=a.top-g.top;o=t/p+e.scrollLeft-e.clientLeft,h=i/b+e.scrollTop-e.clientTop}else o=i.offsetLeft,h=i.offsetTop;r=t,f=c,n=e.scrollWidth-o-r,l=e.scrollHeight-h-f}function c(e,i){t.style.setProperty(`--active-tab-${e}`,`${i}px`)}c("left",o),c("right",n),c("top",h),c("bottom",l),c("width",r),c("height",f),r>0&&f>0&&t.removeAttribute("hidden")}();'},suppressHydrationWarning:!0})]})});var ts=e.i(614855),ti=e.i(144909),tl=e.i(412360),to=e.i(883993),tu=e.i(135709);let tc=((a={}).index="data-index",a.activationDirection="data-activation-direction",a.orientation="data-orientation",a.hidden="data-hidden",a[a.startingStyle=ti.TransitionStatusDataAttributes.startingStyle]="startingStyle",a[a.endingStyle=ti.TransitionStatusDataAttributes.endingStyle]="endingStyle",a),td={...eJ,...ti.transitionStatusMapping},th=i.forwardRef(function(e,t){let{className:r,value:n,render:a,keepMounted:s=!1,...l}=e,{value:o,getTabIdByPanelValue:u,orientation:c,tabActivationDirection:d,registerMountedTabPanel:h,unregisterMountedTabPanel:f}=eY(),m=(0,eZ.useBaseUiId)(),p=i.useMemo(()=>({id:m,value:n}),[m,n]),{ref:x,index:g}=(0,tu.useCompositeListItem)({metadata:p}),b=n===o,{mounted:v,transitionStatus:y,setMounted:w}=(0,to.useTransitionStatus)(b),j=!v,k=u(n),C=i.useRef(null),N=(0,eH.useRenderElement)("div",e,{state:{hidden:j,orientation:c,tabActivationDirection:d,transitionStatus:y},ref:[t,x,C],props:[{"aria-labelledby":k,hidden:j,id:m,role:"tabpanel",tabIndex:b?0:-1,inert:(0,ts.inertValue)(!b),[tc.index]:g},l],stateAttributesMapping:td});return((0,tl.useOpenChangeComplete)({open:b,ref:C,onComplete(){b||w(!1)}}),(0,eO.useIsoLayoutEffect)(()=>{if((!j||s)&&null!=m)return h(n,m),()=>{f(n,m)}},[j,s,n,m,h,f]),s||v)?N:null});var tf=e.i(156420),tm=e.i(615111),tp=e.i(868239);let tx=[];var tg=e.i(101997),tb=e.i(166508);function tv(e){let{render:t,className:r,refs:n=tb.EMPTY_ARRAY,props:a=tb.EMPTY_ARRAY,state:l=tb.EMPTY_OBJECT,stateAttributesMapping:o,highlightedIndex:u,onHighlightedIndexChange:c,orientation:d,dense:h,itemSizes:f,loopFocus:m,cols:p,enableHomeAndEndKeys:x,onMapChange:g,stopEventPropagation:b=!0,rootRef:v,disabledIndices:y,modifierKeys:w,highlightItemOnHover:j=!1,tag:k="div",...C}=e,{props:N,highlightedIndex:S,onHighlightedIndexChange:E,elementsRef:A,onMapChange:D,relayKeyboardEvent:M}=function(e){let{itemSizes:t,cols:r=1,loopFocus:n=!0,dense:a=!1,orientation:s="both",direction:l,highlightedIndex:o,onHighlightedIndexChange:u,rootRef:c,enableHomeAndEndKeys:d=!1,stopEventPropagation:h=!1,disabledIndices:f,modifierKeys:m=tx}=e,[p,x]=i.useState(0),g=r>1,b=i.useRef(null),v=(0,tf.useMergedRefs)(b,c),y=i.useRef([]),w=i.useRef(!1),j=o??p,k=(0,eW.useStableCallback)((e,t=!1)=>{if((u??x)(e),t){let t=y.current[e];(0,tm.scrollIntoViewIfNeeded)(b.current,t,l,s)}}),C=(0,eW.useStableCallback)(e=>{if(0===e.size||w.current)return;w.current=!0;let t=Array.from(e.keys()),r=t.find(e=>e?.hasAttribute(e1))??null,n=r?t.indexOf(r):-1;-1!==n&&k(n),(0,tm.scrollIntoViewIfNeeded)(b.current,r,l,s)}),N=i.useMemo(()=>({"aria-orientation":"both"===s?void 0:s,ref:v,onFocus(e){b.current&&(0,tm.isNativeInput)(e.target)&&e.target.setSelectionRange(0,e.target.value.length??0)},onKeyDown(e){var i;let o=d?tm.ALL_KEYS:tm.ARROW_KEYS;if(!o.has(e.key)||function(e,t){for(let r of tm.MODIFIER_KEYS.values())if(!t.includes(r)&&e.getModifierState(r))return!0;return!1}(e,m)||!b.current)return;let u="rtl"===l,c=u?tm.ARROW_LEFT:tm.ARROW_RIGHT,p={horizontal:c,vertical:tm.ARROW_DOWN,both:c}[s],x=u?tm.ARROW_RIGHT:tm.ARROW_LEFT,v={horizontal:x,vertical:tm.ARROW_UP,both:x}[s];if((0,tm.isNativeInput)(e.target)&&!(null==(i=e.target)||i.hasAttribute("disabled")||"true"===i.getAttribute("aria-disabled"))){let t=e.target.selectionStart,r=e.target.selectionEnd,n=e.target.value??"";if(null==t||e.shiftKey||t!==r||e.key!==v&&t<n.length||e.key!==p&&t>0)return}let w=j,C=(0,tp.getMinListIndex)(y,f),N=(0,tp.getMaxListIndex)(y,f);if(g){let i=t||Array.from({length:y.current.length},()=>({width:1,height:1})),l=(0,tp.createGridCellMap)(i,r,a),o=l.findIndex(e=>null!=e&&!(0,tp.isListIndexDisabled)(y,e,f)),c=l.reduce((e,t,r)=>null==t||(0,tp.isListIndexDisabled)(y,t,f)?e:r,-1);w=l[(0,tp.getGridNavigatedIndex)({current:l.map(e=>e?y.current[e]:null)},{event:e,orientation:s,loopFocus:n,cols:r,disabledIndices:(0,tp.getGridCellIndices)([...f||y.current.map((e,t)=>(0,tp.isListIndexDisabled)(y,t)?t:void 0),void 0],l),minIndex:o,maxIndex:c,prevIndex:(0,tp.getGridCellIndexOfCorner)(j>N?C:j,i,l,r,e.key===tm.ARROW_DOWN?"bl":e.key===tm.ARROW_RIGHT?"tr":"tl"),rtl:u})]}let S={horizontal:[c],vertical:[tm.ARROW_DOWN],both:[c,tm.ARROW_DOWN]}[s],E={horizontal:[x],vertical:[tm.ARROW_UP],both:[x,tm.ARROW_UP]}[s],A=g?o:({horizontal:d?tm.HORIZONTAL_KEYS_WITH_EXTRA_KEYS:tm.HORIZONTAL_KEYS,vertical:d?tm.VERTICAL_KEYS_WITH_EXTRA_KEYS:tm.VERTICAL_KEYS,both:o})[s];d&&(e.key===tm.HOME?w=C:e.key===tm.END&&(w=N)),w===j&&(S.includes(e.key)||E.includes(e.key))&&(w=n&&w===N&&S.includes(e.key)?C:n&&w===C&&E.includes(e.key)?N:(0,tp.findNonDisabledListIndex)(y,{startingIndex:w,decrement:E.includes(e.key),disabledIndices:f})),w===j||(0,tp.isIndexOutOfListBounds)(y,w)||(h&&e.stopPropagation(),A.has(e.key)&&e.preventDefault(),k(w,!0),queueMicrotask(()=>{y.current[w]?.focus()}))}}),[r,a,l,f,y,d,j,g,t,n,v,m,k,s,h]);return i.useMemo(()=>({props:N,highlightedIndex:j,onHighlightedIndexChange:k,elementsRef:y,disabledIndices:f,onMapChange:C,relayKeyboardEvent:N.onKeyDown}),[N,j,k,y,f,C])}({itemSizes:f,cols:p,loopFocus:m,dense:h,orientation:d,highlightedIndex:u,onHighlightedIndexChange:c,rootRef:v,stopEventPropagation:b,enableHomeAndEndKeys:x,direction:(0,eK.useDirection)(),disabledIndices:y,modifierKeys:w}),I=(0,eH.useRenderElement)(k,e,{state:l,ref:n,props:[N,...a,C],stateAttributesMapping:o}),P=i.useMemo(()=>({highlightedIndex:S,onHighlightedIndexChange:E,highlightItemOnHover:j,relayKeyboardEvent:M}),[S,E,j,M]);return(0,s.jsx)(tg.CompositeRootContext.Provider,{value:P,children:(0,s.jsx)(eG.CompositeList,{elementsRef:A,onMapChange:e=>{g?.(e),D(e)},children:I})})}let ty=i.forwardRef(function(e,t){let{activateOnFocus:r=!1,className:n,loopFocus:a=!0,render:l,...o}=e,{getTabElementBySelectedValue:u,onValueChange:c,orientation:d,value:h,setTabMap:f,tabActivationDirection:m}=eY(),[p,x]=i.useState(0),[g,b]=i.useState(null),v=i.useRef(new Set),y=i.useRef(new Set),w=i.useRef(null),j=(0,eW.useStableCallback)(()=>{v.current.forEach(e=>{e()})});i.useEffect(()=>{if("u"<typeof ResizeObserver)return;let e=new ResizeObserver(()=>{v.current.size&&j()});return w.current=e,g&&e.observe(g),y.current.forEach(t=>{e.observe(t)}),()=>{e.disconnect(),w.current=null}},[g,j]);let k=(0,eW.useStableCallback)(e=>(v.current.add(e),()=>{v.current.delete(e)})),C=(0,eW.useStableCallback)(e=>(y.current.add(e),w.current?.observe(e),()=>{y.current.delete(e),w.current?.unobserve(e)})),N=function(e,t,r,n){let[a,s]=i.useState(null);return(0,eO.useIsoLayoutEffect)(()=>{if(null==e||null==r)return void s(null);let a=n(e);if(null==a)return void s(null);let{left:i,top:l}=tw(a,r);s("horizontal"===t?i:l)},[t,n,r,e]),i.useCallback(i=>{if(i===e)return"none";if(null==i)return s(null),"none";if(null!=i&&null!=r){let e=n(i);if(null!=e){let{left:n,top:i}=tw(e,r);if(null==a)return s("horizontal"===t?n:i),"none";if("horizontal"===t){if(n<a)return s(n),"left";if(n>a)return s(n),"right"}else if(i<a)return s(i),"up";else if(i>a)return s(i),"down"}}return"none"},[n,t,a,r,e])}(h,d,g,u),S=(0,eW.useStableCallback)((e,t)=>{e!==h&&(t.activationDirection=N(e),c(e,t))}),E=i.useMemo(()=>({activateOnFocus:r,highlightedTabIndex:p,registerIndicatorUpdateListener:k,registerTabResizeObserverElement:C,onTabActivation:S,setHighlightedTabIndex:x,tabsListElement:g}),[r,p,k,C,S,x,g]);return(0,s.jsx)(e3.Provider,{value:E,children:(0,s.jsx)(tv,{render:l,className:n,state:{orientation:d,tabActivationDirection:m},refs:[t,b],props:[{"aria-orientation":"vertical"===d?"vertical":void 0,role:"tablist"},o],stateAttributesMapping:eJ,highlightedIndex:p,enableHomeAndEndKeys:!0,loopFocus:a,orientation:d,onHighlightedIndexChange:x,onMapChange:f,disabledIndices:tb.EMPTY_ARRAY})})});function tw(e,t){let{left:r,top:n}=e.getBoundingClientRect(),{left:a,top:s}=t.getBoundingClientRect();return{left:r-a,top:n-s}}e.s(["Indicator",0,ta,"List",0,ty,"Panel",0,th,"Root",0,eX,"Tab",0,e6],370404);var tj=e.i(370404),tj=tj,tk=e.i(164688),tC=e.i(937756);function tN({className:e,orientation:t="horizontal",...r}){return(0,s.jsx)(tj.Root,{"data-slot":"tabs","data-orientation":t,className:(0,tC.cn)("group/tabs flex gap-2 data-horizontal:flex-col",e),...r})}let tS=(0,tk.cva)("group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-horizontal/tabs:h-8 group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col data-[variant=line]:rounded-none",{variants:{variant:{default:"bg-muted",line:"gap-1 bg-transparent"}},defaultVariants:{variant:"default"}});function tE({className:e,variant:t="default",...r}){return(0,s.jsx)(tj.List,{"data-slot":"tabs-list","data-variant":t,className:(0,tC.cn)(tS({variant:t}),e),...r})}function tA({className:e,...t}){return(0,s.jsx)(tj.Tab,{"data-slot":"tabs-trigger",className:(0,tC.cn)("relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 dark:text-muted-foreground dark:hover:text-foreground group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4","group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent","data-active:bg-background data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 dark:data-active:text-foreground","after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100",e),...t})}function tD({className:e,...t}){return(0,s.jsx)(tj.Panel,{"data-slot":"tabs-content",className:(0,tC.cn)("flex-1 text-sm outline-none",e),...t})}var tM=e.i(477795),tI=e.i(486305),tP=e.i(894296),tR=e.i(815681),tB=e.i(996032);let tF=(0,d.default)("file",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]]);function tL(e){return Array.isArray?Array.isArray(e):"[object Array]"===tH(e)}function tz(e){return null==e?"":function(e){if("string"==typeof e)return e;if("bigint"==typeof e)return e.toString();let t=e+"";return"0"==t&&1/e==-1/0?"-0":t}(e)}function t$(e){return"string"==typeof e}function tT(e){return"number"==typeof e}function t_(e){return"object"==typeof e}function tO(e){return null!=e}function tW(e){return!e.trim().length}function tH(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}let tG=Object.prototype.hasOwnProperty;class tK{constructor(e){this._keys=[],this._keyMap={};let t=0;e.forEach(e=>{let r=tV(e);this._keys.push(r),this._keyMap[r.id]=r,t+=r.weight}),this._keys.forEach(e=>{e.weight/=t})}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function tV(e){let t=null,r=null,n=null,a=1,s=null;if(t$(e)||tL(e))n=e,t=tU(e),r=tY(e);else{if(!tG.call(e,"name"))throw Error("Missing name property in key");let i=e.name;if(n=i,tG.call(e,"weight")&&(a=e.weight)<=0)throw Error(`Property 'weight' in key '${i}' must be a positive integer`);t=tU(i),r=tY(i),s=e.getFn}return{path:t,id:r,weight:a,src:n,getFn:s}}function tU(e){return tL(e)?e:e.split(".")}function tY(e){return tL(e)?e.join("."):e}let tq=Object.freeze({isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(e,t)=>e.score===t.score?e.idx<t.idx?-1:1:e.score<t.score?-1:1,includeMatches:!1,findAllMatches:!1,minMatchCharLength:1,location:0,threshold:.6,distance:100,useExtendedSearch:!1,useTokenSearch:!1,getFn:function(e,t){let r=[],n=!1,a=(e,t,s,i)=>{if(tO(e))if(t[s]){var l,o;let u=e[t[s]];if(!tO(u))return;if(s===t.length-1&&(t$(u)||tT(u)||!0===(l=u)||!1===l||t_(o=l)&&null!==o&&"[object Boolean]"==tH(l)||"bigint"==typeof u))r.push(void 0!==i?{v:tz(u),i:i}:tz(u));else if(tL(u)){n=!0;for(let e=0,r=u.length;e<r;e+=1)a(u[e],t,s+1,e)}else t.length&&a(u,t,s+1,i)}else r.push(void 0!==i?{v:e,i:i}:e)};return a(e,t$(t)?t.split("."):t,0),n?r:r[0]},ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1}),tJ=/[^ ]+/g;class tX{constructor({getFn:e=tq.getFn,fieldNormWeight:t=tq.fieldNormWeight}={}){this.norm=function(e=1,t=3){let r=new Map,n=Math.pow(10,t);return{get(t){let a=t.match(tJ).length;if(r.has(a))return r.get(a);let s=parseFloat(Math.round(1/Math.pow(a,.5*e)*n)/n);return r.set(a,s),s},clear(){r.clear()}}}(t,3),this.getFn=e,this.isCreated=!1,this.docs=[],this.keys=[],this._keysMap={},this.setIndexRecords()}setSources(e=[]){this.docs=e}setIndexRecords(e=[]){this.records=e}setKeys(e=[]){this.keys=e,this._keysMap={},e.forEach((e,t)=>{this._keysMap[e.id]=t})}create(){!this.isCreated&&this.docs.length&&(this.isCreated=!0,t$(this.docs[0])?this.docs.forEach((e,t)=>{this._addString(e,t)}):this.docs.forEach((e,t)=>{this._addObject(e,t)}),this.norm.clear())}add(e){let t=this.size();t$(e)?this._addString(e,t):this._addObject(e,t)}removeAt(e){this.records.splice(e,1);for(let t=e,r=this.size();t<r;t+=1)this.records[t].i-=1}removeAll(e){for(let t=e.length-1;t>=0;t-=1)this.records.splice(e[t],1);for(let e=0,t=this.records.length;e<t;e+=1)this.records[e].i=e}getValueForItemAtKeyId(e,t){return e[this._keysMap[t]]}size(){return this.records.length}_addString(e,t){if(!tO(e)||tW(e))return;let r={v:e,i:t,n:this.norm.get(e)};this.records.push(r)}_addObject(e,t){let r={i:t,$:{}};this.keys.forEach((t,n)=>{let a=t.getFn?t.getFn(e):this.getFn(e,t.path);if(tO(a)){if(tL(a)){let e=[];for(let t=0,r=a.length;t<r;t+=1){let r=a[t];if(tO(r)){if(t$(r)){if(!tW(r)){let n={v:r,i:t,n:this.norm.get(r)};e.push(n)}}else if(tO(r.v)){let t=t$(r.v)?r.v:tz(r.v);if(!tW(t)){let n={v:t,i:r.i,n:this.norm.get(t)};e.push(n)}}}}r.$[n]=e}else if(t$(a)&&!tW(a)){let e={v:a,n:this.norm.get(a)};r.$[n]=e}}}),this.records.push(r)}toJSON(){return{keys:this.keys.map(({getFn:e,...t})=>t),records:this.records}}}function tQ(e,t,{getFn:r=tq.getFn,fieldNormWeight:n=tq.fieldNormWeight}={}){let a=new tX({getFn:r,fieldNormWeight:n});return a.setKeys(e.map(tV)),a.setSources(t),a.create(),a}function tZ(e){if(e.length<=1)return e;e.sort((e,t)=>e[0]-t[0]||e[1]-t[1]);let t=[e[0]];for(let r=1,n=e.length;r<n;r+=1){let n=t[t.length-1],a=e[r];a[0]<=n[1]+1?n[1]=Math.max(n[1],a[1]):t.push(a)}return t}let t0={ł:"l",Ł:"L",đ:"d",Đ:"D",ø:"o",Ø:"O",ħ:"h",Ħ:"H",ŧ:"t",Ŧ:"T",ı:"i",ß:"ss"},t1=RegExp("["+Object.keys(t0).join("")+"]","g"),t2=String.prototype.normalize?e=>e.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,"").replace(t1,e=>t0[e]):e=>e;class t3{constructor(e,{location:t=tq.location,threshold:r=tq.threshold,distance:n=tq.distance,includeMatches:a=tq.includeMatches,findAllMatches:s=tq.findAllMatches,minMatchCharLength:i=tq.minMatchCharLength,isCaseSensitive:l=tq.isCaseSensitive,ignoreDiacritics:o=tq.ignoreDiacritics,ignoreLocation:u=tq.ignoreLocation}={}){if(this.options={location:t,threshold:r,distance:n,includeMatches:a,findAllMatches:s,minMatchCharLength:i,isCaseSensitive:l,ignoreDiacritics:o,ignoreLocation:u},e=l?e:e.toLowerCase(),e=o?t2(e):e,this.pattern=e,this.chunks=[],!this.pattern.length)return;const c=(e,t)=>{this.chunks.push({pattern:e,alphabet:function(e){let t={};for(let r=0,n=e.length;r<n;r+=1){let a=e.charAt(r);t[a]=(t[a]||0)|1<<n-r-1}return t}(e),startIndex:t})},d=this.pattern.length;if(d>32){let e=0;const t=d%32,r=d-t;for(;e<r;)c(this.pattern.substr(e,32),e),e+=32;if(t){const e=d-32;c(this.pattern.substr(e),e)}}else c(this.pattern,0)}searchIn(e){let{isCaseSensitive:t,ignoreDiacritics:r,includeMatches:n}=this.options;if(e=t?e:e.toLowerCase(),e=r?t2(e):e,this.pattern===e){let t={isMatch:!0,score:0};return n&&(t.indices=[[0,e.length-1]]),t}let{location:a,distance:s,threshold:i,findAllMatches:l,minMatchCharLength:o,ignoreLocation:u}=this.options,c=[],d=0,h=!1;this.chunks.forEach(({pattern:t,alphabet:r,startIndex:f})=>{let{isMatch:m,score:p,indices:x}=function(e,t,r,{location:n=tq.location,distance:a=tq.distance,threshold:s=tq.threshold,findAllMatches:i=tq.findAllMatches,minMatchCharLength:l=tq.minMatchCharLength,includeMatches:o=tq.includeMatches,ignoreLocation:u=tq.ignoreLocation}={}){let c;if(t.length>32)throw Error("Pattern length exceeds max of 32.");let d=t.length,h=e.length,f=Math.max(0,Math.min(n,h)),m=s,p=f,x=(e,t)=>{let r=e/d;if(u)return r;let n=Math.abs(f-t);return a?r+n/a:n?1:r},g=l>1||o,b=g?Array(h):[];for(;(c=e.indexOf(t,p))>-1;)if(m=Math.min(x(0,c),m),p=c+d,g){let e=0;for(;e<d;)b[c+e]=1,e+=1}p=-1;let v=[],y=1,w=d+h,j=1<<d-1;for(let t=0;t<d;t+=1){let n=0,a=w;for(;n<a;)x(t,f+a)<=m?n=a:w=a,a=Math.floor((w-n)/2+n);w=a;let s=Math.max(1,f-a+1),l=i?h:Math.min(f+a,h)+d,o=Array(l+2);o[l+1]=(1<<t)-1;for(let n=l;n>=s;n-=1){let a=n-1,i=r[e[a]];if(g&&(b[a]=+!!i),o[n]=(o[n+1]<<1|1)&i,t&&(o[n]|=(v[n+1]|v[n])<<1|1|v[n+1]),o[n]&j&&(y=x(t,a))<=m){if(m=y,(p=a)<=f)break;s=Math.max(1,2*f-p)}}if(x(t+1,f)>m)break;v=o}let k={isMatch:p>=0,score:Math.max(.001,y)};if(g){let e=function(e=[],t=tq.minMatchCharLength){let r=[],n=-1,a=-1,s=0;for(let i=e.length;s<i;s+=1){let i=e[s];i&&-1===n?n=s:i||-1===n||((a=s-1)-n+1>=t&&r.push([n,a]),n=-1)}return e[s-1]&&s-n>=t&&r.push([n,s-1]),r}(b,l);e.length?o&&(k.indices=e):k.isMatch=!1}return k}(e,t,r,{location:a+f,distance:s,threshold:i,findAllMatches:l,minMatchCharLength:o,includeMatches:n,ignoreLocation:u});m&&(h=!0),d+=p,m&&x&&c.push(...x)});let f={isMatch:h,score:h?d/this.chunks.length:1};return h&&n&&(f.indices=tZ(c)),f}}class t5{constructor(e){this.pattern=e}static isMultiMatch(e){return t4(e,this.multiRegex)}static isSingleMatch(e){return t4(e,this.singleRegex)}search(e){return{isMatch:!1,score:1}}}function t4(e,t){let r=e.match(t);return r?r[1]:null}class t8 extends t5{constructor(e,{location:t=tq.location,threshold:r=tq.threshold,distance:n=tq.distance,includeMatches:a=tq.includeMatches,findAllMatches:s=tq.findAllMatches,minMatchCharLength:i=tq.minMatchCharLength,isCaseSensitive:l=tq.isCaseSensitive,ignoreDiacritics:o=tq.ignoreDiacritics,ignoreLocation:u=tq.ignoreLocation}={}){super(e),this._bitapSearch=new t3(e,{location:t,threshold:r,distance:n,includeMatches:a,findAllMatches:s,minMatchCharLength:i,isCaseSensitive:l,ignoreDiacritics:o,ignoreLocation:u})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(e){return this._bitapSearch.searchIn(e)}}class t7 extends t5{constructor(e){super(e)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(e){let t,r=0,n=[],a=this.pattern.length;for(;(t=e.indexOf(this.pattern,r))>-1;)r=t+a,n.push([t,r-1]);let s=!!n.length;return{isMatch:s,score:+!s,indices:n}}}let t6=[class extends t5{constructor(e){super(e)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(e){let t=e===this.pattern;return{isMatch:t,score:+!t,indices:[0,this.pattern.length-1]}}},t7,class extends t5{constructor(e){super(e)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(e){let t=e.startsWith(this.pattern);return{isMatch:t,score:+!t,indices:[0,this.pattern.length-1]}}},class extends t5{constructor(e){super(e)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(e){let t=!e.startsWith(this.pattern);return{isMatch:t,score:+!t,indices:[0,e.length-1]}}},class extends t5{constructor(e){super(e)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(e){let t=!e.endsWith(this.pattern);return{isMatch:t,score:+!t,indices:[0,e.length-1]}}},class extends t5{constructor(e){super(e)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(e){let t=e.endsWith(this.pattern);return{isMatch:t,score:+!t,indices:[e.length-this.pattern.length,e.length-1]}}},class extends t5{constructor(e){super(e)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(e){let t=-1===e.indexOf(this.pattern);return{isMatch:t,score:+!t,indices:[0,e.length-1]}}},t8],t9=t6.length,re=new Set([t8.type,t7.type]),rt=[];function rr(...e){rt.push(...e)}function rn(e,t){for(let r=0,n=rt.length;r<n;r+=1){let n=rt[r];if(n.condition(e,t))return new n(e,t)}return new t3(e,t)}let ra="$and",rs="$path",ri=e=>!!(e[ra]||e.$or),rl=e=>({[ra]:Object.keys(e).map(t=>({[t]:e[t]}))});function ro(e,t,{auto:r=!0}={}){let n=e=>{if(t$(e)){let n={keyId:null,pattern:e};return r&&(n.searcher=rn(e,t)),n}let a=Object.keys(e),s=!!e[rs];if(!s&&a.length>1&&!ri(e))return n(rl(e));if(!tL(e)&&t_(e)&&!ri(e)){let n=s?e[rs]:a[0],i=s?e.$val:e[n];if(!t$(i))throw Error(`Invalid value for key ${n}`);let l={keyId:tY(n),pattern:i};return r&&(l.searcher=rn(i,t)),l}let i={children:[],operator:a[0]};return a.forEach(t=>{let r=e[t];tL(r)&&r.forEach(e=>{i.children.push(n(e))})}),i};return ri(e)||(e=rl(e)),n(e)}function ru(e,{ignoreFieldNorm:t=tq.ignoreFieldNorm}){let r=1;return e.forEach(({key:e,norm:n,score:a})=>{let s=e?e.weight:null;r*=Math.pow(0===a&&s?Number.EPSILON:a,(s||1)*(t?1:n))}),r}class rc{constructor(e){this.limit=e,this.heap=[]}get size(){return this.heap.length}shouldInsert(e){return this.size<this.limit||e<this.heap[0].score}insert(e){this.size<this.limit?(this.heap.push(e),this._bubbleUp(this.size-1)):e.score<this.heap[0].score&&(this.heap[0]=e,this._sinkDown(0))}extractSorted(e){return this.heap.sort(e)}_bubbleUp(e){let t=this.heap;for(;e>0;){let r=e-1>>1;if(t[e].score<=t[r].score)break;let n=t[e];t[e]=t[r],t[r]=n,e=r}}_sinkDown(e){let t=this.heap,r=t.length,n=e;do{let a=2*(e=n)+1,s=2*e+2;if(a<r&&t[a].score>t[n].score&&(n=a),s<r&&t[s].score>t[n].score&&(n=s),n!==e){let r=t[e];t[e]=t[n],t[n]=r}}while(n!==e)}}function rd(e,t){let r=e.matches;t.matches=[],tO(r)&&r.forEach(e=>{if(!tO(e.indices)||!e.indices.length)return;let{indices:r,value:n}=e,a={indices:r,value:n};e.key&&(a.key=e.key.src),e.idx>-1&&(a.refIndex=e.idx),t.matches.push(a)})}function rh(e,t){t.score=e.score}let rf=/\b\w+\b/g;function rm({isCaseSensitive:e=!1,ignoreDiacritics:t=!1}={}){return{tokenize:r=>(e||(r=r.toLowerCase()),t&&(r=t2(r)),r.match(rf)||[])}}function rp(e,t){for(let[r,n]of e.terms){let a=n.filter(e=>e.docIdx!==t),s=n.length-a.length;s>0&&(e.fieldCount-=s,e.df.set(r,(e.df.get(r)||0)-s),0===a.length?(e.terms.delete(r),e.df.delete(r)):e.terms.set(r,a))}}class rx{constructor(e,t,r){this.options={...tq,...t},this.options.useExtendedSearch,this.options.useTokenSearch,this._keyStore=new tK(this.options.keys),this._docs=e,this._myIndex=null,this._invertedIndex=null,this.setCollection(e,r),this._lastQuery=null,this._lastSearcher=null}_getSearcher(e){if(this._lastQuery===e)return this._lastSearcher;let t=rn(e,this._invertedIndex?{...this.options,_invertedIndex:this._invertedIndex}:this.options);return this._lastQuery=e,this._lastSearcher=t,t}setCollection(e,t){if(this._docs=e,t&&!(t instanceof tX))throw Error("Incorrect 'index' type");if(this._myIndex=t||tQ(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight}),this.options.useTokenSearch){let e=rm({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics});this._invertedIndex=function(e,t,r){let n=new Map,a=new Map,s=0;function i(e,t,i,l){let o=r.tokenize(e);if(!o.length)return;s++;let u=new Map;for(let e of o)u.set(e,(u.get(e)||0)+1);for(let[e,r]of u){let s={docIdx:t,keyIdx:i,subIdx:l,tf:r},o=n.get(e);o||(o=[],n.set(e,o)),o.push(s),a.set(e,(a.get(e)||0)+1)}}for(let r of e){let{i:e,v:n,$:a}=r;if(void 0!==n){i(n,e,-1,-1);continue}if(a)for(let r=0;r<t;r++){let t=a[r];if(t)if(Array.isArray(t))for(let n of t)i(n.v,e,r,n.i??-1);else i(t.v,e,r,-1)}}return{terms:n,fieldCount:s,df:a}}(this._myIndex.records,this._myIndex.keys.length,e)}}add(e){if(tO(e)&&(this._docs.push(e),this._myIndex.add(e),this._invertedIndex)){let e=this._myIndex.records[this._myIndex.records.length-1],t=rm({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics});!function(e,t,r,n){let{i:a,v:s,$:i}=t;function l(t,r,s){let i=n.tokenize(t);if(!i.length)return;e.fieldCount++;let l=new Map;for(let e of i)l.set(e,(l.get(e)||0)+1);for(let[t,n]of l){let i={docIdx:a,keyIdx:r,subIdx:s,tf:n},l=e.terms.get(t);l||(l=[],e.terms.set(t,l)),l.push(i),e.df.set(t,(e.df.get(t)||0)+1)}}if(void 0!==s)return l(s,-1,-1);if(i)for(let e=0;e<r;e++){let t=i[e];if(t)if(Array.isArray(t))for(let r of t)l(r.v,e,r.i??-1);else l(t.v,e,-1)}}(this._invertedIndex,e,this._myIndex.keys.length,t)}}remove(e=()=>!1){let t=[],r=[];for(let n=0,a=this._docs.length;n<a;n+=1)e(this._docs[n],n)&&(t.push(this._docs[n]),r.push(n));if(r.length){if(this._invertedIndex)for(let e of r)rp(this._invertedIndex,e);for(let e=r.length-1;e>=0;e-=1)this._docs.splice(r[e],1);this._myIndex.removeAll(r)}return t}removeAt(e){this._invertedIndex&&rp(this._invertedIndex,e);let t=this._docs.splice(e,1)[0];return this._myIndex.removeAt(e),t}getIndex(){return this._myIndex}search(e,t){let r,{limit:n=-1}=t||{},{includeMatches:a,includeScore:s,shouldSort:i,sortFn:l,ignoreFieldNorm:o}=this.options;if(t$(e)&&!e.trim()){let e=this._docs.map((e,t)=>({item:e,refIndex:t}));return tT(n)&&n>-1&&(e=e.slice(0,n)),e}if(tT(n)&&n>0&&t$(e)){let t=new rc(n);t$(this._docs[0])?this._searchStringList(e,{heap:t,ignoreFieldNorm:o}):this._searchObjectList(e,{heap:t,ignoreFieldNorm:o}),r=t.extractSorted(l)}else!function(e,{ignoreFieldNorm:t=tq.ignoreFieldNorm}){e.forEach(e=>{e.score=ru(e.matches,{ignoreFieldNorm:t})})}(r=t$(e)?t$(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e),{ignoreFieldNorm:o}),i&&r.sort(l),tT(n)&&n>-1&&(r=r.slice(0,n));return function(e,t,{includeMatches:r=tq.includeMatches,includeScore:n=tq.includeScore}={}){let a=[];return r&&a.push(rd),n&&a.push(rh),e.map(e=>{let{idx:r}=e,n={item:t[r],refIndex:r};return a.length&&a.forEach(t=>{t(e,n)}),n})}(r,this._docs,{includeMatches:a,includeScore:s})}_searchStringList(e,{heap:t,ignoreFieldNorm:r}={}){let n=this._getSearcher(e),{records:a}=this._myIndex,s=t?null:[];return a.forEach(({v:e,i:a,n:i})=>{if(!tO(e))return;let{isMatch:l,score:o,indices:u}=n.searchIn(e);if(l){let n={item:e,idx:a,matches:[{score:o,value:e,norm:i,indices:u}]};t?(n.score=ru(n.matches,{ignoreFieldNorm:r}),t.shouldInsert(n.score)&&t.insert(n)):s.push(n)}}),s}_searchLogical(e){let t=ro(e,this.options),r=(e,t,n)=>{if(!("children"in e)){let r,{keyId:a,searcher:s}=e;return(null===a?(r=[],this._myIndex.keys.forEach((e,n)=>{r.push(...this._findMatches({key:e,value:t[n],searcher:s}))})):r=this._findMatches({key:this._keyStore.get(a),value:this._myIndex.getValueForItemAtKeyId(t,a),searcher:s}),r&&r.length)?[{idx:n,item:t,matches:r}]:[]}let{children:a,operator:s}=e,i=[];for(let e=0,l=a.length;e<l;e+=1){let l=r(a[e],t,n);if(l.length)i.push(...l);else if(s===ra)return[]}return i},n=this._myIndex.records,a=new Map,s=[];return n.forEach(({$:e,i:n})=>{if(tO(e)){let i=r(t,e,n);i.length&&(a.has(n)||(a.set(n,{idx:n,item:e,matches:[]}),s.push(a.get(n))),i.forEach(({matches:e})=>{a.get(n).matches.push(...e)}))}}),s}_searchObjectList(e,{heap:t,ignoreFieldNorm:r}={}){let n=this._getSearcher(e),{keys:a,records:s}=this._myIndex,i=t?null:[];return s.forEach(({$:e,i:s})=>{if(!tO(e))return;let l=[],o=!1,u=!1;if(a.forEach((t,r)=>{let a=this._findMatches({key:t,value:e[r],searcher:n});a.length?(l.push(...a),a[0].hasInverse&&(u=!0)):o=!0}),(!u||!o)&&l.length){let n={idx:s,item:e,matches:l};t?(n.score=ru(n.matches,{ignoreFieldNorm:r}),t.shouldInsert(n.score)&&t.insert(n)):i.push(n)}}),i}_findMatches({key:e,value:t,searcher:r}){if(!tO(t))return[];let n=[];if(tL(t))t.forEach(({v:t,i:a,n:s})=>{if(!tO(t))return;let{isMatch:i,score:l,indices:o,hasInverse:u}=r.searchIn(t);i&&n.push({score:l,key:e,value:t,idx:a,norm:s,indices:o,hasInverse:u})});else{let{v:a,n:s}=t,{isMatch:i,score:l,indices:o,hasInverse:u}=r.searchIn(a);i&&n.push({score:l,key:e,value:a,norm:s,indices:o,hasInverse:u})}return n}}rx.version="7.3.0",rx.createIndex=tQ,rx.parseIndex=function(e,{getFn:t=tq.getFn,fieldNormWeight:r=tq.fieldNormWeight}={}){let{keys:n,records:a}=e,s=new tX({getFn:t,fieldNormWeight:r});return s.setKeys(n),s.setIndexRecords(a),s},rx.config=tq,rx.match=function(e,t,r){return rn(e,{...tq,...r}).searchIn(t)},rx.parseQuery=ro,rr(class{constructor(e,{isCaseSensitive:t=tq.isCaseSensitive,ignoreDiacritics:r=tq.ignoreDiacritics,includeMatches:n=tq.includeMatches,minMatchCharLength:a=tq.minMatchCharLength,ignoreLocation:s=tq.ignoreLocation,findAllMatches:i=tq.findAllMatches,location:l=tq.location,threshold:o=tq.threshold,distance:u=tq.distance}={}){this.query=null,this.options={isCaseSensitive:t,ignoreDiacritics:r,includeMatches:n,minMatchCharLength:a,findAllMatches:i,ignoreLocation:s,location:l,threshold:o,distance:u},e=t?e:e.toLowerCase(),e=r?t2(e):e,this.pattern=e,this.query=function(e,t={}){return e.replace(/\\\|/g,"\0").split("|").map(e=>{let r=(function(e){let t=[],r=e.length,n=0;for(;n<r;){for(;n<r&&" "===e[n];)n++;if(n>=r)break;let a=n;for(;a<r&&" "!==e[a]&&'"'!==e[a];)a++;if(a<r&&'"'===e[a]){for(a++;a<r;){if('"'===e[a]){let t=a+1;if(t>=r||" "===e[t]){a++;break}if("$"===e[t]&&(t+1>=r||" "===e[t+1])){a+=2;break}}a++}t.push(e.substring(n,a)),n=a}else{for(;a<r&&" "!==e[a];)a++;t.push(e.substring(n,a)),n=a}}return t})(e.replace(/\u0000/g,"|").trim()).filter(e=>e&&!!e.trim()),n=[];for(let e=0,a=r.length;e<a;e+=1){let a=r[e],s=!1,i=-1;for(;!s&&++i<t9;){let e=t6[i],r=e.isMultiMatch(a);r&&(n.push(new e(r,t)),s=!0)}if(!s)for(i=-1;++i<t9;){let e=t6[i],r=e.isSingleMatch(a);if(r){n.push(new e(r,t));break}}}return n})}(this.pattern,this.options)}static condition(e,t){return t.useExtendedSearch}searchIn(e){let t=this.query;if(!t)return{isMatch:!1,score:1};let{includeMatches:r,isCaseSensitive:n,ignoreDiacritics:a}=this.options;e=n?e:e.toLowerCase(),e=a?t2(e):e;let s=0,i=[],l=0,o=!1;for(let n=0,a=t.length;n<a;n+=1){let a=t[n];i.length=0,s=0,o=!1;for(let t=0,n=a.length;t<n;t+=1){let n=a[t],{isMatch:u,indices:c,score:d}=n.search(e);if(u){s+=1,l+=d;let e=n.constructor.type;e.startsWith("inverse")&&(o=!0),r&&(re.has(e)?i.push(...c):i.push(c))}else{l=0,s=0,i.length=0,o=!1;break}}if(s){let e={isMatch:!0,score:l/s};return o&&(e.hasInverse=!0),r&&(e.indices=tZ(i)),e}}return{isMatch:!1,score:1}}}),rr(class{static condition(e,t){return t.useTokenSearch}constructor(e,t){this.options=t,this.analyzer=rm({isCaseSensitive:t.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics});const r=this.analyzer.tokenize(e),{df:n,fieldCount:a}=t._invertedIndex;for(const e of(this.termSearchers=[],this.idfWeights=[],r)){this.termSearchers.push(new t3(e,{location:t.location,threshold:t.threshold,distance:t.distance,includeMatches:t.includeMatches,findAllMatches:t.findAllMatches,minMatchCharLength:t.minMatchCharLength,isCaseSensitive:t.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics,ignoreLocation:!0}));const r=n.get(e)||0,s=Math.log(1+(a-r+.5)/(r+.5));this.idfWeights.push(s)}}searchIn(e){if(!this.termSearchers.length)return{isMatch:!1,score:1};let t=[],r=0,n=0,a=0;for(let s=0;s<this.termSearchers.length;s++){let i=this.termSearchers[s].searchIn(e),l=this.idfWeights[s];n+=l,i.isMatch&&(a++,r+=l*(1-i.score),i.indices&&t.push(...i.indices))}if(0===a)return{isMatch:!1,score:1};let s={isMatch:!0,score:Math.max(.001,n>0?1-r/n:0)};return this.options.includeMatches&&t.length&&(s.indices=tZ(t)),s}}),rx.use=function(...e){e.forEach(e=>rr(e))};var rg=e.i(726111),rb=e.i(142124),rv=e.i(718837),ry=e.i(711296),rw=e.i(625054),rj=e.i(830954),rk=e.i(750337),rC=e.i(347615),rN=e.i(28034),rS=e.i(337104),rE=e.i(447868),rA=e.i(74418),rD=e.i(803041),rM=e.i(458851);let rI=(0,d.default)("file-code",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]]),rP=(0,d.default)("file-braces",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1",key:"1oajmo"}],["path",{d:"M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1",key:"mpwhp6"}]]);var rR=e.i(555159),rB=e.i(478430);function rF({entry:e,worktreePath:t,depth:r,gitStatusMap:n,expandedPaths:a,childrenMap:l,selectedPath:o,onFileSelect:u,onToggleExpand:c,onContextMenu:d,renamingPath:h,onRenameSubmit:f,onRenameCancel:m,creatingIn:p,onCreateSubmit:x,onCreateCancel:g}){let{t:b}=(0,rw.useI18n)(),v=a.has(e.relativePath),y=o===e.relativePath,w=h===e.relativePath,j=n[e.relativePath],k=l.get(e.relativePath)??[],C=e.isDirectory&&p?.parentPath===e.relativePath&&v,N=(0,i.useRef)(null),S=(0,i.useRef)(null);(0,i.useEffect)(()=>{w&&N.current&&(N.current.focus(),N.current.select())},[w]),(0,i.useEffect)(()=>{C&&S.current&&S.current.focus()},[C]);let E=["flex items-center gap-1 py-0.5 px-1 cursor-pointer hover:bg-accent hover:text-accent-foreground rounded-sm min-h-[28px]",y?"bg-secondary text-secondary-foreground font-medium":""].filter(Boolean).join(" "),A={paddingLeft:`calc(${r} * 8px + 4px)`};return(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:E,style:A,onClick:()=>{if(e.isDirectory)c(e.relativePath);else{let r=t.endsWith("/")?t.slice(0,-1):t,n=e.relativePath.startsWith("/")?e.relativePath.slice(1):e.relativePath;u(`${r}/${n}`)}},onContextMenu:t=>{t.preventDefault(),d(e,t.clientX,t.clientY)},role:"treeitem","aria-expanded":e.isDirectory?v:void 0,children:[e.isDirectory?(0,s.jsx)("span",{className:"flex-shrink-0",children:v?(0,s.jsx)(rM.ChevronDown,{className:"h-3 w-3 transition-transform duration-150"}):(0,s.jsx)(rD.ChevronRight,{className:"h-3 w-3 transition-transform duration-150"})}):(0,s.jsx)("span",{className:"h-3 w-3 flex-shrink-0"}),function(e,t,r){if(t)return r?(0,s.jsx)(rB.FolderOpen,{className:"h-3.5 w-3.5 flex-shrink-0 text-amber-400"}):(0,s.jsx)(tR.Folder,{className:"h-3.5 w-3.5 flex-shrink-0 text-amber-400"});let n=e.includes(".")?e.split(".").pop()?.toLowerCase():"";return"ts"===n||"tsx"===n?(0,s.jsx)(rI,{className:"h-3.5 w-3.5 flex-shrink-0 text-blue-400"}):"json"===n?(0,s.jsx)(rP,{className:"h-3.5 w-3.5 flex-shrink-0 text-yellow-400"}):"md"===n||"mdx"===n?(0,s.jsx)(rR.FileText,{className:"h-3.5 w-3.5 flex-shrink-0 text-muted-foreground"}):"css"===n||"scss"===n||"sass"===n?(0,s.jsx)(tF,{className:"h-3.5 w-3.5 flex-shrink-0 text-pink-400"}):(0,s.jsx)(tF,{className:"h-3.5 w-3.5 flex-shrink-0 text-muted-foreground"})}(e.name,e.isDirectory,v),w?(0,s.jsx)("input",{ref:N,type:"text",defaultValue:e.name,className:"ring-1 ring-primary rounded-sm px-1 text-[13px] w-full bg-background",placeholder:b("taskPage.fileTree.renamePlaceholder"),onKeyDown:t=>{if("Enter"===t.key){let r=t.currentTarget.value.trim();r&&r!==e.name?f(e,r):m()}else"Escape"===t.key&&m()},onBlur:m,onClick:e=>e.stopPropagation()}):(0,s.jsx)("span",{className:"text-[13px] truncate flex-1",children:e.name}),j&&!w&&(0,s.jsx)("span",{className:`ml-auto text-[11px] font-normal ${"M"===j?"text-amber-500 dark:text-amber-400":"A"===j?"text-emerald-500 dark:text-emerald-400":"text-red-500 dark:text-red-400"}`,children:j})]}),e.isDirectory&&v&&(0,s.jsxs)("div",{children:[k.map(e=>(0,s.jsx)(rF,{entry:e,worktreePath:t,depth:r+1,gitStatusMap:n,expandedPaths:a,childrenMap:l,selectedPath:o,onFileSelect:u,onToggleExpand:c,onContextMenu:d,renamingPath:h,onRenameSubmit:f,onRenameCancel:m,creatingIn:p,onCreateSubmit:x,onCreateCancel:g},e.relativePath)),C&&(0,s.jsxs)("div",{className:"flex items-center gap-1 py-0.5 px-1 min-h-[28px]",style:{paddingLeft:`calc(${r+1} * 8px + 4px)`},children:[(0,s.jsx)("span",{className:"h-3 w-3 flex-shrink-0"}),p?.type==="folder"?(0,s.jsx)(tR.Folder,{className:"h-3.5 w-3.5 flex-shrink-0 text-amber-400"}):(0,s.jsx)(tF,{className:"h-3.5 w-3.5 flex-shrink-0 text-muted-foreground"}),(0,s.jsx)("input",{ref:S,type:"text",className:"ring-1 ring-primary rounded-sm px-1 text-[13px] w-full bg-background",placeholder:b(p?.type==="folder"?"taskPage.fileTree.newFolderPlaceholder":"taskPage.fileTree.newFilePlaceholder"),onKeyDown:e=>{if("Enter"===e.key){let t=e.currentTarget.value.trim();t&&p?x(p.parentPath,t,p.type):g()}else"Escape"===e.key&&g()},onBlur:g})]})]})]})}var rL=e.i(9235);function rz({entry:e,x:t,y:r,onClose:n,onNewFile:a,onNewFolder:l,onRename:o,onDelete:u,onRevealInFinder:c}){let{t:d}=(0,rw.useI18n)(),h=(0,i.useRef)(null);(0,i.useEffect)(()=>{let e=e=>{h.current&&!h.current.contains(e.target)&&n()},t=e=>{"Escape"===e.key&&n()};return document.addEventListener("mousedown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",t)}},[n]);let f=".git"===e.name||".git"===e.relativePath,m="flex items-center px-3 py-1.5 text-xs cursor-pointer hover:bg-accent rounded-sm w-full text-left",p=(0,s.jsxs)("div",{ref:h,style:{position:"fixed",top:r,left:t,zIndex:9999},className:"bg-popover border border-border rounded-md shadow-md py-1 min-w-[160px]",children:[(0,s.jsx)("button",{type:"button",className:m,onClick:()=>{a(e),n()},children:d("taskPage.fileTree.newFile")}),(0,s.jsx)("button",{type:"button",className:m,onClick:()=>{l(e),n()},children:d("taskPage.fileTree.newFolder")}),(0,s.jsx)("hr",{className:"my-1 border-border"}),(0,s.jsx)("button",{type:"button",className:m,onClick:()=>{o(e),n()},children:d("taskPage.fileTree.rename")}),c&&(0,s.jsx)("button",{type:"button",className:m,onClick:()=>{c(e),n()},children:d("taskPage.fileTree.revealInFinder")}),!f&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("hr",{className:"my-1 border-border"}),(0,s.jsx)("button",{type:"button",className:`${m} text-destructive hover:bg-destructive/10`,onClick:()=>{u(e),n()},children:d("taskPage.fileTree.delete")})]})]});return"u"<typeof document?null:(0,rL.createPortal)(p,document.body)}function r$({worktreePath:t,baseBranch:r,worktreeBranch:n,executionStatus:a,onFileSelect:l}){let{t:o}=(0,rw.useI18n)(),[u,c]=(0,i.useState)([]),[d,f]=(0,i.useState)(new Set),[m,p]=(0,i.useState)(new Map),[x,g]=(0,i.useState)({}),[v,y]=(0,i.useState)(null),[w,j]=(0,i.useState)(null),[k,C]=(0,i.useState)(null),[N,S]=(0,i.useState)(null),[E,A]=(0,i.useState)(null),[D,M]=(0,i.useState)(!1),[I,P]=(0,i.useState)(!1),[R,B]=(0,i.useState)(""),[F,L]=(0,i.useState)([]),[z,$]=(0,i.useState)(!1),[T,_]=(0,i.useState)(0),O=(0,i.useRef)(null),W=(0,i.useRef)(null),H=(0,i.useRef)(d);H.current=d;let G=(0,i.useCallback)(async()=>{if(t)try{let e=await (0,rj.listDirectory)(t,".");c(e),P(!1)}catch{P(!0)}},[t]),K=(0,i.useCallback)(async e=>{if(t)try{let r=await (0,rj.listDirectory)(t,e);p(t=>{let n=new Map(t);return n.set(e,r),n})}catch{}},[t]),V=(0,i.useCallback)(async()=>{if(t)try{let e=await (0,rj.listDirectory)(t,".");for(let r of(c(e),H.current)){let e=await (0,rj.listDirectory)(t,r).catch(()=>null);e&&p(t=>{let n=new Map(t);return n.set(r,e),n})}}catch{}},[t]);(0,i.useEffect)(()=>{t&&(M(!0),P(!1),c([]),p(new Map),f(new Set),y(null),G().finally(()=>M(!1)),(0,rk.getGitStatus)(t,r,n).then(g).catch(()=>g({})))},[t,r,n,G]),(0,i.useEffect)(()=>{if("RUNNING"!==a)return;let e=setInterval(V,2e3);return()=>clearInterval(e)},[a,V]);let U=(0,i.useCallback)(e=>{f(t=>{let r=new Set(t);return r.has(e)?r.delete(e):(r.add(e),m.has(e)||K(e)),r})},[m,K]),Y=(0,i.useCallback)(e=>{let r=(t??"").endsWith("/")?t??"":`${t??""}/`;y(e.startsWith(r)?e.slice(r.length):e),l(e)},[t,l]),q=(0,i.useCallback)((e,t,r)=>{S({entry:e,x:t,y:r})},[]),J=(0,i.useCallback)(e=>{C({parentPath:e.isDirectory?e.relativePath:e.relativePath.includes("/")?e.relativePath.slice(0,e.relativePath.lastIndexOf("/")):".",type:"file"}),e.isDirectory&&(f(t=>{let r=new Set(t);return r.add(e.relativePath),r}),m.has(e.relativePath)||K(e.relativePath))},[m,K]),X=(0,i.useCallback)(e=>{C({parentPath:e.isDirectory?e.relativePath:e.relativePath.includes("/")?e.relativePath.slice(0,e.relativePath.lastIndexOf("/")):".",type:"folder"}),e.isDirectory&&(f(t=>{let r=new Set(t);return r.add(e.relativePath),r}),m.has(e.relativePath)||K(e.relativePath))},[m,K]),Q=(0,i.useCallback)(e=>{j(e.relativePath)},[]),Z=(0,i.useCallback)(e=>{A(e)},[]),ee=(0,i.useCallback)(async(e,r)=>{if(!t)return;j(null);let n=e.relativePath.includes("/")?e.relativePath.slice(0,e.relativePath.lastIndexOf("/")):".",a="."===n?r:`${n}/${r}`;try{await (0,rS.renameEntry)(t,e.relativePath,a),await V()}catch{}},[t,V]),et=(0,i.useCallback)(()=>{j(null)},[]),er=(0,i.useCallback)(async(e,r,n)=>{if(!t)return;C(null);let a="."===e?r:`${e}/${r}`;try{"file"===n?await (0,rC.createFile)(t,a):await (0,rN.createDirectory)(t,a),await V()}catch{}},[t,V]),en=(0,i.useCallback)(()=>{C(null)},[]),ea=async()=>{if(t&&E){A(null);try{await (0,rE.deleteEntry)(t,E.relativePath),await V()}catch{}}},es=(0,i.useCallback)(async()=>{if(t&&!z)try{let e=await (0,rA.listAllFiles)(t);L(e),$(!0)}catch{}},[t,z]);(0,i.useEffect)(()=>{L([]),$(!1),B("")},[t]);let ei=(0,i.useMemo)(()=>new rx(F,{threshold:.4,distance:200,includeMatches:!0}),[F]),el=(0,i.useMemo)(()=>R.trim()?ei.search(R.trim(),{limit:30}):[],[ei,R]),eo=(0,i.useCallback)(e=>{if("Escape"===e.key){B(""),O.current?.blur();return}if(el.length){if("ArrowDown"===e.key)e.preventDefault(),_(e=>Math.min(e+1,el.length-1));else if("ArrowUp"===e.key)e.preventDefault(),_(e=>Math.max(e-1,0));else if("Enter"===e.key){e.preventDefault();let r=el[T];r&&(Y(`${t}/${r.item}`),B(""))}}},[el,T,t,Y]);if((0,i.useEffect)(()=>{let e=W.current;if(!e)return;let t=e.querySelector("[data-highlighted='true']");t&&t.scrollIntoView({block:"nearest"})},[T]),!t)return(0,s.jsx)(rg.EmptyState,{icon:h,title:o("taskPage.fileTree.emptyHeading"),description:o("taskPage.fileTree.emptyBody"),className:"h-full"});if(I)return(0,s.jsxs)("div",{className:"flex h-full flex-col items-center justify-center gap-3 p-6 text-center",children:[(0,s.jsx)(tP.AlertCircle,{className:"h-8 w-8 text-destructive"}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:o("taskPage.fileTree.loadError")}),(0,s.jsx)("button",{type:"button",className:"text-xs text-primary underline cursor-pointer",onClick:()=>{P(!1),M(!0),G().finally(()=>M(!1))},children:"Retry"})]});if(!D&&0===u.length)return(0,s.jsx)(rg.EmptyState,{icon:tR.Folder,title:o("taskPage.fileTree.emptyDir"),className:"h-full"});let eu=R.trim().length>0;return(0,s.jsxs)("div",{className:"h-full flex flex-col",children:[(0,s.jsx)("div",{className:"flex-shrink-0 px-2 py-1.5 border-b border-border",children:(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)(b.Search,{className:"absolute left-2 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted-foreground"}),(0,s.jsx)("input",{ref:O,type:"text",value:R,placeholder:o("taskPage.fileTree.searchPlaceholder"),className:"w-full h-7 pl-7 pr-7 text-xs bg-muted/50 border border-border rounded-md outline-none focus:border-primary/50 focus:bg-background transition-colors placeholder:text-muted-foreground/60",onChange:e=>{B(e.target.value),_(0),z||es()},onKeyDown:eo}),eu&&(0,s.jsx)("button",{type:"button",className:"absolute right-1.5 top-1/2 -translate-y-1/2 p-0.5 rounded hover:bg-muted-foreground/20 text-muted-foreground",onClick:()=>B(""),children:(0,s.jsx)(tB.X,{className:"h-3 w-3"})})]})}),D&&(0,s.jsx)("div",{className:"h-0.5 w-full bg-primary/30 animate-pulse flex-shrink-0"}),eu?(0,s.jsx)(rb.ScrollArea,{className:"flex-1",children:(0,s.jsx)("div",{ref:W,className:"py-1",children:0===el.length?(0,s.jsx)("p",{className:"px-3 py-4 text-xs text-muted-foreground text-center",children:o("taskPage.fileTree.searchNoResults")}):el.map((e,r)=>{let n=e.item,a=n.split("/").pop()??n,i=n.includes("/")?n.slice(0,n.lastIndexOf("/")):"",l=new Set;if(e.matches)for(let t of e.matches)for(let[e,r]of t.indices)for(let t=e;t<=r;t++)l.add(t);let o=n.length-a.length,u=(e,t)=>{let r=[],n=0;for(;n<e.length;){let a=l.has(n+t),i=n+1;for(;i<e.length&&l.has(i+t)===a;)i++;let o=e.slice(n,i);r.push(a?(0,s.jsx)("span",{className:"text-primary font-semibold",children:o},n):(0,s.jsx)("span",{children:o},n)),n=i}return r};return(0,s.jsxs)("button",{type:"button","data-highlighted":r===T,className:`w-full flex items-center gap-2 px-3 py-1 text-left text-xs hover:bg-accent cursor-pointer ${r===T?"bg-accent":""}`,onClick:()=>{Y(`${t}/${n}`),B("")},onMouseEnter:()=>_(r),children:[(0,s.jsx)(tF,{className:"h-3.5 w-3.5 flex-shrink-0 text-muted-foreground"}),(0,s.jsxs)("span",{className:"truncate",children:[(0,s.jsx)("span",{className:"text-foreground",children:u(a,o)}),i&&(0,s.jsx)("span",{className:"ml-1.5 text-muted-foreground",children:u(i,0)})]})]},n)})})}):(0,s.jsx)(rb.ScrollArea,{className:"flex-1",children:(0,s.jsx)("div",{className:"py-1",children:u.map(e=>(0,s.jsx)(rF,{entry:e,worktreePath:t,depth:0,gitStatusMap:x,expandedPaths:d,childrenMap:m,selectedPath:v,onFileSelect:Y,onToggleExpand:U,onContextMenu:q,renamingPath:w,onRenameSubmit:ee,onRenameCancel:et,creatingIn:k,onCreateSubmit:er,onCreateCancel:en},e.relativePath))})}),N&&(0,s.jsx)(rz,{entry:N.entry,x:N.x,y:N.y,onClose:()=>S(null),onNewFile:J,onNewFolder:X,onRename:Q,onDelete:Z,onRevealInFinder:t?r=>{e.A(657115).then(({revealInFinder:e})=>{e(t,r.relativePath).catch(()=>{})})}:void 0}),(0,s.jsx)(rv.Dialog,{open:null!==E,onOpenChange:e=>{e||A(null)},children:(0,s.jsxs)(rv.DialogContent,{children:[(0,s.jsx)(rv.DialogHeader,{children:(0,s.jsx)(rv.DialogTitle,{children:o("taskPage.fileTree.deleteConfirmHeading")})}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:E?.isDirectory?o("taskPage.fileTree.deleteConfirmBodyFolder",{name:E.name}):o("taskPage.fileTree.deleteConfirmBody",{name:E?.name??""})}),(0,s.jsxs)(rv.DialogFooter,{children:[(0,s.jsx)(ry.Button,{variant:"outline",onClick:()=>A(null),children:o("common.cancel")}),(0,s.jsx)(ry.Button,{variant:"destructive",onClick:ea,children:o("taskPage.fileTree.deleteConfirmAction")})]})]})})]})}var rT=e.i(415411);e.i(504466);var r_=e.i(306453),r_=r_,rO=e.i(275283),rW=e.i(286302),rH=e.i(447995),rG=e.i(299826);function rK({tabs:e,activeTabPath:t,onTabClick:r,onTabClose:n}){let{t:a}=(0,rw.useI18n)();return 0===e.length?null:(0,s.jsx)("div",{className:"header-xs flex items-stretch overflow-x-auto bg-card flex-shrink-0",children:e.map(e=>{let i=e.path===t;return(0,s.jsxs)("div",{role:"tab","aria-selected":i,onClick:()=>r(e.path),className:["flex items-center gap-1.5 px-3 text-sm whitespace-nowrap cursor-pointer select-none border-b-2",i?"border-primary text-foreground font-medium":"border-transparent text-muted-foreground hover:text-foreground"].join(" "),children:[e.isDiff&&(0,s.jsx)("span",{className:"text-amber-400 text-[10px] font-mono font-bold",children:"M"}),e.isDirty&&(0,s.jsx)("span",{className:"text-primary text-xs",children:"●"}),(0,s.jsx)("span",{children:e.filename}),(0,s.jsx)("button",{type:"button","aria-label":a("editor.closeTab"),onClick:t=>{t.stopPropagation(),n(e.path)},className:"text-muted-foreground hover:text-foreground ml-0.5 flex items-center",children:(0,s.jsx)(tB.X,{className:"w-3 h-3"})})]},e.path)})})}var r_=r_;r_.default.config({paths:{vs:"/vs"}});let rV=(0,rT.default)(()=>e.A(454868).then(e=>({default:e.DiffEditor})),{loadableGenerated:{modules:[92729]},ssr:!1}),rU={ts:"typescript",tsx:"typescript",js:"javascript",jsx:"javascript",json:"json",md:"markdown",css:"css",html:"html",py:"python",sh:"shell",yaml:"yaml",yml:"yaml",vue:"html",svelte:"html",prisma:"prisma",txt:"plaintext"};function rY({originalContent:t,modifiedContent:r,filePath:n,language:a,onModifiedChange:l,readOnly:o=!1}){let{resolvedTheme:u}=(0,rO.useTheme)(),c="dark"===u?"vs-dark":"light",d=a??rU[n.split(".").pop()??""]??"plaintext",h=(0,i.useRef)(null);return(0,i.useEffect)(()=>{e.A(820374).then(({loader:e})=>{e.init().then(e=>{e.editor.setTheme(c)})})},[c]),(0,s.jsx)(rV,{height:"100%",theme:c,original:t,modified:r,language:d,onMount:e=>{if(h.current=e,l){let t=e.getModifiedEditor();t.onDidChangeModelContent(()=>{l(t.getValue())})}},options:{readOnly:o,originalEditable:!1,automaticLayout:!0,minimap:{enabled:!1},fontSize:13,fontFamily:'"JetBrains Mono", "Geist Mono", monospace',scrollBeyondLastLine:!1,renderSideBySide:!0},loading:(0,s.jsx)("div",{className:"flex h-full items-center justify-center bg-muted/20",children:(0,s.jsx)("span",{className:"text-sm text-muted-foreground",children:"Loading diff editor..."})})})}r_.default.config({paths:{vs:"/vs"}});let rq=(0,rT.default)(()=>e.A(454868).then(e=>({default:e.default})),{loadableGenerated:{modules:[92729]},ssr:!1}),rJ={ts:"typescript",tsx:"typescript",js:"javascript",jsx:"javascript",json:"json",md:"markdown",css:"css",html:"html",py:"python",sh:"shell",yaml:"yaml",yml:"yaml",vue:"html",svelte:"html",prisma:"prisma",txt:"plaintext"};function rX({worktreePath:t,selectedFilePath:r,onFilePathChange:n,onSave:a,selectedLine:l,diffFileRequest:o}){let{t:u}=(0,rw.useI18n)(),{resolvedTheme:c}=(0,rO.useTheme)(),d="dark"===c?"vs-dark":"light",[h,f]=(0,i.useState)([]),[m,p]=(0,i.useState)(null),x=(0,i.useRef)(null),g=(0,i.useRef)(null),b=(0,i.useRef)(new Map),v=(0,i.useRef)(null),y=(0,i.useRef)(void 0),w=(0,i.useRef)(null);function j(e){"success"===e?rW.toast.success(u("editor.saveSuccess")):rW.toast.error(u("editor.saveError"))}(0,i.useEffect)(()=>{v.current=h.find(e=>e.path===m)??null},[h,m]),(0,i.useEffect)(()=>{y.current=a},[a]),(0,i.useEffect)(()=>{e.A(820374).then(({loader:e})=>{e.init().then(e=>{e.editor.setTheme(d)})})},[d]),(0,i.useEffect)(()=>{if(!r)return;if(w.current=r,h.find(e=>e.path===r)){p(r),n?.(r);return}let e=r.startsWith(t+"/")?r.slice(t.length+1):r,a=e.split("/").pop()??e;(0,rH.readFileContent)(t,e).then(t=>{if(w.current!==r)return;let s={path:r,relativePath:e,filename:a,content:t,isDirty:!1};f(e=>e.some(e=>e.path===r)?e:[...e,s]),p(r),n?.(r)}).catch(()=>{})},[r,t]),(0,i.useEffect)(()=>{if(!o)return;let{relativePath:e,originalContent:r}=o,n="diff:"+(t+"/")+e,a=e.split("/").pop()??e;h.find(e=>e.path===n)?p(n):(0,rH.readFileContent)(t,e).then(t=>{let s={path:n,relativePath:e,filename:a,content:t,isDirty:!1,isDiff:!0,originalContent:r};f(e=>e.some(e=>e.path===n)?e:[...e,s]),p(n)}).catch(()=>{})},[o,t]),(0,i.useEffect)(()=>{if(!l||!x.current)return;let e=x.current,t=setTimeout(()=>{e.revealLineInCenter(l),e.setPosition({lineNumber:l,column:1})},50);return()=>clearTimeout(t)},[l,m]),(0,i.useEffect)(()=>{let e=x.current,t=g.current;if(!e||!t||!m)return;let r=h.find(e=>e.path===m);if(!r)return;let n=t.Uri.parse("file://"+r.path),a=b.current.get(r.path);if(!a){let e=rJ[r.filename.split(".").pop()??""]??"plaintext";a=t.editor.createModel(r.content,e,n),b.current.set(r.path,a)}e.setModel(a)},[m,h]);let k=h.find(e=>e.path===m);return(0,s.jsxs)("div",{className:"flex flex-col h-full overflow-hidden relative",children:[(0,s.jsx)(rK,{tabs:h,activeTabPath:m,onTabClick:function(e){p(e),n?.(e)},onTabClose:function(e){let t=b.current.get(e);t?.dispose&&t.dispose(),b.current.delete(e),f(t=>{let r=t.filter(t=>t.path!==e);if(m===e){let e=r.length>0?r[r.length-1].path:null;p(e),n?.(e)}return r})}}),0===h.length?(0,s.jsxs)("div",{className:"flex h-full flex-col items-center justify-center text-center",children:[(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:u("editor.selectFile")}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:u("editor.selectFileHint")})]}):k?.isDiff?(0,s.jsx)("div",{className:"flex-1 min-h-0",children:(0,s.jsx)(rY,{originalContent:k.originalContent??"",modifiedContent:k.content,filePath:k.relativePath,onModifiedChange:e=>{f(t=>t.map(t=>t.path===m?{...t,content:e,isDirty:!0}:t))}})}):(0,s.jsx)("div",{className:"flex-1 min-h-0",children:(0,s.jsx)(rq,{height:"100%",theme:d,value:k?.content??"",onMount:function(e,r){x.current=e,g.current=r,e.addAction({id:"save-file",label:"Save File",keybindings:[r.KeyMod.CtrlCmd|r.KeyCode.KeyS],run:async()=>{let e=v.current;if(e&&e.isDirty)try{await (0,rG.writeFileContent)(t,e.relativePath,e.content),f(t=>t.map(t=>t.path===e.path?{...t,isDirty:!1}:t)),j("success"),y.current?.()}catch{j("error")}}})},onChange:e=>{void 0!==e&&f(t=>t.map(t=>t.path===m?{...t,content:e,isDirty:!0}:t))},options:{automaticLayout:!0,minimap:{enabled:!1},fontSize:13,fontFamily:'"JetBrains Mono", "Geist Mono", monospace',lineNumbers:"on",wordWrap:"off",scrollBeyondLastLine:!1,tabSize:2},loading:(0,s.jsx)("div",{className:"flex h-full items-center justify-center bg-muted/20",children:(0,s.jsx)("span",{className:"text-sm text-muted-foreground",children:"Loading editor..."})})})})]})}let rQ=(0,d.default)("funnel",[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]]);var rZ=e.i(543485);let r0=(0,rZ.createServerReference)("78d716fcedc9e04099e9599f69b93ba047e0b07e4c",rZ.callServer,void 0,rZ.findSourceMapURL,"searchCode");function r1({localPath:e,onResultSelect:t}){let{t:r}=(0,rw.useI18n)(),[n,a]=(0,i.useState)(""),[l,o]=(0,i.useState)(""),[u,d]=(0,i.useState)([]),[h,f]=(0,i.useState)(!1),[m,p]=(0,i.useState)(null),[x,g]=(0,i.useState)(!1),[v,y]=(0,i.useState)(!1),w=(0,i.useRef)(0),j=(0,i.useCallback)(async()=>{if(!e||!n.trim())return;let t=++w.current;g(!0),p(null),y(!0);try{let a=await r0(e,n.trim(),l.trim()||void 0);if(t!==w.current)return;a.error?(a.error.toLowerCase().includes("ripgrep")||a.error.toLowerCase().includes("rg")?(rW.toast.error(r("codeSearch.rgNotInstalled")),p(r("codeSearch.rgNotInstalled"))):p(a.error),d([]),f(!1)):(d(a.matches),f(a.truncated))}catch(e){if(t!==w.current)return;p(String(e)),d([]),f(!1)}finally{t===w.current&&g(!1)}},[e,n,l,r]),k=(0,i.useCallback)(e=>{"Enter"===e.key&&(e.preventDefault(),j())},[j]);return e?(0,s.jsxs)("div",{className:"h-full flex flex-col overflow-hidden",children:[(0,s.jsxs)("div",{className:"flex-shrink-0 px-2 py-1.5 space-y-1 border-b border-border",children:[(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)(b.Search,{className:"absolute left-2 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted-foreground"}),(0,s.jsx)("input",{type:"text",value:n,placeholder:r("codeSearch.patternPlaceholder"),className:"w-full h-7 pl-7 pr-2 text-xs bg-muted/50 border border-border rounded-md outline-none focus:border-primary/50 focus:bg-background transition-colors placeholder:text-muted-foreground/60",onChange:e=>a(e.target.value),onKeyDown:k})]}),(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)(rQ,{className:"absolute left-2 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted-foreground"}),(0,s.jsx)("input",{type:"text",value:l,placeholder:r("codeSearch.globPlaceholder"),className:"w-full h-7 pl-7 pr-2 text-xs bg-muted/50 border border-border rounded-md outline-none focus:border-primary/50 focus:bg-background transition-colors placeholder:text-muted-foreground/60",onChange:e=>o(e.target.value)})]})]}),(0,s.jsx)("div",{className:"flex-1 min-h-0 flex flex-col",children:x?(0,s.jsxs)("div",{className:"flex flex-col items-center justify-center h-full gap-2",children:[(0,s.jsx)(c.Loader2,{className:"h-5 w-5 animate-spin text-muted-foreground"}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:r("codeSearch.searching")})]}):m?(0,s.jsx)("div",{className:"px-3 py-4 text-xs text-destructive",children:m}):v?0===u.length?(0,s.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:r("codeSearch.noResults")})}):(0,s.jsxs)(rb.ScrollArea,{className:"flex-1",children:[(0,s.jsx)("div",{className:"py-1",children:u.map((r,n)=>(0,s.jsxs)("button",{type:"button",className:"w-full flex flex-col gap-0.5 px-2 py-1.5 text-left hover:bg-accent/50 cursor-pointer border-b border-border/30 last:border-b-0","aria-label":`Open ${r.filePath} at line ${r.lineNumber}`,onClick:()=>{t(e.endsWith("/")?e+r.filePath:e+"/"+r.filePath,r.lineNumber)},children:[(0,s.jsxs)("div",{className:"flex items-center gap-1.5 min-w-0",children:[(0,s.jsx)("span",{className:"text-xs text-muted-foreground truncate flex-1",children:r.filePath}),(0,s.jsxs)("span",{className:"text-xs text-primary/80 flex-shrink-0 tabular-nums",children:[":",r.lineNumber]})]}),(0,s.jsx)("div",{className:"text-xs text-foreground/80 font-mono truncate",children:function(e,t){if(!t.length)return[(0,s.jsx)("span",{children:e},"0")];let r=[],n=0;for(let{start:a,end:i}of t)n<a&&r.push((0,s.jsx)("span",{children:e.slice(n,a)},`plain-${n}`)),r.push((0,s.jsx)("span",{className:"bg-yellow-400/30 text-yellow-200 rounded-[2px] px-[1px]",children:e.slice(a,i)},`match-${a}`)),n=i;return n<e.length&&r.push((0,s.jsx)("span",{children:e.slice(n)},`plain-${n}`)),r}(r.lineText,r.submatches)})]},`${r.filePath}:${r.lineNumber}:${n}`))}),h&&(0,s.jsx)("div",{className:"px-3 py-2 text-xs text-muted-foreground text-center border-t border-border/30",children:r("codeSearch.truncated")})]}):(0,s.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,s.jsx)("p",{className:"text-xs text-muted-foreground text-center px-4",children:r("codeSearch.hint")})})})]}):(0,s.jsxs)("div",{className:"flex h-full flex-col items-center justify-center gap-2 p-4 text-center",children:[(0,s.jsx)(b.Search,{className:"h-8 w-8 text-muted-foreground"}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:r("codeSearch.noPath")})]})}let r2=(0,d.default)("file-plus",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M9 15h6",key:"cctwl0"}],["path",{d:"M12 18v-6",key:"17g6i2"}]]),r3=(0,d.default)("file-minus",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M9 15h6",key:"cctwl0"}]]),r5=(0,d.default)("file-question-mark",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M12 17h.01",key:"p32p05"}],["path",{d:"M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3",key:"mhlwft"}]]),r4=(0,d.default)("file-pen",[["path",{d:"M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34",key:"o6klzx"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z",key:"zhnas1"}]]),r8=(0,d.default)("arrow-down",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]),r7=(0,d.default)("arrow-up",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);var r6=e.i(893832);let r9=(0,d.default)("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);var ne=e.i(780156),nt=e.i(746357),nr=e.i(126741),nn=e.i(565037),na=e.i(871183);let ns=(0,d.default)("undo-2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]);var ni=e.i(802461),nl=e.i(942252),no=e.i(909105),nu=e.i(657572);let nc={modified:r4,added:r2,deleted:r3,untracked:r5,renamed:r4},nd={modified:"text-amber-400",added:"text-emerald-400",deleted:"text-rose-400",untracked:"text-muted-foreground",renamed:"text-sky-400"},nh={modified:"M",added:"A",deleted:"D",untracked:"U",renamed:"R"};function nf(e){let t={name:"",path:"",isDir:!0,children:[]};for(let r of e){let e=r.file.split("/"),n=t;for(let t=0;t<e.length;t++){let a=e[t],s=t===e.length-1,i=e.slice(0,t+1).join("/");if(s)n.children.push({name:a,path:i,isDir:!1,children:[],file:r});else{let e=n.children.find(e=>e.isDir&&e.name===a);e||(e={name:a,path:i,isDir:!0,children:[]},n.children.push(e)),n=e}}}return(function e(t){if(t.isDir&&(t.children=t.children.map(e),1===t.children.length&&t.children[0].isDir&&""!==t.name)){let e=t.children[0];return{...e,name:`${t.name}/${e.name}`}}return t})(t).children.sort((e,t)=>e.isDir!==t.isDir?e.isDir?-1:1:e.name.localeCompare(t.name))}function nm({localPath:e,onFileSelect:t}){let{t:r}=(0,rw.useI18n)(),[n,a]=(0,i.useState)(null),[l,o]=(0,i.useState)(!0),[d,h]=(0,i.useState)(""),[f,m]=(0,i.useState)(!1),[p,x]=(0,i.useState)(!1),[g,v]=(0,i.useState)(!1),[y,w]=(0,i.useState)(!1),[j,k]=(0,i.useState)(!1),[C,N]=(0,i.useState)(""),S=(0,i.useRef)(null);(0,i.useEffect)(()=>{if(j)return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e);function e(e){S.current&&!S.current.contains(e.target)&&k(!1)}},[j]);let[E,A]=(0,i.useState)(!1),D=(0,i.useCallback)(async()=>{try{let t=await fetch(`/api/git?path=${encodeURIComponent(e)}`);if(t.ok){let e=await t.json();a({changedFiles:e.changedFiles??[],ahead:e.ahead??0,behind:e.behind??0,remoteUrl:e.remoteUrl??"",currentBranch:e.currentBranch??"",branches:e.branches??[],remoteBranches:e.remoteBranches??[]})}}catch{}finally{o(!1)}},[e]);(0,i.useEffect)(()=>{D();let e=setInterval(D,5e3);return()=>clearInterval(e)},[D]);let M=async t=>{try{await (0,nu.gitAction)(e,"stage",{files:t}),await D()}catch(e){rW.toast.error(e instanceof Error?e.message:String(e))}},I=async t=>{try{await (0,nu.gitAction)(e,"unstage",{files:t}),await D()}catch(e){rW.toast.error(e instanceof Error?e.message:String(e))}},P=async()=>{if(d.trim()){m(!0);try{await (0,nu.gitAction)(e,"commit",{message:d}),h(""),rW.toast.success(r("git.commitSuccess")),await D()}catch(e){rW.toast.error(e instanceof Error?e.message:String(e))}finally{m(!1)}}},R=async t=>{x(!0);try{await (0,nu.gitAction)(e,"pull",t?{branch:t}:{}),rW.toast.success(r("git.pullSuccess")),await D()}catch(e){rW.toast.error(e instanceof Error?e.message:String(e))}finally{x(!1)}},B=async t=>{v(!0);try{await (0,nu.gitAction)(e,"push",t?{branch:t}:{}),rW.toast.success(r("git.pushSuccess")),await D()}catch(e){rW.toast.error(e instanceof Error?e.message:String(e))}finally{v(!1)}},F=async()=>{w(!0);try{await (0,nu.gitAction)(e,"fetch"),rW.toast.success(r("git.fetchSuccess")),await D()}catch(e){rW.toast.error(e instanceof Error?e.message:String(e))}finally{w(!1)}},L=async t=>{try{await (0,nu.gitAction)(e,"checkout",{branch:t}),k(!1),rW.toast.success(`${r("git.switchSuccess")} ${t}`),await D()}catch(e){rW.toast.error(e instanceof Error?e.message:String(e))}},z=async()=>{try{await (0,nu.gitAction)(e,"stash-save",{message:d||void 0}),h(""),rW.toast.success(r("git.stashSaved")),await D()}catch(e){rW.toast.error(e instanceof Error?e.message:String(e))}},$=async()=>{try{await (0,nu.gitAction)(e,"stash-pop",{index:0}),rW.toast.success(r("git.stashApplied")),await D()}catch(e){rW.toast.error(e instanceof Error?e.message:String(e))}},T=async()=>{try{await (0,nu.gitAction)(e,"discard-all"),rW.toast.success(r("git.discardSuccess")),await D()}catch(e){rW.toast.error(e instanceof Error?e.message:String(e))}},_=async r=>{if("deleted"!==r.status)try{let n=await (0,nu.gitAction)(e,"show",{file:r.file});t?.(r.file,n.content??"")}catch{t?.(r.file,"")}},O=n?.changedFiles.filter(e=>e.staged)??[],W=n?.changedFiles.filter(e=>!e.staged)??[],H=(0,i.useMemo)(()=>nf(O),[O]),G=(0,i.useMemo)(()=>nf(W),[W]);if(l)return(0,s.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,s.jsx)(c.Loader2,{className:"h-4 w-4 animate-spin text-muted-foreground"})});if(!n)return null;function K(e){let t=[];for(let r of e)r.isDir?t.push(...K(r.children)):r.file&&t.push(r.file.file);return t}let V=[...n?.branches??[],...(n?.remoteBranches??[]).filter(e=>!n?.branches?.includes(e))],U=C?V.filter(e=>e.toLowerCase().includes(C.toLowerCase())):V;return(0,s.jsxs)("div",{className:"flex flex-col h-full overflow-hidden",children:[(0,s.jsx)("div",{className:"shrink-0 px-2 pt-2 pb-1",children:(0,s.jsxs)("div",{className:"relative",ref:S,children:[(0,s.jsxs)("button",{onClick:()=>{k(!j),N("")},className:"flex w-full items-center justify-between rounded-md border border-border bg-muted/50 px-2 py-1.5 text-left transition-colors hover:bg-accent",children:[(0,s.jsxs)("div",{className:"flex items-center gap-1.5 min-w-0",children:[(0,s.jsx)(u.GitBranch,{className:"h-3 w-3 shrink-0 text-emerald-400"}),(0,s.jsx)("span",{className:"truncate font-mono text-xs text-foreground",children:n?.currentBranch||"—"})]}),(0,s.jsx)(rM.ChevronDown,{className:`h-3 w-3 shrink-0 text-muted-foreground transition-transform ${j?"rotate-180":""}`})]}),j&&(0,s.jsxs)("div",{className:"absolute left-0 right-0 top-full z-30 mt-1 rounded-lg border border-border bg-popover shadow-xl",children:[(0,s.jsx)("div",{className:"border-b border-border p-1.5",children:(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)(b.Search,{className:"absolute left-2 top-1/2 -translate-y-1/2 h-3 w-3 text-muted-foreground"}),(0,s.jsx)("input",{value:C,onChange:e=>N(e.target.value),placeholder:"Filter...",autoFocus:!0,className:"h-7 w-full rounded-md bg-muted/50 pl-7 pr-2 text-xs text-foreground placeholder-muted-foreground outline-none focus:ring-1 focus:ring-ring"})]})}),(0,s.jsxs)("div",{className:"max-h-48 overflow-auto py-1",children:[(n?.branches??[]).filter(e=>e.toLowerCase().includes(C.toLowerCase())).length>0&&(0,s.jsx)("p",{className:"px-3 pt-1 pb-0.5 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:r("git.localBranches")}),(n?.branches??[]).filter(e=>e.toLowerCase().includes(C.toLowerCase())).map(e=>{let t=e===n?.currentBranch;return(0,s.jsxs)("button",{onClick:()=>{t?k(!1):L(e)},className:`flex w-full items-center gap-2 px-3 py-1 text-left transition-colors ${t?"bg-emerald-500/10 text-emerald-400":"text-secondary-foreground hover:bg-accent"}`,children:[(0,s.jsx)(u.GitBranch,{className:"h-3 w-3 shrink-0"}),(0,s.jsx)("span",{className:"truncate font-mono text-xs",children:e}),t&&(0,s.jsx)(r6.Check,{className:"h-3 w-3 ml-auto shrink-0"})]},`local-${e}`)}),(n?.remoteBranches??[]).filter(e=>!n?.branches?.includes(e)).filter(e=>e.toLowerCase().includes(C.toLowerCase())).length>0&&(0,s.jsx)("p",{className:"px-3 pt-2 pb-0.5 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:r("git.remoteBranches")}),(n?.remoteBranches??[]).filter(e=>!n?.branches?.includes(e)).filter(e=>e.toLowerCase().includes(C.toLowerCase())).map(e=>(0,s.jsxs)("button",{onClick:()=>L(e),className:"flex w-full items-center gap-2 px-3 py-1 text-left text-secondary-foreground transition-colors hover:bg-accent",children:[(0,s.jsx)(ni.Globe,{className:"h-3 w-3 shrink-0 text-sky-400"}),(0,s.jsx)("span",{className:"truncate font-mono text-xs",children:e})]},`remote-${e}`)),0===U.length&&(0,s.jsx)("p",{className:"px-3 py-2 text-xs text-muted-foreground",children:"No branches found"})]}),(0,s.jsxs)("div",{className:"border-t border-border p-1.5 flex gap-1",children:[(0,s.jsxs)(ry.Button,{variant:"ghost",className:"flex-1 h-6 gap-1 text-[10px] text-muted-foreground",onClick:()=>{k(!1),k(!1),A(!0)},children:[(0,s.jsx)(ne.Plus,{className:"h-3 w-3"}),r("git.createBranch")]}),(0,s.jsxs)(ry.Button,{variant:"ghost",className:"h-6 gap-1 text-[10px] text-muted-foreground",onClick:F,disabled:y,children:[(0,s.jsx)(nr.RefreshCw,{className:`h-3 w-3 ${y?"animate-spin":""}`}),"Fetch"]})]})]})]})}),(0,s.jsxs)("div",{className:"shrink-0 px-2 pb-2 space-y-1.5 border-b border-border",children:[(0,s.jsx)("textarea",{value:d,onChange:e=>h(e.target.value),placeholder:r("git.commitMsgPlaceholder"),rows:3,className:"w-full rounded-md border border-border bg-background px-2 py-1.5 text-xs text-foreground placeholder-muted-foreground outline-none transition-colors focus:border-ring focus:ring-1 focus:ring-ring resize-none",onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&"Enter"===e.key&&P()}}),(0,s.jsxs)("div",{className:"flex items-center gap-1",children:[(0,s.jsxs)(ry.Button,{variant:"default",className:"flex-1 h-7 gap-1.5 text-xs",onClick:P,disabled:f||!d.trim()||0===O.length,children:[f?(0,s.jsx)(c.Loader2,{className:"h-3 w-3 animate-spin"}):(0,s.jsx)(r6.Check,{className:"h-3 w-3"}),r("git.commit")]}),(0,s.jsxs)(nl.DropdownMenu,{children:[(0,s.jsx)(nl.DropdownMenuTrigger,{render:(0,s.jsx)(ry.Button,{variant:"outline",size:"icon-xs",className:"h-7 w-7 shrink-0"}),children:(0,s.jsx)(nt.MoreHorizontal,{className:"h-3.5 w-3.5"})}),(0,s.jsxs)(nl.DropdownMenuContent,{align:"end",side:"bottom",className:"w-52",children:[(0,s.jsxs)(nl.DropdownMenuGroup,{children:[(0,s.jsx)(nl.DropdownMenuLabel,{children:r("git.commit")}),(0,s.jsxs)(nl.DropdownMenuItem,{onClick:P,disabled:!d.trim()||0===O.length,children:[(0,s.jsx)(r6.Check,{className:"h-3.5 w-3.5 mr-2"}),r("git.commit")]})]}),(0,s.jsx)(nl.DropdownMenuSeparator,{}),(0,s.jsxs)(nl.DropdownMenuGroup,{children:[(0,s.jsx)(nl.DropdownMenuLabel,{children:r("git.changes")}),(0,s.jsxs)(nl.DropdownMenuItem,{onClick:()=>M(K(G)),disabled:0===W.length,children:[(0,s.jsx)(ne.Plus,{className:"h-3.5 w-3.5 mr-2"}),r("git.stageAll")]}),(0,s.jsxs)(nl.DropdownMenuItem,{onClick:()=>I(K(H)),disabled:0===O.length,children:[(0,s.jsx)(r9,{className:"h-3.5 w-3.5 mr-2"}),r("git.unstageAll")]}),(0,s.jsxs)(nl.DropdownMenuItem,{onClick:T,disabled:0===W.length,children:[(0,s.jsx)(ns,{className:"h-3.5 w-3.5 mr-2"}),r("git.discardAll")]})]}),(0,s.jsx)(nl.DropdownMenuSeparator,{}),(0,s.jsxs)(nl.DropdownMenuGroup,{children:[(0,s.jsx)(nl.DropdownMenuLabel,{children:r("git.sync")}),(0,s.jsxs)(nl.DropdownMenuItem,{onClick:()=>R(),disabled:p,children:[(0,s.jsx)(r8,{className:"h-3.5 w-3.5 mr-2"}),r("git.pull")]}),(0,s.jsxs)(nl.DropdownMenuItem,{onClick:()=>B(),disabled:g,children:[(0,s.jsx)(r7,{className:"h-3.5 w-3.5 mr-2"}),r("git.push")]}),(0,s.jsxs)(nl.DropdownMenuSub,{children:[(0,s.jsxs)(nl.DropdownMenuSubTrigger,{disabled:p,children:[(0,s.jsx)(r8,{className:"h-3.5 w-3.5 mr-2"}),r("git.pullFrom"),"..."]}),(0,s.jsxs)(nl.DropdownMenuSubContent,{className:"max-h-60 overflow-y-auto",children:[(0,s.jsxs)(nl.DropdownMenuItem,{onClick:()=>R(),children:[(0,s.jsx)(u.GitBranch,{className:"h-3 w-3 mr-2 text-emerald-400"}),n.currentBranch,n.behind>0&&(0,s.jsxs)("span",{className:"ml-auto text-[10px] text-muted-foreground",children:["↓",n.behind]})]}),n.remoteBranches.filter(e=>e!==n.currentBranch).map(e=>(0,s.jsxs)(nl.DropdownMenuItem,{onClick:()=>R(e),children:[(0,s.jsx)(u.GitBranch,{className:"h-3 w-3 mr-2 text-sky-400"}),e]},e))]})]}),(0,s.jsxs)(nl.DropdownMenuSub,{children:[(0,s.jsxs)(nl.DropdownMenuSubTrigger,{disabled:g,children:[(0,s.jsx)(r7,{className:"h-3.5 w-3.5 mr-2"}),r("git.pushTo"),"..."]}),(0,s.jsxs)(nl.DropdownMenuSubContent,{className:"max-h-60 overflow-y-auto",children:[(0,s.jsxs)(nl.DropdownMenuItem,{onClick:()=>B(),children:[(0,s.jsx)(u.GitBranch,{className:"h-3 w-3 mr-2 text-emerald-400"}),n.currentBranch,n.ahead>0&&(0,s.jsxs)("span",{className:"ml-auto text-[10px] text-muted-foreground",children:["↑",n.ahead]})]}),n.remoteBranches.filter(e=>e!==n.currentBranch).map(e=>(0,s.jsxs)(nl.DropdownMenuItem,{onClick:()=>B(e),children:[(0,s.jsx)(u.GitBranch,{className:"h-3 w-3 mr-2 text-sky-400"}),e]},e))]})]}),(0,s.jsxs)(nl.DropdownMenuItem,{onClick:F,disabled:y,children:[(0,s.jsx)(nr.RefreshCw,{className:`h-3.5 w-3.5 mr-2 ${y?"animate-spin":""}`}),r("git.fetchAll")]})]}),(0,s.jsx)(nl.DropdownMenuSeparator,{}),(0,s.jsxs)(nl.DropdownMenuGroup,{children:[(0,s.jsx)(nl.DropdownMenuLabel,{children:r("git.stash")}),(0,s.jsxs)(nl.DropdownMenuItem,{onClick:z,disabled:0===n.changedFiles.length,children:[(0,s.jsx)(nn.Archive,{className:"h-3.5 w-3.5 mr-2"}),r("git.stashSave")]}),(0,s.jsxs)(nl.DropdownMenuItem,{onClick:$,children:[(0,s.jsx)(na.ArrowUpFromLine,{className:"h-3.5 w-3.5 mr-2"}),r("git.stashPopLatest")]})]}),(0,s.jsx)(nl.DropdownMenuSeparator,{}),(0,s.jsxs)(nl.DropdownMenuItem,{disabled:!0,className:"text-muted-foreground",children:[(0,s.jsx)(u.GitBranch,{className:"h-3.5 w-3.5 mr-2"}),n.currentBranch]})]})]})]})]}),(0,s.jsxs)(rb.ScrollArea,{className:"flex-1 min-h-0",children:[(0,s.jsx)(np,{label:r("git.stagedChanges"),count:O.length,labelColor:"text-emerald-400",tree:H,batchAction:()=>I(K(H)),batchLabel:r("git.unstageAll"),batchIcon:(0,s.jsx)(r9,{className:"h-3 w-3"}),onFileClick:_,onFileAction:e=>I([e]),fileActionIcon:"−"}),(0,s.jsx)(np,{label:r("git.unstagedChanges"),count:W.length,labelColor:"text-muted-foreground",tree:G,batchAction:()=>M(K(G)),batchLabel:r("git.stageAll"),batchIcon:(0,s.jsx)(ne.Plus,{className:"h-3 w-3"}),onFileClick:_,onFileAction:e=>M([e]),fileActionIcon:"+"}),0===n.changedFiles.length&&(0,s.jsxs)("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[(0,s.jsx)(r6.Check,{className:"h-5 w-5 text-emerald-400 mb-2"}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:r("git.noChanges")})]})]}),(0,s.jsx)(no.CreateBranchDialog,{open:E,onOpenChange:A,branches:[...n?.branches??[],...n?.remoteBranches??[]],currentBranch:n?.currentBranch??"",localPath:e,onCreated:async()=>{rW.toast.success(r("git.createSuccess")),await D()},onError:e=>rW.toast.error(`${r("git.createFailed")}: ${e}`)})]})}function np({label:e,count:t,labelColor:r,tree:n,batchAction:a,batchLabel:l,batchIcon:o,onFileClick:u,onFileAction:c,fileActionIcon:d}){let[h,f]=(0,i.useState)(!0);return 0===t?null:(0,s.jsxs)("div",{className:"border-b border-border",children:[(0,s.jsxs)("div",{className:"group flex items-center justify-between px-2 py-1.5 hover:bg-accent/50 transition-colors",children:[(0,s.jsxs)("button",{onClick:()=>f(!h),className:"flex items-center gap-1 flex-1 min-w-0",children:[h?(0,s.jsx)(rM.ChevronDown,{className:"h-3 w-3 shrink-0 text-muted-foreground"}):(0,s.jsx)(rD.ChevronRight,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),(0,s.jsxs)("span",{className:`text-[10px] font-semibold uppercase tracking-wider ${r}`,children:[e," (",t,")"]})]}),(0,s.jsx)(ry.Button,{variant:"ghost",size:"icon-xs",onClick:a,className:"text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity","aria-label":l,children:o})]}),h&&(0,s.jsx)("div",{className:"pb-1",children:n.map(e=>(0,s.jsx)(nx,{node:e,depth:0,onFileClick:u,onFileAction:c,fileActionIcon:d},e.path))})]})}function nx({node:e,depth:t,onFileClick:r,onFileAction:n,fileActionIcon:a}){let[l,o]=(0,i.useState)(!0),u=8+12*t;if(e.isDir)return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("button",{onClick:()=>o(!l),className:"flex w-full items-center gap-1 py-0.5 hover:bg-accent/50 transition-colors text-left",style:{paddingLeft:u},children:[l?(0,s.jsx)(rM.ChevronDown,{className:"h-3 w-3 shrink-0 text-muted-foreground"}):(0,s.jsx)(rD.ChevronRight,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),(0,s.jsx)(tR.Folder,{className:"h-3 w-3 shrink-0 text-amber-400/70"}),(0,s.jsx)("span",{className:"text-xs text-muted-foreground truncate",children:e.name})]}),l&&e.children.sort((e,t)=>e.isDir!==t.isDir?e.isDir?-1:1:e.name.localeCompare(t.name)).map(e=>(0,s.jsx)(nx,{node:e,depth:t+1,onFileClick:r,onFileAction:n,fileActionIcon:a},e.path))]});let c=e.file,d=nc[c.status]||tF,h=nd[c.status]||"text-muted-foreground",f=nh[c.status]||"?";return(0,s.jsxs)("div",{className:"group flex items-center gap-1 py-0.5 hover:bg-accent/50 transition-colors cursor-pointer",style:{paddingLeft:u+16},onClick:()=>r(c),children:[(0,s.jsx)(d,{className:`h-3 w-3 shrink-0 ${h}`}),(0,s.jsx)("span",{className:"text-xs text-foreground truncate flex-1",children:e.name}),(0,s.jsx)("span",{className:`text-[10px] font-mono font-bold shrink-0 mr-1 ${h}`,children:f}),(0,s.jsx)("button",{onClick:e=>{e.stopPropagation(),n(c.file)},className:"shrink-0 rounded px-1 text-xs font-mono text-muted-foreground opacity-0 group-hover:opacity-100 hover:bg-background hover:text-foreground transition-all mr-1",children:a})]})}var ng=e.i(610874);let nb=(0,rZ.createServerReference)("70ae91e8f69c13c5b8bece62d8faf4eebadf001928",rZ.callServer,void 0,rZ.findSourceMapURL,"startPreview"),nv=(0,rZ.createServerReference)("40d196de561628878cb74c1c47e48d1089416c9c75",rZ.callServer,void 0,rZ.findSourceMapURL,"stopPreview");var ny=e.i(558418),nw=e.i(463638);let nj=["pnpm","npm","yarn"];function nk(e){if(!e)return{pm:"pnpm",script:"dev"};let t=e.trim().split(/\s+/),r=nj.includes(t[0])?t[0]:"pnpm",n=t.slice(1);return{pm:r,script:"run"===n[0]?n[1]??"dev":n[0]??"dev"}}function nC({status:e}){return"running"===e?(0,s.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-400 inline-block"}):"error"===e?(0,s.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-red-400 inline-block"}):"starting"===e?(0,s.jsx)(c.Loader2,{className:"h-3 w-3 animate-spin inline-block"}):(0,s.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-muted-foreground/50 inline-block"})}function nN({taskId:e,worktreePath:t,previewCommand:r,previewPort:n,refreshKey:a,projectId:l,previewUrl:o,onPreviewUrlChange:u}){let{t:d}=(0,rw.useI18n)(),[h,f]=(0,i.useState)("stopped"),[x,g]=(0,i.useState)(""),[b,v]=(0,i.useState)(o??""),[y,w]=(0,i.useState)(o??""),[j,k]=(0,i.useState)(0),C=nk(r),[N,S]=(0,i.useState)(C.pm),[E,A]=(0,i.useState)(C.script),[D,M]=(0,i.useState)(n??5173);(0,i.useEffect)(()=>{let e=nk(r);S(e.pm),A(e.script)},[r]),(0,i.useEffect)(()=>{null!=n&&M(n)},[n]),(0,i.useEffect)(()=>{o&&(v(o),w(o))},[o]);let I=(0,i.useRef)(e);I.current=e,(0,i.useEffect)(()=>()=>{nv(I.current).catch(()=>{})},[]);let P=(()=>{switch(h){case"running":return d("preview.statusRunning");case"starting":return d("preview.statusStarting");case"error":return d("preview.statusError");default:return d("preview.statusStopped")}})(),R=`${N} ${E}`;async function B(){await (0,nw.updateProject)(l,{previewCommand:R,previewPort:D})}async function F(){if(t&&E){f("starting"),g("");try{await B();let r=await nb(e,R,t);if(r.started){if(f("running"),!b){let e=`http://localhost:${D}`;v(e),w(e),u?.(e)}}else f("error"),g(r.error??"")}catch(e){f("error"),g(String(e))}}}async function L(){await nv(e),f("stopped")}async function z(){if(t)try{await (0,ny.openInTerminal)(t)}catch{f("error"),g(d("preview.terminalError"))}}return t?(0,s.jsxs)("div",{className:"flex h-full flex-col",children:[(0,s.jsxs)("div",{className:"flex h-11 shrink-0 items-center gap-2 border-b border-border bg-card px-3",children:[(0,s.jsxs)("span",{className:`inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-xs ${function(e){switch(e){case"running":return"text-emerald-400 bg-emerald-500/10 border border-emerald-500/20";case"error":return"text-red-400 bg-red-500/10 border border-red-500/20";default:return"text-muted-foreground bg-muted border border-transparent"}}(h)}`,children:[(0,s.jsx)(nC,{status:h}),P]}),"running"===h?(0,s.jsx)(ry.Button,{variant:"destructive",onClick:L,children:d("preview.stop")}):(0,s.jsxs)(ry.Button,{variant:"default",disabled:"starting"===h||!E||!t,onClick:F,children:["starting"===h&&(0,s.jsx)(c.Loader2,{className:"mr-1 h-3 w-3 animate-spin"}),d("preview.run")]}),(0,s.jsx)("div",{className:"flex-1"}),(0,s.jsx)(ry.Button,{variant:"ghost",size:"icon",className:"h-8 w-8",title:d("preview.refresh"),onClick:()=>{y&&k(e=>e+1)},children:(0,s.jsx)(nr.RefreshCw,{className:"h-4 w-4"})}),(0,s.jsx)(ry.Button,{variant:"ghost",size:"icon",className:"h-8 w-8",title:d("preview.openTerminal"),disabled:!t,onClick:z,children:(0,s.jsx)(p.Terminal,{className:"h-4 w-4"})})]}),"error"===h&&x&&(0,s.jsxs)("div",{className:"border-b border-border bg-red-500/10 px-3 py-1 text-xs text-red-400",children:[d("preview.errorDesc"),": ",x]}),(0,s.jsxs)("div",{className:"flex shrink-0 items-center gap-2 border-b border-border bg-card px-3 py-1.5",children:[(0,s.jsxs)(ng.Select,{value:N,onValueChange:e=>{e&&(S(e),setTimeout(B,0))},children:[(0,s.jsx)(ng.SelectTrigger,{className:"h-7 w-auto min-w-[80px] text-xs",children:(0,s.jsx)("span",{children:N})}),(0,s.jsx)(ng.SelectContent,{children:nj.map(e=>(0,s.jsx)(ng.SelectItem,{value:e,children:e},e))})]}),(0,s.jsx)("span",{className:"text-xs text-muted-foreground",children:"run"}),(0,s.jsx)("input",{type:"text",value:E,onChange:e=>A(e.target.value),onBlur:B,placeholder:"dev",className:"h-7 w-24 rounded border border-border bg-background px-2 text-xs font-mono focus:outline-none focus:ring-1 focus:ring-primary"}),(0,s.jsx)("span",{className:"text-xs text-muted-foreground",children:d("preview.port")}),(0,s.jsx)("input",{type:"number",value:D,onChange:e=>M(parseInt(e.target.value,10)||0),onBlur:B,placeholder:"5173",className:"h-7 w-20 rounded border border-border bg-background px-2 text-xs font-mono focus:outline-none focus:ring-1 focus:ring-primary"})]}),(0,s.jsx)("div",{className:"flex shrink-0 items-center border-b border-border bg-background px-3 py-1",children:(0,s.jsx)("input",{type:"text",value:b,onChange:e=>v(e.target.value),onKeyDown:function(e){"Enter"===e.key&&(w(b),u?.(b))},placeholder:d("preview.addressPlaceholder"),className:"h-8 w-full rounded border border-border bg-background px-2 text-xs font-mono focus:outline-none focus:ring-1 focus:ring-primary"})}),(0,s.jsx)("div",{className:"flex-1 overflow-hidden",children:(0,s.jsx)("iframe",{src:y||void 0,className:"h-full w-full border-0",allow:"clipboard-read; clipboard-write",referrerPolicy:"no-referrer-when-downgrade",title:"Preview"},`${a}-${j}`)})]}):(0,s.jsxs)("div",{className:"flex h-full flex-col items-center justify-center gap-3 p-8 text-center",children:[(0,s.jsx)(m.Eye,{className:"h-10 w-10 text-muted-foreground/40"}),(0,s.jsx)("h3",{className:"text-sm font-medium text-foreground",children:d("preview.noWorktree")}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:d("preview.noWorktreeDesc")})]})}var nS=e.i(203529),nE=e.i(268244),nA=e.i(763428),nD=e.i(515932),nM=e.i(391041),nI=e.i(924484),nP=e.i(14243),nR=e.i(512568),nB=e.i(446475),nF=e.i(854860),nL=e.i(612758),nz=e.i(79769);let n$={TODO:"待处理",IN_PROGRESS:"执行中",IN_REVIEW:"待评审",DONE:"已完成",CANCELLED:"已取消"},nT={TODO:"bg-muted text-muted-foreground",IN_PROGRESS:"bg-blue-500/10 text-blue-400 border border-blue-500/20",IN_REVIEW:"bg-amber-500/10 text-amber-400 border border-amber-500/20",DONE:"bg-emerald-500/10 text-emerald-400 border border-emerald-500/20",CANCELLED:"bg-muted text-muted-foreground"};e.s(["TaskPageClient",0,function({task:e,workspaceId:t,workspaceName:r,latestExecution:n,executions:a=[]}){let d,j,k=(0,l.useRouter)(),{t:C}=(0,rw.useI18n)(),{removePortal:N}=(0,nz.useTerminalPortal)(),[S,E]=(0,i.useState)(e.status),[A,D]=(0,i.useState)(null),[M,I]=(0,i.useState)(!1),[P,B]=(0,i.useState)(null),[F,L]=(0,i.useState)(null),[z,$]=(0,i.useState)(null),[T,_]=(0,i.useState)(null),[O,W]=(0,i.useState)(0),[H,G]=(0,i.useState)(""),[K,V]=(0,i.useState)(!1),[U,Y]=(0,i.useState)([]),[q,J]=(0,i.useState)(null),[X,Q]=(0,i.useState)(n?.status==="RUNNING"?n?.worktreePath??null:null),Z=e.project?.localPath?e.subPath?`${e.project.localPath}/${e.subPath}`:e.project.localPath:null,ee=n?.worktreePath??Z;(0,i.useEffect)(()=>{let e=!1;return(0,nF.getPrompts)().then(t=>{if(e)return;Y(t.map(e=>({id:e.id,name:e.name,isDefault:e.isDefault})));let r=t.find(e=>e.isDefault);r&&J(r.id)}),()=>{e=!0}},[]),(0,i.useEffect)(()=>{let t=!1;return(0,nI.getTaskExecutions)(e.id).then(r=>{if(t)return;let n=r[0];if(n?.status==="RUNNING"){let t=n.worktreePath||e.project?.localPath||null;t&&Q(t)}}),()=>{t=!0}},[e.id,e.project?.localPath]),(0,i.useEffect)(()=>{if("TODO"===S||"CANCELLED"===S)return;let t=!1;return I(!0),fetch(`/api/tasks/${e.id}/diff`).then(e=>{if(!e.ok)throw Error(`HTTP ${e.status}`);return e.json()}).then(e=>{if(!t){if(!e.files&&!e.branchDeleted)return void D(null);D(e)}}).catch(()=>{t||(D(null),rW.toast.error(C("taskPage.loadDiffFailed")))}).finally(()=>{t||I(!1)}),()=>{t=!0}},[e.id,S]);let et=(0,i.useCallback)(async()=>{if(!K){V(!0);try{let{worktreePath:t}=await (0,nE.startPtyExecution)(e.id,"",q);Q(t)}catch(e){V(!1),rW.toast.error(e instanceof Error?e.message:String(e))}}},[e.id,K,q]),er=(0,i.useCallback)(t=>{V(!1),Q(null),N(e.id),0===t&&E("IN_REVIEW"),k.refresh()},[k,N,e.id]),en=(0,i.useCallback)(async()=>{await (0,nA.stopPtyExecution)(e.id),V(!1),Q(null),E("IN_REVIEW"),k.refresh()},[e.id,k]),ea=(0,i.useCallback)(async t=>{V(!0),N(e.id),Q(null);try{let{worktreePath:r}=await (0,nD.resumePtyExecution)(e.id,t);Q(r),E("IN_PROGRESS")}catch{V(!1)}},[e.id,N]),es=(0,i.useCallback)(async()=>{V(!0),N(e.id),Q(null);try{let{worktreePath:t}=await (0,nM.continueLatestPtyExecution)(e.id);Q(t),E("IN_PROGRESS")}catch(e){V(!1),rW.toast.error(e instanceof Error?e.message:String(e))}},[e.id]),ei=(0,i.useCallback)(()=>{E("DONE"),eo(!1),rW.toast.success(C("taskPage.taskCompleted")),fetch(`/api/tasks/${e.id}/diff`).then(e=>{if(e.ok)return e.json()}).then(e=>{e?.files&&D(e)}).catch(()=>{rW.toast.error(C("taskPage.loadDiffFailed"))}),k.refresh()},[k,C,e.id]),[el,eo]=(0,i.useState)(!1),[eu,ec]=(0,i.useState)([]),ed=(0,i.useCallback)(async()=>{try{let t=await (0,nR.checkWorktreeClean)(e.id);if(t.hasWorktree&&!t.clean)return void rW.toast.error(C("taskPage.uncommittedChanges",{count:String(t.files.length)}));if(t.hasWorktree&&t.clean&&!t.hasCommits)return void rW.toast.error(C("taskPage.noChangesToComplete"));if(t.hasWorktree&&t.hasCommits){ec(t.commitLog),eo(!0);return}await (0,nP.updateTaskStatus)(e.id,"DONE"),E("DONE"),k.refresh(),rW.toast.success(C("taskPage.taskCompleted"))}catch(e){rW.toast.error(e instanceof Error?e.message:String(e))}},[e.id,k,C,n]),eh=(0,i.useCallback)(async t=>{try{let{hash:r}=await (0,nB.commitWorktreeChanges)(e.id,t);rW.toast.success(C("diff.commitSuccess",{hash:r})),k.refresh();let n=await fetch(`/api/tasks/${e.id}/diff`);if(n.ok){let e=await n.json();D(e?.files?e:null)}}catch(e){rW.toast.error(e instanceof Error?e.message:"Commit failed")}},[e.id,k,C]);return(0,s.jsxs)(eL,{direction:"horizontal",className:"h-screen bg-background",children:[(0,s.jsxs)(R,{defaultSize:35,minSize:20,className:"flex flex-col border-r border-border bg-sidebar",children:[(0,s.jsxs)("div",{className:"header-lg px-4 py-3",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsxs)(w.default,{href:`/workspaces/${t}?projectId=${e.projectId}&taskId=${e.id}`,className:"flex shrink-0 items-center justify-center rounded-md border border-border bg-muted px-1.5 py-1 text-xs text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",children:[(0,s.jsx)(o.ArrowLeft,{className:"mr-1 h-3 w-3"}),C("taskPage.back")]}),(0,s.jsxs)("div",{className:"flex min-w-0 items-center gap-1 text-sm text-muted-foreground",children:[(0,s.jsx)("span",{className:"shrink-0",children:r}),e.project&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"shrink-0",children:"/"}),(0,s.jsx)("span",{className:"shrink-0",children:e.project.name})]}),(0,s.jsx)("span",{className:"shrink-0",children:"/"}),(0,s.jsx)("span",{className:"truncate font-semibold text-foreground",children:e.title})]})]}),(0,s.jsxs)("div",{className:"mt-2 flex items-center gap-2",children:[(0,s.jsx)("span",{className:`inline-flex items-center rounded-full px-2 py-0.5 text-[10px] font-medium ${nT[S]??"bg-muted text-muted-foreground"}`,children:n$[S]??S}),(e.baseBranch||n?.worktreeBranch)&&(0,s.jsxs)(nS.Badge,{variant:"secondary",className:"gap-1 border border-border bg-muted font-mono text-[10px] text-muted-foreground",children:[(0,s.jsx)(u.GitBranch,{className:"h-2.5 w-2.5"}),e.baseBranch??n?.worktreeBranch]})]}),(0,s.jsx)("div",{className:"border-t border-transparent",children:"IN_REVIEW"===S&&(0,s.jsx)("div",{className:"mt-2",children:(0,s.jsxs)(ry.Button,{size:"sm",onClick:ed,className:"bg-emerald-500/15 text-emerald-400 ring-1 ring-emerald-500/20 hover:bg-emerald-500/25",children:[(0,s.jsx)(g.CheckCircle2,{className:"h-3.5 w-3.5"}),C("taskPage.completeTask")]})})})]}),(0,s.jsx)("div",{className:"flex-1 min-h-0 overflow-hidden",children:X?(0,s.jsxs)("div",{className:"flex h-full flex-col overflow-hidden",children:[(0,s.jsxs)("div",{className:"header-xs shrink-0 flex items-center justify-between border-b-neutral-800 px-3 py-1.5 bg-[#0a0a0a]",children:[(0,s.jsxs)("span",{className:"flex items-center gap-1.5 text-xs text-emerald-400",children:[(0,s.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-400 animate-pulse"}),C("execution.running")]}),(0,s.jsxs)(y.Tooltip,{children:[(0,s.jsxs)(y.TooltipTrigger,{onClick:en,className:"flex items-center gap-1.5 rounded-md bg-red-500/15 px-3 py-1 text-xs font-medium text-red-400 hover:bg-red-500/25 transition-colors",children:[(0,s.jsx)(x.Square,{className:"h-3 w-3"}),C("terminal.stopExecution")]}),(0,s.jsx)(y.TooltipContent,{side:"bottom",children:C("terminal.stopHint")})]})]}),(0,s.jsx)("div",{className:"flex-1 min-h-0",children:(0,s.jsx)(nz.TerminalOutlet,{taskId:e.id,worktreePath:X,onSessionEnd:er,onFileOpen:e=>{B(e),_("files")}})})]}):"DONE"===S||"CANCELLED"===S?(0,s.jsx)("div",{className:"flex h-full flex-col overflow-hidden bg-[#0a0a0a]",children:(0,s.jsx)("div",{className:"flex-1 min-h-0 overflow-y-auto",children:(0,s.jsx)(nL.ExecutionTimeline,{executions:a})})}):(0,s.jsxs)("div",{className:"flex h-full flex-col overflow-hidden bg-[#0a0a0a]",children:[(0,s.jsxs)("div",{className:"header-xs shrink-0 flex items-center gap-3 border-b-neutral-800 px-4 py-1.5",children:[U.length>0&&(0,s.jsxs)(ng.Select,{defaultValue:q??"none",onValueChange:e=>J("none"===e?null:e),children:[(0,s.jsx)(ng.SelectTrigger,{size:"sm",className:"min-w-[140px]",children:(0,s.jsx)("span",{className:"text-left truncate",children:q?U.find(e=>e.id===q)?.name??C("terminal.noPrompt"):C("terminal.noPrompt")})}),(0,s.jsxs)(ng.SelectContent,{className:"min-w-[200px]",children:[(0,s.jsx)(ng.SelectItem,{value:"none",children:C("terminal.noPrompt")}),U.map(e=>(0,s.jsxs)(ng.SelectItem,{value:e.id,children:[e.name,e.isDefault?" ★":""]},e.id))]})]},`prompt-${U.length}`),(0,s.jsxs)(ry.Button,{onClick:et,disabled:K,size:"sm",className:"gap-2 px-4",children:[K?(0,s.jsx)(c.Loader2,{className:"h-3.5 w-3.5 animate-spin"}):(0,s.jsx)(p.Terminal,{className:"h-3.5 w-3.5"}),K?C("terminal.executing"):C("terminal.launch")]})]}),(0,s.jsx)("div",{className:"flex-1 min-h-0 overflow-y-auto",children:(0,s.jsx)(nL.ExecutionTimeline,{executions:a,onResume:ea,onContinueLatest:es})})]})})]}),(0,s.jsx)(eT,{className:"relative w-px bg-border transition-colors hover:bg-primary/20 active:bg-primary/40 cursor-col-resize"}),(0,s.jsx)(R,{defaultSize:65,minSize:20,className:"flex flex-col",children:(j=(d="DONE"===S&&!!e.baseBranch)?"changes":"files",(0,s.jsxs)(tN,{value:T??j,onValueChange:_,className:"flex h-full flex-col gap-0",children:[(0,s.jsx)("div",{className:"header-lg flex shrink-0 items-center px-3 py-3",children:(0,s.jsxs)(tE,{className:"h-auto border border-border",children:[!d&&(0,s.jsxs)(tA,{value:"files",className:"data-active:bg-background data-active:text-foreground data-active:shadow-sm dark:data-active:bg-background dark:data-active:border-transparent",children:[(0,s.jsx)(h,{className:"h-3.5 w-3.5"}),C("taskPage.tabFiles")]}),(0,s.jsxs)(tA,{value:"changes",className:"data-active:bg-background data-active:text-foreground data-active:shadow-sm dark:data-active:bg-background dark:data-active:border-transparent",children:[(0,s.jsx)(f.GitCompare,{className:"h-3.5 w-3.5"}),C("taskPage.changes")]}),!d&&e.project?.projectType!=="BACKEND"&&(0,s.jsxs)(tA,{value:"preview",className:"data-active:bg-background data-active:text-foreground data-active:shadow-sm dark:data-active:bg-background dark:data-active:border-transparent",children:[(0,s.jsx)(m.Eye,{className:"h-3.5 w-3.5"}),C("taskPage.tabPreview")]})]})}),(0,s.jsx)(tD,{value:"files",className:"flex-1 min-h-0 overflow-hidden",children:(0,s.jsxs)("div",{className:"flex h-full flex-row overflow-hidden",children:[(0,s.jsx)("div",{className:"w-60 flex-none border-r border-border overflow-hidden flex flex-col",children:(0,s.jsxs)(tN,{defaultValue:"filetree",className:"flex h-full flex-col gap-0",children:[(0,s.jsx)("div",{className:"header-xs flex shrink-0 px-2 py-1.5",children:(0,s.jsxs)(tE,{className:"h-auto border border-border w-full",children:[(0,s.jsxs)(tA,{value:"filetree",className:"flex-1 text-xs gap-1 data-active:bg-background data-active:text-foreground data-active:shadow-sm dark:data-active:bg-background dark:data-active:border-transparent",children:[(0,s.jsx)(h,{className:"h-3 w-3"}),C("taskPage.tabFileTree")]}),(0,s.jsxs)(tA,{value:"search",className:"flex-1 text-xs gap-1 data-active:bg-background data-active:text-foreground data-active:shadow-sm dark:data-active:bg-background dark:data-active:border-transparent",children:[(0,s.jsx)(b.Search,{className:"h-3 w-3"}),C("taskPage.tabSearch")]}),(0,s.jsxs)(tA,{value:"git",className:"flex-1 text-xs gap-1 data-active:bg-background data-active:text-foreground data-active:shadow-sm dark:data-active:bg-background dark:data-active:border-transparent",children:[(0,s.jsx)(v,{className:"h-3 w-3"}),C("git.tabLabel")]})]})}),(0,s.jsx)(tD,{value:"filetree",className:"flex-1 min-h-0 overflow-hidden mt-0",children:(0,s.jsx)(r$,{worktreePath:ee??null,baseBranch:e.baseBranch??null,worktreeBranch:n?.worktreeBranch??null,executionStatus:n?.status??"COMPLETED",onFileSelect:e=>{B(e),L(null)}})}),(0,s.jsx)(tD,{value:"search",className:"flex-1 min-h-0 overflow-hidden mt-0",children:(0,s.jsx)(r1,{localPath:ee??e.project?.localPath??null,onResultSelect:(e,t)=>{B(e),L(t),_("files")}})}),(0,s.jsx)(tD,{value:"git",className:"flex-1 min-h-0 overflow-hidden mt-0",children:(0,s.jsx)(nm,{localPath:ee??e.project?.localPath??"",onFileSelect:(e,t)=>{$({relativePath:e,originalContent:t})}})})]})}),(0,s.jsx)("div",{className:"flex-1 min-w-0 overflow-hidden",children:ee?(0,s.jsx)(rX,{worktreePath:ee,selectedFilePath:P,selectedLine:F,onFilePathChange:B,onSave:()=>W(e=>e+1),diffFileRequest:z}):(0,s.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:C("editor.noWorktree")})})})]})}),(0,s.jsx)(tD,{value:"changes",className:"flex-1 min-h-0 overflow-auto",children:M?(0,s.jsxs)("div",{className:"flex h-full flex-col items-center justify-center gap-2",children:[(0,s.jsx)(c.Loader2,{className:"size-5 animate-spin text-muted-foreground"}),(0,s.jsx)("span",{className:"text-xs text-muted-foreground",children:C("taskPage.loadingDiff")})]}):A?.branchDeleted?(0,s.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:C("taskPage.branchDeleted")})}):A?(0,s.jsx)(tM.TaskDiffView,{files:A.files,totalAdded:A.totalAdded,totalRemoved:A.totalRemoved,hasConflicts:A.hasConflicts,conflictFiles:A.conflictFiles,onCommit:eh,hasUncommitted:A.hasUncommitted}):(0,s.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"TODO"===S?C("taskPage.startExecution"):C("taskPage.noDiff")})})}),(0,s.jsx)(tD,{value:"preview",className:"flex-1 min-h-0 overflow-hidden",children:(0,s.jsx)(nN,{taskId:e.id,worktreePath:n?.worktreePath??null,previewCommand:e.project?.previewCommand??null,previewPort:e.project?.previewPort??null,refreshKey:O,projectId:e.projectId,previewUrl:H,onPreviewUrlChange:G})})]},j))}),(0,s.jsx)(tI.TaskMergeConfirmDialog,{open:el,onOpenChange:eo,taskId:e.id,taskTitle:e.title,baseBranch:e.baseBranch??"main",fileCount:A?.files?.length??0,commitCount:A?.commitCount??0,commitLog:eu,onMergeComplete:ei})]})}],839178)}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,839178,e=>{"use strict";let t;var r,n,a,s=e.i(432377),i=e.i(85212),l=e.i(309542),o=e.i(265826),u=e.i(357334),c=e.i(946960),d=e.i(863961);let h=(0,d.default)("folder-tree",[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]]);var f=e.i(442409),m=e.i(154333),p=e.i(950211),x=e.i(289208),g=e.i(750986),b=e.i(677436);let v=(0,d.default)("git-pull-request-arrow",[["circle",{cx:"5",cy:"6",r:"3",key:"1qnov2"}],["path",{d:"M5 9v12",key:"ih889a"}],["circle",{cx:"19",cy:"18",r:"3",key:"1qljk2"}],["path",{d:"m15 9-3-3 3-3",key:"1lwv8l"}],["path",{d:"M12 6h5a2 2 0 0 1 2 2v7",key:"1yj91y"}]]);var y=e.i(11915),w=e.i(631325);let j=(0,i.createContext)(null);j.displayName="PanelGroupContext";let k="data-panel-group-direction",C="data-panel-group-id",N="data-resize-handle",S="data-panel-resize-handle-id",E=i.useLayoutEffect,A=i["useId".toString()],D="function"==typeof A?A:()=>null,M=0;function I(e=null){let t=D(),r=(0,i.useRef)(e||t||null);return null===r.current&&(r.current=""+M++),null!=e?e:r.current}function P({children:e,className:t="",collapsedSize:r,collapsible:n,defaultSize:a,forwardedRef:s,id:l,maxSize:o,minSize:u,onCollapse:c,onExpand:d,onResize:h,order:f,style:m,tagName:p="div",...x}){let g=(0,i.useContext)(j);if(null===g)throw Error("Panel components must be rendered within a PanelGroup container");let{collapsePanel:b,expandPanel:v,getPanelSize:y,getPanelStyle:w,groupId:k,isPanelCollapsed:N,reevaluatePanelConstraints:S,registerPanel:A,resizePanel:D,unregisterPanel:M}=g,R=I(l),B=(0,i.useRef)({callbacks:{onCollapse:c,onExpand:d,onResize:h},constraints:{collapsedSize:r,collapsible:n,defaultSize:a,maxSize:o,minSize:u},id:R,idIsFromProps:void 0!==l,order:f});(0,i.useRef)({didLogMissingDefaultSizeWarning:!1}),E(()=>{let{callbacks:e,constraints:t}=B.current,s={...t};B.current.id=R,B.current.idIsFromProps=void 0!==l,B.current.order=f,e.onCollapse=c,e.onExpand=d,e.onResize=h,t.collapsedSize=r,t.collapsible=n,t.defaultSize=a,t.maxSize=o,t.minSize=u,(s.collapsedSize!==t.collapsedSize||s.collapsible!==t.collapsible||s.maxSize!==t.maxSize||s.minSize!==t.minSize)&&S(B.current,s)}),E(()=>{let e=B.current;return A(e),()=>{M(e)}},[f,R,A,M]),(0,i.useImperativeHandle)(s,()=>({collapse:()=>{b(B.current)},expand:e=>{v(B.current,e)},getId:()=>R,getSize:()=>y(B.current),isCollapsed:()=>N(B.current),isExpanded:()=>!N(B.current),resize:e=>{D(B.current,e)}}),[b,v,y,N,R,D]);let F=w(B.current,a);return(0,i.createElement)(p,{...x,children:e,className:t,id:R,style:{...F,...m},[C]:k,"data-panel":"","data-panel-collapsible":n||void 0,"data-panel-id":R,"data-panel-size":parseFloat(""+F.flexGrow).toFixed(1)})}let R=(0,i.forwardRef)((e,t)=>(0,i.createElement)(P,{...e,forwardedRef:t}));P.displayName="Panel",R.displayName="forwardRef(Panel)";let B=null,F=-1,L=null;function z(e,r){var n,a,s;let i=function(e,t){if(t){let e=(t&U)!=0,r=(t&Y)!=0,n=(t&q)!=0,a=(t&J)!=0;if(e)if(n)return"se-resize";else if(a)return"ne-resize";else return"e-resize";if(r)if(n)return"sw-resize";else if(a)return"nw-resize";else return"w-resize";if(n)return"s-resize";else if(a)return"n-resize"}switch(e){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}(e,r);B!==i&&(B=i,null===L&&(L=document.createElement("style"),t&&L.setAttribute("nonce",t),document.head.appendChild(L)),F>=0&&(null==(s=L.sheet)||s.removeRule(F)),F=null!=(n=null==(a=L.sheet)?void 0:a.insertRule(`*{cursor: ${i} !important;}`))?n:-1)}function $(e){return"keydown"===e.type}function T(e){return e.type.startsWith("pointer")}function _(e){return e.type.startsWith("mouse")}function O(e){if(T(e)){if(e.isPrimary)return{x:e.clientX,y:e.clientY}}else if(_(e))return{x:e.clientX,y:e.clientY};return{x:1/0,y:1/0}}let W=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function H(e){let t=e.length;for(;t--;){let r=e[t];if(eh(r,"Missing node"),function(e){var t;let r,n=getComputedStyle(e);return"fixed"===n.position||!!("auto"!==n.zIndex&&("static"!==n.position||"flex"===(r=getComputedStyle(null!=(t=V(e))?t:e).display)||"inline-flex"===r)||1>+n.opacity||"transform"in n&&"none"!==n.transform||"webkitTransform"in n&&"none"!==n.webkitTransform||"mixBlendMode"in n&&"normal"!==n.mixBlendMode||"filter"in n&&"none"!==n.filter||"webkitFilter"in n&&"none"!==n.webkitFilter||"isolation"in n&&"isolate"===n.isolation||W.test(n.willChange))||"touch"===n.webkitOverflowScrolling}(r))return r}return null}function G(e){return e&&Number(getComputedStyle(e).zIndex)||0}function K(e){let t=[];for(;e;)t.push(e),e=V(e);return t}function V(e){let{parentNode:t}=e;return t&&t instanceof ShadowRoot?t.host:t}let U=1,Y=2,q=4,J=8,X="coarse"===function(){if("function"==typeof matchMedia)return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}(),Q=[],Z=!1,ee=new Map,et=new Map,er=new Set;function en(e){let{target:t}=e,{x:r,y:n}=O(e);Z=!0,el({target:t,x:r,y:n}),ec(),Q.length>0&&(ed("down",e),e.preventDefault(),ei(t)||e.stopImmediatePropagation())}function ea(e){let{x:t,y:r}=O(e);if(Z&&0===e.buttons&&(Z=!1,ed("up",e)),!Z){let{target:n}=e;el({target:n,x:t,y:r})}ed("move",e),eo(),Q.length>0&&e.preventDefault()}function es(e){let{target:t}=e,{x:r,y:n}=O(e);et.clear(),Z=!1,Q.length>0&&(e.preventDefault(),ei(t)||e.stopImmediatePropagation()),ed("up",e),el({target:t,x:r,y:n}),eo(),ec()}function ei(e){let t=e;for(;t;){if(t.hasAttribute(N))return!0;t=t.parentElement}return!1}function el({target:e,x:t,y:r}){Q.splice(0);let n=null;(e instanceof HTMLElement||e instanceof SVGElement)&&(n=e),er.forEach(e=>{let{element:a,hitAreaMargins:s}=e,i=a.getBoundingClientRect(),{bottom:l,left:o,right:u,top:c}=i,d=X?s.coarse:s.fine;if(t>=o-d&&t<=u+d&&r>=c-d&&r<=l+d){if(null!==n&&document.contains(n)&&a!==n&&!a.contains(n)&&!n.contains(a)&&function(e,t){let r;if(e===t)throw Error("Cannot compare node with itself");let n={a:K(e),b:K(t)};for(;n.a.at(-1)===n.b.at(-1);)e=n.a.pop(),t=n.b.pop(),r=e;eh(r,"Stacking order can only be calculated for elements with a common ancestor");let a={a:G(H(n.a)),b:G(H(n.b))};if(a.a===a.b){let e=r.childNodes,t={a:n.a.at(-1),b:n.b.at(-1)},a=e.length;for(;a--;){let r=e[a];if(r===t.a)return 1;if(r===t.b)return -1}}return Math.sign(a.a-a.b)}(n,a)>0){let e=n,t=!1;for(;e;){var h;if(e.contains(a))break;if(h=e.getBoundingClientRect(),h.x<i.x+i.width&&h.x+h.width>i.x&&h.y<i.y+i.height&&h.y+h.height>i.y){t=!0;break}e=e.parentElement}if(t)return}Q.push(e)}})}function eo(){let e=!1,t=!1;Q.forEach(r=>{let{direction:n}=r;"horizontal"===n?e=!0:t=!0});let r=0;et.forEach(e=>{r|=e}),e&&t?z("intersection",r):e?z("horizontal",r):t?z("vertical",r):null!==L&&(document.head.removeChild(L),B=null,L=null,F=-1)}let eu=new AbortController;function ec(){eu.abort();let e={capture:!0,signal:(eu=new AbortController).signal};er.size&&(Z?(Q.length>0&&ee.forEach((t,r)=>{let{body:n}=r;t>0&&(n.addEventListener("contextmenu",es,e),n.addEventListener("pointerleave",ea,e),n.addEventListener("pointermove",ea,e))}),window.addEventListener("pointerup",es,e),window.addEventListener("pointercancel",es,e)):ee.forEach((t,r)=>{let{body:n}=r;t>0&&(n.addEventListener("pointerdown",en,e),n.addEventListener("pointermove",ea,e))}))}function ed(e,t){er.forEach(r=>{let{setResizeHandlerState:n}=r;n(e,Q.includes(r),t)})}function eh(e,t){if(!e)throw console.error(t),Error(t)}function ef(e,t,r=10){return e.toFixed(r)===t.toFixed(r)?0:e>t?1:-1}function em(e,t,r=10){return 0===ef(e,t,r)}function ep(e,t,r){return 0===ef(e,t,r)}function ex({panelConstraints:e,panelIndex:t,size:r}){let n=e[t];eh(null!=n,`Panel constraints not found for index ${t}`);let{collapsedSize:a=0,collapsible:s,maxSize:i=100,minSize:l=0}=n;return 0>ef(r,l)&&(r=s&&0>ef(r,(a+l)/2)?a:l),r=parseFloat((r=Math.min(i,r)).toFixed(10))}function eg({delta:e,initialLayout:t,panelConstraints:r,pivotIndices:n,prevLayout:a,trigger:s}){if(ep(e,0))return t;let i=[...t],[l,o]=n;eh(null!=l,"Invalid first pivot index"),eh(null!=o,"Invalid second pivot index");let u=0;if("keyboard"===s){{let n=e<0?o:l,a=r[n];eh(a,`Panel constraints not found for index ${n}`);let{collapsedSize:s=0,collapsible:i,minSize:u=0}=a;if(i){let r=t[n];if(eh(null!=r,`Previous layout not found for panel index ${n}`),ep(r,s)){let t=u-r;ef(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}{let n=e<0?l:o,a=r[n];eh(a,`No panel constraints found for index ${n}`);let{collapsedSize:s=0,collapsible:i,minSize:u=0}=a;if(i){let r=t[n];if(eh(null!=r,`Previous layout not found for panel index ${n}`),ep(r,u)){let t=r-s;ef(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}}{let n=e<0?1:-1,a=e<0?o:l,s=0;for(;;){let e=t[a];if(eh(null!=e,`Previous layout not found for panel index ${a}`),s+=ex({panelConstraints:r,panelIndex:a,size:100})-e,(a+=n)<0||a>=r.length)break}let i=Math.min(Math.abs(e),Math.abs(s));e=e<0?0-i:i}{let n=e<0?l:o;for(;n>=0&&n<r.length;){let a=Math.abs(e)-Math.abs(u),s=t[n];eh(null!=s,`Previous layout not found for panel index ${n}`);let l=ex({panelConstraints:r,panelIndex:n,size:s-a});if(!ep(s,l)&&(u+=s-l,i[n]=l,u.toPrecision(3).localeCompare(Math.abs(e).toPrecision(3),void 0,{numeric:!0})>=0))break;e<0?n--:n++}}if(function(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(!ep(e[r],t[r],void 0))return!1;return!0}(a,i))return a;{let n=e<0?o:l,a=t[n];eh(null!=a,`Previous layout not found for panel index ${n}`);let s=a+u,c=ex({panelConstraints:r,panelIndex:n,size:s});if(i[n]=c,!ep(c,s)){let t=s-c,n=e<0?o:l;for(;n>=0&&n<r.length;){let a=i[n];eh(null!=a,`Previous layout not found for panel index ${n}`);let s=ex({panelConstraints:r,panelIndex:n,size:a+t});if(ep(a,s)||(t-=s-a,i[n]=s),ep(t,0))break;e>0?n--:n++}}}return ep(i.reduce((e,t)=>t+e,0),100)?i:a}function eb(e,t=document){return Array.from(t.querySelectorAll(`[${S}][data-panel-group-id="${e}"]`))}function ev(e,t,r=document){let n=eb(e,r).findIndex(e=>e.getAttribute(S)===t);return null!=n?n:null}function ey(e,t,r){let n=ev(e,t,r);return null!=n?[n,n+1]:[-1,-1]}function ew(e,t=document){var r;if(t instanceof HTMLElement&&(null==t||null==(r=t.dataset)?void 0:r.panelGroupId)==e)return t;let n=t.querySelector(`[data-panel-group][data-panel-group-id="${e}"]`);return n||null}function ej(e,t=document){let r=t.querySelector(`[${S}="${e}"]`);return r||null}function ek(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}function eC(e,t){let{x:r,y:n}=O(t);return"horizontal"===e?r:n}function eN(e,t,r){t.forEach((t,n)=>{let a=e[n];eh(a,`Panel data not found for index ${n}`);let{callbacks:s,constraints:i,id:l}=a,{collapsedSize:o=0,collapsible:u}=i,c=r[l];if(null==c||t!==c){r[l]=t;let{onCollapse:e,onExpand:n,onResize:a}=s;a&&a(t,c),u&&(e||n)&&(n&&(null==c||em(c,o))&&!em(t,o)&&n(),e&&(null==c||!em(c,o))&&em(t,o)&&e())}})}function eS(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!=t[r])return!1;return!0}function eE(e){try{if("u">typeof localStorage)e.getItem=e=>localStorage.getItem(e),e.setItem=(e,t)=>{localStorage.setItem(e,t)};else throw Error("localStorage not supported in this environment")}catch(t){console.error(t),e.getItem=()=>null,e.setItem=()=>{}}}function eA(e){return`react-resizable-panels:${e}`}function eD(e){return e.map(e=>{let{constraints:t,id:r,idIsFromProps:n,order:a}=e;return n?r:a?`${a}:${JSON.stringify(t)}`:JSON.stringify(t)}).sort((e,t)=>e.localeCompare(t)).join(",")}function eM(e,t){try{let r=eA(e),n=t.getItem(r);if(n){let e=JSON.parse(n);if("object"==typeof e&&null!=e)return e}}catch(e){}return null}function eI(e,t,r,n,a){var s;let i=eA(e),l=eD(t),o=null!=(s=eM(e,a))?s:{};o[l]={expandToSizes:Object.fromEntries(r.entries()),layout:n};try{a.setItem(i,JSON.stringify(o))}catch(e){console.error(e)}}function eP({layout:e,panelConstraints:t}){let r=[...e],n=r.reduce((e,t)=>e+t,0);if(r.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${r.map(e=>`${e}%`).join(", ")}`);if(!ep(n,100)&&r.length>0)for(let e=0;e<t.length;e++){let t=r[e];eh(null!=t,`No layout data found for index ${e}`);let a=100/n*t;r[e]=a}let a=0;for(let e=0;e<t.length;e++){let n=r[e];eh(null!=n,`No layout data found for index ${e}`);let s=ex({panelConstraints:t,panelIndex:e,size:n});n!=s&&(a+=n-s,r[e]=s)}if(!ep(a,0))for(let e=0;e<t.length;e++){let n=r[e];eh(null!=n,`No layout data found for index ${e}`);let s=ex({panelConstraints:t,panelIndex:e,size:n+a});if(n!==s&&(a-=s-n,r[e]=s,ep(a,0)))break}return r}let eR={getItem:e=>(eE(eR),eR.getItem(e)),setItem:(e,t)=>{eE(eR),eR.setItem(e,t)}},eB={};function eF({autoSaveId:e=null,children:t,className:r="",direction:n,forwardedRef:a,id:s=null,onLayout:l=null,keyboardResizeBy:o=null,storage:u=eR,style:c,tagName:d="div",...h}){let f=I(s),m=(0,i.useRef)(null),[p,x]=(0,i.useState)(null),[g,b]=(0,i.useState)([]),v=function(){let[e,t]=(0,i.useState)(0);return(0,i.useCallback)(()=>t(e=>e+1),[])}(),y=(0,i.useRef)({}),w=(0,i.useRef)(new Map),N=(0,i.useRef)(0),A=(0,i.useRef)({autoSaveId:e,direction:n,dragState:p,id:f,keyboardResizeBy:o,onLayout:l,storage:u}),D=(0,i.useRef)({layout:g,panelDataArray:[],panelDataArrayChanged:!1});(0,i.useRef)({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),(0,i.useImperativeHandle)(a,()=>({getId:()=>A.current.id,getLayout:()=>{let{layout:e}=D.current;return e},setLayout:e=>{let{onLayout:t}=A.current,{layout:r,panelDataArray:n}=D.current,a=eP({layout:e,panelConstraints:n.map(e=>e.constraints)});ek(r,a)||(b(a),D.current.layout=a,t&&t(a),eN(n,a,y.current))}}),[]),E(()=>{A.current.autoSaveId=e,A.current.direction=n,A.current.dragState=p,A.current.id=f,A.current.onLayout=l,A.current.storage=u}),function({committedValuesRef:e,eagerValuesRef:t,groupId:r,layout:n,panelDataArray:a,panelGroupElement:s,setLayout:l}){(0,i.useRef)({didWarnAboutMissingResizeHandle:!1}),E(()=>{if(!s)return;let e=eb(r,s);for(let t=0;t<a.length-1;t++){let{valueMax:r,valueMin:s,valueNow:i}=function({layout:e,panelsArray:t,pivotIndices:r}){let n=0,a=100,s=0,i=0,l=r[0];return eh(null!=l,"No pivot index found"),t.forEach((e,t)=>{let{constraints:r}=e,{maxSize:o=100,minSize:u=0}=r;t===l?(n=u,a=o):(s+=u,i+=o)}),{valueMax:Math.min(a,100-s),valueMin:Math.max(n,100-i),valueNow:e[l]}}({layout:n,panelsArray:a,pivotIndices:[t,t+1]}),l=e[t];if(null==l);else{let e=a[t];eh(e,`No panel data found for index "${t}"`),l.setAttribute("aria-controls",e.id),l.setAttribute("aria-valuemax",""+Math.round(r)),l.setAttribute("aria-valuemin",""+Math.round(s)),l.setAttribute("aria-valuenow",null!=i?""+Math.round(i):"")}}return()=>{e.forEach((e,t)=>{e.removeAttribute("aria-controls"),e.removeAttribute("aria-valuemax"),e.removeAttribute("aria-valuemin"),e.removeAttribute("aria-valuenow")})}},[r,n,a,s]),(0,i.useEffect)(()=>{if(!s)return;let e=t.current;eh(e,"Eager values not found");let{panelDataArray:a}=e;eh(null!=ew(r,s),`No group found for id "${r}"`);let i=eb(r,s);eh(i,`No resize handles found for group id "${r}"`);let o=i.map(e=>{let t=e.getAttribute(S);eh(t,"Resize handle element has no handle id attribute");let[i,o]=function(e,t,r,n=document){var a,s,i,l;let o=ej(t,n),u=eb(e,n),c=o?u.indexOf(o):-1;return[null!=(a=null==(s=r[c])?void 0:s.id)?a:null,null!=(i=null==(l=r[c+1])?void 0:l.id)?i:null]}(r,t,a,s);if(null==i||null==o)return()=>{};let u=e=>{if(!e.defaultPrevented&&"Enter"===e.key){e.preventDefault();let o=a.findIndex(e=>e.id===i);if(o>=0){let e=a[o];eh(e,`No panel data found for index ${o}`);let i=n[o],{collapsedSize:u=0,collapsible:c,minSize:d=0}=e.constraints;if(null!=i&&c){let e=eg({delta:ep(i,u)?d-u:u-i,initialLayout:n,panelConstraints:a.map(e=>e.constraints),pivotIndices:ey(r,t,s),prevLayout:n,trigger:"keyboard"});n!==e&&l(e)}}}};return e.addEventListener("keydown",u),()=>{e.removeEventListener("keydown",u)}});return()=>{o.forEach(e=>e())}},[s,e,t,r,n,a,l])}({committedValuesRef:A,eagerValuesRef:D,groupId:f,layout:g,panelDataArray:D.current.panelDataArray,setLayout:b,panelGroupElement:m.current}),(0,i.useEffect)(()=>{let{panelDataArray:t}=D.current;if(e){if(0===g.length||g.length!==t.length)return;let r=eB[e];null==r&&(r=function(e,t=10){let r=null;return(...n)=>{null!==r&&clearTimeout(r),r=setTimeout(()=>{e(...n)},t)}}(eI,100),eB[e]=r),r(e,[...t],new Map(w.current),g,u)}},[e,g,u]),(0,i.useEffect)(()=>{});let M=(0,i.useCallback)(e=>{let{onLayout:t}=A.current,{layout:r,panelDataArray:n}=D.current;if(e.constraints.collapsible){let a=n.map(e=>e.constraints),{collapsedSize:s=0,panelSize:i,pivotIndices:l}=e$(n,e,r);if(eh(null!=i,`Panel size not found for panel "${e.id}"`),!em(i,s)){w.current.set(e.id,i);let o=eg({delta:ez(n,e)===n.length-1?i-s:s-i,initialLayout:r,panelConstraints:a,pivotIndices:l,prevLayout:r,trigger:"imperative-api"});eS(r,o)||(b(o),D.current.layout=o,t&&t(o),eN(n,o,y.current))}}},[]),P=(0,i.useCallback)((e,t)=>{let{onLayout:r}=A.current,{layout:n,panelDataArray:a}=D.current;if(e.constraints.collapsible){let s=a.map(e=>e.constraints),{collapsedSize:i=0,panelSize:l=0,minSize:o=0,pivotIndices:u}=e$(a,e,n),c=null!=t?t:o;if(em(l,i)){let t=w.current.get(e.id),i=null!=t&&t>=c?t:c,o=eg({delta:ez(a,e)===a.length-1?l-i:i-l,initialLayout:n,panelConstraints:s,pivotIndices:u,prevLayout:n,trigger:"imperative-api"});eS(n,o)||(b(o),D.current.layout=o,r&&r(o),eN(a,o,y.current))}}},[]),R=(0,i.useCallback)(e=>{let{layout:t,panelDataArray:r}=D.current,{panelSize:n}=e$(r,e,t);return eh(null!=n,`Panel size not found for panel "${e.id}"`),n},[]),B=(0,i.useCallback)((e,t)=>{let{panelDataArray:r}=D.current,n=ez(r,e);return function({defaultSize:e,dragState:t,layout:r,panelData:n,panelIndex:a,precision:s=3}){let i=r[a];return{flexBasis:0,flexGrow:null==i?void 0!=e?e.toPrecision(s):"1":1===n.length?"1":i.toPrecision(s),flexShrink:1,overflow:"hidden",pointerEvents:null!==t?"none":void 0}}({defaultSize:t,dragState:p,layout:g,panelData:r,panelIndex:n})},[p,g]),F=(0,i.useCallback)(e=>{let{layout:t,panelDataArray:r}=D.current,{collapsedSize:n=0,collapsible:a,panelSize:s}=e$(r,e,t);return eh(null!=s,`Panel size not found for panel "${e.id}"`),!0===a&&em(s,n)},[]),L=(0,i.useCallback)(e=>{let{layout:t,panelDataArray:r}=D.current,{collapsedSize:n=0,collapsible:a,panelSize:s}=e$(r,e,t);return eh(null!=s,`Panel size not found for panel "${e.id}"`),!a||ef(s,n)>0},[]),z=(0,i.useCallback)(e=>{let{panelDataArray:t}=D.current;t.push(e),t.sort((e,t)=>{let r=e.order,n=t.order;return null==r&&null==n?0:null==r?-1:null==n?1:r-n}),D.current.panelDataArrayChanged=!0,v()},[v]);E(()=>{if(D.current.panelDataArrayChanged){D.current.panelDataArrayChanged=!1;let{autoSaveId:r,onLayout:n,storage:a}=A.current,{layout:s,panelDataArray:i}=D.current,l=null;if(r){var e,t;let n=null!=(t=(null!=(e=eM(r,a))?e:{})[eD(i)])?t:null;n&&(w.current=new Map(Object.entries(n.expandToSizes)),l=n.layout)}null==l&&(l=function({panelDataArray:e}){let t=Array(e.length),r=e.map(e=>e.constraints),n=0,a=100;for(let s=0;s<e.length;s++){let e=r[s];eh(e,`Panel constraints not found for index ${s}`);let{defaultSize:i}=e;null!=i&&(n++,t[s]=i,a-=i)}for(let s=0;s<e.length;s++){let i=r[s];eh(i,`Panel constraints not found for index ${s}`);let{defaultSize:l}=i;if(null!=l)continue;let o=a/(e.length-n);n++,t[s]=o,a-=o}return t}({panelDataArray:i}));let o=eP({layout:l,panelConstraints:i.map(e=>e.constraints)});ek(s,o)||(b(o),D.current.layout=o,n&&n(o),eN(i,o,y.current))}}),E(()=>{let e=D.current;return()=>{e.layout=[]}},[]);let O=(0,i.useCallback)(e=>{let t=!1,r=m.current;return r&&"rtl"===window.getComputedStyle(r,null).getPropertyValue("direction")&&(t=!0),function(r){var n,a;r.preventDefault();let s=m.current;if(!s)return()=>null;let{direction:i,dragState:l,id:o,keyboardResizeBy:u,onLayout:c}=A.current,{layout:d,panelDataArray:h}=D.current,{initialLayout:f}=null!=l?l:{},p=ey(o,e,s),x=function(e,t,r,n,a,s){if($(e)){let t="horizontal"===r,n=0;n=e.shiftKey?100:null!=a?a:10;let s=0;switch(e.key){case"ArrowDown":s=t?0:n;break;case"ArrowLeft":s=t?-n:0;break;case"ArrowRight":s=t?n:0;break;case"ArrowUp":s=t?0:-n;break;case"End":s=100;break;case"Home":s=-100}return s}return null==n?0:function(e,t,r,n,a){let s="horizontal"===r,i=ej(t,a);eh(i,`No resize handle element found for id "${t}"`);let l=i.getAttribute(C);eh(l,"Resize handle element has no group id attribute");let{initialCursorPosition:o}=n,u=eC(r,e),c=ew(l,a);eh(c,`No group element found for id "${l}"`);let d=c.getBoundingClientRect();return(u-o)/(s?d.width:d.height)*100}(e,t,r,n,s)}(r,e,i,l,u,s),g="horizontal"===i;g&&t&&(x=-x);let v=eg({delta:x,initialLayout:null!=f?f:d,panelConstraints:h.map(e=>e.constraints),pivotIndices:p,prevLayout:d,trigger:$(r)?"keyboard":"mouse-or-touch"}),w=!eS(d,v);(T(r)||_(r))&&N.current!=x&&((N.current=x,w||0===x)?et.set(e,0):g?(n=x<0?U:Y,et.set(e,n)):(a=x<0?q:J,et.set(e,a))),w&&(b(v),D.current.layout=v,c&&c(v),eN(h,v,y.current))}},[]),W=(0,i.useCallback)((e,t)=>{let{onLayout:r}=A.current,{layout:n,panelDataArray:a}=D.current,s=a.map(e=>e.constraints),{panelSize:i,pivotIndices:l}=e$(a,e,n);eh(null!=i,`Panel size not found for panel "${e.id}"`);let o=eg({delta:ez(a,e)===a.length-1?i-t:t-i,initialLayout:n,panelConstraints:s,pivotIndices:l,prevLayout:n,trigger:"imperative-api"});eS(n,o)||(b(o),D.current.layout=o,r&&r(o),eN(a,o,y.current))},[]),H=(0,i.useCallback)((e,t)=>{let{layout:r,panelDataArray:n}=D.current,{collapsedSize:a=0,collapsible:s}=t,{collapsedSize:i=0,collapsible:l,maxSize:o=100,minSize:u=0}=e.constraints,{panelSize:c}=e$(n,e,r);null!=c&&(s&&l&&em(c,a)?em(a,i)||W(e,i):c<u?W(e,u):c>o&&W(e,o))},[W]),G=(0,i.useCallback)((e,t)=>{let{direction:r}=A.current,{layout:n}=D.current;if(!m.current)return;let a=ej(e,m.current);eh(a,`Drag handle element not found for id "${e}"`);let s=eC(r,t);x({dragHandleId:e,dragHandleRect:a.getBoundingClientRect(),initialCursorPosition:s,initialLayout:n})},[]),K=(0,i.useCallback)(()=>{x(null)},[]),V=(0,i.useCallback)(e=>{let{panelDataArray:t}=D.current,r=ez(t,e);r>=0&&(t.splice(r,1),delete y.current[e.id],D.current.panelDataArrayChanged=!0,v())},[v]),X=(0,i.useMemo)(()=>({collapsePanel:M,direction:n,dragState:p,expandPanel:P,getPanelSize:R,getPanelStyle:B,groupId:f,isPanelCollapsed:F,isPanelExpanded:L,reevaluatePanelConstraints:H,registerPanel:z,registerResizeHandle:O,resizePanel:W,startDragging:G,stopDragging:K,unregisterPanel:V,panelGroupElement:m.current}),[M,p,n,P,R,B,f,F,L,H,z,O,W,G,K,V]);return(0,i.createElement)(j.Provider,{value:X},(0,i.createElement)(d,{...h,children:t,className:r,id:s,ref:m,style:{display:"flex",flexDirection:"horizontal"===n?"row":"column",height:"100%",overflow:"hidden",width:"100%",...c},"data-panel-group":"",[k]:n,[C]:f}))}let eL=(0,i.forwardRef)((e,t)=>(0,i.createElement)(eF,{...e,forwardedRef:t}));function ez(e,t){return e.findIndex(e=>e===t||e.id===t.id)}function e$(e,t,r){let n=ez(e,t),a=n===e.length-1,s=r[n];return{...t.constraints,panelSize:s,pivotIndices:a?[n-1,n]:[n,n+1]}}function eT({children:e=null,className:t="",disabled:r=!1,hitAreaMargins:n,id:a,onBlur:s,onClick:l,onDragging:o,onFocus:u,onPointerDown:c,onPointerUp:d,style:h={},tabIndex:f=0,tagName:m="div",...p}){var x,g;let b=(0,i.useRef)(null),v=(0,i.useRef)({onClick:l,onDragging:o,onPointerDown:c,onPointerUp:d});(0,i.useEffect)(()=>{v.current.onClick=l,v.current.onDragging=o,v.current.onPointerDown=c,v.current.onPointerUp=d});let y=(0,i.useContext)(j);if(null===y)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");let{direction:w,groupId:A,registerResizeHandle:D,startDragging:M,stopDragging:P,panelGroupElement:R}=y,B=I(a),[F,L]=(0,i.useState)("inactive"),[z,$]=(0,i.useState)(!1),[T,_]=(0,i.useState)(null),O=(0,i.useRef)({state:F});E(()=>{O.current.state=F}),(0,i.useEffect)(()=>{if(r)_(null);else{let e=D(B);_(()=>e)}},[r,B,D]);let W=null!=(x=null==n?void 0:n.coarse)?x:15,H=null!=(g=null==n?void 0:n.fine)?g:5;return(0,i.useEffect)(()=>{if(r||null==T)return;let e=b.current;eh(e,"Element ref not attached");let t=!1;return function(e,t,r,n,a){var s;let{ownerDocument:i}=t,l={direction:r,element:t,hitAreaMargins:n,setResizeHandlerState:a},o=null!=(s=ee.get(i))?s:0;return ee.set(i,o+1),er.add(l),ec(),function(){var t;et.delete(e),er.delete(l);let r=null!=(t=ee.get(i))?t:1;if(ee.set(i,r-1),ec(),1===r&&ee.delete(i),Q.includes(l)){let e=Q.indexOf(l);e>=0&&Q.splice(e,1),eo(),a("up",!0,null)}}}(B,e,w,{coarse:W,fine:H},(e,r,n)=>{if(!r)return void L("inactive");switch(e){case"down":{L("drag"),t=!1,eh(n,'Expected event to be defined for "down" action'),M(B,n);let{onDragging:e,onPointerDown:r}=v.current;null==e||e(!0),null==r||r();break}case"move":{let{state:e}=O.current;t=!0,"drag"!==e&&L("hover"),eh(n,'Expected event to be defined for "move" action'),T(n);break}case"up":{L("hover"),P();let{onClick:e,onDragging:r,onPointerUp:n}=v.current;null==r||r(!1),null==n||n(),t||null==e||e()}}})},[W,w,r,H,D,B,T,M,P]),!function({disabled:e,handleId:t,resizeHandler:r,panelGroupElement:n}){(0,i.useEffect)(()=>{if(e||null==r||null==n)return;let a=ej(t,n);if(null==a)return;let s=e=>{if(!e.defaultPrevented)switch(e.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":e.preventDefault(),r(e);break;case"F6":{e.preventDefault();let r=a.getAttribute(C);eh(r,`No group element found for id "${r}"`);let s=eb(r,n),i=ev(r,t,n);eh(null!==i,`No resize element found for id "${t}"`);let l=e.shiftKey?i>0?i-1:s.length-1:i+1<s.length?i+1:0;s[l].focus()}}};return a.addEventListener("keydown",s),()=>{a.removeEventListener("keydown",s)}},[n,e,t,r])}({disabled:r,handleId:B,resizeHandler:T,panelGroupElement:R}),(0,i.createElement)(m,{...p,children:e,className:t,id:a,onBlur:()=>{$(!1),null==s||s()},onFocus:()=>{$(!0),null==u||u()},ref:b,role:"separator",style:{touchAction:"none",userSelect:"none",...h},tabIndex:f,[k]:w,[C]:A,[N]:"","data-resize-handle-active":"drag"===F?"pointer":z?"keyboard":void 0,"data-panel-resize-handle-enabled":!r,[S]:B,"data-resize-handle-state":F})}eF.displayName="PanelGroup",eL.displayName="forwardRef(PanelGroup)",eT.displayName="PanelResizeHandle",e.s([],607143),e.i(607143),e.i(129893);var e_=e.i(121538),eO=e.i(284060),eW=e.i(357030),eH=e.i(793988),eG=e.i(607243),eK=e.i(378719),eV=e.i(499875);let eU=i.createContext(void 0);function eY(){let e=i.useContext(eU);if(void 0===e)throw Error((0,eV.default)(64));return e}let eq=((r={}).activationDirection="data-activation-direction",r.orientation="data-orientation",r),eJ={tabActivationDirection:e=>({[eq.activationDirection]:e})},eX=i.forwardRef(function(e,t){let{className:r,defaultValue:n=0,onValueChange:a,orientation:l="horizontal",render:o,value:u,...c}=e,d=(0,eK.useDirection)(),h=Object.hasOwn(e,"defaultValue"),f=i.useRef([]),[m,p]=i.useState(()=>new Map),[x,g]=(0,e_.useControlled)({controlled:u,default:n,name:"Tabs",state:"value"}),b=void 0!==u,[v,y]=i.useState(()=>new Map),[w,j]=i.useState("none"),k=(0,eW.useStableCallback)((e,t)=>{a?.(e,t),t.isCanceled||(g(e),j(t.activationDirection))}),C=(0,eW.useStableCallback)((e,t)=>{p(r=>{if(r.get(e)===t)return r;let n=new Map(r);return n.set(e,t),n})}),N=(0,eW.useStableCallback)((e,t)=>{p(r=>{if(!r.has(e)||r.get(e)!==t)return r;let n=new Map(r);return n.delete(e),n})}),S=i.useCallback(e=>m.get(e),[m]),E=i.useCallback(e=>{for(let t of v.values())if(e===t?.value)return t?.id},[v]),A=i.useCallback(e=>{if(void 0===e)return null;for(let[t,r]of v.entries())if(null!=r&&e===(r.value??r.index))return t;return null},[v]),D=i.useMemo(()=>({direction:d,getTabElementBySelectedValue:A,getTabIdByPanelValue:E,getTabPanelIdByValue:S,onValueChange:k,orientation:l,registerMountedTabPanel:C,setTabMap:y,unregisterMountedTabPanel:N,tabActivationDirection:w,value:x}),[d,A,E,S,k,l,C,y,N,w,x]),M=i.useMemo(()=>{for(let e of v.values())if(null!=e&&e.value===x)return e},[v,x]),I=i.useMemo(()=>{for(let e of v.values())if(null!=e&&!e.disabled)return e.value},[v]);(0,eO.useIsoLayoutEffect)(()=>{if(b||0===v.size)return;let e=M?.disabled,t=null==M&&null!==x;if(h&&e&&x===n||!e&&!t)return;let r=I??null;x!==r&&(g(r),j("none"))},[n,I,h,b,M,j,g,v,x]);let P=(0,eH.useRenderElement)("div",e,{state:{orientation:l,tabActivationDirection:w},ref:t,props:c,stateAttributesMapping:eJ});return(0,s.jsx)(eU.Provider,{value:D,children:(0,s.jsx)(eG.CompositeList,{elementsRef:f,children:P})})});var eQ=e.i(924723),eZ=e.i(443667),e0=e.i(136391);let e1="data-composite-item-active";var e2=e.i(246863);let e3=i.createContext(void 0);function e5(){let e=i.useContext(e3);if(void 0===e)throw Error((0,eV.default)(65));return e}var e4=e.i(197167),e8=e.i(394772),e7=e.i(75408);let e6=i.forwardRef(function(e,t){let{className:r,disabled:n=!1,render:a,value:s,id:l,nativeButton:o=!0,...u}=e,{value:c,getTabPanelIdByValue:d,orientation:h}=eY(),{activateOnFocus:f,highlightedTabIndex:m,onTabActivation:p,registerTabResizeObserverElement:x,setHighlightedTabIndex:g,tabsListElement:b}=e5(),v=(0,eZ.useBaseUiId)(l),y=i.useMemo(()=>({disabled:n,id:v,value:s}),[n,v,s]),{compositeProps:w,compositeRef:j,index:k}=(0,e2.useCompositeItem)({metadata:y}),C=s===c,N=i.useRef(!1),S=i.useRef(null);i.useEffect(()=>{let e=S.current;if(e)return x(e)},[x]),(0,eO.useIsoLayoutEffect)(()=>{if(N.current){N.current=!1;return}if(C&&k>-1&&m!==k){if(null!=b){let e=(0,e7.activeElement)((0,eQ.ownerDocument)(b));if(e&&(0,e7.contains)(b,e))return}n||g(k)}},[C,k,m,g,n,b]);let{getButtonProps:E,buttonRef:A}=(0,e0.useButton)({disabled:n,native:o,focusableWhenDisabled:!0}),D=d(s),M=i.useRef(!1),I=i.useRef(!1);return(0,eH.useRenderElement)("button",e,{state:{disabled:n,active:C,orientation:h},ref:[t,A,j,S],props:[w,{role:"tab","aria-controls":D,"aria-selected":C,id:v,onClick:function(e){C||n||p(s,(0,e4.createChangeEventDetails)(e8.REASONS.none,e.nativeEvent,void 0,{activationDirection:"none"}))},onFocus:function(e){C||(k>-1&&!n&&g(k),!n&&f&&(!M.current||M.current&&I.current)&&p(s,(0,e4.createChangeEventDetails)(e8.REASONS.none,e.nativeEvent,void 0,{activationDirection:"none"})))},onPointerDown:function(e){C||n||(M.current=!0,e.button&&0!==e.button||(I.current=!0,(0,eQ.ownerDocument)(e.currentTarget).addEventListener("pointerup",function(){M.current=!1,I.current=!1},{once:!0})))},[e1]:C?"":void 0,onKeyDownCapture(){N.current=!0}},u,E]})});var e9=e.i(292547),te=e.i(137399);let tt=((n={}).activeTabLeft="--active-tab-left",n.activeTabRight="--active-tab-right",n.activeTabTop="--active-tab-top",n.activeTabBottom="--active-tab-bottom",n.activeTabWidth="--active-tab-width",n.activeTabHeight="--active-tab-height",n);var tr=e.i(594683);let tn={...eJ,activeTabPosition:()=>null,activeTabSize:()=>null},ta=i.forwardRef(function(e,t){let{className:r,render:n,renderBeforeHydration:a=!1,...l}=e,{nonce:o}=(0,tr.useCSPContext)(),{getTabElementBySelectedValue:u,orientation:c,tabActivationDirection:d,value:h}=eY(),{tabsListElement:f,registerIndicatorUpdateListener:m}=e5(),[p,x]=i.useState(!1);(0,e9.useOnMount)(()=>x(!0));let g=function(){let[,e]=i.useState({});return i.useCallback(()=>{e({})},[])}();i.useEffect(()=>m(g),[m,g]);let b=0,v=0,y=0,w=0,j=0,k=0,C=!1;if(null!=h&&null!=f){let e=u(h);if(C=!0,null!=e){let{width:t,height:r}=(0,te.getCssDimensions)(e),{width:n,height:a}=(0,te.getCssDimensions)(f),s=e.getBoundingClientRect(),i=f.getBoundingClientRect(),l=n>0?i.width/n:1,o=a>0?i.height/a:1;if(Math.abs(l)>Number.EPSILON&&Math.abs(o)>Number.EPSILON){let e=s.left-i.left,t=s.top-i.top;b=e/l+f.scrollLeft-f.clientLeft,y=t/o+f.scrollTop-f.clientTop}else b=e.offsetLeft,y=e.offsetTop;j=t,k=r,v=f.scrollWidth-b-j,w=f.scrollHeight-y-k}}let N=i.useMemo(()=>C?{left:b,right:v,top:y,bottom:w}:null,[b,v,y,w,C]),S=i.useMemo(()=>C?{width:j,height:k}:null,[j,k,C]),E=i.useMemo(()=>{if(C)return{[tt.activeTabLeft]:`${b}px`,[tt.activeTabRight]:`${v}px`,[tt.activeTabTop]:`${y}px`,[tt.activeTabBottom]:`${w}px`,[tt.activeTabWidth]:`${j}px`,[tt.activeTabHeight]:`${k}px`}},[b,v,y,w,j,k,C]),A=C&&j>0&&k>0,D=(0,eH.useRenderElement)("span",e,{state:{orientation:c,activeTabPosition:N,activeTabSize:S,tabActivationDirection:d},ref:t,props:[{role:"presentation",style:E,hidden:!A},l,{suppressHydrationWarning:!0}],stateAttributesMapping:tn});return null==h?null:(0,s.jsxs)(i.Fragment,{children:[D,!p&&a&&(0,s.jsx)("script",{nonce:o,dangerouslySetInnerHTML:{__html:'!function(){const t=document.currentScript.previousElementSibling;if(!t)return;const e=t.closest(\'[role="tablist"]\');if(!e)return;const i=e.querySelector("[data-active]");if(!i)return;if(0===i.offsetWidth||0===e.offsetWidth)return;let o=0,n=0,h=0,l=0,r=0,f=0;function s(t){const e=getComputedStyle(t);let i=parseFloat(e.width)||0,o=parseFloat(e.height)||0;return(Math.round(i)!==t.offsetWidth||Math.round(o)!==t.offsetHeight)&&(i=t.offsetWidth,o=t.offsetHeight),{width:i,height:o}}if(null!=i&&null!=e){const{width:t,height:c}=s(i),{width:u,height:d}=s(e),a=i.getBoundingClientRect(),g=e.getBoundingClientRect(),p=u>0?g.width/u:1,b=d>0?g.height/d:1;if(Math.abs(p)>Number.EPSILON&&Math.abs(b)>Number.EPSILON){const t=a.left-g.left,i=a.top-g.top;o=t/p+e.scrollLeft-e.clientLeft,h=i/b+e.scrollTop-e.clientTop}else o=i.offsetLeft,h=i.offsetTop;r=t,f=c,n=e.scrollWidth-o-r,l=e.scrollHeight-h-f}function c(e,i){t.style.setProperty(`--active-tab-${e}`,`${i}px`)}c("left",o),c("right",n),c("top",h),c("bottom",l),c("width",r),c("height",f),r>0&&f>0&&t.removeAttribute("hidden")}();'},suppressHydrationWarning:!0})]})});var ts=e.i(614855),ti=e.i(144909),tl=e.i(412360),to=e.i(883993),tu=e.i(135709);let tc=((a={}).index="data-index",a.activationDirection="data-activation-direction",a.orientation="data-orientation",a.hidden="data-hidden",a[a.startingStyle=ti.TransitionStatusDataAttributes.startingStyle]="startingStyle",a[a.endingStyle=ti.TransitionStatusDataAttributes.endingStyle]="endingStyle",a),td={...eJ,...ti.transitionStatusMapping},th=i.forwardRef(function(e,t){let{className:r,value:n,render:a,keepMounted:s=!1,...l}=e,{value:o,getTabIdByPanelValue:u,orientation:c,tabActivationDirection:d,registerMountedTabPanel:h,unregisterMountedTabPanel:f}=eY(),m=(0,eZ.useBaseUiId)(),p=i.useMemo(()=>({id:m,value:n}),[m,n]),{ref:x,index:g}=(0,tu.useCompositeListItem)({metadata:p}),b=n===o,{mounted:v,transitionStatus:y,setMounted:w}=(0,to.useTransitionStatus)(b),j=!v,k=u(n),C=i.useRef(null),N=(0,eH.useRenderElement)("div",e,{state:{hidden:j,orientation:c,tabActivationDirection:d,transitionStatus:y},ref:[t,x,C],props:[{"aria-labelledby":k,hidden:j,id:m,role:"tabpanel",tabIndex:b?0:-1,inert:(0,ts.inertValue)(!b),[tc.index]:g},l],stateAttributesMapping:td});return((0,tl.useOpenChangeComplete)({open:b,ref:C,onComplete(){b||w(!1)}}),(0,eO.useIsoLayoutEffect)(()=>{if((!j||s)&&null!=m)return h(n,m),()=>{f(n,m)}},[j,s,n,m,h,f]),s||v)?N:null});var tf=e.i(156420),tm=e.i(615111),tp=e.i(868239);let tx=[];var tg=e.i(101997),tb=e.i(166508);function tv(e){let{render:t,className:r,refs:n=tb.EMPTY_ARRAY,props:a=tb.EMPTY_ARRAY,state:l=tb.EMPTY_OBJECT,stateAttributesMapping:o,highlightedIndex:u,onHighlightedIndexChange:c,orientation:d,dense:h,itemSizes:f,loopFocus:m,cols:p,enableHomeAndEndKeys:x,onMapChange:g,stopEventPropagation:b=!0,rootRef:v,disabledIndices:y,modifierKeys:w,highlightItemOnHover:j=!1,tag:k="div",...C}=e,{props:N,highlightedIndex:S,onHighlightedIndexChange:E,elementsRef:A,onMapChange:D,relayKeyboardEvent:M}=function(e){let{itemSizes:t,cols:r=1,loopFocus:n=!0,dense:a=!1,orientation:s="both",direction:l,highlightedIndex:o,onHighlightedIndexChange:u,rootRef:c,enableHomeAndEndKeys:d=!1,stopEventPropagation:h=!1,disabledIndices:f,modifierKeys:m=tx}=e,[p,x]=i.useState(0),g=r>1,b=i.useRef(null),v=(0,tf.useMergedRefs)(b,c),y=i.useRef([]),w=i.useRef(!1),j=o??p,k=(0,eW.useStableCallback)((e,t=!1)=>{if((u??x)(e),t){let t=y.current[e];(0,tm.scrollIntoViewIfNeeded)(b.current,t,l,s)}}),C=(0,eW.useStableCallback)(e=>{if(0===e.size||w.current)return;w.current=!0;let t=Array.from(e.keys()),r=t.find(e=>e?.hasAttribute(e1))??null,n=r?t.indexOf(r):-1;-1!==n&&k(n),(0,tm.scrollIntoViewIfNeeded)(b.current,r,l,s)}),N=i.useMemo(()=>({"aria-orientation":"both"===s?void 0:s,ref:v,onFocus(e){b.current&&(0,tm.isNativeInput)(e.target)&&e.target.setSelectionRange(0,e.target.value.length??0)},onKeyDown(e){var i;let o=d?tm.ALL_KEYS:tm.ARROW_KEYS;if(!o.has(e.key)||function(e,t){for(let r of tm.MODIFIER_KEYS.values())if(!t.includes(r)&&e.getModifierState(r))return!0;return!1}(e,m)||!b.current)return;let u="rtl"===l,c=u?tm.ARROW_LEFT:tm.ARROW_RIGHT,p={horizontal:c,vertical:tm.ARROW_DOWN,both:c}[s],x=u?tm.ARROW_RIGHT:tm.ARROW_LEFT,v={horizontal:x,vertical:tm.ARROW_UP,both:x}[s];if((0,tm.isNativeInput)(e.target)&&!(null==(i=e.target)||i.hasAttribute("disabled")||"true"===i.getAttribute("aria-disabled"))){let t=e.target.selectionStart,r=e.target.selectionEnd,n=e.target.value??"";if(null==t||e.shiftKey||t!==r||e.key!==v&&t<n.length||e.key!==p&&t>0)return}let w=j,C=(0,tp.getMinListIndex)(y,f),N=(0,tp.getMaxListIndex)(y,f);if(g){let i=t||Array.from({length:y.current.length},()=>({width:1,height:1})),l=(0,tp.createGridCellMap)(i,r,a),o=l.findIndex(e=>null!=e&&!(0,tp.isListIndexDisabled)(y,e,f)),c=l.reduce((e,t,r)=>null==t||(0,tp.isListIndexDisabled)(y,t,f)?e:r,-1);w=l[(0,tp.getGridNavigatedIndex)({current:l.map(e=>e?y.current[e]:null)},{event:e,orientation:s,loopFocus:n,cols:r,disabledIndices:(0,tp.getGridCellIndices)([...f||y.current.map((e,t)=>(0,tp.isListIndexDisabled)(y,t)?t:void 0),void 0],l),minIndex:o,maxIndex:c,prevIndex:(0,tp.getGridCellIndexOfCorner)(j>N?C:j,i,l,r,e.key===tm.ARROW_DOWN?"bl":e.key===tm.ARROW_RIGHT?"tr":"tl"),rtl:u})]}let S={horizontal:[c],vertical:[tm.ARROW_DOWN],both:[c,tm.ARROW_DOWN]}[s],E={horizontal:[x],vertical:[tm.ARROW_UP],both:[x,tm.ARROW_UP]}[s],A=g?o:({horizontal:d?tm.HORIZONTAL_KEYS_WITH_EXTRA_KEYS:tm.HORIZONTAL_KEYS,vertical:d?tm.VERTICAL_KEYS_WITH_EXTRA_KEYS:tm.VERTICAL_KEYS,both:o})[s];d&&(e.key===tm.HOME?w=C:e.key===tm.END&&(w=N)),w===j&&(S.includes(e.key)||E.includes(e.key))&&(w=n&&w===N&&S.includes(e.key)?C:n&&w===C&&E.includes(e.key)?N:(0,tp.findNonDisabledListIndex)(y,{startingIndex:w,decrement:E.includes(e.key),disabledIndices:f})),w===j||(0,tp.isIndexOutOfListBounds)(y,w)||(h&&e.stopPropagation(),A.has(e.key)&&e.preventDefault(),k(w,!0),queueMicrotask(()=>{y.current[w]?.focus()}))}}),[r,a,l,f,y,d,j,g,t,n,v,m,k,s,h]);return i.useMemo(()=>({props:N,highlightedIndex:j,onHighlightedIndexChange:k,elementsRef:y,disabledIndices:f,onMapChange:C,relayKeyboardEvent:N.onKeyDown}),[N,j,k,y,f,C])}({itemSizes:f,cols:p,loopFocus:m,dense:h,orientation:d,highlightedIndex:u,onHighlightedIndexChange:c,rootRef:v,stopEventPropagation:b,enableHomeAndEndKeys:x,direction:(0,eK.useDirection)(),disabledIndices:y,modifierKeys:w}),I=(0,eH.useRenderElement)(k,e,{state:l,ref:n,props:[N,...a,C],stateAttributesMapping:o}),P=i.useMemo(()=>({highlightedIndex:S,onHighlightedIndexChange:E,highlightItemOnHover:j,relayKeyboardEvent:M}),[S,E,j,M]);return(0,s.jsx)(tg.CompositeRootContext.Provider,{value:P,children:(0,s.jsx)(eG.CompositeList,{elementsRef:A,onMapChange:e=>{g?.(e),D(e)},children:I})})}let ty=i.forwardRef(function(e,t){let{activateOnFocus:r=!1,className:n,loopFocus:a=!0,render:l,...o}=e,{getTabElementBySelectedValue:u,onValueChange:c,orientation:d,value:h,setTabMap:f,tabActivationDirection:m}=eY(),[p,x]=i.useState(0),[g,b]=i.useState(null),v=i.useRef(new Set),y=i.useRef(new Set),w=i.useRef(null),j=(0,eW.useStableCallback)(()=>{v.current.forEach(e=>{e()})});i.useEffect(()=>{if("u"<typeof ResizeObserver)return;let e=new ResizeObserver(()=>{v.current.size&&j()});return w.current=e,g&&e.observe(g),y.current.forEach(t=>{e.observe(t)}),()=>{e.disconnect(),w.current=null}},[g,j]);let k=(0,eW.useStableCallback)(e=>(v.current.add(e),()=>{v.current.delete(e)})),C=(0,eW.useStableCallback)(e=>(y.current.add(e),w.current?.observe(e),()=>{y.current.delete(e),w.current?.unobserve(e)})),N=function(e,t,r,n){let[a,s]=i.useState(null);return(0,eO.useIsoLayoutEffect)(()=>{if(null==e||null==r)return void s(null);let a=n(e);if(null==a)return void s(null);let{left:i,top:l}=tw(a,r);s("horizontal"===t?i:l)},[t,n,r,e]),i.useCallback(i=>{if(i===e)return"none";if(null==i)return s(null),"none";if(null!=i&&null!=r){let e=n(i);if(null!=e){let{left:n,top:i}=tw(e,r);if(null==a)return s("horizontal"===t?n:i),"none";if("horizontal"===t){if(n<a)return s(n),"left";if(n>a)return s(n),"right"}else if(i<a)return s(i),"up";else if(i>a)return s(i),"down"}}return"none"},[n,t,a,r,e])}(h,d,g,u),S=(0,eW.useStableCallback)((e,t)=>{e!==h&&(t.activationDirection=N(e),c(e,t))}),E=i.useMemo(()=>({activateOnFocus:r,highlightedTabIndex:p,registerIndicatorUpdateListener:k,registerTabResizeObserverElement:C,onTabActivation:S,setHighlightedTabIndex:x,tabsListElement:g}),[r,p,k,C,S,x,g]);return(0,s.jsx)(e3.Provider,{value:E,children:(0,s.jsx)(tv,{render:l,className:n,state:{orientation:d,tabActivationDirection:m},refs:[t,b],props:[{"aria-orientation":"vertical"===d?"vertical":void 0,role:"tablist"},o],stateAttributesMapping:eJ,highlightedIndex:p,enableHomeAndEndKeys:!0,loopFocus:a,orientation:d,onHighlightedIndexChange:x,onMapChange:f,disabledIndices:tb.EMPTY_ARRAY})})});function tw(e,t){let{left:r,top:n}=e.getBoundingClientRect(),{left:a,top:s}=t.getBoundingClientRect();return{left:r-a,top:n-s}}e.s(["Indicator",0,ta,"List",0,ty,"Panel",0,th,"Root",0,eX,"Tab",0,e6],370404);var tj=e.i(370404),tj=tj,tk=e.i(164688),tC=e.i(937756);function tN({className:e,orientation:t="horizontal",...r}){return(0,s.jsx)(tj.Root,{"data-slot":"tabs","data-orientation":t,className:(0,tC.cn)("group/tabs flex gap-2 data-horizontal:flex-col",e),...r})}let tS=(0,tk.cva)("group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-horizontal/tabs:h-8 group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col data-[variant=line]:rounded-none",{variants:{variant:{default:"bg-muted",line:"gap-1 bg-transparent"}},defaultVariants:{variant:"default"}});function tE({className:e,variant:t="default",...r}){return(0,s.jsx)(tj.List,{"data-slot":"tabs-list","data-variant":t,className:(0,tC.cn)(tS({variant:t}),e),...r})}function tA({className:e,...t}){return(0,s.jsx)(tj.Tab,{"data-slot":"tabs-trigger",className:(0,tC.cn)("relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 dark:text-muted-foreground dark:hover:text-foreground group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4","group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent","data-active:bg-background data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 dark:data-active:text-foreground","after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100",e),...t})}function tD({className:e,...t}){return(0,s.jsx)(tj.Panel,{"data-slot":"tabs-content",className:(0,tC.cn)("flex-1 text-sm outline-none",e),...t})}var tM=e.i(477795),tI=e.i(486305),tP=e.i(894296),tR=e.i(815681),tB=e.i(996032);let tF=(0,d.default)("file",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]]);function tL(e){return Array.isArray?Array.isArray(e):"[object Array]"===tH(e)}function tz(e){return null==e?"":function(e){if("string"==typeof e)return e;if("bigint"==typeof e)return e.toString();let t=e+"";return"0"==t&&1/e==-1/0?"-0":t}(e)}function t$(e){return"string"==typeof e}function tT(e){return"number"==typeof e}function t_(e){return"object"==typeof e}function tO(e){return null!=e}function tW(e){return!e.trim().length}function tH(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}let tG=Object.prototype.hasOwnProperty;class tK{constructor(e){this._keys=[],this._keyMap={};let t=0;e.forEach(e=>{let r=tV(e);this._keys.push(r),this._keyMap[r.id]=r,t+=r.weight}),this._keys.forEach(e=>{e.weight/=t})}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function tV(e){let t=null,r=null,n=null,a=1,s=null;if(t$(e)||tL(e))n=e,t=tU(e),r=tY(e);else{if(!tG.call(e,"name"))throw Error("Missing name property in key");let i=e.name;if(n=i,tG.call(e,"weight")&&(a=e.weight)<=0)throw Error(`Property 'weight' in key '${i}' must be a positive integer`);t=tU(i),r=tY(i),s=e.getFn}return{path:t,id:r,weight:a,src:n,getFn:s}}function tU(e){return tL(e)?e:e.split(".")}function tY(e){return tL(e)?e.join("."):e}let tq=Object.freeze({isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(e,t)=>e.score===t.score?e.idx<t.idx?-1:1:e.score<t.score?-1:1,includeMatches:!1,findAllMatches:!1,minMatchCharLength:1,location:0,threshold:.6,distance:100,useExtendedSearch:!1,useTokenSearch:!1,getFn:function(e,t){let r=[],n=!1,a=(e,t,s,i)=>{if(tO(e))if(t[s]){var l,o;let u=e[t[s]];if(!tO(u))return;if(s===t.length-1&&(t$(u)||tT(u)||!0===(l=u)||!1===l||t_(o=l)&&null!==o&&"[object Boolean]"==tH(l)||"bigint"==typeof u))r.push(void 0!==i?{v:tz(u),i:i}:tz(u));else if(tL(u)){n=!0;for(let e=0,r=u.length;e<r;e+=1)a(u[e],t,s+1,e)}else t.length&&a(u,t,s+1,i)}else r.push(void 0!==i?{v:e,i:i}:e)};return a(e,t$(t)?t.split("."):t,0),n?r:r[0]},ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1}),tJ=/[^ ]+/g;class tX{constructor({getFn:e=tq.getFn,fieldNormWeight:t=tq.fieldNormWeight}={}){this.norm=function(e=1,t=3){let r=new Map,n=Math.pow(10,t);return{get(t){let a=t.match(tJ).length;if(r.has(a))return r.get(a);let s=parseFloat(Math.round(1/Math.pow(a,.5*e)*n)/n);return r.set(a,s),s},clear(){r.clear()}}}(t,3),this.getFn=e,this.isCreated=!1,this.docs=[],this.keys=[],this._keysMap={},this.setIndexRecords()}setSources(e=[]){this.docs=e}setIndexRecords(e=[]){this.records=e}setKeys(e=[]){this.keys=e,this._keysMap={},e.forEach((e,t)=>{this._keysMap[e.id]=t})}create(){!this.isCreated&&this.docs.length&&(this.isCreated=!0,t$(this.docs[0])?this.docs.forEach((e,t)=>{this._addString(e,t)}):this.docs.forEach((e,t)=>{this._addObject(e,t)}),this.norm.clear())}add(e){let t=this.size();t$(e)?this._addString(e,t):this._addObject(e,t)}removeAt(e){this.records.splice(e,1);for(let t=e,r=this.size();t<r;t+=1)this.records[t].i-=1}removeAll(e){for(let t=e.length-1;t>=0;t-=1)this.records.splice(e[t],1);for(let e=0,t=this.records.length;e<t;e+=1)this.records[e].i=e}getValueForItemAtKeyId(e,t){return e[this._keysMap[t]]}size(){return this.records.length}_addString(e,t){if(!tO(e)||tW(e))return;let r={v:e,i:t,n:this.norm.get(e)};this.records.push(r)}_addObject(e,t){let r={i:t,$:{}};this.keys.forEach((t,n)=>{let a=t.getFn?t.getFn(e):this.getFn(e,t.path);if(tO(a)){if(tL(a)){let e=[];for(let t=0,r=a.length;t<r;t+=1){let r=a[t];if(tO(r)){if(t$(r)){if(!tW(r)){let n={v:r,i:t,n:this.norm.get(r)};e.push(n)}}else if(tO(r.v)){let t=t$(r.v)?r.v:tz(r.v);if(!tW(t)){let n={v:t,i:r.i,n:this.norm.get(t)};e.push(n)}}}}r.$[n]=e}else if(t$(a)&&!tW(a)){let e={v:a,n:this.norm.get(a)};r.$[n]=e}}}),this.records.push(r)}toJSON(){return{keys:this.keys.map(({getFn:e,...t})=>t),records:this.records}}}function tQ(e,t,{getFn:r=tq.getFn,fieldNormWeight:n=tq.fieldNormWeight}={}){let a=new tX({getFn:r,fieldNormWeight:n});return a.setKeys(e.map(tV)),a.setSources(t),a.create(),a}function tZ(e){if(e.length<=1)return e;e.sort((e,t)=>e[0]-t[0]||e[1]-t[1]);let t=[e[0]];for(let r=1,n=e.length;r<n;r+=1){let n=t[t.length-1],a=e[r];a[0]<=n[1]+1?n[1]=Math.max(n[1],a[1]):t.push(a)}return t}let t0={ł:"l",Ł:"L",đ:"d",Đ:"D",ø:"o",Ø:"O",ħ:"h",Ħ:"H",ŧ:"t",Ŧ:"T",ı:"i",ß:"ss"},t1=RegExp("["+Object.keys(t0).join("")+"]","g"),t2=String.prototype.normalize?e=>e.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,"").replace(t1,e=>t0[e]):e=>e;class t3{constructor(e,{location:t=tq.location,threshold:r=tq.threshold,distance:n=tq.distance,includeMatches:a=tq.includeMatches,findAllMatches:s=tq.findAllMatches,minMatchCharLength:i=tq.minMatchCharLength,isCaseSensitive:l=tq.isCaseSensitive,ignoreDiacritics:o=tq.ignoreDiacritics,ignoreLocation:u=tq.ignoreLocation}={}){if(this.options={location:t,threshold:r,distance:n,includeMatches:a,findAllMatches:s,minMatchCharLength:i,isCaseSensitive:l,ignoreDiacritics:o,ignoreLocation:u},e=l?e:e.toLowerCase(),e=o?t2(e):e,this.pattern=e,this.chunks=[],!this.pattern.length)return;const c=(e,t)=>{this.chunks.push({pattern:e,alphabet:function(e){let t={};for(let r=0,n=e.length;r<n;r+=1){let a=e.charAt(r);t[a]=(t[a]||0)|1<<n-r-1}return t}(e),startIndex:t})},d=this.pattern.length;if(d>32){let e=0;const t=d%32,r=d-t;for(;e<r;)c(this.pattern.substr(e,32),e),e+=32;if(t){const e=d-32;c(this.pattern.substr(e),e)}}else c(this.pattern,0)}searchIn(e){let{isCaseSensitive:t,ignoreDiacritics:r,includeMatches:n}=this.options;if(e=t?e:e.toLowerCase(),e=r?t2(e):e,this.pattern===e){let t={isMatch:!0,score:0};return n&&(t.indices=[[0,e.length-1]]),t}let{location:a,distance:s,threshold:i,findAllMatches:l,minMatchCharLength:o,ignoreLocation:u}=this.options,c=[],d=0,h=!1;this.chunks.forEach(({pattern:t,alphabet:r,startIndex:f})=>{let{isMatch:m,score:p,indices:x}=function(e,t,r,{location:n=tq.location,distance:a=tq.distance,threshold:s=tq.threshold,findAllMatches:i=tq.findAllMatches,minMatchCharLength:l=tq.minMatchCharLength,includeMatches:o=tq.includeMatches,ignoreLocation:u=tq.ignoreLocation}={}){let c;if(t.length>32)throw Error("Pattern length exceeds max of 32.");let d=t.length,h=e.length,f=Math.max(0,Math.min(n,h)),m=s,p=f,x=(e,t)=>{let r=e/d;if(u)return r;let n=Math.abs(f-t);return a?r+n/a:n?1:r},g=l>1||o,b=g?Array(h):[];for(;(c=e.indexOf(t,p))>-1;)if(m=Math.min(x(0,c),m),p=c+d,g){let e=0;for(;e<d;)b[c+e]=1,e+=1}p=-1;let v=[],y=1,w=d+h,j=1<<d-1;for(let t=0;t<d;t+=1){let n=0,a=w;for(;n<a;)x(t,f+a)<=m?n=a:w=a,a=Math.floor((w-n)/2+n);w=a;let s=Math.max(1,f-a+1),l=i?h:Math.min(f+a,h)+d,o=Array(l+2);o[l+1]=(1<<t)-1;for(let n=l;n>=s;n-=1){let a=n-1,i=r[e[a]];if(g&&(b[a]=+!!i),o[n]=(o[n+1]<<1|1)&i,t&&(o[n]|=(v[n+1]|v[n])<<1|1|v[n+1]),o[n]&j&&(y=x(t,a))<=m){if(m=y,(p=a)<=f)break;s=Math.max(1,2*f-p)}}if(x(t+1,f)>m)break;v=o}let k={isMatch:p>=0,score:Math.max(.001,y)};if(g){let e=function(e=[],t=tq.minMatchCharLength){let r=[],n=-1,a=-1,s=0;for(let i=e.length;s<i;s+=1){let i=e[s];i&&-1===n?n=s:i||-1===n||((a=s-1)-n+1>=t&&r.push([n,a]),n=-1)}return e[s-1]&&s-n>=t&&r.push([n,s-1]),r}(b,l);e.length?o&&(k.indices=e):k.isMatch=!1}return k}(e,t,r,{location:a+f,distance:s,threshold:i,findAllMatches:l,minMatchCharLength:o,includeMatches:n,ignoreLocation:u});m&&(h=!0),d+=p,m&&x&&c.push(...x)});let f={isMatch:h,score:h?d/this.chunks.length:1};return h&&n&&(f.indices=tZ(c)),f}}class t5{constructor(e){this.pattern=e}static isMultiMatch(e){return t4(e,this.multiRegex)}static isSingleMatch(e){return t4(e,this.singleRegex)}search(e){return{isMatch:!1,score:1}}}function t4(e,t){let r=e.match(t);return r?r[1]:null}class t8 extends t5{constructor(e,{location:t=tq.location,threshold:r=tq.threshold,distance:n=tq.distance,includeMatches:a=tq.includeMatches,findAllMatches:s=tq.findAllMatches,minMatchCharLength:i=tq.minMatchCharLength,isCaseSensitive:l=tq.isCaseSensitive,ignoreDiacritics:o=tq.ignoreDiacritics,ignoreLocation:u=tq.ignoreLocation}={}){super(e),this._bitapSearch=new t3(e,{location:t,threshold:r,distance:n,includeMatches:a,findAllMatches:s,minMatchCharLength:i,isCaseSensitive:l,ignoreDiacritics:o,ignoreLocation:u})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(e){return this._bitapSearch.searchIn(e)}}class t7 extends t5{constructor(e){super(e)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(e){let t,r=0,n=[],a=this.pattern.length;for(;(t=e.indexOf(this.pattern,r))>-1;)r=t+a,n.push([t,r-1]);let s=!!n.length;return{isMatch:s,score:+!s,indices:n}}}let t6=[class extends t5{constructor(e){super(e)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(e){let t=e===this.pattern;return{isMatch:t,score:+!t,indices:[0,this.pattern.length-1]}}},t7,class extends t5{constructor(e){super(e)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(e){let t=e.startsWith(this.pattern);return{isMatch:t,score:+!t,indices:[0,this.pattern.length-1]}}},class extends t5{constructor(e){super(e)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(e){let t=!e.startsWith(this.pattern);return{isMatch:t,score:+!t,indices:[0,e.length-1]}}},class extends t5{constructor(e){super(e)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(e){let t=!e.endsWith(this.pattern);return{isMatch:t,score:+!t,indices:[0,e.length-1]}}},class extends t5{constructor(e){super(e)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(e){let t=e.endsWith(this.pattern);return{isMatch:t,score:+!t,indices:[e.length-this.pattern.length,e.length-1]}}},class extends t5{constructor(e){super(e)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(e){let t=-1===e.indexOf(this.pattern);return{isMatch:t,score:+!t,indices:[0,e.length-1]}}},t8],t9=t6.length,re=new Set([t8.type,t7.type]),rt=[];function rr(...e){rt.push(...e)}function rn(e,t){for(let r=0,n=rt.length;r<n;r+=1){let n=rt[r];if(n.condition(e,t))return new n(e,t)}return new t3(e,t)}let ra="$and",rs="$path",ri=e=>!!(e[ra]||e.$or),rl=e=>({[ra]:Object.keys(e).map(t=>({[t]:e[t]}))});function ro(e,t,{auto:r=!0}={}){let n=e=>{if(t$(e)){let n={keyId:null,pattern:e};return r&&(n.searcher=rn(e,t)),n}let a=Object.keys(e),s=!!e[rs];if(!s&&a.length>1&&!ri(e))return n(rl(e));if(!tL(e)&&t_(e)&&!ri(e)){let n=s?e[rs]:a[0],i=s?e.$val:e[n];if(!t$(i))throw Error(`Invalid value for key ${n}`);let l={keyId:tY(n),pattern:i};return r&&(l.searcher=rn(i,t)),l}let i={children:[],operator:a[0]};return a.forEach(t=>{let r=e[t];tL(r)&&r.forEach(e=>{i.children.push(n(e))})}),i};return ri(e)||(e=rl(e)),n(e)}function ru(e,{ignoreFieldNorm:t=tq.ignoreFieldNorm}){let r=1;return e.forEach(({key:e,norm:n,score:a})=>{let s=e?e.weight:null;r*=Math.pow(0===a&&s?Number.EPSILON:a,(s||1)*(t?1:n))}),r}class rc{constructor(e){this.limit=e,this.heap=[]}get size(){return this.heap.length}shouldInsert(e){return this.size<this.limit||e<this.heap[0].score}insert(e){this.size<this.limit?(this.heap.push(e),this._bubbleUp(this.size-1)):e.score<this.heap[0].score&&(this.heap[0]=e,this._sinkDown(0))}extractSorted(e){return this.heap.sort(e)}_bubbleUp(e){let t=this.heap;for(;e>0;){let r=e-1>>1;if(t[e].score<=t[r].score)break;let n=t[e];t[e]=t[r],t[r]=n,e=r}}_sinkDown(e){let t=this.heap,r=t.length,n=e;do{let a=2*(e=n)+1,s=2*e+2;if(a<r&&t[a].score>t[n].score&&(n=a),s<r&&t[s].score>t[n].score&&(n=s),n!==e){let r=t[e];t[e]=t[n],t[n]=r}}while(n!==e)}}function rd(e,t){let r=e.matches;t.matches=[],tO(r)&&r.forEach(e=>{if(!tO(e.indices)||!e.indices.length)return;let{indices:r,value:n}=e,a={indices:r,value:n};e.key&&(a.key=e.key.src),e.idx>-1&&(a.refIndex=e.idx),t.matches.push(a)})}function rh(e,t){t.score=e.score}let rf=/\b\w+\b/g;function rm({isCaseSensitive:e=!1,ignoreDiacritics:t=!1}={}){return{tokenize:r=>(e||(r=r.toLowerCase()),t&&(r=t2(r)),r.match(rf)||[])}}function rp(e,t){for(let[r,n]of e.terms){let a=n.filter(e=>e.docIdx!==t),s=n.length-a.length;s>0&&(e.fieldCount-=s,e.df.set(r,(e.df.get(r)||0)-s),0===a.length?(e.terms.delete(r),e.df.delete(r)):e.terms.set(r,a))}}class rx{constructor(e,t,r){this.options={...tq,...t},this.options.useExtendedSearch,this.options.useTokenSearch,this._keyStore=new tK(this.options.keys),this._docs=e,this._myIndex=null,this._invertedIndex=null,this.setCollection(e,r),this._lastQuery=null,this._lastSearcher=null}_getSearcher(e){if(this._lastQuery===e)return this._lastSearcher;let t=rn(e,this._invertedIndex?{...this.options,_invertedIndex:this._invertedIndex}:this.options);return this._lastQuery=e,this._lastSearcher=t,t}setCollection(e,t){if(this._docs=e,t&&!(t instanceof tX))throw Error("Incorrect 'index' type");if(this._myIndex=t||tQ(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight}),this.options.useTokenSearch){let e=rm({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics});this._invertedIndex=function(e,t,r){let n=new Map,a=new Map,s=0;function i(e,t,i,l){let o=r.tokenize(e);if(!o.length)return;s++;let u=new Map;for(let e of o)u.set(e,(u.get(e)||0)+1);for(let[e,r]of u){let s={docIdx:t,keyIdx:i,subIdx:l,tf:r},o=n.get(e);o||(o=[],n.set(e,o)),o.push(s),a.set(e,(a.get(e)||0)+1)}}for(let r of e){let{i:e,v:n,$:a}=r;if(void 0!==n){i(n,e,-1,-1);continue}if(a)for(let r=0;r<t;r++){let t=a[r];if(t)if(Array.isArray(t))for(let n of t)i(n.v,e,r,n.i??-1);else i(t.v,e,r,-1)}}return{terms:n,fieldCount:s,df:a}}(this._myIndex.records,this._myIndex.keys.length,e)}}add(e){if(tO(e)&&(this._docs.push(e),this._myIndex.add(e),this._invertedIndex)){let e=this._myIndex.records[this._myIndex.records.length-1],t=rm({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics});!function(e,t,r,n){let{i:a,v:s,$:i}=t;function l(t,r,s){let i=n.tokenize(t);if(!i.length)return;e.fieldCount++;let l=new Map;for(let e of i)l.set(e,(l.get(e)||0)+1);for(let[t,n]of l){let i={docIdx:a,keyIdx:r,subIdx:s,tf:n},l=e.terms.get(t);l||(l=[],e.terms.set(t,l)),l.push(i),e.df.set(t,(e.df.get(t)||0)+1)}}if(void 0!==s)return l(s,-1,-1);if(i)for(let e=0;e<r;e++){let t=i[e];if(t)if(Array.isArray(t))for(let r of t)l(r.v,e,r.i??-1);else l(t.v,e,-1)}}(this._invertedIndex,e,this._myIndex.keys.length,t)}}remove(e=()=>!1){let t=[],r=[];for(let n=0,a=this._docs.length;n<a;n+=1)e(this._docs[n],n)&&(t.push(this._docs[n]),r.push(n));if(r.length){if(this._invertedIndex)for(let e of r)rp(this._invertedIndex,e);for(let e=r.length-1;e>=0;e-=1)this._docs.splice(r[e],1);this._myIndex.removeAll(r)}return t}removeAt(e){this._invertedIndex&&rp(this._invertedIndex,e);let t=this._docs.splice(e,1)[0];return this._myIndex.removeAt(e),t}getIndex(){return this._myIndex}search(e,t){let r,{limit:n=-1}=t||{},{includeMatches:a,includeScore:s,shouldSort:i,sortFn:l,ignoreFieldNorm:o}=this.options;if(t$(e)&&!e.trim()){let e=this._docs.map((e,t)=>({item:e,refIndex:t}));return tT(n)&&n>-1&&(e=e.slice(0,n)),e}if(tT(n)&&n>0&&t$(e)){let t=new rc(n);t$(this._docs[0])?this._searchStringList(e,{heap:t,ignoreFieldNorm:o}):this._searchObjectList(e,{heap:t,ignoreFieldNorm:o}),r=t.extractSorted(l)}else!function(e,{ignoreFieldNorm:t=tq.ignoreFieldNorm}){e.forEach(e=>{e.score=ru(e.matches,{ignoreFieldNorm:t})})}(r=t$(e)?t$(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e),{ignoreFieldNorm:o}),i&&r.sort(l),tT(n)&&n>-1&&(r=r.slice(0,n));return function(e,t,{includeMatches:r=tq.includeMatches,includeScore:n=tq.includeScore}={}){let a=[];return r&&a.push(rd),n&&a.push(rh),e.map(e=>{let{idx:r}=e,n={item:t[r],refIndex:r};return a.length&&a.forEach(t=>{t(e,n)}),n})}(r,this._docs,{includeMatches:a,includeScore:s})}_searchStringList(e,{heap:t,ignoreFieldNorm:r}={}){let n=this._getSearcher(e),{records:a}=this._myIndex,s=t?null:[];return a.forEach(({v:e,i:a,n:i})=>{if(!tO(e))return;let{isMatch:l,score:o,indices:u}=n.searchIn(e);if(l){let n={item:e,idx:a,matches:[{score:o,value:e,norm:i,indices:u}]};t?(n.score=ru(n.matches,{ignoreFieldNorm:r}),t.shouldInsert(n.score)&&t.insert(n)):s.push(n)}}),s}_searchLogical(e){let t=ro(e,this.options),r=(e,t,n)=>{if(!("children"in e)){let r,{keyId:a,searcher:s}=e;return(null===a?(r=[],this._myIndex.keys.forEach((e,n)=>{r.push(...this._findMatches({key:e,value:t[n],searcher:s}))})):r=this._findMatches({key:this._keyStore.get(a),value:this._myIndex.getValueForItemAtKeyId(t,a),searcher:s}),r&&r.length)?[{idx:n,item:t,matches:r}]:[]}let{children:a,operator:s}=e,i=[];for(let e=0,l=a.length;e<l;e+=1){let l=r(a[e],t,n);if(l.length)i.push(...l);else if(s===ra)return[]}return i},n=this._myIndex.records,a=new Map,s=[];return n.forEach(({$:e,i:n})=>{if(tO(e)){let i=r(t,e,n);i.length&&(a.has(n)||(a.set(n,{idx:n,item:e,matches:[]}),s.push(a.get(n))),i.forEach(({matches:e})=>{a.get(n).matches.push(...e)}))}}),s}_searchObjectList(e,{heap:t,ignoreFieldNorm:r}={}){let n=this._getSearcher(e),{keys:a,records:s}=this._myIndex,i=t?null:[];return s.forEach(({$:e,i:s})=>{if(!tO(e))return;let l=[],o=!1,u=!1;if(a.forEach((t,r)=>{let a=this._findMatches({key:t,value:e[r],searcher:n});a.length?(l.push(...a),a[0].hasInverse&&(u=!0)):o=!0}),(!u||!o)&&l.length){let n={idx:s,item:e,matches:l};t?(n.score=ru(n.matches,{ignoreFieldNorm:r}),t.shouldInsert(n.score)&&t.insert(n)):i.push(n)}}),i}_findMatches({key:e,value:t,searcher:r}){if(!tO(t))return[];let n=[];if(tL(t))t.forEach(({v:t,i:a,n:s})=>{if(!tO(t))return;let{isMatch:i,score:l,indices:o,hasInverse:u}=r.searchIn(t);i&&n.push({score:l,key:e,value:t,idx:a,norm:s,indices:o,hasInverse:u})});else{let{v:a,n:s}=t,{isMatch:i,score:l,indices:o,hasInverse:u}=r.searchIn(a);i&&n.push({score:l,key:e,value:a,norm:s,indices:o,hasInverse:u})}return n}}rx.version="7.3.0",rx.createIndex=tQ,rx.parseIndex=function(e,{getFn:t=tq.getFn,fieldNormWeight:r=tq.fieldNormWeight}={}){let{keys:n,records:a}=e,s=new tX({getFn:t,fieldNormWeight:r});return s.setKeys(n),s.setIndexRecords(a),s},rx.config=tq,rx.match=function(e,t,r){return rn(e,{...tq,...r}).searchIn(t)},rx.parseQuery=ro,rr(class{constructor(e,{isCaseSensitive:t=tq.isCaseSensitive,ignoreDiacritics:r=tq.ignoreDiacritics,includeMatches:n=tq.includeMatches,minMatchCharLength:a=tq.minMatchCharLength,ignoreLocation:s=tq.ignoreLocation,findAllMatches:i=tq.findAllMatches,location:l=tq.location,threshold:o=tq.threshold,distance:u=tq.distance}={}){this.query=null,this.options={isCaseSensitive:t,ignoreDiacritics:r,includeMatches:n,minMatchCharLength:a,findAllMatches:i,ignoreLocation:s,location:l,threshold:o,distance:u},e=t?e:e.toLowerCase(),e=r?t2(e):e,this.pattern=e,this.query=function(e,t={}){return e.replace(/\\\|/g,"\0").split("|").map(e=>{let r=(function(e){let t=[],r=e.length,n=0;for(;n<r;){for(;n<r&&" "===e[n];)n++;if(n>=r)break;let a=n;for(;a<r&&" "!==e[a]&&'"'!==e[a];)a++;if(a<r&&'"'===e[a]){for(a++;a<r;){if('"'===e[a]){let t=a+1;if(t>=r||" "===e[t]){a++;break}if("$"===e[t]&&(t+1>=r||" "===e[t+1])){a+=2;break}}a++}t.push(e.substring(n,a)),n=a}else{for(;a<r&&" "!==e[a];)a++;t.push(e.substring(n,a)),n=a}}return t})(e.replace(/\u0000/g,"|").trim()).filter(e=>e&&!!e.trim()),n=[];for(let e=0,a=r.length;e<a;e+=1){let a=r[e],s=!1,i=-1;for(;!s&&++i<t9;){let e=t6[i],r=e.isMultiMatch(a);r&&(n.push(new e(r,t)),s=!0)}if(!s)for(i=-1;++i<t9;){let e=t6[i],r=e.isSingleMatch(a);if(r){n.push(new e(r,t));break}}}return n})}(this.pattern,this.options)}static condition(e,t){return t.useExtendedSearch}searchIn(e){let t=this.query;if(!t)return{isMatch:!1,score:1};let{includeMatches:r,isCaseSensitive:n,ignoreDiacritics:a}=this.options;e=n?e:e.toLowerCase(),e=a?t2(e):e;let s=0,i=[],l=0,o=!1;for(let n=0,a=t.length;n<a;n+=1){let a=t[n];i.length=0,s=0,o=!1;for(let t=0,n=a.length;t<n;t+=1){let n=a[t],{isMatch:u,indices:c,score:d}=n.search(e);if(u){s+=1,l+=d;let e=n.constructor.type;e.startsWith("inverse")&&(o=!0),r&&(re.has(e)?i.push(...c):i.push(c))}else{l=0,s=0,i.length=0,o=!1;break}}if(s){let e={isMatch:!0,score:l/s};return o&&(e.hasInverse=!0),r&&(e.indices=tZ(i)),e}}return{isMatch:!1,score:1}}}),rr(class{static condition(e,t){return t.useTokenSearch}constructor(e,t){this.options=t,this.analyzer=rm({isCaseSensitive:t.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics});const r=this.analyzer.tokenize(e),{df:n,fieldCount:a}=t._invertedIndex;for(const e of(this.termSearchers=[],this.idfWeights=[],r)){this.termSearchers.push(new t3(e,{location:t.location,threshold:t.threshold,distance:t.distance,includeMatches:t.includeMatches,findAllMatches:t.findAllMatches,minMatchCharLength:t.minMatchCharLength,isCaseSensitive:t.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics,ignoreLocation:!0}));const r=n.get(e)||0,s=Math.log(1+(a-r+.5)/(r+.5));this.idfWeights.push(s)}}searchIn(e){if(!this.termSearchers.length)return{isMatch:!1,score:1};let t=[],r=0,n=0,a=0;for(let s=0;s<this.termSearchers.length;s++){let i=this.termSearchers[s].searchIn(e),l=this.idfWeights[s];n+=l,i.isMatch&&(a++,r+=l*(1-i.score),i.indices&&t.push(...i.indices))}if(0===a)return{isMatch:!1,score:1};let s={isMatch:!0,score:Math.max(.001,n>0?1-r/n:0)};return this.options.includeMatches&&t.length&&(s.indices=tZ(t)),s}}),rx.use=function(...e){e.forEach(e=>rr(e))};var rg=e.i(726111),rb=e.i(142124),rv=e.i(718837),ry=e.i(711296),rw=e.i(625054),rj=e.i(312345),rk=e.i(894012),rC=e.i(929970),rN=e.i(283639),rS=e.i(126259),rE=e.i(150891),rA=e.i(775202),rD=e.i(803041),rM=e.i(458851);let rI=(0,d.default)("file-code",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]]),rP=(0,d.default)("file-braces",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1",key:"1oajmo"}],["path",{d:"M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1",key:"mpwhp6"}]]);var rR=e.i(555159),rB=e.i(478430);function rF({entry:e,worktreePath:t,depth:r,gitStatusMap:n,expandedPaths:a,childrenMap:l,selectedPath:o,onFileSelect:u,onToggleExpand:c,onContextMenu:d,renamingPath:h,onRenameSubmit:f,onRenameCancel:m,creatingIn:p,onCreateSubmit:x,onCreateCancel:g}){let{t:b}=(0,rw.useI18n)(),v=a.has(e.relativePath),y=o===e.relativePath,w=h===e.relativePath,j=n[e.relativePath],k=l.get(e.relativePath)??[],C=e.isDirectory&&p?.parentPath===e.relativePath&&v,N=(0,i.useRef)(null),S=(0,i.useRef)(null);(0,i.useEffect)(()=>{w&&N.current&&(N.current.focus(),N.current.select())},[w]),(0,i.useEffect)(()=>{C&&S.current&&S.current.focus()},[C]);let E=["flex items-center gap-1 py-0.5 px-1 cursor-pointer hover:bg-accent hover:text-accent-foreground rounded-sm min-h-[28px]",y?"bg-secondary text-secondary-foreground font-medium":""].filter(Boolean).join(" "),A={paddingLeft:`calc(${r} * 8px + 4px)`};return(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:E,style:A,onClick:()=>{if(e.isDirectory)c(e.relativePath);else{let r=t.endsWith("/")?t.slice(0,-1):t,n=e.relativePath.startsWith("/")?e.relativePath.slice(1):e.relativePath;u(`${r}/${n}`)}},onContextMenu:t=>{t.preventDefault(),d(e,t.clientX,t.clientY)},role:"treeitem","aria-expanded":e.isDirectory?v:void 0,children:[e.isDirectory?(0,s.jsx)("span",{className:"flex-shrink-0",children:v?(0,s.jsx)(rM.ChevronDown,{className:"h-3 w-3 transition-transform duration-150"}):(0,s.jsx)(rD.ChevronRight,{className:"h-3 w-3 transition-transform duration-150"})}):(0,s.jsx)("span",{className:"h-3 w-3 flex-shrink-0"}),function(e,t,r){if(t)return r?(0,s.jsx)(rB.FolderOpen,{className:"h-3.5 w-3.5 flex-shrink-0 text-amber-400"}):(0,s.jsx)(tR.Folder,{className:"h-3.5 w-3.5 flex-shrink-0 text-amber-400"});let n=e.includes(".")?e.split(".").pop()?.toLowerCase():"";return"ts"===n||"tsx"===n?(0,s.jsx)(rI,{className:"h-3.5 w-3.5 flex-shrink-0 text-blue-400"}):"json"===n?(0,s.jsx)(rP,{className:"h-3.5 w-3.5 flex-shrink-0 text-yellow-400"}):"md"===n||"mdx"===n?(0,s.jsx)(rR.FileText,{className:"h-3.5 w-3.5 flex-shrink-0 text-muted-foreground"}):"css"===n||"scss"===n||"sass"===n?(0,s.jsx)(tF,{className:"h-3.5 w-3.5 flex-shrink-0 text-pink-400"}):(0,s.jsx)(tF,{className:"h-3.5 w-3.5 flex-shrink-0 text-muted-foreground"})}(e.name,e.isDirectory,v),w?(0,s.jsx)("input",{ref:N,type:"text",defaultValue:e.name,className:"ring-1 ring-primary rounded-sm px-1 text-[13px] w-full bg-background",placeholder:b("taskPage.fileTree.renamePlaceholder"),onKeyDown:t=>{if("Enter"===t.key){let r=t.currentTarget.value.trim();r&&r!==e.name?f(e,r):m()}else"Escape"===t.key&&m()},onBlur:m,onClick:e=>e.stopPropagation()}):(0,s.jsx)("span",{className:"text-[13px] truncate flex-1",children:e.name}),j&&!w&&(0,s.jsx)("span",{className:`ml-auto text-[11px] font-normal ${"M"===j?"text-amber-500 dark:text-amber-400":"A"===j?"text-emerald-500 dark:text-emerald-400":"text-red-500 dark:text-red-400"}`,children:j})]}),e.isDirectory&&v&&(0,s.jsxs)("div",{children:[k.map(e=>(0,s.jsx)(rF,{entry:e,worktreePath:t,depth:r+1,gitStatusMap:n,expandedPaths:a,childrenMap:l,selectedPath:o,onFileSelect:u,onToggleExpand:c,onContextMenu:d,renamingPath:h,onRenameSubmit:f,onRenameCancel:m,creatingIn:p,onCreateSubmit:x,onCreateCancel:g},e.relativePath)),C&&(0,s.jsxs)("div",{className:"flex items-center gap-1 py-0.5 px-1 min-h-[28px]",style:{paddingLeft:`calc(${r+1} * 8px + 4px)`},children:[(0,s.jsx)("span",{className:"h-3 w-3 flex-shrink-0"}),p?.type==="folder"?(0,s.jsx)(tR.Folder,{className:"h-3.5 w-3.5 flex-shrink-0 text-amber-400"}):(0,s.jsx)(tF,{className:"h-3.5 w-3.5 flex-shrink-0 text-muted-foreground"}),(0,s.jsx)("input",{ref:S,type:"text",className:"ring-1 ring-primary rounded-sm px-1 text-[13px] w-full bg-background",placeholder:b(p?.type==="folder"?"taskPage.fileTree.newFolderPlaceholder":"taskPage.fileTree.newFilePlaceholder"),onKeyDown:e=>{if("Enter"===e.key){let t=e.currentTarget.value.trim();t&&p?x(p.parentPath,t,p.type):g()}else"Escape"===e.key&&g()},onBlur:g})]})]})]})}var rL=e.i(9235);function rz({entry:e,x:t,y:r,onClose:n,onNewFile:a,onNewFolder:l,onRename:o,onDelete:u,onRevealInFinder:c}){let{t:d}=(0,rw.useI18n)(),h=(0,i.useRef)(null);(0,i.useEffect)(()=>{let e=e=>{h.current&&!h.current.contains(e.target)&&n()},t=e=>{"Escape"===e.key&&n()};return document.addEventListener("mousedown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",t)}},[n]);let f=".git"===e.name||".git"===e.relativePath,m="flex items-center px-3 py-1.5 text-xs cursor-pointer hover:bg-accent rounded-sm w-full text-left",p=(0,s.jsxs)("div",{ref:h,style:{position:"fixed",top:r,left:t,zIndex:9999},className:"bg-popover border border-border rounded-md shadow-md py-1 min-w-[160px]",children:[(0,s.jsx)("button",{type:"button",className:m,onClick:()=>{a(e),n()},children:d("taskPage.fileTree.newFile")}),(0,s.jsx)("button",{type:"button",className:m,onClick:()=>{l(e),n()},children:d("taskPage.fileTree.newFolder")}),(0,s.jsx)("hr",{className:"my-1 border-border"}),(0,s.jsx)("button",{type:"button",className:m,onClick:()=>{o(e),n()},children:d("taskPage.fileTree.rename")}),c&&(0,s.jsx)("button",{type:"button",className:m,onClick:()=>{c(e),n()},children:d("taskPage.fileTree.revealInFinder")}),!f&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("hr",{className:"my-1 border-border"}),(0,s.jsx)("button",{type:"button",className:`${m} text-destructive hover:bg-destructive/10`,onClick:()=>{u(e),n()},children:d("taskPage.fileTree.delete")})]})]});return"u"<typeof document?null:(0,rL.createPortal)(p,document.body)}function r$({worktreePath:t,baseBranch:r,worktreeBranch:n,executionStatus:a,onFileSelect:l}){let{t:o}=(0,rw.useI18n)(),[u,c]=(0,i.useState)([]),[d,f]=(0,i.useState)(new Set),[m,p]=(0,i.useState)(new Map),[x,g]=(0,i.useState)({}),[v,y]=(0,i.useState)(null),[w,j]=(0,i.useState)(null),[k,C]=(0,i.useState)(null),[N,S]=(0,i.useState)(null),[E,A]=(0,i.useState)(null),[D,M]=(0,i.useState)(!1),[I,P]=(0,i.useState)(!1),[R,B]=(0,i.useState)(""),[F,L]=(0,i.useState)([]),[z,$]=(0,i.useState)(!1),[T,_]=(0,i.useState)(0),O=(0,i.useRef)(null),W=(0,i.useRef)(null),H=(0,i.useRef)(d);H.current=d;let G=(0,i.useCallback)(async()=>{if(t)try{let e=await (0,rj.listDirectory)(t,".");c(e),P(!1)}catch{P(!0)}},[t]),K=(0,i.useCallback)(async e=>{if(t)try{let r=await (0,rj.listDirectory)(t,e);p(t=>{let n=new Map(t);return n.set(e,r),n})}catch{}},[t]),V=(0,i.useCallback)(async()=>{if(t)try{let e=await (0,rj.listDirectory)(t,".");for(let r of(c(e),H.current)){let e=await (0,rj.listDirectory)(t,r).catch(()=>null);e&&p(t=>{let n=new Map(t);return n.set(r,e),n})}}catch{}},[t]);(0,i.useEffect)(()=>{t&&(M(!0),P(!1),c([]),p(new Map),f(new Set),y(null),G().finally(()=>M(!1)),(0,rk.getGitStatus)(t,r,n).then(g).catch(()=>g({})))},[t,r,n,G]),(0,i.useEffect)(()=>{if("RUNNING"!==a)return;let e=setInterval(V,2e3);return()=>clearInterval(e)},[a,V]);let U=(0,i.useCallback)(e=>{f(t=>{let r=new Set(t);return r.has(e)?r.delete(e):(r.add(e),m.has(e)||K(e)),r})},[m,K]),Y=(0,i.useCallback)(e=>{let r=(t??"").endsWith("/")?t??"":`${t??""}/`;y(e.startsWith(r)?e.slice(r.length):e),l(e)},[t,l]),q=(0,i.useCallback)((e,t,r)=>{S({entry:e,x:t,y:r})},[]),J=(0,i.useCallback)(e=>{C({parentPath:e.isDirectory?e.relativePath:e.relativePath.includes("/")?e.relativePath.slice(0,e.relativePath.lastIndexOf("/")):".",type:"file"}),e.isDirectory&&(f(t=>{let r=new Set(t);return r.add(e.relativePath),r}),m.has(e.relativePath)||K(e.relativePath))},[m,K]),X=(0,i.useCallback)(e=>{C({parentPath:e.isDirectory?e.relativePath:e.relativePath.includes("/")?e.relativePath.slice(0,e.relativePath.lastIndexOf("/")):".",type:"folder"}),e.isDirectory&&(f(t=>{let r=new Set(t);return r.add(e.relativePath),r}),m.has(e.relativePath)||K(e.relativePath))},[m,K]),Q=(0,i.useCallback)(e=>{j(e.relativePath)},[]),Z=(0,i.useCallback)(e=>{A(e)},[]),ee=(0,i.useCallback)(async(e,r)=>{if(!t)return;j(null);let n=e.relativePath.includes("/")?e.relativePath.slice(0,e.relativePath.lastIndexOf("/")):".",a="."===n?r:`${n}/${r}`;try{await (0,rS.renameEntry)(t,e.relativePath,a),await V()}catch{}},[t,V]),et=(0,i.useCallback)(()=>{j(null)},[]),er=(0,i.useCallback)(async(e,r,n)=>{if(!t)return;C(null);let a="."===e?r:`${e}/${r}`;try{"file"===n?await (0,rC.createFile)(t,a):await (0,rN.createDirectory)(t,a),await V()}catch{}},[t,V]),en=(0,i.useCallback)(()=>{C(null)},[]),ea=async()=>{if(t&&E){A(null);try{await (0,rE.deleteEntry)(t,E.relativePath),await V()}catch{}}},es=(0,i.useCallback)(async()=>{if(t&&!z)try{let e=await (0,rA.listAllFiles)(t);L(e),$(!0)}catch{}},[t,z]);(0,i.useEffect)(()=>{L([]),$(!1),B("")},[t]);let ei=(0,i.useMemo)(()=>new rx(F,{threshold:.4,distance:200,includeMatches:!0}),[F]),el=(0,i.useMemo)(()=>R.trim()?ei.search(R.trim(),{limit:30}):[],[ei,R]),eo=(0,i.useCallback)(e=>{if("Escape"===e.key){B(""),O.current?.blur();return}if(el.length){if("ArrowDown"===e.key)e.preventDefault(),_(e=>Math.min(e+1,el.length-1));else if("ArrowUp"===e.key)e.preventDefault(),_(e=>Math.max(e-1,0));else if("Enter"===e.key){e.preventDefault();let r=el[T];r&&(Y(`${t}/${r.item}`),B(""))}}},[el,T,t,Y]);if((0,i.useEffect)(()=>{let e=W.current;if(!e)return;let t=e.querySelector("[data-highlighted='true']");t&&t.scrollIntoView({block:"nearest"})},[T]),!t)return(0,s.jsx)(rg.EmptyState,{icon:h,title:o("taskPage.fileTree.emptyHeading"),description:o("taskPage.fileTree.emptyBody"),className:"h-full"});if(I)return(0,s.jsxs)("div",{className:"flex h-full flex-col items-center justify-center gap-3 p-6 text-center",children:[(0,s.jsx)(tP.AlertCircle,{className:"h-8 w-8 text-destructive"}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:o("taskPage.fileTree.loadError")}),(0,s.jsx)("button",{type:"button",className:"text-xs text-primary underline cursor-pointer",onClick:()=>{P(!1),M(!0),G().finally(()=>M(!1))},children:"Retry"})]});if(!D&&0===u.length)return(0,s.jsx)(rg.EmptyState,{icon:tR.Folder,title:o("taskPage.fileTree.emptyDir"),className:"h-full"});let eu=R.trim().length>0;return(0,s.jsxs)("div",{className:"h-full flex flex-col",children:[(0,s.jsx)("div",{className:"flex-shrink-0 px-2 py-1.5 border-b border-border",children:(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)(b.Search,{className:"absolute left-2 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted-foreground"}),(0,s.jsx)("input",{ref:O,type:"text",value:R,placeholder:o("taskPage.fileTree.searchPlaceholder"),className:"w-full h-7 pl-7 pr-7 text-xs bg-muted/50 border border-border rounded-md outline-none focus:border-primary/50 focus:bg-background transition-colors placeholder:text-muted-foreground/60",onChange:e=>{B(e.target.value),_(0),z||es()},onKeyDown:eo}),eu&&(0,s.jsx)("button",{type:"button",className:"absolute right-1.5 top-1/2 -translate-y-1/2 p-0.5 rounded hover:bg-muted-foreground/20 text-muted-foreground",onClick:()=>B(""),children:(0,s.jsx)(tB.X,{className:"h-3 w-3"})})]})}),D&&(0,s.jsx)("div",{className:"h-0.5 w-full bg-primary/30 animate-pulse flex-shrink-0"}),eu?(0,s.jsx)(rb.ScrollArea,{className:"flex-1",children:(0,s.jsx)("div",{ref:W,className:"py-1",children:0===el.length?(0,s.jsx)("p",{className:"px-3 py-4 text-xs text-muted-foreground text-center",children:o("taskPage.fileTree.searchNoResults")}):el.map((e,r)=>{let n=e.item,a=n.split("/").pop()??n,i=n.includes("/")?n.slice(0,n.lastIndexOf("/")):"",l=new Set;if(e.matches)for(let t of e.matches)for(let[e,r]of t.indices)for(let t=e;t<=r;t++)l.add(t);let o=n.length-a.length,u=(e,t)=>{let r=[],n=0;for(;n<e.length;){let a=l.has(n+t),i=n+1;for(;i<e.length&&l.has(i+t)===a;)i++;let o=e.slice(n,i);r.push(a?(0,s.jsx)("span",{className:"text-primary font-semibold",children:o},n):(0,s.jsx)("span",{children:o},n)),n=i}return r};return(0,s.jsxs)("button",{type:"button","data-highlighted":r===T,className:`w-full flex items-center gap-2 px-3 py-1 text-left text-xs hover:bg-accent cursor-pointer ${r===T?"bg-accent":""}`,onClick:()=>{Y(`${t}/${n}`),B("")},onMouseEnter:()=>_(r),children:[(0,s.jsx)(tF,{className:"h-3.5 w-3.5 flex-shrink-0 text-muted-foreground"}),(0,s.jsxs)("span",{className:"truncate",children:[(0,s.jsx)("span",{className:"text-foreground",children:u(a,o)}),i&&(0,s.jsx)("span",{className:"ml-1.5 text-muted-foreground",children:u(i,0)})]})]},n)})})}):(0,s.jsx)(rb.ScrollArea,{className:"flex-1",children:(0,s.jsx)("div",{className:"py-1",children:u.map(e=>(0,s.jsx)(rF,{entry:e,worktreePath:t,depth:0,gitStatusMap:x,expandedPaths:d,childrenMap:m,selectedPath:v,onFileSelect:Y,onToggleExpand:U,onContextMenu:q,renamingPath:w,onRenameSubmit:ee,onRenameCancel:et,creatingIn:k,onCreateSubmit:er,onCreateCancel:en},e.relativePath))})}),N&&(0,s.jsx)(rz,{entry:N.entry,x:N.x,y:N.y,onClose:()=>S(null),onNewFile:J,onNewFolder:X,onRename:Q,onDelete:Z,onRevealInFinder:t?r=>{e.A(657115).then(({revealInFinder:e})=>{e(t,r.relativePath).catch(()=>{})})}:void 0}),(0,s.jsx)(rv.Dialog,{open:null!==E,onOpenChange:e=>{e||A(null)},children:(0,s.jsxs)(rv.DialogContent,{children:[(0,s.jsx)(rv.DialogHeader,{children:(0,s.jsx)(rv.DialogTitle,{children:o("taskPage.fileTree.deleteConfirmHeading")})}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:E?.isDirectory?o("taskPage.fileTree.deleteConfirmBodyFolder",{name:E.name}):o("taskPage.fileTree.deleteConfirmBody",{name:E?.name??""})}),(0,s.jsxs)(rv.DialogFooter,{children:[(0,s.jsx)(ry.Button,{variant:"outline",onClick:()=>A(null),children:o("common.cancel")}),(0,s.jsx)(ry.Button,{variant:"destructive",onClick:ea,children:o("taskPage.fileTree.deleteConfirmAction")})]})]})})]})}var rT=e.i(415411);e.i(504466);var r_=e.i(306453),r_=r_,rO=e.i(275283),rW=e.i(286302),rH=e.i(3416),rG=e.i(248686);function rK({tabs:e,activeTabPath:t,onTabClick:r,onTabClose:n}){let{t:a}=(0,rw.useI18n)();return 0===e.length?null:(0,s.jsx)("div",{className:"header-xs flex items-stretch overflow-x-auto bg-card flex-shrink-0",children:e.map(e=>{let i=e.path===t;return(0,s.jsxs)("div",{role:"tab","aria-selected":i,onClick:()=>r(e.path),className:["flex items-center gap-1.5 px-3 text-sm whitespace-nowrap cursor-pointer select-none border-b-2",i?"border-primary text-foreground font-medium":"border-transparent text-muted-foreground hover:text-foreground"].join(" "),children:[e.isDiff&&(0,s.jsx)("span",{className:"text-amber-400 text-[10px] font-mono font-bold",children:"M"}),e.isDirty&&(0,s.jsx)("span",{className:"text-primary text-xs",children:"●"}),(0,s.jsx)("span",{children:e.filename}),(0,s.jsx)("button",{type:"button","aria-label":a("editor.closeTab"),onClick:t=>{t.stopPropagation(),n(e.path)},className:"text-muted-foreground hover:text-foreground ml-0.5 flex items-center",children:(0,s.jsx)(tB.X,{className:"w-3 h-3"})})]},e.path)})})}var r_=r_;r_.default.config({paths:{vs:"/vs"}});let rV=(0,rT.default)(()=>e.A(454868).then(e=>({default:e.DiffEditor})),{loadableGenerated:{modules:[92729]},ssr:!1}),rU={ts:"typescript",tsx:"typescript",js:"javascript",jsx:"javascript",json:"json",md:"markdown",css:"css",html:"html",py:"python",sh:"shell",yaml:"yaml",yml:"yaml",vue:"html",svelte:"html",prisma:"prisma",txt:"plaintext"};function rY({originalContent:t,modifiedContent:r,filePath:n,language:a,onModifiedChange:l,readOnly:o=!1}){let{resolvedTheme:u}=(0,rO.useTheme)(),c="dark"===u?"vs-dark":"light",d=a??rU[n.split(".").pop()??""]??"plaintext",h=(0,i.useRef)(null);return(0,i.useEffect)(()=>{e.A(820374).then(({loader:e})=>{e.init().then(e=>{e.editor.setTheme(c)})})},[c]),(0,s.jsx)(rV,{height:"100%",theme:c,original:t,modified:r,language:d,onMount:e=>{if(h.current=e,l){let t=e.getModifiedEditor();t.onDidChangeModelContent(()=>{l(t.getValue())})}},options:{readOnly:o,originalEditable:!1,automaticLayout:!0,minimap:{enabled:!1},fontSize:13,fontFamily:'"JetBrains Mono", "Geist Mono", monospace',scrollBeyondLastLine:!1,renderSideBySide:!0},loading:(0,s.jsx)("div",{className:"flex h-full items-center justify-center bg-muted/20",children:(0,s.jsx)("span",{className:"text-sm text-muted-foreground",children:"Loading diff editor..."})})})}r_.default.config({paths:{vs:"/vs"}});let rq=(0,rT.default)(()=>e.A(454868).then(e=>({default:e.default})),{loadableGenerated:{modules:[92729]},ssr:!1}),rJ={ts:"typescript",tsx:"typescript",js:"javascript",jsx:"javascript",json:"json",md:"markdown",css:"css",html:"html",py:"python",sh:"shell",yaml:"yaml",yml:"yaml",vue:"html",svelte:"html",prisma:"prisma",txt:"plaintext"};function rX({worktreePath:t,selectedFilePath:r,onFilePathChange:n,onSave:a,selectedLine:l,diffFileRequest:o}){let{t:u}=(0,rw.useI18n)(),{resolvedTheme:c}=(0,rO.useTheme)(),d="dark"===c?"vs-dark":"light",[h,f]=(0,i.useState)([]),[m,p]=(0,i.useState)(null),x=(0,i.useRef)(null),g=(0,i.useRef)(null),b=(0,i.useRef)(new Map),v=(0,i.useRef)(null),y=(0,i.useRef)(void 0),w=(0,i.useRef)(null);function j(e){"success"===e?rW.toast.success(u("editor.saveSuccess")):rW.toast.error(u("editor.saveError"))}(0,i.useEffect)(()=>{v.current=h.find(e=>e.path===m)??null},[h,m]),(0,i.useEffect)(()=>{y.current=a},[a]),(0,i.useEffect)(()=>{e.A(820374).then(({loader:e})=>{e.init().then(e=>{e.editor.setTheme(d)})})},[d]),(0,i.useEffect)(()=>{if(!r)return;if(w.current=r,h.find(e=>e.path===r)){p(r),n?.(r);return}let e=r.startsWith(t+"/")?r.slice(t.length+1):r,a=e.split("/").pop()??e;(0,rH.readFileContent)(t,e).then(t=>{if(w.current!==r)return;let s={path:r,relativePath:e,filename:a,content:t,isDirty:!1};f(e=>e.some(e=>e.path===r)?e:[...e,s]),p(r),n?.(r)}).catch(()=>{})},[r,t]),(0,i.useEffect)(()=>{if(!o)return;let{relativePath:e,originalContent:r}=o,n="diff:"+(t+"/")+e,a=e.split("/").pop()??e;h.find(e=>e.path===n)?p(n):(0,rH.readFileContent)(t,e).then(t=>{let s={path:n,relativePath:e,filename:a,content:t,isDirty:!1,isDiff:!0,originalContent:r};f(e=>e.some(e=>e.path===n)?e:[...e,s]),p(n)}).catch(()=>{})},[o,t]),(0,i.useEffect)(()=>{if(!l||!x.current)return;let e=x.current,t=setTimeout(()=>{e.revealLineInCenter(l),e.setPosition({lineNumber:l,column:1})},50);return()=>clearTimeout(t)},[l,m]),(0,i.useEffect)(()=>{let e=x.current,t=g.current;if(!e||!t||!m)return;let r=h.find(e=>e.path===m);if(!r)return;let n=t.Uri.parse("file://"+r.path),a=b.current.get(r.path);if(!a){let e=rJ[r.filename.split(".").pop()??""]??"plaintext";a=t.editor.createModel(r.content,e,n),b.current.set(r.path,a)}e.setModel(a)},[m,h]);let k=h.find(e=>e.path===m);return(0,s.jsxs)("div",{className:"flex flex-col h-full overflow-hidden relative",children:[(0,s.jsx)(rK,{tabs:h,activeTabPath:m,onTabClick:function(e){p(e),n?.(e)},onTabClose:function(e){let t=b.current.get(e);t?.dispose&&t.dispose(),b.current.delete(e),f(t=>{let r=t.filter(t=>t.path!==e);if(m===e){let e=r.length>0?r[r.length-1].path:null;p(e),n?.(e)}return r})}}),0===h.length?(0,s.jsxs)("div",{className:"flex h-full flex-col items-center justify-center text-center",children:[(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:u("editor.selectFile")}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:u("editor.selectFileHint")})]}):k?.isDiff?(0,s.jsx)("div",{className:"flex-1 min-h-0",children:(0,s.jsx)(rY,{originalContent:k.originalContent??"",modifiedContent:k.content,filePath:k.relativePath,onModifiedChange:e=>{f(t=>t.map(t=>t.path===m?{...t,content:e,isDirty:!0}:t))}})}):(0,s.jsx)("div",{className:"flex-1 min-h-0",children:(0,s.jsx)(rq,{height:"100%",theme:d,value:k?.content??"",onMount:function(e,r){x.current=e,g.current=r,e.addAction({id:"save-file",label:"Save File",keybindings:[r.KeyMod.CtrlCmd|r.KeyCode.KeyS],run:async()=>{let e=v.current;if(e&&e.isDirty)try{await (0,rG.writeFileContent)(t,e.relativePath,e.content),f(t=>t.map(t=>t.path===e.path?{...t,isDirty:!1}:t)),j("success"),y.current?.()}catch{j("error")}}})},onChange:e=>{void 0!==e&&f(t=>t.map(t=>t.path===m?{...t,content:e,isDirty:!0}:t))},options:{automaticLayout:!0,minimap:{enabled:!1},fontSize:13,fontFamily:'"JetBrains Mono", "Geist Mono", monospace',lineNumbers:"on",wordWrap:"off",scrollBeyondLastLine:!1,tabSize:2},loading:(0,s.jsx)("div",{className:"flex h-full items-center justify-center bg-muted/20",children:(0,s.jsx)("span",{className:"text-sm text-muted-foreground",children:"Loading editor..."})})})})]})}let rQ=(0,d.default)("funnel",[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]]);var rZ=e.i(543485);let r0=(0,rZ.createServerReference)("788cdf62f4755e895a66d6f6242c805e5cd689c889",rZ.callServer,void 0,rZ.findSourceMapURL,"searchCode");function r1({localPath:e,onResultSelect:t}){let{t:r}=(0,rw.useI18n)(),[n,a]=(0,i.useState)(""),[l,o]=(0,i.useState)(""),[u,d]=(0,i.useState)([]),[h,f]=(0,i.useState)(!1),[m,p]=(0,i.useState)(null),[x,g]=(0,i.useState)(!1),[v,y]=(0,i.useState)(!1),w=(0,i.useRef)(0),j=(0,i.useCallback)(async()=>{if(!e||!n.trim())return;let t=++w.current;g(!0),p(null),y(!0);try{let a=await r0(e,n.trim(),l.trim()||void 0);if(t!==w.current)return;a.error?(a.error.toLowerCase().includes("ripgrep")||a.error.toLowerCase().includes("rg")?(rW.toast.error(r("codeSearch.rgNotInstalled")),p(r("codeSearch.rgNotInstalled"))):p(a.error),d([]),f(!1)):(d(a.matches),f(a.truncated))}catch(e){if(t!==w.current)return;p(String(e)),d([]),f(!1)}finally{t===w.current&&g(!1)}},[e,n,l,r]),k=(0,i.useCallback)(e=>{"Enter"===e.key&&(e.preventDefault(),j())},[j]);return e?(0,s.jsxs)("div",{className:"h-full flex flex-col overflow-hidden",children:[(0,s.jsxs)("div",{className:"flex-shrink-0 px-2 py-1.5 space-y-1 border-b border-border",children:[(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)(b.Search,{className:"absolute left-2 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted-foreground"}),(0,s.jsx)("input",{type:"text",value:n,placeholder:r("codeSearch.patternPlaceholder"),className:"w-full h-7 pl-7 pr-2 text-xs bg-muted/50 border border-border rounded-md outline-none focus:border-primary/50 focus:bg-background transition-colors placeholder:text-muted-foreground/60",onChange:e=>a(e.target.value),onKeyDown:k})]}),(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)(rQ,{className:"absolute left-2 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted-foreground"}),(0,s.jsx)("input",{type:"text",value:l,placeholder:r("codeSearch.globPlaceholder"),className:"w-full h-7 pl-7 pr-2 text-xs bg-muted/50 border border-border rounded-md outline-none focus:border-primary/50 focus:bg-background transition-colors placeholder:text-muted-foreground/60",onChange:e=>o(e.target.value)})]})]}),(0,s.jsx)("div",{className:"flex-1 min-h-0 flex flex-col",children:x?(0,s.jsxs)("div",{className:"flex flex-col items-center justify-center h-full gap-2",children:[(0,s.jsx)(c.Loader2,{className:"h-5 w-5 animate-spin text-muted-foreground"}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:r("codeSearch.searching")})]}):m?(0,s.jsx)("div",{className:"px-3 py-4 text-xs text-destructive",children:m}):v?0===u.length?(0,s.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:r("codeSearch.noResults")})}):(0,s.jsxs)(rb.ScrollArea,{className:"flex-1",children:[(0,s.jsx)("div",{className:"py-1",children:u.map((r,n)=>(0,s.jsxs)("button",{type:"button",className:"w-full flex flex-col gap-0.5 px-2 py-1.5 text-left hover:bg-accent/50 cursor-pointer border-b border-border/30 last:border-b-0","aria-label":`Open ${r.filePath} at line ${r.lineNumber}`,onClick:()=>{t(e.endsWith("/")?e+r.filePath:e+"/"+r.filePath,r.lineNumber)},children:[(0,s.jsxs)("div",{className:"flex items-center gap-1.5 min-w-0",children:[(0,s.jsx)("span",{className:"text-xs text-muted-foreground truncate flex-1",children:r.filePath}),(0,s.jsxs)("span",{className:"text-xs text-primary/80 flex-shrink-0 tabular-nums",children:[":",r.lineNumber]})]}),(0,s.jsx)("div",{className:"text-xs text-foreground/80 font-mono truncate",children:function(e,t){if(!t.length)return[(0,s.jsx)("span",{children:e},"0")];let r=[],n=0;for(let{start:a,end:i}of t)n<a&&r.push((0,s.jsx)("span",{children:e.slice(n,a)},`plain-${n}`)),r.push((0,s.jsx)("span",{className:"bg-yellow-400/30 text-yellow-200 rounded-[2px] px-[1px]",children:e.slice(a,i)},`match-${a}`)),n=i;return n<e.length&&r.push((0,s.jsx)("span",{children:e.slice(n)},`plain-${n}`)),r}(r.lineText,r.submatches)})]},`${r.filePath}:${r.lineNumber}:${n}`))}),h&&(0,s.jsx)("div",{className:"px-3 py-2 text-xs text-muted-foreground text-center border-t border-border/30",children:r("codeSearch.truncated")})]}):(0,s.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,s.jsx)("p",{className:"text-xs text-muted-foreground text-center px-4",children:r("codeSearch.hint")})})})]}):(0,s.jsxs)("div",{className:"flex h-full flex-col items-center justify-center gap-2 p-4 text-center",children:[(0,s.jsx)(b.Search,{className:"h-8 w-8 text-muted-foreground"}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:r("codeSearch.noPath")})]})}let r2=(0,d.default)("file-plus",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M9 15h6",key:"cctwl0"}],["path",{d:"M12 18v-6",key:"17g6i2"}]]),r3=(0,d.default)("file-minus",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M9 15h6",key:"cctwl0"}]]),r5=(0,d.default)("file-question-mark",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M12 17h.01",key:"p32p05"}],["path",{d:"M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3",key:"mhlwft"}]]),r4=(0,d.default)("file-pen",[["path",{d:"M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34",key:"o6klzx"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z",key:"zhnas1"}]]),r8=(0,d.default)("arrow-down",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]),r7=(0,d.default)("arrow-up",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);var r6=e.i(893832);let r9=(0,d.default)("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);var ne=e.i(780156),nt=e.i(746357),nr=e.i(126741),nn=e.i(565037),na=e.i(871183);let ns=(0,d.default)("undo-2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]);var ni=e.i(802461),nl=e.i(942252),no=e.i(909105),nu=e.i(657572);let nc={modified:r4,added:r2,deleted:r3,untracked:r5,renamed:r4},nd={modified:"text-amber-400",added:"text-emerald-400",deleted:"text-rose-400",untracked:"text-muted-foreground",renamed:"text-sky-400"},nh={modified:"M",added:"A",deleted:"D",untracked:"U",renamed:"R"};function nf(e){let t={name:"",path:"",isDir:!0,children:[]};for(let r of e){let e=r.file.split("/"),n=t;for(let t=0;t<e.length;t++){let a=e[t],s=t===e.length-1,i=e.slice(0,t+1).join("/");if(s)n.children.push({name:a,path:i,isDir:!1,children:[],file:r});else{let e=n.children.find(e=>e.isDir&&e.name===a);e||(e={name:a,path:i,isDir:!0,children:[]},n.children.push(e)),n=e}}}return(function e(t){if(t.isDir&&(t.children=t.children.map(e),1===t.children.length&&t.children[0].isDir&&""!==t.name)){let e=t.children[0];return{...e,name:`${t.name}/${e.name}`}}return t})(t).children.sort((e,t)=>e.isDir!==t.isDir?e.isDir?-1:1:e.name.localeCompare(t.name))}function nm({localPath:e,onFileSelect:t}){let{t:r}=(0,rw.useI18n)(),[n,a]=(0,i.useState)(null),[l,o]=(0,i.useState)(!0),[d,h]=(0,i.useState)(""),[f,m]=(0,i.useState)(!1),[p,x]=(0,i.useState)(!1),[g,v]=(0,i.useState)(!1),[y,w]=(0,i.useState)(!1),[j,k]=(0,i.useState)(!1),[C,N]=(0,i.useState)(""),S=(0,i.useRef)(null);(0,i.useEffect)(()=>{if(j)return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e);function e(e){S.current&&!S.current.contains(e.target)&&k(!1)}},[j]);let[E,A]=(0,i.useState)(!1),D=(0,i.useCallback)(async()=>{try{let t=await fetch(`/api/git?path=${encodeURIComponent(e)}`);if(t.ok){let e=await t.json();a({changedFiles:e.changedFiles??[],ahead:e.ahead??0,behind:e.behind??0,remoteUrl:e.remoteUrl??"",currentBranch:e.currentBranch??"",branches:e.branches??[],remoteBranches:e.remoteBranches??[]})}}catch{}finally{o(!1)}},[e]);(0,i.useEffect)(()=>{D();let e=setInterval(D,5e3);return()=>clearInterval(e)},[D]);let M=async t=>{try{await (0,nu.gitAction)(e,"stage",{files:t}),await D()}catch(e){rW.toast.error(e instanceof Error?e.message:String(e))}},I=async t=>{try{await (0,nu.gitAction)(e,"unstage",{files:t}),await D()}catch(e){rW.toast.error(e instanceof Error?e.message:String(e))}},P=async()=>{if(d.trim()){m(!0);try{await (0,nu.gitAction)(e,"commit",{message:d}),h(""),rW.toast.success(r("git.commitSuccess")),await D()}catch(e){rW.toast.error(e instanceof Error?e.message:String(e))}finally{m(!1)}}},R=async t=>{x(!0);try{await (0,nu.gitAction)(e,"pull",t?{branch:t}:{}),rW.toast.success(r("git.pullSuccess")),await D()}catch(e){rW.toast.error(e instanceof Error?e.message:String(e))}finally{x(!1)}},B=async t=>{v(!0);try{await (0,nu.gitAction)(e,"push",t?{branch:t}:{}),rW.toast.success(r("git.pushSuccess")),await D()}catch(e){rW.toast.error(e instanceof Error?e.message:String(e))}finally{v(!1)}},F=async()=>{w(!0);try{await (0,nu.gitAction)(e,"fetch"),rW.toast.success(r("git.fetchSuccess")),await D()}catch(e){rW.toast.error(e instanceof Error?e.message:String(e))}finally{w(!1)}},L=async t=>{try{await (0,nu.gitAction)(e,"checkout",{branch:t}),k(!1),rW.toast.success(`${r("git.switchSuccess")} ${t}`),await D()}catch(e){rW.toast.error(e instanceof Error?e.message:String(e))}},z=async()=>{try{await (0,nu.gitAction)(e,"stash-save",{message:d||void 0}),h(""),rW.toast.success(r("git.stashSaved")),await D()}catch(e){rW.toast.error(e instanceof Error?e.message:String(e))}},$=async()=>{try{await (0,nu.gitAction)(e,"stash-pop",{index:0}),rW.toast.success(r("git.stashApplied")),await D()}catch(e){rW.toast.error(e instanceof Error?e.message:String(e))}},T=async()=>{try{await (0,nu.gitAction)(e,"discard-all"),rW.toast.success(r("git.discardSuccess")),await D()}catch(e){rW.toast.error(e instanceof Error?e.message:String(e))}},_=async r=>{if("deleted"!==r.status)try{let n=await (0,nu.gitAction)(e,"show",{file:r.file});t?.(r.file,n.content??"")}catch{t?.(r.file,"")}},O=n?.changedFiles.filter(e=>e.staged)??[],W=n?.changedFiles.filter(e=>!e.staged)??[],H=(0,i.useMemo)(()=>nf(O),[O]),G=(0,i.useMemo)(()=>nf(W),[W]);if(l)return(0,s.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,s.jsx)(c.Loader2,{className:"h-4 w-4 animate-spin text-muted-foreground"})});if(!n)return null;function K(e){let t=[];for(let r of e)r.isDir?t.push(...K(r.children)):r.file&&t.push(r.file.file);return t}let V=[...n?.branches??[],...(n?.remoteBranches??[]).filter(e=>!n?.branches?.includes(e))],U=C?V.filter(e=>e.toLowerCase().includes(C.toLowerCase())):V;return(0,s.jsxs)("div",{className:"flex flex-col h-full overflow-hidden",children:[(0,s.jsx)("div",{className:"shrink-0 px-2 pt-2 pb-1",children:(0,s.jsxs)("div",{className:"relative",ref:S,children:[(0,s.jsxs)("button",{onClick:()=>{k(!j),N("")},className:"flex w-full items-center justify-between rounded-md border border-border bg-muted/50 px-2 py-1.5 text-left transition-colors hover:bg-accent",children:[(0,s.jsxs)("div",{className:"flex items-center gap-1.5 min-w-0",children:[(0,s.jsx)(u.GitBranch,{className:"h-3 w-3 shrink-0 text-emerald-400"}),(0,s.jsx)("span",{className:"truncate font-mono text-xs text-foreground",children:n?.currentBranch||"—"})]}),(0,s.jsx)(rM.ChevronDown,{className:`h-3 w-3 shrink-0 text-muted-foreground transition-transform ${j?"rotate-180":""}`})]}),j&&(0,s.jsxs)("div",{className:"absolute left-0 right-0 top-full z-30 mt-1 rounded-lg border border-border bg-popover shadow-xl",children:[(0,s.jsx)("div",{className:"border-b border-border p-1.5",children:(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)(b.Search,{className:"absolute left-2 top-1/2 -translate-y-1/2 h-3 w-3 text-muted-foreground"}),(0,s.jsx)("input",{value:C,onChange:e=>N(e.target.value),placeholder:"Filter...",autoFocus:!0,className:"h-7 w-full rounded-md bg-muted/50 pl-7 pr-2 text-xs text-foreground placeholder-muted-foreground outline-none focus:ring-1 focus:ring-ring"})]})}),(0,s.jsxs)("div",{className:"max-h-48 overflow-auto py-1",children:[(n?.branches??[]).filter(e=>e.toLowerCase().includes(C.toLowerCase())).length>0&&(0,s.jsx)("p",{className:"px-3 pt-1 pb-0.5 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:r("git.localBranches")}),(n?.branches??[]).filter(e=>e.toLowerCase().includes(C.toLowerCase())).map(e=>{let t=e===n?.currentBranch;return(0,s.jsxs)("button",{onClick:()=>{t?k(!1):L(e)},className:`flex w-full items-center gap-2 px-3 py-1 text-left transition-colors ${t?"bg-emerald-500/10 text-emerald-400":"text-secondary-foreground hover:bg-accent"}`,children:[(0,s.jsx)(u.GitBranch,{className:"h-3 w-3 shrink-0"}),(0,s.jsx)("span",{className:"truncate font-mono text-xs",children:e}),t&&(0,s.jsx)(r6.Check,{className:"h-3 w-3 ml-auto shrink-0"})]},`local-${e}`)}),(n?.remoteBranches??[]).filter(e=>!n?.branches?.includes(e)).filter(e=>e.toLowerCase().includes(C.toLowerCase())).length>0&&(0,s.jsx)("p",{className:"px-3 pt-2 pb-0.5 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:r("git.remoteBranches")}),(n?.remoteBranches??[]).filter(e=>!n?.branches?.includes(e)).filter(e=>e.toLowerCase().includes(C.toLowerCase())).map(e=>(0,s.jsxs)("button",{onClick:()=>L(e),className:"flex w-full items-center gap-2 px-3 py-1 text-left text-secondary-foreground transition-colors hover:bg-accent",children:[(0,s.jsx)(ni.Globe,{className:"h-3 w-3 shrink-0 text-sky-400"}),(0,s.jsx)("span",{className:"truncate font-mono text-xs",children:e})]},`remote-${e}`)),0===U.length&&(0,s.jsx)("p",{className:"px-3 py-2 text-xs text-muted-foreground",children:"No branches found"})]}),(0,s.jsxs)("div",{className:"border-t border-border p-1.5 flex gap-1",children:[(0,s.jsxs)(ry.Button,{variant:"ghost",className:"flex-1 h-6 gap-1 text-[10px] text-muted-foreground",onClick:()=>{k(!1),k(!1),A(!0)},children:[(0,s.jsx)(ne.Plus,{className:"h-3 w-3"}),r("git.createBranch")]}),(0,s.jsxs)(ry.Button,{variant:"ghost",className:"h-6 gap-1 text-[10px] text-muted-foreground",onClick:F,disabled:y,children:[(0,s.jsx)(nr.RefreshCw,{className:`h-3 w-3 ${y?"animate-spin":""}`}),"Fetch"]})]})]})]})}),(0,s.jsxs)("div",{className:"shrink-0 px-2 pb-2 space-y-1.5 border-b border-border",children:[(0,s.jsx)("textarea",{value:d,onChange:e=>h(e.target.value),placeholder:r("git.commitMsgPlaceholder"),rows:3,className:"w-full rounded-md border border-border bg-background px-2 py-1.5 text-xs text-foreground placeholder-muted-foreground outline-none transition-colors focus:border-ring focus:ring-1 focus:ring-ring resize-none",onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&"Enter"===e.key&&P()}}),(0,s.jsxs)("div",{className:"flex items-center gap-1",children:[(0,s.jsxs)(ry.Button,{variant:"default",className:"flex-1 h-7 gap-1.5 text-xs",onClick:P,disabled:f||!d.trim()||0===O.length,children:[f?(0,s.jsx)(c.Loader2,{className:"h-3 w-3 animate-spin"}):(0,s.jsx)(r6.Check,{className:"h-3 w-3"}),r("git.commit")]}),(0,s.jsxs)(nl.DropdownMenu,{children:[(0,s.jsx)(nl.DropdownMenuTrigger,{render:(0,s.jsx)(ry.Button,{variant:"outline",size:"icon-xs",className:"h-7 w-7 shrink-0"}),children:(0,s.jsx)(nt.MoreHorizontal,{className:"h-3.5 w-3.5"})}),(0,s.jsxs)(nl.DropdownMenuContent,{align:"end",side:"bottom",className:"w-52",children:[(0,s.jsxs)(nl.DropdownMenuGroup,{children:[(0,s.jsx)(nl.DropdownMenuLabel,{children:r("git.commit")}),(0,s.jsxs)(nl.DropdownMenuItem,{onClick:P,disabled:!d.trim()||0===O.length,children:[(0,s.jsx)(r6.Check,{className:"h-3.5 w-3.5 mr-2"}),r("git.commit")]})]}),(0,s.jsx)(nl.DropdownMenuSeparator,{}),(0,s.jsxs)(nl.DropdownMenuGroup,{children:[(0,s.jsx)(nl.DropdownMenuLabel,{children:r("git.changes")}),(0,s.jsxs)(nl.DropdownMenuItem,{onClick:()=>M(K(G)),disabled:0===W.length,children:[(0,s.jsx)(ne.Plus,{className:"h-3.5 w-3.5 mr-2"}),r("git.stageAll")]}),(0,s.jsxs)(nl.DropdownMenuItem,{onClick:()=>I(K(H)),disabled:0===O.length,children:[(0,s.jsx)(r9,{className:"h-3.5 w-3.5 mr-2"}),r("git.unstageAll")]}),(0,s.jsxs)(nl.DropdownMenuItem,{onClick:T,disabled:0===W.length,children:[(0,s.jsx)(ns,{className:"h-3.5 w-3.5 mr-2"}),r("git.discardAll")]})]}),(0,s.jsx)(nl.DropdownMenuSeparator,{}),(0,s.jsxs)(nl.DropdownMenuGroup,{children:[(0,s.jsx)(nl.DropdownMenuLabel,{children:r("git.sync")}),(0,s.jsxs)(nl.DropdownMenuItem,{onClick:()=>R(),disabled:p,children:[(0,s.jsx)(r8,{className:"h-3.5 w-3.5 mr-2"}),r("git.pull")]}),(0,s.jsxs)(nl.DropdownMenuItem,{onClick:()=>B(),disabled:g,children:[(0,s.jsx)(r7,{className:"h-3.5 w-3.5 mr-2"}),r("git.push")]}),(0,s.jsxs)(nl.DropdownMenuSub,{children:[(0,s.jsxs)(nl.DropdownMenuSubTrigger,{disabled:p,children:[(0,s.jsx)(r8,{className:"h-3.5 w-3.5 mr-2"}),r("git.pullFrom"),"..."]}),(0,s.jsxs)(nl.DropdownMenuSubContent,{className:"max-h-60 overflow-y-auto",children:[(0,s.jsxs)(nl.DropdownMenuItem,{onClick:()=>R(),children:[(0,s.jsx)(u.GitBranch,{className:"h-3 w-3 mr-2 text-emerald-400"}),n.currentBranch,n.behind>0&&(0,s.jsxs)("span",{className:"ml-auto text-[10px] text-muted-foreground",children:["↓",n.behind]})]}),n.remoteBranches.filter(e=>e!==n.currentBranch).map(e=>(0,s.jsxs)(nl.DropdownMenuItem,{onClick:()=>R(e),children:[(0,s.jsx)(u.GitBranch,{className:"h-3 w-3 mr-2 text-sky-400"}),e]},e))]})]}),(0,s.jsxs)(nl.DropdownMenuSub,{children:[(0,s.jsxs)(nl.DropdownMenuSubTrigger,{disabled:g,children:[(0,s.jsx)(r7,{className:"h-3.5 w-3.5 mr-2"}),r("git.pushTo"),"..."]}),(0,s.jsxs)(nl.DropdownMenuSubContent,{className:"max-h-60 overflow-y-auto",children:[(0,s.jsxs)(nl.DropdownMenuItem,{onClick:()=>B(),children:[(0,s.jsx)(u.GitBranch,{className:"h-3 w-3 mr-2 text-emerald-400"}),n.currentBranch,n.ahead>0&&(0,s.jsxs)("span",{className:"ml-auto text-[10px] text-muted-foreground",children:["↑",n.ahead]})]}),n.remoteBranches.filter(e=>e!==n.currentBranch).map(e=>(0,s.jsxs)(nl.DropdownMenuItem,{onClick:()=>B(e),children:[(0,s.jsx)(u.GitBranch,{className:"h-3 w-3 mr-2 text-sky-400"}),e]},e))]})]}),(0,s.jsxs)(nl.DropdownMenuItem,{onClick:F,disabled:y,children:[(0,s.jsx)(nr.RefreshCw,{className:`h-3.5 w-3.5 mr-2 ${y?"animate-spin":""}`}),r("git.fetchAll")]})]}),(0,s.jsx)(nl.DropdownMenuSeparator,{}),(0,s.jsxs)(nl.DropdownMenuGroup,{children:[(0,s.jsx)(nl.DropdownMenuLabel,{children:r("git.stash")}),(0,s.jsxs)(nl.DropdownMenuItem,{onClick:z,disabled:0===n.changedFiles.length,children:[(0,s.jsx)(nn.Archive,{className:"h-3.5 w-3.5 mr-2"}),r("git.stashSave")]}),(0,s.jsxs)(nl.DropdownMenuItem,{onClick:$,children:[(0,s.jsx)(na.ArrowUpFromLine,{className:"h-3.5 w-3.5 mr-2"}),r("git.stashPopLatest")]})]}),(0,s.jsx)(nl.DropdownMenuSeparator,{}),(0,s.jsxs)(nl.DropdownMenuItem,{disabled:!0,className:"text-muted-foreground",children:[(0,s.jsx)(u.GitBranch,{className:"h-3.5 w-3.5 mr-2"}),n.currentBranch]})]})]})]})]}),(0,s.jsxs)(rb.ScrollArea,{className:"flex-1 min-h-0",children:[(0,s.jsx)(np,{label:r("git.stagedChanges"),count:O.length,labelColor:"text-emerald-400",tree:H,batchAction:()=>I(K(H)),batchLabel:r("git.unstageAll"),batchIcon:(0,s.jsx)(r9,{className:"h-3 w-3"}),onFileClick:_,onFileAction:e=>I([e]),fileActionIcon:"−"}),(0,s.jsx)(np,{label:r("git.unstagedChanges"),count:W.length,labelColor:"text-muted-foreground",tree:G,batchAction:()=>M(K(G)),batchLabel:r("git.stageAll"),batchIcon:(0,s.jsx)(ne.Plus,{className:"h-3 w-3"}),onFileClick:_,onFileAction:e=>M([e]),fileActionIcon:"+"}),0===n.changedFiles.length&&(0,s.jsxs)("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[(0,s.jsx)(r6.Check,{className:"h-5 w-5 text-emerald-400 mb-2"}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:r("git.noChanges")})]})]}),(0,s.jsx)(no.CreateBranchDialog,{open:E,onOpenChange:A,branches:[...n?.branches??[],...n?.remoteBranches??[]],currentBranch:n?.currentBranch??"",localPath:e,onCreated:async()=>{rW.toast.success(r("git.createSuccess")),await D()},onError:e=>rW.toast.error(`${r("git.createFailed")}: ${e}`)})]})}function np({label:e,count:t,labelColor:r,tree:n,batchAction:a,batchLabel:l,batchIcon:o,onFileClick:u,onFileAction:c,fileActionIcon:d}){let[h,f]=(0,i.useState)(!0);return 0===t?null:(0,s.jsxs)("div",{className:"border-b border-border",children:[(0,s.jsxs)("div",{className:"group flex items-center justify-between px-2 py-1.5 hover:bg-accent/50 transition-colors",children:[(0,s.jsxs)("button",{onClick:()=>f(!h),className:"flex items-center gap-1 flex-1 min-w-0",children:[h?(0,s.jsx)(rM.ChevronDown,{className:"h-3 w-3 shrink-0 text-muted-foreground"}):(0,s.jsx)(rD.ChevronRight,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),(0,s.jsxs)("span",{className:`text-[10px] font-semibold uppercase tracking-wider ${r}`,children:[e," (",t,")"]})]}),(0,s.jsx)(ry.Button,{variant:"ghost",size:"icon-xs",onClick:a,className:"text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity","aria-label":l,children:o})]}),h&&(0,s.jsx)("div",{className:"pb-1",children:n.map(e=>(0,s.jsx)(nx,{node:e,depth:0,onFileClick:u,onFileAction:c,fileActionIcon:d},e.path))})]})}function nx({node:e,depth:t,onFileClick:r,onFileAction:n,fileActionIcon:a}){let[l,o]=(0,i.useState)(!0),u=8+12*t;if(e.isDir)return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("button",{onClick:()=>o(!l),className:"flex w-full items-center gap-1 py-0.5 hover:bg-accent/50 transition-colors text-left",style:{paddingLeft:u},children:[l?(0,s.jsx)(rM.ChevronDown,{className:"h-3 w-3 shrink-0 text-muted-foreground"}):(0,s.jsx)(rD.ChevronRight,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),(0,s.jsx)(tR.Folder,{className:"h-3 w-3 shrink-0 text-amber-400/70"}),(0,s.jsx)("span",{className:"text-xs text-muted-foreground truncate",children:e.name})]}),l&&e.children.sort((e,t)=>e.isDir!==t.isDir?e.isDir?-1:1:e.name.localeCompare(t.name)).map(e=>(0,s.jsx)(nx,{node:e,depth:t+1,onFileClick:r,onFileAction:n,fileActionIcon:a},e.path))]});let c=e.file,d=nc[c.status]||tF,h=nd[c.status]||"text-muted-foreground",f=nh[c.status]||"?";return(0,s.jsxs)("div",{className:"group flex items-center gap-1 py-0.5 hover:bg-accent/50 transition-colors cursor-pointer",style:{paddingLeft:u+16},onClick:()=>r(c),children:[(0,s.jsx)(d,{className:`h-3 w-3 shrink-0 ${h}`}),(0,s.jsx)("span",{className:"text-xs text-foreground truncate flex-1",children:e.name}),(0,s.jsx)("span",{className:`text-[10px] font-mono font-bold shrink-0 mr-1 ${h}`,children:f}),(0,s.jsx)("button",{onClick:e=>{e.stopPropagation(),n(c.file)},className:"shrink-0 rounded px-1 text-xs font-mono text-muted-foreground opacity-0 group-hover:opacity-100 hover:bg-background hover:text-foreground transition-all mr-1",children:a})]})}var ng=e.i(610874);let nb=(0,rZ.createServerReference)("70e50ae672d6b8f8288428bdce7739074013d9f455",rZ.callServer,void 0,rZ.findSourceMapURL,"startPreview"),nv=(0,rZ.createServerReference)("40be9587b13948e1070997791235f8a13eabae227b",rZ.callServer,void 0,rZ.findSourceMapURL,"stopPreview");var ny=e.i(862087),nw=e.i(31459);let nj=["pnpm","npm","yarn"];function nk(e){if(!e)return{pm:"pnpm",script:"dev"};let t=e.trim().split(/\s+/),r=nj.includes(t[0])?t[0]:"pnpm",n=t.slice(1);return{pm:r,script:"run"===n[0]?n[1]??"dev":n[0]??"dev"}}function nC({status:e}){return"running"===e?(0,s.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-400 inline-block"}):"error"===e?(0,s.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-red-400 inline-block"}):"starting"===e?(0,s.jsx)(c.Loader2,{className:"h-3 w-3 animate-spin inline-block"}):(0,s.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-muted-foreground/50 inline-block"})}function nN({taskId:e,worktreePath:t,previewCommand:r,previewPort:n,refreshKey:a,projectId:l,previewUrl:o,onPreviewUrlChange:u}){let{t:d}=(0,rw.useI18n)(),[h,f]=(0,i.useState)("stopped"),[x,g]=(0,i.useState)(""),[b,v]=(0,i.useState)(o??""),[y,w]=(0,i.useState)(o??""),[j,k]=(0,i.useState)(0),C=nk(r),[N,S]=(0,i.useState)(C.pm),[E,A]=(0,i.useState)(C.script),[D,M]=(0,i.useState)(n??5173);(0,i.useEffect)(()=>{let e=nk(r);S(e.pm),A(e.script)},[r]),(0,i.useEffect)(()=>{null!=n&&M(n)},[n]),(0,i.useEffect)(()=>{o&&(v(o),w(o))},[o]);let I=(0,i.useRef)(e);I.current=e,(0,i.useEffect)(()=>()=>{nv(I.current).catch(()=>{})},[]);let P=(()=>{switch(h){case"running":return d("preview.statusRunning");case"starting":return d("preview.statusStarting");case"error":return d("preview.statusError");default:return d("preview.statusStopped")}})(),R=`${N} ${E}`;async function B(){await (0,nw.updateProject)(l,{previewCommand:R,previewPort:D})}async function F(){if(t&&E){f("starting"),g("");try{await B();let r=await nb(e,R,t);if(r.started){if(f("running"),!b){let e=`http://localhost:${D}`;v(e),w(e),u?.(e)}}else f("error"),g(r.error??"")}catch(e){f("error"),g(String(e))}}}async function L(){await nv(e),f("stopped")}async function z(){if(t)try{await (0,ny.openInTerminal)(t)}catch{f("error"),g(d("preview.terminalError"))}}return t?(0,s.jsxs)("div",{className:"flex h-full flex-col",children:[(0,s.jsxs)("div",{className:"flex h-11 shrink-0 items-center gap-2 border-b border-border bg-card px-3",children:[(0,s.jsxs)("span",{className:`inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-xs ${function(e){switch(e){case"running":return"text-emerald-400 bg-emerald-500/10 border border-emerald-500/20";case"error":return"text-red-400 bg-red-500/10 border border-red-500/20";default:return"text-muted-foreground bg-muted border border-transparent"}}(h)}`,children:[(0,s.jsx)(nC,{status:h}),P]}),"running"===h?(0,s.jsx)(ry.Button,{variant:"destructive",onClick:L,children:d("preview.stop")}):(0,s.jsxs)(ry.Button,{variant:"default",disabled:"starting"===h||!E||!t,onClick:F,children:["starting"===h&&(0,s.jsx)(c.Loader2,{className:"mr-1 h-3 w-3 animate-spin"}),d("preview.run")]}),(0,s.jsx)("div",{className:"flex-1"}),(0,s.jsx)(ry.Button,{variant:"ghost",size:"icon",className:"h-8 w-8",title:d("preview.refresh"),onClick:()=>{y&&k(e=>e+1)},children:(0,s.jsx)(nr.RefreshCw,{className:"h-4 w-4"})}),(0,s.jsx)(ry.Button,{variant:"ghost",size:"icon",className:"h-8 w-8",title:d("preview.openTerminal"),disabled:!t,onClick:z,children:(0,s.jsx)(p.Terminal,{className:"h-4 w-4"})})]}),"error"===h&&x&&(0,s.jsxs)("div",{className:"border-b border-border bg-red-500/10 px-3 py-1 text-xs text-red-400",children:[d("preview.errorDesc"),": ",x]}),(0,s.jsxs)("div",{className:"flex shrink-0 items-center gap-2 border-b border-border bg-card px-3 py-1.5",children:[(0,s.jsxs)(ng.Select,{value:N,onValueChange:e=>{e&&(S(e),setTimeout(B,0))},children:[(0,s.jsx)(ng.SelectTrigger,{className:"h-7 w-auto min-w-[80px] text-xs",children:(0,s.jsx)("span",{children:N})}),(0,s.jsx)(ng.SelectContent,{children:nj.map(e=>(0,s.jsx)(ng.SelectItem,{value:e,children:e},e))})]}),(0,s.jsx)("span",{className:"text-xs text-muted-foreground",children:"run"}),(0,s.jsx)("input",{type:"text",value:E,onChange:e=>A(e.target.value),onBlur:B,placeholder:"dev",className:"h-7 w-24 rounded border border-border bg-background px-2 text-xs font-mono focus:outline-none focus:ring-1 focus:ring-primary"}),(0,s.jsx)("span",{className:"text-xs text-muted-foreground",children:d("preview.port")}),(0,s.jsx)("input",{type:"number",value:D,onChange:e=>M(parseInt(e.target.value,10)||0),onBlur:B,placeholder:"5173",className:"h-7 w-20 rounded border border-border bg-background px-2 text-xs font-mono focus:outline-none focus:ring-1 focus:ring-primary"})]}),(0,s.jsx)("div",{className:"flex shrink-0 items-center border-b border-border bg-background px-3 py-1",children:(0,s.jsx)("input",{type:"text",value:b,onChange:e=>v(e.target.value),onKeyDown:function(e){"Enter"===e.key&&(w(b),u?.(b))},placeholder:d("preview.addressPlaceholder"),className:"h-8 w-full rounded border border-border bg-background px-2 text-xs font-mono focus:outline-none focus:ring-1 focus:ring-primary"})}),(0,s.jsx)("div",{className:"flex-1 overflow-hidden",children:(0,s.jsx)("iframe",{src:y||void 0,className:"h-full w-full border-0",allow:"clipboard-read; clipboard-write",referrerPolicy:"no-referrer-when-downgrade",title:"Preview"},`${a}-${j}`)})]}):(0,s.jsxs)("div",{className:"flex h-full flex-col items-center justify-center gap-3 p-8 text-center",children:[(0,s.jsx)(m.Eye,{className:"h-10 w-10 text-muted-foreground/40"}),(0,s.jsx)("h3",{className:"text-sm font-medium text-foreground",children:d("preview.noWorktree")}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:d("preview.noWorktreeDesc")})]})}var nS=e.i(203529),nE=e.i(743e3),nA=e.i(311773),nD=e.i(540984),nM=e.i(782988),nI=e.i(124993),nP=e.i(307081),nR=e.i(686693),nB=e.i(648834),nF=e.i(773620),nL=e.i(612758),nz=e.i(79769);let n$={TODO:"待处理",IN_PROGRESS:"执行中",IN_REVIEW:"待评审",DONE:"已完成",CANCELLED:"已取消"},nT={TODO:"bg-muted text-muted-foreground",IN_PROGRESS:"bg-blue-500/10 text-blue-400 border border-blue-500/20",IN_REVIEW:"bg-amber-500/10 text-amber-400 border border-amber-500/20",DONE:"bg-emerald-500/10 text-emerald-400 border border-emerald-500/20",CANCELLED:"bg-muted text-muted-foreground"};e.s(["TaskPageClient",0,function({task:e,workspaceId:t,workspaceName:r,latestExecution:n,executions:a=[]}){let d,j,k=(0,l.useRouter)(),{t:C}=(0,rw.useI18n)(),{removePortal:N}=(0,nz.useTerminalPortal)(),[S,E]=(0,i.useState)(e.status),[A,D]=(0,i.useState)(null),[M,I]=(0,i.useState)(!1),[P,B]=(0,i.useState)(null),[F,L]=(0,i.useState)(null),[z,$]=(0,i.useState)(null),[T,_]=(0,i.useState)(null),[O,W]=(0,i.useState)(0),[H,G]=(0,i.useState)(""),[K,V]=(0,i.useState)(!1),[U,Y]=(0,i.useState)([]),[q,J]=(0,i.useState)(null),[X,Q]=(0,i.useState)(n?.status==="RUNNING"?n?.worktreePath??null:null),Z=e.project?.localPath?e.subPath?`${e.project.localPath}/${e.subPath}`:e.project.localPath:null,ee=n?.worktreePath??Z;(0,i.useEffect)(()=>{let e=!1;return(0,nF.getPrompts)().then(t=>{if(e)return;Y(t.map(e=>({id:e.id,name:e.name,isDefault:e.isDefault})));let r=t.find(e=>e.isDefault);r&&J(r.id)}),()=>{e=!0}},[]),(0,i.useEffect)(()=>{let t=!1;return(0,nI.getTaskExecutions)(e.id).then(r=>{if(t)return;let n=r[0];if(n?.status==="RUNNING"){let t=n.worktreePath||e.project?.localPath||null;t&&Q(t)}}),()=>{t=!0}},[e.id,e.project?.localPath]),(0,i.useEffect)(()=>{if("TODO"===S||"CANCELLED"===S)return;let t=!1;return I(!0),fetch(`/api/tasks/${e.id}/diff`).then(e=>{if(!e.ok)throw Error(`HTTP ${e.status}`);return e.json()}).then(e=>{if(!t){if(!e.files&&!e.branchDeleted)return void D(null);D(e)}}).catch(()=>{t||(D(null),rW.toast.error(C("taskPage.loadDiffFailed")))}).finally(()=>{t||I(!1)}),()=>{t=!0}},[e.id,S]);let et=(0,i.useCallback)(async()=>{if(!K){V(!0);try{let{worktreePath:t}=await (0,nE.startPtyExecution)(e.id,"",q);Q(t)}catch(e){V(!1),rW.toast.error(e instanceof Error?e.message:String(e))}}},[e.id,K,q]),er=(0,i.useCallback)(t=>{V(!1),Q(null),N(e.id),0===t&&E("IN_REVIEW"),k.refresh()},[k,N,e.id]),en=(0,i.useCallback)(async()=>{await (0,nA.stopPtyExecution)(e.id),V(!1),Q(null),E("IN_REVIEW"),k.refresh()},[e.id,k]),ea=(0,i.useCallback)(async t=>{V(!0),N(e.id),Q(null);try{let{worktreePath:r}=await (0,nD.resumePtyExecution)(e.id,t);Q(r),E("IN_PROGRESS")}catch{V(!1)}},[e.id,N]),es=(0,i.useCallback)(async()=>{V(!0),N(e.id),Q(null);try{let{worktreePath:t}=await (0,nM.continueLatestPtyExecution)(e.id);Q(t),E("IN_PROGRESS")}catch(e){V(!1),rW.toast.error(e instanceof Error?e.message:String(e))}},[e.id]),ei=(0,i.useCallback)(()=>{E("DONE"),eo(!1),rW.toast.success(C("taskPage.taskCompleted")),fetch(`/api/tasks/${e.id}/diff`).then(e=>{if(e.ok)return e.json()}).then(e=>{e?.files&&D(e)}).catch(()=>{rW.toast.error(C("taskPage.loadDiffFailed"))}),k.refresh()},[k,C,e.id]),[el,eo]=(0,i.useState)(!1),[eu,ec]=(0,i.useState)([]),ed=(0,i.useCallback)(async()=>{try{let t=await (0,nR.checkWorktreeClean)(e.id);if(t.hasWorktree&&!t.clean)return void rW.toast.error(C("taskPage.uncommittedChanges",{count:String(t.files.length)}));if(t.hasWorktree&&t.clean&&!t.hasCommits)return void rW.toast.error(C("taskPage.noChangesToComplete"));if(t.hasWorktree&&t.hasCommits){ec(t.commitLog),eo(!0);return}await (0,nP.updateTaskStatus)(e.id,"DONE"),E("DONE"),k.refresh(),rW.toast.success(C("taskPage.taskCompleted"))}catch(e){rW.toast.error(e instanceof Error?e.message:String(e))}},[e.id,k,C,n]),eh=(0,i.useCallback)(async t=>{try{let{hash:r}=await (0,nB.commitWorktreeChanges)(e.id,t);rW.toast.success(C("diff.commitSuccess",{hash:r})),k.refresh();let n=await fetch(`/api/tasks/${e.id}/diff`);if(n.ok){let e=await n.json();D(e?.files?e:null)}}catch(e){rW.toast.error(e instanceof Error?e.message:"Commit failed")}},[e.id,k,C]);return(0,s.jsxs)(eL,{direction:"horizontal",className:"h-screen bg-background",children:[(0,s.jsxs)(R,{defaultSize:35,minSize:20,className:"flex flex-col border-r border-border bg-sidebar",children:[(0,s.jsxs)("div",{className:"header-lg px-4 py-3",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsxs)(w.default,{href:`/workspaces/${t}?projectId=${e.projectId}&taskId=${e.id}`,className:"flex shrink-0 items-center justify-center rounded-md border border-border bg-muted px-1.5 py-1 text-xs text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",children:[(0,s.jsx)(o.ArrowLeft,{className:"mr-1 h-3 w-3"}),C("taskPage.back")]}),(0,s.jsxs)("div",{className:"flex min-w-0 items-center gap-1 text-sm text-muted-foreground",children:[(0,s.jsx)("span",{className:"shrink-0",children:r}),e.project&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"shrink-0",children:"/"}),(0,s.jsx)("span",{className:"shrink-0",children:e.project.name})]}),(0,s.jsx)("span",{className:"shrink-0",children:"/"}),(0,s.jsx)("span",{className:"truncate font-semibold text-foreground",children:e.title})]})]}),(0,s.jsxs)("div",{className:"mt-2 flex items-center gap-2",children:[(0,s.jsx)("span",{className:`inline-flex items-center rounded-full px-2 py-0.5 text-[10px] font-medium ${nT[S]??"bg-muted text-muted-foreground"}`,children:n$[S]??S}),(e.baseBranch||n?.worktreeBranch)&&(0,s.jsxs)(nS.Badge,{variant:"secondary",className:"gap-1 border border-border bg-muted font-mono text-[10px] text-muted-foreground",children:[(0,s.jsx)(u.GitBranch,{className:"h-2.5 w-2.5"}),e.baseBranch??n?.worktreeBranch]})]}),(0,s.jsx)("div",{className:"border-t border-transparent",children:"IN_REVIEW"===S&&(0,s.jsx)("div",{className:"mt-2",children:(0,s.jsxs)(ry.Button,{size:"sm",onClick:ed,className:"bg-emerald-500/15 text-emerald-400 ring-1 ring-emerald-500/20 hover:bg-emerald-500/25",children:[(0,s.jsx)(g.CheckCircle2,{className:"h-3.5 w-3.5"}),C("taskPage.completeTask")]})})})]}),(0,s.jsx)("div",{className:"flex-1 min-h-0 overflow-hidden",children:X?(0,s.jsxs)("div",{className:"flex h-full flex-col overflow-hidden",children:[(0,s.jsxs)("div",{className:"header-xs shrink-0 flex items-center justify-between border-b-neutral-800 px-3 py-1.5 bg-[#0a0a0a]",children:[(0,s.jsxs)("span",{className:"flex items-center gap-1.5 text-xs text-emerald-400",children:[(0,s.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-400 animate-pulse"}),C("execution.running")]}),(0,s.jsxs)(y.Tooltip,{children:[(0,s.jsxs)(y.TooltipTrigger,{onClick:en,className:"flex items-center gap-1.5 rounded-md bg-red-500/15 px-3 py-1 text-xs font-medium text-red-400 hover:bg-red-500/25 transition-colors",children:[(0,s.jsx)(x.Square,{className:"h-3 w-3"}),C("terminal.stopExecution")]}),(0,s.jsx)(y.TooltipContent,{side:"bottom",children:C("terminal.stopHint")})]})]}),(0,s.jsx)("div",{className:"flex-1 min-h-0",children:(0,s.jsx)(nz.TerminalOutlet,{taskId:e.id,worktreePath:X,onSessionEnd:er,onFileOpen:e=>{B(e),_("files")}})})]}):"DONE"===S||"CANCELLED"===S?(0,s.jsx)("div",{className:"flex h-full flex-col overflow-hidden bg-[#0a0a0a]",children:(0,s.jsx)("div",{className:"flex-1 min-h-0 overflow-y-auto",children:(0,s.jsx)(nL.ExecutionTimeline,{executions:a})})}):(0,s.jsxs)("div",{className:"flex h-full flex-col overflow-hidden bg-[#0a0a0a]",children:[(0,s.jsxs)("div",{className:"header-xs shrink-0 flex items-center gap-3 border-b-neutral-800 px-4 py-1.5",children:[U.length>0&&(0,s.jsxs)(ng.Select,{defaultValue:q??"none",onValueChange:e=>J("none"===e?null:e),children:[(0,s.jsx)(ng.SelectTrigger,{size:"sm",className:"min-w-[140px]",children:(0,s.jsx)("span",{className:"text-left truncate",children:q?U.find(e=>e.id===q)?.name??C("terminal.noPrompt"):C("terminal.noPrompt")})}),(0,s.jsxs)(ng.SelectContent,{className:"min-w-[200px]",children:[(0,s.jsx)(ng.SelectItem,{value:"none",children:C("terminal.noPrompt")}),U.map(e=>(0,s.jsxs)(ng.SelectItem,{value:e.id,children:[e.name,e.isDefault?" ★":""]},e.id))]})]},`prompt-${U.length}`),(0,s.jsxs)(ry.Button,{onClick:et,disabled:K,size:"sm",className:"gap-2 px-4",children:[K?(0,s.jsx)(c.Loader2,{className:"h-3.5 w-3.5 animate-spin"}):(0,s.jsx)(p.Terminal,{className:"h-3.5 w-3.5"}),K?C("terminal.executing"):C("terminal.launch")]})]}),(0,s.jsx)("div",{className:"flex-1 min-h-0 overflow-y-auto",children:(0,s.jsx)(nL.ExecutionTimeline,{executions:a,onResume:ea,onContinueLatest:es})})]})})]}),(0,s.jsx)(eT,{className:"relative w-px bg-border transition-colors hover:bg-primary/20 active:bg-primary/40 cursor-col-resize"}),(0,s.jsx)(R,{defaultSize:65,minSize:20,className:"flex flex-col",children:(j=(d="DONE"===S&&!!e.baseBranch)?"changes":"files",(0,s.jsxs)(tN,{value:T??j,onValueChange:_,className:"flex h-full flex-col gap-0",children:[(0,s.jsx)("div",{className:"header-lg flex shrink-0 items-center px-3 py-3",children:(0,s.jsxs)(tE,{className:"h-auto border border-border",children:[!d&&(0,s.jsxs)(tA,{value:"files",className:"data-active:bg-background data-active:text-foreground data-active:shadow-sm dark:data-active:bg-background dark:data-active:border-transparent",children:[(0,s.jsx)(h,{className:"h-3.5 w-3.5"}),C("taskPage.tabFiles")]}),(0,s.jsxs)(tA,{value:"changes",className:"data-active:bg-background data-active:text-foreground data-active:shadow-sm dark:data-active:bg-background dark:data-active:border-transparent",children:[(0,s.jsx)(f.GitCompare,{className:"h-3.5 w-3.5"}),C("taskPage.changes")]}),!d&&e.project?.projectType!=="BACKEND"&&(0,s.jsxs)(tA,{value:"preview",className:"data-active:bg-background data-active:text-foreground data-active:shadow-sm dark:data-active:bg-background dark:data-active:border-transparent",children:[(0,s.jsx)(m.Eye,{className:"h-3.5 w-3.5"}),C("taskPage.tabPreview")]})]})}),(0,s.jsx)(tD,{value:"files",className:"flex-1 min-h-0 overflow-hidden",children:(0,s.jsxs)("div",{className:"flex h-full flex-row overflow-hidden",children:[(0,s.jsx)("div",{className:"w-60 flex-none border-r border-border overflow-hidden flex flex-col",children:(0,s.jsxs)(tN,{defaultValue:"filetree",className:"flex h-full flex-col gap-0",children:[(0,s.jsx)("div",{className:"header-xs flex shrink-0 px-2 py-1.5",children:(0,s.jsxs)(tE,{className:"h-auto border border-border w-full",children:[(0,s.jsxs)(tA,{value:"filetree",className:"flex-1 text-xs gap-1 data-active:bg-background data-active:text-foreground data-active:shadow-sm dark:data-active:bg-background dark:data-active:border-transparent",children:[(0,s.jsx)(h,{className:"h-3 w-3"}),C("taskPage.tabFileTree")]}),(0,s.jsxs)(tA,{value:"search",className:"flex-1 text-xs gap-1 data-active:bg-background data-active:text-foreground data-active:shadow-sm dark:data-active:bg-background dark:data-active:border-transparent",children:[(0,s.jsx)(b.Search,{className:"h-3 w-3"}),C("taskPage.tabSearch")]}),(0,s.jsxs)(tA,{value:"git",className:"flex-1 text-xs gap-1 data-active:bg-background data-active:text-foreground data-active:shadow-sm dark:data-active:bg-background dark:data-active:border-transparent",children:[(0,s.jsx)(v,{className:"h-3 w-3"}),C("git.tabLabel")]})]})}),(0,s.jsx)(tD,{value:"filetree",className:"flex-1 min-h-0 overflow-hidden mt-0",children:(0,s.jsx)(r$,{worktreePath:ee??null,baseBranch:e.baseBranch??null,worktreeBranch:n?.worktreeBranch??null,executionStatus:n?.status??"COMPLETED",onFileSelect:e=>{B(e),L(null)}})}),(0,s.jsx)(tD,{value:"search",className:"flex-1 min-h-0 overflow-hidden mt-0",children:(0,s.jsx)(r1,{localPath:ee??e.project?.localPath??null,onResultSelect:(e,t)=>{B(e),L(t),_("files")}})}),(0,s.jsx)(tD,{value:"git",className:"flex-1 min-h-0 overflow-hidden mt-0",children:(0,s.jsx)(nm,{localPath:ee??e.project?.localPath??"",onFileSelect:(e,t)=>{$({relativePath:e,originalContent:t})}})})]})}),(0,s.jsx)("div",{className:"flex-1 min-w-0 overflow-hidden",children:ee?(0,s.jsx)(rX,{worktreePath:ee,selectedFilePath:P,selectedLine:F,onFilePathChange:B,onSave:()=>W(e=>e+1),diffFileRequest:z}):(0,s.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:C("editor.noWorktree")})})})]})}),(0,s.jsx)(tD,{value:"changes",className:"flex-1 min-h-0 overflow-auto",children:M?(0,s.jsxs)("div",{className:"flex h-full flex-col items-center justify-center gap-2",children:[(0,s.jsx)(c.Loader2,{className:"size-5 animate-spin text-muted-foreground"}),(0,s.jsx)("span",{className:"text-xs text-muted-foreground",children:C("taskPage.loadingDiff")})]}):A?.branchDeleted?(0,s.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:C("taskPage.branchDeleted")})}):A?(0,s.jsx)(tM.TaskDiffView,{files:A.files,totalAdded:A.totalAdded,totalRemoved:A.totalRemoved,hasConflicts:A.hasConflicts,conflictFiles:A.conflictFiles,onCommit:eh,hasUncommitted:A.hasUncommitted}):(0,s.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"TODO"===S?C("taskPage.startExecution"):C("taskPage.noDiff")})})}),(0,s.jsx)(tD,{value:"preview",className:"flex-1 min-h-0 overflow-hidden",children:(0,s.jsx)(nN,{taskId:e.id,worktreePath:n?.worktreePath??null,previewCommand:e.project?.previewCommand??null,previewPort:e.project?.previewPort??null,refreshKey:O,projectId:e.projectId,previewUrl:H,onPreviewUrlChange:G})})]},j))}),(0,s.jsx)(tI.TaskMergeConfirmDialog,{open:el,onOpenChange:eo,taskId:e.id,taskTitle:e.title,baseBranch:e.baseBranch??"main",fileCount:A?.files?.length??0,commitCount:A?.commitCount??0,commitLog:eu,onMergeComplete:ei})]})}],839178)}]);